effect 4.0.0-beta.2 → 4.0.0-beta.21

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 (881) hide show
  1. package/dist/Array.d.ts +127 -299
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +102 -62
  4. package/dist/Array.js.map +1 -1
  5. package/dist/Cache.d.ts +2 -2
  6. package/dist/Cache.d.ts.map +1 -1
  7. package/dist/Cache.js +6 -5
  8. package/dist/Cache.js.map +1 -1
  9. package/dist/Cause.d.ts +1 -1
  10. package/dist/Cause.d.ts.map +1 -1
  11. package/dist/Channel.d.ts +116 -30
  12. package/dist/Channel.d.ts.map +1 -1
  13. package/dist/Channel.js +82 -37
  14. package/dist/Channel.js.map +1 -1
  15. package/dist/Chunk.d.ts +54 -247
  16. package/dist/Chunk.d.ts.map +1 -1
  17. package/dist/Chunk.js +36 -67
  18. package/dist/Chunk.js.map +1 -1
  19. package/dist/Combiner.d.ts +280 -13
  20. package/dist/Combiner.d.ts.map +1 -1
  21. package/dist/Combiner.js +198 -7
  22. package/dist/Combiner.js.map +1 -1
  23. package/dist/Config.d.ts +165 -9
  24. package/dist/Config.d.ts.map +1 -1
  25. package/dist/Config.js +62 -7
  26. package/dist/Config.js.map +1 -1
  27. package/dist/ConfigProvider.d.ts +1 -1
  28. package/dist/Cron.d.ts +1 -1
  29. package/dist/Data.d.ts +534 -365
  30. package/dist/Data.d.ts.map +1 -1
  31. package/dist/Data.js +132 -79
  32. package/dist/Data.js.map +1 -1
  33. package/dist/DateTime.d.ts +23 -161
  34. package/dist/DateTime.d.ts.map +1 -1
  35. package/dist/DateTime.js +6 -51
  36. package/dist/DateTime.js.map +1 -1
  37. package/dist/Duration.d.ts +12 -12
  38. package/dist/Duration.d.ts.map +1 -1
  39. package/dist/Duration.js +12 -12
  40. package/dist/Duration.js.map +1 -1
  41. package/dist/Effect.d.ts +829 -692
  42. package/dist/Effect.d.ts.map +1 -1
  43. package/dist/Effect.js +263 -251
  44. package/dist/Effect.js.map +1 -1
  45. package/dist/Encoding.d.ts +194 -0
  46. package/dist/Encoding.d.ts.map +1 -0
  47. package/dist/Encoding.js +352 -0
  48. package/dist/Encoding.js.map +1 -0
  49. package/dist/Equal.d.ts +276 -109
  50. package/dist/Equal.d.ts.map +1 -1
  51. package/dist/Equal.js +124 -48
  52. package/dist/Equal.js.map +1 -1
  53. package/dist/ErrorReporter.d.ts +376 -0
  54. package/dist/ErrorReporter.d.ts.map +1 -0
  55. package/dist/ErrorReporter.js +246 -0
  56. package/dist/ErrorReporter.js.map +1 -0
  57. package/dist/Fiber.d.ts +2 -2
  58. package/dist/Fiber.d.ts.map +1 -1
  59. package/dist/Fiber.js.map +1 -1
  60. package/dist/FileSystem.d.ts +1 -1
  61. package/dist/FileSystem.d.ts.map +1 -1
  62. package/dist/FileSystem.js +5 -5
  63. package/dist/FileSystem.js.map +1 -1
  64. package/dist/Filter.d.ts +30 -34
  65. package/dist/Filter.d.ts.map +1 -1
  66. package/dist/Filter.js +15 -13
  67. package/dist/Filter.js.map +1 -1
  68. package/dist/Formatter.d.ts +131 -47
  69. package/dist/Formatter.d.ts.map +1 -1
  70. package/dist/Formatter.js +229 -51
  71. package/dist/Formatter.js.map +1 -1
  72. package/dist/Graph.d.ts +1 -1
  73. package/dist/Graph.d.ts.map +1 -1
  74. package/dist/Graph.js +5 -8
  75. package/dist/Graph.js.map +1 -1
  76. package/dist/HashMap.d.ts +15 -14
  77. package/dist/HashMap.d.ts.map +1 -1
  78. package/dist/HashMap.js +4 -4
  79. package/dist/HashMap.js.map +1 -1
  80. package/dist/Iterable.d.ts +40 -39
  81. package/dist/Iterable.d.ts.map +1 -1
  82. package/dist/Iterable.js +94 -22
  83. package/dist/Iterable.js.map +1 -1
  84. package/dist/JsonSchema.d.ts +299 -10
  85. package/dist/JsonSchema.d.ts.map +1 -1
  86. package/dist/JsonSchema.js +323 -4
  87. package/dist/JsonSchema.js.map +1 -1
  88. package/dist/Latch.d.ts +109 -0
  89. package/dist/Latch.d.ts.map +1 -0
  90. package/dist/Latch.js +72 -0
  91. package/dist/Latch.js.map +1 -0
  92. package/dist/Layer.d.ts +9 -9
  93. package/dist/Layer.d.ts.map +1 -1
  94. package/dist/Layer.js.map +1 -1
  95. package/dist/LayerMap.d.ts +4 -4
  96. package/dist/LayerMap.d.ts.map +1 -1
  97. package/dist/LogLevel.d.ts +32 -0
  98. package/dist/LogLevel.d.ts.map +1 -1
  99. package/dist/LogLevel.js +28 -100
  100. package/dist/LogLevel.js.map +1 -1
  101. package/dist/Logger.d.ts +29 -95
  102. package/dist/Logger.d.ts.map +1 -1
  103. package/dist/Logger.js +2 -3
  104. package/dist/Logger.js.map +1 -1
  105. package/dist/ManagedRuntime.d.ts +1 -1
  106. package/dist/ManagedRuntime.js +1 -1
  107. package/dist/Metric.d.ts +2 -2
  108. package/dist/Metric.d.ts.map +1 -1
  109. package/dist/Metric.js +1 -1
  110. package/dist/Metric.js.map +1 -1
  111. package/dist/Optic.d.ts +947 -18
  112. package/dist/Optic.d.ts.map +1 -1
  113. package/dist/Optic.js +454 -5
  114. package/dist/Optic.js.map +1 -1
  115. package/dist/Option.d.ts +22 -15
  116. package/dist/Option.d.ts.map +1 -1
  117. package/dist/Option.js +14 -7
  118. package/dist/Option.js.map +1 -1
  119. package/dist/Pipeable.d.ts +17 -0
  120. package/dist/Pipeable.d.ts.map +1 -1
  121. package/dist/Pipeable.js +19 -1
  122. package/dist/Pipeable.js.map +1 -1
  123. package/dist/PlatformError.d.ts +10 -9
  124. package/dist/PlatformError.d.ts.map +1 -1
  125. package/dist/PlatformError.js +2 -2
  126. package/dist/PlatformError.js.map +1 -1
  127. package/dist/Pool.d.ts +6 -4
  128. package/dist/Pool.d.ts.map +1 -1
  129. package/dist/Pool.js +7 -5
  130. package/dist/Pool.js.map +1 -1
  131. package/dist/PubSub.d.ts +3 -2
  132. package/dist/PubSub.d.ts.map +1 -1
  133. package/dist/PubSub.js +3 -2
  134. package/dist/PubSub.js.map +1 -1
  135. package/dist/Pull.d.ts.map +1 -1
  136. package/dist/Pull.js +1 -1
  137. package/dist/Pull.js.map +1 -1
  138. package/dist/Queue.d.ts.map +1 -1
  139. package/dist/Queue.js +0 -1
  140. package/dist/Queue.js.map +1 -1
  141. package/dist/Random.d.ts +35 -1
  142. package/dist/Random.d.ts.map +1 -1
  143. package/dist/Random.js +46 -12
  144. package/dist/Random.js.map +1 -1
  145. package/dist/RcMap.d.ts +2 -2
  146. package/dist/RcMap.d.ts.map +1 -1
  147. package/dist/RcMap.js +1 -1
  148. package/dist/RcMap.js.map +1 -1
  149. package/dist/RcRef.d.ts +1 -1
  150. package/dist/RcRef.d.ts.map +1 -1
  151. package/dist/Record.d.ts +24 -120
  152. package/dist/Record.d.ts.map +1 -1
  153. package/dist/Record.js +21 -41
  154. package/dist/Record.js.map +1 -1
  155. package/dist/Reducer.d.ts +166 -7
  156. package/dist/Reducer.d.ts.map +1 -1
  157. package/dist/Reducer.js +135 -1
  158. package/dist/Reducer.js.map +1 -1
  159. package/dist/References.d.ts +3 -3
  160. package/dist/References.d.ts.map +1 -1
  161. package/dist/Request.d.ts +1 -1
  162. package/dist/Request.d.ts.map +1 -1
  163. package/dist/Request.js +2 -1
  164. package/dist/Request.js.map +1 -1
  165. package/dist/RequestResolver.d.ts +6 -26
  166. package/dist/RequestResolver.d.ts.map +1 -1
  167. package/dist/RequestResolver.js +0 -20
  168. package/dist/RequestResolver.js.map +1 -1
  169. package/dist/Result.d.ts +12 -0
  170. package/dist/Result.d.ts.map +1 -1
  171. package/dist/Result.js +12 -0
  172. package/dist/Result.js.map +1 -1
  173. package/dist/Schedule.d.ts +47 -20
  174. package/dist/Schedule.d.ts.map +1 -1
  175. package/dist/Schedule.js +94 -34
  176. package/dist/Schedule.js.map +1 -1
  177. package/dist/Schema.d.ts +266 -50
  178. package/dist/Schema.d.ts.map +1 -1
  179. package/dist/Schema.js +426 -74
  180. package/dist/Schema.js.map +1 -1
  181. package/dist/SchemaAST.d.ts.map +1 -1
  182. package/dist/SchemaAST.js +7 -6
  183. package/dist/SchemaAST.js.map +1 -1
  184. package/dist/SchemaGetter.d.ts +2 -2
  185. package/dist/SchemaGetter.d.ts.map +1 -1
  186. package/dist/SchemaGetter.js +12 -14
  187. package/dist/SchemaGetter.js.map +1 -1
  188. package/dist/SchemaParser.d.ts +5 -0
  189. package/dist/SchemaParser.d.ts.map +1 -1
  190. package/dist/SchemaParser.js +10 -0
  191. package/dist/SchemaParser.js.map +1 -1
  192. package/dist/SchemaRepresentation.d.ts +44 -43
  193. package/dist/SchemaRepresentation.d.ts.map +1 -1
  194. package/dist/SchemaRepresentation.js +43 -24
  195. package/dist/SchemaRepresentation.js.map +1 -1
  196. package/dist/SchemaTransformation.d.ts +107 -3
  197. package/dist/SchemaTransformation.d.ts.map +1 -1
  198. package/dist/SchemaTransformation.js +159 -4
  199. package/dist/SchemaTransformation.js.map +1 -1
  200. package/dist/ScopedCache.d.ts +2 -2
  201. package/dist/ScopedCache.d.ts.map +1 -1
  202. package/dist/ScopedCache.js +1 -1
  203. package/dist/ScopedCache.js.map +1 -1
  204. package/dist/Semaphore.d.ts +211 -0
  205. package/dist/Semaphore.d.ts.map +1 -0
  206. package/dist/{PartitionedSemaphore.js → Semaphore.js} +97 -13
  207. package/dist/Semaphore.js.map +1 -0
  208. package/dist/ServiceMap.d.ts +39 -30
  209. package/dist/ServiceMap.d.ts.map +1 -1
  210. package/dist/ServiceMap.js +3 -3
  211. package/dist/ServiceMap.js.map +1 -1
  212. package/dist/Sink.d.ts +13 -13
  213. package/dist/Sink.d.ts.map +1 -1
  214. package/dist/Sink.js +53 -6
  215. package/dist/Sink.js.map +1 -1
  216. package/dist/Stream.d.ts +235 -423
  217. package/dist/Stream.d.ts.map +1 -1
  218. package/dist/Stream.js +124 -77
  219. package/dist/Stream.js.map +1 -1
  220. package/dist/Struct.d.ts +16 -0
  221. package/dist/Struct.d.ts.map +1 -1
  222. package/dist/Struct.js +22 -0
  223. package/dist/Struct.js.map +1 -1
  224. package/dist/SubscriptionRef.d.ts +2 -1
  225. package/dist/SubscriptionRef.d.ts.map +1 -1
  226. package/dist/SubscriptionRef.js +2 -1
  227. package/dist/SubscriptionRef.js.map +1 -1
  228. package/dist/SynchronizedRef.d.ts +2 -1
  229. package/dist/SynchronizedRef.d.ts.map +1 -1
  230. package/dist/SynchronizedRef.js +2 -1
  231. package/dist/SynchronizedRef.js.map +1 -1
  232. package/dist/Trie.d.ts +18 -17
  233. package/dist/Trie.d.ts.map +1 -1
  234. package/dist/Trie.js +5 -5
  235. package/dist/Trie.js.map +1 -1
  236. package/dist/TxChunk.d.ts +37 -37
  237. package/dist/TxChunk.d.ts.map +1 -1
  238. package/dist/TxChunk.js +3 -3
  239. package/dist/TxChunk.js.map +1 -1
  240. package/dist/TxDeferred.d.ts +328 -0
  241. package/dist/TxDeferred.d.ts.map +1 -0
  242. package/dist/TxDeferred.js +196 -0
  243. package/dist/TxDeferred.js.map +1 -0
  244. package/dist/TxHashMap.d.ts +84 -83
  245. package/dist/TxHashMap.d.ts.map +1 -1
  246. package/dist/TxHashMap.js +24 -24
  247. package/dist/TxHashMap.js.map +1 -1
  248. package/dist/TxHashSet.d.ts +35 -35
  249. package/dist/TxHashSet.d.ts.map +1 -1
  250. package/dist/TxHashSet.js +14 -14
  251. package/dist/TxHashSet.js.map +1 -1
  252. package/dist/TxPriorityQueue.d.ts +609 -0
  253. package/dist/TxPriorityQueue.d.ts.map +1 -0
  254. package/dist/TxPriorityQueue.js +415 -0
  255. package/dist/TxPriorityQueue.js.map +1 -0
  256. package/dist/TxPubSub.d.ts +585 -0
  257. package/dist/TxPubSub.d.ts.map +1 -0
  258. package/dist/TxPubSub.js +521 -0
  259. package/dist/TxPubSub.js.map +1 -0
  260. package/dist/TxQueue.d.ts +32 -32
  261. package/dist/TxQueue.d.ts.map +1 -1
  262. package/dist/TxQueue.js +26 -26
  263. package/dist/TxQueue.js.map +1 -1
  264. package/dist/TxReentrantLock.d.ts +523 -0
  265. package/dist/TxReentrantLock.d.ts.map +1 -0
  266. package/dist/TxReentrantLock.js +504 -0
  267. package/dist/TxReentrantLock.js.map +1 -0
  268. package/dist/TxRef.d.ts +34 -34
  269. package/dist/TxRef.d.ts.map +1 -1
  270. package/dist/TxRef.js +21 -14
  271. package/dist/TxRef.js.map +1 -1
  272. package/dist/TxSemaphore.d.ts +8 -8
  273. package/dist/TxSemaphore.d.ts.map +1 -1
  274. package/dist/TxSemaphore.js +7 -7
  275. package/dist/TxSemaphore.js.map +1 -1
  276. package/dist/TxSubscriptionRef.d.ts +508 -0
  277. package/dist/TxSubscriptionRef.d.ts.map +1 -0
  278. package/dist/TxSubscriptionRef.js +293 -0
  279. package/dist/TxSubscriptionRef.js.map +1 -0
  280. package/dist/Types.d.ts +84 -6
  281. package/dist/Types.d.ts.map +1 -1
  282. package/dist/index.d.ts +591 -20
  283. package/dist/index.d.ts.map +1 -1
  284. package/dist/index.js +591 -20
  285. package/dist/index.js.map +1 -1
  286. package/dist/internal/core.js +11 -3
  287. package/dist/internal/core.js.map +1 -1
  288. package/dist/internal/dateTime.js +3 -11
  289. package/dist/internal/dateTime.js.map +1 -1
  290. package/dist/internal/effect.js +263 -99
  291. package/dist/internal/effect.js.map +1 -1
  292. package/dist/internal/hashMap.js +5 -4
  293. package/dist/internal/hashMap.js.map +1 -1
  294. package/dist/internal/random.d.ts +2 -0
  295. package/dist/internal/random.d.ts.map +1 -0
  296. package/dist/internal/random.js +13 -0
  297. package/dist/internal/random.js.map +1 -0
  298. package/dist/internal/rcRef.js +3 -2
  299. package/dist/internal/rcRef.js.map +1 -1
  300. package/dist/internal/request.js +2 -2
  301. package/dist/internal/request.js.map +1 -1
  302. package/dist/internal/schema/annotations.js +2 -0
  303. package/dist/internal/schema/annotations.js.map +1 -1
  304. package/dist/internal/schema/schema.js +1 -0
  305. package/dist/internal/schema/schema.js.map +1 -1
  306. package/dist/internal/trie.js +5 -4
  307. package/dist/internal/trie.js.map +1 -1
  308. package/dist/testing/TestClock.d.ts +7 -6
  309. package/dist/testing/TestClock.d.ts.map +1 -1
  310. package/dist/testing/TestClock.js +6 -4
  311. package/dist/testing/TestClock.js.map +1 -1
  312. package/dist/testing/TestSchema.d.ts +8 -8
  313. package/dist/testing/TestSchema.d.ts.map +1 -1
  314. package/dist/testing/TestSchema.js.map +1 -1
  315. package/dist/unstable/ai/AiError.d.ts +128 -48
  316. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  317. package/dist/unstable/ai/AiError.js +11 -12
  318. package/dist/unstable/ai/AiError.js.map +1 -1
  319. package/dist/unstable/ai/Chat.d.ts +3 -3
  320. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  321. package/dist/unstable/ai/Chat.js +4 -3
  322. package/dist/unstable/ai/Chat.js.map +1 -1
  323. package/dist/unstable/ai/LanguageModel.d.ts +4 -2
  324. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  325. package/dist/unstable/ai/LanguageModel.js +86 -14
  326. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  327. package/dist/unstable/ai/McpSchema.d.ts +163 -87
  328. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  329. package/dist/unstable/ai/McpSchema.js +49 -12
  330. package/dist/unstable/ai/McpSchema.js.map +1 -1
  331. package/dist/unstable/ai/McpServer.d.ts +1 -1
  332. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  333. package/dist/unstable/ai/McpServer.js +35 -7
  334. package/dist/unstable/ai/McpServer.js.map +1 -1
  335. package/dist/unstable/ai/Model.d.ts +25 -7
  336. package/dist/unstable/ai/Model.d.ts.map +1 -1
  337. package/dist/unstable/ai/Model.js +22 -6
  338. package/dist/unstable/ai/Model.js.map +1 -1
  339. package/dist/unstable/ai/Prompt.d.ts +20 -20
  340. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  341. package/dist/unstable/ai/Response.d.ts +26 -26
  342. package/dist/unstable/ai/Response.d.ts.map +1 -1
  343. package/dist/unstable/ai/Response.js +1 -1
  344. package/dist/unstable/ai/Response.js.map +1 -1
  345. package/dist/unstable/ai/Tool.d.ts +19 -3
  346. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  347. package/dist/unstable/ai/Tool.js +14 -9
  348. package/dist/unstable/ai/Tool.js.map +1 -1
  349. package/dist/unstable/ai/index.d.ts +1 -1
  350. package/dist/unstable/ai/index.js +1 -1
  351. package/dist/unstable/cli/CliError.d.ts +5 -5
  352. package/dist/unstable/cli/CliOutput.js +59 -6
  353. package/dist/unstable/cli/CliOutput.js.map +1 -1
  354. package/dist/unstable/cli/Command.d.ts +276 -19
  355. package/dist/unstable/cli/Command.d.ts.map +1 -1
  356. package/dist/unstable/cli/Command.js +234 -36
  357. package/dist/unstable/cli/Command.js.map +1 -1
  358. package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
  359. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
  360. package/dist/unstable/cli/GlobalFlag.js +118 -0
  361. package/dist/unstable/cli/GlobalFlag.js.map +1 -0
  362. package/dist/unstable/cli/HelpDoc.d.ts +70 -2
  363. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  364. package/dist/unstable/cli/index.d.ts +4 -0
  365. package/dist/unstable/cli/index.d.ts.map +1 -1
  366. package/dist/unstable/cli/index.js +4 -0
  367. package/dist/unstable/cli/index.js.map +1 -1
  368. package/dist/unstable/cli/internal/command.d.ts +17 -8
  369. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  370. package/dist/unstable/cli/internal/command.js +32 -23
  371. package/dist/unstable/cli/internal/command.js.map +1 -1
  372. package/dist/unstable/cli/internal/completions/CommandDescriptor.js +7 -2
  373. package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
  374. package/dist/unstable/cli/internal/help.d.ts +33 -0
  375. package/dist/unstable/cli/internal/help.d.ts.map +1 -0
  376. package/dist/unstable/cli/internal/help.js +107 -0
  377. package/dist/unstable/cli/internal/help.js.map +1 -0
  378. package/dist/unstable/cli/internal/parser.js +29 -36
  379. package/dist/unstable/cli/internal/parser.js.map +1 -1
  380. package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
  381. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  382. package/dist/unstable/cluster/ClusterCron.js +1 -1
  383. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  384. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  385. package/dist/unstable/cluster/ClusterWorkflowEngine.js +4 -3
  386. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  387. package/dist/unstable/cluster/Entity.d.ts +7 -6
  388. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  389. package/dist/unstable/cluster/Entity.js.map +1 -1
  390. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  391. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  392. package/dist/unstable/cluster/Envelope.d.ts +1 -1
  393. package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
  394. package/dist/unstable/cluster/K8sHttpClient.js +4 -4
  395. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  396. package/dist/unstable/cluster/Message.d.ts +10 -10
  397. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  398. package/dist/unstable/cluster/MessageStorage.js +2 -1
  399. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  400. package/dist/unstable/cluster/Reply.d.ts +6 -6
  401. package/dist/unstable/cluster/Runner.d.ts +1 -1
  402. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  403. package/dist/unstable/cluster/Runners.js +4 -3
  404. package/dist/unstable/cluster/Runners.js.map +1 -1
  405. package/dist/unstable/cluster/Sharding.d.ts +2 -2
  406. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  407. package/dist/unstable/cluster/Sharding.js +9 -7
  408. package/dist/unstable/cluster/Sharding.js.map +1 -1
  409. package/dist/unstable/cluster/ShardingConfig.d.ts +21 -21
  410. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  411. package/dist/unstable/cluster/ShardingConfig.js +20 -20
  412. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  413. package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
  414. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  415. package/dist/unstable/cluster/internal/entityManager.js +5 -4
  416. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  417. package/dist/unstable/cluster/internal/entityReaper.js +2 -1
  418. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  419. package/dist/unstable/cluster/internal/resourceRef.js +2 -1
  420. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  421. package/dist/unstable/devtools/DevToolsSchema.d.ts +36 -36
  422. package/dist/unstable/encoding/Msgpack.d.ts +1 -1
  423. package/dist/unstable/encoding/Ndjson.d.ts +1 -1
  424. package/dist/unstable/encoding/Sse.d.ts +4 -4
  425. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  426. package/dist/unstable/encoding/Sse.js +1 -1
  427. package/dist/unstable/encoding/Sse.js.map +1 -1
  428. package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
  429. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  430. package/dist/unstable/eventlog/EventLog.js +2 -1
  431. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  432. package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
  433. package/dist/unstable/http/Cookies.d.ts +3 -3
  434. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  435. package/dist/unstable/http/Cookies.js +2 -2
  436. package/dist/unstable/http/Cookies.js.map +1 -1
  437. package/dist/unstable/http/Headers.d.ts.map +1 -1
  438. package/dist/unstable/http/Headers.js +27 -10
  439. package/dist/unstable/http/Headers.js.map +1 -1
  440. package/dist/unstable/http/HttpBody.d.ts +17 -2
  441. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  442. package/dist/unstable/http/HttpBody.js +28 -1
  443. package/dist/unstable/http/HttpBody.js.map +1 -1
  444. package/dist/unstable/http/HttpClient.d.ts +37 -13
  445. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  446. package/dist/unstable/http/HttpClient.js +4 -4
  447. package/dist/unstable/http/HttpClient.js.map +1 -1
  448. package/dist/unstable/http/HttpClientError.d.ts +7 -7
  449. package/dist/unstable/http/HttpClientRequest.d.ts +27 -11
  450. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  451. package/dist/unstable/http/HttpClientRequest.js +15 -3
  452. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  453. package/dist/unstable/http/HttpEffect.d.ts +3 -8
  454. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  455. package/dist/unstable/http/HttpEffect.js +42 -56
  456. package/dist/unstable/http/HttpEffect.js.map +1 -1
  457. package/dist/unstable/http/HttpMethod.d.ts +4 -4
  458. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  459. package/dist/unstable/http/HttpMethod.js +3 -3
  460. package/dist/unstable/http/HttpMethod.js.map +1 -1
  461. package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
  462. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  463. package/dist/unstable/http/HttpMiddleware.js +8 -17
  464. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  465. package/dist/unstable/http/HttpServerError.d.ts +20 -33
  466. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  467. package/dist/unstable/http/HttpServerError.js +37 -44
  468. package/dist/unstable/http/HttpServerError.js.map +1 -1
  469. package/dist/unstable/http/HttpServerRequest.d.ts +1 -1
  470. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  471. package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
  472. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  473. package/dist/unstable/http/HttpServerRespondable.js +5 -5
  474. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  475. package/dist/unstable/http/HttpServerResponse.d.ts +2 -1
  476. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  477. package/dist/unstable/http/HttpServerResponse.js +3 -1
  478. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  479. package/dist/unstable/http/Multipart.d.ts +3 -3
  480. package/dist/unstable/http/UrlParams.d.ts +14 -6
  481. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  482. package/dist/unstable/http/UrlParams.js +1 -1
  483. package/dist/unstable/http/UrlParams.js.map +1 -1
  484. package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
  485. package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
  486. package/dist/unstable/http/internal/preResponseHandler.js +10 -0
  487. package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
  488. package/dist/unstable/httpapi/HttpApi.d.ts +3 -3
  489. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  490. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  491. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +11 -5
  492. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  493. package/dist/unstable/httpapi/HttpApiBuilder.js +23 -12
  494. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  495. package/dist/unstable/httpapi/HttpApiClient.d.ts +7 -2
  496. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  497. package/dist/unstable/httpapi/HttpApiClient.js +3 -3
  498. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  499. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +31 -44
  500. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  501. package/dist/unstable/httpapi/HttpApiEndpoint.js +15 -24
  502. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  503. package/dist/unstable/httpapi/HttpApiError.d.ts +11 -0
  504. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  505. package/dist/unstable/httpapi/HttpApiError.js +29 -9
  506. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  507. package/dist/unstable/httpapi/HttpApiGroup.d.ts +3 -3
  508. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  509. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  510. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -4
  511. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  512. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  513. package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
  514. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  515. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  516. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
  517. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  518. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  519. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  520. package/dist/unstable/httpapi/OpenApi.js +32 -21
  521. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  522. package/dist/unstable/observability/Otlp.d.ts +12 -12
  523. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  524. package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
  525. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  526. package/dist/unstable/observability/OtlpExporter.js +1 -1
  527. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  528. package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
  529. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  530. package/dist/unstable/observability/OtlpLogger.js +7 -4
  531. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  532. package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
  533. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  534. package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
  535. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  536. package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
  537. package/dist/unstable/persistence/KeyValueStore.js +6 -6
  538. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  539. package/dist/unstable/persistence/Persistable.d.ts +2 -2
  540. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  541. package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
  542. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  543. package/dist/unstable/persistence/PersistedCache.js +2 -1
  544. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  545. package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
  546. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  547. package/dist/unstable/persistence/PersistedQueue.js +12 -11
  548. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  549. package/dist/unstable/persistence/Persistence.d.ts +1 -1
  550. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  551. package/dist/unstable/persistence/Persistence.js +2 -2
  552. package/dist/unstable/persistence/Persistence.js.map +1 -1
  553. package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
  554. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  555. package/dist/unstable/persistence/RateLimiter.js +1 -1
  556. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  557. package/dist/unstable/process/ChildProcess.d.ts +5 -128
  558. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  559. package/dist/unstable/process/ChildProcess.js +1 -65
  560. package/dist/unstable/process/ChildProcess.js.map +1 -1
  561. package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -7
  562. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  563. package/dist/unstable/process/ChildProcessSpawner.js +21 -1
  564. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  565. package/dist/unstable/reactivity/Atom.d.ts +10 -10
  566. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  567. package/dist/unstable/reactivity/Atom.js +16 -13
  568. package/dist/unstable/reactivity/Atom.js.map +1 -1
  569. package/dist/unstable/reactivity/AtomHttpApi.d.ts +8 -8
  570. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  571. package/dist/unstable/reactivity/AtomHttpApi.js +3 -3
  572. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  573. package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
  574. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  575. package/dist/unstable/reactivity/AtomRegistry.js +24 -7
  576. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  577. package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
  578. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  579. package/dist/unstable/reactivity/AtomRpc.js +1 -1
  580. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  581. package/dist/unstable/reactivity/Hydration.d.ts +39 -0
  582. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
  583. package/dist/unstable/reactivity/Hydration.js +76 -0
  584. package/dist/unstable/reactivity/Hydration.js.map +1 -0
  585. package/dist/unstable/reactivity/index.d.ts +4 -0
  586. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  587. package/dist/unstable/reactivity/index.js +4 -0
  588. package/dist/unstable/reactivity/index.js.map +1 -1
  589. package/dist/unstable/rpc/Rpc.d.ts +4 -4
  590. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  591. package/dist/unstable/rpc/Rpc.js.map +1 -1
  592. package/dist/unstable/rpc/RpcClient.d.ts +5 -26
  593. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  594. package/dist/unstable/rpc/RpcClient.js +6 -13
  595. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  596. package/dist/unstable/rpc/RpcGroup.d.ts +2 -2
  597. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  598. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  599. package/dist/unstable/rpc/RpcMiddleware.d.ts +3 -3
  600. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  601. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  602. package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
  603. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  604. package/dist/unstable/rpc/RpcSchema.js +14 -0
  605. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  606. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  607. package/dist/unstable/rpc/RpcSerialization.js +34 -9
  608. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  609. package/dist/unstable/rpc/RpcServer.d.ts +0 -7
  610. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  611. package/dist/unstable/rpc/RpcServer.js +15 -15
  612. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  613. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  614. package/dist/unstable/rpc/Utils.js +2 -1
  615. package/dist/unstable/rpc/Utils.js.map +1 -1
  616. package/dist/unstable/schema/Model.d.ts +1 -1
  617. package/dist/unstable/schema/Model.d.ts.map +1 -1
  618. package/dist/unstable/schema/VariantSchema.d.ts +3 -3
  619. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  620. package/dist/unstable/schema/VariantSchema.js +3 -3
  621. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  622. package/dist/unstable/socket/Socket.d.ts +4 -4
  623. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  624. package/dist/unstable/socket/Socket.js +6 -5
  625. package/dist/unstable/socket/Socket.js.map +1 -1
  626. package/dist/unstable/socket/SocketServer.d.ts +3 -3
  627. package/dist/unstable/sql/Migrator.d.ts +1 -1
  628. package/dist/unstable/sql/SqlClient.d.ts +1 -1
  629. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  630. package/dist/unstable/sql/SqlError.d.ts +14 -14
  631. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  632. package/dist/unstable/sql/SqlError.js +9 -3
  633. package/dist/unstable/sql/SqlError.js.map +1 -1
  634. package/dist/unstable/sql/SqlModel.d.ts +2 -2
  635. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  636. package/dist/unstable/sql/SqlModel.js +3 -3
  637. package/dist/unstable/sql/SqlModel.js.map +1 -1
  638. package/dist/unstable/sql/SqlSchema.d.ts +16 -5
  639. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  640. package/dist/unstable/sql/SqlSchema.js +17 -7
  641. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  642. package/dist/unstable/sql/Statement.js +0 -1
  643. package/dist/unstable/sql/Statement.js.map +1 -1
  644. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  645. package/dist/unstable/workers/Worker.js +2 -1
  646. package/dist/unstable/workers/Worker.js.map +1 -1
  647. package/dist/unstable/workflow/DurableClock.d.ts +3 -3
  648. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  649. package/dist/unstable/workflow/DurableClock.js +3 -3
  650. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  651. package/dist/unstable/workflow/DurableDeferred.js +2 -2
  652. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  653. package/dist/unstable/workflow/Workflow.d.ts +3 -3
  654. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  655. package/dist/unstable/workflow/Workflow.js +1 -1
  656. package/dist/unstable/workflow/Workflow.js.map +1 -1
  657. package/dist/unstable/workflow/WorkflowEngine.d.ts +12 -1
  658. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  659. package/dist/unstable/workflow/WorkflowEngine.js +137 -1
  660. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  661. package/package.json +2 -2
  662. package/src/Array.ts +190 -342
  663. package/src/Cache.ts +9 -8
  664. package/src/Cause.ts +1 -1
  665. package/src/Channel.ts +554 -138
  666. package/src/Chunk.ts +81 -268
  667. package/src/Combiner.ts +280 -13
  668. package/src/Config.ts +183 -21
  669. package/src/Data.ts +538 -374
  670. package/src/DateTime.ts +24 -164
  671. package/src/Duration.ts +15 -15
  672. package/src/Effect.ts +991 -800
  673. package/src/Encoding.ts +879 -0
  674. package/src/Equal.ts +278 -111
  675. package/src/ErrorReporter.ts +459 -0
  676. package/src/Fiber.ts +9 -2
  677. package/src/FileSystem.ts +7 -8
  678. package/src/Filter.ts +48 -58
  679. package/src/Formatter.ts +253 -51
  680. package/src/Graph.ts +24 -11
  681. package/src/HashMap.ts +15 -14
  682. package/src/Iterable.ts +105 -50
  683. package/src/JsonSchema.ts +383 -10
  684. package/src/Latch.ts +112 -0
  685. package/src/Layer.ts +11 -15
  686. package/src/LayerMap.ts +5 -5
  687. package/src/LogLevel.ts +37 -0
  688. package/src/Logger.ts +33 -100
  689. package/src/ManagedRuntime.ts +1 -1
  690. package/src/Metric.ts +4 -4
  691. package/src/Optic.ts +948 -19
  692. package/src/Option.ts +30 -20
  693. package/src/Pipeable.ts +32 -1
  694. package/src/PlatformError.ts +5 -5
  695. package/src/Pool.ts +13 -11
  696. package/src/PubSub.ts +10 -9
  697. package/src/Pull.ts +1 -1
  698. package/src/Queue.ts +0 -1
  699. package/src/Random.ts +51 -14
  700. package/src/RcMap.ts +5 -5
  701. package/src/RcRef.ts +1 -1
  702. package/src/Record.ts +43 -152
  703. package/src/Reducer.ts +166 -7
  704. package/src/References.ts +4 -4
  705. package/src/Request.ts +3 -2
  706. package/src/RequestResolver.ts +9 -29
  707. package/src/Result.ts +13 -0
  708. package/src/Schedule.ts +318 -160
  709. package/src/Schema.ts +661 -116
  710. package/src/SchemaAST.ts +7 -6
  711. package/src/SchemaGetter.ts +12 -14
  712. package/src/SchemaParser.ts +11 -0
  713. package/src/SchemaRepresentation.ts +43 -24
  714. package/src/SchemaTransformation.ts +189 -4
  715. package/src/ScopedCache.ts +3 -3
  716. package/src/Semaphore.ts +356 -0
  717. package/src/ServiceMap.ts +47 -38
  718. package/src/Sink.ts +78 -26
  719. package/src/Stream.ts +566 -601
  720. package/src/Struct.ts +26 -0
  721. package/src/SubscriptionRef.ts +3 -2
  722. package/src/SynchronizedRef.ts +3 -2
  723. package/src/Trie.ts +18 -17
  724. package/src/TxChunk.ts +72 -53
  725. package/src/TxDeferred.ts +394 -0
  726. package/src/TxHashMap.ts +332 -285
  727. package/src/TxHashSet.ts +111 -116
  728. package/src/TxPriorityQueue.ts +767 -0
  729. package/src/TxPubSub.ts +789 -0
  730. package/src/TxQueue.ts +241 -251
  731. package/src/TxReentrantLock.ts +753 -0
  732. package/src/TxRef.ts +50 -38
  733. package/src/TxSemaphore.ts +29 -32
  734. package/src/TxSubscriptionRef.ts +639 -0
  735. package/src/Types.ts +78 -2
  736. package/src/index.ts +600 -21
  737. package/src/internal/core.ts +12 -5
  738. package/src/internal/dateTime.ts +9 -30
  739. package/src/internal/effect.ts +744 -265
  740. package/src/internal/hashMap.ts +9 -7
  741. package/src/internal/random.ts +20 -0
  742. package/src/internal/rcRef.ts +4 -3
  743. package/src/internal/request.ts +2 -2
  744. package/src/internal/schema/annotations.ts +2 -0
  745. package/src/internal/schema/schema.ts +1 -0
  746. package/src/internal/trie.ts +16 -9
  747. package/src/testing/TestClock.ts +13 -11
  748. package/src/testing/TestSchema.ts +10 -10
  749. package/src/unstable/ai/AiError.ts +97 -44
  750. package/src/unstable/ai/Chat.ts +12 -11
  751. package/src/unstable/ai/LanguageModel.ts +129 -25
  752. package/src/unstable/ai/McpSchema.ts +59 -13
  753. package/src/unstable/ai/McpServer.ts +48 -9
  754. package/src/unstable/ai/Model.ts +40 -9
  755. package/src/unstable/ai/Prompt.ts +37 -37
  756. package/src/unstable/ai/Response.ts +25 -25
  757. package/src/unstable/ai/Tool.ts +19 -13
  758. package/src/unstable/ai/index.ts +1 -1
  759. package/src/unstable/cli/CliOutput.ts +75 -6
  760. package/src/unstable/cli/Command.ts +501 -60
  761. package/src/unstable/cli/GlobalFlag.ts +243 -0
  762. package/src/unstable/cli/HelpDoc.ts +80 -2
  763. package/src/unstable/cli/index.ts +5 -0
  764. package/src/unstable/cli/internal/command.ts +50 -34
  765. package/src/unstable/cli/internal/completions/CommandDescriptor.ts +7 -2
  766. package/src/unstable/cli/internal/help.ts +146 -0
  767. package/src/unstable/cli/internal/parser.ts +33 -54
  768. package/src/unstable/cluster/ClusterCron.ts +2 -2
  769. package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -4
  770. package/src/unstable/cluster/Entity.ts +11 -10
  771. package/src/unstable/cluster/EntityResource.ts +4 -4
  772. package/src/unstable/cluster/Envelope.ts +1 -1
  773. package/src/unstable/cluster/K8sHttpClient.ts +5 -5
  774. package/src/unstable/cluster/MessageStorage.ts +3 -5
  775. package/src/unstable/cluster/Runners.ts +6 -5
  776. package/src/unstable/cluster/Sharding.ts +12 -10
  777. package/src/unstable/cluster/ShardingConfig.ts +30 -31
  778. package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
  779. package/src/unstable/cluster/internal/entityManager.ts +9 -8
  780. package/src/unstable/cluster/internal/entityReaper.ts +2 -1
  781. package/src/unstable/cluster/internal/resourceRef.ts +2 -1
  782. package/src/unstable/encoding/Sse.ts +3 -5
  783. package/src/unstable/eventlog/EventLog.ts +2 -1
  784. package/src/unstable/http/Cookies.ts +3 -3
  785. package/src/unstable/http/Headers.ts +28 -13
  786. package/src/unstable/http/HttpBody.ts +42 -1
  787. package/src/unstable/http/HttpClient.ts +58 -23
  788. package/src/unstable/http/HttpClientRequest.ts +38 -13
  789. package/src/unstable/http/HttpEffect.ts +46 -68
  790. package/src/unstable/http/HttpMethod.ts +16 -4
  791. package/src/unstable/http/HttpMiddleware.ts +9 -24
  792. package/src/unstable/http/HttpServerError.ts +42 -45
  793. package/src/unstable/http/HttpServerRequest.ts +1 -1
  794. package/src/unstable/http/HttpServerRespondable.ts +6 -6
  795. package/src/unstable/http/HttpServerResponse.ts +4 -2
  796. package/src/unstable/http/Multipart.ts +2 -2
  797. package/src/unstable/http/UrlParams.ts +20 -5
  798. package/src/unstable/http/internal/preResponseHandler.ts +15 -0
  799. package/src/unstable/httpapi/HttpApi.ts +5 -5
  800. package/src/unstable/httpapi/HttpApiBuilder.ts +77 -21
  801. package/src/unstable/httpapi/HttpApiClient.ts +14 -6
  802. package/src/unstable/httpapi/HttpApiEndpoint.ts +67 -83
  803. package/src/unstable/httpapi/HttpApiError.ts +30 -9
  804. package/src/unstable/httpapi/HttpApiGroup.ts +6 -6
  805. package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -4
  806. package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
  807. package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
  808. package/src/unstable/httpapi/OpenApi.ts +41 -23
  809. package/src/unstable/observability/Otlp.ts +12 -12
  810. package/src/unstable/observability/OtlpExporter.ts +3 -3
  811. package/src/unstable/observability/OtlpLogger.ts +13 -9
  812. package/src/unstable/observability/OtlpMetrics.ts +4 -4
  813. package/src/unstable/observability/OtlpTracer.ts +4 -4
  814. package/src/unstable/persistence/KeyValueStore.ts +6 -6
  815. package/src/unstable/persistence/Persistable.ts +2 -2
  816. package/src/unstable/persistence/PersistedCache.ts +20 -9
  817. package/src/unstable/persistence/PersistedQueue.ts +25 -24
  818. package/src/unstable/persistence/Persistence.ts +3 -3
  819. package/src/unstable/persistence/RateLimiter.ts +4 -4
  820. package/src/unstable/process/ChildProcess.ts +6 -208
  821. package/src/unstable/process/ChildProcessSpawner.ts +75 -14
  822. package/src/unstable/reactivity/Atom.ts +27 -25
  823. package/src/unstable/reactivity/AtomHttpApi.ts +21 -20
  824. package/src/unstable/reactivity/AtomRegistry.ts +31 -7
  825. package/src/unstable/reactivity/AtomRpc.ts +3 -3
  826. package/src/unstable/reactivity/Hydration.ts +112 -0
  827. package/src/unstable/reactivity/index.ts +5 -0
  828. package/src/unstable/rpc/Rpc.ts +6 -6
  829. package/src/unstable/rpc/RpcClient.ts +12 -54
  830. package/src/unstable/rpc/RpcGroup.ts +4 -4
  831. package/src/unstable/rpc/RpcMiddleware.ts +3 -3
  832. package/src/unstable/rpc/RpcSchema.ts +17 -0
  833. package/src/unstable/rpc/RpcSerialization.ts +44 -9
  834. package/src/unstable/rpc/RpcServer.ts +21 -30
  835. package/src/unstable/rpc/Utils.ts +2 -1
  836. package/src/unstable/schema/VariantSchema.ts +6 -6
  837. package/src/unstable/socket/Socket.ts +16 -17
  838. package/src/unstable/sql/SqlClient.ts +1 -1
  839. package/src/unstable/sql/SqlError.ts +11 -9
  840. package/src/unstable/sql/SqlModel.ts +5 -5
  841. package/src/unstable/sql/SqlSchema.ts +41 -25
  842. package/src/unstable/sql/Statement.ts +0 -1
  843. package/src/unstable/workers/Worker.ts +2 -1
  844. package/src/unstable/workflow/DurableClock.ts +8 -8
  845. package/src/unstable/workflow/DurableDeferred.ts +2 -2
  846. package/src/unstable/workflow/Workflow.ts +6 -2
  847. package/src/unstable/workflow/WorkflowEngine.ts +185 -2
  848. package/dist/PartitionedSemaphore.d.ts +0 -52
  849. package/dist/PartitionedSemaphore.d.ts.map +0 -1
  850. package/dist/PartitionedSemaphore.js.map +0 -1
  851. package/dist/encoding/Base64.d.ts +0 -67
  852. package/dist/encoding/Base64.d.ts.map +0 -1
  853. package/dist/encoding/Base64.js +0 -146
  854. package/dist/encoding/Base64.js.map +0 -1
  855. package/dist/encoding/Base64Url.d.ts +0 -60
  856. package/dist/encoding/Base64Url.d.ts.map +0 -1
  857. package/dist/encoding/Base64Url.js +0 -89
  858. package/dist/encoding/Base64Url.js.map +0 -1
  859. package/dist/encoding/EncodingError.d.ts +0 -31
  860. package/dist/encoding/EncodingError.d.ts.map +0 -1
  861. package/dist/encoding/EncodingError.js +0 -22
  862. package/dist/encoding/EncodingError.js.map +0 -1
  863. package/dist/encoding/Hex.d.ts +0 -61
  864. package/dist/encoding/Hex.d.ts.map +0 -1
  865. package/dist/encoding/Hex.js +0 -115
  866. package/dist/encoding/Hex.js.map +0 -1
  867. package/dist/encoding/index.d.ts +0 -26
  868. package/dist/encoding/index.d.ts.map +0 -1
  869. package/dist/encoding/index.js +0 -27
  870. package/dist/encoding/index.js.map +0 -1
  871. package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
  872. package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
  873. package/dist/unstable/cli/internal/builtInFlags.js +0 -44
  874. package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
  875. package/src/PartitionedSemaphore.ts +0 -182
  876. package/src/encoding/Base64.ts +0 -366
  877. package/src/encoding/Base64Url.ts +0 -104
  878. package/src/encoding/EncodingError.ts +0 -35
  879. package/src/encoding/Hex.ts +0 -390
  880. package/src/encoding/index.ts +0 -31
  881. package/src/unstable/cli/internal/builtInFlags.ts +0 -78
