effect 4.0.0-beta.66 → 4.0.0-beta.67

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 (1633) hide show
  1. package/dist/Array.d.ts +113 -67
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +28 -18
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +404 -337
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +190 -146
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +167 -97
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +87 -47
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +62 -31
  14. package/dist/Boolean.d.ts.map +1 -1
  15. package/dist/Boolean.js +30 -15
  16. package/dist/Boolean.js.map +1 -1
  17. package/dist/Brand.d.ts +20 -1
  18. package/dist/Brand.d.ts.map +1 -1
  19. package/dist/Brand.js +16 -0
  20. package/dist/Brand.js.map +1 -1
  21. package/dist/Cache.d.ts +236 -132
  22. package/dist/Cache.d.ts.map +1 -1
  23. package/dist/Cache.js +133 -57
  24. package/dist/Cache.js.map +1 -1
  25. package/dist/Cause.d.ts +74 -62
  26. package/dist/Cause.d.ts.map +1 -1
  27. package/dist/Cause.js +43 -36
  28. package/dist/Cause.js.map +1 -1
  29. package/dist/Channel.d.ts +1518 -575
  30. package/dist/Channel.d.ts.map +1 -1
  31. package/dist/Channel.js +661 -287
  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 +548 -379
  38. package/dist/Chunk.d.ts.map +1 -1
  39. package/dist/Chunk.js +238 -170
  40. package/dist/Chunk.js.map +1 -1
  41. package/dist/Clock.d.ts +15 -8
  42. package/dist/Clock.d.ts.map +1 -1
  43. package/dist/Clock.js +8 -4
  44. package/dist/Clock.js.map +1 -1
  45. package/dist/Combiner.d.ts +2 -4
  46. package/dist/Combiner.d.ts.map +1 -1
  47. package/dist/Combiner.js +2 -4
  48. package/dist/Combiner.js.map +1 -1
  49. package/dist/Config.d.ts +4 -2
  50. package/dist/Config.d.ts.map +1 -1
  51. package/dist/Config.js +2 -2
  52. package/dist/Config.js.map +1 -1
  53. package/dist/ConfigProvider.d.ts +1 -1
  54. package/dist/ConfigProvider.js +1 -1
  55. package/dist/Console.d.ts +76 -50
  56. package/dist/Console.d.ts.map +1 -1
  57. package/dist/Console.js +69 -46
  58. package/dist/Console.js.map +1 -1
  59. package/dist/Context.d.ts +383 -134
  60. package/dist/Context.d.ts.map +1 -1
  61. package/dist/Context.js +134 -54
  62. package/dist/Context.js.map +1 -1
  63. package/dist/Cron.d.ts +69 -48
  64. package/dist/Cron.d.ts.map +1 -1
  65. package/dist/Cron.js +96 -36
  66. package/dist/Cron.js.map +1 -1
  67. package/dist/Data.d.ts +3 -2
  68. package/dist/Data.d.ts.map +1 -1
  69. package/dist/Data.js.map +1 -1
  70. package/dist/DateTime.d.ts +874 -443
  71. package/dist/DateTime.d.ts.map +1 -1
  72. package/dist/DateTime.js +374 -215
  73. package/dist/DateTime.js.map +1 -1
  74. package/dist/Deferred.d.ts +367 -174
  75. package/dist/Deferred.d.ts.map +1 -1
  76. package/dist/Deferred.js +145 -71
  77. package/dist/Deferred.js.map +1 -1
  78. package/dist/Differ.d.ts +42 -0
  79. package/dist/Differ.d.ts.map +1 -1
  80. package/dist/Differ.js +36 -0
  81. package/dist/Duration.d.ts +329 -185
  82. package/dist/Duration.d.ts.map +1 -1
  83. package/dist/Duration.js +174 -106
  84. package/dist/Duration.js.map +1 -1
  85. package/dist/Effect.d.ts +2109 -1945
  86. package/dist/Effect.d.ts.map +1 -1
  87. package/dist/Effect.js +901 -726
  88. package/dist/Effect.js.map +1 -1
  89. package/dist/Effectable.d.ts +37 -2
  90. package/dist/Effectable.d.ts.map +1 -1
  91. package/dist/Effectable.js +2 -2
  92. package/dist/Effectable.js.map +1 -1
  93. package/dist/Encoding.d.ts +78 -28
  94. package/dist/Encoding.d.ts.map +1 -1
  95. package/dist/Encoding.js +75 -27
  96. package/dist/Encoding.js.map +1 -1
  97. package/dist/Equivalence.d.ts +14 -19
  98. package/dist/Equivalence.d.ts.map +1 -1
  99. package/dist/Equivalence.js +14 -19
  100. package/dist/Equivalence.js.map +1 -1
  101. package/dist/ErrorReporter.d.ts +66 -82
  102. package/dist/ErrorReporter.d.ts.map +1 -1
  103. package/dist/ErrorReporter.js +38 -29
  104. package/dist/ErrorReporter.js.map +1 -1
  105. package/dist/ExecutionPlan.d.ts +94 -9
  106. package/dist/ExecutionPlan.d.ts.map +1 -1
  107. package/dist/ExecutionPlan.js +20 -5
  108. package/dist/ExecutionPlan.js.map +1 -1
  109. package/dist/Exit.d.ts +7 -5
  110. package/dist/Exit.d.ts.map +1 -1
  111. package/dist/Exit.js.map +1 -1
  112. package/dist/Fiber.d.ts +72 -40
  113. package/dist/Fiber.d.ts.map +1 -1
  114. package/dist/Fiber.js +39 -21
  115. package/dist/Fiber.js.map +1 -1
  116. package/dist/FiberHandle.d.ts +117 -56
  117. package/dist/FiberHandle.d.ts.map +1 -1
  118. package/dist/FiberHandle.js +120 -38
  119. package/dist/FiberHandle.js.map +1 -1
  120. package/dist/FiberMap.d.ts +286 -158
  121. package/dist/FiberMap.d.ts.map +1 -1
  122. package/dist/FiberMap.js +174 -72
  123. package/dist/FiberMap.js.map +1 -1
  124. package/dist/FiberSet.d.ts +92 -51
  125. package/dist/FiberSet.d.ts.map +1 -1
  126. package/dist/FiberSet.js +96 -33
  127. package/dist/FiberSet.js.map +1 -1
  128. package/dist/FileSystem.d.ts +104 -73
  129. package/dist/FileSystem.d.ts.map +1 -1
  130. package/dist/FileSystem.js +53 -39
  131. package/dist/FileSystem.js.map +1 -1
  132. package/dist/Filter.d.ts +166 -88
  133. package/dist/Filter.d.ts.map +1 -1
  134. package/dist/Filter.js +68 -42
  135. package/dist/Filter.js.map +1 -1
  136. package/dist/Function.d.ts +154 -86
  137. package/dist/Function.d.ts.map +1 -1
  138. package/dist/Function.js +53 -37
  139. package/dist/Function.js.map +1 -1
  140. package/dist/Graph.d.ts +682 -365
  141. package/dist/Graph.d.ts.map +1 -1
  142. package/dist/Graph.js +308 -157
  143. package/dist/Graph.js.map +1 -1
  144. package/dist/HKT.d.ts +29 -13
  145. package/dist/HKT.d.ts.map +1 -1
  146. package/dist/Hash.d.ts +31 -18
  147. package/dist/Hash.d.ts.map +1 -1
  148. package/dist/Hash.js +25 -15
  149. package/dist/Hash.js.map +1 -1
  150. package/dist/HashMap.d.ts +444 -256
  151. package/dist/HashMap.d.ts.map +1 -1
  152. package/dist/HashMap.js +223 -105
  153. package/dist/HashMap.js.map +1 -1
  154. package/dist/HashRing.d.ts +36 -17
  155. package/dist/HashRing.d.ts.map +1 -1
  156. package/dist/HashRing.js +75 -8
  157. package/dist/HashRing.js.map +1 -1
  158. package/dist/HashSet.d.ts +194 -104
  159. package/dist/HashSet.d.ts.map +1 -1
  160. package/dist/HashSet.js +93 -38
  161. package/dist/HashSet.js.map +1 -1
  162. package/dist/Inspectable.d.ts +20 -9
  163. package/dist/Inspectable.d.ts.map +1 -1
  164. package/dist/Inspectable.js +16 -6
  165. package/dist/Inspectable.js.map +1 -1
  166. package/dist/Iterable.d.ts +309 -149
  167. package/dist/Iterable.d.ts.map +1 -1
  168. package/dist/Iterable.js +129 -65
  169. package/dist/Iterable.js.map +1 -1
  170. package/dist/JsonPatch.d.ts +4 -3
  171. package/dist/JsonPatch.d.ts.map +1 -1
  172. package/dist/JsonPatch.js +4 -3
  173. package/dist/JsonPatch.js.map +1 -1
  174. package/dist/Latch.d.ts +98 -15
  175. package/dist/Latch.d.ts.map +1 -1
  176. package/dist/Latch.js +41 -10
  177. package/dist/Latch.js.map +1 -1
  178. package/dist/Layer.d.ts +412 -309
  179. package/dist/Layer.d.ts.map +1 -1
  180. package/dist/Layer.js +261 -180
  181. package/dist/Layer.js.map +1 -1
  182. package/dist/LayerMap.d.ts +95 -21
  183. package/dist/LayerMap.d.ts.map +1 -1
  184. package/dist/LayerMap.js +55 -11
  185. package/dist/LayerMap.js.map +1 -1
  186. package/dist/LogLevel.d.ts +92 -131
  187. package/dist/LogLevel.d.ts.map +1 -1
  188. package/dist/LogLevel.js +25 -15
  189. package/dist/LogLevel.js.map +1 -1
  190. package/dist/Logger.d.ts +155 -99
  191. package/dist/Logger.d.ts.map +1 -1
  192. package/dist/Logger.js +211 -184
  193. package/dist/Logger.js.map +1 -1
  194. package/dist/ManagedRuntime.d.ts +75 -17
  195. package/dist/ManagedRuntime.d.ts.map +1 -1
  196. package/dist/ManagedRuntime.js +22 -16
  197. package/dist/ManagedRuntime.js.map +1 -1
  198. package/dist/Match.d.ts +133 -157
  199. package/dist/Match.d.ts.map +1 -1
  200. package/dist/Match.js +85 -76
  201. package/dist/Match.js.map +1 -1
  202. package/dist/Metric.d.ts +325 -284
  203. package/dist/Metric.d.ts.map +1 -1
  204. package/dist/Metric.js +217 -212
  205. package/dist/Metric.js.map +1 -1
  206. package/dist/MutableHashMap.d.ts +117 -58
  207. package/dist/MutableHashMap.d.ts.map +1 -1
  208. package/dist/MutableHashMap.js +52 -29
  209. package/dist/MutableHashMap.js.map +1 -1
  210. package/dist/MutableHashSet.d.ts +52 -30
  211. package/dist/MutableHashSet.d.ts.map +1 -1
  212. package/dist/MutableHashSet.js +94 -38
  213. package/dist/MutableHashSet.js.map +1 -1
  214. package/dist/MutableList.d.ts +92 -49
  215. package/dist/MutableList.d.ts.map +1 -1
  216. package/dist/MutableList.js +123 -71
  217. package/dist/MutableList.js.map +1 -1
  218. package/dist/MutableRef.d.ts +99 -62
  219. package/dist/MutableRef.d.ts.map +1 -1
  220. package/dist/MutableRef.js +79 -60
  221. package/dist/MutableRef.js.map +1 -1
  222. package/dist/Newtype.d.ts +3 -0
  223. package/dist/Newtype.d.ts.map +1 -1
  224. package/dist/Newtype.js.map +1 -1
  225. package/dist/NonEmptyIterable.d.ts +36 -39
  226. package/dist/NonEmptyIterable.d.ts.map +1 -1
  227. package/dist/NonEmptyIterable.js +34 -20
  228. package/dist/NonEmptyIterable.js.map +1 -1
  229. package/dist/Number.d.ts +116 -64
  230. package/dist/Number.d.ts.map +1 -1
  231. package/dist/Number.js +54 -30
  232. package/dist/Number.js.map +1 -1
  233. package/dist/Optic.d.ts +1 -2
  234. package/dist/Optic.d.ts.map +1 -1
  235. package/dist/Optic.js +0 -1
  236. package/dist/Optic.js.map +1 -1
  237. package/dist/Option.d.ts +28 -47
  238. package/dist/Option.d.ts.map +1 -1
  239. package/dist/Option.js +14 -12
  240. package/dist/Option.js.map +1 -1
  241. package/dist/Ordering.d.ts +43 -28
  242. package/dist/Ordering.d.ts.map +1 -1
  243. package/dist/Ordering.js +4 -2
  244. package/dist/Ordering.js.map +1 -1
  245. package/dist/PartitionedSemaphore.d.ts +225 -40
  246. package/dist/PartitionedSemaphore.d.ts.map +1 -1
  247. package/dist/PartitionedSemaphore.js +113 -17
  248. package/dist/PartitionedSemaphore.js.map +1 -1
  249. package/dist/Path.d.ts +77 -13
  250. package/dist/Path.d.ts.map +1 -1
  251. package/dist/Path.js +48 -4
  252. package/dist/Path.js.map +1 -1
  253. package/dist/Pipeable.d.ts +71 -15
  254. package/dist/Pipeable.d.ts.map +1 -1
  255. package/dist/Pipeable.js +59 -12
  256. package/dist/Pipeable.js.map +1 -1
  257. package/dist/PlatformError.d.ts +74 -6
  258. package/dist/PlatformError.d.ts.map +1 -1
  259. package/dist/PlatformError.js +68 -5
  260. package/dist/PlatformError.js.map +1 -1
  261. package/dist/Pool.d.ts +66 -31
  262. package/dist/Pool.d.ts.map +1 -1
  263. package/dist/Pool.js +26 -24
  264. package/dist/Pool.js.map +1 -1
  265. package/dist/Predicate.d.ts +16 -21
  266. package/dist/Predicate.d.ts.map +1 -1
  267. package/dist/Predicate.js +9 -14
  268. package/dist/Predicate.js.map +1 -1
  269. package/dist/PrimaryKey.d.ts +9 -2
  270. package/dist/PrimaryKey.d.ts.map +1 -1
  271. package/dist/PrimaryKey.js +7 -1
  272. package/dist/PrimaryKey.js.map +1 -1
  273. package/dist/PubSub.d.ts +364 -262
  274. package/dist/PubSub.d.ts.map +1 -1
  275. package/dist/PubSub.js +245 -174
  276. package/dist/PubSub.js.map +1 -1
  277. package/dist/Pull.d.ts +94 -25
  278. package/dist/Pull.d.ts.map +1 -1
  279. package/dist/Pull.js +61 -13
  280. package/dist/Pull.js.map +1 -1
  281. package/dist/Queue.d.ts +284 -150
  282. package/dist/Queue.d.ts.map +1 -1
  283. package/dist/Queue.js +216 -113
  284. package/dist/Queue.js.map +1 -1
  285. package/dist/Random.d.ts +54 -35
  286. package/dist/Random.d.ts.map +1 -1
  287. package/dist/Random.js +36 -24
  288. package/dist/Random.js.map +1 -1
  289. package/dist/RcMap.d.ts +151 -141
  290. package/dist/RcMap.d.ts.map +1 -1
  291. package/dist/RcMap.js +66 -20
  292. package/dist/RcMap.js.map +1 -1
  293. package/dist/RcRef.d.ts +69 -32
  294. package/dist/RcRef.d.ts.map +1 -1
  295. package/dist/RcRef.js +33 -16
  296. package/dist/RcRef.js.map +1 -1
  297. package/dist/Record.d.ts +273 -129
  298. package/dist/Record.d.ts.map +1 -1
  299. package/dist/Record.js +117 -57
  300. package/dist/Record.js.map +1 -1
  301. package/dist/Redactable.d.ts +3 -3
  302. package/dist/Redactable.js +2 -2
  303. package/dist/Redacted.d.ts +63 -33
  304. package/dist/Redacted.d.ts.map +1 -1
  305. package/dist/Redacted.js +30 -14
  306. package/dist/Redacted.js.map +1 -1
  307. package/dist/Ref.d.ts +81 -52
  308. package/dist/Ref.d.ts.map +1 -1
  309. package/dist/Ref.js +54 -35
  310. package/dist/Ref.js.map +1 -1
  311. package/dist/References.d.ts +73 -31
  312. package/dist/References.d.ts.map +1 -1
  313. package/dist/References.js +66 -30
  314. package/dist/References.js.map +1 -1
  315. package/dist/RegExp.d.ts +11 -5
  316. package/dist/RegExp.d.ts.map +1 -1
  317. package/dist/RegExp.js +11 -5
  318. package/dist/RegExp.js.map +1 -1
  319. package/dist/Request.d.ts +158 -34
  320. package/dist/Request.d.ts.map +1 -1
  321. package/dist/Request.js +67 -12
  322. package/dist/Request.js.map +1 -1
  323. package/dist/RequestResolver.d.ts +261 -116
  324. package/dist/RequestResolver.d.ts.map +1 -1
  325. package/dist/RequestResolver.js +77 -41
  326. package/dist/RequestResolver.js.map +1 -1
  327. package/dist/Resource.d.ts +13 -7
  328. package/dist/Resource.d.ts.map +1 -1
  329. package/dist/Resource.js +44 -6
  330. package/dist/Resource.js.map +1 -1
  331. package/dist/Result.d.ts +16 -14
  332. package/dist/Result.d.ts.map +1 -1
  333. package/dist/Result.js +6 -6
  334. package/dist/Result.js.map +1 -1
  335. package/dist/Runtime.d.ts +43 -18
  336. package/dist/Runtime.d.ts.map +1 -1
  337. package/dist/Runtime.js +35 -16
  338. package/dist/Runtime.js.map +1 -1
  339. package/dist/Schedule.d.ts +545 -576
  340. package/dist/Schedule.d.ts.map +1 -1
  341. package/dist/Schedule.js +260 -246
  342. package/dist/Schedule.js.map +1 -1
  343. package/dist/Scheduler.d.ts +43 -6
  344. package/dist/Scheduler.d.ts.map +1 -1
  345. package/dist/Scheduler.js +33 -4
  346. package/dist/Scheduler.js.map +1 -1
  347. package/dist/Schema.d.ts +803 -282
  348. package/dist/Schema.d.ts.map +1 -1
  349. package/dist/Schema.js +281 -189
  350. package/dist/Schema.js.map +1 -1
  351. package/dist/SchemaAST.d.ts +24 -15
  352. package/dist/SchemaAST.d.ts.map +1 -1
  353. package/dist/SchemaAST.js +13 -9
  354. package/dist/SchemaAST.js.map +1 -1
  355. package/dist/SchemaGetter.d.ts +26 -13
  356. package/dist/SchemaGetter.d.ts.map +1 -1
  357. package/dist/SchemaGetter.js +22 -9
  358. package/dist/SchemaGetter.js.map +1 -1
  359. package/dist/SchemaIssue.d.ts +1 -8
  360. package/dist/SchemaIssue.d.ts.map +1 -1
  361. package/dist/SchemaIssue.js.map +1 -1
  362. package/dist/SchemaParser.d.ts +194 -25
  363. package/dist/SchemaParser.d.ts.map +1 -1
  364. package/dist/SchemaParser.js +220 -26
  365. package/dist/SchemaParser.js.map +1 -1
  366. package/dist/SchemaTransformation.d.ts +61 -41
  367. package/dist/SchemaTransformation.d.ts.map +1 -1
  368. package/dist/SchemaTransformation.js +56 -33
  369. package/dist/SchemaTransformation.js.map +1 -1
  370. package/dist/SchemaUtils.d.ts +7 -0
  371. package/dist/SchemaUtils.d.ts.map +1 -1
  372. package/dist/SchemaUtils.js +23 -0
  373. package/dist/SchemaUtils.js.map +1 -1
  374. package/dist/Scope.d.ts +102 -43
  375. package/dist/Scope.d.ts.map +1 -1
  376. package/dist/Scope.js +57 -23
  377. package/dist/Scope.js.map +1 -1
  378. package/dist/ScopedCache.d.ts +138 -46
  379. package/dist/ScopedCache.d.ts.map +1 -1
  380. package/dist/ScopedCache.js +80 -19
  381. package/dist/ScopedCache.js.map +1 -1
  382. package/dist/ScopedRef.d.ts +28 -8
  383. package/dist/ScopedRef.d.ts.map +1 -1
  384. package/dist/ScopedRef.js +25 -5
  385. package/dist/ScopedRef.js.map +1 -1
  386. package/dist/Semaphore.d.ts +64 -28
  387. package/dist/Semaphore.d.ts.map +1 -1
  388. package/dist/Semaphore.js +22 -13
  389. package/dist/Semaphore.js.map +1 -1
  390. package/dist/Sink.d.ts +458 -200
  391. package/dist/Sink.d.ts.map +1 -1
  392. package/dist/Sink.js +240 -89
  393. package/dist/Sink.js.map +1 -1
  394. package/dist/Stdio.d.ts +43 -6
  395. package/dist/Stdio.d.ts.map +1 -1
  396. package/dist/Stdio.js +33 -4
  397. package/dist/Stdio.js.map +1 -1
  398. package/dist/Stream.d.ts +1896 -1183
  399. package/dist/Stream.d.ts.map +1 -1
  400. package/dist/Stream.js +867 -524
  401. package/dist/Stream.js.map +1 -1
  402. package/dist/String.d.ts +171 -95
  403. package/dist/String.d.ts.map +1 -1
  404. package/dist/String.js +125 -67
  405. package/dist/String.js.map +1 -1
  406. package/dist/SubscriptionRef.d.ts +308 -203
  407. package/dist/SubscriptionRef.d.ts.map +1 -1
  408. package/dist/SubscriptionRef.js +125 -76
  409. package/dist/SubscriptionRef.js.map +1 -1
  410. package/dist/Symbol.d.ts +13 -5
  411. package/dist/Symbol.d.ts.map +1 -1
  412. package/dist/Symbol.js +13 -5
  413. package/dist/Symbol.js.map +1 -1
  414. package/dist/SynchronizedRef.d.ts +278 -62
  415. package/dist/SynchronizedRef.d.ts.map +1 -1
  416. package/dist/SynchronizedRef.js +116 -23
  417. package/dist/SynchronizedRef.js.map +1 -1
  418. package/dist/Take.d.ts +26 -2
  419. package/dist/Take.d.ts.map +1 -1
  420. package/dist/Take.js +4 -1
  421. package/dist/Take.js.map +1 -1
  422. package/dist/Terminal.d.ts +39 -7
  423. package/dist/Terminal.d.ts.map +1 -1
  424. package/dist/Terminal.js +10 -4
  425. package/dist/Terminal.js.map +1 -1
  426. package/dist/Tracer.d.ts +229 -55
  427. package/dist/Tracer.d.ts.map +1 -1
  428. package/dist/Tracer.js +94 -18
  429. package/dist/Tracer.js.map +1 -1
  430. package/dist/Trie.d.ts +213 -142
  431. package/dist/Trie.d.ts.map +1 -1
  432. package/dist/Trie.js +88 -60
  433. package/dist/Trie.js.map +1 -1
  434. package/dist/TxChunk.d.ts +182 -146
  435. package/dist/TxChunk.d.ts.map +1 -1
  436. package/dist/TxChunk.js +73 -56
  437. package/dist/TxChunk.js.map +1 -1
  438. package/dist/TxDeferred.d.ts +43 -29
  439. package/dist/TxDeferred.d.ts.map +1 -1
  440. package/dist/TxDeferred.js +22 -15
  441. package/dist/TxDeferred.js.map +1 -1
  442. package/dist/TxHashMap.d.ts +362 -222
  443. package/dist/TxHashMap.d.ts.map +1 -1
  444. package/dist/TxHashMap.js +171 -98
  445. package/dist/TxHashMap.js.map +1 -1
  446. package/dist/TxHashSet.d.ts +178 -104
  447. package/dist/TxHashSet.d.ts.map +1 -1
  448. package/dist/TxHashSet.js +84 -43
  449. package/dist/TxHashSet.js.map +1 -1
  450. package/dist/TxPriorityQueue.d.ts +93 -62
  451. package/dist/TxPriorityQueue.d.ts.map +1 -1
  452. package/dist/TxPriorityQueue.js +54 -36
  453. package/dist/TxPriorityQueue.js.map +1 -1
  454. package/dist/TxPubSub.d.ts +77 -49
  455. package/dist/TxPubSub.d.ts.map +1 -1
  456. package/dist/TxPubSub.js +60 -37
  457. package/dist/TxPubSub.js.map +1 -1
  458. package/dist/TxQueue.d.ts +279 -241
  459. package/dist/TxQueue.d.ts.map +1 -1
  460. package/dist/TxQueue.js +147 -101
  461. package/dist/TxQueue.js.map +1 -1
  462. package/dist/TxReentrantLock.d.ts +69 -46
  463. package/dist/TxReentrantLock.d.ts.map +1 -1
  464. package/dist/TxReentrantLock.js +48 -32
  465. package/dist/TxReentrantLock.js.map +1 -1
  466. package/dist/TxRef.d.ts +69 -40
  467. package/dist/TxRef.d.ts.map +1 -1
  468. package/dist/TxRef.js +34 -19
  469. package/dist/TxRef.js.map +1 -1
  470. package/dist/TxSemaphore.d.ts +101 -54
  471. package/dist/TxSemaphore.d.ts.map +1 -1
  472. package/dist/TxSemaphore.js +76 -34
  473. package/dist/TxSemaphore.js.map +1 -1
  474. package/dist/TxSubscriptionRef.d.ts +72 -48
  475. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  476. package/dist/TxSubscriptionRef.js +33 -22
  477. package/dist/TxSubscriptionRef.js.map +1 -1
  478. package/dist/Types.d.ts +34 -34
  479. package/dist/UndefinedOr.d.ts +48 -25
  480. package/dist/UndefinedOr.d.ts.map +1 -1
  481. package/dist/UndefinedOr.js +28 -25
  482. package/dist/UndefinedOr.js.map +1 -1
  483. package/dist/Unify.d.ts +71 -116
  484. package/dist/Unify.d.ts.map +1 -1
  485. package/dist/Unify.js +20 -6
  486. package/dist/Unify.js.map +1 -1
  487. package/dist/Utils.d.ts +4 -0
  488. package/dist/Utils.d.ts.map +1 -1
  489. package/dist/Utils.js +4 -0
  490. package/dist/Utils.js.map +1 -1
  491. package/dist/index.d.ts +81 -32
  492. package/dist/index.d.ts.map +1 -1
  493. package/dist/index.js +81 -32
  494. package/dist/index.js.map +1 -1
  495. package/dist/internal/schema/schema.js +1 -1
  496. package/dist/internal/schema/schema.js.map +1 -1
  497. package/dist/testing/FastCheck.d.ts +6 -3
  498. package/dist/testing/FastCheck.d.ts.map +1 -1
  499. package/dist/testing/FastCheck.js +6 -3
  500. package/dist/testing/FastCheck.js.map +1 -1
  501. package/dist/testing/TestClock.d.ts +39 -34
  502. package/dist/testing/TestClock.d.ts.map +1 -1
  503. package/dist/testing/TestClock.js +42 -12
  504. package/dist/testing/TestClock.js.map +1 -1
  505. package/dist/testing/TestConsole.d.ts +39 -30
  506. package/dist/testing/TestConsole.d.ts.map +1 -1
  507. package/dist/testing/TestConsole.js +25 -10
  508. package/dist/testing/TestConsole.js.map +1 -1
  509. package/dist/testing/TestSchema.js +7 -7
  510. package/dist/testing/TestSchema.js.map +1 -1
  511. package/dist/unstable/ai/AiError.d.ts +197 -130
  512. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  513. package/dist/unstable/ai/AiError.js +166 -102
  514. package/dist/unstable/ai/AiError.js.map +1 -1
  515. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  516. package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
  517. package/dist/unstable/ai/Chat.d.ts +65 -41
  518. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  519. package/dist/unstable/ai/Chat.js +51 -33
  520. package/dist/unstable/ai/Chat.js.map +1 -1
  521. package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
  522. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  523. package/dist/unstable/ai/EmbeddingModel.js +9 -8
  524. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  525. package/dist/unstable/ai/IdGenerator.d.ts +28 -18
  526. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  527. package/dist/unstable/ai/IdGenerator.js +18 -11
  528. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  529. package/dist/unstable/ai/LanguageModel.d.ts +31 -25
  530. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  531. package/dist/unstable/ai/LanguageModel.js +20 -14
  532. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  533. package/dist/unstable/ai/McpSchema.d.ts +339 -119
  534. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  535. package/dist/unstable/ai/McpSchema.js +264 -98
  536. package/dist/unstable/ai/McpSchema.js.map +1 -1
  537. package/dist/unstable/ai/McpServer.d.ts +53 -19
  538. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  539. package/dist/unstable/ai/McpServer.js +63 -15
  540. package/dist/unstable/ai/McpServer.js.map +1 -1
  541. package/dist/unstable/ai/Model.d.ts +8 -6
  542. package/dist/unstable/ai/Model.d.ts.map +1 -1
  543. package/dist/unstable/ai/Model.js +7 -5
  544. package/dist/unstable/ai/Model.js.map +1 -1
  545. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  546. package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
  547. package/dist/unstable/ai/Prompt.d.ts +194 -168
  548. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  549. package/dist/unstable/ai/Prompt.js +75 -66
  550. package/dist/unstable/ai/Prompt.js.map +1 -1
  551. package/dist/unstable/ai/Response.d.ts +153 -140
  552. package/dist/unstable/ai/Response.d.ts.map +1 -1
  553. package/dist/unstable/ai/Response.js +43 -48
  554. package/dist/unstable/ai/Response.js.map +1 -1
  555. package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
  556. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  557. package/dist/unstable/ai/ResponseIdTracker.js +27 -2
  558. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  559. package/dist/unstable/ai/Telemetry.d.ts +42 -32
  560. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  561. package/dist/unstable/ai/Telemetry.js +14 -10
  562. package/dist/unstable/ai/Telemetry.js.map +1 -1
  563. package/dist/unstable/ai/Tokenizer.d.ts +13 -8
  564. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  565. package/dist/unstable/ai/Tokenizer.js +10 -6
  566. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  567. package/dist/unstable/ai/Tool.d.ts +153 -84
  568. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  569. package/dist/unstable/ai/Tool.js +97 -44
  570. package/dist/unstable/ai/Tool.js.map +1 -1
  571. package/dist/unstable/ai/Toolkit.d.ts +32 -39
  572. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  573. package/dist/unstable/ai/Toolkit.js +7 -5
  574. package/dist/unstable/ai/Toolkit.js.map +1 -1
  575. package/dist/unstable/ai/index.d.ts +42 -24
  576. package/dist/unstable/ai/index.d.ts.map +1 -1
  577. package/dist/unstable/ai/index.js +42 -24
  578. package/dist/unstable/ai/index.js.map +1 -1
  579. package/dist/unstable/cli/Argument.d.ts +226 -134
  580. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  581. package/dist/unstable/cli/Argument.js +101 -65
  582. package/dist/unstable/cli/Argument.js.map +1 -1
  583. package/dist/unstable/cli/CliError.d.ts +72 -26
  584. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  585. package/dist/unstable/cli/CliError.js +86 -23
  586. package/dist/unstable/cli/CliError.js.map +1 -1
  587. package/dist/unstable/cli/CliOutput.d.ts +43 -13
  588. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  589. package/dist/unstable/cli/CliOutput.js +30 -6
  590. package/dist/unstable/cli/CliOutput.js.map +1 -1
  591. package/dist/unstable/cli/Command.d.ts +194 -113
  592. package/dist/unstable/cli/Command.d.ts.map +1 -1
  593. package/dist/unstable/cli/Command.js +45 -31
  594. package/dist/unstable/cli/Command.js.map +1 -1
  595. package/dist/unstable/cli/Completions.d.ts +7 -7
  596. package/dist/unstable/cli/Completions.js +1 -1
  597. package/dist/unstable/cli/Flag.d.ts +235 -142
  598. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  599. package/dist/unstable/cli/Flag.js +111 -71
  600. package/dist/unstable/cli/Flag.js.map +1 -1
  601. package/dist/unstable/cli/GlobalFlag.d.ts +41 -13
  602. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  603. package/dist/unstable/cli/GlobalFlag.js +30 -7
  604. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  605. package/dist/unstable/cli/HelpDoc.d.ts +35 -10
  606. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  607. package/dist/unstable/cli/HelpDoc.js +21 -0
  608. package/dist/unstable/cli/Param.d.ts +79 -31
  609. package/dist/unstable/cli/Param.d.ts.map +1 -1
  610. package/dist/unstable/cli/Param.js +160 -98
  611. package/dist/unstable/cli/Param.js.map +1 -1
  612. package/dist/unstable/cli/Primitive.d.ts +79 -42
  613. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  614. package/dist/unstable/cli/Primitive.js +66 -35
  615. package/dist/unstable/cli/Primitive.js.map +1 -1
  616. package/dist/unstable/cli/Prompt.d.ts +177 -45
  617. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  618. package/dist/unstable/cli/Prompt.js +103 -21
  619. package/dist/unstable/cli/Prompt.js.map +1 -1
  620. package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
  621. package/dist/unstable/cli/internal/ansi.js +13 -0
  622. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  623. package/dist/unstable/cli/internal/command.d.ts +5 -1
  624. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  625. package/dist/unstable/cli/internal/command.js +5 -1
  626. package/dist/unstable/cli/internal/command.js.map +1 -1
  627. package/dist/unstable/cli/internal/config.d.ts +3 -0
  628. package/dist/unstable/cli/internal/config.d.ts.map +1 -1
  629. package/dist/unstable/cli/internal/config.js.map +1 -1
  630. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  631. package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
  632. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  633. package/dist/unstable/cluster/ClusterCron.js +35 -1
  634. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  635. package/dist/unstable/cluster/ClusterError.d.ts +56 -7
  636. package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
  637. package/dist/unstable/cluster/ClusterError.js +56 -7
  638. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  639. package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
  640. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  641. package/dist/unstable/cluster/ClusterMetrics.js +39 -5
  642. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  643. package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
  644. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  645. package/dist/unstable/cluster/ClusterSchema.js +61 -8
  646. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  647. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
  648. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  649. package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -2
  650. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  651. package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
  652. package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
  653. package/dist/unstable/cluster/DeliverAt.js +11 -3
  654. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  655. package/dist/unstable/cluster/Entity.d.ts +75 -16
  656. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  657. package/dist/unstable/cluster/Entity.js +75 -10
  658. package/dist/unstable/cluster/Entity.js.map +1 -1
  659. package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
  660. package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
  661. package/dist/unstable/cluster/EntityAddress.js +30 -2
  662. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  663. package/dist/unstable/cluster/EntityId.d.ts +18 -3
  664. package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
  665. package/dist/unstable/cluster/EntityId.js +15 -2
  666. package/dist/unstable/cluster/EntityId.js.map +1 -1
  667. package/dist/unstable/cluster/EntityProxy.d.ts +34 -2
  668. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  669. package/dist/unstable/cluster/EntityProxy.js +24 -2
  670. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  671. package/dist/unstable/cluster/EntityProxyServer.d.ts +17 -2
  672. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  673. package/dist/unstable/cluster/EntityProxyServer.js +40 -8
  674. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  675. package/dist/unstable/cluster/EntityResource.d.ts +43 -6
  676. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  677. package/dist/unstable/cluster/EntityResource.js +11 -4
  678. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  679. package/dist/unstable/cluster/EntityType.d.ts +27 -3
  680. package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
  681. package/dist/unstable/cluster/EntityType.js +24 -2
  682. package/dist/unstable/cluster/EntityType.js.map +1 -1
  683. package/dist/unstable/cluster/Envelope.d.ts +105 -23
  684. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  685. package/dist/unstable/cluster/Envelope.js +88 -14
  686. package/dist/unstable/cluster/Envelope.js.map +1 -1
  687. package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
  688. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  689. package/dist/unstable/cluster/HttpRunner.js +88 -13
  690. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  691. package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
  692. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  693. package/dist/unstable/cluster/K8sHttpClient.js +31 -6
  694. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  695. package/dist/unstable/cluster/MachineId.d.ts +24 -3
  696. package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
  697. package/dist/unstable/cluster/MachineId.js +21 -2
  698. package/dist/unstable/cluster/MachineId.js.map +1 -1
  699. package/dist/unstable/cluster/Message.d.ts +102 -13
  700. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  701. package/dist/unstable/cluster/Message.js +86 -10
  702. package/dist/unstable/cluster/Message.js.map +1 -1
  703. package/dist/unstable/cluster/MessageStorage.d.ts +127 -21
  704. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  705. package/dist/unstable/cluster/MessageStorage.js +70 -10
  706. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  707. package/dist/unstable/cluster/Reply.d.ts +101 -12
  708. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  709. package/dist/unstable/cluster/Reply.js +64 -8
  710. package/dist/unstable/cluster/Reply.js.map +1 -1
  711. package/dist/unstable/cluster/Runner.d.ts +47 -17
  712. package/dist/unstable/cluster/Runner.d.ts.map +1 -1
  713. package/dist/unstable/cluster/Runner.js +47 -17
  714. package/dist/unstable/cluster/Runner.js.map +1 -1
  715. package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
  716. package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
  717. package/dist/unstable/cluster/RunnerAddress.js +34 -2
  718. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  719. package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
  720. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  721. package/dist/unstable/cluster/RunnerHealth.js +40 -12
  722. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  723. package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
  724. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  725. package/dist/unstable/cluster/RunnerServer.js +31 -4
  726. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  727. package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
  728. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  729. package/dist/unstable/cluster/RunnerStorage.js +38 -4
  730. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  731. package/dist/unstable/cluster/Runners.d.ts +73 -10
  732. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  733. package/dist/unstable/cluster/Runners.js +70 -9
  734. package/dist/unstable/cluster/Runners.js.map +1 -1
  735. package/dist/unstable/cluster/ShardId.d.ts +51 -5
  736. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  737. package/dist/unstable/cluster/ShardId.js +47 -4
  738. package/dist/unstable/cluster/ShardId.js.map +1 -1
  739. package/dist/unstable/cluster/Sharding.d.ts +10 -2
  740. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  741. package/dist/unstable/cluster/Sharding.js +35 -4
  742. package/dist/unstable/cluster/Sharding.js.map +1 -1
  743. package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
  744. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  745. package/dist/unstable/cluster/ShardingConfig.js +66 -9
  746. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  747. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
  748. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
  749. package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
  750. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  751. package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
  752. package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
  753. package/dist/unstable/cluster/SingleRunner.js +23 -1
  754. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  755. package/dist/unstable/cluster/Singleton.d.ts +15 -1
  756. package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
  757. package/dist/unstable/cluster/Singleton.js +15 -1
  758. package/dist/unstable/cluster/Singleton.js.map +1 -1
  759. package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
  760. package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
  761. package/dist/unstable/cluster/SingletonAddress.js +21 -1
  762. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  763. package/dist/unstable/cluster/Snowflake.d.ts +89 -19
  764. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  765. package/dist/unstable/cluster/Snowflake.js +48 -13
  766. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  767. package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
  768. package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
  769. package/dist/unstable/cluster/SocketRunner.js +29 -2
  770. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  771. package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
  772. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  773. package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
  774. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  775. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
  776. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  777. package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
  778. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  779. package/dist/unstable/cluster/TestRunner.d.ts +18 -1
  780. package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
  781. package/dist/unstable/cluster/TestRunner.js +18 -1
  782. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  783. package/dist/unstable/cluster/internal/hash.js +12 -0
  784. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  785. package/dist/unstable/devtools/DevTools.d.ts +26 -3
  786. package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
  787. package/dist/unstable/devtools/DevTools.js +26 -3
  788. package/dist/unstable/devtools/DevTools.js.map +1 -1
  789. package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
  790. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  791. package/dist/unstable/devtools/DevToolsClient.js +32 -5
  792. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  793. package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
  794. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  795. package/dist/unstable/devtools/DevToolsSchema.js +102 -20
  796. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  797. package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
  798. package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
  799. package/dist/unstable/devtools/DevToolsServer.js +21 -1
  800. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  801. package/dist/unstable/encoding/Msgpack.d.ts +81 -12
  802. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  803. package/dist/unstable/encoding/Msgpack.js +75 -9
  804. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  805. package/dist/unstable/encoding/Ndjson.d.ts +149 -21
  806. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  807. package/dist/unstable/encoding/Ndjson.js +97 -13
  808. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  809. package/dist/unstable/encoding/Sse.d.ts +109 -18
  810. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  811. package/dist/unstable/encoding/Sse.js +69 -13
  812. package/dist/unstable/encoding/Sse.js.map +1 -1
  813. package/dist/unstable/eventlog/Event.d.ts +115 -30
  814. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  815. package/dist/unstable/eventlog/Event.js +22 -2
  816. package/dist/unstable/eventlog/Event.js.map +1 -1
  817. package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
  818. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  819. package/dist/unstable/eventlog/EventGroup.js +24 -6
  820. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  821. package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
  822. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  823. package/dist/unstable/eventlog/EventJournal.js +108 -16
  824. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  825. package/dist/unstable/eventlog/EventLog.d.ts +151 -31
  826. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  827. package/dist/unstable/eventlog/EventLog.js +111 -20
  828. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  829. package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
  830. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  831. package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
  832. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  833. package/dist/unstable/eventlog/EventLogMessage.d.ts +92 -18
  834. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
  835. package/dist/unstable/eventlog/EventLogMessage.js +72 -16
  836. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  837. package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
  838. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  839. package/dist/unstable/eventlog/EventLogRemote.js +54 -8
  840. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  841. package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
  842. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  843. package/dist/unstable/eventlog/EventLogServer.js +17 -3
  844. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  845. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
  846. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  847. package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
  848. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  849. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
  850. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  851. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
  852. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  853. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
  854. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
  855. package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
  856. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  857. package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
  858. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  859. package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
  860. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  861. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
  862. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
  863. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
  864. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  865. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
  866. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
  867. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
  868. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  869. package/dist/unstable/http/Cookies.d.ts +156 -77
  870. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  871. package/dist/unstable/http/Cookies.js +93 -39
  872. package/dist/unstable/http/Cookies.js.map +1 -1
  873. package/dist/unstable/http/Etag.d.ts +40 -7
  874. package/dist/unstable/http/Etag.d.ts.map +1 -1
  875. package/dist/unstable/http/Etag.js +27 -4
  876. package/dist/unstable/http/Etag.js.map +1 -1
  877. package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
  878. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  879. package/dist/unstable/http/FetchHttpClient.js +33 -4
  880. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  881. package/dist/unstable/http/FindMyWay.d.ts +1 -1
  882. package/dist/unstable/http/FindMyWay.js +1 -1
  883. package/dist/unstable/http/Headers.d.ts +182 -36
  884. package/dist/unstable/http/Headers.d.ts.map +1 -1
  885. package/dist/unstable/http/Headers.js +86 -16
  886. package/dist/unstable/http/Headers.js.map +1 -1
  887. package/dist/unstable/http/HttpBody.d.ts +114 -26
  888. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  889. package/dist/unstable/http/HttpBody.js +98 -20
  890. package/dist/unstable/http/HttpBody.js.map +1 -1
  891. package/dist/unstable/http/HttpClient.d.ts +205 -96
  892. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  893. package/dist/unstable/http/HttpClient.js +84 -38
  894. package/dist/unstable/http/HttpClient.js.map +1 -1
  895. package/dist/unstable/http/HttpClientError.d.ts +68 -12
  896. package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
  897. package/dist/unstable/http/HttpClientError.js +71 -9
  898. package/dist/unstable/http/HttpClientError.js.map +1 -1
  899. package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
  900. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  901. package/dist/unstable/http/HttpClientRequest.js +151 -45
  902. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  903. package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
  904. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  905. package/dist/unstable/http/HttpClientResponse.js +44 -11
  906. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  907. package/dist/unstable/http/HttpEffect.d.ts +42 -16
  908. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  909. package/dist/unstable/http/HttpEffect.js +33 -13
  910. package/dist/unstable/http/HttpEffect.js.map +1 -1
  911. package/dist/unstable/http/HttpIncomingMessage.d.ts +47 -7
  912. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  913. package/dist/unstable/http/HttpIncomingMessage.js +44 -6
  914. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  915. package/dist/unstable/http/HttpMethod.d.ts +35 -5
  916. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  917. package/dist/unstable/http/HttpMethod.js +23 -1
  918. package/dist/unstable/http/HttpMethod.js.map +1 -1
  919. package/dist/unstable/http/HttpMiddleware.d.ts +37 -11
  920. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  921. package/dist/unstable/http/HttpMiddleware.js +52 -10
  922. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  923. package/dist/unstable/http/HttpPlatform.d.ts +34 -3
  924. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  925. package/dist/unstable/http/HttpPlatform.js +34 -3
  926. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  927. package/dist/unstable/http/HttpRouter.d.ts +194 -45
  928. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  929. package/dist/unstable/http/HttpRouter.js +118 -24
  930. package/dist/unstable/http/HttpRouter.js.map +1 -1
  931. package/dist/unstable/http/HttpServer.d.ts +151 -22
  932. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  933. package/dist/unstable/http/HttpServer.js +76 -11
  934. package/dist/unstable/http/HttpServer.js.map +1 -1
  935. package/dist/unstable/http/HttpServerError.d.ts +90 -10
  936. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  937. package/dist/unstable/http/HttpServerError.js +82 -8
  938. package/dist/unstable/http/HttpServerError.js.map +1 -1
  939. package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
  940. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  941. package/dist/unstable/http/HttpServerRequest.js +101 -20
  942. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  943. package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
  944. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  945. package/dist/unstable/http/HttpServerRespondable.js +43 -5
  946. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  947. package/dist/unstable/http/HttpServerResponse.d.ts +390 -67
  948. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  949. package/dist/unstable/http/HttpServerResponse.js +204 -33
  950. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  951. package/dist/unstable/http/HttpStaticServer.d.ts +22 -4
  952. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  953. package/dist/unstable/http/HttpStaticServer.js +22 -4
  954. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  955. package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
  956. package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
  957. package/dist/unstable/http/HttpTraceContext.js +47 -5
  958. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  959. package/dist/unstable/http/Multipart.d.ts +178 -28
  960. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  961. package/dist/unstable/http/Multipart.js +129 -19
  962. package/dist/unstable/http/Multipart.js.map +1 -1
  963. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
  964. package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
  965. package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
  966. package/dist/unstable/http/Multipasta/Node.js +1 -1
  967. package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
  968. package/dist/unstable/http/Multipasta/Search.js +1 -1
  969. package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
  970. package/dist/unstable/http/Multipasta/Web.js +1 -1
  971. package/dist/unstable/http/Multipasta.d.ts +1 -1
  972. package/dist/unstable/http/Multipasta.js +1 -1
  973. package/dist/unstable/http/Template.d.ts +53 -0
  974. package/dist/unstable/http/Template.d.ts.map +1 -1
  975. package/dist/unstable/http/Template.js +26 -0
  976. package/dist/unstable/http/Template.js.map +1 -1
  977. package/dist/unstable/http/Url.d.ts +56 -42
  978. package/dist/unstable/http/Url.d.ts.map +1 -1
  979. package/dist/unstable/http/Url.js +29 -15
  980. package/dist/unstable/http/Url.js.map +1 -1
  981. package/dist/unstable/http/UrlParams.d.ts +233 -49
  982. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  983. package/dist/unstable/http/UrlParams.js +116 -23
  984. package/dist/unstable/http/UrlParams.js.map +1 -1
  985. package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
  986. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  987. package/dist/unstable/httpapi/HttpApi.js +14 -8
  988. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  989. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +55 -16
  990. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  991. package/dist/unstable/httpapi/HttpApiBuilder.js +44 -6
  992. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  993. package/dist/unstable/httpapi/HttpApiClient.d.ts +58 -15
  994. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  995. package/dist/unstable/httpapi/HttpApiClient.js +42 -6
  996. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  997. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
  998. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  999. package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
  1000. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1001. package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
  1002. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  1003. package/dist/unstable/httpapi/HttpApiError.js +98 -1
  1004. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1005. package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
  1006. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  1007. package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
  1008. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1009. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +111 -22
  1010. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1011. package/dist/unstable/httpapi/HttpApiMiddleware.js +47 -5
  1012. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1013. package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
  1014. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1015. package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
  1016. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1017. package/dist/unstable/httpapi/HttpApiSchema.d.ts +67 -30
  1018. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  1019. package/dist/unstable/httpapi/HttpApiSchema.js +48 -27
  1020. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1021. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +74 -17
  1022. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  1023. package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
  1024. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1025. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +5 -2
  1026. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  1027. package/dist/unstable/httpapi/HttpApiSwagger.js +24 -2
  1028. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1029. package/dist/unstable/httpapi/HttpApiTest.d.ts +6 -1
  1030. package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
  1031. package/dist/unstable/httpapi/HttpApiTest.js +26 -1
  1032. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1033. package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
  1034. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1035. package/dist/unstable/httpapi/OpenApi.js +73 -15
  1036. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1037. package/dist/unstable/observability/Otlp.d.ts +33 -3
  1038. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  1039. package/dist/unstable/observability/Otlp.js +14 -3
  1040. package/dist/unstable/observability/Otlp.js.map +1 -1
  1041. package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
  1042. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1043. package/dist/unstable/observability/OtlpExporter.js +32 -1
  1044. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1045. package/dist/unstable/observability/OtlpLogger.d.ts +14 -2
  1046. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1047. package/dist/unstable/observability/OtlpLogger.js +29 -2
  1048. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1049. package/dist/unstable/observability/OtlpMetrics.d.ts +15 -4
  1050. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1051. package/dist/unstable/observability/OtlpMetrics.js +32 -2
  1052. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1053. package/dist/unstable/observability/OtlpResource.d.ts +49 -12
  1054. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1055. package/dist/unstable/observability/OtlpResource.js +47 -5
  1056. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1057. package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
  1058. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  1059. package/dist/unstable/observability/OtlpSerialization.js +28 -3
  1060. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1061. package/dist/unstable/observability/OtlpTracer.d.ts +16 -2
  1062. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  1063. package/dist/unstable/observability/OtlpTracer.js +32 -2
  1064. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1065. package/dist/unstable/observability/PrometheusMetrics.d.ts +32 -12
  1066. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1067. package/dist/unstable/observability/PrometheusMetrics.js +7 -5
  1068. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1069. package/dist/unstable/observability/index.d.ts +2 -1
  1070. package/dist/unstable/observability/index.d.ts.map +1 -1
  1071. package/dist/unstable/observability/index.js +2 -1
  1072. package/dist/unstable/observability/index.js.map +1 -1
  1073. package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
  1074. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1075. package/dist/unstable/persistence/KeyValueStore.js +81 -21
  1076. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1077. package/dist/unstable/persistence/Persistable.d.ts +76 -15
  1078. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  1079. package/dist/unstable/persistence/Persistable.js +22 -5
  1080. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1081. package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
  1082. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  1083. package/dist/unstable/persistence/PersistedCache.js +24 -1
  1084. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1085. package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
  1086. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  1087. package/dist/unstable/persistence/PersistedQueue.js +60 -13
  1088. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1089. package/dist/unstable/persistence/Persistence.d.ts +97 -16
  1090. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1091. package/dist/unstable/persistence/Persistence.js +90 -14
  1092. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1093. package/dist/unstable/persistence/RateLimiter.d.ts +97 -21
  1094. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1095. package/dist/unstable/persistence/RateLimiter.js +81 -16
  1096. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1097. package/dist/unstable/persistence/Redis.d.ts +26 -5
  1098. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  1099. package/dist/unstable/persistence/Redis.js +36 -4
  1100. package/dist/unstable/persistence/Redis.js.map +1 -1
  1101. package/dist/unstable/process/ChildProcess.d.ts +87 -64
  1102. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1103. package/dist/unstable/process/ChildProcess.js +24 -17
  1104. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1105. package/dist/unstable/process/ChildProcessSpawner.d.ts +22 -11
  1106. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1107. package/dist/unstable/process/ChildProcessSpawner.js +11 -6
  1108. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1109. package/dist/unstable/process/index.d.ts +2 -1
  1110. package/dist/unstable/process/index.d.ts.map +1 -1
  1111. package/dist/unstable/process/index.js +2 -1
  1112. package/dist/unstable/process/index.js.map +1 -1
  1113. package/dist/unstable/reactivity/AsyncResult.d.ts +196 -59
  1114. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1115. package/dist/unstable/reactivity/AsyncResult.js +121 -36
  1116. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1117. package/dist/unstable/reactivity/Atom.d.ts +539 -130
  1118. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1119. package/dist/unstable/reactivity/Atom.js +252 -58
  1120. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1121. package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
  1122. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1123. package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
  1124. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1125. package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
  1126. package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
  1127. package/dist/unstable/reactivity/AtomRef.js +29 -3
  1128. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1129. package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
  1130. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  1131. package/dist/unstable/reactivity/AtomRegistry.js +69 -10
  1132. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1133. package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
  1134. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1135. package/dist/unstable/reactivity/AtomRpc.js +29 -1
  1136. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1137. package/dist/unstable/reactivity/Hydration.d.ts +28 -5
  1138. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
  1139. package/dist/unstable/reactivity/Hydration.js +35 -3
  1140. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1141. package/dist/unstable/reactivity/Reactivity.d.ts +95 -13
  1142. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  1143. package/dist/unstable/reactivity/Reactivity.js +61 -7
  1144. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1145. package/dist/unstable/rpc/Rpc.d.ts +255 -56
  1146. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1147. package/dist/unstable/rpc/Rpc.js +44 -11
  1148. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1149. package/dist/unstable/rpc/RpcClient.d.ts +81 -19
  1150. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1151. package/dist/unstable/rpc/RpcClient.js +52 -12
  1152. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1153. package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
  1154. package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
  1155. package/dist/unstable/rpc/RpcClientError.js +26 -2
  1156. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1157. package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
  1158. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  1159. package/dist/unstable/rpc/RpcGroup.js +3 -1
  1160. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1161. package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
  1162. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1163. package/dist/unstable/rpc/RpcMessage.js +23 -7
  1164. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1165. package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
  1166. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  1167. package/dist/unstable/rpc/RpcMiddleware.js +39 -3
  1168. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1169. package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
  1170. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  1171. package/dist/unstable/rpc/RpcSchema.js +34 -3
  1172. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1173. package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
  1174. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1175. package/dist/unstable/rpc/RpcSerialization.js +56 -12
  1176. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1177. package/dist/unstable/rpc/RpcServer.d.ts +73 -23
  1178. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  1179. package/dist/unstable/rpc/RpcServer.js +69 -22
  1180. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1181. package/dist/unstable/rpc/RpcTest.d.ts +20 -1
  1182. package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
  1183. package/dist/unstable/rpc/RpcTest.js +20 -1
  1184. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1185. package/dist/unstable/rpc/RpcWorker.d.ts +40 -6
  1186. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  1187. package/dist/unstable/rpc/RpcWorker.js +16 -4
  1188. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1189. package/dist/unstable/rpc/Utils.d.ts +8 -0
  1190. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  1191. package/dist/unstable/rpc/Utils.js +8 -0
  1192. package/dist/unstable/rpc/Utils.js.map +1 -1
  1193. package/dist/unstable/schema/Model.d.ts +130 -52
  1194. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1195. package/dist/unstable/schema/Model.js +79 -34
  1196. package/dist/unstable/schema/Model.js.map +1 -1
  1197. package/dist/unstable/schema/VariantSchema.d.ts +104 -24
  1198. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1199. package/dist/unstable/schema/VariantSchema.js +22 -6
  1200. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1201. package/dist/unstable/socket/Socket.d.ts +167 -34
  1202. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1203. package/dist/unstable/socket/Socket.js +123 -28
  1204. package/dist/unstable/socket/Socket.js.map +1 -1
  1205. package/dist/unstable/socket/SocketServer.d.ts +58 -10
  1206. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  1207. package/dist/unstable/socket/SocketServer.js +43 -5
  1208. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1209. package/dist/unstable/sql/Migrator.d.ts +35 -4
  1210. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  1211. package/dist/unstable/sql/Migrator.js +44 -4
  1212. package/dist/unstable/sql/Migrator.js.map +1 -1
  1213. package/dist/unstable/sql/SqlClient.d.ts +34 -2
  1214. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1215. package/dist/unstable/sql/SqlClient.js +38 -1
  1216. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1217. package/dist/unstable/sql/SqlConnection.d.ts +31 -0
  1218. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  1219. package/dist/unstable/sql/SqlConnection.js +22 -0
  1220. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1221. package/dist/unstable/sql/SqlError.d.ts +99 -0
  1222. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  1223. package/dist/unstable/sql/SqlError.js +114 -0
  1224. package/dist/unstable/sql/SqlError.js.map +1 -1
  1225. package/dist/unstable/sql/SqlModel.d.ts +26 -5
  1226. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  1227. package/dist/unstable/sql/SqlModel.js +8 -4
  1228. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1229. package/dist/unstable/sql/SqlResolver.d.ts +56 -13
  1230. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  1231. package/dist/unstable/sql/SqlResolver.js +44 -10
  1232. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1233. package/dist/unstable/sql/SqlSchema.d.ts +29 -8
  1234. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  1235. package/dist/unstable/sql/SqlSchema.js +29 -8
  1236. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1237. package/dist/unstable/sql/SqlStream.d.ts +3 -0
  1238. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  1239. package/dist/unstable/sql/SqlStream.js +23 -0
  1240. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1241. package/dist/unstable/sql/Statement.d.ts +124 -0
  1242. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1243. package/dist/unstable/sql/Statement.js +82 -0
  1244. package/dist/unstable/sql/Statement.js.map +1 -1
  1245. package/dist/unstable/sql/index.d.ts +1 -1
  1246. package/dist/unstable/sql/index.js +1 -1
  1247. package/dist/unstable/workers/Transferable.d.ts +65 -13
  1248. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  1249. package/dist/unstable/workers/Transferable.js +53 -10
  1250. package/dist/unstable/workers/Transferable.js.map +1 -1
  1251. package/dist/unstable/workers/Worker.d.ts +60 -8
  1252. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  1253. package/dist/unstable/workers/Worker.js +43 -4
  1254. package/dist/unstable/workers/Worker.js.map +1 -1
  1255. package/dist/unstable/workers/WorkerError.d.ts +31 -9
  1256. package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
  1257. package/dist/unstable/workers/WorkerError.js +44 -7
  1258. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1259. package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
  1260. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  1261. package/dist/unstable/workers/WorkerRunner.js +24 -1
  1262. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1263. package/dist/unstable/workers/index.d.ts +1 -1
  1264. package/dist/unstable/workers/index.js +1 -1
  1265. package/dist/unstable/workflow/Activity.d.ts +61 -10
  1266. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  1267. package/dist/unstable/workflow/Activity.js +20 -5
  1268. package/dist/unstable/workflow/Activity.js.map +1 -1
  1269. package/dist/unstable/workflow/DurableClock.d.ts +12 -3
  1270. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  1271. package/dist/unstable/workflow/DurableClock.js +22 -2
  1272. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1273. package/dist/unstable/workflow/DurableDeferred.d.ts +126 -31
  1274. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  1275. package/dist/unstable/workflow/DurableDeferred.js +76 -13
  1276. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1277. package/dist/unstable/workflow/DurableQueue.d.ts +30 -7
  1278. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  1279. package/dist/unstable/workflow/DurableQueue.js +23 -5
  1280. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  1281. package/dist/unstable/workflow/Workflow.d.ts +100 -31
  1282. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1283. package/dist/unstable/workflow/Workflow.js +75 -19
  1284. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1285. package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
  1286. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  1287. package/dist/unstable/workflow/WorkflowEngine.js +16 -4
  1288. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1289. package/dist/unstable/workflow/WorkflowProxy.d.ts +32 -2
  1290. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1291. package/dist/unstable/workflow/WorkflowProxy.js +2 -2
  1292. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1293. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +36 -2
  1294. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  1295. package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
  1296. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1297. package/package.json +11 -11
  1298. package/src/Array.ts +113 -67
  1299. package/src/BigDecimal.ts +404 -337
  1300. package/src/BigInt.ts +167 -97
  1301. package/src/Boolean.ts +62 -31
  1302. package/src/Brand.ts +20 -1
  1303. package/src/Cache.ts +331 -164
  1304. package/src/Cause.ts +74 -62
  1305. package/src/Channel.ts +1585 -607
  1306. package/src/ChannelSchema.ts +137 -12
  1307. package/src/Chunk.ts +549 -380
  1308. package/src/Clock.ts +15 -8
  1309. package/src/Combiner.ts +2 -4
  1310. package/src/Config.ts +4 -2
  1311. package/src/ConfigProvider.ts +1 -1
  1312. package/src/Console.ts +88 -58
  1313. package/src/Context.ts +384 -135
  1314. package/src/Cron.ts +111 -48
  1315. package/src/Data.ts +3 -2
  1316. package/src/DateTime.ts +874 -443
  1317. package/src/Deferred.ts +367 -174
  1318. package/src/Differ.ts +42 -0
  1319. package/src/Duration.ts +329 -185
  1320. package/src/Effect.ts +2127 -1957
  1321. package/src/Effectable.ts +37 -2
  1322. package/src/Encoding.ts +78 -28
  1323. package/src/Equivalence.ts +14 -19
  1324. package/src/ErrorReporter.ts +66 -82
  1325. package/src/ExecutionPlan.ts +94 -9
  1326. package/src/Exit.ts +7 -5
  1327. package/src/Fiber.ts +72 -40
  1328. package/src/FiberHandle.ts +156 -56
  1329. package/src/FiberMap.ts +327 -162
  1330. package/src/FiberSet.ts +129 -51
  1331. package/src/FileSystem.ts +106 -74
  1332. package/src/Filter.ts +166 -88
  1333. package/src/Function.ts +154 -86
  1334. package/src/Graph.ts +682 -365
  1335. package/src/HKT.ts +29 -13
  1336. package/src/Hash.ts +31 -18
  1337. package/src/HashMap.ts +444 -256
  1338. package/src/HashRing.ts +94 -17
  1339. package/src/HashSet.ts +194 -104
  1340. package/src/Inspectable.ts +22 -10
  1341. package/src/Iterable.ts +309 -149
  1342. package/src/JsonPatch.ts +4 -3
  1343. package/src/Latch.ts +98 -15
  1344. package/src/Layer.ts +487 -344
  1345. package/src/LayerMap.ts +95 -21
  1346. package/src/LogLevel.ts +92 -131
  1347. package/src/Logger.ts +357 -288
  1348. package/src/ManagedRuntime.ts +75 -17
  1349. package/src/Match.ts +133 -157
  1350. package/src/Metric.ts +355 -304
  1351. package/src/MutableHashMap.ts +161 -84
  1352. package/src/MutableHashSet.ts +122 -52
  1353. package/src/MutableList.ts +141 -81
  1354. package/src/MutableRef.ts +130 -90
  1355. package/src/Newtype.ts +3 -0
  1356. package/src/NonEmptyIterable.ts +36 -39
  1357. package/src/Number.ts +116 -64
  1358. package/src/Optic.ts +1 -2
  1359. package/src/Option.ts +28 -47
  1360. package/src/Ordering.ts +43 -28
  1361. package/src/PartitionedSemaphore.ts +225 -40
  1362. package/src/Path.ts +77 -13
  1363. package/src/Pipeable.ts +76 -21
  1364. package/src/PlatformError.ts +74 -6
  1365. package/src/Pool.ts +94 -31
  1366. package/src/Predicate.ts +16 -21
  1367. package/src/PrimaryKey.ts +9 -2
  1368. package/src/PubSub.ts +364 -262
  1369. package/src/Pull.ts +94 -25
  1370. package/src/Queue.ts +284 -150
  1371. package/src/Random.ts +54 -35
  1372. package/src/RcMap.ts +151 -141
  1373. package/src/RcRef.ts +69 -32
  1374. package/src/Record.ts +273 -129
  1375. package/src/Redactable.ts +3 -3
  1376. package/src/Redacted.ts +63 -33
  1377. package/src/Ref.ts +161 -104
  1378. package/src/References.ts +73 -31
  1379. package/src/RegExp.ts +11 -5
  1380. package/src/Request.ts +158 -34
  1381. package/src/RequestResolver.ts +277 -119
  1382. package/src/Resource.ts +45 -7
  1383. package/src/Result.ts +18 -16
  1384. package/src/Runtime.ts +45 -19
  1385. package/src/Schedule.ts +574 -599
  1386. package/src/Scheduler.ts +43 -6
  1387. package/src/Schema.ts +819 -295
  1388. package/src/SchemaAST.ts +25 -16
  1389. package/src/SchemaGetter.ts +29 -14
  1390. package/src/SchemaIssue.ts +1 -8
  1391. package/src/SchemaParser.ts +262 -38
  1392. package/src/SchemaTransformation.ts +61 -41
  1393. package/src/SchemaUtils.ts +23 -0
  1394. package/src/Scope.ts +102 -43
  1395. package/src/ScopedCache.ts +192 -56
  1396. package/src/ScopedRef.ts +28 -8
  1397. package/src/Semaphore.ts +64 -28
  1398. package/src/Sink.ts +458 -200
  1399. package/src/Stdio.ts +43 -6
  1400. package/src/Stream.ts +2039 -1252
  1401. package/src/String.ts +171 -95
  1402. package/src/SubscriptionRef.ts +308 -203
  1403. package/src/Symbol.ts +13 -5
  1404. package/src/SynchronizedRef.ts +278 -62
  1405. package/src/Take.ts +26 -2
  1406. package/src/Terminal.ts +40 -7
  1407. package/src/Tracer.ts +229 -55
  1408. package/src/Trie.ts +213 -142
  1409. package/src/TxChunk.ts +182 -146
  1410. package/src/TxDeferred.ts +43 -29
  1411. package/src/TxHashMap.ts +370 -230
  1412. package/src/TxHashSet.ts +250 -152
  1413. package/src/TxPriorityQueue.ts +96 -64
  1414. package/src/TxPubSub.ts +77 -49
  1415. package/src/TxQueue.ts +279 -241
  1416. package/src/TxReentrantLock.ts +70 -47
  1417. package/src/TxRef.ts +69 -40
  1418. package/src/TxSemaphore.ts +101 -54
  1419. package/src/TxSubscriptionRef.ts +72 -48
  1420. package/src/Types.ts +34 -34
  1421. package/src/UndefinedOr.ts +48 -25
  1422. package/src/Unify.ts +71 -116
  1423. package/src/Utils.ts +4 -0
  1424. package/src/index.ts +81 -32
  1425. package/src/internal/schema/schema.ts +1 -1
  1426. package/src/testing/FastCheck.ts +6 -3
  1427. package/src/testing/TestClock.ts +63 -34
  1428. package/src/testing/TestConsole.ts +49 -30
  1429. package/src/testing/TestSchema.ts +8 -8
  1430. package/src/unstable/ai/AiError.ts +187 -120
  1431. package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
  1432. package/src/unstable/ai/Chat.ts +69 -43
  1433. package/src/unstable/ai/EmbeddingModel.ts +12 -11
  1434. package/src/unstable/ai/IdGenerator.ts +28 -18
  1435. package/src/unstable/ai/LanguageModel.ts +35 -27
  1436. package/src/unstable/ai/McpSchema.ts +339 -119
  1437. package/src/unstable/ai/McpServer.ts +76 -19
  1438. package/src/unstable/ai/Model.ts +8 -6
  1439. package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
  1440. package/src/unstable/ai/Prompt.ts +210 -184
  1441. package/src/unstable/ai/Response.ts +159 -147
  1442. package/src/unstable/ai/ResponseIdTracker.ts +43 -4
  1443. package/src/unstable/ai/Telemetry.ts +42 -32
  1444. package/src/unstable/ai/Tokenizer.ts +13 -8
  1445. package/src/unstable/ai/Tool.ts +154 -85
  1446. package/src/unstable/ai/Toolkit.ts +51 -46
  1447. package/src/unstable/ai/index.ts +42 -24
  1448. package/src/unstable/cli/Argument.ts +226 -134
  1449. package/src/unstable/cli/CliError.ts +96 -26
  1450. package/src/unstable/cli/CliOutput.ts +43 -13
  1451. package/src/unstable/cli/Command.ts +194 -113
  1452. package/src/unstable/cli/Completions.ts +7 -7
  1453. package/src/unstable/cli/Flag.ts +235 -142
  1454. package/src/unstable/cli/GlobalFlag.ts +41 -13
  1455. package/src/unstable/cli/HelpDoc.ts +35 -10
  1456. package/src/unstable/cli/Param.ts +327 -189
  1457. package/src/unstable/cli/Primitive.ts +79 -42
  1458. package/src/unstable/cli/Prompt.ts +201 -45
  1459. package/src/unstable/cli/internal/ansi.ts +13 -0
  1460. package/src/unstable/cli/internal/command.ts +5 -1
  1461. package/src/unstable/cli/internal/config.ts +3 -0
  1462. package/src/unstable/cli/internal/lexer.ts +11 -0
  1463. package/src/unstable/cluster/ClusterCron.ts +35 -1
  1464. package/src/unstable/cluster/ClusterError.ts +56 -7
  1465. package/src/unstable/cluster/ClusterMetrics.ts +39 -5
  1466. package/src/unstable/cluster/ClusterSchema.ts +61 -8
  1467. package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -2
  1468. package/src/unstable/cluster/DeliverAt.ts +39 -4
  1469. package/src/unstable/cluster/Entity.ts +107 -16
  1470. package/src/unstable/cluster/EntityAddress.ts +30 -2
  1471. package/src/unstable/cluster/EntityId.ts +18 -3
  1472. package/src/unstable/cluster/EntityProxy.ts +34 -2
  1473. package/src/unstable/cluster/EntityProxyServer.ts +44 -8
  1474. package/src/unstable/cluster/EntityResource.ts +43 -6
  1475. package/src/unstable/cluster/EntityType.ts +27 -3
  1476. package/src/unstable/cluster/Envelope.ts +128 -23
  1477. package/src/unstable/cluster/HttpRunner.ts +88 -13
  1478. package/src/unstable/cluster/K8sHttpClient.ts +49 -6
  1479. package/src/unstable/cluster/MachineId.ts +24 -3
  1480. package/src/unstable/cluster/Message.ts +102 -13
  1481. package/src/unstable/cluster/MessageStorage.ts +127 -21
  1482. package/src/unstable/cluster/Reply.ts +101 -12
  1483. package/src/unstable/cluster/Runner.ts +47 -17
  1484. package/src/unstable/cluster/RunnerAddress.ts +34 -2
  1485. package/src/unstable/cluster/RunnerHealth.ts +40 -12
  1486. package/src/unstable/cluster/RunnerServer.ts +31 -4
  1487. package/src/unstable/cluster/RunnerStorage.ts +42 -5
  1488. package/src/unstable/cluster/Runners.ts +73 -10
  1489. package/src/unstable/cluster/ShardId.ts +51 -5
  1490. package/src/unstable/cluster/Sharding.ts +35 -4
  1491. package/src/unstable/cluster/ShardingConfig.ts +75 -10
  1492. package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
  1493. package/src/unstable/cluster/SingleRunner.ts +23 -1
  1494. package/src/unstable/cluster/Singleton.ts +15 -1
  1495. package/src/unstable/cluster/SingletonAddress.ts +21 -1
  1496. package/src/unstable/cluster/Snowflake.ts +89 -19
  1497. package/src/unstable/cluster/SocketRunner.ts +29 -2
  1498. package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
  1499. package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
  1500. package/src/unstable/cluster/TestRunner.ts +18 -1
  1501. package/src/unstable/cluster/internal/hash.ts +12 -0
  1502. package/src/unstable/devtools/DevTools.ts +26 -3
  1503. package/src/unstable/devtools/DevToolsClient.ts +32 -5
  1504. package/src/unstable/devtools/DevToolsSchema.ts +201 -44
  1505. package/src/unstable/devtools/DevToolsServer.ts +27 -2
  1506. package/src/unstable/encoding/Msgpack.ts +97 -12
  1507. package/src/unstable/encoding/Ndjson.ts +149 -21
  1508. package/src/unstable/encoding/Sse.ts +109 -18
  1509. package/src/unstable/eventlog/Event.ts +131 -30
  1510. package/src/unstable/eventlog/EventGroup.ts +50 -17
  1511. package/src/unstable/eventlog/EventJournal.ts +120 -20
  1512. package/src/unstable/eventlog/EventLog.ts +151 -31
  1513. package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
  1514. package/src/unstable/eventlog/EventLogMessage.ts +92 -18
  1515. package/src/unstable/eventlog/EventLogRemote.ts +54 -8
  1516. package/src/unstable/eventlog/EventLogServer.ts +33 -3
  1517. package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
  1518. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
  1519. package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
  1520. package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
  1521. package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
  1522. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
  1523. package/src/unstable/http/Cookies.ts +156 -77
  1524. package/src/unstable/http/Etag.ts +40 -7
  1525. package/src/unstable/http/FetchHttpClient.ts +33 -4
  1526. package/src/unstable/http/FindMyWay.ts +1 -1
  1527. package/src/unstable/http/Headers.ts +252 -50
  1528. package/src/unstable/http/HttpBody.ts +128 -26
  1529. package/src/unstable/http/HttpClient.ts +205 -96
  1530. package/src/unstable/http/HttpClientError.ts +80 -12
  1531. package/src/unstable/http/HttpClientRequest.ts +318 -100
  1532. package/src/unstable/http/HttpClientResponse.ts +59 -16
  1533. package/src/unstable/http/HttpEffect.ts +66 -18
  1534. package/src/unstable/http/HttpIncomingMessage.ts +47 -7
  1535. package/src/unstable/http/HttpMethod.ts +35 -5
  1536. package/src/unstable/http/HttpMiddleware.ts +59 -11
  1537. package/src/unstable/http/HttpPlatform.ts +34 -3
  1538. package/src/unstable/http/HttpRouter.ts +217 -52
  1539. package/src/unstable/http/HttpServer.ts +151 -22
  1540. package/src/unstable/http/HttpServerError.ts +90 -10
  1541. package/src/unstable/http/HttpServerRequest.ts +125 -21
  1542. package/src/unstable/http/HttpServerRespondable.ts +49 -6
  1543. package/src/unstable/http/HttpServerResponse.ts +390 -67
  1544. package/src/unstable/http/HttpStaticServer.ts +22 -4
  1545. package/src/unstable/http/HttpTraceContext.ts +53 -6
  1546. package/src/unstable/http/Multipart.ts +178 -28
  1547. package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
  1548. package/src/unstable/http/Multipasta/Node.ts +1 -1
  1549. package/src/unstable/http/Multipasta/Search.ts +1 -1
  1550. package/src/unstable/http/Multipasta/Web.ts +1 -1
  1551. package/src/unstable/http/Multipasta.ts +1 -1
  1552. package/src/unstable/http/Template.ts +53 -0
  1553. package/src/unstable/http/Url.ts +56 -42
  1554. package/src/unstable/http/UrlParams.ts +233 -49
  1555. package/src/unstable/httpapi/HttpApi.ts +49 -14
  1556. package/src/unstable/httpapi/HttpApiBuilder.ts +82 -16
  1557. package/src/unstable/httpapi/HttpApiClient.ts +79 -15
  1558. package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
  1559. package/src/unstable/httpapi/HttpApiError.ts +100 -1
  1560. package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
  1561. package/src/unstable/httpapi/HttpApiMiddleware.ts +111 -22
  1562. package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
  1563. package/src/unstable/httpapi/HttpApiSchema.ts +67 -30
  1564. package/src/unstable/httpapi/HttpApiSecurity.ts +74 -17
  1565. package/src/unstable/httpapi/HttpApiSwagger.ts +24 -2
  1566. package/src/unstable/httpapi/HttpApiTest.ts +26 -1
  1567. package/src/unstable/httpapi/OpenApi.ts +115 -15
  1568. package/src/unstable/observability/Otlp.ts +33 -3
  1569. package/src/unstable/observability/OtlpExporter.ts +32 -1
  1570. package/src/unstable/observability/OtlpLogger.ts +31 -2
  1571. package/src/unstable/observability/OtlpMetrics.ts +37 -4
  1572. package/src/unstable/observability/OtlpResource.ts +68 -12
  1573. package/src/unstable/observability/OtlpSerialization.ts +28 -3
  1574. package/src/unstable/observability/OtlpTracer.ts +38 -2
  1575. package/src/unstable/observability/PrometheusMetrics.ts +32 -12
  1576. package/src/unstable/observability/index.ts +2 -1
  1577. package/src/unstable/persistence/KeyValueStore.ts +108 -28
  1578. package/src/unstable/persistence/Persistable.ts +76 -15
  1579. package/src/unstable/persistence/PersistedCache.ts +27 -2
  1580. package/src/unstable/persistence/PersistedQueue.ts +98 -16
  1581. package/src/unstable/persistence/Persistence.ts +97 -16
  1582. package/src/unstable/persistence/RateLimiter.ts +97 -21
  1583. package/src/unstable/persistence/Redis.ts +42 -5
  1584. package/src/unstable/process/ChildProcess.ts +89 -65
  1585. package/src/unstable/process/ChildProcessSpawner.ts +22 -11
  1586. package/src/unstable/process/index.ts +2 -1
  1587. package/src/unstable/reactivity/AsyncResult.ts +202 -61
  1588. package/src/unstable/reactivity/Atom.ts +593 -139
  1589. package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
  1590. package/src/unstable/reactivity/AtomRef.ts +51 -7
  1591. package/src/unstable/reactivity/AtomRegistry.ts +141 -22
  1592. package/src/unstable/reactivity/AtomRpc.ts +36 -2
  1593. package/src/unstable/reactivity/Hydration.ts +45 -5
  1594. package/src/unstable/reactivity/Reactivity.ts +95 -13
  1595. package/src/unstable/rpc/Rpc.ts +255 -56
  1596. package/src/unstable/rpc/RpcClient.ts +107 -19
  1597. package/src/unstable/rpc/RpcClientError.ts +26 -2
  1598. package/src/unstable/rpc/RpcGroup.ts +51 -8
  1599. package/src/unstable/rpc/RpcMessage.ts +128 -32
  1600. package/src/unstable/rpc/RpcMiddleware.ts +100 -20
  1601. package/src/unstable/rpc/RpcSchema.ts +38 -4
  1602. package/src/unstable/rpc/RpcSerialization.ts +60 -13
  1603. package/src/unstable/rpc/RpcServer.ts +107 -23
  1604. package/src/unstable/rpc/RpcTest.ts +20 -1
  1605. package/src/unstable/rpc/RpcWorker.ts +40 -6
  1606. package/src/unstable/rpc/Utils.ts +31 -0
  1607. package/src/unstable/schema/Model.ts +148 -52
  1608. package/src/unstable/schema/VariantSchema.ts +104 -24
  1609. package/src/unstable/socket/Socket.ts +167 -34
  1610. package/src/unstable/socket/SocketServer.ts +58 -10
  1611. package/src/unstable/sql/Migrator.ts +56 -4
  1612. package/src/unstable/sql/SqlClient.ts +55 -2
  1613. package/src/unstable/sql/SqlConnection.ts +31 -0
  1614. package/src/unstable/sql/SqlError.ts +117 -0
  1615. package/src/unstable/sql/SqlModel.ts +26 -5
  1616. package/src/unstable/sql/SqlResolver.ts +56 -13
  1617. package/src/unstable/sql/SqlSchema.ts +29 -8
  1618. package/src/unstable/sql/SqlStream.ts +23 -0
  1619. package/src/unstable/sql/Statement.ts +141 -0
  1620. package/src/unstable/sql/index.ts +1 -1
  1621. package/src/unstable/workers/Transferable.ts +65 -13
  1622. package/src/unstable/workers/Worker.ts +60 -8
  1623. package/src/unstable/workers/WorkerError.ts +50 -9
  1624. package/src/unstable/workers/WorkerRunner.ts +32 -3
  1625. package/src/unstable/workers/index.ts +1 -1
  1626. package/src/unstable/workflow/Activity.ts +61 -10
  1627. package/src/unstable/workflow/DurableClock.ts +26 -3
  1628. package/src/unstable/workflow/DurableDeferred.ts +146 -31
  1629. package/src/unstable/workflow/DurableQueue.ts +30 -7
  1630. package/src/unstable/workflow/Workflow.ts +121 -31
  1631. package/src/unstable/workflow/WorkflowEngine.ts +40 -5
  1632. package/src/unstable/workflow/WorkflowProxy.ts +32 -2
  1633. package/src/unstable/workflow/WorkflowProxyServer.ts +40 -6
