effect 4.0.0-beta.42 → 4.0.0-beta.44

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 (851) 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/ErrorReporter.d.ts +3 -3
  37. package/dist/ErrorReporter.d.ts.map +1 -1
  38. package/dist/ErrorReporter.js +1 -1
  39. package/dist/ErrorReporter.js.map +1 -1
  40. package/dist/ExecutionPlan.d.ts +6 -6
  41. package/dist/ExecutionPlan.d.ts.map +1 -1
  42. package/dist/ExecutionPlan.js +4 -4
  43. package/dist/ExecutionPlan.js.map +1 -1
  44. package/dist/Fiber.d.ts +7 -7
  45. package/dist/Fiber.d.ts.map +1 -1
  46. package/dist/Fiber.js.map +1 -1
  47. package/dist/FiberHandle.d.ts +2 -2
  48. package/dist/FiberHandle.d.ts.map +1 -1
  49. package/dist/FiberHandle.js +4 -4
  50. package/dist/FiberHandle.js.map +1 -1
  51. package/dist/FiberMap.d.ts +2 -2
  52. package/dist/FiberMap.d.ts.map +1 -1
  53. package/dist/FiberMap.js +4 -4
  54. package/dist/FiberMap.js.map +1 -1
  55. package/dist/FiberSet.d.ts +2 -2
  56. package/dist/FiberSet.d.ts.map +1 -1
  57. package/dist/FiberSet.js +4 -4
  58. package/dist/FiberSet.js.map +1 -1
  59. package/dist/FileSystem.d.ts +3 -3
  60. package/dist/FileSystem.d.ts.map +1 -1
  61. package/dist/FileSystem.js +3 -3
  62. package/dist/FileSystem.js.map +1 -1
  63. package/dist/Layer.d.ts +309 -266
  64. package/dist/Layer.d.ts.map +1 -1
  65. package/dist/Layer.js +156 -132
  66. package/dist/Layer.js.map +1 -1
  67. package/dist/LayerMap.d.ts +18 -18
  68. package/dist/LayerMap.d.ts.map +1 -1
  69. package/dist/LayerMap.js +18 -15
  70. package/dist/LayerMap.js.map +1 -1
  71. package/dist/Logger.d.ts +3 -3
  72. package/dist/Logger.d.ts.map +1 -1
  73. package/dist/Logger.js.map +1 -1
  74. package/dist/ManagedRuntime.d.ts +6 -6
  75. package/dist/ManagedRuntime.d.ts.map +1 -1
  76. package/dist/ManagedRuntime.js +18 -21
  77. package/dist/ManagedRuntime.js.map +1 -1
  78. package/dist/Metric.d.ts +19 -19
  79. package/dist/Metric.d.ts.map +1 -1
  80. package/dist/Metric.js +21 -21
  81. package/dist/Metric.js.map +1 -1
  82. package/dist/Path.d.ts +2 -2
  83. package/dist/Path.d.ts.map +1 -1
  84. package/dist/Path.js +2 -2
  85. package/dist/Path.js.map +1 -1
  86. package/dist/Pool.d.ts.map +1 -1
  87. package/dist/Pool.js +4 -4
  88. package/dist/Pool.js.map +1 -1
  89. package/dist/PubSub.d.ts.map +1 -1
  90. package/dist/PubSub.js +3 -3
  91. package/dist/PubSub.js.map +1 -1
  92. package/dist/Random.d.ts +2 -2
  93. package/dist/Random.d.ts.map +1 -1
  94. package/dist/Random.js +0 -23
  95. package/dist/Random.js.map +1 -1
  96. package/dist/RcMap.d.ts +2 -2
  97. package/dist/RcMap.d.ts.map +1 -1
  98. package/dist/RcMap.js +12 -12
  99. package/dist/RcMap.js.map +1 -1
  100. package/dist/Redactable.d.ts +139 -62
  101. package/dist/Redactable.d.ts.map +1 -1
  102. package/dist/Redactable.js +59 -55
  103. package/dist/Redactable.js.map +1 -1
  104. package/dist/References.d.ts +26 -14
  105. package/dist/References.d.ts.map +1 -1
  106. package/dist/References.js +0 -12
  107. package/dist/References.js.map +1 -1
  108. package/dist/Request.d.ts +5 -5
  109. package/dist/Request.d.ts.map +1 -1
  110. package/dist/Request.js.map +1 -1
  111. package/dist/RequestResolver.d.ts.map +1 -1
  112. package/dist/RequestResolver.js +6 -7
  113. package/dist/RequestResolver.js.map +1 -1
  114. package/dist/Resource.d.ts +0 -3
  115. package/dist/Resource.d.ts.map +1 -1
  116. package/dist/Resource.js +3 -3
  117. package/dist/Resource.js.map +1 -1
  118. package/dist/Schedule.d.ts +2 -2
  119. package/dist/Schedule.d.ts.map +1 -1
  120. package/dist/Schedule.js +2 -2
  121. package/dist/Schedule.js.map +1 -1
  122. package/dist/Scheduler.d.ts +4 -4
  123. package/dist/Scheduler.d.ts.map +1 -1
  124. package/dist/Scheduler.js +7 -4
  125. package/dist/Scheduler.js.map +1 -1
  126. package/dist/Schema.d.ts +531 -214
  127. package/dist/Schema.d.ts.map +1 -1
  128. package/dist/Schema.js +304 -103
  129. package/dist/Schema.js.map +1 -1
  130. package/dist/SchemaAST.d.ts.map +1 -1
  131. package/dist/SchemaAST.js +5 -15
  132. package/dist/SchemaAST.js.map +1 -1
  133. package/dist/SchemaGetter.d.ts +49 -5
  134. package/dist/SchemaGetter.d.ts.map +1 -1
  135. package/dist/SchemaGetter.js +64 -5
  136. package/dist/SchemaGetter.js.map +1 -1
  137. package/dist/SchemaTransformation.d.ts +145 -0
  138. package/dist/SchemaTransformation.d.ts.map +1 -1
  139. package/dist/SchemaTransformation.js +146 -0
  140. package/dist/SchemaTransformation.js.map +1 -1
  141. package/dist/Scope.d.ts +2 -2
  142. package/dist/Scope.d.ts.map +1 -1
  143. package/dist/Scope.js.map +1 -1
  144. package/dist/ScopedCache.d.ts.map +1 -1
  145. package/dist/ScopedCache.js +4 -4
  146. package/dist/ScopedCache.js.map +1 -1
  147. package/dist/Sink.d.ts +6 -6
  148. package/dist/Sink.d.ts.map +1 -1
  149. package/dist/Sink.js +1 -1
  150. package/dist/Sink.js.map +1 -1
  151. package/dist/Stdio.d.ts +2 -2
  152. package/dist/Stdio.d.ts.map +1 -1
  153. package/dist/Stdio.js +2 -2
  154. package/dist/Stdio.js.map +1 -1
  155. package/dist/Stream.d.ts +187 -117
  156. package/dist/Stream.d.ts.map +1 -1
  157. package/dist/Stream.js +133 -57
  158. package/dist/Stream.js.map +1 -1
  159. package/dist/Terminal.d.ts +3 -3
  160. package/dist/Terminal.d.ts.map +1 -1
  161. package/dist/Terminal.js +2 -2
  162. package/dist/Terminal.js.map +1 -1
  163. package/dist/Tracer.d.ts +16 -16
  164. package/dist/Tracer.d.ts.map +1 -1
  165. package/dist/Tracer.js +11 -8
  166. package/dist/Tracer.js.map +1 -1
  167. package/dist/Unify.d.ts +8 -2
  168. package/dist/Unify.d.ts.map +1 -1
  169. package/dist/Unify.js.map +1 -1
  170. package/dist/index.d.ts +81 -15
  171. package/dist/index.d.ts.map +1 -1
  172. package/dist/index.js +81 -15
  173. package/dist/index.js.map +1 -1
  174. package/dist/internal/core.js.map +1 -1
  175. package/dist/internal/effect.js +74 -74
  176. package/dist/internal/effect.js.map +1 -1
  177. package/dist/internal/layer.js +3 -3
  178. package/dist/internal/layer.js.map +1 -1
  179. package/dist/internal/random.js +2 -2
  180. package/dist/internal/random.js.map +1 -1
  181. package/dist/internal/rcRef.js +9 -9
  182. package/dist/internal/rcRef.js.map +1 -1
  183. package/dist/internal/references.js +13 -13
  184. package/dist/internal/references.js.map +1 -1
  185. package/dist/internal/request.js +6 -6
  186. package/dist/internal/request.js.map +1 -1
  187. package/dist/internal/schedule.js +1 -1
  188. package/dist/internal/schedule.js.map +1 -1
  189. package/dist/internal/schema/representation.js +11 -1
  190. package/dist/internal/schema/representation.js.map +1 -1
  191. package/dist/internal/schema/schema.d.ts +10 -1
  192. package/dist/internal/schema/schema.d.ts.map +1 -1
  193. package/dist/internal/schema/schema.js +21 -1
  194. package/dist/internal/schema/schema.js.map +1 -1
  195. package/dist/testing/TestSchema.d.ts +3 -3
  196. package/dist/testing/TestSchema.d.ts.map +1 -1
  197. package/dist/testing/TestSchema.js.map +1 -1
  198. package/dist/unstable/ai/AiError.d.ts +19 -19
  199. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  200. package/dist/unstable/ai/AiError.js +2 -1
  201. package/dist/unstable/ai/AiError.js.map +1 -1
  202. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  203. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
  204. package/dist/unstable/ai/AnthropicStructuredOutput.js +5 -2
  205. package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
  206. package/dist/unstable/ai/Chat.d.ts +4 -4
  207. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  208. package/dist/unstable/ai/Chat.js +3 -3
  209. package/dist/unstable/ai/Chat.js.map +1 -1
  210. package/dist/unstable/ai/EmbeddingModel.d.ts +6 -6
  211. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  212. package/dist/unstable/ai/EmbeddingModel.js +3 -3
  213. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  214. package/dist/unstable/ai/IdGenerator.d.ts +2 -2
  215. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  216. package/dist/unstable/ai/IdGenerator.js +2 -2
  217. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  218. package/dist/unstable/ai/LanguageModel.d.ts +2 -2
  219. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  220. package/dist/unstable/ai/LanguageModel.js +2 -2
  221. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  222. package/dist/unstable/ai/McpSchema.d.ts +54 -54
  223. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  224. package/dist/unstable/ai/McpSchema.js +15 -8
  225. package/dist/unstable/ai/McpSchema.js.map +1 -1
  226. package/dist/unstable/ai/McpServer.d.ts +22 -22
  227. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  228. package/dist/unstable/ai/McpServer.js +25 -25
  229. package/dist/unstable/ai/McpServer.js.map +1 -1
  230. package/dist/unstable/ai/Model.d.ts +3 -3
  231. package/dist/unstable/ai/Model.d.ts.map +1 -1
  232. package/dist/unstable/ai/Model.js +5 -5
  233. package/dist/unstable/ai/Model.js.map +1 -1
  234. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  235. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
  236. package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -1
  237. package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
  238. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  239. package/dist/unstable/ai/Prompt.js +6 -9
  240. package/dist/unstable/ai/Prompt.js.map +1 -1
  241. package/dist/unstable/ai/Response.d.ts +1 -1
  242. package/dist/unstable/ai/Response.d.ts.map +1 -1
  243. package/dist/unstable/ai/Response.js +6 -7
  244. package/dist/unstable/ai/Response.js.map +1 -1
  245. package/dist/unstable/ai/ResponseIdTracker.d.ts +2 -2
  246. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  247. package/dist/unstable/ai/ResponseIdTracker.js +2 -2
  248. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  249. package/dist/unstable/ai/Telemetry.d.ts +35 -2
  250. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  251. package/dist/unstable/ai/Telemetry.js +2 -2
  252. package/dist/unstable/ai/Telemetry.js.map +1 -1
  253. package/dist/unstable/ai/Tokenizer.d.ts +2 -2
  254. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  255. package/dist/unstable/ai/Tokenizer.js +2 -2
  256. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  257. package/dist/unstable/ai/Tool.d.ts +16 -16
  258. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  259. package/dist/unstable/ai/Tool.js +41 -13
  260. package/dist/unstable/ai/Tool.js.map +1 -1
  261. package/dist/unstable/ai/Toolkit.d.ts +3 -3
  262. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  263. package/dist/unstable/ai/Toolkit.js +10 -10
  264. package/dist/unstable/ai/Toolkit.js.map +1 -1
  265. package/dist/unstable/ai/internal/codec-transformer.js +5 -2
  266. package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
  267. package/dist/unstable/cli/Argument.d.ts +2 -3
  268. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  269. package/dist/unstable/cli/Argument.js.map +1 -1
  270. package/dist/unstable/cli/CliError.d.ts +29 -8
  271. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  272. package/dist/unstable/cli/CliError.js +8 -1
  273. package/dist/unstable/cli/CliError.js.map +1 -1
  274. package/dist/unstable/cli/CliOutput.d.ts +2 -2
  275. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  276. package/dist/unstable/cli/CliOutput.js +2 -2
  277. package/dist/unstable/cli/CliOutput.js.map +1 -1
  278. package/dist/unstable/cli/Command.d.ts +14 -14
  279. package/dist/unstable/cli/Command.d.ts.map +1 -1
  280. package/dist/unstable/cli/Command.js +11 -10
  281. package/dist/unstable/cli/Command.js.map +1 -1
  282. package/dist/unstable/cli/Flag.d.ts +2 -3
  283. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  284. package/dist/unstable/cli/Flag.js.map +1 -1
  285. package/dist/unstable/cli/GlobalFlag.d.ts +2 -2
  286. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  287. package/dist/unstable/cli/GlobalFlag.js +2 -2
  288. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  289. package/dist/unstable/cli/HelpDoc.d.ts +8 -8
  290. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  291. package/dist/unstable/cli/Param.d.ts +30 -2
  292. package/dist/unstable/cli/Param.d.ts.map +1 -1
  293. package/dist/unstable/cli/Param.js +17 -7
  294. package/dist/unstable/cli/Param.js.map +1 -1
  295. package/dist/unstable/cli/Prompt.js +8 -2
  296. package/dist/unstable/cli/Prompt.js.map +1 -1
  297. package/dist/unstable/cli/internal/command.d.ts +5 -5
  298. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  299. package/dist/unstable/cli/internal/command.js +3 -3
  300. package/dist/unstable/cli/internal/command.js.map +1 -1
  301. package/dist/unstable/cli/internal/parser.js +94 -15
  302. package/dist/unstable/cli/internal/parser.js.map +1 -1
  303. package/dist/unstable/cluster/ClusterError.d.ts +7 -7
  304. package/dist/unstable/cluster/ClusterSchema.d.ts +12 -9
  305. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  306. package/dist/unstable/cluster/ClusterSchema.js +9 -9
  307. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  308. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +1 -0
  309. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  310. package/dist/unstable/cluster/ClusterWorkflowEngine.js +68 -40
  311. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  312. package/dist/unstable/cluster/Entity.d.ts +10 -10
  313. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  314. package/dist/unstable/cluster/Entity.js +25 -20
  315. package/dist/unstable/cluster/Entity.js.map +1 -1
  316. package/dist/unstable/cluster/EntityAddress.d.ts +2 -2
  317. package/dist/unstable/cluster/EntityProxy.js +3 -3
  318. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  319. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  320. package/dist/unstable/cluster/EntityProxyServer.js +4 -4
  321. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  322. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  323. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  324. package/dist/unstable/cluster/EntityResource.js +2 -2
  325. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  326. package/dist/unstable/cluster/Envelope.d.ts +3 -3
  327. package/dist/unstable/cluster/HttpRunner.js +2 -2
  328. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  329. package/dist/unstable/cluster/K8sHttpClient.d.ts +4 -4
  330. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  331. package/dist/unstable/cluster/K8sHttpClient.js +2 -2
  332. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  333. package/dist/unstable/cluster/Message.d.ts +7 -4
  334. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  335. package/dist/unstable/cluster/Message.js +5 -5
  336. package/dist/unstable/cluster/Message.js.map +1 -1
  337. package/dist/unstable/cluster/MessageStorage.d.ts +14 -14
  338. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  339. package/dist/unstable/cluster/MessageStorage.js +8 -8
  340. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  341. package/dist/unstable/cluster/Reply.d.ts +2 -2
  342. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  343. package/dist/unstable/cluster/Reply.js +5 -5
  344. package/dist/unstable/cluster/Reply.js.map +1 -1
  345. package/dist/unstable/cluster/Runner.d.ts +1 -1
  346. package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
  347. package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
  348. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  349. package/dist/unstable/cluster/RunnerHealth.js +2 -2
  350. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  351. package/dist/unstable/cluster/RunnerServer.js +1 -1
  352. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  353. package/dist/unstable/cluster/RunnerStorage.d.ts +12 -12
  354. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  355. package/dist/unstable/cluster/RunnerStorage.js +3 -3
  356. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  357. package/dist/unstable/cluster/Runners.d.ts +3 -3
  358. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  359. package/dist/unstable/cluster/Runners.js +7 -7
  360. package/dist/unstable/cluster/Runners.js.map +1 -1
  361. package/dist/unstable/cluster/ShardId.d.ts +35 -49
  362. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  363. package/dist/unstable/cluster/ShardId.js +65 -67
  364. package/dist/unstable/cluster/ShardId.js.map +1 -1
  365. package/dist/unstable/cluster/Sharding.d.ts +2 -2
  366. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  367. package/dist/unstable/cluster/Sharding.js +21 -21
  368. package/dist/unstable/cluster/Sharding.js.map +1 -1
  369. package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
  370. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  371. package/dist/unstable/cluster/ShardingConfig.js +5 -5
  372. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  373. package/dist/unstable/cluster/SingletonAddress.d.ts +2 -2
  374. package/dist/unstable/cluster/Snowflake.d.ts +2 -2
  375. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  376. package/dist/unstable/cluster/Snowflake.js +2 -2
  377. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  378. package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
  379. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  380. package/dist/unstable/cluster/internal/entityManager.js +15 -14
  381. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  382. package/dist/unstable/cluster/internal/entityReaper.js +2 -2
  383. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  384. package/dist/unstable/cluster/internal/resourceMap.js +3 -3
  385. package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
  386. package/dist/unstable/devtools/DevToolsClient.d.ts +2 -2
  387. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  388. package/dist/unstable/devtools/DevToolsClient.js +5 -5
  389. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  390. package/dist/unstable/eventlog/EventJournal.d.ts +4 -4
  391. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  392. package/dist/unstable/eventlog/EventJournal.js +2 -2
  393. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  394. package/dist/unstable/eventlog/EventLog.d.ts +5 -5
  395. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  396. package/dist/unstable/eventlog/EventLog.js +18 -18
  397. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  398. package/dist/unstable/eventlog/EventLogEncryption.d.ts +2 -2
  399. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  400. package/dist/unstable/eventlog/EventLogEncryption.js +2 -2
  401. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  402. package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -12
  403. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  404. package/dist/unstable/eventlog/EventLogRemote.js +2 -2
  405. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  406. package/dist/unstable/eventlog/EventLogServer.d.ts +3 -3
  407. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  408. package/dist/unstable/eventlog/EventLogServer.js +2 -2
  409. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  410. package/dist/unstable/http/Etag.d.ts +2 -2
  411. package/dist/unstable/http/Etag.d.ts.map +1 -1
  412. package/dist/unstable/http/Etag.js +2 -2
  413. package/dist/unstable/http/Etag.js.map +1 -1
  414. package/dist/unstable/http/FetchHttpClient.d.ts +6 -3
  415. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  416. package/dist/unstable/http/FetchHttpClient.js +5 -5
  417. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  418. package/dist/unstable/http/Headers.d.ts +5 -2
  419. package/dist/unstable/http/Headers.d.ts.map +1 -1
  420. package/dist/unstable/http/Headers.js +3 -3
  421. package/dist/unstable/http/Headers.js.map +1 -1
  422. package/dist/unstable/http/HttpClient.d.ts +8 -6
  423. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  424. package/dist/unstable/http/HttpClient.js +6 -6
  425. package/dist/unstable/http/HttpClient.js.map +1 -1
  426. package/dist/unstable/http/HttpClientError.d.ts +1 -1
  427. package/dist/unstable/http/HttpClientRequest.d.ts +2 -2
  428. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  429. package/dist/unstable/http/HttpClientRequest.js +4 -4
  430. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  431. package/dist/unstable/http/HttpEffect.d.ts +6 -6
  432. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  433. package/dist/unstable/http/HttpEffect.js +24 -24
  434. package/dist/unstable/http/HttpEffect.js.map +1 -1
  435. package/dist/unstable/http/HttpIncomingMessage.d.ts +2 -2
  436. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  437. package/dist/unstable/http/HttpIncomingMessage.js +2 -2
  438. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  439. package/dist/unstable/http/HttpMiddleware.d.ts +3 -3
  440. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  441. package/dist/unstable/http/HttpMiddleware.js +26 -14
  442. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  443. package/dist/unstable/http/HttpPlatform.d.ts +2 -2
  444. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  445. package/dist/unstable/http/HttpPlatform.js +2 -2
  446. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  447. package/dist/unstable/http/HttpRouter.d.ts +7 -7
  448. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  449. package/dist/unstable/http/HttpRouter.js +29 -29
  450. package/dist/unstable/http/HttpRouter.js.map +1 -1
  451. package/dist/unstable/http/HttpServer.d.ts +2 -2
  452. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  453. package/dist/unstable/http/HttpServer.js +2 -2
  454. package/dist/unstable/http/HttpServer.js.map +1 -1
  455. package/dist/unstable/http/HttpServerError.d.ts +3 -3
  456. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  457. package/dist/unstable/http/HttpServerError.js +3 -3
  458. package/dist/unstable/http/HttpServerError.js.map +1 -1
  459. package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
  460. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  461. package/dist/unstable/http/HttpServerRequest.js +6 -6
  462. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  463. package/dist/unstable/http/HttpServerResponse.d.ts +2 -2
  464. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  465. package/dist/unstable/http/HttpServerResponse.js +6 -6
  466. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  467. package/dist/unstable/http/Multipart.d.ts +6 -6
  468. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  469. package/dist/unstable/http/Multipart.js +7 -7
  470. package/dist/unstable/http/Multipart.js.map +1 -1
  471. package/dist/unstable/httpapi/HttpApi.d.ts +9 -9
  472. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  473. package/dist/unstable/httpapi/HttpApi.js +8 -8
  474. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  475. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -3
  476. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  477. package/dist/unstable/httpapi/HttpApiBuilder.js +20 -20
  478. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  479. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  480. package/dist/unstable/httpapi/HttpApiClient.js +1 -1
  481. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  482. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +7 -7
  483. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  484. package/dist/unstable/httpapi/HttpApiEndpoint.js +4 -4
  485. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  486. package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
  487. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  488. package/dist/unstable/httpapi/HttpApiGroup.d.ts +8 -8
  489. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  490. package/dist/unstable/httpapi/HttpApiGroup.js +4 -4
  491. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  492. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +6 -6
  493. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  494. package/dist/unstable/httpapi/HttpApiMiddleware.js +5 -5
  495. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  496. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +9 -6
  497. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  498. package/dist/unstable/httpapi/HttpApiSecurity.js +6 -6
  499. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  500. package/dist/unstable/httpapi/OpenApi.d.ts +15 -15
  501. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  502. package/dist/unstable/httpapi/OpenApi.js +23 -23
  503. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  504. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  505. package/dist/unstable/observability/OtlpExporter.js +5 -5
  506. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  507. package/dist/unstable/observability/OtlpMetrics.js +1 -1
  508. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  509. package/dist/unstable/observability/OtlpSerialization.d.ts +2 -2
  510. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  511. package/dist/unstable/observability/OtlpSerialization.js +2 -2
  512. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  513. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  514. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  515. package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
  516. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  517. package/dist/unstable/observability/PrometheusMetrics.js +4 -33
  518. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  519. package/dist/unstable/persistence/KeyValueStore.d.ts +23 -2
  520. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  521. package/dist/unstable/persistence/KeyValueStore.js +144 -2
  522. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  523. package/dist/unstable/persistence/PersistedCache.d.ts +1 -2
  524. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  525. package/dist/unstable/persistence/PersistedCache.js +10 -11
  526. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  527. package/dist/unstable/persistence/PersistedQueue.d.ts +4 -4
  528. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  529. package/dist/unstable/persistence/PersistedQueue.js +3 -3
  530. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  531. package/dist/unstable/persistence/Persistence.d.ts +4 -4
  532. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  533. package/dist/unstable/persistence/Persistence.js +3 -3
  534. package/dist/unstable/persistence/Persistence.js.map +1 -1
  535. package/dist/unstable/persistence/RateLimiter.d.ts +6 -6
  536. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  537. package/dist/unstable/persistence/RateLimiter.js +3 -3
  538. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  539. package/dist/unstable/persistence/Redis.d.ts +3 -3
  540. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  541. package/dist/unstable/persistence/Redis.js +2 -2
  542. package/dist/unstable/persistence/Redis.js.map +1 -1
  543. package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -2
  544. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  545. package/dist/unstable/process/ChildProcessSpawner.js +2 -2
  546. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  547. package/dist/unstable/reactivity/Atom.d.ts +36 -36
  548. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  549. package/dist/unstable/reactivity/Atom.js +9 -9
  550. package/dist/unstable/reactivity/Atom.js.map +1 -1
  551. package/dist/unstable/reactivity/AtomHttpApi.d.ts +3 -3
  552. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  553. package/dist/unstable/reactivity/AtomHttpApi.js +2 -2
  554. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  555. package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
  556. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  557. package/dist/unstable/reactivity/AtomRegistry.js +3 -3
  558. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  559. package/dist/unstable/reactivity/AtomRpc.d.ts +3 -3
  560. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  561. package/dist/unstable/reactivity/AtomRpc.js +2 -2
  562. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  563. package/dist/unstable/reactivity/Reactivity.d.ts +2 -2
  564. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  565. package/dist/unstable/reactivity/Reactivity.js +6 -6
  566. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  567. package/dist/unstable/rpc/Rpc.d.ts +11 -11
  568. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  569. package/dist/unstable/rpc/Rpc.js +4 -4
  570. package/dist/unstable/rpc/Rpc.js.map +1 -1
  571. package/dist/unstable/rpc/RpcClient.d.ts +18 -8
  572. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  573. package/dist/unstable/rpc/RpcClient.js +27 -18
  574. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  575. package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
  576. package/dist/unstable/rpc/RpcGroup.d.ts +7 -7
  577. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  578. package/dist/unstable/rpc/RpcGroup.js +20 -20
  579. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  580. package/dist/unstable/rpc/RpcMiddleware.d.ts +6 -6
  581. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  582. package/dist/unstable/rpc/RpcMiddleware.js +5 -5
  583. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  584. package/dist/unstable/rpc/RpcSchema.d.ts +3 -3
  585. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  586. package/dist/unstable/rpc/RpcSchema.js +3 -3
  587. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  588. package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
  589. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  590. package/dist/unstable/rpc/RpcSerialization.js +7 -7
  591. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  592. package/dist/unstable/rpc/RpcServer.d.ts +2 -2
  593. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  594. package/dist/unstable/rpc/RpcServer.js +18 -18
  595. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  596. package/dist/unstable/rpc/RpcWorker.d.ts +2 -2
  597. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  598. package/dist/unstable/rpc/RpcWorker.js +4 -4
  599. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  600. package/dist/unstable/rpc/Utils.d.ts +0 -3
  601. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  602. package/dist/unstable/rpc/Utils.js +2 -5
  603. package/dist/unstable/rpc/Utils.js.map +1 -1
  604. package/dist/unstable/socket/Socket.d.ts +10 -10
  605. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  606. package/dist/unstable/socket/Socket.js +9 -9
  607. package/dist/unstable/socket/Socket.js.map +1 -1
  608. package/dist/unstable/socket/SocketServer.d.ts +5 -2
  609. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  610. package/dist/unstable/socket/SocketServer.js +2 -2
  611. package/dist/unstable/socket/SocketServer.js.map +1 -1
  612. package/dist/unstable/sql/SqlClient.d.ts +5 -5
  613. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  614. package/dist/unstable/sql/SqlClient.js +7 -7
  615. package/dist/unstable/sql/SqlClient.js.map +1 -1
  616. package/dist/unstable/sql/SqlConnection.d.ts +2 -2
  617. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  618. package/dist/unstable/sql/SqlConnection.js +5 -2
  619. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  620. package/dist/unstable/sql/SqlError.d.ts +12 -12
  621. package/dist/unstable/sql/SqlModel.d.ts +8 -9
  622. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  623. package/dist/unstable/sql/SqlModel.js +9 -35
  624. package/dist/unstable/sql/SqlModel.js.map +1 -1
  625. package/dist/unstable/sql/SqlResolver.js +11 -11
  626. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  627. package/dist/unstable/sql/Statement.d.ts +2 -2
  628. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  629. package/dist/unstable/sql/Statement.js +2 -2
  630. package/dist/unstable/sql/Statement.js.map +1 -1
  631. package/dist/unstable/workers/Transferable.d.ts +2 -2
  632. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  633. package/dist/unstable/workers/Transferable.js +6 -6
  634. package/dist/unstable/workers/Transferable.js.map +1 -1
  635. package/dist/unstable/workers/Worker.d.ts +3 -3
  636. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  637. package/dist/unstable/workers/Worker.js +6 -3
  638. package/dist/unstable/workers/Worker.js.map +1 -1
  639. package/dist/unstable/workers/WorkerError.d.ts +5 -5
  640. package/dist/unstable/workers/WorkerRunner.d.ts +2 -2
  641. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  642. package/dist/unstable/workers/WorkerRunner.js +5 -2
  643. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  644. package/dist/unstable/workflow/Activity.d.ts +7 -7
  645. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  646. package/dist/unstable/workflow/Activity.js +7 -7
  647. package/dist/unstable/workflow/Activity.js.map +1 -1
  648. package/dist/unstable/workflow/DurableClock.d.ts +0 -3
  649. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  650. package/dist/unstable/workflow/DurableClock.js +3 -3
  651. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  652. package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
  653. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  654. package/dist/unstable/workflow/DurableDeferred.js +7 -7
  655. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  656. package/dist/unstable/workflow/Workflow.d.ts +9 -9
  657. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  658. package/dist/unstable/workflow/Workflow.js +18 -18
  659. package/dist/unstable/workflow/Workflow.js.map +1 -1
  660. package/dist/unstable/workflow/WorkflowEngine.d.ts +9 -3
  661. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  662. package/dist/unstable/workflow/WorkflowEngine.js +14 -5
  663. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  664. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  665. package/dist/unstable/workflow/WorkflowProxyServer.js +4 -4
  666. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  667. package/package.json +1 -1
  668. package/src/Cache.ts +18 -46
  669. package/src/Cause.ts +21 -21
  670. package/src/Channel.ts +120 -79
  671. package/src/Clock.ts +2 -2
  672. package/src/Config.ts +2 -2
  673. package/src/ConfigProvider.ts +5 -5
  674. package/src/Console.ts +2 -2
  675. package/src/{ServiceMap.ts → Context.ts} +337 -340
  676. package/src/DateTime.ts +2 -2
  677. package/src/Effect.ts +182 -184
  678. package/src/ErrorReporter.ts +3 -3
  679. package/src/ExecutionPlan.ts +8 -9
  680. package/src/Fiber.ts +7 -7
  681. package/src/FiberHandle.ts +5 -5
  682. package/src/FiberMap.ts +5 -5
  683. package/src/FiberSet.ts +5 -5
  684. package/src/FileSystem.ts +3 -3
  685. package/src/Layer.ts +358 -305
  686. package/src/LayerMap.ts +27 -26
  687. package/src/Logger.ts +3 -3
  688. package/src/ManagedRuntime.ts +32 -32
  689. package/src/Metric.ts +58 -58
  690. package/src/Path.ts +2 -2
  691. package/src/Pool.ts +5 -5
  692. package/src/PubSub.ts +3 -3
  693. package/src/Random.ts +2 -2
  694. package/src/RcMap.ts +14 -14
  695. package/src/Redactable.ts +146 -72
  696. package/src/References.ts +14 -14
  697. package/src/Request.ts +5 -5
  698. package/src/RequestResolver.ts +6 -7
  699. package/src/Resource.ts +4 -4
  700. package/src/Schedule.ts +2 -2
  701. package/src/Scheduler.ts +4 -4
  702. package/src/Schema.ts +837 -397
  703. package/src/SchemaAST.ts +5 -14
  704. package/src/SchemaGetter.ts +69 -11
  705. package/src/SchemaTransformation.ts +166 -0
  706. package/src/Scope.ts +2 -2
  707. package/src/ScopedCache.ts +5 -5
  708. package/src/Sink.ts +9 -9
  709. package/src/Stdio.ts +2 -2
  710. package/src/Stream.ts +234 -158
  711. package/src/Terminal.ts +3 -3
  712. package/src/Tracer.ts +17 -17
  713. package/src/Unify.ts +26 -2
  714. package/src/index.ts +82 -16
  715. package/src/internal/core.ts +7 -7
  716. package/src/internal/effect.ts +106 -106
  717. package/src/internal/layer.ts +7 -7
  718. package/src/internal/random.ts +2 -2
  719. package/src/internal/rcRef.ts +10 -10
  720. package/src/internal/references.ts +13 -13
  721. package/src/internal/request.ts +8 -8
  722. package/src/internal/schedule.ts +3 -1
  723. package/src/internal/schema/representation.ts +8 -1
  724. package/src/internal/schema/schema.ts +24 -1
  725. package/src/testing/TestSchema.ts +3 -3
  726. package/src/unstable/ai/AiError.ts +3 -2
  727. package/src/unstable/ai/AnthropicStructuredOutput.ts +3 -3
  728. package/src/unstable/ai/Chat.ts +3 -3
  729. package/src/unstable/ai/EmbeddingModel.ts +3 -3
  730. package/src/unstable/ai/IdGenerator.ts +2 -2
  731. package/src/unstable/ai/LanguageModel.ts +2 -2
  732. package/src/unstable/ai/McpSchema.ts +11 -9
  733. package/src/unstable/ai/McpServer.ts +44 -44
  734. package/src/unstable/ai/Model.ts +8 -8
  735. package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
  736. package/src/unstable/ai/Prompt.ts +6 -12
  737. package/src/unstable/ai/Response.ts +6 -8
  738. package/src/unstable/ai/ResponseIdTracker.ts +2 -4
  739. package/src/unstable/ai/Telemetry.ts +2 -2
  740. package/src/unstable/ai/Tokenizer.ts +2 -2
  741. package/src/unstable/ai/Tool.ts +25 -25
  742. package/src/unstable/ai/Toolkit.ts +12 -12
  743. package/src/unstable/ai/internal/codec-transformer.ts +3 -2
  744. package/src/unstable/cli/Argument.ts +3 -4
  745. package/src/unstable/cli/CliError.ts +22 -9
  746. package/src/unstable/cli/CliOutput.ts +2 -2
  747. package/src/unstable/cli/Command.ts +36 -30
  748. package/src/unstable/cli/Flag.ts +3 -4
  749. package/src/unstable/cli/GlobalFlag.ts +3 -3
  750. package/src/unstable/cli/HelpDoc.ts +8 -8
  751. package/src/unstable/cli/Param.ts +39 -16
  752. package/src/unstable/cli/Prompt.ts +13 -6
  753. package/src/unstable/cli/internal/command.ts +7 -7
  754. package/src/unstable/cli/internal/parser.ts +130 -21
  755. package/src/unstable/cluster/ClusterSchema.ts +12 -12
  756. package/src/unstable/cluster/ClusterWorkflowEngine.ts +91 -53
  757. package/src/unstable/cluster/Entity.ts +43 -32
  758. package/src/unstable/cluster/EntityProxy.ts +3 -3
  759. package/src/unstable/cluster/EntityProxyServer.ts +4 -4
  760. package/src/unstable/cluster/EntityResource.ts +2 -2
  761. package/src/unstable/cluster/HttpRunner.ts +2 -2
  762. package/src/unstable/cluster/K8sHttpClient.ts +2 -2
  763. package/src/unstable/cluster/Message.ts +8 -8
  764. package/src/unstable/cluster/MessageStorage.ts +11 -11
  765. package/src/unstable/cluster/Reply.ts +7 -7
  766. package/src/unstable/cluster/RunnerHealth.ts +2 -2
  767. package/src/unstable/cluster/RunnerServer.ts +1 -1
  768. package/src/unstable/cluster/RunnerStorage.ts +9 -9
  769. package/src/unstable/cluster/Runners.ts +7 -7
  770. package/src/unstable/cluster/ShardId.ts +84 -74
  771. package/src/unstable/cluster/Sharding.ts +26 -26
  772. package/src/unstable/cluster/ShardingConfig.ts +5 -5
  773. package/src/unstable/cluster/Snowflake.ts +2 -2
  774. package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
  775. package/src/unstable/cluster/internal/entityManager.ts +27 -23
  776. package/src/unstable/cluster/internal/entityReaper.ts +2 -2
  777. package/src/unstable/cluster/internal/resourceMap.ts +3 -3
  778. package/src/unstable/devtools/DevToolsClient.ts +5 -5
  779. package/src/unstable/eventlog/EventJournal.ts +2 -2
  780. package/src/unstable/eventlog/EventLog.ts +21 -21
  781. package/src/unstable/eventlog/EventLogEncryption.ts +2 -2
  782. package/src/unstable/eventlog/EventLogRemote.ts +2 -2
  783. package/src/unstable/eventlog/EventLogServer.ts +2 -2
  784. package/src/unstable/http/Etag.ts +2 -2
  785. package/src/unstable/http/FetchHttpClient.ts +5 -5
  786. package/src/unstable/http/Headers.ts +4 -4
  787. package/src/unstable/http/HttpClient.ts +9 -8
  788. package/src/unstable/http/HttpClientRequest.ts +5 -5
  789. package/src/unstable/http/HttpEffect.ts +35 -35
  790. package/src/unstable/http/HttpIncomingMessage.ts +2 -2
  791. package/src/unstable/http/HttpMiddleware.ts +28 -14
  792. package/src/unstable/http/HttpPlatform.ts +2 -2
  793. package/src/unstable/http/HttpRouter.ts +37 -37
  794. package/src/unstable/http/HttpServer.ts +2 -2
  795. package/src/unstable/http/HttpServerError.ts +4 -4
  796. package/src/unstable/http/HttpServerRequest.ts +7 -7
  797. package/src/unstable/http/HttpServerResponse.ts +8 -8
  798. package/src/unstable/http/Multipart.ts +8 -8
  799. package/src/unstable/httpapi/HttpApi.ts +18 -18
  800. package/src/unstable/httpapi/HttpApiBuilder.ts +20 -20
  801. package/src/unstable/httpapi/HttpApiClient.ts +4 -4
  802. package/src/unstable/httpapi/HttpApiEndpoint.ts +14 -14
  803. package/src/unstable/httpapi/HttpApiGroup.ts +16 -16
  804. package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -14
  805. package/src/unstable/httpapi/HttpApiSecurity.ts +13 -13
  806. package/src/unstable/httpapi/OpenApi.ts +29 -31
  807. package/src/unstable/observability/OtlpExporter.ts +5 -5
  808. package/src/unstable/observability/OtlpMetrics.ts +1 -1
  809. package/src/unstable/observability/OtlpSerialization.ts +2 -2
  810. package/src/unstable/observability/OtlpTracer.ts +2 -2
  811. package/src/unstable/observability/PrometheusMetrics.ts +5 -5
  812. package/src/unstable/persistence/KeyValueStore.ts +226 -3
  813. package/src/unstable/persistence/PersistedCache.ts +20 -17
  814. package/src/unstable/persistence/PersistedQueue.ts +3 -3
  815. package/src/unstable/persistence/Persistence.ts +4 -4
  816. package/src/unstable/persistence/RateLimiter.ts +3 -3
  817. package/src/unstable/persistence/Redis.ts +2 -2
  818. package/src/unstable/process/ChildProcessSpawner.ts +46 -2
  819. package/src/unstable/reactivity/Atom.ts +79 -79
  820. package/src/unstable/reactivity/AtomHttpApi.ts +4 -4
  821. package/src/unstable/reactivity/AtomRegistry.ts +4 -4
  822. package/src/unstable/reactivity/AtomRpc.ts +4 -4
  823. package/src/unstable/reactivity/Reactivity.ts +6 -6
  824. package/src/unstable/rpc/Rpc.ts +17 -17
  825. package/src/unstable/rpc/RpcClient.ts +44 -30
  826. package/src/unstable/rpc/RpcGroup.ts +30 -30
  827. package/src/unstable/rpc/RpcMiddleware.ts +14 -14
  828. package/src/unstable/rpc/RpcSchema.ts +4 -4
  829. package/src/unstable/rpc/RpcSerialization.ts +7 -7
  830. package/src/unstable/rpc/RpcServer.ts +19 -19
  831. package/src/unstable/rpc/RpcWorker.ts +5 -5
  832. package/src/unstable/rpc/Utils.ts +4 -4
  833. package/src/unstable/socket/Socket.ts +9 -9
  834. package/src/unstable/socket/SocketServer.ts +2 -2
  835. package/src/unstable/sql/SqlClient.ts +11 -11
  836. package/src/unstable/sql/SqlConnection.ts +2 -2
  837. package/src/unstable/sql/SqlModel.ts +54 -82
  838. package/src/unstable/sql/SqlResolver.ts +11 -11
  839. package/src/unstable/sql/Statement.ts +2 -2
  840. package/src/unstable/workers/Transferable.ts +6 -6
  841. package/src/unstable/workers/Worker.ts +4 -4
  842. package/src/unstable/workers/WorkerRunner.ts +2 -2
  843. package/src/unstable/workflow/Activity.ts +14 -14
  844. package/src/unstable/workflow/DurableClock.ts +3 -3
  845. package/src/unstable/workflow/DurableDeferred.ts +8 -8
  846. package/src/unstable/workflow/Workflow.ts +23 -23
  847. package/src/unstable/workflow/WorkflowEngine.ts +28 -6
  848. package/src/unstable/workflow/WorkflowProxyServer.ts +4 -4
  849. package/dist/ServiceMap.d.ts +0 -1150
  850. package/dist/ServiceMap.d.ts.map +0 -1
  851. package/dist/ServiceMap.js.map +0 -1
