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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1767) hide show
  1. package/dist/Array.d.ts +151 -106
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +50 -40
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +620 -553
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +298 -254
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +342 -274
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +168 -126
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +189 -156
  14. package/dist/Boolean.d.ts.map +1 -1
  15. package/dist/Boolean.js +85 -68
  16. package/dist/Boolean.js.map +1 -1
  17. package/dist/Brand.d.ts +30 -5
  18. package/dist/Brand.d.ts.map +1 -1
  19. package/dist/Brand.js +19 -2
  20. package/dist/Brand.js.map +1 -1
  21. package/dist/Cache.d.ts +239 -135
  22. package/dist/Cache.d.ts.map +1 -1
  23. package/dist/Cache.js +135 -59
  24. package/dist/Cache.js.map +1 -1
  25. package/dist/Cause.d.ts +84 -73
  26. package/dist/Cause.d.ts.map +1 -1
  27. package/dist/Cause.js +51 -44
  28. package/dist/Cause.js.map +1 -1
  29. package/dist/Channel.d.ts +1568 -632
  30. package/dist/Channel.d.ts.map +1 -1
  31. package/dist/Channel.js +685 -315
  32. package/dist/Channel.js.map +1 -1
  33. package/dist/ChannelSchema.d.ts +119 -10
  34. package/dist/ChannelSchema.d.ts.map +1 -1
  35. package/dist/ChannelSchema.js +45 -6
  36. package/dist/ChannelSchema.js.map +1 -1
  37. package/dist/Chunk.d.ts +574 -428
  38. package/dist/Chunk.d.ts.map +1 -1
  39. package/dist/Chunk.js +250 -191
  40. package/dist/Chunk.js.map +1 -1
  41. package/dist/Clock.d.ts +16 -9
  42. package/dist/Clock.d.ts.map +1 -1
  43. package/dist/Clock.js +9 -5
  44. package/dist/Clock.js.map +1 -1
  45. package/dist/Combiner.d.ts +11 -5
  46. package/dist/Combiner.d.ts.map +1 -1
  47. package/dist/Combiner.js +10 -4
  48. package/dist/Combiner.js.map +1 -1
  49. package/dist/Config.d.ts +80 -68
  50. package/dist/Config.d.ts.map +1 -1
  51. package/dist/Config.js +53 -49
  52. package/dist/Config.js.map +1 -1
  53. package/dist/ConfigProvider.d.ts +33 -32
  54. package/dist/ConfigProvider.d.ts.map +1 -1
  55. package/dist/ConfigProvider.js +19 -18
  56. package/dist/ConfigProvider.js.map +1 -1
  57. package/dist/Console.d.ts +76 -50
  58. package/dist/Console.d.ts.map +1 -1
  59. package/dist/Console.js +69 -46
  60. package/dist/Console.js.map +1 -1
  61. package/dist/Context.d.ts +400 -189
  62. package/dist/Context.d.ts.map +1 -1
  63. package/dist/Context.js +143 -77
  64. package/dist/Context.js.map +1 -1
  65. package/dist/Cron.d.ts +67 -48
  66. package/dist/Cron.d.ts.map +1 -1
  67. package/dist/Cron.js +94 -36
  68. package/dist/Cron.js.map +1 -1
  69. package/dist/Crypto.d.ts +208 -0
  70. package/dist/Crypto.d.ts.map +1 -0
  71. package/dist/Crypto.js +157 -0
  72. package/dist/Crypto.js.map +1 -0
  73. package/dist/Data.d.ts +9 -3
  74. package/dist/Data.d.ts.map +1 -1
  75. package/dist/Data.js.map +1 -1
  76. package/dist/DateTime.d.ts +893 -464
  77. package/dist/DateTime.d.ts.map +1 -1
  78. package/dist/DateTime.js +387 -228
  79. package/dist/DateTime.js.map +1 -1
  80. package/dist/Deferred.d.ts +367 -175
  81. package/dist/Deferred.d.ts.map +1 -1
  82. package/dist/Deferred.js +146 -72
  83. package/dist/Deferred.js.map +1 -1
  84. package/dist/Differ.d.ts +44 -2
  85. package/dist/Differ.d.ts.map +1 -1
  86. package/dist/Differ.js +36 -0
  87. package/dist/Duration.d.ts +333 -186
  88. package/dist/Duration.d.ts.map +1 -1
  89. package/dist/Duration.js +178 -107
  90. package/dist/Duration.js.map +1 -1
  91. package/dist/Effect.d.ts +2181 -2275
  92. package/dist/Effect.d.ts.map +1 -1
  93. package/dist/Effect.js +935 -850
  94. package/dist/Effect.js.map +1 -1
  95. package/dist/Effectable.d.ts +38 -3
  96. package/dist/Effectable.d.ts.map +1 -1
  97. package/dist/Effectable.js +3 -3
  98. package/dist/Effectable.js.map +1 -1
  99. package/dist/Encoding.d.ts +78 -28
  100. package/dist/Encoding.d.ts.map +1 -1
  101. package/dist/Encoding.js +75 -27
  102. package/dist/Encoding.js.map +1 -1
  103. package/dist/Equal.d.ts +4 -3
  104. package/dist/Equal.d.ts.map +1 -1
  105. package/dist/Equal.js +4 -3
  106. package/dist/Equal.js.map +1 -1
  107. package/dist/Equivalence.d.ts +18 -24
  108. package/dist/Equivalence.d.ts.map +1 -1
  109. package/dist/Equivalence.js +16 -21
  110. package/dist/Equivalence.js.map +1 -1
  111. package/dist/ErrorReporter.d.ts +66 -82
  112. package/dist/ErrorReporter.d.ts.map +1 -1
  113. package/dist/ErrorReporter.js +38 -29
  114. package/dist/ErrorReporter.js.map +1 -1
  115. package/dist/ExecutionPlan.d.ts +106 -12
  116. package/dist/ExecutionPlan.d.ts.map +1 -1
  117. package/dist/ExecutionPlan.js +23 -6
  118. package/dist/ExecutionPlan.js.map +1 -1
  119. package/dist/Exit.d.ts +6 -5
  120. package/dist/Exit.d.ts.map +1 -1
  121. package/dist/Exit.js.map +1 -1
  122. package/dist/Fiber.d.ts +71 -40
  123. package/dist/Fiber.d.ts.map +1 -1
  124. package/dist/Fiber.js +39 -21
  125. package/dist/Fiber.js.map +1 -1
  126. package/dist/FiberHandle.d.ts +118 -57
  127. package/dist/FiberHandle.d.ts.map +1 -1
  128. package/dist/FiberHandle.js +121 -39
  129. package/dist/FiberHandle.js.map +1 -1
  130. package/dist/FiberMap.d.ts +287 -159
  131. package/dist/FiberMap.d.ts.map +1 -1
  132. package/dist/FiberMap.js +175 -73
  133. package/dist/FiberMap.js.map +1 -1
  134. package/dist/FiberSet.d.ts +93 -52
  135. package/dist/FiberSet.d.ts.map +1 -1
  136. package/dist/FiberSet.js +97 -34
  137. package/dist/FiberSet.js.map +1 -1
  138. package/dist/FileSystem.d.ts +102 -73
  139. package/dist/FileSystem.d.ts.map +1 -1
  140. package/dist/FileSystem.js +53 -39
  141. package/dist/FileSystem.js.map +1 -1
  142. package/dist/Filter.d.ts +166 -88
  143. package/dist/Filter.d.ts.map +1 -1
  144. package/dist/Filter.js +68 -42
  145. package/dist/Filter.js.map +1 -1
  146. package/dist/Formatter.d.ts +4 -2
  147. package/dist/Formatter.d.ts.map +1 -1
  148. package/dist/Formatter.js +3 -69
  149. package/dist/Formatter.js.map +1 -1
  150. package/dist/Function.d.ts +218 -151
  151. package/dist/Function.d.ts.map +1 -1
  152. package/dist/Function.js +94 -78
  153. package/dist/Function.js.map +1 -1
  154. package/dist/Graph.d.ts +714 -415
  155. package/dist/Graph.d.ts.map +1 -1
  156. package/dist/Graph.js +325 -182
  157. package/dist/Graph.js.map +1 -1
  158. package/dist/HKT.d.ts +29 -13
  159. package/dist/HKT.d.ts.map +1 -1
  160. package/dist/Hash.d.ts +35 -24
  161. package/dist/Hash.d.ts.map +1 -1
  162. package/dist/Hash.js +27 -17
  163. package/dist/Hash.js.map +1 -1
  164. package/dist/HashMap.d.ts +540 -388
  165. package/dist/HashMap.d.ts.map +1 -1
  166. package/dist/HashMap.js +262 -156
  167. package/dist/HashMap.js.map +1 -1
  168. package/dist/HashRing.d.ts +53 -34
  169. package/dist/HashRing.d.ts.map +1 -1
  170. package/dist/HashRing.js +83 -16
  171. package/dist/HashRing.js.map +1 -1
  172. package/dist/HashSet.d.ts +239 -153
  173. package/dist/HashSet.d.ts.map +1 -1
  174. package/dist/HashSet.js +110 -56
  175. package/dist/HashSet.js.map +1 -1
  176. package/dist/Inspectable.d.ts +26 -13
  177. package/dist/Inspectable.d.ts.map +1 -1
  178. package/dist/Inspectable.js +22 -10
  179. package/dist/Inspectable.js.map +1 -1
  180. package/dist/Iterable.d.ts +336 -222
  181. package/dist/Iterable.d.ts.map +1 -1
  182. package/dist/Iterable.js +146 -100
  183. package/dist/Iterable.js.map +1 -1
  184. package/dist/JsonPatch.d.ts +12 -9
  185. package/dist/JsonPatch.d.ts.map +1 -1
  186. package/dist/JsonPatch.js +9 -6
  187. package/dist/JsonPatch.js.map +1 -1
  188. package/dist/JsonPointer.d.ts +13 -11
  189. package/dist/JsonPointer.d.ts.map +1 -1
  190. package/dist/JsonPointer.js +13 -11
  191. package/dist/JsonPointer.js.map +1 -1
  192. package/dist/JsonSchema.d.ts +16 -0
  193. package/dist/JsonSchema.d.ts.map +1 -1
  194. package/dist/JsonSchema.js +10 -0
  195. package/dist/JsonSchema.js.map +1 -1
  196. package/dist/Latch.d.ts +97 -26
  197. package/dist/Latch.d.ts.map +1 -1
  198. package/dist/Latch.js +39 -20
  199. package/dist/Latch.js.map +1 -1
  200. package/dist/Layer.d.ts +472 -410
  201. package/dist/Layer.d.ts.map +1 -1
  202. package/dist/Layer.js +290 -226
  203. package/dist/Layer.js.map +1 -1
  204. package/dist/LayerMap.d.ts +99 -26
  205. package/dist/LayerMap.d.ts.map +1 -1
  206. package/dist/LayerMap.js +58 -14
  207. package/dist/LayerMap.js.map +1 -1
  208. package/dist/LogLevel.d.ts +92 -131
  209. package/dist/LogLevel.d.ts.map +1 -1
  210. package/dist/LogLevel.js +25 -15
  211. package/dist/LogLevel.js.map +1 -1
  212. package/dist/Logger.d.ts +159 -104
  213. package/dist/Logger.d.ts.map +1 -1
  214. package/dist/Logger.js +215 -189
  215. package/dist/Logger.js.map +1 -1
  216. package/dist/ManagedRuntime.d.ts +78 -19
  217. package/dist/ManagedRuntime.d.ts.map +1 -1
  218. package/dist/ManagedRuntime.js +24 -17
  219. package/dist/ManagedRuntime.js.map +1 -1
  220. package/dist/Match.d.ts +135 -161
  221. package/dist/Match.d.ts.map +1 -1
  222. package/dist/Match.js +86 -78
  223. package/dist/Match.js.map +1 -1
  224. package/dist/Metric.d.ts +330 -291
  225. package/dist/Metric.d.ts.map +1 -1
  226. package/dist/Metric.js +219 -214
  227. package/dist/Metric.js.map +1 -1
  228. package/dist/MutableHashMap.d.ts +146 -87
  229. package/dist/MutableHashMap.d.ts.map +1 -1
  230. package/dist/MutableHashMap.js +67 -43
  231. package/dist/MutableHashMap.js.map +1 -1
  232. package/dist/MutableHashSet.d.ts +52 -30
  233. package/dist/MutableHashSet.d.ts.map +1 -1
  234. package/dist/MutableHashSet.js +92 -38
  235. package/dist/MutableHashSet.js.map +1 -1
  236. package/dist/MutableList.d.ts +110 -68
  237. package/dist/MutableList.d.ts.map +1 -1
  238. package/dist/MutableList.js +135 -85
  239. package/dist/MutableList.js.map +1 -1
  240. package/dist/MutableRef.d.ts +99 -62
  241. package/dist/MutableRef.d.ts.map +1 -1
  242. package/dist/MutableRef.js +78 -60
  243. package/dist/MutableRef.js.map +1 -1
  244. package/dist/Newtype.d.ts +15 -2
  245. package/dist/Newtype.d.ts.map +1 -1
  246. package/dist/Newtype.js +8 -2
  247. package/dist/Newtype.js.map +1 -1
  248. package/dist/NonEmptyIterable.d.ts +38 -48
  249. package/dist/NonEmptyIterable.d.ts.map +1 -1
  250. package/dist/NonEmptyIterable.js +34 -25
  251. package/dist/NonEmptyIterable.js.map +1 -1
  252. package/dist/Number.d.ts +261 -205
  253. package/dist/Number.d.ts.map +1 -1
  254. package/dist/Number.js +119 -91
  255. package/dist/Number.js.map +1 -1
  256. package/dist/Optic.d.ts +6 -7
  257. package/dist/Optic.d.ts.map +1 -1
  258. package/dist/Optic.js +5 -6
  259. package/dist/Optic.js.map +1 -1
  260. package/dist/Option.d.ts +133 -156
  261. package/dist/Option.d.ts.map +1 -1
  262. package/dist/Option.js +64 -64
  263. package/dist/Option.js.map +1 -1
  264. package/dist/Order.d.ts +6 -6
  265. package/dist/Order.js +6 -6
  266. package/dist/Ordering.d.ts +56 -45
  267. package/dist/Ordering.d.ts.map +1 -1
  268. package/dist/Ordering.js +10 -8
  269. package/dist/Ordering.js.map +1 -1
  270. package/dist/PartitionedSemaphore.d.ts +225 -40
  271. package/dist/PartitionedSemaphore.d.ts.map +1 -1
  272. package/dist/PartitionedSemaphore.js +113 -17
  273. package/dist/PartitionedSemaphore.js.map +1 -1
  274. package/dist/Path.d.ts +77 -13
  275. package/dist/Path.d.ts.map +1 -1
  276. package/dist/Path.js +49 -4
  277. package/dist/Path.js.map +1 -1
  278. package/dist/Pipeable.d.ts +77 -18
  279. package/dist/Pipeable.d.ts.map +1 -1
  280. package/dist/Pipeable.js +63 -14
  281. package/dist/Pipeable.js.map +1 -1
  282. package/dist/PlatformError.d.ts +74 -6
  283. package/dist/PlatformError.d.ts.map +1 -1
  284. package/dist/PlatformError.js +68 -5
  285. package/dist/PlatformError.js.map +1 -1
  286. package/dist/Pool.d.ts +66 -31
  287. package/dist/Pool.d.ts.map +1 -1
  288. package/dist/Pool.js +26 -24
  289. package/dist/Pool.js.map +1 -1
  290. package/dist/Predicate.d.ts +16 -23
  291. package/dist/Predicate.d.ts.map +1 -1
  292. package/dist/Predicate.js +12 -17
  293. package/dist/Predicate.js.map +1 -1
  294. package/dist/PrimaryKey.d.ts +11 -3
  295. package/dist/PrimaryKey.d.ts.map +1 -1
  296. package/dist/PrimaryKey.js +9 -2
  297. package/dist/PrimaryKey.js.map +1 -1
  298. package/dist/PubSub.d.ts +385 -309
  299. package/dist/PubSub.d.ts.map +1 -1
  300. package/dist/PubSub.js +260 -207
  301. package/dist/PubSub.js.map +1 -1
  302. package/dist/Pull.d.ts +94 -25
  303. package/dist/Pull.d.ts.map +1 -1
  304. package/dist/Pull.js +61 -13
  305. package/dist/Pull.js.map +1 -1
  306. package/dist/Queue.d.ts +303 -184
  307. package/dist/Queue.d.ts.map +1 -1
  308. package/dist/Queue.js +231 -134
  309. package/dist/Queue.js.map +1 -1
  310. package/dist/Random.d.ts +65 -57
  311. package/dist/Random.d.ts.map +1 -1
  312. package/dist/Random.js +41 -66
  313. package/dist/Random.js.map +1 -1
  314. package/dist/RcMap.d.ts +151 -141
  315. package/dist/RcMap.d.ts.map +1 -1
  316. package/dist/RcMap.js +66 -20
  317. package/dist/RcMap.js.map +1 -1
  318. package/dist/RcRef.d.ts +68 -32
  319. package/dist/RcRef.d.ts.map +1 -1
  320. package/dist/RcRef.js +33 -16
  321. package/dist/RcRef.js.map +1 -1
  322. package/dist/Record.d.ts +282 -137
  323. package/dist/Record.d.ts.map +1 -1
  324. package/dist/Record.js +124 -62
  325. package/dist/Record.js.map +1 -1
  326. package/dist/Redactable.d.ts +7 -5
  327. package/dist/Redactable.d.ts.map +1 -1
  328. package/dist/Redactable.js +5 -3
  329. package/dist/Redactable.js.map +1 -1
  330. package/dist/Redacted.d.ts +63 -34
  331. package/dist/Redacted.d.ts.map +1 -1
  332. package/dist/Redacted.js +31 -15
  333. package/dist/Redacted.js.map +1 -1
  334. package/dist/Reducer.d.ts +3 -1
  335. package/dist/Reducer.d.ts.map +1 -1
  336. package/dist/Reducer.js +2 -0
  337. package/dist/Reducer.js.map +1 -1
  338. package/dist/Ref.d.ts +85 -66
  339. package/dist/Ref.d.ts.map +1 -1
  340. package/dist/Ref.js +57 -45
  341. package/dist/Ref.js.map +1 -1
  342. package/dist/References.d.ts +73 -31
  343. package/dist/References.d.ts.map +1 -1
  344. package/dist/References.js +66 -30
  345. package/dist/References.js.map +1 -1
  346. package/dist/RegExp.d.ts +12 -6
  347. package/dist/RegExp.d.ts.map +1 -1
  348. package/dist/RegExp.js +12 -6
  349. package/dist/RegExp.js.map +1 -1
  350. package/dist/Request.d.ts +159 -34
  351. package/dist/Request.d.ts.map +1 -1
  352. package/dist/Request.js +68 -12
  353. package/dist/Request.js.map +1 -1
  354. package/dist/RequestResolver.d.ts +262 -118
  355. package/dist/RequestResolver.d.ts.map +1 -1
  356. package/dist/RequestResolver.js +78 -42
  357. package/dist/RequestResolver.js.map +1 -1
  358. package/dist/Resource.d.ts +13 -7
  359. package/dist/Resource.d.ts.map +1 -1
  360. package/dist/Resource.js +44 -6
  361. package/dist/Resource.js.map +1 -1
  362. package/dist/Result.d.ts +135 -151
  363. package/dist/Result.d.ts.map +1 -1
  364. package/dist/Result.js +56 -68
  365. package/dist/Result.js.map +1 -1
  366. package/dist/Runtime.d.ts +40 -20
  367. package/dist/Runtime.d.ts.map +1 -1
  368. package/dist/Runtime.js +34 -17
  369. package/dist/Runtime.js.map +1 -1
  370. package/dist/Schedule.d.ts +556 -590
  371. package/dist/Schedule.d.ts.map +1 -1
  372. package/dist/Schedule.js +265 -253
  373. package/dist/Schedule.js.map +1 -1
  374. package/dist/Scheduler.d.ts +44 -7
  375. package/dist/Scheduler.d.ts.map +1 -1
  376. package/dist/Scheduler.js +34 -5
  377. package/dist/Scheduler.js.map +1 -1
  378. package/dist/Schema.d.ts +1293 -602
  379. package/dist/Schema.d.ts.map +1 -1
  380. package/dist/Schema.js +501 -361
  381. package/dist/Schema.js.map +1 -1
  382. package/dist/SchemaAST.d.ts +122 -92
  383. package/dist/SchemaAST.d.ts.map +1 -1
  384. package/dist/SchemaAST.js +102 -77
  385. package/dist/SchemaAST.js.map +1 -1
  386. package/dist/SchemaGetter.d.ts +49 -36
  387. package/dist/SchemaGetter.d.ts.map +1 -1
  388. package/dist/SchemaGetter.js +42 -29
  389. package/dist/SchemaGetter.js.map +1 -1
  390. package/dist/SchemaIssue.d.ts +19 -24
  391. package/dist/SchemaIssue.d.ts.map +1 -1
  392. package/dist/SchemaIssue.js +16 -14
  393. package/dist/SchemaIssue.js.map +1 -1
  394. package/dist/SchemaParser.d.ts +231 -63
  395. package/dist/SchemaParser.d.ts.map +1 -1
  396. package/dist/SchemaParser.js +266 -75
  397. package/dist/SchemaParser.js.map +1 -1
  398. package/dist/SchemaRepresentation.d.ts +89 -77
  399. package/dist/SchemaRepresentation.d.ts.map +1 -1
  400. package/dist/SchemaRepresentation.js +47 -37
  401. package/dist/SchemaRepresentation.js.map +1 -1
  402. package/dist/SchemaTransformation.d.ts +97 -46
  403. package/dist/SchemaTransformation.d.ts.map +1 -1
  404. package/dist/SchemaTransformation.js +89 -38
  405. package/dist/SchemaTransformation.js.map +1 -1
  406. package/dist/SchemaUtils.d.ts +8 -1
  407. package/dist/SchemaUtils.d.ts.map +1 -1
  408. package/dist/SchemaUtils.js +24 -1
  409. package/dist/SchemaUtils.js.map +1 -1
  410. package/dist/Scope.d.ts +107 -65
  411. package/dist/Scope.d.ts.map +1 -1
  412. package/dist/Scope.js +61 -32
  413. package/dist/Scope.js.map +1 -1
  414. package/dist/ScopedCache.d.ts +141 -49
  415. package/dist/ScopedCache.d.ts.map +1 -1
  416. package/dist/ScopedCache.js +82 -21
  417. package/dist/ScopedCache.js.map +1 -1
  418. package/dist/ScopedRef.d.ts +28 -8
  419. package/dist/ScopedRef.d.ts.map +1 -1
  420. package/dist/ScopedRef.js +25 -5
  421. package/dist/ScopedRef.js.map +1 -1
  422. package/dist/Semaphore.d.ts +61 -37
  423. package/dist/Semaphore.d.ts.map +1 -1
  424. package/dist/Semaphore.js +18 -21
  425. package/dist/Semaphore.js.map +1 -1
  426. package/dist/Sink.d.ts +461 -206
  427. package/dist/Sink.d.ts.map +1 -1
  428. package/dist/Sink.js +241 -90
  429. package/dist/Sink.js.map +1 -1
  430. package/dist/Stdio.d.ts +43 -6
  431. package/dist/Stdio.d.ts.map +1 -1
  432. package/dist/Stdio.js +33 -4
  433. package/dist/Stdio.js.map +1 -1
  434. package/dist/Stream.d.ts +2117 -1541
  435. package/dist/Stream.d.ts.map +1 -1
  436. package/dist/Stream.js +951 -682
  437. package/dist/Stream.js.map +1 -1
  438. package/dist/String.d.ts +174 -97
  439. package/dist/String.d.ts.map +1 -1
  440. package/dist/String.js +128 -69
  441. package/dist/String.js.map +1 -1
  442. package/dist/Struct.d.ts +20 -18
  443. package/dist/Struct.d.ts.map +1 -1
  444. package/dist/Struct.js +10 -8
  445. package/dist/Struct.js.map +1 -1
  446. package/dist/SubscriptionRef.d.ts +309 -204
  447. package/dist/SubscriptionRef.d.ts.map +1 -1
  448. package/dist/SubscriptionRef.js +126 -77
  449. package/dist/SubscriptionRef.js.map +1 -1
  450. package/dist/Symbol.d.ts +13 -5
  451. package/dist/Symbol.d.ts.map +1 -1
  452. package/dist/Symbol.js +13 -5
  453. package/dist/Symbol.js.map +1 -1
  454. package/dist/SynchronizedRef.d.ts +278 -62
  455. package/dist/SynchronizedRef.d.ts.map +1 -1
  456. package/dist/SynchronizedRef.js +116 -23
  457. package/dist/SynchronizedRef.js.map +1 -1
  458. package/dist/Take.d.ts +26 -2
  459. package/dist/Take.d.ts.map +1 -1
  460. package/dist/Take.js +4 -1
  461. package/dist/Take.js.map +1 -1
  462. package/dist/Terminal.d.ts +39 -7
  463. package/dist/Terminal.d.ts.map +1 -1
  464. package/dist/Terminal.js +10 -4
  465. package/dist/Terminal.js.map +1 -1
  466. package/dist/Tracer.d.ts +233 -59
  467. package/dist/Tracer.d.ts.map +1 -1
  468. package/dist/Tracer.js +94 -18
  469. package/dist/Tracer.js.map +1 -1
  470. package/dist/Trie.d.ts +280 -245
  471. package/dist/Trie.d.ts.map +1 -1
  472. package/dist/Trie.js +116 -102
  473. package/dist/Trie.js.map +1 -1
  474. package/dist/Tuple.d.ts +34 -32
  475. package/dist/Tuple.d.ts.map +1 -1
  476. package/dist/Tuple.js +16 -14
  477. package/dist/Tuple.js.map +1 -1
  478. package/dist/TxChunk.d.ts +200 -155
  479. package/dist/TxChunk.d.ts.map +1 -1
  480. package/dist/TxChunk.js +83 -61
  481. package/dist/TxChunk.js.map +1 -1
  482. package/dist/TxDeferred.d.ts +43 -29
  483. package/dist/TxDeferred.d.ts.map +1 -1
  484. package/dist/TxDeferred.js +22 -15
  485. package/dist/TxDeferred.js.map +1 -1
  486. package/dist/TxHashMap.d.ts +362 -223
  487. package/dist/TxHashMap.d.ts.map +1 -1
  488. package/dist/TxHashMap.js +171 -98
  489. package/dist/TxHashMap.js.map +1 -1
  490. package/dist/TxHashSet.d.ts +181 -111
  491. package/dist/TxHashSet.d.ts.map +1 -1
  492. package/dist/TxHashSet.js +87 -49
  493. package/dist/TxHashSet.js.map +1 -1
  494. package/dist/TxPriorityQueue.d.ts +94 -63
  495. package/dist/TxPriorityQueue.d.ts.map +1 -1
  496. package/dist/TxPriorityQueue.js +55 -37
  497. package/dist/TxPriorityQueue.js.map +1 -1
  498. package/dist/TxPubSub.d.ts +77 -49
  499. package/dist/TxPubSub.d.ts.map +1 -1
  500. package/dist/TxPubSub.js +60 -37
  501. package/dist/TxPubSub.js.map +1 -1
  502. package/dist/TxQueue.d.ts +277 -242
  503. package/dist/TxQueue.d.ts.map +1 -1
  504. package/dist/TxQueue.js +147 -101
  505. package/dist/TxQueue.js.map +1 -1
  506. package/dist/TxReentrantLock.d.ts +69 -46
  507. package/dist/TxReentrantLock.d.ts.map +1 -1
  508. package/dist/TxReentrantLock.js +48 -32
  509. package/dist/TxReentrantLock.js.map +1 -1
  510. package/dist/TxRef.d.ts +69 -40
  511. package/dist/TxRef.d.ts.map +1 -1
  512. package/dist/TxRef.js +34 -19
  513. package/dist/TxRef.js.map +1 -1
  514. package/dist/TxSemaphore.d.ts +101 -115
  515. package/dist/TxSemaphore.d.ts.map +1 -1
  516. package/dist/TxSemaphore.js +76 -77
  517. package/dist/TxSemaphore.js.map +1 -1
  518. package/dist/TxSubscriptionRef.d.ts +74 -50
  519. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  520. package/dist/TxSubscriptionRef.js +34 -23
  521. package/dist/TxSubscriptionRef.js.map +1 -1
  522. package/dist/Types.d.ts +31 -34
  523. package/dist/Types.d.ts.map +1 -1
  524. package/dist/UndefinedOr.d.ts +62 -25
  525. package/dist/UndefinedOr.d.ts.map +1 -1
  526. package/dist/UndefinedOr.js +36 -25
  527. package/dist/UndefinedOr.js.map +1 -1
  528. package/dist/Unify.d.ts +72 -117
  529. package/dist/Unify.d.ts.map +1 -1
  530. package/dist/Unify.js +20 -6
  531. package/dist/Unify.js.map +1 -1
  532. package/dist/Utils.d.ts +5 -2
  533. package/dist/Utils.d.ts.map +1 -1
  534. package/dist/Utils.js +4 -0
  535. package/dist/Utils.js.map +1 -1
  536. package/dist/index.d.ts +1973 -418
  537. package/dist/index.d.ts.map +1 -1
  538. package/dist/index.js +1973 -418
  539. package/dist/index.js.map +1 -1
  540. package/dist/internal/schema/schema.js +1 -1
  541. package/dist/internal/schema/schema.js.map +1 -1
  542. package/dist/testing/FastCheck.d.ts +9 -6
  543. package/dist/testing/FastCheck.d.ts.map +1 -1
  544. package/dist/testing/FastCheck.js +9 -6
  545. package/dist/testing/FastCheck.js.map +1 -1
  546. package/dist/testing/TestClock.d.ts +39 -35
  547. package/dist/testing/TestClock.d.ts.map +1 -1
  548. package/dist/testing/TestClock.js +42 -12
  549. package/dist/testing/TestClock.js.map +1 -1
  550. package/dist/testing/TestConsole.d.ts +44 -36
  551. package/dist/testing/TestConsole.d.ts.map +1 -1
  552. package/dist/testing/TestConsole.js +30 -15
  553. package/dist/testing/TestConsole.js.map +1 -1
  554. package/dist/testing/TestSchema.d.ts +2 -0
  555. package/dist/testing/TestSchema.d.ts.map +1 -1
  556. package/dist/testing/TestSchema.js +9 -7
  557. package/dist/testing/TestSchema.js.map +1 -1
  558. package/dist/testing/index.d.ts +34 -0
  559. package/dist/testing/index.d.ts.map +1 -1
  560. package/dist/testing/index.js +34 -0
  561. package/dist/testing/index.js.map +1 -1
  562. package/dist/unstable/ai/AiError.d.ts +205 -147
  563. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  564. package/dist/unstable/ai/AiError.js +164 -109
  565. package/dist/unstable/ai/AiError.js.map +1 -1
  566. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  567. package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
  568. package/dist/unstable/ai/Chat.d.ts +64 -41
  569. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  570. package/dist/unstable/ai/Chat.js +51 -33
  571. package/dist/unstable/ai/Chat.js.map +1 -1
  572. package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
  573. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  574. package/dist/unstable/ai/EmbeddingModel.js +9 -8
  575. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  576. package/dist/unstable/ai/IdGenerator.d.ts +28 -18
  577. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  578. package/dist/unstable/ai/IdGenerator.js +18 -11
  579. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  580. package/dist/unstable/ai/LanguageModel.d.ts +31 -25
  581. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  582. package/dist/unstable/ai/LanguageModel.js +20 -14
  583. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  584. package/dist/unstable/ai/McpSchema.d.ts +342 -119
  585. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  586. package/dist/unstable/ai/McpSchema.js +266 -98
  587. package/dist/unstable/ai/McpSchema.js.map +1 -1
  588. package/dist/unstable/ai/McpServer.d.ts +56 -20
  589. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  590. package/dist/unstable/ai/McpServer.js +64 -16
  591. package/dist/unstable/ai/McpServer.js.map +1 -1
  592. package/dist/unstable/ai/Model.d.ts +10 -12
  593. package/dist/unstable/ai/Model.d.ts.map +1 -1
  594. package/dist/unstable/ai/Model.js +9 -7
  595. package/dist/unstable/ai/Model.js.map +1 -1
  596. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  597. package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
  598. package/dist/unstable/ai/Prompt.d.ts +200 -176
  599. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  600. package/dist/unstable/ai/Prompt.js +77 -68
  601. package/dist/unstable/ai/Prompt.js.map +1 -1
  602. package/dist/unstable/ai/Response.d.ts +173 -160
  603. package/dist/unstable/ai/Response.d.ts.map +1 -1
  604. package/dist/unstable/ai/Response.js +43 -48
  605. package/dist/unstable/ai/Response.js.map +1 -1
  606. package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
  607. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  608. package/dist/unstable/ai/ResponseIdTracker.js +27 -2
  609. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  610. package/dist/unstable/ai/Telemetry.d.ts +43 -33
  611. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  612. package/dist/unstable/ai/Telemetry.js +15 -11
  613. package/dist/unstable/ai/Telemetry.js.map +1 -1
  614. package/dist/unstable/ai/Tokenizer.d.ts +14 -9
  615. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  616. package/dist/unstable/ai/Tokenizer.js +10 -6
  617. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  618. package/dist/unstable/ai/Tool.d.ts +167 -96
  619. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  620. package/dist/unstable/ai/Tool.js +107 -53
  621. package/dist/unstable/ai/Tool.js.map +1 -1
  622. package/dist/unstable/ai/Toolkit.d.ts +32 -39
  623. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  624. package/dist/unstable/ai/Toolkit.js +7 -5
  625. package/dist/unstable/ai/Toolkit.js.map +1 -1
  626. package/dist/unstable/ai/index.d.ts +121 -29
  627. package/dist/unstable/ai/index.d.ts.map +1 -1
  628. package/dist/unstable/ai/index.js +121 -29
  629. package/dist/unstable/ai/index.js.map +1 -1
  630. package/dist/unstable/cli/Argument.d.ts +226 -134
  631. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  632. package/dist/unstable/cli/Argument.js +101 -65
  633. package/dist/unstable/cli/Argument.js.map +1 -1
  634. package/dist/unstable/cli/CliError.d.ts +72 -26
  635. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  636. package/dist/unstable/cli/CliError.js +86 -23
  637. package/dist/unstable/cli/CliError.js.map +1 -1
  638. package/dist/unstable/cli/CliOutput.d.ts +48 -19
  639. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  640. package/dist/unstable/cli/CliOutput.js +32 -9
  641. package/dist/unstable/cli/CliOutput.js.map +1 -1
  642. package/dist/unstable/cli/Command.d.ts +196 -115
  643. package/dist/unstable/cli/Command.d.ts.map +1 -1
  644. package/dist/unstable/cli/Command.js +45 -31
  645. package/dist/unstable/cli/Command.js.map +1 -1
  646. package/dist/unstable/cli/Completions.d.ts +7 -7
  647. package/dist/unstable/cli/Completions.js +1 -1
  648. package/dist/unstable/cli/Flag.d.ts +235 -142
  649. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  650. package/dist/unstable/cli/Flag.js +111 -71
  651. package/dist/unstable/cli/Flag.js.map +1 -1
  652. package/dist/unstable/cli/GlobalFlag.d.ts +41 -13
  653. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  654. package/dist/unstable/cli/GlobalFlag.js +30 -7
  655. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  656. package/dist/unstable/cli/HelpDoc.d.ts +39 -14
  657. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  658. package/dist/unstable/cli/HelpDoc.js +21 -0
  659. package/dist/unstable/cli/Param.d.ts +110 -32
  660. package/dist/unstable/cli/Param.d.ts.map +1 -1
  661. package/dist/unstable/cli/Param.js +196 -135
  662. package/dist/unstable/cli/Param.js.map +1 -1
  663. package/dist/unstable/cli/Primitive.d.ts +79 -42
  664. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  665. package/dist/unstable/cli/Primitive.js +66 -35
  666. package/dist/unstable/cli/Primitive.js.map +1 -1
  667. package/dist/unstable/cli/Prompt.d.ts +183 -59
  668. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  669. package/dist/unstable/cli/Prompt.js +105 -23
  670. package/dist/unstable/cli/Prompt.js.map +1 -1
  671. package/dist/unstable/cli/index.d.ts +182 -0
  672. package/dist/unstable/cli/index.d.ts.map +1 -1
  673. package/dist/unstable/cli/index.js +205 -6
  674. package/dist/unstable/cli/index.js.map +1 -1
  675. package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
  676. package/dist/unstable/cli/internal/ansi.js +13 -0
  677. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  678. package/dist/unstable/cli/internal/command.d.ts +5 -1
  679. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  680. package/dist/unstable/cli/internal/command.js +5 -1
  681. package/dist/unstable/cli/internal/command.js.map +1 -1
  682. package/dist/unstable/cli/internal/config.d.ts +3 -0
  683. package/dist/unstable/cli/internal/config.d.ts.map +1 -1
  684. package/dist/unstable/cli/internal/config.js.map +1 -1
  685. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  686. package/dist/unstable/cli/internal/parser.js +0 -1
  687. package/dist/unstable/cli/internal/parser.js.map +1 -1
  688. package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
  689. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  690. package/dist/unstable/cluster/ClusterCron.js +35 -1
  691. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  692. package/dist/unstable/cluster/ClusterError.d.ts +56 -7
  693. package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
  694. package/dist/unstable/cluster/ClusterError.js +56 -7
  695. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  696. package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
  697. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  698. package/dist/unstable/cluster/ClusterMetrics.js +39 -5
  699. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  700. package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
  701. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  702. package/dist/unstable/cluster/ClusterSchema.js +61 -8
  703. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  704. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
  705. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  706. package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -2
  707. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  708. package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
  709. package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
  710. package/dist/unstable/cluster/DeliverAt.js +11 -3
  711. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  712. package/dist/unstable/cluster/Entity.d.ts +74 -16
  713. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  714. package/dist/unstable/cluster/Entity.js +75 -10
  715. package/dist/unstable/cluster/Entity.js.map +1 -1
  716. package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
  717. package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
  718. package/dist/unstable/cluster/EntityAddress.js +30 -2
  719. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  720. package/dist/unstable/cluster/EntityId.d.ts +18 -3
  721. package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
  722. package/dist/unstable/cluster/EntityId.js +15 -2
  723. package/dist/unstable/cluster/EntityId.js.map +1 -1
  724. package/dist/unstable/cluster/EntityProxy.d.ts +42 -14
  725. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  726. package/dist/unstable/cluster/EntityProxy.js +30 -14
  727. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  728. package/dist/unstable/cluster/EntityProxyServer.d.ts +18 -2
  729. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  730. package/dist/unstable/cluster/EntityProxyServer.js +40 -8
  731. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  732. package/dist/unstable/cluster/EntityResource.d.ts +43 -6
  733. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  734. package/dist/unstable/cluster/EntityResource.js +11 -4
  735. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  736. package/dist/unstable/cluster/EntityType.d.ts +27 -3
  737. package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
  738. package/dist/unstable/cluster/EntityType.js +24 -2
  739. package/dist/unstable/cluster/EntityType.js.map +1 -1
  740. package/dist/unstable/cluster/Envelope.d.ts +105 -23
  741. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  742. package/dist/unstable/cluster/Envelope.js +88 -14
  743. package/dist/unstable/cluster/Envelope.js.map +1 -1
  744. package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
  745. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  746. package/dist/unstable/cluster/HttpRunner.js +88 -13
  747. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  748. package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
  749. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  750. package/dist/unstable/cluster/K8sHttpClient.js +31 -6
  751. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  752. package/dist/unstable/cluster/MachineId.d.ts +24 -3
  753. package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
  754. package/dist/unstable/cluster/MachineId.js +21 -2
  755. package/dist/unstable/cluster/MachineId.js.map +1 -1
  756. package/dist/unstable/cluster/Message.d.ts +102 -13
  757. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  758. package/dist/unstable/cluster/Message.js +86 -10
  759. package/dist/unstable/cluster/Message.js.map +1 -1
  760. package/dist/unstable/cluster/MessageStorage.d.ts +126 -21
  761. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  762. package/dist/unstable/cluster/MessageStorage.js +70 -10
  763. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  764. package/dist/unstable/cluster/Reply.d.ts +101 -12
  765. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  766. package/dist/unstable/cluster/Reply.js +64 -8
  767. package/dist/unstable/cluster/Reply.js.map +1 -1
  768. package/dist/unstable/cluster/Runner.d.ts +47 -17
  769. package/dist/unstable/cluster/Runner.d.ts.map +1 -1
  770. package/dist/unstable/cluster/Runner.js +47 -17
  771. package/dist/unstable/cluster/Runner.js.map +1 -1
  772. package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
  773. package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
  774. package/dist/unstable/cluster/RunnerAddress.js +34 -2
  775. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  776. package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
  777. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  778. package/dist/unstable/cluster/RunnerHealth.js +40 -12
  779. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  780. package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
  781. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  782. package/dist/unstable/cluster/RunnerServer.js +31 -4
  783. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  784. package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
  785. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  786. package/dist/unstable/cluster/RunnerStorage.js +38 -4
  787. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  788. package/dist/unstable/cluster/Runners.d.ts +76 -13
  789. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  790. package/dist/unstable/cluster/Runners.js +73 -12
  791. package/dist/unstable/cluster/Runners.js.map +1 -1
  792. package/dist/unstable/cluster/ShardId.d.ts +53 -5
  793. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  794. package/dist/unstable/cluster/ShardId.js +49 -4
  795. package/dist/unstable/cluster/ShardId.js.map +1 -1
  796. package/dist/unstable/cluster/Sharding.d.ts +10 -2
  797. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  798. package/dist/unstable/cluster/Sharding.js +35 -4
  799. package/dist/unstable/cluster/Sharding.js.map +1 -1
  800. package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
  801. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  802. package/dist/unstable/cluster/ShardingConfig.js +66 -9
  803. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  804. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
  805. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
  806. package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
  807. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  808. package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
  809. package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
  810. package/dist/unstable/cluster/SingleRunner.js +23 -1
  811. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  812. package/dist/unstable/cluster/Singleton.d.ts +15 -1
  813. package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
  814. package/dist/unstable/cluster/Singleton.js +15 -1
  815. package/dist/unstable/cluster/Singleton.js.map +1 -1
  816. package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
  817. package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
  818. package/dist/unstable/cluster/SingletonAddress.js +21 -1
  819. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  820. package/dist/unstable/cluster/Snowflake.d.ts +90 -19
  821. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  822. package/dist/unstable/cluster/Snowflake.js +49 -13
  823. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  824. package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
  825. package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
  826. package/dist/unstable/cluster/SocketRunner.js +29 -2
  827. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  828. package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
  829. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  830. package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
  831. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  832. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
  833. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  834. package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
  835. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  836. package/dist/unstable/cluster/TestRunner.d.ts +18 -1
  837. package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
  838. package/dist/unstable/cluster/TestRunner.js +18 -1
  839. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  840. package/dist/unstable/cluster/index.d.ts +790 -0
  841. package/dist/unstable/cluster/index.d.ts.map +1 -1
  842. package/dist/unstable/cluster/index.js +790 -0
  843. package/dist/unstable/cluster/index.js.map +1 -1
  844. package/dist/unstable/cluster/internal/hash.js +12 -0
  845. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  846. package/dist/unstable/devtools/DevTools.d.ts +26 -3
  847. package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
  848. package/dist/unstable/devtools/DevTools.js +26 -3
  849. package/dist/unstable/devtools/DevTools.js.map +1 -1
  850. package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
  851. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  852. package/dist/unstable/devtools/DevToolsClient.js +32 -5
  853. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  854. package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
  855. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  856. package/dist/unstable/devtools/DevToolsSchema.js +102 -20
  857. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  858. package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
  859. package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
  860. package/dist/unstable/devtools/DevToolsServer.js +21 -1
  861. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  862. package/dist/unstable/devtools/index.d.ts +58 -0
  863. package/dist/unstable/devtools/index.d.ts.map +1 -1
  864. package/dist/unstable/devtools/index.js +58 -0
  865. package/dist/unstable/devtools/index.js.map +1 -1
  866. package/dist/unstable/encoding/Msgpack.d.ts +81 -12
  867. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  868. package/dist/unstable/encoding/Msgpack.js +75 -9
  869. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  870. package/dist/unstable/encoding/Ndjson.d.ts +149 -21
  871. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  872. package/dist/unstable/encoding/Ndjson.js +97 -13
  873. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  874. package/dist/unstable/encoding/Sse.d.ts +109 -18
  875. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  876. package/dist/unstable/encoding/Sse.js +69 -13
  877. package/dist/unstable/encoding/Sse.js.map +1 -1
  878. package/dist/unstable/encoding/index.d.ts +49 -0
  879. package/dist/unstable/encoding/index.d.ts.map +1 -1
  880. package/dist/unstable/encoding/index.js +49 -0
  881. package/dist/unstable/encoding/index.js.map +1 -1
  882. package/dist/unstable/eventlog/Event.d.ts +115 -30
  883. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  884. package/dist/unstable/eventlog/Event.js +22 -2
  885. package/dist/unstable/eventlog/Event.js.map +1 -1
  886. package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
  887. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  888. package/dist/unstable/eventlog/EventGroup.js +24 -6
  889. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  890. package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
  891. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  892. package/dist/unstable/eventlog/EventJournal.js +108 -16
  893. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  894. package/dist/unstable/eventlog/EventLog.d.ts +150 -31
  895. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  896. package/dist/unstable/eventlog/EventLog.js +111 -20
  897. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  898. package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
  899. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  900. package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
  901. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  902. package/dist/unstable/eventlog/EventLogMessage.d.ts +92 -18
  903. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
  904. package/dist/unstable/eventlog/EventLogMessage.js +72 -16
  905. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  906. package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
  907. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  908. package/dist/unstable/eventlog/EventLogRemote.js +54 -8
  909. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  910. package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
  911. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  912. package/dist/unstable/eventlog/EventLogServer.js +17 -3
  913. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  914. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
  915. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  916. package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
  917. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  918. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
  919. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  920. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
  921. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  922. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
  923. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
  924. package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
  925. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  926. package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
  927. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  928. package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
  929. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  930. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
  931. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
  932. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
  933. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  934. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
  935. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
  936. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
  937. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  938. package/dist/unstable/eventlog/index.d.ts +240 -0
  939. package/dist/unstable/eventlog/index.d.ts.map +1 -1
  940. package/dist/unstable/eventlog/index.js +240 -0
  941. package/dist/unstable/eventlog/index.js.map +1 -1
  942. package/dist/unstable/http/Cookies.d.ts +156 -77
  943. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  944. package/dist/unstable/http/Cookies.js +93 -39
  945. package/dist/unstable/http/Cookies.js.map +1 -1
  946. package/dist/unstable/http/Etag.d.ts +40 -7
  947. package/dist/unstable/http/Etag.d.ts.map +1 -1
  948. package/dist/unstable/http/Etag.js +27 -4
  949. package/dist/unstable/http/Etag.js.map +1 -1
  950. package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
  951. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  952. package/dist/unstable/http/FetchHttpClient.js +33 -4
  953. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  954. package/dist/unstable/http/FindMyWay.d.ts +1 -1
  955. package/dist/unstable/http/FindMyWay.js +1 -1
  956. package/dist/unstable/http/Headers.d.ts +182 -36
  957. package/dist/unstable/http/Headers.d.ts.map +1 -1
  958. package/dist/unstable/http/Headers.js +86 -16
  959. package/dist/unstable/http/Headers.js.map +1 -1
  960. package/dist/unstable/http/HttpBody.d.ts +114 -26
  961. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  962. package/dist/unstable/http/HttpBody.js +98 -20
  963. package/dist/unstable/http/HttpBody.js.map +1 -1
  964. package/dist/unstable/http/HttpClient.d.ts +204 -96
  965. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  966. package/dist/unstable/http/HttpClient.js +85 -38
  967. package/dist/unstable/http/HttpClient.js.map +1 -1
  968. package/dist/unstable/http/HttpClientError.d.ts +68 -12
  969. package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
  970. package/dist/unstable/http/HttpClientError.js +71 -9
  971. package/dist/unstable/http/HttpClientError.js.map +1 -1
  972. package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
  973. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  974. package/dist/unstable/http/HttpClientRequest.js +151 -45
  975. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  976. package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
  977. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  978. package/dist/unstable/http/HttpClientResponse.js +44 -11
  979. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  980. package/dist/unstable/http/HttpEffect.d.ts +42 -16
  981. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  982. package/dist/unstable/http/HttpEffect.js +33 -13
  983. package/dist/unstable/http/HttpEffect.js.map +1 -1
  984. package/dist/unstable/http/HttpIncomingMessage.d.ts +48 -7
  985. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  986. package/dist/unstable/http/HttpIncomingMessage.js +45 -6
  987. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  988. package/dist/unstable/http/HttpMethod.d.ts +38 -6
  989. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  990. package/dist/unstable/http/HttpMethod.js +27 -2
  991. package/dist/unstable/http/HttpMethod.js.map +1 -1
  992. package/dist/unstable/http/HttpMiddleware.d.ts +38 -11
  993. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  994. package/dist/unstable/http/HttpMiddleware.js +52 -10
  995. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  996. package/dist/unstable/http/HttpPlatform.d.ts +34 -3
  997. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  998. package/dist/unstable/http/HttpPlatform.js +34 -3
  999. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  1000. package/dist/unstable/http/HttpRouter.d.ts +209 -62
  1001. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  1002. package/dist/unstable/http/HttpRouter.js +136 -41
  1003. package/dist/unstable/http/HttpRouter.js.map +1 -1
  1004. package/dist/unstable/http/HttpServer.d.ts +151 -22
  1005. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  1006. package/dist/unstable/http/HttpServer.js +76 -11
  1007. package/dist/unstable/http/HttpServer.js.map +1 -1
  1008. package/dist/unstable/http/HttpServerError.d.ts +93 -10
  1009. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  1010. package/dist/unstable/http/HttpServerError.js +85 -8
  1011. package/dist/unstable/http/HttpServerError.js.map +1 -1
  1012. package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
  1013. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  1014. package/dist/unstable/http/HttpServerRequest.js +101 -20
  1015. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  1016. package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
  1017. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  1018. package/dist/unstable/http/HttpServerRespondable.js +43 -5
  1019. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  1020. package/dist/unstable/http/HttpServerResponse.d.ts +391 -67
  1021. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  1022. package/dist/unstable/http/HttpServerResponse.js +205 -33
  1023. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  1024. package/dist/unstable/http/HttpStaticServer.d.ts +24 -8
  1025. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  1026. package/dist/unstable/http/HttpStaticServer.js +24 -8
  1027. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  1028. package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
  1029. package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
  1030. package/dist/unstable/http/HttpTraceContext.js +47 -5
  1031. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  1032. package/dist/unstable/http/Multipart.d.ts +179 -28
  1033. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  1034. package/dist/unstable/http/Multipart.js +131 -19
  1035. package/dist/unstable/http/Multipart.js.map +1 -1
  1036. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
  1037. package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
  1038. package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
  1039. package/dist/unstable/http/Multipasta/Node.js +1 -1
  1040. package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
  1041. package/dist/unstable/http/Multipasta/Search.js +1 -1
  1042. package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
  1043. package/dist/unstable/http/Multipasta/Web.js +1 -1
  1044. package/dist/unstable/http/Multipasta.d.ts +1 -1
  1045. package/dist/unstable/http/Multipasta.js +1 -1
  1046. package/dist/unstable/http/Template.d.ts +53 -1
  1047. package/dist/unstable/http/Template.d.ts.map +1 -1
  1048. package/dist/unstable/http/Template.js +26 -0
  1049. package/dist/unstable/http/Template.js.map +1 -1
  1050. package/dist/unstable/http/Url.d.ts +70 -56
  1051. package/dist/unstable/http/Url.d.ts.map +1 -1
  1052. package/dist/unstable/http/Url.js +35 -21
  1053. package/dist/unstable/http/Url.js.map +1 -1
  1054. package/dist/unstable/http/UrlParams.d.ts +237 -51
  1055. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  1056. package/dist/unstable/http/UrlParams.js +120 -25
  1057. package/dist/unstable/http/UrlParams.js.map +1 -1
  1058. package/dist/unstable/http/index.d.ts +452 -0
  1059. package/dist/unstable/http/index.d.ts.map +1 -1
  1060. package/dist/unstable/http/index.js +452 -0
  1061. package/dist/unstable/http/index.js.map +1 -1
  1062. package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
  1063. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  1064. package/dist/unstable/httpapi/HttpApi.js +14 -8
  1065. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  1066. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +54 -16
  1067. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  1068. package/dist/unstable/httpapi/HttpApiBuilder.js +44 -6
  1069. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  1070. package/dist/unstable/httpapi/HttpApiClient.d.ts +57 -15
  1071. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  1072. package/dist/unstable/httpapi/HttpApiClient.js +42 -6
  1073. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  1074. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
  1075. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  1076. package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
  1077. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1078. package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
  1079. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  1080. package/dist/unstable/httpapi/HttpApiError.js +98 -1
  1081. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1082. package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
  1083. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  1084. package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
  1085. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1086. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
  1087. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1088. package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -5
  1089. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1090. package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
  1091. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1092. package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
  1093. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1094. package/dist/unstable/httpapi/HttpApiSchema.d.ts +86 -38
  1095. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  1096. package/dist/unstable/httpapi/HttpApiSchema.js +59 -35
  1097. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1098. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +73 -17
  1099. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  1100. package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
  1101. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1102. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +4 -3
  1103. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  1104. package/dist/unstable/httpapi/HttpApiSwagger.js +23 -3
  1105. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1106. package/dist/unstable/httpapi/HttpApiTest.d.ts +6 -1
  1107. package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
  1108. package/dist/unstable/httpapi/HttpApiTest.js +26 -1
  1109. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1110. package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
  1111. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1112. package/dist/unstable/httpapi/OpenApi.js +73 -15
  1113. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1114. package/dist/unstable/httpapi/index.d.ts +310 -25
  1115. package/dist/unstable/httpapi/index.d.ts.map +1 -1
  1116. package/dist/unstable/httpapi/index.js +310 -25
  1117. package/dist/unstable/httpapi/index.js.map +1 -1
  1118. package/dist/unstable/observability/Otlp.d.ts +33 -3
  1119. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  1120. package/dist/unstable/observability/Otlp.js +14 -3
  1121. package/dist/unstable/observability/Otlp.js.map +1 -1
  1122. package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
  1123. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1124. package/dist/unstable/observability/OtlpExporter.js +32 -1
  1125. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1126. package/dist/unstable/observability/OtlpLogger.d.ts +15 -2
  1127. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1128. package/dist/unstable/observability/OtlpLogger.js +29 -2
  1129. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1130. package/dist/unstable/observability/OtlpMetrics.d.ts +17 -5
  1131. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1132. package/dist/unstable/observability/OtlpMetrics.js +32 -2
  1133. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1134. package/dist/unstable/observability/OtlpResource.d.ts +49 -12
  1135. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1136. package/dist/unstable/observability/OtlpResource.js +47 -5
  1137. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1138. package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
  1139. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  1140. package/dist/unstable/observability/OtlpSerialization.js +28 -3
  1141. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1142. package/dist/unstable/observability/OtlpTracer.d.ts +19 -2
  1143. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  1144. package/dist/unstable/observability/OtlpTracer.js +32 -2
  1145. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1146. package/dist/unstable/observability/PrometheusMetrics.d.ts +36 -16
  1147. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1148. package/dist/unstable/observability/PrometheusMetrics.js +9 -7
  1149. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1150. package/dist/unstable/observability/index.d.ts +160 -3
  1151. package/dist/unstable/observability/index.d.ts.map +1 -1
  1152. package/dist/unstable/observability/index.js +160 -3
  1153. package/dist/unstable/observability/index.js.map +1 -1
  1154. package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
  1155. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1156. package/dist/unstable/persistence/KeyValueStore.js +81 -21
  1157. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1158. package/dist/unstable/persistence/Persistable.d.ts +76 -15
  1159. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  1160. package/dist/unstable/persistence/Persistable.js +22 -5
  1161. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1162. package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
  1163. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  1164. package/dist/unstable/persistence/PersistedCache.js +24 -1
  1165. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1166. package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
  1167. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  1168. package/dist/unstable/persistence/PersistedQueue.js +60 -13
  1169. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1170. package/dist/unstable/persistence/Persistence.d.ts +98 -16
  1171. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1172. package/dist/unstable/persistence/Persistence.js +91 -14
  1173. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1174. package/dist/unstable/persistence/RateLimiter.d.ts +101 -21
  1175. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1176. package/dist/unstable/persistence/RateLimiter.js +85 -16
  1177. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1178. package/dist/unstable/persistence/Redis.d.ts +26 -5
  1179. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  1180. package/dist/unstable/persistence/Redis.js +36 -4
  1181. package/dist/unstable/persistence/Redis.js.map +1 -1
  1182. package/dist/unstable/persistence/index.d.ts +147 -0
  1183. package/dist/unstable/persistence/index.d.ts.map +1 -1
  1184. package/dist/unstable/persistence/index.js +147 -0
  1185. package/dist/unstable/persistence/index.js.map +1 -1
  1186. package/dist/unstable/process/ChildProcess.d.ts +87 -64
  1187. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1188. package/dist/unstable/process/ChildProcess.js +25 -18
  1189. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1190. package/dist/unstable/process/ChildProcessSpawner.d.ts +23 -12
  1191. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1192. package/dist/unstable/process/ChildProcessSpawner.js +11 -6
  1193. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1194. package/dist/unstable/process/index.d.ts +2 -1
  1195. package/dist/unstable/process/index.d.ts.map +1 -1
  1196. package/dist/unstable/process/index.js +2 -1
  1197. package/dist/unstable/process/index.js.map +1 -1
  1198. package/dist/unstable/reactivity/AsyncResult.d.ts +198 -59
  1199. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1200. package/dist/unstable/reactivity/AsyncResult.js +121 -36
  1201. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1202. package/dist/unstable/reactivity/Atom.d.ts +544 -130
  1203. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1204. package/dist/unstable/reactivity/Atom.js +252 -58
  1205. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1206. package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
  1207. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1208. package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
  1209. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1210. package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
  1211. package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
  1212. package/dist/unstable/reactivity/AtomRef.js +29 -3
  1213. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1214. package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
  1215. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  1216. package/dist/unstable/reactivity/AtomRegistry.js +69 -10
  1217. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1218. package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
  1219. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1220. package/dist/unstable/reactivity/AtomRpc.js +29 -1
  1221. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1222. package/dist/unstable/reactivity/Hydration.d.ts +28 -5
  1223. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
  1224. package/dist/unstable/reactivity/Hydration.js +35 -3
  1225. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1226. package/dist/unstable/reactivity/Reactivity.d.ts +94 -13
  1227. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  1228. package/dist/unstable/reactivity/Reactivity.js +60 -7
  1229. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1230. package/dist/unstable/reactivity/index.d.ts +167 -0
  1231. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  1232. package/dist/unstable/reactivity/index.js +167 -0
  1233. package/dist/unstable/reactivity/index.js.map +1 -1
  1234. package/dist/unstable/rpc/Rpc.d.ts +254 -56
  1235. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1236. package/dist/unstable/rpc/Rpc.js +44 -11
  1237. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1238. package/dist/unstable/rpc/RpcClient.d.ts +80 -19
  1239. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1240. package/dist/unstable/rpc/RpcClient.js +52 -12
  1241. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1242. package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
  1243. package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
  1244. package/dist/unstable/rpc/RpcClientError.js +26 -2
  1245. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1246. package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
  1247. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  1248. package/dist/unstable/rpc/RpcGroup.js +3 -1
  1249. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1250. package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
  1251. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1252. package/dist/unstable/rpc/RpcMessage.js +23 -7
  1253. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1254. package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
  1255. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  1256. package/dist/unstable/rpc/RpcMiddleware.js +39 -3
  1257. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1258. package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
  1259. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  1260. package/dist/unstable/rpc/RpcSchema.js +34 -3
  1261. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1262. package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
  1263. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1264. package/dist/unstable/rpc/RpcSerialization.js +56 -12
  1265. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1266. package/dist/unstable/rpc/RpcServer.d.ts +73 -23
  1267. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  1268. package/dist/unstable/rpc/RpcServer.js +69 -22
  1269. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1270. package/dist/unstable/rpc/RpcTest.d.ts +20 -1
  1271. package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
  1272. package/dist/unstable/rpc/RpcTest.js +20 -1
  1273. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1274. package/dist/unstable/rpc/RpcWorker.d.ts +39 -6
  1275. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  1276. package/dist/unstable/rpc/RpcWorker.js +16 -4
  1277. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1278. package/dist/unstable/rpc/Utils.d.ts +10 -0
  1279. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  1280. package/dist/unstable/rpc/Utils.js +10 -0
  1281. package/dist/unstable/rpc/Utils.js.map +1 -1
  1282. package/dist/unstable/rpc/index.d.ts +272 -0
  1283. package/dist/unstable/rpc/index.d.ts.map +1 -1
  1284. package/dist/unstable/rpc/index.js +272 -0
  1285. package/dist/unstable/rpc/index.js.map +1 -1
  1286. package/dist/unstable/schema/Model.d.ts +192 -59
  1287. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1288. package/dist/unstable/schema/Model.js +122 -38
  1289. package/dist/unstable/schema/Model.js.map +1 -1
  1290. package/dist/unstable/schema/VariantSchema.d.ts +101 -24
  1291. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1292. package/dist/unstable/schema/VariantSchema.js +22 -6
  1293. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1294. package/dist/unstable/schema/index.d.ts +37 -0
  1295. package/dist/unstable/schema/index.d.ts.map +1 -1
  1296. package/dist/unstable/schema/index.js +37 -0
  1297. package/dist/unstable/schema/index.js.map +1 -1
  1298. package/dist/unstable/socket/Socket.d.ts +168 -34
  1299. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1300. package/dist/unstable/socket/Socket.js +124 -28
  1301. package/dist/unstable/socket/Socket.js.map +1 -1
  1302. package/dist/unstable/socket/SocketServer.d.ts +58 -10
  1303. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  1304. package/dist/unstable/socket/SocketServer.js +43 -5
  1305. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1306. package/dist/unstable/socket/index.d.ts +44 -0
  1307. package/dist/unstable/socket/index.d.ts.map +1 -1
  1308. package/dist/unstable/socket/index.js +44 -0
  1309. package/dist/unstable/socket/index.js.map +1 -1
  1310. package/dist/unstable/sql/Migrator.d.ts +40 -9
  1311. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  1312. package/dist/unstable/sql/Migrator.js +45 -5
  1313. package/dist/unstable/sql/Migrator.js.map +1 -1
  1314. package/dist/unstable/sql/SqlClient.d.ts +38 -2
  1315. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1316. package/dist/unstable/sql/SqlClient.js +40 -1
  1317. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1318. package/dist/unstable/sql/SqlConnection.d.ts +34 -3
  1319. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  1320. package/dist/unstable/sql/SqlConnection.js +22 -0
  1321. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1322. package/dist/unstable/sql/SqlError.d.ts +117 -0
  1323. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  1324. package/dist/unstable/sql/SqlError.js +131 -0
  1325. package/dist/unstable/sql/SqlError.js.map +1 -1
  1326. package/dist/unstable/sql/SqlModel.d.ts +25 -5
  1327. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  1328. package/dist/unstable/sql/SqlModel.js +8 -4
  1329. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1330. package/dist/unstable/sql/SqlResolver.d.ts +56 -13
  1331. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  1332. package/dist/unstable/sql/SqlResolver.js +44 -10
  1333. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1334. package/dist/unstable/sql/SqlSchema.d.ts +29 -8
  1335. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  1336. package/dist/unstable/sql/SqlSchema.js +29 -8
  1337. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1338. package/dist/unstable/sql/SqlStream.d.ts +4 -0
  1339. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  1340. package/dist/unstable/sql/SqlStream.js +24 -0
  1341. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1342. package/dist/unstable/sql/Statement.d.ts +151 -24
  1343. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1344. package/dist/unstable/sql/Statement.js +91 -6
  1345. package/dist/unstable/sql/Statement.js.map +1 -1
  1346. package/dist/unstable/sql/index.d.ts +179 -1
  1347. package/dist/unstable/sql/index.d.ts.map +1 -1
  1348. package/dist/unstable/sql/index.js +179 -1
  1349. package/dist/unstable/sql/index.js.map +1 -1
  1350. package/dist/unstable/workers/Transferable.d.ts +72 -20
  1351. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  1352. package/dist/unstable/workers/Transferable.js +57 -14
  1353. package/dist/unstable/workers/Transferable.js.map +1 -1
  1354. package/dist/unstable/workers/Worker.d.ts +61 -8
  1355. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  1356. package/dist/unstable/workers/Worker.js +44 -4
  1357. package/dist/unstable/workers/Worker.js.map +1 -1
  1358. package/dist/unstable/workers/WorkerError.d.ts +31 -9
  1359. package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
  1360. package/dist/unstable/workers/WorkerError.js +44 -7
  1361. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1362. package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
  1363. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  1364. package/dist/unstable/workers/WorkerRunner.js +24 -1
  1365. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1366. package/dist/unstable/workers/index.d.ts +81 -1
  1367. package/dist/unstable/workers/index.d.ts.map +1 -1
  1368. package/dist/unstable/workers/index.js +81 -1
  1369. package/dist/unstable/workers/index.js.map +1 -1
  1370. package/dist/unstable/workflow/Activity.d.ts +61 -10
  1371. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  1372. package/dist/unstable/workflow/Activity.js +20 -5
  1373. package/dist/unstable/workflow/Activity.js.map +1 -1
  1374. package/dist/unstable/workflow/DurableClock.d.ts +12 -3
  1375. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  1376. package/dist/unstable/workflow/DurableClock.js +22 -2
  1377. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1378. package/dist/unstable/workflow/DurableDeferred.d.ts +128 -31
  1379. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  1380. package/dist/unstable/workflow/DurableDeferred.js +77 -13
  1381. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1382. package/dist/unstable/workflow/DurableQueue.d.ts +33 -8
  1383. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  1384. package/dist/unstable/workflow/DurableQueue.js +26 -6
  1385. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  1386. package/dist/unstable/workflow/Workflow.d.ts +102 -31
  1387. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1388. package/dist/unstable/workflow/Workflow.js +75 -19
  1389. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1390. package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
  1391. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  1392. package/dist/unstable/workflow/WorkflowEngine.js +16 -4
  1393. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1394. package/dist/unstable/workflow/WorkflowProxy.d.ts +40 -12
  1395. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1396. package/dist/unstable/workflow/WorkflowProxy.js +8 -12
  1397. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1398. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +37 -2
  1399. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  1400. package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
  1401. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1402. package/dist/unstable/workflow/index.d.ts +160 -0
  1403. package/dist/unstable/workflow/index.d.ts.map +1 -1
  1404. package/dist/unstable/workflow/index.js +160 -0
  1405. package/dist/unstable/workflow/index.js.map +1 -1
  1406. package/package.json +11 -11
  1407. package/src/Array.ts +151 -106
  1408. package/src/BigDecimal.ts +620 -553
  1409. package/src/BigInt.ts +342 -274
  1410. package/src/Boolean.ts +189 -156
  1411. package/src/Brand.ts +30 -5
  1412. package/src/Cache.ts +334 -167
  1413. package/src/Cause.ts +84 -73
  1414. package/src/Channel.ts +1639 -667
  1415. package/src/ChannelSchema.ts +137 -12
  1416. package/src/Chunk.ts +575 -429
  1417. package/src/Clock.ts +16 -9
  1418. package/src/Combiner.ts +11 -5
  1419. package/src/Config.ts +80 -68
  1420. package/src/ConfigProvider.ts +33 -32
  1421. package/src/Console.ts +88 -58
  1422. package/src/Context.ts +401 -190
  1423. package/src/Cron.ts +109 -48
  1424. package/src/Crypto.ts +327 -0
  1425. package/src/Data.ts +9 -3
  1426. package/src/DateTime.ts +893 -464
  1427. package/src/Deferred.ts +367 -175
  1428. package/src/Differ.ts +44 -2
  1429. package/src/Duration.ts +333 -186
  1430. package/src/Effect.ts +2201 -2289
  1431. package/src/Effectable.ts +38 -3
  1432. package/src/Encoding.ts +78 -28
  1433. package/src/Equal.ts +4 -3
  1434. package/src/Equivalence.ts +18 -24
  1435. package/src/ErrorReporter.ts +66 -82
  1436. package/src/ExecutionPlan.ts +106 -12
  1437. package/src/Exit.ts +6 -5
  1438. package/src/Fiber.ts +71 -40
  1439. package/src/FiberHandle.ts +157 -57
  1440. package/src/FiberMap.ts +328 -163
  1441. package/src/FiberSet.ts +130 -52
  1442. package/src/FileSystem.ts +104 -74
  1443. package/src/Filter.ts +166 -88
  1444. package/src/Formatter.ts +4 -70
  1445. package/src/Function.ts +218 -151
  1446. package/src/Graph.ts +714 -415
  1447. package/src/HKT.ts +29 -13
  1448. package/src/Hash.ts +35 -24
  1449. package/src/HashMap.ts +540 -388
  1450. package/src/HashRing.ts +111 -34
  1451. package/src/HashSet.ts +239 -153
  1452. package/src/Inspectable.ts +30 -17
  1453. package/src/Iterable.ts +336 -222
  1454. package/src/JsonPatch.ts +13 -10
  1455. package/src/JsonPointer.ts +13 -11
  1456. package/src/JsonSchema.ts +16 -0
  1457. package/src/Latch.ts +97 -26
  1458. package/src/Layer.ts +547 -445
  1459. package/src/LayerMap.ts +99 -26
  1460. package/src/LogLevel.ts +92 -131
  1461. package/src/Logger.ts +365 -297
  1462. package/src/ManagedRuntime.ts +78 -19
  1463. package/src/Match.ts +135 -161
  1464. package/src/Metric.ts +362 -313
  1465. package/src/MutableHashMap.ts +202 -127
  1466. package/src/MutableHashSet.ts +120 -52
  1467. package/src/MutableList.ts +157 -100
  1468. package/src/MutableRef.ts +129 -90
  1469. package/src/Newtype.ts +15 -2
  1470. package/src/NonEmptyIterable.ts +38 -48
  1471. package/src/Number.ts +261 -205
  1472. package/src/Optic.ts +6 -7
  1473. package/src/Option.ts +133 -156
  1474. package/src/Order.ts +6 -6
  1475. package/src/Ordering.ts +56 -45
  1476. package/src/PartitionedSemaphore.ts +225 -40
  1477. package/src/Path.ts +77 -13
  1478. package/src/Pipeable.ts +82 -24
  1479. package/src/PlatformError.ts +74 -6
  1480. package/src/Pool.ts +94 -31
  1481. package/src/Predicate.ts +17 -24
  1482. package/src/PrimaryKey.ts +11 -3
  1483. package/src/PubSub.ts +385 -309
  1484. package/src/Pull.ts +94 -25
  1485. package/src/Queue.ts +303 -184
  1486. package/src/Random.ts +69 -93
  1487. package/src/RcMap.ts +151 -141
  1488. package/src/RcRef.ts +68 -32
  1489. package/src/Record.ts +282 -137
  1490. package/src/Redactable.ts +7 -5
  1491. package/src/Redacted.ts +63 -34
  1492. package/src/Reducer.ts +3 -1
  1493. package/src/Ref.ts +173 -134
  1494. package/src/References.ts +73 -31
  1495. package/src/RegExp.ts +12 -6
  1496. package/src/Request.ts +159 -34
  1497. package/src/RequestResolver.ts +278 -121
  1498. package/src/Resource.ts +45 -7
  1499. package/src/Result.ts +137 -153
  1500. package/src/Runtime.ts +42 -21
  1501. package/src/Schedule.ts +585 -613
  1502. package/src/Scheduler.ts +44 -7
  1503. package/src/Schema.ts +1309 -615
  1504. package/src/SchemaAST.ts +123 -93
  1505. package/src/SchemaGetter.ts +52 -37
  1506. package/src/SchemaIssue.ts +19 -24
  1507. package/src/SchemaParser.ts +306 -85
  1508. package/src/SchemaRepresentation.ts +89 -77
  1509. package/src/SchemaTransformation.ts +97 -46
  1510. package/src/SchemaUtils.ts +24 -1
  1511. package/src/Scope.ts +107 -65
  1512. package/src/ScopedCache.ts +195 -59
  1513. package/src/ScopedRef.ts +28 -8
  1514. package/src/Semaphore.ts +61 -37
  1515. package/src/Sink.ts +461 -206
  1516. package/src/Stdio.ts +43 -6
  1517. package/src/Stream.ts +2361 -1613
  1518. package/src/String.ts +174 -97
  1519. package/src/Struct.ts +20 -18
  1520. package/src/SubscriptionRef.ts +309 -204
  1521. package/src/Symbol.ts +13 -5
  1522. package/src/SynchronizedRef.ts +278 -62
  1523. package/src/Take.ts +26 -2
  1524. package/src/Terminal.ts +40 -7
  1525. package/src/Tracer.ts +233 -59
  1526. package/src/Trie.ts +280 -245
  1527. package/src/Tuple.ts +34 -32
  1528. package/src/TxChunk.ts +200 -155
  1529. package/src/TxDeferred.ts +43 -29
  1530. package/src/TxHashMap.ts +370 -231
  1531. package/src/TxHashSet.ts +253 -159
  1532. package/src/TxPriorityQueue.ts +97 -65
  1533. package/src/TxPubSub.ts +77 -49
  1534. package/src/TxQueue.ts +277 -242
  1535. package/src/TxReentrantLock.ts +70 -47
  1536. package/src/TxRef.ts +69 -40
  1537. package/src/TxSemaphore.ts +101 -115
  1538. package/src/TxSubscriptionRef.ts +74 -50
  1539. package/src/Types.ts +31 -34
  1540. package/src/UndefinedOr.ts +62 -25
  1541. package/src/Unify.ts +72 -117
  1542. package/src/Utils.ts +5 -2
  1543. package/src/index.ts +1976 -420
  1544. package/src/internal/schema/schema.ts +1 -1
  1545. package/src/testing/FastCheck.ts +9 -6
  1546. package/src/testing/TestClock.ts +63 -35
  1547. package/src/testing/TestConsole.ts +54 -36
  1548. package/src/testing/TestSchema.ts +10 -8
  1549. package/src/testing/index.ts +34 -0
  1550. package/src/unstable/ai/AiError.ts +195 -137
  1551. package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
  1552. package/src/unstable/ai/Chat.ts +68 -43
  1553. package/src/unstable/ai/EmbeddingModel.ts +12 -11
  1554. package/src/unstable/ai/IdGenerator.ts +28 -18
  1555. package/src/unstable/ai/LanguageModel.ts +35 -27
  1556. package/src/unstable/ai/McpSchema.ts +342 -119
  1557. package/src/unstable/ai/McpServer.ts +79 -20
  1558. package/src/unstable/ai/Model.ts +10 -12
  1559. package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
  1560. package/src/unstable/ai/Prompt.ts +216 -192
  1561. package/src/unstable/ai/Response.ts +179 -167
  1562. package/src/unstable/ai/ResponseIdTracker.ts +43 -4
  1563. package/src/unstable/ai/Telemetry.ts +43 -33
  1564. package/src/unstable/ai/Tokenizer.ts +14 -9
  1565. package/src/unstable/ai/Tool.ts +168 -97
  1566. package/src/unstable/ai/Toolkit.ts +51 -46
  1567. package/src/unstable/ai/index.ts +121 -29
  1568. package/src/unstable/cli/Argument.ts +226 -134
  1569. package/src/unstable/cli/CliError.ts +96 -26
  1570. package/src/unstable/cli/CliOutput.ts +48 -19
  1571. package/src/unstable/cli/Command.ts +196 -115
  1572. package/src/unstable/cli/Completions.ts +7 -7
  1573. package/src/unstable/cli/Flag.ts +235 -142
  1574. package/src/unstable/cli/GlobalFlag.ts +41 -13
  1575. package/src/unstable/cli/HelpDoc.ts +39 -14
  1576. package/src/unstable/cli/Param.ts +395 -260
  1577. package/src/unstable/cli/Primitive.ts +79 -42
  1578. package/src/unstable/cli/Prompt.ts +207 -59
  1579. package/src/unstable/cli/index.ts +205 -6
  1580. package/src/unstable/cli/internal/ansi.ts +13 -0
  1581. package/src/unstable/cli/internal/command.ts +5 -1
  1582. package/src/unstable/cli/internal/config.ts +3 -0
  1583. package/src/unstable/cli/internal/lexer.ts +11 -0
  1584. package/src/unstable/cli/internal/parser.ts +0 -1
  1585. package/src/unstable/cluster/ClusterCron.ts +35 -1
  1586. package/src/unstable/cluster/ClusterError.ts +56 -7
  1587. package/src/unstable/cluster/ClusterMetrics.ts +39 -5
  1588. package/src/unstable/cluster/ClusterSchema.ts +61 -8
  1589. package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -2
  1590. package/src/unstable/cluster/DeliverAt.ts +39 -4
  1591. package/src/unstable/cluster/Entity.ts +106 -16
  1592. package/src/unstable/cluster/EntityAddress.ts +30 -2
  1593. package/src/unstable/cluster/EntityId.ts +18 -3
  1594. package/src/unstable/cluster/EntityProxy.ts +42 -14
  1595. package/src/unstable/cluster/EntityProxyServer.ts +45 -8
  1596. package/src/unstable/cluster/EntityResource.ts +43 -6
  1597. package/src/unstable/cluster/EntityType.ts +27 -3
  1598. package/src/unstable/cluster/Envelope.ts +128 -23
  1599. package/src/unstable/cluster/HttpRunner.ts +88 -13
  1600. package/src/unstable/cluster/K8sHttpClient.ts +49 -6
  1601. package/src/unstable/cluster/MachineId.ts +24 -3
  1602. package/src/unstable/cluster/Message.ts +102 -13
  1603. package/src/unstable/cluster/MessageStorage.ts +126 -21
  1604. package/src/unstable/cluster/Reply.ts +101 -12
  1605. package/src/unstable/cluster/Runner.ts +47 -17
  1606. package/src/unstable/cluster/RunnerAddress.ts +34 -2
  1607. package/src/unstable/cluster/RunnerHealth.ts +40 -12
  1608. package/src/unstable/cluster/RunnerServer.ts +31 -4
  1609. package/src/unstable/cluster/RunnerStorage.ts +42 -5
  1610. package/src/unstable/cluster/Runners.ts +76 -13
  1611. package/src/unstable/cluster/ShardId.ts +53 -5
  1612. package/src/unstable/cluster/Sharding.ts +35 -4
  1613. package/src/unstable/cluster/ShardingConfig.ts +75 -10
  1614. package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
  1615. package/src/unstable/cluster/SingleRunner.ts +23 -1
  1616. package/src/unstable/cluster/Singleton.ts +15 -1
  1617. package/src/unstable/cluster/SingletonAddress.ts +21 -1
  1618. package/src/unstable/cluster/Snowflake.ts +90 -19
  1619. package/src/unstable/cluster/SocketRunner.ts +29 -2
  1620. package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
  1621. package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
  1622. package/src/unstable/cluster/TestRunner.ts +18 -1
  1623. package/src/unstable/cluster/index.ts +790 -0
  1624. package/src/unstable/cluster/internal/hash.ts +12 -0
  1625. package/src/unstable/devtools/DevTools.ts +26 -3
  1626. package/src/unstable/devtools/DevToolsClient.ts +32 -5
  1627. package/src/unstable/devtools/DevToolsSchema.ts +201 -44
  1628. package/src/unstable/devtools/DevToolsServer.ts +27 -2
  1629. package/src/unstable/devtools/index.ts +58 -0
  1630. package/src/unstable/encoding/Msgpack.ts +97 -12
  1631. package/src/unstable/encoding/Ndjson.ts +149 -21
  1632. package/src/unstable/encoding/Sse.ts +109 -18
  1633. package/src/unstable/encoding/index.ts +49 -0
  1634. package/src/unstable/eventlog/Event.ts +131 -30
  1635. package/src/unstable/eventlog/EventGroup.ts +50 -17
  1636. package/src/unstable/eventlog/EventJournal.ts +120 -20
  1637. package/src/unstable/eventlog/EventLog.ts +150 -31
  1638. package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
  1639. package/src/unstable/eventlog/EventLogMessage.ts +92 -18
  1640. package/src/unstable/eventlog/EventLogRemote.ts +54 -8
  1641. package/src/unstable/eventlog/EventLogServer.ts +33 -3
  1642. package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
  1643. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
  1644. package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
  1645. package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
  1646. package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
  1647. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
  1648. package/src/unstable/eventlog/index.ts +240 -0
  1649. package/src/unstable/http/Cookies.ts +156 -77
  1650. package/src/unstable/http/Etag.ts +40 -7
  1651. package/src/unstable/http/FetchHttpClient.ts +33 -4
  1652. package/src/unstable/http/FindMyWay.ts +1 -1
  1653. package/src/unstable/http/Headers.ts +252 -50
  1654. package/src/unstable/http/HttpBody.ts +128 -26
  1655. package/src/unstable/http/HttpClient.ts +204 -96
  1656. package/src/unstable/http/HttpClientError.ts +80 -12
  1657. package/src/unstable/http/HttpClientRequest.ts +318 -100
  1658. package/src/unstable/http/HttpClientResponse.ts +59 -16
  1659. package/src/unstable/http/HttpEffect.ts +66 -18
  1660. package/src/unstable/http/HttpIncomingMessage.ts +48 -7
  1661. package/src/unstable/http/HttpMethod.ts +38 -6
  1662. package/src/unstable/http/HttpMiddleware.ts +60 -11
  1663. package/src/unstable/http/HttpPlatform.ts +34 -3
  1664. package/src/unstable/http/HttpRouter.ts +232 -69
  1665. package/src/unstable/http/HttpServer.ts +151 -22
  1666. package/src/unstable/http/HttpServerError.ts +93 -10
  1667. package/src/unstable/http/HttpServerRequest.ts +125 -21
  1668. package/src/unstable/http/HttpServerRespondable.ts +49 -6
  1669. package/src/unstable/http/HttpServerResponse.ts +391 -67
  1670. package/src/unstable/http/HttpStaticServer.ts +24 -8
  1671. package/src/unstable/http/HttpTraceContext.ts +53 -6
  1672. package/src/unstable/http/Multipart.ts +179 -28
  1673. package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
  1674. package/src/unstable/http/Multipasta/Node.ts +1 -1
  1675. package/src/unstable/http/Multipasta/Search.ts +1 -1
  1676. package/src/unstable/http/Multipasta/Web.ts +1 -1
  1677. package/src/unstable/http/Multipasta.ts +1 -1
  1678. package/src/unstable/http/Template.ts +53 -1
  1679. package/src/unstable/http/Url.ts +70 -56
  1680. package/src/unstable/http/UrlParams.ts +237 -51
  1681. package/src/unstable/http/index.ts +452 -0
  1682. package/src/unstable/httpapi/HttpApi.ts +49 -14
  1683. package/src/unstable/httpapi/HttpApiBuilder.ts +81 -16
  1684. package/src/unstable/httpapi/HttpApiClient.ts +78 -15
  1685. package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
  1686. package/src/unstable/httpapi/HttpApiError.ts +100 -1
  1687. package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
  1688. package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -22
  1689. package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
  1690. package/src/unstable/httpapi/HttpApiSchema.ts +86 -38
  1691. package/src/unstable/httpapi/HttpApiSecurity.ts +73 -17
  1692. package/src/unstable/httpapi/HttpApiSwagger.ts +23 -3
  1693. package/src/unstable/httpapi/HttpApiTest.ts +26 -1
  1694. package/src/unstable/httpapi/OpenApi.ts +115 -15
  1695. package/src/unstable/httpapi/index.ts +310 -25
  1696. package/src/unstable/observability/Otlp.ts +33 -3
  1697. package/src/unstable/observability/OtlpExporter.ts +32 -1
  1698. package/src/unstable/observability/OtlpLogger.ts +32 -2
  1699. package/src/unstable/observability/OtlpMetrics.ts +39 -5
  1700. package/src/unstable/observability/OtlpResource.ts +68 -12
  1701. package/src/unstable/observability/OtlpSerialization.ts +28 -3
  1702. package/src/unstable/observability/OtlpTracer.ts +41 -2
  1703. package/src/unstable/observability/PrometheusMetrics.ts +36 -16
  1704. package/src/unstable/observability/index.ts +160 -3
  1705. package/src/unstable/persistence/KeyValueStore.ts +108 -28
  1706. package/src/unstable/persistence/Persistable.ts +76 -15
  1707. package/src/unstable/persistence/PersistedCache.ts +27 -2
  1708. package/src/unstable/persistence/PersistedQueue.ts +98 -16
  1709. package/src/unstable/persistence/Persistence.ts +98 -16
  1710. package/src/unstable/persistence/RateLimiter.ts +101 -21
  1711. package/src/unstable/persistence/Redis.ts +42 -5
  1712. package/src/unstable/persistence/index.ts +147 -0
  1713. package/src/unstable/process/ChildProcess.ts +90 -66
  1714. package/src/unstable/process/ChildProcessSpawner.ts +23 -12
  1715. package/src/unstable/process/index.ts +2 -1
  1716. package/src/unstable/reactivity/AsyncResult.ts +204 -61
  1717. package/src/unstable/reactivity/Atom.ts +598 -139
  1718. package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
  1719. package/src/unstable/reactivity/AtomRef.ts +51 -7
  1720. package/src/unstable/reactivity/AtomRegistry.ts +141 -22
  1721. package/src/unstable/reactivity/AtomRpc.ts +36 -2
  1722. package/src/unstable/reactivity/Hydration.ts +45 -5
  1723. package/src/unstable/reactivity/Reactivity.ts +94 -13
  1724. package/src/unstable/reactivity/index.ts +167 -0
  1725. package/src/unstable/rpc/Rpc.ts +254 -56
  1726. package/src/unstable/rpc/RpcClient.ts +106 -19
  1727. package/src/unstable/rpc/RpcClientError.ts +26 -2
  1728. package/src/unstable/rpc/RpcGroup.ts +51 -8
  1729. package/src/unstable/rpc/RpcMessage.ts +128 -32
  1730. package/src/unstable/rpc/RpcMiddleware.ts +100 -20
  1731. package/src/unstable/rpc/RpcSchema.ts +38 -4
  1732. package/src/unstable/rpc/RpcSerialization.ts +60 -13
  1733. package/src/unstable/rpc/RpcServer.ts +107 -23
  1734. package/src/unstable/rpc/RpcTest.ts +20 -1
  1735. package/src/unstable/rpc/RpcWorker.ts +39 -6
  1736. package/src/unstable/rpc/Utils.ts +33 -0
  1737. package/src/unstable/rpc/index.ts +272 -0
  1738. package/src/unstable/schema/Model.ts +245 -61
  1739. package/src/unstable/schema/VariantSchema.ts +101 -24
  1740. package/src/unstable/schema/index.ts +37 -0
  1741. package/src/unstable/socket/Socket.ts +168 -34
  1742. package/src/unstable/socket/SocketServer.ts +58 -10
  1743. package/src/unstable/socket/index.ts +44 -0
  1744. package/src/unstable/sql/Migrator.ts +61 -9
  1745. package/src/unstable/sql/SqlClient.ts +59 -2
  1746. package/src/unstable/sql/SqlConnection.ts +34 -3
  1747. package/src/unstable/sql/SqlError.ts +135 -0
  1748. package/src/unstable/sql/SqlModel.ts +25 -5
  1749. package/src/unstable/sql/SqlResolver.ts +56 -13
  1750. package/src/unstable/sql/SqlSchema.ts +29 -8
  1751. package/src/unstable/sql/SqlStream.ts +24 -0
  1752. package/src/unstable/sql/Statement.ts +168 -24
  1753. package/src/unstable/sql/index.ts +179 -1
  1754. package/src/unstable/workers/Transferable.ts +72 -20
  1755. package/src/unstable/workers/Worker.ts +61 -8
  1756. package/src/unstable/workers/WorkerError.ts +50 -9
  1757. package/src/unstable/workers/WorkerRunner.ts +32 -3
  1758. package/src/unstable/workers/index.ts +81 -1
  1759. package/src/unstable/workflow/Activity.ts +61 -10
  1760. package/src/unstable/workflow/DurableClock.ts +26 -3
  1761. package/src/unstable/workflow/DurableDeferred.ts +148 -31
  1762. package/src/unstable/workflow/DurableQueue.ts +33 -8
  1763. package/src/unstable/workflow/Workflow.ts +123 -31
  1764. package/src/unstable/workflow/WorkflowEngine.ts +40 -5
  1765. package/src/unstable/workflow/WorkflowProxy.ts +40 -12
  1766. package/src/unstable/workflow/WorkflowProxyServer.ts +41 -6
  1767. package/src/unstable/workflow/index.ts +160 -0
