effect 4.0.0-beta.2 → 4.0.0-beta.20

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 (876) hide show
  1. package/dist/Array.d.ts +127 -299
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +102 -62
  4. package/dist/Array.js.map +1 -1
  5. package/dist/Cache.d.ts +2 -2
  6. package/dist/Cache.d.ts.map +1 -1
  7. package/dist/Cache.js +6 -5
  8. package/dist/Cache.js.map +1 -1
  9. package/dist/Cause.d.ts +1 -1
  10. package/dist/Cause.d.ts.map +1 -1
  11. package/dist/Channel.d.ts +116 -30
  12. package/dist/Channel.d.ts.map +1 -1
  13. package/dist/Channel.js +82 -37
  14. package/dist/Channel.js.map +1 -1
  15. package/dist/Chunk.d.ts +54 -247
  16. package/dist/Chunk.d.ts.map +1 -1
  17. package/dist/Chunk.js +36 -67
  18. package/dist/Chunk.js.map +1 -1
  19. package/dist/Combiner.d.ts +280 -13
  20. package/dist/Combiner.d.ts.map +1 -1
  21. package/dist/Combiner.js +198 -7
  22. package/dist/Combiner.js.map +1 -1
  23. package/dist/Config.d.ts +165 -9
  24. package/dist/Config.d.ts.map +1 -1
  25. package/dist/Config.js +62 -7
  26. package/dist/Config.js.map +1 -1
  27. package/dist/ConfigProvider.d.ts +1 -1
  28. package/dist/Cron.d.ts +1 -1
  29. package/dist/Data.d.ts +534 -365
  30. package/dist/Data.d.ts.map +1 -1
  31. package/dist/Data.js +132 -79
  32. package/dist/Data.js.map +1 -1
  33. package/dist/DateTime.d.ts +23 -161
  34. package/dist/DateTime.d.ts.map +1 -1
  35. package/dist/DateTime.js +6 -51
  36. package/dist/DateTime.js.map +1 -1
  37. package/dist/Duration.d.ts +12 -12
  38. package/dist/Duration.d.ts.map +1 -1
  39. package/dist/Duration.js +12 -12
  40. package/dist/Duration.js.map +1 -1
  41. package/dist/Effect.d.ts +733 -687
  42. package/dist/Effect.d.ts.map +1 -1
  43. package/dist/Effect.js +233 -250
  44. package/dist/Effect.js.map +1 -1
  45. package/dist/Encoding.d.ts +194 -0
  46. package/dist/Encoding.d.ts.map +1 -0
  47. package/dist/Encoding.js +352 -0
  48. package/dist/Encoding.js.map +1 -0
  49. package/dist/Equal.d.ts +276 -109
  50. package/dist/Equal.d.ts.map +1 -1
  51. package/dist/Equal.js +124 -48
  52. package/dist/Equal.js.map +1 -1
  53. package/dist/ErrorReporter.d.ts +376 -0
  54. package/dist/ErrorReporter.d.ts.map +1 -0
  55. package/dist/ErrorReporter.js +246 -0
  56. package/dist/ErrorReporter.js.map +1 -0
  57. package/dist/Fiber.d.ts +2 -2
  58. package/dist/Fiber.d.ts.map +1 -1
  59. package/dist/Fiber.js.map +1 -1
  60. package/dist/FileSystem.d.ts +1 -1
  61. package/dist/FileSystem.d.ts.map +1 -1
  62. package/dist/FileSystem.js +5 -5
  63. package/dist/FileSystem.js.map +1 -1
  64. package/dist/Filter.d.ts +30 -34
  65. package/dist/Filter.d.ts.map +1 -1
  66. package/dist/Filter.js +15 -13
  67. package/dist/Filter.js.map +1 -1
  68. package/dist/Formatter.d.ts +131 -47
  69. package/dist/Formatter.d.ts.map +1 -1
  70. package/dist/Formatter.js +229 -51
  71. package/dist/Formatter.js.map +1 -1
  72. package/dist/Graph.d.ts +1 -1
  73. package/dist/Graph.d.ts.map +1 -1
  74. package/dist/Graph.js +5 -8
  75. package/dist/Graph.js.map +1 -1
  76. package/dist/HashMap.d.ts +15 -14
  77. package/dist/HashMap.d.ts.map +1 -1
  78. package/dist/HashMap.js +4 -4
  79. package/dist/HashMap.js.map +1 -1
  80. package/dist/Iterable.d.ts +40 -39
  81. package/dist/Iterable.d.ts.map +1 -1
  82. package/dist/Iterable.js +94 -22
  83. package/dist/Iterable.js.map +1 -1
  84. package/dist/JsonSchema.d.ts +299 -10
  85. package/dist/JsonSchema.d.ts.map +1 -1
  86. package/dist/JsonSchema.js +323 -4
  87. package/dist/JsonSchema.js.map +1 -1
  88. package/dist/Latch.d.ts +109 -0
  89. package/dist/Latch.d.ts.map +1 -0
  90. package/dist/Latch.js +72 -0
  91. package/dist/Latch.js.map +1 -0
  92. package/dist/Layer.d.ts +9 -9
  93. package/dist/Layer.d.ts.map +1 -1
  94. package/dist/Layer.js.map +1 -1
  95. package/dist/LayerMap.d.ts +4 -4
  96. package/dist/LayerMap.d.ts.map +1 -1
  97. package/dist/LogLevel.d.ts +32 -0
  98. package/dist/LogLevel.d.ts.map +1 -1
  99. package/dist/LogLevel.js +28 -100
  100. package/dist/LogLevel.js.map +1 -1
  101. package/dist/Logger.d.ts +29 -95
  102. package/dist/Logger.d.ts.map +1 -1
  103. package/dist/Logger.js +2 -3
  104. package/dist/Logger.js.map +1 -1
  105. package/dist/ManagedRuntime.d.ts +1 -1
  106. package/dist/ManagedRuntime.js +1 -1
  107. package/dist/Metric.d.ts +2 -2
  108. package/dist/Metric.d.ts.map +1 -1
  109. package/dist/Metric.js +1 -1
  110. package/dist/Metric.js.map +1 -1
  111. package/dist/Optic.d.ts +947 -18
  112. package/dist/Optic.d.ts.map +1 -1
  113. package/dist/Optic.js +454 -5
  114. package/dist/Optic.js.map +1 -1
  115. package/dist/Option.d.ts +22 -15
  116. package/dist/Option.d.ts.map +1 -1
  117. package/dist/Option.js +14 -7
  118. package/dist/Option.js.map +1 -1
  119. package/dist/Pipeable.d.ts +17 -0
  120. package/dist/Pipeable.d.ts.map +1 -1
  121. package/dist/Pipeable.js +19 -1
  122. package/dist/Pipeable.js.map +1 -1
  123. package/dist/PlatformError.d.ts +10 -9
  124. package/dist/PlatformError.d.ts.map +1 -1
  125. package/dist/PlatformError.js +2 -2
  126. package/dist/PlatformError.js.map +1 -1
  127. package/dist/Pool.d.ts +6 -4
  128. package/dist/Pool.d.ts.map +1 -1
  129. package/dist/Pool.js +7 -5
  130. package/dist/Pool.js.map +1 -1
  131. package/dist/PubSub.d.ts +3 -2
  132. package/dist/PubSub.d.ts.map +1 -1
  133. package/dist/PubSub.js +3 -2
  134. package/dist/PubSub.js.map +1 -1
  135. package/dist/Pull.d.ts.map +1 -1
  136. package/dist/Pull.js +1 -1
  137. package/dist/Pull.js.map +1 -1
  138. package/dist/Queue.d.ts.map +1 -1
  139. package/dist/Queue.js +0 -1
  140. package/dist/Queue.js.map +1 -1
  141. package/dist/Random.d.ts +35 -1
  142. package/dist/Random.d.ts.map +1 -1
  143. package/dist/Random.js +46 -12
  144. package/dist/Random.js.map +1 -1
  145. package/dist/RcMap.d.ts +2 -2
  146. package/dist/RcMap.d.ts.map +1 -1
  147. package/dist/RcMap.js +1 -1
  148. package/dist/RcMap.js.map +1 -1
  149. package/dist/RcRef.d.ts +1 -1
  150. package/dist/RcRef.d.ts.map +1 -1
  151. package/dist/Record.d.ts +24 -120
  152. package/dist/Record.d.ts.map +1 -1
  153. package/dist/Record.js +21 -41
  154. package/dist/Record.js.map +1 -1
  155. package/dist/Reducer.d.ts +166 -7
  156. package/dist/Reducer.d.ts.map +1 -1
  157. package/dist/Reducer.js +135 -1
  158. package/dist/Reducer.js.map +1 -1
  159. package/dist/References.d.ts +3 -3
  160. package/dist/References.d.ts.map +1 -1
  161. package/dist/Request.d.ts +1 -1
  162. package/dist/Request.d.ts.map +1 -1
  163. package/dist/Request.js +2 -1
  164. package/dist/Request.js.map +1 -1
  165. package/dist/RequestResolver.d.ts +6 -26
  166. package/dist/RequestResolver.d.ts.map +1 -1
  167. package/dist/RequestResolver.js +0 -20
  168. package/dist/RequestResolver.js.map +1 -1
  169. package/dist/Result.d.ts +12 -0
  170. package/dist/Result.d.ts.map +1 -1
  171. package/dist/Result.js +12 -0
  172. package/dist/Result.js.map +1 -1
  173. package/dist/Schedule.d.ts +47 -20
  174. package/dist/Schedule.d.ts.map +1 -1
  175. package/dist/Schedule.js +91 -34
  176. package/dist/Schedule.js.map +1 -1
  177. package/dist/Schema.d.ts +266 -50
  178. package/dist/Schema.d.ts.map +1 -1
  179. package/dist/Schema.js +426 -74
  180. package/dist/Schema.js.map +1 -1
  181. package/dist/SchemaAST.d.ts.map +1 -1
  182. package/dist/SchemaAST.js +3 -2
  183. package/dist/SchemaAST.js.map +1 -1
  184. package/dist/SchemaGetter.d.ts +2 -2
  185. package/dist/SchemaGetter.d.ts.map +1 -1
  186. package/dist/SchemaGetter.js +12 -14
  187. package/dist/SchemaGetter.js.map +1 -1
  188. package/dist/SchemaParser.d.ts +5 -0
  189. package/dist/SchemaParser.d.ts.map +1 -1
  190. package/dist/SchemaParser.js +10 -0
  191. package/dist/SchemaParser.js.map +1 -1
  192. package/dist/SchemaRepresentation.d.ts +44 -43
  193. package/dist/SchemaRepresentation.d.ts.map +1 -1
  194. package/dist/SchemaRepresentation.js +43 -24
  195. package/dist/SchemaRepresentation.js.map +1 -1
  196. package/dist/SchemaTransformation.d.ts +107 -3
  197. package/dist/SchemaTransformation.d.ts.map +1 -1
  198. package/dist/SchemaTransformation.js +159 -4
  199. package/dist/SchemaTransformation.js.map +1 -1
  200. package/dist/ScopedCache.d.ts +2 -2
  201. package/dist/ScopedCache.d.ts.map +1 -1
  202. package/dist/ScopedCache.js +1 -1
  203. package/dist/ScopedCache.js.map +1 -1
  204. package/dist/Semaphore.d.ts +211 -0
  205. package/dist/Semaphore.d.ts.map +1 -0
  206. package/dist/{PartitionedSemaphore.js → Semaphore.js} +97 -13
  207. package/dist/Semaphore.js.map +1 -0
  208. package/dist/ServiceMap.d.ts +39 -30
  209. package/dist/ServiceMap.d.ts.map +1 -1
  210. package/dist/ServiceMap.js +3 -3
  211. package/dist/ServiceMap.js.map +1 -1
  212. package/dist/Sink.d.ts +13 -13
  213. package/dist/Sink.d.ts.map +1 -1
  214. package/dist/Sink.js +53 -6
  215. package/dist/Sink.js.map +1 -1
  216. package/dist/Stream.d.ts +235 -423
  217. package/dist/Stream.d.ts.map +1 -1
  218. package/dist/Stream.js +123 -76
  219. package/dist/Stream.js.map +1 -1
  220. package/dist/Struct.d.ts +16 -0
  221. package/dist/Struct.d.ts.map +1 -1
  222. package/dist/Struct.js +22 -0
  223. package/dist/Struct.js.map +1 -1
  224. package/dist/SubscriptionRef.d.ts +2 -1
  225. package/dist/SubscriptionRef.d.ts.map +1 -1
  226. package/dist/SubscriptionRef.js +2 -1
  227. package/dist/SubscriptionRef.js.map +1 -1
  228. package/dist/SynchronizedRef.d.ts +2 -1
  229. package/dist/SynchronizedRef.d.ts.map +1 -1
  230. package/dist/SynchronizedRef.js +2 -1
  231. package/dist/SynchronizedRef.js.map +1 -1
  232. package/dist/Trie.d.ts +18 -17
  233. package/dist/Trie.d.ts.map +1 -1
  234. package/dist/Trie.js +5 -5
  235. package/dist/Trie.js.map +1 -1
  236. package/dist/TxChunk.d.ts +37 -37
  237. package/dist/TxChunk.d.ts.map +1 -1
  238. package/dist/TxChunk.js +3 -3
  239. package/dist/TxChunk.js.map +1 -1
  240. package/dist/TxDeferred.d.ts +328 -0
  241. package/dist/TxDeferred.d.ts.map +1 -0
  242. package/dist/TxDeferred.js +196 -0
  243. package/dist/TxDeferred.js.map +1 -0
  244. package/dist/TxHashMap.d.ts +84 -83
  245. package/dist/TxHashMap.d.ts.map +1 -1
  246. package/dist/TxHashMap.js +24 -24
  247. package/dist/TxHashMap.js.map +1 -1
  248. package/dist/TxHashSet.d.ts +35 -35
  249. package/dist/TxHashSet.d.ts.map +1 -1
  250. package/dist/TxHashSet.js +14 -14
  251. package/dist/TxHashSet.js.map +1 -1
  252. package/dist/TxPriorityQueue.d.ts +609 -0
  253. package/dist/TxPriorityQueue.d.ts.map +1 -0
  254. package/dist/TxPriorityQueue.js +415 -0
  255. package/dist/TxPriorityQueue.js.map +1 -0
  256. package/dist/TxPubSub.d.ts +585 -0
  257. package/dist/TxPubSub.d.ts.map +1 -0
  258. package/dist/TxPubSub.js +521 -0
  259. package/dist/TxPubSub.js.map +1 -0
  260. package/dist/TxQueue.d.ts +32 -32
  261. package/dist/TxQueue.d.ts.map +1 -1
  262. package/dist/TxQueue.js +26 -26
  263. package/dist/TxQueue.js.map +1 -1
  264. package/dist/TxReentrantLock.d.ts +523 -0
  265. package/dist/TxReentrantLock.d.ts.map +1 -0
  266. package/dist/TxReentrantLock.js +504 -0
  267. package/dist/TxReentrantLock.js.map +1 -0
  268. package/dist/TxRef.d.ts +34 -34
  269. package/dist/TxRef.d.ts.map +1 -1
  270. package/dist/TxRef.js +21 -14
  271. package/dist/TxRef.js.map +1 -1
  272. package/dist/TxSemaphore.d.ts +8 -8
  273. package/dist/TxSemaphore.d.ts.map +1 -1
  274. package/dist/TxSemaphore.js +7 -7
  275. package/dist/TxSemaphore.js.map +1 -1
  276. package/dist/TxSubscriptionRef.d.ts +508 -0
  277. package/dist/TxSubscriptionRef.d.ts.map +1 -0
  278. package/dist/TxSubscriptionRef.js +293 -0
  279. package/dist/TxSubscriptionRef.js.map +1 -0
  280. package/dist/Types.d.ts +84 -6
  281. package/dist/Types.d.ts.map +1 -1
  282. package/dist/index.d.ts +591 -20
  283. package/dist/index.d.ts.map +1 -1
  284. package/dist/index.js +591 -20
  285. package/dist/index.js.map +1 -1
  286. package/dist/internal/core.js +11 -3
  287. package/dist/internal/core.js.map +1 -1
  288. package/dist/internal/dateTime.js +3 -11
  289. package/dist/internal/dateTime.js.map +1 -1
  290. package/dist/internal/effect.js +225 -99
  291. package/dist/internal/effect.js.map +1 -1
  292. package/dist/internal/hashMap.js +5 -4
  293. package/dist/internal/hashMap.js.map +1 -1
  294. package/dist/internal/random.d.ts +2 -0
  295. package/dist/internal/random.d.ts.map +1 -0
  296. package/dist/internal/random.js +13 -0
  297. package/dist/internal/random.js.map +1 -0
  298. package/dist/internal/rcRef.js +3 -2
  299. package/dist/internal/rcRef.js.map +1 -1
  300. package/dist/internal/request.js +2 -2
  301. package/dist/internal/request.js.map +1 -1
  302. package/dist/internal/schema/annotations.js +2 -0
  303. package/dist/internal/schema/annotations.js.map +1 -1
  304. package/dist/internal/schema/schema.js +1 -0
  305. package/dist/internal/schema/schema.js.map +1 -1
  306. package/dist/internal/trie.js +5 -4
  307. package/dist/internal/trie.js.map +1 -1
  308. package/dist/testing/TestClock.d.ts +7 -6
  309. package/dist/testing/TestClock.d.ts.map +1 -1
  310. package/dist/testing/TestClock.js +6 -4
  311. package/dist/testing/TestClock.js.map +1 -1
  312. package/dist/testing/TestSchema.d.ts +8 -8
  313. package/dist/testing/TestSchema.d.ts.map +1 -1
  314. package/dist/testing/TestSchema.js.map +1 -1
  315. package/dist/unstable/ai/AiError.d.ts +128 -48
  316. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  317. package/dist/unstable/ai/AiError.js +11 -12
  318. package/dist/unstable/ai/AiError.js.map +1 -1
  319. package/dist/unstable/ai/Chat.d.ts +3 -3
  320. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  321. package/dist/unstable/ai/Chat.js +4 -3
  322. package/dist/unstable/ai/Chat.js.map +1 -1
  323. package/dist/unstable/ai/LanguageModel.d.ts +4 -2
  324. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  325. package/dist/unstable/ai/LanguageModel.js +86 -14
  326. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  327. package/dist/unstable/ai/McpSchema.d.ts +163 -87
  328. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  329. package/dist/unstable/ai/McpSchema.js +49 -12
  330. package/dist/unstable/ai/McpSchema.js.map +1 -1
  331. package/dist/unstable/ai/McpServer.d.ts +1 -1
  332. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  333. package/dist/unstable/ai/McpServer.js +33 -6
  334. package/dist/unstable/ai/McpServer.js.map +1 -1
  335. package/dist/unstable/ai/Model.d.ts +25 -7
  336. package/dist/unstable/ai/Model.d.ts.map +1 -1
  337. package/dist/unstable/ai/Model.js +22 -6
  338. package/dist/unstable/ai/Model.js.map +1 -1
  339. package/dist/unstable/ai/Prompt.d.ts +20 -20
  340. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  341. package/dist/unstable/ai/Response.d.ts +26 -26
  342. package/dist/unstable/ai/Response.d.ts.map +1 -1
  343. package/dist/unstable/ai/Response.js +1 -1
  344. package/dist/unstable/ai/Response.js.map +1 -1
  345. package/dist/unstable/ai/Tool.d.ts +19 -3
  346. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  347. package/dist/unstable/ai/Tool.js +14 -9
  348. package/dist/unstable/ai/Tool.js.map +1 -1
  349. package/dist/unstable/ai/index.d.ts +1 -1
  350. package/dist/unstable/ai/index.js +1 -1
  351. package/dist/unstable/cli/CliError.d.ts +5 -5
  352. package/dist/unstable/cli/CliOutput.js +59 -6
  353. package/dist/unstable/cli/CliOutput.js.map +1 -1
  354. package/dist/unstable/cli/Command.d.ts +276 -19
  355. package/dist/unstable/cli/Command.d.ts.map +1 -1
  356. package/dist/unstable/cli/Command.js +234 -36
  357. package/dist/unstable/cli/Command.js.map +1 -1
  358. package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
  359. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
  360. package/dist/unstable/cli/GlobalFlag.js +118 -0
  361. package/dist/unstable/cli/GlobalFlag.js.map +1 -0
  362. package/dist/unstable/cli/HelpDoc.d.ts +70 -2
  363. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  364. package/dist/unstable/cli/index.d.ts +4 -0
  365. package/dist/unstable/cli/index.d.ts.map +1 -1
  366. package/dist/unstable/cli/index.js +4 -0
  367. package/dist/unstable/cli/index.js.map +1 -1
  368. package/dist/unstable/cli/internal/command.d.ts +17 -8
  369. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  370. package/dist/unstable/cli/internal/command.js +32 -23
  371. package/dist/unstable/cli/internal/command.js.map +1 -1
  372. package/dist/unstable/cli/internal/completions/CommandDescriptor.js +7 -2
  373. package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
  374. package/dist/unstable/cli/internal/help.d.ts +33 -0
  375. package/dist/unstable/cli/internal/help.d.ts.map +1 -0
  376. package/dist/unstable/cli/internal/help.js +107 -0
  377. package/dist/unstable/cli/internal/help.js.map +1 -0
  378. package/dist/unstable/cli/internal/parser.js +29 -36
  379. package/dist/unstable/cli/internal/parser.js.map +1 -1
  380. package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
  381. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  382. package/dist/unstable/cluster/ClusterCron.js +1 -1
  383. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  384. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  385. package/dist/unstable/cluster/ClusterWorkflowEngine.js +4 -3
  386. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  387. package/dist/unstable/cluster/Entity.d.ts +7 -6
  388. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  389. package/dist/unstable/cluster/Entity.js.map +1 -1
  390. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  391. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  392. package/dist/unstable/cluster/Envelope.d.ts +1 -1
  393. package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
  394. package/dist/unstable/cluster/K8sHttpClient.js +4 -4
  395. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  396. package/dist/unstable/cluster/Message.d.ts +10 -10
  397. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  398. package/dist/unstable/cluster/MessageStorage.js +2 -1
  399. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  400. package/dist/unstable/cluster/Reply.d.ts +6 -6
  401. package/dist/unstable/cluster/Runner.d.ts +1 -1
  402. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  403. package/dist/unstable/cluster/Runners.js +4 -3
  404. package/dist/unstable/cluster/Runners.js.map +1 -1
  405. package/dist/unstable/cluster/Sharding.d.ts +2 -2
  406. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  407. package/dist/unstable/cluster/Sharding.js +9 -7
  408. package/dist/unstable/cluster/Sharding.js.map +1 -1
  409. package/dist/unstable/cluster/ShardingConfig.d.ts +21 -21
  410. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  411. package/dist/unstable/cluster/ShardingConfig.js +20 -20
  412. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  413. package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
  414. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  415. package/dist/unstable/cluster/internal/entityManager.js +5 -4
  416. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  417. package/dist/unstable/cluster/internal/entityReaper.js +2 -1
  418. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  419. package/dist/unstable/cluster/internal/resourceRef.js +2 -1
  420. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  421. package/dist/unstable/devtools/DevToolsSchema.d.ts +36 -36
  422. package/dist/unstable/encoding/Msgpack.d.ts +1 -1
  423. package/dist/unstable/encoding/Ndjson.d.ts +1 -1
  424. package/dist/unstable/encoding/Sse.d.ts +4 -4
  425. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  426. package/dist/unstable/encoding/Sse.js +1 -1
  427. package/dist/unstable/encoding/Sse.js.map +1 -1
  428. package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
  429. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  430. package/dist/unstable/eventlog/EventLog.js +2 -1
  431. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  432. package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
  433. package/dist/unstable/http/Cookies.d.ts +3 -3
  434. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  435. package/dist/unstable/http/Cookies.js +2 -2
  436. package/dist/unstable/http/Cookies.js.map +1 -1
  437. package/dist/unstable/http/Headers.d.ts.map +1 -1
  438. package/dist/unstable/http/Headers.js +27 -10
  439. package/dist/unstable/http/Headers.js.map +1 -1
  440. package/dist/unstable/http/HttpBody.d.ts +17 -2
  441. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  442. package/dist/unstable/http/HttpBody.js +28 -1
  443. package/dist/unstable/http/HttpBody.js.map +1 -1
  444. package/dist/unstable/http/HttpClient.d.ts +37 -13
  445. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  446. package/dist/unstable/http/HttpClient.js +4 -4
  447. package/dist/unstable/http/HttpClient.js.map +1 -1
  448. package/dist/unstable/http/HttpClientError.d.ts +7 -7
  449. package/dist/unstable/http/HttpClientRequest.d.ts +27 -11
  450. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  451. package/dist/unstable/http/HttpClientRequest.js +15 -3
  452. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  453. package/dist/unstable/http/HttpEffect.d.ts +3 -8
  454. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  455. package/dist/unstable/http/HttpEffect.js +42 -56
  456. package/dist/unstable/http/HttpEffect.js.map +1 -1
  457. package/dist/unstable/http/HttpMethod.d.ts +4 -4
  458. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  459. package/dist/unstable/http/HttpMethod.js +3 -3
  460. package/dist/unstable/http/HttpMethod.js.map +1 -1
  461. package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
  462. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  463. package/dist/unstable/http/HttpMiddleware.js +8 -17
  464. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  465. package/dist/unstable/http/HttpServerError.d.ts +20 -33
  466. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  467. package/dist/unstable/http/HttpServerError.js +37 -44
  468. package/dist/unstable/http/HttpServerError.js.map +1 -1
  469. package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
  470. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  471. package/dist/unstable/http/HttpServerRespondable.js +5 -5
  472. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  473. package/dist/unstable/http/HttpServerResponse.d.ts +2 -1
  474. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  475. package/dist/unstable/http/HttpServerResponse.js +3 -1
  476. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  477. package/dist/unstable/http/Multipart.d.ts +3 -3
  478. package/dist/unstable/http/UrlParams.d.ts +14 -6
  479. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  480. package/dist/unstable/http/UrlParams.js +1 -1
  481. package/dist/unstable/http/UrlParams.js.map +1 -1
  482. package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
  483. package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
  484. package/dist/unstable/http/internal/preResponseHandler.js +10 -0
  485. package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
  486. package/dist/unstable/httpapi/HttpApi.d.ts +3 -3
  487. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  488. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  489. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +11 -5
  490. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  491. package/dist/unstable/httpapi/HttpApiBuilder.js +23 -12
  492. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  493. package/dist/unstable/httpapi/HttpApiClient.d.ts +7 -2
  494. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  495. package/dist/unstable/httpapi/HttpApiClient.js +3 -3
  496. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  497. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +31 -44
  498. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  499. package/dist/unstable/httpapi/HttpApiEndpoint.js +15 -24
  500. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  501. package/dist/unstable/httpapi/HttpApiError.d.ts +11 -0
  502. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  503. package/dist/unstable/httpapi/HttpApiError.js +29 -9
  504. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  505. package/dist/unstable/httpapi/HttpApiGroup.d.ts +3 -3
  506. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  507. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  508. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -4
  509. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  510. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  511. package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
  512. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  513. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  514. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
  515. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  516. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  517. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  518. package/dist/unstable/httpapi/OpenApi.js +32 -21
  519. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  520. package/dist/unstable/observability/Otlp.d.ts +12 -12
  521. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  522. package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
  523. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  524. package/dist/unstable/observability/OtlpExporter.js +1 -1
  525. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  526. package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
  527. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  528. package/dist/unstable/observability/OtlpLogger.js +7 -4
  529. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  530. package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
  531. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  532. package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
  533. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  534. package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
  535. package/dist/unstable/persistence/KeyValueStore.js +6 -6
  536. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  537. package/dist/unstable/persistence/Persistable.d.ts +2 -2
  538. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  539. package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
  540. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  541. package/dist/unstable/persistence/PersistedCache.js +2 -1
  542. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  543. package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
  544. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  545. package/dist/unstable/persistence/PersistedQueue.js +12 -11
  546. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  547. package/dist/unstable/persistence/Persistence.d.ts +1 -1
  548. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  549. package/dist/unstable/persistence/Persistence.js +2 -2
  550. package/dist/unstable/persistence/Persistence.js.map +1 -1
  551. package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
  552. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  553. package/dist/unstable/persistence/RateLimiter.js +1 -1
  554. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  555. package/dist/unstable/process/ChildProcess.d.ts +5 -128
  556. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  557. package/dist/unstable/process/ChildProcess.js +1 -65
  558. package/dist/unstable/process/ChildProcess.js.map +1 -1
  559. package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -7
  560. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  561. package/dist/unstable/process/ChildProcessSpawner.js +21 -1
  562. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  563. package/dist/unstable/reactivity/Atom.d.ts +10 -10
  564. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  565. package/dist/unstable/reactivity/Atom.js +16 -13
  566. package/dist/unstable/reactivity/Atom.js.map +1 -1
  567. package/dist/unstable/reactivity/AtomHttpApi.d.ts +8 -8
  568. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  569. package/dist/unstable/reactivity/AtomHttpApi.js +3 -3
  570. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  571. package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
  572. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  573. package/dist/unstable/reactivity/AtomRegistry.js +24 -7
  574. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  575. package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
  576. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  577. package/dist/unstable/reactivity/AtomRpc.js +1 -1
  578. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  579. package/dist/unstable/reactivity/Hydration.d.ts +39 -0
  580. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
  581. package/dist/unstable/reactivity/Hydration.js +76 -0
  582. package/dist/unstable/reactivity/Hydration.js.map +1 -0
  583. package/dist/unstable/reactivity/index.d.ts +4 -0
  584. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  585. package/dist/unstable/reactivity/index.js +4 -0
  586. package/dist/unstable/reactivity/index.js.map +1 -1
  587. package/dist/unstable/rpc/Rpc.d.ts +4 -4
  588. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  589. package/dist/unstable/rpc/Rpc.js.map +1 -1
  590. package/dist/unstable/rpc/RpcClient.d.ts +5 -26
  591. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  592. package/dist/unstable/rpc/RpcClient.js +6 -13
  593. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  594. package/dist/unstable/rpc/RpcGroup.d.ts +2 -2
  595. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  596. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  597. package/dist/unstable/rpc/RpcMiddleware.d.ts +3 -3
  598. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  599. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  600. package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
  601. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  602. package/dist/unstable/rpc/RpcSchema.js +14 -0
  603. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  604. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  605. package/dist/unstable/rpc/RpcSerialization.js +34 -9
  606. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  607. package/dist/unstable/rpc/RpcServer.d.ts +0 -7
  608. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  609. package/dist/unstable/rpc/RpcServer.js +15 -15
  610. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  611. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  612. package/dist/unstable/rpc/Utils.js +2 -1
  613. package/dist/unstable/rpc/Utils.js.map +1 -1
  614. package/dist/unstable/schema/Model.d.ts +1 -1
  615. package/dist/unstable/schema/Model.d.ts.map +1 -1
  616. package/dist/unstable/schema/VariantSchema.d.ts +3 -3
  617. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  618. package/dist/unstable/schema/VariantSchema.js +3 -3
  619. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  620. package/dist/unstable/socket/Socket.d.ts +4 -4
  621. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  622. package/dist/unstable/socket/Socket.js +6 -5
  623. package/dist/unstable/socket/Socket.js.map +1 -1
  624. package/dist/unstable/socket/SocketServer.d.ts +3 -3
  625. package/dist/unstable/sql/Migrator.d.ts +1 -1
  626. package/dist/unstable/sql/SqlClient.d.ts +1 -1
  627. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  628. package/dist/unstable/sql/SqlError.d.ts +14 -14
  629. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  630. package/dist/unstable/sql/SqlError.js +9 -3
  631. package/dist/unstable/sql/SqlError.js.map +1 -1
  632. package/dist/unstable/sql/SqlModel.d.ts +2 -2
  633. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  634. package/dist/unstable/sql/SqlModel.js +3 -3
  635. package/dist/unstable/sql/SqlModel.js.map +1 -1
  636. package/dist/unstable/sql/SqlSchema.d.ts +16 -5
  637. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  638. package/dist/unstable/sql/SqlSchema.js +17 -7
  639. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  640. package/dist/unstable/sql/Statement.js +0 -1
  641. package/dist/unstable/sql/Statement.js.map +1 -1
  642. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  643. package/dist/unstable/workers/Worker.js +2 -1
  644. package/dist/unstable/workers/Worker.js.map +1 -1
  645. package/dist/unstable/workflow/DurableClock.d.ts +3 -3
  646. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  647. package/dist/unstable/workflow/DurableClock.js +3 -3
  648. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  649. package/dist/unstable/workflow/DurableDeferred.js +2 -2
  650. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  651. package/dist/unstable/workflow/Workflow.d.ts +3 -3
  652. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  653. package/dist/unstable/workflow/WorkflowEngine.d.ts +8 -1
  654. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  655. package/dist/unstable/workflow/WorkflowEngine.js +133 -1
  656. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  657. package/package.json +2 -2
  658. package/src/Array.ts +190 -342
  659. package/src/Cache.ts +9 -8
  660. package/src/Cause.ts +1 -1
  661. package/src/Channel.ts +554 -138
  662. package/src/Chunk.ts +81 -268
  663. package/src/Combiner.ts +280 -13
  664. package/src/Config.ts +183 -21
  665. package/src/Data.ts +538 -374
  666. package/src/DateTime.ts +24 -164
  667. package/src/Duration.ts +15 -15
  668. package/src/Effect.ts +909 -817
  669. package/src/Encoding.ts +879 -0
  670. package/src/Equal.ts +278 -111
  671. package/src/ErrorReporter.ts +459 -0
  672. package/src/Fiber.ts +9 -2
  673. package/src/FileSystem.ts +7 -8
  674. package/src/Filter.ts +48 -58
  675. package/src/Formatter.ts +253 -51
  676. package/src/Graph.ts +24 -11
  677. package/src/HashMap.ts +15 -14
  678. package/src/Iterable.ts +105 -50
  679. package/src/JsonSchema.ts +383 -10
  680. package/src/Latch.ts +112 -0
  681. package/src/Layer.ts +11 -15
  682. package/src/LayerMap.ts +5 -5
  683. package/src/LogLevel.ts +37 -0
  684. package/src/Logger.ts +33 -100
  685. package/src/ManagedRuntime.ts +1 -1
  686. package/src/Metric.ts +4 -4
  687. package/src/Optic.ts +948 -19
  688. package/src/Option.ts +30 -20
  689. package/src/Pipeable.ts +32 -1
  690. package/src/PlatformError.ts +5 -5
  691. package/src/Pool.ts +13 -11
  692. package/src/PubSub.ts +10 -9
  693. package/src/Pull.ts +1 -1
  694. package/src/Queue.ts +0 -1
  695. package/src/Random.ts +51 -14
  696. package/src/RcMap.ts +5 -5
  697. package/src/RcRef.ts +1 -1
  698. package/src/Record.ts +43 -152
  699. package/src/Reducer.ts +166 -7
  700. package/src/References.ts +4 -4
  701. package/src/Request.ts +3 -2
  702. package/src/RequestResolver.ts +9 -29
  703. package/src/Result.ts +13 -0
  704. package/src/Schedule.ts +315 -160
  705. package/src/Schema.ts +661 -116
  706. package/src/SchemaAST.ts +3 -2
  707. package/src/SchemaGetter.ts +12 -14
  708. package/src/SchemaParser.ts +11 -0
  709. package/src/SchemaRepresentation.ts +43 -24
  710. package/src/SchemaTransformation.ts +189 -4
  711. package/src/ScopedCache.ts +3 -3
  712. package/src/Semaphore.ts +356 -0
  713. package/src/ServiceMap.ts +47 -38
  714. package/src/Sink.ts +78 -26
  715. package/src/Stream.ts +565 -600
  716. package/src/Struct.ts +26 -0
  717. package/src/SubscriptionRef.ts +3 -2
  718. package/src/SynchronizedRef.ts +3 -2
  719. package/src/Trie.ts +18 -17
  720. package/src/TxChunk.ts +72 -53
  721. package/src/TxDeferred.ts +394 -0
  722. package/src/TxHashMap.ts +332 -285
  723. package/src/TxHashSet.ts +111 -116
  724. package/src/TxPriorityQueue.ts +767 -0
  725. package/src/TxPubSub.ts +789 -0
  726. package/src/TxQueue.ts +241 -251
  727. package/src/TxReentrantLock.ts +753 -0
  728. package/src/TxRef.ts +50 -38
  729. package/src/TxSemaphore.ts +29 -32
  730. package/src/TxSubscriptionRef.ts +639 -0
  731. package/src/Types.ts +78 -2
  732. package/src/index.ts +600 -21
  733. package/src/internal/core.ts +12 -5
  734. package/src/internal/dateTime.ts +9 -30
  735. package/src/internal/effect.ts +660 -265
  736. package/src/internal/hashMap.ts +9 -7
  737. package/src/internal/random.ts +20 -0
  738. package/src/internal/rcRef.ts +4 -3
  739. package/src/internal/request.ts +2 -2
  740. package/src/internal/schema/annotations.ts +2 -0
  741. package/src/internal/schema/schema.ts +1 -0
  742. package/src/internal/trie.ts +16 -9
  743. package/src/testing/TestClock.ts +13 -11
  744. package/src/testing/TestSchema.ts +10 -10
  745. package/src/unstable/ai/AiError.ts +97 -44
  746. package/src/unstable/ai/Chat.ts +12 -11
  747. package/src/unstable/ai/LanguageModel.ts +129 -25
  748. package/src/unstable/ai/McpSchema.ts +59 -13
  749. package/src/unstable/ai/McpServer.ts +46 -8
  750. package/src/unstable/ai/Model.ts +40 -9
  751. package/src/unstable/ai/Prompt.ts +37 -37
  752. package/src/unstable/ai/Response.ts +25 -25
  753. package/src/unstable/ai/Tool.ts +19 -13
  754. package/src/unstable/ai/index.ts +1 -1
  755. package/src/unstable/cli/CliOutput.ts +75 -6
  756. package/src/unstable/cli/Command.ts +501 -60
  757. package/src/unstable/cli/GlobalFlag.ts +243 -0
  758. package/src/unstable/cli/HelpDoc.ts +80 -2
  759. package/src/unstable/cli/index.ts +5 -0
  760. package/src/unstable/cli/internal/command.ts +50 -34
  761. package/src/unstable/cli/internal/completions/CommandDescriptor.ts +7 -2
  762. package/src/unstable/cli/internal/help.ts +146 -0
  763. package/src/unstable/cli/internal/parser.ts +33 -54
  764. package/src/unstable/cluster/ClusterCron.ts +2 -2
  765. package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -4
  766. package/src/unstable/cluster/Entity.ts +11 -10
  767. package/src/unstable/cluster/EntityResource.ts +4 -4
  768. package/src/unstable/cluster/Envelope.ts +1 -1
  769. package/src/unstable/cluster/K8sHttpClient.ts +5 -5
  770. package/src/unstable/cluster/MessageStorage.ts +3 -5
  771. package/src/unstable/cluster/Runners.ts +6 -5
  772. package/src/unstable/cluster/Sharding.ts +12 -10
  773. package/src/unstable/cluster/ShardingConfig.ts +30 -31
  774. package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
  775. package/src/unstable/cluster/internal/entityManager.ts +9 -8
  776. package/src/unstable/cluster/internal/entityReaper.ts +2 -1
  777. package/src/unstable/cluster/internal/resourceRef.ts +2 -1
  778. package/src/unstable/encoding/Sse.ts +3 -5
  779. package/src/unstable/eventlog/EventLog.ts +2 -1
  780. package/src/unstable/http/Cookies.ts +3 -3
  781. package/src/unstable/http/Headers.ts +28 -13
  782. package/src/unstable/http/HttpBody.ts +42 -1
  783. package/src/unstable/http/HttpClient.ts +58 -23
  784. package/src/unstable/http/HttpClientRequest.ts +38 -13
  785. package/src/unstable/http/HttpEffect.ts +46 -68
  786. package/src/unstable/http/HttpMethod.ts +16 -4
  787. package/src/unstable/http/HttpMiddleware.ts +9 -24
  788. package/src/unstable/http/HttpServerError.ts +42 -45
  789. package/src/unstable/http/HttpServerRespondable.ts +6 -6
  790. package/src/unstable/http/HttpServerResponse.ts +4 -2
  791. package/src/unstable/http/Multipart.ts +2 -2
  792. package/src/unstable/http/UrlParams.ts +20 -5
  793. package/src/unstable/http/internal/preResponseHandler.ts +15 -0
  794. package/src/unstable/httpapi/HttpApi.ts +5 -5
  795. package/src/unstable/httpapi/HttpApiBuilder.ts +77 -21
  796. package/src/unstable/httpapi/HttpApiClient.ts +14 -6
  797. package/src/unstable/httpapi/HttpApiEndpoint.ts +67 -83
  798. package/src/unstable/httpapi/HttpApiError.ts +30 -9
  799. package/src/unstable/httpapi/HttpApiGroup.ts +6 -6
  800. package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -4
  801. package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
  802. package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
  803. package/src/unstable/httpapi/OpenApi.ts +41 -23
  804. package/src/unstable/observability/Otlp.ts +12 -12
  805. package/src/unstable/observability/OtlpExporter.ts +3 -3
  806. package/src/unstable/observability/OtlpLogger.ts +13 -9
  807. package/src/unstable/observability/OtlpMetrics.ts +4 -4
  808. package/src/unstable/observability/OtlpTracer.ts +4 -4
  809. package/src/unstable/persistence/KeyValueStore.ts +6 -6
  810. package/src/unstable/persistence/Persistable.ts +2 -2
  811. package/src/unstable/persistence/PersistedCache.ts +20 -9
  812. package/src/unstable/persistence/PersistedQueue.ts +25 -24
  813. package/src/unstable/persistence/Persistence.ts +3 -3
  814. package/src/unstable/persistence/RateLimiter.ts +4 -4
  815. package/src/unstable/process/ChildProcess.ts +6 -208
  816. package/src/unstable/process/ChildProcessSpawner.ts +75 -14
  817. package/src/unstable/reactivity/Atom.ts +27 -25
  818. package/src/unstable/reactivity/AtomHttpApi.ts +21 -20
  819. package/src/unstable/reactivity/AtomRegistry.ts +31 -7
  820. package/src/unstable/reactivity/AtomRpc.ts +3 -3
  821. package/src/unstable/reactivity/Hydration.ts +112 -0
  822. package/src/unstable/reactivity/index.ts +5 -0
  823. package/src/unstable/rpc/Rpc.ts +6 -6
  824. package/src/unstable/rpc/RpcClient.ts +12 -54
  825. package/src/unstable/rpc/RpcGroup.ts +4 -4
  826. package/src/unstable/rpc/RpcMiddleware.ts +3 -3
  827. package/src/unstable/rpc/RpcSchema.ts +17 -0
  828. package/src/unstable/rpc/RpcSerialization.ts +44 -9
  829. package/src/unstable/rpc/RpcServer.ts +21 -30
  830. package/src/unstable/rpc/Utils.ts +2 -1
  831. package/src/unstable/schema/VariantSchema.ts +6 -6
  832. package/src/unstable/socket/Socket.ts +16 -17
  833. package/src/unstable/sql/SqlClient.ts +1 -1
  834. package/src/unstable/sql/SqlError.ts +11 -9
  835. package/src/unstable/sql/SqlModel.ts +5 -5
  836. package/src/unstable/sql/SqlSchema.ts +41 -25
  837. package/src/unstable/sql/Statement.ts +0 -1
  838. package/src/unstable/workers/Worker.ts +2 -1
  839. package/src/unstable/workflow/DurableClock.ts +8 -8
  840. package/src/unstable/workflow/DurableDeferred.ts +2 -2
  841. package/src/unstable/workflow/Workflow.ts +1 -1
  842. package/src/unstable/workflow/WorkflowEngine.ts +181 -2
  843. package/dist/PartitionedSemaphore.d.ts +0 -52
  844. package/dist/PartitionedSemaphore.d.ts.map +0 -1
  845. package/dist/PartitionedSemaphore.js.map +0 -1
  846. package/dist/encoding/Base64.d.ts +0 -67
  847. package/dist/encoding/Base64.d.ts.map +0 -1
  848. package/dist/encoding/Base64.js +0 -146
  849. package/dist/encoding/Base64.js.map +0 -1
  850. package/dist/encoding/Base64Url.d.ts +0 -60
  851. package/dist/encoding/Base64Url.d.ts.map +0 -1
  852. package/dist/encoding/Base64Url.js +0 -89
  853. package/dist/encoding/Base64Url.js.map +0 -1
  854. package/dist/encoding/EncodingError.d.ts +0 -31
  855. package/dist/encoding/EncodingError.d.ts.map +0 -1
  856. package/dist/encoding/EncodingError.js +0 -22
  857. package/dist/encoding/EncodingError.js.map +0 -1
  858. package/dist/encoding/Hex.d.ts +0 -61
  859. package/dist/encoding/Hex.d.ts.map +0 -1
  860. package/dist/encoding/Hex.js +0 -115
  861. package/dist/encoding/Hex.js.map +0 -1
  862. package/dist/encoding/index.d.ts +0 -26
  863. package/dist/encoding/index.d.ts.map +0 -1
  864. package/dist/encoding/index.js +0 -27
  865. package/dist/encoding/index.js.map +0 -1
  866. package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
  867. package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
  868. package/dist/unstable/cli/internal/builtInFlags.js +0 -44
  869. package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
  870. package/src/PartitionedSemaphore.ts +0 -182
  871. package/src/encoding/Base64.ts +0 -366
  872. package/src/encoding/Base64Url.ts +0 -104
  873. package/src/encoding/EncodingError.ts +0 -35
  874. package/src/encoding/Hex.ts +0 -390
  875. package/src/encoding/index.ts +0 -31
  876. package/src/unstable/cli/internal/builtInFlags.ts +0 -78
