effect 4.0.0-beta.103 → 4.0.0-beta.104

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 (523) hide show
  1. package/dist/Cache.js +1 -1
  2. package/dist/Cache.js.map +1 -1
  3. package/dist/Channel.d.ts +1 -1
  4. package/dist/Channel.d.ts.map +1 -1
  5. package/dist/Channel.js.map +1 -1
  6. package/dist/Config.d.ts.map +1 -1
  7. package/dist/Config.js +28 -7
  8. package/dist/Config.js.map +1 -1
  9. package/dist/ConfigProvider.d.ts.map +1 -1
  10. package/dist/ConfigProvider.js +2 -1
  11. package/dist/ConfigProvider.js.map +1 -1
  12. package/dist/Context.d.ts +2 -2
  13. package/dist/Context.d.ts.map +1 -1
  14. package/dist/Context.js.map +1 -1
  15. package/dist/Crypto.d.ts.map +1 -1
  16. package/dist/Crypto.js +13 -5
  17. package/dist/Crypto.js.map +1 -1
  18. package/dist/Duration.d.ts.map +1 -1
  19. package/dist/Duration.js +12 -1
  20. package/dist/Duration.js.map +1 -1
  21. package/dist/Effect.d.ts +132 -14
  22. package/dist/Effect.d.ts.map +1 -1
  23. package/dist/Effect.js +38 -0
  24. package/dist/Effect.js.map +1 -1
  25. package/dist/Equal.d.ts.map +1 -1
  26. package/dist/Equal.js +10 -2
  27. package/dist/Equal.js.map +1 -1
  28. package/dist/ExecutionPlan.d.ts +73 -0
  29. package/dist/ExecutionPlan.d.ts.map +1 -1
  30. package/dist/ExecutionPlan.js +1 -1
  31. package/dist/ExecutionPlan.js.map +1 -1
  32. package/dist/FiberSet.js +1 -1
  33. package/dist/FileSystem.d.ts +2 -2
  34. package/dist/Function.d.ts +4 -3
  35. package/dist/Function.d.ts.map +1 -1
  36. package/dist/Function.js +5 -5
  37. package/dist/Function.js.map +1 -1
  38. package/dist/Iterable.d.ts.map +1 -1
  39. package/dist/Iterable.js +11 -10
  40. package/dist/Iterable.js.map +1 -1
  41. package/dist/Layer.d.ts.map +1 -1
  42. package/dist/Layer.js +7 -5
  43. package/dist/Layer.js.map +1 -1
  44. package/dist/Schedule.d.ts +8 -8
  45. package/dist/Schedule.d.ts.map +1 -1
  46. package/dist/Schedule.js +4 -4
  47. package/dist/Schedule.js.map +1 -1
  48. package/dist/Schema.d.ts +32 -32
  49. package/dist/Schema.d.ts.map +1 -1
  50. package/dist/Schema.js +23 -18
  51. package/dist/Schema.js.map +1 -1
  52. package/dist/SchemaAST.d.ts +3 -3
  53. package/dist/SchemaAST.d.ts.map +1 -1
  54. package/dist/SchemaAST.js +47 -31
  55. package/dist/SchemaAST.js.map +1 -1
  56. package/dist/SchemaParser.d.ts.map +1 -1
  57. package/dist/SchemaParser.js +35 -53
  58. package/dist/SchemaParser.js.map +1 -1
  59. package/dist/ScopedCache.js +1 -1
  60. package/dist/ScopedCache.js.map +1 -1
  61. package/dist/Sink.d.ts +1 -1
  62. package/dist/Sink.d.ts.map +1 -1
  63. package/dist/Stream.d.ts +27 -4
  64. package/dist/Stream.d.ts.map +1 -1
  65. package/dist/Stream.js +27 -2
  66. package/dist/Stream.js.map +1 -1
  67. package/dist/SynchronizedRef.js +1 -1
  68. package/dist/SynchronizedRef.js.map +1 -1
  69. package/dist/Terminal.js +1 -1
  70. package/dist/Terminal.js.map +1 -1
  71. package/dist/Tuple.d.ts +6 -4
  72. package/dist/Tuple.d.ts.map +1 -1
  73. package/dist/Tuple.js.map +1 -1
  74. package/dist/TxReentrantLock.d.ts +0 -56
  75. package/dist/TxReentrantLock.d.ts.map +1 -1
  76. package/dist/TxReentrantLock.js +8 -8
  77. package/dist/TxReentrantLock.js.map +1 -1
  78. package/dist/internal/dateTime.js +1 -1
  79. package/dist/internal/dateTime.js.map +1 -1
  80. package/dist/internal/executionPlan.js +51 -3
  81. package/dist/internal/executionPlan.js.map +1 -1
  82. package/dist/internal/hashMap.js +12 -8
  83. package/dist/internal/hashMap.js.map +1 -1
  84. package/dist/internal/matcher.js +1 -1
  85. package/dist/internal/matcher.js.map +1 -1
  86. package/dist/internal/schedule.js.map +1 -1
  87. package/dist/internal/schema/annotations.js +2 -0
  88. package/dist/internal/schema/annotations.js.map +1 -1
  89. package/dist/internal/schema/toArbitrary.js +1 -1
  90. package/dist/internal/schema/toArbitrary.js.map +1 -1
  91. package/dist/internal/trie.js +13 -3
  92. package/dist/internal/trie.js.map +1 -1
  93. package/dist/testing/TestClock.d.ts.map +1 -1
  94. package/dist/testing/TestClock.js +11 -1
  95. package/dist/testing/TestClock.js.map +1 -1
  96. package/dist/testing/TestSchema.d.ts +1 -1
  97. package/dist/testing/TestSchema.d.ts.map +1 -1
  98. package/dist/unstable/ai/AiError.js +19 -19
  99. package/dist/unstable/ai/AiError.js.map +1 -1
  100. package/dist/unstable/ai/Chat.js +1 -1
  101. package/dist/unstable/ai/Chat.js.map +1 -1
  102. package/dist/unstable/ai/LanguageModel.js +4 -2
  103. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  104. package/dist/unstable/ai/McpSchema.d.ts +132 -132
  105. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  106. package/dist/unstable/ai/McpSchema.js +8 -8
  107. package/dist/unstable/ai/McpSchema.js.map +1 -1
  108. package/dist/unstable/ai/McpServer.js +1 -1
  109. package/dist/unstable/ai/McpServer.js.map +1 -1
  110. package/dist/unstable/ai/Prompt.d.ts +15 -3
  111. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  112. package/dist/unstable/ai/Prompt.js +6 -3
  113. package/dist/unstable/ai/Prompt.js.map +1 -1
  114. package/dist/unstable/cli/CliError.d.ts +3 -3
  115. package/dist/unstable/cli/CliError.js +11 -11
  116. package/dist/unstable/cli/CliError.js.map +1 -1
  117. package/dist/unstable/cli/Command.d.ts +9 -9
  118. package/dist/unstable/cli/Command.d.ts.map +1 -1
  119. package/dist/unstable/cli/Command.js +8 -6
  120. package/dist/unstable/cli/Command.js.map +1 -1
  121. package/dist/unstable/cli/Param.d.ts +7 -5
  122. package/dist/unstable/cli/Param.d.ts.map +1 -1
  123. package/dist/unstable/cli/Param.js +15 -11
  124. package/dist/unstable/cli/Param.js.map +1 -1
  125. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  126. package/dist/unstable/cli/Primitive.js +31 -24
  127. package/dist/unstable/cli/Primitive.js.map +1 -1
  128. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  129. package/dist/unstable/cli/Prompt.js +31 -17
  130. package/dist/unstable/cli/Prompt.js.map +1 -1
  131. package/dist/unstable/cli/internal/ansi.js +2 -2
  132. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  133. package/dist/unstable/cli/internal/command.d.ts +2 -2
  134. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  135. package/dist/unstable/cli/internal/command.js +10 -9
  136. package/dist/unstable/cli/internal/command.js.map +1 -1
  137. package/dist/unstable/cli/internal/completions/bash.js +69 -9
  138. package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
  139. package/dist/unstable/cli/internal/completions/descriptor.js +24 -18
  140. package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
  141. package/dist/unstable/cli/internal/completions/fish.js +5 -5
  142. package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
  143. package/dist/unstable/cli/internal/help.d.ts.map +1 -1
  144. package/dist/unstable/cli/internal/help.js +4 -2
  145. package/dist/unstable/cli/internal/help.js.map +1 -1
  146. package/dist/unstable/cli/internal/parser.js +3 -3
  147. package/dist/unstable/cli/internal/parser.js.map +1 -1
  148. package/dist/unstable/cli/internal/wizard.js +2 -2
  149. package/dist/unstable/cli/internal/wizard.js.map +1 -1
  150. package/dist/unstable/cluster/ClusterError.js +7 -7
  151. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  152. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  153. package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
  154. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  155. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  156. package/dist/unstable/cluster/MessageStorage.js +8 -1
  157. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  158. package/dist/unstable/cluster/Reply.d.ts +8 -0
  159. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  160. package/dist/unstable/cluster/Reply.js +12 -0
  161. package/dist/unstable/cluster/Reply.js.map +1 -1
  162. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  163. package/dist/unstable/cluster/RunnerServer.js +4 -2
  164. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  165. package/dist/unstable/cluster/RunnerStorage.d.ts +1 -2
  166. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  167. package/dist/unstable/cluster/RunnerStorage.js +7 -6
  168. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  169. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  170. package/dist/unstable/cluster/Sharding.js +22 -4
  171. package/dist/unstable/cluster/Sharding.js.map +1 -1
  172. package/dist/unstable/cluster/internal/entityManager.js +1 -1
  173. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  174. package/dist/unstable/cluster/internal/resourceMap.js +2 -2
  175. package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
  176. package/dist/unstable/cluster/internal/resourceRef.js +17 -0
  177. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  178. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  179. package/dist/unstable/devtools/DevToolsClient.js +7 -2
  180. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  181. package/dist/unstable/encoding/Ini.d.ts +20 -0
  182. package/dist/unstable/encoding/Ini.d.ts.map +1 -0
  183. package/dist/unstable/encoding/Ini.js +153 -0
  184. package/dist/unstable/encoding/Ini.js.map +1 -0
  185. package/dist/unstable/encoding/Msgpack.d.ts +2 -1
  186. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  187. package/dist/unstable/encoding/Msgpack.js +21 -7
  188. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  189. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  190. package/dist/unstable/encoding/Ndjson.js +7 -1
  191. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  192. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  193. package/dist/unstable/encoding/Sse.js +14 -23
  194. package/dist/unstable/encoding/Sse.js.map +1 -1
  195. package/dist/unstable/encoding/Toml.d.ts +19 -0
  196. package/dist/unstable/encoding/Toml.d.ts.map +1 -0
  197. package/dist/unstable/encoding/Toml.js +434 -0
  198. package/dist/unstable/encoding/Toml.js.map +1 -0
  199. package/dist/unstable/encoding/Yaml.d.ts +19 -0
  200. package/dist/unstable/encoding/Yaml.d.ts.map +1 -0
  201. package/dist/unstable/encoding/Yaml.js +461 -0
  202. package/dist/unstable/encoding/Yaml.js.map +1 -0
  203. package/dist/unstable/encoding/index.d.ts +12 -0
  204. package/dist/unstable/encoding/index.d.ts.map +1 -1
  205. package/dist/unstable/encoding/index.js +12 -0
  206. package/dist/unstable/encoding/index.js.map +1 -1
  207. package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
  208. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  209. package/dist/unstable/eventlog/EventJournal.js +13 -5
  210. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  211. package/dist/unstable/eventlog/EventLogMessage.js +1 -1
  212. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  213. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
  214. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  215. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  216. package/dist/unstable/eventlog/SqlEventJournal.js +1 -4
  217. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  218. package/dist/unstable/http/FindMyWay/internal/queryString.d.ts +11 -0
  219. package/dist/unstable/http/FindMyWay/internal/queryString.d.ts.map +1 -0
  220. package/dist/unstable/http/FindMyWay/internal/queryString.js +259 -0
  221. package/dist/unstable/http/FindMyWay/internal/queryString.js.map +1 -0
  222. package/dist/unstable/http/FindMyWay/internal/router.d.ts +2 -0
  223. package/dist/unstable/http/FindMyWay/internal/router.d.ts.map +1 -0
  224. package/dist/unstable/http/FindMyWay/internal/router.js +665 -0
  225. package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -0
  226. package/dist/unstable/http/FindMyWay.d.ts +33 -8
  227. package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
  228. package/dist/unstable/http/FindMyWay.js +4 -7
  229. package/dist/unstable/http/FindMyWay.js.map +1 -1
  230. package/dist/unstable/http/HttpClientError.js +1 -1
  231. package/dist/unstable/http/HttpClientError.js.map +1 -1
  232. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  233. package/dist/unstable/http/HttpClientRequest.js +2 -14
  234. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  235. package/dist/unstable/http/HttpClientResponse.js +1 -16
  236. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  237. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  238. package/dist/unstable/http/HttpPlatform.js +21 -3
  239. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  240. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  241. package/dist/unstable/http/HttpServerRequest.js +7 -6
  242. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  243. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  244. package/dist/unstable/http/HttpServerResponse.js +8 -6
  245. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  246. package/dist/unstable/http/Multipart.d.ts +1 -1
  247. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  248. package/dist/unstable/http/Multipart.js +9 -2
  249. package/dist/unstable/http/Multipart.js.map +1 -1
  250. package/dist/unstable/http/MultipartParser/HeadersParser.d.ts +53 -0
  251. package/dist/unstable/http/MultipartParser/HeadersParser.d.ts.map +1 -0
  252. package/dist/unstable/http/MultipartParser/HeadersParser.js +14 -0
  253. package/dist/unstable/http/MultipartParser/HeadersParser.js.map +1 -0
  254. package/dist/unstable/http/MultipartParser/Search.d.ts +11 -0
  255. package/dist/unstable/http/MultipartParser/Search.d.ts.map +1 -0
  256. package/dist/unstable/http/MultipartParser/Search.js +14 -0
  257. package/dist/unstable/http/MultipartParser/Search.js.map +1 -0
  258. package/dist/unstable/http/MultipartParser/internal/contentType.d.ts +5 -0
  259. package/dist/unstable/http/MultipartParser/internal/contentType.d.ts.map +1 -0
  260. package/dist/unstable/http/MultipartParser/internal/contentType.js +82 -0
  261. package/dist/unstable/http/MultipartParser/internal/contentType.js.map +1 -0
  262. package/dist/unstable/http/MultipartParser/internal/headers.d.ts +3 -0
  263. package/dist/unstable/http/MultipartParser/internal/headers.d.ts.map +1 -0
  264. package/dist/unstable/http/MultipartParser/internal/headers.js +194 -0
  265. package/dist/unstable/http/MultipartParser/internal/headers.js.map +1 -0
  266. package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +8 -0
  267. package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -0
  268. package/dist/unstable/http/MultipartParser/internal/multipart.js +226 -0
  269. package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -0
  270. package/dist/unstable/http/MultipartParser/internal/search.d.ts +5 -0
  271. package/dist/unstable/http/MultipartParser/internal/search.d.ts.map +1 -0
  272. package/dist/unstable/http/MultipartParser/internal/search.js +120 -0
  273. package/dist/unstable/http/MultipartParser/internal/search.js.map +1 -0
  274. package/dist/unstable/http/MultipartParser.d.ts +98 -0
  275. package/dist/unstable/http/MultipartParser.d.ts.map +1 -0
  276. package/dist/unstable/http/MultipartParser.js +23 -0
  277. package/dist/unstable/http/MultipartParser.js.map +1 -0
  278. package/dist/unstable/http/Template.d.ts.map +1 -1
  279. package/dist/unstable/http/Template.js +2 -2
  280. package/dist/unstable/http/Template.js.map +1 -1
  281. package/dist/unstable/http/index.d.ts +1 -1
  282. package/dist/unstable/http/index.d.ts.map +1 -1
  283. package/dist/unstable/http/index.js +1 -1
  284. package/dist/unstable/http/index.js.map +1 -1
  285. package/dist/unstable/http/internal/httpBody.d.ts +2 -0
  286. package/dist/unstable/http/internal/httpBody.d.ts.map +1 -0
  287. package/dist/unstable/http/internal/httpBody.js +10 -0
  288. package/dist/unstable/http/internal/httpBody.js.map +1 -0
  289. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  290. package/dist/unstable/httpapi/HttpApi.js +5 -5
  291. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  292. package/dist/unstable/httpapi/HttpApiBuilder.js +68 -15
  293. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  294. package/dist/unstable/httpapi/HttpApiClient.d.ts +1 -1
  295. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  296. package/dist/unstable/httpapi/HttpApiClient.js +65 -25
  297. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  298. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +6 -4
  299. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  300. package/dist/unstable/httpapi/HttpApiEndpoint.js +73 -16
  301. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  302. package/dist/unstable/httpapi/HttpApiError.d.ts +5 -5
  303. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  304. package/dist/unstable/httpapi/HttpApiError.js +17 -17
  305. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  306. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +1 -1
  307. package/dist/unstable/httpapi/HttpApiMiddleware.js +1 -1
  308. package/dist/unstable/httpapi/HttpApiSchema.d.ts +219 -0
  309. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  310. package/dist/unstable/httpapi/HttpApiSchema.js +170 -0
  311. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  312. package/dist/unstable/httpapi/OpenApi.d.ts +8 -0
  313. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  314. package/dist/unstable/httpapi/OpenApi.js +45 -18
  315. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  316. package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
  317. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  318. package/dist/unstable/observability/OtlpExporter.js +2 -1
  319. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  320. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  321. package/dist/unstable/observability/OtlpLogger.js +2 -2
  322. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  323. package/dist/unstable/observability/OtlpMetrics.d.ts +2 -2
  324. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  325. package/dist/unstable/observability/OtlpMetrics.js +28 -15
  326. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  327. package/dist/unstable/observability/OtlpTracer.js +1 -1
  328. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  329. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  330. package/dist/unstable/persistence/PersistedQueue.js +9 -9
  331. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  332. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  333. package/dist/unstable/persistence/Persistence.js +17 -7
  334. package/dist/unstable/persistence/Persistence.js.map +1 -1
  335. package/dist/unstable/persistence/RateLimiter.d.ts +22 -12
  336. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  337. package/dist/unstable/persistence/RateLimiter.js +15 -42
  338. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  339. package/dist/unstable/persistence/Redis.js +1 -1
  340. package/dist/unstable/persistence/Redis.js.map +1 -1
  341. package/dist/unstable/rpc/RpcClient.d.ts +14 -0
  342. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  343. package/dist/unstable/rpc/RpcClient.js +18 -9
  344. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  345. package/dist/unstable/rpc/RpcClientError.js +2 -2
  346. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  347. package/dist/unstable/rpc/RpcSerialization.js +3 -1
  348. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  349. package/dist/unstable/schema/Model.d.ts +1 -1
  350. package/dist/unstable/schema/Model.d.ts.map +1 -1
  351. package/dist/unstable/schema/VariantSchema.d.ts +5 -5
  352. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  353. package/dist/unstable/schema/VariantSchema.js +17 -9
  354. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  355. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  356. package/dist/unstable/socket/Socket.js +28 -12
  357. package/dist/unstable/socket/Socket.js.map +1 -1
  358. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  359. package/dist/unstable/sql/SqlClient.js +7 -3
  360. package/dist/unstable/sql/SqlClient.js.map +1 -1
  361. package/dist/unstable/sql/SqlError.js +13 -13
  362. package/dist/unstable/sql/SqlError.js.map +1 -1
  363. package/dist/unstable/sql/SqlResolver.js +8 -6
  364. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  365. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  366. package/dist/unstable/sql/Statement.js +8 -6
  367. package/dist/unstable/sql/Statement.js.map +1 -1
  368. package/dist/unstable/workers/WorkerError.js +5 -5
  369. package/dist/unstable/workers/WorkerError.js.map +1 -1
  370. package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
  371. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  372. package/dist/unstable/workflow/WorkflowEngine.js +3 -3
  373. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  374. package/package.json +2 -8
  375. package/src/Cache.ts +1 -1
  376. package/src/Channel.ts +1 -1
  377. package/src/Config.ts +28 -7
  378. package/src/ConfigProvider.ts +4 -1
  379. package/src/Context.ts +5 -5
  380. package/src/Crypto.ts +17 -8
  381. package/src/Duration.ts +16 -2
  382. package/src/Effect.ts +141 -17
  383. package/src/Equal.ts +10 -2
  384. package/src/ExecutionPlan.ts +78 -1
  385. package/src/FiberSet.ts +1 -1
  386. package/src/FileSystem.ts +2 -2
  387. package/src/Function.ts +6 -6
  388. package/src/Iterable.ts +11 -10
  389. package/src/Layer.ts +7 -5
  390. package/src/Schedule.ts +13 -13
  391. package/src/Schema.ts +50 -41
  392. package/src/SchemaAST.ts +69 -37
  393. package/src/SchemaParser.ts +75 -69
  394. package/src/ScopedCache.ts +1 -1
  395. package/src/Sink.ts +1 -1
  396. package/src/Stream.ts +77 -10
  397. package/src/SynchronizedRef.ts +1 -1
  398. package/src/Terminal.ts +1 -1
  399. package/src/Tuple.ts +7 -4
  400. package/src/TxReentrantLock.ts +39 -35
  401. package/src/internal/dateTime.ts +1 -1
  402. package/src/internal/executionPlan.ts +105 -10
  403. package/src/internal/hashMap.ts +20 -14
  404. package/src/internal/matcher.ts +2 -2
  405. package/src/internal/schedule.ts +4 -4
  406. package/src/internal/schema/annotations.ts +3 -0
  407. package/src/internal/schema/toArbitrary.ts +3 -1
  408. package/src/internal/trie.ts +12 -2
  409. package/src/testing/TestClock.ts +13 -1
  410. package/src/testing/TestSchema.ts +1 -1
  411. package/src/unstable/ai/AiError.ts +19 -19
  412. package/src/unstable/ai/Chat.ts +1 -1
  413. package/src/unstable/ai/LanguageModel.ts +4 -2
  414. package/src/unstable/ai/McpSchema.ts +17 -16
  415. package/src/unstable/ai/McpServer.ts +1 -1
  416. package/src/unstable/ai/Prompt.ts +21 -6
  417. package/src/unstable/cli/CliError.ts +12 -12
  418. package/src/unstable/cli/Command.ts +12 -10
  419. package/src/unstable/cli/Param.ts +41 -19
  420. package/src/unstable/cli/Primitive.ts +11 -5
  421. package/src/unstable/cli/Prompt.ts +36 -20
  422. package/src/unstable/cli/internal/ansi.ts +2 -2
  423. package/src/unstable/cli/internal/command.ts +15 -10
  424. package/src/unstable/cli/internal/completions/bash.ts +59 -9
  425. package/src/unstable/cli/internal/completions/descriptor.ts +14 -20
  426. package/src/unstable/cli/internal/completions/fish.ts +5 -7
  427. package/src/unstable/cli/internal/help.ts +4 -2
  428. package/src/unstable/cli/internal/parser.ts +3 -3
  429. package/src/unstable/cli/internal/wizard.ts +2 -2
  430. package/src/unstable/cluster/ClusterError.ts +7 -7
  431. package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -1
  432. package/src/unstable/cluster/MessageStorage.ts +9 -5
  433. package/src/unstable/cluster/Reply.ts +21 -0
  434. package/src/unstable/cluster/RunnerServer.ts +4 -10
  435. package/src/unstable/cluster/RunnerStorage.ts +9 -7
  436. package/src/unstable/cluster/Sharding.ts +35 -7
  437. package/src/unstable/cluster/internal/entityManager.ts +1 -1
  438. package/src/unstable/cluster/internal/resourceMap.ts +5 -2
  439. package/src/unstable/cluster/internal/resourceRef.ts +27 -5
  440. package/src/unstable/devtools/DevToolsClient.ts +3 -2
  441. package/src/unstable/encoding/Ini.ts +174 -0
  442. package/src/unstable/encoding/Msgpack.ts +47 -28
  443. package/src/unstable/encoding/Ndjson.ts +9 -1
  444. package/src/unstable/encoding/Sse.ts +11 -21
  445. package/src/unstable/encoding/Toml.ts +504 -0
  446. package/src/unstable/encoding/Yaml.ts +541 -0
  447. package/src/unstable/encoding/index.ts +15 -0
  448. package/src/unstable/eventlog/EventJournal.ts +14 -6
  449. package/src/unstable/eventlog/EventLogMessage.ts +1 -1
  450. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
  451. package/src/unstable/eventlog/SqlEventJournal.ts +6 -4
  452. package/src/unstable/http/FindMyWay/internal/queryString.ts +420 -0
  453. package/src/unstable/http/FindMyWay/internal/router.ts +950 -0
  454. package/src/unstable/http/FindMyWay.ts +65 -6
  455. package/src/unstable/http/HttpClientError.ts +1 -1
  456. package/src/unstable/http/HttpClientRequest.ts +2 -14
  457. package/src/unstable/http/HttpClientResponse.ts +1 -17
  458. package/src/unstable/http/HttpPlatform.ts +34 -6
  459. package/src/unstable/http/HttpServerRequest.ts +14 -6
  460. package/src/unstable/http/HttpServerResponse.ts +9 -7
  461. package/src/unstable/http/Multipart.ts +9 -2
  462. package/src/unstable/http/MultipartParser/HeadersParser.ts +68 -0
  463. package/src/unstable/http/MultipartParser/Search.ts +17 -0
  464. package/src/unstable/http/MultipartParser/internal/contentType.ts +103 -0
  465. package/src/unstable/http/MultipartParser/internal/headers.ts +615 -0
  466. package/src/unstable/http/MultipartParser/internal/multipart.ts +262 -0
  467. package/src/unstable/http/MultipartParser/internal/search.ts +167 -0
  468. package/src/unstable/http/MultipartParser.ts +115 -0
  469. package/src/unstable/http/Template.ts +6 -5
  470. package/src/unstable/http/index.ts +1 -1
  471. package/src/unstable/http/internal/httpBody.ts +15 -0
  472. package/src/unstable/httpapi/HttpApi.ts +6 -7
  473. package/src/unstable/httpapi/HttpApiBuilder.ts +119 -21
  474. package/src/unstable/httpapi/HttpApiClient.ts +104 -41
  475. package/src/unstable/httpapi/HttpApiEndpoint.ts +117 -29
  476. package/src/unstable/httpapi/HttpApiError.ts +33 -39
  477. package/src/unstable/httpapi/HttpApiMiddleware.ts +1 -1
  478. package/src/unstable/httpapi/HttpApiSchema.ts +353 -0
  479. package/src/unstable/httpapi/OpenApi.ts +70 -20
  480. package/src/unstable/observability/OtlpExporter.ts +4 -2
  481. package/src/unstable/observability/OtlpLogger.ts +3 -1
  482. package/src/unstable/observability/OtlpMetrics.ts +32 -18
  483. package/src/unstable/observability/OtlpTracer.ts +1 -1
  484. package/src/unstable/persistence/PersistedQueue.ts +12 -9
  485. package/src/unstable/persistence/Persistence.ts +27 -7
  486. package/src/unstable/persistence/RateLimiter.ts +54 -31
  487. package/src/unstable/persistence/Redis.ts +1 -1
  488. package/src/unstable/rpc/RpcClient.ts +38 -12
  489. package/src/unstable/rpc/RpcClientError.ts +2 -2
  490. package/src/unstable/rpc/RpcSerialization.ts +1 -1
  491. package/src/unstable/schema/VariantSchema.ts +36 -18
  492. package/src/unstable/socket/Socket.ts +24 -14
  493. package/src/unstable/sql/SqlClient.ts +65 -56
  494. package/src/unstable/sql/SqlError.ts +13 -13
  495. package/src/unstable/sql/SqlResolver.ts +8 -6
  496. package/src/unstable/sql/Statement.ts +13 -8
  497. package/src/unstable/workers/WorkerError.ts +5 -5
  498. package/src/unstable/workflow/WorkflowEngine.ts +8 -3
  499. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +0 -14
  500. package/dist/unstable/http/Multipasta/HeadersParser.d.ts.map +0 -1
  501. package/dist/unstable/http/Multipasta/HeadersParser.js +0 -14
  502. package/dist/unstable/http/Multipasta/HeadersParser.js.map +0 -1
  503. package/dist/unstable/http/Multipasta/Node.d.ts +0 -14
  504. package/dist/unstable/http/Multipasta/Node.d.ts.map +0 -1
  505. package/dist/unstable/http/Multipasta/Node.js +0 -14
  506. package/dist/unstable/http/Multipasta/Node.js.map +0 -1
  507. package/dist/unstable/http/Multipasta/Search.d.ts +0 -14
  508. package/dist/unstable/http/Multipasta/Search.d.ts.map +0 -1
  509. package/dist/unstable/http/Multipasta/Search.js +0 -14
  510. package/dist/unstable/http/Multipasta/Search.js.map +0 -1
  511. package/dist/unstable/http/Multipasta/Web.d.ts +0 -14
  512. package/dist/unstable/http/Multipasta/Web.d.ts.map +0 -1
  513. package/dist/unstable/http/Multipasta/Web.js +0 -14
  514. package/dist/unstable/http/Multipasta/Web.js.map +0 -1
  515. package/dist/unstable/http/Multipasta.d.ts +0 -15
  516. package/dist/unstable/http/Multipasta.d.ts.map +0 -1
  517. package/dist/unstable/http/Multipasta.js +0 -15
  518. package/dist/unstable/http/Multipasta.js.map +0 -1
  519. package/src/unstable/http/Multipasta/HeadersParser.ts +0 -14
  520. package/src/unstable/http/Multipasta/Node.ts +0 -14
  521. package/src/unstable/http/Multipasta/Search.ts +0 -14
  522. package/src/unstable/http/Multipasta/Web.ts +0 -14
  523. package/src/unstable/http/Multipasta.ts +0 -15
