effect 4.0.0-beta.4 → 4.0.0-beta.41

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 (1235) hide show
  1. package/dist/Array.d.ts +213 -385
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +149 -102
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +82 -45
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +87 -38
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +39 -32
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +32 -29
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Brand.d.ts +1 -1
  14. package/dist/Brand.d.ts.map +1 -1
  15. package/dist/Brand.js +1 -1
  16. package/dist/Brand.js.map +1 -1
  17. package/dist/Cache.d.ts +2 -2
  18. package/dist/Cache.d.ts.map +1 -1
  19. package/dist/Cache.js +6 -5
  20. package/dist/Cache.js.map +1 -1
  21. package/dist/Cause.d.ts +33 -2
  22. package/dist/Cause.d.ts.map +1 -1
  23. package/dist/Cause.js +19 -0
  24. package/dist/Cause.js.map +1 -1
  25. package/dist/Channel.d.ts +130 -35
  26. package/dist/Channel.d.ts.map +1 -1
  27. package/dist/Channel.js +96 -45
  28. package/dist/Channel.js.map +1 -1
  29. package/dist/Chunk.d.ts +112 -304
  30. package/dist/Chunk.d.ts.map +1 -1
  31. package/dist/Chunk.js +56 -88
  32. package/dist/Chunk.js.map +1 -1
  33. package/dist/Combiner.d.ts +280 -13
  34. package/dist/Combiner.d.ts.map +1 -1
  35. package/dist/Combiner.js +198 -7
  36. package/dist/Combiner.js.map +1 -1
  37. package/dist/Config.d.ts +169 -9
  38. package/dist/Config.d.ts.map +1 -1
  39. package/dist/Config.js +69 -11
  40. package/dist/Config.js.map +1 -1
  41. package/dist/ConfigProvider.d.ts +1 -1
  42. package/dist/Cron.d.ts +11 -7
  43. package/dist/Cron.d.ts.map +1 -1
  44. package/dist/Cron.js +120 -63
  45. package/dist/Cron.js.map +1 -1
  46. package/dist/Data.d.ts +535 -366
  47. package/dist/Data.d.ts.map +1 -1
  48. package/dist/Data.js +132 -79
  49. package/dist/Data.js.map +1 -1
  50. package/dist/DateTime.d.ts +72 -253
  51. package/dist/DateTime.d.ts.map +1 -1
  52. package/dist/DateTime.js +15 -60
  53. package/dist/DateTime.js.map +1 -1
  54. package/dist/Deferred.d.ts +7 -5
  55. package/dist/Deferred.d.ts.map +1 -1
  56. package/dist/Deferred.js +7 -5
  57. package/dist/Deferred.js.map +1 -1
  58. package/dist/Duration.d.ts +62 -32
  59. package/dist/Duration.d.ts.map +1 -1
  60. package/dist/Duration.js +108 -78
  61. package/dist/Duration.js.map +1 -1
  62. package/dist/Effect.d.ts +1225 -951
  63. package/dist/Effect.d.ts.map +1 -1
  64. package/dist/Effect.js +398 -338
  65. package/dist/Effect.js.map +1 -1
  66. package/dist/Encoding.d.ts +194 -0
  67. package/dist/Encoding.d.ts.map +1 -0
  68. package/dist/Encoding.js +352 -0
  69. package/dist/Encoding.js.map +1 -0
  70. package/dist/Equal.d.ts +276 -109
  71. package/dist/Equal.d.ts.map +1 -1
  72. package/dist/Equal.js +124 -48
  73. package/dist/Equal.js.map +1 -1
  74. package/dist/Equivalence.d.ts +60 -3
  75. package/dist/Equivalence.d.ts.map +1 -1
  76. package/dist/Equivalence.js +70 -13
  77. package/dist/Equivalence.js.map +1 -1
  78. package/dist/ErrorReporter.d.ts +374 -0
  79. package/dist/ErrorReporter.d.ts.map +1 -0
  80. package/dist/ErrorReporter.js +245 -0
  81. package/dist/ErrorReporter.js.map +1 -0
  82. package/dist/Exit.d.ts +24 -12
  83. package/dist/Exit.d.ts.map +1 -1
  84. package/dist/Exit.js +8 -4
  85. package/dist/Exit.js.map +1 -1
  86. package/dist/Fiber.d.ts +5 -3
  87. package/dist/Fiber.d.ts.map +1 -1
  88. package/dist/Fiber.js.map +1 -1
  89. package/dist/FiberHandle.d.ts +9 -8
  90. package/dist/FiberHandle.d.ts.map +1 -1
  91. package/dist/FiberHandle.js +8 -7
  92. package/dist/FiberHandle.js.map +1 -1
  93. package/dist/FiberMap.d.ts +20 -19
  94. package/dist/FiberMap.d.ts.map +1 -1
  95. package/dist/FiberMap.js +6 -6
  96. package/dist/FiberMap.js.map +1 -1
  97. package/dist/FileSystem.d.ts +18 -17
  98. package/dist/FileSystem.d.ts.map +1 -1
  99. package/dist/FileSystem.js +17 -13
  100. package/dist/FileSystem.js.map +1 -1
  101. package/dist/Filter.d.ts +34 -38
  102. package/dist/Filter.d.ts.map +1 -1
  103. package/dist/Filter.js +15 -13
  104. package/dist/Filter.js.map +1 -1
  105. package/dist/Formatter.d.ts +131 -47
  106. package/dist/Formatter.d.ts.map +1 -1
  107. package/dist/Formatter.js +229 -51
  108. package/dist/Formatter.js.map +1 -1
  109. package/dist/Function.d.ts +1 -9
  110. package/dist/Function.d.ts.map +1 -1
  111. package/dist/Function.js +2 -10
  112. package/dist/Function.js.map +1 -1
  113. package/dist/Graph.d.ts +65 -65
  114. package/dist/Graph.d.ts.map +1 -1
  115. package/dist/Graph.js +60 -62
  116. package/dist/Graph.js.map +1 -1
  117. package/dist/HashMap.d.ts +26 -19
  118. package/dist/HashMap.d.ts.map +1 -1
  119. package/dist/HashMap.js +7 -5
  120. package/dist/HashMap.js.map +1 -1
  121. package/dist/Iterable.d.ts +50 -50
  122. package/dist/Iterable.d.ts.map +1 -1
  123. package/dist/Iterable.js +106 -34
  124. package/dist/Iterable.js.map +1 -1
  125. package/dist/JsonSchema.d.ts +299 -10
  126. package/dist/JsonSchema.d.ts.map +1 -1
  127. package/dist/JsonSchema.js +323 -4
  128. package/dist/JsonSchema.js.map +1 -1
  129. package/dist/Latch.d.ts +175 -0
  130. package/dist/Latch.d.ts.map +1 -0
  131. package/dist/Latch.js +130 -0
  132. package/dist/Latch.js.map +1 -0
  133. package/dist/Layer.d.ts +306 -129
  134. package/dist/Layer.d.ts.map +1 -1
  135. package/dist/Layer.js +93 -48
  136. package/dist/Layer.js.map +1 -1
  137. package/dist/LayerMap.d.ts +9 -8
  138. package/dist/LayerMap.d.ts.map +1 -1
  139. package/dist/LayerMap.js +3 -3
  140. package/dist/LayerMap.js.map +1 -1
  141. package/dist/LogLevel.d.ts +32 -0
  142. package/dist/LogLevel.d.ts.map +1 -1
  143. package/dist/LogLevel.js +28 -100
  144. package/dist/LogLevel.js.map +1 -1
  145. package/dist/Logger.d.ts +29 -95
  146. package/dist/Logger.d.ts.map +1 -1
  147. package/dist/Logger.js +2 -3
  148. package/dist/Logger.js.map +1 -1
  149. package/dist/ManagedRuntime.d.ts +2 -2
  150. package/dist/ManagedRuntime.d.ts.map +1 -1
  151. package/dist/ManagedRuntime.js +21 -9
  152. package/dist/ManagedRuntime.js.map +1 -1
  153. package/dist/Metric.d.ts +4 -6
  154. package/dist/Metric.d.ts.map +1 -1
  155. package/dist/Metric.js +3 -5
  156. package/dist/Metric.js.map +1 -1
  157. package/dist/MutableHashMap.d.ts +7 -0
  158. package/dist/MutableHashMap.d.ts.map +1 -1
  159. package/dist/MutableHashMap.js +8 -0
  160. package/dist/MutableHashMap.js.map +1 -1
  161. package/dist/MutableHashSet.d.ts +7 -0
  162. package/dist/MutableHashSet.d.ts.map +1 -1
  163. package/dist/MutableHashSet.js +8 -0
  164. package/dist/MutableHashSet.js.map +1 -1
  165. package/dist/Newtype.d.ts +291 -0
  166. package/dist/Newtype.d.ts.map +1 -0
  167. package/dist/Newtype.js +161 -0
  168. package/dist/Newtype.js.map +1 -0
  169. package/dist/Number.d.ts +74 -18
  170. package/dist/Number.d.ts.map +1 -1
  171. package/dist/Number.js +34 -15
  172. package/dist/Number.js.map +1 -1
  173. package/dist/Optic.d.ts +947 -18
  174. package/dist/Optic.d.ts.map +1 -1
  175. package/dist/Optic.js +454 -5
  176. package/dist/Optic.js.map +1 -1
  177. package/dist/Option.d.ts +25 -16
  178. package/dist/Option.d.ts.map +1 -1
  179. package/dist/Option.js +15 -9
  180. package/dist/Option.js.map +1 -1
  181. package/dist/Order.d.ts +6 -1
  182. package/dist/Order.d.ts.map +1 -1
  183. package/dist/Order.js +19 -14
  184. package/dist/Order.js.map +1 -1
  185. package/dist/PartitionedSemaphore.d.ts +146 -15
  186. package/dist/PartitionedSemaphore.d.ts.map +1 -1
  187. package/dist/PartitionedSemaphore.js +174 -61
  188. package/dist/PartitionedSemaphore.js.map +1 -1
  189. package/dist/Pipeable.d.ts +17 -0
  190. package/dist/Pipeable.d.ts.map +1 -1
  191. package/dist/Pipeable.js +19 -1
  192. package/dist/Pipeable.js.map +1 -1
  193. package/dist/PlatformError.d.ts +10 -9
  194. package/dist/PlatformError.d.ts.map +1 -1
  195. package/dist/PlatformError.js +2 -2
  196. package/dist/PlatformError.js.map +1 -1
  197. package/dist/Pool.d.ts +6 -4
  198. package/dist/Pool.d.ts.map +1 -1
  199. package/dist/Pool.js +7 -5
  200. package/dist/Pool.js.map +1 -1
  201. package/dist/PubSub.d.ts +8 -6
  202. package/dist/PubSub.d.ts.map +1 -1
  203. package/dist/PubSub.js +18 -10
  204. package/dist/PubSub.js.map +1 -1
  205. package/dist/Pull.d.ts.map +1 -1
  206. package/dist/Pull.js +1 -1
  207. package/dist/Pull.js.map +1 -1
  208. package/dist/Queue.d.ts +9 -6
  209. package/dist/Queue.d.ts.map +1 -1
  210. package/dist/Queue.js +7 -5
  211. package/dist/Queue.js.map +1 -1
  212. package/dist/Random.d.ts +35 -1
  213. package/dist/Random.d.ts.map +1 -1
  214. package/dist/Random.js +46 -12
  215. package/dist/Random.js.map +1 -1
  216. package/dist/RcMap.d.ts +2 -2
  217. package/dist/RcMap.d.ts.map +1 -1
  218. package/dist/RcMap.js +1 -1
  219. package/dist/RcMap.js.map +1 -1
  220. package/dist/RcRef.d.ts +1 -1
  221. package/dist/RcRef.d.ts.map +1 -1
  222. package/dist/Record.d.ts +63 -160
  223. package/dist/Record.d.ts.map +1 -1
  224. package/dist/Record.js +37 -56
  225. package/dist/Record.js.map +1 -1
  226. package/dist/Reducer.d.ts +166 -7
  227. package/dist/Reducer.d.ts.map +1 -1
  228. package/dist/Reducer.js +135 -1
  229. package/dist/Reducer.js.map +1 -1
  230. package/dist/References.d.ts +242 -226
  231. package/dist/References.d.ts.map +1 -1
  232. package/dist/References.js +240 -247
  233. package/dist/References.js.map +1 -1
  234. package/dist/Request.d.ts +1 -1
  235. package/dist/Request.d.ts.map +1 -1
  236. package/dist/Request.js +2 -1
  237. package/dist/Request.js.map +1 -1
  238. package/dist/RequestResolver.d.ts +25 -45
  239. package/dist/RequestResolver.d.ts.map +1 -1
  240. package/dist/RequestResolver.js +10 -30
  241. package/dist/RequestResolver.js.map +1 -1
  242. package/dist/Resource.d.ts.map +1 -1
  243. package/dist/Resource.js +2 -1
  244. package/dist/Resource.js.map +1 -1
  245. package/dist/Result.d.ts +1 -1
  246. package/dist/Result.d.ts.map +1 -1
  247. package/dist/Result.js +1 -2
  248. package/dist/Result.js.map +1 -1
  249. package/dist/Runtime.d.ts +66 -0
  250. package/dist/Runtime.d.ts.map +1 -1
  251. package/dist/Runtime.js +79 -6
  252. package/dist/Runtime.js.map +1 -1
  253. package/dist/Schedule.d.ts +174 -291
  254. package/dist/Schedule.d.ts.map +1 -1
  255. package/dist/Schedule.js +160 -134
  256. package/dist/Schedule.js.map +1 -1
  257. package/dist/Scheduler.d.ts +34 -123
  258. package/dist/Scheduler.d.ts.map +1 -1
  259. package/dist/Scheduler.js +31 -123
  260. package/dist/Scheduler.js.map +1 -1
  261. package/dist/Schema.d.ts +2722 -247
  262. package/dist/Schema.d.ts.map +1 -1
  263. package/dist/Schema.js +1947 -224
  264. package/dist/Schema.js.map +1 -1
  265. package/dist/SchemaAST.d.ts +7 -2
  266. package/dist/SchemaAST.d.ts.map +1 -1
  267. package/dist/SchemaAST.js +131 -25
  268. package/dist/SchemaAST.js.map +1 -1
  269. package/dist/SchemaGetter.d.ts +5 -5
  270. package/dist/SchemaGetter.d.ts.map +1 -1
  271. package/dist/SchemaGetter.js +18 -18
  272. package/dist/SchemaGetter.js.map +1 -1
  273. package/dist/SchemaParser.d.ts +44 -54
  274. package/dist/SchemaParser.d.ts.map +1 -1
  275. package/dist/SchemaParser.js +55 -2
  276. package/dist/SchemaParser.js.map +1 -1
  277. package/dist/SchemaRepresentation.d.ts +46 -45
  278. package/dist/SchemaRepresentation.d.ts.map +1 -1
  279. package/dist/SchemaRepresentation.js +49 -24
  280. package/dist/SchemaRepresentation.js.map +1 -1
  281. package/dist/SchemaTransformation.d.ts +107 -3
  282. package/dist/SchemaTransformation.d.ts.map +1 -1
  283. package/dist/SchemaTransformation.js +173 -13
  284. package/dist/SchemaTransformation.js.map +1 -1
  285. package/dist/ScopedCache.d.ts +2 -2
  286. package/dist/ScopedCache.d.ts.map +1 -1
  287. package/dist/ScopedCache.js +1 -1
  288. package/dist/ScopedCache.js.map +1 -1
  289. package/dist/Semaphore.d.ts +307 -0
  290. package/dist/Semaphore.d.ts.map +1 -0
  291. package/dist/Semaphore.js +222 -0
  292. package/dist/Semaphore.js.map +1 -0
  293. package/dist/ServiceMap.d.ts +76 -52
  294. package/dist/ServiceMap.d.ts.map +1 -1
  295. package/dist/ServiceMap.js +45 -29
  296. package/dist/ServiceMap.js.map +1 -1
  297. package/dist/Sink.d.ts +18 -15
  298. package/dist/Sink.d.ts.map +1 -1
  299. package/dist/Sink.js +53 -6
  300. package/dist/Sink.js.map +1 -1
  301. package/dist/Stdio.d.ts +16 -4
  302. package/dist/Stdio.d.ts.map +1 -1
  303. package/dist/Stdio.js +18 -0
  304. package/dist/Stdio.js.map +1 -1
  305. package/dist/Stream.d.ts +284 -431
  306. package/dist/Stream.d.ts.map +1 -1
  307. package/dist/Stream.js +189 -88
  308. package/dist/Stream.js.map +1 -1
  309. package/dist/String.d.ts +114 -47
  310. package/dist/String.d.ts.map +1 -1
  311. package/dist/String.js +29 -47
  312. package/dist/String.js.map +1 -1
  313. package/dist/Struct.d.ts +23 -7
  314. package/dist/Struct.d.ts.map +1 -1
  315. package/dist/Struct.js +22 -0
  316. package/dist/Struct.js.map +1 -1
  317. package/dist/SubscriptionRef.d.ts +3 -3
  318. package/dist/SubscriptionRef.d.ts.map +1 -1
  319. package/dist/SubscriptionRef.js +85 -117
  320. package/dist/SubscriptionRef.js.map +1 -1
  321. package/dist/SynchronizedRef.d.ts +2 -1
  322. package/dist/SynchronizedRef.d.ts.map +1 -1
  323. package/dist/SynchronizedRef.js +2 -1
  324. package/dist/SynchronizedRef.js.map +1 -1
  325. package/dist/Terminal.d.ts +2 -1
  326. package/dist/Terminal.d.ts.map +1 -1
  327. package/dist/Terminal.js.map +1 -1
  328. package/dist/Tracer.d.ts +5 -4
  329. package/dist/Tracer.d.ts.map +1 -1
  330. package/dist/Tracer.js +2 -1
  331. package/dist/Tracer.js.map +1 -1
  332. package/dist/Trie.d.ts +44 -31
  333. package/dist/Trie.d.ts.map +1 -1
  334. package/dist/Trie.js +13 -9
  335. package/dist/Trie.js.map +1 -1
  336. package/dist/TxChunk.d.ts +37 -37
  337. package/dist/TxChunk.d.ts.map +1 -1
  338. package/dist/TxChunk.js +3 -3
  339. package/dist/TxChunk.js.map +1 -1
  340. package/dist/TxDeferred.d.ts +328 -0
  341. package/dist/TxDeferred.d.ts.map +1 -0
  342. package/dist/TxDeferred.js +197 -0
  343. package/dist/TxDeferred.js.map +1 -0
  344. package/dist/TxHashMap.d.ts +159 -140
  345. package/dist/TxHashMap.d.ts.map +1 -1
  346. package/dist/TxHashMap.js +51 -44
  347. package/dist/TxHashMap.js.map +1 -1
  348. package/dist/TxHashSet.d.ts +36 -36
  349. package/dist/TxHashSet.d.ts.map +1 -1
  350. package/dist/TxHashSet.js +16 -15
  351. package/dist/TxHashSet.js.map +1 -1
  352. package/dist/TxPriorityQueue.d.ts +609 -0
  353. package/dist/TxPriorityQueue.d.ts.map +1 -0
  354. package/dist/TxPriorityQueue.js +416 -0
  355. package/dist/TxPriorityQueue.js.map +1 -0
  356. package/dist/TxPubSub.d.ts +585 -0
  357. package/dist/TxPubSub.d.ts.map +1 -0
  358. package/dist/TxPubSub.js +521 -0
  359. package/dist/TxPubSub.js.map +1 -0
  360. package/dist/TxQueue.d.ts +32 -32
  361. package/dist/TxQueue.d.ts.map +1 -1
  362. package/dist/TxQueue.js +26 -26
  363. package/dist/TxQueue.js.map +1 -1
  364. package/dist/TxReentrantLock.d.ts +523 -0
  365. package/dist/TxReentrantLock.d.ts.map +1 -0
  366. package/dist/TxReentrantLock.js +504 -0
  367. package/dist/TxReentrantLock.js.map +1 -0
  368. package/dist/TxRef.d.ts +34 -34
  369. package/dist/TxRef.d.ts.map +1 -1
  370. package/dist/TxRef.js +21 -14
  371. package/dist/TxRef.js.map +1 -1
  372. package/dist/TxSemaphore.d.ts +170 -10
  373. package/dist/TxSemaphore.d.ts.map +1 -1
  374. package/dist/TxSemaphore.js +23 -8
  375. package/dist/TxSemaphore.js.map +1 -1
  376. package/dist/TxSubscriptionRef.d.ts +508 -0
  377. package/dist/TxSubscriptionRef.d.ts.map +1 -0
  378. package/dist/TxSubscriptionRef.js +293 -0
  379. package/dist/TxSubscriptionRef.js.map +1 -0
  380. package/dist/Types.d.ts +80 -23
  381. package/dist/Types.d.ts.map +1 -1
  382. package/dist/Utils.d.ts +137 -65
  383. package/dist/Utils.d.ts.map +1 -1
  384. package/dist/Utils.js +38 -66
  385. package/dist/Utils.js.map +1 -1
  386. package/dist/index.d.ts +806 -55
  387. package/dist/index.d.ts.map +1 -1
  388. package/dist/index.js +806 -55
  389. package/dist/index.js.map +1 -1
  390. package/dist/internal/core.js +11 -3
  391. package/dist/internal/core.js.map +1 -1
  392. package/dist/internal/dateTime.js +77 -71
  393. package/dist/internal/dateTime.js.map +1 -1
  394. package/dist/internal/effect.js +284 -201
  395. package/dist/internal/effect.js.map +1 -1
  396. package/dist/internal/hashMap.js +7 -5
  397. package/dist/internal/hashMap.js.map +1 -1
  398. package/dist/internal/option.js +6 -0
  399. package/dist/internal/option.js.map +1 -1
  400. package/dist/internal/random.d.ts +2 -0
  401. package/dist/internal/random.d.ts.map +1 -0
  402. package/dist/internal/random.js +13 -0
  403. package/dist/internal/random.js.map +1 -0
  404. package/dist/internal/rcRef.js +3 -2
  405. package/dist/internal/rcRef.js.map +1 -1
  406. package/dist/internal/references.d.ts +2 -0
  407. package/dist/internal/references.d.ts.map +1 -0
  408. package/dist/internal/references.js +51 -0
  409. package/dist/internal/references.js.map +1 -0
  410. package/dist/internal/request.js +2 -2
  411. package/dist/internal/request.js.map +1 -1
  412. package/dist/internal/schema/annotations.js +2 -0
  413. package/dist/internal/schema/annotations.js.map +1 -1
  414. package/dist/internal/schema/representation.js +75 -106
  415. package/dist/internal/schema/representation.js.map +1 -1
  416. package/dist/internal/schema/schema.js +1 -0
  417. package/dist/internal/schema/schema.js.map +1 -1
  418. package/dist/internal/schema/to-codec.js +7 -10
  419. package/dist/internal/schema/to-codec.js.map +1 -1
  420. package/dist/internal/trie.js +8 -7
  421. package/dist/internal/trie.js.map +1 -1
  422. package/dist/testing/TestClock.d.ts +8 -7
  423. package/dist/testing/TestClock.d.ts.map +1 -1
  424. package/dist/testing/TestClock.js +6 -4
  425. package/dist/testing/TestClock.js.map +1 -1
  426. package/dist/testing/TestSchema.d.ts +266 -32
  427. package/dist/testing/TestSchema.d.ts.map +1 -1
  428. package/dist/testing/TestSchema.js +296 -23
  429. package/dist/testing/TestSchema.js.map +1 -1
  430. package/dist/testing/index.d.ts +64 -1
  431. package/dist/testing/index.d.ts.map +1 -1
  432. package/dist/testing/index.js +64 -1
  433. package/dist/testing/index.js.map +1 -1
  434. package/dist/unstable/ai/AiError.d.ts +136 -54
  435. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  436. package/dist/unstable/ai/AiError.js +28 -23
  437. package/dist/unstable/ai/AiError.js.map +1 -1
  438. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
  439. package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -0
  440. package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
  441. package/dist/unstable/ai/Chat.d.ts +35 -7
  442. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  443. package/dist/unstable/ai/Chat.js +38 -44
  444. package/dist/unstable/ai/Chat.js.map +1 -1
  445. package/dist/unstable/ai/EmbeddingModel.d.ts +130 -0
  446. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -0
  447. package/dist/unstable/ai/EmbeddingModel.js +127 -0
  448. package/dist/unstable/ai/EmbeddingModel.js.map +1 -0
  449. package/dist/unstable/ai/LanguageModel.d.ts +117 -47
  450. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  451. package/dist/unstable/ai/LanguageModel.js +258 -59
  452. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  453. package/dist/unstable/ai/McpSchema.d.ts +183 -88
  454. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  455. package/dist/unstable/ai/McpSchema.js +57 -12
  456. package/dist/unstable/ai/McpSchema.js.map +1 -1
  457. package/dist/unstable/ai/McpServer.d.ts +66 -13
  458. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  459. package/dist/unstable/ai/McpServer.js +193 -51
  460. package/dist/unstable/ai/McpServer.js.map +1 -1
  461. package/dist/unstable/ai/Model.d.ts +25 -7
  462. package/dist/unstable/ai/Model.d.ts.map +1 -1
  463. package/dist/unstable/ai/Model.js +22 -6
  464. package/dist/unstable/ai/Model.js.map +1 -1
  465. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
  466. package/dist/unstable/ai/OpenAiStructuredOutput.js +4 -0
  467. package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
  468. package/dist/unstable/ai/Prompt.d.ts +20 -20
  469. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  470. package/dist/unstable/ai/Response.d.ts +26 -26
  471. package/dist/unstable/ai/Response.d.ts.map +1 -1
  472. package/dist/unstable/ai/Response.js +1 -1
  473. package/dist/unstable/ai/Response.js.map +1 -1
  474. package/dist/unstable/ai/ResponseIdTracker.d.ts +38 -0
  475. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -0
  476. package/dist/unstable/ai/ResponseIdTracker.js +68 -0
  477. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -0
  478. package/dist/unstable/ai/Tool.d.ts +34 -4
  479. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  480. package/dist/unstable/ai/Tool.js +28 -10
  481. package/dist/unstable/ai/Tool.js.map +1 -1
  482. package/dist/unstable/ai/Toolkit.d.ts +1 -1
  483. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  484. package/dist/unstable/ai/Toolkit.js +4 -11
  485. package/dist/unstable/ai/Toolkit.js.map +1 -1
  486. package/dist/unstable/ai/index.d.ts +22 -1
  487. package/dist/unstable/ai/index.d.ts.map +1 -1
  488. package/dist/unstable/ai/index.js +22 -1
  489. package/dist/unstable/ai/index.js.map +1 -1
  490. package/dist/unstable/ai/internal/codec-transformer.js +0 -5
  491. package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
  492. package/dist/unstable/cli/Argument.d.ts +2 -4
  493. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  494. package/dist/unstable/cli/Argument.js +1 -3
  495. package/dist/unstable/cli/Argument.js.map +1 -1
  496. package/dist/unstable/cli/CliError.d.ts +27 -60
  497. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  498. package/dist/unstable/cli/CliError.js +25 -57
  499. package/dist/unstable/cli/CliError.js.map +1 -1
  500. package/dist/unstable/cli/CliOutput.d.ts +3 -2
  501. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  502. package/dist/unstable/cli/CliOutput.js +65 -10
  503. package/dist/unstable/cli/CliOutput.js.map +1 -1
  504. package/dist/unstable/cli/Command.d.ts +371 -58
  505. package/dist/unstable/cli/Command.d.ts.map +1 -1
  506. package/dist/unstable/cli/Command.js +328 -67
  507. package/dist/unstable/cli/Command.js.map +1 -1
  508. package/dist/unstable/cli/Completions.d.ts +16 -0
  509. package/dist/unstable/cli/Completions.d.ts.map +1 -0
  510. package/dist/unstable/cli/Completions.js +23 -0
  511. package/dist/unstable/cli/Completions.js.map +1 -0
  512. package/dist/unstable/cli/Flag.d.ts +2 -2
  513. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  514. package/dist/unstable/cli/Flag.js +1 -1
  515. package/dist/unstable/cli/Flag.js.map +1 -1
  516. package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
  517. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
  518. package/dist/unstable/cli/GlobalFlag.js +118 -0
  519. package/dist/unstable/cli/GlobalFlag.js.map +1 -0
  520. package/dist/unstable/cli/HelpDoc.d.ts +81 -11
  521. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  522. package/dist/unstable/cli/Param.d.ts +4 -4
  523. package/dist/unstable/cli/Param.d.ts.map +1 -1
  524. package/dist/unstable/cli/Param.js +7 -7
  525. package/dist/unstable/cli/Param.js.map +1 -1
  526. package/dist/unstable/cli/Primitive.d.ts +2 -2
  527. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  528. package/dist/unstable/cli/Primitive.js +1 -1
  529. package/dist/unstable/cli/Primitive.js.map +1 -1
  530. package/dist/unstable/cli/Prompt.js +259 -85
  531. package/dist/unstable/cli/Prompt.js.map +1 -1
  532. package/dist/unstable/cli/index.d.ts +8 -0
  533. package/dist/unstable/cli/index.d.ts.map +1 -1
  534. package/dist/unstable/cli/index.js +8 -0
  535. package/dist/unstable/cli/index.js.map +1 -1
  536. package/dist/unstable/cli/internal/command.d.ts +40 -14
  537. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  538. package/dist/unstable/cli/internal/command.js +72 -46
  539. package/dist/unstable/cli/internal/command.js.map +1 -1
  540. package/dist/unstable/cli/internal/completions/CommandDescriptor.js +16 -4
  541. package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
  542. package/dist/unstable/cli/internal/config.js +42 -0
  543. package/dist/unstable/cli/internal/config.js.map +1 -1
  544. package/dist/unstable/cli/internal/help.d.ts +33 -0
  545. package/dist/unstable/cli/internal/help.d.ts.map +1 -0
  546. package/dist/unstable/cli/internal/help.js +125 -0
  547. package/dist/unstable/cli/internal/help.js.map +1 -0
  548. package/dist/unstable/cli/internal/parser.js +61 -43
  549. package/dist/unstable/cli/internal/parser.js.map +1 -1
  550. package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
  551. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  552. package/dist/unstable/cluster/ClusterCron.js +1 -1
  553. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  554. package/dist/unstable/cluster/ClusterSchema.d.ts +18 -0
  555. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  556. package/dist/unstable/cluster/ClusterSchema.js +21 -1
  557. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  558. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +3 -2
  559. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  560. package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -29
  561. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  562. package/dist/unstable/cluster/DeliverAt.js +1 -1
  563. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  564. package/dist/unstable/cluster/Entity.d.ts +10 -8
  565. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  566. package/dist/unstable/cluster/Entity.js +8 -7
  567. package/dist/unstable/cluster/Entity.js.map +1 -1
  568. package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
  569. package/dist/unstable/cluster/EntityAddress.js +1 -1
  570. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  571. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  572. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  573. package/dist/unstable/cluster/Envelope.d.ts +1 -1
  574. package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
  575. package/dist/unstable/cluster/K8sHttpClient.js +4 -4
  576. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  577. package/dist/unstable/cluster/Message.d.ts +18 -15
  578. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  579. package/dist/unstable/cluster/Message.js +15 -7
  580. package/dist/unstable/cluster/Message.js.map +1 -1
  581. package/dist/unstable/cluster/MessageStorage.d.ts +33 -10
  582. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  583. package/dist/unstable/cluster/MessageStorage.js +36 -20
  584. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  585. package/dist/unstable/cluster/Reply.d.ts +8 -7
  586. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  587. package/dist/unstable/cluster/Reply.js +4 -3
  588. package/dist/unstable/cluster/Reply.js.map +1 -1
  589. package/dist/unstable/cluster/Runner.d.ts +1 -1
  590. package/dist/unstable/cluster/Runner.d.ts.map +1 -1
  591. package/dist/unstable/cluster/Runner.js +1 -1
  592. package/dist/unstable/cluster/Runner.js.map +1 -1
  593. package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
  594. package/dist/unstable/cluster/RunnerAddress.js +1 -1
  595. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  596. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  597. package/dist/unstable/cluster/RunnerServer.js +9 -8
  598. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  599. package/dist/unstable/cluster/Runners.d.ts +2 -1
  600. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  601. package/dist/unstable/cluster/Runners.js +11 -9
  602. package/dist/unstable/cluster/Runners.js.map +1 -1
  603. package/dist/unstable/cluster/ShardId.js +3 -3
  604. package/dist/unstable/cluster/ShardId.js.map +1 -1
  605. package/dist/unstable/cluster/Sharding.d.ts +2 -2
  606. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  607. package/dist/unstable/cluster/Sharding.js +51 -39
  608. package/dist/unstable/cluster/Sharding.js.map +1 -1
  609. package/dist/unstable/cluster/ShardingConfig.d.ts +26 -25
  610. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  611. package/dist/unstable/cluster/ShardingConfig.js +24 -24
  612. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  613. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  614. package/dist/unstable/cluster/SqlMessageStorage.js +25 -19
  615. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  616. package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
  617. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  618. package/dist/unstable/cluster/internal/entityManager.js +24 -18
  619. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  620. package/dist/unstable/cluster/internal/entityReaper.js +2 -1
  621. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  622. package/dist/unstable/cluster/internal/resourceRef.js +2 -1
  623. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  624. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  625. package/dist/unstable/devtools/DevToolsClient.js +4 -3
  626. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  627. package/dist/unstable/devtools/DevToolsSchema.d.ts +40 -40
  628. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  629. package/dist/unstable/devtools/DevToolsSchema.js +9 -2
  630. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  631. package/dist/unstable/encoding/Msgpack.d.ts +1 -1
  632. package/dist/unstable/encoding/Ndjson.d.ts +9 -9
  633. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  634. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  635. package/dist/unstable/encoding/Sse.d.ts +4 -4
  636. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  637. package/dist/unstable/encoding/Sse.js +1 -1
  638. package/dist/unstable/encoding/Sse.js.map +1 -1
  639. package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
  640. package/dist/unstable/eventlog/EventJournal.js +2 -2
  641. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  642. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  643. package/dist/unstable/eventlog/EventLog.js +3 -2
  644. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  645. package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
  646. package/dist/unstable/eventlog/SqlEventLogJournal.js +2 -2
  647. package/dist/unstable/eventlog/SqlEventLogJournal.js.map +1 -1
  648. package/dist/unstable/http/Cookies.d.ts +52 -7
  649. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  650. package/dist/unstable/http/Cookies.js +27 -6
  651. package/dist/unstable/http/Cookies.js.map +1 -1
  652. package/dist/unstable/http/Etag.d.ts.map +1 -1
  653. package/dist/unstable/http/Etag.js +5 -1
  654. package/dist/unstable/http/Etag.js.map +1 -1
  655. package/dist/unstable/http/Headers.d.ts +19 -2
  656. package/dist/unstable/http/Headers.d.ts.map +1 -1
  657. package/dist/unstable/http/Headers.js +40 -11
  658. package/dist/unstable/http/Headers.js.map +1 -1
  659. package/dist/unstable/http/HttpBody.d.ts +1 -1
  660. package/dist/unstable/http/HttpClient.d.ts +117 -15
  661. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  662. package/dist/unstable/http/HttpClient.js +191 -13
  663. package/dist/unstable/http/HttpClient.js.map +1 -1
  664. package/dist/unstable/http/HttpClientError.d.ts +7 -7
  665. package/dist/unstable/http/HttpClientRequest.d.ts +43 -15
  666. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  667. package/dist/unstable/http/HttpClientRequest.js +131 -21
  668. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  669. package/dist/unstable/http/HttpClientResponse.d.ts +2 -1
  670. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  671. package/dist/unstable/http/HttpClientResponse.js +6 -1
  672. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  673. package/dist/unstable/http/HttpEffect.d.ts +7 -5
  674. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  675. package/dist/unstable/http/HttpEffect.js +46 -54
  676. package/dist/unstable/http/HttpEffect.js.map +1 -1
  677. package/dist/unstable/http/HttpIncomingMessage.d.ts +3 -2
  678. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  679. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  680. package/dist/unstable/http/HttpMethod.d.ts +4 -4
  681. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  682. package/dist/unstable/http/HttpMethod.js +3 -3
  683. package/dist/unstable/http/HttpMethod.js.map +1 -1
  684. package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
  685. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  686. package/dist/unstable/http/HttpMiddleware.js +24 -32
  687. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  688. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  689. package/dist/unstable/http/HttpPlatform.js +3 -2
  690. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  691. package/dist/unstable/http/HttpRouter.d.ts +2 -1
  692. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  693. package/dist/unstable/http/HttpRouter.js +7 -7
  694. package/dist/unstable/http/HttpRouter.js.map +1 -1
  695. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  696. package/dist/unstable/http/HttpServer.js +2 -2
  697. package/dist/unstable/http/HttpServer.js.map +1 -1
  698. package/dist/unstable/http/HttpServerError.d.ts +22 -34
  699. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  700. package/dist/unstable/http/HttpServerError.js +39 -45
  701. package/dist/unstable/http/HttpServerError.js.map +1 -1
  702. package/dist/unstable/http/HttpServerRequest.d.ts +15 -3
  703. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  704. package/dist/unstable/http/HttpServerRequest.js +301 -7
  705. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  706. package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
  707. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  708. package/dist/unstable/http/HttpServerRespondable.js +5 -5
  709. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  710. package/dist/unstable/http/HttpServerResponse.d.ts +50 -3
  711. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  712. package/dist/unstable/http/HttpServerResponse.js +236 -1
  713. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  714. package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
  715. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
  716. package/dist/unstable/http/HttpStaticServer.js +353 -0
  717. package/dist/unstable/http/HttpStaticServer.js.map +1 -0
  718. package/dist/unstable/http/HttpTraceContext.d.ts +3 -2
  719. package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
  720. package/dist/unstable/http/HttpTraceContext.js +27 -15
  721. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  722. package/dist/unstable/http/Multipart.d.ts +3 -3
  723. package/dist/unstable/http/Url.d.ts +604 -0
  724. package/dist/unstable/http/Url.d.ts.map +1 -0
  725. package/dist/unstable/http/Url.js +256 -0
  726. package/dist/unstable/http/Url.js.map +1 -0
  727. package/dist/unstable/http/UrlParams.d.ts +19 -10
  728. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  729. package/dist/unstable/http/UrlParams.js +6 -7
  730. package/dist/unstable/http/UrlParams.js.map +1 -1
  731. package/dist/unstable/http/index.d.ts +8 -0
  732. package/dist/unstable/http/index.d.ts.map +1 -1
  733. package/dist/unstable/http/index.js +8 -0
  734. package/dist/unstable/http/index.js.map +1 -1
  735. package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
  736. package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
  737. package/dist/unstable/http/internal/preResponseHandler.js +10 -0
  738. package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
  739. package/dist/unstable/httpapi/HttpApi.d.ts +4 -4
  740. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  741. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  742. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +11 -5
  743. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  744. package/dist/unstable/httpapi/HttpApiBuilder.js +40 -27
  745. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  746. package/dist/unstable/httpapi/HttpApiClient.d.ts +83 -7
  747. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  748. package/dist/unstable/httpapi/HttpApiClient.js +78 -10
  749. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  750. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +207 -101
  751. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  752. package/dist/unstable/httpapi/HttpApiEndpoint.js +49 -43
  753. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  754. package/dist/unstable/httpapi/HttpApiError.d.ts +31 -14
  755. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  756. package/dist/unstable/httpapi/HttpApiError.js +125 -32
  757. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  758. package/dist/unstable/httpapi/HttpApiGroup.d.ts +4 -3
  759. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  760. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  761. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +46 -15
  762. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  763. package/dist/unstable/httpapi/HttpApiMiddleware.js +32 -3
  764. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  765. package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
  766. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  767. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  768. package/dist/unstable/httpapi/HttpApiSchema.d.ts +6 -3
  769. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  770. package/dist/unstable/httpapi/HttpApiSchema.js +20 -2
  771. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  772. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
  773. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  774. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  775. package/dist/unstable/httpapi/OpenApi.d.ts +1 -0
  776. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  777. package/dist/unstable/httpapi/OpenApi.js +34 -26
  778. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  779. package/dist/unstable/observability/Otlp.d.ts +12 -12
  780. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  781. package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
  782. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  783. package/dist/unstable/observability/OtlpExporter.js +3 -3
  784. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  785. package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
  786. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  787. package/dist/unstable/observability/OtlpLogger.js +7 -4
  788. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  789. package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
  790. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  791. package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
  792. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  793. package/dist/unstable/observability/OtlpTracer.js +7 -3
  794. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  795. package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
  796. package/dist/unstable/persistence/KeyValueStore.js +6 -6
  797. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  798. package/dist/unstable/persistence/Persistable.d.ts +2 -2
  799. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  800. package/dist/unstable/persistence/Persistable.js +1 -1
  801. package/dist/unstable/persistence/Persistable.js.map +1 -1
  802. package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
  803. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  804. package/dist/unstable/persistence/PersistedCache.js +2 -1
  805. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  806. package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
  807. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  808. package/dist/unstable/persistence/PersistedQueue.js +12 -11
  809. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  810. package/dist/unstable/persistence/Persistence.d.ts +1 -1
  811. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  812. package/dist/unstable/persistence/Persistence.js +2 -2
  813. package/dist/unstable/persistence/Persistence.js.map +1 -1
  814. package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
  815. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  816. package/dist/unstable/persistence/RateLimiter.js +1 -1
  817. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  818. package/dist/unstable/process/ChildProcess.d.ts +5 -128
  819. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  820. package/dist/unstable/process/ChildProcess.js +1 -65
  821. package/dist/unstable/process/ChildProcess.js.map +1 -1
  822. package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -7
  823. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  824. package/dist/unstable/process/ChildProcessSpawner.js +21 -1
  825. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  826. package/dist/unstable/reactivity/Atom.d.ts +73 -12
  827. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  828. package/dist/unstable/reactivity/Atom.js +108 -25
  829. package/dist/unstable/reactivity/Atom.js.map +1 -1
  830. package/dist/unstable/reactivity/AtomHttpApi.d.ts +17 -15
  831. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  832. package/dist/unstable/reactivity/AtomHttpApi.js +45 -15
  833. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  834. package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
  835. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  836. package/dist/unstable/reactivity/AtomRegistry.js +54 -11
  837. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  838. package/dist/unstable/reactivity/AtomRpc.d.ts +9 -9
  839. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  840. package/dist/unstable/reactivity/AtomRpc.js +47 -21
  841. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  842. package/dist/unstable/reactivity/Hydration.d.ts +39 -0
  843. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
  844. package/dist/unstable/reactivity/Hydration.js +76 -0
  845. package/dist/unstable/reactivity/Hydration.js.map +1 -0
  846. package/dist/unstable/reactivity/index.d.ts +4 -0
  847. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  848. package/dist/unstable/reactivity/index.js +4 -0
  849. package/dist/unstable/reactivity/index.js.map +1 -1
  850. package/dist/unstable/rpc/Rpc.d.ts +6 -5
  851. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  852. package/dist/unstable/rpc/Rpc.js +4 -3
  853. package/dist/unstable/rpc/Rpc.js.map +1 -1
  854. package/dist/unstable/rpc/RpcClient.d.ts +5 -26
  855. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  856. package/dist/unstable/rpc/RpcClient.js +53 -43
  857. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  858. package/dist/unstable/rpc/RpcGroup.d.ts +3 -5
  859. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  860. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  861. package/dist/unstable/rpc/RpcMiddleware.d.ts +8 -8
  862. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  863. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  864. package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
  865. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  866. package/dist/unstable/rpc/RpcSchema.js +17 -2
  867. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  868. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  869. package/dist/unstable/rpc/RpcSerialization.js +39 -11
  870. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  871. package/dist/unstable/rpc/RpcServer.d.ts +6 -10
  872. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  873. package/dist/unstable/rpc/RpcServer.js +20 -19
  874. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  875. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  876. package/dist/unstable/rpc/Utils.js +3 -2
  877. package/dist/unstable/rpc/Utils.js.map +1 -1
  878. package/dist/unstable/schema/Model.d.ts +22 -1
  879. package/dist/unstable/schema/Model.d.ts.map +1 -1
  880. package/dist/unstable/schema/Model.js +15 -0
  881. package/dist/unstable/schema/Model.js.map +1 -1
  882. package/dist/unstable/schema/VariantSchema.d.ts +6 -6
  883. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  884. package/dist/unstable/schema/VariantSchema.js +6 -6
  885. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  886. package/dist/unstable/socket/Socket.d.ts +6 -5
  887. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  888. package/dist/unstable/socket/Socket.js +12 -9
  889. package/dist/unstable/socket/Socket.js.map +1 -1
  890. package/dist/unstable/socket/SocketServer.d.ts +3 -3
  891. package/dist/unstable/sql/Migrator.d.ts +1 -1
  892. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  893. package/dist/unstable/sql/Migrator.js +2 -2
  894. package/dist/unstable/sql/Migrator.js.map +1 -1
  895. package/dist/unstable/sql/SqlClient.d.ts +1 -1
  896. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  897. package/dist/unstable/sql/SqlClient.js +1 -1
  898. package/dist/unstable/sql/SqlClient.js.map +1 -1
  899. package/dist/unstable/sql/SqlError.d.ts +237 -17
  900. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  901. package/dist/unstable/sql/SqlError.js +260 -4
  902. package/dist/unstable/sql/SqlError.js.map +1 -1
  903. package/dist/unstable/sql/SqlModel.d.ts +2 -2
  904. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  905. package/dist/unstable/sql/SqlModel.js +3 -3
  906. package/dist/unstable/sql/SqlModel.js.map +1 -1
  907. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  908. package/dist/unstable/sql/SqlResolver.js +17 -8
  909. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  910. package/dist/unstable/sql/SqlSchema.d.ts +17 -6
  911. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  912. package/dist/unstable/sql/SqlSchema.js +17 -7
  913. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  914. package/dist/unstable/sql/Statement.js +0 -1
  915. package/dist/unstable/sql/Statement.js.map +1 -1
  916. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  917. package/dist/unstable/workers/Worker.js +2 -1
  918. package/dist/unstable/workers/Worker.js.map +1 -1
  919. package/dist/unstable/workflow/Activity.d.ts +5 -0
  920. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  921. package/dist/unstable/workflow/Activity.js +13 -0
  922. package/dist/unstable/workflow/Activity.js.map +1 -1
  923. package/dist/unstable/workflow/DurableClock.d.ts +3 -3
  924. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  925. package/dist/unstable/workflow/DurableClock.js +3 -3
  926. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  927. package/dist/unstable/workflow/DurableDeferred.js +8 -8
  928. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  929. package/dist/unstable/workflow/Workflow.d.ts +5 -4
  930. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  931. package/dist/unstable/workflow/Workflow.js +1 -1
  932. package/dist/unstable/workflow/Workflow.js.map +1 -1
  933. package/dist/unstable/workflow/WorkflowEngine.d.ts +17 -5
  934. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  935. package/dist/unstable/workflow/WorkflowEngine.js +153 -12
  936. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  937. package/package.json +2 -2
  938. package/src/Array.ts +304 -447
  939. package/src/BigDecimal.ts +117 -66
  940. package/src/BigInt.ts +49 -41
  941. package/src/Brand.ts +1 -1
  942. package/src/Cache.ts +9 -8
  943. package/src/Cause.ts +37 -2
  944. package/src/Channel.ts +582 -154
  945. package/src/Chunk.ts +149 -331
  946. package/src/Combiner.ts +280 -13
  947. package/src/Config.ts +195 -25
  948. package/src/Cron.ts +155 -63
  949. package/src/Data.ts +539 -376
  950. package/src/DateTime.ts +75 -256
  951. package/src/Deferred.ts +8 -6
  952. package/src/Duration.ts +122 -66
  953. package/src/Effect.ts +1484 -1157
  954. package/src/Encoding.ts +879 -0
  955. package/src/Equal.ts +278 -111
  956. package/src/Equivalence.ts +114 -52
  957. package/src/ErrorReporter.ts +458 -0
  958. package/src/Exit.ts +24 -12
  959. package/src/Fiber.ts +12 -3
  960. package/src/FiberHandle.ts +10 -9
  961. package/src/FiberMap.ts +22 -22
  962. package/src/FileSystem.ts +34 -31
  963. package/src/Filter.ts +52 -63
  964. package/src/Formatter.ts +253 -51
  965. package/src/Function.ts +2 -10
  966. package/src/Graph.ts +131 -117
  967. package/src/HashMap.ts +26 -19
  968. package/src/Iterable.ts +117 -63
  969. package/src/JsonSchema.ts +383 -10
  970. package/src/Latch.ts +194 -0
  971. package/src/Layer.ts +394 -160
  972. package/src/LayerMap.ts +11 -9
  973. package/src/LogLevel.ts +37 -0
  974. package/src/Logger.ts +33 -100
  975. package/src/ManagedRuntime.ts +35 -22
  976. package/src/Metric.ts +6 -8
  977. package/src/MutableHashMap.ts +9 -0
  978. package/src/MutableHashSet.ts +9 -0
  979. package/src/Newtype.ts +308 -0
  980. package/src/Number.ts +85 -26
  981. package/src/Optic.ts +948 -19
  982. package/src/Option.ts +34 -24
  983. package/src/Order.ts +39 -32
  984. package/src/PartitionedSemaphore.ts +288 -56
  985. package/src/Pipeable.ts +32 -1
  986. package/src/PlatformError.ts +5 -5
  987. package/src/Pool.ts +13 -11
  988. package/src/PubSub.ts +30 -20
  989. package/src/Pull.ts +1 -1
  990. package/src/Queue.ts +11 -9
  991. package/src/Random.ts +51 -14
  992. package/src/RcMap.ts +5 -5
  993. package/src/RcRef.ts +1 -1
  994. package/src/Record.ts +94 -199
  995. package/src/Reducer.ts +166 -7
  996. package/src/References.ts +283 -287
  997. package/src/Request.ts +3 -2
  998. package/src/RequestResolver.ts +29 -49
  999. package/src/Resource.ts +2 -1
  1000. package/src/Result.ts +2 -4
  1001. package/src/Runtime.ts +102 -6
  1002. package/src/Schedule.ts +458 -449
  1003. package/src/Scheduler.ts +49 -126
  1004. package/src/Schema.ts +3298 -392
  1005. package/src/SchemaAST.ts +172 -33
  1006. package/src/SchemaGetter.ts +19 -21
  1007. package/src/SchemaParser.ts +92 -27
  1008. package/src/SchemaRepresentation.ts +51 -26
  1009. package/src/SchemaTransformation.ts +198 -13
  1010. package/src/ScopedCache.ts +3 -3
  1011. package/src/Semaphore.ts +444 -0
  1012. package/src/ServiceMap.ts +144 -97
  1013. package/src/Sink.ts +83 -28
  1014. package/src/Stdio.ts +27 -4
  1015. package/src/Stream.ts +687 -617
  1016. package/src/String.ts +122 -69
  1017. package/src/Struct.ts +33 -7
  1018. package/src/SubscriptionRef.ts +101 -120
  1019. package/src/SynchronizedRef.ts +3 -2
  1020. package/src/Terminal.ts +2 -1
  1021. package/src/Tracer.ts +6 -5
  1022. package/src/Trie.ts +44 -31
  1023. package/src/TxChunk.ts +72 -53
  1024. package/src/TxDeferred.ts +394 -0
  1025. package/src/TxHashMap.ts +409 -343
  1026. package/src/TxHashSet.ts +113 -118
  1027. package/src/TxPriorityQueue.ts +766 -0
  1028. package/src/TxPubSub.ts +789 -0
  1029. package/src/TxQueue.ts +241 -251
  1030. package/src/TxReentrantLock.ts +753 -0
  1031. package/src/TxRef.ts +50 -38
  1032. package/src/TxSemaphore.ts +217 -44
  1033. package/src/TxSubscriptionRef.ts +639 -0
  1034. package/src/Types.ts +73 -19
  1035. package/src/Utils.ts +137 -111
  1036. package/src/index.ts +816 -56
  1037. package/src/internal/core.ts +12 -5
  1038. package/src/internal/dateTime.ts +91 -96
  1039. package/src/internal/effect.ts +844 -432
  1040. package/src/internal/hashMap.ts +12 -10
  1041. package/src/internal/option.ts +7 -0
  1042. package/src/internal/random.ts +20 -0
  1043. package/src/internal/rcRef.ts +4 -3
  1044. package/src/internal/references.ts +72 -0
  1045. package/src/internal/request.ts +2 -2
  1046. package/src/internal/schema/annotations.ts +2 -0
  1047. package/src/internal/schema/representation.ts +73 -94
  1048. package/src/internal/schema/schema.ts +1 -0
  1049. package/src/internal/schema/to-codec.ts +7 -17
  1050. package/src/internal/trie.ts +21 -15
  1051. package/src/testing/TestClock.ts +13 -11
  1052. package/src/testing/TestSchema.ts +332 -35
  1053. package/src/testing/index.ts +64 -1
  1054. package/src/unstable/ai/AiError.ts +111 -54
  1055. package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -0
  1056. package/src/unstable/ai/Chat.ts +134 -85
  1057. package/src/unstable/ai/EmbeddingModel.ts +209 -0
  1058. package/src/unstable/ai/LanguageModel.ts +683 -253
  1059. package/src/unstable/ai/McpSchema.ts +73 -13
  1060. package/src/unstable/ai/McpServer.ts +271 -61
  1061. package/src/unstable/ai/Model.ts +40 -9
  1062. package/src/unstable/ai/OpenAiStructuredOutput.ts +4 -0
  1063. package/src/unstable/ai/Prompt.ts +37 -37
  1064. package/src/unstable/ai/Response.ts +25 -25
  1065. package/src/unstable/ai/ResponseIdTracker.ts +97 -0
  1066. package/src/unstable/ai/Tool.ts +42 -16
  1067. package/src/unstable/ai/Toolkit.ts +5 -14
  1068. package/src/unstable/ai/index.ts +24 -1
  1069. package/src/unstable/ai/internal/codec-transformer.ts +0 -7
  1070. package/src/unstable/cli/Argument.ts +2 -4
  1071. package/src/unstable/cli/CliError.ts +47 -59
  1072. package/src/unstable/cli/CliOutput.ts +85 -13
  1073. package/src/unstable/cli/Command.ts +801 -192
  1074. package/src/unstable/cli/Completions.ts +36 -0
  1075. package/src/unstable/cli/Flag.ts +2 -2
  1076. package/src/unstable/cli/GlobalFlag.ts +242 -0
  1077. package/src/unstable/cli/HelpDoc.ts +91 -11
  1078. package/src/unstable/cli/Param.ts +15 -11
  1079. package/src/unstable/cli/Primitive.ts +2 -2
  1080. package/src/unstable/cli/Prompt.ts +265 -101
  1081. package/src/unstable/cli/index.ts +10 -0
  1082. package/src/unstable/cli/internal/command.ts +109 -63
  1083. package/src/unstable/cli/internal/completions/CommandDescriptor.ts +10 -4
  1084. package/src/unstable/cli/internal/config.ts +49 -0
  1085. package/src/unstable/cli/internal/help.ts +171 -0
  1086. package/src/unstable/cli/internal/parser.ts +71 -63
  1087. package/src/unstable/cluster/ClusterCron.ts +2 -2
  1088. package/src/unstable/cluster/ClusterSchema.ts +29 -1
  1089. package/src/unstable/cluster/ClusterWorkflowEngine.ts +62 -37
  1090. package/src/unstable/cluster/DeliverAt.ts +1 -1
  1091. package/src/unstable/cluster/Entity.ts +25 -22
  1092. package/src/unstable/cluster/EntityAddress.ts +1 -1
  1093. package/src/unstable/cluster/EntityResource.ts +4 -4
  1094. package/src/unstable/cluster/Envelope.ts +1 -1
  1095. package/src/unstable/cluster/K8sHttpClient.ts +5 -5
  1096. package/src/unstable/cluster/Message.ts +28 -15
  1097. package/src/unstable/cluster/MessageStorage.ts +66 -36
  1098. package/src/unstable/cluster/Reply.ts +7 -4
  1099. package/src/unstable/cluster/Runner.ts +1 -1
  1100. package/src/unstable/cluster/RunnerAddress.ts +1 -1
  1101. package/src/unstable/cluster/RunnerServer.ts +10 -13
  1102. package/src/unstable/cluster/Runners.ts +14 -12
  1103. package/src/unstable/cluster/ShardId.ts +2 -2
  1104. package/src/unstable/cluster/Sharding.ts +66 -49
  1105. package/src/unstable/cluster/ShardingConfig.ts +36 -37
  1106. package/src/unstable/cluster/SqlMessageStorage.ts +31 -19
  1107. package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
  1108. package/src/unstable/cluster/internal/entityManager.ts +50 -34
  1109. package/src/unstable/cluster/internal/entityReaper.ts +2 -1
  1110. package/src/unstable/cluster/internal/resourceRef.ts +2 -1
  1111. package/src/unstable/devtools/DevToolsClient.ts +23 -18
  1112. package/src/unstable/devtools/DevToolsSchema.ts +16 -3
  1113. package/src/unstable/encoding/Ndjson.ts +17 -17
  1114. package/src/unstable/encoding/Sse.ts +3 -5
  1115. package/src/unstable/eventlog/EventJournal.ts +2 -2
  1116. package/src/unstable/eventlog/EventLog.ts +3 -2
  1117. package/src/unstable/eventlog/SqlEventLogJournal.ts +2 -2
  1118. package/src/unstable/http/Cookies.ts +94 -11
  1119. package/src/unstable/http/Etag.ts +5 -3
  1120. package/src/unstable/http/Headers.ts +68 -18
  1121. package/src/unstable/http/HttpClient.ts +376 -34
  1122. package/src/unstable/http/HttpClientRequest.ts +151 -39
  1123. package/src/unstable/http/HttpClientResponse.ts +12 -6
  1124. package/src/unstable/http/HttpEffect.ts +54 -68
  1125. package/src/unstable/http/HttpIncomingMessage.ts +3 -2
  1126. package/src/unstable/http/HttpMethod.ts +16 -4
  1127. package/src/unstable/http/HttpMiddleware.ts +25 -39
  1128. package/src/unstable/http/HttpPlatform.ts +3 -2
  1129. package/src/unstable/http/HttpRouter.ts +9 -9
  1130. package/src/unstable/http/HttpServer.ts +3 -9
  1131. package/src/unstable/http/HttpServerError.ts +45 -47
  1132. package/src/unstable/http/HttpServerRequest.ts +407 -16
  1133. package/src/unstable/http/HttpServerRespondable.ts +6 -6
  1134. package/src/unstable/http/HttpServerResponse.ts +345 -7
  1135. package/src/unstable/http/HttpStaticServer.ts +456 -0
  1136. package/src/unstable/http/HttpTraceContext.ts +31 -17
  1137. package/src/unstable/http/Multipart.ts +2 -2
  1138. package/src/unstable/http/Url.ts +650 -0
  1139. package/src/unstable/http/UrlParams.ts +31 -19
  1140. package/src/unstable/http/index.ts +10 -0
  1141. package/src/unstable/http/internal/preResponseHandler.ts +15 -0
  1142. package/src/unstable/httpapi/HttpApi.ts +6 -6
  1143. package/src/unstable/httpapi/HttpApiBuilder.ts +106 -41
  1144. package/src/unstable/httpapi/HttpApiClient.ts +180 -28
  1145. package/src/unstable/httpapi/HttpApiEndpoint.ts +216 -104
  1146. package/src/unstable/httpapi/HttpApiError.ts +108 -30
  1147. package/src/unstable/httpapi/HttpApiGroup.ts +7 -6
  1148. package/src/unstable/httpapi/HttpApiMiddleware.ts +83 -22
  1149. package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
  1150. package/src/unstable/httpapi/HttpApiSchema.ts +21 -3
  1151. package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
  1152. package/src/unstable/httpapi/OpenApi.ts +44 -29
  1153. package/src/unstable/observability/Otlp.ts +12 -12
  1154. package/src/unstable/observability/OtlpExporter.ts +8 -5
  1155. package/src/unstable/observability/OtlpLogger.ts +13 -9
  1156. package/src/unstable/observability/OtlpMetrics.ts +4 -4
  1157. package/src/unstable/observability/OtlpTracer.ts +12 -8
  1158. package/src/unstable/persistence/KeyValueStore.ts +6 -6
  1159. package/src/unstable/persistence/Persistable.ts +3 -3
  1160. package/src/unstable/persistence/PersistedCache.ts +20 -9
  1161. package/src/unstable/persistence/PersistedQueue.ts +25 -24
  1162. package/src/unstable/persistence/Persistence.ts +3 -3
  1163. package/src/unstable/persistence/RateLimiter.ts +4 -4
  1164. package/src/unstable/process/ChildProcess.ts +6 -208
  1165. package/src/unstable/process/ChildProcessSpawner.ts +75 -14
  1166. package/src/unstable/reactivity/Atom.ts +212 -54
  1167. package/src/unstable/reactivity/AtomHttpApi.ts +81 -41
  1168. package/src/unstable/reactivity/AtomRegistry.ts +66 -12
  1169. package/src/unstable/reactivity/AtomRpc.ts +51 -20
  1170. package/src/unstable/reactivity/Hydration.ts +112 -0
  1171. package/src/unstable/reactivity/index.ts +5 -0
  1172. package/src/unstable/rpc/Rpc.ts +12 -12
  1173. package/src/unstable/rpc/RpcClient.ts +67 -96
  1174. package/src/unstable/rpc/RpcGroup.ts +7 -7
  1175. package/src/unstable/rpc/RpcMiddleware.ts +15 -9
  1176. package/src/unstable/rpc/RpcSchema.ts +23 -5
  1177. package/src/unstable/rpc/RpcSerialization.ts +49 -11
  1178. package/src/unstable/rpc/RpcServer.ts +31 -35
  1179. package/src/unstable/rpc/Utils.ts +3 -2
  1180. package/src/unstable/schema/Model.ts +31 -0
  1181. package/src/unstable/schema/VariantSchema.ts +10 -10
  1182. package/src/unstable/socket/Socket.ts +31 -27
  1183. package/src/unstable/sql/Migrator.ts +7 -5
  1184. package/src/unstable/sql/SqlClient.ts +6 -4
  1185. package/src/unstable/sql/SqlError.ts +365 -11
  1186. package/src/unstable/sql/SqlModel.ts +5 -5
  1187. package/src/unstable/sql/SqlResolver.ts +17 -7
  1188. package/src/unstable/sql/SqlSchema.ts +42 -26
  1189. package/src/unstable/sql/Statement.ts +0 -1
  1190. package/src/unstable/workers/Worker.ts +2 -1
  1191. package/src/unstable/workflow/Activity.ts +23 -0
  1192. package/src/unstable/workflow/DurableClock.ts +8 -8
  1193. package/src/unstable/workflow/DurableDeferred.ts +8 -8
  1194. package/src/unstable/workflow/Workflow.ts +7 -3
  1195. package/src/unstable/workflow/WorkflowEngine.ts +211 -19
  1196. package/dist/NullOr.d.ts +0 -149
  1197. package/dist/NullOr.d.ts.map +0 -1
  1198. package/dist/NullOr.js +0 -152
  1199. package/dist/NullOr.js.map +0 -1
  1200. package/dist/encoding/Base64.d.ts +0 -67
  1201. package/dist/encoding/Base64.d.ts.map +0 -1
  1202. package/dist/encoding/Base64.js +0 -146
  1203. package/dist/encoding/Base64.js.map +0 -1
  1204. package/dist/encoding/Base64Url.d.ts +0 -60
  1205. package/dist/encoding/Base64Url.d.ts.map +0 -1
  1206. package/dist/encoding/Base64Url.js +0 -89
  1207. package/dist/encoding/Base64Url.js.map +0 -1
  1208. package/dist/encoding/EncodingError.d.ts +0 -31
  1209. package/dist/encoding/EncodingError.d.ts.map +0 -1
  1210. package/dist/encoding/EncodingError.js +0 -22
  1211. package/dist/encoding/EncodingError.js.map +0 -1
  1212. package/dist/encoding/Hex.d.ts +0 -61
  1213. package/dist/encoding/Hex.d.ts.map +0 -1
  1214. package/dist/encoding/Hex.js +0 -115
  1215. package/dist/encoding/Hex.js.map +0 -1
  1216. package/dist/encoding/index.d.ts +0 -26
  1217. package/dist/encoding/index.d.ts.map +0 -1
  1218. package/dist/encoding/index.js +0 -27
  1219. package/dist/encoding/index.js.map +0 -1
  1220. package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
  1221. package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
  1222. package/dist/unstable/cli/internal/builtInFlags.js +0 -44
  1223. package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
  1224. package/dist/unstable/cli/internal/completions/Completions.d.ts +0 -2
  1225. package/dist/unstable/cli/internal/completions/Completions.d.ts.map +0 -1
  1226. package/dist/unstable/cli/internal/completions/Completions.js +0 -23
  1227. package/dist/unstable/cli/internal/completions/Completions.js.map +0 -1
  1228. package/src/NullOr.ts +0 -204
  1229. package/src/encoding/Base64.ts +0 -366
  1230. package/src/encoding/Base64Url.ts +0 -104
  1231. package/src/encoding/EncodingError.ts +0 -35
  1232. package/src/encoding/Hex.ts +0 -390
  1233. package/src/encoding/index.ts +0 -31
  1234. package/src/unstable/cli/internal/builtInFlags.ts +0 -78
  1235. package/src/unstable/cli/internal/completions/Completions.ts +0 -31