package/src/Channel.ts CHANGED
@@ -63,14 +63,15 @@ import * as Chunk from "./Chunk.ts"
63
63
  import * as Effect from "./Effect.ts"
64
64
  import * as Exit from "./Exit.ts"
65
65
  import * as Fiber from "./Fiber.ts"
66
- import * as Filter from "./Filter.ts"
66
+ import type * as Filter from "./Filter.ts"
67
67
  import type { LazyArg } from "./Function.ts"
68
68
  import { constant, constTrue, constVoid, dual, identity as identity_ } from "./Function.ts"
69
69
  import { ClockRef, endSpan } from "./internal/effect.ts"
70
70
  import { addSpanStackTrace } from "./internal/tracer.ts"
71
71
  import * as Iterable from "./Iterable.ts"
72
+ import * as Latch from "./Latch.ts"
72
73
  import * as Layer from "./Layer.ts"
73
- import type { LogLevel } from "./LogLevel.ts"
74
+ import type { Severity } from "./LogLevel.ts"
74
75
  import * as Option from "./Option.ts"
75
76
  import type { Pipeable } from "./Pipeable.ts"
76
77
  import { pipeArguments } from "./Pipeable.ts"
@@ -83,6 +84,7 @@ import { TracerTimingEnabled } from "./References.ts"
83
84
  import * as Result from "./Result.ts"
