effect 4.0.0-beta.65 → 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 (1657) 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 +77 -65
  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 +5 -4
  50. package/dist/Config.d.ts.map +1 -1
  51. package/dist/Config.js +9 -8
  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 +386 -138
  60. package/dist/Context.d.ts.map +1 -1
  61. package/dist/Context.js +144 -62
  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 +875 -444
  71. package/dist/DateTime.d.ts.map +1 -1
  72. package/dist/DateTime.js +376 -217
  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 +2445 -2356
  86. package/dist/Effect.d.ts.map +1 -1
  87. package/dist/Effect.js +906 -758
  88. package/dist/Effect.js.map +1 -1
  89. package/dist/Effectable.d.ts +38 -3
  90. package/dist/Effectable.d.ts.map +1 -1
  91. package/dist/Effectable.js +3 -3
  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 +96 -12
  106. package/dist/ExecutionPlan.d.ts.map +1 -1
  107. package/dist/ExecutionPlan.js +21 -6
  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 +119 -58
  117. package/dist/FiberHandle.d.ts.map +1 -1
  118. package/dist/FiberHandle.js +122 -40
  119. package/dist/FiberHandle.js.map +1 -1
  120. package/dist/FiberMap.d.ts +288 -160
  121. package/dist/FiberMap.d.ts.map +1 -1
  122. package/dist/FiberMap.js +176 -74
  123. package/dist/FiberMap.js.map +1 -1
  124. package/dist/FiberSet.d.ts +93 -52
  125. package/dist/FiberSet.d.ts.map +1 -1
  126. package/dist/FiberSet.js +97 -34
  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 +262 -181
  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 +58 -14
  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 +38 -53
  238. package/dist/Option.d.ts.map +1 -1
  239. package/dist/Option.js +87 -11
  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 +26 -16
  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 +261 -247
  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 +815 -294
  348. package/dist/Schema.d.ts.map +1 -1
  349. package/dist/Schema.js +287 -193
  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 +24 -11
  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/SchemaRepresentation.d.ts +2 -2
  367. package/dist/SchemaTransformation.d.ts +61 -41
  368. package/dist/SchemaTransformation.d.ts.map +1 -1
  369. package/dist/SchemaTransformation.js +56 -33
  370. package/dist/SchemaTransformation.js.map +1 -1
  371. package/dist/SchemaUtils.d.ts +7 -0
  372. package/dist/SchemaUtils.d.ts.map +1 -1
  373. package/dist/SchemaUtils.js +23 -0
  374. package/dist/SchemaUtils.js.map +1 -1
  375. package/dist/Scope.d.ts +102 -43
  376. package/dist/Scope.d.ts.map +1 -1
  377. package/dist/Scope.js +57 -23
  378. package/dist/Scope.js.map +1 -1
  379. package/dist/ScopedCache.d.ts +138 -46
  380. package/dist/ScopedCache.d.ts.map +1 -1
  381. package/dist/ScopedCache.js +80 -19
  382. package/dist/ScopedCache.js.map +1 -1
  383. package/dist/ScopedRef.d.ts +28 -8
  384. package/dist/ScopedRef.d.ts.map +1 -1
  385. package/dist/ScopedRef.js +25 -5
  386. package/dist/ScopedRef.js.map +1 -1
  387. package/dist/Semaphore.d.ts +64 -28
  388. package/dist/Semaphore.d.ts.map +1 -1
  389. package/dist/Semaphore.js +22 -13
  390. package/dist/Semaphore.js.map +1 -1
  391. package/dist/Sink.d.ts +458 -200
  392. package/dist/Sink.d.ts.map +1 -1
  393. package/dist/Sink.js +240 -89
  394. package/dist/Sink.js.map +1 -1
  395. package/dist/Stdio.d.ts +43 -6
  396. package/dist/Stdio.d.ts.map +1 -1
  397. package/dist/Stdio.js +33 -4
  398. package/dist/Stdio.js.map +1 -1
  399. package/dist/Stream.d.ts +1899 -1186
  400. package/dist/Stream.d.ts.map +1 -1
  401. package/dist/Stream.js +868 -525
  402. package/dist/Stream.js.map +1 -1
  403. package/dist/String.d.ts +171 -95
  404. package/dist/String.d.ts.map +1 -1
  405. package/dist/String.js +125 -67
  406. package/dist/String.js.map +1 -1
  407. package/dist/SubscriptionRef.d.ts +308 -203
  408. package/dist/SubscriptionRef.d.ts.map +1 -1
  409. package/dist/SubscriptionRef.js +125 -76
  410. package/dist/SubscriptionRef.js.map +1 -1
  411. package/dist/Symbol.d.ts +13 -5
  412. package/dist/Symbol.d.ts.map +1 -1
  413. package/dist/Symbol.js +13 -5
  414. package/dist/Symbol.js.map +1 -1
  415. package/dist/SynchronizedRef.d.ts +278 -62
  416. package/dist/SynchronizedRef.d.ts.map +1 -1
  417. package/dist/SynchronizedRef.js +116 -23
  418. package/dist/SynchronizedRef.js.map +1 -1
  419. package/dist/Take.d.ts +26 -2
  420. package/dist/Take.d.ts.map +1 -1
  421. package/dist/Take.js +4 -1
  422. package/dist/Take.js.map +1 -1
  423. package/dist/Terminal.d.ts +39 -7
  424. package/dist/Terminal.d.ts.map +1 -1
  425. package/dist/Terminal.js +10 -4
  426. package/dist/Terminal.js.map +1 -1
  427. package/dist/Tracer.d.ts +229 -55
  428. package/dist/Tracer.d.ts.map +1 -1
  429. package/dist/Tracer.js +94 -18
  430. package/dist/Tracer.js.map +1 -1
  431. package/dist/Trie.d.ts +213 -142
  432. package/dist/Trie.d.ts.map +1 -1
  433. package/dist/Trie.js +88 -60
  434. package/dist/Trie.js.map +1 -1
  435. package/dist/TxChunk.d.ts +182 -146
  436. package/dist/TxChunk.d.ts.map +1 -1
  437. package/dist/TxChunk.js +73 -56
  438. package/dist/TxChunk.js.map +1 -1
  439. package/dist/TxDeferred.d.ts +43 -29
  440. package/dist/TxDeferred.d.ts.map +1 -1
  441. package/dist/TxDeferred.js +22 -15
  442. package/dist/TxDeferred.js.map +1 -1
  443. package/dist/TxHashMap.d.ts +362 -222
  444. package/dist/TxHashMap.d.ts.map +1 -1
  445. package/dist/TxHashMap.js +171 -98
  446. package/dist/TxHashMap.js.map +1 -1
  447. package/dist/TxHashSet.d.ts +178 -104
  448. package/dist/TxHashSet.d.ts.map +1 -1
  449. package/dist/TxHashSet.js +84 -43
  450. package/dist/TxHashSet.js.map +1 -1
  451. package/dist/TxPriorityQueue.d.ts +93 -62
  452. package/dist/TxPriorityQueue.d.ts.map +1 -1
  453. package/dist/TxPriorityQueue.js +54 -36
  454. package/dist/TxPriorityQueue.js.map +1 -1
  455. package/dist/TxPubSub.d.ts +77 -49
  456. package/dist/TxPubSub.d.ts.map +1 -1
  457. package/dist/TxPubSub.js +60 -37
  458. package/dist/TxPubSub.js.map +1 -1
  459. package/dist/TxQueue.d.ts +279 -241
  460. package/dist/TxQueue.d.ts.map +1 -1
  461. package/dist/TxQueue.js +147 -101
  462. package/dist/TxQueue.js.map +1 -1
  463. package/dist/TxReentrantLock.d.ts +69 -46
  464. package/dist/TxReentrantLock.d.ts.map +1 -1
  465. package/dist/TxReentrantLock.js +48 -32
  466. package/dist/TxReentrantLock.js.map +1 -1
  467. package/dist/TxRef.d.ts +69 -40
  468. package/dist/TxRef.d.ts.map +1 -1
  469. package/dist/TxRef.js +35 -20
  470. package/dist/TxRef.js.map +1 -1
  471. package/dist/TxSemaphore.d.ts +101 -54
  472. package/dist/TxSemaphore.d.ts.map +1 -1
  473. package/dist/TxSemaphore.js +76 -34
  474. package/dist/TxSemaphore.js.map +1 -1
  475. package/dist/TxSubscriptionRef.d.ts +72 -48
  476. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  477. package/dist/TxSubscriptionRef.js +33 -22
  478. package/dist/TxSubscriptionRef.js.map +1 -1
  479. package/dist/Types.d.ts +34 -34
  480. package/dist/UndefinedOr.d.ts +48 -25
  481. package/dist/UndefinedOr.d.ts.map +1 -1
  482. package/dist/UndefinedOr.js +28 -25
  483. package/dist/UndefinedOr.js.map +1 -1
  484. package/dist/Unify.d.ts +71 -116
  485. package/dist/Unify.d.ts.map +1 -1
  486. package/dist/Unify.js +20 -6
  487. package/dist/Unify.js.map +1 -1
  488. package/dist/Utils.d.ts +4 -0
  489. package/dist/Utils.d.ts.map +1 -1
  490. package/dist/Utils.js +4 -0
  491. package/dist/Utils.js.map +1 -1
  492. package/dist/index.d.ts +81 -32
  493. package/dist/index.d.ts.map +1 -1
  494. package/dist/index.js +81 -32
  495. package/dist/index.js.map +1 -1
  496. package/dist/internal/concurrency.js +2 -2
  497. package/dist/internal/concurrency.js.map +1 -1
  498. package/dist/internal/core.js +8 -20
  499. package/dist/internal/core.js.map +1 -1
  500. package/dist/internal/effect.js +20 -19
  501. package/dist/internal/effect.js.map +1 -1
  502. package/dist/internal/executionPlan.js +2 -2
  503. package/dist/internal/executionPlan.js.map +1 -1
  504. package/dist/internal/option.js +5 -8
  505. package/dist/internal/option.js.map +1 -1
  506. package/dist/internal/result.js +5 -8
  507. package/dist/internal/result.js.map +1 -1
  508. package/dist/internal/schema/schema.js +1 -1
  509. package/dist/internal/schema/schema.js.map +1 -1
  510. package/dist/testing/FastCheck.d.ts +6 -3
  511. package/dist/testing/FastCheck.d.ts.map +1 -1
  512. package/dist/testing/FastCheck.js +6 -3
  513. package/dist/testing/FastCheck.js.map +1 -1
  514. package/dist/testing/TestClock.d.ts +39 -34
  515. package/dist/testing/TestClock.d.ts.map +1 -1
  516. package/dist/testing/TestClock.js +42 -12
  517. package/dist/testing/TestClock.js.map +1 -1
  518. package/dist/testing/TestConsole.d.ts +39 -30
  519. package/dist/testing/TestConsole.d.ts.map +1 -1
  520. package/dist/testing/TestConsole.js +25 -10
  521. package/dist/testing/TestConsole.js.map +1 -1
  522. package/dist/testing/TestSchema.js +7 -7
  523. package/dist/testing/TestSchema.js.map +1 -1
  524. package/dist/unstable/ai/AiError.d.ts +197 -130
  525. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  526. package/dist/unstable/ai/AiError.js +166 -102
  527. package/dist/unstable/ai/AiError.js.map +1 -1
  528. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  529. package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
  530. package/dist/unstable/ai/Chat.d.ts +65 -41
  531. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  532. package/dist/unstable/ai/Chat.js +51 -33
  533. package/dist/unstable/ai/Chat.js.map +1 -1
  534. package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
  535. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  536. package/dist/unstable/ai/EmbeddingModel.js +9 -8
  537. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  538. package/dist/unstable/ai/IdGenerator.d.ts +28 -18
  539. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  540. package/dist/unstable/ai/IdGenerator.js +18 -11
  541. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  542. package/dist/unstable/ai/LanguageModel.d.ts +36 -30
  543. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  544. package/dist/unstable/ai/LanguageModel.js +21 -15
  545. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  546. package/dist/unstable/ai/McpSchema.d.ts +339 -119
  547. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  548. package/dist/unstable/ai/McpSchema.js +264 -98
  549. package/dist/unstable/ai/McpSchema.js.map +1 -1
  550. package/dist/unstable/ai/McpServer.d.ts +53 -19
  551. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  552. package/dist/unstable/ai/McpServer.js +65 -17
  553. package/dist/unstable/ai/McpServer.js.map +1 -1
  554. package/dist/unstable/ai/Model.d.ts +13 -7
  555. package/dist/unstable/ai/Model.d.ts.map +1 -1
  556. package/dist/unstable/ai/Model.js +11 -9
  557. package/dist/unstable/ai/Model.js.map +1 -1
  558. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  559. package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
  560. package/dist/unstable/ai/Prompt.d.ts +194 -168
  561. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  562. package/dist/unstable/ai/Prompt.js +75 -66
  563. package/dist/unstable/ai/Prompt.js.map +1 -1
  564. package/dist/unstable/ai/Response.d.ts +153 -140
  565. package/dist/unstable/ai/Response.d.ts.map +1 -1
  566. package/dist/unstable/ai/Response.js +43 -48
  567. package/dist/unstable/ai/Response.js.map +1 -1
  568. package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
  569. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  570. package/dist/unstable/ai/ResponseIdTracker.js +27 -2
  571. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  572. package/dist/unstable/ai/Telemetry.d.ts +42 -32
  573. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  574. package/dist/unstable/ai/Telemetry.js +14 -10
  575. package/dist/unstable/ai/Telemetry.js.map +1 -1
  576. package/dist/unstable/ai/Tokenizer.d.ts +13 -8
  577. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  578. package/dist/unstable/ai/Tokenizer.js +10 -6
  579. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  580. package/dist/unstable/ai/Tool.d.ts +153 -84
  581. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  582. package/dist/unstable/ai/Tool.js +97 -44
  583. package/dist/unstable/ai/Tool.js.map +1 -1
  584. package/dist/unstable/ai/Toolkit.d.ts +33 -42
  585. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  586. package/dist/unstable/ai/Toolkit.js +35 -36
  587. package/dist/unstable/ai/Toolkit.js.map +1 -1
  588. package/dist/unstable/ai/index.d.ts +42 -24
  589. package/dist/unstable/ai/index.d.ts.map +1 -1
  590. package/dist/unstable/ai/index.js +42 -24
  591. package/dist/unstable/ai/index.js.map +1 -1
  592. package/dist/unstable/cli/Argument.d.ts +226 -134
  593. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  594. package/dist/unstable/cli/Argument.js +101 -65
  595. package/dist/unstable/cli/Argument.js.map +1 -1
  596. package/dist/unstable/cli/CliError.d.ts +72 -26
  597. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  598. package/dist/unstable/cli/CliError.js +86 -23
  599. package/dist/unstable/cli/CliError.js.map +1 -1
  600. package/dist/unstable/cli/CliOutput.d.ts +43 -13
  601. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  602. package/dist/unstable/cli/CliOutput.js +30 -6
  603. package/dist/unstable/cli/CliOutput.js.map +1 -1
  604. package/dist/unstable/cli/Command.d.ts +218 -117
  605. package/dist/unstable/cli/Command.d.ts.map +1 -1
  606. package/dist/unstable/cli/Command.js +45 -31
  607. package/dist/unstable/cli/Command.js.map +1 -1
  608. package/dist/unstable/cli/Completions.d.ts +7 -7
  609. package/dist/unstable/cli/Completions.js +1 -1
  610. package/dist/unstable/cli/Flag.d.ts +235 -142
  611. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  612. package/dist/unstable/cli/Flag.js +111 -71
  613. package/dist/unstable/cli/Flag.js.map +1 -1
  614. package/dist/unstable/cli/GlobalFlag.d.ts +42 -14
  615. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  616. package/dist/unstable/cli/GlobalFlag.js +30 -7
  617. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  618. package/dist/unstable/cli/HelpDoc.d.ts +35 -10
  619. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  620. package/dist/unstable/cli/HelpDoc.js +21 -0
  621. package/dist/unstable/cli/Param.d.ts +79 -31
  622. package/dist/unstable/cli/Param.d.ts.map +1 -1
  623. package/dist/unstable/cli/Param.js +161 -99
  624. package/dist/unstable/cli/Param.js.map +1 -1
  625. package/dist/unstable/cli/Primitive.d.ts +79 -42
  626. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  627. package/dist/unstable/cli/Primitive.js +66 -35
  628. package/dist/unstable/cli/Primitive.js.map +1 -1
  629. package/dist/unstable/cli/Prompt.d.ts +178 -47
  630. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  631. package/dist/unstable/cli/Prompt.js +111 -31
  632. package/dist/unstable/cli/Prompt.js.map +1 -1
  633. package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
  634. package/dist/unstable/cli/internal/ansi.js +13 -0
  635. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  636. package/dist/unstable/cli/internal/command.d.ts +7 -7
  637. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  638. package/dist/unstable/cli/internal/command.js +12 -10
  639. package/dist/unstable/cli/internal/command.js.map +1 -1
  640. package/dist/unstable/cli/internal/config.d.ts +3 -0
  641. package/dist/unstable/cli/internal/config.d.ts.map +1 -1
  642. package/dist/unstable/cli/internal/config.js.map +1 -1
  643. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  644. package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
  645. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  646. package/dist/unstable/cluster/ClusterCron.js +35 -1
  647. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  648. package/dist/unstable/cluster/ClusterError.d.ts +56 -7
  649. package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
  650. package/dist/unstable/cluster/ClusterError.js +56 -7
  651. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  652. package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
  653. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  654. package/dist/unstable/cluster/ClusterMetrics.js +39 -5
  655. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  656. package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
  657. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  658. package/dist/unstable/cluster/ClusterSchema.js +61 -8
  659. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  660. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
  661. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  662. package/dist/unstable/cluster/ClusterWorkflowEngine.js +36 -3
  663. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  664. package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
  665. package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
  666. package/dist/unstable/cluster/DeliverAt.js +11 -3
  667. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  668. package/dist/unstable/cluster/Entity.d.ts +75 -16
  669. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  670. package/dist/unstable/cluster/Entity.js +78 -13
  671. package/dist/unstable/cluster/Entity.js.map +1 -1
  672. package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
  673. package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
  674. package/dist/unstable/cluster/EntityAddress.js +30 -2
  675. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  676. package/dist/unstable/cluster/EntityId.d.ts +18 -3
  677. package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
  678. package/dist/unstable/cluster/EntityId.js +15 -2
  679. package/dist/unstable/cluster/EntityId.js.map +1 -1
  680. package/dist/unstable/cluster/EntityProxy.d.ts +34 -2
  681. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  682. package/dist/unstable/cluster/EntityProxy.js +24 -2
  683. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  684. package/dist/unstable/cluster/EntityProxyServer.d.ts +17 -2
  685. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  686. package/dist/unstable/cluster/EntityProxyServer.js +40 -8
  687. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  688. package/dist/unstable/cluster/EntityResource.d.ts +43 -6
  689. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  690. package/dist/unstable/cluster/EntityResource.js +11 -4
  691. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  692. package/dist/unstable/cluster/EntityType.d.ts +27 -3
  693. package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
  694. package/dist/unstable/cluster/EntityType.js +24 -2
  695. package/dist/unstable/cluster/EntityType.js.map +1 -1
  696. package/dist/unstable/cluster/Envelope.d.ts +105 -23
  697. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  698. package/dist/unstable/cluster/Envelope.js +88 -14
  699. package/dist/unstable/cluster/Envelope.js.map +1 -1
  700. package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
  701. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  702. package/dist/unstable/cluster/HttpRunner.js +88 -13
  703. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  704. package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
  705. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  706. package/dist/unstable/cluster/K8sHttpClient.js +31 -6
  707. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  708. package/dist/unstable/cluster/MachineId.d.ts +24 -3
  709. package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
  710. package/dist/unstable/cluster/MachineId.js +21 -2
  711. package/dist/unstable/cluster/MachineId.js.map +1 -1
  712. package/dist/unstable/cluster/Message.d.ts +102 -13
  713. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  714. package/dist/unstable/cluster/Message.js +86 -10
  715. package/dist/unstable/cluster/Message.js.map +1 -1
  716. package/dist/unstable/cluster/MessageStorage.d.ts +127 -21
  717. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  718. package/dist/unstable/cluster/MessageStorage.js +71 -11
  719. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  720. package/dist/unstable/cluster/Reply.d.ts +101 -12
  721. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  722. package/dist/unstable/cluster/Reply.js +64 -8
  723. package/dist/unstable/cluster/Reply.js.map +1 -1
  724. package/dist/unstable/cluster/Runner.d.ts +47 -17
  725. package/dist/unstable/cluster/Runner.d.ts.map +1 -1
  726. package/dist/unstable/cluster/Runner.js +47 -17
  727. package/dist/unstable/cluster/Runner.js.map +1 -1
  728. package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
  729. package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
  730. package/dist/unstable/cluster/RunnerAddress.js +34 -2
  731. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  732. package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
  733. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  734. package/dist/unstable/cluster/RunnerHealth.js +40 -12
  735. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  736. package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
  737. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  738. package/dist/unstable/cluster/RunnerServer.js +31 -4
  739. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  740. package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
  741. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  742. package/dist/unstable/cluster/RunnerStorage.js +38 -4
  743. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  744. package/dist/unstable/cluster/Runners.d.ts +73 -10
  745. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  746. package/dist/unstable/cluster/Runners.js +70 -9
  747. package/dist/unstable/cluster/Runners.js.map +1 -1
  748. package/dist/unstable/cluster/ShardId.d.ts +51 -5
  749. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  750. package/dist/unstable/cluster/ShardId.js +47 -4
  751. package/dist/unstable/cluster/ShardId.js.map +1 -1
  752. package/dist/unstable/cluster/Sharding.d.ts +10 -2
  753. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  754. package/dist/unstable/cluster/Sharding.js +35 -4
  755. package/dist/unstable/cluster/Sharding.js.map +1 -1
  756. package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
  757. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  758. package/dist/unstable/cluster/ShardingConfig.js +67 -10
  759. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  760. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
  761. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
  762. package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
  763. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  764. package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
  765. package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
  766. package/dist/unstable/cluster/SingleRunner.js +23 -1
  767. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  768. package/dist/unstable/cluster/Singleton.d.ts +15 -1
  769. package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
  770. package/dist/unstable/cluster/Singleton.js +15 -1
  771. package/dist/unstable/cluster/Singleton.js.map +1 -1
  772. package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
  773. package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
  774. package/dist/unstable/cluster/SingletonAddress.js +21 -1
  775. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  776. package/dist/unstable/cluster/Snowflake.d.ts +89 -19
  777. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  778. package/dist/unstable/cluster/Snowflake.js +48 -13
  779. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  780. package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
  781. package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
  782. package/dist/unstable/cluster/SocketRunner.js +29 -2
  783. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  784. package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
  785. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  786. package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
  787. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  788. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
  789. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  790. package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
  791. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  792. package/dist/unstable/cluster/TestRunner.d.ts +18 -1
  793. package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
  794. package/dist/unstable/cluster/TestRunner.js +18 -1
  795. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  796. package/dist/unstable/cluster/internal/hash.js +12 -0
  797. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  798. package/dist/unstable/devtools/DevTools.d.ts +26 -3
  799. package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
  800. package/dist/unstable/devtools/DevTools.js +26 -3
  801. package/dist/unstable/devtools/DevTools.js.map +1 -1
  802. package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
  803. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  804. package/dist/unstable/devtools/DevToolsClient.js +32 -5
  805. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  806. package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
  807. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  808. package/dist/unstable/devtools/DevToolsSchema.js +102 -20
  809. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  810. package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
  811. package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
  812. package/dist/unstable/devtools/DevToolsServer.js +21 -1
  813. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  814. package/dist/unstable/encoding/Msgpack.d.ts +81 -12
  815. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  816. package/dist/unstable/encoding/Msgpack.js +75 -9
  817. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  818. package/dist/unstable/encoding/Ndjson.d.ts +149 -21
  819. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  820. package/dist/unstable/encoding/Ndjson.js +97 -13
  821. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  822. package/dist/unstable/encoding/Sse.d.ts +109 -18
  823. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  824. package/dist/unstable/encoding/Sse.js +69 -13
  825. package/dist/unstable/encoding/Sse.js.map +1 -1
  826. package/dist/unstable/eventlog/Event.d.ts +115 -30
  827. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  828. package/dist/unstable/eventlog/Event.js +22 -2
  829. package/dist/unstable/eventlog/Event.js.map +1 -1
  830. package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
  831. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  832. package/dist/unstable/eventlog/EventGroup.js +24 -6
  833. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  834. package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
  835. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  836. package/dist/unstable/eventlog/EventJournal.js +108 -16
  837. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  838. package/dist/unstable/eventlog/EventLog.d.ts +151 -31
  839. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  840. package/dist/unstable/eventlog/EventLog.js +111 -20
  841. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  842. package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
  843. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  844. package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
  845. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  846. package/dist/unstable/eventlog/EventLogMessage.d.ts +96 -22
  847. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
  848. package/dist/unstable/eventlog/EventLogMessage.js +72 -16
  849. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  850. package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
  851. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  852. package/dist/unstable/eventlog/EventLogRemote.js +54 -8
  853. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  854. package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
  855. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  856. package/dist/unstable/eventlog/EventLogServer.js +17 -3
  857. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  858. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
  859. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  860. package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
  861. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  862. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
  863. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  864. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
  865. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  866. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
  867. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
  868. package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
  869. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  870. package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
  871. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  872. package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
  873. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  874. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
  875. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
  876. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
  877. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  878. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
  879. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
  880. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
  881. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  882. package/dist/unstable/http/Cookies.d.ts +156 -77
  883. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  884. package/dist/unstable/http/Cookies.js +93 -39
  885. package/dist/unstable/http/Cookies.js.map +1 -1
  886. package/dist/unstable/http/Etag.d.ts +40 -7
  887. package/dist/unstable/http/Etag.d.ts.map +1 -1
  888. package/dist/unstable/http/Etag.js +27 -4
  889. package/dist/unstable/http/Etag.js.map +1 -1
  890. package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
  891. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  892. package/dist/unstable/http/FetchHttpClient.js +33 -4
  893. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  894. package/dist/unstable/http/FindMyWay.d.ts +1 -1
  895. package/dist/unstable/http/FindMyWay.js +1 -1
  896. package/dist/unstable/http/Headers.d.ts +182 -36
  897. package/dist/unstable/http/Headers.d.ts.map +1 -1
  898. package/dist/unstable/http/Headers.js +86 -16
  899. package/dist/unstable/http/Headers.js.map +1 -1
  900. package/dist/unstable/http/HttpBody.d.ts +114 -26
  901. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  902. package/dist/unstable/http/HttpBody.js +100 -22
  903. package/dist/unstable/http/HttpBody.js.map +1 -1
  904. package/dist/unstable/http/HttpClient.d.ts +205 -96
  905. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  906. package/dist/unstable/http/HttpClient.js +85 -39
  907. package/dist/unstable/http/HttpClient.js.map +1 -1
  908. package/dist/unstable/http/HttpClientError.d.ts +68 -12
  909. package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
  910. package/dist/unstable/http/HttpClientError.js +71 -9
  911. package/dist/unstable/http/HttpClientError.js.map +1 -1
  912. package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
  913. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  914. package/dist/unstable/http/HttpClientRequest.js +153 -47
  915. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  916. package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
  917. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  918. package/dist/unstable/http/HttpClientResponse.js +44 -11
  919. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  920. package/dist/unstable/http/HttpEffect.d.ts +42 -16
  921. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  922. package/dist/unstable/http/HttpEffect.js +33 -13
  923. package/dist/unstable/http/HttpEffect.js.map +1 -1
  924. package/dist/unstable/http/HttpIncomingMessage.d.ts +47 -7
  925. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  926. package/dist/unstable/http/HttpIncomingMessage.js +44 -6
  927. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  928. package/dist/unstable/http/HttpMethod.d.ts +35 -5
  929. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  930. package/dist/unstable/http/HttpMethod.js +23 -1
  931. package/dist/unstable/http/HttpMethod.js.map +1 -1
  932. package/dist/unstable/http/HttpMiddleware.d.ts +37 -11
  933. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  934. package/dist/unstable/http/HttpMiddleware.js +70 -31
  935. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  936. package/dist/unstable/http/HttpPlatform.d.ts +34 -3
  937. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  938. package/dist/unstable/http/HttpPlatform.js +35 -4
  939. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  940. package/dist/unstable/http/HttpRouter.d.ts +194 -45
  941. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  942. package/dist/unstable/http/HttpRouter.js +122 -28
  943. package/dist/unstable/http/HttpRouter.js.map +1 -1
  944. package/dist/unstable/http/HttpServer.d.ts +151 -22
  945. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  946. package/dist/unstable/http/HttpServer.js +77 -12
  947. package/dist/unstable/http/HttpServer.js.map +1 -1
  948. package/dist/unstable/http/HttpServerError.d.ts +90 -10
  949. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  950. package/dist/unstable/http/HttpServerError.js +82 -8
  951. package/dist/unstable/http/HttpServerError.js.map +1 -1
  952. package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
  953. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  954. package/dist/unstable/http/HttpServerRequest.js +112 -31
  955. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  956. package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
  957. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  958. package/dist/unstable/http/HttpServerRespondable.js +43 -5
  959. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  960. package/dist/unstable/http/HttpServerResponse.d.ts +390 -67
  961. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  962. package/dist/unstable/http/HttpServerResponse.js +209 -38
  963. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  964. package/dist/unstable/http/HttpStaticServer.d.ts +22 -4
  965. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  966. package/dist/unstable/http/HttpStaticServer.js +22 -4
  967. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  968. package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
  969. package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
  970. package/dist/unstable/http/HttpTraceContext.js +47 -5
  971. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  972. package/dist/unstable/http/Multipart.d.ts +178 -28
  973. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  974. package/dist/unstable/http/Multipart.js +130 -20
  975. package/dist/unstable/http/Multipart.js.map +1 -1
  976. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
  977. package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
  978. package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
  979. package/dist/unstable/http/Multipasta/Node.js +1 -1
  980. package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
  981. package/dist/unstable/http/Multipasta/Search.js +1 -1
  982. package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
  983. package/dist/unstable/http/Multipasta/Web.js +1 -1
  984. package/dist/unstable/http/Multipasta.d.ts +1 -1
  985. package/dist/unstable/http/Multipasta.js +1 -1
  986. package/dist/unstable/http/Template.d.ts +53 -0
  987. package/dist/unstable/http/Template.d.ts.map +1 -1
  988. package/dist/unstable/http/Template.js +26 -0
  989. package/dist/unstable/http/Template.js.map +1 -1
  990. package/dist/unstable/http/Url.d.ts +56 -42
  991. package/dist/unstable/http/Url.d.ts.map +1 -1
  992. package/dist/unstable/http/Url.js +29 -15
  993. package/dist/unstable/http/Url.js.map +1 -1
  994. package/dist/unstable/http/UrlParams.d.ts +233 -49
  995. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  996. package/dist/unstable/http/UrlParams.js +116 -23
  997. package/dist/unstable/http/UrlParams.js.map +1 -1
  998. package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
  999. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  1000. package/dist/unstable/httpapi/HttpApi.js +14 -8
  1001. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  1002. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +55 -16
  1003. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  1004. package/dist/unstable/httpapi/HttpApiBuilder.js +47 -9
  1005. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  1006. package/dist/unstable/httpapi/HttpApiClient.d.ts +58 -15
  1007. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  1008. package/dist/unstable/httpapi/HttpApiClient.js +43 -7
  1009. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  1010. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
  1011. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  1012. package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
  1013. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1014. package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
  1015. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  1016. package/dist/unstable/httpapi/HttpApiError.js +98 -1
  1017. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1018. package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
  1019. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  1020. package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
  1021. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1022. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
  1023. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1024. package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -6
  1025. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1026. package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
  1027. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1028. package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
  1029. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1030. package/dist/unstable/httpapi/HttpApiSchema.d.ts +67 -30
  1031. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  1032. package/dist/unstable/httpapi/HttpApiSchema.js +48 -27
  1033. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1034. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +74 -17
  1035. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  1036. package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
  1037. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1038. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +5 -2
  1039. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  1040. package/dist/unstable/httpapi/HttpApiSwagger.js +24 -2
  1041. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1042. package/dist/unstable/httpapi/HttpApiTest.d.ts +9 -2
  1043. package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
  1044. package/dist/unstable/httpapi/HttpApiTest.js +28 -3
  1045. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1046. package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
  1047. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1048. package/dist/unstable/httpapi/OpenApi.js +73 -15
  1049. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1050. package/dist/unstable/observability/Otlp.d.ts +33 -3
  1051. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  1052. package/dist/unstable/observability/Otlp.js +14 -3
  1053. package/dist/unstable/observability/Otlp.js.map +1 -1
  1054. package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
  1055. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1056. package/dist/unstable/observability/OtlpExporter.js +32 -1
  1057. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1058. package/dist/unstable/observability/OtlpLogger.d.ts +14 -2
  1059. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1060. package/dist/unstable/observability/OtlpLogger.js +29 -2
  1061. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1062. package/dist/unstable/observability/OtlpMetrics.d.ts +15 -4
  1063. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1064. package/dist/unstable/observability/OtlpMetrics.js +32 -2
  1065. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1066. package/dist/unstable/observability/OtlpResource.d.ts +49 -12
  1067. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1068. package/dist/unstable/observability/OtlpResource.js +47 -5
  1069. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1070. package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
  1071. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  1072. package/dist/unstable/observability/OtlpSerialization.js +28 -3
  1073. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1074. package/dist/unstable/observability/OtlpTracer.d.ts +16 -2
  1075. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  1076. package/dist/unstable/observability/OtlpTracer.js +32 -2
  1077. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1078. package/dist/unstable/observability/PrometheusMetrics.d.ts +32 -12
  1079. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1080. package/dist/unstable/observability/PrometheusMetrics.js +7 -5
  1081. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1082. package/dist/unstable/observability/index.d.ts +2 -1
  1083. package/dist/unstable/observability/index.d.ts.map +1 -1
  1084. package/dist/unstable/observability/index.js +2 -1
  1085. package/dist/unstable/observability/index.js.map +1 -1
  1086. package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
  1087. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1088. package/dist/unstable/persistence/KeyValueStore.js +81 -21
  1089. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1090. package/dist/unstable/persistence/Persistable.d.ts +76 -15
  1091. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  1092. package/dist/unstable/persistence/Persistable.js +22 -5
  1093. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1094. package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
  1095. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  1096. package/dist/unstable/persistence/PersistedCache.js +24 -1
  1097. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1098. package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
  1099. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  1100. package/dist/unstable/persistence/PersistedQueue.js +60 -13
  1101. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1102. package/dist/unstable/persistence/Persistence.d.ts +97 -16
  1103. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1104. package/dist/unstable/persistence/Persistence.js +90 -14
  1105. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1106. package/dist/unstable/persistence/RateLimiter.d.ts +97 -21
  1107. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1108. package/dist/unstable/persistence/RateLimiter.js +82 -17
  1109. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1110. package/dist/unstable/persistence/Redis.d.ts +26 -5
  1111. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  1112. package/dist/unstable/persistence/Redis.js +36 -4
  1113. package/dist/unstable/persistence/Redis.js.map +1 -1
  1114. package/dist/unstable/process/ChildProcess.d.ts +89 -109
  1115. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1116. package/dist/unstable/process/ChildProcess.js +74 -23
  1117. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1118. package/dist/unstable/process/ChildProcessSpawner.d.ts +22 -11
  1119. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1120. package/dist/unstable/process/ChildProcessSpawner.js +11 -6
  1121. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1122. package/dist/unstable/process/index.d.ts +2 -1
  1123. package/dist/unstable/process/index.d.ts.map +1 -1
  1124. package/dist/unstable/process/index.js +2 -1
  1125. package/dist/unstable/process/index.js.map +1 -1
  1126. package/dist/unstable/reactivity/AsyncResult.d.ts +196 -59
  1127. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1128. package/dist/unstable/reactivity/AsyncResult.js +121 -36
  1129. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1130. package/dist/unstable/reactivity/Atom.d.ts +539 -130
  1131. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1132. package/dist/unstable/reactivity/Atom.js +256 -62
  1133. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1134. package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
  1135. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1136. package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
  1137. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1138. package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
  1139. package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
  1140. package/dist/unstable/reactivity/AtomRef.js +29 -3
  1141. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1142. package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
  1143. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  1144. package/dist/unstable/reactivity/AtomRegistry.js +69 -10
  1145. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1146. package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
  1147. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1148. package/dist/unstable/reactivity/AtomRpc.js +29 -1
  1149. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1150. package/dist/unstable/reactivity/Hydration.d.ts +28 -5
  1151. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
  1152. package/dist/unstable/reactivity/Hydration.js +35 -3
  1153. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1154. package/dist/unstable/reactivity/Reactivity.d.ts +95 -13
  1155. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  1156. package/dist/unstable/reactivity/Reactivity.js +61 -7
  1157. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1158. package/dist/unstable/rpc/Rpc.d.ts +255 -56
  1159. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1160. package/dist/unstable/rpc/Rpc.js +44 -11
  1161. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1162. package/dist/unstable/rpc/RpcClient.d.ts +81 -19
  1163. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1164. package/dist/unstable/rpc/RpcClient.js +53 -13
  1165. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1166. package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
  1167. package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
  1168. package/dist/unstable/rpc/RpcClientError.js +26 -2
  1169. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1170. package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
  1171. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  1172. package/dist/unstable/rpc/RpcGroup.js +3 -1
  1173. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1174. package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
  1175. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1176. package/dist/unstable/rpc/RpcMessage.js +23 -7
  1177. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1178. package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
  1179. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  1180. package/dist/unstable/rpc/RpcMiddleware.js +39 -3
  1181. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1182. package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
  1183. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  1184. package/dist/unstable/rpc/RpcSchema.js +34 -3
  1185. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1186. package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
  1187. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1188. package/dist/unstable/rpc/RpcSerialization.js +56 -12
  1189. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1190. package/dist/unstable/rpc/RpcServer.d.ts +73 -23
  1191. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  1192. package/dist/unstable/rpc/RpcServer.js +70 -23
  1193. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1194. package/dist/unstable/rpc/RpcTest.d.ts +20 -1
  1195. package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
  1196. package/dist/unstable/rpc/RpcTest.js +20 -1
  1197. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1198. package/dist/unstable/rpc/RpcWorker.d.ts +40 -6
  1199. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  1200. package/dist/unstable/rpc/RpcWorker.js +17 -5
  1201. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1202. package/dist/unstable/rpc/Utils.d.ts +8 -0
  1203. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  1204. package/dist/unstable/rpc/Utils.js +8 -0
  1205. package/dist/unstable/rpc/Utils.js.map +1 -1
  1206. package/dist/unstable/schema/Model.d.ts +130 -52
  1207. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1208. package/dist/unstable/schema/Model.js +79 -34
  1209. package/dist/unstable/schema/Model.js.map +1 -1
  1210. package/dist/unstable/schema/VariantSchema.d.ts +104 -24
  1211. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1212. package/dist/unstable/schema/VariantSchema.js +22 -6
  1213. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1214. package/dist/unstable/socket/Socket.d.ts +167 -34
  1215. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1216. package/dist/unstable/socket/Socket.js +124 -29
  1217. package/dist/unstable/socket/Socket.js.map +1 -1
  1218. package/dist/unstable/socket/SocketServer.d.ts +58 -10
  1219. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  1220. package/dist/unstable/socket/SocketServer.js +43 -5
  1221. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1222. package/dist/unstable/sql/Migrator.d.ts +35 -4
  1223. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  1224. package/dist/unstable/sql/Migrator.js +45 -5
  1225. package/dist/unstable/sql/Migrator.js.map +1 -1
  1226. package/dist/unstable/sql/SqlClient.d.ts +34 -2
  1227. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1228. package/dist/unstable/sql/SqlClient.js +38 -1
  1229. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1230. package/dist/unstable/sql/SqlConnection.d.ts +31 -0
  1231. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  1232. package/dist/unstable/sql/SqlConnection.js +22 -0
  1233. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1234. package/dist/unstable/sql/SqlError.d.ts +99 -0
  1235. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  1236. package/dist/unstable/sql/SqlError.js +114 -0
  1237. package/dist/unstable/sql/SqlError.js.map +1 -1
  1238. package/dist/unstable/sql/SqlModel.d.ts +26 -5
  1239. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  1240. package/dist/unstable/sql/SqlModel.js +8 -4
  1241. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1242. package/dist/unstable/sql/SqlResolver.d.ts +56 -13
  1243. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  1244. package/dist/unstable/sql/SqlResolver.js +44 -10
  1245. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1246. package/dist/unstable/sql/SqlSchema.d.ts +29 -8
  1247. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  1248. package/dist/unstable/sql/SqlSchema.js +29 -8
  1249. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1250. package/dist/unstable/sql/SqlStream.d.ts +3 -0
  1251. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  1252. package/dist/unstable/sql/SqlStream.js +23 -0
  1253. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1254. package/dist/unstable/sql/Statement.d.ts +124 -0
  1255. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1256. package/dist/unstable/sql/Statement.js +82 -0
  1257. package/dist/unstable/sql/Statement.js.map +1 -1
  1258. package/dist/unstable/sql/index.d.ts +1 -1
  1259. package/dist/unstable/sql/index.js +1 -1
  1260. package/dist/unstable/workers/Transferable.d.ts +65 -13
  1261. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  1262. package/dist/unstable/workers/Transferable.js +53 -10
  1263. package/dist/unstable/workers/Transferable.js.map +1 -1
  1264. package/dist/unstable/workers/Worker.d.ts +60 -8
  1265. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  1266. package/dist/unstable/workers/Worker.js +43 -4
  1267. package/dist/unstable/workers/Worker.js.map +1 -1
  1268. package/dist/unstable/workers/WorkerError.d.ts +31 -9
  1269. package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
  1270. package/dist/unstable/workers/WorkerError.js +44 -7
  1271. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1272. package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
  1273. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  1274. package/dist/unstable/workers/WorkerRunner.js +24 -1
  1275. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1276. package/dist/unstable/workers/index.d.ts +1 -1
  1277. package/dist/unstable/workers/index.js +1 -1
  1278. package/dist/unstable/workflow/Activity.d.ts +61 -10
  1279. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  1280. package/dist/unstable/workflow/Activity.js +21 -6
  1281. package/dist/unstable/workflow/Activity.js.map +1 -1
  1282. package/dist/unstable/workflow/DurableClock.d.ts +12 -3
  1283. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  1284. package/dist/unstable/workflow/DurableClock.js +22 -2
  1285. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1286. package/dist/unstable/workflow/DurableDeferred.d.ts +126 -31
  1287. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  1288. package/dist/unstable/workflow/DurableDeferred.js +76 -13
  1289. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1290. package/dist/unstable/workflow/DurableQueue.d.ts +145 -0
  1291. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -0
  1292. package/dist/unstable/workflow/DurableQueue.js +200 -0
  1293. package/dist/unstable/workflow/DurableQueue.js.map +1 -0
  1294. package/dist/unstable/workflow/Workflow.d.ts +100 -31
  1295. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1296. package/dist/unstable/workflow/Workflow.js +76 -20
  1297. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1298. package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
  1299. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  1300. package/dist/unstable/workflow/WorkflowEngine.js +16 -4
  1301. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1302. package/dist/unstable/workflow/WorkflowProxy.d.ts +32 -2
  1303. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1304. package/dist/unstable/workflow/WorkflowProxy.js +2 -2
  1305. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1306. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +36 -2
  1307. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  1308. package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
  1309. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1310. package/dist/unstable/workflow/index.d.ts +4 -0
  1311. package/dist/unstable/workflow/index.d.ts.map +1 -1
  1312. package/dist/unstable/workflow/index.js +4 -0
  1313. package/dist/unstable/workflow/index.js.map +1 -1
  1314. package/package.json +11 -11
  1315. package/src/Array.ts +113 -67
  1316. package/src/BigDecimal.ts +404 -337
  1317. package/src/BigInt.ts +167 -97
  1318. package/src/Boolean.ts +62 -31
  1319. package/src/Brand.ts +20 -1
  1320. package/src/Cache.ts +331 -164
  1321. package/src/Cause.ts +77 -65
  1322. package/src/Channel.ts +1585 -607
  1323. package/src/ChannelSchema.ts +137 -12
  1324. package/src/Chunk.ts +549 -380
  1325. package/src/Clock.ts +15 -8
  1326. package/src/Combiner.ts +2 -4
  1327. package/src/Config.ts +12 -10
  1328. package/src/ConfigProvider.ts +1 -1
  1329. package/src/Console.ts +88 -58
  1330. package/src/Context.ts +397 -149
  1331. package/src/Cron.ts +111 -48
  1332. package/src/Data.ts +3 -2
  1333. package/src/DateTime.ts +876 -445
  1334. package/src/Deferred.ts +367 -174
  1335. package/src/Differ.ts +42 -0
  1336. package/src/Duration.ts +329 -185
  1337. package/src/Effect.ts +2474 -2395
  1338. package/src/Effectable.ts +39 -4
  1339. package/src/Encoding.ts +78 -28
  1340. package/src/Equivalence.ts +14 -19
  1341. package/src/ErrorReporter.ts +66 -82
  1342. package/src/ExecutionPlan.ts +97 -13
  1343. package/src/Exit.ts +7 -5
  1344. package/src/Fiber.ts +72 -40
  1345. package/src/FiberHandle.ts +158 -58
  1346. package/src/FiberMap.ts +329 -164
  1347. package/src/FiberSet.ts +130 -52
  1348. package/src/FileSystem.ts +106 -74
  1349. package/src/Filter.ts +166 -88
  1350. package/src/Function.ts +154 -86
  1351. package/src/Graph.ts +682 -365
  1352. package/src/HKT.ts +29 -13
  1353. package/src/Hash.ts +31 -18
  1354. package/src/HashMap.ts +444 -256
  1355. package/src/HashRing.ts +94 -17
  1356. package/src/HashSet.ts +194 -104
  1357. package/src/Inspectable.ts +22 -10
  1358. package/src/Iterable.ts +309 -149
  1359. package/src/JsonPatch.ts +4 -3
  1360. package/src/Latch.ts +98 -15
  1361. package/src/Layer.ts +488 -345
  1362. package/src/LayerMap.ts +98 -25
  1363. package/src/LogLevel.ts +92 -131
  1364. package/src/Logger.ts +357 -288
  1365. package/src/ManagedRuntime.ts +75 -17
  1366. package/src/Match.ts +133 -157
  1367. package/src/Metric.ts +355 -304
  1368. package/src/MutableHashMap.ts +161 -84
  1369. package/src/MutableHashSet.ts +122 -52
  1370. package/src/MutableList.ts +141 -81
  1371. package/src/MutableRef.ts +130 -90
  1372. package/src/Newtype.ts +3 -0
  1373. package/src/NonEmptyIterable.ts +36 -39
  1374. package/src/Number.ts +116 -64
  1375. package/src/Optic.ts +1 -2
  1376. package/src/Option.ts +41 -53
  1377. package/src/Ordering.ts +43 -28
  1378. package/src/PartitionedSemaphore.ts +225 -40
  1379. package/src/Path.ts +77 -13
  1380. package/src/Pipeable.ts +76 -21
  1381. package/src/PlatformError.ts +74 -6
  1382. package/src/Pool.ts +94 -31
  1383. package/src/Predicate.ts +16 -21
  1384. package/src/PrimaryKey.ts +9 -2
  1385. package/src/PubSub.ts +364 -262
  1386. package/src/Pull.ts +94 -25
  1387. package/src/Queue.ts +284 -150
  1388. package/src/Random.ts +54 -35
  1389. package/src/RcMap.ts +151 -141
  1390. package/src/RcRef.ts +69 -32
  1391. package/src/Record.ts +273 -129
  1392. package/src/Redactable.ts +3 -3
  1393. package/src/Redacted.ts +63 -33
  1394. package/src/Ref.ts +161 -104
  1395. package/src/References.ts +73 -31
  1396. package/src/RegExp.ts +11 -5
  1397. package/src/Request.ts +158 -34
  1398. package/src/RequestResolver.ts +277 -119
  1399. package/src/Resource.ts +45 -7
  1400. package/src/Result.ts +31 -18
  1401. package/src/Runtime.ts +45 -19
  1402. package/src/Schedule.ts +575 -600
  1403. package/src/Scheduler.ts +43 -6
  1404. package/src/Schema.ts +845 -319
  1405. package/src/SchemaAST.ts +25 -16
  1406. package/src/SchemaGetter.ts +32 -17
  1407. package/src/SchemaIssue.ts +1 -8
  1408. package/src/SchemaParser.ts +262 -38
  1409. package/src/SchemaTransformation.ts +61 -41
  1410. package/src/SchemaUtils.ts +23 -0
  1411. package/src/Scope.ts +102 -43
  1412. package/src/ScopedCache.ts +192 -56
  1413. package/src/ScopedRef.ts +28 -8
  1414. package/src/Semaphore.ts +64 -28
  1415. package/src/Sink.ts +458 -200
  1416. package/src/Stdio.ts +43 -6
  1417. package/src/Stream.ts +2043 -1256
  1418. package/src/String.ts +171 -95
  1419. package/src/SubscriptionRef.ts +308 -203
  1420. package/src/Symbol.ts +13 -5
  1421. package/src/SynchronizedRef.ts +278 -62
  1422. package/src/Take.ts +26 -2
  1423. package/src/Terminal.ts +40 -7
  1424. package/src/Tracer.ts +229 -55
  1425. package/src/Trie.ts +213 -142
  1426. package/src/TxChunk.ts +182 -146
  1427. package/src/TxDeferred.ts +43 -29
  1428. package/src/TxHashMap.ts +370 -230
  1429. package/src/TxHashSet.ts +250 -152
  1430. package/src/TxPriorityQueue.ts +96 -64
  1431. package/src/TxPubSub.ts +77 -49
  1432. package/src/TxQueue.ts +279 -241
  1433. package/src/TxReentrantLock.ts +70 -47
  1434. package/src/TxRef.ts +70 -41
  1435. package/src/TxSemaphore.ts +101 -54
  1436. package/src/TxSubscriptionRef.ts +72 -48
  1437. package/src/Types.ts +34 -34
  1438. package/src/UndefinedOr.ts +48 -25
  1439. package/src/Unify.ts +71 -116
  1440. package/src/Utils.ts +4 -0
  1441. package/src/index.ts +81 -32
  1442. package/src/internal/concurrency.ts +2 -2
  1443. package/src/internal/core.ts +12 -23
  1444. package/src/internal/effect.ts +25 -29
  1445. package/src/internal/executionPlan.ts +2 -2
  1446. package/src/internal/option.ts +5 -8
  1447. package/src/internal/result.ts +5 -8
  1448. package/src/internal/schema/schema.ts +1 -1
  1449. package/src/testing/FastCheck.ts +6 -3
  1450. package/src/testing/TestClock.ts +63 -34
  1451. package/src/testing/TestConsole.ts +49 -30
  1452. package/src/testing/TestSchema.ts +8 -8
  1453. package/src/unstable/ai/AiError.ts +187 -120
  1454. package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
  1455. package/src/unstable/ai/Chat.ts +69 -43
  1456. package/src/unstable/ai/EmbeddingModel.ts +12 -11
  1457. package/src/unstable/ai/IdGenerator.ts +28 -18
  1458. package/src/unstable/ai/LanguageModel.ts +47 -46
  1459. package/src/unstable/ai/McpSchema.ts +339 -119
  1460. package/src/unstable/ai/McpServer.ts +78 -21
  1461. package/src/unstable/ai/Model.ts +23 -18
  1462. package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
  1463. package/src/unstable/ai/Prompt.ts +210 -184
  1464. package/src/unstable/ai/Response.ts +159 -147
  1465. package/src/unstable/ai/ResponseIdTracker.ts +43 -4
  1466. package/src/unstable/ai/Telemetry.ts +42 -32
  1467. package/src/unstable/ai/Tokenizer.ts +13 -8
  1468. package/src/unstable/ai/Tool.ts +154 -85
  1469. package/src/unstable/ai/Toolkit.ts +81 -84
  1470. package/src/unstable/ai/index.ts +42 -24
  1471. package/src/unstable/cli/Argument.ts +226 -134
  1472. package/src/unstable/cli/CliError.ts +96 -26
  1473. package/src/unstable/cli/CliOutput.ts +43 -13
  1474. package/src/unstable/cli/Command.ts +225 -125
  1475. package/src/unstable/cli/Completions.ts +7 -7
  1476. package/src/unstable/cli/Flag.ts +235 -142
  1477. package/src/unstable/cli/GlobalFlag.ts +42 -14
  1478. package/src/unstable/cli/HelpDoc.ts +35 -10
  1479. package/src/unstable/cli/Param.ts +328 -190
  1480. package/src/unstable/cli/Primitive.ts +79 -42
  1481. package/src/unstable/cli/Prompt.ts +210 -58
  1482. package/src/unstable/cli/internal/ansi.ts +13 -0
  1483. package/src/unstable/cli/internal/command.ts +17 -15
  1484. package/src/unstable/cli/internal/config.ts +3 -0
  1485. package/src/unstable/cli/internal/lexer.ts +11 -0
  1486. package/src/unstable/cluster/ClusterCron.ts +35 -1
  1487. package/src/unstable/cluster/ClusterError.ts +56 -7
  1488. package/src/unstable/cluster/ClusterMetrics.ts +39 -5
  1489. package/src/unstable/cluster/ClusterSchema.ts +61 -8
  1490. package/src/unstable/cluster/ClusterWorkflowEngine.ts +36 -3
  1491. package/src/unstable/cluster/DeliverAt.ts +39 -4
  1492. package/src/unstable/cluster/Entity.ts +110 -19
  1493. package/src/unstable/cluster/EntityAddress.ts +30 -2
  1494. package/src/unstable/cluster/EntityId.ts +18 -3
  1495. package/src/unstable/cluster/EntityProxy.ts +34 -2
  1496. package/src/unstable/cluster/EntityProxyServer.ts +44 -8
  1497. package/src/unstable/cluster/EntityResource.ts +43 -6
  1498. package/src/unstable/cluster/EntityType.ts +27 -3
  1499. package/src/unstable/cluster/Envelope.ts +128 -23
  1500. package/src/unstable/cluster/HttpRunner.ts +88 -13
  1501. package/src/unstable/cluster/K8sHttpClient.ts +49 -6
  1502. package/src/unstable/cluster/MachineId.ts +24 -3
  1503. package/src/unstable/cluster/Message.ts +102 -13
  1504. package/src/unstable/cluster/MessageStorage.ts +128 -22
  1505. package/src/unstable/cluster/Reply.ts +101 -12
  1506. package/src/unstable/cluster/Runner.ts +47 -17
  1507. package/src/unstable/cluster/RunnerAddress.ts +34 -2
  1508. package/src/unstable/cluster/RunnerHealth.ts +40 -12
  1509. package/src/unstable/cluster/RunnerServer.ts +31 -4
  1510. package/src/unstable/cluster/RunnerStorage.ts +42 -5
  1511. package/src/unstable/cluster/Runners.ts +73 -10
  1512. package/src/unstable/cluster/ShardId.ts +51 -5
  1513. package/src/unstable/cluster/Sharding.ts +35 -4
  1514. package/src/unstable/cluster/ShardingConfig.ts +76 -11
  1515. package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
  1516. package/src/unstable/cluster/SingleRunner.ts +23 -1
  1517. package/src/unstable/cluster/Singleton.ts +15 -1
  1518. package/src/unstable/cluster/SingletonAddress.ts +21 -1
  1519. package/src/unstable/cluster/Snowflake.ts +89 -19
  1520. package/src/unstable/cluster/SocketRunner.ts +29 -2
  1521. package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
  1522. package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
  1523. package/src/unstable/cluster/TestRunner.ts +18 -1
  1524. package/src/unstable/cluster/internal/hash.ts +12 -0
  1525. package/src/unstable/devtools/DevTools.ts +26 -3
  1526. package/src/unstable/devtools/DevToolsClient.ts +32 -5
  1527. package/src/unstable/devtools/DevToolsSchema.ts +201 -44
  1528. package/src/unstable/devtools/DevToolsServer.ts +27 -2
  1529. package/src/unstable/encoding/Msgpack.ts +97 -12
  1530. package/src/unstable/encoding/Ndjson.ts +149 -21
  1531. package/src/unstable/encoding/Sse.ts +109 -18
  1532. package/src/unstable/eventlog/Event.ts +131 -30
  1533. package/src/unstable/eventlog/EventGroup.ts +50 -17
  1534. package/src/unstable/eventlog/EventJournal.ts +120 -20
  1535. package/src/unstable/eventlog/EventLog.ts +151 -31
  1536. package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
  1537. package/src/unstable/eventlog/EventLogMessage.ts +92 -18
  1538. package/src/unstable/eventlog/EventLogRemote.ts +54 -8
  1539. package/src/unstable/eventlog/EventLogServer.ts +33 -3
  1540. package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
  1541. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
  1542. package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
  1543. package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
  1544. package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
  1545. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
  1546. package/src/unstable/http/Cookies.ts +156 -77
  1547. package/src/unstable/http/Etag.ts +40 -7
  1548. package/src/unstable/http/FetchHttpClient.ts +33 -4
  1549. package/src/unstable/http/FindMyWay.ts +1 -1
  1550. package/src/unstable/http/Headers.ts +252 -50
  1551. package/src/unstable/http/HttpBody.ts +130 -28
  1552. package/src/unstable/http/HttpClient.ts +206 -97
  1553. package/src/unstable/http/HttpClientError.ts +80 -12
  1554. package/src/unstable/http/HttpClientRequest.ts +320 -102
  1555. package/src/unstable/http/HttpClientResponse.ts +59 -16
  1556. package/src/unstable/http/HttpEffect.ts +66 -18
  1557. package/src/unstable/http/HttpIncomingMessage.ts +47 -7
  1558. package/src/unstable/http/HttpMethod.ts +35 -5
  1559. package/src/unstable/http/HttpMiddleware.ts +63 -16
  1560. package/src/unstable/http/HttpPlatform.ts +35 -4
  1561. package/src/unstable/http/HttpRouter.ts +221 -57
  1562. package/src/unstable/http/HttpServer.ts +152 -23
  1563. package/src/unstable/http/HttpServerError.ts +90 -10
  1564. package/src/unstable/http/HttpServerRequest.ts +136 -32
  1565. package/src/unstable/http/HttpServerRespondable.ts +49 -6
  1566. package/src/unstable/http/HttpServerResponse.ts +395 -72
  1567. package/src/unstable/http/HttpStaticServer.ts +22 -4
  1568. package/src/unstable/http/HttpTraceContext.ts +53 -6
  1569. package/src/unstable/http/Multipart.ts +179 -29
  1570. package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
  1571. package/src/unstable/http/Multipasta/Node.ts +1 -1
  1572. package/src/unstable/http/Multipasta/Search.ts +1 -1
  1573. package/src/unstable/http/Multipasta/Web.ts +1 -1
  1574. package/src/unstable/http/Multipasta.ts +1 -1
  1575. package/src/unstable/http/Template.ts +53 -0
  1576. package/src/unstable/http/Url.ts +56 -42
  1577. package/src/unstable/http/UrlParams.ts +233 -49
  1578. package/src/unstable/httpapi/HttpApi.ts +49 -14
  1579. package/src/unstable/httpapi/HttpApiBuilder.ts +86 -20
  1580. package/src/unstable/httpapi/HttpApiClient.ts +80 -16
  1581. package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
  1582. package/src/unstable/httpapi/HttpApiError.ts +100 -1
  1583. package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
  1584. package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -23
  1585. package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
  1586. package/src/unstable/httpapi/HttpApiSchema.ts +67 -30
  1587. package/src/unstable/httpapi/HttpApiSecurity.ts +74 -17
  1588. package/src/unstable/httpapi/HttpApiSwagger.ts +24 -2
  1589. package/src/unstable/httpapi/HttpApiTest.ts +31 -3
  1590. package/src/unstable/httpapi/OpenApi.ts +115 -15
  1591. package/src/unstable/observability/Otlp.ts +33 -3
  1592. package/src/unstable/observability/OtlpExporter.ts +32 -1
  1593. package/src/unstable/observability/OtlpLogger.ts +31 -2
  1594. package/src/unstable/observability/OtlpMetrics.ts +37 -4
  1595. package/src/unstable/observability/OtlpResource.ts +68 -12
  1596. package/src/unstable/observability/OtlpSerialization.ts +28 -3
  1597. package/src/unstable/observability/OtlpTracer.ts +38 -2
  1598. package/src/unstable/observability/PrometheusMetrics.ts +32 -12
  1599. package/src/unstable/observability/index.ts +2 -1
  1600. package/src/unstable/persistence/KeyValueStore.ts +108 -28
  1601. package/src/unstable/persistence/Persistable.ts +76 -15
  1602. package/src/unstable/persistence/PersistedCache.ts +27 -2
  1603. package/src/unstable/persistence/PersistedQueue.ts +98 -16
  1604. package/src/unstable/persistence/Persistence.ts +97 -16
  1605. package/src/unstable/persistence/RateLimiter.ts +98 -22
  1606. package/src/unstable/persistence/Redis.ts +42 -5
  1607. package/src/unstable/process/ChildProcess.ts +100 -79
  1608. package/src/unstable/process/ChildProcessSpawner.ts +22 -11
  1609. package/src/unstable/process/index.ts +2 -1
  1610. package/src/unstable/reactivity/AsyncResult.ts +202 -61
  1611. package/src/unstable/reactivity/Atom.ts +597 -143
  1612. package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
  1613. package/src/unstable/reactivity/AtomRef.ts +51 -7
  1614. package/src/unstable/reactivity/AtomRegistry.ts +141 -22
  1615. package/src/unstable/reactivity/AtomRpc.ts +36 -2
  1616. package/src/unstable/reactivity/Hydration.ts +45 -5
  1617. package/src/unstable/reactivity/Reactivity.ts +95 -13
  1618. package/src/unstable/rpc/Rpc.ts +255 -56
  1619. package/src/unstable/rpc/RpcClient.ts +108 -20
  1620. package/src/unstable/rpc/RpcClientError.ts +26 -2
  1621. package/src/unstable/rpc/RpcGroup.ts +51 -8
  1622. package/src/unstable/rpc/RpcMessage.ts +128 -32
  1623. package/src/unstable/rpc/RpcMiddleware.ts +100 -20
  1624. package/src/unstable/rpc/RpcSchema.ts +38 -4
  1625. package/src/unstable/rpc/RpcSerialization.ts +60 -13
  1626. package/src/unstable/rpc/RpcServer.ts +108 -25
  1627. package/src/unstable/rpc/RpcTest.ts +20 -1
  1628. package/src/unstable/rpc/RpcWorker.ts +42 -8
  1629. package/src/unstable/rpc/Utils.ts +31 -0
  1630. package/src/unstable/schema/Model.ts +148 -52
  1631. package/src/unstable/schema/VariantSchema.ts +104 -24
  1632. package/src/unstable/socket/Socket.ts +168 -35
  1633. package/src/unstable/socket/SocketServer.ts +58 -10
  1634. package/src/unstable/sql/Migrator.ts +57 -5
  1635. package/src/unstable/sql/SqlClient.ts +55 -2
  1636. package/src/unstable/sql/SqlConnection.ts +31 -0
  1637. package/src/unstable/sql/SqlError.ts +117 -0
  1638. package/src/unstable/sql/SqlModel.ts +26 -5
  1639. package/src/unstable/sql/SqlResolver.ts +56 -13
  1640. package/src/unstable/sql/SqlSchema.ts +29 -8
  1641. package/src/unstable/sql/SqlStream.ts +23 -0
  1642. package/src/unstable/sql/Statement.ts +141 -0
  1643. package/src/unstable/sql/index.ts +1 -1
  1644. package/src/unstable/workers/Transferable.ts +65 -13
  1645. package/src/unstable/workers/Worker.ts +60 -8
  1646. package/src/unstable/workers/WorkerError.ts +50 -9
  1647. package/src/unstable/workers/WorkerRunner.ts +32 -3
  1648. package/src/unstable/workers/index.ts +1 -1
  1649. package/src/unstable/workflow/Activity.ts +62 -11
  1650. package/src/unstable/workflow/DurableClock.ts +26 -3
  1651. package/src/unstable/workflow/DurableDeferred.ts +146 -31
  1652. package/src/unstable/workflow/DurableQueue.ts +366 -0
  1653. package/src/unstable/workflow/Workflow.ts +122 -32
  1654. package/src/unstable/workflow/WorkflowEngine.ts +40 -5
  1655. package/src/unstable/workflow/WorkflowProxy.ts +32 -2
  1656. package/src/unstable/workflow/WorkflowProxyServer.ts +40 -6
  1657. package/src/unstable/workflow/index.ts +5 -0
