effect 4.0.0-beta.43 → 4.0.0-beta.45

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 (918) hide show
  1. package/dist/Cache.d.ts +12 -43
  2. package/dist/Cache.d.ts.map +1 -1
  3. package/dist/Cache.js +15 -42
  4. package/dist/Cache.js.map +1 -1
  5. package/dist/Cause.d.ts +21 -21
  6. package/dist/Cause.d.ts.map +1 -1
  7. package/dist/Cause.js +89 -10
  8. package/dist/Cause.js.map +1 -1
  9. package/dist/Channel.d.ts +42 -19
  10. package/dist/Channel.d.ts.map +1 -1
  11. package/dist/Channel.js +86 -46
  12. package/dist/Channel.js.map +1 -1
  13. package/dist/Clock.d.ts +2 -2
  14. package/dist/Clock.d.ts.map +1 -1
  15. package/dist/Clock.js.map +1 -1
  16. package/dist/Config.d.ts +2 -2
  17. package/dist/ConfigProvider.d.ts +5 -5
  18. package/dist/ConfigProvider.d.ts.map +1 -1
  19. package/dist/ConfigProvider.js +5 -5
  20. package/dist/ConfigProvider.js.map +1 -1
  21. package/dist/Console.d.ts +2 -2
  22. package/dist/Console.d.ts.map +1 -1
  23. package/dist/Console.js.map +1 -1
  24. package/dist/Context.d.ts +1150 -0
  25. package/dist/Context.d.ts.map +1 -0
  26. package/dist/{ServiceMap.js → Context.js} +139 -139
  27. package/dist/Context.js.map +1 -0
  28. package/dist/DateTime.d.ts +2 -2
  29. package/dist/DateTime.d.ts.map +1 -1
  30. package/dist/DateTime.js +2 -2
  31. package/dist/DateTime.js.map +1 -1
  32. package/dist/Effect.d.ts +177 -177
  33. package/dist/Effect.d.ts.map +1 -1
  34. package/dist/Effect.js +81 -81
  35. package/dist/Effect.js.map +1 -1
  36. package/dist/Equal.d.ts.map +1 -1
  37. package/dist/Equal.js +16 -0
  38. package/dist/Equal.js.map +1 -1
  39. package/dist/ErrorReporter.d.ts +3 -3
  40. package/dist/ErrorReporter.d.ts.map +1 -1
  41. package/dist/ErrorReporter.js +1 -1
  42. package/dist/ErrorReporter.js.map +1 -1
  43. package/dist/ExecutionPlan.d.ts +6 -6
  44. package/dist/ExecutionPlan.d.ts.map +1 -1
  45. package/dist/ExecutionPlan.js +4 -4
  46. package/dist/ExecutionPlan.js.map +1 -1
  47. package/dist/Fiber.d.ts +7 -7
  48. package/dist/Fiber.d.ts.map +1 -1
  49. package/dist/Fiber.js.map +1 -1
  50. package/dist/FiberHandle.d.ts +2 -2
  51. package/dist/FiberHandle.d.ts.map +1 -1
  52. package/dist/FiberHandle.js +4 -4
  53. package/dist/FiberHandle.js.map +1 -1
  54. package/dist/FiberMap.d.ts +2 -2
  55. package/dist/FiberMap.d.ts.map +1 -1
  56. package/dist/FiberMap.js +4 -4
  57. package/dist/FiberMap.js.map +1 -1
  58. package/dist/FiberSet.d.ts +2 -2
  59. package/dist/FiberSet.d.ts.map +1 -1
  60. package/dist/FiberSet.js +4 -4
  61. package/dist/FiberSet.js.map +1 -1
  62. package/dist/FileSystem.d.ts +3 -3
  63. package/dist/FileSystem.d.ts.map +1 -1
  64. package/dist/FileSystem.js +3 -3
  65. package/dist/FileSystem.js.map +1 -1
  66. package/dist/Hash.js +1 -1
  67. package/dist/Hash.js.map +1 -1
  68. package/dist/Layer.d.ts +286 -268
  69. package/dist/Layer.d.ts.map +1 -1
  70. package/dist/Layer.js +133 -134
  71. package/dist/Layer.js.map +1 -1
  72. package/dist/LayerMap.d.ts +18 -18
  73. package/dist/LayerMap.d.ts.map +1 -1
  74. package/dist/LayerMap.js +18 -15
  75. package/dist/LayerMap.js.map +1 -1
  76. package/dist/Logger.d.ts +3 -3
  77. package/dist/Logger.d.ts.map +1 -1
  78. package/dist/Logger.js.map +1 -1
  79. package/dist/ManagedRuntime.d.ts +6 -6
  80. package/dist/ManagedRuntime.d.ts.map +1 -1
  81. package/dist/ManagedRuntime.js +18 -21
  82. package/dist/ManagedRuntime.js.map +1 -1
  83. package/dist/Metric.d.ts +19 -19
  84. package/dist/Metric.d.ts.map +1 -1
  85. package/dist/Metric.js +21 -21
  86. package/dist/Metric.js.map +1 -1
  87. package/dist/Path.d.ts +2 -2
  88. package/dist/Path.d.ts.map +1 -1
  89. package/dist/Path.js +2 -2
  90. package/dist/Path.js.map +1 -1
  91. package/dist/Pool.d.ts.map +1 -1
  92. package/dist/Pool.js +4 -4
  93. package/dist/Pool.js.map +1 -1
  94. package/dist/PubSub.d.ts.map +1 -1
  95. package/dist/PubSub.js +3 -3
  96. package/dist/PubSub.js.map +1 -1
  97. package/dist/Random.d.ts +2 -2
  98. package/dist/Random.d.ts.map +1 -1
  99. package/dist/Random.js +0 -23
  100. package/dist/Random.js.map +1 -1
  101. package/dist/RcMap.d.ts +2 -2
  102. package/dist/RcMap.d.ts.map +1 -1
  103. package/dist/RcMap.js +12 -12
  104. package/dist/RcMap.js.map +1 -1
  105. package/dist/Redactable.d.ts +139 -62
  106. package/dist/Redactable.d.ts.map +1 -1
  107. package/dist/Redactable.js +59 -55
  108. package/dist/Redactable.js.map +1 -1
  109. package/dist/References.d.ts +26 -14
  110. package/dist/References.d.ts.map +1 -1
  111. package/dist/References.js +0 -12
  112. package/dist/References.js.map +1 -1
  113. package/dist/Request.d.ts +5 -5
  114. package/dist/Request.d.ts.map +1 -1
  115. package/dist/Request.js.map +1 -1
  116. package/dist/RequestResolver.d.ts.map +1 -1
  117. package/dist/RequestResolver.js +6 -7
  118. package/dist/RequestResolver.js.map +1 -1
  119. package/dist/Resource.d.ts +0 -3
  120. package/dist/Resource.d.ts.map +1 -1
  121. package/dist/Resource.js +3 -3
  122. package/dist/Resource.js.map +1 -1
  123. package/dist/Schedule.d.ts +2 -2
  124. package/dist/Schedule.d.ts.map +1 -1
  125. package/dist/Schedule.js +2 -2
  126. package/dist/Schedule.js.map +1 -1
  127. package/dist/Scheduler.d.ts +4 -4
  128. package/dist/Scheduler.d.ts.map +1 -1
  129. package/dist/Scheduler.js +7 -4
  130. package/dist/Scheduler.js.map +1 -1
  131. package/dist/Schema.d.ts +531 -214
  132. package/dist/Schema.d.ts.map +1 -1
  133. package/dist/Schema.js +304 -103
  134. package/dist/Schema.js.map +1 -1
  135. package/dist/SchemaAST.d.ts.map +1 -1
  136. package/dist/SchemaAST.js +5 -15
  137. package/dist/SchemaAST.js.map +1 -1
  138. package/dist/SchemaGetter.d.ts +49 -5
  139. package/dist/SchemaGetter.d.ts.map +1 -1
  140. package/dist/SchemaGetter.js +64 -5
  141. package/dist/SchemaGetter.js.map +1 -1
  142. package/dist/SchemaTransformation.d.ts +145 -0
  143. package/dist/SchemaTransformation.d.ts.map +1 -1
  144. package/dist/SchemaTransformation.js +146 -0
  145. package/dist/SchemaTransformation.js.map +1 -1
  146. package/dist/Scope.d.ts +2 -2
  147. package/dist/Scope.d.ts.map +1 -1
  148. package/dist/Scope.js.map +1 -1
  149. package/dist/ScopedCache.d.ts.map +1 -1
  150. package/dist/ScopedCache.js +4 -4
  151. package/dist/ScopedCache.js.map +1 -1
  152. package/dist/Semaphore.d.ts +1 -1
  153. package/dist/Semaphore.d.ts.map +1 -1
  154. package/dist/Semaphore.js +1 -3
  155. package/dist/Semaphore.js.map +1 -1
  156. package/dist/Sink.d.ts +6 -6
  157. package/dist/Sink.d.ts.map +1 -1
  158. package/dist/Sink.js +1 -1
  159. package/dist/Sink.js.map +1 -1
  160. package/dist/Stdio.d.ts +2 -2
  161. package/dist/Stdio.d.ts.map +1 -1
  162. package/dist/Stdio.js +2 -2
  163. package/dist/Stdio.js.map +1 -1
  164. package/dist/Stream.d.ts +187 -117
  165. package/dist/Stream.d.ts.map +1 -1
  166. package/dist/Stream.js +133 -57
  167. package/dist/Stream.js.map +1 -1
  168. package/dist/Terminal.d.ts +3 -3
  169. package/dist/Terminal.d.ts.map +1 -1
  170. package/dist/Terminal.js +2 -2
  171. package/dist/Terminal.js.map +1 -1
  172. package/dist/Tracer.d.ts +16 -16
  173. package/dist/Tracer.d.ts.map +1 -1
  174. package/dist/Tracer.js +11 -8
  175. package/dist/Tracer.js.map +1 -1
  176. package/dist/Unify.d.ts +8 -2
  177. package/dist/Unify.d.ts.map +1 -1
  178. package/dist/Unify.js.map +1 -1
  179. package/dist/index.d.ts +81 -15
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +81 -15
  182. package/dist/index.js.map +1 -1
  183. package/dist/internal/core.js.map +1 -1
  184. package/dist/internal/effect.js +74 -74
  185. package/dist/internal/effect.js.map +1 -1
  186. package/dist/internal/layer.js +3 -3
  187. package/dist/internal/layer.js.map +1 -1
  188. package/dist/internal/random.js +2 -2
  189. package/dist/internal/random.js.map +1 -1
  190. package/dist/internal/rcRef.js +9 -9
  191. package/dist/internal/rcRef.js.map +1 -1
  192. package/dist/internal/references.js +13 -13
  193. package/dist/internal/references.js.map +1 -1
  194. package/dist/internal/request.js +6 -6
  195. package/dist/internal/request.js.map +1 -1
  196. package/dist/internal/schedule.js +1 -1
  197. package/dist/internal/schedule.js.map +1 -1
  198. package/dist/internal/schema/representation.js +11 -1
  199. package/dist/internal/schema/representation.js.map +1 -1
  200. package/dist/internal/schema/schema.d.ts +10 -1
  201. package/dist/internal/schema/schema.d.ts.map +1 -1
  202. package/dist/internal/schema/schema.js +21 -1
  203. package/dist/internal/schema/schema.js.map +1 -1
  204. package/dist/testing/TestSchema.d.ts +3 -3
  205. package/dist/testing/TestSchema.d.ts.map +1 -1
  206. package/dist/testing/TestSchema.js.map +1 -1
  207. package/dist/unstable/ai/AiError.d.ts +19 -19
  208. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  209. package/dist/unstable/ai/AiError.js +2 -1
  210. package/dist/unstable/ai/AiError.js.map +1 -1
  211. package/dist/unstable/ai/Chat.d.ts +4 -4
  212. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  213. package/dist/unstable/ai/Chat.js +3 -3
  214. package/dist/unstable/ai/Chat.js.map +1 -1
  215. package/dist/unstable/ai/EmbeddingModel.d.ts +6 -6
  216. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  217. package/dist/unstable/ai/EmbeddingModel.js +3 -3
  218. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  219. package/dist/unstable/ai/IdGenerator.d.ts +2 -2
  220. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  221. package/dist/unstable/ai/IdGenerator.js +2 -2
  222. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  223. package/dist/unstable/ai/LanguageModel.d.ts +2 -2
  224. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  225. package/dist/unstable/ai/LanguageModel.js +2 -2
  226. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  227. package/dist/unstable/ai/McpSchema.d.ts +54 -54
  228. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  229. package/dist/unstable/ai/McpSchema.js +15 -8
  230. package/dist/unstable/ai/McpSchema.js.map +1 -1
  231. package/dist/unstable/ai/McpServer.d.ts +22 -22
  232. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  233. package/dist/unstable/ai/McpServer.js +49 -46
  234. package/dist/unstable/ai/McpServer.js.map +1 -1
  235. package/dist/unstable/ai/Model.d.ts +3 -3
  236. package/dist/unstable/ai/Model.d.ts.map +1 -1
  237. package/dist/unstable/ai/Model.js +5 -5
  238. package/dist/unstable/ai/Model.js.map +1 -1
  239. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  240. package/dist/unstable/ai/Prompt.js +6 -9
  241. package/dist/unstable/ai/Prompt.js.map +1 -1
  242. package/dist/unstable/ai/Response.d.ts +1 -1
  243. package/dist/unstable/ai/Response.d.ts.map +1 -1
  244. package/dist/unstable/ai/Response.js +6 -7
  245. package/dist/unstable/ai/Response.js.map +1 -1
  246. package/dist/unstable/ai/ResponseIdTracker.d.ts +2 -2
  247. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  248. package/dist/unstable/ai/ResponseIdTracker.js +2 -2
  249. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  250. package/dist/unstable/ai/Telemetry.d.ts +35 -2
  251. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  252. package/dist/unstable/ai/Telemetry.js +2 -2
  253. package/dist/unstable/ai/Telemetry.js.map +1 -1
  254. package/dist/unstable/ai/Tokenizer.d.ts +2 -2
  255. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  256. package/dist/unstable/ai/Tokenizer.js +2 -2
  257. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  258. package/dist/unstable/ai/Tool.d.ts +16 -16
  259. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  260. package/dist/unstable/ai/Tool.js +41 -13
  261. package/dist/unstable/ai/Tool.js.map +1 -1
  262. package/dist/unstable/ai/Toolkit.d.ts +3 -3
  263. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  264. package/dist/unstable/ai/Toolkit.js +10 -10
  265. package/dist/unstable/ai/Toolkit.js.map +1 -1
  266. package/dist/unstable/cli/Argument.d.ts +2 -3
  267. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  268. package/dist/unstable/cli/Argument.js.map +1 -1
  269. package/dist/unstable/cli/CliError.d.ts +29 -8
  270. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  271. package/dist/unstable/cli/CliError.js +8 -1
  272. package/dist/unstable/cli/CliError.js.map +1 -1
  273. package/dist/unstable/cli/CliOutput.d.ts +2 -2
  274. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  275. package/dist/unstable/cli/CliOutput.js +2 -2
  276. package/dist/unstable/cli/CliOutput.js.map +1 -1
  277. package/dist/unstable/cli/Command.d.ts +14 -14
  278. package/dist/unstable/cli/Command.d.ts.map +1 -1
  279. package/dist/unstable/cli/Command.js +11 -10
  280. package/dist/unstable/cli/Command.js.map +1 -1
  281. package/dist/unstable/cli/Flag.d.ts +2 -3
  282. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  283. package/dist/unstable/cli/Flag.js.map +1 -1
  284. package/dist/unstable/cli/GlobalFlag.d.ts +2 -2
  285. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  286. package/dist/unstable/cli/GlobalFlag.js +2 -2
  287. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  288. package/dist/unstable/cli/HelpDoc.d.ts +8 -8
  289. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  290. package/dist/unstable/cli/Param.d.ts +30 -2
  291. package/dist/unstable/cli/Param.d.ts.map +1 -1
  292. package/dist/unstable/cli/Param.js +17 -7
  293. package/dist/unstable/cli/Param.js.map +1 -1
  294. package/dist/unstable/cli/Prompt.js +8 -2
  295. package/dist/unstable/cli/Prompt.js.map +1 -1
  296. package/dist/unstable/cli/internal/command.d.ts +5 -5
  297. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  298. package/dist/unstable/cli/internal/command.js +3 -3
  299. package/dist/unstable/cli/internal/command.js.map +1 -1
  300. package/dist/unstable/cli/internal/parser.js +94 -15
  301. package/dist/unstable/cli/internal/parser.js.map +1 -1
  302. package/dist/unstable/cluster/ClusterError.d.ts +7 -7
  303. package/dist/unstable/cluster/ClusterSchema.d.ts +12 -9
  304. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  305. package/dist/unstable/cluster/ClusterSchema.js +9 -9
  306. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  307. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  308. package/dist/unstable/cluster/ClusterWorkflowEngine.js +13 -14
  309. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  310. package/dist/unstable/cluster/Entity.d.ts +8 -8
  311. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  312. package/dist/unstable/cluster/Entity.js +12 -12
  313. package/dist/unstable/cluster/Entity.js.map +1 -1
  314. package/dist/unstable/cluster/EntityAddress.d.ts +2 -2
  315. package/dist/unstable/cluster/EntityProxy.js +3 -3
  316. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  317. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  318. package/dist/unstable/cluster/EntityProxyServer.js +4 -4
  319. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  320. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  321. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  322. package/dist/unstable/cluster/EntityResource.js +2 -2
  323. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  324. package/dist/unstable/cluster/Envelope.d.ts +3 -3
  325. package/dist/unstable/cluster/HttpRunner.js +2 -2
  326. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  327. package/dist/unstable/cluster/K8sHttpClient.d.ts +4 -4
  328. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  329. package/dist/unstable/cluster/K8sHttpClient.js +2 -2
  330. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  331. package/dist/unstable/cluster/Message.d.ts +7 -4
  332. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  333. package/dist/unstable/cluster/Message.js +5 -5
  334. package/dist/unstable/cluster/Message.js.map +1 -1
  335. package/dist/unstable/cluster/MessageStorage.d.ts +14 -14
  336. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  337. package/dist/unstable/cluster/MessageStorage.js +8 -8
  338. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  339. package/dist/unstable/cluster/Reply.d.ts +2 -2
  340. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  341. package/dist/unstable/cluster/Reply.js +5 -5
  342. package/dist/unstable/cluster/Reply.js.map +1 -1
  343. package/dist/unstable/cluster/Runner.d.ts +1 -1
  344. package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
  345. package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
  346. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  347. package/dist/unstable/cluster/RunnerHealth.js +2 -2
  348. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  349. package/dist/unstable/cluster/RunnerServer.js +1 -1
  350. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  351. package/dist/unstable/cluster/RunnerStorage.d.ts +12 -12
  352. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  353. package/dist/unstable/cluster/RunnerStorage.js +3 -3
  354. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  355. package/dist/unstable/cluster/Runners.d.ts +3 -3
  356. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  357. package/dist/unstable/cluster/Runners.js +7 -7
  358. package/dist/unstable/cluster/Runners.js.map +1 -1
  359. package/dist/unstable/cluster/ShardId.d.ts +35 -49
  360. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  361. package/dist/unstable/cluster/ShardId.js +65 -67
  362. package/dist/unstable/cluster/ShardId.js.map +1 -1
  363. package/dist/unstable/cluster/Sharding.d.ts +2 -2
  364. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  365. package/dist/unstable/cluster/Sharding.js +21 -21
  366. package/dist/unstable/cluster/Sharding.js.map +1 -1
  367. package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
  368. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  369. package/dist/unstable/cluster/ShardingConfig.js +5 -5
  370. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  371. package/dist/unstable/cluster/SingletonAddress.d.ts +2 -2
  372. package/dist/unstable/cluster/Snowflake.d.ts +2 -2
  373. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  374. package/dist/unstable/cluster/Snowflake.js +2 -2
  375. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  376. package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
  377. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  378. package/dist/unstable/cluster/internal/entityManager.js +15 -14
  379. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  380. package/dist/unstable/cluster/internal/entityReaper.js +2 -2
  381. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  382. package/dist/unstable/cluster/internal/resourceMap.js +3 -3
  383. package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
  384. package/dist/unstable/devtools/DevToolsClient.d.ts +2 -2
  385. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  386. package/dist/unstable/devtools/DevToolsClient.js +5 -5
  387. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  388. package/dist/unstable/eventlog/Event.d.ts +0 -6
  389. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  390. package/dist/unstable/eventlog/Event.js +0 -5
  391. package/dist/unstable/eventlog/Event.js.map +1 -1
  392. package/dist/unstable/eventlog/EventGroup.d.ts +0 -2
  393. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  394. package/dist/unstable/eventlog/EventGroup.js +0 -2
  395. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  396. package/dist/unstable/eventlog/EventJournal.d.ts +26 -9
  397. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  398. package/dist/unstable/eventlog/EventJournal.js +128 -69
  399. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  400. package/dist/unstable/eventlog/EventLog.d.ts +91 -37
  401. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  402. package/dist/unstable/eventlog/EventLog.js +223 -149
  403. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  404. package/dist/unstable/eventlog/EventLogEncryption.d.ts +11 -9
  405. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  406. package/dist/unstable/eventlog/EventLogEncryption.js +15 -17
  407. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  408. package/dist/unstable/eventlog/EventLogMessage.d.ts +228 -0
  409. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -0
  410. package/dist/unstable/eventlog/EventLogMessage.js +214 -0
  411. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -0
  412. package/dist/unstable/eventlog/EventLogRemote.d.ts +111 -193
  413. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  414. package/dist/unstable/eventlog/EventLogRemote.js +167 -322
  415. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  416. package/dist/unstable/eventlog/EventLogServer.d.ts +26 -48
  417. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  418. package/dist/unstable/eventlog/EventLogServer.js +128 -199
  419. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  420. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +60 -0
  421. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -0
  422. package/dist/unstable/eventlog/EventLogServerEncrypted.js +166 -0
  423. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -0
  424. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +183 -0
  425. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -0
  426. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +461 -0
  427. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -0
  428. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +117 -0
  429. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -0
  430. package/dist/unstable/eventlog/EventLogSessionAuth.js +284 -0
  431. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -0
  432. package/dist/unstable/eventlog/{SqlEventLogJournal.d.ts → SqlEventJournal.d.ts} +2 -2
  433. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -0
  434. package/dist/unstable/eventlog/{SqlEventLogJournal.js → SqlEventJournal.js} +20 -14
  435. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -0
  436. package/dist/unstable/eventlog/{SqlEventLogServer.d.ts → SqlEventLogServerEncrypted.d.ts} +5 -5
  437. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -0
  438. package/dist/unstable/eventlog/{SqlEventLogServer.js → SqlEventLogServerEncrypted.js} +65 -24
  439. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -0
  440. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +25 -0
  441. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -0
  442. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +354 -0
  443. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -0
  444. package/dist/unstable/eventlog/index.d.ts +22 -2
  445. package/dist/unstable/eventlog/index.d.ts.map +1 -1
  446. package/dist/unstable/eventlog/index.js +22 -2
  447. package/dist/unstable/eventlog/index.js.map +1 -1
  448. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts +2 -0
  449. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts.map +1 -0
  450. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js +89 -0
  451. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -0
  452. package/dist/unstable/http/Etag.d.ts +2 -2
  453. package/dist/unstable/http/Etag.d.ts.map +1 -1
  454. package/dist/unstable/http/Etag.js +2 -2
  455. package/dist/unstable/http/Etag.js.map +1 -1
  456. package/dist/unstable/http/FetchHttpClient.d.ts +6 -3
  457. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  458. package/dist/unstable/http/FetchHttpClient.js +5 -5
  459. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  460. package/dist/unstable/http/Headers.d.ts +5 -2
  461. package/dist/unstable/http/Headers.d.ts.map +1 -1
  462. package/dist/unstable/http/Headers.js +3 -3
  463. package/dist/unstable/http/Headers.js.map +1 -1
  464. package/dist/unstable/http/HttpClient.d.ts +8 -6
  465. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  466. package/dist/unstable/http/HttpClient.js +6 -6
  467. package/dist/unstable/http/HttpClient.js.map +1 -1
  468. package/dist/unstable/http/HttpClientError.d.ts +1 -1
  469. package/dist/unstable/http/HttpClientRequest.d.ts +2 -2
  470. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  471. package/dist/unstable/http/HttpClientRequest.js +4 -4
  472. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  473. package/dist/unstable/http/HttpEffect.d.ts +6 -6
  474. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  475. package/dist/unstable/http/HttpEffect.js +24 -24
  476. package/dist/unstable/http/HttpEffect.js.map +1 -1
  477. package/dist/unstable/http/HttpIncomingMessage.d.ts +2 -2
  478. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  479. package/dist/unstable/http/HttpIncomingMessage.js +2 -2
  480. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  481. package/dist/unstable/http/HttpMiddleware.d.ts +3 -3
  482. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  483. package/dist/unstable/http/HttpMiddleware.js +26 -14
  484. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  485. package/dist/unstable/http/HttpPlatform.d.ts +2 -2
  486. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  487. package/dist/unstable/http/HttpPlatform.js +2 -2
  488. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  489. package/dist/unstable/http/HttpRouter.d.ts +7 -7
  490. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  491. package/dist/unstable/http/HttpRouter.js +29 -29
  492. package/dist/unstable/http/HttpRouter.js.map +1 -1
  493. package/dist/unstable/http/HttpServer.d.ts +2 -2
  494. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  495. package/dist/unstable/http/HttpServer.js +2 -2
  496. package/dist/unstable/http/HttpServer.js.map +1 -1
  497. package/dist/unstable/http/HttpServerError.d.ts +3 -3
  498. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  499. package/dist/unstable/http/HttpServerError.js +3 -3
  500. package/dist/unstable/http/HttpServerError.js.map +1 -1
  501. package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
  502. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  503. package/dist/unstable/http/HttpServerRequest.js +6 -6
  504. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  505. package/dist/unstable/http/HttpServerResponse.d.ts +2 -2
  506. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  507. package/dist/unstable/http/HttpServerResponse.js +6 -6
  508. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  509. package/dist/unstable/http/Multipart.d.ts +6 -6
  510. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  511. package/dist/unstable/http/Multipart.js +7 -7
  512. package/dist/unstable/http/Multipart.js.map +1 -1
  513. package/dist/unstable/httpapi/HttpApi.d.ts +9 -9
  514. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  515. package/dist/unstable/httpapi/HttpApi.js +8 -8
  516. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  517. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -3
  518. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  519. package/dist/unstable/httpapi/HttpApiBuilder.js +20 -20
  520. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  521. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  522. package/dist/unstable/httpapi/HttpApiClient.js +1 -1
  523. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  524. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +7 -7
  525. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  526. package/dist/unstable/httpapi/HttpApiEndpoint.js +4 -4
  527. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  528. package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
  529. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  530. package/dist/unstable/httpapi/HttpApiGroup.d.ts +8 -8
  531. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  532. package/dist/unstable/httpapi/HttpApiGroup.js +4 -4
  533. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  534. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +6 -6
  535. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  536. package/dist/unstable/httpapi/HttpApiMiddleware.js +5 -5
  537. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  538. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +9 -6
  539. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  540. package/dist/unstable/httpapi/HttpApiSecurity.js +6 -6
  541. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  542. package/dist/unstable/httpapi/OpenApi.d.ts +15 -15
  543. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  544. package/dist/unstable/httpapi/OpenApi.js +23 -23
  545. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  546. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  547. package/dist/unstable/observability/OtlpExporter.js +5 -5
  548. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  549. package/dist/unstable/observability/OtlpMetrics.js +1 -1
  550. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  551. package/dist/unstable/observability/OtlpSerialization.d.ts +2 -2
  552. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  553. package/dist/unstable/observability/OtlpSerialization.js +2 -2
  554. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  555. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  556. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  557. package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
  558. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  559. package/dist/unstable/observability/PrometheusMetrics.js +4 -33
  560. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  561. package/dist/unstable/persistence/KeyValueStore.d.ts +23 -2
  562. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  563. package/dist/unstable/persistence/KeyValueStore.js +144 -2
  564. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  565. package/dist/unstable/persistence/PersistedCache.d.ts +1 -2
  566. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  567. package/dist/unstable/persistence/PersistedCache.js +10 -11
  568. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  569. package/dist/unstable/persistence/PersistedQueue.d.ts +4 -4
  570. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  571. package/dist/unstable/persistence/PersistedQueue.js +3 -3
  572. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  573. package/dist/unstable/persistence/Persistence.d.ts +4 -4
  574. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  575. package/dist/unstable/persistence/Persistence.js +3 -3
  576. package/dist/unstable/persistence/Persistence.js.map +1 -1
  577. package/dist/unstable/persistence/RateLimiter.d.ts +6 -6
  578. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  579. package/dist/unstable/persistence/RateLimiter.js +3 -3
  580. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  581. package/dist/unstable/persistence/Redis.d.ts +3 -3
  582. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  583. package/dist/unstable/persistence/Redis.js +2 -2
  584. package/dist/unstable/persistence/Redis.js.map +1 -1
  585. package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -2
  586. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  587. package/dist/unstable/process/ChildProcessSpawner.js +2 -2
  588. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  589. package/dist/unstable/reactivity/Atom.d.ts +36 -36
  590. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  591. package/dist/unstable/reactivity/Atom.js +9 -9
  592. package/dist/unstable/reactivity/Atom.js.map +1 -1
  593. package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -5
  594. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  595. package/dist/unstable/reactivity/AtomHttpApi.js +4 -4
  596. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  597. package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
  598. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  599. package/dist/unstable/reactivity/AtomRegistry.js +3 -3
  600. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  601. package/dist/unstable/reactivity/AtomRpc.d.ts +4 -5
  602. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  603. package/dist/unstable/reactivity/AtomRpc.js +5 -5
  604. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  605. package/dist/unstable/reactivity/Reactivity.d.ts +2 -2
  606. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  607. package/dist/unstable/reactivity/Reactivity.js +6 -6
  608. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  609. package/dist/unstable/rpc/Rpc.d.ts +35 -14
  610. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  611. package/dist/unstable/rpc/Rpc.js +30 -4
  612. package/dist/unstable/rpc/Rpc.js.map +1 -1
  613. package/dist/unstable/rpc/RpcClient.d.ts +21 -21
  614. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  615. package/dist/unstable/rpc/RpcClient.js +73 -40
  616. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  617. package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
  618. package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
  619. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  620. package/dist/unstable/rpc/RpcGroup.js +20 -20
  621. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  622. package/dist/unstable/rpc/RpcMiddleware.d.ts +8 -8
  623. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  624. package/dist/unstable/rpc/RpcMiddleware.js +5 -5
  625. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  626. package/dist/unstable/rpc/RpcSchema.d.ts +3 -3
  627. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  628. package/dist/unstable/rpc/RpcSchema.js +3 -3
  629. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  630. package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
  631. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  632. package/dist/unstable/rpc/RpcSerialization.js +2 -2
  633. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  634. package/dist/unstable/rpc/RpcServer.d.ts +2 -2
  635. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  636. package/dist/unstable/rpc/RpcServer.js +21 -20
  637. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  638. package/dist/unstable/rpc/RpcWorker.d.ts +2 -2
  639. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  640. package/dist/unstable/rpc/RpcWorker.js +4 -4
  641. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  642. package/dist/unstable/rpc/Utils.d.ts +6 -3
  643. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  644. package/dist/unstable/rpc/Utils.js +46 -5
  645. package/dist/unstable/rpc/Utils.js.map +1 -1
  646. package/dist/unstable/schema/Model.d.ts +2 -2
  647. package/dist/unstable/schema/Model.d.ts.map +1 -1
  648. package/dist/unstable/schema/Model.js +2 -4
  649. package/dist/unstable/schema/Model.js.map +1 -1
  650. package/dist/unstable/schema/VariantSchema.d.ts +1 -1
  651. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  652. package/dist/unstable/schema/VariantSchema.js +1 -12
  653. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  654. package/dist/unstable/socket/Socket.d.ts +10 -10
  655. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  656. package/dist/unstable/socket/Socket.js +9 -9
  657. package/dist/unstable/socket/Socket.js.map +1 -1
  658. package/dist/unstable/socket/SocketServer.d.ts +5 -2
  659. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  660. package/dist/unstable/socket/SocketServer.js +2 -2
  661. package/dist/unstable/socket/SocketServer.js.map +1 -1
  662. package/dist/unstable/sql/SqlClient.d.ts +5 -5
  663. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  664. package/dist/unstable/sql/SqlClient.js +7 -7
  665. package/dist/unstable/sql/SqlClient.js.map +1 -1
  666. package/dist/unstable/sql/SqlConnection.d.ts +2 -2
  667. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  668. package/dist/unstable/sql/SqlConnection.js +5 -2
  669. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  670. package/dist/unstable/sql/SqlError.d.ts +12 -12
  671. package/dist/unstable/sql/SqlModel.d.ts +8 -9
  672. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  673. package/dist/unstable/sql/SqlModel.js +9 -35
  674. package/dist/unstable/sql/SqlModel.js.map +1 -1
  675. package/dist/unstable/sql/SqlResolver.js +11 -11
  676. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  677. package/dist/unstable/sql/Statement.d.ts +2 -2
  678. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  679. package/dist/unstable/sql/Statement.js +2 -2
  680. package/dist/unstable/sql/Statement.js.map +1 -1
  681. package/dist/unstable/workers/Transferable.d.ts +3 -3
  682. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  683. package/dist/unstable/workers/Transferable.js +7 -7
  684. package/dist/unstable/workers/Transferable.js.map +1 -1
  685. package/dist/unstable/workers/Worker.d.ts +3 -3
  686. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  687. package/dist/unstable/workers/Worker.js +6 -3
  688. package/dist/unstable/workers/Worker.js.map +1 -1
  689. package/dist/unstable/workers/WorkerError.d.ts +5 -5
  690. package/dist/unstable/workers/WorkerRunner.d.ts +2 -2
  691. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  692. package/dist/unstable/workers/WorkerRunner.js +5 -2
  693. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  694. package/dist/unstable/workflow/Activity.d.ts +7 -7
  695. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  696. package/dist/unstable/workflow/Activity.js +7 -7
  697. package/dist/unstable/workflow/Activity.js.map +1 -1
  698. package/dist/unstable/workflow/DurableClock.d.ts +0 -3
  699. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  700. package/dist/unstable/workflow/DurableClock.js +3 -3
  701. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  702. package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
  703. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  704. package/dist/unstable/workflow/DurableDeferred.js +7 -7
  705. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  706. package/dist/unstable/workflow/Workflow.d.ts +9 -9
  707. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  708. package/dist/unstable/workflow/Workflow.js +18 -18
  709. package/dist/unstable/workflow/Workflow.js.map +1 -1
  710. package/dist/unstable/workflow/WorkflowEngine.d.ts +3 -3
  711. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  712. package/dist/unstable/workflow/WorkflowEngine.js +5 -5
  713. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  714. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  715. package/dist/unstable/workflow/WorkflowProxyServer.js +4 -4
  716. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  717. package/package.json +1 -1
  718. package/src/Cache.ts +18 -46
  719. package/src/Cause.ts +21 -21
  720. package/src/Channel.ts +120 -79
  721. package/src/Clock.ts +2 -2
  722. package/src/Config.ts +2 -2
  723. package/src/ConfigProvider.ts +5 -5
  724. package/src/Console.ts +2 -2
  725. package/src/{ServiceMap.ts → Context.ts} +337 -340
  726. package/src/DateTime.ts +2 -2
  727. package/src/Effect.ts +182 -184
  728. package/src/Equal.ts +17 -0
  729. package/src/ErrorReporter.ts +3 -3
  730. package/src/ExecutionPlan.ts +8 -9
  731. package/src/Fiber.ts +7 -7
  732. package/src/FiberHandle.ts +5 -5
  733. package/src/FiberMap.ts +5 -5
  734. package/src/FiberSet.ts +5 -5
  735. package/src/FileSystem.ts +3 -3
  736. package/src/Hash.ts +2 -2
  737. package/src/Layer.ts +333 -307
  738. package/src/LayerMap.ts +27 -26
  739. package/src/Logger.ts +3 -3
  740. package/src/ManagedRuntime.ts +32 -32
  741. package/src/Metric.ts +58 -58
  742. package/src/Path.ts +2 -2
  743. package/src/Pool.ts +5 -5
  744. package/src/PubSub.ts +3 -3
  745. package/src/Random.ts +2 -2
  746. package/src/RcMap.ts +14 -14
  747. package/src/Redactable.ts +146 -72
  748. package/src/References.ts +14 -14
  749. package/src/Request.ts +5 -5
  750. package/src/RequestResolver.ts +6 -7
  751. package/src/Resource.ts +4 -4
  752. package/src/Schedule.ts +2 -2
  753. package/src/Scheduler.ts +4 -4
  754. package/src/Schema.ts +837 -397
  755. package/src/SchemaAST.ts +5 -14
  756. package/src/SchemaGetter.ts +69 -11
  757. package/src/SchemaTransformation.ts +166 -0
  758. package/src/Scope.ts +2 -2
  759. package/src/ScopedCache.ts +5 -5
  760. package/src/Semaphore.ts +2 -4
  761. package/src/Sink.ts +9 -9
  762. package/src/Stdio.ts +2 -2
  763. package/src/Stream.ts +234 -158
  764. package/src/Terminal.ts +3 -3
  765. package/src/Tracer.ts +17 -17
  766. package/src/Unify.ts +26 -2
  767. package/src/index.ts +82 -16
  768. package/src/internal/core.ts +7 -7
  769. package/src/internal/effect.ts +106 -106
  770. package/src/internal/layer.ts +7 -7
  771. package/src/internal/random.ts +2 -2
  772. package/src/internal/rcRef.ts +10 -10
  773. package/src/internal/references.ts +13 -13
  774. package/src/internal/request.ts +8 -8
  775. package/src/internal/schedule.ts +3 -1
  776. package/src/internal/schema/representation.ts +8 -1
  777. package/src/internal/schema/schema.ts +24 -1
  778. package/src/testing/TestSchema.ts +3 -3
  779. package/src/unstable/ai/AiError.ts +3 -2
  780. package/src/unstable/ai/Chat.ts +3 -3
  781. package/src/unstable/ai/EmbeddingModel.ts +3 -3
  782. package/src/unstable/ai/IdGenerator.ts +2 -2
  783. package/src/unstable/ai/LanguageModel.ts +2 -2
  784. package/src/unstable/ai/McpSchema.ts +11 -9
  785. package/src/unstable/ai/McpServer.ts +68 -66
  786. package/src/unstable/ai/Model.ts +8 -8
  787. package/src/unstable/ai/Prompt.ts +6 -12
  788. package/src/unstable/ai/Response.ts +6 -8
  789. package/src/unstable/ai/ResponseIdTracker.ts +2 -4
  790. package/src/unstable/ai/Telemetry.ts +2 -2
  791. package/src/unstable/ai/Tokenizer.ts +2 -2
  792. package/src/unstable/ai/Tool.ts +25 -25
  793. package/src/unstable/ai/Toolkit.ts +12 -12
  794. package/src/unstable/cli/Argument.ts +3 -4
  795. package/src/unstable/cli/CliError.ts +22 -9
  796. package/src/unstable/cli/CliOutput.ts +2 -2
  797. package/src/unstable/cli/Command.ts +36 -30
  798. package/src/unstable/cli/Flag.ts +3 -4
  799. package/src/unstable/cli/GlobalFlag.ts +3 -3
  800. package/src/unstable/cli/HelpDoc.ts +8 -8
  801. package/src/unstable/cli/Param.ts +39 -16
  802. package/src/unstable/cli/Prompt.ts +13 -6
  803. package/src/unstable/cli/internal/command.ts +7 -7
  804. package/src/unstable/cli/internal/parser.ts +130 -21
  805. package/src/unstable/cluster/ClusterSchema.ts +12 -12
  806. package/src/unstable/cluster/ClusterWorkflowEngine.ts +14 -15
  807. package/src/unstable/cluster/Entity.ts +25 -25
  808. package/src/unstable/cluster/EntityProxy.ts +3 -3
  809. package/src/unstable/cluster/EntityProxyServer.ts +4 -4
  810. package/src/unstable/cluster/EntityResource.ts +2 -2
  811. package/src/unstable/cluster/HttpRunner.ts +2 -2
  812. package/src/unstable/cluster/K8sHttpClient.ts +2 -2
  813. package/src/unstable/cluster/Message.ts +8 -8
  814. package/src/unstable/cluster/MessageStorage.ts +11 -11
  815. package/src/unstable/cluster/Reply.ts +7 -7
  816. package/src/unstable/cluster/RunnerHealth.ts +2 -2
  817. package/src/unstable/cluster/RunnerServer.ts +1 -1
  818. package/src/unstable/cluster/RunnerStorage.ts +9 -9
  819. package/src/unstable/cluster/Runners.ts +7 -7
  820. package/src/unstable/cluster/ShardId.ts +84 -74
  821. package/src/unstable/cluster/Sharding.ts +26 -26
  822. package/src/unstable/cluster/ShardingConfig.ts +5 -5
  823. package/src/unstable/cluster/Snowflake.ts +2 -2
  824. package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
  825. package/src/unstable/cluster/internal/entityManager.ts +27 -23
  826. package/src/unstable/cluster/internal/entityReaper.ts +2 -2
  827. package/src/unstable/cluster/internal/resourceMap.ts +3 -3
  828. package/src/unstable/devtools/DevToolsClient.ts +5 -5
  829. package/src/unstable/eventlog/Event.ts +0 -8
  830. package/src/unstable/eventlog/EventGroup.ts +0 -4
  831. package/src/unstable/eventlog/EventJournal.ts +146 -78
  832. package/src/unstable/eventlog/EventLog.ts +353 -232
  833. package/src/unstable/eventlog/EventLogEncryption.ts +18 -32
  834. package/src/unstable/eventlog/EventLogMessage.ts +277 -0
  835. package/src/unstable/eventlog/EventLogRemote.ts +263 -410
  836. package/src/unstable/eventlog/EventLogServer.ts +183 -275
  837. package/src/unstable/eventlog/EventLogServerEncrypted.ts +206 -0
  838. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +749 -0
  839. package/src/unstable/eventlog/EventLogSessionAuth.ts +437 -0
  840. package/src/unstable/eventlog/{SqlEventLogJournal.ts → SqlEventJournal.ts} +26 -18
  841. package/src/unstable/eventlog/{SqlEventLogServer.ts → SqlEventLogServerEncrypted.ts} +102 -40
  842. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +500 -0
  843. package/src/unstable/eventlog/index.ts +27 -2
  844. package/src/unstable/eventlog/internal/identityRootSecretDerivation.ts +153 -0
  845. package/src/unstable/http/Etag.ts +2 -2
  846. package/src/unstable/http/FetchHttpClient.ts +5 -5
  847. package/src/unstable/http/Headers.ts +4 -4
  848. package/src/unstable/http/HttpClient.ts +9 -8
  849. package/src/unstable/http/HttpClientRequest.ts +5 -5
  850. package/src/unstable/http/HttpEffect.ts +35 -35
  851. package/src/unstable/http/HttpIncomingMessage.ts +2 -2
  852. package/src/unstable/http/HttpMiddleware.ts +28 -14
  853. package/src/unstable/http/HttpPlatform.ts +2 -2
  854. package/src/unstable/http/HttpRouter.ts +37 -37
  855. package/src/unstable/http/HttpServer.ts +2 -2
  856. package/src/unstable/http/HttpServerError.ts +4 -4
  857. package/src/unstable/http/HttpServerRequest.ts +7 -7
  858. package/src/unstable/http/HttpServerResponse.ts +8 -8
  859. package/src/unstable/http/Multipart.ts +8 -8
  860. package/src/unstable/httpapi/HttpApi.ts +18 -18
  861. package/src/unstable/httpapi/HttpApiBuilder.ts +20 -20
  862. package/src/unstable/httpapi/HttpApiClient.ts +4 -4
  863. package/src/unstable/httpapi/HttpApiEndpoint.ts +14 -14
  864. package/src/unstable/httpapi/HttpApiGroup.ts +16 -16
  865. package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -14
  866. package/src/unstable/httpapi/HttpApiSecurity.ts +13 -13
  867. package/src/unstable/httpapi/OpenApi.ts +29 -31
  868. package/src/unstable/observability/OtlpExporter.ts +5 -5
  869. package/src/unstable/observability/OtlpMetrics.ts +1 -1
  870. package/src/unstable/observability/OtlpSerialization.ts +2 -2
  871. package/src/unstable/observability/OtlpTracer.ts +2 -2
  872. package/src/unstable/observability/PrometheusMetrics.ts +5 -5
  873. package/src/unstable/persistence/KeyValueStore.ts +226 -3
  874. package/src/unstable/persistence/PersistedCache.ts +20 -17
  875. package/src/unstable/persistence/PersistedQueue.ts +3 -3
  876. package/src/unstable/persistence/Persistence.ts +4 -4
  877. package/src/unstable/persistence/RateLimiter.ts +3 -3
  878. package/src/unstable/persistence/Redis.ts +2 -2
  879. package/src/unstable/process/ChildProcessSpawner.ts +46 -2
  880. package/src/unstable/reactivity/Atom.ts +79 -79
  881. package/src/unstable/reactivity/AtomHttpApi.ts +27 -12
  882. package/src/unstable/reactivity/AtomRegistry.ts +4 -4
  883. package/src/unstable/reactivity/AtomRpc.ts +20 -9
  884. package/src/unstable/reactivity/Reactivity.ts +6 -6
  885. package/src/unstable/rpc/Rpc.ts +59 -21
  886. package/src/unstable/rpc/RpcClient.ts +103 -54
  887. package/src/unstable/rpc/RpcGroup.ts +31 -31
  888. package/src/unstable/rpc/RpcMiddleware.ts +16 -16
  889. package/src/unstable/rpc/RpcSchema.ts +4 -4
  890. package/src/unstable/rpc/RpcSerialization.ts +2 -2
  891. package/src/unstable/rpc/RpcServer.ts +24 -22
  892. package/src/unstable/rpc/RpcWorker.ts +5 -5
  893. package/src/unstable/rpc/Utils.ts +63 -4
  894. package/src/unstable/schema/Model.ts +4 -6
  895. package/src/unstable/schema/VariantSchema.ts +4 -17
  896. package/src/unstable/socket/Socket.ts +9 -9
  897. package/src/unstable/socket/SocketServer.ts +2 -2
  898. package/src/unstable/sql/SqlClient.ts +11 -11
  899. package/src/unstable/sql/SqlConnection.ts +2 -2
  900. package/src/unstable/sql/SqlModel.ts +54 -82
  901. package/src/unstable/sql/SqlResolver.ts +11 -11
  902. package/src/unstable/sql/Statement.ts +2 -2
  903. package/src/unstable/workers/Transferable.ts +15 -17
  904. package/src/unstable/workers/Worker.ts +4 -4
  905. package/src/unstable/workers/WorkerRunner.ts +2 -2
  906. package/src/unstable/workflow/Activity.ts +14 -14
  907. package/src/unstable/workflow/DurableClock.ts +3 -3
  908. package/src/unstable/workflow/DurableDeferred.ts +8 -8
  909. package/src/unstable/workflow/Workflow.ts +23 -23
  910. package/src/unstable/workflow/WorkflowEngine.ts +6 -6
  911. package/src/unstable/workflow/WorkflowProxyServer.ts +4 -4
  912. package/dist/ServiceMap.d.ts +0 -1150
  913. package/dist/ServiceMap.d.ts.map +0 -1
  914. package/dist/ServiceMap.js.map +0 -1
  915. package/dist/unstable/eventlog/SqlEventLogJournal.d.ts.map +0 -1
  916. package/dist/unstable/eventlog/SqlEventLogJournal.js.map +0 -1
  917. package/dist/unstable/eventlog/SqlEventLogServer.d.ts.map +0 -1
  918. package/dist/unstable/eventlog/SqlEventLogServer.js.map +0 -1
