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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1196) hide show
  1. package/dist/Array.d.ts +41 -42
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +23 -23
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +265 -265
  6. package/dist/BigDecimal.js +128 -128
  7. package/dist/BigInt.d.ts +175 -177
  8. package/dist/BigInt.d.ts.map +1 -1
  9. package/dist/BigInt.js +81 -79
  10. package/dist/BigInt.js.map +1 -1
  11. package/dist/Boolean.d.ts +127 -125
  12. package/dist/Boolean.d.ts.map +1 -1
  13. package/dist/Boolean.js +55 -53
  14. package/dist/Boolean.js.map +1 -1
  15. package/dist/Brand.d.ts +10 -4
  16. package/dist/Brand.d.ts.map +1 -1
  17. package/dist/Brand.js +3 -2
  18. package/dist/Brand.js.map +1 -1
  19. package/dist/Cache.d.ts +36 -36
  20. package/dist/Cache.js +17 -17
  21. package/dist/Cause.d.ts +17 -18
  22. package/dist/Cause.d.ts.map +1 -1
  23. package/dist/Cause.js +12 -12
  24. package/dist/Cause.js.map +1 -1
  25. package/dist/Channel.d.ts +234 -241
  26. package/dist/Channel.d.ts.map +1 -1
  27. package/dist/Channel.js +98 -102
  28. package/dist/Channel.js.map +1 -1
  29. package/dist/Chunk.d.ts +33 -56
  30. package/dist/Chunk.d.ts.map +1 -1
  31. package/dist/Chunk.js +17 -26
  32. package/dist/Chunk.js.map +1 -1
  33. package/dist/Clock.d.ts +1 -1
  34. package/dist/Clock.js +1 -1
  35. package/dist/Combiner.d.ts +9 -1
  36. package/dist/Combiner.d.ts.map +1 -1
  37. package/dist/Combiner.js +8 -0
  38. package/dist/Combiner.js.map +1 -1
  39. package/dist/Config.d.ts +78 -68
  40. package/dist/Config.d.ts.map +1 -1
  41. package/dist/Config.js +53 -49
  42. package/dist/Config.js.map +1 -1
  43. package/dist/ConfigProvider.d.ts +33 -32
  44. package/dist/ConfigProvider.d.ts.map +1 -1
  45. package/dist/ConfigProvider.js +19 -18
  46. package/dist/ConfigProvider.js.map +1 -1
  47. package/dist/Console.d.ts +19 -19
  48. package/dist/Console.js +19 -19
  49. package/dist/Context.d.ts +70 -108
  50. package/dist/Context.d.ts.map +1 -1
  51. package/dist/Context.js +30 -44
  52. package/dist/Context.js.map +1 -1
  53. package/dist/Cron.d.ts +3 -5
  54. package/dist/Cron.d.ts.map +1 -1
  55. package/dist/Cron.js +3 -5
  56. package/dist/Cron.js.map +1 -1
  57. package/dist/Crypto.d.ts +208 -0
  58. package/dist/Crypto.d.ts.map +1 -0
  59. package/dist/Crypto.js +157 -0
  60. package/dist/Crypto.js.map +1 -0
  61. package/dist/Data.d.ts +6 -1
  62. package/dist/Data.d.ts.map +1 -1
  63. package/dist/Data.js.map +1 -1
  64. package/dist/DateTime.d.ts +29 -31
  65. package/dist/DateTime.d.ts.map +1 -1
  66. package/dist/DateTime.js +19 -19
  67. package/dist/DateTime.js.map +1 -1
  68. package/dist/Deferred.d.ts +8 -9
  69. package/dist/Deferred.d.ts.map +1 -1
  70. package/dist/Deferred.js +6 -6
  71. package/dist/Deferred.js.map +1 -1
  72. package/dist/Differ.d.ts +2 -2
  73. package/dist/Duration.d.ts +30 -27
  74. package/dist/Duration.d.ts.map +1 -1
  75. package/dist/Duration.js +15 -12
  76. package/dist/Duration.js.map +1 -1
  77. package/dist/Effect.d.ts +879 -1137
  78. package/dist/Effect.d.ts.map +1 -1
  79. package/dist/Effect.js +375 -465
  80. package/dist/Effect.js.map +1 -1
  81. package/dist/Effectable.d.ts +2 -2
  82. package/dist/Effectable.js +2 -2
  83. package/dist/Encoding.d.ts +9 -9
  84. package/dist/Encoding.js +9 -9
  85. package/dist/Equal.d.ts +4 -3
  86. package/dist/Equal.d.ts.map +1 -1
  87. package/dist/Equal.js +4 -3
  88. package/dist/Equal.js.map +1 -1
  89. package/dist/Equivalence.d.ts +4 -5
  90. package/dist/Equivalence.d.ts.map +1 -1
  91. package/dist/Equivalence.js +2 -2
  92. package/dist/Equivalence.js.map +1 -1
  93. package/dist/ErrorReporter.d.ts +14 -14
  94. package/dist/ErrorReporter.js +9 -9
  95. package/dist/ExecutionPlan.d.ts +18 -9
  96. package/dist/ExecutionPlan.d.ts.map +1 -1
  97. package/dist/ExecutionPlan.js +6 -4
  98. package/dist/ExecutionPlan.js.map +1 -1
  99. package/dist/Exit.d.ts +0 -1
  100. package/dist/Exit.d.ts.map +1 -1
  101. package/dist/Exit.js.map +1 -1
  102. package/dist/Fiber.d.ts +1 -2
  103. package/dist/Fiber.d.ts.map +1 -1
  104. package/dist/Fiber.js +1 -1
  105. package/dist/Fiber.js.map +1 -1
  106. package/dist/FiberHandle.d.ts +5 -5
  107. package/dist/FiberHandle.js +3 -3
  108. package/dist/FiberMap.d.ts +10 -10
  109. package/dist/FiberMap.js +4 -4
  110. package/dist/FiberSet.d.ts +4 -4
  111. package/dist/FiberSet.js +2 -2
  112. package/dist/FileSystem.d.ts +10 -12
  113. package/dist/FileSystem.d.ts.map +1 -1
  114. package/dist/FileSystem.js +3 -3
  115. package/dist/FileSystem.js.map +1 -1
  116. package/dist/Filter.d.ts +54 -54
  117. package/dist/Filter.js +28 -28
  118. package/dist/Formatter.d.ts +4 -2
  119. package/dist/Formatter.d.ts.map +1 -1
  120. package/dist/Formatter.js +3 -69
  121. package/dist/Formatter.js.map +1 -1
  122. package/dist/Function.d.ts +64 -65
  123. package/dist/Function.d.ts.map +1 -1
  124. package/dist/Function.js +41 -41
  125. package/dist/Function.js.map +1 -1
  126. package/dist/Graph.d.ts +157 -175
  127. package/dist/Graph.d.ts.map +1 -1
  128. package/dist/Graph.js +72 -80
  129. package/dist/Graph.js.map +1 -1
  130. package/dist/Hash.d.ts +4 -6
  131. package/dist/Hash.d.ts.map +1 -1
  132. package/dist/Hash.js +2 -2
  133. package/dist/Hash.js.map +1 -1
  134. package/dist/HashMap.d.ts +121 -157
  135. package/dist/HashMap.d.ts.map +1 -1
  136. package/dist/HashMap.js +47 -59
  137. package/dist/HashMap.js.map +1 -1
  138. package/dist/HashRing.d.ts +34 -34
  139. package/dist/HashRing.js +16 -16
  140. package/dist/HashSet.d.ts +51 -55
  141. package/dist/HashSet.d.ts.map +1 -1
  142. package/dist/HashSet.js +19 -20
  143. package/dist/HashSet.js.map +1 -1
  144. package/dist/Inspectable.d.ts +6 -4
  145. package/dist/Inspectable.d.ts.map +1 -1
  146. package/dist/Inspectable.js +6 -4
  147. package/dist/Inspectable.js.map +1 -1
  148. package/dist/Iterable.d.ts +37 -83
  149. package/dist/Iterable.d.ts.map +1 -1
  150. package/dist/Iterable.js +21 -39
  151. package/dist/Iterable.js.map +1 -1
  152. package/dist/JsonPatch.d.ts +8 -6
  153. package/dist/JsonPatch.d.ts.map +1 -1
  154. package/dist/JsonPatch.js +5 -3
  155. package/dist/JsonPatch.js.map +1 -1
  156. package/dist/JsonPointer.d.ts +13 -11
  157. package/dist/JsonPointer.d.ts.map +1 -1
  158. package/dist/JsonPointer.js +13 -11
  159. package/dist/JsonPointer.js.map +1 -1
  160. package/dist/JsonSchema.d.ts +16 -0
  161. package/dist/JsonSchema.d.ts.map +1 -1
  162. package/dist/JsonSchema.js +10 -0
  163. package/dist/JsonSchema.js.map +1 -1
  164. package/dist/Latch.d.ts +4 -16
  165. package/dist/Latch.d.ts.map +1 -1
  166. package/dist/Latch.js +2 -14
  167. package/dist/Latch.js.map +1 -1
  168. package/dist/Layer.d.ts +94 -135
  169. package/dist/Layer.d.ts.map +1 -1
  170. package/dist/Layer.js +44 -61
  171. package/dist/Layer.js.map +1 -1
  172. package/dist/LayerMap.d.ts +15 -16
  173. package/dist/LayerMap.d.ts.map +1 -1
  174. package/dist/LayerMap.js +6 -6
  175. package/dist/LogLevel.d.ts +13 -13
  176. package/dist/LogLevel.js +4 -4
  177. package/dist/Logger.d.ts +10 -11
  178. package/dist/Logger.d.ts.map +1 -1
  179. package/dist/Logger.js +10 -11
  180. package/dist/Logger.js.map +1 -1
  181. package/dist/ManagedRuntime.d.ts +5 -4
  182. package/dist/ManagedRuntime.d.ts.map +1 -1
  183. package/dist/ManagedRuntime.js +4 -3
  184. package/dist/ManagedRuntime.js.map +1 -1
  185. package/dist/Match.d.ts +2 -4
  186. package/dist/Match.d.ts.map +1 -1
  187. package/dist/Match.js +1 -2
  188. package/dist/Match.js.map +1 -1
  189. package/dist/Metric.d.ts +48 -50
  190. package/dist/Metric.d.ts.map +1 -1
  191. package/dist/Metric.js +22 -22
  192. package/dist/Metric.js.map +1 -1
  193. package/dist/MutableHashMap.d.ts +30 -30
  194. package/dist/MutableHashMap.d.ts.map +1 -1
  195. package/dist/MutableHashMap.js +15 -14
  196. package/dist/MutableHashMap.js.map +1 -1
  197. package/dist/MutableHashSet.d.ts.map +1 -1
  198. package/dist/MutableHashSet.js +0 -2
  199. package/dist/MutableHashSet.js.map +1 -1
  200. package/dist/MutableList.d.ts +23 -24
  201. package/dist/MutableList.d.ts.map +1 -1
  202. package/dist/MutableList.js +17 -19
  203. package/dist/MutableList.js.map +1 -1
  204. package/dist/MutableRef.d.ts.map +1 -1
  205. package/dist/MutableRef.js +0 -1
  206. package/dist/MutableRef.js.map +1 -1
  207. package/dist/Newtype.d.ts +12 -2
  208. package/dist/Newtype.d.ts.map +1 -1
  209. package/dist/Newtype.js +8 -2
  210. package/dist/Newtype.js.map +1 -1
  211. package/dist/NonEmptyIterable.d.ts +5 -12
  212. package/dist/NonEmptyIterable.d.ts.map +1 -1
  213. package/dist/NonEmptyIterable.js +3 -8
  214. package/dist/NonEmptyIterable.js.map +1 -1
  215. package/dist/Number.d.ts +145 -141
  216. package/dist/Number.d.ts.map +1 -1
  217. package/dist/Number.js +65 -61
  218. package/dist/Number.js.map +1 -1
  219. package/dist/Optic.d.ts +5 -5
  220. package/dist/Optic.js +5 -5
  221. package/dist/Option.d.ts +105 -109
  222. package/dist/Option.d.ts.map +1 -1
  223. package/dist/Option.js +50 -52
  224. package/dist/Option.js.map +1 -1
  225. package/dist/Order.d.ts +6 -6
  226. package/dist/Order.js +6 -6
  227. package/dist/Ordering.d.ts +15 -19
  228. package/dist/Ordering.d.ts.map +1 -1
  229. package/dist/Ordering.js +6 -6
  230. package/dist/Ordering.js.map +1 -1
  231. package/dist/PartitionedSemaphore.d.ts +3 -3
  232. package/dist/PartitionedSemaphore.js +2 -2
  233. package/dist/Path.d.ts +4 -4
  234. package/dist/Path.d.ts.map +1 -1
  235. package/dist/Path.js +2 -1
  236. package/dist/Path.js.map +1 -1
  237. package/dist/Pipeable.d.ts +10 -7
  238. package/dist/Pipeable.d.ts.map +1 -1
  239. package/dist/Pipeable.js +6 -4
  240. package/dist/Pipeable.js.map +1 -1
  241. package/dist/PlatformError.d.ts +3 -3
  242. package/dist/PlatformError.js +2 -2
  243. package/dist/Predicate.d.ts +2 -4
  244. package/dist/Predicate.d.ts.map +1 -1
  245. package/dist/Predicate.js +3 -3
  246. package/dist/Predicate.js.map +1 -1
  247. package/dist/PrimaryKey.d.ts +2 -1
  248. package/dist/PrimaryKey.d.ts.map +1 -1
  249. package/dist/PrimaryKey.js +2 -1
  250. package/dist/PrimaryKey.js.map +1 -1
  251. package/dist/PubSub.d.ts +25 -51
  252. package/dist/PubSub.d.ts.map +1 -1
  253. package/dist/PubSub.js +17 -35
  254. package/dist/PubSub.js.map +1 -1
  255. package/dist/Queue.d.ts +45 -60
  256. package/dist/Queue.d.ts.map +1 -1
  257. package/dist/Queue.js +27 -33
  258. package/dist/Queue.js.map +1 -1
  259. package/dist/Random.d.ts +27 -38
  260. package/dist/Random.d.ts.map +1 -1
  261. package/dist/Random.js +17 -54
  262. package/dist/Random.js.map +1 -1
  263. package/dist/RcMap.d.ts +11 -11
  264. package/dist/RcMap.js +3 -3
  265. package/dist/RcRef.d.ts +0 -1
  266. package/dist/RcRef.d.ts.map +1 -1
  267. package/dist/RcRef.js.map +1 -1
  268. package/dist/Record.d.ts +9 -8
  269. package/dist/Record.d.ts.map +1 -1
  270. package/dist/Record.js +7 -5
  271. package/dist/Record.js.map +1 -1
  272. package/dist/Redactable.d.ts +7 -5
  273. package/dist/Redactable.d.ts.map +1 -1
  274. package/dist/Redactable.js +5 -3
  275. package/dist/Redactable.js.map +1 -1
  276. package/dist/Redacted.d.ts +2 -3
  277. package/dist/Redacted.d.ts.map +1 -1
  278. package/dist/Redacted.js +2 -2
  279. package/dist/Redacted.js.map +1 -1
  280. package/dist/Reducer.d.ts +3 -1
  281. package/dist/Reducer.d.ts.map +1 -1
  282. package/dist/Reducer.js +2 -0
  283. package/dist/Reducer.js.map +1 -1
  284. package/dist/Ref.d.ts +7 -17
  285. package/dist/Ref.d.ts.map +1 -1
  286. package/dist/Ref.js +5 -12
  287. package/dist/Ref.js.map +1 -1
  288. package/dist/RegExp.d.ts +1 -1
  289. package/dist/RegExp.js +1 -1
  290. package/dist/Request.d.ts +2 -1
  291. package/dist/Request.d.ts.map +1 -1
  292. package/dist/Request.js +1 -0
  293. package/dist/Request.js.map +1 -1
  294. package/dist/RequestResolver.d.ts +2 -3
  295. package/dist/RequestResolver.d.ts.map +1 -1
  296. package/dist/RequestResolver.js +1 -1
  297. package/dist/RequestResolver.js.map +1 -1
  298. package/dist/Resource.d.ts +1 -1
  299. package/dist/Resource.js +1 -1
  300. package/dist/Result.d.ts +124 -142
  301. package/dist/Result.d.ts.map +1 -1
  302. package/dist/Result.js +51 -63
  303. package/dist/Result.js.map +1 -1
  304. package/dist/Runtime.d.ts +2 -7
  305. package/dist/Runtime.d.ts.map +1 -1
  306. package/dist/Runtime.js +1 -3
  307. package/dist/Runtime.js.map +1 -1
  308. package/dist/Schedule.d.ts +69 -72
  309. package/dist/Schedule.d.ts.map +1 -1
  310. package/dist/Schedule.js +31 -33
  311. package/dist/Schedule.js.map +1 -1
  312. package/dist/Scheduler.d.ts +2 -2
  313. package/dist/Scheduler.js +2 -2
  314. package/dist/Schema.d.ts +491 -321
  315. package/dist/Schema.d.ts.map +1 -1
  316. package/dist/Schema.js +220 -172
  317. package/dist/Schema.js.map +1 -1
  318. package/dist/SchemaAST.d.ts +98 -77
  319. package/dist/SchemaAST.d.ts.map +1 -1
  320. package/dist/SchemaAST.js +89 -68
  321. package/dist/SchemaAST.js.map +1 -1
  322. package/dist/SchemaGetter.d.ts +23 -23
  323. package/dist/SchemaGetter.js +20 -20
  324. package/dist/SchemaIssue.d.ts +18 -16
  325. package/dist/SchemaIssue.d.ts.map +1 -1
  326. package/dist/SchemaIssue.js +16 -14
  327. package/dist/SchemaIssue.js.map +1 -1
  328. package/dist/SchemaParser.d.ts +39 -40
  329. package/dist/SchemaParser.d.ts.map +1 -1
  330. package/dist/SchemaParser.js +48 -51
  331. package/dist/SchemaParser.js.map +1 -1
  332. package/dist/SchemaRepresentation.d.ts +89 -77
  333. package/dist/SchemaRepresentation.d.ts.map +1 -1
  334. package/dist/SchemaRepresentation.js +47 -37
  335. package/dist/SchemaRepresentation.js.map +1 -1
  336. package/dist/SchemaTransformation.d.ts +36 -5
  337. package/dist/SchemaTransformation.d.ts.map +1 -1
  338. package/dist/SchemaTransformation.js +33 -5
  339. package/dist/SchemaTransformation.js.map +1 -1
  340. package/dist/SchemaUtils.d.ts +1 -1
  341. package/dist/SchemaUtils.js +1 -1
  342. package/dist/Scope.d.ts +12 -29
  343. package/dist/Scope.d.ts.map +1 -1
  344. package/dist/Scope.js +6 -11
  345. package/dist/Scope.js.map +1 -1
  346. package/dist/ScopedCache.d.ts +37 -37
  347. package/dist/ScopedCache.js +17 -17
  348. package/dist/Semaphore.d.ts +4 -16
  349. package/dist/Semaphore.d.ts.map +1 -1
  350. package/dist/Semaphore.js +2 -14
  351. package/dist/Semaphore.js.map +1 -1
  352. package/dist/Sink.d.ts +36 -39
  353. package/dist/Sink.d.ts.map +1 -1
  354. package/dist/Sink.js +18 -18
  355. package/dist/Sink.js.map +1 -1
  356. package/dist/Stdio.d.ts +6 -6
  357. package/dist/Stdio.js +4 -4
  358. package/dist/Stream.d.ts +671 -808
  359. package/dist/Stream.d.ts.map +1 -1
  360. package/dist/Stream.js +289 -363
  361. package/dist/Stream.js.map +1 -1
  362. package/dist/String.d.ts +3 -2
  363. package/dist/String.d.ts.map +1 -1
  364. package/dist/String.js +3 -2
  365. package/dist/String.js.map +1 -1
  366. package/dist/Struct.d.ts +20 -18
  367. package/dist/Struct.d.ts.map +1 -1
  368. package/dist/Struct.js +10 -8
  369. package/dist/Struct.js.map +1 -1
  370. package/dist/SubscriptionRef.d.ts +2 -2
  371. package/dist/SubscriptionRef.js +2 -2
  372. package/dist/Symbol.d.ts +3 -3
  373. package/dist/Symbol.js +3 -3
  374. package/dist/SynchronizedRef.d.ts +1 -1
  375. package/dist/SynchronizedRef.js +1 -1
  376. package/dist/Take.d.ts +2 -2
  377. package/dist/Take.js +1 -1
  378. package/dist/Terminal.d.ts +5 -5
  379. package/dist/Terminal.js +2 -2
  380. package/dist/Tracer.d.ts +9 -9
  381. package/dist/Tracer.js +2 -2
  382. package/dist/Trie.d.ts +70 -106
  383. package/dist/Trie.d.ts.map +1 -1
  384. package/dist/Trie.js +29 -43
  385. package/dist/Trie.js.map +1 -1
  386. package/dist/Tuple.d.ts +34 -32
  387. package/dist/Tuple.d.ts.map +1 -1
  388. package/dist/Tuple.js +16 -14
  389. package/dist/Tuple.js.map +1 -1
  390. package/dist/TxChunk.d.ts +27 -18
  391. package/dist/TxChunk.d.ts.map +1 -1
  392. package/dist/TxChunk.js +15 -10
  393. package/dist/TxChunk.js.map +1 -1
  394. package/dist/TxDeferred.d.ts +11 -11
  395. package/dist/TxDeferred.js +5 -5
  396. package/dist/TxHashMap.d.ts +60 -61
  397. package/dist/TxHashMap.d.ts.map +1 -1
  398. package/dist/TxHashMap.js +23 -23
  399. package/dist/TxHashMap.js.map +1 -1
  400. package/dist/TxHashSet.d.ts +28 -32
  401. package/dist/TxHashSet.d.ts.map +1 -1
  402. package/dist/TxHashSet.js +13 -16
  403. package/dist/TxHashSet.js.map +1 -1
  404. package/dist/TxPriorityQueue.d.ts +30 -30
  405. package/dist/TxPriorityQueue.js +18 -18
  406. package/dist/TxPubSub.d.ts +18 -18
  407. package/dist/TxPubSub.js +14 -14
  408. package/dist/TxQueue.d.ts +26 -29
  409. package/dist/TxQueue.d.ts.map +1 -1
  410. package/dist/TxQueue.js +17 -17
  411. package/dist/TxQueue.js.map +1 -1
  412. package/dist/TxReentrantLock.d.ts +21 -21
  413. package/dist/TxReentrantLock.js +15 -15
  414. package/dist/TxRef.d.ts +24 -24
  415. package/dist/TxRef.js +11 -11
  416. package/dist/TxSemaphore.d.ts +13 -74
  417. package/dist/TxSemaphore.d.ts.map +1 -1
  418. package/dist/TxSemaphore.js +9 -52
  419. package/dist/TxSemaphore.js.map +1 -1
  420. package/dist/TxSubscriptionRef.d.ts +24 -24
  421. package/dist/TxSubscriptionRef.js +11 -11
  422. package/dist/Types.d.ts +1 -4
  423. package/dist/Types.d.ts.map +1 -1
  424. package/dist/UndefinedOr.d.ts +14 -0
  425. package/dist/UndefinedOr.d.ts.map +1 -1
  426. package/dist/UndefinedOr.js +8 -0
  427. package/dist/UndefinedOr.js.map +1 -1
  428. package/dist/Unify.d.ts +8 -8
  429. package/dist/Unify.js +1 -1
  430. package/dist/Utils.d.ts +1 -2
  431. package/dist/Utils.d.ts.map +1 -1
  432. package/dist/Utils.js.map +1 -1
  433. package/dist/index.d.ts +1934 -436
  434. package/dist/index.d.ts.map +1 -1
  435. package/dist/index.js +1934 -436
  436. package/dist/index.js.map +1 -1
  437. package/dist/testing/FastCheck.d.ts +3 -3
  438. package/dist/testing/FastCheck.js +3 -3
  439. package/dist/testing/TestClock.d.ts +2 -3
  440. package/dist/testing/TestClock.d.ts.map +1 -1
  441. package/dist/testing/TestClock.js +1 -1
  442. package/dist/testing/TestClock.js.map +1 -1
  443. package/dist/testing/TestConsole.d.ts +8 -9
  444. package/dist/testing/TestConsole.d.ts.map +1 -1
  445. package/dist/testing/TestConsole.js +5 -5
  446. package/dist/testing/TestConsole.js.map +1 -1
  447. package/dist/testing/TestSchema.d.ts +2 -0
  448. package/dist/testing/TestSchema.d.ts.map +1 -1
  449. package/dist/testing/TestSchema.js +2 -0
  450. package/dist/testing/TestSchema.js.map +1 -1
  451. package/dist/testing/index.d.ts +34 -0
  452. package/dist/testing/index.d.ts.map +1 -1
  453. package/dist/testing/index.js +34 -0
  454. package/dist/testing/index.js.map +1 -1
  455. package/dist/unstable/ai/AiError.d.ts +10 -19
  456. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  457. package/dist/unstable/ai/AiError.js +0 -9
  458. package/dist/unstable/ai/AiError.js.map +1 -1
  459. package/dist/unstable/ai/Chat.d.ts +0 -1
  460. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  461. package/dist/unstable/ai/Chat.js.map +1 -1
  462. package/dist/unstable/ai/McpSchema.d.ts +3 -0
  463. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  464. package/dist/unstable/ai/McpSchema.js +2 -0
  465. package/dist/unstable/ai/McpSchema.js.map +1 -1
  466. package/dist/unstable/ai/McpServer.d.ts +3 -1
  467. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  468. package/dist/unstable/ai/McpServer.js +1 -1
  469. package/dist/unstable/ai/McpServer.js.map +1 -1
  470. package/dist/unstable/ai/Model.d.ts +2 -6
  471. package/dist/unstable/ai/Model.d.ts.map +1 -1
  472. package/dist/unstable/ai/Model.js +2 -2
  473. package/dist/unstable/ai/Model.js.map +1 -1
  474. package/dist/unstable/ai/Prompt.d.ts +8 -10
  475. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  476. package/dist/unstable/ai/Prompt.js +4 -4
  477. package/dist/unstable/ai/Prompt.js.map +1 -1
  478. package/dist/unstable/ai/Response.d.ts +20 -20
  479. package/dist/unstable/ai/ResponseIdTracker.d.ts +1 -1
  480. package/dist/unstable/ai/ResponseIdTracker.js +1 -1
  481. package/dist/unstable/ai/Telemetry.d.ts +5 -5
  482. package/dist/unstable/ai/Telemetry.js +3 -3
  483. package/dist/unstable/ai/Tokenizer.d.ts +1 -1
  484. package/dist/unstable/ai/Tool.d.ts +14 -12
  485. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  486. package/dist/unstable/ai/Tool.js +10 -9
  487. package/dist/unstable/ai/Tool.js.map +1 -1
  488. package/dist/unstable/ai/index.d.ts +80 -6
  489. package/dist/unstable/ai/index.d.ts.map +1 -1
  490. package/dist/unstable/ai/index.js +80 -6
  491. package/dist/unstable/ai/index.js.map +1 -1
  492. package/dist/unstable/cli/CliOutput.d.ts +5 -6
  493. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  494. package/dist/unstable/cli/CliOutput.js +2 -3
  495. package/dist/unstable/cli/CliOutput.js.map +1 -1
  496. package/dist/unstable/cli/Command.d.ts +3 -3
  497. package/dist/unstable/cli/Command.js +1 -1
  498. package/dist/unstable/cli/Flag.d.ts +23 -0
  499. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  500. package/dist/unstable/cli/Flag.js +23 -0
  501. package/dist/unstable/cli/Flag.js.map +1 -1
  502. package/dist/unstable/cli/HelpDoc.d.ts +4 -4
  503. package/dist/unstable/cli/Param.d.ts +33 -1
  504. package/dist/unstable/cli/Param.d.ts.map +1 -1
  505. package/dist/unstable/cli/Param.js +64 -38
  506. package/dist/unstable/cli/Param.js.map +1 -1
  507. package/dist/unstable/cli/Primitive.d.ts +1 -1
  508. package/dist/unstable/cli/Primitive.js +1 -1
  509. package/dist/unstable/cli/Prompt.d.ts +6 -14
  510. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  511. package/dist/unstable/cli/Prompt.js +2 -2
  512. package/dist/unstable/cli/Prompt.js.map +1 -1
  513. package/dist/unstable/cli/index.d.ts +212 -0
  514. package/dist/unstable/cli/index.d.ts.map +1 -1
  515. package/dist/unstable/cli/index.js +205 -6
  516. package/dist/unstable/cli/index.js.map +1 -1
  517. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  518. package/dist/unstable/cli/internal/command.js +3 -0
  519. package/dist/unstable/cli/internal/command.js.map +1 -1
  520. package/dist/unstable/cli/internal/completions/descriptor.js +3 -0
  521. package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
  522. package/dist/unstable/cli/internal/help.d.ts.map +1 -1
  523. package/dist/unstable/cli/internal/help.js +10 -0
  524. package/dist/unstable/cli/internal/help.js.map +1 -1
  525. package/dist/unstable/cli/internal/parser.js +3 -1
  526. package/dist/unstable/cli/internal/parser.js.map +1 -1
  527. package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
  528. package/dist/unstable/cluster/ClusterCron.js +1 -1
  529. package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
  530. package/dist/unstable/cluster/ClusterSchema.js +8 -8
  531. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +2 -2
  532. package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -2
  533. package/dist/unstable/cluster/Entity.d.ts +0 -1
  534. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  535. package/dist/unstable/cluster/Entity.js.map +1 -1
  536. package/dist/unstable/cluster/EntityProxy.d.ts +10 -14
  537. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  538. package/dist/unstable/cluster/EntityProxy.js +8 -14
  539. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  540. package/dist/unstable/cluster/EntityProxyServer.d.ts +3 -2
  541. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  542. package/dist/unstable/cluster/EntityProxyServer.js +2 -2
  543. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  544. package/dist/unstable/cluster/EntityResource.js +1 -1
  545. package/dist/unstable/cluster/Envelope.d.ts +1 -1
  546. package/dist/unstable/cluster/Envelope.js +1 -1
  547. package/dist/unstable/cluster/HttpRunner.d.ts +11 -11
  548. package/dist/unstable/cluster/HttpRunner.js +11 -11
  549. package/dist/unstable/cluster/K8sHttpClient.d.ts +5 -5
  550. package/dist/unstable/cluster/K8sHttpClient.js +5 -5
  551. package/dist/unstable/cluster/MachineId.d.ts +1 -1
  552. package/dist/unstable/cluster/MachineId.js +1 -1
  553. package/dist/unstable/cluster/MessageStorage.d.ts +1 -2
  554. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  555. package/dist/unstable/cluster/MessageStorage.js +1 -1
  556. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  557. package/dist/unstable/cluster/Runner.d.ts +1 -1
  558. package/dist/unstable/cluster/Runner.js +1 -1
  559. package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
  560. package/dist/unstable/cluster/RunnerHealth.js +2 -2
  561. package/dist/unstable/cluster/RunnerServer.d.ts +4 -4
  562. package/dist/unstable/cluster/RunnerServer.js +4 -4
  563. package/dist/unstable/cluster/Runners.d.ts +3 -3
  564. package/dist/unstable/cluster/Runners.js +3 -3
  565. package/dist/unstable/cluster/ShardId.d.ts +7 -5
  566. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  567. package/dist/unstable/cluster/ShardId.js +6 -4
  568. package/dist/unstable/cluster/ShardId.js.map +1 -1
  569. package/dist/unstable/cluster/Sharding.js +1 -1
  570. package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
  571. package/dist/unstable/cluster/ShardingConfig.js +2 -2
  572. package/dist/unstable/cluster/SingleRunner.d.ts +1 -1
  573. package/dist/unstable/cluster/SingleRunner.js +1 -1
  574. package/dist/unstable/cluster/Snowflake.d.ts +10 -9
  575. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  576. package/dist/unstable/cluster/Snowflake.js +4 -3
  577. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  578. package/dist/unstable/cluster/SocketRunner.d.ts +2 -2
  579. package/dist/unstable/cluster/SocketRunner.js +2 -2
  580. package/dist/unstable/cluster/SqlMessageStorage.d.ts +3 -3
  581. package/dist/unstable/cluster/SqlMessageStorage.js +3 -3
  582. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +3 -3
  583. package/dist/unstable/cluster/SqlRunnerStorage.js +3 -3
  584. package/dist/unstable/cluster/TestRunner.d.ts +1 -1
  585. package/dist/unstable/cluster/TestRunner.js +1 -1
  586. package/dist/unstable/cluster/index.d.ts +790 -0
  587. package/dist/unstable/cluster/index.d.ts.map +1 -1
  588. package/dist/unstable/cluster/index.js +790 -0
  589. package/dist/unstable/cluster/index.js.map +1 -1
  590. package/dist/unstable/devtools/index.d.ts +58 -0
  591. package/dist/unstable/devtools/index.d.ts.map +1 -1
  592. package/dist/unstable/devtools/index.js +58 -0
  593. package/dist/unstable/devtools/index.js.map +1 -1
  594. package/dist/unstable/encoding/Sse.d.ts +16 -16
  595. package/dist/unstable/encoding/Sse.js +11 -11
  596. package/dist/unstable/encoding/index.d.ts +49 -0
  597. package/dist/unstable/encoding/index.d.ts.map +1 -1
  598. package/dist/unstable/encoding/index.js +49 -0
  599. package/dist/unstable/encoding/index.js.map +1 -1
  600. package/dist/unstable/eventlog/Event.d.ts +2 -2
  601. package/dist/unstable/eventlog/Event.js +1 -1
  602. package/dist/unstable/eventlog/EventGroup.d.ts +2 -2
  603. package/dist/unstable/eventlog/EventGroup.js +1 -1
  604. package/dist/unstable/eventlog/EventLog.d.ts +6 -7
  605. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  606. package/dist/unstable/eventlog/EventLog.js +4 -4
  607. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  608. package/dist/unstable/eventlog/EventLogRemote.d.ts +2 -2
  609. package/dist/unstable/eventlog/EventLogRemote.js +2 -2
  610. package/dist/unstable/eventlog/EventLogServer.d.ts +2 -2
  611. package/dist/unstable/eventlog/EventLogServer.js +2 -2
  612. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -2
  613. package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -2
  614. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +1 -1
  615. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
  616. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
  617. package/dist/unstable/eventlog/index.d.ts +240 -0
  618. package/dist/unstable/eventlog/index.d.ts.map +1 -1
  619. package/dist/unstable/eventlog/index.js +240 -0
  620. package/dist/unstable/eventlog/index.js.map +1 -1
  621. package/dist/unstable/http/Cookies.d.ts +6 -6
  622. package/dist/unstable/http/Cookies.js +4 -4
  623. package/dist/unstable/http/Etag.d.ts +2 -2
  624. package/dist/unstable/http/Etag.js +2 -2
  625. package/dist/unstable/http/Headers.d.ts +2 -2
  626. package/dist/unstable/http/Headers.js +1 -1
  627. package/dist/unstable/http/HttpClient.d.ts +5 -6
  628. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  629. package/dist/unstable/http/HttpClient.js +5 -4
  630. package/dist/unstable/http/HttpClient.js.map +1 -1
  631. package/dist/unstable/http/HttpClientError.d.ts +1 -1
  632. package/dist/unstable/http/HttpClientError.js +1 -1
  633. package/dist/unstable/http/HttpClientRequest.d.ts +4 -4
  634. package/dist/unstable/http/HttpClientRequest.js +4 -4
  635. package/dist/unstable/http/HttpClientResponse.d.ts +6 -6
  636. package/dist/unstable/http/HttpClientResponse.js +6 -6
  637. package/dist/unstable/http/HttpEffect.d.ts +5 -5
  638. package/dist/unstable/http/HttpEffect.js +5 -5
  639. package/dist/unstable/http/HttpIncomingMessage.d.ts +7 -6
  640. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  641. package/dist/unstable/http/HttpIncomingMessage.js +7 -6
  642. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  643. package/dist/unstable/http/HttpMethod.d.ts +4 -2
  644. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  645. package/dist/unstable/http/HttpMethod.js +4 -1
  646. package/dist/unstable/http/HttpMethod.js.map +1 -1
  647. package/dist/unstable/http/HttpMiddleware.d.ts +1 -0
  648. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  649. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  650. package/dist/unstable/http/HttpRouter.d.ts +23 -25
  651. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  652. package/dist/unstable/http/HttpRouter.js +23 -22
  653. package/dist/unstable/http/HttpRouter.js.map +1 -1
  654. package/dist/unstable/http/HttpServerError.d.ts +4 -1
  655. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  656. package/dist/unstable/http/HttpServerError.js +4 -1
  657. package/dist/unstable/http/HttpServerError.js.map +1 -1
  658. package/dist/unstable/http/HttpServerRequest.d.ts +15 -15
  659. package/dist/unstable/http/HttpServerRequest.js +15 -15
  660. package/dist/unstable/http/HttpServerRespondable.d.ts +1 -1
  661. package/dist/unstable/http/HttpServerRespondable.js +1 -1
  662. package/dist/unstable/http/HttpServerResponse.d.ts +5 -4
  663. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  664. package/dist/unstable/http/HttpServerResponse.js +5 -4
  665. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  666. package/dist/unstable/http/HttpStaticServer.d.ts +2 -4
  667. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  668. package/dist/unstable/http/HttpStaticServer.js +2 -4
  669. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  670. package/dist/unstable/http/Multipart.d.ts +20 -19
  671. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  672. package/dist/unstable/http/Multipart.js +19 -17
  673. package/dist/unstable/http/Multipart.js.map +1 -1
  674. package/dist/unstable/http/Template.d.ts +0 -1
  675. package/dist/unstable/http/Template.d.ts.map +1 -1
  676. package/dist/unstable/http/Template.js.map +1 -1
  677. package/dist/unstable/http/Url.d.ts +17 -17
  678. package/dist/unstable/http/Url.js +8 -8
  679. package/dist/unstable/http/UrlParams.d.ts +14 -12
  680. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  681. package/dist/unstable/http/UrlParams.js +12 -10
  682. package/dist/unstable/http/UrlParams.js.map +1 -1
  683. package/dist/unstable/http/index.d.ts +452 -0
  684. package/dist/unstable/http/index.d.ts.map +1 -1
  685. package/dist/unstable/http/index.js +452 -0
  686. package/dist/unstable/http/index.js.map +1 -1
  687. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -1
  688. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  689. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  690. package/dist/unstable/httpapi/HttpApiClient.d.ts +0 -1
  691. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  692. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  693. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -2
  694. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  695. package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -1
  696. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  697. package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
  698. package/dist/unstable/httpapi/HttpApiSchema.d.ts +19 -8
  699. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  700. package/dist/unstable/httpapi/HttpApiSchema.js +11 -8
  701. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  702. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +0 -1
  703. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  704. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  705. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +0 -2
  706. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  707. package/dist/unstable/httpapi/HttpApiSwagger.js +0 -2
  708. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  709. package/dist/unstable/httpapi/index.d.ts +310 -25
  710. package/dist/unstable/httpapi/index.d.ts.map +1 -1
  711. package/dist/unstable/httpapi/index.js +310 -25
  712. package/dist/unstable/httpapi/index.js.map +1 -1
  713. package/dist/unstable/observability/Otlp.d.ts +3 -3
  714. package/dist/unstable/observability/Otlp.js +3 -3
  715. package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
  716. package/dist/unstable/observability/OtlpExporter.js +1 -1
  717. package/dist/unstable/observability/OtlpLogger.d.ts +3 -2
  718. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  719. package/dist/unstable/observability/OtlpLogger.js +2 -2
  720. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  721. package/dist/unstable/observability/OtlpMetrics.d.ts +5 -4
  722. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  723. package/dist/unstable/observability/OtlpMetrics.js +2 -2
  724. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  725. package/dist/unstable/observability/OtlpResource.d.ts +9 -9
  726. package/dist/unstable/observability/OtlpResource.js +2 -2
  727. package/dist/unstable/observability/OtlpSerialization.d.ts +3 -3
  728. package/dist/unstable/observability/OtlpSerialization.js +3 -3
  729. package/dist/unstable/observability/OtlpTracer.d.ts +5 -2
  730. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  731. package/dist/unstable/observability/OtlpTracer.js +2 -2
  732. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  733. package/dist/unstable/observability/PrometheusMetrics.d.ts +7 -7
  734. package/dist/unstable/observability/PrometheusMetrics.js +2 -2
  735. package/dist/unstable/observability/index.d.ts +159 -3
  736. package/dist/unstable/observability/index.d.ts.map +1 -1
  737. package/dist/unstable/observability/index.js +159 -3
  738. package/dist/unstable/observability/index.js.map +1 -1
  739. package/dist/unstable/persistence/KeyValueStore.d.ts +4 -4
  740. package/dist/unstable/persistence/KeyValueStore.js +1 -1
  741. package/dist/unstable/persistence/Persistable.d.ts +11 -11
  742. package/dist/unstable/persistence/Persistable.js +1 -1
  743. package/dist/unstable/persistence/PersistedCache.d.ts +2 -2
  744. package/dist/unstable/persistence/PersistedCache.js +1 -1
  745. package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
  746. package/dist/unstable/persistence/PersistedQueue.js +3 -3
  747. package/dist/unstable/persistence/Persistence.d.ts +2 -1
  748. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  749. package/dist/unstable/persistence/Persistence.js +2 -1
  750. package/dist/unstable/persistence/Persistence.js.map +1 -1
  751. package/dist/unstable/persistence/RateLimiter.d.ts +19 -15
  752. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  753. package/dist/unstable/persistence/RateLimiter.js +14 -10
  754. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  755. package/dist/unstable/persistence/Redis.d.ts +3 -3
  756. package/dist/unstable/persistence/Redis.js +3 -3
  757. package/dist/unstable/persistence/index.d.ts +147 -0
  758. package/dist/unstable/persistence/index.d.ts.map +1 -1
  759. package/dist/unstable/persistence/index.js +147 -0
  760. package/dist/unstable/persistence/index.js.map +1 -1
  761. package/dist/unstable/process/ChildProcess.d.ts +41 -41
  762. package/dist/unstable/process/ChildProcess.js +11 -11
  763. package/dist/unstable/process/ChildProcessSpawner.d.ts +10 -10
  764. package/dist/unstable/process/ChildProcessSpawner.js +5 -5
  765. package/dist/unstable/process/index.d.ts +1 -1
  766. package/dist/unstable/process/index.js +1 -1
  767. package/dist/unstable/reactivity/AsyncResult.d.ts +8 -6
  768. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  769. package/dist/unstable/reactivity/AsyncResult.js +3 -3
  770. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  771. package/dist/unstable/reactivity/Atom.d.ts +25 -20
  772. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  773. package/dist/unstable/reactivity/Atom.js +12 -12
  774. package/dist/unstable/reactivity/Atom.js.map +1 -1
  775. package/dist/unstable/reactivity/AtomHttpApi.d.ts +2 -2
  776. package/dist/unstable/reactivity/AtomHttpApi.js +1 -1
  777. package/dist/unstable/reactivity/AtomRef.d.ts +2 -2
  778. package/dist/unstable/reactivity/AtomRef.js +1 -1
  779. package/dist/unstable/reactivity/AtomRegistry.d.ts +16 -16
  780. package/dist/unstable/reactivity/AtomRegistry.js +7 -7
  781. package/dist/unstable/reactivity/AtomRpc.d.ts +2 -2
  782. package/dist/unstable/reactivity/AtomRpc.js +1 -1
  783. package/dist/unstable/reactivity/Reactivity.d.ts +2 -3
  784. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  785. package/dist/unstable/reactivity/Reactivity.js +2 -3
  786. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  787. package/dist/unstable/reactivity/index.d.ts +166 -0
  788. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  789. package/dist/unstable/reactivity/index.js +166 -0
  790. package/dist/unstable/reactivity/index.js.map +1 -1
  791. package/dist/unstable/rpc/Rpc.d.ts +0 -1
  792. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  793. package/dist/unstable/rpc/Rpc.js.map +1 -1
  794. package/dist/unstable/rpc/RpcClient.d.ts +0 -1
  795. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  796. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  797. package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
  798. package/dist/unstable/rpc/RpcClientError.js +2 -2
  799. package/dist/unstable/rpc/RpcMiddleware.d.ts +2 -2
  800. package/dist/unstable/rpc/RpcMiddleware.js +1 -1
  801. package/dist/unstable/rpc/RpcWorker.d.ts +0 -1
  802. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  803. package/dist/unstable/rpc/RpcWorker.js +1 -1
  804. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  805. package/dist/unstable/rpc/Utils.d.ts +2 -0
  806. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  807. package/dist/unstable/rpc/Utils.js +2 -0
  808. package/dist/unstable/rpc/Utils.js.map +1 -1
  809. package/dist/unstable/rpc/index.d.ts +272 -0
  810. package/dist/unstable/rpc/index.d.ts.map +1 -1
  811. package/dist/unstable/rpc/index.js +272 -0
  812. package/dist/unstable/rpc/index.js.map +1 -1
  813. package/dist/unstable/schema/Model.d.ts +63 -8
  814. package/dist/unstable/schema/Model.d.ts.map +1 -1
  815. package/dist/unstable/schema/Model.js +44 -5
  816. package/dist/unstable/schema/Model.js.map +1 -1
  817. package/dist/unstable/schema/VariantSchema.d.ts +1 -4
  818. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  819. package/dist/unstable/schema/VariantSchema.js +1 -1
  820. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  821. package/dist/unstable/schema/index.d.ts +37 -0
  822. package/dist/unstable/schema/index.d.ts.map +1 -1
  823. package/dist/unstable/schema/index.js +37 -0
  824. package/dist/unstable/schema/index.js.map +1 -1
  825. package/dist/unstable/socket/Socket.d.ts +5 -4
  826. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  827. package/dist/unstable/socket/Socket.js +4 -3
  828. package/dist/unstable/socket/Socket.js.map +1 -1
  829. package/dist/unstable/socket/index.d.ts +44 -0
  830. package/dist/unstable/socket/index.d.ts.map +1 -1
  831. package/dist/unstable/socket/index.js +44 -0
  832. package/dist/unstable/socket/index.js.map +1 -1
  833. package/dist/unstable/sql/Migrator.d.ts +11 -9
  834. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  835. package/dist/unstable/sql/Migrator.js +10 -8
  836. package/dist/unstable/sql/Migrator.js.map +1 -1
  837. package/dist/unstable/sql/SqlClient.d.ts +4 -0
  838. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  839. package/dist/unstable/sql/SqlClient.js +2 -0
  840. package/dist/unstable/sql/SqlClient.js.map +1 -1
  841. package/dist/unstable/sql/SqlConnection.d.ts +3 -3
  842. package/dist/unstable/sql/SqlError.d.ts +18 -0
  843. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  844. package/dist/unstable/sql/SqlError.js +17 -0
  845. package/dist/unstable/sql/SqlError.js.map +1 -1
  846. package/dist/unstable/sql/SqlModel.d.ts +0 -1
  847. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  848. package/dist/unstable/sql/SqlModel.js.map +1 -1
  849. package/dist/unstable/sql/SqlSchema.d.ts +5 -5
  850. package/dist/unstable/sql/SqlSchema.js +5 -5
  851. package/dist/unstable/sql/SqlStream.d.ts +1 -0
  852. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  853. package/dist/unstable/sql/SqlStream.js +1 -0
  854. package/dist/unstable/sql/SqlStream.js.map +1 -1
  855. package/dist/unstable/sql/Statement.d.ts +27 -24
  856. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  857. package/dist/unstable/sql/Statement.js +9 -6
  858. package/dist/unstable/sql/Statement.js.map +1 -1
  859. package/dist/unstable/sql/index.d.ts +178 -1
  860. package/dist/unstable/sql/index.d.ts.map +1 -1
  861. package/dist/unstable/sql/index.js +178 -1
  862. package/dist/unstable/sql/index.js.map +1 -1
  863. package/dist/unstable/workers/Transferable.d.ts +7 -7
  864. package/dist/unstable/workers/Transferable.js +4 -4
  865. package/dist/unstable/workers/Worker.d.ts +1 -0
  866. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  867. package/dist/unstable/workers/Worker.js +1 -0
  868. package/dist/unstable/workers/Worker.js.map +1 -1
  869. package/dist/unstable/workers/WorkerError.d.ts +8 -8
  870. package/dist/unstable/workers/WorkerError.js +7 -7
  871. package/dist/unstable/workers/index.d.ts +80 -0
  872. package/dist/unstable/workers/index.d.ts.map +1 -1
  873. package/dist/unstable/workers/index.js +80 -0
  874. package/dist/unstable/workers/index.js.map +1 -1
  875. package/dist/unstable/workflow/Activity.d.ts +7 -7
  876. package/dist/unstable/workflow/Activity.js +2 -2
  877. package/dist/unstable/workflow/DurableClock.d.ts +2 -2
  878. package/dist/unstable/workflow/DurableClock.js +1 -1
  879. package/dist/unstable/workflow/DurableDeferred.d.ts +22 -20
  880. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  881. package/dist/unstable/workflow/DurableDeferred.js +8 -7
  882. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  883. package/dist/unstable/workflow/DurableQueue.d.ts +7 -5
  884. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  885. package/dist/unstable/workflow/DurableQueue.js +5 -3
  886. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  887. package/dist/unstable/workflow/Workflow.d.ts +12 -10
  888. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  889. package/dist/unstable/workflow/Workflow.js +3 -3
  890. package/dist/unstable/workflow/Workflow.js.map +1 -1
  891. package/dist/unstable/workflow/WorkflowEngine.d.ts +4 -4
  892. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  893. package/dist/unstable/workflow/WorkflowEngine.js +9 -13
  894. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  895. package/dist/unstable/workflow/WorkflowProxy.d.ts +10 -12
  896. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  897. package/dist/unstable/workflow/WorkflowProxy.js +8 -12
  898. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  899. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +3 -2
  900. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  901. package/dist/unstable/workflow/WorkflowProxyServer.js +2 -2
  902. package/dist/unstable/workflow/index.d.ts +160 -0
  903. package/dist/unstable/workflow/index.d.ts.map +1 -1
  904. package/dist/unstable/workflow/index.js +160 -0
  905. package/dist/unstable/workflow/index.js.map +1 -1
  906. package/package.json +3 -3
  907. package/src/Array.ts +41 -42
  908. package/src/BigDecimal.ts +265 -265
  909. package/src/BigInt.ts +175 -177
  910. package/src/Boolean.ts +127 -125
  911. package/src/Brand.ts +10 -4
  912. package/src/Cache.ts +42 -42
  913. package/src/Cause.ts +17 -18
  914. package/src/Channel.ts +256 -257
  915. package/src/Chunk.ts +33 -56
  916. package/src/Clock.ts +1 -1
  917. package/src/Combiner.ts +9 -1
  918. package/src/Config.ts +78 -68
  919. package/src/ConfigProvider.ts +33 -32
  920. package/src/Console.ts +23 -23
  921. package/src/Context.ts +70 -108
  922. package/src/Cron.ts +3 -5
  923. package/src/Crypto.ts +327 -0
  924. package/src/Data.ts +6 -1
  925. package/src/DateTime.ts +29 -31
  926. package/src/Deferred.ts +8 -9
  927. package/src/Differ.ts +2 -2
  928. package/src/Duration.ts +30 -27
  929. package/src/Effect.ts +893 -1151
  930. package/src/Effectable.ts +2 -2
  931. package/src/Encoding.ts +9 -9
  932. package/src/Equal.ts +4 -3
  933. package/src/Equivalence.ts +4 -5
  934. package/src/ErrorReporter.ts +14 -14
  935. package/src/ExecutionPlan.ts +18 -9
  936. package/src/Exit.ts +0 -1
  937. package/src/Fiber.ts +1 -2
  938. package/src/FiberHandle.ts +5 -5
  939. package/src/FiberMap.ts +10 -10
  940. package/src/FiberSet.ts +4 -4
  941. package/src/FileSystem.ts +10 -12
  942. package/src/Filter.ts +54 -54
  943. package/src/Formatter.ts +4 -70
  944. package/src/Function.ts +64 -65
  945. package/src/Graph.ts +157 -175
  946. package/src/Hash.ts +4 -6
  947. package/src/HashMap.ts +121 -157
  948. package/src/HashRing.ts +34 -34
  949. package/src/HashSet.ts +51 -55
  950. package/src/Inspectable.ts +8 -7
  951. package/src/Iterable.ts +37 -83
  952. package/src/JsonPatch.ts +9 -7
  953. package/src/JsonPointer.ts +13 -11
  954. package/src/JsonSchema.ts +16 -0
  955. package/src/Latch.ts +4 -16
  956. package/src/Layer.ts +94 -135
  957. package/src/LayerMap.ts +15 -16
  958. package/src/LogLevel.ts +13 -13
  959. package/src/Logger.ts +16 -17
  960. package/src/ManagedRuntime.ts +5 -4
  961. package/src/Match.ts +2 -4
  962. package/src/Metric.ts +56 -58
  963. package/src/MutableHashMap.ts +42 -44
  964. package/src/MutableHashSet.ts +0 -2
  965. package/src/MutableList.ts +23 -26
  966. package/src/MutableRef.ts +0 -1
  967. package/src/Newtype.ts +12 -2
  968. package/src/NonEmptyIterable.ts +5 -12
  969. package/src/Number.ts +145 -141
  970. package/src/Optic.ts +5 -5
  971. package/src/Option.ts +105 -109
  972. package/src/Order.ts +6 -6
  973. package/src/Ordering.ts +15 -19
  974. package/src/PartitionedSemaphore.ts +3 -3
  975. package/src/Path.ts +4 -4
  976. package/src/Pipeable.ts +10 -7
  977. package/src/PlatformError.ts +3 -3
  978. package/src/Predicate.ts +3 -5
  979. package/src/PrimaryKey.ts +2 -1
  980. package/src/PubSub.ts +25 -51
  981. package/src/Queue.ts +45 -60
  982. package/src/Random.ts +31 -74
  983. package/src/RcMap.ts +11 -11
  984. package/src/RcRef.ts +0 -1
  985. package/src/Record.ts +9 -8
  986. package/src/Redactable.ts +7 -5
  987. package/src/Redacted.ts +2 -3
  988. package/src/Reducer.ts +3 -1
  989. package/src/Ref.ts +15 -33
  990. package/src/RegExp.ts +1 -1
  991. package/src/Request.ts +2 -1
  992. package/src/RequestResolver.ts +2 -3
  993. package/src/Resource.ts +1 -1
  994. package/src/Result.ts +124 -142
  995. package/src/Runtime.ts +2 -7
  996. package/src/Schedule.ts +74 -77
  997. package/src/Scheduler.ts +2 -2
  998. package/src/Schema.ts +491 -321
  999. package/src/SchemaAST.ts +98 -77
  1000. package/src/SchemaGetter.ts +23 -23
  1001. package/src/SchemaIssue.ts +18 -16
  1002. package/src/SchemaParser.ts +46 -49
  1003. package/src/SchemaRepresentation.ts +89 -77
  1004. package/src/SchemaTransformation.ts +36 -5
  1005. package/src/SchemaUtils.ts +1 -1
  1006. package/src/Scope.ts +12 -29
  1007. package/src/ScopedCache.ts +43 -43
  1008. package/src/Semaphore.ts +4 -16
  1009. package/src/Sink.ts +36 -39
  1010. package/src/Stdio.ts +6 -6
  1011. package/src/Stream.ts +789 -828
  1012. package/src/String.ts +3 -2
  1013. package/src/Struct.ts +20 -18
  1014. package/src/SubscriptionRef.ts +2 -2
  1015. package/src/Symbol.ts +3 -3
  1016. package/src/SynchronizedRef.ts +1 -1
  1017. package/src/Take.ts +2 -2
  1018. package/src/Terminal.ts +5 -5
  1019. package/src/Tracer.ts +9 -9
  1020. package/src/Trie.ts +70 -106
  1021. package/src/Tuple.ts +34 -32
  1022. package/src/TxChunk.ts +27 -18
  1023. package/src/TxDeferred.ts +11 -11
  1024. package/src/TxHashMap.ts +62 -63
  1025. package/src/TxHashSet.ts +38 -42
  1026. package/src/TxPriorityQueue.ts +31 -31
  1027. package/src/TxPubSub.ts +18 -18
  1028. package/src/TxQueue.ts +26 -29
  1029. package/src/TxReentrantLock.ts +21 -21
  1030. package/src/TxRef.ts +24 -24
  1031. package/src/TxSemaphore.ts +13 -74
  1032. package/src/TxSubscriptionRef.ts +24 -24
  1033. package/src/Types.ts +1 -4
  1034. package/src/UndefinedOr.ts +14 -0
  1035. package/src/Unify.ts +8 -8
  1036. package/src/Utils.ts +1 -2
  1037. package/src/index.ts +1932 -433
  1038. package/src/testing/FastCheck.ts +3 -3
  1039. package/src/testing/TestClock.ts +2 -3
  1040. package/src/testing/TestConsole.ts +8 -9
  1041. package/src/testing/TestSchema.ts +2 -0
  1042. package/src/testing/index.ts +34 -0
  1043. package/src/unstable/ai/AiError.ts +10 -19
  1044. package/src/unstable/ai/Chat.ts +0 -1
  1045. package/src/unstable/ai/McpSchema.ts +3 -0
  1046. package/src/unstable/ai/McpServer.ts +3 -1
  1047. package/src/unstable/ai/Model.ts +2 -6
  1048. package/src/unstable/ai/Prompt.ts +8 -10
  1049. package/src/unstable/ai/Response.ts +20 -20
  1050. package/src/unstable/ai/ResponseIdTracker.ts +1 -1
  1051. package/src/unstable/ai/Telemetry.ts +5 -5
  1052. package/src/unstable/ai/Tokenizer.ts +1 -1
  1053. package/src/unstable/ai/Tool.ts +14 -12
  1054. package/src/unstable/ai/index.ts +80 -6
  1055. package/src/unstable/cli/CliOutput.ts +5 -6
  1056. package/src/unstable/cli/Command.ts +3 -3
  1057. package/src/unstable/cli/Flag.ts +24 -0
  1058. package/src/unstable/cli/HelpDoc.ts +4 -4
  1059. package/src/unstable/cli/Param.ts +101 -72
  1060. package/src/unstable/cli/Primitive.ts +1 -1
  1061. package/src/unstable/cli/Prompt.ts +6 -14
  1062. package/src/unstable/cli/index.ts +205 -6
  1063. package/src/unstable/cli/internal/command.ts +3 -0
  1064. package/src/unstable/cli/internal/completions/descriptor.ts +3 -0
  1065. package/src/unstable/cli/internal/help.ts +10 -0
  1066. package/src/unstable/cli/internal/parser.ts +3 -1
  1067. package/src/unstable/cluster/ClusterCron.ts +1 -1
  1068. package/src/unstable/cluster/ClusterSchema.ts +8 -8
  1069. package/src/unstable/cluster/ClusterWorkflowEngine.ts +2 -2
  1070. package/src/unstable/cluster/Entity.ts +0 -1
  1071. package/src/unstable/cluster/EntityProxy.ts +10 -14
  1072. package/src/unstable/cluster/EntityProxyServer.ts +3 -2
  1073. package/src/unstable/cluster/EntityResource.ts +2 -2
  1074. package/src/unstable/cluster/Envelope.ts +1 -1
  1075. package/src/unstable/cluster/HttpRunner.ts +11 -11
  1076. package/src/unstable/cluster/K8sHttpClient.ts +5 -5
  1077. package/src/unstable/cluster/MachineId.ts +1 -1
  1078. package/src/unstable/cluster/MessageStorage.ts +1 -2
  1079. package/src/unstable/cluster/Runner.ts +1 -1
  1080. package/src/unstable/cluster/RunnerHealth.ts +2 -2
  1081. package/src/unstable/cluster/RunnerServer.ts +4 -4
  1082. package/src/unstable/cluster/Runners.ts +3 -3
  1083. package/src/unstable/cluster/ShardId.ts +7 -5
  1084. package/src/unstable/cluster/Sharding.ts +1 -1
  1085. package/src/unstable/cluster/ShardingConfig.ts +2 -2
  1086. package/src/unstable/cluster/SingleRunner.ts +1 -1
  1087. package/src/unstable/cluster/Snowflake.ts +10 -9
  1088. package/src/unstable/cluster/SocketRunner.ts +2 -2
  1089. package/src/unstable/cluster/SqlMessageStorage.ts +3 -3
  1090. package/src/unstable/cluster/SqlRunnerStorage.ts +3 -3
  1091. package/src/unstable/cluster/TestRunner.ts +1 -1
  1092. package/src/unstable/cluster/index.ts +790 -0
  1093. package/src/unstable/devtools/index.ts +58 -0
  1094. package/src/unstable/encoding/Sse.ts +16 -16
  1095. package/src/unstable/encoding/index.ts +49 -0
  1096. package/src/unstable/eventlog/Event.ts +2 -2
  1097. package/src/unstable/eventlog/EventGroup.ts +2 -2
  1098. package/src/unstable/eventlog/EventLog.ts +6 -7
  1099. package/src/unstable/eventlog/EventLogRemote.ts +2 -2
  1100. package/src/unstable/eventlog/EventLogServer.ts +2 -2
  1101. package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -2
  1102. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
  1103. package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
  1104. package/src/unstable/eventlog/index.ts +240 -0
  1105. package/src/unstable/http/Cookies.ts +6 -6
  1106. package/src/unstable/http/Etag.ts +2 -2
  1107. package/src/unstable/http/Headers.ts +2 -2
  1108. package/src/unstable/http/HttpClient.ts +5 -6
  1109. package/src/unstable/http/HttpClientError.ts +1 -1
  1110. package/src/unstable/http/HttpClientRequest.ts +4 -4
  1111. package/src/unstable/http/HttpClientResponse.ts +6 -6
  1112. package/src/unstable/http/HttpEffect.ts +5 -5
  1113. package/src/unstable/http/HttpIncomingMessage.ts +7 -6
  1114. package/src/unstable/http/HttpMethod.ts +4 -2
  1115. package/src/unstable/http/HttpMiddleware.ts +1 -0
  1116. package/src/unstable/http/HttpRouter.ts +23 -25
  1117. package/src/unstable/http/HttpServerError.ts +4 -1
  1118. package/src/unstable/http/HttpServerRequest.ts +15 -15
  1119. package/src/unstable/http/HttpServerRespondable.ts +1 -1
  1120. package/src/unstable/http/HttpServerResponse.ts +5 -4
  1121. package/src/unstable/http/HttpStaticServer.ts +2 -4
  1122. package/src/unstable/http/Multipart.ts +20 -19
  1123. package/src/unstable/http/Template.ts +0 -1
  1124. package/src/unstable/http/Url.ts +17 -17
  1125. package/src/unstable/http/UrlParams.ts +14 -12
  1126. package/src/unstable/http/index.ts +452 -0
  1127. package/src/unstable/httpapi/HttpApiBuilder.ts +0 -1
  1128. package/src/unstable/httpapi/HttpApiClient.ts +0 -1
  1129. package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -2
  1130. package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
  1131. package/src/unstable/httpapi/HttpApiSchema.ts +19 -8
  1132. package/src/unstable/httpapi/HttpApiSecurity.ts +0 -1
  1133. package/src/unstable/httpapi/HttpApiSwagger.ts +0 -2
  1134. package/src/unstable/httpapi/index.ts +310 -25
  1135. package/src/unstable/observability/Otlp.ts +3 -3
  1136. package/src/unstable/observability/OtlpExporter.ts +1 -1
  1137. package/src/unstable/observability/OtlpLogger.ts +3 -2
  1138. package/src/unstable/observability/OtlpMetrics.ts +5 -4
  1139. package/src/unstable/observability/OtlpResource.ts +9 -9
  1140. package/src/unstable/observability/OtlpSerialization.ts +3 -3
  1141. package/src/unstable/observability/OtlpTracer.ts +5 -2
  1142. package/src/unstable/observability/PrometheusMetrics.ts +7 -7
  1143. package/src/unstable/observability/index.ts +159 -3
  1144. package/src/unstable/persistence/KeyValueStore.ts +4 -4
  1145. package/src/unstable/persistence/Persistable.ts +11 -11
  1146. package/src/unstable/persistence/PersistedCache.ts +2 -2
  1147. package/src/unstable/persistence/PersistedQueue.ts +6 -6
  1148. package/src/unstable/persistence/Persistence.ts +2 -1
  1149. package/src/unstable/persistence/RateLimiter.ts +19 -15
  1150. package/src/unstable/persistence/Redis.ts +3 -3
  1151. package/src/unstable/persistence/index.ts +147 -0
  1152. package/src/unstable/process/ChildProcess.ts +42 -42
  1153. package/src/unstable/process/ChildProcessSpawner.ts +10 -10
  1154. package/src/unstable/process/index.ts +1 -1
  1155. package/src/unstable/reactivity/AsyncResult.ts +8 -6
  1156. package/src/unstable/reactivity/Atom.ts +25 -20
  1157. package/src/unstable/reactivity/AtomHttpApi.ts +2 -2
  1158. package/src/unstable/reactivity/AtomRef.ts +2 -2
  1159. package/src/unstable/reactivity/AtomRegistry.ts +17 -17
  1160. package/src/unstable/reactivity/AtomRpc.ts +2 -2
  1161. package/src/unstable/reactivity/Reactivity.ts +2 -3
  1162. package/src/unstable/reactivity/index.ts +166 -0
  1163. package/src/unstable/rpc/Rpc.ts +0 -1
  1164. package/src/unstable/rpc/RpcClient.ts +0 -1
  1165. package/src/unstable/rpc/RpcClientError.ts +2 -2
  1166. package/src/unstable/rpc/RpcMiddleware.ts +2 -2
  1167. package/src/unstable/rpc/RpcWorker.ts +3 -2
  1168. package/src/unstable/rpc/Utils.ts +2 -0
  1169. package/src/unstable/rpc/index.ts +272 -0
  1170. package/src/unstable/schema/Model.ts +98 -10
  1171. package/src/unstable/schema/VariantSchema.ts +1 -4
  1172. package/src/unstable/schema/index.ts +37 -0
  1173. package/src/unstable/socket/Socket.ts +5 -4
  1174. package/src/unstable/socket/index.ts +44 -0
  1175. package/src/unstable/sql/Migrator.ts +14 -12
  1176. package/src/unstable/sql/SqlClient.ts +4 -0
  1177. package/src/unstable/sql/SqlConnection.ts +3 -3
  1178. package/src/unstable/sql/SqlError.ts +18 -0
  1179. package/src/unstable/sql/SqlModel.ts +0 -1
  1180. package/src/unstable/sql/SqlSchema.ts +5 -5
  1181. package/src/unstable/sql/SqlStream.ts +1 -0
  1182. package/src/unstable/sql/Statement.ts +27 -24
  1183. package/src/unstable/sql/index.ts +178 -1
  1184. package/src/unstable/workers/Transferable.ts +7 -7
  1185. package/src/unstable/workers/Worker.ts +1 -0
  1186. package/src/unstable/workers/WorkerError.ts +8 -8
  1187. package/src/unstable/workers/index.ts +80 -0
  1188. package/src/unstable/workflow/Activity.ts +7 -7
  1189. package/src/unstable/workflow/DurableClock.ts +2 -2
  1190. package/src/unstable/workflow/DurableDeferred.ts +22 -20
  1191. package/src/unstable/workflow/DurableQueue.ts +7 -5
  1192. package/src/unstable/workflow/Workflow.ts +12 -10
  1193. package/src/unstable/workflow/WorkflowEngine.ts +11 -15
  1194. package/src/unstable/workflow/WorkflowProxy.ts +10 -12
  1195. package/src/unstable/workflow/WorkflowProxyServer.ts +3 -2
  1196. package/src/unstable/workflow/index.ts +160 -0
