effect 4.0.0-beta.67 → 4.0.0-beta.69

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.
Files changed (1196) hide show
  1. package/dist/Array.d.ts +41 -42
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +23 -23
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +265 -265
  6. package/dist/BigDecimal.js +128 -128
  7. package/dist/BigInt.d.ts +175 -177
  8. package/dist/BigInt.d.ts.map +1 -1
  9. package/dist/BigInt.js +81 -79
  10. package/dist/BigInt.js.map +1 -1
  11. package/dist/Boolean.d.ts +127 -125
  12. package/dist/Boolean.d.ts.map +1 -1
  13. package/dist/Boolean.js +55 -53
  14. package/dist/Boolean.js.map +1 -1
  15. package/dist/Brand.d.ts +10 -4
  16. package/dist/Brand.d.ts.map +1 -1
  17. package/dist/Brand.js +3 -2
  18. package/dist/Brand.js.map +1 -1
  19. package/dist/Cache.d.ts +36 -36
  20. package/dist/Cache.js +17 -17
  21. package/dist/Cause.d.ts +17 -18
  22. package/dist/Cause.d.ts.map +1 -1
  23. package/dist/Cause.js +12 -12
  24. package/dist/Cause.js.map +1 -1
  25. package/dist/Channel.d.ts +234 -241
  26. package/dist/Channel.d.ts.map +1 -1
  27. package/dist/Channel.js +98 -102
  28. package/dist/Channel.js.map +1 -1
  29. package/dist/Chunk.d.ts +33 -56
  30. package/dist/Chunk.d.ts.map +1 -1
  31. package/dist/Chunk.js +17 -26
  32. package/dist/Chunk.js.map +1 -1
  33. package/dist/Clock.d.ts +1 -1
  34. package/dist/Clock.js +1 -1
  35. package/dist/Combiner.d.ts +9 -1
  36. package/dist/Combiner.d.ts.map +1 -1
  37. package/dist/Combiner.js +8 -0
  38. package/dist/Combiner.js.map +1 -1
  39. package/dist/Config.d.ts +78 -68
  40. package/dist/Config.d.ts.map +1 -1
  41. package/dist/Config.js +53 -49
  42. package/dist/Config.js.map +1 -1
  43. package/dist/ConfigProvider.d.ts +33 -32
  44. package/dist/ConfigProvider.d.ts.map +1 -1
  45. package/dist/ConfigProvider.js +19 -18
  46. package/dist/ConfigProvider.js.map +1 -1
  47. package/dist/Console.d.ts +19 -19
  48. package/dist/Console.js +19 -19
  49. package/dist/Context.d.ts +70 -108
  50. package/dist/Context.d.ts.map +1 -1
  51. package/dist/Context.js +30 -44
  52. package/dist/Context.js.map +1 -1
  53. package/dist/Cron.d.ts +3 -5
  54. package/dist/Cron.d.ts.map +1 -1
  55. package/dist/Cron.js +3 -5
  56. package/dist/Cron.js.map +1 -1
  57. package/dist/Crypto.d.ts +208 -0
  58. package/dist/Crypto.d.ts.map +1 -0
  59. package/dist/Crypto.js +157 -0
  60. package/dist/Crypto.js.map +1 -0
  61. package/dist/Data.d.ts +6 -1
  62. package/dist/Data.d.ts.map +1 -1
  63. package/dist/Data.js.map +1 -1
  64. package/dist/DateTime.d.ts +29 -31
  65. package/dist/DateTime.d.ts.map +1 -1
  66. package/dist/DateTime.js +19 -19
  67. package/dist/DateTime.js.map +1 -1
  68. package/dist/Deferred.d.ts +8 -9
  69. package/dist/Deferred.d.ts.map +1 -1
  70. package/dist/Deferred.js +6 -6
  71. package/dist/Deferred.js.map +1 -1
  72. package/dist/Differ.d.ts +2 -2
  73. package/dist/Duration.d.ts +30 -27
  74. package/dist/Duration.d.ts.map +1 -1
  75. package/dist/Duration.js +15 -12
  76. package/dist/Duration.js.map +1 -1
  77. package/dist/Effect.d.ts +879 -1137
  78. package/dist/Effect.d.ts.map +1 -1
  79. package/dist/Effect.js +375 -465
  80. package/dist/Effect.js.map +1 -1
  81. package/dist/Effectable.d.ts +2 -2
  82. package/dist/Effectable.js +2 -2
  83. package/dist/Encoding.d.ts +9 -9
  84. package/dist/Encoding.js +9 -9
  85. package/dist/Equal.d.ts +4 -3
  86. package/dist/Equal.d.ts.map +1 -1
  87. package/dist/Equal.js +4 -3
  88. package/dist/Equal.js.map +1 -1
  89. package/dist/Equivalence.d.ts +4 -5
  90. package/dist/Equivalence.d.ts.map +1 -1
  91. package/dist/Equivalence.js +2 -2
  92. package/dist/Equivalence.js.map +1 -1
  93. package/dist/ErrorReporter.d.ts +14 -14
  94. package/dist/ErrorReporter.js +9 -9
  95. package/dist/ExecutionPlan.d.ts +18 -9
  96. package/dist/ExecutionPlan.d.ts.map +1 -1
  97. package/dist/ExecutionPlan.js +6 -4
  98. package/dist/ExecutionPlan.js.map +1 -1
  99. package/dist/Exit.d.ts +0 -1
  100. package/dist/Exit.d.ts.map +1 -1
  101. package/dist/Exit.js.map +1 -1
  102. package/dist/Fiber.d.ts +1 -2
  103. package/dist/Fiber.d.ts.map +1 -1
  104. package/dist/Fiber.js +1 -1
  105. package/dist/Fiber.js.map +1 -1
  106. package/dist/FiberHandle.d.ts +5 -5
  107. package/dist/FiberHandle.js +3 -3
  108. package/dist/FiberMap.d.ts +10 -10
  109. package/dist/FiberMap.js +4 -4
  110. package/dist/FiberSet.d.ts +4 -4
  111. package/dist/FiberSet.js +2 -2
  112. package/dist/FileSystem.d.ts +10 -12
  113. package/dist/FileSystem.d.ts.map +1 -1
  114. package/dist/FileSystem.js +3 -3
  115. package/dist/FileSystem.js.map +1 -1
  116. package/dist/Filter.d.ts +54 -54
  117. package/dist/Filter.js +28 -28
  118. package/dist/Formatter.d.ts +4 -2
  119. package/dist/Formatter.d.ts.map +1 -1
  120. package/dist/Formatter.js +3 -69
  121. package/dist/Formatter.js.map +1 -1
  122. package/dist/Function.d.ts +64 -65
  123. package/dist/Function.d.ts.map +1 -1
  124. package/dist/Function.js +41 -41
  125. package/dist/Function.js.map +1 -1
  126. package/dist/Graph.d.ts +157 -175
  127. package/dist/Graph.d.ts.map +1 -1
  128. package/dist/Graph.js +72 -80
  129. package/dist/Graph.js.map +1 -1
  130. package/dist/Hash.d.ts +4 -6
  131. package/dist/Hash.d.ts.map +1 -1
  132. package/dist/Hash.js +2 -2
  133. package/dist/Hash.js.map +1 -1
  134. package/dist/HashMap.d.ts +121 -157
  135. package/dist/HashMap.d.ts.map +1 -1
  136. package/dist/HashMap.js +47 -59
  137. package/dist/HashMap.js.map +1 -1
  138. package/dist/HashRing.d.ts +34 -34
  139. package/dist/HashRing.js +16 -16
  140. package/dist/HashSet.d.ts +51 -55
  141. package/dist/HashSet.d.ts.map +1 -1
  142. package/dist/HashSet.js +19 -20
  143. package/dist/HashSet.js.map +1 -1
  144. package/dist/Inspectable.d.ts +6 -4
  145. package/dist/Inspectable.d.ts.map +1 -1
  146. package/dist/Inspectable.js +6 -4
  147. package/dist/Inspectable.js.map +1 -1
  148. package/dist/Iterable.d.ts +37 -83
  149. package/dist/Iterable.d.ts.map +1 -1
  150. package/dist/Iterable.js +21 -39
  151. package/dist/Iterable.js.map +1 -1
  152. package/dist/JsonPatch.d.ts +8 -6
  153. package/dist/JsonPatch.d.ts.map +1 -1
  154. package/dist/JsonPatch.js +5 -3
  155. package/dist/JsonPatch.js.map +1 -1
  156. package/dist/JsonPointer.d.ts +13 -11
  157. package/dist/JsonPointer.d.ts.map +1 -1
  158. package/dist/JsonPointer.js +13 -11
  159. package/dist/JsonPointer.js.map +1 -1
  160. package/dist/JsonSchema.d.ts +16 -0
  161. package/dist/JsonSchema.d.ts.map +1 -1
  162. package/dist/JsonSchema.js +10 -0
  163. package/dist/JsonSchema.js.map +1 -1
  164. package/dist/Latch.d.ts +4 -16
  165. package/dist/Latch.d.ts.map +1 -1
  166. package/dist/Latch.js +2 -14
  167. package/dist/Latch.js.map +1 -1
  168. package/dist/Layer.d.ts +94 -135
  169. package/dist/Layer.d.ts.map +1 -1
  170. package/dist/Layer.js +44 -61
  171. package/dist/Layer.js.map +1 -1
  172. package/dist/LayerMap.d.ts +15 -16
  173. package/dist/LayerMap.d.ts.map +1 -1
  174. package/dist/LayerMap.js +6 -6
  175. package/dist/LogLevel.d.ts +13 -13
  176. package/dist/LogLevel.js +4 -4
  177. package/dist/Logger.d.ts +10 -11
  178. package/dist/Logger.d.ts.map +1 -1
  179. package/dist/Logger.js +10 -11
  180. package/dist/Logger.js.map +1 -1
  181. package/dist/ManagedRuntime.d.ts +5 -4
  182. package/dist/ManagedRuntime.d.ts.map +1 -1
  183. package/dist/ManagedRuntime.js +4 -3
  184. package/dist/ManagedRuntime.js.map +1 -1
  185. package/dist/Match.d.ts +2 -4
  186. package/dist/Match.d.ts.map +1 -1
  187. package/dist/Match.js +1 -2
  188. package/dist/Match.js.map +1 -1
  189. package/dist/Metric.d.ts +48 -50
  190. package/dist/Metric.d.ts.map +1 -1
  191. package/dist/Metric.js +22 -22
  192. package/dist/Metric.js.map +1 -1
  193. package/dist/MutableHashMap.d.ts +30 -30
  194. package/dist/MutableHashMap.d.ts.map +1 -1
  195. package/dist/MutableHashMap.js +15 -14
  196. package/dist/MutableHashMap.js.map +1 -1
  197. package/dist/MutableHashSet.d.ts.map +1 -1
  198. package/dist/MutableHashSet.js +0 -2
  199. package/dist/MutableHashSet.js.map +1 -1
  200. package/dist/MutableList.d.ts +23 -24
  201. package/dist/MutableList.d.ts.map +1 -1
  202. package/dist/MutableList.js +17 -19
  203. package/dist/MutableList.js.map +1 -1
  204. package/dist/MutableRef.d.ts.map +1 -1
  205. package/dist/MutableRef.js +0 -1
  206. package/dist/MutableRef.js.map +1 -1
  207. package/dist/Newtype.d.ts +12 -2
  208. package/dist/Newtype.d.ts.map +1 -1
  209. package/dist/Newtype.js +8 -2
  210. package/dist/Newtype.js.map +1 -1
  211. package/dist/NonEmptyIterable.d.ts +5 -12
  212. package/dist/NonEmptyIterable.d.ts.map +1 -1
  213. package/dist/NonEmptyIterable.js +3 -8
  214. package/dist/NonEmptyIterable.js.map +1 -1
  215. package/dist/Number.d.ts +145 -141
  216. package/dist/Number.d.ts.map +1 -1
  217. package/dist/Number.js +65 -61
  218. package/dist/Number.js.map +1 -1
  219. package/dist/Optic.d.ts +5 -5
  220. package/dist/Optic.js +5 -5
  221. package/dist/Option.d.ts +105 -109
  222. package/dist/Option.d.ts.map +1 -1
  223. package/dist/Option.js +50 -52
  224. package/dist/Option.js.map +1 -1
  225. package/dist/Order.d.ts +6 -6
  226. package/dist/Order.js +6 -6
  227. package/dist/Ordering.d.ts +15 -19
  228. package/dist/Ordering.d.ts.map +1 -1
  229. package/dist/Ordering.js +6 -6
  230. package/dist/Ordering.js.map +1 -1
  231. package/dist/PartitionedSemaphore.d.ts +3 -3
  232. package/dist/PartitionedSemaphore.js +2 -2
  233. package/dist/Path.d.ts +4 -4
  234. package/dist/Path.d.ts.map +1 -1
  235. package/dist/Path.js +2 -1
  236. package/dist/Path.js.map +1 -1
  237. package/dist/Pipeable.d.ts +10 -7
  238. package/dist/Pipeable.d.ts.map +1 -1
  239. package/dist/Pipeable.js +6 -4
  240. package/dist/Pipeable.js.map +1 -1
  241. package/dist/PlatformError.d.ts +3 -3
  242. package/dist/PlatformError.js +2 -2
  243. package/dist/Predicate.d.ts +2 -4
  244. package/dist/Predicate.d.ts.map +1 -1
  245. package/dist/Predicate.js +3 -3
  246. package/dist/Predicate.js.map +1 -1
  247. package/dist/PrimaryKey.d.ts +2 -1
  248. package/dist/PrimaryKey.d.ts.map +1 -1
  249. package/dist/PrimaryKey.js +2 -1
  250. package/dist/PrimaryKey.js.map +1 -1
  251. package/dist/PubSub.d.ts +25 -51
  252. package/dist/PubSub.d.ts.map +1 -1
  253. package/dist/PubSub.js +17 -35
  254. package/dist/PubSub.js.map +1 -1
  255. package/dist/Queue.d.ts +45 -60
  256. package/dist/Queue.d.ts.map +1 -1
  257. package/dist/Queue.js +27 -33
  258. package/dist/Queue.js.map +1 -1
  259. package/dist/Random.d.ts +27 -38
  260. package/dist/Random.d.ts.map +1 -1
  261. package/dist/Random.js +17 -54
  262. package/dist/Random.js.map +1 -1
  263. package/dist/RcMap.d.ts +11 -11
  264. package/dist/RcMap.js +3 -3
  265. package/dist/RcRef.d.ts +0 -1
  266. package/dist/RcRef.d.ts.map +1 -1
  267. package/dist/RcRef.js.map +1 -1
  268. package/dist/Record.d.ts +9 -8
  269. package/dist/Record.d.ts.map +1 -1
  270. package/dist/Record.js +7 -5
  271. package/dist/Record.js.map +1 -1
  272. package/dist/Redactable.d.ts +7 -5
  273. package/dist/Redactable.d.ts.map +1 -1
  274. package/dist/Redactable.js +5 -3
  275. package/dist/Redactable.js.map +1 -1
  276. package/dist/Redacted.d.ts +2 -3
  277. package/dist/Redacted.d.ts.map +1 -1
  278. package/dist/Redacted.js +2 -2
  279. package/dist/Redacted.js.map +1 -1
  280. package/dist/Reducer.d.ts +3 -1
  281. package/dist/Reducer.d.ts.map +1 -1
  282. package/dist/Reducer.js +2 -0
  283. package/dist/Reducer.js.map +1 -1
  284. package/dist/Ref.d.ts +7 -17
  285. package/dist/Ref.d.ts.map +1 -1
  286. package/dist/Ref.js +5 -12
  287. package/dist/Ref.js.map +1 -1
  288. package/dist/RegExp.d.ts +1 -1
  289. package/dist/RegExp.js +1 -1
  290. package/dist/Request.d.ts +2 -1
  291. package/dist/Request.d.ts.map +1 -1
  292. package/dist/Request.js +1 -0
  293. package/dist/Request.js.map +1 -1
  294. package/dist/RequestResolver.d.ts +2 -3
  295. package/dist/RequestResolver.d.ts.map +1 -1
  296. package/dist/RequestResolver.js +1 -1
  297. package/dist/RequestResolver.js.map +1 -1
  298. package/dist/Resource.d.ts +1 -1
  299. package/dist/Resource.js +1 -1
  300. package/dist/Result.d.ts +124 -142
  301. package/dist/Result.d.ts.map +1 -1
  302. package/dist/Result.js +51 -63
  303. package/dist/Result.js.map +1 -1
  304. package/dist/Runtime.d.ts +2 -7
  305. package/dist/Runtime.d.ts.map +1 -1
  306. package/dist/Runtime.js +1 -3
  307. package/dist/Runtime.js.map +1 -1
  308. package/dist/Schedule.d.ts +69 -72
  309. package/dist/Schedule.d.ts.map +1 -1
  310. package/dist/Schedule.js +31 -33
  311. package/dist/Schedule.js.map +1 -1
  312. package/dist/Scheduler.d.ts +2 -2
  313. package/dist/Scheduler.js +2 -2
  314. package/dist/Schema.d.ts +491 -321
  315. package/dist/Schema.d.ts.map +1 -1
  316. package/dist/Schema.js +220 -172
  317. package/dist/Schema.js.map +1 -1
  318. package/dist/SchemaAST.d.ts +98 -77
  319. package/dist/SchemaAST.d.ts.map +1 -1
  320. package/dist/SchemaAST.js +89 -68
  321. package/dist/SchemaAST.js.map +1 -1
  322. package/dist/SchemaGetter.d.ts +23 -23
  323. package/dist/SchemaGetter.js +20 -20
  324. package/dist/SchemaIssue.d.ts +18 -16
  325. package/dist/SchemaIssue.d.ts.map +1 -1
  326. package/dist/SchemaIssue.js +16 -14
  327. package/dist/SchemaIssue.js.map +1 -1
  328. package/dist/SchemaParser.d.ts +39 -40
  329. package/dist/SchemaParser.d.ts.map +1 -1
  330. package/dist/SchemaParser.js +48 -51
  331. package/dist/SchemaParser.js.map +1 -1
  332. package/dist/SchemaRepresentation.d.ts +89 -77
  333. package/dist/SchemaRepresentation.d.ts.map +1 -1
  334. package/dist/SchemaRepresentation.js +47 -37
  335. package/dist/SchemaRepresentation.js.map +1 -1
  336. package/dist/SchemaTransformation.d.ts +36 -5
  337. package/dist/SchemaTransformation.d.ts.map +1 -1
  338. package/dist/SchemaTransformation.js +33 -5
  339. package/dist/SchemaTransformation.js.map +1 -1
  340. package/dist/SchemaUtils.d.ts +1 -1
  341. package/dist/SchemaUtils.js +1 -1
  342. package/dist/Scope.d.ts +12 -29
  343. package/dist/Scope.d.ts.map +1 -1
  344. package/dist/Scope.js +6 -11
  345. package/dist/Scope.js.map +1 -1
  346. package/dist/ScopedCache.d.ts +37 -37
  347. package/dist/ScopedCache.js +17 -17
  348. package/dist/Semaphore.d.ts +4 -16
  349. package/dist/Semaphore.d.ts.map +1 -1
  350. package/dist/Semaphore.js +2 -14
  351. package/dist/Semaphore.js.map +1 -1
  352. package/dist/Sink.d.ts +36 -39
  353. package/dist/Sink.d.ts.map +1 -1
  354. package/dist/Sink.js +18 -18
  355. package/dist/Sink.js.map +1 -1
  356. package/dist/Stdio.d.ts +6 -6
  357. package/dist/Stdio.js +4 -4
  358. package/dist/Stream.d.ts +671 -808
  359. package/dist/Stream.d.ts.map +1 -1
  360. package/dist/Stream.js +289 -363
  361. package/dist/Stream.js.map +1 -1
  362. package/dist/String.d.ts +3 -2
  363. package/dist/String.d.ts.map +1 -1
  364. package/dist/String.js +3 -2
  365. package/dist/String.js.map +1 -1
  366. package/dist/Struct.d.ts +20 -18
  367. package/dist/Struct.d.ts.map +1 -1
  368. package/dist/Struct.js +10 -8
  369. package/dist/Struct.js.map +1 -1
  370. package/dist/SubscriptionRef.d.ts +2 -2
  371. package/dist/SubscriptionRef.js +2 -2
  372. package/dist/Symbol.d.ts +3 -3
  373. package/dist/Symbol.js +3 -3
  374. package/dist/SynchronizedRef.d.ts +1 -1
  375. package/dist/SynchronizedRef.js +1 -1
  376. package/dist/Take.d.ts +2 -2
  377. package/dist/Take.js +1 -1
  378. package/dist/Terminal.d.ts +5 -5
  379. package/dist/Terminal.js +2 -2
  380. package/dist/Tracer.d.ts +9 -9
  381. package/dist/Tracer.js +2 -2
  382. package/dist/Trie.d.ts +70 -106
  383. package/dist/Trie.d.ts.map +1 -1
  384. package/dist/Trie.js +29 -43
  385. package/dist/Trie.js.map +1 -1
  386. package/dist/Tuple.d.ts +34 -32
  387. package/dist/Tuple.d.ts.map +1 -1
  388. package/dist/Tuple.js +16 -14
  389. package/dist/Tuple.js.map +1 -1
  390. package/dist/TxChunk.d.ts +27 -18
  391. package/dist/TxChunk.d.ts.map +1 -1
  392. package/dist/TxChunk.js +15 -10
  393. package/dist/TxChunk.js.map +1 -1
  394. package/dist/TxDeferred.d.ts +11 -11
  395. package/dist/TxDeferred.js +5 -5
  396. package/dist/TxHashMap.d.ts +60 -61
  397. package/dist/TxHashMap.d.ts.map +1 -1
  398. package/dist/TxHashMap.js +23 -23
  399. package/dist/TxHashMap.js.map +1 -1
  400. package/dist/TxHashSet.d.ts +28 -32
  401. package/dist/TxHashSet.d.ts.map +1 -1
  402. package/dist/TxHashSet.js +13 -16
  403. package/dist/TxHashSet.js.map +1 -1
  404. package/dist/TxPriorityQueue.d.ts +30 -30
  405. package/dist/TxPriorityQueue.js +18 -18
  406. package/dist/TxPubSub.d.ts +18 -18
  407. package/dist/TxPubSub.js +14 -14
  408. package/dist/TxQueue.d.ts +26 -29
  409. package/dist/TxQueue.d.ts.map +1 -1
  410. package/dist/TxQueue.js +17 -17
  411. package/dist/TxQueue.js.map +1 -1
  412. package/dist/TxReentrantLock.d.ts +21 -21
  413. package/dist/TxReentrantLock.js +15 -15
  414. package/dist/TxRef.d.ts +24 -24
  415. package/dist/TxRef.js +11 -11
  416. package/dist/TxSemaphore.d.ts +13 -74
  417. package/dist/TxSemaphore.d.ts.map +1 -1
  418. package/dist/TxSemaphore.js +9 -52
  419. package/dist/TxSemaphore.js.map +1 -1
  420. package/dist/TxSubscriptionRef.d.ts +24 -24
  421. package/dist/TxSubscriptionRef.js +11 -11
  422. package/dist/Types.d.ts +1 -4
  423. package/dist/Types.d.ts.map +1 -1
  424. package/dist/UndefinedOr.d.ts +14 -0
  425. package/dist/UndefinedOr.d.ts.map +1 -1
  426. package/dist/UndefinedOr.js +8 -0
  427. package/dist/UndefinedOr.js.map +1 -1
  428. package/dist/Unify.d.ts +8 -8
  429. package/dist/Unify.js +1 -1
  430. package/dist/Utils.d.ts +1 -2
  431. package/dist/Utils.d.ts.map +1 -1
  432. package/dist/Utils.js.map +1 -1
  433. package/dist/index.d.ts +1934 -436
  434. package/dist/index.d.ts.map +1 -1
  435. package/dist/index.js +1934 -436
  436. package/dist/index.js.map +1 -1
  437. package/dist/testing/FastCheck.d.ts +3 -3
  438. package/dist/testing/FastCheck.js +3 -3
  439. package/dist/testing/TestClock.d.ts +2 -3
  440. package/dist/testing/TestClock.d.ts.map +1 -1
  441. package/dist/testing/TestClock.js +1 -1
  442. package/dist/testing/TestClock.js.map +1 -1
  443. package/dist/testing/TestConsole.d.ts +8 -9
  444. package/dist/testing/TestConsole.d.ts.map +1 -1
  445. package/dist/testing/TestConsole.js +5 -5
  446. package/dist/testing/TestConsole.js.map +1 -1
  447. package/dist/testing/TestSchema.d.ts +2 -0
  448. package/dist/testing/TestSchema.d.ts.map +1 -1
  449. package/dist/testing/TestSchema.js +2 -0
  450. package/dist/testing/TestSchema.js.map +1 -1
  451. package/dist/testing/index.d.ts +34 -0
  452. package/dist/testing/index.d.ts.map +1 -1
  453. package/dist/testing/index.js +34 -0
  454. package/dist/testing/index.js.map +1 -1
  455. package/dist/unstable/ai/AiError.d.ts +10 -19
  456. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  457. package/dist/unstable/ai/AiError.js +0 -9
  458. package/dist/unstable/ai/AiError.js.map +1 -1
  459. package/dist/unstable/ai/Chat.d.ts +0 -1
  460. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  461. package/dist/unstable/ai/Chat.js.map +1 -1
  462. package/dist/unstable/ai/McpSchema.d.ts +3 -0
  463. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  464. package/dist/unstable/ai/McpSchema.js +2 -0
  465. package/dist/unstable/ai/McpSchema.js.map +1 -1
  466. package/dist/unstable/ai/McpServer.d.ts +3 -1
  467. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  468. package/dist/unstable/ai/McpServer.js +1 -1
  469. package/dist/unstable/ai/McpServer.js.map +1 -1
  470. package/dist/unstable/ai/Model.d.ts +2 -6
  471. package/dist/unstable/ai/Model.d.ts.map +1 -1
  472. package/dist/unstable/ai/Model.js +2 -2
  473. package/dist/unstable/ai/Model.js.map +1 -1
  474. package/dist/unstable/ai/Prompt.d.ts +8 -10
  475. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  476. package/dist/unstable/ai/Prompt.js +4 -4
  477. package/dist/unstable/ai/Prompt.js.map +1 -1
  478. package/dist/unstable/ai/Response.d.ts +20 -20
  479. package/dist/unstable/ai/ResponseIdTracker.d.ts +1 -1
  480. package/dist/unstable/ai/ResponseIdTracker.js +1 -1
  481. package/dist/unstable/ai/Telemetry.d.ts +5 -5
  482. package/dist/unstable/ai/Telemetry.js +3 -3
  483. package/dist/unstable/ai/Tokenizer.d.ts +1 -1
  484. package/dist/unstable/ai/Tool.d.ts +14 -12
  485. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  486. package/dist/unstable/ai/Tool.js +10 -9
  487. package/dist/unstable/ai/Tool.js.map +1 -1
  488. package/dist/unstable/ai/index.d.ts +80 -6
  489. package/dist/unstable/ai/index.d.ts.map +1 -1
  490. package/dist/unstable/ai/index.js +80 -6
  491. package/dist/unstable/ai/index.js.map +1 -1
  492. package/dist/unstable/cli/CliOutput.d.ts +5 -6
  493. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  494. package/dist/unstable/cli/CliOutput.js +2 -3
  495. package/dist/unstable/cli/CliOutput.js.map +1 -1
  496. package/dist/unstable/cli/Command.d.ts +3 -3
  497. package/dist/unstable/cli/Command.js +1 -1
  498. package/dist/unstable/cli/Flag.d.ts +23 -0
  499. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  500. package/dist/unstable/cli/Flag.js +23 -0
  501. package/dist/unstable/cli/Flag.js.map +1 -1
  502. package/dist/unstable/cli/HelpDoc.d.ts +4 -4
  503. package/dist/unstable/cli/Param.d.ts +33 -1
  504. package/dist/unstable/cli/Param.d.ts.map +1 -1
  505. package/dist/unstable/cli/Param.js +64 -38
  506. package/dist/unstable/cli/Param.js.map +1 -1
  507. package/dist/unstable/cli/Primitive.d.ts +1 -1
  508. package/dist/unstable/cli/Primitive.js +1 -1
  509. package/dist/unstable/cli/Prompt.d.ts +6 -14
  510. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  511. package/dist/unstable/cli/Prompt.js +2 -2
  512. package/dist/unstable/cli/Prompt.js.map +1 -1
  513. package/dist/unstable/cli/index.d.ts +212 -0
  514. package/dist/unstable/cli/index.d.ts.map +1 -1
  515. package/dist/unstable/cli/index.js +205 -6
  516. package/dist/unstable/cli/index.js.map +1 -1
  517. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  518. package/dist/unstable/cli/internal/command.js +3 -0
  519. package/dist/unstable/cli/internal/command.js.map +1 -1
  520. package/dist/unstable/cli/internal/completions/descriptor.js +3 -0
  521. package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
  522. package/dist/unstable/cli/internal/help.d.ts.map +1 -1
  523. package/dist/unstable/cli/internal/help.js +10 -0
  524. package/dist/unstable/cli/internal/help.js.map +1 -1
  525. package/dist/unstable/cli/internal/parser.js +3 -1
  526. package/dist/unstable/cli/internal/parser.js.map +1 -1
  527. package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
  528. package/dist/unstable/cluster/ClusterCron.js +1 -1
  529. package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
  530. package/dist/unstable/cluster/ClusterSchema.js +8 -8
  531. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +2 -2
  532. package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -2
  533. package/dist/unstable/cluster/Entity.d.ts +0 -1
  534. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  535. package/dist/unstable/cluster/Entity.js.map +1 -1
  536. package/dist/unstable/cluster/EntityProxy.d.ts +10 -14
  537. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  538. package/dist/unstable/cluster/EntityProxy.js +8 -14
  539. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  540. package/dist/unstable/cluster/EntityProxyServer.d.ts +3 -2
  541. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  542. package/dist/unstable/cluster/EntityProxyServer.js +2 -2
  543. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  544. package/dist/unstable/cluster/EntityResource.js +1 -1
  545. package/dist/unstable/cluster/Envelope.d.ts +1 -1
  546. package/dist/unstable/cluster/Envelope.js +1 -1
  547. package/dist/unstable/cluster/HttpRunner.d.ts +11 -11
  548. package/dist/unstable/cluster/HttpRunner.js +11 -11
  549. package/dist/unstable/cluster/K8sHttpClient.d.ts +5 -5
  550. package/dist/unstable/cluster/K8sHttpClient.js +5 -5
  551. package/dist/unstable/cluster/MachineId.d.ts +1 -1
  552. package/dist/unstable/cluster/MachineId.js +1 -1
  553. package/dist/unstable/cluster/MessageStorage.d.ts +1 -2
  554. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  555. package/dist/unstable/cluster/MessageStorage.js +1 -1
  556. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  557. package/dist/unstable/cluster/Runner.d.ts +1 -1
  558. package/dist/unstable/cluster/Runner.js +1 -1
  559. package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
  560. package/dist/unstable/cluster/RunnerHealth.js +2 -2
  561. package/dist/unstable/cluster/RunnerServer.d.ts +4 -4
  562. package/dist/unstable/cluster/RunnerServer.js +4 -4
  563. package/dist/unstable/cluster/Runners.d.ts +3 -3
  564. package/dist/unstable/cluster/Runners.js +3 -3
  565. package/dist/unstable/cluster/ShardId.d.ts +7 -5
  566. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  567. package/dist/unstable/cluster/ShardId.js +6 -4
  568. package/dist/unstable/cluster/ShardId.js.map +1 -1
  569. package/dist/unstable/cluster/Sharding.js +1 -1
  570. package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
  571. package/dist/unstable/cluster/ShardingConfig.js +2 -2
  572. package/dist/unstable/cluster/SingleRunner.d.ts +1 -1
  573. package/dist/unstable/cluster/SingleRunner.js +1 -1
  574. package/dist/unstable/cluster/Snowflake.d.ts +10 -9
  575. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  576. package/dist/unstable/cluster/Snowflake.js +4 -3
  577. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  578. package/dist/unstable/cluster/SocketRunner.d.ts +2 -2
  579. package/dist/unstable/cluster/SocketRunner.js +2 -2
  580. package/dist/unstable/cluster/SqlMessageStorage.d.ts +3 -3
  581. package/dist/unstable/cluster/SqlMessageStorage.js +3 -3
  582. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +3 -3
  583. package/dist/unstable/cluster/SqlRunnerStorage.js +3 -3
  584. package/dist/unstable/cluster/TestRunner.d.ts +1 -1
  585. package/dist/unstable/cluster/TestRunner.js +1 -1
  586. package/dist/unstable/cluster/index.d.ts +790 -0
  587. package/dist/unstable/cluster/index.d.ts.map +1 -1
  588. package/dist/unstable/cluster/index.js +790 -0
  589. package/dist/unstable/cluster/index.js.map +1 -1
  590. package/dist/unstable/devtools/index.d.ts +58 -0
  591. package/dist/unstable/devtools/index.d.ts.map +1 -1
  592. package/dist/unstable/devtools/index.js +58 -0
  593. package/dist/unstable/devtools/index.js.map +1 -1
  594. package/dist/unstable/encoding/Sse.d.ts +16 -16
  595. package/dist/unstable/encoding/Sse.js +11 -11
  596. package/dist/unstable/encoding/index.d.ts +49 -0
  597. package/dist/unstable/encoding/index.d.ts.map +1 -1
  598. package/dist/unstable/encoding/index.js +49 -0
  599. package/dist/unstable/encoding/index.js.map +1 -1
  600. package/dist/unstable/eventlog/Event.d.ts +2 -2
  601. package/dist/unstable/eventlog/Event.js +1 -1
  602. package/dist/unstable/eventlog/EventGroup.d.ts +2 -2
  603. package/dist/unstable/eventlog/EventGroup.js +1 -1
  604. package/dist/unstable/eventlog/EventLog.d.ts +6 -7
  605. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  606. package/dist/unstable/eventlog/EventLog.js +4 -4
  607. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  608. package/dist/unstable/eventlog/EventLogRemote.d.ts +2 -2
  609. package/dist/unstable/eventlog/EventLogRemote.js +2 -2
  610. package/dist/unstable/eventlog/EventLogServer.d.ts +2 -2
  611. package/dist/unstable/eventlog/EventLogServer.js +2 -2
  612. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -2
  613. package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -2
  614. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +1 -1
  615. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
  616. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
  617. package/dist/unstable/eventlog/index.d.ts +240 -0
  618. package/dist/unstable/eventlog/index.d.ts.map +1 -1
  619. package/dist/unstable/eventlog/index.js +240 -0
  620. package/dist/unstable/eventlog/index.js.map +1 -1
  621. package/dist/unstable/http/Cookies.d.ts +6 -6
  622. package/dist/unstable/http/Cookies.js +4 -4
  623. package/dist/unstable/http/Etag.d.ts +2 -2
  624. package/dist/unstable/http/Etag.js +2 -2
  625. package/dist/unstable/http/Headers.d.ts +2 -2
  626. package/dist/unstable/http/Headers.js +1 -1
  627. package/dist/unstable/http/HttpClient.d.ts +5 -6
  628. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  629. package/dist/unstable/http/HttpClient.js +5 -4
  630. package/dist/unstable/http/HttpClient.js.map +1 -1
  631. package/dist/unstable/http/HttpClientError.d.ts +1 -1
  632. package/dist/unstable/http/HttpClientError.js +1 -1
  633. package/dist/unstable/http/HttpClientRequest.d.ts +4 -4
  634. package/dist/unstable/http/HttpClientRequest.js +4 -4
  635. package/dist/unstable/http/HttpClientResponse.d.ts +6 -6
  636. package/dist/unstable/http/HttpClientResponse.js +6 -6
  637. package/dist/unstable/http/HttpEffect.d.ts +5 -5
  638. package/dist/unstable/http/HttpEffect.js +5 -5
  639. package/dist/unstable/http/HttpIncomingMessage.d.ts +7 -6
  640. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  641. package/dist/unstable/http/HttpIncomingMessage.js +7 -6
  642. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  643. package/dist/unstable/http/HttpMethod.d.ts +4 -2
  644. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  645. package/dist/unstable/http/HttpMethod.js +4 -1
  646. package/dist/unstable/http/HttpMethod.js.map +1 -1
  647. package/dist/unstable/http/HttpMiddleware.d.ts +1 -0
  648. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  649. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  650. package/dist/unstable/http/HttpRouter.d.ts +23 -25
  651. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  652. package/dist/unstable/http/HttpRouter.js +23 -22
  653. package/dist/unstable/http/HttpRouter.js.map +1 -1
  654. package/dist/unstable/http/HttpServerError.d.ts +4 -1
  655. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  656. package/dist/unstable/http/HttpServerError.js +4 -1
  657. package/dist/unstable/http/HttpServerError.js.map +1 -1
  658. package/dist/unstable/http/HttpServerRequest.d.ts +15 -15
  659. package/dist/unstable/http/HttpServerRequest.js +15 -15
  660. package/dist/unstable/http/HttpServerRespondable.d.ts +1 -1
  661. package/dist/unstable/http/HttpServerRespondable.js +1 -1
  662. package/dist/unstable/http/HttpServerResponse.d.ts +5 -4
  663. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  664. package/dist/unstable/http/HttpServerResponse.js +5 -4
  665. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  666. package/dist/unstable/http/HttpStaticServer.d.ts +2 -4
  667. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  668. package/dist/unstable/http/HttpStaticServer.js +2 -4
  669. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  670. package/dist/unstable/http/Multipart.d.ts +20 -19
  671. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  672. package/dist/unstable/http/Multipart.js +19 -17
  673. package/dist/unstable/http/Multipart.js.map +1 -1
  674. package/dist/unstable/http/Template.d.ts +0 -1
  675. package/dist/unstable/http/Template.d.ts.map +1 -1
  676. package/dist/unstable/http/Template.js.map +1 -1
  677. package/dist/unstable/http/Url.d.ts +17 -17
  678. package/dist/unstable/http/Url.js +8 -8
  679. package/dist/unstable/http/UrlParams.d.ts +14 -12
  680. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  681. package/dist/unstable/http/UrlParams.js +12 -10
  682. package/dist/unstable/http/UrlParams.js.map +1 -1
  683. package/dist/unstable/http/index.d.ts +452 -0
  684. package/dist/unstable/http/index.d.ts.map +1 -1
  685. package/dist/unstable/http/index.js +452 -0
  686. package/dist/unstable/http/index.js.map +1 -1
  687. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -1
  688. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  689. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  690. package/dist/unstable/httpapi/HttpApiClient.d.ts +0 -1
  691. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  692. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  693. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -2
  694. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  695. package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -1
  696. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  697. package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
  698. package/dist/unstable/httpapi/HttpApiSchema.d.ts +19 -8
  699. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  700. package/dist/unstable/httpapi/HttpApiSchema.js +11 -8
  701. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  702. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +0 -1
  703. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  704. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  705. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +0 -2
  706. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  707. package/dist/unstable/httpapi/HttpApiSwagger.js +0 -2
  708. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  709. package/dist/unstable/httpapi/index.d.ts +310 -25
  710. package/dist/unstable/httpapi/index.d.ts.map +1 -1
  711. package/dist/unstable/httpapi/index.js +310 -25
  712. package/dist/unstable/httpapi/index.js.map +1 -1
  713. package/dist/unstable/observability/Otlp.d.ts +3 -3
  714. package/dist/unstable/observability/Otlp.js +3 -3
  715. package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
  716. package/dist/unstable/observability/OtlpExporter.js +1 -1
  717. package/dist/unstable/observability/OtlpLogger.d.ts +3 -2
  718. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  719. package/dist/unstable/observability/OtlpLogger.js +2 -2
  720. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  721. package/dist/unstable/observability/OtlpMetrics.d.ts +5 -4
  722. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  723. package/dist/unstable/observability/OtlpMetrics.js +2 -2
  724. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  725. package/dist/unstable/observability/OtlpResource.d.ts +9 -9
  726. package/dist/unstable/observability/OtlpResource.js +2 -2
  727. package/dist/unstable/observability/OtlpSerialization.d.ts +3 -3
  728. package/dist/unstable/observability/OtlpSerialization.js +3 -3
  729. package/dist/unstable/observability/OtlpTracer.d.ts +5 -2
  730. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  731. package/dist/unstable/observability/OtlpTracer.js +2 -2
  732. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  733. package/dist/unstable/observability/PrometheusMetrics.d.ts +7 -7
  734. package/dist/unstable/observability/PrometheusMetrics.js +2 -2
  735. package/dist/unstable/observability/index.d.ts +159 -3
  736. package/dist/unstable/observability/index.d.ts.map +1 -1
  737. package/dist/unstable/observability/index.js +159 -3
  738. package/dist/unstable/observability/index.js.map +1 -1
  739. package/dist/unstable/persistence/KeyValueStore.d.ts +4 -4
  740. package/dist/unstable/persistence/KeyValueStore.js +1 -1
  741. package/dist/unstable/persistence/Persistable.d.ts +11 -11
  742. package/dist/unstable/persistence/Persistable.js +1 -1
  743. package/dist/unstable/persistence/PersistedCache.d.ts +2 -2
  744. package/dist/unstable/persistence/PersistedCache.js +1 -1
  745. package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
  746. package/dist/unstable/persistence/PersistedQueue.js +3 -3
  747. package/dist/unstable/persistence/Persistence.d.ts +2 -1
  748. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  749. package/dist/unstable/persistence/Persistence.js +2 -1
  750. package/dist/unstable/persistence/Persistence.js.map +1 -1
  751. package/dist/unstable/persistence/RateLimiter.d.ts +19 -15
  752. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  753. package/dist/unstable/persistence/RateLimiter.js +14 -10
  754. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  755. package/dist/unstable/persistence/Redis.d.ts +3 -3
  756. package/dist/unstable/persistence/Redis.js +3 -3
  757. package/dist/unstable/persistence/index.d.ts +147 -0
  758. package/dist/unstable/persistence/index.d.ts.map +1 -1
  759. package/dist/unstable/persistence/index.js +147 -0
  760. package/dist/unstable/persistence/index.js.map +1 -1
  761. package/dist/unstable/process/ChildProcess.d.ts +41 -41
  762. package/dist/unstable/process/ChildProcess.js +11 -11
  763. package/dist/unstable/process/ChildProcessSpawner.d.ts +10 -10
  764. package/dist/unstable/process/ChildProcessSpawner.js +5 -5
  765. package/dist/unstable/process/index.d.ts +1 -1
  766. package/dist/unstable/process/index.js +1 -1
  767. package/dist/unstable/reactivity/AsyncResult.d.ts +8 -6
  768. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  769. package/dist/unstable/reactivity/AsyncResult.js +3 -3
  770. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  771. package/dist/unstable/reactivity/Atom.d.ts +25 -20
  772. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  773. package/dist/unstable/reactivity/Atom.js +12 -12
  774. package/dist/unstable/reactivity/Atom.js.map +1 -1
  775. package/dist/unstable/reactivity/AtomHttpApi.d.ts +2 -2
  776. package/dist/unstable/reactivity/AtomHttpApi.js +1 -1
  777. package/dist/unstable/reactivity/AtomRef.d.ts +2 -2
  778. package/dist/unstable/reactivity/AtomRef.js +1 -1
  779. package/dist/unstable/reactivity/AtomRegistry.d.ts +16 -16
  780. package/dist/unstable/reactivity/AtomRegistry.js +7 -7
  781. package/dist/unstable/reactivity/AtomRpc.d.ts +2 -2
  782. package/dist/unstable/reactivity/AtomRpc.js +1 -1
  783. package/dist/unstable/reactivity/Reactivity.d.ts +2 -3
  784. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  785. package/dist/unstable/reactivity/Reactivity.js +2 -3
  786. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  787. package/dist/unstable/reactivity/index.d.ts +166 -0
  788. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  789. package/dist/unstable/reactivity/index.js +166 -0
  790. package/dist/unstable/reactivity/index.js.map +1 -1
  791. package/dist/unstable/rpc/Rpc.d.ts +0 -1
  792. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  793. package/dist/unstable/rpc/Rpc.js.map +1 -1
  794. package/dist/unstable/rpc/RpcClient.d.ts +0 -1
  795. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  796. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  797. package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
  798. package/dist/unstable/rpc/RpcClientError.js +2 -2
  799. package/dist/unstable/rpc/RpcMiddleware.d.ts +2 -2
  800. package/dist/unstable/rpc/RpcMiddleware.js +1 -1
  801. package/dist/unstable/rpc/RpcWorker.d.ts +0 -1
  802. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  803. package/dist/unstable/rpc/RpcWorker.js +1 -1
  804. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  805. package/dist/unstable/rpc/Utils.d.ts +2 -0
  806. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  807. package/dist/unstable/rpc/Utils.js +2 -0
  808. package/dist/unstable/rpc/Utils.js.map +1 -1
  809. package/dist/unstable/rpc/index.d.ts +272 -0
  810. package/dist/unstable/rpc/index.d.ts.map +1 -1
  811. package/dist/unstable/rpc/index.js +272 -0
  812. package/dist/unstable/rpc/index.js.map +1 -1
  813. package/dist/unstable/schema/Model.d.ts +63 -8
  814. package/dist/unstable/schema/Model.d.ts.map +1 -1
  815. package/dist/unstable/schema/Model.js +44 -5
  816. package/dist/unstable/schema/Model.js.map +1 -1
  817. package/dist/unstable/schema/VariantSchema.d.ts +1 -4
  818. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  819. package/dist/unstable/schema/VariantSchema.js +1 -1
  820. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  821. package/dist/unstable/schema/index.d.ts +37 -0
  822. package/dist/unstable/schema/index.d.ts.map +1 -1
  823. package/dist/unstable/schema/index.js +37 -0
  824. package/dist/unstable/schema/index.js.map +1 -1
  825. package/dist/unstable/socket/Socket.d.ts +5 -4
  826. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  827. package/dist/unstable/socket/Socket.js +4 -3
  828. package/dist/unstable/socket/Socket.js.map +1 -1
  829. package/dist/unstable/socket/index.d.ts +44 -0
  830. package/dist/unstable/socket/index.d.ts.map +1 -1
  831. package/dist/unstable/socket/index.js +44 -0
  832. package/dist/unstable/socket/index.js.map +1 -1
  833. package/dist/unstable/sql/Migrator.d.ts +11 -9
  834. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  835. package/dist/unstable/sql/Migrator.js +10 -8
  836. package/dist/unstable/sql/Migrator.js.map +1 -1
  837. package/dist/unstable/sql/SqlClient.d.ts +4 -0
  838. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  839. package/dist/unstable/sql/SqlClient.js +2 -0
  840. package/dist/unstable/sql/SqlClient.js.map +1 -1
  841. package/dist/unstable/sql/SqlConnection.d.ts +3 -3
  842. package/dist/unstable/sql/SqlError.d.ts +18 -0
  843. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  844. package/dist/unstable/sql/SqlError.js +17 -0
  845. package/dist/unstable/sql/SqlError.js.map +1 -1
  846. package/dist/unstable/sql/SqlModel.d.ts +0 -1
  847. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  848. package/dist/unstable/sql/SqlModel.js.map +1 -1
  849. package/dist/unstable/sql/SqlSchema.d.ts +5 -5
  850. package/dist/unstable/sql/SqlSchema.js +5 -5
  851. package/dist/unstable/sql/SqlStream.d.ts +1 -0
  852. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  853. package/dist/unstable/sql/SqlStream.js +1 -0
  854. package/dist/unstable/sql/SqlStream.js.map +1 -1
  855. package/dist/unstable/sql/Statement.d.ts +27 -24
  856. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  857. package/dist/unstable/sql/Statement.js +9 -6
  858. package/dist/unstable/sql/Statement.js.map +1 -1
  859. package/dist/unstable/sql/index.d.ts +178 -1
  860. package/dist/unstable/sql/index.d.ts.map +1 -1
  861. package/dist/unstable/sql/index.js +178 -1
  862. package/dist/unstable/sql/index.js.map +1 -1
  863. package/dist/unstable/workers/Transferable.d.ts +7 -7
  864. package/dist/unstable/workers/Transferable.js +4 -4
  865. package/dist/unstable/workers/Worker.d.ts +1 -0
  866. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  867. package/dist/unstable/workers/Worker.js +1 -0
  868. package/dist/unstable/workers/Worker.js.map +1 -1
  869. package/dist/unstable/workers/WorkerError.d.ts +8 -8
  870. package/dist/unstable/workers/WorkerError.js +7 -7
  871. package/dist/unstable/workers/index.d.ts +80 -0
  872. package/dist/unstable/workers/index.d.ts.map +1 -1
  873. package/dist/unstable/workers/index.js +80 -0
  874. package/dist/unstable/workers/index.js.map +1 -1
  875. package/dist/unstable/workflow/Activity.d.ts +7 -7
  876. package/dist/unstable/workflow/Activity.js +2 -2
  877. package/dist/unstable/workflow/DurableClock.d.ts +2 -2
  878. package/dist/unstable/workflow/DurableClock.js +1 -1
  879. package/dist/unstable/workflow/DurableDeferred.d.ts +22 -20
  880. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  881. package/dist/unstable/workflow/DurableDeferred.js +8 -7
  882. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  883. package/dist/unstable/workflow/DurableQueue.d.ts +7 -5
  884. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  885. package/dist/unstable/workflow/DurableQueue.js +5 -3
  886. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  887. package/dist/unstable/workflow/Workflow.d.ts +12 -10
  888. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  889. package/dist/unstable/workflow/Workflow.js +3 -3
  890. package/dist/unstable/workflow/Workflow.js.map +1 -1
  891. package/dist/unstable/workflow/WorkflowEngine.d.ts +4 -4
  892. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  893. package/dist/unstable/workflow/WorkflowEngine.js +9 -13
  894. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  895. package/dist/unstable/workflow/WorkflowProxy.d.ts +10 -12
  896. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  897. package/dist/unstable/workflow/WorkflowProxy.js +8 -12
  898. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  899. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +3 -2
  900. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  901. package/dist/unstable/workflow/WorkflowProxyServer.js +2 -2
  902. package/dist/unstable/workflow/index.d.ts +160 -0
  903. package/dist/unstable/workflow/index.d.ts.map +1 -1
  904. package/dist/unstable/workflow/index.js +160 -0
  905. package/dist/unstable/workflow/index.js.map +1 -1
  906. package/package.json +3 -3
  907. package/src/Array.ts +41 -42
  908. package/src/BigDecimal.ts +265 -265
  909. package/src/BigInt.ts +175 -177
  910. package/src/Boolean.ts +127 -125
  911. package/src/Brand.ts +10 -4
  912. package/src/Cache.ts +42 -42
  913. package/src/Cause.ts +17 -18
  914. package/src/Channel.ts +256 -257
  915. package/src/Chunk.ts +33 -56
  916. package/src/Clock.ts +1 -1
  917. package/src/Combiner.ts +9 -1
  918. package/src/Config.ts +78 -68
  919. package/src/ConfigProvider.ts +33 -32
  920. package/src/Console.ts +23 -23
  921. package/src/Context.ts +70 -108
  922. package/src/Cron.ts +3 -5
  923. package/src/Crypto.ts +327 -0
  924. package/src/Data.ts +6 -1
  925. package/src/DateTime.ts +29 -31
  926. package/src/Deferred.ts +8 -9
  927. package/src/Differ.ts +2 -2
  928. package/src/Duration.ts +30 -27
  929. package/src/Effect.ts +893 -1151
  930. package/src/Effectable.ts +2 -2
  931. package/src/Encoding.ts +9 -9
  932. package/src/Equal.ts +4 -3
  933. package/src/Equivalence.ts +4 -5
  934. package/src/ErrorReporter.ts +14 -14
  935. package/src/ExecutionPlan.ts +18 -9
  936. package/src/Exit.ts +0 -1
  937. package/src/Fiber.ts +1 -2
  938. package/src/FiberHandle.ts +5 -5
  939. package/src/FiberMap.ts +10 -10
  940. package/src/FiberSet.ts +4 -4
  941. package/src/FileSystem.ts +10 -12
  942. package/src/Filter.ts +54 -54
  943. package/src/Formatter.ts +4 -70
  944. package/src/Function.ts +64 -65
  945. package/src/Graph.ts +157 -175
  946. package/src/Hash.ts +4 -6
  947. package/src/HashMap.ts +121 -157
  948. package/src/HashRing.ts +34 -34
  949. package/src/HashSet.ts +51 -55
  950. package/src/Inspectable.ts +8 -7
  951. package/src/Iterable.ts +37 -83
  952. package/src/JsonPatch.ts +9 -7
  953. package/src/JsonPointer.ts +13 -11
  954. package/src/JsonSchema.ts +16 -0
  955. package/src/Latch.ts +4 -16
  956. package/src/Layer.ts +94 -135
  957. package/src/LayerMap.ts +15 -16
  958. package/src/LogLevel.ts +13 -13
  959. package/src/Logger.ts +16 -17
  960. package/src/ManagedRuntime.ts +5 -4
  961. package/src/Match.ts +2 -4
  962. package/src/Metric.ts +56 -58
  963. package/src/MutableHashMap.ts +42 -44
  964. package/src/MutableHashSet.ts +0 -2
  965. package/src/MutableList.ts +23 -26
  966. package/src/MutableRef.ts +0 -1
  967. package/src/Newtype.ts +12 -2
  968. package/src/NonEmptyIterable.ts +5 -12
  969. package/src/Number.ts +145 -141
  970. package/src/Optic.ts +5 -5
  971. package/src/Option.ts +105 -109
  972. package/src/Order.ts +6 -6
  973. package/src/Ordering.ts +15 -19
  974. package/src/PartitionedSemaphore.ts +3 -3
  975. package/src/Path.ts +4 -4
  976. package/src/Pipeable.ts +10 -7
  977. package/src/PlatformError.ts +3 -3
  978. package/src/Predicate.ts +3 -5
  979. package/src/PrimaryKey.ts +2 -1
  980. package/src/PubSub.ts +25 -51
  981. package/src/Queue.ts +45 -60
  982. package/src/Random.ts +31 -74
  983. package/src/RcMap.ts +11 -11
  984. package/src/RcRef.ts +0 -1
  985. package/src/Record.ts +9 -8
  986. package/src/Redactable.ts +7 -5
  987. package/src/Redacted.ts +2 -3
  988. package/src/Reducer.ts +3 -1
  989. package/src/Ref.ts +15 -33
  990. package/src/RegExp.ts +1 -1
  991. package/src/Request.ts +2 -1
  992. package/src/RequestResolver.ts +2 -3
  993. package/src/Resource.ts +1 -1
  994. package/src/Result.ts +124 -142
  995. package/src/Runtime.ts +2 -7
  996. package/src/Schedule.ts +74 -77
  997. package/src/Scheduler.ts +2 -2
  998. package/src/Schema.ts +491 -321
  999. package/src/SchemaAST.ts +98 -77
  1000. package/src/SchemaGetter.ts +23 -23
  1001. package/src/SchemaIssue.ts +18 -16
  1002. package/src/SchemaParser.ts +46 -49
  1003. package/src/SchemaRepresentation.ts +89 -77
  1004. package/src/SchemaTransformation.ts +36 -5
  1005. package/src/SchemaUtils.ts +1 -1
  1006. package/src/Scope.ts +12 -29
  1007. package/src/ScopedCache.ts +43 -43
  1008. package/src/Semaphore.ts +4 -16
  1009. package/src/Sink.ts +36 -39
  1010. package/src/Stdio.ts +6 -6
  1011. package/src/Stream.ts +789 -828
  1012. package/src/String.ts +3 -2
  1013. package/src/Struct.ts +20 -18
  1014. package/src/SubscriptionRef.ts +2 -2
  1015. package/src/Symbol.ts +3 -3
  1016. package/src/SynchronizedRef.ts +1 -1
  1017. package/src/Take.ts +2 -2
  1018. package/src/Terminal.ts +5 -5
  1019. package/src/Tracer.ts +9 -9
  1020. package/src/Trie.ts +70 -106
  1021. package/src/Tuple.ts +34 -32
  1022. package/src/TxChunk.ts +27 -18
  1023. package/src/TxDeferred.ts +11 -11
  1024. package/src/TxHashMap.ts +62 -63
  1025. package/src/TxHashSet.ts +38 -42
  1026. package/src/TxPriorityQueue.ts +31 -31
  1027. package/src/TxPubSub.ts +18 -18
  1028. package/src/TxQueue.ts +26 -29
  1029. package/src/TxReentrantLock.ts +21 -21
  1030. package/src/TxRef.ts +24 -24
  1031. package/src/TxSemaphore.ts +13 -74
  1032. package/src/TxSubscriptionRef.ts +24 -24
  1033. package/src/Types.ts +1 -4
  1034. package/src/UndefinedOr.ts +14 -0
  1035. package/src/Unify.ts +8 -8
  1036. package/src/Utils.ts +1 -2
  1037. package/src/index.ts +1932 -433
  1038. package/src/testing/FastCheck.ts +3 -3
  1039. package/src/testing/TestClock.ts +2 -3
  1040. package/src/testing/TestConsole.ts +8 -9
  1041. package/src/testing/TestSchema.ts +2 -0
  1042. package/src/testing/index.ts +34 -0
  1043. package/src/unstable/ai/AiError.ts +10 -19
  1044. package/src/unstable/ai/Chat.ts +0 -1
  1045. package/src/unstable/ai/McpSchema.ts +3 -0
  1046. package/src/unstable/ai/McpServer.ts +3 -1
  1047. package/src/unstable/ai/Model.ts +2 -6
  1048. package/src/unstable/ai/Prompt.ts +8 -10
  1049. package/src/unstable/ai/Response.ts +20 -20
  1050. package/src/unstable/ai/ResponseIdTracker.ts +1 -1
  1051. package/src/unstable/ai/Telemetry.ts +5 -5
  1052. package/src/unstable/ai/Tokenizer.ts +1 -1
  1053. package/src/unstable/ai/Tool.ts +14 -12
  1054. package/src/unstable/ai/index.ts +80 -6
  1055. package/src/unstable/cli/CliOutput.ts +5 -6
  1056. package/src/unstable/cli/Command.ts +3 -3
  1057. package/src/unstable/cli/Flag.ts +24 -0
  1058. package/src/unstable/cli/HelpDoc.ts +4 -4
  1059. package/src/unstable/cli/Param.ts +101 -72
  1060. package/src/unstable/cli/Primitive.ts +1 -1
  1061. package/src/unstable/cli/Prompt.ts +6 -14
  1062. package/src/unstable/cli/index.ts +205 -6
  1063. package/src/unstable/cli/internal/command.ts +3 -0
  1064. package/src/unstable/cli/internal/completions/descriptor.ts +3 -0
  1065. package/src/unstable/cli/internal/help.ts +10 -0
  1066. package/src/unstable/cli/internal/parser.ts +3 -1
  1067. package/src/unstable/cluster/ClusterCron.ts +1 -1
  1068. package/src/unstable/cluster/ClusterSchema.ts +8 -8
  1069. package/src/unstable/cluster/ClusterWorkflowEngine.ts +2 -2
  1070. package/src/unstable/cluster/Entity.ts +0 -1
  1071. package/src/unstable/cluster/EntityProxy.ts +10 -14
  1072. package/src/unstable/cluster/EntityProxyServer.ts +3 -2
  1073. package/src/unstable/cluster/EntityResource.ts +2 -2
  1074. package/src/unstable/cluster/Envelope.ts +1 -1
  1075. package/src/unstable/cluster/HttpRunner.ts +11 -11
  1076. package/src/unstable/cluster/K8sHttpClient.ts +5 -5
  1077. package/src/unstable/cluster/MachineId.ts +1 -1
  1078. package/src/unstable/cluster/MessageStorage.ts +1 -2
  1079. package/src/unstable/cluster/Runner.ts +1 -1
  1080. package/src/unstable/cluster/RunnerHealth.ts +2 -2
  1081. package/src/unstable/cluster/RunnerServer.ts +4 -4
  1082. package/src/unstable/cluster/Runners.ts +3 -3
  1083. package/src/unstable/cluster/ShardId.ts +7 -5
  1084. package/src/unstable/cluster/Sharding.ts +1 -1
  1085. package/src/unstable/cluster/ShardingConfig.ts +2 -2
  1086. package/src/unstable/cluster/SingleRunner.ts +1 -1
  1087. package/src/unstable/cluster/Snowflake.ts +10 -9
  1088. package/src/unstable/cluster/SocketRunner.ts +2 -2
  1089. package/src/unstable/cluster/SqlMessageStorage.ts +3 -3
  1090. package/src/unstable/cluster/SqlRunnerStorage.ts +3 -3
  1091. package/src/unstable/cluster/TestRunner.ts +1 -1
  1092. package/src/unstable/cluster/index.ts +790 -0
  1093. package/src/unstable/devtools/index.ts +58 -0
  1094. package/src/unstable/encoding/Sse.ts +16 -16
  1095. package/src/unstable/encoding/index.ts +49 -0
  1096. package/src/unstable/eventlog/Event.ts +2 -2
  1097. package/src/unstable/eventlog/EventGroup.ts +2 -2
  1098. package/src/unstable/eventlog/EventLog.ts +6 -7
  1099. package/src/unstable/eventlog/EventLogRemote.ts +2 -2
  1100. package/src/unstable/eventlog/EventLogServer.ts +2 -2
  1101. package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -2
  1102. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
  1103. package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
  1104. package/src/unstable/eventlog/index.ts +240 -0
  1105. package/src/unstable/http/Cookies.ts +6 -6
  1106. package/src/unstable/http/Etag.ts +2 -2
  1107. package/src/unstable/http/Headers.ts +2 -2
  1108. package/src/unstable/http/HttpClient.ts +5 -6
  1109. package/src/unstable/http/HttpClientError.ts +1 -1
  1110. package/src/unstable/http/HttpClientRequest.ts +4 -4
  1111. package/src/unstable/http/HttpClientResponse.ts +6 -6
  1112. package/src/unstable/http/HttpEffect.ts +5 -5
  1113. package/src/unstable/http/HttpIncomingMessage.ts +7 -6
  1114. package/src/unstable/http/HttpMethod.ts +4 -2
  1115. package/src/unstable/http/HttpMiddleware.ts +1 -0
  1116. package/src/unstable/http/HttpRouter.ts +23 -25
  1117. package/src/unstable/http/HttpServerError.ts +4 -1
  1118. package/src/unstable/http/HttpServerRequest.ts +15 -15
  1119. package/src/unstable/http/HttpServerRespondable.ts +1 -1
  1120. package/src/unstable/http/HttpServerResponse.ts +5 -4
  1121. package/src/unstable/http/HttpStaticServer.ts +2 -4
  1122. package/src/unstable/http/Multipart.ts +20 -19
  1123. package/src/unstable/http/Template.ts +0 -1
  1124. package/src/unstable/http/Url.ts +17 -17
  1125. package/src/unstable/http/UrlParams.ts +14 -12
  1126. package/src/unstable/http/index.ts +452 -0
  1127. package/src/unstable/httpapi/HttpApiBuilder.ts +0 -1
  1128. package/src/unstable/httpapi/HttpApiClient.ts +0 -1
  1129. package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -2
  1130. package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
  1131. package/src/unstable/httpapi/HttpApiSchema.ts +19 -8
  1132. package/src/unstable/httpapi/HttpApiSecurity.ts +0 -1
  1133. package/src/unstable/httpapi/HttpApiSwagger.ts +0 -2
  1134. package/src/unstable/httpapi/index.ts +310 -25
  1135. package/src/unstable/observability/Otlp.ts +3 -3
  1136. package/src/unstable/observability/OtlpExporter.ts +1 -1
  1137. package/src/unstable/observability/OtlpLogger.ts +3 -2
  1138. package/src/unstable/observability/OtlpMetrics.ts +5 -4
  1139. package/src/unstable/observability/OtlpResource.ts +9 -9
  1140. package/src/unstable/observability/OtlpSerialization.ts +3 -3
  1141. package/src/unstable/observability/OtlpTracer.ts +5 -2
  1142. package/src/unstable/observability/PrometheusMetrics.ts +7 -7
  1143. package/src/unstable/observability/index.ts +159 -3
  1144. package/src/unstable/persistence/KeyValueStore.ts +4 -4
  1145. package/src/unstable/persistence/Persistable.ts +11 -11
  1146. package/src/unstable/persistence/PersistedCache.ts +2 -2
  1147. package/src/unstable/persistence/PersistedQueue.ts +6 -6
  1148. package/src/unstable/persistence/Persistence.ts +2 -1
  1149. package/src/unstable/persistence/RateLimiter.ts +19 -15
  1150. package/src/unstable/persistence/Redis.ts +3 -3
  1151. package/src/unstable/persistence/index.ts +147 -0
  1152. package/src/unstable/process/ChildProcess.ts +42 -42
  1153. package/src/unstable/process/ChildProcessSpawner.ts +10 -10
  1154. package/src/unstable/process/index.ts +1 -1
  1155. package/src/unstable/reactivity/AsyncResult.ts +8 -6
  1156. package/src/unstable/reactivity/Atom.ts +25 -20
  1157. package/src/unstable/reactivity/AtomHttpApi.ts +2 -2
  1158. package/src/unstable/reactivity/AtomRef.ts +2 -2
  1159. package/src/unstable/reactivity/AtomRegistry.ts +17 -17
  1160. package/src/unstable/reactivity/AtomRpc.ts +2 -2
  1161. package/src/unstable/reactivity/Reactivity.ts +2 -3
  1162. package/src/unstable/reactivity/index.ts +166 -0
  1163. package/src/unstable/rpc/Rpc.ts +0 -1
  1164. package/src/unstable/rpc/RpcClient.ts +0 -1
  1165. package/src/unstable/rpc/RpcClientError.ts +2 -2
  1166. package/src/unstable/rpc/RpcMiddleware.ts +2 -2
  1167. package/src/unstable/rpc/RpcWorker.ts +3 -2
  1168. package/src/unstable/rpc/Utils.ts +2 -0
  1169. package/src/unstable/rpc/index.ts +272 -0
  1170. package/src/unstable/schema/Model.ts +98 -10
  1171. package/src/unstable/schema/VariantSchema.ts +1 -4
  1172. package/src/unstable/schema/index.ts +37 -0
  1173. package/src/unstable/socket/Socket.ts +5 -4
  1174. package/src/unstable/socket/index.ts +44 -0
  1175. package/src/unstable/sql/Migrator.ts +14 -12
  1176. package/src/unstable/sql/SqlClient.ts +4 -0
  1177. package/src/unstable/sql/SqlConnection.ts +3 -3
  1178. package/src/unstable/sql/SqlError.ts +18 -0
  1179. package/src/unstable/sql/SqlModel.ts +0 -1
  1180. package/src/unstable/sql/SqlSchema.ts +5 -5
  1181. package/src/unstable/sql/SqlStream.ts +1 -0
  1182. package/src/unstable/sql/Statement.ts +27 -24
  1183. package/src/unstable/sql/index.ts +178 -1
  1184. package/src/unstable/workers/Transferable.ts +7 -7
  1185. package/src/unstable/workers/Worker.ts +1 -0
  1186. package/src/unstable/workers/WorkerError.ts +8 -8
  1187. package/src/unstable/workers/index.ts +80 -0
  1188. package/src/unstable/workflow/Activity.ts +7 -7
  1189. package/src/unstable/workflow/DurableClock.ts +2 -2
  1190. package/src/unstable/workflow/DurableDeferred.ts +22 -20
  1191. package/src/unstable/workflow/DurableQueue.ts +7 -5
  1192. package/src/unstable/workflow/Workflow.ts +12 -10
  1193. package/src/unstable/workflow/WorkflowEngine.ts +11 -15
  1194. package/src/unstable/workflow/WorkflowProxy.ts +10 -12
  1195. package/src/unstable/workflow/WorkflowProxyServer.ts +3 -2
  1196. package/src/unstable/workflow/index.ts +160 -0