package/src/Schedule.ts CHANGED
@@ -6,7 +6,8 @@
6
6
  * along with a delay duration. Schedules can be combined, transformed, and used to implement
7
7
  * sophisticated retry and repetition logic.
8
8
  *
9
- * @example
9
+ * **Example** (Retrying and repeating effects)
10
+ *
10
11
  * ```ts
11
12
  * import { Effect, Schedule } from "effect"
12
13
  *
@@ -53,9 +54,14 @@ const randomNext: Effect<number> = random.Random.useSync((random) => random.next
53
54
  /**
54
55
  * A Schedule defines a strategy for repeating or retrying effects based on some policy.
55
56
  *
56
- * @example
57
+ * **Example** (Defining retry and repeat schedules)
58
+ *
57
59
  * ```ts
58
- * import { Console, Effect, Schedule } from "effect"
60
+ * import { Console, Data, Effect, Schedule } from "effect"
61
+ *
62
+ * class NetworkError extends Data.TaggedError("NetworkError")<{
63
+ * readonly attempt: number
64
+ * }> {}
59
65
  *
60
66
  * // Basic retry schedule - retry up to 3 times with exponential backoff
61
67
  * const retrySchedule = Schedule.exponential("100 millis").pipe(
@@ -66,25 +72,29 @@ const randomNext: Effect<number> = random.Random.useSync((random) => random.next
66
72
  * const repeatSchedule: Schedule.Schedule<number, unknown, never> = Schedule
67
73
  * .spaced("30 seconds")
68
74
  *
69
- * // Advanced schedule with custom logic
70
- * const smartRetry = Schedule.exponential("1 second")
71
- *
72
75
  * const program = Effect.gen(function*() {
73
- * // Using retry schedule
76
+ * let attempts = 0
77
+ *
74
78
  * const result1 = yield* Effect.retry(
75
- * Effect.suspend(() => Math.random() > 0.5 ? Effect.fail("temporary error") : Effect.succeed("Success")),
79
+ * Effect.gen(function*() {
80
+ * attempts++
81
+ * if (attempts < 3) {
82
+ * return yield* Effect.fail(new NetworkError({ attempt: attempts }))
83
+ * }
84
+ * return "Success"
85
+ * }),
76
86
  * retrySchedule
77
87
  * )
88
+ * console.log(result1) // "Success"
78
89
  *
79
- * // Using repeat schedule
80
90
  * yield* Console.log("heartbeat").pipe(
81
91
  * Effect.repeat(repeatSchedule.pipe(Schedule.take(5)))
82
92
  * )
83
93
  * })
84
94
  * ```
85
95
  *
96
+ * @category models
86
97
  * @since 2.0.0
87
- * @category Models
88
98
  */
89
99
  export interface Schedule<out Output, in Input = unknown, out Error = never, out Env = never>
90
100
  extends Schedule.Variance<Output, Input, Error, Env>, Pipeable
@@ -93,7 +103,8 @@ export interface Schedule<out Output, in Input = unknown, out Error = never, out
93
103
  /**
94
104
  * Metadata provided to schedule functions containing timing and input information.
95
105
  *
96
- * @example
106
+ * **Example** (Reading schedule input metadata)
107
+ *
97
108
  * ```ts
98
109
  * import { Console, Effect, Schedule } from "effect"
99
110
  *
@@ -112,8 +123,8 @@ export interface Schedule<out Output, in Input = unknown, out Error = never, out
112
123
  * })
