effect 4.1.4 → 4.1.5

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 (723) hide show
  1. package/THIRD_PARTY_NOTICES.md +88 -0
  2. package/ai-docs/package.json +2 -2
  3. package/dist/Arbitrary.d.ts +44 -2
  4. package/dist/Arbitrary.d.ts.map +1 -1
  5. package/dist/Arbitrary.js +9 -1
  6. package/dist/Arbitrary.js.map +1 -1
  7. package/dist/BigInt.d.ts +200 -1
  8. package/dist/BigInt.d.ts.map +1 -1
  9. package/dist/BigInt.js +105 -9
  10. package/dist/BigInt.js.map +1 -1
  11. package/dist/Cache.d.ts.map +1 -1
  12. package/dist/Cache.js +4 -2
  13. package/dist/Cache.js.map +1 -1
  14. package/dist/Cause.d.ts +3 -3
  15. package/dist/Cause.js +1 -1
  16. package/dist/Chunk.d.ts +5 -0
  17. package/dist/Chunk.d.ts.map +1 -1
  18. package/dist/Chunk.js +7 -2
  19. package/dist/Chunk.js.map +1 -1
  20. package/dist/Clock.d.ts +5 -2
  21. package/dist/Clock.d.ts.map +1 -1
  22. package/dist/Clock.js +2 -1
  23. package/dist/Clock.js.map +1 -1
  24. package/dist/Codegen.d.ts +295 -0
  25. package/dist/Codegen.d.ts.map +1 -0
  26. package/dist/Codegen.js +521 -0
  27. package/dist/Codegen.js.map +1 -0
  28. package/dist/Config.d.ts +31 -2
  29. package/dist/Config.d.ts.map +1 -1
  30. package/dist/Config.js +12 -1
  31. package/dist/Config.js.map +1 -1
  32. package/dist/ConfigProvider.d.ts +11 -1
  33. package/dist/ConfigProvider.d.ts.map +1 -1
  34. package/dist/ConfigProvider.js +17 -6
  35. package/dist/ConfigProvider.js.map +1 -1
  36. package/dist/Effect.d.ts +869 -109
  37. package/dist/Effect.d.ts.map +1 -1
  38. package/dist/Effect.js +400 -47
  39. package/dist/Effect.js.map +1 -1
  40. package/dist/Equivalence.d.ts +11 -9
  41. package/dist/Equivalence.d.ts.map +1 -1
  42. package/dist/Equivalence.js +15 -12
  43. package/dist/Equivalence.js.map +1 -1
  44. package/dist/Fiber.d.ts +58 -8
  45. package/dist/Fiber.d.ts.map +1 -1
  46. package/dist/Fiber.js +28 -4
  47. package/dist/Fiber.js.map +1 -1
  48. package/dist/FiberHandle.d.ts +81 -10
  49. package/dist/FiberHandle.d.ts.map +1 -1
  50. package/dist/FiberHandle.js +40 -8
  51. package/dist/FiberHandle.js.map +1 -1
  52. package/dist/FiberMap.d.ts +80 -10
  53. package/dist/FiberMap.d.ts.map +1 -1
  54. package/dist/FiberMap.js +37 -6
  55. package/dist/FiberMap.js.map +1 -1
  56. package/dist/FiberSet.d.ts +93 -8
  57. package/dist/FiberSet.d.ts.map +1 -1
  58. package/dist/FiberSet.js +46 -4
  59. package/dist/FiberSet.js.map +1 -1
  60. package/dist/Formatter.d.ts +2 -0
  61. package/dist/Formatter.d.ts.map +1 -1
  62. package/dist/Formatter.js +2 -0
  63. package/dist/Formatter.js.map +1 -1
  64. package/dist/LayerMap.d.ts +12 -3
  65. package/dist/LayerMap.d.ts.map +1 -1
  66. package/dist/LayerMap.js +12 -2
  67. package/dist/LayerMap.js.map +1 -1
  68. package/dist/LayerRef.d.ts +2 -2
  69. package/dist/Match.d.ts +12 -0
  70. package/dist/Match.d.ts.map +1 -1
  71. package/dist/Match.js +16 -0
  72. package/dist/Match.js.map +1 -1
  73. package/dist/Metric.js +1 -1
  74. package/dist/Metric.js.map +1 -1
  75. package/dist/Option.d.ts +4 -1
  76. package/dist/Option.d.ts.map +1 -1
  77. package/dist/Option.js +6 -2
  78. package/dist/Option.js.map +1 -1
  79. package/dist/Order.d.ts +7 -5
  80. package/dist/Order.d.ts.map +1 -1
  81. package/dist/Order.js +7 -2
  82. package/dist/Order.js.map +1 -1
  83. package/dist/Pool.d.ts +4 -3
  84. package/dist/Pool.d.ts.map +1 -1
  85. package/dist/Pool.js +21 -18
  86. package/dist/Pool.js.map +1 -1
  87. package/dist/Predicate.d.ts +4 -1
  88. package/dist/Predicate.d.ts.map +1 -1
  89. package/dist/Predicate.js +5 -1
  90. package/dist/Predicate.js.map +1 -1
  91. package/dist/Queue.d.ts +69 -22
  92. package/dist/Queue.d.ts.map +1 -1
  93. package/dist/Queue.js +40 -18
  94. package/dist/Queue.js.map +1 -1
  95. package/dist/Rational.d.ts +179 -0
  96. package/dist/Rational.d.ts.map +1 -1
  97. package/dist/Rational.js +63 -0
  98. package/dist/Rational.js.map +1 -1
  99. package/dist/Request.d.ts +20 -0
  100. package/dist/Request.d.ts.map +1 -1
  101. package/dist/Request.js +20 -0
  102. package/dist/Request.js.map +1 -1
  103. package/dist/Result.d.ts +3 -1
  104. package/dist/Result.d.ts.map +1 -1
  105. package/dist/Result.js +5 -2
  106. package/dist/Result.js.map +1 -1
  107. package/dist/Schema.d.ts +49 -19
  108. package/dist/Schema.d.ts.map +1 -1
  109. package/dist/Schema.js +44 -27
  110. package/dist/Schema.js.map +1 -1
  111. package/dist/SchemaAST.d.ts.map +1 -1
  112. package/dist/SchemaAST.js +11 -4
  113. package/dist/SchemaAST.js.map +1 -1
  114. package/dist/SchemaGetter.d.ts +5 -6
  115. package/dist/SchemaGetter.d.ts.map +1 -1
  116. package/dist/SchemaGetter.js +14 -10
  117. package/dist/SchemaGetter.js.map +1 -1
  118. package/dist/SchemaRepresentation.d.ts +19 -64
  119. package/dist/SchemaRepresentation.d.ts.map +1 -1
  120. package/dist/SchemaRepresentation.js +1 -28
  121. package/dist/SchemaRepresentation.js.map +1 -1
  122. package/dist/SchemaTransformation.d.ts +11 -10
  123. package/dist/SchemaTransformation.d.ts.map +1 -1
  124. package/dist/SchemaTransformation.js +12 -11
  125. package/dist/SchemaTransformation.js.map +1 -1
  126. package/dist/Scope.d.ts +12 -6
  127. package/dist/Scope.d.ts.map +1 -1
  128. package/dist/Scope.js +12 -6
  129. package/dist/Scope.js.map +1 -1
  130. package/dist/ScopedCache.d.ts.map +1 -1
  131. package/dist/ScopedCache.js +2 -1
  132. package/dist/ScopedCache.js.map +1 -1
  133. package/dist/Semaphore.d.ts.map +1 -1
  134. package/dist/Semaphore.js +18 -4
  135. package/dist/Semaphore.js.map +1 -1
  136. package/dist/Stream.d.ts.map +1 -1
  137. package/dist/Stream.js +55 -14
  138. package/dist/Stream.js.map +1 -1
  139. package/dist/String.d.ts +57 -3
  140. package/dist/String.d.ts.map +1 -1
  141. package/dist/String.js +62 -4
  142. package/dist/String.js.map +1 -1
  143. package/dist/Struct.d.ts +135 -1
  144. package/dist/Struct.d.ts.map +1 -1
  145. package/dist/Struct.js +64 -5
  146. package/dist/Struct.js.map +1 -1
  147. package/dist/TextDiff.d.ts +105 -0
  148. package/dist/TextDiff.d.ts.map +1 -1
  149. package/dist/TextDiff.js +137 -24
  150. package/dist/TextDiff.js.map +1 -1
  151. package/dist/TxPriorityQueue.js +2 -2
  152. package/dist/TxPriorityQueue.js.map +1 -1
  153. package/dist/ai/LanguageModel.d.ts.map +1 -1
  154. package/dist/ai/LanguageModel.js +1 -1
  155. package/dist/ai/LanguageModel.js.map +1 -1
  156. package/dist/ai/McpSchema.d.ts +88 -88
  157. package/dist/ai/McpSchema.d.ts.map +1 -1
  158. package/dist/ai/McpServer.d.ts +47 -2
  159. package/dist/ai/McpServer.d.ts.map +1 -1
  160. package/dist/ai/McpServer.js +135 -16
  161. package/dist/ai/McpServer.js.map +1 -1
  162. package/dist/ai/Tool.d.ts +3 -2
  163. package/dist/ai/Tool.d.ts.map +1 -1
  164. package/dist/ai/Tool.js +3 -2
  165. package/dist/ai/Tool.js.map +1 -1
  166. package/dist/ai/Toolkit.d.ts.map +1 -1
  167. package/dist/ai/Toolkit.js +5 -1
  168. package/dist/ai/Toolkit.js.map +1 -1
  169. package/dist/chat/Chat.d.ts +90 -0
  170. package/dist/chat/Chat.d.ts.map +1 -0
  171. package/dist/chat/Chat.js +127 -0
  172. package/dist/chat/Chat.js.map +1 -0
  173. package/dist/chat/ChatAdapter.d.ts +386 -0
  174. package/dist/chat/ChatAdapter.d.ts.map +1 -0
  175. package/dist/chat/ChatAdapter.js +110 -0
  176. package/dist/chat/ChatAdapter.js.map +1 -0
  177. package/dist/chat/ChatError.d.ts +500 -0
  178. package/dist/chat/ChatError.d.ts.map +1 -0
  179. package/dist/chat/ChatError.js +521 -0
  180. package/dist/chat/ChatError.js.map +1 -0
  181. package/dist/chat/ChatEvent.d.ts +321 -0
  182. package/dist/chat/ChatEvent.d.ts.map +1 -0
  183. package/dist/chat/ChatEvent.js +163 -0
  184. package/dist/chat/ChatEvent.js.map +1 -0
  185. package/dist/chat/ChatHandler.d.ts +81 -0
  186. package/dist/chat/ChatHandler.d.ts.map +1 -0
  187. package/dist/chat/ChatHandler.js +85 -0
  188. package/dist/chat/ChatHandler.js.map +1 -0
  189. package/dist/chat/ChatInteraction.d.ts +1519 -0
  190. package/dist/chat/ChatInteraction.d.ts.map +1 -0
  191. package/dist/chat/ChatInteraction.js +1052 -0
  192. package/dist/chat/ChatInteraction.js.map +1 -0
  193. package/dist/chat/ChatMarkdown.d.ts +280 -0
  194. package/dist/chat/ChatMarkdown.d.ts.map +1 -0
  195. package/dist/chat/ChatMarkdown.js +1172 -0
  196. package/dist/chat/ChatMarkdown.js.map +1 -0
  197. package/dist/chat/ChatMessage.d.ts +224 -0
  198. package/dist/chat/ChatMessage.d.ts.map +1 -0
  199. package/dist/chat/ChatMessage.js +172 -0
  200. package/dist/chat/ChatMessage.js.map +1 -0
  201. package/dist/chat/ChatTest.d.ts +407 -0
  202. package/dist/chat/ChatTest.d.ts.map +1 -0
  203. package/dist/chat/ChatTest.js +2145 -0
  204. package/dist/chat/ChatTest.js.map +1 -0
  205. package/dist/chat/ChatThread.d.ts +92 -0
  206. package/dist/chat/ChatThread.d.ts.map +1 -0
  207. package/dist/chat/ChatThread.js +116 -0
  208. package/dist/chat/ChatThread.js.map +1 -0
  209. package/dist/chat/ChatUi.d.ts +362 -0
  210. package/dist/chat/ChatUi.d.ts.map +1 -0
  211. package/dist/chat/ChatUi.js +209 -0
  212. package/dist/chat/ChatUi.js.map +1 -0
  213. package/dist/chat/index.d.ts +60 -0
  214. package/dist/chat/index.d.ts.map +1 -0
  215. package/dist/chat/index.js +61 -0
  216. package/dist/chat/index.js.map +1 -0
  217. package/dist/chat/internal/retries.d.ts +2 -0
  218. package/dist/chat/internal/retries.d.ts.map +1 -0
  219. package/dist/chat/internal/retries.js +7 -0
  220. package/dist/chat/internal/retries.js.map +1 -0
  221. package/dist/cli/CliOutput.d.ts.map +1 -1
  222. package/dist/cli/CliOutput.js +6 -7
  223. package/dist/cli/CliOutput.js.map +1 -1
  224. package/dist/cli/Command.d.ts +20 -2
  225. package/dist/cli/Command.d.ts.map +1 -1
  226. package/dist/cli/Command.js +4 -0
  227. package/dist/cli/Command.js.map +1 -1
  228. package/dist/cli/Prompt.d.ts +5 -6
  229. package/dist/cli/Prompt.d.ts.map +1 -1
  230. package/dist/cli/Prompt.js +9 -4
  231. package/dist/cli/Prompt.js.map +1 -1
  232. package/dist/cli/internal/command.d.ts +1 -1
  233. package/dist/cli/internal/command.d.ts.map +1 -1
  234. package/dist/cli/internal/config.d.ts +1 -1
  235. package/dist/cli/internal/config.d.ts.map +1 -1
  236. package/dist/cli/internal/config.js +3 -3
  237. package/dist/cli/internal/config.js.map +1 -1
  238. package/dist/cluster/ClusterCron.d.ts +21 -1
  239. package/dist/cluster/ClusterCron.d.ts.map +1 -1
  240. package/dist/cluster/ClusterCron.js +24 -6
  241. package/dist/cluster/ClusterCron.js.map +1 -1
  242. package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  243. package/dist/cluster/ClusterWorkflowEngine.js +30 -22
  244. package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
  245. package/dist/cluster/Sharding.d.ts.map +1 -1
  246. package/dist/cluster/Sharding.js +15 -3
  247. package/dist/cluster/Sharding.js.map +1 -1
  248. package/dist/cluster/ShardingConfig.d.ts +6 -0
  249. package/dist/cluster/ShardingConfig.d.ts.map +1 -1
  250. package/dist/cluster/ShardingConfig.js.map +1 -1
  251. package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
  252. package/dist/cluster/SqlMessageStorage.js +13 -15
  253. package/dist/cluster/SqlMessageStorage.js.map +1 -1
  254. package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
  255. package/dist/cluster/SqlRunnerStorage.js +18 -8
  256. package/dist/cluster/SqlRunnerStorage.js.map +1 -1
  257. package/dist/cluster/internal/entityManager.js +12 -8
  258. package/dist/cluster/internal/entityManager.js.map +1 -1
  259. package/dist/cluster/internal/entityReaper.js +1 -1
  260. package/dist/cluster/internal/entityReaper.js.map +1 -1
  261. package/dist/crypto/Kdf.d.ts +2 -1
  262. package/dist/crypto/Kdf.d.ts.map +1 -1
  263. package/dist/crypto/Kdf.js +2 -1
  264. package/dist/crypto/Kdf.js.map +1 -1
  265. package/dist/crypto/Password.d.ts +162 -0
  266. package/dist/crypto/Password.d.ts.map +1 -0
  267. package/dist/crypto/Password.js +217 -0
  268. package/dist/crypto/Password.js.map +1 -0
  269. package/dist/crypto/index.d.ts +5 -0
  270. package/dist/crypto/index.d.ts.map +1 -1
  271. package/dist/crypto/index.js +5 -0
  272. package/dist/crypto/index.js.map +1 -1
  273. package/dist/encoding/Base64.d.ts +63 -0
  274. package/dist/encoding/Base64.d.ts.map +1 -1
  275. package/dist/encoding/Base64.js +77 -0
  276. package/dist/encoding/Base64.js.map +1 -1
  277. package/dist/encoding/Base64Url.d.ts +1 -0
  278. package/dist/encoding/Base64Url.d.ts.map +1 -1
  279. package/dist/encoding/Base64Url.js +1 -0
  280. package/dist/encoding/Base64Url.js.map +1 -1
  281. package/dist/encoding/Csv.d.ts.map +1 -1
  282. package/dist/encoding/Csv.js +44 -16
  283. package/dist/encoding/Csv.js.map +1 -1
  284. package/dist/encoding/Hex.d.ts +5 -0
  285. package/dist/encoding/Hex.d.ts.map +1 -1
  286. package/dist/encoding/Hex.js +5 -0
  287. package/dist/encoding/Hex.js.map +1 -1
  288. package/dist/encoding/SchemaBinary.d.ts.map +1 -1
  289. package/dist/encoding/SchemaBinary.js +13 -124
  290. package/dist/encoding/SchemaBinary.js.map +1 -1
  291. package/dist/encoding/Sse.d.ts +1 -0
  292. package/dist/encoding/Sse.d.ts.map +1 -1
  293. package/dist/encoding/Sse.js +7 -5
  294. package/dist/encoding/Sse.js.map +1 -1
  295. package/dist/encoding/Xml.d.ts +117 -11
  296. package/dist/encoding/Xml.d.ts.map +1 -1
  297. package/dist/encoding/Xml.js +332 -42
  298. package/dist/encoding/Xml.js.map +1 -1
  299. package/dist/eventlog/EventJournal.d.ts.map +1 -1
  300. package/dist/eventlog/EventJournal.js +3 -8
  301. package/dist/eventlog/EventJournal.js.map +1 -1
  302. package/dist/eventlog/SqlEventLogServerEncrypted.js +6 -8
  303. package/dist/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  304. package/dist/http/FindMyWay/internal/router.js +163 -116
  305. package/dist/http/FindMyWay/internal/router.js.map +1 -1
  306. package/dist/http/FindMyWay.d.ts +99 -0
  307. package/dist/http/FindMyWay.d.ts.map +1 -1
  308. package/dist/http/FindMyWay.js +39 -0
  309. package/dist/http/FindMyWay.js.map +1 -1
  310. package/dist/http/HttpClient.d.ts.map +1 -1
  311. package/dist/http/HttpClient.js +1 -1
  312. package/dist/http/HttpClient.js.map +1 -1
  313. package/dist/http/HttpMiddleware.d.ts.map +1 -1
  314. package/dist/http/HttpMiddleware.js +15 -8
  315. package/dist/http/HttpMiddleware.js.map +1 -1
  316. package/dist/http/HttpRouter.d.ts +49 -1
  317. package/dist/http/HttpRouter.d.ts.map +1 -1
  318. package/dist/http/HttpRouter.js +70 -20
  319. package/dist/http/HttpRouter.js.map +1 -1
  320. package/dist/http/HttpServerResponse.d.ts.map +1 -1
  321. package/dist/http/HttpServerResponse.js +24 -58
  322. package/dist/http/HttpServerResponse.js.map +1 -1
  323. package/dist/http/Mime.d.ts.map +1 -1
  324. package/dist/http/Mime.js +3 -2
  325. package/dist/http/Mime.js.map +1 -1
  326. package/dist/http/internal/compression.d.ts.map +1 -1
  327. package/dist/http/internal/compression.js +2 -2
  328. package/dist/http/internal/compression.js.map +1 -1
  329. package/dist/http/internal/mediaType.d.ts.map +1 -0
  330. package/dist/{http-api → http}/internal/mediaType.js +4 -0
  331. package/dist/{http-api → http}/internal/mediaType.js.map +1 -1
  332. package/dist/http/internal/redactedPath.d.ts +2 -0
  333. package/dist/http/internal/redactedPath.d.ts.map +1 -0
  334. package/dist/http/internal/redactedPath.js +138 -0
  335. package/dist/http/internal/redactedPath.js.map +1 -0
  336. package/dist/http/internal/requestState.js +1 -0
  337. package/dist/http/internal/requestState.js.map +1 -1
  338. package/dist/http-api/HttpApi.d.ts +13 -2
  339. package/dist/http-api/HttpApi.d.ts.map +1 -1
  340. package/dist/http-api/HttpApi.js +16 -2
  341. package/dist/http-api/HttpApi.js.map +1 -1
  342. package/dist/http-api/HttpApiBuilder.d.ts.map +1 -1
  343. package/dist/http-api/HttpApiBuilder.js +3 -2
  344. package/dist/http-api/HttpApiBuilder.js.map +1 -1
  345. package/dist/http-api/HttpApiClient.d.ts.map +1 -1
  346. package/dist/http-api/HttpApiClient.js +6 -6
  347. package/dist/http-api/HttpApiClient.js.map +1 -1
  348. package/dist/http-api/HttpApiEndpoint.d.ts.map +1 -1
  349. package/dist/http-api/HttpApiEndpoint.js +1 -1
  350. package/dist/http-api/HttpApiEndpoint.js.map +1 -1
  351. package/dist/http-api/HttpApiScalar.d.ts +4 -0
  352. package/dist/http-api/HttpApiScalar.d.ts.map +1 -1
  353. package/dist/http-api/HttpApiScalar.js +10 -1
  354. package/dist/http-api/HttpApiScalar.js.map +1 -1
  355. package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
  356. package/dist/http-api/HttpApiSchema.js +1 -1
  357. package/dist/http-api/HttpApiSchema.js.map +1 -1
  358. package/dist/http-api/OpenApi.d.ts +2 -0
  359. package/dist/http-api/OpenApi.d.ts.map +1 -1
  360. package/dist/http-api/internal/httpApiScalar.js +5 -2
  361. package/dist/http-api/internal/httpApiScalar.js.map +1 -1
  362. package/dist/index.d.ts +5 -0
  363. package/dist/index.d.ts.map +1 -1
  364. package/dist/index.js +5 -0
  365. package/dist/index.js.map +1 -1
  366. package/dist/internal/arbitrary/model.js +0 -5
  367. package/dist/internal/arbitrary/model.js.map +1 -1
  368. package/dist/internal/arbitrary/regexp.js +2 -1
  369. package/dist/internal/arbitrary/regexp.js.map +1 -1
  370. package/dist/internal/arbitrary/runner.d.ts.map +1 -1
  371. package/dist/internal/arbitrary/runner.js +21 -16
  372. package/dist/internal/arbitrary/runner.js.map +1 -1
  373. package/dist/internal/arbitrary/schema.js +140 -23
  374. package/dist/internal/arbitrary/schema.js.map +1 -1
  375. package/dist/internal/codegen.d.ts +2 -0
  376. package/dist/internal/codegen.d.ts.map +1 -0
  377. package/dist/internal/codegen.js +59 -0
  378. package/dist/internal/codegen.js.map +1 -0
  379. package/dist/internal/core.js +3 -3
  380. package/dist/internal/core.js.map +1 -1
  381. package/dist/internal/dateTime.js +26 -12
  382. package/dist/internal/dateTime.js.map +1 -1
  383. package/dist/internal/effect.js +21 -7
  384. package/dist/internal/effect.js.map +1 -1
  385. package/dist/internal/hashMap.js +7 -7
  386. package/dist/internal/hashMap.js.map +1 -1
  387. package/dist/internal/matcher.js +2 -1
  388. package/dist/internal/matcher.js.map +1 -1
  389. package/dist/internal/record.js +18 -4
  390. package/dist/internal/record.js.map +1 -1
  391. package/dist/internal/result.js +1 -1
  392. package/dist/internal/result.js.map +1 -1
  393. package/dist/internal/schema/codeExpression.d.ts +4 -0
  394. package/dist/internal/schema/codeExpression.d.ts.map +1 -0
  395. package/dist/internal/schema/codeExpression.js +179 -0
  396. package/dist/internal/schema/codeExpression.js.map +1 -0
  397. package/dist/internal/schema/codeImports.d.ts +8 -0
  398. package/dist/internal/schema/codeImports.d.ts.map +1 -0
  399. package/dist/internal/schema/codeImports.js +135 -0
  400. package/dist/internal/schema/codeImports.js.map +1 -0
  401. package/dist/internal/schema/codeTokens.d.ts +8 -0
  402. package/dist/internal/schema/codeTokens.d.ts.map +1 -0
  403. package/dist/internal/schema/codeTokens.js +17 -0
  404. package/dist/internal/schema/codeTokens.js.map +1 -0
  405. package/dist/internal/schema/passthrough.d.ts +2 -0
  406. package/dist/internal/schema/passthrough.d.ts.map +1 -0
  407. package/dist/internal/schema/passthrough.js +8 -0
  408. package/dist/internal/schema/passthrough.js.map +1 -0
  409. package/dist/internal/schema/schemaCodegen.d.ts +2 -0
  410. package/dist/internal/schema/schemaCodegen.d.ts.map +1 -0
  411. package/dist/internal/schema/schemaCodegen.js +377 -0
  412. package/dist/internal/schema/schemaCodegen.js.map +1 -0
  413. package/dist/internal/schema/toJsonSchemaDocument.js +11 -4
  414. package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
  415. package/dist/internal/trie.js +51 -64
  416. package/dist/internal/trie.js.map +1 -1
  417. package/dist/internal/utf8.d.ts +2 -0
  418. package/dist/internal/utf8.d.ts.map +1 -0
  419. package/dist/internal/utf8.js +151 -0
  420. package/dist/internal/utf8.js.map +1 -0
  421. package/dist/internal/version.js +1 -1
  422. package/dist/jose/Jwks.d.ts +13 -0
  423. package/dist/jose/Jwks.d.ts.map +1 -1
  424. package/dist/jose/Jwks.js +10 -2
  425. package/dist/jose/Jwks.js.map +1 -1
  426. package/dist/observability/OtlpExporter.d.ts.map +1 -1
  427. package/dist/observability/OtlpExporter.js +12 -10
  428. package/dist/observability/OtlpExporter.js.map +1 -1
  429. package/dist/observability/OtlpLogger.d.ts.map +1 -1
  430. package/dist/observability/OtlpLogger.js +5 -3
  431. package/dist/observability/OtlpLogger.js.map +1 -1
  432. package/dist/observability/internal/otlpProtobuf.d.ts +4 -2
  433. package/dist/observability/internal/otlpProtobuf.d.ts.map +1 -1
  434. package/dist/observability/internal/otlpProtobuf.js +238 -156
  435. package/dist/observability/internal/otlpProtobuf.js.map +1 -1
  436. package/dist/persistence/PersistedQueue.d.ts.map +1 -1
  437. package/dist/persistence/PersistedQueue.js +20 -3
  438. package/dist/persistence/PersistedQueue.js.map +1 -1
  439. package/dist/protobuf/ProtobufDescriptor.d.ts +377 -0
  440. package/dist/protobuf/ProtobufDescriptor.d.ts.map +1 -0
  441. package/dist/protobuf/ProtobufDescriptor.js +135 -0
  442. package/dist/protobuf/ProtobufDescriptor.js.map +1 -0
  443. package/dist/protobuf/ProtobufDescriptorProto.d.ts +2083 -0
  444. package/dist/protobuf/ProtobufDescriptorProto.d.ts.map +1 -0
  445. package/dist/protobuf/ProtobufDescriptorProto.js +2674 -0
  446. package/dist/protobuf/ProtobufDescriptorProto.js.map +1 -0
  447. package/dist/protobuf/ProtobufMessage.d.ts +183 -0
  448. package/dist/protobuf/ProtobufMessage.d.ts.map +1 -0
  449. package/dist/protobuf/ProtobufMessage.js +232 -0
  450. package/dist/protobuf/ProtobufMessage.js.map +1 -0
  451. package/dist/protobuf/ProtobufReader.d.ts +350 -0
  452. package/dist/protobuf/ProtobufReader.d.ts.map +1 -0
  453. package/dist/protobuf/ProtobufReader.js +698 -0
  454. package/dist/protobuf/ProtobufReader.js.map +1 -0
  455. package/dist/protobuf/ProtobufWriter.d.ts +224 -0
  456. package/dist/protobuf/ProtobufWriter.d.ts.map +1 -0
  457. package/dist/protobuf/ProtobufWriter.js +483 -0
  458. package/dist/protobuf/ProtobufWriter.js.map +1 -0
  459. package/dist/protobuf/index.d.ts +30 -0
  460. package/dist/protobuf/index.d.ts.map +1 -0
  461. package/dist/protobuf/index.js +31 -0
  462. package/dist/protobuf/index.js.map +1 -0
  463. package/dist/protobuf/internal/binary.d.ts +2 -0
  464. package/dist/protobuf/internal/binary.d.ts.map +1 -0
  465. package/dist/protobuf/internal/binary.js +966 -0
  466. package/dist/protobuf/internal/binary.js.map +1 -0
  467. package/dist/protobuf/internal/resolve.d.ts +2 -0
  468. package/dist/protobuf/internal/resolve.d.ts.map +1 -0
  469. package/dist/protobuf/internal/resolve.js +463 -0
  470. package/dist/protobuf/internal/resolve.js.map +1 -0
  471. package/dist/protobuf/internal/wireType.d.ts +2 -0
  472. package/dist/protobuf/internal/wireType.d.ts.map +1 -0
  473. package/dist/protobuf/internal/wireType.js +10 -0
  474. package/dist/protobuf/internal/wireType.js.map +1 -0
  475. package/dist/reactivity/AsyncResult.d.ts +3 -0
  476. package/dist/reactivity/AsyncResult.d.ts.map +1 -1
  477. package/dist/reactivity/AsyncResult.js +4 -1
  478. package/dist/reactivity/AsyncResult.js.map +1 -1
  479. package/dist/reactivity/Atom.d.ts +10 -4
  480. package/dist/reactivity/Atom.d.ts.map +1 -1
  481. package/dist/reactivity/Atom.js +38 -13
  482. package/dist/reactivity/Atom.js.map +1 -1
  483. package/dist/reactivity/AtomHttpApi.d.ts +5 -0
  484. package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
  485. package/dist/reactivity/AtomHttpApi.js +5 -1
  486. package/dist/reactivity/AtomHttpApi.js.map +1 -1
  487. package/dist/reactivity/AtomRegistry.js +13 -0
  488. package/dist/reactivity/AtomRegistry.js.map +1 -1
  489. package/dist/reactivity/AtomRpc.d.ts +5 -0
  490. package/dist/reactivity/AtomRpc.d.ts.map +1 -1
  491. package/dist/reactivity/AtomRpc.js +6 -1
  492. package/dist/reactivity/AtomRpc.js.map +1 -1
  493. package/dist/rpc/Rpc.d.ts +25 -0
  494. package/dist/rpc/Rpc.d.ts.map +1 -1
  495. package/dist/rpc/Rpc.js +18 -0
  496. package/dist/rpc/Rpc.js.map +1 -1
  497. package/dist/rpc/RpcClient.d.ts.map +1 -1
  498. package/dist/rpc/RpcClient.js +38 -21
  499. package/dist/rpc/RpcClient.js.map +1 -1
  500. package/dist/rpc/RpcGroup.d.ts +5 -0
  501. package/dist/rpc/RpcGroup.d.ts.map +1 -1
  502. package/dist/rpc/RpcGroup.js.map +1 -1
  503. package/dist/rpc/RpcMiddleware.d.ts +9 -0
  504. package/dist/rpc/RpcMiddleware.d.ts.map +1 -1
  505. package/dist/rpc/RpcMiddleware.js.map +1 -1
  506. package/dist/rpc/RpcSerialization.d.ts +7 -1
  507. package/dist/rpc/RpcSerialization.d.ts.map +1 -1
  508. package/dist/rpc/RpcSerialization.js +22 -5
  509. package/dist/rpc/RpcSerialization.js.map +1 -1
  510. package/dist/rpc/RpcServer.d.ts.map +1 -1
  511. package/dist/rpc/RpcServer.js +33 -18
  512. package/dist/rpc/RpcServer.js.map +1 -1
  513. package/dist/schema/SchemaCompiler/runtime.js +2 -1
  514. package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
  515. package/dist/schema/VariantSchema.d.ts +10 -2
  516. package/dist/schema/VariantSchema.d.ts.map +1 -1
  517. package/dist/schema/VariantSchema.js +7 -1
  518. package/dist/schema/VariantSchema.js.map +1 -1
  519. package/dist/socket/Socket.d.ts +24 -10
  520. package/dist/socket/Socket.d.ts.map +1 -1
  521. package/dist/socket/Socket.js +52 -17
  522. package/dist/socket/Socket.js.map +1 -1
  523. package/dist/sql/Migrator.d.ts +3 -0
  524. package/dist/sql/Migrator.d.ts.map +1 -1
  525. package/dist/sql/Migrator.js +10 -1
  526. package/dist/sql/Migrator.js.map +1 -1
  527. package/dist/sql/SqlModel.d.ts.map +1 -1
  528. package/dist/sql/SqlModel.js +1 -0
  529. package/dist/sql/SqlModel.js.map +1 -1
  530. package/dist/testing/TestConsole.d.ts +96 -0
  531. package/dist/testing/TestConsole.d.ts.map +1 -1
  532. package/dist/testing/TestConsole.js +78 -6
  533. package/dist/testing/TestConsole.js.map +1 -1
  534. package/dist/testing/TestSchema.d.ts +5 -1
  535. package/dist/testing/TestSchema.d.ts.map +1 -1
  536. package/dist/testing/TestSchema.js +7 -2
  537. package/dist/testing/TestSchema.js.map +1 -1
  538. package/dist/workers/SharedMemory.d.ts +115 -0
  539. package/dist/workers/SharedMemory.d.ts.map +1 -0
  540. package/dist/workers/SharedMemory.js +149 -0
  541. package/dist/workers/SharedMemory.js.map +1 -0
  542. package/dist/workers/Transferable.d.ts.map +1 -1
  543. package/dist/workers/Transferable.js +1 -4
  544. package/dist/workers/Transferable.js.map +1 -1
  545. package/dist/workers/index.d.ts +5 -0
  546. package/dist/workers/index.d.ts.map +1 -1
  547. package/dist/workers/index.js +5 -0
  548. package/dist/workers/index.js.map +1 -1
  549. package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
  550. package/dist/workflow/WorkflowEngine.js +3 -1
  551. package/dist/workflow/WorkflowEngine.js.map +1 -1
  552. package/package.json +7 -4
  553. package/src/Arbitrary.ts +60 -3
  554. package/src/BigInt.ts +247 -9
  555. package/src/Cache.ts +4 -2
  556. package/src/Cause.ts +3 -3
  557. package/src/Chunk.ts +7 -3
  558. package/src/Clock.ts +5 -2
  559. package/src/Codegen.ts +741 -0
  560. package/src/Config.ts +35 -4
  561. package/src/ConfigProvider.ts +24 -7
  562. package/src/Effect.ts +871 -109
  563. package/src/Equivalence.ts +16 -13
  564. package/src/Fiber.ts +58 -8
  565. package/src/FiberHandle.ts +86 -12
  566. package/src/FiberMap.ts +83 -10
  567. package/src/FiberSet.ts +96 -8
  568. package/src/Formatter.ts +2 -0
  569. package/src/LayerMap.ts +14 -4
  570. package/src/LayerRef.ts +2 -2
  571. package/src/Match.ts +16 -0
  572. package/src/Metric.ts +1 -1
  573. package/src/Option.ts +9 -5
  574. package/src/Order.ts +9 -4
  575. package/src/Pool.ts +22 -17
  576. package/src/Predicate.ts +7 -3
  577. package/src/Queue.ts +84 -31
  578. package/src/Rational.ts +198 -0
  579. package/src/Request.ts +20 -0
  580. package/src/Result.ts +9 -6
  581. package/src/Schema.ts +69 -32
  582. package/src/SchemaAST.ts +15 -4
  583. package/src/SchemaGetter.ts +17 -10
  584. package/src/SchemaRepresentation.ts +19 -74
  585. package/src/SchemaTransformation.ts +12 -11
  586. package/src/Scope.ts +12 -6
  587. package/src/ScopedCache.ts +2 -1
  588. package/src/Semaphore.ts +18 -4
  589. package/src/Stream.ts +66 -20
  590. package/src/String.ts +83 -6
  591. package/src/Struct.ts +138 -5
  592. package/src/TextDiff.ts +186 -30
  593. package/src/TxPriorityQueue.ts +2 -2
  594. package/src/ai/LanguageModel.ts +2 -1
  595. package/src/ai/McpServer.ts +145 -22
  596. package/src/ai/Tool.ts +3 -2
  597. package/src/ai/Toolkit.ts +3 -1
  598. package/src/chat/Chat.ts +164 -0
  599. package/src/chat/ChatAdapter.ts +444 -0
  600. package/src/chat/ChatError.ts +684 -0
  601. package/src/chat/ChatEvent.ts +221 -0
  602. package/src/chat/ChatHandler.ts +102 -0
  603. package/src/chat/ChatInteraction.ts +1979 -0
  604. package/src/chat/ChatMarkdown.ts +1406 -0
  605. package/src/chat/ChatMessage.ts +213 -0
  606. package/src/chat/ChatTest.ts +2606 -0
  607. package/src/chat/ChatThread.ts +132 -0
  608. package/src/chat/ChatUi.ts +320 -0
  609. package/src/chat/index.ts +72 -0
  610. package/src/chat/internal/retries.ts +7 -0
  611. package/src/cli/CliOutput.ts +4 -5
  612. package/src/cli/Command.ts +20 -2
  613. package/src/cli/Prompt.ts +15 -9
  614. package/src/cli/internal/config.ts +8 -8
  615. package/src/cluster/ClusterCron.ts +33 -10
  616. package/src/cluster/ClusterWorkflowEngine.ts +42 -23
  617. package/src/cluster/Sharding.ts +17 -3
  618. package/src/cluster/ShardingConfig.ts +3 -0
  619. package/src/cluster/SqlMessageStorage.ts +16 -20
  620. package/src/cluster/SqlRunnerStorage.ts +21 -8
  621. package/src/cluster/internal/entityManager.ts +19 -10
  622. package/src/cluster/internal/entityReaper.ts +1 -1
  623. package/src/crypto/Kdf.ts +2 -1
  624. package/src/crypto/Password.ts +258 -0
  625. package/src/crypto/index.ts +6 -0
  626. package/src/encoding/Base64.ts +79 -0
  627. package/src/encoding/Base64Url.ts +1 -0
  628. package/src/encoding/Csv.ts +47 -20
  629. package/src/encoding/Hex.ts +5 -0
  630. package/src/encoding/SchemaBinary.ts +13 -79
  631. package/src/encoding/Sse.ts +7 -5
  632. package/src/encoding/Xml.ts +394 -47
  633. package/src/eventlog/EventJournal.ts +3 -8
  634. package/src/eventlog/SqlEventLogServerEncrypted.ts +9 -9
  635. package/src/http/FindMyWay/internal/router.ts +181 -129
  636. package/src/http/FindMyWay.ts +106 -0
  637. package/src/http/HttpClient.ts +2 -1
  638. package/src/http/HttpMiddleware.ts +22 -9
  639. package/src/http/HttpRouter.ts +84 -20
  640. package/src/http/HttpServerResponse.ts +33 -61
  641. package/src/http/Mime.ts +3 -2
  642. package/src/http/internal/compression.ts +2 -2
  643. package/src/{http-api → http}/internal/mediaType.ts +4 -0
  644. package/src/http/internal/redactedPath.ts +144 -0
  645. package/src/http/internal/requestState.ts +2 -0
  646. package/src/http-api/HttpApi.ts +25 -2
  647. package/src/http-api/HttpApiBuilder.ts +5 -2
  648. package/src/http-api/HttpApiClient.ts +10 -6
  649. package/src/http-api/HttpApiEndpoint.ts +1 -1
  650. package/src/http-api/HttpApiScalar.ts +9 -1
  651. package/src/http-api/HttpApiSchema.ts +1 -1
  652. package/src/http-api/OpenApi.ts +2 -0
  653. package/src/http-api/internal/httpApiScalar.ts +5 -1
  654. package/src/index.ts +6 -0
  655. package/src/internal/arbitrary/model.ts +3 -9
  656. package/src/internal/arbitrary/regexp.ts +3 -1
  657. package/src/internal/arbitrary/runner.ts +28 -14
  658. package/src/internal/arbitrary/schema.ts +140 -35
  659. package/src/internal/codegen.ts +53 -0
  660. package/src/internal/core.ts +3 -3
  661. package/src/internal/dateTime.ts +30 -13
  662. package/src/internal/effect.ts +25 -9
  663. package/src/internal/hashMap.ts +8 -7
  664. package/src/internal/matcher.ts +2 -1
  665. package/src/internal/record.ts +19 -4
  666. package/src/internal/result.ts +1 -1
  667. package/src/internal/schema/codeExpression.ts +179 -0
  668. package/src/internal/schema/codeImports.ts +142 -0
  669. package/src/internal/schema/codeTokens.ts +39 -0
  670. package/src/internal/schema/passthrough.ts +8 -0
  671. package/src/internal/schema/schemaCodegen.ts +543 -0
  672. package/src/internal/schema/toJsonSchemaDocument.ts +13 -4
  673. package/src/internal/trie.ts +46 -60
  674. package/src/internal/utf8.ts +106 -0
  675. package/src/internal/version.ts +1 -1
  676. package/src/jose/Jwks.ts +23 -4
  677. package/src/observability/OtlpExporter.ts +12 -10
  678. package/src/observability/OtlpLogger.ts +5 -3
  679. package/src/observability/internal/otlpProtobuf.ts +386 -457
  680. package/src/persistence/PersistedQueue.ts +21 -4
  681. package/src/protobuf/ProtobufDescriptor.ts +503 -0
  682. package/src/protobuf/ProtobufDescriptorProto.ts +3611 -0
  683. package/src/protobuf/ProtobufMessage.ts +277 -0
  684. package/src/protobuf/ProtobufReader.ts +756 -0
  685. package/src/protobuf/ProtobufWriter.ts +530 -0
  686. package/src/protobuf/index.ts +36 -0
  687. package/src/protobuf/internal/binary.ts +1215 -0
  688. package/src/protobuf/internal/resolve.ts +533 -0
  689. package/src/protobuf/internal/wireType.ts +9 -0
  690. package/src/reactivity/AsyncResult.ts +6 -1
  691. package/src/reactivity/Atom.ts +55 -16
  692. package/src/reactivity/AtomHttpApi.ts +10 -1
  693. package/src/reactivity/AtomRegistry.ts +16 -0
  694. package/src/reactivity/AtomRpc.ts +11 -1
  695. package/src/rpc/Rpc.ts +31 -0
  696. package/src/rpc/RpcClient.ts +30 -21
  697. package/src/rpc/RpcGroup.ts +5 -0
  698. package/src/rpc/RpcMiddleware.ts +9 -0
  699. package/src/rpc/RpcSerialization.ts +26 -6
  700. package/src/rpc/RpcServer.ts +33 -20
  701. package/src/schema/SchemaCompiler/runtime.ts +2 -3
  702. package/src/schema/VariantSchema.ts +12 -4
  703. package/src/socket/Socket.ts +67 -20
  704. package/src/sql/Migrator.ts +8 -1
  705. package/src/sql/SqlModel.ts +4 -0
  706. package/src/testing/TestConsole.ts +119 -9
  707. package/src/testing/TestSchema.ts +8 -3
  708. package/src/workers/SharedMemory.ts +227 -0
  709. package/src/workers/Transferable.ts +1 -5
  710. package/src/workers/index.ts +6 -0
  711. package/src/workflow/WorkflowEngine.ts +3 -1
  712. package/dist/http-api/internal/mediaType.d.ts.map +0 -1
  713. package/dist/internal/schema/toCodeDocument.d.ts +0 -2
  714. package/dist/internal/schema/toCodeDocument.d.ts.map +0 -1
  715. package/dist/internal/schema/toCodeDocument.js +0 -447
  716. package/dist/internal/schema/toCodeDocument.js.map +0 -1
  717. package/dist/observability/internal/protobuf.d.ts +0 -2
  718. package/dist/observability/internal/protobuf.d.ts.map +0 -1
  719. package/dist/observability/internal/protobuf.js +0 -169
  720. package/dist/observability/internal/protobuf.js.map +0 -1
  721. package/src/internal/schema/toCodeDocument.ts +0 -578
  722. package/src/observability/internal/protobuf.ts +0 -225
  723. /package/dist/{http-api → http}/internal/mediaType.d.ts +0 -0