package/dist/Layer.d.ts CHANGED
@@ -19,12 +19,14 @@
19
19
  */
20
20
  import type { NonEmptyReadonlyArray } from "./Array.ts";
21
21
  import type * as Cause from "./Cause.ts";
22
+ import type * as Channel from "./Channel.ts";
22
23
  import type { Effect } from "./Effect.ts";
23
24
  import type * as Exit from "./Exit.ts";
24
25
  import type { LazyArg } from "./Function.ts";
25
26
  import { type Pipeable } from "./Pipeable.ts";
26
27
  import * as Scope from "./Scope.ts";
27
28
  import * as ServiceMap from "./ServiceMap.ts";
29
+ import type * as Stream from "./Stream.ts";
28
30
  import * as Tracer from "./Tracer.ts";
29
31
  import type * as Types from "./Types.ts";
30
32
  declare const TypeId = "~effect/Layer";
@@ -112,7 +114,7 @@ declare const MemoMapTypeId = "~effect/Layer/MemoMap";
112
114
  * const scope = yield* Effect.scope
113
115
  *
114
116
  * const dbLayer = Layer.succeed(Database)({
115
- * query: (sql: string) => Effect.succeed("result")
117
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
116
118
  * })
117
119
  * const services = yield* Layer.buildWithMemoMap(dbLayer, memoMap, scope)