package/dist/index.js CHANGED
@@ -152,6 +152,41 @@ export * as Boolean from "./Boolean.js";
152
152
  */
153
153
  export * as Brand from "./Brand.js";
154
154
  /**
155
+ * The `Cache` module provides an effectful, mutable key-value cache for values
156
+ * that are computed by a lookup function. A `Cache<Key, A, E, R>` stores lookup
157
+ * results for keys, shares concurrent lookups for the same key, and manages
158
+ * entry lifetime with capacity limits and optional time-to-live policies.
159
+ *
160
+ * **Mental model**
161
+ *
162
+ * - A cache is created from a lookup function and a maximum capacity
163
+ * - {@link get} returns a cached value when present, or runs the lookup on a miss
164
+ * - Concurrent misses for the same key share one pending lookup
165
+ * - Lookup failures are cached as failures until the entry expires, is invalidated, or is refreshed
166
+ * - Entries can live forever, expire after a fixed duration, or use a dynamic TTL based on the lookup `Exit`
167
+ * - Capacity is enforced by removing the oldest stored entries when new entries are added
168
+ *
169
+ * **Common tasks**
170
+ *
171
+ * - Create a cache: {@link make}, {@link makeWith}
172
+ * - Read values: {@link get}, {@link getOption}, {@link getSuccess}
173
+ * - Seed or overwrite values: {@link set}
174
+ * - Refresh values: {@link refresh}
175
+ * - Remove entries: {@link invalidate}, {@link invalidateWhen}, {@link invalidateAll}
176
+ * - Inspect contents: {@link has}, {@link size}, {@link keys}, {@link values}, {@link entries}
177
+ *
178
+ * **Gotchas**
179
+ *
180
+ * - {@link getOption} does not run the lookup; it only reads an existing non-expired entry
181
+ * - {@link size} may include expired entries until they are observed and removed
182
+ * - {@link values} and {@link entries} include only successfully resolved entries
183
+ * - Use `Data` or another `Equal`-compatible key type when keys need structural equality
184
+ *
185
+ * **See also**
186
+ *
187
+ * - {@link Duration} for configuring fixed or dynamic time-to-live values
188
+ * - {@link Effect} for the lookup effects used to compute cached values
189
+ *
155
190
  * @since 4.0.0
156
191
  */