package/src/Schema.ts CHANGED
@@ -2,8 +2,10 @@
2
2
  * @since 4.0.0
3
3
  */
4
4
 
5
+ /** @effect-diagnostics schemaStructWithTag:skip-file */
5
6
  import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec"
6
7
  import * as Arr from "./Array.ts"
8
+ import * as BigDecimal_ from "./BigDecimal.ts"
7
9
  import type * as Brand from "./Brand.ts"
8
10
  import * as Cause_ from "./Cause.ts"
9
11
  import type * as Combiner from "./Combiner.ts"
@@ -12,13 +14,15 @@ import * as DateTime from "./DateTime.ts"
12
14
  import type { Differ } from "./Differ.ts"
13
15
  import * as Duration_ from "./Duration.ts"
14
16
  import * as Effect from "./Effect.ts"
15
- import * as Base64 from "./encoding/Base64.ts"
17
+ import * as Encoding from "./Encoding.ts"
16
18
  import * as Equal from "./Equal.ts"
17
19
  import * as Equivalence from "./Equivalence.ts"
18
20
  import * as Exit_ from "./Exit.ts"
19
21
  import type { Formatter } from "./Formatter.ts"
20
22
  import { format, formatDate, formatPropertyKey } from "./Formatter.ts"
21
23
  import { identity } from "./Function.ts"