package/src/Effect.ts CHANGED
@@ -10,6 +10,25 @@
10
10
  * creating effects, combining them, handling failures, managing resources, and
11
11
  * running effect programs.
12
12
  *
13
+ * A fiber runs in either an interruptible or an uninterruptible region.
14
+ * `interruptible`, `uninterruptible`, and `uninterruptibleMask` change the
15
+ * region for the effect they wrap.
16
+ *
17
+ * Interrupting a fiber records a request. In an interruptible region the
18
+ * fiber stops its current work. In an uninterruptible region it continues
19
+ * until it next enters an interruptible region, where the request takes effect.
20
+ *
21
+ * An interrupted fiber skips ordinary continuations and failure handlers in
22
+ * interruptible regions. By default, `onExit` runs cleanup and `Scope.close`
23
+ * runs registered finalizers in an uninterruptible region.
24
+ *
25
+ * Fork and run APIs start fibers in an interruptible region by default,
26
+ * regardless of the caller's region. Concurrent `all` and `forEach` effects
27
+ * inherit the caller's region. Any contender a race or timeout starts is
28
+ * initially interruptible.
29
+ *
30
+ * `Fiber.interrupt` waits for the fiber to finish, including its cleanup.
31
+ *
13
32
  * @stability stable
14
33
  * @since 2.0.0