157
192
  export * as Cache from "./Cache.js";
@@ -297,6 +332,48 @@ export * as Cause from "./Cause.js";
297
332
  */
298
333
  export * as Channel from "./Channel.js";
299
334
  /**
335
+ * The `ChannelSchema` module provides helpers for applying `Schema` encoding
336
+ * and decoding at `Channel` boundaries. It is useful when a channel should
337
+ * expose typed values to application code while communicating with an upstream
338
+ * or downstream component through an encoded representation such as JSON-ready
339
+ * data, wire protocol values, or any other schema-defined format.
340
+ *
341
+ * **Mental model**
342
+ *
343
+ * - A channel schema adapter is a streaming boundary: chunks flow through a
344
+ * `Channel`, and each non-empty chunk is validated and transformed with a
345
+ * `Schema`
346
+ * - `encode` turns typed schema values into their encoded representation before
347
+ * they leave a typed part of a pipeline
348
+ * - `decode` turns encoded input into typed schema values before application
349
+ * code consumes them
350
+ * - `duplex` wraps a bidirectional channel so callers work with typed input and
351
+ * output while the wrapped channel continues to operate on encoded chunks
352
+ * - Schema failures are surfaced through the channel error type as
353
+ * `SchemaError`, and schema services are reflected in the channel
354
+ * requirements
355
+ *
356
+ * **Common tasks**
357
+ *
358
+ * - Encode typed channel input before sending it to an encoded transport:
359
+ * {@link encode}
360
+ * - Decode encoded channel output before handling it as domain data:
361
+ * {@link decode}
362
+ * - Use unknown encoded boundaries when static encoded types are intentionally
363
+ * erased: {@link encodeUnknown} and {@link decodeUnknown}
364
+ * - Wrap a bidirectional encoded channel with typed input and output schemas:
365
+ * {@link duplex} or {@link duplexUnknown}
366
+ *
367
+ * **Gotchas**
368
+ *
369
+ * - These helpers operate on `NonEmptyReadonlyArray` chunks, so schemas are
370
+ * applied to non-empty batches rather than individual scalar values
371
+ * - Encoding and decoding can require services from the schema; those
372
+ * requirements become part of the resulting channel type
373
+ * - `duplex` encodes values flowing into the wrapped channel and decodes values
374
+ * emitted by it, so choose `inputSchema` and `outputSchema` from the
375
+ * perspective of the typed caller
376
+ *
300
377
  * @since 4.0.0
301
378
  */
302
379
  export * as ChannelSchema from "./ChannelSchema.js";
@@ -363,12 +440,11 @@ export * as ChannelSchema from "./ChannelSchema.js";
363
440
  * import { Chunk, Effect } from "effect"
364
441
  *
365
442
  * // Working with Effects
366
- * const processChunk = (chunk: Chunk.Chunk<number>) =>
367
- * Effect.gen(function*() {
368
- * const mapped = Chunk.map(chunk, (n) => n * 2)
369
- * const filtered = Chunk.filter(mapped, (n) => n > 5)
370
- * return Chunk.toReadonlyArray(filtered)
371
- * })
443
+ * const processChunk = Effect.fnUntraced(function*(chunk: Chunk.Chunk<number>) {
444
+ * const mapped = Chunk.map(chunk, (n) => n * 2)
445
+ * const filtered = Chunk.filter(mapped, (n) => n > 5)
446
+ * return Chunk.toReadonlyArray(filtered)
447
+ * })
372
448
  * ```
373
449
  *
374
450
  * @since 2.0.0
@@ -742,9 +818,107 @@ export * as Console from "./Console.js";
742
818
  */
743
819
  export * as Context from "./Context.js";
744
820
  /**
821
+ * The `Cron` module provides utilities for representing recurring calendar
822
+ * schedules with cron expressions. A `Cron` value stores allowed seconds,
823
+ * minutes, hours, days of month, months, weekdays, and an optional time zone,
824
+ * then uses those constraints to test dates and find scheduled occurrences.
825
+ *
826
+ * **Mental model**
827
+ *
828
+ * - A cron schedule is a set of allowed values for each time field
829
+ * - Expressions may use five fields (`minute hour day month weekday`) or six
830
+ * fields (`second minute hour day month weekday`); five-field expressions
831
+ * default seconds to `0`
832
+ * - Each field supports `*`, comma-separated values, ranges, and step syntax
833
+ * - Month and weekday fields support aliases such as `JAN`, `DEC`, `SUN`, and
834
+ * `MON`
835
+ * - Empty internal field sets represent an unconstrained field, the same idea
836
+ * as `*`
837
+ * - When both day-of-month and weekday are constrained, matching uses cron's
838
+ * inclusive behavior: either field may match
839
+ *
840
+ * **Common tasks**
841
+ *
842
+ * - Build directly from field constraints: {@link make}
843
+ * - Parse expressions safely: {@link parse}
844
+ * - Parse expressions and throw on invalid input: {@link parseUnsafe}
845
+ * - Check whether a date satisfies a schedule: {@link match}
846
+ * - Find adjacent scheduled dates: {@link next}, {@link prev}
847
+ * - Iterate future scheduled dates: {@link sequence}
848
+ * - Compare schedule constraints: {@link equals}, {@link Equivalence}
849
+ * - Detect parse failures: {@link CronParseError}, {@link isCronParseError}
850
+ *
851
+ * **Gotchas**
852
+ *
853
+ * - Weekdays are numbered `0` through `6`, with `0` representing Sunday
854
+ * - Months are numbered `1` through `12`, while JavaScript `Date` months are
855
+ * zero-based
856
+ * - `*` normalizes to an empty set internally, so inspect schedules with the
857
+ * public helpers instead of assuming every allowed value is stored
858
+ * - `next` and `prev` search strictly after or before the provided instant
859
+ * - Time-zone-aware schedules account for daylight saving transitions; during
860
+ * a fall-back transition, repeated local times are emitted once when moving
861
+ * forward
862
+ *
745
863
  * @since 2.0.0
746
864
  */
747
865
  export * as Cron from "./Cron.js";
866
+ /**
867
+ * The `Crypto` module provides a platform-agnostic service for cryptographic
868
+ * operations. Runtime packages such as `@effect/platform-node`,
869
+ * `@effect/platform-bun`, and `@effect/platform-browser` provide concrete
870
+ * implementations backed by the host platform's cryptography APIs.
871
+ *
872
+ * Use `Crypto` for cryptographic randomness, UUID generation, random values,
873
+ * and message digests. The base `Random` service is not cryptographically
874
+ * secure unless you replace it with a cryptographically secure implementation.
875
+ *
876
+ * **Example** (Providing a test Crypto service)
877
+ *
878
+ * ```ts
879
+ * import { Console, Crypto, Effect, Layer } from "effect"
880
+ *
881
+ * const TestCrypto = Layer.succeed(
882
+ * Crypto.Crypto,
883
+ * Crypto.make({
884
+ * randomBytes: (size) => new Uint8Array(size),
885
+ * digest: (_algorithm, data) => Effect.succeed(data)
886
+ * })
887
+ * )
888
+ *
889
+ * const program = Effect.gen(function*() {
890
+ * const crypto = yield* Crypto.Crypto
891
+ * const id = yield* crypto.randomUUIDv4
892
+ * yield* Console.log(`Created id: ${id}`)
893
+ * })
894
+ *
895
+ * Effect.runPromise(Effect.provide(program, TestCrypto))
896
+ * ```
897
+ *
898
+ * **Example** (Generating random bytes)
899
+ *
900
+ * ```ts
901
+ * import { Crypto, Effect, Layer } from "effect"
902
+ *
903
+ * const TestCrypto = Layer.succeed(
904
+ * Crypto.Crypto,
905
+ * Crypto.make({
906
+ * randomBytes: (size) => new Uint8Array(size),
907
+ * digest: (_algorithm, data) => Effect.succeed(data)
908
+ * })
909
+ * )
910
+ *
911
+ * const program = Effect.gen(function*() {
912
+ * const crypto = yield* Crypto.Crypto
913
+ * return yield* crypto.randomBytes(32)
914
+ * })
915
+ *
916
+ * Effect.runPromise(Effect.provide(program, TestCrypto))
917
+ * ```
918
+ *
919
+ * @since 4.0.0
920
+ */
921
+ export * as Crypto from "./Crypto.js";
748
922
  /**
749
923
  * Immutable data constructors with discriminated-union support.
750
924
  *
@@ -820,6 +994,55 @@ export * as Cron from "./Cron.js";
820
994
  */
821
995
  export * as Data from "./Data.js";
822
996
  /**
997
+ * The `DateTime` module provides immutable data types and utilities for working
998
+ * with instants, UTC date-times, zoned date-times, and time zones. A
999
+ * `DateTime` is always an absolute point in time, represented internally by
1000
+ * epoch milliseconds, and may also carry a `TimeZone` for zone-aware calendar
1001
+ * parts and formatting.
1002
+ *
1003
+ * **Mental model**
1004
+ *
1005
+ * - `DateTime` is a discriminated union: `Utc | Zoned`
1006
+ * - `Utc` stores an absolute instant without an associated time zone
1007
+ * - `Zoned` stores the same kind of absolute instant plus a `TimeZone`
1008
+ * - Time zones can be fixed offsets or named IANA zones such as `"Europe/Rome"`
1009
+ * - Comparison and ordering use the instant, so two values in different zones
1010
+ * can still be equivalent
1011
+ * - Calendar parts and formatted output depend on whether you ask for UTC parts
1012
+ * or zone-adjusted parts
1013
+ *
1014
+ * **Common tasks**
1015
+ *
1016
+ * - Construct values: {@link make}, {@link makeUnsafe}, {@link makeZoned}, {@link makeZonedUnsafe}
1017
+ * - Get the current instant: {@link now}, {@link nowInCurrentZone}
1018
+ * - Create time zones: {@link zoneMakeOffset}, {@link zoneMakeNamed}, {@link zoneFromString}
1019
+ * - Attach or change zones: {@link setZone}, {@link setZoneNamed}, {@link setZoneCurrent}, {@link toUtc}
1020
+ * - Convert to platform values or parts: {@link toDate}, {@link toDateUtc}, {@link toEpochMillis}, {@link toParts}, {@link toPartsUtc}
1021
+ * - Compare and bound values: {@link Equivalence}, {@link Order}, {@link distance}, {@link min}, {@link max}, {@link clamp}, {@link between}
1022
+ * - Transform values: {@link add}, {@link subtract}, {@link startOf}, {@link endOf}, {@link nearest}, {@link setParts}, {@link mutate}
1023
+ * - Format values: {@link format}, {@link formatUtc}, {@link formatLocal}, {@link formatIntl}, {@link formatIso}, {@link formatIsoZoned}
1024
+ * - Provide an application time zone: {@link CurrentTimeZone}, {@link withCurrentZone}, {@link layerCurrentZone}
1025
+ *
1026
+ * **Gotchas**
1027
+ *
1028
+ * - `make` and `makeZoned` return `Option`; unsafe constructors throw on invalid
1029
+ * input
1030
+ * - `DateTime` equality is instant-based, not display-time-based
1031
+ * - `setZone` changes the zone used for local parts and formatting without
1032
+ * changing the represented instant
1033
+ * - Use `adjustForTimeZone` with {@link makeZoned} when input parts should be
1034
+ * interpreted as wall-clock time in the target zone
1035
+ * - Daylight-saving gaps and repeated local times are resolved with
1036
+ * `Disambiguation`
1037
+ * - Prefer the Clock-backed {@link now} and `CurrentTimeZone` services in
1038
+ * Effect workflows; unsafe helpers read from the host environment directly
1039
+ *
1040
+ * **See also**
1041
+ *
1042
+ * - {@link DateTime} for the UTC/zoned data model
1043
+ * - {@link TimeZone} for offset and named time-zone values
1044
+ * - {@link Disambiguation} for daylight-saving ambiguity handling
1045
+ *
823
1046
  * @since 3.6.0
824
1047
  */
825
1048
  export * as DateTime from "./DateTime.js";
@@ -894,6 +1117,42 @@ export * as DateTime from "./DateTime.js";
894
1117
  */
895
1118
  export * as Deferred from "./Deferred.js";
896
1119
  /**
1120
+ * The `Differ` module defines the core abstraction for describing changes to a
1121
+ * value. A `Differ<T, Patch>` knows how to compare two `T` values, produce a
1122
+ * patch that represents the difference, combine multiple patches, and apply a
1123
+ * patch to an old value to obtain the updated value.
1124
+ *
1125
+ * **Mental model**
1126
+ *
1127
+ * - A differ separates "what changed" from "the value after the change"
1128
+ * - `diff(oldValue, newValue)` produces a `Patch` that can later be applied
1129
+ * - `patch(oldValue, patch)` replays a patch against a value of the same domain
1130
+ * - `empty` is the identity patch: applying it should leave the value unchanged
1131
+ * - `combine(first, second)` composes patches in sequence, where `second`
1132
+ * represents changes that happen after `first`
1133
+ * - Patch types are chosen by the differ implementation and may be compact,
1134
+ * domain-specific, or compatible with a serialization format such as JSON
1135
+ * Patch
1136
+ *
1137
+ * **Common tasks**
1138
+ *
1139
+ * - Construct a differ by providing the four operations of the {@link Differ}
1140
+ * interface
1141
+ * - Compute a patch with `diff` when you have an old value and a new value
1142
+ * - Store, transmit, or aggregate patches instead of storing full replacement
1143
+ * values
1144
+ * - Combine incremental updates with `combine` before applying them
1145
+ * - Apply updates with `patch` to reconstruct the next value from a previous
1146
+ * value and a patch
1147
+ *
1148
+ * **Gotchas**
1149
+ *
1150
+ * - `combine` is order-sensitive for most patch formats
1151
+ * - A patch is generally meaningful only for values that belong to the same
1152
+ * domain and assumptions used by the differ that created it
1153
+ * - Differs should make `empty` a true identity and should make combined
1154
+ * patches behave the same as applying the original patches in order
1155
+ *
897
1156
  * @since 4.0.0
898
1157
  */
899
1158
  export * as Differ from "./Differ.js";
@@ -935,7 +1194,7 @@ export * as Duration from "./Duration.js";
935
1194
  * - **Testable**: Built-in support for testing with controlled environments
936
1195
  * - **Interruptible**: Effects can be safely interrupted and cancelled
937
1196
  *
938
- * **Example** (Usage)
1197
+ * **Example** (Creating and running effects)
939
1198
  *
940
1199
  * ```ts