package/src/Metric.ts CHANGED
@@ -1,47 +1,54 @@
1
1
  /**
2
- * @since 2.0.0
3
- *
4
- * The `Metric` module provides a comprehensive system for collecting, aggregating, and observing
5
- * application metrics in Effect applications. It offers type-safe, concurrent metrics that can
6
- * be used to monitor performance, track business metrics, and gain insights into application behavior.
7
- *
8
- * ## Key Features
9
- *
10
- * - **Five Metric Types**: Counters, Gauges, Frequencies, Histograms, and Summaries
11
- * - **Type Safety**: Fully typed metrics with compile-time guarantees
12
- * - **Concurrency Safe**: Thread-safe metrics that work with Effect's concurrency model
13
- * - **Attributes**: Tag metrics with key-value attributes for filtering and grouping
14
- * - **Snapshots**: Take point-in-time snapshots of all metrics for reporting
15
- * - **Runtime Integration**: Automatic fiber runtime metrics collection
16
- *
17
- * ## Metric Types
18
- *
19
- * ### Counter
20
- * Tracks cumulative values that only increase or can be reset to zero.
21
- * Perfect for counting events, requests, errors, etc.
22
- *
23
- * ### Gauge
24
- * Represents a single numerical value that can go up or down.
25
- * Ideal for current resource usage, temperature, queue sizes, etc.
26
- *
27
- * ### Frequency
28
- * Counts occurrences of discrete string values.
29
- * Useful for tracking categorical data like HTTP status codes, user actions, etc.
30
- *
31
- * ### Histogram
32
- * Records observations in configurable buckets to analyze distribution.
33
- * Great for response times, request sizes, and other measured values.
34
- *
35
- * ### Summary
36
- * Calculates quantiles over a sliding time window.
37
- * Provides statistical insights into value distributions over time.
38
- *
39
- * ## Basic Usage
2
+ * The `Metric` module provides tools for defining, updating, tagging, and
3
+ * reading application metrics from Effect programs. A `Metric<Input, State>`
4
+ * accepts typed input values and aggregates them into a typed state that can be
5
+ * read directly or exported from a snapshot.
6
+ *
7
+ * **Mental model**
8
+ *
9
+ * - A metric has an identifier, a type, an optional description, optional attributes, and mutable aggregate state
10
+ * - Use counters for cumulative values such as requests, errors, retries, or bytes processed
11
+ * - Use gauges for point-in-time values that can rise or fall, such as active connections or queue size
12
+ * - Use frequencies to count occurrences of discrete string values, such as status codes or action names
13
+ * - Use histograms to bucket numeric observations and inspect count, min, max, and sum
14
+ * - Use summaries to calculate quantiles over a bounded, time-based observation window
15
+ * - Metrics are updated from effects with {@link update} and {@link modify}, and read with {@link value}
16
+ * - Attributes tag metrics with key-value dimensions so the same logical metric can be grouped by service, endpoint, method, or other labels
17
+ * - Snapshots capture the currently registered metrics and their aggregate states for reporting or export
18
+ *
19
+ * **Common tasks**
20
+ *
21
+ * - Create counters: {@link counter}
22
+ * - Create gauges: {@link gauge}
23
+ * - Create frequencies: {@link frequency}
24
+ * - Create histograms: {@link histogram}, {@link linearBoundaries}, {@link exponentialBoundaries}
25
+ * - Create summaries: {@link summary}, {@link summaryWithTimestamp}
26
+ * - Measure effect duration: {@link timer}
27
+ * - Update a metric: {@link update}
28
+ * - Apply relative updates where supported: {@link modify}
29
+ * - Read one metric: {@link value}
30
+ * - Tag a metric: {@link withAttributes}
31
+ * - Transform accepted input values: {@link mapInput}
32
+ * - Record a constant input for repeated events: {@link withConstantInput}
33
+ * - Inspect all registered metrics: {@link snapshot}, {@link dump}
34
+ * - Enable fiber runtime metrics: {@link enableRuntimeMetrics}
35
+ *
36
+ * **Gotchas**
37
+ *
38
+ * - Counter and gauge metrics can use `number` inputs by default or `bigint` inputs with the `bigint` option
39
+ * - Incremental counters ignore negative updates; use non-incremental counters only when decreases are meaningful
40
+ * - {@link update} sets a gauge to an absolute value, while {@link modify} changes it relative to its current value
41
+ * - Histogram buckets are cumulative and depend on the boundaries supplied when the metric is created
42
+ * - Summary quantiles are calculated from the configured sliding window, so old observations expire
43
+ * - Prefer low-cardinality attributes; using unbounded values such as request IDs can create too many metric series
44
+ *
45
+ * **Quickstart**
46
+ *
47
+ * **Example** (Creating and updating metrics)
40
48
  *
41
49
  * ```ts
42
50
  * import { Effect, Metric } from "effect"
43
51
  *
44
- * // Create metrics
45
52
  * const requestCount = Metric.counter("http_requests_total", {
46
53
  * description: "Total number of HTTP requests"
47
54
  * })
@@ -51,31 +58,7 @@
51
58
  * boundaries: Metric.linearBoundaries({ start: 0, width: 50, count: 20 })
52
59
  * })
53
60
  *
54
- * // Use metrics in your application
55
61
  * const handleRequest = Effect.gen(function*() {
56
- * yield* Metric.update(requestCount, 1)
57
- *
58
- * const startTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
59
- *
60
- * // Process request...
61
- * yield* Effect.sleep("100 millis")
62
- *
63
- * const endTime = yield* Effect.clockWith((clock) => clock.currentTimeMillis)
64
- * yield* Metric.update(responseTime, endTime - startTime)
65
- * })
66
- * ```
67
- *
68
- * ## Attributes and Tagging
69
- *
70
- * ```ts
71
- * import { Effect, Metric } from "effect"
72
- *
73
- * const requestCount = Metric.counter("requests", {
74
- * description: "Number of requests by endpoint and method"
75
- * })
76
- *
77
- * const program = Effect.gen(function*() {
78
- * // Add attributes to metrics
79
62
  * yield* Metric.update(
80
63
  * Metric.withAttributes(requestCount, {
81
64
  * endpoint: "/api/users",
@@ -84,57 +67,21 @@
84
67
  * 1
85
68
  * )
86
69
  *
87
- * // Or use withAttributes for compile-time attributes
88
- * const taggedCounter = Metric.withAttributes(requestCount, {
89
- * endpoint: "/api/posts",
90
- * method: "POST"
91
- * })
92
- * yield* Metric.update(taggedCounter, 1)
93
- * })
94
- * ```
95
- *
96
- * ## Advanced Examples
97
- *
98
- * ```ts
99
- * import { Effect, Metric } from "effect"
100
- *
101
- * // Business metrics
102
- * const userSignups = Metric.counter("user_signups_total")
103
- * const activeUsers = Metric.gauge("active_users_current")
104
- * const featureUsage = Metric.frequency("feature_usage")
70
+ * yield* Metric.update(responseTime, 125)
105
71
  *
106
- * // Performance metrics
107
- * const dbQueryTime = Metric.summary("db_query_duration", {
108
- * maxAge: "5 minutes",
109
- * maxSize: 1000,
110
- * quantiles: [0.5, 0.9, 0.95, 0.99]
72
+ * return yield* Metric.value(requestCount)
111
73
  * })
74
+ * ```
112
75
  *
113
- * const program = Effect.gen(function*() {
114
- * // Track user signup
115
- * yield* Metric.update(userSignups, 1)
116
- *
117
- * // Update active user count
118
- * yield* Metric.update(activeUsers, 1250)
119
- *
120
- * // Record feature usage
121
- * yield* Metric.update(featureUsage, "dashboard_view")
76
+ * **See also**
122
77
  *
123
- * // Measure database query time
124
- * yield* Effect.timed(performDatabaseQuery).pipe(
125
- * Effect.tap(([duration]) => Metric.update(dbQueryTime, duration))
126
- * )
127
- * })
128
- *
129
- * // Get metric snapshots
130
- * const getMetrics = Effect.gen(function*() {
131
- * const snapshots = yield* Metric.snapshot
78
+ * - {@link counter} / {@link gauge} / {@link frequency} for common metric types
79
+ * - {@link histogram} / {@link summary} for distribution metrics
80
+ * - {@link update} / {@link modify} / {@link value} for working with metric state
81
+ * - {@link withAttributes} for adding dimensions
82
+ * - {@link snapshot} for exporting all registered metric values
132
83
  *
133
- * for (const metric of snapshots) {
134
- * console.log(`${metric.id}: ${JSON.stringify(metric.state)}`)
135
- * }
136
- * })
137
- * ```
84
+ * @since 2.0.0
138
85
  */