118
120
  *
@@ -139,7 +141,7 @@ export interface MemoMap {
139
141
  * }>()("Database") {}
140
142
  *
141
143
  * const dbLayer = Layer.succeed(Database)({
142
- * query: (sql: string) => Effect.succeed("result")
144
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
143
145
  * })
144
146
  * const notALayer = { someProperty: "value" }
145
147
  *
@@ -223,7 +225,7 @@ export declare const fromBuildMemo: <ROut, E, RIn>(build: (memoMap: MemoMap, sco
223
225
  * const scope = yield* Effect.scope
224
226
  *
225
227
  * const dbLayer = Layer.succeed(Database)({
226
- * query: (sql: string) => Effect.succeed("result")
228
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
227
229
  * })
228
230
  * const services = yield* Layer.buildWithMemoMap(dbLayer, memoMap, scope)
229
231
  *
@@ -252,7 +254,7 @@ export declare const makeMemoMapUnsafe: () => MemoMap;
252
254
  * const scope = yield* Effect.scope
253
255
  *
254
256
  * const dbLayer = Layer.succeed(Database)({
255
- * query: (sql: string) => Effect.succeed("result")
257
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
256
258
  * })
257
259
  * const services = yield* Layer.buildWithMemoMap(dbLayer, memoMap, scope)
258
260
  *
@@ -300,13 +302,13 @@ export declare class CurrentMemoMap extends CurrentMemoMap_base {
300
302
  *
301
303
  * // Build database layer with memoization
302
304
  * const dbLayer = Layer.succeed(Database)({
303
- * query: (sql: string) => Effect.succeed("result")
305
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
304
306
  * })
305
307
  * const dbServices = yield* Layer.buildWithMemoMap(dbLayer, memoMap, scope)
306
308
  *
307
309
  * // Build logger layer with same memoization (reuses memo if same layer)
308
310
  * const loggerLayer = Layer.succeed(Logger)({
309
- * log: (msg: string) => Effect.sync(() => console.log(msg))
311
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
310
312
  * })
311
313
  * const loggerServices = yield* Layer.buildWithMemoMap(
312
314
  * loggerLayer,
@@ -348,13 +350,13 @@ export declare const buildWithMemoMap: {
348
350
  *
349
351
  * // Build database layer with memoization
350
352
  * const dbLayer = Layer.succeed(Database)({
351
- * query: (sql: string) => Effect.succeed("result")
353
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
352
354
  * })
353
355
  * const dbServices = yield* Layer.buildWithMemoMap(dbLayer, memoMap, scope)
354
356
  *
355
357
  * // Build logger layer with same memoization (reuses memo if same layer)
356
358
  * const loggerLayer = Layer.succeed(Logger)({
357
- * log: (msg: string) => Effect.sync(() => console.log(msg))
359
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
358
360
  * })
359
361
  * const loggerServices = yield* Layer.buildWithMemoMap(
360
362
  * loggerLayer,
@@ -396,13 +398,13 @@ export declare const buildWithMemoMap: {
396
398
  *
397
399
  * // Build database layer with memoization
398
400
  * const dbLayer = Layer.succeed(Database)({
399
- * query: (sql: string) => Effect.succeed("result")
401
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
400
402
  * })
401
403
  * const dbServices = yield* Layer.buildWithMemoMap(dbLayer, memoMap, scope)
402
404
  *
403
405
  * // Build logger layer with same memoization (reuses memo if same layer)
404
406
  * const loggerLayer = Layer.succeed(Logger)({
405
- * log: (msg: string) => Effect.sync(() => console.log(msg))
407
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
406
408
  * })
407
409
  * const loggerServices = yield* Layer.buildWithMemoMap(
408
410
  * loggerLayer,
@@ -436,7 +438,7 @@ export declare const buildWithMemoMap: {
436
438
  * // Build a layer to get its services
437
439
  * const program = Effect.gen(function*() {
438
440
  * const dbLayer = Layer.succeed(Database)({
439
- * query: (sql: string) => Effect.succeed("result")
441
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
440
442
  * })
441
443
  *
442
444
  * // Build the layer into ServiceMap - automatically manages scope and memoization
@@ -478,7 +480,7 @@ export declare const build: <RIn, E, ROut>(self: Layer<ROut, E, RIn>) => Effect<
478
480
  * scope,
479
481
  * Effect.sync(() => console.log("Database closed"))
480
482
  * )
481
- * return { query: (sql: string) => Effect.succeed(`Result: ${sql}`) }
483
+ * return { query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`)) }
482
484
  * }))
483
485
  *
484
486
  * // Build with specific scope - resources tied to this scope
@@ -519,7 +521,7 @@ export declare const buildWithScope: {
519
521
  * scope,
520
522
  * Effect.sync(() => console.log("Database closed"))
521
523
  * )
522
- * return { query: (sql: string) => Effect.succeed(`Result: ${sql}`) }
524
+ * return { query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`)) }
523
525
  * }))
524
526
  *
525
527
  * // Build with specific scope - resources tied to this scope
@@ -560,7 +562,7 @@ export declare const buildWithScope: {
560
562
  * scope,
561
563
  * Effect.sync(() => console.log("Database closed"))
562
564
  * )
563
- * return { query: (sql: string) => Effect.succeed(`Result: ${sql}`) }
565
+ * return { query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`)) }
564
566
  * }))
565
567
  *
566
568
  * // Build with specific scope - resources tied to this scope
@@ -594,11 +596,11 @@ export declare const buildWithScope: {
594
596
  *
595
597
  * // Create layers from concrete service implementations
596
598
  * const databaseLayer = Layer.succeed(Database)({
597
- * query: (sql: string) => Effect.succeed(`Query result: ${sql}`)
599
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Query result: ${sql}`))
598
600
  * })
599
601
  *
600
602
  * const loggerLayer = Layer.succeed(Logger)({
601
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
603
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
602
604
  * })
603
605
  *
604
606
  * // Use the layers in a program
@@ -637,11 +639,11 @@ export declare const succeed: {
637
639
  *
638
640
  * // Create layers from concrete service implementations
639
641
  * const databaseLayer = Layer.succeed(Database)({
640
- * query: (sql: string) => Effect.succeed(`Query result: ${sql}`)
642
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Query result: ${sql}`))
641
643
  * })
642
644
  *
643
645
  * const loggerLayer = Layer.succeed(Logger)({
644
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
646
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
645
647
  * })
646
648
  *
647
649
  * // Use the layers in a program
@@ -662,7 +664,7 @@ export declare const succeed: {
662
664
  * @since 2.0.0
663
665
  * @category constructors
664
666
  */
665
- <I, S>(service: ServiceMap.Service<I, S>): (resource: S) => Layer<I>;
667
+ <I, S>(service: ServiceMap.Key<I, S>): (resource: S) => Layer<I>;
666
668
  /**
667
669
  * Constructs a layer from the specified value.
668
670
  *
@@ -680,11 +682,11 @@ export declare const succeed: {
680
682
  *
681
683
  * // Create layers from concrete service implementations
682
684
  * const databaseLayer = Layer.succeed(Database)({
683
- * query: (sql: string) => Effect.succeed(`Query result: ${sql}`)
685
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Query result: ${sql}`))
684
686
  * })
685
687
  *
686
688
  * const loggerLayer = Layer.succeed(Logger)({
687
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
689
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
688
690
  * })
689
691
  *
690
692
  * // Use the layers in a program
@@ -705,7 +707,7 @@ export declare const succeed: {
705
707
  * @since 2.0.0
706
708
  * @category constructors
707
709
  */
708
- <I, S>(service: ServiceMap.Service<I, S>, resource: Types.NoInfer<S>): Layer<I>;
710
+ <I, S>(service: ServiceMap.Key<I, S>, resource: Types.NoInfer<S>): Layer<I>;
709
711
  };
710
712
  /**
711
713
  * Constructs a layer from the specified value, which must return one or more
@@ -727,7 +729,7 @@ export declare const succeed: {
727
729
  * }>()("Logger") {}
728
730
  *
729
731
  * const services = ServiceMap.make(Database, {
730
- * query: (sql: string) => Effect.succeed("result")
732
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
731
733
  * })
732
734
  * .pipe(
733
735
  * ServiceMap.add(Logger, {
@@ -804,7 +806,7 @@ export declare const sync: {
804
806
  * @since 2.0.0
805
807
  * @category constructors
806
808
  */
807
- <I, S>(service: ServiceMap.Service<I, S>): (evaluate: LazyArg<S>) => Layer<I>;
809
+ <I, S>(service: ServiceMap.Key<I, S>): (evaluate: LazyArg<S>) => Layer<I>;
808
810
  /**
809
811
  * Lazily constructs a layer from the specified value.
810
812
  *
@@ -827,7 +829,7 @@ export declare const sync: {
827
829
  * @since 2.0.0
828
830
  * @category constructors
829
831
  */
830
- <I, S>(service: ServiceMap.Service<I, S>, evaluate: LazyArg<S>): Layer<I>;
832
+ <I, S>(service: ServiceMap.Key<I, S>, evaluate: LazyArg<S>): Layer<I>;
831
833
  };
