effect 4.0.0-beta.66 → 4.0.0-beta.68

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 (1767) hide show
  1. package/dist/Array.d.ts +151 -106
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +50 -40
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +620 -553
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +298 -254
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +342 -274
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +168 -126
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +189 -156
  14. package/dist/Boolean.d.ts.map +1 -1
  15. package/dist/Boolean.js +85 -68
  16. package/dist/Boolean.js.map +1 -1
  17. package/dist/Brand.d.ts +30 -5
  18. package/dist/Brand.d.ts.map +1 -1
  19. package/dist/Brand.js +19 -2
  20. package/dist/Brand.js.map +1 -1
  21. package/dist/Cache.d.ts +239 -135
  22. package/dist/Cache.d.ts.map +1 -1
  23. package/dist/Cache.js +135 -59
  24. package/dist/Cache.js.map +1 -1
  25. package/dist/Cause.d.ts +84 -73
  26. package/dist/Cause.d.ts.map +1 -1
  27. package/dist/Cause.js +51 -44
  28. package/dist/Cause.js.map +1 -1
  29. package/dist/Channel.d.ts +1568 -632
  30. package/dist/Channel.d.ts.map +1 -1
  31. package/dist/Channel.js +685 -315
  32. package/dist/Channel.js.map +1 -1
  33. package/dist/ChannelSchema.d.ts +119 -10
  34. package/dist/ChannelSchema.d.ts.map +1 -1
  35. package/dist/ChannelSchema.js +45 -6
  36. package/dist/ChannelSchema.js.map +1 -1
  37. package/dist/Chunk.d.ts +574 -428
  38. package/dist/Chunk.d.ts.map +1 -1
  39. package/dist/Chunk.js +250 -191
  40. package/dist/Chunk.js.map +1 -1
  41. package/dist/Clock.d.ts +16 -9
  42. package/dist/Clock.d.ts.map +1 -1
  43. package/dist/Clock.js +9 -5
  44. package/dist/Clock.js.map +1 -1
  45. package/dist/Combiner.d.ts +11 -5
  46. package/dist/Combiner.d.ts.map +1 -1
  47. package/dist/Combiner.js +10 -4
  48. package/dist/Combiner.js.map +1 -1
  49. package/dist/Config.d.ts +80 -68
  50. package/dist/Config.d.ts.map +1 -1
  51. package/dist/Config.js +53 -49
  52. package/dist/Config.js.map +1 -1
  53. package/dist/ConfigProvider.d.ts +33 -32
  54. package/dist/ConfigProvider.d.ts.map +1 -1
  55. package/dist/ConfigProvider.js +19 -18
  56. package/dist/ConfigProvider.js.map +1 -1
  57. package/dist/Console.d.ts +76 -50
  58. package/dist/Console.d.ts.map +1 -1
  59. package/dist/Console.js +69 -46
  60. package/dist/Console.js.map +1 -1
  61. package/dist/Context.d.ts +400 -189
  62. package/dist/Context.d.ts.map +1 -1
  63. package/dist/Context.js +143 -77
  64. package/dist/Context.js.map +1 -1
  65. package/dist/Cron.d.ts +67 -48
  66. package/dist/Cron.d.ts.map +1 -1
  67. package/dist/Cron.js +94 -36
  68. package/dist/Cron.js.map +1 -1
  69. package/dist/Crypto.d.ts +208 -0
  70. package/dist/Crypto.d.ts.map +1 -0
  71. package/dist/Crypto.js +157 -0
  72. package/dist/Crypto.js.map +1 -0
  73. package/dist/Data.d.ts +9 -3
  74. package/dist/Data.d.ts.map +1 -1
  75. package/dist/Data.js.map +1 -1
  76. package/dist/DateTime.d.ts +893 -464
  77. package/dist/DateTime.d.ts.map +1 -1
  78. package/dist/DateTime.js +387 -228
  79. package/dist/DateTime.js.map +1 -1
  80. package/dist/Deferred.d.ts +367 -175
  81. package/dist/Deferred.d.ts.map +1 -1
  82. package/dist/Deferred.js +146 -72
  83. package/dist/Deferred.js.map +1 -1
  84. package/dist/Differ.d.ts +44 -2
  85. package/dist/Differ.d.ts.map +1 -1
  86. package/dist/Differ.js +36 -0
  87. package/dist/Duration.d.ts +333 -186
  88. package/dist/Duration.d.ts.map +1 -1
  89. package/dist/Duration.js +178 -107
  90. package/dist/Duration.js.map +1 -1
  91. package/dist/Effect.d.ts +2181 -2275
  92. package/dist/Effect.d.ts.map +1 -1
  93. package/dist/Effect.js +935 -850
  94. package/dist/Effect.js.map +1 -1
  95. package/dist/Effectable.d.ts +38 -3
  96. package/dist/Effectable.d.ts.map +1 -1
  97. package/dist/Effectable.js +3 -3
  98. package/dist/Effectable.js.map +1 -1
  99. package/dist/Encoding.d.ts +78 -28
  100. package/dist/Encoding.d.ts.map +1 -1
  101. package/dist/Encoding.js +75 -27
  102. package/dist/Encoding.js.map +1 -1
  103. package/dist/Equal.d.ts +4 -3
  104. package/dist/Equal.d.ts.map +1 -1
  105. package/dist/Equal.js +4 -3
  106. package/dist/Equal.js.map +1 -1
  107. package/dist/Equivalence.d.ts +18 -24
  108. package/dist/Equivalence.d.ts.map +1 -1
  109. package/dist/Equivalence.js +16 -21
  110. package/dist/Equivalence.js.map +1 -1
  111. package/dist/ErrorReporter.d.ts +66 -82
  112. package/dist/ErrorReporter.d.ts.map +1 -1
  113. package/dist/ErrorReporter.js +38 -29
  114. package/dist/ErrorReporter.js.map +1 -1
  115. package/dist/ExecutionPlan.d.ts +106 -12
  116. package/dist/ExecutionPlan.d.ts.map +1 -1
  117. package/dist/ExecutionPlan.js +23 -6
  118. package/dist/ExecutionPlan.js.map +1 -1
  119. package/dist/Exit.d.ts +6 -5
  120. package/dist/Exit.d.ts.map +1 -1
  121. package/dist/Exit.js.map +1 -1
  122. package/dist/Fiber.d.ts +71 -40
  123. package/dist/Fiber.d.ts.map +1 -1
  124. package/dist/Fiber.js +39 -21
  125. package/dist/Fiber.js.map +1 -1
  126. package/dist/FiberHandle.d.ts +118 -57
  127. package/dist/FiberHandle.d.ts.map +1 -1
  128. package/dist/FiberHandle.js +121 -39
  129. package/dist/FiberHandle.js.map +1 -1
  130. package/dist/FiberMap.d.ts +287 -159
  131. package/dist/FiberMap.d.ts.map +1 -1
  132. package/dist/FiberMap.js +175 -73
  133. package/dist/FiberMap.js.map +1 -1
  134. package/dist/FiberSet.d.ts +93 -52
  135. package/dist/FiberSet.d.ts.map +1 -1
  136. package/dist/FiberSet.js +97 -34
  137. package/dist/FiberSet.js.map +1 -1
  138. package/dist/FileSystem.d.ts +102 -73
  139. package/dist/FileSystem.d.ts.map +1 -1
  140. package/dist/FileSystem.js +53 -39
  141. package/dist/FileSystem.js.map +1 -1
  142. package/dist/Filter.d.ts +166 -88
  143. package/dist/Filter.d.ts.map +1 -1
  144. package/dist/Filter.js +68 -42
  145. package/dist/Filter.js.map +1 -1
  146. package/dist/Formatter.d.ts +4 -2
  147. package/dist/Formatter.d.ts.map +1 -1
  148. package/dist/Formatter.js +3 -69
  149. package/dist/Formatter.js.map +1 -1
  150. package/dist/Function.d.ts +218 -151
  151. package/dist/Function.d.ts.map +1 -1
  152. package/dist/Function.js +94 -78
  153. package/dist/Function.js.map +1 -1
  154. package/dist/Graph.d.ts +714 -415
  155. package/dist/Graph.d.ts.map +1 -1
  156. package/dist/Graph.js +325 -182
  157. package/dist/Graph.js.map +1 -1
  158. package/dist/HKT.d.ts +29 -13
  159. package/dist/HKT.d.ts.map +1 -1
  160. package/dist/Hash.d.ts +35 -24
  161. package/dist/Hash.d.ts.map +1 -1
  162. package/dist/Hash.js +27 -17
  163. package/dist/Hash.js.map +1 -1
  164. package/dist/HashMap.d.ts +540 -388
  165. package/dist/HashMap.d.ts.map +1 -1
  166. package/dist/HashMap.js +262 -156
  167. package/dist/HashMap.js.map +1 -1
  168. package/dist/HashRing.d.ts +53 -34
  169. package/dist/HashRing.d.ts.map +1 -1
  170. package/dist/HashRing.js +83 -16
  171. package/dist/HashRing.js.map +1 -1
  172. package/dist/HashSet.d.ts +239 -153
  173. package/dist/HashSet.d.ts.map +1 -1
  174. package/dist/HashSet.js +110 -56
  175. package/dist/HashSet.js.map +1 -1
  176. package/dist/Inspectable.d.ts +26 -13
  177. package/dist/Inspectable.d.ts.map +1 -1
  178. package/dist/Inspectable.js +22 -10
  179. package/dist/Inspectable.js.map +1 -1
  180. package/dist/Iterable.d.ts +336 -222
  181. package/dist/Iterable.d.ts.map +1 -1
  182. package/dist/Iterable.js +146 -100
  183. package/dist/Iterable.js.map +1 -1
  184. package/dist/JsonPatch.d.ts +12 -9
  185. package/dist/JsonPatch.d.ts.map +1 -1
  186. package/dist/JsonPatch.js +9 -6
  187. package/dist/JsonPatch.js.map +1 -1
  188. package/dist/JsonPointer.d.ts +13 -11
  189. package/dist/JsonPointer.d.ts.map +1 -1
  190. package/dist/JsonPointer.js +13 -11
  191. package/dist/JsonPointer.js.map +1 -1
  192. package/dist/JsonSchema.d.ts +16 -0
  193. package/dist/JsonSchema.d.ts.map +1 -1
  194. package/dist/JsonSchema.js +10 -0
  195. package/dist/JsonSchema.js.map +1 -1
  196. package/dist/Latch.d.ts +97 -26
  197. package/dist/Latch.d.ts.map +1 -1
  198. package/dist/Latch.js +39 -20
  199. package/dist/Latch.js.map +1 -1
  200. package/dist/Layer.d.ts +472 -410
  201. package/dist/Layer.d.ts.map +1 -1
  202. package/dist/Layer.js +290 -226
  203. package/dist/Layer.js.map +1 -1
  204. package/dist/LayerMap.d.ts +99 -26
  205. package/dist/LayerMap.d.ts.map +1 -1
  206. package/dist/LayerMap.js +58 -14
  207. package/dist/LayerMap.js.map +1 -1
  208. package/dist/LogLevel.d.ts +92 -131
  209. package/dist/LogLevel.d.ts.map +1 -1
  210. package/dist/LogLevel.js +25 -15
  211. package/dist/LogLevel.js.map +1 -1
  212. package/dist/Logger.d.ts +159 -104
  213. package/dist/Logger.d.ts.map +1 -1
  214. package/dist/Logger.js +215 -189
  215. package/dist/Logger.js.map +1 -1
  216. package/dist/ManagedRuntime.d.ts +78 -19
  217. package/dist/ManagedRuntime.d.ts.map +1 -1
  218. package/dist/ManagedRuntime.js +24 -17
  219. package/dist/ManagedRuntime.js.map +1 -1
  220. package/dist/Match.d.ts +135 -161
  221. package/dist/Match.d.ts.map +1 -1
  222. package/dist/Match.js +86 -78
  223. package/dist/Match.js.map +1 -1
  224. package/dist/Metric.d.ts +330 -291
  225. package/dist/Metric.d.ts.map +1 -1
  226. package/dist/Metric.js +219 -214
  227. package/dist/Metric.js.map +1 -1
  228. package/dist/MutableHashMap.d.ts +146 -87
  229. package/dist/MutableHashMap.d.ts.map +1 -1
  230. package/dist/MutableHashMap.js +67 -43
  231. package/dist/MutableHashMap.js.map +1 -1
  232. package/dist/MutableHashSet.d.ts +52 -30
  233. package/dist/MutableHashSet.d.ts.map +1 -1
  234. package/dist/MutableHashSet.js +92 -38
  235. package/dist/MutableHashSet.js.map +1 -1
  236. package/dist/MutableList.d.ts +110 -68
  237. package/dist/MutableList.d.ts.map +1 -1
  238. package/dist/MutableList.js +135 -85
  239. package/dist/MutableList.js.map +1 -1
  240. package/dist/MutableRef.d.ts +99 -62
  241. package/dist/MutableRef.d.ts.map +1 -1
  242. package/dist/MutableRef.js +78 -60
  243. package/dist/MutableRef.js.map +1 -1
  244. package/dist/Newtype.d.ts +15 -2
  245. package/dist/Newtype.d.ts.map +1 -1
  246. package/dist/Newtype.js +8 -2
  247. package/dist/Newtype.js.map +1 -1
  248. package/dist/NonEmptyIterable.d.ts +38 -48
  249. package/dist/NonEmptyIterable.d.ts.map +1 -1
  250. package/dist/NonEmptyIterable.js +34 -25
  251. package/dist/NonEmptyIterable.js.map +1 -1
  252. package/dist/Number.d.ts +261 -205
  253. package/dist/Number.d.ts.map +1 -1
  254. package/dist/Number.js +119 -91
  255. package/dist/Number.js.map +1 -1
  256. package/dist/Optic.d.ts +6 -7
  257. package/dist/Optic.d.ts.map +1 -1
  258. package/dist/Optic.js +5 -6
  259. package/dist/Optic.js.map +1 -1
  260. package/dist/Option.d.ts +133 -156
  261. package/dist/Option.d.ts.map +1 -1
  262. package/dist/Option.js +64 -64
  263. package/dist/Option.js.map +1 -1
  264. package/dist/Order.d.ts +6 -6
  265. package/dist/Order.js +6 -6
  266. package/dist/Ordering.d.ts +56 -45
  267. package/dist/Ordering.d.ts.map +1 -1
  268. package/dist/Ordering.js +10 -8
  269. package/dist/Ordering.js.map +1 -1
  270. package/dist/PartitionedSemaphore.d.ts +225 -40
  271. package/dist/PartitionedSemaphore.d.ts.map +1 -1
  272. package/dist/PartitionedSemaphore.js +113 -17
  273. package/dist/PartitionedSemaphore.js.map +1 -1
  274. package/dist/Path.d.ts +77 -13
  275. package/dist/Path.d.ts.map +1 -1
  276. package/dist/Path.js +49 -4
  277. package/dist/Path.js.map +1 -1
  278. package/dist/Pipeable.d.ts +77 -18
  279. package/dist/Pipeable.d.ts.map +1 -1
  280. package/dist/Pipeable.js +63 -14
  281. package/dist/Pipeable.js.map +1 -1
  282. package/dist/PlatformError.d.ts +74 -6
  283. package/dist/PlatformError.d.ts.map +1 -1
  284. package/dist/PlatformError.js +68 -5
  285. package/dist/PlatformError.js.map +1 -1
  286. package/dist/Pool.d.ts +66 -31
  287. package/dist/Pool.d.ts.map +1 -1
  288. package/dist/Pool.js +26 -24
  289. package/dist/Pool.js.map +1 -1
  290. package/dist/Predicate.d.ts +16 -23
  291. package/dist/Predicate.d.ts.map +1 -1
  292. package/dist/Predicate.js +12 -17
  293. package/dist/Predicate.js.map +1 -1
  294. package/dist/PrimaryKey.d.ts +11 -3
  295. package/dist/PrimaryKey.d.ts.map +1 -1
  296. package/dist/PrimaryKey.js +9 -2
  297. package/dist/PrimaryKey.js.map +1 -1
  298. package/dist/PubSub.d.ts +385 -309
  299. package/dist/PubSub.d.ts.map +1 -1
  300. package/dist/PubSub.js +260 -207
  301. package/dist/PubSub.js.map +1 -1
  302. package/dist/Pull.d.ts +94 -25
  303. package/dist/Pull.d.ts.map +1 -1
  304. package/dist/Pull.js +61 -13
  305. package/dist/Pull.js.map +1 -1
  306. package/dist/Queue.d.ts +303 -184
  307. package/dist/Queue.d.ts.map +1 -1
  308. package/dist/Queue.js +231 -134
  309. package/dist/Queue.js.map +1 -1
  310. package/dist/Random.d.ts +65 -57
  311. package/dist/Random.d.ts.map +1 -1
  312. package/dist/Random.js +41 -66
  313. package/dist/Random.js.map +1 -1
  314. package/dist/RcMap.d.ts +151 -141
  315. package/dist/RcMap.d.ts.map +1 -1
  316. package/dist/RcMap.js +66 -20
  317. package/dist/RcMap.js.map +1 -1
  318. package/dist/RcRef.d.ts +68 -32
  319. package/dist/RcRef.d.ts.map +1 -1
  320. package/dist/RcRef.js +33 -16
  321. package/dist/RcRef.js.map +1 -1
  322. package/dist/Record.d.ts +282 -137
  323. package/dist/Record.d.ts.map +1 -1
  324. package/dist/Record.js +124 -62
  325. package/dist/Record.js.map +1 -1
  326. package/dist/Redactable.d.ts +7 -5
  327. package/dist/Redactable.d.ts.map +1 -1
  328. package/dist/Redactable.js +5 -3
  329. package/dist/Redactable.js.map +1 -1
  330. package/dist/Redacted.d.ts +63 -34
  331. package/dist/Redacted.d.ts.map +1 -1
  332. package/dist/Redacted.js +31 -15
  333. package/dist/Redacted.js.map +1 -1
  334. package/dist/Reducer.d.ts +3 -1
  335. package/dist/Reducer.d.ts.map +1 -1
  336. package/dist/Reducer.js +2 -0
  337. package/dist/Reducer.js.map +1 -1
  338. package/dist/Ref.d.ts +85 -66
  339. package/dist/Ref.d.ts.map +1 -1
  340. package/dist/Ref.js +57 -45
  341. package/dist/Ref.js.map +1 -1
  342. package/dist/References.d.ts +73 -31
  343. package/dist/References.d.ts.map +1 -1
  344. package/dist/References.js +66 -30
  345. package/dist/References.js.map +1 -1
  346. package/dist/RegExp.d.ts +12 -6
  347. package/dist/RegExp.d.ts.map +1 -1
  348. package/dist/RegExp.js +12 -6
  349. package/dist/RegExp.js.map +1 -1
  350. package/dist/Request.d.ts +159 -34
  351. package/dist/Request.d.ts.map +1 -1
  352. package/dist/Request.js +68 -12
  353. package/dist/Request.js.map +1 -1
  354. package/dist/RequestResolver.d.ts +262 -118
  355. package/dist/RequestResolver.d.ts.map +1 -1
  356. package/dist/RequestResolver.js +78 -42
  357. package/dist/RequestResolver.js.map +1 -1
  358. package/dist/Resource.d.ts +13 -7
  359. package/dist/Resource.d.ts.map +1 -1
  360. package/dist/Resource.js +44 -6
  361. package/dist/Resource.js.map +1 -1
  362. package/dist/Result.d.ts +135 -151
  363. package/dist/Result.d.ts.map +1 -1
  364. package/dist/Result.js +56 -68
  365. package/dist/Result.js.map +1 -1
  366. package/dist/Runtime.d.ts +40 -20
  367. package/dist/Runtime.d.ts.map +1 -1
  368. package/dist/Runtime.js +34 -17
  369. package/dist/Runtime.js.map +1 -1
  370. package/dist/Schedule.d.ts +556 -590
  371. package/dist/Schedule.d.ts.map +1 -1
  372. package/dist/Schedule.js +265 -253
  373. package/dist/Schedule.js.map +1 -1
  374. package/dist/Scheduler.d.ts +44 -7
  375. package/dist/Scheduler.d.ts.map +1 -1
  376. package/dist/Scheduler.js +34 -5
  377. package/dist/Scheduler.js.map +1 -1
  378. package/dist/Schema.d.ts +1293 -602
  379. package/dist/Schema.d.ts.map +1 -1
  380. package/dist/Schema.js +501 -361
  381. package/dist/Schema.js.map +1 -1
  382. package/dist/SchemaAST.d.ts +122 -92
  383. package/dist/SchemaAST.d.ts.map +1 -1
  384. package/dist/SchemaAST.js +102 -77
  385. package/dist/SchemaAST.js.map +1 -1
  386. package/dist/SchemaGetter.d.ts +49 -36
  387. package/dist/SchemaGetter.d.ts.map +1 -1
  388. package/dist/SchemaGetter.js +42 -29
  389. package/dist/SchemaGetter.js.map +1 -1
  390. package/dist/SchemaIssue.d.ts +19 -24
  391. package/dist/SchemaIssue.d.ts.map +1 -1
  392. package/dist/SchemaIssue.js +16 -14
  393. package/dist/SchemaIssue.js.map +1 -1
  394. package/dist/SchemaParser.d.ts +231 -63
  395. package/dist/SchemaParser.d.ts.map +1 -1
  396. package/dist/SchemaParser.js +266 -75
  397. package/dist/SchemaParser.js.map +1 -1
  398. package/dist/SchemaRepresentation.d.ts +89 -77
  399. package/dist/SchemaRepresentation.d.ts.map +1 -1
  400. package/dist/SchemaRepresentation.js +47 -37
  401. package/dist/SchemaRepresentation.js.map +1 -1
  402. package/dist/SchemaTransformation.d.ts +97 -46
  403. package/dist/SchemaTransformation.d.ts.map +1 -1
  404. package/dist/SchemaTransformation.js +89 -38
  405. package/dist/SchemaTransformation.js.map +1 -1
  406. package/dist/SchemaUtils.d.ts +8 -1
  407. package/dist/SchemaUtils.d.ts.map +1 -1
  408. package/dist/SchemaUtils.js +24 -1
  409. package/dist/SchemaUtils.js.map +1 -1
  410. package/dist/Scope.d.ts +107 -65
  411. package/dist/Scope.d.ts.map +1 -1
  412. package/dist/Scope.js +61 -32
  413. package/dist/Scope.js.map +1 -1
  414. package/dist/ScopedCache.d.ts +141 -49
  415. package/dist/ScopedCache.d.ts.map +1 -1
  416. package/dist/ScopedCache.js +82 -21
  417. package/dist/ScopedCache.js.map +1 -1
  418. package/dist/ScopedRef.d.ts +28 -8
  419. package/dist/ScopedRef.d.ts.map +1 -1
  420. package/dist/ScopedRef.js +25 -5
  421. package/dist/ScopedRef.js.map +1 -1
  422. package/dist/Semaphore.d.ts +61 -37
  423. package/dist/Semaphore.d.ts.map +1 -1
  424. package/dist/Semaphore.js +18 -21
  425. package/dist/Semaphore.js.map +1 -1
  426. package/dist/Sink.d.ts +461 -206
  427. package/dist/Sink.d.ts.map +1 -1
  428. package/dist/Sink.js +241 -90
  429. package/dist/Sink.js.map +1 -1
  430. package/dist/Stdio.d.ts +43 -6
  431. package/dist/Stdio.d.ts.map +1 -1
  432. package/dist/Stdio.js +33 -4
  433. package/dist/Stdio.js.map +1 -1
  434. package/dist/Stream.d.ts +2117 -1541
  435. package/dist/Stream.d.ts.map +1 -1
  436. package/dist/Stream.js +951 -682
  437. package/dist/Stream.js.map +1 -1
  438. package/dist/String.d.ts +174 -97
  439. package/dist/String.d.ts.map +1 -1
  440. package/dist/String.js +128 -69
  441. package/dist/String.js.map +1 -1
  442. package/dist/Struct.d.ts +20 -18
  443. package/dist/Struct.d.ts.map +1 -1
  444. package/dist/Struct.js +10 -8
  445. package/dist/Struct.js.map +1 -1
  446. package/dist/SubscriptionRef.d.ts +309 -204
  447. package/dist/SubscriptionRef.d.ts.map +1 -1
  448. package/dist/SubscriptionRef.js +126 -77
  449. package/dist/SubscriptionRef.js.map +1 -1
  450. package/dist/Symbol.d.ts +13 -5
  451. package/dist/Symbol.d.ts.map +1 -1
  452. package/dist/Symbol.js +13 -5
  453. package/dist/Symbol.js.map +1 -1
  454. package/dist/SynchronizedRef.d.ts +278 -62
  455. package/dist/SynchronizedRef.d.ts.map +1 -1
  456. package/dist/SynchronizedRef.js +116 -23
  457. package/dist/SynchronizedRef.js.map +1 -1
  458. package/dist/Take.d.ts +26 -2
  459. package/dist/Take.d.ts.map +1 -1
  460. package/dist/Take.js +4 -1
  461. package/dist/Take.js.map +1 -1
  462. package/dist/Terminal.d.ts +39 -7
  463. package/dist/Terminal.d.ts.map +1 -1
  464. package/dist/Terminal.js +10 -4
  465. package/dist/Terminal.js.map +1 -1
  466. package/dist/Tracer.d.ts +233 -59
  467. package/dist/Tracer.d.ts.map +1 -1
  468. package/dist/Tracer.js +94 -18
  469. package/dist/Tracer.js.map +1 -1
  470. package/dist/Trie.d.ts +280 -245
  471. package/dist/Trie.d.ts.map +1 -1
  472. package/dist/Trie.js +116 -102
  473. package/dist/Trie.js.map +1 -1
  474. package/dist/Tuple.d.ts +34 -32
  475. package/dist/Tuple.d.ts.map +1 -1
  476. package/dist/Tuple.js +16 -14
  477. package/dist/Tuple.js.map +1 -1
  478. package/dist/TxChunk.d.ts +200 -155
  479. package/dist/TxChunk.d.ts.map +1 -1
  480. package/dist/TxChunk.js +83 -61
  481. package/dist/TxChunk.js.map +1 -1
  482. package/dist/TxDeferred.d.ts +43 -29
  483. package/dist/TxDeferred.d.ts.map +1 -1
  484. package/dist/TxDeferred.js +22 -15
  485. package/dist/TxDeferred.js.map +1 -1
  486. package/dist/TxHashMap.d.ts +362 -223
  487. package/dist/TxHashMap.d.ts.map +1 -1
  488. package/dist/TxHashMap.js +171 -98
  489. package/dist/TxHashMap.js.map +1 -1
  490. package/dist/TxHashSet.d.ts +181 -111
  491. package/dist/TxHashSet.d.ts.map +1 -1
  492. package/dist/TxHashSet.js +87 -49
  493. package/dist/TxHashSet.js.map +1 -1
  494. package/dist/TxPriorityQueue.d.ts +94 -63
  495. package/dist/TxPriorityQueue.d.ts.map +1 -1
  496. package/dist/TxPriorityQueue.js +55 -37
  497. package/dist/TxPriorityQueue.js.map +1 -1
  498. package/dist/TxPubSub.d.ts +77 -49
  499. package/dist/TxPubSub.d.ts.map +1 -1
  500. package/dist/TxPubSub.js +60 -37
  501. package/dist/TxPubSub.js.map +1 -1
  502. package/dist/TxQueue.d.ts +277 -242
  503. package/dist/TxQueue.d.ts.map +1 -1
  504. package/dist/TxQueue.js +147 -101
  505. package/dist/TxQueue.js.map +1 -1
  506. package/dist/TxReentrantLock.d.ts +69 -46
  507. package/dist/TxReentrantLock.d.ts.map +1 -1
  508. package/dist/TxReentrantLock.js +48 -32
  509. package/dist/TxReentrantLock.js.map +1 -1
  510. package/dist/TxRef.d.ts +69 -40
  511. package/dist/TxRef.d.ts.map +1 -1
  512. package/dist/TxRef.js +34 -19
  513. package/dist/TxRef.js.map +1 -1
  514. package/dist/TxSemaphore.d.ts +101 -115
  515. package/dist/TxSemaphore.d.ts.map +1 -1
  516. package/dist/TxSemaphore.js +76 -77
  517. package/dist/TxSemaphore.js.map +1 -1
  518. package/dist/TxSubscriptionRef.d.ts +74 -50
  519. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  520. package/dist/TxSubscriptionRef.js +34 -23
  521. package/dist/TxSubscriptionRef.js.map +1 -1
  522. package/dist/Types.d.ts +31 -34
  523. package/dist/Types.d.ts.map +1 -1
  524. package/dist/UndefinedOr.d.ts +62 -25
  525. package/dist/UndefinedOr.d.ts.map +1 -1
  526. package/dist/UndefinedOr.js +36 -25
  527. package/dist/UndefinedOr.js.map +1 -1
  528. package/dist/Unify.d.ts +72 -117
  529. package/dist/Unify.d.ts.map +1 -1
  530. package/dist/Unify.js +20 -6
  531. package/dist/Unify.js.map +1 -1
  532. package/dist/Utils.d.ts +5 -2
  533. package/dist/Utils.d.ts.map +1 -1
  534. package/dist/Utils.js +4 -0
  535. package/dist/Utils.js.map +1 -1
  536. package/dist/index.d.ts +1973 -418
  537. package/dist/index.d.ts.map +1 -1
  538. package/dist/index.js +1973 -418
  539. package/dist/index.js.map +1 -1
  540. package/dist/internal/schema/schema.js +1 -1
  541. package/dist/internal/schema/schema.js.map +1 -1
  542. package/dist/testing/FastCheck.d.ts +9 -6
  543. package/dist/testing/FastCheck.d.ts.map +1 -1
  544. package/dist/testing/FastCheck.js +9 -6
  545. package/dist/testing/FastCheck.js.map +1 -1
  546. package/dist/testing/TestClock.d.ts +39 -35
  547. package/dist/testing/TestClock.d.ts.map +1 -1
  548. package/dist/testing/TestClock.js +42 -12
  549. package/dist/testing/TestClock.js.map +1 -1
  550. package/dist/testing/TestConsole.d.ts +44 -36
  551. package/dist/testing/TestConsole.d.ts.map +1 -1
  552. package/dist/testing/TestConsole.js +30 -15
  553. package/dist/testing/TestConsole.js.map +1 -1
  554. package/dist/testing/TestSchema.d.ts +2 -0
  555. package/dist/testing/TestSchema.d.ts.map +1 -1
  556. package/dist/testing/TestSchema.js +9 -7
  557. package/dist/testing/TestSchema.js.map +1 -1
  558. package/dist/testing/index.d.ts +34 -0
  559. package/dist/testing/index.d.ts.map +1 -1
  560. package/dist/testing/index.js +34 -0
  561. package/dist/testing/index.js.map +1 -1
  562. package/dist/unstable/ai/AiError.d.ts +205 -147
  563. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  564. package/dist/unstable/ai/AiError.js +164 -109
  565. package/dist/unstable/ai/AiError.js.map +1 -1
  566. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  567. package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
  568. package/dist/unstable/ai/Chat.d.ts +64 -41
  569. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  570. package/dist/unstable/ai/Chat.js +51 -33
  571. package/dist/unstable/ai/Chat.js.map +1 -1
  572. package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
  573. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  574. package/dist/unstable/ai/EmbeddingModel.js +9 -8
  575. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  576. package/dist/unstable/ai/IdGenerator.d.ts +28 -18
  577. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  578. package/dist/unstable/ai/IdGenerator.js +18 -11
  579. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  580. package/dist/unstable/ai/LanguageModel.d.ts +31 -25
  581. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  582. package/dist/unstable/ai/LanguageModel.js +20 -14
  583. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  584. package/dist/unstable/ai/McpSchema.d.ts +342 -119
  585. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  586. package/dist/unstable/ai/McpSchema.js +266 -98
  587. package/dist/unstable/ai/McpSchema.js.map +1 -1
  588. package/dist/unstable/ai/McpServer.d.ts +56 -20
  589. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  590. package/dist/unstable/ai/McpServer.js +64 -16
  591. package/dist/unstable/ai/McpServer.js.map +1 -1
  592. package/dist/unstable/ai/Model.d.ts +10 -12
  593. package/dist/unstable/ai/Model.d.ts.map +1 -1
  594. package/dist/unstable/ai/Model.js +9 -7
  595. package/dist/unstable/ai/Model.js.map +1 -1
  596. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  597. package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
  598. package/dist/unstable/ai/Prompt.d.ts +200 -176
  599. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  600. package/dist/unstable/ai/Prompt.js +77 -68
  601. package/dist/unstable/ai/Prompt.js.map +1 -1
  602. package/dist/unstable/ai/Response.d.ts +173 -160
  603. package/dist/unstable/ai/Response.d.ts.map +1 -1
  604. package/dist/unstable/ai/Response.js +43 -48
  605. package/dist/unstable/ai/Response.js.map +1 -1
  606. package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
  607. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  608. package/dist/unstable/ai/ResponseIdTracker.js +27 -2
  609. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  610. package/dist/unstable/ai/Telemetry.d.ts +43 -33
  611. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  612. package/dist/unstable/ai/Telemetry.js +15 -11
  613. package/dist/unstable/ai/Telemetry.js.map +1 -1
  614. package/dist/unstable/ai/Tokenizer.d.ts +14 -9
  615. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  616. package/dist/unstable/ai/Tokenizer.js +10 -6
  617. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  618. package/dist/unstable/ai/Tool.d.ts +167 -96
  619. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  620. package/dist/unstable/ai/Tool.js +107 -53
  621. package/dist/unstable/ai/Tool.js.map +1 -1
  622. package/dist/unstable/ai/Toolkit.d.ts +32 -39
  623. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  624. package/dist/unstable/ai/Toolkit.js +7 -5
  625. package/dist/unstable/ai/Toolkit.js.map +1 -1
  626. package/dist/unstable/ai/index.d.ts +121 -29
  627. package/dist/unstable/ai/index.d.ts.map +1 -1
  628. package/dist/unstable/ai/index.js +121 -29
  629. package/dist/unstable/ai/index.js.map +1 -1
  630. package/dist/unstable/cli/Argument.d.ts +226 -134
  631. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  632. package/dist/unstable/cli/Argument.js +101 -65
  633. package/dist/unstable/cli/Argument.js.map +1 -1
  634. package/dist/unstable/cli/CliError.d.ts +72 -26
  635. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  636. package/dist/unstable/cli/CliError.js +86 -23
  637. package/dist/unstable/cli/CliError.js.map +1 -1
  638. package/dist/unstable/cli/CliOutput.d.ts +48 -19
  639. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  640. package/dist/unstable/cli/CliOutput.js +32 -9
  641. package/dist/unstable/cli/CliOutput.js.map +1 -1
  642. package/dist/unstable/cli/Command.d.ts +196 -115
  643. package/dist/unstable/cli/Command.d.ts.map +1 -1
  644. package/dist/unstable/cli/Command.js +45 -31
  645. package/dist/unstable/cli/Command.js.map +1 -1
  646. package/dist/unstable/cli/Completions.d.ts +7 -7
  647. package/dist/unstable/cli/Completions.js +1 -1
  648. package/dist/unstable/cli/Flag.d.ts +235 -142
  649. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  650. package/dist/unstable/cli/Flag.js +111 -71
  651. package/dist/unstable/cli/Flag.js.map +1 -1
  652. package/dist/unstable/cli/GlobalFlag.d.ts +41 -13
  653. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  654. package/dist/unstable/cli/GlobalFlag.js +30 -7
  655. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  656. package/dist/unstable/cli/HelpDoc.d.ts +39 -14
  657. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  658. package/dist/unstable/cli/HelpDoc.js +21 -0
  659. package/dist/unstable/cli/Param.d.ts +110 -32
  660. package/dist/unstable/cli/Param.d.ts.map +1 -1
  661. package/dist/unstable/cli/Param.js +196 -135
  662. package/dist/unstable/cli/Param.js.map +1 -1
  663. package/dist/unstable/cli/Primitive.d.ts +79 -42
  664. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  665. package/dist/unstable/cli/Primitive.js +66 -35
  666. package/dist/unstable/cli/Primitive.js.map +1 -1
  667. package/dist/unstable/cli/Prompt.d.ts +183 -59
  668. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  669. package/dist/unstable/cli/Prompt.js +105 -23
  670. package/dist/unstable/cli/Prompt.js.map +1 -1
  671. package/dist/unstable/cli/index.d.ts +182 -0
  672. package/dist/unstable/cli/index.d.ts.map +1 -1
  673. package/dist/unstable/cli/index.js +205 -6
  674. package/dist/unstable/cli/index.js.map +1 -1
  675. package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
  676. package/dist/unstable/cli/internal/ansi.js +13 -0
  677. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  678. package/dist/unstable/cli/internal/command.d.ts +5 -1
  679. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  680. package/dist/unstable/cli/internal/command.js +5 -1
  681. package/dist/unstable/cli/internal/command.js.map +1 -1
  682. package/dist/unstable/cli/internal/config.d.ts +3 -0
  683. package/dist/unstable/cli/internal/config.d.ts.map +1 -1
  684. package/dist/unstable/cli/internal/config.js.map +1 -1
  685. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  686. package/dist/unstable/cli/internal/parser.js +0 -1
  687. package/dist/unstable/cli/internal/parser.js.map +1 -1
  688. package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
  689. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  690. package/dist/unstable/cluster/ClusterCron.js +35 -1
  691. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  692. package/dist/unstable/cluster/ClusterError.d.ts +56 -7
  693. package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
  694. package/dist/unstable/cluster/ClusterError.js +56 -7
  695. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  696. package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
  697. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  698. package/dist/unstable/cluster/ClusterMetrics.js +39 -5
  699. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  700. package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
  701. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  702. package/dist/unstable/cluster/ClusterSchema.js +61 -8
  703. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  704. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
  705. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  706. package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -2
  707. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  708. package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
  709. package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
  710. package/dist/unstable/cluster/DeliverAt.js +11 -3
  711. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  712. package/dist/unstable/cluster/Entity.d.ts +74 -16
  713. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  714. package/dist/unstable/cluster/Entity.js +75 -10
  715. package/dist/unstable/cluster/Entity.js.map +1 -1
  716. package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
  717. package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
  718. package/dist/unstable/cluster/EntityAddress.js +30 -2
  719. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  720. package/dist/unstable/cluster/EntityId.d.ts +18 -3
  721. package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
  722. package/dist/unstable/cluster/EntityId.js +15 -2
  723. package/dist/unstable/cluster/EntityId.js.map +1 -1
  724. package/dist/unstable/cluster/EntityProxy.d.ts +42 -14
  725. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  726. package/dist/unstable/cluster/EntityProxy.js +30 -14
  727. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  728. package/dist/unstable/cluster/EntityProxyServer.d.ts +18 -2
  729. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  730. package/dist/unstable/cluster/EntityProxyServer.js +40 -8
  731. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  732. package/dist/unstable/cluster/EntityResource.d.ts +43 -6
  733. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  734. package/dist/unstable/cluster/EntityResource.js +11 -4
  735. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  736. package/dist/unstable/cluster/EntityType.d.ts +27 -3
  737. package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
  738. package/dist/unstable/cluster/EntityType.js +24 -2
  739. package/dist/unstable/cluster/EntityType.js.map +1 -1
  740. package/dist/unstable/cluster/Envelope.d.ts +105 -23
  741. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  742. package/dist/unstable/cluster/Envelope.js +88 -14
  743. package/dist/unstable/cluster/Envelope.js.map +1 -1
  744. package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
  745. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  746. package/dist/unstable/cluster/HttpRunner.js +88 -13
  747. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  748. package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
  749. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  750. package/dist/unstable/cluster/K8sHttpClient.js +31 -6
  751. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  752. package/dist/unstable/cluster/MachineId.d.ts +24 -3
  753. package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
  754. package/dist/unstable/cluster/MachineId.js +21 -2
  755. package/dist/unstable/cluster/MachineId.js.map +1 -1
  756. package/dist/unstable/cluster/Message.d.ts +102 -13
  757. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  758. package/dist/unstable/cluster/Message.js +86 -10
  759. package/dist/unstable/cluster/Message.js.map +1 -1
  760. package/dist/unstable/cluster/MessageStorage.d.ts +126 -21
  761. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  762. package/dist/unstable/cluster/MessageStorage.js +70 -10
  763. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  764. package/dist/unstable/cluster/Reply.d.ts +101 -12
  765. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  766. package/dist/unstable/cluster/Reply.js +64 -8
  767. package/dist/unstable/cluster/Reply.js.map +1 -1
  768. package/dist/unstable/cluster/Runner.d.ts +47 -17
  769. package/dist/unstable/cluster/Runner.d.ts.map +1 -1
  770. package/dist/unstable/cluster/Runner.js +47 -17
  771. package/dist/unstable/cluster/Runner.js.map +1 -1
  772. package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
  773. package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
  774. package/dist/unstable/cluster/RunnerAddress.js +34 -2
  775. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  776. package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
  777. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  778. package/dist/unstable/cluster/RunnerHealth.js +40 -12
  779. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  780. package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
  781. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  782. package/dist/unstable/cluster/RunnerServer.js +31 -4
  783. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  784. package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
  785. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  786. package/dist/unstable/cluster/RunnerStorage.js +38 -4
  787. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  788. package/dist/unstable/cluster/Runners.d.ts +76 -13
  789. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  790. package/dist/unstable/cluster/Runners.js +73 -12
  791. package/dist/unstable/cluster/Runners.js.map +1 -1
  792. package/dist/unstable/cluster/ShardId.d.ts +53 -5
  793. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  794. package/dist/unstable/cluster/ShardId.js +49 -4
  795. package/dist/unstable/cluster/ShardId.js.map +1 -1
  796. package/dist/unstable/cluster/Sharding.d.ts +10 -2
  797. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  798. package/dist/unstable/cluster/Sharding.js +35 -4
  799. package/dist/unstable/cluster/Sharding.js.map +1 -1
  800. package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
  801. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  802. package/dist/unstable/cluster/ShardingConfig.js +66 -9
  803. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  804. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
  805. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
  806. package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
  807. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  808. package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
  809. package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
  810. package/dist/unstable/cluster/SingleRunner.js +23 -1
  811. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  812. package/dist/unstable/cluster/Singleton.d.ts +15 -1
  813. package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
  814. package/dist/unstable/cluster/Singleton.js +15 -1
  815. package/dist/unstable/cluster/Singleton.js.map +1 -1
  816. package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
  817. package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
  818. package/dist/unstable/cluster/SingletonAddress.js +21 -1
  819. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  820. package/dist/unstable/cluster/Snowflake.d.ts +90 -19
  821. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  822. package/dist/unstable/cluster/Snowflake.js +49 -13
  823. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  824. package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
  825. package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
  826. package/dist/unstable/cluster/SocketRunner.js +29 -2
  827. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  828. package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
  829. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  830. package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
  831. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  832. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
  833. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  834. package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
  835. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  836. package/dist/unstable/cluster/TestRunner.d.ts +18 -1
  837. package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
  838. package/dist/unstable/cluster/TestRunner.js +18 -1
  839. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  840. package/dist/unstable/cluster/index.d.ts +790 -0
  841. package/dist/unstable/cluster/index.d.ts.map +1 -1
  842. package/dist/unstable/cluster/index.js +790 -0
  843. package/dist/unstable/cluster/index.js.map +1 -1
  844. package/dist/unstable/cluster/internal/hash.js +12 -0
  845. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  846. package/dist/unstable/devtools/DevTools.d.ts +26 -3
  847. package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
  848. package/dist/unstable/devtools/DevTools.js +26 -3
  849. package/dist/unstable/devtools/DevTools.js.map +1 -1
  850. package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
  851. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  852. package/dist/unstable/devtools/DevToolsClient.js +32 -5
  853. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  854. package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
  855. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  856. package/dist/unstable/devtools/DevToolsSchema.js +102 -20
  857. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  858. package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
  859. package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
  860. package/dist/unstable/devtools/DevToolsServer.js +21 -1
  861. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  862. package/dist/unstable/devtools/index.d.ts +58 -0
  863. package/dist/unstable/devtools/index.d.ts.map +1 -1
  864. package/dist/unstable/devtools/index.js +58 -0
  865. package/dist/unstable/devtools/index.js.map +1 -1
  866. package/dist/unstable/encoding/Msgpack.d.ts +81 -12
  867. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  868. package/dist/unstable/encoding/Msgpack.js +75 -9
  869. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  870. package/dist/unstable/encoding/Ndjson.d.ts +149 -21
  871. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  872. package/dist/unstable/encoding/Ndjson.js +97 -13
  873. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  874. package/dist/unstable/encoding/Sse.d.ts +109 -18
  875. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  876. package/dist/unstable/encoding/Sse.js +69 -13
  877. package/dist/unstable/encoding/Sse.js.map +1 -1
  878. package/dist/unstable/encoding/index.d.ts +49 -0
  879. package/dist/unstable/encoding/index.d.ts.map +1 -1
  880. package/dist/unstable/encoding/index.js +49 -0
  881. package/dist/unstable/encoding/index.js.map +1 -1
  882. package/dist/unstable/eventlog/Event.d.ts +115 -30
  883. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  884. package/dist/unstable/eventlog/Event.js +22 -2
  885. package/dist/unstable/eventlog/Event.js.map +1 -1
  886. package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
  887. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  888. package/dist/unstable/eventlog/EventGroup.js +24 -6
  889. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  890. package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
  891. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  892. package/dist/unstable/eventlog/EventJournal.js +108 -16
  893. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  894. package/dist/unstable/eventlog/EventLog.d.ts +150 -31
  895. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  896. package/dist/unstable/eventlog/EventLog.js +111 -20
  897. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  898. package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
  899. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  900. package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
  901. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  902. package/dist/unstable/eventlog/EventLogMessage.d.ts +92 -18
  903. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
  904. package/dist/unstable/eventlog/EventLogMessage.js +72 -16
  905. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  906. package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
  907. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  908. package/dist/unstable/eventlog/EventLogRemote.js +54 -8
  909. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  910. package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
  911. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  912. package/dist/unstable/eventlog/EventLogServer.js +17 -3
  913. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  914. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
  915. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  916. package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
  917. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  918. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
  919. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  920. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
  921. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  922. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
  923. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
  924. package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
  925. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  926. package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
  927. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  928. package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
  929. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  930. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
  931. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
  932. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
  933. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  934. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
  935. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
  936. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
  937. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  938. package/dist/unstable/eventlog/index.d.ts +240 -0
  939. package/dist/unstable/eventlog/index.d.ts.map +1 -1
  940. package/dist/unstable/eventlog/index.js +240 -0
  941. package/dist/unstable/eventlog/index.js.map +1 -1
  942. package/dist/unstable/http/Cookies.d.ts +156 -77
  943. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  944. package/dist/unstable/http/Cookies.js +93 -39
  945. package/dist/unstable/http/Cookies.js.map +1 -1
  946. package/dist/unstable/http/Etag.d.ts +40 -7
  947. package/dist/unstable/http/Etag.d.ts.map +1 -1
  948. package/dist/unstable/http/Etag.js +27 -4
  949. package/dist/unstable/http/Etag.js.map +1 -1
  950. package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
  951. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  952. package/dist/unstable/http/FetchHttpClient.js +33 -4
  953. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  954. package/dist/unstable/http/FindMyWay.d.ts +1 -1
  955. package/dist/unstable/http/FindMyWay.js +1 -1
  956. package/dist/unstable/http/Headers.d.ts +182 -36
  957. package/dist/unstable/http/Headers.d.ts.map +1 -1
  958. package/dist/unstable/http/Headers.js +86 -16
  959. package/dist/unstable/http/Headers.js.map +1 -1
  960. package/dist/unstable/http/HttpBody.d.ts +114 -26
  961. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  962. package/dist/unstable/http/HttpBody.js +98 -20
  963. package/dist/unstable/http/HttpBody.js.map +1 -1
  964. package/dist/unstable/http/HttpClient.d.ts +204 -96
  965. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  966. package/dist/unstable/http/HttpClient.js +85 -38
  967. package/dist/unstable/http/HttpClient.js.map +1 -1
  968. package/dist/unstable/http/HttpClientError.d.ts +68 -12
  969. package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
  970. package/dist/unstable/http/HttpClientError.js +71 -9
  971. package/dist/unstable/http/HttpClientError.js.map +1 -1
  972. package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
  973. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  974. package/dist/unstable/http/HttpClientRequest.js +151 -45
  975. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  976. package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
  977. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  978. package/dist/unstable/http/HttpClientResponse.js +44 -11
  979. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  980. package/dist/unstable/http/HttpEffect.d.ts +42 -16
  981. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  982. package/dist/unstable/http/HttpEffect.js +33 -13
  983. package/dist/unstable/http/HttpEffect.js.map +1 -1
  984. package/dist/unstable/http/HttpIncomingMessage.d.ts +48 -7
  985. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  986. package/dist/unstable/http/HttpIncomingMessage.js +45 -6
  987. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  988. package/dist/unstable/http/HttpMethod.d.ts +38 -6
  989. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  990. package/dist/unstable/http/HttpMethod.js +27 -2
  991. package/dist/unstable/http/HttpMethod.js.map +1 -1
  992. package/dist/unstable/http/HttpMiddleware.d.ts +38 -11
  993. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  994. package/dist/unstable/http/HttpMiddleware.js +52 -10
  995. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  996. package/dist/unstable/http/HttpPlatform.d.ts +34 -3
  997. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  998. package/dist/unstable/http/HttpPlatform.js +34 -3
  999. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  1000. package/dist/unstable/http/HttpRouter.d.ts +209 -62
  1001. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  1002. package/dist/unstable/http/HttpRouter.js +136 -41
  1003. package/dist/unstable/http/HttpRouter.js.map +1 -1
  1004. package/dist/unstable/http/HttpServer.d.ts +151 -22
  1005. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  1006. package/dist/unstable/http/HttpServer.js +76 -11
  1007. package/dist/unstable/http/HttpServer.js.map +1 -1
  1008. package/dist/unstable/http/HttpServerError.d.ts +93 -10
  1009. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  1010. package/dist/unstable/http/HttpServerError.js +85 -8
  1011. package/dist/unstable/http/HttpServerError.js.map +1 -1
  1012. package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
  1013. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  1014. package/dist/unstable/http/HttpServerRequest.js +101 -20
  1015. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  1016. package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
  1017. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  1018. package/dist/unstable/http/HttpServerRespondable.js +43 -5
  1019. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  1020. package/dist/unstable/http/HttpServerResponse.d.ts +391 -67
  1021. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  1022. package/dist/unstable/http/HttpServerResponse.js +205 -33
  1023. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  1024. package/dist/unstable/http/HttpStaticServer.d.ts +24 -8
  1025. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  1026. package/dist/unstable/http/HttpStaticServer.js +24 -8
  1027. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  1028. package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
  1029. package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
  1030. package/dist/unstable/http/HttpTraceContext.js +47 -5
  1031. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  1032. package/dist/unstable/http/Multipart.d.ts +179 -28
  1033. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  1034. package/dist/unstable/http/Multipart.js +131 -19
  1035. package/dist/unstable/http/Multipart.js.map +1 -1
  1036. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
  1037. package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
  1038. package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
  1039. package/dist/unstable/http/Multipasta/Node.js +1 -1
  1040. package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
  1041. package/dist/unstable/http/Multipasta/Search.js +1 -1
  1042. package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
  1043. package/dist/unstable/http/Multipasta/Web.js +1 -1
  1044. package/dist/unstable/http/Multipasta.d.ts +1 -1
  1045. package/dist/unstable/http/Multipasta.js +1 -1
  1046. package/dist/unstable/http/Template.d.ts +53 -1
  1047. package/dist/unstable/http/Template.d.ts.map +1 -1
  1048. package/dist/unstable/http/Template.js +26 -0
  1049. package/dist/unstable/http/Template.js.map +1 -1
  1050. package/dist/unstable/http/Url.d.ts +70 -56
  1051. package/dist/unstable/http/Url.d.ts.map +1 -1
  1052. package/dist/unstable/http/Url.js +35 -21
  1053. package/dist/unstable/http/Url.js.map +1 -1
  1054. package/dist/unstable/http/UrlParams.d.ts +237 -51
  1055. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  1056. package/dist/unstable/http/UrlParams.js +120 -25
  1057. package/dist/unstable/http/UrlParams.js.map +1 -1
  1058. package/dist/unstable/http/index.d.ts +452 -0
  1059. package/dist/unstable/http/index.d.ts.map +1 -1
  1060. package/dist/unstable/http/index.js +452 -0
  1061. package/dist/unstable/http/index.js.map +1 -1
  1062. package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
  1063. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  1064. package/dist/unstable/httpapi/HttpApi.js +14 -8
  1065. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  1066. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +54 -16
  1067. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  1068. package/dist/unstable/httpapi/HttpApiBuilder.js +44 -6
  1069. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  1070. package/dist/unstable/httpapi/HttpApiClient.d.ts +57 -15
  1071. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  1072. package/dist/unstable/httpapi/HttpApiClient.js +42 -6
  1073. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  1074. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
  1075. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  1076. package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
  1077. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1078. package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
  1079. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  1080. package/dist/unstable/httpapi/HttpApiError.js +98 -1
  1081. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1082. package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
  1083. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  1084. package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
  1085. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1086. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
  1087. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1088. package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -5
  1089. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1090. package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
  1091. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1092. package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
  1093. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1094. package/dist/unstable/httpapi/HttpApiSchema.d.ts +86 -38
  1095. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  1096. package/dist/unstable/httpapi/HttpApiSchema.js +59 -35
  1097. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1098. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +73 -17
  1099. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  1100. package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
  1101. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1102. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +4 -3
  1103. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  1104. package/dist/unstable/httpapi/HttpApiSwagger.js +23 -3
  1105. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1106. package/dist/unstable/httpapi/HttpApiTest.d.ts +6 -1
  1107. package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
  1108. package/dist/unstable/httpapi/HttpApiTest.js +26 -1
  1109. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1110. package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
  1111. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1112. package/dist/unstable/httpapi/OpenApi.js +73 -15
  1113. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1114. package/dist/unstable/httpapi/index.d.ts +310 -25
  1115. package/dist/unstable/httpapi/index.d.ts.map +1 -1
  1116. package/dist/unstable/httpapi/index.js +310 -25
  1117. package/dist/unstable/httpapi/index.js.map +1 -1
  1118. package/dist/unstable/observability/Otlp.d.ts +33 -3
  1119. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  1120. package/dist/unstable/observability/Otlp.js +14 -3
  1121. package/dist/unstable/observability/Otlp.js.map +1 -1
  1122. package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
  1123. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1124. package/dist/unstable/observability/OtlpExporter.js +32 -1
  1125. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1126. package/dist/unstable/observability/OtlpLogger.d.ts +15 -2
  1127. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1128. package/dist/unstable/observability/OtlpLogger.js +29 -2
  1129. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1130. package/dist/unstable/observability/OtlpMetrics.d.ts +17 -5
  1131. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1132. package/dist/unstable/observability/OtlpMetrics.js +32 -2
  1133. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1134. package/dist/unstable/observability/OtlpResource.d.ts +49 -12
  1135. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1136. package/dist/unstable/observability/OtlpResource.js +47 -5
  1137. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1138. package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
  1139. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  1140. package/dist/unstable/observability/OtlpSerialization.js +28 -3
  1141. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1142. package/dist/unstable/observability/OtlpTracer.d.ts +19 -2
  1143. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  1144. package/dist/unstable/observability/OtlpTracer.js +32 -2
  1145. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1146. package/dist/unstable/observability/PrometheusMetrics.d.ts +36 -16
  1147. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1148. package/dist/unstable/observability/PrometheusMetrics.js +9 -7
  1149. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1150. package/dist/unstable/observability/index.d.ts +160 -3
  1151. package/dist/unstable/observability/index.d.ts.map +1 -1
  1152. package/dist/unstable/observability/index.js +160 -3
  1153. package/dist/unstable/observability/index.js.map +1 -1
  1154. package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
  1155. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1156. package/dist/unstable/persistence/KeyValueStore.js +81 -21
  1157. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1158. package/dist/unstable/persistence/Persistable.d.ts +76 -15
  1159. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  1160. package/dist/unstable/persistence/Persistable.js +22 -5
  1161. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1162. package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
  1163. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  1164. package/dist/unstable/persistence/PersistedCache.js +24 -1
  1165. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1166. package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
  1167. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  1168. package/dist/unstable/persistence/PersistedQueue.js +60 -13
  1169. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1170. package/dist/unstable/persistence/Persistence.d.ts +98 -16
  1171. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1172. package/dist/unstable/persistence/Persistence.js +91 -14
  1173. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1174. package/dist/unstable/persistence/RateLimiter.d.ts +101 -21
  1175. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1176. package/dist/unstable/persistence/RateLimiter.js +85 -16
  1177. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1178. package/dist/unstable/persistence/Redis.d.ts +26 -5
  1179. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  1180. package/dist/unstable/persistence/Redis.js +36 -4
  1181. package/dist/unstable/persistence/Redis.js.map +1 -1
  1182. package/dist/unstable/persistence/index.d.ts +147 -0
  1183. package/dist/unstable/persistence/index.d.ts.map +1 -1
  1184. package/dist/unstable/persistence/index.js +147 -0
  1185. package/dist/unstable/persistence/index.js.map +1 -1
  1186. package/dist/unstable/process/ChildProcess.d.ts +87 -64
  1187. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1188. package/dist/unstable/process/ChildProcess.js +25 -18
  1189. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1190. package/dist/unstable/process/ChildProcessSpawner.d.ts +23 -12
  1191. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1192. package/dist/unstable/process/ChildProcessSpawner.js +11 -6
  1193. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1194. package/dist/unstable/process/index.d.ts +2 -1
  1195. package/dist/unstable/process/index.d.ts.map +1 -1
  1196. package/dist/unstable/process/index.js +2 -1
  1197. package/dist/unstable/process/index.js.map +1 -1
  1198. package/dist/unstable/reactivity/AsyncResult.d.ts +198 -59
  1199. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1200. package/dist/unstable/reactivity/AsyncResult.js +121 -36
  1201. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1202. package/dist/unstable/reactivity/Atom.d.ts +544 -130
  1203. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1204. package/dist/unstable/reactivity/Atom.js +252 -58
  1205. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1206. package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
  1207. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1208. package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
  1209. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1210. package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
  1211. package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
  1212. package/dist/unstable/reactivity/AtomRef.js +29 -3
  1213. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1214. package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
  1215. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  1216. package/dist/unstable/reactivity/AtomRegistry.js +69 -10
  1217. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1218. package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
  1219. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1220. package/dist/unstable/reactivity/AtomRpc.js +29 -1
  1221. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1222. package/dist/unstable/reactivity/Hydration.d.ts +28 -5
  1223. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
  1224. package/dist/unstable/reactivity/Hydration.js +35 -3
  1225. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1226. package/dist/unstable/reactivity/Reactivity.d.ts +94 -13
  1227. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  1228. package/dist/unstable/reactivity/Reactivity.js +60 -7
  1229. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1230. package/dist/unstable/reactivity/index.d.ts +167 -0
  1231. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  1232. package/dist/unstable/reactivity/index.js +167 -0
  1233. package/dist/unstable/reactivity/index.js.map +1 -1
  1234. package/dist/unstable/rpc/Rpc.d.ts +254 -56
  1235. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1236. package/dist/unstable/rpc/Rpc.js +44 -11
  1237. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1238. package/dist/unstable/rpc/RpcClient.d.ts +80 -19
  1239. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1240. package/dist/unstable/rpc/RpcClient.js +52 -12
  1241. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1242. package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
  1243. package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
  1244. package/dist/unstable/rpc/RpcClientError.js +26 -2
  1245. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1246. package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
  1247. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  1248. package/dist/unstable/rpc/RpcGroup.js +3 -1
  1249. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1250. package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
  1251. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1252. package/dist/unstable/rpc/RpcMessage.js +23 -7
  1253. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1254. package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
  1255. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  1256. package/dist/unstable/rpc/RpcMiddleware.js +39 -3
  1257. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1258. package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
  1259. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  1260. package/dist/unstable/rpc/RpcSchema.js +34 -3
  1261. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1262. package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
  1263. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1264. package/dist/unstable/rpc/RpcSerialization.js +56 -12
  1265. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1266. package/dist/unstable/rpc/RpcServer.d.ts +73 -23
  1267. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  1268. package/dist/unstable/rpc/RpcServer.js +69 -22
  1269. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1270. package/dist/unstable/rpc/RpcTest.d.ts +20 -1
  1271. package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
  1272. package/dist/unstable/rpc/RpcTest.js +20 -1
  1273. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1274. package/dist/unstable/rpc/RpcWorker.d.ts +39 -6
  1275. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  1276. package/dist/unstable/rpc/RpcWorker.js +16 -4
  1277. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1278. package/dist/unstable/rpc/Utils.d.ts +10 -0
  1279. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  1280. package/dist/unstable/rpc/Utils.js +10 -0
  1281. package/dist/unstable/rpc/Utils.js.map +1 -1
  1282. package/dist/unstable/rpc/index.d.ts +272 -0
  1283. package/dist/unstable/rpc/index.d.ts.map +1 -1
  1284. package/dist/unstable/rpc/index.js +272 -0
  1285. package/dist/unstable/rpc/index.js.map +1 -1
  1286. package/dist/unstable/schema/Model.d.ts +192 -59
  1287. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1288. package/dist/unstable/schema/Model.js +122 -38
  1289. package/dist/unstable/schema/Model.js.map +1 -1
  1290. package/dist/unstable/schema/VariantSchema.d.ts +101 -24
  1291. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1292. package/dist/unstable/schema/VariantSchema.js +22 -6
  1293. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1294. package/dist/unstable/schema/index.d.ts +37 -0
  1295. package/dist/unstable/schema/index.d.ts.map +1 -1
  1296. package/dist/unstable/schema/index.js +37 -0
  1297. package/dist/unstable/schema/index.js.map +1 -1
  1298. package/dist/unstable/socket/Socket.d.ts +168 -34
  1299. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1300. package/dist/unstable/socket/Socket.js +124 -28
  1301. package/dist/unstable/socket/Socket.js.map +1 -1
  1302. package/dist/unstable/socket/SocketServer.d.ts +58 -10
  1303. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  1304. package/dist/unstable/socket/SocketServer.js +43 -5
  1305. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1306. package/dist/unstable/socket/index.d.ts +44 -0
  1307. package/dist/unstable/socket/index.d.ts.map +1 -1
  1308. package/dist/unstable/socket/index.js +44 -0
  1309. package/dist/unstable/socket/index.js.map +1 -1
  1310. package/dist/unstable/sql/Migrator.d.ts +40 -9
  1311. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  1312. package/dist/unstable/sql/Migrator.js +45 -5
  1313. package/dist/unstable/sql/Migrator.js.map +1 -1
  1314. package/dist/unstable/sql/SqlClient.d.ts +38 -2
  1315. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1316. package/dist/unstable/sql/SqlClient.js +40 -1
  1317. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1318. package/dist/unstable/sql/SqlConnection.d.ts +34 -3
  1319. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  1320. package/dist/unstable/sql/SqlConnection.js +22 -0
  1321. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1322. package/dist/unstable/sql/SqlError.d.ts +117 -0
  1323. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  1324. package/dist/unstable/sql/SqlError.js +131 -0
  1325. package/dist/unstable/sql/SqlError.js.map +1 -1
  1326. package/dist/unstable/sql/SqlModel.d.ts +25 -5
  1327. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  1328. package/dist/unstable/sql/SqlModel.js +8 -4
  1329. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1330. package/dist/unstable/sql/SqlResolver.d.ts +56 -13
  1331. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  1332. package/dist/unstable/sql/SqlResolver.js +44 -10
  1333. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1334. package/dist/unstable/sql/SqlSchema.d.ts +29 -8
  1335. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  1336. package/dist/unstable/sql/SqlSchema.js +29 -8
  1337. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1338. package/dist/unstable/sql/SqlStream.d.ts +4 -0
  1339. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  1340. package/dist/unstable/sql/SqlStream.js +24 -0
  1341. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1342. package/dist/unstable/sql/Statement.d.ts +151 -24
  1343. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1344. package/dist/unstable/sql/Statement.js +91 -6
  1345. package/dist/unstable/sql/Statement.js.map +1 -1
  1346. package/dist/unstable/sql/index.d.ts +179 -1
  1347. package/dist/unstable/sql/index.d.ts.map +1 -1
  1348. package/dist/unstable/sql/index.js +179 -1
  1349. package/dist/unstable/sql/index.js.map +1 -1
  1350. package/dist/unstable/workers/Transferable.d.ts +72 -20
  1351. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  1352. package/dist/unstable/workers/Transferable.js +57 -14
  1353. package/dist/unstable/workers/Transferable.js.map +1 -1
  1354. package/dist/unstable/workers/Worker.d.ts +61 -8
  1355. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  1356. package/dist/unstable/workers/Worker.js +44 -4
  1357. package/dist/unstable/workers/Worker.js.map +1 -1
  1358. package/dist/unstable/workers/WorkerError.d.ts +31 -9
  1359. package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
  1360. package/dist/unstable/workers/WorkerError.js +44 -7
  1361. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1362. package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
  1363. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  1364. package/dist/unstable/workers/WorkerRunner.js +24 -1
  1365. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1366. package/dist/unstable/workers/index.d.ts +81 -1
  1367. package/dist/unstable/workers/index.d.ts.map +1 -1
  1368. package/dist/unstable/workers/index.js +81 -1
  1369. package/dist/unstable/workers/index.js.map +1 -1
  1370. package/dist/unstable/workflow/Activity.d.ts +61 -10
  1371. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  1372. package/dist/unstable/workflow/Activity.js +20 -5
  1373. package/dist/unstable/workflow/Activity.js.map +1 -1
  1374. package/dist/unstable/workflow/DurableClock.d.ts +12 -3
  1375. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  1376. package/dist/unstable/workflow/DurableClock.js +22 -2
  1377. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1378. package/dist/unstable/workflow/DurableDeferred.d.ts +128 -31
  1379. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  1380. package/dist/unstable/workflow/DurableDeferred.js +77 -13
  1381. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1382. package/dist/unstable/workflow/DurableQueue.d.ts +33 -8
  1383. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  1384. package/dist/unstable/workflow/DurableQueue.js +26 -6
  1385. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  1386. package/dist/unstable/workflow/Workflow.d.ts +102 -31
  1387. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1388. package/dist/unstable/workflow/Workflow.js +75 -19
  1389. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1390. package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
  1391. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  1392. package/dist/unstable/workflow/WorkflowEngine.js +16 -4
  1393. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1394. package/dist/unstable/workflow/WorkflowProxy.d.ts +40 -12
  1395. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1396. package/dist/unstable/workflow/WorkflowProxy.js +8 -12
  1397. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1398. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +37 -2
  1399. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  1400. package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
  1401. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1402. package/dist/unstable/workflow/index.d.ts +160 -0
  1403. package/dist/unstable/workflow/index.d.ts.map +1 -1
  1404. package/dist/unstable/workflow/index.js +160 -0
  1405. package/dist/unstable/workflow/index.js.map +1 -1
  1406. package/package.json +11 -11
  1407. package/src/Array.ts +151 -106
  1408. package/src/BigDecimal.ts +620 -553
  1409. package/src/BigInt.ts +342 -274
  1410. package/src/Boolean.ts +189 -156
  1411. package/src/Brand.ts +30 -5
  1412. package/src/Cache.ts +334 -167
  1413. package/src/Cause.ts +84 -73
  1414. package/src/Channel.ts +1639 -667
  1415. package/src/ChannelSchema.ts +137 -12
  1416. package/src/Chunk.ts +575 -429
  1417. package/src/Clock.ts +16 -9
  1418. package/src/Combiner.ts +11 -5
  1419. package/src/Config.ts +80 -68
  1420. package/src/ConfigProvider.ts +33 -32
  1421. package/src/Console.ts +88 -58
  1422. package/src/Context.ts +401 -190
  1423. package/src/Cron.ts +109 -48
  1424. package/src/Crypto.ts +327 -0
  1425. package/src/Data.ts +9 -3
  1426. package/src/DateTime.ts +893 -464
  1427. package/src/Deferred.ts +367 -175
  1428. package/src/Differ.ts +44 -2
  1429. package/src/Duration.ts +333 -186
  1430. package/src/Effect.ts +2201 -2289
  1431. package/src/Effectable.ts +38 -3
  1432. package/src/Encoding.ts +78 -28
  1433. package/src/Equal.ts +4 -3
  1434. package/src/Equivalence.ts +18 -24
  1435. package/src/ErrorReporter.ts +66 -82
  1436. package/src/ExecutionPlan.ts +106 -12
  1437. package/src/Exit.ts +6 -5
  1438. package/src/Fiber.ts +71 -40
  1439. package/src/FiberHandle.ts +157 -57
  1440. package/src/FiberMap.ts +328 -163
  1441. package/src/FiberSet.ts +130 -52
  1442. package/src/FileSystem.ts +104 -74
  1443. package/src/Filter.ts +166 -88
  1444. package/src/Formatter.ts +4 -70
  1445. package/src/Function.ts +218 -151
  1446. package/src/Graph.ts +714 -415
  1447. package/src/HKT.ts +29 -13
  1448. package/src/Hash.ts +35 -24
  1449. package/src/HashMap.ts +540 -388
  1450. package/src/HashRing.ts +111 -34
  1451. package/src/HashSet.ts +239 -153
  1452. package/src/Inspectable.ts +30 -17
  1453. package/src/Iterable.ts +336 -222
  1454. package/src/JsonPatch.ts +13 -10
  1455. package/src/JsonPointer.ts +13 -11
  1456. package/src/JsonSchema.ts +16 -0
  1457. package/src/Latch.ts +97 -26
  1458. package/src/Layer.ts +547 -445
  1459. package/src/LayerMap.ts +99 -26
  1460. package/src/LogLevel.ts +92 -131
  1461. package/src/Logger.ts +365 -297
  1462. package/src/ManagedRuntime.ts +78 -19
  1463. package/src/Match.ts +135 -161
  1464. package/src/Metric.ts +362 -313
  1465. package/src/MutableHashMap.ts +202 -127
  1466. package/src/MutableHashSet.ts +120 -52
  1467. package/src/MutableList.ts +157 -100
  1468. package/src/MutableRef.ts +129 -90
  1469. package/src/Newtype.ts +15 -2
  1470. package/src/NonEmptyIterable.ts +38 -48
  1471. package/src/Number.ts +261 -205
  1472. package/src/Optic.ts +6 -7
  1473. package/src/Option.ts +133 -156
  1474. package/src/Order.ts +6 -6
  1475. package/src/Ordering.ts +56 -45
  1476. package/src/PartitionedSemaphore.ts +225 -40
  1477. package/src/Path.ts +77 -13
  1478. package/src/Pipeable.ts +82 -24
  1479. package/src/PlatformError.ts +74 -6
  1480. package/src/Pool.ts +94 -31
  1481. package/src/Predicate.ts +17 -24
  1482. package/src/PrimaryKey.ts +11 -3
  1483. package/src/PubSub.ts +385 -309
  1484. package/src/Pull.ts +94 -25
  1485. package/src/Queue.ts +303 -184
  1486. package/src/Random.ts +69 -93
  1487. package/src/RcMap.ts +151 -141
  1488. package/src/RcRef.ts +68 -32
  1489. package/src/Record.ts +282 -137
  1490. package/src/Redactable.ts +7 -5
  1491. package/src/Redacted.ts +63 -34
  1492. package/src/Reducer.ts +3 -1
  1493. package/src/Ref.ts +173 -134
  1494. package/src/References.ts +73 -31
  1495. package/src/RegExp.ts +12 -6
  1496. package/src/Request.ts +159 -34
  1497. package/src/RequestResolver.ts +278 -121
  1498. package/src/Resource.ts +45 -7
  1499. package/src/Result.ts +137 -153
  1500. package/src/Runtime.ts +42 -21
  1501. package/src/Schedule.ts +585 -613
  1502. package/src/Scheduler.ts +44 -7
  1503. package/src/Schema.ts +1309 -615
  1504. package/src/SchemaAST.ts +123 -93
  1505. package/src/SchemaGetter.ts +52 -37
  1506. package/src/SchemaIssue.ts +19 -24
  1507. package/src/SchemaParser.ts +306 -85
  1508. package/src/SchemaRepresentation.ts +89 -77
  1509. package/src/SchemaTransformation.ts +97 -46
  1510. package/src/SchemaUtils.ts +24 -1
  1511. package/src/Scope.ts +107 -65
  1512. package/src/ScopedCache.ts +195 -59
  1513. package/src/ScopedRef.ts +28 -8
  1514. package/src/Semaphore.ts +61 -37
  1515. package/src/Sink.ts +461 -206
  1516. package/src/Stdio.ts +43 -6
  1517. package/src/Stream.ts +2361 -1613
  1518. package/src/String.ts +174 -97
  1519. package/src/Struct.ts +20 -18
  1520. package/src/SubscriptionRef.ts +309 -204
  1521. package/src/Symbol.ts +13 -5
  1522. package/src/SynchronizedRef.ts +278 -62
  1523. package/src/Take.ts +26 -2
  1524. package/src/Terminal.ts +40 -7
  1525. package/src/Tracer.ts +233 -59
  1526. package/src/Trie.ts +280 -245
  1527. package/src/Tuple.ts +34 -32
  1528. package/src/TxChunk.ts +200 -155
  1529. package/src/TxDeferred.ts +43 -29
  1530. package/src/TxHashMap.ts +370 -231
  1531. package/src/TxHashSet.ts +253 -159
  1532. package/src/TxPriorityQueue.ts +97 -65
  1533. package/src/TxPubSub.ts +77 -49
  1534. package/src/TxQueue.ts +277 -242
  1535. package/src/TxReentrantLock.ts +70 -47
  1536. package/src/TxRef.ts +69 -40
  1537. package/src/TxSemaphore.ts +101 -115
  1538. package/src/TxSubscriptionRef.ts +74 -50
  1539. package/src/Types.ts +31 -34
  1540. package/src/UndefinedOr.ts +62 -25
  1541. package/src/Unify.ts +72 -117
  1542. package/src/Utils.ts +5 -2
  1543. package/src/index.ts +1976 -420
  1544. package/src/internal/schema/schema.ts +1 -1
  1545. package/src/testing/FastCheck.ts +9 -6
  1546. package/src/testing/TestClock.ts +63 -35
  1547. package/src/testing/TestConsole.ts +54 -36
  1548. package/src/testing/TestSchema.ts +10 -8
  1549. package/src/testing/index.ts +34 -0
  1550. package/src/unstable/ai/AiError.ts +195 -137
  1551. package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
  1552. package/src/unstable/ai/Chat.ts +68 -43
  1553. package/src/unstable/ai/EmbeddingModel.ts +12 -11
  1554. package/src/unstable/ai/IdGenerator.ts +28 -18
  1555. package/src/unstable/ai/LanguageModel.ts +35 -27
  1556. package/src/unstable/ai/McpSchema.ts +342 -119
  1557. package/src/unstable/ai/McpServer.ts +79 -20
  1558. package/src/unstable/ai/Model.ts +10 -12
  1559. package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
  1560. package/src/unstable/ai/Prompt.ts +216 -192
  1561. package/src/unstable/ai/Response.ts +179 -167
  1562. package/src/unstable/ai/ResponseIdTracker.ts +43 -4
  1563. package/src/unstable/ai/Telemetry.ts +43 -33
  1564. package/src/unstable/ai/Tokenizer.ts +14 -9
  1565. package/src/unstable/ai/Tool.ts +168 -97
  1566. package/src/unstable/ai/Toolkit.ts +51 -46
  1567. package/src/unstable/ai/index.ts +121 -29
  1568. package/src/unstable/cli/Argument.ts +226 -134
  1569. package/src/unstable/cli/CliError.ts +96 -26
  1570. package/src/unstable/cli/CliOutput.ts +48 -19
  1571. package/src/unstable/cli/Command.ts +196 -115
  1572. package/src/unstable/cli/Completions.ts +7 -7
  1573. package/src/unstable/cli/Flag.ts +235 -142
  1574. package/src/unstable/cli/GlobalFlag.ts +41 -13
  1575. package/src/unstable/cli/HelpDoc.ts +39 -14
  1576. package/src/unstable/cli/Param.ts +395 -260
  1577. package/src/unstable/cli/Primitive.ts +79 -42
  1578. package/src/unstable/cli/Prompt.ts +207 -59
  1579. package/src/unstable/cli/index.ts +205 -6
  1580. package/src/unstable/cli/internal/ansi.ts +13 -0
  1581. package/src/unstable/cli/internal/command.ts +5 -1
  1582. package/src/unstable/cli/internal/config.ts +3 -0
  1583. package/src/unstable/cli/internal/lexer.ts +11 -0
  1584. package/src/unstable/cli/internal/parser.ts +0 -1
  1585. package/src/unstable/cluster/ClusterCron.ts +35 -1
  1586. package/src/unstable/cluster/ClusterError.ts +56 -7
  1587. package/src/unstable/cluster/ClusterMetrics.ts +39 -5
  1588. package/src/unstable/cluster/ClusterSchema.ts +61 -8
  1589. package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -2
  1590. package/src/unstable/cluster/DeliverAt.ts +39 -4
  1591. package/src/unstable/cluster/Entity.ts +106 -16
  1592. package/src/unstable/cluster/EntityAddress.ts +30 -2
  1593. package/src/unstable/cluster/EntityId.ts +18 -3
  1594. package/src/unstable/cluster/EntityProxy.ts +42 -14
  1595. package/src/unstable/cluster/EntityProxyServer.ts +45 -8
  1596. package/src/unstable/cluster/EntityResource.ts +43 -6
  1597. package/src/unstable/cluster/EntityType.ts +27 -3
  1598. package/src/unstable/cluster/Envelope.ts +128 -23
  1599. package/src/unstable/cluster/HttpRunner.ts +88 -13
  1600. package/src/unstable/cluster/K8sHttpClient.ts +49 -6
  1601. package/src/unstable/cluster/MachineId.ts +24 -3
  1602. package/src/unstable/cluster/Message.ts +102 -13
  1603. package/src/unstable/cluster/MessageStorage.ts +126 -21
  1604. package/src/unstable/cluster/Reply.ts +101 -12
  1605. package/src/unstable/cluster/Runner.ts +47 -17
  1606. package/src/unstable/cluster/RunnerAddress.ts +34 -2
  1607. package/src/unstable/cluster/RunnerHealth.ts +40 -12
  1608. package/src/unstable/cluster/RunnerServer.ts +31 -4
  1609. package/src/unstable/cluster/RunnerStorage.ts +42 -5
  1610. package/src/unstable/cluster/Runners.ts +76 -13
  1611. package/src/unstable/cluster/ShardId.ts +53 -5
  1612. package/src/unstable/cluster/Sharding.ts +35 -4
  1613. package/src/unstable/cluster/ShardingConfig.ts +75 -10
  1614. package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
  1615. package/src/unstable/cluster/SingleRunner.ts +23 -1
  1616. package/src/unstable/cluster/Singleton.ts +15 -1
  1617. package/src/unstable/cluster/SingletonAddress.ts +21 -1
  1618. package/src/unstable/cluster/Snowflake.ts +90 -19
  1619. package/src/unstable/cluster/SocketRunner.ts +29 -2
  1620. package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
  1621. package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
  1622. package/src/unstable/cluster/TestRunner.ts +18 -1
  1623. package/src/unstable/cluster/index.ts +790 -0
  1624. package/src/unstable/cluster/internal/hash.ts +12 -0
  1625. package/src/unstable/devtools/DevTools.ts +26 -3
  1626. package/src/unstable/devtools/DevToolsClient.ts +32 -5
  1627. package/src/unstable/devtools/DevToolsSchema.ts +201 -44
  1628. package/src/unstable/devtools/DevToolsServer.ts +27 -2
  1629. package/src/unstable/devtools/index.ts +58 -0
  1630. package/src/unstable/encoding/Msgpack.ts +97 -12
  1631. package/src/unstable/encoding/Ndjson.ts +149 -21
  1632. package/src/unstable/encoding/Sse.ts +109 -18
  1633. package/src/unstable/encoding/index.ts +49 -0
  1634. package/src/unstable/eventlog/Event.ts +131 -30
  1635. package/src/unstable/eventlog/EventGroup.ts +50 -17
  1636. package/src/unstable/eventlog/EventJournal.ts +120 -20
  1637. package/src/unstable/eventlog/EventLog.ts +150 -31
  1638. package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
  1639. package/src/unstable/eventlog/EventLogMessage.ts +92 -18
  1640. package/src/unstable/eventlog/EventLogRemote.ts +54 -8
  1641. package/src/unstable/eventlog/EventLogServer.ts +33 -3
  1642. package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
  1643. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
  1644. package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
  1645. package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
  1646. package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
  1647. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
  1648. package/src/unstable/eventlog/index.ts +240 -0
  1649. package/src/unstable/http/Cookies.ts +156 -77
  1650. package/src/unstable/http/Etag.ts +40 -7
  1651. package/src/unstable/http/FetchHttpClient.ts +33 -4
  1652. package/src/unstable/http/FindMyWay.ts +1 -1
  1653. package/src/unstable/http/Headers.ts +252 -50
  1654. package/src/unstable/http/HttpBody.ts +128 -26
  1655. package/src/unstable/http/HttpClient.ts +204 -96
  1656. package/src/unstable/http/HttpClientError.ts +80 -12
  1657. package/src/unstable/http/HttpClientRequest.ts +318 -100
  1658. package/src/unstable/http/HttpClientResponse.ts +59 -16
  1659. package/src/unstable/http/HttpEffect.ts +66 -18
  1660. package/src/unstable/http/HttpIncomingMessage.ts +48 -7
  1661. package/src/unstable/http/HttpMethod.ts +38 -6
  1662. package/src/unstable/http/HttpMiddleware.ts +60 -11
  1663. package/src/unstable/http/HttpPlatform.ts +34 -3
  1664. package/src/unstable/http/HttpRouter.ts +232 -69
  1665. package/src/unstable/http/HttpServer.ts +151 -22
  1666. package/src/unstable/http/HttpServerError.ts +93 -10
  1667. package/src/unstable/http/HttpServerRequest.ts +125 -21
  1668. package/src/unstable/http/HttpServerRespondable.ts +49 -6
  1669. package/src/unstable/http/HttpServerResponse.ts +391 -67
  1670. package/src/unstable/http/HttpStaticServer.ts +24 -8
  1671. package/src/unstable/http/HttpTraceContext.ts +53 -6
  1672. package/src/unstable/http/Multipart.ts +179 -28
  1673. package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
  1674. package/src/unstable/http/Multipasta/Node.ts +1 -1
  1675. package/src/unstable/http/Multipasta/Search.ts +1 -1
  1676. package/src/unstable/http/Multipasta/Web.ts +1 -1
  1677. package/src/unstable/http/Multipasta.ts +1 -1
  1678. package/src/unstable/http/Template.ts +53 -1
  1679. package/src/unstable/http/Url.ts +70 -56
  1680. package/src/unstable/http/UrlParams.ts +237 -51
  1681. package/src/unstable/http/index.ts +452 -0
  1682. package/src/unstable/httpapi/HttpApi.ts +49 -14
  1683. package/src/unstable/httpapi/HttpApiBuilder.ts +81 -16
  1684. package/src/unstable/httpapi/HttpApiClient.ts +78 -15
  1685. package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
  1686. package/src/unstable/httpapi/HttpApiError.ts +100 -1
  1687. package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
  1688. package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -22
  1689. package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
  1690. package/src/unstable/httpapi/HttpApiSchema.ts +86 -38
  1691. package/src/unstable/httpapi/HttpApiSecurity.ts +73 -17
  1692. package/src/unstable/httpapi/HttpApiSwagger.ts +23 -3
  1693. package/src/unstable/httpapi/HttpApiTest.ts +26 -1
  1694. package/src/unstable/httpapi/OpenApi.ts +115 -15
  1695. package/src/unstable/httpapi/index.ts +310 -25
  1696. package/src/unstable/observability/Otlp.ts +33 -3
  1697. package/src/unstable/observability/OtlpExporter.ts +32 -1
  1698. package/src/unstable/observability/OtlpLogger.ts +32 -2
  1699. package/src/unstable/observability/OtlpMetrics.ts +39 -5
  1700. package/src/unstable/observability/OtlpResource.ts +68 -12
  1701. package/src/unstable/observability/OtlpSerialization.ts +28 -3
  1702. package/src/unstable/observability/OtlpTracer.ts +41 -2
  1703. package/src/unstable/observability/PrometheusMetrics.ts +36 -16
  1704. package/src/unstable/observability/index.ts +160 -3
  1705. package/src/unstable/persistence/KeyValueStore.ts +108 -28
  1706. package/src/unstable/persistence/Persistable.ts +76 -15
  1707. package/src/unstable/persistence/PersistedCache.ts +27 -2
  1708. package/src/unstable/persistence/PersistedQueue.ts +98 -16
  1709. package/src/unstable/persistence/Persistence.ts +98 -16
  1710. package/src/unstable/persistence/RateLimiter.ts +101 -21
  1711. package/src/unstable/persistence/Redis.ts +42 -5
  1712. package/src/unstable/persistence/index.ts +147 -0
  1713. package/src/unstable/process/ChildProcess.ts +90 -66
  1714. package/src/unstable/process/ChildProcessSpawner.ts +23 -12
  1715. package/src/unstable/process/index.ts +2 -1
  1716. package/src/unstable/reactivity/AsyncResult.ts +204 -61
  1717. package/src/unstable/reactivity/Atom.ts +598 -139
  1718. package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
  1719. package/src/unstable/reactivity/AtomRef.ts +51 -7
  1720. package/src/unstable/reactivity/AtomRegistry.ts +141 -22
  1721. package/src/unstable/reactivity/AtomRpc.ts +36 -2
  1722. package/src/unstable/reactivity/Hydration.ts +45 -5
  1723. package/src/unstable/reactivity/Reactivity.ts +94 -13
  1724. package/src/unstable/reactivity/index.ts +167 -0
  1725. package/src/unstable/rpc/Rpc.ts +254 -56
  1726. package/src/unstable/rpc/RpcClient.ts +106 -19
  1727. package/src/unstable/rpc/RpcClientError.ts +26 -2
  1728. package/src/unstable/rpc/RpcGroup.ts +51 -8
  1729. package/src/unstable/rpc/RpcMessage.ts +128 -32
  1730. package/src/unstable/rpc/RpcMiddleware.ts +100 -20
  1731. package/src/unstable/rpc/RpcSchema.ts +38 -4
  1732. package/src/unstable/rpc/RpcSerialization.ts +60 -13
  1733. package/src/unstable/rpc/RpcServer.ts +107 -23
  1734. package/src/unstable/rpc/RpcTest.ts +20 -1
  1735. package/src/unstable/rpc/RpcWorker.ts +39 -6
  1736. package/src/unstable/rpc/Utils.ts +33 -0
  1737. package/src/unstable/rpc/index.ts +272 -0
  1738. package/src/unstable/schema/Model.ts +245 -61
  1739. package/src/unstable/schema/VariantSchema.ts +101 -24
  1740. package/src/unstable/schema/index.ts +37 -0
  1741. package/src/unstable/socket/Socket.ts +168 -34
  1742. package/src/unstable/socket/SocketServer.ts +58 -10
  1743. package/src/unstable/socket/index.ts +44 -0
  1744. package/src/unstable/sql/Migrator.ts +61 -9
  1745. package/src/unstable/sql/SqlClient.ts +59 -2
  1746. package/src/unstable/sql/SqlConnection.ts +34 -3
  1747. package/src/unstable/sql/SqlError.ts +135 -0
  1748. package/src/unstable/sql/SqlModel.ts +25 -5
  1749. package/src/unstable/sql/SqlResolver.ts +56 -13
  1750. package/src/unstable/sql/SqlSchema.ts +29 -8
  1751. package/src/unstable/sql/SqlStream.ts +24 -0
  1752. package/src/unstable/sql/Statement.ts +168 -24
  1753. package/src/unstable/sql/index.ts +179 -1
  1754. package/src/unstable/workers/Transferable.ts +72 -20
  1755. package/src/unstable/workers/Worker.ts +61 -8
  1756. package/src/unstable/workers/WorkerError.ts +50 -9
  1757. package/src/unstable/workers/WorkerRunner.ts +32 -3
  1758. package/src/unstable/workers/index.ts +81 -1
  1759. package/src/unstable/workflow/Activity.ts +61 -10
  1760. package/src/unstable/workflow/DurableClock.ts +26 -3
  1761. package/src/unstable/workflow/DurableDeferred.ts +148 -31
  1762. package/src/unstable/workflow/DurableQueue.ts +33 -8
  1763. package/src/unstable/workflow/Workflow.ts +123 -31
  1764. package/src/unstable/workflow/WorkflowEngine.ts +40 -5
  1765. package/src/unstable/workflow/WorkflowProxy.ts +40 -12
  1766. package/src/unstable/workflow/WorkflowProxyServer.ts +41 -6
  1767. package/src/unstable/workflow/index.ts +160 -0