15
34
  */
@@ -337,7 +356,7 @@ export declare namespace All {
337
356
  * @since 2.0.0
338
357
  */
339
358
  export type ReturnObject<T, Discard extends boolean, Mode extends boolean = false> = [T] extends [
340
- Record<string, EffectAny>
359
+ Record<PropertyKey, EffectAny>
341
360
  ] ? Effect<
342
361
  Discard extends true ? void
343
362
  : {
@@ -377,7 +396,7 @@ export declare namespace All {
377
396
  * @since 2.0.0
378
397
  */
379
398
  export type Return<
380
- Arg extends Iterable<EffectAny> | Record<string, EffectAny>,
399
+ Arg extends Iterable<EffectAny> | Record<PropertyKey, EffectAny>,
381
400
  O extends {
382
401
  readonly concurrency?: Concurrency | undefined
383
402
  readonly discard?: boolean | undefined
@@ -385,7 +404,7 @@ export declare namespace All {
385
404
  }
386
405
  > = [Arg] extends [ReadonlyArray<EffectAny>] ? ReturnTuple<Arg, IsDiscard<O>, IsResult<O>>
387
406
  : [Arg] extends [Iterable<EffectAny>] ? ReturnIterable<Arg, IsDiscard<O>, IsResult<O>>
388
- : [Arg] extends [Record<string, EffectAny>] ? ReturnObject<Arg, IsDiscard<O>, IsResult<O>>
407
+ : [Arg] extends [Record<PropertyKey, EffectAny>] ? ReturnObject<Arg, IsDiscard<O>, IsResult<O>>
389
408
  : never
390
409
 
391
410
  type ObjectValues<T> = T extends unknown ? T[keyof T] : never
@@ -406,6 +425,8 @@ export declare namespace All {
406
425
  * results under the same keys. By default, the combined effect fails on the
407
426
  * first failure; with concurrent execution, effects that have already started
408
427
  * may be interrupted, while effects not yet started are skipped.
428
+ * Record inputs use own enumerable string and symbol properties.
429
+ * Non-enumerable and inherited properties are ignored.
409
430
  *
410
431
  * Options:
411
432
  *
@@ -414,6 +435,18 @@ export declare namespace All {
414
435
  * `Result` in the same output shape. Use `discard: true` to ignore successful
415
436
  * values and return `void`.
416
437
  *
438
+ * With concurrent execution, a failure requests interruption of other effects
439
+ * that have already started. The returned effect waits for those fibers to finish,
440
+ * including their finalizers. Uninterruptible regions can delay completion.
441
+ * This fail-fast behavior does not apply to `mode: "result"`. Concurrent
442
+ * effects inherit the surrounding region's interruptibility.
443
+ *
444
+ * **Gotchas**
445
+ *
446
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
447
+ * can keep running unless the operation honors cancellation. Fibers started
448
+ * with `forkDetach` are not awaited.
449
+ *
417
450
  * **Example** (Collecting tuple results in order)
418
451
  *
419
452
  * ```ts import.meta.vitest
@@ -507,7 +540,7 @@ export declare namespace All {
507
540
  export const all: <
508
541
  const Arg extends
509
542
  | Iterable<Effect<any, any, any>>
510
- | Record<string, Effect<any, any, any>>,
543
+ | Record<PropertyKey, Effect<any, any, any>>,
511
544
  O extends {
512
545
  readonly concurrency?: Concurrency | undefined
513
546
  readonly discard?: boolean | undefined
@@ -1064,8 +1097,8 @@ export const findFirstFilter: {
1064
1097
  * The `forEach` function applies a provided operation to each element in the
1065
1098
  * iterable, producing a new effect that returns an array of results.
1066
1099
  *
1067
- * If any effect fails, the iteration stops immediately (short-circuiting), and
1068
- * the error is propagated.
1100
+ * If any effect fails, the iteration short-circuits and propagates the error
1101
+ * after cleanup.
1069
1102
  *
1070
1103
  * Concurrency:
1071
1104
  *
@@ -1077,6 +1110,17 @@ export const findFirstFilter: {
1077
1110
  * If the `discard` option is set to `true`, the intermediate results are not
1078
1111
  * collected, and the final result of the operation is `void`.
1079
1112
  *
1113
+ * With concurrent execution, a failure requests interruption of other effects
1114
+ * that have already started. The returned effect waits for those fibers to finish,
1115
+ * including their finalizers. Uninterruptible regions can delay completion.
1116
+ * Concurrent effects inherit the surrounding region's interruptibility.
1117
+ *
1118
+ * **Gotchas**
1119
+ *
1120
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
1121
+ * can keep running unless the operation honors cancellation. Fibers started
1122
+ * with `forkDetach` are not awaited.
1123
+ *
1080
1124
  * **Example** (Mapping over an iterable with effects)
1081
1125
  *
1082
1126
  * ```ts import.meta.vitest
@@ -1130,8 +1174,8 @@ export const forEach: {
1130
1174
  * The `forEach` function applies a provided operation to each element in the
1131
1175
  * iterable, producing a new effect that returns an array of results.
1132
1176
  *
1133
- * If any effect fails, the iteration stops immediately (short-circuiting), and
1134
- * the error is propagated.
1177
+ * If any effect fails, the iteration short-circuits and propagates the error
1178
+ * after cleanup.
1135
1179
  *
1136
1180
  * Concurrency:
1137
1181
  *
@@ -1143,6 +1187,17 @@ export const forEach: {
1143
1187
  * If the `discard` option is set to `true`, the intermediate results are not
1144
1188
  * collected, and the final result of the operation is `void`.
1145
1189
  *
1190
+ * With concurrent execution, a failure requests interruption of other effects
1191
+ * that have already started. The returned effect waits for those fibers to finish,
1192
+ * including their finalizers. Uninterruptible regions can delay completion.
1193
+ * Concurrent effects inherit the surrounding region's interruptibility.
1194
+ *
1195
+ * **Gotchas**
1196
+ *
1197
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
1198
+ * can keep running unless the operation honors cancellation. Fibers started
1199
+ * with `forkDetach` are not awaited.
1200
+ *
1146
1201
  * **Example** (Mapping over an iterable with effects)
1147
1202
  *
1148
1203
  * ```ts import.meta.vitest
@@ -1201,8 +1256,8 @@ export const forEach: {
1201
1256
  * The `forEach` function applies a provided operation to each element in the
1202
1257
  * iterable, producing a new effect that returns an array of results.
1203
1258
  *
1204
- * If any effect fails, the iteration stops immediately (short-circuiting), and
1205
- * the error is propagated.
1259
+ * If any effect fails, the iteration short-circuits and propagates the error
1260
+ * after cleanup.
1206
1261
  *
1207
1262
  * Concurrency:
1208
1263
  *
@@ -1214,6 +1269,17 @@ export const forEach: {
1214
1269
  * If the `discard` option is set to `true`, the intermediate results are not
1215
1270
  * collected, and the final result of the operation is `void`.
1216
1271
  *
1272
+ * With concurrent execution, a failure requests interruption of other effects
1273
+ * that have already started. The returned effect waits for those fibers to finish,
1274
+ * including their finalizers. Uninterruptible regions can delay completion.
1275
+ * Concurrent effects inherit the surrounding region's interruptibility.
1276
+ *
1277
+ * **Gotchas**
1278
+ *
1279
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
1280
+ * can keep running unless the operation honors cancellation. Fibers started
1281
+ * with `forkDetach` are not awaited.
1282
+ *
1217
1283
  * **Example** (Mapping over an iterable with effects)
1218
1284
  *
1219
1285
  * ```ts import.meta.vitest
@@ -1703,6 +1769,11 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
1703
1769
  * different effects. Any side effects or scoped captures inside the thunk are
1704
1770
  * re-executed on each invocation.
1705
1771
  *
1772
+ * **Gotchas**
1773
+ *
1774
+ * If the thunk throws, the thrown value is treated as a defect, not as a typed
1775
+ * failure. Use `Effect.try` when a throw should become a typed failure.
1776
+ *
1706
1777
  * **Example** (Lazily evaluating side effects)
1707
1778
  *
1708
1779
  * ```ts import.meta.vitest
@@ -3886,9 +3957,8 @@ export const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, never
3886
3957
  * `exit` wraps an effect's success or failure inside an `Exit` type, allowing
3887
3958
  * you to handle both cases explicitly.
3888
3959
  *
3889
- * The resulting effect cannot fail because the failure is encapsulated within
3890
- * the `Exit.Failure` type. The error type is set to `never`, indicating that
3891
- * the effect is structured to never fail directly.
3960
+ * If the running fiber is interrupted in an interruptible region, `exit`
3961
+ * does not turn that interruption into an `Exit` value.
3892
3962
  *
3893
3963
  * **Example** (Capturing completion as Exit)
3894
3964
  *
@@ -3906,6 +3976,7 @@ export const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, never
3906
3976
  * Effect.runSync(program2) // => Exit.fail("Something went wrong")
3907
3977
  * ```
3908
3978
  *
3979
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
3909
3980
  * @see {@link option} for a version that uses `Option` instead.
3910
3981
  * @see {@link result} for a version that uses `Result` instead.
3911
3982
  *
@@ -5679,8 +5750,7 @@ export const unwrapReason: {
5679
5750
  } = internal.unwrapReason
5680
5751
 
5681
5752
  /**
5682
- * Handles both recoverable and unrecoverable errors by providing a recovery
5683
- * effect.
5753
+ * Runs a recovery effect with the full cause of failure.
5684
5754
  *
5685
5755
  * **When to use**
5686
5756
  *
@@ -5690,7 +5760,15 @@ export const unwrapReason: {
5690
5760
  *
5691
5761
  * **Details**
5692
5762
  *
5693
- * When to Recover from Defects:
5763
+ * The handler can recover from an interruption in the cause, such as one from
5764
+ * `Effect.interrupt` or from joining an interrupted fiber.
5765
+ *
5766
+ * Interruption of the fiber running `catchCause` is different. In an
5767
+ * interruptible region, the handler is skipped and the fiber runs its cleanup
5768
+ * before exiting. A handler in an uninterruptible region can handle an
5769
+ * interruption delivered in an inner interruptible region. A pending request
5770
+ * alone neither invokes that handler nor adds an interruption to an unrelated
5771
+ * failure while the fiber remains uninterruptible.
5694
5772
  *
5695
5773
  * Defects are unexpected errors that typically shouldn't be recovered from, as
5696
5774
  * they often indicate serious issues. However, in some cases, such as
@@ -5725,8 +5803,7 @@ export const unwrapReason: {
5725
5803
  */
5726
5804
  export const catchCause: {
5727
5805
  /**
5728
- * Handles both recoverable and unrecoverable errors by providing a recovery
5729
- * effect.
5806
+ * Runs a recovery effect with the full cause of failure.
5730
5807
  *
5731
5808
  * **When to use**
5732
5809
  *
@@ -5736,7 +5813,15 @@ export const catchCause: {
5736
5813
  *
5737
5814
  * **Details**
5738
5815
  *
5739
- * When to Recover from Defects:
5816
+ * The handler can recover from an interruption in the cause, such as one from
5817
+ * `Effect.interrupt` or from joining an interrupted fiber.
5818
+ *
5819
+ * Interruption of the fiber running `catchCause` is different. In an
5820
+ * interruptible region, the handler is skipped and the fiber runs its cleanup
5821
+ * before exiting. A handler in an uninterruptible region can handle an
5822
+ * interruption delivered in an inner interruptible region. A pending request
5823
+ * alone neither invokes that handler nor adds an interruption to an unrelated
5824
+ * failure while the fiber remains uninterruptible.
5740
5825
  *
5741
5826
  * Defects are unexpected errors that typically shouldn't be recovered from, as
5742
5827
  * they often indicate serious issues. However, in some cases, such as
@@ -5771,8 +5856,7 @@ export const catchCause: {
5771
5856
  */
5772
5857
  <E, A2, E2, R2>(f: (cause: Cause.Cause<E>) => Effect<A2, E2, R2>): <A, R>(self: Effect<A, E, R>) => Effect<A2 | A, E2, R2 | R>
5773
5858
  /**
5774
- * Handles both recoverable and unrecoverable errors by providing a recovery
5775
- * effect.
5859
+ * Runs a recovery effect with the full cause of failure.
5776
5860
  *
5777
5861
  * **When to use**
5778
5862
  *
@@ -5782,7 +5866,15 @@ export const catchCause: {
5782
5866
  *
5783
5867
  * **Details**
5784
5868
  *
5785
- * When to Recover from Defects:
5869
+ * The handler can recover from an interruption in the cause, such as one from
5870
+ * `Effect.interrupt` or from joining an interrupted fiber.
5871
+ *
5872
+ * Interruption of the fiber running `catchCause` is different. In an
5873
+ * interruptible region, the handler is skipped and the fiber runs its cleanup
5874
+ * before exiting. A handler in an uninterruptible region can handle an
5875
+ * interruption delivered in an inner interruptible region. A pending request
5876
+ * alone neither invokes that handler nor adds an interruption to an unrelated
5877
+ * failure while the fiber remains uninterruptible.
5786
5878
  *
5787
5879
  * Defects are unexpected errors that typically shouldn't be recovered from, as
5788
5880
  * they often indicate serious issues. However, in some cases, such as
@@ -6418,6 +6510,9 @@ export const catchNoSuchElement: <A, E, R>(
6418
6510
  * that match a specific predicate. This is useful when you want to handle
6419
6511
  * only certain types of errors while letting others propagate.
6420
6512
  *
6513
+ * The failure handler is skipped if the running fiber is interrupted in an
6514
+ * interruptible region.
6515
+ *
6421
6516
  * **Example** (Recovering from selected causes)
6422
6517
  *
6423
6518
  * ```ts import.meta.vitest
@@ -6463,6 +6558,9 @@ export const catchCauseIf: {
6463
6558
  * that match a specific predicate. This is useful when you want to handle
6464
6559
  * only certain types of errors while letting others propagate.
6465
6560
  *
6561
+ * The failure handler is skipped if the running fiber is interrupted in an
6562
+ * interruptible region.
6563
+ *
6466
6564
  * **Example** (Recovering from selected causes)
6467
6565
  *
6468
6566
  * ```ts import.meta.vitest
@@ -6511,6 +6609,9 @@ export const catchCauseIf: {
6511
6609
  * that match a specific predicate. This is useful when you want to handle
6512
6610
  * only certain types of errors while letting others propagate.
6513
6611
  *
6612
+ * The failure handler is skipped if the running fiber is interrupted in an
6613
+ * interruptible region.
6614
+ *
6514
6615
  * **Example** (Recovering from selected causes)
6515
6616
  *
6516
6617
  * ```ts import.meta.vitest
@@ -6564,6 +6665,9 @@ export const catchCauseIf: {
6564
6665
  * receives the selected value and the original cause. When it fails, the effect
6565
6666
  * re-fails with the residual cause returned by the filter.
6566
6667
  *
6668
+ * The failure handler is skipped if the running fiber is interrupted in an
6669
+ * interruptible region.
6670
+ *
6567
6671
  * @see {@link catchCauseIf} for predicate-based cause selection
6568
6672
  * @see {@link catchFilter} for filtering typed error values instead of full causes
6569
6673
  * @see {@link catchCause} for recovering from every cause without filtering
@@ -6588,6 +6692,9 @@ export const catchCauseFilter: {
6588
6692
  * receives the selected value and the original cause. When it fails, the effect
6589
6693
  * re-fails with the residual cause returned by the filter.
6590
6694
  *
6695
+ * The failure handler is skipped if the running fiber is interrupted in an
6696
+ * interruptible region.
6697
+ *
6591
6698
  * @see {@link catchCauseIf} for predicate-based cause selection
6592
6699
  * @see {@link catchFilter} for filtering typed error values instead of full causes
6593
6700
  * @see {@link catchCause} for recovering from every cause without filtering
@@ -6615,6 +6722,9 @@ export const catchCauseFilter: {
6615
6722
  * receives the selected value and the original cause. When it fails, the effect
6616
6723
  * re-fails with the residual cause returned by the filter.
6617
6724
  *
6725
+ * The failure handler is skipped if the running fiber is interrupted in an
6726
+ * interruptible region.
6727
+ *
6618
6728
  * @see {@link catchCauseIf} for predicate-based cause selection
6619
6729
  * @see {@link catchFilter} for filtering typed error values instead of full causes
6620
6730
  * @see {@link catchCause} for recovering from every cause without filtering
@@ -7196,6 +7306,9 @@ export const tapErrorTag: {
7196
7306
  * the operation succeeds, the original cause is preserved. If the operation
7197
7307
  * fails, its error is also represented in the returned effect.
7198
7308
  *
7309
+ * The observer is skipped if the running fiber is interrupted in an
7310
+ * interruptible region.
7311
+ *
7199
7312
  * **Example** (Observing full failure causes)
7200
7313
  *
7201
7314
  * ```ts import.meta.vitest
@@ -7213,6 +7326,8 @@ export const tapErrorTag: {
7213
7326
  * output // => ["Logging cause: Something went wrong", Exit.fail("Something went wrong")]
7214
7327
  * ```
7215
7328
  *
7329
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7330
+ *
7216
7331
  * @stability stable
7217
7332
  * @category error handling
7218
7333
  * @since 4.0.0
@@ -7233,6 +7348,9 @@ export const tapCause: {
7233
7348
  * the operation succeeds, the original cause is preserved. If the operation
7234
7349
  * fails, its error is also represented in the returned effect.
7235
7350
  *
7351
+ * The observer is skipped if the running fiber is interrupted in an
7352
+ * interruptible region.
7353
+ *
7236
7354
  * **Example** (Observing full failure causes)
7237
7355
  *
7238
7356
  * ```ts import.meta.vitest
@@ -7250,6 +7368,8 @@ export const tapCause: {
7250
7368
  * output // => ["Logging cause: Something went wrong", Exit.fail("Something went wrong")]
7251
7369
  * ```
7252
7370
  *
7371
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7372
+ *
7253
7373
  * @stability stable
7254
7374
  * @category error handling
7255
7375
  * @since 4.0.0
@@ -7270,6 +7390,9 @@ export const tapCause: {
7270
7390
  * the operation succeeds, the original cause is preserved. If the operation
7271
7391
  * fails, its error is also represented in the returned effect.
7272
7392
  *
7393
+ * The observer is skipped if the running fiber is interrupted in an
7394
+ * interruptible region.
7395
+ *
7273
7396
  * **Example** (Observing full failure causes)
7274
7397
  *
7275
7398
  * ```ts import.meta.vitest
@@ -7287,6 +7410,8 @@ export const tapCause: {
7287
7410
  * output // => ["Logging cause: Something went wrong", Exit.fail("Something went wrong")]
7288
7411
  * ```
7289
7412
  *
7413
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7414
+ *
7290
7415
  * @stability stable
7291
7416
  * @category error handling
7292
7417
  * @since 4.0.0
@@ -7303,6 +7428,9 @@ export const tapCause: {
7303
7428
  * the cause matches a specific predicate. This is useful for conditional logging,
7304
7429
  * monitoring, or other side effects based on the type of failure.
7305
7430
  *
7431
+ * The observer is skipped if the running fiber is interrupted in an
7432
+ * interruptible region.
7433
+ *
7306
7434
  * **Example** (Observing selected failure causes)
7307
7435
  *
7308
7436
  * ```ts import.meta.vitest
@@ -7322,6 +7450,8 @@ export const tapCause: {
7322
7450
  * output // => ["Logging failure cause: Network timeout", Exit.fail("Network timeout")]
7323
7451
  * ```
7324
7452
  *
7453
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7454
+ *
7325
7455
  * @stability stable
7326
7456
  * @category error handling
7327
7457
  * @since 4.0.0
@@ -7336,6 +7466,9 @@ export const tapCauseIf: {
7336
7466
  * the cause matches a specific predicate. This is useful for conditional logging,
7337
7467
  * monitoring, or other side effects based on the type of failure.
7338
7468
  *
7469
+ * The observer is skipped if the running fiber is interrupted in an
7470
+ * interruptible region.
7471
+ *
7339
7472
  * **Example** (Observing selected failure causes)
7340
7473
  *
7341
7474
  * ```ts import.meta.vitest
@@ -7355,6 +7488,8 @@ export const tapCauseIf: {
7355
7488
  * output // => ["Logging failure cause: Network timeout", Exit.fail("Network timeout")]
7356
7489
  * ```
7357
7490
  *
7491
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7492
+ *
7358
7493
  * @stability stable
7359
7494
  * @category error handling
7360
7495
  * @since 4.0.0
@@ -7372,6 +7507,9 @@ export const tapCauseIf: {
7372
7507
  * the cause matches a specific predicate. This is useful for conditional logging,
7373
7508
  * monitoring, or other side effects based on the type of failure.
7374
7509
  *
7510
+ * The observer is skipped if the running fiber is interrupted in an
7511
+ * interruptible region.
7512
+ *
7375
7513
  * **Example** (Observing selected failure causes)
7376
7514
  *
7377
7515
  * ```ts import.meta.vitest
@@ -7391,6 +7529,8 @@ export const tapCauseIf: {
7391
7529
  * output // => ["Logging failure cause: Network timeout", Exit.fail("Network timeout")]
7392
7530
  * ```
7393
7531
  *
7532
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7533
+ *
7394
7534
  * @stability stable
7395
7535
  * @category error handling
7396
7536
  * @since 4.0.0
@@ -7417,6 +7557,10 @@ export const tapCauseIf: {
7417
7557
  * original cause. A failed filter result skips the side effect and preserves the
7418
7558
  * original cause.
7419
7559
  *
7560
+ * The observer is skipped if the running fiber is interrupted in an
7561
+ * interruptible region.
7562
+ *
7563
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7420
7564
  * @see {@link tapCauseIf} for selecting causes with a boolean predicate
7421
7565
  * @see {@link tapCause} for observing every failure cause
7422
7566
  * @see {@link catchCauseFilter} for recovering from selected causes instead of only observing them
@@ -7441,6 +7585,10 @@ export const tapCauseFilter: {
7441
7585
  * original cause. A failed filter result skips the side effect and preserves the
7442
7586
  * original cause.
7443
7587
  *
7588
+ * The observer is skipped if the running fiber is interrupted in an
7589
+ * interruptible region.
7590
+ *
7591
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7444
7592
  * @see {@link tapCauseIf} for selecting causes with a boolean predicate
7445
7593
  * @see {@link tapCause} for observing every failure cause
7446
7594
  * @see {@link catchCauseFilter} for recovering from selected causes instead of only observing them
@@ -7468,6 +7616,10 @@ export const tapCauseFilter: {
7468
7616
  * original cause. A failed filter result skips the side effect and preserves the
7469
7617
  * original cause.
7470
7618
  *
7619
+ * The observer is skipped if the running fiber is interrupted in an
7620
+ * interruptible region.
7621
+ *
7622
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
7471
7623
  * @see {@link tapCauseIf} for selecting causes with a boolean predicate
7472
7624
  * @see {@link tapCause} for observing every failure cause
7473
7625
  * @see {@link catchCauseFilter} for recovering from selected causes instead of only observing them
@@ -7699,6 +7851,8 @@ export declare namespace Retry {
7699
7851
  * succeeds, the returned effect succeeds with that value. If the policy stops
7700
7852
  * while the effect is still failing, the last failure is propagated.
7701
7853
  *
7854
+ * Scheduled delays use the context's `Clock`.
7855
+ *
7702
7856
  * **Gotchas**
7703
7857
  *
7704
7858
  * The source effect is always evaluated once before any retry policy is
@@ -7754,6 +7908,8 @@ export const retry: {
7754
7908
  * succeeds, the returned effect succeeds with that value. If the policy stops
7755
7909
  * while the effect is still failing, the last failure is propagated.
7756
7910
  *
7911
+ * Scheduled delays use the context's `Clock`.
7912
+ *
7757
7913
  * **Gotchas**
7758
7914
  *
7759
7915
  * The source effect is always evaluated once before any retry policy is
@@ -7809,6 +7965,8 @@ export const retry: {
7809
7965
  * succeeds, the returned effect succeeds with that value. If the policy stops
7810
7966
  * while the effect is still failing, the last failure is propagated.
7811
7967
  *
7968
+ * Scheduled delays use the context's `Clock`.
7969
+ *
7812
7970
  * **Gotchas**
7813
7971
  *
7814
7972
  * The source effect is always evaluated once before any retry policy is
@@ -7864,6 +8022,8 @@ export const retry: {
7864
8022
  * succeeds, the returned effect succeeds with that value. If the policy stops
7865
8023
  * while the effect is still failing, the last failure is propagated.
7866
8024
  *
8025
+ * Scheduled delays use the context's `Clock`.
8026
+ *
7867
8027
  * **Gotchas**
7868
8028
  *
7869
8029
  * The source effect is always evaluated once before any retry policy is
@@ -7923,6 +8083,8 @@ export const retry: {
7923
8083
  * succeeds, the returned effect succeeds with that value. If the policy stops
7924
8084
  * while the effect is still failing, the last failure is propagated.
7925
8085
  *
8086
+ * Scheduled delays use the context's `Clock`.
8087
+ *
7926
8088
  * **Gotchas**
7927
8089
  *
7928
8090
  * The source effect is always evaluated once before any retry policy is
@@ -7978,6 +8140,8 @@ export const retry: {
7978
8140
  * succeeds, the returned effect succeeds with that value. If the policy stops
7979
8141
  * while the effect is still failing, the last failure is propagated.
7980
8142
  *
8143
+ * Scheduled delays use the context's `Clock`.
8144
+ *
7981
8145
  * **Gotchas**
7982
8146
  *
7983
8147
  * The source effect is always evaluated once before any retry policy is
@@ -8033,6 +8197,8 @@ export const retry: {
8033
8197
  * succeeds, the returned effect succeeds with that value. If the policy stops
8034
8198
  * while the effect is still failing, the last failure is propagated.
8035
8199
  *
8200
+ * Scheduled delays use the context's `Clock`.
8201
+ *
8036
8202
  * **Gotchas**
8037
8203
  *
8038
8204
  * The source effect is always evaluated once before any retry policy is
@@ -8096,6 +8262,8 @@ export const retry: {
8096
8262
  * If the retries are exhausted and the effect still fails, it runs a fallback
8097
8263
  * effect instead.
8098
8264
  *
8265
+ * Scheduled delays use the context's `Clock`.
8266
+ *
8099
8267
  * **Gotchas**
8100
8268
  *
8101
8269
  * Defects take precedence over typed errors. A failure whose cause contains a
@@ -8159,6 +8327,8 @@ export const retryOrElse: {
8159
8327
  * If the retries are exhausted and the effect still fails, it runs a fallback
8160
8328
  * effect instead.
8161
8329
  *
8330
+ * Scheduled delays use the context's `Clock`.
8331
+ *
8162
8332
  * **Gotchas**
8163
8333
  *
8164
8334
  * Defects take precedence over typed errors. A failure whose cause contains a
@@ -8225,6 +8395,8 @@ export const retryOrElse: {
8225
8395
  * If the retries are exhausted and the effect still fails, it runs a fallback
8226
8396
  * effect instead.
8227
8397
  *
8398
+ * Scheduled delays use the context's `Clock`.
8399
+ *
8228
8400
  * **Gotchas**
8229
8401
  *
8230
8402
  * Defects take precedence over typed errors. A failure whose cause contains a
@@ -8287,6 +8459,9 @@ export const retryOrElse: {
8287
8459
  * failures, defects, and interruptions. Use `Effect.catch(Effect.failCause)` to
8288
8460
  * restore the original typed error channel after cause-level handling.
8289
8461
  *
8462
+ * Interrupting the running fiber in an interruptible region bypasses the
8463
+ * error channel.
8464
+ *
8290
8465
  * **Example** (Exposing failures as causes)
8291
8466
  *
8292
8467
  * ```ts import.meta.vitest
@@ -8303,6 +8478,8 @@ export const retryOrElse: {
8303
8478
  * Effect.runSync(program) // => "Caught cause: Something went wrong"
8304
8479
  * ```
8305
8480
  *
8481
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
8482
+ *
8306
8483
  * @stability stable
8307
8484
  * @category error handling
8308
8485
  * @since 2.0.0
@@ -8905,13 +9082,24 @@ export const firstSuccessOf: <Eff extends Effect<any, any, any>>(
8905
9082
  *
8906
9083
  * The `timeout` function allows you to specify a time limit for an
8907
9084
  * effect's execution. If the effect does not complete within the given time, a
8908
- * `TimeoutError` is raised. This can be useful for controlling how long your
8909
- * program waits for a task to finish, ensuring that it doesn't hang
8910
- * indefinitely if the task takes too long.
9085
+ * `TimeoutError` is raised after the source fiber finishes its cleanup.
9086
+ *
9087
+ * Any contender the timeout starts (source or timer) is initially
9088
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9089
+ * timer uses the context's `Clock`.
8911
9090
  *
8912
9091
  * **Gotchas**
8913
9092
  *
8914
- * If the timeout wins, the source effect is interrupted.
9093
+ * If the timeout wins, the source is interrupted and the returned effect waits
9094
+ * for the source fiber to finish, including its finalizers. The duration
9095
+ * determines when interruption is requested, not a deadline for completion.
9096
+ * If the source enters its own uninterruptible region, completion can be
9097
+ * delayed until that region finishes. The eventual source result is
9098
+ * discarded and the timeout failure is still returned.
9099
+ *
9100
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9101
+ * can keep running unless the operation honors cancellation. Fibers started
9102
+ * with `forkDetach` are not awaited.
8915
9103
  *
8916
9104
  * **Example** (Failing when work takes too long)
8917
9105
  *
@@ -8948,13 +9136,24 @@ export const timeout: {
8948
9136
  *
8949
9137
  * The `timeout` function allows you to specify a time limit for an
8950
9138
  * effect's execution. If the effect does not complete within the given time, a
8951
- * `TimeoutError` is raised. This can be useful for controlling how long your
8952
- * program waits for a task to finish, ensuring that it doesn't hang
8953
- * indefinitely if the task takes too long.
9139
+ * `TimeoutError` is raised after the source fiber finishes its cleanup.
9140
+ *
9141
+ * Any contender the timeout starts (source or timer) is initially
9142
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9143
+ * timer uses the context's `Clock`.
8954
9144
  *
8955
9145
  * **Gotchas**
8956
9146
  *
8957
- * If the timeout wins, the source effect is interrupted.
9147
+ * If the timeout wins, the source is interrupted and the returned effect waits
9148
+ * for the source fiber to finish, including its finalizers. The duration
9149
+ * determines when interruption is requested, not a deadline for completion.
9150
+ * If the source enters its own uninterruptible region, completion can be
9151
+ * delayed until that region finishes. The eventual source result is
9152
+ * discarded and the timeout failure is still returned.
9153
+ *
9154
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9155
+ * can keep running unless the operation honors cancellation. Fibers started
9156
+ * with `forkDetach` are not awaited.
8958
9157
  *
8959
9158
  * **Example** (Failing when work takes too long)
8960
9159
  *
@@ -8991,13 +9190,24 @@ export const timeout: {
8991
9190
  *
8992
9191
  * The `timeout` function allows you to specify a time limit for an
8993
9192
  * effect's execution. If the effect does not complete within the given time, a
8994
- * `TimeoutError` is raised. This can be useful for controlling how long your
8995
- * program waits for a task to finish, ensuring that it doesn't hang
8996
- * indefinitely if the task takes too long.
9193
+ * `TimeoutError` is raised after the source fiber finishes its cleanup.
9194
+ *
9195
+ * Any contender the timeout starts (source or timer) is initially
9196
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9197
+ * timer uses the context's `Clock`.
8997
9198
  *
8998
9199
  * **Gotchas**
8999
9200
  *
9000
- * If the timeout wins, the source effect is interrupted.
9201
+ * If the timeout wins, the source is interrupted and the returned effect waits
9202
+ * for the source fiber to finish, including its finalizers. The duration
9203
+ * determines when interruption is requested, not a deadline for completion.
9204
+ * If the source enters its own uninterruptible region, completion can be
9205
+ * delayed until that region finishes. The eventual source result is
9206
+ * discarded and the timeout failure is still returned.
9207
+ *
9208
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9209
+ * can keep running unless the operation honors cancellation. Fibers started
9210
+ * with `forkDetach` are not awaited.
9001
9211
  *
9002
9212
  * **Example** (Failing when work takes too long)
9003
9213
  *
@@ -9034,6 +9244,23 @@ export const timeout: {
9034
9244
  * interrupted and the returned effect succeeds with `Option.none`. If the
9035
9245
  * source effect fails before the timeout, that failure is preserved.
9036
9246
  *
9247
+ * Any contender the timeout starts (source or timer) is initially
9248
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9249
+ * timer uses the context's `Clock`.
9250
+ *
9251
+ * **Gotchas**
9252
+ *
9253
+ * If the timeout wins, the source is interrupted and the returned effect waits
9254
+ * for the source fiber to finish, including its finalizers. The duration
9255
+ * determines when interruption is requested, not a deadline for completion.
9256
+ * If the source enters its own uninterruptible region, completion can be
9257
+ * delayed until that region finishes. The eventual source result is
9258
+ * discarded and the timeout still produces `Option.none`.
9259
+ *
9260
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9261
+ * can keep running unless the operation honors cancellation. Fibers started
9262
+ * with `forkDetach` are not awaited.
9263
+ *
9037
9264
  * **Example** (Returning None on timeout)
9038
9265
  *
9039
9266
  * ```ts import.meta.vitest
@@ -9066,6 +9293,23 @@ export const timeoutOption: {
9066
9293
  * interrupted and the returned effect succeeds with `Option.none`. If the
9067
9294
  * source effect fails before the timeout, that failure is preserved.
9068
9295
  *
9296
+ * Any contender the timeout starts (source or timer) is initially
9297
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9298
+ * timer uses the context's `Clock`.
9299
+ *
9300
+ * **Gotchas**
9301
+ *
9302
+ * If the timeout wins, the source is interrupted and the returned effect waits
9303
+ * for the source fiber to finish, including its finalizers. The duration
9304
+ * determines when interruption is requested, not a deadline for completion.
9305
+ * If the source enters its own uninterruptible region, completion can be
9306
+ * delayed until that region finishes. The eventual source result is
9307
+ * discarded and the timeout still produces `Option.none`.
9308
+ *
9309
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9310
+ * can keep running unless the operation honors cancellation. Fibers started
9311
+ * with `forkDetach` are not awaited.
9312
+ *
9069
9313
  * **Example** (Returning None on timeout)
9070
9314
  *
9071
9315
  * ```ts import.meta.vitest
@@ -9098,6 +9342,23 @@ export const timeoutOption: {
9098
9342
  * interrupted and the returned effect succeeds with `Option.none`. If the
9099
9343
  * source effect fails before the timeout, that failure is preserved.
9100
9344
  *
9345
+ * Any contender the timeout starts (source or timer) is initially
9346
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9347
+ * timer uses the context's `Clock`.
9348
+ *
9349
+ * **Gotchas**
9350
+ *
9351
+ * If the timeout wins, the source is interrupted and the returned effect waits
9352
+ * for the source fiber to finish, including its finalizers. The duration
9353
+ * determines when interruption is requested, not a deadline for completion.
9354
+ * If the source enters its own uninterruptible region, completion can be
9355
+ * delayed until that region finishes. The eventual source result is
9356
+ * discarded and the timeout still produces `Option.none`.
9357
+ *
9358
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9359
+ * can keep running unless the operation honors cancellation. Fibers started
9360
+ * with `forkDetach` are not awaited.
9361
+ *
9101
9362
  * **Example** (Returning None on timeout)
9102
9363
  *
9103
9364
  * ```ts import.meta.vitest
@@ -9119,7 +9380,26 @@ export const timeoutOption: {
9119
9380
 
9120
9381
  /**
9121
9382
  * Applies a timeout to an effect, lazily evaluating `orElse` after interrupting
9122
- * the source if the timeout is reached.
9383
+ * the source and waiting for its cleanup if the timeout is reached.
9384
+ *
9385
+ * **Details**
9386
+ *
9387
+ * Any contender the timeout starts (source or timer) is initially
9388
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9389
+ * timer uses the context's `Clock`.
9390
+ *
9391
+ * **Gotchas**
9392
+ *
9393
+ * If the timeout wins, the source is interrupted and the returned effect waits
9394
+ * for the source fiber to finish, including its finalizers. The duration
9395
+ * determines when interruption is requested, not a deadline for completion.
9396
+ * If the source enters its own uninterruptible region, completion can be
9397
+ * delayed until that region finishes. The eventual source result is
9398
+ * discarded and the timeout still selects `orElse`.
9399
+ *
9400
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9401
+ * can keep running unless the operation honors cancellation. Fibers started
9402
+ * with `forkDetach` are not awaited.
9123
9403
  *
9124
9404
  * **Example** (Falling back on timeout)
9125
9405
  *
@@ -9148,7 +9428,26 @@ export const timeoutOption: {
9148
9428
  export const timeoutOrElse: {
9149
9429
  /**
9150
9430
  * Applies a timeout to an effect, lazily evaluating `orElse` after interrupting
9151
- * the source if the timeout is reached.
9431
+ * the source and waiting for its cleanup if the timeout is reached.
9432
+ *
9433
+ * **Details**
9434
+ *
9435
+ * Any contender the timeout starts (source or timer) is initially
9436
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9437
+ * timer uses the context's `Clock`.
9438
+ *
9439
+ * **Gotchas**
9440
+ *
9441
+ * If the timeout wins, the source is interrupted and the returned effect waits
9442
+ * for the source fiber to finish, including its finalizers. The duration
9443
+ * determines when interruption is requested, not a deadline for completion.
9444
+ * If the source enters its own uninterruptible region, completion can be
9445
+ * delayed until that region finishes. The eventual source result is
9446
+ * discarded and the timeout still selects `orElse`.
9447
+ *
9448
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9449
+ * can keep running unless the operation honors cancellation. Fibers started
9450
+ * with `forkDetach` are not awaited.
9152
9451
  *
9153
9452
  * **Example** (Falling back on timeout)
9154
9453
  *
@@ -9182,7 +9481,26 @@ export const timeoutOrElse: {
9182
9481
  ): <A, E, R>(self: Effect<A, E, R>) => Effect<A | A2, E | E2, R | R2>
9183
9482
  /**
9184
9483
  * Applies a timeout to an effect, lazily evaluating `orElse` after interrupting
9185
- * the source if the timeout is reached.
9484
+ * the source and waiting for its cleanup if the timeout is reached.
9485
+ *
9486
+ * **Details**
9487
+ *
9488
+ * Any contender the timeout starts (source or timer) is initially
9489
+ * interruptible, even when the timeout runs in an uninterruptible region. The
9490
+ * timer uses the context's `Clock`.
9491
+ *
9492
+ * **Gotchas**
9493
+ *
9494
+ * If the timeout wins, the source is interrupted and the returned effect waits
9495
+ * for the source fiber to finish, including its finalizers. The duration
9496
+ * determines when interruption is requested, not a deadline for completion.
9497
+ * If the source enters its own uninterruptible region, completion can be
9498
+ * delayed until that region finishes. The eventual source result is
9499
+ * discarded and the timeout still selects `orElse`.
9500
+ *
9501
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9502
+ * can keep running unless the operation honors cancellation. Fibers started
9503
+ * with `forkDetach` are not awaited.
9186
9504
  *
9187
9505
  * **Example** (Falling back on timeout)
9188
9506
  *
@@ -9218,8 +9536,8 @@ export const timeoutOrElse: {
9218
9536
  } = internal.timeoutOrElse
9219
9537
 
9220
9538
  /**
9221
- * Returns an effect that is delayed from this effect by the specified
9222
- * `Duration`.
9539
+ * Delays the start of an effect by the specified duration using the context's
9540
+ * `Clock`.
9223
9541
  *
9224
9542
  * **Example** (Delaying an effect)
9225
9543
  *
@@ -9233,14 +9551,15 @@ export const timeoutOrElse: {
9233
9551
  * output // => ["Delayed message"]
9234
9552
  * ```
9235
9553
  *
9554
+ * @see {@link sleep} for waiting with the current clock
9236
9555
  * @stability stable
9237
9556
  * @category delays & timeouts
9238
9557
  * @since 2.0.0
9239
9558
  */
9240
9559
  export const delay: {
9241
9560
  /**
9242
- * Returns an effect that is delayed from this effect by the specified
9243
- * `Duration`.
9561
+ * Delays the start of an effect by the specified duration using the context's
9562
+ * `Clock`.
9244
9563
  *
9245
9564
  * **Example** (Delaying an effect)
9246
9565
  *
@@ -9254,14 +9573,15 @@ export const delay: {
9254
9573
  * output // => ["Delayed message"]
9255
9574
  * ```
9256
9575
  *
9576
+ * @see {@link sleep} for waiting with the current clock
9257
9577
  * @stability stable
9258
9578
  * @category delays & timeouts
9259
9579
  * @since 2.0.0
9260
9580
  */
9261
9581
  (duration: Duration.Input): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R>
9262
9582
  /**
9263
- * Returns an effect that is delayed from this effect by the specified
9264
- * `Duration`.
9583
+ * Delays the start of an effect by the specified duration using the context's
9584
+ * `Clock`.
9265
9585
  *
9266
9586
  * **Example** (Delaying an effect)
9267
9587
  *
@@ -9275,6 +9595,7 @@ export const delay: {
9275
9595
  * output // => ["Delayed message"]
9276
9596
  * ```
9277
9597
  *
9598
+ * @see {@link sleep} for waiting with the current clock
9278
9599
  * @stability stable
9279
9600
  * @category delays & timeouts
9280
9601
  * @since 2.0.0
@@ -9284,7 +9605,7 @@ export const delay: {
9284
9605
 
9285
9606
  /**
9286
9607
  * Returns an effect that suspends the current fiber for the specified duration
9287
- * without blocking a JavaScript thread.
9608
+ * using the context's `Clock`, without blocking a JavaScript thread.
9288
9609
  *
9289
9610
  * **Example** (Pausing without blocking)
9290
9611
  *
@@ -9351,9 +9672,24 @@ export const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration: Durati
9351
9672
  * **Details**
9352
9673
  *
9353
9674
  * Early failures do not finish the race; `raceAll` keeps waiting until one
9354
- * effect succeeds or every effect has failed. When one effect succeeds, the
9355
- * remaining effects are interrupted. If every effect fails, the returned effect
9356
- * fails with a cause containing the collected failure reasons.
9675
+ * effect succeeds or every effect has failed. If one succeeds, any
9676
+ * still-running contenders are interrupted. If every effect fails, the
9677
+ * returned effect fails with a cause containing the collected failure reasons.
9678
+ *
9679
+ * Any contender the race starts is initially interruptible, even when the race
9680
+ * runs in an uninterruptible region.
9681
+ *
9682
+ * The returned effect completes only after the interrupted participants have
9683
+ * finished, including their finalizers.
9684
+ *
9685
+ * **Gotchas**
9686
+ *
9687
+ * If a losing effect enters its own uninterruptible region, the race waits
9688
+ * for that region to finish. The losing result is discarded.
9689
+ *
9690
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9691
+ * can keep running unless the operation honors cancellation. Fibers started
9692
+ * with `forkDetach` are not awaited.
9357
9693
  *
9358
9694
  * **Example** (Racing many effects)
9359
9695
  *
@@ -9389,9 +9725,24 @@ export const raceAll: <Eff extends Effect<any, any, any>>(
9389
9725
  *
9390
9726
  * **Details**
9391
9727
  *
9392
- * After the first effect completes, all remaining effects are interrupted. Use
9393
- * `raceAll` when early failures should be ignored until a success occurs or
9394
- * all effects fail.
9728
+ * The race requests interruption of any still-running losers. Use `raceAll`
9729
+ * when early failures should be ignored until a success occurs or all effects
9730
+ * fail.
9731
+ *
9732
+ * Any contender the race starts is initially interruptible, even when the race
9733
+ * runs in an uninterruptible region.
9734
+ *
9735
+ * The returned effect completes only after the interrupted participants have
9736
+ * finished, including their finalizers.
9737
+ *
9738
+ * **Gotchas**
9739
+ *
9740
+ * If a losing effect enters its own uninterruptible region, the race waits
9741
+ * for that region to finish. The losing result is discarded.
9742
+ *
9743
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9744
+ * can keep running unless the operation honors cancellation. Fibers started
9745
+ * with `forkDetach` are not awaited.
9395
9746
  *
9396
9747
  * **Example** (Taking the first settled result)
9397
9748
  *
@@ -9425,8 +9776,23 @@ export const raceAllFirst: <Eff extends Effect<any, any, any>>(
9425
9776
  *
9426
9777
  * **Details**
9427
9778
  *
9428
- * If one effect succeeds, the other is interrupted and `onWinner` can observe the
9429
- * winning fiber. If both fail, the race fails.
9779
+ * If one effect succeeds, `onWinner` can observe the winning fiber. The other
9780
+ * effect is interrupted if it is still running. If both fail, the race fails.
9781
+ *
9782
+ * Any contender the race starts is initially interruptible, even when the race
9783
+ * runs in an uninterruptible region.
9784
+ *
9785
+ * The returned effect completes only after the interrupted participants have
9786
+ * finished, including their finalizers.
9787
+ *
9788
+ * **Gotchas**
9789
+ *
9790
+ * If a losing effect enters its own uninterruptible region, the race waits
9791
+ * for that region to finish. The losing result is discarded.
9792
+ *
9793
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9794
+ * can keep running unless the operation honors cancellation. Fibers started
9795
+ * with `forkDetach` are not awaited.
9430
9796
  *
9431
9797
  * **Example** (Racing two effects)
9432
9798
  *
@@ -9456,8 +9822,23 @@ export const race: {
9456
9822
  *
9457
9823
  * **Details**
9458
9824
  *
9459
- * If one effect succeeds, the other is interrupted and `onWinner` can observe the
9460
- * winning fiber. If both fail, the race fails.
9825
+ * If one effect succeeds, `onWinner` can observe the winning fiber. The other
9826
+ * effect is interrupted if it is still running. If both fail, the race fails.
9827
+ *
9828
+ * Any contender the race starts is initially interruptible, even when the race
9829
+ * runs in an uninterruptible region.
9830
+ *
9831
+ * The returned effect completes only after the interrupted participants have
9832
+ * finished, including their finalizers.
9833
+ *
9834
+ * **Gotchas**
9835
+ *
9836
+ * If a losing effect enters its own uninterruptible region, the race waits
9837
+ * for that region to finish. The losing result is discarded.
9838
+ *
9839
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9840
+ * can keep running unless the operation honors cancellation. Fibers started
9841
+ * with `forkDetach` are not awaited.
9461
9842
  *
9462
9843
  * **Example** (Racing two effects)
9463
9844
  *
@@ -9494,8 +9875,23 @@ export const race: {
9494
9875
  *
9495
9876
  * **Details**
9496
9877
  *
9497
- * If one effect succeeds, the other is interrupted and `onWinner` can observe the
9498
- * winning fiber. If both fail, the race fails.
9878
+ * If one effect succeeds, `onWinner` can observe the winning fiber. The other
9879
+ * effect is interrupted if it is still running. If both fail, the race fails.
9880
+ *
9881
+ * Any contender the race starts is initially interruptible, even when the race
9882
+ * runs in an uninterruptible region.
9883
+ *
9884
+ * The returned effect completes only after the interrupted participants have
9885
+ * finished, including their finalizers.
9886
+ *
9887
+ * **Gotchas**
9888
+ *
9889
+ * If a losing effect enters its own uninterruptible region, the race waits
9890
+ * for that region to finish. The losing result is discarded.
9891
+ *
9892
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9893
+ * can keep running unless the operation honors cancellation. Fibers started
9894
+ * with `forkDetach` are not awaited.
9499
9895
  *
9500
9896
  * **Example** (Racing two effects)
9501
9897
  *
@@ -9536,12 +9932,27 @@ export const race: {
9536
9932
  *
9537
9933
  * **When to use**
9538
9934
  *
9539
- * Use when any completion, including failure, should decide the race and
9540
- * interrupt the losing effect.
9935
+ * Use when any completion, including failure, should decide the race.
9541
9936
  *
9542
9937
  * **Details**
9543
9938
  *
9544
- * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
9939
+ * The losing effect is interrupted if it is still running. `onWinner` can
9940
+ * observe the winning fiber.
9941
+ *
9942
+ * Any contender the race starts is initially interruptible, even when the race
9943
+ * runs in an uninterruptible region.
9944
+ *
9945
+ * The returned effect completes only after the interrupted participants have
9946
+ * finished, including their finalizers.
9947
+ *
9948
+ * **Gotchas**
9949
+ *
9950
+ * If a losing effect enters its own uninterruptible region, the race waits
9951
+ * for that region to finish. The losing result is discarded.
9952
+ *
9953
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
9954
+ * can keep running unless the operation honors cancellation. Fibers started
9955
+ * with `forkDetach` are not awaited.
9545
9956
  *
9546
9957
  * **Example** (Observing the winning fiber)
9547
9958
  *
@@ -9575,12 +9986,27 @@ export const raceFirst: {
9575
9986
  *
9576
9987
  * **When to use**
9577
9988
  *
9578
- * Use when any completion, including failure, should decide the race and
9579
- * interrupt the losing effect.
9989
+ * Use when any completion, including failure, should decide the race.
9580
9990
  *
9581
9991
  * **Details**
9582
9992
  *
9583
- * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
9993
+ * The losing effect is interrupted if it is still running. `onWinner` can
9994
+ * observe the winning fiber.
9995
+ *
9996
+ * Any contender the race starts is initially interruptible, even when the race
9997
+ * runs in an uninterruptible region.
9998
+ *
9999
+ * The returned effect completes only after the interrupted participants have
10000
+ * finished, including their finalizers.
10001
+ *
10002
+ * **Gotchas**
10003
+ *
10004
+ * If a losing effect enters its own uninterruptible region, the race waits
10005
+ * for that region to finish. The losing result is discarded.
10006
+ *
10007
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
10008
+ * can keep running unless the operation honors cancellation. Fibers started
10009
+ * with `forkDetach` are not awaited.
9584
10010
  *
9585
10011
  * **Example** (Observing the winning fiber)
9586
10012
  *
@@ -9621,12 +10047,27 @@ export const raceFirst: {
9621
10047
  *
9622
10048
  * **When to use**
9623
10049
  *
9624
- * Use when any completion, including failure, should decide the race and
9625
- * interrupt the losing effect.
10050
+ * Use when any completion, including failure, should decide the race.
9626
10051
  *
9627
10052
  * **Details**
9628
10053
  *
9629
- * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
10054
+ * The losing effect is interrupted if it is still running. `onWinner` can
10055
+ * observe the winning fiber.
10056
+ *
10057
+ * Any contender the race starts is initially interruptible, even when the race
10058
+ * runs in an uninterruptible region.
10059
+ *
10060
+ * The returned effect completes only after the interrupted participants have
10061
+ * finished, including their finalizers.
10062
+ *
10063
+ * **Gotchas**
10064
+ *
10065
+ * If a losing effect enters its own uninterruptible region, the race waits
10066
+ * for that region to finish. The losing result is discarded.
10067
+ *
10068
+ * Waiting for fiber cleanup does not ensure external work stops: a Promise
10069
+ * can keep running unless the operation honors cancellation. Fibers started
10070
+ * with `forkDetach` are not awaited.
9630
10071
  *
9631
10072
  * **Example** (Observing the winning fiber)
9632
10073
  *
@@ -11230,6 +11671,9 @@ export const matchEager: {
11230
11671
  * The `matchCause` function allows you to handle failures with access to the
11231
11672
  * full cause of the failure within a fiber.
11232
11673
  *
11674
+ * The failure handler is skipped if the running fiber is interrupted in an
11675
+ * interruptible region.
11676
+ *
11233
11677
  * **Example** (Matching on success or failure causes)
11234
11678
  *
11235
11679
  * ```ts import.meta.vitest
@@ -11245,6 +11689,7 @@ export const matchEager: {
11245
11689
  * Effect.runSync(program) // => "Failed: Something went wrong"
11246
11690
  * ```
11247
11691
  *
11692
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11248
11693
  * @see {@link matchCauseEffect} if you need to perform side effects in the
11249
11694
  * handlers.
11250
11695
  * @see {@link match} if you don't need to handle the cause of the failure.
@@ -11266,6 +11711,9 @@ export const matchCause: {
11266
11711
  * The `matchCause` function allows you to handle failures with access to the
11267
11712
  * full cause of the failure within a fiber.
11268
11713
  *
11714
+ * The failure handler is skipped if the running fiber is interrupted in an
11715
+ * interruptible region.
11716
+ *
11269
11717
  * **Example** (Matching on success or failure causes)
11270
11718
  *
11271
11719
  * ```ts import.meta.vitest
@@ -11281,6 +11729,7 @@ export const matchCause: {
11281
11729
  * Effect.runSync(program) // => "Failed: Something went wrong"
11282
11730
  * ```
11283
11731
  *
11732
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11284
11733
  * @see {@link matchCauseEffect} if you need to perform side effects in the
11285
11734
  * handlers.
11286
11735
  * @see {@link match} if you don't need to handle the cause of the failure.
@@ -11307,6 +11756,9 @@ export const matchCause: {
11307
11756
  * The `matchCause` function allows you to handle failures with access to the
11308
11757
  * full cause of the failure within a fiber.
11309
11758
  *
11759
+ * The failure handler is skipped if the running fiber is interrupted in an
11760
+ * interruptible region.
11761
+ *
11310
11762
  * **Example** (Matching on success or failure causes)
11311
11763
  *
11312
11764
  * ```ts import.meta.vitest
@@ -11322,6 +11774,7 @@ export const matchCause: {
11322
11774
  * Effect.runSync(program) // => "Failed: Something went wrong"
11323
11775
  * ```
11324
11776
  *
11777
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11325
11778
  * @see {@link matchCauseEffect} if you need to perform side effects in the
11326
11779
  * handlers.
11327
11780
  * @see {@link match} if you don't need to handle the cause of the failure.
@@ -11352,6 +11805,9 @@ export const matchCause: {
11352
11805
  * effects by immediately applying the matching function instead of deferring it
11353
11806
  * through the effect pipeline.
11354
11807
  *
11808
+ * Unless the effect is already an `Exit`, the failure handler is skipped if
11809
+ * the running fiber is interrupted in an interruptible region.
11810
+ *
11355
11811
  * **Example** (Eagerly matching already completed effects)
11356
11812
  *
11357
11813
  * ```ts import.meta.vitest
@@ -11364,6 +11820,8 @@ export const matchCause: {
11364
11820
  * Effect.runSync(handleResult) // => "Success: 42"
11365
11821
  * ```
11366
11822
  *
11823
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11824
+ *
11367
11825
  * @stability stable
11368
11826
  * @category pattern matching
11369
11827
  * @since 4.0.0
@@ -11383,6 +11841,9 @@ export const matchCauseEager: {
11383
11841
  * effects by immediately applying the matching function instead of deferring it
11384
11842
  * through the effect pipeline.
11385
11843
  *
11844
+ * Unless the effect is already an `Exit`, the failure handler is skipped if
11845
+ * the running fiber is interrupted in an interruptible region.
11846
+ *
11386
11847
  * **Example** (Eagerly matching already completed effects)
11387
11848
  *
11388
11849
  * ```ts import.meta.vitest
@@ -11395,6 +11856,8 @@ export const matchCauseEager: {
11395
11856
  * Effect.runSync(handleResult) // => "Success: 42"
11396
11857
  * ```
11397
11858
  *
11859
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11860
+ *
11398
11861
  * @stability stable
11399
11862
  * @category pattern matching
11400
11863
  * @since 4.0.0
@@ -11419,6 +11882,9 @@ export const matchCauseEager: {
11419
11882
  * effects by immediately applying the matching function instead of deferring it
11420
11883
  * through the effect pipeline.
11421
11884
  *
11885
+ * Unless the effect is already an `Exit`, the failure handler is skipped if
11886
+ * the running fiber is interrupted in an interruptible region.
11887
+ *
11422
11888
  * **Example** (Eagerly matching already completed effects)
11423
11889
  *
11424
11890
  * ```ts import.meta.vitest
@@ -11431,6 +11897,8 @@ export const matchCauseEager: {
11431
11897
  * Effect.runSync(handleResult) // => "Success: 42"
11432
11898
  * ```
11433
11899
  *
11900
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11901
+ *
11434
11902
  * @stability stable
11435
11903
  * @category pattern matching
11436
11904
  * @since 4.0.0
@@ -11457,6 +11925,10 @@ export const matchCauseEager: {
11457
11925
  * If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
11458
11926
  * {@link matchCauseEffect}.
11459
11927
  *
11928
+ * Unless the effect is already an `Exit`, the failure handler is skipped if
11929
+ * the running fiber is interrupted in an interruptible region.
11930
+ *
11931
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11460
11932
  * @see {@link matchCauseEffect} for the non-eager effectful variant
11461
11933
  * @see {@link matchCauseEager} for eager cause matching with pure handlers
11462
11934
  * @see {@link matchEffect} for effectful matching on typed failures instead of full causes
@@ -11479,6 +11951,10 @@ export const matchCauseEffectEager: {
11479
11951
  * If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
11480
11952
  * {@link matchCauseEffect}.
11481
11953
  *
11954
+ * Unless the effect is already an `Exit`, the failure handler is skipped if
11955
+ * the running fiber is interrupted in an interruptible region.
11956
+ *
11957
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11482
11958
  * @see {@link matchCauseEffect} for the non-eager effectful variant
11483
11959
  * @see {@link matchCauseEager} for eager cause matching with pure handlers
11484
11960
  * @see {@link matchEffect} for effectful matching on typed failures instead of full causes
@@ -11506,6 +11982,10 @@ export const matchCauseEffectEager: {
11506
11982
  * If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
11507
11983
  * {@link matchCauseEffect}.
11508
11984
  *
11985
+ * Unless the effect is already an `Exit`, the failure handler is skipped if
11986
+ * the running fiber is interrupted in an interruptible region.
11987
+ *
11988
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11509
11989
  * @see {@link matchCauseEffect} for the non-eager effectful variant
11510
11990
  * @see {@link matchCauseEager} for eager cause matching with pure handlers
11511
11991
  * @see {@link matchEffect} for effectful matching on typed failures instead of full causes
@@ -11540,6 +12020,9 @@ export const matchCauseEffectEager: {
11540
12020
  * you to respond accordingly while performing side effects (like logging or
11541
12021
  * other operations).
11542
12022
  *
12023
+ * The failure handler is skipped if the running fiber is interrupted in an
12024
+ * interruptible region.
12025
+ *
11543
12026
  * **Example** (Effectfully matching on causes)
11544
12027
  *
11545
12028
  * ```ts import.meta.vitest
@@ -11575,6 +12058,7 @@ export const matchCauseEffectEager: {
11575
12058
  * output // => ["Handling error: Task failed", "recovered from error"]
11576
12059
  * ```
11577
12060
  *
12061
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11578
12062
  * @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.
11579
12063
  * @see {@link matchEffect} if you don't need to handle the cause of the failure.
11580
12064
  *
@@ -11600,6 +12084,9 @@ export const matchCauseEffect: {
11600
12084
  * you to respond accordingly while performing side effects (like logging or
11601
12085
  * other operations).
11602
12086
  *
12087
+ * The failure handler is skipped if the running fiber is interrupted in an
12088
+ * interruptible region.
12089
+ *
11603
12090
  * **Example** (Effectfully matching on causes)
11604
12091
  *
11605
12092
  * ```ts import.meta.vitest
@@ -11635,6 +12122,7 @@ export const matchCauseEffect: {
11635
12122
  * output // => ["Handling error: Task failed", "recovered from error"]
11636
12123
  * ```
11637
12124
  *
12125
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11638
12126
  * @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.
11639
12127
  * @see {@link matchEffect} if you don't need to handle the cause of the failure.
11640
12128
  *
@@ -11665,6 +12153,9 @@ export const matchCauseEffect: {
11665
12153
  * you to respond accordingly while performing side effects (like logging or
11666
12154
  * other operations).
11667
12155
  *
12156
+ * The failure handler is skipped if the running fiber is interrupted in an
12157
+ * interruptible region.
12158
+ *
11668
12159
  * **Example** (Effectfully matching on causes)
11669
12160
  *
11670
12161
  * ```ts import.meta.vitest
@@ -11700,6 +12191,7 @@ export const matchCauseEffect: {
11700
12191
  * output // => ["Handling error: Task failed", "recovered from error"]
11701
12192
  * ```
11702
12193
  *
12194
+ * @see {@link catchCause} for fiber interruption versus interruption in a cause
11703
12195
  * @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.
11704
12196
  * @see {@link matchEffect} if you don't need to handle the cause of the failure.
11705
12197
  *
@@ -13547,9 +14039,10 @@ export const scopedWith: <A, E, R>(
13547
14039
  *
13548
14040
  * **Details**
13549
14041
  *
13550
- * If acquisition succeeds, the release finalizer is added to the current scope
13551
- * and is guaranteed to run when that scope closes. The finalizer receives the
13552
- * `Exit` value used to close the scope.
14042
+ * After successful acquisition, release is registered on the scope. If the
14043
+ * scope is open, `Scope.close` runs it according to the scope's finalizer
14044
+ * strategy and passes it the closing `Exit`. If the scope is already closed,
14045
+ * release runs immediately with that `Exit`.
13553
14046
  *
13554
14047
  * By default, acquisition is protected by an uninterruptible region. Pass
13555
14048
  * `{ interruptible: true }` to allow the acquisition effect to be interrupted.
@@ -13680,8 +14173,12 @@ export const acquireDisposable: <A extends AsyncDisposable | Disposable, E, R>(
13680
14173
  * and will be executed as long as the acquisition `Effect` value
13681
14174
  * successfully acquires the resource.
13682
14175
  *
13683
- * During the time period between the acquisition and release of the resource,
13684
- * the `use` `Effect` value will be executed.
14176
+ * `use` runs with the interruptibility of the surrounding region. In an
14177
+ * interruptible region, it can be interrupted, and `release` receives an `Exit`
14178
+ * whose cause contains the interruption. In an uninterruptible region, `use`
14179
+ * runs to completion unless it explicitly restores interruptibility.
14180
+ *
14181
+ * The returned effect waits for release to finish, including when interrupted.
13685
14182
  *
13686
14183
  * If the `release` `Effect` value fails, then the entire `Effect` value will
13687
14184
  * fail, even if the `use` `Effect` value succeeds. If this fail-fast behavior
@@ -13752,8 +14249,9 @@ export const acquireUseRelease: <Resource, E, R, A, E2, R2, E3, R3>(
13752
14249
  *
13753
14250
  * **Details**
13754
14251
  *
13755
- * The finalizer runs when the surrounding scope is closed and receives the
13756
- * `Exit` value used to close the scope.
14252
+ * If the scope is open, `Scope.close` runs the finalizer according to the
14253
+ * scope's finalizer strategy and passes it the closing `Exit`. If the scope is
14254
+ * already closed, the finalizer runs immediately with that `Exit`.
13757
14255
  *
13758
14256
  * **Example** (Registering scope finalizers)
13759
14257
  *
@@ -13801,12 +14299,12 @@ export const addFinalizer: <R>(
13801
14299
  *
13802
14300
  * **Details**
13803
14301
  *
13804
- * For use cases that need access to the effect's result, see `onExit`.
13805
- *
13806
14302
  * Finalizers offer very powerful guarantees, but they are low-level, and
13807
14303
  * should generally not be used for releasing resources. For higher-level
13808
14304
  * logic built on `ensuring`, see the `acquireRelease` family of methods.
13809
14305
  *
14306
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14307
+ *
13810
14308
  * **Example** (Always running cleanup)
13811
14309
  *
13812
14310
  * ```ts import.meta.vitest
@@ -13841,12 +14339,12 @@ export const ensuring: {
13841
14339
  *
13842
14340
  * **Details**
13843
14341
  *
13844
- * For use cases that need access to the effect's result, see `onExit`.
13845
- *
13846
14342
  * Finalizers offer very powerful guarantees, but they are low-level, and
13847
14343
  * should generally not be used for releasing resources. For higher-level
13848
14344
  * logic built on `ensuring`, see the `acquireRelease` family of methods.
13849
14345
  *
14346
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14347
+ *
13850
14348
  * **Example** (Always running cleanup)
13851
14349
  *
13852
14350
  * ```ts import.meta.vitest
@@ -13881,12 +14379,12 @@ export const ensuring: {
13881
14379
  *
13882
14380
  * **Details**
13883
14381
  *
13884
- * For use cases that need access to the effect's result, see `onExit`.
13885
- *
13886
14382
  * Finalizers offer very powerful guarantees, but they are low-level, and
13887
14383
  * should generally not be used for releasing resources. For higher-level
13888
14384
  * logic built on `ensuring`, see the `acquireRelease` family of methods.
13889
14385
  *
14386
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14387
+ *
13890
14388
  * **Example** (Always running cleanup)
13891
14389
  *
13892
14390
  * ```ts import.meta.vitest
@@ -14012,6 +14510,10 @@ export const onError: {
14012
14510
  * Runs the finalizer only when this effect fails and the `Cause` matches the
14013
14511
  * provided predicate.
14014
14512
  *
14513
+ * **Details**
14514
+ *
14515
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14516
+ *
14015
14517
  * **Example** (Running cleanup for selected failures)
14016
14518
  *
14017
14519
  * ```ts import.meta.vitest
@@ -14042,6 +14544,10 @@ export const onErrorIf: {
14042
14544
  * Runs the finalizer only when this effect fails and the `Cause` matches the
14043
14545
  * provided predicate.
14044
14546
  *
14547
+ * **Details**
14548
+ *
14549
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14550
+ *
14045
14551
  * **Example** (Running cleanup for selected failures)
14046
14552
  *
14047
14553
  * ```ts import.meta.vitest
@@ -14075,6 +14581,10 @@ export const onErrorIf: {
14075
14581
  * Runs the finalizer only when this effect fails and the `Cause` matches the
14076
14582
  * provided predicate.
14077
14583
  *
14584
+ * **Details**
14585
+ *
14586
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14587
+ *
14078
14588
  * **Example** (Running cleanup for selected failures)
14079
14589
  *
14080
14590
  * ```ts import.meta.vitest
@@ -14116,6 +14626,10 @@ export const onErrorIf: {
14116
14626
  * `Cause` is accepted or transformed by a `Filter`, and the finalizer needs the
14117
14627
  * filter's pass value plus the original cause.
14118
14628
  *
14629
+ * **Details**
14630
+ *
14631
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14632
+ *
14119
14633
  * @see {@link onError} for cleanup on every failure
14120
14634
  * @see {@link onErrorIf} for selecting failures with a boolean predicate
14121
14635
  * @see {@link onExitFilter} for selecting from every exit instead of only failures
@@ -14134,6 +14648,10 @@ export const onErrorFilter: {
14134
14648
  * `Cause` is accepted or transformed by a `Filter`, and the finalizer needs the
14135
14649
  * filter's pass value plus the original cause.
14136
14650
  *
14651
+ * **Details**
14652
+ *
14653
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14654
+ *
14137
14655
  * @see {@link onError} for cleanup on every failure
14138
14656
  * @see {@link onErrorIf} for selecting failures with a boolean predicate
14139
14657
  * @see {@link onExitFilter} for selecting from every exit instead of only failures
@@ -14155,6 +14673,10 @@ export const onErrorFilter: {
14155
14673
  * `Cause` is accepted or transformed by a `Filter`, and the finalizer needs the
14156
14674
  * filter's pass value plus the original cause.
14157
14675
  *
14676
+ * **Details**
14677
+ *
14678
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14679
+ *
14158
14680
  * @see {@link onError} for cleanup on every failure
14159
14681
  * @see {@link onErrorIf} for selecting failures with a boolean predicate
14160
14682
  * @see {@link onExitFilter} for selecting from every exit instead of only failures
@@ -14206,6 +14728,15 @@ export const onExitPrimitive: <A, E, R, XE = never, XR = never>(
14206
14728
  *
14207
14729
  * If both the effect and the cleanup function fail, the two causes are merged.
14208
14730
  *
14731
+ * Cleanup runs in an uninterruptible region. `Fiber.interrupt` waits for it
14732
+ * to finish. Wrap a part of cleanup in `Effect.interruptible` to allow that
14733
+ * part to be interrupted.
14734
+ *
14735
+ * **Gotchas**
14736
+ *
14737
+ * If interruption is already pending, a part of cleanup wrapped in
14738
+ * `Effect.interruptible` is interrupted before it starts.
14739
+ *
14209
14740
  * **Example** (Observing every exit)
14210
14741
  *
14211
14742
  * ```ts import.meta.vitest
@@ -14238,6 +14769,15 @@ export const onExit: {
14238
14769
  *
14239
14770
  * If both the effect and the cleanup function fail, the two causes are merged.
14240
14771
  *
14772
+ * Cleanup runs in an uninterruptible region. `Fiber.interrupt` waits for it
14773
+ * to finish. Wrap a part of cleanup in `Effect.interruptible` to allow that
14774
+ * part to be interrupted.
14775
+ *
14776
+ * **Gotchas**
14777
+ *
14778
+ * If interruption is already pending, a part of cleanup wrapped in
14779
+ * `Effect.interruptible` is interrupted before it starts.
14780
+ *
14241
14781
  * **Example** (Observing every exit)
14242
14782
  *
14243
14783
  * ```ts import.meta.vitest
@@ -14270,6 +14810,15 @@ export const onExit: {
14270
14810
  *
14271
14811
  * If both the effect and the cleanup function fail, the two causes are merged.
14272
14812
  *
14813
+ * Cleanup runs in an uninterruptible region. `Fiber.interrupt` waits for it
14814
+ * to finish. Wrap a part of cleanup in `Effect.interruptible` to allow that
14815
+ * part to be interrupted.
14816
+ *
14817
+ * **Gotchas**
14818
+ *
14819
+ * If interruption is already pending, a part of cleanup wrapped in
14820
+ * `Effect.interruptible` is interrupted before it starts.
14821
+ *
14273
14822
  * **Example** (Observing every exit)
14274
14823
  *
14275
14824
  * ```ts import.meta.vitest
@@ -14300,6 +14849,10 @@ export const onExit: {
14300
14849
  * Runs the cleanup effect only when the `Exit` satisfies the provided
14301
14850
  * predicate.
14302
14851
  *
14852
+ * **Details**
14853
+ *
14854
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14855
+ *
14303
14856
  * **Example** (Observing selected exits)
14304
14857
  *
14305
14858
  * ```ts import.meta.vitest
@@ -14328,6 +14881,10 @@ export const onExitIf: {
14328
14881
  * Runs the cleanup effect only when the `Exit` satisfies the provided
14329
14882
  * predicate.
14330
14883
  *
14884
+ * **Details**
14885
+ *
14886
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14887
+ *
14331
14888
  * **Example** (Observing selected exits)
14332
14889
  *
14333
14890
  * ```ts import.meta.vitest
@@ -14359,6 +14916,10 @@ export const onExitIf: {
14359
14916
  * Runs the cleanup effect only when the `Exit` satisfies the provided
14360
14917
  * predicate.
14361
14918
  *
14919
+ * **Details**
14920
+ *
14921
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14922
+ *
14362
14923
  * **Example** (Observing selected exits)
14363
14924
  *
14364
14925
  * ```ts import.meta.vitest
@@ -14403,6 +14964,8 @@ export const onExitIf: {
14403
14964
  * `Result.fail` skips cleanup, and `Result.succeed` runs cleanup with the
14404
14965
  * selected value and the original `Exit`.
14405
14966
  *
14967
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14968
+ *
14406
14969
  * @see {@link onExit} for cleanup on every exit
14407
14970
  * @see {@link onExitIf} for selecting exits with a boolean predicate
14408
14971
  * @see {@link onErrorFilter} for selecting only failure causes
@@ -14426,6 +14989,8 @@ export const onExitFilter: {
14426
14989
  * `Result.fail` skips cleanup, and `Result.succeed` runs cleanup with the
14427
14990
  * selected value and the original `Exit`.
14428
14991
  *
14992
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
14993
+ *
14429
14994
  * @see {@link onExit} for cleanup on every exit
14430
14995
  * @see {@link onExitIf} for selecting exits with a boolean predicate
14431
14996
  * @see {@link onErrorFilter} for selecting only failure causes
@@ -14452,6 +15017,8 @@ export const onExitFilter: {
14452
15017
  * `Result.fail` skips cleanup, and `Result.succeed` runs cleanup with the
14453
15018
  * selected value and the original `Exit`.
14454
15019
  *
15020
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
15021
+ *
14455
15022
  * @see {@link onExit} for cleanup on every exit
14456
15023
  * @see {@link onExitIf} for selecting exits with a boolean predicate
14457
15024
  * @see {@link onErrorFilter} for selecting only failure causes
@@ -15274,7 +15841,8 @@ export const cachedInvalidateWithTTL: {
15274
15841
  // -----------------------------------------------------------------------------
15275
15842
 
15276
15843
  /**
15277
- * Returns an effect that is immediately interrupted.
15844
+ * Fails with an `Interrupt` reason that names the current fiber. This does not
15845
+ * request interruption of the fiber itself, so a cause handler can recover.
15278
15846
  *
15279
15847
  * **Example** (Creating an interrupted effect)
15280
15848
  *
@@ -15289,6 +15857,8 @@ export const cachedInvalidateWithTTL: {
15289
15857
  * Effect.runSyncExit(program)._tag // => "Failure"
15290
15858
  * ```
15291
15859
  *
15860
+ * @see {@link catchCause} for recovering from an interruption in the cause
15861
+ *
15292
15862
  * @stability stable
15293
15863
  * @category interruption
15294
15864
  * @since 2.0.0
@@ -15296,7 +15866,12 @@ export const cachedInvalidateWithTTL: {
15296
15866
  export const interrupt: Effect<never> = internal.interrupt
15297
15867
 
15298
15868
  /**
15299
- * Returns a new effect that allows the effect to be interruptible.
15869
+ * Runs an effect in an interruptible region.
15870
+ *
15871
+ * **Details**
15872
+ *
15873
+ * If interruption is pending when the fiber enters this region, it takes
15874
+ * effect before the wrapped effect starts.
15300
15875
  *
15301
15876
  * **Example** (Allowing interruption)
15302
15877
  *
@@ -15309,6 +15884,8 @@ export const interrupt: Effect<never> = internal.interrupt
15309
15884
  * await Effect.runPromise(program) // => Option.none()
15310
15885
  * ```
15311
15886
  *
15887
+ * @see {@link uninterruptible} for how regions defer interruption
15888
+ *
15312
15889
  * @stability stable
15313
15890
  * @category interruption
15314
15891
  * @since 2.0.0
@@ -15320,6 +15897,10 @@ export const interruptible: <A, E, R>(
15320
15897
  /**
15321
15898
  * Runs the specified finalizer effect if this effect is interrupted.
15322
15899
  *
15900
+ * **Details**
15901
+ *
15902
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
15903
+ *
15323
15904
  * **Example** (Running cleanup on interruption)
15324
15905
  *
15325
15906
  * ```ts import.meta.vitest
@@ -15346,6 +15927,10 @@ export const onInterrupt: {
15346
15927
  /**
15347
15928
  * Runs the specified finalizer effect if this effect is interrupted.
15348
15929
  *
15930
+ * **Details**
15931
+ *
15932
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
15933
+ *
15349
15934
  * **Example** (Running cleanup on interruption)
15350
15935
  *
15351
15936
  * ```ts import.meta.vitest
@@ -15372,6 +15957,10 @@ export const onInterrupt: {
15372
15957
  /**
15373
15958
  * Runs the specified finalizer effect if this effect is interrupted.
15374
15959
  *
15960
+ * **Details**
15961
+ *
15962
+ * Like {@link onExit} cleanup, the finalizer runs in an uninterruptible region.
15963
+ *
15375
15964
  * **Example** (Running cleanup on interruption)
15376
15965
  *
15377
15966
  * ```ts import.meta.vitest
@@ -15401,7 +15990,13 @@ export const onInterrupt: {
15401
15990
  } = internal.onInterrupt
15402
15991
 
15403
15992
  /**
15404
- * Returns a new effect that disables interruption for the given effect.
15993
+ * Runs an effect in an uninterruptible region.
15994
+ *
15995
+ * **Details**
15996
+ *
15997
+ * An interruption request remains pending while the fiber is uninterruptible.
15998
+ * It takes effect when the fiber returns to an interruptible region or enters
15999
+ * one explicitly with `interruptible`.
15405
16000
  *
15406
16001
  * **Example** (Preventing interruption)
15407
16002
  *
@@ -15432,6 +16027,12 @@ export const uninterruptible: <A, E, R>(
15432
16027
  * Disables interruption and provides a restore function to restore the
15433
16028
  * interruptible state within the effect.
15434
16029
  *
16030
+ * **Details**
16031
+ *
16032
+ * `restore(effect)` runs `effect` in the surrounding region. If that region
16033
+ * was interruptible, a pending interruption takes effect before `effect`
16034
+ * starts; if it was uninterruptible, the request remains pending.
16035
+ *
15435
16036
  * **Example** (Restoring interruption in protected regions)
15436
16037
  *
15437
16038
  * ```ts import.meta.vitest
@@ -15456,6 +16057,8 @@ export const uninterruptible: <A, E, R>(
15456
16057
  * output // => ["Uninterruptible phase...", "Interruptible phase...", "Back to uninterruptible"]
15457
16058
  * ```
15458
16059
  *
16060
+ * @see {@link uninterruptible} for how regions defer interruption
16061
+ *
15459
16062
  * @stability stable
15460
16063
  * @category interruption
15461
16064
  * @since 2.0.0
@@ -15470,6 +16073,11 @@ export const uninterruptibleMask: <A, E, R>(
15470
16073
  * Runs an effect in an interruptible region while providing `restore` for
15471
16074
  * locally restoring the previous interruptibility.
15472
16075
  *
16076
+ * **Details**
16077
+ *
16078
+ * A pending interruption takes effect when the fiber enters the interruptible
16079
+ * region. Otherwise, `restore` can run a section in the surrounding region.
16080
+ *
15473
16081
  * **Example** (Controlling interruptibility locally)
15474
16082
  *
15475
16083
  * ```ts import.meta.vitest
@@ -15490,10 +16098,12 @@ export const uninterruptibleMask: <A, E, R>(
15490
16098
  * })
15491
16099
  * )
15492
16100
  *
15493
- * Effect.runSync(program)
16101
+ * Effect.runSync(Effect.uninterruptible(program))
15494
16102
  * output // => ["Interruptible phase...", "Uninterruptible phase...", "Back to interruptible"]
15495
16103
  * ```
15496
16104
  *
16105
+ * @see {@link uninterruptible} for how regions defer interruption
16106
+ *
15497
16107
  * @stability stable
15498
16108
  * @category interruption
15499
16109
  * @since 2.0.0
@@ -15639,9 +16249,7 @@ export const forever: <
15639
16249
  * If the effect succeeds, it is repeated according to the schedule. If it
15640
16250
  * fails, the repetition stops immediately, and the failure is returned.
15641
16251
  *
15642
- * The schedule can also specify delays between repetitions, making it useful
15643
- * for tasks like retrying operations with backoff, periodic execution, or
15644
- * performing a series of dependent actions.
16252
+ * Delays between repetitions use the context's `Clock`.
15645
16253
  *
15646
16254
  * You can combine schedules for more advanced repetition logic, such as adding
15647
16255
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
@@ -15725,9 +16333,7 @@ export const repeat: {
15725
16333
  * If the effect succeeds, it is repeated according to the schedule. If it
15726
16334
  * fails, the repetition stops immediately, and the failure is returned.
15727
16335
  *
15728
- * The schedule can also specify delays between repetitions, making it useful
15729
- * for tasks like retrying operations with backoff, periodic execution, or
15730
- * performing a series of dependent actions.
16336
+ * Delays between repetitions use the context's `Clock`.
15731
16337
  *
15732
16338
  * You can combine schedules for more advanced repetition logic, such as adding
15733
16339
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
@@ -15811,9 +16417,7 @@ export const repeat: {
15811
16417
  * If the effect succeeds, it is repeated according to the schedule. If it
15812
16418
  * fails, the repetition stops immediately, and the failure is returned.
15813
16419
  *
15814
- * The schedule can also specify delays between repetitions, making it useful
15815
- * for tasks like retrying operations with backoff, periodic execution, or
15816
- * performing a series of dependent actions.
16420
+ * Delays between repetitions use the context's `Clock`.
15817
16421
  *
15818
16422
  * You can combine schedules for more advanced repetition logic, such as adding
15819
16423
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
@@ -15897,9 +16501,7 @@ export const repeat: {
15897
16501
  * If the effect succeeds, it is repeated according to the schedule. If it
15898
16502
  * fails, the repetition stops immediately, and the failure is returned.
15899
16503
  *
15900
- * The schedule can also specify delays between repetitions, making it useful
15901
- * for tasks like retrying operations with backoff, periodic execution, or
15902
- * performing a series of dependent actions.
16504
+ * Delays between repetitions use the context's `Clock`.
15903
16505
  *
15904
16506
  * You can combine schedules for more advanced repetition logic, such as adding
15905
16507
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
@@ -15987,9 +16589,7 @@ export const repeat: {
15987
16589
  * If the effect succeeds, it is repeated according to the schedule. If it
15988
16590
  * fails, the repetition stops immediately, and the failure is returned.
15989
16591
  *
15990
- * The schedule can also specify delays between repetitions, making it useful
15991
- * for tasks like retrying operations with backoff, periodic execution, or
15992
- * performing a series of dependent actions.
16592
+ * Delays between repetitions use the context's `Clock`.
15993
16593
  *
15994
16594
  * You can combine schedules for more advanced repetition logic, such as adding
15995
16595
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
@@ -16073,9 +16673,7 @@ export const repeat: {
16073
16673
  * If the effect succeeds, it is repeated according to the schedule. If it
16074
16674
  * fails, the repetition stops immediately, and the failure is returned.
16075
16675
  *
16076
- * The schedule can also specify delays between repetitions, making it useful
16077
- * for tasks like retrying operations with backoff, periodic execution, or
16078
- * performing a series of dependent actions.
16676
+ * Delays between repetitions use the context's `Clock`.
16079
16677
  *
16080
16678
  * You can combine schedules for more advanced repetition logic, such as adding
16081
16679
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
@@ -16162,9 +16760,7 @@ export const repeat: {
16162
16760
  * If the effect succeeds, it is repeated according to the schedule. If it
16163
16761
  * fails, the repetition stops immediately, and the failure is returned.
16164
16762
  *
16165
- * The schedule can also specify delays between repetitions, making it useful
16166
- * for tasks like retrying operations with backoff, periodic execution, or
16167
- * performing a series of dependent actions.
16763
+ * Delays between repetitions use the context's `Clock`.
16168
16764
  *
16169
16765
  * You can combine schedules for more advanced repetition logic, such as adding
16170
16766
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
@@ -16253,6 +16849,8 @@ export const repeat: {
16253
16849
  * otherwise it receives `None`. If the schedule completes normally, the
16254
16850
  * returned effect succeeds with the schedule's output.
16255
16851
  *
16852
+ * Scheduled delays use the context's `Clock`.
16853
+ *
16256
16854
  * **Gotchas**
16257
16855
  *
16258
16856
  * Defects take precedence over typed errors from either the effect or policy.
@@ -16313,6 +16911,8 @@ export const repeatOrElse: {
16313
16911
  * otherwise it receives `None`. If the schedule completes normally, the
16314
16912
  * returned effect succeeds with the schedule's output.
16315
16913
  *
16914
+ * Scheduled delays use the context's `Clock`.
16915
+ *
16316
16916
  * **Gotchas**
16317
16917
  *
16318
16918
  * Defects take precedence over typed errors from either the effect or policy.
@@ -16376,6 +16976,8 @@ export const repeatOrElse: {
16376
16976
  * otherwise it receives `None`. If the schedule completes normally, the
16377
16977
  * returned effect succeeds with the schedule's output.
16378
16978
  *
16979
+ * Scheduled delays use the context's `Clock`.
16980
+ *
16379
16981
  * **Gotchas**
16380
16982
  *
16381
16983
  * Defects take precedence over typed errors from either the effect or policy.
@@ -16681,6 +17283,8 @@ export const replicateEffect: {
16681
17283
  * fails, and otherwise succeeds with the schedule output when the schedule
16682
17284
  * completes.
16683
17285
  *
17286
+ * Scheduled delays use the context's `Clock`.
17287
+ *
16684
17288
  * **Example** (Scheduling repeated execution)
16685
17289
  *
16686
17290
  * ```ts import.meta.vitest
@@ -16723,6 +17327,8 @@ export const schedule: {
16723
17327
  * fails, and otherwise succeeds with the schedule output when the schedule
16724
17328
  * completes.
16725
17329
  *
17330
+ * Scheduled delays use the context's `Clock`.
17331
+ *
16726
17332
  * **Example** (Scheduling repeated execution)
16727
17333
  *
16728
17334
  * ```ts import.meta.vitest
@@ -16765,6 +17371,8 @@ export const schedule: {
16765
17371
  * fails, and otherwise succeeds with the schedule output when the schedule
16766
17372
  * completes.
16767
17373
  *
17374
+ * Scheduled delays use the context's `Clock`.
17375
+ *
16768
17376
  * **Example** (Scheduling repeated execution)
16769
17377
  *
16770
17378
  * ```ts import.meta.vitest
@@ -16807,6 +17415,8 @@ export const schedule: {
16807
17415
  * succeeds with the schedule output when the schedule completes and fails if
16808
17416
  * the effect or schedule fails.
16809
17417
  *
17418
+ * Scheduled delays use the context's `Clock`.
17419
+ *
16810
17420
  * **Example** (Scheduling from an initial value)
16811
17421
  *
16812
17422
  * ```ts import.meta.vitest
@@ -16847,6 +17457,8 @@ export const scheduleFrom: {
16847
17457
  * succeeds with the schedule output when the schedule completes and fails if
16848
17458
  * the effect or schedule fails.
16849
17459
  *
17460
+ * Scheduled delays use the context's `Clock`.
17461
+ *
16850
17462
  * **Example** (Scheduling from an initial value)
16851
17463
  *
16852
17464
  * ```ts import.meta.vitest
@@ -16887,6 +17499,8 @@ export const scheduleFrom: {
16887
17499
  * succeeds with the schedule output when the schedule completes and fails if
16888
17500
  * the effect or schedule fails.
16889
17501
  *
17502
+ * Scheduled delays use the context's `Clock`.
17503
+ *
16890
17504
  * **Example** (Scheduling from an initial value)
16891
17505
  *
16892
17506
  * ```ts import.meta.vitest
@@ -18192,9 +18806,7 @@ export const requestUnsafe: <A extends Request.Any>(
18192
18806
  // -----------------------------------------------------------------------------
18193
18807
 
18194
18808
  /**
18195
- * Returns an effect that forks this effect into its own separate fiber,
18196
- * returning the fiber immediately, without waiting for it to begin executing
18197
- * the effect.
18809
+ * Forks this effect into a child fiber and returns its handle.
18198
18810
  *
18199
18811
  * **Details**
18200
18812
  *
@@ -18214,6 +18826,18 @@ export const requestUnsafe: <A extends Request.Any>(
18214
18826
  * fibers leak. This behavior is called "auto supervision", and if this
18215
18827
  * behavior is not desired, you may use the `forkDetach` or `forkIn` methods.
18216
18828
  *
18829
+ * Fork options:
18830
+ *
18831
+ * - `startImmediately` defaults to `false`: the fork returns before the new
18832
+ * fiber runs, without promising a scheduler turn. With `true`, the fiber
18833
+ * runs synchronously until it suspends, yields, or completes before the fork
18834
+ * returns.
18835
+ * - `uninterruptible` defaults to `false`, even in an uninterruptible caller.
18836
+ * With `true`, the fiber starts uninterruptible: `Fiber.interrupt` waits for
18837
+ * completion without replacing its result. Explicit `Effect.interruptible`
18838
+ * regions can still be interrupted. `"inherit"` copies the caller's
18839
+ * interruptibility at the fork.
18840
+ *
18217
18841
  * **Example** (Forking a child fiber)
18218
18842
  *
18219
18843
  * ```ts import.meta.vitest
@@ -18255,6 +18879,33 @@ export const forkChild: <
18255
18879
  * Forks the effect in the specified scope. The fiber will be interrupted
18256
18880
  * when the scope is closed.
18257
18881
  *
18882
+ * **Details**
18883
+ *
18884
+ * The scope owns the fiber, not the forker: it can outlive the forker's
18885
+ * completion or interruption. Closing the scope from another fiber interrupts
18886
+ * it and waits for completion, including finalizers.
18887
+ *
18888
+ * Forking and registration are interruption-safe: interrupting the forker
18889
+ * cannot leave the new fiber outside the scope. If the scope is already
18890
+ * closed, the effect is not started and the returned fiber is interrupted.
18891
+ *
18892
+ * Fork options:
18893
+ *
18894
+ * - `startImmediately` defaults to `false`: the fork returns before the new
18895
+ * fiber runs, without promising a scheduler turn. With `true`, the fiber
18896
+ * runs synchronously until it suspends, yields, or completes before the fork
18897
+ * returns.
18898
+ * - `uninterruptible` defaults to `false`, even in an uninterruptible caller.
18899
+ * With `true`, the fiber starts uninterruptible: `Fiber.interrupt` waits for
18900
+ * completion without replacing its result. Explicit `Effect.interruptible`
18901
+ * regions can still be interrupted. `"inherit"` copies the caller's
18902
+ * interruptibility at the fork.
18903
+ *
18904
+ * **Gotchas**
18905
+ *
18906
+ * A fiber that closes its own scope is not interrupted or awaited by that
18907
+ * close. An uninterruptible fiber can delay scope closure.
18908
+ *
18258
18909
  * **Example** (Forking into a supplied scope)
18259
18910
  *
18260
18911
  * ```ts import.meta.vitest
@@ -18283,6 +18934,33 @@ export const forkIn: {
18283
18934
  * Forks the effect in the specified scope. The fiber will be interrupted
18284
18935
  * when the scope is closed.
18285
18936
  *
18937
+ * **Details**
18938
+ *
18939
+ * The scope owns the fiber, not the forker: it can outlive the forker's
18940
+ * completion or interruption. Closing the scope from another fiber interrupts
18941
+ * it and waits for completion, including finalizers.
18942
+ *
18943
+ * Forking and registration are interruption-safe: interrupting the forker
18944
+ * cannot leave the new fiber outside the scope. If the scope is already
18945
+ * closed, the effect is not started and the returned fiber is interrupted.
18946
+ *
18947
+ * Fork options:
18948
+ *
18949
+ * - `startImmediately` defaults to `false`: the fork returns before the new
18950
+ * fiber runs, without promising a scheduler turn. With `true`, the fiber
18951
+ * runs synchronously until it suspends, yields, or completes before the fork
18952
+ * returns.
18953
+ * - `uninterruptible` defaults to `false`, even in an uninterruptible caller.
18954
+ * With `true`, the fiber starts uninterruptible: `Fiber.interrupt` waits for
18955
+ * completion without replacing its result. Explicit `Effect.interruptible`
18956
+ * regions can still be interrupted. `"inherit"` copies the caller's
18957
+ * interruptibility at the fork.
18958
+ *
18959
+ * **Gotchas**
18960
+ *
18961
+ * A fiber that closes its own scope is not interrupted or awaited by that
18962
+ * close. An uninterruptible fiber can delay scope closure.
18963
+ *
18286
18964
  * **Example** (Forking into a supplied scope)
18287
18965
  *
18288
18966
  * ```ts import.meta.vitest
@@ -18317,6 +18995,33 @@ export const forkIn: {
18317
18995
  * Forks the effect in the specified scope. The fiber will be interrupted
18318
18996
  * when the scope is closed.
18319
18997
  *
18998
+ * **Details**
18999
+ *
19000
+ * The scope owns the fiber, not the forker: it can outlive the forker's
19001
+ * completion or interruption. Closing the scope from another fiber interrupts
19002
+ * it and waits for completion, including finalizers.
19003
+ *
19004
+ * Forking and registration are interruption-safe: interrupting the forker
19005
+ * cannot leave the new fiber outside the scope. If the scope is already
19006
+ * closed, the effect is not started and the returned fiber is interrupted.
19007
+ *
19008
+ * Fork options:
19009
+ *
19010
+ * - `startImmediately` defaults to `false`: the fork returns before the new
19011
+ * fiber runs, without promising a scheduler turn. With `true`, the fiber
19012
+ * runs synchronously until it suspends, yields, or completes before the fork
19013
+ * returns.
19014
+ * - `uninterruptible` defaults to `false`, even in an uninterruptible caller.
19015
+ * With `true`, the fiber starts uninterruptible: `Fiber.interrupt` waits for
19016
+ * completion without replacing its result. Explicit `Effect.interruptible`
19017
+ * regions can still be interrupted. `"inherit"` copies the caller's
19018
+ * interruptibility at the fork.
19019
+ *
19020
+ * **Gotchas**
19021
+ *
19022
+ * A fiber that closes its own scope is not interrupted or awaited by that
19023
+ * close. An uninterruptible fiber can delay scope closure.
19024
+ *
18320
19025
  * **Example** (Forking into a supplied scope)
18321
19026
  *
18322
19027
  * ```ts import.meta.vitest
@@ -18353,6 +19058,33 @@ export const forkIn: {
18353
19058
  /**
18354
19059
  * Forks the fiber in a `Scope`, interrupting it when the scope is closed.
18355
19060
  *
19061
+ * **Details**
19062
+ *
19063
+ * The scope owns the fiber, not the forker: it can outlive the forker's
19064
+ * completion or interruption. Closing the scope from another fiber interrupts
19065
+ * it and waits for completion, including finalizers.
19066
+ *
19067
+ * Forking and registration are interruption-safe: interrupting the forker
19068
+ * cannot leave the new fiber outside the scope. If the scope is already
19069
+ * closed, the effect is not started and the returned fiber is interrupted.
19070
+ *
19071
+ * Fork options:
19072
+ *
19073
+ * - `startImmediately` defaults to `false`: the fork returns before the new
19074
+ * fiber runs, without promising a scheduler turn. With `true`, the fiber
19075
+ * runs synchronously until it suspends, yields, or completes before the fork
19076
+ * returns.
19077
+ * - `uninterruptible` defaults to `false`, even in an uninterruptible caller.
19078
+ * With `true`, the fiber starts uninterruptible: `Fiber.interrupt` waits for
19079
+ * completion without replacing its result. Explicit `Effect.interruptible`
19080
+ * regions can still be interrupted. `"inherit"` copies the caller's
19081
+ * interruptibility at the fork.
19082
+ *
19083
+ * **Gotchas**
19084
+ *
19085
+ * A fiber that closes its own scope is not interrupted or awaited by that
19086
+ * close. An uninterruptible fiber can delay scope closure.
19087
+ *
18356
19088
  * **Example** (Forking into the current scope)
18357
19089
  *
18358
19090
  * ```ts import.meta.vitest
@@ -18403,6 +19135,18 @@ export const forkScoped: <
18403
19135
  * until it completes or is explicitly interrupted through the returned handle,
18404
19136
  * even after the forking fiber terminates.
18405
19137
  *
19138
+ * Fork options:
19139
+ *
19140
+ * - `startImmediately` defaults to `false`: the fork returns before the new
19141
+ * fiber runs, without promising a scheduler turn. With `true`, the fiber
19142
+ * runs synchronously until it suspends, yields, or completes before the fork
19143
+ * returns.
19144
+ * - `uninterruptible` defaults to `false`, even in an uninterruptible caller.
19145
+ * With `true`, the fiber starts uninterruptible: `Fiber.interrupt` waits for
19146
+ * completion without replacing its result. Explicit `Effect.interruptible`
19147
+ * regions can still be interrupted. `"inherit"` copies the caller's
19148
+ * interruptibility at the fork.
19149
+ *
18406
19150
  * **Example** (Forking a detached fiber)
18407
19151
  *
18408
19152
  * ```ts import.meta.vitest
@@ -18525,9 +19269,9 @@ export const fiberId: Effect<number> = internal.fiberId
18525
19269
  *
18526
19270
  * **Details**
18527
19271
  *
18528
- * `signal` interrupts the fiber, `scheduler` provides the scheduler service,
18529
- * `uninterruptible` starts the fiber uninterruptibly, and `onFiberStart`
18530
- * receives the created fiber.
19272
+ * `signal` can interrupt the fiber, and `scheduler` provides the scheduler
19273
+ * service. The fiber starts interruptible unless `uninterruptible: true` is
19274
+ * set.
18531
19275
  *
18532
19276
  * @see {@link runFork} for starting a fiber with these options
18533
19277
  * @see {@link runCallback} for callback-based running with these options
@@ -18553,6 +19297,12 @@ export interface RunOptions {
18553
19297
  *
18554
19298
  * Use when you need to start an effect in the background and receive a fiber.
18555
19299
  *
19300
+ * **Details**
19301
+ *
19302
+ * The fiber starts immediately and runs synchronously until it suspends,
19303
+ * yields, or completes. It starts interruptible unless `uninterruptible: true`
19304
+ * is set.
19305
+ *
18556
19306
  * **Example** (Running an effect in the background)
18557
19307
  *
18558
19308
  * ```ts import.meta.vitest
@@ -18571,6 +19321,8 @@ export interface RunOptions {
18571
19321
  * output // => ["running...", "done"]
18572
19322
  * ```
18573
19323
  *
19324
+ * @see {@link RunOptions} for configuring the fiber
19325
+ * @see {@link forkChild} for starting a child of the current fiber
18574
19326
  * @stability stable
18575
19327
  * @category running
18576
19328
  * @since 2.0.0
@@ -18586,6 +19338,12 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
18586
19338
  * Use when an effect still requires services, you already have a `Context`, and
18587
19339
  * you want a background fiber.
18588
19340
  *
19341
+ * **Details**
19342
+ *
19343
+ * The fiber starts immediately and runs synchronously until it suspends,
19344
+ * yields, or completes. It starts interruptible unless `uninterruptible: true`
19345
+ * is set.
19346
+ *
18589
19347
  * **Example** (Running with services in the background)
18590
19348
  *
18591
19349
  * ```ts import.meta.vitest
@@ -18613,6 +19371,8 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
18613
19371
  * output // => ["Hello from service!", "done"]
18614
19372
  * ```
18615
19373
  *
19374
+ * @see {@link RunOptions} for configuring the fiber
19375
+ * @see {@link forkChild} for starting a child of the current fiber
18616
19376
  * @stability stable
18617
19377
  * @category running
18618
19378
  * @since 4.0.0
@@ -26549,6 +27309,8 @@ export const tx = <A, E, R>(
26549
27309
  if (!internal.hasInterruptsOnly(cause)) return sync(() => clearTransaction(mutable))
26550
27310
  return restore(awaitPendingTransaction(mutable))
26551
27311
  }),
27312
+ // A body that recovers the txRetry interrupt succeeds with retry still set, so wait here too.
27313
+ tap(() => mutable.retry ? restore(awaitPendingTransaction(mutable)) : void_),
26552
27314
  exit
26553
27315
  )
26554
27316
  return flatMap(