139
86
 
140
87
  import * as Arr from "./Array.ts"
@@ -170,7 +117,8 @@ import type { Contravariant, Covariant } from "./Types.ts"
170
117
  * - Histograms
171
118
  * - Summaries
172
119
  *
173
- * @example
120
+ * **Example** (Using multiple metric types)
121
+ *
174
122
  * ```ts
175
123
  * import { Data, Effect, Metric } from "effect"
176
124
  *
@@ -224,8 +172,8 @@ import type { Contravariant, Covariant } from "./Types.ts"
224
172
  * })
225
173
  * ```
226
174
  *
227
- * @since 2.0.0
228
175
  * @category Models
176
+ * @since 2.0.0
229
177
  */
230
178
  export interface Metric<in Input, out State> extends Pipeable {
231
179
  readonly [TypeId]: typeof TypeId
@@ -246,7 +194,8 @@ export interface Metric<in Input, out State> extends Pipeable {
246
194
  * Counters are useful for tracking monotonically increasing values like request counts,
247
195
  * bytes processed, errors encountered, or any value that accumulates over time.
248
196
  *
249
- * @example
197
+ * **Example** (Using counter metrics)
198
+ *
250
199
  * ```ts
251
200
  * import { Data, Effect, Metric } from "effect"
252
201
  *
@@ -300,15 +249,16 @@ export interface Metric<in Input, out State> extends Pipeable {
300
249
  * })
301
250
  * ```
302
251
  *
303
- * @since 2.0.0
304
252
  * @category Metrics
253
+ * @since 2.0.0
305
254
  */
306
255
  export interface Counter<in Input extends number | bigint> extends Metric<Input, CounterState<Input>> {}
307
256
 
308
257
  /**
309
258
  * State interface for Counter metrics containing the current count and increment mode.
310
259
  *
311
- * @example
260
+ * **Example** (Reading counter state)
261
+ *
312
262
  * ```ts
313
263
  * import { Data, Effect, Metric } from "effect"
314
264
  *
@@ -361,8 +311,8 @@ export interface Counter<in Input extends number | bigint> extends Metric<Input,
361
311
  * })
362
312
  * ```
363
313
  *
364
- * @since 2.0.0
365
314
  * @category Counter
315
+ * @since 2.0.0
366
316
  */
367
317
  export interface CounterState<in Input extends number | bigint> {
368
318
  readonly count: Input extends bigint ? bigint : number
@@ -376,7 +326,8 @@ export interface CounterState<in Input extends number | bigint> {
376
326
  * how many times specific string values occur, such as HTTP status codes, user actions,
377
327
  * error types, or any discrete string-based events.
378
328
  *
379
- * @example
329
+ * **Example** (Using frequency metrics)
330
+ *
380
331
  * ```ts
381
332
  * import { Data, Effect, Metric } from "effect"
382
333
  *
@@ -446,15 +397,16 @@ export interface CounterState<in Input extends number | bigint> {
446
397
  * })
447
398
  * ```
448
399
  *
449
- * @since 2.0.0
450
400
  * @category Metrics
401
+ * @since 2.0.0
451
402
  */
452
403
  export interface Frequency extends Metric<string, FrequencyState> {}
453
404
 
454
405
  /**
455
406
  * State interface for Frequency metrics containing occurrence counts for discrete string values.
456
407
  *
457
- * @example
408
+ * **Example** (Reading frequency state)
409
+ *
458
410
  * ```ts
459
411
  * import { Data, Effect, Metric } from "effect"
460
412
  *
@@ -530,8 +482,8 @@ export interface Frequency extends Metric<string, FrequencyState> {}
530
482
  * })
531
483
  * ```
532
484
  *
533
- * @since 2.0.0
534
485
  * @category Metrics
486
+ * @since 2.0.0
535
487
  */
536
488
  export interface FrequencyState {
537
489
  readonly occurrences: ReadonlyMap<string, number>
@@ -543,7 +495,8 @@ export interface FrequencyState {
543
495
  * Gauges are useful for tracking current state values like memory usage, CPU load,
544
496
  * active connections, queue sizes, or any value that represents a current level.
545
497
  *
546
- * @example
498
+ * **Example** (Using gauge metrics)
499
+ *
547
500
  * ```ts
548
501
  * import { Data, Effect, Metric } from "effect"
549
502
  *
@@ -590,15 +543,16 @@ export interface FrequencyState {
590
543
  * })
591
544
  * ```
592
545
  *
593
- * @since 2.0.0
594
546
  * @category Metrics
547
+ * @since 2.0.0
595
548
  */
596
549
  export interface Gauge<in Input extends number | bigint> extends Metric<Input, GaugeState<Input>> {}
597
550
 
598
551
  /**
599
552
  * State interface for Gauge metrics containing the current instantaneous value.
600
553
  *
601
- * @example
554
+ * **Example** (Reading gauge state)
555
+ *
602
556
  * ```ts
603
557
  * import { Data, Effect, Metric } from "effect"
604
558
  *
@@ -658,8 +612,8 @@ export interface Gauge<in Input extends number | bigint> extends Metric<Input, G
658
612
  * })
659
613
  * ```
660
614
  *
661
- * @since 2.0.0
662
615
  * @category Metrics
616
+ * @since 2.0.0
663
617
  */
664
618
  export interface GaugeState<in Input extends number | bigint> {
665
619
  readonly value: Input extends bigint ? bigint : number
@@ -671,7 +625,8 @@ export interface GaugeState<in Input extends number | bigint> {
671
625
  * Histograms are ideal for measuring request durations, response sizes, and other continuous values
672
626
  * where you need to understand the distribution of values rather than just aggregates.
673
627
  *
674
- * @example
628
+ * **Example** (Using histogram metrics)
629
+ *
675
630
  * ```ts
676
631
  * import { Data, Effect, Metric } from "effect"
677
632
  *
@@ -746,15 +701,16 @@ export interface GaugeState<in Input extends number | bigint> {
746
701
  * })
747
702
  * ```
748
703
  *
749
- * @since 2.0.0
750
704
  * @category Metrics
705
+ * @since 2.0.0
751
706
  */
752
707
  export interface Histogram<Input> extends Metric<Input, HistogramState> {}
753
708
 
754
709
  /**
755
710
  * State interface for Histogram metrics containing bucket distributions and aggregate statistics.
756
711
  *
757
- * @example
712
+ * **Example** (Reading histogram state)
713
+ *
758
714
  * ```ts
759
715
  * import { Data, Effect, Metric } from "effect"
760
716
  *
@@ -832,8 +788,8 @@ export interface Histogram<Input> extends Metric<Input, HistogramState> {}
832
788
  * })
833
789
  * ```
834
790
  *
835
- * @since 2.0.0
836
791
  * @category Metrics
792
+ * @since 2.0.0
837
793
  */
838
794
  export interface HistogramState {
839
795
  readonly buckets: ReadonlyArray<[number, number]>
@@ -850,7 +806,8 @@ export interface HistogramState {
850
806
  * (percentiles) such as median (50th), 95th percentile, 99th percentile, etc. They're ideal for
851
807
  * understanding performance characteristics like response time distributions.
852
808
  *
853
- * @example
809
+ * **Example** (Using summary metrics)
810
+ *
854
811
  * ```ts
855
812
  * import { Data, Effect, Metric } from "effect"
856
813
  *
@@ -935,15 +892,16 @@ export interface HistogramState {
935
892
  * })
936
893
  * ```
937
894
  *
938
- * @since 2.0.0
939
895
  * @category Metrics
896
+ * @since 2.0.0
940
897
  */
941
898
  export interface Summary<Input> extends Metric<Input, SummaryState> {}
942
899
 
943
900
  /**
944
901
  * State interface for Summary metrics containing quantile calculations and aggregate statistics.
945
902
  *
946
- * @example
903
+ * **Example** (Reading summary state)
904
+ *
947
905
  * ```ts
948
906
  * import { Data, Effect, Metric } from "effect"
949
907
  *
@@ -1016,8 +974,8 @@ export interface Summary<Input> extends Metric<Input, SummaryState> {}
1016
974
  * })
1017
975
  * ```
1018
976
  *
1019
- * @since 2.0.0
1020
977
  * @category Metrics
978
+ * @since 2.0.0
1021
979
  */
1022
980
  export interface SummaryState {
1023
981
  readonly quantiles: ReadonlyArray<readonly [number, number | undefined]>
@@ -1031,7 +989,8 @@ export interface SummaryState {
1031
989
  * The `Metric` namespace provides a comprehensive system for collecting, aggregating, and observing
1032
990
  * application metrics in Effect applications.
1033
991
  *
1034
- * @example
992
+ * **Example** (Collecting application metrics)
993
+ *
1035
994
  * ```ts
1036
995
  * import { Data, Effect, Metric } from "effect"
1037
996
  *
@@ -1069,14 +1028,15 @@ export interface SummaryState {
1069
1028
  * })
1070
1029
  * ```
1071
1030
  *
1072
- * @since 2.0.0
1073
1031
  * @category models
1032
+ * @since 2.0.0
1074
1033
  */
1075
1034
  export declare namespace Metric {
1076
1035
  /**
1077
1036
  * Union type representing all available metric types in the Effect metrics system.
1078
1037
  *
1079
- * @example
1038
+ * **Example** (Inspecting metric types)
1039
+ *
1080
1040
  * ```ts
1081
1041
  * import { Data, Effect, Metric } from "effect"
1082
1042
  *
@@ -1148,15 +1108,16 @@ export declare namespace Metric {
1148
1108
  * })
1149
1109
  * ```
1150
1110
  *
1151
- * @since 2.0.0
1152
1111
  * @category types
1112
+ * @since 2.0.0
1153
1113
  */
1154
1114
  export type Type = "Counter" | "Frequency" | "Gauge" | "Histogram" | "Summary"
1155
1115
 
1156
1116
  /**
1157
1117
  * Union type for metric attributes that can be provided as either an object or array of tuples.
1158
1118
  *
1159
- * @example
1119
+ * **Example** (Providing attributes in different formats)
1120
+ *
1160
1121
  * ```ts
1161
1122
  * import { Data, Effect, Metric } from "effect"
1162
1123
  *
@@ -1223,15 +1184,16 @@ export declare namespace Metric {
1223
1184
  * })
1224
1185
  * ```
1225
1186
  *
1226
- * @since 2.0.0
1227
1187
  * @category types
1188
+ * @since 2.0.0
1228
1189
  */
1229
1190
  export type Attributes = AttributeSet | ReadonlyArray<[string, string]>
1230
1191
 
1231
1192
  /**
1232
1193
  * Type for metric attributes as a readonly record of string key-value pairs.
1233
1194
  *
1234
- * @example
1195
+ * **Example** (Combining metric attribute sets)
1196
+ *
1235
1197
  * ```ts
1236
1198
  * import { Data, Effect, Metric } from "effect"
1237
1199
  *
@@ -1300,15 +1262,16 @@ export declare namespace Metric {
1300
1262
  * })
1301
1263
  * ```
1302
1264
  *
1303
- * @since 2.0.0
1304
1265
  * @category types
1266
+ * @since 2.0.0
1305
1267
  */
1306
1268
  export type AttributeSet = Readonly<Record<string, string>>
1307
1269
 
1308
1270
  /**
1309
1271
  * Utility type to extract the Input type from a Metric type.
1310
1272
  *
1311
- * @example
1273
+ * **Example** (Extracting metric input types)
1274
+ *
1312
1275
  * ```ts
1313
1276
  * import { Metric } from "effect"
1314
1277
  *
@@ -1349,8 +1312,8 @@ export declare namespace Metric {
1349
1312
  * // Metric.update(stringFrequency, 404) // ✗ Type error
1350
1313
  * ```
1351
1314
  *
1352
- * @since 2.0.0
1353
1315
  * @category types
1316
+ * @since 2.0.0
1354
1317
  */
1355
1318
  export type Input<A> = A extends Metric<infer _Input, infer _State> ? _Input
1356
1319
  : never
@@ -1358,7 +1321,8 @@ export declare namespace Metric {
1358
1321
  /**
1359
1322
  * Utility type to extract the State type from a Metric type.
1360
1323
  *
1361
- * @example
1324
+ * **Example** (Extracting metric state types)
1325
+ *
1362
1326
  * ```ts
1363
1327
  * import { Effect, Metric } from "effect"
1364
1328
  *
@@ -1408,8 +1372,8 @@ export declare namespace Metric {
1408
1372
  * })
1409
1373
  * ```
1410
1374
  *
1411
- * @since 2.0.0
1412
1375
  * @category types
1376
+ * @since 2.0.0
1413
1377
  */
1414
1378
  export type State<A> = A extends Metric<infer _Input, infer _State> ? _State
1415
1379
  : never
@@ -1417,7 +1381,8 @@ export declare namespace Metric {
1417
1381
  /**
1418
1382
  * Interface defining the core hooks for metric operations: get, update, and modify.
1419
1383
  *
1420
- * @example
1384
+ * **Example** (Using metric hooks)
1385
+ *
1421
1386
  * ```ts
1422
1387
  * import { Data, Effect, Metric } from "effect"
1423
1388
  *
@@ -1453,8 +1418,8 @@ export declare namespace Metric {
1453
1418
  * })
1454
1419
  * ```
1455
1420
  *
1456
- * @since 2.0.0
1457
1421
  * @category interfaces
1422
+ * @since 2.0.0
1458
1423
  */
1459
1424
  export interface Hooks<in Input, out State> {
1460
1425
  readonly get: (context: Context.Context<never>) => State
@@ -1465,7 +1430,8 @@ export declare namespace Metric {
1465
1430
  /**
1466
1431
  * Interface containing complete metadata information about a metric.
1467
1432
  *
1468
- * @example
1433
+ * **Example** (Inspecting metric metadata)
1434
+ *
1469
1435
  * ```ts
1470
1436
  * import { Data, Effect, Metric } from "effect"
1471
1437
  *
@@ -1518,8 +1484,8 @@ export declare namespace Metric {
1518
1484
  * })
1519
1485
  * ```
1520
1486
  *
1521
- * @since 4.0.0
1522
1487
  * @category interfaces
1488
+ * @since 4.0.0
1523
1489
  */
1524
1490
  export interface Metadata<in Input, out State> {
1525
1491
  readonly id: string
@@ -1532,7 +1498,8 @@ export declare namespace Metric {
1532
1498
  /**
1533
1499
  * Protocol interface for metric snapshots containing metadata and current state.
1534
1500
  *
1535
- * @example
1501
+ * **Example** (Inspecting metric snapshot protocols)
1502
+ *
1536
1503
  * ```ts
1537
1504
  * import { Data, Effect, Metric } from "effect"
1538
1505
  *
@@ -1590,8 +1557,8 @@ export declare namespace Metric {
1590
1557
  * })
1591
1558
  * ```
1592
1559
  *
1593
- * @since 4.0.0
1594
1560
  * @category interfaces
1561
+ * @since 4.0.0
1595
1562
  */
1596
1563
  export interface SnapshotProto<T extends Type, State> {
1597
1564
  readonly id: string
@@ -1604,7 +1571,8 @@ export declare namespace Metric {
1604
1571
  /**
1605
1572
  * Union type representing all possible metric snapshot types with their corresponding states.
1606
1573
  *
1607
- * @example
1574
+ * **Example** (Analyzing metric snapshots)
1575
+ *
1608
1576
  * ```ts
1609
1577
  * import { Data, Effect, Metric } from "effect"
1610
1578
  *
@@ -1666,8 +1634,8 @@ export declare namespace Metric {
1666
1634
  * })
1667
1635
  * ```
1668
1636
  *
1669
- * @since 4.0.0
1670
1637
  * @category types
1638
+ * @since 4.0.0
1671
1639
  */
1672
1640
  export type Snapshot =
1673
1641
  | SnapshotProto<"Counter", CounterState<number | bigint>>
@@ -1680,7 +1648,8 @@ export declare namespace Metric {
1680
1648
  /**
1681
1649
  * Service key for the current metric attributes context.
1682
1650
  *
1683
- * @example
1651
+ * **Example** (Using the current attributes key)
1652
+ *
1684
1653
  * ```ts
1685
1654
  * import { Data, Effect, Metric } from "effect"
1686
1655
  *
@@ -1722,15 +1691,22 @@ export declare namespace Metric {
1722
1691
  * })
1723
1692
  * ```
1724
1693
  *
1725
- * @since 4.0.0
1726
1694
  * @category References
1695
+ * @since 4.0.0
1727
1696
  */
1728
1697
  export const CurrentMetricAttributesKey = "effect/Metric/CurrentMetricAttributes" as const
1729
1698
 
1730
1699
  /**
1731
- * Service class for managing the current metric attributes context.
1700
+ * `Context.Reference` for metric attributes applied from the current Effect
1701
+ * context.
1702
+ *
1703
+ * **Details**
1704
+ * The default value is an empty attribute set. Metric reads and updates merge
1705
+ * these contextual attributes with the metric's own attributes to select the
1706
+ * metric series being accessed.
1707
+ *
1708
+ * **Example** (Providing current metric attributes)
1732
1709
  *
1733
- * @example
1734
1710
  * ```ts
1735
1711
  * import { Data, Effect, Metric } from "effect"
1736
1712
  *
@@ -1758,8 +1734,8 @@ export const CurrentMetricAttributesKey = "effect/Metric/CurrentMetricAttributes
1758
1734
  * })
1759
1735
  * ```
1760
1736
  *
1761
- * @since 4.0.0
1762
1737
  * @category References
1738
+ * @since 4.0.0
1763
1739
  */
1764
1740
  export const CurrentMetricAttributes = Context.Reference<Metric.AttributeSet>(CurrentMetricAttributesKey, {
1765
1741
  defaultValue: () => ({})
@@ -1768,10 +1744,14 @@ export const CurrentMetricAttributes = Context.Reference<Metric.AttributeSet>(Cu
1768
1744
  const MetricRegistryKey = "~effect/observability/Metric/MetricRegistryKey"
1769
1745
 
1770
1746
  /**
1771
- * Service class for accessing the current metric registry.
1747
+ * `Context.Reference` for the metric registry in the current context.
1748
+ *
1749
+ * **Details**
1750
+ * The default registry is an empty `Map`. Metrics register their metadata and
1751
+ * hooks lazily in this map when they are read or updated.
1772
1752
  *
1773
- * @since 4.0.0
1774
1753
  * @category References
1754
+ * @since 4.0.0
1775
1755
  */
1776
1756
  export const MetricRegistry = Context.Reference<Map<string, Metric.Metadata<any, any>>>(
1777
1757
  MetricRegistryKey,
@@ -2150,7 +2130,8 @@ class MetricTransform<in Input, out State, in Input2> extends Metric$<Input2, St
2150
2130
  * This function is useful for runtime type checking and ensuring that a value
2151
2131
  * conforms to the Metric interface before performing metric operations.
2152
2132
  *
2153
- * @example
2133
+ * **Example** (Checking metric values)
2134
+ *
2154
2135
  * ```ts
2155
2136
  * import { Metric } from "effect"
2156
2137
  *
@@ -2164,8 +2145,8 @@ class MetricTransform<in Input, out State, in Input2> extends Metric$<Input2, St
2164
2145
  * console.log(Metric.isMetric(null)) // false
2165
2146
  * ```
2166
2147
  *
2167
- * @since 4.0.0
2168
2148
  * @category Guards
2149
+ * @since 4.0.0
2169
2150
  */
2170
2151
  export const isMetric = (u: unknown): u is Metric<unknown, never> =>
2171
2152
  Predicate.hasProperty(u, "~effect/Metric") && u["~effect/Metric"] === "~effect/Metric"
@@ -2183,7 +2164,8 @@ export const isMetric = (u: unknown): u is Metric<unknown, never> =>
2183
2164
  * - `incremental` - Set to `true` to create a `Counter` that can only ever be
2184
2165
  * incremented.
2185
2166
  *
2186
- * @example
2167
+ * **Example** (Creating counter metrics)
2168
+ *
2187
2169
  * ```ts
2188
2170
  * import { Data, Effect, Metric } from "effect"
2189
2171
  *
@@ -2225,8 +2207,8 @@ export const isMetric = (u: unknown): u is Metric<unknown, never> =>
2225
2207
  * })
2226
2208
  * ```
2227
2209
  *
2228
- * @since 2.0.0
2229
2210
  * @category Constructors
2211
+ * @since 2.0.0
2230
2212
  */
2231
2213
  export const counter: {
2232
2214
  /**
@@ -2242,7 +2224,8 @@ export const counter: {
2242
2224
  * - `incremental` - Set to `true` to create a `Counter` that can only ever be
2243
2225
  * incremented.
2244
2226
  *
2245
- * @example
2227
+ * **Example** (Creating counter metrics)
2228
+ *
2246
2229
  * ```ts
2247
2230
  * import { Data, Effect, Metric } from "effect"
2248
2231
  *
@@ -2284,8 +2267,8 @@ export const counter: {
2284
2267
  * })
2285
2268
  * ```
2286
2269
  *
2287
- * @since 2.0.0
2288
2270
  * @category Constructors
2271
+ * @since 2.0.0
2289
2272
  */
2290
2273
  (
2291
2274
  name: string,
@@ -2309,7 +2292,8 @@ export const counter: {
2309
2292
  * - `incremental` - Set to `true` to create a `Counter` that can only ever be
2310
2293
  * incremented.
2311
2294
  *
2312
- * @example
2295
+ * **Example** (Creating counter metrics)
2296
+ *
2313
2297
  * ```ts
2314
2298
  * import { Data, Effect, Metric } from "effect"
2315
2299
  *
@@ -2351,8 +2335,8 @@ export const counter: {
2351
2335
  * })
2352
2336
  * ```
2353
2337
  *
2354
- * @since 2.0.0
2355
2338
  * @category Constructors
2339
+ * @since 2.0.0
2356
2340
  */
2357
2341
  (
2358
2342
  name: string,
@@ -2378,7 +2362,8 @@ export const counter: {
2378
2362
  * - `attributes` - The attributes to associate with the `Gauge`.
2379
2363
  * - `bigint` - Indicates if the `Gauge` should use the `bigint` type.
2380
2364
  *
2381
- * @example
2365
+ * **Example** (Creating gauge metrics)
2366
+ *
2382
2367
  * ```ts
2383
2368
  * import { Data, Effect, Metric } from "effect"
2384
2369
  *
@@ -2425,8 +2410,8 @@ export const counter: {
2425
2410
  * })
2426
2411
  * ```
2427
2412
  *
2428
- * @since 2.0.0
2429
2413
  * @category Constructors
2414
+ * @since 2.0.0
2430
2415
  */
2431
2416
  export const gauge: {
2432
2417
  /**
@@ -2442,7 +2427,8 @@ export const gauge: {
2442
2427
  * - `attributes` - The attributes to associate with the `Gauge`.
2443
2428
  * - `bigint` - Indicates if the `Gauge` should use the `bigint` type.
2444
2429
  *
2445
- * @example
2430
+ * **Example** (Creating gauge metrics)
2431
+ *
2446
2432
  * ```ts
2447
2433
  * import { Data, Effect, Metric } from "effect"
2448
2434
  *
@@ -2489,8 +2475,8 @@ export const gauge: {
2489
2475
  * })
2490
2476
  * ```
2491
2477
  *
2492
- * @since 2.0.0
2493
2478
  * @category Constructors
2479
+ * @since 2.0.0
2494
2480
  */
2495
2481
  (
2496
2482
  name: string,
@@ -2513,7 +2499,8 @@ export const gauge: {
2513
2499
  * - `attributes` - The attributes to associate with the `Gauge`.
2514
2500
  * - `bigint` - Indicates if the `Gauge` should use the `bigint` type.
2515
2501
  *
2516
- * @example
2502
+ * **Example** (Creating gauge metrics)
2503
+ *
2517
2504
  * ```ts
2518
2505
  * import { Data, Effect, Metric } from "effect"
2519
2506
  *
@@ -2560,8 +2547,8 @@ export const gauge: {
2560
2547
  * })
2561
2548
  * ```
2562
2549
  *
2563
- * @since 2.0.0
2564
2550
  * @category Constructors
2551
+ * @since 2.0.0
2565
2552
  */
2566
2553
  (
2567
2554
  name: string,
@@ -2587,7 +2574,8 @@ export const gauge: {
2587
2574
  * - `preregisteredWords` - Occurrences which are pre-registered with the
2588
2575
  * `Frequency` metric occurrences.
2589
2576
  *
2590
- * @example
2577
+ * **Example** (Creating frequency metrics)
2578
+ *
2591
2579
  * ```ts
2592
2580
  * import { Data, Effect, Metric } from "effect"
2593
2581
  *
@@ -2645,8 +2633,8 @@ export const gauge: {
2645
2633
  * })
2646
2634
  * ```
2647
2635
  *
2648
- * @since 2.0.0
2649
2636
  * @category Constructors
2637
+ * @since 2.0.0
2650
2638
  */
2651
2639
  export const frequency = (name: string, options?: {
2652
2640
  readonly description?: string | undefined
@@ -2666,7 +2654,8 @@ export const frequency = (name: string, options?: {
2666
2654
  * - `attributes` - The attributes to associate with the `Histogram`.
2667
2655
  * - `boundaries` - The bucket boundaries of the `Histogram`
2668
2656
  *
2669
- * @example
2657
+ * **Example** (Creating histogram metrics)
2658
+ *
2670
2659
  * ```ts
2671
2660
  * import { Data, Effect, Metric } from "effect"
2672
2661
  *
@@ -2721,8 +2710,8 @@ export const frequency = (name: string, options?: {
2721
2710
  * })
2722
2711
  * ```
2723
2712
  *
2724
- * @since 2.0.0
2725
2713
  * @category Constructors
2714
+ * @since 2.0.0
2726
2715
  */
2727
2716
  export const histogram = (name: string, options: {
2728
2717
  readonly description?: string | undefined
@@ -2745,7 +2734,8 @@ export const histogram = (name: string, options: {
2745
2734
  * - `maxSize` - The maximum number of observations to keep.
2746
2735
  * - `quantiles` - An array of quantiles to calculate (e.g., [0.5, 0.9]).
2747
2736
  *
2748
- * @example
2737
+ * **Example** (Creating summary metrics)
2738
+ *
2749
2739
  * ```ts
2750
2740
  * import { Data, Duration, Effect, Metric } from "effect"
2751
2741
  *
@@ -2771,13 +2761,10 @@ export const histogram = (name: string, options: {
2771
2761
  * attributes: { service: "upload-service" }
2772
2762
  * })
2773
2763
  *
2774
- * // Simulate recording various response times over time
2775
- * for (let i = 0; i < 20; i++) {
2776
- * const responseTime = 50 + Math.random() * 200 // 50-250ms
2764
+ * // Record deterministic response times
2765
+ * const responseTimes = [82, 96, 104, 118, 135, 170, 210, 240]
2766
+ * for (const responseTime of responseTimes) {
2777
2767
  * yield* Metric.update(responseTimeSummary, responseTime)
2778
- *
2779
- * // Wait a bit to simulate different timestamps
2780
- * yield* Effect.sleep(Duration.millis(100))
2781
2768
  * }
2782
2769
  *
2783
2770
  * // Record some payload sizes
@@ -2790,20 +2777,28 @@ export const histogram = (name: string, options: {
2790
2777
  * const responseStats = yield* Metric.value(responseTimeSummary)
2791
2778
  * const payloadStats = yield* Metric.value(payloadSizeSummary)
2792
2779
  *
2793
- * // responseStats will contain:
2794
- * // - quantiles: [[0.5, Some(125)], [0.9, Some(220)], [0.95, Some(235)], [0.99, Some(245)]]
2795
- * // - count: 20, min: ~50, max: ~250, sum: ~2500
2796
- * // - Only observations from the last 5 minutes are included
2780
+ * console.log({
2781
+ * count: responseStats.count,
2782
+ * min: responseStats.min,
2783
+ * max: responseStats.max,
2784
+ * sum: responseStats.sum
2785
+ * }) // { count: 8, min: 82, max: 240, sum: 1155 }
2797
2786
  *
2798
- * // payloadStats will contain quantile information for recent payload sizes
2799
- * // Older observations automatically age out based on maxAge setting
2787
+ * console.log({
2788
+ * count: payloadStats.count,
2789
+ * min: payloadStats.min,
2790
+ * max: payloadStats.max,
2791
+ * sum: payloadStats.sum
2792
+ * }) // { count: 4, min: 1.2, max: 15.6, sum: 26 }
2793
+ *
2794
+ * // Both summaries include quantile information for their configured windows.
2800
2795
  *
2801
2796
  * return { responseStats, payloadStats }
2802
2797
  * })
2803
2798
  * ```
2804
2799
  *
2805
- * @since 2.0.0
2806
2800
  * @category Constructors
2801
+ * @since 2.0.0
2807
2802
  */
2808
2803
  export const summary = (name: string, options: {
2809
2804
  readonly description?: string | undefined
@@ -2819,11 +2814,12 @@ export const summary = (name: string, options: {
2819
2814
  ] as [number, number])
2820
2815
 
2821
2816
  /**
2822
- * Creates a `Summary` metric that records observations and calculates quantiles
2823
- * which takes a value and the current timestamp as input.
2817
+ * Creates a `Summary` metric that records observations with explicit
2818
+ * timestamps and calculates quantiles.
2824
2819
  *
2825
- * Summary metrics are most suitable for providing statistical information about
2826
- * a set of values, including quantiles.
2820
+ * Summary metrics are most suitable for statistical information about a set of
2821
+ * values. Inputs to this metric are `[value, timestamp]` pairs; the current
2822
+ * clock is used when reading quantiles against the configured `maxAge`.
2827
2823
  *
2828
2824
  * **Options**
2829
2825
  *
@@ -2833,7 +2829,8 @@ export const summary = (name: string, options: {
2833
2829
  * - `maxSize` - The maximum number of observations to keep.
2834
2830
  * - `quantiles` - An array of quantiles to calculate (e.g., [0.5, 0.9]).
2835
2831
  *
2836
- * @example
2832
+ * **Example** (Creating summaries with explicit timestamps)
2833
+ *
2837
2834
  * ```ts
2838
2835
  * import { Metric } from "effect"
2839
2836
  *
@@ -2848,8 +2845,8 @@ export const summary = (name: string, options: {
2848
2845
  * )
2849
2846
  * ```
2850
2847
  *
2851
- * @since 2.0.0
2852
2848
  * @category Constructors
2849
+ * @since 2.0.0
2853
2850
  */
2854
2851
  export const summaryWithTimestamp = (name: string, options: {
2855
2852
  readonly description?: string | undefined
@@ -2869,7 +2866,8 @@ export const summaryWithTimestamp = (name: string, options: {
2869
2866
  * If `options.boundaries` is not provided, the boundaries will be computed
2870
2867
  * using `Metric.exponentialBoundaries({ start: 0.5, factor: 2, count: 35 })`.
2871
2868
  *
2872
- * @example
2869
+ * **Example** (Recording durations with a timer)
2870
+ *
2873
2871
  * ```ts
2874
2872
  * import { Data, Duration, Effect, Metric } from "effect"
2875
2873
  *
@@ -2883,19 +2881,23 @@ export const summaryWithTimestamp = (name: string, options: {
2883
2881
  * attributes: { service: "user-api" }
2884
2882
  * })
2885
2883
  *
2886
- * // Simulate an API operation and measure its duration
2884
+ * // Record a measured API operation duration
2887
2885
  * const apiOperation = Effect.gen(function*() {
2888
- * const start = Date.now()
2889
- * yield* Effect.sleep(Duration.millis(100)) // Simulate work
2890
- * const duration = Duration.millis(Date.now() - start)
2891
- *
2892
- * // Update the timer with the measured duration
2886
+ * const duration = Duration.millis(120)
2893
2887
  * yield* Metric.update(apiRequestTimer, duration)
2888
+ *
2889
+ * const state = yield* Metric.value(apiRequestTimer)
2890
+ * console.log({
2891
+ * count: state.count,
2892
+ * min: state.min,
2893
+ * max: state.max,
2894
+ * sum: state.sum
2895
+ * }) // { count: 1, min: 120, max: 120, sum: 120 }
2894
2896
  * })
2895
2897
  * ```
2896
2898
  *
2897
- * @since 2.0.0
2898
2899
  * @category Constructors
2900
+ * @since 2.0.0
2899
2901
  */
2900
2902
  export const timer = (name: string, options?: {
2901
2903
  readonly description?: string | undefined
@@ -2913,15 +2915,17 @@ export const timer = (name: string, options?: {
2913
2915
  /**
2914
2916
  * Retrieves the current state of the specified `Metric`.
2915
2917
  *
2916
- * This function returns an Effect that, when executed, will provide the current
2917
- * aggregated state of the metric. The state type depends on the metric type:
2918
- * - Counter: `{ count: number | bigint }`
2919
- * - Gauge: `{ value: number | bigint }`
2920
- * - Frequency: `{ occurrences: Map<string, number> }`
2921
- * - Histogram: `{ buckets: Array<[number, number]>, count: number, min: number, max: number, sum: number }`
2922
- * - Summary: `{ quantiles: Array<[number, number | undefined]>, count: number, min: number, max: number, sum: number }`
2918
+ * **Details**
2919
+ * The returned state depends on the metric type:
2920
+ *
2921
+ * - Counter: `CounterState<number | bigint>` with `count` and `incremental`
2922
+ * - Gauge: `GaugeState<number | bigint>` with `value`
2923
+ * - Frequency: `FrequencyState` with `occurrences`
2924
+ * - Histogram: `HistogramState` with buckets, count, min, max, and sum
2925
+ * - Summary: `SummaryState` with quantiles, count, min, max, and sum
2926
+ *
2927
+ * **Example** (Reading metric state)
2923
2928
  *
2924
- * @example
2925
2929
  * ```ts
2926
2930
  * import { Effect, Metric } from "effect"
2927
2931
  *
@@ -2949,8 +2953,8 @@ export const timer = (name: string, options?: {
2949
2953
  * })
2950
2954
  * ```
2951
2955
  *
2952
- * @since 2.0.0
2953
2956
  * @category Utilities
2957
+ * @since 2.0.0
2954
2958
  */
2955
2959
  export const value = <Input, State>(
2956
2960
  self: Metric<Input, State>
@@ -2970,7 +2974,8 @@ export const value = <Input, State>(
2970
2974
  * - **Histogram**: Same as `update` - records the input value in the appropriate bucket
2971
2975
  * - **Summary**: Same as `update` - records the input observation
2972
2976
  *
2973
- * @example
2977
+ * **Example** (Modifying metric values)
2978
+ *
2974
2979
  * ```ts
2975
2980
  * import { Effect, Metric } from "effect"
2976
2981
  *
@@ -2997,8 +3002,8 @@ export const value = <Input, State>(
2997
3002
  * })
2998
3003
  * ```
2999
3004
  *
3000
- * @since 2.0.0
3001
3005
  * @category Utilities
3006
+ * @since 2.0.0
3002
3007
  */
3003
3008
  export const modify: {
3004
3009
  /**
@@ -3011,7 +3016,8 @@ export const modify: {
3011
3016
  * - **Histogram**: Same as `update` - records the input value in the appropriate bucket
3012
3017
  * - **Summary**: Same as `update` - records the input observation
3013
3018
  *
3014
- * @example
3019
+ * **Example** (Modifying metric values)
3020
+ *
3015
3021
  * ```ts
3016
3022
  * import { Effect, Metric } from "effect"
3017
3023
  *
@@ -3038,8 +3044,8 @@ export const modify: {
3038
3044
  * })
3039
3045
  * ```
3040
3046
  *
3041
- * @since 2.0.0
3042
3047
  * @category Utilities
3048
+ * @since 2.0.0
3043
3049
  */
3044
3050
  <Input>(input: Input): <State>(self: Metric<Input, State>) => Effect<void>
3045
3051
  /**
@@ -3052,7 +3058,8 @@ export const modify: {
3052
3058
  * - **Histogram**: Same as `update` - records the input value in the appropriate bucket
3053
3059
  * - **Summary**: Same as `update` - records the input observation
3054
3060
  *
3055
- * @example
3061
+ * **Example** (Modifying metric values)
3062
+ *
3056
3063
  * ```ts
3057
3064
  * import { Effect, Metric } from "effect"
3058
3065
  *
@@ -3079,8 +3086,8 @@ export const modify: {
3079
3086
  * })
3080
3087
  * ```
3081
3088
  *
3082
- * @since 2.0.0
3083
3089
  * @category Utilities
3090
+ * @since 2.0.0
3084
3091
  */
3085
3092
  <Input, State>(self: Metric<Input, State>, input: Input): Effect<void>
3086
3093
  } = dual<
@@ -3094,7 +3101,8 @@ export const modify: {
3094
3101
  * - **Histogram**: Same as `update` - records the input value in the appropriate bucket
3095
3102
  * - **Summary**: Same as `update` - records the input observation
3096
3103
  *
3097
- * @example
3104
+ * **Example** (Modifying metric values)
3105
+ *
3098
3106
  * ```ts
3099
3107
  * import { Effect, Metric } from "effect"
3100
3108
  *
@@ -3121,8 +3129,8 @@ export const modify: {
3121
3129
  * })
3122
3130
  * ```
3123
3131
  *
3124
- * @since 2.0.0
3125
3132
  * @category Utilities
3133
+ * @since 2.0.0
3126
3134
  */
3127
3135
  <Input>(input: Input) => <State>(self: Metric<Input, State>) => Effect<void>,
3128
3136
  /**
@@ -3135,7 +3143,8 @@ export const modify: {
3135
3143
  * - **Histogram**: Same as `update` - records the input value in the appropriate bucket
3136
3144
  * - **Summary**: Same as `update` - records the input observation
3137
3145
  *
3138
- * @example
3146
+ * **Example** (Modifying metric values)
3147
+ *
3139
3148
  * ```ts
3140
3149
  * import { Effect, Metric } from "effect"
3141
3150
  *
@@ -3162,8 +3171,8 @@ export const modify: {
3162
3171
  * })
3163
3172
  * ```
3164
3173
  *
3165
- * @since 2.0.0
3166
3174
  * @category Utilities
3175
+ * @since 2.0.0
3167
3176
  */
3168
3177
  <Input, State>(self: Metric<Input, State>, input: Input) => Effect<void>
3169
3178
  >(2, (self, input) =>
@@ -3182,7 +3191,8 @@ export const modify: {
3182
3191
  * - **Histogram**: Records the input value in the appropriate bucket
3183
3192
  * - **Summary**: Records the input value as a new observation
3184
3193
  *
3185
- * @example
3194
+ * **Example** (Updating metric values)
3195
+ *
3186
3196
  * ```ts
3187
3197
  * import { Effect, Metric } from "effect"
3188
3198
  *
@@ -3218,8 +3228,8 @@ export const modify: {
3218
3228
  * })
3219
3229
  * ```
3220
3230
  *
3221
- * @since 2.0.0
3222
3231
  * @category Utilities
3232
+ * @since 2.0.0
3223
3233
  */
3224
3234
  export const update: {
3225
3235
  /**
@@ -3232,7 +3242,8 @@ export const update: {
3232
3242
  * - **Histogram**: Records the input value in the appropriate bucket
3233
3243
  * - **Summary**: Records the input value as a new observation
3234
3244
  *
3235
- * @example
3245
+ * **Example** (Updating metric values)
3246
+ *
3236
3247
  * ```ts
3237
3248
  * import { Effect, Metric } from "effect"
3238
3249
  *
@@ -3268,8 +3279,8 @@ export const update: {
3268
3279
  * })
3269
3280
  * ```
3270
3281
  *
3271
- * @since 2.0.0
3272
3282
  * @category Utilities
3283
+ * @since 2.0.0
3273
3284
  */
3274
3285
  <Input>(input: Input): <State>(self: Metric<Input, State>) => Effect<void>
3275
3286
  /**
@@ -3282,7 +3293,8 @@ export const update: {
3282
3293
  * - **Histogram**: Records the input value in the appropriate bucket
3283
3294
  * - **Summary**: Records the input value as a new observation
3284
3295
  *
3285
- * @example
3296
+ * **Example** (Updating metric values)
3297
+ *
3286
3298
  * ```ts
3287
3299
  * import { Effect, Metric } from "effect"
3288
3300
  *
@@ -3318,8 +3330,8 @@ export const update: {
3318
3330
  * })
3319
3331
  * ```
3320
3332
  *
3321
- * @since 2.0.0
3322
3333
  * @category Utilities
3334
+ * @since 2.0.0
3323
3335
  */
3324
3336
  <Input, State>(self: Metric<Input, State>, input: Input): Effect<void>
3325
3337
  } = dual<
@@ -3333,7 +3345,8 @@ export const update: {
3333
3345
  * - **Histogram**: Records the input value in the appropriate bucket
3334
3346
  * - **Summary**: Records the input value as a new observation
3335
3347
  *
3336
- * @example
3348
+ * **Example** (Updating metric values)
3349
+ *
3337
3350
  * ```ts
3338
3351
  * import { Effect, Metric } from "effect"
3339
3352
  *
@@ -3369,8 +3382,8 @@ export const update: {
3369
3382
  * })
3370
3383
  * ```
3371
3384
  *
3372
- * @since 2.0.0
3373
3385
  * @category Utilities
3386
+ * @since 2.0.0
3374
3387
  */
3375
3388
  <Input>(input: Input) => <State>(self: Metric<Input, State>) => Effect<void>,
3376
3389
  /**
@@ -3383,7 +3396,8 @@ export const update: {
3383
3396
  * - **Histogram**: Records the input value in the appropriate bucket
3384
3397
  * - **Summary**: Records the input value as a new observation
3385
3398
  *
3386
- * @example
3399
+ * **Example** (Updating metric values)
3400
+ *
3387
3401
  * ```ts
3388
3402
  * import { Effect, Metric } from "effect"
3389
3403
  *
@@ -3419,8 +3433,8 @@ export const update: {
3419
3433
  * })
3420
3434
  * ```
3421
3435
  *
3422
- * @since 2.0.0
3423
3436
  * @category Utilities
3437
+ * @since 2.0.0
3424
3438
  */
3425
3439
  <Input, State>(self: Metric<Input, State>, input: Input) => Effect<void>
3426
3440
  >(
@@ -3434,7 +3448,8 @@ export const update: {
3434
3448
  * of the specified new type, which must be transformable to the input type of
3435
3449
  * this metric.
3436
3450
  *
3437
- * @example
3451
+ * **Example** (Mapping metric inputs)
3452
+ *
3438
3453
  * ```ts
3439
3454
  * import { Data, Effect, Metric } from "effect"
3440
3455
  *
@@ -3464,8 +3479,8 @@ export const update: {
3464
3479
  * })
3465
3480
  * ```
3466
3481
  *
3467
- * @since 2.0.0
3468
3482
  * @category Mapping
3483
+ * @since 2.0.0
3469
3484
  */
3470
3485
  export const mapInput: {
3471
3486
  /**
@@ -3473,7 +3488,8 @@ export const mapInput: {
3473
3488
  * of the specified new type, which must be transformable to the input type of
3474
3489
  * this metric.
3475
3490
  *
3476
- * @example
3491
+ * **Example** (Mapping metric inputs)
3492
+ *
3477
3493
  * ```ts
3478
3494
  * import { Data, Effect, Metric } from "effect"
3479
3495
  *
@@ -3503,8 +3519,8 @@ export const mapInput: {
3503
3519
  * })
3504
3520
  * ```
3505
3521
  *
3506
- * @since 2.0.0
3507
3522
  * @category Mapping
3523
+ * @since 2.0.0
3508
3524
  */
3509
3525
  <Input, Input2 extends Input>(f: (input: Input2, context: Context.Context<never>) => Input): <State>(self: Metric<Input, State>) => Metric<Input2, State>
3510
3526
  /**
@@ -3512,7 +3528,8 @@ export const mapInput: {
3512
3528
  * of the specified new type, which must be transformable to the input type of
3513
3529
  * this metric.
3514
3530
  *
3515
- * @example
3531
+ * **Example** (Mapping metric inputs)
3532
+ *
3516
3533
  * ```ts
3517
3534
  * import { Data, Effect, Metric } from "effect"
3518
3535
  *
@@ -3542,8 +3559,8 @@ export const mapInput: {
3542
3559
  * })
3543
3560
  * ```
3544
3561
  *
3545
- * @since 2.0.0
3546
3562
  * @category Mapping
3563
+ * @since 2.0.0
3547
3564
  */
3548
3565
  <Input, State, Input2>(
3549
3566
  self: Metric<Input, State>,
@@ -3555,7 +3572,8 @@ export const mapInput: {
3555
3572
  * of the specified new type, which must be transformable to the input type of
3556
3573
  * this metric.
3557
3574
  *
3558
- * @example
3575
+ * **Example** (Mapping metric inputs)
3576
+ *
3559
3577
  * ```ts
3560
3578
  * import { Data, Effect, Metric } from "effect"
3561
3579
  *
@@ -3585,8 +3603,8 @@ export const mapInput: {
3585
3603
  * })
3586
3604
  * ```
3587
3605
  *
3588
- * @since 2.0.0
3589
3606
  * @category Mapping
3607
+ * @since 2.0.0
3590
3608
  */
3591
3609
  <Input, Input2 extends Input>(f: (input: Input2, context: Context.Context<never>) => Input) => <State>(self: Metric<Input, State>) => Metric<Input2, State>,
3592
3610
  /**
@@ -3594,7 +3612,8 @@ export const mapInput: {
3594
3612
  * of the specified new type, which must be transformable to the input type of
3595
3613
  * this metric.
3596
3614
  *
3597
- * @example
3615
+ * **Example** (Mapping metric inputs)
3616
+ *
3598
3617
  * ```ts
3599
3618
  * import { Data, Effect, Metric } from "effect"
3600
3619
  *
@@ -3624,8 +3643,8 @@ export const mapInput: {
3624
3643
  * })
3625
3644
  * ```
3626
3645
  *
3627
- * @since 2.0.0
3628
3646
  * @category Mapping
3647
+ * @since 2.0.0
3629
3648
  */
3630
3649
  <Input, State, Input2>(
3631
3650
  self: Metric<Input, State>,
@@ -3647,7 +3666,8 @@ export const mapInput: {
3647
3666
  * of any type, and translates them to updates with the specified constant
3648
3667
  * update value.
3649
3668
  *
3650
- * @example
3669
+ * **Example** (Ignoring inputs with a constant value)
3670
+ *
3651
3671
  * ```ts
3652
3672
  * import { Data, Effect, Metric } from "effect"
3653
3673
  *
@@ -3674,8 +3694,8 @@ export const mapInput: {
3674
3694
  * })
3675
3695
  * ```
3676
3696
  *
3677
- * @since 2.0.0
3678
3697
  * @category Input
3698
+ * @since 2.0.0
3679
3699
  */
3680
3700
  export const withConstantInput: {
3681
3701
  /**
@@ -3683,7 +3703,8 @@ export const withConstantInput: {
3683
3703
  * of any type, and translates them to updates with the specified constant
3684
3704
  * update value.
3685
3705
  *
3686
- * @example
3706
+ * **Example** (Ignoring inputs with a constant value)
3707
+ *
3687
3708
  * ```ts
3688
3709
  * import { Data, Effect, Metric } from "effect"
3689
3710
  *
@@ -3710,8 +3731,8 @@ export const withConstantInput: {
3710
3731
  * })
3711
3732
  * ```
3712
3733
  *
3713
- * @since 2.0.0
3714
3734
  * @category Input
3735
+ * @since 2.0.0
3715
3736
  */
3716
3737
  <Input>(input: Input): <State>(self: Metric<Input, State>) => Metric<unknown, State>
3717
3738
  /**
@@ -3719,7 +3740,8 @@ export const withConstantInput: {
3719
3740
  * of any type, and translates them to updates with the specified constant
3720
3741
  * update value.
3721
3742
  *
3722
- * @example
3743
+ * **Example** (Ignoring inputs with a constant value)
3744
+ *
3723
3745
  * ```ts
3724
3746
  * import { Data, Effect, Metric } from "effect"
3725
3747
  *
@@ -3746,8 +3768,8 @@ export const withConstantInput: {
3746
3768
  * })
3747
3769
  * ```
3748
3770
  *
3749
- * @since 2.0.0
3750
3771
  * @category Input
3772
+ * @since 2.0.0
3751
3773
  */
3752
3774
  <Input, State>(self: Metric<Input, State>, input: Input): Metric<unknown, State>
3753
3775
  } = dual<
@@ -3756,7 +3778,8 @@ export const withConstantInput: {
3756
3778
  * of any type, and translates them to updates with the specified constant
3757
3779
  * update value.
3758
3780
  *
3759
- * @example
3781
+ * **Example** (Ignoring inputs with a constant value)
3782
+ *
3760
3783
  * ```ts
3761
3784
  * import { Data, Effect, Metric } from "effect"
3762
3785
  *
@@ -3783,8 +3806,8 @@ export const withConstantInput: {
3783
3806
  * })
3784
3807
  * ```
3785
3808
  *
3786
- * @since 2.0.0
3787
3809
  * @category Input
3810
+ * @since 2.0.0
3788
3811
  */
3789
3812
  <Input>(input: Input) => <State>(self: Metric<Input, State>) => Metric<unknown, State>,
3790
3813
  /**
@@ -3792,7 +3815,8 @@ export const withConstantInput: {
3792
3815
  * of any type, and translates them to updates with the specified constant
3793
3816
  * update value.
3794
3817
  *
3795
- * @example
3818
+ * **Example** (Ignoring inputs with a constant value)
3819
+ *
3796
3820
  * ```ts
3797
3821
  * import { Data, Effect, Metric } from "effect"
3798
3822
  *
@@ -3819,8 +3843,8 @@ export const withConstantInput: {
3819
3843
  * })
3820
3844
  * ```
3821
3845
  *
3822
- * @since 2.0.0
3823
3846
  * @category Input
3847
+ * @since 2.0.0
3824
3848
  */
3825
3849
  <Input, State>(self: Metric<Input, State>, input: Input) => Metric<unknown, State>
3826
3850
  >(2, (self, input) => mapInput(self, () => input))
@@ -3832,7 +3856,8 @@ export const withConstantInput: {
3832
3856
  * enabling filtering, grouping, and more detailed analysis. Each combination
3833
3857
  * of attribute values creates a separate metric series.
3834
3858
  *
3835
- * @example
3859
+ * **Example** (Applying metric attributes)
3860
+ *
3836
3861
  * ```ts
3837
3862
  * import { Effect, Metric } from "effect"
3838
3863
  *
@@ -3877,8 +3902,8 @@ export const withConstantInput: {
3877
3902
  * })
3878
3903
  * ```
3879
3904
  *
3880
- * @since 4.0.0
3881
3905
  * @category Attributes
3906
+ * @since 4.0.0
3882
3907
  */
3883
3908
  export const withAttributes: {
3884
3909
  /**
@@ -3888,7 +3913,8 @@ export const withAttributes: {
3888
3913
  * enabling filtering, grouping, and more detailed analysis. Each combination
3889
3914
  * of attribute values creates a separate metric series.
3890
3915
  *
3891
- * @example
3916
+ * **Example** (Applying metric attributes)
3917
+ *
3892
3918
  * ```ts
3893
3919
  * import { Effect, Metric } from "effect"
3894
3920
  *
@@ -3933,8 +3959,8 @@ export const withAttributes: {
3933
3959
  * })
3934
3960
  * ```
3935
3961
  *
3936
- * @since 4.0.0
3937
3962
  * @category Attributes
3963
+ * @since 4.0.0
3938
3964
  */
3939
3965
  (attributes: Metric.Attributes): <Input, State>(self: Metric<Input, State>) => Metric<Input, State>
3940
3966
  /**
@@ -3944,7 +3970,8 @@ export const withAttributes: {
3944
3970
  * enabling filtering, grouping, and more detailed analysis. Each combination
3945
3971
  * of attribute values creates a separate metric series.
3946
3972
  *
3947
- * @example
3973
+ * **Example** (Applying metric attributes)
3974
+ *
3948
3975
  * ```ts
3949
3976
  * import { Effect, Metric } from "effect"
3950
3977
  *
@@ -3989,8 +4016,8 @@ export const withAttributes: {
3989
4016
  * })
3990
4017
  * ```
3991
4018
  *
3992
- * @since 4.0.0
3993
4019
  * @category Attributes
4020
+ * @since 4.0.0
3994
4021
  */
3995
4022
  <Input, State>(self: Metric<Input, State>, attributes: Metric.Attributes): Metric<Input, State>
3996
4023
  } = dual<
@@ -4001,7 +4028,8 @@ export const withAttributes: {
4001
4028
  * enabling filtering, grouping, and more detailed analysis. Each combination
4002
4029
  * of attribute values creates a separate metric series.
4003
4030
  *
4004
- * @example
4031
+ * **Example** (Applying metric attributes)
4032
+ *
4005
4033
  * ```ts
4006
4034
  * import { Effect, Metric } from "effect"
4007
4035
  *
@@ -4046,8 +4074,8 @@ export const withAttributes: {
4046
4074
  * })
4047
4075
  * ```
4048
4076
  *
4049
- * @since 4.0.0
4050
4077
  * @category Attributes
4078
+ * @since 4.0.0
4051
4079
  */
4052
4080
  (attributes: Metric.Attributes) => <Input, State>(self: Metric<Input, State>) => Metric<Input, State>,
4053
4081
  /**
@@ -4057,7 +4085,8 @@ export const withAttributes: {
4057
4085
  * enabling filtering, grouping, and more detailed analysis. Each combination
4058
4086
  * of attribute values creates a separate metric series.
4059
4087
  *
4060
- * @example
4088
+ * **Example** (Applying metric attributes)
4089
+ *
4061
4090
  * ```ts
4062
4091
  * import { Effect, Metric } from "effect"
4063
4092
  *
@@ -4102,8 +4131,8 @@ export const withAttributes: {
4102
4131
  * })
4103
4132
  * ```
4104
4133
  *
4105
- * @since 4.0.0
4106
4134
  * @category Attributes
4135
+ * @since 4.0.0
4107
4136
  */
4108
4137
  <Input, State>(self: Metric<Input, State>, attributes: Metric.Attributes) => Metric<Input, State>
4109
4138
  >(2, <Input, State>(
@@ -4125,7 +4154,8 @@ export const withAttributes: {
4125
4154
  * Returns an array of metric snapshots, each containing the metric's metadata
4126
4155
  * (name, description, type) and current state (values, counts, etc.).
4127
4156
  *
4128
- * @example
4157
+ * **Example** (Capturing metric snapshots)
4158
+ *
4129
4159
  * ```ts
4130
4160
  * import { Console, Data, Effect, Metric } from "effect"
4131
4161
  *
@@ -4164,8 +4194,8 @@ export const withAttributes: {
4164
4194
  * })
4165
4195
  * ```
4166
4196
  *
4167
- * @since 2.0.0
4168
4197
  * @category Snapshotting
4198
+ * @since 2.0.0
4169
4199
  */
4170
4200
  export const snapshot: Effect<ReadonlyArray<Metric.Snapshot>> = InternalEffect.map(
4171
4201
  InternalEffect.context(),
@@ -4180,7 +4210,8 @@ export const snapshot: Effect<ReadonlyArray<Metric.Snapshot>> = InternalEffect.m
4180
4210
  * in an easy-to-read table showing names, descriptions, types, attributes,
4181
4211
  * and current state values.
4182
4212
  *
4183
- * @example
4213
+ * **Example** (Dumping metrics as text)
4214
+ *
4184
4215
  * ```ts
4185
4216
  * import { Console, Data, Effect, Metric } from "effect"
4186
4217
  *
@@ -4223,8 +4254,8 @@ export const snapshot: Effect<ReadonlyArray<Metric.Snapshot>> = InternalEffect.m
4223
4254
  * })
4224
4255
  * ```
4225
4256
  *
4226
- * @since 2.0.0
4227
4257
  * @category Debugging
4258
+ * @since 2.0.0
4228
4259
  */
4229
4260
  export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.context(), (context) => {
4230
4261
  const metrics = snapshotUnsafe(context)
@@ -4269,7 +4300,8 @@ export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.contex
4269
4300
  * manual handling of the services context. Use the safe `snapshot` function for normal
4270
4301
  * application code.
4271
4302
  *
4272
- * @example
4303
+ * **Example** (Capturing snapshots from a context)
4304
+ *
4273
4305
  * ```ts
4274
4306
  * import { Data, Effect, Metric } from "effect"
4275
4307
  *
@@ -4296,13 +4328,14 @@ export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.contex
4296
4328
  *
4297
4329
  * // Use snapshotUnsafe for direct, synchronous access
4298
4330
  * const snapshots = Metric.snapshotUnsafe(services)
4331
+ * const exportBatchCreatedAt = 1_700_000_000_000
4299
4332
  *
4300
4333
  * // Process snapshots immediately (useful for exporters, debugging tools)
4301
4334
  * const exportData = snapshots.map((snapshot) => ({
4302
4335
  * name: snapshot.id,
4303
4336
  * type: snapshot.type,
4304
4337
  * value: snapshot.state,
4305
- * timestamp: Date.now()
4338
+ * timestamp: exportBatchCreatedAt
4306
4339
  * }))
4307
4340
  *
4308
4341
  * // This is synchronous and doesn't involve Effect overhead
@@ -4318,8 +4351,8 @@ export const dump: Effect<string> = InternalEffect.flatMap(InternalEffect.contex
4318
4351
  * })
4319
4352
  * ```
4320
4353
  *
4321
- * @since 2.0.0
4322
4354
  * @category Snapshotting
4355
+ * @since 2.0.0
4323
4356
  */
4324
4357
  export const snapshotUnsafe = (context: Context.Context<never>): ReadonlyArray<Metric.Snapshot> => {
4325
4358
  const registry = Context.get(context, MetricRegistry)
@@ -4398,7 +4431,8 @@ const attributesToString = (attributes: Metric.AttributeSet): string => {
4398
4431
  * non-positive values, and automatically appending positive infinity as the
4399
4432
  * final boundary.
4400
4433
  *
4401
- * @example
4434
+ * **Example** (Creating boundaries from values)
4435
+ *
4402
4436
  * ```ts
4403
4437
  * import { Data, Effect, Metric } from "effect"
4404
4438
  *
@@ -4452,20 +4486,24 @@ const attributesToString = (attributes: Metric.AttributeSet): string => {
4452
4486
  * })
4453
4487
  * ```
4454
4488
  *
4455
- * @since 2.0.0
4456
4489
  * @category Boundaries
4490
+ * @since 2.0.0
4457
4491
  */
4458
4492
  export const boundariesFromIterable = (iterable: Iterable<number>): ReadonlyArray<number> =>
4459
4493
  Arr.append(Arr.filter(new Set(iterable), (n) => n > 0), Number.POSITIVE_INFINITY)
4460
4494
 
4461
4495
  /**
4462
- * A helper method to create histogram bucket boundaries with linearly
4463
- * increasing values.
4496
+ * Creates histogram bucket boundaries from a linear sequence and appends
4497
+ * positive infinity.
4498
+ *
4499
+ * **Details**
4500
+ * Generates `count - 1` finite boundaries using `start + width + index` for
4501
+ * each zero-based index, then applies the same normalization as
4502
+ * `boundariesFromIterable`: non-positive values are removed, duplicates are
4503
+ * collapsed, and `Infinity` is appended.
4464
4504
  *
4465
- * Creates evenly-spaced boundaries starting from a base value and incrementing
4466
- * by a fixed width. Automatically adds positive infinity as the final boundary.
4505
+ * **Example** (Creating linear boundaries)
4467
4506
  *
4468
- * @example
4469
4507
  * ```ts
4470
4508
  * import { Data, Effect, Metric } from "effect"
4471
4509
  *
@@ -4474,13 +4512,12 @@ export const boundariesFromIterable = (iterable: Iterable<number>): ReadonlyArra
4474
4512
  * }> {}
4475
4513
  *
4476
4514
  * // Create boundaries for response time histogram
4477
- * // Buckets: 0-100ms, 100-200ms, 200-300ms, 300-400ms, 400ms+
4478
4515
  * const responseBoundaries = Metric.linearBoundaries({
4479
4516
  * start: 0, // Starting point
4480
- * width: 100, // 100ms intervals
4517
+ * width: 100, // Offset used for the first boundary
4481
4518
  * count: 5 // Creates 4 boundaries + infinity
4482
4519
  * })
4483
- * console.log(responseBoundaries) // [100, 200, 300, 400, Infinity]
4520
+ * console.log(responseBoundaries) // [100, 101, 102, 103, Infinity]
4484
4521
  *
4485
4522
  * // Create a histogram using these boundaries
4486
4523
  * const responseTimeHistogram = Metric.histogram("api_response_time", {
@@ -4490,17 +4527,17 @@ export const boundariesFromIterable = (iterable: Iterable<number>): ReadonlyArra
4490
4527
  *
4491
4528
  * const program = Effect.gen(function*() {
4492
4529
  * // Record some response times
4493
- * yield* Metric.update(responseTimeHistogram, 85) // Goes in 0-100ms bucket
4494
- * yield* Metric.update(responseTimeHistogram, 250) // Goes in 200-300ms bucket
4495
- * yield* Metric.update(responseTimeHistogram, 450) // Goes in 400ms+ bucket
4530
+ * yield* Metric.update(responseTimeHistogram, 85)
4531
+ * yield* Metric.update(responseTimeHistogram, 101)
4532
+ * yield* Metric.update(responseTimeHistogram, 450)
4496
4533
  *
4497
4534
  * const value = yield* Metric.value(responseTimeHistogram)
4498
4535
  * return value
4499
4536
  * })
4500
4537
  * ```
4501
4538
  *
4502
- * @since 2.0.0
4503
4539
  * @category Boundaries
4540
+ * @since 2.0.0
4504
4541
  */
4505
4542
  export const linearBoundaries = (options: {
4506
4543
  readonly start: number
@@ -4516,7 +4553,8 @@ export const linearBoundaries = (options: {
4516
4553
  * Creates boundaries that grow exponentially, useful for metrics that span
4517
4554
  * multiple orders of magnitude. Each boundary is calculated as start * factor^i.
4518
4555
  *
4519
- * @example
4556
+ * **Example** (Creating exponential boundaries)
4557
+ *
4520
4558
  * ```ts
4521
4559
  * import { Data, Effect, Metric } from "effect"
4522
4560
  *
@@ -4557,8 +4595,8 @@ export const linearBoundaries = (options: {
4557
4595
  * })
4558
4596
  * ```
4559
4597
  *
4560
- * @since 2.0.0
4561
4598
  * @category Boundaries
4599
+ * @since 2.0.0
4562
4600
  */
4563
4601
  export const exponentialBoundaries = (options: {
4564
4602
  readonly start: number
@@ -4588,7 +4626,8 @@ const fiberFailures = counter("child_fiber_failures", {
4588
4626
  /**
4589
4627
  * Service key for the fiber runtime metrics service.
4590
4628
  *
4591
- * @example
4629
+ * **Example** (Using the fiber runtime metrics key)
4630
+ *
4592
4631
  * ```ts
4593
4632
  * import { Data, Effect, Layer, Metric } from "effect"
4594
4633
  *
@@ -4618,8 +4657,8 @@ const fiberFailures = counter("child_fiber_failures", {
4618
4657
  * })
4619
4658
  * ```
4620
4659
  *
4621
- * @since 4.0.0
4622
4660
  * @category Runtime Metrics
4661
+ * @since 4.0.0
4623
4662
  */
4624
4663
  export const FiberRuntimeMetricsKey: "effect/observability/Metric/FiberRuntimeMetricsKey" =
4625
4664
  InternalMetric.FiberRuntimeMetricsKey
@@ -4627,7 +4666,8 @@ export const FiberRuntimeMetricsKey: "effect/observability/Metric/FiberRuntimeMe
4627
4666
  /**
4628
4667
  * Interface for the fiber runtime metrics service that tracks fiber lifecycle events.
4629
4668
  *
4630
- * @example
4669
+ * **Example** (Providing a custom fiber metrics service)
4670
+ *
4631
4671
  * ```ts
4632
4672
  * import type { Context } from "effect"
4633
4673
  * import { Data, Effect, Layer, Metric } from "effect"
@@ -4660,8 +4700,8 @@ export const FiberRuntimeMetricsKey: "effect/observability/Metric/FiberRuntimeMe
4660
4700
  * })
4661
4701
  * ```
4662
4702
  *
4663
- * @since 4.0.0
4664
4703
  * @category Runtime Metrics
4704
+ * @since 4.0.0
4665
4705
  */
4666
4706
  export interface FiberRuntimeMetricsService {
4667
4707
  readonly recordFiberStart: (context: Context.Context<never>) => void
@@ -4669,9 +4709,15 @@ export interface FiberRuntimeMetricsService {
4669
4709
  }
4670
4710
 
4671
4711
  /**
4672
- * Service class for managing fiber runtime metrics collection.
4712
+ * `Context.Reference` for the optional fiber runtime metrics service.
4713
+ *
4714
+ * **Details**
4715
+ * When provided, the runtime can notify the service about child-fiber start and
4716
+ * end events. When the reference is `undefined`, automatic fiber runtime metric
4717
+ * collection is disabled.
4718
+ *
4719
+ * **Example** (Accessing the fiber runtime metrics service)
4673
4720
  *
4674
- * @example
4675
4721
  * ```ts
4676
4722
  * import { Data, Effect, Metric } from "effect"
4677
4723
  *
@@ -4710,8 +4756,8 @@ export interface FiberRuntimeMetricsService {
4710
4756
  * })
4711
4757
  * ```
4712
4758
  *
4713
- * @since 4.0.0
4714
4759
  * @category Runtime Metrics
4760
+ * @since 4.0.0
4715
4761
  */
4716
4762
  export const FiberRuntimeMetrics = Context.Reference<FiberRuntimeMetricsService | undefined>(
4717
4763
  InternalMetric.FiberRuntimeMetricsKey,
@@ -4721,7 +4767,8 @@ export const FiberRuntimeMetrics = Context.Reference<FiberRuntimeMetricsService
4721
4767
  /**
4722
4768
  * Default implementation of the fiber runtime metrics service.
4723
4769
  *
4724
- * @example
4770
+ * **Example** (Using the default fiber metrics implementation)
4771
+ *
4725
4772
  * ```ts
4726
4773
  * import { Data, Effect, Layer, Metric } from "effect"
4727
4774
  *
@@ -4759,8 +4806,8 @@ export const FiberRuntimeMetrics = Context.Reference<FiberRuntimeMetricsService
4759
4806
  * })
4760
4807
  * ```
4761
4808
  *
4762
- * @since 4.0.0
4763
4809
  * @category Runtime Metrics
4810
+ * @since 4.0.0
4764
4811
  */
4765
4812
  export const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService = {
4766
4813
  recordFiberStart(context: Context.Context<never>) {
@@ -4786,7 +4833,8 @@ export const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService = {
4786
4833
  * the recommended approach for production applications that need comprehensive
4787
4834
  * fiber monitoring.
4788
4835
  *
4789
- * @example
4836
+ * **Example** (Enabling runtime metrics with a layer)
4837
+ *
4790
4838
  * ```ts
4791
4839
  * import { Console, Data, Effect, Layer, Metric } from "effect"
4792
4840
  *
@@ -4871,15 +4919,16 @@ export const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService = {
4871
4919
  * )
4872
4920
  * ```
4873
4921
  *
4874
- * @since 4.0.0
4875
4922
  * @category Runtime Metrics
4923
+ * @since 4.0.0
4876
4924
  */
4877
4925
  export const enableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(FiberRuntimeMetricsImpl)
4878
4926
 
4879
4927
  /**
4880
4928
  * A Layer that disables automatic collection of fiber runtime metrics.
4881
4929
  *
4882
- * @example
4930
+ * **Example** (Disabling runtime metrics with a layer)
4931
+ *
4883
4932
  * ```ts
4884
4933
  * import { Data, Effect, Metric } from "effect"
4885
4934
  *
@@ -4911,8 +4960,8 @@ export const enableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(Fibe
4911
4960
  * })
4912
4961
  * ```
4913
4962
  *
4914
- * @since 4.0.0
4915
4963
  * @category Runtime Metrics
4964
+ * @since 4.0.0
4916
4965
  */
4917
4966
  export const disableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(undefined)
4918
4967
 
@@ -4923,7 +4972,8 @@ export const disableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(und
4923
4972
  * started fibers, successful completions, and failures. These metrics provide valuable
4924
4973
  * insights into the concurrency patterns and health of your Effect application.
4925
4974
  *
4926
- * @example
4975
+ * **Example** (Enabling runtime metrics for an effect)
4976
+ *
4927
4977
  * ```ts
4928
4978
  * import { Console, Data, Effect, Layer, Metric } from "effect"
4929
4979
  *
@@ -4992,8 +5042,8 @@ export const disableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(und
4992
5042
  * )
4993
5043
  * ```
4994
5044
  *
4995
- * @since 4.0.0
4996
5045
  * @category Runtime Metrics
5046
+ * @since 4.0.0
4997
5047
  */
4998
5048
  export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R> = InternalEffect.provideService(
4999
5049
  FiberRuntimeMetrics,
@@ -5007,7 +5057,8 @@ export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A,
5007
5057
  * parts of your application while keeping them enabled elsewhere, or when you need
5008
5058
  * to avoid the overhead of metrics collection in performance-critical sections.
5009
5059
  *
5010
- * @example
5060
+ * **Example** (Disabling runtime metrics for an effect)
5061
+ *
5011
5062
  * ```ts
5012
5063
  * import { Console, Data, Effect, Layer, Metric } from "effect"
5013
5064
  *
@@ -5035,7 +5086,7 @@ export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A,
5035
5086
  * (_, i) =>
5036
5087
  * Effect.gen(function*() {
5037
5088
  * // Simulate intensive computation
5038
- * const result = i * i + Math.random()
5089
+ * const result = i * i + (i % 10) / 10
5039
5090
  * return result
5040
5091
  * })
5041
5092
  * )
@@ -5077,8 +5128,8 @@ export const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A,
5077
5128
  * )
5078
5129
  * ```
5079
5130
  *
5080
- * @since 4.0.0
5081
5131
  * @category Runtime Metrics
5132
+ * @since 4.0.0
5082
5133
  */
5083
5134
  export const disableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R> = InternalEffect.provideService(
5084
5135
  FiberRuntimeMetrics,