effect 4.0.0-beta.4 → 4.0.0-beta.41
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/Array.d.ts +213 -385
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +149 -102
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +82 -45
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +87 -38
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +39 -32
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +32 -29
- package/dist/BigInt.js.map +1 -1
- package/dist/Brand.d.ts +1 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +2 -2
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +6 -5
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +33 -2
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +19 -0
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +130 -35
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +96 -45
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +112 -304
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +56 -88
- package/dist/Chunk.js.map +1 -1
- package/dist/Combiner.d.ts +280 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +198 -7
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +169 -9
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +69 -11
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +11 -7
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +120 -63
- package/dist/Cron.js.map +1 -1
- package/dist/Data.d.ts +535 -366
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +132 -79
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +72 -253
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +15 -60
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +7 -5
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +7 -5
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +62 -32
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +108 -78
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +1225 -951
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +398 -338
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +194 -0
- package/dist/Encoding.d.ts.map +1 -0
- package/dist/Encoding.js +352 -0
- package/dist/Encoding.js.map +1 -0
- package/dist/Equal.d.ts +276 -109
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +124 -48
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +60 -3
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +70 -13
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +374 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +245 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/Exit.d.ts +24 -12
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -4
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +5 -3
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +9 -8
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +8 -7
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +20 -19
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +6 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FileSystem.d.ts +18 -17
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +17 -13
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +34 -38
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +15 -13
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +131 -47
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +229 -51
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +1 -9
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +2 -10
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +65 -65
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +60 -62
- package/dist/Graph.js.map +1 -1
- package/dist/HashMap.d.ts +26 -19
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +7 -5
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +50 -50
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +106 -34
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonSchema.d.ts +299 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +323 -4
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +175 -0
- package/dist/Latch.d.ts.map +1 -0
- package/dist/Latch.js +130 -0
- package/dist/Latch.js.map +1 -0
- package/dist/Layer.d.ts +306 -129
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +93 -48
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +9 -8
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +3 -3
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +32 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +28 -100
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +29 -95
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +2 -3
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +2 -2
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +21 -9
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts +4 -6
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +3 -5
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +7 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +8 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +7 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +8 -0
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/Newtype.d.ts +291 -0
- package/dist/Newtype.d.ts.map +1 -0
- package/dist/Newtype.js +161 -0
- package/dist/Newtype.js.map +1 -0
- package/dist/Number.d.ts +74 -18
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +34 -15
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +947 -18
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +454 -5
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +25 -16
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +15 -9
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -1
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +19 -14
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +146 -15
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +174 -61
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Pipeable.d.ts +17 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +19 -1
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +10 -9
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +2 -2
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +6 -4
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +7 -5
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts +8 -6
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +18 -10
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +1 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +9 -6
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +7 -5
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +35 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +46 -12
- 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 +1 -1
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +1 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/Record.d.ts +63 -160
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +37 -56
- package/dist/Record.js.map +1 -1
- package/dist/Reducer.d.ts +166 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +135 -1
- package/dist/Reducer.js.map +1 -1
- package/dist/References.d.ts +242 -226
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +240 -247
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +2 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +25 -45
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +10 -30
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +2 -1
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +1 -2
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +66 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +79 -6
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +174 -291
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +160 -134
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +34 -123
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +31 -123
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +2722 -247
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +1947 -224
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +7 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +131 -25
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +5 -5
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +18 -18
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaParser.d.ts +44 -54
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +55 -2
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +46 -45
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +49 -24
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +107 -3
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +173 -13
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts +2 -2
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +307 -0
- package/dist/Semaphore.d.ts.map +1 -0
- package/dist/Semaphore.js +222 -0
- package/dist/Semaphore.js.map +1 -0
- package/dist/ServiceMap.d.ts +76 -52
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +45 -29
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Sink.d.ts +18 -15
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +53 -6
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +16 -4
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +18 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +284 -431
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +189 -88
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +114 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +29 -47
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +23 -7
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +22 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +3 -3
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +85 -117
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.d.ts +2 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +5 -4
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +2 -1
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +44 -31
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +13 -9
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +37 -37
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +3 -3
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +328 -0
- package/dist/TxDeferred.d.ts.map +1 -0
- package/dist/TxDeferred.js +197 -0
- package/dist/TxDeferred.js.map +1 -0
- package/dist/TxHashMap.d.ts +159 -140
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +51 -44
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +36 -36
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +16 -15
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +609 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -0
- package/dist/TxPriorityQueue.js +416 -0
- package/dist/TxPriorityQueue.js.map +1 -0
- package/dist/TxPubSub.d.ts +585 -0
- package/dist/TxPubSub.d.ts.map +1 -0
- package/dist/TxPubSub.js +521 -0
- package/dist/TxPubSub.js.map +1 -0
- package/dist/TxQueue.d.ts +32 -32
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +26 -26
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +523 -0
- package/dist/TxReentrantLock.d.ts.map +1 -0
- package/dist/TxReentrantLock.js +504 -0
- package/dist/TxReentrantLock.js.map +1 -0
- package/dist/TxRef.d.ts +34 -34
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +21 -14
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +170 -10
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +23 -8
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +508 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -0
- package/dist/TxSubscriptionRef.js +293 -0
- package/dist/TxSubscriptionRef.js.map +1 -0
- package/dist/Types.d.ts +80 -23
- package/dist/Types.d.ts.map +1 -1
- package/dist/Utils.d.ts +137 -65
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +38 -66
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +806 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +806 -55
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +11 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +77 -71
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +284 -201
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +7 -5
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/option.js +6 -0
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/random.d.ts +2 -0
- package/dist/internal/random.d.ts.map +1 -0
- package/dist/internal/random.js +13 -0
- package/dist/internal/random.js.map +1 -0
- package/dist/internal/rcRef.js +3 -2
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.d.ts +2 -0
- package/dist/internal/references.d.ts.map +1 -0
- package/dist/internal/references.js +51 -0
- package/dist/internal/references.js.map +1 -0
- package/dist/internal/request.js +2 -2
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/representation.js +75 -106
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -0
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/to-codec.js +7 -10
- package/dist/internal/schema/to-codec.js.map +1 -1
- package/dist/internal/trie.js +8 -7
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts +8 -7
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +6 -4
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +266 -32
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +296 -23
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +64 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +64 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +136 -54
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +28 -23
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +35 -7
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +38 -44
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +130 -0
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -0
- package/dist/unstable/ai/EmbeddingModel.js +127 -0
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -0
- package/dist/unstable/ai/LanguageModel.d.ts +117 -47
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +258 -59
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +183 -88
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +57 -12
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +66 -13
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +193 -51
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +25 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +22 -6
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +4 -0
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +20 -20
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts +26 -26
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +1 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +38 -0
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -0
- package/dist/unstable/ai/ResponseIdTracker.js +68 -0
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -0
- package/dist/unstable/ai/Tool.d.ts +34 -4
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +28 -10
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +4 -11
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +22 -1
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +22 -1
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +0 -5
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -4
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -3
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +27 -60
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +25 -57
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +3 -2
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +65 -10
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +371 -58
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +328 -67
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +16 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -0
- package/dist/unstable/cli/Completions.js +23 -0
- package/dist/unstable/cli/Completions.js.map +1 -0
- package/dist/unstable/cli/Flag.d.ts +2 -2
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
- package/dist/unstable/cli/GlobalFlag.js +118 -0
- package/dist/unstable/cli/GlobalFlag.js.map +1 -0
- package/dist/unstable/cli/HelpDoc.d.ts +81 -11
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +7 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +2 -2
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +259 -85
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +8 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +8 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +40 -14
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +72 -46
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +16 -4
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/config.js +42 -0
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts +33 -0
- package/dist/unstable/cli/internal/help.d.ts.map +1 -0
- package/dist/unstable/cli/internal/help.js +125 -0
- package/dist/unstable/cli/internal/help.js.map +1 -0
- package/dist/unstable/cli/internal/parser.js +61 -43
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +18 -0
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +21 -1
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +3 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -29
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +10 -8
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +8 -7
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +1 -1
- package/dist/unstable/cluster/EntityAddress.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/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +4 -4
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +18 -15
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +15 -7
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +33 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +36 -20
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +8 -7
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -3
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +9 -8
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +2 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +11 -9
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js +3 -3
- 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 +51 -39
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +26 -25
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +24 -24
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +25 -19
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +24 -18
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +2 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +4 -3
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +40 -40
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +9 -2
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +9 -9
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +4 -4
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
- package/dist/unstable/eventlog/EventJournal.js +2 -2
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +3 -2
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
- package/dist/unstable/eventlog/SqlEventLogJournal.js +2 -2
- package/dist/unstable/eventlog/SqlEventLogJournal.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +52 -7
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +27 -6
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +5 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +19 -2
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +40 -11
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpClient.d.ts +117 -15
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +191 -13
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +43 -15
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +131 -21
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +2 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +6 -1
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +7 -5
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +46 -54
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +3 -2
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -4
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +3 -3
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +24 -32
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +3 -2
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +2 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +7 -7
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- 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 +22 -34
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +39 -45
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +15 -3
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +301 -7
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +5 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +50 -3
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +236 -1
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
- package/dist/unstable/http/HttpStaticServer.js +353 -0
- package/dist/unstable/http/HttpStaticServer.js.map +1 -0
- package/dist/unstable/http/HttpTraceContext.d.ts +3 -2
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +27 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +3 -3
- package/dist/unstable/http/Url.d.ts +604 -0
- package/dist/unstable/http/Url.d.ts.map +1 -0
- package/dist/unstable/http/Url.js +256 -0
- package/dist/unstable/http/Url.js.map +1 -0
- package/dist/unstable/http/UrlParams.d.ts +19 -10
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +6 -7
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +8 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +8 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
- package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js +10 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +11 -5
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +40 -27
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +83 -7
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +78 -10
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +207 -101
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +49 -43
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +31 -14
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +125 -32
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +46 -15
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +32 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +6 -3
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +20 -2
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +1 -0
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +34 -26
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +12 -12
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +3 -3
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +7 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +7 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +6 -6
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +12 -11
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -2
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -128
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +1 -65
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +21 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +73 -12
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +108 -25
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +17 -15
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +45 -15
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +54 -11
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +9 -9
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +47 -21
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +39 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
- package/dist/unstable/reactivity/Hydration.js +76 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -0
- package/dist/unstable/reactivity/index.d.ts +4 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +4 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +6 -5
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -3
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +5 -26
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +53 -43
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +3 -5
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +8 -8
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +17 -2
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +39 -11
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +6 -10
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +20 -19
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +3 -2
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +22 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +15 -0
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +6 -6
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +6 -6
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +6 -5
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +12 -9
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +2 -2
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +1 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +237 -17
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +260 -4
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +3 -3
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +17 -8
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +17 -6
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +17 -7
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.js +0 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +2 -1
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +5 -0
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +13 -0
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +3 -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.js +8 -8
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +5 -4
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +1 -1
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +17 -5
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +153 -12
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +2 -2
- package/src/Array.ts +304 -447
- package/src/BigDecimal.ts +117 -66
- package/src/BigInt.ts +49 -41
- package/src/Brand.ts +1 -1
- package/src/Cache.ts +9 -8
- package/src/Cause.ts +37 -2
- package/src/Channel.ts +582 -154
- package/src/Chunk.ts +149 -331
- package/src/Combiner.ts +280 -13
- package/src/Config.ts +195 -25
- package/src/Cron.ts +155 -63
- package/src/Data.ts +539 -376
- package/src/DateTime.ts +75 -256
- package/src/Deferred.ts +8 -6
- package/src/Duration.ts +122 -66
- package/src/Effect.ts +1484 -1157
- package/src/Encoding.ts +879 -0
- package/src/Equal.ts +278 -111
- package/src/Equivalence.ts +114 -52
- package/src/ErrorReporter.ts +458 -0
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +12 -3
- package/src/FiberHandle.ts +10 -9
- package/src/FiberMap.ts +22 -22
- package/src/FileSystem.ts +34 -31
- package/src/Filter.ts +52 -63
- package/src/Formatter.ts +253 -51
- package/src/Function.ts +2 -10
- package/src/Graph.ts +131 -117
- package/src/HashMap.ts +26 -19
- package/src/Iterable.ts +117 -63
- package/src/JsonSchema.ts +383 -10
- package/src/Latch.ts +194 -0
- package/src/Layer.ts +394 -160
- package/src/LayerMap.ts +11 -9
- package/src/LogLevel.ts +37 -0
- package/src/Logger.ts +33 -100
- package/src/ManagedRuntime.ts +35 -22
- package/src/Metric.ts +6 -8
- package/src/MutableHashMap.ts +9 -0
- package/src/MutableHashSet.ts +9 -0
- package/src/Newtype.ts +308 -0
- package/src/Number.ts +85 -26
- package/src/Optic.ts +948 -19
- package/src/Option.ts +34 -24
- package/src/Order.ts +39 -32
- package/src/PartitionedSemaphore.ts +288 -56
- package/src/Pipeable.ts +32 -1
- package/src/PlatformError.ts +5 -5
- package/src/Pool.ts +13 -11
- package/src/PubSub.ts +30 -20
- package/src/Pull.ts +1 -1
- package/src/Queue.ts +11 -9
- package/src/Random.ts +51 -14
- package/src/RcMap.ts +5 -5
- package/src/RcRef.ts +1 -1
- package/src/Record.ts +94 -199
- package/src/Reducer.ts +166 -7
- package/src/References.ts +283 -287
- package/src/Request.ts +3 -2
- package/src/RequestResolver.ts +29 -49
- package/src/Resource.ts +2 -1
- package/src/Result.ts +2 -4
- package/src/Runtime.ts +102 -6
- package/src/Schedule.ts +458 -449
- package/src/Scheduler.ts +49 -126
- package/src/Schema.ts +3298 -392
- package/src/SchemaAST.ts +172 -33
- package/src/SchemaGetter.ts +19 -21
- package/src/SchemaParser.ts +92 -27
- package/src/SchemaRepresentation.ts +51 -26
- package/src/SchemaTransformation.ts +198 -13
- package/src/ScopedCache.ts +3 -3
- package/src/Semaphore.ts +444 -0
- package/src/ServiceMap.ts +144 -97
- package/src/Sink.ts +83 -28
- package/src/Stdio.ts +27 -4
- package/src/Stream.ts +687 -617
- package/src/String.ts +122 -69
- package/src/Struct.ts +33 -7
- package/src/SubscriptionRef.ts +101 -120
- package/src/SynchronizedRef.ts +3 -2
- package/src/Terminal.ts +2 -1
- package/src/Tracer.ts +6 -5
- package/src/Trie.ts +44 -31
- package/src/TxChunk.ts +72 -53
- package/src/TxDeferred.ts +394 -0
- package/src/TxHashMap.ts +409 -343
- package/src/TxHashSet.ts +113 -118
- package/src/TxPriorityQueue.ts +766 -0
- package/src/TxPubSub.ts +789 -0
- package/src/TxQueue.ts +241 -251
- package/src/TxReentrantLock.ts +753 -0
- package/src/TxRef.ts +50 -38
- package/src/TxSemaphore.ts +217 -44
- package/src/TxSubscriptionRef.ts +639 -0
- package/src/Types.ts +73 -19
- package/src/Utils.ts +137 -111
- package/src/index.ts +816 -56
- package/src/internal/core.ts +12 -5
- package/src/internal/dateTime.ts +91 -96
- package/src/internal/effect.ts +844 -432
- package/src/internal/hashMap.ts +12 -10
- package/src/internal/option.ts +7 -0
- package/src/internal/random.ts +20 -0
- package/src/internal/rcRef.ts +4 -3
- package/src/internal/references.ts +72 -0
- package/src/internal/request.ts +2 -2
- package/src/internal/schema/annotations.ts +2 -0
- package/src/internal/schema/representation.ts +73 -94
- package/src/internal/schema/schema.ts +1 -0
- package/src/internal/schema/to-codec.ts +7 -17
- package/src/internal/trie.ts +21 -15
- package/src/testing/TestClock.ts +13 -11
- package/src/testing/TestSchema.ts +332 -35
- package/src/testing/index.ts +64 -1
- package/src/unstable/ai/AiError.ts +111 -54
- package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -0
- package/src/unstable/ai/Chat.ts +134 -85
- package/src/unstable/ai/EmbeddingModel.ts +209 -0
- package/src/unstable/ai/LanguageModel.ts +683 -253
- package/src/unstable/ai/McpSchema.ts +73 -13
- package/src/unstable/ai/McpServer.ts +271 -61
- package/src/unstable/ai/Model.ts +40 -9
- package/src/unstable/ai/OpenAiStructuredOutput.ts +4 -0
- package/src/unstable/ai/Prompt.ts +37 -37
- package/src/unstable/ai/Response.ts +25 -25
- package/src/unstable/ai/ResponseIdTracker.ts +97 -0
- package/src/unstable/ai/Tool.ts +42 -16
- package/src/unstable/ai/Toolkit.ts +5 -14
- package/src/unstable/ai/index.ts +24 -1
- package/src/unstable/ai/internal/codec-transformer.ts +0 -7
- package/src/unstable/cli/Argument.ts +2 -4
- package/src/unstable/cli/CliError.ts +47 -59
- package/src/unstable/cli/CliOutput.ts +85 -13
- package/src/unstable/cli/Command.ts +801 -192
- package/src/unstable/cli/Completions.ts +36 -0
- package/src/unstable/cli/Flag.ts +2 -2
- package/src/unstable/cli/GlobalFlag.ts +242 -0
- package/src/unstable/cli/HelpDoc.ts +91 -11
- package/src/unstable/cli/Param.ts +15 -11
- package/src/unstable/cli/Primitive.ts +2 -2
- package/src/unstable/cli/Prompt.ts +265 -101
- package/src/unstable/cli/index.ts +10 -0
- package/src/unstable/cli/internal/command.ts +109 -63
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +10 -4
- package/src/unstable/cli/internal/config.ts +49 -0
- package/src/unstable/cli/internal/help.ts +171 -0
- package/src/unstable/cli/internal/parser.ts +71 -63
- package/src/unstable/cluster/ClusterCron.ts +2 -2
- package/src/unstable/cluster/ClusterSchema.ts +29 -1
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +62 -37
- package/src/unstable/cluster/DeliverAt.ts +1 -1
- package/src/unstable/cluster/Entity.ts +25 -22
- package/src/unstable/cluster/EntityAddress.ts +1 -1
- package/src/unstable/cluster/EntityResource.ts +4 -4
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/K8sHttpClient.ts +5 -5
- package/src/unstable/cluster/Message.ts +28 -15
- package/src/unstable/cluster/MessageStorage.ts +66 -36
- package/src/unstable/cluster/Reply.ts +7 -4
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerAddress.ts +1 -1
- package/src/unstable/cluster/RunnerServer.ts +10 -13
- package/src/unstable/cluster/Runners.ts +14 -12
- package/src/unstable/cluster/ShardId.ts +2 -2
- package/src/unstable/cluster/Sharding.ts +66 -49
- package/src/unstable/cluster/ShardingConfig.ts +36 -37
- package/src/unstable/cluster/SqlMessageStorage.ts +31 -19
- package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +50 -34
- package/src/unstable/cluster/internal/entityReaper.ts +2 -1
- package/src/unstable/cluster/internal/resourceRef.ts +2 -1
- package/src/unstable/devtools/DevToolsClient.ts +23 -18
- package/src/unstable/devtools/DevToolsSchema.ts +16 -3
- package/src/unstable/encoding/Ndjson.ts +17 -17
- package/src/unstable/encoding/Sse.ts +3 -5
- package/src/unstable/eventlog/EventJournal.ts +2 -2
- package/src/unstable/eventlog/EventLog.ts +3 -2
- package/src/unstable/eventlog/SqlEventLogJournal.ts +2 -2
- package/src/unstable/http/Cookies.ts +94 -11
- package/src/unstable/http/Etag.ts +5 -3
- package/src/unstable/http/Headers.ts +68 -18
- package/src/unstable/http/HttpClient.ts +376 -34
- package/src/unstable/http/HttpClientRequest.ts +151 -39
- package/src/unstable/http/HttpClientResponse.ts +12 -6
- package/src/unstable/http/HttpEffect.ts +54 -68
- package/src/unstable/http/HttpIncomingMessage.ts +3 -2
- package/src/unstable/http/HttpMethod.ts +16 -4
- package/src/unstable/http/HttpMiddleware.ts +25 -39
- package/src/unstable/http/HttpPlatform.ts +3 -2
- package/src/unstable/http/HttpRouter.ts +9 -9
- package/src/unstable/http/HttpServer.ts +3 -9
- package/src/unstable/http/HttpServerError.ts +45 -47
- package/src/unstable/http/HttpServerRequest.ts +407 -16
- package/src/unstable/http/HttpServerRespondable.ts +6 -6
- package/src/unstable/http/HttpServerResponse.ts +345 -7
- package/src/unstable/http/HttpStaticServer.ts +456 -0
- package/src/unstable/http/HttpTraceContext.ts +31 -17
- package/src/unstable/http/Multipart.ts +2 -2
- package/src/unstable/http/Url.ts +650 -0
- package/src/unstable/http/UrlParams.ts +31 -19
- package/src/unstable/http/index.ts +10 -0
- package/src/unstable/http/internal/preResponseHandler.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +6 -6
- package/src/unstable/httpapi/HttpApiBuilder.ts +106 -41
- package/src/unstable/httpapi/HttpApiClient.ts +180 -28
- package/src/unstable/httpapi/HttpApiEndpoint.ts +216 -104
- package/src/unstable/httpapi/HttpApiError.ts +108 -30
- package/src/unstable/httpapi/HttpApiGroup.ts +7 -6
- package/src/unstable/httpapi/HttpApiMiddleware.ts +83 -22
- package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
- package/src/unstable/httpapi/HttpApiSchema.ts +21 -3
- package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
- package/src/unstable/httpapi/OpenApi.ts +44 -29
- package/src/unstable/observability/Otlp.ts +12 -12
- package/src/unstable/observability/OtlpExporter.ts +8 -5
- package/src/unstable/observability/OtlpLogger.ts +13 -9
- package/src/unstable/observability/OtlpMetrics.ts +4 -4
- package/src/unstable/observability/OtlpTracer.ts +12 -8
- package/src/unstable/persistence/KeyValueStore.ts +6 -6
- package/src/unstable/persistence/Persistable.ts +3 -3
- package/src/unstable/persistence/PersistedCache.ts +20 -9
- package/src/unstable/persistence/PersistedQueue.ts +25 -24
- package/src/unstable/persistence/Persistence.ts +3 -3
- package/src/unstable/persistence/RateLimiter.ts +4 -4
- package/src/unstable/process/ChildProcess.ts +6 -208
- package/src/unstable/process/ChildProcessSpawner.ts +75 -14
- package/src/unstable/reactivity/Atom.ts +212 -54
- package/src/unstable/reactivity/AtomHttpApi.ts +81 -41
- package/src/unstable/reactivity/AtomRegistry.ts +66 -12
- package/src/unstable/reactivity/AtomRpc.ts +51 -20
- package/src/unstable/reactivity/Hydration.ts +112 -0
- package/src/unstable/reactivity/index.ts +5 -0
- package/src/unstable/rpc/Rpc.ts +12 -12
- package/src/unstable/rpc/RpcClient.ts +67 -96
- package/src/unstable/rpc/RpcGroup.ts +7 -7
- package/src/unstable/rpc/RpcMiddleware.ts +15 -9
- package/src/unstable/rpc/RpcSchema.ts +23 -5
- package/src/unstable/rpc/RpcSerialization.ts +49 -11
- package/src/unstable/rpc/RpcServer.ts +31 -35
- package/src/unstable/rpc/Utils.ts +3 -2
- package/src/unstable/schema/Model.ts +31 -0
- package/src/unstable/schema/VariantSchema.ts +10 -10
- package/src/unstable/socket/Socket.ts +31 -27
- package/src/unstable/sql/Migrator.ts +7 -5
- package/src/unstable/sql/SqlClient.ts +6 -4
- package/src/unstable/sql/SqlError.ts +365 -11
- package/src/unstable/sql/SqlModel.ts +5 -5
- package/src/unstable/sql/SqlResolver.ts +17 -7
- package/src/unstable/sql/SqlSchema.ts +42 -26
- package/src/unstable/sql/Statement.ts +0 -1
- package/src/unstable/workers/Worker.ts +2 -1
- package/src/unstable/workflow/Activity.ts +23 -0
- package/src/unstable/workflow/DurableClock.ts +8 -8
- package/src/unstable/workflow/DurableDeferred.ts +8 -8
- package/src/unstable/workflow/Workflow.ts +7 -3
- package/src/unstable/workflow/WorkflowEngine.ts +211 -19
- package/dist/NullOr.d.ts +0 -149
- package/dist/NullOr.d.ts.map +0 -1
- package/dist/NullOr.js +0 -152
- package/dist/NullOr.js.map +0 -1
- package/dist/encoding/Base64.d.ts +0 -67
- package/dist/encoding/Base64.d.ts.map +0 -1
- package/dist/encoding/Base64.js +0 -146
- package/dist/encoding/Base64.js.map +0 -1
- package/dist/encoding/Base64Url.d.ts +0 -60
- package/dist/encoding/Base64Url.d.ts.map +0 -1
- package/dist/encoding/Base64Url.js +0 -89
- package/dist/encoding/Base64Url.js.map +0 -1
- package/dist/encoding/EncodingError.d.ts +0 -31
- package/dist/encoding/EncodingError.d.ts.map +0 -1
- package/dist/encoding/EncodingError.js +0 -22
- package/dist/encoding/EncodingError.js.map +0 -1
- package/dist/encoding/Hex.d.ts +0 -61
- package/dist/encoding/Hex.d.ts.map +0 -1
- package/dist/encoding/Hex.js +0 -115
- package/dist/encoding/Hex.js.map +0 -1
- package/dist/encoding/index.d.ts +0 -26
- package/dist/encoding/index.d.ts.map +0 -1
- package/dist/encoding/index.js +0 -27
- package/dist/encoding/index.js.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
- package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.js +0 -44
- package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/Completions.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.js +0 -23
- package/dist/unstable/cli/internal/completions/Completions.js.map +0 -1
- package/src/NullOr.ts +0 -204
- package/src/encoding/Base64.ts +0 -366
- package/src/encoding/Base64Url.ts +0 -104
- package/src/encoding/EncodingError.ts +0 -35
- package/src/encoding/Hex.ts +0 -390
- package/src/encoding/index.ts +0 -31
- package/src/unstable/cli/internal/builtInFlags.ts +0 -78
- package/src/unstable/cli/internal/completions/Completions.ts +0 -31
package/dist/Schedule.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* // Retry with exponential backoff
|
|
14
14
|
* const retryPolicy = Schedule.exponential("100 millis", 2.0)
|
|
15
|
-
* .pipe(Schedule.
|
|
15
|
+
* .pipe(Schedule.both(Schedule.recurs(3)))
|
|
16
16
|
*
|
|
17
17
|
* const program = Effect.gen(function*() {
|
|
18
18
|
* // This will retry up to 3 times with exponential backoff
|
|
@@ -33,13 +33,16 @@ import * as Cause from "./Cause.js";
|
|
|
33
33
|
import * as Cron from "./Cron.js";
|
|
34
34
|
import * as Duration from "./Duration.js";
|
|
35
35
|
import { constant, dual, identity } from "./Function.js";
|
|
36
|
+
import { isEffect } from "./internal/core.js";
|
|
36
37
|
import * as effect from "./internal/effect.js";
|
|
38
|
+
import * as random from "./internal/random.js";
|
|
37
39
|
import { pipeArguments } from "./Pipeable.js";
|
|
38
40
|
import { hasProperty } from "./Predicate.js";
|
|
39
41
|
import * as Pull from "./Pull.js";
|
|
40
42
|
import * as Result from "./Result.js";
|
|
41
43
|
import * as ServiceMap from "./ServiceMap.js";
|
|
42
44
|
const TypeId = "~effect/Schedule";
|
|
45
|
+
const randomNext = /*#__PURE__*/random.Random.useSync(random => random.nextDoubleUnsafe());
|
|
43
46
|
/**
|
|
44
47
|
* @since 4.0.0
|
|
45
48
|
* @category Metadata
|
|
@@ -103,7 +106,7 @@ export const isSchedule = u => hasProperty(u, TypeId);
|
|
|
103
106
|
*
|
|
104
107
|
* // These can be combined and transformed as needed
|
|
105
108
|
* const complexSchedule = simpleSchedule.pipe(
|
|
106
|
-
* Schedule.
|
|
109
|
+
* Schedule.both(Schedule.recurs(3))
|
|
107
110
|
* )
|
|
108
111
|
* ```
|
|
109
112
|
*
|
|
@@ -242,7 +245,9 @@ export const toStepWithSleep = schedule => effect.map(toStepWithMetadata(schedul
|
|
|
242
245
|
*
|
|
243
246
|
* @example
|
|
244
247
|
* ```ts
|
|
245
|
-
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
248
|
+
* import { Console, Data, Duration, Effect, Schedule } from "effect"
|
|
249
|
+
*
|
|
250
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
246
251
|
*
|
|
247
252
|
* // Add random jitter to schedule delays
|
|
248
253
|
* const jitteredSchedule = Schedule.addDelay(
|
|
@@ -338,7 +343,7 @@ export const toStepWithSleep = schedule => effect.map(toStepWithMetadata(schedul
|
|
|
338
343
|
* Effect.gen(function*() {
|
|
339
344
|
* attempt++
|
|
340
345
|
* if (attempt < 5) {
|
|
341
|
-
* yield* Effect.fail(new
|
|
346
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
342
347
|
* }
|
|
343
348
|
* return `Success on attempt ${attempt}`
|
|
344
349
|
* }),
|
|
@@ -352,7 +357,7 @@ export const toStepWithSleep = schedule => effect.map(toStepWithMetadata(schedul
|
|
|
352
357
|
* @since 2.0.0
|
|
353
358
|
* @category utils
|
|
354
359
|
*/
|
|
355
|
-
export const addDelay = /*#__PURE__*/dual(2, (self, f) => modifyDelay(self, (output, delay) => effect.map(f(output), d => Duration.sum(Duration.
|
|
360
|
+
export const addDelay = /*#__PURE__*/dual(2, (self, f) => modifyDelay(self, (output, delay) => effect.map(f(output), d => Duration.sum(Duration.fromInputUnsafe(d), Duration.fromInputUnsafe(delay)))));
|
|
356
361
|
/**
|
|
357
362
|
* Returns a new `Schedule` that will first execute the left (i.e. `self`)
|
|
358
363
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
@@ -360,7 +365,9 @@ export const addDelay = /*#__PURE__*/dual(2, (self, f) => modifyDelay(self, (out
|
|
|
360
365
|
*
|
|
361
366
|
* @example
|
|
362
367
|
* ```ts
|
|
363
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
368
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
369
|
+
*
|
|
370
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
364
371
|
*
|
|
365
372
|
* // First retry 3 times quickly, then switch to slower retries
|
|
366
373
|
* const quickRetries = Schedule.exponential("100 millis").pipe(
|
|
@@ -379,7 +386,7 @@ export const addDelay = /*#__PURE__*/dual(2, (self, f) => modifyDelay(self, (out
|
|
|
379
386
|
* attempt++
|
|
380
387
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
381
388
|
* if (attempt < 6) {
|
|
382
|
-
* yield* Effect.fail(new
|
|
389
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Failure ${attempt}` }))
|
|
383
390
|
* }
|
|
384
391
|
* return `Success on attempt ${attempt}`
|
|
385
392
|
* }),
|
|
@@ -432,21 +439,26 @@ export const andThen = /*#__PURE__*/dual(2, (self, other) => map(andThenResult(s
|
|
|
432
439
|
* @since 2.0.0
|
|
433
440
|
* @category sequencing
|
|
434
441
|
*/
|
|
435
|
-
export const andThenResult = /*#__PURE__*/dual(2, (self, other) => fromStep(effect.
|
|
436
|
-
let
|
|
437
|
-
let
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
442
|
+
export const andThenResult = /*#__PURE__*/dual(2, (self, other) => fromStep(effect.sync(() => {
|
|
443
|
+
let currentSide = 0;
|
|
444
|
+
let currentStep;
|
|
445
|
+
const left = map(self, Result.succeed);
|
|
446
|
+
const right = map(other, Result.fail);
|
|
447
|
+
return function recur(now, input) {
|
|
448
|
+
if (currentStep) return currentStep(now, input);
|
|
449
|
+
return toStep(currentSide === 0 ? left : right).pipe(effect.flatMap(step => {
|
|
450
|
+
currentSide++;
|
|
451
|
+
if (currentSide === 1) {
|
|
452
|
+
currentStep = (now, input) => Pull.catchDone(step(now, input), _ => {
|
|
453
|
+
currentStep = undefined;
|
|
454
|
+
return recur(now, input);
|
|
455
|
+
});
|
|
456
|
+
return currentStep(now, input);
|
|
446
457
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
458
|
+
currentStep = step;
|
|
459
|
+
return currentStep(now, input);
|
|
460
|
+
}));
|
|
461
|
+
};
|
|
450
462
|
})));
|
|
451
463
|
/**
|
|
452
464
|
* Combines two `Schedule`s by recurring if both of the two schedules want
|
|
@@ -455,7 +467,9 @@ export const andThenResult = /*#__PURE__*/dual(2, (self, other) => fromStep(effe
|
|
|
455
467
|
*
|
|
456
468
|
* @example
|
|
457
469
|
* ```ts
|
|
458
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
470
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
471
|
+
*
|
|
472
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
459
473
|
*
|
|
460
474
|
* // Both schedules must want to continue for the combined schedule to continue
|
|
461
475
|
* const timeLimit = Schedule.spaced("1 second").pipe(Schedule.take(5)) // max 5 times
|
|
@@ -497,7 +511,7 @@ export const andThenResult = /*#__PURE__*/dual(2, (self, other) => fromStep(effe
|
|
|
497
511
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
498
512
|
*
|
|
499
513
|
* if (attempt < 3) {
|
|
500
|
-
* yield* Effect.fail(new
|
|
514
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
501
515
|
* }
|
|
502
516
|
*
|
|
503
517
|
* return `Success on attempt ${attempt}`
|
|
@@ -625,69 +639,6 @@ export const bothWith = /*#__PURE__*/dual(3, (self, other, combine) => fromStep(
|
|
|
625
639
|
onDone: leftDone => stepRight(now, input).pipe(effect.flatMap(rightResult => Cause.done(combine(leftDone, rightResult[0]))), Pull.catchDone(rightDone => Cause.done(combine(leftDone, rightDone)))),
|
|
626
640
|
onFailure: effect.failCause
|
|
627
641
|
}))));
|
|
628
|
-
/**
|
|
629
|
-
* Returns a new `Schedule` that combines two schedules by running them
|
|
630
|
-
* sequentially. First the current schedule runs to completion, then the
|
|
631
|
-
* other schedule runs to completion. The output is a tuple of both results.
|
|
632
|
-
*
|
|
633
|
-
* @example
|
|
634
|
-
* ```ts
|
|
635
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
636
|
-
*
|
|
637
|
-
* // Compose a quick retry phase followed by slower retry phase
|
|
638
|
-
* const fastRetries = Schedule.exponential("100 millis").pipe(
|
|
639
|
-
* Schedule.compose(Schedule.recurs(3)) // 3 fast retries
|
|
640
|
-
* )
|
|
641
|
-
*
|
|
642
|
-
* const slowRetries = Schedule.exponential("2 seconds").pipe(
|
|
643
|
-
* Schedule.compose(Schedule.recurs(2)) // 2 slow retries
|
|
644
|
-
* )
|
|
645
|
-
*
|
|
646
|
-
* // Sequential composition: fast retries first, then slow retries
|
|
647
|
-
* const composedRetry = Schedule.compose(fastRetries, slowRetries)
|
|
648
|
-
* // Outputs: [number_from_fast_phase, number_from_slow_phase]
|
|
649
|
-
*
|
|
650
|
-
* const program = Effect.gen(function*() {
|
|
651
|
-
* let attempt = 0
|
|
652
|
-
*
|
|
653
|
-
* const result = yield* Effect.retry(
|
|
654
|
-
* Effect.gen(function*() {
|
|
655
|
-
* attempt++
|
|
656
|
-
* yield* Console.log(`Attempt ${attempt}`)
|
|
657
|
-
*
|
|
658
|
-
* if (attempt < 7) { // Needs both phases to succeed
|
|
659
|
-
* yield* Effect.fail(new Error(`Attempt ${attempt} failed`))
|
|
660
|
-
* }
|
|
661
|
-
*
|
|
662
|
-
* return `Success on attempt ${attempt}`
|
|
663
|
-
* }),
|
|
664
|
-
* composedRetry.pipe(
|
|
665
|
-
* Schedule.tapOutput(([fastResult, slowResult]) =>
|
|
666
|
-
* Console.log(`Fast phase: ${fastResult}, Slow phase: ${slowResult}`)
|
|
667
|
-
* )
|
|
668
|
-
* )
|
|
669
|
-
* )
|
|
670
|
-
*
|
|
671
|
-
* yield* Console.log(`Final result: ${result}`)
|
|
672
|
-
* })
|
|
673
|
-
*
|
|
674
|
-
* // Compose different schedule types
|
|
675
|
-
* const warmupAndMaintenance = Schedule.compose(
|
|
676
|
-
* Schedule.fixed("500 millis").pipe(Schedule.take(5)), // 5 warmup cycles
|
|
677
|
-
* Schedule.spaced("5 seconds") // then regular maintenance
|
|
678
|
-
* )
|
|
679
|
-
*
|
|
680
|
-
* // Progressive backoff: fixed first, then exponential
|
|
681
|
-
* const progressiveBackoff = Schedule.compose(
|
|
682
|
-
* Schedule.fixed("100 millis").pipe(Schedule.take(3)), // Fixed: 100ms, 100ms, 100ms
|
|
683
|
-
* Schedule.exponential("500 millis").pipe(Schedule.take(3)) // Then exponential: 500ms, 1s, 2s
|
|
684
|
-
* )
|
|
685
|
-
* ```
|
|
686
|
-
*
|
|
687
|
-
* @since 2.0.0
|
|
688
|
-
* @category sequencing
|
|
689
|
-
*/
|
|
690
|
-
export const compose = /*#__PURE__*/dual(2, (self, other) => both(self, other));
|
|
691
642
|
/**
|
|
692
643
|
* Returns a new `Schedule` that always recurs, collecting all inputs of the
|
|
693
644
|
* schedule into an array.
|
|
@@ -850,17 +801,19 @@ export const collectOutputs = self => collectWhile(self, () => effect.succeed(tr
|
|
|
850
801
|
* @since 2.0.0
|
|
851
802
|
* @category utilities
|
|
852
803
|
*/
|
|
853
|
-
export const collectWhile = /*#__PURE__*/dual(2, (self, predicate) => reduce(while_(self, predicate), () => [], (outputs, output) =>
|
|
804
|
+
export const collectWhile = /*#__PURE__*/dual(2, (self, predicate) => reduce(while_(self, predicate), () => [], (outputs, output) => {
|
|
854
805
|
outputs.push(output);
|
|
855
806
|
return outputs;
|
|
856
|
-
})
|
|
807
|
+
}));
|
|
857
808
|
/**
|
|
858
809
|
* Returns a new `Schedule` that recurs on the specified `Cron` schedule and
|
|
859
810
|
* outputs the duration between recurrences.
|
|
860
811
|
*
|
|
861
812
|
* @example
|
|
862
813
|
* ```ts
|
|
863
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
814
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
815
|
+
*
|
|
816
|
+
* class ScheduledTaskError extends Data.TaggedError("ScheduledTaskError")<{ readonly message: string }> {}
|
|
864
817
|
*
|
|
865
818
|
* // Run every minute
|
|
866
819
|
* const everyMinute = Schedule.cron("* * * * *")
|
|
@@ -961,7 +914,7 @@ export const collectWhile = /*#__PURE__*/dual(2, (self, predicate) => reduce(whi
|
|
|
961
914
|
* yield* Console.log("Complex scheduled task...")
|
|
962
915
|
* // Simulate occasional failures
|
|
963
916
|
* if (Math.random() < 0.3) {
|
|
964
|
-
* yield* Effect.fail(new
|
|
917
|
+
* return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
|
|
965
918
|
* }
|
|
966
919
|
* return "success"
|
|
967
920
|
* }),
|
|
@@ -1079,7 +1032,7 @@ export const delays = self => fromStep(effect.map(toStep(self), step => (now, in
|
|
|
1079
1032
|
* @category constructors
|
|
1080
1033
|
*/
|
|
1081
1034
|
export const duration = durationInput => {
|
|
1082
|
-
const duration = Duration.
|
|
1035
|
+
const duration = Duration.fromInputUnsafe(durationInput);
|
|
1083
1036
|
return fromStepWithMetadata(effect.succeed(meta => meta.attempt === 1 ? effect.succeed([duration, duration]) : Cause.done(Duration.zero)));
|
|
1084
1037
|
};
|
|
1085
1038
|
/**
|
|
@@ -1088,7 +1041,9 @@ export const duration = durationInput => {
|
|
|
1088
1041
|
*
|
|
1089
1042
|
* @example
|
|
1090
1043
|
* ```ts
|
|
1091
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1044
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1045
|
+
*
|
|
1046
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1092
1047
|
*
|
|
1093
1048
|
* // Run a task for exactly 5 seconds, regardless of how many iterations
|
|
1094
1049
|
* const fiveSecondSchedule = Schedule.during("5 seconds")
|
|
@@ -1150,7 +1105,7 @@ export const duration = durationInput => {
|
|
|
1150
1105
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
1151
1106
|
*
|
|
1152
1107
|
* if (Math.random() < 0.8) { // 80% failure rate
|
|
1153
|
-
* yield* Effect.fail(new
|
|
1108
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1154
1109
|
* }
|
|
1155
1110
|
*
|
|
1156
1111
|
* return `Success on attempt ${attempt}`
|
|
@@ -1169,7 +1124,7 @@ export const duration = durationInput => {
|
|
|
1169
1124
|
*/
|
|
1170
1125
|
export const during = duration => while_(elapsed, ({
|
|
1171
1126
|
output
|
|
1172
|
-
}) => effect.succeed(Duration.isLessThanOrEqualTo(output, Duration.
|
|
1127
|
+
}) => effect.succeed(Duration.isLessThanOrEqualTo(output, Duration.fromInputUnsafe(duration))));
|
|
1173
1128
|
/**
|
|
1174
1129
|
* Combines two `Schedule`s by recurring if either of the two schedules wants
|
|
1175
1130
|
* to recur, using the minimum of the two durations between recurrences and
|
|
@@ -1177,7 +1132,9 @@ export const during = duration => while_(elapsed, ({
|
|
|
1177
1132
|
*
|
|
1178
1133
|
* @example
|
|
1179
1134
|
* ```ts
|
|
1180
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1135
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1136
|
+
*
|
|
1137
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1181
1138
|
*
|
|
1182
1139
|
* // Either continues as long as at least one schedule wants to continue
|
|
1183
1140
|
* const timeBasedSchedule = Schedule.spaced("2 seconds").pipe(Schedule.take(3))
|
|
@@ -1221,7 +1178,7 @@ export const during = duration => while_(elapsed, ({
|
|
|
1221
1178
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
1222
1179
|
*
|
|
1223
1180
|
* if (attempt < 6) {
|
|
1224
|
-
* yield* Effect.fail(new
|
|
1181
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1225
1182
|
* }
|
|
1226
1183
|
*
|
|
1227
1184
|
* return `Success on attempt ${attempt}`
|
|
@@ -1391,7 +1348,9 @@ export const elapsed = /*#__PURE__*/fromStepWithMetadata(/*#__PURE__*/effect.suc
|
|
|
1391
1348
|
*
|
|
1392
1349
|
* @example
|
|
1393
1350
|
* ```ts
|
|
1394
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1351
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1352
|
+
*
|
|
1353
|
+
* class RetryFailure extends Data.TaggedError("RetryFailure")<{ readonly message: string }> {}
|
|
1395
1354
|
*
|
|
1396
1355
|
* // Basic exponential backoff with default factor of 2
|
|
1397
1356
|
* const basicExponential = Schedule.exponential("100 millis")
|
|
@@ -1403,7 +1362,7 @@ export const elapsed = /*#__PURE__*/fromStepWithMetadata(/*#__PURE__*/effect.suc
|
|
|
1403
1362
|
*
|
|
1404
1363
|
* // Retry with exponential backoff (limited to 5 attempts)
|
|
1405
1364
|
* const retryPolicy = Schedule.exponential("50 millis").pipe(
|
|
1406
|
-
* Schedule.
|
|
1365
|
+
* Schedule.both(Schedule.recurs(5))
|
|
1407
1366
|
* )
|
|
1408
1367
|
*
|
|
1409
1368
|
* const program = Effect.gen(function*() {
|
|
@@ -1414,7 +1373,7 @@ export const elapsed = /*#__PURE__*/fromStepWithMetadata(/*#__PURE__*/effect.suc
|
|
|
1414
1373
|
* attempt++
|
|
1415
1374
|
* if (attempt < 4) {
|
|
1416
1375
|
* yield* Console.log(`Attempt ${attempt} failed, retrying...`)
|
|
1417
|
-
* yield* Effect.fail(new
|
|
1376
|
+
* return yield* Effect.fail(new RetryFailure({ message: `Failure ${attempt}` }))
|
|
1418
1377
|
* }
|
|
1419
1378
|
* return `Success on attempt ${attempt}`
|
|
1420
1379
|
* }),
|
|
@@ -1431,7 +1390,7 @@ export const elapsed = /*#__PURE__*/fromStepWithMetadata(/*#__PURE__*/effect.suc
|
|
|
1431
1390
|
* @category constructors
|
|
1432
1391
|
*/
|
|
1433
1392
|
export const exponential = (base, factor = 2) => {
|
|
1434
|
-
const baseMillis = Duration.toMillis(Duration.
|
|
1393
|
+
const baseMillis = Duration.toMillis(Duration.fromInputUnsafe(base));
|
|
1435
1394
|
return fromStepWithMetadata(effect.succeed(meta => {
|
|
1436
1395
|
const duration = Duration.millis(baseMillis * Math.pow(factor, meta.attempt - 1));
|
|
1437
1396
|
return effect.succeed([duration, duration]);
|
|
@@ -1444,7 +1403,9 @@ export const exponential = (base, factor = 2) => {
|
|
|
1444
1403
|
*
|
|
1445
1404
|
* @example
|
|
1446
1405
|
* ```ts
|
|
1447
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1406
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1407
|
+
*
|
|
1408
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1448
1409
|
*
|
|
1449
1410
|
* // Basic fibonacci schedule starting with 100ms
|
|
1450
1411
|
* const fibSchedule = Schedule.fibonacci("100 millis")
|
|
@@ -1460,13 +1421,13 @@ export const exponential = (base, factor = 2) => {
|
|
|
1460
1421
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
1461
1422
|
*
|
|
1462
1423
|
* if (attempt < 5) {
|
|
1463
|
-
* yield* Effect.fail(new
|
|
1424
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1464
1425
|
* }
|
|
1465
1426
|
*
|
|
1466
1427
|
* return `Success on attempt ${attempt}`
|
|
1467
1428
|
* }),
|
|
1468
1429
|
* Schedule.fibonacci("50 millis").pipe(
|
|
1469
|
-
* Schedule.
|
|
1430
|
+
* Schedule.both(Schedule.recurs(6)), // Maximum 6 retries
|
|
1470
1431
|
* Schedule.tapOutput((delay) => Console.log(`Next retry in ${delay}`))
|
|
1471
1432
|
* )
|
|
1472
1433
|
* )
|
|
@@ -1502,7 +1463,7 @@ export const exponential = (base, factor = 2) => {
|
|
|
1502
1463
|
* @category constructors
|
|
1503
1464
|
*/
|
|
1504
1465
|
export const fibonacci = one => {
|
|
1505
|
-
const oneMillis = Duration.toMillis(Duration.
|
|
1466
|
+
const oneMillis = Duration.toMillis(Duration.fromInputUnsafe(one));
|
|
1506
1467
|
return fromStep(effect.sync(() => {
|
|
1507
1468
|
let a = 0;
|
|
1508
1469
|
let b = oneMillis;
|
|
@@ -1578,8 +1539,26 @@ export const fibonacci = one => {
|
|
|
1578
1539
|
* @category constructors
|
|
1579
1540
|
*/
|
|
1580
1541
|
export const fixed = interval => {
|
|
1581
|
-
const window = Duration.toMillis(Duration.
|
|
1582
|
-
return fromStepWithMetadata(effect.
|
|
1542
|
+
const window = Duration.toMillis(Duration.fromInputUnsafe(interval));
|
|
1543
|
+
return fromStepWithMetadata(effect.sync(() => {
|
|
1544
|
+
let start = 0;
|
|
1545
|
+
let lastRun = 0;
|
|
1546
|
+
return meta => effect.sync(() => {
|
|
1547
|
+
if (window === 0) {
|
|
1548
|
+
return [meta.attempt - 1, Duration.zero];
|
|
1549
|
+
}
|
|
1550
|
+
if (meta.attempt === 1) {
|
|
1551
|
+
start = meta.now;
|
|
1552
|
+
lastRun = meta.now + window;
|
|
1553
|
+
return [0, Duration.millis(window)];
|
|
1554
|
+
}
|
|
1555
|
+
const runningBehind = meta.now > lastRun + window;
|
|
1556
|
+
const boundary = window - (meta.now - start) % window;
|
|
1557
|
+
const delay = runningBehind ? 0 : boundary === 0 ? window : boundary;
|
|
1558
|
+
lastRun = runningBehind ? meta.now : meta.now + delay;
|
|
1559
|
+
return [meta.attempt - 1, Duration.millis(delay)];
|
|
1560
|
+
});
|
|
1561
|
+
}));
|
|
1583
1562
|
};
|
|
1584
1563
|
/**
|
|
1585
1564
|
* Returns a new `Schedule` that maps the output of this schedule using the
|
|
@@ -1645,9 +1624,17 @@ export const fixed = interval => {
|
|
|
1645
1624
|
*/
|
|
1646
1625
|
export const map = /*#__PURE__*/dual(2, (self, f) => {
|
|
1647
1626
|
const handle = Pull.matchEffect({
|
|
1648
|
-
onSuccess: ([output, duration]) =>
|
|
1627
|
+
onSuccess: ([output, duration]) => {
|
|
1628
|
+
const result = f(output);
|
|
1629
|
+
if (!isEffect(result)) return effect.succeed([result, duration]);
|
|
1630
|
+
return effect.map(result, output => [output, duration]);
|
|
1631
|
+
},
|
|
1649
1632
|
onFailure: effect.failCause,
|
|
1650
|
-
onDone: output =>
|
|
1633
|
+
onDone: output => {
|
|
1634
|
+
const result = f(output);
|
|
1635
|
+
if (!isEffect(result)) return Cause.done(result);
|
|
1636
|
+
return effect.flatMap(result, Cause.done);
|
|
1637
|
+
}
|
|
1651
1638
|
});
|
|
1652
1639
|
return fromStep(effect.map(toStep(self), step => (now, input) => handle(step(now, input))));
|
|
1653
1640
|
});
|
|
@@ -1683,7 +1670,19 @@ export const map = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1683
1670
|
* @since 2.0.0
|
|
1684
1671
|
* @category utilities
|
|
1685
1672
|
*/
|
|
1686
|
-
export const modifyDelay = /*#__PURE__*/dual(2, (self, f) => fromStep(effect.map(toStep(self), step => (now, input) => effect.flatMap(step(now, input), ([output, delay]) => effect.map(f(output, delay), delay => [output, Duration.
|
|
1673
|
+
export const modifyDelay = /*#__PURE__*/dual(2, (self, f) => fromStep(effect.map(toStep(self), step => (now, input) => effect.flatMap(step(now, input), ([output, delay]) => effect.map(f(output, delay), delay => [output, Duration.fromInputUnsafe(delay)])))));
|
|
1674
|
+
/**
|
|
1675
|
+
* Returns a new `Schedule` that randomly adjusts each recurrence delay.
|
|
1676
|
+
*
|
|
1677
|
+
* Delays are jittered between `80%` and `120%` of the original delay.
|
|
1678
|
+
*
|
|
1679
|
+
* @since 2.0.0
|
|
1680
|
+
* @category utilities
|
|
1681
|
+
*/
|
|
1682
|
+
export const jittered = self => modifyDelay(self, (_, delay) => effect.map(randomNext, random => {
|
|
1683
|
+
const millis = Duration.toMillis(Duration.fromInputUnsafe(delay));
|
|
1684
|
+
return Duration.millis(millis * 0.8 * (1 - random) + millis * 1.2 * random);
|
|
1685
|
+
}));
|
|
1687
1686
|
/**
|
|
1688
1687
|
* Returns a new `Schedule` that outputs the inputs of the specified schedule.
|
|
1689
1688
|
*
|
|
@@ -1723,7 +1722,9 @@ export const passthrough = self => fromStep(effect.map(toStep(self), step => (no
|
|
|
1723
1722
|
*
|
|
1724
1723
|
* @example
|
|
1725
1724
|
* ```ts
|
|
1726
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1725
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1726
|
+
*
|
|
1727
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1727
1728
|
*
|
|
1728
1729
|
* // Basic recurs - retry at most 3 times
|
|
1729
1730
|
* const maxThreeAttempts = Schedule.recurs(3)
|
|
@@ -1738,7 +1739,7 @@ export const passthrough = self => fromStep(effect.map(toStep(self), step => (no
|
|
|
1738
1739
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
1739
1740
|
*
|
|
1740
1741
|
* if (attempt < 4) {
|
|
1741
|
-
* yield* Effect.fail(new
|
|
1742
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1742
1743
|
* }
|
|
1743
1744
|
*
|
|
1744
1745
|
* return `Success on attempt ${attempt}`
|
|
@@ -1751,7 +1752,7 @@ export const passthrough = self => fromStep(effect.map(toStep(self), step => (no
|
|
|
1751
1752
|
*
|
|
1752
1753
|
* // Combining recurs with other schedules for sophisticated retry logic
|
|
1753
1754
|
* const complexRetry = Schedule.exponential("100 millis").pipe(
|
|
1754
|
-
* Schedule.
|
|
1755
|
+
* Schedule.both(Schedule.recurs(3)) // At most 3 attempts
|
|
1755
1756
|
* )
|
|
1756
1757
|
*
|
|
1757
1758
|
* // Repeat an effect exactly 10 times
|
|
@@ -1888,12 +1889,22 @@ export const recurs = times => while_(forever, ({
|
|
|
1888
1889
|
export const reduce = /*#__PURE__*/dual(3, (self, initial, combine) => fromStep(effect.map(toStep(self), step => {
|
|
1889
1890
|
let state = initial();
|
|
1890
1891
|
return (now, input) => Pull.matchEffect(step(now, input), {
|
|
1891
|
-
onSuccess
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1892
|
+
onSuccess([output, delay]) {
|
|
1893
|
+
const next = combine(state, output);
|
|
1894
|
+
if (!isEffect(next)) {
|
|
1895
|
+
state = next;
|
|
1896
|
+
return effect.succeed([next, delay]);
|
|
1897
|
+
}
|
|
1898
|
+
return effect.map(next, nextState => {
|
|
1899
|
+
state = nextState;
|
|
1900
|
+
return [nextState, delay];
|
|
1901
|
+
});
|
|
1902
|
+
},
|
|
1895
1903
|
onFailure: effect.failCause,
|
|
1896
|
-
onDone
|
|
1904
|
+
onDone(output) {
|
|
1905
|
+
const next = combine(state, output);
|
|
1906
|
+
return isEffect(next) ? effect.flatMap(next, Cause.done) : Cause.done(next);
|
|
1907
|
+
}
|
|
1897
1908
|
});
|
|
1898
1909
|
})));
|
|
1899
1910
|
/**
|
|
@@ -1927,7 +1938,7 @@ export const reduce = /*#__PURE__*/dual(3, (self, initial, combine) => fromStep(
|
|
|
1927
1938
|
*
|
|
1928
1939
|
* // Simple spaced schedule with limited repetitions
|
|
1929
1940
|
* const limitedSpaced = Schedule.spaced("100 millis").pipe(
|
|
1930
|
-
* Schedule.
|
|
1941
|
+
* Schedule.both(Schedule.recurs(5)) // at most 5 times
|
|
1931
1942
|
* )
|
|
1932
1943
|
*
|
|
1933
1944
|
* const program = Effect.gen(function*() {
|
|
@@ -1946,7 +1957,7 @@ export const reduce = /*#__PURE__*/dual(3, (self, initial, combine) => fromStep(
|
|
|
1946
1957
|
* @category constructors
|
|
1947
1958
|
*/
|
|
1948
1959
|
export const spaced = duration => {
|
|
1949
|
-
const decoded = Duration.
|
|
1960
|
+
const decoded = Duration.fromInputUnsafe(duration);
|
|
1950
1961
|
return fromStepWithMetadata(effect.succeed(meta => effect.succeed([meta.attempt - 1, decoded])));
|
|
1951
1962
|
};
|
|
1952
1963
|
/**
|
|
@@ -1956,12 +1967,14 @@ export const spaced = duration => {
|
|
|
1956
1967
|
*
|
|
1957
1968
|
* @example
|
|
1958
1969
|
* ```ts
|
|
1959
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1970
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1971
|
+
*
|
|
1972
|
+
* class RetryError extends Data.TaggedError("RetryError")<{ readonly message: string }> {}
|
|
1960
1973
|
*
|
|
1961
1974
|
* // Log retry errors for debugging
|
|
1962
1975
|
* const errorLoggingSchedule = Schedule.exponential("100 millis").pipe(
|
|
1963
1976
|
* Schedule.take(3),
|
|
1964
|
-
* Schedule.tapInput((error:
|
|
1977
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
1965
1978
|
* Console.log(`Retry triggered by error: ${String(error)}`)
|
|
1966
1979
|
* )
|
|
1967
1980
|
* )
|
|
@@ -1973,7 +1986,7 @@ export const spaced = duration => {
|
|
|
1973
1986
|
* Effect.gen(function*() {
|
|
1974
1987
|
* attempt++
|
|
1975
1988
|
* if (attempt < 4) {
|
|
1976
|
-
* yield* Effect.fail(new
|
|
1989
|
+
* return yield* Effect.fail(new RetryError({ message: `Network timeout on attempt ${attempt}` }))
|
|
1977
1990
|
* }
|
|
1978
1991
|
* return `Success on attempt ${attempt}`
|
|
1979
1992
|
* }),
|
|
@@ -2022,7 +2035,7 @@ export const spaced = duration => {
|
|
|
2022
2035
|
* // Conditional alerting based on input
|
|
2023
2036
|
* const alertingSchedule = Schedule.exponential("200 millis").pipe(
|
|
2024
2037
|
* Schedule.take(6),
|
|
2025
|
-
* Schedule.tapInput((error:
|
|
2038
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
2026
2039
|
* Effect.gen(function*() {
|
|
2027
2040
|
* if (String(error).includes("critical")) {
|
|
2028
2041
|
* yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
|
|
@@ -2044,7 +2057,7 @@ export const spaced = duration => {
|
|
|
2044
2057
|
* const errorType = isCritical
|
|
2045
2058
|
* ? "critical database failure"
|
|
2046
2059
|
* : "temporary network issue"
|
|
2047
|
-
* yield* Effect.fail(new
|
|
2060
|
+
* return yield* Effect.fail(new RetryError({ message: errorType }))
|
|
2048
2061
|
* }),
|
|
2049
2062
|
* alertingSchedule
|
|
2050
2063
|
* ).pipe(
|
|
@@ -2057,10 +2070,10 @@ export const spaced = duration => {
|
|
|
2057
2070
|
* // Chain multiple input taps for different purposes
|
|
2058
2071
|
* const comprehensiveSchedule = Schedule.fibonacci("100 millis").pipe(
|
|
2059
2072
|
* Schedule.take(5),
|
|
2060
|
-
* Schedule.tapInput((error:
|
|
2061
|
-
* Console.log(`Error occurred: ${error.
|
|
2073
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
2074
|
+
* Console.log(`Error occurred: ${error._tag}`)
|
|
2062
2075
|
* ),
|
|
2063
|
-
* Schedule.tapInput((error:
|
|
2076
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
2064
2077
|
* String(error).length > 20
|
|
2065
2078
|
* ? Console.log("📝 Long error message detected")
|
|
2066
2079
|
* : Effect.void
|
|
@@ -2079,7 +2092,9 @@ export const tapInput = /*#__PURE__*/dual(2, (self, f) => fromStep(effect.map(to
|
|
|
2079
2092
|
*
|
|
2080
2093
|
* @example
|
|
2081
2094
|
* ```ts
|
|
2082
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2095
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2096
|
+
*
|
|
2097
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
2083
2098
|
*
|
|
2084
2099
|
* // Log schedule outputs for debugging/monitoring
|
|
2085
2100
|
* const monitoredSchedule = Schedule.exponential("100 millis").pipe(
|
|
@@ -2094,7 +2109,7 @@ export const tapInput = /*#__PURE__*/dual(2, (self, f) => fromStep(effect.map(to
|
|
|
2094
2109
|
* Effect.gen(function*() {
|
|
2095
2110
|
* attempt++
|
|
2096
2111
|
* if (attempt < 4) {
|
|
2097
|
-
* yield* Effect.fail(new
|
|
2112
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
2098
2113
|
* }
|
|
2099
2114
|
* return `Success on attempt ${attempt}`
|
|
2100
2115
|
* }),
|
|
@@ -2163,7 +2178,9 @@ export const tapOutput = /*#__PURE__*/dual(2, (self, f) => fromStep(effect.map(t
|
|
|
2163
2178
|
*
|
|
2164
2179
|
* @example
|
|
2165
2180
|
* ```ts
|
|
2166
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2181
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2182
|
+
*
|
|
2183
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
2167
2184
|
*
|
|
2168
2185
|
* // Limit an infinite schedule to run only 5 times
|
|
2169
2186
|
* const limitedHeartbeat = Schedule.spaced("1 second").pipe(
|
|
@@ -2196,7 +2213,7 @@ export const tapOutput = /*#__PURE__*/dual(2, (self, f) => fromStep(effect.map(t
|
|
|
2196
2213
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
2197
2214
|
*
|
|
2198
2215
|
* if (attempt < 5) { // Will fail more than 3 times
|
|
2199
|
-
* yield* Effect.fail(new
|
|
2216
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
2200
2217
|
* }
|
|
2201
2218
|
*
|
|
2202
2219
|
* return `Success on attempt ${attempt}`
|
|
@@ -2345,11 +2362,12 @@ const while_ = /*#__PURE__*/dual(2, (self, predicate) => fromStep(effect.map(toS
|
|
|
2345
2362
|
const meta = metadataFn();
|
|
2346
2363
|
return (now, input) => effect.flatMap(step(now, input), result => {
|
|
2347
2364
|
const [output, duration] = result;
|
|
2348
|
-
|
|
2365
|
+
const eff = predicate({
|
|
2349
2366
|
...meta(now, input),
|
|
2350
2367
|
output,
|
|
2351
2368
|
duration
|
|
2352
|
-
})
|
|
2369
|
+
});
|
|
2370
|
+
return effect.flatMap(isEffect(eff) ? eff : effect.succeed(eff), check => check ? effect.succeed(result) : Cause.done(output));
|
|
2353
2371
|
});
|
|
2354
2372
|
})));
|
|
2355
2373
|
export {
|
|
@@ -2400,7 +2418,7 @@ while_ as while };
|
|
|
2400
2418
|
* @category constructors
|
|
2401
2419
|
*/
|
|
2402
2420
|
export const windowed = interval => {
|
|
2403
|
-
const window = Duration.toMillis(Duration.
|
|
2421
|
+
const window = Duration.toMillis(Duration.fromInputUnsafe(interval));
|
|
2404
2422
|
return fromStepWithMetadata(effect.succeed(meta => effect.sync(() => [meta.attempt - 1, window === 0 ? Duration.zero : Duration.millis(window - meta.elapsed % window)])));
|
|
2405
2423
|
};
|
|
2406
2424
|
/**
|
|
@@ -2473,6 +2491,14 @@ identity_ as identity };
|
|
|
2473
2491
|
* @category ensuring types
|
|
2474
2492
|
*/
|
|
2475
2493
|
export const satisfiesInputType = () => self => self;
|
|
2494
|
+
/**
|
|
2495
|
+
* Sets the input type of the provided schedule to a specified type, without
|
|
2496
|
+
* altering the schedule's behavior.
|
|
2497
|
+
*
|
|
2498
|
+
* @since 2.0.0
|
|
2499
|
+
* @category ensuring types
|
|
2500
|
+
*/
|
|
2501
|
+
export const setInputType = () => self => self;
|
|
2476
2502
|
/**
|
|
2477
2503
|
* Ensures that the provided schedule respects a specified output type.
|
|
2478
2504
|
*
|