package/src/index.ts CHANGED
@@ -161,6 +161,41 @@ export * as Boolean from "./Boolean.ts"
161
161
  export * as Brand from "./Brand.ts"
162
162
 
163
163
  /**
164
+ * The `Cache` module provides an effectful, mutable key-value cache for values
165
+ * that are computed by a lookup function. A `Cache<Key, A, E, R>` stores lookup
166
+ * results for keys, shares concurrent lookups for the same key, and manages
167
+ * entry lifetime with capacity limits and optional time-to-live policies.
168
+ *
169
+ * **Mental model**
170
+ *
171
+ * - A cache is created from a lookup function and a maximum capacity
172
+ * - {@link get} returns a cached value when present, or runs the lookup on a miss
173
+ * - Concurrent misses for the same key share one pending lookup
174
+ * - Lookup failures are cached as failures until the entry expires, is invalidated, or is refreshed
175
+ * - Entries can live forever, expire after a fixed duration, or use a dynamic TTL based on the lookup `Exit`
176
+ * - Capacity is enforced by removing the oldest stored entries when new entries are added
177
+ *
178
+ * **Common tasks**
179
+ *
180
+ * - Create a cache: {@link make}, {@link makeWith}
181
+ * - Read values: {@link get}, {@link getOption}, {@link getSuccess}
182
+ * - Seed or overwrite values: {@link set}
183
+ * - Refresh values: {@link refresh}
184
+ * - Remove entries: {@link invalidate}, {@link invalidateWhen}, {@link invalidateAll}
185
+ * - Inspect contents: {@link has}, {@link size}, {@link keys}, {@link values}, {@link entries}
186
+ *
187
+ * **Gotchas**
188
+ *
189
+ * - {@link getOption} does not run the lookup; it only reads an existing non-expired entry
190
+ * - {@link size} may include expired entries until they are observed and removed
191
+ * - {@link values} and {@link entries} include only successfully resolved entries
192
+ * - Use `Data` or another `Equal`-compatible key type when keys need structural equality
193
+ *
194
+ * **See also**
195
+ *
196
+ * - {@link Duration} for configuring fixed or dynamic time-to-live values
197
+ * - {@link Effect} for the lookup effects used to compute cached values
198
+ *
164
199
  * @since 4.0.0
165
200
  */