941
1200
  * import { Console, Effect } from "effect"
@@ -954,7 +1213,7 @@ export * as Duration from "./Duration.js";
954
1213
  * Effect.runPromise(program).then(console.log) // 13
955
1214
  * ```
956
1215
  *
957
- * **Example** (Usage)
1216
+ * **Example** (Handling typed failures)
958
1217
  *
959
1218
  * ```ts
960
1219
  * import { Data, Effect } from "effect"
@@ -987,6 +1246,41 @@ export * as Duration from "./Duration.js";
987
1246
  */
988
1247
  export * as Effect from "./Effect.js";
989
1248
  /**
1249
+ * The `Effectable` module provides low-level building blocks for defining
1250
+ * custom values that behave like `Effect`s. It is primarily used by library
1251
+ * authors who need domain-specific effect-like data types, such as service
1252
+ * keys, configuration descriptions, prompts, or other declarative programs
1253
+ * that can be yielded inside `Effect.gen`.
1254
+ *
1255
+ * **Mental model**
1256
+ *
1257
+ * - `Effectable` does not run effects by itself; it provides prototypes that
1258
+ * implement the internal Effect protocol.
1259
+ * - {@link Prototype} creates a primitive Effect prototype with a custom
1260
+ * evaluation function that receives the current `Fiber`.
1261
+ * - {@link Class} is an abstract base class for defining custom classes whose
1262
+ * instances are also `Effect` values.
1263
+ * - The success, error, and service requirements of the custom type are
1264
+ * preserved through the `Effect.Effect<A, E, R>` type parameters.
1265
+ *
1266
+ * **Common tasks**
1267
+ *
1268
+ * - Build an effect-like interface around a declarative data structure.
1269
+ * - Implement a custom `evaluate` hook that interprets the value in terms of
1270
+ * the current fiber and returns the underlying `Effect`.
1271
+ * - Extend {@link Class} when a nominal class-based API is more convenient
1272
+ * than manually wiring a prototype.
1273
+ *
1274
+ * **Gotchas**
1275
+ *
1276
+ * - This module is intentionally low-level; most application code should use
1277
+ * `Effect` constructors and combinators instead.
1278
+ * - `evaluate` must return an `Effect` with the same success, error, and
1279
+ * service types as the custom value.
1280
+ * - Because these APIs participate in the internal Effect protocol, keep
1281
+ * implementations small and follow existing modules such as `Config` and
1282
+ * `Context` when adding new effect-like types.
1283
+ *
990
1284
  * @since 4.0.0
991
1285
  */
992
1286
  export * as Effectable from "./Effectable.js";
@@ -1175,6 +1469,43 @@ export * as Equivalence from "./Equivalence.js";
1175
1469
  */
1176
1470
  export * as ErrorReporter from "./ErrorReporter.js";
1177
1471
  /**
1472
+ * The `ExecutionPlan` module provides a way to describe ordered fallback
1473
+ * strategies for effects and streams that need different resources across
1474
+ * repeated attempts. An `ExecutionPlan` is a non-empty list of steps, where
1475
+ * each step supplies a `Context` or `Layer` and may control retries with an
1476
+ * attempt limit, a `Schedule`, or a `while` predicate.
1477
+ *
1478
+ * **Mental model**
1479
+ *
1480
+ * - A plan is evaluated step by step until the wrapped effect or stream
1481
+ * succeeds, or until every step has been exhausted
1482
+ * - Each step provides the services used while that step is active
1483
+ * - `attempts` limits how many times a step may be tried
1484
+ * - `schedule` controls retry timing and receives the failure input
1485
+ * - `while` can stop retrying a step based on the failure input
1486
+ * - `CurrentMetadata` exposes the current 1-based attempt and 0-based step
1487
+ * index to code running under a plan
1488
+ *
1489
+ * **Common tasks**
1490
+ *
1491
+ * - Build a plan with {@link make}
1492
+ * - Run an effect with a plan using `Effect.withExecutionPlan`
1493
+ * - Run a stream with a plan using `Stream.withExecutionPlan`
1494
+ * - Combine plans in order with {@link merge}
1495
+ * - Capture required services up front with `captureRequirements`
1496
+ * - Inspect the current attempt and step with {@link CurrentMetadata}
1497
+ *
1498
+ * **Gotchas**
1499
+ *
1500
+ * - Plans must contain at least one step
1501
+ * - `attempts` must be greater than zero when provided
1502
+ * - If `attempts` is omitted, a step is attempted once unless a `schedule` is
1503
+ * provided
1504
+ * - A `while` predicate returning `false` skips the remaining retries for that
1505
+ * step and moves the plan forward
1506
+ * - Layer, schedule, and predicate requirements are tracked in the plan type
1507
+ * until they are provided or captured
1508
+ *
1178
1509
  * @since 3.16.0
1179
1510
  */
1180
1511
  export * as ExecutionPlan from "./ExecutionPlan.js";
@@ -1314,14 +1645,125 @@ export * as Exit from "./Exit.js";
1314
1645
  */
1315
1646
  export * as Fiber from "./Fiber.js";
1316
1647
  /**
1648
+ * The `FiberHandle` module provides a scoped handle for managing the lifecycle
1649
+ * of at most one fiber at a time. A `FiberHandle<A, E>` can hold one
1650
+ * `Fiber<A, E>`; when a new fiber is installed, the previous fiber is
1651
+ * interrupted unless the operation is configured with `onlyIfMissing`.
1652
+ *
1653
+ * **Mental model**
1654
+ *
1655
+ * - A handle is either open with zero or one current fiber, or closed by its
1656
+ * surrounding `Scope`
1657
+ * - Closing the scope interrupts the current fiber and prevents new work from
1658
+ * being accepted
1659
+ * - Completed fibers remove themselves from the handle, so the handle can be
1660
+ * reused for later work
1661
+ * - Replacing a fiber uses the handle's internal interruption id, allowing
1662
+ * expected replacement interruptions to be distinguished from real failures
1663
+ *
1664
+ * **Common tasks**
1665
+ *
1666
+ * - Create a scoped handle: {@link make}
1667
+ * - Fork an effect into the handle: {@link run}
1668
+ * - Store an existing fiber: {@link set}
1669
+ * - Read or clear the current fiber: {@link get}, {@link clear}
1670
+ * - Capture runtime-specific runners: {@link makeRuntime}, {@link runtime}
1671
+ * - Run handled effects as Promises: {@link makeRuntimePromise},
1672
+ * {@link runtimePromise}
1673
+ * - Wait for failure or closure: {@link join}
1674
+ * - Wait until the current fiber is gone: {@link awaitEmpty}
1675
+ *
1676
+ * **Gotchas**
1677
+ *
1678
+ * - The handle never contains more than one live fiber; starting or setting
1679
+ * another fiber interrupts the previous one by default
1680
+ * - Use `onlyIfMissing` when a call should leave an already running fiber in
1681
+ * place instead of replacing it
1682
+ * - `join` observes the handle's failure/close signal; successful fiber
1683
+ * completion only empties the handle
1684
+ * - `awaitEmpty` waits for the fiber that is current when it starts; later
1685
+ * calls to {@link run} or {@link set} can install new work
1686
+ *
1317
1687
  * @since 2.0.0
1318
1688
  */
1319
1689
  export * as FiberHandle from "./FiberHandle.js";
1320
1690
  /**
1691
+ * The `FiberMap` module provides a scoped, mutable collection for managing
1692
+ * fibers by key. A `FiberMap<K, A, E>` owns a set of running fibers, interrupts
1693
+ * them when its scope closes, and automatically removes each entry when the
1694
+ * corresponding fiber completes.
1695
+ *
1696
+ * **Mental model**
1697
+ *
1698
+ * - A `FiberMap` is a keyed registry of fibers with lifecycle management
1699
+ * - Keys identify the currently active fiber for a logical task or resource
1700
+ * - Adding a fiber under an existing key interrupts the previous fiber by default
1701
+ * - Completed fibers remove themselves from the map if they are still current
1702
+ * - Closing the map's scope interrupts every fiber that remains in the map
1703
+ * - The map can surface the first non-ignored managed fiber failure via {@link join}
1704
+ *
1705
+ * **Common tasks**
1706
+ *
1707
+ * - Create a scoped map: {@link make}
1708
+ * - Fork effects into the map: {@link run}
1709
+ * - Add existing fibers: {@link set}
1710
+ * - Create captured runners: {@link makeRuntime}, {@link runtime}
1711
+ * - Bridge to Promise-based callers: {@link makeRuntimePromise}, {@link runtimePromise}
1712
+ * - Inspect entries: {@link get}, {@link has}, {@link size}
1713
+ * - Stop work: {@link remove}, {@link clear}
1714
+ * - Coordinate completion or failure: {@link awaitEmpty}, {@link join}
1715
+ *
1716
+ * **Gotchas**
1717
+ *
1718
+ * - `FiberMap` is scoped; use it with `Effect.scoped` or another scope owner so
1719
+ * managed fibers are interrupted when the scope closes
1720
+ * - Reusing a key is a replacement operation unless `onlyIfMissing` is enabled
1721
+ * - `join` waits for the map to fail or close; use {@link awaitEmpty} to wait
1722
+ * until all currently managed fibers have completed
1723
+ * - The `Unsafe` variants mutate synchronously and should only be used when the
1724
+ * caller already controls the surrounding execution context
1725
+ *
1321
1726
  * @since 2.0.0
1322
1727
  */
1323
1728
  export * as FiberMap from "./FiberMap.js";
1324
1729
  /**
1730
+ * The `FiberSet` module provides a scoped container for managing many fibers as
1731
+ * one lifecycle. A `FiberSet<A, E>` tracks fibers whose successful values are
1732
+ * compatible with `A` and whose failures are compatible with `E`, removes each
1733
+ * fiber when it completes, and interrupts all still-running fibers when the
1734
+ * owning `Scope` closes.
1735
+ *
1736
+ * **Mental model**
1737
+ *
1738
+ * - A `FiberSet` is an owned, scoped collection of fibers
1739
+ * - Fibers can be added directly with {@link add} / {@link addUnsafe}
1740
+ * - Effects can be forked into the set with {@link run}, {@link runtime}, or
1741
+ * {@link runtimePromise}
1742
+ * - Completed fibers are automatically removed from the set
1743
+ * - Closing the scope or calling {@link clear} interrupts the currently tracked
1744
+ * fibers
1745
+ * - {@link join} waits for the set's first non-ignored failure, while
1746
+ * {@link awaitEmpty} waits until all tracked fibers have completed
1747
+ *
1748
+ * **Common tasks**
1749
+ *
1750
+ * - Create a scoped set: {@link make}
1751
+ * - Create scoped runners: {@link makeRuntime}, {@link makeRuntimePromise}
1752
+ * - Add an existing fiber: {@link add}
1753
+ * - Fork an effect into the set: {@link run}
1754
+ * - Interrupt tracked fibers: {@link clear}
1755
+ * - Observe the set: {@link size}, {@link awaitEmpty}, {@link join}
1756
+ * - Check a value: {@link isFiberSet}
1757
+ *
1758
+ * **Gotchas**
1759
+ *
1760
+ * - `FiberSet` values are scoped; use them inside `Effect.scoped` or another
1761
+ * scope owner so their fibers are interrupted reliably
1762
+ * - Adding or running into a closed set interrupts the fiber immediately
1763
+ * - By default, interruptions are not treated as failures for {@link join};
1764
+ * use the `propagateInterruption` option when interruption should be
1765
+ * propagated
1766
+ *
1325
1767
  * @since 2.0.0
1326
1768
  */
1327
1769
  export * as FiberSet from "./FiberSet.js";
@@ -1365,6 +1807,40 @@ export * as FiberSet from "./FiberSet.js";
1365
1807
  */
1366
1808
  export * as FileSystem from "./FileSystem.js";
1367
1809
  /**
1810
+ * The `Filter` module provides composable functions for accepting, rejecting,
1811
+ * narrowing, and transforming values. A `Filter<Input, Pass, Fail>` receives an
1812
+ * input and returns a `Result`: success means the value passed the filter, while
1813
+ * failure means the value was filtered out.
1814
+ *
1815
+ * **Mental model**
1816
+ *
1817
+ * - A filter is a typed predicate that can also transform the successful value
1818
+ * - Predicate-based filters pass the original input when the predicate returns `true`
1819
+ * - Refinement-based filters narrow the successful type, for example from `unknown` to `string`
1820
+ * - Custom filters return `Result.succeed(pass)` or `Result.fail(fail)` directly
1821
+ * - Filters compose with logical and sequential combinators instead of throwing exceptions
1822
+ * - `FilterEffect` is the effectful form for filters that need asynchronous work, errors, or services
1823
+ *
1824
+ * **Common tasks**
1825
+ *
1826
+ * - Build filters: {@link make}, {@link makeEffect}, {@link fromPredicate}, {@link fromPredicateOption}
1827
+ * - Narrow unknown values: {@link string}, {@link number}, {@link boolean}, {@link bigint}, {@link symbol}, {@link date}
1828
+ * - Match shapes and variants: {@link instanceOf}, {@link tagged}, {@link reason}, {@link has}
1829
+ * - Match exact values: {@link equals}, {@link equalsStrict}
1830
+ * - Combine alternatives: {@link or}
1831
+ * - Require multiple filters: {@link zip}, {@link zipWith}, {@link andLeft}, {@link andRight}
1832
+ * - Run filters in sequence: {@link compose}, {@link composePassthrough}
1833
+ * - Convert results: {@link toPredicate}, {@link toOption}, {@link toResult}
1834
+ * - Adjust failure values: {@link mapFail}
1835
+ *
1836
+ * **Gotchas**
1837
+ *
1838
+ * - A failed filter is data in the `Result` failure channel; it is not an exception
1839
+ * - `compose` preserves intermediate failure values, while {@link composePassthrough} fails with the original input
1840
+ * - `equalsStrict` uses JavaScript `===`; use {@link equals} for structural equality
1841
+ * - `fromPredicateOption` fails with the original input when the returned `Option` is `None`
1842
+ * - Prefer refinement predicates when you want TypeScript to narrow the successful value type
1843
+ *
1368
1844
  * @since 4.0.0
1369
1845
  */
1370
1846
  export * as Filter from "./Filter.js";
@@ -1424,10 +1900,105 @@ export * as Filter from "./Filter.js";
1424
1900
  */
1425
1901
  export * as Formatter from "./Formatter.js";
1426
1902
  /**
1903
+ * The `Function` module provides small, pure helpers for defining, composing,
1904
+ * adapting, and reusing TypeScript functions. It is the foundation for the
1905
+ * data-first and data-last APIs used throughout Effect, and it includes the
1906
+ * core pipeline utilities that make those APIs ergonomic.
1907
+ *
1908
+ * **Mental model**
1909
+ *
1910
+ * - {@link pipe} starts with a value and passes it through one unary function at
1911
+ * a time
1912
+ * - {@link flow} composes unary functions into a reusable function
1913
+ * - {@link dual} builds APIs that support both direct calls and `pipe`-friendly
1914
+ * data-last calls
1915
+ * - {@link identity}, {@link constant}, and the `const*` helpers model common
1916
+ * identity and thunk patterns without allocating ad hoc callbacks
1917
+ * - {@link tupled}, {@link untupled}, {@link flip}, and {@link apply} adapt
1918
+ * call shapes without changing the underlying behavior
1919
+ * - Type helpers such as {@link LazyArg}, {@link FunctionN}, {@link satisfies},
1920
+ * and {@link cast} describe or constrain functions at the type level
1921
+ *
1922
+ * **Common tasks**
1923
+ *
1924
+ * - Build readable transformation pipelines: {@link pipe}
1925
+ * - Create reusable composed functions: {@link flow}, {@link compose}
1926
+ * - Define functions callable in both data-first and data-last style: {@link dual}
1927
+ * - Return a value unchanged: {@link identity}
1928
+ * - Create thunks and common constant functions: {@link constant},
1929
+ * {@link constTrue}, {@link constFalse}, {@link constNull},
1930
+ * {@link constUndefined}, {@link constVoid}
1931
+ * - Convert between rest-argument and tuple-argument functions: {@link tupled},
1932
+ * {@link untupled}
1933
+ * - Express impossible branches: {@link absurd}
1934
+ * - Cache results for object keys: {@link memoize}
1935
+ *
1936
+ * **Gotchas**
1937
+ *
1938
+ * - Functions passed to {@link pipe} and {@link flow} are applied left-to-right
1939
+ * and should be unary at each step
1940
+ * - {@link dual} uses either an arity or a predicate to decide whether a call is
1941
+ * data-first or data-last; use a predicate when optional arguments make arity
1942
+ * ambiguous
1943
+ * - {@link cast} changes only the static TypeScript type and performs no runtime
1944
+ * validation
1945
+ * - {@link memoize} is intended for object keys and stores cached values in a
1946
+ * `WeakMap`
1947
+ *
1427
1948
  * @since 2.0.0
1428
1949
  */
1429
1950
  export * as Function from "./Function.js";
1430
1951
  /**
1952
+ * The `Graph` module provides immutable and scoped-mutable graph data
1953
+ * structures for modeling relationships between indexed nodes and edges. A
1954
+ * graph can be directed or undirected, stores user-defined data on both nodes
1955
+ * and edges, and exposes traversal, analysis, path finding, transformation, and
1956
+ * diagram export utilities.
1957
+ *
1958
+ * **Mental model**
1959
+ *
1960
+ * - Nodes and edges are addressed by stable numeric indices: {@link NodeIndex}
1961
+ * and {@link EdgeIndex}
1962
+ * - Node data has type `N`; edge data has type `E`
1963
+ * - {@link Graph} values are immutable snapshots; use {@link MutableGraph}
1964
+ * through {@link mutate}, {@link beginMutation}, or constructor callbacks to
1965
+ * add, remove, or update nodes and edges
1966
+ * - Directed graphs follow edge direction for neighbors and traversals, while
1967
+ * undirected graphs treat each edge as connecting both endpoints
1968
+ * - Missing lookups return `Option`, while structurally invalid operations such
1969
+ * as adding an edge to a missing node throw {@link GraphError}
1970
+ *
1971
+ * **Common tasks**
1972
+ *
1973
+ * - Create graphs: {@link directed}, {@link undirected}
1974
+ * - Mutate safely: {@link mutate}, {@link addNode}, {@link addEdge},
1975
+ * {@link removeNode}, {@link removeEdge}
1976
+ * - Query contents: {@link getNode}, {@link getEdge}, {@link hasNode},
1977
+ * {@link hasEdge}, {@link nodeCount}, {@link edgeCount}, {@link neighbors}
1978
+ * - Transform data: {@link updateNode}, {@link updateEdge}, {@link mapNodes},
1979
+ * {@link mapEdges}, {@link filterNodes}, {@link filterEdges},
1980
+ * {@link filterMapNodes}, {@link filterMapEdges}
1981
+ * - Traverse lazily: {@link dfs}, {@link bfs}, {@link topo},
1982
+ * {@link dfsPostOrder}, {@link nodes}, {@link edges}, {@link Walker}
1983
+ * - Analyze structure: {@link isAcyclic}, {@link isBipartite},
1984
+ * {@link connectedComponents}, {@link stronglyConnectedComponents},
1985
+ * {@link externals}
1986
+ * - Find paths: {@link dijkstra}, {@link astar}, {@link bellmanFord},
1987
+ * {@link floydWarshall}
1988
+ * - Export diagrams: {@link toGraphViz}, {@link toMermaid}
1989
+ *
1990
+ * **Gotchas**
1991
+ *
1992
+ * - Only mutable graphs can be changed. Create one with {@link mutate} or by
1993
+ * passing a callback to {@link directed} / {@link undirected}.
1994
+ * - Traversal APIs return lazy {@link Walker} values. Use {@link indices},
1995
+ * {@link values}, or {@link entries} to choose what each iteration yields.
1996
+ * - `NodeIndex` and `EdgeIndex` values are identifiers, not array offsets. They
1997
+ * are not reused after removals.
1998
+ * - Shortest-path algorithms require a cost function. {@link dijkstra} and
1999
+ * {@link astar} reject negative weights; use {@link bellmanFord} or
2000
+ * {@link floydWarshall} when negative weights are part of the model.
2001
+ *
1431
2002
  * @since 4.0.0
1432
2003
  */
1433
2004
  export * as Graph from "./Graph.js";
@@ -1442,14 +2013,182 @@ export * as Graph from "./Graph.js";
1442
2013
  */
1443
2014
  export * as Hash from "./Hash.js";
1444
2015
  /**
2016
+ * The `HashMap` module provides an immutable key-value data structure with
2017
+ * efficient lookup, insertion, removal, and transformation operations. A
2018
+ * `HashMap<Key, Value>` stores entries by hashing keys and resolving matches
2019
+ * with Effect's structural equality semantics.
2020
+ *
2021
+ * **Mental model**
2022
+ *
2023
+ * - A `HashMap<Key, Value>` is an immutable collection of key-value pairs
2024
+ * - Operations such as {@link set}, {@link remove}, and {@link modifyAt} return
2025
+ * new maps; existing maps are not mutated
2026
+ * - Keys are compared using the `Equal` protocol and are grouped by hashes from
2027
+ * the `Hash` protocol
2028
+ * - Plain JavaScript primitives work as keys, and custom objects can define
2029
+ * `Equal` / `Hash` behavior for structural lookup
2030
+ * - Lookups with {@link get} return an `Option`, making missing keys explicit
2031
+ * - Iteration order is based on the map's internal hash structure and should
2032
+ * not be treated as insertion order
2033
+ *
2034
+ * **Common tasks**
2035
+ *
2036
+ * - Create maps: {@link empty}, {@link make}, {@link fromIterable}
2037
+ * - Read values: {@link get}, {@link getUnsafe}, {@link has}, {@link hasBy}
2038
+ * - Add or update entries: {@link set}, {@link modify}, {@link modifyAt}, {@link setMany}
2039
+ * - Remove entries: {@link remove}, {@link removeMany}
2040
+ * - Combine maps: {@link union}
2041
+ * - Iterate or convert: {@link keys}, {@link values}, {@link entries}, {@link toValues}, {@link toEntries}
2042
+ * - Transform values: {@link map}, {@link flatMap}, {@link filter}, {@link filterMap}, {@link compact}
2043
+ * - Fold and search: {@link reduce}, {@link findFirst}, {@link some}, {@link every}
2044
+ * - Batch updates efficiently: {@link mutate}, {@link beginMutation}, {@link endMutation}
2045
+ *
2046
+ * **Gotchas**
2047
+ *
2048
+ * - {@link getUnsafe} throws when the key is absent; prefer {@link get} unless
2049
+ * absence is impossible by construction
2050
+ * - Mutating a key object after insertion can make future lookups fail if its
2051
+ * equality or hash changes
2052
+ * - Hash collisions are handled by equality checks, so matching hashes alone do
2053
+ * not make two keys equal
2054
+ * - Use {@link getHash} and {@link hasHash} only when you already have the
2055
+ * correct hash for the same key
2056
+ * - Convert entries to an array and sort them when deterministic presentation is
2057
+ * required
2058
+ *
2059
+ * **Quickstart**
2060
+ *
2061
+ * **Example** (Working with immutable maps)
2062
+ *
2063
+ * ```ts
2064
+ * import { HashMap, Option } from "effect"
2065
+ *
2066
+ * const scores = HashMap.make(["alice", 10], ["bob", 15])
2067
+ *
2068
+ * const updated = scores.pipe(
2069
+ * HashMap.set("carol", 20),
2070
+ * HashMap.modify("alice", (score) => score + 1)
2071
+ * )
2072
+ *
2073
+ * console.log(HashMap.get(updated, "alice"))
2074
+ * // Output: Option.some(11)
2075
+ *
2076
+ * console.log(HashMap.get(scores, "carol"))
2077
+ * // Output: Option.none()
2078
+ *
2079
+ * console.log(Option.getOrElse(HashMap.get(updated, "dave"), () => 0))
2080
+ * // Output: 0
2081
+ * ```
2082
+ *
2083
+ * **See also**
2084
+ *
2085
+ * - {@link HashSet} for immutable sets backed by hash semantics
2086
+ * - {@link Equal} for structural equality
2087
+ * - {@link Hash} for hash implementations used by hashed collections
2088
+ *
1445
2089
  * @since 2.0.0
1446
2090
  */