832
834
  /**
833
835
  * Lazily constructs a layer from the specified value, which must return one or more
@@ -918,7 +920,7 @@ export declare const effect: {
918
920
  * @since 2.0.0
919
921
  * @category constructors
920
922
  */
921
- <I, S>(service: ServiceMap.Service<I, S>): <E, R>(effect: Effect<S, E, R>) => Layer<I, E, Exclude<R, Scope.Scope>>;
923
+ <I, S>(service: ServiceMap.Key<I, S>): <E, R>(effect: Effect<S, E, R>) => Layer<I, E, Exclude<R, Scope.Scope>>;
922
924
  /**
923
925
  * Constructs a layer from the specified scoped effect.
924
926
  *
@@ -950,7 +952,7 @@ export declare const effect: {
950
952
  * @since 2.0.0
951
953
  * @category constructors
952
954
  */
953
- <I, S, E, R>(service: ServiceMap.Service<I, S>, effect: Effect<S, E, R>): Layer<I, E, Exclude<R, Scope.Scope>>;
955
+ <I, S, E, R>(service: ServiceMap.Key<I, S>, effect: Effect<S, E, R>): Layer<I, E, Exclude<R, Scope.Scope>>;
954
956
  };
955
957
  /**
956
958
  * Constructs a layer from the specified scoped effect, which must return one
@@ -1022,7 +1024,7 @@ export declare const effectDiscard: <X, E, R>(effect: Effect<X, E, R>) => Layer<
1022
1024
  * }>()("Database") {}
1023
1025
  *
1024
1026
  * const layerEffect = Effect.succeed(
1025
- * Layer.succeed(Database)({ query: (sql: string) => Effect.succeed("result") })
1027
+ * Layer.succeed(Database)({ query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result")) })
1026
1028
  * )
1027
1029
  *
1028
1030
  * const unwrappedLayer = Layer.unwrap(layerEffect)
@@ -1051,10 +1053,10 @@ export declare const unwrap: <A, E1, R1, E, R>(self: Effect<Layer<A, E1, R1>, E,
1051
1053
  * }>()("Logger") {}
1052
1054
  *
1053
1055
  * const dbLayer = Layer.succeed(Database)({
1054
- * query: (sql: string) => Effect.succeed("result")
1056
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
1055
1057
  * })
1056
1058
  * const loggerLayer = Layer.succeed(Logger)({
1057
- * log: (msg: string) => Effect.sync(() => console.log(msg))
1059
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
1058
1060
  * })
1059
1061
  *
1060
1062
  * const mergedLayer = Layer.mergeAll(dbLayer, loggerLayer)
@@ -1083,10 +1085,10 @@ export declare const mergeAll: <Layers extends [Layer<never, any, any>, ...Array
1083
1085
  * }>()("Logger") {}
1084
1086
  *
1085
1087
  * const dbLayer = Layer.succeed(Database)({
1086
- * query: (sql: string) => Effect.succeed("result")
1088
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
1087
1089
  * })
1088
1090
  * const loggerLayer = Layer.succeed(Logger)({
1089
- * log: (msg: string) => Effect.sync(() => console.log(msg))
1091
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
1090
1092
  * })
1091
1093
  *
1092
1094
  * const mergedLayer = Layer.merge(dbLayer, loggerLayer)
@@ -1115,10 +1117,10 @@ export declare const merge: {
1115
1117
  * }>()("Logger") {}
1116
1118
  *
1117
1119
  * const dbLayer = Layer.succeed(Database)({
1118
- * query: (sql: string) => Effect.succeed("result")
1120
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
1119
1121
  * })
1120
1122
  * const loggerLayer = Layer.succeed(Logger)({
1121
- * log: (msg: string) => Effect.sync(() => console.log(msg))
1123
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
1122
1124
  * })
1123
1125
  *
1124
1126
  * const mergedLayer = Layer.merge(dbLayer, loggerLayer)
@@ -1147,10 +1149,10 @@ export declare const merge: {
1147
1149
  * }>()("Logger") {}
1148
1150
  *
1149
1151
  * const dbLayer = Layer.succeed(Database)({
1150
- * query: (sql: string) => Effect.succeed("result")
1152
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
1151
1153
  * })
1152
1154
  * const loggerLayer = Layer.succeed(Logger)({
1153
- * log: (msg: string) => Effect.sync(() => console.log(msg))
1155
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
1154
1156
  * })
1155
1157
  *
1156
1158
  * const mergedLayer = Layer.merge(dbLayer, loggerLayer)
@@ -1179,10 +1181,10 @@ export declare const merge: {
1179
1181
  * }>()("Logger") {}
1180
1182
  *
1181
1183
  * const dbLayer = Layer.succeed(Database)({
1182
- * query: (sql: string) => Effect.succeed("result")
1184
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
1183
1185
  * })
1184
1186
  * const loggerLayer = Layer.succeed(Logger)({
1185
- * log: (msg: string) => Effect.sync(() => console.log(msg))
1187
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
1186
1188
  * })
1187
1189
  *
1188
1190
  * const mergedLayer = Layer.merge(dbLayer, loggerLayer)
@@ -1211,10 +1213,10 @@ export declare const merge: {
1211
1213
  * }>()("Logger") {}
1212
1214
  *
1213
1215
  * const dbLayer = Layer.succeed(Database)({
1214
- * query: (sql: string) => Effect.succeed("result")
1216
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
1215
1217
  * })
1216
1218
  * const loggerLayer = Layer.succeed(Logger)({
1217
- * log: (msg: string) => Effect.sync(() => console.log(msg))
1219
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
1218
1220
  * })
1219
1221
  *
1220
1222
  * const mergedLayer = Layer.merge(dbLayer, loggerLayer)
@@ -1251,11 +1253,11 @@ export declare const merge: {
1251
1253
  *
1252
1254
  * // Create dependency layers
1253
1255
  * const databaseLayer = Layer.succeed(Database)({
1254
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1256
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1255
1257
  * })
1256
1258
  *
1257
1259
  * const loggerLayer = Layer.succeed(Logger)({
1258
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1260
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1259
1261
  * })
1260
1262
  *
1261
1263
  * // UserService depends on Database and Logger
@@ -1264,8 +1266,7 @@ export declare const merge: {
1264
1266
  * const logger = yield* Logger
1265
1267
  *
1266
1268
  * return {
1267
- * getUser: (id: string) =>
1268
- * Effect.gen(function*() {
1269
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1269
1270
  * yield* logger.log(`Looking up user ${id}`)
1270
1271
  * const result = yield* database.query(
1271
1272
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1319,11 +1320,11 @@ export declare const provide: {
1319
1320
  *
1320
1321
  * // Create dependency layers
1321
1322
  * const databaseLayer = Layer.succeed(Database)({
1322
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1323
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1323
1324
  * })
1324
1325
  *
1325
1326
  * const loggerLayer = Layer.succeed(Logger)({
1326
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1327
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1327
1328
  * })
1328
1329
  *
1329
1330
  * // UserService depends on Database and Logger
@@ -1332,8 +1333,7 @@ export declare const provide: {
1332
1333
  * const logger = yield* Logger
1333
1334
  *
1334
1335
  * return {
1335
- * getUser: (id: string) =>
1336
- * Effect.gen(function*() {
1336
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1337
1337
  * yield* logger.log(`Looking up user ${id}`)
1338
1338
  * const result = yield* database.query(
1339
1339
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1387,11 +1387,11 @@ export declare const provide: {
1387
1387
  *
1388
1388
  * // Create dependency layers
1389
1389
  * const databaseLayer = Layer.succeed(Database)({
1390
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1390
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1391
1391
  * })
1392
1392
  *
1393
1393
  * const loggerLayer = Layer.succeed(Logger)({
1394
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1394
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1395
1395
  * })
1396
1396
  *
1397
1397
  * // UserService depends on Database and Logger
@@ -1400,8 +1400,7 @@ export declare const provide: {
1400
1400
  * const logger = yield* Logger
1401
1401
  *
1402
1402
  * return {
1403
- * getUser: (id: string) =>
1404
- * Effect.gen(function*() {
1403
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1405
1404
  * yield* logger.log(`Looking up user ${id}`)
1406
1405
  * const result = yield* database.query(
1407
1406
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1455,11 +1454,11 @@ export declare const provide: {
1455
1454
  *
1456
1455
  * // Create dependency layers
1457
1456
  * const databaseLayer = Layer.succeed(Database)({
1458
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1457
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1459
1458
  * })
1460
1459
  *
1461
1460
  * const loggerLayer = Layer.succeed(Logger)({
1462
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1461
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1463
1462
  * })
1464
1463
  *
1465
1464
  * // UserService depends on Database and Logger
@@ -1468,8 +1467,7 @@ export declare const provide: {
1468
1467
  * const logger = yield* Logger
1469
1468
  *
1470
1469
  * return {
1471
- * getUser: (id: string) =>
1472
- * Effect.gen(function*() {
1470
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1473
1471
  * yield* logger.log(`Looking up user ${id}`)
1474
1472
  * const result = yield* database.query(
1475
1473
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1523,11 +1521,11 @@ export declare const provide: {
1523
1521
  *
1524
1522
  * // Create dependency layers
1525
1523
  * const databaseLayer = Layer.succeed(Database)({
1526
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1524
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1527
1525
  * })
1528
1526
  *
1529
1527
  * const loggerLayer = Layer.succeed(Logger)({
1530
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1528
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1531
1529
  * })
1532
1530
  *
1533
1531
  * // UserService depends on Database and Logger
@@ -1536,8 +1534,7 @@ export declare const provide: {
1536
1534
  * const logger = yield* Logger
1537
1535
  *
1538
1536
  * return {
1539
- * getUser: (id: string) =>
1540
- * Effect.gen(function*() {
1537
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1541
1538
  * yield* logger.log(`Looking up user ${id}`)
1542
1539
  * const result = yield* database.query(
1543
1540
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1592,11 +1589,11 @@ export declare const provide: {
1592
1589
  *
1593
1590
  * // Create dependency layers
1594
1591
  * const databaseLayer = Layer.succeed(Database)({
1595
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1592
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1596
1593
  * })
1597
1594
  *
1598
1595
  * const loggerLayer = Layer.succeed(Logger)({
1599
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1596
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1600
1597
  * })
1601
1598
  *
1602
1599
  * // UserService depends on Database and Logger
@@ -1605,8 +1602,7 @@ export declare const provide: {
1605
1602
  * const logger = yield* Logger
1606
1603
  *
1607
1604
  * return {
1608
- * getUser: (id: string) =>
1609
- * Effect.gen(function*() {
1605
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1610
1606
  * yield* logger.log(`Looking up user ${id}`)
1611
1607
  * const result = yield* database.query(
1612
1608
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1666,11 +1662,11 @@ export declare const provideMerge: {
1666
1662
  *
1667
1663
  * // Create dependency layers
1668
1664
  * const databaseLayer = Layer.succeed(Database)({
1669
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1665
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1670
1666
  * })
1671
1667
  *
1672
1668
  * const loggerLayer = Layer.succeed(Logger)({
1673
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1669
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1674
1670
  * })
1675
1671
  *
1676
1672
  * // UserService depends on Database and Logger
@@ -1679,8 +1675,7 @@ export declare const provideMerge: {
1679
1675
  * const logger = yield* Logger
1680
1676
  *
1681
1677
  * return {
1682
- * getUser: (id: string) =>
1683
- * Effect.gen(function*() {
1678
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1684
1679
  * yield* logger.log(`Looking up user ${id}`)
1685
1680
  * const result = yield* database.query(
1686
1681
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1740,11 +1735,11 @@ export declare const provideMerge: {
1740
1735
  *
1741
1736
  * // Create dependency layers
1742
1737
  * const databaseLayer = Layer.succeed(Database)({
1743
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1738
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1744
1739
  * })
1745
1740
  *
1746
1741
  * const loggerLayer = Layer.succeed(Logger)({
1747
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1742
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1748
1743
  * })
1749
1744
  *
1750
1745
  * // UserService depends on Database and Logger
@@ -1753,8 +1748,7 @@ export declare const provideMerge: {
1753
1748
  * const logger = yield* Logger
1754
1749
  *
1755
1750
  * return {
1756
- * getUser: (id: string) =>
1757
- * Effect.gen(function*() {
1751
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1758
1752
  * yield* logger.log(`Looking up user ${id}`)
1759
1753
  * const result = yield* database.query(
1760
1754
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1814,11 +1808,11 @@ export declare const provideMerge: {
1814
1808
  *
1815
1809
  * // Create dependency layers
1816
1810
  * const databaseLayer = Layer.succeed(Database)({
1817
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1811
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1818
1812
  * })
1819
1813
  *
1820
1814
  * const loggerLayer = Layer.succeed(Logger)({
1821
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1815
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1822
1816
  * })
1823
1817
  *
1824
1818
  * // UserService depends on Database and Logger
@@ -1827,8 +1821,7 @@ export declare const provideMerge: {
1827
1821
  * const logger = yield* Logger
1828
1822
  *
1829
1823
  * return {
1830
- * getUser: (id: string) =>
1831
- * Effect.gen(function*() {
1824
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1832
1825
  * yield* logger.log(`Looking up user ${id}`)
1833
1826
  * const result = yield* database.query(
1834
1827
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1888,11 +1881,11 @@ export declare const provideMerge: {
1888
1881
  *
1889
1882
  * // Create dependency layers
1890
1883
  * const databaseLayer = Layer.succeed(Database)({
1891
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
1884
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
1892
1885
  * })
1893
1886
  *
1894
1887
  * const loggerLayer = Layer.succeed(Logger)({
1895
- * log: (msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`))
1888
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(`[LOG] ${msg}`)))
1896
1889
  * })
1897
1890
  *
1898
1891
  * // UserService depends on Database and Logger
@@ -1901,8 +1894,7 @@ export declare const provideMerge: {
1901
1894
  * const logger = yield* Logger
1902
1895
  *
1903
1896
  * return {
1904
- * getUser: (id: string) =>
1905
- * Effect.gen(function*() {
1897
+ * getUser: Effect.fn("UserService.getUser")(function*(id: string) {
1906
1898
  * yield* logger.log(`Looking up user ${id}`)
1907
1899
  * const result = yield* database.query(
1908
1900
  * `SELECT * FROM users WHERE id = ${id}`
@@ -1970,18 +1962,19 @@ export declare const provideMerge: {
1970
1962
  *
1971
1963
  * // Create database layer based on config
1972
1964
  * const dbLayer = Layer.succeed(Database)({
1973
- * query: (sql: string) =>
1965
+ * query: Effect.fn("Database.query")((sql: string) =>
1974
1966
  * Effect.succeed(
1975
1967
  * `Querying ${config.dbUrl}: ${sql}`
1976
- * )
1968
+ * ))
1977
1969
  * })
1978
1970
  *
1979
1971
  * // Create logger layer based on config
1980
1972
  * const loggerLayer = Layer.succeed(Logger)({
1981
- * log: (msg: string) =>
1973
+ * log: Effect.fn("Logger.log")((msg: string) =>
1982
1974
  * config.logLevel === "debug"
1983
1975
  * ? Effect.sync(() => console.log(`[DEBUG] ${msg}`))
1984
1976
  * : Effect.sync(() => console.log(msg))
1977
+ * )
1985
1978
  * })
1986
1979
  *
1987
1980
  * // Return combined layer
@@ -2040,18 +2033,19 @@ export declare const flatMap: {
2040
2033
  *
2041
2034
  * // Create database layer based on config
2042
2035
  * const dbLayer = Layer.succeed(Database)({
2043
- * query: (sql: string) =>
2036
+ * query: Effect.fn("Database.query")((sql: string) =>
2044
2037
  * Effect.succeed(
2045
2038
  * `Querying ${config.dbUrl}: ${sql}`
2046
- * )
2039
+ * ))
2047
2040
  * })
2048
2041
  *
2049
2042
  * // Create logger layer based on config
2050
2043
  * const loggerLayer = Layer.succeed(Logger)({
2051
- * log: (msg: string) =>
2044
+ * log: Effect.fn("Logger.log")((msg: string) =>
2052
2045
  * config.logLevel === "debug"
2053
2046
  * ? Effect.sync(() => console.log(`[DEBUG] ${msg}`))
2054
2047
  * : Effect.sync(() => console.log(msg))
2048
+ * )
2055
2049
  * })
2056
2050
  *
2057
2051
  * // Return combined layer
@@ -2110,18 +2104,19 @@ export declare const flatMap: {
2110
2104
  *
2111
2105
  * // Create database layer based on config
2112
2106
  * const dbLayer = Layer.succeed(Database)({
2113
- * query: (sql: string) =>
2107
+ * query: Effect.fn("Database.query")((sql: string) =>
2114
2108
  * Effect.succeed(
2115
2109
  * `Querying ${config.dbUrl}: ${sql}`
2116
- * )
2110
+ * ))
2117
2111
  * })
2118
2112
  *
2119
2113
  * // Create logger layer based on config
2120
2114
  * const loggerLayer = Layer.succeed(Logger)({
2121
- * log: (msg: string) =>
2115
+ * log: Effect.fn("Logger.log")((msg: string) =>
2122
2116
  * config.logLevel === "debug"
2123
2117
  * ? Effect.sync(() => console.log(`[DEBUG] ${msg}`))
2124
2118
  * : Effect.sync(() => console.log(msg))
2119
+ * )
2125
2120
  * })
2126
2121
  *
2127
2122
  * // Return combined layer
@@ -2148,6 +2143,90 @@ export declare const flatMap: {
2148
2143
  */
