effect 4.0.0-rc.111 → 4.0.0-rc.113
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/AGENTS.md +24 -9
- package/CLAUDE.md +24 -9
- package/ai-docs/package.json +2 -2
- package/ai-docs/src/01_effect/01_basics/02_effect-fn.ts +18 -5
- package/ai-docs/src/01_effect/01_basics/index.md +5 -3
- package/ai-docs/src/01_effect/03_services/20_layer-composition.ts +1 -1
- package/ai-docs/src/01_effect/03_services/20_layer-unwrap.ts +2 -2
- package/ai-docs/src/01_effect/05_resources/10_acquire-release.ts +2 -2
- package/ai-docs/src/03_stream/30_encoding.ts +5 -7
- package/ai-docs/src/08_observability/10_logging.ts +1 -1
- package/ai-docs/src/70_cli/10_basics.ts +7 -7
- package/ai-docs/src/71_ai/10_language-model.ts +2 -2
- package/ai-docs/src/71_ai/20_tools.ts +1 -1
- package/ai-docs/src/71_ai/30_chat.ts +1 -1
- package/dist/Array.d.ts +109 -52
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +65 -32
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +5 -1
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +40 -23
- package/dist/BigDecimal.js.map +1 -1
- package/dist/ByteSize.d.ts +633 -0
- package/dist/ByteSize.d.ts.map +1 -0
- package/dist/ByteSize.js +524 -0
- package/dist/ByteSize.js.map +1 -0
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +17 -3
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts +97 -24
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +68 -41
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +49 -28
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +27 -18
- package/dist/Chunk.js.map +1 -1
- package/dist/Config.d.ts +162 -201
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +103 -212
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +4 -4
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +7 -7
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Context.d.ts +31 -0
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +2 -2
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +2 -2
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +3 -2
- package/dist/Crypto.js.map +1 -1
- package/dist/DateTime.d.ts +2 -2
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +6 -6
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +1 -1
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +220 -113
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +27 -26
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +58 -2
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +58 -6
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +3 -1
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +40 -10
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +1 -1
- package/dist/Equal.js.map +1 -1
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +1 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Fiber.d.ts +32 -8
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.js +3 -3
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +12 -6
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +11 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FileSystem.d.ts +42 -210
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +16 -148
- package/dist/FileSystem.js.map +1 -1
- package/dist/Formatter.d.ts +1 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +19 -3
- package/dist/Formatter.js.map +1 -1
- package/dist/Graph.d.ts +48 -20
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +20 -5
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +5 -14
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +1 -1
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashRing.d.ts +6 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +9 -2
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +1 -1
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js.map +1 -1
- package/dist/Iterable.d.ts +56 -17
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +65 -45
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.js +4 -4
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +68 -4
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +90 -4
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +67 -94
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +752 -397
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Layer.d.ts +47 -4
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +4 -6
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +24 -3
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +9 -5
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +7 -5
- package/dist/LayerRef.js.map +1 -1
- package/dist/Logger.d.ts +114 -9
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +109 -9
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.js +1 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +43 -31
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +5 -2
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +11 -4
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +14 -18
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +1 -1
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +1 -1
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +1 -1
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +13 -2
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +18 -2
- package/dist/MutableList.js.map +1 -1
- package/dist/Number.d.ts +6 -0
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +3 -1
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +5 -4
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +1 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +1 -1
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +1 -0
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +3 -1
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +1 -2
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +1 -1
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +1 -1
- package/dist/Path.js.map +1 -1
- package/dist/PlatformError.d.ts +1 -1
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +1 -1
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +137 -10
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +332 -75
- package/dist/Pool.js.map +1 -1
- package/dist/PrimaryKey.d.ts +1 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +1 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +21 -9
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +18 -14
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +82 -6
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +116 -27
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +17 -4
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +1 -1
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +137 -0
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +72 -9
- package/dist/RcMap.js.map +1 -1
- package/dist/Record.d.ts +13 -0
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js.map +1 -1
- package/dist/Redacted.d.ts +1 -1
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +1 -1
- package/dist/Redacted.js.map +1 -1
- package/dist/RequestResolver.d.ts +15 -9
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +33 -15
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Result.d.ts +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +1 -1
- package/dist/Result.js.map +1 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +19 -10
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +2200 -2433
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2797 -4184
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +359 -176
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +373 -630
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +46 -22
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +56 -53
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +123 -200
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +59 -263
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.js +2 -9
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +1276 -172
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +1371 -29
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +49 -16
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +75 -98
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +9 -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 +10 -3
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Sink.d.ts +9 -4
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +49 -31
- package/dist/Sink.js.map +1 -1
- package/dist/StandardSchema.d.ts +125 -0
- package/dist/StandardSchema.d.ts.map +1 -0
- package/dist/StandardSchema.js +9 -0
- package/dist/StandardSchema.js.map +1 -0
- package/dist/Stream.d.ts +221 -35
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +168 -84
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +16 -6
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +12 -5
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +7 -4
- package/dist/Struct.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +3 -2
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.d.ts +3 -3
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +3 -3
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +27 -7
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +38 -13
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +1 -1
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Tuple.d.ts +2 -1
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +1 -1
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +1 -1
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +1 -1
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +1 -1
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +1 -1
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +1 -1
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +1 -1
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +1 -1
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +1 -1
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +1 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +1 -1
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +1 -1
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +9 -9
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +93 -86
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +29 -1
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +29 -1
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +1 -1
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +1 -1
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +1 -1
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +1 -1
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +1 -1
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +1 -1
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +33 -19
- package/dist/Types.d.ts.map +1 -1
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +2 -1
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/model.d.ts +2 -0
- package/dist/internal/arbitrary/model.d.ts.map +1 -0
- package/dist/internal/arbitrary/model.js +495 -0
- package/dist/internal/arbitrary/model.js.map +1 -0
- package/dist/internal/arbitrary/regexp.d.ts +2 -0
- package/dist/internal/arbitrary/regexp.d.ts.map +1 -0
- package/dist/internal/arbitrary/regexp.js +789 -0
- package/dist/internal/arbitrary/regexp.js.map +1 -0
- package/dist/internal/arbitrary/runner.d.ts +2 -0
- package/dist/internal/arbitrary/runner.d.ts.map +1 -0
- package/dist/internal/arbitrary/runner.js +496 -0
- package/dist/internal/arbitrary/runner.js.map +1 -0
- package/dist/internal/arbitrary/schema.d.ts.map +1 -0
- package/dist/internal/arbitrary/schema.js +1340 -0
- package/dist/internal/arbitrary/schema.js.map +1 -0
- package/dist/internal/core.js +27 -13
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/count.d.ts +2 -0
- package/dist/internal/count.d.ts.map +1 -0
- package/dist/internal/count.js +14 -0
- package/dist/internal/count.js.map +1 -0
- package/dist/internal/dateTime.js +4 -10
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +416 -258
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/graph.js +3 -1
- package/dist/internal/graph.js.map +1 -1
- package/dist/internal/hashMap.js +5 -3
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/hashSet.js +1 -1
- package/dist/internal/hashSet.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/metric.js +1 -1
- package/dist/internal/metric.js.map +1 -1
- package/dist/internal/option.js +6 -5
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/random.js +17 -0
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js +10 -7
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.js +1 -0
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js +13 -6
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/result.js +11 -9
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schema/annotations.js +1 -1
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +238 -132
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/fromRepresentation.js +5 -5
- package/dist/internal/schema/fromRepresentation.js.map +1 -1
- package/dist/internal/schema/make.d.ts +2 -0
- package/dist/internal/schema/make.d.ts.map +1 -0
- package/dist/internal/schema/{schema.js → make.js} +1 -25
- package/dist/internal/schema/make.js.map +1 -0
- package/dist/internal/schema/parser.d.ts +0 -12
- package/dist/internal/schema/parser.d.ts.map +1 -1
- package/dist/internal/schema/parser.js +7 -0
- package/dist/internal/schema/parser.js.map +1 -1
- package/dist/internal/schema/standardSchema.d.ts +2 -0
- package/dist/internal/schema/standardSchema.d.ts.map +1 -0
- package/dist/internal/schema/standardSchema.js +112 -0
- package/dist/internal/schema/standardSchema.js.map +1 -0
- package/dist/internal/schema/toCodeDocument.js +34 -22
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toCodec.d.ts +2 -0
- package/dist/internal/schema/toCodec.d.ts.map +1 -0
- package/dist/internal/schema/toCodec.js +242 -0
- package/dist/internal/schema/toCodec.js.map +1 -0
- package/dist/internal/schema/toDifferJsonPatch.d.ts +2 -0
- package/dist/internal/schema/toDifferJsonPatch.d.ts.map +1 -0
- package/dist/internal/schema/toDifferJsonPatch.js +20 -0
- package/dist/internal/schema/toDifferJsonPatch.js.map +1 -0
- package/dist/internal/schema/toEncoderXml.d.ts +2 -0
- package/dist/internal/schema/toEncoderXml.d.ts.map +1 -0
- package/dist/internal/schema/toEncoderXml.js +104 -0
- package/dist/internal/schema/toEncoderXml.js.map +1 -0
- package/dist/internal/schema/toEquivalence.js +66 -0
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/schema/toFormatter.d.ts +2 -0
- package/dist/internal/schema/toFormatter.d.ts.map +1 -0
- package/dist/internal/schema/toFormatter.js +227 -0
- package/dist/internal/schema/toFormatter.js.map +1 -0
- package/dist/internal/schema/toIso.d.ts +2 -0
- package/dist/internal/schema/toIso.d.ts.map +1 -0
- package/dist/internal/schema/toIso.js +17 -0
- package/dist/internal/schema/toIso.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +122 -71
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/toRepresentation.js +3 -1
- package/dist/internal/schema/toRepresentation.js.map +1 -1
- package/dist/internal/schemaError.d.ts +4 -0
- package/dist/internal/schemaError.d.ts.map +1 -0
- package/dist/internal/schemaError.js +6 -0
- package/dist/internal/schemaError.js.map +1 -0
- package/dist/internal/stream.js +5 -6
- package/dist/internal/stream.js.map +1 -1
- package/dist/internal/tracer.d.ts +1 -3
- package/dist/internal/tracer.d.ts.map +1 -1
- package/dist/internal/tracer.js +6 -0
- package/dist/internal/tracer.js.map +1 -1
- package/dist/internal/trie.js +2 -2
- package/dist/internal/trie.js.map +1 -1
- package/dist/internal/uuid.d.ts +1 -2
- package/dist/internal/uuid.d.ts.map +1 -1
- package/dist/internal/uuid.js +2 -0
- package/dist/internal/uuid.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +9 -11
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +20 -18
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -4
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -4
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +98 -23
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +98 -6
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +5 -16
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +27 -32
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +10 -13
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +23 -16
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +13 -11
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +48 -37
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +150 -47
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +2 -2
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +87 -78
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +3 -14
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +2 -2
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +15 -4
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +37 -94
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +46 -96
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +4 -5
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +38 -20
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +27 -1
- 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 +30 -18
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +2 -2
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/structured-output.js +28 -5
- package/dist/unstable/ai/internal/structured-output.js.map +1 -1
- package/dist/unstable/arbitrary/Arbitrary.d.ts +626 -0
- package/dist/unstable/arbitrary/Arbitrary.d.ts.map +1 -0
- package/dist/unstable/arbitrary/Arbitrary.js +238 -0
- package/dist/unstable/arbitrary/Arbitrary.js.map +1 -0
- package/dist/unstable/arbitrary/index.d.ts +8 -0
- package/dist/unstable/arbitrary/index.d.ts.map +1 -0
- package/dist/unstable/arbitrary/index.js +9 -0
- package/dist/unstable/arbitrary/index.js.map +1 -0
- package/dist/unstable/cli/Argument.d.ts +104 -108
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +56 -57
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +2 -0
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +2 -0
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.js +27 -4
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +73 -73
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +22 -22
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +4 -4
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +150 -161
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +79 -90
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +3 -3
- package/dist/unstable/cli/GlobalFlag.js +13 -13
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +118 -126
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +104 -113
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +69 -58
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +65 -66
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +113 -59
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +391 -327
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js +109 -38
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +23 -11
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js +15 -7
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js +6 -4
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.js +4 -4
- package/dist/unstable/cli/internal/parser.js +1 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.d.ts +5 -1
- package/dist/unstable/cli/internal/wizard.d.ts.map +1 -1
- package/dist/unstable/cli/internal/wizard.js +34 -26
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +13 -0
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +16 -1
- 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 +57 -14
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +2 -0
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +2 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +22 -5
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +23 -3
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +32 -13
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +17 -5
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +21 -8
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +34 -4
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +33 -12
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +5 -4
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +21 -12
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +12 -6
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +11 -5
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +56 -35
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +32 -17
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +23 -23
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +2 -2
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +4 -3
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +11 -8
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +11 -4
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/clusterAbandon.d.ts +5 -0
- package/dist/unstable/cluster/internal/clusterAbandon.d.ts.map +1 -0
- package/dist/unstable/cluster/internal/clusterAbandon.js +9 -0
- package/dist/unstable/cluster/internal/clusterAbandon.js.map +1 -0
- package/dist/unstable/cluster/internal/entityManager.js +10 -6
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/interruptors.js +30 -1
- package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +12 -7
- 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 +12 -7
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/encoding/Ini.d.ts +2 -0
- package/dist/unstable/encoding/Ini.d.ts.map +1 -1
- package/dist/unstable/encoding/Ini.js +2 -0
- package/dist/unstable/encoding/Ini.js.map +1 -1
- package/dist/unstable/encoding/SchemaBinary.d.ts +273 -0
- package/dist/unstable/encoding/SchemaBinary.d.ts.map +1 -0
- package/dist/unstable/encoding/SchemaBinary.js +4573 -0
- package/dist/unstable/encoding/SchemaBinary.js.map +1 -0
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/Toml.d.ts +2 -0
- package/dist/unstable/encoding/Toml.d.ts.map +1 -1
- package/dist/unstable/encoding/Toml.js +6 -4
- package/dist/unstable/encoding/Toml.js.map +1 -1
- package/dist/unstable/encoding/Yaml.d.ts +2 -0
- package/dist/unstable/encoding/Yaml.d.ts.map +1 -1
- package/dist/unstable/encoding/Yaml.js +16 -5
- package/dist/unstable/encoding/Yaml.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +2 -2
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +2 -2
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +5 -5
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +3 -3
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +15 -9
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +26 -12
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +13 -9
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +11 -5
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +25 -15
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +7 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +13 -3
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +2 -2
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +0 -10
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +29 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +5 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +1 -45
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +2 -64
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +1 -1
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/FindMyWay/internal/router.js +124 -33
- package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/unstable/http/FindMyWay.d.ts +15 -5
- package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
- package/dist/unstable/http/FindMyWay.js +3 -1
- package/dist/unstable/http/FindMyWay.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +0 -22
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +3 -34
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +41 -10
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +64 -10
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +28 -18
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +28 -6
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +8 -19
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +10 -6
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +16 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +121 -65
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +3 -3
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +1 -13
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +29 -21
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +12 -11
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +36 -10
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +5 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +22 -8
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +11 -42
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +16 -20
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +11 -11
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +1 -1
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +9 -13
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +34 -44
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +2 -2
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +19 -19
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/Mime.d.ts +28 -0
- package/dist/unstable/http/Mime.d.ts.map +1 -0
- package/dist/unstable/http/Mime.js +72 -0
- package/dist/unstable/http/Mime.js.map +1 -0
- package/dist/unstable/http/Multipart.d.ts +22 -9
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +26 -10
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +1 -1
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -1
- package/dist/unstable/http/MultipartParser/internal/multipart.js +8 -3
- package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser.d.ts +4 -3
- package/dist/unstable/http/MultipartParser.d.ts.map +1 -1
- package/dist/unstable/http/MultipartParser.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +0 -97
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +3 -104
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +4 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +4 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/compression.js +8 -11
- package/dist/unstable/http/internal/compression.js.map +1 -1
- package/dist/unstable/http/internal/headers.d.ts +2 -0
- package/dist/unstable/http/internal/headers.d.ts.map +1 -0
- package/dist/unstable/http/internal/headers.js +5 -0
- package/dist/unstable/http/internal/headers.js.map +1 -0
- package/dist/unstable/http/internal/httpBody.js +8 -0
- package/dist/unstable/http/internal/httpBody.js.map +1 -1
- package/dist/unstable/http/internal/mimeTypes.d.ts +361 -0
- package/dist/unstable/http/internal/mimeTypes.d.ts.map +1 -0
- package/dist/unstable/http/internal/mimeTypes.js +363 -0
- package/dist/unstable/http/internal/mimeTypes.js.map +1 -0
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +13 -0
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +28 -11
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +25 -13
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +8 -3
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +9 -6
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +3 -1
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +7 -5
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +15 -12
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +12 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +8 -10
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +6 -3
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +8 -2
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +31 -20
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/net/IpInterface.d.ts +140 -0
- package/dist/unstable/net/IpInterface.d.ts.map +1 -0
- package/dist/unstable/net/IpInterface.js +149 -0
- package/dist/unstable/net/IpInterface.js.map +1 -0
- package/dist/unstable/net/IpNetwork.d.ts +227 -0
- package/dist/unstable/net/IpNetwork.d.ts.map +1 -0
- package/dist/unstable/net/IpNetwork.js +239 -0
- package/dist/unstable/net/IpNetwork.js.map +1 -0
- package/dist/unstable/net/NetAddress.d.ts +705 -0
- package/dist/unstable/net/NetAddress.d.ts.map +1 -0
- package/dist/unstable/net/NetAddress.js +956 -0
- package/dist/unstable/net/NetAddress.js.map +1 -0
- package/dist/unstable/net/index.d.ts +16 -0
- package/dist/unstable/net/index.d.ts.map +1 -0
- package/dist/unstable/net/index.js +17 -0
- package/dist/unstable/net/index.js.map +1 -0
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -0
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +4 -6
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +9 -9
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +9 -8
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +2 -2
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +82 -55
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.d.ts +1 -1
- package/dist/unstable/observability/internal/otlpEnv.d.ts.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js +5 -9
- package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +1 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +114 -14
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +799 -234
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +28 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +33 -41
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +8 -2
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +7 -2
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +6 -3
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +3 -6
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +6 -3
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +2 -3
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -4
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +20 -6
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +26 -26
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +10 -12
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +5 -0
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +94 -81
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +66 -7
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +68 -9
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +7 -5
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +28 -33
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +56 -92
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +25 -0
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +125 -68
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +7 -6
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +3 -0
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +287 -102
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +408 -215
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +5 -32
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +3 -3
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +20 -0
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +14 -7
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +15 -0
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +1 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +13 -5
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +29 -15
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +3 -1
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -0
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +14 -4
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +2 -2
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +8 -0
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +8 -0
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +5 -0
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +70 -12
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +6 -0
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +11 -0
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +2 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +4 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/package.json +8 -10
- package/src/Array.ts +142 -70
- package/src/BigDecimal.ts +50 -28
- package/src/ByteSize.ts +838 -0
- package/src/Cache.ts +17 -3
- package/src/Cause.ts +1 -1
- package/src/Channel.ts +185 -50
- package/src/Chunk.ts +65 -36
- package/src/Config.ts +237 -248
- package/src/ConfigProvider.ts +7 -8
- package/src/Context.ts +31 -0
- package/src/Cron.ts +2 -2
- package/src/Crypto.ts +3 -2
- package/src/Deferred.ts +7 -6
- package/src/Duration.ts +1 -1
- package/src/Effect.ts +226 -122
- package/src/Effectable.ts +78 -9
- package/src/Encoding.ts +101 -11
- package/src/Equal.ts +1 -1
- package/src/ExecutionPlan.ts +3 -0
- package/src/Fiber.ts +33 -8
- package/src/FiberHandle.ts +3 -3
- package/src/FiberMap.ts +19 -10
- package/src/FileSystem.ts +55 -230
- package/src/Formatter.ts +21 -3
- package/src/Graph.ts +55 -25
- package/src/Hash.ts +5 -16
- package/src/HashRing.ts +9 -2
- package/src/HashSet.ts +56 -0
- package/src/Iterable.ts +90 -44
- package/src/JsonPatch.ts +4 -4
- package/src/JsonPointer.ts +97 -4
- package/src/JsonSchema.ts +998 -476
- package/src/Layer.ts +59 -18
- package/src/LayerMap.ts +38 -6
- package/src/LayerRef.ts +7 -5
- package/src/Logger.ts +125 -18
- package/src/ManagedRuntime.ts +1 -1
- package/src/Match.ts +33 -14
- package/src/Metric.ts +24 -21
- package/src/MutableHashMap.ts +1 -1
- package/src/MutableHashSet.ts +1 -1
- package/src/MutableList.ts +18 -2
- package/src/Number.ts +7 -1
- package/src/Optic.ts +8 -4
- package/src/Option.ts +1 -1
- package/src/Order.ts +3 -1
- package/src/PartitionedSemaphore.ts +1 -2
- package/src/Path.ts +1 -1
- package/src/PlatformError.ts +1 -1
- package/src/Pool.ts +535 -134
- package/src/PrimaryKey.ts +1 -1
- package/src/PubSub.ts +32 -20
- package/src/Queue.ts +119 -28
- package/src/Random.ts +20 -6
- package/src/RcMap.ts +176 -13
- package/src/Record.ts +15 -0
- package/src/Redacted.ts +1 -1
- package/src/RequestResolver.ts +49 -26
- package/src/Result.ts +1 -1
- package/src/Scheduler.ts +21 -11
- package/src/Schema.ts +5032 -6518
- package/src/SchemaAST.ts +1156 -316
- package/src/SchemaGetter.ts +75 -21
- package/src/SchemaIssue.ts +260 -16
- package/src/SchemaParser.ts +2 -12
- package/src/SchemaRepresentation.ts +1774 -189
- package/src/SchemaTransformation.ts +145 -22
- package/src/Scope.ts +9 -2
- package/src/ScopedCache.ts +10 -3
- package/src/Sink.ts +31 -15
- package/src/StandardSchema.ts +207 -0
- package/src/Stream.ts +294 -76
- package/src/String.ts +20 -9
- package/src/Struct.ts +8 -4
- package/src/SynchronizedRef.ts +3 -5
- package/src/Terminal.ts +3 -3
- package/src/Tracer.ts +43 -14
- package/src/Tuple.ts +3 -1
- package/src/TxChunk.ts +1 -1
- package/src/TxDeferred.ts +1 -1
- package/src/TxHashMap.ts +1 -1
- package/src/TxHashSet.ts +92 -11
- package/src/TxPriorityQueue.ts +1 -1
- package/src/TxPubSub.ts +1 -1
- package/src/TxQueue.ts +22 -17
- package/src/TxReentrantLock.ts +29 -1
- package/src/TxRef.ts +1 -1
- package/src/TxSemaphore.ts +1 -1
- package/src/TxSubscriptionRef.ts +1 -1
- package/src/Types.ts +40 -17
- package/src/Utils.ts +3 -1
- package/src/index.ts +10 -0
- package/src/internal/arbitrary/model.ts +701 -0
- package/src/internal/arbitrary/regexp.ts +855 -0
- package/src/internal/arbitrary/runner.ts +608 -0
- package/src/internal/arbitrary/schema.ts +1800 -0
- package/src/internal/core.ts +48 -22
- package/src/internal/count.ts +14 -0
- package/src/internal/dateTime.ts +8 -10
- package/src/internal/effect.ts +510 -301
- package/src/internal/graph.ts +6 -1
- package/src/internal/hashMap.ts +5 -3
- package/src/internal/hashSet.ts +1 -1
- package/src/internal/matcher.ts +34 -19
- package/src/internal/metric.ts +1 -1
- package/src/internal/option.ts +8 -6
- package/src/internal/random.ts +20 -7
- package/src/internal/rcRef.ts +10 -7
- package/src/internal/references.ts +1 -0
- package/src/internal/request.ts +12 -7
- package/src/internal/result.ts +15 -11
- package/src/internal/schema/annotations.ts +3 -3
- package/src/internal/schema/fromJsonSchemaDocument.ts +326 -160
- package/src/internal/schema/fromRepresentation.ts +5 -3
- package/src/internal/schema/{schema.ts → make.ts} +0 -40
- package/src/internal/schema/parser.ts +8 -0
- package/src/internal/schema/standardSchema.ts +125 -0
- package/src/internal/schema/toCodeDocument.ts +58 -44
- package/src/internal/schema/toCodec.ts +312 -0
- package/src/internal/schema/toDifferJsonPatch.ts +24 -0
- package/src/internal/schema/toEncoderXml.ts +110 -0
- package/src/internal/schema/toEquivalence.ts +76 -0
- package/src/internal/schema/toFormatter.ts +230 -0
- package/src/internal/schema/toIso.ts +20 -0
- package/src/internal/schema/toJsonSchemaDocument.ts +125 -67
- package/src/internal/schema/toRepresentation.ts +1 -1
- package/src/internal/schemaError.ts +8 -0
- package/src/internal/stream.ts +14 -6
- package/src/internal/tracer.ts +4 -0
- package/src/internal/trie.ts +5 -2
- package/src/internal/uuid.ts +4 -0
- package/src/testing/TestSchema.ts +36 -30
- package/src/testing/index.ts +0 -5
- package/src/unstable/ai/AiError.ts +126 -6
- package/src/unstable/ai/AnthropicStructuredOutput.ts +8 -5
- package/src/unstable/ai/Chat.ts +35 -36
- package/src/unstable/ai/EmbeddingModel.ts +27 -15
- package/src/unstable/ai/LanguageModel.ts +283 -100
- package/src/unstable/ai/McpServer.ts +105 -92
- package/src/unstable/ai/OpenAiStructuredOutput.ts +6 -3
- package/src/unstable/ai/Prompt.ts +20 -5
- package/src/unstable/ai/Response.ts +107 -189
- package/src/unstable/ai/Tokenizer.ts +4 -5
- package/src/unstable/ai/Tool.ts +58 -35
- package/src/unstable/ai/Toolkit.ts +43 -37
- package/src/unstable/ai/internal/codec-transformer.ts +3 -2
- package/src/unstable/ai/internal/structured-output.ts +29 -6
- package/src/unstable/arbitrary/Arbitrary.ts +715 -0
- package/src/unstable/arbitrary/index.ts +10 -0
- package/src/unstable/cli/Argument.ts +111 -115
- package/src/unstable/cli/CliError.ts +2 -0
- package/src/unstable/cli/CliOutput.ts +41 -4
- package/src/unstable/cli/Command.ts +79 -78
- package/src/unstable/cli/Completions.ts +4 -4
- package/src/unstable/cli/Flag.ts +158 -169
- package/src/unstable/cli/GlobalFlag.ts +13 -13
- package/src/unstable/cli/Param.ts +150 -159
- package/src/unstable/cli/Primitive.ts +75 -76
- package/src/unstable/cli/Prompt.ts +543 -408
- package/src/unstable/cli/internal/completions/bash.ts +113 -38
- package/src/unstable/cli/internal/completions/descriptor.ts +23 -11
- package/src/unstable/cli/internal/completions/fish.ts +17 -9
- package/src/unstable/cli/internal/completions/zsh.ts +7 -4
- package/src/unstable/cli/internal/config.ts +4 -4
- package/src/unstable/cli/internal/parser.ts +1 -1
- package/src/unstable/cli/internal/wizard.ts +60 -32
- package/src/unstable/cluster/ClusterSchema.ts +19 -1
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +66 -16
- package/src/unstable/cluster/Entity.ts +3 -0
- package/src/unstable/cluster/EntityProxyServer.ts +6 -2
- package/src/unstable/cluster/Envelope.ts +32 -3
- package/src/unstable/cluster/HttpRunner.ts +52 -25
- package/src/unstable/cluster/Message.ts +35 -13
- package/src/unstable/cluster/MessageStorage.ts +69 -24
- package/src/unstable/cluster/Reply.ts +36 -19
- package/src/unstable/cluster/RunnerServer.ts +21 -11
- package/src/unstable/cluster/Runners.ts +93 -80
- package/src/unstable/cluster/Sharding.ts +44 -19
- package/src/unstable/cluster/ShardingConfig.ts +23 -23
- package/src/unstable/cluster/SocketRunner.ts +5 -4
- package/src/unstable/cluster/SqlMessageStorage.ts +12 -8
- package/src/unstable/cluster/SqlRunnerStorage.ts +18 -10
- package/src/unstable/cluster/internal/clusterAbandon.ts +14 -0
- package/src/unstable/cluster/internal/entityManager.ts +15 -6
- package/src/unstable/cluster/internal/interruptors.ts +58 -1
- package/src/unstable/cluster/internal/resourceRef.ts +15 -7
- package/src/unstable/devtools/DevToolsClient.ts +13 -3
- package/src/unstable/encoding/Ini.ts +2 -0
- package/src/unstable/encoding/SchemaBinary.ts +5308 -0
- package/src/unstable/encoding/Sse.ts +1 -1
- package/src/unstable/encoding/Toml.ts +7 -5
- package/src/unstable/encoding/Yaml.ts +18 -5
- package/src/unstable/encoding/index.ts +2 -2
- package/src/unstable/eventlog/Event.ts +7 -7
- package/src/unstable/eventlog/EventJournal.ts +22 -15
- package/src/unstable/eventlog/EventLog.ts +24 -14
- package/src/unstable/eventlog/EventLogMessage.ts +25 -15
- package/src/unstable/eventlog/EventLogRemote.ts +15 -4
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +2 -2
- package/src/unstable/eventlog/SqlEventJournal.ts +35 -10
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +11 -1
- package/src/unstable/http/Cookies.ts +2 -102
- package/src/unstable/http/FetchHttpClient.ts +1 -1
- package/src/unstable/http/FindMyWay/internal/router.ts +139 -33
- package/src/unstable/http/FindMyWay.ts +15 -5
- package/src/unstable/http/Headers.ts +3 -48
- package/src/unstable/http/HttpBody.ts +107 -36
- package/src/unstable/http/HttpClient.ts +41 -30
- package/src/unstable/http/HttpClientRequest.ts +32 -18
- package/src/unstable/http/HttpClientResponse.ts +16 -3
- package/src/unstable/http/HttpEffect.ts +145 -73
- package/src/unstable/http/HttpIncomingMessage.ts +4 -4
- package/src/unstable/http/HttpMiddleware.ts +43 -24
- package/src/unstable/http/HttpPlatform.ts +62 -20
- package/src/unstable/http/HttpRouter.ts +27 -16
- package/src/unstable/http/HttpServer.ts +18 -57
- package/src/unstable/http/HttpServerRequest.ts +17 -15
- package/src/unstable/http/HttpServerRespondable.ts +1 -1
- package/src/unstable/http/HttpServerResponse.ts +49 -40
- package/src/unstable/http/HttpStaticServer.ts +30 -28
- package/src/unstable/http/Mime.ts +76 -0
- package/src/unstable/http/Multipart.ts +35 -18
- package/src/unstable/http/MultipartParser/internal/multipart.ts +10 -3
- package/src/unstable/http/MultipartParser.ts +4 -3
- package/src/unstable/http/UrlParams.ts +3 -161
- package/src/unstable/http/index.ts +5 -0
- package/src/unstable/http/internal/compression.ts +11 -12
- package/src/unstable/http/internal/headers.ts +7 -0
- package/src/unstable/http/internal/httpBody.ts +9 -0
- package/src/unstable/http/internal/mimeTypes.ts +395 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +63 -11
- package/src/unstable/httpapi/HttpApiClient.ts +44 -24
- package/src/unstable/httpapi/HttpApiEndpoint.ts +24 -11
- package/src/unstable/httpapi/HttpApiError.ts +3 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +7 -5
- package/src/unstable/httpapi/HttpApiScalar.ts +30 -27
- package/src/unstable/httpapi/HttpApiSchema.ts +14 -7
- package/src/unstable/httpapi/HttpApiSwagger.ts +6 -3
- package/src/unstable/httpapi/HttpApiTest.ts +6 -1
- package/src/unstable/httpapi/OpenApi.ts +32 -22
- package/src/unstable/net/IpInterface.ts +242 -0
- package/src/unstable/net/IpNetwork.ts +357 -0
- package/src/unstable/net/NetAddress.ts +1271 -0
- package/src/unstable/net/index.ts +20 -0
- package/src/unstable/observability/OtlpExporter.ts +5 -6
- package/src/unstable/observability/OtlpLogger.ts +9 -9
- package/src/unstable/observability/OtlpMetrics.ts +9 -8
- package/src/unstable/observability/OtlpResource.ts +5 -4
- package/src/unstable/observability/OtlpTracer.ts +103 -81
- package/src/unstable/observability/internal/otlpEnv.ts +10 -13
- package/src/unstable/persistence/PersistedCache.ts +1 -1
- package/src/unstable/persistence/PersistedQueue.ts +1100 -291
- package/src/unstable/persistence/RateLimiter.ts +64 -58
- package/src/unstable/process/ChildProcess.ts +15 -4
- package/src/unstable/process/ChildProcessSpawner.ts +1 -1
- package/src/unstable/reactivity/Atom.ts +6 -3
- package/src/unstable/reactivity/AtomHttpApi.ts +21 -10
- package/src/unstable/reactivity/AtomRegistry.ts +2 -4
- package/src/unstable/reactivity/AtomRpc.ts +6 -5
- package/src/unstable/reactivity/Hydration.ts +26 -7
- package/src/unstable/reactivity/Reactivity.ts +49 -36
- package/src/unstable/rpc/RpcClient.ts +100 -82
- package/src/unstable/rpc/RpcMessage.ts +78 -11
- package/src/unstable/rpc/RpcMiddleware.ts +7 -5
- package/src/unstable/rpc/RpcSerialization.ts +82 -92
- package/src/unstable/rpc/RpcServer.ts +171 -93
- package/src/unstable/schema/Model.ts +8 -7
- package/src/unstable/schema/VariantSchema.ts +3 -0
- package/src/unstable/socket/Socket.ts +714 -383
- package/src/unstable/socket/SocketServer.ts +5 -35
- package/src/unstable/sql/SqlClient.ts +42 -7
- package/src/unstable/sql/SqlConnection.ts +18 -0
- package/src/unstable/sql/SqlModel.ts +1 -1
- package/src/unstable/sql/Statement.ts +46 -20
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +3 -1
- package/src/unstable/workflow/Activity.ts +20 -9
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +6 -0
- package/src/unstable/workflow/DurableQueue.ts +8 -0
- package/src/unstable/workflow/Workflow.ts +105 -28
- package/src/unstable/workflow/WorkflowEngine.ts +22 -0
- package/src/unstable/workflow/WorkflowProxy.ts +8 -4
- package/dist/internal/schema/schema.d.ts.map +0 -1
- package/dist/internal/schema/schema.js.map +0 -1
- package/dist/internal/schema/toArbitrary.d.ts +0 -2
- package/dist/internal/schema/toArbitrary.d.ts.map +0 -1
- package/dist/internal/schema/toArbitrary.js +0 -705
- package/dist/internal/schema/toArbitrary.js.map +0 -1
- package/dist/testing/FastCheck.d.ts +0 -90
- package/dist/testing/FastCheck.d.ts.map +0 -1
- package/dist/testing/FastCheck.js +0 -90
- package/dist/testing/FastCheck.js.map +0 -1
- package/dist/unstable/encoding/Msgpack.d.ts +0 -185
- package/dist/unstable/encoding/Msgpack.d.ts.map +0 -1
- package/dist/unstable/encoding/Msgpack.js +0 -227
- package/dist/unstable/encoding/Msgpack.js.map +0 -1
- package/src/internal/schema/toArbitrary.ts +0 -843
- package/src/testing/FastCheck.ts +0 -90
- package/src/unstable/encoding/Msgpack.ts +0 -432
- /package/dist/internal/{schema → arbitrary}/schema.d.ts +0 -0
|
@@ -16,7 +16,7 @@ import { dual, identity, type LazyArg } from "../../Function.ts"
|
|
|
16
16
|
import * as Option from "../../Option.ts"
|
|
17
17
|
import { type Pipeable, pipeArguments } from "../../Pipeable.ts"
|
|
18
18
|
import * as Predicate from "../../Predicate.ts"
|
|
19
|
-
import type * as
|
|
19
|
+
import type * as Redacted_ from "../../Redacted.ts"
|
|
20
20
|
import * as Result from "../../Result.ts"
|
|
21
21
|
import * as Schema from "../../Schema.ts"
|
|
22
22
|
import type { Covariant } from "../../Types.ts"
|
|
@@ -279,7 +279,7 @@ const Proto = {
|
|
|
279
279
|
* ```ts import.meta.vitest
|
|
280
280
|
* import { Param } from "effect/unstable/cli"
|
|
281
281
|
*
|
|
282
|
-
* const maybeParam = Param.
|
|
282
|
+
* const maybeParam = Param.String(Param.flagKind, "name")
|
|
283
283
|
*
|
|
284
284
|
* Param.isParam(maybeParam) // => true
|
|
285
285
|
* ```
|
|
@@ -297,7 +297,7 @@ export const isParam = (u: unknown): u is Param<any, ParamKind> => Predicate.has
|
|
|
297
297
|
* ```ts import.meta.vitest
|
|
298
298
|
* import { Param } from "effect/unstable/cli"
|
|
299
299
|
*
|
|
300
|
-
* const nameParam = Param.
|
|
300
|
+
* const nameParam = Param.String(Param.flagKind, "name")
|
|
301
301
|
* const optionalParam = Param.optional(nameParam)
|
|
302
302
|
*
|
|
303
303
|
* Param.isSingle(nameParam) // => true
|
|
@@ -364,10 +364,10 @@ export const makeSingle = <const Kind extends ParamKind, A>(params: {
|
|
|
364
364
|
* import { Param } from "effect/unstable/cli"
|
|
365
365
|
*
|
|
366
366
|
* // Create a string flag
|
|
367
|
-
* const nameFlag = Param.
|
|
367
|
+
* const nameFlag = Param.String(Param.flagKind, "name")
|
|
368
368
|
*
|
|
369
369
|
* // Create a string argument
|
|
370
|
-
* const fileArg = Param.
|
|
370
|
+
* const fileArg = Param.String(Param.argumentKind, "file")
|
|
371
371
|
*
|
|
372
372
|
* // Usage in CLI: --name "John Doe" or as positional argument
|
|
373
373
|
* const kinds = [nameFlag.kind, fileArg.kind] // => ["flag", "argument"]
|
|
@@ -376,13 +376,13 @@ export const makeSingle = <const Kind extends ParamKind, A>(params: {
|
|
|
376
376
|
* @category constructors
|
|
377
377
|
* @since 4.0.0
|
|
378
378
|
*/
|
|
379
|
-
export const
|
|
379
|
+
export const String = <const Kind extends ParamKind>(
|
|
380
380
|
kind: Kind,
|
|
381
381
|
name: string
|
|
382
382
|
): Param<Kind, string> =>
|
|
383
383
|
makeSingle({
|
|
384
384
|
name,
|
|
385
|
-
primitiveType: Primitive.
|
|
385
|
+
primitiveType: Primitive.String,
|
|
386
386
|
kind
|
|
387
387
|
})
|
|
388
388
|
|
|
@@ -395,10 +395,10 @@ export const string = <const Kind extends ParamKind>(
|
|
|
395
395
|
* import { Param } from "effect/unstable/cli"
|
|
396
396
|
*
|
|
397
397
|
* // Create a boolean flag
|
|
398
|
-
* const verboseFlag = Param.
|
|
398
|
+
* const verboseFlag = Param.Boolean(Param.flagKind, "verbose")
|
|
399
399
|
*
|
|
400
400
|
* // Create a boolean argument
|
|
401
|
-
* const enableArg = Param.
|
|
401
|
+
* const enableArg = Param.Boolean(Param.argumentKind, "enable")
|
|
402
402
|
*
|
|
403
403
|
* // Usage in CLI: --verbose (true) or --no-verbose (false).
|
|
404
404
|
* // The flag is required unless made optional or given a fallback.
|
|
@@ -409,13 +409,13 @@ export const string = <const Kind extends ParamKind>(
|
|
|
409
409
|
* @category constructors
|
|
410
410
|
* @since 4.0.0
|
|
411
411
|
*/
|
|
412
|
-
export const
|
|
412
|
+
export const Boolean = <const Kind extends ParamKind>(
|
|
413
413
|
kind: Kind,
|
|
414
414
|
name: string
|
|
415
415
|
): Param<Kind, boolean> =>
|
|
416
416
|
makeSingle({
|
|
417
417
|
name,
|
|
418
|
-
primitiveType: Primitive.
|
|
418
|
+
primitiveType: Primitive.Boolean,
|
|
419
419
|
kind
|
|
420
420
|
})
|
|
421
421
|
|
|
@@ -428,10 +428,10 @@ export const boolean = <const Kind extends ParamKind>(
|
|
|
428
428
|
* import { Param } from "effect/unstable/cli"
|
|
429
429
|
*
|
|
430
430
|
* // Create an integer flag
|
|
431
|
-
* const portFlag = Param.
|
|
431
|
+
* const portFlag = Param.Int(Param.flagKind, "port")
|
|
432
432
|
*
|
|
433
433
|
* // Create an integer argument
|
|
434
|
-
* const countArg = Param.
|
|
434
|
+
* const countArg = Param.Int(Param.argumentKind, "count")
|
|
435
435
|
*
|
|
436
436
|
* // Usage in CLI: --port 8080 or as positional argument: 42
|
|
437
437
|
* const kinds = [portFlag.kind, countArg.kind] // => ["flag", "argument"]
|
|
@@ -440,44 +440,41 @@ export const boolean = <const Kind extends ParamKind>(
|
|
|
440
440
|
* @category constructors
|
|
441
441
|
* @since 4.0.0
|
|
442
442
|
*/
|
|
443
|
-
export const
|
|
443
|
+
export const Int = <const Kind extends ParamKind>(
|
|
444
444
|
kind: Kind,
|
|
445
445
|
name: string
|
|
446
446
|
): Param<Kind, number> =>
|
|
447
447
|
makeSingle({
|
|
448
448
|
name,
|
|
449
|
-
primitiveType: Primitive.
|
|
449
|
+
primitiveType: Primitive.Int,
|
|
450
450
|
kind
|
|
451
451
|
})
|
|
452
452
|
|
|
453
453
|
/**
|
|
454
|
-
* Creates a
|
|
454
|
+
* Creates a finite number parameter.
|
|
455
455
|
*
|
|
456
|
-
* **Example** (Creating
|
|
456
|
+
* **Example** (Creating finite number parameters)
|
|
457
457
|
*
|
|
458
458
|
* ```ts import.meta.vitest
|
|
459
459
|
* import { Param } from "effect/unstable/cli"
|
|
460
460
|
*
|
|
461
|
-
*
|
|
462
|
-
* const rateFlag = Param.float(Param.flagKind, "rate")
|
|
461
|
+
* const rateFlag = Param.Finite(Param.flagKind, "rate")
|
|
463
462
|
*
|
|
464
|
-
*
|
|
465
|
-
* const thresholdArg = Param.float(Param.argumentKind, "threshold")
|
|
463
|
+
* const thresholdArg = Param.Finite(Param.argumentKind, "threshold")
|
|
466
464
|
*
|
|
467
|
-
* // Usage in CLI: --rate 0.95 or as positional argument: 3.14159
|
|
468
465
|
* const kinds = [rateFlag.kind, thresholdArg.kind] // => ["flag", "argument"]
|
|
469
466
|
* ```
|
|
470
467
|
*
|
|
471
468
|
* @category constructors
|
|
472
469
|
* @since 4.0.0
|
|
473
470
|
*/
|
|
474
|
-
export const
|
|
471
|
+
export const Finite = <const Kind extends ParamKind>(
|
|
475
472
|
kind: Kind,
|
|
476
473
|
name: string
|
|
477
474
|
): Param<Kind, number> =>
|
|
478
475
|
makeSingle({
|
|
479
476
|
name,
|
|
480
|
-
primitiveType: Primitive.
|
|
477
|
+
primitiveType: Primitive.Finite,
|
|
481
478
|
kind
|
|
482
479
|
})
|
|
483
480
|
|
|
@@ -490,10 +487,10 @@ export const float = <const Kind extends ParamKind>(
|
|
|
490
487
|
* import { Param } from "effect/unstable/cli"
|
|
491
488
|
*
|
|
492
489
|
* // Create a date flag
|
|
493
|
-
* const startFlag = Param.
|
|
490
|
+
* const startFlag = Param.Date(Param.flagKind, "start-date")
|
|
494
491
|
*
|
|
495
492
|
* // Create a date argument
|
|
496
|
-
* const dueDateArg = Param.
|
|
493
|
+
* const dueDateArg = Param.Date(Param.argumentKind, "due-date")
|
|
497
494
|
*
|
|
498
495
|
* // Usage in CLI: --start-date "2023-12-25" or as positional: "2023-01-01"
|
|
499
496
|
* // Parses to JavaScript Date object
|
|
@@ -503,13 +500,13 @@ export const float = <const Kind extends ParamKind>(
|
|
|
503
500
|
* @category constructors
|
|
504
501
|
* @since 4.0.0
|
|
505
502
|
*/
|
|
506
|
-
export const
|
|
503
|
+
export const Date = <const Kind extends ParamKind>(
|
|
507
504
|
kind: Kind,
|
|
508
505
|
name: string
|
|
509
|
-
): Param<Kind, Date> =>
|
|
506
|
+
): Param<Kind, globalThis.Date> =>
|
|
510
507
|
makeSingle({
|
|
511
508
|
name,
|
|
512
|
-
primitiveType: Primitive.
|
|
509
|
+
primitiveType: Primitive.Date,
|
|
513
510
|
kind
|
|
514
511
|
})
|
|
515
512
|
|
|
@@ -532,7 +529,7 @@ export const date = <const Kind extends ParamKind>(
|
|
|
532
529
|
* readonly _tag: "Cat"
|
|
533
530
|
* }
|
|
534
531
|
*
|
|
535
|
-
* const animal = Param.
|
|
532
|
+
* const animal = Param.ChoiceWithValue(Param.flagKind, "animal", [
|
|
536
533
|
* ["dog", { _tag: "Dog" }],
|
|
537
534
|
* ["cat", { _tag: "Cat" }]
|
|
538
535
|
* ])
|
|
@@ -542,13 +539,13 @@ export const date = <const Kind extends ParamKind>(
|
|
|
542
539
|
* @category constructors
|
|
543
540
|
* @since 4.0.0
|
|
544
541
|
*/
|
|
545
|
-
export const
|
|
542
|
+
export const ChoiceWithValue = <
|
|
546
543
|
const Kind extends ParamKind,
|
|
547
544
|
const Choices extends ReadonlyArray<readonly [string, any]>
|
|
548
545
|
>(kind: Kind, name: string, choices: Choices): Param<Kind, Choices[number][1]> =>
|
|
549
546
|
makeSingle({
|
|
550
547
|
name,
|
|
551
|
-
primitiveType: Primitive.
|
|
548
|
+
primitiveType: Primitive.Choice(choices),
|
|
552
549
|
kind
|
|
553
550
|
})
|
|
554
551
|
|
|
@@ -561,7 +558,7 @@ export const choiceWithValue = <
|
|
|
561
558
|
* ```ts import.meta.vitest
|
|
562
559
|
* import { Param } from "effect/unstable/cli"
|
|
563
560
|
*
|
|
564
|
-
* const logLevel = Param.
|
|
561
|
+
* const logLevel = Param.Literals(Param.flagKind, "log-level", [
|
|
565
562
|
* "debug",
|
|
566
563
|
* "info",
|
|
567
564
|
* "warn",
|
|
@@ -573,12 +570,12 @@ export const choiceWithValue = <
|
|
|
573
570
|
* @category constructors
|
|
574
571
|
* @since 4.0.0
|
|
575
572
|
*/
|
|
576
|
-
export const
|
|
573
|
+
export const Literals = <
|
|
577
574
|
const Kind extends ParamKind,
|
|
578
575
|
const Choices extends ReadonlyArray<string>
|
|
579
576
|
>(kind: Kind, name: string, choices: Choices): Param<Kind, Choices[number]> => {
|
|
580
577
|
const mappedChoices = choices.map((value) => [value, value] as const)
|
|
581
|
-
return
|
|
578
|
+
return ChoiceWithValue(kind, name, mappedChoices)
|
|
582
579
|
}
|
|
583
580
|
|
|
584
581
|
/**
|
|
@@ -590,13 +587,13 @@ export const choice = <
|
|
|
590
587
|
* import { Param } from "effect/unstable/cli"
|
|
591
588
|
*
|
|
592
589
|
* // Basic path parameter
|
|
593
|
-
* const outputPath = Param.
|
|
590
|
+
* const outputPath = Param.Path(Param.flagKind, "output")
|
|
594
591
|
*
|
|
595
592
|
* // Path that must exist
|
|
596
|
-
* const inputPath = Param.
|
|
593
|
+
* const inputPath = Param.Path(Param.flagKind, "input", { mustExist: true })
|
|
597
594
|
*
|
|
598
595
|
* // File-only path
|
|
599
|
-
* const configFile = Param.
|
|
596
|
+
* const configFile = Param.Path(Param.flagKind, "config", {
|
|
600
597
|
* pathType: "file",
|
|
601
598
|
* mustExist: true,
|
|
602
599
|
* typeName: "config-file"
|
|
@@ -607,7 +604,7 @@ export const choice = <
|
|
|
607
604
|
* @category constructors
|
|
608
605
|
* @since 4.0.0
|
|
609
606
|
*/
|
|
610
|
-
export const
|
|
607
|
+
export const Path = <Kind extends ParamKind>(
|
|
611
608
|
kind: Kind,
|
|
612
609
|
name: string,
|
|
613
610
|
options?: {
|
|
@@ -619,7 +616,7 @@ export const path = <Kind extends ParamKind>(
|
|
|
619
616
|
makeSingle({
|
|
620
617
|
name,
|
|
621
618
|
kind,
|
|
622
|
-
primitiveType: Primitive.
|
|
619
|
+
primitiveType: Primitive.Path(options?.pathType ?? "either", options?.mustExist),
|
|
623
620
|
typeName: options?.typeName
|
|
624
621
|
})
|
|
625
622
|
|
|
@@ -637,10 +634,10 @@ export const path = <Kind extends ParamKind>(
|
|
|
637
634
|
* import { Param } from "effect/unstable/cli"
|
|
638
635
|
*
|
|
639
636
|
* // Basic directory parameter
|
|
640
|
-
* const outputDir = Param.
|
|
637
|
+
* const outputDir = Param.Directory(Param.flagKind, "output-dir")
|
|
641
638
|
*
|
|
642
639
|
* // Directory that must exist
|
|
643
|
-
* const sourceDir = Param.
|
|
640
|
+
* const sourceDir = Param.Directory(Param.flagKind, "source", { mustExist: true })
|
|
644
641
|
*
|
|
645
642
|
* // Usage: --output-dir /path/to/dir --source /existing/dir
|
|
646
643
|
* const kinds = [outputDir.kind, sourceDir.kind] // => ["flag", "flag"]
|
|
@@ -649,14 +646,14 @@ export const path = <Kind extends ParamKind>(
|
|
|
649
646
|
* @category constructors
|
|
650
647
|
* @since 4.0.0
|
|
651
648
|
*/
|
|
652
|
-
export const
|
|
649
|
+
export const Directory = <Kind extends ParamKind>(
|
|
653
650
|
kind: Kind,
|
|
654
651
|
name: string,
|
|
655
652
|
options?: {
|
|
656
653
|
readonly mustExist?: boolean | undefined
|
|
657
654
|
}
|
|
658
655
|
): Param<Kind, string> =>
|
|
659
|
-
|
|
656
|
+
Path(kind, name, {
|
|
660
657
|
pathType: "directory",
|
|
661
658
|
typeName: "directory",
|
|
662
659
|
mustExist: options?.mustExist
|
|
@@ -676,10 +673,10 @@ export const directory = <Kind extends ParamKind>(
|
|
|
676
673
|
* import { Param } from "effect/unstable/cli"
|
|
677
674
|
*
|
|
678
675
|
* // Basic file parameter
|
|
679
|
-
* const outputFile = Param.
|
|
676
|
+
* const outputFile = Param.File(Param.flagKind, "output")
|
|
680
677
|
*
|
|
681
678
|
* // File that must exist
|
|
682
|
-
* const inputFile = Param.
|
|
679
|
+
* const inputFile = Param.File(Param.flagKind, "input", { mustExist: true })
|
|
683
680
|
*
|
|
684
681
|
* // Usage: --output result.txt --input existing-file.txt
|
|
685
682
|
* const kinds = [outputFile.kind, inputFile.kind] // => ["flag", "flag"]
|
|
@@ -688,14 +685,14 @@ export const directory = <Kind extends ParamKind>(
|
|
|
688
685
|
* @category constructors
|
|
689
686
|
* @since 4.0.0
|
|
690
687
|
*/
|
|
691
|
-
export const
|
|
688
|
+
export const File = <Kind extends ParamKind>(
|
|
692
689
|
kind: Kind,
|
|
693
690
|
name: string,
|
|
694
691
|
options?: {
|
|
695
692
|
readonly mustExist?: boolean | undefined
|
|
696
693
|
}
|
|
697
694
|
): Param<Kind, string> =>
|
|
698
|
-
|
|
695
|
+
Path(kind, name, {
|
|
699
696
|
pathType: "file",
|
|
700
697
|
typeName: "file",
|
|
701
698
|
mustExist: options?.mustExist
|
|
@@ -711,10 +708,10 @@ export const file = <Kind extends ParamKind>(
|
|
|
711
708
|
* import { Param } from "effect/unstable/cli"
|
|
712
709
|
*
|
|
713
710
|
* // Create a password parameter
|
|
714
|
-
* const password = Param.
|
|
711
|
+
* const password = Param.Redacted(Param.flagKind, "password")
|
|
715
712
|
*
|
|
716
713
|
* // Create an API key argument
|
|
717
|
-
* const apiKey = Param.
|
|
714
|
+
* const apiKey = Param.Redacted(Param.argumentKind, "api-key")
|
|
718
715
|
*
|
|
719
716
|
* // Usage: --password (value will be hidden in help/logs)
|
|
720
717
|
* const kinds = [password.kind, apiKey.kind] // => ["flag", "argument"]
|
|
@@ -723,13 +720,13 @@ export const file = <Kind extends ParamKind>(
|
|
|
723
720
|
* @category constructors
|
|
724
721
|
* @since 4.0.0
|
|
725
722
|
*/
|
|
726
|
-
export const
|
|
723
|
+
export const Redacted = <Kind extends ParamKind>(
|
|
727
724
|
kind: Kind,
|
|
728
725
|
name: string
|
|
729
|
-
): Param<Kind,
|
|
726
|
+
): Param<Kind, Redacted_.Redacted<string>> =>
|
|
730
727
|
makeSingle({
|
|
731
728
|
name,
|
|
732
|
-
primitiveType: Primitive.
|
|
729
|
+
primitiveType: Primitive.Redacted,
|
|
733
730
|
kind
|
|
734
731
|
})
|
|
735
732
|
|
|
@@ -742,10 +739,10 @@ export const redacted = <Kind extends ParamKind>(
|
|
|
742
739
|
* import { Param } from "effect/unstable/cli"
|
|
743
740
|
*
|
|
744
741
|
* // Read a config file as string
|
|
745
|
-
* const configContent = Param.
|
|
742
|
+
* const configContent = Param.FileText(Param.flagKind, "config")
|
|
746
743
|
*
|
|
747
744
|
* // Read a template file as argument
|
|
748
|
-
* const templateContent = Param.
|
|
745
|
+
* const templateContent = Param.FileText(Param.argumentKind, "template")
|
|
749
746
|
*
|
|
750
747
|
* // Usage: --config config.txt (reads file content into string)
|
|
751
748
|
* const kinds = [configContent.kind, templateContent.kind] // => ["flag", "argument"]
|
|
@@ -754,10 +751,10 @@ export const redacted = <Kind extends ParamKind>(
|
|
|
754
751
|
* @category constructors
|
|
755
752
|
* @since 4.0.0
|
|
756
753
|
*/
|
|
757
|
-
export const
|
|
754
|
+
export const FileText = <Kind extends ParamKind>(kind: Kind, name: string): Param<Kind, string> =>
|
|
758
755
|
makeSingle({
|
|
759
756
|
name,
|
|
760
|
-
primitiveType: Primitive.
|
|
757
|
+
primitiveType: Primitive.FileText,
|
|
761
758
|
kind
|
|
762
759
|
})
|
|
763
760
|
|
|
@@ -776,10 +773,10 @@ export const fileText = <Kind extends ParamKind>(kind: Kind, name: string): Para
|
|
|
776
773
|
*
|
|
777
774
|
* // Will use the extension of the file passed on the command line to determine
|
|
778
775
|
* // the parser to use
|
|
779
|
-
* const config = Param.
|
|
776
|
+
* const config = Param.FileParse(Param.flagKind, "config")
|
|
780
777
|
*
|
|
781
778
|
* // Will use the JSON parser
|
|
782
|
-
* const jsonConfig = Param.
|
|
779
|
+
* const jsonConfig = Param.FileParse(Param.flagKind, "json-config", {
|
|
783
780
|
* format: "json"
|
|
784
781
|
* })
|
|
785
782
|
* const kinds = [config.kind, jsonConfig.kind] // => ["flag", "flag"]
|
|
@@ -788,14 +785,14 @@ export const fileText = <Kind extends ParamKind>(kind: Kind, name: string): Para
|
|
|
788
785
|
* @category constructors
|
|
789
786
|
* @since 4.0.0
|
|
790
787
|
*/
|
|
791
|
-
export const
|
|
788
|
+
export const FileParse = <Kind extends ParamKind>(
|
|
792
789
|
kind: Kind,
|
|
793
790
|
name: string,
|
|
794
791
|
options?: Primitive.FileParseOptions | undefined
|
|
795
792
|
): Param<Kind, unknown> =>
|
|
796
793
|
makeSingle({
|
|
797
794
|
name,
|
|
798
|
-
primitiveType: Primitive.
|
|
795
|
+
primitiveType: Primitive.FileParse(options),
|
|
799
796
|
kind
|
|
800
797
|
})
|
|
801
798
|
|
|
@@ -813,12 +810,12 @@ export const fileParse = <Kind extends ParamKind>(
|
|
|
813
810
|
* host: Schema.String
|
|
814
811
|
* })
|
|
815
812
|
*
|
|
816
|
-
* const config = Param.
|
|
813
|
+
* const config = Param.FileSchema(Param.flagKind, "config", configSchema, {
|
|
817
814
|
* format: "json"
|
|
818
815
|
* })
|
|
819
816
|
*
|
|
820
817
|
* // Parse YAML file
|
|
821
|
-
* const yamlConfig = Param.
|
|
818
|
+
* const yamlConfig = Param.FileSchema(Param.flagKind, "config", configSchema, {
|
|
822
819
|
* format: "yaml"
|
|
823
820
|
* })
|
|
824
821
|
*
|
|
@@ -829,7 +826,7 @@ export const fileParse = <Kind extends ParamKind>(
|
|
|
829
826
|
* @category constructors
|
|
830
827
|
* @since 4.0.0
|
|
831
828
|
*/
|
|
832
|
-
export const
|
|
829
|
+
export const FileSchema = <Kind extends ParamKind, A>(
|
|
833
830
|
kind: Kind,
|
|
834
831
|
name: string,
|
|
835
832
|
schema: Schema.ConstraintDecoder<A, Environment>,
|
|
@@ -837,7 +834,7 @@ export const fileSchema = <Kind extends ParamKind, A>(
|
|
|
837
834
|
): Param<Kind, A> =>
|
|
838
835
|
makeSingle({
|
|
839
836
|
name,
|
|
840
|
-
primitiveType: Primitive.
|
|
837
|
+
primitiveType: Primitive.FileSchema(schema, options),
|
|
841
838
|
kind
|
|
842
839
|
})
|
|
843
840
|
|
|
@@ -859,10 +856,10 @@ export const fileSchema = <Kind extends ParamKind, A>(
|
|
|
859
856
|
* ```ts import.meta.vitest
|
|
860
857
|
* import { Param } from "effect/unstable/cli"
|
|
861
858
|
*
|
|
862
|
-
* const env = Param.
|
|
859
|
+
* const env = Param.KeyValuePair(Param.flagKind, "env")
|
|
863
860
|
* // --env FOO=bar --env BAZ=qux will parse to { FOO: "bar", BAZ: "qux" }
|
|
864
861
|
*
|
|
865
|
-
* const props = Param.
|
|
862
|
+
* const props = Param.KeyValuePair(Param.flagKind, "property")
|
|
866
863
|
* // --property name=value --property debug=true
|
|
867
864
|
* const kinds = [env.kind, props.kind] // => ["flag", "flag"]
|
|
868
865
|
* ```
|
|
@@ -870,7 +867,7 @@ export const fileSchema = <Kind extends ParamKind, A>(
|
|
|
870
867
|
* @category constructors
|
|
871
868
|
* @since 4.0.0
|
|
872
869
|
*/
|
|
873
|
-
export const
|
|
870
|
+
export const KeyValuePair = <Kind extends ParamKind>(
|
|
874
871
|
kind: Kind,
|
|
875
872
|
name: string
|
|
876
873
|
): Param<Kind, Record<string, string>> =>
|
|
@@ -878,7 +875,7 @@ export const keyValuePair = <Kind extends ParamKind>(
|
|
|
878
875
|
variadic(
|
|
879
876
|
makeSingle({
|
|
880
877
|
name,
|
|
881
|
-
primitiveType: Primitive.
|
|
878
|
+
primitiveType: Primitive.KeyValuePair,
|
|
882
879
|
kind
|
|
883
880
|
}),
|
|
884
881
|
{ min: 1 }
|
|
@@ -887,22 +884,17 @@ export const keyValuePair = <Kind extends ParamKind>(
|
|
|
887
884
|
)
|
|
888
885
|
|
|
889
886
|
/**
|
|
890
|
-
*
|
|
891
|
-
*
|
|
892
|
-
* **When to use**
|
|
893
|
-
*
|
|
894
|
-
* Use when you need an empty CLI parameter sentinel for optional parameter
|
|
895
|
-
* construction or internal combinators.
|
|
887
|
+
* A parameter that always fails to parse.
|
|
896
888
|
*
|
|
897
889
|
* **Example** (Creating sentinel parameters)
|
|
898
890
|
*
|
|
899
891
|
* ```ts import.meta.vitest
|
|
900
892
|
* import { Param } from "effect/unstable/cli"
|
|
901
893
|
*
|
|
902
|
-
* const disabledDebugParam = Param.
|
|
894
|
+
* const disabledDebugParam = Param.Never(Param.flagKind)
|
|
903
895
|
*
|
|
904
896
|
* const makeDebugParam = (enableDebug: boolean) =>
|
|
905
|
-
* enableDebug ? Param.
|
|
897
|
+
* enableDebug ? Param.String(Param.flagKind, "debug") : disabledDebugParam
|
|
906
898
|
*
|
|
907
899
|
* makeDebugParam(true) === disabledDebugParam // => false
|
|
908
900
|
* makeDebugParam(false) === disabledDebugParam // => true
|
|
@@ -911,10 +903,10 @@ export const keyValuePair = <Kind extends ParamKind>(
|
|
|
911
903
|
* @category constructors
|
|
912
904
|
* @since 4.0.0
|
|
913
905
|
*/
|
|
914
|
-
export const
|
|
906
|
+
export const Never = <Kind extends ParamKind>(kind: Kind): Param<Kind, never> =>
|
|
915
907
|
makeSingle({
|
|
916
|
-
name: "
|
|
917
|
-
primitiveType: Primitive.
|
|
908
|
+
name: "__never__",
|
|
909
|
+
primitiveType: Primitive.Never,
|
|
918
910
|
kind
|
|
919
911
|
})
|
|
920
912
|
|
|
@@ -938,13 +930,13 @@ const FLAG_DASH_REGEXP = /^-+/
|
|
|
938
930
|
* ```ts import.meta.vitest
|
|
939
931
|
* import { Param } from "effect/unstable/cli"
|
|
940
932
|
*
|
|
941
|
-
* const force = Param.
|
|
933
|
+
* const force = Param.Boolean(Param.flagKind, "force").pipe(
|
|
942
934
|
* Param.withAlias("-f"),
|
|
943
935
|
* Param.withAlias("-F")
|
|
944
936
|
* )
|
|
945
937
|
*
|
|
946
938
|
* // Also works on composed params:
|
|
947
|
-
* const count = Param.
|
|
939
|
+
* const count = Param.Int(Param.flagKind, "count").pipe(
|
|
948
940
|
* Param.optional,
|
|
949
941
|
* Param.withAlias("-c") // finds the underlying Single and adds alias
|
|
950
942
|
* )
|
|
@@ -973,13 +965,13 @@ export const withAlias: {
|
|
|
973
965
|
* ```ts import.meta.vitest
|
|
974
966
|
* import { Param } from "effect/unstable/cli"
|
|
975
967
|
*
|
|
976
|
-
* const force = Param.
|
|
968
|
+
* const force = Param.Boolean(Param.flagKind, "force").pipe(
|
|
977
969
|
* Param.withAlias("-f"),
|
|
978
970
|
* Param.withAlias("-F")
|
|
979
971
|
* )
|
|
980
972
|
*
|
|
981
973
|
* // Also works on composed params:
|
|
982
|
-
* const count = Param.
|
|
974
|
+
* const count = Param.Int(Param.flagKind, "count").pipe(
|
|
983
975
|
* Param.optional,
|
|
984
976
|
* Param.withAlias("-c") // finds the underlying Single and adds alias
|
|
985
977
|
* )
|
|
@@ -1008,13 +1000,13 @@ export const withAlias: {
|
|
|
1008
1000
|
* ```ts import.meta.vitest
|
|
1009
1001
|
* import { Param } from "effect/unstable/cli"
|
|
1010
1002
|
*
|
|
1011
|
-
* const force = Param.
|
|
1003
|
+
* const force = Param.Boolean(Param.flagKind, "force").pipe(
|
|
1012
1004
|
* Param.withAlias("-f"),
|
|
1013
1005
|
* Param.withAlias("-F")
|
|
1014
1006
|
* )
|
|
1015
1007
|
*
|
|
1016
1008
|
* // Also works on composed params:
|
|
1017
|
-
* const count = Param.
|
|
1009
|
+
* const count = Param.Int(Param.flagKind, "count").pipe(
|
|
1018
1010
|
* Param.optional,
|
|
1019
1011
|
* Param.withAlias("-c") // finds the underlying Single and adds alias
|
|
1020
1012
|
* )
|
|
@@ -1046,7 +1038,7 @@ export const withAlias: {
|
|
|
1046
1038
|
* ```ts import.meta.vitest
|
|
1047
1039
|
* import { Param } from "effect/unstable/cli"
|
|
1048
1040
|
*
|
|
1049
|
-
* const verbose = Param.
|
|
1041
|
+
* const verbose = Param.Boolean(Param.flagKind, "verbose").pipe(
|
|
1050
1042
|
* Param.withAlias("-v"),
|
|
1051
1043
|
* Param.withDescription("Enable verbose output")
|
|
1052
1044
|
* )
|
|
@@ -1070,7 +1062,7 @@ export const withDescription: {
|
|
|
1070
1062
|
* ```ts import.meta.vitest
|
|
1071
1063
|
* import { Param } from "effect/unstable/cli"
|
|
1072
1064
|
*
|
|
1073
|
-
* const verbose = Param.
|
|
1065
|
+
* const verbose = Param.Boolean(Param.flagKind, "verbose").pipe(
|
|
1074
1066
|
* Param.withAlias("-v"),
|
|
1075
1067
|
* Param.withDescription("Enable verbose output")
|
|
1076
1068
|
* )
|
|
@@ -1094,7 +1086,7 @@ export const withDescription: {
|
|
|
1094
1086
|
* ```ts import.meta.vitest
|
|
1095
1087
|
* import { Param } from "effect/unstable/cli"
|
|
1096
1088
|
*
|
|
1097
|
-
* const verbose = Param.
|
|
1089
|
+
* const verbose = Param.Boolean(Param.flagKind, "verbose").pipe(
|
|
1098
1090
|
* Param.withAlias("-v"),
|
|
1099
1091
|
* Param.withDescription("Enable verbose output")
|
|
1100
1092
|
* )
|
|
@@ -1127,7 +1119,7 @@ export const withDescription: {
|
|
|
1127
1119
|
* ```ts import.meta.vitest
|
|
1128
1120
|
* import { Param } from "effect/unstable/cli"
|
|
1129
1121
|
*
|
|
1130
|
-
* const experimental = Param.
|
|
1122
|
+
* const experimental = Param.Boolean(Param.flagKind, "experimental-foo").pipe(
|
|
1131
1123
|
* Param.withHidden
|
|
1132
1124
|
* )
|
|
1133
1125
|
* experimental.kind // => "flag"
|
|
@@ -1151,7 +1143,7 @@ export const withHidden = <Kind extends ParamKind, A>(self: Param<Kind, A>): Par
|
|
|
1151
1143
|
* ```ts import.meta.vitest
|
|
1152
1144
|
* import { Param } from "effect/unstable/cli"
|
|
1153
1145
|
*
|
|
1154
|
-
* const port = Param.
|
|
1146
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
1155
1147
|
* Param.map((n) => ({ port: n, url: `http://localhost:${n}` }))
|
|
1156
1148
|
* )
|
|
1157
1149
|
* port.kind // => "flag"
|
|
@@ -1169,7 +1161,7 @@ export const map: {
|
|
|
1169
1161
|
* ```ts import.meta.vitest
|
|
1170
1162
|
* import { Param } from "effect/unstable/cli"
|
|
1171
1163
|
*
|
|
1172
|
-
* const port = Param.
|
|
1164
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
1173
1165
|
* Param.map((n) => ({ port: n, url: `http://localhost:${n}` }))
|
|
1174
1166
|
* )
|
|
1175
1167
|
* port.kind // => "flag"
|
|
@@ -1187,7 +1179,7 @@ export const map: {
|
|
|
1187
1179
|
* ```ts import.meta.vitest
|
|
1188
1180
|
* import { Param } from "effect/unstable/cli"
|
|
1189
1181
|
*
|
|
1190
|
-
* const port = Param.
|
|
1182
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
1191
1183
|
* Param.map((n) => ({ port: n, url: `http://localhost:${n}` }))
|
|
1192
1184
|
* )
|
|
1193
1185
|
* port.kind // => "flag"
|
|
@@ -1258,7 +1250,7 @@ const transform = <Kind extends ParamKind, A, B>(
|
|
|
1258
1250
|
* )
|
|
1259
1251
|
* )
|
|
1260
1252
|
*
|
|
1261
|
-
* const validatedEmail = Param.
|
|
1253
|
+
* const validatedEmail = Param.String(Param.flagKind, "email").pipe(
|
|
1262
1254
|
* Param.mapEffect((email) =>
|
|
1263
1255
|
* email.includes("@")
|
|
1264
1256
|
* ? Effect.succeed(email)
|
|
@@ -1313,7 +1305,7 @@ export const mapEffect: {
|
|
|
1313
1305
|
* )
|
|
1314
1306
|
* )
|
|
1315
1307
|
*
|
|
1316
|
-
* const validatedEmail = Param.
|
|
1308
|
+
* const validatedEmail = Param.String(Param.flagKind, "email").pipe(
|
|
1317
1309
|
* Param.mapEffect((email) =>
|
|
1318
1310
|
* email.includes("@")
|
|
1319
1311
|
* ? Effect.succeed(email)
|
|
@@ -1368,7 +1360,7 @@ export const mapEffect: {
|
|
|
1368
1360
|
* )
|
|
1369
1361
|
* )
|
|
1370
1362
|
*
|
|
1371
|
-
* const validatedEmail = Param.
|
|
1363
|
+
* const validatedEmail = Param.String(Param.flagKind, "email").pipe(
|
|
1372
1364
|
* Param.mapEffect((email) =>
|
|
1373
1365
|
* email.includes("@")
|
|
1374
1366
|
* ? Effect.succeed(email)
|
|
@@ -1440,7 +1432,7 @@ export const mapEffect: {
|
|
|
1440
1432
|
* )
|
|
1441
1433
|
* )
|
|
1442
1434
|
*
|
|
1443
|
-
* const parsedJson = Param.
|
|
1435
|
+
* const parsedJson = Param.String(Param.flagKind, "config").pipe(
|
|
1444
1436
|
* Param.mapTryCatch(
|
|
1445
1437
|
* (str) => JSON.parse(str),
|
|
1446
1438
|
* (error) =>
|
|
@@ -1489,7 +1481,7 @@ export const mapTryCatch: {
|
|
|
1489
1481
|
* )
|
|
1490
1482
|
* )
|
|
1491
1483
|
*
|
|
1492
|
-
* const parsedJson = Param.
|
|
1484
|
+
* const parsedJson = Param.String(Param.flagKind, "config").pipe(
|
|
1493
1485
|
* Param.mapTryCatch(
|
|
1494
1486
|
* (str) => JSON.parse(str),
|
|
1495
1487
|
* (error) =>
|
|
@@ -1538,7 +1530,7 @@ export const mapTryCatch: {
|
|
|
1538
1530
|
* )
|
|
1539
1531
|
* )
|
|
1540
1532
|
*
|
|
1541
|
-
* const parsedJson = Param.
|
|
1533
|
+
* const parsedJson = Param.String(Param.flagKind, "config").pipe(
|
|
1542
1534
|
* Param.mapTryCatch(
|
|
1543
1535
|
* (str) => JSON.parse(str),
|
|
1544
1536
|
* (error) =>
|
|
@@ -1578,7 +1570,7 @@ export const mapTryCatch: {
|
|
|
1578
1570
|
(error) =>
|
|
1579
1571
|
new CliError.InvalidValue({
|
|
1580
1572
|
option: single.name,
|
|
1581
|
-
value: String(a),
|
|
1573
|
+
value: globalThis.String(a),
|
|
1582
1574
|
expected: error,
|
|
1583
1575
|
kind: single.kind
|
|
1584
1576
|
})
|
|
@@ -1605,7 +1597,7 @@ export const mapTryCatch: {
|
|
|
1605
1597
|
* // Create an optional port option
|
|
1606
1598
|
* // - When not provided: returns Option.none()
|
|
1607
1599
|
* // - When provided: returns Option.some(parsedValue)
|
|
1608
|
-
* const port = Param.optional(Param.
|
|
1600
|
+
* const port = Param.optional(Param.Int(Param.flagKind, "port"))
|
|
1609
1601
|
* port.kind // => "flag"
|
|
1610
1602
|
* ```
|
|
1611
1603
|
*
|
|
@@ -1615,10 +1607,8 @@ export const mapTryCatch: {
|
|
|
1615
1607
|
export const optional = <Kind extends ParamKind, A>(
|
|
1616
1608
|
param: Param<Kind, A>
|
|
1617
1609
|
): Param<Kind, Option.Option<A>> => {
|
|
1618
|
-
const parse: Parse<Option.Option<A>> =
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
return yield* param.parse(args).pipe(
|
|
1610
|
+
const parse: Parse<Option.Option<A>> = (args) =>
|
|
1611
|
+
param.parse(args).pipe(
|
|
1622
1612
|
Effect.map(([leftover, value]) => [leftover, Option.some(value)] as const),
|
|
1623
1613
|
// Catch both MissingOption (for flags) and MissingArgument (for positional arguments)
|
|
1624
1614
|
Effect.catchTags({
|
|
@@ -1626,7 +1616,6 @@ export const optional = <Kind extends ParamKind, A>(
|
|
|
1626
1616
|
MissingArgument: () => Effect.succeed([args.arguments, Option.none()] as const)
|
|
1627
1617
|
})
|
|
1628
1618
|
)
|
|
1629
|
-
})
|
|
1630
1619
|
return Object.assign(Object.create(Proto), {
|
|
1631
1620
|
_tag: "Optional",
|
|
1632
1621
|
kind: param.kind,
|
|
@@ -1649,12 +1638,12 @@ export const optional = <Kind extends ParamKind, A>(
|
|
|
1649
1638
|
* import { Param } from "effect/unstable/cli"
|
|
1650
1639
|
*
|
|
1651
1640
|
* // Using the pipe operator to make an option optional
|
|
1652
|
-
* const port = Param.
|
|
1641
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
1653
1642
|
* Param.withDefault(8080)
|
|
1654
1643
|
* )
|
|
1655
1644
|
*
|
|
1656
1645
|
* // Can also be used with other combinators
|
|
1657
|
-
* const verbose = Param.
|
|
1646
|
+
* const verbose = Param.Boolean(Param.flagKind, "verbose").pipe(
|
|
1658
1647
|
* Param.withAlias("-v"),
|
|
1659
1648
|
* Param.withDescription("Enable verbose output"),
|
|
1660
1649
|
* Param.withDefault(false)
|
|
@@ -1680,12 +1669,12 @@ export const withDefault: {
|
|
|
1680
1669
|
* import { Param } from "effect/unstable/cli"
|
|
1681
1670
|
*
|
|
1682
1671
|
* // Using the pipe operator to make an option optional
|
|
1683
|
-
* const port = Param.
|
|
1672
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
1684
1673
|
* Param.withDefault(8080)
|
|
1685
1674
|
* )
|
|
1686
1675
|
*
|
|
1687
1676
|
* // Can also be used with other combinators
|
|
1688
|
-
* const verbose = Param.
|
|
1677
|
+
* const verbose = Param.Boolean(Param.flagKind, "verbose").pipe(
|
|
1689
1678
|
* Param.withAlias("-v"),
|
|
1690
1679
|
* Param.withDescription("Enable verbose output"),
|
|
1691
1680
|
* Param.withDefault(false)
|
|
@@ -1711,12 +1700,12 @@ export const withDefault: {
|
|
|
1711
1700
|
* import { Param } from "effect/unstable/cli"
|
|
1712
1701
|
*
|
|
1713
1702
|
* // Using the pipe operator to make an option optional
|
|
1714
|
-
* const port = Param.
|
|
1703
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
1715
1704
|
* Param.withDefault(8080)
|
|
1716
1705
|
* )
|
|
1717
1706
|
*
|
|
1718
1707
|
* // Can also be used with other combinators
|
|
1719
|
-
* const verbose = Param.
|
|
1708
|
+
* const verbose = Param.Boolean(Param.flagKind, "verbose").pipe(
|
|
1720
1709
|
* Param.withAlias("-v"),
|
|
1721
1710
|
* Param.withDescription("Enable verbose output"),
|
|
1722
1711
|
* Param.withDefault(false)
|
|
@@ -1981,16 +1970,16 @@ export type VariadicParamOptions = {
|
|
|
1981
1970
|
* import { Param } from "effect/unstable/cli"
|
|
1982
1971
|
*
|
|
1983
1972
|
* // Basic variadic parameter (0 to infinity)
|
|
1984
|
-
* const tags = Param.variadic(Param.
|
|
1973
|
+
* const tags = Param.variadic(Param.String(Param.flagKind, "tag"))
|
|
1985
1974
|
*
|
|
1986
1975
|
* // Variadic with minimum count
|
|
1987
1976
|
* const inputs = Param.variadic(
|
|
1988
|
-
* Param.
|
|
1977
|
+
* Param.String(Param.flagKind, "input"),
|
|
1989
1978
|
* { min: 1 } // at least 1 required
|
|
1990
1979
|
* )
|
|
1991
1980
|
*
|
|
1992
1981
|
* // Variadic with both min and max
|
|
1993
|
-
* const limited = Param.variadic(Param.
|
|
1982
|
+
* const limited = Param.variadic(Param.String(Param.flagKind, "item"), {
|
|
1994
1983
|
* min: 2, // at least 2 times
|
|
1995
1984
|
* max: 2 // at most 2 times
|
|
1996
1985
|
* })
|
|
@@ -2036,7 +2025,7 @@ export const variadic = <Kind extends ParamKind, A>(
|
|
|
2036
2025
|
* import { Param } from "effect/unstable/cli"
|
|
2037
2026
|
*
|
|
2038
2027
|
* // Allow 1-3 file inputs
|
|
2039
|
-
* const files = Param.
|
|
2028
|
+
* const files = Param.String(Param.flagKind, "file").pipe(
|
|
2040
2029
|
* Param.between(1, 3),
|
|
2041
2030
|
* Param.withAlias("-f")
|
|
2042
2031
|
* )
|
|
@@ -2045,7 +2034,7 @@ export const variadic = <Kind extends ParamKind, A>(
|
|
|
2045
2034
|
* // Result: ["a.txt", "b.txt"]
|
|
2046
2035
|
*
|
|
2047
2036
|
* // Allow 0 or more tags
|
|
2048
|
-
* const tags = Param.
|
|
2037
|
+
* const tags = Param.String(Param.flagKind, "tag").pipe(
|
|
2049
2038
|
* Param.between(0, Number.MAX_SAFE_INTEGER)
|
|
2050
2039
|
* )
|
|
2051
2040
|
*
|
|
@@ -2072,7 +2061,7 @@ export const between: {
|
|
|
2072
2061
|
* import { Param } from "effect/unstable/cli"
|
|
2073
2062
|
*
|
|
2074
2063
|
* // Allow 1-3 file inputs
|
|
2075
|
-
* const files = Param.
|
|
2064
|
+
* const files = Param.String(Param.flagKind, "file").pipe(
|
|
2076
2065
|
* Param.between(1, 3),
|
|
2077
2066
|
* Param.withAlias("-f")
|
|
2078
2067
|
* )
|
|
@@ -2081,7 +2070,7 @@ export const between: {
|
|
|
2081
2070
|
* // Result: ["a.txt", "b.txt"]
|
|
2082
2071
|
*
|
|
2083
2072
|
* // Allow 0 or more tags
|
|
2084
|
-
* const tags = Param.
|
|
2073
|
+
* const tags = Param.String(Param.flagKind, "tag").pipe(
|
|
2085
2074
|
* Param.between(0, Number.MAX_SAFE_INTEGER)
|
|
2086
2075
|
* )
|
|
2087
2076
|
*
|
|
@@ -2108,7 +2097,7 @@ export const between: {
|
|
|
2108
2097
|
* import { Param } from "effect/unstable/cli"
|
|
2109
2098
|
*
|
|
2110
2099
|
* // Allow 1-3 file inputs
|
|
2111
|
-
* const files = Param.
|
|
2100
|
+
* const files = Param.String(Param.flagKind, "file").pipe(
|
|
2112
2101
|
* Param.between(1, 3),
|
|
2113
2102
|
* Param.withAlias("-f")
|
|
2114
2103
|
* )
|
|
@@ -2117,7 +2106,7 @@ export const between: {
|
|
|
2117
2106
|
* // Result: ["a.txt", "b.txt"]
|
|
2118
2107
|
*
|
|
2119
2108
|
* // Allow 0 or more tags
|
|
2120
|
-
* const tags = Param.
|
|
2109
|
+
* const tags = Param.String(Param.flagKind, "tag").pipe(
|
|
2121
2110
|
* Param.between(0, Number.MAX_SAFE_INTEGER)
|
|
2122
2111
|
* )
|
|
2123
2112
|
*
|
|
@@ -2155,7 +2144,7 @@ export const between: {
|
|
|
2155
2144
|
* import { Param } from "effect/unstable/cli"
|
|
2156
2145
|
*
|
|
2157
2146
|
* // Allow at most 3 warning suppressions
|
|
2158
|
-
* const suppressions = Param.
|
|
2147
|
+
* const suppressions = Param.String(Param.flagKind, "suppress").pipe(
|
|
2159
2148
|
* Param.atMost(3)
|
|
2160
2149
|
* )
|
|
2161
2150
|
*
|
|
@@ -2182,7 +2171,7 @@ export const atMost: {
|
|
|
2182
2171
|
* import { Param } from "effect/unstable/cli"
|
|
2183
2172
|
*
|
|
2184
2173
|
* // Allow at most 3 warning suppressions
|
|
2185
|
-
* const suppressions = Param.
|
|
2174
|
+
* const suppressions = Param.String(Param.flagKind, "suppress").pipe(
|
|
2186
2175
|
* Param.atMost(3)
|
|
2187
2176
|
* )
|
|
2188
2177
|
*
|
|
@@ -2209,7 +2198,7 @@ export const atMost: {
|
|
|
2209
2198
|
* import { Param } from "effect/unstable/cli"
|
|
2210
2199
|
*
|
|
2211
2200
|
* // Allow at most 3 warning suppressions
|
|
2212
|
-
* const suppressions = Param.
|
|
2201
|
+
* const suppressions = Param.String(Param.flagKind, "suppress").pipe(
|
|
2213
2202
|
* Param.atMost(3)
|
|
2214
2203
|
* )
|
|
2215
2204
|
*
|
|
@@ -2243,7 +2232,7 @@ export const atMost: {
|
|
|
2243
2232
|
* import { Param } from "effect/unstable/cli"
|
|
2244
2233
|
*
|
|
2245
2234
|
* // Require at least 2 input files
|
|
2246
|
-
* const inputs = Param.
|
|
2235
|
+
* const inputs = Param.String(Param.flagKind, "input").pipe(
|
|
2247
2236
|
* Param.atLeast(2),
|
|
2248
2237
|
* Param.withAlias("-i")
|
|
2249
2238
|
* )
|
|
@@ -2271,7 +2260,7 @@ export const atLeast: {
|
|
|
2271
2260
|
* import { Param } from "effect/unstable/cli"
|
|
2272
2261
|
*
|
|
2273
2262
|
* // Require at least 2 input files
|
|
2274
|
-
* const inputs = Param.
|
|
2263
|
+
* const inputs = Param.String(Param.flagKind, "input").pipe(
|
|
2275
2264
|
* Param.atLeast(2),
|
|
2276
2265
|
* Param.withAlias("-i")
|
|
2277
2266
|
* )
|
|
@@ -2299,7 +2288,7 @@ export const atLeast: {
|
|
|
2299
2288
|
* import { Param } from "effect/unstable/cli"
|
|
2300
2289
|
*
|
|
2301
2290
|
* // Require at least 2 input files
|
|
2302
|
-
* const inputs = Param.
|
|
2291
|
+
* const inputs = Param.String(Param.flagKind, "input").pipe(
|
|
2303
2292
|
* Param.atLeast(2),
|
|
2304
2293
|
* Param.withAlias("-i")
|
|
2305
2294
|
* )
|
|
@@ -2334,7 +2323,7 @@ export const atLeast: {
|
|
|
2334
2323
|
* ```ts import.meta.vitest
|
|
2335
2324
|
* import { Option } from "effect"
|
|
2336
2325
|
* import { Param } from "effect/unstable/cli"
|
|
2337
|
-
* const positiveInt = Param.
|
|
2326
|
+
* const positiveInt = Param.Int(Param.flagKind, "count").pipe(
|
|
2338
2327
|
* Param.filterMap(
|
|
2339
2328
|
* (n) => n > 0 ? Option.some(n) : Option.none(),
|
|
2340
2329
|
* (n) => `Expected positive integer, got ${n}`
|
|
@@ -2361,7 +2350,7 @@ export const filterMap: {
|
|
|
2361
2350
|
* ```ts import.meta.vitest
|
|
2362
2351
|
* import { Option } from "effect"
|
|
2363
2352
|
* import { Param } from "effect/unstable/cli"
|
|
2364
|
-
* const positiveInt = Param.
|
|
2353
|
+
* const positiveInt = Param.Int(Param.flagKind, "count").pipe(
|
|
2365
2354
|
* Param.filterMap(
|
|
2366
2355
|
* (n) => n > 0 ? Option.some(n) : Option.none(),
|
|
2367
2356
|
* (n) => `Expected positive integer, got ${n}`
|
|
@@ -2388,7 +2377,7 @@ export const filterMap: {
|
|
|
2388
2377
|
* ```ts import.meta.vitest
|
|
2389
2378
|
* import { Option } from "effect"
|
|
2390
2379
|
* import { Param } from "effect/unstable/cli"
|
|
2391
|
-
* const positiveInt = Param.
|
|
2380
|
+
* const positiveInt = Param.Int(Param.flagKind, "count").pipe(
|
|
2392
2381
|
* Param.filterMap(
|
|
2393
2382
|
* (n) => n > 0 ? Option.some(n) : Option.none(),
|
|
2394
2383
|
* (n) => `Expected positive integer, got ${n}`
|
|
@@ -2420,7 +2409,7 @@ export const filterMap: {
|
|
|
2420
2409
|
const single = getUnderlyingSingleOrThrow(self)
|
|
2421
2410
|
return yield* new CliError.InvalidValue({
|
|
2422
2411
|
option: single.name,
|
|
2423
|
-
value: String(a),
|
|
2412
|
+
value: globalThis.String(a),
|
|
2424
2413
|
expected: onNone(a),
|
|
2425
2414
|
kind: single.kind
|
|
2426
2415
|
})
|
|
@@ -2435,7 +2424,7 @@ export const filterMap: {
|
|
|
2435
2424
|
* ```ts import.meta.vitest
|
|
2436
2425
|
* import { Param } from "effect/unstable/cli"
|
|
2437
2426
|
*
|
|
2438
|
-
* const evenNumber = Param.
|
|
2427
|
+
* const evenNumber = Param.Int(Param.flagKind, "num").pipe(
|
|
2439
2428
|
* Param.filter(
|
|
2440
2429
|
* (n) => n % 2 === 0,
|
|
2441
2430
|
* (n) => `Expected even number, got ${n}`
|
|
@@ -2456,7 +2445,7 @@ export const filter: {
|
|
|
2456
2445
|
* ```ts import.meta.vitest
|
|
2457
2446
|
* import { Param } from "effect/unstable/cli"
|
|
2458
2447
|
*
|
|
2459
|
-
* const evenNumber = Param.
|
|
2448
|
+
* const evenNumber = Param.Int(Param.flagKind, "num").pipe(
|
|
2460
2449
|
* Param.filter(
|
|
2461
2450
|
* (n) => n % 2 === 0,
|
|
2462
2451
|
* (n) => `Expected even number, got ${n}`
|
|
@@ -2477,7 +2466,7 @@ export const filter: {
|
|
|
2477
2466
|
* ```ts import.meta.vitest
|
|
2478
2467
|
* import { Param } from "effect/unstable/cli"
|
|
2479
2468
|
*
|
|
2480
|
-
* const evenNumber = Param.
|
|
2469
|
+
* const evenNumber = Param.Int(Param.flagKind, "num").pipe(
|
|
2481
2470
|
* Param.filter(
|
|
2482
2471
|
* (n) => n % 2 === 0,
|
|
2483
2472
|
* (n) => `Expected even number, got ${n}`
|
|
@@ -2513,7 +2502,7 @@ export const filter: {
|
|
|
2513
2502
|
* ```ts import.meta.vitest
|
|
2514
2503
|
* import { Param } from "effect/unstable/cli"
|
|
2515
2504
|
*
|
|
2516
|
-
* const port = Param.
|
|
2505
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
2517
2506
|
* Param.withMetavar("PORT"),
|
|
2518
2507
|
* Param.filter(
|
|
2519
2508
|
* (p) => p >= 1 && p <= 65535,
|
|
@@ -2540,7 +2529,7 @@ export const withMetavar: {
|
|
|
2540
2529
|
* ```ts import.meta.vitest
|
|
2541
2530
|
* import { Param } from "effect/unstable/cli"
|
|
2542
2531
|
*
|
|
2543
|
-
* const port = Param.
|
|
2532
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
2544
2533
|
* Param.withMetavar("PORT"),
|
|
2545
2534
|
* Param.filter(
|
|
2546
2535
|
* (p) => p >= 1 && p <= 65535,
|
|
@@ -2567,7 +2556,7 @@ export const withMetavar: {
|
|
|
2567
2556
|
* ```ts import.meta.vitest
|
|
2568
2557
|
* import { Param } from "effect/unstable/cli"
|
|
2569
2558
|
*
|
|
2570
|
-
* const port = Param.
|
|
2559
|
+
* const port = Param.Int(Param.flagKind, "port").pipe(
|
|
2571
2560
|
* Param.withMetavar("PORT"),
|
|
2572
2561
|
* Param.filter(
|
|
2573
2562
|
* (p) => p >= 1 && p <= 65535,
|
|
@@ -2605,7 +2594,7 @@ export const withMetavar: {
|
|
|
2605
2594
|
* Schema.check(isEmail)
|
|
2606
2595
|
* )
|
|
2607
2596
|
*
|
|
2608
|
-
* const email = Param.
|
|
2597
|
+
* const email = Param.String(Param.flagKind, "email").pipe(
|
|
2609
2598
|
* Param.withSchema(Email)
|
|
2610
2599
|
* )
|
|
2611
2600
|
* email.kind // => "flag"
|
|
@@ -2629,7 +2618,7 @@ export const withSchema: {
|
|
|
2629
2618
|
* Schema.check(isEmail)
|
|
2630
2619
|
* )
|
|
2631
2620
|
*
|
|
2632
|
-
* const email = Param.
|
|
2621
|
+
* const email = Param.String(Param.flagKind, "email").pipe(
|
|
2633
2622
|
* Param.withSchema(Email)
|
|
2634
2623
|
* )
|
|
2635
2624
|
* email.kind // => "flag"
|
|
@@ -2655,7 +2644,7 @@ export const withSchema: {
|
|
|
2655
2644
|
* Schema.check(isEmail)
|
|
2656
2645
|
* )
|
|
2657
2646
|
*
|
|
2658
|
-
* const email = Param.
|
|
2647
|
+
* const email = Param.String(Param.flagKind, "email").pipe(
|
|
2659
2648
|
* Param.withSchema(Email)
|
|
2660
2649
|
* )
|
|
2661
2650
|
* email.kind // => "flag"
|
|
@@ -2678,7 +2667,7 @@ export const withSchema: {
|
|
|
2678
2667
|
const single = getUnderlyingSingleOrThrow(self)
|
|
2679
2668
|
return new CliError.InvalidValue({
|
|
2680
2669
|
option: single.name,
|
|
2681
|
-
value: String(value),
|
|
2670
|
+
value: globalThis.String(value),
|
|
2682
2671
|
expected: `Schema validation failed: ${error.message}`,
|
|
2683
2672
|
kind: single.kind
|
|
2684
2673
|
})
|
|
@@ -2693,8 +2682,8 @@ export const withSchema: {
|
|
|
2693
2682
|
* ```ts import.meta.vitest
|
|
2694
2683
|
* import { Param } from "effect/unstable/cli"
|
|
2695
2684
|
*
|
|
2696
|
-
* const config = Param.
|
|
2697
|
-
* Param.orElse(() => Param.
|
|
2685
|
+
* const config = Param.File(Param.flagKind, "config").pipe(
|
|
2686
|
+
* Param.orElse(() => Param.String(Param.flagKind, "config-url"))
|
|
2698
2687
|
* )
|
|
2699
2688
|
* config.kind // => "flag"
|
|
2700
2689
|
* ```
|
|
@@ -2711,8 +2700,8 @@ export const orElse: {
|
|
|
2711
2700
|
* ```ts import.meta.vitest
|
|
2712
2701
|
* import { Param } from "effect/unstable/cli"
|
|
2713
2702
|
*
|
|
2714
|
-
* const config = Param.
|
|
2715
|
-
* Param.orElse(() => Param.
|
|
2703
|
+
* const config = Param.File(Param.flagKind, "config").pipe(
|
|
2704
|
+
* Param.orElse(() => Param.String(Param.flagKind, "config-url"))
|
|
2716
2705
|
* )
|
|
2717
2706
|
* config.kind // => "flag"
|
|
2718
2707
|
* ```
|
|
@@ -2729,8 +2718,8 @@ export const orElse: {
|
|
|
2729
2718
|
* ```ts import.meta.vitest
|
|
2730
2719
|
* import { Param } from "effect/unstable/cli"
|
|
2731
2720
|
*
|
|
2732
|
-
* const config = Param.
|
|
2733
|
-
* Param.orElse(() => Param.
|
|
2721
|
+
* const config = Param.File(Param.flagKind, "config").pipe(
|
|
2722
|
+
* Param.orElse(() => Param.String(Param.flagKind, "config-url"))
|
|
2734
2723
|
* )
|
|
2735
2724
|
* config.kind // => "flag"
|
|
2736
2725
|
* ```
|
|
@@ -2764,8 +2753,8 @@ export const orElse: {
|
|
|
2764
2753
|
* ```ts import.meta.vitest
|
|
2765
2754
|
* import { Param } from "effect/unstable/cli"
|
|
2766
2755
|
*
|
|
2767
|
-
* const configSource = Param.
|
|
2768
|
-
* Param.orElseResult(() => Param.
|
|
2756
|
+
* const configSource = Param.File(Param.flagKind, "config").pipe(
|
|
2757
|
+
* Param.orElseResult(() => Param.String(Param.flagKind, "config-url"))
|
|
2769
2758
|
* )
|
|
2770
2759
|
* // Returns Result<string, string>
|
|
2771
2760
|
* configSource.kind // => "flag"
|
|
@@ -2789,8 +2778,8 @@ export const orElseResult: {
|
|
|
2789
2778
|
* ```ts import.meta.vitest
|
|
2790
2779
|
* import { Param } from "effect/unstable/cli"
|
|
2791
2780
|
*
|
|
2792
|
-
* const configSource = Param.
|
|
2793
|
-
* Param.orElseResult(() => Param.
|
|
2781
|
+
* const configSource = Param.File(Param.flagKind, "config").pipe(
|
|
2782
|
+
* Param.orElseResult(() => Param.String(Param.flagKind, "config-url"))
|
|
2794
2783
|
* )
|
|
2795
2784
|
* // Returns Result<string, string>
|
|
2796
2785
|
* configSource.kind // => "flag"
|
|
@@ -2814,8 +2803,8 @@ export const orElseResult: {
|
|
|
2814
2803
|
* ```ts import.meta.vitest
|
|
2815
2804
|
* import { Param } from "effect/unstable/cli"
|
|
2816
2805
|
*
|
|
2817
|
-
* const configSource = Param.
|
|
2818
|
-
* Param.orElseResult(() => Param.
|
|
2806
|
+
* const configSource = Param.File(Param.flagKind, "config").pipe(
|
|
2807
|
+
* Param.orElseResult(() => Param.String(Param.flagKind, "config-url"))
|
|
2819
2808
|
* )
|
|
2820
2809
|
* // Returns Result<string, string>
|
|
2821
2810
|
* configSource.kind // => "flag"
|
|
@@ -2939,12 +2928,14 @@ const parsePositionalVariadic: <Kind extends ParamKind, A>(
|
|
|
2939
2928
|
}
|
|
2940
2929
|
|
|
2941
2930
|
if (count < minValue) {
|
|
2942
|
-
return yield*
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2931
|
+
return yield* count === 0
|
|
2932
|
+
? new CliError.MissingArgument({ argument: single.name })
|
|
2933
|
+
: new CliError.InvalidValue({
|
|
2934
|
+
option: single.name,
|
|
2935
|
+
value: `${count} values`,
|
|
2936
|
+
expected: `at least ${minValue} value${minValue === 1 ? "" : "s"}`,
|
|
2937
|
+
kind: single.kind
|
|
2938
|
+
})
|
|
2948
2939
|
}
|
|
2949
2940
|
|
|
2950
2941
|
return [currentArgs, results] as const
|