24
+ import * as HashMap_ from "./HashMap.ts"
25
+ import * as HashSet_ from "./HashSet.ts"
22
26
  import * as core from "./internal/core.ts"
23
27
  import * as InternalAnnotations from "./internal/schema/annotations.ts"
24
28
  import * as InternalArbitrary from "./internal/schema/arbitrary.ts"
@@ -149,6 +153,7 @@ export interface Bottom<
149
153
  * @throws {Error} The issue is contained in the error cause.
150
154
  */
151
155
  makeUnsafe(input: this["~type.make.in"], options?: MakeOptions): this["Type"]
156
+ makeOption(input: this["~type.make.in"], options?: MakeOptions): Option_.Option<this["Type"]>
152
157
  }
153
158
 
154
159
  /**
@@ -321,7 +326,7 @@ export declare namespace Schema {
321
326
  /**
322
327
  * @since 4.0.0
323
328
  */
324
- export type Type<S extends Top> = S["Type"]
329
+ export type Type<S> = S extends Top ? S["Type"] : never
325
330
  }
326
331
 
327
332
  /**
@@ -349,15 +354,15 @@ export declare namespace Codec {
349
354
  /**
350
355
  * @since 4.0.0
351
356
  */
352
- export type Encoded<S extends Top> = S["Encoded"]
357
+ export type Encoded<S> = S extends Top ? S["Encoded"] : never
353
358
  /**
354
359
  * @since 4.0.0
355
360
  */