package/src/Effect.ts CHANGED
@@ -71,6 +71,7 @@
71
71
  import type * as Arr from "./Array.ts"
72
72
  import type * as Cause from "./Cause.ts"
73
73
  import type { Clock } from "./Clock.ts"
74
+ import * as Context from "./Context.ts"
74
75
  import * as Duration from "./Duration.ts"
75
76
  import type { ExecutionPlan } from "./ExecutionPlan.ts"
76
77
  import * as Exit from "./Exit.ts"
@@ -98,7 +99,6 @@ import type * as Result from "./Result.ts"
98
99
  import type { Schedule } from "./Schedule.ts"
99
100
  import type { Scheduler } from "./Scheduler.ts"
100
101
  import type { Scope } from "./Scope.ts"
101
- import * as ServiceMap from "./ServiceMap.ts"
102
102
  import type {
103
103
  AnySpan,
104
104
  ParentSpan,
@@ -6760,6 +6760,7 @@ export declare namespace Retry {
6760
6760
  export type Return<R, E, A, O extends Options<E>> = Effect<
6761
6761
  A,
6762
6762
  | (O extends { schedule: Schedule<infer _O, infer _I, infer _E1, infer _R> } ? E
6763
+ : O extends { times: number } ? E
6763
6764
  : O extends { until: Predicate.Refinement<E, infer E2> } ? E2
6764
6765
  : O extends { while: Predicate.Refinement<E, infer E2> } ? Exclude<E, E2>
6765
6766
  : E)
@@ -7498,9 +7499,9 @@ export const ignoreCause: <
7498
7499
  *
7499
7500
  * @example
7500
7501
  * ```ts
7501
- * import { Effect, ExecutionPlan, Layer, ServiceMap } from "effect"
7502
+ * import { Effect, ExecutionPlan, Layer, Context } from "effect"
7502
7503
  *
7503
- * const Endpoint = ServiceMap.Service<{ url: string }>("Endpoint")
7504
+ * const Endpoint = Context.Service<{ url: string }>("Endpoint")
7504
7505
  *
7505
7506
  * const fetchUrl = Effect.gen(function*() {
7506
7507
  * const endpoint = yield* Effect.service(Endpoint)
@@ -7532,9 +7533,9 @@ export const withExecutionPlan: {
7532
7533
  *
7533
7534
  * @example
7534
7535
  * ```ts
7535
- * import { Effect, ExecutionPlan, Layer, ServiceMap } from "effect"
7536
+ * import { Effect, ExecutionPlan, Layer, Context } from "effect"
7536
7537
  *
7537
- * const Endpoint = ServiceMap.Service<{ url: string }>("Endpoint")
7538
+ * const Endpoint = Context.Service<{ url: string }>("Endpoint")
7538
7539
  *
7539
7540
  * const fetchUrl = Effect.gen(function*() {
7540
7541
  * const endpoint = yield* Effect.service(Endpoint)
@@ -7570,9 +7571,9 @@ export const withExecutionPlan: {
7570
7571
  *
7571
7572
  * @example
7572
7573
  * ```ts
7573
- * import { Effect, ExecutionPlan, Layer, ServiceMap } from "effect"
7574
+ * import { Effect, ExecutionPlan, Layer, Context } from "effect"
7574
7575
  *
7575
- * const Endpoint = ServiceMap.Service<{ url: string }>("Endpoint")
7576
+ * const Endpoint = Context.Service<{ url: string }>("Endpoint")
7576
7577
  *
7577
7578
  * const fetchUrl = Effect.gen(function*() {
7578
7579
  * const endpoint = yield* Effect.service(Endpoint)
@@ -10501,7 +10502,7 @@ export const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boolean, neve
10501
10502
  // -----------------------------------------------------------------------------
10502
10503
 
10503
10504
  /**
10504
- * Returns the complete service map from the current context.
10505
+ * Returns the complete context.
10505
10506
  *
10506
10507
  * This function allows you to access all services that are currently available
10507
10508
  * in the effect's environment. This can be useful for debugging, introspection,
@@ -10509,57 +10510,57 @@ export const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boolean, neve
10509
10510
  *
10510
10511
  * @example
10511
10512
  * ```ts
10512
- * import { Console, Effect, Option, ServiceMap } from "effect"
10513
+ * import { Console, Effect, Option, Context } from "effect"
10513
10514
  *
10514
- * const Logger = ServiceMap.Service<{
10515
+ * const Logger = Context.Service<{
10515
10516
  * log: (msg: string) => void
10516
10517
  * }>("Logger")
10517
- * const Database = ServiceMap.Service<{
10518
+ * const Database = Context.Service<{
10518
10519
  * query: (sql: string) => string
10519
10520
  * }>("Database")
10520
10521
  *
10521
10522
  * const program = Effect.gen(function*() {
10522
- * const allServices = yield* Effect.services()
10523
+ * const allServices = yield* Effect.context()
10523
10524
  *
10524
10525
  * // Check if specific services are available
10525
- * const loggerOption = ServiceMap.getOption(allServices, Logger)
10526
- * const databaseOption = ServiceMap.getOption(allServices, Database)
10526
+ * const loggerOption = Context.getOption(allServices, Logger)
10527
+ * const databaseOption = Context.getOption(allServices, Database)
10527
10528
  *
10528
10529
  * yield* Console.log(`Logger available: ${Option.isSome(loggerOption)}`)
10529
10530
  * yield* Console.log(`Database available: ${Option.isSome(databaseOption)}`)
10530
10531
  * })
10531
10532
  *
10532
- * const serviceMap = ServiceMap.make(Logger, { log: console.log })
10533
- * .pipe(ServiceMap.add(Database, { query: () => "result" }))
10533
+ * const context = Context.make(Logger, { log: console.log })
10534
+ * .pipe(Context.add(Database, { query: () => "result" }))
10534
10535
  *
10535
- * const provided = Effect.provideServices(program, serviceMap)
10536
+ * const provided = Effect.provideContext(program, context)
10536
10537
  * ```
10537
10538
  *
10538
10539
  * @since 2.0.0
10539
10540
  * @category Environment
10540
10541
  */
10541
- export const services: <R = never>() => Effect<ServiceMap.ServiceMap<R>, never, R> = internal.services
10542
+ export const context: <R = never>() => Effect<Context.Context<R>, never, R> = internal.context
10542
10543
 
10543
10544
  /**
10544
- * Transforms the current service map using the provided function.
10545
+ * Transforms the current context using the provided function.
10545
10546
  *
10546
- * This function allows you to access the complete service map and perform
10547
+ * This function allows you to access the complete context and perform
10547
10548
  * computations based on all available services. This is useful when you need
10548
10549
  * to conditionally execute logic based on what services are available.
10549
10550
  *
10550
10551
  * @example
10551
10552
  * ```ts
10552
- * import { Console, Effect, Option, ServiceMap } from "effect"
10553
+ * import { Console, Effect, Option, Context } from "effect"
10553
10554
  *
10554
- * const Logger = ServiceMap.Service<{
10555
+ * const Logger = Context.Service<{
10555
10556
  * log: (msg: string) => void
10556
10557
  * }>("Logger")
10557
- * const Cache = ServiceMap.Service<{
10558
+ * const Cache = Context.Service<{
10558
10559
  * get: (key: string) => string | null
10559
10560
  * }>("Cache")
10560
10561
  *
10561
- * const program = Effect.servicesWith((services) => {
10562
- * const cacheOption = ServiceMap.getOption(services, Cache)
10562
+ * const program = Effect.contextWith((services) => {
10563
+ * const cacheOption = Context.getOption(services, Cache)
10563
10564
  * const hasCache = Option.isSome(cacheOption)
10564
10565
  *
10565
10566
  * if (hasCache) {
@@ -10584,9 +10585,9 @@ export const services: <R = never>() => Effect<ServiceMap.ServiceMap<R>, never,
10584
10585
  * @since 2.0.0
10585
10586
  * @category Environment
10586
10587
  */
10587
- export const servicesWith: <R, A, E, R2>(
10588
- f: (services: ServiceMap.ServiceMap<R>) => Effect<A, E, R2>
10589
- ) => Effect<A, E, R | R2> = internal.servicesWith
10588
+ export const contextWith: <R, A, E, R2>(
10589
+ f: (context: Context.Context<R>) => Effect<A, E, R2>
10590
+ ) => Effect<A, E, R | R2> = internal.contextWith
10590
10591
 
10591
10592
  /**
10592
10593
  * Provides dependencies to an effect using layers or a context. Use `options.local`
@@ -10595,13 +10596,13 @@ export const servicesWith: <R, A, E, R2>(
10595
10596
  *
10596
10597
  * @example
10597
10598
  * ```ts
10598
- * import { Effect, Layer, ServiceMap } from "effect"
10599
+ * import { Effect, Layer, Context } from "effect"
10599
10600
  *
10600
10601
  * interface Database {
10601
10602
  * readonly query: (sql: string) => Effect.Effect<string>
10602
10603
  * }
10603
10604
  *
10604
- * const Database = ServiceMap.Service<Database>("Database")
10605
+ * const Database = Context.Service<Database>("Database")
10605
10606
  *
10606
10607
  * const DatabaseLive = Layer.succeed(Database)({
10607
10608
  * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result for: ${sql}`))
@@ -10629,13 +10630,13 @@ export const provide: {
10629
10630
  *
10630
10631
  * @example
10631
10632
  * ```ts
10632
- * import { Effect, Layer, ServiceMap } from "effect"
10633
+ * import { Effect, Layer, Context } from "effect"
10633
10634
  *
10634
10635
  * interface Database {
10635
10636
  * readonly query: (sql: string) => Effect.Effect<string>
10636
10637
  * }
10637
10638
  *
10638
- * const Database = ServiceMap.Service<Database>("Database")
10639
+ * const Database = Context.Service<Database>("Database")
10639
10640
  *
10640
10641
  * const DatabaseLive = Layer.succeed(Database)({
10641
10642
  * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result for: ${sql}`))
@@ -10674,13 +10675,13 @@ export const provide: {
10674
10675
  *
10675
10676
  * @example
10676
10677
  * ```ts
10677
- * import { Effect, Layer, ServiceMap } from "effect"
10678
+ * import { Effect, Layer, Context } from "effect"
10678
10679
  *
10679
10680
  * interface Database {
10680
10681
  * readonly query: (sql: string) => Effect.Effect<string>
10681
10682
  * }
10682
10683
  *
10683
- * const Database = ServiceMap.Service<Database>("Database")
10684
+ * const Database = Context.Service<Database>("Database")
10684
10685
  *
10685
10686
  * const DatabaseLive = Layer.succeed(Database)({
10686
10687
  * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result for: ${sql}`))
@@ -10715,13 +10716,13 @@ export const provide: {
10715
10716
  *
10716
10717
  * @example
10717
10718
  * ```ts
10718
- * import { Effect, Layer, ServiceMap } from "effect"
10719
+ * import { Effect, Layer, Context } from "effect"
10719
10720
  *
10720
10721
  * interface Database {
10721
10722
  * readonly query: (sql: string) => Effect.Effect<string>
10722
10723
  * }
10723
10724
  *
10724
- * const Database = ServiceMap.Service<Database>("Database")
10725
+ * const Database = Context.Service<Database>("Database")
10725
10726
  *
10726
10727
  * const DatabaseLive = Layer.succeed(Database)({
10727
10728
  * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result for: ${sql}`))
@@ -10741,7 +10742,7 @@ export const provide: {
10741
10742
  * @since 2.0.0
10742
10743
  * @category Environment
10743
10744
  */
10744
- <R2>(context: ServiceMap.ServiceMap<R2>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, R2>>
10745
+ <R2>(context: Context.Context<R2>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, R2>>
10745
10746
  /**
10746
10747
  * Provides dependencies to an effect using layers or a context. Use `options.local`
10747
10748
  * to build the layer every time; by default, layers are shared between provide
@@ -10749,13 +10750,13 @@ export const provide: {
10749
10750
  *
10750
10751
  * @example
10751
10752
  * ```ts
10752
- * import { Effect, Layer, ServiceMap } from "effect"
10753
+ * import { Effect, Layer, Context } from "effect"
10753
10754
  *
10754
10755
  * interface Database {
10755
10756
  * readonly query: (sql: string) => Effect.Effect<string>
10756
10757
  * }
10757
10758
  *
10758
- * const Database = ServiceMap.Service<Database>("Database")
10759
+ * const Database = Context.Service<Database>("Database")
10759
10760
  *
10760
10761
  * const DatabaseLive = Layer.succeed(Database)({
10761
10762
  * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result for: ${sql}`))
@@ -10793,13 +10794,13 @@ export const provide: {
10793
10794
  *
10794
10795
  * @example
10795
10796
  * ```ts
10796
- * import { Effect, Layer, ServiceMap } from "effect"
10797
+ * import { Effect, Layer, Context } from "effect"
10797
10798
  *
10798
10799
  * interface Database {
10799
10800
  * readonly query: (sql: string) => Effect.Effect<string>
10800
10801
  * }
10801
10802
  *
10802
- * const Database = ServiceMap.Service<Database>("Database")
10803
+ * const Database = Context.Service<Database>("Database")
10803
10804
  *
10804
10805
  * const DatabaseLive = Layer.succeed(Database)({
10805
10806
  * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result for: ${sql}`))
@@ -10833,13 +10834,13 @@ export const provide: {
10833
10834
  *
10834
10835
  * @example
10835
10836
  * ```ts
10836
- * import { Effect, Layer, ServiceMap } from "effect"
10837
+ * import { Effect, Layer, Context } from "effect"
10837
10838
  *
10838
10839
  * interface Database {
10839
10840
  * readonly query: (sql: string) => Effect.Effect<string>
10840
10841
  * }
10841
10842
  *
10842
- * const Database = ServiceMap.Service<Database>("Database")
10843
+ * const Database = Context.Service<Database>("Database")
10843
10844
  *
10844
10845
  * const DatabaseLive = Layer.succeed(Database)({
10845
10846
  * query: Effect.fn("Database.query")((sql: string) => Effect.succeed(`Result for: ${sql}`))
@@ -10859,33 +10860,33 @@ export const provide: {
10859
10860
  * @since 2.0.0
10860
10861
  * @category Environment
10861
10862
  */
10862
- <A, E, R, R2>(self: Effect<A, E, R>, context: ServiceMap.ServiceMap<R2>): Effect<A, E, Exclude<R, R2>>
10863
+ <A, E, R, R2>(self: Effect<A, E, R>, context: Context.Context<R2>): Effect<A, E, Exclude<R, R2>>
10863
10864
  } = internalLayer.provide
10864
10865
 
10865
10866
  /**
10866
- * Provides a service map to an effect, fulfilling its service requirements.
10867
+ * Provides a context to an effect, fulfilling its service requirements.
10867
10868
  *
10868
10869
  * **Details**
10869
10870
  *
10870
- * This function provides multiple services at once by supplying a service map
10871
+ * This function provides multiple services at once by supplying a context
10871
10872
  * that contains all the required services. It removes the provided services
10872
10873
  * from the effect's requirements, making them available to the effect.
10873
10874
  *
10874
10875
  * @example
10875
10876
  * ```ts
10876
- * import { Effect, ServiceMap } from "effect"
10877
+ * import { Effect, Context } from "effect"
10877
10878
  *
10878
10879
  * // Define service keys
10879
- * const Logger = ServiceMap.Service<{
10880
+ * const Logger = Context.Service<{
10880
10881
  * log: (msg: string) => void
10881
10882
  * }>("Logger")
10882
- * const Database = ServiceMap.Service<{
10883
+ * const Database = Context.Service<{
10883
10884
  * query: (sql: string) => string
10884
10885
  * }>("Database")
10885
10886
  *
10886
- * // Create service map with multiple services
10887
- * const serviceMap = ServiceMap.make(Logger, { log: console.log })
10888
- * .pipe(ServiceMap.add(Database, { query: () => "result" }))
10887
+ * // Create a context with multiple services
10888
+ * const context = Context.make(Logger, { log: console.log })
10889
+ * .pipe(Context.add(Database, { query: () => "result" }))
10889
10890
  *
10890
10891
  * // An effect that requires both services
10891
10892
  * const program = Effect.gen(function*() {
@@ -10895,37 +10896,37 @@ export const provide: {
10895
10896
  * return db.query("SELECT * FROM users")
10896
10897
  * })
10897
10898
  *
10898
- * const provided = Effect.provideServices(program, serviceMap)
10899
+ * const provided = Effect.provideContext(program, context)
10899
10900
  * ```
10900
10901
  *
10901
10902
  * @since 2.0.0
10902
10903
  * @category Environment
10903
10904
  */
10904
- export const provideServices: {
10905
+ export const provideContext: {
10905
10906
  /**
10906
- * Provides a service map to an effect, fulfilling its service requirements.
10907
+ * Provides a context to an effect, fulfilling its service requirements.
10907
10908
  *
10908
10909
  * **Details**
10909
10910
  *
10910
- * This function provides multiple services at once by supplying a service map
10911
+ * This function provides multiple services at once by supplying a context
10911
10912
  * that contains all the required services. It removes the provided services
10912
10913
  * from the effect's requirements, making them available to the effect.
10913
10914
  *
10914
10915
  * @example
10915
10916
  * ```ts
10916
- * import { Effect, ServiceMap } from "effect"
10917
+ * import { Effect, Context } from "effect"
10917
10918
  *
10918
10919
  * // Define service keys
10919
- * const Logger = ServiceMap.Service<{
10920
+ * const Logger = Context.Service<{
10920
10921
  * log: (msg: string) => void
10921
10922
  * }>("Logger")
10922
- * const Database = ServiceMap.Service<{
10923
+ * const Database = Context.Service<{
10923
10924
  * query: (sql: string) => string
10924
10925
  * }>("Database")
10925
10926
  *
10926
- * // Create service map with multiple services
10927
- * const serviceMap = ServiceMap.make(Logger, { log: console.log })
10928
- * .pipe(ServiceMap.add(Database, { query: () => "result" }))
10927
+ * // Create a context with multiple services
10928
+ * const context = Context.make(Logger, { log: console.log })
10929
+ * .pipe(Context.add(Database, { query: () => "result" }))
10929
10930
  *
10930
10931
  * // An effect that requires both services
10931
10932
  * const program = Effect.gen(function*() {
@@ -10935,37 +10936,37 @@ export const provideServices: {
10935
10936
  * return db.query("SELECT * FROM users")
10936
10937
  * })
10937
10938
  *
10938
- * const provided = Effect.provideServices(program, serviceMap)
10939
+ * const provided = Effect.provideContext(program, context)
10939
10940
  * ```
10940
10941
  *
10941
10942
  * @since 2.0.0
10942
10943
  * @category Environment
10943
10944
  */
10944
- <XR>(context: ServiceMap.ServiceMap<XR>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, XR>>
10945
+ <XR>(context: Context.Context<XR>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, XR>>
10945
10946
  /**
10946
- * Provides a service map to an effect, fulfilling its service requirements.
10947
+ * Provides a context to an effect, fulfilling its service requirements.
10947
10948
  *
10948
10949
  * **Details**
10949
10950
  *
10950
- * This function provides multiple services at once by supplying a service map
10951
+ * This function provides multiple services at once by supplying a context
10951
10952
  * that contains all the required services. It removes the provided services
10952
10953
  * from the effect's requirements, making them available to the effect.
10953
10954
  *
10954
10955
  * @example
10955
10956
  * ```ts
10956
- * import { Effect, ServiceMap } from "effect"
10957
+ * import { Effect, Context } from "effect"
10957
10958
  *
10958
10959
  * // Define service keys
10959
- * const Logger = ServiceMap.Service<{
10960
+ * const Logger = Context.Service<{
10960
10961
  * log: (msg: string) => void
10961
10962
  * }>("Logger")
10962
- * const Database = ServiceMap.Service<{
10963
+ * const Database = Context.Service<{
10963
10964
  * query: (sql: string) => string
10964
10965
  * }>("Database")
10965
10966
  *
10966
- * // Create service map with multiple services
10967
- * const serviceMap = ServiceMap.make(Logger, { log: console.log })
10968
- * .pipe(ServiceMap.add(Database, { query: () => "result" }))
10967
+ * // Create a context with multiple services
10968
+ * const context = Context.make(Logger, { log: console.log })
10969
+ * .pipe(Context.add(Database, { query: () => "result" }))
10969
10970
  *
10970
10971
  * // An effect that requires both services
10971
10972
  * const program = Effect.gen(function*() {
@@ -10975,27 +10976,27 @@ export const provideServices: {
10975
10976
  * return db.query("SELECT * FROM users")
10976
10977
  * })
10977
10978
  *
10978
- * const provided = Effect.provideServices(program, serviceMap)
10979
+ * const provided = Effect.provideContext(program, context)
10979
10980
  * ```
10980
10981
  *
10981
10982
  * @since 2.0.0
10982
10983
  * @category Environment
10983
10984
  */
10984
- <A, E, R, XR>(self: Effect<A, E, R>, context: ServiceMap.ServiceMap<XR>): Effect<A, E, Exclude<R, XR>>
10985
- } = internal.provideServices
10985
+ <A, E, R, XR>(self: Effect<A, E, R>, context: Context.Context<XR>): Effect<A, E, Exclude<R, XR>>
10986
+ } = internal.provideContext
10986
10987
 
10987
10988
  /**
10988
10989
  * Accesses a service from the context.
10989
10990
  *
10990
10991
  * @example
10991
10992
  * ```ts
10992
- * import { Effect, ServiceMap } from "effect"
10993
+ * import { Effect, Context } from "effect"
10993
10994
  *
10994
10995
  * interface Database {
10995
10996
  * readonly query: (sql: string) => Effect.Effect<string>
10996
10997
  * }
10997
10998
  *
10998
- * const Database = ServiceMap.Service<Database>("Database")
10999
+ * const Database = Context.Service<Database>("Database")
10999
11000
  *
11000
11001
  * const program = Effect.gen(function*() {
11001
11002
  * const db = yield* Effect.service(Database)
@@ -11004,9 +11005,9 @@ export const provideServices: {
11004
11005
  * ```
11005
11006
  *
11006
11007
  * @since 4.0.0
11007
- * @category ServiceMap
11008
+ * @category Context
11008
11009
  */
11009
- export const service: <I, S>(service: ServiceMap.Key<I, S>) => Effect<S, never, I> = internal.service
11010
+ export const service: <I, S>(service: Context.Key<I, S>) => Effect<S, never, I> = internal.service
11010
11011
 
11011
11012
  /**
11012
11013
  * Optionally accesses a service from the environment.
@@ -11020,10 +11021,10 @@ export const service: <I, S>(service: ServiceMap.Key<I, S>) => Effect<S, never,
11020
11021
  *
11021
11022
  * @example
11022
11023
  * ```ts
11023
- * import { Effect, Option, ServiceMap } from "effect"
11024
+ * import { Effect, Option, Context } from "effect"
11024
11025
  *
11025
11026
  * // Define a service key
11026
- * const Logger = ServiceMap.Service<{
11027
+ * const Logger = Context.Service<{
11027
11028
  * log: (msg: string) => void
11028
11029
  * }>("Logger")
11029
11030
  *
@@ -11040,9 +11041,9 @@ export const service: <I, S>(service: ServiceMap.Key<I, S>) => Effect<S, never,
11040
11041
  * ```
11041
11042
  *
11042
11043
  * @since 2.0.0
11043
- * @category ServiceMap
11044
+ * @category Context
11044
11045
  */
11045
- export const serviceOption: <I, S>(key: ServiceMap.Key<I, S>) => Effect<Option<S>> = internal.serviceOption
11046
+ export const serviceOption: <I, S>(key: Context.Key<I, S>) => Effect<Option<S>> = internal.serviceOption
11046
11047
 
11047
11048
  /**
11048
11049
  * Provides part of the required context while leaving the rest unchanged.
@@ -11054,13 +11055,13 @@ export const serviceOption: <I, S>(key: ServiceMap.Key<I, S>) => Effect<Option<S
11054
11055
  *
11055
11056
  * @example
11056
11057
  * ```ts
11057
- * import { Effect, ServiceMap } from "effect"
11058
+ * import { Effect, Context } from "effect"
11058
11059
  *
11059
11060
  * // Define services
11060
- * const Logger = ServiceMap.Service<{
11061
+ * const Logger = Context.Service<{
11061
11062
  * log: (msg: string) => void
11062
11063
  * }>("Logger")
11063
- * const Config = ServiceMap.Service<{
11064
+ * const Config = Context.Service<{
11064
11065
  * name: string
11065
11066
  * }>("Config")
11066
11067
  *
@@ -11070,8 +11071,8 @@ export const serviceOption: <I, S>(key: ServiceMap.Key<I, S>) => Effect<Option<S
11070
11071
  *
11071
11072
  * // Transform services by providing Config while keeping Logger requirement
11072
11073
  * const configured = program.pipe(
11073
- * Effect.updateServices((services: ServiceMap.ServiceMap<typeof Logger>) =>
11074
- * ServiceMap.add(services, Config, { name: "World" })
11074
+ * Effect.updateContext((context: Context.Context<typeof Logger>) =>
11075
+ * Context.add(context, Config, { name: "World" })
11075
11076
  * )
11076
11077
  * )
11077
11078
  *
@@ -11082,9 +11083,9 @@ export const serviceOption: <I, S>(key: ServiceMap.Key<I, S>) => Effect<Option<S
11082
11083
  * ```
11083
11084
  *
11084
11085
  * @since 4.0.0
11085
- * @category ServiceMap
11086
+ * @category Context
11086
11087
  */
11087
- export const updateServices: {
11088
+ export const updateContext: {
11088
11089
  /**
11089
11090
  * Provides part of the required context while leaving the rest unchanged.
11090
11091
  *
@@ -11095,13 +11096,13 @@ export const updateServices: {
11095
11096
  *
11096
11097
  * @example
11097
11098
  * ```ts
11098
- * import { Effect, ServiceMap } from "effect"
11099
+ * import { Effect, Context } from "effect"
11099
11100
  *
11100
11101
  * // Define services
11101
- * const Logger = ServiceMap.Service<{
11102
+ * const Logger = Context.Service<{
11102
11103
  * log: (msg: string) => void
11103
11104
  * }>("Logger")
11104
- * const Config = ServiceMap.Service<{
11105
+ * const Config = Context.Service<{
11105
11106
  * name: string
11106
11107
  * }>("Config")
11107
11108
  *
@@ -11111,8 +11112,8 @@ export const updateServices: {
11111
11112
  *
11112
11113
  * // Transform services by providing Config while keeping Logger requirement
11113
11114
  * const configured = program.pipe(
11114
- * Effect.updateServices((services: ServiceMap.ServiceMap<typeof Logger>) =>
11115
- * ServiceMap.add(services, Config, { name: "World" })
11115
+ * Effect.updateContext((context: Context.Context<typeof Logger>) =>
11116
+ * Context.add(context, Config, { name: "World" })
11116
11117
  * )
11117
11118
  * )
11118
11119
  *
@@ -11123,11 +11124,9 @@ export const updateServices: {
11123
11124
  * ```
11124
11125
  *
11125
11126
  * @since 4.0.0
11126
- * @category ServiceMap
11127
+ * @category Context
11127
11128
  */
11128
- <R2, R>(
11129
- f: (services: ServiceMap.ServiceMap<R2>) => ServiceMap.ServiceMap<NoInfer<R>>
11130
- ): <A, E>(self: Effect<A, E, R>) => Effect<A, E, R2>
11129
+ <R2, R>(f: (context: Context.Context<R2>) => Context.Context<NoInfer<R>>): <A, E>(self: Effect<A, E, R>) => Effect<A, E, R2>
11131
11130
  /**
11132
11131
  * Provides part of the required context while leaving the rest unchanged.
11133
11132
  *
@@ -11138,13 +11137,13 @@ export const updateServices: {
11138
11137
  *
11139
11138
  * @example
11140
11139
  * ```ts
11141
- * import { Effect, ServiceMap } from "effect"
11140
+ * import { Effect, Context } from "effect"
11142
11141
  *
11143
11142
  * // Define services
11144
- * const Logger = ServiceMap.Service<{
11143
+ * const Logger = Context.Service<{
11145
11144
  * log: (msg: string) => void
11146
11145
  * }>("Logger")
11147
- * const Config = ServiceMap.Service<{
11146
+ * const Config = Context.Service<{
11148
11147
  * name: string
11149
11148
  * }>("Config")
11150
11149
  *
@@ -11154,8 +11153,8 @@ export const updateServices: {
11154
11153
  *
11155
11154
  * // Transform services by providing Config while keeping Logger requirement
11156
11155
  * const configured = program.pipe(
11157
- * Effect.updateServices((services: ServiceMap.ServiceMap<typeof Logger>) =>
11158
- * ServiceMap.add(services, Config, { name: "World" })
11156
+ * Effect.updateContext((context: Context.Context<typeof Logger>) =>
11157
+ * Context.add(context, Config, { name: "World" })
11159
11158
  * )
11160
11159
  * )
11161
11160
  *
@@ -11166,23 +11165,23 @@ export const updateServices: {
11166
11165
  * ```
11167
11166
  *
11168
11167
  * @since 4.0.0
11169
- * @category ServiceMap
11168
+ * @category Context
11170
11169
  */
11171
11170
  <A, E, R, R2>(
11172
11171
  self: Effect<A, E, R>,
11173
- f: (services: ServiceMap.ServiceMap<R2>) => ServiceMap.ServiceMap<NoInfer<R>>
11172
+ f: (context: Context.Context<R2>) => Context.Context<NoInfer<R>>
11174
11173
  ): Effect<A, E, R2>
11175
- } = internal.updateServices
11174
+ } = internal.updateContext
11176
11175
 
11177
11176
  /**
11178
11177
  * Updates the service with the required service entry.
11179
11178
  *
11180
11179
  * @example
11181
11180
  * ```ts
11182
- * import { Console, Effect, ServiceMap } from "effect"
11181
+ * import { Console, Effect, Context } from "effect"
11183
11182
  *
11184
11183
  * // Define a counter service
11185
- * const Counter = ServiceMap.Service<{ count: number }>("Counter")
11184
+ * const Counter = Context.Service<{ count: number }>("Counter")
11186
11185
  *
11187
11186
  * const program = Effect.gen(function*() {
11188
11187
  * const updatedCounter = yield* Effect.service(Counter)
@@ -11200,7 +11199,7 @@ export const updateServices: {
11200
11199
  * ```
11201
11200
  *
11202
11201
  * @since 2.0.0
11203
- * @category ServiceMap
11202
+ * @category Context
11204
11203
  */
11205
11204
  export const updateService: {
11206
11205
  /**
@@ -11208,10 +11207,10 @@ export const updateService: {
11208
11207
  *
11209
11208
  * @example
11210
11209
  * ```ts
11211
- * import { Console, Effect, ServiceMap } from "effect"
11210
+ * import { Console, Effect, Context } from "effect"
11212
11211
  *
11213
11212
  * // Define a counter service
11214
- * const Counter = ServiceMap.Service<{ count: number }>("Counter")
11213
+ * const Counter = Context.Service<{ count: number }>("Counter")
11215
11214
  *
11216
11215
  * const program = Effect.gen(function*() {
11217
11216
  * const updatedCounter = yield* Effect.service(Counter)
@@ -11229,18 +11228,18 @@ export const updateService: {
11229
11228
  * ```
11230
11229
  *
11231
11230
  * @since 2.0.0
11232
- * @category ServiceMap
11231
+ * @category Context
11233
11232
  */
11234
- <I, A>(service: ServiceMap.Key<I, A>, f: (value: A) => A): <XA, E, R>(self: Effect<XA, E, R>) => Effect<XA, E, R | I>
11233
+ <I, A>(service: Context.Key<I, A>, f: (value: A) => A): <XA, E, R>(self: Effect<XA, E, R>) => Effect<XA, E, R | I>
11235
11234
  /**
11236
11235
  * Updates the service with the required service entry.
11237
11236
  *
11238
11237
  * @example
11239
11238
  * ```ts
11240
- * import { Console, Effect, ServiceMap } from "effect"
11239
+ * import { Console, Effect, Context } from "effect"
11241
11240
  *
11242
11241
  * // Define a counter service
11243
- * const Counter = ServiceMap.Service<{ count: number }>("Counter")
11242
+ * const Counter = Context.Service<{ count: number }>("Counter")
11244
11243
  *
11245
11244
  * const program = Effect.gen(function*() {
11246
11245
  * const updatedCounter = yield* Effect.service(Counter)
@@ -11258,9 +11257,9 @@ export const updateService: {
11258
11257
  * ```
11259
11258
  *
11260
11259
  * @since 2.0.0
11261
- * @category ServiceMap
11260
+ * @category Context
11262
11261
  */
11263
- <XA, E, R, I, A>(self: Effect<XA, E, R>, service: ServiceMap.Key<I, A>, f: (value: A) => A): Effect<XA, E, R | I>
11262
+ <XA, E, R, I, A>(self: Effect<XA, E, R>, service: Context.Key<I, A>, f: (value: A) => A): Effect<XA, E, R | I>
11264
11263
  } = internal.updateService
11265
11264
 
11266
11265
  /**
@@ -11277,10 +11276,10 @@ export const updateService: {
11277
11276
  *
11278
11277
  * @example
11279
11278
  * ```ts
11280
- * import { Console, Effect, ServiceMap } from "effect"
11279
+ * import { Console, Effect, Context } from "effect"
11281
11280
  *
11282
11281
  * // Define a service for configuration
11283
- * const Config = ServiceMap.Service<{
11282
+ * const Config = Context.Service<{
11284
11283
  * apiUrl: string
11285
11284
  * timeout: number
11286
11285
  * }>("Config")
@@ -11306,7 +11305,7 @@ export const updateService: {
11306
11305
  * ```
11307
11306
  *
11308
11307
  * @since 2.0.0
11309
- * @category ServiceMap
11308
+ * @category Context
11310
11309
  */
11311
11310
  export const provideService: {
11312
11311
  /**
@@ -11323,10 +11322,10 @@ export const provideService: {
11323
11322
  *
11324
11323
  * @example
11325
11324
  * ```ts
11326
- * import { Console, Effect, ServiceMap } from "effect"
11325
+ * import { Console, Effect, Context } from "effect"
11327
11326
  *
11328
11327
  * // Define a service for configuration
11329
- * const Config = ServiceMap.Service<{
11328
+ * const Config = Context.Service<{
11330
11329
  * apiUrl: string
11331
11330
  * timeout: number
11332
11331
  * }>("Config")
@@ -11352,9 +11351,9 @@ export const provideService: {
11352
11351
  * ```
11353
11352
  *
11354
11353
  * @since 2.0.0
11355
- * @category ServiceMap
11354
+ * @category Context
11356
11355
  */
11357
- <I, S>(service: ServiceMap.Key<I, S>): {
11356
+ <I, S>(service: Context.Key<I, S>): {
11358
11357
  /**
11359
11358
  * The `provideService` function is used to provide an actual
11360
11359
  * implementation for a service in the context of an effect.
@@ -11369,10 +11368,10 @@ export const provideService: {
11369
11368
  *
11370
11369
  * @example
11371
11370
  * ```ts
11372
- * import { Console, Effect, ServiceMap } from "effect"
11371
+ * import { Console, Effect, Context } from "effect"
11373
11372
  *
11374
11373
  * // Define a service for configuration
11375
- * const Config = ServiceMap.Service<{
11374
+ * const Config = Context.Service<{
11376
11375
  * apiUrl: string
11377
11376
  * timeout: number
11378
11377
  * }>("Config")
@@ -11398,7 +11397,7 @@ export const provideService: {
11398
11397
  * ```
11399
11398
  *
11400
11399
  * @since 2.0.0
11401
- * @category ServiceMap
11400
+ * @category Context
11402
11401
  */
11403
11402
  (implementation: S): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, I>>
11404
11403
  /**
@@ -11415,10 +11414,10 @@ export const provideService: {
11415
11414
  *
11416
11415
  * @example
11417
11416
  * ```ts
11418
- * import { Console, Effect, ServiceMap } from "effect"
11417
+ * import { Console, Effect, Context } from "effect"
11419
11418
  *
11420
11419
  * // Define a service for configuration
11421
- * const Config = ServiceMap.Service<{
11420
+ * const Config = Context.Service<{
11422
11421
  * apiUrl: string
11423
11422
  * timeout: number
11424
11423
  * }>("Config")
@@ -11444,7 +11443,7 @@ export const provideService: {
11444
11443
  * ```
11445
11444
  *
11446
11445
  * @since 2.0.0
11447
- * @category ServiceMap
11446
+ * @category Context
11448
11447
  */
11449
11448
  <A, E, R>(self: Effect<A, E, R>, implementation: S): Effect<A, E, Exclude<R, I>>
11450
11449
  }
@@ -11462,10 +11461,10 @@ export const provideService: {
11462
11461
  *
11463
11462
  * @example
11464
11463
  * ```ts
11465
- * import { Console, Effect, ServiceMap } from "effect"
11464
+ * import { Console, Effect, Context } from "effect"
11466
11465
  *
11467
11466
  * // Define a service for configuration
11468
- * const Config = ServiceMap.Service<{
11467
+ * const Config = Context.Service<{
11469
11468
  * apiUrl: string
11470
11469
  * timeout: number
11471
11470
  * }>("Config")
@@ -11491,9 +11490,9 @@ export const provideService: {
11491
11490
  * ```
11492
11491
  *
11493
11492
  * @since 2.0.0
11494
- * @category ServiceMap
11493
+ * @category Context
11495
11494
  */
11496
- <I, S>(service: ServiceMap.Key<I, S>, implementation: S): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, I>>
11495
+ <I, S>(service: Context.Key<I, S>, implementation: S): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, I>>
11497
11496
  /**
11498
11497
  * The `provideService` function is used to provide an actual
11499
11498
  * implementation for a service in the context of an effect.
@@ -11508,10 +11507,10 @@ export const provideService: {
11508
11507
  *
11509
11508
  * @example
11510
11509
  * ```ts
11511
- * import { Console, Effect, ServiceMap } from "effect"
11510
+ * import { Console, Effect, Context } from "effect"
11512
11511
  *
11513
11512
  * // Define a service for configuration
11514
- * const Config = ServiceMap.Service<{
11513
+ * const Config = Context.Service<{
11515
11514
  * apiUrl: string
11516
11515
  * timeout: number
11517
11516
  * }>("Config")
@@ -11537,9 +11536,9 @@ export const provideService: {
11537
11536
  * ```
11538
11537
  *
11539
11538
  * @since 2.0.0
11540
- * @category ServiceMap
11539
+ * @category Context
11541
11540
  */
11542
- <A, E, R, I, S>(self: Effect<A, E, R>, service: ServiceMap.Key<I, S>, implementation: S): Effect<A, E, Exclude<R, I>>
11541
+ <A, E, R, I, S>(self: Effect<A, E, R>, service: Context.Key<I, S>, implementation: S): Effect<A, E, Exclude<R, I>>
11543
11542
  } = internal.provideService
11544
11543
 
11545
11544
  /**
@@ -11554,13 +11553,13 @@ export const provideService: {
11554
11553
  *
11555
11554
  * @example
11556
11555
  * ```ts
11557
- * import { Console, Effect, ServiceMap } from "effect"
11556
+ * import { Console, Effect, Context } from "effect"
11558
11557
  *
11559
11558
  * // Define a database connection service
11560
11559
  * interface DatabaseConnection {
11561
11560
  * readonly query: (sql: string) => Effect.Effect<string>
11562
11561
  * }
11563
- * const Database = ServiceMap.Service<DatabaseConnection>("Database")
11562
+ * const Database = Context.Service<DatabaseConnection>("Database")
11564
11563
  *
11565
11564
  * // Effect that creates a database connection
11566
11565
  * const createConnection = Effect.gen(function*() {
@@ -11592,7 +11591,7 @@ export const provideService: {
11592
11591
  * ```
11593
11592
  *
11594
11593
  * @since 2.0.0
11595
- * @category ServiceMap
11594
+ * @category Context
11596
11595
  */
11597
11596
  export const provideServiceEffect: {
11598
11597
  /**
@@ -11607,13 +11606,13 @@ export const provideServiceEffect: {
11607
11606
  *
11608
11607
  * @example
11609
11608
  * ```ts
11610
- * import { Console, Effect, ServiceMap } from "effect"
11609
+ * import { Console, Effect, Context } from "effect"
11611
11610
  *
11612
11611
  * // Define a database connection service
11613
11612
  * interface DatabaseConnection {
11614
11613
  * readonly query: (sql: string) => Effect.Effect<string>
11615
11614
  * }
11616
- * const Database = ServiceMap.Service<DatabaseConnection>("Database")
11615
+ * const Database = Context.Service<DatabaseConnection>("Database")
11617
11616
  *
11618
11617
  * // Effect that creates a database connection
11619
11618
  * const createConnection = Effect.gen(function*() {
@@ -11645,9 +11644,9 @@ export const provideServiceEffect: {
11645
11644
  * ```
11646
11645
  *
11647
11646
  * @since 2.0.0
11648
- * @category ServiceMap
11647
+ * @category Context
11649
11648
  */
11650
- <I, S, E2, R2>(service: ServiceMap.Key<I, S>, acquire: Effect<S, E2, R2>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E | E2, Exclude<R, I> | R2>
11649
+ <I, S, E2, R2>(service: Context.Key<I, S>, acquire: Effect<S, E2, R2>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E | E2, Exclude<R, I> | R2>
11651
11650
  /**
11652
11651
  * Provides the effect with the single service it requires. If the effect
11653
11652
  * requires more than one service use `provide` instead.
@@ -11660,13 +11659,13 @@ export const provideServiceEffect: {
11660
11659
  *
11661
11660
  * @example
11662
11661
  * ```ts
11663
- * import { Console, Effect, ServiceMap } from "effect"
11662
+ * import { Console, Effect, Context } from "effect"
11664
11663
  *
11665
11664
  * // Define a database connection service
11666
11665
  * interface DatabaseConnection {
11667
11666
  * readonly query: (sql: string) => Effect.Effect<string>
11668
11667
  * }
11669
- * const Database = ServiceMap.Service<DatabaseConnection>("Database")
11668
+ * const Database = Context.Service<DatabaseConnection>("Database")
11670
11669
  *
11671
11670
  * // Effect that creates a database connection
11672
11671
  * const createConnection = Effect.gen(function*() {
@@ -11698,11 +11697,11 @@ export const provideServiceEffect: {
11698
11697
  * ```
11699
11698
  *
11700
11699
  * @since 2.0.0
11701
- * @category ServiceMap
11700
+ * @category Context
11702
11701
  */
11703
11702
  <A, E, R, I, S, E2, R2>(
11704
11703
  self: Effect<A, E, R>,
11705
- service: ServiceMap.Key<I, S>,
11704
+ service: Context.Key<I, S>,
11706
11705
  acquire: Effect<S, E2, R2>
11707
11706
  ): Effect<A, E | E2, Exclude<R, I> | R2>
11708
11707
  } = internal.provideServiceEffect
@@ -13372,8 +13371,7 @@ export declare namespace Repeat {
13372
13371
  * ```
13373
13372
  */
13374
13373
  export type Return<R, E, A, O extends Options<A>> = Effect<
13375
- O extends { schedule: Schedule<infer Out, infer _I, infer _E, infer _R> } ? Out
13376
- : O extends { until: Predicate.Refinement<A, infer B> } ? B
13374
+ O extends { until: Predicate.Refinement<A, infer B> } ? B
13377
13375
  : O extends { while: Predicate.Refinement<A, infer B> } ? Exclude<A, B>
13378
13376
  : A,
13379
13377
  | E
@@ -15602,7 +15600,7 @@ export const request: {
15602
15600
 
15603
15601
  /**
15604
15602
  * Low-level entry point that registers a request with a resolver and delivers the exit value via `onExit`.
15605
- * Use this when you already have a `ServiceMap` and need to enqueue a request outside an `Effect`.
15603
+ * Use this when you already have a `Context` and need to enqueue a request outside an `Effect`.
15606
15604
  *
15607
15605
  * It returns a canceler that removes the pending request entry.
15608
15606
  *
@@ -15614,7 +15612,7 @@ export const requestUnsafe: <A extends Request.Any>(
15614
15612
  options: {
15615
15613
  readonly resolver: RequestResolver<A>
15616
15614
  readonly onExit: (exit: Exit.Exit<Request.Success<A>, Request.Error<A>>) => void
15617
- readonly services: ServiceMap.ServiceMap<never>
15615
+ readonly context: Context.Context<never>
15618
15616
  }
15619
15617
  ) => () => void = internalRequest.requestUnsafe
15620
15618
 
@@ -16017,15 +16015,15 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
16017
16015
  *
16018
16016
  * @example
16019
16017
  * ```ts
16020
- * import { Effect, ServiceMap } from "effect"
16018
+ * import { Effect, Context } from "effect"
16021
16019
  *
16022
16020
  * interface Logger {
16023
16021
  * log: (message: string) => void
16024
16022
  * }
16025
16023
  *
16026
- * const Logger = ServiceMap.Service<Logger>("Logger")
16024
+ * const Logger = Context.Service<Logger>("Logger")
16027
16025
  *
16028
- * const services = ServiceMap.make(Logger, {
16026
+ * const services = Context.make(Logger, {
16029
16027
  * log: (message) => console.log(message)
16030
16028
  * })
16031
16029
  *
@@ -16042,7 +16040,7 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
16042
16040
  * @category Running Effects
16043
16041
  */
16044
16042
  export const runForkWith: <R>(
16045
- services: ServiceMap.ServiceMap<R>
16043
+ context: Context.Context<R>
16046
16044
  ) => <A, E>(effect: Effect<A, E, R>, options?: RunOptions | undefined) => Fiber<A, E> = internal.runForkWith
16047
16045
 
16048
16046
  /**
@@ -16052,15 +16050,15 @@ export const runForkWith: <R>(
16052
16050
  *
16053
16051
  * @example
16054
16052
  * ```ts
16055
- * import { Console, Effect, Exit, ServiceMap } from "effect"
16053
+ * import { Console, Effect, Exit, Context } from "effect"
16056
16054
  *
16057
16055
  * interface Logger {
16058
16056
  * log: (message: string) => Effect.Effect<void>
16059
16057
  * }
16060
16058
  *
16061
- * const Logger = ServiceMap.Service<Logger>("Logger")
16059
+ * const Logger = Context.Service<Logger>("Logger")
16062
16060
  *
16063
- * const services = ServiceMap.make(Logger, {
16061
+ * const services = Context.make(Logger, {
16064
16062
  * log: (message) => Console.log(message)
16065
16063
  * })
16066
16064
  *
@@ -16086,7 +16084,7 @@ export const runForkWith: <R>(
16086
16084
  * @category Running Effects
16087
16085
  */
16088
16086
  export const runCallbackWith: <R>(
16089
- services: ServiceMap.ServiceMap<R>
16087
+ context: Context.Context<R>
16090
16088
  ) => <A, E>(
16091
16089
  effect: Effect<A, E, R>,
16092
16090
  options?: (RunOptions & { readonly onExit: (exit: Exit.Exit<A, E>) => void }) | undefined
@@ -16178,15 +16176,15 @@ export const runPromise: <A, E>(
16178
16176
  *
16179
16177
  * @example
16180
16178
  * ```ts
16181
- * import { Effect, ServiceMap } from "effect"
16179
+ * import { Effect, Context } from "effect"
16182
16180
  *
16183
16181
  * interface Config {
16184
16182
  * apiUrl: string
16185
16183
  * }
16186
16184
  *
16187
- * const Config = ServiceMap.Service<Config>("Config")
16185
+ * const Config = Context.Service<Config>("Config")
16188
16186
  *
16189
- * const services = ServiceMap.make(Config, {
16187
+ * const context = Context.make(Config, {
16190
16188
  * apiUrl: "https://api.example.com"
16191
16189
  * })
16192
16190
  *
@@ -16195,14 +16193,14 @@ export const runPromise: <A, E>(
16195
16193
  * return `Connecting to ${config.apiUrl}`
16196
16194
  * })
16197
16195
  *
16198
- * Effect.runPromiseWith(services)(program).then(console.log)
16196
+ * Effect.runPromiseWith(context)(program).then(console.log)
16199
16197
  * ```
16200
16198
  *
16201
16199
  * @since 4.0.0
16202
16200
  * @category Running Effects
16203
16201
  */
16204
16202
  export const runPromiseWith: <R>(
16205
- services: ServiceMap.ServiceMap<R>
16203
+ context: Context.Context<R>
16206
16204
  ) => <A, E>(effect: Effect<A, E, R>, options?: RunOptions | undefined) => Promise<A> = internal.runPromiseWith
16207
16205
 
16208
16206
  /**
@@ -16262,15 +16260,15 @@ export const runPromiseExit: <A, E>(
16262
16260
  *
16263
16261
  * @example
16264
16262
  * ```ts
16265
- * import { Effect, Exit, ServiceMap } from "effect"
16263
+ * import { Effect, Exit, Context } from "effect"
16266
16264
  *
16267
16265
  * interface Database {
16268
16266
  * query: (sql: string) => string
16269
16267
  * }
16270
16268
  *
16271
- * const Database = ServiceMap.Service<Database>("Database")
16269
+ * const Database = Context.Service<Database>("Database")
16272
16270
  *
16273
- * const services = ServiceMap.make(Database, {
16271
+ * const services = Context.make(Database, {
16274
16272
  * query: (sql) => `Result for: ${sql}`
16275
16273
  * })
16276
16274
  *
@@ -16290,7 +16288,7 @@ export const runPromiseExit: <A, E>(
16290
16288
  * @category Running Effects
16291
16289
  */
16292
16290
  export const runPromiseExitWith: <R>(
16293
- services: ServiceMap.ServiceMap<R>
16291
+ context: Context.Context<R>
16294
16292
  ) => <A, E>(effect: Effect<A, E, R>, options?: RunOptions | undefined) => Promise<Exit.Exit<A, E>> =
16295
16293
  internal.runPromiseExitWith
16296
16294
 
@@ -16358,15 +16356,15 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
16358
16356
  *
16359
16357
  * @example
16360
16358
  * ```ts
16361
- * import { Effect, ServiceMap } from "effect"
16359
+ * import { Effect, Context } from "effect"
16362
16360
  *
16363
16361
  * interface MathService {
16364
16362
  * add: (a: number, b: number) => number
16365
16363
  * }
16366
16364
  *
16367
- * const MathService = ServiceMap.Service<MathService>("MathService")
16365
+ * const MathService = Context.Service<MathService>("MathService")
16368
16366
  *
16369
- * const services = ServiceMap.make(MathService, {
16367
+ * const context = Context.make(MathService, {
16370
16368
  * add: (a, b) => a + b
16371
16369
  * })
16372
16370
  *
@@ -16375,7 +16373,7 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
16375
16373
  * return math.add(2, 3)
16376
16374
  * })
16377
16375
  *
16378
- * const result = Effect.runSyncWith(services)(program)
16376
+ * const result = Effect.runSyncWith(context)(program)
16379
16377
  * console.log(result) // 5
16380
16378
  * ```
16381
16379
  *
@@ -16383,7 +16381,7 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
16383
16381
  * @category Running Effects
16384
16382
  */
16385
16383
  export const runSyncWith: <R>(
16386
- services: ServiceMap.ServiceMap<R>
16384
+ context: Context.Context<R>
16387
16385
  ) => <A, E>(effect: Effect<A, E, R>) => A = internal.runSyncWith
16388
16386
 
16389
16387
  /**
@@ -16462,10 +16460,10 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
16462
16460
  *
16463
16461
  * @example
16464
16462
  * ```ts
16465
- * import { Effect, Exit, ServiceMap } from "effect"
16463
+ * import { Effect, Exit, Context } from "effect"
16466
16464
  *
16467
16465
  * // Define a logger service
16468
- * const Logger = ServiceMap.Service<{
16466
+ * const Logger = Context.Service<{
16469
16467
  * log: (msg: string) => void
16470
16468
  * }>("Logger")
16471
16469
  *
@@ -16475,12 +16473,12 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
16475
16473
  * return 42
16476
16474
  * })
16477
16475
  *
16478
- * // Prepare services
16479
- * const services = ServiceMap.make(Logger, {
16476
+ * // Prepare context
16477
+ * const context = Context.make(Logger, {
16480
16478
  * log: (msg) => console.log(`[LOG] ${msg}`)
16481
16479
  * })
16482
16480
  *
16483
- * const exit = Effect.runSyncExitWith(services)(program)
16481
+ * const exit = Effect.runSyncExitWith(context)(program)
16484
16482
  *
16485
16483
  * if (Exit.isSuccess(exit)) {
16486
16484
  * console.log(`Success: ${exit.value}`)
@@ -16496,7 +16494,7 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
16496
16494
  * @category Running Effects
16497
16495
  */
16498
16496
  export const runSyncExitWith: <R>(
16499
- services: ServiceMap.ServiceMap<R>
16497
+ context: Context.Context<R>
16500
16498
  ) => <A, E>(effect: Effect<A, E, R>) => Exit.Exit<A, E> = internal.runSyncExitWith
16501
16499
 
16502
16500
  // -----------------------------------------------------------------------------
@@ -22590,7 +22588,7 @@ export const trackDuration: {
22590
22588
  * @since 4.0.0
22591
22589
  * @category Transactions
22592
22590
  */
22593
- export class Transaction extends ServiceMap.Service<
22591
+ export class Transaction extends Context.Service<
22594
22592
  Transaction,
22595
22593
  {
22596
22594
  retry: boolean
@@ -22650,7 +22648,7 @@ export const tx = <A, E, R>(
22650
22648
  effect: Effect<A, E, R>
22651
22649
  ): Effect<A, E, Exclude<R, Transaction>> =>
22652
22650
  withFiber((fiber) => {
22653
- if (fiber.services.mapUnsafe.has(Transaction.key)) {
22651
+ if (fiber.context.mapUnsafe.has(Transaction.key)) {
22654
22652
  return effect as Effect<A, E, Exclude<R, Transaction>>
22655
22653
  }
22656
22654
  // Create transaction state only at the outermost boundary