@@ -12,9 +12,14 @@ declare const TypeId = "~effect/Schedule";
12
12
  /**
13
13
  * A Schedule defines a strategy for repeating or retrying effects based on some policy.
14
14
  *
15
- * @example
15
+ * **Example** (Defining retry and repeat schedules)
16
+ *
16
17
  * ```ts
17
- * import { Console, Effect, Schedule } from "effect"
18
+ * import { Console, Data, Effect, Schedule } from "effect"
19
+ *
20
+ * class NetworkError extends Data.TaggedError("NetworkError")<{
21
+ * readonly attempt: number
22
+ * }> {}
18
23
  *
19
24
  * // Basic retry schedule - retry up to 3 times with exponential backoff
20
25
  * const retrySchedule = Schedule.exponential("100 millis").pipe(
@@ -25,32 +30,37 @@ declare const TypeId = "~effect/Schedule";
25
30
  * const repeatSchedule: Schedule.Schedule<number, unknown, never> = Schedule
26
31
  * .spaced("30 seconds")
27
32
  *
28
- * // Advanced schedule with custom logic
29
- * const smartRetry = Schedule.exponential("1 second")
30
- *
31
33
  * const program = Effect.gen(function*() {
32
- * // Using retry schedule
34
+ * let attempts = 0
35
+ *
33
36
  * const result1 = yield* Effect.retry(
34
- * Effect.suspend(() => Math.random() > 0.5 ? Effect.fail("temporary error") : Effect.succeed("Success")),
37
+ * Effect.gen(function*() {
38
+ * attempts++
39
+ * if (attempts < 3) {
40
+ * return yield* Effect.fail(new NetworkError({ attempt: attempts }))
41
+ * }
42
+ * return "Success"
43
+ * }),
35
44
  * retrySchedule
36
45
  * )
46
+ * console.log(result1) // "Success"
37
47
  *
38
- * // Using repeat schedule
39
48
  * yield* Console.log("heartbeat").pipe(
40
49
  * Effect.repeat(repeatSchedule.pipe(Schedule.take(5)))
41
50
  * )
42
51
  * })
43
52
  * ```
44
53
  *
45
- * @since 2.0.0
46
54
  * @category Models
55
+ * @since 2.0.0
47
56
  */