@@ -10,7 +10,9 @@
10
10
  * @since 3.16.0
11
11
  */
12
12
  import type { NonEmptyReadonlyArray } from "./Array.ts"
13
+ import type * as Cause from "./Cause.ts"
13
14
  import * as Context from "./Context.ts"
15
+ import type * as Duration from "./Duration.ts"
14
16
  import type * as Effect from "./Effect.ts"
15
17
  import { constant } from "./Function.ts"
16
18
  import * as effect from "./internal/effect.ts"
@@ -179,7 +181,7 @@ export const make = <const Steps extends NonEmptyReadonlyArray<make.Step>>(
179
181
  | (Steps[number]["schedule"] extends Schedule.Schedule<infer _O, infer _I, infer R> ? R : never)
180
182
  }> =>
181
183
  makeProto(steps.map((options, i) => {
182
- if (options.attempts && options.attempts < 1) {
184
+ if (options.attempts !== undefined && options.attempts < 1) {
183
185
  throw new Error(`ExecutionPlan.make: step[${i}].attempts must be greater than 0`)
184
186
  }
185
187
  return {
@@ -372,3 +374,78 @@ export const CurrentMetadata = Context.Reference<Metadata>("effect/ExecutionPlan
372
374
  stepIndex: 0
373
375
  })
374
376
  })
377
+
378
+ /**
379
+ * Lifecycle event emitted before an execution-plan attempt runs.
380
+ *
381
+ * **Details**
382
+ *
383
+ * `attempt` is the cumulative 1-based attempt number across all steps and
384
+ * matches `CurrentMetadata.attempt` for the same attempt. `stepAttempt` is the
385
+ * 1-based attempt number within the current step, and `stepIndex` is the
386
+ * 0-based index of the step being attempted.
387
+ *
388
+ * @category models
389
+ * @since 4.0.0
390
+ */
391
+ export interface AttemptStart {
392
+ readonly _tag: "AttemptStart"
393
+ readonly attempt: number
394
+ readonly stepAttempt: number
395
+ readonly stepIndex: number
396
+ }
397
+
398
+ /**
399
+ * Lifecycle event emitted when an execution-plan attempt succeeds.
400
+ *
401
+ * **Details**
402
+ *
403
+ * A successful attempt completes the plan, so this is always the final event.
404
+ * `duration` is the elapsed time of the attempt.
405
+ *
406
+ * @category models
407
+ * @since 4.0.0
408
+ */
409
+ export interface AttemptSuccess {
410
+ readonly _tag: "AttemptSuccess"
411
+ readonly attempt: number
412
+ readonly stepAttempt: number
413
+ readonly stepIndex: number
414
+ readonly duration: Duration.Duration
415
+ }
416
+
417
+ /**
418
+ * Lifecycle event emitted when an execution-plan attempt fails.
419
+ *
420
+ * **Details**
421
+ *
422
+ * `cause` holds the full failure cause, so defects and interruption are
423
+ * reported as well as expected errors. Whether the plan retries or fails over
424
+ * afterwards is decided by the step's `attempts`, `while`, and `schedule`; a
425
+ * following `AttemptStart` indicates another attempt was made.
426
+ *
427
+ * @category models
428
+ * @since 4.0.0
429
+ */
430
+ export interface AttemptFailure<E> {
431
+ readonly _tag: "AttemptFailure"
432
+ readonly attempt: number
433
+ readonly stepAttempt: number
434
+ readonly stepIndex: number
435
+ readonly duration: Duration.Duration
436
+ readonly cause: Cause.Cause<E>
437
+ }
438
+
439
+ /**
440
+ * Union of the lifecycle events emitted while an execution plan runs.
441
+ *
442
+ * **Details**
443
+ *
444
+ * Every `AttemptStart` is followed by exactly one terminal event, either
445
+ * `AttemptSuccess` or `AttemptFailure`. An interrupted attempt emits
446
+ * `AttemptFailure` with the interruption cause.
447
+ *
448
+ * @category models
449
+ * @since 4.0.0
450
+ */
451
+ export type Event<E> = AttemptStart | AttemptSuccess | AttemptFailure<E>
package/src/FiberSet.ts CHANGED
@@ -100,7 +100,7 @@ const Proto = {
100
100
  ...PipeInspectableProto,
101
101
  toJSON(this: FiberSet<unknown, unknown>) {
102
102
  return {
103
- _id: "FiberMap",
103
+ _id: "FiberSet",
104
104
  state: this.state
105
105
  }
106
106
  }
package/src/FileSystem.ts CHANGED
@@ -1010,7 +1010,7 @@ export const isFile = (u: unknown): u is File => hasProperty(u, FileTypeId)
1010
1010
  * const file: FileSystem.File = {
1011
1011
  * [FileSystem.FileTypeId]: FileSystem.FileTypeId,
1012
1012
  * stat: Effect.succeed({ size: FileSystem.Size(5) } as FileSystem.File.Info),
1013
- * seek: () => Effect.void,
1013
+ * seek: () => Effect.succeed(FileSystem.Size(0)),
1014
1014
  * sync: Effect.void,
1015
1015
  * read: (buffer) => Effect.sync(() => {
1016
1016
  * buffer.set([1, 2, 3, 4, 5])
@@ -1040,7 +1040,7 @@ export const isFile = (u: unknown): u is File => hasProperty(u, FileTypeId)
1040
1040
  export interface File {
1041
1041
  readonly [FileTypeId]: typeof FileTypeId
1042
1042
  readonly stat: Effect.Effect<File.Info, PlatformError>
1043
- readonly seek: (offset: SizeInput, from: SeekMode) => Effect.Effect<void>
1043
+ readonly seek: (offset: SizeInput, from: SeekMode) => Effect.Effect<Size>
1044
1044
  readonly sync: Effect.Effect<void, PlatformError>
1045
1045
  readonly read: (buffer: Uint8Array) => Effect.Effect<Size, PlatformError>
1046
1046
  readonly readAlloc: (size: SizeInput) => Effect.Effect<Option.Option<Uint8Array>, PlatformError>
package/src/Function.ts CHANGED
@@ -1493,11 +1493,12 @@ export const SK = <A, B>(_: A, b: B): B => b
1493
1493
  * **Details**
1494
1494
  *
1495
1495
  * Each memoized wrapper owns a private `WeakMap` keyed by object identity.
1496
- * Cached `undefined` results are still returned because the cache is checked
1497
- * with `WeakMap.has`.
1498
1496
  *
1499
1497
  * **Gotchas**
1500
1498
  *
1499
+ * `undefined` is reserved to represent a cache miss and is therefore not
1500
+ * supported as a return value.
1501
+ *
1501
1502
  * Structurally equal objects do not share cache entries. If the same object is
1502
1503
  * mutated after its first call, later calls still return the cached result for
1503
1504
  * that reference.
@@ -1505,12 +1506,11 @@ export const SK = <A, B>(_: A, b: B): B => b
1505
1506
  * @category caching
1506
1507
  * @since 4.0.0
1507
1508
  */
1508
- export function memoize<A extends object, O>(f: (a: A) => O): (ast: A) => O {
1509
+ export function memoize<A extends object, O extends {} | null>(f: (a: A) => O): (ast: A) => O {
1509
1510
  const cache = new WeakMap<object, O>()
1510
1511
  return (a) => {
1511
- if (cache.has(a)) {
1512
- return cache.get(a)!
1513
- }
1512
+ const cached = cache.get(a)
1513
+ if (cached !== undefined) return cached
1514
1514
  const result = f(a)
1515
1515
  cache.set(a, result)
1516
1516
  return result
package/src/Iterable.ts CHANGED
@@ -3276,19 +3276,20 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3276
3276
  const outerIterator = self[Symbol.iterator]()
3277
3277
  let innerIterator: Iterator<A> | undefined
3278
3278
  function next() {
3279
- if (innerIterator === undefined) {
3280
- const next = outerIterator.next()
3281
- if (next.done) {
3282
- return next
3279
+ while (true) {
3280
+ if (innerIterator === undefined) {
3281
+ const next = outerIterator.next()
3282
+ if (next.done) {
3283
+ return next
3284
+ }
3285
+ innerIterator = next.value[Symbol.iterator]()
3286
+ }
3287
+ const result = innerIterator.next()
3288
+ if (!result.done) {
3289
+ return result
3283
3290
  }
3284
- innerIterator = next.value[Symbol.iterator]()
3285
- }
3286
- const result = innerIterator.next()
3287
- if (result.done) {
3288
3291
  innerIterator = undefined
3289
- return next()
3290
3292
  }
3291
- return result
3292
3293
  }
3293
3294
  return { next }
3294
3295
  }
package/src/Layer.ts CHANGED
@@ -447,11 +447,13 @@ class MemoMapImpl implements MemoMap {
447
447
  scope: Scope.Scope,
448
448
  build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<ROut>, E, RIn>
449
449
  ): Effect<Context.Context<ROut>, E, RIn> {
450
- const existing = this.get(layer, scope)
451
- if (existing) {
452
- return existing
453
- }
454
- return memoMapBuild(this, layer, scope, build)
450
+ return internalEffect.suspend(() => {
451
+ const existing = this.get(layer, scope)
452
+ if (existing) {
453
+ return existing
454
+ }
455
+ return memoMapBuild(this, layer, scope, build)
456
+ })
455
457
  }
456
458
  }
457
459
 
package/src/Schedule.ts CHANGED
@@ -538,14 +538,14 @@ export const addDelay: {
538
538
  * ```ts import.meta.vitest
539
539
  * import { Schedule } from "effect"
540
540
  *
541
- * const schedule = Schedule.andThen(Schedule.recurs(1), Schedule.recurs(2))
541
+ * const schedule = Schedule.concat(Schedule.recurs(1), Schedule.recurs(2))
542
542
  * Schedule.isSchedule(schedule) // => true
543
543
  * ```
544
544
  *
545
545
  * @category sequencing
546
546
  * @since 2.0.0
547
547
  */
548
- export const andThen: {
548
+ export const concat: {
549
549
  /**
550
550
  * Returns a schedule that runs `self` to completion, then runs `other`, and
551
551
  * merges their outputs.
@@ -555,7 +555,7 @@ export const andThen: {
555
555
  * ```ts import.meta.vitest
556
556
  * import { Schedule } from "effect"
557
557
  *
558
- * const schedule = Schedule.andThen(Schedule.recurs(1), Schedule.recurs(2))
558
+ * const schedule = Schedule.concat(Schedule.recurs(1), Schedule.recurs(2))
559
559
  * Schedule.isSchedule(schedule) // => true
560
560
  * ```
561
561
  *
@@ -574,7 +574,7 @@ export const andThen: {
574
574
  * ```ts import.meta.vitest
575
575
  * import { Schedule } from "effect"
576
576
  *
577
- * const schedule = Schedule.andThen(Schedule.recurs(1), Schedule.recurs(2))
577
+ * const schedule = Schedule.concat(Schedule.recurs(1), Schedule.recurs(2))
578
578
  * Schedule.isSchedule(schedule) // => true
579
579
  * ```
580
580
  *
@@ -589,7 +589,7 @@ export const andThen: {
589
589
  self: Schedule<Output, Input, Error, Env>,
590
590
  other: Schedule<Output2, Input2, Error2, Env2>
591
591
  ): Schedule<Output | Output2, Input & Input2, Error | Error2, Env | Env2> =>
592
- map(andThenResult(self, other), ({ output }) => effect.succeed(Result.merge(output))))
592
+ map(concatResult(self, other), ({ output }) => effect.succeed(Result.merge(output))))
593
593
 
594
594
  /**
595
595
  * Returns a schedule that runs `self` to completion, then runs `other`, and
@@ -606,14 +606,14 @@ export const andThen: {
606
606
  * ```ts import.meta.vitest
607
607
  * import { Schedule } from "effect"
608
608
  *
609
- * const schedule = Schedule.andThenResult(Schedule.recurs(1), Schedule.recurs(2))
609
+ * const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
610
610
  * Schedule.isSchedule(schedule) // => true
611
611
  * ```
612
612
  *
613
613
  * @category sequencing
614
614
  * @since 4.0.0
615
615
  */
616
- export const andThenResult: {
616
+ export const concatResult: {
617
617
  /**
618
618
  * Returns a schedule that runs `self` to completion, then runs `other`, and
619
619
  * preserves which schedule produced each output.
@@ -629,7 +629,7 @@ export const andThenResult: {
629
629
  * ```ts import.meta.vitest
630
630
  * import { Schedule } from "effect"
631
631
  *
632
- * const schedule = Schedule.andThenResult(Schedule.recurs(1), Schedule.recurs(2))
632
+ * const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
633
633
  * Schedule.isSchedule(schedule) // => true
634
634
  * ```
635
635
  *
@@ -654,7 +654,7 @@ export const andThenResult: {
654
654
  * ```ts import.meta.vitest
655
655
  * import { Schedule } from "effect"
656
656
  *
657
- * const schedule = Schedule.andThenResult(Schedule.recurs(1), Schedule.recurs(2))
657
+ * const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
658
658
  * Schedule.isSchedule(schedule) // => true
659
659
  * ```
660
660
  *
@@ -707,7 +707,7 @@ export const andThenResult: {
707
707
  * ```ts import.meta.vitest
708
708
  * import { Schedule } from "effect"
709
709
  *
710
- * const schedule = Schedule.andThenResult(Schedule.recurs(1), Schedule.recurs(2))
710
+ * const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
711
711
  * Schedule.isSchedule(schedule) // => true
712
712
  * ```
713
713
  *
@@ -730,7 +730,7 @@ export const andThenResult: {
730
730
  * ```ts import.meta.vitest
731
731
  * import { Schedule } from "effect"
732
732
  *
733
- * const schedule = Schedule.andThenResult(Schedule.recurs(1), Schedule.recurs(2))
733
+ * const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
734
734
  * Schedule.isSchedule(schedule) // => true
735
735
  * ```
736
736
  *
@@ -753,7 +753,7 @@ export const andThenResult: {
753
753
  * ```ts import.meta.vitest
754
754
  * import { Schedule } from "effect"
755
755
  *
756
- * const schedule = Schedule.andThenResult(Schedule.recurs(1), Schedule.recurs(2))
756
+ * const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
757
757
  * Schedule.isSchedule(schedule) // => true
758
758
  * ```
759
759
  *
@@ -776,7 +776,7 @@ export const andThenResult: {
776
776
  * ```ts import.meta.vitest
777
777
  * import { Schedule } from "effect"
778
778
  *
779
- * const schedule = Schedule.andThenResult(Schedule.recurs(1), Schedule.recurs(2))
779
+ * const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
780
780
  * Schedule.isSchedule(schedule) // => true
781
781
  * ```
782
782
  *
package/src/Schema.ts CHANGED
@@ -10524,17 +10524,17 @@ function causeToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
10524
10524
  }
10525
10525
 
10526
10526
  /**
10527
- * Type-level representation of {@link Error}.
10527
+ * Type-level representation of {@link ErrorInstance}.
10528
10528
  *
10529
10529
  * @category models
10530
10530
  * @since 4.0.0
10531
10531
  */
10532
- export interface Error extends instanceOf<globalThis.Error> {
10533
- readonly "Rebuild": Error
10532
+ export interface ErrorInstance extends instanceOf<globalThis.Error> {
10533
+ readonly "Rebuild": ErrorInstance
10534
10534
  }
10535
10535
 
10536
10536
  /**
10537
- * Options for {@link Error} and {@link Defect}.
10537
+ * Options for {@link ErrorInstance} and {@link Defect}.
10538
10538
  *
10539
10539
  * @category options
10540
10540
  * @since 4.0.0
@@ -10597,7 +10597,7 @@ const getErrorOptions = (key: ErrorOptionsKey): NormalizedErrorOptions | undefin
10597
10597
  }
10598
10598
  }
10599
10599
 
10600
- const errorSchemaCache: Array<Error | undefined> = []
10600
+ const errorSchemaCache: Array<ErrorInstance | undefined> = []
10601
10601
 
10602
10602
  /**
10603
10603
  * Schema for JavaScript `Error` objects.
@@ -10614,7 +10614,7 @@ const errorSchemaCache: Array<Error | undefined> = []
10614
10614
  * @category schemas
10615
10615
  * @since 4.0.0
10616
10616
  */
10617
- export function Error(options?: ErrorOptions): Error {
10617
+ export function ErrorInstance(options?: ErrorOptions): ErrorInstance {
10618
10618
  const key = getErrorOptionsKey(options)
10619
10619
  const cached = errorSchemaCache[key]
10620
10620
  if (cached !== undefined) {
@@ -10627,7 +10627,9 @@ export function Error(options?: ErrorOptions): Error {
10627
10627
  payload: normalizedOptions ?? null
10628
10628
  },
10629
10629
  toCode: () => ({
10630
- runtime: normalizedOptions !== undefined ? `Schema.Error(${format(normalizedOptions)})` : `Schema.Error()`,
10630
+ runtime: normalizedOptions !== undefined
10631
+ ? `Schema.ErrorInstance(${format(normalizedOptions)})`
10632
+ : `Schema.ErrorInstance()`,
10631
10633
  Type: `globalThis.Error`
10632
10634
  }),
10633
10635
  expected: "Error",
@@ -10639,22 +10641,22 @@ export function Error(options?: ErrorOptions): Error {
10639
10641
  }
10640
10642
 
10641
10643
  /**
10642
- * Reviver for persisted {@link Error} declarations.
10644
+ * Reviver for persisted {@link ErrorInstance} declarations.
10643
10645
  *
10644
10646
  * **When to use**
10645
10647
  *
10646
- * Use when reconstructing documents that may contain schemas created by {@link Error}.
10648
+ * Use when reconstructing documents that may contain schemas created by {@link ErrorInstance}.
10647
10649
  *
10648
- * @see {@link Error} for creating the corresponding schema
10650
+ * @see {@link ErrorInstance} for creating the corresponding schema
10649
10651
  *
10650
10652
  * @category schemas
10651
10653
  * @since 4.0.0
10652
10654
  */
10653
- export const ErrorReviver = InternalSchema.makeDeclarationReviver(
10655
+ export const ErrorInstanceReviver = InternalSchema.makeDeclarationReviver(
10654
10656
  "effect/schema/Error",
10655
10657
  ErrorRepresentationPayload,
10656
10658
  ({ annotations, payload }) => {
10657
- const schema = Error(payload ?? undefined)
10659
+ const schema = ErrorInstance(payload ?? undefined)
10658
10660
  return annotations === undefined ? schema : schema.annotate(annotations)
10659
10661
  }
10660
10662
  )
@@ -10708,7 +10710,7 @@ const defectSchemaCache: Array<Defect | undefined> = []
10708
10710
  * - Values that cannot be represented as JSON fall back to Effect's formatted
10709
10711
  * string representation.
10710
10712
  *
10711
- * @see {@link Error} for a schema that only accepts JavaScript `Error` values.
10713
+ * @see {@link ErrorInstance} for a schema that only accepts JavaScript `Error` values.
10712
10714
  * @category schemas
10713
10715
  * @since 4.0.0
10714
10716
  */
@@ -14129,19 +14131,26 @@ function getClassSchemaFactory<S extends Constraint>(
14129
14131
  if (memo !== undefined) {
14130
14132
  return memo
14131
14133
  }
14134
+ const ClassTypeId = getClassTypeId(identifier)
14135
+ const isClassValue: Predicate.Predicate<unknown> = (input) =>
14136
+ input instanceof self || Predicate.hasProperty(input, ClassTypeId)
14132
14137
  const transformation = getClassTransformation(self)
14133
14138
  const to = make<declareConstructor<Self, S["Encoded"], readonly [S]>>(
14134
14139
  new SchemaAST.Declaration(
14135
14140
  [from.ast],
14136
14141
  () => (input, ast) => {
14137
- return input instanceof self ||
14138
- Predicate.hasProperty(input, getClassTypeId(identifier)) ?
14142
+ return isClassValue(input) ?
14139
14143
  Effect.succeed(input) :
14140
14144
  Effect.fail(new SchemaIssue.InvalidType(ast))
14141
14145
  },
14142
14146
  {
14143
14147
  identifier,
14144
- [SchemaAST.ClassTypeId]: ([from]: readonly [SchemaAST.AST]) => new SchemaAST.Link(from, transformation),
14148
+ [InternalAnnotations.CONSTRUCTOR_ANNOTATION_KEY]: (
14149
+ [from]: readonly [SchemaAST.AST]
14150
+ ): SchemaAST.ConstructorDescriptor => ({
14151
+ isConstructed: isClassValue,
14152
+ link: new SchemaAST.Link(from, transformation)
14153
+ }),
14145
14154
  toCodec: ([from]: readonly [ConstraintCodec<S["Encoded"], S["Encoded"]>]) =>
14146
14155
  new SchemaAST.Link(from.ast, transformation),
14147
14156
  toArbitrary: ([from]: readonly [Annotations.ToArbitrary.TypeParameter<S["Type"]>]) => () => ({
@@ -14228,8 +14237,8 @@ type MissingSelfGeneric<Usage extends string> =
14228
14237
  * ```
14229
14238
  *
14230
14239
  * @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
14231
- * @see {@link ErrorClass} for defining schema-backed error classes
14232
- * @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
14240
+ * @see {@link Error} for defining schema-backed error classes
14241
+ * @see {@link TaggedError} for defining tagged schema-backed error classes
14233
14242
  *
14234
14243
  * @category constructors
14235
14244
  * @since 3.10.0
@@ -14298,8 +14307,8 @@ export const Class: {
14298
14307
  * ```
14299
14308
  *
14300
14309
  * @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
14301
- * @see {@link ErrorClass} for defining schema-backed error classes
14302
- * @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
14310
+ * @see {@link Error} for defining schema-backed error classes
14311
+ * @see {@link TaggedError} for defining tagged schema-backed error classes
14303
14312
  *
14304
14313
  * @category constructors
14305
14314
  * @since 3.10.0
@@ -14368,8 +14377,8 @@ export const Class: {
14368
14377
  * ```
14369
14378
  *
14370
14379
  * @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
14371
- * @see {@link ErrorClass} for defining schema-backed error classes
14372
- * @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
14380
+ * @see {@link Error} for defining schema-backed error classes
14381
+ * @see {@link TaggedError} for defining tagged schema-backed error classes
14373
14382
  *
14374
14383
  * @category constructors
14375
14384
  * @since 3.10.0
@@ -14441,8 +14450,8 @@ export const Class: {
14441
14450
  * ```
14442
14451
  *
14443
14452
  * @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
14444
- * @see {@link ErrorClass} for defining schema-backed error classes
14445
- * @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
14453
+ * @see {@link Error} for defining schema-backed error classes
14454
+ * @see {@link TaggedError} for defining tagged schema-backed error classes
14446
14455
  *
14447
14456
  * @category constructors
14448
14457
  * @since 3.10.0
@@ -14634,7 +14643,7 @@ export const TaggedClass: {
14634
14643
  * ```ts import.meta.vitest
14635
14644
  * import { Effect, Schema } from "effect"
14636
14645
  *
14637
- * class NotFound extends Schema.ErrorClass<NotFound>("NotFound")({
14646
+ * class NotFound extends Schema.Error<NotFound>("NotFound")({
14638
14647
  * id: Schema.Number
14639
14648
  * }) {}
14640
14649
  *
@@ -14648,7 +14657,7 @@ export const TaggedClass: {
14648
14657
  * @category constructors
14649
14658
  * @since 4.0.0
14650
14659
  */
14651
- export const ErrorClass: {
14660
+ export const Error: {
14652
14661
  /**
14653
14662
  * Creates a schema-backed error class that can be used as a typed,
14654
14663
  * yieldable error in Effect programs. Combines {@link Class} validation with
@@ -14660,7 +14669,7 @@ export const ErrorClass: {
14660
14669
  * ```ts import.meta.vitest
14661
14670
  * import { Effect, Schema } from "effect"
14662
14671
  *
14663
- * class NotFound extends Schema.ErrorClass<NotFound>("NotFound")({
14672
+ * class NotFound extends Schema.Error<NotFound>("NotFound")({
14664
14673
  * id: Schema.Number
14665
14674
  * }) {}
14666
14675
  *
@@ -14686,7 +14695,7 @@ export const ErrorClass: {
14686
14695
  * ```ts import.meta.vitest
14687
14696
  * import { Effect, Schema } from "effect"
14688
14697
  *
14689
- * class NotFound extends Schema.ErrorClass<NotFound>("NotFound")({
14698
+ * class NotFound extends Schema.Error<NotFound>("NotFound")({
14690
14699
  * id: Schema.Number
14691
14700
  * }) {}
14692
14701
  *
@@ -14703,7 +14712,7 @@ export const ErrorClass: {
14703
14712
  <const Fields extends Struct.Fields>(
14704
14713
  fields: Fields,
14705
14714
  annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>
14706
- ): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass">
14715
+ ): [Self] extends [never] ? MissingSelfGeneric<"Schema.Error">
14707
14716
  : Class<Self, Struct<Fields>, Cause_.YieldableError & Brand>
14708
14717
  /**
14709
14718
  * Creates a schema-backed error class that can be used as a typed,
@@ -14716,7 +14725,7 @@ export const ErrorClass: {
14716
14725
  * ```ts import.meta.vitest
14717
14726
  * import { Effect, Schema } from "effect"
14718
14727
  *
14719
- * class NotFound extends Schema.ErrorClass<NotFound>("NotFound")({
14728
+ * class NotFound extends Schema.Error<NotFound>("NotFound")({
14720
14729
  * id: Schema.Number
14721
14730
  * }) {}
14722
14731
  *
@@ -14730,13 +14739,13 @@ export const ErrorClass: {
14730
14739
  * @category constructors
14731
14740
  * @since 4.0.0
14732
14741
  */
14733
- <S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass"> : Class<Self, S, Cause_.YieldableError & Brand>
14742
+ <S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.Error"> : Class<Self, S, Cause_.YieldableError & Brand>
14734
14743
  }
14735
14744
  } = <Self, Brand = {}>(identifier: string) =>
14736
14745
  (
14737
14746
  schema: Struct.Fields | Struct<Struct.Fields>,
14738
14747
  annotations?: Annotations.Declaration<Self, readonly [Struct<Struct.Fields>]>
14739
- ): [Self] extends [never] ? MissingSelfGeneric<"Schema.ErrorClass">
14748
+ ): [Self] extends [never] ? MissingSelfGeneric<"Schema.Error">
14740
14749
  : Class<Self, Struct<Struct.Fields>, Cause_.YieldableError & Brand> =>
14741
14750
  {
14742
14751
  const struct = isStruct(schema) ? schema : Struct(schema)
@@ -14766,7 +14775,7 @@ export const ErrorClass: {
14766
14775
  * ```ts import.meta.vitest
14767
14776
  * import { Effect, Schema } from "effect"
14768
14777
  *
14769
- * class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
14778
+ * class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
14770
14779
  * id: Schema.Number
14771
14780
  * }) {}
14772
14781
  *
@@ -14781,7 +14790,7 @@ export const ErrorClass: {
14781
14790
  * @category constructors
14782
14791
  * @since 3.10.0
14783
14792
  */
14784
- export const TaggedErrorClass: {
14793
+ export const TaggedError: {
14785
14794
  /**
14786
14795
  * Defines a schema-backed yieldable error class with an automatically populated
14787
14796
  * `_tag` field.
@@ -14796,7 +14805,7 @@ export const TaggedErrorClass: {
14796
14805
  * ```ts import.meta.vitest
14797
14806
  * import { Effect, Schema } from "effect"
14798
14807
  *
14799
- * class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
14808
+ * class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
14800
14809
  * id: Schema.Number
14801
14810
  * }) {}
14802
14811
  *
@@ -14826,7 +14835,7 @@ export const TaggedErrorClass: {
14826
14835
  * ```ts import.meta.vitest
14827
14836
  * import { Effect, Schema } from "effect"
14828
14837
  *
14829
- * class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
14838
+ * class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
14830
14839
  * id: Schema.Number
14831
14840
  * }) {}
14832
14841
  *
@@ -14845,7 +14854,7 @@ export const TaggedErrorClass: {
14845
14854
  tag: Tag,
14846
14855
  fields: Fields,
14847
14856
  annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>
14848
- ): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedErrorClass">
14857
+ ): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedError">
14849
14858
  : Class<Self, TaggedStruct<Tag, Fields>, Cause_.YieldableError & Brand>
14850
14859
  /**
14851
14860
  * Defines a schema-backed yieldable error class with an automatically populated
@@ -14861,7 +14870,7 @@ export const TaggedErrorClass: {
14861
14870
  * ```ts import.meta.vitest
14862
14871
  * import { Effect, Schema } from "effect"
14863
14872
  *
14864
- * class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
14873
+ * class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
14865
14874
  * id: Schema.Number
14866
14875
  * }) {}
14867
14876
  *
@@ -14883,7 +14892,7 @@ export const TaggedErrorClass: {
14883
14892
  Self,
14884
14893
  readonly [Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>]
14885
14894
  >
14886
- ): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedErrorClass">
14895
+ ): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedError">
14887
14896
  : Class<Self, Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>, Cause_.YieldableError & Brand>
14888
14897
  }
14889
14898
  } = (identifier?: string) => {
@@ -14897,7 +14906,7 @@ export const TaggedErrorClass: {
14897
14906
  unsafePreserveChecks: true
14898
14907
  }) :
14899
14908
  TaggedStruct(tagValue, schema)
14900
- return ErrorClass<any, {}>(identifier ?? tagValue)(
14909
+ return Error<any, {}>(identifier ?? tagValue)(
14901
14910
  struct,
14902
14911
  annotations as Annotations.Declaration<any, readonly [typeof struct]>
14903
14912
  )
@@ -15385,7 +15394,7 @@ const toCodecJsonASTBase = SchemaAST.applyToSelfOrLastLinkEncoding((ast) => {
15385
15394
  export const toCodecJsonAST = memoize(toCodecJsonASTBase)
15386
15395
 
15387
15396
  function withoutConstructorDefault(context: SchemaAST.Context): SchemaAST.Context {
15388
- return context.defaultValue === undefined ?
15397
+ return context.constructorDefault === undefined ?
15389
15398
  context :
15390
15399
  new SchemaAST.Context(context.isOptional, context.isMutable, undefined, context.annotations)
15391
15400
  }