113
124
  * ```
114
125
  *
115
- * @since 4.0.0
116
126
  * @category Metadata
127
+ * @since 4.0.0
117
128
  */
118
129
  export interface InputMetadata<Input> {
119
130
  readonly input: Input
@@ -127,18 +138,19 @@ export interface InputMetadata<Input> {
127
138
  /**
128
139
  * Extended metadata that includes both input metadata and the output value from the schedule.
129
140
  *
130
- * @example
141
+ * **Example** (Logging schedule output metadata)
142
+ *
131
143
  * ```ts
132
144
  * import { Console, Duration, Effect, Schedule } from "effect"
133
145
  *
134
- * // Custom schedule that logs metadata including output
146
+ * // Custom schedule that logs metadata and output for each recurrence
135
147
  * const loggingSchedule = Schedule.unfold(0, (n) => Effect.succeed(n + 1)).pipe(
136
148
  * Schedule.addDelay(() => Effect.succeed(Duration.millis(100))),
137
- * Schedule.tapOutput((output) => {
138
- * return Console.log(
139
- * `Output: ${output}`
140
- * )
141
- * })
149
+ * Schedule.collectWhile((metadata) =>
150
+ * Console.log(
151
+ * `Output: ${metadata.output}, attempt: ${metadata.attempt}, elapsed: ${metadata.elapsed}ms`
152
+ * ).pipe(Effect.as(metadata.attempt <= 3))
153
+ * )
142
154
  * )