48
57
  export interface Schedule<out Output, in Input = unknown, out Error = never, out Env = never> extends Schedule.Variance<Output, Input, Error, Env>, Pipeable {
49
58
  }
50
59
  /**
51
60
  * Metadata provided to schedule functions containing timing and input information.
52
61
  *
53
- * @example
62
+ * **Example** (Reading schedule input metadata)
63
+ *
54
64
  * ```ts
55
65
  * import { Console, Effect, Schedule } from "effect"
56
66
  *
@@ -69,8 +79,8 @@ export interface Schedule<out Output, in Input = unknown, out Error = never, out
69
79
  * })
70
80
  * ```
71
81
  *
72
- * @since 4.0.0
73
82
  * @category Metadata
83
+ * @since 4.0.0
74
84
  */
75
85
  export interface InputMetadata<Input> {
76
86
  readonly input: Input;
@@ -83,18 +93,19 @@ export interface InputMetadata<Input> {
83
93
  /**
84
94
  * Extended metadata that includes both input metadata and the output value from the schedule.
85
95
  *
86
- * @example
96
+ * **Example** (Logging schedule output metadata)
97
+ *
87
98
  * ```ts
88
99
  * import { Console, Duration, Effect, Schedule } from "effect"
89
100
  *
90
- * // Custom schedule that logs metadata including output
101
+ * // Custom schedule that logs metadata and output for each recurrence
91
102
  * const loggingSchedule = Schedule.unfold(0, (n) => Effect.succeed(n + 1)).pipe(
92
103
  * Schedule.addDelay(() => Effect.succeed(Duration.millis(100))),
93
- * Schedule.tapOutput((output) => {
94
- * return Console.log(
95
- * `Output: ${output}`
96
- * )
97
- * })
104
+ * Schedule.collectWhile((metadata) =>
105
+ * Console.log(
106
+ * `Output: ${metadata.output}, attempt: ${metadata.attempt}, elapsed: ${metadata.elapsed}ms`
107
+ * ).pipe(Effect.as(metadata.attempt <= 3))
108
+ * )
98
109
  * )
99
110
  *
100
111
  * const program = Effect.gen(function*() {
@@ -105,27 +116,36 @@ export interface InputMetadata<Input> {
105
116
  * })
106
117
  *
107
118
  * // Output logs will show:
108
- * // "Output: 0, Attempt: 1, Elapsed: 0ms, Since previous: 0ms"
109
- * // "Output: 1, Attempt: 2, Elapsed: 100ms, Since previous: 100ms"
110
- * // "Output: 2, Attempt: 3, Elapsed: 200ms, Since previous: 100ms"
119
+ * // Output: 0, attempt: 1, elapsed: 0ms
120
+ * // Output: 1, attempt: 2, elapsed: 100ms
121
+ * // Output: 2, attempt: 3, elapsed: 200ms
111
122
  * ```
112
123
  *
113
- * @since 4.0.0
114
124
  * @category Metadata
125
+ * @since 4.0.0
115
126
  */
116
127
  export interface Metadata<Output = unknown, Input = unknown> extends InputMetadata<Input> {
117
128
  readonly output: Output;
118
129
  readonly duration: Duration.Duration;
119
130
  }
120
131
  /**
121
- * @since 4.0.0
132
+ * Context reference containing metadata for the currently running schedule step.
133
+ *
134
+ * **Details**
135
+ * Repeat, retry, stream, and channel scheduling operations provide this service
136
+ * to effects run between schedule steps. The default value contains undefined
137
+ * input and output values, zero duration, and zeroed timing fields before any
138
+ * schedule step has produced metadata.
139
+ *
122
140
  * @category Metadata
141
+ * @since 4.0.0
123
142
  */
124
143
  export declare const CurrentMetadata: Context.Reference<Metadata<unknown, unknown>>;
125
144
  /**
126
145
  * The Schedule namespace contains types and utilities for working with schedules.
127
146
  *
128
- * @example
147
+ * **Example** (Creating custom schedules with the namespace)
148
+ *
129
149
  * ```ts
130
150
  * import { Duration, Effect, Schedule } from "effect"
131
151
  *
@@ -152,14 +172,15 @@ export declare const CurrentMetadata: Context.Reference<Metadata<unknown, unknow
152
172
  * })
153
173
  * ```
154
174
  *
155
- * @since 2.0.0
156
175
  * @category models
176
+ * @since 2.0.0
157
177
  */
158
178
  export declare namespace Schedule {
159
179
  /**
160
180
  * Variance interface that defines the type parameter relationships for Schedule.
161
181
  *
162
- * @example
182
+ * **Example** (Understanding schedule variance)
183
+ *
163
184
  * ```ts
164
185
  * import { Effect, Schedule } from "effect"
165
186
  *
@@ -183,43 +204,22 @@ export declare namespace Schedule {
183
204
  * const serviceSchedule = Schedule.spaced("5 seconds")
184
205
  * ```
185
206
  *
186
- * @since 2.0.0
187
207
  * @category Models
208
+ * @since 2.0.0
188
209
  */
189
210
  interface Variance<out Output, in Input, out Error, out Env> {
190
211
  readonly [TypeId]: VarianceStruct<Output, Input, Error, Env>;
191
212
  }
192
213
  /**
193
- * Internal structure that holds the variance annotations for Schedule type parameters.
194
- *
195
- * @example
196
- * ```ts
197
- * import { Effect, Schedule } from "effect"
198
- *
199
- * // The variance struct defines how Schedule's type parameters behave
200
- * // This internal interface is used for type variance annotations
201
- *
202
- * // Example showing variance relationships:
203
- * interface Animal {
204
- * name: string
205
- * }
206
- * interface Dog extends Animal {
207
- * breed: string
208
- * }
209
- *
210
- * // Output is covariant - more specific types can be substituted
211
- * const stringSchedule = Schedule.spaced("1 second").pipe(
212
- * Schedule.map(() => Effect.succeed("output"))
213
- * )
214
- *
215
- * // Input is contravariant - more general types can be accepted
216
- * const numberSchedule = Schedule.exponential("100 millis")
214
+ * Type-level marker used by `Schedule.Variance` to record the variance of
215
+ * `Schedule` type parameters.
217
216
  *
218
- * // This enables proper type relationships where schedules can be composed safely
219
- * ```
217
+ * **Notes**
218
+ * This interface exists for TypeScript inference and assignability. Users
219
+ * normally do not construct or inspect it directly.
220
220
  *
221
- * @since 2.0.0
222
221
  * @category Models
222
+ * @since 2.0.0
223
223
  */
224
224
  interface VarianceStruct<out Output, in Input, out Error, out Env> {
225
225
  readonly _Out: Covariant<Output>;
@@ -231,7 +231,8 @@ export declare namespace Schedule {
231
231
  /**
232
232
  * Type guard that checks if a value is a Schedule.
233
233
  *
234
- * @example
234
+ * **Example** (Checking for schedules)
235
+ *
235
236
  * ```ts
236
237
  * import { Schedule } from "effect"
237
238
  *
@@ -244,64 +245,63 @@ export declare namespace Schedule {
244
245
  * console.log(Schedule.isSchedule(undefined)) // false
245
246
  * ```
246
247
  *
247
- * @since 2.0.0
248
248
  * @category guards
249
+ * @since 2.0.0
249
250
  */
250
251
  export declare const isSchedule: (u: unknown) => u is Schedule<unknown, never, unknown, unknown>;
251
252
  /**
252
253
  * Creates a Schedule from a step function that returns a Pull.
253
254
  *
254
- * @example
255
- * ```ts
256
- * import { Schedule } from "effect"
255
+ * **Example** (Creating a custom schedule from a step function)
257
256
  *
258
- * // fromStep is an advanced function for creating custom schedules
259
- * // It requires a step function that returns a Pull value
257
+ * ```ts
258
+ * import { Cause, Duration, Effect, Schedule } from "effect"
260
259
  *
261
- * // Most users should use simpler schedule constructors like:
262
- * const simpleSchedule = Schedule.exponential("100 millis")
263
- * const spacedSchedule = Schedule.spaced("1 second")
264
- * const recurringSchedule = Schedule.recurs(5)
260
+ * const schedule = Schedule.fromStep(Effect.sync(() => {
261
+ * let count = 0
265
262
  *
266
- * // These can be combined and transformed as needed
267
- * const complexSchedule = simpleSchedule.pipe(
268
- * Schedule.both(Schedule.recurs(3))
269
- * )
263
+ * return (_now: number, _input: string) => {
264
+ * if (count >= 3) {
265
+ * return Cause.done(count)
266
+ * }
267
+ * return Effect.succeed([count++, Duration.millis(100)] as [number, Duration.Duration])
268
+ * }
269
+ * }))
270
270
  * ```
271
271
  *
272
- * @since 4.0.0
273
272
  * @category constructors
273
+ * @since 4.0.0
274
274
  */
275
275
  export declare const fromStep: <Input, Output, EnvX, Error, ErrorX, Env>(step: Effect<(now: number, input: Input) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, Error, Env>) => Schedule<Output, Input, Error | Pull.ExcludeDone<ErrorX>, Env | EnvX>;
276
276
  /**
277
277
  * Creates a Schedule from a step function that receives metadata about the schedule's execution.
278
278
  *
279
- * @example
280
- * ```ts
281
- * import { Effect, Schedule } from "effect"
279
+ * **Example** (Creating a metadata-aware schedule)
282
280
  *
283
- * // fromStepWithMetadata is an advanced function for creating schedules
284
- * // that need access to execution metadata like timing and recurrence count
281
+ * ```ts
282
+ * import { Cause, Duration, Effect, Schedule } from "effect"
285
283
  *
286
- * // Most users should use simpler metadata-aware functions like:
287
- * const metadataSchedule = Schedule.spaced("1 second").pipe(
288
- * Schedule.collectWhile((metadata) => Effect.succeed(metadata.attempt <= 5))
289
- * )
284
+ * const firstThreeInputs = Schedule.fromStepWithMetadata(Effect.succeed((metadata: Schedule.InputMetadata<string>) => {
285
+ * if (metadata.attempt > 3) {
286
+ * return Cause.done("finished")
287
+ * }
290
288
  *
291
- * // Or use existing schedules with metadata transformations:
292
- * const conditionalSchedule = Schedule.exponential("100 millis").pipe(
293
- * Schedule.tapOutput((output) => Effect.log(`Output: ${output}`))
294
- * )
289
+ * return Effect.succeed([
290
+ * `attempt ${metadata.attempt}: ${metadata.input}`,
291
+ * Duration.millis(250)
292
+ * ] as [string, Duration.Duration])
293
+ * }))
295
294
  * ```
296
295
  *
297
- * @since 4.0.0
298
296
  * @category constructors
297
+ * @since 4.0.0
299
298
  */
300
299
  export declare const fromStepWithMetadata: <Input, Output, EnvX, ErrorX, Error, Env>(step: Effect<(options: InputMetadata<Input>) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, Error, Env>) => Schedule<Output, Input, Error | Pull.ExcludeDone<ErrorX>, Env | EnvX>;
301
300
  /**
302
301
  * Extracts the step function from a Schedule.
303
302
  *
304
- * @example
303
+ * **Example** (Extracting a schedule step function)
304
+ *
305
305
  * ```ts
306
306
  * import { Effect, Schedule } from "effect"
307
307
  *
@@ -311,30 +311,32 @@ export declare const fromStepWithMetadata: <Input, Output, EnvX, ErrorX, Error,
311
311
  * const program = Effect.gen(function*() {
312
312
  * const stepFn = yield* Schedule.toStep(schedule)
313
313
  *
314
- * // Use the step function directly for custom logic
315
- * const now = Date.now()
314
+ * // Use the step function directly for custom logic. The timestamp is
315
+ * // supplied by the caller, so tests can pass a deterministic value.
316
+ * const now = 0
316
317
  * const result = yield* stepFn(now, "input")
317
318
  *
318
319
  * console.log(`Step result: ${result}`)
319
320
  * })
320
321
  * ```
321
322
  *
322
- * @since 4.0.0
323
323
  * @category destructors
324
+ * @since 4.0.0
324
325
  */
325
326
  export declare const toStep: <Output, Input, Error, Env>(schedule: Schedule<Output, Input, Error, Env>) => Effect<(now: number, input: Input) => Pull.Pull<[Output, Duration.Duration], Error, Output, Env>, never, Env>;
326
327
  /**
327
328
  * Extracts a step function from a Schedule that provides metadata about each
328
329
  * execution. It will also handle sleeping for the computed delay.
329
330
  *
330
- * @since 4.0.0
331
331
  * @category destructors
332
+ * @since 4.0.0
332
333
  */
333
334
  export declare const toStepWithMetadata: <Output, Input, Error, Env>(schedule: Schedule<Output, Input, Error, Env>) => Effect<(input: Input) => Pull.Pull<Metadata<Output, Input>, Error, Output, Env>, never, Env>;
334
335
  /**
335
336
  * Extracts a step function from a Schedule that automatically handles sleep delays.
336
337
  *
337
- * @example
338
+ * **Example** (Extracting a sleeping step function)
339
+ *
338
340
  * ```ts
339
341
  * import { Effect, Schedule } from "effect"
340
342
  *
@@ -357,37 +359,34 @@ export declare const toStepWithMetadata: <Output, Input, Error, Env>(schedule: S
357
359
  * })
358
360
  * ```
359
361
  *
360
- * @since 4.0.0
361
362
  * @category destructors
363
+ * @since 4.0.0
362
364
  */
363
365
  export declare const toStepWithSleep: <Output, Input, Error, Env>(schedule: Schedule<Output, Input, Error, Env>) => Effect<(input: Input) => Pull.Pull<Output, Error, Output, Env>, never, Env>;
364
366
  /**
365
367
  * Returns a new `Schedule` that adds the delay computed by the specified
366
368
  * effectful function to the the next recurrence of the schedule.
367
369
  *
368
- * @example
370
+ * **Example** (Adding extra delay to a schedule)
371
+ *
369
372
  * ```ts
370
373
  * import { Console, Data, Duration, Effect, Schedule } from "effect"
371
374
  *
372
375
  * class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
373
376
  *
374
- * // Add random jitter to schedule delays
375
- * const jitteredSchedule = Schedule.addDelay(
377
+ * // Add a deterministic extra delay based on the schedule output
378
+ * const delayedSchedule = Schedule.addDelay(
376
379
  * Schedule.exponential("100 millis").pipe(Schedule.take(5)),
377
380
  * (output) =>
378
- * // Add random jitter between 0-50ms
379
- * Effect.succeed(Duration.millis(Math.random() * 50))
381
+ * Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
380
382
  * )
381
383
  *
382
- * const jitterProgram = Effect.gen(function*() {
384
+ * const repeatProgram = Effect.gen(function*() {
383
385
  * yield* Effect.repeat(
384
- * Effect.gen(function*() {
385
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
386
- * return "jittered task"
387
- * }),
388
- * jitteredSchedule.pipe(
386
+ * Effect.succeed("delayed task"),
387
+ * delayedSchedule.pipe(
389
388
  * Schedule.tapOutput((delay) =>
390
- * Console.log(`Base delay with jitter applied`)
389
+ * Console.log(`Base delay: ${delay}`)
391
390
  * )
392
391
  * )
393
392
  * )
@@ -415,12 +414,15 @@ export declare const toStepWithSleep: <Output, Input, Error, Env>(schedule: Sche
415
414
  * )
416
415
  * })
417
416
  *
418
- * // Add effectful delay computation
417
+ * // Add effectful delay computation from deterministic service data
418
+ * const loadByExecution = [1, 3, 2, 4] as const
419
+ *
419
420
  * const dynamicSchedule = Schedule.addDelay(
420
421
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
421
- * (executionNumber) =>
422
- * // Simulate checking system load and return additional delay
423
- * Effect.succeed(Duration.millis(Math.random() > 0.7 ? 2000 : 500))
422
+ * (executionNumber) => {
423
+ * const load = loadByExecution[executionNumber] ?? 1
424
+ * return Effect.succeed(Duration.millis(load * 100))
425
+ * }
424
426
  * )
425
427
  *
426
428
  * const dynamicProgram = Effect.gen(function*() {
@@ -433,25 +435,6 @@ export declare const toStepWithSleep: <Output, Input, Error, Env>(schedule: Sche
433
435
  * )
434
436
  * })
435
437
  *
436
- * // Add delay based on previous execution results (30% extra)
437
- * const resultBasedSchedule = Schedule.addDelay(
438
- * Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
439
- * (fibonacciDelay) =>
440
- * Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
441
- * )
442
- *
443
- * const resultProgram = Effect.gen(function*() {
444
- * yield* Effect.repeat(
445
- * Effect.gen(function*() {
446
- * yield* Console.log("Result-based delay task")
447
- * return Math.random()
448
- * }),
449
- * resultBasedSchedule.pipe(
450
- * Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
451
- * )
452
- * )
453
- * })
454
- *
455
438
  * // Combine with retry for progressive backoff
456
439
  * const progressiveRetrySchedule = Schedule.addDelay(
457
440
  * Schedule.exponential("50 millis").pipe(Schedule.take(4)),
@@ -476,37 +459,34 @@ export declare const toStepWithSleep: <Output, Input, Error, Env>(schedule: Sche
476
459
  * })
477
460
  * ```
478
461
  *
479
- * @since 2.0.0
480
462
  * @category utils
463
+ * @since 2.0.0
481
464
  */
482
465
  export declare const addDelay: {
483
466
  /**
484
467
  * Returns a new `Schedule` that adds the delay computed by the specified
485
468
  * effectful function to the the next recurrence of the schedule.
486
469
  *
487
- * @example
470
+ * **Example** (Adding extra delay to a schedule)
471
+ *
488
472
  * ```ts
489
473
  * import { Console, Data, Duration, Effect, Schedule } from "effect"
490
474
  *
491
475
  * class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
492
476
  *
493
- * // Add random jitter to schedule delays
494
- * const jitteredSchedule = Schedule.addDelay(
477
+ * // Add a deterministic extra delay based on the schedule output
478
+ * const delayedSchedule = Schedule.addDelay(
495
479
  * Schedule.exponential("100 millis").pipe(Schedule.take(5)),
496
480
  * (output) =>
497
- * // Add random jitter between 0-50ms
498
- * Effect.succeed(Duration.millis(Math.random() * 50))
481
+ * Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
499
482
  * )
500
483
  *
501
- * const jitterProgram = Effect.gen(function*() {
484
+ * const repeatProgram = Effect.gen(function*() {
502
485
  * yield* Effect.repeat(
503
- * Effect.gen(function*() {
504
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
505
- * return "jittered task"
506
- * }),
507
- * jitteredSchedule.pipe(
486
+ * Effect.succeed("delayed task"),
487
+ * delayedSchedule.pipe(
508
488
  * Schedule.tapOutput((delay) =>
509
- * Console.log(`Base delay with jitter applied`)
489
+ * Console.log(`Base delay: ${delay}`)
510
490
  * )
511
491
  * )
512
492
  * )
@@ -534,12 +514,15 @@ export declare const addDelay: {
534
514
  * )
535
515
  * })
536
516
  *
537
- * // Add effectful delay computation
517
+ * // Add effectful delay computation from deterministic service data
518
+ * const loadByExecution = [1, 3, 2, 4] as const
519
+ *
538
520
  * const dynamicSchedule = Schedule.addDelay(
539
521
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
540
- * (executionNumber) =>
541
- * // Simulate checking system load and return additional delay
542
- * Effect.succeed(Duration.millis(Math.random() > 0.7 ? 2000 : 500))
522
+ * (executionNumber) => {
523
+ * const load = loadByExecution[executionNumber] ?? 1
524
+ * return Effect.succeed(Duration.millis(load * 100))
525
+ * }
543
526
  * )
544
527
  *
545
528
  * const dynamicProgram = Effect.gen(function*() {
@@ -552,25 +535,6 @@ export declare const addDelay: {
552
535
  * )
553
536
  * })
554
537
  *
555
- * // Add delay based on previous execution results (30% extra)
556
- * const resultBasedSchedule = Schedule.addDelay(
557
- * Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
558
- * (fibonacciDelay) =>
559
- * Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
560
- * )
561
- *
562
- * const resultProgram = Effect.gen(function*() {
563
- * yield* Effect.repeat(
564
- * Effect.gen(function*() {
565
- * yield* Console.log("Result-based delay task")
566
- * return Math.random()
567
- * }),
568
- * resultBasedSchedule.pipe(
569
- * Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
570
- * )
571
- * )
572
- * })
573
- *
574
538
  * // Combine with retry for progressive backoff
575
539
  * const progressiveRetrySchedule = Schedule.addDelay(
576
540
  * Schedule.exponential("50 millis").pipe(Schedule.take(4)),
@@ -595,37 +559,34 @@ export declare const addDelay: {
595
559
  * })
596
560
  * ```
597
561
  *
598
- * @since 2.0.0
599
562
  * @category utils
563
+ * @since 2.0.0
600
564
  */
601
565
  <Output, Error2 = never, Env2 = never>(f: (output: Output) => Effect<Duration.Input, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
602
566
  /**
603
567
  * Returns a new `Schedule` that adds the delay computed by the specified
604
568
  * effectful function to the the next recurrence of the schedule.
605
569
  *
606
- * @example
570
+ * **Example** (Adding extra delay to a schedule)
571
+ *
607
572
  * ```ts
608
573
  * import { Console, Data, Duration, Effect, Schedule } from "effect"
609
574
  *
610
575
  * class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
611
576
  *
612
- * // Add random jitter to schedule delays
613
- * const jitteredSchedule = Schedule.addDelay(
577
+ * // Add a deterministic extra delay based on the schedule output
578
+ * const delayedSchedule = Schedule.addDelay(
614
579
  * Schedule.exponential("100 millis").pipe(Schedule.take(5)),
615
580
  * (output) =>
616
- * // Add random jitter between 0-50ms
617
- * Effect.succeed(Duration.millis(Math.random() * 50))
581
+ * Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
618
582
  * )
619
583
  *
620
- * const jitterProgram = Effect.gen(function*() {
584
+ * const repeatProgram = Effect.gen(function*() {
621
585
  * yield* Effect.repeat(
622
- * Effect.gen(function*() {
623
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
624
- * return "jittered task"
625
- * }),
626
- * jitteredSchedule.pipe(
586
+ * Effect.succeed("delayed task"),
587
+ * delayedSchedule.pipe(
627
588
  * Schedule.tapOutput((delay) =>
628
- * Console.log(`Base delay with jitter applied`)
589
+ * Console.log(`Base delay: ${delay}`)
629
590
  * )
630
591
  * )
631
592
  * )
@@ -653,12 +614,15 @@ export declare const addDelay: {
653
614
  * )
654
615
  * })
655
616
  *
656
- * // Add effectful delay computation
617
+ * // Add effectful delay computation from deterministic service data
618
+ * const loadByExecution = [1, 3, 2, 4] as const
619
+ *
657
620
  * const dynamicSchedule = Schedule.addDelay(
658
621
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
659
- * (executionNumber) =>
660
- * // Simulate checking system load and return additional delay
661
- * Effect.succeed(Duration.millis(Math.random() > 0.7 ? 2000 : 500))
622
+ * (executionNumber) => {
623
+ * const load = loadByExecution[executionNumber] ?? 1
624
+ * return Effect.succeed(Duration.millis(load * 100))
625
+ * }
662
626
  * )
663
627
  *
664
628
  * const dynamicProgram = Effect.gen(function*() {
@@ -671,25 +635,6 @@ export declare const addDelay: {
671
635
  * )
672
636
  * })
673
637
  *
674
- * // Add delay based on previous execution results (30% extra)
675
- * const resultBasedSchedule = Schedule.addDelay(
676
- * Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
677
- * (fibonacciDelay) =>
678
- * Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
679
- * )
680
- *
681
- * const resultProgram = Effect.gen(function*() {
682
- * yield* Effect.repeat(
683
- * Effect.gen(function*() {
684
- * yield* Console.log("Result-based delay task")
685
- * return Math.random()
686
- * }),
687
- * resultBasedSchedule.pipe(
688
- * Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
689
- * )
690
- * )
691
- * })
692
- *
693
638
  * // Combine with retry for progressive backoff
694
639
  * const progressiveRetrySchedule = Schedule.addDelay(
695
640
  * Schedule.exponential("50 millis").pipe(Schedule.take(4)),
@@ -714,8 +659,8 @@ export declare const addDelay: {
714
659
  * })
715
660
  * ```
716
661
  *
717
- * @since 2.0.0
718
662
  * @category utils
663
+ * @since 2.0.0
719
664
  */
720
665
  <Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output) => Effect<Duration.Input, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
721
666
  };
@@ -724,7 +669,8 @@ export declare const addDelay: {
724
669
  * schedule to completion. Once the left schedule is complete, the right (i.e.
725
670
  * `other`) schedule will be executed to completion.
726
671
  *
727
- * @example
672
+ * **Example** (Sequencing quick and slow retries)
673
+ *
728
674
  * ```ts
729
675
  * import { Console, Data, Effect, Schedule } from "effect"
730
676
  *
@@ -756,8 +702,8 @@ export declare const addDelay: {
756
702
  * })
757
703
  * ```
758
704
  *
759
- * @since 2.0.0
760
705
  * @category sequencing
706
+ * @since 2.0.0
761
707
  */
762
708
  export declare const andThen: {
763
709
  /**
@@ -765,7 +711,8 @@ export declare const andThen: {
765
711
  * schedule to completion. Once the left schedule is complete, the right (i.e.
766
712
  * `other`) schedule will be executed to completion.
767
713
  *
768
- * @example
714
+ * **Example** (Sequencing quick and slow retries)
715
+ *
769
716
  * ```ts
770
717
  * import { Console, Data, Effect, Schedule } from "effect"
771
718
  *
@@ -797,8 +744,8 @@ export declare const andThen: {
797
744
  * })
798
745
  * ```
799
746
  *
800
- * @since 2.0.0
801
747
  * @category sequencing
748
+ * @since 2.0.0
802
749
  */
803
750
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output | Output2, Input & Input2, Error | Error2, Env | Env2>;
804
751
  /**
@@ -806,7 +753,8 @@ export declare const andThen: {
806
753
  * schedule to completion. Once the left schedule is complete, the right (i.e.
807
754
  * `other`) schedule will be executed to completion.
808
755
  *
809
- * @example
756
+ * **Example** (Sequencing quick and slow retries)
757
+ *
810
758
  * ```ts
811
759
  * import { Console, Data, Effect, Schedule } from "effect"
812
760
  *
@@ -838,8 +786,8 @@ export declare const andThen: {
838
786
  * })
839
787
  * ```
840
788
  *
841
- * @since 2.0.0
842
789
  * @category sequencing
790
+ * @since 2.0.0
843
791
  */
844
792
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<Output | Output2, Input & Input2, Error | Error2, Env | Env2>;
845
793
  };
@@ -848,11 +796,12 @@ export declare const andThen: {
848
796
  * schedule to completion. Once the left schedule is complete, the right (i.e.
849
797
  * `other`) schedule will be executed to completion.
850
798
  *
851
- * The output of the resulting schedule is a `Result` where outputs of the
852
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
853
- * schedule are emitted as `Result.Ok<Output>`.
799
+ * The resulting schedule emits a `Result` to indicate which phase produced
800
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
801
+ * `other` are emitted as `Success`.
802
+ *
803
+ * **Example** (Tracking sequential schedule phases)
854
804
  *
855
- * @example
856
805
  * ```ts
857
806
  * import { Console, Effect, Result, Schedule } from "effect"
858
807
  *
@@ -880,8 +829,8 @@ export declare const andThen: {
880
829
  * })
881
830
  * ```
882
831
  *
883
- * @since 2.0.0
884
832
  * @category sequencing
833
+ * @since 2.0.0
885
834
  */
886
835
  export declare const andThenResult: {
887
836
  /**
@@ -889,11 +838,12 @@ export declare const andThenResult: {
889
838
  * schedule to completion. Once the left schedule is complete, the right (i.e.
890
839
  * `other`) schedule will be executed to completion.
891
840
  *
892
- * The output of the resulting schedule is a `Result` where outputs of the
893
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
894
- * schedule are emitted as `Result.Ok<Output>`.
841
+ * The resulting schedule emits a `Result` to indicate which phase produced
842
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
843
+ * `other` are emitted as `Success`.
844
+ *
845
+ * **Example** (Tracking sequential schedule phases)
895
846
  *
896
- * @example
897
847
  * ```ts
898
848
  * import { Console, Effect, Result, Schedule } from "effect"
899
849
  *
@@ -921,8 +871,8 @@ export declare const andThenResult: {
921
871
  * })
922
872
  * ```
923
873
  *
924
- * @since 2.0.0
925
874
  * @category sequencing
875
+ * @since 2.0.0
926
876
  */
927
877
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Result.Result<Output2, Output>, Input & Input2, Error | Error2, Env | Env2>;
928
878
  /**
@@ -930,11 +880,12 @@ export declare const andThenResult: {
930
880
  * schedule to completion. Once the left schedule is complete, the right (i.e.
931
881
  * `other`) schedule will be executed to completion.
932
882
  *
933
- * The output of the resulting schedule is a `Result` where outputs of the
934
- * left schedule are emitted as `Result.Err<Output>` and outputs of the right
935
- * schedule are emitted as `Result.Ok<Output>`.
883
+ * The resulting schedule emits a `Result` to indicate which phase produced
884
+ * each output: outputs from `self` are emitted as `Failure`, and outputs from
885
+ * `other` are emitted as `Success`.
886
+ *
887
+ * **Example** (Tracking sequential schedule phases)
936
888
  *
937
- * @example
938
889
  * ```ts
939
890
  * import { Console, Effect, Result, Schedule } from "effect"
940
891
  *
@@ -962,8 +913,8 @@ export declare const andThenResult: {
962
913
  * })
963
914
  * ```
964
915
  *
965
- * @since 2.0.0
966
916
  * @category sequencing
917
+ * @since 2.0.0
967
918
  */
968
919
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<Result.Result<Output2, Output>, Input & Input2, Error | Error2, Env | Env2>;
969
920
  };
@@ -972,7 +923,8 @@ export declare const andThenResult: {
972
923
  * to recur, using the maximum of the two durations between recurrences and
973
924
  * outputting a tuple of the outputs of both schedules.
974
925
  *
975
- * @example
926
+ * **Example** (Combining time and attempt limits)
927
+ *
976
928
  * ```ts
977
929
  * import { Console, Data, Effect, Schedule } from "effect"
978
930
  *
@@ -989,7 +941,7 @@ export declare const andThenResult: {
989
941
  * const program = Effect.gen(function*() {
990
942
  * const results = yield* Effect.repeat(
991
943
  * Effect.gen(function*() {
992
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
944
+ * yield* Console.log("Task executed")
993
945
  * return "task completed"
994
946
  * }),
995
947
  * bothSchedule.pipe(
@@ -1033,8 +985,8 @@ export declare const andThenResult: {
1033
985
  * // Compare with either which provides union semantics (OR logic)
1034
986
  * ```
1035
987
  *
1036
- * @since 2.0.0
1037
988
  * @category utilities
989
+ * @since 2.0.0
1038
990
  */
1039
991
  export declare const both: {
1040
992
  /**
@@ -1042,7 +994,8 @@ export declare const both: {
1042
994
  * to recur, using the maximum of the two durations between recurrences and
1043
995
  * outputting a tuple of the outputs of both schedules.
1044
996
  *
1045
- * @example
997
+ * **Example** (Combining time and attempt limits)
998
+ *
1046
999
  * ```ts
1047
1000
  * import { Console, Data, Effect, Schedule } from "effect"
1048
1001
  *
@@ -1059,7 +1012,7 @@ export declare const both: {
1059
1012
  * const program = Effect.gen(function*() {
1060
1013
  * const results = yield* Effect.repeat(
1061
1014
  * Effect.gen(function*() {
1062
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
1015
+ * yield* Console.log("Task executed")
1063
1016
  * return "task completed"
1064
1017
  * }),
1065
1018
  * bothSchedule.pipe(
@@ -1103,8 +1056,8 @@ export declare const both: {
1103
1056
  * // Compare with either which provides union semantics (OR logic)
1104
1057
  * ```
1105
1058
  *
1106
- * @since 2.0.0
1107
1059
  * @category utilities
1060
+ * @since 2.0.0
1108
1061
  */
1109
1062
  <Output2, Input2, Error2, Env2, Output>(other: Schedule<Output2, Input2, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<[Output, Output2], Input & Input2, Error | Error2, Env | Env2>;
1110
1063
  /**
@@ -1112,7 +1065,8 @@ export declare const both: {
1112
1065
  * to recur, using the maximum of the two durations between recurrences and
1113
1066
  * outputting a tuple of the outputs of both schedules.
1114
1067
  *
1115
- * @example
1068
+ * **Example** (Combining time and attempt limits)
1069
+ *
1116
1070
  * ```ts
1117
1071
  * import { Console, Data, Effect, Schedule } from "effect"
1118
1072
  *
@@ -1129,7 +1083,7 @@ export declare const both: {
1129
1083
  * const program = Effect.gen(function*() {
1130
1084
  * const results = yield* Effect.repeat(
1131
1085
  * Effect.gen(function*() {
1132
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
1086
+ * yield* Console.log("Task executed")
1133
1087
  * return "task completed"
1134
1088
  * }),
1135
1089
  * bothSchedule.pipe(
@@ -1173,8 +1127,8 @@ export declare const both: {
1173
1127
  * // Compare with either which provides union semantics (OR logic)
1174
1128
  * ```
1175
1129
  *
1176
- * @since 2.0.0
1177
1130
  * @category utilities
1131
+ * @since 2.0.0
1178
1132
  */
1179
1133
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<[Output, Output2], Input & Input2, Error | Error2, Env | Env2>;
1180
1134
  };
@@ -1183,7 +1137,8 @@ export declare const both: {
1183
1137
  * to recur, using the maximum of the two durations between recurrences and
1184
1138
  * outputting the result of the left schedule (i.e. `self`).
1185
1139
  *
1186
- * @example
1140
+ * **Example** (Combining schedules and keeping the left output)
1141
+ *
1187
1142
  * ```ts
1188
1143
  * import { Console, Effect, Schedule } from "effect"
1189
1144
  *
@@ -1206,8 +1161,8 @@ export declare const both: {
1206
1161
  * })
1207
1162
  * ```
1208
1163
  *
1209
- * @since 2.0.0
1210
1164
  * @category utilities
1165
+ * @since 2.0.0
1211
1166
  */
1212
1167
  export declare const bothLeft: {
1213
1168
  /**
@@ -1215,7 +1170,8 @@ export declare const bothLeft: {
1215
1170
  * to recur, using the maximum of the two durations between recurrences and
1216
1171
  * outputting the result of the left schedule (i.e. `self`).
1217
1172
  *
1218
- * @example
1173
+ * **Example** (Combining schedules and keeping the left output)
1174
+ *
1219
1175
  * ```ts
1220
1176
  * import { Console, Effect, Schedule } from "effect"
1221
1177
  *
@@ -1238,8 +1194,8 @@ export declare const bothLeft: {
1238
1194
  * })
1239
1195
  * ```
1240
1196
  *
1241
- * @since 2.0.0
1242
1197
  * @category utilities
1198
+ * @since 2.0.0
1243
1199
  */
1244
1200
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input & Input2, Error | Error2, Env | Env2>;
1245
1201
  /**
@@ -1247,7 +1203,8 @@ export declare const bothLeft: {
1247
1203
  * to recur, using the maximum of the two durations between recurrences and
1248
1204
  * outputting the result of the left schedule (i.e. `self`).
1249
1205
  *
1250
- * @example
1206
+ * **Example** (Combining schedules and keeping the left output)
1207
+ *
1251
1208
  * ```ts
1252
1209
  * import { Console, Effect, Schedule } from "effect"
1253
1210
  *
@@ -1270,8 +1227,8 @@ export declare const bothLeft: {
1270
1227
  * })
1271
1228
  * ```
1272
1229
  *
1273
- * @since 2.0.0
1274
1230
  * @category utilities
1231
+ * @since 2.0.0
1275
1232
  */
1276
1233
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<Output, Input & Input2, Error | Error2, Env | Env2>;
1277
1234
  };
@@ -1280,7 +1237,8 @@ export declare const bothLeft: {
1280
1237
  * to recur, using the maximum of the two durations between recurrences and
1281
1238
  * outputting the result of the right schedule (i.e. `other`).
1282
1239
  *
1283
- * @example
1240
+ * **Example** (Combining schedules and keeping the right output)
1241
+ *
1284
1242
  * ```ts
1285
1243
  * import { Console, Effect, Schedule } from "effect"
1286
1244
  *
@@ -1305,8 +1263,8 @@ export declare const bothLeft: {
1305
1263
  * })
1306
1264
  * ```
1307
1265
  *
1308
- * @since 2.0.0
1309
1266
  * @category utilities
1267
+ * @since 2.0.0
1310
1268
  */
1311
1269
  export declare const bothRight: {
1312
1270
  /**
@@ -1314,7 +1272,8 @@ export declare const bothRight: {
1314
1272
  * to recur, using the maximum of the two durations between recurrences and
1315
1273
  * outputting the result of the right schedule (i.e. `other`).
1316
1274
  *
1317
- * @example
1275
+ * **Example** (Combining schedules and keeping the right output)
1276
+ *
1318
1277
  * ```ts
1319
1278
  * import { Console, Effect, Schedule } from "effect"
1320
1279
  *
@@ -1339,8 +1298,8 @@ export declare const bothRight: {
1339
1298
  * })
1340
1299
  * ```
1341
1300
  *
1342
- * @since 2.0.0
1343
1301
  * @category utilities
1302
+ * @since 2.0.0
1344
1303
  */
1345
1304
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input & Input2, Error | Error2, Env | Env2>;
1346
1305
  /**
@@ -1348,7 +1307,8 @@ export declare const bothRight: {
1348
1307
  * to recur, using the maximum of the two durations between recurrences and
1349
1308
  * outputting the result of the right schedule (i.e. `other`).
1350
1309
  *
1351
- * @example
1310
+ * **Example** (Combining schedules and keeping the right output)
1311
+ *
1352
1312
  * ```ts
1353
1313
  * import { Console, Effect, Schedule } from "effect"
1354
1314
  *
@@ -1373,8 +1333,8 @@ export declare const bothRight: {
1373
1333
  * })
1374
1334
  * ```
1375
1335
  *
1376
- * @since 2.0.0
1377
1336
  * @category utilities
1337
+ * @since 2.0.0
1378
1338
  */
1379
1339
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<Output, Input & Input2, Error | Error2, Env | Env2>;
1380
1340
  };
@@ -1384,7 +1344,8 @@ export declare const bothRight: {
1384
1344
  * outputting the result of the combination of both schedule outputs using the
1385
1345
  * specified `combine` function.
1386
1346
  *
1387
- * @example
1347
+ * **Example** (Combining schedule outputs)
1348
+ *
1388
1349
  * ```ts
1389
1350
  * import { Console, Effect, Schedule } from "effect"
1390
1351
  *
@@ -1413,8 +1374,8 @@ export declare const bothRight: {
1413
1374
  * })
1414
1375
  * ```
1415
1376
  *
1416
- * @since 2.0.0
1417
1377
  * @category utilities
1378
+ * @since 2.0.0
1418
1379
  */
1419
1380
  export declare const bothWith: {
1420
1381
  /**
@@ -1423,7 +1384,8 @@ export declare const bothWith: {
1423
1384
  * outputting the result of the combination of both schedule outputs using the
1424
1385
  * specified `combine` function.
1425
1386
  *
1426
- * @example
1387
+ * **Example** (Combining schedule outputs)
1388
+ *
1427
1389
  * ```ts
1428
1390
  * import { Console, Effect, Schedule } from "effect"
1429
1391
  *
@@ -1452,8 +1414,8 @@ export declare const bothWith: {
1452
1414
  * })
1453
1415
  * ```
1454
1416
  *
1455
- * @since 2.0.0
1456
1417
  * @category utilities
1418
+ * @since 2.0.0
1457
1419
  */
1458
1420
  <Output2, Input2, Error2, Env2, Output, Output3>(other: Schedule<Output2, Input2, Error2, Env2>, combine: (selfOutput: Output, otherOutput: Output2) => Output3): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output3, Input & Input2, Error | Error2, Env | Env2>;
1459
1421
  /**
@@ -1462,7 +1424,8 @@ export declare const bothWith: {
1462
1424
  * outputting the result of the combination of both schedule outputs using the
1463
1425
  * specified `combine` function.
1464
1426
  *
1465
- * @example
1427
+ * **Example** (Combining schedule outputs)
1428
+ *
1466
1429
  * ```ts
1467
1430
  * import { Console, Effect, Schedule } from "effect"
1468
1431
  *
@@ -1491,16 +1454,21 @@ export declare const bothWith: {
1491
1454
  * })
1492
1455
  * ```
1493
1456
  *
1494
- * @since 2.0.0
1495
1457
  * @category utilities
1458
+ * @since 2.0.0
1496
1459
  */
1497
1460
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2, Output3>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>, combine: (selfOutput: Output, otherOutput: Output2) => Output3): Schedule<Output3, Input & Input2, Error | Error2, Env | Env2>;
1498
1461
  };
1499
1462
  /**
1500
- * Returns a new `Schedule` that always recurs, collecting all inputs of the
1501
- * schedule into an array.
1463
+ * Returns a new `Schedule` that follows `self` and outputs the inputs seen so
1464
+ * far as an array.
1465
+ *
1466
+ * **Details**
1467
+ * This does not make the schedule run forever. The collected schedule stops
1468
+ * when `self` stops and fails when `self` fails.
1469
+ *
1470
+ * **Example** (Collecting schedule inputs)
1502
1471
  *
1503
- * @example
1504
1472
  * ```ts
1505
1473
  * import { Console, Effect, Schedule } from "effect"
1506
1474
  *
@@ -1522,15 +1490,20 @@ export declare const bothWith: {
1522
1490
  * })
1523
1491
  * ```
1524
1492
  *
1525
- * @since 2.0.0
1526
1493
  * @category utilities
1494
+ * @since 2.0.0
1527
1495
  */
1528
1496
  export declare const collectInputs: <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Array<Input>, Input, Error, Env>;
1529
1497
  /**
1530
- * Returns a new `Schedule` that always recurs, collecting all outputs of the
1531
- * schedule into an array.
1498
+ * Returns a new `Schedule` that follows `self` and outputs the schedule outputs
1499
+ * seen so far as an array.
1500
+ *
1501
+ * **Details**
1502
+ * This does not make the schedule run forever. The collected schedule stops
1503
+ * when `self` stops and fails when `self` fails.
1504
+ *
1505
+ * **Example** (Collecting schedule outputs)
1532
1506
  *
1533
- * @example
1534
1507
  * ```ts
1535
1508
  * import { Console, Effect, Schedule } from "effect"
1536
1509
  *
@@ -1550,39 +1523,19 @@ export declare const collectInputs: <Output, Input, Error, Env>(self: Schedule<O
1550
1523
  * })
1551
1524
  * ```
1552
1525
  *
1553
- * @since 2.0.0
1554
1526
  * @category utilities
1527
+ * @since 2.0.0
1555
1528
  */
1556
1529
  export declare const collectOutputs: <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Array<Output>, Input, Error, Env>;
1557
1530
  /**
1558
1531
  * Returns a new `Schedule` that recurs as long as the specified `predicate`
1559
1532
  * returns `true`, collecting all outputs of the schedule into an array.
1560
1533
  *
1561
- * @example
1534
+ * **Example** (Collecting outputs while a condition holds)
1535
+ *
1562
1536
  * ```ts
1563
1537
  * import { Console, Effect, Schedule } from "effect"
1564
1538
  *
1565
- * // Collect outputs while under time limit
1566
- * const collectForTime = Schedule.collectWhile(
1567
- * Schedule.spaced("500 millis"),
1568
- * (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
1569
- * )
1570
- *
1571
- * const timeBasedProgram = Effect.gen(function*() {
1572
- * const results = yield* Effect.repeat(
1573
- * Effect.gen(function*() {
1574
- * const value = Math.floor(Math.random() * 100)
1575
- * yield* Console.log(`Generated value: ${value}`)
1576
- * return value
1577
- * }),
1578
- * collectForTime
1579
- * )
1580
- *
1581
- * yield* Console.log(
1582
- * `Collected ${results.length} values: [${results.join(", ")}]`
1583
- * )
1584
- * })
1585
- *
1586
1539
  * // Collect outputs while condition is met
1587
1540
  * const collectWhileSmall = Schedule.collectWhile(
1588
1541
  * Schedule.exponential("100 millis"),
@@ -1593,16 +1546,16 @@ export declare const collectOutputs: <Output, Input, Error, Env>(self: Schedule<
1593
1546
  * const conditionalProgram = Effect.gen(function*() {
1594
1547
  * let attempt = 0
1595
1548
  *
1596
- * const delays = yield* Effect.repeat(
1549
+ * const attempts = yield* Effect.repeat(
1597
1550
  * Effect.gen(function*() {
1598
1551
  * attempt++
1599
1552
  * yield* Console.log(`Retry attempt ${attempt}`)
1600
- * return `${Date.now()}`
1553
+ * return `attempt-${attempt}`
1601
1554
  * }),
1602
1555
  * collectWhileSmall
1603
1556
  * )
1604
1557
  *
1605
- * yield* Console.log(`Collected attempts: [${delays.join(", ")}]`)
1558
+ * yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
1606
1559
  * })
1607
1560
  *
1608
1561
  * // Collect with effectful predicate
@@ -1619,19 +1572,17 @@ export declare const collectOutputs: <Output, Input, Error, Env>(self: Schedule<
1619
1572
  * )
1620
1573
  *
1621
1574
  * const effectfulProgram = Effect.gen(function*() {
1622
- * const timestamps = yield* Effect.repeat(
1623
- * Effect.gen(function*() {
1624
- * const now = new Date().toISOString()
1625
- * yield* Console.log(`Task at ${now}`)
1626
- * return now
1627
- * }),
1575
+ * const results = yield* Effect.repeat(
1576
+ * Effect.succeed("checked"),
1628
1577
  * collectWithCheck
1629
1578
  * )
1630
1579
  *
1631
- * yield* Console.log(`Final collection: ${timestamps.length} items`)
1580
+ * yield* Console.log(`Final collection: ${results.length} items`)
1632
1581
  * })
1633
1582
  *
1634
1583
  * // Collect samples with condition
1584
+ * const samples = [12, 18, 24, 30, 36]
1585
+ *
1635
1586
  * const collectSamples = Schedule.collectWhile(
1636
1587
  * Schedule.spaced("200 millis"),
1637
1588
  * (metadata) =>
@@ -1639,55 +1590,36 @@ export declare const collectOutputs: <Output, Input, Error, Env>(self: Schedule<
1639
1590
  * )
1640
1591
  *
1641
1592
  * const samplingProgram = Effect.gen(function*() {
1642
- * const samples = yield* Effect.repeat(
1593
+ * let index = 0
1594
+ * const collected = yield* Effect.repeat(
1643
1595
  * Effect.gen(function*() {
1644
- * const sample = Math.random() * 100
1645
- * yield* Console.log(`Sample: ${sample.toFixed(1)}`)
1596
+ * const sample = samples[index++]
1597
+ * yield* Console.log(`Sample: ${sample}`)
1646
1598
  * return sample
1647
1599
  * }),
1648
1600
  * collectSamples
1649
1601
  * )
1650
1602
  *
1651
- * const average = samples.reduce((sum, s) => sum + s, 0) / samples.length
1603
+ * const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
1652
1604
  * yield* Console.log(
1653
- * `Collected ${samples.length} samples, average: ${average.toFixed(1)}`
1605
+ * `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
1654
1606
  * )
1655
1607
  * })
1656
1608
  * ```
1657
1609
  *
1658
- * @since 2.0.0
1659
1610
  * @category utilities
1611
+ * @since 2.0.0
1660
1612
  */
1661
1613
  export declare const collectWhile: {
1662
1614
  /**
1663
1615
  * Returns a new `Schedule` that recurs as long as the specified `predicate`
1664
1616
  * returns `true`, collecting all outputs of the schedule into an array.
1665
1617
  *
1666
- * @example
1618
+ * **Example** (Collecting outputs while a condition holds)
1619
+ *
1667
1620
  * ```ts
1668
1621
  * import { Console, Effect, Schedule } from "effect"
1669
1622
  *
1670
- * // Collect outputs while under time limit
1671
- * const collectForTime = Schedule.collectWhile(
1672
- * Schedule.spaced("500 millis"),
1673
- * (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
1674
- * )
1675
- *
1676
- * const timeBasedProgram = Effect.gen(function*() {
1677
- * const results = yield* Effect.repeat(
1678
- * Effect.gen(function*() {
1679
- * const value = Math.floor(Math.random() * 100)
1680
- * yield* Console.log(`Generated value: ${value}`)
1681
- * return value
1682
- * }),
1683
- * collectForTime
1684
- * )
1685
- *
1686
- * yield* Console.log(
1687
- * `Collected ${results.length} values: [${results.join(", ")}]`
1688
- * )
1689
- * })
1690
- *
1691
1623
  * // Collect outputs while condition is met
1692
1624
  * const collectWhileSmall = Schedule.collectWhile(
1693
1625
  * Schedule.exponential("100 millis"),
@@ -1698,16 +1630,16 @@ export declare const collectWhile: {
1698
1630
  * const conditionalProgram = Effect.gen(function*() {
1699
1631
  * let attempt = 0
1700
1632
  *
1701
- * const delays = yield* Effect.repeat(
1633
+ * const attempts = yield* Effect.repeat(
1702
1634
  * Effect.gen(function*() {
1703
1635
  * attempt++
1704
1636
  * yield* Console.log(`Retry attempt ${attempt}`)
1705
- * return `${Date.now()}`
1637
+ * return `attempt-${attempt}`
1706
1638
  * }),
1707
1639
  * collectWhileSmall
1708
1640
  * )
1709
1641
  *
1710
- * yield* Console.log(`Collected attempts: [${delays.join(", ")}]`)
1642
+ * yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
1711
1643
  * })
1712
1644
  *
1713
1645
  * // Collect with effectful predicate
@@ -1724,19 +1656,17 @@ export declare const collectWhile: {
1724
1656
  * )
1725
1657
  *
1726
1658
  * const effectfulProgram = Effect.gen(function*() {
1727
- * const timestamps = yield* Effect.repeat(
1728
- * Effect.gen(function*() {
1729
- * const now = new Date().toISOString()
1730
- * yield* Console.log(`Task at ${now}`)
1731
- * return now
1732
- * }),
1659
+ * const results = yield* Effect.repeat(
1660
+ * Effect.succeed("checked"),
1733
1661
  * collectWithCheck
1734
1662
  * )
1735
1663
  *
1736
- * yield* Console.log(`Final collection: ${timestamps.length} items`)
1664
+ * yield* Console.log(`Final collection: ${results.length} items`)
1737
1665
  * })
1738
1666
  *
1739
1667
  * // Collect samples with condition
1668
+ * const samples = [12, 18, 24, 30, 36]
1669
+ *
1740
1670
  * const collectSamples = Schedule.collectWhile(
1741
1671
  * Schedule.spaced("200 millis"),
1742
1672
  * (metadata) =>
@@ -1744,55 +1674,36 @@ export declare const collectWhile: {
1744
1674
  * )
1745
1675
  *
1746
1676
  * const samplingProgram = Effect.gen(function*() {
1747
- * const samples = yield* Effect.repeat(
1677
+ * let index = 0
1678
+ * const collected = yield* Effect.repeat(
1748
1679
  * Effect.gen(function*() {
1749
- * const sample = Math.random() * 100
1750
- * yield* Console.log(`Sample: ${sample.toFixed(1)}`)
1680
+ * const sample = samples[index++]
1681
+ * yield* Console.log(`Sample: ${sample}`)
1751
1682
  * return sample
1752
1683
  * }),
1753
1684
  * collectSamples
1754
1685
  * )
1755
1686
  *
1756
- * const average = samples.reduce((sum, s) => sum + s, 0) / samples.length
1687
+ * const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
1757
1688
  * yield* Console.log(
1758
- * `Collected ${samples.length} samples, average: ${average.toFixed(1)}`
1689
+ * `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
1759
1690
  * )
1760
1691
  * })
1761
1692
  * ```
1762
1693
  *
1763
- * @since 2.0.0
1764
1694
  * @category utilities
1695
+ * @since 2.0.0
1765
1696
  */
1766
1697
  <Input, Output, Error2 = never, Env2 = never>(predicate: (metadata: Metadata<Output, Input>) => boolean | Effect<boolean, Error2, Env2>): <Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Array<Output>, Input, Error | Error2, Env | Env2>;
1767
1698
  /**
1768
1699
  * Returns a new `Schedule` that recurs as long as the specified `predicate`
1769
1700
  * returns `true`, collecting all outputs of the schedule into an array.
1770
1701
  *
1771
- * @example
1702
+ * **Example** (Collecting outputs while a condition holds)
1703
+ *
1772
1704
  * ```ts
1773
1705
  * import { Console, Effect, Schedule } from "effect"
1774
1706
  *
1775
- * // Collect outputs while under time limit
1776
- * const collectForTime = Schedule.collectWhile(
1777
- * Schedule.spaced("500 millis"),
1778
- * (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
1779
- * )
1780
- *
1781
- * const timeBasedProgram = Effect.gen(function*() {
1782
- * const results = yield* Effect.repeat(
1783
- * Effect.gen(function*() {
1784
- * const value = Math.floor(Math.random() * 100)
1785
- * yield* Console.log(`Generated value: ${value}`)
1786
- * return value
1787
- * }),
1788
- * collectForTime
1789
- * )
1790
- *
1791
- * yield* Console.log(
1792
- * `Collected ${results.length} values: [${results.join(", ")}]`
1793
- * )
1794
- * })
1795
- *
1796
1707
  * // Collect outputs while condition is met
1797
1708
  * const collectWhileSmall = Schedule.collectWhile(
1798
1709
  * Schedule.exponential("100 millis"),
@@ -1803,16 +1714,16 @@ export declare const collectWhile: {
1803
1714
  * const conditionalProgram = Effect.gen(function*() {
1804
1715
  * let attempt = 0
1805
1716
  *
1806
- * const delays = yield* Effect.repeat(
1717
+ * const attempts = yield* Effect.repeat(
1807
1718
  * Effect.gen(function*() {
1808
1719
  * attempt++
1809
1720
  * yield* Console.log(`Retry attempt ${attempt}`)
1810
- * return `${Date.now()}`
1721
+ * return `attempt-${attempt}`
1811
1722
  * }),
1812
1723
  * collectWhileSmall
1813
1724
  * )
1814
1725
  *
1815
- * yield* Console.log(`Collected attempts: [${delays.join(", ")}]`)
1726
+ * yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
1816
1727
  * })
1817
1728
  *
1818
1729
  * // Collect with effectful predicate
@@ -1829,19 +1740,17 @@ export declare const collectWhile: {
1829
1740
  * )
1830
1741
  *
1831
1742
  * const effectfulProgram = Effect.gen(function*() {
1832
- * const timestamps = yield* Effect.repeat(
1833
- * Effect.gen(function*() {
1834
- * const now = new Date().toISOString()
1835
- * yield* Console.log(`Task at ${now}`)
1836
- * return now
1837
- * }),
1743
+ * const results = yield* Effect.repeat(
1744
+ * Effect.succeed("checked"),
1838
1745
  * collectWithCheck
1839
1746
  * )
1840
1747
  *
1841
- * yield* Console.log(`Final collection: ${timestamps.length} items`)
1748
+ * yield* Console.log(`Final collection: ${results.length} items`)
1842
1749
  * })
1843
1750
  *
1844
1751
  * // Collect samples with condition
1752
+ * const samples = [12, 18, 24, 30, 36]
1753
+ *
1845
1754
  * const collectSamples = Schedule.collectWhile(
1846
1755
  * Schedule.spaced("200 millis"),
1847
1756
  * (metadata) =>
@@ -1849,24 +1758,25 @@ export declare const collectWhile: {
1849
1758
  * )
1850
1759
  *
1851
1760
  * const samplingProgram = Effect.gen(function*() {
1852
- * const samples = yield* Effect.repeat(
1761
+ * let index = 0
1762
+ * const collected = yield* Effect.repeat(
1853
1763
  * Effect.gen(function*() {
1854
- * const sample = Math.random() * 100
1855
- * yield* Console.log(`Sample: ${sample.toFixed(1)}`)
1764
+ * const sample = samples[index++]
1765
+ * yield* Console.log(`Sample: ${sample}`)
1856
1766
  * return sample
1857
1767
  * }),
1858
1768
  * collectSamples
1859
1769
  * )
1860
1770
  *
1861
- * const average = samples.reduce((sum, s) => sum + s, 0) / samples.length
1771
+ * const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
1862
1772
  * yield* Console.log(
1863
- * `Collected ${samples.length} samples, average: ${average.toFixed(1)}`
1773
+ * `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
1864
1774
  * )
1865
1775
  * })
1866
1776
  * ```
1867
1777
  *
1868
- * @since 2.0.0
1869
1778
  * @category utilities
1779
+ * @since 2.0.0
1870
1780
  */
1871
1781
  <Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, predicate: (metadata: Metadata<Output, Input>) => boolean | Effect<boolean, Error2, Env2>): Schedule<Array<Output>, Input, Error | Error2, Env | Env2>;
1872
1782
  };
@@ -1874,7 +1784,8 @@ export declare const collectWhile: {
1874
1784
  * Returns a new `Schedule` that recurs on the specified `Cron` schedule and
1875
1785
  * outputs the duration between recurrences.
1876
1786
  *
1877
- * @example
1787
+ * **Example** (Scheduling work with cron expressions)
1788
+ *
1878
1789
  * ```ts
1879
1790
  * import { Console, Data, Effect, Schedule } from "effect"
1880
1791
  *
@@ -1886,7 +1797,7 @@ export declare const collectWhile: {
1886
1797
  * const minutelyProgram = Effect.gen(function*() {
1887
1798
  * yield* Effect.repeat(
1888
1799
  * Effect.gen(function*() {
1889
- * yield* Console.log(`Minutely task at ${new Date().toISOString()}`)
1800
+ * yield* Console.log("Running minutely task")
1890
1801
  * return "minute"
1891
1802
  * }),
1892
1803
  * everyMinute.pipe(
@@ -1924,8 +1835,8 @@ export declare const collectWhile: {
1924
1835
  * Effect.gen(function*() {
1925
1836
  * yield* Console.log("Generating weekly report...")
1926
1837
  * const report = {
1927
- * week: Math.floor(Date.now() / (7 * 24 * 60 * 60 * 1000)),
1928
- * timestamp: new Date().toISOString()
1838
+ * week: 42,
1839
+ * status: "ready" as const
1929
1840
  * }
1930
1841
  * yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
1931
1842
  * return report
@@ -1938,10 +1849,13 @@ export declare const collectWhile: {
1938
1849
  * const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
1939
1850
  *
1940
1851
  * const businessProgram = Effect.gen(function*() {
1852
+ * const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
1853
+ * let index = 0
1854
+ *
1941
1855
  * yield* Effect.repeat(
1942
1856
  * Effect.gen(function*() {
1943
1857
  * yield* Console.log("Business hours health check...")
1944
- * const status = Math.random() > 0.1 ? "healthy" : "degraded"
1858
+ * const status = statuses[index++]
1945
1859
  * yield* Console.log(`System status: ${status}`)
1946
1860
  * return status
1947
1861
  * }),
@@ -1958,9 +1872,9 @@ export declare const collectWhile: {
1958
1872
  * yield* Effect.repeat(
1959
1873
  * Effect.gen(function*() {
1960
1874
  * yield* Console.log("Processing monthly invoices...")
1961
- * const invoiceCount = Math.floor(Math.random() * 100) + 50
1875
+ * const invoiceCount = 72
1962
1876
  * yield* Console.log(`Processed ${invoiceCount} invoices`)
1963
- * return { count: invoiceCount, date: new Date().toISOString() }
1877
+ * return { count: invoiceCount, batch: "2024-01-a" }
1964
1878
  * }),
1965
1879
  * monthlyInvoice.pipe(Schedule.take(1))
1966
1880
  * )
@@ -1974,11 +1888,13 @@ export declare const collectWhile: {
1974
1888
  * )
1975
1889
  *
1976
1890
  * const robustProgram = Effect.gen(function*() {
1891
+ * let attempt = 0
1892
+ *
1977
1893
  * yield* Effect.repeat(
1978
1894
  * Effect.gen(function*() {
1895
+ * attempt++
1979
1896
  * yield* Console.log("Complex scheduled task...")
1980
- * // Simulate occasional failures
1981
- * if (Math.random() < 0.3) {
1897
+ * if (attempt === 1) {
1982
1898
  * return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
1983
1899
  * }
1984
1900
  * return "success"
@@ -1992,15 +1908,16 @@ export declare const collectWhile: {
1992
1908
  * })
1993
1909
  * ```
1994
1910
  *
1995
- * @since 4.0.0
1996
1911
  * @category constructors
1912
+ * @since 4.0.0
1997
1913
  */
1998
1914
  export declare const cron: {
1999
1915
  /**
2000
1916
  * Returns a new `Schedule` that recurs on the specified `Cron` schedule and
2001
1917
  * outputs the duration between recurrences.
2002
1918
  *
2003
- * @example
1919
+ * **Example** (Scheduling work with cron expressions)
1920
+ *
2004
1921
  * ```ts
2005
1922
  * import { Console, Data, Effect, Schedule } from "effect"
2006
1923
  *
@@ -2012,7 +1929,7 @@ export declare const cron: {
2012
1929
  * const minutelyProgram = Effect.gen(function*() {
2013
1930
  * yield* Effect.repeat(
2014
1931
  * Effect.gen(function*() {
2015
- * yield* Console.log(`Minutely task at ${new Date().toISOString()}`)
1932
+ * yield* Console.log("Running minutely task")
2016
1933
  * return "minute"
2017
1934
  * }),
2018
1935
  * everyMinute.pipe(
@@ -2050,8 +1967,8 @@ export declare const cron: {
2050
1967
  * Effect.gen(function*() {
2051
1968
  * yield* Console.log("Generating weekly report...")
2052
1969
  * const report = {
2053
- * week: Math.floor(Date.now() / (7 * 24 * 60 * 60 * 1000)),
2054
- * timestamp: new Date().toISOString()
1970
+ * week: 42,
1971
+ * status: "ready" as const
2055
1972
  * }
2056
1973
  * yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
2057
1974
  * return report
@@ -2064,10 +1981,13 @@ export declare const cron: {
2064
1981
  * const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
2065
1982
  *
2066
1983
  * const businessProgram = Effect.gen(function*() {
1984
+ * const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
1985
+ * let index = 0
1986
+ *
2067
1987
  * yield* Effect.repeat(
2068
1988
  * Effect.gen(function*() {
2069
1989
  * yield* Console.log("Business hours health check...")
2070
- * const status = Math.random() > 0.1 ? "healthy" : "degraded"
1990
+ * const status = statuses[index++]
2071
1991
  * yield* Console.log(`System status: ${status}`)
2072
1992
  * return status
2073
1993
  * }),
@@ -2084,9 +2004,9 @@ export declare const cron: {
2084
2004
  * yield* Effect.repeat(
2085
2005
  * Effect.gen(function*() {
2086
2006
  * yield* Console.log("Processing monthly invoices...")
2087
- * const invoiceCount = Math.floor(Math.random() * 100) + 50
2007
+ * const invoiceCount = 72
2088
2008
  * yield* Console.log(`Processed ${invoiceCount} invoices`)
2089
- * return { count: invoiceCount, date: new Date().toISOString() }
2009
+ * return { count: invoiceCount, batch: "2024-01-a" }
2090
2010
  * }),
2091
2011
  * monthlyInvoice.pipe(Schedule.take(1))
2092
2012
  * )
@@ -2100,11 +2020,13 @@ export declare const cron: {
2100
2020
  * )
2101
2021
  *
2102
2022
  * const robustProgram = Effect.gen(function*() {
2023
+ * let attempt = 0
2024
+ *
2103
2025
  * yield* Effect.repeat(
2104
2026
  * Effect.gen(function*() {
2027
+ * attempt++
2105
2028
  * yield* Console.log("Complex scheduled task...")
2106
- * // Simulate occasional failures
2107
- * if (Math.random() < 0.3) {
2029
+ * if (attempt === 1) {
2108
2030
  * return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
2109
2031
  * }
2110
2032
  * return "success"
@@ -2118,15 +2040,16 @@ export declare const cron: {
2118
2040
  * })
2119
2041
  * ```
2120
2042
  *
2121
- * @since 4.0.0
2122
2043
  * @category constructors
2044
+ * @since 4.0.0
2123
2045
  */
2124
2046
  (expression: Cron.Cron): Schedule<Duration.Duration, unknown, Cron.CronParseError>;
2125
2047
  /**
2126
2048
  * Returns a new `Schedule` that recurs on the specified `Cron` schedule and
2127
2049
  * outputs the duration between recurrences.
2128
2050
  *
2129
- * @example
2051
+ * **Example** (Scheduling work with cron expressions)
2052
+ *
2130
2053
  * ```ts
2131
2054
  * import { Console, Data, Effect, Schedule } from "effect"
2132
2055
  *
@@ -2138,7 +2061,7 @@ export declare const cron: {
2138
2061
  * const minutelyProgram = Effect.gen(function*() {
2139
2062
  * yield* Effect.repeat(
2140
2063
  * Effect.gen(function*() {
2141
- * yield* Console.log(`Minutely task at ${new Date().toISOString()}`)
2064
+ * yield* Console.log("Running minutely task")
2142
2065
  * return "minute"
2143
2066
  * }),
2144
2067
  * everyMinute.pipe(
@@ -2176,8 +2099,8 @@ export declare const cron: {
2176
2099
  * Effect.gen(function*() {
2177
2100
  * yield* Console.log("Generating weekly report...")
2178
2101
  * const report = {
2179
- * week: Math.floor(Date.now() / (7 * 24 * 60 * 60 * 1000)),
2180
- * timestamp: new Date().toISOString()
2102
+ * week: 42,
2103
+ * status: "ready" as const
2181
2104
  * }
2182
2105
  * yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
2183
2106
  * return report
@@ -2190,10 +2113,13 @@ export declare const cron: {
2190
2113
  * const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
2191
2114
  *
2192
2115
  * const businessProgram = Effect.gen(function*() {
2116
+ * const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
2117
+ * let index = 0
2118
+ *
2193
2119
  * yield* Effect.repeat(
2194
2120
  * Effect.gen(function*() {
2195
2121
  * yield* Console.log("Business hours health check...")
2196
- * const status = Math.random() > 0.1 ? "healthy" : "degraded"
2122
+ * const status = statuses[index++]
2197
2123
  * yield* Console.log(`System status: ${status}`)
2198
2124
  * return status
2199
2125
  * }),
@@ -2210,9 +2136,9 @@ export declare const cron: {
2210
2136
  * yield* Effect.repeat(
2211
2137
  * Effect.gen(function*() {
2212
2138
  * yield* Console.log("Processing monthly invoices...")
2213
- * const invoiceCount = Math.floor(Math.random() * 100) + 50
2139
+ * const invoiceCount = 72
2214
2140
  * yield* Console.log(`Processed ${invoiceCount} invoices`)
2215
- * return { count: invoiceCount, date: new Date().toISOString() }
2141
+ * return { count: invoiceCount, batch: "2024-01-a" }
2216
2142
  * }),
2217
2143
  * monthlyInvoice.pipe(Schedule.take(1))
2218
2144
  * )
@@ -2226,11 +2152,13 @@ export declare const cron: {
2226
2152
  * )
2227
2153
  *
2228
2154
  * const robustProgram = Effect.gen(function*() {
2155
+ * let attempt = 0
2156
+ *
2229
2157
  * yield* Effect.repeat(
2230
2158
  * Effect.gen(function*() {
2159
+ * attempt++
2231
2160
  * yield* Console.log("Complex scheduled task...")
2232
- * // Simulate occasional failures
2233
- * if (Math.random() < 0.3) {
2161
+ * if (attempt === 1) {
2234
2162
  * return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
2235
2163
  * }
2236
2164
  * return "success"
@@ -2244,15 +2172,16 @@ export declare const cron: {
2244
2172
  * })
2245
2173
  * ```
2246
2174
  *
2247
- * @since 4.0.0
2248
2175
  * @category constructors
2176
+ * @since 4.0.0
2249
2177
  */
2250
2178
  (expression: string, tz?: string | DateTime.TimeZone): Schedule<Duration.Duration, unknown, Cron.CronParseError>;
2251
2179
  };
2252
2180
  /**
2253
2181
  * Returns a new schedule that outputs the delay between each occurence.
2254
2182
  *
2255
- * @example
2183
+ * **Example** (Extracting schedule delays)
2184
+ *
2256
2185
  * ```ts
2257
2186
  * import { Console, Effect, Schedule } from "effect"
2258
2187
  *
@@ -2312,7 +2241,7 @@ export declare const cron: {
2312
2241
  * yield* Effect.repeat(
2313
2242
  * Effect.gen(function*() {
2314
2243
  * yield* Console.log("Adaptive task execution")
2315
- * return Date.now()
2244
+ * return "completed"
2316
2245
  * }),
2317
2246
  * adaptiveDelays.pipe(
2318
2247
  * Schedule.tapOutput((delay) => Console.log(`Adaptive delay: ${delay}`))
@@ -2329,8 +2258,8 @@ export declare const cron: {
2329
2258
  * )
2330
2259
  * ```
2331
2260
  *
2332
- * @since 2.0.0
2333
2261
  * @category constructors
2262
+ * @since 2.0.0
2334
2263
  */
2335
2264
  export declare const delays: <Out, In, E, R>(self: Schedule<Out, In, E, R>) => Schedule<Duration.Duration, In, E, R>;
2336
2265
  /**
@@ -2339,15 +2268,16 @@ export declare const delays: <Out, In, E, R>(self: Schedule<Out, In, E, R>) => S
2339
2268
  * The schedule outputs the configured duration for its first recurrence and
2340
2269
  * then completes.
2341
2270
  *
2342
- * @since 2.0.0
2343
2271
  * @category constructors
2272
+ * @since 2.0.0
2344
2273
  */
2345
2274
  export declare const duration: (durationInput: Duration.Input) => Schedule<Duration.Duration>;
2346
2275
  /**
2347
2276
  * Returns a new `Schedule` that will always recur, but only during the
2348
2277
  * specified `duration` of time.
2349
2278
  *
2350
- * @example
2279
+ * **Example** (Repeating work during a duration)
2280
+ *
2351
2281
  * ```ts
2352
2282
  * import { Console, Data, Effect, Schedule } from "effect"
2353
2283
  *
@@ -2357,12 +2287,9 @@ export declare const duration: (durationInput: Duration.Input) => Schedule<Durat
2357
2287
  * const fiveSecondSchedule = Schedule.during("5 seconds")
2358
2288
  *
2359
2289
  * const timedProgram = Effect.gen(function*() {
2360
- * const startTime = Date.now()
2361
- *
2362
2290
  * yield* Effect.repeat(
2363
2291
  * Effect.gen(function*() {
2364
- * const elapsed = Date.now() - startTime
2365
- * yield* Console.log(`Task executed after ${elapsed}ms`)
2292
+ * yield* Console.log("Task executed inside the time window")
2366
2293
  * yield* Effect.sleep("500 millis") // Each task takes 500ms
2367
2294
  * return "task done"
2368
2295
  * }),
@@ -2390,8 +2317,8 @@ export declare const duration: (durationInput: Duration.Input) => Schedule<Durat
2390
2317
  *
2391
2318
  * yield* Effect.repeat(
2392
2319
  * Effect.gen(function*() {
2393
- * yield* Console.log(`Burst task at ${new Date().toISOString()}`)
2394
- * return Math.random()
2320
+ * yield* Console.log("Burst task")
2321
+ * return "burst"
2395
2322
  * }),
2396
2323
  * burstWindow
2397
2324
  * )
@@ -2412,7 +2339,7 @@ export declare const duration: (durationInput: Duration.Input) => Schedule<Durat
2412
2339
  * attempt++
2413
2340
  * yield* Console.log(`Retry attempt ${attempt}`)
2414
2341
  *
2415
- * if (Math.random() < 0.8) { // 80% failure rate
2342
+ * if (attempt < 4) {
2416
2343
  * return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
2417
2344
  * }
2418
2345
  *
@@ -2427,8 +2354,8 @@ export declare const duration: (durationInput: Duration.Input) => Schedule<Durat
2427
2354
  * )
2428
2355
  * ```
2429
2356
  *
2430
- * @since 4.0.0
2431
2357
  * @category constructors
2358
+ * @since 4.0.0
2432
2359
  */
2433
2360
  export declare const during: (duration: Duration.Input) => Schedule<Duration.Duration>;
2434
2361
  /**
@@ -2436,7 +2363,8 @@ export declare const during: (duration: Duration.Input) => Schedule<Duration.Dur
2436
2363
  * to recur, using the minimum of the two durations between recurrences and
2437
2364
  * outputting a tuple of the outputs of both schedules.
2438
2365
  *
2439
- * @example
2366
+ * **Example** (Combining schedules with either semantics)
2367
+ *
2440
2368
  * ```ts
2441
2369
  * import { Console, Data, Effect, Schedule } from "effect"
2442
2370
  *
@@ -2453,7 +2381,7 @@ export declare const during: (duration: Duration.Input) => Schedule<Duration.Dur
2453
2381
  * const program = Effect.gen(function*() {
2454
2382
  * const results = yield* Effect.repeat(
2455
2383
  * Effect.gen(function*() {
2456
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
2384
+ * yield* Console.log("Task executed")
2457
2385
  * return "task completed"
2458
2386
  * }),
2459
2387
  * eitherSchedule.pipe(
@@ -2499,8 +2427,8 @@ export declare const during: (duration: Duration.Input) => Schedule<Duration.Dur
2499
2427
  * // Compare with intersect which provides intersection semantics (AND logic)
2500
2428
  * ```
2501
2429
  *
2502
- * @since 2.0.0
2503
2430
  * @category utilities
2431
+ * @since 2.0.0
2504
2432
  */
2505
2433
  export declare const either: {
2506
2434
  /**
@@ -2508,7 +2436,8 @@ export declare const either: {
2508
2436
  * to recur, using the minimum of the two durations between recurrences and
2509
2437
  * outputting a tuple of the outputs of both schedules.
2510
2438
  *
2511
- * @example
2439
+ * **Example** (Combining schedules with either semantics)
2440
+ *
2512
2441
  * ```ts
2513
2442
  * import { Console, Data, Effect, Schedule } from "effect"
2514
2443
  *
@@ -2525,7 +2454,7 @@ export declare const either: {
2525
2454
  * const program = Effect.gen(function*() {
2526
2455
  * const results = yield* Effect.repeat(
2527
2456
  * Effect.gen(function*() {
2528
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
2457
+ * yield* Console.log("Task executed")
2529
2458
  * return "task completed"
2530
2459
  * }),
2531
2460
  * eitherSchedule.pipe(
@@ -2571,8 +2500,8 @@ export declare const either: {
2571
2500
  * // Compare with intersect which provides intersection semantics (AND logic)
2572
2501
  * ```
2573
2502
  *
2574
- * @since 2.0.0
2575
2503
  * @category utilities
2504
+ * @since 2.0.0
2576
2505
  */
2577
2506
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<[Output, Output2], Input & Input2, Error | Error2, Env | Env2>;
2578
2507
  /**
@@ -2580,7 +2509,8 @@ export declare const either: {
2580
2509
  * to recur, using the minimum of the two durations between recurrences and
2581
2510
  * outputting a tuple of the outputs of both schedules.
2582
2511
  *
2583
- * @example
2512
+ * **Example** (Combining schedules with either semantics)
2513
+ *
2584
2514
  * ```ts
2585
2515
  * import { Console, Data, Effect, Schedule } from "effect"
2586
2516
  *
@@ -2597,7 +2527,7 @@ export declare const either: {
2597
2527
  * const program = Effect.gen(function*() {
2598
2528
  * const results = yield* Effect.repeat(
2599
2529
  * Effect.gen(function*() {
2600
- * yield* Console.log(`Task executed at ${new Date().toISOString()}`)
2530
+ * yield* Console.log("Task executed")
2601
2531
  * return "task completed"
2602
2532
  * }),
2603
2533
  * eitherSchedule.pipe(
@@ -2643,8 +2573,8 @@ export declare const either: {
2643
2573
  * // Compare with intersect which provides intersection semantics (AND logic)
2644
2574
  * ```
2645
2575
  *
2646
- * @since 2.0.0
2647
2576
  * @category utilities
2577
+ * @since 2.0.0
2648
2578
  */
2649
2579
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<[Output, Output2], Input & Input2, Error | Error2, Env | Env2>;
2650
2580
  };
@@ -2653,7 +2583,8 @@ export declare const either: {
2653
2583
  * to recur, using the minimum of the two durations between recurrences and
2654
2584
  * outputting the result of the left schedule (i.e. `self`).
2655
2585
  *
2656
- * @example
2586
+ * **Example** (Combining either schedules and keeping the left output)
2587
+ *
2657
2588
  * ```ts
2658
2589
  * import { Console, Effect, Schedule } from "effect"
2659
2590
  *
@@ -2679,8 +2610,8 @@ export declare const either: {
2679
2610
  * })
2680
2611
  * ```
2681
2612
  *
2682
- * @since 2.0.0
2683
2613
  * @category utilities
2614
+ * @since 2.0.0
2684
2615
  */
2685
2616
  export declare const eitherLeft: {
2686
2617
  /**
@@ -2688,7 +2619,8 @@ export declare const eitherLeft: {
2688
2619
  * to recur, using the minimum of the two durations between recurrences and
2689
2620
  * outputting the result of the left schedule (i.e. `self`).
2690
2621
  *
2691
- * @example
2622
+ * **Example** (Combining either schedules and keeping the left output)
2623
+ *
2692
2624
  * ```ts
2693
2625
  * import { Console, Effect, Schedule } from "effect"
2694
2626
  *
@@ -2714,8 +2646,8 @@ export declare const eitherLeft: {
2714
2646
  * })
2715
2647
  * ```
2716
2648
  *
2717
- * @since 2.0.0
2718
2649
  * @category utilities
2650
+ * @since 2.0.0
2719
2651
  */
2720
2652
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input & Input2, Error | Error2, Env | Env2>;
2721
2653
  /**
@@ -2723,7 +2655,8 @@ export declare const eitherLeft: {
2723
2655
  * to recur, using the minimum of the two durations between recurrences and
2724
2656
  * outputting the result of the left schedule (i.e. `self`).
2725
2657
  *
2726
- * @example
2658
+ * **Example** (Combining either schedules and keeping the left output)
2659
+ *
2727
2660
  * ```ts
2728
2661
  * import { Console, Effect, Schedule } from "effect"
2729
2662
  *
@@ -2749,8 +2682,8 @@ export declare const eitherLeft: {
2749
2682
  * })
2750
2683
  * ```
2751
2684
  *
2752
- * @since 2.0.0
2753
2685
  * @category utilities
2686
+ * @since 2.0.0
2754
2687
  */
2755
2688
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<Output, Input & Input2, Error | Error2, Env | Env2>;
2756
2689
  };
@@ -2759,7 +2692,8 @@ export declare const eitherLeft: {
2759
2692
  * to recur, using the minimum of the two durations between recurrences and
2760
2693
  * outputting the result of the right schedule (i.e. `other`).
2761
2694
  *
2762
- * @example
2695
+ * **Example** (Combining either schedules and keeping the right output)
2696
+ *
2763
2697
  * ```ts
2764
2698
  * import { Console, Effect, Schedule } from "effect"
2765
2699
  *
@@ -2785,8 +2719,8 @@ export declare const eitherLeft: {
2785
2719
  * })
2786
2720
  * ```
2787
2721
  *
2788
- * @since 2.0.0
2789
2722
  * @category utilities
2723
+ * @since 2.0.0
2790
2724
  */
2791
2725
  export declare const eitherRight: {
2792
2726
  /**
@@ -2794,7 +2728,8 @@ export declare const eitherRight: {
2794
2728
  * to recur, using the minimum of the two durations between recurrences and
2795
2729
  * outputting the result of the right schedule (i.e. `other`).
2796
2730
  *
2797
- * @example
2731
+ * **Example** (Combining either schedules and keeping the right output)
2732
+ *
2798
2733
  * ```ts
2799
2734
  * import { Console, Effect, Schedule } from "effect"
2800
2735
  *
@@ -2820,8 +2755,8 @@ export declare const eitherRight: {
2820
2755
  * })
2821
2756
  * ```
2822
2757
  *
2823
- * @since 2.0.0
2824
2758
  * @category utilities
2759
+ * @since 2.0.0
2825
2760
  */
2826
2761
  <Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output2, Input & Input2, Error | Error2, Env | Env2>;
2827
2762
  /**
@@ -2829,7 +2764,8 @@ export declare const eitherRight: {
2829
2764
  * to recur, using the minimum of the two durations between recurrences and
2830
2765
  * outputting the result of the right schedule (i.e. `other`).
2831
2766
  *
2832
- * @example
2767
+ * **Example** (Combining either schedules and keeping the right output)
2768
+ *
2833
2769
  * ```ts
2834
2770
  * import { Console, Effect, Schedule } from "effect"
2835
2771
  *
@@ -2855,8 +2791,8 @@ export declare const eitherRight: {
2855
2791
  * })
2856
2792
  * ```
2857
2793
  *
2858
- * @since 2.0.0
2859
2794
  * @category utilities
2795
+ * @since 2.0.0
2860
2796
  */
2861
2797
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>): Schedule<Output2, Input & Input2, Error | Error2, Env | Env2>;
2862
2798
  };
@@ -2866,7 +2802,8 @@ export declare const eitherRight: {
2866
2802
  * outputting the result of the combination of both schedule outputs using the
2867
2803
  * specified `combine` function.
2868
2804
  *
2869
- * @example
2805
+ * **Example** (Combining either schedule outputs)
2806
+ *
2870
2807
  * ```ts
2871
2808
  * import { Console, Effect, Schedule } from "effect"
2872
2809
  *
@@ -2896,8 +2833,8 @@ export declare const eitherRight: {
2896
2833
  * })
2897
2834
  * ```
2898
2835
  *
2899
- * @since 2.0.0
2900
2836
  * @category utilities
2837
+ * @since 2.0.0
2901
2838
  */
2902
2839
  export declare const eitherWith: {
2903
2840
  /**
@@ -2906,7 +2843,8 @@ export declare const eitherWith: {
2906
2843
  * outputting the result of the combination of both schedule outputs using the
2907
2844
  * specified `combine` function.
2908
2845
  *
2909
- * @example
2846
+ * **Example** (Combining either schedule outputs)
2847
+ *
2910
2848
  * ```ts
2911
2849
  * import { Console, Effect, Schedule } from "effect"
2912
2850
  *
@@ -2936,8 +2874,8 @@ export declare const eitherWith: {
2936
2874
  * })
2937
2875
  * ```
2938
2876
  *
2939
- * @since 2.0.0
2940
2877
  * @category utilities
2878
+ * @since 2.0.0
2941
2879
  */
2942
2880
  <Output2, Input2, Error2, Env2, Output, Output3>(other: Schedule<Output2, Input2, Error2, Env2>, combine: (selfOutput: Output, otherOutput: Output2) => Output3): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output3, Input & Input2, Error | Error2, Env | Env2>;
2943
2881
  /**
@@ -2946,7 +2884,8 @@ export declare const eitherWith: {
2946
2884
  * outputting the result of the combination of both schedule outputs using the
2947
2885
  * specified `combine` function.
2948
2886
  *
2949
- * @example
2887
+ * **Example** (Combining either schedule outputs)
2888
+ *
2950
2889
  * ```ts
2951
2890
  * import { Console, Effect, Schedule } from "effect"
2952
2891
  *
@@ -2976,8 +2915,8 @@ export declare const eitherWith: {
2976
2915
  * })
2977
2916
  * ```
2978
2917
  *
2979
- * @since 2.0.0
2980
2918
  * @category utilities
2919
+ * @since 2.0.0
2981
2920
  */
2982
2921
  <Output, Input, Error, Env, Output2, Input2, Error2, Env2, Output3>(self: Schedule<Output, Input, Error, Env>, other: Schedule<Output2, Input2, Error2, Env2>, combine: (selfOutput: Output, otherOutput: Output2) => Output3): Schedule<Output3, Input & Input2, Error | Error2, Env | Env2>;
2983
2922
  };
@@ -2989,7 +2928,8 @@ export declare const eitherWith: {
2989
2928
  *
2990
2929
  * @returns A schedule that outputs the elapsed duration and never stops
2991
2930
  *
2992
- * @example
2931
+ * **Example** (Measuring elapsed schedule time)
2932
+ *
2993
2933
  * ```ts
2994
2934
  * import { Console, Duration, Effect, Schedule } from "effect"
2995
2935
  *
@@ -3007,8 +2947,8 @@ export declare const eitherWith: {
3007
2947
  * })
3008
2948
  * ```
3009
2949
  *
3010
- * @since 2.0.0
3011
2950
  * @category constructors
2951
+ * @since 2.0.0
3012
2952
  */
3013
2953
  export declare const elapsed: Schedule<Duration.Duration>;
3014
2954
  /**
@@ -3016,7 +2956,8 @@ export declare const elapsed: Schedule<Duration.Duration>;
3016
2956
  * repetitions, given by `base * factor.pow(n)`, where `n` is the number of
3017
2957
  * repetitions so far. Returns the current duration between recurrences.
3018
2958
  *
3019
- * @example
2959
+ * **Example** (Retrying with exponential backoff)
2960
+ *
3020
2961
  * ```ts
3021
2962
  * import { Console, Data, Effect, Schedule } from "effect"
3022
2963
  *
@@ -3056,8 +2997,8 @@ export declare const elapsed: Schedule<Duration.Duration>;
3056
2997
  * // Will retry with delays: 50ms, 100ms, 200ms before success
3057
2998
  * ```
3058
2999
  *
3059
- * @since 2.0.0
3060
3000
  * @category constructors
3001
+ * @since 2.0.0
3061
3002
  */
3062
3003
  export declare const exponential: (base: Duration.Input, factor?: number) => Schedule<Duration.Duration>;
3063
3004
  /**
@@ -3065,7 +3006,8 @@ export declare const exponential: (base: Duration.Input, factor?: number) => Sch
3065
3006
  * two delays (similar to the fibonacci sequence). Returns the current
3066
3007
  * duration between recurrences.
3067
3008
  *
3068
- * @example
3009
+ * **Example** (Retrying with fibonacci backoff)
3010
+ *
3069
3011
  * ```ts
3070
3012
  * import { Console, Data, Effect, Schedule } from "effect"
3071
3013
  *
@@ -3101,7 +3043,7 @@ export declare const exponential: (base: Duration.Input, factor?: number) => Sch
3101
3043
  *
3102
3044
  * // Heartbeat with fibonacci intervals (starts fast, gets slower)
3103
3045
  * const adaptiveHeartbeat = Effect.gen(function*() {
3104
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
3046
+ * yield* Console.log("Heartbeat")
3105
3047
  * return "pulse"
3106
3048
  * }).pipe(
3107
3049
  * Effect.repeat(
@@ -3123,8 +3065,8 @@ export declare const exponential: (base: Duration.Input, factor?: number) => Sch
3123
3065
  * })
3124
3066
  * ```
3125
3067
  *
3126
- * @since 2.0.0
3127
3068
  * @category constructors
3069
+ * @since 2.0.0
3128
3070
  */
3129
3071
  export declare const fibonacci: (one: Duration.Input) => Schedule<Duration.Duration>;
3130
3072
  /**
@@ -3139,7 +3081,8 @@ export declare const fibonacci: (one: Duration.Input) => Schedule<Duration.Durat
3139
3081
  * |---------action--------||action|-----|action|-----------|
3140
3082
  * ```
3141
3083
  *
3142
- * @example
3084
+ * **Example** (Repeating on fixed intervals)
3085
+ *
3143
3086
  * ```ts
3144
3087
  * import { Console, Effect, Schedule } from "effect"
3145
3088
  *
@@ -3148,7 +3091,7 @@ export declare const fibonacci: (one: Duration.Input) => Schedule<Duration.Durat
3148
3091
  *
3149
3092
  * // Health check that runs at fixed intervals
3150
3093
  * const healthCheck = Effect.gen(function*() {
3151
- * yield* Console.log(`Health check at ${new Date().toISOString()}`)
3094
+ * yield* Console.log("Health check")
3152
3095
  * yield* Effect.sleep("200 millis") // simulate health check work
3153
3096
  * return "healthy"
3154
3097
  * }).pipe(
@@ -3186,15 +3129,16 @@ export declare const fibonacci: (one: Duration.Input) => Schedule<Duration.Durat
3186
3129
  * })
3187
3130
  * ```
3188
3131
  *
3189
- * @since 2.0.0
3190
3132
  * @category constructors
3133
+ * @since 2.0.0
3191
3134
  */
3192
3135
  export declare const fixed: (interval: Duration.Input) => Schedule<number>;
3193
3136
  /**
3194
3137
  * Returns a new `Schedule` that maps the output of this schedule using the
3195
3138
  * specified function.
3196
3139
  *
3197
- * @example
3140
+ * **Example** (Mapping schedule outputs)
3141
+ *
3198
3142
  * ```ts
3199
3143
  * import { Console, Effect, Schedule } from "effect"
3200
3144
  *
@@ -3212,7 +3156,6 @@ export declare const fixed: (interval: Duration.Input) => Schedule<number>;
3212
3156
  * const structuredSchedule = Schedule.spaced("1 second").pipe(
3213
3157
  * Schedule.map((recurrence) => Effect.succeed({
3214
3158
  * iteration: recurrence + 1,
3215
- * timestamp: new Date().toISOString(),
3216
3159
  * phase: recurrence < 5 ? "warmup" as const : "steady" as const
3217
3160
  * }))
3218
3161
  * )
@@ -3224,7 +3167,7 @@ export declare const fixed: (interval: Duration.Input) => Schedule<number>;
3224
3167
  * Schedule.take(8),
3225
3168
  * Schedule.tapOutput((info) =>
3226
3169
  * Console.log(
3227
- * `${info.phase} phase - iteration ${info.iteration} at ${info.timestamp}`
3170
+ * `${info.phase} phase - iteration ${info.iteration}`
3228
3171
  * )
3229
3172
  * )
3230
3173
  * )
@@ -3249,15 +3192,16 @@ export declare const fixed: (interval: Duration.Input) => Schedule<number>;
3249
3192
  * )
3250
3193
  * ```
3251
3194
  *
3252
- * @since 2.0.0
3253
3195
  * @category mapping
3196
+ * @since 2.0.0
3254
3197
  */
3255
3198
  export declare const map: {
3256
3199
  /**
3257
3200
  * Returns a new `Schedule` that maps the output of this schedule using the
3258
3201
  * specified function.
3259
3202
  *
3260
- * @example
3203
+ * **Example** (Mapping schedule outputs)
3204
+ *
3261
3205
  * ```ts
3262
3206
  * import { Console, Effect, Schedule } from "effect"
3263
3207
  *
@@ -3275,7 +3219,6 @@ export declare const map: {
3275
3219
  * const structuredSchedule = Schedule.spaced("1 second").pipe(
3276
3220
  * Schedule.map((recurrence) => Effect.succeed({
3277
3221
  * iteration: recurrence + 1,
3278
- * timestamp: new Date().toISOString(),
3279
3222
  * phase: recurrence < 5 ? "warmup" as const : "steady" as const
3280
3223
  * }))
3281
3224
  * )
@@ -3287,7 +3230,7 @@ export declare const map: {
3287
3230
  * Schedule.take(8),
3288
3231
  * Schedule.tapOutput((info) =>
3289
3232
  * Console.log(
3290
- * `${info.phase} phase - iteration ${info.iteration} at ${info.timestamp}`
3233
+ * `${info.phase} phase - iteration ${info.iteration}`
3291
3234
  * )
3292
3235
  * )
3293
3236
  * )
@@ -3312,15 +3255,16 @@ export declare const map: {
3312
3255
  * )
3313
3256
  * ```
3314
3257
  *
3315
- * @since 2.0.0
3316
3258
  * @category mapping
3259
+ * @since 2.0.0
3317
3260
  */
3318
3261
  <Output, Output2, Error2 = never, Env2 = never>(f: (output: Output) => Output2 | Effect<Output2, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output2, Input, Error | Error2, Env | Env2>;
3319
3262
  /**
3320
3263
  * Returns a new `Schedule` that maps the output of this schedule using the
3321
3264
  * specified function.
3322
3265
  *
3323
- * @example
3266
+ * **Example** (Mapping schedule outputs)
3267
+ *
3324
3268
  * ```ts
3325
3269
  * import { Console, Effect, Schedule } from "effect"
3326
3270
  *
@@ -3338,7 +3282,6 @@ export declare const map: {
3338
3282
  * const structuredSchedule = Schedule.spaced("1 second").pipe(
3339
3283
  * Schedule.map((recurrence) => Effect.succeed({
3340
3284
  * iteration: recurrence + 1,
3341
- * timestamp: new Date().toISOString(),
3342
3285
  * phase: recurrence < 5 ? "warmup" as const : "steady" as const
3343
3286
  * }))
3344
3287
  * )
@@ -3350,7 +3293,7 @@ export declare const map: {
3350
3293
  * Schedule.take(8),
3351
3294
  * Schedule.tapOutput((info) =>
3352
3295
  * Console.log(
3353
- * `${info.phase} phase - iteration ${info.iteration} at ${info.timestamp}`
3296
+ * `${info.phase} phase - iteration ${info.iteration}`
3354
3297
  * )
3355
3298
  * )
3356
3299
  * )
@@ -3375,8 +3318,8 @@ export declare const map: {
3375
3318
  * )
3376
3319
  * ```
3377
3320
  *
3378
- * @since 2.0.0
3379
3321
  * @category mapping
3322
+ * @since 2.0.0
3380
3323
  */
3381
3324
  <Output, Input, Error, Env, Output2, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output) => Output2 | Effect<Output2, Error2, Env2>): Schedule<Output2, Input, Error | Error2, Env | Env2>;
3382
3325
  };
@@ -3384,7 +3327,8 @@ export declare const map: {
3384
3327
  * Returns a new `Schedule` that modifies the delay of the next recurrence
3385
3328
  * of the schedule using the specified effectual function.
3386
3329
  *
3387
- * @example
3330
+ * **Example** (Modifying delays from schedule output)
3331
+ *
3388
3332
  * ```ts
3389
3333
  * import { Console, Duration, Effect, Schedule } from "effect"
3390
3334
  *
@@ -3409,15 +3353,16 @@ export declare const map: {
3409
3353
  * })
3410
3354
  * ```
3411
3355
  *
3412
- * @since 2.0.0
3413
3356
  * @category utilities
3357
+ * @since 2.0.0
3414
3358
  */
3415
3359
  export declare const modifyDelay: {
3416
3360
  /**
3417
3361
  * Returns a new `Schedule` that modifies the delay of the next recurrence
3418
3362
  * of the schedule using the specified effectual function.
3419
3363
  *
3420
- * @example
3364
+ * **Example** (Modifying delays from schedule output)
3365
+ *
3421
3366
  * ```ts
3422
3367
  * import { Console, Duration, Effect, Schedule } from "effect"
3423
3368
  *
@@ -3442,15 +3387,16 @@ export declare const modifyDelay: {
3442
3387
  * })
3443
3388
  * ```
3444
3389
  *
3445
- * @since 2.0.0
3446
3390
  * @category utilities
3391
+ * @since 2.0.0
3447
3392
  */
3448
3393
  <Output, Error2 = never, Env2 = never>(f: (output: Output, delay: Duration.Duration) => Effect<Duration.Input, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
3449
3394
  /**
3450
3395
  * Returns a new `Schedule` that modifies the delay of the next recurrence
3451
3396
  * of the schedule using the specified effectual function.
3452
3397
  *
3453
- * @example
3398
+ * **Example** (Modifying delays from schedule output)
3399
+ *
3454
3400
  * ```ts
3455
3401
  * import { Console, Duration, Effect, Schedule } from "effect"
3456
3402
  *
@@ -3475,8 +3421,8 @@ export declare const modifyDelay: {
3475
3421
  * })
3476
3422
  * ```
3477
3423
  *
3478
- * @since 2.0.0
3479
3424
  * @category utilities
3425
+ * @since 2.0.0
3480
3426
  */
3481
3427
  <Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output, delay: Duration.Input) => Effect<Duration.Input, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
3482
3428
  };
@@ -3485,14 +3431,15 @@ export declare const modifyDelay: {
3485
3431
  *
3486
3432
  * Delays are jittered between `80%` and `120%` of the original delay.
3487
3433
  *
3488
- * @since 2.0.0
3489
3434
  * @category utilities
3435
+ * @since 2.0.0
3490
3436
  */
3491
3437
  export declare const jittered: <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
3492
3438
  /**
3493
3439
  * Returns a new `Schedule` that outputs the inputs of the specified schedule.
3494
3440
  *
3495
- * @example
3441
+ * **Example** (Passing inputs through as outputs)
3442
+ *
3496
3443
  * ```ts
3497
3444
  * import { Console, Effect, Schedule } from "effect"
3498
3445
  *
@@ -3514,15 +3461,16 @@ export declare const jittered: <Output, Input, Error, Env>(self: Schedule<Output
3514
3461
  * })
3515
3462
  * ```
3516
3463
  *
3517
- * @since 2.0.0
3518
3464
  * @category utilities
3465
+ * @since 2.0.0
3519
3466
  */
3520
3467
  export declare const passthrough: <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Input, Input, Error, Env>;
3521
3468
  /**
3522
3469
  * Returns a `Schedule` which can only be stepped the specified number of
3523
3470
  * `times` before it terminates.
3524
3471
  *
3525
- * @example
3472
+ * **Example** (Limiting recurrences)
3473
+ *
3526
3474
  * ```ts
3527
3475
  * import { Console, Data, Effect, Schedule } from "effect"
3528
3476
  *
@@ -3560,7 +3508,7 @@ export declare const passthrough: <Output, Input, Error, Env>(self: Schedule<Out
3560
3508
  * // Repeat an effect exactly 10 times
3561
3509
  * const exactlyTenTimes = Effect.gen(function*() {
3562
3510
  * yield* Console.log("Executing task...")
3563
- * return Math.random()
3511
+ * return "completed"
3564
3512
  * }).pipe(
3565
3513
  * Effect.repeat(Schedule.recurs(10))
3566
3514
  * )
@@ -3580,7 +3528,8 @@ export declare const recurs: (times: number) => Schedule<number>;
3580
3528
  * using the specified effectful `combine` function and starting from the
3581
3529
  * specified `initial` state.
3582
3530
  *
3583
- * @example
3531
+ * **Example** (Reducing schedule outputs)
3532
+ *
3584
3533
  * ```ts
3585
3534
  * import { Console, Effect, Schedule } from "effect"
3586
3535
  *
@@ -3605,24 +3554,24 @@ export declare const recurs: (times: number) => Schedule<number>;
3605
3554
  * yield* Console.log(`Final sum: ${finalSum}`)
3606
3555
  * })
3607
3556
  *
3608
- * // Build a history of execution times
3557
+ * // Build a history of execution counts
3609
3558
  * const historySchedule = Schedule.reduce(
3610
3559
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
3611
3560
  * () => [] as Array<number>, // Initial empty array
3612
- * (history, executionNumber) => Effect.succeed([...history, Date.now()])
3561
+ * (history, executionNumber) => Effect.succeed([...history, executionNumber])
3613
3562
  * )
3614
3563
  *
3615
3564
  * const historyProgram = Effect.gen(function*() {
3616
3565
  * const timeline = yield* Effect.repeat(
3617
3566
  * Effect.gen(function*() {
3618
- * yield* Console.log("Recording timestamp...")
3567
+ * yield* Console.log("Recording execution...")
3619
3568
  * return "recorded"
3620
3569
  * }),
3621
3570
  * historySchedule
3622
3571
  * )
3623
3572
  *
3624
3573
  * yield* Console.log(
3625
- * `Execution timeline: ${timeline.length} timestamps recorded`
3574
+ * `Execution timeline: ${timeline.join(", ")}`
3626
3575
  * )
3627
3576
  * })
3628
3577
  *
@@ -3683,8 +3632,8 @@ export declare const recurs: (times: number) => Schedule<number>;
3683
3632
  * })
3684
3633
  * ```
3685
3634
  *
3686
- * @since 2.0.0
3687
3635
  * @category utilities
3636
+ * @since 2.0.0
3688
3637
  */
3689
3638
  export declare const reduce: {
3690
3639
  /**
@@ -3692,7 +3641,8 @@ export declare const reduce: {
3692
3641
  * using the specified effectful `combine` function and starting from the
3693
3642
  * specified `initial` state.
3694
3643
  *
3695
- * @example
3644
+ * **Example** (Reducing schedule outputs)
3645
+ *
3696
3646
  * ```ts
3697
3647
  * import { Console, Effect, Schedule } from "effect"
3698
3648
  *
@@ -3717,24 +3667,24 @@ export declare const reduce: {
3717
3667
  * yield* Console.log(`Final sum: ${finalSum}`)
3718
3668
  * })
3719
3669
  *
3720
- * // Build a history of execution times
3670
+ * // Build a history of execution counts
3721
3671
  * const historySchedule = Schedule.reduce(
3722
3672
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
3723
3673
  * () => [] as Array<number>, // Initial empty array
3724
- * (history, executionNumber) => Effect.succeed([...history, Date.now()])
3674
+ * (history, executionNumber) => Effect.succeed([...history, executionNumber])
3725
3675
  * )
3726
3676
  *
3727
3677
  * const historyProgram = Effect.gen(function*() {
3728
3678
  * const timeline = yield* Effect.repeat(
3729
3679
  * Effect.gen(function*() {
3730
- * yield* Console.log("Recording timestamp...")
3680
+ * yield* Console.log("Recording execution...")
3731
3681
  * return "recorded"
3732
3682
  * }),
3733
3683
  * historySchedule
3734
3684
  * )
3735
3685
  *
3736
3686
  * yield* Console.log(
3737
- * `Execution timeline: ${timeline.length} timestamps recorded`
3687
+ * `Execution timeline: ${timeline.join(", ")}`
3738
3688
  * )
3739
3689
  * })
3740
3690
  *
@@ -3795,8 +3745,8 @@ export declare const reduce: {
3795
3745
  * })
3796
3746
  * ```
3797
3747
  *
3798
- * @since 2.0.0
3799
3748
  * @category utilities
3749
+ * @since 2.0.0
3800
3750
  */
3801
3751
  <State, Output, Error2 = never, Env2 = never>(initial: LazyArg<State>, combine: (state: State, output: Output) => State | Effect<State, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<State, Input, Error | Error2, Env | Env2>;
3802
3752
  /**
@@ -3804,7 +3754,8 @@ export declare const reduce: {
3804
3754
  * using the specified effectful `combine` function and starting from the
3805
3755
  * specified `initial` state.
3806
3756
  *
3807
- * @example
3757
+ * **Example** (Reducing schedule outputs)
3758
+ *
3808
3759
  * ```ts
3809
3760
  * import { Console, Effect, Schedule } from "effect"
3810
3761
  *
@@ -3829,24 +3780,24 @@ export declare const reduce: {
3829
3780
  * yield* Console.log(`Final sum: ${finalSum}`)
3830
3781
  * })
3831
3782
  *
3832
- * // Build a history of execution times
3783
+ * // Build a history of execution counts
3833
3784
  * const historySchedule = Schedule.reduce(
3834
3785
  * Schedule.spaced("1 second").pipe(Schedule.take(4)),
3835
3786
  * () => [] as Array<number>, // Initial empty array
3836
- * (history, executionNumber) => Effect.succeed([...history, Date.now()])
3787
+ * (history, executionNumber) => Effect.succeed([...history, executionNumber])
3837
3788
  * )
3838
3789
  *
3839
3790
  * const historyProgram = Effect.gen(function*() {
3840
3791
  * const timeline = yield* Effect.repeat(
3841
3792
  * Effect.gen(function*() {
3842
- * yield* Console.log("Recording timestamp...")
3793
+ * yield* Console.log("Recording execution...")
3843
3794
  * return "recorded"
3844
3795
  * }),
3845
3796
  * historySchedule
3846
3797
  * )
3847
3798
  *
3848
3799
  * yield* Console.log(
3849
- * `Execution timeline: ${timeline.length} timestamps recorded`
3800
+ * `Execution timeline: ${timeline.join(", ")}`
3850
3801
  * )
3851
3802
  * })
3852
3803
  *
@@ -3907,8 +3858,8 @@ export declare const reduce: {
3907
3858
  * })
3908
3859
  * ```
3909
3860
  *
3910
- * @since 2.0.0
3911
3861
  * @category utilities
3862
+ * @since 2.0.0
3912
3863
  */
3913
3864
  <Output, Input, Error, Env, State, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, initial: LazyArg<State>, combine: (state: State, output: Output) => State | Effect<State, Error2, Env2>): Schedule<State, Input, Error | Error2, Env | Env2>;
3914
3865
  };
@@ -3916,7 +3867,8 @@ export declare const reduce: {
3916
3867
  * Returns a schedule that recurs continuously, each repetition spaced the
3917
3868
  * specified duration from the last run.
3918
3869
  *
3919
- * @example
3870
+ * **Example** (Repeating with fixed spacing)
3871
+ *
3920
3872
  * ```ts
3921
3873
  * import { Console, Effect, Schedule } from "effect"
3922
3874
  *
@@ -3925,7 +3877,7 @@ export declare const reduce: {
3925
3877
  *
3926
3878
  * // Heartbeat that runs indefinitely with fixed spacing
3927
3879
  * const heartbeat = Effect.gen(function*() {
3928
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
3880
+ * yield* Console.log("Heartbeat")
3929
3881
  * }).pipe(
3930
3882
  * Effect.repeat(everyTwoSeconds)
3931
3883
  * )
@@ -3958,8 +3910,8 @@ export declare const reduce: {
3958
3910
  * })
3959
3911
  * ```
3960
3912
  *
3961
- * @since 2.0.0
3962
3913
  * @category constructors
3914
+ * @since 2.0.0
3963
3915
  */
3964
3916
  export declare const spaced: (duration: Duration.Input) => Schedule<number>;
3965
3917
  /**
@@ -3967,7 +3919,8 @@ export declare const spaced: (duration: Duration.Input) => Schedule<number>;
3967
3919
  * every input to the schedule, but does not alter the inputs and outputs of
3968
3920
  * the schedule.
3969
3921
  *
3970
- * @example
3922
+ * **Example** (Tapping retry inputs)
3923
+ *
3971
3924
  * ```ts
3972
3925
  * import { Console, Data, Effect, Schedule } from "effect"
3973
3926
  *
@@ -4003,7 +3956,6 @@ export declare const spaced: (duration: Duration.Input) => Schedule<number>;
4003
3956
  * Schedule.take(5),
4004
3957
  * Schedule.tapInput((input: unknown) =>
4005
3958
  * Effect.gen(function*() {
4006
- * yield* Console.log(`Processing input at ${new Date().toISOString()}`)
4007
3959
  * yield* Console.log(`Input type: ${typeof input}`)
4008
3960
  * // In real applications, might send metrics to monitoring system
4009
3961
  * })
@@ -4025,10 +3977,13 @@ export declare const spaced: (duration: Duration.Input) => Schedule<number>;
4025
3977
  * )
4026
3978
  *
4027
3979
  * const validationProgram = Effect.gen(function*() {
3980
+ * let count = 0
3981
+ *
4028
3982
  * yield* Effect.repeat(
4029
3983
  * Effect.gen(function*() {
3984
+ * count++
4030
3985
  * yield* Console.log("Task with validation")
4031
- * return { data: Math.random(), timestamp: Date.now() }
3986
+ * return { data: `sample-${count}` }
4032
3987
  * }),
4033
3988
  * validatingSchedule
4034
3989
  * )
@@ -4040,10 +3995,10 @@ export declare const spaced: (duration: Duration.Input) => Schedule<number>;
4040
3995
  * Schedule.tapInput((error: RetryError) =>
4041
3996
  * Effect.gen(function*() {
4042
3997
  * if (String(error).includes("critical")) {
4043
- * yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
3998
+ * yield* Console.log(`Critical error: ${String(error)}`)
4044
3999
  * // In real applications, might trigger alerts or notifications
4045
4000
  * } else {
4046
- * yield* Console.log(`ℹ️ Regular error: ${String(error)}`)
4001
+ * yield* Console.log(`Regular error: ${String(error)}`)
4047
4002
  * }
4048
4003
  * })
4049
4004
  * )
@@ -4077,14 +4032,14 @@ export declare const spaced: (duration: Duration.Input) => Schedule<number>;
4077
4032
  * ),
4078
4033
  * Schedule.tapInput((error: RetryError) =>
4079
4034
  * String(error).length > 20
4080
- * ? Console.log("📝 Long error message detected")
4035
+ * ? Console.log("Long error message detected")
4081
4036
  * : Effect.void
4082
4037
  * )
4083
4038
  * )
4084
4039
  * ```
4085
4040
  *
4086
- * @since 2.0.0
4087
4041
  * @category sequencing
4042
+ * @since 2.0.0
4088
4043
  */
4089
4044
  export declare const tapInput: {
4090
4045
  /**
@@ -4092,7 +4047,8 @@ export declare const tapInput: {
4092
4047
  * every input to the schedule, but does not alter the inputs and outputs of
4093
4048
  * the schedule.
4094
4049
  *
4095
- * @example
4050
+ * **Example** (Tapping retry inputs)
4051
+ *
4096
4052
  * ```ts
4097
4053
  * import { Console, Data, Effect, Schedule } from "effect"
4098
4054
  *
@@ -4128,7 +4084,6 @@ export declare const tapInput: {
4128
4084
  * Schedule.take(5),
4129
4085
  * Schedule.tapInput((input: unknown) =>
4130
4086
  * Effect.gen(function*() {
4131
- * yield* Console.log(`Processing input at ${new Date().toISOString()}`)
4132
4087
  * yield* Console.log(`Input type: ${typeof input}`)
4133
4088
  * // In real applications, might send metrics to monitoring system
4134
4089
  * })
@@ -4150,10 +4105,13 @@ export declare const tapInput: {
4150
4105
  * )
4151
4106
  *
4152
4107
  * const validationProgram = Effect.gen(function*() {
4108
+ * let count = 0
4109
+ *
4153
4110
  * yield* Effect.repeat(
4154
4111
  * Effect.gen(function*() {
4112
+ * count++
4155
4113
  * yield* Console.log("Task with validation")
4156
- * return { data: Math.random(), timestamp: Date.now() }
4114
+ * return { data: `sample-${count}` }
4157
4115
  * }),
4158
4116
  * validatingSchedule
4159
4117
  * )
@@ -4165,10 +4123,10 @@ export declare const tapInput: {
4165
4123
  * Schedule.tapInput((error: RetryError) =>
4166
4124
  * Effect.gen(function*() {
4167
4125
  * if (String(error).includes("critical")) {
4168
- * yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
4126
+ * yield* Console.log(`Critical error: ${String(error)}`)
4169
4127
  * // In real applications, might trigger alerts or notifications
4170
4128
  * } else {
4171
- * yield* Console.log(`ℹ️ Regular error: ${String(error)}`)
4129
+ * yield* Console.log(`Regular error: ${String(error)}`)
4172
4130
  * }
4173
4131
  * })
4174
4132
  * )
@@ -4202,14 +4160,14 @@ export declare const tapInput: {
4202
4160
  * ),
4203
4161
  * Schedule.tapInput((error: RetryError) =>
4204
4162
  * String(error).length > 20
4205
- * ? Console.log("📝 Long error message detected")
4163
+ * ? Console.log("Long error message detected")
4206
4164
  * : Effect.void
4207
4165
  * )
4208
4166
  * )
4209
4167
  * ```
4210
4168
  *
4211
- * @since 2.0.0
4212
4169
  * @category sequencing
4170
+ * @since 2.0.0
4213
4171
  */
4214
4172
  <Input, X, Error2, Env2>(f: (input: Input) => Effect<X, Error2, Env2>): <Output, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
4215
4173
  /**
@@ -4217,7 +4175,8 @@ export declare const tapInput: {
4217
4175
  * every input to the schedule, but does not alter the inputs and outputs of
4218
4176
  * the schedule.
4219
4177
  *
4220
- * @example
4178
+ * **Example** (Tapping retry inputs)
4179
+ *
4221
4180
  * ```ts
4222
4181
  * import { Console, Data, Effect, Schedule } from "effect"
4223
4182
  *
@@ -4253,7 +4212,6 @@ export declare const tapInput: {
4253
4212
  * Schedule.take(5),
4254
4213
  * Schedule.tapInput((input: unknown) =>
4255
4214
  * Effect.gen(function*() {
4256
- * yield* Console.log(`Processing input at ${new Date().toISOString()}`)
4257
4215
  * yield* Console.log(`Input type: ${typeof input}`)
4258
4216
  * // In real applications, might send metrics to monitoring system
4259
4217
  * })
@@ -4275,10 +4233,13 @@ export declare const tapInput: {
4275
4233
  * )
4276
4234
  *
4277
4235
  * const validationProgram = Effect.gen(function*() {
4236
+ * let count = 0
4237
+ *
4278
4238
  * yield* Effect.repeat(
4279
4239
  * Effect.gen(function*() {
4240
+ * count++
4280
4241
  * yield* Console.log("Task with validation")
4281
- * return { data: Math.random(), timestamp: Date.now() }
4242
+ * return { data: `sample-${count}` }
4282
4243
  * }),
4283
4244
  * validatingSchedule
4284
4245
  * )
@@ -4290,10 +4251,10 @@ export declare const tapInput: {
4290
4251
  * Schedule.tapInput((error: RetryError) =>
4291
4252
  * Effect.gen(function*() {
4292
4253
  * if (String(error).includes("critical")) {
4293
- * yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
4254
+ * yield* Console.log(`Critical error: ${String(error)}`)
4294
4255
  * // In real applications, might trigger alerts or notifications
4295
4256
  * } else {
4296
- * yield* Console.log(`ℹ️ Regular error: ${String(error)}`)
4257
+ * yield* Console.log(`Regular error: ${String(error)}`)
4297
4258
  * }
4298
4259
  * })
4299
4260
  * )
@@ -4327,14 +4288,14 @@ export declare const tapInput: {
4327
4288
  * ),
4328
4289
  * Schedule.tapInput((error: RetryError) =>
4329
4290
  * String(error).length > 20
4330
- * ? Console.log("📝 Long error message detected")
4291
+ * ? Console.log("Long error message detected")
4331
4292
  * : Effect.void
4332
4293
  * )
4333
4294
  * )
4334
4295
  * ```
4335
4296
  *
4336
- * @since 2.0.0
4337
4297
  * @category sequencing
4298
+ * @since 2.0.0
4338
4299
  */
4339
4300
  <Output, Input, Error, Env, X, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, f: (input: Input) => Effect<X, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
4340
4301
  };
@@ -4343,7 +4304,8 @@ export declare const tapInput: {
4343
4304
  * every output of the schedule, but does not alter the inputs and outputs of
4344
4305
  * the schedule.
4345
4306
  *
4346
- * @example
4307
+ * **Example** (Tapping schedule outputs)
4308
+ *
4347
4309
  * ```ts
4348
4310
  * import { Console, Data, Effect, Schedule } from "effect"
4349
4311
  *
@@ -4391,7 +4353,7 @@ export declare const tapInput: {
4391
4353
  * Effect.gen(function*() {
4392
4354
  * const delayMs = delay.toString()
4393
4355
  * if (delayMs.includes("1000")) { // Alert on delays >= 1 second
4394
- * yield* Console.log(`🚨 High delay detected: ${delay}`)
4356
+ * yield* Console.log(`High delay detected: ${delay}`)
4395
4357
  * }
4396
4358
  * })
4397
4359
  * )
@@ -4401,8 +4363,7 @@ export declare const tapInput: {
4401
4363
  * yield* Effect.repeat(
4402
4364
  * Effect.gen(function*() {
4403
4365
  * yield* Console.log("Performing health check...")
4404
- * // Simulate health check
4405
- * return Math.random() > 0.7 ? "healthy" : "degraded"
4366
+ * return "healthy"
4406
4367
  * }),
4407
4368
  * alertingSchedule
4408
4369
  * )
@@ -4414,14 +4375,14 @@ export declare const tapInput: {
4414
4375
  * Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
4415
4376
  * Schedule.tapOutput((count) =>
4416
4377
  * count % 3 === 0
4417
- * ? Console.log("🎯 Checkpoint reached!")
4378
+ * ? Console.log("Checkpoint reached")
4418
4379
  * : Effect.void
4419
4380
  * )
4420
4381
  * )
4421
4382
  * ```
4422
4383
  *
4423
- * @since 2.0.0
4424
4384
  * @category sequencing
4385
+ * @since 2.0.0
4425
4386
  */
4426
4387
  export declare const tapOutput: {
4427
4388
  /**
@@ -4429,7 +4390,8 @@ export declare const tapOutput: {
4429
4390
  * every output of the schedule, but does not alter the inputs and outputs of
4430
4391
  * the schedule.
4431
4392
  *
4432
- * @example
4393
+ * **Example** (Tapping schedule outputs)
4394
+ *
4433
4395
  * ```ts
4434
4396
  * import { Console, Data, Effect, Schedule } from "effect"
4435
4397
  *
@@ -4477,7 +4439,7 @@ export declare const tapOutput: {
4477
4439
  * Effect.gen(function*() {
4478
4440
  * const delayMs = delay.toString()
4479
4441
  * if (delayMs.includes("1000")) { // Alert on delays >= 1 second
4480
- * yield* Console.log(`🚨 High delay detected: ${delay}`)
4442
+ * yield* Console.log(`High delay detected: ${delay}`)
4481
4443
  * }
4482
4444
  * })
4483
4445
  * )
@@ -4487,8 +4449,7 @@ export declare const tapOutput: {
4487
4449
  * yield* Effect.repeat(
4488
4450
  * Effect.gen(function*() {
4489
4451
  * yield* Console.log("Performing health check...")
4490
- * // Simulate health check
4491
- * return Math.random() > 0.7 ? "healthy" : "degraded"
4452
+ * return "healthy"
4492
4453
  * }),
4493
4454
  * alertingSchedule
4494
4455
  * )
@@ -4500,14 +4461,14 @@ export declare const tapOutput: {
4500
4461
  * Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
4501
4462
  * Schedule.tapOutput((count) =>
4502
4463
  * count % 3 === 0
4503
- * ? Console.log("🎯 Checkpoint reached!")
4464
+ * ? Console.log("Checkpoint reached")
4504
4465
  * : Effect.void
4505
4466
  * )
4506
4467
  * )
4507
4468
  * ```
4508
4469
  *
4509
- * @since 2.0.0
4510
4470
  * @category sequencing
4471
+ * @since 2.0.0
4511
4472
  */
4512
4473
  <Output, X, Error2, Env2>(f: (output: Output) => Effect<X, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
4513
4474
  /**
@@ -4515,7 +4476,8 @@ export declare const tapOutput: {
4515
4476
  * every output of the schedule, but does not alter the inputs and outputs of
4516
4477
  * the schedule.
4517
4478
  *
4518
- * @example
4479
+ * **Example** (Tapping schedule outputs)
4480
+ *
4519
4481
  * ```ts
4520
4482
  * import { Console, Data, Effect, Schedule } from "effect"
4521
4483
  *
@@ -4563,7 +4525,7 @@ export declare const tapOutput: {
4563
4525
  * Effect.gen(function*() {
4564
4526
  * const delayMs = delay.toString()
4565
4527
  * if (delayMs.includes("1000")) { // Alert on delays >= 1 second
4566
- * yield* Console.log(`🚨 High delay detected: ${delay}`)
4528
+ * yield* Console.log(`High delay detected: ${delay}`)
4567
4529
  * }
4568
4530
  * })
4569
4531
  * )
@@ -4573,8 +4535,7 @@ export declare const tapOutput: {
4573
4535
  * yield* Effect.repeat(
4574
4536
  * Effect.gen(function*() {
4575
4537
  * yield* Console.log("Performing health check...")
4576
- * // Simulate health check
4577
- * return Math.random() > 0.7 ? "healthy" : "degraded"
4538
+ * return "healthy"
4578
4539
  * }),
4579
4540
  * alertingSchedule
4580
4541
  * )
@@ -4586,14 +4547,14 @@ export declare const tapOutput: {
4586
4547
  * Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
4587
4548
  * Schedule.tapOutput((count) =>
4588
4549
  * count % 3 === 0
4589
- * ? Console.log("🎯 Checkpoint reached!")
4550
+ * ? Console.log("Checkpoint reached")
4590
4551
  * : Effect.void
4591
4552
  * )
4592
4553
  * )
4593
4554
  * ```
4594
4555
  *
4595
- * @since 2.0.0
4596
4556
  * @category sequencing
4557
+ * @since 2.0.0
4597
4558
  */
4598
4559
  <Output, Input, Error, Env, X, Error2, Env2>(self: Schedule<Output, Input, Error, Env>, f: (output: Output) => Effect<X, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
4599
4560
  };
@@ -4602,7 +4563,8 @@ export declare const tapOutput: {
4602
4563
  * from the schedule. Once the specified number of outputs is reached, the
4603
4564
  * schedule will stop.
4604
4565
  *
4605
- * @example
4566
+ * **Example** (Taking a limited number of recurrences)
4567
+ *
4606
4568
  * ```ts
4607
4569
  * import { Console, Data, Effect, Schedule } from "effect"
4608
4570
  *
@@ -4616,7 +4578,7 @@ export declare const tapOutput: {
4616
4578
  * const heartbeatProgram = Effect.gen(function*() {
4617
4579
  * yield* Effect.repeat(
4618
4580
  * Effect.gen(function*() {
4619
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
4581
+ * yield* Console.log("Heartbeat")
4620
4582
  * return "pulse"
4621
4583
  * }),
4622
4584
  * limitedHeartbeat
@@ -4663,8 +4625,8 @@ export declare const tapOutput: {
4663
4625
  * const samplingProgram = Effect.gen(function*() {
4664
4626
  * yield* Effect.repeat(
4665
4627
  * Effect.gen(function*() {
4666
- * const value = Math.random()
4667
- * yield* Console.log(`Sampled value: ${value.toFixed(3)}`)
4628
+ * const value = "sample"
4629
+ * yield* Console.log(`Sampled value: ${value}`)
4668
4630
  * return value
4669
4631
  * }),
4670
4632
  * samplingSchedule.pipe(
@@ -4674,8 +4636,8 @@ export declare const tapOutput: {
4674
4636
  * })
4675
4637
  * ```
4676
4638
  *
4677
- * @since 2.0.0
4678
4639
  * @category utilities
4640
+ * @since 2.0.0
4679
4641
  */
4680
4642
  export declare const take: {
4681
4643
  /**
@@ -4683,7 +4645,8 @@ export declare const take: {
4683
4645
  * from the schedule. Once the specified number of outputs is reached, the
4684
4646
  * schedule will stop.
4685
4647
  *
4686
- * @example
4648
+ * **Example** (Taking a limited number of recurrences)
4649
+ *
4687
4650
  * ```ts
4688
4651
  * import { Console, Data, Effect, Schedule } from "effect"
4689
4652
  *
@@ -4697,7 +4660,7 @@ export declare const take: {
4697
4660
  * const heartbeatProgram = Effect.gen(function*() {
4698
4661
  * yield* Effect.repeat(
4699
4662
  * Effect.gen(function*() {
4700
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
4663
+ * yield* Console.log("Heartbeat")
4701
4664
  * return "pulse"
4702
4665
  * }),
4703
4666
  * limitedHeartbeat
@@ -4744,8 +4707,8 @@ export declare const take: {
4744
4707
  * const samplingProgram = Effect.gen(function*() {
4745
4708
  * yield* Effect.repeat(
4746
4709
  * Effect.gen(function*() {
4747
- * const value = Math.random()
4748
- * yield* Console.log(`Sampled value: ${value.toFixed(3)}`)
4710
+ * const value = "sample"
4711
+ * yield* Console.log(`Sampled value: ${value}`)
4749
4712
  * return value
4750
4713
  * }),
4751
4714
  * samplingSchedule.pipe(
@@ -4755,8 +4718,8 @@ export declare const take: {
4755
4718
  * })
4756
4719
  * ```
4757
4720
  *
4758
- * @since 2.0.0
4759
4721
  * @category utilities
4722
+ * @since 2.0.0
4760
4723
  */
4761
4724
  (n: number): <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
4762
4725
  /**
@@ -4764,7 +4727,8 @@ export declare const take: {
4764
4727
  * from the schedule. Once the specified number of outputs is reached, the
4765
4728
  * schedule will stop.
4766
4729
  *
4767
- * @example
4730
+ * **Example** (Taking a limited number of recurrences)
4731
+ *
4768
4732
  * ```ts
4769
4733
  * import { Console, Data, Effect, Schedule } from "effect"
4770
4734
  *
@@ -4778,7 +4742,7 @@ export declare const take: {
4778
4742
  * const heartbeatProgram = Effect.gen(function*() {
4779
4743
  * yield* Effect.repeat(
4780
4744
  * Effect.gen(function*() {
4781
- * yield* Console.log(`Heartbeat at ${new Date().toISOString()}`)
4745
+ * yield* Console.log("Heartbeat")
4782
4746
  * return "pulse"
4783
4747
  * }),
4784
4748
  * limitedHeartbeat
@@ -4825,8 +4789,8 @@ export declare const take: {
4825
4789
  * const samplingProgram = Effect.gen(function*() {
4826
4790
  * yield* Effect.repeat(
4827
4791
  * Effect.gen(function*() {
4828
- * const value = Math.random()
4829
- * yield* Console.log(`Sampled value: ${value.toFixed(3)}`)
4792
+ * const value = "sample"
4793
+ * yield* Console.log(`Sampled value: ${value}`)
4830
4794
  * return value
4831
4795
  * }),
4832
4796
  * samplingSchedule.pipe(
@@ -4836,8 +4800,8 @@ export declare const take: {
4836
4800
  * })
4837
4801
  * ```
4838
4802
  *
4839
- * @since 2.0.0
4840
4803
  * @category utilities
4804
+ * @since 2.0.0
4841
4805
  */
4842
4806
  <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>, n: number): Schedule<Output, Input, Error, Env>;
4843
4807
  };
@@ -4845,7 +4809,8 @@ export declare const take: {
4845
4809
  * Creates a schedule that unfolds a state by repeatedly applying a function,
4846
4810
  * outputting the current state and computing the next state.
4847
4811
  *
4848
- * @example
4812
+ * **Example** (Unfolding schedule state)
4813
+ *
4849
4814
  * ```ts
4850
4815
  * import { Console, Effect, Schedule } from "effect"
4851
4816
  *
@@ -4893,15 +4858,14 @@ export declare const take: {
4893
4858
  * })
4894
4859
  * )
4895
4860
  *
4896
- * // Random jitter schedule
4897
- * const jitteredSchedule = Schedule.unfold(
4898
- * 1000,
4899
- * (baseDelay) =>
4861
+ * // Deterministic delay adjustment schedule
4862
+ * const adjustedDelaySchedule = Schedule.unfold(
4863
+ * { delay: 1000, adjustment: 100 },
4864
+ * ({ delay, adjustment }) =>
4900
4865
  * Effect.gen(function*() {
4901
- * const jitter = Math.random() * 200 - 100 // ±100ms jitter
4902
- * const nextDelay = Math.max(100, baseDelay + jitter)
4903
- * yield* Console.log(`Jittered delay: ${nextDelay.toFixed(0)}ms`)
4904
- * return nextDelay
4866
+ * const nextDelay = Math.max(100, delay + adjustment)
4867
+ * yield* Console.log(`Adjusted delay: ${nextDelay}ms`)
4868
+ * return { delay: nextDelay, adjustment: adjustment * -1 }
4905
4869
  * })
4906
4870
  * )
4907
4871
  *
@@ -4934,8 +4898,8 @@ export declare const take: {
4934
4898
  * })
4935
4899
  * ```
4936
4900
  *
4937
- * @since 2.0.0
4938
4901
  * @category constructors
4902
+ * @since 2.0.0
4939
4903
  */
4940
4904
  export declare const unfold: <State, Error = never, Env = never>(initial: State, next: (state: State) => Effect<State, Error, Env>) => Schedule<State, unknown, Error, Env>;
4941
4905
  declare const while_: {
@@ -4950,8 +4914,8 @@ export {
4950
4914
  * If the `predicate` returns `true`, the schedule will continue, otherwise
4951
4915
  * the schedule will stop.
4952
4916
  *
4953
- * @since 2.0.0
4954
4917
  * @category utilities
4918
+ * @since 2.0.0
4955
4919
  */
4956
4920
  while_ as while };
4957
4921
  /**
@@ -4967,7 +4931,8 @@ while_ as while };
4967
4931
  * |action------|sleep---|act|-sleep|action----|
4968
4932
  * ```
4969
4933
  *
4970
- * @example
4934
+ * **Example** (Repeating on aligned windows)
4935
+ *
4971
4936
  * ```ts
4972
4937
  * import { Console, Effect, Schedule } from "effect"
4973
4938
  *
@@ -4977,8 +4942,7 @@ while_ as while };
4977
4942
  * const program = Effect.gen(function*() {
4978
4943
  * yield* Effect.repeat(
4979
4944
  * Effect.gen(function*() {
4980
- * const now = new Date().toISOString()
4981
- * yield* Console.log(`Window task executed at: ${now}`)
4945
+ * yield* Console.log("Window task executed")
4982
4946
  * return "window-task"
4983
4947
  * }),
4984
4948
  * windowSchedule.pipe(Schedule.take(4))
@@ -4986,8 +4950,8 @@ while_ as while };
4986
4950
  * })
4987
4951
  * ```
4988
4952
  *
4989
- * @since 2.0.0
4990
4953
  * @category constructors
4954
+ * @since 2.0.0
4991
4955
  */
4992
4956
  export declare const windowed: (interval: Duration.Input) => Schedule<number>;
4993
4957
  /**
@@ -4996,7 +4960,8 @@ export declare const windowed: (interval: Duration.Input) => Schedule<number>;
4996
4960
  * The output of the schedule is the current count of its repetitions thus far
4997
4961
  * (i.e. `0, 1, 2, ...`).
4998
4962
  *
4999
- * @example
4963
+ * **Example** (Repeating forever)
4964
+ *
5000
4965
  * ```ts
5001
4966
  * import { Console, Effect, Schedule } from "effect"
5002
4967
  *
@@ -5014,8 +4979,8 @@ export declare const windowed: (interval: Duration.Input) => Schedule<number>;
5014
4979
  * })
5015
4980
  * ```
5016
4981
  *
5017
- * @since 2.0.0
5018
4982
  * @category constructors
4983
+ * @since 2.0.0
5019
4984
  */
5020
4985
  export declare const forever: Schedule<number>;
5021
4986
  declare const identity_: <A>() => Schedule<A, A>;
@@ -5029,14 +4994,15 @@ export {
5029
4994
  * without modification. It effectively acts as a pass-through that simply
5030
4995
  * echoes its input values at each step.
5031
4996
  *
5032
- * @since 2.0.0
5033
4997
  * @category Constructors
4998
+ * @since 2.0.0
5034
4999
  */
5035
5000
  identity_ as identity };
5036
5001
  /**
5037
5002
  * Ensures that the provided schedule respects a specified input type.
5038
5003
  *
5039
- * @example
5004
+ * **Example** (Constraining schedule input types)
5005
+ *
5040
5006
  * ```ts
5041
5007
  * import { Schedule } from "effect"
5042
5008
  *
@@ -5055,22 +5021,23 @@ identity_ as identity };
5055
5021
  * // where CustomType doesn't match the schedule's input type
5056
5022
  * ```
5057
5023
  *
5058
- * @since 2.0.0
5059
5024
  * @category ensuring types
5025
+ * @since 2.0.0
5060
5026
  */
5061
5027
  export declare const satisfiesInputType: <T>() => <Input extends T, Output = never, Error = never, Env = never>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
5062
5028
  /**
5063
5029
  * Sets the input type of the provided schedule to a specified type, without
5064
5030
  * altering the schedule's behavior.
5065
5031
  *
5066
- * @since 2.0.0
5067
5032
  * @category ensuring types
5033
+ * @since 2.0.0
5068
5034
  */
5069
5035
  export declare const setInputType: <T>() => <Output, Error, Env>(self: Schedule<Output, T, Error, Env>) => Schedule<Output, T, Error, Env>;
5070
5036
  /**
5071
5037
  * Ensures that the provided schedule respects a specified output type.
5072
5038
  *
5073
- * @example
5039
+ * **Example** (Constraining schedule output types)
5040
+ *
5074
5041
  * ```ts
5075
5042
  * import { Effect, Schedule } from "effect"
5076
5043
  *
@@ -5084,14 +5051,15 @@ export declare const setInputType: <T>() => <Output, Error, Env>(self: Schedule<
5084
5051
  * )
5085
5052
  * ```
5086
5053
  *
5087
- * @since 2.0.0
5088
5054
  * @category ensuring types
5055
+ * @since 2.0.0
5089
5056
  */
5090
5057
  export declare const satisfiesOutputType: <T>() => <Output extends T, Error = never, Input = unknown, Env = never>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
5091
5058
  /**
5092
5059
  * Ensures that the provided schedule respects a specified error type.
5093
5060
  *
5094
- * @example
5061
+ * **Example** (Constraining schedule error types)
5062
+ *
5095
5063
  * ```ts
5096
5064
  * import { Data, Schedule } from "effect"
5097
5065
  *
@@ -5111,16 +5079,17 @@ export declare const satisfiesOutputType: <T>() => <Output extends T, Error = ne
5111
5079
  * )
5112
5080
  * ```
5113
5081
  *
5114
- * @since 2.0.0
5115
5082
  * @category ensuring types
5083
+ * @since 2.0.0
5116
5084
  */
5117
5085
  export declare const satisfiesErrorType: <T>() => <Error extends T, Output = never, Input = unknown, Env = never>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
5118
5086
  /**
5119
5087
  * Ensures that the provided schedule respects a specified context type.
5120
5088
  *
5121
- * @example
5089
+ * **Example** (Constraining schedule service types)
5090
+ *
5122
5091
  * ```ts
5123
- * import { Schedule } from "effect"
5092
+ * import { Effect, Schedule } from "effect"
5124
5093
  *
5125
5094
  * // Define service interfaces (type-level only)
5126
5095
  * interface Logger {
@@ -5128,7 +5097,7 @@ export declare const satisfiesErrorType: <T>() => <Error extends T, Output = nev
5128
5097
  * }
5129
5098
  *
5130
5099
  * interface Database {
5131
- * readonly query: (sql: string) => Promise<unknown>
5100
+ * readonly query: (sql: string) => Effect.Effect<ReadonlyArray<unknown>>
5132
5101
  * }
5133
5102
  *
5134
5103
  * // Ensure schedule requires Logger service
@@ -5142,8 +5111,8 @@ export declare const satisfiesErrorType: <T>() => <Error extends T, Output = nev
5142
5111
  * )
5143
5112
  * ```
5144
5113
  *
5145
- * @since 2.0.0
5146
5114
  * @category ensuring types
5115
+ * @since 2.0.0
5147
5116
  */
5148
5117
  export declare const satisfiesServicesType: <T>() => <Env extends T, Output = never, Input = unknown, Error = never>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
5149
5118
  //# sourceMappingURL=Schedule.d.ts.map