effect 4.0.0-beta.102 → 4.0.0-beta.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +971 -1037
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +381 -407
- 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.js.map +1 -1
- package/dist/Cache.d.ts +405 -254
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +166 -101
- 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 +729 -768
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +514 -440
- 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 +225 -173
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +336 -265
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +194 -68
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +115 -80
- 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 +151 -274
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +171 -214
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +68 -77
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +57 -66
- 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 +9 -10
- 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 +16 -23
- 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 +104 -96
- 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 +132 -186
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2841 -3247
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +1322 -1546
- 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 +29 -21
- 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 +51 -27
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +50 -26
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +13 -55
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -28
- 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 +82 -146
- 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 +106 -73
- 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 +85 -59
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +153 -264
- 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 +25 -33
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +48 -49
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +76 -145
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +40 -57
- 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 +12 -12
- package/dist/Inspectable.js +8 -8
- 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 +228 -306
- 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 +44 -102
- 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 +297 -234
- 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 +359 -260
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +195 -175
- 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 +218 -467
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +204 -450
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +7 -5
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +7 -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 +198 -642
- 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 +59 -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 +97 -189
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +187 -290
- 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 +211 -392
- 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.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 +162 -132
- 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 +291 -488
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +111 -202
- 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 -168
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +102 -168
- 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 +16 -13
- 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 +133 -217
- 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 +290 -1636
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +162 -803
- 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 +644 -642
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +491 -527
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +27 -50
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +366 -279
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.d.ts +7 -6
- package/dist/SchemaError.d.ts.map +1 -1
- package/dist/SchemaError.js +7 -6
- package/dist/SchemaError.js.map +1 -1
- package/dist/SchemaGetter.d.ts +217 -174
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +218 -185
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +62 -190
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +73 -265
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +2 -2
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +123 -75
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +22 -36
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +20 -26
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +114 -74
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +120 -85
- 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.map +1 -1
- package/dist/ScopedRef.d.ts +3 -3
- package/dist/ScopedRef.js +2 -2
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +96 -10
- 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 +117 -107
- 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 +1 -1
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +2415 -2949
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1078 -1381
- 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 +41 -50
- 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.map +1 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +2 -2
- package/dist/Terminal.js +1 -1
- 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 +92 -127
- 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 +160 -136
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +97 -66
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +67 -45
- 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 +126 -67
- 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.js.map +1 -1
- package/dist/internal/array.js.map +1 -1
- package/dist/internal/core.js +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +4 -0
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/doNotation.js.map +1 -1
- package/dist/internal/effect.js +77 -40
- 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.map +1 -1
- 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.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.map +1 -1
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/redacted.js.map +1 -1
- package/dist/internal/references.js +3 -0
- 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.map +1 -1
- package/dist/internal/schema/cause.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +13 -11
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/fromRepresentation.js +8 -15
- package/dist/internal/schema/fromRepresentation.js.map +1 -1
- 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.map +1 -1
- package/dist/internal/schema/toArbitrary.js.map +1 -1
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/schema/toJsonSchemaDocument.js +48 -6
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/toRepresentation.js +87 -107
- package/dist/internal/schema/toRepresentation.js.map +1 -1
- 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 +13 -9
- package/dist/internal/trie.js.map +1 -1
- 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 +57 -28
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +50 -18
- 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 +29 -29
- package/dist/testing/TestSchema.js +25 -25
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +95 -118
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +94 -117
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +1 -1
- 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 +55 -51
- package/dist/unstable/ai/Chat.js.map +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 +107 -67
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +104 -64
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpProtocol.d.ts +30 -0
- package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/McpProtocol.js +20 -0
- package/dist/unstable/ai/McpProtocol.js.map +1 -0
- package/dist/unstable/ai/McpSchema.d.ts +141 -75
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +58 -50
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +68 -59
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +694 -241
- 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 +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +112 -38
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +53 -17
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +28 -14
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +9 -4
- 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 +59 -44
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +48 -39
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +26 -8
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +18 -4
- 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.map +1 -1
- package/dist/unstable/ai/internal/mcpProtocol.d.ts +21 -0
- package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol.js +22 -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 +32 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
- package/dist/unstable/ai/internal/structured-output.js +14 -15
- package/dist/unstable/ai/internal/structured-output.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +273 -69
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +111 -33
- 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 +69 -76
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +57 -61
- 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 +705 -107
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +238 -42
- 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 +292 -78
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +128 -46
- 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 +344 -136
- 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 +23 -14
- 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.map +1 -1
- package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- 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.js.map +1 -1
- 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 +2 -2
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- 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 +5 -1
- 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 +10 -10
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +8 -8
- 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 +4 -2
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +4 -2
- 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 +2 -2
- package/dist/unstable/cluster/EntityResource.js +2 -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.js +3 -3
- 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.js.map +1 -1
- 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 +15 -15
- package/dist/unstable/cluster/MessageStorage.js +5 -5
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -4
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.js.map +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 +16 -16
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +2 -2
- package/dist/unstable/cluster/RunnerStorage.js +1 -1
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +6 -6
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +19 -10
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +3 -2
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +3 -3
- package/dist/unstable/cluster/ShardingConfig.js +3 -3
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -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.js +1 -1
- 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 +20 -5
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +5 -5
- 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.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/cluster/internal/shardLock.js.map +1 -1
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- 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/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +6 -8
- package/dist/unstable/encoding/Msgpack.js.map +1 -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 +58 -8
- package/dist/unstable/encoding/Sse.js.map +1 -1
- 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 +15 -15
- package/dist/unstable/eventlog/EventJournal.js +13 -13
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +3 -3
- package/dist/unstable/eventlog/EventLog.js +3 -3
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
- package/dist/unstable/eventlog/EventLogRemote.js +1 -1
- 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 +13 -5
- 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 +14 -6
- 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.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- 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 +30 -18
- 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.map +1 -1
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +2 -2
- 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 +51 -44
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +46 -17
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
- package/dist/unstable/http/HttpClientResponse.js +2 -2
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +6 -6
- package/dist/unstable/http/HttpEffect.js +3 -3
- 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 +32 -0
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +88 -89
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +78 -79
- 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.js +4 -4
- 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 +10 -0
- 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/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +6 -6
- package/dist/unstable/http/Multipart.js +5 -5
- package/dist/unstable/http/Multipart.js.map +1 -1
- 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 +9 -17
- package/dist/unstable/http/UrlParams.js.map +1 -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/preResponseHandler.js.map +1 -1
- 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 +10 -11
- 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 +11 -13
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +42 -42
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.js +13 -13
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
- 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 +6 -6
- package/dist/unstable/httpapi/HttpApiSchema.js +4 -4
- 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 +13 -13
- package/dist/unstable/httpapi/OpenApi.js +13 -13
- 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 +12 -14
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +17 -4
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- 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.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.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.js +6 -6
- 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 +91 -15
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +26 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +24 -13
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +2 -2
- package/dist/unstable/persistence/Redis.js +1 -1
- 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 +64 -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 +1 -1
- 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 +10 -10
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +25 -22
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +14 -13
- 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 +24 -3
- 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.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 +12 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +12 -11
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
- package/dist/unstable/rpc/RpcGroup.js +1 -1
- 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 +175 -96
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +13 -13
- package/dist/unstable/rpc/RpcServer.js +17 -13
- 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 +52 -50
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +35 -33
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +5 -5
- package/dist/unstable/schema/VariantSchema.js +2 -2
- 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 +11 -3
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +9 -4
- 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.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 +2 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- 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.js +2 -2
- 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.js +15 -15
- 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.js +2 -2
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +7 -7
- package/dist/unstable/workers/WorkerError.js +6 -6
- 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.js +5 -5
- 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 +1 -1
- 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 +5 -6
- package/src/Array.ts +982 -1045
- package/src/BigDecimal.ts +433 -756
- package/src/BigInt.ts +213 -269
- package/src/Boolean.ts +146 -188
- package/src/Cache.ts +409 -255
- package/src/Cause.ts +167 -277
- package/src/Channel.ts +891 -816
- 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 +615 -332
- package/src/ConfigProvider.ts +214 -120
- package/src/Console.ts +289 -39
- package/src/Context.ts +319 -378
- package/src/Cron.ts +68 -77
- package/src/Crypto.ts +13 -15
- package/src/Data.ts +60 -80
- package/src/DateTime.ts +564 -660
- package/src/Deferred.ts +253 -256
- package/src/Duration.ts +216 -308
- package/src/Effect.ts +2893 -3279
- package/src/Encoding.ts +22 -40
- package/src/Equal.ts +49 -39
- package/src/Equivalence.ts +103 -105
- package/src/ErrorReporter.ts +51 -27
- package/src/ExecutionPlan.ts +13 -55
- package/src/Exit.ts +116 -192
- package/src/Fiber.ts +81 -148
- package/src/FiberHandle.ts +152 -105
- package/src/FiberMap.ts +225 -174
- package/src/FiberSet.ts +124 -82
- package/src/FileSystem.ts +155 -263
- package/src/Filter.ts +61 -33
- package/src/Formatter.ts +54 -56
- package/src/Function.ts +76 -145
- 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 +12 -12
- package/src/Iterable.ts +620 -786
- package/src/JsonPatch.ts +58 -112
- package/src/JsonPointer.ts +8 -8
- package/src/JsonSchema.ts +402 -244
- package/src/Latch.ts +23 -35
- package/src/Layer.ts +359 -260
- package/src/LayerMap.ts +49 -29
- package/src/LayerRef.ts +6 -2
- package/src/LogLevel.ts +114 -214
- package/src/Logger.ts +344 -697
- package/src/ManagedRuntime.ts +7 -5
- package/src/Match.ts +217 -252
- package/src/Metric.ts +516 -1089
- package/src/MutableHashMap.ts +218 -255
- package/src/MutableHashSet.ts +84 -89
- package/src/MutableList.ts +73 -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 +243 -383
- package/src/Option.ts +447 -812
- package/src/Order.ts +109 -109
- package/src/Ordering.ts +20 -23
- 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 +200 -159
- package/src/Random.ts +49 -74
- package/src/RcMap.ts +121 -63
- package/src/RcRef.ts +24 -13
- package/src/Record.ts +291 -488
- 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 -168
- package/src/RegExp.ts +10 -14
- package/src/Request.ts +31 -21
- package/src/RequestResolver.ts +202 -91
- package/src/Result.ts +312 -484
- package/src/Runtime.ts +50 -75
- package/src/Schedule.ts +308 -1734
- package/src/Scheduler.ts +20 -7
- package/src/Schema.ts +716 -745
- package/src/SchemaAST.ts +466 -358
- package/src/SchemaError.ts +7 -6
- package/src/SchemaGetter.ts +242 -190
- package/src/SchemaIssue.ts +89 -275
- package/src/SchemaParser.ts +180 -93
- package/src/SchemaRepresentation.ts +22 -40
- package/src/SchemaTransformation.ts +129 -88
- package/src/Scope.ts +123 -151
- package/src/ScopedRef.ts +4 -4
- package/src/Semaphore.ts +152 -51
- package/src/Sink.ts +128 -113
- package/src/Stdio.ts +1 -1
- package/src/Stream.ts +2602 -3123
- package/src/String.ts +275 -312
- package/src/Struct.ts +109 -114
- package/src/SubscriptionRef.ts +284 -252
- package/src/Symbol.ts +3 -3
- package/src/Terminal.ts +2 -2
- package/src/Tracer.ts +102 -55
- package/src/Trie.ts +287 -679
- package/src/Tuple.ts +92 -127
- 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 +214 -183
- package/src/TxReentrantLock.ts +97 -66
- package/src/TxRef.ts +51 -32
- package/src/TxSemaphore.ts +129 -95
- package/src/TxSubscriptionRef.ts +97 -70
- package/src/Types.ts +126 -67
- package/src/Unify.ts +45 -65
- package/src/Utils.ts +23 -16
- package/src/internal/core.ts +2 -2
- package/src/internal/dateTime.ts +6 -0
- package/src/internal/effect.ts +93 -48
- package/src/internal/persistence.ts +2 -0
- package/src/internal/references.ts +3 -2
- package/src/internal/schema/fromJsonSchemaDocument.ts +15 -13
- package/src/internal/schema/fromRepresentation.ts +10 -16
- package/src/internal/schema/parser.ts +22 -0
- package/src/internal/schema/toJsonSchemaDocument.ts +60 -6
- package/src/internal/schema/toRepresentation.ts +104 -119
- package/src/internal/trie.ts +10 -11
- package/src/testing/FastCheck.ts +8 -7
- package/src/testing/TestClock.ts +72 -30
- package/src/testing/TestConsole.ts +32 -31
- package/src/testing/TestSchema.ts +29 -29
- package/src/unstable/ai/AiError.ts +95 -118
- package/src/unstable/ai/AnthropicStructuredOutput.ts +1 -1
- package/src/unstable/ai/Chat.ts +132 -97
- package/src/unstable/ai/IdGenerator.ts +32 -28
- package/src/unstable/ai/LanguageModel.ts +107 -67
- package/src/unstable/ai/McpProtocol.ts +48 -0
- package/src/unstable/ai/McpSchema.ts +60 -50
- package/src/unstable/ai/McpServer.ts +930 -304
- package/src/unstable/ai/Model.ts +9 -20
- package/src/unstable/ai/OpenAiStructuredOutput.ts +1 -1
- package/src/unstable/ai/Prompt.ts +145 -43
- package/src/unstable/ai/Response.ts +28 -14
- package/src/unstable/ai/Telemetry.ts +46 -13
- package/src/unstable/ai/Tokenizer.ts +14 -3
- package/src/unstable/ai/Tool.ts +59 -44
- package/src/unstable/ai/Toolkit.ts +26 -8
- package/src/unstable/ai/index.ts +5 -0
- package/src/unstable/ai/internal/mcpProtocol.ts +85 -0
- package/src/unstable/ai/internal/mcpProtocolRegistry.ts +70 -0
- package/src/unstable/ai/internal/structured-output.ts +13 -18
- package/src/unstable/cli/Argument.ts +273 -69
- package/src/unstable/cli/CliError.ts +69 -76
- package/src/unstable/cli/CliOutput.ts +44 -58
- package/src/unstable/cli/Command.ts +705 -107
- 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 +292 -78
- package/src/unstable/cli/Primitive.ts +370 -149
- package/src/unstable/cli/Prompt.ts +28 -14
- package/src/unstable/cli/internal/lexer.ts +8 -2
- package/src/unstable/cli/internal/parser.ts +2 -2
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -1
- package/src/unstable/cluster/Entity.ts +15 -16
- package/src/unstable/cluster/EntityProxy.ts +4 -2
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/Envelope.ts +3 -3
- package/src/unstable/cluster/HttpRunner.ts +6 -4
- package/src/unstable/cluster/Message.ts +9 -9
- package/src/unstable/cluster/MessageStorage.ts +15 -15
- package/src/unstable/cluster/Reply.ts +4 -6
- package/src/unstable/cluster/RunnerHealth.ts +1 -1
- package/src/unstable/cluster/RunnerServer.ts +41 -8
- package/src/unstable/cluster/RunnerStorage.ts +2 -2
- package/src/unstable/cluster/Runners.ts +23 -12
- package/src/unstable/cluster/Sharding.ts +7 -8
- package/src/unstable/cluster/ShardingConfig.ts +3 -3
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +8 -8
- package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
- package/src/unstable/cluster/SqlRunnerStorage.ts +21 -5
- package/src/unstable/cluster/internal/entityManager.ts +11 -15
- package/src/unstable/encoding/Msgpack.ts +6 -8
- package/src/unstable/encoding/Sse.ts +98 -16
- package/src/unstable/eventlog/Event.ts +20 -20
- package/src/unstable/eventlog/EventGroup.ts +4 -4
- package/src/unstable/eventlog/EventJournal.ts +15 -15
- package/src/unstable/eventlog/EventLog.ts +3 -3
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogMessage.ts +2 -2
- package/src/unstable/eventlog/EventLogRemote.ts +1 -1
- package/src/unstable/eventlog/EventLogServer.ts +41 -7
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +13 -5
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +14 -6
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/http/Cookies.ts +35 -21
- package/src/unstable/http/Etag.ts +1 -1
- package/src/unstable/http/FetchHttpClient.ts +3 -1
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpBody.ts +20 -5
- package/src/unstable/http/HttpClient.ts +83 -55
- package/src/unstable/http/HttpClientRequest.ts +2 -0
- package/src/unstable/http/HttpClientResponse.ts +4 -4
- package/src/unstable/http/HttpEffect.ts +8 -8
- package/src/unstable/http/HttpMethod.ts +6 -9
- package/src/unstable/http/HttpMiddleware.ts +202 -39
- package/src/unstable/http/HttpPlatform.ts +95 -0
- package/src/unstable/http/HttpRouter.ts +102 -98
- package/src/unstable/http/HttpServer.ts +13 -13
- package/src/unstable/http/HttpServerError.ts +2 -2
- package/src/unstable/http/HttpServerRequest.ts +4 -4
- package/src/unstable/http/HttpServerResponse.ts +30 -0
- package/src/unstable/http/HttpStaticServer.ts +35 -7
- package/src/unstable/http/Multipart.ts +6 -6
- package/src/unstable/http/Url.ts +33 -63
- package/src/unstable/http/UrlParams.ts +10 -18
- package/src/unstable/http/internal/compression.ts +196 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +10 -9
- package/src/unstable/httpapi/HttpApiClient.ts +14 -14
- package/src/unstable/httpapi/HttpApiEndpoint.ts +42 -42
- package/src/unstable/httpapi/HttpApiError.ts +13 -13
- package/src/unstable/httpapi/HttpApiGroup.ts +15 -15
- package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
- package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
- package/src/unstable/httpapi/HttpApiSchema.ts +6 -6
- package/src/unstable/httpapi/OpenApi.ts +13 -13
- package/src/unstable/observability/OtlpExporter.ts +31 -19
- package/src/unstable/observability/OtlpMetrics.ts +4 -1
- package/src/unstable/observability/OtlpResource.ts +26 -17
- 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 +8 -8
- package/src/unstable/persistence/PersistedQueue.ts +6 -6
- package/src/unstable/persistence/Persistence.ts +126 -19
- package/src/unstable/persistence/RateLimiter.ts +26 -15
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcess.ts +64 -21
- package/src/unstable/process/ChildProcessSpawner.ts +21 -10
- package/src/unstable/reactivity/AsyncResult.ts +12 -13
- package/src/unstable/reactivity/Atom.ts +28 -25
- package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
- package/src/unstable/reactivity/AtomRegistry.ts +24 -3
- package/src/unstable/reactivity/AtomRpc.ts +5 -4
- package/src/unstable/reactivity/Hydration.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +35 -33
- package/src/unstable/rpc/RpcClient.ts +16 -15
- package/src/unstable/rpc/RpcGroup.ts +8 -8
- 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 +167 -68
- package/src/unstable/rpc/RpcServer.ts +18 -15
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/schema/Model.ts +52 -50
- package/src/unstable/schema/VariantSchema.ts +5 -5
- package/src/unstable/socket/Socket.ts +17 -4
- package/src/unstable/sql/SqlClient.ts +5 -6
- package/src/unstable/sql/SqlModel.ts +2 -2
- package/src/unstable/sql/SqlResolver.ts +5 -5
- package/src/unstable/sql/Statement.ts +24 -23
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +2 -2
- package/src/unstable/workers/WorkerError.ts +7 -7
- 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 +10 -10
- package/src/unstable/workflow/DurableQueue.ts +22 -20
- package/src/unstable/workflow/Workflow.ts +23 -23
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
- package/src/unstable/workflow/WorkflowProxy.ts +4 -2
- 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/src/internal/version.ts +0 -2
package/dist/Graph.js
CHANGED
|
@@ -184,7 +184,7 @@ export const isGraph = u => hasProperty(u, TypeId);
|
|
|
184
184
|
*
|
|
185
185
|
* **Example** (Constructing by kind)
|
|
186
186
|
*
|
|
187
|
-
* ```ts
|
|
187
|
+
* ```ts import.meta.vitest
|
|
188
188
|
* import { Graph } from "effect"
|
|
189
189
|
*
|
|
190
190
|
* const makeGraph = Graph.make("directed")
|
|
@@ -192,7 +192,7 @@ export const isGraph = u => hasProperty(u, TypeId);
|
|
|
192
192
|
* Graph.addNode(mutable, "A")
|
|
193
193
|
* })
|
|
194
194
|
*
|
|
195
|
-
*
|
|
195
|
+
* graph.type // => "directed"
|
|
196
196
|
* ```
|
|
197
197
|
*
|
|
198
198
|
* @see {@link directed} for constructing a directed graph directly
|
|
@@ -223,7 +223,7 @@ export const make = type => mutate => {
|
|
|
223
223
|
*
|
|
224
224
|
* **Example** (Creating a directed graph)
|
|
225
225
|
*
|
|
226
|
-
* ```ts
|
|
226
|
+
* ```ts import.meta.vitest
|
|
227
227
|
* import { Graph } from "effect"
|
|
228
228
|
*
|
|
229
229
|
* // Directed graph with initial nodes and edges
|
|
@@ -234,6 +234,7 @@ export const make = type => mutate => {
|
|
|
234
234
|
* Graph.addEdge(mutable, a, b, "A->B")
|
|
235
235
|
* Graph.addEdge(mutable, b, c, "B->C")
|
|
236
236
|
* })
|
|
237
|
+
* Array.of(Graph.nodeCount(graph), Graph.edgeCount(graph)) // => [3, 2]
|
|
237
238
|
* ```
|
|
238
239
|
*
|
|
239
240
|
* @category constructors
|
|
@@ -245,7 +246,7 @@ export const directed = /*#__PURE__*/make("directed");
|
|
|
245
246
|
*
|
|
246
247
|
* **Example** (Creating an undirected graph)
|
|
247
248
|
*
|
|
248
|
-
* ```ts
|
|
249
|
+
* ```ts import.meta.vitest
|
|
249
250
|
* import { Graph } from "effect"
|
|
250
251
|
*
|
|
251
252
|
* // Undirected graph with initial nodes and edges
|
|
@@ -256,6 +257,7 @@ export const directed = /*#__PURE__*/make("directed");
|
|
|
256
257
|
* Graph.addEdge(mutable, a, b, "A-B")
|
|
257
258
|
* Graph.addEdge(mutable, b, c, "B-C")
|
|
258
259
|
* })
|
|
260
|
+
* Array.of(Graph.nodeCount(graph), Graph.edgeCount(graph)) // => [3, 2]
|
|
259
261
|
* ```
|
|
260
262
|
*
|
|
261
263
|
* @category constructors
|
|
@@ -270,12 +272,13 @@ export const undirected = /*#__PURE__*/make("undirected");
|
|
|
270
272
|
*
|
|
271
273
|
* **Example** (Beginning a mutation scope)
|
|
272
274
|
*
|
|
273
|
-
* ```ts
|
|
275
|
+
* ```ts import.meta.vitest
|
|
274
276
|
* import { Graph } from "effect"
|
|
275
277
|
*
|
|
276
278
|
* const graph = Graph.directed<string, number>()
|
|
277
279
|
* const mutable = Graph.beginMutation(graph)
|
|
278
280
|
* // Now mutable can be safely modified without affecting original graph
|
|
281
|
+
* Array.of(Graph.nodeCount(mutable), Graph.nodeCount(graph)) // => [0, 0]
|
|
279
282
|
* ```
|
|
280
283
|
*
|
|
281
284
|
* @category mutations
|
|
@@ -307,13 +310,13 @@ export const beginMutation = graph => {
|
|
|
307
310
|
*
|
|
308
311
|
* **Example** (Ending a mutation scope)
|
|
309
312
|
*
|
|
310
|
-
* ```ts
|
|
313
|
+
* ```ts import.meta.vitest
|
|
311
314
|
* import { Graph } from "effect"
|
|
312
315
|
*
|
|
313
316
|
* const graph = Graph.directed<string, number>()
|
|
314
317
|
* const mutable = Graph.beginMutation(graph)
|
|
315
318
|
* // ... perform mutations on mutable ...
|
|
316
|
-
*
|
|
319
|
+
* Graph.nodeCount(Graph.endMutation(mutable)) // => 0
|
|
317
320
|
* ```
|
|
318
321
|
*
|
|
319
322
|
* @category mutations
|
|
@@ -350,7 +353,7 @@ const mutateScoped = (mutable, f) => {
|
|
|
350
353
|
*
|
|
351
354
|
* **Example** (Applying scoped mutations)
|
|
352
355
|
*
|
|
353
|
-
* ```ts
|
|
356
|
+
* ```ts import.meta.vitest
|
|
354
357
|
* import { Graph } from "effect"
|
|
355
358
|
*
|
|
356
359
|
* const graph = Graph.directed<string, number>()
|
|
@@ -360,8 +363,8 @@ const mutateScoped = (mutable, f) => {
|
|
|
360
363
|
* Graph.addEdge(mutable, nodeA, nodeB, 1)
|
|
361
364
|
* })
|
|
362
365
|
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
366
|
+
* Graph.nodeCount(newGraph) // => 2
|
|
367
|
+
* Graph.edgeCount(newGraph) // => 1
|
|
365
368
|
* ```
|
|
366
369
|
*
|
|
367
370
|
* @category mutations
|
|
@@ -470,7 +473,7 @@ const assertSameKind = (self, that) => {
|
|
|
470
473
|
*
|
|
471
474
|
* **Example** (Combining graphs)
|
|
472
475
|
*
|
|
473
|
-
* ```ts
|
|
476
|
+
* ```ts import.meta.vitest
|
|
474
477
|
* import { Graph } from "effect"
|
|
475
478
|
*
|
|
476
479
|
* const left = Graph.directed<{ id: string }, string>((mutable) => {
|
|
@@ -489,8 +492,8 @@ const assertSameKind = (self, that) => {
|
|
|
489
492
|
* nodeIdentity: (node) => node.id
|
|
490
493
|
* })
|
|
491
494
|
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
495
|
+
* Graph.nodeCount(result) // => 3
|
|
496
|
+
* Graph.edgeCount(result) // => 2
|
|
494
497
|
* ```
|
|
495
498
|
*
|
|
496
499
|
* @category set operations
|
|
@@ -540,7 +543,7 @@ export const compose = /*#__PURE__*/dual(args => isGraph(args[0]) && isGraph(arg
|
|
|
540
543
|
*
|
|
541
544
|
* **Example** (Finding shared structure)
|
|
542
545
|
*
|
|
543
|
-
* ```ts
|
|
546
|
+
* ```ts import.meta.vitest
|
|
544
547
|
* import { Graph } from "effect"
|
|
545
548
|
*
|
|
546
549
|
* const left = Graph.directed<string, string>((mutable) => {
|
|
@@ -557,8 +560,8 @@ export const compose = /*#__PURE__*/dual(args => isGraph(args[0]) && isGraph(arg
|
|
|
557
560
|
*
|
|
558
561
|
* const result = Graph.intersection(left, right)
|
|
559
562
|
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
563
|
+
* Graph.nodeCount(result) // => 2
|
|
564
|
+
* Graph.edgeCount(result) // => 1
|
|
562
565
|
* ```
|
|
563
566
|
*
|
|
564
567
|
* @category set operations
|
|
@@ -617,7 +620,7 @@ export const intersection = /*#__PURE__*/dual(args => isGraph(args[0]) && isGrap
|
|
|
617
620
|
*
|
|
618
621
|
* **Example** (Removing shared edges)
|
|
619
622
|
*
|
|
620
|
-
* ```ts
|
|
623
|
+
* ```ts import.meta.vitest
|
|
621
624
|
* import { Graph } from "effect"
|
|
622
625
|
*
|
|
623
626
|
* const left = Graph.directed<string, string>((mutable) => {
|
|
@@ -636,8 +639,8 @@ export const intersection = /*#__PURE__*/dual(args => isGraph(args[0]) && isGrap
|
|
|
636
639
|
*
|
|
637
640
|
* const result = Graph.difference(left, right)
|
|
638
641
|
*
|
|
639
|
-
*
|
|
640
|
-
*
|
|
642
|
+
* Graph.nodeCount(result) // => 3
|
|
643
|
+
* Graph.edgeCount(result) // => 1
|
|
641
644
|
* ```
|
|
642
645
|
*
|
|
643
646
|
* @category set operations
|
|
@@ -686,7 +689,7 @@ export const difference = /*#__PURE__*/dual(args => isGraph(args[0]) && isGraph(
|
|
|
686
689
|
*
|
|
687
690
|
* **Example** (Finding differing edges)
|
|
688
691
|
*
|
|
689
|
-
* ```ts
|
|
692
|
+
* ```ts import.meta.vitest
|
|
690
693
|
* import { Graph } from "effect"
|
|
691
694
|
*
|
|
692
695
|
* const left = Graph.directed<string, string>((mutable) => {
|
|
@@ -707,8 +710,8 @@ export const difference = /*#__PURE__*/dual(args => isGraph(args[0]) && isGraph(
|
|
|
707
710
|
*
|
|
708
711
|
* const result = Graph.symmetricDifference(left, right)
|
|
709
712
|
*
|
|
710
|
-
*
|
|
711
|
-
*
|
|
713
|
+
* Graph.nodeCount(result) // => 4
|
|
714
|
+
* Graph.edgeCount(result) // => 2
|
|
712
715
|
* ```
|
|
713
716
|
*
|
|
714
717
|
* @category set operations
|
|
@@ -756,7 +759,7 @@ export const symmetricDifference = /*#__PURE__*/dual(args => isGraph(args[0]) &&
|
|
|
756
759
|
*
|
|
757
760
|
* **Example** (Finding missing relationships)
|
|
758
761
|
*
|
|
759
|
-
* ```ts
|
|
762
|
+
* ```ts import.meta.vitest
|
|
760
763
|
* import { Graph } from "effect"
|
|
761
764
|
*
|
|
762
765
|
* const graph = Graph.directed<string, string>((mutable) => {
|
|
@@ -767,7 +770,7 @@ export const symmetricDifference = /*#__PURE__*/dual(args => isGraph(args[0]) &&
|
|
|
767
770
|
*
|
|
768
771
|
* const result = Graph.complement(graph, (source, target) => `${source}-${target}`)
|
|
769
772
|
*
|
|
770
|
-
*
|
|
773
|
+
* Graph.edgeCount(result) // => 1
|
|
771
774
|
* ```
|
|
772
775
|
*
|
|
773
776
|
* @category set operations
|
|
@@ -811,7 +814,7 @@ export const complement = /*#__PURE__*/dual(2, (self, createEdge) => {
|
|
|
811
814
|
*
|
|
812
815
|
* **Example** (Getting a local neighborhood)
|
|
813
816
|
*
|
|
814
|
-
* ```ts
|
|
817
|
+
* ```ts import.meta.vitest
|
|
815
818
|
* import { Graph } from "effect"
|
|
816
819
|
*
|
|
817
820
|
* const graph = Graph.directed<string, string>((mutable) => {
|
|
@@ -824,7 +827,7 @@ export const complement = /*#__PURE__*/dual(2, (self, createEdge) => {
|
|
|
824
827
|
*
|
|
825
828
|
* const result = Graph.neighborhood(graph, 1, { radius: 1 })
|
|
826
829
|
*
|
|
827
|
-
*
|
|
830
|
+
* Graph.nodeCount(result) // => 2
|
|
828
831
|
* ```
|
|
829
832
|
*
|
|
830
833
|
* @category set operations
|
|
@@ -916,14 +919,12 @@ export const sum = /*#__PURE__*/dual(2, (self, that) => {
|
|
|
916
919
|
*
|
|
917
920
|
* **Example** (Adding nodes)
|
|
918
921
|
*
|
|
919
|
-
* ```ts
|
|
922
|
+
* ```ts import.meta.vitest
|
|
920
923
|
* import { Graph } from "effect"
|
|
921
924
|
*
|
|
922
|
-
*
|
|
923
|
-
*
|
|
924
|
-
*
|
|
925
|
-
* console.log(nodeA) // NodeIndex with value 0
|
|
926
|
-
* console.log(nodeB) // NodeIndex with value 1
|
|
925
|
+
* Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
926
|
+
* Graph.addNode(mutable, "Node A") // => 0
|
|
927
|
+
* Graph.addNode(mutable, "Node B") // => 1
|
|
927
928
|
* })
|
|
928
929
|
* ```
|
|
929
930
|
*
|
|
@@ -952,19 +953,14 @@ export const addNode = (mutable, data) => {
|
|
|
952
953
|
*
|
|
953
954
|
* **Example** (Getting node data)
|
|
954
955
|
*
|
|
955
|
-
* ```ts
|
|
956
|
+
* ```ts import.meta.vitest
|
|
956
957
|
* import { Graph, Option } from "effect"
|
|
957
958
|
*
|
|
958
959
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
959
960
|
* Graph.addNode(mutable, "Node A")
|
|
960
961
|
* })
|
|
961
962
|
*
|
|
962
|
-
*
|
|
963
|
-
* const nodeData = Graph.getNode(graph, nodeIndex)
|
|
964
|
-
*
|
|
965
|
-
* if (Option.isSome(nodeData)) {
|
|
966
|
-
* console.log(nodeData.value) // "Node A"
|
|
967
|
-
* }
|
|
963
|
+
* Graph.getNode(graph, 0) // => Option.some("Node A")
|
|
968
964
|
* ```
|
|
969
965
|
*
|
|
970
966
|
* @category getters
|
|
@@ -979,20 +975,15 @@ export const getNode = /*#__PURE__*/dual(2, (graph, nodeIndex) => {
|
|
|
979
975
|
*
|
|
980
976
|
* **Example** (Checking node existence)
|
|
981
977
|
*
|
|
982
|
-
* ```ts
|
|
978
|
+
* ```ts import.meta.vitest
|
|
983
979
|
* import { Graph } from "effect"
|
|
984
980
|
*
|
|
985
981
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
986
982
|
* Graph.addNode(mutable, "Node A")
|
|
987
983
|
* })
|
|
988
984
|
*
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
* console.log(exists) // true
|
|
992
|
-
*
|
|
993
|
-
* const nonExistentIndex = 999
|
|
994
|
-
* const notExists = Graph.hasNode(graph, nonExistentIndex)
|
|
995
|
-
* console.log(notExists) // false
|
|
985
|
+
* Graph.hasNode(graph, 0) // => true
|
|
986
|
+
* Graph.hasNode(graph, 999) // => false
|
|
996
987
|
* ```
|
|
997
988
|
*
|
|
998
989
|
* @category getters
|
|
@@ -1004,11 +995,11 @@ export const hasNode = /*#__PURE__*/dual(2, (graph, nodeIndex) => graphImpl(grap
|
|
|
1004
995
|
*
|
|
1005
996
|
* **Example** (Counting nodes)
|
|
1006
997
|
*
|
|
1007
|
-
* ```ts
|
|
998
|
+
* ```ts import.meta.vitest
|
|
1008
999
|
* import { Graph } from "effect"
|
|
1009
1000
|
*
|
|
1010
1001
|
* const emptyGraph = Graph.directed<string, number>()
|
|
1011
|
-
*
|
|
1002
|
+
* Graph.nodeCount(emptyGraph) // => 0
|
|
1012
1003
|
*
|
|
1013
1004
|
* const graphWithNodes = Graph.mutate(emptyGraph, (mutable) => {
|
|
1014
1005
|
* Graph.addNode(mutable, "Node A")
|
|
@@ -1016,7 +1007,7 @@ export const hasNode = /*#__PURE__*/dual(2, (graph, nodeIndex) => graphImpl(grap
|
|
|
1016
1007
|
* Graph.addNode(mutable, "Node C")
|
|
1017
1008
|
* })
|
|
1018
1009
|
*
|
|
1019
|
-
*
|
|
1010
|
+
* Graph.nodeCount(graphWithNodes) // => 3
|
|
1020
1011
|
* ```
|
|
1021
1012
|
*
|
|
1022
1013
|
* @category getters
|
|
@@ -1028,8 +1019,8 @@ export const nodeCount = graph => graphImpl(graph).nodes.size;
|
|
|
1028
1019
|
*
|
|
1029
1020
|
* **Example** (Finding the first matching node)
|
|
1030
1021
|
*
|
|
1031
|
-
* ```ts
|
|
1032
|
-
* import { Graph } from "effect"
|
|
1022
|
+
* ```ts import.meta.vitest
|
|
1023
|
+
* import { Graph, Option } from "effect"
|
|
1033
1024
|
*
|
|
1034
1025
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
1035
1026
|
* Graph.addNode(mutable, "Node A")
|
|
@@ -1037,11 +1028,8 @@ export const nodeCount = graph => graphImpl(graph).nodes.size;
|
|
|
1037
1028
|
* Graph.addNode(mutable, "Node C")
|
|
1038
1029
|
* })
|
|
1039
1030
|
*
|
|
1040
|
-
*
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1043
|
-
* const notFound = Graph.findNode(graph, (data) => data === "Node D")
|
|
1044
|
-
* console.log(notFound) // Option.none()
|
|
1031
|
+
* Graph.findNode(graph, (data) => data.startsWith("Node B")) // => Option.some(1)
|
|
1032
|
+
* Graph.findNode(graph, (data) => data === "Node D") // => Option.none()
|
|
1045
1033
|
* ```
|
|
1046
1034
|
*
|
|
1047
1035
|
* @category getters
|
|
@@ -1061,7 +1049,7 @@ export const findNode = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1061
1049
|
*
|
|
1062
1050
|
* **Example** (Finding matching nodes)
|
|
1063
1051
|
*
|
|
1064
|
-
* ```ts
|
|
1052
|
+
* ```ts import.meta.vitest
|
|
1065
1053
|
* import { Graph } from "effect"
|
|
1066
1054
|
*
|
|
1067
1055
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
@@ -1070,11 +1058,8 @@ export const findNode = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1070
1058
|
* Graph.addNode(mutable, "Start C")
|
|
1071
1059
|
* })
|
|
1072
1060
|
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1075
|
-
*
|
|
1076
|
-
* const empty = Graph.findNodes(graph, (data) => data === "Not Found")
|
|
1077
|
-
* console.log(empty) // []
|
|
1061
|
+
* Graph.findNodes(graph, (data) => data.startsWith("Start")) // => [0, 2]
|
|
1062
|
+
* Graph.findNodes(graph, (data) => data === "Not Found") // => []
|
|
1078
1063
|
* ```
|
|
1079
1064
|
*
|
|
1080
1065
|
* @category getters
|
|
@@ -1095,8 +1080,8 @@ export const findNodes = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1095
1080
|
*
|
|
1096
1081
|
* **Example** (Finding the first matching edge)
|
|
1097
1082
|
*
|
|
1098
|
-
* ```ts
|
|
1099
|
-
* import { Graph } from "effect"
|
|
1083
|
+
* ```ts import.meta.vitest
|
|
1084
|
+
* import { Graph, Option } from "effect"
|
|
1100
1085
|
*
|
|
1101
1086
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
1102
1087
|
* const nodeA = Graph.addNode(mutable, "Node A")
|
|
@@ -1106,11 +1091,8 @@ export const findNodes = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1106
1091
|
* Graph.addEdge(mutable, nodeB, nodeC, 20)
|
|
1107
1092
|
* })
|
|
1108
1093
|
*
|
|
1109
|
-
*
|
|
1110
|
-
*
|
|
1111
|
-
*
|
|
1112
|
-
* const notFound = Graph.findEdge(graph, (data) => data > 100)
|
|
1113
|
-
* console.log(notFound) // Option.none()
|
|
1094
|
+
* Graph.findEdge(graph, (data) => data > 15) // => Option.some(1)
|
|
1095
|
+
* Graph.findEdge(graph, (data) => data > 100) // => Option.none()
|
|
1114
1096
|
* ```
|
|
1115
1097
|
*
|
|
1116
1098
|
* @category getters
|
|
@@ -1130,7 +1112,7 @@ export const findEdge = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1130
1112
|
*
|
|
1131
1113
|
* **Example** (Finding matching edges)
|
|
1132
1114
|
*
|
|
1133
|
-
* ```ts
|
|
1115
|
+
* ```ts import.meta.vitest
|
|
1134
1116
|
* import { Graph } from "effect"
|
|
1135
1117
|
*
|
|
1136
1118
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
@@ -1142,11 +1124,8 @@ export const findEdge = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1142
1124
|
* Graph.addEdge(mutable, nodeC, nodeA, 30)
|
|
1143
1125
|
* })
|
|
1144
1126
|
*
|
|
1145
|
-
*
|
|
1146
|
-
*
|
|
1147
|
-
*
|
|
1148
|
-
* const empty = Graph.findEdges(graph, (data) => data > 100)
|
|
1149
|
-
* console.log(empty) // []
|
|
1127
|
+
* Graph.findEdges(graph, (data) => data >= 20) // => [1, 2]
|
|
1128
|
+
* Graph.findEdges(graph, (data) => data > 100) // => []
|
|
1150
1129
|
* ```
|
|
1151
1130
|
*
|
|
1152
1131
|
* @category getters
|
|
@@ -1167,8 +1146,8 @@ export const findEdges = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1167
1146
|
*
|
|
1168
1147
|
* **Example** (Updating node data)
|
|
1169
1148
|
*
|
|
1170
|
-
* ```ts
|
|
1171
|
-
* import { Graph } from "effect"
|
|
1149
|
+
* ```ts import.meta.vitest
|
|
1150
|
+
* import { Graph, Option } from "effect"
|
|
1172
1151
|
*
|
|
1173
1152
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
1174
1153
|
* Graph.addNode(mutable, "Node A")
|
|
@@ -1176,8 +1155,7 @@ export const findEdges = /*#__PURE__*/dual(2, (graph, predicate) => {
|
|
|
1176
1155
|
* Graph.updateNode(mutable, 0, (data) => data.toUpperCase())
|
|
1177
1156
|
* })
|
|
1178
1157
|
*
|
|
1179
|
-
*
|
|
1180
|
-
* console.log(nodeData) // Option.some("NODE A")
|
|
1158
|
+
* Graph.getNode(graph, 0) // => Option.some("NODE A")
|
|
1181
1159
|
* ```
|
|
1182
1160
|
*
|
|
1183
1161
|
* @category transforming
|
|
@@ -1198,8 +1176,8 @@ export const updateNode = (mutable, index, f) => {
|
|
|
1198
1176
|
*
|
|
1199
1177
|
* **Example** (Updating edge data)
|
|
1200
1178
|
*
|
|
1201
|
-
* ```ts
|
|
1202
|
-
* import { Graph } from "effect"
|
|
1179
|
+
* ```ts import.meta.vitest
|
|
1180
|
+
* import { Graph, Option } from "effect"
|
|
1203
1181
|
*
|
|
1204
1182
|
* const result = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
1205
1183
|
* const nodeA = Graph.addNode(mutable, "Node A")
|
|
@@ -1208,8 +1186,7 @@ export const updateNode = (mutable, index, f) => {
|
|
|
1208
1186
|
* Graph.updateEdge(mutable, edgeIndex, (data) => data * 2)
|
|
1209
1187
|
* })
|
|
1210
1188
|
*
|
|
1211
|
-
*
|
|
1212
|
-
* console.log(edgeData) // Option.some(new Graph.Edge({ source: 0, target: 1, data: 20 }))
|
|
1189
|
+
* Option.map(Graph.getEdge(result, 0), (edge) => edge.data) // => Option.some(20)
|
|
1213
1190
|
* ```
|
|
1214
1191
|
*
|
|
1215
1192
|
* @category mutations
|
|
@@ -1238,8 +1215,8 @@ export const updateEdge = (mutable, edgeIndex, f) => {
|
|
|
1238
1215
|
*
|
|
1239
1216
|
* **Example** (Mapping node data)
|
|
1240
1217
|
*
|
|
1241
|
-
* ```ts
|
|
1242
|
-
* import { Graph } from "effect"
|
|
1218
|
+
* ```ts import.meta.vitest
|
|
1219
|
+
* import { Graph, Option } from "effect"
|
|
1243
1220
|
*
|
|
1244
1221
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
1245
1222
|
* Graph.addNode(mutable, "node a")
|
|
@@ -1248,8 +1225,7 @@ export const updateEdge = (mutable, edgeIndex, f) => {
|
|
|
1248
1225
|
* Graph.mapNodes(mutable, (data) => data.toUpperCase())
|
|
1249
1226
|
* })
|
|
1250
1227
|
*
|
|
1251
|
-
*
|
|
1252
|
-
* console.log(nodeData) // Option.some("NODE A")
|
|
1228
|
+
* Graph.getNode(graph, 0) // => Option.some("NODE A")
|
|
1253
1229
|
* ```
|
|
1254
1230
|
*
|
|
1255
1231
|
* @category transforming
|
|
@@ -1269,8 +1245,8 @@ export const mapNodes = (mutable, f) => {
|
|
|
1269
1245
|
*
|
|
1270
1246
|
* **Example** (Mapping edge data)
|
|
1271
1247
|
*
|
|
1272
|
-
* ```ts
|
|
1273
|
-
* import { Graph } from "effect"
|
|
1248
|
+
* ```ts import.meta.vitest
|
|
1249
|
+
* import { Graph, Option } from "effect"
|
|
1274
1250
|
*
|
|
1275
1251
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
1276
1252
|
* const a = Graph.addNode(mutable, "A")
|
|
@@ -1281,8 +1257,7 @@ export const mapNodes = (mutable, f) => {
|
|
|
1281
1257
|
* Graph.mapEdges(mutable, (data) => data * 2)
|
|
1282
1258
|
* })
|
|
1283
1259
|
*
|
|
1284
|
-
*
|
|
1285
|
-
* console.log(edgeData) // Option.some(new Graph.Edge({ source: 0, target: 1, data: 20 }))
|
|
1260
|
+
* Option.map(Graph.getEdge(graph, 0), (edge) => edge.data) // => Option.some(20)
|
|
1286
1261
|
* ```
|
|
1287
1262
|
*
|
|
1288
1263
|
* @category transforming
|
|
@@ -1324,8 +1299,8 @@ const rebuildAdjacency = mutable => {
|
|
|
1324
1299
|
*
|
|
1325
1300
|
* **Example** (Reversing edge directions)
|
|
1326
1301
|
*
|
|
1327
|
-
* ```ts
|
|
1328
|
-
* import { Graph } from "effect"
|
|
1302
|
+
* ```ts import.meta.vitest
|
|
1303
|
+
* import { Graph, Option } from "effect"
|
|
1329
1304
|
*
|
|
1330
1305
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
1331
1306
|
* const a = Graph.addNode(mutable, "A")
|
|
@@ -1336,8 +1311,7 @@ const rebuildAdjacency = mutable => {
|
|
|
1336
1311
|
* Graph.reverse(mutable) // Now B -> A, C -> B
|
|
1337
1312
|
* })
|
|
1338
1313
|
*
|
|
1339
|
-
*
|
|
1340
|
-
* console.log(edge0) // Option.some(new Graph.Edge({ source: 1, target: 0, data: 1 }))
|
|
1314
|
+
* Option.map(Graph.getEdge(graph, 0), (edge) => edge.source) // => Option.some(1)
|
|
1341
1315
|
* ```
|
|
1342
1316
|
*
|
|
1343
1317
|
* @category transforming
|
|
@@ -1367,7 +1341,7 @@ export const reverse = mutable => {
|
|
|
1367
1341
|
*
|
|
1368
1342
|
* **Example** (Filtering and mapping nodes)
|
|
1369
1343
|
*
|
|
1370
|
-
* ```ts
|
|
1344
|
+
* ```ts import.meta.vitest
|
|
1371
1345
|
* import { Graph, Option } from "effect"
|
|
1372
1346
|
*
|
|
1373
1347
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -1385,7 +1359,7 @@ export const reverse = mutable => {
|
|
|
1385
1359
|
* )
|
|
1386
1360
|
* })
|
|
1387
1361
|
*
|
|
1388
|
-
*
|
|
1362
|
+
* Graph.nodeCount(graph) // => 2
|
|
1389
1363
|
* ```
|
|
1390
1364
|
*
|
|
1391
1365
|
* @category transforming
|
|
@@ -1417,7 +1391,7 @@ export const filterMapNodes = (mutable, f) => {
|
|
|
1417
1391
|
*
|
|
1418
1392
|
* **Example** (Filtering and mapping edges)
|
|
1419
1393
|
*
|
|
1420
|
-
* ```ts
|
|
1394
|
+
* ```ts import.meta.vitest
|
|
1421
1395
|
* import { Graph, Option } from "effect"
|
|
1422
1396
|
*
|
|
1423
1397
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -1435,7 +1409,7 @@ export const filterMapNodes = (mutable, f) => {
|
|
|
1435
1409
|
* )
|
|
1436
1410
|
* })
|
|
1437
1411
|
*
|
|
1438
|
-
*
|
|
1412
|
+
* Graph.edgeCount(graph) // => 2
|
|
1439
1413
|
* ```
|
|
1440
1414
|
*
|
|
1441
1415
|
* @category transforming
|
|
@@ -1470,7 +1444,7 @@ export const filterMapEdges = (mutable, f) => {
|
|
|
1470
1444
|
*
|
|
1471
1445
|
* **Example** (Filtering nodes)
|
|
1472
1446
|
*
|
|
1473
|
-
* ```ts
|
|
1447
|
+
* ```ts import.meta.vitest
|
|
1474
1448
|
* import { Graph } from "effect"
|
|
1475
1449
|
*
|
|
1476
1450
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -1483,7 +1457,7 @@ export const filterMapEdges = (mutable, f) => {
|
|
|
1483
1457
|
* Graph.filterNodes(mutable, (data) => data === "active")
|
|
1484
1458
|
* })
|
|
1485
1459
|
*
|
|
1486
|
-
*
|
|
1460
|
+
* Graph.nodeCount(graph) // => 2
|
|
1487
1461
|
* ```
|
|
1488
1462
|
*
|
|
1489
1463
|
* @category transforming
|
|
@@ -1510,7 +1484,7 @@ export const filterNodes = (mutable, predicate) => {
|
|
|
1510
1484
|
*
|
|
1511
1485
|
* **Example** (Filtering edges)
|
|
1512
1486
|
*
|
|
1513
|
-
* ```ts
|
|
1487
|
+
* ```ts import.meta.vitest
|
|
1514
1488
|
* import { Graph } from "effect"
|
|
1515
1489
|
*
|
|
1516
1490
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -1526,7 +1500,7 @@ export const filterNodes = (mutable, predicate) => {
|
|
|
1526
1500
|
* Graph.filterEdges(mutable, (data) => data >= 10)
|
|
1527
1501
|
* })
|
|
1528
1502
|
*
|
|
1529
|
-
*
|
|
1503
|
+
* Graph.edgeCount(graph) // => 2
|
|
1530
1504
|
* ```
|
|
1531
1505
|
*
|
|
1532
1506
|
* @category transforming
|
|
@@ -1588,14 +1562,13 @@ const invalidateCycleFlagOnAddition = mutable => {
|
|
|
1588
1562
|
*
|
|
1589
1563
|
* **Example** (Adding edges)
|
|
1590
1564
|
*
|
|
1591
|
-
* ```ts
|
|
1565
|
+
* ```ts import.meta.vitest
|
|
1592
1566
|
* import { Graph } from "effect"
|
|
1593
1567
|
*
|
|
1594
|
-
*
|
|
1568
|
+
* Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
1595
1569
|
* const nodeA = Graph.addNode(mutable, "Node A")
|
|
1596
1570
|
* const nodeB = Graph.addNode(mutable, "Node B")
|
|
1597
|
-
*
|
|
1598
|
-
* console.log(edge) // EdgeIndex with value 0
|
|
1571
|
+
* Graph.addEdge(mutable, nodeA, nodeB, 42) // => 0
|
|
1599
1572
|
* })
|
|
1600
1573
|
* ```
|
|
1601
1574
|
*
|
|
@@ -1657,7 +1630,7 @@ export const addEdge = (mutable, source, target, data) => {
|
|
|
1657
1630
|
*
|
|
1658
1631
|
* **Example** (Removing a node)
|
|
1659
1632
|
*
|
|
1660
|
-
* ```ts
|
|
1633
|
+
* ```ts import.meta.vitest
|
|
1661
1634
|
* import { Graph } from "effect"
|
|
1662
1635
|
*
|
|
1663
1636
|
* const result = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
@@ -1668,6 +1641,7 @@ export const addEdge = (mutable, source, target, data) => {
|
|
|
1668
1641
|
* // Remove nodeA and all edges connected to it
|
|
1669
1642
|
* Graph.removeNode(mutable, nodeA)
|
|
1670
1643
|
* })
|
|
1644
|
+
* Array.of(Graph.nodeCount(result), Graph.edgeCount(result)) // => [1, 0]
|
|
1671
1645
|
* ```
|
|
1672
1646
|
*
|
|
1673
1647
|
* @category mutations
|
|
@@ -1713,7 +1687,7 @@ export const removeNode = (mutable, nodeIndex) => {
|
|
|
1713
1687
|
*
|
|
1714
1688
|
* **Example** (Removing an edge)
|
|
1715
1689
|
*
|
|
1716
|
-
* ```ts
|
|
1690
|
+
* ```ts import.meta.vitest
|
|
1717
1691
|
* import { Graph } from "effect"
|
|
1718
1692
|
*
|
|
1719
1693
|
* const result = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
@@ -1724,6 +1698,7 @@ export const removeNode = (mutable, nodeIndex) => {
|
|
|
1724
1698
|
* // Remove the edge
|
|
1725
1699
|
* Graph.removeEdge(mutable, edge)
|
|
1726
1700
|
* })
|
|
1701
|
+
* Array.of(Graph.nodeCount(result), Graph.edgeCount(result)) // => [2, 0]
|
|
1727
1702
|
* ```
|
|
1728
1703
|
*
|
|
1729
1704
|
* @category mutations
|
|
@@ -1794,8 +1769,8 @@ const removeEdgeInternal = (mutable, edgeIndex) => {
|
|
|
1794
1769
|
*
|
|
1795
1770
|
* **Example** (Getting edge data)
|
|
1796
1771
|
*
|
|
1797
|
-
* ```ts
|
|
1798
|
-
* import { Graph } from "effect"
|
|
1772
|
+
* ```ts import.meta.vitest
|
|
1773
|
+
* import { Graph, Option } from "effect"
|
|
1799
1774
|
*
|
|
1800
1775
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
1801
1776
|
* const nodeA = Graph.addNode(mutable, "Node A")
|
|
@@ -1803,14 +1778,7 @@ const removeEdgeInternal = (mutable, edgeIndex) => {
|
|
|
1803
1778
|
* Graph.addEdge(mutable, nodeA, nodeB, 42)
|
|
1804
1779
|
* })
|
|
1805
1780
|
*
|
|
1806
|
-
*
|
|
1807
|
-
* const edgeData = Graph.getEdge(graph, edgeIndex)
|
|
1808
|
-
*
|
|
1809
|
-
* if (edgeData._tag === "Some") {
|
|
1810
|
-
* console.log(edgeData.value.data) // 42
|
|
1811
|
-
* console.log(edgeData.value.source) // 0
|
|
1812
|
-
* console.log(edgeData.value.target) // 1
|
|
1813
|
-
* }
|
|
1781
|
+
* Graph.getEdge(graph, 0) // => Option.some(new Graph.Edge({ source: 0, target: 1, data: 42 }))
|
|
1814
1782
|
* ```
|
|
1815
1783
|
*
|
|
1816
1784
|
* @category getters
|
|
@@ -1822,7 +1790,7 @@ export const getEdge = /*#__PURE__*/dual(2, (graph, edgeIndex) => Option.fromUnd
|
|
|
1822
1790
|
*
|
|
1823
1791
|
* **Example** (Checking edge existence)
|
|
1824
1792
|
*
|
|
1825
|
-
* ```ts
|
|
1793
|
+
* ```ts import.meta.vitest
|
|
1826
1794
|
* import { Graph } from "effect"
|
|
1827
1795
|
*
|
|
1828
1796
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
@@ -1832,15 +1800,8 @@ export const getEdge = /*#__PURE__*/dual(2, (graph, edgeIndex) => Option.fromUnd
|
|
|
1832
1800
|
* Graph.addEdge(mutable, nodeA, nodeB, 42)
|
|
1833
1801
|
* })
|
|
1834
1802
|
*
|
|
1835
|
-
*
|
|
1836
|
-
*
|
|
1837
|
-
* const nodeC = 2
|
|
1838
|
-
*
|
|
1839
|
-
* const hasAB = Graph.hasEdge(graph, nodeA, nodeB)
|
|
1840
|
-
* console.log(hasAB) // true
|
|
1841
|
-
*
|
|
1842
|
-
* const hasAC = Graph.hasEdge(graph, nodeA, nodeC)
|
|
1843
|
-
* console.log(hasAC) // false
|
|
1803
|
+
* Graph.hasEdge(graph, 0, 1) // => true
|
|
1804
|
+
* Graph.hasEdge(graph, 0, 2) // => false
|
|
1844
1805
|
* ```
|
|
1845
1806
|
*
|
|
1846
1807
|
* @category getters
|
|
@@ -1869,11 +1830,11 @@ export const hasEdge = /*#__PURE__*/dual(3, (graph, source, target) => {
|
|
|
1869
1830
|
*
|
|
1870
1831
|
* **Example** (Counting edges)
|
|
1871
1832
|
*
|
|
1872
|
-
* ```ts
|
|
1833
|
+
* ```ts import.meta.vitest
|
|
1873
1834
|
* import { Graph } from "effect"
|
|
1874
1835
|
*
|
|
1875
1836
|
* const emptyGraph = Graph.directed<string, number>()
|
|
1876
|
-
*
|
|
1837
|
+
* Graph.edgeCount(emptyGraph) // => 0
|
|
1877
1838
|
*
|
|
1878
1839
|
* const graphWithEdges = Graph.mutate(emptyGraph, (mutable) => {
|
|
1879
1840
|
* const nodeA = Graph.addNode(mutable, "Node A")
|
|
@@ -1884,7 +1845,7 @@ export const hasEdge = /*#__PURE__*/dual(3, (graph, source, target) => {
|
|
|
1884
1845
|
* Graph.addEdge(mutable, nodeC, nodeA, 3)
|
|
1885
1846
|
* })
|
|
1886
1847
|
*
|
|
1887
|
-
*
|
|
1848
|
+
* Graph.edgeCount(graphWithEdges) // => 3
|
|
1888
1849
|
* ```
|
|
1889
1850
|
*
|
|
1890
1851
|
* @category getters
|
|
@@ -1917,7 +1878,7 @@ const getDirectedNeighbors = (graph, nodeIndex, direction) => {
|
|
|
1917
1878
|
*
|
|
1918
1879
|
* **Example** (Getting outgoing neighbors)
|
|
1919
1880
|
*
|
|
1920
|
-
* ```ts
|
|
1881
|
+
* ```ts import.meta.vitest
|
|
1921
1882
|
* import { Graph } from "effect"
|
|
1922
1883
|
*
|
|
1923
1884
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
@@ -1928,15 +1889,8 @@ const getDirectedNeighbors = (graph, nodeIndex, direction) => {
|
|
|
1928
1889
|
* Graph.addEdge(mutable, nodeA, nodeC, 2)
|
|
1929
1890
|
* })
|
|
1930
1891
|
*
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1933
|
-
* const nodeC = 2
|
|
1934
|
-
*
|
|
1935
|
-
* const neighborsA = Graph.neighbors(graph, nodeA)
|
|
1936
|
-
* console.log(neighborsA) // [1, 2]
|
|
1937
|
-
*
|
|
1938
|
-
* const neighborsB = Graph.neighbors(graph, nodeB)
|
|
1939
|
-
* console.log(neighborsB) // []
|
|
1892
|
+
* Graph.neighbors(graph, 0) // => [1, 2]
|
|
1893
|
+
* Graph.neighbors(graph, 1) // => []
|
|
1940
1894
|
* ```
|
|
1941
1895
|
*
|
|
1942
1896
|
* @category getters
|
|
@@ -1964,7 +1918,7 @@ export const neighbors = /*#__PURE__*/dual(2, (graph, nodeIndex) => {
|
|
|
1964
1918
|
* @see {@link predecessors} for incoming neighbors in a directed graph
|
|
1965
1919
|
* @see {@link neighbors} for generic neighbor lookup across graph kinds
|
|
1966
1920
|
*
|
|
1967
|
-
* @category
|
|
1921
|
+
* @category getters
|
|
1968
1922
|
* @since 4.0.0
|
|
1969
1923
|
*/
|
|
1970
1924
|
export const successors = /*#__PURE__*/dual(2, (graph, nodeIndex) => {
|
|
@@ -1990,7 +1944,7 @@ export const successors = /*#__PURE__*/dual(2, (graph, nodeIndex) => {
|
|
|
1990
1944
|
* @see {@link successors} for outgoing neighbors in a directed graph
|
|
1991
1945
|
* @see {@link neighbors} for generic neighbor lookup across graph kinds
|
|
1992
1946
|
*
|
|
1993
|
-
* @category
|
|
1947
|
+
* @category getters
|
|
1994
1948
|
* @since 4.0.0
|
|
1995
1949
|
*/
|
|
1996
1950
|
export const predecessors = /*#__PURE__*/dual(2, (graph, nodeIndex) => {
|
|
@@ -2015,7 +1969,7 @@ export const predecessors = /*#__PURE__*/dual(2, (graph, nodeIndex) => {
|
|
|
2015
1969
|
*
|
|
2016
1970
|
* **Example** (Traversing directed neighbors)
|
|
2017
1971
|
*
|
|
2018
|
-
* ```ts
|
|
1972
|
+
* ```ts import.meta.vitest
|
|
2019
1973
|
* import { Graph } from "effect"
|
|
2020
1974
|
*
|
|
2021
1975
|
* const graph = Graph.directed<string, string>((mutable) => {
|
|
@@ -2032,12 +1986,13 @@ export const predecessors = /*#__PURE__*/dual(2, (graph, nodeIndex) => {
|
|
|
2032
1986
|
*
|
|
2033
1987
|
* // Get incoming neighbors (nodes that point to nodeB)
|
|
2034
1988
|
* const incoming = Graph.neighborsDirected(graph, nodeB, "incoming")
|
|
1989
|
+
* Array.of(outgoing, incoming) // => [[1], [0]]
|
|
2035
1990
|
* ```
|
|
2036
1991
|
*
|
|
2037
1992
|
* @deprecated Use {@link successors} for outgoing neighbors or {@link predecessors} for incoming neighbors.
|
|
2038
1993
|
* @see {@link successors} for outgoing neighbors in a directed graph
|
|
2039
1994
|
* @see {@link predecessors} for incoming neighbors in a directed graph
|
|
2040
|
-
* @category
|
|
1995
|
+
* @category getters
|
|
2041
1996
|
* @since 3.18.0
|
|
2042
1997
|
*/
|
|
2043
1998
|
export const neighborsDirected = /*#__PURE__*/dual(3, (graph, nodeIndex, direction) => {
|
|
@@ -2054,7 +2009,7 @@ const escapeGraphVizString = value => value.replace(/\\/g, "\\\\").replace(/"/g,
|
|
|
2054
2009
|
*
|
|
2055
2010
|
* **Example** (Exporting GraphViz DOT)
|
|
2056
2011
|
*
|
|
2057
|
-
* ```ts
|
|
2012
|
+
* ```ts import.meta.vitest
|
|
2058
2013
|
* import { Graph } from "effect"
|
|
2059
2014
|
*
|
|
2060
2015
|
* const graph = Graph.mutate(Graph.directed<string, number>(), (mutable) => {
|
|
@@ -2066,16 +2021,7 @@ const escapeGraphVizString = value => value.replace(/\\/g, "\\\\").replace(/"/g,
|
|
|
2066
2021
|
* Graph.addEdge(mutable, nodeC, nodeA, 3)
|
|
2067
2022
|
* })
|
|
2068
2023
|
*
|
|
2069
|
-
*
|
|
2070
|
-
* console.log(dot)
|
|
2071
|
-
* // digraph "G" {
|
|
2072
|
-
* // "0" [label="Node A"];
|
|
2073
|
-
* // "1" [label="Node B"];
|
|
2074
|
-
* // "2" [label="Node C"];
|
|
2075
|
-
* // "0" -> "1" [label="1"];
|
|
2076
|
-
* // "1" -> "2" [label="2"];
|
|
2077
|
-
* // "2" -> "0" [label="3"];
|
|
2078
|
-
* // }
|
|
2024
|
+
* Graph.toGraphViz(graph).split("\n") // => ['digraph "G" {', ' "0" [label="Node A"];', ' "1" [label="Node B"];', ' "2" [label="Node C"];', ' "0" -> "1" [label="1"];', ' "1" -> "2" [label="2"];', ' "2" -> "0" [label="3"];', "}"]
|
|
2079
2025
|
* ```
|
|
2080
2026
|
*
|
|
2081
2027
|
* @category converting
|
|
@@ -2153,7 +2099,7 @@ const formatMermaidNode = (nodeId, label, shape) => {
|
|
|
2153
2099
|
*
|
|
2154
2100
|
* **Example** (Exporting a directed Mermaid diagram)
|
|
2155
2101
|
*
|
|
2156
|
-
* ```ts
|
|
2102
|
+
* ```ts import.meta.vitest
|
|
2157
2103
|
* import { Graph } from "effect"
|
|
2158
2104
|
*
|
|
2159
2105
|
* // Basic directed graph export
|
|
@@ -2165,19 +2111,12 @@ const formatMermaidNode = (nodeId, label, shape) => {
|
|
|
2165
2111
|
* Graph.addEdge(mutable, app, cache, 2)
|
|
2166
2112
|
* })
|
|
2167
2113
|
*
|
|
2168
|
-
*
|
|
2169
|
-
* console.log(mermaid)
|
|
2170
|
-
* // flowchart TD
|
|
2171
|
-
* // 0["App"]
|
|
2172
|
-
* // 1["Database"]
|
|
2173
|
-
* // 2["Cache"]
|
|
2174
|
-
* // 0 -->|"1"| 1
|
|
2175
|
-
* // 0 -->|"2"| 2
|
|
2114
|
+
* Graph.toMermaid(graph).split("\n") // => ["flowchart TD", ' 0["App"]', ' 1["Database"]', ' 2["Cache"]', ' 0 -->|"1"| 1', ' 0 -->|"2"| 2']
|
|
2176
2115
|
* ```
|
|
2177
2116
|
*
|
|
2178
2117
|
* **Example** (Exporting an undirected Mermaid diagram)
|
|
2179
2118
|
*
|
|
2180
|
-
* ```ts
|
|
2119
|
+
* ```ts import.meta.vitest
|
|
2181
2120
|
* import { Graph } from "effect"
|
|
2182
2121
|
*
|
|
2183
2122
|
* // Undirected graph with custom labels and direction
|
|
@@ -2194,18 +2133,12 @@ const formatMermaidNode = (nodeId, label, shape) => {
|
|
|
2194
2133
|
* edgeLabel: (relationship) => relationship,
|
|
2195
2134
|
* direction: "LR"
|
|
2196
2135
|
* })
|
|
2197
|
-
*
|
|
2198
|
-
* // graph LR
|
|
2199
|
-
* // 0["Alice"]
|
|
2200
|
-
* // 1["Bob"]
|
|
2201
|
-
* // 2["Charlie"]
|
|
2202
|
-
* // 0 ---|"friends"| 1
|
|
2203
|
-
* // 1 ---|"colleagues"| 2
|
|
2136
|
+
* mermaid.split("\n") // => ["graph LR", ' 0["Alice"]', ' 1["Bob"]', ' 2["Charlie"]', ' 0 ---|"friends"| 1', ' 1 ---|"colleagues"| 2']
|
|
2204
2137
|
* ```
|
|
2205
2138
|
*
|
|
2206
2139
|
* **Example** (Customizing Mermaid node shapes)
|
|
2207
2140
|
*
|
|
2208
|
-
* ```ts
|
|
2141
|
+
* ```ts import.meta.vitest
|
|
2209
2142
|
* import { Graph } from "effect"
|
|
2210
2143
|
*
|
|
2211
2144
|
* // Advanced styling with node shapes for flowchart
|
|
@@ -2244,20 +2177,12 @@ const formatMermaidNode = (nodeId, label, shape) => {
|
|
|
2244
2177
|
* }
|
|
2245
2178
|
* }
|
|
2246
2179
|
* })
|
|
2247
|
-
*
|
|
2248
|
-
* // flowchart TD
|
|
2249
|
-
* // 0(["Begin"])
|
|
2250
|
-
* // 1["Process Data"]
|
|
2251
|
-
* // 2{"Valid?"}
|
|
2252
|
-
* // 3(["Complete"])
|
|
2253
|
-
* // 0 --> 1
|
|
2254
|
-
* // 1 --> 2
|
|
2255
|
-
* // 2 --> 3
|
|
2180
|
+
* mermaid.split("\n") // => ["flowchart TD", ' 0(["Begin"])', ' 1["Process Data"]', ' 2{"Valid?"}', ' 3(["Complete"])', " 0 --> 1", " 1 --> 2", ' 2 -->|"yes"| 3']
|
|
2256
2181
|
* ```
|
|
2257
2182
|
*
|
|
2258
2183
|
* **Example** (Visualizing dependency graphs)
|
|
2259
2184
|
*
|
|
2260
|
-
* ```ts
|
|
2185
|
+
* ```ts import.meta.vitest
|
|
2261
2186
|
* import { Graph } from "effect"
|
|
2262
2187
|
*
|
|
2263
2188
|
* // Real-world example: Software dependency graph
|
|
@@ -2306,15 +2231,7 @@ const formatMermaidNode = (nodeId, label, shape) => {
|
|
|
2306
2231
|
* direction: "TB"
|
|
2307
2232
|
* })
|
|
2308
2233
|
*
|
|
2309
|
-
*
|
|
2310
|
-
* // flowchart TB
|
|
2311
|
-
* // 0["MyApp\nv1.0.0"]
|
|
2312
|
-
* // 1{{"React\nv18.0.0"}}
|
|
2313
|
-
* // 2["Lodash\nv4.17.0"]
|
|
2314
|
-
* // 3{"Webpack\nv5.0.0"}
|
|
2315
|
-
* // 0 -->|"depends on"| 1
|
|
2316
|
-
* // 0 -->|"depends on"| 2
|
|
2317
|
-
* // 0 -->|"builds with"| 3
|
|
2234
|
+
* dependencyDiagram.split("\n") // => ["flowchart TB", ' 0["MyApp#92;nv1.0.0"]', ' 1{{"React#92;nv18.0.0"}}', ' 2["Lodash#92;nv4.17.0"]', ' 3{"Webpack#92;nv5.0.0"}', ' 0 -->|"depends on"| 1', ' 0 -->|"depends on"| 2', ' 0 -->|"builds with"| 3']
|
|
2318
2235
|
* ```
|
|
2319
2236
|
*
|
|
2320
2237
|
* @category converting
|
|
@@ -2372,7 +2289,7 @@ export const toMermaid = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, opt
|
|
|
2372
2289
|
*
|
|
2373
2290
|
* **Example** (Checking cycles)
|
|
2374
2291
|
*
|
|
2375
|
-
* ```ts
|
|
2292
|
+
* ```ts import.meta.vitest
|
|
2376
2293
|
* import { Graph } from "effect"
|
|
2377
2294
|
*
|
|
2378
2295
|
* // Acyclic directed graph (DAG)
|
|
@@ -2383,7 +2300,7 @@ export const toMermaid = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, opt
|
|
|
2383
2300
|
* Graph.addEdge(mutable, a, b, "A->B")
|
|
2384
2301
|
* Graph.addEdge(mutable, b, c, "B->C")
|
|
2385
2302
|
* })
|
|
2386
|
-
*
|
|
2303
|
+
* Graph.isAcyclic(dag) // => true
|
|
2387
2304
|
*
|
|
2388
2305
|
* // Cyclic directed graph
|
|
2389
2306
|
* const cyclic = Graph.directed<string, string>((mutable) => {
|
|
@@ -2392,7 +2309,7 @@ export const toMermaid = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, opt
|
|
|
2392
2309
|
* Graph.addEdge(mutable, a, b, "A->B")
|
|
2393
2310
|
* Graph.addEdge(mutable, b, a, "B->A") // Creates cycle
|
|
2394
2311
|
* })
|
|
2395
|
-
*
|
|
2312
|
+
* Graph.isAcyclic(cyclic) // => false
|
|
2396
2313
|
* ```
|
|
2397
2314
|
*
|
|
2398
2315
|
* @category algorithms
|
|
@@ -2513,7 +2430,7 @@ export const isAcyclic = graph => {
|
|
|
2513
2430
|
*
|
|
2514
2431
|
* **Example** (Checking bipartite graphs)
|
|
2515
2432
|
*
|
|
2516
|
-
* ```ts
|
|
2433
|
+
* ```ts import.meta.vitest
|
|
2517
2434
|
* import { Graph } from "effect"
|
|
2518
2435
|
*
|
|
2519
2436
|
* // Bipartite graph (alternating coloring possible)
|
|
@@ -2526,7 +2443,7 @@ export const isAcyclic = graph => {
|
|
|
2526
2443
|
* Graph.addEdge(mutable, b, c, "edge")
|
|
2527
2444
|
* Graph.addEdge(mutable, c, d, "edge")
|
|
2528
2445
|
* })
|
|
2529
|
-
*
|
|
2446
|
+
* Graph.isBipartite(bipartite) // => true
|
|
2530
2447
|
*
|
|
2531
2448
|
* // Non-bipartite graph (odd cycle)
|
|
2532
2449
|
* const triangle = Graph.undirected<string, string>((mutable) => {
|
|
@@ -2537,7 +2454,7 @@ export const isAcyclic = graph => {
|
|
|
2537
2454
|
* Graph.addEdge(mutable, b, c, "edge")
|
|
2538
2455
|
* Graph.addEdge(mutable, c, a, "edge") // Triangle (3-cycle)
|
|
2539
2456
|
* })
|
|
2540
|
-
*
|
|
2457
|
+
* Graph.isBipartite(triangle) // => false
|
|
2541
2458
|
* ```
|
|
2542
2459
|
*
|
|
2543
2460
|
* @category algorithms
|
|
@@ -2626,7 +2543,7 @@ const getTraversableNeighbor = (graph, current, edge) => graph.type === "undirec
|
|
|
2626
2543
|
*
|
|
2627
2544
|
* **Example** (Finding connected components)
|
|
2628
2545
|
*
|
|
2629
|
-
* ```ts
|
|
2546
|
+
* ```ts import.meta.vitest
|
|
2630
2547
|
* import { Graph } from "effect"
|
|
2631
2548
|
*
|
|
2632
2549
|
* const graph = Graph.undirected<string, string>((mutable) => {
|
|
@@ -2638,8 +2555,7 @@ const getTraversableNeighbor = (graph, current, edge) => graph.type === "undirec
|
|
|
2638
2555
|
* Graph.addEdge(mutable, c, d, "edge") // Component 2: C-D
|
|
2639
2556
|
* })
|
|
2640
2557
|
*
|
|
2641
|
-
*
|
|
2642
|
-
* console.log(components) // [[0, 1], [2, 3]]
|
|
2558
|
+
* Graph.connectedComponents(graph) // => [[0, 1], [2, 3]]
|
|
2643
2559
|
* ```
|
|
2644
2560
|
*
|
|
2645
2561
|
* @category algorithms
|
|
@@ -2683,7 +2599,7 @@ export const connectedComponents = graph => {
|
|
|
2683
2599
|
*
|
|
2684
2600
|
* **Example** (Finding strongly connected components)
|
|
2685
2601
|
*
|
|
2686
|
-
* ```ts
|
|
2602
|
+
* ```ts import.meta.vitest
|
|
2687
2603
|
* import { Graph } from "effect"
|
|
2688
2604
|
*
|
|
2689
2605
|
* const graph = Graph.directed<string, string>((mutable) => {
|
|
@@ -2695,8 +2611,7 @@ export const connectedComponents = graph => {
|
|
|
2695
2611
|
* Graph.addEdge(mutable, c, a, "C->A") // Creates SCC: A-B-C
|
|
2696
2612
|
* })
|
|
2697
2613
|
*
|
|
2698
|
-
*
|
|
2699
|
-
* console.log(sccs) // [[0, 1, 2]]
|
|
2614
|
+
* Graph.stronglyConnectedComponents(graph) // => [[0, 2, 1]]
|
|
2700
2615
|
* ```
|
|
2701
2616
|
*
|
|
2702
2617
|
* @category algorithms
|
|
@@ -2827,8 +2742,8 @@ const minHeapPop = heap => {
|
|
|
2827
2742
|
*
|
|
2828
2743
|
* **Example** (Finding shortest paths with Dijkstra)
|
|
2829
2744
|
*
|
|
2830
|
-
* ```ts
|
|
2831
|
-
* import { Graph } from "effect"
|
|
2745
|
+
* ```ts import.meta.vitest
|
|
2746
|
+
* import { Graph, Option } from "effect"
|
|
2832
2747
|
*
|
|
2833
2748
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
2834
2749
|
* const a = Graph.addNode(mutable, "A")
|
|
@@ -2845,10 +2760,7 @@ const minHeapPop = heap => {
|
|
|
2845
2760
|
* cost: (edgeData) => edgeData
|
|
2846
2761
|
* })
|
|
2847
2762
|
*
|
|
2848
|
-
*
|
|
2849
|
-
* console.log(result.value.path) // [0, 1, 2] - shortest path A->B->C
|
|
2850
|
-
* console.log(result.value.distance) // 7 - total distance
|
|
2851
|
-
* }
|
|
2763
|
+
* Option.map(result, ({ distance, path }) => [distance, path] as const) // => Option.some([7, [0, 1, 2]])
|
|
2852
2764
|
* ```
|
|
2853
2765
|
*
|
|
2854
2766
|
* @category algorithms
|
|
@@ -2980,7 +2892,7 @@ export const dijkstra = /*#__PURE__*/dual(2, (graph, config) => {
|
|
|
2980
2892
|
*
|
|
2981
2893
|
* **Example** (Finding all-pairs shortest paths)
|
|
2982
2894
|
*
|
|
2983
|
-
* ```ts
|
|
2895
|
+
* ```ts import.meta.vitest
|
|
2984
2896
|
* import { Graph } from "effect"
|
|
2985
2897
|
*
|
|
2986
2898
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -2993,8 +2905,8 @@ export const dijkstra = /*#__PURE__*/dual(2, (graph, config) => {
|
|
|
2993
2905
|
* })
|
|
2994
2906
|
*
|
|
2995
2907
|
* const result = Graph.floydWarshall(graph, (edgeData) => edgeData)
|
|
2996
|
-
* const
|
|
2997
|
-
*
|
|
2908
|
+
* const shortest = { distance: result.distances.get(0)?.get(2), path: result.paths.get(0)?.get(2) }
|
|
2909
|
+
* shortest // => { distance: 5, path: [0, 1, 2] }
|
|
2998
2910
|
* ```
|
|
2999
2911
|
*
|
|
3000
2912
|
* @category algorithms
|
|
@@ -3122,8 +3034,8 @@ export const floydWarshall = /*#__PURE__*/dual(2, (graph, cost) => {
|
|
|
3122
3034
|
*
|
|
3123
3035
|
* **Example** (Finding shortest paths with A-star)
|
|
3124
3036
|
*
|
|
3125
|
-
* ```ts
|
|
3126
|
-
* import { Graph } from "effect"
|
|
3037
|
+
* ```ts import.meta.vitest
|
|
3038
|
+
* import { Graph, Option } from "effect"
|
|
3127
3039
|
*
|
|
3128
3040
|
* const graph = Graph.directed<{ x: number; y: number }, number>((mutable) => {
|
|
3129
3041
|
* const a = Graph.addNode(mutable, { x: 0, y: 0 })
|
|
@@ -3146,10 +3058,7 @@ export const floydWarshall = /*#__PURE__*/dual(2, (graph, cost) => {
|
|
|
3146
3058
|
* heuristic
|
|
3147
3059
|
* })
|
|
3148
3060
|
*
|
|
3149
|
-
*
|
|
3150
|
-
* console.log(result.value.path) // [0, 1, 2] - shortest path
|
|
3151
|
-
* console.log(result.value.distance) // 2 - total distance
|
|
3152
|
-
* }
|
|
3061
|
+
* Option.map(result, ({ distance, path }) => [distance, path] as const) // => Option.some([2, [0, 1, 2]])
|
|
3153
3062
|
* ```
|
|
3154
3063
|
*
|
|
3155
3064
|
* @category algorithms
|
|
@@ -3304,8 +3213,8 @@ export const astar = /*#__PURE__*/dual(2, (graph, config) => {
|
|
|
3304
3213
|
*
|
|
3305
3214
|
* **Example** (Finding shortest paths with Bellman-Ford)
|
|
3306
3215
|
*
|
|
3307
|
-
* ```ts
|
|
3308
|
-
* import { Graph } from "effect"
|
|
3216
|
+
* ```ts import.meta.vitest
|
|
3217
|
+
* import { Graph, Option } from "effect"
|
|
3309
3218
|
*
|
|
3310
3219
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
3311
3220
|
* const a = Graph.addNode(mutable, "A")
|
|
@@ -3322,10 +3231,7 @@ export const astar = /*#__PURE__*/dual(2, (graph, config) => {
|
|
|
3322
3231
|
* cost: (edgeData) => edgeData
|
|
3323
3232
|
* })
|
|
3324
3233
|
*
|
|
3325
|
-
*
|
|
3326
|
-
* console.log(result.value.path) // [0, 1, 2] - shortest path A->B->C
|
|
3327
|
-
* console.log(result.value.distance) // 2 - total distance
|
|
3328
|
-
* }
|
|
3234
|
+
* Option.map(result, ({ distance, path }) => [distance, path] as const) // => Option.some([2, [0, 1, 2]])
|
|
3329
3235
|
* ```
|
|
3330
3236
|
*
|
|
3331
3237
|
* @category algorithms
|
|
@@ -3453,7 +3359,7 @@ export const bellmanFord = /*#__PURE__*/dual(2, (graph, config) => {
|
|
|
3453
3359
|
*
|
|
3454
3360
|
* **Example** (Working with node walkers)
|
|
3455
3361
|
*
|
|
3456
|
-
* ```ts
|
|
3362
|
+
* ```ts import.meta.vitest
|
|
3457
3363
|
* import { Graph } from "effect"
|
|
3458
3364
|
*
|
|
3459
3365
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3472,8 +3378,8 @@ export const bellmanFord = /*#__PURE__*/dual(2, (graph, config) => {
|
|
|
3472
3378
|
* }
|
|
3473
3379
|
*
|
|
3474
3380
|
* // Access node data using values() or entries()
|
|
3475
|
-
*
|
|
3476
|
-
*
|
|
3381
|
+
* Array.from(Graph.values(dfsNodes)) // => ["A", "B"]
|
|
3382
|
+
* Array.from(Graph.entries(allNodes)) // => [[0, "A"], [1, "B"]]
|
|
3477
3383
|
* ```
|
|
3478
3384
|
*
|
|
3479
3385
|
* @category models
|
|
@@ -3493,7 +3399,7 @@ export class Walker {
|
|
|
3493
3399
|
*
|
|
3494
3400
|
* **Example** (Visiting walker elements)
|
|
3495
3401
|
*
|
|
3496
|
-
* ```ts
|
|
3402
|
+
* ```ts import.meta.vitest
|
|
3497
3403
|
* import { Graph } from "effect"
|
|
3498
3404
|
*
|
|
3499
3405
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3505,14 +3411,10 @@ export class Walker {
|
|
|
3505
3411
|
* const dfs = Graph.dfs(graph, { start: [0] })
|
|
3506
3412
|
*
|
|
3507
3413
|
* // Map to just the node data
|
|
3508
|
-
*
|
|
3509
|
-
* console.log(values) // ["A", "B"]
|
|
3414
|
+
* Array.from(dfs.visit((index, data) => data)) // => ["A", "B"]
|
|
3510
3415
|
*
|
|
3511
3416
|
* // Map to custom objects
|
|
3512
|
-
*
|
|
3513
|
-
* dfs.visit((index, data) => ({ id: index, name: data }))
|
|
3514
|
-
* )
|
|
3515
|
-
* console.log(custom) // [{ id: 0, name: "A" }, { id: 1, name: "B" }]
|
|
3417
|
+
* Array.from(dfs.visit((index, data) => ({ id: index, name: data }))) // => [{ id: 0, name: "A" }, { id: 1, name: "B" }]
|
|
3516
3418
|
* ```
|
|
3517
3419
|
*
|
|
3518
3420
|
* @since 4.0.0
|
|
@@ -3528,7 +3430,7 @@ export class Walker {
|
|
|
3528
3430
|
*
|
|
3529
3431
|
* **Example** (Visiting walker elements)
|
|
3530
3432
|
*
|
|
3531
|
-
* ```ts
|
|
3433
|
+
* ```ts import.meta.vitest
|
|
3532
3434
|
* import { Graph } from "effect"
|
|
3533
3435
|
*
|
|
3534
3436
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3540,14 +3442,10 @@ export class Walker {
|
|
|
3540
3442
|
* const dfs = Graph.dfs(graph, { start: [0] })
|
|
3541
3443
|
*
|
|
3542
3444
|
* // Map to just the node data
|
|
3543
|
-
*
|
|
3544
|
-
* console.log(values) // ["A", "B"]
|
|
3445
|
+
* Array.from(dfs.visit((index, data) => data)) // => ["A", "B"]
|
|
3545
3446
|
*
|
|
3546
3447
|
* // Map to custom objects
|
|
3547
|
-
*
|
|
3548
|
-
* dfs.visit((index, data) => ({ id: index, name: data }))
|
|
3549
|
-
* )
|
|
3550
|
-
* console.log(custom) // [{ id: 0, name: "A" }, { id: 1, name: "B" }]
|
|
3448
|
+
* Array.from(dfs.visit((index, data) => ({ id: index, name: data }))) // => [{ id: 0, name: "A" }, { id: 1, name: "B" }]
|
|
3551
3449
|
* ```
|
|
3552
3450
|
*
|
|
3553
3451
|
* @category iterators
|
|
@@ -3563,7 +3461,7 @@ export class Walker {
|
|
|
3563
3461
|
*
|
|
3564
3462
|
* **Example** (Iterating walker indices)
|
|
3565
3463
|
*
|
|
3566
|
-
* ```ts
|
|
3464
|
+
* ```ts import.meta.vitest
|
|
3567
3465
|
* import { Graph } from "effect"
|
|
3568
3466
|
*
|
|
3569
3467
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3573,8 +3471,7 @@ export class Walker {
|
|
|
3573
3471
|
* })
|
|
3574
3472
|
*
|
|
3575
3473
|
* const dfs = Graph.dfs(graph, { start: [0] })
|
|
3576
|
-
*
|
|
3577
|
-
* console.log(indices) // [0, 1]
|
|
3474
|
+
* Array.from(Graph.indices(dfs)) // => [0, 1]
|
|
3578
3475
|
* ```
|
|
3579
3476
|
*
|
|
3580
3477
|
* @category iterators
|
|
@@ -3586,7 +3483,7 @@ export const indices = walker => walker.visit((index, _) => index);
|
|
|
3586
3483
|
*
|
|
3587
3484
|
* **Example** (Iterating walker values)
|
|
3588
3485
|
*
|
|
3589
|
-
* ```ts
|
|
3486
|
+
* ```ts import.meta.vitest
|
|
3590
3487
|
* import { Graph } from "effect"
|
|
3591
3488
|
*
|
|
3592
3489
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3596,8 +3493,7 @@ export const indices = walker => walker.visit((index, _) => index);
|
|
|
3596
3493
|
* })
|
|
3597
3494
|
*
|
|
3598
3495
|
* const dfs = Graph.dfs(graph, { start: [0] })
|
|
3599
|
-
*
|
|
3600
|
-
* console.log(values) // ["A", "B"]
|
|
3496
|
+
* Array.from(Graph.values(dfs)) // => ["A", "B"]
|
|
3601
3497
|
* ```
|
|
3602
3498
|
*
|
|
3603
3499
|
* @category iterators
|
|
@@ -3609,7 +3505,7 @@ export const values = walker => walker.visit((_, data) => data);
|
|
|
3609
3505
|
*
|
|
3610
3506
|
* **Example** (Iterating walker entries)
|
|
3611
3507
|
*
|
|
3612
|
-
* ```ts
|
|
3508
|
+
* ```ts import.meta.vitest
|
|
3613
3509
|
* import { Graph } from "effect"
|
|
3614
3510
|
*
|
|
3615
3511
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3619,8 +3515,7 @@ export const values = walker => walker.visit((_, data) => data);
|
|
|
3619
3515
|
* })
|
|
3620
3516
|
*
|
|
3621
3517
|
* const dfs = Graph.dfs(graph, { start: [0] })
|
|
3622
|
-
*
|
|
3623
|
-
* console.log(entries) // [[0, "A"], [1, "B"]]
|
|
3518
|
+
* Array.from(Graph.entries(dfs)) // => [[0, "A"], [1, "B"]]
|
|
3624
3519
|
* ```
|
|
3625
3520
|
*
|
|
3626
3521
|
* @category iterators
|
|
@@ -3640,7 +3535,7 @@ export const entries = walker => walker.visit((index, data) => [index, data]);
|
|
|
3640
3535
|
*
|
|
3641
3536
|
* **Example** (Traversing depth-first)
|
|
3642
3537
|
*
|
|
3643
|
-
* ```ts
|
|
3538
|
+
* ```ts import.meta.vitest
|
|
3644
3539
|
* import { Graph } from "effect"
|
|
3645
3540
|
*
|
|
3646
3541
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3652,14 +3547,10 @@ export const entries = walker => walker.visit((index, data) => [index, data]);
|
|
|
3652
3547
|
* })
|
|
3653
3548
|
*
|
|
3654
3549
|
* // Start from a specific node
|
|
3655
|
-
*
|
|
3656
|
-
* for (const nodeIndex of Graph.indices(dfs1)) {
|
|
3657
|
-
* console.log(nodeIndex) // Traverses in DFS order: 0, 1, 2
|
|
3658
|
-
* }
|
|
3550
|
+
* Array.from(Graph.indices(Graph.dfs(graph, { start: [0] }))) // => [0, 1, 2]
|
|
3659
3551
|
*
|
|
3660
3552
|
* // Empty iterator (no starting nodes)
|
|
3661
|
-
*
|
|
3662
|
-
* // Can be used programmatically
|
|
3553
|
+
* Graph.dfs(graph)
|
|
3663
3554
|
* ```
|
|
3664
3555
|
*
|
|
3665
3556
|
* @category iterators
|
|
@@ -3761,7 +3652,7 @@ export const dfs = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, config =
|
|
|
3761
3652
|
*
|
|
3762
3653
|
* **Example** (Traversing breadth-first)
|
|
3763
3654
|
*
|
|
3764
|
-
* ```ts
|
|
3655
|
+
* ```ts import.meta.vitest
|
|
3765
3656
|
* import { Graph } from "effect"
|
|
3766
3657
|
*
|
|
3767
3658
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3773,14 +3664,10 @@ export const dfs = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, config =
|
|
|
3773
3664
|
* })
|
|
3774
3665
|
*
|
|
3775
3666
|
* // Start from a specific node
|
|
3776
|
-
*
|
|
3777
|
-
* for (const nodeIndex of Graph.indices(bfs1)) {
|
|
3778
|
-
* console.log(nodeIndex) // Traverses in BFS order: 0, 1, 2
|
|
3779
|
-
* }
|
|
3667
|
+
* Array.from(Graph.indices(Graph.bfs(graph, { start: [0] }))) // => [0, 1, 2]
|
|
3780
3668
|
*
|
|
3781
3669
|
* // Empty iterator (no starting nodes)
|
|
3782
|
-
*
|
|
3783
|
-
* // Can be used programmatically
|
|
3670
|
+
* Graph.bfs(graph)
|
|
3784
3671
|
* ```
|
|
3785
3672
|
*
|
|
3786
3673
|
* @category iterators
|
|
@@ -3844,7 +3731,7 @@ export const bfs = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, config =
|
|
|
3844
3731
|
*
|
|
3845
3732
|
* **Example** (Sorting topologically)
|
|
3846
3733
|
*
|
|
3847
|
-
* ```ts
|
|
3734
|
+
* ```ts import.meta.vitest
|
|
3848
3735
|
* import { Graph } from "effect"
|
|
3849
3736
|
*
|
|
3850
3737
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3856,13 +3743,10 @@ export const bfs = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, config =
|
|
|
3856
3743
|
* })
|
|
3857
3744
|
*
|
|
3858
3745
|
* // Standard topological sort
|
|
3859
|
-
*
|
|
3860
|
-
* for (const nodeIndex of Graph.indices(topo1)) {
|
|
3861
|
-
* console.log(nodeIndex) // 0, 1, 2 (topological order)
|
|
3862
|
-
* }
|
|
3746
|
+
* Array.from(Graph.indices(Graph.topo(graph))) // => [0, 1, 2]
|
|
3863
3747
|
*
|
|
3864
3748
|
* // With initial nodes
|
|
3865
|
-
*
|
|
3749
|
+
* Graph.topo(graph, { initials: [0] })
|
|
3866
3750
|
*
|
|
3867
3751
|
* // Check before sorting a cyclic graph
|
|
3868
3752
|
* const cyclicGraph = Graph.directed<string, number>((mutable) => {
|
|
@@ -3872,9 +3756,7 @@ export const bfs = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, config =
|
|
|
3872
3756
|
* Graph.addEdge(mutable, b, a, 2) // Creates cycle
|
|
3873
3757
|
* })
|
|
3874
3758
|
*
|
|
3875
|
-
*
|
|
3876
|
-
* console.log("cyclic graph") // cyclic graph
|
|
3877
|
-
* }
|
|
3759
|
+
* Graph.isAcyclic(cyclicGraph) // => false
|
|
3878
3760
|
* ```
|
|
3879
3761
|
*
|
|
3880
3762
|
* @category iterators
|
|
@@ -3992,7 +3874,7 @@ export const topo = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, config =
|
|
|
3992
3874
|
*
|
|
3993
3875
|
* **Example** (Traversing in postorder)
|
|
3994
3876
|
*
|
|
3995
|
-
* ```ts
|
|
3877
|
+
* ```ts import.meta.vitest
|
|
3996
3878
|
* import { Graph } from "effect"
|
|
3997
3879
|
*
|
|
3998
3880
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -4004,10 +3886,7 @@ export const topo = /*#__PURE__*/dual(args => isGraph(args[0]), (graph, config =
|
|
|
4004
3886
|
* })
|
|
4005
3887
|
*
|
|
4006
3888
|
* // Postorder: children before parents
|
|
4007
|
-
*
|
|
4008
|
-
* for (const node of postOrder) {
|
|
4009
|
-
* console.log(node) // 1, 2, 0
|
|
4010
|
-
* }
|
|
3889
|
+
* Array.from(Graph.indices(Graph.dfsPostOrder(graph, { start: [0] }))) // => [1, 2, 0]
|
|
4011
3890
|
* ```
|
|
4012
3891
|
*
|
|
4013
3892
|
* @category iterators
|
|
@@ -4095,7 +3974,7 @@ export const dfsPostOrder = /*#__PURE__*/dual(args => isGraph(args[0]), (graph,
|
|
|
4095
3974
|
*
|
|
4096
3975
|
* **Example** (Iterating all nodes)
|
|
4097
3976
|
*
|
|
4098
|
-
* ```ts
|
|
3977
|
+
* ```ts import.meta.vitest
|
|
4099
3978
|
* import { Graph } from "effect"
|
|
4100
3979
|
*
|
|
4101
3980
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -4105,8 +3984,7 @@ export const dfsPostOrder = /*#__PURE__*/dual(args => isGraph(args[0]), (graph,
|
|
|
4105
3984
|
* Graph.addEdge(mutable, a, b, 1)
|
|
4106
3985
|
* })
|
|
4107
3986
|
*
|
|
4108
|
-
*
|
|
4109
|
-
* console.log(indices) // [0, 1, 2]
|
|
3987
|
+
* Array.from(Graph.indices(Graph.nodes(graph))) // => [0, 1, 2]
|
|
4110
3988
|
* ```
|
|
4111
3989
|
*
|
|
4112
3990
|
* @category iterators
|
|
@@ -4144,7 +4022,7 @@ export const nodes = graph => new Walker(f => ({
|
|
|
4144
4022
|
*
|
|
4145
4023
|
* **Example** (Iterating all edges)
|
|
4146
4024
|
*
|
|
4147
|
-
* ```ts
|
|
4025
|
+
* ```ts import.meta.vitest
|
|
4148
4026
|
* import { Graph } from "effect"
|
|
4149
4027
|
*
|
|
4150
4028
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -4155,8 +4033,7 @@ export const nodes = graph => new Walker(f => ({
|
|
|
4155
4033
|
* Graph.addEdge(mutable, b, c, 2)
|
|
4156
4034
|
* })
|
|
4157
4035
|
*
|
|
4158
|
-
*
|
|
4159
|
-
* console.log(indices) // [0, 1]
|
|
4036
|
+
* Array.from(Graph.indices(Graph.edges(graph))) // => [0, 1]
|
|
4160
4037
|
* ```
|
|
4161
4038
|
*
|
|
4162
4039
|
* @category iterators
|
|
@@ -4195,7 +4072,7 @@ export const edges = graph => new Walker(f => ({
|
|
|
4195
4072
|
*
|
|
4196
4073
|
* **Example** (Iterating external nodes)
|
|
4197
4074
|
*
|
|
4198
|
-
* ```ts
|
|
4075
|
+
* ```ts import.meta.vitest
|
|
4199
4076
|
* import { Graph } from "effect"
|
|
4200
4077
|
*
|
|
4201
4078
|
* const graph = Graph.directed<string, number>((mutable) => {
|
|
@@ -4209,16 +4086,10 @@ export const edges = graph => new Walker(f => ({
|
|
|
4209
4086
|
* })
|
|
4210
4087
|
*
|
|
4211
4088
|
* // Nodes with no outgoing edges (sinks + isolated)
|
|
4212
|
-
*
|
|
4213
|
-
* Graph.indices(Graph.externals(graph, { direction: "outgoing" }))
|
|
4214
|
-
* )
|
|
4215
|
-
* console.log(sinks) // [2, 3]
|
|
4089
|
+
* Array.from(Graph.indices(Graph.externals(graph, { direction: "outgoing" }))) // => [2, 3]
|
|
4216
4090
|
*
|
|
4217
4091
|
* // Nodes with no incoming edges (sources + isolated)
|
|
4218
|
-
*
|
|
4219
|
-
* Graph.indices(Graph.externals(graph, { direction: "incoming" }))
|
|
4220
|
-
* )
|
|
4221
|
-
* console.log(sources) // [0, 3]
|
|
4092
|
+
* Array.from(Graph.indices(Graph.externals(graph, { direction: "incoming" }))) // => [0, 3]
|
|
4222
4093
|
* ```
|
|
4223
4094
|
*
|
|
4224
4095
|
* @category iterators
|