84
85
  import * as Schedule from "./Schedule.ts"
85
86
  import * as Scope from "./Scope.ts"
87
+ import * as Semaphore from "./Semaphore.ts"
86
88
  import * as ServiceMap from "./ServiceMap.ts"
87
89
  import * as String from "./String.ts"
88
90
  import * as Take from "./Take.ts"
@@ -2084,7 +2086,7 @@ const mapEffectConcurrent = <
2084
2086
  const trackFiber = Fiber.runIn(forkedScope)
2085
2087
 
2086
2088
  if (options.unordered) {
2087
- const semaphore = Effect.makeSemaphoreUnsafe(concurrencyN)
2089
+ const semaphore = Semaphore.makeUnsafe(concurrencyN)
2088
2090
  const release = constant(semaphore.release(1))
2089
2091
  const handle = Effect.matchCauseEffect({
2090
2092
  onFailure: (cause: Cause.Cause<EX>) => Effect.flatMap(Queue.failCause(queue, cause), release),
@@ -3562,9 +3564,9 @@ export const filter: {
3562
3564
  * @since 2.0.0
3563
3565
  * @category Filtering
3564
3566
  */
3565
- <OutElem, Result extends Filter.ResultOrBool>(filter: Filter.OrPredicate<OutElem, Result>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3567
+ <OutElem>(predicate: Predicate.Predicate<OutElem>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3566
3568
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
3567
- ) => Channel<Filter.Pass<OutElem, Result>, OutErr, OutDone, InElem, InErr, InDone, Env>
3569
+ ) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
3568
3570
  /**
3569
3571
  * Filters the output elements of a channel using a predicate function.
3570
3572
  * Elements that don't match the predicate are discarded.
@@ -3623,24 +3625,59 @@ export const filter: {
3623
3625
  * @since 2.0.0
3624
3626
  * @category Filtering
3625
3627
  */
3626
- <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, Result extends Filter.ResultOrBool>(
3628
+ <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
3629
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
3630
+ predicate: Predicate.Predicate<OutElem>
3631
+ ): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
3632
+ } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
3633
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
3634
+ predicate: Predicate.Predicate<OutElem>
3635
+ ): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env> =>
3636
+ fromTransform((upstream, scope) =>
3637
+ Effect.map(
3638
+ toTransform(self)(upstream, scope),
3639
+ (pull) =>
3640
+ Effect.flatMap(pull, function loop(elem): Pull.Pull<OutElem, OutErr, OutDone> {
3641
+ return predicate(elem)
3642
+ ? Effect.succeed(elem)
3643
+ : Effect.flatMap(pull, loop)
3644
+ })
3645
+ )
3646
+ ))
3647
+
3648
+ /**
3649
+ * @since 4.0.0
3650
+ * @category Filtering
3651
+ */
3652
+ export const filterMap: {
3653
+ /**
3654
+ * @since 4.0.0
3655
+ * @category Filtering
3656
+ */
3657
+ <OutElem, B, X>(filter: Filter.Filter<OutElem, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3658
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
3659
+ ) => Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>
3660
+ /**
3661
+ * @since 4.0.0
3662
+ * @category Filtering
3663
+ */
3664
+ <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
3627
3665
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
3628
- filter: Filter.OrPredicate<OutElem, Result>
3629
- ): Channel<Filter.Pass<OutElem, Result>, OutErr, OutDone, InElem, InErr, InDone, Env>
3630
- } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, Result extends Filter.ResultOrBool>(
3666
+ filter: Filter.Filter<OutElem, B, X>
3667
+ ): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>
3668
+ } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
3631
3669
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
3632
- filter: Filter.OrPredicate<OutElem, Result>
3633
- ): Channel<Filter.Pass<OutElem, Result>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
3670
+ filter: Filter.Filter<OutElem, B, X>
3671
+ ): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env> =>
3634
3672
  fromTransform((upstream, scope) =>
3635
3673
  Effect.map(
3636
3674
  toTransform(self)(upstream, scope),
3637
3675
  (pull) =>
3638
- Effect.flatMap(pull, function loop(elem): Pull.Pull<Filter.Pass<OutElem, Result>, OutErr, OutDone> {
3676
+ Effect.flatMap(pull, function loop(elem): Pull.Pull<B, OutErr, OutDone> {
3639
3677
  const result = filter(elem)
3640
- if (result === true) return Effect.succeed(elem as Filter.Pass<OutElem, Result>)
3641
- else if (result === false) return Effect.flatMap(pull, loop)
3642
- else if (Result.isSuccess(result)) return Effect.succeed(result.success)
3643
- return Effect.flatMap(pull, loop)
3678
+ return Result.isFailure(result)
3679
+ ? Effect.flatMap(pull, loop)
3680
+ : Effect.succeed(result.success)
3644
3681
  })
3645
3682
  )
3646
3683
  ))
@@ -3650,6 +3687,46 @@ export const filter: {
3650
3687
  * @category Filtering
3651
3688
  */
3652
3689
  export const filterEffect: {
3690
+ /**
3691
+ * @since 4.0.0
3692
+ * @category Filtering
3693
+ */
3694
+ <OutElem, E, R>(predicate: (a: OutElem) => Effect.Effect<boolean, E, R>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3695
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
3696
+ ) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
3697
+ /**
3698
+ * @since 4.0.0
3699
+ * @category Filtering
3700
+ */
3701
+ <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
3702
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
3703
+ predicate: (a: OutElem) => Effect.Effect<boolean, E, R>
3704
+ ): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
3705
+ } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
3706
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
3707
+ predicate: (a: OutElem) => Effect.Effect<boolean, E, R>
3708
+ ): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R> =>
3709
+ fromTransform((upstream, scope) =>
3710
+ Effect.map(
3711
+ toTransform(self)(upstream, scope),
3712
+ (pull) =>
3713
+ Effect.flatMap(pull, function loop(elem): Pull.Pull<OutElem, OutErr | E, OutDone, R> {
3714
+ return Effect.flatMap(
3715
+ predicate(elem),
3716
+ (passes) =>
3717
+ passes
3718
+ ? Effect.succeed(elem)
3719
+ : Effect.flatMap(pull, loop)
3720
+ )
3721
+ })
3722
+ )
3723
+ ))
3724
+
3725
+ /**
3726
+ * @since 4.0.0
3727
+ * @category Filtering
3728
+ */
3729
+ export const filterMapEffect: {
3653
3730
  /**
3654
3731
  * @since 4.0.0
3655
3732
  * @category Filtering
@@ -3794,9 +3871,9 @@ export const filterArray: {
3794
3871
  * @since 4.0.0
3795
3872
  * @category Filtering
3796
3873
  */
3797
- <OutElem, Result extends Filter.ResultOrBool>(filter: Filter.OrPredicate<Types.NoInfer<OutElem>, Result>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3874
+ <OutElem>(predicate: Predicate.Predicate<Types.NoInfer<OutElem>>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3798
3875
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
3799
- ) => Channel<Arr.NonEmptyReadonlyArray<Filter.Pass<OutElem, Result>>, OutErr, OutDone, InElem, InErr, InDone, Env>
3876
+ ) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
3800
3877
  /**
3801
3878
  * Filters arrays of elements emitted by a channel, applying the filter
3802
3879
  * to each element within the arrays and only emitting non-empty filtered arrays.
@@ -3871,19 +3948,24 @@ export const filterArray: {
3871
3948
  * @since 4.0.0
3872
3949
  * @category Filtering
3873
3950
  */
3874
- <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, Result extends Filter.ResultOrBool>(
3951
+ <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
3875
3952
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
3876
- filter: Filter.OrPredicate<Types.NoInfer<OutElem>, Result>
3877
- ): Channel<Arr.NonEmptyReadonlyArray<Filter.Pass<OutElem, Result>>, OutErr, OutDone, InElem, InErr, InDone, Env>
3878
- } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, Result extends Filter.ResultOrBool>(
3953
+ predicate: Predicate.Predicate<Types.NoInfer<OutElem>>
3954
+ ): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
3955
+ } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
3879
3956
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
3880
- filter: Filter.OrPredicate<Types.NoInfer<OutElem>, Result>
3881
- ): Channel<Arr.NonEmptyReadonlyArray<Filter.Pass<OutElem, Result>>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
3957
+ predicate: Predicate.Predicate<Types.NoInfer<OutElem>>
3958
+ ): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
3882
3959
  transformPull(self, (pull) =>
3883
3960
  Effect.succeed(Effect.flatMap(
3884
3961
  pull,
3885
- function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<any>, OutErr, OutDone> {
3886
- const [, passes] = Arr.partition(arr, filter as any)
3962
+ function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone> {
3963
+ const passes: Array<OutElem> = []
3964
+ for (let i = 0; i < arr.length; i++) {
3965
+ if (predicate(arr[i] as Types.NoInfer<OutElem>)) {
3966
+ passes.push(arr[i])
3967
+ }
3968
+ }
3887
3969
  return Arr.isReadonlyArrayNonEmpty(passes)
3888
3970
  ? Effect.succeed(passes)
3889
3971
  : Effect.flatMap(pull, loop)
@@ -3894,23 +3976,57 @@ export const filterArray: {
3894
3976
  * @since 4.0.0
3895
3977
  * @category Filtering
3896
3978
  */
3897
- export const filterArrayEffect: {
3979
+ export const filterMapArray: {
3898
3980
  /**
3899
3981
  * @since 4.0.0
3900
3982
  * @category Filtering
3901
3983
  */
3902
- <OutElem, E, R>(
3903
- predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
3904
- ): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3984
+ <OutElem, B, X>(filter: Filter.Filter<Types.NoInfer<OutElem>, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3905
3985
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
3906
- ) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
3986
+ ) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>
3907
3987
  /**
3908
3988
  * @since 4.0.0
3909
3989
  * @category Filtering
3910
3990
  */
3911
- <OutElem, B, X, EX, RX>(filter: Filter.FilterEffect<OutElem, B, X, EX, RX>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3991
+ <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
3992
+ self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
3993
+ filter: Filter.Filter<OutElem, B, X>
3994
+ ): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>
3995
+ } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
3996
+ self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
3997
+ filter: Filter.Filter<OutElem, B, X>
3998
+ ): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
3999
+ transformPull(self, (pull) =>
4000
+ Effect.succeed(Effect.flatMap(
4001
+ pull,
4002
+ function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone> {
4003
+ const passes: Array<B> = []
4004
+ for (let i = 0; i < arr.length; i++) {
4005
+ const result = filter(arr[i])
4006
+ if (Result.isSuccess(result)) {
4007
+ passes.push(result.success)
4008
+ }
4009
+ }
4010
+ return Arr.isReadonlyArrayNonEmpty(passes)
4011
+ ? Effect.succeed(passes)
4012
+ : Effect.flatMap(pull, loop)
4013
+ }
4014
+ ))))
4015
+
4016
+ /**
4017
+ * @since 4.0.0
4018
+ * @category Filtering
4019
+ */
4020
+ export const filterArrayEffect: {
4021
+ /**
4022
+ * @since 4.0.0
4023
+ * @category Filtering
4024
+ */
4025
+ <OutElem, E, R>(
4026
+ predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
4027
+ ): <OutErr, OutDone, InElem, InErr, InDone, Env>(
3912
4028
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
3913
- ) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>
4029
+ ) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
3914
4030
  /**
3915
4031
  * @since 4.0.0
3916
4032
  * @category Filtering
@@ -3919,6 +4035,32 @@ export const filterArrayEffect: {
3919
4035
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
3920
4036
  predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
3921
4037
  ): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
4038
+ } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
4039
+ self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
4040
+ predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
4041
+ ): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R> =>
4042
+ transformPull(self, (pull) => {
4043
+ const f = Effect.flatMap(pull, (arr) => Effect.filter(arr, predicate))
4044
+ return Effect.succeed(Effect.flatMap(
4045
+ f,
4046
+ function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, R> {
4047
+ return Arr.isReadonlyArrayNonEmpty(arr) ? Effect.succeed(arr) : Effect.flatMap(f, loop)
4048
+ }
4049
+ ))
4050
+ }))
4051
+
4052
+ /**
4053
+ * @since 4.0.0
4054
+ * @category Filtering
4055
+ */
4056
+ export const filterMapArrayEffect: {
4057
+ /**
4058
+ * @since 4.0.0
4059
+ * @category Filtering
4060
+ */
4061
+ <OutElem, B, X, EX, RX>(filter: Filter.FilterEffect<Types.NoInfer<OutElem>, B, X, EX, RX>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
4062
+ self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
4063
+ ) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>
3922
4064
  /**
3923
4065
  * @since 4.0.0
3924
4066
  * @category Filtering
@@ -3927,32 +4069,23 @@ export const filterArrayEffect: {
3927
4069
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
3928
4070
  filter: Filter.FilterEffect<OutElem, B, X, EX, RX>
3929
4071
  ): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>
3930
- } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
4072
+ } = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X, EX, RX>(
3931
4073
  self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
3932
- filter:
3933
- | Filter.FilterEffect<OutElem, any, any, any, any>
3934
- | ((a: OutElem, index: number) => Effect.Effect<boolean, any, any>)
3935
- ): Channel<Arr.NonEmptyReadonlyArray<any>, any, OutDone, InElem, InErr, InDone, any> => {
3936
- if (filter.length > 1) {
3937
- // effectful boolean predicate: (a, index) => Effect<boolean>
3938
- const predicate = filter as (a: OutElem, index: number) => Effect.Effect<boolean, any, any>
3939
- return transformPull(self, (pull) => {
3940
- const f = Effect.flatMap(pull, (arr) => Effect.filter(arr, predicate))
3941
- return Effect.succeed(Effect.flatMap(
3942
- f,
3943
- function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<any>, any, OutDone, any> {
3944
- return Arr.isReadonlyArrayNonEmpty(arr) ? Effect.succeed(arr) : Effect.flatMap(f, loop)
3945
- }
3946
- ))
3947
- })
3948
- }
3949
- // FilterEffect: (a) => Effect<pass|fail>
3950
- return filterEffect(self, (arr) =>
3951
- Effect.map(
3952
- Effect.filter(arr, filter as any),
3953
- (passes) => Arr.isReadonlyArrayNonEmpty(passes) ? Result.succeed(passes) : Result.fail(undefined)
3954
- ))
3955
- })
4074
+ filter: Filter.FilterEffect<OutElem, B, X, EX, RX>
4075
+ ): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX> =>
4076
+ transformPull(self, (pull) =>
4077
+ Effect.succeed(Effect.flatMap(
4078
+ pull,
4079
+ function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, RX> {
4080
+ return Effect.flatMap(
4081
+ Effect.filterMapEffect(arr, filter as any),
4082
+ (passes) =>
4083
+ Arr.isReadonlyArrayNonEmpty(passes)
4084
+ ? Effect.succeed(passes as Arr.NonEmptyReadonlyArray<B>)
4085
+ : Effect.flatMap(pull, loop)
4086
+ )
4087
+ }
4088
+ ))))
3956
4089
 
3957
4090
  /**
3958
4091
  * Statefully maps over a channel with an accumulator, where each element can produce multiple output values.
@@ -4755,7 +4888,6 @@ export const catchCauseIf: {
4755
4888
  */
4756
4889
  <
4757
4890
  OutErr,
4758
- Result extends Filter.ResultOrBool<Cause.Cause<any>>,
4759
4891
  OutElem1,
4760
4892
  OutErr1,
4761
4893
  OutDone1,
@@ -4764,11 +4896,8 @@ export const catchCauseIf: {
4764
4896
  InDone1,
4765
4897
  Env1
4766
4898
  >(
4767
- filter: Filter.OrPredicate<Cause.Cause<OutErr>, Result>,
4768
- f: (
4769
- failure: Filter.Pass<Cause.Cause<OutErr>, Result>,
4770
- cause: Cause.Cause<OutErr>
4771
- ) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
4899
+ predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
4900
+ f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
4772
4901
  ): <
4773
4902
  OutElem,
4774
4903
  OutDone,
@@ -4778,7 +4907,7 @@ export const catchCauseIf: {
4778
4907
  Env
4779
4908
  >(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
4780
4909
  OutElem | OutElem1,
4781
- Cause.Cause.Error<Filter.Fail<Cause.Cause<OutErr>, Result>> | OutErr1,
4910
+ OutErr | OutErr1,
4782
4911
  OutDone | OutDone1,
4783
4912
  InElem & InElem1,
4784
4913
  InErr & InErr1,
@@ -4800,7 +4929,6 @@ export const catchCauseIf: {
4800
4929
  InErr,
4801
4930
  InDone,
4802
4931
  Env,
4803
- Result extends Filter.ResultOrBool<Cause.Cause<any>>,
4804
4932
  OutElem1,
4805
4933
  OutErr1,
4806
4934
  OutDone1,
@@ -4810,14 +4938,137 @@ export const catchCauseIf: {
4810
4938
  Env1
4811
4939
  >(
4812
4940
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
4813
- filter: Filter.OrPredicate<Cause.Cause<OutErr>, Result>,
4941
+ predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
4942
+ f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
4943
+ ): Channel<
4944
+ OutElem | OutElem1,
4945
+ OutErr | OutErr1,
4946
+ OutDone | OutDone1,
4947
+ InElem & InElem1,
4948
+ InErr & InErr1,
4949
+ InDone & InDone1,
4950
+ Env | Env1
4951
+ >
4952
+ } = dual(3, <
4953
+ OutElem,
4954
+ OutErr,
4955
+ OutDone,
4956
+ InElem,
4957
+ InErr,
4958
+ InDone,
4959
+ Env,
4960
+ OutElem1,
4961
+ OutErr1,
4962
+ OutDone1,
4963
+ InElem1,
4964
+ InErr1,
4965
+ InDone1,
4966
+ Env1
4967
+ >(
4968
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
4969
+ predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
4970
+ f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
4971
+ ): Channel<
4972
+ OutElem | OutElem1,
4973
+ OutErr | OutErr1,
4974
+ OutDone | OutDone1,
4975
+ InElem & InElem1,
4976
+ InErr & InErr1,
4977
+ InDone & InDone1,
4978
+ Env | Env1
4979
+ > =>
4980
+ catchCause(
4981
+ self,
4982
+ (
4983
+ cause
4984
+ ): Channel<
4985
+ OutElem1,
4986
+ OutErr | OutErr1,
4987
+ OutDone1,
4988
+ InElem1,
4989
+ InErr1,
4990
+ InDone1,
4991
+ Env1
4992
+ > => {
4993
+ return predicate(cause)
4994
+ ? f(cause)
4995
+ : failCause(cause as any)
4996
+ }
4997
+ ))
4998
+
4999
+ /**
5000
+ * @since 4.0.0
5001
+ * @category Error handling
5002
+ */
5003
+ export const catchCauseFilter: {
5004
+ /**
5005
+ * @since 4.0.0
5006
+ * @category Error handling
5007
+ */
5008
+ <
5009
+ OutErr,
5010
+ EB,
5011
+ X extends Cause.Cause<any>,
5012
+ OutElem1,
5013
+ OutErr1,
5014
+ OutDone1,
5015
+ InElem1,
5016
+ InErr1,
5017
+ InDone1,
5018
+ Env1
5019
+ >(
5020
+ filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
5021
+ f: (
5022
+ failure: EB,
5023
+ cause: Cause.Cause<OutErr>
5024
+ ) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
5025
+ ): <
5026
+ OutElem,
5027
+ OutDone,
5028
+ InElem,
5029
+ InErr,
5030
+ InDone,
5031
+ Env
5032
+ >(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
5033
+ OutElem | OutElem1,
5034
+ Cause.Cause.Error<X> | OutErr1,
5035
+ OutDone | OutDone1,
5036
+ InElem & InElem1,
5037
+ InErr & InErr1,
5038
+ InDone & InDone1,
5039
+ Env | Env1
5040
+ >
5041
+ /**
5042
+ * @since 4.0.0
5043
+ * @category Error handling
5044
+ */
5045
+ <
5046
+ OutElem,
5047
+ OutErr,
5048
+ OutDone,
5049
+ InElem,
5050
+ InErr,
5051
+ InDone,
5052
+ Env,
5053
+ EB,
5054
+ X extends Cause.Cause<any>,
5055
+ OutElem1,
5056
+ OutErr1,
5057
+ OutDone1,
5058
+ InElem1,
5059
+ InErr1,
5060
+ InDone1,
5061
+ Env1
5062
+ >(
5063
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
5064
+ filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
4814
5065
  f: (
4815
- failure: Filter.Pass<Cause.Cause<OutErr>, Result>,
5066
+ failure: EB,
4816
5067
  cause: Cause.Cause<OutErr>
4817
5068
  ) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
4818
5069
  ): Channel<
4819
5070
  OutElem | OutElem1,
4820
- Cause.Cause.Error<Filter.Fail<Cause.Cause<OutErr>, Result>> | OutErr1,
5071
+ Cause.Cause.Error<X> | OutErr1,
4821
5072
  OutDone | OutDone1,
4822
5073
  InElem & InElem1,
4823
5074
  InErr & InErr1,
@@ -4832,7 +5083,8 @@ export const catchCauseIf: {
4832
5083
  InErr,
4833
5084
  InDone,
4834
5085
  Env,
4835
- Result extends Filter.ResultOrBool<Cause.Cause<any>>,
5086
+ EB,
5087
+ X extends Cause.Cause<any>,
4836
5088
  OutElem1,
4837
5089
  OutErr1,
4838
5090
  OutDone1,
@@ -4842,14 +5094,14 @@ export const catchCauseIf: {
4842
5094
  Env1
4843
5095
  >(
4844
5096
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
4845
- filter: Filter.OrPredicate<Cause.Cause<OutErr>, Result>,
5097
+ filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
4846
5098
  f: (
4847
- failure: Filter.Pass<Cause.Cause<OutErr>, Result>,
5099
+ failure: EB,
4848
5100
  cause: Cause.Cause<OutErr>
4849
5101
  ) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
4850
5102
  ): Channel<
4851
5103
  OutElem | OutElem1,
4852
- Cause.Cause.Error<Filter.Fail<Cause.Cause<OutErr>, Result>> | OutErr1,
5104
+ Cause.Cause.Error<X> | OutErr1,
4853
5105
  OutDone | OutDone1,
4854
5106
  InElem & InElem1,
4855
5107
  InErr & InErr1,
@@ -4862,18 +5114,17 @@ export const catchCauseIf: {
4862
5114
  cause
4863
5115
  ): Channel<
4864
5116
  OutElem1,
4865
- Cause.Cause.Error<Filter.Fail<Cause.Cause<OutErr>, Result>> | OutErr1,
5117
+ Cause.Cause.Error<X> | OutErr1,
4866
5118
  OutDone1,
4867
5119
  InElem1,
4868
5120
  InErr1,
4869
5121
  InDone1,
4870
5122
  Env1
4871
5123
  > => {
4872
- const eb = filter(cause)
4873
- if (eb === true) return f(cause as any, cause)
4874
- else if (eb === false) return failCause(cause as any)
4875
- else if (Result.isSuccess(eb)) return f(eb.success as any, cause)
4876
- return failCause(eb.failure)
5124
+ const result = filter(cause)
5125
+ return Result.isFailure(result)
5126
+ ? failCause(result.failure)
5127
+ : f(result.success, cause)
4877
5128
  }
4878
5129
  ))
4879
5130
 
@@ -4949,7 +5200,7 @@ const catch_: {
4949
5200
  InErr & InErr1,
4950
5201
  InDone & InDone1,
4951
5202
  Env | Env1
4952
- > => catchCauseIf(self, Cause.findError as any, (e: any) => f(e)) as any)
5203
+ > => catchCauseFilter(self, Cause.findError, (e) => f(e)))
4953
5204
 
4954
5205
  export {
4955
5206
  /**
@@ -5099,7 +5350,6 @@ export const catchIf: {
5099
5350
  */
5100
5351
  <
5101
5352
  OutErr,
5102
- Result extends Filter.ResultOrBool,
5103
5353
  OutElem1,
5104
5354
  OutErr1,
5105
5355
  OutDone1,
@@ -5108,18 +5358,18 @@ export const catchIf: {
5108
5358
  InDone1,
5109
5359
  Env1,
5110
5360
  OutElem2 = never,
5111
- OutErr2 = Filter.Fail<OutErr, Result>,
5361
+ OutErr2 = OutErr,
5112
5362
  OutDone2 = never,
5113
5363
  InElem2 = unknown,
5114
5364
  InErr2 = unknown,
5115
5365
  InDone2 = unknown,
5116
5366
  Env2 = never
5117
5367
  >(
5118
- filter: Filter.OrPredicate<OutErr, Result>,
5119
- f: (failure: Filter.Pass<OutErr, Result>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5368
+ predicate: Predicate.Predicate<OutErr>,
5369
+ f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5120
5370
  orElse?:
5121
5371
  | ((
5122
- failure: Filter.Fail<OutErr, Result>
5372
+ failure: OutErr
5123
5373
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5124
5374
  | undefined
5125
5375
  ): <
@@ -5195,7 +5445,6 @@ export const catchIf: {
5195
5445
  InErr,
5196
5446
  InDone,
5197
5447
  Env,
5198
- Result extends Filter.ResultOrBool,
5199
5448
  OutElem1,
5200
5449
  OutErr1,
5201
5450
  OutDone1,
@@ -5204,7 +5453,7 @@ export const catchIf: {
5204
5453
  InDone1,
5205
5454
  Env1,
5206
5455
  OutElem2 = never,
5207
- OutErr2 = Filter.Fail<OutErr, Result>,
5456
+ OutErr2 = OutErr,
5208
5457
  OutDone2 = never,
5209
5458
  InElem2 = unknown,
5210
5459
  InErr2 = unknown,
@@ -5212,11 +5461,11 @@ export const catchIf: {
5212
5461
  Env2 = never
5213
5462
  >(
5214
5463
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
5215
- filter: Filter.OrPredicate<OutErr, Result>,
5216
- f: (failure: Filter.Pass<OutErr, Result>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5464
+ predicate: Predicate.Predicate<OutErr>,
5465
+ f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5217
5466
  orElse?:
5218
5467
  | ((
5219
- failure: Filter.Fail<OutErr, Result>
5468
+ failure: OutErr
5220
5469
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5221
5470
  | undefined
5222
5471
  ): Channel<
@@ -5236,7 +5485,6 @@ export const catchIf: {
5236
5485
  InErr,
5237
5486
  InDone,
5238
5487
  Env,
5239
- Result extends Filter.ResultOrBool,
5240
5488
  OutElem1,
5241
5489
  OutErr1,
5242
5490
  OutDone1,
@@ -5245,7 +5493,7 @@ export const catchIf: {
5245
5493
  InDone1,
5246
5494
  Env1,
5247
5495
  OutElem2 = never,
5248
- OutErr2 = Filter.Fail<OutErr, Result>,
5496
+ OutErr2 = OutErr,
5249
5497
  OutDone2 = never,
5250
5498
  InElem2 = unknown,
5251
5499
  InErr2 = unknown,
@@ -5253,11 +5501,11 @@ export const catchIf: {
5253
5501
  Env2 = never
5254
5502
  >(
5255
5503
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
5256
- filter: Filter.OrPredicate<OutErr, Result>,
5257
- f: (failure: Filter.Pass<OutErr, Result>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5504
+ predicate: Predicate.Predicate<OutErr>,
5505
+ f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5258
5506
  orElse?:
5259
5507
  | ((
5260
- failure: Filter.Fail<OutErr, Result>
5508
+ failure: OutErr
5261
5509
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5262
5510
  | undefined
5263
5511
  ): Channel<
@@ -5280,12 +5528,170 @@ export const catchIf: {
5280
5528
  InDone1 & InDone2,
5281
5529
  Env1 | Env2
5282
5530
  > => {
5283
- const eb = Filter.apply(filter as any, err)
5284
- return !Result.isFailure(eb)
5285
- ? f(eb.success as any)
5531
+ return predicate(err)
5532
+ ? f(err)
5286
5533
  : orElse
5287
- ? orElse(eb.failure as any)
5288
- : fail(eb.failure as any) as any
5534
+ ? orElse(err)
5535
+ : fail(err as any) as any
5536
+ }
5537
+ ))
5538
+
5539
+ /**
5540
+ * @since 4.0.0
5541
+ * @category Error handling
5542
+ */
5543
+ export const catchFilter: {
5544
+ /**
5545
+ * @since 4.0.0
5546
+ * @category Error handling
5547
+ */
5548
+ <
5549
+ OutErr,
5550
+ EB,
5551
+ X,
5552
+ OutElem1,
5553
+ OutErr1,
5554
+ OutDone1,
5555
+ InElem1,
5556
+ InErr1,
5557
+ InDone1,
5558
+ Env1,
5559
+ OutElem2 = never,
5560
+ OutErr2 = X,
5561
+ OutDone2 = never,
5562
+ InElem2 = unknown,
5563
+ InErr2 = unknown,
5564
+ InDone2 = unknown,
5565
+ Env2 = never
5566
+ >(
5567
+ filter: Filter.Filter<OutErr, EB, X>,
5568
+ f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5569
+ orElse?:
5570
+ | ((
5571
+ failure: X
5572
+ ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5573
+ | undefined
5574
+ ): <
5575
+ OutElem,
5576
+ OutDone,
5577
+ InElem,
5578
+ InErr,
5579
+ InDone,
5580
+ Env
5581
+ >(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
5582
+ OutElem | OutElem1 | OutElem2,
5583
+ OutErr1 | OutErr2,
5584
+ OutDone | OutDone1 | OutDone2,
5585
+ InElem & InElem1 & InElem2,
5586
+ InErr & InErr1 & InErr2,
5587
+ InDone & InDone1 & InDone2,
5588
+ Env | Env1 | Env2
5589
+ >
5590
+ /**
5591
+ * @since 4.0.0
5592
+ * @category Error handling
5593
+ */
5594
+ <
5595
+ OutElem,
5596
+ OutErr,
5597
+ OutDone,
5598
+ InElem,
5599
+ InErr,
5600
+ InDone,
5601
+ Env,
5602
+ EB,
5603
+ X,
5604
+ OutElem1,
5605
+ OutErr1,
5606
+ OutDone1,
5607
+ InElem1,
5608
+ InErr1,
5609
+ InDone1,
5610
+ Env1,
5611
+ OutElem2 = never,
5612
+ OutErr2 = X,
5613
+ OutDone2 = never,
5614
+ InElem2 = unknown,
5615
+ InErr2 = unknown,
5616
+ InDone2 = unknown,
5617
+ Env2 = never
5618
+ >(
5619
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
5620
+ filter: Filter.Filter<OutErr, EB, X>,
5621
+ f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5622
+ orElse?:
5623
+ | ((
5624
+ failure: X
5625
+ ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5626
+ | undefined
5627
+ ): Channel<
5628
+ OutElem | OutElem1 | OutElem2,
5629
+ OutErr1 | OutErr2,
5630
+ OutDone | OutDone1 | OutDone2,
5631
+ InElem & InElem1 & InElem2,
5632
+ InErr & InErr1 & InErr2,
5633
+ InDone & InDone1 & InDone2,
5634
+ Env | Env1 | Env2
5635
+ >
5636
+ } = dual((args) => isChannel(args[0]), <
5637
+ OutElem,
5638
+ OutErr,
5639
+ OutDone,
5640
+ InElem,
5641
+ InErr,
5642
+ InDone,
5643
+ Env,
5644
+ EB,
5645
+ X,
5646
+ OutElem1,
5647
+ OutErr1,
5648
+ OutDone1,
5649
+ InElem1,
5650
+ InErr1,
5651
+ InDone1,
5652
+ Env1,
5653
+ OutElem2 = never,
5654
+ OutErr2 = X,
5655
+ OutDone2 = never,
5656
+ InElem2 = unknown,
5657
+ InErr2 = unknown,
5658
+ InDone2 = unknown,
5659
+ Env2 = never
5660
+ >(
5661
+ self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
5662
+ filter: Filter.Filter<OutErr, EB, X>,
5663
+ f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5664
+ orElse?:
5665
+ | ((
5666
+ failure: X
5667
+ ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5668
+ | undefined
5669
+ ): Channel<
5670
+ OutElem | OutElem1 | OutElem2,
5671
+ OutErr1 | OutErr2,
5672
+ OutDone | OutDone1 | OutDone2,
5673
+ InElem & InElem1 & InElem2,
5674
+ InErr & InErr1 & InErr2,
5675
+ InDone & InDone1 & InDone2,
5676
+ Env | Env1 | Env2
5677
+ > =>
5678
+ catch_(
5679
+ self,
5680
+ (err): Channel<
5681
+ OutElem1 | OutElem2,
5682
+ OutErr1 | OutErr2,
5683
+ OutDone1 | OutDone2,
5684
+ InElem1 & InElem2,
5685
+ InErr1 & InErr2,
5686
+ InDone1 & InDone2,
5687
+ Env1 | Env2
5688
+ > => {
5689
+ const result = filter(err)
5690
+ return Result.isFailure(result)
5691
+ ? orElse
5692
+ ? orElse(result.failure)
5693
+ : fail(result.failure as any) as any
5694
+ : f(result.success)
5289
5695
  }
5290
5696
  ))
5291
5697
 
@@ -5526,11 +5932,13 @@ export const catchReason: {
5526
5932
  errorTag: K,
5527
5933
  reasonTag: RK,
5528
5934
  f: (
5529
- reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5935
+ reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
5936
+ error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5530
5937
  ) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5531
5938
  orElse?:
5532
5939
  | ((
5533
- reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5940
+ reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
5941
+ error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5534
5942
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5535
5943
  | undefined
5536
5944
  ): <
@@ -5613,11 +6021,13 @@ export const catchReason: {
5613
6021
  errorTag: K,
5614
6022
  reasonTag: RK,
5615
6023
  f: (
5616
- reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
6024
+ reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
6025
+ error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5617
6026
  ) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5618
6027
  orElse?:
5619
6028
  | ((
5620
- reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
6029
+ reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
6030
+ error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5621
6031
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5622
6032
  | undefined
5623
6033
  ): Channel<
@@ -5658,11 +6068,13 @@ export const catchReason: {
5658
6068
  errorTag: K,
5659
6069
  reasonTag: RK,
5660
6070
  f: (
5661
- reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
6071
+ reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
6072
+ error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5662
6073
  ) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
5663
6074
  orElse?:
5664
6075
  | ((
5665
- reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
6076
+ reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
6077
+ error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5666
6078
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5667
6079
  | undefined
5668
6080
  ): Channel<
@@ -5688,9 +6100,9 @@ export const catchReason: {
5688
6100
  if (isTagged(error, errorTag) && hasProperty(error, "reason")) {
5689
6101
  const reason = error.reason as Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5690
6102
  if (isTagged(reason, reasonTag)) {
5691
- return f(reason as any)
6103
+ return f(reason as any, error as any)
5692
6104
  }
5693
- return orElse ? orElse(reason) as any : fail(error) as any
6105
+ return orElse ? orElse(reason, error as any) as any : fail(error) as any
5694
6106
  }
5695
6107
  return fail(error) as any
5696
6108
  }
@@ -5714,7 +6126,8 @@ export const catchReasons: {
5714
6126
  OutErr,
5715
6127
  Cases extends {
5716
6128
  [RK in Types.ReasonTags<Types.ExtractTag<Types.NoInfer<OutErr>, K>>]+?: (
5717
- reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
6129
+ reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
6130
+ error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
5718
6131
  ) => Channel<any, any, any, any, any, any, any>
5719
6132
  },
5720
6133
  OutElem2 = Types.unassigned,
@@ -5729,7 +6142,8 @@ export const catchReasons: {
5729
6142
  cases: Cases,
5730
6143
  orElse?:
5731
6144
  | ((
5732
- reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
6145
+ reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>,
6146
+ error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
5733
6147
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5734
6148
  | undefined
5735
6149
  ): <OutElem, OutDone, InElem, InErr, InDone, Env>(
@@ -5795,7 +6209,8 @@ export const catchReasons: {
5795
6209
  K extends Types.Tags<OutErr>,
5796
6210
  Cases extends {
5797
6211
  [RK in Types.ReasonTags<Types.ExtractTag<OutErr, K>>]+?: (
5798
- reason: Types.ExtractReason<Types.ExtractTag<OutErr, K>, RK>
6212
+ reason: Types.ExtractReason<Types.ExtractTag<OutErr, K>, RK>,
6213
+ error: Types.NarrowReason<Types.ExtractTag<OutErr, K>, RK>
5799
6214
  ) => Channel<any, any, any, any, any, any, any>
5800
6215
  },
5801
6216
  OutElem2 = Types.unassigned,
@@ -5811,7 +6226,8 @@ export const catchReasons: {
5811
6226
  cases: Cases,
5812
6227
  orElse?:
5813
6228
  | ((
5814
- reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
6229
+ reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>,
6230
+ error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
5815
6231
  ) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
5816
6232
  | undefined
5817
6233
  ): Channel<
@@ -5860,7 +6276,7 @@ export const catchReasons: {
5860
6276
  >
5861
6277
  } = dual((args) => isChannel(args[0]), (self, errorTag, cases, orElse) => {
5862
6278
  let keys: Set<string>
5863
- return catch_(self, (error: any) => {
6279
+ return catch_(self, (error) => {
5864
6280
  if (
5865
6281
  isTagged(error, errorTag) &&
5866
6282
  hasProperty(error, "reason") &&
@@ -5870,9 +6286,9 @@ export const catchReasons: {
5870
6286
  const reason = error.reason as { readonly _tag: string }
5871
6287
  keys ??= new Set(Object.keys(cases))
5872
6288
  if (keys.has(reason._tag)) {
5873
- return (cases as any)[reason._tag](reason as any)
6289
+ return (cases as any)[reason._tag](reason as any, error)
5874
6290
  }
5875
- return orElse ? orElse(reason) as any : fail(error) as any
6291
+ return orElse ? orElse(reason, error) as any : fail(error) as any
5876
6292
  }
5877
6293
  return fail(error) as any
5878
6294
  })
@@ -6022,11 +6438,11 @@ export const unwrapReason: {
6022
6438
  InDone,
6023
6439
  Env
6024
6440
  > =>
6025
- catchIf(
6441
+ catchFilter(
6026
6442
  self,
6027
- (error: any) =>
6443
+ (error) =>
6028
6444
  isTagged(error, errorTag) && hasProperty(error, "reason") ? Result.succeed(error.reason) : Result.fail(error),
6029
- fail as any
6445
+ fail
6030
6446
  ) as any)
6031
6447
 
6032
6448
  /**
@@ -6112,14 +6528,14 @@ export const orDie = <
6112
6528
  */
6113
6529
  export const ignore: <
6114
6530
  Arg extends Channel<any, any, any, any, any, any, any> | {
6115
- readonly log?: boolean | LogLevel | undefined
6531
+ readonly log?: boolean | Severity | undefined
6116
6532
  } | undefined = {
6117
- readonly log?: boolean | LogLevel | undefined
6533
+ readonly log?: boolean | Severity | undefined
6118
6534
  }
6119
6535
  >(
6120
6536
  selfOrOptions: Arg,
6121
6537
  options?: {
6122
- readonly log?: boolean | LogLevel | undefined
6538
+ readonly log?: boolean | Severity | undefined
6123
6539
  } | undefined
6124
6540
  ) => [Arg] extends
6125
6541
  [Channel<infer OutElem, infer _OutErr, infer OutDone, infer InElem, infer InErr, infer InDone, infer Env>]
@@ -6131,7 +6547,7 @@ export const ignore: <
6131
6547
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
6132
6548
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
6133
6549
  options?: {
6134
- readonly log?: boolean | LogLevel | undefined
6550
+ readonly log?: boolean | Severity | undefined
6135
6551
  } | undefined
6136
6552
  ): Channel<OutElem, never, OutDone | void, InElem, InErr, InDone, Env> => {
6137
6553
  if (!options?.log) {
@@ -6167,14 +6583,14 @@ const ignoreCause_ = <
6167
6583
  */
6168
6584
  export const ignoreCause: <
6169
6585
  Arg extends Channel<any, any, any, any, any, any, any> | {
6170
- readonly log?: boolean | LogLevel | undefined
6586
+ readonly log?: boolean | Severity | undefined
6171
6587
  } | undefined = {
6172
- readonly log?: boolean | LogLevel | undefined
6588
+ readonly log?: boolean | Severity | undefined
6173
6589
  }
6174
6590
  >(
6175
6591
  selfOrOptions: Arg,
6176
6592
  options?: {
6177
- readonly log?: boolean | LogLevel | undefined
6593
+ readonly log?: boolean | Severity | undefined
6178
6594
  } | undefined
6179
6595
  ) => [Arg] extends
6180
6596
  [Channel<infer OutElem, infer _OutErr, infer OutDone, infer InElem, infer InErr, infer InDone, infer Env>]
@@ -6185,7 +6601,7 @@ export const ignoreCause: <
6185
6601
  (args) => isChannel(args[0]),
6186
6602
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
6187
6603
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
6188
- options?: { readonly log?: boolean | LogLevel | undefined } | undefined
6604
+ options?: { readonly log?: boolean | Severity | undefined } | undefined
6189
6605
  ): Channel<OutElem, never, OutDone | void, InElem, InErr, InDone, Env> => {
6190
6606
  if (!options?.log) return ignoreCause_(self)
6191
6607
  const logEffect = Effect.logWithLevel(options.log === true ? undefined : options.log)
@@ -6631,8 +7047,8 @@ export const mergeAll: {
6631
7047
  const concurrencyN = concurrency === "unbounded"
6632
7048
  ? Number.MAX_SAFE_INTEGER
6633
7049
  : Math.max(1, concurrency)
6634
- const semaphore = switch_ ? undefined : Effect.makeSemaphoreUnsafe(concurrencyN)
6635
- const doneLatch = yield* Effect.makeLatch(true)
7050
+ const semaphore = switch_ ? undefined : Semaphore.makeUnsafe(concurrencyN)
7051
+ const doneLatch = yield* Latch.make(true)
6636
7052
  const fibers = new Set<Fiber.Fiber<any, any>>()
6637
7053
 
6638
7054
  const queue = yield* Queue.bounded</**
@@ -8208,7 +8624,7 @@ export const provideService: {
8208
8624
  * @since 4.0.0
8209
8625
  * @category Services
8210
8626
  */
8211
- <I, S>(key: ServiceMap.Service<I, S>, service: NoInfer<S>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
8627
+ <I, S>(key: ServiceMap.Key<I, S>, service: NoInfer<S>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
8212
8628
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
8213
8629
  ) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>
8214
8630
  /**
@@ -8217,12 +8633,12 @@ export const provideService: {
8217
8633
  */
8218
8634
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
8219
8635
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
8220
- key: ServiceMap.Service<I, S>,
8636
+ key: ServiceMap.Key<I, S>,
8221
8637
  service: NoInfer<S>
8222
8638
  ): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>
8223
8639
  } = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
8224
8640
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
8225
- key: ServiceMap.Service<I, S>,
8641
+ key: ServiceMap.Key<I, S>,
8226
8642
  service: NoInfer<S>
8227
8643
  ): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>> =>
8228
8644
  fromTransform((upstream, scope) =>
@@ -8241,7 +8657,7 @@ export const provideServiceEffect: {
8241
8657
  * @since 4.0.0
8242
8658
  * @category Services
8243
8659
  */
8244
- <I, S, ES, RS>(key: ServiceMap.Service<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
8660
+ <I, S, ES, RS>(key: ServiceMap.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
8245
8661
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
8246
8662
  ) => Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>
8247
8663
  /**
@@ -8250,12 +8666,12 @@ export const provideServiceEffect: {
8250
8666
  */
8251
8667
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S, ES, RS>(
8252
8668
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
8253
- key: ServiceMap.Service<I, S>,
8669
+ key: ServiceMap.Key<I, S>,
8254
8670
  service: Effect.Effect<NoInfer<S>, ES, RS>
8255
8671
  ): Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>
8256
8672
  } = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S, ES, RS>(
8257
8673
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
8258
- key: ServiceMap.Service<I, S>,
8674
+ key: ServiceMap.Key<I, S>,
8259
8675
  service: Effect.Effect<NoInfer<S>, ES, RS>
8260
8676
  ): Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS> =>
8261
8677
  fromTransform((upstream, scope) =>
@@ -8353,7 +8769,7 @@ export const updateService: {
8353
8769
  * @since 2.0.0
8354
8770
  * @category Services
8355
8771
  */
8356
- <I, S>(key: ServiceMap.Service<I, S>, f: (service: NoInfer<S>) => S): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
8772
+ <I, S>(key: ServiceMap.Key<I, S>, f: (service: NoInfer<S>) => S): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
8357
8773
  self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
8358
8774
  ) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>
8359
8775
  /**
@@ -8362,12 +8778,12 @@ export const updateService: {
8362
8778
  */
8363
8779
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
8364
8780
  self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
8365
- service: ServiceMap.Service<I, S>,
8781
+ service: ServiceMap.Key<I, S>,
8366
8782
  f: (service: NoInfer<S>) => S
8367
8783
  ): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>
8368
8784
  } = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
8369
8785
  self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
8370
- service: ServiceMap.Service<I, S>,
8786
+ service: ServiceMap.Key<I, S>,
8371
8787
  f: (service: NoInfer<S>) => S
8372
8788
  ): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I> =>
8373
8789
  updateServices(self, (services) =>
@@ -9085,7 +9501,7 @@ export const toPull: <OutElem, OutErr, OutDone, Env>(
9085
9501
  function*<OutElem, OutErr, OutDone, Env>(
9086
9502
  self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>
9087
9503
  ) {
9088
- const semaphore = Effect.makeSemaphoreUnsafe(1)
9504
+ const semaphore = Semaphore.makeUnsafe(1)
9089
9505
  const context = yield* Effect.services<Env | Scope.Scope>()
9090
9506
  const scope = ServiceMap.get(context, Scope.Scope)
9091
9507
  const pull = yield* toTransform(self)(Cause.done(), scope)