package/dist/Effect.js CHANGED
@@ -15,13 +15,13 @@ import { internalCall } from "./Utils.js";
15
15
  * Runtime identifier used to recognize `Effect` values.
16
16
  *
17
17
  * @category Type identifiers
18
- * @since 2.0.0
18
+ * @since 4.0.0
19
19
  */
20
20
  export const TypeId = core.EffectTypeId;
21
21
  /**
22
22
  * Tests if a value is an `Effect`.
23
23
  *
24
- * **Example** (Usage)
24
+ * **Example** (Checking whether a value is an Effect)
25
25
  *
26
26
  * ```ts
27
27
  * import { Effect } from "effect"
@@ -30,7 +30,7 @@ export const TypeId = core.EffectTypeId;
30
30
  * console.log(Effect.isEffect("hello")) // false
31
31
  * ```
32
32
  *
33
- * @category Guards
33
+ * @category guards
34
34
  * @since 2.0.0
35
35
  */
36
36
  export const isEffect = core.isEffect;
@@ -52,7 +52,7 @@ export const isEffect = core.isEffect;
52
52
  * `Result` in the same output shape. Use `discard: true` to ignore successful
53
53
  * values and return `void`.
54
54
  *
55
- * **Example** (Combining Effects in Tuples)
55
+ * **Example** (Collecting tuple results in order)
56
56
  *