143
155
  *
144
156
  * const program = Effect.gen(function*() {
@@ -149,13 +161,13 @@ export interface InputMetadata<Input> {
149
161
  * })
150
162
  *
151
163
  * // Output logs will show:
152
- * // "Output: 0, Attempt: 1, Elapsed: 0ms, Since previous: 0ms"
153
- * // "Output: 1, Attempt: 2, Elapsed: 100ms, Since previous: 100ms"
154
- * // "Output: 2, Attempt: 3, Elapsed: 200ms, Since previous: 100ms"
164
+ * // Output: 0, attempt: 1, elapsed: 0ms
165
+ * // Output: 1, attempt: 2, elapsed: 100ms
166
+ * // Output: 2, attempt: 3, elapsed: 200ms
155
167
  * ```
156
168
  *
157
- * @since 4.0.0
158
169
  * @category Metadata
170
+ * @since 4.0.0
159
171
  */
160
172
  export interface Metadata<Output = unknown, Input = unknown> extends InputMetadata<Input> {
161
173
  readonly output: Output
@@ -163,8 +175,16 @@ export interface Metadata<Output = unknown, Input = unknown> extends InputMetada
163
175
  }
164
176
 
165
177
  /**
166
- * @since 4.0.0
178
+ * Context reference containing metadata for the currently running schedule step.
179
+ *
180
+ * **Details**
181
+ * Repeat, retry, stream, and channel scheduling operations provide this service
182
+ * to effects run between schedule steps. The default value contains undefined
183
+ * input and output values, zero duration, and zeroed timing fields before any
184
+ * schedule step has produced metadata.
185
+ *
167
186
  * @category Metadata
187
+ * @since 4.0.0
168
188
  */
169
189
  export const CurrentMetadata = Context.Reference<Metadata>("effect/Schedule/CurrentMetadata", {
170
190
  defaultValue: constant({
@@ -182,7 +202,8 @@ export const CurrentMetadata = Context.Reference<Metadata>("effect/Schedule/Curr
182
202
  /**
183
203
  * The Schedule namespace contains types and utilities for working with schedules.
184
204
  *
185
- * @example
205
+ * **Example** (Creating custom schedules with the namespace)
206
+ *
186
207
  * ```ts
187
208
  * import { Duration, Effect, Schedule } from "effect"
188
209
  *
@@ -210,13 +231,13 @@ export const CurrentMetadata = Context.Reference<Metadata>("effect/Schedule/Curr
210
231
  * ```
211
232
  *
212
233
  * @since 2.0.0
213
- * @category models
214
234
  */
215
235
  export declare namespace Schedule {
216
236
  /**
217
237
  * Variance interface that defines the type parameter relationships for Schedule.
218
238
  *
219
- * @example
239
+ * **Example** (Understanding schedule variance)
240
+ *
220
241
  * ```ts
221
242
  * import { Effect, Schedule } from "effect"
222
243
  *
@@ -240,44 +261,23 @@ export declare namespace Schedule {
240
261
  * const serviceSchedule = Schedule.spaced("5 seconds")
241
262
  * ```
242
263
  *
264
+ * @category models
243
265
  * @since 2.0.0
244
- * @category Models
245
266
  */
246
267
  export interface Variance<out Output, in Input, out Error, out Env> {
247
268
  readonly [TypeId]: VarianceStruct<Output, Input, Error, Env>
248
269
  }
249
270
 
250
271
  /**
251
- * Internal structure that holds the variance annotations for Schedule type parameters.
252
- *
253
- * @example
254
- * ```ts
255
- * import { Effect, Schedule } from "effect"
272
+ * Type-level marker used by `Schedule.Variance` to record the variance of
273
+ * `Schedule` type parameters.
256
274
  *
257
- * // The variance struct defines how Schedule's type parameters behave
258
- * // This internal interface is used for type variance annotations
275
+ * **Notes**
276
+ * This interface exists for TypeScript inference and assignability. Users
277
+ * normally do not construct or inspect it directly.
259
278
  *
260
- * // Example showing variance relationships:
261
- * interface Animal {
262
- * name: string
263
- * }
264
- * interface Dog extends Animal {
265
- * breed: string
266
- * }
267
- *
268
- * // Output is covariant - more specific types can be substituted
269
- * const stringSchedule = Schedule.spaced("1 second").pipe(
270
- * Schedule.map(() => Effect.succeed("output"))
271
- * )
272
- *
273
- * // Input is contravariant - more general types can be accepted
274
- * const numberSchedule = Schedule.exponential("100 millis")
275
- *
276
- * // This enables proper type relationships where schedules can be composed safely
277
- * ```
278
- *
279
- * @since 2.0.0
280
- * @category Models
279
+ * @category models
280
+ * @since 4.0.0
281
281
  */
282
282
  export interface VarianceStruct<out Output, in Input, out Error, out Env> {
283
283
  readonly _Out: Covariant<Output>
@@ -301,7 +301,8 @@ const ScheduleProto = {
301
301
  /**
302
302
  * Type guard that checks if a value is a Schedule.
303
303
  *
304
- * @example
304
+ * **Example** (Checking for schedules)
305
+ *
305
306
  * ```ts
306
307
  * import { Schedule } from "effect"
307
308
  *
@@ -314,34 +315,33 @@ const ScheduleProto = {
314
315
  * console.log(Schedule.isSchedule(undefined)) // false
315
316
  * ```
316
317
  *
317
- * @since 2.0.0
318
318
  * @category guards
319
+ * @since 2.0.0
319
320
  */
320
321
  export const isSchedule = (u: unknown): u is Schedule<unknown, never, unknown, unknown> => hasProperty(u, TypeId)
321
322
 
322
323
  /**
323
324
  * Creates a Schedule from a step function that returns a Pull.
324
325
  *
325
- * @example
326
- * ```ts
327
- * import { Schedule } from "effect"
326
+ * **Example** (Creating a custom schedule from a step function)
328
327
  *
329
- * // fromStep is an advanced function for creating custom schedules
330
- * // It requires a step function that returns a Pull value
328
+ * ```ts
329
+ * import { Cause, Duration, Effect, Schedule } from "effect"
331
330
  *
332
- * // Most users should use simpler schedule constructors like:
333
- * const simpleSchedule = Schedule.exponential("100 millis")
334
- * const spacedSchedule = Schedule.spaced("1 second")
335
- * const recurringSchedule = Schedule.recurs(5)
331
+ * const schedule = Schedule.fromStep(Effect.sync(() => {
332
+ * let count = 0
336
333
  *
337
- * // These can be combined and transformed as needed
338
- * const complexSchedule = simpleSchedule.pipe(
339
- * Schedule.both(Schedule.recurs(3))
340
- * )
334
+ * return (_now: number, _input: string) => {
335
+ * if (count >= 3) {
336
+ * return Cause.done(count)
337
+ * }
338
+ * return Effect.succeed([count++, Duration.millis(100)] as [number, Duration.Duration])
339
+ * }
340
+ * }))
341
341
  * ```
342
342
  *
343
- * @since 4.0.0
344
343
  * @category constructors
344
+ * @since 4.0.0
345
345
  */
346
346
  export const fromStep = <Input, Output, EnvX, Error, ErrorX, Env>(
347
347
  step: Effect<
@@ -371,26 +371,25 @@ const metadataFn = () => {
371
371
  /**
372
372
  * Creates a Schedule from a step function that receives metadata about the schedule's execution.
373
373
  *
374
- * @example
375
- * ```ts
376
- * import { Effect, Schedule } from "effect"
374
+ * **Example** (Creating a metadata-aware schedule)
377
375
  *
378
- * // fromStepWithMetadata is an advanced function for creating schedules
379
- * // that need access to execution metadata like timing and recurrence count
376
+ * ```ts
377
+ * import { Cause, Duration, Effect, Schedule } from "effect"
380
378
  *
381
- * // Most users should use simpler metadata-aware functions like:
382
- * const metadataSchedule = Schedule.spaced("1 second").pipe(
383
- * Schedule.collectWhile((metadata) => Effect.succeed(metadata.attempt <= 5))
384
- * )
379
+ * const firstThreeInputs = Schedule.fromStepWithMetadata(Effect.succeed((metadata: Schedule.InputMetadata<string>) => {
380
+ * if (metadata.attempt > 3) {
381
+ * return Cause.done("finished")
382
+ * }
385
383
  *
386
- * // Or use existing schedules with metadata transformations:
387
- * const conditionalSchedule = Schedule.exponential("100 millis").pipe(
388
- * Schedule.tapOutput((output) => Effect.log(`Output: ${output}`))
389
- * )
384
+ * return Effect.succeed([
385
+ * `attempt ${metadata.attempt}: ${metadata.input}`,
386
+ * Duration.millis(250)
387
+ * ] as [string, Duration.Duration])
388
+ * }))
390
389
  * ```
391
390
  *
392
- * @since 4.0.0
393
391
  * @category constructors
392
+ * @since 4.0.0
394
393
  */
395
394
  export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>(
396
395
  step: Effect<
@@ -407,7 +406,8 @@ export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>(
407
406
  /**
408
407
  * Extracts the step function from a Schedule.
409
408
  *
410
- * @example
409
+ * **Example** (Extracting a schedule step function)
410
+ *
411
411
  * ```ts
412
412
  * import { Effect, Schedule } from "effect"
413
413
  *
@@ -417,16 +417,17 @@ export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>(
417
417
  * const program = Effect.gen(function*() {
418
418
  * const stepFn = yield* Schedule.toStep(schedule)
419
419
  *
420
- * // Use the step function directly for custom logic
421
- * const now = Date.now()
420
+ * // Use the step function directly for custom logic. The timestamp is
421
+ * // supplied by the caller, so tests can pass a deterministic value.
422
+ * const now = 0
422
423
  * const result = yield* stepFn(now, "input")
423
424
  *
424
425
  * console.log(`Step result: ${result}`)
425
426
  * })
426
427
  * ```
427
428
  *
428
- * @since 4.0.0
429
429
  * @category destructors
430
+ * @since 4.0.0
430
431
  */
431
432
  export const toStep = <Output, Input, Error, Env>(
432
433
  schedule: Schedule<Output, Input, Error, Env>
@@ -444,8 +445,8 @@ export const toStep = <Output, Input, Error, Env>(
444
445
  * Extracts a step function from a Schedule that provides metadata about each
445
446
  * execution. It will also handle sleeping for the computed delay.
446
447
  *
447
- * @since 4.0.0
448
448
  * @category destructors
449
+ * @since 4.0.0
449
450
  */
450
451
  export const toStepWithMetadata = <Output, Input, Error, Env>(
451
452
  schedule: Schedule<Output, Input, Error, Env>
@@ -479,7 +480,8 @@ export const toStepWithMetadata = <Output, Input, Error, Env>(
479
480
  /**
480
481
  * Extracts a step function from a Schedule that automatically handles sleep delays.
481
482
  *
482
- * @example
483
+ * **Example** (Extracting a sleeping step function)
484
+ *
483
485
  * ```ts
484
486
  * import { Effect, Schedule } from "effect"
485
487
  *
@@ -502,8 +504,8 @@ export const toStepWithMetadata = <Output, Input, Error, Env>(
502
504
  * })
503
505
  * ```
504
506
  *
505
- * @since 4.0.0
506
507
  * @category destructors
508
+ * @since 4.0.0
507
509
  */
508
510
  export const toStepWithSleep = <Output, Input, Error, Env>(
509
511
  schedule: Schedule<Output, Input, Error, Env>
@@ -521,29 +523,26 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
521
523
  * Returns a new `Schedule` that adds the delay computed by the specified
522
524
  * effectful function to the the next recurrence of the schedule.
523
525
  *
524
- * @example
526
+ * **Example** (Adding extra delay to a schedule)
527
+ *
525
528
  * ```ts
526
529
  * import { Console, Data, Duration, Effect, Schedule } from "effect"
527
530
  *
528
531
  * class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
529
532
  *
530
- * // Add random jitter to schedule delays
531
- * const jitteredSchedule = Schedule.addDelay(
533
+ * // Add a deterministic extra delay based on the schedule output
534
+ * const delayedSchedule = Schedule.addDelay(
532
535
  * Schedule.exponential("100 millis").pipe(Schedule.take(5)),
533
536
  * (output) =>
534
- * // Add random jitter between 0-50ms
535
- * Effect.succeed(Duration.millis(Math.random() * 50))
537
+ * Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
536
538
  * )
537
539
  *
538
- * const jitterProgram = Effect.gen(function*() {
540
+ * const repeatProgram = Effect.gen(function*() {
539
541
  * yield* Effect.repeat(
540
- * Effect.gen(function*() {
541
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
542
- * return "jittered task"
543
- * }),
544
- * jitteredSchedule.pipe(
542
+ * Effect.succeed("delayed task"),
543
+ * delayedSchedule.pipe(
545
544
  * Schedule.tapOutput((delay) =>
546
- * Console.log(`Base delay with jitter applied`)
545
+ * Console.log(`Base delay: ${delay}`)
547
546
  * )
548
547
  * )
549
548
  * )
@@ -571,12 +570,15 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
571
570
  * )
572
571
  * })
573
572
  *
574
- * // Add effectful delay computation
573
+ * // Add effectful delay computation from deterministic service data
574
+ * const loadByExecution = [1, 3, 2, 4] as const
575
+ *
575
576
  * const dynamicSchedule = Schedule.addDelay(
576
577
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
577
- * (executionNumber) =>
578
- * // Simulate checking system load and return additional delay
579
- * Effect.succeed(Duration.millis(Math.random() > 0.7 ? 2000 : 500))
578
+ * (executionNumber) => {
579
+ * const load = loadByExecution[executionNumber] ?? 1
580
+ * return Effect.succeed(Duration.millis(load * 100))
581
+ * }
580
582
  * )
581
583
  *
582
584
  * const dynamicProgram = Effect.gen(function*() {
@@ -589,25 +591,6 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
589
591
  * )
590
592
  * })
591
593
  *
592
- * // Add delay based on previous execution results (30% extra)
593
- * const resultBasedSchedule = Schedule.addDelay(
594
- * Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
595
- * (fibonacciDelay) =>
596
- * Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
597
- * )
598
- *
599
- * const resultProgram = Effect.gen(function*() {
600
- * yield* Effect.repeat(
601
- * Effect.gen(function*() {
602
- * yield* Console.log("Result-based delay task")
603
- * return Math.random()
604
- * }),
605
- * resultBasedSchedule.pipe(
606
- * Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
607
- * )
608
- * )
609
- * })
610
- *
611
594
  * // Combine with retry for progressive backoff
612
595
  * const progressiveRetrySchedule = Schedule.addDelay(
613
596
  * Schedule.exponential("50 millis").pipe(Schedule.take(4)),
@@ -632,37 +615,34 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
632
615
  * })
633
616
  * ```
634
617
  *
635
- * @since 2.0.0
636
618
  * @category utils
619
+ * @since 2.0.0
637
620
  */
638
621
  export const addDelay: {
639
622
  /**
640
623
  * Returns a new `Schedule` that adds the delay computed by the specified
641
624
  * effectful function to the the next recurrence of the schedule.
642
625
  *
643
- * @example
626
+ * **Example** (Adding extra delay to a schedule)
627
+ *
644
628
  * ```ts
645
629
  * import { Console, Data, Duration, Effect, Schedule } from "effect"
646
630
  *
647
631
  * class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
648
632
  *
649
- * // Add random jitter to schedule delays
650
- * const jitteredSchedule = Schedule.addDelay(
633
+ * // Add a deterministic extra delay based on the schedule output
634
+ * const delayedSchedule = Schedule.addDelay(
651
635
  * Schedule.exponential("100 millis").pipe(Schedule.take(5)),
652
636
  * (output) =>
653
- * // Add random jitter between 0-50ms
654
- * Effect.succeed(Duration.millis(Math.random() * 50))
637
+ * Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
655
638
  * )
656
639
  *
657
- * const jitterProgram = Effect.gen(function*() {
640
+ * const repeatProgram = Effect.gen(function*() {
658
641
  * yield* Effect.repeat(
659
- * Effect.gen(function*() {
660
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
661
- * return "jittered task"
662
- * }),
663
- * jitteredSchedule.pipe(
642
+ * Effect.succeed("delayed task"),
643
+ * delayedSchedule.pipe(
664
644
  * Schedule.tapOutput((delay) =>
665
- * Console.log(`Base delay with jitter applied`)
645
+ * Console.log(`Base delay: ${delay}`)
666
646
  * )
667
647
  * )
668
648
  * )
@@ -690,12 +670,15 @@ export const addDelay: {
690
670
  * )
691
671
  * })
692
672
  *
693
- * // Add effectful delay computation
673
+ * // Add effectful delay computation from deterministic service data
674
+ * const loadByExecution = [1, 3, 2, 4] as const
675
+ *
694
676
  * const dynamicSchedule = Schedule.addDelay(
695
677
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
696
- * (executionNumber) =>
697
- * // Simulate checking system load and return additional delay
698
- * Effect.succeed(Duration.millis(Math.random() > 0.7 ? 2000 : 500))
678
+ * (executionNumber) => {
679
+ * const load = loadByExecution[executionNumber] ?? 1
680
+ * return Effect.succeed(Duration.millis(load * 100))
681
+ * }
699
682
  * )
700
683
  *
701
684
  * const dynamicProgram = Effect.gen(function*() {
@@ -708,25 +691,6 @@ export const addDelay: {
708
691
  * )
709
692
  * })
710
693
  *
711
- * // Add delay based on previous execution results (30% extra)
712
- * const resultBasedSchedule = Schedule.addDelay(
713
- * Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
714
- * (fibonacciDelay) =>
715
- * Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
716
- * )
717
- *
718
- * const resultProgram = Effect.gen(function*() {
719
- * yield* Effect.repeat(
720
- * Effect.gen(function*() {
721
- * yield* Console.log("Result-based delay task")
722
- * return Math.random()
723
- * }),
724
- * resultBasedSchedule.pipe(
725
- * Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
726
- * )
727
- * )
728
- * })
729
- *
730
694
  * // Combine with retry for progressive backoff
731
695
  * const progressiveRetrySchedule = Schedule.addDelay(
732
696
  * Schedule.exponential("50 millis").pipe(Schedule.take(4)),
@@ -751,8 +715,8 @@ export const addDelay: {
751
715
  * })
752
716
  * ```
753
717
  *
754
- * @since 2.0.0
755
718
  * @category utils
719
+ * @since 2.0.0
756
720
  */
757
721
  <Output, Error2 = never, Env2 = never>(f: (output: Output) => Effect<Duration.Input, Error2, Env2>): <Input, Error, Env>(
758
722
  self: Schedule<Output, Input, Error, Env>
@@ -761,29 +725,26 @@ export const addDelay: {
761
725
  * Returns a new `Schedule` that adds the delay computed by the specified
762
726
  * effectful function to the the next recurrence of the schedule.
763
727
  *
764
- * @example
728
+ * **Example** (Adding extra delay to a schedule)
729
+ *
765
730
  * ```ts
766
731
  * import { Console, Data, Duration, Effect, Schedule } from "effect"
767
732
  *
768
733
  * class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
769
734
  *
770
- * // Add random jitter to schedule delays
771
- * const jitteredSchedule = Schedule.addDelay(
735
+ * // Add a deterministic extra delay based on the schedule output
736
+ * const delayedSchedule = Schedule.addDelay(
772
737
  * Schedule.exponential("100 millis").pipe(Schedule.take(5)),
773
738
  * (output) =>
774
- * // Add random jitter between 0-50ms
775
- * Effect.succeed(Duration.millis(Math.random() * 50))
739
+ * Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
776
740
  * )
777
741
  *
778
- * const jitterProgram = Effect.gen(function*() {
742
+ * const repeatProgram = Effect.gen(function*() {
779
743
  * yield* Effect.repeat(
780
- * Effect.gen(function*() {
781
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
782
- * return "jittered task"
783
- * }),
784
- * jitteredSchedule.pipe(
744
+ * Effect.succeed("delayed task"),
745
+ * delayedSchedule.pipe(
785
746
  * Schedule.tapOutput((delay) =>
786
- * Console.log(`Base delay with jitter applied`)
747
+ * Console.log(`Base delay: ${delay}`)
787
748
  * )
788
749
  * )
789
750
  * )
@@ -811,12 +772,15 @@ export const addDelay: {
811
772
  * )
812
773
  * })
813
774
  *
814
- * // Add effectful delay computation
775
+ * // Add effectful delay computation from deterministic service data
776
+ * const loadByExecution = [1, 3, 2, 4] as const
777
+ *
815
778
  * const dynamicSchedule = Schedule.addDelay(
816
779
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
817
- * (executionNumber) =>
818
- * // Simulate checking system load and return additional delay
819
- * Effect.succeed(Duration.millis(Math.random() > 0.7 ? 2000 : 500))
780
+ * (executionNumber) => {
781
+ * const load = loadByExecution[executionNumber] ?? 1
782
+ * return Effect.succeed(Duration.millis(load * 100))
783
+ * }
820
784
  * )
821
785
  *
822
786
  * const dynamicProgram = Effect.gen(function*() {
@@ -829,25 +793,6 @@ export const addDelay: {
829
793
  * )
830
794
  * })
831
795
  *
832
- * // Add delay based on previous execution results (30% extra)
833
- * const resultBasedSchedule = Schedule.addDelay(
834
- * Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
835
- * (fibonacciDelay) =>
836
- * Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
837
- * )
838
- *
839
- * const resultProgram = Effect.gen(function*() {
840
- * yield* Effect.repeat(
841
- * Effect.gen(function*() {
842
- * yield* Console.log("Result-based delay task")
843
- * return Math.random()
844
- * }),
845
- * resultBasedSchedule.pipe(
846
- * Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
847
- * )
848
- * )
849
- * })
850
- *
851
796
  * // Combine with retry for progressive backoff
852
797
  * const progressiveRetrySchedule = Schedule.addDelay(
853
798
  * Schedule.exponential("50 millis").pipe(Schedule.take(4)),
@@ -872,8 +817,8 @@ export const addDelay: {
872
817
  * })
873
818
  * ```
874
819
  *
875
- * @since 2.0.0
876
820
  * @category utils
821
+ * @since 2.0.0
877
822
  */
878
823
  <Output, Input, Error, Env, Error2 = never, Env2 = never>(
879
824
  self: Schedule<Output, Input, Error, Env>,
@@ -894,7 +839,8 @@ export const addDelay: {
894
839
  * schedule to completion. Once the left schedule is complete, the right (i.e.
895
840
  * `other`) schedule will be executed to completion.
896
841
  *
897
- * @example
842
+ * **Example** (Sequencing quick and slow retries)
843
+ *
898
844
  * ```ts
899
845
  * import { Console, Data, Effect, Schedule } from "effect"
900
846
  *
@@ -926,8 +872,8 @@ export const addDelay: {
926
872
  * })
927
873
  * ```
928
874
  *
929
- * @since 2.0.0
930
875
  * @category sequencing
876
+ * @since 2.0.0
931
877
  */
932
878
  export const andThen: {
933
879
  /**
@@ -935,7 +881,8 @@ export const andThen: {
935
881
  * schedule to completion. Once the left schedule is complete, the right (i.e.
936
882
  * `other`) schedule will be executed to completion.
937
883
  *
938
- * @example
884
+ * **Example** (Sequencing quick and slow retries)
885
+ *
939
886
  * ```ts
940
887
  * import { Console, Data, Effect, Schedule } from "effect"
941
888
  *
@@ -967,8 +914,8 @@ export const andThen: {
967
914
  * })
968
915
  * ```
969
916
  *
970
- * @since 2.0.0
971
917
  * @category sequencing
918
+ * @since 2.0.0
972
919
  */
973
920
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
974
921
  self: Schedule<Output, Input, Error, Env>
@@ -978,7 +925,8 @@ export const andThen: {
978
925
  * schedule to completion. Once the left schedule is complete, the right (i.e.
979
926
  * `other`) schedule will be executed to completion.
980
927
  *
981
- * @example
928
+ * **Example** (Sequencing quick and slow retries)
929
+ *
982
930
  * ```ts
983
931
  * import { Console, Data, Effect, Schedule } from "effect"
984
932
  *
@@ -1010,8 +958,8 @@ export const andThen: {
1010
958
  * })
1011
959
  * ```
1012
960
  *
1013
- * @since 2.0.0
1014
961
  * @category sequencing
962
+ * @since 2.0.0
1015
963
  */
1016
964
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
1017
965
  self: Schedule<Output, Input, Error, Env>,
@@ -1028,11 +976,12 @@ export const andThen: {
1028
976
  * schedule to completion. Once the left schedule is complete, the right (i.e.
1029
977
  * `other`) schedule will be executed to completion.
1030
978
  *
1031
- * The output of the resulting schedule is a `Result` where outputs of the
1032
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
1033
- * schedule are emitted as `Result.Ok<Output>`.
979
+ * The resulting schedule emits a `Result` to indicate which phase produced
980
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
981
+ * `other` are emitted as `Success`.
982
+ *
983
+ * **Example** (Tracking sequential schedule phases)
1034
984
  *
1035
- * @example
1036
985
  * ```ts
1037
986
  * import { Console, Effect, Result, Schedule } from "effect"
1038
987
  *
@@ -1060,8 +1009,8 @@ export const andThen: {
1060
1009
  * })
1061
1010
  * ```
1062
1011
  *
1063
- * @since 2.0.0
1064
1012
  * @category sequencing
1013
+ * @since 4.0.0
1065
1014
  */
1066
1015
  export const andThenResult: {
1067
1016
  /**
@@ -1069,11 +1018,12 @@ export const andThenResult: {
1069
1018
  * schedule to completion. Once the left schedule is complete, the right (i.e.
1070
1019
  * `other`) schedule will be executed to completion.
1071
1020
  *
1072
- * The output of the resulting schedule is a `Result` where outputs of the
1073
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
1074
- * schedule are emitted as `Result.Ok<Output>`.
1021
+ * The resulting schedule emits a `Result` to indicate which phase produced
1022
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
1023
+ * `other` are emitted as `Success`.
1024
+ *
1025
+ * **Example** (Tracking sequential schedule phases)
1075
1026
  *
1076
- * @example
1077
1027
  * ```ts
1078
1028
  * import { Console, Effect, Result, Schedule } from "effect"
1079
1029
  *
@@ -1101,8 +1051,8 @@ export const andThenResult: {
1101
1051
  * })
1102
1052
  * ```
1103
1053
  *
1104
- * @since 2.0.0
1105
1054
  * @category sequencing
1055
+ * @since 4.0.0
1106
1056
  */
1107
1057
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
1108
1058
  self: Schedule<Output, Input, Error, Env>
@@ -1112,11 +1062,12 @@ export const andThenResult: {
1112
1062
  * schedule to completion. Once the left schedule is complete, the right (i.e.
1113
1063
  * `other`) schedule will be executed to completion.
1114
1064
  *
1115
- * The output of the resulting schedule is a `Result` where outputs of the
1116
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
1117
- * schedule are emitted as `Result.Ok<Output>`.
1065
+ * The resulting schedule emits a `Result` to indicate which phase produced
1066
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
1067
+ * `other` are emitted as `Success`.
1068
+ *
1069
+ * **Example** (Tracking sequential schedule phases)
1118
1070
  *
1119
- * @example
1120
1071
  * ```ts
1121
1072
  * import { Console, Effect, Result, Schedule } from "effect"
1122
1073
  *
@@ -1144,8 +1095,8 @@ export const andThenResult: {
1144
1095
  * })
1145
1096
  * ```
1146
1097
  *
1147
- * @since 2.0.0
1148
1098
  * @category sequencing
1099
+ * @since 4.0.0
1149
1100
  */
1150
1101
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
1151
1102
  self: Schedule<Output, Input, Error, Env>,
@@ -1183,11 +1134,12 @@ export const andThenResult: {
1183
1134
  * schedule to completion. Once the left schedule is complete, the right (i.e.
1184
1135
  * `other`) schedule will be executed to completion.
1185
1136
  *
1186
- * The output of the resulting schedule is a `Result` where outputs of the
1187
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
1188
- * schedule are emitted as `Result.Ok<Output>`.
1137
+ * The resulting schedule emits a `Result` to indicate which phase produced
1138
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
1139
+ * `other` are emitted as `Success`.
1140
+ *
1141
+ * **Example** (Tracking sequential schedule phases)
1189
1142
  *
1190
- * @example
1191
1143
  * ```ts
1192
1144
  * import { Console, Effect, Result, Schedule } from "effect"
1193
1145
  *
@@ -1215,8 +1167,8 @@ export const andThenResult: {
1215
1167
  * })
1216
1168
  * ```
1217
1169
  *
1218
- * @since 2.0.0
1219
1170
  * @category sequencing
1171
+ * @since 4.0.0
1220
1172
  */
1221
1173
  Result.Result<Output, Output2>,
1222
1174
  /**
@@ -1224,11 +1176,12 @@ export const andThenResult: {
1224
1176
  * schedule to completion. Once the left schedule is complete, the right (i.e.
1225
1177
  * `other`) schedule will be executed to completion.
1226
1178
  *
1227
- * The output of the resulting schedule is a `Result` where outputs of the
1228
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
1229
- * schedule are emitted as `Result.Ok<Output>`.
1179
+ * The resulting schedule emits a `Result` to indicate which phase produced
1180
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
1181
+ * `other` are emitted as `Success`.
1182
+ *
1183
+ * **Example** (Tracking sequential schedule phases)
1230
1184
  *
1231
- * @example
1232
1185
  * ```ts
1233
1186
  * import { Console, Effect, Result, Schedule } from "effect"
1234
1187
  *
@@ -1256,8 +1209,8 @@ export const andThenResult: {
1256
1209
  * })
1257
1210
  * ```
1258
1211
  *
1259
- * @since 2.0.0
1260
1212
  * @category sequencing
1213
+ * @since 4.0.0
1261
1214
  */
1262
1215
  Input & Input2,
1263
1216
  /**
@@ -1265,11 +1218,12 @@ export const andThenResult: {
1265
1218
  * schedule to completion. Once the left schedule is complete, the right (i.e.
1266
1219
  * `other`) schedule will be executed to completion.
1267
1220
  *
1268
- * The output of the resulting schedule is a `Result` where outputs of the
1269
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
1270
- * schedule are emitted as `Result.Ok<Output>`.
1221
+ * The resulting schedule emits a `Result` to indicate which phase produced
1222
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
1223
+ * `other` are emitted as `Success`.
1224
+ *
1225
+ * **Example** (Tracking sequential schedule phases)
1271
1226
  *
1272
- * @example
1273
1227
  * ```ts
1274
1228
  * import { Console, Effect, Result, Schedule } from "effect"
1275
1229
  *
@@ -1297,8 +1251,8 @@ export const andThenResult: {
1297
1251
  * })
1298
1252
  * ```
1299
1253
  *
1300
- * @since 2.0.0
1301
1254
  * @category sequencing
1255
+ * @since 4.0.0
1302
1256
  */
1303
1257
  Error | Error2,
1304
1258
  /**
@@ -1306,11 +1260,12 @@ export const andThenResult: {
1306
1260
  * schedule to completion. Once the left schedule is complete, the right (i.e.
1307
1261
  * `other`) schedule will be executed to completion.
1308
1262
  *
1309
- * The output of the resulting schedule is a `Result` where outputs of the
1310
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
1311
- * schedule are emitted as `Result.Ok<Output>`.
1263
+ * The resulting schedule emits a `Result` to indicate which phase produced
1264
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
1265
+ * `other` are emitted as `Success`.
1266
+ *
1267
+ * **Example** (Tracking sequential schedule phases)
1312
1268
  *
1313
- * @example
1314
1269
  * ```ts
1315
1270
  * import { Console, Effect, Result, Schedule } from "effect"
1316
1271
  *
@@ -1338,8 +1293,8 @@ export const andThenResult: {
1338
1293
  * })
1339
1294
  * ```
1340
1295
  *
1341
- * @since 2.0.0
1342
1296
  * @category sequencing
1297
+ * @since 4.0.0
1343
1298
  */
1344
1299
  Env | Env2
1345
1300
  >(currentSide === 0 ? left : right).pipe(
@@ -1365,7 +1320,8 @@ export const andThenResult: {
1365
1320
  * to recur, using the maximum of the two durations between recurrences and
1366
1321
  * outputting a tuple of the outputs of both schedules.
1367
1322
  *
1368
- * @example
1323
+ * **Example** (Combining time and attempt limits)
1324
+ *
1369
1325
  * ```ts
1370
1326
  * import { Console, Data, Effect, Schedule } from "effect"
1371
1327
  *
@@ -1382,7 +1338,7 @@ export const andThenResult: {
1382
1338
  * const program = Effect.gen(function*() {
1383
1339
  * const results = yield* Effect.repeat(
1384
1340
  * Effect.gen(function*() {
1385
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
1341
+ * yield* Console.log("Task executed")
1386
1342
  * return "task completed"
1387
1343
  * }),
1388
1344
  * bothSchedule.pipe(
@@ -1426,8 +1382,8 @@ export const andThenResult: {
1426
1382
  * // Compare with either which provides union semantics (OR logic)
1427
1383
  * ```
1428
1384
  *
1385
+ * @category utils
1429
1386
  * @since 2.0.0
1430
- * @category utilities
1431
1387
  */
1432
1388
  export const both: {
1433
1389
  /**
@@ -1435,7 +1391,8 @@ export const both: {
1435
1391
  * to recur, using the maximum of the two durations between recurrences and
1436
1392
  * outputting a tuple of the outputs of both schedules.
1437
1393
  *
1438
- * @example
1394
+ * **Example** (Combining time and attempt limits)
1395
+ *
1439
1396
  * ```ts
1440
1397
  * import { Console, Data, Effect, Schedule } from "effect"
1441
1398
  *
@@ -1452,7 +1409,7 @@ export const both: {
1452
1409
  * const program = Effect.gen(function*() {
1453
1410
  * const results = yield* Effect.repeat(
1454
1411
  * Effect.gen(function*() {
1455
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
1412
+ * yield* Console.log("Task executed")
1456
1413
  * return "task completed"
1457
1414
  * }),
1458
1415
  * bothSchedule.pipe(
@@ -1496,8 +1453,8 @@ export const both: {
1496
1453
  * // Compare with either which provides union semantics (OR logic)
1497
1454
  * ```
1498
1455
  *
1456
+ * @category utils
1499
1457
  * @since 2.0.0
1500
- * @category utilities
1501
1458
  */
1502
1459
  <Output2, Input2, Error2, Env2, Output>(other: Schedule<Output2, Input2, Error2, Env2>): <Input, Error, Env>(
1503
1460
  self: Schedule<Output, Input, Error, Env>
@@ -1507,7 +1464,8 @@ export const both: {
1507
1464
  * to recur, using the maximum of the two durations between recurrences and
1508
1465
  * outputting a tuple of the outputs of both schedules.
1509
1466
  *
1510
- * @example
1467
+ * **Example** (Combining time and attempt limits)
1468
+ *
1511
1469
  * ```ts
1512
1470
  * import { Console, Data, Effect, Schedule } from "effect"
1513
1471
  *
@@ -1524,7 +1482,7 @@ export const both: {
1524
1482
  * const program = Effect.gen(function*() {
1525
1483
  * const results = yield* Effect.repeat(
1526
1484
  * Effect.gen(function*() {
1527
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
1485
+ * yield* Console.log("Task executed")
1528
1486
  * return "task completed"
1529
1487
  * }),
1530
1488
  * bothSchedule.pipe(
@@ -1568,8 +1526,8 @@ export const both: {
1568
1526
  * // Compare with either which provides union semantics (OR logic)
1569
1527
  * ```
1570
1528
  *
1529
+ * @category utils
1571
1530
  * @since 2.0.0
1572
- * @category utilities
1573
1531
  */
1574
1532
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
1575
1533
  self: Schedule<Output, Input, Error, Env>,
@@ -1586,7 +1544,8 @@ export const both: {
1586
1544
  * to recur, using the maximum of the two durations between recurrences and
1587
1545
  * outputting the result of the left schedule (i.e. `self`).
1588
1546
  *
1589
- * @example
1547
+ * **Example** (Combining schedules and keeping the left output)
1548
+ *
1590
1549
  * ```ts
1591
1550
  * import { Console, Effect, Schedule } from "effect"
1592
1551
  *
@@ -1609,8 +1568,8 @@ export const both: {
1609
1568
  * })
1610
1569
  * ```
1611
1570
  *
1571
+ * @category utils
1612
1572
  * @since 2.0.0
1613
- * @category utilities
1614
1573
  */
1615
1574
  export const bothLeft: {
1616
1575
  /**
@@ -1618,7 +1577,8 @@ export const bothLeft: {
1618
1577
  * to recur, using the maximum of the two durations between recurrences and
1619
1578
  * outputting the result of the left schedule (i.e. `self`).
1620
1579
  *
1621
- * @example
1580
+ * **Example** (Combining schedules and keeping the left output)
1581
+ *
1622
1582
  * ```ts
1623
1583
  * import { Console, Effect, Schedule } from "effect"
1624
1584
  *
@@ -1641,8 +1601,8 @@ export const bothLeft: {
1641
1601
  * })
1642
1602
  * ```
1643
1603
  *
1604
+ * @category utils
1644
1605
  * @since 2.0.0
1645
- * @category utilities
1646
1606
  */
1647
1607
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
1648
1608
  self: Schedule<Output, Input, Error, Env>
@@ -1652,7 +1612,8 @@ export const bothLeft: {
1652
1612
  * to recur, using the maximum of the two durations between recurrences and
1653
1613
  * outputting the result of the left schedule (i.e. `self`).
1654
1614
  *
1655
- * @example
1615
+ * **Example** (Combining schedules and keeping the left output)
1616
+ *
1656
1617
  * ```ts
1657
1618
  * import { Console, Effect, Schedule } from "effect"
1658
1619
  *
@@ -1675,8 +1636,8 @@ export const bothLeft: {
1675
1636
  * })
1676
1637
  * ```
1677
1638
  *
1639
+ * @category utils
1678
1640
  * @since 2.0.0
1679
- * @category utilities
1680
1641
  */
1681
1642
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
1682
1643
  self: Schedule<Output, Input, Error, Env>,
@@ -1692,7 +1653,8 @@ export const bothLeft: {
1692
1653
  * to recur, using the maximum of the two durations between recurrences and
1693
1654
  * outputting the result of the right schedule (i.e. `other`).
1694
1655
  *
1695
- * @example
1656
+ * **Example** (Combining schedules and keeping the right output)
1657
+ *
1696
1658
  * ```ts
1697
1659
  * import { Console, Effect, Schedule } from "effect"
1698
1660
  *
@@ -1717,8 +1679,8 @@ export const bothLeft: {
1717
1679
  * })
1718
1680
  * ```
1719
1681
  *
1682
+ * @category utils
1720
1683
  * @since 2.0.0
1721
- * @category utilities
1722
1684
  */
1723
1685
  export const bothRight: {
1724
1686
  /**
@@ -1726,7 +1688,8 @@ export const bothRight: {
1726
1688
  * to recur, using the maximum of the two durations between recurrences and
1727
1689
  * outputting the result of the right schedule (i.e. `other`).
1728
1690
  *
1729
- * @example
1691
+ * **Example** (Combining schedules and keeping the right output)
1692
+ *
1730
1693
  * ```ts
1731
1694
  * import { Console, Effect, Schedule } from "effect"
1732
1695
  *
@@ -1751,8 +1714,8 @@ export const bothRight: {
1751
1714
  * })
1752
1715
  * ```
1753
1716
  *
1717
+ * @category utils
1754
1718
  * @since 2.0.0
1755
- * @category utilities
1756
1719
  */
1757
1720
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
1758
1721
  self: Schedule<Output, Input, Error, Env>
@@ -1762,7 +1725,8 @@ export const bothRight: {
1762
1725
  * to recur, using the maximum of the two durations between recurrences and
1763
1726
  * outputting the result of the right schedule (i.e. `other`).
1764
1727
  *
1765
- * @example
1728
+ * **Example** (Combining schedules and keeping the right output)
1729
+ *
1766
1730
  * ```ts
1767
1731
  * import { Console, Effect, Schedule } from "effect"
1768
1732
  *
@@ -1787,8 +1751,8 @@ export const bothRight: {
1787
1751
  * })
1788
1752
  * ```
1789
1753
  *
1754
+ * @category utils
1790
1755
  * @since 2.0.0
1791
- * @category utilities
1792
1756
  */
1793
1757
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
1794
1758
  self: Schedule<Output, Input, Error, Env>,
@@ -1805,7 +1769,8 @@ export const bothRight: {
1805
1769
  * outputting the result of the combination of both schedule outputs using the
1806
1770
  * specified `combine` function.
1807
1771
  *
1808
- * @example
1772
+ * **Example** (Combining schedule outputs)
1773
+ *
1809
1774
  * ```ts
1810
1775
  * import { Console, Effect, Schedule } from "effect"
1811
1776
  *
@@ -1834,8 +1799,8 @@ export const bothRight: {
1834
1799
  * })
1835
1800
  * ```
1836
1801
  *
1802
+ * @category utils
1837
1803
  * @since 2.0.0
1838
- * @category utilities
1839
1804
  */
1840
1805
  export const bothWith: {
1841
1806
  /**
@@ -1844,7 +1809,8 @@ export const bothWith: {
1844
1809
  * outputting the result of the combination of both schedule outputs using the
1845
1810
  * specified `combine` function.
1846
1811
  *
1847
- * @example
1812
+ * **Example** (Combining schedule outputs)
1813
+ *
1848
1814
  * ```ts
1849
1815
  * import { Console, Effect, Schedule } from "effect"
1850
1816
  *
@@ -1873,8 +1839,8 @@ export const bothWith: {
1873
1839
  * })
1874
1840
  * ```
1875
1841
  *
1842
+ * @category utils
1876
1843
  * @since 2.0.0
1877
- * @category utilities
1878
1844
  */
1879
1845
  <Output2, Input2, Error2, Env2, Output, Output3>(
1880
1846
  other: Schedule<Output2, Input2, Error2, Env2>,
@@ -1888,7 +1854,8 @@ export const bothWith: {
1888
1854
  * outputting the result of the combination of both schedule outputs using the
1889
1855
  * specified `combine` function.
1890
1856
  *
1891
- * @example
1857
+ * **Example** (Combining schedule outputs)
1858
+ *
1892
1859
  * ```ts
1893
1860
  * import { Console, Effect, Schedule } from "effect"
1894
1861
  *
@@ -1917,8 +1884,8 @@ export const bothWith: {
1917
1884
  * })
1918
1885
  * ```
1919
1886
  *
1887
+ * @category utils
1920
1888
  * @since 2.0.0
1921
- * @category utilities
1922
1889
  */
1923
1890
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2, Output3>(
1924
1891
  self: Schedule<Output, Input, Error, Env>,
@@ -1954,10 +1921,15 @@ export const bothWith: {
1954
1921
  )))
1955
1922
 
1956
1923
  /**
1957
- * Returns a new `Schedule` that always recurs, collecting all inputs of the
1958
- * schedule into an array.
1924
+ * Returns a new `Schedule` that follows `self` and outputs the inputs seen so
1925
+ * far as an array.
1926
+ *
1927
+ * **Details**
1928
+ * This does not make the schedule run forever. The collected schedule stops
1929
+ * when `self` stops and fails when `self` fails.
1930
+ *
1931
+ * **Example** (Collecting schedule inputs)
1959
1932
  *
1960
- * @example
1961
1933
  * ```ts
1962
1934
  * import { Console, Effect, Schedule } from "effect"
1963
1935
  *
@@ -1979,18 +1951,23 @@ export const bothWith: {
1979
1951
  * })
1980
1952
  * ```
1981
1953
  *
1982
- * @since 2.0.0
1983
- * @category utilities
1954
+ * @category utils
1955
+ * @since 4.0.0
1984
1956
  */
1985
1957
  export const collectInputs = <Output, Input, Error, Env>(
1986
1958
  self: Schedule<Output, Input, Error, Env>
1987
1959
  ): Schedule<Array<Input>, Input, Error, Env> => collectWhile(passthrough(self), () => effect.succeed(true))
1988
1960
 
1989
1961
  /**
1990
- * Returns a new `Schedule` that always recurs, collecting all outputs of the
1991
- * schedule into an array.
1962
+ * Returns a new `Schedule` that follows `self` and outputs the schedule outputs
1963
+ * seen so far as an array.
1964
+ *
1965
+ * **Details**
1966
+ * This does not make the schedule run forever. The collected schedule stops
1967
+ * when `self` stops and fails when `self` fails.
1968
+ *
1969
+ * **Example** (Collecting schedule outputs)
1992
1970
  *
1993
- * @example
1994
1971
  * ```ts
1995
1972
  * import { Console, Effect, Schedule } from "effect"
1996
1973
  *
@@ -2010,8 +1987,8 @@ export const collectInputs = <Output, Input, Error, Env>(
2010
1987
  * })
2011
1988
  * ```
2012
1989
  *
2013
- * @since 2.0.0
2014
- * @category utilities
1990
+ * @category utils
1991
+ * @since 4.0.0
2015
1992
  */
2016
1993
  export const collectOutputs = <Output, Input, Error, Env>(
2017
1994
  self: Schedule<Output, Input, Error, Env>
@@ -2021,31 +1998,11 @@ export const collectOutputs = <Output, Input, Error, Env>(
2021
1998
  * Returns a new `Schedule` that recurs as long as the specified `predicate`
2022
1999
  * returns `true`, collecting all outputs of the schedule into an array.
2023
2000
  *
2024
- * @example
2001
+ * **Example** (Collecting outputs while a condition holds)
2002
+ *
2025
2003
  * ```ts
2026
2004
  * import { Console, Effect, Schedule } from "effect"
2027
2005
  *
2028
- * // Collect outputs while under time limit
2029
- * const collectForTime = Schedule.collectWhile(
2030
- * Schedule.spaced("500 millis"),
2031
- * (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
2032
- * )
2033
- *
2034
- * const timeBasedProgram = Effect.gen(function*() {
2035
- * const results = yield* Effect.repeat(
2036
- * Effect.gen(function*() {
2037
- * const value = Math.floor(Math.random() * 100)
2038
- * yield* Console.log(`Generated value: ${value}`)
2039
- * return value
2040
- * }),
2041
- * collectForTime
2042
- * )
2043
- *
2044
- * yield* Console.log(
2045
- * `Collected ${results.length} values: [${results.join(", ")}]`
2046
- * )
2047
- * })
2048
- *
2049
2006
  * // Collect outputs while condition is met
2050
2007
  * const collectWhileSmall = Schedule.collectWhile(
2051
2008
  * Schedule.exponential("100 millis"),
@@ -2056,16 +2013,16 @@ export const collectOutputs = <Output, Input, Error, Env>(
2056
2013
  * const conditionalProgram = Effect.gen(function*() {
2057
2014
  * let attempt = 0
2058
2015
  *
2059
- * const delays = yield* Effect.repeat(
2016
+ * const attempts = yield* Effect.repeat(
2060
2017
  * Effect.gen(function*() {
2061
2018
  * attempt++
2062
2019
  * yield* Console.log(`Retry attempt ${attempt}`)
2063
- * return `${Date.now()}`
2020
+ * return `attempt-${attempt}`
2064
2021
  * }),
2065
2022
  * collectWhileSmall
2066
2023
  * )
2067
2024
  *
2068
- * yield* Console.log(`Collected attempts: [${delays.join(", ")}]`)
2025
+ * yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
2069
2026
  * })
2070
2027
  *
2071
2028
  * // Collect with effectful predicate
@@ -2082,19 +2039,17 @@ export const collectOutputs = <Output, Input, Error, Env>(
2082
2039
  * )
2083
2040
  *
2084
2041
  * const effectfulProgram = Effect.gen(function*() {
2085
- * const timestamps = yield* Effect.repeat(
2086
- * Effect.gen(function*() {
2087
- * const now = new Date().toISOString()
2088
- * yield* Console.log(`Task at ${now}`)
2089
- * return now
2090
- * }),
2042
+ * const results = yield* Effect.repeat(
2043
+ * Effect.succeed("checked"),
2091
2044
  * collectWithCheck
2092
2045
  * )
2093
2046
  *
2094
- * yield* Console.log(`Final collection: ${timestamps.length} items`)
2047
+ * yield* Console.log(`Final collection: ${results.length} items`)
2095
2048
  * })
2096
2049
  *
2097
2050
  * // Collect samples with condition
2051
+ * const samples = [12, 18, 24, 30, 36]
2052
+ *
2098
2053
  * const collectSamples = Schedule.collectWhile(
2099
2054
  * Schedule.spaced("200 millis"),
2100
2055
  * (metadata) =>
@@ -2102,55 +2057,36 @@ export const collectOutputs = <Output, Input, Error, Env>(
2102
2057
  * )
2103
2058
  *
2104
2059
  * const samplingProgram = Effect.gen(function*() {
2105
- * const samples = yield* Effect.repeat(
2060
+ * let index = 0
2061
+ * const collected = yield* Effect.repeat(
2106
2062
  * Effect.gen(function*() {
2107
- * const sample = Math.random() * 100
2108
- * yield* Console.log(`Sample: ${sample.toFixed(1)}`)
2063
+ * const sample = samples[index++]
2064
+ * yield* Console.log(`Sample: ${sample}`)
2109
2065
  * return sample
2110
2066
  * }),
2111
2067
  * collectSamples
2112
2068
  * )
2113
2069
  *
2114
- * const average = samples.reduce((sum, s) => sum + s, 0) / samples.length
2070
+ * const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
2115
2071
  * yield* Console.log(
2116
- * `Collected ${samples.length} samples, average: ${average.toFixed(1)}`
2072
+ * `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
2117
2073
  * )
2118
2074
  * })
2119
2075
  * ```
2120
2076
  *
2077
+ * @category utils
2121
2078
  * @since 2.0.0
2122
- * @category utilities
2123
2079
  */
2124
2080
  export const collectWhile: {
2125
2081
  /**
2126
2082
  * Returns a new `Schedule` that recurs as long as the specified `predicate`
2127
2083
  * returns `true`, collecting all outputs of the schedule into an array.
2128
2084
  *
2129
- * @example
2085
+ * **Example** (Collecting outputs while a condition holds)
2086
+ *
2130
2087
  * ```ts
2131
2088
  * import { Console, Effect, Schedule } from "effect"
2132
2089
  *
2133
- * // Collect outputs while under time limit
2134
- * const collectForTime = Schedule.collectWhile(
2135
- * Schedule.spaced("500 millis"),
2136
- * (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
2137
- * )
2138
- *
2139
- * const timeBasedProgram = Effect.gen(function*() {
2140
- * const results = yield* Effect.repeat(
2141
- * Effect.gen(function*() {
2142
- * const value = Math.floor(Math.random() * 100)
2143
- * yield* Console.log(`Generated value: ${value}`)
2144
- * return value
2145
- * }),
2146
- * collectForTime
2147
- * )
2148
- *
2149
- * yield* Console.log(
2150
- * `Collected ${results.length} values: [${results.join(", ")}]`
2151
- * )
2152
- * })
2153
- *
2154
2090
  * // Collect outputs while condition is met
2155
2091
  * const collectWhileSmall = Schedule.collectWhile(
2156
2092
  * Schedule.exponential("100 millis"),
@@ -2161,16 +2097,16 @@ export const collectWhile: {
2161
2097
  * const conditionalProgram = Effect.gen(function*() {
2162
2098
  * let attempt = 0
2163
2099
  *
2164
- * const delays = yield* Effect.repeat(
2100
+ * const attempts = yield* Effect.repeat(
2165
2101
  * Effect.gen(function*() {
2166
2102
  * attempt++
2167
2103
  * yield* Console.log(`Retry attempt ${attempt}`)
2168
- * return `${Date.now()}`
2104
+ * return `attempt-${attempt}`
2169
2105
  * }),
2170
2106
  * collectWhileSmall
2171
2107
  * )
2172
2108
  *
2173
- * yield* Console.log(`Collected attempts: [${delays.join(", ")}]`)
2109
+ * yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
2174
2110
  * })
2175
2111
  *
2176
2112
  * // Collect with effectful predicate
@@ -2187,19 +2123,17 @@ export const collectWhile: {
2187
2123
  * )
2188
2124
  *
2189
2125
  * const effectfulProgram = Effect.gen(function*() {
2190
- * const timestamps = yield* Effect.repeat(
2191
- * Effect.gen(function*() {
2192
- * const now = new Date().toISOString()
2193
- * yield* Console.log(`Task at ${now}`)
2194
- * return now
2195
- * }),
2126
+ * const results = yield* Effect.repeat(
2127
+ * Effect.succeed("checked"),
2196
2128
  * collectWithCheck
2197
2129
  * )
2198
2130
  *
2199
- * yield* Console.log(`Final collection: ${timestamps.length} items`)
2131
+ * yield* Console.log(`Final collection: ${results.length} items`)
2200
2132
  * })
2201
2133
  *
2202
2134
  * // Collect samples with condition
2135
+ * const samples = [12, 18, 24, 30, 36]
2136
+ *
2203
2137
  * const collectSamples = Schedule.collectWhile(
2204
2138
  * Schedule.spaced("200 millis"),
2205
2139
  * (metadata) =>
@@ -2207,24 +2141,25 @@ export const collectWhile: {
2207
2141
  * )
2208
2142
  *
2209
2143
  * const samplingProgram = Effect.gen(function*() {
2210
- * const samples = yield* Effect.repeat(
2144
+ * let index = 0
2145
+ * const collected = yield* Effect.repeat(
2211
2146
  * Effect.gen(function*() {
2212
- * const sample = Math.random() * 100
2213
- * yield* Console.log(`Sample: ${sample.toFixed(1)}`)
2147
+ * const sample = samples[index++]
2148
+ * yield* Console.log(`Sample: ${sample}`)
2214
2149
  * return sample
2215
2150
  * }),
2216
2151
  * collectSamples
2217
2152
  * )
2218
2153
  *
2219
- * const average = samples.reduce((sum, s) => sum + s, 0) / samples.length
2154
+ * const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
2220
2155
  * yield* Console.log(
2221
- * `Collected ${samples.length} samples, average: ${average.toFixed(1)}`
2156
+ * `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
2222
2157
  * )
2223
2158
  * })
2224
2159
  * ```
2225
2160
  *
2161
+ * @category utils
2226
2162
  * @since 2.0.0
2227
- * @category utilities
2228
2163
  */
2229
2164
  <Input, Output, Error2 = never, Env2 = never>(
2230
2165
  predicate: (
@@ -2237,31 +2172,11 @@ export const collectWhile: {
2237
2172
  * Returns a new `Schedule` that recurs as long as the specified `predicate`
2238
2173
  * returns `true`, collecting all outputs of the schedule into an array.
2239
2174
  *
2240
- * @example
2175
+ * **Example** (Collecting outputs while a condition holds)
2176
+ *
2241
2177
  * ```ts
2242
2178
  * import { Console, Effect, Schedule } from "effect"
2243
2179
  *
2244
- * // Collect outputs while under time limit
2245
- * const collectForTime = Schedule.collectWhile(
2246
- * Schedule.spaced("500 millis"),
2247
- * (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
2248
- * )
2249
- *
2250
- * const timeBasedProgram = Effect.gen(function*() {
2251
- * const results = yield* Effect.repeat(
2252
- * Effect.gen(function*() {
2253
- * const value = Math.floor(Math.random() * 100)
2254
- * yield* Console.log(`Generated value: ${value}`)
2255
- * return value
2256
- * }),
2257
- * collectForTime
2258
- * )
2259
- *
2260
- * yield* Console.log(
2261
- * `Collected ${results.length} values: [${results.join(", ")}]`
2262
- * )
2263
- * })
2264
- *
2265
2180
  * // Collect outputs while condition is met
2266
2181
  * const collectWhileSmall = Schedule.collectWhile(
2267
2182
  * Schedule.exponential("100 millis"),
@@ -2272,16 +2187,16 @@ export const collectWhile: {
2272
2187
  * const conditionalProgram = Effect.gen(function*() {
2273
2188
  * let attempt = 0
2274
2189
  *
2275
- * const delays = yield* Effect.repeat(
2190
+ * const attempts = yield* Effect.repeat(
2276
2191
  * Effect.gen(function*() {
2277
2192
  * attempt++
2278
2193
  * yield* Console.log(`Retry attempt ${attempt}`)
2279
- * return `${Date.now()}`
2194
+ * return `attempt-${attempt}`
2280
2195
  * }),
2281
2196
  * collectWhileSmall
2282
2197
  * )
2283
2198
  *
2284
- * yield* Console.log(`Collected attempts: [${delays.join(", ")}]`)
2199
+ * yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
2285
2200
  * })
2286
2201
  *
2287
2202
  * // Collect with effectful predicate
@@ -2298,19 +2213,17 @@ export const collectWhile: {
2298
2213
  * )
2299
2214
  *
2300
2215
  * const effectfulProgram = Effect.gen(function*() {
2301
- * const timestamps = yield* Effect.repeat(
2302
- * Effect.gen(function*() {
2303
- * const now = new Date().toISOString()
2304
- * yield* Console.log(`Task at ${now}`)
2305
- * return now
2306
- * }),
2216
+ * const results = yield* Effect.repeat(
2217
+ * Effect.succeed("checked"),
2307
2218
  * collectWithCheck
2308
2219
  * )
2309
2220
  *
2310
- * yield* Console.log(`Final collection: ${timestamps.length} items`)
2221
+ * yield* Console.log(`Final collection: ${results.length} items`)
2311
2222
  * })
2312
2223
  *
2313
2224
  * // Collect samples with condition
2225
+ * const samples = [12, 18, 24, 30, 36]
2226
+ *
2314
2227
  * const collectSamples = Schedule.collectWhile(
2315
2228
  * Schedule.spaced("200 millis"),
2316
2229
  * (metadata) =>
@@ -2318,24 +2231,25 @@ export const collectWhile: {
2318
2231
  * )
2319
2232
  *
2320
2233
  * const samplingProgram = Effect.gen(function*() {
2321
- * const samples = yield* Effect.repeat(
2234
+ * let index = 0
2235
+ * const collected = yield* Effect.repeat(
2322
2236
  * Effect.gen(function*() {
2323
- * const sample = Math.random() * 100
2324
- * yield* Console.log(`Sample: ${sample.toFixed(1)}`)
2237
+ * const sample = samples[index++]
2238
+ * yield* Console.log(`Sample: ${sample}`)
2325
2239
  * return sample
2326
2240
  * }),
2327
2241
  * collectSamples
2328
2242
  * )
2329
2243
  *
2330
- * const average = samples.reduce((sum, s) => sum + s, 0) / samples.length
2244
+ * const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
2331
2245
  * yield* Console.log(
2332
- * `Collected ${samples.length} samples, average: ${average.toFixed(1)}`
2246
+ * `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
2333
2247
  * )
2334
2248
  * })
2335
2249
  * ```
2336
2250
  *
2251
+ * @category utils
2337
2252
  * @since 2.0.0
2338
- * @category utilities
2339
2253
  */
2340
2254
  <Output, Input, Error, Env, Error2 = never, Env2 = never>(
2341
2255
  self: Schedule<Output, Input, Error, Env>,
@@ -2358,7 +2272,8 @@ export const collectWhile: {
2358
2272
  * Returns a new `Schedule` that recurs on the specified `Cron` schedule and
2359
2273
  * outputs the duration between recurrences.
2360
2274
  *
2361
- * @example
2275
+ * **Example** (Scheduling work with cron expressions)
2276
+ *
2362
2277
  * ```ts
2363
2278
  * import { Console, Data, Effect, Schedule } from "effect"
2364
2279
  *
@@ -2370,7 +2285,7 @@ export const collectWhile: {
2370
2285
  * const minutelyProgram = Effect.gen(function*() {
2371
2286
  * yield* Effect.repeat(
2372
2287
  * Effect.gen(function*() {
2373
- * yield* Console.log(`Minutely task at ${new Date().toISOString()}`)
2288
+ * yield* Console.log("Running minutely task")
2374
2289
  * return "minute"
2375
2290
  * }),
2376
2291
  * everyMinute.pipe(
@@ -2408,8 +2323,8 @@ export const collectWhile: {
2408
2323
  * Effect.gen(function*() {
2409
2324
  * yield* Console.log("Generating weekly report...")
2410
2325
  * const report = {
2411
- * week: Math.floor(Date.now() / (7 * 24 * 60 * 60 * 1000)),
2412
- * timestamp: new Date().toISOString()
2326
+ * week: 42,
2327
+ * status: "ready" as const
2413
2328
  * }
2414
2329
  * yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
2415
2330
  * return report
@@ -2422,10 +2337,13 @@ export const collectWhile: {
2422
2337
  * const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
2423
2338
  *
2424
2339
  * const businessProgram = Effect.gen(function*() {
2340
+ * const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
2341
+ * let index = 0
2342
+ *
2425
2343
  * yield* Effect.repeat(
2426
2344
  * Effect.gen(function*() {
2427
2345
  * yield* Console.log("Business hours health check...")
2428
- * const status = Math.random() > 0.1 ? "healthy" : "degraded"
2346
+ * const status = statuses[index++]
2429
2347
  * yield* Console.log(`System status: ${status}`)
2430
2348
  * return status
2431
2349
  * }),
@@ -2442,9 +2360,9 @@ export const collectWhile: {
2442
2360
  * yield* Effect.repeat(
2443
2361
  * Effect.gen(function*() {
2444
2362
  * yield* Console.log("Processing monthly invoices...")
2445
- * const invoiceCount = Math.floor(Math.random() * 100) + 50
2363
+ * const invoiceCount = 72
2446
2364
  * yield* Console.log(`Processed ${invoiceCount} invoices`)
2447
- * return { count: invoiceCount, date: new Date().toISOString() }
2365
+ * return { count: invoiceCount, batch: "2024-01-a" }
2448
2366
  * }),
2449
2367
  * monthlyInvoice.pipe(Schedule.take(1))
2450
2368
  * )
@@ -2458,11 +2376,13 @@ export const collectWhile: {
2458
2376
  * )
2459
2377
  *
2460
2378
  * const robustProgram = Effect.gen(function*() {
2379
+ * let attempt = 0
2380
+ *
2461
2381
  * yield* Effect.repeat(
2462
2382
  * Effect.gen(function*() {
2383
+ * attempt++
2463
2384
  * yield* Console.log("Complex scheduled task...")
2464
- * // Simulate occasional failures
2465
- * if (Math.random() < 0.3) {
2385
+ * if (attempt === 1) {
2466
2386
  * return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
2467
2387
  * }
2468
2388
  * return "success"
@@ -2476,15 +2396,16 @@ export const collectWhile: {
2476
2396
  * })
2477
2397
  * ```
2478
2398
  *
2479
- * @since 4.0.0
2480
2399
  * @category constructors
2400
+ * @since 2.0.0
2481
2401
  */
2482
2402
  export const cron: {
2483
2403
  /**
2484
2404
  * Returns a new `Schedule` that recurs on the specified `Cron` schedule and
2485
2405
  * outputs the duration between recurrences.
2486
2406
  *
2487
- * @example
2407
+ * **Example** (Scheduling work with cron expressions)
2408
+ *
2488
2409
  * ```ts
2489
2410
  * import { Console, Data, Effect, Schedule } from "effect"
2490
2411
  *
@@ -2496,7 +2417,7 @@ export const cron: {
2496
2417
  * const minutelyProgram = Effect.gen(function*() {
2497
2418
  * yield* Effect.repeat(
2498
2419
  * Effect.gen(function*() {
2499
- * yield* Console.log(`Minutely task at ${new Date().toISOString()}`)
2420
+ * yield* Console.log("Running minutely task")
2500
2421
  * return "minute"
2501
2422
  * }),
2502
2423
  * everyMinute.pipe(
@@ -2534,8 +2455,8 @@ export const cron: {
2534
2455
  * Effect.gen(function*() {
2535
2456
  * yield* Console.log("Generating weekly report...")
2536
2457
  * const report = {
2537
- * week: Math.floor(Date.now() / (7 * 24 * 60 * 60 * 1000)),
2538
- * timestamp: new Date().toISOString()
2458
+ * week: 42,
2459
+ * status: "ready" as const
2539
2460
  * }
2540
2461
  * yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
2541
2462
  * return report
@@ -2548,10 +2469,13 @@ export const cron: {
2548
2469
  * const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
2549
2470
  *
2550
2471
  * const businessProgram = Effect.gen(function*() {
2472
+ * const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
2473
+ * let index = 0
2474
+ *
2551
2475
  * yield* Effect.repeat(
2552
2476
  * Effect.gen(function*() {
2553
2477
  * yield* Console.log("Business hours health check...")
2554
- * const status = Math.random() > 0.1 ? "healthy" : "degraded"
2478
+ * const status = statuses[index++]
2555
2479
  * yield* Console.log(`System status: ${status}`)
2556
2480
  * return status
2557
2481
  * }),
@@ -2568,9 +2492,9 @@ export const cron: {
2568
2492
  * yield* Effect.repeat(
2569
2493
  * Effect.gen(function*() {
2570
2494
  * yield* Console.log("Processing monthly invoices...")
2571
- * const invoiceCount = Math.floor(Math.random() * 100) + 50
2495
+ * const invoiceCount = 72
2572
2496
  * yield* Console.log(`Processed ${invoiceCount} invoices`)
2573
- * return { count: invoiceCount, date: new Date().toISOString() }
2497
+ * return { count: invoiceCount, batch: "2024-01-a" }
2574
2498
  * }),
2575
2499
  * monthlyInvoice.pipe(Schedule.take(1))
2576
2500
  * )
@@ -2584,11 +2508,13 @@ export const cron: {
2584
2508
  * )
2585
2509
  *
2586
2510
  * const robustProgram = Effect.gen(function*() {
2511
+ * let attempt = 0
2512
+ *
2587
2513
  * yield* Effect.repeat(
2588
2514
  * Effect.gen(function*() {
2515
+ * attempt++
2589
2516
  * yield* Console.log("Complex scheduled task...")
2590
- * // Simulate occasional failures
2591
- * if (Math.random() < 0.3) {
2517
+ * if (attempt === 1) {
2592
2518
  * return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
2593
2519
  * }
2594
2520
  * return "success"
@@ -2602,15 +2528,16 @@ export const cron: {
2602
2528
  * })
2603
2529
  * ```
2604
2530
  *
2605
- * @since 4.0.0
2606
2531
  * @category constructors
2532
+ * @since 2.0.0
2607
2533
  */
2608
2534
  (expression: Cron.Cron): Schedule<Duration.Duration, unknown, Cron.CronParseError>
2609
2535
  /**
2610
2536
  * Returns a new `Schedule` that recurs on the specified `Cron` schedule and
2611
2537
  * outputs the duration between recurrences.
2612
2538
  *
2613
- * @example
2539
+ * **Example** (Scheduling work with cron expressions)
2540
+ *
2614
2541
  * ```ts
2615
2542
  * import { Console, Data, Effect, Schedule } from "effect"
2616
2543
  *
@@ -2622,7 +2549,7 @@ export const cron: {
2622
2549
  * const minutelyProgram = Effect.gen(function*() {
2623
2550
  * yield* Effect.repeat(
2624
2551
  * Effect.gen(function*() {
2625
- * yield* Console.log(`Minutely task at ${new Date().toISOString()}`)
2552
+ * yield* Console.log("Running minutely task")
2626
2553
  * return "minute"
2627
2554
  * }),
2628
2555
  * everyMinute.pipe(
@@ -2660,8 +2587,8 @@ export const cron: {
2660
2587
  * Effect.gen(function*() {
2661
2588
  * yield* Console.log("Generating weekly report...")
2662
2589
  * const report = {
2663
- * week: Math.floor(Date.now() / (7 * 24 * 60 * 60 * 1000)),
2664
- * timestamp: new Date().toISOString()
2590
+ * week: 42,
2591
+ * status: "ready" as const
2665
2592
  * }
2666
2593
  * yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
2667
2594
  * return report
@@ -2674,10 +2601,13 @@ export const cron: {
2674
2601
  * const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
2675
2602
  *
2676
2603
  * const businessProgram = Effect.gen(function*() {
2604
+ * const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
2605
+ * let index = 0
2606
+ *
2677
2607
  * yield* Effect.repeat(
2678
2608
  * Effect.gen(function*() {
2679
2609
  * yield* Console.log("Business hours health check...")
2680
- * const status = Math.random() > 0.1 ? "healthy" : "degraded"
2610
+ * const status = statuses[index++]
2681
2611
  * yield* Console.log(`System status: ${status}`)
2682
2612
  * return status
2683
2613
  * }),
@@ -2694,9 +2624,9 @@ export const cron: {
2694
2624
  * yield* Effect.repeat(
2695
2625
  * Effect.gen(function*() {
2696
2626
  * yield* Console.log("Processing monthly invoices...")
2697
- * const invoiceCount = Math.floor(Math.random() * 100) + 50
2627
+ * const invoiceCount = 72
2698
2628
  * yield* Console.log(`Processed ${invoiceCount} invoices`)
2699
- * return { count: invoiceCount, date: new Date().toISOString() }
2629
+ * return { count: invoiceCount, batch: "2024-01-a" }
2700
2630
  * }),
2701
2631
  * monthlyInvoice.pipe(Schedule.take(1))
2702
2632
  * )
@@ -2710,11 +2640,13 @@ export const cron: {
2710
2640
  * )
2711
2641
  *
2712
2642
  * const robustProgram = Effect.gen(function*() {
2643
+ * let attempt = 0
2644
+ *
2713
2645
  * yield* Effect.repeat(
2714
2646
  * Effect.gen(function*() {
2647
+ * attempt++
2715
2648
  * yield* Console.log("Complex scheduled task...")
2716
- * // Simulate occasional failures
2717
- * if (Math.random() < 0.3) {
2649
+ * if (attempt === 1) {
2718
2650
  * return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
2719
2651
  * }
2720
2652
  * return "success"
@@ -2728,8 +2660,8 @@ export const cron: {
2728
2660
  * })
2729
2661
  * ```
2730
2662
  *
2731
- * @since 4.0.0
2732
2663
  * @category constructors
2664
+ * @since 2.0.0
2733
2665
  */
2734
2666
  (expression: string, tz?: string | DateTime.TimeZone): Schedule<Duration.Duration, unknown, Cron.CronParseError>
2735
2667
  } = (expression: string | Cron.Cron, tz?: string | DateTime.TimeZone) => {
@@ -2745,7 +2677,8 @@ export const cron: {
2745
2677
  /**
2746
2678
  * Returns a new schedule that outputs the delay between each occurence.
2747
2679
  *
2748
- * @example
2680
+ * **Example** (Extracting schedule delays)
2681
+ *
2749
2682
  * ```ts
2750
2683
  * import { Console, Effect, Schedule } from "effect"
2751
2684
  *
@@ -2805,7 +2738,7 @@ export const cron: {
2805
2738
  * yield* Effect.repeat(
2806
2739
  * Effect.gen(function*() {
2807
2740
  * yield* Console.log("Adaptive task execution")
2808
- * return Date.now()
2741
+ * return "completed"
2809
2742
  * }),
2810
2743
  * adaptiveDelays.pipe(
2811
2744
  * Schedule.tapOutput((delay) => Console.log(`Adaptive delay: ${delay}`))
@@ -2822,8 +2755,8 @@ export const cron: {
2822
2755
  * )
2823
2756
  * ```
2824
2757
  *
2825
- * @since 2.0.0
2826
2758
  * @category constructors
2759
+ * @since 2.0.0
2827
2760
  */
2828
2761
  export const delays = <Out, In, E, R>(self: Schedule<Out, In, E, R>): Schedule<Duration.Duration, In, E, R> =>
2829
2762
  fromStep(
@@ -2843,8 +2776,8 @@ export const delays = <Out, In, E, R>(self: Schedule<Out, In, E, R>): Schedule<D
2843
2776
  * The schedule outputs the configured duration for its first recurrence and
2844
2777
  * then completes.
2845
2778
  *
2846
- * @since 2.0.0
2847
2779
  * @category constructors
2780
+ * @since 2.0.0
2848
2781
  */
2849
2782
  export const duration = (durationInput: Duration.Input): Schedule<Duration.Duration> => {
2850
2783
  const duration = Duration.fromInputUnsafe(durationInput)
@@ -2859,7 +2792,8 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
2859
2792
  * Returns a new `Schedule` that will always recur, but only during the
2860
2793
  * specified `duration` of time.
2861
2794
  *
2862
- * @example
2795
+ * **Example** (Repeating work during a duration)
2796
+ *
2863
2797
  * ```ts
2864
2798
  * import { Console, Data, Effect, Schedule } from "effect"
2865
2799
  *
@@ -2869,12 +2803,9 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
2869
2803
  * const fiveSecondSchedule = Schedule.during("5 seconds")
2870
2804
  *
2871
2805
  * const timedProgram = Effect.gen(function*() {
2872
- * const startTime = Date.now()
2873
- *
2874
2806
  * yield* Effect.repeat(
2875
2807
  * Effect.gen(function*() {
2876
- * const elapsed = Date.now() - startTime
2877
- * yield* Console.log(`Task executed after ${elapsed}ms`)
2808
+ * yield* Console.log("Task executed inside the time window")
2878
2809
  * yield* Effect.sleep("500 millis") // Each task takes 500ms
2879
2810
  * return "task done"
2880
2811
  * }),
@@ -2902,8 +2833,8 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
2902
2833
  *
2903
2834
  * yield* Effect.repeat(
2904
2835
  * Effect.gen(function*() {
2905
- * yield* Console.log(`Burst task at ${new Date().toISOString()}`)
2906
- * return Math.random()
2836
+ * yield* Console.log("Burst task")
2837
+ * return "burst"
2907
2838
  * }),
2908
2839
  * burstWindow
2909
2840
  * )
@@ -2924,7 +2855,7 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
2924
2855
  * attempt++
2925
2856
  * yield* Console.log(`Retry attempt ${attempt}`)
2926
2857
  *
2927
- * if (Math.random() < 0.8) { // 80% failure rate
2858
+ * if (attempt < 4) {
2928
2859
  * return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
2929
2860
  * }
2930
2861
  *
@@ -2939,8 +2870,8 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
2939
2870
  * )
2940
2871
  * ```
2941
2872
  *
2942
- * @since 4.0.0
2943
2873
  * @category constructors
2874
+ * @since 4.0.0
2944
2875
  */
2945
2876
  export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
2946
2877
  while_(
@@ -2953,7 +2884,8 @@ export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
2953
2884
  * to recur, using the minimum of the two durations between recurrences and
2954
2885
  * outputting a tuple of the outputs of both schedules.
2955
2886
  *
2956
- * @example
2887
+ * **Example** (Combining schedules with either semantics)
2888
+ *
2957
2889
  * ```ts
2958
2890
  * import { Console, Data, Effect, Schedule } from "effect"
2959
2891
  *
@@ -2970,7 +2902,7 @@ export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
2970
2902
  * const program = Effect.gen(function*() {
2971
2903
  * const results = yield* Effect.repeat(
2972
2904
  * Effect.gen(function*() {
2973
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
2905
+ * yield* Console.log("Task executed")
2974
2906
  * return "task completed"
2975
2907
  * }),
2976
2908
  * eitherSchedule.pipe(
@@ -3016,8 +2948,8 @@ export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
3016
2948
  * // Compare with intersect which provides intersection semantics (AND logic)
3017
2949
  * ```
3018
2950
  *
2951
+ * @category utils
3019
2952
  * @since 2.0.0
3020
- * @category utilities
3021
2953
  */
3022
2954
  export const either: {
3023
2955
  /**
@@ -3025,7 +2957,8 @@ export const either: {
3025
2957
  * to recur, using the minimum of the two durations between recurrences and
3026
2958
  * outputting a tuple of the outputs of both schedules.
3027
2959
  *
3028
- * @example
2960
+ * **Example** (Combining schedules with either semantics)
2961
+ *
3029
2962
  * ```ts
3030
2963
  * import { Console, Data, Effect, Schedule } from "effect"
3031
2964
  *
@@ -3042,7 +2975,7 @@ export const either: {
3042
2975
  * const program = Effect.gen(function*() {
3043
2976
  * const results = yield* Effect.repeat(
3044
2977
  * Effect.gen(function*() {
3045
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
2978
+ * yield* Console.log("Task executed")
3046
2979
  * return "task completed"
3047
2980
  * }),
3048
2981
  * eitherSchedule.pipe(
@@ -3088,8 +3021,8 @@ export const either: {
3088
3021
  * // Compare with intersect which provides intersection semantics (AND logic)
3089
3022
  * ```
3090
3023
  *
3024
+ * @category utils
3091
3025
  * @since 2.0.0
3092
- * @category utilities
3093
3026
  */
3094
3027
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
3095
3028
  self: Schedule<Output, Input, Error, Env>
@@ -3099,7 +3032,8 @@ export const either: {
3099
3032
  * to recur, using the minimum of the two durations between recurrences and
3100
3033
  * outputting a tuple of the outputs of both schedules.
3101
3034
  *
3102
- * @example
3035
+ * **Example** (Combining schedules with either semantics)
3036
+ *
3103
3037
  * ```ts
3104
3038
  * import { Console, Data, Effect, Schedule } from "effect"
3105
3039
  *
@@ -3116,7 +3050,7 @@ export const either: {
3116
3050
  * const program = Effect.gen(function*() {
3117
3051
  * const results = yield* Effect.repeat(
3118
3052
  * Effect.gen(function*() {
3119
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
3053
+ * yield* Console.log("Task executed")
3120
3054
  * return "task completed"
3121
3055
  * }),
3122
3056
  * eitherSchedule.pipe(
@@ -3162,8 +3096,8 @@ export const either: {
3162
3096
  * // Compare with intersect which provides intersection semantics (AND logic)
3163
3097
  * ```
3164
3098
  *
3099
+ * @category utils
3165
3100
  * @since 2.0.0
3166
- * @category utilities
3167
3101
  */
3168
3102
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
3169
3103
  self: Schedule<Output, Input, Error, Env>,
@@ -3180,7 +3114,8 @@ export const either: {
3180
3114
  * to recur, using the minimum of the two durations between recurrences and
3181
3115
  * outputting the result of the left schedule (i.e. `self`).
3182
3116
  *
3183
- * @example
3117
+ * **Example** (Combining either schedules and keeping the left output)
3118
+ *
3184
3119
  * ```ts
3185
3120
  * import { Console, Effect, Schedule } from "effect"
3186
3121
  *
@@ -3206,8 +3141,8 @@ export const either: {
3206
3141
  * })
3207
3142
  * ```
3208
3143
  *
3209
- * @since 2.0.0
3210
- * @category utilities
3144
+ * @category utils
3145
+ * @since 4.0.0
3211
3146
  */
3212
3147
  export const eitherLeft: {
3213
3148
  /**
@@ -3215,7 +3150,8 @@ export const eitherLeft: {
3215
3150
  * to recur, using the minimum of the two durations between recurrences and
3216
3151
  * outputting the result of the left schedule (i.e. `self`).
3217
3152
  *
3218
- * @example
3153
+ * **Example** (Combining either schedules and keeping the left output)
3154
+ *
3219
3155
  * ```ts
3220
3156
  * import { Console, Effect, Schedule } from "effect"
3221
3157
  *
@@ -3241,8 +3177,8 @@ export const eitherLeft: {
3241
3177
  * })
3242
3178
  * ```
3243
3179
  *
3244
- * @since 2.0.0
3245
- * @category utilities
3180
+ * @category utils
3181
+ * @since 4.0.0
3246
3182
  */
3247
3183
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
3248
3184
  self: Schedule<Output, Input, Error, Env>
@@ -3252,7 +3188,8 @@ export const eitherLeft: {
3252
3188
  * to recur, using the minimum of the two durations between recurrences and
3253
3189
  * outputting the result of the left schedule (i.e. `self`).
3254
3190
  *
3255
- * @example
3191
+ * **Example** (Combining either schedules and keeping the left output)
3192
+ *
3256
3193
  * ```ts
3257
3194
  * import { Console, Effect, Schedule } from "effect"
3258
3195
  *
@@ -3278,8 +3215,8 @@ export const eitherLeft: {
3278
3215
  * })
3279
3216
  * ```
3280
3217
  *
3281
- * @since 2.0.0
3282
- * @category utilities
3218
+ * @category utils
3219
+ * @since 4.0.0
3283
3220
  */
3284
3221
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
3285
3222
  self: Schedule<Output, Input, Error, Env>,
@@ -3295,7 +3232,8 @@ export const eitherLeft: {
3295
3232
  * to recur, using the minimum of the two durations between recurrences and
3296
3233
  * outputting the result of the right schedule (i.e. `other`).
3297
3234
  *
3298
- * @example
3235
+ * **Example** (Combining either schedules and keeping the right output)
3236
+ *
3299
3237
  * ```ts
3300
3238
  * import { Console, Effect, Schedule } from "effect"
3301
3239
  *
@@ -3321,8 +3259,8 @@ export const eitherLeft: {
3321
3259
  * })
3322
3260
  * ```
3323
3261
  *
3324
- * @since 2.0.0
3325
- * @category utilities
3262
+ * @category utils
3263
+ * @since 4.0.0
3326
3264
  */
3327
3265
  export const eitherRight: {
3328
3266
  /**
@@ -3330,7 +3268,8 @@ export const eitherRight: {
3330
3268
  * to recur, using the minimum of the two durations between recurrences and
3331
3269
  * outputting the result of the right schedule (i.e. `other`).
3332
3270
  *
3333
- * @example
3271
+ * **Example** (Combining either schedules and keeping the right output)
3272
+ *
3334
3273
  * ```ts
3335
3274
  * import { Console, Effect, Schedule } from "effect"
3336
3275
  *
@@ -3356,8 +3295,8 @@ export const eitherRight: {
3356
3295
  * })
3357
3296
  * ```
3358
3297
  *
3359
- * @since 2.0.0
3360
- * @category utilities
3298
+ * @category utils
3299
+ * @since 4.0.0
3361
3300
  */
3362
3301
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
3363
3302
  self: Schedule<Output, Input, Error, Env>
@@ -3367,7 +3306,8 @@ export const eitherRight: {
3367
3306
  * to recur, using the minimum of the two durations between recurrences and
3368
3307
  * outputting the result of the right schedule (i.e. `other`).
3369
3308
  *
3370
- * @example
3309
+ * **Example** (Combining either schedules and keeping the right output)
3310
+ *
3371
3311
  * ```ts
3372
3312
  * import { Console, Effect, Schedule } from "effect"
3373
3313
  *
@@ -3393,8 +3333,8 @@ export const eitherRight: {
3393
3333
  * })
3394
3334
  * ```
3395
3335
  *
3396
- * @since 2.0.0
3397
- * @category utilities
3336
+ * @category utils
3337
+ * @since 4.0.0
3398
3338
  */
3399
3339
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
3400
3340
  self: Schedule<Output, Input, Error, Env>,
@@ -3411,7 +3351,8 @@ export const eitherRight: {
3411
3351
  * outputting the result of the combination of both schedule outputs using the
3412
3352
  * specified `combine` function.
3413
3353
  *
3414
- * @example
3354
+ * **Example** (Combining either schedule outputs)
3355
+ *
3415
3356
  * ```ts
3416
3357
  * import { Console, Effect, Schedule } from "effect"
3417
3358
  *
@@ -3441,8 +3382,8 @@ export const eitherRight: {
3441
3382
  * })
3442
3383
  * ```
3443
3384
  *
3385
+ * @category utils
3444
3386
  * @since 2.0.0
3445
- * @category utilities
3446
3387
  */
3447
3388
  export const eitherWith: {
3448
3389
  /**
@@ -3451,7 +3392,8 @@ export const eitherWith: {
3451
3392
  * outputting the result of the combination of both schedule outputs using the
3452
3393
  * specified `combine` function.
3453
3394
  *
3454
- * @example
3395
+ * **Example** (Combining either schedule outputs)
3396
+ *
3455
3397
  * ```ts
3456
3398
  * import { Console, Effect, Schedule } from "effect"
3457
3399
  *
@@ -3481,8 +3423,8 @@ export const eitherWith: {
3481
3423
  * })
3482
3424
  * ```
3483
3425
  *
3426
+ * @category utils
3484
3427
  * @since 2.0.0
3485
- * @category utilities
3486
3428
  */
3487
3429
  <Output2, Input2, Error2, Env2, Output, Output3>(
3488
3430
  other: Schedule<Output2, Input2, Error2, Env2>,
@@ -3496,7 +3438,8 @@ export const eitherWith: {
3496
3438
  * outputting the result of the combination of both schedule outputs using the
3497
3439
  * specified `combine` function.
3498
3440
  *
3499
- * @example
3441
+ * **Example** (Combining either schedule outputs)
3442
+ *
3500
3443
  * ```ts
3501
3444
  * import { Console, Effect, Schedule } from "effect"
3502
3445
  *
@@ -3526,8 +3469,8 @@ export const eitherWith: {
3526
3469
  * })
3527
3470
  * ```
3528
3471
  *
3472
+ * @category utils
3529
3473
  * @since 2.0.0
3530
- * @category utilities
3531
3474
  */
3532
3475
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2, Output3>(
3533
3476
  self: Schedule<Output, Input, Error, Env>,
@@ -3558,7 +3501,8 @@ export const eitherWith: {
3558
3501
  * outputting the result of the combination of both schedule outputs using the
3559
3502
  * specified `combine` function.
3560
3503
  *
3561
- * @example
3504
+ * **Example** (Combining either schedule outputs)
3505
+ *
3562
3506
  * ```ts
3563
3507
  * import { Console, Effect, Schedule } from "effect"
3564
3508
  *
@@ -3588,8 +3532,8 @@ export const eitherWith: {
3588
3532
  * })
3589
3533
  * ```
3590
3534
  *
3535
+ * @category utils
3591
3536
  * @since 2.0.0
3592
- * @category utilities
3593
3537
  */
3594
3538
  [Output3, Duration.Duration]>([
3595
3539
  combine(leftResult[0], rightDone as Output2),
@@ -3617,9 +3561,8 @@ export const eitherWith: {
3617
3561
  * This schedule never stops and outputs the cumulative time that has passed since the schedule
3618
3562
  * started executing. Useful for tracking execution time or implementing time-based logic.
3619
3563
  *
3620
- * @returns A schedule that outputs the elapsed duration and never stops
3564
+ * **Example** (Measuring elapsed schedule time)
3621
3565
  *
3622
- * @example
3623
3566
  * ```ts
3624
3567
  * import { Console, Duration, Effect, Schedule } from "effect"
3625
3568
  *
@@ -3637,8 +3580,8 @@ export const eitherWith: {
3637
3580
  * })
3638
3581
  * ```
3639
3582
  *
3640
- * @since 2.0.0
3641
3583
  * @category constructors
3584
+ * @since 2.0.0
3642
3585
  */
3643
3586
  export const elapsed: Schedule<Duration.Duration> = fromStepWithMetadata(
3644
3587
  effect.succeed((meta) => effect.succeed([Duration.millis(meta.elapsed), Duration.zero] as const))
@@ -3649,7 +3592,8 @@ export const elapsed: Schedule<Duration.Duration> = fromStepWithMetadata(
3649
3592
  * repetitions, given by `base * factor.pow(n)`, where `n` is the number of
3650
3593
  * repetitions so far. Returns the current duration between recurrences.
3651
3594
  *
3652
- * @example
3595
+ * **Example** (Retrying with exponential backoff)
3596
+ *
3653
3597
  * ```ts
3654
3598
  * import { Console, Data, Effect, Schedule } from "effect"
3655
3599
  *
@@ -3689,8 +3633,8 @@ export const elapsed: Schedule<Duration.Duration> = fromStepWithMetadata(
3689
3633
  * // Will retry with delays: 50ms, 100ms, 200ms before success
3690
3634
  * ```
3691
3635
  *
3692
- * @since 2.0.0
3693
3636
  * @category constructors
3637
+ * @since 2.0.0
3694
3638
  */
3695
3639
  export const exponential = (
3696
3640
  base: Duration.Input,
@@ -3708,7 +3652,8 @@ export const exponential = (
3708
3652
  * two delays (similar to the fibonacci sequence). Returns the current
3709
3653
  * duration between recurrences.
3710
3654
  *
3711
- * @example
3655
+ * **Example** (Retrying with fibonacci backoff)
3656
+ *
3712
3657
  * ```ts
3713
3658
  * import { Console, Data, Effect, Schedule } from "effect"
3714
3659
  *
@@ -3744,7 +3689,7 @@ export const exponential = (
3744
3689
  *
3745
3690
  * // Heartbeat with fibonacci intervals (starts fast, gets slower)
3746
3691
  * const adaptiveHeartbeat = Effect.gen(function*() {
3747
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
3692
+ * yield* Console.log("Heartbeat")
3748
3693
  * return "pulse"
3749
3694
  * }).pipe(
3750
3695
  * Effect.repeat(
@@ -3766,8 +3711,8 @@ export const exponential = (
3766
3711
  * })
3767
3712
  * ```
3768
3713
  *
3769
- * @since 2.0.0
3770
3714
  * @category constructors
3715
+ * @since 2.0.0
3771
3716
  */
3772
3717
  export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
3773
3718
  const oneMillis = Duration.toMillis(Duration.fromInputUnsafe(one))
@@ -3796,7 +3741,8 @@ export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
3796
3741
  * |---------action--------||action|-----|action|-----------|
3797
3742
  * ```
3798
3743
  *
3799
- * @example
3744
+ * **Example** (Repeating on fixed intervals)
3745
+ *
3800
3746
  * ```ts
3801
3747
  * import { Console, Effect, Schedule } from "effect"
3802
3748
  *
@@ -3805,7 +3751,7 @@ export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
3805
3751
  *
3806
3752
  * // Health check that runs at fixed intervals
3807
3753
  * const healthCheck = Effect.gen(function*() {
3808
- * yield* Console.log(`Health check at ${new Date().toISOString()}`)
3754
+ * yield* Console.log("Health check")
3809
3755
  * yield* Effect.sleep("200 millis") // simulate health check work
3810
3756
  * return "healthy"
3811
3757
  * }).pipe(
@@ -3843,8 +3789,8 @@ export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
3843
3789
  * })
3844
3790
  * ```
3845
3791
  *
3846
- * @since 2.0.0
3847
3792
  * @category constructors
3793
+ * @since 2.0.0
3848
3794
  */
3849
3795
  export const fixed = (interval: Duration.Input): Schedule<number> => {
3850
3796
  const window = Duration.toMillis(Duration.fromInputUnsafe(interval))
@@ -3874,7 +3820,8 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
3874
3820
  * Returns a new `Schedule` that maps the output of this schedule using the
3875
3821
  * specified function.
3876
3822
  *
3877
- * @example
3823
+ * **Example** (Mapping schedule outputs)
3824
+ *
3878
3825
  * ```ts
3879
3826
  * import { Console, Effect, Schedule } from "effect"
3880
3827
  *
@@ -3892,7 +3839,6 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
3892
3839
  * const structuredSchedule = Schedule.spaced("1 second").pipe(
3893
3840
  * Schedule.map((recurrence) => Effect.succeed({
3894
3841
  * iteration: recurrence + 1,
3895
- * timestamp: new Date().toISOString(),
3896
3842
  * phase: recurrence < 5 ? "warmup" as const : "steady" as const
3897
3843
  * }))
3898
3844
  * )
@@ -3904,7 +3850,7 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
3904
3850
  * Schedule.take(8),
3905
3851
  * Schedule.tapOutput((info) =>
3906
3852
  * Console.log(
3907
- * `${info.phase} phase - iteration ${info.iteration} at ${info.timestamp}`
3853
+ * `${info.phase} phase - iteration ${info.iteration}`
3908
3854
  * )
3909
3855
  * )
3910
3856
  * )
@@ -3929,15 +3875,16 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
3929
3875
  * )
3930
3876
  * ```
3931
3877
  *
3932
- * @since 2.0.0
3933
3878
  * @category mapping
3879
+ * @since 2.0.0
3934
3880
  */
3935
3881
  export const map: {
3936
3882
  /**
3937
3883
  * Returns a new `Schedule` that maps the output of this schedule using the
3938
3884
  * specified function.
3939
3885
  *
3940
- * @example
3886
+ * **Example** (Mapping schedule outputs)
3887
+ *
3941
3888
  * ```ts
3942
3889
  * import { Console, Effect, Schedule } from "effect"
3943
3890
  *
@@ -3955,7 +3902,6 @@ export const map: {
3955
3902
  * const structuredSchedule = Schedule.spaced("1 second").pipe(
3956
3903
  * Schedule.map((recurrence) => Effect.succeed({
3957
3904
  * iteration: recurrence + 1,
3958
- * timestamp: new Date().toISOString(),
3959
3905
  * phase: recurrence < 5 ? "warmup" as const : "steady" as const
3960
3906
  * }))
3961
3907
  * )
@@ -3967,7 +3913,7 @@ export const map: {
3967
3913
  * Schedule.take(8),
3968
3914
  * Schedule.tapOutput((info) =>
3969
3915
  * Console.log(
3970
- * `${info.phase} phase - iteration ${info.iteration} at ${info.timestamp}`
3916
+ * `${info.phase} phase - iteration ${info.iteration}`
3971
3917
  * )
3972
3918
  * )
3973
3919
  * )
@@ -3992,8 +3938,8 @@ export const map: {
3992
3938
  * )
3993
3939
  * ```
3994
3940
  *
3995
- * @since 2.0.0
3996
3941
  * @category mapping
3942
+ * @since 2.0.0
3997
3943
  */
3998
3944
  <Output, Output2, Error2 = never, Env2 = never>(f: (output: Output) => Output2 | Effect<Output2, Error2, Env2>): <Input, Error, Env>(
3999
3945
  self: Schedule<Output, Input, Error, Env>
@@ -4002,7 +3948,8 @@ export const map: {
4002
3948
  * Returns a new `Schedule` that maps the output of this schedule using the
4003
3949
  * specified function.
4004
3950
  *
4005
- * @example
3951
+ * **Example** (Mapping schedule outputs)
3952
+ *
4006
3953
  * ```ts
4007
3954
  * import { Console, Effect, Schedule } from "effect"
4008
3955
  *
@@ -4020,7 +3967,6 @@ export const map: {
4020
3967
  * const structuredSchedule = Schedule.spaced("1 second").pipe(
4021
3968
  * Schedule.map((recurrence) => Effect.succeed({
4022
3969
  * iteration: recurrence + 1,
4023
- * timestamp: new Date().toISOString(),
4024
3970
  * phase: recurrence < 5 ? "warmup" as const : "steady" as const
4025
3971
  * }))
4026
3972
  * )
@@ -4032,7 +3978,7 @@ export const map: {
4032
3978
  * Schedule.take(8),
4033
3979
  * Schedule.tapOutput((info) =>
4034
3980
  * Console.log(
4035
- * `${info.phase} phase - iteration ${info.iteration} at ${info.timestamp}`
3981
+ * `${info.phase} phase - iteration ${info.iteration}`
4036
3982
  * )
4037
3983
  * )
4038
3984
  * )
@@ -4057,8 +4003,8 @@ export const map: {
4057
4003
  * )
4058
4004
  * ```
4059
4005
  *
4060
- * @since 2.0.0
4061
4006
  * @category mapping
4007
+ * @since 2.0.0
4062
4008
  */
4063
4009
  <Output, Input, Error, Env, Output2, Error2 = never, Env2 = never>(
4064
4010
  self: Schedule<Output, Input, Error, Env>,
@@ -4088,7 +4034,8 @@ export const map: {
4088
4034
  * Returns a new `Schedule` that modifies the delay of the next recurrence
4089
4035
  * of the schedule using the specified effectual function.
4090
4036
  *
4091
- * @example
4037
+ * **Example** (Modifying delays from schedule output)
4038
+ *
4092
4039
  * ```ts
4093
4040
  * import { Console, Duration, Effect, Schedule } from "effect"
4094
4041
  *
@@ -4113,15 +4060,16 @@ export const map: {
4113
4060
  * })
4114
4061
  * ```
4115
4062
  *
4063
+ * @category utils
4116
4064
  * @since 2.0.0
4117
- * @category utilities
4118
4065
  */
4119
4066
  export const modifyDelay: {
4120
4067
  /**
4121
4068
  * Returns a new `Schedule` that modifies the delay of the next recurrence
4122
4069
  * of the schedule using the specified effectual function.
4123
4070
  *
4124
- * @example
4071
+ * **Example** (Modifying delays from schedule output)
4072
+ *
4125
4073
  * ```ts
4126
4074
  * import { Console, Duration, Effect, Schedule } from "effect"
4127
4075
  *
@@ -4146,8 +4094,8 @@ export const modifyDelay: {
4146
4094
  * })
4147
4095
  * ```
4148
4096
  *
4097
+ * @category utils
4149
4098
  * @since 2.0.0
4150
- * @category utilities
4151
4099
  */
4152
4100
  <Output, Error2 = never, Env2 = never>(
4153
4101
  f: (
@@ -4161,7 +4109,8 @@ export const modifyDelay: {
4161
4109
  * Returns a new `Schedule` that modifies the delay of the next recurrence
4162
4110
  * of the schedule using the specified effectual function.
4163
4111
  *
4164
- * @example
4112
+ * **Example** (Modifying delays from schedule output)
4113
+ *
4165
4114
  * ```ts
4166
4115
  * import { Console, Duration, Effect, Schedule } from "effect"
4167
4116
  *
@@ -4186,8 +4135,8 @@ export const modifyDelay: {
4186
4135
  * })
4187
4136
  * ```
4188
4137
  *
4138
+ * @category utils
4189
4139
  * @since 2.0.0
4190
- * @category utilities
4191
4140
  */
4192
4141
  <Output, Input, Error, Env, Error2 = never, Env2 = never>(
4193
4142
  self: Schedule<Output, Input, Error, Env>,
@@ -4214,8 +4163,8 @@ export const modifyDelay: {
4214
4163
  *
4215
4164
  * Delays are jittered between `80%` and `120%` of the original delay.
4216
4165
  *
4166
+ * @category utils
4217
4167
  * @since 2.0.0
4218
- * @category utilities
4219
4168
  */
4220
4169
  export const jittered = <Output, Input, Error, Env>(
4221
4170
  self: Schedule<Output, Input, Error, Env>
@@ -4229,7 +4178,8 @@ export const jittered = <Output, Input, Error, Env>(
4229
4178
  /**
4230
4179
  * Returns a new `Schedule` that outputs the inputs of the specified schedule.
4231
4180
  *
4232
- * @example
4181
+ * **Example** (Passing inputs through as outputs)
4182
+ *
4233
4183
  * ```ts
4234
4184
  * import { Console, Effect, Schedule } from "effect"
4235
4185
  *
@@ -4251,8 +4201,8 @@ export const jittered = <Output, Input, Error, Env>(
4251
4201
  * })
4252
4202
  * ```
4253
4203
  *
4204
+ * @category utils
4254
4205
  * @since 2.0.0
4255
- * @category utilities
4256
4206
  */
4257
4207
  export const passthrough = <Output, Input, Error, Env>(
4258
4208
  self: Schedule<Output, Input, Error, Env>
@@ -4268,7 +4218,8 @@ export const passthrough = <Output, Input, Error, Env>(
4268
4218
  * Returns a `Schedule` which can only be stepped the specified number of
4269
4219
  * `times` before it terminates.
4270
4220
  *
4271
- * @example
4221
+ * **Example** (Limiting recurrences)
4222
+ *
4272
4223
  * ```ts
4273
4224
  * import { Console, Data, Effect, Schedule } from "effect"
4274
4225
  *
@@ -4306,7 +4257,7 @@ export const passthrough = <Output, Input, Error, Env>(
4306
4257
  * // Repeat an effect exactly 10 times
4307
4258
  * const exactlyTenTimes = Effect.gen(function*() {
4308
4259
  * yield* Console.log("Executing task...")
4309
- * return Math.random()
4260
+ * return "completed"
4310
4261
  * }).pipe(
4311
4262
  * Effect.repeat(Schedule.recurs(10))
4312
4263
  * )
@@ -4328,7 +4279,8 @@ export const recurs = (times: number): Schedule<number> =>
4328
4279
  * using the specified effectful `combine` function and starting from the
4329
4280
  * specified `initial` state.
4330
4281
  *
4331
- * @example
4282
+ * **Example** (Reducing schedule outputs)
4283
+ *
4332
4284
  * ```ts
4333
4285
  * import { Console, Effect, Schedule } from "effect"
4334
4286
  *
@@ -4353,24 +4305,24 @@ export const recurs = (times: number): Schedule<number> =>
4353
4305
  * yield* Console.log(`Final sum: ${finalSum}`)
4354
4306
  * })
4355
4307
  *
4356
- * // Build a history of execution times
4308
+ * // Build a history of execution counts
4357
4309
  * const historySchedule = Schedule.reduce(
4358
4310
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
4359
4311
  * () => [] as Array<number>, // Initial empty array
4360
- * (history, executionNumber) => Effect.succeed([...history, Date.now()])
4312
+ * (history, executionNumber) => Effect.succeed([...history, executionNumber])
4361
4313
  * )
4362
4314
  *
4363
4315
  * const historyProgram = Effect.gen(function*() {
4364
4316
  * const timeline = yield* Effect.repeat(
4365
4317
  * Effect.gen(function*() {
4366
- * yield* Console.log("Recording timestamp...")
4318
+ * yield* Console.log("Recording execution...")
4367
4319
  * return "recorded"
4368
4320
  * }),
4369
4321
  * historySchedule
4370
4322
  * )
4371
4323
  *
4372
4324
  * yield* Console.log(
4373
- * `Execution timeline: ${timeline.length} timestamps recorded`
4325
+ * `Execution timeline: ${timeline.join(", ")}`
4374
4326
  * )
4375
4327
  * })
4376
4328
  *
@@ -4431,8 +4383,8 @@ export const recurs = (times: number): Schedule<number> =>
4431
4383
  * })
4432
4384
  * ```
4433
4385
  *
4386
+ * @category utils
4434
4387
  * @since 2.0.0
4435
- * @category utilities
4436
4388
  */
4437
4389
  export const reduce: {
4438
4390
  /**
@@ -4440,7 +4392,8 @@ export const reduce: {
4440
4392
  * using the specified effectful `combine` function and starting from the
4441
4393
  * specified `initial` state.
4442
4394
  *
4443
- * @example
4395
+ * **Example** (Reducing schedule outputs)
4396
+ *
4444
4397
  * ```ts
4445
4398
  * import { Console, Effect, Schedule } from "effect"
4446
4399
  *
@@ -4465,24 +4418,24 @@ export const reduce: {
4465
4418
  * yield* Console.log(`Final sum: ${finalSum}`)
4466
4419
  * })
4467
4420
  *
4468
- * // Build a history of execution times
4421
+ * // Build a history of execution counts
4469
4422
  * const historySchedule = Schedule.reduce(
4470
4423
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
4471
4424
  * () => [] as Array<number>, // Initial empty array
4472
- * (history, executionNumber) => Effect.succeed([...history, Date.now()])
4425
+ * (history, executionNumber) => Effect.succeed([...history, executionNumber])
4473
4426
  * )
4474
4427
  *
4475
4428
  * const historyProgram = Effect.gen(function*() {
4476
4429
  * const timeline = yield* Effect.repeat(
4477
4430
  * Effect.gen(function*() {
4478
- * yield* Console.log("Recording timestamp...")
4431
+ * yield* Console.log("Recording execution...")
4479
4432
  * return "recorded"
4480
4433
  * }),
4481
4434
  * historySchedule
4482
4435
  * )
4483
4436
  *
4484
4437
  * yield* Console.log(
4485
- * `Execution timeline: ${timeline.length} timestamps recorded`
4438
+ * `Execution timeline: ${timeline.join(", ")}`
4486
4439
  * )
4487
4440
  * })
4488
4441
  *
@@ -4543,8 +4496,8 @@ export const reduce: {
4543
4496
  * })
4544
4497
  * ```
4545
4498
  *
4499
+ * @category utils
4546
4500
  * @since 2.0.0
4547
- * @category utilities
4548
4501
  */
4549
4502
  <State, Output, Error2 = never, Env2 = never>(
4550
4503
  initial: LazyArg<State>,
@@ -4557,7 +4510,8 @@ export const reduce: {
4557
4510
  * using the specified effectful `combine` function and starting from the
4558
4511
  * specified `initial` state.
4559
4512
  *
4560
- * @example
4513
+ * **Example** (Reducing schedule outputs)
4514
+ *
4561
4515
  * ```ts
4562
4516
  * import { Console, Effect, Schedule } from "effect"
4563
4517
  *
@@ -4582,24 +4536,24 @@ export const reduce: {
4582
4536
  * yield* Console.log(`Final sum: ${finalSum}`)
4583
4537
  * })
4584
4538
  *
4585
- * // Build a history of execution times
4539
+ * // Build a history of execution counts
4586
4540
  * const historySchedule = Schedule.reduce(
4587
4541
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
4588
4542
  * () => [] as Array<number>, // Initial empty array
4589
- * (history, executionNumber) => Effect.succeed([...history, Date.now()])
4543
+ * (history, executionNumber) => Effect.succeed([...history, executionNumber])
4590
4544
  * )
4591
4545
  *
4592
4546
  * const historyProgram = Effect.gen(function*() {
4593
4547
  * const timeline = yield* Effect.repeat(
4594
4548
  * Effect.gen(function*() {
4595
- * yield* Console.log("Recording timestamp...")
4549
+ * yield* Console.log("Recording execution...")
4596
4550
  * return "recorded"
4597
4551
  * }),
4598
4552
  * historySchedule
4599
4553
  * )
4600
4554
  *
4601
4555
  * yield* Console.log(
4602
- * `Execution timeline: ${timeline.length} timestamps recorded`
4556
+ * `Execution timeline: ${timeline.join(", ")}`
4603
4557
  * )
4604
4558
  * })
4605
4559
  *
@@ -4660,8 +4614,8 @@ export const reduce: {
4660
4614
  * })
4661
4615
  * ```
4662
4616
  *
4617
+ * @category utils
4663
4618
  * @since 2.0.0
4664
- * @category utilities
4665
4619
  */
4666
4620
  <Output, Input, Error, Env, State, Error2 = never, Env2 = never>(
4667
4621
  self: Schedule<Output, Input, Error, Env>,
@@ -4700,7 +4654,8 @@ export const reduce: {
4700
4654
  * Returns a schedule that recurs continuously, each repetition spaced the
4701
4655
  * specified duration from the last run.
4702
4656
  *
4703
- * @example
4657
+ * **Example** (Repeating with fixed spacing)
4658
+ *
4704
4659
  * ```ts
4705
4660
  * import { Console, Effect, Schedule } from "effect"
4706
4661
  *
@@ -4709,7 +4664,7 @@ export const reduce: {
4709
4664
  *
4710
4665
  * // Heartbeat that runs indefinitely with fixed spacing
4711
4666
  * const heartbeat = Effect.gen(function*() {
4712
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
4667
+ * yield* Console.log("Heartbeat")
4713
4668
  * }).pipe(
4714
4669
  * Effect.repeat(everyTwoSeconds)
4715
4670
  * )
@@ -4742,8 +4697,8 @@ export const reduce: {
4742
4697
  * })
4743
4698
  * ```
4744
4699
  *
4745
- * @since 2.0.0
4746
4700
  * @category constructors
4701
+ * @since 2.0.0
4747
4702
  */
4748
4703
  export const spaced = (duration: Duration.Input): Schedule<number> => {
4749
4704
  const decoded = Duration.fromInputUnsafe(duration)
@@ -4755,7 +4710,8 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
4755
4710
  * every input to the schedule, but does not alter the inputs and outputs of
4756
4711
  * the schedule.
4757
4712
  *
4758
- * @example
4713
+ * **Example** (Tapping retry inputs)
4714
+ *
4759
4715
  * ```ts
4760
4716
  * import { Console, Data, Effect, Schedule } from "effect"
4761
4717
  *
@@ -4791,7 +4747,6 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
4791
4747
  * Schedule.take(5),
4792
4748
  * Schedule.tapInput((input: unknown) =>
4793
4749
  * Effect.gen(function*() {
4794
- * yield* Console.log(`Processing input at ${new Date().toISOString()}`)
4795
4750
  * yield* Console.log(`Input type: ${typeof input}`)
4796
4751
  * // In real applications, might send metrics to monitoring system
4797
4752
  * })
@@ -4813,10 +4768,13 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
4813
4768
  * )
4814
4769
  *
4815
4770
  * const validationProgram = Effect.gen(function*() {
4771
+ * let count = 0
4772
+ *
4816
4773
  * yield* Effect.repeat(
4817
4774
  * Effect.gen(function*() {
4775
+ * count++
4818
4776
  * yield* Console.log("Task with validation")
4819
- * return { data: Math.random(), timestamp: Date.now() }
4777
+ * return { data: `sample-${count}` }
4820
4778
  * }),
4821
4779
  * validatingSchedule
4822
4780
  * )
@@ -4828,10 +4786,10 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
4828
4786
  * Schedule.tapInput((error: RetryError) =>
4829
4787
  * Effect.gen(function*() {
4830
4788
  * if (String(error).includes("critical")) {
4831
- * yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
4789
+ * yield* Console.log(`Critical error: ${String(error)}`)
4832
4790
  * // In real applications, might trigger alerts or notifications
4833
4791
  * } else {
4834
- * yield* Console.log(`ℹ️ Regular error: ${String(error)}`)
4792
+ * yield* Console.log(`Regular error: ${String(error)}`)
4835
4793
  * }
4836
4794
  * })
4837
4795
  * )
@@ -4865,14 +4823,14 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
4865
4823
  * ),
4866
4824
  * Schedule.tapInput((error: RetryError) =>
4867
4825
  * String(error).length > 20
4868
- * ? Console.log("📝 Long error message detected")
4826
+ * ? Console.log("Long error message detected")
4869
4827
  * : Effect.void
4870
4828
  * )
4871
4829
  * )
4872
4830
  * ```
4873
4831
  *
4874
- * @since 2.0.0
4875
4832
  * @category sequencing
4833
+ * @since 2.0.0
4876
4834
  */
4877
4835
  export const tapInput: {
4878
4836
  /**
@@ -4880,7 +4838,8 @@ export const tapInput: {
4880
4838
  * every input to the schedule, but does not alter the inputs and outputs of
4881
4839
  * the schedule.
4882
4840
  *
4883
- * @example
4841
+ * **Example** (Tapping retry inputs)
4842
+ *
4884
4843
  * ```ts
4885
4844
  * import { Console, Data, Effect, Schedule } from "effect"
4886
4845
  *
@@ -4916,7 +4875,6 @@ export const tapInput: {
4916
4875
  * Schedule.take(5),
4917
4876
  * Schedule.tapInput((input: unknown) =>
4918
4877
  * Effect.gen(function*() {
4919
- * yield* Console.log(`Processing input at ${new Date().toISOString()}`)
4920
4878
  * yield* Console.log(`Input type: ${typeof input}`)
4921
4879
  * // In real applications, might send metrics to monitoring system
4922
4880
  * })
@@ -4938,10 +4896,13 @@ export const tapInput: {
4938
4896
  * )
4939
4897
  *
4940
4898
  * const validationProgram = Effect.gen(function*() {
4899
+ * let count = 0
4900
+ *
4941
4901
  * yield* Effect.repeat(
4942
4902
  * Effect.gen(function*() {
4903
+ * count++
4943
4904
  * yield* Console.log("Task with validation")
4944
- * return { data: Math.random(), timestamp: Date.now() }
4905
+ * return { data: `sample-${count}` }
4945
4906
  * }),
4946
4907
  * validatingSchedule
4947
4908
  * )
@@ -4953,10 +4914,10 @@ export const tapInput: {
4953
4914
  * Schedule.tapInput((error: RetryError) =>
4954
4915
  * Effect.gen(function*() {
4955
4916
  * if (String(error).includes("critical")) {
4956
- * yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
4917
+ * yield* Console.log(`Critical error: ${String(error)}`)
4957
4918
  * // In real applications, might trigger alerts or notifications
4958
4919
  * } else {
4959
- * yield* Console.log(`ℹ️ Regular error: ${String(error)}`)
4920
+ * yield* Console.log(`Regular error: ${String(error)}`)
4960
4921
  * }
4961
4922
  * })
4962
4923
  * )
@@ -4990,14 +4951,14 @@ export const tapInput: {
4990
4951
  * ),
4991
4952
  * Schedule.tapInput((error: RetryError) =>
4992
4953
  * String(error).length > 20
4993
- * ? Console.log("📝 Long error message detected")
4954
+ * ? Console.log("Long error message detected")
4994
4955
  * : Effect.void
4995
4956
  * )
4996
4957
  * )
4997
4958
  * ```
4998
4959
  *
4999
- * @since 2.0.0
5000
4960
  * @category sequencing
4961
+ * @since 2.0.0
5001
4962
  */
5002
4963
  <Input, X, Error2, Env2>(f: (input: Input) => Effect<X, Error2, Env2>): <Output, Error, Env>(
5003
4964
  self: Schedule<Output, Input, Error, Env>
@@ -5007,7 +4968,8 @@ export const tapInput: {
5007
4968
  * every input to the schedule, but does not alter the inputs and outputs of
5008
4969
  * the schedule.
5009
4970
  *
5010
- * @example
4971
+ * **Example** (Tapping retry inputs)
4972
+ *
5011
4973
  * ```ts
5012
4974
  * import { Console, Data, Effect, Schedule } from "effect"
5013
4975
  *
@@ -5043,7 +5005,6 @@ export const tapInput: {
5043
5005
  * Schedule.take(5),
5044
5006
  * Schedule.tapInput((input: unknown) =>
5045
5007
  * Effect.gen(function*() {
5046
- * yield* Console.log(`Processing input at ${new Date().toISOString()}`)
5047
5008
  * yield* Console.log(`Input type: ${typeof input}`)
5048
5009
  * // In real applications, might send metrics to monitoring system
5049
5010
  * })
@@ -5065,10 +5026,13 @@ export const tapInput: {
5065
5026
  * )
5066
5027
  *
5067
5028
  * const validationProgram = Effect.gen(function*() {
5029
+ * let count = 0
5030
+ *
5068
5031
  * yield* Effect.repeat(
5069
5032
  * Effect.gen(function*() {
5033
+ * count++
5070
5034
  * yield* Console.log("Task with validation")
5071
- * return { data: Math.random(), timestamp: Date.now() }
5035
+ * return { data: `sample-${count}` }
5072
5036
  * }),
5073
5037
  * validatingSchedule
5074
5038
  * )
@@ -5080,10 +5044,10 @@ export const tapInput: {
5080
5044
  * Schedule.tapInput((error: RetryError) =>
5081
5045
  * Effect.gen(function*() {
5082
5046
  * if (String(error).includes("critical")) {
5083
- * yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
5047
+ * yield* Console.log(`Critical error: ${String(error)}`)
5084
5048
  * // In real applications, might trigger alerts or notifications
5085
5049
  * } else {
5086
- * yield* Console.log(`ℹ️ Regular error: ${String(error)}`)
5050
+ * yield* Console.log(`Regular error: ${String(error)}`)
5087
5051
  * }
5088
5052
  * })
5089
5053
  * )
@@ -5117,14 +5081,14 @@ export const tapInput: {
5117
5081
  * ),
5118
5082
  * Schedule.tapInput((error: RetryError) =>
5119
5083
  * String(error).length > 20
5120
- * ? Console.log("📝 Long error message detected")
5084
+ * ? Console.log("Long error message detected")
5121
5085
  * : Effect.void
5122
5086
  * )
5123
5087
  * )
5124
5088
  * ```
5125
5089
  *
5126
- * @since 2.0.0
5127
5090
  * @category sequencing
5091
+ * @since 2.0.0
5128
5092
  */
5129
5093
  <Output, Input, Error, Env, X, Error2, Env2>(
5130
5094
  self: Schedule<Output, Input, Error, Env>,
@@ -5144,7 +5108,8 @@ export const tapInput: {
5144
5108
  * every output of the schedule, but does not alter the inputs and outputs of
5145
5109
  * the schedule.
5146
5110
  *
5147
- * @example
5111
+ * **Example** (Tapping schedule outputs)
5112
+ *
5148
5113
  * ```ts
5149
5114
  * import { Console, Data, Effect, Schedule } from "effect"
5150
5115
  *
@@ -5192,7 +5157,7 @@ export const tapInput: {
5192
5157
  * Effect.gen(function*() {
5193
5158
  * const delayMs = delay.toString()
5194
5159
  * if (delayMs.includes("1000")) { // Alert on delays >= 1 second
5195
- * yield* Console.log(`🚨 High delay detected: ${delay}`)
5160
+ * yield* Console.log(`High delay detected: ${delay}`)
5196
5161
  * }
5197
5162
  * })
5198
5163
  * )
@@ -5202,8 +5167,7 @@ export const tapInput: {
5202
5167
  * yield* Effect.repeat(
5203
5168
  * Effect.gen(function*() {
5204
5169
  * yield* Console.log("Performing health check...")
5205
- * // Simulate health check
5206
- * return Math.random() > 0.7 ? "healthy" : "degraded"
5170
+ * return "healthy"
5207
5171
  * }),
5208
5172
  * alertingSchedule
5209
5173
  * )
@@ -5215,14 +5179,14 @@ export const tapInput: {
5215
5179
  * Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
5216
5180
  * Schedule.tapOutput((count) =>
5217
5181
  * count % 3 === 0
5218
- * ? Console.log("🎯 Checkpoint reached!")
5182
+ * ? Console.log("Checkpoint reached")
5219
5183
  * : Effect.void
5220
5184
  * )
5221
5185
  * )
5222
5186
  * ```
5223
5187
  *
5224
- * @since 2.0.0
5225
5188
  * @category sequencing
5189
+ * @since 2.0.0
5226
5190
  */
5227
5191
  export const tapOutput: {
5228
5192
  /**
@@ -5230,7 +5194,8 @@ export const tapOutput: {
5230
5194
  * every output of the schedule, but does not alter the inputs and outputs of
5231
5195
  * the schedule.
5232
5196
  *
5233
- * @example
5197
+ * **Example** (Tapping schedule outputs)
5198
+ *
5234
5199
  * ```ts
5235
5200
  * import { Console, Data, Effect, Schedule } from "effect"
5236
5201
  *
@@ -5278,7 +5243,7 @@ export const tapOutput: {
5278
5243
  * Effect.gen(function*() {
5279
5244
  * const delayMs = delay.toString()
5280
5245
  * if (delayMs.includes("1000")) { // Alert on delays >= 1 second
5281
- * yield* Console.log(`🚨 High delay detected: ${delay}`)
5246
+ * yield* Console.log(`High delay detected: ${delay}`)
5282
5247
  * }
5283
5248
  * })
5284
5249
  * )
@@ -5288,8 +5253,7 @@ export const tapOutput: {
5288
5253
  * yield* Effect.repeat(
5289
5254
  * Effect.gen(function*() {
5290
5255
  * yield* Console.log("Performing health check...")
5291
- * // Simulate health check
5292
- * return Math.random() > 0.7 ? "healthy" : "degraded"
5256
+ * return "healthy"
5293
5257
  * }),
5294
5258
  * alertingSchedule
5295
5259
  * )
@@ -5301,14 +5265,14 @@ export const tapOutput: {
5301
5265
  * Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
5302
5266
  * Schedule.tapOutput((count) =>
5303
5267
  * count % 3 === 0
5304
- * ? Console.log("🎯 Checkpoint reached!")
5268
+ * ? Console.log("Checkpoint reached")
5305
5269
  * : Effect.void
5306
5270
  * )
5307
5271
  * )
5308
5272
  * ```
5309
5273
  *
5310
- * @since 2.0.0
5311
5274
  * @category sequencing
5275
+ * @since 2.0.0
5312
5276
  */
5313
5277
  <Output, X, Error2, Env2>(f: (output: Output) => Effect<X, Error2, Env2>): <Input, Error, Env>(
5314
5278
  self: Schedule<Output, Input, Error, Env>
@@ -5318,7 +5282,8 @@ export const tapOutput: {
5318
5282
  * every output of the schedule, but does not alter the inputs and outputs of
5319
5283
  * the schedule.
5320
5284
  *
5321
- * @example
5285
+ * **Example** (Tapping schedule outputs)
5286
+ *
5322
5287
  * ```ts
5323
5288
  * import { Console, Data, Effect, Schedule } from "effect"
5324
5289
  *
@@ -5366,7 +5331,7 @@ export const tapOutput: {
5366
5331
  * Effect.gen(function*() {
5367
5332
  * const delayMs = delay.toString()
5368
5333
  * if (delayMs.includes("1000")) { // Alert on delays >= 1 second
5369
- * yield* Console.log(`🚨 High delay detected: ${delay}`)
5334
+ * yield* Console.log(`High delay detected: ${delay}`)
5370
5335
  * }
5371
5336
  * })
5372
5337
  * )
@@ -5376,8 +5341,7 @@ export const tapOutput: {
5376
5341
  * yield* Effect.repeat(
5377
5342
  * Effect.gen(function*() {
5378
5343
  * yield* Console.log("Performing health check...")
5379
- * // Simulate health check
5380
- * return Math.random() > 0.7 ? "healthy" : "degraded"
5344
+ * return "healthy"
5381
5345
  * }),
5382
5346
  * alertingSchedule
5383
5347
  * )
@@ -5389,14 +5353,14 @@ export const tapOutput: {
5389
5353
  * Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
5390
5354
  * Schedule.tapOutput((count) =>
5391
5355
  * count % 3 === 0
5392
- * ? Console.log("🎯 Checkpoint reached!")
5356
+ * ? Console.log("Checkpoint reached")
5393
5357
  * : Effect.void
5394
5358
  * )
5395
5359
  * )
5396
5360
  * ```
5397
5361
  *
5398
- * @since 2.0.0
5399
5362
  * @category sequencing
5363
+ * @since 2.0.0
5400
5364
  */
5401
5365
  <Output, Input, Error, Env, X, Error2, Env2>(
5402
5366
  self: Schedule<Output, Input, Error, Env>,
@@ -5416,7 +5380,8 @@ export const tapOutput: {
5416
5380
  * from the schedule. Once the specified number of outputs is reached, the
5417
5381
  * schedule will stop.
5418
5382
  *
5419
- * @example
5383
+ * **Example** (Taking a limited number of recurrences)
5384
+ *
5420
5385
  * ```ts
5421
5386
  * import { Console, Data, Effect, Schedule } from "effect"
5422
5387
  *
@@ -5430,7 +5395,7 @@ export const tapOutput: {
5430
5395
  * const heartbeatProgram = Effect.gen(function*() {
5431
5396
  * yield* Effect.repeat(
5432
5397
  * Effect.gen(function*() {
5433
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
5398
+ * yield* Console.log("Heartbeat")
5434
5399
  * return "pulse"
5435
5400
  * }),
5436
5401
  * limitedHeartbeat
@@ -5477,8 +5442,8 @@ export const tapOutput: {
5477
5442
  * const samplingProgram = Effect.gen(function*() {
5478
5443
  * yield* Effect.repeat(
5479
5444
  * Effect.gen(function*() {
5480
- * const value = Math.random()
5481
- * yield* Console.log(`Sampled value: ${value.toFixed(3)}`)
5445
+ * const value = "sample"
5446
+ * yield* Console.log(`Sampled value: ${value}`)
5482
5447
  * return value
5483
5448
  * }),
5484
5449
  * samplingSchedule.pipe(
@@ -5488,8 +5453,8 @@ export const tapOutput: {
5488
5453
  * })
5489
5454
  * ```
5490
5455
  *
5491
- * @since 2.0.0
5492
- * @category utilities
5456
+ * @category utils
5457
+ * @since 4.0.0
5493
5458
  */
5494
5459
  export const take: {
5495
5460
  /**
@@ -5497,7 +5462,8 @@ export const take: {
5497
5462
  * from the schedule. Once the specified number of outputs is reached, the
5498
5463
  * schedule will stop.
5499
5464
  *
5500
- * @example
5465
+ * **Example** (Taking a limited number of recurrences)
5466
+ *
5501
5467
  * ```ts
5502
5468
  * import { Console, Data, Effect, Schedule } from "effect"
5503
5469
  *
@@ -5511,7 +5477,7 @@ export const take: {
5511
5477
  * const heartbeatProgram = Effect.gen(function*() {
5512
5478
  * yield* Effect.repeat(
5513
5479
  * Effect.gen(function*() {
5514
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
5480
+ * yield* Console.log("Heartbeat")
5515
5481
  * return "pulse"
5516
5482
  * }),
5517
5483
  * limitedHeartbeat
@@ -5558,8 +5524,8 @@ export const take: {
5558
5524
  * const samplingProgram = Effect.gen(function*() {
5559
5525
  * yield* Effect.repeat(
5560
5526
  * Effect.gen(function*() {
5561
- * const value = Math.random()
5562
- * yield* Console.log(`Sampled value: ${value.toFixed(3)}`)
5527
+ * const value = "sample"
5528
+ * yield* Console.log(`Sampled value: ${value}`)
5563
5529
  * return value
5564
5530
  * }),
5565
5531
  * samplingSchedule.pipe(
@@ -5569,8 +5535,8 @@ export const take: {
5569
5535
  * })
5570
5536
  * ```
5571
5537
  *
5572
- * @since 2.0.0
5573
- * @category utilities
5538
+ * @category utils
5539
+ * @since 4.0.0
5574
5540
  */
5575
5541
  (n: number): <Output, Input, Error, Env>(
5576
5542
  self: Schedule<Output, Input, Error, Env>
@@ -5580,7 +5546,8 @@ export const take: {
5580
5546
  * from the schedule. Once the specified number of outputs is reached, the
5581
5547
  * schedule will stop.
5582
5548
  *
5583
- * @example
5549
+ * **Example** (Taking a limited number of recurrences)
5550
+ *
5584
5551
  * ```ts
5585
5552
  * import { Console, Data, Effect, Schedule } from "effect"
5586
5553
  *
@@ -5594,7 +5561,7 @@ export const take: {
5594
5561
  * const heartbeatProgram = Effect.gen(function*() {
5595
5562
  * yield* Effect.repeat(
5596
5563
  * Effect.gen(function*() {
5597
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
5564
+ * yield* Console.log("Heartbeat")
5598
5565
  * return "pulse"
5599
5566
  * }),
5600
5567
  * limitedHeartbeat
@@ -5641,8 +5608,8 @@ export const take: {
5641
5608
  * const samplingProgram = Effect.gen(function*() {
5642
5609
  * yield* Effect.repeat(
5643
5610
  * Effect.gen(function*() {
5644
- * const value = Math.random()
5645
- * yield* Console.log(`Sampled value: ${value.toFixed(3)}`)
5611
+ * const value = "sample"
5612
+ * yield* Console.log(`Sampled value: ${value}`)
5646
5613
  * return value
5647
5614
  * }),
5648
5615
  * samplingSchedule.pipe(
@@ -5652,8 +5619,8 @@ export const take: {
5652
5619
  * })
5653
5620
  * ```
5654
5621
  *
5655
- * @since 2.0.0
5656
- * @category utilities
5622
+ * @category utils
5623
+ * @since 4.0.0
5657
5624
  */
5658
5625
  <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>, n: number): Schedule<Output, Input, Error, Env>
5659
5626
  } = dual(2, <Output, Input, Error, Env>(
@@ -5665,7 +5632,8 @@ export const take: {
5665
5632
  * Creates a schedule that unfolds a state by repeatedly applying a function,
5666
5633
  * outputting the current state and computing the next state.
5667
5634
  *
5668
- * @example
5635
+ * **Example** (Unfolding schedule state)
5636
+ *
5669
5637
  * ```ts
5670
5638
  * import { Console, Effect, Schedule } from "effect"
5671
5639
  *
@@ -5713,15 +5681,14 @@ export const take: {
5713
5681
  * })
5714
5682
  * )
5715
5683
  *
5716
- * // Random jitter schedule
5717
- * const jitteredSchedule = Schedule.unfold(
5718
- * 1000,
5719
- * (baseDelay) =>
5684
+ * // Deterministic delay adjustment schedule
5685
+ * const adjustedDelaySchedule = Schedule.unfold(
5686
+ * { delay: 1000, adjustment: 100 },
5687
+ * ({ delay, adjustment }) =>
5720
5688
  * Effect.gen(function*() {
5721
- * const jitter = Math.random() * 200 - 100 // ±100ms jitter
5722
- * const nextDelay = Math.max(100, baseDelay + jitter)
5723
- * yield* Console.log(`Jittered delay: ${nextDelay.toFixed(0)}ms`)
5724
- * return nextDelay
5689
+ * const nextDelay = Math.max(100, delay + adjustment)
5690
+ * yield* Console.log(`Adjusted delay: ${nextDelay}ms`)
5691
+ * return { delay: nextDelay, adjustment: adjustment * -1 }
5725
5692
  * })
5726
5693
  * )
5727
5694
  *
@@ -5754,8 +5721,8 @@ export const take: {
5754
5721
  * })
5755
5722
  * ```
5756
5723
  *
5757
- * @since 2.0.0
5758
5724
  * @category constructors
5725
+ * @since 2.0.0
5759
5726
  */
5760
5727
  export const unfold = <State, Error = never, Env = never>(
5761
5728
  initial: State,
@@ -5814,8 +5781,8 @@ export {
5814
5781
  * If the `predicate` returns `true`, the schedule will continue, otherwise
5815
5782
  * the schedule will stop.
5816
5783
  *
5817
- * @since 2.0.0
5818
- * @category utilities
5784
+ * @category utils
5785
+ * @since 4.0.0
5819
5786
  */
5820
5787
  while_ as while
5821
5788
  }
@@ -5833,7 +5800,8 @@ export {
5833
5800
  * |action------|sleep---|act|-sleep|action----|
5834
5801
  * ```
5835
5802
  *
5836
- * @example
5803
+ * **Example** (Repeating on aligned windows)
5804
+ *
5837
5805
  * ```ts
5838
5806
  * import { Console, Effect, Schedule } from "effect"
5839
5807
  *
@@ -5843,8 +5811,7 @@ export {
5843
5811
  * const program = Effect.gen(function*() {
5844
5812
  * yield* Effect.repeat(
5845
5813
  * Effect.gen(function*() {
5846
- * const now = new Date().toISOString()
5847
- * yield* Console.log(`Window task executed at: ${now}`)
5814
+ * yield* Console.log("Window task executed")
5848
5815
  * return "window-task"
5849
5816
  * }),
5850
5817
  * windowSchedule.pipe(Schedule.take(4))
@@ -5852,8 +5819,8 @@ export {
5852
5819
  * })
5853
5820
  * ```
5854
5821
  *
5855
- * @since 2.0.0
5856
5822
  * @category constructors
5823
+ * @since 2.0.0
5857
5824
  */
5858
5825
  export const windowed = (interval: Duration.Input): Schedule<number> => {
5859
5826
  const window = Duration.toMillis(Duration.fromInputUnsafe(interval))
@@ -5871,7 +5838,8 @@ export const windowed = (interval: Duration.Input): Schedule<number> => {
5871
5838
  * The output of the schedule is the current count of its repetitions thus far
5872
5839
  * (i.e. `0, 1, 2, ...`).
5873
5840
  *
5874
- * @example
5841
+ * **Example** (Repeating forever)
5842
+ *
5875
5843
  * ```ts
5876
5844
  * import { Console, Effect, Schedule } from "effect"
5877
5845
  *
@@ -5889,8 +5857,8 @@ export const windowed = (interval: Duration.Input): Schedule<number> => {
5889
5857
  * })
5890
5858
  * ```
5891
5859
  *
5892
- * @since 2.0.0
5893
5860
  * @category constructors
5861
+ * @since 2.0.0
5894
5862
  */
5895
5863
  export const forever: Schedule<number> = spaced(Duration.zero)
5896
5864
 
@@ -5910,8 +5878,8 @@ export {
5910
5878
  * without modification. It effectively acts as a pass-through that simply
5911
5879
  * echoes its input values at each step.
5912
5880
  *
5881
+ * @category constructors
5913
5882
  * @since 2.0.0
5914
- * @category Constructors
5915
5883
  */
5916
5884
  identity_ as identity
5917
5885
  }
@@ -5919,7 +5887,8 @@ export {
5919
5887
  /**
5920
5888
  * Ensures that the provided schedule respects a specified input type.
5921
5889
  *
5922
- * @example
5890
+ * **Example** (Constraining schedule input types)
5891
+ *
5923
5892
  * ```ts
5924
5893
  * import { Schedule } from "effect"
5925
5894
  *
@@ -5938,8 +5907,8 @@ export {
5938
5907
  * // where CustomType doesn't match the schedule's input type
5939
5908
  * ```
5940
5909
  *
5941
- * @since 2.0.0
5942
5910
  * @category ensuring types
5911
+ * @since 4.0.0
5943
5912
  */
5944
5913
  export const satisfiesInputType = <T>() =>
5945
5914
  <Input extends T, Output = never, Error = never, Env = never>(
@@ -5950,8 +5919,8 @@ export const satisfiesInputType = <T>() =>
5950
5919
  * Sets the input type of the provided schedule to a specified type, without
5951
5920
  * altering the schedule's behavior.
5952
5921
  *
5953
- * @since 2.0.0
5954
5922
  * @category ensuring types
5923
+ * @since 4.0.0
5955
5924
  */
5956
5925
  export const setInputType =
5957
5926
  <T>() => <Output, Error, Env>(self: Schedule<Output, T, Error, Env>): Schedule<Output, T, Error, Env> => self
@@ -5959,7 +5928,8 @@ export const setInputType =
5959
5928
  /**
5960
5929
  * Ensures that the provided schedule respects a specified output type.
5961
5930
  *
5962
- * @example
5931
+ * **Example** (Constraining schedule output types)
5932
+ *
5963
5933
  * ```ts
5964
5934
  * import { Effect, Schedule } from "effect"
5965
5935
  *
@@ -5973,8 +5943,8 @@ export const setInputType =
5973
5943
  * )
5974
5944
  * ```
5975
5945
  *
5976
- * @since 2.0.0
5977
5946
  * @category ensuring types
5947
+ * @since 4.0.0
5978
5948
  */
5979
5949
  export const satisfiesOutputType = <T>() =>
5980
5950
  <Output extends T, Error = never, Input = unknown, Env = never>(
@@ -5984,7 +5954,8 @@ export const satisfiesOutputType = <T>() =>
5984
5954
  /**
5985
5955
  * Ensures that the provided schedule respects a specified error type.
5986
5956
  *
5987
- * @example
5957
+ * **Example** (Constraining schedule error types)
5958
+ *
5988
5959
  * ```ts
5989
5960
  * import { Data, Schedule } from "effect"
5990
5961
  *
@@ -6004,8 +5975,8 @@ export const satisfiesOutputType = <T>() =>
6004
5975
  * )
6005
5976
  * ```
6006
5977
  *
6007
- * @since 2.0.0
6008
5978
  * @category ensuring types
5979
+ * @since 4.0.0
6009
5980
  */
6010
5981
  export const satisfiesErrorType = <T>() =>
6011
5982
  <Error extends T, Output = never, Input = unknown, Env = never>(
@@ -6015,9 +5986,10 @@ export const satisfiesErrorType = <T>() =>
6015
5986
  /**
6016
5987
  * Ensures that the provided schedule respects a specified context type.
6017
5988
  *
6018
- * @example
5989
+ * **Example** (Constraining schedule service types)
5990
+ *
6019
5991
  * ```ts
6020
- * import { Schedule } from "effect"
5992
+ * import { Effect, Schedule } from "effect"
6021
5993
  *
6022
5994
  * // Define service interfaces (type-level only)
6023
5995
  * interface Logger {
@@ -6025,7 +5997,7 @@ export const satisfiesErrorType = <T>() =>
6025
5997
  * }
6026
5998
  *
6027
5999
  * interface Database {
6028
- * readonly query: (sql: string) => Promise<unknown>
6000
+ * readonly query: (sql: string) => Effect.Effect<ReadonlyArray<unknown>>
6029
6001
  * }
6030
6002
  *
6031
6003
  * // Ensure schedule requires Logger service
@@ -6039,8 +6011,8 @@ export const satisfiesErrorType = <T>() =>
6039
6011
  * )
6040
6012
  * ```
6041
6013
  *
6042
- * @since 2.0.0
6043
6014
  * @category ensuring types
6015
+ * @since 4.0.0
6044
6016
  */
6045
6017
  export const satisfiesServicesType = <T>() =>
6046
6018
  <Env extends T, Output = never, Input = unknown, Error = never>(