166
201
  export * as Cache from "./Cache.ts"
@@ -276,7 +311,8 @@ export * as Cause from "./Cause.ts"
276
311
  * 2. **Sequencing**: Use the result of one channel to create another
277
312
  * 3. **Concatenating**: Combine multiple channels into a single channel
278
313
  *
279
- * @example
314
+ * **Example** (Creating a simple channel)
315
+ *
280
316
  * ```ts
281
317
  * import { Channel } from "effect"
282
318
  *
@@ -289,7 +325,8 @@ export * as Cause from "./Cause.ts"
289
325
  * // Running the channel would output: 84
290
326
  * ```
291
327
  *
292
- * @example
328
+ * **Example** (Transforming array-backed channels)
329
+ *
293
330
  * ```ts
294
331
  * import { Channel } from "effect"
295
332
  *
@@ -307,6 +344,48 @@ export * as Cause from "./Cause.ts"
307
344
  export * as Channel from "./Channel.ts"
308
345
 
309
346
  /**
347
+ * The `ChannelSchema` module provides helpers for applying `Schema` encoding
348
+ * and decoding at `Channel` boundaries. It is useful when a channel should
349
+ * expose typed values to application code while communicating with an upstream
350
+ * or downstream component through an encoded representation such as JSON-ready
351
+ * data, wire protocol values, or any other schema-defined format.
352
+ *
353
+ * **Mental model**
354
+ *
355
+ * - A channel schema adapter is a streaming boundary: chunks flow through a
356
+ * `Channel`, and each non-empty chunk is validated and transformed with a
357
+ * `Schema`
358
+ * - `encode` turns typed schema values into their encoded representation before
359
+ * they leave a typed part of a pipeline
360
+ * - `decode` turns encoded input into typed schema values before application
361
+ * code consumes them
362
+ * - `duplex` wraps a bidirectional channel so callers work with typed input and
363
+ * output while the wrapped channel continues to operate on encoded chunks
364
+ * - Schema failures are surfaced through the channel error type as
365
+ * `SchemaError`, and schema services are reflected in the channel
366
+ * requirements
367
+ *
368
+ * **Common tasks**
369
+ *
370
+ * - Encode typed channel input before sending it to an encoded transport:
371
+ * {@link encode}
372
+ * - Decode encoded channel output before handling it as domain data:
373
+ * {@link decode}
374
+ * - Use unknown encoded boundaries when static encoded types are intentionally
375
+ * erased: {@link encodeUnknown} and {@link decodeUnknown}
376
+ * - Wrap a bidirectional encoded channel with typed input and output schemas:
377
+ * {@link duplex} or {@link duplexUnknown}
378
+ *
379
+ * **Gotchas**
380
+ *
381
+ * - These helpers operate on `NonEmptyReadonlyArray` chunks, so schemas are
382
+ * applied to non-empty batches rather than individual scalar values
383
+ * - Encoding and decoding can require services from the schema; those
384
+ * requirements become part of the resulting channel type
385
+ * - `duplex` encodes values flowing into the wrapped channel and decodes values
386
+ * emitted by it, so choose `inputSchema` and `outputSchema` from the
387
+ * perspective of the typed caller
388
+ *
310
389
  * @since 4.0.0
311
390
  */
312
391
  export * as ChannelSchema from "./ChannelSchema.ts"
@@ -341,7 +420,8 @@ export * as ChannelSchema from "./ChannelSchema.ts"
341
420
  * - **Iteration**: O(n)
342
421
  * - **Memory**: Structural sharing minimizes allocation
343
422
  *
344
- * @example
423
+ * **Example** (Creating and combining chunks)
424
+ *
345
425
  * ```ts