57
57
  * ```ts
58
58
  * import { Console, Effect } from "effect"
@@ -73,7 +73,7 @@ export const isEffect = core.isEffect;
73
73
  * // [ 42, 'Hello' ]
74
74
  * ```
75
75
  *
76
- * **Example** (Combining Effects in Iterables)
76
+ * **Example** (Collecting iterable results in order)
77
77
  *
78
78
  * ```ts
79
79
  * import { Console, Effect } from "effect"
@@ -94,7 +94,7 @@ export const isEffect = core.isEffect;
94
94
  * // [ 1, 2, 3 ]
95
95
  * ```
96
96
  *
97
- * **Example** (Combining Effects in Structs)
97
+ * **Example** (Collecting struct results by key)
98
98
  *
99
99
  * ```ts
100
100
  * import { Console, Effect } from "effect"
@@ -115,7 +115,7 @@ export const isEffect = core.isEffect;
115
115
  * // { a: 42, b: 'Hello' }
116
116
  * ```
117
117
  *
118
- * **Example** (Combining Effects in Records)
118
+ * **Example** (Collecting record results by key)
119
119
  *
120
120
  * ```ts
121
121
  * import { Console, Effect } from "effect"
@@ -136,7 +136,7 @@ export const isEffect = core.isEffect;
136
136
  * // { key1: 1, key2: 2 }
137
137
  * ```
138
138
  *
139
- * **Example** (Short-Circuiting Behavior)
139
+ * **Example** (Stopping on the first failure)
140
140
  *
141
141
  * ```ts
142
142
  * import { Console, Effect } from "effect"
@@ -176,7 +176,7 @@ export const all = internal.all;
176
176
  * This function runs every effect and never fails. Use `concurrency` to control
177
177
  * parallelism.
178
178
  *
179
- * **Example** (Usage)
179
+ * **Example** (Separating successes and failures)
180
180
  *
181
181
  * ```ts
182
182
  * import { Effect } from "effect"
@@ -190,7 +190,7 @@ export const all = internal.all;
190
190
  * ```
191
191
  *
192
192
  * @category Collecting
193
- * @since 3.0.0
193
+ * @since 2.0.0
194
194
  */
195
195
  export const partition = internal.partition;
196
196
  /**
@@ -203,7 +203,7 @@ export const partition = internal.partition;
203
203
  * Use `discard: true` to ignore successful values while still validating all
204
204
  * elements.
205
205
  *
206
- * **Example** (Usage)
206
+ * **Example** (Validating every element)
207
207
  *
208
208
  * ```ts
209
209
  * import { Effect } from "effect"
@@ -227,7 +227,7 @@ export const partition = internal.partition;
227
227
  * ```
228
228
  *
229
229
  * @category Error Accumulation
230
- * @since 4.0.0
230
+ * @since 2.0.0
231
231
  */
232
232
  export const validate = internal.validate;
233
233
  /**
@@ -236,7 +236,7 @@ export const validate = internal.validate;
236
236
  * The predicate receives the element and its index. Evaluation short-circuits
237
237
  * as soon as an element matches.
238
238
  *
239
- * **Example** (Usage)
239
+ * **Example** (Finding the first successful match)
240
240
  *
241
241
  * ```ts
242
242
  * import { Effect } from "effect"
@@ -284,11 +284,10 @@ export const findFirstFilter = internal.findFirstFilter;
284
284
  *
285
285
  * @see {@link all} for combining multiple effects into one.
286
286
  *
287
- * **Example** (Applying Effects to Iterable Elements)
287
+ * **Example** (Mapping over an iterable with effects)
288
288
  *
289
289
  * ```ts
290
- * import { Effect } from "effect"
291
- * import { Console } from "effect"
290
+ * import { Console, Effect } from "effect"
292
291
  *
293
292
  * const result = Effect.forEach(
294
293
  * [1, 2, 3, 4, 5],
@@ -306,11 +305,10 @@ export const findFirstFilter = internal.findFirstFilter;
306
305
  * // [ 2, 4, 6, 8, 10 ]
307
306
  * ```
308
307
  *
309
- * **Example** (Using discard to Ignore Results)
308
+ * **Example** (Running effects without collecting results)
310
309
  *
311
310
  * ```ts
312
- * import { Effect } from "effect"
313
- * import { Console } from "effect"
311
+ * import { Console, Effect } from "effect"
314
312
  *
315
313
  * // Apply effects but discard the results
316
314
  * const result = Effect.forEach(
@@ -337,7 +335,7 @@ export const forEach = internal.forEach;
337
335
  /**
338
336
  * Executes a body effect repeatedly while a condition holds true.
339
337
  *
340
- * **Example** (Usage)
338
+ * **Example** (Repeating an effectful loop)
341
339
  *
342
340
  * ```ts
343
341
  * import { Effect } from "effect"
@@ -382,7 +380,7 @@ export const whileLoop = internal.whileLoop;
382
380
  * This defect is not a standard error but indicates a flaw in the logic that
383
381
  * was expected to be error-free. You can think of it similar to an unexpected
384
382
  * crash in the program, which can be further managed or logged using tools like
385
- * {@link catchAllDefect}.
383
+ * {@link catchDefect}.
386
384
  *
387
385
  * **Interruptions**
388
386
  *
@@ -391,7 +389,7 @@ export const whileLoop = internal.whileLoop;
391
389
  *
392
390
  * @see {@link tryPromise} for a version that can handle failures.
393
391
  *
394
- * **Example** (Delayed Message)
392
+ * **Example** (Wrapping a non-rejecting Promise)
395
393
  *
396
394
  * ```ts
397
395
  * import { Effect } from "effect"
@@ -441,7 +439,7 @@ export const promise = internal.promise;
441
439
  * An optional `AbortSignal` can be provided to allow for interruption of the
442
440
  * wrapped `Promise` API.
443
441
  *
444
- * **Example** (Fetching a TODO Item)
442
+ * **Example** (Wrapping a fetch request that may fail)
445
443
  *
446
444
  * ```ts
447
445
  * import { Effect } from "effect"
@@ -457,7 +455,7 @@ export const promise = internal.promise;
457
455
  * const program = getTodo(1)
458
456
  * ```
459
457
  *
460
- * **Example** (Custom Error Handling)
458
+ * **Example** (Mapping Promise rejections to a tagged error)
461
459
  *
462
460
  * ```ts
463
461
  * import { Data, Effect } from "effect"
@@ -492,7 +490,7 @@ export const tryPromise = internal.tryPromise;
492
490
  *
493
491
  * @see {@link fail} to create an effect that represents a failure.
494
492
  *
495
- * **Example** (Creating a Successful Effect)
493
+ * **Example** (Creating a successful effect)
496
494
  *
497
495
  * ```ts
498
496
  * import { Effect } from "effect"
@@ -511,7 +509,7 @@ export const succeed = internal.succeed;
511
509
  /**
512
510
  * Returns an effect which succeeds with `None`.
513
511
  *
514
- * **Example** (Usage)
512
+ * **Example** (Succeeding with Option.none)
515
513
  *
516
514
  * ```ts
517
515
  * import { Effect } from "effect"
@@ -529,7 +527,7 @@ export const succeedNone = internal.succeedNone;
529
527
  /**
530
528
  * Returns an effect which succeeds with the value wrapped in a `Some`.
531
529
  *
532
- * **Example** (Usage)
530
+ * **Example** (Succeeding with Option.some)
533
531
  *
534
532
  * ```ts
535
533
  * import { Effect } from "effect"
@@ -558,7 +556,7 @@ export const succeedSome = internal.succeedSome;
558
556
  * - **Handling Circular Dependencies**: Useful in managing circular dependencies, such as recursive functions that need to avoid eager evaluation to prevent stack overflow.
559
557
  * - **Unifying Return Types**: Can help TypeScript unify return types in situations where multiple branches of logic return different effects, simplifying type inference.
560
558
  *
561
- * **Example** (Lazy Evaluation with Side Effects)
559
+ * **Example** (Lazily evaluating side effects)
562
560
  *
563
561
  * ```ts
564
562
  * import { Effect } from "effect"
@@ -576,7 +574,7 @@ export const succeedSome = internal.succeedSome;
576
574
  * console.log(Effect.runSync(good)) // Output: 2
577
575
  * ```
578
576
  *
579
- * **Example** (Recursive Fibonacci)
577
+ * **Example** (Suspending recursive Fibonacci evaluation)
580
578
  *
581
579
  * ```ts
582
580
  * import { Effect } from "effect"
@@ -602,7 +600,7 @@ export const succeedSome = internal.succeedSome;
602
600
  * // Output: 3524578
603
601
  * ```
604
602
  *
605
- * **Example** (Using Effect.suspend to Help TypeScript Infer Types)
603
+ * **Example** (Helping TypeScript infer recursive effect types)
606
604
  *
607
605
  * ```ts
608
606
  * import { Effect } from "effect"
@@ -646,11 +644,11 @@ export const suspend = internal.suspend;
646
644
  * This defect is not a standard error but indicates a flaw in the logic that
647
645
  * was expected to be error-free. You can think of it similar to an unexpected
648
646
  * crash in the program, which can be further managed or logged using tools like
649
- * {@link catchAllDefect}.
647
+ * {@link catchDefect}.
650
648
  *
651
649
  * @see {@link try_ | try} for a version that can handle failures.
652
650
  *
653
- * **Example** (Logging a Message)
651
+ * **Example** (Capturing synchronous logging in an Effect)
654
652
  *
655
653
  * ```ts
656
654
  * import { Effect } from "effect"
@@ -698,13 +696,7 @@ undefined_ as undefined };
698
696
  * Use `Effect.callback` when integrating APIs that complete through callbacks
699
697
  * instead of returning a `Promise`.
700
698
  *
701
- * **Previously Known As**
702
- *
703
- * This API replaces the following from Effect 3.x:
704
- *
705
- * - `Effect.async`
706
- *
707
- * **Example** (Usage)
699
+ * **Example** (Integrating callback APIs)
708
700
  *
709
701
  * ```ts
710
702
  * import { Effect } from "effect"
@@ -722,14 +714,14 @@ undefined_ as undefined };
722
714
  * ```
723
715
  *
724
716
  * @category Creating Effects
725
- * @since 2.0.0
717
+ * @since 4.0.0
726
718
  */