package/src/Stream.ts CHANGED
@@ -6,6 +6,7 @@ import * as Arr from "./Array.ts"
6
6
  import * as Cause from "./Cause.ts"
7
7
  import * as Channel from "./Channel.ts"
8
8
  import { Clock } from "./Clock.ts"
9
+ import * as Context from "./Context.ts"
9
10
  import * as Duration from "./Duration.ts"
10
11
  import * as Effect from "./Effect.ts"
11
12
  import * as Equal from "./Equal.ts"
@@ -37,7 +38,6 @@ import * as RcRef from "./RcRef.ts"
37
38
  import * as Result from "./Result.ts"
38
39
  import * as Schedule from "./Schedule.ts"
39
40
  import * as Scope from "./Scope.ts"
40
- import * as ServiceMap from "./ServiceMap.ts"
41
41
  import * as Sink from "./Sink.ts"
42
42
  import { isString } from "./String.ts"
43
43
  import type * as Take from "./Take.ts"
@@ -354,6 +354,79 @@ export const fromChannel: <Arr extends Arr.NonEmptyReadonlyArray<any>, E, R>(
354
354
  export const fromEffect = <A, E, R>(effect: Effect.Effect<A, E, R>): Stream<A, E, R> =>
355
355
  fromChannel(Channel.fromEffect(Effect.map(effect, Arr.of)))
356
356
 
357
+ /**
358
+ * Accesses a service from the context and emits it as a single element.
359
+ *
360
+ * @example
361
+ * ```ts
362
+ * import { Effect, Context, Stream } from "effect"
363
+ *
364
+ * class Greeter extends Context.Service<Greeter, {
365
+ * readonly greet: (name: string) => string
366
+ * }>()("Greeter") {}
367
+ *
368
+ * const stream = Stream.service(Greeter).pipe(
369
+ * Stream.map((greeter) => greeter.greet("World"))
370
+ * )
371
+ *
372
+ * const program = Effect.gen(function*() {
373
+ * return yield* stream.pipe(
374
+ * Stream.provideService(Greeter, {
375
+ * greet: (name) => `Hello, ${name}!`
376
+ * }),
377
+ * Stream.runCollect
378
+ * )
379
+ * })
380
+ *
381
+ * Effect.runPromise(program)
382
+ * // Output: [ "Hello, World!" ]
383
+ * ```
384
+ *
385
+ * @since 4.0.0
386
+ * @category Context
387
+ */
388
+ export const service = <I, S>(service: Context.Key<I, S>): Stream<S, never, I> => fromEffect(Effect.service(service))
389
+
390
+ /**
391
+ * Optionally accesses a service from the context and emits the result as a
392
+ * single element.
393
+ *
394
+ * @example
395
+ * ```ts
396
+ * import { Effect, Option, Context, Stream } from "effect"
397
+ *
398
+ * class Greeter extends Context.Service<Greeter, {
399
+ * readonly greet: (name: string) => string
400
+ * }>()("Greeter") {}
401
+ *
402
+ * const stream = Stream.serviceOption(Greeter).pipe(
403
+ * Stream.map((maybeGreeter) =>
404
+ * Option.match(maybeGreeter, {
405
+ * onNone: () => "No greeter",
406
+ * onSome: (greeter) => greeter.greet("World")
407
+ * })
408
+ * )
409
+ * )
410
+ *
411
+ * const program = Effect.gen(function*() {
412
+ * return yield* stream.pipe(
413
+ * Stream.provideService(Greeter, {
414
+ * greet: (name) => `Hello, ${name}!`
415
+ * }),
416
+ * Stream.runCollect
417
+ * )
418
+ * })
419
+ *
420
+ * Effect.runPromise(program)
421
+ * // Output: [ "Hello, World!" ]
422
+ * ```
423
+ *
424
+ * @since 4.0.0
425
+ * @category Context
426
+ */
427
+ export const serviceOption = <I, S>(service: Context.Key<I, S>): Stream<Option.Option<S>> =>
428
+ fromEffect(Effect.serviceOption(service))
429
+
357
430
  /**
358
431
  * Creates a stream that runs the effect and emits no elements.
359
432
  *
@@ -1011,9 +1084,9 @@ export const fromIterable = <A>(
1011
1084
  *
1012
1085
  * @example
1013
1086
  * ```ts
1014
- * import { Console, Effect, ServiceMap, Stream } from "effect"
1087
+ * import { Console, Effect, Context, Stream } from "effect"
1015
1088
  *
1016
- * class UserRepo extends ServiceMap.Service<UserRepo, {
1089
+ * class UserRepo extends Context.Service<UserRepo, {
1017
1090
  * readonly list: Effect.Effect<ReadonlyArray<string>>
1018
1091
  * }>()("UserRepo") {}
1019
1092
  *
@@ -9083,9 +9156,9 @@ export const retry: {
9083
9156
  *
9084
9157
  * @example
9085
9158
  * ```ts
9086
- * import { Console, Effect, ExecutionPlan, Layer, ServiceMap, Stream } from "effect"
9159
+ * import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
9087
9160
  *
9088
- * class Service extends ServiceMap.Service<Service>()("Service", {
9161
+ * class Service extends Context.Service<Service>()("Service", {
9089
9162
  * make: Effect.succeed({
9090
9163
  * stream: Stream.fail("A") as Stream.Stream<number, string>
9091
9164
  * })
@@ -9125,9 +9198,9 @@ export const withExecutionPlan: {
9125
9198
  *
9126
9199
  * @example
9127
9200
  * ```ts
9128
- * import { Console, Effect, ExecutionPlan, Layer, ServiceMap, Stream } from "effect"
9201
+ * import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
9129
9202
  *
9130
- * class Service extends ServiceMap.Service<Service>()("Service", {
9203
+ * class Service extends Context.Service<Service>()("Service", {
9131
9204
  * make: Effect.succeed({
9132
9205
  * stream: Stream.fail("A") as Stream.Stream<number, string>
9133
9206
  * })
@@ -9170,9 +9243,9 @@ export const withExecutionPlan: {
9170
9243
  *
9171
9244
  * @example
9172
9245
  * ```ts
9173
- * import { Console, Effect, ExecutionPlan, Layer, ServiceMap, Stream } from "effect"
9246
+ * import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
9174
9247
  *
9175
- * class Service extends ServiceMap.Service<Service>()("Service", {
9248
+ * class Service extends Context.Service<Service>()("Service", {
9176
9249
  * make: Effect.succeed({
9177
9250
  * stream: Stream.fail("A") as Stream.Stream<number, string>
9178
9251
  * })
@@ -9245,9 +9318,9 @@ export const withExecutionPlan: {
9245
9318
  *
9246
9319
  * @example
9247
9320
  * ```ts
9248
- * import { Console, Effect, ExecutionPlan, Layer, ServiceMap, Stream } from "effect"
9321
+ * import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
9249
9322
  *
9250
- * class Service extends ServiceMap.Service<Service>()("Service", {
9323
+ * class Service extends Context.Service<Service>()("Service", {
9251
9324
  * make: Effect.succeed({
9252
9325
  * stream: Stream.fail("A") as Stream.Stream<number, string>
9253
9326
  * })
@@ -13664,11 +13737,9 @@ export const aggregateWithin: {
13664
13737
  })
13665
13738
 
13666
13739
  // upstream -> buffer
13667
- let hadChunk = false
13668
13740
  yield* pull.pipe(
13669
13741
  pullLatch.whenOpen,
13670
13742
  Effect.flatMap((arr) => {
13671
- hadChunk = true
13672
13743
  pullLatch.closeUnsafe()
13673
13744
  return Queue.offer(buffer, arr)
13674
13745
  }),
@@ -13706,10 +13777,11 @@ export const aggregateWithin: {
13706
13777
  */
13707
13778
  B>()
13708
13779
  let leftover: Arr.NonEmptyReadonlyArray<A2> | undefined
13780
+ let sinkHasInput = false
13709
13781
  const step = yield* Schedule.toStepWithSleep(schedule)
13710
13782
  const stepToBuffer = Effect.suspend(function loop(): Pull.Pull<never, E3, void, R3> {
13711
13783
  return step(lastOutput).pipe(
13712
- Effect.flatMap(() => !hadChunk && leftover === undefined ? loop() : Queue.offer(buffer, scheduleStep)),
13784
+ Effect.flatMap(() => !sinkHasInput ? loop() : Queue.offer(buffer, scheduleStep)),
13713
13785
  Effect.flatMap(() => Effect.never),
13714
13786
  Pull.catchDone(() => Cause.done())
13715
13787
  )
@@ -13720,22 +13792,28 @@ export const aggregateWithin: {
13720
13792
  Arr.NonEmptyReadonlyArray<A>,
13721
13793
  E
13722
13794
  > = Queue.take(buffer).pipe(
13723
- Effect.flatMap((arr) => arr === scheduleStep ? Cause.done() : Effect.succeed(arr))
13795
+ Effect.flatMap((arr) => {
13796
+ if (arr === scheduleStep) {
13797
+ return Cause.done()
13798
+ }
13799
+ sinkHasInput = true
13800
+ return Effect.succeed(arr)
13801
+ })
13724
13802
  )
13725
13803
 
13726
13804
  const sinkUpstream = Effect.suspend((): Pull.Pull<Arr.NonEmptyReadonlyArray<A | A2>, E> => {
13727
13805
  if (leftover !== undefined) {
13728
13806
  const chunk = leftover
13729
13807
  leftover = undefined
13808
+ sinkHasInput = true
13730
13809
  return Effect.succeed(chunk)
13731
13810
  }
13732
- hadChunk = false
13733
13811
  pullLatch.openUnsafe()
13734
13812
  return pullFromBuffer
13735
13813
  })
13736
13814
  const catchSinkHalt = Effect.flatMap(([value, leftover_]: Sink.End<B, A2>) => {
13737
13815
  // ignore the last output if the upstream only pulled a halt
13738
- if (!hadChunk && buffer.state._tag === "Done") return Cause.done()
13816
+ if (!sinkHasInput && buffer.state._tag === "Done") return Cause.done()
13739
13817
  lastOutput = Option.some(value)
13740
13818
  leftover = leftover_
13741
13819
  return Effect.succeed(Arr.of(value))
@@ -13743,9 +13821,10 @@ export const aggregateWithin: {
13743
13821
 
13744
13822
  return Effect.suspend(() => {
13745
13823
  // if the buffer has exited and there is no more data to process
13746
- if (buffer.state._tag === "Done") {
13824
+ if (buffer.state._tag === "Done" && leftover === undefined) {
13747
13825
  return buffer.state.exit as Exit.Exit<never, Cause.Done<void> | E>
13748
13826
  }
13827
+ sinkHasInput = leftover !== undefined
13749
13828
  return Effect.succeed(Effect.suspend(() => sink.transform(sinkUpstream as any, scope)))
13750
13829
  }).pipe(
13751
13830
  Effect.flatMap((pull) => Effect.raceFirst(catchSinkHalt(pull), stepToBuffer))
@@ -15876,7 +15955,7 @@ export const ensuring: {
15876
15955
  )
15877
15956
 
15878
15957
  /**
15879
- * Provides a layer or service map to the stream, removing the corresponding
15958
+ * Provides a layer or context to the stream, removing the corresponding
15880
15959
  * service requirements. Use `options.local` to build the layer every time; by
15881
15960
  * default, layers are shared between provide calls.
15882
15961
  *
@@ -15884,9 +15963,9 @@ export const ensuring: {
15884
15963
  *
15885
15964
  * @example
15886
15965
  * ```ts
15887
- * import { Console, Effect, Layer, ServiceMap, Stream } from "effect"
15966
+ * import { Console, Effect, Layer, Context, Stream } from "effect"
15888
15967
  *
15889
- * class Env extends ServiceMap.Service<Env, { readonly name: string }>()("Env") {}
15968
+ * class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
15890
15969
  *
15891
15970
  * const layer = Layer.succeed(Env)({ name: "Ada" })
15892
15971
  *
@@ -15913,7 +15992,7 @@ export const ensuring: {
15913
15992
  */
15914
15993
  export const provide: {
15915
15994
  /**
15916
- * Provides a layer or service map to the stream, removing the corresponding
15995
+ * Provides a layer or context to the stream, removing the corresponding
15917
15996
  * service requirements. Use `options.local` to build the layer every time; by
15918
15997
  * default, layers are shared between provide calls.
15919
15998
  *
@@ -15921,9 +16000,9 @@ export const provide: {
15921
16000
  *
15922
16001
  * @example
15923
16002
  * ```ts
15924
- * import { Console, Effect, Layer, ServiceMap, Stream } from "effect"
16003
+ * import { Console, Effect, Layer, Context, Stream } from "effect"
15925
16004
  *
15926
- * class Env extends ServiceMap.Service<Env, { readonly name: string }>()("Env") {}
16005
+ * class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
15927
16006
  *
15928
16007
  * const layer = Layer.succeed(Env)({ name: "Ada" })
15929
16008
  *
@@ -15949,7 +16028,7 @@ export const provide: {
15949
16028
  * @category Services
15950
16029
  */
15951
16030
  <AL, EL = never, RL = never>(
15952
- layer: Layer.Layer<AL, EL, RL> | ServiceMap.ServiceMap<AL>,
16031
+ layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>,
15953
16032
  options?: {
15954
16033
  readonly local?: boolean | undefined
15955
16034
  } | undefined
@@ -15957,7 +16036,7 @@ export const provide: {
15957
16036
  self: Stream<A, E, R>
15958
16037
  ) => Stream<A, E | EL, Exclude<R, AL> | RL>
15959
16038
  /**
15960
- * Provides a layer or service map to the stream, removing the corresponding
16039
+ * Provides a layer or context to the stream, removing the corresponding
15961
16040
  * service requirements. Use `options.local` to build the layer every time; by
15962
16041
  * default, layers are shared between provide calls.
15963
16042
  *
@@ -15965,9 +16044,9 @@ export const provide: {
15965
16044
  *
15966
16045
  * @example
15967
16046
  * ```ts
15968
- * import { Console, Effect, Layer, ServiceMap, Stream } from "effect"
16047
+ * import { Console, Effect, Layer, Context, Stream } from "effect"
15969
16048
  *
15970
- * class Env extends ServiceMap.Service<Env, { readonly name: string }>()("Env") {}
16049
+ * class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
15971
16050
  *
15972
16051
  * const layer = Layer.succeed(Env)({ name: "Ada" })
15973
16052
  *
@@ -15994,31 +16073,31 @@ export const provide: {
15994
16073
  */
15995
16074
  <A, E, R, AL, EL = never, RL = never>(
15996
16075
  self: Stream<A, E, R>,
15997
- layer: Layer.Layer<AL, EL, RL> | ServiceMap.ServiceMap<AL>,
16076
+ layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>,
15998
16077
  options?: {
15999
16078
  readonly local?: boolean | undefined
16000
16079
  } | undefined
16001
16080
  ): Stream<A, E | EL, Exclude<R, AL> | RL>
16002
16081
  } = dual((args) => isStream(args[0]), <A, E, R, AL, EL = never, RL = never>(
16003
16082
  self: Stream<A, E, R>,
16004
- layer: Layer.Layer<AL, EL, RL> | ServiceMap.ServiceMap<AL>,
16083
+ layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>,
16005
16084
  options?: {
16006
16085
  readonly local?: boolean | undefined
16007
16086
  } | undefined
16008
16087
  ): Stream<A, E | EL, Exclude<R, AL> | RL> => fromChannel(Channel.provide(self.channel, layer, options)))
16009
16088
 
16010
16089
  /**
16011
- * Provides multiple services to the stream using a service map.
16090
+ * Provides multiple services to the stream using a context.
16012
16091
  *
16013
16092
  * @example
16014
16093
  * ```ts
16015
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16094
+ * import { Console, Effect, Context, Stream } from "effect"
16016
16095
  *
16017
- * class Config extends ServiceMap.Service<Config, { readonly prefix: string }>()("Config") {}
16018
- * class Greeter extends ServiceMap.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
16096
+ * class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
16097
+ * class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
16019
16098
  *
16020
- * const services = ServiceMap.make(Config, { prefix: "Hello" }).pipe(
16021
- * ServiceMap.add(Greeter, { greet: (name: string) => `${name}!` })
16099
+ * const context = Context.make(Config, { prefix: "Hello" }).pipe(
16100
+ * Context.add(Greeter, { greet: (name: string) => `${name}!` })
16022
16101
  * )
16023
16102
  *
16024
16103
  * const stream = Stream.fromEffect(
@@ -16030,7 +16109,7 @@ export const provide: {
16030
16109
  * )
16031
16110
  *
16032
16111
  * const program = Effect.gen(function*() {
16033
- * const result = yield* Stream.runCollect(Stream.provideServices(stream, services))
16112
+ * const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
16034
16113
  * yield* Console.log(result)
16035
16114
  * })
16036
16115
  *
@@ -16041,19 +16120,19 @@ export const provide: {
16041
16120
  * @since 4.0.0
16042
16121
  * @category Services
16043
16122
  */
16044
- export const provideServices: {
16123
+ export const provideContext: {
16045
16124
  /**
16046
- * Provides multiple services to the stream using a service map.
16125
+ * Provides multiple services to the stream using a context.
16047
16126
  *
16048
16127
  * @example
16049
16128
  * ```ts
16050
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16129
+ * import { Console, Effect, Context, Stream } from "effect"
16051
16130
  *
16052
- * class Config extends ServiceMap.Service<Config, { readonly prefix: string }>()("Config") {}
16053
- * class Greeter extends ServiceMap.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
16131
+ * class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
16132
+ * class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
16054
16133
  *
16055
- * const services = ServiceMap.make(Config, { prefix: "Hello" }).pipe(
16056
- * ServiceMap.add(Greeter, { greet: (name: string) => `${name}!` })
16134
+ * const context = Context.make(Config, { prefix: "Hello" }).pipe(
16135
+ * Context.add(Greeter, { greet: (name: string) => `${name}!` })
16057
16136
  * )
16058
16137
  *
16059
16138
  * const stream = Stream.fromEffect(
@@ -16065,7 +16144,7 @@ export const provideServices: {
16065
16144
  * )
16066
16145
  *
16067
16146
  * const program = Effect.gen(function*() {
16068
- * const result = yield* Stream.runCollect(Stream.provideServices(stream, services))
16147
+ * const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
16069
16148
  * yield* Console.log(result)
16070
16149
  * })
16071
16150
  *
@@ -16076,19 +16155,19 @@ export const provideServices: {
16076
16155
  * @since 4.0.0
16077
16156
  * @category Services
16078
16157
  */
16079
- <R2>(services: ServiceMap.ServiceMap<R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, Exclude<R, R2>>
16158
+ <R2>(context: Context.Context<R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, Exclude<R, R2>>
16080
16159
  /**
16081
- * Provides multiple services to the stream using a service map.
16160
+ * Provides multiple services to the stream using a context.
16082
16161
  *
16083
16162
  * @example
16084
16163
  * ```ts
16085
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16164
+ * import { Console, Effect, Context, Stream } from "effect"
16086
16165
  *
16087
- * class Config extends ServiceMap.Service<Config, { readonly prefix: string }>()("Config") {}
16088
- * class Greeter extends ServiceMap.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
16166
+ * class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
16167
+ * class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
16089
16168
  *
16090
- * const services = ServiceMap.make(Config, { prefix: "Hello" }).pipe(
16091
- * ServiceMap.add(Greeter, { greet: (name: string) => `${name}!` })
16169
+ * const context = Context.make(Config, { prefix: "Hello" }).pipe(
16170
+ * Context.add(Greeter, { greet: (name: string) => `${name}!` })
16092
16171
  * )
16093
16172
  *
16094
16173
  * const stream = Stream.fromEffect(
@@ -16100,7 +16179,7 @@ export const provideServices: {
16100
16179
  * )
16101
16180
  *
16102
16181
  * const program = Effect.gen(function*() {
16103
- * const result = yield* Stream.runCollect(Stream.provideServices(stream, services))
16182
+ * const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
16104
16183
  * yield* Console.log(result)
16105
16184
  * })
16106
16185
  *
@@ -16111,11 +16190,11 @@ export const provideServices: {
16111
16190
  * @since 4.0.0
16112
16191
  * @category Services
16113
16192
  */
16114
- <A, E, R, R2>(self: Stream<A, E, R>, services: ServiceMap.ServiceMap<R2>): Stream<A, E, Exclude<R, R2>>
16193
+ <A, E, R, R2>(self: Stream<A, E, R>, context: Context.Context<R2>): Stream<A, E, Exclude<R, R2>>
16115
16194
  } = dual(
16116
16195
  2,
16117
- <A, E, R, R2>(self: Stream<A, E, R>, services: ServiceMap.ServiceMap<R2>): Stream<A, E, Exclude<R, R2>> =>
16118
- fromChannel(Channel.provideServices(self.channel, services))
16196
+ <A, E, R, R2>(self: Stream<A, E, R>, context: Context.Context<R2>): Stream<A, E, Exclude<R, R2>> =>
16197
+ fromChannel(Channel.provideContext(self.channel, context))
16119
16198
  )
16120
16199
 
16121
16200
  /**
@@ -16124,9 +16203,9 @@ export const provideServices: {
16124
16203
  *
16125
16204
  * @example
16126
16205
  * ```ts
16127
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16206
+ * import { Console, Effect, Context, Stream } from "effect"
16128
16207
  *
16129
- * class Greeter extends ServiceMap.Service<Greeter, {
16208
+ * class Greeter extends Context.Service<Greeter, {
16130
16209
  * greet: (name: string) => string
16131
16210
  * }>()("Greeter") {}
16132
16211
  *
@@ -16161,9 +16240,9 @@ export const provideService: {
16161
16240
  *
16162
16241
  * @example
16163
16242
  * ```ts
16164
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16243
+ * import { Console, Effect, Context, Stream } from "effect"
16165
16244
  *
16166
- * class Greeter extends ServiceMap.Service<Greeter, {
16245
+ * class Greeter extends Context.Service<Greeter, {
16167
16246
  * greet: (name: string) => string
16168
16247
  * }>()("Greeter") {}
16169
16248
  *
@@ -16191,7 +16270,7 @@ export const provideService: {
16191
16270
  * @since 4.0.0
16192
16271
  * @category Services
16193
16272
  */
16194
- <I, S>(key: ServiceMap.Key<I, S>, service: NoInfer<S>): <A, E, R>(
16273
+ <I, S>(key: Context.Key<I, S>, service: NoInfer<S>): <A, E, R>(
16195
16274
  self: Stream<A, E, R>
16196
16275
  ) => Stream<A, E, Exclude<R, I>>
16197
16276
  /**
@@ -16200,9 +16279,9 @@ export const provideService: {
16200
16279
  *
16201
16280
  * @example
16202
16281
  * ```ts
16203
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16282
+ * import { Console, Effect, Context, Stream } from "effect"
16204
16283
  *
16205
- * class Greeter extends ServiceMap.Service<Greeter, {
16284
+ * class Greeter extends Context.Service<Greeter, {
16206
16285
  * greet: (name: string) => string
16207
16286
  * }>()("Greeter") {}
16208
16287
  *
@@ -16230,10 +16309,10 @@ export const provideService: {
16230
16309
  * @since 4.0.0
16231
16310
  * @category Services
16232
16311
  */
16233
- <A, E, R, I, S>(self: Stream<A, E, R>, key: ServiceMap.Key<I, S>, service: NoInfer<S>): Stream<A, E, Exclude<R, I>>
16312
+ <A, E, R, I, S>(self: Stream<A, E, R>, key: Context.Key<I, S>, service: NoInfer<S>): Stream<A, E, Exclude<R, I>>
16234
16313
  } = dual(3, <A, E, R, I, S>(
16235
16314
  self: Stream<A, E, R>,
16236
- key: ServiceMap.Key<I, S>,
16315
+ key: Context.Key<I, S>,
16237
16316
  service: NoInfer<S>
16238
16317
  ): Stream<A, E, Exclude<R, I>> => fromChannel(Channel.provideService(self.channel, key, service)))
16239
16318
 
@@ -16242,9 +16321,9 @@ export const provideService: {
16242
16321
  *
16243
16322
  * @example
16244
16323
  * ```ts
16245
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16324
+ * import { Console, Effect, Context, Stream } from "effect"
16246
16325
  *
16247
- * class ApiConfig extends ServiceMap.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
16326
+ * class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
16248
16327
  *
16249
16328
  * const stream = Stream.fromEffect(
16250
16329
  * Effect.gen(function*() {
@@ -16281,9 +16360,9 @@ export const provideServiceEffect: {
16281
16360
  *
16282
16361
  * @example
16283
16362
  * ```ts
16284
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16363
+ * import { Console, Effect, Context, Stream } from "effect"
16285
16364
  *
16286
- * class ApiConfig extends ServiceMap.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
16365
+ * class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
16287
16366
  *
16288
16367
  * const stream = Stream.fromEffect(
16289
16368
  * Effect.gen(function*() {
@@ -16314,7 +16393,7 @@ export const provideServiceEffect: {
16314
16393
  * @since 4.0.0
16315
16394
  * @category Services
16316
16395
  */
16317
- <I, S, ES, RS>(key: ServiceMap.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <A, E, R>(
16396
+ <I, S, ES, RS>(key: Context.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <A, E, R>(
16318
16397
  self: Stream<A, E, R>
16319
16398
  ) => Stream<A, E | ES, Exclude<R, I> | RS>
16320
16399
  /**
@@ -16322,9 +16401,9 @@ export const provideServiceEffect: {
16322
16401
  *
16323
16402
  * @example
16324
16403
  * ```ts
16325
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16404
+ * import { Console, Effect, Context, Stream } from "effect"
16326
16405
  *
16327
- * class ApiConfig extends ServiceMap.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
16406
+ * class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
16328
16407
  *
16329
16408
  * const stream = Stream.fromEffect(
16330
16409
  * Effect.gen(function*() {
@@ -16357,25 +16436,25 @@ export const provideServiceEffect: {
16357
16436
  */
16358
16437
  <A, E, R, I, S, ES, RS>(
16359
16438
  self: Stream<A, E, R>,
16360
- key: ServiceMap.Key<I, S>,
16439
+ key: Context.Key<I, S>,
16361
16440
  service: Effect.Effect<NoInfer<S>, ES, RS>
16362
16441
  ): Stream<A, E | ES, Exclude<R, I> | RS>
16363
16442
  } = dual(3, <A, E, R, I, S, ES, RS>(
16364
16443
  self: Stream<A, E, R>,
16365
- key: ServiceMap.Key<I, S>,
16444
+ key: Context.Key<I, S>,
16366
16445
  service: Effect.Effect<NoInfer<S>, ES, RS>
16367
16446
  ): Stream<A, E | ES, Exclude<R, I> | RS> => fromChannel(Channel.provideServiceEffect(self.channel, key, service)))
16368
16447
 
16369
16448
  /**
16370
- * Transforms the stream's required services by mapping the current service map
16449
+ * Transforms the stream's required services by mapping the current context
16371
16450
  * to a new one.
16372
16451
  *
16373
16452
  * @example
16374
16453
  * ```ts
16375
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16454
+ * import { Console, Effect, Context, Stream } from "effect"
16376
16455
  *
16377
- * class Logger extends ServiceMap.Service<Logger, { prefix: string }>()("Logger") {}
16378
- * class Config extends ServiceMap.Service<Config, { name: string }>()("Config") {}
16456
+ * class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
16457
+ * class Config extends Context.Service<Config, { name: string }>()("Config") {}
16379
16458
  *
16380
16459
  * const stream = Stream.fromEffect(
16381
16460
  * Effect.gen(function*() {
@@ -16386,8 +16465,8 @@ export const provideServiceEffect: {
16386
16465
  * )
16387
16466
  *
16388
16467
  * const updated = stream.pipe(
16389
- * Stream.updateServices((services: ServiceMap.ServiceMap<Logger>) =>
16390
- * ServiceMap.add(services, Config, { name: "World" })
16468
+ * Stream.updateContext((context: Context.Context<Logger>) =>
16469
+ * Context.add(context, Config, { name: "World" })
16391
16470
  * )
16392
16471
  * )
16393
16472
  *
@@ -16405,17 +16484,17 @@ export const provideServiceEffect: {
16405
16484
  * @since 2.0.0
16406
16485
  * @category Services
16407
16486
  */
16408
- export const updateServices: {
16487
+ export const updateContext: {
16409
16488
  /**
16410
- * Transforms the stream's required services by mapping the current service map
16489
+ * Transforms the stream's required services by mapping the current context
16411
16490
  * to a new one.
16412
16491
  *
16413
16492
  * @example
16414
16493
  * ```ts
16415
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16494
+ * import { Console, Effect, Context, Stream } from "effect"
16416
16495
  *
16417
- * class Logger extends ServiceMap.Service<Logger, { prefix: string }>()("Logger") {}
16418
- * class Config extends ServiceMap.Service<Config, { name: string }>()("Config") {}
16496
+ * class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
16497
+ * class Config extends Context.Service<Config, { name: string }>()("Config") {}
16419
16498
  *
16420
16499
  * const stream = Stream.fromEffect(
16421
16500
  * Effect.gen(function*() {
@@ -16426,8 +16505,8 @@ export const updateServices: {
16426
16505
  * )
16427
16506
  *
16428
16507
  * const updated = stream.pipe(
16429
- * Stream.updateServices((services: ServiceMap.ServiceMap<Logger>) =>
16430
- * ServiceMap.add(services, Config, { name: "World" })
16508
+ * Stream.updateContext((context: Context.Context<Logger>) =>
16509
+ * Context.add(context, Config, { name: "World" })
16431
16510
  * )
16432
16511
  * )
16433
16512
  *
@@ -16445,19 +16524,19 @@ export const updateServices: {
16445
16524
  * @since 2.0.0
16446
16525
  * @category Services
16447
16526
  */
16448
- <R, R2>(f: (services: ServiceMap.ServiceMap<R2>) => ServiceMap.ServiceMap<R>): <A, E>(
16527
+ <R, R2>(f: (context: Context.Context<R2>) => Context.Context<R>): <A, E>(
16449
16528
  self: Stream<A, E, R>
16450
16529
  ) => Stream<A, E, R2>
16451
16530
  /**
16452
- * Transforms the stream's required services by mapping the current service map
16531
+ * Transforms the stream's required services by mapping the current context
16453
16532
  * to a new one.
16454
16533
  *
16455
16534
  * @example
16456
16535
  * ```ts
16457
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16536
+ * import { Console, Effect, Context, Stream } from "effect"
16458
16537
  *
16459
- * class Logger extends ServiceMap.Service<Logger, { prefix: string }>()("Logger") {}
16460
- * class Config extends ServiceMap.Service<Config, { name: string }>()("Config") {}
16538
+ * class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
16539
+ * class Config extends Context.Service<Config, { name: string }>()("Config") {}
16461
16540
  *
16462
16541
  * const stream = Stream.fromEffect(
16463
16542
  * Effect.gen(function*() {
@@ -16468,8 +16547,8 @@ export const updateServices: {
16468
16547
  * )
16469
16548
  *
16470
16549
  * const updated = stream.pipe(
16471
- * Stream.updateServices((services: ServiceMap.ServiceMap<Logger>) =>
16472
- * ServiceMap.add(services, Config, { name: "World" })
16550
+ * Stream.updateContext((context: Context.Context<Logger>) =>
16551
+ * Context.add(context, Config, { name: "World" })
16473
16552
  * )
16474
16553
  * )
16475
16554
  *
@@ -16489,21 +16568,21 @@ export const updateServices: {
16489
16568
  */
16490
16569
  <A, E, R, R2>(
16491
16570
  self: Stream<A, E, R>,
16492
- f: (services: ServiceMap.ServiceMap<R2>) => ServiceMap.ServiceMap<R>
16571
+ f: (context: Context.Context<R2>) => Context.Context<R>
16493
16572
  ): Stream<A, E, R2>
16494
16573
  } = dual(2, <A, E, R, R2>(
16495
16574
  self: Stream<A, E, R>,
16496
- f: (services: ServiceMap.ServiceMap<R2>) => ServiceMap.ServiceMap<R>
16497
- ): Stream<A, E, R2> => fromChannel(Channel.updateServices(self.channel, f)))
16575
+ f: (context: Context.Context<R2>) => Context.Context<R>
16576
+ ): Stream<A, E, R2> => fromChannel(Channel.updateContext(self.channel, f)))
16498
16577
 
16499
16578
  /**
16500
16579
  * Updates a single service in the stream environment by applying a function.
16501
16580
  *
16502
16581
  * @example
16503
16582
  * ```ts
16504
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16583
+ * import { Console, Effect, Context, Stream } from "effect"
16505
16584
  *
16506
- * class Counter extends ServiceMap.Service<Counter, { count: number }>()("Counter") {}
16585
+ * class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
16507
16586
  *
16508
16587
  * const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
16509
16588
  * Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
@@ -16527,9 +16606,9 @@ export const updateService: {
16527
16606
  *
16528
16607
  * @example
16529
16608
  * ```ts
16530
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16609
+ * import { Console, Effect, Context, Stream } from "effect"
16531
16610
  *
16532
- * class Counter extends ServiceMap.Service<Counter, { count: number }>()("Counter") {}
16611
+ * class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
16533
16612
  *
16534
16613
  * const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
16535
16614
  * Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
@@ -16547,7 +16626,7 @@ export const updateService: {
16547
16626
  * @since 2.0.0
16548
16627
  * @category Services
16549
16628
  */
16550
- <I, S>(key: ServiceMap.Key<I, S>, f: (service: NoInfer<S>) => S): <A, E, R>(
16629
+ <I, S>(key: Context.Key<I, S>, f: (service: NoInfer<S>) => S): <A, E, R>(
16551
16630
  self: Stream<A, E, R>
16552
16631
  ) => Stream<A, E, R | I>
16553
16632
  /**
@@ -16555,9 +16634,9 @@ export const updateService: {
16555
16634
  *
16556
16635
  * @example
16557
16636
  * ```ts
16558
- * import { Console, Effect, ServiceMap, Stream } from "effect"
16637
+ * import { Console, Effect, Context, Stream } from "effect"
16559
16638
  *
16560
- * class Counter extends ServiceMap.Service<Counter, { count: number }>()("Counter") {}
16639
+ * class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
16561
16640
  *
16562
16641
  * const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
16563
16642
  * Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
@@ -16577,19 +16656,19 @@ export const updateService: {
16577
16656
  */
16578
16657
  <A, E, R, I, S>(
16579
16658
  self: Stream<A, E, R>,
16580
- key: ServiceMap.Key<I, S>,
16659
+ key: Context.Key<I, S>,
16581
16660
  f: (service: NoInfer<S>) => S
16582
16661
  ): Stream<A, E, R | I>
16583
16662
  } = dual(3, <A, E, R, I, S>(
16584
16663
  self: Stream<A, E, R>,
16585
- service: ServiceMap.Key<I, S>,
16664
+ service: Context.Key<I, S>,
16586
16665
  f: (service: NoInfer<S>) => S
16587
16666
  ): Stream<A, E, R | I> =>
16588
- updateServices(self, (services) =>
16589
- ServiceMap.add(
16590
- services,
16667
+ updateContext(self, (context) =>
16668
+ Context.add(
16669
+ context,
16591
16670
  service,
16592
- f(ServiceMap.get(services, service))
16671
+ f(Context.get(context, service))
16593
16672
  )))
16594
16673
 
16595
16674
  /**
@@ -17757,10 +17836,10 @@ export const mkUint8Array = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effec
17757
17836
  *
17758
17837
  * @example
17759
17838
  * ```ts
17760
- * import { ServiceMap, Stream } from "effect"
17839
+ * import { Context, Stream } from "effect"
17761
17840
  *
17762
17841
  * const stream = Stream.make(1, 2, 3, 4, 5)
17763
- * const readableStream = Stream.toReadableStreamWith(stream, ServiceMap.empty())
17842
+ * const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
17764
17843
  * ```
17765
17844
  *
17766
17845
  * @since 2.0.0
@@ -17774,17 +17853,17 @@ export const toReadableStreamWith = dual<
17774
17853
  *
17775
17854
  * @example
17776
17855
  * ```ts
17777
- * import { ServiceMap, Stream } from "effect"
17856
+ * import { Context, Stream } from "effect"
17778
17857
  *
17779
17858
  * const stream = Stream.make(1, 2, 3, 4, 5)
17780
- * const readableStream = Stream.toReadableStreamWith(stream, ServiceMap.empty())
17859
+ * const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
17781
17860
  * ```
17782
17861
  *
17783
17862
  * @since 2.0.0
17784
17863
  * @category Destructors
17785
17864
  */
17786
17865
  <A, XR>(
17787
- services: ServiceMap.ServiceMap<XR>,
17866
+ context: Context.Context<XR>,
17788
17867
  options?: { readonly strategy?: QueuingStrategy<A> | undefined }
17789
17868
  ) => <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>,
17790
17869
  /**
@@ -17794,10 +17873,10 @@ export const toReadableStreamWith = dual<
17794
17873
  *
17795
17874
  * @example
17796
17875
  * ```ts
17797
- * import { ServiceMap, Stream } from "effect"
17876
+ * import { Context, Stream } from "effect"
17798
17877
  *
17799
17878
  * const stream = Stream.make(1, 2, 3, 4, 5)
17800
- * const readableStream = Stream.toReadableStreamWith(stream, ServiceMap.empty())
17879
+ * const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
17801
17880
  * ```
17802
17881
  *
17803
17882
  * @since 2.0.0
@@ -17805,14 +17884,14 @@ export const toReadableStreamWith = dual<
17805
17884
  */
17806
17885
  <A, E, XR, R extends XR>(
17807
17886
  self: Stream<A, E, R>,
17808
- services: ServiceMap.ServiceMap<XR>,
17887
+ context: Context.Context<XR>,
17809
17888
  options?: { readonly strategy?: QueuingStrategy<A> | undefined }
17810
17889
  ) => ReadableStream<A>
17811
17890
  >(
17812
17891
  (args) => isStream(args[0]),
17813
17892
  <A, E, XR, R extends XR>(
17814
17893
  self: Stream<A, E, R>,
17815
- services: ServiceMap.ServiceMap<XR>,
17894
+ context: Context.Context<XR>,
17816
17895
  options?: { readonly strategy?: QueuingStrategy<A> | undefined }
17817
17896
  ): ReadableStream<A> => {
17818
17897
  let currentResolve: (() => void) | undefined = undefined
@@ -17821,7 +17900,7 @@ export const toReadableStreamWith = dual<
17821
17900
 
17822
17901
  return new ReadableStream<A>({
17823
17902
  start(controller) {
17824
- fiber = Effect.runFork(Effect.provideServices(
17903
+ fiber = Effect.runFork(Effect.provideContext(
17825
17904
  runForEachArray(self, (chunk) =>
17826
17905
  latch.whenOpen(Effect.sync(() => {
17827
17906
  latch.closeUnsafe()
@@ -17831,7 +17910,7 @@ export const toReadableStreamWith = dual<
17831
17910
  currentResolve!()
17832
17911
  currentResolve = undefined
17833
17912
  }))),
17834
- services
17913
+ context
17835
17914
  ))
17836
17915
  fiber.addObserver((exit) => {
17837
17916
  if (exit._tag === "Failure") {
@@ -17916,7 +17995,7 @@ export const toReadableStream: {
17916
17995
  <A, E>(
17917
17996
  self: Stream<A, E>,
17918
17997
  options?: { readonly strategy?: QueuingStrategy<A> | undefined }
17919
- ): ReadableStream<A> => toReadableStreamWith(self, ServiceMap.empty(), options)
17998
+ ): ReadableStream<A> => toReadableStreamWith(self, Context.empty(), options)
17920
17999
  )
17921
18000
 
17922
18001
  /**
@@ -18000,7 +18079,7 @@ export const toReadableStreamEffect: {
18000
18079
  options?: { readonly strategy?: QueuingStrategy<A> | undefined }
18001
18080
  ): Effect.Effect<ReadableStream<A>, never, R> =>
18002
18081
  Effect.map(
18003
- Effect.services</**
18082
+ Effect.context</**
18004
18083
  * Creates an Effect that builds a ReadableStream from the stream.
18005
18084
  *
18006
18085
  * See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
@@ -18032,10 +18111,10 @@ export const toReadableStreamEffect: {
18032
18111
  *
18033
18112
  * @example
18034
18113
  * ```ts
18035
- * import { ServiceMap, Stream } from "effect"
18114
+ * import { Context, Stream } from "effect"
18036
18115
  *
18037
18116
  * const stream = Stream.make(1, 2, 3)
18038
- * const iterable = Stream.toAsyncIterableWith(stream, ServiceMap.empty())
18117
+ * const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
18039
18118
  *
18040
18119
  * const collect = async () => {
18041
18120
  * const results: Array<number> = []
@@ -18055,10 +18134,10 @@ export const toAsyncIterableWith: {
18055
18134
  *
18056
18135
  * @example
18057
18136
  * ```ts
18058
- * import { ServiceMap, Stream } from "effect"
18137
+ * import { Context, Stream } from "effect"
18059
18138
  *
18060
18139
  * const stream = Stream.make(1, 2, 3)
18061
- * const iterable = Stream.toAsyncIterableWith(stream, ServiceMap.empty())
18140
+ * const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
18062
18141
  *
18063
18142
  * const collect = async () => {
18064
18143
  * const results: Array<number> = []
@@ -18072,16 +18151,16 @@ export const toAsyncIterableWith: {
18072
18151
  * @since 2.0.0
18073
18152
  * @category Destructors
18074
18153
  */
18075
- <XR>(services: ServiceMap.ServiceMap<XR>): <A, E, R extends XR>(self: Stream<A, E, R>) => AsyncIterable<A>
18154
+ <XR>(context: Context.Context<XR>): <A, E, R extends XR>(self: Stream<A, E, R>) => AsyncIterable<A>
18076
18155
  /**
18077
18156
  * Converts the stream to an `AsyncIterable` using the provided services.
18078
18157
  *
18079
18158
  * @example
18080
18159
  * ```ts
18081
- * import { ServiceMap, Stream } from "effect"
18160
+ * import { Context, Stream } from "effect"
18082
18161
  *
18083
18162
  * const stream = Stream.make(1, 2, 3)
18084
- * const iterable = Stream.toAsyncIterableWith(stream, ServiceMap.empty())
18163
+ * const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
18085
18164
  *
18086
18165
  * const collect = async () => {
18087
18166
  * const results: Array<number> = []
@@ -18095,16 +18174,16 @@ export const toAsyncIterableWith: {
18095
18174
  * @since 2.0.0
18096
18175
  * @category Destructors
18097
18176
  */
18098
- <A, E, XR, R extends XR>(self: Stream<A, E, R>, services: ServiceMap.ServiceMap<XR>): AsyncIterable<A>
18177
+ <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>): AsyncIterable<A>
18099
18178
  } = dual(
18100
18179
  2,
18101
18180
  <A, E, XR, R extends XR>(
18102
18181
  self: Stream<A, E, R>,
18103
- services: ServiceMap.ServiceMap<XR>
18182
+ context: Context.Context<XR>
18104
18183
  ): AsyncIterable<A> => ({
18105
18184
  [Symbol.asyncIterator]() {
18106
- const runPromise = Effect.runPromiseWith(services)
18107
- const runPromiseExit = Effect.runPromiseExitWith(services)
18185
+ const runPromise = Effect.runPromiseWith(context)
18186
+ const runPromiseExit = Effect.runPromiseExitWith(context)
18108
18187
  const scope = Scope.makeUnsafe()
18109
18188
  let pull: Pull.Pull<Arr.NonEmptyReadonlyArray<A>, E, void, R> | undefined
18110
18189
  let currentIter: Iterator<A> | undefined
@@ -18166,8 +18245,8 @@ export const toAsyncIterableWith: {
18166
18245
  */
18167
18246
  export const toAsyncIterableEffect = <A, E, R>(self: Stream<A, E, R>): Effect.Effect<AsyncIterable<A>, never, R> =>
18168
18247
  Effect.map(
18169
- Effect.services<R>(),
18170
- (services) => toAsyncIterableWith(self, services)
18248
+ Effect.context<R>(),
18249
+ (context) => toAsyncIterableWith(self, context)
18171
18250
  )
18172
18251
 
18173
18252
  /**
@@ -18196,7 +18275,7 @@ export const toAsyncIterableEffect = <A, E, R>(self: Stream<A, E, R>): Effect.Ef
18196
18275
  * @category Destructors
18197
18276
  */
18198
18277
  export const toAsyncIterable = <A, E>(self: Stream<A, E>): AsyncIterable<A> =>
18199
- toAsyncIterableWith(self, ServiceMap.empty())
18278
+ toAsyncIterableWith(self, Context.empty())
18200
18279
 
18201
18280
  /**
18202
18281
  * Runs the stream, publishing elements into the provided PubSub.
@@ -18542,16 +18621,16 @@ export const toPubSubTake: {
18542
18621
  )
18543
18622
 
18544
18623
  /**
18545
- * Converts a stream to a PubSub for concurrent consumption.
18624
+ * Converts a stream to a Queue for concurrent consumption.
18546
18625
  *
18547
18626
  * @example
18548
18627
  * ```ts
18549
- * import { Effect, PubSub, Stream } from "effect"
18628
+ * import { Effect, Queue, Stream } from "effect"
18550
18629
  *
18551
18630
  * const program = Effect.gen(function* () {
18552
- * const pubSub = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
18553
- * const subscription = yield* PubSub.subscribe(pubSub)
18554
- * return subscription
18631
+ * const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
18632
+ * const chunk = yield* Queue.takeBetween(queue, 1, 3)
18633
+ * return chunk
18555
18634
  * })
18556
18635
  * ```
18557
18636
  *
@@ -18560,16 +18639,16 @@ export const toPubSubTake: {
18560
18639
  */
18561
18640
  export const toQueue: {
18562
18641
  /**
18563
- * Converts a stream to a PubSub for concurrent consumption.
18642
+ * Converts a stream to a Queue for concurrent consumption.
18564
18643
  *
18565
18644
  * @example
18566
18645
  * ```ts
18567
- * import { Effect, PubSub, Stream } from "effect"
18646
+ * import { Effect, Queue, Stream } from "effect"
18568
18647
  *
18569
18648
  * const program = Effect.gen(function* () {
18570
- * const pubSub = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
18571
- * const subscription = yield* PubSub.subscribe(pubSub)
18572
- * return subscription
18649
+ * const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
18650
+ * const chunk = yield* Queue.takeBetween(queue, 1, 3)
18651
+ * return chunk
18573
18652
  * })
18574
18653
  * ```
18575
18654
  *
@@ -18585,16 +18664,16 @@ export const toQueue: {
18585
18664
  }
18586
18665
  ): <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope>
18587
18666
  /**
18588
- * Converts a stream to a PubSub for concurrent consumption.
18667
+ * Converts a stream to a Queue for concurrent consumption.
18589
18668
  *
18590
18669
  * @example
18591
18670
  * ```ts
18592
- * import { Effect, PubSub, Stream } from "effect"
18671
+ * import { Effect, Queue, Stream } from "effect"
18593
18672
  *
18594
18673
  * const program = Effect.gen(function* () {
18595
- * const pubSub = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
18596
- * const subscription = yield* PubSub.subscribe(pubSub)
18597
- * return subscription
18674
+ * const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
18675
+ * const chunk = yield* Queue.takeBetween(queue, 1, 3)
18676
+ * return chunk
18598
18677
  * })
18599
18678
  * ```
18600
18679
  *
@@ -18609,22 +18688,19 @@ export const toQueue: {
18609
18688
  readonly capacity: number
18610
18689
  readonly strategy?: "dropping" | "sliding" | "suspend" | undefined
18611
18690
  }
18612
- ): Effect.Effect<PubSub.PubSub<A>, never, R | Scope.Scope>
18691
+ ): Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope>
18613
18692
  } = dual(
18614
18693
  2,
18615
18694
  <A, E, R>(
18616
18695
  self: Stream<A, E, R>,
18617
18696
  options: {
18618
18697
  readonly capacity: "unbounded"
18619
- readonly replay?: number | undefined
18620
- readonly shutdownOnEnd?: boolean | undefined
18621
18698
  } | {
18622
18699
  readonly capacity: number
18623
18700
  readonly strategy?: "dropping" | "sliding" | "suspend" | undefined
18624
- readonly replay?: number | undefined
18625
- readonly shutdownOnEnd?: boolean | undefined
18626
18701
  }
18627
- ): Effect.Effect<PubSub.PubSub<A>, never, R | Scope.Scope> => Channel.toPubSubArray(self.channel, options)
18702
+ ): Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope> =>
18703
+ Channel.toQueueArray(self.channel, options)
18628
18704
  )
18629
18705
 
18630
18706
  /**