1447
2091
  export * as HashMap from "./HashMap.js";
1448
2092
  /**
2093
+ * The `HashRing` module provides a weighted consistent-hashing data structure
2094
+ * for assigning arbitrary string inputs to a changing set of nodes. A hash ring
2095
+ * minimizes remapping when nodes are added, removed, or reweighted, which makes
2096
+ * it useful for routing requests, partitioning keys, and distributing shards
2097
+ * across service instances or storage backends.
2098
+ *
2099
+ * **Mental model**
2100
+ *
2101
+ * - Each node is identified by its {@link PrimaryKey.PrimaryKey} value
2102
+ * - {@link add} and {@link addMany} place weighted virtual points on the ring
2103
+ * - {@link get} hashes an input string and returns the nearest node on the ring
2104
+ * - {@link getShards} assigns a fixed number of shard indexes across the nodes
2105
+ * - Higher weights receive proportionally more virtual points and shard
2106
+ * allocations
2107
+ * - Operations mutate and return the same ring instance
2108
+ *
2109
+ * **Common tasks**
2110
+ *
2111
+ * - Create an empty ring: {@link make}
2112
+ * - Add or update nodes: {@link add}, {@link addMany}
2113
+ * - Remove nodes: {@link remove}
2114
+ * - Check membership by primary key: {@link has}
2115
+ * - Route an input key to a node: {@link get}
2116
+ * - Precompute shard ownership: {@link getShards}
2117
+ * - Guard unknown values: {@link isHashRing}
2118
+ *
2119
+ * **Gotchas**
2120
+ *
2121
+ * - Empty rings return `undefined` from {@link get} and {@link getShards}
2122
+ * - Nodes with the same primary key represent the same ring member
2123
+ * - Weights are clamped to a positive minimum so a node remains represented
2124
+ * - Mutating a ring in place is intentional; create a new ring when independent
2125
+ * snapshots are required
2126
+ *
2127
+ * **Quickstart**
2128
+ *
2129
+ * **Example** (Routing keys across nodes)
2130
+ *
2131
+ * ```ts
2132
+ * import { HashRing, PrimaryKey } from "effect"
2133
+ *
2134
+ * class Node implements PrimaryKey.PrimaryKey {
2135
+ * constructor(readonly id: string) {}
2136
+ *
2137
+ * [PrimaryKey.symbol](): string {
2138
+ * return this.id
2139
+ * }
2140
+ * }
2141
+ *
2142
+ * const ring = HashRing.make<Node>().pipe(
2143
+ * HashRing.add(new Node("node-a")),
2144
+ * HashRing.add(new Node("node-b"), { weight: 2 })
2145
+ * )
2146
+ *
2147
+ * const owner = HashRing.get(ring, "user:123")
2148
+ * console.log(owner ? PrimaryKey.value(owner) : undefined)
2149
+ * ```
2150
+ *
1449
2151
  * @since 4.0.0
1450
2152
  */
1451
2153
  export * as HashRing from "./HashRing.js";
1452
2154
  /**
2155
+ * The `HashSet` module provides an immutable set data structure for storing
2156
+ * unique values with efficient membership checks, additions, removals, and set
2157
+ * operations. A `HashSet<A>` contains at most one value for each equality class
2158
+ * as determined by Effect's `Equal` / `Hash` semantics.
2159
+ *
2160
+ * **Mental model**
2161
+ *
2162
+ * - `HashSet<A>` is an immutable collection of unique values of type `A`
2163
+ * - Operations such as {@link add}, {@link remove}, {@link union}, and
2164
+ * {@link difference} return new sets; the input set is never mutated
2165
+ * - Membership is checked with {@link has}, using Effect equality and hashing
2166
+ * rather than array-style linear scanning
2167
+ * - Duplicate values are collapsed when using {@link make}, {@link fromIterable},
2168
+ * {@link add}, or {@link map}
2169
+ * - `HashSet` is iterable, but iteration order is not a sorting guarantee
2170
+ *
2171
+ * **Common tasks**
2172
+ *
2173
+ * - Create sets: {@link empty}, {@link make}, {@link fromIterable}
2174
+ * - Check membership and size: {@link has}, {@link size}, {@link isEmpty}
2175
+ * - Add or remove values: {@link add}, {@link remove}
2176
+ * - Combine sets: {@link union}, {@link intersection}, {@link difference}
2177
+ * - Compare sets: {@link isSubset}
2178
+ * - Transform or select values: {@link map}, {@link filter}
2179
+ * - Test values: {@link some}, {@link every}
2180
+ * - Fold values: {@link reduce}
2181
+ *
2182
+ * **Gotchas**
2183
+ *
2184
+ * - Values that should compare structurally should implement compatible
2185
+ * `Equal` and `Hash` behavior; otherwise object identity may affect whether
2186
+ * values are considered distinct
2187
+ * - {@link map} may reduce the set size when multiple input values map to the
2188
+ * same output value
2189
+ * - Do not rely on iteration order for deterministic presentation; sort the
2190
+ * values after converting to an array when order matters
2191
+ *
1453
2192
  * @since 2.0.0
1454
2193
  */
1455
2194
  export * as HashSet from "./HashSet.js";
@@ -1504,8 +2243,7 @@ export * as HKT from "./HKT.js";
1504
2243
  * **Example** (Creating inspectable values)
1505
2244
  *
1506
2245
  * ```ts
1507
- * import { Inspectable } from "effect"
1508
- * import { format } from "effect/Formatter"
2246
+ * import { Formatter, Inspectable } from "effect"
1509
2247
  *
1510
2248
  * class User extends Inspectable.Class {
1511
2249
  * constructor(
@@ -1526,7 +2264,7 @@ export * as HKT from "./HKT.js";
1526
2264
  *
1527
2265
  * const user = new User("Alice", "alice@example.com")
1528
2266
  * console.log(user.toString()) // Pretty printed JSON
1529
- * console.log(format(user)) // Same as toString()
2267
+ * console.log(Formatter.format(user)) // Same as toString()
1530
2268
  * ```
1531
2269
  *
1532
2270
  * @since 2.0.0
@@ -1600,7 +2338,7 @@ export * as Iterable from "./Iterable.js";
1600
2338
  * **Example** (Computing and applying a patch)
1601
2339
  *
1602
2340
  * ```ts
1603
- * import * as JsonPatch from "effect/JsonPatch"
2341
+ * import { JsonPatch } from "effect"
1604
2342
  *
1605
2343
  * const oldValue = { name: "Alice", age: 30 }
1606
2344
  * const newValue = { name: "Alice", age: 31, city: "NYC" }
@@ -1654,15 +2392,15 @@ export * as JsonPatch from "./JsonPatch.js";
1654
2392
  * **Example** (Building and parsing a JSON Pointer)
1655
2393
  *
1656
2394
  * ```ts
1657
- * import { escapeToken, unescapeToken } from "effect/JsonPointer"
2395
+ * import { JsonPointer } from "effect"
1658
2396
  *
1659
2397
  * // Build a JSON Pointer from path segments
1660
2398
  * const segments = ["users", "name/alias", "value"]
1661
- * const pointer = "/" + segments.map(escapeToken).join("/")
2399
+ * const pointer = "/" + segments.map(JsonPointer.escapeToken).join("/")
1662
2400
  * // "/users/name~1alias/value"
1663
2401
  *
1664
2402
  * // Parse a JSON Pointer back to segments
1665
- * const tokens = pointer.split("/").slice(1).map(unescapeToken)
2403
+ * const tokens = pointer.split("/").slice(1).map(JsonPointer.unescapeToken)
1666
2404
  * // ["users", "name/alias", "value"]
1667
2405
  * ```
1668
2406
  *
@@ -1762,7 +2500,39 @@ export * as JsonPointer from "./JsonPointer.js";
1762
2500
  */
1763
2501
  export * as JsonSchema from "./JsonSchema.js";
1764
2502
  /**
1765
- * @since 3.8.0
2503
+ * The `Latch` module provides a reusable synchronization primitive for
2504
+ * coordinating fibers. A `Latch` is either open or closed: when it is closed,
2505
+ * fibers that use {@link await} or {@link whenOpen} suspend until the latch is
2506
+ * opened or the current waiters are released.
2507
+ *
2508
+ * **Mental model**
2509
+ *
2510
+ * - An open latch lets current and future waiters continue immediately
2511
+ * - A closed latch causes `await` and `whenOpen` to suspend
2512
+ * - {@link open} permanently opens the latch until it is closed again
2513
+ * - {@link release} wakes only the fibers currently waiting and leaves the
2514
+ * latch closed for future waiters
2515
+ * - {@link close} resets the latch so later waiters suspend again
2516
+ *
2517
+ * **Common tasks**
2518
+ *
2519
+ * - Create a latch inside `Effect`: {@link make}
2520
+ * - Create a latch synchronously: {@link makeUnsafe}
2521
+ * - Wait for a signal before continuing: {@link await}
2522
+ * - Guard an effect so it runs only after the latch is open: {@link whenOpen}
2523
+ * - Let all current and future waiters proceed: {@link open}
2524
+ * - Let only the current waiters proceed: {@link release}
2525
+ * - Re-enable waiting after opening: {@link close}
2526
+ *
2527
+ * **Gotchas**
2528
+ *
2529
+ * - `release` is not the same as `open`; new waiters still suspend after the
2530
+ * current waiters are released
2531
+ * - `open` and `close` report whether they changed the latch state
2532
+ * - Prefer the effectful APIs unless synchronous allocation or mutation is
2533
+ * required
2534
+ *
2535
+ * @since 4.0.0
1766
2536
  */
1767
2537
  export * as Latch from "./Latch.js";
1768
2538
  /**
@@ -1786,228 +2556,207 @@ export * as Latch from "./Latch.js";
1786
2556
  */
1787
2557
  export * as Layer from "./Layer.js";
1788
2558
  /**
1789
- * @since 3.14.0
1790
- */
1791
- export * as LayerMap from "./LayerMap.js";
1792
- /**
1793
- * @since 2.0.0
1794
- *
1795
- * The `Logger` module provides a robust and flexible logging system for Effect applications.
1796
- * It offers structured logging, multiple output formats, and seamless integration with the
1797
- * Effect runtime's tracing and context management.
1798
- *
1799
- * ## Key Features
2559
+ * The `LayerMap` module provides utilities for managing scoped resources that
2560
+ * are selected by key and built from `Layer` values. A `LayerMap<K, I, E>` turns
2561
+ * a key into a cached service `Context<I>`, so applications can lazily acquire
2562
+ * and reuse different resource instances such as tenant clients, regional
2563
+ * connections, environment-specific services, or other keyed infrastructure.
1800
2564
  *
1801
- * - **Structured Logging**: Built-in support for structured log messages with metadata
1802
- * - **Multiple Formats**: JSON, LogFmt, Pretty, and custom formatting options
1803
- * - **Context Integration**: Automatic capture of fiber context, spans, and annotations
1804
- * - **Batching**: Efficient log aggregation and batch processing
1805
- * - **File Output**: Direct file writing with configurable batch windows
1806
- * - **Composable**: Transform and compose loggers using functional patterns
2565
+ * **Mental model**
1807
2566
  *
1808
- * ## Basic Usage
2567
+ * - A `LayerMap` is a scoped, reference-counted cache of contexts produced by layers
2568
+ * - Keys identify which layer-backed resource set should be acquired
2569
+ * - Resources are acquired on demand when a key is requested
2570
+ * - The same key reuses the cached context while it remains live
2571
+ * - Cached resources are finalized when invalidated, when their scope closes, or after idle expiration
2572
+ * - The layers built by a `LayerMap` share the current layer memoization map
1809
2573
  *
1810
- * **Example** (Logging messages with structured data)
2574
+ * **Common tasks**
1811
2575
  *
1812
- * ```ts
1813
- * import { Effect } from "effect"
2576
+ * - Create from a lookup function: {@link make}
2577
+ * - Create from a fixed record of layers: {@link fromRecord}
2578
+ * - Define a service wrapper with accessor helpers: {@link Service}
2579
+ * - Retrieve a layer for a key: {@link LayerMap.get}
2580
+ * - Retrieve a scoped context directly: {@link LayerMap.contextEffect}
2581
+ * - Force a cached entry to be rebuilt later: {@link LayerMap.invalidate}
2582
+ * - Remove idle entries automatically with the `idleTimeToLive` option
2583
+ * - Eagerly build known entries with `preloadKeys` or `preload`
1814
2584
  *
1815
- * // Basic logging
1816
- * const program = Effect.gen(function*() {
1817
- * yield* Effect.log("Application started")
1818
- * yield* Effect.logInfo("Processing user request")
1819
- * yield* Effect.logWarning("Resource limit approaching")
1820
- * yield* Effect.logError("Database connection failed")
1821
- * })
2585
+ * **Gotchas**
1822
2586
  *
1823
- * // With structured data
1824
- * const structuredLog = Effect.gen(function*() {
1825
- * yield* Effect.log("User action", { userId: 123, action: "login" })
1826
- * yield* Effect.logInfo("Request processed", { duration: 150, statusCode: 200 })
1827
- * })
1828
- * ```
2587
+ * - `contextEffect` requires a `Scope.Scope` because it exposes the acquired context directly
2588
+ * - `get` returns a `Layer` that can be provided to programs expecting the keyed services
2589
+ * - Invalidating a key finalizes the current cached resources for that key; the next access rebuilds them
2590
+ * - Preloading moves layer construction errors to `LayerMap` creation instead of first use
1829
2591
  *
1830
- * ## Custom Loggers
2592
+ * @since 3.14.0
2593
+ */
2594
+ export * as LayerMap from "./LayerMap.js";
2595
+ /**
2596
+ * The `Logger` module defines the logging model used by the Effect runtime and
2597
+ * provides constructors for formatting, routing, batching, and installing
2598
+ * loggers. A `Logger<Message, Output>` receives each runtime log event as an
2599
+ * {@link Options} value and transforms it into an output such as a string,
2600
+ * structured object, JSON line, console write, file write, or trace span event.
1831
2601
  *
1832
- * **Example** (Creating and providing custom loggers)
2602
+ * **Mental model**
1833
2603
  *
1834
- * ```ts
1835
- * import { Effect, Logger } from "effect"
2604
+ * - Effect programs emit log events with APIs such as `Effect.log`,
2605
+ * `Effect.logInfo`, `Effect.logWarning`, and `Effect.logError`
2606
+ * - Each event contains a message, log level, cause, fiber, and timestamp
2607
+ * - Loggers are ordinary values created with {@link make} and installed with
2608
+ * {@link layer}
2609
+ * - Multiple loggers can be active at once by providing a layer with several
2610
+ * logger values
2611
+ * - Formatter loggers such as {@link formatLogFmt}, {@link formatStructured},
2612
+ * and {@link formatJson} return formatted data without writing it anywhere
2613
+ * - Console loggers such as {@link consolePretty}, {@link consoleLogFmt},
2614
+ * {@link consoleStructured}, and {@link consoleJson} write formatted output
2615
+ * to the active Effect console
2616
+ *
2617
+ * **Log output structure**
2618
+ *
2619
+ * Built-in formatters include the log level, timestamp, fiber identifier, and
2620
+ * logged message. When present, they also include the pretty-printed cause,
2621
+ * active log annotations, and active log spans. Structured and JSON loggers keep
2622
+ * these fields as machine-readable data, while logfmt and pretty loggers render
2623
+ * them as human-readable text.
1836
2624
  *
1837
- * // Create a custom logger
1838
- * const customLogger = Logger.make((options) => {
1839
- * console.log(`[${options.logLevel}] ${options.message}`)
1840
- * })
2625
+ * **Common tasks**
1841
2626
  *
1842
- * // Use JSON format for production
1843
- * const jsonLogger = Logger.consoleJson
2627
+ * - Create a custom logger: {@link make}
2628
+ * - Transform logger output: {@link map}
2629
+ * - Write formatter output to the console: {@link withConsoleLog},
2630
+ * {@link withConsoleError}, {@link withLeveledConsole}
2631
+ * - Use built-in console loggers: {@link consolePretty}, {@link consoleLogFmt},
2632
+ * {@link consoleStructured}, {@link consoleJson}
2633
+ * - Use built-in formatter loggers: {@link formatSimple}, {@link formatLogFmt},
2634
+ * {@link formatStructured}, {@link formatJson}
2635
+ * - Batch logger output before flushing to a sink: {@link batched}
2636
+ * - Write string logger output to a file: {@link toFile}
2637
+ * - Preserve trace correlation by including {@link tracerLogger}
2638
+ * - Install or replace loggers for an effect: {@link layer}
1844
2639
  *
1845
- * // Pretty format for development
1846
- * const prettyLogger = Logger.consolePretty()
2640
+ * **Gotchas**
1847
2641
  *
1848
- * const program = Effect.log("Hello World").pipe(
1849
- * Effect.provide(Logger.layer([jsonLogger]))
1850
- * )
1851
- * ```
2642
+ * - {@link layer} replaces the current logger set by default; pass
2643
+ * `mergeWithExisting: true` when adding loggers to the existing runtime
2644
+ * loggers
2645
+ * - Formatter loggers only produce values; wrap them with console, file, batch,
2646
+ * or custom sink loggers when output should be written somewhere
2647
+ * - {@link batched} and {@link toFile} are scoped; keep their scope open while
2648
+ * logs are being emitted so buffered entries can flush reliably
2649
+ * - {@link toFile} accepts only loggers that output strings, so pair it with
2650
+ * string formatters such as {@link formatJson} or {@link formatLogFmt}
2651
+ * - The default runtime logger set includes {@link tracerLogger}; replacing
2652
+ * loggers without merging may remove automatic log-to-trace-span recording
1852
2653
  *
1853
- * ## Multiple Loggers
2654
+ * **Quickstart**
1854
2655
  *
1855
- * **Example** (Combining multiple loggers)
2656
+ * **Example** (Installing a JSON console logger)
1856
2657
  *
1857
2658
  * ```ts
1858
2659
  * import { Effect, Logger } from "effect"
1859
2660
  *
1860
- * // Combine multiple loggers
1861
- * const CombinedLoggerLive = Logger.layer([
1862
- * Logger.consoleJson,
1863
- * Logger.consolePretty()
1864
- * ])
1865
- *
1866
- * const program = Effect.log("Application event").pipe(
1867
- * Effect.provide(CombinedLoggerLive)
2661
+ * const program = Effect.gen(function*() {
2662
+ * yield* Effect.logInfo("request started", { method: "GET", path: "/users" })
2663
+ * yield* Effect.logError("request failed", { status: 500 })
2664
+ * }).pipe(
2665
+ * Effect.annotateLogs("service", "users-api"),
2666
+ * Effect.withLogSpan("http.request"),
2667
+ * Effect.provide(Logger.layer([Logger.consoleJson]))
1868
2668
  * )
1869
2669
  * ```
1870
2670
  *
1871
- * ## Batched Logging
1872
- *
1873
- * **Example** (Batching log messages)
2671
+ * **See also**
1874
2672
  *
1875
- * ```ts
1876
- * import { Duration, Effect, Logger } from "effect"
1877
- *
1878
- * const batchedLogger = Logger.batched(Logger.formatJson, {
1879
- * window: Duration.seconds(5),
1880
- * flush: (messages) =>
1881
- * Effect.sync(() => {
1882
- * // Process batch of log messages
1883
- * console.log("Flushing", messages.length, "log entries")
1884
- * })
1885
- * })
2673
+ * - {@link make} for defining custom loggers
2674
+ * - {@link layer} for installing loggers
2675
+ * - {@link formatJson} and {@link consoleJson} for structured production logs
2676
+ * - {@link consolePretty} for readable local logs
1886
2677
  *
1887
- * const program = Effect.gen(function*() {
1888
- * const logger = yield* batchedLogger
1889
- * yield* Effect.provide(
1890
- * Effect.all([
1891
- * Effect.log("Event 1"),
1892
- * Effect.log("Event 2"),
1893
- * Effect.log("Event 3")
1894
- * ]),
1895
- * Logger.layer([logger])
1896
- * )
1897
- * })
1898
- * ```
2678
+ * @since 2.0.0
1899
2679
  */
1900
2680
  export * as Logger from "./Logger.js";
1901
2681
  /**
1902
- * @since 2.0.0
1903
- *
1904
- * The `LogLevel` module provides utilities for managing log levels in Effect applications.
1905
- * It defines a hierarchy of log levels and provides functions for comparing and filtering logs
1906
- * based on their severity.
1907
- *
1908
- * ## Log Level Hierarchy
1909
- *
1910
- * The log levels are ordered from most severe to least severe:
1911
- *
1912
- * 1. **All** - Special level that allows all messages
1913
- * 2. **Fatal** - System is unusable, immediate attention required
1914
- * 3. **Error** - Error conditions that should be investigated
1915
- * 4. **Warn** - Warning conditions that may indicate problems
1916
- * 5. **Info** - Informational messages about normal operation
1917
- * 6. **Debug** - Debug information useful during development
1918
- * 7. **Trace** - Very detailed trace information
1919
- * 8. **None** - Special level that suppresses all messages
1920
- *
1921
- * ## Basic Usage
1922
- *
1923
- * **Example** (Logging at different levels)
2682
+ * The `LogLevel` module defines the levels used by Effect logging and the
2683
+ * ordering operations used to compare, filter, and enable log output.
1924
2684
  *
1925
- * ```ts
1926
- * import { Effect } from "effect"
1927
- *
1928
- * // Basic log level usage
1929
- * const program = Effect.gen(function*() {
1930
- * yield* Effect.logFatal("System is shutting down")
1931
- * yield* Effect.logError("Database connection failed")
1932
- * yield* Effect.logWarning("Memory usage is high")
1933
- * yield* Effect.logInfo("User logged in")
1934
- * yield* Effect.logDebug("Processing request")
1935
- * yield* Effect.logTrace("Variable value: xyz")
1936
- * })
1937
- * ```
1938
- *
1939
- * ## Level Comparison
1940
- *
1941
- * **Example** (Comparing log levels)
1942
- *
1943
- * ```ts
1944
- * import { LogLevel } from "effect"
1945
- *
1946
- * // Check if one level is more severe than another
1947
- * console.log(LogLevel.isGreaterThan("Error", "Info")) // true
1948
- * console.log(LogLevel.isGreaterThan("Debug", "Error")) // false
2685
+ * **Mental model**
1949
2686
  *
1950
- * // Check if level meets minimum threshold
1951
- * console.log(LogLevel.isGreaterThanOrEqualTo("Info", "Debug")) // true
1952
- * console.log(LogLevel.isLessThan("Trace", "Info")) // true
1953
- * ```
2687
+ * - A `LogLevel` is one of `All`, `Fatal`, `Error`, `Warn`, `Info`, `Debug`,
2688
+ * `Trace`, or `None`
2689
+ * - `Fatal` is the most severe concrete level and `Trace` is the least severe
2690
+ * - `All` and `None` are sentinel levels: `All` enables every message and
2691
+ * `None` disables every message
2692
+ * - Ordering follows logging severity, so higher levels are more important and
2693
+ * lower levels are more verbose
2694
+ * - Filtering is usually expressed as "log this message when its level is
2695
+ * greater than or equal to the configured minimum"
1954
2696
  *
1955
- * ## Filtering by Level
2697
+ * **Common tasks**
1956
2698
  *
1957
- * **Example** (Filtering logger output)
2699
+ * - Enumerate levels with {@link values}
2700
+ * - Compare exact levels with {@link Equivalence}
2701
+ * - Sort or compare by severity with {@link Order} and {@link getOrdinal}
2702
+ * - Check thresholds with {@link isGreaterThanOrEqualTo} and
2703
+ * {@link isLessThanOrEqualTo}
2704
+ * - Test whether a level is enabled for the current fiber with
2705
+ * {@link isEnabled}
1958
2706
  *
1959
- * ```ts
1960
- * import { Logger, LogLevel } from "effect"
2707
+ * **Gotchas**
1961
2708
  *
1962
- * // Create a logger that only logs Error and above
1963
- * const errorLogger = Logger.make((options) => {
1964
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, "Error")) {
1965
- * console.log(`[${options.logLevel}] ${options.message}`)
1966
- * }
1967
- * })
2709
+ * - `All` and `None` are useful for configuration boundaries, but they are not
2710
+ * concrete message severities; use {@link Severity} when only emitted message
2711
+ * levels are valid
2712
+ * - The comparison helpers compare severity, not declaration position in source
2713
+ * code or alphabetical order
2714
+ * - `isEnabled` reads the current fiber's `MinimumLogLevel` reference, so it is
2715
+ * context-sensitive; use the pure comparison helpers when checking an
2716
+ * explicit threshold
1968
2717
  *