727
719
  export const callback = internal.callback;
728
720
  /**
729
721
  * Returns an effect that will never produce anything. The moral equivalent of
730
722
  * `while(true) {}`, only without the wasted CPU cycles.
731
723
  *
732
- * **Example** (Usage)
724
+ * **Example** (Creating a never-ending effect)
733
725
  *
734
726
  * ```ts
735
727
  * import { Effect } from "effect"
@@ -752,11 +744,10 @@ export const never = internal.never;
752
744
  * An `Effect` containing an empty record `{}`, used as the starting point for
753
745
  * do notation chains.
754
746
  *
755
- * **Example** (Usage)
747
+ * **Example** (Starting do notation)
756
748
  *
757
749
  * ```ts
758
- * import { Effect } from "effect"
759
- * import { pipe } from "effect/Function"
750
+ * import { Effect, pipe } from "effect"
760
751
  *
761
752
  * const program = pipe(
762
753
  * Effect.Do,
@@ -767,7 +758,7 @@ export const never = internal.never;
767
758
  * ```
768
759
  *
769
760
  * @category Do notation
770
- * @since 4.0.0
761
+ * @since 2.0.0
771
762
  */
772
763
  export const Do = internal.Do;
773
764
  /**
@@ -775,7 +766,7 @@ export const Do = internal.Do;
775
766
  * record used in do notation pipelines.
776
767
  *
777
768
  * @category Do notation
778
- * @since 4.0.0
769
+ * @since 2.0.0
779
770
  */
780
771
  export const bindTo = internal.bindTo;
781
772
  const let_ = internal.let;
@@ -784,14 +775,14 @@ export {
784
775
  * Adds a computed plain value to the do notation record.
785
776
  *
786
777
  * @category Do notation
787
- * @since 4.0.0
778
+ * @since 2.0.0
788
779
  */
789
780
  let_ as let };
790
781
  /**
791
782
  * Adds an `Effect` value to the do notation record under a given name.
792
783
  *
793
784
  * @category Do notation
794
- * @since 4.0.0
785
+ * @since 2.0.0
795
786
  */
796
787
  export const bind = internal.bind;
797
788
  /**
@@ -809,7 +800,7 @@ export const bind = internal.bind;
809
800
  * explicit control over the execution of effects. You can `yield*` values from
810
801
  * effects and return the final result at the end.
811
802
  *
812
- * **Example** (Usage)
803
+ * **Example** (Sequencing effects with generators)
813
804
  *
814
805
  * ```ts
815
806
  * import { Data, Effect } from "effect"
@@ -853,11 +844,11 @@ export const gen = internal.gen;
853
844
  *
854
845
  * Use this function to explicitly signal an error in an `Effect`. The error
855
846
  * will keep propagating unless it is handled. You can handle the error with
856
- * functions like {@link catchAll} or {@link catchTag}.
847
+ * functions like {@link catchTag} or {@link catchTags}.
857
848
  *
858
849
  * @see {@link succeed} to create an effect that represents a successful value.
859
850
  *
860
- * **Example** (Creating a Failed Effect)
851
+ * **Example** (Creating a failed effect)
861
852
  *
862
853
  * ```ts
863
854
  * import { Data, Effect } from "effect"
@@ -881,7 +872,7 @@ export const fail = internal.fail;
881
872
  * This function is useful when you need to create an error effect but want to
882
873
  * defer the computation of the error value until the effect is actually run.
883
874
  *
884
- * **Example** (Usage)
875
+ * **Example** (Lazily creating failures)
885
876
  *
886
877
  * ```ts
887
878
  * import { Data, Effect } from "effect"
@@ -904,7 +895,7 @@ export const failSync = internal.failSync;
904
895
  * This function allows you to create effects that fail with complex error
905
896
  * structures, including multiple errors, defects, interruptions, and more.
906
897
  *
907
- * **Example** (Usage)
898
+ * **Example** (Failing with a full Cause)
908
899
  *
909
900
  * ```ts
910
901
  * import { Cause, Effect } from "effect"
@@ -927,7 +918,7 @@ export const failCause = internal.failCause;
927
918
  * This function is useful when you need to create a failure effect with a
928
919
  * complex cause but want to defer the computation until the effect is run.
929
920
  *
930
- * **Example** (Usage)
921
+ * **Example** (Lazily creating a Cause)
931
922
  *
932
923
  * ```ts
933
924
  * import { Cause, Effect } from "effect"
@@ -961,10 +952,9 @@ export const failCauseSync = internal.failCauseSync;
961
952
  * The error channel of the resulting effect is of type `never`, indicating that
962
953
  * it cannot recover from this failure.
963
954
  *
964
- * @see {@link dieSync} for a variant that throws a specified error, evaluated lazily.
965
- * @see {@link dieMessage} for a variant that throws a `RuntimeException` with a message.
955
+ * @see {@link die} for a variant that dies with an already computed defect.
966
956
  *
967
- * **Example** (Terminating on Division by Zero with a Specified Error)
957
+ * **Example** (Failing when division by zero)
968
958
  *
969
959
  * ```ts
970
960
  * import { Effect } from "effect"
@@ -1013,7 +1003,7 @@ export {
1013
1003
  * @see {@link sync} if the effectful computation is synchronous and does not
1014
1004
  * throw errors.
1015
1005
  *
1016
- * **Example** (Basic Usage with Default Error Handling)
1006
+ * **Example** (Parsing JSON with typed error mapping)
1017
1007
  *
1018
1008
  * ```ts
1019
1009
  * import { Effect } from "effect"
@@ -1033,7 +1023,7 @@ export {
1033
1023
  * // Output: Exit.failure with Error
1034
1024
  * ```
1035
1025
  *
1036
- * **Example** (Custom Error Handling)
1026
+ * **Example** (Mapping synchronous exceptions to a tagged error)
1037
1027
  *
1038
1028
  * ```ts
1039
1029
  * import { Data, Effect } from "effect"
@@ -1057,7 +1047,7 @@ try_ as try };
1057
1047
  /**
1058
1048
  * Yields control back to the Effect runtime, allowing other fibers to execute.
1059
1049
  *
1060
- * **Example** (Usage)
1050
+ * **Example** (Yielding to other fibers)
1061
1051
  *
1062
1052
  * ```ts
1063
1053
  * import { Effect } from "effect"
@@ -1078,7 +1068,7 @@ export const yieldNow = internal.yieldNow;
1078
1068
  /**
1079
1069
  * Yields control back to the Effect runtime with a specified priority, allowing other fibers to execute.
1080
1070
  *
1081
- * **Example** (Usage)
1071
+ * **Example** (Yielding with priority)
1082
1072
  *
1083
1073
  * ```ts
1084
1074
  * import { Effect } from "effect"
@@ -1093,13 +1083,13 @@ export const yieldNow = internal.yieldNow;
1093
1083
  * ```
1094
1084
  *
1095
1085
  * @category Creating Effects
1096
- * @since 2.0.0
1086
+ * @since 4.0.0
1097
1087
  */
1098
1088
  export const yieldNowWith = internal.yieldNowWith;
1099
1089
  /**
1100
1090
  * Provides access to the current fiber within an effect computation.
1101
1091
  *
1102
- * **Example** (Usage)
1092
+ * **Example** (Reading the current fiber)
1103
1093
  *
1104
1094
  * ```ts
1105
1095
  * import { Effect } from "effect"
@@ -1113,7 +1103,7 @@ export const yieldNowWith = internal.yieldNowWith;
1113
1103
  * ```
1114
1104
  *
1115
1105
  * @category Creating Effects
1116
- * @since 2.0.0
1106
+ * @since 4.0.0
1117
1107
  */
1118
1108
  export const withFiber = core.withFiber;
1119
1109
  // -----------------------------------------------------------------------------
@@ -1122,7 +1112,7 @@ export const withFiber = core.withFiber;
1122
1112
  /**
1123
1113
  * Converts a `Result` to an `Effect`.
1124
1114
  *
1125
- * **Example** (Usage)
1115
+ * **Example** (Converting a Result into an Effect)
1126
1116
  *
1127
1117
  * ```ts
1128
1118
  * import { Effect, Result } from "effect"
@@ -1138,7 +1128,7 @@ export const withFiber = core.withFiber;
1138
1128
  * // { _id: 'Exit', _tag: 'Failure', cause: { _id: 'Cause', _tag: 'Fail', failure: 'Something went wrong' } }
1139
1129
  * ```
1140
1130
  *
1141
- * @category Conversions
1131
+ * @category converting
1142
1132
  * @since 4.0.0
1143
1133
  */
1144
1134
  export const fromResult = internal.fromResult;
@@ -1148,7 +1138,7 @@ export const fromResult = internal.fromResult;
1148
1138
  * `Option.some` becomes a successful effect with the contained value, while
1149
1139
  * `Option.none` becomes a failed effect with `NoSuchElementError`.
1150
1140
  *
1151
- * **Example** (Usage)
1141
+ * **Example** (Converting an Option into an Effect)
1152
1142
  *
1153
1143
  * ```ts
1154
1144
  * import { Effect, Option } from "effect"
@@ -1164,7 +1154,7 @@ export const fromResult = internal.fromResult;
1164
1154
  * // { _id: 'Exit', _tag: 'Failure', cause: { _id: 'Cause', _tag: 'Fail', failure: { _id: 'NoSuchElementError' } } }
1165
1155
  * ```
1166
1156
  *
1167
- * @category Conversions
1157
+ * @category converting
1168
1158
  * @since 4.0.0
1169
1159
  */
1170
1160
  export const fromOption = internal.fromOption;
@@ -1172,7 +1162,7 @@ export const fromOption = internal.fromOption;
1172
1162
  * Converts a nullable value to an `Effect`, failing with a `NoSuchElementError`
1173
1163
  * when the value is `null` or `undefined`.
1174
1164
  *
1175
- * **Example** (Usage)
1165
+ * **Example** (Failing on nullish values)
1176
1166
  *
1177
1167
  * ```ts
1178
1168
  * import { Console, Effect } from "effect"
@@ -1190,7 +1180,7 @@ export const fromOption = internal.fromOption;
1190
1180
  * // Output: hello
1191
1181
  * ```
1192
1182
  *
1193
- * @category Conversions
1183
+ * @category converting
1194
1184
  * @since 4.0.0
1195
1185
  */
1196
1186
  export const fromNullishOr = internal.fromNullishOr;
@@ -1227,7 +1217,7 @@ export const fromNullishOr = internal.fromNullishOr;
1227
1217
  * step produces a new `Effect` while flattening any nested effects that may
1228
1218
  * occur.
1229
1219
  *
1230
- * **Example** (Usage)
1220
+ * **Example** (Sequencing dependent effects)
1231
1221
  *
1232
1222
  * ```ts
1233
1223
  * import { Data, Effect, pipe } from "effect"
@@ -1258,14 +1248,14 @@ export const fromNullishOr = internal.fromNullishOr;
1258
1248
  *
1259
1249
  * @see {@link tap} for a version that ignores the result of the effect.
1260
1250
  *
1261
- * @category Sequencing
1251
+ * @category sequencing
1262
1252
  * @since 2.0.0
1263
1253
  */
1264
1254
  export const flatMap = internal.flatMap;
1265
1255
  /**
1266
1256
  * Flattens an `Effect` that produces another `Effect` into a single effect.
1267
1257
  *
1268
- * **Example** (Usage)
1258
+ * **Example** (Flattening nested effects)
1269
1259
  *
1270
1260
  * ```ts
1271
1261
  * import { Console, Effect } from "effect"
@@ -1279,7 +1269,7 @@ export const flatMap = internal.flatMap;
1279
1269
  * })
1280
1270
  * ```
1281
1271
  *
1282
- * @category Sequencing
1272
+ * @category sequencing
1283
1273
  * @since 2.0.0
1284
1274
  */
1285
1275
  export const flatten = internal.flatten;
@@ -1312,13 +1302,7 @@ export const flatten = internal.flatten;
1312
1302
  * Failures or requirements from either effect are preserved in the returned
1313
1303
  * effect.
1314
1304
  *
1315
- * **Previously Known As**
1316
- *
1317
- * This API replaces the following from Effect 3.x:
1318
- *
1319
- * - `Effect.zipRight`
1320
- *
1321
- * **Example** (Applying a Discount Based on Fetched Amount)
1305
+ * **Example** (Sequencing a discount calculation after fetching a total)
1322
1306
  *
1323
1307
  * ```ts
1324
1308
  * import { Data, Effect, pipe } from "effect"
@@ -1358,7 +1342,7 @@ export const flatten = internal.flatten;
1358
1342
  * // Output: 190
1359
1343
  * ```
1360
1344
  *
1361
- * @category Sequencing
1345
+ * @category sequencing
1362
1346
  * @since 2.0.0
1363
1347
  */
1364
1348
  export const andThen = internal.andThen;
@@ -1379,17 +1363,10 @@ export const andThen = internal.andThen;
1379
1363
  * next part of the chain. Note that if the side effect fails, the entire chain
1380
1364
  * will fail too.
1381
1365
  *
1382
- * **Previously Known As**
1383
- *
1384
- * This API replaces the following from Effect 3.x:
1385
- *
1386
- * - `Effect.zipLeft`
1387
- *
1388
1366
  * **Example** (Logging a step in a pipeline)
1389
1367
  *
1390
1368
  * ```ts
1391
- * import { Data, Effect, pipe } from "effect"
1392
- * import { Console } from "effect"
1369
+ * import { Console, Data, Effect, pipe } from "effect"
1393
1370
  *
1394
1371
  * class DiscountRateError extends Data.TaggedError("DiscountRateError")<{}> {}
1395
1372
  *
@@ -1419,7 +1396,7 @@ export const andThen = internal.andThen;
1419
1396
  * // 95
1420
1397
  * ```
1421
1398
  *
1422
- * @category Sequencing
1399
+ * @category sequencing
1423
1400
  * @since 2.0.0
1424
1401
  */
1425
1402
  export const tap = internal.tap;
@@ -1446,13 +1423,7 @@ export const tap = internal.tap;
1446
1423
  * The resulting effect cannot fail directly because all recoverable failures
1447
1424
  * are represented inside the `Result` type.
1448
1425
  *
1449
- * **Previously Known As**
1450
- *
1451
- * This API replaces the following from Effect 3.x:
1452
- *
1453
- * - `Effect.either`
1454
- *
1455
- * **Example** (Usage)
1426
+ * **Example** (Capturing success or failure as Result)
1456
1427
  *
1457
1428
  * ```ts
1458
1429
  * import { Effect } from "effect"
@@ -1485,7 +1456,7 @@ export const result = internal.result;
1485
1456
  * Success values become `Option.some`, recoverable failures become
1486
1457
  * `Option.none`, and defects still fail the effect.
1487
1458
  *
1488
- * **Example** (Usage)
1459
+ * **Example** (Capturing success or failure as Option)
1489
1460
  *
1490
1461
  * ```ts
1491
1462
  * import { Console, Effect, Option } from "effect"
@@ -1523,7 +1494,7 @@ export const option = internal.option;
1523
1494
  * the `Exit.Failure` type. The error type is set to `never`, indicating that
1524
1495
  * the effect is structured to never fail directly.
1525
1496
  *
1526
- * **Example** (Usage)
1497
+ * **Example** (Capturing completion as Exit)
1527
1498
  *
1528
1499
  * ```ts
1529
1500
  * import { Effect } from "effect"
@@ -1570,7 +1541,7 @@ export const exit = internal.exit;
1570
1541
  * effect is not modified. Instead, a new effect is returned with the updated
1571
1542
  * value.
1572
1543
  *
1573
- * **Example** (Adding a Service Charge)
1544
+ * **Example** (Adding a service charge)
1574
1545
  *
1575
1546
  * ```ts
1576
1547
  * import { Effect, pipe } from "effect"
@@ -1592,7 +1563,7 @@ export const exit = internal.exit;
1592
1563
  * @see {@link mapBoth} for a version that operates on both channels.
1593
1564
  * @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
1594
1565
  *
1595
- * @category Mapping
1566
+ * @category mapping
1596
1567
  * @since 2.0.0
1597
1568
  */
1598
1569
  export const map = internal.map;
@@ -1602,7 +1573,7 @@ export const map = internal.map;
1602
1573
  * `as` allows you to ignore the original value inside an effect and
1603
1574
  * replace it with a new constant value.
1604
1575
  *
1605
- * **Example** (Replacing a Value)
1576
+ * **Example** (Replacing a success value)
1606
1577
  *
1607
1578
  * ```ts
1608
1579
  * import { Effect, pipe } from "effect"
@@ -1614,7 +1585,7 @@ export const map = internal.map;
1614
1585
  * // Output: "new value"
1615
1586
  * ```
1616
1587
  *
1617
- * @category Mapping
1588
+ * @category mapping
1618
1589
  * @since 2.0.0
1619
1590
  */
1620
1591
  export const as = internal.as;
@@ -1623,7 +1594,7 @@ export const as = internal.as;
1623
1594
  * in an `Option` value. If the original `Effect` value fails, the returned
1624
1595
  * `Effect` value will also fail.
1625
1596
  *
1626
- * **Example** (Usage)
1597
+ * **Example** (Wrapping success in Option.some)
1627
1598
  *
1628
1599
  * ```ts
1629
1600
  * import { Effect } from "effect"
@@ -1634,7 +1605,7 @@ export const as = internal.as;
1634
1605
  * // { _id: 'Option', _tag: 'Some', value: 42 }
1635
1606
  * ```
1636
1607
  *
1637
- * @category Mapping
1608
+ * @category mapping
1638
1609
  * @since 2.0.0
1639
1610
  */
1640
1611
  export const asSome = internal.asSome;
@@ -1644,7 +1615,7 @@ export const asSome = internal.asSome;
1644
1615
  * succeed. If the original `Effect` value fails, the returned `Effect` value
1645
1616
  * will fail with the same error.
1646
1617
  *
1647
- * **Example** (Usage)
1618
+ * **Example** (Discarding success values)
1648
1619
  *
1649
1620
  * ```ts
1650
1621
  * import { Effect } from "effect"
@@ -1655,7 +1626,7 @@ export const asSome = internal.asSome;
1655
1626
  * // undefined (void)
1656
1627
  * ```
1657
1628
  *
1658
- * @category Mapping
1629
+ * @category mapping
1659
1630
  * @since 2.0.0
1660
1631
  */
1661
1632
  export const asVoid = internal.asVoid;
@@ -1668,7 +1639,7 @@ export const asVoid = internal.asVoid;
1668
1639
  * be helpful in scenarios where you want to handle a success as a failure or
1669
1640
  * treat an error as a valid result.
1670
1641
  *
1671
- * **Example** (Usage)
1642
+ * **Example** (Swapping success and failure channels)
1672
1643
  *
1673
1644
  * ```ts
1674
1645
  * import { Effect } from "effect"
@@ -1682,7 +1653,7 @@ export const asVoid = internal.asVoid;
1682
1653
  * const flipped = Effect.flip(program)
1683
1654
  * ```
1684
1655
  *
1685
- * @category Mapping
1656
+ * @category mapping
1686
1657
  * @since 2.0.0
1687
1658
  */
1688
1659
  export const flip = internal.flip;
@@ -1703,7 +1674,7 @@ export const flip = internal.flip;
1703
1674
  * @see {@link zipWith} for a version that combines the results with a custom function.
1704
1675
  * @see {@link validate} for a version that accumulates errors.
1705
1676
  *
1706
- * **Example** (Combining Two Effects Sequentially)
1677
+ * **Example** (Combining two effects sequentially)
1707
1678
  *
1708
1679
  * ```ts
1709
1680
  * import { Effect } from "effect"
@@ -1730,7 +1701,7 @@ export const flip = internal.flip;
1730
1701
  * // [ 1, 'hello' ]
1731
1702
  * ```
1732
1703
  *
1733
- * **Example** (Combining Two Effects Concurrently)
1704
+ * **Example** (Combining two effects concurrently)
1734
1705
  *
1735
1706
  * ```ts
1736
1707
  * import { Effect } from "effect"
@@ -1754,7 +1725,7 @@ export const flip = internal.flip;
1754
1725
  * // [ 1, 'hello' ]
1755
1726
  * ```
1756
1727
  *
1757
- * @category Zipping
1728
+ * @category zipping
1758
1729
  * @since 2.0.0
1759
1730
  */
1760
1731
  export const zip = internal.zip;
@@ -1773,7 +1744,7 @@ export const zip = internal.zip;
1773
1744
  * By default, the effects are run sequentially. To execute them concurrently,
1774
1745
  * use the `{ concurrent: true }` option.
1775
1746
  *
1776
- * **Example** (Combining Effects with a Custom Function)
1747
+ * **Example** (Combining two success values with a function)
1777
1748
  *
1778
1749
  * ```ts
1779
1750
  * import { Effect } from "effect"
@@ -1801,7 +1772,7 @@ export const zip = internal.zip;
1801
1772
  * // 6
1802
1773
  * ```
1803
1774
  *
1804
- * @category Zipping
1775
+ * @category zipping
1805
1776
  * @since 2.0.0
1806
1777
  */
1807
1778
  export const zipWith = internal.zipWith;
@@ -1825,13 +1796,7 @@ export {
1825
1796
  *
1826
1797
  * @see {@link catchCause} for a version that can recover from both recoverable and unrecoverable errors.
1827
1798
  *
1828
- * **Previously Known As**
1829
- *
1830
- * This API replaces the following from Effect 3.x:
1831
- *
1832
- * - `Effect.catchAll`
1833
- *
1834
- * @category Error Handling
1799
+ * @category error handling
1835
1800
  * @since 4.0.0
1836
1801
  */
1837
1802
  catch_ as catch };
@@ -1849,7 +1814,7 @@ catch_ as catch };
1849
1814
  * The error type must have a readonly `_tag` field to use `catchTag`. This
1850
1815
  * field is used to identify and match errors.
1851
1816
  *
1852
- * **Example** (Usage)
1817
+ * **Example** (Handling a tagged error)
1853
1818
  *
1854
1819
  * ```ts
1855
1820
  * import { Effect } from "effect"
@@ -1873,7 +1838,7 @@ catch_ as catch };
1873
1838
  * )
1874
1839
  * ```
1875
1840
  *
1876
- * @category Error Handling
1841
+ * @category error handling
1877
1842
  * @since 2.0.0
1878
1843
  */
1879
1844
  export const catchTag = internal.catchTag;
@@ -1892,7 +1857,7 @@ export const catchTag = internal.catchTag;
1892
1857
  * The error type must have a readonly `_tag` field to use `catchTag`. This
1893
1858
  * field is used to identify and match errors.
1894
1859
  *
1895
- * **Example** (Usage)
1860
+ * **Example** (Handling multiple tagged errors)
1896
1861
  *
1897
1862
  * ```ts
1898
1863
  * import { Data, Effect } from "effect"
@@ -1917,7 +1882,7 @@ export const catchTag = internal.catchTag;
1917
1882
  * })
1918
1883
  * ```
1919
1884
  *
1920
- * @category Error Handling
1885
+ * @category error handling
1921
1886
  * @since 2.0.0
1922
1887
  */
1923
1888
  export const catchTags = internal.catchTags;
@@ -1927,7 +1892,7 @@ export const catchTags = internal.catchTags;
1927
1892
  * Use this to handle nested error causes without removing the parent error
1928
1893
  * from the error channel. The handler receives the unwrapped reason.
1929
1894
  *
1930
- * **Example** (Usage)
1895
+ * **Example** (Handling an error reason)
1931
1896
  *
1932
1897
  * ```ts
1933
1898
  * import { Data, Effect } from "effect"
@@ -1954,14 +1919,14 @@ export const catchTags = internal.catchTags;
1954
1919
  * )
1955
1920
  * ```
1956
1921
  *
1957
- * @category Error Handling
1922
+ * @category error handling
1958
1923
  * @since 4.0.0
1959
1924
  */
1960
1925
  export const catchReason = internal.catchReason;
1961
1926
  /**
1962
1927
  * Catches multiple reasons within a tagged error using an object of handlers.
1963
1928
  *
1964
- * **Example** (Usage)
1929
+ * **Example** (Handling multiple error reasons)
1965
1930
  *
1966
1931
  * ```ts
1967
1932
  * import { Data, Effect } from "effect"
@@ -1990,7 +1955,7 @@ export const catchReason = internal.catchReason;
1990
1955
  * )
1991
1956
  * ```
1992
1957
  *
1993
- * @category Error Handling
1958
+ * @category error handling
1994
1959
  * @since 4.0.0
1995
1960
  */
1996
1961
  export const catchReasons = internal.catchReasons;
@@ -1998,7 +1963,7 @@ export const catchReasons = internal.catchReasons;
1998
1963
  * Promotes nested reason errors into the Effect error channel, replacing
1999
1964
  * the parent error.
2000
1965
  *
2001
- * **Example** (Usage)
1966
+ * **Example** (Extracting the reason from a tagged error)
2002
1967
  *
2003
1968
  * ```ts
2004
1969
  * import { Data, Effect } from "effect"
@@ -2022,7 +1987,7 @@ export const catchReasons = internal.catchReasons;
2022
1987
  * const unwrapped = program.pipe(Effect.unwrapReason("AiError"))