346
426
  * import { Chunk } from "effect"
347
427
  *
@@ -355,7 +435,8 @@ export * as ChannelSchema from "./ChannelSchema.ts"
355
435
  * console.log(Chunk.toReadonlyArray(combined)) // [1, 2, 3, 4, 5, 6]
356
436
  * ```
357
437
  *
358
- * @example
438
+ * **Example** (Transforming chunks)
439
+ *
359
440
  * ```ts
360
441
  * import { Chunk } from "effect"
361
442
  *
@@ -366,17 +447,17 @@ export * as ChannelSchema from "./ChannelSchema.ts"
366
447
  * const sum = Chunk.reduce(evens, 0, (acc, n) => acc + n) // 12
367
448
  * ```
368
449
  *
369
- * @example
450
+ * **Example** (Processing chunks with Effect)
451
+ *
370
452
  * ```ts
371
453
  * import { Chunk, Effect } from "effect"
372
454
  *
373
455
  * // Working with Effects
374
- * const processChunk = (chunk: Chunk.Chunk<number>) =>
375
- * Effect.gen(function*() {
376
- * const mapped = Chunk.map(chunk, (n) => n * 2)
377
- * const filtered = Chunk.filter(mapped, (n) => n > 5)
378
- * return Chunk.toReadonlyArray(filtered)
379
- * })
456
+ * const processChunk = Effect.fnUntraced(function*(chunk: Chunk.Chunk<number>) {
457
+ * const mapped = Chunk.map(chunk, (n) => n * 2)
458
+ * const filtered = Chunk.filter(mapped, (n) => n > 5)
459
+ * return Chunk.toReadonlyArray(filtered)
460
+ * })
380
461
  * ```
381
462
  *
382
463
  * @since 2.0.0
@@ -402,7 +483,8 @@ export * as Chunk from "./Chunk.ts"
402
483
  * - **Testable**: Mock time control for deterministic testing
403
484
  * - **Resource-safe**: Automatic cleanup of time-based resources
404
485
  *
405
- * @example
486
+ * **Example** (Measuring elapsed time)
487
+ *
406
488
  * ```ts
407
489
  * import { Clock, Effect } from "effect"
408
490
  *
@@ -421,7 +503,8 @@ export * as Chunk from "./Chunk.ts"
421
503
  * })
422
504
  * ```
423
505
  *
424
- * @example
506
+ * **Example** (Using the Clock service)
507
+ *
425
508
  * ```ts
426
509
  * import { Clock, Effect } from "effect"
427
510
  *
@@ -686,7 +769,8 @@ export * as ConfigProvider from "./ConfigProvider.ts"
686
769
  * - **Data display**: `table`, `dir`, `dirxml` for structured data visualization
687
770
  * - **Utilities**: `clear`, `count`, `countReset`, `trace`
688
771
  *
689
- * @example
772
+ * **Example** (Logging basic messages)
773
+ *
690
774
  * ```ts
691
775
  * import { Console, Effect } from "effect"
692
776
  *
@@ -699,7 +783,8 @@ export * as ConfigProvider from "./ConfigProvider.ts"
699
783
  * })
700
784
  * ```
701
785
  *
702
- * @example
786
+ * **Example** (Grouping timed logs)
787
+ *
703
788
  * ```ts
704
789
  * import { Console, Effect } from "effect"
705
790
  *
@@ -716,7 +801,8 @@ export * as ConfigProvider from "./ConfigProvider.ts"
716
801
  * )
717
802
  * ```
718
803
  *
719
- * @example
804
+ * **Example** (Displaying structured data)
805
+ *
720
806
  * ```ts
721
807
  * import { Console, Effect } from "effect"
722
808
  *
@@ -752,10 +838,107 @@ export * as Console from "./Console.ts"
752
838
  export * as Context from "./Context.ts"
753
839
 
754
840
  /**
841
+ * The `Cron` module provides utilities for representing recurring calendar
842
+ * schedules with cron expressions. A `Cron` value stores allowed seconds,
843
+ * minutes, hours, days of month, months, weekdays, and an optional time zone,
844
+ * then uses those constraints to test dates and find scheduled occurrences.
845
+ *
846
+ * **Mental model**
847
+ *
848
+ * - A cron schedule is a set of allowed values for each time field
849
+ * - Expressions may use five fields (`minute hour day month weekday`) or six
850
+ * fields (`second minute hour day month weekday`); five-field expressions
851
+ * default seconds to `0`
852
+ * - Each field supports `*`, comma-separated values, ranges, and step syntax
853
+ * - Month and weekday fields support aliases such as `JAN`, `DEC`, `SUN`, and
854
+ * `MON`
855
+ * - Empty internal field sets represent an unconstrained field, the same idea
856
+ * as `*`
857
+ * - When both day-of-month and weekday are constrained, matching uses cron's
858
+ * inclusive behavior: either field may match
859
+ *
860
+ * **Common tasks**
861
+ *
862
+ * - Build directly from field constraints: {@link make}
863
+ * - Parse expressions safely: {@link parse}
864
+ * - Parse expressions and throw on invalid input: {@link parseUnsafe}
865
+ * - Check whether a date satisfies a schedule: {@link match}
866
+ * - Find adjacent scheduled dates: {@link next}, {@link prev}
867
+ * - Iterate future scheduled dates: {@link sequence}
868
+ * - Compare schedule constraints: {@link equals}, {@link Equivalence}
869
+ * - Detect parse failures: {@link CronParseError}, {@link isCronParseError}
870
+ *
871
+ * **Gotchas**
872
+ *
873
+ * - Weekdays are numbered `0` through `6`, with `0` representing Sunday
874
+ * - Months are numbered `1` through `12`, while JavaScript `Date` months are
875
+ * zero-based
876
+ * - `*` normalizes to an empty set internally, so inspect schedules with the
877
+ * public helpers instead of assuming every allowed value is stored
878
+ * - `next` and `prev` search strictly after or before the provided instant
879
+ * - Time-zone-aware schedules account for daylight saving transitions; during
880
+ * a fall-back transition, repeated local times are emitted once when moving
881
+ * forward
882
+ *
755
883
  * @since 2.0.0
756
884
  */
757
885
  export * as Cron from "./Cron.ts"
758
886
 
887
+ /**
888
+ * The `Crypto` module provides a platform-agnostic service for cryptographic
889
+ * operations. Runtime packages such as `@effect/platform-node`,
890
+ * `@effect/platform-bun`, and `@effect/platform-browser` provide concrete
891
+ * implementations backed by the host platform's cryptography APIs.
892
+ *
893
+ * Use `Crypto` for cryptographic randomness, UUID generation, random values,
894
+ * and message digests. The base `Random` service is not cryptographically
895
+ * secure unless you replace it with a cryptographically secure implementation.
896
+ *
897
+ * @example
898
+ * ```ts
899
+ * import { Console, Crypto, Effect, Layer } from "effect"
900
+ *
901
+ * const TestCrypto = Layer.succeed(
902
+ * Crypto.Crypto,
903
+ * Crypto.make({
904
+ * randomBytes: (size) => new Uint8Array(size),
905
+ * digest: (_algorithm, data) => Effect.succeed(data)
906
+ * })
907
+ * )
908
+ *
909
+ * const program = Effect.gen(function*() {
910
+ * const crypto = yield* Crypto.Crypto
911
+ * const id = yield* crypto.randomUUIDv4
912
+ * yield* Console.log(`Created id: ${id}`)
913
+ * })
914
+ *
915
+ * Effect.runPromise(Effect.provide(program, TestCrypto))
916
+ * ```
917
+ *
918
+ * @example
919
+ * ```ts
920
+ * import { Crypto, Effect, Layer } from "effect"
921
+ *
922
+ * const TestCrypto = Layer.succeed(
923
+ * Crypto.Crypto,
924
+ * Crypto.make({
925
+ * randomBytes: (size) => new Uint8Array(size),
926
+ * digest: (_algorithm, data) => Effect.succeed(data)
927
+ * })
928
+ * )
929
+ *
930
+ * const program = Effect.gen(function*() {
931
+ * const crypto = yield* Crypto.Crypto
932
+ * return yield* crypto.randomBytes(32)
933
+ * })
934
+ *
935
+ * Effect.runPromise(Effect.provide(program, TestCrypto))
936
+ * ```
937
+ *
938
+ * @since 4.0.0
939
+ */
940
+ export * as Crypto from "./Crypto.ts"
941
+
759
942
  /**
760
943
  * Immutable data constructors with discriminated-union support.
761
944
  *
@@ -832,6 +1015,55 @@ export * as Cron from "./Cron.ts"
832
1015
  export * as Data from "./Data.ts"
833
1016
 
834
1017
  /**
1018
+ * The `DateTime` module provides immutable data types and utilities for working
1019
+ * with instants, UTC date-times, zoned date-times, and time zones. A
1020
+ * `DateTime` is always an absolute point in time, represented internally by
1021
+ * epoch milliseconds, and may also carry a `TimeZone` for zone-aware calendar
1022
+ * parts and formatting.
1023
+ *
1024
+ * **Mental model**
1025
+ *
1026
+ * - `DateTime` is a discriminated union: `Utc | Zoned`
1027
+ * - `Utc` stores an absolute instant without an associated time zone
1028
+ * - `Zoned` stores the same kind of absolute instant plus a `TimeZone`
1029
+ * - Time zones can be fixed offsets or named IANA zones such as `"Europe/Rome"`
1030
+ * - Comparison and ordering use the instant, so two values in different zones
1031
+ * can still be equivalent
1032
+ * - Calendar parts and formatted output depend on whether you ask for UTC parts
1033
+ * or zone-adjusted parts
1034
+ *
1035
+ * **Common tasks**
1036
+ *
1037
+ * - Construct values: {@link make}, {@link makeUnsafe}, {@link makeZoned}, {@link makeZonedUnsafe}
1038
+ * - Get the current instant: {@link now}, {@link nowInCurrentZone}
1039
+ * - Create time zones: {@link zoneMakeOffset}, {@link zoneMakeNamed}, {@link zoneFromString}
1040
+ * - Attach or change zones: {@link setZone}, {@link setZoneNamed}, {@link setZoneCurrent}, {@link toUtc}
1041
+ * - Convert to platform values or parts: {@link toDate}, {@link toDateUtc}, {@link toEpochMillis}, {@link toParts}, {@link toPartsUtc}
1042
+ * - Compare and bound values: {@link Equivalence}, {@link Order}, {@link distance}, {@link min}, {@link max}, {@link clamp}, {@link between}
1043
+ * - Transform values: {@link add}, {@link subtract}, {@link startOf}, {@link endOf}, {@link nearest}, {@link setParts}, {@link mutate}
1044
+ * - Format values: {@link format}, {@link formatUtc}, {@link formatLocal}, {@link formatIntl}, {@link formatIso}, {@link formatIsoZoned}
1045
+ * - Provide an application time zone: {@link CurrentTimeZone}, {@link withCurrentZone}, {@link layerCurrentZone}
1046
+ *
1047
+ * **Gotchas**
1048
+ *
1049
+ * - `make` and `makeZoned` return `Option`; unsafe constructors throw on invalid
1050
+ * input
1051
+ * - `DateTime` equality is instant-based, not display-time-based
1052
+ * - `setZone` changes the zone used for local parts and formatting without
1053
+ * changing the represented instant
1054
+ * - Use `adjustForTimeZone` with {@link makeZoned} when input parts should be
1055
+ * interpreted as wall-clock time in the target zone
1056
+ * - Daylight-saving gaps and repeated local times are resolved with
1057
+ * `Disambiguation`
1058
+ * - Prefer the Clock-backed {@link now} and `CurrentTimeZone` services in
1059
+ * Effect workflows; unsafe helpers read from the host environment directly
1060
+ *
1061
+ * **See also**
1062
+ *
1063
+ * - {@link DateTime} for the UTC/zoned data model
1064
+ * - {@link TimeZone} for offset and named time-zone values
1065
+ * - {@link Disambiguation} for daylight-saving ambiguity handling
1066
+ *
835
1067
  * @since 3.6.0
836
1068
  */
837
1069
  export * as DateTime from "./DateTime.ts"
@@ -853,7 +1085,8 @@ export * as DateTime from "./DateTime.ts"
853
1085
  * - **Fiber-safe**: Thread-safe operations across concurrent fibers
854
1086
  * - **Composable**: Works seamlessly with other Effect operations
855
1087
  *
856
- * @example
1088
+ * **Example** (Coordinating fibers with a Deferred)
1089
+ *
857
1090
  * ```ts
858
1091
  * import { Deferred, Effect, Fiber } from "effect"
859
1092
  *
@@ -907,6 +1140,42 @@ export * as DateTime from "./DateTime.ts"
907
1140
  export * as Deferred from "./Deferred.ts"
908
1141
 
909
1142
  /**
1143
+ * The `Differ` module defines the core abstraction for describing changes to a
1144
+ * value. A `Differ<T, Patch>` knows how to compare two `T` values, produce a
1145
+ * patch that represents the difference, combine multiple patches, and apply a
1146
+ * patch to an old value to obtain the updated value.
1147
+ *
1148
+ * **Mental model**
1149
+ *
1150
+ * - A differ separates "what changed" from "the value after the change"
1151
+ * - `diff(oldValue, newValue)` produces a `Patch` that can later be applied
1152
+ * - `patch(oldValue, patch)` replays a patch against a value of the same domain
1153
+ * - `empty` is the identity patch: applying it should leave the value unchanged
1154
+ * - `combine(first, second)` composes patches in sequence, where `second`
1155
+ * represents changes that happen after `first`
1156
+ * - Patch types are chosen by the differ implementation and may be compact,
1157
+ * domain-specific, or compatible with a serialization format such as JSON
1158
+ * Patch
1159
+ *
1160
+ * **Common tasks**
1161
+ *
1162
+ * - Construct a differ by providing the four operations of the {@link Differ}
1163
+ * interface
1164
+ * - Compute a patch with `diff` when you have an old value and a new value
1165
+ * - Store, transmit, or aggregate patches instead of storing full replacement
1166
+ * values
1167
+ * - Combine incremental updates with `combine` before applying them
1168
+ * - Apply updates with `patch` to reconstruct the next value from a previous
1169
+ * value and a patch
1170
+ *
1171
+ * **Gotchas**
1172
+ *
1173
+ * - `combine` is order-sensitive for most patch formats
1174
+ * - A patch is generally meaningful only for values that belong to the same
1175
+ * domain and assumptions used by the differ that created it
1176
+ * - Differs should make `empty` a true identity and should make combined
1177
+ * patches behave the same as applying the original patches in order
1178
+ *
910
1179
  * @since 4.0.0
911
1180
  */
912
1181
  export * as Differ from "./Differ.ts"
@@ -950,7 +1219,8 @@ export * as Duration from "./Duration.ts"
950
1219
  * - **Testable**: Built-in support for testing with controlled environments
951
1220
  * - **Interruptible**: Effects can be safely interrupted and cancelled
952
1221
  *
953
- * @example
1222
+ * **Example** (Usage)
1223
+ *
954
1224
  * ```ts
955
1225
  * import { Console, Effect } from "effect"
956
1226
  *
@@ -968,7 +1238,8 @@ export * as Duration from "./Duration.ts"
968
1238
  * Effect.runPromise(program).then(console.log) // 13
969
1239
  * ```
970
1240
  *
971
- * @example
1241
+ * **Example** (Usage)
1242
+ *
972
1243
  * ```ts
973
1244
  * import { Data, Effect } from "effect"
974
1245
  *
@@ -1001,6 +1272,41 @@ export * as Duration from "./Duration.ts"
1001
1272
  export * as Effect from "./Effect.ts"
1002
1273
 
1003
1274
  /**
1275
+ * The `Effectable` module provides low-level building blocks for defining
1276
+ * custom values that behave like `Effect`s. It is primarily used by library
1277
+ * authors who need domain-specific effect-like data types, such as service
1278
+ * keys, configuration descriptions, prompts, or other declarative programs
1279
+ * that can be yielded inside `Effect.gen`.
1280
+ *
1281
+ * **Mental model**
1282
+ *
1283
+ * - `Effectable` does not run effects by itself; it provides prototypes that
1284
+ * implement the internal Effect protocol.
1285
+ * - {@link Prototype} creates a primitive Effect prototype with a custom
1286
+ * evaluation function that receives the current `Fiber`.
1287
+ * - {@link Class} is an abstract base class for defining custom classes whose
1288
+ * instances are also `Effect` values.
1289
+ * - The success, error, and service requirements of the custom type are
1290
+ * preserved through the `Effect.Effect<A, E, R>` type parameters.
1291
+ *
1292
+ * **Common tasks**
1293
+ *
1294
+ * - Build an effect-like interface around a declarative data structure.
1295
+ * - Implement a custom `evaluate` hook that interprets the value in terms of
1296
+ * the current fiber and returns the underlying `Effect`.
1297
+ * - Extend {@link Class} when a nominal class-based API is more convenient
1298
+ * than manually wiring a prototype.
1299
+ *
1300
+ * **Gotchas**
1301
+ *
1302
+ * - This module is intentionally low-level; most application code should use
1303
+ * `Effect` constructors and combinators instead.
1304
+ * - `evaluate` must return an `Effect` with the same success, error, and
1305
+ * service types as the custom value.
1306
+ * - Because these APIs participate in the internal Effect protocol, keep
1307
+ * implementations small and follow existing modules such as `Config` and
1308
+ * `Context` when adding new effect-like types.
1309
+ *
1004
1310
  * @since 4.0.0
1005
1311
  */
1006
1312
  export * as Effectable from "./Effectable.ts"
@@ -1155,7 +1461,8 @@ export * as Equivalence from "./Equivalence.ts"
1155
1461
  * Use the annotation symbols (`ignore`, `severity`, `attributes`) on your
1156
1462
  * error classes to control reporting behavior per-error.
1157
1463
  *
1158
- * @example
1464
+ * **Example** (Reporting errors with annotations)
1465
+ *
1159
1466
  * ```ts
1160
1467
  * import { Data, Effect, ErrorReporter } from "effect"
1161
1468
  *
@@ -1193,6 +1500,43 @@ export * as Equivalence from "./Equivalence.ts"
1193
1500
  export * as ErrorReporter from "./ErrorReporter.ts"
1194
1501
 
1195
1502
  /**
1503
+ * The `ExecutionPlan` module provides a way to describe ordered fallback
1504
+ * strategies for effects and streams that need different resources across
1505
+ * repeated attempts. An `ExecutionPlan` is a non-empty list of steps, where
1506
+ * each step supplies a `Context` or `Layer` and may control retries with an
1507
+ * attempt limit, a `Schedule`, or a `while` predicate.
1508
+ *
1509
+ * **Mental model**
1510
+ *
1511
+ * - A plan is evaluated step by step until the wrapped effect or stream
1512
+ * succeeds, or until every step has been exhausted
1513
+ * - Each step provides the services used while that step is active
1514
+ * - `attempts` limits how many times a step may be tried
1515
+ * - `schedule` controls retry timing and receives the failure input
1516
+ * - `while` can stop retrying a step based on the failure input
1517
+ * - `CurrentMetadata` exposes the current 1-based attempt and 0-based step
1518
+ * index to code running under a plan
1519
+ *
1520
+ * **Common tasks**
1521
+ *
1522
+ * - Build a plan with {@link make}
1523
+ * - Run an effect with a plan using `Effect.withExecutionPlan`
1524
+ * - Run a stream with a plan using `Stream.withExecutionPlan`
1525
+ * - Combine plans in order with {@link merge}
1526
+ * - Capture required services up front with `captureRequirements`
1527
+ * - Inspect the current attempt and step with {@link CurrentMetadata}
1528
+ *
1529
+ * **Gotchas**
1530
+ *
1531
+ * - Plans must contain at least one step
1532
+ * - `attempts` must be greater than zero when provided
1533
+ * - If `attempts` is omitted, a step is attempted once unless a `schedule` is
1534
+ * provided
1535
+ * - A `while` predicate returning `false` skips the remaining retries for that
1536
+ * step and moves the plan forward
1537
+ * - Layer, schedule, and predicate requirements are tracked in the plan type
1538
+ * until they are provided or captured
1539
+ *
1196
1540
  * @since 3.16.0
1197
1541
  */
1198
1542
  export * as ExecutionPlan from "./ExecutionPlan.ts"
@@ -1275,7 +1619,8 @@ export * as Exit from "./Exit.ts"
1275
1619
  * - **Supervision**: Monitor and restart failed fibers
1276
1620
  * - **Resource management**: Ensure proper cleanup on interruption
1277
1621
  *
1278
- * @example
1622
+ * **Example** (Running effects in fibers)
1623
+ *
1279
1624
  * ```ts
1280
1625
  * import { Console, Effect, Fiber } from "effect"
1281
1626
  *
@@ -1334,16 +1679,127 @@ export * as Exit from "./Exit.ts"
1334
1679
  export * as Fiber from "./Fiber.ts"
1335
1680
 
1336
1681
  /**
1682
+ * The `FiberHandle` module provides a scoped handle for managing the lifecycle
1683
+ * of at most one fiber at a time. A `FiberHandle<A, E>` can hold one
1684
+ * `Fiber<A, E>`; when a new fiber is installed, the previous fiber is
1685
+ * interrupted unless the operation is configured with `onlyIfMissing`.
1686
+ *
1687
+ * **Mental model**
1688
+ *
1689
+ * - A handle is either open with zero or one current fiber, or closed by its
1690
+ * surrounding `Scope`
1691
+ * - Closing the scope interrupts the current fiber and prevents new work from
1692
+ * being accepted
1693
+ * - Completed fibers remove themselves from the handle, so the handle can be
1694
+ * reused for later work
1695
+ * - Replacing a fiber uses the handle's internal interruption id, allowing
1696
+ * expected replacement interruptions to be distinguished from real failures
1697
+ *
1698
+ * **Common tasks**
1699
+ *
1700
+ * - Create a scoped handle: {@link make}
1701
+ * - Fork an effect into the handle: {@link run}
1702
+ * - Store an existing fiber: {@link set}
1703
+ * - Read or clear the current fiber: {@link get}, {@link clear}
1704
+ * - Capture runtime-specific runners: {@link makeRuntime}, {@link runtime}
1705
+ * - Run handled effects as Promises: {@link makeRuntimePromise},
1706
+ * {@link runtimePromise}
1707
+ * - Wait for failure or closure: {@link join}
1708
+ * - Wait until the current fiber is gone: {@link awaitEmpty}
1709
+ *
1710
+ * **Gotchas**
1711
+ *
1712
+ * - The handle never contains more than one live fiber; starting or setting
1713
+ * another fiber interrupts the previous one by default
1714
+ * - Use `onlyIfMissing` when a call should leave an already running fiber in
1715
+ * place instead of replacing it
1716
+ * - `join` observes the handle's failure/close signal; successful fiber
1717
+ * completion only empties the handle
1718
+ * - `awaitEmpty` waits for the fiber that is current when it starts; later
1719
+ * calls to {@link run} or {@link set} can install new work
1720
+ *
1337
1721
  * @since 2.0.0
1338
1722
  */
1339
1723
  export * as FiberHandle from "./FiberHandle.ts"
1340
1724
 
1341
1725
  /**
1726
+ * The `FiberMap` module provides a scoped, mutable collection for managing
1727
+ * fibers by key. A `FiberMap<K, A, E>` owns a set of running fibers, interrupts
1728
+ * them when its scope closes, and automatically removes each entry when the
1729
+ * corresponding fiber completes.
1730
+ *
1731
+ * **Mental model**
1732
+ *
1733
+ * - A `FiberMap` is a keyed registry of fibers with lifecycle management
1734
+ * - Keys identify the currently active fiber for a logical task or resource
1735
+ * - Adding a fiber under an existing key interrupts the previous fiber by default
1736
+ * - Completed fibers remove themselves from the map if they are still current
1737
+ * - Closing the map's scope interrupts every fiber that remains in the map
1738
+ * - The map can surface the first non-ignored managed fiber failure via {@link join}
1739
+ *
1740
+ * **Common tasks**
1741
+ *
1742
+ * - Create a scoped map: {@link make}
1743
+ * - Fork effects into the map: {@link run}
1744
+ * - Add existing fibers: {@link set}
1745
+ * - Create captured runners: {@link makeRuntime}, {@link runtime}
1746
+ * - Bridge to Promise-based callers: {@link makeRuntimePromise}, {@link runtimePromise}
1747
+ * - Inspect entries: {@link get}, {@link has}, {@link size}
1748
+ * - Stop work: {@link remove}, {@link clear}
1749
+ * - Coordinate completion or failure: {@link awaitEmpty}, {@link join}
1750
+ *
1751
+ * **Gotchas**
1752
+ *
1753
+ * - `FiberMap` is scoped; use it with `Effect.scoped` or another scope owner so
1754
+ * managed fibers are interrupted when the scope closes
1755
+ * - Reusing a key is a replacement operation unless `onlyIfMissing` is enabled
1756
+ * - `join` waits for the map to fail or close; use {@link awaitEmpty} to wait
1757
+ * until all currently managed fibers have completed
1758
+ * - The `Unsafe` variants mutate synchronously and should only be used when the
1759
+ * caller already controls the surrounding execution context
1760
+ *
1342
1761
  * @since 2.0.0
1343
1762
  */
1344
1763
  export * as FiberMap from "./FiberMap.ts"
1345
1764
 
1346
1765
  /**
1766
+ * The `FiberSet` module provides a scoped container for managing many fibers as
1767
+ * one lifecycle. A `FiberSet<A, E>` tracks fibers whose successful values are
1768
+ * compatible with `A` and whose failures are compatible with `E`, removes each
1769
+ * fiber when it completes, and interrupts all still-running fibers when the
1770
+ * owning `Scope` closes.
1771
+ *
1772
+ * **Mental model**
1773
+ *
1774
+ * - A `FiberSet` is an owned, scoped collection of fibers
1775
+ * - Fibers can be added directly with {@link add} / {@link addUnsafe}
1776
+ * - Effects can be forked into the set with {@link run}, {@link runtime}, or
1777
+ * {@link runtimePromise}
1778
+ * - Completed fibers are automatically removed from the set
1779
+ * - Closing the scope or calling {@link clear} interrupts the currently tracked
1780
+ * fibers
1781
+ * - {@link join} waits for the set's first non-ignored failure, while
1782
+ * {@link awaitEmpty} waits until all tracked fibers have completed
1783
+ *
1784
+ * **Common tasks**
1785
+ *
1786
+ * - Create a scoped set: {@link make}
1787
+ * - Create scoped runners: {@link makeRuntime}, {@link makeRuntimePromise}
1788
+ * - Add an existing fiber: {@link add}
1789
+ * - Fork an effect into the set: {@link run}
1790
+ * - Interrupt tracked fibers: {@link clear}
1791
+ * - Observe the set: {@link size}, {@link awaitEmpty}, {@link join}
1792
+ * - Check a value: {@link isFiberSet}
1793
+ *
1794
+ * **Gotchas**
1795
+ *
1796
+ * - `FiberSet` values are scoped; use them inside `Effect.scoped` or another
1797
+ * scope owner so their fibers are interrupted reliably
1798
+ * - Adding or running into a closed set interrupts the fiber immediately
1799
+ * - By default, interruptions are not treated as failures for {@link join};
1800
+ * use the `propagateInterruption` option when interruption should be
1801
+ * propagated
1802
+ *
1347
1803
  * @since 2.0.0
1348
1804
  */
1349
1805
  export * as FiberSet from "./FiberSet.ts"
@@ -1357,7 +1813,8 @@ export * as FiberSet from "./FiberSet.ts"
1357
1813
  * allowing you to work with files and directories in a functional, composable way. All operations
1358
1814
  * return `Effect` values that can be composed, transformed, and executed safely.
1359
1815
  *
1360
- * @example
1816
+ * **Example** (Working with files and directories)
1817
+ *
1361
1818
  * ```ts