1969
- * // Production logger - Info and above
1970
- * const productionLogger = Logger.make((options) => {
1971
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, "Info")) {
1972
- * console.log(
1973
- * `${options.date.toISOString()} [${options.logLevel}] ${options.message}`
1974
- * )
1975
- * }
1976
- * })
2718
+ * @since 2.0.0
2719
+ */
2720
+ export * as LogLevel from "./LogLevel.js";
2721
+ /**
2722
+ * The `ManagedRuntime` module provides a way to build a reusable runtime from
2723
+ * a `Layer` and use it to run effects that require the services produced by
2724
+ * that layer. A `ManagedRuntime<R, ER>` owns the lifecycle of the layer-built
2725
+ * resources, caches the resulting `Context<R>`, and exposes runners for
2726
+ * integrating Effect programs with JavaScript entry points.
1977
2727
  *
1978
- * // Development logger - Debug and above
1979
- * const devLogger = Logger.make((options) => {
1980
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, "Debug")) {
1981
- * console.log(`[${options.logLevel}] ${options.message}`)
1982
- * }
1983
- * })
1984
- * ```
2728
+ * **Mental model**
1985
2729
  *
1986
- * ## Runtime Configuration
2730
+ * - A managed runtime is created from a `Layer` with {@link make}
2731
+ * - The layer is built lazily the first time the runtime is used
2732
+ * - The built context is cached and reused for subsequent effect executions
2733
+ * - Resources acquired by the layer are owned by the runtime's internal scope
2734
+ * - Disposing the runtime closes that scope and releases all managed resources
2735
+ * - Effects run through the runtime receive the layer's services automatically
1987
2736
  *
1988
- * **Example** (Configuring log level from the environment)
2737
+ * **Common tasks**
1989
2738
  *
1990
- * ```ts
1991
- * import { Config, Effect, Logger, LogLevel } from "effect"
2739
+ * - Create a runtime from application services: {@link make}
2740
+ * - Run an effect as a `Promise`: {@link ManagedRuntime.runPromise}
2741
+ * - Run an effect and keep its `Exit`: {@link ManagedRuntime.runPromiseExit}
2742
+ * - Fork an effect into a `Fiber`: {@link ManagedRuntime.runFork}
2743
+ * - Bridge callback-style APIs: {@link ManagedRuntime.runCallback}
2744
+ * - Run synchronous effects at program boundaries: {@link ManagedRuntime.runSync},
2745
+ * {@link ManagedRuntime.runSyncExit}
2746
+ * - Access the cached service context: {@link ManagedRuntime.context}
2747
+ * - Release layer resources: {@link ManagedRuntime.dispose},
2748
+ * {@link ManagedRuntime.disposeEffect}
1992
2749
  *
1993
- * // Configure log level from environment
1994
- * const logLevelConfig = Config.string("LOG_LEVEL").pipe(
1995
- * Config.withDefault("Info")
1996
- * )
2750
+ * **Gotchas**
1997
2751
  *
1998
- * const configurableLogger = Effect.gen(function*() {
1999
- * const minLevel = yield* logLevelConfig
2752
+ * - Always dispose a managed runtime when it is no longer needed, especially
2753
+ * when the layer acquires resources such as connections, servers, or files
2754
+ * - Layer construction errors are included in the error channel of runtime
2755
+ * runners, so `ER` is combined with the effect's own error type
2756
+ * - `runSync` can only execute effects without asynchronous boundaries; use
2757
+ * `runPromise` for asynchronous programs
2758
+ * - After disposal, the runtime cannot be reused
2000
2759
  *
2001
- * return Logger.make((options) => {
2002
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, minLevel)) {
2003
- * console.log(`[${options.logLevel}] ${options.message}`)
2004
- * }
2005
- * })
2006
- * })
2007
- * ```
2008
- */
2009
- export * as LogLevel from "./LogLevel.js";
2010
- /**
2011
2760
  * @since 2.0.0
2012
2761
  */
2013
2762
  export * as ManagedRuntime from "./ManagedRuntime.js";
@@ -2041,51 +2790,56 @@ export * as ManagedRuntime from "./ManagedRuntime.js";
2041
2790
  */
2042
2791
  export * as Match from "./Match.js";
2043
2792
  /**
2044
- * @since 2.0.0
2793
+ * The `Metric` module provides tools for defining, updating, tagging, and
2794
+ * reading application metrics from Effect programs. A `Metric<Input, State>`
2795
+ * accepts typed input values and aggregates them into a typed state that can be
2796
+ * read directly or exported from a snapshot.
2045
2797
  *
2046
- * The `Metric` module provides a comprehensive system for collecting, aggregating, and observing
2047
- * application metrics in Effect applications. It offers type-safe, concurrent metrics that can
2048
- * be used to monitor performance, track business metrics, and gain insights into application behavior.
2049
- *
2050
- * ## Key Features
2051
- *
2052
- * - **Five Metric Types**: Counters, Gauges, Frequencies, Histograms, and Summaries
2053
- * - **Type Safety**: Fully typed metrics with compile-time guarantees
2054
- * - **Concurrency Safe**: Thread-safe metrics that work with Effect's concurrency model
2055
- * - **Attributes**: Tag metrics with key-value attributes for filtering and grouping
2056
- * - **Snapshots**: Take point-in-time snapshots of all metrics for reporting
2057
- * - **Runtime Integration**: Automatic fiber runtime metrics collection
2058
- *
2059
- * ## Metric Types
2798
+ * **Mental model**
2060
2799
  *
2061
- * ### Counter
2062
- * Tracks cumulative values that only increase or can be reset to zero.
2063
- * Perfect for counting events, requests, errors, etc.
2800
+ * - A metric has an identifier, a type, an optional description, optional attributes, and mutable aggregate state
2801
+ * - Use counters for cumulative values such as requests, errors, retries, or bytes processed
2802
+ * - Use gauges for point-in-time values that can rise or fall, such as active connections or queue size
2803
+ * - Use frequencies to count occurrences of discrete string values, such as status codes or action names
2804
+ * - Use histograms to bucket numeric observations and inspect count, min, max, and sum
2805
+ * - Use summaries to calculate quantiles over a bounded, time-based observation window
2806
+ * - Metrics are updated from effects with {@link update} and {@link modify}, and read with {@link value}
2807
+ * - Attributes tag metrics with key-value dimensions so the same logical metric can be grouped by service, endpoint, method, or other labels
2808
+ * - Snapshots capture the currently registered metrics and their aggregate states for reporting or export
2064
2809
  *
2065
- * ### Gauge
2066
- * Represents a single numerical value that can go up or down.
2067
- * Ideal for current resource usage, temperature, queue sizes, etc.
2810
+ * **Common tasks**
2068
2811
  *
2069
- * ### Frequency
2070
- * Counts occurrences of discrete string values.
2071
- * Useful for tracking categorical data like HTTP status codes, user actions, etc.
2812
+ * - Create counters: {@link counter}
2813
+ * - Create gauges: {@link gauge}
2814
+ * - Create frequencies: {@link frequency}
2815
+ * - Create histograms: {@link histogram}, {@link linearBoundaries}, {@link exponentialBoundaries}
2816
+ * - Create summaries: {@link summary}, {@link summaryWithTimestamp}
2817
+ * - Measure effect duration: {@link timer}
2818
+ * - Update a metric: {@link update}
2819
+ * - Apply relative updates where supported: {@link modify}
2820
+ * - Read one metric: {@link value}
2821
+ * - Tag a metric: {@link withAttributes}
2822
+ * - Transform accepted input values: {@link mapInput}
2823
+ * - Record a constant input for repeated events: {@link withConstantInput}
2824
+ * - Inspect all registered metrics: {@link snapshot}, {@link dump}
2825
+ * - Enable fiber runtime metrics: {@link enableRuntimeMetrics}
2072
2826
  *
2073
- * ### Histogram
2074
- * Records observations in configurable buckets to analyze distribution.
2075
- * Great for response times, request sizes, and other measured values.
2827
+ * **Gotchas**
2076
2828
  *
2077
- * ### Summary
2078
- * Calculates quantiles over a sliding time window.
2079
- * Provides statistical insights into value distributions over time.
2829
+ * - Counter and gauge metrics can use `number` inputs by default or `bigint` inputs with the `bigint` option
2830
+ * - Incremental counters ignore negative updates; use non-incremental counters only when decreases are meaningful
2831
+ * - {@link update} sets a gauge to an absolute value, while {@link modify} changes it relative to its current value
2832
+ * - Histogram buckets are cumulative and depend on the boundaries supplied when the metric is created
2833
+ * - Summary quantiles are calculated from the configured sliding window, so old observations expire
2834
+ * - Prefer low-cardinality attributes; using unbounded values such as request IDs can create too many metric series
2080
2835
  *
2081
- * ## Basic Usage
2836
+ * **Quickstart**
2082
2837
  *
2083
2838
  * **Example** (Creating and updating metrics)
2084
2839
  *
2085
2840
  * ```ts
2086
2841
  * import { Effect, Metric } from "effect"
2087
2842
  *
2088
- * // Create metrics
2089
2843
  * const requestCount = Metric.counter("http_requests_total", {
2090
2844
  * description: "Total number of HTTP requests"
2091
2845
  * })
@@ -2095,33 +2849,7 @@ export * as Match from "./Match.js";
2095
2849
  * boundaries: Metric.linearBoundaries({ start: 0, width: 50, count: 20 })
2096
2850
  * })
2097
2851
  *
2098
- * // Use metrics in your application
2099
2852
  * const handleRequest = Effect.gen(function*() {
2100
- * yield* Metric.update(requestCount, 1)
2101
- *
2102
- * const startTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
2103
- *
2104
- * // Process request...
2105
- * yield* Effect.sleep("100 millis")
2106
- *
2107
- * const endTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
2108
- * yield* Metric.update(responseTime, endTime - startTime)
2109
- * })
2110
- * ```
2111
- *
2112
- * ## Attributes and Tagging
2113
- *
2114
- * **Example** (Tagging metrics with attributes)
2115
- *
2116
- * ```ts
2117
- * import { Effect, Metric } from "effect"
2118
- *
2119
- * const requestCount = Metric.counter("requests", {
2120
- * description: "Number of requests by endpoint and method"
2121
- * })
2122
- *
2123
- * const program = Effect.gen(function*() {
2124
- * // Add attributes to metrics
2125
2853
  * yield* Metric.update(
2126
2854
  * Metric.withAttributes(requestCount, {
2127
2855
  * endpoint: "/api/users",
@@ -2130,59 +2858,21 @@ export * as Match from "./Match.js";
2130
2858
  * 1
2131
2859
  * )
2132
2860
  *
2133
- * // Or use withAttributes for compile-time attributes
2134
- * const taggedCounter = Metric.withAttributes(requestCount, {
2135
- * endpoint: "/api/posts",
2136
- * method: "POST"
2137
- * })
2138
- * yield* Metric.update(taggedCounter, 1)
2139
- * })
2140
- * ```
2141
- *
2142
- * ## Advanced Examples
2861
+ * yield* Metric.update(responseTime, 125)
2143
2862
  *
2144
- * **Example** (Recording business and performance metrics)
2145
- *
2146
- * ```ts
2147
- * import { Effect, Metric } from "effect"
2148
- *
2149
- * // Business metrics
2150
- * const userSignups = Metric.counter("user_signups_total")
2151
- * const activeUsers = Metric.gauge("active_users_current")
2152
- * const featureUsage = Metric.frequency("feature_usage")
2153
- *
2154
- * // Performance metrics
2155
- * const dbQueryTime = Metric.summary("db_query_duration", {
2156
- * maxAge: "5 minutes",
2157
- * maxSize: 1000,
2158
- * quantiles: [0.5, 0.9, 0.95, 0.99]
2863
+ * return yield* Metric.value(requestCount)
2159
2864
  * })
2865
+ * ```
2160
2866
  *
2161
- * const program = Effect.gen(function*() {
2162
- * // Track user signup
2163
- * yield* Metric.update(userSignups, 1)
2164
- *
2165
- * // Update active user count
2166
- * yield* Metric.update(activeUsers, 1250)
2167
- *
2168
- * // Record feature usage
2169
- * yield* Metric.update(featureUsage, "dashboard_view")
2170
- *
2171
- * // Measure database query time
2172
- * yield* Effect.timed(performDatabaseQuery).pipe(
2173
- * Effect.tap(([duration]) => Metric.update(dbQueryTime, duration))
2174
- * )
2175
- * })
2867
+ * **See also**
2176
2868
  *
2177
- * // Get metric snapshots
2178
- * const getMetrics = Effect.gen(function*() {
2179
- * const snapshots = yield* Metric.snapshot
2869
+ * - {@link counter} / {@link gauge} / {@link frequency} for common metric types
2870
+ * - {@link histogram} / {@link summary} for distribution metrics
2871
+ * - {@link update} / {@link modify} / {@link value} for working with metric state
2872
+ * - {@link withAttributes} for adding dimensions
2873
+ * - {@link snapshot} for exporting all registered metric values
2180
2874
  *
2181
- * for (const metric of snapshots) {
2182
- * console.log(`${metric.id}: ${JSON.stringify(metric.state)}`)
2183
- * }
2184
- * })
2185
- * ```
2875
+ * @since 2.0.0
2186
2876
  */
2187
2877
  export * as Metric from "./Metric.js";
2188
2878
  /**
@@ -2201,111 +2891,172 @@ export * as Metric from "./Metric.js";
2201
2891
  * - Iterable interface for easy traversal
2202
2892
  * - Memory-efficient storage with automatic bucket management
2203
2893
  *
2204
- * Performance Characteristics:
2205
- * - Get/Set/Has: O(1) average, O(n) worst case (hash collisions)
2206
- * - Remove: O(1) average, O(n) worst case
2207
- * - Clear: O(1)
2208
- * - Size: O(1)
2209
- * - Iteration: O(n)
2894
+ * Performance Characteristics:
2895
+ * - Get/Set/Has: O(1) average, O(n) worst case (hash collisions)
2896
+ * - Remove: O(1) average, O(n) worst case
2897
+ * - Clear: O(1)
2898
+ * - Size: O(1)
2899
+ * - Iteration: O(n)
2900
+ *
2901
+ * @since 2.0.0
2902
+ */
2903
+ export * as MutableHashMap from "./MutableHashMap.js";
2904
+ /**
2905
+ * The `MutableHashSet` module provides a mutable hash set for storing unique
2906
+ * values with efficient membership checks, insertion, removal, and iteration.
2907
+ * It is built on {@link MutableHashMap}: each set value is stored as a map key,
2908
+ * so uniqueness follows the same hashing and equality rules as the underlying
2909
+ * mutable hash map.
2910
+ *
2911
+ * **Mental model**
2912
+ *
2913
+ * - `MutableHashSet<V>` is a mutable collection of unique values of type `V`
2914
+ * - Operations such as {@link add}, {@link remove}, and {@link clear} mutate
2915
+ * the set in place
2916
+ * - Duplicate values are ignored according to Effect equality and hashing semantics
2917
+ * - Values that implement `Equal` / `Hash` are compared structurally
2918
+ * - Primitive values and references that do not implement Effect equality use
2919
+ * the normal hash map behavior
2920
+ * - The set is iterable, so `Array.from(set)` or `for...of` can be used to
2921
+ * inspect its values
2922
+ *
2923
+ * **Common tasks**
2924
+ *
2925
+ * - Create an empty set: {@link empty}
2926
+ * - Create from values: {@link make}
2927
+ * - Create from any iterable: {@link fromIterable}
2928
+ * - Add a value: {@link add}
2929
+ * - Check membership: {@link has}
2930
+ * - Remove a value: {@link remove}
2931
+ * - Remove all values: {@link clear}
2932
+ * - Count unique values: {@link size}
2933
+ * - Narrow unknown values: {@link isMutableHashSet}
2934
+ *
2935
+ * **Gotchas**
2936
+ *
2937
+ * - This data structure is intentionally mutable; keep ownership clear when
2938
+ * sharing it between callers
2939
+ * - Mutating operations return the same set instance for convenient piping, not
2940
+ * a copy
2941
+ * - Iteration order should not be used as a stable sorting mechanism
2942
+ * - For immutable set operations, use Effect's immutable collection modules
2943
+ * instead
2944
+ *
2945
+ * **Performance**
2946
+ *
2947
+ * - Add, membership checks, and removal are O(1) on average and O(n) in the
2948
+ * presence of hash collisions
2949
+ * - Clearing and reading the size are O(1)
2950
+ * - Iteration is O(n)
2951
+ *
2952
+ * **Quickstart**
2953
+ *
2954
+ * **Example** (Tracking unique values)
2955
+ *
2956
+ * ```ts
2957
+ * import { MutableHashSet } from "effect"
2958
+ *
2959
+ * const set = MutableHashSet.make("apple", "banana", "apple")
2210
2960
  *
2211
- * @category data-structures
2212
- * @since 2.0.0
2213
- */
2214
- export * as MutableHashMap from "./MutableHashMap.js";
2215
- /**
2216
- * @fileoverview
2217
- * MutableHashSet is a high-performance, mutable set implementation that provides efficient storage
2218
- * and retrieval of unique values. Built on top of MutableHashMap, it inherits the same performance
2219
- * characteristics and support for both structural and referential equality.
2961
+ * MutableHashSet.add(set, "cherry")
2962
+ * MutableHashSet.remove(set, "banana")
2220
2963
  *
2221
- * The implementation uses a MutableHashMap internally where each value is stored as a key with a
2222
- * boolean flag, providing O(1) average-case performance for all operations.
2964
+ * console.log(MutableHashSet.has(set, "apple"))
2965
+ * // Output: true
2223
2966
  *
2224
- * Key Features:
2225
- * - Mutable operations for performance-critical scenarios
2226
- * - Supports both structural and referential equality
2227
- * - Efficient duplicate detection and removal
2228
- * - Iterable interface for easy traversal
2229
- * - Memory-efficient storage with automatic deduplication
2230
- * - Seamless integration with Effect's Equal and Hash interfaces
2967
+ * console.log(MutableHashSet.size(set))
2968
+ * // Output: 2
2231
2969
  *
2232
- * Performance Characteristics:
2233
- * - Add/Has/Remove: O(1) average, O(n) worst case (hash collisions)
2234
- * - Clear: O(1)
2235
- * - Size: O(1)
2236
- * - Iteration: O(n)
2970
+ * console.log(Array.from(set))
2971
+ * // Output: ["apple", "cherry"]
2972
+ * ```
2237
2973
  *
2238
- * @category data-structures
2239
2974
  * @since 2.0.0
2240
2975
  */
2241
2976
  export * as MutableHashSet from "./MutableHashSet.js";
2242
2977
  /**
2243
- * @fileoverview
2244
- * MutableList is an efficient, mutable linked list implementation optimized for high-throughput
2245
- * scenarios like logging, queuing, and streaming. It uses a bucket-based architecture where
2246
- * elements are stored in arrays (buckets) linked together, providing optimal performance for
2247
- * both append and prepend operations.
2978
+ * The `MutableList` module provides a mutable linked list for accumulating,
2979
+ * ordering, inspecting, and draining values with efficient operations at both
2980
+ * ends of the list.
2248
2981
  *
2249
- * The implementation uses a sophisticated bucket system:
2250
- * - Each bucket contains an array of elements with an offset pointer
2251
- * - Buckets can be marked as mutable or immutable for optimization
2252
- * - Elements are taken from the head and added to the tail
2253
- * - Memory is efficiently managed through bucket reuse and cleanup
2982
+ * A `MutableList<A>` stores values in linked buckets of arrays. Appending adds
2983
+ * values to the tail, prepending adds values to the head, and taking removes
2984
+ * values from the head. Unlike persistent collections, every mutation updates
2985
+ * the list object in place: operations such as {@link append}, {@link prepend},
2986
+ * {@link take}, {@link takeN}, {@link clear}, {@link filter}, and {@link remove}
2987
+ * change the same `MutableList` instance and update its `length`.
2254
2988
  *
2255
- * Key Features:
2256
- * - Highly optimized for high-frequency append/prepend operations
2257
- * - Memory efficient with automatic cleanup of consumed elements
2258
- * - Support for bulk operations (appendAll, prependAll, takeN)
2259
- * - Filtering and removal operations
2260
- * - Zero-copy optimizations for certain scenarios
2989
+ * **Mental model**
2261
2990
  *
2262
- * Performance Characteristics:
2263
- * - Append/Prepend: O(1) amortized
2264
- * - Take/TakeN: O(1) per element taken
2265
- * - Length: O(1)
2266
- * - Clear: O(1)
2267
- * - Filter: O(n)
2991
+ * - `MutableList<A>` is a stateful container with `head`, `tail`, and `length`
2992
+ * - Values are consumed from the head with {@link take}, {@link takeN}, or
2993
+ * {@link takeAll}
2994
+ * - {@link append} and {@link appendAll} preserve FIFO queue order for normal
2995
+ * producer-consumer use cases
2996
+ * - {@link prepend} and {@link prependAll} place values before the current
2997
+ * contents, which is useful for priority work or restoring items to the front
2998
+ * - {@link toArray} and {@link toArrayN} copy values without modifying the list
2999
+ * - The `head` and `tail` bucket fields are exposed for advanced use, but most
3000
+ * code should treat them as implementation details
2268
3001
  *
2269
- * Ideal Use Cases:
2270
- * - High-throughput logging systems
2271
- * - Producer-consumer queues
2272
- * - Streaming data buffers
2273
- * - Real-time data processing pipelines
3002
+ * **Common tasks**
3003
+ *
3004
+ * - Create an empty list: {@link make}
3005
+ * - Add one value: {@link append}, {@link prepend}
3006
+ * - Add many values: {@link appendAll}, {@link prependAll}
3007
+ * - Drain one value: {@link take}
3008
+ * - Drain many values: {@link takeN}, {@link takeAll}
3009
+ * - Inspect without draining: {@link toArrayN}, {@link toArray}
3010
+ * - Reset the list: {@link clear}
3011
+ * - Mutate contents in place: {@link filter}, {@link remove}
3012
+ *
3013
+ * **Gotchas**
3014
+ *
3015
+ * - `MutableList` is intentionally mutable; sharing a list means sharing its
3016
+ * changing state
3017
+ * - {@link take} returns the {@link Empty} symbol when the list has no value, so
3018
+ * compare with `MutableList.Empty` instead of relying on falsy checks
3019
+ * - {@link appendAllUnsafe} and {@link prependAllUnsafe} may reuse the provided
3020
+ * array when `mutable` is `true`; only enable that optimization when callers
3021
+ * will not keep using the array independently
3022
+ * - {@link remove} uses JavaScript strict equality semantics, not structural
3023
+ * equality
2274
3024
  *
2275
- * @category data-structures
2276
3025
  * @since 4.0.0
2277
3026
  */
2278
3027
  export * as MutableList from "./MutableList.js";
2279
3028
  /**
2280
- * @fileoverview
2281
- * MutableRef provides a mutable reference container that allows safe mutation of values
2282
- * in functional programming contexts. It serves as a bridge between functional and imperative
2283
- * programming paradigms, offering atomic operations for state management.
3029
+ * The `MutableRef` module provides a small synchronous container for mutable
3030
+ * state. A `MutableRef<A>` stores one current value of type `A`, exposes that
3031
+ * value through `.current`, and offers pipeable helpers for reading, replacing,
3032
+ * and transforming the value in place.
2284
3033
  *
2285
- * Unlike regular variables, MutableRef encapsulates mutable state and provides controlled
2286
- * access through a standardized API. It supports atomic compare-and-set operations for
2287
- * thread-safe updates and integrates seamlessly with Effect's ecosystem.
3034
+ * **Mental model**
2288
3035
  *
2289
- * Key Features:
2290
- * - Mutable reference semantics with functional API
2291
- * - Atomic compare-and-set operations for safe concurrent updates
2292
- * - Specialized operations for numeric and boolean values
2293
- * - Chainable operations that return the reference or the value
2294
- * - Integration with Effect's Equal interface for value comparison
2295
- *
2296
- * Common Use Cases:
2297
- * - State containers in functional applications
2298
- * - Counters and accumulators
2299
- * - Configuration that needs to be updated at runtime
2300
- * - Caching and memoization scenarios
2301
- * - Inter-module communication via shared references
3036
+ * - `MutableRef<A>` is a stable reference whose `.current` field may change over time
3037
+ * - Reads and writes are synchronous and return immediately
3038
+ * - `set`, `update`, `increment`, `decrement`, and `toggle` mutate the same reference in place
3039
+ * - `getAnd*` helpers return the previous value, while `*AndGet` helpers return the new value
3040
+ * - `compareAndSet` updates only when the current value is equal to the expected value using `Equal.equals`
3041
+ * - A `MutableRef` is useful for local mutable state, but it does not make updates transactional or effectful
2302
3042
  *
2303
- * Performance Characteristics:
2304
- * - Get/Set: O(1)
2305
- * - Compare-and-set: O(1)
2306
- * - All operations: O(1)
3043
+ * **Common tasks**
3044
+ *
3045
+ * - Create a reference: {@link make}
3046
+ * - Read the current value: {@link get} or `.current`
3047
+ * - Replace the current value: {@link set}, {@link setAndGet}, {@link getAndSet}
3048
+ * - Transform the current value: {@link update}, {@link updateAndGet}, {@link getAndUpdate}
3049
+ * - Coordinate conditional replacement: {@link compareAndSet}
3050
+ * - Work with counters: {@link increment}, {@link decrement}, {@link incrementAndGet}, {@link decrementAndGet}
3051
+ * - Work with boolean flags: {@link toggle}
3052
+ *
3053
+ * **Gotchas**
3054
+ *
3055
+ * - All updates are imperative mutations; aliases to the same `MutableRef` observe the same changing value
3056
+ * - Updating object or array values does not clone them unless the update function creates a new value
3057
+ * - `compareAndSet` compares with Effect equality semantics, not only JavaScript reference equality
3058
+ * - For state that must participate in `Effect` workflows, interruption, or fiber coordination, prefer higher-level Effect data types
2307
3059
  *
2308
- * @category data-structures
2309
3060
  * @since 2.0.0
2310
3061
  */
2311
3062
  export * as MutableRef from "./MutableRef.js";
@@ -2376,33 +3127,39 @@ export * as MutableRef from "./MutableRef.js";
2376
3127
  */
2377
3128
  export * as Newtype from "./Newtype.js";
2378
3129
  /**
2379
- * @since 2.0.0
3130
+ * The `NonEmptyIterable` module provides a type-level representation of any
3131
+ * JavaScript `Iterable` that is known to contain at least one element. A
3132
+ * `NonEmptyIterable<A>` can be consumed anywhere an `Iterable<A>` is expected,
3133
+ * while also carrying the guarantee that reading the first element is safe.
2380
3134
  *
2381
- * The `NonEmptyIterable` module provides types and utilities for working with iterables
2382
- * that are guaranteed to contain at least one element. This provides compile-time
2383
- * safety when working with collections that must not be empty.
3135
+ * **Mental model**
2384
3136
  *
2385
- * ## Key Features
3137
+ * - `NonEmptyIterable<A>` is an `Iterable<A>` branded with a non-empty guarantee
3138
+ * - The guarantee is static: values should only be typed this way when construction or validation proves at least one element exists
3139
+ * - The iterable can be an array, string, set, map, generator, or any custom iterable
3140
+ * - `unprepend` safely separates the first element from an iterator for the remaining elements
3141
+ * - Operations that may remove elements, such as filtering, usually return ordinary collections because they can become empty
2386
3142
  *
2387
- * - **Type Safety**: Compile-time guarantee that the iterable contains at least one element
2388
- * - **Iterator Protocol**: Fully compatible with JavaScript's built-in iteration protocol
2389
- * - **Functional Operations**: Safe operations that preserve the non-empty property
2390
- * - **Lightweight**: Minimal overhead with maximum type safety
3143
+ * **Common tasks**
3144
+ *
3145
+ * - Accept inputs that must contain at least one value
3146
+ * - Extract a head element and process the remaining iterator with {@link unprepend}
3147
+ * - Model APIs such as reductions, comparisons, or aggregation that are undefined for empty inputs
3148
+ * - Preserve compatibility with the JavaScript iteration protocol while documenting the stronger invariant
2391
3149
  *
2392
- * ## Why NonEmptyIterable?
3150
+ * **Gotchas**
2393
3151
  *
2394
- * Many operations require non-empty collections to be meaningful:
2395
- * - Finding the maximum or minimum value
2396
- * - Getting the first or last element
2397
- * - Reducing without an initial value
2398
- * - Operations that would otherwise need runtime checks
3152
+ * - A type assertion does not make an empty iterable non-empty; only assert after a trusted check or constructor
3153
+ * - Iterators are stateful, so calling {@link unprepend} consumes the first yielded value from that iterator
3154
+ * - The order of the first element follows the source iterable's iteration order, for example insertion order for `Map` and `Set`
3155
+ * - Some transformations preserve non-emptiness, but transformations that can discard elements must account for the empty case
2399
3156
  *
2400
- * ## Basic Usage
3157
+ * **Quickstart**
2401
3158
  *
2402
3159
  * **Example** (Requiring a non-empty iterable)
2403
3160
  *
2404
3161
  * ```ts
2405
- * import * as NonEmptyIterable from "effect/NonEmptyIterable"
3162
+ * import { NonEmptyIterable } from "effect"
2406
3163
  *
2407
3164
  * // NonEmptyIterable is a type that represents any iterable with at least one element
2408
3165
  * function processNonEmpty<A>(data: NonEmptyIterable.NonEmptyIterable<A>): A {
@@ -2488,7 +3245,7 @@ export * as Newtype from "./Newtype.js";
2488
3245
  *
2489
3246
  * ```ts
2490
3247
  * import { Array, pipe } from "effect"
2491
- * import type * as NonEmptyIterable from "effect/NonEmptyIterable"
3248
+ * import type { NonEmptyIterable } from "effect"
2492
3249
  *
2493
3250
  * // Many Array functions work with NonEmptyIterable
2494
3251
  * declare const nonEmptyData: NonEmptyIterable.NonEmptyIterable<number>
@@ -2509,6 +3266,8 @@ export * as Newtype from "./Newtype.js";
2509
3266
  * // This would still be non-empty if the source was non-empty
2510
3267
  * )
2511
3268
  * ```
3269
+ *
3270
+ * @since 2.0.0
2512
3271
  */