2023
1988
  * ```
2024
1989
  *
2025
- * @category Error Handling
1990
+ * @category error handling
2026
1991
  * @since 4.0.0
2027
1992
  */
2028
1993
  export const unwrapReason = internal.unwrapReason;
@@ -2043,13 +2008,7 @@ export const unwrapReason = internal.unwrapReason;
2043
2008
  * they often indicate serious issues. However, in some cases, such as
2044
2009
  * dynamically loaded plugins, controlled recovery might be needed.
2045
2010
  *
2046
- * **Previously Known As**
2047
- *
2048
- * This API replaces the following from Effect 3.x:
2049
- *
2050
- * - `Effect.catchAllCause`
2051
- *
2052
- * **Example** (Usage)
2011
+ * **Example** (Recovering from full failure causes)
2053
2012
  *
2054
2013
  * ```ts
2055
2014
  * import { Cause, Console, Effect } from "effect"
@@ -2068,7 +2027,7 @@ export const unwrapReason = internal.unwrapReason;
2068
2027
  * })
2069
2028
  * ```
2070
2029
  *
2071
- * @category Error Handling
2030
+ * @category error handling
2072
2031
  * @since 4.0.0
2073
2032
  */
2074
2033
  export const catchCause = internal.catchCause;
@@ -2091,13 +2050,7 @@ export const catchCause = internal.catchCause;
2091
2050
  * they often indicate serious issues. In some cases, such as dynamically loaded
2092
2051
  * plugins, controlled recovery may be needed.
2093
2052
  *
2094
- * **Previously Known As**
2095
- *
2096
- * This API replaces the following from Effect 3.x:
2097
- *
2098
- * - `Effect.catchAllDefect`
2099
- *
2100
- * **Example** (Usage)
2053
+ * **Example** (Recovering from defects)
2101
2054
  *
2102
2055
  * ```ts
2103
2056
  * import { Console, Effect } from "effect"
@@ -2115,7 +2068,7 @@ export const catchCause = internal.catchCause;
2115
2068
  * })
2116
2069
  * ```
2117
2070
  *
2118
- * @category Error Handling
2071
+ * @category error handling
2119
2072
  * @since 4.0.0
2120
2073
  */
2121
2074
  export const catchDefect = internal.catchDefect;
@@ -2129,14 +2082,7 @@ export const catchDefect = internal.catchDefect;
2129
2082
  * matching. Non-matching errors re-fail with the original cause. Defects and
2130
2083
  * interrupts are not caught.
2131
2084
  *
2132
- * **Previously Known As**
2133
- *
2134
- * This API replaces the following:
2135
- *
2136
- * - `Effect.catchSome` (Effect 3.x)
2137
- * - `Effect.catchIf`
2138
- *
2139
- * **Example** (Usage)
2085
+ * **Example** (Recovering when a predicate matches)
2140
2086
  *
2141
2087
  * ```ts
2142
2088
  * import { Data, Effect, Filter } from "effect"
@@ -2162,14 +2108,14 @@ export const catchDefect = internal.catchDefect;
2162
2108
  * )
2163
2109
  * ```
2164
2110
  *
2165
- * @category Error Handling
2111
+ * @category error handling
2166
2112
  * @since 2.0.0
2167
2113
  */
2168
2114
  export const catchIf = internal.catchIf;
2169
2115
  /**
2170
2116
  * Recovers from specific errors using a `Filter`.
2171
2117
  *
2172
- * @category Error Handling
2118
+ * @category error handling
2173
2119
  * @since 4.0.0
2174
2120
  */
2175
2121
  export const catchFilter = internal.catchFilter;
@@ -2179,7 +2125,7 @@ export const catchFilter = internal.catchFilter;
2179
2125
  * Success values become `Option.some`, `NoSuchElementError` becomes
2180
2126
  * `Option.none`, and all other errors are preserved.
2181
2127
  *
2182
- * **Example** (Usage)
2128
+ * **Example** (Recovering from missing Option values)
2183
2129
  *
2184
2130
  * ```ts
2185
2131
  * import { Effect, Option } from "effect"
@@ -2191,14 +2137,8 @@ export const catchFilter = internal.catchFilter;
2191
2137
  * Effect.runPromise(none).then(console.log) // { _id: 'Option', _tag: 'None' }
2192
2138
  * ```
2193
2139
  *
2194
- * **Previously Known As**
2195
- *
2196
- * This API replaces the following from Effect 3.x:
2197
- *
2198
- * - `Effect.optionFromOptional`
2199
- *
2200
- * @category Error Handling
2201
- * @since 2.0.0
2140
+ * @category error handling
2141
+ * @since 4.0.0
2202
2142
  */
2203
2143
  export const catchNoSuchElement = internal.catchNoSuchElement;
2204
2144
  /**
@@ -2208,13 +2148,7 @@ export const catchNoSuchElement = internal.catchNoSuchElement;
2208
2148
  * that match a specific predicate. This is useful when you want to handle
2209
2149
  * only certain types of errors while letting others propagate.
2210
2150
  *
2211
- * **Previously Known As**
2212
- *
2213
- * This API replaces the following from Effect 3.x:
2214
- *
2215
- * - `Effect.catchSomeCause`
2216
- *
2217
- * **Example** (Usage)
2151
+ * **Example** (Recovering from selected causes)
2218
2152
  *
2219
2153
  * ```ts
2220
2154
  * import { Cause, Console, Effect } from "effect"
@@ -2237,14 +2171,14 @@ export const catchNoSuchElement = internal.catchNoSuchElement;
2237
2171
  * // Then: "Fallback response"
2238
2172
  * ```
2239
2173
  *
2240
- * @category Error Handling
2174
+ * @category error handling
2241
2175
  * @since 4.0.0
2242
2176
  */
2243
2177
  export const catchCauseIf = internal.catchCauseIf;
2244
2178
  /**
2245
2179
  * Recovers from specific failures based on a `Filter`.
2246
2180
  *
2247
- * @category Error Handling
2181
+ * @category error handling
2248
2182
  * @since 4.0.0
2249
2183
  */
2250
2184
  export const catchCauseFilter = internal.catchCauseFilter;
@@ -2259,9 +2193,9 @@ export const catchCauseFilter = internal.catchCauseFilter;
2259
2193
  *
2260
2194
  * @see {@link map} for a version that operates on the success channel.
2261
2195
  * @see {@link mapBoth} for a version that operates on both channels.
2262
- * @see {@link orElseFail} if you want to replace the error with a new one.
2196
+ * @see {@link mapError} if you want to replace the error with a new one.
2263
2197
  *
2264
- * **Example** (Usage)
2198
+ * **Example** (Transforming the error channel)
2265
2199
  *
2266
2200
  * ```ts
2267
2201
  * import { Data, Effect } from "effect"
@@ -2280,7 +2214,7 @@ export const catchCauseFilter = internal.catchCauseFilter;
2280
2214
  * )
2281
2215
  * ```
2282
2216
  *
2283
- * @category Error Handling
2217
+ * @category error handling
2284
2218
  * @since 2.0.0
2285
2219
  */
2286
2220
  export const mapError = internal.mapError;
@@ -2294,7 +2228,7 @@ export const mapError = internal.mapError;
2294
2228
  * the error and the success values without altering the overall success or
2295
2229
  * failure status of the effect.
2296
2230
  *
2297
- * **Example** (Usage)
2231
+ * **Example** (Transforming success and failure channels)
2298
2232
  *
2299
2233
  * ```ts
2300
2234
  * import { Data, Effect } from "effect"
@@ -2316,7 +2250,7 @@ export const mapError = internal.mapError;
2316
2250
  * @see {@link map} for a version that operates on the success channel.
2317
2251
  * @see {@link mapError} for a version that operates on the error channel.
2318
2252
  *
2319
- * @category Mapping
2253
+ * @category mapping
2320
2254
  * @since 2.0.0
2321
2255
  */
2322
2256
  export const mapBoth = internal.mapBoth;
@@ -2329,9 +2263,9 @@ export const mapBoth = internal.mapBoth;
2329
2263
  * Use `orDie` when a typed failure represents an unrecoverable bug or invalid
2330
2264
  * state and should not be handled as a recoverable error.
2331
2265
  *
2332
- * @see {@link orDieWith} if you need to customize the error.
2266
+ * @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
2333
2267
  *
2334
- * **Example** (Propagating an Error as a Defect)
2268
+ * **Example** (Converting typed failures into defects)
2335
2269
  *
2336
2270
  * ```ts
2337
2271
  * import { Data, Effect } from "effect"
@@ -2367,7 +2301,7 @@ export const orDie = internal.orDie;
2367
2301
  * operation passed to `tapError` fails, that error is also represented in the
2368
2302
  * returned effect's error channel.
2369
2303
  *
2370
- * **Example** (Usage)
2304
+ * **Example** (Running effects on failure)
2371
2305
  *
2372
2306
  * ```ts
2373
2307
  * import { Console, Effect } from "effect"
@@ -2386,7 +2320,7 @@ export const orDie = internal.orDie;
2386
2320
  * // expected error: NetworkError
2387
2321
  * ```
2388
2322
  *
2389
- * @category Sequencing
2323
+ * @category sequencing
2390
2324
  * @since 2.0.0
2391
2325
  */
2392
2326
  export const tapError = internal.tapError;
@@ -2397,7 +2331,7 @@ export const tapError = internal.tapError;
2397
2331
  * list of tags. When the handler succeeds, the original failure is preserved;
2398
2332
  * if the handler fails, its error is also included in the returned effect.
2399
2333
  *
2400
- * **Example** (Usage)
2334
+ * **Example** (Running effects for tagged failures)
2401
2335
  *
2402
2336
  * ```ts
2403
2337
  * import { Console, Data, Effect } from "effect"
@@ -2422,7 +2356,7 @@ export const tapError = internal.tapError;
2422
2356
  * // expected error: 504
2423
2357
  * ```
2424
2358
  *
2425
- * @category Sequencing
2359
+ * @category sequencing
2426
2360
  * @since 2.0.0
2427
2361
  */
2428
2362
  export const tapErrorTag = internal.tapErrorTag;
@@ -2436,13 +2370,7 @@ export const tapErrorTag = internal.tapErrorTag;
2436
2370
  * the operation succeeds, the original cause is preserved. If the operation
2437
2371
  * fails, its error is also represented in the returned effect.
2438
2372
  *
2439
- * **Previously Known As**
2440
- *
2441
- * This API replaces the following from Effect 3.x:
2442
- *
2443
- * - `Effect.tapErrorCause`
2444
- *
2445
- * **Example** (Usage)
2373
+ * **Example** (Observing full failure causes)
2446
2374
  *
2447
2375
  * ```ts
2448
2376
  * import { Cause, Console, Effect } from "effect"
@@ -2459,8 +2387,8 @@ export const tapErrorTag = internal.tapErrorTag;
2459
2387
  * // Then: { _id: 'Exit', _tag: 'Failure', cause: ... }
2460
2388
  * ```
2461
2389
  *
2462
- * @category Sequencing
2463
- * @since 2.0.0
2390
+ * @category sequencing
2391
+ * @since 4.0.0
2464
2392
  */
2465
2393
  export const tapCause = internal.tapCause;
2466
2394
  /**
@@ -2470,7 +2398,7 @@ export const tapCause = internal.tapCause;
2470
2398
  * the cause matches a specific predicate. This is useful for conditional logging,
2471
2399
  * monitoring, or other side effects based on the type of failure.
2472
2400
  *
2473
- * **Example** (Usage)
2401
+ * **Example** (Observing selected failure causes)
2474
2402
  *
2475
2403
  * ```ts
2476
2404
  * import { Cause, Console, Effect } from "effect"
@@ -2489,14 +2417,14 @@ export const tapCause = internal.tapCause;
2489
2417
  * // Then: { _id: 'Exit', _tag: 'Failure', cause: ... }
2490
2418
  * ```
2491
2419
  *
2492
- * @category Sequencing
2420
+ * @category sequencing
2493
2421
  * @since 4.0.0
2494
2422
  */
2495
2423
  export const tapCauseIf = internal.tapCauseIf;
2496
2424
  /**
2497
2425
  * Conditionally executes a side effect based on the cause of a failed effect.
2498
2426
  *
2499
- * @category Sequencing
2427
+ * @category sequencing
2500
2428
  * @since 4.0.0
2501
2429
  */
2502
2430
  export const tapCauseFilter = internal.tapCauseFilter;
@@ -2510,7 +2438,7 @@ export const tapCauseFilter = internal.tapCauseFilter;
2510
2438
  * operation succeeds, the original defect is preserved; if the operation fails,
2511
2439
  * its error is also represented in the returned effect.
2512
2440
  *
2513
- * **Example** (Usage)
2441
+ * **Example** (Observing defects)
2514
2442
  *
2515
2443
  * ```ts
2516
2444
  * import { Console, Effect } from "effect"
@@ -2544,7 +2472,7 @@ export const tapCauseFilter = internal.tapCauseFilter;
2544
2472
  * // ... stack trace ...
2545
2473
  * ```
2546
2474
  *
2547
- * @category Sequencing
2475
+ * @category sequencing
2548
2476
  * @since 2.0.0
2549
2477
  */
2550
2478
  export const tapDefect = internal.tapDefect;
@@ -2553,7 +2481,7 @@ export const tapDefect = internal.tapDefect;
2553
2481
  *
2554
2482
  * Yields between attempts so other fibers can run.
2555
2483
  *
2556
- * **Example** (Usage)
2484
+ * **Example** (Retrying until success)
2557
2485
  *
2558
2486
  * ```ts
2559
2487
  * import { Console, Effect } from "effect"
@@ -2600,7 +2528,7 @@ export const eventually = internal.eventually;
2600
2528
  * Use `retry` when typed failures may be transient, such as network issues or
2601
2529
  * temporary resource unavailability.
2602
2530
  *
2603
- * **Example** (Usage)
2531
+ * **Example** (Retrying with a schedule)
2604
2532
  *
2605
2533
  * ```ts
2606
2534
  * import { Data, Effect, Schedule } from "effect"
@@ -2627,7 +2555,7 @@ export const eventually = internal.eventually;
2627
2555
  * @see {@link retryOrElse} for a version that allows you to run a fallback.
2628
2556
  * @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
2629
2557
  *
2630
- * @category Error Handling
2558
+ * @category error handling
2631
2559
  * @since 2.0.0
2632
2560
  */
2633
2561
  export const retry = internalSchedule.retry;
@@ -2649,7 +2577,7 @@ export const retry = internalSchedule.retry;
2649
2577
  *
2650
2578
  * @see {@link retry} for a version that does not run a fallback effect.
2651
2579
  *
2652
- * **Example** (Usage)
2580
+ * **Example** (Falling back after retries are exhausted)
2653
2581
  *
2654
2582
  * ```ts
2655
2583
  * import { Console, Data, Effect, Schedule } from "effect"
@@ -2685,7 +2613,7 @@ export const retry = internalSchedule.retry;
2685
2613
  * // Network data
2686
2614
  * ```
2687
2615
  *
2688
- * @category Error Handling
2616
+ * @category error handling
2689
2617
  * @since 2.0.0
2690
2618
  */
2691
2619
  export const retryOrElse = internalSchedule.retryOrElse;
@@ -2698,7 +2626,7 @@ export const retryOrElse = internalSchedule.retryOrElse;
2698
2626
  * failures, defects, and interruptions. Use `unsandbox` to restore the original
2699
2627
  * typed error channel after cause-level handling.
2700
2628
  *
2701
- * **Example** (Usage)
2629
+ * **Example** (Exposing failures as causes)
2702
2630
  *
2703
2631
  * ```ts
2704
2632
  * import { Cause, Effect } from "effect"
@@ -2715,9 +2643,9 @@ export const retryOrElse = internalSchedule.retryOrElse;
2715
2643
  * // Output: "Caught cause: Something went wrong"
2716
2644
  * ```
2717
2645
  *
2718
- * @see {@link unsandbox} to restore the original error handling.
2646
+ * @see {@link sandbox} to expose failures as full causes.
2719
2647
  *
2720
- * @category Error Handling
2648
+ * @category error handling
2721
2649
  * @since 2.0.0
2722
2650
  */
2723
2651
  export const sandbox = internal.sandbox;
@@ -2733,7 +2661,7 @@ export const sandbox = internal.sandbox;
2733
2661
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
2734
2662
  * and `message` to prepend a custom log message.
2735
2663
  *
2736
- * **Example** (Using Effect.ignore to Discard Values)
2664
+ * **Example** (Discarding success and failure values)
2737
2665
  *
2738
2666
  * ```ts
2739
2667
  * import { Effect } from "effect"
@@ -2758,13 +2686,7 @@ export const sandbox = internal.sandbox;
2758
2686
  * const programWarn = task.pipe(Effect.ignore({ log: "Warn", message: "Ignoring task failure" }))
2759
2687
  * ```
2760
2688
  *
2761
- * **Previously Known As**
2762
- *
2763
- * This API replaces the following from Effect 3.x:
2764
- *
2765
- * - `Effect.ignoreLogged`
2766
- *
2767
- * @category Error Handling
2689
+ * @category error handling
2768
2690
  * @since 2.0.0
2769
2691
  */
2770
2692
  export const ignore = internal.ignore;
@@ -2774,7 +2696,7 @@ export const ignore = internal.ignore;
2774
2696
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
2775
2697
  * and `message` to prepend a custom log message.
2776
2698
  *
2777
- * **Example** (Usage)
2699
+ * **Example** (Ignoring failures and logging causes)
2778
2700
  *
2779
2701
  * ```ts
2780
2702
  * import { Effect } from "effect"
@@ -2785,7 +2707,7 @@ export const ignore = internal.ignore;
2785
2707
  * const programLog = task.pipe(Effect.ignoreCause({ log: true, message: "Ignoring failure cause" }))
2786
2708
  * ```
2787
2709
  *
2788
- * @category Error Handling
2710
+ * @category error handling
2789
2711
  * @since 4.0.0
2790
2712
  */
2791
2713
  export const ignoreCause = internal.ignoreCause;
@@ -2797,10 +2719,10 @@ export const ignoreCause = internal.ignoreCause;
2797
2719
  * and retry timing is derived per step (the first attempt uses the remaining
2798
2720
  * attempts schedule; later retries apply the step schedule at least once).
2799
2721
  *
2800
- * **Example** (Usage)
2722
+ * **Example** (Retrying with an execution plan)
2801
2723
  *
2802
2724
  * ```ts
2803
- * import { Effect, ExecutionPlan, Layer, Context } from "effect"
2725
+ * import { Context, Effect, ExecutionPlan, Layer } from "effect"
2804
2726
  *
2805
2727
  * const Endpoint = Context.Service<{ url: string }>("Endpoint")
2806
2728
  *
@@ -2830,7 +2752,7 @@ export const withExecutionPlan = internalExecutionPlan.withExecutionPlan;
2830
2752
  * If the `defectsOnly` option is set to `true`, only defects (unrecoverable
2831
2753
  * errors) will be reported, while regular failures will be ignored.
2832
2754
  *
2833
- * @category Error Handling
2755
+ * @category error handling
2834
2756
  * @since 4.0.0
2835
2757
  */
2836
2758
  export const withErrorReporting = internal.withErrorReporting;
@@ -2848,7 +2770,7 @@ export const withErrorReporting = internal.withErrorReporting;
2848
2770
  *
2849
2771
  * Defects and interruptions are not recovered by this operator.
2850
2772
  *
2851
- * **Example** (Usage)
2773
+ * **Example** (Replacing failures with a value)
2852
2774
  *
2853
2775
  * ```ts
2854
2776
  * import { Effect } from "effect"
@@ -2894,7 +2816,7 @@ export const orElseSucceed = internal.orElseSucceed;
2894
2816
  * attempting multiple APIs, reading configuration from several sources, or
2895
2817
  * trying alternative resource locations in order.
2896
2818
  *
2897
- * **Example** (Usage)
2819
+ * **Example** (Trying alternatives until one succeeds)
2898
2820
  *
2899
2821
  * ```ts
2900
2822
  * import { Effect } from "effect"
@@ -2932,11 +2854,9 @@ export const firstSuccessOf = internal.firstSuccessOf;
2932
2854
  * your program waits for a task to finish, ensuring that it doesn't hang
2933
2855
  * indefinitely if the task takes too long.
2934
2856
  *
2935
- * @see {@link timeoutFail} for a version that raises a custom error.
2936
- * @see {@link timeoutFailCause} for a version that raises a custom defect.
2937
- * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
2857
+ * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
2938
2858
  *
2939
- * **Example** (Usage)
2859
+ * **Example** (Failing when work takes too long)
2940
2860
  *
2941
2861
  * ```ts
2942
2862
  * import { Effect } from "effect"
@@ -2982,11 +2902,9 @@ export const timeout = internal.timeout;
2982
2902
  * source effect fails before the timeout, that failure is preserved.
2983
2903
  *
2984
2904
  * @see {@link timeout} for a version that raises a `TimeoutException`.
2985
- * @see {@link timeoutFail} for a version that raises a custom error.
2986
- * @see {@link timeoutFailCause} for a version that raises a custom defect.
2987
- * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
2905
+ * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
2988
2906
  *
2989
- * **Example** (Usage)
2907
+ * **Example** (Returning None on timeout)
2990
2908
  *
2991
2909
  * ```ts
2992
2910
  * import { Effect } from "effect"
@@ -3024,7 +2942,7 @@ export const timeoutOption = internal.timeoutOption;
3024
2942
  * This function is useful when you want to set a maximum duration for an operation
3025
2943
  * and provide an alternative action if the timeout is exceeded.
3026
2944
  *
3027
- * **Example** (Usage)
2945
+ * **Example** (Falling back on timeout)
3028
2946
  *
3029
2947
  * ```ts
3030
2948
  * import { Console, Effect } from "effect"
@@ -3053,14 +2971,14 @@ export const timeoutOption = internal.timeoutOption;
3053
2971
  * ```
3054
2972
  *
3055
2973
  * @category Delays & Timeouts
3056
- * @since 3.1.0
2974
+ * @since 4.0.0
3057
2975
  */
3058
2976
  export const timeoutOrElse = internal.timeoutOrElse;
3059
2977
  /**
3060
2978
  * Returns an effect that is delayed from this effect by the specified
3061
2979
  * `Duration`.
3062
2980
  *
3063
- * **Example** (Usage)
2981
+ * **Example** (Delaying an effect)
3064
2982
  *
3065
2983
  * ```ts
3066
2984
  * import { Console, Effect } from "effect"
@@ -3082,7 +3000,7 @@ export const delay = internal.delay;
3082
3000
  * Returns an effect that suspends the current fiber for the specified duration
3083
3001
  * without blocking a JavaScript thread.
3084
3002
  *
3085
- * **Example** (Usage)
3003
+ * **Example** (Pausing without blocking)
3086
3004
  *
3087
3005
  * ```ts
3088
3006
  * import { Console, Effect } from "effect"
@@ -3108,7 +3026,7 @@ export const sleep = internal.sleep;
3108
3026
  * The original success, failure, or interruption is preserved; only the success
3109
3027
  * value is paired with the duration.
3110
3028
  *
3111
- * **Example** (Usage)
3029
+ * **Example** (Measuring execution time)
3112
3030
  *
3113
3031
  * ```ts
3114
3032
  * import { Console, Duration, Effect } from "effect"
@@ -3143,7 +3061,7 @@ export const timed = internal.timed;
3143
3061
  *
3144
3062
  * @see {@link race} for a version that handles only two effects.
3145
3063
  *
3146
- * **Example** (Usage)
3064
+ * **Example** (Racing many effects)
3147
3065
  *
3148
3066
  * ```ts
3149
3067
  * import { Duration, Effect } from "effect"
@@ -3173,7 +3091,7 @@ export const raceAll = internal.raceAll;
3173
3091
  * `raceAll` when early failures should be ignored until a success occurs or
3174
3092
  * all effects fail.
3175
3093
  *
3176
- * **Example** (Usage)
3094
+ * **Example** (Taking the first settled result)
3177
3095
  *
3178
3096
  * ```ts
3179
3097
  * import { Duration, Effect } from "effect"
@@ -3199,7 +3117,7 @@ export const raceAllFirst = internal.raceAllFirst;
3199
3117
  * If one effect succeeds, the other is interrupted and `onWinner` can observe the
3200
3118
  * winning fiber. If both fail, the race fails.
3201
3119
  *
3202
- * **Example** (Usage)
3120
+ * **Example** (Racing two effects)
3203
3121
  *
3204
3122
  * ```ts
3205
3123
  * import { Console, Duration, Effect } from "effect"
@@ -3226,7 +3144,7 @@ export const race = internal.race;
3226
3144
  *
3227
3145
  * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
3228
3146
  *
3229
- * **Example** (Usage)
3147
+ * **Example** (Observing the winning fiber)
3230
3148
  *
3231
3149
  * ```ts
3232
3150
  * import { Console, Duration, Effect } from "effect"
@@ -3257,7 +3175,7 @@ export const raceFirst = internal.raceFirst;
3257
3175
  * Filters elements of an iterable using a predicate, refinement, or effectful
3258
3176
  * predicate.
3259
3177
  *
3260
- * **Example** (Usage)
3178
+ * **Example** (Filtering success values)
3261
3179
  *
3262
3180
  * ```ts
3263
3181
  * import { Effect } from "effect"
@@ -3271,21 +3189,21 @@ export const raceFirst = internal.raceFirst;
3271
3189
  * // Use Effect.filterMapEffect for effectful Filter.Filter callbacks
3272
3190
  * ```
3273
3191
  *
3274
- * @category Filtering
3192
+ * @category filtering
3275
3193
  * @since 2.0.0
3276
3194
  */
3277
3195
  export const filter = internal.filter;
3278
3196
  /**
3279
3197
  * Filters and maps elements of an iterable with a `Filter`.
3280
3198
  *
3281
- * @category Filtering
3282
- * @since 4.0.0
3199
+ * @category filtering
3200
+ * @since 2.0.0
3283
3201
  */
3284
3202
  export const filterMap = internal.filterMap;
3285
3203
  /**
3286
3204
  * Effectfully filters and maps elements of an iterable with a `FilterEffect`.
3287
3205
  *
3288
- * @category Filtering
3206
+ * @category filtering
3289
3207
  * @since 4.0.0
3290
3208
  */
3291
3209
  export const filterMapEffect = internal.filterMapEffect;
