effect 4.0.0-beta.99 → 4.0.0-rc.109
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 +395 -0
- package/CLAUDE.md +395 -0
- package/README.md +19 -23
- package/ai-docs/README.md +44 -0
- package/ai-docs/package.json +36 -0
- package/ai-docs/src/01_effect/01_basics/01_effect-gen.ts +30 -0
- package/ai-docs/src/01_effect/01_basics/02_effect-fn.ts +39 -0
- package/ai-docs/src/01_effect/01_basics/10_creating-effects.ts +74 -0
- package/ai-docs/src/01_effect/01_basics/index.md +5 -0
- package/ai-docs/src/01_effect/02_schema/10_schema-basics.ts +43 -0
- package/ai-docs/src/01_effect/02_schema/index.md +7 -0
- package/ai-docs/src/01_effect/03_services/01_service.ts +45 -0
- package/ai-docs/src/01_effect/03_services/10_reference.ts +10 -0
- package/ai-docs/src/01_effect/03_services/20_layer-composition.ts +70 -0
- package/ai-docs/src/01_effect/03_services/20_layer-unwrap.ts +66 -0
- package/ai-docs/src/01_effect/03_services/index.md +5 -0
- package/ai-docs/src/01_effect/04_errors/01_error-handling.ts +30 -0
- package/ai-docs/src/01_effect/04_errors/10_catch-tags.ts +24 -0
- package/ai-docs/src/01_effect/04_errors/20_reason-errors.ts +64 -0
- package/ai-docs/src/01_effect/04_errors/index.md +1 -0
- package/ai-docs/src/01_effect/05_resources/10_acquire-release.ts +105 -0
- package/ai-docs/src/01_effect/05_resources/20_layer-side-effects.ts +31 -0
- package/ai-docs/src/01_effect/05_resources/30_layer-map.ts +86 -0
- package/ai-docs/src/01_effect/05_resources/index.md +3 -0
- package/ai-docs/src/01_effect/06_running/10_run-main.ts +30 -0
- package/ai-docs/src/01_effect/06_running/20_layer-launch.ts +27 -0
- package/ai-docs/src/01_effect/06_running/index.md +1 -0
- package/ai-docs/src/01_effect/07_pubsub/10_pubsub.ts +56 -0
- package/ai-docs/src/01_effect/07_pubsub/index.md +3 -0
- package/ai-docs/src/03_stream/10_creating-streams.ts +103 -0
- package/ai-docs/src/03_stream/20_consuming-streams.ts +137 -0
- package/ai-docs/src/03_stream/30_encoding.ts +165 -0
- package/ai-docs/src/03_stream/index.md +4 -0
- package/ai-docs/src/04_integration/10_managed-runtime.ts +129 -0
- package/ai-docs/src/04_integration/index.md +5 -0
- package/ai-docs/src/05_batching/10_request-resolver.ts +89 -0
- package/ai-docs/src/05_batching/index.md +3 -0
- package/ai-docs/src/06_schedule/10_schedules.ts +110 -0
- package/ai-docs/src/06_schedule/index.md +3 -0
- package/ai-docs/src/07_datetime/10_creating-and-formatting.ts +30 -0
- package/ai-docs/src/07_datetime/20_time-zones.ts +44 -0
- package/ai-docs/src/07_datetime/index.md +5 -0
- package/ai-docs/src/08_observability/10_logging.ts +66 -0
- package/ai-docs/src/08_observability/20_otlp-tracing.ts +95 -0
- package/ai-docs/src/08_observability/index.md +7 -0
- package/ai-docs/src/09_testing/10_effect-tests.ts +55 -0
- package/ai-docs/src/09_testing/20_layer-tests.ts +138 -0
- package/ai-docs/src/09_testing/index.md +1 -0
- package/ai-docs/src/10_predicate/01_basics.ts +14 -0
- package/ai-docs/src/10_predicate/index.md +9 -0
- package/ai-docs/src/40_sql/10_basics.ts +175 -0
- package/ai-docs/src/40_sql/index.md +6 -0
- package/ai-docs/src/50_http-client/10_basics.ts +102 -0
- package/ai-docs/src/50_http-client/index.md +3 -0
- package/ai-docs/src/51_http-server/10_basics.ts +118 -0
- package/ai-docs/src/51_http-server/20_testing.ts +100 -0
- package/ai-docs/src/51_http-server/fixtures/api/Api.ts +14 -0
- package/ai-docs/src/51_http-server/fixtures/api/Authorization.ts +36 -0
- package/ai-docs/src/51_http-server/fixtures/api/System.ts +10 -0
- package/ai-docs/src/51_http-server/fixtures/api/Users.ts +107 -0
- package/ai-docs/src/51_http-server/fixtures/domain/User.ts +21 -0
- package/ai-docs/src/51_http-server/fixtures/domain/UserErrors.ts +22 -0
- package/ai-docs/src/51_http-server/fixtures/server/Authorization.ts +37 -0
- package/ai-docs/src/51_http-server/fixtures/server/Users/http.ts +80 -0
- package/ai-docs/src/51_http-server/fixtures/server/Users.ts +183 -0
- package/ai-docs/src/51_http-server/index.md +3 -0
- package/ai-docs/src/60_child-process/10_working-with-child-processes.ts +117 -0
- package/ai-docs/src/60_child-process/index.md +3 -0
- package/ai-docs/src/70_cli/10_basics.ts +160 -0
- package/ai-docs/src/70_cli/index.md +5 -0
- package/ai-docs/src/71_ai/10_language-model.ts +156 -0
- package/ai-docs/src/71_ai/20_tools.ts +226 -0
- package/ai-docs/src/71_ai/30_chat.ts +158 -0
- package/ai-docs/src/71_ai/fixtures/domain/LaunchPlan.ts +9 -0
- package/ai-docs/src/71_ai/index.md +5 -0
- package/ai-docs/src/80_cluster/10_entities.ts +97 -0
- package/ai-docs/src/80_cluster/index.md +4 -0
- package/ai-docs/src/index.md +10 -0
- package/ai-docs/tsconfig.json +24 -0
- package/dist/Array.d.ts +971 -1037
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +462 -412
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +433 -756
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +200 -325
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +207 -267
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +107 -135
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +146 -188
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +64 -84
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +3 -3
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +4 -3
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +409 -256
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +213 -134
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +167 -277
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +122 -176
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +756 -769
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +588 -449
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +834 -1173
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +326 -439
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +180 -49
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +96 -31
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +20 -33
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +18 -30
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +226 -174
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +361 -267
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +229 -71
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +164 -95
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +233 -33
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +232 -32
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +160 -277
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +179 -236
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +144 -176
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +227 -162
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +13 -15
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +24 -39
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +60 -80
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +18 -24
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +562 -660
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +307 -362
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +253 -256
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +110 -98
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +216 -308
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +157 -188
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +3157 -3360
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +1457 -1574
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +22 -40
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +22 -40
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +33 -37
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +39 -23
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +103 -105
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +77 -79
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +52 -28
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +51 -27
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +86 -55
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +8 -29
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +116 -192
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +82 -130
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +83 -147
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +48 -87
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +152 -105
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +109 -75
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +213 -168
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +114 -89
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +123 -81
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +86 -60
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +154 -265
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +42 -147
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +61 -33
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +26 -15
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +24 -32
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +55 -60
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +106 -148
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +81 -62
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +360 -714
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +168 -297
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +12 -6
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +47 -83
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +46 -68
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +319 -411
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +122 -166
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +1 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +177 -284
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +68 -109
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +19 -18
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +20 -16
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +620 -786
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +241 -317
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +11 -13
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +46 -103
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +8 -8
- package/dist/JsonPointer.js +8 -8
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +98 -44
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +319 -241
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +23 -35
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +16 -28
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +362 -263
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +203 -181
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +42 -29
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +31 -21
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +6 -2
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +6 -2
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +114 -214
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +41 -76
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +219 -468
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +209 -454
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +16 -5
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +10 -5
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +217 -252
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +150 -183
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +442 -993
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +202 -645
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +144 -173
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +68 -79
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +84 -89
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +44 -47
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +71 -370
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +63 -284
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +420 -243
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +209 -120
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +21 -14
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +15 -13
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +7 -137
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +5 -93
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +196 -233
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +90 -109
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +132 -210
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +221 -324
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +447 -812
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +213 -393
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +109 -109
- package/dist/Order.js +91 -91
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +20 -23
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +8 -9
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +1 -4
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +38 -41
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +3 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +6 -5
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +2 -2
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +4 -4
- package/dist/PlatformError.js +3 -3
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +4 -2
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +4 -2
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +200 -181
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +100 -108
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +7 -7
- package/dist/PrimaryKey.js +5 -5
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +425 -494
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +373 -362
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +24 -18
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +11 -9
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +200 -159
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +166 -138
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +49 -74
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -54
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +121 -63
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +42 -21
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +24 -13
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +15 -9
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +361 -466
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +163 -216
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -2
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +7 -2
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +25 -25
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +19 -20
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +8 -15
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +6 -12
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +95 -165
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +75 -122
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +102 -213
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +102 -213
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +10 -14
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +10 -14
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +31 -21
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +25 -19
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +201 -90
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +87 -41
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +302 -470
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +135 -218
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +50 -75
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +39 -60
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +292 -1638
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +164 -805
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +5 -5
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +18 -6
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +2056 -1269
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2868 -1135
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +64 -72
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +698 -468
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +236 -188
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +281 -234
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +219 -190
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +303 -309
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +32 -2
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +170 -118
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +433 -1511
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +301 -2854
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +117 -77
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +139 -104
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +123 -151
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +72 -92
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +3 -3
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +2 -2
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +101 -13
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +78 -39
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +118 -108
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +107 -100
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +18 -5
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +6 -3
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +2467 -2962
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1154 -1413
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +262 -308
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +184 -215
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +109 -114
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +46 -54
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +282 -250
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +104 -92
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +3 -3
- package/dist/Symbol.js +3 -3
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.js +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +2 -2
- package/dist/Terminal.js +2 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +100 -54
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +41 -24
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +287 -679
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +109 -251
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +98 -131
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -57
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +201 -121
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +85 -56
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +62 -46
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +30 -22
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +631 -779
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +268 -330
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +297 -236
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +130 -100
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +126 -95
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +74 -56
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +101 -88
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +87 -66
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +200 -180
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +161 -137
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +89 -114
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +75 -53
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +51 -32
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +23 -15
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +129 -95
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +85 -70
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +97 -70
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +44 -34
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +127 -70
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +45 -65
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +6 -9
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +23 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +3 -7
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/dist/internal/array.js.map +1 -1
- package/dist/internal/core.js +4 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +5 -1
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/doNotation.js.map +1 -1
- package/dist/internal/effect.js +254 -114
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/executionPlan.js +52 -3
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/hashMap.js +12 -8
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/hashSet.js.map +1 -1
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/matcher.js +2 -2
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/metric.js.map +1 -1
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/persistence.d.ts +2 -0
- package/dist/internal/persistence.d.ts.map +1 -0
- package/dist/internal/persistence.js +3 -0
- package/dist/internal/persistence.js.map +1 -0
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js +18 -13
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/record.d.ts +0 -3
- package/dist/internal/record.d.ts.map +1 -1
- package/dist/internal/record.js +10 -5
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/redacted.js.map +1 -1
- package/dist/internal/references.js +3 -4
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js +15 -1
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/cause.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js +761 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/fromRepresentation.d.ts +2 -0
- package/dist/internal/schema/fromRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/fromRepresentation.js +245 -0
- package/dist/internal/schema/fromRepresentation.js.map +1 -0
- package/dist/internal/schema/parser.d.ts +14 -0
- package/dist/internal/schema/parser.d.ts.map +1 -0
- package/dist/internal/schema/parser.js +13 -0
- package/dist/internal/schema/parser.js.map +1 -0
- package/dist/internal/schema/schema.js +29 -49
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/toArbitrary.d.ts +2 -0
- package/dist/internal/schema/toArbitrary.d.ts.map +1 -0
- package/dist/internal/schema/{arbitrary.js → toArbitrary.js} +8 -83
- package/dist/internal/schema/toArbitrary.js.map +1 -0
- package/dist/internal/schema/toCodeDocument.d.ts +2 -0
- package/dist/internal/schema/toCodeDocument.d.ts.map +1 -0
- package/dist/internal/schema/toCodeDocument.js +438 -0
- package/dist/internal/schema/toCodeDocument.js.map +1 -0
- package/dist/internal/schema/toEquivalence.d.ts +2 -0
- package/dist/internal/schema/toEquivalence.d.ts.map +1 -0
- package/dist/internal/schema/{equivalence.js → toEquivalence.js} +15 -13
- package/dist/internal/schema/toEquivalence.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +522 -0
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/toRepresentation.d.ts +2 -0
- package/dist/internal/schema/toRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/toRepresentation.js +351 -0
- package/dist/internal/schema/toRepresentation.js.map +1 -0
- package/dist/internal/stackTraceLimit.js +3 -6
- package/dist/internal/stackTraceLimit.js.map +1 -1
- package/dist/internal/stream.js.map +1 -1
- package/dist/internal/tracer.js.map +1 -1
- package/dist/internal/trie.js +24 -10
- package/dist/internal/trie.js.map +1 -1
- package/dist/internal/uuid.d.ts +3 -0
- package/dist/internal/uuid.d.ts.map +1 -0
- package/dist/internal/uuid.js +30 -0
- package/dist/internal/uuid.js.map +1 -0
- package/dist/testing/FastCheck.d.ts +8 -7
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +8 -7
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +58 -29
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +79 -24
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +32 -31
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +24 -22
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +31 -31
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +35 -34
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +121 -144
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +118 -140
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +22 -7
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +87 -317
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +132 -97
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +56 -52
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +1 -1
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +32 -28
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +26 -21
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +111 -68
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +127 -83
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpProtocol.d.ts +116 -0
- package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/McpProtocol.js +32 -0
- package/dist/unstable/ai/McpProtocol.js.map +1 -0
- package/dist/unstable/ai/McpSchema.d.ts +378 -223
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +135 -87
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +89 -100
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +1037 -361
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +8 -19
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +9 -20
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +33 -11
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +194 -378
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +131 -44
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +100 -36
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +47 -33
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +23 -18
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +46 -13
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +18 -7
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +14 -3
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +63 -44
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +59 -42
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +35 -9
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +32 -14
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +4 -0
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +4 -0
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +15 -12
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/mcpCore.d.ts +7 -0
- package/dist/unstable/ai/internal/mcpCore.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpCore.js +152 -0
- package/dist/unstable/ai/internal/mcpCore.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2024_11_05.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2024_11_05.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2024_11_05.js +259 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2024_11_05.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_03_26.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_03_26.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_03_26.js +279 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_03_26.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_06_18.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_06_18.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_06_18.js +281 -0
- package/dist/unstable/ai/internal/mcpProtocol/v2025_06_18.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol.js +153 -0
- package/dist/unstable/ai/internal/mcpProtocol.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js +47 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
- package/dist/unstable/ai/internal/mcpSchema/v2024_11_05.d.ts +1185 -0
- package/dist/unstable/ai/internal/mcpSchema/v2024_11_05.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpSchema/v2024_11_05.js +404 -0
- package/dist/unstable/ai/internal/mcpSchema/v2024_11_05.js.map +1 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_03_26.d.ts +825 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_03_26.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_03_26.js +138 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_03_26.js.map +1 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_06_18.d.ts +1462 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_06_18.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_06_18.js +309 -0
- package/dist/unstable/ai/internal/mcpSchema/v2025_06_18.js.map +1 -0
- package/dist/unstable/ai/internal/structured-output.d.ts +2 -0
- package/dist/unstable/ai/internal/structured-output.d.ts.map +1 -0
- package/dist/unstable/ai/internal/structured-output.js +315 -0
- package/dist/unstable/ai/internal/structured-output.js.map +1 -0
- package/dist/unstable/cli/Argument.d.ts +279 -72
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +113 -34
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliConfig.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +126 -76
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +136 -76
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +35 -54
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +26 -42
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +736 -115
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +282 -56
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +418 -138
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +197 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +12 -4
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +299 -83
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +146 -60
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +370 -149
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +377 -162
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +23 -14
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +54 -31
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +2 -2
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +5 -3
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +21 -13
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js +69 -9
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +24 -18
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js +5 -5
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +0 -48
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js +8 -10
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.js +4 -2
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js +17 -7
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +5 -5
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js +2 -2
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +3 -1
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +10 -8
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
- package/dist/unstable/cluster/ClusterSchema.js +8 -8
- 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 +43 -21
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +12 -12
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +9 -9
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +7 -5
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +8 -5
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +4 -4
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +14 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +5 -4
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +6 -4
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +2 -2
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +8 -0
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/K8sTypes.d.ts +2327 -0
- package/dist/unstable/cluster/K8sTypes.d.ts.map +1 -0
- package/dist/unstable/cluster/K8sTypes.js +29 -0
- package/dist/unstable/cluster/K8sTypes.js.map +1 -0
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +9 -9
- package/dist/unstable/cluster/Message.js +6 -6
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +66 -22
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +56 -13
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +8 -0
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +17 -5
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +1 -1
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +2 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +29 -23
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +3 -4
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +8 -7
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +11 -15
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +32 -22
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js +1 -1
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +2 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +293 -46
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +57 -5
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +11 -3
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +4 -2
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +2 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +1 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +8 -8
- package/dist/unstable/cluster/Snowflake.js +8 -8
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +21 -9
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +130 -43
- 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 +141 -79
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +4 -0
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +4 -0
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +33 -13
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +8 -2
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +17 -0
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/cluster/internal/shardLock.d.ts +2 -0
- package/dist/unstable/cluster/internal/shardLock.d.ts.map +1 -0
- package/dist/unstable/cluster/internal/shardLock.js +4 -0
- package/dist/unstable/cluster/internal/shardLock.js.map +1 -0
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +7 -2
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +20 -20
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +8 -5
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Ini.d.ts +20 -0
- package/dist/unstable/encoding/Ini.d.ts.map +1 -0
- package/dist/unstable/encoding/Ini.js +153 -0
- package/dist/unstable/encoding/Ini.js.map +1 -0
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +31 -19
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +7 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +72 -8
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +72 -31
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/Toml.d.ts +19 -0
- package/dist/unstable/encoding/Toml.d.ts.map +1 -0
- package/dist/unstable/encoding/Toml.js +434 -0
- package/dist/unstable/encoding/Toml.js.map +1 -0
- package/dist/unstable/encoding/Yaml.d.ts +19 -0
- package/dist/unstable/encoding/Yaml.d.ts.map +1 -0
- package/dist/unstable/encoding/Yaml.js +461 -0
- package/dist/unstable/encoding/Yaml.js.map +1 -0
- package/dist/unstable/encoding/index.d.ts +12 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +12 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +20 -20
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +4 -4
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +30 -17
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +30 -35
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +3 -3
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +18 -14
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +8 -7
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +16 -14
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +31 -31
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +12 -8
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
- package/dist/unstable/eventlog/EventLogRemote.js +5 -5
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +11 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +45 -21
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +4 -4
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +17 -8
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -5
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +15 -7
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +4 -7
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +3 -3
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +2 -2
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +54 -40
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +1 -1
- package/dist/unstable/http/Etag.js +1 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts.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/queryString.d.ts +11 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js +259 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts +2 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.js +665 -0
- package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -0
- package/dist/unstable/http/FindMyWay.d.ts +33 -8
- package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
- package/dist/unstable/http/FindMyWay.js +4 -7
- package/dist/unstable/http/FindMyWay.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +10 -10
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +5 -3
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +11 -5
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +110 -47
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +79 -36
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +44 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +16 -12
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
- package/dist/unstable/http/HttpClientResponse.js +3 -18
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +7 -9
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +14 -15
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +6 -9
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +6 -9
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +75 -9
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +164 -39
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +76 -0
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +53 -3
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +91 -92
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +79 -80
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +13 -13
- package/dist/unstable/http/HttpServer.js +6 -6
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +2 -2
- package/dist/unstable/http/HttpServerError.js +2 -2
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +23 -15
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +22 -0
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +17 -5
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +35 -7
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +35 -7
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpStatus.d.ts +99 -0
- package/dist/unstable/http/HttpStatus.d.ts.map +1 -0
- package/dist/unstable/http/HttpStatus.js +91 -0
- package/dist/unstable/http/HttpStatus.js.map +1 -0
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +28 -9
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +65 -35
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts +53 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js +14 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts +11 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.js +14 -0
- package/dist/unstable/http/MultipartParser/Search.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js +82 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts +3 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js +208 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +8 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js +241 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.js +120 -0
- package/dist/unstable/http/MultipartParser/internal/search.js.map +1 -0
- package/dist/unstable/http/MultipartParser.d.ts +98 -0
- package/dist/unstable/http/MultipartParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser.js +23 -0
- package/dist/unstable/http/MultipartParser.js.map +1 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +3 -3
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +33 -63
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +14 -28
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +10 -18
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +26 -31
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +5 -1
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +5 -1
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/compression.d.ts +2 -0
- package/dist/unstable/http/internal/compression.d.ts.map +1 -0
- package/dist/unstable/http/internal/compression.js +155 -0
- package/dist/unstable/http/internal/compression.js.map +1 -0
- package/dist/unstable/http/internal/httpBody.d.ts +2 -0
- package/dist/unstable/http/internal/httpBody.d.ts.map +1 -0
- package/dist/unstable/http/internal/httpBody.js +10 -0
- package/dist/unstable/http/internal/httpBody.js.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +9 -9
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +82 -30
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -5
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +89 -51
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +48 -46
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +73 -16
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +18 -18
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +30 -30
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
- package/dist/unstable/httpapi/HttpApiGroup.js +2 -2
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +71 -24
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +57 -10
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +0 -12
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +227 -71
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +176 -69
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +21 -13
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +110 -57
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/httpapi/internal/html.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/internal/mediaType.js.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +71 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +86 -7
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -3
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +4 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +11 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +31 -15
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +16 -7
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +21 -12
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -3
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +3 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +13 -4
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +10 -3
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
- package/dist/unstable/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/unstable/observability/internal/protobuf.js +3 -0
- package/dist/unstable/observability/internal/protobuf.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +8 -3
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +22 -13
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -8
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +2 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +97 -86
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +3 -3
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +108 -22
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +47 -26
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +31 -47
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +2 -2
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +4 -4
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +72 -21
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +14 -5
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +21 -10
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +4 -2
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +8 -8
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +14 -13
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +131 -30
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +55 -43
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +4 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +25 -4
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +4 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +1 -1
- package/dist/unstable/reactivity/Hydration.js +1 -1
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +1 -1
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +35 -33
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -2
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +26 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +41 -23
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +2 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
- package/dist/unstable/rpc/RpcGroup.js +2 -2
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +31 -30
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +6 -6
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +10 -10
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +4 -4
- package/dist/unstable/rpc/RpcSchema.js +3 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +58 -7
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +178 -97
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +13 -13
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +23 -18
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +5 -5
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +66 -51
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +39 -52
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +11 -12
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +28 -17
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +12 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +38 -17
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +9 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +15 -2
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +11 -7
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.js +15 -15
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.js +2 -2
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +5 -5
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +33 -26
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +6 -6
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +30 -27
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +2 -2
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +13 -14
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +7 -7
- package/dist/unstable/workers/WorkerError.js +11 -11
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +1 -1
- package/dist/unstable/workers/WorkerRunner.js +1 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +2 -2
- package/dist/unstable/workflow/Activity.js +2 -2
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +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 +10 -10
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +13 -8
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +22 -20
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +22 -20
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +21 -21
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +13 -14
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +26 -3
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +72 -6
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +4 -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/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.js.map +1 -1
- package/dist/unstable/workflow/internal/crypto.js.map +1 -1
- package/package.json +10 -16
- package/src/Array.ts +1068 -1070
- package/src/BigDecimal.ts +433 -756
- package/src/BigInt.ts +213 -269
- package/src/Boolean.ts +146 -188
- package/src/Brand.ts +4 -4
- package/src/Cache.ts +469 -851
- package/src/Cause.ts +167 -277
- package/src/Channel.ts +982 -831
- package/src/ChannelSchema.ts +1 -1
- package/src/Chunk.ts +841 -1181
- package/src/Clock.ts +181 -49
- package/src/Combiner.ts +20 -33
- package/src/Config.ts +642 -335
- package/src/ConfigProvider.ts +267 -135
- package/src/Console.ts +289 -39
- package/src/Context.ts +336 -405
- package/src/Cron.ts +271 -219
- package/src/Crypto.ts +33 -63
- package/src/Data.ts +63 -82
- package/src/DateTime.ts +564 -660
- package/src/Deferred.ts +259 -258
- package/src/Duration.ts +244 -311
- package/src/Effect.ts +3241 -3410
- package/src/Encoding.ts +22 -40
- package/src/Equal.ts +59 -41
- package/src/Equivalence.ts +103 -105
- package/src/ErrorReporter.ts +52 -28
- package/src/ExecutionPlan.ts +91 -56
- package/src/Exit.ts +116 -192
- package/src/Fiber.ts +82 -149
- package/src/FiberHandle.ts +155 -107
- package/src/FiberMap.ts +225 -174
- package/src/FiberSet.ts +125 -83
- package/src/FileSystem.ts +156 -264
- package/src/Filter.ts +61 -33
- package/src/Formatter.ts +69 -76
- package/src/Function.ts +119 -151
- package/src/Graph.ts +416 -770
- package/src/HKT.ts +12 -6
- package/src/Hash.ts +52 -83
- package/src/HashMap.ts +319 -411
- package/src/HashRing.ts +1 -0
- package/src/HashSet.ts +177 -284
- package/src/Inspectable.ts +22 -20
- package/src/Iterable.ts +633 -797
- package/src/JsonPatch.ts +60 -113
- package/src/JsonPointer.ts +8 -8
- package/src/JsonSchema.ts +408 -251
- package/src/Latch.ts +23 -35
- package/src/Layer.ts +369 -268
- package/src/LayerMap.ts +49 -29
- package/src/LayerRef.ts +6 -2
- package/src/LogLevel.ts +114 -214
- package/src/Logger.ts +349 -701
- package/src/ManagedRuntime.ts +20 -5
- package/src/Match.ts +217 -252
- package/src/Metric.ts +520 -1092
- package/src/MutableHashMap.ts +218 -255
- package/src/MutableHashSet.ts +84 -89
- package/src/MutableList.ts +77 -370
- package/src/MutableRef.ts +420 -243
- package/src/Newtype.ts +21 -14
- package/src/NonEmptyIterable.ts +7 -137
- package/src/Number.ts +196 -233
- package/src/Optic.ts +303 -441
- package/src/Option.ts +449 -813
- package/src/Order.ts +109 -109
- package/src/Ordering.ts +20 -23
- package/src/PartitionedSemaphore.ts +1 -4
- package/src/Path.ts +38 -41
- package/src/Pipeable.ts +6 -5
- package/src/PlatformError.ts +4 -4
- package/src/Pool.ts +4 -2
- package/src/Predicate.ts +200 -181
- package/src/PrimaryKey.ts +7 -7
- package/src/PubSub.ts +526 -552
- package/src/Pull.ts +24 -18
- package/src/Queue.ts +204 -165
- package/src/Random.ts +49 -74
- package/src/RcMap.ts +121 -63
- package/src/RcRef.ts +24 -13
- package/src/Record.ts +387 -487
- package/src/Redactable.ts +10 -3
- package/src/Redacted.ts +25 -25
- package/src/Reducer.ts +8 -15
- package/src/Ref.ts +221 -361
- package/src/References.ts +102 -214
- package/src/RegExp.ts +10 -14
- package/src/Request.ts +36 -28
- package/src/RequestResolver.ts +202 -91
- package/src/Result.ts +314 -485
- package/src/Runtime.ts +50 -75
- package/src/Schedule.ts +311 -1737
- package/src/Scheduler.ts +20 -7
- package/src/Schema.ts +3475 -1913
- package/src/SchemaAST.ts +902 -573
- package/src/SchemaGetter.ts +351 -233
- package/src/SchemaIssue.ts +367 -334
- package/src/SchemaParser.ts +254 -148
- package/src/SchemaRepresentation.ts +732 -3414
- package/src/SchemaTransformation.ts +186 -97
- package/src/Scope.ts +123 -151
- package/src/ScopedCache.ts +1 -1
- package/src/ScopedRef.ts +6 -4
- package/src/Semaphore.ts +157 -54
- package/src/Sink.ts +129 -114
- package/src/Stdio.ts +24 -5
- package/src/Stream.ts +2745 -3173
- package/src/String.ts +275 -312
- package/src/Struct.ts +114 -118
- package/src/SubscriptionRef.ts +284 -252
- package/src/Symbol.ts +3 -3
- package/src/SynchronizedRef.ts +1 -1
- package/src/Terminal.ts +3 -3
- package/src/Tracer.ts +102 -55
- package/src/Trie.ts +287 -679
- package/src/Tuple.ts +99 -131
- package/src/TxChunk.ts +201 -121
- package/src/TxDeferred.ts +62 -46
- package/src/TxHashMap.ts +645 -799
- package/src/TxHashSet.ts +443 -356
- package/src/TxPriorityQueue.ts +130 -98
- package/src/TxPubSub.ts +107 -80
- package/src/TxQueue.ts +215 -184
- package/src/TxReentrantLock.ts +136 -101
- package/src/TxRef.ts +51 -32
- package/src/TxSemaphore.ts +129 -95
- package/src/TxSubscriptionRef.ts +97 -70
- package/src/Types.ts +127 -70
- package/src/Unify.ts +45 -65
- package/src/Utils.ts +23 -16
- package/src/index.ts +0 -10
- package/src/internal/core.ts +6 -5
- package/src/internal/dateTime.ts +7 -1
- package/src/internal/effect.ts +319 -149
- package/src/internal/executionPlan.ts +106 -10
- package/src/internal/hashMap.ts +20 -14
- package/src/internal/matcher.ts +3 -3
- package/src/internal/persistence.ts +2 -0
- package/src/internal/rcRef.ts +24 -16
- package/src/internal/record.ts +11 -7
- package/src/internal/references.ts +3 -7
- package/src/internal/schedule.ts +4 -4
- package/src/internal/schema/annotations.ts +48 -1
- package/src/internal/schema/fromJsonSchemaDocument.ts +977 -0
- package/src/internal/schema/fromRepresentation.ts +339 -0
- package/src/internal/schema/parser.ts +22 -0
- package/src/internal/schema/schema.ts +46 -63
- package/src/internal/schema/{arbitrary.ts → toArbitrary.ts} +9 -81
- package/src/internal/schema/toCodeDocument.ts +572 -0
- package/src/internal/schema/{equivalence.ts → toEquivalence.ts} +12 -7
- package/src/internal/schema/toJsonSchemaDocument.ts +549 -0
- package/src/internal/schema/toRepresentation.ts +404 -0
- package/src/internal/stackTraceLimit.ts +3 -7
- package/src/internal/trie.ts +21 -12
- package/src/internal/uuid.ts +51 -0
- package/src/testing/FastCheck.ts +8 -7
- package/src/testing/TestClock.ts +103 -36
- package/src/testing/TestConsole.ts +32 -31
- package/src/testing/TestSchema.ts +40 -40
- package/src/unstable/ai/AiError.ts +119 -141
- package/src/unstable/ai/AnthropicStructuredOutput.ts +103 -334
- package/src/unstable/ai/Chat.ts +133 -98
- package/src/unstable/ai/EmbeddingModel.ts +1 -1
- package/src/unstable/ai/IdGenerator.ts +32 -28
- package/src/unstable/ai/LanguageModel.ts +141 -97
- package/src/unstable/ai/McpProtocol.ts +137 -0
- package/src/unstable/ai/McpSchema.ts +199 -100
- package/src/unstable/ai/McpServer.ts +1360 -455
- package/src/unstable/ai/Model.ts +9 -20
- package/src/unstable/ai/OpenAiStructuredOutput.ts +231 -396
- package/src/unstable/ai/Prompt.ts +212 -63
- package/src/unstable/ai/Response.ts +52 -38
- package/src/unstable/ai/Telemetry.ts +46 -13
- package/src/unstable/ai/Tokenizer.ts +14 -3
- package/src/unstable/ai/Tool.ts +81 -48
- package/src/unstable/ai/Toolkit.ts +45 -15
- package/src/unstable/ai/index.ts +5 -0
- package/src/unstable/ai/internal/codec-transformer.ts +13 -7
- package/src/unstable/ai/internal/mcpCore.ts +457 -0
- package/src/unstable/ai/internal/mcpProtocol/v2024_11_05.ts +321 -0
- package/src/unstable/ai/internal/mcpProtocol/v2025_03_26.ts +347 -0
- package/src/unstable/ai/internal/mcpProtocol/v2025_06_18.ts +361 -0
- package/src/unstable/ai/internal/mcpProtocol.ts +336 -0
- package/src/unstable/ai/internal/mcpProtocolRegistry.ts +102 -0
- package/src/unstable/ai/internal/mcpSchema/v2024_11_05.ts +521 -0
- package/src/unstable/ai/internal/mcpSchema/v2025_03_26.ts +204 -0
- package/src/unstable/ai/internal/mcpSchema/v2025_06_18.ts +404 -0
- package/src/unstable/ai/internal/structured-output.ts +453 -0
- package/src/unstable/cli/Argument.ts +279 -72
- package/src/unstable/cli/CliError.ts +159 -91
- package/src/unstable/cli/CliOutput.ts +44 -58
- package/src/unstable/cli/Command.ts +764 -124
- package/src/unstable/cli/Flag.ts +418 -138
- package/src/unstable/cli/GlobalFlag.ts +1 -1
- package/src/unstable/cli/HelpDoc.ts +12 -4
- package/src/unstable/cli/Param.ts +336 -100
- package/src/unstable/cli/Primitive.ts +383 -156
- package/src/unstable/cli/Prompt.ts +64 -34
- package/src/unstable/cli/internal/ansi.ts +2 -2
- package/src/unstable/cli/internal/command.ts +28 -15
- package/src/unstable/cli/internal/completions/bash.ts +59 -9
- package/src/unstable/cli/internal/completions/descriptor.ts +14 -20
- package/src/unstable/cli/internal/completions/fish.ts +5 -7
- package/src/unstable/cli/internal/config.ts +8 -10
- package/src/unstable/cli/internal/help.ts +4 -2
- package/src/unstable/cli/internal/lexer.ts +8 -2
- package/src/unstable/cli/internal/parser.ts +5 -5
- package/src/unstable/cli/internal/wizard.ts +2 -2
- package/src/unstable/cluster/ClusterError.ts +10 -8
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +65 -39
- package/src/unstable/cluster/Entity.ts +23 -19
- package/src/unstable/cluster/EntityProxy.ts +16 -7
- package/src/unstable/cluster/EntityResource.ts +5 -5
- package/src/unstable/cluster/Envelope.ts +5 -4
- package/src/unstable/cluster/HttpRunner.ts +6 -4
- package/src/unstable/cluster/K8sHttpClient.ts +2 -2
- package/src/unstable/cluster/K8sTypes.ts +2467 -0
- package/src/unstable/cluster/Message.ts +9 -9
- package/src/unstable/cluster/MessageStorage.ts +106 -33
- package/src/unstable/cluster/Reply.ts +26 -7
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerAddress.ts +1 -1
- package/src/unstable/cluster/RunnerHealth.ts +1 -1
- package/src/unstable/cluster/RunnerServer.ts +45 -18
- package/src/unstable/cluster/RunnerStorage.ts +11 -9
- package/src/unstable/cluster/Runners.ts +48 -26
- package/src/unstable/cluster/ShardId.ts +1 -1
- package/src/unstable/cluster/Sharding.ts +360 -65
- package/src/unstable/cluster/ShardingConfig.ts +46 -4
- package/src/unstable/cluster/SingleRunner.ts +4 -2
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +8 -8
- package/src/unstable/cluster/SqlMessageStorage.ts +212 -60
- package/src/unstable/cluster/SqlRunnerStorage.ts +223 -133
- package/src/unstable/cluster/index.ts +5 -0
- package/src/unstable/cluster/internal/entityManager.ts +72 -27
- package/src/unstable/cluster/internal/entityReaper.ts +2 -3
- package/src/unstable/cluster/internal/resourceMap.ts +13 -2
- package/src/unstable/cluster/internal/resourceRef.ts +27 -5
- package/src/unstable/cluster/internal/shardLock.ts +9 -0
- package/src/unstable/devtools/DevToolsClient.ts +3 -2
- package/src/unstable/devtools/DevToolsSchema.ts +10 -5
- package/src/unstable/encoding/Ini.ts +174 -0
- package/src/unstable/encoding/Msgpack.ts +61 -40
- package/src/unstable/encoding/Ndjson.ts +9 -1
- package/src/unstable/encoding/Sse.ts +109 -37
- package/src/unstable/encoding/Toml.ts +504 -0
- package/src/unstable/encoding/Yaml.ts +541 -0
- package/src/unstable/encoding/index.ts +15 -0
- package/src/unstable/eventlog/Event.ts +20 -20
- package/src/unstable/eventlog/EventGroup.ts +4 -4
- package/src/unstable/eventlog/EventJournal.ts +33 -25
- package/src/unstable/eventlog/EventLog.ts +24 -14
- package/src/unstable/eventlog/EventLogEncryption.ts +17 -18
- package/src/unstable/eventlog/EventLogMessage.ts +15 -9
- package/src/unstable/eventlog/EventLogRemote.ts +5 -5
- package/src/unstable/eventlog/EventLogServer.ts +41 -7
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +16 -8
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +15 -7
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +9 -7
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +1 -1
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +6 -3
- package/src/unstable/http/Cookies.ts +64 -45
- package/src/unstable/http/Etag.ts +1 -1
- package/src/unstable/http/FetchHttpClient.ts +4 -2
- package/src/unstable/http/FindMyWay/internal/queryString.ts +420 -0
- package/src/unstable/http/FindMyWay/internal/router.ts +950 -0
- package/src/unstable/http/FindMyWay.ts +65 -6
- package/src/unstable/http/Headers.ts +10 -10
- package/src/unstable/http/HttpBody.ts +20 -5
- package/src/unstable/http/HttpClient.ts +215 -78
- package/src/unstable/http/HttpClientError.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +59 -12
- package/src/unstable/http/HttpClientResponse.ts +5 -21
- package/src/unstable/http/HttpEffect.ts +27 -26
- package/src/unstable/http/HttpMethod.ts +6 -9
- package/src/unstable/http/HttpMiddleware.ts +202 -39
- package/src/unstable/http/HttpPlatform.ts +129 -6
- package/src/unstable/http/HttpRouter.ts +110 -102
- package/src/unstable/http/HttpServer.ts +13 -13
- package/src/unstable/http/HttpServerError.ts +2 -2
- package/src/unstable/http/HttpServerRequest.ts +31 -17
- package/src/unstable/http/HttpServerResponse.ts +38 -6
- package/src/unstable/http/HttpStaticServer.ts +35 -7
- package/src/unstable/http/HttpStatus.ts +100 -0
- package/src/unstable/http/Multipart.ts +67 -36
- package/src/unstable/http/MultipartParser/HeadersParser.ts +68 -0
- package/src/unstable/http/MultipartParser/Search.ts +17 -0
- package/src/unstable/http/MultipartParser/internal/contentType.ts +103 -0
- package/src/unstable/http/MultipartParser/internal/headers.ts +244 -0
- package/src/unstable/http/MultipartParser/internal/multipart.ts +279 -0
- package/src/unstable/http/MultipartParser/internal/search.ts +167 -0
- package/src/unstable/http/MultipartParser.ts +115 -0
- package/src/unstable/http/Template.ts +7 -6
- package/src/unstable/http/Url.ts +33 -63
- package/src/unstable/http/UrlParams.ts +27 -32
- package/src/unstable/http/index.ts +6 -1
- package/src/unstable/http/internal/compression.ts +196 -0
- package/src/unstable/http/internal/httpBody.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +10 -11
- package/src/unstable/httpapi/HttpApiBuilder.ts +154 -33
- package/src/unstable/httpapi/HttpApiClient.ts +142 -61
- package/src/unstable/httpapi/HttpApiEndpoint.ts +159 -71
- package/src/unstable/httpapi/HttpApiError.ts +46 -52
- package/src/unstable/httpapi/HttpApiGroup.ts +17 -17
- package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
- package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
- package/src/unstable/httpapi/HttpApiSchema.ts +362 -73
- package/src/unstable/httpapi/OpenApi.ts +153 -62
- package/src/unstable/observability/OtlpExporter.ts +130 -12
- package/src/unstable/observability/OtlpLogger.ts +8 -6
- package/src/unstable/observability/OtlpMetrics.ts +42 -21
- package/src/unstable/observability/OtlpResource.ts +26 -17
- package/src/unstable/observability/OtlpTracer.ts +9 -5
- package/src/unstable/observability/PrometheusMetrics.ts +13 -4
- package/src/unstable/observability/internal/otlpEnv.ts +1 -1
- package/src/unstable/observability/internal/protobuf.ts +3 -0
- package/src/unstable/persistence/KeyValueStore.ts +72 -49
- package/src/unstable/persistence/Persistable.ts +11 -10
- package/src/unstable/persistence/PersistedQueue.ts +129 -108
- package/src/unstable/persistence/Persistence.ts +153 -26
- package/src/unstable/persistence/RateLimiter.ts +79 -45
- package/src/unstable/persistence/Redis.ts +5 -5
- package/src/unstable/process/ChildProcess.ts +72 -21
- package/src/unstable/process/ChildProcessSpawner.ts +22 -11
- package/src/unstable/reactivity/AsyncResult.ts +23 -18
- package/src/unstable/reactivity/Atom.ts +170 -56
- package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
- package/src/unstable/reactivity/AtomRegistry.ts +25 -4
- package/src/unstable/reactivity/AtomRpc.ts +5 -4
- package/src/unstable/reactivity/Hydration.ts +1 -1
- package/src/unstable/reactivity/Reactivity.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +35 -33
- package/src/unstable/rpc/RpcClient.ts +66 -30
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcGroup.ts +9 -9
- package/src/unstable/rpc/RpcMessage.ts +31 -30
- package/src/unstable/rpc/RpcMiddleware.ts +10 -10
- package/src/unstable/rpc/RpcSchema.ts +4 -4
- package/src/unstable/rpc/RpcSerialization.ts +168 -69
- package/src/unstable/rpc/RpcServer.ts +28 -22
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/schema/Model.ts +60 -58
- package/src/unstable/schema/VariantSchema.ts +51 -43
- package/src/unstable/socket/Socket.ts +42 -19
- package/src/unstable/sql/Migrator.ts +22 -9
- package/src/unstable/sql/SqlClient.ts +71 -60
- package/src/unstable/sql/SqlError.ts +15 -15
- package/src/unstable/sql/SqlModel.ts +2 -2
- package/src/unstable/sql/SqlResolver.ts +44 -33
- package/src/unstable/sql/Statement.ts +44 -37
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +15 -16
- package/src/unstable/workers/WorkerError.ts +12 -12
- package/src/unstable/workers/WorkerRunner.ts +1 -1
- package/src/unstable/workflow/Activity.ts +2 -2
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +18 -13
- package/src/unstable/workflow/DurableQueue.ts +22 -20
- package/src/unstable/workflow/Workflow.ts +23 -26
- package/src/unstable/workflow/WorkflowEngine.ts +111 -8
- package/src/unstable/workflow/WorkflowProxy.ts +4 -2
- package/dist/SchemaError.d.ts +0 -53
- package/dist/SchemaError.d.ts.map +0 -1
- package/dist/SchemaError.js +0 -61
- package/dist/SchemaError.js.map +0 -1
- package/dist/SchemaUtils.d.ts +0 -28
- package/dist/SchemaUtils.d.ts.map +0 -1
- package/dist/SchemaUtils.js +0 -45
- package/dist/SchemaUtils.js.map +0 -1
- package/dist/internal/schema/arbitrary.d.ts +0 -5
- package/dist/internal/schema/arbitrary.d.ts.map +0 -1
- package/dist/internal/schema/arbitrary.js.map +0 -1
- package/dist/internal/schema/equivalence.d.ts +0 -2
- package/dist/internal/schema/equivalence.d.ts.map +0 -1
- package/dist/internal/schema/equivalence.js.map +0 -1
- package/dist/internal/schema/representation.d.ts +0 -2
- package/dist/internal/schema/representation.d.ts.map +0 -1
- package/dist/internal/schema/representation.js +0 -865
- package/dist/internal/schema/representation.js.map +0 -1
- package/dist/internal/version.d.ts +0 -3
- package/dist/internal/version.d.ts.map +0 -1
- package/dist/internal/version.js +0 -2
- package/dist/internal/version.js.map +0 -1
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.js.map +0 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Node.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Node.js +0 -14
- package/dist/unstable/http/Multipasta/Node.js.map +0 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Search.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Search.js +0 -14
- package/dist/unstable/http/Multipasta/Search.js.map +0 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Web.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Web.js +0 -14
- package/dist/unstable/http/Multipasta/Web.js.map +0 -1
- package/dist/unstable/http/Multipasta.d.ts +0 -15
- package/dist/unstable/http/Multipasta.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta.js +0 -15
- package/dist/unstable/http/Multipasta.js.map +0 -1
- package/src/SchemaError.ts +0 -64
- package/src/SchemaUtils.ts +0 -51
- package/src/internal/schema/representation.ts +0 -795
- package/src/internal/version.ts +0 -2
- package/src/unstable/http/Multipasta/HeadersParser.ts +0 -14
- package/src/unstable/http/Multipasta/Node.ts +0 -14
- package/src/unstable/http/Multipasta/Search.ts +0 -14
- package/src/unstable/http/Multipasta/Web.ts +0 -14
- package/src/unstable/http/Multipasta.ts +0 -15
|
@@ -22,6 +22,7 @@ import type * as Path from "../../Path.ts"
|
|
|
22
22
|
import * as Predicate from "../../Predicate.ts"
|
|
23
23
|
import * as References from "../../References.ts"
|
|
24
24
|
import * as Result from "../../Result.ts"
|
|
25
|
+
import * as Runtime from "../../Runtime.ts"
|
|
25
26
|
import * as Stdio from "../../Stdio.ts"
|
|
26
27
|
import * as Terminal from "../../Terminal.ts"
|
|
27
28
|
import type { Contravariant, Covariant, NoInfer, Simplify } from "../../Types.ts"
|
|
@@ -57,9 +58,27 @@ import * as Prompt from "./Prompt.ts"
|
|
|
57
58
|
*
|
|
58
59
|
* **Example** (Defining CLI commands)
|
|
59
60
|
*
|
|
60
|
-
* ```ts
|
|
61
|
-
* import {
|
|
61
|
+
* ```ts import.meta.vitest
|
|
62
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
62
63
|
* import { Argument, Command, Flag } from "effect/unstable/cli"
|
|
64
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
65
|
+
*
|
|
66
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
67
|
+
* FileSystem.layerNoop({}),
|
|
68
|
+
* Path.layer,
|
|
69
|
+
* Stdio.layerTest({}),
|
|
70
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
71
|
+
* columns: Effect.succeed(80),
|
|
72
|
+
* rows: Effect.succeed(24),
|
|
73
|
+
* readInput: Effect.die("unused"),
|
|
74
|
+
* readLine: Effect.die("unused"),
|
|
75
|
+
* display: () => Effect.void
|
|
76
|
+
* })),
|
|
77
|
+
* Layer.succeed(
|
|
78
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
79
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
80
|
+
* )
|
|
81
|
+
* )
|
|
63
82
|
*
|
|
64
83
|
* // Simple command with no configuration
|
|
65
84
|
* const version: Command.Command<"version", {}, {}, never, never> = Command.make(
|
|
@@ -84,9 +103,15 @@ import * as Prompt from "./Prompt.ts"
|
|
|
84
103
|
* })
|
|
85
104
|
*
|
|
86
105
|
* // Command with handler
|
|
106
|
+
* const output: Array<string> = []
|
|
87
107
|
* const greet = Command.make("greet", {
|
|
88
108
|
* name: Flag.string("name")
|
|
89
|
-
* }, (config) =>
|
|
109
|
+
* }, (config) => Effect.sync(() => output.push(`Hello, ${config.name}!`)).pipe(Effect.asVoid))
|
|
110
|
+
*
|
|
111
|
+
* await Effect.runPromise(
|
|
112
|
+
* Command.runWith(greet, { version: "1.0.0" })(["--name", "Alice"]).pipe(Effect.provide(CliTestLayer))
|
|
113
|
+
* )
|
|
114
|
+
* output // => ["Hello, Alice!"]
|
|
90
115
|
* ```
|
|
91
116
|
*
|
|
92
117
|
* @category models
|
|
@@ -141,11 +166,11 @@ export interface Command<in out Name extends string, in Input, out ContextInput
|
|
|
141
166
|
readonly annotations: Context.Context<never>
|
|
142
167
|
|
|
143
168
|
/**
|
|
144
|
-
* Whether this command is
|
|
145
|
-
* completions, and unknown-subcommand suggestions.
|
|
169
|
+
* Whether this command is omitted from parent help output, shell
|
|
170
|
+
* completions, and unknown-subcommand suggestions. Unlisted commands still
|
|
146
171
|
* parse and execute normally when invoked by exact name.
|
|
147
172
|
*/
|
|
148
|
-
readonly
|
|
173
|
+
readonly unlisted: boolean
|
|
149
174
|
}
|
|
150
175
|
|
|
151
176
|
/**
|
|
@@ -194,19 +219,19 @@ export declare namespace Command {
|
|
|
194
219
|
*
|
|
195
220
|
* **Example** (Configuring command input)
|
|
196
221
|
*
|
|
197
|
-
* ```ts
|
|
222
|
+
* ```ts import.meta.vitest
|
|
198
223
|
* import { Argument, Flag } from "effect/unstable/cli"
|
|
199
224
|
* import type { Command as CliCommand } from "effect/unstable/cli"
|
|
200
225
|
*
|
|
201
226
|
* // Simple flat configuration
|
|
202
|
-
* const simpleConfig
|
|
227
|
+
* const simpleConfig = {
|
|
203
228
|
* name: Flag.string("name"),
|
|
204
229
|
* age: Flag.integer("age"),
|
|
205
230
|
* file: Argument.string("file")
|
|
206
|
-
* }
|
|
231
|
+
* } satisfies CliCommand.Command.Config
|
|
207
232
|
*
|
|
208
233
|
* // Nested configuration for organization
|
|
209
|
-
* const nestedConfig
|
|
234
|
+
* const nestedConfig = {
|
|
210
235
|
* user: {
|
|
211
236
|
* name: Flag.string("name"),
|
|
212
237
|
* email: Flag.string("email")
|
|
@@ -215,7 +240,9 @@ export declare namespace Command {
|
|
|
215
240
|
* host: Flag.string("host"),
|
|
216
241
|
* port: Flag.integer("port")
|
|
217
242
|
* }
|
|
218
|
-
* }
|
|
243
|
+
* } satisfies CliCommand.Command.Config
|
|
244
|
+
*
|
|
245
|
+
* [simpleConfig.name.kind, nestedConfig.server.port.kind] // => ["flag", "flag"]
|
|
219
246
|
* ```
|
|
220
247
|
*
|
|
221
248
|
* @category models
|
|
@@ -261,7 +288,7 @@ export declare namespace Command {
|
|
|
261
288
|
*
|
|
262
289
|
* **Example** (Inferring command input)
|
|
263
290
|
*
|
|
264
|
-
* ```ts
|
|
291
|
+
* ```ts import.meta.vitest
|
|
265
292
|
* import { Flag } from "effect/unstable/cli"
|
|
266
293
|
* import type { Command as CliCommand } from "effect/unstable/cli"
|
|
267
294
|
*
|
|
@@ -281,6 +308,12 @@ export declare namespace Command {
|
|
|
281
308
|
* // readonly port: number
|
|
282
309
|
* // }
|
|
283
310
|
* // }
|
|
311
|
+
*
|
|
312
|
+
* const inferred: Result = {
|
|
313
|
+
* name: "Alice",
|
|
314
|
+
* server: { host: "localhost", port: 8080 }
|
|
315
|
+
* }
|
|
316
|
+
* inferred // => { name: "Alice", server: { host: "localhost", port: 8080 } }
|
|
284
317
|
* ```
|
|
285
318
|
*
|
|
286
319
|
* @category models
|
|
@@ -320,7 +353,7 @@ export declare namespace Command {
|
|
|
320
353
|
readonly commands: NonEmptyReadonlyArray<Command.Any>
|
|
321
354
|
}>
|
|
322
355
|
readonly annotations: Context.Context<never>
|
|
323
|
-
readonly
|
|
356
|
+
readonly unlisted: boolean
|
|
324
357
|
}
|
|
325
358
|
|
|
326
359
|
/**
|
|
@@ -399,9 +432,27 @@ export type Services<C> = C extends Command<
|
|
|
399
432
|
*
|
|
400
433
|
* **Example** (Accessing parent command context)
|
|
401
434
|
*
|
|
402
|
-
* ```ts
|
|
403
|
-
* import {
|
|
435
|
+
* ```ts import.meta.vitest
|
|
436
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
404
437
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
438
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
439
|
+
*
|
|
440
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
441
|
+
* FileSystem.layerNoop({}),
|
|
442
|
+
* Path.layer,
|
|
443
|
+
* Stdio.layerTest({}),
|
|
444
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
445
|
+
* columns: Effect.succeed(80),
|
|
446
|
+
* rows: Effect.succeed(24),
|
|
447
|
+
* readInput: Effect.die("unused"),
|
|
448
|
+
* readLine: Effect.die("unused"),
|
|
449
|
+
* display: () => Effect.void
|
|
450
|
+
* })),
|
|
451
|
+
* Layer.succeed(
|
|
452
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
453
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
454
|
+
* )
|
|
455
|
+
* )
|
|
405
456
|
*
|
|
406
457
|
* const parent = Command.make("app").pipe(
|
|
407
458
|
* Command.withSharedFlags({
|
|
@@ -410,19 +461,31 @@ export type Services<C> = C extends Command<
|
|
|
410
461
|
* })
|
|
411
462
|
* )
|
|
412
463
|
*
|
|
464
|
+
* const output: Array<string> = []
|
|
413
465
|
* const child = Command.make("deploy", {
|
|
414
466
|
* target: Flag.string("target")
|
|
415
467
|
* }, (config) =>
|
|
416
468
|
* Effect.gen(function*() {
|
|
417
469
|
* // Access parent's config by yielding the parent command
|
|
418
470
|
* const parentConfig = yield* parent
|
|
419
|
-
* yield*
|
|
420
|
-
* yield*
|
|
421
|
-
* yield*
|
|
471
|
+
* yield* Effect.sync(() => output.push(`Verbose: ${parentConfig.verbose}`))
|
|
472
|
+
* yield* Effect.sync(() => output.push(`Config: ${parentConfig.config}`))
|
|
473
|
+
* yield* Effect.sync(() => output.push(`Target: ${config.target}`))
|
|
422
474
|
* }))
|
|
423
475
|
*
|
|
424
476
|
* const app = parent.pipe(Command.withSubcommands([child]))
|
|
425
|
-
*
|
|
477
|
+
*
|
|
478
|
+
* await Effect.runPromise(
|
|
479
|
+
* Command.runWith(app, { version: "1.0.0" })([
|
|
480
|
+
* "--verbose",
|
|
481
|
+
* "--config",
|
|
482
|
+
* "prod.json",
|
|
483
|
+
* "deploy",
|
|
484
|
+
* "--target",
|
|
485
|
+
* "staging"
|
|
486
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
487
|
+
* )
|
|
488
|
+
* output // => ["Verbose: true", "Config: prod.json", "Target: staging"]
|
|
426
489
|
* ```
|
|
427
490
|
*
|
|
428
491
|
* @category models
|
|
@@ -478,9 +541,27 @@ export const isCommand = (u: unknown): u is Command.Any => Predicate.hasProperty
|
|
|
478
541
|
*
|
|
479
542
|
* **Example** (Creating commands)
|
|
480
543
|
*
|
|
481
|
-
* ```ts
|
|
482
|
-
* import {
|
|
544
|
+
* ```ts import.meta.vitest
|
|
545
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
483
546
|
* import { Argument, Command, Flag } from "effect/unstable/cli"
|
|
547
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
548
|
+
*
|
|
549
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
550
|
+
* FileSystem.layerNoop({}),
|
|
551
|
+
* Path.layer,
|
|
552
|
+
* Stdio.layerTest({}),
|
|
553
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
554
|
+
* columns: Effect.succeed(80),
|
|
555
|
+
* rows: Effect.succeed(24),
|
|
556
|
+
* readInput: Effect.die("unused"),
|
|
557
|
+
* readLine: Effect.die("unused"),
|
|
558
|
+
* display: () => Effect.void
|
|
559
|
+
* })),
|
|
560
|
+
* Layer.succeed(
|
|
561
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
562
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
563
|
+
* )
|
|
564
|
+
* )
|
|
484
565
|
*
|
|
485
566
|
* // Simple command with no configuration
|
|
486
567
|
* const version = Command.make("version")
|
|
@@ -505,19 +586,29 @@ export const isCommand = (u: unknown): u is Command.Any => Predicate.hasProperty
|
|
|
505
586
|
* })
|
|
506
587
|
*
|
|
507
588
|
* // Command with handler
|
|
589
|
+
* const output: Array<string> = []
|
|
508
590
|
* const deployWithHandler = Command.make("deploy", {
|
|
509
591
|
* environment: Flag.string("env"),
|
|
510
592
|
* force: Flag.boolean("force")
|
|
511
593
|
* }, (config) =>
|
|
512
594
|
* Effect.gen(function*() {
|
|
513
|
-
* yield*
|
|
595
|
+
* yield* Effect.sync(() => output.push(`Starting deployment to ${config.environment}`))
|
|
514
596
|
*
|
|
515
597
|
* if (!config.force && config.environment === "production") {
|
|
516
598
|
* return yield* Effect.fail("Production deployments require --force flag")
|
|
517
599
|
* }
|
|
518
600
|
*
|
|
519
|
-
* yield*
|
|
601
|
+
* yield* Effect.sync(() => output.push("Deployment completed successfully"))
|
|
520
602
|
* }))
|
|
603
|
+
*
|
|
604
|
+
* await Effect.runPromise(
|
|
605
|
+
* Command.runWith(deployWithHandler, { version: "1.0.0" })([
|
|
606
|
+
* "--env",
|
|
607
|
+
* "staging",
|
|
608
|
+
* "--force"
|
|
609
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
610
|
+
* )
|
|
611
|
+
* output // => ["Starting deployment to staging", "Deployment completed successfully"]
|
|
521
612
|
* ```
|
|
522
613
|
*
|
|
523
614
|
* @category constructors
|
|
@@ -540,9 +631,27 @@ export const make: {
|
|
|
540
631
|
*
|
|
541
632
|
* **Example** (Creating commands)
|
|
542
633
|
*
|
|
543
|
-
* ```ts
|
|
544
|
-
* import {
|
|
634
|
+
* ```ts import.meta.vitest
|
|
635
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
545
636
|
* import { Argument, Command, Flag } from "effect/unstable/cli"
|
|
637
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
638
|
+
*
|
|
639
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
640
|
+
* FileSystem.layerNoop({}),
|
|
641
|
+
* Path.layer,
|
|
642
|
+
* Stdio.layerTest({}),
|
|
643
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
644
|
+
* columns: Effect.succeed(80),
|
|
645
|
+
* rows: Effect.succeed(24),
|
|
646
|
+
* readInput: Effect.die("unused"),
|
|
647
|
+
* readLine: Effect.die("unused"),
|
|
648
|
+
* display: () => Effect.void
|
|
649
|
+
* })),
|
|
650
|
+
* Layer.succeed(
|
|
651
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
652
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
653
|
+
* )
|
|
654
|
+
* )
|
|
546
655
|
*
|
|
547
656
|
* // Simple command with no configuration
|
|
548
657
|
* const version = Command.make("version")
|
|
@@ -567,19 +676,29 @@ export const make: {
|
|
|
567
676
|
* })
|
|
568
677
|
*
|
|
569
678
|
* // Command with handler
|
|
679
|
+
* const output: Array<string> = []
|
|
570
680
|
* const deployWithHandler = Command.make("deploy", {
|
|
571
681
|
* environment: Flag.string("env"),
|
|
572
682
|
* force: Flag.boolean("force")
|
|
573
683
|
* }, (config) =>
|
|
574
684
|
* Effect.gen(function*() {
|
|
575
|
-
* yield*
|
|
685
|
+
* yield* Effect.sync(() => output.push(`Starting deployment to ${config.environment}`))
|
|
576
686
|
*
|
|
577
687
|
* if (!config.force && config.environment === "production") {
|
|
578
688
|
* return yield* Effect.fail("Production deployments require --force flag")
|
|
579
689
|
* }
|
|
580
690
|
*
|
|
581
|
-
* yield*
|
|
691
|
+
* yield* Effect.sync(() => output.push("Deployment completed successfully"))
|
|
582
692
|
* }))
|
|
693
|
+
*
|
|
694
|
+
* await Effect.runPromise(
|
|
695
|
+
* Command.runWith(deployWithHandler, { version: "1.0.0" })([
|
|
696
|
+
* "--env",
|
|
697
|
+
* "staging",
|
|
698
|
+
* "--force"
|
|
699
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
700
|
+
* )
|
|
701
|
+
* output // => ["Starting deployment to staging", "Deployment completed successfully"]
|
|
583
702
|
* ```
|
|
584
703
|
*
|
|
585
704
|
* @category constructors
|
|
@@ -603,9 +722,27 @@ export const make: {
|
|
|
603
722
|
*
|
|
604
723
|
* **Example** (Creating commands)
|
|
605
724
|
*
|
|
606
|
-
* ```ts
|
|
607
|
-
* import {
|
|
725
|
+
* ```ts import.meta.vitest
|
|
726
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
608
727
|
* import { Argument, Command, Flag } from "effect/unstable/cli"
|
|
728
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
729
|
+
*
|
|
730
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
731
|
+
* FileSystem.layerNoop({}),
|
|
732
|
+
* Path.layer,
|
|
733
|
+
* Stdio.layerTest({}),
|
|
734
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
735
|
+
* columns: Effect.succeed(80),
|
|
736
|
+
* rows: Effect.succeed(24),
|
|
737
|
+
* readInput: Effect.die("unused"),
|
|
738
|
+
* readLine: Effect.die("unused"),
|
|
739
|
+
* display: () => Effect.void
|
|
740
|
+
* })),
|
|
741
|
+
* Layer.succeed(
|
|
742
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
743
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
744
|
+
* )
|
|
745
|
+
* )
|
|
609
746
|
*
|
|
610
747
|
* // Simple command with no configuration
|
|
611
748
|
* const version = Command.make("version")
|
|
@@ -630,19 +767,29 @@ export const make: {
|
|
|
630
767
|
* })
|
|
631
768
|
*
|
|
632
769
|
* // Command with handler
|
|
770
|
+
* const output: Array<string> = []
|
|
633
771
|
* const deployWithHandler = Command.make("deploy", {
|
|
634
772
|
* environment: Flag.string("env"),
|
|
635
773
|
* force: Flag.boolean("force")
|
|
636
774
|
* }, (config) =>
|
|
637
775
|
* Effect.gen(function*() {
|
|
638
|
-
* yield*
|
|
776
|
+
* yield* Effect.sync(() => output.push(`Starting deployment to ${config.environment}`))
|
|
639
777
|
*
|
|
640
778
|
* if (!config.force && config.environment === "production") {
|
|
641
779
|
* return yield* Effect.fail("Production deployments require --force flag")
|
|
642
780
|
* }
|
|
643
781
|
*
|
|
644
|
-
* yield*
|
|
782
|
+
* yield* Effect.sync(() => output.push("Deployment completed successfully"))
|
|
645
783
|
* }))
|
|
784
|
+
*
|
|
785
|
+
* await Effect.runPromise(
|
|
786
|
+
* Command.runWith(deployWithHandler, { version: "1.0.0" })([
|
|
787
|
+
* "--env",
|
|
788
|
+
* "staging",
|
|
789
|
+
* "--force"
|
|
790
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
791
|
+
* )
|
|
792
|
+
* output // => ["Starting deployment to staging", "Deployment completed successfully"]
|
|
646
793
|
* ```
|
|
647
794
|
*
|
|
648
795
|
* @category constructors
|
|
@@ -666,9 +813,27 @@ export const make: {
|
|
|
666
813
|
*
|
|
667
814
|
* **Example** (Creating commands)
|
|
668
815
|
*
|
|
669
|
-
* ```ts
|
|
670
|
-
* import {
|
|
816
|
+
* ```ts import.meta.vitest
|
|
817
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
671
818
|
* import { Argument, Command, Flag } from "effect/unstable/cli"
|
|
819
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
820
|
+
*
|
|
821
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
822
|
+
* FileSystem.layerNoop({}),
|
|
823
|
+
* Path.layer,
|
|
824
|
+
* Stdio.layerTest({}),
|
|
825
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
826
|
+
* columns: Effect.succeed(80),
|
|
827
|
+
* rows: Effect.succeed(24),
|
|
828
|
+
* readInput: Effect.die("unused"),
|
|
829
|
+
* readLine: Effect.die("unused"),
|
|
830
|
+
* display: () => Effect.void
|
|
831
|
+
* })),
|
|
832
|
+
* Layer.succeed(
|
|
833
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
834
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
835
|
+
* )
|
|
836
|
+
* )
|
|
672
837
|
*
|
|
673
838
|
* // Simple command with no configuration
|
|
674
839
|
* const version = Command.make("version")
|
|
@@ -693,19 +858,29 @@ export const make: {
|
|
|
693
858
|
* })
|
|
694
859
|
*
|
|
695
860
|
* // Command with handler
|
|
861
|
+
* const output: Array<string> = []
|
|
696
862
|
* const deployWithHandler = Command.make("deploy", {
|
|
697
863
|
* environment: Flag.string("env"),
|
|
698
864
|
* force: Flag.boolean("force")
|
|
699
865
|
* }, (config) =>
|
|
700
866
|
* Effect.gen(function*() {
|
|
701
|
-
* yield*
|
|
867
|
+
* yield* Effect.sync(() => output.push(`Starting deployment to ${config.environment}`))
|
|
702
868
|
*
|
|
703
869
|
* if (!config.force && config.environment === "production") {
|
|
704
870
|
* return yield* Effect.fail("Production deployments require --force flag")
|
|
705
871
|
* }
|
|
706
872
|
*
|
|
707
|
-
* yield*
|
|
873
|
+
* yield* Effect.sync(() => output.push("Deployment completed successfully"))
|
|
708
874
|
* }))
|
|
875
|
+
*
|
|
876
|
+
* await Effect.runPromise(
|
|
877
|
+
* Command.runWith(deployWithHandler, { version: "1.0.0" })([
|
|
878
|
+
* "--env",
|
|
879
|
+
* "staging",
|
|
880
|
+
* "--force"
|
|
881
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
882
|
+
* )
|
|
883
|
+
* output // => ["Starting deployment to staging", "Deployment completed successfully"]
|
|
709
884
|
* ```
|
|
710
885
|
*
|
|
711
886
|
* @category constructors
|
|
@@ -738,9 +913,27 @@ export const make: {
|
|
|
738
913
|
*
|
|
739
914
|
* **Example** (Adding command handlers)
|
|
740
915
|
*
|
|
741
|
-
* ```ts
|
|
742
|
-
* import {
|
|
916
|
+
* ```ts import.meta.vitest
|
|
917
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
743
918
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
919
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
920
|
+
*
|
|
921
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
922
|
+
* FileSystem.layerNoop({}),
|
|
923
|
+
* Path.layer,
|
|
924
|
+
* Stdio.layerTest({}),
|
|
925
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
926
|
+
* columns: Effect.succeed(80),
|
|
927
|
+
* rows: Effect.succeed(24),
|
|
928
|
+
* readInput: Effect.die("unused"),
|
|
929
|
+
* readLine: Effect.die("unused"),
|
|
930
|
+
* display: () => Effect.void
|
|
931
|
+
* })),
|
|
932
|
+
* Layer.succeed(
|
|
933
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
934
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
935
|
+
* )
|
|
936
|
+
* )
|
|
744
937
|
*
|
|
745
938
|
* // Command without initial handler
|
|
746
939
|
* const greet = Command.make("greet", {
|
|
@@ -748,11 +941,19 @@ export const make: {
|
|
|
748
941
|
* })
|
|
749
942
|
*
|
|
750
943
|
* // Add handler later
|
|
944
|
+
* const output: Array<string> = []
|
|
751
945
|
* const greetWithHandler = greet.pipe(
|
|
752
946
|
* Command.withHandler((config: { readonly name: string }) =>
|
|
753
|
-
*
|
|
947
|
+
* Effect.sync(() => output.push(`Hello, ${config.name}!`)).pipe(Effect.asVoid)
|
|
754
948
|
* )
|
|
755
949
|
* )
|
|
950
|
+
*
|
|
951
|
+
* await Effect.runPromise(
|
|
952
|
+
* Command.runWith(greetWithHandler, { version: "1.0.0" })(["--name", "Alice"]).pipe(
|
|
953
|
+
* Effect.provide(CliTestLayer)
|
|
954
|
+
* )
|
|
955
|
+
* )
|
|
956
|
+
* output // => ["Hello, Alice!"]
|
|
756
957
|
* ```
|
|
757
958
|
*
|
|
758
959
|
* @category combinators
|
|
@@ -768,9 +969,27 @@ export const withHandler: {
|
|
|
768
969
|
*
|
|
769
970
|
* **Example** (Adding command handlers)
|
|
770
971
|
*
|
|
771
|
-
* ```ts
|
|
772
|
-
* import {
|
|
972
|
+
* ```ts import.meta.vitest
|
|
973
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
773
974
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
975
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
976
|
+
*
|
|
977
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
978
|
+
* FileSystem.layerNoop({}),
|
|
979
|
+
* Path.layer,
|
|
980
|
+
* Stdio.layerTest({}),
|
|
981
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
982
|
+
* columns: Effect.succeed(80),
|
|
983
|
+
* rows: Effect.succeed(24),
|
|
984
|
+
* readInput: Effect.die("unused"),
|
|
985
|
+
* readLine: Effect.die("unused"),
|
|
986
|
+
* display: () => Effect.void
|
|
987
|
+
* })),
|
|
988
|
+
* Layer.succeed(
|
|
989
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
990
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
991
|
+
* )
|
|
992
|
+
* )
|
|
774
993
|
*
|
|
775
994
|
* // Command without initial handler
|
|
776
995
|
* const greet = Command.make("greet", {
|
|
@@ -778,11 +997,19 @@ export const withHandler: {
|
|
|
778
997
|
* })
|
|
779
998
|
*
|
|
780
999
|
* // Add handler later
|
|
1000
|
+
* const output: Array<string> = []
|
|
781
1001
|
* const greetWithHandler = greet.pipe(
|
|
782
1002
|
* Command.withHandler((config: { readonly name: string }) =>
|
|
783
|
-
*
|
|
1003
|
+
* Effect.sync(() => output.push(`Hello, ${config.name}!`)).pipe(Effect.asVoid)
|
|
1004
|
+
* )
|
|
1005
|
+
* )
|
|
1006
|
+
*
|
|
1007
|
+
* await Effect.runPromise(
|
|
1008
|
+
* Command.runWith(greetWithHandler, { version: "1.0.0" })(["--name", "Alice"]).pipe(
|
|
1009
|
+
* Effect.provide(CliTestLayer)
|
|
784
1010
|
* )
|
|
785
1011
|
* )
|
|
1012
|
+
* output // => ["Hello, Alice!"]
|
|
786
1013
|
* ```
|
|
787
1014
|
*
|
|
788
1015
|
* @category combinators
|
|
@@ -800,9 +1027,27 @@ export const withHandler: {
|
|
|
800
1027
|
*
|
|
801
1028
|
* **Example** (Adding command handlers)
|
|
802
1029
|
*
|
|
803
|
-
* ```ts
|
|
804
|
-
* import {
|
|
1030
|
+
* ```ts import.meta.vitest
|
|
1031
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
805
1032
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
1033
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
1034
|
+
*
|
|
1035
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
1036
|
+
* FileSystem.layerNoop({}),
|
|
1037
|
+
* Path.layer,
|
|
1038
|
+
* Stdio.layerTest({}),
|
|
1039
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
1040
|
+
* columns: Effect.succeed(80),
|
|
1041
|
+
* rows: Effect.succeed(24),
|
|
1042
|
+
* readInput: Effect.die("unused"),
|
|
1043
|
+
* readLine: Effect.die("unused"),
|
|
1044
|
+
* display: () => Effect.void
|
|
1045
|
+
* })),
|
|
1046
|
+
* Layer.succeed(
|
|
1047
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
1048
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
1049
|
+
* )
|
|
1050
|
+
* )
|
|
806
1051
|
*
|
|
807
1052
|
* // Command without initial handler
|
|
808
1053
|
* const greet = Command.make("greet", {
|
|
@@ -810,11 +1055,19 @@ export const withHandler: {
|
|
|
810
1055
|
* })
|
|
811
1056
|
*
|
|
812
1057
|
* // Add handler later
|
|
1058
|
+
* const output: Array<string> = []
|
|
813
1059
|
* const greetWithHandler = greet.pipe(
|
|
814
1060
|
* Command.withHandler((config: { readonly name: string }) =>
|
|
815
|
-
*
|
|
1061
|
+
* Effect.sync(() => output.push(`Hello, ${config.name}!`)).pipe(Effect.asVoid)
|
|
816
1062
|
* )
|
|
817
1063
|
* )
|
|
1064
|
+
*
|
|
1065
|
+
* await Effect.runPromise(
|
|
1066
|
+
* Command.runWith(greetWithHandler, { version: "1.0.0" })(["--name", "Alice"]).pipe(
|
|
1067
|
+
* Effect.provide(CliTestLayer)
|
|
1068
|
+
* )
|
|
1069
|
+
* )
|
|
1070
|
+
* output // => ["Hello, Alice!"]
|
|
818
1071
|
* ```
|
|
819
1072
|
*
|
|
820
1073
|
* @category combinators
|
|
@@ -892,9 +1145,27 @@ const normalizeSubcommandEntries = (
|
|
|
892
1145
|
*
|
|
893
1146
|
* **Example** (Adding subcommands)
|
|
894
1147
|
*
|
|
895
|
-
* ```ts
|
|
896
|
-
* import {
|
|
1148
|
+
* ```ts import.meta.vitest
|
|
1149
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
897
1150
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
1151
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
1152
|
+
*
|
|
1153
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
1154
|
+
* FileSystem.layerNoop({}),
|
|
1155
|
+
* Path.layer,
|
|
1156
|
+
* Stdio.layerTest({}),
|
|
1157
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
1158
|
+
* columns: Effect.succeed(80),
|
|
1159
|
+
* rows: Effect.succeed(24),
|
|
1160
|
+
* readInput: Effect.die("unused"),
|
|
1161
|
+
* readLine: Effect.die("unused"),
|
|
1162
|
+
* display: () => Effect.void
|
|
1163
|
+
* })),
|
|
1164
|
+
* Layer.succeed(
|
|
1165
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
1166
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
1167
|
+
* )
|
|
1168
|
+
* )
|
|
898
1169
|
*
|
|
899
1170
|
* // Parent command with shared flags
|
|
900
1171
|
* const git = Command.make("git").pipe(
|
|
@@ -904,19 +1175,29 @@ const normalizeSubcommandEntries = (
|
|
|
904
1175
|
* )
|
|
905
1176
|
*
|
|
906
1177
|
* // Subcommand that accesses parent config
|
|
1178
|
+
* const output: Array<string> = []
|
|
907
1179
|
* const clone = Command.make("clone", {
|
|
908
1180
|
* repository: Flag.string("repo")
|
|
909
1181
|
* }, (config) =>
|
|
910
1182
|
* Effect.gen(function*() {
|
|
911
1183
|
* const parent = yield* git // Access parent's parsed config
|
|
912
1184
|
* if (parent.verbose) {
|
|
913
|
-
* yield*
|
|
1185
|
+
* yield* Effect.sync(() => output.push("Verbose mode enabled"))
|
|
914
1186
|
* }
|
|
915
|
-
* yield*
|
|
1187
|
+
* yield* Effect.sync(() => output.push(`Cloning ${config.repository}`))
|
|
916
1188
|
* }))
|
|
917
1189
|
*
|
|
918
1190
|
* const app = git.pipe(Command.withSubcommands([clone]))
|
|
919
|
-
*
|
|
1191
|
+
*
|
|
1192
|
+
* await Effect.runPromise(
|
|
1193
|
+
* Command.runWith(app, { version: "1.0.0" })([
|
|
1194
|
+
* "--verbose",
|
|
1195
|
+
* "clone",
|
|
1196
|
+
* "--repo",
|
|
1197
|
+
* "github.com/foo/bar"
|
|
1198
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
1199
|
+
* )
|
|
1200
|
+
* output // => ["Verbose mode enabled", "Cloning github.com/foo/bar"]
|
|
920
1201
|
* ```
|
|
921
1202
|
*
|
|
922
1203
|
* @category combinators
|
|
@@ -934,9 +1215,27 @@ export const withSubcommands: {
|
|
|
934
1215
|
*
|
|
935
1216
|
* **Example** (Adding subcommands)
|
|
936
1217
|
*
|
|
937
|
-
* ```ts
|
|
938
|
-
* import {
|
|
1218
|
+
* ```ts import.meta.vitest
|
|
1219
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
939
1220
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
1221
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
1222
|
+
*
|
|
1223
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
1224
|
+
* FileSystem.layerNoop({}),
|
|
1225
|
+
* Path.layer,
|
|
1226
|
+
* Stdio.layerTest({}),
|
|
1227
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
1228
|
+
* columns: Effect.succeed(80),
|
|
1229
|
+
* rows: Effect.succeed(24),
|
|
1230
|
+
* readInput: Effect.die("unused"),
|
|
1231
|
+
* readLine: Effect.die("unused"),
|
|
1232
|
+
* display: () => Effect.void
|
|
1233
|
+
* })),
|
|
1234
|
+
* Layer.succeed(
|
|
1235
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
1236
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
1237
|
+
* )
|
|
1238
|
+
* )
|
|
940
1239
|
*
|
|
941
1240
|
* // Parent command with shared flags
|
|
942
1241
|
* const git = Command.make("git").pipe(
|
|
@@ -946,19 +1245,29 @@ export const withSubcommands: {
|
|
|
946
1245
|
* )
|
|
947
1246
|
*
|
|
948
1247
|
* // Subcommand that accesses parent config
|
|
1248
|
+
* const output: Array<string> = []
|
|
949
1249
|
* const clone = Command.make("clone", {
|
|
950
1250
|
* repository: Flag.string("repo")
|
|
951
1251
|
* }, (config) =>
|
|
952
1252
|
* Effect.gen(function*() {
|
|
953
1253
|
* const parent = yield* git // Access parent's parsed config
|
|
954
1254
|
* if (parent.verbose) {
|
|
955
|
-
* yield*
|
|
1255
|
+
* yield* Effect.sync(() => output.push("Verbose mode enabled"))
|
|
956
1256
|
* }
|
|
957
|
-
* yield*
|
|
1257
|
+
* yield* Effect.sync(() => output.push(`Cloning ${config.repository}`))
|
|
958
1258
|
* }))
|
|
959
1259
|
*
|
|
960
1260
|
* const app = git.pipe(Command.withSubcommands([clone]))
|
|
961
|
-
*
|
|
1261
|
+
*
|
|
1262
|
+
* await Effect.runPromise(
|
|
1263
|
+
* Command.runWith(app, { version: "1.0.0" })([
|
|
1264
|
+
* "--verbose",
|
|
1265
|
+
* "clone",
|
|
1266
|
+
* "--repo",
|
|
1267
|
+
* "github.com/foo/bar"
|
|
1268
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
1269
|
+
* )
|
|
1270
|
+
* output // => ["Verbose mode enabled", "Cloning github.com/foo/bar"]
|
|
962
1271
|
* ```
|
|
963
1272
|
*
|
|
964
1273
|
* @category combinators
|
|
@@ -984,9 +1293,27 @@ export const withSubcommands: {
|
|
|
984
1293
|
*
|
|
985
1294
|
* **Example** (Adding subcommands)
|
|
986
1295
|
*
|
|
987
|
-
* ```ts
|
|
988
|
-
* import {
|
|
1296
|
+
* ```ts import.meta.vitest
|
|
1297
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
989
1298
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
1299
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
1300
|
+
*
|
|
1301
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
1302
|
+
* FileSystem.layerNoop({}),
|
|
1303
|
+
* Path.layer,
|
|
1304
|
+
* Stdio.layerTest({}),
|
|
1305
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
1306
|
+
* columns: Effect.succeed(80),
|
|
1307
|
+
* rows: Effect.succeed(24),
|
|
1308
|
+
* readInput: Effect.die("unused"),
|
|
1309
|
+
* readLine: Effect.die("unused"),
|
|
1310
|
+
* display: () => Effect.void
|
|
1311
|
+
* })),
|
|
1312
|
+
* Layer.succeed(
|
|
1313
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
1314
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
1315
|
+
* )
|
|
1316
|
+
* )
|
|
990
1317
|
*
|
|
991
1318
|
* // Parent command with shared flags
|
|
992
1319
|
* const git = Command.make("git").pipe(
|
|
@@ -996,19 +1323,29 @@ export const withSubcommands: {
|
|
|
996
1323
|
* )
|
|
997
1324
|
*
|
|
998
1325
|
* // Subcommand that accesses parent config
|
|
1326
|
+
* const output: Array<string> = []
|
|
999
1327
|
* const clone = Command.make("clone", {
|
|
1000
1328
|
* repository: Flag.string("repo")
|
|
1001
1329
|
* }, (config) =>
|
|
1002
1330
|
* Effect.gen(function*() {
|
|
1003
1331
|
* const parent = yield* git // Access parent's parsed config
|
|
1004
1332
|
* if (parent.verbose) {
|
|
1005
|
-
* yield*
|
|
1333
|
+
* yield* Effect.sync(() => output.push("Verbose mode enabled"))
|
|
1006
1334
|
* }
|
|
1007
|
-
* yield*
|
|
1335
|
+
* yield* Effect.sync(() => output.push(`Cloning ${config.repository}`))
|
|
1008
1336
|
* }))
|
|
1009
1337
|
*
|
|
1010
1338
|
* const app = git.pipe(Command.withSubcommands([clone]))
|
|
1011
|
-
*
|
|
1339
|
+
*
|
|
1340
|
+
* await Effect.runPromise(
|
|
1341
|
+
* Command.runWith(app, { version: "1.0.0" })([
|
|
1342
|
+
* "--verbose",
|
|
1343
|
+
* "clone",
|
|
1344
|
+
* "--repo",
|
|
1345
|
+
* "github.com/foo/bar"
|
|
1346
|
+
* ]).pipe(Effect.provide(CliTestLayer))
|
|
1347
|
+
* )
|
|
1348
|
+
* output // => ["Verbose mode enabled", "Cloning github.com/foo/bar"]
|
|
1012
1349
|
* ```
|
|
1013
1350
|
*
|
|
1014
1351
|
* @category combinators
|
|
@@ -1068,7 +1405,7 @@ export const withSubcommands: {
|
|
|
1068
1405
|
|
|
1069
1406
|
const context = yield* impl.parseContext(raw)
|
|
1070
1407
|
const result = yield* sub.parse(raw.subcommand.value.parsedInput)
|
|
1071
|
-
return
|
|
1408
|
+
return { ...context, [SubcommandStateSymbol]: { name: sub.name, result } } as NextInput
|
|
1072
1409
|
})
|
|
1073
1410
|
|
|
1074
1411
|
const handle = Effect.fnUntraced(function*(input: NextInput, path: ReadonlyArray<string>) {
|
|
@@ -1094,6 +1431,7 @@ export const withSubcommands: {
|
|
|
1094
1431
|
description: impl.description,
|
|
1095
1432
|
shortDescription: impl.shortDescription,
|
|
1096
1433
|
alias: impl.alias,
|
|
1434
|
+
unlisted: impl.unlisted,
|
|
1097
1435
|
annotations: impl.annotations,
|
|
1098
1436
|
globalFlags: impl.globalFlags,
|
|
1099
1437
|
examples: impl.examples,
|
|
@@ -1184,20 +1522,20 @@ export const withSharedFlags: {
|
|
|
1184
1522
|
type NextInput = Simplify<Input & SharedInput>
|
|
1185
1523
|
type NextContextInput = Simplify<ContextInput & SharedInput>
|
|
1186
1524
|
|
|
1187
|
-
const parseShared = makeParser(sharedConfig) as (
|
|
1525
|
+
const parseShared = makeParser(sharedConfig, { allowLeftovers: true }) as (
|
|
1188
1526
|
input: ParsedTokens
|
|
1189
1527
|
) => Effect.Effect<SharedInput, CliError.CliError, Environment>
|
|
1190
1528
|
|
|
1191
1529
|
const parse = Effect.fnUntraced(function*(raw: ParsedTokens) {
|
|
1192
1530
|
const base = yield* impl.parse(raw)
|
|
1193
1531
|
const shared = yield* parseShared(raw)
|
|
1194
|
-
return
|
|
1532
|
+
return { ...(base as object), ...(shared as object) } as NextInput
|
|
1195
1533
|
})
|
|
1196
1534
|
|
|
1197
1535
|
const parseContext = Effect.fnUntraced(function*(raw: ParsedTokens) {
|
|
1198
1536
|
const base = yield* impl.parseContext(raw)
|
|
1199
1537
|
const shared = yield* parseShared(raw)
|
|
1200
|
-
return
|
|
1538
|
+
return { ...(base as object), ...(shared as object) } as NextContextInput
|
|
1201
1539
|
})
|
|
1202
1540
|
|
|
1203
1541
|
const handle = (
|
|
@@ -1212,6 +1550,7 @@ export const withSharedFlags: {
|
|
|
1212
1550
|
description: impl.description,
|
|
1213
1551
|
shortDescription: impl.shortDescription,
|
|
1214
1552
|
alias: impl.alias,
|
|
1553
|
+
unlisted: impl.unlisted,
|
|
1215
1554
|
annotations: impl.annotations,
|
|
1216
1555
|
globalFlags: impl.globalFlags,
|
|
1217
1556
|
examples: impl.examples,
|
|
@@ -1307,18 +1646,42 @@ type ExtractSubcommandContext<T extends ReadonlyArray<Command.SubcommandEntry>>
|
|
|
1307
1646
|
*
|
|
1308
1647
|
* **Example** (Setting descriptions)
|
|
1309
1648
|
*
|
|
1310
|
-
* ```ts
|
|
1311
|
-
* import {
|
|
1649
|
+
* ```ts import.meta.vitest
|
|
1650
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
1312
1651
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
1652
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
1653
|
+
*
|
|
1654
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
1655
|
+
* FileSystem.layerNoop({}),
|
|
1656
|
+
* Path.layer,
|
|
1657
|
+
* Stdio.layerTest({}),
|
|
1658
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
1659
|
+
* columns: Effect.succeed(80),
|
|
1660
|
+
* rows: Effect.succeed(24),
|
|
1661
|
+
* readInput: Effect.die("unused"),
|
|
1662
|
+
* readLine: Effect.die("unused"),
|
|
1663
|
+
* display: () => Effect.void
|
|
1664
|
+
* })),
|
|
1665
|
+
* Layer.succeed(
|
|
1666
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
1667
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
1668
|
+
* )
|
|
1669
|
+
* )
|
|
1313
1670
|
*
|
|
1671
|
+
* const output: Array<string> = []
|
|
1314
1672
|
* const deploy = Command.make("deploy", {
|
|
1315
1673
|
* environment: Flag.string("env")
|
|
1316
1674
|
* }, (config) =>
|
|
1317
1675
|
* Effect.gen(function*() {
|
|
1318
|
-
* yield*
|
|
1676
|
+
* yield* Effect.sync(() => output.push(`Deploying to ${config.environment}`))
|
|
1319
1677
|
* })).pipe(
|
|
1320
1678
|
* Command.withDescription("Deploy the application to a specified environment")
|
|
1321
1679
|
* )
|
|
1680
|
+
*
|
|
1681
|
+
* await Effect.runPromise(
|
|
1682
|
+
* Command.runWith(deploy, { version: "1.0.0" })(["--env", "staging"]).pipe(Effect.provide(CliTestLayer))
|
|
1683
|
+
* )
|
|
1684
|
+
* output // => ["Deploying to staging"]
|
|
1322
1685
|
* ```
|
|
1323
1686
|
*
|
|
1324
1687
|
* @category combinators
|
|
@@ -1335,18 +1698,42 @@ export const withDescription: {
|
|
|
1335
1698
|
*
|
|
1336
1699
|
* **Example** (Setting descriptions)
|
|
1337
1700
|
*
|
|
1338
|
-
* ```ts
|
|
1339
|
-
* import {
|
|
1701
|
+
* ```ts import.meta.vitest
|
|
1702
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
1340
1703
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
1704
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
1705
|
+
*
|
|
1706
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
1707
|
+
* FileSystem.layerNoop({}),
|
|
1708
|
+
* Path.layer,
|
|
1709
|
+
* Stdio.layerTest({}),
|
|
1710
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
1711
|
+
* columns: Effect.succeed(80),
|
|
1712
|
+
* rows: Effect.succeed(24),
|
|
1713
|
+
* readInput: Effect.die("unused"),
|
|
1714
|
+
* readLine: Effect.die("unused"),
|
|
1715
|
+
* display: () => Effect.void
|
|
1716
|
+
* })),
|
|
1717
|
+
* Layer.succeed(
|
|
1718
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
1719
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
1720
|
+
* )
|
|
1721
|
+
* )
|
|
1341
1722
|
*
|
|
1723
|
+
* const output: Array<string> = []
|
|
1342
1724
|
* const deploy = Command.make("deploy", {
|
|
1343
1725
|
* environment: Flag.string("env")
|
|
1344
1726
|
* }, (config) =>
|
|
1345
1727
|
* Effect.gen(function*() {
|
|
1346
|
-
* yield*
|
|
1728
|
+
* yield* Effect.sync(() => output.push(`Deploying to ${config.environment}`))
|
|
1347
1729
|
* })).pipe(
|
|
1348
1730
|
* Command.withDescription("Deploy the application to a specified environment")
|
|
1349
1731
|
* )
|
|
1732
|
+
*
|
|
1733
|
+
* await Effect.runPromise(
|
|
1734
|
+
* Command.runWith(deploy, { version: "1.0.0" })(["--env", "staging"]).pipe(Effect.provide(CliTestLayer))
|
|
1735
|
+
* )
|
|
1736
|
+
* output // => ["Deploying to staging"]
|
|
1350
1737
|
* ```
|
|
1351
1738
|
*
|
|
1352
1739
|
* @category combinators
|
|
@@ -1365,18 +1752,42 @@ export const withDescription: {
|
|
|
1365
1752
|
*
|
|
1366
1753
|
* **Example** (Setting descriptions)
|
|
1367
1754
|
*
|
|
1368
|
-
* ```ts
|
|
1369
|
-
* import {
|
|
1755
|
+
* ```ts import.meta.vitest
|
|
1756
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
1370
1757
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
1758
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
1759
|
+
*
|
|
1760
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
1761
|
+
* FileSystem.layerNoop({}),
|
|
1762
|
+
* Path.layer,
|
|
1763
|
+
* Stdio.layerTest({}),
|
|
1764
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
1765
|
+
* columns: Effect.succeed(80),
|
|
1766
|
+
* rows: Effect.succeed(24),
|
|
1767
|
+
* readInput: Effect.die("unused"),
|
|
1768
|
+
* readLine: Effect.die("unused"),
|
|
1769
|
+
* display: () => Effect.void
|
|
1770
|
+
* })),
|
|
1771
|
+
* Layer.succeed(
|
|
1772
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
1773
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
1774
|
+
* )
|
|
1775
|
+
* )
|
|
1371
1776
|
*
|
|
1777
|
+
* const output: Array<string> = []
|
|
1372
1778
|
* const deploy = Command.make("deploy", {
|
|
1373
1779
|
* environment: Flag.string("env")
|
|
1374
1780
|
* }, (config) =>
|
|
1375
1781
|
* Effect.gen(function*() {
|
|
1376
|
-
* yield*
|
|
1782
|
+
* yield* Effect.sync(() => output.push(`Deploying to ${config.environment}`))
|
|
1377
1783
|
* })).pipe(
|
|
1378
1784
|
* Command.withDescription("Deploy the application to a specified environment")
|
|
1379
1785
|
* )
|
|
1786
|
+
*
|
|
1787
|
+
* await Effect.runPromise(
|
|
1788
|
+
* Command.runWith(deploy, { version: "1.0.0" })(["--env", "staging"]).pipe(Effect.provide(CliTestLayer))
|
|
1789
|
+
* )
|
|
1790
|
+
* output // => ["Deploying to staging"]
|
|
1380
1791
|
* ```
|
|
1381
1792
|
*
|
|
1382
1793
|
* @category combinators
|
|
@@ -1478,7 +1889,7 @@ export const withAlias: {
|
|
|
1478
1889
|
) => makeCommand({ ...toImpl(self), alias }))
|
|
1479
1890
|
|
|
1480
1891
|
/**
|
|
1481
|
-
*
|
|
1892
|
+
* Omits a subcommand from parent help output, shell completions, and
|
|
1482
1893
|
* "did you mean?" suggestions while keeping it fully invocable by exact name.
|
|
1483
1894
|
*
|
|
1484
1895
|
* **When to use**
|
|
@@ -1486,29 +1897,31 @@ export const withAlias: {
|
|
|
1486
1897
|
* Use when experimental or internal subcommands should be accepted but not advertised on
|
|
1487
1898
|
* the public CLI surface.
|
|
1488
1899
|
*
|
|
1489
|
-
* **Example** (
|
|
1900
|
+
* **Example** (Unlisting a subcommand)
|
|
1490
1901
|
*
|
|
1491
|
-
* ```ts
|
|
1902
|
+
* ```ts import.meta.vitest
|
|
1492
1903
|
* import { Command } from "effect/unstable/cli"
|
|
1493
1904
|
*
|
|
1494
1905
|
* // `experimental` still runs when invoked as `mycli experimental`,
|
|
1495
1906
|
* // but it does not appear under SUBCOMMANDS in `mycli --help`.
|
|
1496
1907
|
* const experimental = Command.make("experimental").pipe(
|
|
1497
|
-
* Command.
|
|
1908
|
+
* Command.unlisted
|
|
1498
1909
|
* )
|
|
1499
1910
|
*
|
|
1500
1911
|
* const root = Command.make("mycli").pipe(
|
|
1501
1912
|
* Command.withSubcommands([experimental])
|
|
1502
1913
|
* )
|
|
1914
|
+
*
|
|
1915
|
+
* root.subcommands[0].commands[0].unlisted // => true
|
|
1503
1916
|
* ```
|
|
1504
1917
|
*
|
|
1505
1918
|
* @category combinators
|
|
1506
1919
|
* @since 4.0.0
|
|
1507
1920
|
*/
|
|
1508
|
-
export const
|
|
1921
|
+
export const unlisted = <const Name extends string, Input, E, R, ContextInput>(
|
|
1509
1922
|
self: Command<Name, Input, ContextInput, E, R>
|
|
1510
1923
|
): Command<Name, Input, ContextInput, E, R> =>
|
|
1511
|
-
makeCommand({ ...toImpl(self),
|
|
1924
|
+
makeCommand({ ...toImpl(self), unlisted: true }) as Command<Name, Input, ContextInput, E, R>
|
|
1512
1925
|
|
|
1513
1926
|
/**
|
|
1514
1927
|
* Adds a custom annotation to a command.
|
|
@@ -1689,7 +2102,7 @@ export const annotateMerge: {
|
|
|
1689
2102
|
*
|
|
1690
2103
|
* **Example** (Adding usage examples)
|
|
1691
2104
|
*
|
|
1692
|
-
* ```ts
|
|
2105
|
+
* ```ts import.meta.vitest
|
|
1693
2106
|
* import { Command } from "effect/unstable/cli"
|
|
1694
2107
|
*
|
|
1695
2108
|
* const login = Command.make("login").pipe(
|
|
@@ -1698,6 +2111,8 @@ export const annotateMerge: {
|
|
|
1698
2111
|
* { command: "myapp login --token sbp_abc123", description: "Log in with a token" }
|
|
1699
2112
|
* ])
|
|
1700
2113
|
* )
|
|
2114
|
+
*
|
|
2115
|
+
* login.examples.map((example) => example.command) // => ["myapp login", "myapp login --token sbp_abc123"]
|
|
1701
2116
|
* ```
|
|
1702
2117
|
*
|
|
1703
2118
|
* @category combinators
|
|
@@ -1714,7 +2129,7 @@ export const withExamples: {
|
|
|
1714
2129
|
*
|
|
1715
2130
|
* **Example** (Adding usage examples)
|
|
1716
2131
|
*
|
|
1717
|
-
* ```ts
|
|
2132
|
+
* ```ts import.meta.vitest
|
|
1718
2133
|
* import { Command } from "effect/unstable/cli"
|
|
1719
2134
|
*
|
|
1720
2135
|
* const login = Command.make("login").pipe(
|
|
@@ -1723,6 +2138,8 @@ export const withExamples: {
|
|
|
1723
2138
|
* { command: "myapp login --token sbp_abc123", description: "Log in with a token" }
|
|
1724
2139
|
* ])
|
|
1725
2140
|
* )
|
|
2141
|
+
*
|
|
2142
|
+
* login.examples.map((example) => example.command) // => ["myapp login", "myapp login --token sbp_abc123"]
|
|
1726
2143
|
* ```
|
|
1727
2144
|
*
|
|
1728
2145
|
* @category combinators
|
|
@@ -1741,7 +2158,7 @@ export const withExamples: {
|
|
|
1741
2158
|
*
|
|
1742
2159
|
* **Example** (Adding usage examples)
|
|
1743
2160
|
*
|
|
1744
|
-
* ```ts
|
|
2161
|
+
* ```ts import.meta.vitest
|
|
1745
2162
|
* import { Command } from "effect/unstable/cli"
|
|
1746
2163
|
*
|
|
1747
2164
|
* const login = Command.make("login").pipe(
|
|
@@ -1750,6 +2167,8 @@ export const withExamples: {
|
|
|
1750
2167
|
* { command: "myapp login --token sbp_abc123", description: "Log in with a token" }
|
|
1751
2168
|
* ])
|
|
1752
2169
|
* )
|
|
2170
|
+
*
|
|
2171
|
+
* login.examples.map((example) => example.command) // => ["myapp login", "myapp login --token sbp_abc123"]
|
|
1753
2172
|
* ```
|
|
1754
2173
|
*
|
|
1755
2174
|
* @category combinators
|
|
@@ -1783,16 +2202,35 @@ const mapHandler = <Name extends string, Input, E, R, ContextInput, E2, R2>(
|
|
|
1783
2202
|
*
|
|
1784
2203
|
* **Example** (Providing command services)
|
|
1785
2204
|
*
|
|
1786
|
-
* ```ts
|
|
1787
|
-
* import { Effect, FileSystem, PlatformError } from "effect"
|
|
2205
|
+
* ```ts import.meta.vitest
|
|
2206
|
+
* import { Effect, FileSystem, Layer, Path, PlatformError, Stdio, Terminal } from "effect"
|
|
1788
2207
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
2208
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2209
|
+
*
|
|
2210
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2211
|
+
* FileSystem.layerNoop({}),
|
|
2212
|
+
* Path.layer,
|
|
2213
|
+
* Stdio.layerTest({}),
|
|
2214
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2215
|
+
* columns: Effect.succeed(80),
|
|
2216
|
+
* rows: Effect.succeed(24),
|
|
2217
|
+
* readInput: Effect.die("unused"),
|
|
2218
|
+
* readLine: Effect.die("unused"),
|
|
2219
|
+
* display: () => Effect.void
|
|
2220
|
+
* })),
|
|
2221
|
+
* Layer.succeed(
|
|
2222
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2223
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2224
|
+
* )
|
|
2225
|
+
* )
|
|
1789
2226
|
*
|
|
2227
|
+
* const output: Array<string> = []
|
|
1790
2228
|
* const deploy = Command.make("deploy", {
|
|
1791
2229
|
* env: Flag.string("env")
|
|
1792
2230
|
* }, (config) =>
|
|
1793
2231
|
* Effect.gen(function*() {
|
|
1794
2232
|
* const fs = yield* FileSystem.FileSystem
|
|
1795
|
-
*
|
|
2233
|
+
* yield* Effect.sync(() => output.push(`Using file system for ${config.env}`))
|
|
1796
2234
|
* })).pipe(
|
|
1797
2235
|
* // Provide FileSystem based on the --env flag
|
|
1798
2236
|
* Command.provide((config) =>
|
|
@@ -1809,6 +2247,11 @@ const mapHandler = <Name extends string, Input, E, R, ContextInput, E2, R2>(
|
|
|
1809
2247
|
* })
|
|
1810
2248
|
* )
|
|
1811
2249
|
* )
|
|
2250
|
+
*
|
|
2251
|
+
* await Effect.runPromise(
|
|
2252
|
+
* Command.runWith(deploy, { version: "1.0.0" })(["--env", "local"]).pipe(Effect.provide(CliTestLayer))
|
|
2253
|
+
* )
|
|
2254
|
+
* output // => ["Using file system for local"]
|
|
1812
2255
|
* ```
|
|
1813
2256
|
*
|
|
1814
2257
|
* @category providing services
|
|
@@ -1821,16 +2264,35 @@ export const provide: {
|
|
|
1821
2264
|
*
|
|
1822
2265
|
* **Example** (Providing command services)
|
|
1823
2266
|
*
|
|
1824
|
-
* ```ts
|
|
1825
|
-
* import { Effect, FileSystem, PlatformError } from "effect"
|
|
2267
|
+
* ```ts import.meta.vitest
|
|
2268
|
+
* import { Effect, FileSystem, Layer, Path, PlatformError, Stdio, Terminal } from "effect"
|
|
1826
2269
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
2270
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2271
|
+
*
|
|
2272
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2273
|
+
* FileSystem.layerNoop({}),
|
|
2274
|
+
* Path.layer,
|
|
2275
|
+
* Stdio.layerTest({}),
|
|
2276
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2277
|
+
* columns: Effect.succeed(80),
|
|
2278
|
+
* rows: Effect.succeed(24),
|
|
2279
|
+
* readInput: Effect.die("unused"),
|
|
2280
|
+
* readLine: Effect.die("unused"),
|
|
2281
|
+
* display: () => Effect.void
|
|
2282
|
+
* })),
|
|
2283
|
+
* Layer.succeed(
|
|
2284
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2285
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2286
|
+
* )
|
|
2287
|
+
* )
|
|
1827
2288
|
*
|
|
2289
|
+
* const output: Array<string> = []
|
|
1828
2290
|
* const deploy = Command.make("deploy", {
|
|
1829
2291
|
* env: Flag.string("env")
|
|
1830
2292
|
* }, (config) =>
|
|
1831
2293
|
* Effect.gen(function*() {
|
|
1832
2294
|
* const fs = yield* FileSystem.FileSystem
|
|
1833
|
-
*
|
|
2295
|
+
* yield* Effect.sync(() => output.push(`Using file system for ${config.env}`))
|
|
1834
2296
|
* })).pipe(
|
|
1835
2297
|
* // Provide FileSystem based on the --env flag
|
|
1836
2298
|
* Command.provide((config) =>
|
|
@@ -1847,6 +2309,11 @@ export const provide: {
|
|
|
1847
2309
|
* })
|
|
1848
2310
|
* )
|
|
1849
2311
|
* )
|
|
2312
|
+
*
|
|
2313
|
+
* await Effect.runPromise(
|
|
2314
|
+
* Command.runWith(deploy, { version: "1.0.0" })(["--env", "local"]).pipe(Effect.provide(CliTestLayer))
|
|
2315
|
+
* )
|
|
2316
|
+
* output // => ["Using file system for local"]
|
|
1850
2317
|
* ```
|
|
1851
2318
|
*
|
|
1852
2319
|
* @category providing services
|
|
@@ -1866,16 +2333,35 @@ export const provide: {
|
|
|
1866
2333
|
*
|
|
1867
2334
|
* **Example** (Providing command services)
|
|
1868
2335
|
*
|
|
1869
|
-
* ```ts
|
|
1870
|
-
* import { Effect, FileSystem, PlatformError } from "effect"
|
|
2336
|
+
* ```ts import.meta.vitest
|
|
2337
|
+
* import { Effect, FileSystem, Layer, Path, PlatformError, Stdio, Terminal } from "effect"
|
|
1871
2338
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
2339
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2340
|
+
*
|
|
2341
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2342
|
+
* FileSystem.layerNoop({}),
|
|
2343
|
+
* Path.layer,
|
|
2344
|
+
* Stdio.layerTest({}),
|
|
2345
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2346
|
+
* columns: Effect.succeed(80),
|
|
2347
|
+
* rows: Effect.succeed(24),
|
|
2348
|
+
* readInput: Effect.die("unused"),
|
|
2349
|
+
* readLine: Effect.die("unused"),
|
|
2350
|
+
* display: () => Effect.void
|
|
2351
|
+
* })),
|
|
2352
|
+
* Layer.succeed(
|
|
2353
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2354
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2355
|
+
* )
|
|
2356
|
+
* )
|
|
1872
2357
|
*
|
|
2358
|
+
* const output: Array<string> = []
|
|
1873
2359
|
* const deploy = Command.make("deploy", {
|
|
1874
2360
|
* env: Flag.string("env")
|
|
1875
2361
|
* }, (config) =>
|
|
1876
2362
|
* Effect.gen(function*() {
|
|
1877
2363
|
* const fs = yield* FileSystem.FileSystem
|
|
1878
|
-
*
|
|
2364
|
+
* yield* Effect.sync(() => output.push(`Using file system for ${config.env}`))
|
|
1879
2365
|
* })).pipe(
|
|
1880
2366
|
* // Provide FileSystem based on the --env flag
|
|
1881
2367
|
* Command.provide((config) =>
|
|
@@ -1892,6 +2378,11 @@ export const provide: {
|
|
|
1892
2378
|
* })
|
|
1893
2379
|
* )
|
|
1894
2380
|
* )
|
|
2381
|
+
*
|
|
2382
|
+
* await Effect.runPromise(
|
|
2383
|
+
* Command.runWith(deploy, { version: "1.0.0" })(["--env", "local"]).pipe(Effect.provide(CliTestLayer))
|
|
2384
|
+
* )
|
|
2385
|
+
* output // => ["Using file system for local"]
|
|
1895
2386
|
* ```
|
|
1896
2387
|
*
|
|
1897
2388
|
* @category providing services
|
|
@@ -2093,19 +2584,42 @@ export const provideEffectDiscard: {
|
|
|
2093
2584
|
*
|
|
2094
2585
|
* **Example** (Constructing command arguments)
|
|
2095
2586
|
*
|
|
2096
|
-
* ```ts
|
|
2097
|
-
* import { Console, Effect } from "effect"
|
|
2587
|
+
* ```ts import.meta.vitest
|
|
2588
|
+
* import { Console, Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
2098
2589
|
* import { Command } from "effect/unstable/cli"
|
|
2590
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2591
|
+
*
|
|
2592
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2593
|
+
* FileSystem.layerNoop({}),
|
|
2594
|
+
* Path.layer,
|
|
2595
|
+
* Stdio.layerTest({}),
|
|
2596
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2597
|
+
* columns: Effect.succeed(80),
|
|
2598
|
+
* rows: Effect.succeed(24),
|
|
2599
|
+
* readInput: Effect.die("unused"),
|
|
2600
|
+
* readLine: Effect.die("unused"),
|
|
2601
|
+
* display: () => Effect.void
|
|
2602
|
+
* })),
|
|
2603
|
+
* Layer.succeed(
|
|
2604
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2605
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2606
|
+
* )
|
|
2607
|
+
* )
|
|
2099
2608
|
*
|
|
2100
2609
|
* const command = Command.make("app")
|
|
2101
|
-
*
|
|
2102
|
-
*
|
|
2103
|
-
* const args = yield* Command.wizard(command)
|
|
2104
|
-
* yield* Console.log(args.join(" "))
|
|
2610
|
+
* const silentConsole: Console.Console = Object.assign(Object.create(console), {
|
|
2611
|
+
* log: () => {}
|
|
2105
2612
|
* })
|
|
2613
|
+
*
|
|
2614
|
+
* const program = Command.wizard(command).pipe(
|
|
2615
|
+
* Effect.provideService(Console.Console, silentConsole),
|
|
2616
|
+
* Effect.provide(CliTestLayer)
|
|
2617
|
+
* )
|
|
2618
|
+
*
|
|
2619
|
+
* await Effect.runPromise(program) // => ["app"]
|
|
2106
2620
|
* ```
|
|
2107
2621
|
*
|
|
2108
|
-
* @category
|
|
2622
|
+
* @category running
|
|
2109
2623
|
* @since 4.0.0
|
|
2110
2624
|
*/
|
|
2111
2625
|
export const wizard = <Name extends string, Input, E, R, ContextInput>(
|
|
@@ -2156,18 +2670,26 @@ const getOutOfScopeGlobalFlagErrors = (
|
|
|
2156
2670
|
|
|
2157
2671
|
const showHelp = <Name extends string, Input, E, R, ContextInput>(
|
|
2158
2672
|
command: Command<Name, Input, ContextInput, E, R>,
|
|
2159
|
-
error: CliError.ShowHelp
|
|
2673
|
+
error: CliError.ShowHelp,
|
|
2674
|
+
renderErrors: boolean
|
|
2160
2675
|
): Effect.Effect<void, CliError.CliError, Environment> =>
|
|
2161
2676
|
Effect.gen(function*() {
|
|
2162
2677
|
const { builtIns } = yield* CliConfig.CliConfig
|
|
2163
2678
|
const formatter = yield* CliOutput.Formatter
|
|
2164
2679
|
const helpDoc = yield* getHelpForCommandPath(command, error.commandPath, builtIns)
|
|
2165
2680
|
yield* Console.log(formatter.formatHelpDoc(helpDoc))
|
|
2166
|
-
if (error.errors.length > 0) {
|
|
2681
|
+
if (renderErrors && error.errors.length > 0) {
|
|
2167
2682
|
yield* Console.error(formatter.formatErrors(error.errors as any))
|
|
2168
2683
|
}
|
|
2169
2684
|
})
|
|
2170
2685
|
|
|
2686
|
+
const showUserError = (error: CliError.UserError): Effect.Effect<void> =>
|
|
2687
|
+
Effect.gen(function*() {
|
|
2688
|
+
const formatter = yield* CliOutput.Formatter
|
|
2689
|
+
yield* Console.error(formatter.formatError(error))
|
|
2690
|
+
error[Runtime.errorReported] = false
|
|
2691
|
+
})
|
|
2692
|
+
|
|
2171
2693
|
/**
|
|
2172
2694
|
* Runs a command using the arguments supplied by the `Stdio` service.
|
|
2173
2695
|
*
|
|
@@ -2176,28 +2698,57 @@ const showHelp = <Name extends string, Input, E, R, ContextInput>(
|
|
|
2176
2698
|
* Use when command-line arguments should come from `Stdio` at the application
|
|
2177
2699
|
* entry point.
|
|
2178
2700
|
*
|
|
2701
|
+
* Help documents are always rendered. By default, parse error details and
|
|
2702
|
+
* `CliError.UserError` failures are also rendered with the installed
|
|
2703
|
+
* `CliOutput.Formatter` before the error is rethrown. Set `renderErrors` to
|
|
2704
|
+
* `false` when the host application owns error rendering.
|
|
2705
|
+
*
|
|
2179
2706
|
* **Example** (Running commands with standard input)
|
|
2180
2707
|
*
|
|
2181
|
-
* ```ts
|
|
2182
|
-
* import {
|
|
2708
|
+
* ```ts import.meta.vitest
|
|
2709
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
2183
2710
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
2711
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2712
|
+
*
|
|
2713
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2714
|
+
* FileSystem.layerNoop({}),
|
|
2715
|
+
* Path.layer,
|
|
2716
|
+
* Stdio.layerTest({
|
|
2717
|
+
* args: Effect.succeed(["--name", "Alice"])
|
|
2718
|
+
* }),
|
|
2719
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2720
|
+
* columns: Effect.succeed(80),
|
|
2721
|
+
* rows: Effect.succeed(24),
|
|
2722
|
+
* readInput: Effect.die("unused"),
|
|
2723
|
+
* readLine: Effect.die("unused"),
|
|
2724
|
+
* display: () => Effect.void
|
|
2725
|
+
* })),
|
|
2726
|
+
* Layer.succeed(
|
|
2727
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2728
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2729
|
+
* )
|
|
2730
|
+
* )
|
|
2184
2731
|
*
|
|
2732
|
+
* const output: Array<string> = []
|
|
2185
2733
|
* const greetCommand = Command.make("greet", {
|
|
2186
2734
|
* name: Flag.string("name")
|
|
2187
2735
|
* }, (config) =>
|
|
2188
2736
|
* Effect.gen(function*() {
|
|
2189
|
-
* yield*
|
|
2737
|
+
* yield* Effect.sync(() => output.push(`Hello, ${config.name}!`))
|
|
2190
2738
|
* }))
|
|
2191
2739
|
*
|
|
2192
2740
|
* // Automatically gets args from the Stdio service
|
|
2193
2741
|
* const program = Command.run(greetCommand, {
|
|
2194
2742
|
* version: "1.0.0"
|
|
2195
2743
|
* })
|
|
2744
|
+
*
|
|
2745
|
+
* await Effect.runPromise(program.pipe(Effect.provide(CliTestLayer)))
|
|
2746
|
+
* output // => ["Hello, Alice!"]
|
|
2196
2747
|
* ```
|
|
2197
2748
|
*
|
|
2198
2749
|
* @see {@link runWith} for running a command with an explicit argument array
|
|
2199
2750
|
*
|
|
2200
|
-
* @category
|
|
2751
|
+
* @category running
|
|
2201
2752
|
* @since 4.0.0
|
|
2202
2753
|
*/
|
|
2203
2754
|
export const run: {
|
|
@@ -2209,33 +2760,63 @@ export const run: {
|
|
|
2209
2760
|
* Use when command-line arguments should come from `Stdio` at the application
|
|
2210
2761
|
* entry point.
|
|
2211
2762
|
*
|
|
2763
|
+
* Help documents are always rendered. By default, parse error details and
|
|
2764
|
+
* `CliError.UserError` failures are also rendered with the installed
|
|
2765
|
+
* `CliOutput.Formatter` before the error is rethrown. Set `renderErrors` to
|
|
2766
|
+
* `false` when the host application owns error rendering.
|
|
2767
|
+
*
|
|
2212
2768
|
* **Example** (Running commands with standard input)
|
|
2213
2769
|
*
|
|
2214
|
-
* ```ts
|
|
2215
|
-
* import {
|
|
2770
|
+
* ```ts import.meta.vitest
|
|
2771
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
2216
2772
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
2773
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2774
|
+
*
|
|
2775
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2776
|
+
* FileSystem.layerNoop({}),
|
|
2777
|
+
* Path.layer,
|
|
2778
|
+
* Stdio.layerTest({
|
|
2779
|
+
* args: Effect.succeed(["--name", "Alice"])
|
|
2780
|
+
* }),
|
|
2781
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2782
|
+
* columns: Effect.succeed(80),
|
|
2783
|
+
* rows: Effect.succeed(24),
|
|
2784
|
+
* readInput: Effect.die("unused"),
|
|
2785
|
+
* readLine: Effect.die("unused"),
|
|
2786
|
+
* display: () => Effect.void
|
|
2787
|
+
* })),
|
|
2788
|
+
* Layer.succeed(
|
|
2789
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2790
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2791
|
+
* )
|
|
2792
|
+
* )
|
|
2217
2793
|
*
|
|
2794
|
+
* const output: Array<string> = []
|
|
2218
2795
|
* const greetCommand = Command.make("greet", {
|
|
2219
2796
|
* name: Flag.string("name")
|
|
2220
2797
|
* }, (config) =>
|
|
2221
2798
|
* Effect.gen(function*() {
|
|
2222
|
-
* yield*
|
|
2799
|
+
* yield* Effect.sync(() => output.push(`Hello, ${config.name}!`))
|
|
2223
2800
|
* }))
|
|
2224
2801
|
*
|
|
2225
2802
|
* // Automatically gets args from the Stdio service
|
|
2226
2803
|
* const program = Command.run(greetCommand, {
|
|
2227
2804
|
* version: "1.0.0"
|
|
2228
2805
|
* })
|
|
2806
|
+
*
|
|
2807
|
+
* await Effect.runPromise(program.pipe(Effect.provide(CliTestLayer)))
|
|
2808
|
+
* output // => ["Hello, Alice!"]
|
|
2229
2809
|
* ```
|
|
2230
2810
|
*
|
|
2231
2811
|
* @see {@link runWith} for running a command with an explicit argument array
|
|
2232
2812
|
*
|
|
2233
|
-
* @category
|
|
2813
|
+
* @category running
|
|
2234
2814
|
* @since 4.0.0
|
|
2235
2815
|
*/
|
|
2236
2816
|
(
|
|
2237
2817
|
config: {
|
|
2238
2818
|
readonly version: string
|
|
2819
|
+
readonly renderErrors?: boolean | undefined
|
|
2239
2820
|
}
|
|
2240
2821
|
): <Name extends string, Input, E, R, ContextInput>(
|
|
2241
2822
|
command: Command<Name, Input, ContextInput, E, R>
|
|
@@ -2248,40 +2829,71 @@ export const run: {
|
|
|
2248
2829
|
* Use when command-line arguments should come from `Stdio` at the application
|
|
2249
2830
|
* entry point.
|
|
2250
2831
|
*
|
|
2832
|
+
* Help documents are always rendered. By default, parse error details and
|
|
2833
|
+
* `CliError.UserError` failures are also rendered with the installed
|
|
2834
|
+
* `CliOutput.Formatter` before the error is rethrown. Set `renderErrors` to
|
|
2835
|
+
* `false` when the host application owns error rendering.
|
|
2836
|
+
*
|
|
2251
2837
|
* **Example** (Running commands with standard input)
|
|
2252
2838
|
*
|
|
2253
|
-
* ```ts
|
|
2254
|
-
* import {
|
|
2839
|
+
* ```ts import.meta.vitest
|
|
2840
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
2255
2841
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
2842
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2843
|
+
*
|
|
2844
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2845
|
+
* FileSystem.layerNoop({}),
|
|
2846
|
+
* Path.layer,
|
|
2847
|
+
* Stdio.layerTest({
|
|
2848
|
+
* args: Effect.succeed(["--name", "Alice"])
|
|
2849
|
+
* }),
|
|
2850
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2851
|
+
* columns: Effect.succeed(80),
|
|
2852
|
+
* rows: Effect.succeed(24),
|
|
2853
|
+
* readInput: Effect.die("unused"),
|
|
2854
|
+
* readLine: Effect.die("unused"),
|
|
2855
|
+
* display: () => Effect.void
|
|
2856
|
+
* })),
|
|
2857
|
+
* Layer.succeed(
|
|
2858
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2859
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2860
|
+
* )
|
|
2861
|
+
* )
|
|
2256
2862
|
*
|
|
2863
|
+
* const output: Array<string> = []
|
|
2257
2864
|
* const greetCommand = Command.make("greet", {
|
|
2258
2865
|
* name: Flag.string("name")
|
|
2259
2866
|
* }, (config) =>
|
|
2260
2867
|
* Effect.gen(function*() {
|
|
2261
|
-
* yield*
|
|
2868
|
+
* yield* Effect.sync(() => output.push(`Hello, ${config.name}!`))
|
|
2262
2869
|
* }))
|
|
2263
2870
|
*
|
|
2264
2871
|
* // Automatically gets args from the Stdio service
|
|
2265
2872
|
* const program = Command.run(greetCommand, {
|
|
2266
2873
|
* version: "1.0.0"
|
|
2267
2874
|
* })
|
|
2875
|
+
*
|
|
2876
|
+
* await Effect.runPromise(program.pipe(Effect.provide(CliTestLayer)))
|
|
2877
|
+
* output // => ["Hello, Alice!"]
|
|
2268
2878
|
* ```
|
|
2269
2879
|
*
|
|
2270
2880
|
* @see {@link runWith} for running a command with an explicit argument array
|
|
2271
2881
|
*
|
|
2272
|
-
* @category
|
|
2882
|
+
* @category running
|
|
2273
2883
|
* @since 4.0.0
|
|
2274
2884
|
*/
|
|
2275
2885
|
<Name extends string, Input, E, R, ContextInput>(
|
|
2276
2886
|
command: Command<Name, Input, ContextInput, E, R>,
|
|
2277
2887
|
config: {
|
|
2278
2888
|
readonly version: string
|
|
2889
|
+
readonly renderErrors?: boolean | undefined
|
|
2279
2890
|
}
|
|
2280
2891
|
): Effect.Effect<void, E | CliError.CliError, R | Environment>
|
|
2281
2892
|
} = dual(2, <Name extends string, Input, E, R, ContextInput>(
|
|
2282
2893
|
command: Command<Name, Input, ContextInput, E, R>,
|
|
2283
2894
|
config: {
|
|
2284
2895
|
readonly version: string
|
|
2896
|
+
readonly renderErrors?: boolean | undefined
|
|
2285
2897
|
}
|
|
2286
2898
|
) =>
|
|
2287
2899
|
Stdio.Stdio.use(({ args }) =>
|
|
@@ -2299,19 +2911,43 @@ export const run: {
|
|
|
2299
2911
|
* Use when you need to test CLI applications or programmatically execute
|
|
2300
2912
|
* commands with specific arguments.
|
|
2301
2913
|
*
|
|
2914
|
+
* Help documents are always rendered. By default, parse error details and
|
|
2915
|
+
* `CliError.UserError` failures are also rendered with the installed
|
|
2916
|
+
* `CliOutput.Formatter` before the error is rethrown. Set `renderErrors` to
|
|
2917
|
+
* `false` when the host application owns error rendering.
|
|
2918
|
+
*
|
|
2302
2919
|
* **Example** (Running commands with explicit arguments)
|
|
2303
2920
|
*
|
|
2304
|
-
* ```ts
|
|
2305
|
-
* import {
|
|
2921
|
+
* ```ts import.meta.vitest
|
|
2922
|
+
* import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
|
|
2306
2923
|
* import { Command, Flag } from "effect/unstable/cli"
|
|
2924
|
+
* import { ChildProcessSpawner } from "effect/unstable/process"
|
|
2925
|
+
*
|
|
2926
|
+
* const CliTestLayer = Layer.mergeAll(
|
|
2927
|
+
* FileSystem.layerNoop({}),
|
|
2928
|
+
* Path.layer,
|
|
2929
|
+
* Stdio.layerTest({}),
|
|
2930
|
+
* Layer.succeed(Terminal.Terminal, Terminal.make({
|
|
2931
|
+
* columns: Effect.succeed(80),
|
|
2932
|
+
* rows: Effect.succeed(24),
|
|
2933
|
+
* readInput: Effect.die("unused"),
|
|
2934
|
+
* readLine: Effect.die("unused"),
|
|
2935
|
+
* display: () => Effect.void
|
|
2936
|
+
* })),
|
|
2937
|
+
* Layer.succeed(
|
|
2938
|
+
* ChildProcessSpawner.ChildProcessSpawner,
|
|
2939
|
+
* ChildProcessSpawner.make(() => Effect.die("unused"))
|
|
2940
|
+
* )
|
|
2941
|
+
* )
|
|
2307
2942
|
*
|
|
2943
|
+
* const output: Array<string> = []
|
|
2308
2944
|
* const greet = Command.make("greet", {
|
|
2309
2945
|
* name: Flag.string("name"),
|
|
2310
2946
|
* count: Flag.integer("count").pipe(Flag.withDefault(1))
|
|
2311
2947
|
* }, (config) =>
|
|
2312
2948
|
* Effect.gen(function*() {
|
|
2313
2949
|
* for (let i = 0; i < config.count; i++) {
|
|
2314
|
-
* yield*
|
|
2950
|
+
* yield* Effect.sync(() => output.push(`Hello, ${config.name}!`))
|
|
2315
2951
|
* }
|
|
2316
2952
|
* }))
|
|
2317
2953
|
*
|
|
@@ -2319,24 +2955,21 @@ export const run: {
|
|
|
2319
2955
|
* const testProgram = Effect.gen(function*() {
|
|
2320
2956
|
* const runCommand = Command.runWith(greet, { version: "1.0.0" })
|
|
2321
2957
|
*
|
|
2322
|
-
* // Test normal execution
|
|
2323
2958
|
* yield* runCommand(["--name", "Alice", "--count", "2"])
|
|
2324
|
-
*
|
|
2325
|
-
* // Test help display
|
|
2326
|
-
* yield* runCommand(["--help"])
|
|
2327
|
-
*
|
|
2328
|
-
* // Test version display
|
|
2329
|
-
* yield* runCommand(["--version"])
|
|
2330
2959
|
* })
|
|
2960
|
+
*
|
|
2961
|
+
* await Effect.runPromise(testProgram.pipe(Effect.provide(CliTestLayer)))
|
|
2962
|
+
* output // => ["Hello, Alice!", "Hello, Alice!"]
|
|
2331
2963
|
* ```
|
|
2332
2964
|
*
|
|
2333
|
-
* @category
|
|
2965
|
+
* @category running
|
|
2334
2966
|
* @since 4.0.0
|
|
2335
2967
|
*/
|
|
2336
2968
|
export const runWith = <const Name extends string, Input, E, R, ContextInput>(
|
|
2337
2969
|
command: Command<Name, Input, ContextInput, E, R>,
|
|
2338
2970
|
config: {
|
|
2339
2971
|
readonly version: string
|
|
2972
|
+
readonly renderErrors?: boolean | undefined
|
|
2340
2973
|
}
|
|
2341
2974
|
): (
|
|
2342
2975
|
input: ReadonlyArray<string>
|
|
@@ -2403,7 +3036,7 @@ export const runWith = <const Name extends string, Input, E, R, ContextInput>(
|
|
|
2403
3036
|
}))
|
|
2404
3037
|
if (shouldRun) {
|
|
2405
3038
|
yield* Console.log()
|
|
2406
|
-
yield* runWith(command, config)(wizardArgs.slice(1))
|
|
3039
|
+
yield* runWith(command, { ...config, renderErrors: false })(wizardArgs.slice(1))
|
|
2407
3040
|
}
|
|
2408
3041
|
}).pipe(
|
|
2409
3042
|
Effect.catchTag("QuitError", () => Console.log(Wizard.renderQuit()))
|
|
@@ -2451,7 +3084,14 @@ export const runWith = <const Name extends string, Input, E, R, ContextInput>(
|
|
|
2451
3084
|
CliError.isCliError(error) && error._tag === "ShowHelp"
|
|
2452
3085
|
? Result.succeed(error)
|
|
2453
3086
|
: Result.fail(error),
|
|
2454
|
-
(error) => Effect.andThen(showHelp(command, error), Effect.fail(error))
|
|
3087
|
+
(error) => Effect.andThen(showHelp(command, error, config.renderErrors !== false), Effect.fail(error))
|
|
3088
|
+
),
|
|
3089
|
+
Effect.catchFilter(
|
|
3090
|
+
(error) =>
|
|
3091
|
+
config.renderErrors !== false && CliError.isCliError(error) && error._tag === "UserError"
|
|
3092
|
+
? Result.succeed(error)
|
|
3093
|
+
: Result.fail(error),
|
|
3094
|
+
(error) => Effect.andThen(showUserError(error), Effect.fail(error))
|
|
2455
3095
|
),
|
|
2456
3096
|
Effect.catchFilter(
|
|
2457
3097
|
(e) =>
|