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/Graph.ts CHANGED
@@ -1,4 +1,54 @@
1
1
  /**
2
+ * The `Graph` module provides immutable and scoped-mutable graph data
3
+ * structures for modeling relationships between indexed nodes and edges. A
4
+ * graph can be directed or undirected, stores user-defined data on both nodes
5
+ * and edges, and exposes traversal, analysis, path finding, transformation, and
6
+ * diagram export utilities.
7
+ *
8
+ * **Mental model**
9
+ *
10
+ * - Nodes and edges are addressed by stable numeric indices: {@link NodeIndex}
11
+ * and {@link EdgeIndex}
12
+ * - Node data has type `N`; edge data has type `E`
13
+ * - {@link Graph} values are immutable snapshots; use {@link MutableGraph}
14
+ * through {@link mutate}, {@link beginMutation}, or constructor callbacks to
15
+ * add, remove, or update nodes and edges
16
+ * - Directed graphs follow edge direction for neighbors and traversals, while
17
+ * undirected graphs treat each edge as connecting both endpoints
18
+ * - Missing lookups return `Option`, while structurally invalid operations such
19
+ * as adding an edge to a missing node throw {@link GraphError}
20
+ *
21
+ * **Common tasks**
22
+ *
23
+ * - Create graphs: {@link directed}, {@link undirected}
24
+ * - Mutate safely: {@link mutate}, {@link addNode}, {@link addEdge},
25
+ * {@link removeNode}, {@link removeEdge}
26
+ * - Query contents: {@link getNode}, {@link getEdge}, {@link hasNode},
27
+ * {@link hasEdge}, {@link nodeCount}, {@link edgeCount}, {@link neighbors}
28
+ * - Transform data: {@link updateNode}, {@link updateEdge}, {@link mapNodes},
29
+ * {@link mapEdges}, {@link filterNodes}, {@link filterEdges},
30
+ * {@link filterMapNodes}, {@link filterMapEdges}
31
+ * - Traverse lazily: {@link dfs}, {@link bfs}, {@link topo},
32
+ * {@link dfsPostOrder}, {@link nodes}, {@link edges}, {@link Walker}
33
+ * - Analyze structure: {@link isAcyclic}, {@link isBipartite},
34
+ * {@link connectedComponents}, {@link stronglyConnectedComponents},
35
+ * {@link externals}
36
+ * - Find paths: {@link dijkstra}, {@link astar}, {@link bellmanFord},
37
+ * {@link floydWarshall}
38
+ * - Export diagrams: {@link toGraphViz}, {@link toMermaid}
39
+ *
40
+ * **Gotchas**
41
+ *
42
+ * - Only mutable graphs can be changed. Create one with {@link mutate} or by
43
+ * passing a callback to {@link directed} / {@link undirected}.
44
+ * - Traversal APIs return lazy {@link Walker} values. Use {@link indices},
45
+ * {@link values}, or {@link entries} to choose what each iteration yields.
46
+ * - `NodeIndex` and `EdgeIndex` values are identifiers, not array offsets. They
47
+ * are not reused after removals.
48
+ * - Shortest-path algorithms require a cost function. {@link dijkstra} and
49
+ * {@link astar} reject negative weights; use {@link bellmanFord} or
50
+ * {@link floydWarshall} when negative weights are part of the model.
51
+ *
2
52
  * @since 4.0.0
3
53
  */
4
54
 
@@ -19,24 +69,24 @@ const TypeId = "~effect/collections/Graph"
19
69
  /**
20
70
  * Node index for node identification using plain numbers.
21
71
  *
22
- * @since 4.0.0
23
72
  * @category models
73
+ * @since 4.0.0
24
74
  */
25
75
  export type NodeIndex = number
26
76
 
27
77
  /**
28
78
  * Edge index for edge identification using plain numbers.
29
79
  *
30
- * @since 4.0.0
31
80
  * @category models
81
+ * @since 4.0.0
32
82
  */
33
83
  export type EdgeIndex = number
34
84
 
35
85
  /**
36
86
  * Edge data containing source, target, and user data.
37
87
  *
38
- * @since 4.0.0
39
88
  * @category models
89
+ * @since 4.0.0
40
90
  */