@@ -3299,7 +3217,7 @@ export const filterMapEffect = internal.filterMapEffect;
3299
3217
  * `orElse` effect can produce an alternative value or perform additional
3300
3218
  * computations.
3301
3219
  *
3302
- * **Example** (Usage)
3220
+ * **Example** (Filtering with a fallback effect)
3303
3221
  *
3304
3222
  * ```ts
3305
3223
  * import { Effect } from "effect"
@@ -3317,14 +3235,14 @@ export const filterMapEffect = internal.filterMapEffect;
3317
3235
  * // Result: "Number 5 is odd" (since 5 is not even)
3318
3236
  * ```
3319
3237
  *
3320
- * @category Filtering
3238
+ * @category filtering
3321
3239
  * @since 2.0.0
3322
3240
  */
3323
3241
  export const filterOrElse = internal.filterOrElse;
3324
3242
  /**
3325
3243
  * Filters an effect with a `Filter`, providing an alternative effect on failure.
3326
3244
  *
3327
- * @category Filtering
3245
+ * @category filtering
3328
3246
  * @since 4.0.0
3329
3247
  */
3330
3248
  export const filterMapOrElse = internal.filterMapOrElse;
@@ -3337,7 +3255,7 @@ export const filterMapOrElse = internal.filterMapOrElse;
3337
3255
  * predicate evaluates to `false`, the effect fails with either a custom
3338
3256
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
3339
3257
  *
3340
- * **Example** (Usage)
3258
+ * **Example** (Filtering with a custom failure)
3341
3259
  *
3342
3260
  * ```ts
3343
3261
  * import { Effect } from "effect"
@@ -3355,14 +3273,14 @@ export const filterMapOrElse = internal.filterMapOrElse;
3355
3273
  * // Result: Effect.fail("Expected even number, got 5")
3356
3274
  * ```
3357
3275
  *
3358
- * @category Filtering
3276
+ * @category filtering
3359
3277
  * @since 2.0.0
3360
3278
  */
3361
3279
  export const filterOrFail = internal.filterOrFail;
3362
3280
  /**
3363
3281
  * Filters an effect with a `Filter`, failing when the filter fails.
3364
3282
  *
3365
- * @category Filtering
3283
+ * @category filtering
3366
3284
  * @since 4.0.0
3367
3285
  */
3368
3286
  export const filterMapOrFail = internal.filterMapOrFail;
@@ -3385,7 +3303,7 @@ export const filterMapOrFail = internal.filterMapOrFail;
3385
3303
  * Use this when an effectful check decides whether to run another effect while
3386
3304
  * representing the skipped case explicitly.
3387
3305
  *
3388
- * **Example** (Usage)
3306
+ * **Example** (Conditionally running an effect)
3389
3307
  *
3390
3308
  * ```ts
3391
3309
  * import { Console, Effect } from "effect"
@@ -3402,8 +3320,7 @@ export const filterMapOrFail = internal.filterMapOrFail;
3402
3320
  * // { _id: 'Option', _tag: 'Some', value: undefined }
3403
3321
  * ```
3404
3322
  *
3405
- * @see {@link whenEffect} for a version that allows the condition to be an effect.
3406
- * @see {@link unless} for a version that executes the effect when the condition is `false`.
3323
+ * @see {@link when} for conditional execution with a boolean condition.
3407
3324
  *
3408
3325
  * @category Conditional Operators
3409
3326
  * @since 2.0.0
@@ -3430,7 +3347,7 @@ export const when = internal.when;
3430
3347
  *
3431
3348
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
3432
3349
  *
3433
- * **Example** (Handling Both Success and Failure Cases)
3350
+ * **Example** (Matching success and failure values)
3434
3351
  *
3435
3352
  * ```ts
3436
3353
  * import { Data, Effect } from "effect"
@@ -3483,7 +3400,7 @@ export const match = internal.match;
3483
3400
  * optimal performance for resolved effects. This is particularly useful in
3484
3401
  * scenarios where you frequently work with already computed values.
3485
3402
  *
3486
- * **Example** (Usage)
3403
+ * **Example** (Pattern matching eagerly when possible)
3487
3404
  *
3488
3405
  * ```ts
3489
3406
  * import { Effect } from "effect"
@@ -3501,7 +3418,7 @@ export const match = internal.match;
3501
3418
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
3502
3419
  *
3503
3420
  * @category Pattern Matching
3504
- * @since 2.0.0
3421
+ * @since 4.0.0
3505
3422
  */
3506
3423
  export const matchEager = internal.matchEager;
3507
3424
  /**
@@ -3518,7 +3435,7 @@ export const matchEager = internal.matchEager;
3518
3435
  * regular failures, defects, or interruptions. You can provide specific
3519
3436
  * handling logic for each failure type based on the cause.
3520
3437
  *
3521
- * **Example** (Usage)
3438
+ * **Example** (Matching on success or failure causes)
3522
3439
  *
3523
3440
  * ```ts
3524
3441
  * import { Cause, Effect } from "effect"
@@ -3557,7 +3474,7 @@ export const matchCause = internal.matchCause;
3557
3474
  * and you want to avoid the overhead of the effect pipeline. For pending effects,
3558
3475
  * it automatically falls back to the regular `matchCause` behavior.
3559
3476
  *
3560
- * **Example** (Usage)
3477
+ * **Example** (Eagerly matching already completed effects)
3561
3478
  *
3562
3479
  * ```ts
3563
3480
  * import { Effect } from "effect"
@@ -3569,7 +3486,7 @@ export const matchCause = internal.matchCause;
3569
3486
  * ```
3570
3487
  *
3571
3488
  * @category Pattern Matching
3572
- * @since 3.8.0
3489
+ * @since 4.0.0
3573
3490
  */
3574
3491
  export const matchCauseEager = internal.matchCauseEager;
3575
3492
  /**
@@ -3594,7 +3511,7 @@ export const matchCauseEffectEager = internal.matchCauseEffectEager;
3594
3511
  * you to respond accordingly while performing side effects (like logging or
3595
3512
  * other operations).
3596
3513
  *
3597
- * **Example** (Usage)
3514
+ * **Example** (Effectfully matching on causes)
3598
3515
  *
3599
3516
  * ```ts
3600
3517
  * import { Cause, Console, Data, Effect, Result } from "effect"
@@ -3653,7 +3570,7 @@ export const matchCauseEffect = internal.matchCauseEffect;
3653
3570
  * @see {@link match} if you don't need side effects and only want to handle the
3654
3571
  * result or failure.
3655
3572
  *
3656
- * **Example** (Handling Both Success and Failure Cases with Side Effects)
3573
+ * **Example** (Matching success and failure with effectful handlers)
3657
3574
  *
3658
3575
  * ```ts
3659
3576
  * import { Data, Effect } from "effect"
@@ -3762,10 +3679,10 @@ export const isSuccess = internal.isSuccess;
3762
3679
  * in the effect's environment. This can be useful for debugging, introspection,
3763
3680
  * or when you need to pass the entire context to another function.
3764
3681
  *
3765
- * **Example** (Usage)
3682
+ * **Example** (Reading the full context)
3766
3683
  *
3767
3684
  * ```ts
3768
- * import { Console, Effect, Option, Context } from "effect"
3685
+ * import { Console, Context, Effect, Option } from "effect"
3769
3686
  *
3770
3687
  * const Logger = Context.Service<{
3771
3688
  * log: (msg: string) => void
@@ -3802,10 +3719,10 @@ export const context = internal.context;
3802
3719
  * computations based on all available services. This is useful when you need
3803
3720
  * to conditionally execute logic based on what services are available.
3804
3721
  *
3805
- * **Example** (Usage)
3722
+ * **Example** (Deriving values from the context)
3806
3723
  *
3807
3724
  * ```ts
3808
- * import { Console, Effect, Option, Context } from "effect"
3725
+ * import { Console, Context, Effect, Option } from "effect"
3809
3726
  *
3810
3727
  * const Logger = Context.Service<{
3811
3728
  * log: (msg: string) => void
@@ -3846,10 +3763,10 @@ export const contextWith = internal.contextWith;
3846
3763
  * to build the layer every time; by default, layers are shared between provide
3847
3764
  * calls.
3848
3765
  *
3849
- * **Example** (Usage)
3766
+ * **Example** (Providing dependencies with a layer)
3850
3767
  *
3851
3768
  * ```ts
3852
- * import { Effect, Layer, Context } from "effect"
3769
+ * import { Context, Effect, Layer } from "effect"
3853
3770
  *
3854
3771
  * interface Database {
3855
3772
  * readonly query: (sql: string) => Effect.Effect<string>
@@ -3885,10 +3802,10 @@ export const provide = internalLayer.provide;
3885
3802
  * that contains all the required services. It removes the provided services
3886
3803
  * from the effect's requirements, making them available to the effect.
3887
3804
  *
3888
- * **Example** (Usage)
3805
+ * **Example** (Providing a complete context)
3889
3806
  *
3890
3807
  * ```ts
3891
- * import { Effect, Context } from "effect"
3808
+ * import { Context, Effect } from "effect"
3892
3809
  *
3893
3810
  * // Define service keys
3894
3811
  * const Logger = Context.Service<{
@@ -3914,16 +3831,16 @@ export const provide = internalLayer.provide;
3914
3831
  * ```
3915
3832
  *
3916
3833
  * @category Environment
3917
- * @since 2.0.0
3834
+ * @since 4.0.0
3918
3835
  */
3919
3836
  export const provideContext = internal.provideContext;
3920
3837
  /**
3921
3838
  * Accesses a service from the context.
3922
3839
  *
3923
- * **Example** (Usage)
3840
+ * **Example** (Accessing a required service)
3924
3841
  *
3925
3842
  * ```ts
3926
- * import { Effect, Context } from "effect"
3843
+ * import { Context, Effect } from "effect"
3927
3844
  *
3928
3845
  * interface Database {
3929
3846
  * readonly query: (sql: string) => Effect.Effect<string>
@@ -3951,10 +3868,10 @@ export const service = internal.service;
3951
3868
  * available, it returns `None`. Unlike `service`, this function does not
3952
3869
  * require the service to be present in the environment.
3953
3870
  *
3954
- * **Example** (Usage)
3871
+ * **Example** (Accessing an optional service)
3955
3872
  *
3956
3873
  * ```ts
3957
- * import { Effect, Option, Context } from "effect"
3874
+ * import { Context, Effect, Option } from "effect"
3958
3875
  *
3959
3876
  * // Define a service key
3960
3877
  * const Logger = Context.Service<{
@@ -3985,10 +3902,10 @@ export const serviceOption = internal.serviceOption;
3985
3902
  * This function allows you to transform the context required by an effect,
3986
3903
  * providing part of the context and leaving the rest to be fulfilled later.
3987
3904
  *
3988
- * **Example** (Usage)
3905
+ * **Example** (Updating the context before running)
3989
3906
  *
3990
3907
  * ```ts
3991
- * import { Effect, Context } from "effect"
3908
+ * import { Context, Effect } from "effect"
3992
3909
  *
3993
3910
  * // Define services
3994
3911
  * const Logger = Context.Service<{
@@ -4026,10 +3943,10 @@ export const updateContext = internal.updateContext;
4026
3943
  * The service must be available in the effect's context; `updateService`
4027
3944
  * replaces it for the wrapped effect with the value returned by the updater.
4028
3945
  *
4029
- * **Example** (Usage)
3946
+ * **Example** (Replacing a service for one effect)
4030
3947
  *
4031
3948
  * ```ts
4032
- * import { Console, Effect, Context } from "effect"
3949
+ * import { Console, Context, Effect } from "effect"
4033
3950
  *
4034
3951
  * // Define a counter service
4035
3952
  * const Counter = Context.Service<{ count: number }>("Counter")
@@ -4065,10 +3982,10 @@ export const updateService = internal.updateService;
4065
3982
  *
4066
3983
  * @see {@link provide} for providing multiple layers to an effect.
4067
3984
  *
4068
- * **Example** (Usage)
3985
+ * **Example** (Providing a service value)
4069
3986
  *
4070
3987
  * ```ts
4071
- * import { Console, Effect, Context } from "effect"
3988
+ * import { Console, Context, Effect } from "effect"
4072
3989
  *
4073
3990
  * // Define a service for configuration
4074
3991
  * const Config = Context.Service<{
@@ -4110,10 +4027,10 @@ export const provideService = internal.provideService;
4110
4027
  * and leaves any other requirements to be provided later. Acquisition failures
4111
4028
  * are included in the returned effect's error channel.
4112
4029
  *
4113
- * **Example** (Usage)
4030
+ * **Example** (Providing a service with an effect)
4114
4031
  *
4115
4032
  * ```ts
4116
- * import { Console, Effect, Context } from "effect"
4033
+ * import { Console, Context, Effect } from "effect"
4117
4034
  *
4118
4035
  * // Define a database connection service
4119
4036
  * interface DatabaseConnection {
@@ -4160,7 +4077,7 @@ export const provideServiceEffect = internal.provideServiceEffect;
4160
4077
  /**
4161
4078
  * Sets the concurrency level for parallel operations within an effect.
4162
4079
  *
4163
- * **Example** (Usage)
4080
+ * **Example** (Setting local concurrency)
4164
4081
  *
4165
4082
  * ```ts
4166
4083
  * import { Console, Effect } from "effect"
@@ -4186,7 +4103,7 @@ export const provideServiceEffect = internal.provideServiceEffect;
4186
4103
  * // [1, 2, 3, 4, 5]
4187
4104
  * ```
4188
4105
  *
4189
- * @category References
4106
+ * @category references
4190
4107
  * @since 2.0.0
4191
4108
  */
4192
4109
  export const withConcurrency = internal.withConcurrency;
@@ -4196,7 +4113,7 @@ export const withConcurrency = internal.withConcurrency;
4196
4113
  /**
4197
4114
  * Returns the current scope for resource management.
4198
4115
  *
4199
- * **Example** (Usage)
4116
+ * **Example** (Accessing the current scope)
4200
4117
  *
4201
4118
  * ```ts
4202
4119
  * import { Console, Effect } from "effect"
@@ -4222,7 +4139,7 @@ export const withConcurrency = internal.withConcurrency;
4222
4139
  * // Releasing resource
4223
4140
  * ```
4224
4141
  *
4225
- * @category Resource Management & Finalization
4142
+ * @category resource management
4226
4143
  * @since 2.0.0
4227
4144
  */
4228
4145
  export const scope = internal.scope;
@@ -4231,7 +4148,7 @@ export const scope = internal.scope;
4231
4148
  * ensuring that their finalizers are run as soon as this workflow completes
4232
4149
  * execution, whether by success, failure, or interruption.
4233
4150
  *
4234
- * **Example** (Usage)
4151
+ * **Example** (Running a scoped acquisition)
4235
4152
  *
4236
4153
  * ```ts
4237
4154
  * import { Console, Effect } from "effect"
@@ -4255,14 +4172,14 @@ export const scope = internal.scope;
4255
4172
  * // Output: "Releasing resource"
4256
4173
  * ```
4257
4174
  *
4258
- * @category Resource Management & Finalization
4175
+ * @category resource management
4259
4176
  * @since 2.0.0
4260
4177
  */
4261
4178
  export const scoped = internal.scoped;
4262
4179
  /**
4263
4180
  * Creates a scoped effect by providing access to the scope.
4264
4181
  *
4265
- * **Example** (Usage)
4182
+ * **Example** (Working with an explicit scope)
4266
4183
  *
4267
4184
  * ```ts
4268
4185
  * import { Console, Effect, Scope } from "effect"
@@ -4295,8 +4212,8 @@ export const scoped = internal.scoped;
4295
4212
  * // Manual finalizer
4296
4213
  * ```
4297
4214
  *
4298
- * @category Resource Management & Finalization
4299
- * @since 2.0.0
4215
+ * @category resource management
4216
+ * @since 3.11.0
4300
4217
  */
4301
4218
  export const scopedWith = internal.scopedWith;
4302
4219
  /**
@@ -4312,7 +4229,7 @@ export const scopedWith = internal.scopedWith;
4312
4229
  * By default, acquisition is protected by an uninterruptible region. Pass
4313
4230
  * `{ interruptible: true }` to allow the acquisition effect to be interrupted.
4314
4231
  *
4315
- * **Example** (Usage)
4232
+ * **Example** (Acquiring and releasing a resource)
4316
4233
  *
4317
4234
  * ```ts
4318
4235
  * import { Console, Effect, Exit } from "effect"
@@ -4350,7 +4267,7 @@ export const scopedWith = internal.scopedWith;
4350
4267
  * )
4351
4268
  * ```
4352
4269
  *
4353
- * @category Resource Management & Finalization
4270
+ * @category resource management
4354
4271
  * @since 2.0.0
4355
4272
  */
4356
4273
  export const acquireRelease = internal.acquireRelease;
@@ -4367,13 +4284,13 @@ export const acquireRelease = internal.acquireRelease;
4367
4284
  * JavaScript disposal protocal instead of requiring an explicit release
4368
4285
  * function.
4369
4286
  *
4370
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using}
4287
+ * @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
4371
4288
  *
4372
- * **Example** (Usage)
4289
+ * **Example** (Acquiring a disposable resource)
4373
4290
  *
4374
4291
  * ```ts
4375
4292
  * import sqlite from "node:sqlite";
4376
- * import { Effect } from "effect";
4293
+ * import { Effect } from "effect"
4377
4294
  *
4378
4295
  * const program = Effect.scoped(
4379
4296
  * Effect.gen(function* () {
@@ -4389,7 +4306,7 @@ export const acquireRelease = internal.acquireRelease;
4389
4306
  * )
4390
4307
  * ```
4391
4308
  *
4392
- * @category Resource Management & Finalization
4309
+ * @category resource management
4393
4310
  * @since 4.0.0
4394
4311
  */
4395
4312
  export const acquireDisposable = internal.acquireDisposable;
@@ -4416,7 +4333,7 @@ export const acquireDisposable = internal.acquireDisposable;
4416
4333
  * is not desired, errors produced by the `release` `Effect` value can be caught
4417
4334
  * and ignored.
4418
4335
  *
4419
- * **Example** (Usage)
4336
+ * **Example** (Using a resource with cleanup)
4420
4337
  *
4421
4338
  * ```ts
4422
4339
  * import { Console, Effect, Exit } from "effect"
@@ -4462,7 +4379,7 @@ export const acquireDisposable = internal.acquireDisposable;
4462
4379
  * // Closing connection to db://localhost:5432 (success)
4463
4380
  * ```
4464
4381
  *
4465
- * @category Resource Management & Finalization
4382
+ * @category resource management
4466
4383
  * @since 2.0.0
4467
4384
  */
4468
4385
  export const acquireUseRelease = internal.acquireUseRelease;
@@ -4475,7 +4392,7 @@ export const acquireUseRelease = internal.acquireUseRelease;
4475
4392
  * whether the effect succeeds or fails. They're commonly used for resource
4476
4393
  * cleanup, logging, or other side effects that should always occur.
4477
4394
  *
4478
- * **Example** (Usage)
4395
+ * **Example** (Registering scope finalizers)
4479
4396
  *
4480
4397
  * ```ts
4481
4398
  * import { Console, Effect, Exit } from "effect"
@@ -4505,7 +4422,7 @@ export const acquireUseRelease = internal.acquireUseRelease;
4505
4422
  * // operation result
4506
4423
  * ```
4507
4424
  *
4508
- * @category Resource Management & Finalization
4425
+ * @category resource management
4509
4426
  * @since 2.0.0
4510
4427
  */
4511
4428
  export const addFinalizer = internal.addFinalizer;
@@ -4520,7 +4437,7 @@ export const addFinalizer = internal.addFinalizer;
4520
4437
  * should generally not be used for releasing resources. For higher-level
4521
4438
  * logic built on `ensuring`, see the `acquireRelease` family of methods.
4522
4439
  *
4523
- * **Example** (Usage)
4440
+ * **Example** (Always running cleanup)
4524
4441
  *
4525
4442
  * ```ts
4526
4443
  * import { Console, Effect } from "effect"
@@ -4546,7 +4463,7 @@ export const addFinalizer = internal.addFinalizer;
4546
4463
  * // 42
4547
4464
  * ```
4548
4465
  *
4549
- * @category Resource Management & Finalization
4466
+ * @category resource management
4550
4467
  * @since 2.0.0
4551
4468
  */
4552
4469
  export const ensuring = internal.ensuring;
@@ -4554,10 +4471,10 @@ export const ensuring = internal.ensuring;
4554
4471
  * Runs the specified effect if this effect fails, providing the error to the
4555
4472
  * effect if it exists. The provided effect will not be interrupted.
4556
4473
  *
4557
- * **Example** (Usage)
4474
+ * **Example** (Running cleanup on failure)
4558
4475
  *
4559
4476
  * ```ts
4560
- * import { Cause, Data, Console, Effect } from "effect"
4477
+ * import { Cause, Console, Data, Effect } from "effect"
4561
4478
  *
4562
4479
  * class TaskError extends Data.TaggedError("TaskError")<{ readonly message: string }> {}
4563
4480
  *
@@ -4574,7 +4491,7 @@ export const ensuring = internal.ensuring;
4574
4491
  * // TaskError: Something went wrong
4575
4492
  * ```
4576
4493
  *
4577
- * @category Resource Management & Finalization
4494
+ * @category resource management
4578
4495
  * @since 2.0.0
4579
4496
  */
4580
4497
  export const onError = internal.onError;
@@ -4582,7 +4499,7 @@ export const onError = internal.onError;
4582
4499
  * Runs the finalizer only when this effect fails and the `Cause` matches the
4583
4500
  * provided predicate.
4584
4501
  *
4585
- * **Example** (Usage)
4502
+ * **Example** (Running cleanup for selected failures)
4586
4503
  *
4587
4504
  * ```ts
4588
4505
  * import { Cause, Console, Effect } from "effect"
@@ -4599,14 +4516,14 @@ export const onError = internal.onError;
4599
4516
  * )
4600
4517
  * ```
4601
4518
  *
4602
- * @category Resource Management & Finalization
4519
+ * @category resource management
4603
4520
  * @since 4.0.0
4604
4521
  */
4605
4522
  export const onErrorIf = internal.onErrorIf;
4606
4523
  /**
4607
4524
  * Runs the finalizer only when this effect fails and the cause matches the provided `Filter`.
4608
4525
  *
4609
- * @category Resource Management & Finalization
4526
+ * @category resource management
4610
4527
  * @since 4.0.0
4611
4528
  */
4612
4529
  export const onErrorFilter = internal.onErrorFilter;
@@ -4619,15 +4536,15 @@ export const onErrorFilter = internal.onErrorFilter;
4619
4536
  * This low-level operator preserves the source effect's result unless the
4620
4537
  * finalizer fails. Prefer `onExit` for normal cleanup logic.
4621
4538
  *
4622
- * @category Resource Management & Finalization
4623
- * @since 2.0.0
4539
+ * @category resource management
4540
+ * @since 4.0.0
4624
4541
  */
4625
4542
  export const onExitPrimitive = internal.onExitPrimitive;
4626
4543
  /**
4627
4544
  * Ensures that a cleanup functions runs, whether this effect succeeds, fails,
4628
4545
  * or is interrupted.
4629
4546
  *
4630
- * **Example** (Usage)
4547
+ * **Example** (Observing every exit)
4631
4548
  *
4632
4549
  * ```ts
4633
4550
  * import { Console, Effect, Exit } from "effect"
@@ -4647,7 +4564,7 @@ export const onExitPrimitive = internal.onExitPrimitive;
4647
4564
  * // 42
4648
4565
  * ```
4649
4566
  *
4650
- * @category Resource Management & Finalization
4567
+ * @category resource management
4651
4568
  * @since 2.0.0
4652
4569
  */
4653
4570
  export const onExit = internal.onExit;
@@ -4655,7 +4572,7 @@ export const onExit = internal.onExit;
4655
4572
  * Runs the cleanup effect only when the `Exit` satisfies the provided
4656
4573
  * predicate.
4657
4574
  *
4658
- * **Example** (Usage)
4575
+ * **Example** (Observing selected exits)
4659
4576
  *
4660
4577
  * ```ts
4661
4578
  * import { Console, Effect, Exit } from "effect"
@@ -4670,14 +4587,14 @@ export const onExit = internal.onExit;
4670
4587
  * )
4671
4588
  * ```
4672
4589
  *
4673
- * @category Resource Management & Finalization
4590
+ * @category resource management
4674
4591
  * @since 4.0.0
4675
4592
  */
4676
4593
  export const onExitIf = internal.onExitIf;
4677
4594
  /**
4678
4595
  * Runs the cleanup effect only when the `Exit` matches the provided `Filter`.
4679
4596
  *
4680
- * @category Resource Management & Finalization
4597
+ * @category resource management
4681
4598
  * @since 4.0.0
4682
4599
  */
4683
4600
  export const onExitFilter = internal.onExitFilter;
@@ -4707,7 +4624,7 @@ export const onExitFilter = internal.onExitFilter;
4707
4624
  * @see {@link cachedInvalidateWithTTL} for a similar function that includes an
4708
4625
  * additional effect for manually invalidating the cached value.
4709
4626
  *
4710
- * **Example** (Usage)
4627
+ * **Example** (Memoizing an effect until invalidated)
4711
4628
  *
4712
4629
  * ```ts
4713
4630
  * import { Console, Effect } from "effect"
@@ -4781,7 +4698,7 @@ export const cached = internal.cached;
4781
4698
  * @see {@link cachedInvalidateWithTTL} for a similar function that includes an
4782
4699
  * additional effect for manually invalidating the cached value.
4783
4700
  *
4784
- * **Example** (Usage)
4701
+ * **Example** (Memoizing an effect with TTL)
4785
4702
  *
4786
4703
  * ```ts
4787
4704
  * import { Console, Effect } from "effect"
@@ -4849,7 +4766,7 @@ export const cachedWithTTL = internal.cachedWithTTL;
4849
4766
  * @see {@link cachedWithTTL} for a similar function that caches the result for
4850
4767
  * a specified duration but does not include an effect for manual invalidation.
4851
4768
  *
4852
- * **Example** (Usage)
4769
+ * **Example** (Memoizing with TTL and invalidation)
4853
4770
  *