2513
3272
  export * as NonEmptyIterable from "./NonEmptyIterable.js";
2514
3273
  /**
@@ -2741,50 +3500,200 @@ export * as Option from "./Option.js";
2741
3500
  */
2742
3501
  export * as Order from "./Order.js";
2743
3502
  /**
2744
- * @fileoverview
2745
- * The Ordering module provides utilities for working with comparison results and ordering operations.
2746
- * An Ordering represents the result of comparing two values, expressing whether the first value is
2747
- * less than (-1), equal to (0), or greater than (1) the second value.
3503
+ * The `Ordering` module provides the standard representation for the result of
3504
+ * comparing two values. An `Ordering` is one of three numeric literals: `-1`
3505
+ * when the first value is less than the second, `0` when both values compare as
3506
+ * equal, and `1` when the first value is greater than the second.
2748
3507
  *
2749
- * This module is fundamental for building comparison functions, sorting algorithms, and implementing
2750
- * ordered data structures. It provides composable operations for combining multiple comparison results
2751
- * and pattern matching on ordering outcomes.
3508
+ * **Mental model**
3509
+ *
3510
+ * - `Ordering` describes the relationship between two compared values, not the
3511
+ * values themselves
3512
+ * - Negative means "less than", zero means "equal", and positive means "greater
3513
+ * than"
3514
+ * - Unlike JavaScript comparators, this type is normalized to exactly `-1`, `0`,
3515
+ * or `1`
3516
+ * - `0` is neutral when combining comparisons; the first non-zero ordering
3517
+ * determines the result
3518
+ *
3519
+ * **Common tasks**
3520
+ *
3521
+ * - Interpret a comparison result with {@link match}
3522
+ * - Reverse ascending and descending order with {@link reverse}
3523
+ * - Combine multiple comparison criteria with {@link Reducer}
3524
+ * - Build custom comparison functions for sorting, ordered collections, and
3525
+ * domain-specific ordering rules
3526
+ *
3527
+ * **Gotchas**
3528
+ *
3529
+ * - Do not cast arbitrary comparator results such as `a.localeCompare(b)`
3530
+ * directly unless they have been normalized to `-1`, `0`, or `1`
3531
+ * - In comparator-style APIs, `-1` means the left value should come before the
3532
+ * right value, while `1` means it should come after
3533
+ * - Reversing an `Ordering` swaps `-1` and `1`, but leaves `0` unchanged
2752
3534
  *
2753
- * Key Features:
2754
- * - Type-safe representation of comparison results (-1, 0, 1)
2755
- * - Composable operations for combining multiple orderings
2756
- * - Pattern matching utilities for handling different ordering cases
2757
- * - Ordering reversal and combination functions
2758
- * - Integration with Effect's functional programming patterns
2759
- *
2760
- * Common Use Cases:
2761
- * - Implementing custom comparison functions
2762
- * - Building complex sorting criteria
2763
- * - Combining multiple comparison results
2764
- * - Creating ordered data structures
2765
- * - Pattern matching on comparison outcomes
2766
- *
2767
- * @category utilities
2768
3535
  * @since 2.0.0
2769
3536
  */
2770
3537
  export * as Ordering from "./Ordering.js";
2771
3538
  /**
3539
+ * The `PartitionedSemaphore` module provides a semaphore for limiting
3540
+ * concurrency across a shared permit pool while keeping waiters grouped by
3541
+ * partition key. A `PartitionedSemaphore<K>` is useful when many independent
3542
+ * groups of work compete for the same bounded resource and each group should
3543
+ * make progress without one busy group monopolizing released permits.
3544
+ *
3545
+ * **Mental model**
3546
+ *
3547
+ * - The semaphore has a fixed shared capacity measured in permits
3548
+ * - Work acquires permits with a partition key of type `K`
3549
+ * - Waiting acquisitions are tracked per partition
3550
+ * - Released permits are assigned to waiting partitions in round-robin order
3551
+ * - `withPermit` and `withPermits` acquire permits around an effect and
3552
+ * release them when the effect exits, fails, or is interrupted
3553
+ *
3554
+ * **Common tasks**
3555
+ *
3556
+ * - Create a semaphore: {@link make}, {@link makeUnsafe}
3557
+ * - Inspect capacity and availability: {@link capacity}, {@link available}
3558
+ * - Acquire and release manually: {@link take}, {@link release}
3559
+ * - Limit a single operation per partition: {@link withPermit}
3560
+ * - Limit weighted work per partition: {@link withPermits}
3561
+ * - Run only when permits are immediately available:
3562
+ * {@link withPermitsIfAvailable}
3563
+ *
3564
+ * **Gotchas**
3565
+ *
3566
+ * - `withPermitsIfAvailable` does not use a partition key; it only succeeds
3567
+ * when the shared pool has enough permits immediately
3568
+ * - Acquiring more permits than the semaphore capacity never completes
3569
+ * - Requests for zero or negative permits complete without acquiring anything
3570
+ * - Non-finite capacities create an unbounded semaphore whose acquire and
3571
+ * release operations complete immediately
3572
+ *
2772
3573
  * @since 4.0.0
2773
3574
  */
2774
3575
  export * as PartitionedSemaphore from "./PartitionedSemaphore.js";
2775
3576
  /**
3577
+ * The `Path` module provides a platform path service for manipulating file
3578
+ * system paths through Effect's environment. It models path operations as a
3579
+ * replaceable service so programs can depend on path behavior without directly
3580
+ * coupling to a particular runtime implementation.
3581
+ *
3582
+ * **Mental model**
3583
+ *
3584
+ * - `Path.Path` is a `Context.Service` tag used to access the current path implementation
3585
+ * - The service offers familiar path operations such as joining, resolving, parsing, and formatting
3586
+ * - Most operations are pure string transformations and follow POSIX-style path semantics
3587
+ * - File URL conversions return `Effect`s because invalid paths or URLs can fail with `BadArgument`
3588
+ * - Custom implementations can be provided with `Layer.succeed` for alternate platforms or tests
3589
+ *
3590
+ * **Common tasks**
3591
+ *
3592
+ * - Combine path segments with `join` or turn segments into an absolute path with `resolve`
3593
+ * - Normalize `.` and `..` segments with `normalize`
3594
+ * - Inspect paths with `basename`, `dirname`, `extname`, and `isAbsolute`
3595
+ * - Convert between structured path parts and strings with `parse` and `format`
3596
+ * - Compute relative paths with `relative`
3597
+ * - Convert between file paths and `file:` URLs with `toFileUrl` and `fromFileUrl`
3598
+ *
3599
+ * **Gotchas**
3600
+ *
3601
+ * - Path strings are not checked against the file system; these operations only manipulate syntax
3602
+ * - `resolve` may consult the host current working directory when no absolute segment is supplied
3603
+ * - `fromFileUrl` only accepts valid `file:` URLs and rejects encoded path separators
3604
+ * - Use the service from the environment when writing portable Effect code instead of importing
3605
+ * host-specific path APIs directly
3606
+ *
2776
3607
  * @since 4.0.0
2777
3608
  */
2778
3609
  export * as Path from "./Path.js";
2779
3610
  /**
3611
+ * The `Pipeable` module defines the shared interface and implementation helpers
3612
+ * for values that support Effect-style method chaining with `.pipe(...)`.
3613
+ *
3614
+ * A `Pipeable` value can pass itself through a sequence of unary functions from
3615
+ * left to right, so code can be written as `value.pipe(f, g, h)` instead of
3616
+ * deeply nesting calls. This is the method form used by many Effect data types
3617
+ * to compose transformations, validations, and effectful operations while
3618
+ * keeping the original value as the starting point of the pipeline.
3619
+ *
3620
+ * **Common tasks**
3621
+ *
3622
+ * - Type values that expose a `.pipe(...)` method with the {@link Pipeable} interface
3623
+ * - Implement a custom `.pipe(...)` method with {@link pipeArguments}
3624
+ * - Reuse the standard implementation through {@link Prototype}, {@link Class}, or {@link Mixin}
3625
+ *
3626
+ * **Gotchas**
3627
+ *
3628
+ * - Each function receives the result of the previous function, not the original value
3629
+ * - The overloads preserve precise types for long pipelines, but very long chains may be easier to read when split
3630
+ *
2780
3631
  * @since 2.0.0
2781
3632
  */
2782
3633
  export * as Pipeable from "./Pipeable.js";
2783
3634
  /**
3635
+ * The `PlatformError` module defines the normalized error model used by
3636
+ * platform APIs when adapting host operations into Effect programs. It gives
3637
+ * callers a stable `PlatformError` wrapper whose `reason` is either a
3638
+ * `BadArgument`, for invalid inputs rejected before an operation runs, or a
3639
+ * `SystemError`, for failures reported by the host platform or operating
3640
+ * system.
3641
+ *
3642
+ * Use this module when implementing or consuming platform services such as
3643
+ * file systems, terminal access, sockets, or other environment-specific APIs.
3644
+ * `SystemError` intentionally groups many low-level failures into a small set
3645
+ * of portable tags like `NotFound`, `PermissionDenied`, and `TimedOut`, while
3646
+ * still preserving operation details such as the module, method, syscall, path
3647
+ * or descriptor, description, and original cause when available.
3648
+ *
3649
+ * **Common tasks**
3650
+ *
3651
+ * - Create platform failures from system operations with {@link systemError}
3652
+ * - Report rejected caller input with {@link badArgument}
3653
+ * - Inspect the underlying reason via {@link PlatformError.reason}
3654
+ * - Match normalized system failures with {@link SystemErrorTag}
3655
+ *
3656
+ * **Gotchas**
3657
+ *
3658
+ * - `PlatformError` is a wrapper; inspect `reason` to distinguish
3659
+ * `BadArgument` from `SystemError`
3660
+ * - `SystemErrorTag` values are normalized categories, not necessarily raw
3661
+ * platform error codes
3662
+ * - The original cause is preserved when provided, but portable handling
3663
+ * should rely on the normalized fields
3664
+ *
2784
3665
  * @since 4.0.0
2785
3666
  */
2786
3667
  export * as PlatformError from "./PlatformError.js";
2787
3668
  /**
3669
+ * The `Pool` module provides scoped resource pools for sharing expensive or
3670
+ * limited resources across fibers. A `Pool<A, E>` manages values of type `A`
3671
+ * acquired by an effect that may fail with `E`, automatically releasing all
3672
+ * allocated resources when the surrounding `Scope` closes.
3673
+ *
3674
+ * **Mental model**
3675
+ *
3676
+ * - A pool owns a bounded set of acquired items and hands them out with {@link get}
3677
+ * - Each checkout is scoped; leaving the scope returns the item to the pool
3678
+ * - `concurrency` controls how many fibers may use the same item at once
3679
+ * - `targetUtilization` controls when the pool grows between its minimum and maximum sizes
3680
+ * - {@link invalidate} removes a specific item so it can be replaced lazily
3681
+ *
3682
+ * **Common tasks**
3683
+ *
3684
+ * - Create a fixed-size pool with {@link make}
3685
+ * - Create an elastic pool with time-to-live reclamation using {@link makeWithTTL}
3686
+ * - Implement custom resizing and reclamation behavior with {@link makeWithStrategy}
3687
+ * - Borrow resources safely in scoped effects with {@link get}
3688
+ *
3689
+ * **Gotchas**
3690
+ *
3691
+ * - Pool construction and item checkout require `Scope`; closing the scope shuts
3692
+ * down the pool or returns the borrowed item
3693
+ * - Failed acquisitions are represented by the `get` effect failing with the
3694
+ * acquisition error, and retrying `get` can retry acquisition
3695
+ * - Resource finalization order during shutdown is unspecified
3696
+ *
2788
3697
  * @since 2.0.0
2789
3698
  */
2790
3699
  export * as Pool from "./Pool.js";
@@ -2817,7 +3726,7 @@ export * as Pool from "./Pool.js";
2817
3726
  * **Example** (Filter by a predicate)
2818
3727
  *