1362
1819
  * import { Console, Effect, FileSystem } from "effect"
1363
1820
  *
@@ -1388,6 +1845,40 @@ export * as FiberSet from "./FiberSet.ts"
1388
1845
  export * as FileSystem from "./FileSystem.ts"
1389
1846
 
1390
1847
  /**
1848
+ * The `Filter` module provides composable functions for accepting, rejecting,
1849
+ * narrowing, and transforming values. A `Filter<Input, Pass, Fail>` receives an
1850
+ * input and returns a `Result`: success means the value passed the filter, while
1851
+ * failure means the value was filtered out.
1852
+ *
1853
+ * **Mental model**
1854
+ *
1855
+ * - A filter is a typed predicate that can also transform the successful value
1856
+ * - Predicate-based filters pass the original input when the predicate returns `true`
1857
+ * - Refinement-based filters narrow the successful type, for example from `unknown` to `string`
1858
+ * - Custom filters return `Result.succeed(pass)` or `Result.fail(fail)` directly
1859
+ * - Filters compose with logical and sequential combinators instead of throwing exceptions
1860
+ * - `FilterEffect` is the effectful form for filters that need asynchronous work, errors, or services
1861
+ *
1862
+ * **Common tasks**
1863
+ *
1864
+ * - Build filters: {@link make}, {@link makeEffect}, {@link fromPredicate}, {@link fromPredicateOption}
1865
+ * - Narrow unknown values: {@link string}, {@link number}, {@link boolean}, {@link bigint}, {@link symbol}, {@link date}
1866
+ * - Match shapes and variants: {@link instanceOf}, {@link tagged}, {@link reason}, {@link has}
1867
+ * - Match exact values: {@link equals}, {@link equalsStrict}
1868
+ * - Combine alternatives: {@link or}
1869
+ * - Require multiple filters: {@link zip}, {@link zipWith}, {@link andLeft}, {@link andRight}
1870
+ * - Run filters in sequence: {@link compose}, {@link composePassthrough}
1871
+ * - Convert results: {@link toPredicate}, {@link toOption}, {@link toResult}
1872
+ * - Adjust failure values: {@link mapFail}
1873
+ *
1874
+ * **Gotchas**
1875
+ *
1876
+ * - A failed filter is data in the `Result` failure channel; it is not an exception
1877
+ * - `compose` preserves intermediate failure values, while {@link composePassthrough} fails with the original input
1878
+ * - `equalsStrict` uses JavaScript `===`; use {@link equals} for structural equality
1879
+ * - `fromPredicateOption` fails with the original input when the returned `Option` is `None`
1880
+ * - Prefer refinement predicates when you want TypeScript to narrow the successful value type
1881
+ *
1391
1882
  * @since 4.0.0
1392
1883
  */
1393
1884
  export * as Filter from "./Filter.ts"
@@ -1449,11 +1940,106 @@ export * as Filter from "./Filter.ts"
1449
1940
  export * as Formatter from "./Formatter.ts"
1450
1941
 
1451
1942
  /**
1943
+ * The `Function` module provides small, pure helpers for defining, composing,
1944
+ * adapting, and reusing TypeScript functions. It is the foundation for the
1945
+ * data-first and data-last APIs used throughout Effect, and it includes the
1946
+ * core pipeline utilities that make those APIs ergonomic.
1947
+ *
1948
+ * **Mental model**
1949
+ *
1950
+ * - {@link pipe} starts with a value and passes it through one unary function at
1951
+ * a time
1952
+ * - {@link flow} composes unary functions into a reusable function
1953
+ * - {@link dual} builds APIs that support both direct calls and `pipe`-friendly
1954
+ * data-last calls
1955
+ * - {@link identity}, {@link constant}, and the `const*` helpers model common
1956
+ * identity and thunk patterns without allocating ad hoc callbacks
1957
+ * - {@link tupled}, {@link untupled}, {@link flip}, and {@link apply} adapt
1958
+ * call shapes without changing the underlying behavior
1959
+ * - Type helpers such as {@link LazyArg}, {@link FunctionN}, {@link satisfies},
1960
+ * and {@link cast} describe or constrain functions at the type level
1961
+ *
1962
+ * **Common tasks**
1963
+ *
1964
+ * - Build readable transformation pipelines: {@link pipe}
1965
+ * - Create reusable composed functions: {@link flow}, {@link compose}
1966
+ * - Define functions callable in both data-first and data-last style: {@link dual}
1967
+ * - Return a value unchanged: {@link identity}
1968
+ * - Create thunks and common constant functions: {@link constant},
1969
+ * {@link constTrue}, {@link constFalse}, {@link constNull},
1970
+ * {@link constUndefined}, {@link constVoid}
1971
+ * - Convert between rest-argument and tuple-argument functions: {@link tupled},
1972
+ * {@link untupled}
1973
+ * - Express impossible branches: {@link absurd}
1974
+ * - Cache results for object keys: {@link memoize}
1975
+ *
1976
+ * **Gotchas**
1977
+ *
1978
+ * - Functions passed to {@link pipe} and {@link flow} are applied left-to-right
1979
+ * and should be unary at each step
1980
+ * - {@link dual} uses either an arity or a predicate to decide whether a call is
1981
+ * data-first or data-last; use a predicate when optional arguments make arity
1982
+ * ambiguous
1983
+ * - {@link cast} changes only the static TypeScript type and performs no runtime
1984
+ * validation
1985
+ * - {@link memoize} is intended for object keys and stores cached values in a
1986
+ * `WeakMap`
1987
+ *
1452
1988
  * @since 2.0.0
1453
1989
  */
1454
1990
  export * as Function from "./Function.ts"
1455
1991
 
1456
1992
  /**
1993
+ * The `Graph` module provides immutable and scoped-mutable graph data
1994
+ * structures for modeling relationships between indexed nodes and edges. A
1995
+ * graph can be directed or undirected, stores user-defined data on both nodes
1996
+ * and edges, and exposes traversal, analysis, path finding, transformation, and
1997
+ * diagram export utilities.
1998
+ *
1999
+ * **Mental model**
2000
+ *
2001
+ * - Nodes and edges are addressed by stable numeric indices: {@link NodeIndex}
2002
+ * and {@link EdgeIndex}
2003
+ * - Node data has type `N`; edge data has type `E`
2004
+ * - {@link Graph} values are immutable snapshots; use {@link MutableGraph}
2005
+ * through {@link mutate}, {@link beginMutation}, or constructor callbacks to
2006
+ * add, remove, or update nodes and edges
2007
+ * - Directed graphs follow edge direction for neighbors and traversals, while
2008
+ * undirected graphs treat each edge as connecting both endpoints
2009
+ * - Missing lookups return `Option`, while structurally invalid operations such
2010
+ * as adding an edge to a missing node throw {@link GraphError}
2011
+ *
2012
+ * **Common tasks**
2013
+ *
2014
+ * - Create graphs: {@link directed}, {@link undirected}
2015
+ * - Mutate safely: {@link mutate}, {@link addNode}, {@link addEdge},
2016
+ * {@link removeNode}, {@link removeEdge}
2017
+ * - Query contents: {@link getNode}, {@link getEdge}, {@link hasNode},
2018
+ * {@link hasEdge}, {@link nodeCount}, {@link edgeCount}, {@link neighbors}
2019
+ * - Transform data: {@link updateNode}, {@link updateEdge}, {@link mapNodes},
2020
+ * {@link mapEdges}, {@link filterNodes}, {@link filterEdges},
2021
+ * {@link filterMapNodes}, {@link filterMapEdges}
2022
+ * - Traverse lazily: {@link dfs}, {@link bfs}, {@link topo},
2023
+ * {@link dfsPostOrder}, {@link nodes}, {@link edges}, {@link Walker}
2024
+ * - Analyze structure: {@link isAcyclic}, {@link isBipartite},
2025
+ * {@link connectedComponents}, {@link stronglyConnectedComponents},
2026
+ * {@link externals}
2027
+ * - Find paths: {@link dijkstra}, {@link astar}, {@link bellmanFord},
2028
+ * {@link floydWarshall}
2029
+ * - Export diagrams: {@link toGraphViz}, {@link toMermaid}
2030
+ *
2031
+ * **Gotchas**
2032
+ *
2033
+ * - Only mutable graphs can be changed. Create one with {@link mutate} or by
2034
+ * passing a callback to {@link directed} / {@link undirected}.
2035
+ * - Traversal APIs return lazy {@link Walker} values. Use {@link indices},
2036
+ * {@link values}, or {@link entries} to choose what each iteration yields.
2037
+ * - `NodeIndex` and `EdgeIndex` values are identifiers, not array offsets. They
2038
+ * are not reused after removals.
2039
+ * - Shortest-path algorithms require a cost function. {@link dijkstra} and
2040
+ * {@link astar} reject negative weights; use {@link bellmanFord} or
2041
+ * {@link floydWarshall} when negative weights are part of the model.
2042
+ *
1457
2043
  * @since 4.0.0
1458
2044
  */
1459
2045
  export * as Graph from "./Graph.ts"
@@ -1470,16 +2056,184 @@ export * as Graph from "./Graph.ts"
1470
2056
  export * as Hash from "./Hash.ts"
1471
2057
 
1472
2058
  /**
2059
+ * The `HashMap` module provides an immutable key-value data structure with
2060
+ * efficient lookup, insertion, removal, and transformation operations. A
2061
+ * `HashMap<Key, Value>` stores entries by hashing keys and resolving matches
2062
+ * with Effect's structural equality semantics.
2063
+ *
2064
+ * **Mental model**
2065
+ *
2066
+ * - A `HashMap<Key, Value>` is an immutable collection of key-value pairs
2067
+ * - Operations such as {@link set}, {@link remove}, and {@link modifyAt} return
2068
+ * new maps; existing maps are not mutated
2069
+ * - Keys are compared using the `Equal` protocol and are grouped by hashes from
2070
+ * the `Hash` protocol
2071
+ * - Plain JavaScript primitives work as keys, and custom objects can define
2072
+ * `Equal` / `Hash` behavior for structural lookup
2073
+ * - Lookups with {@link get} return an `Option`, making missing keys explicit
2074
+ * - Iteration order is based on the map's internal hash structure and should
2075
+ * not be treated as insertion order
2076
+ *
2077
+ * **Common tasks**
2078
+ *
2079
+ * - Create maps: {@link empty}, {@link make}, {@link fromIterable}
2080
+ * - Read values: {@link get}, {@link getUnsafe}, {@link has}, {@link hasBy}
2081
+ * - Add or update entries: {@link set}, {@link modify}, {@link modifyAt}, {@link setMany}
2082
+ * - Remove entries: {@link remove}, {@link removeMany}
2083
+ * - Combine maps: {@link union}
2084
+ * - Iterate or convert: {@link keys}, {@link values}, {@link entries}, {@link toValues}, {@link toEntries}
2085
+ * - Transform values: {@link map}, {@link flatMap}, {@link filter}, {@link filterMap}, {@link compact}
2086
+ * - Fold and search: {@link reduce}, {@link findFirst}, {@link some}, {@link every}
2087
+ * - Batch updates efficiently: {@link mutate}, {@link beginMutation}, {@link endMutation}
2088
+ *
2089
+ * **Gotchas**
2090
+ *
2091
+ * - {@link getUnsafe} throws when the key is absent; prefer {@link get} unless
2092
+ * absence is impossible by construction
2093
+ * - Mutating a key object after insertion can make future lookups fail if its
2094
+ * equality or hash changes
2095
+ * - Hash collisions are handled by equality checks, so matching hashes alone do
2096
+ * not make two keys equal
2097
+ * - Use {@link getHash} and {@link hasHash} only when you already have the
2098
+ * correct hash for the same key
2099
+ * - Convert entries to an array and sort them when deterministic presentation is
2100
+ * required
2101
+ *
2102
+ * **Quickstart**
2103
+ *
2104
+ * **Example** (Working with immutable maps)
2105
+ *
2106
+ * ```ts
2107
+ * import { HashMap, Option } from "effect"
2108
+ *
2109
+ * const scores = HashMap.make(["alice", 10], ["bob", 15])
2110
+ *
2111
+ * const updated = scores.pipe(
2112
+ * HashMap.set("carol", 20),
2113
+ * HashMap.modify("alice", (score) => score + 1)
2114
+ * )
2115
+ *
2116
+ * console.log(HashMap.get(updated, "alice"))
2117
+ * // Output: Option.some(11)
2118
+ *
2119
+ * console.log(HashMap.get(scores, "carol"))
2120
+ * // Output: Option.none()
2121
+ *
2122
+ * console.log(Option.getOrElse(HashMap.get(updated, "dave"), () => 0))
2123
+ * // Output: 0
2124
+ * ```
2125
+ *
2126
+ * **See also**
2127
+ *
2128
+ * - {@link HashSet} for immutable sets backed by hash semantics
2129
+ * - {@link Equal} for structural equality
2130
+ * - {@link Hash} for hash implementations used by hashed collections
2131
+ *
1473
2132
  * @since 2.0.0
1474
2133
  */
1475
2134
  export * as HashMap from "./HashMap.ts"
1476
2135
 
1477
2136
  /**
2137
+ * The `HashRing` module provides a weighted consistent-hashing data structure
2138
+ * for assigning arbitrary string inputs to a changing set of nodes. A hash ring
2139
+ * minimizes remapping when nodes are added, removed, or reweighted, which makes
2140
+ * it useful for routing requests, partitioning keys, and distributing shards
2141
+ * across service instances or storage backends.
2142
+ *
2143
+ * **Mental model**
2144
+ *
2145
+ * - Each node is identified by its {@link PrimaryKey.PrimaryKey} value
2146
+ * - {@link add} and {@link addMany} place weighted virtual points on the ring
2147
+ * - {@link get} hashes an input string and returns the nearest node on the ring
2148
+ * - {@link getShards} assigns a fixed number of shard indexes across the nodes
2149
+ * - Higher weights receive proportionally more virtual points and shard
2150
+ * allocations
2151
+ * - Operations mutate and return the same ring instance
2152
+ *
2153
+ * **Common tasks**
2154
+ *
2155
+ * - Create an empty ring: {@link make}
2156
+ * - Add or update nodes: {@link add}, {@link addMany}
2157
+ * - Remove nodes: {@link remove}
2158
+ * - Check membership by primary key: {@link has}
2159
+ * - Route an input key to a node: {@link get}
2160
+ * - Precompute shard ownership: {@link getShards}
2161
+ * - Guard unknown values: {@link isHashRing}
2162
+ *
2163
+ * **Gotchas**
2164
+ *
2165
+ * - Empty rings return `undefined` from {@link get} and {@link getShards}
2166
+ * - Nodes with the same primary key represent the same ring member
2167
+ * - Weights are clamped to a positive minimum so a node remains represented
2168
+ * - Mutating a ring in place is intentional; create a new ring when independent
2169
+ * snapshots are required
2170
+ *
2171
+ * **Quickstart**
2172
+ *
2173
+ * **Example** (Routing keys across nodes)
2174
+ *
2175
+ * ```ts
2176
+ * import { HashRing, PrimaryKey } from "effect"
2177
+ *
2178
+ * class Node implements PrimaryKey.PrimaryKey {
2179
+ * constructor(readonly id: string) {}
2180
+ *
2181
+ * [PrimaryKey.symbol](): string {
2182
+ * return this.id
2183
+ * }
2184
+ * }
2185
+ *
2186
+ * const ring = HashRing.make<Node>().pipe(
2187
+ * HashRing.add(new Node("node-a")),
2188
+ * HashRing.add(new Node("node-b"), { weight: 2 })
2189
+ * )
2190
+ *
2191
+ * const owner = HashRing.get(ring, "user:123")
2192
+ * console.log(owner ? PrimaryKey.value(owner) : undefined)
2193
+ * ```
2194
+ *
1478
2195
  * @since 4.0.0
1479
2196
  */
1480
2197
  export * as HashRing from "./HashRing.ts"
1481
2198
 
1482
2199
  /**
2200
+ * The `HashSet` module provides an immutable set data structure for storing
2201
+ * unique values with efficient membership checks, additions, removals, and set
2202
+ * operations. A `HashSet<A>` contains at most one value for each equality class
2203
+ * as determined by Effect's `Equal` / `Hash` semantics.
2204
+ *
2205
+ * **Mental model**
2206
+ *
2207
+ * - `HashSet<A>` is an immutable collection of unique values of type `A`
2208
+ * - Operations such as {@link add}, {@link remove}, {@link union}, and
2209
+ * {@link difference} return new sets; the input set is never mutated
2210
+ * - Membership is checked with {@link has}, using Effect equality and hashing
2211
+ * rather than array-style linear scanning
2212
+ * - Duplicate values are collapsed when using {@link make}, {@link fromIterable},
2213
+ * {@link add}, or {@link map}
2214
+ * - `HashSet` is iterable, but iteration order is not a sorting guarantee
2215
+ *
2216
+ * **Common tasks**
2217
+ *
2218
+ * - Create sets: {@link empty}, {@link make}, {@link fromIterable}
2219
+ * - Check membership and size: {@link has}, {@link size}, {@link isEmpty}
2220
+ * - Add or remove values: {@link add}, {@link remove}
2221
+ * - Combine sets: {@link union}, {@link intersection}, {@link difference}
2222
+ * - Compare sets: {@link isSubset}
2223
+ * - Transform or select values: {@link map}, {@link filter}
2224
+ * - Test values: {@link some}, {@link every}
2225
+ * - Fold values: {@link reduce}
2226
+ *
2227
+ * **Gotchas**
2228
+ *
2229
+ * - Values that should compare structurally should implement compatible
2230
+ * `Equal` and `Hash` behavior; otherwise object identity may affect whether
2231
+ * values are considered distinct
2232
+ * - {@link map} may reduce the set size when multiple input values map to the
2233
+ * same output value
2234
+ * - Do not rely on iteration order for deterministic presentation; sort the
2235
+ * values after converting to an array when order matters
2236
+ *
1483
2237
  * @since 2.0.0
1484
2238
  */
1485
2239
  export * as HashSet from "./HashSet.ts"
@@ -1496,7 +2250,8 @@ export * as HashSet from "./HashSet.ts"
1496
2250
  * can represent complex type relationships with multiple type parameters, including
1497
2251
  * contravariant, covariant, and invariant positions.
1498
2252
  *
1499
- * @example
2253
+ * **Example** (Encoding type lambdas)
2254
+ *
1500
2255
  * ```ts
1501
2256
  * import type { HKT } from "effect"
1502
2257
  *
@@ -1532,7 +2287,8 @@ export * as HKT from "./HKT.ts"
1532
2287
  * The module also includes redaction capabilities for sensitive data, allowing objects
1533
2288
  * to provide different representations based on the current execution context.
1534
2289
  *
1535
- * @example
2290
+ * **Example** (Creating inspectable values)
2291
+ *
1536
2292
  * ```ts
1537
2293
  * import { Inspectable } from "effect"
1538
2294
  * import { format } from "effect/Formatter"
@@ -1575,7 +2331,8 @@ export * as Inspectable from "./Inspectable.ts"
1575
2331
  * for stream processing and memory-efficient data manipulation. All functions in this
1576
2332
  * module preserve the lazy nature of iterables where possible.
1577
2333
  *
1578
- * @example
2334
+ * **Example** (Working with iterables)
2335
+ *
1579
2336
  * ```ts
1580
2337
  * import { Iterable, Option } from "effect"
1581
2338
  *
@@ -1796,6 +2553,38 @@ export * as JsonPointer from "./JsonPointer.ts"
1796
2553
  export * as JsonSchema from "./JsonSchema.ts"
1797
2554
 
1798
2555
  /**
2556
+ * The `Latch` module provides a reusable synchronization primitive for
2557
+ * coordinating fibers. A `Latch` is either open or closed: when it is closed,
2558
+ * fibers that use {@link await} or {@link whenOpen} suspend until the latch is
2559
+ * opened or the current waiters are released.
2560
+ *
2561
+ * **Mental model**
2562
+ *
2563
+ * - An open latch lets current and future waiters continue immediately
2564
+ * - A closed latch causes `await` and `whenOpen` to suspend
2565
+ * - {@link open} permanently opens the latch until it is closed again
2566
+ * - {@link release} wakes only the fibers currently waiting and leaves the
2567
+ * latch closed for future waiters
2568
+ * - {@link close} resets the latch so later waiters suspend again
2569
+ *
2570
+ * **Common tasks**
2571
+ *
2572
+ * - Create a latch inside `Effect`: {@link make}
2573
+ * - Create a latch synchronously: {@link makeUnsafe}
2574
+ * - Wait for a signal before continuing: {@link await}
2575
+ * - Guard an effect so it runs only after the latch is open: {@link whenOpen}
2576
+ * - Let all current and future waiters proceed: {@link open}
2577
+ * - Let only the current waiters proceed: {@link release}
2578
+ * - Re-enable waiting after opening: {@link close}
2579
+ *
2580
+ * **Gotchas**
2581
+ *
2582
+ * - `release` is not the same as `open`; new waiters still suspend after the
2583
+ * current waiters are released
2584
+ * - `open` and `close` report whether they changed the latch state
2585
+ * - Prefer the effectful APIs unless synchronous allocation or mutation is
2586
+ * required
2587
+ *
1799
2588
  * @since 3.8.0
1800
2589
  */
1801
2590
  export * as Latch from "./Latch.ts"
@@ -1822,215 +2611,210 @@ export * as Latch from "./Latch.ts"
1822
2611
  export * as Layer from "./Layer.ts"
1823
2612
 
1824
2613
  /**
1825
- * @since 3.14.0
1826
- */
1827
- export * as LayerMap from "./LayerMap.ts"
1828
-
1829
- /**
1830
- * @since 2.0.0
2614
+ * The `LayerMap` module provides utilities for managing scoped resources that
2615
+ * are selected by key and built from `Layer` values. A `LayerMap<K, I, E>` turns
2616
+ * a key into a cached service `Context<I>`, so applications can lazily acquire
2617
+ * and reuse different resource instances such as tenant clients, regional
2618
+ * connections, environment-specific services, or other keyed infrastructure.
1831
2619
  *
1832
- * The `Logger` module provides a robust and flexible logging system for Effect applications.
1833
- * It offers structured logging, multiple output formats, and seamless integration with the
1834
- * Effect runtime's tracing and context management.
2620
+ * **Mental model**
1835
2621
  *
1836
- * ## Key Features
2622
+ * - A `LayerMap` is a scoped, reference-counted cache of contexts produced by layers
2623
+ * - Keys identify which layer-backed resource set should be acquired
2624
+ * - Resources are acquired on demand when a key is requested
2625
+ * - The same key reuses the cached context while it remains live
2626
+ * - Cached resources are finalized when invalidated, when their scope closes, or after idle expiration
2627
+ * - The layers built by a `LayerMap` share the current layer memoization map
1837
2628
  *
1838
- * - **Structured Logging**: Built-in support for structured log messages with metadata
1839
- * - **Multiple Formats**: JSON, LogFmt, Pretty, and custom formatting options
1840
- * - **Context Integration**: Automatic capture of fiber context, spans, and annotations
1841
- * - **Batching**: Efficient log aggregation and batch processing
1842
- * - **File Output**: Direct file writing with configurable batch windows
1843
- * - **Composable**: Transform and compose loggers using functional patterns
2629
+ * **Common tasks**
1844
2630
  *
1845
- * ## Basic Usage
2631
+ * - Create from a lookup function: {@link make}
2632
+ * - Create from a fixed record of layers: {@link fromRecord}
2633
+ * - Define a service wrapper with accessor helpers: {@link Service}
2634
+ * - Retrieve a layer for a key: {@link LayerMap.get}
2635
+ * - Retrieve a scoped context directly: {@link LayerMap.contextEffect}
2636
+ * - Force a cached entry to be rebuilt later: {@link LayerMap.invalidate}
2637
+ * - Remove idle entries automatically with the `idleTimeToLive` option
2638
+ * - Eagerly build known entries with `preloadKeys` or `preload`
1846
2639
  *
1847
- * ```ts
1848
- * import { Effect } from "effect"
2640
+ * **Gotchas**
1849
2641
  *
1850
- * // Basic logging
1851
- * const program = Effect.gen(function*() {
1852
- * yield* Effect.log("Application started")
1853
- * yield* Effect.logInfo("Processing user request")
1854
- * yield* Effect.logWarning("Resource limit approaching")
1855
- * yield* Effect.logError("Database connection failed")
1856
- * })
2642
+ * - `contextEffect` requires a `Scope.Scope` because it exposes the acquired context directly
2643
+ * - `get` returns a `Layer` that can be provided to programs expecting the keyed services
2644
+ * - Invalidating a key finalizes the current cached resources for that key; the next access rebuilds them
2645
+ * - Preloading moves layer construction errors to `LayerMap` creation instead of first use
1857
2646
  *
1858
- * // With structured data
1859
- * const structuredLog = Effect.gen(function*() {
1860
- * yield* Effect.log("User action", { userId: 123, action: "login" })
1861
- * yield* Effect.logInfo("Request processed", { duration: 150, statusCode: 200 })
1862
- * })
1863
- * ```
2647
+ * @since 3.14.0
2648
+ */
2649
+ export * as LayerMap from "./LayerMap.ts"
2650
+
2651
+ /**
2652
+ * The `Logger` module defines the logging model used by the Effect runtime and
2653
+ * provides constructors for formatting, routing, batching, and installing
2654
+ * loggers. A `Logger<Message, Output>` receives each runtime log event as an
2655
+ * {@link Options} value and transforms it into an output such as a string,
2656
+ * structured object, JSON line, console write, file write, or trace span event.
1864
2657
  *
1865
- * ## Custom Loggers
2658
+ * **Mental model**
1866
2659
  *
1867
- * ```ts
1868
- * import { Effect, Logger } from "effect"
2660
+ * - Effect programs emit log events with APIs such as `Effect.log`,
2661
+ * `Effect.logInfo`, `Effect.logWarning`, and `Effect.logError`
2662
+ * - Each event contains a message, log level, cause, fiber, and timestamp
2663
+ * - Loggers are ordinary values created with {@link make} and installed with
2664
+ * {@link layer}
2665
+ * - Multiple loggers can be active at once by providing a layer with several
2666
+ * logger values
2667
+ * - Formatter loggers such as {@link formatLogFmt}, {@link formatStructured},
2668
+ * and {@link formatJson} return formatted data without writing it anywhere
2669
+ * - Console loggers such as {@link consolePretty}, {@link consoleLogFmt},
2670
+ * {@link consoleStructured}, and {@link consoleJson} write formatted output
2671
+ * to the active Effect console
2672
+ *
2673
+ * **Log output structure**
2674
+ *
2675
+ * Built-in formatters include the log level, timestamp, fiber identifier, and
2676
+ * logged message. When present, they also include the pretty-printed cause,
2677
+ * active log annotations, and active log spans. Structured and JSON loggers keep
2678
+ * these fields as machine-readable data, while logfmt and pretty loggers render
2679
+ * them as human-readable text.
1869
2680
  *
1870
- * // Create a custom logger
1871
- * const customLogger = Logger.make((options) => {
1872
- * console.log(`[${options.logLevel}] ${options.message}`)
1873
- * })
2681
+ * **Common tasks**
1874
2682
  *
1875
- * // Use JSON format for production
1876
- * const jsonLogger = Logger.consoleJson
2683
+ * - Create a custom logger: {@link make}
2684
+ * - Transform logger output: {@link map}
2685
+ * - Write formatter output to the console: {@link withConsoleLog},
2686
+ * {@link withConsoleError}, {@link withLeveledConsole}
2687
+ * - Use built-in console loggers: {@link consolePretty}, {@link consoleLogFmt},
2688
+ * {@link consoleStructured}, {@link consoleJson}
2689
+ * - Use built-in formatter loggers: {@link formatSimple}, {@link formatLogFmt},
2690
+ * {@link formatStructured}, {@link formatJson}
2691
+ * - Batch logger output before flushing to a sink: {@link batched}
2692
+ * - Write string logger output to a file: {@link toFile}
2693
+ * - Preserve trace correlation by including {@link tracerLogger}
2694
+ * - Install or replace loggers for an effect: {@link layer}
1877
2695
  *
1878
- * // Pretty format for development
1879
- * const prettyLogger = Logger.consolePretty()
2696
+ * **Gotchas**
1880
2697
  *
1881
- * const program = Effect.log("Hello World").pipe(
1882
- * Effect.provide(Logger.layer([jsonLogger]))
1883
- * )
1884
- * ```
2698
+ * - {@link layer} replaces the current logger set by default; pass
2699
+ * `mergeWithExisting: true` when adding loggers to the existing runtime
2700
+ * loggers
2701
+ * - Formatter loggers only produce values; wrap them with console, file, batch,
2702
+ * or custom sink loggers when output should be written somewhere
2703
+ * - {@link batched} and {@link toFile} are scoped; keep their scope open while
2704
+ * logs are being emitted so buffered entries can flush reliably
2705
+ * - {@link toFile} accepts only loggers that output strings, so pair it with
2706
+ * string formatters such as {@link formatJson} or {@link formatLogFmt}
2707
+ * - The default runtime logger set includes {@link tracerLogger}; replacing
2708
+ * loggers without merging may remove automatic log-to-trace-span recording
1885
2709
  *
1886
- * ## Multiple Loggers
2710
+ * **Quickstart**
2711
+ *
2712
+ * **Example** (Installing a JSON console logger)
1887
2713
  *
1888
2714
  * ```ts
1889
2715
  * import { Effect, Logger } from "effect"
1890
2716
  *