4854
4771
  * ```ts
4855
4772
  * import { Console, Effect } from "effect"
@@ -4894,7 +4811,7 @@ export const cachedInvalidateWithTTL = internal.cachedInvalidateWithTTL;
4894
4811
  /**
4895
4812
  * Returns an effect that is immediately interrupted.
4896
4813
  *
4897
- * **Example** (Usage)
4814
+ * **Example** (Creating an interrupted effect)
4898
4815
  *
4899
4816
  * ```ts
4900
4817
  * import { Effect } from "effect"
@@ -4915,7 +4832,7 @@ export const interrupt = internal.interrupt;
4915
4832
  /**
4916
4833
  * Returns a new effect that allows the effect to be interruptible.
4917
4834
  *
4918
- * **Example** (Usage)
4835
+ * **Example** (Allowing interruption)
4919
4836
  *
4920
4837
  * ```ts
4921
4838
  * import { Effect } from "effect"
@@ -4936,7 +4853,7 @@ export const interruptible = internal.interruptible;
4936
4853
  /**
4937
4854
  * Runs the specified finalizer effect if this effect is interrupted.
4938
4855
  *
4939
- * **Example** (Usage)
4856
+ * **Example** (Running cleanup on interruption)
4940
4857
  *
4941
4858
  * ```ts
4942
4859
  * import { Console, Effect, Fiber } from "effect"
@@ -4961,7 +4878,7 @@ export const onInterrupt = internal.onInterrupt;
4961
4878
  /**
4962
4879
  * Returns a new effect that disables interruption for the given effect.
4963
4880
  *
4964
- * **Example** (Usage)
4881
+ * **Example** (Preventing interruption)
4965
4882
  *
4966
4883
  * ```ts
4967
4884
  * import { Console, Effect, Fiber } from "effect"
@@ -4987,7 +4904,7 @@ export const uninterruptible = internal.uninterruptible;
4987
4904
  * Disables interruption and provides a restore function to restore the
4988
4905
  * interruptible state within the effect.
4989
4906
  *
4990
- * **Example** (Usage)
4907
+ * **Example** (Restoring interruption in protected regions)
4991
4908
  *
4992
4909
  * ```ts
4993
4910
  * import { Console, Effect } from "effect"
@@ -5019,7 +4936,7 @@ export const uninterruptibleMask = internal.uninterruptibleMask;
5019
4936
  * `restore` function. This function can be used to restore the interruptibility
5020
4937
  * of any specific region of code.
5021
4938
  *
5022
- * **Example** (Usage)
4939
+ * **Example** (Controlling interruptibility locally)
5023
4940
  *
5024
4941
  * ```ts
5025
4942
  * import { Console, Effect } from "effect"
@@ -5056,7 +4973,7 @@ export const abortSignal = internal.abortSignal;
5056
4973
  /**
5057
4974
  * Repeats this effect forever (until the first error).
5058
4975
  *
5059
- * **Example** (Usage)
4976
+ * **Example** (Repeating forever)
5060
4977
  *
5061
4978
  * ```ts
5062
4979
  * import { Console, Effect, Fiber } from "effect"
@@ -5106,13 +5023,11 @@ export const forever = internal.forever;
5106
5023
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
5107
5024
  * each execution.
5108
5025
  *
5109
- * **Example** (Usage)
5026
+ * **Example** (Repeating successful effects with a schedule)
5110
5027
  *
5111
5028
  * ```ts
5112
5029
  * // Success Example
5113
- * import { Effect } from "effect"
5114
- * import { Schedule } from "effect"
5115
- * import { Console } from "effect"
5030
+ * import { Console, Effect, Schedule } from "effect"
5116
5031
  *
5117
5032
  * const action = Console.log("success")
5118
5033
  * const policy = Schedule.addDelay(Schedule.recurs(2), () => Effect.succeed("100 millis"))
@@ -5121,12 +5036,11 @@ export const forever = internal.forever;
5121
5036
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
5122
5037
  * ```
5123
5038
  *
5124
- * **Example** (Usage)
5039
+ * **Example** (Stopping repetition on failure)
5125
5040
  *
5126
5041
  * ```ts
5127
5042
  * // Failure Example
5128
- * import { Effect } from "effect"
5129
- * import { Schedule } from "effect"
5043
+ * import { Effect, Schedule } from "effect"
5130
5044
  *
5131
5045
  * let count = 0
5132
5046
  *
@@ -5163,11 +5077,10 @@ export const repeat = internalSchedule.repeat;
5163
5077
  * otherwise it receives `None`. If the schedule completes normally, the
5164
5078
  * returned effect succeeds with the schedule's output.
5165
5079
  *
5166
- * **Example** (Usage)
5080
+ * **Example** (Recovering after repetition stops)
5167
5081
  *
5168
5082
  * ```ts
5169
- * import { Console, Effect, Schedule } from "effect"
5170
- * import * as Option from "effect/Option"
5083
+ * import { Console, Effect, Option, Schedule } from "effect"
5171
5084
  *
5172
5085
  * let attempt = 0
5173
5086
  * const task = Effect.gen(function*() {
@@ -5210,7 +5123,7 @@ export const replicate = internal.replicate;
5210
5123
  *
5211
5124
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
5212
5125
  *
5213
- * **Example** (Usage)
5126
+ * **Example** (Replicating an effect)
5214
5127
  *
5215
5128
  * ```ts
5216
5129
  * import { Console, Effect } from "effect"
@@ -5237,7 +5150,7 @@ export const replicateEffect = internal.replicateEffect;
5237
5150
  * fails, and otherwise succeeds with the schedule output when the schedule
5238
5151
  * completes.
5239
5152
  *
5240
- * **Example** (Usage)
5153
+ * **Example** (Scheduling repeated execution)
5241
5154
  *
5242
5155
  * ```ts
5243
5156
  * import { Console, Effect, Schedule } from "effect"
@@ -5280,7 +5193,7 @@ export const schedule = /*#__PURE__*/dual(2, (self, schedule) => scheduleFrom(se
5280
5193
  * succeeds with the schedule output when the schedule completes and fails if
5281
5194
  * the effect or schedule fails.
5282
5195
  *
5283
- * **Example** (Usage)
5196
+ * **Example** (Scheduling from an initial value)
5284
5197
  *
5285
5198
  * ```ts
5286
5199
  * import { Console, Effect, Schedule } from "effect"
@@ -5312,7 +5225,7 @@ export const scheduleFrom = internalSchedule.scheduleFrom;
5312
5225
  /**
5313
5226
  * Returns the current tracer from the context.
5314
5227
  *
5315
- * **Example** (Usage)
5228
+ * **Example** (Accessing the current tracer)
5316
5229
  *
5317
5230
  * ```ts
5318
5231
  * import { Effect } from "effect"
@@ -5324,14 +5237,14 @@ export const scheduleFrom = internalSchedule.scheduleFrom;
5324
5237
  * })
5325
5238
  * ```
5326
5239
  *
5327
- * @category Tracing
5240
+ * @category tracing
5328
5241
  * @since 2.0.0
5329
5242
  */
5330
5243
  export const tracer = internal.tracer;
5331
5244
  /**
5332
5245
  * Provides a tracer to an effect.
5333
5246
  *
5334
- * **Example** (Usage)
5247
+ * **Example** (Providing a tracer)
5335
5248
  *
5336
5249
  * ```ts
5337
5250
  * import { Effect } from "effect"
@@ -5345,7 +5258,7 @@ export const tracer = internal.tracer;
5345
5258
  * // const traced = Effect.withTracer(program, customTracer)
5346
5259
  * ```
5347
5260
  *
5348
- * @category Tracing
5261
+ * @category tracing
5349
5262
  * @since 2.0.0
5350
5263
  */
5351
5264
  export const withTracer = internal.withTracer;
@@ -5357,7 +5270,7 @@ export const withTracer = internal.withTracer;
5357
5270
  * When `enabled` is `false`, spans created inside the effect are not registered
5358
5271
  * with the current tracer and do not propagate as normal trace parents.
5359
5272
  *
5360
- * **Example** (Usage)
5273
+ * **Example** (Enabling or disabling tracing)
5361
5274
  *
5362
5275
  * ```ts
5363
5276
  * import { Effect } from "effect"
@@ -5369,14 +5282,14 @@ export const withTracer = internal.withTracer;
5369
5282
  * )
5370
5283
  * ```
5371
5284
  *
5372
- * @category Tracing
5285
+ * @category tracing
5373
5286
  * @since 2.0.0
5374
5287
  */
5375
5288
  export const withTracerEnabled = internal.withTracerEnabled;
5376
5289
  /**
5377
5290
  * Enables or disables tracer timing for the given Effect.
5378
5291
  *
5379
- * **Example** (Usage)
5292
+ * **Example** (Enabling or disabling tracing timing)
5380
5293
  *
5381
5294
  * ```ts
5382
5295
  * import { Effect } from "effect"
@@ -5388,14 +5301,14 @@ export const withTracerEnabled = internal.withTracerEnabled;
5388
5301
  * )
5389
5302
  * ```
5390
5303
  *
5391
- * @category Tracing
5304
+ * @category tracing
5392
5305
  * @since 2.0.0
5393
5306
  */
5394
5307
  export const withTracerTiming = internal.withTracerTiming;
5395
5308
  /**
5396
5309
  * Adds an annotation to each span in this effect.
5397
5310
  *
5398
- * **Example** (Usage)
5311
+ * **Example** (Annotating all spans)
5399
5312
  *
5400
5313
  * ```ts
5401
5314
  * import { Effect } from "effect"
@@ -5416,14 +5329,14 @@ export const withTracerTiming = internal.withTracerTiming;
5416
5329
  * })
5417
5330
  * ```
5418
5331
  *
5419
- * @category Tracing
5332
+ * @category tracing
5420
5333
  * @since 2.0.0
5421
5334
  */
5422
5335
  export const annotateSpans = internal.annotateSpans;
5423
5336
  /**
5424
5337
  * Adds an annotation to the current span if available.
5425
5338
  *
5426
- * **Example** (Usage)
5339
+ * **Example** (Annotating the current span)
5427
5340
  *
5428
5341
  * ```ts
5429
5342
  * import { Effect } from "effect"
@@ -5441,7 +5354,7 @@ export const annotateSpans = internal.annotateSpans;
5441
5354
  * const traced = Effect.withSpan(program, "user-operation")
5442
5355
  * ```
5443
5356
  *
5444
- * @category Tracing
5357
+ * @category tracing
5445
5358
  * @since 2.0.0
5446
5359
  */
5447
5360
  export const annotateCurrentSpan = internal.annotateCurrentSpan;
@@ -5453,7 +5366,7 @@ export const annotateCurrentSpan = internal.annotateCurrentSpan;
5453
5366
  * The effect fails with `NoSuchElementError` when there is no active local
5454
5367
  * `Span`.
5455
5368
  *
5456
- * **Example** (Usage)
5369
+ * **Example** (Reading the current span)
5457
5370
  *
5458
5371
  * ```ts
5459
5372
  * import { Effect } from "effect"
@@ -5467,7 +5380,7 @@ export const annotateCurrentSpan = internal.annotateCurrentSpan;
5467
5380
  * const traced = Effect.withSpan(program, "my-span")
5468
5381
  * ```
5469
5382
  *
5470
- * @category Tracing
5383
+ * @category tracing
5471
5384
  * @since 2.0.0
5472
5385
  */
5473
5386
  export const currentSpan = internal.currentSpan;
@@ -5480,7 +5393,7 @@ export const currentSpan = internal.currentSpan;
5480
5393
  * present, and fails with `NoSuchElementError` when no parent span is
5481
5394
  * available.
5482
5395
  *
5483
- * **Example** (Usage)
5396
+ * **Example** (Reading the parent span)
5484
5397
  *
5485
5398
  * ```ts
5486
5399
  * import { Effect } from "effect"
@@ -5499,7 +5412,7 @@ export const currentSpan = internal.currentSpan;
5499
5412
  * const traced = Effect.withSpan(program, "parent-span")
5500
5413
  * ```
5501
5414
  *
5502
- * @category Tracing
5415
+ * @category tracing
5503
5416
  * @since 2.0.0
5504
5417
  */
5505
5418
  export const currentParentSpan = internal.currentParentSpan;
@@ -5511,7 +5424,7 @@ export const currentParentSpan = internal.currentParentSpan;
5511
5424
  * These annotations are applied to spans created inside the context, such as
5512
5425
  * spans created by `withSpan`, `useSpan`, or `makeSpan`.
5513
5426
  *
5514
- * **Example** (Usage)
5427
+ * **Example** (Providing span annotations)
5515
5428
  *
5516
5429
  * ```ts
5517
5430
  * import { Effect } from "effect"
@@ -5532,7 +5445,7 @@ export const currentParentSpan = internal.currentParentSpan;
5532
5445
  * // Output: Current span annotations: { userId: "123", operation: "data-processing" }
5533
5446
  * ```
5534
5447
  *
5535
- * @category Tracing
5448
+ * @category tracing
5536
5449
  * @since 2.0.0
5537
5450
  */
5538
5451
  export const spanAnnotations = internal.spanAnnotations;
@@ -5544,7 +5457,7 @@ export const spanAnnotations = internal.spanAnnotations;
5544
5457
  * These links are attached to spans created inside the context. Span links
5545
5458
  * connect related spans without making one span the parent of another.
5546
5459
  *
5547
- * **Example** (Usage)
5460
+ * **Example** (Providing span links)
5548
5461
  *
5549
5462
  * ```ts
5550
5463
  * import { Effect } from "effect"
@@ -5557,7 +5470,7 @@ export const spanAnnotations = internal.spanAnnotations;
5557
5470
  * })
5558
5471
  * ```
5559
5472
  *
5560
- * @category Tracing
5473
+ * @category tracing
5561
5474
  * @since 2.0.0
5562
5475
  */
5563
5476
  export const spanLinks = internal.spanLinks;
@@ -5568,7 +5481,7 @@ export const spanLinks = internal.spanLinks;
5568
5481
  * parent-child relationship. For example, you might want to link spans from
5569
5482
  * parallel operations or connect spans across different traces.
5570
5483
  *
5571
- * **Example** (Usage)
5484
+ * **Example** (Linking one span to another span)
5572
5485
  *
5573
5486
  * ```ts
5574
5487
  * import { Effect } from "effect"
@@ -5591,7 +5504,7 @@ export const spanLinks = internal.spanLinks;
5591
5504
  * })
5592
5505
  * ```
5593
5506
  *
5594
- * **Example** (Usage)
5507
+ * **Example** (Linking multiple spans at once)
5595
5508
  *
5596
5509
  * ```ts
5597
5510
  * import { Effect } from "effect"
@@ -5610,7 +5523,7 @@ export const spanLinks = internal.spanLinks;
5610
5523
  * })
5611
5524
  * ```
5612
5525
  *
5613
- * @category Tracing
5526
+ * @category tracing
5614
5527
  * @since 2.0.0
5615
5528
  */
5616
5529
  export const linkSpans = internal.linkSpans;
@@ -5623,7 +5536,7 @@ export const linkSpans = internal.linkSpans;
5623
5536
  * automatically. Use `withSpan`, `useSpan`, or `makeSpanScoped` when the span
5624
5537
  * should be installed as context or closed automatically.
5625
5538
  *
5626
- * **Example** (Usage)
5539
+ * **Example** (Creating a span manually)
5627
5540
  *
5628
5541
  * ```ts
5629
5542
  * import { Effect } from "effect"
@@ -5635,7 +5548,7 @@ export const linkSpans = internal.linkSpans;
5635
5548
  * })
5636
5549
  * ```
5637
5550
  *
5638
- * @category Tracing
5551
+ * @category tracing
5639
5552
  * @since 2.0.0
5640
5553
  */
5641
5554
  export const makeSpan = internal.makeSpan;
@@ -5646,7 +5559,7 @@ export const makeSpan = internal.makeSpan;
5646
5559
  * The span is not added to the current span stack, so no child spans will be
5647
5560
  * created for it.
5648
5561
  *
5649
- * **Example** (Usage)
5562
+ * **Example** (Creating a scoped standalone span)
5650
5563
  *
5651
5564
  * ```ts
5652
5565
  * import { Effect } from "effect"
@@ -5661,7 +5574,7 @@ export const makeSpan = internal.makeSpan;
5661
5574
  * )
5662
5575
  * ```
5663
5576
  *
5664
- * @category Tracing
5577
+ * @category tracing
5665
5578
  * @since 2.0.0
5666
5579
  */
5667
5580
  export const makeSpanScoped = internal.makeSpanScoped;
@@ -5672,7 +5585,7 @@ export const makeSpanScoped = internal.makeSpanScoped;
5672
5585
  * The span is not added to the current span stack, so no child spans will be
5673
5586
  * created for it.
5674
5587
  *
5675
- * **Example** (Usage)
5588
+ * **Example** (Running an effect with a standalone span)
5676
5589
  *
5677
5590
  * ```ts
5678
5591
  * import { Effect } from "effect"
@@ -5687,14 +5600,14 @@ export const makeSpanScoped = internal.makeSpanScoped;
5687
5600
  * )
5688
5601
  * ```
5689
5602
  *
5690
- * @category Tracing
5603
+ * @category tracing
5691
5604
  * @since 2.0.0
5692
5605
  */
5693
5606
  export const useSpan = internal.useSpan;
5694
5607
  /**
5695
5608
  * Wraps the effect with a new span for tracing.
5696
5609
  *
5697
- * **Example** (Usage)
5610
+ * **Example** (Wrapping an effect in a child span)
5698
5611
  *
5699
5612
  * ```ts
5700
5613
  * import { Effect } from "effect"
@@ -5709,7 +5622,7 @@ export const useSpan = internal.useSpan;
5709
5622
  * })
5710
5623
  * ```
5711
5624
  *
5712
- * @category Tracing
5625
+ * @category tracing
5713
5626
  * @since 2.0.0
5714
5627
  */
5715
5628
  export const withSpan = internal.withSpan;
@@ -5718,7 +5631,7 @@ export const withSpan = internal.withSpan;
5718
5631
  *
5719
5632
  * The span is ended when the Scope is finalized.
5720
5633
  *
5721
- * **Example** (Usage)
5634
+ * **Example** (Creating a scoped child span)
5722
5635
  *
5723
5636
  * ```ts
5724
5637
  * import { Effect } from "effect"
@@ -5732,14 +5645,14 @@ export const withSpan = internal.withSpan;
5732
5645
  * )
5733
5646
  * ```
5734
5647
  *
5735
- * @category Tracing
5648
+ * @category tracing
5736
5649
  * @since 2.0.0
5737
5650
  */
5738
5651
  export const withSpanScoped = internal.withSpanScoped;
5739
5652
  /**
5740
5653
  * Adds the provided span to the current span stack.
5741
5654
  *
5742
- * **Example** (Usage)
5655
+ * **Example** (Setting a parent span)
5743
5656
  *
5744
5657
  * ```ts
5745
5658
  * import { Effect } from "effect"
@@ -5752,7 +5665,7 @@ export const withSpanScoped = internal.withSpanScoped;
5752
5665
  * })
5753
5666
  * ```
5754
5667
  *
5755
- * @category Tracing
5668
+ * @category tracing
5756
5669
  * @since 2.0.0
5757
5670
  */
5758
5671
  export const withParentSpan = internal.withParentSpan;
@@ -5765,7 +5678,7 @@ export const withParentSpan = internal.withParentSpan;
5765
5678
  * @category Requests & Batching
5766
5679
  * @since 2.0.0
5767
5680
  *
5768
- * **Example** (Usage)
5681
+ * **Example** (Executing a request through a resolver)
5769
5682
  *
5770
5683
  * ```ts
5771
5684
  * import { Console, Effect, Exit, Request, RequestResolver } from "effect"
@@ -5825,7 +5738,7 @@ export const requestUnsafe = internalRequest.requestUnsafe;
5825
5738
  * fibers leak. This behavior is called "auto supervision", and if this
5826
5739
  * behavior is not desired, you may use the `forkDetach` or `forkIn` methods.
5827
5740
  *
5828
- * **Example** (Usage)
5741
+ * **Example** (Forking a child fiber)
5829
5742
  *
5830
5743
  * ```ts
5831
5744
  * import { Effect, Fiber } from "effect"
@@ -5856,7 +5769,7 @@ export const forkChild = internal.forkChild;
5856
5769
  * Forks the effect in the specified scope. The fiber will be interrupted
5857
5770
  * when the scope is closed.
5858
5771
  *
5859
- * **Example** (Usage)
5772
+ * **Example** (Forking into a supplied scope)
5860
5773
  *
5861
5774
  * ```ts
5862
5775
  * import { Effect } from "effect"
@@ -5884,7 +5797,7 @@ export const forkIn = internal.forkIn;
5884
5797
  /**
5885
5798
  * Forks the fiber in a `Scope`, interrupting it when the scope is closed.
5886
5799
  *
5887
- * **Example** (Usage)
5800
+ * **Example** (Forking into the current scope)
5888
5801
  *
5889
5802
  * ```ts
5890
5803
  * import { Effect } from "effect"
@@ -5920,7 +5833,7 @@ export const forkScoped = internal.forkScoped;
5920
5833
  * new fiber is attached to the global scope, when the fiber executing the
5921
5834
  * returned effect terminates, the forked fiber will continue running.
5922
5835
  *
5923
- * **Example** (Usage)
5836
+ * **Example** (Forking a detached fiber)
5924
5837
  *
5925
5838
  * ```ts
5926
5839
  * import { Effect } from "effect"
@@ -5946,7 +5859,7 @@ export const forkScoped = internal.forkScoped;
5946
5859
  * ```
5947
5860
  *
5948
5861
  * @category Supervision & Fibers
5949
- * @since 2.0.0
5862
+ * @since 4.0.0
5950
5863
  */
5951
5864
  export const forkDetach = internal.forkDetach;
5952
5865
  /**
@@ -5960,7 +5873,7 @@ export const awaitAllChildren = internal.awaitAllChildren;
5960
5873
  /**
5961
5874
  * Access the fiber currently executing the effect.
5962
5875
  *
5963
- * **Example** (Usage)
5876
+ * **Example** (Accessing the current fiber)
5964
5877
  *
5965
5878
  * ```ts
5966
5879
  * import { Console, Effect } from "effect"
@@ -5978,7 +5891,7 @@ export const fiber = internal.fiber;
5978
5891
  /**
5979
5892
  * Access the current fiber id executing the effect.
5980
5893
  *
5981
- * **Example** (Usage)
5894
+ * **Example** (Accessing the current fiber id)
5982
5895
  *
5983
5896
  * ```ts
5984
5897
  * import { Effect } from "effect"
@@ -5995,7 +5908,7 @@ export const fiber = internal.fiber;
5995
5908
  * ```
5996
5909
  *
5997
5910
  * @category Supervision & Fibers
5998
- * @since 4.0.0
5911
+ * @since 2.0.0
5999
5912
  */
6000
5913
  export const fiberId = internal.fiberId;
6001
5914
  /**
@@ -6011,13 +5924,10 @@ export const fiberId = internal.fiberId;
6011
5924
  * Unless you specifically need a `Promise` or synchronous operation,
6012
5925
  * `runFork` is a good default choice.
6013
5926
  *
6014
- * **Example** (Running an Effect in the Background)
5927
+ * **Example** (Running an effect in the background)
6015
5928
  *
6016
5929
  * ```ts
6017
- * import { Effect } from "effect"
6018
- * import { Schedule } from "effect"
6019
- * import { Fiber } from "effect"
6020
- * import { Console } from "effect"
5930
+ * import { Console, Effect, Fiber, Schedule } from "effect"
6021
5931
  *
6022
5932
  * // ┌─── Effect<number, never, never>
6023
5933
  * // ▼
@@ -6042,10 +5952,10 @@ export const runFork = internal.runFork;
6042
5952
  /**
6043
5953
  * Runs an effect in the background with the provided services.
6044
5954
  *
6045
- * **Example** (Usage)
5955
+ * **Example** (Running with services in the background)
6046
5956
  *
6047
5957
  * ```ts
6048
- * import { Effect, Context } from "effect"
5958
+ * import { Context, Effect } from "effect"
6049
5959
  *
6050
5960
  * interface Logger {
6051
5961
  * log: (message: string) => void
@@ -6075,10 +5985,10 @@ export const runForkWith = internal.runForkWith;
6075
5985
  *
6076
5986
  * The returned interruptor calls `fiber.interruptUnsafe`, optionally with an interruptor id.
6077
5987
  *
6078
- * **Example** (Usage)
5988
+ * **Example** (Running with services and a callback)
6079
5989
  *
6080
5990
  * ```ts
6081
- * import { Console, Effect, Exit, Context } from "effect"
5991
+ * import { Console, Context, Effect, Exit } from "effect"
6082
5992
  *
6083
5993
  * interface Logger {
6084
5994
  * log: (message: string) => Effect.Effect<void>
@@ -6119,7 +6029,7 @@ export const runCallbackWith = internal.runCallbackWith;
6119
6029
  * The interruptor calls `fiber.interruptUnsafe` with the optional interruptor
6120
6030
  * id.
6121
6031
  *
6122
- * **Example** (Usage)
6032
+ * **Example** (Running with a callback)
6123
6033
  *
6124
6034
  * ```ts
6125
6035
  * import { Console, Effect, Exit } from "effect"
@@ -6148,7 +6058,7 @@ export const runCallbackWith = internal.runCallbackWith;
6148
6058
  * ```
6149
6059
  *
6150
6060
  * @category Running Effects
6151
- * @since 4.0.0
6061
+ * @since 2.0.0
6152
6062
  */
6153
6063
  export const runCallback = internal.runCallback;