2819
3728
  * ```ts
2820
- * import * as Predicate from "effect/Predicate"
3729
+ * import { Predicate } from "effect"
2821
3730
  *
2822
3731
  * const isPositive = (n: number) => n > 0
2823
3732
  * const data = [2, -1, 3]
@@ -2857,13 +3766,14 @@ export * as PrimaryKey from "./PrimaryKey.js";
2857
3766
  * const program = Effect.gen(function*() {
2858
3767
  * const pubsub = yield* PubSub.bounded<string>(10)
2859
3768
  *
2860
- * // Publisher
2861
- * yield* PubSub.publish(pubsub, "Hello")
2862
- * yield* PubSub.publish(pubsub, "World")
2863
- *
2864
- * // Subscriber
2865
3769
  * yield* Effect.scoped(Effect.gen(function*() {
2866
3770
  * const subscription = yield* PubSub.subscribe(pubsub)
3771
+ *
3772
+ * // Publisher
3773
+ * yield* PubSub.publish(pubsub, "Hello")
3774
+ * yield* PubSub.publish(pubsub, "World")
3775
+ *
3776
+ * // Subscriber
2867
3777
  * const message1 = yield* PubSub.take(subscription)
2868
3778
  * const message2 = yield* PubSub.take(subscription)
2869
3779
  * console.log(message1, message2) // "Hello", "World"
@@ -2875,17 +3785,103 @@ export * as PrimaryKey from "./PrimaryKey.js";
2875
3785
  */
2876
3786
  export * as PubSub from "./PubSub.js";
2877
3787
  /**
3788
+ * The `Pull` module provides the low-level pull-step abstraction used by
3789
+ * stream-like consumers. A `Pull<A, E, Done, R>` is an `Effect` that can
3790
+ * produce one value of type `A`, fail with an ordinary error `E`, or signal
3791
+ * end-of-input with a `Cause.Done<Done>` value.
3792
+ *
3793
+ * **Mental model**
3794
+ *
3795
+ * - `Pull` is an `Effect` with a distinguished completion signal in the error channel
3796
+ * - ordinary failures and completion are both represented by `Cause`, but can be separated with the helpers in this module
3797
+ * - the `Done` value can carry leftover state or a final value needed by a downstream consumer
3798
+ * - `Pull` is useful when repeatedly evaluating an effect until it either produces values, fails, or reports that no more input is available
3799
+ *
3800
+ * **Common tasks**
3801
+ *
3802
+ * - Extract type parameters from a pull: {@link Success}, {@link Error}, {@link Leftover}, {@link Services}
3803
+ * - Detect and filter completion: {@link isDoneCause}, {@link filterDone}, {@link filterNoDone}
3804
+ * - Recover from completion while preserving ordinary failures: {@link catchDone}
3805
+ * - Convert done causes to successful exits: {@link doneExitFromCause}
3806
+ * - Handle all outcomes explicitly: {@link matchEffect}
3807
+ *
3808
+ * **Gotchas**
3809
+ *
3810
+ * - `Cause.Done` is not an ordinary failure; use this module's helpers before treating a pull failure as an error
3811
+ * - `Done` lives in the error channel, so generic `Effect` error handling can catch it unless you filter it deliberately
3812
+ * - `Pull` is a low-level primitive; most user-facing stream workflows should prefer higher-level stream APIs when available
3813
+ *
2878
3814
  * @since 4.0.0
2879
3815
  */
2880
3816
  export * as Pull from "./Pull.js";
2881
3817
  /**
3818
+ * The `Queue` module provides asynchronous queues for communicating between
3819
+ * fibers. A `Queue<A, E>` can receive values of type `A`, deliver them to
3820
+ * consumers in order, and eventually complete or fail with an error of type
3821
+ * `E`.
3822
+ *
3823
+ * **Mental model**
3824
+ *
3825
+ * - A queue is a fiber-aware channel with one write side ({@link Enqueue}) and
3826
+ * one read side ({@link Dequeue})
3827
+ * - Producers add values with {@link offer} or {@link offerAll}; consumers
3828
+ * remove values with {@link take}, {@link takeN}, {@link takeBetween}, or
3829
+ * {@link takeAll}
3830
+ * - Bounded queues use an overflow strategy: {@link bounded} suspends
3831
+ * producers, {@link dropping} rejects new values, and {@link sliding} drops
3832
+ * old values
3833
+ * - Queues can be completed with {@link end}, failed with {@link fail} or
3834
+ * {@link failCause}, interrupted with {@link interrupt}, and shut down with
3835
+ * {@link shutdown}
3836
+ * - Operations are expressed as `Effect` values so waiting producers and
3837
+ * consumers compose with interruption, scheduling, and structured
3838
+ * concurrency
3839
+ *
3840
+ * **Common tasks**
3841
+ *
3842
+ * - Create queues: {@link make}, {@link bounded}, {@link dropping},
3843
+ * {@link sliding}, {@link unbounded}
3844
+ * - Restrict capabilities: {@link asEnqueue}, {@link asDequeue}
3845
+ * - Produce values: {@link offer}, {@link offerAll}
3846
+ * - Consume values: {@link take}, {@link takeN}, {@link takeBetween},
3847
+ * {@link takeAll}, {@link poll}, {@link peek}
3848
+ * - Drain or reset buffered values: {@link collect}, {@link clear}
3849
+ * - Signal lifecycle: {@link end}, {@link fail}, {@link failCause},
3850
+ * {@link interrupt}, {@link shutdown}
3851
+ * - Inspect state: {@link size}, {@link isFull}
3852
+ *
3853
+ * **Gotchas**
3854
+ *
3855
+ * - `take` waits when the queue is empty; use {@link poll} when absence should
3856
+ * be represented as `Option.None`
3857
+ * - `dropping` and `sliding` queues can lose values by design; use
3858
+ * {@link bounded} when every offered value must be preserved
3859
+ * - Completion and failure are observed by consumers through the queue's error
3860
+ * channel, so include `Cause.Done` in the error type when using {@link end}
3861
+ * - The `Unsafe` variants are synchronous, low-level operations; prefer the
3862
+ * effectful APIs in application code
3863
+ *
3864
+ * **See also**
3865
+ *
3866
+ * - {@link Enqueue} for write-only queue handles
3867
+ * - {@link Dequeue} for read-only queue handles
3868
+ * - {@link Pull} for stream-style completion errors
3869
+ *
2882
3870
  * @since 3.8.0
2883
3871
  */
2884
3872
  export * as Queue from "./Queue.js";
2885
3873
  /**
2886
- * The Random module provides a service for generating random numbers in Effect
2887
- * programs. It offers a testable and composable way to work with randomness,
2888
- * supporting integers, floating-point numbers, and range-based generation.
3874
+ * The `Random` module provides a service for generating pseudo-random numbers
3875
+ * in Effect programs. It offers a testable and composable way to work with
3876
+ * randomness, supporting integers, floating-point numbers, and range-based
3877
+ * generation.
3878
+ *
3879
+ * The default `Random` service is not cryptographically secure. Do not use it
3880
+ * for secrets, tokens, UUIDs, session identifiers, or other security-sensitive
3881
+ * values. For cryptographically secure random generation, replace the service
3882
+ * with a cryptographically secure implementation such as the platform `Crypto`
3883
+ * service. `Random.withSeed` also replaces the service, but predictable seeds
3884
+ * remain deterministic and must not be treated as cryptographically secure.
2889
3885
  *
2890
3886
  * **Example** (Generating random values)
2891
3887
  *
@@ -2908,10 +3904,44 @@ export * as Queue from "./Queue.js";
2908
3904
  */
2909
3905
  export * as Random from "./Random.js";
2910
3906
  /**
3907
+ * The `RcMap` module provides a scoped, reference-counted map for sharing
3908
+ * resources by key. It is useful when many fibers may request the same
3909
+ * resource, such as a connection, client, session, or cached handle, and the
3910
+ * resource should be acquired once, reused while it has active references, and
3911
+ * released automatically when it is no longer needed.
3912
+ *
3913
+ * Each key is resolved with a user-provided lookup effect on first access via
3914
+ * {@link get}. Further accesses to the same key share the in-flight or acquired
3915
+ * resource and increment its reference count for the caller's current
3916
+ * `Scope`. When those scopes close, references are released; resources can be
3917
+ * closed immediately, kept alive for an idle time-to-live, invalidated
3918
+ * explicitly, or bounded by a maximum capacity.
3919
+ *
3920
+ * `RcMap` is designed for Effect resource lifecycles rather than general
3921
+ * mutable caching. The map itself is scoped, lookups require a `Scope`, and
3922
+ * complex keys should provide `Equal` / `Hash` behavior when they need
3923
+ * value-based lookup semantics.
3924
+ *
2911
3925
  * @since 3.5.0
2912
3926
  */
2913
3927
  export * as RcMap from "./RcMap.js";
2914
3928
  /**
3929
+ * The `RcRef` module provides reference-counted access to a shared resource
3930
+ * whose lifecycle is managed by `Scope`. An `RcRef<A, E>` lazily acquires its
3931
+ * resource the first time it is requested, shares that resource across active
3932
+ * users, and releases it when the final scope holding a reference closes.
3933
+ *
3934
+ * Use `RcRef` when several scoped operations should reuse the same expensive
3935
+ * or stateful resource, such as a connection, client, cache, or worker, without
3936
+ * making each operation acquire and release its own copy. `make` defines how
3937
+ * the resource is acquired, `get` borrows the current resource for the active
3938
+ * scope, and `invalidate` forces a future `get` to acquire a fresh resource.
3939
+ *
3940
+ * The resource is tied to scopes rather than ordinary object reachability:
3941
+ * every `get` must run with a `Scope`, and the reference count is decremented
3942
+ * when that scope closes. If `idleTimeToLive` is configured, a resource whose
3943
+ * reference count reaches zero can remain cached briefly before release.
3944
+ *
2915
3945
  * @since 3.5.0
2916
3946
  */
2917
3947
  export * as RcRef from "./RcRef.js";
@@ -3136,10 +4166,85 @@ export * as RegExp from "./RegExp.js";
3136
4166
  */
3137
4167
  export * as Request from "./Request.js";
3138
4168
  /**
4169
+ * The `RequestResolver` module provides the data-loading side of
4170
+ * `Effect.request`. A `Request` describes what a fiber needs, while a
4171
+ * `RequestResolver` describes how to collect, batch, execute, cache, trace,
4172
+ * and complete those requests.
4173
+ *
4174
+ * **Mental model**
4175
+ *
4176
+ * - A resolver receives one or more `Request.Entry` values and must complete
4177
+ * each entry with either a success or failure
4178
+ * - Concurrent requests made with the same resolver can be gathered into a
4179
+ * batch before the resolver is run
4180
+ * - Batch keys split pending requests into independent groups, which is useful
4181
+ * when different backends, tenants, or query shapes must be resolved
4182
+ * separately
4183
+ * - Delays and `batchN` tune how long requests are collected and how large
4184
+ * each batch may become
4185
+ * - Resolvers can be wrapped with tracing, in-memory caching, cache services,
4186
+ * and persistence without changing the request type
4187
+ *
4188
+ * **Common tasks**
4189
+ *
4190
+ * - Create a resolver from batch logic: {@link make}
4191
+ * - Create grouped batch logic: {@link makeGrouped} or {@link grouped}
4192
+ * - Create a resolver from pure logic: {@link fromFunction} or
4193
+ * {@link fromFunctionBatched}
4194
+ * - Create a resolver from effectful logic: {@link fromEffect} or
4195
+ * {@link fromEffectTagged}
4196
+ * - Control batching: {@link setDelay}, {@link setDelayEffect},
4197
+ * {@link batchN}
4198
+ * - Add operational behavior: {@link around}, {@link race}, {@link withSpan}
4199
+ * - Reuse results: {@link withCache}, {@link asCache}, {@link persisted}
4200
+ *
4201
+ * **Gotchas**
4202
+ *
4203
+ * - Every entry passed to a resolver must be completed; leaving an entry
4204
+ * incomplete causes the waiting request to fail
4205
+ * - Batched result collections must line up with the input entries in order
4206
+ * and length when using the batched helper constructors
4207
+ * - Grouping controls which requests share a resolver run; choose stable keys
4208
+ * for requests that can safely be handled together
4209
+ * - Caching and persistence depend on request identity and the request's
4210
+ * equality semantics, so model request values deliberately when cached
4211
+ *
3139
4212
  * @since 2.0.0
3140
4213
  */
3141
4214
  export * as RequestResolver from "./RequestResolver.js";
3142
4215
  /**
4216
+ * The `Resource` module provides refreshable, scoped values. A
4217
+ * `Resource<A, E>` stores the latest successful or failed acquisition result and
4218
+ * can be read with {@link get}, refreshed manually with {@link refresh}, or
4219
+ * refreshed automatically with {@link auto}.
4220
+ *
4221
+ * **Mental model**
4222
+ *
4223
+ * - A `Resource` wraps an acquisition `Effect` whose result is kept in a
4224
+ * `ScopedRef`
4225
+ * - Each refresh re-runs acquisition and replaces the stored `Exit`
4226
+ * - Replacing the stored value releases resources associated with the previous
4227
+ * scoped value
4228
+ * - Reading a resource returns the current acquired value or fails with the
4229
+ * current acquisition error
4230
+ *
4231
+ * **Common tasks**
4232
+ *
4233
+ * - Create a manually refreshed resource with {@link manual}
4234
+ * - Create a schedule-driven resource with {@link auto}
4235
+ * - Read the current value with {@link get}
4236
+ * - Force a reload with {@link refresh}
4237
+ * - Check whether an unknown value is a resource with {@link isResource}
4238
+ *
4239
+ * **Gotchas**
4240
+ *
4241
+ * - Creating a resource requires a `Scope`; when the scope closes, scoped
4242
+ * values held by the resource are released
4243
+ * - Failed acquisitions are stored too, so subsequent {@link get} calls fail
4244
+ * until a refresh succeeds
4245
+ * - Automatic refreshes run in the resource scope and stop when that scope is
4246
+ * closed
4247
+ *
3143
4248
  * @since 2.0.0
3144
4249
  */
3145
4250
  export * as Resource from "./Resource.js";
@@ -3277,6 +4382,25 @@ export * as Runtime from "./Runtime.js";
3277
4382
  */
3278
4383
  export * as Schedule from "./Schedule.js";
3279
4384
  /**
4385
+ * The `Scheduler` module defines the runtime scheduling services used by
4386
+ * Effect fibers. A scheduler decides how runnable tasks are enqueued, when they
4387
+ * are dispatched, and whether a fiber should yield after consuming its
4388
+ * operation budget.
4389
+ *
4390
+ * **Common tasks**
4391
+ *
4392
+ * - Use {@link Scheduler} to provide a custom runtime scheduler
4393
+ * - Use {@link MixedScheduler} for the default priority-aware scheduler
4394
+ * - Use {@link MaxOpsBeforeYield} to tune fairness for CPU-bound fibers
4395
+ * - Use {@link PreventSchedulerYield} only when a runtime should bypass yield checks
4396
+ *
4397
+ * **Gotchas**
4398
+ *
4399
+ * - Scheduler priorities affect the order of queued runtime tasks, not the
4400
+ * semantic result of an `Effect`
4401
+ * - Disabling scheduler yields can improve throughput for controlled workloads,
4402
+ * but it can also let long-running fibers monopolize the JavaScript thread
4403
+ *
3280
4404
  * @since 2.0.0
3281
4405
  */
3282
4406
  export * as Scheduler from "./Scheduler.js";
@@ -3611,6 +4735,25 @@ export * as SchemaGetter from "./SchemaGetter.js";
3611
4735
  */
3612
4736
  export * as SchemaIssue from "./SchemaIssue.js";
3613
4737
  /**
4738
+ * The `SchemaParser` module turns schemas into reusable runtime operations for
4739
+ * constructing, validating, decoding, and encoding values. It is the execution
4740
+ * layer behind a schema's AST: parsers walk the schema structure, apply
4741
+ * transformations, honor parse options, run checks, and report failures as
4742
+ * `SchemaIssue.Issue` values.
4743
+ *
4744
+ * Use this module when you need a parser with a specific result shape:
4745
+ * `Effect` for effectful parsing and service requirements, `Promise` for
4746
+ * JavaScript interop, `Exit` or `Result` when failures should stay in data,
4747
+ * `Option` for yes/no validation, and synchronous helpers when throwing is the
4748
+ * desired boundary.
4749
+ *
4750
+ * Decoding reads from the encoded/input side of a schema into its decoded
4751
+ * `Type`, while encoding runs the schema in the opposite direction. The
4752
+ * `make*` helpers construct decoded values and apply constructor defaults before
4753
+ * validation. Parse options supplied when a parser is created are merged with
4754
+ * options supplied at call time, and schema-level parse annotations can further
4755
+ * refine behavior.
4756
+ *
3614
4757
  * @since 4.0.0
3615
4758
  */
3616
4759
  export * as SchemaParser from "./SchemaParser.js";
@@ -3791,6 +4934,22 @@ export * as SchemaRepresentation from "./SchemaRepresentation.js";
3791
4934
  */
3792
4935
  export * as SchemaTransformation from "./SchemaTransformation.js";
3793
4936
  /**
4937
+ * The `SchemaUtils` module contains focused helpers for schema patterns that
4938
+ * are useful but too specialized for the core `Schema` API surface.
4939
+ *
4940
+ * Use this module when you need to describe a native class with a schema while
4941
+ * keeping a plain struct as its encoded representation. This is especially
4942
+ * useful for classes such as `Data.Error` subclasses that should decode from
4943
+ * structured data, encode back to that data, and still preserve class identity
4944
+ * for instance checks and schema optics.
4945
+ *
4946
+ * **Gotchas**
4947
+ *
4948
+ * - The constructor is called with the decoded struct fields as a single
4949
+ * argument, so the class constructor must accept that shape.
4950
+ * - Encoding uses the instance itself as the encoded shape, so the instance
4951
+ * should expose properties compatible with the provided struct schema.
4952
+ *
3794
4953
  * @since 4.0.0
3795
4954
  */
3796
4955
  export * as SchemaUtils from "./SchemaUtils.js";
@@ -3811,26 +4970,173 @@ export * as SchemaUtils from "./SchemaUtils.js";
3811
4970
  */
3812
4971
  export * as Scope from "./Scope.js";
3813
4972
  /**
4973
+ * The `ScopedCache` module provides a cache for values that acquire scoped
4974
+ * resources during lookup. Each cached entry owns a `Scope`, so resources
4975
+ * created while computing a value stay alive for as long as that entry remains
4976
+ * cached and are released when the entry is removed.
4977
+ *
4978
+ * A `ScopedCache` is itself created inside a scope. Calls to {@link get} run the
4979
+ * lookup effect on cache misses, share the same in-flight lookup among
4980
+ * concurrent callers for the same key, and store the resulting exit according
4981
+ * to a time-to-live policy. Entries can be inserted manually with {@link set},
4982
+ * refreshed with {@link refresh}, inspected without triggering lookup with
4983
+ * {@link getOption}, and removed with {@link invalidate} or
4984
+ * {@link invalidateAll}. Capacity limits evict the oldest entries.
4985
+ *
4986
+ * **Lifecycle notes**
4987
+ *
4988
+ * - Entry scopes are closed when entries expire, are invalidated, are evicted,
4989
+ * are replaced, or when the cache's owning scope closes
4990
+ * - Successful and failed lookup exits are both cached according to the
4991
+ * configured TTL
4992
+ * - Expired entries may remain counted by {@link size} until a cache operation
4993
+ * observes and removes them
4994
+ * - Once the owning scope closes, the cache is closed and lookup-style
4995
+ * operations interrupt instead of acquiring new values
4996
+ *
3814
4997
  * @since 4.0.0
3815
4998
  */
3816
4999
  export * as ScopedCache from "./ScopedCache.js";
3817
5000
  /**
5001
+ * The `ScopedRef` module provides a mutable reference for values that are tied
5002
+ * to scoped resources. Each value stored in a `ScopedRef` is acquired within its
5003
+ * own `Scope`, and replacing the value safely releases the resources associated
5004
+ * with the previous value.
5005
+ *
5006
+ * Use `ScopedRef` when an application needs to keep a current resource-backed
5007
+ * value, such as a live client, connection, subscription, or cached handle, and
5008
+ * later swap it for a newly acquired value without leaking the old resources.
5009
+ * Reads are simple, while updates are synchronized and resource-safe.
5010
+ *
5011
+ * **Gotchas**
5012
+ *
5013
+ * - A `ScopedRef` must itself be created and used within a `Scope`; when that
5014
+ * scope closes, the currently stored value is finalized.
5015
+ * - Use {@link fromAcquire} or {@link set} for resourceful values so acquisition
5016
+ * and finalization are tracked correctly.
5017
+ * - Use {@link make} only for values that do not acquire resources.
5018
+ * - Updating a `ScopedRef` waits for the replacement acquisition and old
5019
+ * finalization to complete before returning.
5020
+ *
3818
5021
  * @since 2.0.0
3819
5022
  */
3820
5023
  export * as ScopedRef from "./ScopedRef.js";
3821
5024
  /**
3822
- * @since 2.0.0
5025
+ * The `Semaphore` module provides a counting semaphore for coordinating
5026
+ * concurrent access to shared or limited resources. A semaphore tracks a fixed
5027
+ * number of permits: effects acquire permits before entering a critical section
5028
+ * and release them when they leave.
5029
+ *
5030
+ * Use semaphores to bound parallel work, protect rate-limited services, or
5031
+ * serialize access to resources that cannot safely handle unlimited
5032
+ * concurrency. Prefer {@link withPermit} and {@link withPermits} when possible,
5033
+ * because they release permits automatically when the protected effect exits.
5034
+ * Use {@link take} and {@link release} for lower-level protocols that need
5035
+ * manual control.
5036
+ *
5037
+ * **Gotchas**
5038
+ *
5039
+ * - Pending acquisitions wait until enough permits are available.
5040
+ * - {@link withPermitsIfAvailable} does not wait; it returns `Option.none` when
5041
+ * the requested permits cannot be acquired immediately.
5042
+ * - Manual `take` / `release` usage must keep permit counts balanced.
5043
+ *
5044
+ * @since 4.0.0
3823
5045
  */
3824
5046
  export * as Semaphore from "./Semaphore.js";
3825
5047
  /**
5048
+ * The `Sink` module provides composable consumers for `Stream` values. A
5049
+ * `Sink<A, In, L, E, R>` pulls input elements of type `In`, may require
5050
+ * services `R`, may fail with `E`, and eventually produces a result `A` plus
5051
+ * any leftover input `L` that was read but not consumed.
5052
+ *
5053
+ * **Mental model**
5054
+ *
5055
+ * - A sink is the terminal consumer used by `Stream.run`
5056
+ * - Sinks can consume zero, one, many, or all input elements before finishing
5057
+ * - Leftovers allow one sink to stop early without losing already-pulled input
5058
+ * - Sink composition preserves typed errors and service requirements
5059
+ * - Most sinks are built from `Channel` internally, but users compose them with
5060
+ * the higher-level APIs in this module
5061
+ *
5062
+ * **Common tasks**
5063
+ *
5064
+ * - Create simple sinks: {@link succeed}, {@link fail}, {@link fromEffect}
5065
+ * - Fold input: {@link fold}
5066
+ * - Collect values: {@link collect}
5067
+ * - Count or drain input: {@link count}, {@link drain}
5068
+ * - Transform results: {@link map}, {@link mapEffect}, {@link as}
5069
+ * - Adapt input before consumption: {@link mapInput}, {@link mapInputEffect}
5070
+ *
5071
+ * **Gotchas**
5072
+ *
5073
+ * - A sink can finish before the stream is exhausted; check leftover-aware
5074
+ * combinators when composing parsers or protocol decoders
5075
+ * - `In` is contravariant, so a sink that accepts broader input can be used
5076
+ * where narrower input is expected
5077
+ * - Resource and service requirements are tracked in the `R` type parameter
5078
+ *
3826
5079
  * @since 2.0.0
3827
5080
  */
3828
5081
  export * as Sink from "./Sink.js";
3829
5082
  /**
5083
+ * The `Stdio` module defines the service interface used by Effect programs to
5084
+ * interact with process standard I/O. It models command-line arguments,
5085
+ * standard output, standard error, and standard input as Effects, Sinks, and
5086
+ * Streams so programs can depend on console I/O through `Context` instead of
5087
+ * directly coupling to a specific runtime.
5088
+ *
5089
+ * Use this module when building command-line programs, tests, or platform
5090
+ * integrations that need to read bytes from stdin, write text or bytes to
5091
+ * stdout/stderr, or provide deterministic replacements for those capabilities.
5092
+ * The `layerTest` helper is useful for tests because it supplies inert defaults
5093
+ * and lets individual fields be overridden.
5094
+ *
5095
+ * Standard I/O operations are platform capabilities and may fail with
5096
+ * `PlatformError`; handle those failures in the Effect error channel rather than
5097
+ * assuming writes or reads are infallible.
5098
+ *
3830
5099
  * @since 4.0.0
3831
5100
  */
3832
5101
  export * as Stdio from "./Stdio.js";
3833
5102
  /**
5103
+ * The `Stream` module provides a typed, composable way to describe effectful
5104
+ * sequences of values. A `Stream<A, E, R>` can emit zero or more `A` values,
5105
+ * fail with an `E`, and require services from `R` while preserving
5106
+ * backpressure and resource safety.
5107
+ *
5108
+ * **Mental model**
5109
+ *
5110
+ * - A stream is a lazy description; it runs only when consumed with a `run*` function
5111
+ * - Streams are pull-based and emit chunks internally for efficient throughput
5112
+ * - `A` is the element type, `E` is the failure type, and `R` is the required context
5113
+ * - Stream composition mirrors `Effect`: use `map`, `flatMap`, error handling, and `pipe`
5114
+ * - Resource scopes, interruption, and finalizers are tracked by the Effect runtime
5115
+ * - Interop functions connect streams to queues, pub/subs, web streams, async iterables, and channels
5116
+ *
5117
+ * **Common tasks**
5118
+ *
5119
+ * - Create streams: {@link make}, {@link fromIterable}, {@link fromEffect}, {@link fromQueue}
5120
+ * - Transform values: {@link map}, {@link mapEffect}, {@link flatMap}, {@link filter}
5121
+ * - Combine streams: {@link concat}, {@link merge}, {@link zip}, {@link race}
5122
+ * - Control demand and timing: {@link take}, {@link drop}, {@link debounce}, {@link throttle}
5123
+ * - Manage errors: {@link catchCause}, {@link catchIf}, {@link mapError}, {@link retry}
5124
+ * - Manage resources and services: {@link scoped}, {@link ensuring}, {@link provide}
5125
+ * - Consume streams: {@link runCollect}, {@link runForEach}, {@link runFold}, {@link runDrain}
5126
+ *
5127
+ * **Gotchas**
5128
+ *
5129
+ * - A stream is not a collection; constructors and operators build a description until it is run
5130
+ * - Re-running a stream re-executes its effects unless it is explicitly shared or backed by external state
5131
+ * - Operators such as {@link merge}, {@link race}, and {@link broadcast} introduce concurrency and interruption semantics
5132
+ * - Prefer bounded constructors and sinks for large or infinite streams instead of collecting everything into memory
5133
+ *
5134
+ * **See also**
5135
+ *
5136
+ * - {@link Effect.Effect} for single-result effectful programs
5137
+ * - {@link Sink.Sink} for consuming and folding streams
5138
+ * - {@link Channel.Channel} for the lower-level primitive underlying streams
5139
+ *
3834
5140
  * @since 2.0.0
3835
5141
  */
3836
5142
  export * as Stream from "./Stream.js";
@@ -3918,26 +5224,142 @@ export * as String from "./String.js";
3918
5224
  */
3919
5225
  export * as Struct from "./Struct.js";
3920
5226
  /**
5227
+ * The `SubscriptionRef` module provides a mutable reference that can be read
5228
+ * and updated like a `Ref`, while also exposing a stream of its current value
5229
+ * and every subsequent change. It is useful when one part of an application
5230
+ * owns evolving state and many fibers need to subscribe to consistent updates,
5231
+ * such as configuration, coordination state, cached snapshots, or UI models.
5232
+ *
5233
+ * Updates are serialized with an internal semaphore and each update is
5234
+ * published to subscribers. The {@link changes} stream replays the latest value
5235
+ * first, then emits future updates, so new subscribers can start from the
5236
+ * current state without performing a separate read. Prefer the effectful
5237
+ * getters and update operations for concurrent code; the unsafe helpers bypass
5238
+ * synchronization and should only be used when the caller already controls
5239
+ * access.
5240
+ *
3921
5241
  * @since 2.0.0
3922
5242
  */
3923
5243
  export * as SubscriptionRef from "./SubscriptionRef.js";
3924
5244
  /**
5245
+ * The `Symbol` module provides a small runtime guard for working with
5246
+ * JavaScript `symbol` values. Use {@link isSymbol} when validating unknown
5247
+ * input, narrowing union types, or building predicates that need to recognize
5248
+ * primitive symbols such as those created by `Symbol()` or `Symbol.for`.
5249
+ *
5250
+ * The guard checks for the primitive `symbol` type; boxed objects created with
5251
+ * `Object(Symbol())` are objects and do not satisfy this predicate.
5252
+ *
3925
5253
  * @since 2.0.0
3926
5254
  */
3927
5255
  export * as Symbol from "./Symbol.js";
3928
5256
  /**
5257
+ * The `SynchronizedRef` module provides mutable references whose updates are
5258
+ * serialized, including updates that run effects before deciding the next
5259
+ * value. A `SynchronizedRef<A>` behaves like a `Ref<A>` for reading and basic
5260
+ * updates, but uses an internal semaphore so concurrent modifications observe a
5261
+ * consistent current value and apply one at a time.
5262
+ *
5263
+ * **When to use**
5264
+ *
5265
+ * - Coordinating shared state that may be updated by many fibers
5266
+ * - Running effectful state transitions that must not overlap
5267
+ * - Computing both a return value and a new stored value atomically
5268
+ * - Applying partial updates with `Option`, where `None` leaves the value
5269
+ * unchanged
5270
+ *
5271
+ * **Gotchas**
5272
+ *
5273
+ * - Effectful update functions run while the semaphore is held, so long-running
5274
+ * effects delay other updates to the same ref
5275
+ * - Failed effectful updates do not replace the stored value
5276
+ * - `getUnsafe` and `makeUnsafe` bypass the `Effect` API and should be reserved
5277
+ * for low-level or carefully controlled code
5278
+ *
3929
5279
  * @since 2.0.0
3930
5280
  */
3931
5281
  export * as SynchronizedRef from "./SynchronizedRef.js";
3932
5282
  /**
5283
+ * The `Take` module provides the representation used by stream-like producers
5284
+ * to describe a single pull result. A `Take<A, E, Done>` is either a
5285
+ * non-empty batch of emitted values, a failed `Exit`, or a successful `Exit`
5286
+ * carrying the stream's completion value.
5287
+ *
5288
+ * `Take` is useful at boundaries where pull results need to be stored,
5289
+ * transferred, or interpreted later while preserving the distinction between
5290
+ * emitted elements, failures, and normal completion. Use {@link toPull} to turn
5291
+ * a `Take` back into a `Pull`: value batches become successful pulls, failure
5292
+ * exits are propagated, and successful exits signal completion with `Done`.
5293
+ *
5294
+ * **Gotchas**
5295
+ *
5296
+ * - A value batch is always represented by a `NonEmptyReadonlyArray`; empty
5297
+ * batches are not valid `Take` values.
5298
+ * - Successful `Exit` values do not emit elements. They represent pull
5299
+ * completion and carry the `Done` value.
5300
+ *
3933
5301
  * @since 2.0.0
3934
5302
  */
3935
5303
  export * as Take from "./Take.js";
3936
5304
  /**
5305
+ * The `Terminal` module defines the service interface used by platform
5306
+ * integrations to model command-line input and output. It gives programs a
5307
+ * uniform way to query terminal dimensions, read lines, stream low-level key
5308
+ * events, and write text without depending directly on Node, the browser, or a
5309
+ * test-specific console implementation.
5310
+ *
5311
+ * Use this module when building interactive command-line tools, prompts, or
5312
+ * platform abstractions that need terminal capabilities as an Effect service.
5313
+ * Implementations are supplied through context, so application code can depend
5314
+ * on `Terminal` while tests and runtimes provide the concrete behavior.
5315
+ *
5316
+ * `readLine` can fail with {@link QuitError} when the user requests to quit,
5317
+ * commonly via `Ctrl+C`. For lower-level interaction, `readInput` returns a
5318
+ * scoped stream of {@link UserInput} values containing parsed key metadata and
5319
+ * any raw character input.
5320
+ *
3937
5321
  * @since 4.0.0
3938
5322
  */
3939
5323
  export * as Terminal from "./Terminal.js";
3940
5324
  /**
5325
+ * The `Tracer` module defines the low-level tracing model used by Effect to
5326
+ * describe and propagate spans. A span records the lifetime of an operation,
5327
+ * including its name, parent, attributes, links, annotations, sampling decision,
5328
+ * kind, and completion status.
5329
+ *
5330
+ * **Mental model**
5331
+ *
5332
+ * - `Tracer` is the backend interface responsible for creating spans
5333
+ * - `Span` values represent Effect-managed operations with mutable lifecycle
5334
+ * hooks for ending spans and adding attributes, events, or links
5335
+ * - `ExternalSpan` represents trace context imported from another tracing
5336
+ * system so Effect spans can be parented by or linked to external work
5337
+ * - `ParentSpan`, `Tracer`, and related context references control propagation,
5338
+ * sampling, and trace-level filtering through the Effect context
5339
+ *
5340
+ * **Common tasks**
5341
+ *
5342
+ * - Implement a custom tracing backend with {@link make}
5343
+ * - Provide or inspect parent span context with {@link ParentSpan}
5344
+ * - Convert external trace identifiers into Effect span values with
5345
+ * {@link externalSpan}
5346
+ * - Configure span metadata with {@link SpanOptions}, {@link SpanKind}, and
5347
+ * {@link SpanLink}
5348
+ * - Disable propagation or adjust trace filtering with
5349
+ * {@link DisablePropagation}, {@link CurrentTraceLevel}, and
5350
+ * {@link MinimumTraceLevel}
5351
+ *
5352
+ * **Gotchas**
5353
+ *
5354
+ * - This module exposes the tracing data model and backend hooks; most
5355
+ * application code should create spans through higher-level Effect APIs such
5356
+ * as `Effect.withSpan`
5357
+ * - `ExternalSpan` only carries identity and metadata from another system; it
5358
+ * does not have lifecycle methods like `Span`
5359
+ * - Propagation and sampling are context-dependent, so parent selection can be
5360
+ * affected by disabled propagation, root span options, and trace-level
5361
+ * thresholds
5362
+ *
3941
5363
  * @since 2.0.0
3942
5364
  */
3943
5365
  export * as Tracer from "./Tracer.js";
@@ -4051,10 +5473,55 @@ export * as TxChunk from "./TxChunk.js";
4051
5473
  */
4052
5474
  export * as TxDeferred from "./TxDeferred.js";
4053
5475
  /**
5476
+ * The `TxHashMap` module provides a transactional hash map for storing and
5477
+ * updating key-value pairs inside Effect transactions. It is useful when
5478
+ * multiple fibers need to coordinate shared map state and each read-modify-write
5479
+ * sequence must be committed atomically.
5480
+ *
5481
+ * A `TxHashMap<K, V>` has the familiar shape of a `HashMap<K, V>`, but every
5482
+ * operation returns an `Effect` and participates in transaction semantics
5483
+ * through `TxRef`. Use it for concurrent registries, caches, counters, indexes,
5484
+ * and other mutable maps whose updates should compose safely with other
5485
+ * transactional references.
5486
+ *
5487
+ * **Common tasks**
5488
+ *
5489
+ * - Create maps with {@link empty}, {@link fromIterable}, or {@link make}
5490
+ * - Read entries with {@link get}, {@link has}, {@link keys}, {@link values}, and {@link entries}
5491
+ * - Update entries with {@link set}, {@link modify}, {@link modifyAt}, and {@link remove}
5492
+ * - Inspect aggregate state with {@link size}, {@link isEmpty}, and {@link reduce}
5493
+ *
5494
+ * **Gotchas**
5495
+ *
5496
+ * - Operations are effectful; run them in `Effect.gen` and wrap multi-step
5497
+ * transactions with `Effect.tx` when the whole sequence must commit together.
5498
+ * - Reads that may be absent return `Option`, so handle both `Some` and `None`
5499
+ * instead of assuming a key exists.
5500
+ *
4054
5501
  * @since 2.0.0
4055
5502
  */
4056
5503
  export * as TxHashMap from "./TxHashMap.js";
4057
5504
  /**
5505
+ * The `TxHashSet` module provides a transactional hash set for storing unique
5506
+ * values inside Effect transactions. A `TxHashSet<A>` wraps a `HashSet<A>` in a
5507
+ * transactional reference, so reads and writes can be composed with other
5508
+ * transactional operations and committed atomically.
5509
+ *
5510
+ * **Common tasks**
5511
+ *
5512
+ * - Create transactional sets with {@link empty}, {@link make}, or {@link fromIterable}
5513
+ * - Mutate an existing set with {@link add}, {@link remove}, and {@link clear}
5514
+ * - Query membership and size with {@link has}, {@link size}, and {@link isEmpty}
5515
+ * - Derive new sets with {@link map}, {@link filter}, {@link union}, {@link intersection}, and {@link difference}
5516
+ * - Fold or collect values with {@link reduce} and {@link toHashSet}
5517
+ *
5518
+ * **Gotchas**
5519
+ *
5520
+ * - Mutation operations update the same transactional set; transform operations
5521
+ * return a new `TxHashSet`
5522
+ * - Operations are `Effect` values and must be yielded, piped, or run to take effect
5523
+ * - Use `Effect.tx` when several operations must observe and commit one atomic transaction
5524
+ *
4058
5525
  * @since 2.0.0
4059
5526
  */
4060
5527
  export * as TxHashSet from "./TxHashSet.js";
@@ -4108,6 +5575,24 @@ export * as TxReentrantLock from "./TxReentrantLock.js";
4108
5575
  */
4109
5576
  export * as TxRef from "./TxRef.js";
4110
5577
  /**
5578
+ * The `TxSemaphore` module provides a transactional semaphore for coordinating
5579
+ * access to limited resources from within Effect transactions. A semaphore
5580
+ * tracks a fixed number of permits, and transactional operations can acquire,
5581
+ * release, or inspect those permits atomically with other transactional state.
5582
+ *
5583
+ * Use `TxSemaphore` when permit accounting needs to compose with `TxRef` and
5584
+ * other transactional updates, such as guarding resource pools, rate-limited
5585
+ * sections, or workflows that must reserve capacity consistently before
5586
+ * committing related state changes.
5587
+ *
5588
+ * **Gotchas**
5589
+ *
5590
+ * - Permit operations are intended for transactional workflows and are wrapped
5591
+ * with `Effect.tx`.
5592
+ * - The semaphore capacity is fixed at construction time; releasing more
5593
+ * permits than the original capacity fails.
5594
+ * - Creating a semaphore with a negative number of permits defects.
5595
+ *
4111
5596
  * @since 4.0.0
4112
5597
  */
4113
5598
  export * as TxSemaphore from "./TxSemaphore.js";
@@ -4204,6 +5689,19 @@ export * as Types from "./Types.js";
4204
5689
  */
4205
5690
  export * as UndefinedOr from "./UndefinedOr.js";
4206
5691
  /**
5692
+ * The `Unify` module contains the type-level protocol Effect uses to normalize
5693
+ * unions of data types that opt in to unification. It is primarily a library
5694
+ * authoring tool: data types expose hidden symbol properties describing how
5695
+ * their variants should be widened, and {@link Unify} turns those protocol
5696
+ * entries into the user-facing union type that TypeScript should infer.
5697
+ *
5698
+ * Most application code does not need to interact with these symbols directly.
5699
+ * The main runtime helper, {@link unify}, is an identity function that preserves
5700
+ * values and functions at runtime while applying {@link Unify} to the relevant
5701
+ * static type. This is useful when authoring APIs that return branded or
5702
+ * protocol-enabled values and need inference to collapse to the public Effect
5703
+ * data type rather than exposing implementation details.
5704
+ *
4207
5705
  * @since 2.0.0
4208
5706
  */
4209
5707
  export * as Unify from "./Unify.js";