2149
2144
  <A, E, R, A2, E2, R2>(self: Layer<A, E, R>, f: (context: ServiceMap.ServiceMap<A>) => Layer<A2, E2, R2>): Layer<A2, E | E2, R | R2>;
2150
2145
  };
2146
+ /**
2147
+ * Performs the specified effect if this layer succeeds.
2148
+ *
2149
+ * @since 4.0.0
2150
+ * @category sequencing
2151
+ */
2152
+ export declare const tap: {
2153
+ /**
2154
+ * Performs the specified effect if this layer succeeds.
2155
+ *
2156
+ * @since 4.0.0
2157
+ * @category sequencing
2158
+ */
2159
+ <ROut, XR extends ROut, RIn2, E2, X>(f: (context: ServiceMap.ServiceMap<XR>) => Effect<X, E2, RIn2>): <RIn, E>(self: Layer<ROut, E, RIn>) => Layer<ROut, E | E2, RIn | Exclude<RIn2, Scope.Scope>>;
2160
+ /**
2161
+ * Performs the specified effect if this layer succeeds.
2162
+ *
2163
+ * @since 4.0.0
2164
+ * @category sequencing
2165
+ */
2166
+ <RIn, E, ROut, XR extends ROut, RIn2, E2, X>(self: Layer<ROut, E, RIn>, f: (context: ServiceMap.ServiceMap<XR>) => Effect<X, E2, RIn2>): Layer<ROut, E | E2, RIn | Exclude<RIn2, Scope.Scope>>;
2167
+ };
2168
+ /**
2169
+ * Performs the specified effect if this layer fails.
2170
+ *
2171
+ * @since 4.0.0
2172
+ * @category sequencing
2173
+ */
2174
+ export declare const tapError: {
2175
+ /**
2176
+ * Performs the specified effect if this layer fails.
2177
+ *
2178
+ * @since 4.0.0
2179
+ * @category sequencing
2180
+ */
2181
+ <E, XE extends E, RIn2, E2, X>(f: (e: XE) => Effect<X, E2, RIn2>): <RIn, ROut>(self: Layer<ROut, E, RIn>) => Layer<ROut, E | E2, RIn | Exclude<RIn2, Scope.Scope>>;
2182
+ /**
2183
+ * Performs the specified effect if this layer fails.
2184
+ *
2185
+ * @since 4.0.0
2186
+ * @category sequencing
2187
+ */
2188
+ <RIn, E, XE extends E, ROut, RIn2, E2, X>(self: Layer<ROut, E, RIn>, f: (e: XE) => Effect<X, E2, RIn2>): Layer<ROut, E | E2, RIn | Exclude<RIn2, Scope.Scope>>;
2189
+ };
2190
+ /**
2191
+ * Performs the specified effect if this layer fails.
2192
+ *
2193
+ * **Previously Known As**
2194
+ *
2195
+ * This API replaces the following from Effect 3.x:
2196
+ *
2197
+ * - `Layer.tapErrorCause`
2198
+ *
2199
+ * @since 4.0.0
2200
+ * @category sequencing
2201
+ */
2202
+ export declare const tapCause: {
2203
+ /**
2204
+ * Performs the specified effect if this layer fails.
2205
+ *
2206
+ * **Previously Known As**
2207
+ *
2208
+ * This API replaces the following from Effect 3.x:
2209
+ *
2210
+ * - `Layer.tapErrorCause`
2211
+ *
2212
+ * @since 4.0.0
2213
+ * @category sequencing
2214
+ */
2215
+ <E, XE extends E, RIn2, E2, X>(f: (cause: Cause.Cause<XE>) => Effect<X, E2, RIn2>): <RIn, ROut>(self: Layer<ROut, E, RIn>) => Layer<ROut, E | E2, RIn | Exclude<RIn2, Scope.Scope>>;
2216
+ /**
2217
+ * Performs the specified effect if this layer fails.
2218
+ *
2219
+ * **Previously Known As**
2220
+ *
2221
+ * This API replaces the following from Effect 3.x:
2222
+ *
2223
+ * - `Layer.tapErrorCause`
2224
+ *
2225
+ * @since 4.0.0
2226
+ * @category sequencing
2227
+ */
2228
+ <RIn, E, XE extends E, ROut, RIn2, E2, X>(self: Layer<ROut, E, RIn>, f: (cause: Cause.Cause<XE>) => Effect<X, E2, RIn2>): Layer<ROut, E | E2, RIn | Exclude<RIn2, Scope.Scope>>;
2229
+ };
2151
2230
  /**
2152
2231
  * Translates effect failure into death of the fiber, making all failures
2153
2232
  * unchecked and not a part of the type of the layer.
@@ -2169,10 +2248,10 @@ export declare const flatMap: {
2169
2248
  * // Simulate a database connection that might fail
2170
2249
  * const shouldFail = Math.random() > 0.5
2171
2250
  * if (shouldFail) {
2172
- * yield* Effect.fail(new DatabaseError({ message: "Connection failed" }))
2251
+ * return yield* new DatabaseError({ message: "Connection failed" })
2173
2252
  * }
2174
2253
  *
2175
- * return { query: (sql: string) => Effect.succeed(`Result: ${sql}`) }
2254
+ * return { query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`)) }
2176
2255
  * }))
2177
2256
  *
2178
2257
  * // Convert failures to fiber death - removes error from type
@@ -2310,8 +2389,8 @@ export declare const catchTag: {
2310
2389
  *
2311
2390
  * // Primary database layer that might fail
2312
2391
  * const primaryDatabaseLayer = Layer.effect(Database)(Effect.gen(function*() {
2313
- * yield* Effect.fail(new DatabaseError({ message: "Primary DB unreachable" }))
2314
- * return { query: (sql: string) => Effect.succeed(`Primary: ${sql}`) }
2392
+ * return yield* new DatabaseError({ message: "Primary DB unreachable" })
2393
+ * return { query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Primary: ${sql}`)) }
2315
2394
  * }))
2316
2395
  *
2317
2396
  * // Fallback layers for different error causes
@@ -2320,11 +2399,12 @@ export declare const catchTag: {
2320
2399
  * // For any cause/error, fallback to in-memory database
2321
2400
  * return Layer.mergeAll(
2322
2401
  * Layer.succeed(Database)({
2323
- * query: (sql: string) => Effect.succeed(`Memory: ${sql}`)
2402
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Memory: ${sql}`))
2324
2403
  * }),
2325
2404
  * Layer.succeed(Logger)({
2326
- * log: (msg: string) =>
2405
+ * log: Effect.fn("Logger.log")((msg: string) =>
2327
2406
  * Effect.sync(() => console.log(`[FALLBACK] ${msg}`))
2407
+ * )
2328
2408
  * })
2329
2409
  * )
2330
2410
  * })
@@ -2367,8 +2447,8 @@ export declare const catchCause: {
2367
2447
  *
2368
2448
  * // Primary database layer that might fail
2369
2449
  * const primaryDatabaseLayer = Layer.effect(Database)(Effect.gen(function*() {
2370
- * yield* Effect.fail(new DatabaseError({ message: "Primary DB unreachable" }))
2371
- * return { query: (sql: string) => Effect.succeed(`Primary: ${sql}`) }
2450
+ * return yield* new DatabaseError({ message: "Primary DB unreachable" })
2451
+ * return { query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Primary: ${sql}`)) }
2372
2452
  * }))
2373
2453
  *
2374
2454
  * // Fallback layers for different error causes
@@ -2377,11 +2457,12 @@ export declare const catchCause: {
2377
2457
  * // For any cause/error, fallback to in-memory database
2378
2458
  * return Layer.mergeAll(
2379
2459
  * Layer.succeed(Database)({
2380
- * query: (sql: string) => Effect.succeed(`Memory: ${sql}`)
2460
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Memory: ${sql}`))
2381
2461
  * }),
2382
2462
  * Layer.succeed(Logger)({
2383
- * log: (msg: string) =>
2463
+ * log: Effect.fn("Logger.log")((msg: string) =>
2384
2464
  * Effect.sync(() => console.log(`[FALLBACK] ${msg}`))
2465
+ * )
2385
2466
  * })
2386
2467
  * )
2387
2468
  * })
@@ -2424,8 +2505,8 @@ export declare const catchCause: {
2424
2505
  *
2425
2506
  * // Primary database layer that might fail
2426
2507
  * const primaryDatabaseLayer = Layer.effect(Database)(Effect.gen(function*() {
2427
- * yield* Effect.fail(new DatabaseError({ message: "Primary DB unreachable" }))
2428
- * return { query: (sql: string) => Effect.succeed(`Primary: ${sql}`) }
2508
+ * return yield* new DatabaseError({ message: "Primary DB unreachable" })
2509
+ * return { query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Primary: ${sql}`)) }
2429
2510
  * }))
2430
2511
  *
2431
2512
  * // Fallback layers for different error causes
@@ -2434,11 +2515,12 @@ export declare const catchCause: {
2434
2515
  * // For any cause/error, fallback to in-memory database
2435
2516
  * return Layer.mergeAll(
2436
2517
  * Layer.succeed(Database)({
2437
- * query: (sql: string) => Effect.succeed(`Memory: ${sql}`)
2518
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Memory: ${sql}`))
2438
2519
  * }),
2439
2520
  * Layer.succeed(Logger)({
2440
- * log: (msg: string) =>
2521
+ * log: Effect.fn("Logger.log")((msg: string) =>
2441
2522
  * Effect.sync(() => console.log(`[FALLBACK] ${msg}`))
2523
+ * )
2442
2524
  * })
2443
2525
  * )
2444
2526
  * })
@@ -2494,7 +2576,7 @@ export declare const updateService: {
2494
2576
  * @since 3.13.0
2495
2577
  * @category utils
2496
2578
  */