41
91
  export class Edge<E> extends Data.Class<{
42
92
  readonly source: NodeIndex
@@ -47,16 +97,21 @@ export class Edge<E> extends Data.Class<{
47
97
  /**
48
98
  * Graph type for distinguishing directed and undirected graphs.
49
99
  *
50
- * @since 4.0.0
51
100
  * @category models
101
+ * @since 4.0.0
52
102
  */
53
103
  export type Kind = "directed" | "undirected"
54
104
 
55
105
  /**
56
- * Graph prototype interface.
106
+ * Common structural interface shared by immutable and mutable graphs.
107
+ *
108
+ * **Details**
109
+ *
110
+ * Contains the node and edge maps, adjacency indexes, allocation counters, and
111
+ * shared protocols used by both `Graph` and `MutableGraph`.
57
112
  *
58
- * @since 4.0.0
59
113
  * @category models
114
+ * @since 4.0.0
60
115
  */
61
116
  export interface Proto<out N, out E> extends Iterable<readonly [NodeIndex, N]>, Equal.Equal, Pipeable, Inspectable {
62
117
  readonly [TypeId]: typeof TypeId
@@ -72,8 +127,8 @@ export interface Proto<out N, out E> extends Iterable<readonly [NodeIndex, N]>,
72
127
  /**
73
128
  * Immutable graph interface.
74
129
  *
75
- * @since 4.0.0
76
130
  * @category models
131
+ * @since 4.0.0
77
132
  */
78
133
  export interface Graph<out N, out E, T extends Kind = "directed"> extends Proto<N, E> {
79
134
  readonly type: T
@@ -83,8 +138,8 @@ export interface Graph<out N, out E, T extends Kind = "directed"> extends Proto<
83
138
  /**
84
139
  * Mutable graph interface.
85
140
  *
86
- * @since 4.0.0
87
141
  * @category models
142
+ * @since 4.0.0
88
143
  */
89
144
  export interface MutableGraph<out N, out E, T extends Kind = "directed"> extends Proto<N, E> {
90
145
  readonly type: T
@@ -94,32 +149,32 @@ export interface MutableGraph<out N, out E, T extends Kind = "directed"> extends
94
149
  /**
95
150
  * Directed graph type alias.
96
151
  *
97
- * @since 4.0.0
98
152
  * @category models
153
+ * @since 4.0.0
99
154
  */
100
155
  export type DirectedGraph<N, E> = Graph<N, E, "directed">
101
156
 
102
157
  /**
103
158
  * Undirected graph type alias.
104
159
  *
105
- * @since 4.0.0
106
160
  * @category models
161
+ * @since 4.0.0
107
162
  */
108
163
  export type UndirectedGraph<N, E> = Graph<N, E, "undirected">
109
164
 
110
165
  /**
111
166
  * Mutable directed graph type alias.
112
167
  *
113
- * @since 4.0.0
114
168
  * @category models
169
+ * @since 4.0.0
115
170
  */
116
171
  export type MutableDirectedGraph<N, E> = MutableGraph<N, E, "directed">
117
172
 
118
173
  /**
119
174
  * Mutable undirected graph type alias.
120
175
  *
121
- * @since 4.0.0
122
176
  * @category models
177
+ * @since 4.0.0
123
178
  */
124
179
  export type MutableUndirectedGraph<N, E> = MutableGraph<N, E, "undirected">
125
180
 
@@ -205,8 +260,12 @@ const ProtoGraph = {
205
260
  // TODO: Do we need safe variants for these?
206
261
 
207
262
  /**
208
- * @since 4.0.0
263
+ * Error thrown by graph operations when the requested graph structure is
264
+ * invalid, such as referencing a missing node or using unsupported edge
265
+ * weights.
266
+ *
209
267
  * @category errors
268
+ * @since 4.0.0
210
269
  */
211
270
  export class GraphError extends Data.TaggedError("GraphError")<{
212
271
  readonly message: string
@@ -220,15 +279,19 @@ const missingNode = (node: number) => new GraphError({ message: `Node ${node} do
220
279
  // =============================================================================
221
280
 
222
281
  /**
223
- * @since 4.0.0
282
+ * Returns `true` if a value has the graph runtime type identifier, narrowing
283
+ * it to a `Graph`.
284
+ *
224
285
  * @category Guards
286
+ * @since 4.0.0
225
287
  */
226
288
  export const isGraph = (u: unknown): u is Graph<unknown, unknown> => hasProperty(u, TypeId)
227
289
 
228
290
  /**
229
291
  * Creates a directed graph, optionally with initial mutations.
230
292
  *
231
- * @example
293
+ * **Example** (Creating a directed graph)
294
+ *
232
295
  * ```ts
233
296
  * import { Graph } from "effect"
234
297
  *
@@ -242,8 +305,8 @@ export const isGraph = (u: unknown): u is Graph<unknown, unknown> => hasProperty
242
305
  * })
243
306
  * ```
244
307
  *
245
- * @since 4.0.0
246
308
  * @category constructors
309
+ * @since 4.0.0
247
310
  */
248
311
  export const directed = <N, E>(mutate?: (mutable: MutableDirectedGraph<N, E>) => void): DirectedGraph<N, E> => {
249
312
  const graph: Mutable<DirectedGraph<N, E>> = Object.create(ProtoGraph)
@@ -269,7 +332,8 @@ export const directed = <N, E>(mutate?: (mutable: MutableDirectedGraph<N, E>) =>
269
332
  /**
270
333
  * Creates an undirected graph, optionally with initial mutations.
271
334
  *
272
- * @example
335
+ * **Example** (Creating an undirected graph)
336
+ *
273
337
  * ```ts
274
338
  * import { Graph } from "effect"
275
339
  *
@@ -283,8 +347,8 @@ export const directed = <N, E>(mutate?: (mutable: MutableDirectedGraph<N, E>) =>
283
347
  * })
284
348
  * ```
285
349
  *
286
- * @since 4.0.0
287
350
  * @category constructors
351
+ * @since 4.0.0
288
352
  */
289
353
  export const undirected = <N, E>(mutate?: (mutable: MutableUndirectedGraph<N, E>) => void): UndirectedGraph<N, E> => {
290
354
  const graph: Mutable<UndirectedGraph<N, E>> = Object.create(ProtoGraph)
@@ -314,7 +378,8 @@ export const undirected = <N, E>(mutate?: (mutable: MutableUndirectedGraph<N, E>
314
378
  /**
315
379
  * Creates a mutable scope for safe graph mutations by copying the data structure.
316
380
  *
317
- * @example
381
+ * **Example** (Beginning a mutation scope)
382
+ *
318
383
  * ```ts
319
384
  * import { Graph } from "effect"
320
385
  *
@@ -323,8 +388,8 @@ export const undirected = <N, E>(mutate?: (mutable: MutableUndirectedGraph<N, E>
323
388
  * // Now mutable can be safely modified without affecting original graph
324
389
  * ```
325
390
  *
326
- * @since 4.0.0
327
391
  * @category mutations
392
+ * @since 4.0.0
328
393
  */
329
394
  export const beginMutation = <N, E, T extends Kind = "directed">(
330
395
  graph: Graph<N, E, T>
@@ -358,7 +423,8 @@ export const beginMutation = <N, E, T extends Kind = "directed">(
358
423
  /**
359
424
  * Converts a mutable graph back to an immutable graph, ending the mutation scope.
360
425
  *
361
- * @example
426
+ * **Example** (Ending a mutation scope)
427
+ *
362
428
  * ```ts
363
429
  * import { Graph } from "effect"
364
430
  *
@@ -368,8 +434,8 @@ export const beginMutation = <N, E, T extends Kind = "directed">(
368
434
  * const newGraph = Graph.endMutation(mutable)
369
435
  * ```
370
436
  *
371
- * @since 4.0.0
372
437
  * @category mutations
438
+ * @since 4.0.0
373
439
  */
374
440
  export const endMutation = <N, E, T extends Kind = "directed">(
375
441
  mutable: MutableGraph<N, E, T>
@@ -391,55 +457,70 @@ export const endMutation = <N, E, T extends Kind = "directed">(
391
457
  /**
392
458
  * Performs scoped mutations on a graph, automatically managing the mutation lifecycle.
393
459
  *
394
- * @example
460
+ * **Example** (Applying scoped mutations)
461
+ *
395
462
  * ```ts
396
463
  * import { Graph } from "effect"
397
464
  *
398
465
  * const graph = Graph.directed<string, number>()
399
466
  * const newGraph = Graph.mutate(graph, (mutable) => {
400
- * // Safe mutations go here
401
- * // mutable gets automatically converted back to immutable
467
+ * const nodeA = Graph.addNode(mutable, "A")
468
+ * const nodeB = Graph.addNode(mutable, "B")
469
+ * Graph.addEdge(mutable, nodeA, nodeB, 1)
402
470
  * })
471
+ *
472
+ * console.log(Graph.nodeCount(newGraph)) // 2
473
+ * console.log(Graph.edgeCount(newGraph)) // 1
403
474
  * ```
404
475
  *
405
- * @since 4.0.0
406
476
  * @category mutations
477
+ * @since 4.0.0
407
478
  */
408
479
  export const mutate: {
409
480
  /**
410
481
  * Performs scoped mutations on a graph, automatically managing the mutation lifecycle.
411
482
  *
412
- * @example
483
+ * **Example** (Applying scoped mutations)
484
+ *
413
485
  * ```ts
414
486
  * import { Graph } from "effect"
415
487
  *
416
488
  * const graph = Graph.directed<string, number>()
417
489
  * const newGraph = Graph.mutate(graph, (mutable) => {
418
- * // Safe mutations go here
419
- * // mutable gets automatically converted back to immutable
490
+ * const nodeA = Graph.addNode(mutable, "A")
491
+ * const nodeB = Graph.addNode(mutable, "B")
492
+ * Graph.addEdge(mutable, nodeA, nodeB, 1)
420
493
  * })
494
+ *
495
+ * console.log(Graph.nodeCount(newGraph)) // 2
496
+ * console.log(Graph.edgeCount(newGraph)) // 1
421
497
  * ```
422
498
  *
423
- * @since 4.0.0
424
499
  * @category mutations
500
+ * @since 4.0.0
425
501
  */
426
502
  <N, E, T extends Kind = "directed">(f: (mutable: MutableGraph<N, E, T>) => void): (graph: Graph<N, E, T>) => Graph<N, E, T>
427
503
  /**
428
504
  * Performs scoped mutations on a graph, automatically managing the mutation lifecycle.
429
505
  *
430
- * @example
506
+ * **Example** (Applying scoped mutations)
507
+ *
431
508
  * ```ts
432
509
  * import { Graph } from "effect"
433
510
  *
434
511
  * const graph = Graph.directed<string, number>()
435
512
  * const newGraph = Graph.mutate(graph, (mutable) => {
436
- * // Safe mutations go here
437
- * // mutable gets automatically converted back to immutable
513
+ * const nodeA = Graph.addNode(mutable, "A")
514
+ * const nodeB = Graph.addNode(mutable, "B")
515
+ * Graph.addEdge(mutable, nodeA, nodeB, 1)
438
516
  * })
517
+ *
518
+ * console.log(Graph.nodeCount(newGraph)) // 2
519
+ * console.log(Graph.edgeCount(newGraph)) // 1
439
520
  * ```
440
521
  *
441
- * @since 4.0.0
442
522
  * @category mutations
523
+ * @since 4.0.0
443
524
  */
444
525
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T>, f: (mutable: MutableGraph<N, E, T>) => void): Graph<N, E, T>
445
526
  } = dual(2, <N, E, T extends Kind = "directed">(
@@ -458,7 +539,8 @@ export const mutate: {
458
539
  /**
459
540
  * Adds a new node to a mutable graph and returns its index.
460
541
  *
461
- * @example
542
+ * **Example** (Adding nodes)
543
+ *
462
544
  * ```ts
463
545
  * import { Graph } from "effect"
464
546
  *
@@ -470,8 +552,8 @@ export const mutate: {
470
552
  * })
471
553
  * ```
472
554
  *
473
- * @since 4.0.0
474
555
  * @category mutations
556
+ * @since 4.0.0
475
557
  */
476
558
  export const addNode = <N, E, T extends Kind = "directed">(
477
559
  mutable: MutableGraph<N, E, T>,
@@ -495,7 +577,8 @@ export const addNode = <N, E, T extends Kind = "directed">(
495
577
  /**
496
578
  * Gets the data associated with a node index, if it exists.
497
579
  *
498
- * @example
580
+ * **Example** (Getting node data)
581
+ *
499
582
  * ```ts
500
583
  * import { Graph } from "effect"
501
584
  * import * as Option from "effect/Option"
@@ -512,14 +595,15 @@ export const addNode = <N, E, T extends Kind = "directed">(
512
595
  * }
513
596
  * ```
514
597
  *
515
- * @since 4.0.0
516
598
  * @category getters
599
+ * @since 4.0.0
517
600
  */
518
601
  export const getNode: {
519
602
  /**
520
603
  * Gets the data associated with a node index, if it exists.
521
604
  *
522
- * @example
605
+ * **Example** (Getting node data)
606
+ *
523
607
  * ```ts
524
608
  * import { Graph } from "effect"
525
609
  * import * as Option from "effect/Option"
@@ -536,14 +620,15 @@ export const getNode: {
536
620
  * }
537
621
  * ```
538
622
  *
539
- * @since 4.0.0
540
623
  * @category getters
624
+ * @since 4.0.0
541
625
  */
542
626
  <N, E, T extends Kind = "directed">(nodeIndex: NodeIndex): (graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<N>
543
627
  /**
544
628
  * Gets the data associated with a node index, if it exists.
545
629
  *
546
- * @example
630
+ * **Example** (Getting node data)
631
+ *
547
632
  * ```ts
548
633
  * import { Graph } from "effect"
549
634
  * import * as Option from "effect/Option"
@@ -560,8 +645,8 @@ export const getNode: {
560
645
  * }
561
646
  * ```
562
647
  *
563
- * @since 4.0.0
564
648
  * @category getters
649
+ * @since 4.0.0
565
650
  */
566
651
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, nodeIndex: NodeIndex): Option.Option<N>
567
652
  } = dual(2, <N, E, T extends Kind = "directed">(
@@ -572,7 +657,8 @@ export const getNode: {
572
657
  /**
573
658
  * Checks if a node with the given index exists in the graph.
574
659
  *
575
- * @example
660
+ * **Example** (Checking node existence)
661
+ *
576
662
  * ```ts
577
663
  * import { Graph } from "effect"
578
664
  *
@@ -589,14 +675,15 @@ export const getNode: {
589
675
  * console.log(notExists) // false
590
676
  * ```
591
677
  *
592
- * @since 4.0.0
593
678
  * @category getters
679
+ * @since 4.0.0
594
680
  */
595
681
  export const hasNode: {
596
682
  /**
597
683
  * Checks if a node with the given index exists in the graph.
598
684
  *
599
- * @example
685
+ * **Example** (Checking node existence)
686
+ *
600
687
  * ```ts
601
688
  * import { Graph } from "effect"
602
689
  *
@@ -613,14 +700,15 @@ export const hasNode: {
613
700
  * console.log(notExists) // false
614
701
  * ```
615
702
  *
616
- * @since 4.0.0
617
703
  * @category getters
704
+ * @since 4.0.0
618
705
  */
619
706
  (nodeIndex: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => boolean
620
707
  /**
621
708
  * Checks if a node with the given index exists in the graph.
622
709
  *
623
- * @example
710
+ * **Example** (Checking node existence)
711
+ *
624
712
  * ```ts
625
713
  * import { Graph } from "effect"
626
714
  *
@@ -637,8 +725,8 @@ export const hasNode: {
637
725
  * console.log(notExists) // false
638
726
  * ```
639
727
  *
640
- * @since 4.0.0
641
728
  * @category getters
729
+ * @since 4.0.0
642
730
  */
643
731
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, nodeIndex: NodeIndex): boolean
644
732
  } = dual(2, <N, E, T extends Kind = "directed">(
@@ -649,7 +737,8 @@ export const hasNode: {
649
737
  /**
650
738
  * Returns the number of nodes in the graph.
651
739
  *
652
- * @example
740
+ * **Example** (Counting nodes)
741
+ *
653
742
  * ```ts
654
743
  * import { Graph } from "effect"
655
744
  *
@@ -665,8 +754,8 @@ export const hasNode: {
665
754
  * console.log(Graph.nodeCount(graphWithNodes)) // 3
666
755
  * ```
667
756
  *
668
- * @since 4.0.0
669
757
  * @category getters
758
+ * @since 4.0.0
670
759
  */
671
760
  export const nodeCount = <N, E, T extends Kind = "directed">(
672
761
  graph: Graph<N, E, T> | MutableGraph<N, E, T>
@@ -675,7 +764,8 @@ export const nodeCount = <N, E, T extends Kind = "directed">(
675
764
  /**
676
765
  * Finds the first node that matches the given predicate.
677
766
  *
678
- * @example
767
+ * **Example** (Finding the first matching node)
768
+ *
679
769
  * ```ts
680
770
  * import { Graph } from "effect"
681
771
  *
@@ -692,14 +782,15 @@ export const nodeCount = <N, E, T extends Kind = "directed">(
692
782
  * console.log(notFound) // Option.none()
693
783
  * ```
694
784
  *
695
- * @since 4.0.0
696
785
  * @category getters
786
+ * @since 4.0.0
697
787
  */
698
788
  export const findNode: {
699
789
  /**
700
790
  * Finds the first node that matches the given predicate.
701
791
  *
702
- * @example
792
+ * **Example** (Finding the first matching node)
793
+ *
703
794
  * ```ts
704
795
  * import { Graph } from "effect"
705
796
  *
@@ -716,14 +807,15 @@ export const findNode: {
716
807
  * console.log(notFound) // Option.none()
717
808
  * ```
718
809
  *
719
- * @since 4.0.0
720
810
  * @category getters
811
+ * @since 4.0.0
721
812
  */
722
813
  <N>(predicate: (data: N) => boolean): <E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<NodeIndex>
723
814
  /**
724
815
  * Finds the first node that matches the given predicate.
725
816
  *
726
- * @example
817
+ * **Example** (Finding the first matching node)
818
+ *
727
819
  * ```ts
728
820
  * import { Graph } from "effect"
729
821
  *
@@ -740,8 +832,8 @@ export const findNode: {
740
832
  * console.log(notFound) // Option.none()
741
833
  * ```
742
834
  *
743
- * @since 4.0.0
744
835
  * @category getters
836
+ * @since 4.0.0
745
837
  */
746
838
  <N, E, T extends Kind = "directed">(
747
839
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -762,7 +854,8 @@ export const findNode: {
762
854
  /**
763
855
  * Finds all nodes that match the given predicate.
764
856
  *
765
- * @example
857
+ * **Example** (Finding matching nodes)
858
+ *
766
859
  * ```ts
767
860
  * import { Graph } from "effect"
768
861
  *
@@ -779,14 +872,15 @@ export const findNode: {
779
872
  * console.log(empty) // []
780
873
  * ```
781
874
  *
782
- * @since 4.0.0
783
875
  * @category getters
876
+ * @since 4.0.0
784
877
  */
785
878
  export const findNodes: {
786
879
  /**
787
880
  * Finds all nodes that match the given predicate.
788
881
  *
789
- * @example
882
+ * **Example** (Finding matching nodes)
883
+ *
790
884
  * ```ts
791
885
  * import { Graph } from "effect"
792
886
  *
@@ -803,14 +897,15 @@ export const findNodes: {
803
897
  * console.log(empty) // []
804
898
  * ```
805
899
  *
806
- * @since 4.0.0
807
900
  * @category getters
901
+ * @since 4.0.0
808
902
  */
809
903
  <N>(predicate: (data: N) => boolean): <E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<NodeIndex>
810
904
  /**
811
905
  * Finds all nodes that match the given predicate.
812
906
  *
813
- * @example
907
+ * **Example** (Finding matching nodes)
908
+ *
814
909
  * ```ts
815
910
  * import { Graph } from "effect"
816
911
  *
@@ -827,8 +922,8 @@ export const findNodes: {
827
922
  * console.log(empty) // []
828
923
  * ```
829
924
  *
830
- * @since 4.0.0
831
925
  * @category getters
926
+ * @since 4.0.0
832
927
  */
833
928
  <N, E, T extends Kind = "directed">(
834
929
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -850,7 +945,8 @@ export const findNodes: {
850
945
  /**
851
946
  * Finds the first edge that matches the given predicate.
852
947
  *
853
- * @example
948
+ * **Example** (Finding the first matching edge)
949
+ *
854
950
  * ```ts
855
951
  * import { Graph } from "effect"
856
952
  *
@@ -869,14 +965,15 @@ export const findNodes: {
869
965
  * console.log(notFound) // Option.none()
870
966
  * ```
871
967
  *
872
- * @since 4.0.0
873
968
  * @category getters
969
+ * @since 4.0.0
874
970
  */
875
971
  export const findEdge: {
876
972
  /**
877
973
  * Finds the first edge that matches the given predicate.
878
974
  *
879
- * @example
975
+ * **Example** (Finding the first matching edge)
976
+ *
880
977
  * ```ts
881
978
  * import { Graph } from "effect"
882
979
  *
@@ -895,14 +992,15 @@ export const findEdge: {
895
992
  * console.log(notFound) // Option.none()
896
993
  * ```
897
994
  *
898
- * @since 4.0.0
899
995
  * @category getters
996
+ * @since 4.0.0
900
997
  */
901
998
  <E>(predicate: (data: E, source: NodeIndex, target: NodeIndex) => boolean): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<EdgeIndex>
902
999
  /**
903
1000
  * Finds the first edge that matches the given predicate.
904
1001
  *
905
- * @example
1002
+ * **Example** (Finding the first matching edge)
1003
+ *
906
1004
  * ```ts
907
1005
  * import { Graph } from "effect"
908
1006
  *
@@ -921,8 +1019,8 @@ export const findEdge: {
921
1019
  * console.log(notFound) // Option.none()
922
1020
  * ```
923
1021
  *
924
- * @since 4.0.0
925
1022
  * @category getters
1023
+ * @since 4.0.0
926
1024
  */
927
1025
  <N, E, T extends Kind = "directed">(
928
1026
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -943,7 +1041,8 @@ export const findEdge: {
943
1041
  /**
944
1042
  * Finds all edges that match the given predicate.
945
1043
  *
946
- * @example
1044
+ * **Example** (Finding matching edges)
1045
+ *
947
1046
  * ```ts
948
1047
  * import { Graph } from "effect"
949
1048
  *
@@ -963,14 +1062,15 @@ export const findEdge: {
963
1062
  * console.log(empty) // []
964
1063
  * ```
965
1064
  *
966
- * @since 4.0.0
967
1065
  * @category getters
1066
+ * @since 4.0.0
968
1067
  */
969
1068
  export const findEdges: {
970
1069
  /**
971
1070
  * Finds all edges that match the given predicate.
972
1071
  *
973
- * @example
1072
+ * **Example** (Finding matching edges)
1073
+ *
974
1074
  * ```ts
975
1075
  * import { Graph } from "effect"
976
1076
  *
@@ -990,14 +1090,15 @@ export const findEdges: {
990
1090
  * console.log(empty) // []
991
1091
  * ```
992
1092
  *
993
- * @since 4.0.0
994
1093
  * @category getters
1094
+ * @since 4.0.0
995
1095
  */
996
1096
  <E>(predicate: (data: E, source: NodeIndex, target: NodeIndex) => boolean): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<EdgeIndex>
997
1097
  /**
998
1098
  * Finds all edges that match the given predicate.
999
1099
  *
1000
- * @example
1100
+ * **Example** (Finding matching edges)
1101
+ *
1001
1102
  * ```ts
1002
1103
  * import { Graph } from "effect"
1003
1104
  *
@@ -1017,8 +1118,8 @@ export const findEdges: {
1017
1118
  * console.log(empty) // []
1018
1119
  * ```
1019
1120
  *
1020
- * @since 4.0.0
1021
1121
  * @category getters
1122
+ * @since 4.0.0
1022
1123
  */
1023
1124
  <N, E, T extends Kind = "directed">(
1024
1125
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -1040,7 +1141,8 @@ export const findEdges: {
1040
1141
  /**
1041
1142
  * Updates a single node's data by applying a transformation function.
1042
1143
  *
1043
- * @example
1144
+ * **Example** (Updating node data)
1145
+ *
1044
1146
  * ```ts
1045
1147
  * import { Graph } from "effect"
1046
1148
  *
@@ -1054,8 +1156,8 @@ export const findEdges: {
1054
1156
  * console.log(nodeData) // Option.some("NODE A")
1055
1157
  * ```
1056
1158
  *
1057
- * @since 4.0.0
1058
1159
  * @category transformations
1160
+ * @since 4.0.0
1059
1161
  */
1060
1162
  export const updateNode = <N, E, T extends Kind = "directed">(
1061
1163
  mutable: MutableGraph<N, E, T>,
@@ -1074,7 +1176,8 @@ export const updateNode = <N, E, T extends Kind = "directed">(
1074
1176
  /**
1075
1177
  * Updates a single edge's data by applying a transformation function.
1076
1178
  *
1077
- * @example
1179
+ * **Example** (Updating edge data)
1180
+ *
1078
1181
  * ```ts
1079
1182
  * import { Graph } from "effect"
1080
1183
  *
@@ -1086,11 +1189,11 @@ export const updateNode = <N, E, T extends Kind = "directed">(
1086
1189
  * })
1087
1190
  *
1088
1191
  * const edgeData = Graph.getEdge(result, 0)
1089
- * console.log(edgeData) // new Graph.Edge({ source: 0, target: 1, data: 20 })
1192
+ * console.log(edgeData) // Option.some(new Graph.Edge({ source: 0, target: 1, data: 20 }))
1090
1193
  * ```
1091
1194
  *
1092
- * @since 4.0.0
1093
1195
  * @category mutations
1196
+ * @since 4.0.0
1094
1197
  */
1095
1198
  export const updateEdge = <N, E, T extends Kind = "directed">(
1096
1199
  mutable: MutableGraph<N, E, T>,
@@ -1107,9 +1210,15 @@ export const updateEdge = <N, E, T extends Kind = "directed">(
1107
1210
  }
1108
1211
 
1109
1212
  /**
1110
- * Creates a new graph with transformed node data using the provided mapping function.
1213
+ * Transforms every node's data in a mutable graph in place using the provided
1214
+ * mapping function.
1215
+ *
1216
+ * **Details**
1217
+ *
1218
+ * Node indices and edges are preserved; only the stored node data is replaced.
1219
+ *
1220
+ * **Example** (Mapping node data)
1111
1221
  *
1112
- * @example
1113
1222
  * ```ts
1114
1223
  * import { Graph } from "effect"
1115
1224
  *
@@ -1121,11 +1230,11 @@ export const updateEdge = <N, E, T extends Kind = "directed">(
1121
1230
  * })
1122
1231
  *
1123
1232
  * const nodeData = Graph.getNode(graph, 0)
1124
- * console.log(nodeData) // new Graph.Node("NODE A")
1233
+ * console.log(nodeData) // Option.some("NODE A")
1125
1234
  * ```
1126
1235
  *
1127
- * @since 4.0.0
1128
1236
  * @category transformations
1237
+ * @since 4.0.0
1129
1238
  */
1130
1239
  export const mapNodes = <N, E, T extends Kind = "directed">(
1131
1240
  mutable: MutableGraph<N, E, T>,
@@ -1141,7 +1250,8 @@ export const mapNodes = <N, E, T extends Kind = "directed">(
1141
1250
  /**
1142
1251
  * Transforms all edge data in a mutable graph using the provided mapping function.
1143
1252
  *
1144
- * @example
1253
+ * **Example** (Mapping edge data)
1254
+ *
1145
1255
  * ```ts
1146
1256
  * import { Graph } from "effect"
1147
1257
  *
@@ -1155,11 +1265,11 @@ export const mapNodes = <N, E, T extends Kind = "directed">(
1155
1265
  * })
1156
1266
  *
1157
1267
  * const edgeData = Graph.getEdge(graph, 0)
1158
- * console.log(edgeData) // new Graph.Edge({ source: 0, target: 1, data: 20 })
1268
+ * console.log(edgeData) // Option.some(new Graph.Edge({ source: 0, target: 1, data: 20 }))
1159
1269
  * ```
1160
1270
  *
1161
- * @since 4.0.0
1162
1271
  * @category transformations
1272
+ * @since 4.0.0
1163
1273
  */
1164
1274
  export const mapEdges = <N, E, T extends Kind = "directed">(
1165
1275
  mutable: MutableGraph<N, E, T>,
@@ -1178,7 +1288,8 @@ export const mapEdges = <N, E, T extends Kind = "directed">(
1178
1288
  /**
1179
1289
  * Reverses all edge directions in a mutable graph by swapping source and target nodes.
1180
1290
  *
1181
- * @example
1291
+ * **Example** (Reversing edge directions)
1292
+ *
1182
1293
  * ```ts
1183
1294
  * import { Graph } from "effect"
1184
1295
  *
@@ -1192,11 +1303,11 @@ export const mapEdges = <N, E, T extends Kind = "directed">(
1192
1303
  * })
1193
1304
  *
1194
1305
  * const edge0 = Graph.getEdge(graph, 0)
1195
- * console.log(edge0) // new Graph.Edge({ source: 1, target: 0, data: 1 }) - B -> A
1306
+ * console.log(edge0) // Option.some(new Graph.Edge({ source: 1, target: 0, data: 1 }))
1196
1307
  * ```
1197
1308
  *
1198
- * @since 4.0.0
1199
1309
  * @category transformations
1310
+ * @since 4.0.0
1200
1311
  */
1201
1312
  export const reverse = <N, E, T extends Kind = "directed">(
1202
1313
  mutable: MutableGraph<N, E, T>
@@ -1238,7 +1349,8 @@ export const reverse = <N, E, T extends Kind = "directed">(
1238
1349
  * Filters and optionally transforms nodes in a mutable graph using a predicate function.
1239
1350
  * Nodes that return Option.none are removed along with all their connected edges.
1240
1351
  *
1241
- * @example
1352
+ * **Example** (Filtering and mapping nodes)
1353
+ *
1242
1354
  * ```ts
1243
1355
  * import { Graph } from "effect"
1244
1356
  * import * as Option from "effect/Option"
@@ -1261,8 +1373,8 @@ export const reverse = <N, E, T extends Kind = "directed">(
1261
1373
  * console.log(Graph.nodeCount(graph)) // 2 (only "active" nodes remain)
1262
1374
  * ```
1263
1375
  *
1264
- * @since 4.0.0
1265
1376
  * @category transformations
1377
+ * @since 4.0.0
1266
1378
  */
1267
1379
  export const filterMapNodes = <N, E, T extends Kind = "directed">(
1268
1380
  mutable: MutableGraph<N, E, T>,
@@ -1292,7 +1404,8 @@ export const filterMapNodes = <N, E, T extends Kind = "directed">(
1292
1404
  * Filters and optionally transforms edges in a mutable graph using a predicate function.
1293
1405
  * Edges that return Option.none are removed from the graph.
1294
1406
  *
1295
- * @example
1407
+ * **Example** (Filtering and mapping edges)
1408
+ *
1296
1409
  * ```ts
1297
1410
  * import { Graph } from "effect"
1298
1411
  * import * as Option from "effect/Option"
@@ -1315,8 +1428,8 @@ export const filterMapNodes = <N, E, T extends Kind = "directed">(
1315
1428
  * console.log(Graph.edgeCount(graph)) // 2 (edges with weight 5 removed)
1316
1429
  * ```
1317
1430
  *
1318
- * @since 4.0.0
1319
1431
  * @category transformations
1432
+ * @since 4.0.0
1320
1433
  */
1321
1434
  export const filterMapEdges = <N, E, T extends Kind = "directed">(
1322
1435
  mutable: MutableGraph<N, E, T>,
@@ -1349,7 +1462,8 @@ export const filterMapEdges = <N, E, T extends Kind = "directed">(
1349
1462
  * Filters nodes by removing those that don't match the predicate.
1350
1463
  * This function modifies the mutable graph in place.
1351
1464
  *
1352
- * @example
1465
+ * **Example** (Filtering nodes)
1466
+ *
1353
1467
  * ```ts
1354
1468
  * import { Graph } from "effect"
1355
1469
  *
@@ -1366,8 +1480,8 @@ export const filterMapEdges = <N, E, T extends Kind = "directed">(
1366
1480
  * console.log(Graph.nodeCount(graph)) // 2 (only "active" nodes remain)
1367
1481
  * ```
1368
1482
  *
1369
- * @since 4.0.0
1370
1483
  * @category transformations
1484
+ * @since 4.0.0
1371
1485
  */
1372
1486
  export const filterNodes = <N, E, T extends Kind = "directed">(
1373
1487
  mutable: MutableGraph<N, E, T>,
@@ -1392,7 +1506,8 @@ export const filterNodes = <N, E, T extends Kind = "directed">(
1392
1506
  * Filters edges by removing those that don't match the predicate.
1393
1507
  * This function modifies the mutable graph in place.
1394
1508
  *
1395
- * @example
1509
+ * **Example** (Filtering edges)
1510
+ *
1396
1511
  * ```ts
1397
1512
  * import { Graph } from "effect"
1398
1513
  *
@@ -1412,8 +1527,8 @@ export const filterNodes = <N, E, T extends Kind = "directed">(
1412
1527
  * console.log(Graph.edgeCount(graph)) // 2 (edge with weight 5 removed)
1413
1528
  * ```
1414
1529
  *
1415
- * @since 4.0.0
1416
1530
  * @category transformations
1531
+ * @since 4.0.0
1417
1532
  */
1418
1533
  export const filterEdges = <N, E, T extends Kind = "directed">(
1419
1534
  mutable: MutableGraph<N, E, T>,
@@ -1465,7 +1580,8 @@ const invalidateCycleFlagOnAddition = <N, E, T extends Kind = "directed">(
1465
1580
  /**
1466
1581
  * Adds a new edge to a mutable graph and returns its index.
1467
1582
  *
1468
- * @example
1583
+ * **Example** (Adding edges)
1584
+ *
1469
1585
  * ```ts
1470
1586
  * import { Graph } from "effect"
1471
1587
  *
@@ -1477,8 +1593,8 @@ const invalidateCycleFlagOnAddition = <N, E, T extends Kind = "directed">(
1477
1593
  * })
1478
1594
  * ```
1479
1595
  *
1480
- * @since 4.0.0
1481
1596
  * @category mutations
1597
+ * @since 4.0.0
1482
1598
  */
1483
1599
  export const addEdge = <N, E, T extends Kind = "directed">(
1484
1600
  mutable: MutableGraph<N, E, T>,
@@ -1537,7 +1653,8 @@ export const addEdge = <N, E, T extends Kind = "directed">(
1537
1653
  /**
1538
1654
  * Removes a node and all its incident edges from a mutable graph.
1539
1655
  *
1540
- * @example
1656
+ * **Example** (Removing a node)
1657
+ *
1541
1658
  * ```ts
1542
1659
  * import { Graph } from "effect"
1543
1660
  *
@@ -1551,8 +1668,8 @@ export const addEdge = <N, E, T extends Kind = "directed">(
1551
1668
  * })
1552
1669
  * ```
1553
1670
  *
1554
- * @since 4.0.0
1555
1671
  * @category mutations
1672
+ * @since 4.0.0
1556
1673
  */
1557
1674
  export const removeNode = <N, E, T extends Kind = "directed">(
1558
1675
  mutable: MutableGraph<N, E, T>,
@@ -1600,7 +1717,8 @@ export const removeNode = <N, E, T extends Kind = "directed">(
1600
1717
  /**
1601
1718
  * Removes an edge from a mutable graph.
1602
1719
  *
1603
- * @example
1720
+ * **Example** (Removing an edge)
1721
+ *
1604
1722
  * ```ts
1605
1723
  * import { Graph } from "effect"
1606
1724
  *
@@ -1614,8 +1732,8 @@ export const removeNode = <N, E, T extends Kind = "directed">(
1614
1732
  * })
1615
1733
  * ```
1616
1734
  *
1617
- * @since 4.0.0
1618
1735
  * @category mutations
1736
+ * @since 4.0.0
1619
1737
  */
1620
1738
  export const removeEdge = <N, E, T extends Kind = "directed">(
1621
1739
  mutable: MutableGraph<N, E, T>,
@@ -1692,7 +1810,8 @@ const removeEdgeInternal = <N, E, T extends Kind = "directed">(
1692
1810
  /**
1693
1811
  * Gets the edge data associated with an edge index, if it exists.
1694
1812
  *
1695
- * @example
1813
+ * **Example** (Getting edge data)
1814
+ *
1696
1815
  * ```ts
1697
1816
  * import { Graph } from "effect"
1698
1817
  *
@@ -1707,13 +1826,13 @@ const removeEdgeInternal = <N, E, T extends Kind = "directed">(
1707
1826
  *
1708
1827
  * if (edgeData._tag === "Some") {
1709
1828
  * console.log(edgeData.value.data) // 42
1710
- * console.log(edgeData.value.source) // NodeIndex(0)
1711
- * console.log(edgeData.value.target) // NodeIndex(1)
1829
+ * console.log(edgeData.value.source) // 0
1830
+ * console.log(edgeData.value.target) // 1
1712
1831
  * }
1713
1832
  * ```
1714
1833
  *
1715
- * @since 4.0.0
1716
1834
  * @category getters
1835
+ * @since 4.0.0
1717
1836
  */
1718
1837
  export const getEdge: {
1719
1838
  // =============================================================================
@@ -1723,7 +1842,8 @@ export const getEdge: {
1723
1842
  /**
1724
1843
  * Gets the edge data associated with an edge index, if it exists.
1725
1844
  *
1726
- * @example
1845
+ * **Example** (Getting edge data)
1846
+ *
1727
1847
  * ```ts
1728
1848
  * import { Graph } from "effect"
1729
1849
  *
@@ -1738,13 +1858,13 @@ export const getEdge: {
1738
1858
  *
1739
1859
  * if (edgeData._tag === "Some") {
1740
1860
  * console.log(edgeData.value.data) // 42
1741
- * console.log(edgeData.value.source) // NodeIndex(0)
1742
- * console.log(edgeData.value.target) // NodeIndex(1)
1861
+ * console.log(edgeData.value.source) // 0
1862
+ * console.log(edgeData.value.target) // 1
1743
1863
  * }
1744
1864
  * ```
1745
1865
  *
1746
- * @since 4.0.0
1747
1866
  * @category getters
1867
+ * @since 4.0.0
1748
1868
  */
1749
1869
  <E>(edgeIndex: EdgeIndex): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<Edge<E>>
1750
1870
  // =============================================================================
@@ -1754,7 +1874,8 @@ export const getEdge: {
1754
1874
  /**
1755
1875
  * Gets the edge data associated with an edge index, if it exists.
1756
1876
  *
1757
- * @example
1877
+ * **Example** (Getting edge data)
1878
+ *
1758
1879
  * ```ts
1759
1880
  * import { Graph } from "effect"
1760
1881
  *
@@ -1769,13 +1890,13 @@ export const getEdge: {
1769
1890
  *
1770
1891
  * if (edgeData._tag === "Some") {
1771
1892
  * console.log(edgeData.value.data) // 42
1772
- * console.log(edgeData.value.source) // NodeIndex(0)
1773
- * console.log(edgeData.value.target) // NodeIndex(1)
1893
+ * console.log(edgeData.value.source) // 0
1894
+ * console.log(edgeData.value.target) // 1
1774
1895
  * }
1775
1896
  * ```
1776
1897
  *
1777
- * @since 4.0.0
1778
1898
  * @category getters
1899
+ * @since 4.0.0
1779
1900
  */
1780
1901
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, edgeIndex: EdgeIndex): Option.Option<Edge<E>>
1781
1902
  } = dual(2, <N, E, T extends Kind = "directed">(
@@ -1786,7 +1907,8 @@ export const getEdge: {
1786
1907
  /**
1787
1908
  * Checks if an edge exists between two nodes in the graph.
1788
1909
  *
1789
- * @example
1910
+ * **Example** (Checking edge existence)
1911
+ *
1790
1912
  * ```ts
1791
1913
  * import { Graph } from "effect"
1792
1914
  *
@@ -1808,14 +1930,15 @@ export const getEdge: {
1808
1930
  * console.log(hasAC) // false
1809
1931
  * ```
1810
1932
  *
1811
- * @since 4.0.0
1812
1933
  * @category getters
1934
+ * @since 4.0.0
1813
1935
  */
1814
1936
  export const hasEdge: {
1815
1937
  /**
1816
1938
  * Checks if an edge exists between two nodes in the graph.
1817
1939
  *
1818
- * @example
1940
+ * **Example** (Checking edge existence)
1941
+ *
1819
1942
  * ```ts
1820
1943
  * import { Graph } from "effect"
1821
1944
  *
@@ -1837,14 +1960,15 @@ export const hasEdge: {
1837
1960
  * console.log(hasAC) // false
1838
1961
  * ```
1839
1962
  *
1840
- * @since 4.0.0
1841
1963
  * @category getters
1964
+ * @since 4.0.0
1842
1965
  */
1843
1966
  (source: NodeIndex, target: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => boolean
1844
1967
  /**
1845
1968
  * Checks if an edge exists between two nodes in the graph.
1846
1969
  *
1847
- * @example
1970
+ * **Example** (Checking edge existence)
1971
+ *
1848
1972
  * ```ts
1849
1973
  * import { Graph } from "effect"
1850
1974
  *
@@ -1866,8 +1990,8 @@ export const hasEdge: {
1866
1990
  * console.log(hasAC) // false
1867
1991
  * ```
1868
1992
  *
1869
- * @since 4.0.0
1870
1993
  * @category getters
1994
+ * @since 4.0.0
1871
1995
  */
1872
1996
  <N, E, T extends Kind = "directed">(
1873
1997
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -1898,7 +2022,8 @@ export const hasEdge: {
1898
2022
  /**
1899
2023
  * Returns the number of edges in the graph.
1900
2024
  *
1901
- * @example
2025
+ * **Example** (Counting edges)
2026
+ *
1902
2027
  * ```ts
1903
2028
  * import { Graph } from "effect"
1904
2029
  *
@@ -1917,17 +2042,23 @@ export const hasEdge: {
1917
2042
  * console.log(Graph.edgeCount(graphWithEdges)) // 3
1918
2043
  * ```
1919
2044
  *
1920
- * @since 4.0.0
1921
2045
  * @category getters
2046
+ * @since 4.0.0
1922
2047
  */
1923
2048
  export const edgeCount = <N, E, T extends Kind = "directed">(
1924
2049
  graph: Graph<N, E, T> | MutableGraph<N, E, T>
1925
2050
  ): number => graph.edges.size
1926
2051
 
1927
2052
  /**
1928
- * Returns the neighboring nodes (targets of outgoing edges) for a given node.
2053
+ * Returns the neighboring node indices for a node.
2054
+ *
2055
+ * **Details**
2056
+ *
2057
+ * For directed graphs, neighbors are the targets of outgoing edges. For
2058
+ * undirected graphs, neighbors are the other endpoints of incident edges.
2059
+ *
2060
+ * **Example** (Getting outgoing neighbors)
1929
2061
  *
1930
- * @example
1931
2062
  * ```ts
1932
2063
  * import { Graph } from "effect"
1933
2064
  *
@@ -1944,20 +2075,26 @@ export const edgeCount = <N, E, T extends Kind = "directed">(
1944
2075
  * const nodeC = 2
1945
2076
  *
1946
2077
  * const neighborsA = Graph.neighbors(graph, nodeA)
1947
- * console.log(neighborsA) // [NodeIndex(1), NodeIndex(2)]
2078
+ * console.log(neighborsA) // [1, 2]
1948
2079
  *
1949
2080
  * const neighborsB = Graph.neighbors(graph, nodeB)
1950
2081
  * console.log(neighborsB) // []
1951
2082
  * ```
1952
2083
  *
1953
- * @since 4.0.0
1954
2084
  * @category getters
2085
+ * @since 4.0.0
1955
2086
  */
1956
2087
  export const neighbors: {
1957
2088
  /**
1958
- * Returns the neighboring nodes (targets of outgoing edges) for a given node.
2089
+ * Returns the neighboring node indices for a node.
2090
+ *
2091
+ * **Details**
2092
+ *
2093
+ * For directed graphs, neighbors are the targets of outgoing edges. For
2094
+ * undirected graphs, neighbors are the other endpoints of incident edges.
2095
+ *
2096
+ * **Example** (Getting outgoing neighbors)
1959
2097
  *
1960
- * @example
1961
2098
  * ```ts
1962
2099
  * import { Graph } from "effect"
1963
2100
  *
@@ -1974,20 +2111,26 @@ export const neighbors: {
1974
2111
  * const nodeC = 2
1975
2112
  *
1976
2113
  * const neighborsA = Graph.neighbors(graph, nodeA)
1977
- * console.log(neighborsA) // [NodeIndex(1), NodeIndex(2)]
2114
+ * console.log(neighborsA) // [1, 2]
1978
2115
  *
1979
2116
  * const neighborsB = Graph.neighbors(graph, nodeB)
1980
2117
  * console.log(neighborsB) // []
1981
2118
  * ```
1982
2119
  *
1983
- * @since 4.0.0
1984
2120
  * @category getters
2121
+ * @since 4.0.0
1985
2122
  */
1986
2123
  (nodeIndex: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<NodeIndex>
1987
2124
  /**
1988
- * Returns the neighboring nodes (targets of outgoing edges) for a given node.
2125
+ * Returns the neighboring node indices for a node.
2126
+ *
2127
+ * **Details**
2128
+ *
2129
+ * For directed graphs, neighbors are the targets of outgoing edges. For
2130
+ * undirected graphs, neighbors are the other endpoints of incident edges.
2131
+ *
2132
+ * **Example** (Getting outgoing neighbors)
1989
2133
  *
1990
- * @example
1991
2134
  * ```ts
1992
2135
  * import { Graph } from "effect"
1993
2136
  *
@@ -2004,14 +2147,14 @@ export const neighbors: {
2004
2147
  * const nodeC = 2
2005
2148
  *
2006
2149
  * const neighborsA = Graph.neighbors(graph, nodeA)
2007
- * console.log(neighborsA) // [NodeIndex(1), NodeIndex(2)]
2150
+ * console.log(neighborsA) // [1, 2]
2008
2151
  *
2009
2152
  * const neighborsB = Graph.neighbors(graph, nodeB)
2010
2153
  * console.log(neighborsB) // []
2011
2154
  * ```
2012
2155
  *
2013
- * @since 4.0.0
2014
2156
  * @category getters
2157
+ * @since 4.0.0
2015
2158
  */
2016
2159
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, nodeIndex: NodeIndex): Array<NodeIndex>
2017
2160
  } = dual(2, <N, E, T extends Kind = "directed">(
@@ -2042,7 +2185,8 @@ export const neighbors: {
2042
2185
  /**
2043
2186
  * Get neighbors of a node in a specific direction for bidirectional traversal.
2044
2187
  *
2045
- * @example
2188
+ * **Example** (Traversing directed neighbors)
2189
+ *
2046
2190
  * ```ts
2047
2191
  * import { Graph } from "effect"
2048
2192
  *
@@ -2062,14 +2206,15 @@ export const neighbors: {
2062
2206
  * const incoming = Graph.neighborsDirected(graph, nodeB, "incoming")
2063
2207
  * ```
2064
2208
  *
2065
- * @since 4.0.0
2066
2209
  * @category queries
2210
+ * @since 4.0.0
2067
2211
  */
2068
2212
  export const neighborsDirected: {
2069
2213
  /**
2070
2214
  * Get neighbors of a node in a specific direction for bidirectional traversal.
2071
2215
  *
2072
- * @example
2216
+ * **Example** (Traversing directed neighbors)
2217
+ *
2073
2218
  * ```ts
2074
2219
  * import { Graph } from "effect"
2075
2220
  *
@@ -2089,14 +2234,15 @@ export const neighborsDirected: {
2089
2234
  * const incoming = Graph.neighborsDirected(graph, nodeB, "incoming")
2090
2235
  * ```
2091
2236
  *
2092
- * @since 4.0.0
2093
2237
  * @category queries
2238
+ * @since 4.0.0
2094
2239
  */
2095
2240
  (nodeIndex: NodeIndex, direction: Direction): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<NodeIndex>
2096
2241
  /**
2097
2242
  * Get neighbors of a node in a specific direction for bidirectional traversal.
2098
2243
  *
2099
- * @example
2244
+ * **Example** (Traversing directed neighbors)
2245
+ *
2100
2246
  * ```ts
2101
2247
  * import { Graph } from "effect"
2102
2248
  *
@@ -2116,8 +2262,8 @@ export const neighborsDirected: {
2116
2262
  * const incoming = Graph.neighborsDirected(graph, nodeB, "incoming")
2117
2263
  * ```
2118
2264
  *
2119
- * @since 4.0.0
2120
2265
  * @category queries
2266
+ * @since 4.0.0
2121
2267
  */
2122
2268
  <N, E, T extends Kind = "directed">(
2123
2269
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -2163,7 +2309,8 @@ export const neighborsDirected: {
2163
2309
  * Provides customization for node labels, edge labels, and graph naming
2164
2310
  * in DOT format compatible with GraphViz tools.
2165
2311
  *
2166
- * @example
2312
+ * **Example** (Configuring GraphViz labels)
2313
+ *
2167
2314
  * ```ts
2168
2315
  * import type * as Graph from "effect/Graph"
2169
2316
  *
@@ -2181,8 +2328,8 @@ export const neighborsDirected: {
2181
2328
  * }
2182
2329
  * ```
2183
2330
  *
2184
- * @since 4.0.0
2185
2331
  * @category models
2332
+ * @since 4.0.0
2186
2333
  */
2187
2334
  export interface GraphVizOptions<N, E> {
2188
2335
  /**
@@ -2207,7 +2354,8 @@ export interface GraphVizOptions<N, E> {
2207
2354
  /**
2208
2355
  * Exports a graph to GraphViz DOT format for visualization.
2209
2356
  *
2210
- * @example
2357
+ * **Example** (Exporting GraphViz DOT)
2358
+ *
2211
2359
  * ```ts
2212
2360
  * import { Graph } from "effect"
2213
2361
  *
@@ -2232,14 +2380,15 @@ export interface GraphVizOptions<N, E> {
2232
2380
  * // }
2233
2381
  * ```
2234
2382
  *
2235
- * @since 4.0.0
2236
2383
  * @category utils
2384
+ * @since 4.0.0
2237
2385
  */
2238
2386
  export const toGraphViz: {
2239
2387
  /**
2240
2388
  * Exports a graph to GraphViz DOT format for visualization.
2241
2389
  *
2242
- * @example
2390
+ * **Example** (Exporting GraphViz DOT)
2391
+ *
2243
2392
  * ```ts
2244
2393
  * import { Graph } from "effect"
2245
2394
  *
@@ -2264,14 +2413,15 @@ export const toGraphViz: {
2264
2413
  * // }
2265
2414
  * ```
2266
2415
  *
2267
- * @since 4.0.0
2268
2416
  * @category utils
2417
+ * @since 4.0.0
2269
2418
  */
2270
2419
  <N, E>(options?: GraphVizOptions<N, E>): <T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => string
2271
2420
  /**
2272
2421
  * Exports a graph to GraphViz DOT format for visualization.
2273
2422
  *
2274
- * @example
2423
+ * **Example** (Exporting GraphViz DOT)
2424
+ *
2275
2425
  * ```ts
2276
2426
  * import { Graph } from "effect"
2277
2427
  *
@@ -2296,8 +2446,8 @@ export const toGraphViz: {
2296
2446
  * // }
2297
2447
  * ```
2298
2448
  *
2299
- * @since 4.0.0
2300
2449
  * @category utils
2450
+ * @since 4.0.0
2301
2451
  */
2302
2452
  <N, E, T extends Kind = "directed">(
2303
2453
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -2353,7 +2503,8 @@ export const toGraphViz: {
2353
2503
  * - `subroutine`: Subroutine-style nodes `A[["label"]]`
2354
2504
  * - `cylindrical`: Cylindrical database-style nodes `A[("label")]`
2355
2505
  *
2356
- * @example
2506
+ * **Example** (Selecting Mermaid node shapes)
2507
+ *
2357
2508
  * ```ts
2358
2509
  * import type * as Graph from "effect/Graph"
2359
2510
  *
@@ -2371,8 +2522,8 @@ export const toGraphViz: {
2371
2522
  * }
2372
2523
  * ```
2373
2524
  *
2374
- * @since 4.0.0
2375
2525
  * @category models
2526
+ * @since 4.0.0
2376
2527
  */
2377
2528
  export type MermaidNodeShape =
2378
2529
  | "rectangle" // A["label"]
@@ -2393,7 +2544,8 @@ export type MermaidNodeShape =
2393
2544
  * - `LR`: Left to Right (horizontal layout)
2394
2545
  * - `RL`: Right to Left (reverse horizontal)
2395
2546
  *
2396
- * @example
2547
+ * **Example** (Configuring Mermaid directions)
2548
+ *
2397
2549
  * ```ts
2398
2550
  * import type * as Graph from "effect/Graph"
2399
2551
  *
@@ -2413,8 +2565,8 @@ export type MermaidNodeShape =
2413
2565
  * }
2414
2566
  * ```
2415
2567
  *
2416
- * @since 4.0.0
2417
2568
  * @category models
2569
+ * @since 4.0.0
2418
2570
  */
2419
2571
  export type MermaidDirection =
2420
2572
  | "TB" // Top to Bottom (default)
@@ -2433,7 +2585,8 @@ export type MermaidDirection =
2433
2585
  * When not specified, automatically selects based on graph type:
2434
2586
  * directed graphs use "flowchart", undirected graphs use "graph".
2435
2587
  *
2436
- * @example
2588
+ * **Example** (Selecting Mermaid diagram types)
2589
+ *
2437
2590
  * ```ts
2438
2591
  * import type * as Graph from "effect/Graph"
2439
2592
  *
@@ -2451,8 +2604,8 @@ export type MermaidDirection =
2451
2604
  * const autoOptions: Graph.MermaidOptions<string, string> = {}
2452
2605
  * ```
2453
2606
  *
2454
- * @since 4.0.0
2455
2607
  * @category models
2608
+ * @since 4.0.0
2456
2609
  */
2457
2610
  export type MermaidDiagramType =
2458
2611
  | "flowchart" // For directed graphs
@@ -2461,8 +2614,8 @@ export type MermaidDiagramType =
2461
2614
  /**
2462
2615
  * Configuration options for Mermaid diagram generation, following GraphViz pattern.
2463
2616
  *
2464
- * @since 4.0.0
2465
2617
  * @category models
2618
+ * @since 4.0.0
2466
2619
  */
2467
2620
  /**
2468
2621
  * Configuration options for Mermaid diagram generation from graphs.
@@ -2470,7 +2623,8 @@ export type MermaidDiagramType =
2470
2623
  * Provides customization for node labels, edge labels, diagram type,
2471
2624
  * layout direction, node shapes, and graph naming in Mermaid format.
2472
2625
  *
2473
- * @example
2626
+ * **Example** (Configuring Mermaid output)
2627
+ *
2474
2628
  * ```ts
2475
2629
  * import type * as Graph from "effect/Graph"
2476
2630
  *
@@ -2490,8 +2644,8 @@ export type MermaidDiagramType =
2490
2644
  * }
2491
2645
  * ```
2492
2646
  *
2493
- * @since 4.0.0
2494
2647
  * @category models
2648
+ * @since 4.0.0
2495
2649
  */
2496
2650
  export interface MermaidOptions<N, E> {
2497
2651
  /**
@@ -2587,7 +2741,8 @@ const formatMermaidNode = (
2587
2741
  * structures to valid Mermaid syntax for use in documentation, web applications,
2588
2742
  * and visualization tools.
2589
2743
  *
2590
- * @example
2744
+ * **Example** (Exporting a directed Mermaid diagram)
2745
+ *
2591
2746
  * ```ts
2592
2747
  * import * as Graph from "effect/Graph"
2593
2748
  *
@@ -2610,7 +2765,8 @@ const formatMermaidNode = (
2610
2765
  * // 0 -->|"2"| 2
2611
2766
  * ```
2612
2767
  *
2613
- * @example
2768
+ * **Example** (Exporting an undirected Mermaid diagram)
2769
+ *
2614
2770
  * ```ts
2615
2771
  * import * as Graph from "effect/Graph"
2616
2772
  *
@@ -2637,7 +2793,8 @@ const formatMermaidNode = (
2637
2793
  * // 1 ---|"colleagues"| 2
2638
2794
  * ```
2639
2795
  *
2640
- * @example
2796
+ * **Example** (Customizing Mermaid node shapes)
2797
+ *
2641
2798
  * ```ts
2642
2799
  * import * as Graph from "effect/Graph"
2643
2800
  *
@@ -2688,7 +2845,8 @@ const formatMermaidNode = (
2688
2845
  * // 2 --> 3
2689
2846
  * ```
2690
2847
  *
2691
- * @example
2848
+ * **Example** (Visualizing dependency graphs)
2849
+ *
2692
2850
  * ```ts
2693
2851
  * import * as Graph from "effect/Graph"
2694
2852
  *
@@ -2753,8 +2911,8 @@ const formatMermaidNode = (
2753
2911
  * @param options - Optional configuration for the Mermaid output
2754
2912
  * @returns Mermaid diagram syntax as a string
2755
2913
  *
2756
- * @since 4.0.0
2757
2914
  * @category utils
2915
+ * @since 4.0.0
2758
2916
  */
2759
2917
  export const toMermaid: {
2760
2918
  /**
@@ -2765,7 +2923,8 @@ export const toMermaid: {
2765
2923
  * structures to valid Mermaid syntax for use in documentation, web applications,
2766
2924
  * and visualization tools.
2767
2925
  *
2768
- * @example
2926
+ * **Example** (Exporting a directed Mermaid diagram)
2927
+ *
2769
2928
  * ```ts
2770
2929
  * import * as Graph from "effect/Graph"
2771
2930
  *
@@ -2788,7 +2947,8 @@ export const toMermaid: {
2788
2947
  * // 0 -->|"2"| 2
2789
2948
  * ```
2790
2949
  *
2791
- * @example
2950
+ * **Example** (Exporting an undirected Mermaid diagram)
2951
+ *
2792
2952
  * ```ts
2793
2953
  * import * as Graph from "effect/Graph"
2794
2954
  *
@@ -2815,7 +2975,8 @@ export const toMermaid: {
2815
2975
  * // 1 ---|"colleagues"| 2
2816
2976
  * ```
2817
2977
  *
2818
- * @example
2978
+ * **Example** (Customizing Mermaid node shapes)
2979
+ *
2819
2980
  * ```ts
2820
2981
  * import * as Graph from "effect/Graph"
2821
2982
  *
@@ -2866,7 +3027,8 @@ export const toMermaid: {
2866
3027
  * // 2 --> 3
2867
3028
  * ```
2868
3029
  *
2869
- * @example
3030
+ * **Example** (Visualizing dependency graphs)
3031
+ *
2870
3032
  * ```ts
2871
3033
  * import * as Graph from "effect/Graph"
2872
3034
  *
@@ -2931,8 +3093,8 @@ export const toMermaid: {
2931
3093
  * @param options - Optional configuration for the Mermaid output
2932
3094
  * @returns Mermaid diagram syntax as a string
2933
3095
  *
2934
- * @since 4.0.0
2935
3096
  * @category utils
3097
+ * @since 4.0.0
2936
3098
  */
2937
3099
  <N, E>(options?: MermaidOptions<N, E>): <T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => string
2938
3100
  /**
@@ -2943,7 +3105,8 @@ export const toMermaid: {
2943
3105
  * structures to valid Mermaid syntax for use in documentation, web applications,
2944
3106
  * and visualization tools.
2945
3107
  *
2946
- * @example
3108
+ * **Example** (Exporting a directed Mermaid diagram)
3109
+ *
2947
3110
  * ```ts
2948
3111
  * import * as Graph from "effect/Graph"
2949
3112
  *
@@ -2966,7 +3129,8 @@ export const toMermaid: {
2966
3129
  * // 0 -->|"2"| 2
2967
3130
  * ```
2968
3131
  *
2969
- * @example
3132
+ * **Example** (Exporting an undirected Mermaid diagram)
3133
+ *
2970
3134
  * ```ts
2971
3135
  * import * as Graph from "effect/Graph"
2972
3136
  *
@@ -2993,7 +3157,8 @@ export const toMermaid: {
2993
3157
  * // 1 ---|"colleagues"| 2
2994
3158
  * ```
2995
3159
  *
2996
- * @example
3160
+ * **Example** (Customizing Mermaid node shapes)
3161
+ *
2997
3162
  * ```ts
2998
3163
  * import * as Graph from "effect/Graph"
2999
3164
  *
@@ -3044,7 +3209,8 @@ export const toMermaid: {
3044
3209
  * // 2 --> 3
3045
3210
  * ```
3046
3211
  *
3047
- * @example
3212
+ * **Example** (Visualizing dependency graphs)
3213
+ *
3048
3214
  * ```ts
3049
3215
  * import * as Graph from "effect/Graph"
3050
3216
  *
@@ -3109,8 +3275,8 @@ export const toMermaid: {
3109
3275
  * @param options - Optional configuration for the Mermaid output
3110
3276
  * @returns Mermaid diagram syntax as a string
3111
3277
  *
3112
- * @since 4.0.0
3113
3278
  * @category utils
3279
+ * @since 4.0.0
3114
3280
  */
3115
3281
  <N, E, T extends Kind = "directed">(
3116
3282
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -3170,7 +3336,8 @@ export const toMermaid: {
3170
3336
  /**
3171
3337
  * Direction for graph traversal, indicating which edges to follow.
3172
3338
  *
3173
- * @example
3339
+ * **Example** (Traversing by direction)
3340
+ *
3174
3341
  * ```ts
3175
3342
  * import { Graph } from "effect"
3176
3343
  *
@@ -3191,8 +3358,8 @@ export const toMermaid: {
3191
3358
  * )
3192
3359
  * ```
3193
3360
  *
3194
- * @since 4.0.0
3195
3361
  * @category models
3362
+ * @since 4.0.0
3196
3363
  */
3197
3364
  export type Direction = "outgoing" | "incoming"
3198
3365
 
@@ -3207,7 +3374,8 @@ export type Direction = "outgoing" | "incoming"
3207
3374
  * For directed graphs, any back edge creates a cycle. For undirected graphs,
3208
3375
  * a back edge that doesn't go to the immediate parent creates a cycle.
3209
3376
  *
3210
- * @example
3377
+ * **Example** (Checking cycles)
3378
+ *
3211
3379
  * ```ts
3212
3380
  * import { Graph } from "effect"
3213
3381
  *
@@ -3231,8 +3399,8 @@ export type Direction = "outgoing" | "incoming"
3231
3399
  * console.log(Graph.isAcyclic(cyclic)) // false
3232
3400
  * ```
3233
3401
  *
3234
- * @since 4.0.0
3235
3402
  * @category algorithms
3403
+ * @since 4.0.0
3236
3404
  */
3237
3405
  export const isAcyclic = <N, E, T extends Kind = "directed">(
3238
3406
  graph: Graph<N, E, T> | MutableGraph<N, E, T>
@@ -3317,7 +3485,8 @@ export const isAcyclic = <N, E, T extends Kind = "directed">(
3317
3485
  * such that no two vertices within the same set are adjacent. Uses BFS coloring
3318
3486
  * to determine bipartiteness.
3319
3487
  *
3320
- * @example
3488
+ * **Example** (Checking bipartite graphs)
3489
+ *
3321
3490
  * ```ts
3322
3491
  * import { Graph } from "effect"
3323
3492
  *
@@ -3345,8 +3514,8 @@ export const isAcyclic = <N, E, T extends Kind = "directed">(
3345
3514
  * console.log(Graph.isBipartite(triangle)) // false
3346
3515
  * ```
3347
3516
  *
3348
- * @since 4.0.0
3349
3517
  * @category algorithms
3518
+ * @since 4.0.0
3350
3519
  */
3351
3520
  export const isBipartite = <N, E>(
3352
3521
  graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">
@@ -3426,7 +3595,8 @@ const getUndirectedNeighbors = <N, E>(
3426
3595
  * Find connected components in an undirected graph.
3427
3596
  * Each component is represented as an array of node indices.
3428
3597
  *
3429
- * @example
3598
+ * **Example** (Finding connected components)
3599
+ *
3430
3600
  * ```ts
3431
3601
  * import { Graph } from "effect"
3432
3602
  *
@@ -3443,8 +3613,8 @@ const getUndirectedNeighbors = <N, E>(
3443
3613
  * console.log(components) // [[0, 1], [2, 3]]
3444
3614
  * ```
3445
3615
  *
3446
- * @since 4.0.0
3447
3616
  * @category algorithms
3617
+ * @since 4.0.0
3448
3618
  */
3449
3619
  export const connectedComponents = <N, E>(
3450
3620
  graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">
@@ -3484,7 +3654,8 @@ export const connectedComponents = <N, E>(
3484
3654
  * Find strongly connected components in a directed graph using Kosaraju's algorithm.
3485
3655
  * Each SCC is represented as an array of node indices.
3486
3656
  *
3487
- * @example
3657
+ * **Example** (Finding strongly connected components)
3658
+ *
3488
3659
  * ```ts
3489
3660
  * import { Graph } from "effect"
3490
3661
  *
@@ -3501,8 +3672,8 @@ export const connectedComponents = <N, E>(
3501
3672
  * console.log(sccs) // [[0, 1, 2]]
3502
3673
  * ```
3503
3674
  *
3504
- * @since 4.0.0
3505
3675
  * @category algorithms
3676
+ * @since 4.0.0
3506
3677
  */
3507
3678
  export const stronglyConnectedComponents = <N, E, T extends Kind = "directed">(
3508
3679
  graph: Graph<N, E, T> | MutableGraph<N, E, T>
@@ -3602,10 +3773,15 @@ export const stronglyConnectedComponents = <N, E, T extends Kind = "directed">(
3602
3773
  // =============================================================================
3603
3774
 
3604
3775
  /**
3605
- * Result of a shortest path computation containing the path and total distance.
3776
+ * Result of a shortest path computation.
3777
+ *
3778
+ * **Details**
3779
+ *
3780
+ * Contains the node-index path, the total numeric distance, and the edge data
3781
+ * encountered along the path.
3606
3782
  *
3607
- * @since 4.0.0
3608
3783
  * @category models
3784
+ * @since 4.0.0
3609
3785
  */
3610
3786
  export interface PathResult<E> {
3611
3787
  readonly path: Array<NodeIndex>
@@ -3614,10 +3790,15 @@ export interface PathResult<E> {
3614
3790
  }
3615
3791
 
3616
3792
  /**
3617
- * Configuration for Dijkstra's algorithm.
3793
+ * Configuration for finding a shortest path with Dijkstra's algorithm.
3794
+ *
3795
+ * **Details**
3796
+ *
3797
+ * Specifies the source and target node indices, plus a cost function that maps
3798
+ * each edge's data to a non-negative numeric weight.
3618
3799
  *
3619
- * @since 4.0.0
3620
3800
  * @category models
3801
+ * @since 4.0.0
3621
3802
  */
3622
3803
  export interface DijkstraConfig<E> {
3623
3804
  source: NodeIndex
@@ -3626,12 +3807,17 @@ export interface DijkstraConfig<E> {
3626
3807
  }
3627
3808
 
3628
3809
  /**
3629
- * Find the shortest path between two nodes using Dijkstra's algorithm.
3810
+ * Finds the shortest path from the configured source node to the target node
3811
+ * using Dijkstra's algorithm.
3812
+ *
3813
+ * **Details**
3814
+ *
3815
+ * Edge costs must be non-negative. Returns `Option.none()` when the target is
3816
+ * not reachable, and throws a `GraphError` when either endpoint is missing or a
3817
+ * negative edge cost is encountered.
3630
3818
  *
3631
- * Dijkstra's algorithm works with non-negative edge weights and finds the shortest
3632
- * path from a source node to a target node in O((V + E) log V) time complexity.
3819
+ * **Example** (Finding shortest paths with Dijkstra)
3633
3820
  *
3634
- * @example
3635
3821
  * ```ts
3636
3822
  * import { Graph } from "effect"
3637
3823
  *
@@ -3656,17 +3842,22 @@ export interface DijkstraConfig<E> {
3656
3842
  * }
3657
3843
  * ```
3658
3844
  *
3659
- * @since 4.0.0
3660
3845
  * @category algorithms
3846
+ * @since 4.0.0
3661
3847
  */
3662
3848
  export const dijkstra: {
3663
3849
  /**
3664
- * Find the shortest path between two nodes using Dijkstra's algorithm.
3850
+ * Finds the shortest path from the configured source node to the target node
3851
+ * using Dijkstra's algorithm.
3852
+ *
3853
+ * **Details**
3665
3854
  *
3666
- * Dijkstra's algorithm works with non-negative edge weights and finds the shortest
3667
- * path from a source node to a target node in O((V + E) log V) time complexity.
3855
+ * Edge costs must be non-negative. Returns `Option.none()` when the target is
3856
+ * not reachable, and throws a `GraphError` when either endpoint is missing or a
3857
+ * negative edge cost is encountered.
3858
+ *
3859
+ * **Example** (Finding shortest paths with Dijkstra)
3668
3860
  *
3669
- * @example
3670
3861
  * ```ts
3671
3862
  * import { Graph } from "effect"
3672
3863
  *
@@ -3691,17 +3882,22 @@ export const dijkstra: {
3691
3882
  * }
3692
3883
  * ```
3693
3884
  *
3694
- * @since 4.0.0
3695
3885
  * @category algorithms
3886
+ * @since 4.0.0
3696
3887
  */
3697
3888
  <E>(config: DijkstraConfig<E>): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<PathResult<E>>
3698
3889
  /**
3699
- * Find the shortest path between two nodes using Dijkstra's algorithm.
3890
+ * Finds the shortest path from the configured source node to the target node
3891
+ * using Dijkstra's algorithm.
3700
3892
  *
3701
- * Dijkstra's algorithm works with non-negative edge weights and finds the shortest
3702
- * path from a source node to a target node in O((V + E) log V) time complexity.
3893
+ * **Details**
3894
+ *
3895
+ * Edge costs must be non-negative. Returns `Option.none()` when the target is
3896
+ * not reachable, and throws a `GraphError` when either endpoint is missing or a
3897
+ * negative edge cost is encountered.
3898
+ *
3899
+ * **Example** (Finding shortest paths with Dijkstra)
3703
3900
  *
3704
- * @example
3705
3901
  * ```ts
3706
3902
  * import { Graph } from "effect"
3707
3903
  *
@@ -3726,8 +3922,8 @@ export const dijkstra: {
3726
3922
  * }
3727
3923
  * ```
3728
3924
  *
3729
- * @since 4.0.0
3730
3925
  * @category algorithms
3926
+ * @since 4.0.0
3731
3927
  */
3732
3928
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config: DijkstraConfig<E>): Option.Option<PathResult<E>>
3733
3929
  } = dual(2, <N, E, T extends Kind = "directed">(
@@ -3857,10 +4053,15 @@ export const dijkstra: {
3857
4053
  })
3858
4054
 
3859
4055
  /**
3860
- * Result of all-pairs shortest path computation.
4056
+ * Result of an all-pairs shortest path computation.
4057
+ *
4058
+ * **Details**
4059
+ *
4060
+ * Contains distance, node-path, and edge-data maps keyed by source and target
4061
+ * node indices.
3861
4062
  *
3862
- * @since 4.0.0
3863
4063
  * @category models
4064
+ * @since 4.0.0
3864
4065
  */
3865
4066
  export interface AllPairsResult<E> {
3866
4067
  readonly distances: Map<NodeIndex, Map<NodeIndex, number>>
@@ -3869,14 +4070,17 @@ export interface AllPairsResult<E> {
3869
4070
  }
3870
4071
 
3871
4072
  /**
3872
- * Find shortest paths between all pairs of nodes using Floyd-Warshall algorithm.
4073
+ * Finds shortest paths between all pairs of nodes using the Floyd-Warshall
4074
+ * algorithm.
4075
+ *
4076
+ * **Details**
3873
4077
  *
3874
- * Floyd-Warshall algorithm computes shortest paths between all pairs of nodes in O(V³) time.
3875
- * It can handle negative edge weights and detect negative cycles.
4078
+ * Computes distances, reconstructed node paths, and edge-data paths for every
4079
+ * source and target pair in O(V^3) time. Negative edge weights are allowed, but
4080
+ * a `GraphError` is thrown if any negative cycle is detected.
3876
4081
  *
3877
- * Throws if a negative cycle is detected that affects the path to target.
4082
+ * **Example** (Finding all-pairs shortest paths)
3878
4083
  *
3879
- * @example
3880
4084
  * ```ts
3881
4085
  * import { Graph } from "effect"
3882
4086
  *
@@ -3894,19 +4098,22 @@ export interface AllPairsResult<E> {
3894
4098
  * const pathAToC = result.paths.get(0)?.get(2) // [0, 1, 2]
3895
4099
  * ```
3896
4100
  *
3897
- * @since 4.0.0
3898
4101
  * @category algorithms
4102
+ * @since 4.0.0
3899
4103
  */
3900
4104
  export const floydWarshall: {
3901
4105
  /**
3902
- * Find shortest paths between all pairs of nodes using Floyd-Warshall algorithm.
4106
+ * Finds shortest paths between all pairs of nodes using the Floyd-Warshall
4107
+ * algorithm.
4108
+ *
4109
+ * **Details**
3903
4110
  *
3904
- * Floyd-Warshall algorithm computes shortest paths between all pairs of nodes in O(V³) time.
3905
- * It can handle negative edge weights and detect negative cycles.
4111
+ * Computes distances, reconstructed node paths, and edge-data paths for every
4112
+ * source and target pair in O(V^3) time. Negative edge weights are allowed, but
4113
+ * a `GraphError` is thrown if any negative cycle is detected.
3906
4114
  *
3907
- * Throws if a negative cycle is detected that affects the path to target.
4115
+ * **Example** (Finding all-pairs shortest paths)
3908
4116
  *
3909
- * @example
3910
4117
  * ```ts
3911
4118
  * import { Graph } from "effect"
3912
4119
  *
@@ -3924,19 +4131,22 @@ export const floydWarshall: {
3924
4131
  * const pathAToC = result.paths.get(0)?.get(2) // [0, 1, 2]
3925
4132
  * ```
3926
4133
  *
3927
- * @since 4.0.0
3928
4134
  * @category algorithms
4135
+ * @since 4.0.0
3929
4136
  */
3930
4137
  <E>(cost: (edgeData: E) => number): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => AllPairsResult<E>
3931
4138
  /**
3932
- * Find shortest paths between all pairs of nodes using Floyd-Warshall algorithm.
4139
+ * Finds shortest paths between all pairs of nodes using the Floyd-Warshall
4140
+ * algorithm.
4141
+ *
4142
+ * **Details**
3933
4143
  *
3934
- * Floyd-Warshall algorithm computes shortest paths between all pairs of nodes in O(V³) time.
3935
- * It can handle negative edge weights and detect negative cycles.
4144
+ * Computes distances, reconstructed node paths, and edge-data paths for every
4145
+ * source and target pair in O(V^3) time. Negative edge weights are allowed, but
4146
+ * a `GraphError` is thrown if any negative cycle is detected.
3936
4147
  *
3937
- * Throws if a negative cycle is detected that affects the path to target.
4148
+ * **Example** (Finding all-pairs shortest paths)
3938
4149
  *
3939
- * @example
3940
4150
  * ```ts
3941
4151
  * import { Graph } from "effect"
3942
4152
  *
@@ -3954,8 +4164,8 @@ export const floydWarshall: {
3954
4164
  * const pathAToC = result.paths.get(0)?.get(2) // [0, 1, 2]
3955
4165
  * ```
3956
4166
  *
3957
- * @since 4.0.0
3958
4167
  * @category algorithms
4168
+ * @since 4.0.0
3959
4169
  */
3960
4170
  <N, E, T extends Kind = "directed">(
3961
4171
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -4073,10 +4283,15 @@ export const floydWarshall: {
4073
4283
  })
4074
4284
 
4075
4285
  /**
4076
- * Configuration for A* pathfinding algorithm.
4286
+ * Configuration for finding a shortest path with the A* algorithm.
4287
+ *
4288
+ * **Details**
4289
+ *
4290
+ * Specifies the source and target node indices, an edge-cost function, and a
4291
+ * heuristic that estimates the remaining cost from a node to the target.
4077
4292
  *
4078
- * @since 4.0.0
4079
4293
  * @category models
4294
+ * @since 4.0.0
4080
4295
  */
4081
4296
  export interface AstarConfig<E, N> {
4082
4297
  source: NodeIndex
@@ -4086,13 +4301,18 @@ export interface AstarConfig<E, N> {
4086
4301
  }
4087
4302
 
4088
4303
  /**
4089
- * Find the shortest path between two nodes using A* pathfinding algorithm.
4304
+ * Finds the shortest path from the configured source node to the target node
4305
+ * using the A* pathfinding algorithm.
4306
+ *
4307
+ * **Details**
4308
+ *
4309
+ * The edge-cost function must return non-negative weights, and the heuristic
4310
+ * should be admissible to preserve shortest-path guarantees. Returns
4311
+ * `Option.none()` when the target is not reachable, and throws a `GraphError`
4312
+ * when either endpoint is missing or a negative edge cost is encountered.
4090
4313
  *
4091
- * A* is an extension of Dijkstra's algorithm that uses a heuristic function to guide
4092
- * the search towards the target, potentially finding paths faster than Dijkstra's.
4093
- * The heuristic must be admissible (never overestimate the actual cost).
4314
+ * **Example** (Finding shortest paths with A-star)
4094
4315
  *
4095
- * @example
4096
4316
  * ```ts
4097
4317
  * import { Graph } from "effect"
4098
4318
  *
@@ -4123,18 +4343,23 @@ export interface AstarConfig<E, N> {
4123
4343
  * }
4124
4344
  * ```
4125
4345
  *
4126
- * @since 4.0.0
4127
4346
  * @category algorithms
4347
+ * @since 4.0.0
4128
4348
  */
4129
4349
  export const astar: {
4130
4350
  /**
4131
- * Find the shortest path between two nodes using A* pathfinding algorithm.
4351
+ * Finds the shortest path from the configured source node to the target node
4352
+ * using the A* pathfinding algorithm.
4353
+ *
4354
+ * **Details**
4132
4355
  *
4133
- * A* is an extension of Dijkstra's algorithm that uses a heuristic function to guide
4134
- * the search towards the target, potentially finding paths faster than Dijkstra's.
4135
- * The heuristic must be admissible (never overestimate the actual cost).
4356
+ * The edge-cost function must return non-negative weights, and the heuristic
4357
+ * should be admissible to preserve shortest-path guarantees. Returns
4358
+ * `Option.none()` when the target is not reachable, and throws a `GraphError`
4359
+ * when either endpoint is missing or a negative edge cost is encountered.
4360
+ *
4361
+ * **Example** (Finding shortest paths with A-star)
4136
4362
  *
4137
- * @example
4138
4363
  * ```ts
4139
4364
  * import { Graph } from "effect"
4140
4365
  *
@@ -4165,18 +4390,23 @@ export const astar: {
4165
4390
  * }
4166
4391
  * ```
4167
4392
  *
4168
- * @since 4.0.0
4169
4393
  * @category algorithms
4394
+ * @since 4.0.0
4170
4395
  */
4171
4396
  <E, N>(config: AstarConfig<E, N>): <T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<PathResult<E>>
4172
4397
  /**
4173
- * Find the shortest path between two nodes using A* pathfinding algorithm.
4398
+ * Finds the shortest path from the configured source node to the target node
4399
+ * using the A* pathfinding algorithm.
4400
+ *
4401
+ * **Details**
4174
4402
  *
4175
- * A* is an extension of Dijkstra's algorithm that uses a heuristic function to guide
4176
- * the search towards the target, potentially finding paths faster than Dijkstra's.
4177
- * The heuristic must be admissible (never overestimate the actual cost).
4403
+ * The edge-cost function must return non-negative weights, and the heuristic
4404
+ * should be admissible to preserve shortest-path guarantees. Returns
4405
+ * `Option.none()` when the target is not reachable, and throws a `GraphError`
4406
+ * when either endpoint is missing or a negative edge cost is encountered.
4407
+ *
4408
+ * **Example** (Finding shortest paths with A-star)
4178
4409
  *
4179
- * @example
4180
4410
  * ```ts
4181
4411
  * import { Graph } from "effect"
4182
4412
  *
@@ -4207,8 +4437,8 @@ export const astar: {
4207
4437
  * }
4208
4438
  * ```
4209
4439
  *
4210
- * @since 4.0.0
4211
4440
  * @category algorithms
4441
+ * @since 4.0.0
4212
4442
  */
4213
4443
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config: AstarConfig<E, N>): Option.Option<PathResult<E>>
4214
4444
  } = dual(2, <N, E, T extends Kind = "directed">(
@@ -4362,10 +4592,15 @@ export const astar: {
4362
4592
  })
4363
4593
 
4364
4594
  /**
4365
- * Configuration for Bellman-Ford algorithm.
4595
+ * Configuration for finding a shortest path with the Bellman-Ford algorithm.
4596
+ *
4597
+ * **Details**
4598
+ *
4599
+ * Specifies the source and target node indices, plus a cost function that maps
4600
+ * each edge's data to a numeric weight.
4366
4601
  *
4367
- * @since 4.0.0
4368
4602
  * @category models
4603
+ * @since 4.0.0
4369
4604
  */
4370
4605
  export interface BellmanFordConfig<E> {
4371
4606
  source: NodeIndex
@@ -4374,13 +4609,17 @@ export interface BellmanFordConfig<E> {
4374
4609
  }
4375
4610
 
4376
4611
  /**
4377
- * Find the shortest path between two nodes using Bellman-Ford algorithm.
4612
+ * Finds the shortest path from the configured source node to the target node
4613
+ * using the Bellman-Ford algorithm.
4614
+ *
4615
+ * **Details**
4616
+ *
4617
+ * Negative edge weights are allowed. Returns `Option.none()` when the target is
4618
+ * unreachable or when a negative cycle affects the path to the target. Throws a
4619
+ * `GraphError` when either endpoint is missing.
4378
4620
  *
4379
- * Bellman-Ford algorithm can handle negative edge weights and detects negative cycles.
4380
- * It has O(VE) time complexity, slower than Dijkstra's but more versatile.
4381
- * Returns Option.none() if a negative cycle is detected that affects the path.
4621
+ * **Example** (Finding shortest paths with Bellman-Ford)
4382
4622
  *
4383
- * @example
4384
4623
  * ```ts
4385
4624
  * import { Graph } from "effect"
4386
4625
  *
@@ -4405,18 +4644,22 @@ export interface BellmanFordConfig<E> {
4405
4644
  * }
4406
4645
  * ```
4407
4646
  *
4408
- * @since 4.0.0
4409
4647
  * @category algorithms
4648
+ * @since 4.0.0
4410
4649
  */
4411
4650
  export const bellmanFord: {
4412
4651
  /**
4413
- * Find the shortest path between two nodes using Bellman-Ford algorithm.
4652
+ * Finds the shortest path from the configured source node to the target node
4653
+ * using the Bellman-Ford algorithm.
4654
+ *
4655
+ * **Details**
4656
+ *
4657
+ * Negative edge weights are allowed. Returns `Option.none()` when the target is
4658
+ * unreachable or when a negative cycle affects the path to the target. Throws a
4659
+ * `GraphError` when either endpoint is missing.
4414
4660
  *
4415
- * Bellman-Ford algorithm can handle negative edge weights and detects negative cycles.
4416
- * It has O(VE) time complexity, slower than Dijkstra's but more versatile.
4417
- * Returns Option.none() if a negative cycle is detected that affects the path.
4661
+ * **Example** (Finding shortest paths with Bellman-Ford)
4418
4662
  *
4419
- * @example
4420
4663
  * ```ts
4421
4664
  * import { Graph } from "effect"
4422
4665
  *
@@ -4441,18 +4684,22 @@ export const bellmanFord: {
4441
4684
  * }
4442
4685
  * ```
4443
4686
  *
4444
- * @since 4.0.0
4445
4687
  * @category algorithms
4688
+ * @since 4.0.0
4446
4689
  */
4447
4690
  <E>(config: BellmanFordConfig<E>): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<PathResult<E>>
4448
4691
  /**
4449
- * Find the shortest path between two nodes using Bellman-Ford algorithm.
4692
+ * Finds the shortest path from the configured source node to the target node
4693
+ * using the Bellman-Ford algorithm.
4694
+ *
4695
+ * **Details**
4450
4696
  *
4451
- * Bellman-Ford algorithm can handle negative edge weights and detects negative cycles.
4452
- * It has O(VE) time complexity, slower than Dijkstra's but more versatile.
4453
- * Returns Option.none() if a negative cycle is detected that affects the path.
4697
+ * Negative edge weights are allowed. Returns `Option.none()` when the target is
4698
+ * unreachable or when a negative cycle affects the path to the target. Throws a
4699
+ * `GraphError` when either endpoint is missing.
4700
+ *
4701
+ * **Example** (Finding shortest paths with Bellman-Ford)
4454
4702
  *
4455
- * @example
4456
4703
  * ```ts
4457
4704
  * import { Graph } from "effect"
4458
4705
  *
@@ -4477,8 +4724,8 @@ export const bellmanFord: {
4477
4724
  * }
4478
4725
  * ```
4479
4726
  *
4480
- * @since 4.0.0
4481
4727
  * @category algorithms
4728
+ * @since 4.0.0
4482
4729
  */
4483
4730
  <N, E, T extends Kind = "directed">(
4484
4731
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
@@ -4614,13 +4861,16 @@ export const bellmanFord: {
4614
4861
  })
4615
4862
 
4616
4863
  /**
4617
- * Concrete class for iterables that produce [NodeIndex, NodeData] tuples.
4864
+ * Iterable wrapper used by graph traversal and listing APIs.
4865
+ *
4866
+ * **Details**
4618
4867
  *
4619
- * This class provides a common abstraction for all iterables that return node data,
4620
- * including traversal iterators (DFS, BFS, etc.) and element iterators (nodes, externals).
4621
- * It uses a mapEntry function pattern for flexible iteration and transformation.
4868
+ * A `Walker` yields `[index, data]` pairs lazily and can be viewed as just the
4869
+ * indices, just the values, or mapped entries with `indices`, `values`,
4870
+ * `entries`, and `visit`.
4871
+ *
4872
+ * **Example** (Working with node walkers)
4622
4873
  *
4623
- * @example
4624
4874
  * ```ts
4625
4875
  * import { Graph } from "effect"
4626
4876
  *
@@ -4644,8 +4894,8 @@ export const bellmanFord: {
4644
4894
  * const nodeEntries = Array.from(Graph.entries(allNodes)) // [[0, "A"], [1, "B"]]
4645
4895
  * ```
4646
4896
  *
4647
- * @since 4.0.0
4648
4897
  * @category models
4898
+ * @since 4.0.0
4649
4899
  */
4650
4900
  export class Walker<T, N> implements Iterable<[T, N]> {
4651
4901
  // @ts-ignore
@@ -4658,7 +4908,8 @@ export class Walker<T, N> implements Iterable<[T, N]> {
4658
4908
  * and returns an iterable of the mapped values. Skips elements that
4659
4909
  * no longer exist in the graph.
4660
4910
  *
4661
- * @example
4911
+ * **Example** (Visiting walker elements)
4912
+ *
4662
4913
  * ```ts
4663
4914
  * import { Graph } from "effect"
4664
4915
  *
@@ -4681,8 +4932,8 @@ export class Walker<T, N> implements Iterable<[T, N]> {
4681
4932
  * console.log(custom) // [{ id: 0, name: "A" }, { id: 1, name: "B" }]
4682
4933
  * ```
4683
4934
  *
4684
- * @since 4.0.0
4685
4935
  * @category iterators
4936
+ * @since 4.0.0
4686
4937
  */
4687
4938
  readonly visit: <U>(f: (index: T, data: N) => U) => Iterable<U>
4688
4939
 
@@ -4694,7 +4945,8 @@ export class Walker<T, N> implements Iterable<[T, N]> {
4694
4945
  * and returns an iterable of the mapped values. Skips elements that
4695
4946
  * no longer exist in the graph.
4696
4947
  *
4697
- * @example
4948
+ * **Example** (Visiting walker elements)
4949
+ *
4698
4950
  * ```ts
4699
4951
  * import { Graph } from "effect"
4700
4952
  *
@@ -4717,8 +4969,8 @@ export class Walker<T, N> implements Iterable<[T, N]> {
4717
4969
  * console.log(custom) // [{ id: 0, name: "A" }, { id: 1, name: "B" }]
4718
4970
  * ```
4719
4971
  *
4720
- * @since 4.0.0
4721
4972
  * @category iterators
4973
+ * @since 4.0.0
4722
4974
  */
4723
4975
  visit: <U>(f: (index: T, data: N) => U) => Iterable<U>
4724
4976
  ) {
@@ -4731,8 +4983,8 @@ export class Walker<T, N> implements Iterable<[T, N]> {
4731
4983
  * Type alias for node iteration using Walker.
4732
4984
  * NodeWalker is represented as Walker<NodeIndex, N>.
4733
4985
  *
4734
- * @since 4.0.0
4735
4986
  * @category models
4987
+ * @since 4.0.0
4736
4988
  */
4737
4989
  export type NodeWalker<N> = Walker<NodeIndex, N>
4738
4990
 
@@ -4740,15 +4992,16 @@ export type NodeWalker<N> = Walker<NodeIndex, N>
4740
4992
  * Type alias for edge iteration using Walker.
4741
4993
  * EdgeWalker is represented as Walker<EdgeIndex, Edge<E>>.
4742
4994
  *
4743
- * @since 4.0.0
4744
4995
  * @category models
4996
+ * @since 4.0.0
4745
4997
  */
4746
4998
  export type EdgeWalker<E> = Walker<EdgeIndex, Edge<E>>
4747
4999
 
4748
5000
  /**
4749
5001
  * Returns an iterator over the indices in the walker.
4750
5002
  *
4751
- * @example
5003
+ * **Example** (Iterating walker indices)
5004
+ *
4752
5005
  * ```ts
4753
5006
  * import { Graph } from "effect"
4754
5007
  *
@@ -4763,15 +5016,16 @@ export type EdgeWalker<E> = Walker<EdgeIndex, Edge<E>>
4763
5016
  * console.log(indices) // [0, 1]
4764
5017
  * ```
4765
5018
  *
4766
- * @since 4.0.0
4767
5019
  * @category utilities
5020
+ * @since 4.0.0
4768
5021
  */
4769
5022
  export const indices = <T, N>(walker: Walker<T, N>): Iterable<T> => walker.visit((index, _) => index)
4770
5023
 
4771
5024
  /**
4772
5025
  * Returns an iterator over the values (data) in the walker.
4773
5026
  *
4774
- * @example
5027
+ * **Example** (Iterating walker values)
5028
+ *
4775
5029
  * ```ts
4776
5030
  * import { Graph } from "effect"
4777
5031
  *
@@ -4786,15 +5040,16 @@ export const indices = <T, N>(walker: Walker<T, N>): Iterable<T> => walker.visit
4786
5040
  * console.log(values) // ["A", "B"]
4787
5041
  * ```
4788
5042
  *
4789
- * @since 4.0.0
4790
5043
  * @category utilities
5044
+ * @since 4.0.0
4791
5045
  */
4792
5046
  export const values = <T, N>(walker: Walker<T, N>): Iterable<N> => walker.visit((_, data) => data)
4793
5047
 
4794
5048
  /**
4795
5049
  * Returns an iterator over [index, data] entries in the walker.
4796
5050
  *
4797
- * @example
5051
+ * **Example** (Iterating walker entries)
5052
+ *
4798
5053
  * ```ts
4799
5054
  * import { Graph } from "effect"
4800
5055
  *
@@ -4809,17 +5064,23 @@ export const values = <T, N>(walker: Walker<T, N>): Iterable<N> => walker.visit(
4809
5064
  * console.log(entries) // [[0, "A"], [1, "B"]]
4810
5065
  * ```
4811
5066
  *
4812
- * @since 4.0.0
4813
5067
  * @category utilities
5068
+ * @since 4.0.0
4814
5069
  */
4815
5070
  export const entries = <T, N>(walker: Walker<T, N>): Iterable<[T, N]> =>
4816
5071
  walker.visit((index, data) => [index, data] as [T, N])
4817
5072
 
4818
5073
  /**
4819
- * Configuration options for search iterators.
5074
+ * Configuration for DFS, BFS, and postorder graph traversals.
5075
+ *
5076
+ * **Details**
5077
+ *
5078
+ * `start` supplies the node indices where traversal begins. If it is omitted,
5079
+ * the iterator is empty. `direction` chooses whether traversal follows
5080
+ * outgoing or incoming edges.
4820
5081
  *
4821
- * @since 4.0.0
4822
5082
  * @category models
5083
+ * @since 4.0.0
4823
5084
  */
4824
5085
  export interface SearchConfig {
4825
5086
  readonly start?: Array<NodeIndex>
@@ -4827,12 +5088,17 @@ export interface SearchConfig {
4827
5088
  }
4828
5089
 
4829
5090
  /**
4830
- * Creates a new DFS iterator with optional configuration.
5091
+ * Creates a lazy depth-first traversal iterator from the configured start
5092
+ * nodes.
4831
5093
  *
4832
- * The iterator maintains a stack of nodes to visit and tracks discovered nodes.
4833
- * It provides lazy evaluation of the depth-first search.
5094
+ * **Details**
5095
+ *
5096
+ * If no start nodes are supplied, the iterator is empty. The `direction` option
5097
+ * chooses whether to follow outgoing or incoming edges. Throws a `GraphError`
5098
+ * if any configured start node does not exist.
5099
+ *
5100
+ * **Example** (Traversing depth-first)
4834
5101
  *
4835
- * @example
4836
5102
  * ```ts
4837
5103
  * import { Graph } from "effect"
4838
5104
  *
@@ -4855,17 +5121,22 @@ export interface SearchConfig {
4855
5121
  * // Can be used programmatically
4856
5122
  * ```
4857
5123
  *
4858
- * @since 4.0.0
4859
5124
  * @category iterators
5125
+ * @since 4.0.0
4860
5126
  */
4861
5127
  export const dfs: {
4862
5128
  /**
4863
- * Creates a new DFS iterator with optional configuration.
5129
+ * Creates a lazy depth-first traversal iterator from the configured start
5130
+ * nodes.
5131
+ *
5132
+ * **Details**
4864
5133
  *
4865
- * The iterator maintains a stack of nodes to visit and tracks discovered nodes.
4866
- * It provides lazy evaluation of the depth-first search.
5134
+ * If no start nodes are supplied, the iterator is empty. The `direction` option
5135
+ * chooses whether to follow outgoing or incoming edges. Throws a `GraphError`
5136
+ * if any configured start node does not exist.
5137
+ *
5138
+ * **Example** (Traversing depth-first)
4867
5139
  *
4868
- * @example
4869
5140
  * ```ts
4870
5141
  * import { Graph } from "effect"
4871
5142
  *
@@ -4888,17 +5159,22 @@ export const dfs: {
4888
5159
  * // Can be used programmatically
4889
5160
  * ```
4890
5161
  *
4891
- * @since 4.0.0
4892
5162
  * @category iterators
5163
+ * @since 4.0.0
4893
5164
  */
4894
5165
  (config?: SearchConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>
4895
5166
  /**
4896
- * Creates a new DFS iterator with optional configuration.
5167
+ * Creates a lazy depth-first traversal iterator from the configured start
5168
+ * nodes.
5169
+ *
5170
+ * **Details**
5171
+ *
5172
+ * If no start nodes are supplied, the iterator is empty. The `direction` option
5173
+ * chooses whether to follow outgoing or incoming edges. Throws a `GraphError`
5174
+ * if any configured start node does not exist.
4897
5175
  *
4898
- * The iterator maintains a stack of nodes to visit and tracks discovered nodes.
4899
- * It provides lazy evaluation of the depth-first search.
5176
+ * **Example** (Traversing depth-first)
4900
5177
  *
4901
- * @example
4902
5178
  * ```ts
4903
5179
  * import { Graph } from "effect"
4904
5180
  *
@@ -4921,8 +5197,8 @@ export const dfs: {
4921
5197
  * // Can be used programmatically
4922
5198
  * ```
4923
5199
  *
4924
- * @since 4.0.0
4925
5200
  * @category iterators
5201
+ * @since 4.0.0
4926
5202
  */
4927
5203
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: SearchConfig): NodeWalker<N>
4928
5204
  } = dual((args) => isGraph(args[0]), <N, E, T extends Kind = "directed">(
@@ -4979,12 +5255,17 @@ export const dfs: {
4979
5255
  })
4980
5256
 
4981
5257
  /**
4982
- * Creates a new BFS iterator with optional configuration.
5258
+ * Creates a lazy breadth-first traversal iterator from the configured start
5259
+ * nodes.
5260
+ *
5261
+ * **Details**
4983
5262
  *
4984
- * The iterator maintains a queue of nodes to visit and tracks discovered nodes.
4985
- * It provides lazy evaluation of the breadth-first search.
5263
+ * If no start nodes are supplied, the iterator is empty. The `direction` option
5264
+ * chooses whether to follow outgoing or incoming edges. Throws a `GraphError`
5265
+ * if any configured start node does not exist.
5266
+ *
5267
+ * **Example** (Traversing breadth-first)
4986
5268
  *
4987
- * @example
4988
5269
  * ```ts
4989
5270
  * import { Graph } from "effect"
4990
5271
  *
@@ -5007,17 +5288,22 @@ export const dfs: {
5007
5288
  * // Can be used programmatically
5008
5289
  * ```
5009
5290
  *
5010
- * @since 4.0.0
5011
5291
  * @category iterators
5292
+ * @since 4.0.0
5012
5293
  */
5013
5294
  export const bfs: {
5014
5295
  /**
5015
- * Creates a new BFS iterator with optional configuration.
5296
+ * Creates a lazy breadth-first traversal iterator from the configured start
5297
+ * nodes.
5016
5298
  *
5017
- * The iterator maintains a queue of nodes to visit and tracks discovered nodes.
5018
- * It provides lazy evaluation of the breadth-first search.
5299
+ * **Details**
5300
+ *
5301
+ * If no start nodes are supplied, the iterator is empty. The `direction` option
5302
+ * chooses whether to follow outgoing or incoming edges. Throws a `GraphError`
5303
+ * if any configured start node does not exist.
5304
+ *
5305
+ * **Example** (Traversing breadth-first)
5019
5306
  *
5020
- * @example
5021
5307
  * ```ts
5022
5308
  * import { Graph } from "effect"
5023
5309
  *
@@ -5040,17 +5326,22 @@ export const bfs: {
5040
5326
  * // Can be used programmatically
5041
5327
  * ```
5042
5328
  *
5043
- * @since 4.0.0
5044
5329
  * @category iterators
5330
+ * @since 4.0.0
5045
5331
  */
5046
5332
  (config?: SearchConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>
5047
5333
  /**
5048
- * Creates a new BFS iterator with optional configuration.
5334
+ * Creates a lazy breadth-first traversal iterator from the configured start
5335
+ * nodes.
5049
5336
  *
5050
- * The iterator maintains a queue of nodes to visit and tracks discovered nodes.
5051
- * It provides lazy evaluation of the breadth-first search.
5337
+ * **Details**
5338
+ *
5339
+ * If no start nodes are supplied, the iterator is empty. The `direction` option
5340
+ * chooses whether to follow outgoing or incoming edges. Throws a `GraphError`
5341
+ * if any configured start node does not exist.
5342
+ *
5343
+ * **Example** (Traversing breadth-first)
5052
5344
  *
5053
- * @example
5054
5345
  * ```ts
5055
5346
  * import { Graph } from "effect"
5056
5347
  *
@@ -5073,8 +5364,8 @@ export const bfs: {
5073
5364
  * // Can be used programmatically
5074
5365
  * ```
5075
5366
  *
5076
- * @since 4.0.0
5077
5367
  * @category iterators
5368
+ * @since 4.0.0
5078
5369
  */
5079
5370
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: SearchConfig): NodeWalker<N>
5080
5371
  } = dual((args) => isGraph(args[0]), <N, E, T extends Kind = "directed">(
@@ -5127,10 +5418,16 @@ export const bfs: {
5127
5418
  })
5128
5419
 
5129
5420
  /**
5130
- * Configuration options for topological sort iterator.
5421
+ * Configuration for the topological sort iterator.
5422
+ *
5423
+ * **Details**
5424
+ *
5425
+ * `initials` optionally supplies the node indices used as initial queue
5426
+ * entries. When omitted, topological sorting starts from all nodes with zero
5427
+ * in-degree.
5131
5428
  *
5132
- * @since 4.0.0
5133
5429
  * @category models
5430
+ * @since 4.0.0
5134
5431
  */
5135
5432
  export interface TopoConfig {
5136
5433
  readonly initials?: Array<NodeIndex>
@@ -5142,7 +5439,8 @@ export interface TopoConfig {
5142
5439
  * The iterator uses Kahn's algorithm to lazily produce nodes in topological order.
5143
5440
  * Throws an error if the graph contains cycles.
5144
5441
  *
5145
- * @example
5442
+ * **Example** (Sorting topologically)
5443
+ *
5146
5444
  * ```ts
5147
5445
  * import { Graph } from "effect"
5148
5446
  *
@@ -5163,7 +5461,7 @@ export interface TopoConfig {
5163
5461
  * // With initial nodes
5164
5462
  * const topo2 = Graph.topo(graph, { initials: [0] })
5165
5463
  *
5166
- * // Throws error for cyclic graph
5464
+ * // Check before sorting a cyclic graph
5167
5465
  * const cyclicGraph = Graph.directed<string, number>((mutable) => {
5168
5466
  * const a = Graph.addNode(mutable, "A")
5169
5467
  * const b = Graph.addNode(mutable, "B")
@@ -5171,15 +5469,13 @@ export interface TopoConfig {
5171
5469
  * Graph.addEdge(mutable, b, a, 2) // Creates cycle
5172
5470
  * })
5173
5471
  *
5174
- * try {
5175
- * Graph.topo(cyclicGraph) // Throws: "Cannot perform topological sort on cyclic graph"
5176
- * } catch (error) {
5177
- * console.log((error as Error).message)
5472
+ * if (!Graph.isAcyclic(cyclicGraph)) {
5473
+ * console.log("cyclic graph") // cyclic graph
5178
5474
  * }
5179
5475
  * ```
5180
5476
  *
5181
- * @since 4.0.0
5182
5477
  * @category iterators
5478
+ * @since 4.0.0
5183
5479
  */
5184
5480
  export const topo: {
5185
5481
  /**
@@ -5188,7 +5484,8 @@ export const topo: {
5188
5484
  * The iterator uses Kahn's algorithm to lazily produce nodes in topological order.
5189
5485
  * Throws an error if the graph contains cycles.
5190
5486
  *
5191
- * @example
5487
+ * **Example** (Sorting topologically)
5488
+ *
5192
5489
  * ```ts
5193
5490
  * import { Graph } from "effect"
5194
5491
  *
@@ -5209,7 +5506,7 @@ export const topo: {
5209
5506
  * // With initial nodes
5210
5507
  * const topo2 = Graph.topo(graph, { initials: [0] })
5211
5508
  *
5212
- * // Throws error for cyclic graph
5509
+ * // Check before sorting a cyclic graph
5213
5510
  * const cyclicGraph = Graph.directed<string, number>((mutable) => {
5214
5511
  * const a = Graph.addNode(mutable, "A")
5215
5512
  * const b = Graph.addNode(mutable, "B")
@@ -5217,15 +5514,13 @@ export const topo: {
5217
5514
  * Graph.addEdge(mutable, b, a, 2) // Creates cycle
5218
5515
  * })
5219
5516
  *
5220
- * try {
5221
- * Graph.topo(cyclicGraph) // Throws: "Cannot perform topological sort on cyclic graph"
5222
- * } catch (error) {
5223
- * console.log((error as Error).message)
5517
+ * if (!Graph.isAcyclic(cyclicGraph)) {
5518
+ * console.log("cyclic graph") // cyclic graph
5224
5519
  * }
5225
5520
  * ```
5226
5521
  *
5227
- * @since 4.0.0
5228
5522
  * @category iterators
5523
+ * @since 4.0.0
5229
5524
  */
5230
5525
  (config?: TopoConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>
5231
5526
  /**
@@ -5234,7 +5529,8 @@ export const topo: {
5234
5529
  * The iterator uses Kahn's algorithm to lazily produce nodes in topological order.
5235
5530
  * Throws an error if the graph contains cycles.
5236
5531
  *
5237
- * @example
5532
+ * **Example** (Sorting topologically)
5533
+ *
5238
5534
  * ```ts
5239
5535
  * import { Graph } from "effect"
5240
5536
  *
@@ -5255,7 +5551,7 @@ export const topo: {
5255
5551
  * // With initial nodes
5256
5552
  * const topo2 = Graph.topo(graph, { initials: [0] })
5257
5553
  *
5258
- * // Throws error for cyclic graph
5554
+ * // Check before sorting a cyclic graph
5259
5555
  * const cyclicGraph = Graph.directed<string, number>((mutable) => {
5260
5556
  * const a = Graph.addNode(mutable, "A")
5261
5557
  * const b = Graph.addNode(mutable, "B")
@@ -5263,15 +5559,13 @@ export const topo: {
5263
5559
  * Graph.addEdge(mutable, b, a, 2) // Creates cycle
5264
5560
  * })
5265
5561
  *
5266
- * try {
5267
- * Graph.topo(cyclicGraph) // Throws: "Cannot perform topological sort on cyclic graph"
5268
- * } catch (error) {
5269
- * console.log((error as Error).message)
5562
+ * if (!Graph.isAcyclic(cyclicGraph)) {
5563
+ * console.log("cyclic graph") // cyclic graph
5270
5564
  * }
5271
5565
  * ```
5272
5566
  *
5273
- * @since 4.0.0
5274
5567
  * @category iterators
5568
+ * @since 4.0.0
5275
5569
  */
5276
5570
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: TopoConfig): NodeWalker<N>
5277
5571
  } = dual((args) => isGraph(args[0]), <N, E, T extends Kind = "directed">(
@@ -5358,13 +5652,17 @@ export const topo: {
5358
5652
  })
5359
5653
 
5360
5654
  /**
5361
- * Creates a new DFS postorder iterator with optional configuration.
5655
+ * Creates a lazy depth-first postorder traversal iterator from the configured
5656
+ * start nodes.
5657
+ *
5658
+ * **Details**
5659
+ *
5660
+ * Nodes are emitted after their reachable descendants have been processed. If
5661
+ * no start nodes are supplied, the iterator is empty. The `direction` option
5662
+ * chooses whether to follow outgoing or incoming edges.
5362
5663
  *
5363
- * The iterator maintains a stack with visit state tracking and emits nodes
5364
- * in postorder (after all descendants have been processed). Essential for
5365
- * dependency resolution and tree destruction algorithms.
5664
+ * **Example** (Traversing in postorder)
5366
5665
  *
5367
- * @example
5368
5666
  * ```ts
5369
5667
  * import { Graph } from "effect"
5370
5668
  *
@@ -5383,18 +5681,22 @@ export const topo: {
5383
5681
  * }
5384
5682
  * ```
5385
5683
  *
5386
- * @since 4.0.0
5387
5684
  * @category iterators
5685
+ * @since 4.0.0
5388
5686
  */
5389
5687
  export const dfsPostOrder: {
5390
5688
  /**
5391
- * Creates a new DFS postorder iterator with optional configuration.
5689
+ * Creates a lazy depth-first postorder traversal iterator from the configured
5690
+ * start nodes.
5691
+ *
5692
+ * **Details**
5392
5693
  *
5393
- * The iterator maintains a stack with visit state tracking and emits nodes
5394
- * in postorder (after all descendants have been processed). Essential for
5395
- * dependency resolution and tree destruction algorithms.
5694
+ * Nodes are emitted after their reachable descendants have been processed. If
5695
+ * no start nodes are supplied, the iterator is empty. The `direction` option
5696
+ * chooses whether to follow outgoing or incoming edges.
5697
+ *
5698
+ * **Example** (Traversing in postorder)
5396
5699
  *
5397
- * @example
5398
5700
  * ```ts
5399
5701
  * import { Graph } from "effect"
5400
5702
  *
@@ -5413,18 +5715,22 @@ export const dfsPostOrder: {
5413
5715
  * }
5414
5716
  * ```
5415
5717
  *
5416
- * @since 4.0.0
5417
5718
  * @category iterators
5719
+ * @since 4.0.0
5418
5720
  */
5419
5721
  (config?: SearchConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>
5420
5722
  /**
5421
- * Creates a new DFS postorder iterator with optional configuration.
5723
+ * Creates a lazy depth-first postorder traversal iterator from the configured
5724
+ * start nodes.
5725
+ *
5726
+ * **Details**
5422
5727
  *
5423
- * The iterator maintains a stack with visit state tracking and emits nodes
5424
- * in postorder (after all descendants have been processed). Essential for
5425
- * dependency resolution and tree destruction algorithms.
5728
+ * Nodes are emitted after their reachable descendants have been processed. If
5729
+ * no start nodes are supplied, the iterator is empty. The `direction` option
5730
+ * chooses whether to follow outgoing or incoming edges.
5731
+ *
5732
+ * **Example** (Traversing in postorder)
5426
5733
  *
5427
- * @example
5428
5734
  * ```ts
5429
5735
  * import { Graph } from "effect"
5430
5736
  *
@@ -5443,8 +5749,8 @@ export const dfsPostOrder: {
5443
5749
  * }
5444
5750
  * ```
5445
5751
  *
5446
- * @since 4.0.0
5447
5752
  * @category iterators
5753
+ * @since 4.0.0
5448
5754
  */
5449
5755
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: SearchConfig): NodeWalker<N>
5450
5756
  } = dual((args) => isGraph(args[0]), <N, E, T extends Kind = "directed">(
@@ -5520,7 +5826,8 @@ export const dfsPostOrder: {
5520
5826
  * The iterator produces node indices in the order they were added to the graph.
5521
5827
  * This provides access to all nodes regardless of connectivity.
5522
5828
  *
5523
- * @example
5829
+ * **Example** (Iterating all nodes)
5830
+ *
5524
5831
  * ```ts
5525
5832
  * import { Graph } from "effect"
5526
5833
  *
@@ -5535,8 +5842,8 @@ export const dfsPostOrder: {
5535
5842
  * console.log(indices) // [0, 1, 2]
5536
5843
  * ```
5537
5844
  *
5538
- * @since 4.0.0
5539
5845
  * @category iterators
5846
+ * @since 4.0.0
5540
5847
  */
5541
5848
  export const nodes = <N, E, T extends Kind = "directed">(
5542
5849
  graph: Graph<N, E, T> | MutableGraph<N, E, T>
@@ -5565,7 +5872,8 @@ export const nodes = <N, E, T extends Kind = "directed">(
5565
5872
  * The iterator produces edge indices in the order they were added to the graph.
5566
5873
  * This provides access to all edges regardless of connectivity.
5567
5874
  *
5568
- * @example
5875
+ * **Example** (Iterating all edges)
5876
+ *
5569
5877
  * ```ts
5570
5878
  * import { Graph } from "effect"
5571
5879
  *
@@ -5581,8 +5889,8 @@ export const nodes = <N, E, T extends Kind = "directed">(
5581
5889
  * console.log(indices) // [0, 1]
5582
5890
  * ```
5583
5891
  *
5584
- * @since 4.0.0
5585
5892
  * @category iterators
5893
+ * @since 4.0.0
5586
5894
  */
5587
5895
  export const edges = <N, E, T extends Kind = "directed">(
5588
5896
  graph: Graph<N, E, T> | MutableGraph<N, E, T>
@@ -5606,10 +5914,16 @@ export const edges = <N, E, T extends Kind = "directed">(
5606
5914
  }))
5607
5915
 
5608
5916
  /**
5609
- * Configuration for externals iterator.
5917
+ * Configuration for selecting external nodes.
5918
+ *
5919
+ * **Details**
5920
+ *
5921
+ * `direction` chooses which missing edge direction makes a node external:
5922
+ * `"outgoing"` selects nodes with no outgoing edges, and `"incoming"` selects
5923
+ * nodes with no incoming edges.
5610
5924
  *
5611
- * @since 4.0.0
5612
5925
  * @category models
5926
+ * @since 4.0.0
5613
5927
  */
5614
5928
  export interface ExternalsConfig {
5615
5929
  readonly direction?: Direction
@@ -5622,7 +5936,8 @@ export interface ExternalsConfig {
5622
5936
  * no incoming edges (direction="incoming"). These are useful for finding
5623
5937
  * sources, sinks, or isolated nodes.
5624
5938
  *
5625
- * @example
5939
+ * **Example** (Iterating external nodes)
5940
+ *
5626
5941
  * ```ts
5627
5942
  * import { Graph } from "effect"
5628
5943
  *
@@ -5649,8 +5964,8 @@ export interface ExternalsConfig {
5649
5964
  * console.log(sources) // [0, 3]
5650
5965
  * ```
5651
5966
  *
5652
- * @since 4.0.0
5653
5967
  * @category iterators
5968
+ * @since 4.0.0
5654
5969
  */
5655
5970
  export const externals: {
5656
5971
  /**
@@ -5660,7 +5975,8 @@ export const externals: {
5660
5975
  * no incoming edges (direction="incoming"). These are useful for finding
5661
5976
  * sources, sinks, or isolated nodes.
5662
5977
  *
5663
- * @example
5978
+ * **Example** (Iterating external nodes)
5979
+ *
5664
5980
  * ```ts
5665
5981
  * import { Graph } from "effect"
5666
5982
  *
@@ -5687,8 +6003,8 @@ export const externals: {
5687
6003
  * console.log(sources) // [0, 3]
5688
6004
  * ```
5689
6005
  *
5690
- * @since 4.0.0
5691
6006
  * @category iterators
6007
+ * @since 4.0.0
5692
6008
  */
5693
6009
  (config?: ExternalsConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>
5694
6010
  /**
@@ -5698,7 +6014,8 @@ export const externals: {
5698
6014
  * no incoming edges (direction="incoming"). These are useful for finding
5699
6015
  * sources, sinks, or isolated nodes.
5700
6016
  *
5701
- * @example
6017
+ * **Example** (Iterating external nodes)
6018
+ *
5702
6019
  * ```ts
5703
6020
  * import { Graph } from "effect"
5704
6021
  *
@@ -5725,8 +6042,8 @@ export const externals: {
5725
6042
  * console.log(sources) // [0, 3]
5726
6043
  * ```
5727
6044
  *
5728
- * @since 4.0.0
5729
6045
  * @category iterators
6046
+ * @since 4.0.0
5730
6047
  */
5731
6048
  <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: ExternalsConfig): NodeWalker<N>
5732
6049
  } = dual((args) => isGraph(args[0]), <N, E, T extends Kind = "directed">(