1891
- * // Combine multiple loggers
1892
- * const CombinedLoggerLive = Logger.layer([
1893
- * Logger.consoleJson,
1894
- * Logger.consolePretty()
1895
- * ])
1896
- *
1897
- * const program = Effect.log("Application event").pipe(
1898
- * Effect.provide(CombinedLoggerLive)
2717
+ * const program = Effect.gen(function*() {
2718
+ * yield* Effect.logInfo("request started", { method: "GET", path: "/users" })
2719
+ * yield* Effect.logError("request failed", { status: 500 })
2720
+ * }).pipe(
2721
+ * Effect.annotateLogs("service", "users-api"),
2722
+ * Effect.withLogSpan("http.request"),
2723
+ * Effect.provide(Logger.layer([Logger.consoleJson]))
1899
2724
  * )
1900
2725
  * ```
1901
2726
  *
1902
- * ## Batched Logging
2727
+ * **See also**
1903
2728
  *
1904
- * ```ts
1905
- * import { Duration, Effect, Logger } from "effect"
1906
- *
1907
- * const batchedLogger = Logger.batched(Logger.formatJson, {
1908
- * window: Duration.seconds(5),
1909
- * flush: (messages) =>
1910
- * Effect.sync(() => {
1911
- * // Process batch of log messages
1912
- * console.log("Flushing", messages.length, "log entries")
1913
- * })
1914
- * })
2729
+ * - {@link make} for defining custom loggers
2730
+ * - {@link layer} for installing loggers
2731
+ * - {@link formatJson} and {@link consoleJson} for structured production logs
2732
+ * - {@link consolePretty} for readable local logs
1915
2733
  *
1916
- * const program = Effect.gen(function*() {
1917
- * const logger = yield* batchedLogger
1918
- * yield* Effect.provide(
1919
- * Effect.all([
1920
- * Effect.log("Event 1"),
1921
- * Effect.log("Event 2"),
1922
- * Effect.log("Event 3")
1923
- * ]),
1924
- * Logger.layer([logger])
1925
- * )
1926
- * })
1927
- * ```
2734
+ * @since 2.0.0
1928
2735
  */
1929
2736
  export * as Logger from "./Logger.ts"
1930
2737
 
1931
2738
  /**
1932
- * @since 2.0.0
1933
- *
1934
- * The `LogLevel` module provides utilities for managing log levels in Effect applications.
1935
- * It defines a hierarchy of log levels and provides functions for comparing and filtering logs
1936
- * based on their severity.
1937
- *
1938
- * ## Log Level Hierarchy
2739
+ * The `LogLevel` module defines the levels used by Effect logging and the
2740
+ * ordering operations used to compare, filter, and enable log output.
1939
2741
  *
1940
- * The log levels are ordered from most severe to least severe:
1941
- *
1942
- * 1. **All** - Special level that allows all messages
1943
- * 2. **Fatal** - System is unusable, immediate attention required
1944
- * 3. **Error** - Error conditions that should be investigated
1945
- * 4. **Warn** - Warning conditions that may indicate problems
1946
- * 5. **Info** - Informational messages about normal operation
1947
- * 6. **Debug** - Debug information useful during development
1948
- * 7. **Trace** - Very detailed trace information
1949
- * 8. **None** - Special level that suppresses all messages
1950
- *
1951
- * ## Basic Usage
1952
- *
1953
- * ```ts
1954
- * import { Effect } from "effect"
1955
- *
1956
- * // Basic log level usage
1957
- * const program = Effect.gen(function*() {
1958
- * yield* Effect.logFatal("System is shutting down")
1959
- * yield* Effect.logError("Database connection failed")
1960
- * yield* Effect.logWarning("Memory usage is high")
1961
- * yield* Effect.logInfo("User logged in")
1962
- * yield* Effect.logDebug("Processing request")
1963
- * yield* Effect.logTrace("Variable value: xyz")
1964
- * })
1965
- * ```
1966
- *
1967
- * ## Level Comparison
2742
+ * **Mental model**
1968
2743
  *
1969
- * ```ts
1970
- * import { LogLevel } from "effect"
2744
+ * - A `LogLevel` is one of `All`, `Fatal`, `Error`, `Warn`, `Info`, `Debug`,
2745
+ * `Trace`, or `None`
2746
+ * - `Fatal` is the most severe concrete level and `Trace` is the least severe
2747
+ * - `All` and `None` are sentinel levels: `All` enables every message and
2748
+ * `None` disables every message
2749
+ * - Ordering follows logging severity, so higher levels are more important and
2750
+ * lower levels are more verbose
2751
+ * - Filtering is usually expressed as "log this message when its level is
2752
+ * greater than or equal to the configured minimum"
1971
2753
  *
1972
- * // Check if one level is more severe than another
1973
- * console.log(LogLevel.isGreaterThan("Error", "Info")) // true
1974
- * console.log(LogLevel.isGreaterThan("Debug", "Error")) // false
2754
+ * **Common tasks**
1975
2755
  *
1976
- * // Check if level meets minimum threshold
1977
- * console.log(LogLevel.isGreaterThanOrEqualTo("Info", "Debug")) // true
1978
- * console.log(LogLevel.isLessThan("Trace", "Info")) // true
1979
- * ```
2756
+ * - Enumerate levels with {@link values}
2757
+ * - Compare exact levels with {@link Equivalence}
2758
+ * - Sort or compare by severity with {@link Order} and {@link getOrdinal}
2759
+ * - Check thresholds with {@link isGreaterThanOrEqualTo} and
2760
+ * {@link isLessThanOrEqualTo}
2761
+ * - Test whether a level is enabled for the current fiber with
2762
+ * {@link isEnabled}
1980
2763
  *
1981
- * ## Filtering by Level
2764
+ * **Gotchas**
1982
2765
  *
1983
- * ```ts
1984
- * import { Logger, LogLevel } from "effect"
2766
+ * - `All` and `None` are useful for configuration boundaries, but they are not
2767
+ * concrete message severities; use {@link Severity} when only emitted message
2768
+ * levels are valid
2769
+ * - The comparison helpers compare severity, not declaration position in source
2770
+ * code or alphabetical order
2771
+ * - `isEnabled` reads the current fiber's `MinimumLogLevel` reference, so it is
2772
+ * context-sensitive; use the pure comparison helpers when checking an
2773
+ * explicit threshold
1985
2774
  *
1986
- * // Create a logger that only logs Error and above
1987
- * const errorLogger = Logger.make((options) => {
1988
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, "Error")) {
1989
- * console.log(`[${options.logLevel}] ${options.message}`)
1990
- * }
1991
- * })
2775
+ * @since 2.0.0
2776
+ */
2777
+ export * as LogLevel from "./LogLevel.ts"
2778
+
2779
+ /**
2780
+ * The `ManagedRuntime` module provides a way to build a reusable runtime from
2781
+ * a `Layer` and use it to run effects that require the services produced by
2782
+ * that layer. A `ManagedRuntime<R, ER>` owns the lifecycle of the layer-built
2783
+ * resources, caches the resulting `Context<R>`, and exposes runners for
2784
+ * integrating Effect programs with JavaScript entry points.
1992
2785
  *
1993
- * // Production logger - Info and above
1994
- * const productionLogger = Logger.make((options) => {
1995
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, "Info")) {
1996
- * console.log(
1997
- * `${options.date.toISOString()} [${options.logLevel}] ${options.message}`
1998
- * )
1999
- * }
2000
- * })
2786
+ * **Mental model**
2001
2787
  *
2002
- * // Development logger - Debug and above
2003
- * const devLogger = Logger.make((options) => {
2004
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, "Debug")) {
2005
- * console.log(`[${options.logLevel}] ${options.message}`)
2006
- * }
2007
- * })
2008
- * ```
2788
+ * - A managed runtime is created from a `Layer` with {@link make}
2789
+ * - The layer is built lazily the first time the runtime is used
2790
+ * - The built context is cached and reused for subsequent effect executions
2791
+ * - Resources acquired by the layer are owned by the runtime's internal scope
2792
+ * - Disposing the runtime closes that scope and releases all managed resources
2793
+ * - Effects run through the runtime receive the layer's services automatically
2009
2794
  *
2010
- * ## Runtime Configuration
2795
+ * **Common tasks**
2011
2796
  *
2012
- * ```ts
2013
- * import { Config, Effect, Logger, LogLevel } from "effect"
2797
+ * - Create a runtime from application services: {@link make}
2798
+ * - Run an effect as a `Promise`: {@link ManagedRuntime.runPromise}
2799
+ * - Run an effect and keep its `Exit`: {@link ManagedRuntime.runPromiseExit}
2800
+ * - Fork an effect into a `Fiber`: {@link ManagedRuntime.runFork}
2801
+ * - Bridge callback-style APIs: {@link ManagedRuntime.runCallback}
2802
+ * - Run synchronous effects at program boundaries: {@link ManagedRuntime.runSync},
2803
+ * {@link ManagedRuntime.runSyncExit}
2804
+ * - Access the cached service context: {@link ManagedRuntime.context}
2805
+ * - Release layer resources: {@link ManagedRuntime.dispose},
2806
+ * {@link ManagedRuntime.disposeEffect}
2014
2807
  *
2015
- * // Configure log level from environment
2016
- * const logLevelConfig = Config.string("LOG_LEVEL").pipe(
2017
- * Config.withDefault("Info")
2018
- * )
2808
+ * **Gotchas**
2019
2809
  *
2020
- * const configurableLogger = Effect.gen(function*() {
2021
- * const minLevel = yield* logLevelConfig
2810
+ * - Always dispose a managed runtime when it is no longer needed, especially
2811
+ * when the layer acquires resources such as connections, servers, or files
2812
+ * - Layer construction errors are included in the error channel of runtime
2813
+ * runners, so `ER` is combined with the effect's own error type
2814
+ * - `runSync` can only execute effects without asynchronous boundaries; use
2815
+ * `runPromise` for asynchronous programs
2816
+ * - After disposal, the runtime cannot be reused
2022
2817
  *
2023
- * return Logger.make((options) => {
2024
- * if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, minLevel)) {
2025
- * console.log(`[${options.logLevel}] ${options.message}`)
2026
- * }
2027
- * })
2028
- * })
2029
- * ```
2030
- */
2031
- export * as LogLevel from "./LogLevel.ts"
2032
-
2033
- /**
2034
2818
  * @since 2.0.0
2035
2819
  */
2036
2820
  export * as ManagedRuntime from "./ManagedRuntime.ts"
@@ -2066,49 +2850,56 @@ export * as ManagedRuntime from "./ManagedRuntime.ts"
2066
2850
  export * as Match from "./Match.ts"
2067
2851
 
2068
2852
  /**
2069
- * @since 2.0.0
2853
+ * The `Metric` module provides tools for defining, updating, tagging, and
2854
+ * reading application metrics from Effect programs. A `Metric<Input, State>`
2855
+ * accepts typed input values and aggregates them into a typed state that can be
2856
+ * read directly or exported from a snapshot.
2070
2857
  *
2071
- * The `Metric` module provides a comprehensive system for collecting, aggregating, and observing
2072
- * application metrics in Effect applications. It offers type-safe, concurrent metrics that can
2073
- * be used to monitor performance, track business metrics, and gain insights into application behavior.
2074
- *
2075
- * ## Key Features
2076
- *
2077
- * - **Five Metric Types**: Counters, Gauges, Frequencies, Histograms, and Summaries
2078
- * - **Type Safety**: Fully typed metrics with compile-time guarantees
2079
- * - **Concurrency Safe**: Thread-safe metrics that work with Effect's concurrency model
2080
- * - **Attributes**: Tag metrics with key-value attributes for filtering and grouping
2081
- * - **Snapshots**: Take point-in-time snapshots of all metrics for reporting
2082
- * - **Runtime Integration**: Automatic fiber runtime metrics collection
2858
+ * **Mental model**
2083
2859
  *
2084
- * ## Metric Types
2860
+ * - A metric has an identifier, a type, an optional description, optional attributes, and mutable aggregate state
2861
+ * - Use counters for cumulative values such as requests, errors, retries, or bytes processed
2862
+ * - Use gauges for point-in-time values that can rise or fall, such as active connections or queue size
2863
+ * - Use frequencies to count occurrences of discrete string values, such as status codes or action names
2864
+ * - Use histograms to bucket numeric observations and inspect count, min, max, and sum
2865
+ * - Use summaries to calculate quantiles over a bounded, time-based observation window
2866
+ * - Metrics are updated from effects with {@link update} and {@link modify}, and read with {@link value}
2867
+ * - Attributes tag metrics with key-value dimensions so the same logical metric can be grouped by service, endpoint, method, or other labels
2868
+ * - Snapshots capture the currently registered metrics and their aggregate states for reporting or export
2085
2869
  *
2086
- * ### Counter
2087
- * Tracks cumulative values that only increase or can be reset to zero.
2088
- * Perfect for counting events, requests, errors, etc.
2870
+ * **Common tasks**
2089
2871
  *
2090
- * ### Gauge
2091
- * Represents a single numerical value that can go up or down.
2092
- * Ideal for current resource usage, temperature, queue sizes, etc.
2872
+ * - Create counters: {@link counter}
2873
+ * - Create gauges: {@link gauge}
2874
+ * - Create frequencies: {@link frequency}
2875
+ * - Create histograms: {@link histogram}, {@link linearBoundaries}, {@link exponentialBoundaries}
2876
+ * - Create summaries: {@link summary}, {@link summaryWithTimestamp}
2877
+ * - Measure effect duration: {@link timer}
2878
+ * - Update a metric: {@link update}
2879
+ * - Apply relative updates where supported: {@link modify}
2880
+ * - Read one metric: {@link value}
2881
+ * - Tag a metric: {@link withAttributes}
2882
+ * - Transform accepted input values: {@link mapInput}
2883
+ * - Record a constant input for repeated events: {@link withConstantInput}
2884
+ * - Inspect all registered metrics: {@link snapshot}, {@link dump}
2885
+ * - Enable fiber runtime metrics: {@link enableRuntimeMetrics}
2093
2886
  *
2094
- * ### Frequency
2095
- * Counts occurrences of discrete string values.
2096
- * Useful for tracking categorical data like HTTP status codes, user actions, etc.
2887
+ * **Gotchas**
2097
2888
  *
2098
- * ### Histogram
2099
- * Records observations in configurable buckets to analyze distribution.
2100
- * Great for response times, request sizes, and other measured values.
2889
+ * - Counter and gauge metrics can use `number` inputs by default or `bigint` inputs with the `bigint` option
2890
+ * - Incremental counters ignore negative updates; use non-incremental counters only when decreases are meaningful
2891
+ * - {@link update} sets a gauge to an absolute value, while {@link modify} changes it relative to its current value
2892
+ * - Histogram buckets are cumulative and depend on the boundaries supplied when the metric is created
2893
+ * - Summary quantiles are calculated from the configured sliding window, so old observations expire
2894
+ * - Prefer low-cardinality attributes; using unbounded values such as request IDs can create too many metric series
2101
2895
  *
2102
- * ### Summary
2103
- * Calculates quantiles over a sliding time window.
2104
- * Provides statistical insights into value distributions over time.
2896
+ * **Quickstart**
2105
2897
  *
2106
- * ## Basic Usage
2898
+ * **Example** (Creating and updating metrics)
2107
2899
  *
2108
2900
  * ```ts
2109
2901
  * import { Effect, Metric } from "effect"
2110
2902
  *
2111
- * // Create metrics
2112
2903
  * const requestCount = Metric.counter("http_requests_total", {
2113
2904
  * description: "Total number of HTTP requests"
2114
2905
  * })
@@ -2118,31 +2909,7 @@ export * as Match from "./Match.ts"
2118
2909
  * boundaries: Metric.linearBoundaries({ start: 0, width: 50, count: 20 })
2119
2910
  * })
2120
2911
  *
2121
- * // Use metrics in your application
2122
2912
  * const handleRequest = Effect.gen(function*() {
2123
- * yield* Metric.update(requestCount, 1)
2124
- *
2125
- * const startTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
2126
- *
2127
- * // Process request...
2128
- * yield* Effect.sleep("100 millis")
2129
- *
2130
- * const endTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
2131
- * yield* Metric.update(responseTime, endTime - startTime)
2132
- * })
2133
- * ```
2134
- *
2135
- * ## Attributes and Tagging
2136
- *
2137
- * ```ts
2138
- * import { Effect, Metric } from "effect"
2139
- *
2140
- * const requestCount = Metric.counter("requests", {
2141
- * description: "Number of requests by endpoint and method"
2142
- * })
2143
- *
2144
- * const program = Effect.gen(function*() {
2145
- * // Add attributes to metrics
2146
2913
  * yield* Metric.update(
2147
2914
  * Metric.withAttributes(requestCount, {
2148
2915
  * endpoint: "/api/users",
@@ -2151,57 +2918,21 @@ export * as Match from "./Match.ts"
2151
2918
  * 1
2152
2919
  * )
2153
2920
  *
2154
- * // Or use withAttributes for compile-time attributes
2155
- * const taggedCounter = Metric.withAttributes(requestCount, {
2156
- * endpoint: "/api/posts",
2157
- * method: "POST"
2158
- * })
2159
- * yield* Metric.update(taggedCounter, 1)
2160
- * })
2161
- * ```
2162
- *
2163
- * ## Advanced Examples
2164
- *
2165
- * ```ts
2166
- * import { Effect, Metric } from "effect"
2921
+ * yield* Metric.update(responseTime, 125)
2167
2922
  *
2168
- * // Business metrics
2169
- * const userSignups = Metric.counter("user_signups_total")
2170
- * const activeUsers = Metric.gauge("active_users_current")
2171
- * const featureUsage = Metric.frequency("feature_usage")
2172
- *
2173
- * // Performance metrics
2174
- * const dbQueryTime = Metric.summary("db_query_duration", {
2175
- * maxAge: "5 minutes",
2176
- * maxSize: 1000,
2177
- * quantiles: [0.5, 0.9, 0.95, 0.99]
2923
+ * return yield* Metric.value(requestCount)
2178
2924
  * })
2925
+ * ```
2179
2926
  *
2180
- * const program = Effect.gen(function*() {
2181
- * // Track user signup
2182
- * yield* Metric.update(userSignups, 1)
2183
- *
2184
- * // Update active user count
2185
- * yield* Metric.update(activeUsers, 1250)
2186
- *
2187
- * // Record feature usage
2188
- * yield* Metric.update(featureUsage, "dashboard_view")
2189
- *
2190
- * // Measure database query time
2191
- * yield* Effect.timed(performDatabaseQuery).pipe(
2192
- * Effect.tap(([duration]) => Metric.update(dbQueryTime, duration))
2193
- * )
2194
- * })
2927
+ * **See also**
2195
2928
  *
2196
- * // Get metric snapshots
2197
- * const getMetrics = Effect.gen(function*() {
2198
- * const snapshots = yield* Metric.snapshot
2929
+ * - {@link counter} / {@link gauge} / {@link frequency} for common metric types
2930
+ * - {@link histogram} / {@link summary} for distribution metrics
2931
+ * - {@link update} / {@link modify} / {@link value} for working with metric state
2932
+ * - {@link withAttributes} for adding dimensions
2933
+ * - {@link snapshot} for exporting all registered metric values
2199
2934
  *
2200
- * for (const metric of snapshots) {
2201
- * console.log(`${metric.id}: ${JSON.stringify(metric.state)}`)
2202
- * }
2203
- * })
2204
- * ```
2935
+ * @since 2.0.0
2205
2936
  */
2206
2937
  export * as Metric from "./Metric.ts"
2207
2938
 
@@ -2228,108 +2959,175 @@ export * as Metric from "./Metric.ts"
2228
2959
  * - Size: O(1)
2229
2960
  * - Iteration: O(n)
2230
2961
  *
2231
- * @since 2.0.0
2232
2962
  * @category data-structures
2963
+ * @since 2.0.0
2233
2964
  */
2234
2965
  export * as MutableHashMap from "./MutableHashMap.ts"
2235
2966
 
2236
2967
  /**
2237
- * @fileoverview
2238
- * MutableHashSet is a high-performance, mutable set implementation that provides efficient storage
2239
- * and retrieval of unique values. Built on top of MutableHashMap, it inherits the same performance
2240
- * characteristics and support for both structural and referential equality.
2968
+ * The `MutableHashSet` module provides a mutable hash set for storing unique
2969
+ * values with efficient membership checks, insertion, removal, and iteration.
2970
+ * It is built on {@link MutableHashMap}: each set value is stored as a map key,
2971
+ * so uniqueness follows the same hashing and equality rules as the underlying
2972
+ * mutable hash map.
2241
2973
  *
2242
- * The implementation uses a MutableHashMap internally where each value is stored as a key with a
2243
- * boolean flag, providing O(1) average-case performance for all operations.
2974
+ * **Mental model**
2244
2975
  *
2245
- * Key Features:
2246
- * - Mutable operations for performance-critical scenarios
2247
- * - Supports both structural and referential equality
2248
- * - Efficient duplicate detection and removal
2249
- * - Iterable interface for easy traversal
2250
- * - Memory-efficient storage with automatic deduplication
2251
- * - Seamless integration with Effect's Equal and Hash interfaces
2976
+ * - `MutableHashSet<V>` is a mutable collection of unique values of type `V`
2977
+ * - Operations such as {@link add}, {@link remove}, and {@link clear} mutate
2978
+ * the set in place
2979
+ * - Duplicate values are ignored according to Effect equality and hashing semantics
2980
+ * - Values that implement `Equal` / `Hash` are compared structurally
2981
+ * - Primitive values and references that do not implement Effect equality use
2982
+ * the normal hash map behavior
2983
+ * - The set is iterable, so `Array.from(set)` or `for...of` can be used to
2984
+ * inspect its values
2252
2985
  *
2253
- * Performance Characteristics:
2254
- * - Add/Has/Remove: O(1) average, O(n) worst case (hash collisions)
2255
- * - Clear: O(1)
2256
- * - Size: O(1)
2257
- * - Iteration: O(n)
2986
+ * **Common tasks**
2258
2987
  *
2259
- * @since 2.0.0
2988
+ * - Create an empty set: {@link empty}
2989
+ * - Create from values: {@link make}
2990
+ * - Create from any iterable: {@link fromIterable}
2991
+ * - Add a value: {@link add}
2992
+ * - Check membership: {@link has}
2993
+ * - Remove a value: {@link remove}
2994
+ * - Remove all values: {@link clear}
2995
+ * - Count unique values: {@link size}
2996
+ * - Narrow unknown values: {@link isMutableHashSet}
2997
+ *
2998
+ * **Gotchas**
2999
+ *
3000
+ * - This data structure is intentionally mutable; keep ownership clear when
3001
+ * sharing it between callers
3002
+ * - Mutating operations return the same set instance for convenient piping, not
3003
+ * a copy
3004
+ * - Iteration order should not be used as a stable sorting mechanism
3005
+ * - For immutable set operations, use Effect's immutable collection modules
3006
+ * instead
3007
+ *
3008
+ * **Performance**
3009
+ *
3010
+ * - Add, membership checks, and removal are O(1) on average and O(n) in the
3011
+ * presence of hash collisions
3012
+ * - Clearing and reading the size are O(1)
3013
+ * - Iteration is O(n)
3014
+ *
3015
+ * **Quickstart**
3016
+ *
3017
+ * **Example** (Tracking unique values)
3018
+ *
3019
+ * ```ts
3020
+ * import { MutableHashSet } from "effect"
3021
+ *
3022
+ * const set = MutableHashSet.make("apple", "banana", "apple")
3023
+ *
3024
+ * MutableHashSet.add(set, "cherry")
3025
+ * MutableHashSet.remove(set, "banana")
3026
+ *
3027
+ * console.log(MutableHashSet.has(set, "apple"))
3028
+ * // Output: true
3029
+ *
3030
+ * console.log(MutableHashSet.size(set))
3031
+ * // Output: 2
3032
+ *
3033
+ * console.log(Array.from(set))
3034
+ * // Output: ["apple", "cherry"]
3035
+ * ```
3036
+ *
3037
+ * @fileoverview
2260
3038
  * @category data-structures
3039
+ * @since 2.0.0
2261
3040
  */
2262
3041
  export * as MutableHashSet from "./MutableHashSet.ts"
2263
3042
 
2264
3043
  /**
2265
- * @fileoverview
2266
- * MutableList is an efficient, mutable linked list implementation optimized for high-throughput
2267
- * scenarios like logging, queuing, and streaming. It uses a bucket-based architecture where
2268
- * elements are stored in arrays (buckets) linked together, providing optimal performance for
2269
- * both append and prepend operations.
3044
+ * The `MutableList` module provides a mutable linked list for accumulating,
3045
+ * ordering, inspecting, and draining values with efficient operations at both
3046
+ * ends of the list.
2270
3047
  *
2271
- * The implementation uses a sophisticated bucket system:
2272
- * - Each bucket contains an array of elements with an offset pointer
2273
- * - Buckets can be marked as mutable or immutable for optimization
2274
- * - Elements are taken from the head and added to the tail
2275
- * - Memory is efficiently managed through bucket reuse and cleanup
3048
+ * A `MutableList<A>` stores values in linked buckets of arrays. Appending adds
3049
+ * values to the tail, prepending adds values to the head, and taking removes
3050
+ * values from the head. Unlike persistent collections, every mutation updates
3051
+ * the list object in place: operations such as {@link append}, {@link prepend},
3052
+ * {@link take}, {@link takeN}, {@link clear}, {@link filter}, and {@link remove}
3053
+ * change the same `MutableList` instance and update its `length`.
2276
3054
  *
2277
- * Key Features:
2278
- * - Highly optimized for high-frequency append/prepend operations
2279
- * - Memory efficient with automatic cleanup of consumed elements
2280
- * - Support for bulk operations (appendAll, prependAll, takeN)
2281
- * - Filtering and removal operations
2282
- * - Zero-copy optimizations for certain scenarios
3055
+ * **Mental model**
3056
+ *
3057
+ * - `MutableList<A>` is a stateful container with `head`, `tail`, and `length`
3058
+ * - Values are consumed from the head with {@link take}, {@link takeN}, or
3059
+ * {@link takeAll}
3060
+ * - {@link append} and {@link appendAll} preserve FIFO queue order for normal
3061
+ * producer-consumer use cases
3062
+ * - {@link prepend} and {@link prependAll} place values before the current
3063
+ * contents, which is useful for priority work or restoring items to the front
3064
+ * - {@link toArray} and {@link toArrayN} copy values without modifying the list
3065
+ * - The `head` and `tail` bucket fields are exposed for advanced use, but most
3066
+ * code should treat them as implementation details
3067
+ *
3068
+ * **Common tasks**
3069
+ *
3070
+ * - Create an empty list: {@link make}
3071
+ * - Add one value: {@link append}, {@link prepend}
3072
+ * - Add many values: {@link appendAll}, {@link prependAll}
3073
+ * - Drain one value: {@link take}
3074
+ * - Drain many values: {@link takeN}, {@link takeAll}
3075
+ * - Inspect without draining: {@link toArrayN}, {@link toArray}
3076
+ * - Reset the list: {@link clear}
3077
+ * - Mutate contents in place: {@link filter}, {@link remove}
2283
3078
  *
2284
- * Performance Characteristics:
2285
- * - Append/Prepend: O(1) amortized
2286
- * - Take/TakeN: O(1) per element taken
2287
- * - Length: O(1)
2288
- * - Clear: O(1)
2289
- * - Filter: O(n)
3079
+ * **Gotchas**
2290
3080
  *
2291
- * Ideal Use Cases:
2292
- * - High-throughput logging systems
2293
- * - Producer-consumer queues
2294
- * - Streaming data buffers
2295
- * - Real-time data processing pipelines
3081
+ * - `MutableList` is intentionally mutable; sharing a list means sharing its
3082
+ * changing state
3083
+ * - {@link take} returns the {@link Empty} symbol when the list has no value, so
3084
+ * compare with `MutableList.Empty` instead of relying on falsy checks
3085
+ * - {@link appendAllUnsafe} and {@link prependAllUnsafe} may reuse the provided
3086
+ * array when `mutable` is `true`; only enable that optimization when callers
3087
+ * will not keep using the array independently
3088
+ * - {@link remove} uses JavaScript strict equality semantics, not structural
3089
+ * equality
2296
3090
  *
2297
- * @since 4.0.0
3091
+ * @fileoverview
2298
3092
  * @category data-structures
3093
+ * @since 4.0.0
2299
3094
  */
2300
3095
  export * as MutableList from "./MutableList.ts"
2301
3096
 
2302
3097
  /**
2303
- * @fileoverview
2304
- * MutableRef provides a mutable reference container that allows safe mutation of values
2305
- * in functional programming contexts. It serves as a bridge between functional and imperative
2306
- * programming paradigms, offering atomic operations for state management.
3098
+ * The `MutableRef` module provides a small synchronous container for mutable
3099
+ * state. A `MutableRef<A>` stores one current value of type `A`, exposes that
3100
+ * value through `.current`, and offers pipeable helpers for reading, replacing,
3101
+ * and transforming the value in place.
3102
+ *
3103
+ * **Mental model**
2307
3104
  *
2308
- * Unlike regular variables, MutableRef encapsulates mutable state and provides controlled
2309
- * access through a standardized API. It supports atomic compare-and-set operations for
2310
- * thread-safe updates and integrates seamlessly with Effect's ecosystem.
3105
+ * - `MutableRef<A>` is a stable reference whose `.current` field may change over time
3106
+ * - Reads and writes are synchronous and return immediately
3107
+ * - `set`, `update`, `increment`, `decrement`, and `toggle` mutate the same reference in place
3108
+ * - `getAnd*` helpers return the previous value, while `*AndGet` helpers return the new value
3109
+ * - `compareAndSet` updates only when the current value is equal to the expected value using `Equal.equals`
3110
+ * - A `MutableRef` is useful for local mutable state, but it does not make updates transactional or effectful
2311
3111
  *
2312
- * Key Features:
2313
- * - Mutable reference semantics with functional API
2314
- * - Atomic compare-and-set operations for safe concurrent updates
2315
- * - Specialized operations for numeric and boolean values
2316
- * - Chainable operations that return the reference or the value
2317
- * - Integration with Effect's Equal interface for value comparison
2318
- *
2319
- * Common Use Cases:
2320
- * - State containers in functional applications
2321
- * - Counters and accumulators
2322
- * - Configuration that needs to be updated at runtime
2323
- * - Caching and memoization scenarios
2324
- * - Inter-module communication via shared references
3112
+ * **Common tasks**
2325
3113
  *
2326
- * Performance Characteristics:
2327
- * - Get/Set: O(1)
2328
- * - Compare-and-set: O(1)
2329
- * - All operations: O(1)
3114
+ * - Create a reference: {@link make}
3115
+ * - Read the current value: {@link get} or `.current`
3116
+ * - Replace the current value: {@link set}, {@link setAndGet}, {@link getAndSet}
3117
+ * - Transform the current value: {@link update}, {@link updateAndGet}, {@link getAndUpdate}
3118
+ * - Coordinate conditional replacement: {@link compareAndSet}
3119
+ * - Work with counters: {@link increment}, {@link decrement}, {@link incrementAndGet}, {@link decrementAndGet}
3120
+ * - Work with boolean flags: {@link toggle}
3121
+ *
3122
+ * **Gotchas**
3123
+ *
3124
+ * - All updates are imperative mutations; aliases to the same `MutableRef` observe the same changing value
3125
+ * - Updating object or array values does not clone them unless the update function creates a new value
3126
+ * - `compareAndSet` compares with Effect equality semantics, not only JavaScript reference equality
3127
+ * - For state that must participate in `Effect` workflows, interruption, or fiber coordination, prefer higher-level Effect data types
2330
3128
  *
2331
- * @since 2.0.0
2332
3129
  * @category data-structures
3130
+ * @since 2.0.0
2333
3131
  */