2497
- <I, A>(service: ServiceMap.Service<I, A>, f: (a: A) => A): <A1, E1, R1>(layer: Layer<A1, E1, R1>) => Layer<A1, E1, I | R1>;
2579
+ <I, A>(service: ServiceMap.Key<I, A>, f: (a: A) => A): <A1, E1, R1>(layer: Layer<A1, E1, R1>) => Layer<A1, E1, I | R1>;
2498
2580
  /**
2499
2581
  * Updates a service in the context with a new implementation.
2500
2582
  *
@@ -2513,7 +2595,7 @@ export declare const updateService: {
2513
2595
  * @since 3.13.0
2514
2596
  * @category utils
2515
2597
  */
2516
- <A1, E1, R1, I, A>(layer: Layer<A1, E1, R1>, service: ServiceMap.Service<I, A>, f: (a: A) => A): Layer<A1, E1, I | R1>;
2598
+ <A1, E1, R1, I, A>(layer: Layer<A1, E1, R1>, service: ServiceMap.Key<I, A>, f: (a: A) => A): Layer<A1, E1, I | R1>;
2517
2599
  };
2518
2600
  /**
2519
2601
  * Creates a fresh version of this layer that will not be shared.
@@ -2532,10 +2614,11 @@ export declare const updateService: {
2532
2614
  * const ref = yield* Ref.make(0)
2533
2615
  * return {
2534
2616
  * count: 0,
2535
- * increment: () =>
2617
+ * increment: Effect.fn("Counter.increment")(() =>
2536
2618
  * Ref.update(ref, (n) => n + 1).pipe(
2537
2619
  * Effect.flatMap(() => Ref.get(ref))
2538
2620
  * )
2621
+ * )
2539
2622
  * }
2540
2623
  * }))
2541
2624
  *
@@ -2588,13 +2671,11 @@ export declare const fresh: <A, E, R>(self: Layer<A, E, R>) => Layer<A, E, R>;
2588
2671
  * yield* Console.log("Starting HTTP server...")
2589
2672
  *
2590
2673
  * return {
2591
- * start: () =>
2592
- * Effect.gen(function*() {
2674
+ * start: Effect.fn("HttpServer.start")(function*() {
2593
2675
  * yield* Console.log("Server listening on port 3000")
2594
2676
  * return "Server started"
2595
2677
  * }),
2596
- * stop: () =>
2597
- * Effect.gen(function*() {
2678
+ * stop: Effect.fn("HttpServer.stop")(function*() {
2598
2679
  * yield* Console.log("Server stopped gracefully")
2599
2680
  * return "Server stopped"
2600
2681
  * })
@@ -2602,7 +2683,7 @@ export declare const fresh: <A, E, R>(self: Layer<A, E, R>) => Layer<A, E, R>;
2602
2683
  * }))
2603
2684
  *
2604
2685
  * const loggerLayer = Layer.succeed(Logger)({
2605
- * log: (msg: string) => Console.log(`[LOG] ${msg}`)
2686
+ * log: Effect.fn("Logger.log")((msg: string) => Console.log(`[LOG] ${msg}`))
2606
2687
  * })
2607
2688
  *
2608
2689
  * // Application layer combining all services
@@ -2634,10 +2715,11 @@ export declare const launch: <RIn, E, ROut>(self: Layer<ROut, E, RIn>) => Effect
2634
2715
  * @category Testing
2635
2716
  */