6154
6064
  /**
@@ -6165,7 +6075,7 @@ export const runCallback = internal.runCallback;
6165
6075
  *
6166
6076
  * @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
6167
6077
  *
6168
- * **Example** (Running a Successful Effect as a Promise)
6078
+ * **Example** (Running a successful effect as a Promise)
6169
6079
  *
6170
6080
  * ```ts
6171
6081
  * import { Effect } from "effect"
@@ -6174,7 +6084,7 @@ export const runCallback = internal.runCallback;
6174
6084
  * // Output: 1
6175
6085
  * ```
6176
6086
  *
6177
- * **Example** (Usage)
6087
+ * **Example** (Running effects as promises)
6178
6088
  *
6179
6089
  * ```ts
6180
6090
  * //Example: Handling a Failing Effect as a Rejected Promise
@@ -6192,10 +6102,10 @@ export const runPromise = internal.runPromise;
6192
6102
  /**
6193
6103
  * Executes an effect as a Promise with the provided services.
6194
6104
  *
6195
- * **Example** (Usage)
6105
+ * **Example** (Running with services as a promise)
6196
6106
  *
6197
6107
  * ```ts
6198
- * import { Effect, Context } from "effect"
6108
+ * import { Context, Effect } from "effect"
6199
6109
  *
6200
6110
  * interface Config {
6201
6111
  * apiUrl: string
@@ -6235,7 +6145,7 @@ export const runPromiseWith = internal.runPromiseWith;
6235
6145
  * - If it fails, the failure information is provided as a `Failure` containing
6236
6146
  * a `Cause` type.
6237
6147
  *
6238
- * **Example** (Handling Results as Exit)
6148
+ * **Example** (Observing promise results as Exit)
6239
6149
  *
6240
6150
  * ```ts
6241
6151
  * import { Effect } from "effect"
@@ -6270,10 +6180,10 @@ export const runPromiseExit = internal.runPromiseExit;
6270
6180
  /**
6271
6181
  * Runs an effect and returns a Promise of Exit with provided services.
6272
6182
  *
6273
- * **Example** (Usage)
6183
+ * **Example** (Running with services as an Exit promise)
6274
6184
  *
6275
6185
  * ```ts
6276
- * import { Effect, Exit, Context } from "effect"
6186
+ * import { Context, Effect, Exit } from "effect"
6277
6187
  *
6278
6188
  * interface Database {
6279
6189
  * query: (sql: string) => string
@@ -6317,7 +6227,7 @@ export const runPromiseExitWith = internal.runPromiseExitWith;
6317
6227
  * @see {@link runSyncExit} for a version that returns an `Exit` type instead of
6318
6228
  * throwing an error.
6319
6229
  *
6320
- * **Example** (Synchronous Logging)
6230
+ * **Example** (Running a synchronous effect)
6321
6231
  *
6322
6232
  * ```ts
6323
6233
  * import { Effect } from "effect"
@@ -6334,7 +6244,7 @@ export const runPromiseExitWith = internal.runPromiseExitWith;
6334
6244
  * // Output: 1
6335
6245
  * ```
6336
6246
  *
6337
- * **Example** (Incorrect Usage with Failing or Async Effects)
6247
+ * **Example** (Throwing for failed or async effects)
6338
6248
  *
6339
6249
  * ```ts
6340
6250
  * import { Effect } from "effect"
@@ -6365,10 +6275,10 @@ export const runSync = internal.runSync;
6365
6275
  /**
6366
6276
  * Executes an effect synchronously with provided services.
6367
6277
  *
6368
- * **Example** (Usage)
6278
+ * **Example** (Running synchronously with services)
6369
6279
  *
6370
6280
  * ```ts
6371
- * import { Effect, Context } from "effect"
6281
+ * import { Context, Effect } from "effect"
6372
6282
  *
6373
6283
  * interface MathService {
6374
6284
  * add: (a: number, b: number) => number
@@ -6413,7 +6323,7 @@ export const runSyncWith = internal.runSyncWith;
6413
6323
  * return an `Failure` with a `Die` cause, indicating that the effect cannot be
6414
6324
  * resolved synchronously.
6415
6325
  *
6416
- * **Example** (Handling Results as Exit)
6326
+ * **Example** (Observing synchronous results as Exit)
6417
6327
  *
6418
6328
  * ```ts
6419
6329
  * import { Effect } from "effect"
@@ -6439,7 +6349,7 @@ export const runSyncWith = internal.runSyncWith;
6439
6349
  * // }
6440
6350
  * ```
6441
6351
  *
6442
- * **Example** (Asynchronous Operation Resulting in Die)
6352
+ * **Example** (Capturing async work as a Die cause)
6443
6353
  *
6444
6354
  * ```ts
6445
6355
  * import { Effect } from "effect"
@@ -6468,10 +6378,10 @@ export const runSyncExit = internal.runSyncExit;
6468
6378
  /**
6469
6379
  * Runs an effect synchronously with provided services, returning an Exit result.
6470
6380
  *
6471
- * **Example** (Usage)
6381
+ * **Example** (Running synchronously with services as Exit)
6472
6382
  *
6473
6383
  * ```ts
6474
- * import { Effect, Exit, Context } from "effect"
6384
+ * import { Context, Effect, Exit } from "effect"
6475
6385
  *
6476
6386
  * // Define a logger service
6477
6387
  * const Logger = Context.Service<{
@@ -6510,7 +6420,7 @@ export const runSyncExitWith = internal.runSyncExitWith;
6510
6420
  *
6511
6421
  * `Effect.fnUntraced` also acts as a `pipe` function, so you can append transforms after the body.
6512
6422
  *
6513
- * **Example** (Usage)
6423
+ * **Example** (Defining untraced effect functions)
6514
6424
  *
6515
6425
  * ```ts
6516
6426
  * import { Console, Effect } from "effect"
@@ -6532,7 +6442,7 @@ export const fnUntraced = internal.fnUntraced;
6532
6442
  *
6533
6443
  * Pipeable functions run after the body and can transform the resulting Effect.
6534
6444
  *
6535
- * **Example** (Usage)
6445
+ * **Example** (Defining traced effect functions)
6536
6446
  *
6537
6447
  * ```ts
6538
6448
  * import { Console, Effect } from "effect"
@@ -6553,7 +6463,7 @@ export const fnUntraced = internal.fnUntraced;
6553
6463
  * ```
6554
6464
  *
6555
6465
  * @category Function
6556
- * @since 3.12.0
6466
+ * @since 3.11.0
6557
6467
  */
6558
6468
  export const fn = internal.fn;
6559
6469
  // ========================================================================
@@ -6563,7 +6473,7 @@ export const fn = internal.fn;
6563
6473
  * Retrieves the `Clock` service from the context and provides it to the
6564
6474
  * specified effectful function.
6565
6475
  *
6566
- * **Example** (Usage)
6476
+ * **Example** (Accessing the Clock service)
6567
6477
  *
6568
6478
  * ```ts
6569
6479
  * import { Console, Effect } from "effect"
@@ -6593,7 +6503,7 @@ export const clockWith = internal.clockWith;
6593
6503
  * If no level is provided, the logger uses the fiber's current log level and
6594
6504
  * extracts any `Cause` values from the message list.
6595
6505
  *
6596
- * **Example** (Usage)
6506
+ * **Example** (Logging at a dynamic level)
6597
6507
  *
6598
6508
  * ```ts
6599
6509
  * import { Effect } from "effect"
@@ -6605,14 +6515,14 @@ export const clockWith = internal.clockWith;
6605
6515
  * })
6606
6516
  * ```
6607
6517
  *
6608
- * @category Logging
6518
+ * @category logging
6609
6519
  * @since 2.0.0
6610
6520
  */
6611
6521
  export const logWithLevel = internal.logWithLevel;
6612
6522
  /**
6613
6523
  * Logs one or more messages using the default log level.
6614
6524
  *
6615
- * **Example** (Usage)
6525
+ * **Example** (Logging at the default level)
6616
6526
  *
6617
6527
  * ```ts
6618
6528
  * import { Effect } from "effect"
@@ -6633,14 +6543,14 @@ export const logWithLevel = internal.logWithLevel;
6633
6543
  * // 4
6634
6544
  * ```
6635
6545
  *
6636
- * @category Logging
6546
+ * @category logging
6637
6547
  * @since 2.0.0
6638
6548
  */
6639
6549
  export const log = /*#__PURE__*/internal.logWithLevel();
6640
6550
  /**
6641
6551
  * Logs one or more messages at the FATAL level.
6642
6552
  *
6643
- * **Example** (Usage)
6553
+ * **Example** (Logging fatal messages)
6644
6554
  *
6645
6555
  * ```ts
6646
6556
  * import { Effect } from "effect"
@@ -6662,14 +6572,14 @@ export const log = /*#__PURE__*/internal.logWithLevel();
6662
6572
  * // timestamp=2023-... level=FATAL message="System shutting down"
6663
6573
  * ```
6664
6574
  *
6665
- * @category Logging
6575
+ * @category logging
6666
6576
  * @since 2.0.0
6667
6577
  */
6668
6578
  export const logFatal = /*#__PURE__*/internal.logWithLevel("Fatal");
6669
6579
  /**
6670
6580
  * Logs one or more messages at the WARNING level.
6671
6581
  *
6672
- * **Example** (Usage)
6582
+ * **Example** (Logging warnings)
6673
6583
  *
6674
6584
  * ```ts
6675
6585
  * import { Effect } from "effect"
@@ -6692,14 +6602,14 @@ export const logFatal = /*#__PURE__*/internal.logWithLevel("Fatal");
6692
6602
  * // timestamp=2023-... level=WARN message="Using deprecated API endpoint"
6693
6603
  * ```
6694
6604
  *
6695
- * @category Logging
6605
+ * @category logging
6696
6606
  * @since 2.0.0
6697
6607
  */
6698
6608
  export const logWarning = /*#__PURE__*/internal.logWithLevel("Warn");
6699
6609
  /**
6700
6610
  * Logs one or more messages at the ERROR level.
6701
6611
  *
6702
- * **Example** (Usage)
6612
+ * **Example** (Logging errors)
6703
6613
  *
6704
6614
  * ```ts
6705
6615
  * import { Effect } from "effect"
@@ -6725,14 +6635,14 @@ export const logWarning = /*#__PURE__*/internal.logWithLevel("Warn");
6725
6635
  * // timestamp=2023-... level=ERROR message="Caught error: Something went wrong"
6726
6636
  * ```
6727
6637
  *
6728
- * @category Logging
6638
+ * @category logging
6729
6639
  * @since 2.0.0
6730
6640
  */
6731
6641
  export const logError = /*#__PURE__*/internal.logWithLevel("Error");
6732
6642
  /**
6733
6643
  * Logs one or more messages at the INFO level.
6734
6644
  *
6735
- * **Example** (Usage)
6645
+ * **Example** (Logging information)
6736
6646
  *
6737
6647
  * ```ts
6738
6648
  * import { Effect } from "effect"
@@ -6753,14 +6663,14 @@ export const logError = /*#__PURE__*/internal.logWithLevel("Error");
6753
6663
  * // timestamp=2023-... level=INFO message="Application version: 1.2.3"
6754
6664
  * ```
6755
6665
  *
6756
- * @category Logging
6666
+ * @category logging
6757
6667
  * @since 2.0.0
6758
6668
  */
6759
6669
  export const logInfo = /*#__PURE__*/internal.logWithLevel("Info");
6760
6670
  /**
6761
6671
  * Logs one or more messages at the DEBUG level.
6762
6672
  *
6763
- * **Example** (Usage)
6673
+ * **Example** (Logging debug messages)
6764
6674
  *
6765
6675
  * ```ts
6766
6676
  * import { Effect } from "effect"
@@ -6782,14 +6692,14 @@ export const logInfo = /*#__PURE__*/internal.logWithLevel("Info");
6782
6692
  * // timestamp=2023-... level=DEBUG message="Variable state: x=10 y=20 z=30"
6783
6693
  * ```
6784
6694
  *
6785
- * @category Logging
6695
+ * @category logging
6786
6696
  * @since 2.0.0
6787
6697
  */
6788
6698
  export const logDebug = /*#__PURE__*/internal.logWithLevel("Debug");
6789
6699
  /**
6790
6700
  * Logs one or more messages at the TRACE level.
6791
6701
  *
6792
- * **Example** (Usage)
6702
+ * **Example** (Logging trace messages)
6793
6703
  *
6794
6704
  * ```ts
6795
6705
  * import { Effect } from "effect"
@@ -6814,14 +6724,14 @@ export const logDebug = /*#__PURE__*/internal.logWithLevel("Debug");
6814
6724
  * // timestamp=2023-... level=TRACE message="Exiting function processData"
6815
6725
  * ```
6816
6726
  *
6817
- * @category Logging
6727
+ * @category logging
6818
6728
  * @since 2.0.0
6819
6729
  */
6820
6730
  export const logTrace = /*#__PURE__*/internal.logWithLevel("Trace");
6821
6731
  /**
6822
6732
  * Adds a logger to the set of loggers which will output logs for this effect.
6823
6733
  *
6824
- * **Example** (Usage)
6734
+ * **Example** (Adding a logger to an effect)
6825
6735
  *
6826
6736
  * ```ts
6827
6737
  * import { Effect, Logger } from "effect"
@@ -6843,14 +6753,14 @@ export const logTrace = /*#__PURE__*/internal.logWithLevel("Trace");
6843
6753
  * // Output includes both default and custom log outputs
6844
6754
  * ```
6845
6755
  *
6846
- * @category Logging
6847
- * @since 2.0.0
6756
+ * @category logging
6757
+ * @since 4.0.0
6848
6758
  */
6849
6759
  export const withLogger = /*#__PURE__*/dual(2, (effect, logger) => internal.updateService(effect, internal.CurrentLoggers, loggers => new Set([...loggers, logger])));
6850
6760
  /**
6851
6761
  * Adds an annotation to each log line in this effect.
6852
6762
  *
6853
- * **Example** (Usage)
6763
+ * **Example** (Adding log annotations)
6854
6764
  *
6855
6765
  * ```ts
6856
6766
  * import { Effect } from "effect"
@@ -6874,7 +6784,7 @@ export const withLogger = /*#__PURE__*/dual(2, (effect, logger) => internal.upda
6874
6784
  * // All log messages will include the userId and operation annotations
6875
6785
  * ```
6876
6786
  *
6877
- * @category Logging
6787
+ * @category logging
6878
6788
  * @since 2.0.0
6879
6789
  */
6880
6790
  export const annotateLogs = /*#__PURE__*/dual(args => isEffect(args[0]), (effect, ...args) => internal.updateService(effect, CurrentLogAnnotations, annotations => {
@@ -6895,7 +6805,7 @@ export const annotateLogs = /*#__PURE__*/dual(args => isEffect(args[0]), (effect
6895
6805
  * `annotateLogsScoped` updates annotations for the entire current `Scope` and
6896
6806
  * restores the previous annotations when the scope closes.
6897
6807
  *
6898
- * **Example** (Usage)
6808
+ * **Example** (Adding scoped log annotations)
6899
6809
  *
6900
6810
  * ```ts
6901
6811
  * import { Effect } from "effect"
@@ -6911,14 +6821,14 @@ export const annotateLogs = /*#__PURE__*/dual(args => isEffect(args[0]), (effect
6911
6821
  * Effect.runPromise(program)
6912
6822
  * ```
6913
6823
  *
6914
- * @category Logging
6915
- * @since 4.0.0
6824
+ * @category logging
6825
+ * @since 3.1.0
6916
6826
  */
6917
6827
  export const annotateLogsScoped = internal.annotateLogsScoped;
6918
6828
  /**
6919
6829
  * Adds a span to each log line in this effect.
6920
6830
  *
6921
- * **Example** (Usage)
6831
+ * **Example** (Adding a log span)
6922
6832
  *
6923
6833
  * ```ts
6924
6834
  * import { Effect } from "effect"
@@ -6943,7 +6853,7 @@ export const annotateLogsScoped = internal.annotateLogsScoped;
6943
6853
  * // All log messages will include span information showing the nested operation context
6944
6854
  * ```
6945
6855
  *
6946
- * @category Logging
6856
+ * @category logging
6947
6857
  * @since 2.0.0
6948
6858
  */
6949
6859
  export const withLogSpan = /*#__PURE__*/dual(2, (effect, label) => internal.flatMap(internal.currentTimeMillis, now => internal.updateService(effect, CurrentLogSpans, spans => {
@@ -6959,7 +6869,7 @@ export const withLogSpan = /*#__PURE__*/dual(2, (effect, label) => internal.flat
6959
6869
  * Also accepts an optional function which can be used to map the `Exit` value
6960
6870
  * of the `Effect` into a valid `Input` for the `Metric`.
6961
6871
  *
6962
- * **Example** (Usage)
6872
+ * **Example** (Incrementing a metric for each execution)
6963
6873
  *
6964
6874
  * ```ts
6965
6875
  * import { Effect, Metric } from "effect"
@@ -6979,7 +6889,7 @@ export const withLogSpan = /*#__PURE__*/dual(2, (effect, label) => internal.flat
6979
6889
  * )
6980
6890
  * ```
6981
6891
  *
6982
- * **Example** (Usage)
6892
+ * **Example** (Mapping exits before updating a metric)
6983
6893
  *
6984
6894
  * ```ts
6985
6895
  * import { Effect, Exit, Metric } from "effect"
@@ -7014,7 +6924,7 @@ export const track = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric,
7014
6924
  * Also accepts an optional function which can be used to map the success value
7015
6925
  * of the `Effect` into a valid `Input` for the `Metric`.
7016
6926
  *
7017
- * **Example** (Usage)
6927
+ * **Example** (Counting successful results)
7018
6928
  *
7019
6929
  * ```ts
7020
6930
  * import { Effect, Metric } from "effect"
@@ -7033,7 +6943,7 @@ export const track = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric,
7033
6943
  * )
7034
6944
  * ```
7035
6945
  *
7036
- * **Example** (Usage)
6946
+ * **Example** (Mapping successes before tracking)
7037
6947
  *
7038
6948
  * ```ts
7039
6949
  * import { Effect, Metric } from "effect"
@@ -7065,7 +6975,7 @@ export const trackSuccesses = /*#__PURE__*/dual(args => isEffect(args[0]), (self
7065
6975
  * Also accepts an optional function which can be used to map the error value
7066
6976
  * of the `Effect` into a valid `Input` for the `Metric`.
7067
6977
  *
7068
- * **Example** (Usage)
6978
+ * **Example** (Counting expected failures)
7069
6979
  *
7070
6980
  * ```ts
7071
6981
  * import { Effect, Metric } from "effect"
@@ -7084,7 +6994,7 @@ export const trackSuccesses = /*#__PURE__*/dual(args => isEffect(args[0]), (self
7084
6994
  * )
7085
6995
  * ```
7086
6996
  *
7087
- * **Example** (Usage)
6997
+ * **Example** (Mapping errors before tracking)
7088
6998
  *
7089
6999
  * ```ts
7090
7000
  * import { Data, Effect, Metric } from "effect"
@@ -7118,7 +7028,7 @@ export const trackErrors = /*#__PURE__*/dual(args => isEffect(args[0]), (self, m
7118
7028
  * Also accepts an optional function which can be used to map the defect value
7119
7029
  * of the `Effect` into a valid `Input` for the `Metric`.
7120
7030
  *
7121
- * **Example** (Usage)
7031
+ * **Example** (Counting defects)
7122
7032
  *
7123
7033
  * ```ts
7124
7034
  * import { Effect, Metric } from "effect"
@@ -7137,7 +7047,7 @@ export const trackErrors = /*#__PURE__*/dual(args => isEffect(args[0]), (self, m
7137
7047
  * )
7138
7048
  * ```
7139
7049
  *
7140
- * **Example** (Usage)
7050
+ * **Example** (Mapping defects before tracking)
7141
7051
  *
7142
7052
  * ```ts
7143
7053
  * import { Effect, Metric } from "effect"
@@ -7173,7 +7083,7 @@ export const trackDefects = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
7173
7083
  * that the wrapped `Effect` took to complete into a valid `Input` for the
7174
7084
  * `Metric`.
7175
7085
  *
7176
- * **Example** (Usage)
7086
+ * **Example** (Recording execution duration)
7177
7087
  *
7178
7088
  * ```ts
7179
7089
  * import { Effect, Metric } from "effect"
@@ -7190,7 +7100,7 @@ export const trackDefects = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
7190
7100
  * )
7191
7101
  * ```
7192
7102
  *
7193
- * **Example** (Usage)
7103
+ * **Example** (Mapping duration before tracking)
7194
7104
  *
7195
7105
  * ```ts
7196
7106
  * import { Duration, Effect, Metric } from "effect"
@@ -7229,7 +7139,7 @@ export const trackDuration = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
7229
7139
  * - a journal that stores any non committed change to TxRef values
7230
7140
  * - a retry flag to know if the transaction should be retried
7231
7141
  *
7232
- * **Example** (Usage)
7142
+ * **Example** (Building transactions)
7233
7143
  *
7234
7144
  * ```ts
7235
7145
  * import { Effect } from "effect"
@@ -7264,7 +7174,7 @@ export class Transaction extends /*#__PURE__*/Context.Service()("effect/Effect/T
7264
7174
  * The outermost `tx` call creates the transaction boundary and commits or rolls back the full
7265
7175
  * composed transaction.
7266
7176
  *
7267
- * **Example** (Usage)
7177
+ * **Example** (Running a transaction)
7268
7178
  *
7269
7179
  * ```ts
7270
7180
  * import { Effect, TxRef } from "effect"
@@ -7373,7 +7283,7 @@ function clearTransaction(state) {
7373
7283
  * @category Transactions
7374
7284
  * @since 4.0.0
7375
7285
  *
7376
- * **Example** (Usage)
7286
+ * **Example** (Retrying transactions)
7377
7287
  *
7378
7288
  * ```ts
7379
7289
  * import { Effect, TxRef } from "effect"
@@ -7418,7 +7328,7 @@ export const txRetry = /*#__PURE__*/flatMap(Transaction, state => {
7418
7328
  * callback errors and `onSyncError` to turn synchronous throws into typed
7419
7329
  * failures; otherwise synchronous throws become defects.
7420
7330
  *
7421
- * **Example** (Basic Usage)
7331
+ * **Example** (Converting callbacks to effects)
7422
7332
  *
7423
7333
  * ```ts
7424
7334
  * import { Effect } from "effect"
@@ -7434,7 +7344,7 @@ export const txRetry = /*#__PURE__*/flatMap(Transaction, state => {
7434
7344
  * // Output: contents of package.json
7435
7345
  * ```
7436
7346
  *
7437
- * **Example** (Custom Error Handling)
7347
+ * **Example** (Mapping callback errors to typed failures)
7438
7348
  *
7439
7349
  * ```ts
7440
7350
  * import { Effect } from "effect"
@@ -7476,7 +7386,7 @@ export const effectify = (fn, onError, onSyncError) => (...args) => callback(res
7476
7386
  * This function provides compile-time type checking to ensure that the success
7477
7387
  * value of an effect conforms to a specific type constraint.
7478
7388
  *
7479
- * **Example** (Usage)
7389
+ * **Example** (Constraining the success type)
7480
7390
  *
7481
7391
  * ```ts
7482
7392
  * import { Effect } from "effect"
@@ -7503,7 +7413,7 @@ export const satisfiesSuccessType = () => effect => effect;
7503
7413
  * This function provides compile-time type checking to ensure that the error
7504
7414
  * type of an effect conforms to a specific type constraint.
7505
7415
  *
7506
- * **Example** (Usage)
7416
+ * **Example** (Constraining the error type)
7507
7417
  *
7508
7418
  * ```ts
7509
7419
  * import { Data, Effect } from "effect"
@@ -7532,7 +7442,7 @@ export const satisfiesErrorType = () => effect => effect;
7532
7442
  * This function provides compile-time type checking to ensure that the
7533
7443
  * requirements (context) type of an effect conforms to a specific type constraint.
7534
7444
  *
7535
- * **Example** (Usage)
7445
+ * **Example** (Constraining the services type)
7536
7446
  *
7537
7447
  * ```ts
7538
7448
  * import { Effect } from "effect"
@@ -7569,7 +7479,7 @@ export const satisfiesServicesType = () => effect => effect;
7569
7479
  * - For **Failure effects**: Returns the failure as-is without applying the mapping
7570
7480
  * - For **Pending effects**: Falls back to the regular `map` behavior
7571
7481
  *
7572
- * **Example** (Usage)
7482
+ * **Example** (Mapping already completed effects)
7573
7483
  *
7574
7484
  * ```ts
7575
7485
  * import { Effect } from "effect"
@@ -7603,7 +7513,7 @@ export const mapEager = internal.mapEager;
7603
7513
  * - For **Failure effects**: Applies the mapping function immediately to the error
7604
7514
  * - For **Pending effects**: Falls back to the regular `mapError` behavior
7605
7515
  *
7606
- * **Example** (Usage)
7516
+ * **Example** (Mapping errors eagerly when possible)
7607
7517
  *
7608
7518
  * ```ts
7609
7519
  * import { Effect } from "effect"
@@ -7640,7 +7550,7 @@ export const mapErrorEager = internal.mapErrorEager;
7640
7550
  * - For **Failure effects**: Applies the `onFailure` function immediately to the error
7641
7551
  * - For **Pending effects**: Falls back to the regular `mapBoth` behavior
7642
7552
  *
7643
- * **Example** (Usage)
7553
+ * **Example** (Mapping both channels eagerly when possible)
7644
7554
  *
7645
7555
  * ```ts
7646
7556
  * import { Effect } from "effect"
@@ -7679,7 +7589,7 @@ export const mapBothEager = internal.mapBothEager;
7679
7589
  * - For **Failure effects**: Returns the failure as-is without applying the flatMap
7680
7590
  * - For **Pending effects**: Falls back to the regular `flatMap` behavior
7681
7591
  *
7682
- * **Example** (Usage)
7592
+ * **Example** (Flat mapping eagerly when possible)
7683
7593
  *
7684
7594
  * ```ts
7685
7595
  * import { Effect } from "effect"
@@ -7716,7 +7626,7 @@ export const flatMapEager = internal.flatMapEager;
7716
7626
  * - For **Failure effects**: Applies the catch function immediately to the error
7717
7627
  * - For **Pending effects**: Falls back to the regular `catch` behavior
7718
7628
  *
7719
- * **Example** (Usage)
7629
+ * **Example** (Catching failures eagerly when possible)
7720
7630
  *
7721
7631
  * ```ts
7722
7632
  * import { Effect } from "effect"
@@ -7753,7 +7663,7 @@ export const catchEager = internal.catchEager;
7753
7663
  * Executes generator functions eagerly when all yielded effects are synchronous,
7754
7664
  * stopping at the first async effect and deferring to normal execution.
7755
7665
  *
7756
- * **Example** (Usage)
7666
+ * **Example** (Defining eager untraced effect functions)
7757
7667
  *
7758
7668
  * ```ts
7759
7669
  * import { Effect } from "effect"