2334
3132
  export * as MutableRef from "./MutableRef.ts"
2335
3133
 
@@ -2401,28 +3199,36 @@ export * as MutableRef from "./MutableRef.ts"
2401
3199
  export * as Newtype from "./Newtype.ts"
2402
3200
 
2403
3201
  /**
2404
- * @since 2.0.0
3202
+ * The `NonEmptyIterable` module provides a type-level representation of any
3203
+ * JavaScript `Iterable` that is known to contain at least one element. A
3204
+ * `NonEmptyIterable<A>` can be consumed anywhere an `Iterable<A>` is expected,
3205
+ * while also carrying the guarantee that reading the first element is safe.
2405
3206
  *
2406
- * The `NonEmptyIterable` module provides types and utilities for working with iterables
2407
- * that are guaranteed to contain at least one element. This provides compile-time
2408
- * safety when working with collections that must not be empty.
3207
+ * **Mental model**
2409
3208
  *
2410
- * ## Key Features
3209
+ * - `NonEmptyIterable<A>` is an `Iterable<A>` branded with a non-empty guarantee
3210
+ * - The guarantee is static: values should only be typed this way when construction or validation proves at least one element exists
3211
+ * - The iterable can be an array, string, set, map, generator, or any custom iterable
3212
+ * - `unprepend` safely separates the first element from an iterator for the remaining elements
3213
+ * - Operations that may remove elements, such as filtering, usually return ordinary collections because they can become empty
2411
3214
  *
2412
- * - **Type Safety**: Compile-time guarantee that the iterable contains at least one element
2413
- * - **Iterator Protocol**: Fully compatible with JavaScript's built-in iteration protocol
2414
- * - **Functional Operations**: Safe operations that preserve the non-empty property
2415
- * - **Lightweight**: Minimal overhead with maximum type safety
3215
+ * **Common tasks**
3216
+ *
3217
+ * - Accept inputs that must contain at least one value
3218
+ * - Extract a head element and process the remaining iterator with {@link unprepend}
3219
+ * - Model APIs such as reductions, comparisons, or aggregation that are undefined for empty inputs
3220
+ * - Preserve compatibility with the JavaScript iteration protocol while documenting the stronger invariant
3221
+ *
3222
+ * **Gotchas**
2416
3223
  *
2417
- * ## Why NonEmptyIterable?
3224
+ * - A type assertion does not make an empty iterable non-empty; only assert after a trusted check or constructor
3225
+ * - Iterators are stateful, so calling {@link unprepend} consumes the first yielded value from that iterator
3226
+ * - The order of the first element follows the source iterable's iteration order, for example insertion order for `Map` and `Set`
3227
+ * - Some transformations preserve non-emptiness, but transformations that can discard elements must account for the empty case
2418
3228
  *
2419
- * Many operations require non-empty collections to be meaningful:
2420
- * - Finding the maximum or minimum value
2421
- * - Getting the first or last element
2422
- * - Reducing without an initial value
2423
- * - Operations that would otherwise need runtime checks
3229
+ * **Quickstart**
2424
3230
  *
2425
- * ## Basic Usage
3231
+ * **Example** (Requiring a non-empty iterable)
2426
3232
  *
2427
3233
  * ```ts
2428
3234
  * import * as NonEmptyIterable from "effect/NonEmptyIterable"
@@ -2460,6 +3266,8 @@ export * as Newtype from "./Newtype.ts"
2460
3266
  *
2461
3267
  * ## Working with Different Iterable Types
2462
3268
  *
3269
+ * **Example** (Adapting iterable inputs)
3270
+ *
2463
3271
  * ```ts
2464
3272
  * import { Array } from "effect"
2465
3273
  *
@@ -2505,10 +3313,11 @@ export * as Newtype from "./Newtype.ts"
2505
3313
  *
2506
3314
  * ## Integration with Effect Arrays
2507
3315
  *
3316
+ * **Example** (Processing non-empty iterables with Array)
3317
+ *
2508
3318
  * ```ts
2509
3319
  * import { Array, pipe } from "effect"
2510
3320
  * import type * as NonEmptyIterable from "effect/NonEmptyIterable"
2511
- * import type * as NonEmptyIterable from "effect/NonEmptyIterable"
2512
3321
  *
2513
3322
  * // Many Array functions work with NonEmptyIterable
2514
3323
  * declare const nonEmptyData: NonEmptyIterable.NonEmptyIterable<number>
@@ -2529,6 +3338,8 @@ export * as Newtype from "./Newtype.ts"
2529
3338
  * // This would still be non-empty if the source was non-empty
2530
3339
  * )
2531
3340
  * ```
3341
+ *
3342
+ * @since 2.0.0
2532
3343
  */
2533
3344
  export * as NonEmptyIterable from "./NonEmptyIterable.ts"
2534
3345
 
@@ -2634,7 +3445,6 @@ export * as Number from "./Number.ts"
2634
3445
  * - {@link some} / {@link success} / {@link failure} — built-in prisms
2635
3446
  *
2636
3447
  * @since 4.0.0
2637
- * @module
2638
3448
  */
2639
3449
  export * as Optic from "./Optic.ts"
2640
3450
 
@@ -2710,7 +3520,6 @@ export * as Optic from "./Optic.ts"
2710
3520
  * - {@link gen} for generator-based syntax
2711
3521
  *
2712
3522
  * @since 2.0.0
2713
- * @module
2714
3523
  */
2715
3524
  export * as Option from "./Option.ts"
2716
3525
 
@@ -2768,55 +3577,207 @@ export * as Option from "./Option.ts"
2768
3577
  export * as Order from "./Order.ts"
2769
3578
 
2770
3579
  /**
2771
- * @fileoverview
2772
- * The Ordering module provides utilities for working with comparison results and ordering operations.
2773
- * An Ordering represents the result of comparing two values, expressing whether the first value is
2774
- * less than (-1), equal to (0), or greater than (1) the second value.
3580
+ * The `Ordering` module provides the standard representation for the result of
3581
+ * comparing two values. An `Ordering` is one of three numeric literals: `-1`
3582
+ * when the first value is less than the second, `0` when both values compare as
3583
+ * equal, and `1` when the first value is greater than the second.
3584
+ *
3585
+ * **Mental model**
2775
3586
  *
2776
- * This module is fundamental for building comparison functions, sorting algorithms, and implementing
2777
- * ordered data structures. It provides composable operations for combining multiple comparison results
2778
- * and pattern matching on ordering outcomes.
3587
+ * - `Ordering` describes the relationship between two compared values, not the
3588
+ * values themselves
3589
+ * - Negative means "less than", zero means "equal", and positive means "greater
3590
+ * than"
3591
+ * - Unlike JavaScript comparators, this type is normalized to exactly `-1`, `0`,
3592
+ * or `1`
3593
+ * - `0` is neutral when combining comparisons; the first non-zero ordering
3594
+ * determines the result
2779
3595
  *
2780
- * Key Features:
2781
- * - Type-safe representation of comparison results (-1, 0, 1)
2782
- * - Composable operations for combining multiple orderings
2783
- * - Pattern matching utilities for handling different ordering cases
2784
- * - Ordering reversal and combination functions
2785
- * - Integration with Effect's functional programming patterns
2786
- *
2787
- * Common Use Cases:
2788
- * - Implementing custom comparison functions
2789
- * - Building complex sorting criteria
2790
- * - Combining multiple comparison results
2791
- * - Creating ordered data structures
2792
- * - Pattern matching on comparison outcomes
3596
+ * **Common tasks**
2793
3597
  *
2794
- * @since 2.0.0
3598
+ * - Interpret a comparison result with {@link match}
3599
+ * - Reverse ascending and descending order with {@link reverse}
3600
+ * - Combine multiple comparison criteria with {@link Reducer}
3601
+ * - Build custom comparison functions for sorting, ordered collections, and
3602
+ * domain-specific ordering rules
3603
+ *
3604
+ * **Gotchas**
3605
+ *
3606
+ * - Do not cast arbitrary comparator results such as `a.localeCompare(b)`
3607
+ * directly unless they have been normalized to `-1`, `0`, or `1`
3608
+ * - In comparator-style APIs, `-1` means the left value should come before the
3609
+ * right value, while `1` means it should come after
3610
+ * - Reversing an `Ordering` swaps `-1` and `1`, but leaves `0` unchanged
3611
+ *
3612
+ * @fileoverview
2795
3613
  * @category utilities
3614
+ * @since 2.0.0
2796
3615
  */
2797
3616
  export * as Ordering from "./Ordering.ts"
2798
3617
 
2799
3618
  /**
3619
+ * The `PartitionedSemaphore` module provides a semaphore for limiting
3620
+ * concurrency across a shared permit pool while keeping waiters grouped by
3621
+ * partition key. A `PartitionedSemaphore<K>` is useful when many independent
3622
+ * groups of work compete for the same bounded resource and each group should
3623
+ * make progress without one busy group monopolizing released permits.
3624
+ *
3625
+ * **Mental model**
3626
+ *
3627
+ * - The semaphore has a fixed shared capacity measured in permits
3628
+ * - Work acquires permits with a partition key of type `K`
3629
+ * - Waiting acquisitions are tracked per partition
3630
+ * - Released permits are assigned to waiting partitions in round-robin order
3631
+ * - `withPermit` and `withPermits` acquire permits around an effect and
3632
+ * release them when the effect exits, fails, or is interrupted
3633
+ *
3634
+ * **Common tasks**
3635
+ *
3636
+ * - Create a semaphore: {@link make}, {@link makeUnsafe}
3637
+ * - Inspect capacity and availability: {@link capacity}, {@link available}
3638
+ * - Acquire and release manually: {@link take}, {@link release}
3639
+ * - Limit a single operation per partition: {@link withPermit}
3640
+ * - Limit weighted work per partition: {@link withPermits}
3641
+ * - Run only when permits are immediately available:
3642
+ * {@link withPermitsIfAvailable}
3643
+ *
3644
+ * **Gotchas**
3645
+ *
3646
+ * - `withPermitsIfAvailable` does not use a partition key; it only succeeds
3647
+ * when the shared pool has enough permits immediately
3648
+ * - Acquiring more permits than the semaphore capacity never completes
3649
+ * - Requests for zero or negative permits complete without acquiring anything
3650
+ * - Non-finite capacities create an unbounded semaphore whose acquire and
3651
+ * release operations complete immediately
3652
+ *
2800
3653
  * @since 4.0.0
2801
3654
  */
2802
3655
  export * as PartitionedSemaphore from "./PartitionedSemaphore.ts"
2803
3656
 
2804
3657
  /**
3658
+ * The `Path` module provides a platform path service for manipulating file
3659
+ * system paths through Effect's environment. It models path operations as a
3660
+ * replaceable service so programs can depend on path behavior without directly
3661
+ * coupling to a particular runtime implementation.
3662
+ *
3663
+ * **Mental model**
3664
+ *
3665
+ * - `Path.Path` is a `Context.Service` tag used to access the current path implementation
3666
+ * - The service offers familiar path operations such as joining, resolving, parsing, and formatting
3667
+ * - Most operations are pure string transformations and follow POSIX-style path semantics
3668
+ * - File URL conversions return `Effect`s because invalid paths or URLs can fail with `BadArgument`
3669
+ * - Custom implementations can be provided with `Layer.succeed` for alternate platforms or tests
3670
+ *
3671
+ * **Common tasks**
3672
+ *
3673
+ * - Combine path segments with `join` or turn segments into an absolute path with `resolve`
3674
+ * - Normalize `.` and `..` segments with `normalize`
3675
+ * - Inspect paths with `basename`, `dirname`, `extname`, and `isAbsolute`
3676
+ * - Convert between structured path parts and strings with `parse` and `format`
3677
+ * - Compute relative paths with `relative`
3678
+ * - Convert between file paths and `file:` URLs with `toFileUrl` and `fromFileUrl`
3679
+ *
3680
+ * **Gotchas**
3681
+ *
3682
+ * - Path strings are not checked against the file system; these operations only manipulate syntax
3683
+ * - `resolve` may consult the host current working directory when no absolute segment is supplied
3684
+ * - `fromFileUrl` only accepts valid `file:` URLs and rejects encoded path separators
3685
+ * - Use the service from the environment when writing portable Effect code instead of importing
3686
+ * host-specific path APIs directly
3687
+ *
2805
3688
  * @since 4.0.0
2806
3689
  */
2807
3690
  export * as Path from "./Path.ts"
2808
3691
 
2809
3692
  /**
3693
+ * The `Pipeable` module defines the shared interface and implementation helpers
3694
+ * for values that support Effect-style method chaining with `.pipe(...)`.
3695
+ *
3696
+ * A `Pipeable` value can pass itself through a sequence of unary functions from
3697
+ * left to right, so code can be written as `value.pipe(f, g, h)` instead of
3698
+ * deeply nesting calls. This is the method form used by many Effect data types
3699
+ * to compose transformations, validations, and effectful operations while
3700
+ * keeping the original value as the starting point of the pipeline.
3701
+ *
3702
+ * **Common tasks**
3703
+ *
3704
+ * - Type values that expose a `.pipe(...)` method with the {@link Pipeable} interface
3705
+ * - Implement a custom `.pipe(...)` method with {@link pipeArguments}
3706
+ * - Reuse the standard implementation through {@link Prototype}, {@link Class}, or {@link Mixin}
3707
+ *
3708
+ * **Gotchas**
3709
+ *
3710
+ * - Each function receives the result of the previous function, not the original value
3711
+ * - The overloads preserve precise types for long pipelines, but very long chains may be easier to read when split
3712
+ *
2810
3713
  * @since 2.0.0
2811
3714
  */
2812
3715
  export * as Pipeable from "./Pipeable.ts"
2813
3716
 
2814
3717
  /**
3718
+ * The `PlatformError` module defines the normalized error model used by
3719
+ * platform APIs when adapting host operations into Effect programs. It gives
3720
+ * callers a stable `PlatformError` wrapper whose `reason` is either a
3721
+ * `BadArgument`, for invalid inputs rejected before an operation runs, or a
3722
+ * `SystemError`, for failures reported by the host platform or operating
3723
+ * system.
3724
+ *
3725
+ * Use this module when implementing or consuming platform services such as
3726
+ * file systems, terminal access, sockets, or other environment-specific APIs.
3727
+ * `SystemError` intentionally groups many low-level failures into a small set
3728
+ * of portable tags like `NotFound`, `PermissionDenied`, and `TimedOut`, while
3729
+ * still preserving operation details such as the module, method, syscall, path
3730
+ * or descriptor, description, and original cause when available.
3731
+ *
3732
+ * **Common tasks**
3733
+ *
3734
+ * - Create platform failures from system operations with {@link systemError}
3735
+ * - Report rejected caller input with {@link badArgument}
3736
+ * - Inspect the underlying reason via {@link PlatformError.reason}
3737
+ * - Match normalized system failures with {@link SystemErrorTag}
3738
+ *
3739
+ * **Gotchas**
3740
+ *
3741
+ * - `PlatformError` is a wrapper; inspect `reason` to distinguish
3742
+ * `BadArgument` from `SystemError`
3743
+ * - `SystemErrorTag` values are normalized categories, not necessarily raw
3744
+ * platform error codes
3745
+ * - The original cause is preserved when provided, but portable handling
3746
+ * should rely on the normalized fields
3747
+ *
2815
3748
  * @since 4.0.0
2816
3749
  */
2817
3750
  export * as PlatformError from "./PlatformError.ts"
2818
3751
 
2819
3752
  /**
3753
+ * The `Pool` module provides scoped resource pools for sharing expensive or
3754
+ * limited resources across fibers. A `Pool<A, E>` manages values of type `A`
3755
+ * acquired by an effect that may fail with `E`, automatically releasing all
3756
+ * allocated resources when the surrounding `Scope` closes.
3757
+ *
3758
+ * **Mental model**
3759
+ *
3760
+ * - A pool owns a bounded set of acquired items and hands them out with {@link get}
3761
+ * - Each checkout is scoped; leaving the scope returns the item to the pool
3762
+ * - `concurrency` controls how many fibers may use the same item at once
3763
+ * - `targetUtilization` controls when the pool grows between its minimum and maximum sizes
3764
+ * - {@link invalidate} removes a specific item so it can be replaced lazily
3765
+ *
3766
+ * **Common tasks**
3767
+ *
3768
+ * - Create a fixed-size pool with {@link make}
3769
+ * - Create an elastic pool with time-to-live reclamation using {@link makeWithTTL}
3770
+ * - Implement custom resizing and reclamation behavior with {@link makeWithStrategy}
3771
+ * - Borrow resources safely in scoped effects with {@link get}
3772
+ *
3773
+ * **Gotchas**
3774
+ *
3775
+ * - Pool construction and item checkout require `Scope`; closing the scope shuts
3776
+ * down the pool or returns the borrowed item
3777
+ * - Failed acquisitions are represented by the `get` effect failing with the
3778
+ * acquisition error, and retrying `get` can retry acquisition
3779
+ * - Resource finalization order during shutdown is unspecified
3780
+ *
2820
3781
  * @since 2.0.0
2821
3782
  */
2822
3783
  export * as Pool from "./Pool.ts"
@@ -2884,20 +3845,22 @@ export * as PrimaryKey from "./PrimaryKey.ts"
2884
3845
  * can subscribe to receive those messages. PubSub supports various backpressure strategies,
2885
3846
  * message replay, and concurrent access from multiple producers and consumers.
2886
3847
  *
2887
- * @example
3848
+ * **Example** (Creating and using a PubSub)
3849
+ *
2888
3850
  * ```ts
2889
3851
  * import { Effect, PubSub } from "effect"
2890
3852
  *
2891
3853
  * const program = Effect.gen(function*() {
2892
3854
  * const pubsub = yield* PubSub.bounded<string>(10)
2893
3855
  *
2894
- * // Publisher
2895
- * yield* PubSub.publish(pubsub, "Hello")
2896
- * yield* PubSub.publish(pubsub, "World")
2897
- *
2898
- * // Subscriber
2899
3856
  * yield* Effect.scoped(Effect.gen(function*() {
2900
3857
  * const subscription = yield* PubSub.subscribe(pubsub)
3858
+ *
3859
+ * // Publisher
3860
+ * yield* PubSub.publish(pubsub, "Hello")
3861
+ * yield* PubSub.publish(pubsub, "World")
3862
+ *
3863
+ * // Subscriber
2901
3864
  * const message1 = yield* PubSub.take(subscription)
2902
3865
  * const message2 = yield* PubSub.take(subscription)
2903
3866
  * console.log(message1, message2) // "Hello", "World"
@@ -2910,21 +3873,108 @@ export * as PrimaryKey from "./PrimaryKey.ts"
2910
3873
  export * as PubSub from "./PubSub.ts"
2911
3874
 
2912
3875
  /**
3876
+ * The `Pull` module provides the low-level pull-step abstraction used by
3877
+ * stream-like consumers. A `Pull<A, E, Done, R>` is an `Effect` that can
3878
+ * produce one value of type `A`, fail with an ordinary error `E`, or signal
3879
+ * end-of-input with a `Cause.Done<Done>` value.
3880
+ *
3881
+ * **Mental model**
3882
+ *
3883
+ * - `Pull` is an `Effect` with a distinguished completion signal in the error channel
3884
+ * - ordinary failures and completion are both represented by `Cause`, but can be separated with the helpers in this module
3885
+ * - the `Done` value can carry leftover state or a final value needed by a downstream consumer
3886
+ * - `Pull` is useful when repeatedly evaluating an effect until it either produces values, fails, or reports that no more input is available
3887
+ *
3888
+ * **Common tasks**
3889
+ *
3890
+ * - Extract type parameters from a pull: {@link Success}, {@link Error}, {@link Leftover}, {@link Services}
3891
+ * - Detect and filter completion: {@link isDoneCause}, {@link filterDone}, {@link filterNoDone}
3892
+ * - Recover from completion while preserving ordinary failures: {@link catchDone}
3893
+ * - Convert done causes to successful exits: {@link doneExitFromCause}
3894
+ * - Handle all outcomes explicitly: {@link matchEffect}
3895
+ *
3896
+ * **Gotchas**
3897
+ *
3898
+ * - `Cause.Done` is not an ordinary failure; use this module's helpers before treating a pull failure as an error
3899
+ * - `Done` lives in the error channel, so generic `Effect` error handling can catch it unless you filter it deliberately
3900
+ * - `Pull` is a low-level primitive; most user-facing stream workflows should prefer higher-level stream APIs when available
3901
+ *
2913
3902
  * @since 4.0.0
2914
3903
  */
2915
3904
  export * as Pull from "./Pull.ts"
2916
3905
 
2917
3906
  /**
3907
+ * The `Queue` module provides asynchronous queues for communicating between
3908
+ * fibers. A `Queue<A, E>` can receive values of type `A`, deliver them to
3909
+ * consumers in order, and eventually complete or fail with an error of type
3910
+ * `E`.
3911
+ *
3912
+ * **Mental model**
3913
+ *
3914
+ * - A queue is a fiber-aware channel with one write side ({@link Enqueue}) and
3915
+ * one read side ({@link Dequeue})
3916
+ * - Producers add values with {@link offer} or {@link offerAll}; consumers
3917
+ * remove values with {@link take}, {@link takeN}, {@link takeBetween}, or
3918
+ * {@link takeAll}
3919
+ * - Bounded queues use an overflow strategy: {@link bounded} suspends
3920
+ * producers, {@link dropping} rejects new values, and {@link sliding} drops
3921
+ * old values
3922
+ * - Queues can be completed with {@link end}, failed with {@link fail} or
3923
+ * {@link failCause}, interrupted with {@link interrupt}, and shut down with
3924
+ * {@link shutdown}
3925
+ * - Operations are expressed as `Effect` values so waiting producers and
3926
+ * consumers compose with interruption, scheduling, and structured
3927
+ * concurrency
3928
+ *
3929
+ * **Common tasks**
3930
+ *
3931
+ * - Create queues: {@link make}, {@link bounded}, {@link dropping},
3932
+ * {@link sliding}, {@link unbounded}
3933
+ * - Restrict capabilities: {@link asEnqueue}, {@link asDequeue}
3934
+ * - Produce values: {@link offer}, {@link offerAll}
3935
+ * - Consume values: {@link take}, {@link takeN}, {@link takeBetween},
3936
+ * {@link takeAll}, {@link poll}, {@link peek}
3937
+ * - Drain or reset buffered values: {@link collect}, {@link clear}
3938
+ * - Signal lifecycle: {@link end}, {@link fail}, {@link failCause},
3939
+ * {@link interrupt}, {@link shutdown}
3940
+ * - Inspect state: {@link size}, {@link isFull}
3941
+ *
3942
+ * **Gotchas**
3943
+ *
3944
+ * - `take` waits when the queue is empty; use {@link poll} when absence should
3945
+ * be represented as `Option.None`
3946
+ * - `dropping` and `sliding` queues can lose values by design; use
3947
+ * {@link bounded} when every offered value must be preserved
3948
+ * - Completion and failure are observed by consumers through the queue's error
3949
+ * channel, so include `Cause.Done` in the error type when using {@link end}
3950
+ * - The `Unsafe` variants are synchronous, low-level operations; prefer the
3951
+ * effectful APIs in application code
3952
+ *
3953
+ * **See also**
3954
+ *
3955
+ * - {@link Enqueue} for write-only queue handles
3956
+ * - {@link Dequeue} for read-only queue handles
3957
+ * - {@link Pull} for stream-style completion errors
3958
+ *
2918
3959
  * @since 3.8.0
2919
3960
  */
2920
3961
  export * as Queue from "./Queue.ts"
2921
3962
 
2922
3963
  /**
2923
- * The Random module provides a service for generating random numbers in Effect
2924
- * programs. It offers a testable and composable way to work with randomness,
2925
- * supporting integers, floating-point numbers, and range-based generation.
3964
+ * The `Random` module provides a service for generating pseudo-random numbers
3965
+ * in Effect programs. It offers a testable and composable way to work with
3966
+ * randomness, supporting integers, floating-point numbers, and range-based
3967
+ * generation.
3968
+ *
3969
+ * The default `Random` service is not cryptographically secure. Do not use it
3970
+ * for secrets, tokens, UUIDs, session identifiers, or other security-sensitive
3971
+ * values. For cryptographically secure random generation, replace the service
3972
+ * with a cryptographically secure implementation such as the platform `Crypto`
3973
+ * service. `Random.withSeed` also replaces the service, but predictable seeds
3974
+ * remain deterministic and must not be treated as cryptographically secure.
3975
+ *
3976
+ * **Example** (Generating random values)
2926
3977
  *
2927
- * @example
2928
3978
  * ```ts
2929
3979
  * import { Effect, Random } from "effect"
2930
3980
  *
@@ -2945,11 +3995,45 @@ export * as Queue from "./Queue.ts"
2945
3995
  export * as Random from "./Random.ts"
2946
3996
 
2947
3997
  /**
3998
+ * The `RcMap` module provides a scoped, reference-counted map for sharing
3999
+ * resources by key. It is useful when many fibers may request the same
4000
+ * resource, such as a connection, client, session, or cached handle, and the
4001
+ * resource should be acquired once, reused while it has active references, and
4002
+ * released automatically when it is no longer needed.
4003
+ *
4004
+ * Each key is resolved with a user-provided lookup effect on first access via
4005
+ * {@link get}. Further accesses to the same key share the in-flight or acquired
4006
+ * resource and increment its reference count for the caller's current
4007
+ * `Scope`. When those scopes close, references are released; resources can be
4008
+ * closed immediately, kept alive for an idle time-to-live, invalidated
4009
+ * explicitly, or bounded by a maximum capacity.
4010
+ *
4011
+ * `RcMap` is designed for Effect resource lifecycles rather than general
4012
+ * mutable caching. The map itself is scoped, lookups require a `Scope`, and
4013
+ * complex keys should provide `Equal` / `Hash` behavior when they need
4014
+ * value-based lookup semantics.
4015
+ *
2948
4016
  * @since 3.5.0
2949
4017
  */
2950
4018
  export * as RcMap from "./RcMap.ts"
2951
4019
 
2952
4020
  /**
4021
+ * The `RcRef` module provides reference-counted access to a shared resource
4022
+ * whose lifecycle is managed by `Scope`. An `RcRef<A, E>` lazily acquires its
4023
+ * resource the first time it is requested, shares that resource across active
4024
+ * users, and releases it when the final scope holding a reference closes.
4025
+ *
4026
+ * Use `RcRef` when several scoped operations should reuse the same expensive
4027
+ * or stateful resource, such as a connection, client, cache, or worker, without
4028
+ * making each operation acquire and release its own copy. `make` defines how
4029
+ * the resource is acquired, `get` borrows the current resource for the active
4030
+ * scope, and `invalidate` forces a future `get` to acquire a fresh resource.
4031
+ *
4032
+ * The resource is tied to scopes rather than ordinary object reachability:
4033
+ * every `get` must run with a `Scope`, and the reference count is decremented
4034
+ * when that scope closes. If `idleTimeToLive` is configured, a resource whose
4035
+ * reference count reaches zero can remain cached briefly before release.
4036
+ *
2953
4037
  * @since 3.5.0
2954
4038
  */
2955
4039
  export * as RcRef from "./RcRef.ts"
@@ -3118,7 +4202,8 @@ export * as Reducer from "./Reducer.ts"
3118
4202
  * mutable variables, Refs are thread-safe and work seamlessly with Effect's concurrency model.
3119
4203
  * They provide atomic operations for safe state management in concurrent programs.
3120
4204
  *