2636
2717
  export type PartialEffectful<A extends object> = Types.Simplify<{
2637
- [K in keyof A as A[K] extends Effect<any, any, any> | ((...args: any) => Effect<any, any, any>) ? K : never]?: A[K];
2718
+ [K in keyof A as A[K] extends AnyEffectOrStream ? K : never]?: A[K];
2638
2719
  } & {
2639
- [K in keyof A as A[K] extends Effect<any, any, any> | ((...args: any) => Effect<any, any, any>) ? never : K]: A[K];
2720
+ [K in keyof A as A[K] extends AnyEffectOrStream ? never : K]: A[K];
2640
2721
  }>;
2722
+ type AnyEffectOrStream = Effect<any, any, any> | Stream.Stream<any, any, any> | Channel.Channel<any, any, any, any, any, any, any> | ((...args: any) => Effect<any, any, any>) | ((...args: any) => Stream.Stream<any, any, any>) | ((...args: any) => Channel.Channel<any, any, any, any, any, any, any>);
2641
2723
  /**
2642
2724
  * Creates a mock layer for testing purposes. You can provide a partial
2643
2725
  * implementation of the service, and any methods not provided will
@@ -2660,7 +2742,7 @@ export type PartialEffectful<A extends object> = Types.Simplify<{
2660
2742
  * }>()("UserService") {}
2661
2743
  *
2662
2744
  * // Create a partial mock - only implement what you need for testing
2663
- * const testUserLayer = Layer.mock(UserService)({
2745
+ * const testUserLayer = Layer.mock(UserService, {
2664
2746
  * config: { apiUrl: "https://test-api.com" }, // Required - non-Effect property
2665
2747
  * getUser: (id: string) => Effect.succeed({ id, name: "Test User" }) // Mock implementation
2666
2748
  * // deleteUser and updateUser are omitted - will throw UnimplementedError if called
@@ -2684,7 +2766,102 @@ export type PartialEffectful<A extends object> = Types.Simplify<{
2684
2766
  * @since 4.0.0
2685
2767
  * @category Testing
2686
2768
  */