356
- export type DecodingServices<S extends Top> = S["DecodingServices"]
361
+ export type DecodingServices<S> = S extends Top ? S["DecodingServices"] : never
357
362
  /**
358
363
  * @since 4.0.0
359
364
  */
360
- export type EncodingServices<S extends Top> = S["EncodingServices"]
365
+ export type EncodingServices<S> = S extends Top ? S["EncodingServices"] : never
361
366
  /**
362
367
  * @since 4.0.0
363
368
  */
@@ -1631,6 +1636,27 @@ export interface Struct<Fields extends Struct.Fields> extends
1631
1636
  >
1632
1637
  {
1633
1638
  readonly "~rebuild.out": this
1639
+ /**
1640
+ * The field definitions of this struct. Spread them into a new struct to
1641
+ * reuse fields across schemas.
1642
+ *
1643
+ * **Example** (Reusing fields across structs)
1644
+ *
1645
+ * ```ts
1646
+ * import { Schema } from "effect"
1647
+ *
1648
+ * const Timestamped = Schema.Struct({
1649
+ * createdAt: Schema.Date,
1650
+ * updatedAt: Schema.Date
1651
+ * })
1652
+ *
1653
+ * const User = Schema.Struct({
1654
+ * ...Timestamped.fields,
1655
+ * name: Schema.String,
1656
+ * email: Schema.String
1657
+ * })
1658
+ * ```
1659
+ */
1634
1660
  readonly fields: Fields
1635
1661
  /**
1636
1662
  * Returns a new struct with the fields modified by the provided function.
@@ -1713,7 +1739,7 @@ export function fieldsAssign<const NewFields extends Struct.Fields>(fields: NewF
1713
1739
  * @since 4.0.0
1714
1740
  */
1715
1741
  export function encodeKeys<
1716
- S extends Struct<Struct.Fields>,
1742
+ S extends Top & { readonly fields: Struct.Fields },
1717
1743
  const M extends { readonly [K in keyof S["fields"]]?: PropertyKey }
1718
1744
  >(mapping: M) {
1719
1745
  return function(
@@ -1731,11 +1757,12 @@ export function encodeKeys<
1731
1757
  const fields: any = {}
1732
1758
  const reverseMapping: any = {}
1733
1759
  for (const k in self.fields) {
1760
+ const encoded = toEncoded(self.fields[k])
1734
1761
  if (Object.hasOwn(mapping, k)) {
1735
- fields[mapping[k]!] = toEncoded(self.fields[k])
1762
+ fields[mapping[k]!] = encoded
1736
1763
  reverseMapping[mapping[k]!] = k
1737
1764
  } else {
1738
- fields[k] = self.fields[k]
1765
+ fields[k] = encoded
1739
1766
  }
1740
1767
  }
1741
1768
  return Struct(fields).pipe(decodeTo(
@@ -1801,11 +1828,6 @@ export declare namespace Record {
1801
1828
  readonly "Iso": PropertyKey
1802
1829
  }
1803
1830
 
1804
- /**
1805
- * @since 4.0.0
1806
- */
1807
- export type Record = Record$<Record.Key, Top>
1808
-
1809
1831
  /**
1810
1832
  * @since 4.0.0
1811
1833
  */
@@ -1864,14 +1886,14 @@ export declare namespace Record {
1864
1886
  /**
1865
1887
  * @since 4.0.0
1866
1888
  */
1867
- export interface Record$<Key extends Record.Key, Value extends Top> extends
1889
+ export interface $Record<Key extends Record.Key, Value extends Top> extends
1868
1890
  Bottom<
1869
1891
  Record.Type<Key, Value>,
1870
1892
  Record.Encoded<Key, Value>,
1871
1893
  Record.DecodingServices<Key, Value>,
1872
1894
  Record.EncodingServices<Key, Value>,
1873
1895
  AST.Objects,
1874
- Record$<Key, Value>,
1896
+ $Record<Key, Value>,
1875
1897
  Simplify<Record.MakeIn<Key, Value>>,
1876
1898
  Record.Iso<Key, Value>
1877
1899
  >
@@ -1893,7 +1915,7 @@ export function Record<Key extends Record.Key, Value extends Top>(
1893
1915
  readonly encode?: Combiner.Combiner<readonly [Key["Encoded"], Value["Encoded"]]> | undefined
1894
1916
  }
1895
1917
  }
1896
- ): Record$<Key, Value> {
1918
+ ): $Record<Key, Value> {
1897
1919
  const keyValueCombiner = options?.keyValueCombiner?.decode || options?.keyValueCombiner?.encode
1898
1920
  ? new AST.KeyValueCombiner(options.keyValueCombiner.decode, options.keyValueCombiner.encode)
1899
1921
  : undefined
@@ -1912,7 +1934,7 @@ export declare namespace StructWithRest {
1912
1934
  /**
1913
1935
  * @since 4.0.0
1914
1936
  */
1915
- export type Records = ReadonlyArray<Record.Record>
1937
+ export type Records = ReadonlyArray<$Record<Record.Key, Top>>
1916
1938
 
1917
1939
  type MergeTuple<T extends ReadonlyArray<unknown>> = T extends readonly [infer Head, ...infer Tail] ?
1918
1940
  Head & MergeTuple<Tail>
@@ -2244,14 +2266,14 @@ export function TupleWithRest<S extends Tuple<Tuple.Elements>, const Rest extend
2244
2266
  /**
2245
2267
  * @since 4.0.0
2246
2268
  */
2247
- export interface Array$<S extends Top> extends
2269
+ export interface $Array<S extends Top> extends
2248
2270
  Bottom<
2249
2271
  ReadonlyArray<S["Type"]>,
2250
2272
  ReadonlyArray<S["Encoded"]>,
2251
2273
  S["DecodingServices"],
2252
2274
  S["EncodingServices"],
2253
2275
  AST.Arrays,
2254
- Array$<S>,
2276
+ $Array<S>,
2255
2277
  ReadonlyArray<S["~type.make"]>,
2256
2278
  ReadonlyArray<S["Iso"]>
2257
2279
  >
@@ -2261,8 +2283,8 @@ export interface Array$<S extends Top> extends
2261
2283
  }
2262
2284
 
2263
2285
  interface ArrayLambda extends Lambda {
2264
- <S extends Top>(self: S): Array$<S>
2265
- readonly "~lambda.out": this["~lambda.in"] extends Top ? Array$<this["~lambda.in"]> : never
2286
+ <S extends Top>(self: S): $Array<S>
2287
+ readonly "~lambda.out": this["~lambda.in"] extends Top ? $Array<this["~lambda.in"]> : never
2266
2288
  }
2267
2289
 
2268
2290
  /**
@@ -2306,7 +2328,7 @@ export const NonEmptyArray = Struct_.lambda<NonEmptyArrayLambda>((schema) =>
2306
2328
  /**
2307
2329
  * @since 4.0.0
2308
2330
  */
2309
- export interface UniqueArray<S extends Top> extends Array$<S> {}
2331
+ export interface UniqueArray<S extends Top> extends $Array<S> {}
2310
2332
 
2311
2333
  /**
2312
2334
  * Returns a new array schema that ensures all elements are unique.
@@ -3309,12 +3331,12 @@ export interface TaggedUnion<Cases extends Record<string, Top>> extends
3309
3331
  readonly guards: { [K in keyof Cases]: (u: unknown) => u is Cases[K]["Type"] }
3310
3332
  readonly match: {
3311
3333
  <Output>(
3312
- value: Cases[keyof Cases]["Type"],
3313
3334
  cases: { [K in keyof Cases]: (value: Cases[K]["Type"]) => Output }
3314
- ): Output
3335
+ ): (value: Cases[keyof Cases]["Type"]) => Output
3315
3336
  <Output>(
3337
+ value: Cases[keyof Cases]["Type"],
3316
3338
  cases: { [K in keyof Cases]: (value: Cases[K]["Type"]) => Output }
3317
- ): (value: Cases[keyof Cases]["Type"]) => Output
3339
+ ): Output
3318
3340
  }
3319
3341
  }
3320
3342
 
@@ -4755,6 +4777,63 @@ export const isBetweenBigInt = makeIsBetween({
4755
4777
  })
4756
4778
  })
4757
4779
 
4780
+ /**
4781
+ * Validates that a BigDecimal is greater than the specified value (exclusive).
4782
+ *
4783
+ * @category BigDecimal checks
4784
+ * @since 4.0.0
4785
+ */
4786
+ export const isGreaterThanBigDecimal = makeIsGreaterThan({
4787
+ order: BigDecimal_.Order,
4788
+ formatter: (bd) => BigDecimal_.format(bd)
4789
+ })
4790
+
4791
+ /**
4792
+ * Validates that a BigDecimal is greater than or equal to the specified value
4793
+ * (inclusive).
4794
+ *
4795
+ * @category BigDecimal checks
4796
+ * @since 4.0.0
4797
+ */
4798
+ export const isGreaterThanOrEqualToBigDecimal = makeIsGreaterThanOrEqualTo({
4799
+ order: BigDecimal_.Order,
4800
+ formatter: (bd) => BigDecimal_.format(bd)
4801
+ })
4802
+
4803
+ /**
4804
+ * Validates that a BigDecimal is less than the specified value (exclusive).
4805
+ *
4806
+ * @category BigDecimal checks
4807
+ * @since 4.0.0
4808
+ */
4809
+ export const isLessThanBigDecimal = makeIsLessThan({
4810
+ order: BigDecimal_.Order,
4811
+ formatter: (bd) => BigDecimal_.format(bd)
4812
+ })
4813
+
4814
+ /**
4815
+ * Validates that a BigDecimal is less than or equal to the specified value
4816
+ * (inclusive).
4817
+ *
4818
+ * @category BigDecimal checks
4819
+ * @since 4.0.0
4820
+ */
4821
+ export const isLessThanOrEqualToBigDecimal = makeIsLessThanOrEqualTo({
4822
+ order: BigDecimal_.Order,
4823
+ formatter: (bd) => BigDecimal_.format(bd)
4824
+ })
4825
+
4826
+ /**
4827
+ * Validates that a BigDecimal is within a specified range.
4828
+ *
4829
+ * @category BigDecimal checks
4830
+ * @since 4.0.0
4831
+ */
4832
+ export const isBetweenBigDecimal = makeIsBetween({
4833
+ order: BigDecimal_.Order,
4834
+ formatter: (bd) => BigDecimal_.format(bd)
4835
+ })
4836
+
4758
4837
  /**
4759
4838
  * Validates that a value has at least the specified length. Works with strings
4760
4839
  * and arrays.
@@ -5363,6 +5442,63 @@ export function OptionFromNullOr<S extends Top>(schema: S): OptionFromNullOr<S>
5363
5442
  ))
5364
5443
  }
5365
5444
 
5445
+ /**
5446
+ * @since 4.0.0
5447
+ */
5448
+ export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<toType<S>>, UndefinedOr<S>> {}
5449
+
5450
+ /**
5451
+ * Decodes an undefined-or value `T` to a required `Option<T>` value.
5452
+ *
5453
+ * Decoding:
5454
+ * - `undefined` is decoded as `None`
5455
+ * - other values are decoded as `Some`
5456
+ *
5457
+ * Encoding:
5458
+ * - `None` is encoded as `undefined`
5459
+ * - `Some` is encoded as the value
5460
+ *
5461
+ * @category Option
5462
+ * @since 4.0.0
5463
+ */
5464
+ export function OptionFromUndefinedOr<S extends Top>(schema: S): OptionFromUndefinedOr<S> {
5465
+ return UndefinedOr(schema).pipe(decodeTo(
5466
+ Option(toType(schema)),
5467
+ Transformation.optionFromUndefinedOr()
5468
+ ))
5469
+ }
5470
+
5471
+ /**
5472
+ * @since 4.0.0
5473
+ */
5474
+ export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toType<S>>, NullishOr<S>> {}
5475
+
5476
+ /**
5477
+ * Decodes a nullish value `T` to a required `Option<T>` value.
5478
+ *
5479
+ * Decoding:
5480
+ * - `null` and `undefined` are decoded as `None`
5481
+ * - other values are decoded as `Some`
5482
+ *
5483
+ * Encoding:
5484
+ * - `None` is encoded as `null` or `undefined` depending on the provided `options.onNoneEncoding` (defaults to `undefined`)
5485
+ * - `Some` is encoded as the value
5486
+ *
5487
+ * @category Option
5488
+ * @since 4.0.0
5489
+ */
5490
+ export function OptionFromNullishOr<S extends Top>(
5491
+ schema: S,
5492
+ options?: {
5493
+ onNoneEncoding: null | undefined
5494
+ }
5495
+ ): OptionFromNullishOr<S> {
5496
+ return NullishOr(schema).pipe(decodeTo(
5497
+ Option(toType(schema)),
5498
+ Transformation.optionFromNullishOr(options)
5499
+ ))
5500
+ }
5501
+
5366
5502
  /**
5367
5503
  * @since 4.0.0
5368
5504
  */
@@ -5651,15 +5787,15 @@ export function RedactedFromValue<S extends Top>(value: S, options?: {
5651
5787
  }
5652
5788
 
5653
5789
  /**
5654
- * @category CauseFailure
5790
+ * @category CauseReason
5655
5791
  * @since 4.0.0
5656
5792
  */
5657
- export interface CauseFailure<E extends Top, D extends Top> extends
5793
+ export interface CauseReason<E extends Top, D extends Top> extends
5658
5794
  declareConstructor<
5659
5795
  Cause_.Reason<E["Type"]>,
5660
5796
  Cause_.Reason<E["Encoded"]>,
5661
5797
  readonly [E, D],
5662
- CauseFailureIso<E, D>
5798
+ CauseReasonIso<E, D>
5663
5799
  >
5664
5800
  {
5665
5801
  readonly error: E
@@ -5667,10 +5803,10 @@ export interface CauseFailure<E extends Top, D extends Top> extends
5667
5803
  }
5668
5804
 
5669
5805
  /**
5670
- * @category CauseFailure
5806
+ * @category CauseReason
5671
5807
  * @since 4.0.0
5672
5808
  */
5673
- export type CauseFailureIso<E extends Top, D extends Top> = {
5809
+ export type CauseReasonIso<E extends Top, D extends Top> = {
5674
5810
  readonly _tag: "Fail"
5675
5811
  readonly error: E["Iso"]
5676
5812
  } | {
@@ -5682,11 +5818,11 @@ export type CauseFailureIso<E extends Top, D extends Top> = {
5682
5818
  }
5683
5819
 
5684
5820
  /**
5685
- * @category CauseFailure
5821
+ * @category CauseReason
5686
5822
  * @since 4.0.0
5687
5823
  */
5688
- export function CauseFailure<E extends Top, D extends Top>(error: E, defect: D): CauseFailure<E, D> {
5689
- const schema = declareConstructor<Cause_.Reason<E["Type"]>, Cause_.Reason<E["Encoded"]>, CauseFailureIso<E, D>>()(
5824
+ export function CauseReason<E extends Top, D extends Top>(error: E, defect: D): CauseReason<E, D> {
5825
+ const schema = declareConstructor<Cause_.Reason<E["Type"]>, Cause_.Reason<E["Encoded"]>, CauseReasonIso<E, D>>()(
5690
5826
  [error, defect],
5691
5827
  ([error, defect]) => (input, ast, options) => {
5692
5828
  if (!Cause_.isReason(input)) {
@@ -5719,7 +5855,7 @@ export function CauseFailure<E extends Top, D extends Top>(error: E, defect: D):
5719
5855
  _tag: "effect/Cause/Failure"
5720
5856
  },
5721
5857
  generation: {
5722
- runtime: `Schema.CauseFailure(?, ?)`,
5858
+ runtime: `Schema.CauseReason(?, ?)`,
5723
5859
  Type: `Cause.Failure<?, ?>`,
5724
5860
  importDeclaration: `import * as Cause from "effect/Cause"`
5725
5861
  },
@@ -5745,15 +5881,15 @@ export function CauseFailure<E extends Top, D extends Top>(error: E, defect: D):
5745
5881
  encode: identity
5746
5882
  })
5747
5883
  ),
5748
- toArbitrary: ([error, defect]) => causeFailureToArbitrary(error, defect),
5749
- toEquivalence: ([error, defect]) => causeFailureToEquivalence(error, defect),
5750
- toFormatter: ([error, defect]) => causeFailureToFormatter(error, defect)
5884
+ toArbitrary: ([error, defect]) => causeReasonToArbitrary(error, defect),
5885
+ toEquivalence: ([error, defect]) => causeReasonToEquivalence(error, defect),
5886
+ toFormatter: ([error, defect]) => causeReasonToFormatter(error, defect)
5751
5887
  }
5752
5888
  )
5753
5889
  return make(schema.ast, { error, defect })
5754
5890
  }
5755
5891
 
5756
- function causeFailureToArbitrary<E, D>(error: FastCheck.Arbitrary<E>, defect: FastCheck.Arbitrary<D>) {
5892
+ function causeReasonToArbitrary<E, D>(error: FastCheck.Arbitrary<E>, defect: FastCheck.Arbitrary<D>) {
5757
5893
  return (fc: typeof FastCheck, ctx: Annotations.ToArbitrary.Context | undefined) => {
5758
5894
  return fc.oneof(
5759
5895
  ctx?.isSuspend ? { maxDepth: 2, depthIdentifier: "Cause.Failure" } : {},
@@ -5765,7 +5901,7 @@ function causeFailureToArbitrary<E, D>(error: FastCheck.Arbitrary<E>, defect: Fa
5765
5901
  }
5766
5902
  }
5767
5903
 
5768
- function causeFailureToEquivalence<E>(error: Equivalence.Equivalence<E>, defect: Equivalence.Equivalence<unknown>) {
5904
+ function causeReasonToEquivalence<E>(error: Equivalence.Equivalence<E>, defect: Equivalence.Equivalence<unknown>) {
5769
5905
  return (a: Cause_.Reason<E>, b: Cause_.Reason<E>) => {
5770
5906
  if (a._tag !== b._tag) return false
5771
5907
  switch (a._tag) {
@@ -5779,7 +5915,7 @@ function causeFailureToEquivalence<E>(error: Equivalence.Equivalence<E>, defect:
5779
5915
  }
5780
5916
  }
5781
5917
 
5782
- function causeFailureToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
5918
+ function causeReasonToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
5783
5919
  return (t: Cause_.Reason<E>) => {
5784
5920
  switch (t._tag) {
5785
5921
  case "Fail":
@@ -5812,7 +5948,7 @@ export interface Cause<E extends Top, D extends Top> extends
5812
5948
  * @category Cause
5813
5949
  * @since 4.0.0
5814
5950
  */
5815
- export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseFailureIso<E, D>>
5951
+ export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseReasonIso<E, D>>
5816
5952
 
5817
5953
  /**
5818
5954
  * @category Cause
@@ -5821,15 +5957,17 @@ export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseFailureI
5821
5957
  export function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<E, D> {
5822
5958
  const schema = declareConstructor<Cause_.Cause<E["Type"]>, Cause_.Cause<E["Encoded"]>, CauseIso<E, D>>()(
5823
5959
  [error, defect],
5824
- ([error, defect]) => (input, ast, options) => {
5825
- if (!Cause_.isCause(input)) {
5826
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
5960
+ ([error, defect]) => {
5961
+ const failures = Array(CauseReason(error, defect))
5962
+ return (input, ast, options) => {
5963
+ if (!Cause_.isCause(input)) {
5964
+ return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
5965
+ }
5966
+ return Effect.mapBothEager(Parser.decodeUnknownEffect(failures)(input.reasons, options), {
5967
+ onSuccess: Cause_.fromReasons,
5968
+ onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["failures"], issue)])
5969
+ })
5827
5970
  }
5828
- const failures = Array(CauseFailure(error, defect))
5829
- return Effect.mapBothEager(Parser.decodeUnknownEffect(failures)(input.reasons, options), {
5830
- onSuccess: Cause_.fromReasons,
5831
- onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["failures"], issue)])
5832
- })
5833
5971
  },
5834
5972
  {
5835
5973
  typeConstructor: {
@@ -5843,7 +5981,7 @@ export function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<
5843
5981
  expected: "Cause",
5844
5982
  toCodec: ([error, defect]) =>
5845
5983
  link<Cause_.Cause<E["Encoded"]>>()(
5846
- Array(CauseFailure(error, defect)),
5984
+ Array(CauseReason(error, defect)),
5847
5985
  Transformation.transform({
5848
5986
  decode: Cause_.fromReasons,
5849
5987
  encode: ({ reasons: failures }) => failures
@@ -5859,18 +5997,18 @@ export function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<
5859
5997
 
5860
5998
  function causeToArbitrary<E, D>(error: FastCheck.Arbitrary<E>, defect: FastCheck.Arbitrary<D>) {
5861
5999
  return (fc: typeof FastCheck, ctx: Annotations.ToArbitrary.Context | undefined) => {
5862
- return fc.array(causeFailureToArbitrary(error, defect)(fc, ctx)).map(Cause_.fromReasons)
6000
+ return fc.array(causeReasonToArbitrary(error, defect)(fc, ctx)).map(Cause_.fromReasons)
5863
6001
  }
5864
6002
  }
5865
6003
 
5866
6004
  function causeToEquivalence<E>(error: Equivalence.Equivalence<E>, defect: Equivalence.Equivalence<unknown>) {
5867
- const failures = Equivalence.Array(causeFailureToEquivalence(error, defect))
6005
+ const failures = Equivalence.Array(causeReasonToEquivalence(error, defect))
5868
6006
  return (a: Cause_.Cause<E>, b: Cause_.Cause<E>) => failures(a.reasons, b.reasons)
5869
6007
  }
5870
6008
 
5871
6009
  function causeToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
5872
- const causeFailure = causeFailureToFormatter(error, defect)
5873
- return (t: Cause_.Cause<E>) => `Cause([${t.reasons.map(causeFailure).join(", ")}])`
6010
+ const causeReason = causeReasonToFormatter(error, defect)
6011
+ return (t: Cause_.Cause<E>) => `Cause([${t.reasons.map(causeReason).join(", ")}])`
5874
6012
  }
5875
6013
 
5876
6014
  /**
@@ -6044,28 +6182,32 @@ export function Exit<A extends Top, E extends Top, D extends Top>(value: A, erro
6044
6182
  ExitIso<A, E, D>
6045
6183
  >()(
6046
6184
  [value, error, defect],
6047
- ([value, error, defect]) => (input, ast, options) => {
6048
- if (!Exit_.isExit(input)) {
6049
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6050
- }
6185
+ ([value, error, defect]) => {
6051
6186
  const cause = Cause(error, defect)
6052
- switch (input._tag) {
6053
- case "Success":
6054
- return Effect.mapBothEager(
6055
- Parser.decodeUnknownEffect(value)(input.value, options),
6056
- {
6057
- onSuccess: Exit_.succeed,
6058
- onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["value"], issue)])
6059
- }
6060
- )
6061
- case "Failure":
6062
- return Effect.mapBothEager(
6063
- Parser.decodeUnknownEffect(cause)(input.cause, options),
6064
- {
6065
- onSuccess: Exit_.failCause,
6066
- onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["cause"], issue)])
6067
- }
6068
- )
6187
+ return (input, ast, options) => {
6188
+ if (!Exit_.isExit(input)) {
6189
+ return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6190
+ }
6191
+ switch (input._tag) {
6192
+ case "Success":
6193
+ return Effect.mapBothEager(
6194
+ Parser.decodeUnknownEffect(value)(input.value, options),
6195
+ {
6196
+ onSuccess: Exit_.succeed,
6197
+ onFailure: (issue) =>
6198
+ new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["value"], issue)])
6199
+ }
6200
+ )
6201
+ case "Failure":
6202
+ return Effect.mapBothEager(
6203
+ Parser.decodeUnknownEffect(cause)(input.cause, options),
6204
+ {
6205
+ onSuccess: Exit_.failCause,
6206
+ onFailure: (issue) =>
6207
+ new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["cause"], issue)])
6208
+ }
6209
+ )
6210
+ }
6069
6211
  }
6070
6212
  },
6071
6213
  {
@@ -6131,7 +6273,7 @@ export function Exit<A extends Top, E extends Top, D extends Top>(value: A, erro
6131
6273
  * @category ReadonlyMap
6132
6274
  * @since 4.0.0
6133
6275
  */
6134
- export interface ReadonlyMap$<Key extends Top, Value extends Top> extends
6276
+ export interface $ReadonlyMap<Key extends Top, Value extends Top> extends
6135
6277
  declareConstructor<
6136
6278
  globalThis.ReadonlyMap<Key["Type"], Value["Type"]>,
6137
6279
  globalThis.ReadonlyMap<Key["Encoded"], Value["Encoded"]>,
@@ -6156,25 +6298,28 @@ export type ReadonlyMapIso<Key extends Top, Value extends Top> = ReadonlyArray<r
6156
6298
  * @category ReadonlyMap
6157
6299
  * @since 4.0.0
6158
6300
  */
6159
- export function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value: Value): ReadonlyMap$<Key, Value> {
6301
+ export function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value: Value): $ReadonlyMap<Key, Value> {
6160
6302
  const schema = declareConstructor<
6161
6303
  globalThis.ReadonlyMap<Key["Type"], Value["Type"]>,
6162
6304
  globalThis.ReadonlyMap<Key["Encoded"], Value["Encoded"]>,
6163
6305
  ReadonlyMapIso<Key, Value>
6164
6306
  >()(
6165
6307
  [key, value],
6166
- ([key, value]) => (input, ast, options) => {
6167
- if (input instanceof globalThis.Map) {
6168
- const array = Array(Tuple([key, value]))
6169
- return Effect.mapBothEager(
6170
- Parser.decodeUnknownEffect(array)([...input], options),
6171
- {
6172
- onSuccess: (array: ReadonlyArray<readonly [Key["Type"], Value["Type"]]>) => new globalThis.Map(array),
6173
- onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["entries"], issue)])
6174
- }
6175
- )
6308
+ ([key, value]) => {
6309
+ const array = Array(Tuple([key, value]))
6310
+ return (input, ast, options) => {
6311
+ if (input instanceof globalThis.Map) {
6312
+ return Effect.mapBothEager(
6313
+ Parser.decodeUnknownEffect(array)([...input], options),
6314
+ {
6315
+ onSuccess: (array: ReadonlyArray<readonly [Key["Type"], Value["Type"]]>) => new globalThis.Map(array),
6316
+ onFailure: (issue) =>
6317
+ new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["entries"], issue)])
6318
+ }
6319
+ )
6320
+ }
6321
+ return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6176
6322
  }
6177
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6178
6323
  },
6179
6324
  {
6180
6325
  typeConstructor: {
@@ -6214,11 +6359,102 @@ export function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value:
6214
6359
  return make(schema.ast, { key, value })
6215
6360
  }
6216
6361
 
6362
+ /**
6363
+ * @category HashMap
6364
+ * @since 4.0.0
6365
+ */
6366
+ export interface HashMap<Key extends Top, Value extends Top> extends
6367
+ declareConstructor<
6368
+ HashMap_.HashMap<Key["Type"], Value["Type"]>,
6369
+ HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>,
6370
+ readonly [Key, Value],
6371
+ HashMapIso<Key, Value>
6372
+ >
6373
+ {
6374
+ readonly key: Key
6375
+ readonly value: Value
6376
+ }
6377
+
6378
+ /**
6379
+ * @category HashMap
6380
+ * @since 4.0.0
6381
+ */
6382
+ export type HashMapIso<Key extends Top, Value extends Top> = ReadonlyArray<readonly [Key["Iso"], Value["Iso"]]>
6383
+
6384
+ /**
6385
+ * Creates a schema that validates a `HashMap` where keys and values must
6386
+ * conform to the provided schemas.
6387
+ *
6388
+ * @category HashMap
6389
+ * @since 4.0.0
6390
+ */
6391
+ export function HashMap<Key extends Top, Value extends Top>(key: Key, value: Value): HashMap<Key, Value> {
6392
+ const schema = declareConstructor<
6393
+ HashMap_.HashMap<Key["Type"], Value["Type"]>,
6394
+ HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>,
6395
+ HashMapIso<Key, Value>
6396
+ >()(
6397
+ [key, value],
6398
+ ([key, value]) => {
6399
+ const entries = Array(Tuple([key, value]))
6400
+ return (input, ast, options) => {
6401
+ if (HashMap_.isHashMap(input)) {
6402
+ return Effect.mapBothEager(
6403
+ Parser.decodeUnknownEffect(entries)(HashMap_.toEntries(input), options),
6404
+ {
6405
+ onSuccess: HashMap_.fromIterable,
6406
+ onFailure: (issue) =>
6407
+ new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["entries"], issue)])
6408
+ }
6409
+ )
6410
+ }
6411
+ return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6412
+ }
6413
+ },
6414
+ {
6415
+ typeConstructor: {
6416
+ _tag: "effect/HashMap"
6417
+ },
6418
+ generation: {
6419
+ runtime: `Schema.HashMap(?, ?)`,
6420
+ Type: `HashMap.HashMap<?, ?>`,
6421
+ importDeclaration: `import * as HashMap from "effect/HashMap"`
6422
+ },
6423
+ expected: "HashMap",
6424
+ toCodec: ([key, value]) =>
6425
+ link<HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>>()(
6426
+ Array(Tuple([key, value])),
6427
+ Transformation.transform({
6428
+ decode: HashMap_.fromIterable,
6429
+ encode: HashMap_.toEntries
6430
+ })
6431
+ ),
6432
+ toArbitrary: ([key, value]) => (fc, ctx) => {
6433
+ return fc.oneof(
6434
+ ctx?.isSuspend ? { maxDepth: 2, depthIdentifier: "HashMap" } : {},
6435
+ fc.constant([]),
6436
+ fc.array(fc.tuple(key, value), ctx?.constraints?.array)
6437
+ ).map(HashMap_.fromIterable)
6438
+ },
6439
+ toEquivalence: ([key, value]) => Equal.makeCompareMap(key, value),
6440
+ toFormatter: ([key, value]) => (t) => {
6441
+ const size = HashMap_.size(t)
6442
+ if (size === 0) {
6443
+ return "HashMap(0) {}"
6444
+ }
6445
+ const entries = HashMap_.toEntries(t).sort().map(([k, v]) => `${key(k)} => ${value(v)}`)
6446
+ return `HashMap(${size}) { ${entries.join(", ")} }`
6447
+ }
6448
+ }
6449
+ )
6450
+ return make(schema.ast, { key, value })
6451
+ }
6452
+
6217
6453
  /**
6218
6454
  * @category ReadonlySet
6219
6455
  * @since 4.0.0
6220
6456
  */
6221
- export interface ReadonlySet$<Value extends Top> extends
6457
+ export interface $ReadonlySet<Value extends Top> extends
6222
6458
  declareConstructor<
6223
6459
  globalThis.ReadonlySet<Value["Type"]>,
6224
6460
  globalThis.ReadonlySet<Value["Encoded"]>,
@@ -6239,25 +6475,28 @@ export type ReadonlySetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>
6239
6475
  * @category ReadonlySet
6240
6476
  * @since 4.0.0
6241
6477
  */
6242
- export function ReadonlySet<Value extends Top>(value: Value): ReadonlySet$<Value> {
6478
+ export function ReadonlySet<Value extends Top>(value: Value): $ReadonlySet<Value> {
6243
6479
  const schema = declareConstructor<
6244
6480
  globalThis.ReadonlySet<Value["Type"]>,
6245
6481
  globalThis.ReadonlySet<Value["Encoded"]>,
6246
6482
  ReadonlySetIso<Value>
6247
6483
  >()(
6248
6484
  [value],
6249
- ([value]) => (input, ast, options) => {
6250
- if (input instanceof globalThis.Set) {
6251
- const array = Array(value)
6252
- return Effect.mapBothEager(
6253
- Parser.decodeUnknownEffect(array)([...input], options),
6254
- {
6255
- onSuccess: (array: ReadonlyArray<Value["Type"]>) => new globalThis.Set(array),
6256
- onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
6257
- }
6258
- )
6485
+ ([value]) => {
6486
+ const array = Array(value)
6487
+ return (input, ast, options) => {
6488
+ if (input instanceof globalThis.Set) {
6489
+ return Effect.mapBothEager(
6490
+ Parser.decodeUnknownEffect(array)([...input], options),
6491
+ {
6492
+ onSuccess: (array: ReadonlyArray<Value["Type"]>) => new globalThis.Set(array),
6493
+ onFailure: (issue) =>
6494
+ new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
6495
+ }
6496
+ )
6497
+ }
6498
+ return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6259
6499
  }
6260
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6261
6500
  },
6262
6501
  {
6263
6502
  typeConstructor: {
@@ -6297,6 +6536,95 @@ export function ReadonlySet<Value extends Top>(value: Value): ReadonlySet$<Value
6297
6536
  return make(schema.ast, { value })
6298
6537
  }
6299
6538
 
6539
+ /**
6540
+ * @category HashSet
6541
+ * @since 4.0.0
6542
+ */
6543
+ export interface HashSet<Value extends Top> extends
6544
+ declareConstructor<
6545
+ HashSet_.HashSet<Value["Type"]>,
6546
+ HashSet_.HashSet<Value["Encoded"]>,
6547
+ readonly [Value],
6548
+ HashSetIso<Value>
6549
+ >
6550
+ {
6551
+ readonly value: Value
6552
+ }
6553
+
6554
+ /**
6555
+ * @category HashSet
6556
+ * @since 4.0.0
6557
+ */
6558
+ export type HashSetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>
6559
+
6560
+ /**
6561
+ * Creates a schema that validates a `HashSet` where values must conform to the
6562
+ * provided schema.
6563
+ *
6564
+ * @category HashSet
6565
+ * @since 4.0.0
6566
+ */
6567
+ export function HashSet<Value extends Top>(value: Value): HashSet<Value> {
6568
+ const schema = declareConstructor<
6569
+ HashSet_.HashSet<Value["Type"]>,
6570
+ HashSet_.HashSet<Value["Encoded"]>,
6571
+ HashSetIso<Value>
6572
+ >()(
6573
+ [value],
6574
+ ([value]) => {
6575
+ const values = Array(value)
6576
+ return (input, ast, options) => {
6577
+ if (HashSet_.isHashSet(input)) {
6578
+ return Effect.mapBothEager(
6579
+ Parser.decodeUnknownEffect(values)(Arr.fromIterable(input), options),
6580
+ {
6581
+ onSuccess: HashSet_.fromIterable,
6582
+ onFailure: (issue) =>
6583
+ new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
6584
+ }
6585
+ )
6586
+ }
6587
+ return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
6588
+ }
6589
+ },
6590
+ {
6591
+ typeConstructor: {
6592
+ _tag: "effect/HashSet"
6593
+ },
6594
+ generation: {
6595
+ runtime: `Schema.HashSet(?)`,
6596
+ Type: `HashSet.HashSet<?>`
6597
+ },
6598
+ expected: "HashSet",
6599
+ toCodec: ([value]) =>
6600
+ link<HashSet_.HashSet<Value["Encoded"]>>()(
6601
+ Array(value),
6602
+ Transformation.transform({
6603
+ decode: HashSet_.fromIterable,
6604
+ encode: Arr.fromIterable
6605
+ })
6606
+ ),
6607
+ toArbitrary: ([value]) => (fc, ctx) => {
6608
+ return fc.oneof(
6609
+ ctx?.isSuspend ? { maxDepth: 2, depthIdentifier: "HashSet" } : {},
6610
+ fc.constant([]),
6611
+ fc.array(value, ctx?.constraints?.array)
6612
+ ).map(HashSet_.fromIterable)
6613
+ },
6614
+ toEquivalence: ([value]) => Equal.makeCompareSet(value),
6615
+ toFormatter: ([value]) => (t) => {
6616
+ const size = HashSet_.size(t)
6617
+ if (size === 0) {
6618
+ return "HashSet(0) {}"
6619
+ }
6620
+ const values = globalThis.Array.from(t).sort().map((v) => `${value(v)}`)
6621
+ return `HashSet(${size}) { ${values.join(", ")} }`
6622
+ }
6623
+ }
6624
+ )
6625
+ return make(schema.ast, { value })
6626
+ }
6627
+
6300
6628
  /**
6301
6629
  * @since 4.0.0
6302
6630
  */
@@ -6588,6 +6916,45 @@ export const DurationFromMillis: DurationFromMillis = Number.check(isGreaterThan
6588
6916
  decodeTo(Duration, Transformation.durationFromMillis)
6589
6917
  )
6590
6918
 
6919
+ /**
6920
+ * @since 4.0.0
6921
+ */
6922
+ export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {}
6923
+
6924
+ /**
6925
+ * A schema for `BigDecimal` values.
6926
+ *
6927
+ * **Default JSON serializer**
6928
+ *
6929
+ * - encodes `BigDecimal` as a `string`
6930
+ *
6931
+ * @since 4.0.0
6932
+ */
6933
+ export const BigDecimal: BigDecimal = declare(
6934
+ BigDecimal_.isBigDecimal,
6935
+ {
6936
+ typeConstructor: {
6937
+ _tag: "effect/BigDecimal"
6938
+ },
6939
+ generation: {
6940
+ runtime: `Schema.BigDecimal`,
6941
+ Type: `BigDecimal.BigDecimal`,
6942
+ importDeclaration: `import * as BigDecimal from "effect/BigDecimal"`
6943
+ },
6944
+ expected: "BigDecimal",
6945
+ toCodecJson: () =>
6946
+ link<BigDecimal_.BigDecimal>()(
6947
+ String.annotate({ expected: "a string that will be decoded as a BigDecimal" }),
6948
+ Transformation.bigDecimalFromString
6949
+ ),
6950
+ toArbitrary: () => (fc) =>
6951
+ fc.tuple(fc.bigInt(), fc.integer({ min: 0, max: 20 }))
6952
+ .map(([value, scale]) => BigDecimal_.make(value, scale)),
6953
+ toFormatter: () => (bd) => BigDecimal_.format(bd),
6954
+ toEquivalence: () => BigDecimal_.Equivalence
6955
+ }
6956
+ )
6957
+
6591
6958
  /**
6592
6959
  * @since 4.0.0
6593
6960
  */
@@ -6720,7 +7087,7 @@ export const File: File = instanceOf(globalThis.File, {
6720
7087
  }),
6721
7088
  Transformation.transformOrFail({
6722
7089
  decode: (e) =>
6723
- Result_.match(Base64.decode(e.data), {
7090
+ Result_.match(Encoding.decodeBase64(e.data), {
6724
7091
  onFailure: (error) =>
6725
7092
  Effect.fail(
6726
7093
  new Issue.InvalidValue(Option_.some(e.data), {
@@ -6739,7 +7106,7 @@ export const File: File = instanceOf(globalThis.File, {
6739
7106
  try: async () => {
6740
7107
  const bytes = new globalThis.Uint8Array(await file.arrayBuffer())
6741
7108
  return {
6742
- data: Base64.encode(bytes),
7109
+ data: Encoding.encodeBase64(bytes),
6743
7110
  type: file.type,
6744
7111
  name: file.name,
6745
7112
  lastModified: file.lastModified
@@ -7273,7 +7640,7 @@ export const DateTimeUtc: DateTimeUtc = declare(
7273
7640
  (u) => DateTime.isDateTime(u) && DateTime.isUtc(u),
7274
7641
  {
7275
7642
  typeConstructor: {
7276
- _tag: "DateTime.Utc"
7643
+ _tag: "effect/DateTime.Utc"
7277
7644
  },
7278
7645
  generation: {
7279
7646
  runtime: `Schema.DateTimeUtc`,
@@ -7284,10 +7651,7 @@ export const DateTimeUtc: DateTimeUtc = declare(
7284
7651
  toCodecJson: () =>
7285
7652
  link<DateTime.Utc>()(
7286
7653
  String,
7287
- {
7288
- decode: Getter.dateTimeUtcFromInput(),
7289
- encode: Getter.transform(DateTime.formatIso)
7290
- }
7654
+ Transformation.dateTimeUtcFromString
7291
7655
  ),
7292
7656
  toArbitrary: () => (fc, ctx) =>
7293
7657
  fc.date({ noInvalidDate: true, ...ctx?.constraints?.date }).map((date) => DateTime.fromDateUnsafe(date)),
@@ -7344,10 +7708,7 @@ export const DateTimeUtcFromString: DateTimeUtcFromString = String.annotate({
7344
7708
  }).pipe(
7345
7709
  decodeTo(
7346
7710
  DateTimeUtc,
7347
- Transformation.transform({
7348
- decode: DateTime.makeUnsafe,
7349
- encode: DateTime.formatIso
7350
- })
7711
+ Transformation.dateTimeUtcFromString
7351
7712
  )
7352
7713
  )
7353
7714
 
@@ -7375,6 +7736,183 @@ export const DateTimeUtcFromMillis: DateTimeUtcFromMillis = Number.pipe(
7375
7736
  })
7376
7737
  )
7377
7738
 
7739
+ /**
7740
+ * @since 4.0.0
7741
+ */
7742
+ export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {}
7743
+
7744
+ /**
7745
+ * A schema for `DateTime.TimeZone.Offset` values.
7746
+ *
7747
+ * **Default JSON serializer**
7748
+ *
7749
+ * - encodes `DateTime.TimeZone.Offset` as a number (offset in milliseconds)
7750
+ *
7751
+ * @category DateTime
7752
+ * @since 4.0.0
7753
+ */
7754
+ export const TimeZoneOffset: TimeZoneOffset = declare(
7755
+ DateTime.isTimeZoneOffset,
7756
+ {
7757
+ typeConstructor: {
7758
+ _tag: "effect/DateTime.TimeZone.Offset"
7759
+ },
7760
+ generation: {
7761
+ runtime: `Schema.TimeZoneOffset`,
7762
+ Type: `DateTime.TimeZone.Offset`,
7763
+ importDeclaration: `import * as DateTime from "effect/DateTime"`
7764
+ },
7765
+ expected: "DateTime.TimeZone.Offset",
7766
+ toCodecJson: () =>
7767
+ link<DateTime.TimeZone.Offset>()(
7768
+ Number,
7769
+ Transformation.timeZoneOffsetFromNumber
7770
+ ),
7771
+ toArbitrary: () => (fc) =>
7772
+ fc.integer({ min: -12 * 60 * 60 * 1000, max: 14 * 60 * 60 * 1000 }).map((n) => DateTime.zoneMakeOffset(n)),
7773
+ toFormatter: () => (tz) => DateTime.zoneToString(tz),
7774
+ toEquivalence: () => (a, b) => a.offset === b.offset
7775
+ }
7776
+ )
7777
+
7778
+ /**
7779
+ * @since 4.0.0
7780
+ */
7781
+ export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {}
7782
+
7783
+ /**
7784
+ * A schema for `DateTime.TimeZone.Named` values.
7785
+ *
7786
+ * **Default JSON serializer**
7787
+ *
7788
+ * - encodes `DateTime.TimeZone.Named` as a string (IANA time zone identifier)
7789
+ *
7790
+ * @category DateTime
7791
+ * @since 4.0.0
7792
+ */
7793
+ export const TimeZoneNamed: TimeZoneNamed = declare(
7794
+ DateTime.isTimeZoneNamed,
7795
+ {
7796
+ typeConstructor: {
7797
+ _tag: "effect/DateTime.TimeZone.Named"
7798
+ },
7799
+ generation: {
7800
+ runtime: `Schema.TimeZoneNamed`,
7801
+ Type: `DateTime.TimeZone.Named`,
7802
+ importDeclaration: `import * as DateTime from "effect/DateTime"`
7803
+ },
7804
+ expected: "DateTime.TimeZone.Named",
7805
+ toCodecJson: () =>
7806
+ link<DateTime.TimeZone.Named>()(
7807
+ String.annotate({ expected: "an IANA time zone identifier" }),
7808
+ Transformation.timeZoneNamedFromString
7809
+ ),
7810
+ toArbitrary: () => (fc) =>
7811
+ fc.constantFrom(
7812
+ ...["UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney"].map(
7813
+ DateTime.zoneMakeNamedUnsafe
7814
+ )
7815
+ ),
7816
+ toFormatter: () => (tz) => DateTime.zoneToString(tz),
7817
+ toEquivalence: () => (a, b) => a.id === b.id
7818
+ }
7819
+ )
7820
+
7821
+ /**
7822
+ * @since 4.0.0
7823
+ */
7824
+ export interface TimeZone extends declare<DateTime.TimeZone> {}
7825
+
7826
+ /**
7827
+ * A schema for `DateTime.TimeZone` values.
7828
+ *
7829
+ * **Default JSON serializer**
7830
+ *
7831
+ * - encodes `DateTime.TimeZone` as a string (IANA identifier or offset like
7832
+ * `+03:00`)
7833
+ *
7834
+ * @category DateTime
7835
+ * @since 4.0.0
7836
+ */
7837
+ export const TimeZone: TimeZone = declare(
7838
+ DateTime.isTimeZone,
7839
+ {
7840
+ typeConstructor: {
7841
+ _tag: "effect/DateTime.TimeZone"
7842
+ },
7843
+ generation: {
7844
+ runtime: `Schema.TimeZone`,
7845
+ Type: `DateTime.TimeZone`,
7846
+ importDeclaration: `import * as DateTime from "effect/DateTime"`
7847
+ },
7848
+ expected: "DateTime.TimeZone",
7849
+ toCodecJson: () =>
7850
+ link<DateTime.TimeZone>()(
7851
+ String.annotate({ expected: "a time zone string (IANA identifier or offset like +03:00)" }),
7852
+ Transformation.timeZoneFromString
7853
+ ),
7854
+ toArbitrary: () => (fc) =>
7855
+ fc.oneof(
7856
+ fc.integer({ min: -12 * 60 * 60 * 1000, max: 14 * 60 * 60 * 1000 }).map((n) => DateTime.zoneMakeOffset(n)),
7857
+ fc.constantFrom(
7858
+ ...["UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney"].map(
7859
+ DateTime.zoneMakeNamedUnsafe
7860
+ )
7861
+ )
7862
+ ),
7863
+ toFormatter: () => (tz) => DateTime.zoneToString(tz),
7864
+ toEquivalence: () => (a, b) => DateTime.zoneToString(a) === DateTime.zoneToString(b)
7865
+ }
7866
+ )
7867
+
7868
+ /**
7869
+ * @since 4.0.0
7870
+ */
7871
+ export interface DateTimeZoned extends declare<DateTime.Zoned> {}
7872
+
7873
+ /**
7874
+ * A schema for `DateTime.Zoned` values.
7875
+ *
7876
+ * **Default JSON serializer**
7877
+ *
7878
+ * - encodes `DateTime.Zoned` as a string in the format
7879
+ * `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`
7880
+ *
7881
+ * @category DateTime
7882
+ * @since 4.0.0
7883
+ */
7884
+ export const DateTimeZoned: DateTimeZoned = declare(
7885
+ (u) => DateTime.isDateTime(u) && DateTime.isZoned(u),
7886
+ {
7887
+ typeConstructor: {
7888
+ _tag: "effect/DateTime.Zoned"
7889
+ },
7890
+ generation: {
7891
+ runtime: `Schema.DateTimeZoned`,
7892
+ Type: `DateTime.Zoned`,
7893
+ importDeclaration: `import * as DateTime from "effect/DateTime"`
7894
+ },
7895
+ expected: "DateTime.Zoned",
7896
+ toCodecJson: () =>
7897
+ link<DateTime.Zoned>()(
7898
+ String.annotate({ expected: "a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])" }),
7899
+ Transformation.dateTimeZonedFromString
7900
+ ),
7901
+ toArbitrary: () => (fc, ctx) =>
7902
+ fc.tuple(
7903
+ fc.date({
7904
+ noInvalidDate: true,
7905
+ min: new globalThis.Date(-8640000000000000 + 14 * 60 * 60 * 1000),
7906
+ max: new globalThis.Date(8640000000000000 - 14 * 60 * 60 * 1000),
7907
+ ...ctx?.constraints?.date
7908
+ }),
7909
+ fc.constantFrom("UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney")
7910
+ ).map(([date, zone]) => DateTime.makeZonedUnsafe(date, { timeZone: zone })),
7911
+ toFormatter: () => (zoned) => DateTime.formatIsoZoned(zoned),
7912
+ toEquivalence: () => DateTime.Equivalence
7913
+ }
7914
+ )
7915
+
7378
7916
  // -----------------------------------------------------------------------------
7379
7917
  // Class
7380
7918
  // -----------------------------------------------------------------------------
@@ -7402,7 +7940,10 @@ export interface Class<Self, S extends Top & { readonly fields: Struct.Fields },
7402
7940
  >
7403
7941
  {
7404
7942
  // intentionally left without `readonly "~rebuild.out": this`
7405
- new(props: S["~type.make.in"], options?: MakeOptions): S["Type"] & Inherited
7943
+ new(
7944
+ ...args: {} extends S["~type.make.in"] ? [props?: S["~type.make.in"], options?: MakeOptions]
7945
+ : [props: S["~type.make.in"], options?: MakeOptions]
7946
+ ): S["Type"] & Inherited
7406
7947
  readonly identifier: string
7407
7948
  readonly fields: S["fields"]
7408
7949
  /**
@@ -7463,11 +8004,12 @@ function makeClass<
7463
8004
 
7464
8005
  return class extends Inherited {
7465
8006
  constructor(...[input, options]: ReadonlyArray<any>) {
8007
+ const props = input ?? {}
7466
8008
  if (options?.disableValidation) {
7467
- super(input, options)
8009
+ super(props, options)
7468
8010
  } else {
7469
- const validated = struct.makeUnsafe(input, options)
7470
- super({ ...input, ...validated }, { ...options, disableValidation: true })
8011
+ const validated = struct.makeUnsafe(props, options)
8012
+ super({ ...props, ...validated }, { ...options, disableValidation: true })
7471
8013
  }
7472
8014
  }
7473
8015
 
@@ -7516,6 +8058,9 @@ function makeClass<
7516
8058
  static makeUnsafe(input: S["~type.make.in"], options?: MakeOptions): Self {
7517
8059
  return new this(input, options)
7518
8060
  }
8061
+ static makeOption(input: S["~type.make.in"], options?: MakeOptions): Option_.Option<Self> {
8062
+ return Parser.makeOption(getClassSchema(this) as any)(input, options) as any
8063
+ }
7519
8064
  static annotate(annotations: Annotations.Declaration<Self, readonly [S]>) {
7520
8065
  return this.rebuild(AST.annotate(this.ast, annotations))
7521
8066
  }