3121
- * @example
4205
+ * **Example** (Managing shared state with refs)
4206
+ *
3122
4207
  * ```ts
3123
4208
  * import { Effect, Ref } from "effect"
3124
4209
  *
@@ -3182,11 +4267,86 @@ export * as RegExp from "./RegExp.ts"
3182
4267
  export * as Request from "./Request.ts"
3183
4268
 
3184
4269
  /**
4270
+ * The `RequestResolver` module provides the data-loading side of
4271
+ * `Effect.request`. A `Request` describes what a fiber needs, while a
4272
+ * `RequestResolver` describes how to collect, batch, execute, cache, trace,
4273
+ * and complete those requests.
4274
+ *
4275
+ * **Mental model**
4276
+ *
4277
+ * - A resolver receives one or more `Request.Entry` values and must complete
4278
+ * each entry with either a success or failure
4279
+ * - Concurrent requests made with the same resolver can be gathered into a
4280
+ * batch before the resolver is run
4281
+ * - Batch keys split pending requests into independent groups, which is useful
4282
+ * when different backends, tenants, or query shapes must be resolved
4283
+ * separately
4284
+ * - Delays and `batchN` tune how long requests are collected and how large
4285
+ * each batch may become
4286
+ * - Resolvers can be wrapped with tracing, in-memory caching, cache services,
4287
+ * and persistence without changing the request type
4288
+ *
4289
+ * **Common tasks**
4290
+ *
4291
+ * - Create a resolver from batch logic: {@link make}
4292
+ * - Create grouped batch logic: {@link makeGrouped} or {@link grouped}
4293
+ * - Create a resolver from pure logic: {@link fromFunction} or
4294
+ * {@link fromFunctionBatched}
4295
+ * - Create a resolver from effectful logic: {@link fromEffect} or
4296
+ * {@link fromEffectTagged}
4297
+ * - Control batching: {@link setDelay}, {@link setDelayEffect},
4298
+ * {@link batchN}
4299
+ * - Add operational behavior: {@link around}, {@link race}, {@link withSpan}
4300
+ * - Reuse results: {@link withCache}, {@link asCache}, {@link persisted}
4301
+ *
4302
+ * **Gotchas**
4303
+ *
4304
+ * - Every entry passed to a resolver must be completed; leaving an entry
4305
+ * incomplete causes the waiting request to fail
4306
+ * - Batched result collections must line up with the input entries in order
4307
+ * and length when using the batched helper constructors
4308
+ * - Grouping controls which requests share a resolver run; choose stable keys
4309
+ * for requests that can safely be handled together
4310
+ * - Caching and persistence depend on request identity and the request's
4311
+ * equality semantics, so model request values deliberately when cached
4312
+ *
3185
4313
  * @since 2.0.0
3186
4314
  */
3187
4315
  export * as RequestResolver from "./RequestResolver.ts"
3188
4316
 
3189
4317
  /**
4318
+ * The `Resource` module provides refreshable, scoped values. A
4319
+ * `Resource<A, E>` stores the latest successful or failed acquisition result and
4320
+ * can be read with {@link get}, refreshed manually with {@link refresh}, or
4321
+ * refreshed automatically with {@link auto}.
4322
+ *
4323
+ * **Mental model**
4324
+ *
4325
+ * - A `Resource` wraps an acquisition `Effect` whose result is kept in a
4326
+ * `ScopedRef`
4327
+ * - Each refresh re-runs acquisition and replaces the stored `Exit`
4328
+ * - Replacing the stored value releases resources associated with the previous
4329
+ * scoped value
4330
+ * - Reading a resource returns the current acquired value or fails with the
4331
+ * current acquisition error
4332
+ *
4333
+ * **Common tasks**
4334
+ *
4335
+ * - Create a manually refreshed resource with {@link manual}
4336
+ * - Create a schedule-driven resource with {@link auto}
4337
+ * - Read the current value with {@link get}
4338
+ * - Force a reload with {@link refresh}
4339
+ * - Check whether an unknown value is a resource with {@link isResource}
4340
+ *
4341
+ * **Gotchas**
4342
+ *
4343
+ * - Creating a resource requires a `Scope`; when the scope closes, scoped
4344
+ * values held by the resource are released
4345
+ * - Failed acquisitions are stored too, so subsequent {@link get} calls fail
4346
+ * until a refresh succeeds
4347
+ * - Automatic refreshes run in the resource scope and stop when that scope is
4348
+ * closed
4349
+ *
3190
4350
  * @since 2.0.0
3191
4351
  */
3192
4352
  export * as Resource from "./Resource.ts"
@@ -3269,7 +4429,8 @@ export * as Result from "./Result.ts"
3269
4429
  * teardown, error reporting, and exit code management. These utilities are particularly useful
3270
4430
  * for creating CLI applications and server processes that need to manage their lifecycle properly.
3271
4431
  *
3272
- * @example
4432
+ * **Example** (Creating a main runner)
4433
+ *
3273
4434
  * ```ts
3274
4435
  * import { Effect, Fiber, Runtime } from "effect"
3275
4436
  *
@@ -3300,7 +4461,8 @@ export * as Runtime from "./Runtime.ts"
3300
4461
  * along with a delay duration. Schedules can be combined, transformed, and used to implement
3301
4462
  * sophisticated retry and repetition logic.
3302
4463
  *
3303
- * @example
4464
+ * **Example** (Retrying and repeating effects)
4465
+ *
3304
4466
  * ```ts
3305
4467
  * import { Effect, Schedule } from "effect"
3306
4468
  *
@@ -3326,6 +4488,25 @@ export * as Runtime from "./Runtime.ts"
3326
4488
  export * as Schedule from "./Schedule.ts"
3327
4489
 
3328
4490
  /**
4491
+ * The `Scheduler` module defines the runtime scheduling services used by
4492
+ * Effect fibers. A scheduler decides how runnable tasks are enqueued, when they
4493
+ * are dispatched, and whether a fiber should yield after consuming its
4494
+ * operation budget.
4495
+ *
4496
+ * **Common tasks**
4497
+ *
4498
+ * - Use {@link Scheduler} to provide a custom runtime scheduler
4499
+ * - Use {@link MixedScheduler} for the default priority-aware scheduler
4500
+ * - Use {@link MaxOpsBeforeYield} to tune fairness for CPU-bound fibers
4501
+ * - Use {@link PreventSchedulerYield} only when a runtime should bypass yield checks
4502
+ *
4503
+ * **Gotchas**
4504
+ *
4505
+ * - Scheduler priorities affect the order of queued runtime tasks, not the
4506
+ * semantic result of an `Effect`
4507
+ * - Disabling scheduler yields can improve throughput for controlled workloads,
4508
+ * but it can also let long-running fibers monopolize the JavaScript thread
4509
+ *
3329
4510
  * @since 2.0.0
3330
4511
  */
3331
4512
  export * as Scheduler from "./Scheduler.ts"
@@ -3665,6 +4846,25 @@ export * as SchemaGetter from "./SchemaGetter.ts"
3665
4846
  export * as SchemaIssue from "./SchemaIssue.ts"
3666
4847
 
3667
4848
  /**
4849
+ * The `SchemaParser` module turns schemas into reusable runtime operations for
4850
+ * constructing, validating, decoding, and encoding values. It is the execution
4851
+ * layer behind a schema's AST: parsers walk the schema structure, apply
4852
+ * transformations, honor parse options, run checks, and report failures as
4853
+ * `SchemaIssue.Issue` values.
4854
+ *
4855
+ * Use this module when you need a parser with a specific result shape:
4856
+ * `Effect` for effectful parsing and service requirements, `Promise` for
4857
+ * JavaScript interop, `Exit` or `Result` when failures should stay in data,
4858
+ * `Option` for yes/no validation, and synchronous helpers when throwing is the
4859
+ * desired boundary.
4860
+ *
4861
+ * Decoding reads from the encoded/input side of a schema into its decoded
4862
+ * `Type`, while encoding runs the schema in the opposite direction. The
4863
+ * `make*` helpers construct decoded values and apply constructor defaults before
4864
+ * validation. Parse options supplied when a parser is created are merged with
4865
+ * options supplied at call time, and schema-level parse annotations can further
4866
+ * refine behavior.
4867
+ *
3668
4868
  * @since 4.0.0
3669
4869
  */
3670
4870
  export * as SchemaParser from "./SchemaParser.ts"
@@ -3848,6 +5048,22 @@ export * as SchemaRepresentation from "./SchemaRepresentation.ts"
3848
5048
  export * as SchemaTransformation from "./SchemaTransformation.ts"
3849
5049
 
3850
5050
  /**
5051
+ * The `SchemaUtils` module contains focused helpers for schema patterns that
5052
+ * are useful but too specialized for the core `Schema` API surface.
5053
+ *
5054
+ * Use this module when you need to describe a native class with a schema while
5055
+ * keeping a plain struct as its encoded representation. This is especially
5056
+ * useful for classes such as `Data.Error` subclasses that should decode from
5057
+ * structured data, encode back to that data, and still preserve class identity
5058
+ * for instance checks and schema optics.
5059
+ *
5060
+ * **Gotchas**
5061
+ *
5062
+ * - The constructor is called with the decoded struct fields as a single
5063
+ * argument, so the class constructor must accept that shape.
5064
+ * - Encoding uses the instance itself as the encoded shape, so the instance
5065
+ * should expose properties compatible with the provided struct schema.
5066
+ *
3851
5067
  * @since 4.0.0
3852
5068
  */
3853
5069
  export * as SchemaUtils from "./SchemaUtils.ts"
@@ -3870,31 +5086,179 @@ export * as SchemaUtils from "./SchemaUtils.ts"
3870
5086
  export * as Scope from "./Scope.ts"
3871
5087
 
3872
5088
  /**
5089
+ * The `ScopedCache` module provides a cache for values that acquire scoped
5090
+ * resources during lookup. Each cached entry owns a `Scope`, so resources
5091
+ * created while computing a value stay alive for as long as that entry remains
5092
+ * cached and are released when the entry is removed.
5093
+ *
5094
+ * A `ScopedCache` is itself created inside a scope. Calls to {@link get} run the
5095
+ * lookup effect on cache misses, share the same in-flight lookup among
5096
+ * concurrent callers for the same key, and store the resulting exit according
5097
+ * to a time-to-live policy. Entries can be inserted manually with {@link set},
5098
+ * refreshed with {@link refresh}, inspected without triggering lookup with
5099
+ * {@link getOption}, and removed with {@link invalidate} or
5100
+ * {@link invalidateAll}. Capacity limits evict the oldest entries.
5101
+ *
5102
+ * **Lifecycle notes**
5103
+ *
5104
+ * - Entry scopes are closed when entries expire, are invalidated, are evicted,
5105
+ * are replaced, or when the cache's owning scope closes
5106
+ * - Successful and failed lookup exits are both cached according to the
5107
+ * configured TTL
5108
+ * - Expired entries may remain counted by {@link size} until a cache operation
5109
+ * observes and removes them
5110
+ * - Once the owning scope closes, the cache is closed and lookup-style
5111
+ * operations interrupt instead of acquiring new values
5112
+ *
3873
5113
  * @since 4.0.0
3874
5114
  */
3875
5115
  export * as ScopedCache from "./ScopedCache.ts"
3876
5116
 
3877
5117
  /**
5118
+ * The `ScopedRef` module provides a mutable reference for values that are tied
5119
+ * to scoped resources. Each value stored in a `ScopedRef` is acquired within its
5120
+ * own `Scope`, and replacing the value safely releases the resources associated
5121
+ * with the previous value.
5122
+ *
5123
+ * Use `ScopedRef` when an application needs to keep a current resource-backed
5124
+ * value, such as a live client, connection, subscription, or cached handle, and
5125
+ * later swap it for a newly acquired value without leaking the old resources.
5126
+ * Reads are simple, while updates are synchronized and resource-safe.
5127
+ *
5128
+ * **Gotchas**
5129
+ *
5130
+ * - A `ScopedRef` must itself be created and used within a `Scope`; when that
5131
+ * scope closes, the currently stored value is finalized.
5132
+ * - Use {@link fromAcquire} or {@link set} for resourceful values so acquisition
5133
+ * and finalization are tracked correctly.
5134
+ * - Use {@link make} only for values that do not acquire resources.
5135
+ * - Updating a `ScopedRef` waits for the replacement acquisition and old
5136
+ * finalization to complete before returning.
5137
+ *
3878
5138
  * @since 2.0.0
3879
5139
  */
3880
5140
  export * as ScopedRef from "./ScopedRef.ts"
3881
5141
 
3882
5142
  /**
5143
+ * The `Semaphore` module provides a counting semaphore for coordinating
5144
+ * concurrent access to shared or limited resources. A semaphore tracks a fixed
5145
+ * number of permits: effects acquire permits before entering a critical section
5146
+ * and release them when they leave.
5147
+ *
5148
+ * Use semaphores to bound parallel work, protect rate-limited services, or
5149
+ * serialize access to resources that cannot safely handle unlimited
5150
+ * concurrency. Prefer {@link withPermit} and {@link withPermits} when possible,
5151
+ * because they release permits automatically when the protected effect exits.
5152
+ * Use {@link take} and {@link release} for lower-level protocols that need
5153
+ * manual control.
5154
+ *
5155
+ * **Gotchas**
5156
+ *
5157
+ * - Pending acquisitions wait until enough permits are available.
5158
+ * - {@link withPermitsIfAvailable} does not wait; it returns `Option.none` when
5159
+ * the requested permits cannot be acquired immediately.
5160
+ * - Manual `take` / `release` usage must keep permit counts balanced.
5161
+ *
3883
5162
  * @since 2.0.0
3884
5163
  */
3885
5164
  export * as Semaphore from "./Semaphore.ts"
3886
5165
 
3887
5166
  /**
5167
+ * The `Sink` module provides composable consumers for `Stream` values. A
5168
+ * `Sink<A, In, L, E, R>` pulls input elements of type `In`, may require
5169
+ * services `R`, may fail with `E`, and eventually produces a result `A` plus
5170
+ * any leftover input `L` that was read but not consumed.
5171
+ *
5172
+ * **Mental model**
5173
+ *
5174
+ * - A sink is the terminal consumer used by `Stream.run`
5175
+ * - Sinks can consume zero, one, many, or all input elements before finishing
5176
+ * - Leftovers allow one sink to stop early without losing already-pulled input
5177
+ * - Sink composition preserves typed errors and service requirements
5178
+ * - Most sinks are built from `Channel` internally, but users compose them with
5179
+ * the higher-level APIs in this module
5180
+ *
5181
+ * **Common tasks**
5182
+ *
5183
+ * - Create simple sinks: {@link succeed}, {@link fail}, {@link fromEffect}
5184
+ * - Fold input: {@link fold}, {@link foldEffect}, {@link foldLeft}
5185
+ * - Collect values: {@link collectAll}, {@link collectAllN}, {@link collectAllWhile}
5186
+ * - Count or drain input: {@link count}, {@link drain}
5187
+ * - Transform results: {@link map}, {@link mapEffect}, {@link as}
5188
+ * - Combine sinks: {@link zip}, {@link zipWith}, {@link race}
5189
+ * - Filter and refine input: {@link filterInput}, {@link filterInputEffect}
5190
+ *
5191
+ * **Gotchas**
5192
+ *
5193
+ * - A sink can finish before the stream is exhausted; check leftover-aware
5194
+ * combinators when composing parsers or protocol decoders
5195
+ * - `In` is contravariant, so a sink that accepts broader input can be used
5196
+ * where narrower input is expected
5197
+ * - Resource and service requirements are tracked in the `R` type parameter
5198
+ *
3888
5199
  * @since 2.0.0
3889
5200
  */
3890
5201
  export * as Sink from "./Sink.ts"
3891
5202
 
3892
5203
  /**
5204
+ * The `Stdio` module defines the service interface used by Effect programs to
5205
+ * interact with process standard I/O. It models command-line arguments,
5206
+ * standard output, standard error, and standard input as Effects, Sinks, and
5207
+ * Streams so programs can depend on console I/O through `Context` instead of
5208
+ * directly coupling to a specific runtime.
5209
+ *
5210
+ * Use this module when building command-line programs, tests, or platform
5211
+ * integrations that need to read bytes from stdin, write text or bytes to
5212
+ * stdout/stderr, or provide deterministic replacements for those capabilities.
5213
+ * The `layerTest` helper is useful for tests because it supplies inert defaults
5214
+ * and lets individual fields be overridden.
5215
+ *
5216
+ * Standard I/O operations are platform capabilities and may fail with
5217
+ * `PlatformError`; handle those failures in the Effect error channel rather than
5218
+ * assuming writes or reads are infallible.
5219
+ *
3893
5220
  * @since 4.0.0
3894
5221
  */
3895
5222
  export * as Stdio from "./Stdio.ts"
3896
5223
 
3897
5224
  /**
5225
+ * The `Stream` module provides a typed, composable way to describe effectful
5226
+ * sequences of values. A `Stream<A, E, R>` can emit zero or more `A` values,
5227
+ * fail with an `E`, and require services from `R` while preserving
5228
+ * backpressure and resource safety.
5229
+ *
5230
+ * **Mental model**
5231
+ *
5232
+ * - A stream is a lazy description; it runs only when consumed with a `run*` function
5233
+ * - Streams are pull-based and emit chunks internally for efficient throughput
5234
+ * - `A` is the element type, `E` is the failure type, and `R` is the required context
5235
+ * - Stream composition mirrors `Effect`: use `map`, `flatMap`, error handling, and `pipe`
5236
+ * - Resource scopes, interruption, and finalizers are tracked by the Effect runtime
5237
+ * - Interop functions connect streams to queues, pub/subs, web streams, async iterables, and channels
5238
+ *
5239
+ * **Common tasks**
5240
+ *
5241
+ * - Create streams: {@link make}, {@link fromIterable}, {@link fromEffect}, {@link fromQueue}
5242
+ * - Transform values: {@link map}, {@link mapEffect}, {@link flatMap}, {@link filter}
5243
+ * - Combine streams: {@link concat}, {@link merge}, {@link zip}, {@link race}
5244
+ * - Control demand and timing: {@link take}, {@link drop}, {@link debounce}, {@link throttle}
5245
+ * - Manage errors: {@link catchCause}, {@link catchIf}, {@link mapError}, {@link retry}
5246
+ * - Manage resources and services: {@link scoped}, {@link ensuring}, {@link provide}
5247
+ * - Consume streams: {@link runCollect}, {@link runForEach}, {@link runFold}, {@link runDrain}
5248
+ *
5249
+ * **Gotchas**
5250
+ *
5251
+ * - A stream is not a collection; constructors and operators build a description until it is run
5252
+ * - Re-running a stream re-executes its effects unless it is explicitly shared or backed by external state
5253
+ * - Operators such as {@link merge}, {@link race}, and {@link broadcast} introduce concurrency and interruption semantics
5254
+ * - Prefer bounded constructors and sinks for large or infinite streams instead of collecting everything into memory
5255
+ *
5256
+ * **See also**
5257
+ *
5258
+ * - {@link Effect.Effect} for single-result effectful programs
5259
+ * - {@link Sink.Sink} for consuming and folding streams
5260
+ * - {@link Channel.Channel} for the lower-level primitive underlying streams
5261
+ *
3898
5262
  * @since 2.0.0
3899
5263
  */
3900
5264
  export * as Stream from "./Stream.ts"
@@ -3985,31 +5349,147 @@ export * as String from "./String.ts"
3985
5349
  export * as Struct from "./Struct.ts"
3986
5350
 
3987
5351
  /**
5352
+ * The `SubscriptionRef` module provides a mutable reference that can be read
5353
+ * and updated like a `Ref`, while also exposing a stream of its current value
5354
+ * and every subsequent change. It is useful when one part of an application
5355
+ * owns evolving state and many fibers need to subscribe to consistent updates,
5356
+ * such as configuration, coordination state, cached snapshots, or UI models.
5357
+ *
5358
+ * Updates are serialized with an internal semaphore and each update is
5359
+ * published to subscribers. The {@link changes} stream replays the latest value
5360
+ * first, then emits future updates, so new subscribers can start from the
5361
+ * current state without performing a separate read. Prefer the effectful
5362
+ * getters and update operations for concurrent code; the unsafe helpers bypass
5363
+ * synchronization and should only be used when the caller already controls
5364
+ * access.
5365
+ *
3988
5366
  * @since 2.0.0
3989
5367
  */
3990
5368
  export * as SubscriptionRef from "./SubscriptionRef.ts"
3991
5369
 
3992
5370
  /**
5371
+ * The `Symbol` module provides a small runtime guard for working with
5372
+ * JavaScript `symbol` values. Use {@link isSymbol} when validating unknown
5373
+ * input, narrowing union types, or building predicates that need to recognize
5374
+ * primitive symbols such as those created by `Symbol()` or `Symbol.for`.
5375
+ *
5376
+ * The guard checks for the primitive `symbol` type; boxed objects created with
5377
+ * `Object(Symbol())` are objects and do not satisfy this predicate.
5378
+ *
3993
5379
  * @since 2.0.0
3994
5380
  */
3995
5381
  export * as Symbol from "./Symbol.ts"
3996
5382
 
3997
5383
  /**
5384
+ * The `SynchronizedRef` module provides mutable references whose updates are
5385
+ * serialized, including updates that run effects before deciding the next
5386
+ * value. A `SynchronizedRef<A>` behaves like a `Ref<A>` for reading and basic
5387
+ * updates, but uses an internal semaphore so concurrent modifications observe a
5388
+ * consistent current value and apply one at a time.
5389
+ *
5390
+ * **When to use**
5391
+ *
5392
+ * - Coordinating shared state that may be updated by many fibers
5393
+ * - Running effectful state transitions that must not overlap
5394
+ * - Computing both a return value and a new stored value atomically
5395
+ * - Applying partial updates with `Option`, where `None` leaves the value
5396
+ * unchanged
5397
+ *
5398
+ * **Gotchas**
5399
+ *
5400
+ * - Effectful update functions run while the semaphore is held, so long-running
5401
+ * effects delay other updates to the same ref
5402
+ * - Failed effectful updates do not replace the stored value
5403
+ * - `getUnsafe` and `makeUnsafe` bypass the `Effect` API and should be reserved
5404
+ * for low-level or carefully controlled code
5405
+ *
3998
5406
  * @since 2.0.0
3999
5407
  */
4000
5408
  export * as SynchronizedRef from "./SynchronizedRef.ts"
4001
5409
 
4002
5410
  /**
5411
+ * The `Take` module provides the representation used by stream-like producers
5412
+ * to describe a single pull result. A `Take<A, E, Done>` is either a
5413
+ * non-empty batch of emitted values, a failed `Exit`, or a successful `Exit`
5414
+ * carrying the stream's completion value.
5415
+ *
5416
+ * `Take` is useful at boundaries where pull results need to be stored,
5417
+ * transferred, or interpreted later while preserving the distinction between
5418
+ * emitted elements, failures, and normal completion. Use {@link toPull} to turn
5419
+ * a `Take` back into a `Pull`: value batches become successful pulls, failure
5420
+ * exits are propagated, and successful exits signal completion with `Done`.
5421
+ *
5422
+ * **Gotchas**
5423
+ *
5424
+ * - A value batch is always represented by a `NonEmptyReadonlyArray`; empty
5425
+ * batches are not valid `Take` values.
5426
+ * - Successful `Exit` values do not emit elements. They represent pull
5427
+ * completion and carry the `Done` value.
5428
+ *
4003
5429
  * @since 2.0.0
4004
5430
  */
4005
5431
  export * as Take from "./Take.ts"
4006
5432
 
4007
5433
  /**
5434
+ * The `Terminal` module defines the service interface used by platform
5435
+ * integrations to model command-line input and output. It gives programs a
5436
+ * uniform way to query terminal dimensions, read lines, stream low-level key
5437
+ * events, and write text without depending directly on Node, the browser, or a
5438
+ * test-specific console implementation.
5439
+ *
5440
+ * Use this module when building interactive command-line tools, prompts, or
5441
+ * platform abstractions that need terminal capabilities as an Effect service.
5442
+ * Implementations are supplied through context, so application code can depend
5443
+ * on `Terminal` while tests and runtimes provide the concrete behavior.
5444
+ *
5445
+ * `readLine` can fail with {@link QuitError} when the user requests to quit,
5446
+ * commonly via `Ctrl+C`. For lower-level interaction, `readInput` returns a
5447
+ * scoped stream of {@link UserInput} values containing parsed key metadata and
5448
+ * any raw character input.
5449
+ *
4008
5450
  * @since 4.0.0
4009
5451
  */
4010
5452
  export * as Terminal from "./Terminal.ts"
4011
5453
 
4012
5454
  /**
5455
+ * The `Tracer` module defines the low-level tracing model used by Effect to
5456
+ * describe and propagate spans. A span records the lifetime of an operation,
5457
+ * including its name, parent, attributes, links, annotations, sampling decision,
5458
+ * kind, and completion status.
5459
+ *
5460
+ * **Mental model**
5461
+ *
5462
+ * - `Tracer` is the backend interface responsible for creating spans
5463
+ * - `Span` values represent Effect-managed operations with mutable lifecycle
5464
+ * hooks for ending spans and adding attributes, events, or links
5465
+ * - `ExternalSpan` represents trace context imported from another tracing
5466
+ * system so Effect spans can be parented by or linked to external work
5467
+ * - `ParentSpan`, `Tracer`, and related context references control propagation,
5468
+ * sampling, and trace-level filtering through the Effect context
5469
+ *
5470
+ * **Common tasks**
5471
+ *
5472
+ * - Implement a custom tracing backend with {@link make}
5473
+ * - Provide or inspect parent span context with {@link ParentSpan}
5474
+ * - Convert external trace identifiers into Effect span values with
5475
+ * {@link externalSpan}
5476
+ * - Configure span metadata with {@link SpanOptions}, {@link SpanKind}, and
5477
+ * {@link SpanLink}
5478
+ * - Disable propagation or adjust trace filtering with
5479
+ * {@link DisablePropagation}, {@link CurrentTraceLevel}, and
5480
+ * {@link MinimumTraceLevel}
5481
+ *
5482
+ * **Gotchas**
5483
+ *
5484
+ * - This module exposes the tracing data model and backend hooks; most
5485
+ * application code should create spans through higher-level Effect APIs such
5486
+ * as `Effect.withSpan`
5487
+ * - `ExternalSpan` only carries identity and metadata from another system; it
5488
+ * does not have lifecycle methods like `Span`
5489
+ * - Propagation and sampling are context-dependent, so parent selection can be
5490
+ * affected by disabled propagation, root span options, and trace-level
5491
+ * thresholds
5492
+ *
4013
5493
  * @since 2.0.0
4014
5494
  */
4015
5495
  export * as Tracer from "./Tracer.ts"
@@ -4128,11 +5608,56 @@ export * as TxChunk from "./TxChunk.ts"
4128
5608
  export * as TxDeferred from "./TxDeferred.ts"
4129
5609
 
4130
5610
  /**
5611
+ * The `TxHashMap` module provides a transactional hash map for storing and
5612
+ * updating key-value pairs inside Effect transactions. It is useful when
5613
+ * multiple fibers need to coordinate shared map state and each read-modify-write
5614
+ * sequence must be committed atomically.
5615
+ *
5616
+ * A `TxHashMap<K, V>` has the familiar shape of a `HashMap<K, V>`, but every
5617
+ * operation returns an `Effect` and participates in transaction semantics
5618
+ * through `TxRef`. Use it for concurrent registries, caches, counters, indexes,
5619
+ * and other mutable maps whose updates should compose safely with other
5620
+ * transactional references.
5621
+ *
5622
+ * **Common tasks**
5623
+ *
5624
+ * - Create maps with {@link empty}, {@link fromIterable}, or {@link make}
5625
+ * - Read entries with {@link get}, {@link has}, {@link keys}, {@link values}, and {@link entries}
5626
+ * - Update entries with {@link set}, {@link modify}, {@link modifyAt}, and {@link remove}
5627
+ * - Inspect aggregate state with {@link size}, {@link isEmpty}, and {@link reduce}
5628
+ *
5629
+ * **Gotchas**
5630
+ *
5631
+ * - Operations are effectful; run them in `Effect.gen` and wrap multi-step
5632
+ * transactions with `Effect.tx` when the whole sequence must commit together.
5633
+ * - Reads that may be absent return `Option`, so handle both `Some` and `None`
5634
+ * instead of assuming a key exists.
5635
+ *
4131
5636
  * @since 2.0.0
4132
5637
  */
4133
5638
  export * as TxHashMap from "./TxHashMap.ts"
4134
5639
 
4135
5640
  /**
5641
+ * The `TxHashSet` module provides a transactional hash set for storing unique
5642
+ * values inside Effect transactions. A `TxHashSet<A>` wraps a `HashSet<A>` in a
5643
+ * transactional reference, so reads and writes can be composed with other
5644
+ * transactional operations and committed atomically.
5645
+ *
5646
+ * **Common tasks**
5647
+ *
5648
+ * - Create transactional sets with {@link empty}, {@link make}, or {@link fromIterable}
5649
+ * - Mutate an existing set with {@link add}, {@link remove}, and {@link clear}
5650
+ * - Query membership and size with {@link has}, {@link size}, and {@link isEmpty}
5651
+ * - Derive new sets with {@link map}, {@link filter}, {@link union}, {@link intersection}, and {@link difference}
5652
+ * - Fold or collect values with {@link reduce}, {@link toArray}, and {@link toHashSet}
5653
+ *
5654
+ * **Gotchas**
5655
+ *
5656
+ * - Mutation operations update the same transactional set; transform operations
5657
+ * return a new `TxHashSet`
5658
+ * - Operations are `Effect` values and must be yielded, piped, or run to take effect
5659
+ * - Use `Effect.tx` when several operations must observe and commit one atomic transaction
5660
+ *
4136
5661
  * @since 2.0.0
4137
5662
  */
4138
5663
  export * as TxHashSet from "./TxHashSet.ts"
@@ -4192,6 +5717,24 @@ export * as TxReentrantLock from "./TxReentrantLock.ts"
4192
5717
  export * as TxRef from "./TxRef.ts"
4193
5718
 
4194
5719
  /**
5720
+ * The `TxSemaphore` module provides a transactional semaphore for coordinating
5721
+ * access to limited resources from within Effect transactions. A semaphore
5722
+ * tracks a fixed number of permits, and transactional operations can acquire,
5723
+ * release, or inspect those permits atomically with other transactional state.
5724
+ *
5725
+ * Use `TxSemaphore` when permit accounting needs to compose with `TxRef` and
5726
+ * other transactional updates, such as guarding resource pools, rate-limited
5727
+ * sections, or workflows that must reserve capacity consistently before
5728
+ * committing related state changes.
5729
+ *
5730
+ * **Gotchas**
5731
+ *
5732
+ * - Permit operations are intended for transactional workflows and are wrapped
5733
+ * with `Effect.tx`.
5734
+ * - The semaphore capacity is fixed at construction time; releasing more
5735
+ * permits than the original capacity fails.
5736
+ * - Creating a semaphore with a negative number of permits defects.
5737
+ *
4195
5738
  * @since 4.0.0
4196
5739
  */
4197
5740
  export * as TxSemaphore from "./TxSemaphore.ts"
@@ -4292,6 +5835,19 @@ export * as Types from "./Types.ts"
4292
5835
  export * as UndefinedOr from "./UndefinedOr.ts"
4293
5836
 
4294
5837
  /**
5838
+ * The `Unify` module contains the type-level protocol Effect uses to normalize
5839
+ * unions of data types that opt in to unification. It is primarily a library
5840
+ * authoring tool: data types expose hidden symbol properties describing how
5841
+ * their variants should be widened, and {@link Unify} turns those protocol
5842
+ * entries into the user-facing union type that TypeScript should infer.
5843
+ *
5844
+ * Most application code does not need to interact with these symbols directly.
5845
+ * The main runtime helper, {@link unify}, is an identity function that preserves
5846
+ * values and functions at runtime while applying {@link Unify} to the relevant
5847
+ * static type. This is useful when authoring APIs that return branded or
5848
+ * protocol-enabled values and need inference to collapse to the public Effect
5849
+ * data type rather than exposing implementation details.
5850
+ *
4295
5851
  * @since 2.0.0
4296
5852
  */
4297
5853
  export * as Unify from "./Unify.ts"