2687
- export declare const mock: <I, S extends object>(service: ServiceMap.Service<I, S>) => (implementation: PartialEffectful<S>) => Layer<I>;
2769
+ export declare const mock: {
2770
+ /**
2771
+ * Creates a mock layer for testing purposes. You can provide a partial
2772
+ * implementation of the service, and any methods not provided will
2773
+ * throw an unimplemented defect when called.
2774
+ *
2775
+ * @example
2776
+ * ```ts
2777
+ * import { Effect, Layer, ServiceMap } from "effect"
2778
+ *
2779
+ * class UserService extends ServiceMap.Service<UserService, {
2780
+ * readonly config: { apiUrl: string }
2781
+ * readonly getUser: (
2782
+ * id: string
2783
+ * ) => Effect.Effect<{ id: string; name: string }, Error>
2784
+ * readonly deleteUser: (id: string) => Effect.Effect<void, Error>
2785
+ * readonly updateUser: (
2786
+ * id: string,
2787
+ * data: object
2788
+ * ) => Effect.Effect<{ id: string; name: string }, Error>
2789
+ * }>()("UserService") {}
2790
+ *
2791
+ * // Create a partial mock - only implement what you need for testing
2792
+ * const testUserLayer = Layer.mock(UserService, {
2793
+ * config: { apiUrl: "https://test-api.com" }, // Required - non-Effect property
2794
+ * getUser: (id: string) => Effect.succeed({ id, name: "Test User" }) // Mock implementation
2795
+ * // deleteUser and updateUser are omitted - will throw UnimplementedError if called
2796
+ * })
2797
+ *
2798
+ * // Use in tests
2799
+ * const testProgram = Effect.gen(function*() {
2800
+ * const userService = yield* UserService
2801
+ *
2802
+ * // This works - we provided an implementation
2803
+ * const user = yield* userService.getUser("123")
2804
+ * console.log(user.name) // "Test User"
2805
+ *
2806
+ * // This would throw - we didn't implement deleteUser
2807
+ * // yield* userService.deleteUser("123") // UnimplementedError
2808
+ * }).pipe(
2809
+ * Effect.provide(testUserLayer)
2810
+ * )
2811
+ * ```
2812
+ *
2813
+ * @since 4.0.0
2814
+ * @category Testing
2815
+ */
2816
+ <I, S extends object>(service: ServiceMap.Key<I, S>): (implementation: PartialEffectful<S>) => Layer<I>;
2817
+ /**
2818
+ * Creates a mock layer for testing purposes. You can provide a partial
2819
+ * implementation of the service, and any methods not provided will
2820
+ * throw an unimplemented defect when called.
2821
+ *
2822
+ * @example
2823
+ * ```ts
2824
+ * import { Effect, Layer, ServiceMap } from "effect"
2825
+ *
2826
+ * class UserService extends ServiceMap.Service<UserService, {
2827
+ * readonly config: { apiUrl: string }
2828
+ * readonly getUser: (
2829
+ * id: string
2830
+ * ) => Effect.Effect<{ id: string; name: string }, Error>
2831
+ * readonly deleteUser: (id: string) => Effect.Effect<void, Error>
2832
+ * readonly updateUser: (
2833
+ * id: string,
2834
+ * data: object
2835
+ * ) => Effect.Effect<{ id: string; name: string }, Error>
2836
+ * }>()("UserService") {}
2837
+ *
2838
+ * // Create a partial mock - only implement what you need for testing
2839
+ * const testUserLayer = Layer.mock(UserService, {
2840
+ * config: { apiUrl: "https://test-api.com" }, // Required - non-Effect property
2841
+ * getUser: (id: string) => Effect.succeed({ id, name: "Test User" }) // Mock implementation
2842
+ * // deleteUser and updateUser are omitted - will throw UnimplementedError if called
2843
+ * })
2844
+ *
2845
+ * // Use in tests
2846
+ * const testProgram = Effect.gen(function*() {
2847
+ * const userService = yield* UserService
2848
+ *
2849
+ * // This works - we provided an implementation
2850
+ * const user = yield* userService.getUser("123")
2851
+ * console.log(user.name) // "Test User"
2852
+ *
2853
+ * // This would throw - we didn't implement deleteUser
2854
+ * // yield* userService.deleteUser("123") // UnimplementedError
2855
+ * }).pipe(
2856
+ * Effect.provide(testUserLayer)
2857
+ * )
2858
+ * ```
2859
+ *
2860
+ * @since 4.0.0
2861
+ * @category Testing
2862
+ */
2863
+ <I, S extends object>(service: ServiceMap.Key<I, S>, implementation: Types.NoInfer<PartialEffectful<S>>): Layer<I>;
2864
+ };
2688
2865
  /**
2689
2866
  * Ensures that an layer's success type extends a given type `ROut`.
2690
2867
  *
@@ -2815,7 +2992,7 @@ export interface SpanOptions extends Tracer.SpanOptions {
2815
2992
  * yield* Console.log((parentSpan as Tracer.Span).name) // "database-init"
2816
2993
  *
2817
2994
  * return {
2818
- * query: (sql: string) => Effect.succeed(`Result: ${sql}`)
2995
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`))
2819
2996
  * }
2820
2997
  * })).pipe(Layer.provide(Layer.span("database-init")))
2821
2998
  *
@@ -2859,7 +3036,7 @@ export declare const span: (name: string, options?: SpanOptions) => Layer<Tracer
2859
3036
  * yield* Console.log(parentSpan.spanId) // "42"
2860
3037
  *
2861
3038
  * return {
2862
- * query: (sql: string) => Effect.succeed(`Result: ${sql}`)
3039
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`))
2863
3040
  * }
2864
3041
  * })
2865
3042
  * ).pipe(Layer.provide(Layer.parentSpan(Tracer.externalSpan({
@@ -2897,14 +3074,14 @@ export declare const parentSpan: (span: Tracer.AnySpan) => Layer<Tracer.ParentSp
2897
3074
  * yield* Effect.log("Connecting to database")
2898
3075
  * yield* Effect.sleep("100 millis")
2899
3076
  * return {
2900
- * query: (sql: string) => Effect.succeed(`Result: ${sql}`)
3077
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`))
2901
3078
  * }
2902
3079
  * })).pipe(Layer.withSpan("database-initialization", {
2903
3080
  * attributes: { dbType: "postgres" }
2904
3081
  * }))
2905
3082
  *
2906
3083
  * const loggerLayer = Layer.succeed(Logger, {
2907
- * log: (msg: string) => Effect.sync(() => console.log(msg))
3084
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
2908
3085
  * }).pipe(Layer.withSpan("logger-initialization"))
2909
3086
  *
2910
3087
  * // Combine traced layers
@@ -2956,14 +3133,14 @@ export declare const withSpan: {
2956
3133
  * yield* Effect.log("Connecting to database")
2957
3134
  * yield* Effect.sleep("100 millis")
2958
3135
  * return {
2959
- * query: (sql: string) => Effect.succeed(`Result: ${sql}`)
3136
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`))
2960
3137
  * }
2961
3138
  * })).pipe(Layer.withSpan("database-initialization", {
2962
3139
  * attributes: { dbType: "postgres" }
2963
3140
  * }))
2964
3141
  *
2965
3142
  * const loggerLayer = Layer.succeed(Logger, {
2966
- * log: (msg: string) => Effect.sync(() => console.log(msg))
3143
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
2967
3144
  * }).pipe(Layer.withSpan("logger-initialization"))
2968
3145
  *
2969
3146
  * // Combine traced layers
@@ -3015,14 +3192,14 @@ export declare const withSpan: {
3015
3192
  * yield* Effect.log("Connecting to database")
3016
3193
  * yield* Effect.sleep("100 millis")
3017
3194
  * return {
3018
- * query: (sql: string) => Effect.succeed(`Result: ${sql}`)
3195
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result: ${sql}`))
3019
3196
  * }
3020
3197
  * })).pipe(Layer.withSpan("database-initialization", {
3021
3198
  * attributes: { dbType: "postgres" }
3022
3199
  * }))
3023
3200
  *
3024
3201
  * const loggerLayer = Layer.succeed(Logger, {
3025
- * log: (msg: string) => Effect.sync(() => console.log(msg))
3202
+ * log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
3026
3203
  * }).pipe(Layer.withSpan("logger-initialization"))
3027
3204
  *
3028
3205
  * // Combine traced layers
@@ -3073,14 +3250,14 @@ export declare const withSpan: {
3073
3250
  * const DatabaseLayer = Layer.effect(Database, Effect.gen(function*() {
3074
3251
  * yield* Effect.log("Connecting to database")
3075
3252
  * return {
3076
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
3253
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
3077
3254
  * }
3078
3255
  * }))
3079
3256
  *
3080
3257
  * const CacheLayer = Layer.effect(Cache, Effect.gen(function*() {
3081
3258
  * yield* Effect.log("Connecting to cache")
3082
3259
  * return {
3083
- * get: (key: string) => Effect.succeed(`Cache: ${key}`)
3260
+ * get: Effect.fn("Cache.get")((key: string) => Effect.succeed(`Cache: ${key}`))
3084
3261
  * }
3085
3262
  * }))
3086
3263
  *
@@ -3133,14 +3310,14 @@ export declare const withParentSpan: {
3133
3310
  * const DatabaseLayer = Layer.effect(Database, Effect.gen(function*() {
3134
3311
  * yield* Effect.log("Connecting to database")
3135
3312
  * return {
3136
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
3313
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
3137
3314
  * }
3138
3315
  * }))
3139
3316
  *
3140
3317
  * const CacheLayer = Layer.effect(Cache, Effect.gen(function*() {
3141
3318
  * yield* Effect.log("Connecting to cache")
3142
3319
  * return {
3143
- * get: (key: string) => Effect.succeed(`Cache: ${key}`)
3320
+ * get: Effect.fn("Cache.get")((key: string) => Effect.succeed(`Cache: ${key}`))
3144
3321
  * }
3145
3322
  * }))
3146
3323
  *
@@ -3193,14 +3370,14 @@ export declare const withParentSpan: {
3193
3370
  * const DatabaseLayer = Layer.effect(Database, Effect.gen(function*() {
3194
3371
  * yield* Effect.log("Connecting to database")
3195
3372
  * return {
3196
- * query: (sql: string) => Effect.succeed(`DB: ${sql}`)
3373
+ * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`DB: ${sql}`))
3197
3374
  * }
3198
3375
  * }))
3199
3376
  *
3200
3377
  * const CacheLayer = Layer.effect(Cache, Effect.gen(function*() {
3201
3378
  * yield* Effect.log("Connecting to cache")
3202
3379
  * return {
3203
- * get: (key: string) => Effect.succeed(`Cache: ${key}`)
3380
+ * get: Effect.fn("Cache.get")((key: string) => Effect.succeed(`Cache: ${key}`))
3204
3381
  * }
3205
3382
  * }))
3206
3383
  *