effect 4.0.0-beta.73 → 4.0.0-beta.75

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 (930) hide show
  1. package/dist/Array.d.ts +745 -627
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +277 -217
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +37 -30
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +19 -16
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +34 -40
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +16 -16
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +10 -10
  14. package/dist/Boolean.js +6 -6
  15. package/dist/Brand.d.ts +13 -11
  16. package/dist/Brand.d.ts.map +1 -1
  17. package/dist/Brand.js +10 -8
  18. package/dist/Brand.js.map +1 -1
  19. package/dist/Cause.d.ts +21 -23
  20. package/dist/Cause.d.ts.map +1 -1
  21. package/dist/Cause.js +21 -23
  22. package/dist/Cause.js.map +1 -1
  23. package/dist/Channel.d.ts +282 -72
  24. package/dist/Channel.d.ts.map +1 -1
  25. package/dist/Channel.js +108 -28
  26. package/dist/Channel.js.map +1 -1
  27. package/dist/ChannelSchema.d.ts +11 -11
  28. package/dist/ChannelSchema.js +5 -5
  29. package/dist/Chunk.d.ts +86 -33
  30. package/dist/Chunk.d.ts.map +1 -1
  31. package/dist/Chunk.js +48 -13
  32. package/dist/Chunk.js.map +1 -1
  33. package/dist/Clock.d.ts +3 -3
  34. package/dist/Clock.js +3 -3
  35. package/dist/Combiner.d.ts +9 -13
  36. package/dist/Combiner.d.ts.map +1 -1
  37. package/dist/Combiner.js +9 -13
  38. package/dist/Combiner.js.map +1 -1
  39. package/dist/Config.d.ts +49 -56
  40. package/dist/Config.d.ts.map +1 -1
  41. package/dist/Config.js +40 -43
  42. package/dist/Config.js.map +1 -1
  43. package/dist/ConfigProvider.d.ts +34 -44
  44. package/dist/ConfigProvider.d.ts.map +1 -1
  45. package/dist/ConfigProvider.js +24 -32
  46. package/dist/ConfigProvider.js.map +1 -1
  47. package/dist/Console.d.ts +2 -2
  48. package/dist/Console.js +2 -2
  49. package/dist/Context.d.ts +63 -75
  50. package/dist/Context.d.ts.map +1 -1
  51. package/dist/Context.js +29 -33
  52. package/dist/Context.js.map +1 -1
  53. package/dist/Cron.d.ts +6 -6
  54. package/dist/Cron.js +6 -6
  55. package/dist/Crypto.d.ts +4 -4
  56. package/dist/Crypto.js +4 -4
  57. package/dist/Data.d.ts +21 -15
  58. package/dist/Data.d.ts.map +1 -1
  59. package/dist/Data.js +7 -7
  60. package/dist/Data.js.map +1 -1
  61. package/dist/DateTime.d.ts +35 -16
  62. package/dist/DateTime.d.ts.map +1 -1
  63. package/dist/DateTime.js +35 -8
  64. package/dist/DateTime.js.map +1 -1
  65. package/dist/Deferred.d.ts +61 -52
  66. package/dist/Deferred.d.ts.map +1 -1
  67. package/dist/Deferred.js +21 -18
  68. package/dist/Deferred.js.map +1 -1
  69. package/dist/Duration.d.ts +50 -37
  70. package/dist/Duration.d.ts.map +1 -1
  71. package/dist/Duration.js +24 -13
  72. package/dist/Duration.js.map +1 -1
  73. package/dist/Effect.d.ts +574 -474
  74. package/dist/Effect.d.ts.map +1 -1
  75. package/dist/Effect.js +273 -213
  76. package/dist/Effect.js.map +1 -1
  77. package/dist/Encoding.d.ts +5 -0
  78. package/dist/Encoding.d.ts.map +1 -1
  79. package/dist/Encoding.js +5 -0
  80. package/dist/Encoding.js.map +1 -1
  81. package/dist/Equal.d.ts +28 -41
  82. package/dist/Equal.d.ts.map +1 -1
  83. package/dist/Equal.js +12 -19
  84. package/dist/Equal.js.map +1 -1
  85. package/dist/Equivalence.d.ts +72 -100
  86. package/dist/Equivalence.d.ts.map +1 -1
  87. package/dist/Equivalence.js +54 -74
  88. package/dist/Equivalence.js.map +1 -1
  89. package/dist/ErrorReporter.d.ts +1 -1
  90. package/dist/ErrorReporter.js +1 -1
  91. package/dist/ExecutionPlan.d.ts +2 -2
  92. package/dist/ExecutionPlan.js +1 -1
  93. package/dist/Exit.d.ts +79 -96
  94. package/dist/Exit.d.ts.map +1 -1
  95. package/dist/Exit.js +57 -64
  96. package/dist/Exit.js.map +1 -1
  97. package/dist/Fiber.d.ts +8 -6
  98. package/dist/Fiber.d.ts.map +1 -1
  99. package/dist/Fiber.js +8 -6
  100. package/dist/Fiber.js.map +1 -1
  101. package/dist/FiberHandle.d.ts +25 -0
  102. package/dist/FiberHandle.d.ts.map +1 -1
  103. package/dist/FiberHandle.js +15 -0
  104. package/dist/FiberHandle.js.map +1 -1
  105. package/dist/FiberMap.d.ts +35 -0
  106. package/dist/FiberMap.d.ts.map +1 -1
  107. package/dist/FiberMap.js +15 -0
  108. package/dist/FiberMap.js.map +1 -1
  109. package/dist/FiberSet.d.ts +20 -0
  110. package/dist/FiberSet.d.ts.map +1 -1
  111. package/dist/FiberSet.js +10 -0
  112. package/dist/FiberSet.js.map +1 -1
  113. package/dist/FileSystem.d.ts +6 -6
  114. package/dist/FileSystem.js +2 -2
  115. package/dist/Filter.d.ts +4 -4
  116. package/dist/Filter.js +4 -4
  117. package/dist/Formatter.d.ts +14 -19
  118. package/dist/Formatter.d.ts.map +1 -1
  119. package/dist/Formatter.js +14 -19
  120. package/dist/Formatter.js.map +1 -1
  121. package/dist/Function.d.ts +20 -21
  122. package/dist/Function.d.ts.map +1 -1
  123. package/dist/Function.js +14 -15
  124. package/dist/Function.js.map +1 -1
  125. package/dist/Graph.d.ts +13 -13
  126. package/dist/Graph.js +7 -7
  127. package/dist/HKT.d.ts +3 -3
  128. package/dist/Hash.d.ts +2 -1
  129. package/dist/Hash.d.ts.map +1 -1
  130. package/dist/Hash.js +2 -1
  131. package/dist/Hash.js.map +1 -1
  132. package/dist/HashMap.d.ts +18 -3
  133. package/dist/HashMap.d.ts.map +1 -1
  134. package/dist/HashMap.js +5 -0
  135. package/dist/HashMap.js.map +1 -1
  136. package/dist/HashRing.d.ts +9 -9
  137. package/dist/HashRing.js +3 -3
  138. package/dist/HashSet.d.ts +1 -1
  139. package/dist/Iterable.d.ts +39 -27
  140. package/dist/Iterable.d.ts.map +1 -1
  141. package/dist/Iterable.js +21 -11
  142. package/dist/Iterable.js.map +1 -1
  143. package/dist/JsonPatch.d.ts +2 -3
  144. package/dist/JsonPatch.d.ts.map +1 -1
  145. package/dist/JsonPatch.js +2 -3
  146. package/dist/JsonPatch.js.map +1 -1
  147. package/dist/JsonPointer.d.ts +2 -6
  148. package/dist/JsonPointer.d.ts.map +1 -1
  149. package/dist/JsonPointer.js +2 -6
  150. package/dist/JsonPointer.js.map +1 -1
  151. package/dist/JsonSchema.d.ts +17 -13
  152. package/dist/JsonSchema.d.ts.map +1 -1
  153. package/dist/JsonSchema.js +17 -13
  154. package/dist/JsonSchema.js.map +1 -1
  155. package/dist/Latch.d.ts +4 -3
  156. package/dist/Latch.d.ts.map +1 -1
  157. package/dist/Latch.js +4 -3
  158. package/dist/Latch.js.map +1 -1
  159. package/dist/Layer.d.ts +108 -130
  160. package/dist/Layer.d.ts.map +1 -1
  161. package/dist/Layer.js +43 -51
  162. package/dist/Layer.js.map +1 -1
  163. package/dist/Logger.d.ts +16 -19
  164. package/dist/Logger.d.ts.map +1 -1
  165. package/dist/Logger.js +15 -18
  166. package/dist/Logger.js.map +1 -1
  167. package/dist/ManagedRuntime.d.ts +2 -2
  168. package/dist/Match.d.ts +22 -22
  169. package/dist/Match.js +18 -18
  170. package/dist/Metric.d.ts +105 -125
  171. package/dist/Metric.d.ts.map +1 -1
  172. package/dist/Metric.js +54 -64
  173. package/dist/Metric.js.map +1 -1
  174. package/dist/MutableHashMap.d.ts +21 -12
  175. package/dist/MutableHashMap.d.ts.map +1 -1
  176. package/dist/MutableHashMap.js +7 -4
  177. package/dist/MutableHashMap.js.map +1 -1
  178. package/dist/MutableList.d.ts +15 -0
  179. package/dist/MutableList.d.ts.map +1 -1
  180. package/dist/MutableList.js +15 -0
  181. package/dist/MutableList.js.map +1 -1
  182. package/dist/MutableRef.d.ts +56 -42
  183. package/dist/MutableRef.d.ts.map +1 -1
  184. package/dist/MutableRef.js +28 -22
  185. package/dist/MutableRef.js.map +1 -1
  186. package/dist/Newtype.d.ts +10 -7
  187. package/dist/Newtype.d.ts.map +1 -1
  188. package/dist/Newtype.js +10 -7
  189. package/dist/Newtype.js.map +1 -1
  190. package/dist/Number.d.ts +23 -11
  191. package/dist/Number.d.ts.map +1 -1
  192. package/dist/Number.js +9 -5
  193. package/dist/Number.js.map +1 -1
  194. package/dist/Optic.d.ts +16 -16
  195. package/dist/Optic.d.ts.map +1 -1
  196. package/dist/Optic.js +10 -9
  197. package/dist/Optic.js.map +1 -1
  198. package/dist/Option.d.ts +232 -204
  199. package/dist/Option.d.ts.map +1 -1
  200. package/dist/Option.js +113 -96
  201. package/dist/Option.js.map +1 -1
  202. package/dist/Order.d.ts +119 -180
  203. package/dist/Order.d.ts.map +1 -1
  204. package/dist/Order.js +93 -145
  205. package/dist/Order.js.map +1 -1
  206. package/dist/PartitionedSemaphore.d.ts +14 -14
  207. package/dist/PartitionedSemaphore.js +6 -6
  208. package/dist/Path.d.ts +3 -3
  209. package/dist/Path.js +3 -3
  210. package/dist/Pipeable.d.ts +3 -3
  211. package/dist/Pipeable.js +3 -3
  212. package/dist/PlatformError.d.ts +4 -4
  213. package/dist/PlatformError.js +4 -4
  214. package/dist/Pool.d.ts +7 -11
  215. package/dist/Pool.d.ts.map +1 -1
  216. package/dist/Pool.js +3 -5
  217. package/dist/Pool.js.map +1 -1
  218. package/dist/Predicate.d.ts +279 -268
  219. package/dist/Predicate.d.ts.map +1 -1
  220. package/dist/Predicate.js +128 -123
  221. package/dist/Predicate.js.map +1 -1
  222. package/dist/PubSub.d.ts +33 -23
  223. package/dist/PubSub.d.ts.map +1 -1
  224. package/dist/PubSub.js +21 -11
  225. package/dist/PubSub.js.map +1 -1
  226. package/dist/Pull.d.ts +4 -4
  227. package/dist/Pull.js +4 -4
  228. package/dist/Queue.d.ts +70 -31
  229. package/dist/Queue.d.ts.map +1 -1
  230. package/dist/Queue.js +66 -27
  231. package/dist/Queue.js.map +1 -1
  232. package/dist/RcRef.d.ts +0 -4
  233. package/dist/RcRef.d.ts.map +1 -1
  234. package/dist/RcRef.js.map +1 -1
  235. package/dist/Record.d.ts +15 -15
  236. package/dist/Record.js +5 -5
  237. package/dist/Redactable.d.ts +2 -2
  238. package/dist/Redactable.js +2 -2
  239. package/dist/Redacted.d.ts +5 -5
  240. package/dist/Redacted.js +4 -4
  241. package/dist/Reducer.d.ts +2 -3
  242. package/dist/Reducer.d.ts.map +1 -1
  243. package/dist/Reducer.js +2 -3
  244. package/dist/Reducer.js.map +1 -1
  245. package/dist/Ref.d.ts +23 -22
  246. package/dist/Ref.d.ts.map +1 -1
  247. package/dist/Ref.js +21 -20
  248. package/dist/Ref.js.map +1 -1
  249. package/dist/References.d.ts +4 -4
  250. package/dist/References.js +4 -4
  251. package/dist/RegExp.d.ts +1 -1
  252. package/dist/RegExp.js +1 -1
  253. package/dist/Request.d.ts +22 -22
  254. package/dist/Request.js +6 -6
  255. package/dist/RequestResolver.d.ts +6 -6
  256. package/dist/RequestResolver.js +2 -2
  257. package/dist/Resource.d.ts +3 -3
  258. package/dist/Resource.js +3 -3
  259. package/dist/Result.d.ts +95 -51
  260. package/dist/Result.d.ts.map +1 -1
  261. package/dist/Result.js +53 -30
  262. package/dist/Result.js.map +1 -1
  263. package/dist/Runtime.d.ts +11 -8
  264. package/dist/Runtime.d.ts.map +1 -1
  265. package/dist/Runtime.js +11 -8
  266. package/dist/Runtime.js.map +1 -1
  267. package/dist/Schedule.d.ts +151 -89
  268. package/dist/Schedule.d.ts.map +1 -1
  269. package/dist/Schedule.js +59 -47
  270. package/dist/Schedule.js.map +1 -1
  271. package/dist/Scheduler.d.ts +6 -4
  272. package/dist/Scheduler.d.ts.map +1 -1
  273. package/dist/Scheduler.js +6 -4
  274. package/dist/Scheduler.js.map +1 -1
  275. package/dist/Schema.d.ts +620 -830
  276. package/dist/Schema.d.ts.map +1 -1
  277. package/dist/Schema.js +543 -452
  278. package/dist/Schema.js.map +1 -1
  279. package/dist/SchemaAST.d.ts +43 -22
  280. package/dist/SchemaAST.d.ts.map +1 -1
  281. package/dist/SchemaAST.js +80 -59
  282. package/dist/SchemaAST.js.map +1 -1
  283. package/dist/SchemaGetter.d.ts +139 -119
  284. package/dist/SchemaGetter.d.ts.map +1 -1
  285. package/dist/SchemaGetter.js +133 -113
  286. package/dist/SchemaGetter.js.map +1 -1
  287. package/dist/SchemaIssue.d.ts +37 -39
  288. package/dist/SchemaIssue.d.ts.map +1 -1
  289. package/dist/SchemaIssue.js +16 -17
  290. package/dist/SchemaIssue.js.map +1 -1
  291. package/dist/SchemaParser.d.ts +75 -156
  292. package/dist/SchemaParser.d.ts.map +1 -1
  293. package/dist/SchemaParser.js +75 -148
  294. package/dist/SchemaParser.js.map +1 -1
  295. package/dist/SchemaRepresentation.d.ts +30 -21
  296. package/dist/SchemaRepresentation.d.ts.map +1 -1
  297. package/dist/SchemaRepresentation.js +26 -22
  298. package/dist/SchemaRepresentation.js.map +1 -1
  299. package/dist/SchemaTransformation.d.ts +169 -145
  300. package/dist/SchemaTransformation.d.ts.map +1 -1
  301. package/dist/SchemaTransformation.js +183 -159
  302. package/dist/SchemaTransformation.js.map +1 -1
  303. package/dist/SchemaUtils.js +2 -2
  304. package/dist/SchemaUtils.js.map +1 -1
  305. package/dist/Scope.d.ts +16 -1
  306. package/dist/Scope.d.ts.map +1 -1
  307. package/dist/Scope.js +16 -1
  308. package/dist/Scope.js.map +1 -1
  309. package/dist/ScopedCache.d.ts +1 -1
  310. package/dist/ScopedCache.js +1 -1
  311. package/dist/ScopedRef.d.ts +14 -18
  312. package/dist/ScopedRef.d.ts.map +1 -1
  313. package/dist/ScopedRef.js +6 -8
  314. package/dist/ScopedRef.js.map +1 -1
  315. package/dist/Semaphore.d.ts +9 -9
  316. package/dist/Semaphore.js +3 -3
  317. package/dist/Sink.d.ts +18 -18
  318. package/dist/Sink.d.ts.map +1 -1
  319. package/dist/Sink.js +12 -12
  320. package/dist/Sink.js.map +1 -1
  321. package/dist/Stdio.d.ts +4 -5
  322. package/dist/Stdio.d.ts.map +1 -1
  323. package/dist/Stdio.js +4 -5
  324. package/dist/Stdio.js.map +1 -1
  325. package/dist/Stream.d.ts +376 -99
  326. package/dist/Stream.d.ts.map +1 -1
  327. package/dist/Stream.js +158 -43
  328. package/dist/Stream.js.map +1 -1
  329. package/dist/String.d.ts +11 -14
  330. package/dist/String.d.ts.map +1 -1
  331. package/dist/String.js +5 -6
  332. package/dist/String.js.map +1 -1
  333. package/dist/Struct.d.ts +23 -21
  334. package/dist/Struct.d.ts.map +1 -1
  335. package/dist/Struct.js +14 -12
  336. package/dist/Struct.js.map +1 -1
  337. package/dist/SubscriptionRef.d.ts +24 -19
  338. package/dist/SubscriptionRef.d.ts.map +1 -1
  339. package/dist/SubscriptionRef.js +12 -7
  340. package/dist/SubscriptionRef.js.map +1 -1
  341. package/dist/SynchronizedRef.d.ts +145 -120
  342. package/dist/SynchronizedRef.d.ts.map +1 -1
  343. package/dist/SynchronizedRef.js +51 -42
  344. package/dist/SynchronizedRef.js.map +1 -1
  345. package/dist/Terminal.d.ts +1 -1
  346. package/dist/Terminal.js +1 -1
  347. package/dist/Tracer.d.ts +9 -9
  348. package/dist/Tracer.js +6 -6
  349. package/dist/Trie.d.ts +15 -0
  350. package/dist/Trie.d.ts.map +1 -1
  351. package/dist/Trie.js +5 -0
  352. package/dist/Trie.js.map +1 -1
  353. package/dist/Tuple.d.ts +39 -33
  354. package/dist/Tuple.d.ts.map +1 -1
  355. package/dist/Tuple.js +23 -19
  356. package/dist/Tuple.js.map +1 -1
  357. package/dist/TxHashMap.d.ts +3 -3
  358. package/dist/TxHashSet.d.ts +1 -1
  359. package/dist/TxReentrantLock.d.ts +6 -3
  360. package/dist/TxReentrantLock.d.ts.map +1 -1
  361. package/dist/TxReentrantLock.js +2 -1
  362. package/dist/TxReentrantLock.js.map +1 -1
  363. package/dist/TxRef.d.ts +16 -16
  364. package/dist/TxRef.js +8 -8
  365. package/dist/TxSubscriptionRef.d.ts +43 -27
  366. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  367. package/dist/TxSubscriptionRef.js +19 -13
  368. package/dist/TxSubscriptionRef.js.map +1 -1
  369. package/dist/Types.d.ts +12 -38
  370. package/dist/Types.d.ts.map +1 -1
  371. package/dist/Types.js +0 -2
  372. package/dist/UndefinedOr.d.ts +15 -14
  373. package/dist/UndefinedOr.d.ts.map +1 -1
  374. package/dist/UndefinedOr.js +11 -10
  375. package/dist/UndefinedOr.js.map +1 -1
  376. package/dist/Unify.d.ts +9 -9
  377. package/dist/Unify.js +1 -1
  378. package/dist/internal/schema/annotations.js.map +1 -1
  379. package/dist/internal/schema/arbitrary.js +9 -9
  380. package/dist/internal/schema/arbitrary.js.map +1 -1
  381. package/dist/internal/schema/equivalence.js +9 -9
  382. package/dist/internal/schema/equivalence.js.map +1 -1
  383. package/dist/internal/schema/representation.js +14 -14
  384. package/dist/internal/schema/representation.js.map +1 -1
  385. package/dist/internal/schema/schema.js +11 -11
  386. package/dist/internal/schema/schema.js.map +1 -1
  387. package/dist/testing/TestClock.d.ts +5 -5
  388. package/dist/testing/TestClock.js +4 -4
  389. package/dist/testing/TestConsole.d.ts +3 -3
  390. package/dist/testing/TestConsole.js +3 -3
  391. package/dist/testing/TestSchema.d.ts +10 -10
  392. package/dist/testing/TestSchema.d.ts.map +1 -1
  393. package/dist/testing/TestSchema.js +9 -9
  394. package/dist/testing/TestSchema.js.map +1 -1
  395. package/dist/unstable/ai/AiError.d.ts +4 -2
  396. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  397. package/dist/unstable/ai/AiError.js +4 -2
  398. package/dist/unstable/ai/AiError.js.map +1 -1
  399. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +17 -20
  400. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
  401. package/dist/unstable/ai/AnthropicStructuredOutput.js +36 -39
  402. package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
  403. package/dist/unstable/ai/Chat.d.ts +6 -7
  404. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  405. package/dist/unstable/ai/Chat.js +6 -7
  406. package/dist/unstable/ai/Chat.js.map +1 -1
  407. package/dist/unstable/ai/EmbeddingModel.d.ts +5 -5
  408. package/dist/unstable/ai/EmbeddingModel.js +4 -4
  409. package/dist/unstable/ai/IdGenerator.d.ts +4 -5
  410. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  411. package/dist/unstable/ai/IdGenerator.js +3 -4
  412. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  413. package/dist/unstable/ai/LanguageModel.d.ts +7 -6
  414. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  415. package/dist/unstable/ai/LanguageModel.js +6 -5
  416. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  417. package/dist/unstable/ai/McpSchema.d.ts +14 -12
  418. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  419. package/dist/unstable/ai/McpSchema.js +19 -17
  420. package/dist/unstable/ai/McpSchema.js.map +1 -1
  421. package/dist/unstable/ai/McpServer.d.ts +11 -4
  422. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  423. package/dist/unstable/ai/McpServer.js +8 -5
  424. package/dist/unstable/ai/McpServer.js.map +1 -1
  425. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +20 -18
  426. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
  427. package/dist/unstable/ai/OpenAiStructuredOutput.js +45 -43
  428. package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
  429. package/dist/unstable/ai/Prompt.d.ts +17 -17
  430. package/dist/unstable/ai/Prompt.js +4 -4
  431. package/dist/unstable/ai/Prompt.js.map +1 -1
  432. package/dist/unstable/ai/ResponseIdTracker.d.ts +3 -2
  433. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  434. package/dist/unstable/ai/ResponseIdTracker.js +3 -2
  435. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  436. package/dist/unstable/ai/Telemetry.d.ts +26 -11
  437. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  438. package/dist/unstable/ai/Telemetry.js +9 -4
  439. package/dist/unstable/ai/Telemetry.js.map +1 -1
  440. package/dist/unstable/ai/Tokenizer.d.ts +1 -1
  441. package/dist/unstable/ai/Tokenizer.js +1 -1
  442. package/dist/unstable/ai/Tool.d.ts +13 -12
  443. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  444. package/dist/unstable/ai/Tool.js +14 -13
  445. package/dist/unstable/ai/Tool.js.map +1 -1
  446. package/dist/unstable/ai/Toolkit.d.ts +2 -2
  447. package/dist/unstable/ai/Toolkit.js +2 -2
  448. package/dist/unstable/cli/Command.d.ts +37 -16
  449. package/dist/unstable/cli/Command.d.ts.map +1 -1
  450. package/dist/unstable/cli/Command.js +16 -9
  451. package/dist/unstable/cli/Command.js.map +1 -1
  452. package/dist/unstable/cli/Completions.d.ts +1 -1
  453. package/dist/unstable/cli/Completions.js +1 -1
  454. package/dist/unstable/cli/Flag.d.ts +7 -6
  455. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  456. package/dist/unstable/cli/Flag.js +7 -6
  457. package/dist/unstable/cli/Flag.js.map +1 -1
  458. package/dist/unstable/cli/GlobalFlag.d.ts +6 -1
  459. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  460. package/dist/unstable/cli/GlobalFlag.js +7 -2
  461. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  462. package/dist/unstable/cli/Param.d.ts +4 -4
  463. package/dist/unstable/cli/Param.d.ts.map +1 -1
  464. package/dist/unstable/cli/Param.js +13 -10
  465. package/dist/unstable/cli/Param.js.map +1 -1
  466. package/dist/unstable/cli/Primitive.d.ts +6 -5
  467. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  468. package/dist/unstable/cli/Primitive.js +4 -3
  469. package/dist/unstable/cli/Primitive.js.map +1 -1
  470. package/dist/unstable/cli/Prompt.d.ts +11 -11
  471. package/dist/unstable/cli/internal/parser.js +145 -10
  472. package/dist/unstable/cli/internal/parser.js.map +1 -1
  473. package/dist/unstable/cluster/ClusterCron.d.ts +1 -2
  474. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  475. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  476. package/dist/unstable/cluster/ClusterMetrics.d.ts +5 -0
  477. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  478. package/dist/unstable/cluster/ClusterMetrics.js +5 -0
  479. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  480. package/dist/unstable/cluster/ClusterSchema.d.ts +3 -3
  481. package/dist/unstable/cluster/ClusterSchema.js +3 -3
  482. package/dist/unstable/cluster/ClusterWorkflowEngine.js +15 -15
  483. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  484. package/dist/unstable/cluster/Entity.d.ts +1 -1
  485. package/dist/unstable/cluster/Entity.js +1 -1
  486. package/dist/unstable/cluster/EntityResource.d.ts +10 -0
  487. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  488. package/dist/unstable/cluster/EntityResource.js +10 -0
  489. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  490. package/dist/unstable/cluster/Envelope.d.ts +2 -2
  491. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  492. package/dist/unstable/cluster/Envelope.js +2 -2
  493. package/dist/unstable/cluster/Envelope.js.map +1 -1
  494. package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
  495. package/dist/unstable/cluster/HttpRunner.js +2 -2
  496. package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
  497. package/dist/unstable/cluster/K8sHttpClient.js +1 -1
  498. package/dist/unstable/cluster/Reply.d.ts +2 -2
  499. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  500. package/dist/unstable/cluster/Reply.js +12 -12
  501. package/dist/unstable/cluster/Reply.js.map +1 -1
  502. package/dist/unstable/cluster/RunnerHealth.d.ts +2 -1
  503. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  504. package/dist/unstable/cluster/RunnerHealth.js +2 -1
  505. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  506. package/dist/unstable/cluster/RunnerServer.d.ts +2 -2
  507. package/dist/unstable/cluster/RunnerServer.js +2 -2
  508. package/dist/unstable/cluster/Runners.d.ts +4 -4
  509. package/dist/unstable/cluster/Runners.js +4 -4
  510. package/dist/unstable/cluster/ShardId.js +3 -3
  511. package/dist/unstable/cluster/ShardId.js.map +1 -1
  512. package/dist/unstable/cluster/Sharding.d.ts +4 -4
  513. package/dist/unstable/cluster/Sharding.js +4 -4
  514. package/dist/unstable/cluster/ShardingConfig.d.ts +4 -4
  515. package/dist/unstable/cluster/ShardingConfig.js +4 -4
  516. package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
  517. package/dist/unstable/cluster/SingletonAddress.js +1 -1
  518. package/dist/unstable/cluster/Snowflake.d.ts +6 -6
  519. package/dist/unstable/cluster/Snowflake.js +8 -8
  520. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  521. package/dist/unstable/cluster/internal/entityManager.js +2 -2
  522. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  523. package/dist/unstable/devtools/DevToolsClient.d.ts +1 -1
  524. package/dist/unstable/devtools/DevToolsClient.js +1 -1
  525. package/dist/unstable/encoding/Msgpack.d.ts +2 -2
  526. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  527. package/dist/unstable/encoding/Msgpack.js +5 -5
  528. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  529. package/dist/unstable/encoding/Ndjson.d.ts +5 -0
  530. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  531. package/dist/unstable/encoding/Ndjson.js +5 -0
  532. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  533. package/dist/unstable/encoding/Sse.d.ts +2 -2
  534. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  535. package/dist/unstable/encoding/Sse.js +2 -2
  536. package/dist/unstable/encoding/Sse.js.map +1 -1
  537. package/dist/unstable/eventlog/EventGroup.d.ts +2 -1
  538. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  539. package/dist/unstable/eventlog/EventGroup.js +2 -1
  540. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  541. package/dist/unstable/eventlog/EventJournal.d.ts +10 -0
  542. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  543. package/dist/unstable/eventlog/EventJournal.js +10 -0
  544. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  545. package/dist/unstable/eventlog/EventLog.d.ts +4 -4
  546. package/dist/unstable/eventlog/EventLog.js +4 -4
  547. package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
  548. package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
  549. package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
  550. package/dist/unstable/eventlog/EventLogRemote.js +1 -1
  551. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -3
  552. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  553. package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -3
  554. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  555. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +8 -10
  556. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  557. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +8 -10
  558. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  559. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +4 -4
  560. package/dist/unstable/eventlog/EventLogSessionAuth.js +4 -4
  561. package/dist/unstable/http/Cookies.d.ts +1 -1
  562. package/dist/unstable/http/Cookies.js +4 -4
  563. package/dist/unstable/http/Cookies.js.map +1 -1
  564. package/dist/unstable/http/Etag.d.ts +3 -4
  565. package/dist/unstable/http/Etag.d.ts.map +1 -1
  566. package/dist/unstable/http/Etag.js +3 -4
  567. package/dist/unstable/http/Etag.js.map +1 -1
  568. package/dist/unstable/http/FetchHttpClient.d.ts +2 -2
  569. package/dist/unstable/http/FetchHttpClient.js +2 -2
  570. package/dist/unstable/http/Headers.js +2 -2
  571. package/dist/unstable/http/Headers.js.map +1 -1
  572. package/dist/unstable/http/HttpBody.js +2 -2
  573. package/dist/unstable/http/HttpBody.js.map +1 -1
  574. package/dist/unstable/http/HttpClient.d.ts +3 -3
  575. package/dist/unstable/http/HttpClient.js +3 -3
  576. package/dist/unstable/http/HttpClientRequest.d.ts +32 -5
  577. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  578. package/dist/unstable/http/HttpClientRequest.js +10 -1
  579. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  580. package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
  581. package/dist/unstable/http/HttpMiddleware.js +1 -1
  582. package/dist/unstable/http/HttpPlatform.d.ts +1 -1
  583. package/dist/unstable/http/HttpPlatform.js +1 -1
  584. package/dist/unstable/http/HttpRouter.d.ts +5 -5
  585. package/dist/unstable/http/HttpRouter.js +5 -5
  586. package/dist/unstable/http/HttpServerResponse.d.ts +28 -23
  587. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  588. package/dist/unstable/http/HttpServerResponse.js +13 -8
  589. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  590. package/dist/unstable/http/Multipart.js +3 -3
  591. package/dist/unstable/http/Multipart.js.map +1 -1
  592. package/dist/unstable/http/Url.d.ts +33 -33
  593. package/dist/unstable/http/Url.js +11 -11
  594. package/dist/unstable/http/UrlParams.d.ts +30 -0
  595. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  596. package/dist/unstable/http/UrlParams.js +16 -6
  597. package/dist/unstable/http/UrlParams.js.map +1 -1
  598. package/dist/unstable/httpapi/HttpApi.d.ts +4 -3
  599. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  600. package/dist/unstable/httpapi/HttpApi.js +4 -3
  601. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  602. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  603. package/dist/unstable/httpapi/HttpApiBuilder.js +10 -8
  604. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  605. package/dist/unstable/httpapi/HttpApiClient.js +15 -15
  606. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  607. package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
  608. package/dist/unstable/httpapi/HttpApiError.js +13 -13
  609. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +3 -3
  610. package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -3
  611. package/dist/unstable/httpapi/HttpApiSchema.d.ts +2 -2
  612. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  613. package/dist/unstable/httpapi/HttpApiSchema.js +9 -9
  614. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  615. package/dist/unstable/httpapi/OpenApi.js +11 -11
  616. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  617. package/dist/unstable/observability/OtlpResource.d.ts +5 -0
  618. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  619. package/dist/unstable/observability/OtlpResource.js +5 -0
  620. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  621. package/dist/unstable/observability/PrometheusMetrics.d.ts +8 -6
  622. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  623. package/dist/unstable/observability/PrometheusMetrics.js +6 -4
  624. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  625. package/dist/unstable/persistence/KeyValueStore.d.ts +3 -3
  626. package/dist/unstable/persistence/KeyValueStore.js +1 -1
  627. package/dist/unstable/persistence/Persistable.d.ts +2 -2
  628. package/dist/unstable/persistence/Persistable.js +2 -2
  629. package/dist/unstable/persistence/PersistedQueue.d.ts +8 -8
  630. package/dist/unstable/persistence/PersistedQueue.js +8 -8
  631. package/dist/unstable/persistence/RateLimiter.d.ts +1 -1
  632. package/dist/unstable/persistence/RateLimiter.js +1 -1
  633. package/dist/unstable/process/ChildProcess.d.ts +5 -5
  634. package/dist/unstable/process/ChildProcess.js +2 -2
  635. package/dist/unstable/reactivity/AsyncResult.d.ts +4 -4
  636. package/dist/unstable/reactivity/AsyncResult.js +1 -1
  637. package/dist/unstable/reactivity/Atom.d.ts +4 -4
  638. package/dist/unstable/reactivity/Atom.js +4 -4
  639. package/dist/unstable/reactivity/AtomRegistry.d.ts +1 -1
  640. package/dist/unstable/reactivity/AtomRegistry.js +1 -1
  641. package/dist/unstable/reactivity/Reactivity.d.ts +1 -1
  642. package/dist/unstable/reactivity/Reactivity.js +1 -1
  643. package/dist/unstable/rpc/Rpc.d.ts +5 -5
  644. package/dist/unstable/rpc/Rpc.js +1 -1
  645. package/dist/unstable/rpc/RpcMiddleware.d.ts +1 -1
  646. package/dist/unstable/rpc/RpcMiddleware.js +1 -1
  647. package/dist/unstable/rpc/RpcSchema.d.ts +5 -5
  648. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  649. package/dist/unstable/rpc/RpcSchema.js +2 -2
  650. package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
  651. package/dist/unstable/rpc/RpcSerialization.js +2 -2
  652. package/dist/unstable/schema/Model.d.ts +2 -2
  653. package/dist/unstable/schema/Model.js +6 -6
  654. package/dist/unstable/schema/Model.js.map +1 -1
  655. package/dist/unstable/schema/VariantSchema.d.ts +2 -2
  656. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  657. package/dist/unstable/socket/Socket.d.ts +3 -3
  658. package/dist/unstable/socket/Socket.js +3 -3
  659. package/dist/unstable/socket/SocketServer.d.ts +1 -1
  660. package/dist/unstable/socket/SocketServer.js +1 -1
  661. package/dist/unstable/sql/Migrator.d.ts +1 -1
  662. package/dist/unstable/sql/SqlClient.d.ts +3 -3
  663. package/dist/unstable/sql/SqlClient.js +2 -2
  664. package/dist/unstable/sql/SqlConnection.d.ts +1 -1
  665. package/dist/unstable/sql/SqlConnection.js +1 -1
  666. package/dist/unstable/sql/SqlSchema.d.ts +4 -4
  667. package/dist/unstable/sql/SqlSchema.js +4 -4
  668. package/dist/unstable/sql/Statement.d.ts +2 -2
  669. package/dist/unstable/sql/Statement.js +2 -2
  670. package/dist/unstable/workers/Transferable.d.ts +3 -3
  671. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  672. package/dist/unstable/workers/Transferable.js +6 -6
  673. package/dist/unstable/workers/Transferable.js.map +1 -1
  674. package/dist/unstable/workers/Worker.d.ts +1 -1
  675. package/dist/unstable/workers/Worker.js +1 -1
  676. package/dist/unstable/workflow/Activity.d.ts +1 -1
  677. package/dist/unstable/workflow/Activity.js +1 -1
  678. package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
  679. package/dist/unstable/workflow/DurableDeferred.js +8 -8
  680. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  681. package/dist/unstable/workflow/DurableQueue.d.ts +1 -2
  682. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  683. package/dist/unstable/workflow/DurableQueue.js +1 -2
  684. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  685. package/dist/unstable/workflow/Workflow.d.ts +35 -15
  686. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  687. package/dist/unstable/workflow/Workflow.js +94 -72
  688. package/dist/unstable/workflow/Workflow.js.map +1 -1
  689. package/dist/unstable/workflow/WorkflowEngine.d.ts +10 -2
  690. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  691. package/dist/unstable/workflow/WorkflowEngine.js +16 -8
  692. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  693. package/dist/unstable/workflow/WorkflowProxy.d.ts +2 -4
  694. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  695. package/dist/unstable/workflow/WorkflowProxy.js +9 -11
  696. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  697. package/dist/unstable/workflow/WorkflowProxyServer.js +7 -7
  698. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  699. package/package.json +1 -1
  700. package/src/Array.ts +745 -627
  701. package/src/BigDecimal.ts +37 -30
  702. package/src/BigInt.ts +34 -40
  703. package/src/Boolean.ts +10 -10
  704. package/src/Brand.ts +16 -14
  705. package/src/Cause.ts +21 -23
  706. package/src/Channel.ts +316 -76
  707. package/src/ChannelSchema.ts +11 -11
  708. package/src/Chunk.ts +87 -34
  709. package/src/Clock.ts +3 -3
  710. package/src/Combiner.ts +9 -13
  711. package/src/Config.ts +60 -67
  712. package/src/ConfigProvider.ts +34 -44
  713. package/src/Console.ts +2 -2
  714. package/src/Context.ts +64 -76
  715. package/src/Cron.ts +6 -6
  716. package/src/Crypto.ts +4 -4
  717. package/src/Data.ts +21 -15
  718. package/src/DateTime.ts +35 -16
  719. package/src/Deferred.ts +61 -52
  720. package/src/Duration.ts +50 -37
  721. package/src/Effect.ts +574 -474
  722. package/src/Encoding.ts +5 -0
  723. package/src/Equal.ts +28 -41
  724. package/src/Equivalence.ts +72 -100
  725. package/src/ErrorReporter.ts +1 -1
  726. package/src/ExecutionPlan.ts +2 -2
  727. package/src/Exit.ts +79 -96
  728. package/src/Fiber.ts +8 -6
  729. package/src/FiberHandle.ts +25 -0
  730. package/src/FiberMap.ts +35 -0
  731. package/src/FiberSet.ts +20 -0
  732. package/src/FileSystem.ts +6 -6
  733. package/src/Filter.ts +4 -4
  734. package/src/Formatter.ts +14 -19
  735. package/src/Function.ts +20 -21
  736. package/src/Graph.ts +13 -13
  737. package/src/HKT.ts +3 -3
  738. package/src/Hash.ts +2 -1
  739. package/src/HashMap.ts +18 -3
  740. package/src/HashRing.ts +9 -9
  741. package/src/HashSet.ts +1 -1
  742. package/src/Iterable.ts +39 -27
  743. package/src/JsonPatch.ts +2 -3
  744. package/src/JsonPointer.ts +2 -6
  745. package/src/JsonSchema.ts +17 -13
  746. package/src/Latch.ts +4 -3
  747. package/src/Layer.ts +108 -130
  748. package/src/Logger.ts +22 -25
  749. package/src/ManagedRuntime.ts +2 -2
  750. package/src/Match.ts +22 -22
  751. package/src/Metric.ts +129 -157
  752. package/src/MutableHashMap.ts +35 -20
  753. package/src/MutableList.ts +15 -0
  754. package/src/MutableRef.ts +56 -42
  755. package/src/Newtype.ts +10 -7
  756. package/src/Number.ts +23 -11
  757. package/src/Optic.ts +25 -22
  758. package/src/Option.ts +232 -204
  759. package/src/Order.ts +119 -180
  760. package/src/PartitionedSemaphore.ts +14 -14
  761. package/src/Path.ts +3 -3
  762. package/src/Pipeable.ts +3 -3
  763. package/src/PlatformError.ts +4 -4
  764. package/src/Pool.ts +7 -11
  765. package/src/Predicate.ts +279 -268
  766. package/src/PubSub.ts +33 -23
  767. package/src/Pull.ts +4 -4
  768. package/src/Queue.ts +70 -31
  769. package/src/RcRef.ts +0 -4
  770. package/src/Record.ts +15 -15
  771. package/src/Redactable.ts +2 -2
  772. package/src/Redacted.ts +5 -5
  773. package/src/Reducer.ts +2 -3
  774. package/src/Ref.ts +61 -58
  775. package/src/References.ts +4 -4
  776. package/src/RegExp.ts +1 -1
  777. package/src/Request.ts +22 -22
  778. package/src/RequestResolver.ts +8 -8
  779. package/src/Resource.ts +3 -3
  780. package/src/Result.ts +105 -51
  781. package/src/Runtime.ts +11 -8
  782. package/src/Schedule.ts +157 -90
  783. package/src/Scheduler.ts +6 -4
  784. package/src/Schema.ts +1020 -1108
  785. package/src/SchemaAST.ts +149 -118
  786. package/src/SchemaGetter.ts +155 -134
  787. package/src/SchemaIssue.ts +39 -41
  788. package/src/SchemaParser.ts +176 -232
  789. package/src/SchemaRepresentation.ts +38 -28
  790. package/src/SchemaTransformation.ts +233 -207
  791. package/src/SchemaUtils.ts +2 -2
  792. package/src/Scope.ts +16 -1
  793. package/src/ScopedCache.ts +1 -1
  794. package/src/ScopedRef.ts +14 -18
  795. package/src/Semaphore.ts +9 -9
  796. package/src/Sink.ts +18 -18
  797. package/src/Stdio.ts +4 -5
  798. package/src/Stream.ts +411 -114
  799. package/src/String.ts +11 -14
  800. package/src/Struct.ts +23 -21
  801. package/src/SubscriptionRef.ts +24 -19
  802. package/src/SynchronizedRef.ts +145 -120
  803. package/src/Terminal.ts +1 -1
  804. package/src/Tracer.ts +9 -9
  805. package/src/Trie.ts +15 -0
  806. package/src/Tuple.ts +39 -33
  807. package/src/TxHashMap.ts +3 -3
  808. package/src/TxHashSet.ts +1 -1
  809. package/src/TxReentrantLock.ts +6 -3
  810. package/src/TxRef.ts +16 -16
  811. package/src/TxSubscriptionRef.ts +43 -27
  812. package/src/Types.ts +12 -39
  813. package/src/UndefinedOr.ts +15 -14
  814. package/src/Unify.ts +9 -9
  815. package/src/internal/schema/annotations.ts +4 -4
  816. package/src/internal/schema/arbitrary.ts +16 -16
  817. package/src/internal/schema/equivalence.ts +11 -11
  818. package/src/internal/schema/representation.ts +23 -23
  819. package/src/internal/schema/schema.ts +17 -17
  820. package/src/testing/TestClock.ts +5 -5
  821. package/src/testing/TestConsole.ts +3 -3
  822. package/src/testing/TestSchema.ts +20 -20
  823. package/src/unstable/ai/AiError.ts +4 -2
  824. package/src/unstable/ai/AnthropicStructuredOutput.ts +59 -56
  825. package/src/unstable/ai/Chat.ts +6 -7
  826. package/src/unstable/ai/EmbeddingModel.ts +5 -5
  827. package/src/unstable/ai/IdGenerator.ts +4 -5
  828. package/src/unstable/ai/LanguageModel.ts +9 -8
  829. package/src/unstable/ai/McpSchema.ts +19 -17
  830. package/src/unstable/ai/McpServer.ts +14 -7
  831. package/src/unstable/ai/OpenAiStructuredOutput.ts +72 -61
  832. package/src/unstable/ai/Prompt.ts +20 -20
  833. package/src/unstable/ai/ResponseIdTracker.ts +3 -2
  834. package/src/unstable/ai/Telemetry.ts +26 -11
  835. package/src/unstable/ai/Tokenizer.ts +1 -1
  836. package/src/unstable/ai/Tool.ts +17 -16
  837. package/src/unstable/ai/Toolkit.ts +2 -2
  838. package/src/unstable/cli/Command.ts +42 -17
  839. package/src/unstable/cli/Completions.ts +1 -1
  840. package/src/unstable/cli/Flag.ts +7 -6
  841. package/src/unstable/cli/GlobalFlag.ts +7 -1
  842. package/src/unstable/cli/Param.ts +24 -19
  843. package/src/unstable/cli/Primitive.ts +6 -5
  844. package/src/unstable/cli/Prompt.ts +11 -11
  845. package/src/unstable/cli/internal/parser.ts +204 -10
  846. package/src/unstable/cluster/ClusterCron.ts +1 -2
  847. package/src/unstable/cluster/ClusterMetrics.ts +5 -0
  848. package/src/unstable/cluster/ClusterSchema.ts +3 -3
  849. package/src/unstable/cluster/ClusterWorkflowEngine.ts +15 -15
  850. package/src/unstable/cluster/Entity.ts +1 -1
  851. package/src/unstable/cluster/EntityResource.ts +10 -0
  852. package/src/unstable/cluster/Envelope.ts +3 -3
  853. package/src/unstable/cluster/HttpRunner.ts +2 -2
  854. package/src/unstable/cluster/K8sHttpClient.ts +1 -1
  855. package/src/unstable/cluster/Reply.ts +14 -12
  856. package/src/unstable/cluster/RunnerHealth.ts +2 -1
  857. package/src/unstable/cluster/RunnerServer.ts +2 -2
  858. package/src/unstable/cluster/Runners.ts +4 -4
  859. package/src/unstable/cluster/ShardId.ts +3 -3
  860. package/src/unstable/cluster/Sharding.ts +4 -4
  861. package/src/unstable/cluster/ShardingConfig.ts +4 -4
  862. package/src/unstable/cluster/SingletonAddress.ts +1 -1
  863. package/src/unstable/cluster/Snowflake.ts +8 -8
  864. package/src/unstable/cluster/internal/entityManager.ts +2 -2
  865. package/src/unstable/devtools/DevToolsClient.ts +1 -1
  866. package/src/unstable/encoding/Msgpack.ts +6 -6
  867. package/src/unstable/encoding/Ndjson.ts +5 -0
  868. package/src/unstable/encoding/Sse.ts +2 -2
  869. package/src/unstable/eventlog/EventGroup.ts +2 -1
  870. package/src/unstable/eventlog/EventJournal.ts +10 -0
  871. package/src/unstable/eventlog/EventLog.ts +4 -4
  872. package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
  873. package/src/unstable/eventlog/EventLogRemote.ts +1 -1
  874. package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -3
  875. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +8 -10
  876. package/src/unstable/eventlog/EventLogSessionAuth.ts +4 -4
  877. package/src/unstable/http/Cookies.ts +5 -5
  878. package/src/unstable/http/Etag.ts +3 -4
  879. package/src/unstable/http/FetchHttpClient.ts +2 -2
  880. package/src/unstable/http/Headers.ts +2 -2
  881. package/src/unstable/http/HttpBody.ts +2 -2
  882. package/src/unstable/http/HttpClient.ts +3 -3
  883. package/src/unstable/http/HttpClientRequest.ts +32 -5
  884. package/src/unstable/http/HttpMiddleware.ts +1 -1
  885. package/src/unstable/http/HttpPlatform.ts +1 -1
  886. package/src/unstable/http/HttpRouter.ts +5 -5
  887. package/src/unstable/http/HttpServerResponse.ts +28 -23
  888. package/src/unstable/http/Multipart.ts +3 -3
  889. package/src/unstable/http/Url.ts +33 -33
  890. package/src/unstable/http/UrlParams.ts +36 -6
  891. package/src/unstable/httpapi/HttpApi.ts +6 -5
  892. package/src/unstable/httpapi/HttpApiBuilder.ts +14 -13
  893. package/src/unstable/httpapi/HttpApiClient.ts +16 -16
  894. package/src/unstable/httpapi/HttpApiError.ts +13 -13
  895. package/src/unstable/httpapi/HttpApiMiddleware.ts +3 -3
  896. package/src/unstable/httpapi/HttpApiSchema.ts +15 -15
  897. package/src/unstable/httpapi/OpenApi.ts +18 -18
  898. package/src/unstable/observability/OtlpResource.ts +5 -0
  899. package/src/unstable/observability/PrometheusMetrics.ts +8 -6
  900. package/src/unstable/persistence/KeyValueStore.ts +3 -3
  901. package/src/unstable/persistence/Persistable.ts +2 -2
  902. package/src/unstable/persistence/PersistedQueue.ts +8 -8
  903. package/src/unstable/persistence/RateLimiter.ts +1 -1
  904. package/src/unstable/process/ChildProcess.ts +5 -5
  905. package/src/unstable/reactivity/AsyncResult.ts +4 -4
  906. package/src/unstable/reactivity/Atom.ts +4 -4
  907. package/src/unstable/reactivity/AtomRegistry.ts +1 -1
  908. package/src/unstable/reactivity/Reactivity.ts +1 -1
  909. package/src/unstable/rpc/Rpc.ts +5 -5
  910. package/src/unstable/rpc/RpcMiddleware.ts +1 -1
  911. package/src/unstable/rpc/RpcSchema.ts +5 -5
  912. package/src/unstable/rpc/RpcSerialization.ts +2 -2
  913. package/src/unstable/schema/Model.ts +7 -7
  914. package/src/unstable/schema/VariantSchema.ts +2 -2
  915. package/src/unstable/socket/Socket.ts +3 -3
  916. package/src/unstable/socket/SocketServer.ts +1 -1
  917. package/src/unstable/sql/Migrator.ts +1 -1
  918. package/src/unstable/sql/SqlClient.ts +3 -3
  919. package/src/unstable/sql/SqlConnection.ts +1 -1
  920. package/src/unstable/sql/SqlSchema.ts +4 -4
  921. package/src/unstable/sql/Statement.ts +2 -2
  922. package/src/unstable/workers/Transferable.ts +7 -7
  923. package/src/unstable/workers/Worker.ts +1 -1
  924. package/src/unstable/workflow/Activity.ts +1 -1
  925. package/src/unstable/workflow/DurableDeferred.ts +8 -8
  926. package/src/unstable/workflow/DurableQueue.ts +1 -2
  927. package/src/unstable/workflow/Workflow.ts +159 -114
  928. package/src/unstable/workflow/WorkflowEngine.ts +16 -8
  929. package/src/unstable/workflow/WorkflowProxy.ts +9 -11
  930. package/src/unstable/workflow/WorkflowProxyServer.ts +7 -7
package/dist/Schema.js CHANGED
@@ -118,11 +118,11 @@ import * as Record_ from "./Record.js";
118
118
  import * as Redacted_ from "./Redacted.js";
119
119
  import * as Result_ from "./Result.js";
120
120
  import * as Scheduler from "./Scheduler.js";
121
- import * as AST from "./SchemaAST.js";
122
- import * as Getter from "./SchemaGetter.js";
123
- import * as Issue from "./SchemaIssue.js";
124
- import * as Parser from "./SchemaParser.js";
125
- import * as Transformation from "./SchemaTransformation.js";
121
+ import * as SchemaAST from "./SchemaAST.js";
122
+ import * as SchemaGetter from "./SchemaGetter.js";
123
+ import * as SchemaIssue from "./SchemaIssue.js";
124
+ import * as SchemaParser from "./SchemaParser.js";
125
+ import * as SchemaTransformation from "./SchemaTransformation.js";
126
126
  import * as Struct_ from "./Struct.js";
127
127
  import * as FastCheck from "./testing/FastCheck.js";
128
128
  const TypeId = InternalSchema.TypeId;
@@ -131,6 +131,11 @@ const TypeId = InternalSchema.TypeId;
131
131
  * `Array<A>`, `Option<A>`, etc.) by accepting a list of type-parameter schemas
132
132
  * and a decoder factory.
133
133
  *
134
+ * **When to use**
135
+ *
136
+ * Use when you are defining a schema for a generic container whose validation
137
+ * depends on one or more type-parameter schemas.
138
+ *
134
139
  * **Details**
135
140
  *
136
141
  * The outer call `declareConstructor<T, E, Iso>()` fixes the decoded type `T`,
@@ -160,7 +165,7 @@ const TypeId = InternalSchema.TypeId;
160
165
  * ([itemCodec]) =>
161
166
  * (u, ast, options) => {
162
167
  * if (!isBox(u)) {
163
- * return Effect.fail(new Issue.InvalidType(ast, Option.some(u)))
168
+ * return Effect.fail(new SchemaIssue.InvalidType(ast, Option.some(u)))
164
169
  * }
165
170
  * return Effect.map(
166
171
  * SchemaParser.decodeUnknownEffect(itemCodec)(u.value, options),
@@ -177,7 +182,7 @@ const TypeId = InternalSchema.TypeId;
177
182
  */
178
183
  export function declareConstructor() {
179
184
  return (typeParameters, run, annotations) => {
180
- return make(new AST.Declaration(typeParameters.map(AST.getAST), typeParameters => run(typeParameters.map(ast => make(ast))), annotations));
185
+ return make(new SchemaAST.Declaration(typeParameters.map(SchemaAST.getAST), typeParameters => run(typeParameters.map(ast => make(ast))), annotations));
181
186
  };
182
187
  }
183
188
  /**
@@ -185,10 +190,10 @@ export function declareConstructor() {
185
190
  * function. The schema accepts any unknown value and succeeds when `is` returns
186
191
  * `true`, failing with an `InvalidType` issue otherwise.
187
192
  *
188
- * **Details**
193
+ * **When to use**
189
194
  *
190
- * Use this when the type has no type parameters. For parametric types such as
191
- * `Option<A>` or `Array<A>`, use {@link declareConstructor} instead.
195
+ * Use when you are defining a schema for an opaque type with no type parameters
196
+ * and validation can be expressed as a type guard.
192
197
  *
193
198
  * **Example** (Schema for a custom `UserId` branded type)
194
199
  *
@@ -212,7 +217,7 @@ export function declareConstructor() {
212
217
  * @since 3.10.0
213
218
  */
214
219
  export function declare(is, annotations) {
215
- return declareConstructor()([], () => (input, ast) => is(input) ? Effect.succeed(input) : Effect.fail(new Issue.InvalidType(ast, Option_.some(input))), annotations);
220
+ return declareConstructor()([], () => (input, ast) => is(input) ? Effect.succeed(input) : Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input))), annotations);
216
221
  }
217
222
  /**
218
223
  * Returns a schema widened to the fully-parameterized {@link Bottom} interface,
@@ -240,7 +245,7 @@ export function declare(is, annotations) {
240
245
  * type E = typeof bottom["Encoded"] // string
241
246
  * ```
242
247
  *
243
- * @category utils
248
+ * @category utility types
244
249
  * @since 4.0.0
245
250
  */
246
251
  export function revealBottom(bottom) {
@@ -342,7 +347,7 @@ export function annotateEncoded(annotations) {
342
347
  */
343
348
  export function annotateKey(annotations) {
344
349
  return self => {
345
- return self.rebuild(AST.annotateKey(self.ast, annotations));
350
+ return self.rebuild(SchemaAST.annotateKey(self.ast, annotations));
346
351
  };
347
352
  }
348
353
  /**
@@ -367,7 +372,7 @@ export function annotateKey(annotations) {
367
372
  * type Enc = typeof codec["Encoded"] // string
368
373
  * ```
369
374
  *
370
- * @category utils
375
+ * @category utility types
371
376
  * @since 4.0.0
372
377
  */
373
378
  export function revealCodec(codec) {
@@ -380,7 +385,7 @@ export {
380
385
  *
381
386
  * **Details**
382
387
  *
383
- * The `issue` field contains a structured {@link Issue.Issue} tree describing
388
+ * The `issue` field contains a structured {@link SchemaIssue.Issue} tree describing
384
389
  * every validation failure, including the path to the problematic value,
385
390
  * expected types, and actual values received. `message` renders the issue tree
386
391
  * as a human-readable string.
@@ -500,12 +505,12 @@ function makeStandardResult(exit) {
500
505
  * @since 4.0.0
501
506
  */
502
507
  export function toStandardSchemaV1(self, options) {
503
- const decodeUnknownEffect = Parser.decodeUnknownEffect(self);
508
+ const decodeUnknownEffect = SchemaParser.decodeUnknownEffect(self);
504
509
  const parseOptions = {
505
510
  errors: "all",
506
511
  ...options?.parseOptions
507
512
  };
508
- const formatter = Issue.makeFormatterStandardSchemaV1(options);
513
+ const formatter = SchemaIssue.makeFormatterStandardSchemaV1(options);
509
514
  const validate = value => {
510
515
  const scheduler = new Scheduler.MixedScheduler();
511
516
  const fiber = Effect.runFork(Effect.match(decodeUnknownEffect(value, parseOptions), {
@@ -629,7 +634,7 @@ export function toStandardJSONSchemaV1(self) {
629
634
  * @category guards
630
635
  * @since 3.10.0
631
636
  */
632
- export const is = Parser.is;
637
+ export const is = SchemaParser.is;
633
638
  /**
634
639
  * Creates an assertion function that throws an error if the input doesn't match
635
640
  * the schema.
@@ -637,7 +642,7 @@ export const is = Parser.is;
637
642
  * **When to use**
638
643
  *
639
644
  * Use to validate unknown input at runtime while narrowing the value with a
640
- * TypeScript `asserts` predicate.
645
+ * TypeScript assertion signature.
641
646
  *
642
647
  * **Details**
643
648
  *
@@ -667,14 +672,15 @@ export const is = Parser.is;
667
672
  * @category guards
668
673
  * @since 4.0.0
669
674
  */
670
- export const asserts = Parser.asserts;
675
+ export const asserts = SchemaParser.asserts;
671
676
  /**
672
677
  * Decodes an `unknown` input against a schema, returning an `Effect` that
673
678
  * succeeds with the decoded value or fails with a {@link SchemaError}.
674
679
  *
675
680
  * **When to use**
676
681
  *
677
- * Use when decoding input whose type is not statically known.
682
+ * Use when you need to decode unknown input in an `Effect` whose failure
683
+ * channel is `SchemaError`.
678
684
  *
679
685
  * **Details**
680
686
  *
@@ -683,11 +689,13 @@ export const asserts = Parser.asserts;
683
689
  * Options may be provided either when creating the decoder or when applying it;
684
690
  * application options override creation options.
685
691
  *
692
+ * @see {@link SchemaParser.decodeUnknownEffect} for the adapter that fails with `SchemaIssue.Issue` directly
693
+ *
686
694
  * @category decoding
687
695
  * @since 4.0.0
688
696
  */
689
697
  export function decodeUnknownEffect(schema, options) {
690
- const parser = Parser.decodeUnknownEffect(schema, options);
698
+ const parser = SchemaParser.decodeUnknownEffect(schema, options);
691
699
  return (input, options) => {
692
700
  return Effect.mapErrorEager(parser(input, options), issue => new SchemaError(issue));
693
701
  };
@@ -699,7 +707,8 @@ export function decodeUnknownEffect(schema, options) {
699
707
  *
700
708
  * **When to use**
701
709
  *
702
- * Use when the input is already typed as the schema's `Encoded` type.
710
+ * Use when you need to decode input already typed as the schema's `Encoded`
711
+ * type in an `Effect` whose failure channel is `SchemaError`.
703
712
  *
704
713
  * **Details**
705
714
  *
@@ -707,6 +716,8 @@ export function decodeUnknownEffect(schema, options) {
707
716
  * Options may be provided either when creating the decoder or when applying it;
708
717
  * application options override creation options.
709
718
  *
719
+ * @see {@link SchemaParser.decodeEffect} for the adapter that fails with `SchemaIssue.Issue` directly
720
+ *
710
721
  * @category decoding
711
722
  * @since 4.0.0
712
723
  */
@@ -718,8 +729,8 @@ export const decodeEffect = decodeUnknownEffect;
718
729
  *
719
730
  * **When to use**
720
731
  *
721
- * Use when the input type is not statically known and decoding should return an
722
- * `Exit` instead of failing or throwing.
732
+ * Use when you need to decode unknown input into an `Exit` whose failure
733
+ * contains `SchemaError`.
723
734
  *
724
735
  * **Details**
725
736
  *
@@ -729,11 +740,13 @@ export const decodeEffect = decodeUnknownEffect;
729
740
  * Options may be provided either when creating the decoder or when applying it;
730
741
  * application options override creation options.
731
742
  *
743
+ * @see {@link SchemaParser.decodeUnknownExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
744
+ *
732
745
  * @category decoding
733
746
  * @since 4.0.0
734
747
  */
735
748
  export function decodeUnknownExit(schema, options) {
736
- const parser = Parser.decodeUnknownExit(schema, options);
749
+ const parser = SchemaParser.decodeUnknownExit(schema, options);
737
750
  return (input, options) => {
738
751
  return Exit_.mapError(parser(input, options), issue => new SchemaError(issue));
739
752
  };
@@ -745,8 +758,8 @@ export function decodeUnknownExit(schema, options) {
745
758
  *
746
759
  * **When to use**
747
760
  *
748
- * Use when typed input should be decoded into an `Exit` instead of failing or
749
- * throwing.
761
+ * Use when you need to decode already typed `Encoded` input into an `Exit`
762
+ * whose failure contains `SchemaError`.
750
763
  *
751
764
  * **Details**
752
765
  *
@@ -755,6 +768,8 @@ export function decodeUnknownExit(schema, options) {
755
768
  * Options may be provided either when creating the decoder or when applying it;
756
769
  * application options override creation options.
757
770
  *
771
+ * @see {@link SchemaParser.decodeExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
772
+ *
758
773
  * @category decoding
759
774
  * @since 4.0.0
760
775
  */
@@ -765,20 +780,21 @@ export const decodeExit = decodeUnknownExit;
765
780
  *
766
781
  * **When to use**
767
782
  *
768
- * Use when the input type is not statically known and you only need to know
783
+ * Use when you do not know the input type statically and only need to know
769
784
  * whether decoding succeeded.
770
785
  *
771
786
  * **Details**
772
787
  *
773
788
  * Prefer this over {@link decodeUnknownExit} or {@link decodeUnknownEffect}
774
- * when you don't need error details. For typed input use {@link decodeOption}.
789
+ * when you don't need error details. For input already typed as the schema's
790
+ * `Encoded` type use {@link decodeOption}.
775
791
  * Options may be provided either when creating the decoder or when applying it;
776
792
  * application options override creation options.
777
793
  *
778
794
  * @category decoding
779
795
  * @since 3.10.0
780
796
  */
781
- export const decodeUnknownOption = Parser.decodeUnknownOption;
797
+ export const decodeUnknownOption = SchemaParser.decodeUnknownOption;
782
798
  /**
783
799
  * Decodes a typed input (the schema's `Encoded` type) against a schema,
784
800
  * returning an `Option` that is `Some` with the decoded value on success or
@@ -786,7 +802,8 @@ export const decodeUnknownOption = Parser.decodeUnknownOption;
786
802
  *
787
803
  * **When to use**
788
804
  *
789
- * Use when typed input should be decoded and only success or failure matters.
805
+ * Use when you already have input typed as the schema's `Encoded` type and
806
+ * only need to know whether decoding succeeded.
790
807
  *
791
808
  * **Details**
792
809
  *
@@ -797,35 +814,43 @@ export const decodeUnknownOption = Parser.decodeUnknownOption;
797
814
  * @category decoding
798
815
  * @since 3.10.0
799
816
  */
800
- export const decodeOption = Parser.decodeOption;
817
+ export const decodeOption = decodeUnknownOption;
801
818
  /**
802
819
  * Decodes an `unknown` input against a schema, returning a `Result` that
803
- * succeeds with the decoded value or fails with a schema issue.
820
+ * succeeds with the decoded value or fails with a {@link SchemaError}.
804
821
  *
805
822
  * **When to use**
806
823
  *
807
- * Use when the input type is not statically known and decoding should return a
808
- * `Result` with structured issue data.
824
+ * Use when you do not know the input type statically and want decoding to
825
+ * return a `Result` with `SchemaError` failure data.
809
826
  *
810
827
  * **Details**
811
828
  *
812
- * For typed input use {@link decodeResult}.
829
+ * For input already typed as the schema's `Encoded` type use
830
+ * {@link decodeResult}.
813
831
  * Options may be provided either when creating the decoder or when applying it;
814
832
  * application options override creation options.
815
833
  *
834
+ * @see {@link SchemaParser.decodeUnknownResult} for the adapter that fails with `SchemaIssue.Issue` directly
835
+ *
816
836
  * @category decoding
817
837
  * @since 4.0.0
818
838
  */
819
- export const decodeUnknownResult = Parser.decodeUnknownResult;
839
+ export function decodeUnknownResult(schema, options) {
840
+ const parser = SchemaParser.decodeUnknownResult(schema, options);
841
+ return (input, options) => {
842
+ return Result_.mapError(parser(input, options), issue => new SchemaError(issue));
843
+ };
844
+ }
820
845
  /**
821
846
  * Decodes a typed input (the schema's `Encoded` type) against a schema,
822
847
  * returning a `Result` that succeeds with the decoded value or fails with a
823
- * schema issue.
848
+ * {@link SchemaError}.
824
849
  *
825
850
  * **When to use**
826
851
  *
827
- * Use when typed input should be decoded into a `Result` with structured issue
828
- * data.
852
+ * Use when you already have input typed as the schema's `Encoded` type and
853
+ * want decoding to return a `Result` with `SchemaError` failure data.
829
854
  *
830
855
  * **Details**
831
856
  *
@@ -833,36 +858,49 @@ export const decodeUnknownResult = Parser.decodeUnknownResult;
833
858
  * Options may be provided either when creating the decoder or when applying it;
834
859
  * application options override creation options.
835
860
  *
861
+ * @see {@link SchemaParser.decodeResult} for the adapter that fails with `SchemaIssue.Issue` directly
862
+ *
836
863
  * @category decoding
837
864
  * @since 4.0.0
838
865
  */
839
- export const decodeResult = Parser.decodeResult;
866
+ export const decodeResult = decodeUnknownResult;
840
867
  /**
841
868
  * Decodes an `unknown` input against a schema, returning a `Promise` that
842
- * resolves with the decoded value or rejects with a schema issue.
869
+ * resolves with the decoded value or rejects with a {@link SchemaError}.
843
870
  *
844
871
  * **When to use**
845
872
  *
846
- * Use when integrating unknown input validation with Promise-based APIs.
873
+ * Use when you need decoding of unknown input to return a JavaScript `Promise`
874
+ * that rejects with `SchemaError`.
847
875
  *
848
876
  * **Details**
849
877
  *
850
- * For typed input use {@link decodePromise}.
878
+ * For input already typed as the schema's `Encoded` type use
879
+ * {@link decodePromise}.
851
880
  * Options may be provided either when creating the decoder or when applying it;
852
881
  * application options override creation options.
853
882
  *
883
+ * @see {@link SchemaParser.decodeUnknownPromise} for the adapter that rejects with `SchemaIssue.Issue` directly
884
+ *
854
885
  * @category decoding
855
886
  * @since 3.10.0
856
887
  */
857
- export const decodeUnknownPromise = Parser.decodeUnknownPromise;
888
+ export function decodeUnknownPromise(schema, options) {
889
+ const parser = decodeUnknownEffect(schema, options);
890
+ return (input, options) => {
891
+ return Effect.runPromise(parser(input, options));
892
+ };
893
+ }
858
894
  /**
859
895
  * Decodes a typed input (the schema's `Encoded` type) against a schema,
860
896
  * returning a `Promise` that resolves with the decoded value or rejects with a
861
- * schema issue.
897
+ * {@link SchemaError}.
862
898
  *
863
899
  * **When to use**
864
900
  *
865
- * Use when integrating typed input decoding with Promise-based APIs.
901
+ * Use when you already have input typed as the schema's `Encoded` type and
902
+ * need decoding to return a JavaScript `Promise` that rejects with
903
+ * `SchemaError`.
866
904
  *
867
905
  * **Details**
868
906
  *
@@ -870,22 +908,24 @@ export const decodeUnknownPromise = Parser.decodeUnknownPromise;
870
908
  * Options may be provided either when creating the decoder or when applying it;
871
909
  * application options override creation options.
872
910
  *
911
+ * @see {@link SchemaParser.decodePromise} for the adapter that rejects with `SchemaIssue.Issue` directly
912
+ *
873
913
  * @category decoding
874
914
  * @since 3.10.0
875
915
  */
876
- export const decodePromise = Parser.decodePromise;
916
+ export const decodePromise = decodeUnknownPromise;
877
917
  /**
878
918
  * Decodes an `unknown` input against a schema synchronously, returning the
879
- * decoded value or throwing an `Error` whose cause contains the schema issue.
919
+ * decoded value or throwing a {@link SchemaError}.
880
920
  *
881
921
  * **When to use**
882
922
  *
883
- * Use when validating unknown data at a boundary and treating schema mismatches
884
- * as exceptions.
923
+ * Use when you need to validate unknown data at a synchronous boundary and want
924
+ * schema mismatches to throw `SchemaError`.
885
925
  *
886
926
  * **Details**
887
927
  *
888
- * For typed input use `decodeSync`.
928
+ * For input already typed as the schema's `Encoded` type use `decodeSync`.
889
929
  * Only service-free schemas can be decoded synchronously. For non-throwing
890
930
  * alternatives see `decodeUnknownOption`, `decodeUnknownExit`, or
891
931
  * `decodeUnknownEffect`. Options may be provided either when creating the
@@ -908,19 +948,25 @@ export const decodePromise = Parser.decodePromise;
908
948
  * // └─ Expected a numeric string, actual "not a number"
909
949
  * ```
910
950
  *
951
+ * @see {@link SchemaParser.decodeUnknownSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
952
+ *
911
953
  * @category decoding
912
954
  * @since 4.0.0
913
955
  */
914
- export const decodeUnknownSync = Parser.decodeUnknownSync;
956
+ export function decodeUnknownSync(schema, options) {
957
+ const parser = decodeUnknownEffect(schema, options);
958
+ return (input, options) => {
959
+ return Effect.runSync(parser(input, options));
960
+ };
961
+ }
915
962
  /**
916
963
  * Decodes a typed input (the schema's `Encoded` type) against a schema
917
- * synchronously, returning the decoded value or throwing an `Error` whose cause
918
- * contains the schema issue.
964
+ * synchronously, returning the decoded value or throwing a {@link SchemaError}.
919
965
  *
920
966
  * **When to use**
921
967
  *
922
- * Use when typed input should be decoded synchronously and schema mismatches
923
- * should throw.
968
+ * Use when you already have input typed as the schema's `Encoded` type and
969
+ * want schema mismatches to throw `SchemaError` synchronously.
924
970
  *
925
971
  * **Details**
926
972
  *
@@ -929,21 +975,24 @@ export const decodeUnknownSync = Parser.decodeUnknownSync;
929
975
  * provided either when creating the decoder or when applying it; application
930
976
  * options override creation options.
931
977
  *
978
+ * @see {@link SchemaParser.decodeSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
979
+ *
932
980
  * @category decoding
933
981
  * @since 4.0.0
934
982
  */
935
- export const decodeSync = Parser.decodeSync;
983
+ export const decodeSync = decodeUnknownSync;
936
984
  /**
937
985
  * Encodes an `unknown` input against a schema, returning an `Effect` that
938
986
  * succeeds with the encoded value or fails with a {@link SchemaError}.
939
987
  *
940
988
  * **When to use**
941
989
  *
942
- * Use when encoding input whose type is not statically known.
990
+ * Use when you need to encode unknown input in an `Effect` whose failure
991
+ * channel is `SchemaError`.
943
992
  *
944
993
  * **Details**
945
994
  *
946
- * Prefer {@link encodeEffect} when the input is already typed as the schema's
995
+ * Prefer {@link encodeEffect} when the value is already typed as the schema's
947
996
  * `Type`.
948
997
  * Options may be provided either when creating the encoder or when applying it;
949
998
  * application options override creation options.
@@ -959,11 +1008,13 @@ export const decodeSync = Parser.decodeSync;
959
1008
  * // Output: "42"
960
1009
  * ```
961
1010
  *
1011
+ * @see {@link SchemaParser.encodeUnknownEffect} for the adapter that fails with `SchemaIssue.Issue` directly
1012
+ *
962
1013
  * @category encoding
963
1014
  * @since 4.0.0
964
1015
  */
965
1016
  export function encodeUnknownEffect(schema, options) {
966
- const parser = Parser.encodeUnknownEffect(schema, options);
1017
+ const parser = SchemaParser.encodeUnknownEffect(schema, options);
967
1018
  return (input, options) => {
968
1019
  return Effect.mapErrorEager(parser(input, options), issue => new SchemaError(issue));
969
1020
  };
@@ -975,7 +1026,8 @@ export function encodeUnknownEffect(schema, options) {
975
1026
  *
976
1027
  * **When to use**
977
1028
  *
978
- * Use when the input is already typed as the schema's `Type`.
1029
+ * Use when you need to encode input already typed as the schema's `Type` in
1030
+ * an `Effect` whose failure channel is `SchemaError`.
979
1031
  *
980
1032
  * **Details**
981
1033
  *
@@ -983,6 +1035,8 @@ export function encodeUnknownEffect(schema, options) {
983
1035
  * Options may be provided either when creating the encoder or when applying it;
984
1036
  * application options override creation options.
985
1037
  *
1038
+ * @see {@link SchemaParser.encodeEffect} for the adapter that fails with `SchemaIssue.Issue` directly
1039
+ *
986
1040
  * @category encoding
987
1041
  * @since 4.0.0
988
1042
  */
@@ -994,21 +1048,23 @@ export const encodeEffect = encodeUnknownEffect;
994
1048
  *
995
1049
  * **When to use**
996
1050
  *
997
- * Use when the input type is not statically known and encoding should return an
998
- * `Exit` instead of failing or throwing.
1051
+ * Use when you need to encode unknown input into an `Exit` whose failure
1052
+ * contains `SchemaError`.
999
1053
  *
1000
1054
  * **Details**
1001
1055
  *
1002
1056
  * Only usable with schemas that have no `EncodingServices` requirement. Prefer
1003
- * {@link encodeExit} when the input is already typed as the schema's `Type`.
1057
+ * {@link encodeExit} when the value is already typed as the schema's `Type`.
1004
1058
  * Options may be provided either when creating the encoder or when applying it;
1005
1059
  * application options override creation options.
1006
1060
  *
1061
+ * @see {@link SchemaParser.encodeUnknownExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
1062
+ *
1007
1063
  * @category encoding
1008
1064
  * @since 4.0.0
1009
1065
  */
1010
1066
  export function encodeUnknownExit(schema, options) {
1011
- const parser = Parser.encodeUnknownExit(schema, options);
1067
+ const parser = SchemaParser.encodeUnknownExit(schema, options);
1012
1068
  return (input, options) => {
1013
1069
  return Exit_.mapError(parser(input, options), issue => new SchemaError(issue));
1014
1070
  };
@@ -1020,8 +1076,8 @@ export function encodeUnknownExit(schema, options) {
1020
1076
  *
1021
1077
  * **When to use**
1022
1078
  *
1023
- * Use when typed input should be encoded into an `Exit` instead of failing or
1024
- * throwing.
1079
+ * Use when you need to encode already typed schema values into an `Exit` whose
1080
+ * failure contains `SchemaError`.
1025
1081
  *
1026
1082
  * **Details**
1027
1083
  *
@@ -1030,6 +1086,8 @@ export function encodeUnknownExit(schema, options) {
1030
1086
  * Options may be provided either when creating the encoder or when applying it;
1031
1087
  * application options override creation options.
1032
1088
  *
1089
+ * @see {@link SchemaParser.encodeExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
1090
+ *
1033
1091
  * @category encoding
1034
1092
  * @since 4.0.0
1035
1093
  */
@@ -1040,20 +1098,21 @@ export const encodeExit = encodeUnknownExit;
1040
1098
  *
1041
1099
  * **When to use**
1042
1100
  *
1043
- * Use when the input type is not statically known and you only need to know
1101
+ * Use when you do not know the input type statically and only need to know
1044
1102
  * whether encoding succeeded.
1045
1103
  *
1046
1104
  * **Details**
1047
1105
  *
1048
1106
  * Prefer this over {@link encodeUnknownExit} or {@link encodeUnknownEffect}
1049
- * when you don't need error details. For typed input use {@link encodeOption}.
1107
+ * when you don't need error details. For values already typed as the schema's
1108
+ * `Type` use {@link encodeOption}.
1050
1109
  * Options may be provided either when creating the encoder or when applying it;
1051
1110
  * application options override creation options.
1052
1111
  *
1053
1112
  * @category encoding
1054
1113
  * @since 3.10.0
1055
1114
  */
1056
- export const encodeUnknownOption = Parser.encodeUnknownOption;
1115
+ export const encodeUnknownOption = SchemaParser.encodeUnknownOption;
1057
1116
  /**
1058
1117
  * Encodes a typed input (the schema's `Type`) against a schema, returning an
1059
1118
  * `Option` that is `Some` with the encoded value on success or `None` on
@@ -1061,7 +1120,8 @@ export const encodeUnknownOption = Parser.encodeUnknownOption;
1061
1120
  *
1062
1121
  * **When to use**
1063
1122
  *
1064
- * Use when typed input should be encoded and only success or failure matters.
1123
+ * Use when you already have a value typed as the schema's `Type` and only need
1124
+ * to know whether encoding succeeded.
1065
1125
  *
1066
1126
  * **Details**
1067
1127
  *
@@ -1072,34 +1132,42 @@ export const encodeUnknownOption = Parser.encodeUnknownOption;
1072
1132
  * @category encoding
1073
1133
  * @since 3.10.0
1074
1134
  */
1075
- export const encodeOption = Parser.encodeOption;
1135
+ export const encodeOption = encodeUnknownOption;
1076
1136
  /**
1077
1137
  * Encodes an `unknown` input against a schema, returning a `Result` that
1078
- * succeeds with the encoded value or fails with a schema issue.
1138
+ * succeeds with the encoded value or fails with a {@link SchemaError}.
1079
1139
  *
1080
1140
  * **When to use**
1081
1141
  *
1082
- * Use when the input type is not statically known and encoding should return a
1083
- * `Result` with structured issue data.
1142
+ * Use when you do not know the input type statically and want encoding to
1143
+ * return a `Result` with `SchemaError` failure data.
1084
1144
  *
1085
1145
  * **Details**
1086
1146
  *
1087
- * For typed input use {@link encodeResult}.
1147
+ * For values already typed as the schema's `Type` use {@link encodeResult}.
1088
1148
  * Options may be provided either when creating the encoder or when applying it;
1089
1149
  * application options override creation options.
1090
1150
  *
1151
+ * @see {@link SchemaParser.encodeUnknownResult} for the adapter that fails with `SchemaIssue.Issue` directly
1152
+ *
1091
1153
  * @category encoding
1092
1154
  * @since 4.0.0
1093
1155
  */
1094
- export const encodeUnknownResult = Parser.encodeUnknownResult;
1156
+ export function encodeUnknownResult(schema, options) {
1157
+ const parser = SchemaParser.encodeUnknownResult(schema, options);
1158
+ return (input, options) => {
1159
+ return Result_.mapError(parser(input, options), issue => new SchemaError(issue));
1160
+ };
1161
+ }
1095
1162
  /**
1096
1163
  * Encodes a typed input (the schema's `Type`) against a schema, returning a
1097
- * `Result` that succeeds with the encoded value or fails with a schema issue.
1164
+ * `Result` that succeeds with the encoded value or fails with a
1165
+ * {@link SchemaError}.
1098
1166
  *
1099
1167
  * **When to use**
1100
1168
  *
1101
- * Use when typed input should be encoded into a `Result` with structured issue
1102
- * data.
1169
+ * Use when you already have a value typed as the schema's `Type` and want
1170
+ * encoding to return a `Result` with `SchemaError` failure data.
1103
1171
  *
1104
1172
  * **Details**
1105
1173
  *
@@ -1107,28 +1175,38 @@ export const encodeUnknownResult = Parser.encodeUnknownResult;
1107
1175
  * Options may be provided either when creating the encoder or when applying it;
1108
1176
  * application options override creation options.
1109
1177
  *
1178
+ * @see {@link SchemaParser.encodeResult} for the adapter that fails with `SchemaIssue.Issue` directly
1179
+ *
1110
1180
  * @category encoding
1111
1181
  * @since 4.0.0
1112
1182
  */
1113
- export const encodeResult = Parser.encodeResult;
1183
+ export const encodeResult = encodeUnknownResult;
1114
1184
  /**
1115
1185
  * Encodes an `unknown` input against a schema, returning a `Promise` that
1116
- * resolves with the encoded value or rejects with a schema issue.
1186
+ * resolves with the encoded value or rejects with a {@link SchemaError}.
1117
1187
  *
1118
1188
  * **When to use**
1119
1189
  *
1120
- * Use when integrating unknown input serialization with Promise-based APIs.
1190
+ * Use when you need encoding of unknown input to return a JavaScript `Promise`
1191
+ * that rejects with `SchemaError`.
1121
1192
  *
1122
1193
  * **Details**
1123
1194
  *
1124
- * For typed input use {@link encodePromise}.
1195
+ * For values already typed as the schema's `Type` use {@link encodePromise}.
1125
1196
  * Options may be provided either when creating the encoder or when applying it;
1126
1197
  * application options override creation options.
1127
1198
  *
1199
+ * @see {@link SchemaParser.encodeUnknownPromise} for the adapter that rejects with `SchemaIssue.Issue` directly
1200
+ *
1128
1201
  * @category encoding
1129
1202
  * @since 3.10.0
1130
1203
  */
1131
- export const encodeUnknownPromise = Parser.encodeUnknownPromise;
1204
+ export function encodeUnknownPromise(schema, options) {
1205
+ const parser = encodeUnknownEffect(schema, options);
1206
+ return (input, options) => {
1207
+ return Effect.runPromise(parser(input, options));
1208
+ };
1209
+ }
1132
1210
  /**
1133
1211
  * Encodes a typed input (the schema's `Type`) against a schema, returning a
1134
1212
  * `Promise` that resolves with the encoded value or rejects with a
@@ -1136,7 +1214,8 @@ export const encodeUnknownPromise = Parser.encodeUnknownPromise;
1136
1214
  *
1137
1215
  * **When to use**
1138
1216
  *
1139
- * Use when integrating typed input serialization with Promise-based APIs.
1217
+ * Use when you already have a value typed as the schema's `Type` and need
1218
+ * encoding to return a JavaScript `Promise` that rejects with `SchemaError`.
1140
1219
  *
1141
1220
  * **Details**
1142
1221
  *
@@ -1144,39 +1223,48 @@ export const encodeUnknownPromise = Parser.encodeUnknownPromise;
1144
1223
  * Options may be provided either when creating the encoder or when applying it;
1145
1224
  * application options override creation options.
1146
1225
  *
1226
+ * @see {@link SchemaParser.encodePromise} for the adapter that rejects with `SchemaIssue.Issue` directly
1227
+ *
1147
1228
  * @category encoding
1148
1229
  * @since 3.10.0
1149
1230
  */
1150
- export const encodePromise = Parser.encodePromise;
1231
+ export const encodePromise = encodeUnknownPromise;
1151
1232
  /**
1152
1233
  * Encodes an `unknown` input against a schema synchronously, throwing a
1153
1234
  * {@link SchemaError} on failure.
1154
1235
  *
1155
1236
  * **When to use**
1156
1237
  *
1157
- * Use when serializing unknown data at a boundary and treating schema
1158
- * mismatches as unrecoverable errors.
1238
+ * Use when you need to serialize unknown data at a synchronous boundary and
1239
+ * want schema mismatches to throw `SchemaError`.
1159
1240
  *
1160
1241
  * **Details**
1161
1242
  *
1162
1243
  * For non-throwing alternatives see {@link encodeUnknownOption},
1163
- * {@link encodeUnknownExit}, or {@link encodeUnknownEffect}. For typed input
1164
- * use {@link encodeSync}.
1244
+ * {@link encodeUnknownExit}, or {@link encodeUnknownEffect}. For values
1245
+ * already typed as the schema's `Type` use {@link encodeSync}.
1165
1246
  * Options may be provided either when creating the encoder or when applying it;
1166
1247
  * application options override creation options.
1167
1248
  *
1249
+ * @see {@link SchemaParser.encodeUnknownSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
1250
+ *
1168
1251
  * @category encoding
1169
1252
  * @since 4.0.0
1170
1253
  */
1171
- export const encodeUnknownSync = Parser.encodeUnknownSync;
1254
+ export function encodeUnknownSync(schema, options) {
1255
+ const parser = encodeUnknownEffect(schema, options);
1256
+ return (input, options) => {
1257
+ return Effect.runSync(parser(input, options));
1258
+ };
1259
+ }
1172
1260
  /**
1173
1261
  * Encodes a typed input (the schema's `Type`) against a schema synchronously,
1174
1262
  * throwing a {@link SchemaError} on failure.
1175
1263
  *
1176
1264
  * **When to use**
1177
1265
  *
1178
- * Use when typed input should be encoded synchronously and schema mismatches
1179
- * should throw.
1266
+ * Use when you already have a value typed as the schema's `Type` and want
1267
+ * schema mismatches to throw `SchemaError` synchronously.
1180
1268
  *
1181
1269
  * **Details**
1182
1270
  *
@@ -1184,10 +1272,12 @@ export const encodeUnknownSync = Parser.encodeUnknownSync;
1184
1272
  * Options may be provided either when creating the encoder or when applying it;
1185
1273
  * application options override creation options.
1186
1274
  *
1275
+ * @see {@link SchemaParser.encodeSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
1276
+ *
1187
1277
  * @category encoding
1188
1278
  * @since 4.0.0
1189
1279
  */
1190
- export const encodeSync = Parser.encodeSync;
1280
+ export const encodeSync = encodeUnknownSync;
1191
1281
  /**
1192
1282
  * Creates a schema from an AST (Abstract Syntax Tree) node.
1193
1283
  *
@@ -1263,7 +1353,7 @@ export function isSchema(u) {
1263
1353
  * @category combinators
1264
1354
  * @since 4.0.0
1265
1355
  */
1266
- export const optionalKey = /*#__PURE__*/Struct_.lambda(schema => make(AST.optionalKey(schema.ast), {
1356
+ export const optionalKey = /*#__PURE__*/Struct_.lambda(schema => make(SchemaAST.optionalKey(schema.ast), {
1267
1357
  schema
1268
1358
  }));
1269
1359
  /**
@@ -1331,7 +1421,7 @@ export const required = /*#__PURE__*/Struct_.lambda(self => self.schema.members[
1331
1421
  * @category combinators
1332
1422
  * @since 4.0.0
1333
1423
  */
1334
- export const mutableKey = /*#__PURE__*/Struct_.lambda(schema => make(AST.mutableKey(schema.ast), {
1424
+ export const mutableKey = /*#__PURE__*/Struct_.lambda(schema => make(SchemaAST.mutableKey(schema.ast), {
1335
1425
  schema
1336
1426
  }));
1337
1427
  /**
@@ -1353,7 +1443,7 @@ export const readonlyKey = /*#__PURE__*/Struct_.lambda(self => self.schema);
1353
1443
  * @category transforming
1354
1444
  * @since 4.0.0
1355
1445
  */
1356
- export const toType = /*#__PURE__*/Struct_.lambda(schema => make(AST.toType(schema.ast), {
1446
+ export const toType = /*#__PURE__*/Struct_.lambda(schema => make(SchemaAST.toType(schema.ast), {
1357
1447
  schema
1358
1448
  }));
1359
1449
  /**
@@ -1363,7 +1453,7 @@ export const toType = /*#__PURE__*/Struct_.lambda(schema => make(AST.toType(sche
1363
1453
  * @category transforming
1364
1454
  * @since 4.0.0
1365
1455
  */
1366
- export const toEncoded = /*#__PURE__*/Struct_.lambda(schema => make(AST.toEncoded(schema.ast), {
1456
+ export const toEncoded = /*#__PURE__*/Struct_.lambda(schema => make(SchemaAST.toEncoded(schema.ast), {
1367
1457
  schema
1368
1458
  }));
1369
1459
  const FlipTypeId = "~effect/Schema/flip";
@@ -1372,9 +1462,9 @@ function isFlip$(schema) {
1372
1462
  }
1373
1463
  export function flip(schema) {
1374
1464
  if (isFlip$(schema)) {
1375
- return schema.schema.rebuild(AST.flip(schema.ast));
1465
+ return schema.schema.rebuild(SchemaAST.flip(schema.ast));
1376
1466
  }
1377
- return make(AST.flip(schema.ast), {
1467
+ return make(SchemaAST.flip(schema.ast), {
1378
1468
  [FlipTypeId]: FlipTypeId,
1379
1469
  schema
1380
1470
  });
@@ -1398,24 +1488,29 @@ export function flip(schema) {
1398
1488
  * @since 3.10.0
1399
1489
  */
1400
1490
  export function Literal(literal) {
1401
- const out = make(new AST.Literal(literal), {
1491
+ const out = make(new SchemaAST.Literal(literal), {
1402
1492
  literal,
1403
1493
  transform(to) {
1404
1494
  return out.pipe(decodeTo(Literal(to), {
1405
- decode: Getter.transform(() => to),
1406
- encode: Getter.transform(() => literal)
1495
+ decode: SchemaGetter.transform(() => to),
1496
+ encode: SchemaGetter.transform(() => literal)
1407
1497
  }));
1408
1498
  }
1409
1499
  });
1410
1500
  return out;
1411
1501
  }
1412
1502
  function templateLiteralFromParts(parts) {
1413
- return new AST.TemplateLiteral(parts.map(part => isSchema(part) ? part.ast : new AST.Literal(part)));
1503
+ return new SchemaAST.TemplateLiteral(parts.map(part => isSchema(part) ? part.ast : new SchemaAST.Literal(part)));
1414
1504
  }
1415
1505
  /**
1416
1506
  * Creates a schema that validates strings matching a template literal pattern. Each part can be
1417
1507
  * a literal string/number/bigint or a schema whose encoded type is a string, number, or bigint.
1418
1508
  *
1509
+ * **When to use**
1510
+ *
1511
+ * Use when the decoded value should remain the matched string and you do not
1512
+ * need the individual template parts parsed into a tuple.
1513
+ *
1419
1514
  * **Example** (URL path pattern)
1420
1515
  *
1421
1516
  * ```ts
@@ -1486,7 +1581,7 @@ export function TemplateLiteralParser(parts) {
1486
1581
  * @since 4.0.0
1487
1582
  */
1488
1583
  export function Enum(enums) {
1489
- return make(new AST.Enum(Object.keys(enums).filter(key => typeof enums[enums[key]] !== "number").map(key => [key, enums[key]])), {
1584
+ return make(new SchemaAST.Enum(Object.keys(enums).filter(key => typeof enums[enums[key]] !== "number").map(key => [key, enums[key]])), {
1490
1585
  enums
1491
1586
  });
1492
1587
  }
@@ -1496,7 +1591,7 @@ export function Enum(enums) {
1496
1591
  * @category schemas
1497
1592
  * @since 3.10.0
1498
1593
  */
1499
- export const Never = /*#__PURE__*/make(AST.never);
1594
+ export const Never = /*#__PURE__*/make(SchemaAST.never);
1500
1595
  /**
1501
1596
  * Schema for the `any` type. Accepts any value without validation.
1502
1597
  *
@@ -1504,15 +1599,20 @@ export const Never = /*#__PURE__*/make(AST.never);
1504
1599
  * @category schemas
1505
1600
  * @since 3.10.0
1506
1601
  */
1507
- export const Any = /*#__PURE__*/make(AST.any);
1602
+ export const Any = /*#__PURE__*/make(SchemaAST.any);
1508
1603
  /**
1509
1604
  * Schema for the `unknown` type. Accepts any value without validation.
1510
1605
  *
1606
+ * **When to use**
1607
+ *
1608
+ * Use as a top schema when you need to accept any input while preserving
1609
+ * TypeScript's `unknown` safety at use sites.
1610
+ *
1511
1611
  * @see {@link Any} for the `any` variant.
1512
1612
  * @category schemas
1513
1613
  * @since 3.10.0
1514
1614
  */
1515
- export const Unknown = /*#__PURE__*/make(AST.unknown);
1615
+ export const Unknown = /*#__PURE__*/make(SchemaAST.unknown);
1516
1616
  /**
1517
1617
  * Schema for the `null` literal. Validates that the input is strictly `null`.
1518
1618
  *
@@ -1520,7 +1620,7 @@ export const Unknown = /*#__PURE__*/make(AST.unknown);
1520
1620
  * @category schemas
1521
1621
  * @since 3.10.0
1522
1622
  */
1523
- export const Null = /*#__PURE__*/make(AST.null);
1623
+ export const Null = /*#__PURE__*/make(SchemaAST.null);
1524
1624
  /**
1525
1625
  * Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
1526
1626
  *
@@ -1528,14 +1628,14 @@ export const Null = /*#__PURE__*/make(AST.null);
1528
1628
  * @category schemas
1529
1629
  * @since 3.10.0
1530
1630
  */
1531
- export const Undefined = /*#__PURE__*/make(AST.undefined);
1631
+ export const Undefined = /*#__PURE__*/make(SchemaAST.undefined);
1532
1632
  /**
1533
1633
  * Schema for `string` values. Validates that the input is `typeof` `"string"`.
1534
1634
  *
1535
1635
  * @category schemas
1536
1636
  * @since 4.0.0
1537
1637
  */
1538
- export const String = /*#__PURE__*/make(AST.string);
1638
+ export const String = /*#__PURE__*/make(SchemaAST.string);
1539
1639
  /**
1540
1640
  * Schema for `number` values, including `NaN`, `Infinity`, and `-Infinity`.
1541
1641
  *
@@ -1550,7 +1650,7 @@ export const String = /*#__PURE__*/make(AST.string);
1550
1650
  * @category schemas
1551
1651
  * @since 4.0.0
1552
1652
  */
1553
- export const Number = /*#__PURE__*/make(AST.number);
1653
+ export const Number = /*#__PURE__*/make(SchemaAST.number);
1554
1654
  /**
1555
1655
  * Schema for `boolean` values. Validates that the input is `typeof` `"boolean"`.
1556
1656
  *
@@ -1560,10 +1660,10 @@ export const Number = /*#__PURE__*/make(AST.number);
1560
1660
  *
1561
1661
  * @see {@link BooleanFromBit} for a schema that decodes bit literals `0` or `1` into a boolean
1562
1662
  *
1563
- * @category Boolean
1663
+ * @category boolean
1564
1664
  * @since 4.0.0
1565
1665
  */
1566
- export const Boolean = /*#__PURE__*/make(AST.boolean);
1666
+ export const Boolean = /*#__PURE__*/make(SchemaAST.boolean);
1567
1667
  /**
1568
1668
  * Schema for `symbol` values. Validates that the input is `typeof` `"symbol"`.
1569
1669
  *
@@ -1571,7 +1671,7 @@ export const Boolean = /*#__PURE__*/make(AST.boolean);
1571
1671
  * @category schemas
1572
1672
  * @since 4.0.0
1573
1673
  */
1574
- export const Symbol = /*#__PURE__*/make(AST.symbol);
1674
+ export const Symbol = /*#__PURE__*/make(SchemaAST.symbol);
1575
1675
  /**
1576
1676
  * Schema for `bigint` values. Validates that the input is `typeof` `"bigint"`.
1577
1677
  *
@@ -1585,14 +1685,14 @@ export const Symbol = /*#__PURE__*/make(AST.symbol);
1585
1685
  * @category schemas
1586
1686
  * @since 4.0.0
1587
1687
  */
1588
- export const BigInt = /*#__PURE__*/make(AST.bigInt);
1688
+ export const BigInt = /*#__PURE__*/make(SchemaAST.bigInt);
1589
1689
  /**
1590
1690
  * Schema for the `void` type. Accepts `undefined` as the encoded value.
1591
1691
  *
1592
1692
  * @category schemas
1593
1693
  * @since 3.10.0
1594
1694
  */
1595
- export const Void = /*#__PURE__*/make(AST.void);
1695
+ export const Void = /*#__PURE__*/make(SchemaAST.void);
1596
1696
  /**
1597
1697
  * Schema for the `object` type. Validates that the input is a non-null object or function
1598
1698
  * (i.e. `typeof value === "object" && value !== null || typeof value === "function"`).
@@ -1600,7 +1700,7 @@ export const Void = /*#__PURE__*/make(AST.void);
1600
1700
  * @category schemas
1601
1701
  * @since 4.0.0
1602
1702
  */
1603
- export const ObjectKeyword = /*#__PURE__*/make(AST.objectKeyword);
1703
+ export const ObjectKeyword = /*#__PURE__*/make(SchemaAST.objectKeyword);
1604
1704
  /**
1605
1705
  * Creates a schema for a specific symbol. Only that exact symbol satisfies the schema.
1606
1706
  *
@@ -1618,14 +1718,14 @@ export const ObjectKeyword = /*#__PURE__*/make(AST.objectKeyword);
1618
1718
  * @since 4.0.0
1619
1719
  */
1620
1720
  export function UniqueSymbol(symbol) {
1621
- return make(new AST.UniqueSymbol(symbol));
1721
+ return make(new SchemaAST.UniqueSymbol(symbol));
1622
1722
  }
1623
1723
  function makeStruct(ast, fields) {
1624
1724
  return make(ast, {
1625
1725
  fields,
1626
1726
  mapFields(f, options) {
1627
1727
  const fields = f(this.fields);
1628
- return makeStruct(AST.struct(fields, options?.unsafePreserveChecks ? this.ast.checks : undefined), fields);
1728
+ return makeStruct(SchemaAST.struct(fields, options?.unsafePreserveChecks ? this.ast.checks : undefined), fields);
1629
1729
  }
1630
1730
  });
1631
1731
  }
@@ -1663,15 +1763,15 @@ function makeStruct(ast, fields) {
1663
1763
  * @since 3.10.0
1664
1764
  */
1665
1765
  export function Struct(fields) {
1666
- return makeStruct(AST.struct(fields, undefined), fields);
1766
+ return makeStruct(SchemaAST.struct(fields, undefined), fields);
1667
1767
  }
1668
1768
  /**
1669
1769
  * Adds fields to a struct schema through a struct-mapping lambda.
1670
1770
  *
1671
1771
  * **When to use**
1672
1772
  *
1673
- * Use to add the same fields to an existing struct or to every struct member of
1674
- * a union.
1773
+ * Use to add the same fields to an existing struct or every struct member of a
1774
+ * union.
1675
1775
  *
1676
1776
  * **Details**
1677
1777
  *
@@ -1734,7 +1834,7 @@ export function encodeKeys(mapping) {
1734
1834
  fields[k] = encoded;
1735
1835
  }
1736
1836
  }
1737
- return Struct(fields).pipe(decodeTo(self, Transformation.transform({
1837
+ return Struct(fields).pipe(decodeTo(self, SchemaTransformation.transform({
1738
1838
  decode: Struct_.renameKeys(reverseMapping),
1739
1839
  encode: Struct_.renameKeys(mapping)
1740
1840
  })));
@@ -1780,7 +1880,7 @@ derive) {
1780
1880
  ...f,
1781
1881
  ...fields
1782
1882
  });
1783
- return self.pipe(decodeTo(to, Transformation.transform({
1883
+ return self.pipe(decodeTo(to, SchemaTransformation.transform({
1784
1884
  decode: input => {
1785
1885
  const out = {
1786
1886
  ...input
@@ -1828,8 +1928,8 @@ derive) {
1828
1928
  * @since 3.10.0
1829
1929
  */
1830
1930
  export function Record(key, value, options) {
1831
- const keyValueCombiner = options?.keyValueCombiner?.decode || options?.keyValueCombiner?.encode ? new AST.KeyValueCombiner(options.keyValueCombiner.decode, options.keyValueCombiner.encode) : undefined;
1832
- return make(AST.record(key.ast, value.ast, keyValueCombiner), {
1931
+ const keyValueCombiner = options?.keyValueCombiner?.decode || options?.keyValueCombiner?.encode ? new SchemaAST.KeyValueCombiner(options.keyValueCombiner.decode, options.keyValueCombiner.encode) : undefined;
1932
+ return make(SchemaAST.record(key.ast, value.ast, keyValueCombiner), {
1833
1933
  key,
1834
1934
  value
1835
1935
  });
@@ -1845,10 +1945,10 @@ export function Record(key, value, options) {
1845
1945
  *
1846
1946
  * const schema = Schema.StructWithRest(
1847
1947
  * Schema.Struct({ id: Schema.Number }),
1848
- * [Schema.Record(Schema.String, Schema.String)]
1948
+ * [Schema.Record(Schema.String, Schema.Number)]
1849
1949
  * )
1850
1950
  *
1851
- * // { readonly id: number } & { readonly [x: string]: string }
1951
+ * // { readonly id: number, readonly [x: string]: number }
1852
1952
  * type T = typeof schema.Type
1853
1953
  * ```
1854
1954
  *
@@ -1856,7 +1956,7 @@ export function Record(key, value, options) {
1856
1956
  * @since 4.0.0
1857
1957
  */
1858
1958
  export function StructWithRest(schema, records) {
1859
- return make(AST.structWithRest(schema.ast, records.map(AST.getAST)), {
1959
+ return make(SchemaAST.structWithRest(schema.ast, records.map(SchemaAST.getAST)), {
1860
1960
  schema,
1861
1961
  records
1862
1962
  });
@@ -1866,7 +1966,7 @@ function makeTuple(ast, elements) {
1866
1966
  elements,
1867
1967
  mapElements(f, options) {
1868
1968
  const elements = f(this.elements);
1869
- return makeTuple(AST.tuple(elements, options?.unsafePreserveChecks ? this.ast.checks : undefined), elements);
1969
+ return makeTuple(SchemaAST.tuple(elements, options?.unsafePreserveChecks ? this.ast.checks : undefined), elements);
1870
1970
  }
1871
1971
  });
1872
1972
  }
@@ -1889,7 +1989,7 @@ function makeTuple(ast, elements) {
1889
1989
  * @since 3.10.0
1890
1990
  */
1891
1991
  export function Tuple(elements) {
1892
- return makeTuple(AST.tuple(elements), elements);
1992
+ return makeTuple(SchemaAST.tuple(elements), elements);
1893
1993
  }
1894
1994
  /**
1895
1995
  * Extends a fixed-length tuple schema with a variadic rest segment.
@@ -1922,7 +2022,7 @@ export function Tuple(elements) {
1922
2022
  * @since 4.0.0
1923
2023
  */
1924
2024
  export function TupleWithRest(schema, rest) {
1925
- return make(AST.tupleWithRest(schema.ast, rest.map(AST.getAST)), {
2025
+ return make(SchemaAST.tupleWithRest(schema.ast, rest.map(SchemaAST.getAST)), {
1926
2026
  schema,
1927
2027
  rest
1928
2028
  });
@@ -1931,7 +2031,7 @@ export function TupleWithRest(schema, rest) {
1931
2031
  * @category constructors
1932
2032
  * @since 4.0.0
1933
2033
  */
1934
- const ArraySchema = /*#__PURE__*/Struct_.lambda(schema => make(new AST.Arrays(false, [], [schema.ast]), {
2034
+ const ArraySchema = /*#__PURE__*/Struct_.lambda(schema => make(new SchemaAST.Arrays(false, [], [schema.ast]), {
1935
2035
  value: schema
1936
2036
  }));
1937
2037
  export {
@@ -1972,7 +2072,7 @@ ArraySchema as Array };
1972
2072
  * @category constructors
1973
2073
  * @since 3.10.0
1974
2074
  */
1975
- export const NonEmptyArray = /*#__PURE__*/Struct_.lambda(schema => make(new AST.Arrays(false, [schema.ast], [schema.ast]), {
2075
+ export const NonEmptyArray = /*#__PURE__*/Struct_.lambda(schema => make(new SchemaAST.Arrays(false, [schema.ast], [schema.ast]), {
1976
2076
  value: schema
1977
2077
  }));
1978
2078
  /**
@@ -2002,7 +2102,7 @@ export const NonEmptyArray = /*#__PURE__*/Struct_.lambda(schema => make(new AST.
2002
2102
  * @since 3.10.0
2003
2103
  */
2004
2104
  export function ArrayEnsure(schema) {
2005
- return Union([schema, ArraySchema(schema)]).pipe(decodeTo(ArraySchema(toType(schema)), Transformation.transform({
2105
+ return Union([schema, ArraySchema(schema)]).pipe(decodeTo(ArraySchema(toType(schema)), SchemaTransformation.transform({
2006
2106
  decode: Arr.ensure,
2007
2107
  encode: array => array.length === 1 ? array[0] : array
2008
2108
  })));
@@ -2039,7 +2139,7 @@ export function UniqueArray(item) {
2039
2139
  * @since 3.10.0
2040
2140
  */
2041
2141
  export const mutable = /*#__PURE__*/Struct_.lambda(schema => {
2042
- return make(new AST.Arrays(true, schema.ast.elements, schema.ast.rest), {
2142
+ return make(new SchemaAST.Arrays(true, schema.ast.elements, schema.ast.rest), {
2043
2143
  schema
2044
2144
  });
2045
2145
  });
@@ -2048,7 +2148,7 @@ function makeUnion(ast, members) {
2048
2148
  members,
2049
2149
  mapMembers(f, options) {
2050
2150
  const members = f(this.members);
2051
- return makeUnion(AST.union(members, this.ast.mode, options?.unsafePreserveChecks ? this.ast.checks : undefined), members);
2151
+ return makeUnion(SchemaAST.union(members, this.ast.mode, options?.unsafePreserveChecks ? this.ast.checks : undefined), members);
2052
2152
  }
2053
2153
  });
2054
2154
  }
@@ -2077,7 +2177,7 @@ function makeUnion(ast, members) {
2077
2177
  * @since 3.10.0
2078
2178
  */
2079
2179
  export function Union(members, options) {
2080
- return makeUnion(AST.union(members, options?.mode ?? "anyOf", undefined), members);
2180
+ return makeUnion(SchemaAST.union(members, options?.mode ?? "anyOf", undefined), members);
2081
2181
  }
2082
2182
  /**
2083
2183
  * Creates a union schema from an array of literal values.
@@ -2097,7 +2197,7 @@ export function Union(members, options) {
2097
2197
  */
2098
2198
  export function Literals(literals) {
2099
2199
  const members = literals.map(Literal);
2100
- return make(AST.union(members, "anyOf", undefined), {
2200
+ return make(SchemaAST.union(members, "anyOf", undefined), {
2101
2201
  literals,
2102
2202
  members,
2103
2203
  mapMembers(f) {
@@ -2157,7 +2257,7 @@ export const NullishOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Null,
2157
2257
  * @since 3.10.0
2158
2258
  */
2159
2259
  export function suspend(f) {
2160
- return make(new AST.Suspend(() => f().ast));
2260
+ return make(new SchemaAST.Suspend(() => f().ast));
2161
2261
  }
2162
2262
  /**
2163
2263
  * Attaches one or more filter checks to a schema without changing the
@@ -2195,7 +2295,7 @@ export function check(...checks) {
2195
2295
  * @since 3.10.0
2196
2296
  */
2197
2297
  export function refine(refinement, annotations) {
2198
- return schema => make(AST.appendChecks(schema.ast, [AST.makeFilterByGuard(refinement, annotations)]), {
2298
+ return schema => make(SchemaAST.appendChecks(schema.ast, [SchemaAST.makeFilterByGuard(refinement, annotations)]), {
2199
2299
  schema
2200
2300
  });
2201
2301
  }
@@ -2219,7 +2319,7 @@ export function refine(refinement, annotations) {
2219
2319
  * @since 3.10.0
2220
2320
  */
2221
2321
  export function brand(identifier) {
2222
- return schema => make(AST.brand(schema.ast, identifier), {
2322
+ return schema => make(SchemaAST.brand(schema.ast, identifier), {
2223
2323
  schema,
2224
2324
  identifier
2225
2325
  });
@@ -2262,7 +2362,7 @@ export function fromBrand(identifier, ctor) {
2262
2362
  * @since 4.0.0
2263
2363
  */
2264
2364
  export function middlewareDecoding(decode) {
2265
- return schema => make(AST.middlewareDecoding(schema.ast, new Transformation.Middleware(decode, identity)), {
2365
+ return schema => make(SchemaAST.middlewareDecoding(schema.ast, new SchemaTransformation.Middleware(decode, identity)), {
2266
2366
  schema
2267
2367
  });
2268
2368
  }
@@ -2292,7 +2392,7 @@ export function middlewareDecoding(decode) {
2292
2392
  * @since 4.0.0
2293
2393
  */
2294
2394
  export function middlewareEncoding(encode) {
2295
- return schema => make(AST.middlewareEncoding(schema.ast, new Transformation.Middleware(identity, encode)), {
2395
+ return schema => make(SchemaAST.middlewareEncoding(schema.ast, new SchemaTransformation.Middleware(identity, encode)), {
2296
2396
  schema
2297
2397
  });
2298
2398
  }
@@ -2326,7 +2426,8 @@ export function catchDecoding(f) {
2326
2426
  *
2327
2427
  * **When to use**
2328
2428
  *
2329
- * Use when decoding fallback logic needs services from the Effect context.
2429
+ * Use when you need decoding fallback logic to require services from the Effect
2430
+ * context.
2330
2431
  *
2331
2432
  * **Details**
2332
2433
  *
@@ -2363,7 +2464,8 @@ export function catchEncoding(f) {
2363
2464
  *
2364
2465
  * **When to use**
2365
2466
  *
2366
- * Use when encoding fallback logic needs services from the Effect context.
2467
+ * Use when you need encoding fallback logic to require services from the Effect
2468
+ * context.
2367
2469
  *
2368
2470
  * **Details**
2369
2471
  *
@@ -2382,7 +2484,7 @@ export function catchEncodingWithContext(f) {
2382
2484
  }
2383
2485
  export function decodeTo(to, transformation) {
2384
2486
  return from => {
2385
- return make(AST.decodeTo(from.ast, to.ast, transformation ? Transformation.make(transformation) : Transformation.passthrough()), {
2487
+ return make(SchemaAST.decodeTo(from.ast, to.ast, transformation ? SchemaTransformation.make(transformation) : SchemaTransformation.passthrough()), {
2386
2488
  from,
2387
2489
  to
2388
2490
  });
@@ -2391,23 +2493,26 @@ export function decodeTo(to, transformation) {
2391
2493
  /**
2392
2494
  * Applies a transformation to a schema, creating a new schema with the same type but transformed encoding/decoding.
2393
2495
  *
2496
+ * **When to use**
2497
+ *
2498
+ * Use when the decoded type stays the same and the transformation only
2499
+ * normalizes values during encoding and decoding.
2500
+ *
2394
2501
  * **Details**
2395
2502
  *
2396
- * This is a curried function: call it with a transformation object, then call the returned function with a schema.
2397
- * The resulting schema has `Type = S["Type"]` and `Encoded = S["Encoded"]`, with the transformation applied during
2398
- * encoding and decoding operations.
2503
+ * Call it with a transformation object and then pipe a schema into the returned
2504
+ * function. The resulting schema keeps the same `Type` and `Encoded` types as
2505
+ * the source schema, while applying the transformation during both decoding and
2506
+ * encoding.
2507
+ *
2508
+ * Internally this uses `toType(self)` as the target schema and combines service
2509
+ * requirements from the source schema and the transformation.
2399
2510
  *
2400
- * Key guarantees:
2401
- * - Resulting schema has `Type = S["Type"]` and `Encoded = S["Encoded"]`
2402
- * - Uses `toType(self)` as the target schema internally (creates a schema where both Type and Encoded are `S["Type"]`)
2403
- * - Combines decoding/encoding services from the source schema and transformation
2404
- * - Transformation `decode` maps `S["Type"]` → `S["Type"]` (used during encoding)
2405
- * - Transformation `encode` maps `S["Type"]` → `S["Type"]` (used during decoding)
2511
+ * **Gotchas**
2406
2512
  *
2407
- * Common mistakes:
2408
- * - **Currying**: This is curried - must use pipe: `schema.pipe(Schema.decode(transformation))`
2409
- * - **Transformation direction**: `decode` and `encode` both operate on `S["Type"]` (same type, different values)
2410
- * - **Service dependencies**: Resulting schema requires services from the source schema and transformation; use `Schema.provideService` if needed
2513
+ * Use {@link decodeTo} instead when the transformation should change the
2514
+ * decoded type. For this helper, both transformation getters operate on
2515
+ * `S["Type"]` values.
2411
2516
  *
2412
2517
  * **Example** (Trimming string values during encoding/decoding)
2413
2518
  *
@@ -2499,7 +2604,7 @@ export function withConstructorDefault(
2499
2604
  // `S["~type.make.in"]` instead of `S["Type"]` is intentional here because
2500
2605
  // it makes easier to define the default value if there are nested defaults
2501
2606
  defaultValue) {
2502
- return schema => make(AST.withConstructorDefault(schema.ast, Effect.mapErrorEager(defaultValue, e => e.issue)), {
2607
+ return schema => make(SchemaAST.withConstructorDefault(schema.ast, Effect.mapErrorEager(defaultValue, e => e.issue)), {
2503
2608
  schema
2504
2609
  });
2505
2610
  }
@@ -2538,10 +2643,10 @@ defaultValue) {
2538
2643
  * @since 4.0.0
2539
2644
  */
2540
2645
  export function withDecodingDefaultKey(defaultValue, options) {
2541
- const encode = options?.encodingStrategy === "omit" ? Getter.omit() : Getter.passthrough();
2646
+ const encode = options?.encodingStrategy === "omit" ? SchemaGetter.omit() : SchemaGetter.passthrough();
2542
2647
  return self => {
2543
2648
  return optionalKey(toEncoded(self)).pipe(decodeTo(self, {
2544
- decode: Getter.withDefault(Effect.mapErrorEager(defaultValue, e => e.issue)),
2649
+ decode: SchemaGetter.withDefault(Effect.mapErrorEager(defaultValue, e => e.issue)),
2545
2650
  encode
2546
2651
  }));
2547
2652
  };
@@ -2578,6 +2683,11 @@ export function withDecodingDefaultTypeKey(defaultValue, options) {
2578
2683
  * and provides a default `Encoded` value when the field is missing or
2579
2684
  * `undefined` during decoding.
2580
2685
  *
2686
+ * **When to use**
2687
+ *
2688
+ * Use when the default is expressed in the encoded representation, before the
2689
+ * field's decoding transformation runs.
2690
+ *
2581
2691
  * **Details**
2582
2692
  *
2583
2693
  * The default value is specified in terms of the `Encoded` type (before any
@@ -2608,10 +2718,10 @@ export function withDecodingDefaultTypeKey(defaultValue, options) {
2608
2718
  * @since 3.10.0
2609
2719
  */
2610
2720
  export function withDecodingDefault(defaultValue, options) {
2611
- const encode = options?.encodingStrategy === "omit" ? Getter.omit() : Getter.passthrough();
2721
+ const encode = options?.encodingStrategy === "omit" ? SchemaGetter.omit() : SchemaGetter.passthrough();
2612
2722
  return self => {
2613
2723
  return optional(toEncoded(self)).pipe(decodeTo(self, {
2614
- decode: Getter.withDefault(Effect.mapErrorEager(defaultValue, e => e.issue)),
2724
+ decode: SchemaGetter.withDefault(Effect.mapErrorEager(defaultValue, e => e.issue)),
2615
2725
  encode
2616
2726
  }));
2617
2727
  };
@@ -2621,6 +2731,11 @@ export function withDecodingDefault(defaultValue, options) {
2621
2731
  * and provides a default `Type` value when the field is missing or
2622
2732
  * `undefined` during decoding.
2623
2733
  *
2734
+ * **When to use**
2735
+ *
2736
+ * Use when the default is already in the decoded representation and should not
2737
+ * pass through the field's decoding transformation.
2738
+ *
2624
2739
  * **Details**
2625
2740
  *
2626
2741
  * Unlike {@link withDecodingDefault}, the default value is specified in terms
@@ -2795,10 +2910,10 @@ export function toTaggedUnion(tag) {
2795
2910
  });
2796
2911
  function walk(schema) {
2797
2912
  const ast = schema.ast;
2798
- if (AST.isUnion(ast) && "members" in schema && globalThis.Array.isArray(schema.members) && schema.members.every(isSchema)) {
2913
+ if (SchemaAST.isUnion(ast) && "members" in schema && globalThis.Array.isArray(schema.members) && schema.members.every(isSchema)) {
2799
2914
  return schema.members.forEach(walk);
2800
2915
  }
2801
- const sentinels = AST.collectSentinels(ast);
2916
+ const sentinels = SchemaAST.collectSentinels(ast);
2802
2917
  if (sentinels.length > 0) {
2803
2918
  const literal = sentinels.find(s => s.key === tag)?.literal;
2804
2919
  if (Predicate.isPropertyKey(literal)) {
@@ -2920,7 +3035,7 @@ export function instanceOf(constructor, annotations) {
2920
3035
  return declare(u => u instanceof constructor, annotations);
2921
3036
  }
2922
3037
  /**
2923
- * Constructs an `AST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
3038
+ * Constructs an `SchemaAST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
2924
3039
  * Used when building low-level AST transformations that bridge two schema types.
2925
3040
  *
2926
3041
  * @category transforming
@@ -2928,7 +3043,7 @@ export function instanceOf(constructor, annotations) {
2928
3043
  */
2929
3044
  export function link() {
2930
3045
  return (encodeTo, transformation) => {
2931
- return new AST.Link(encodeTo.ast, Transformation.make(transformation));
3046
+ return new SchemaAST.Link(encodeTo.ast, SchemaTransformation.make(transformation));
2932
3047
  };
2933
3048
  }
2934
3049
  // -----------------------------------------------------------------------------
@@ -2989,19 +3104,19 @@ export function link() {
2989
3104
  * // at ["c"])]))
2990
3105
  * ```
2991
3106
  *
2992
- * @category Checks Constructors
3107
+ * @category constructors
2993
3108
  * @since 4.0.0
2994
3109
  */
2995
- export const makeFilter = AST.makeFilter;
3110
+ export const makeFilter = SchemaAST.makeFilter;
2996
3111
  /**
2997
- * Groups multiple checks into a single {@link AST.FilterGroup}, applying
3112
+ * Groups multiple checks into a single {@link SchemaAST.FilterGroup}, applying
2998
3113
  * optional shared annotations to the group as a whole.
2999
3114
  *
3000
- * @category Checks Constructors
3115
+ * @category constructors
3001
3116
  * @since 4.0.0
3002
3117
  */
3003
3118
  export function makeFilterGroup(checks, annotations = undefined) {
3004
- return new AST.FilterGroup(checks, annotations);
3119
+ return new SchemaAST.FilterGroup(checks, annotations);
3005
3120
  }
3006
3121
  const TRIMMED_PATTERN = "^\\S[\\s\\S]*\\S$|^\\S$|^$";
3007
3122
  /**
@@ -3054,7 +3169,7 @@ export function isTrimmed(annotations) {
3054
3169
  * @category String checks
3055
3170
  * @since 4.0.0
3056
3171
  */
3057
- export const isPattern = AST.isPattern;
3172
+ export const isPattern = SchemaAST.isPattern;
3058
3173
  /**
3059
3174
  * Validates that a string represents a finite number.
3060
3175
  *
@@ -3073,7 +3188,7 @@ export const isPattern = AST.isPattern;
3073
3188
  * @category String checks
3074
3189
  * @since 4.0.0
3075
3190
  */
3076
- export const isStringFinite = AST.isStringFinite;
3191
+ export const isStringFinite = SchemaAST.isStringFinite;
3077
3192
  /**
3078
3193
  * Validates that a string is a signed base-10 integer literal for Effect's
3079
3194
  * BigInt string encoding.
@@ -3091,7 +3206,7 @@ export const isStringFinite = AST.isStringFinite;
3091
3206
  * @category String checks
3092
3207
  * @since 4.0.0
3093
3208
  */
3094
- export const isStringBigInt = AST.isStringBigInt;
3209
+ export const isStringBigInt = SchemaAST.isStringBigInt;
3095
3210
  /**
3096
3211
  * Validates that a string has the `Symbol(description)` format used by Effect's
3097
3212
  * symbol string encoding.
@@ -3104,7 +3219,7 @@ export const isStringBigInt = AST.isStringBigInt;
3104
3219
  * @category String checks
3105
3220
  * @since 4.0.0
3106
3221
  */
3107
- export const isStringSymbol = AST.isStringSymbol;
3222
+ export const isStringSymbol = SchemaAST.isStringSymbol;
3108
3223
  /**
3109
3224
  * Returns a RegExp for validating an RFC 4122 UUID.
3110
3225
  *
@@ -3836,7 +3951,7 @@ export function isInt(annotations) {
3836
3951
  * @since 4.0.0
3837
3952
  */
3838
3953
  export function isInt32(annotations) {
3839
- return new AST.FilterGroup([isInt(annotations), isBetween({
3954
+ return new SchemaAST.FilterGroup([isInt(annotations), isBetween({
3840
3955
  minimum: -2147483648,
3841
3956
  maximum: 2147483647
3842
3957
  })], {
@@ -3864,7 +3979,7 @@ export function isInt32(annotations) {
3864
3979
  * @since 4.0.0
3865
3980
  */
3866
3981
  export function isUint32(annotations) {
3867
- return new AST.FilterGroup([isInt(), isBetween({
3982
+ return new SchemaAST.FilterGroup([isInt(), isBetween({
3868
3983
  minimum: 0,
3869
3984
  maximum: 4294967295
3870
3985
  })], {
@@ -4306,7 +4421,7 @@ export function isMinLength(minLength, annotations) {
4306
4421
  _tag: "isMinLength",
4307
4422
  minLength
4308
4423
  },
4309
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4424
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4310
4425
  toArbitraryConstraint: {
4311
4426
  string: {
4312
4427
  minLength
@@ -4368,7 +4483,7 @@ export function isMaxLength(maxLength, annotations) {
4368
4483
  _tag: "isMaxLength",
4369
4484
  maxLength
4370
4485
  },
4371
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4486
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4372
4487
  toArbitraryConstraint: {
4373
4488
  string: {
4374
4489
  maxLength
@@ -4410,7 +4525,7 @@ export function isLengthBetween(minimum, maximum, annotations) {
4410
4525
  minimum,
4411
4526
  maximum
4412
4527
  },
4413
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4528
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4414
4529
  toArbitraryConstraint: {
4415
4530
  string: {
4416
4531
  minLength: minimum,
@@ -4452,7 +4567,7 @@ export function isMinSize(minSize, annotations) {
4452
4567
  _tag: "isMinSize",
4453
4568
  minSize
4454
4569
  },
4455
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4570
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4456
4571
  toArbitraryConstraint: {
4457
4572
  array: {
4458
4573
  minLength: minSize
@@ -4489,7 +4604,7 @@ export function isMaxSize(maxSize, annotations) {
4489
4604
  _tag: "isMaxSize",
4490
4605
  maxSize
4491
4606
  },
4492
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4607
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4493
4608
  toArbitraryConstraint: {
4494
4609
  array: {
4495
4610
  maxLength: maxSize
@@ -4528,7 +4643,7 @@ export function isSizeBetween(minimum, maximum, annotations) {
4528
4643
  minimum,
4529
4644
  maximum
4530
4645
  },
4531
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4646
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4532
4647
  toArbitraryConstraint: {
4533
4648
  array: {
4534
4649
  minLength: minimum,
@@ -4567,7 +4682,7 @@ export function isMinProperties(minProperties, annotations) {
4567
4682
  _tag: "isMinProperties",
4568
4683
  minProperties
4569
4684
  },
4570
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4685
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4571
4686
  toArbitraryConstraint: {
4572
4687
  array: {
4573
4688
  minLength: minProperties
@@ -4604,7 +4719,7 @@ export function isMaxProperties(maxProperties, annotations) {
4604
4719
  _tag: "isMaxProperties",
4605
4720
  maxProperties
4606
4721
  },
4607
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4722
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4608
4723
  toArbitraryConstraint: {
4609
4724
  array: {
4610
4725
  maxLength: maxProperties
@@ -4643,7 +4758,7 @@ export function isPropertiesLengthBetween(minimum, maximum, annotations) {
4643
4758
  minimum,
4644
4759
  maximum
4645
4760
  },
4646
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4761
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4647
4762
  toArbitraryConstraint: {
4648
4763
  array: {
4649
4764
  minLength: minimum,
@@ -4671,19 +4786,19 @@ export function isPropertiesLengthBetween(minimum, maximum, annotations) {
4671
4786
  */
4672
4787
  export function isPropertyNames(keySchema, annotations) {
4673
4788
  const propertyNames = toEncoded(keySchema);
4674
- const parser = Parser._issue(propertyNames.ast);
4789
+ const parser = SchemaParser._issue(propertyNames.ast);
4675
4790
  return makeFilter((input, ast, options) => {
4676
4791
  const keys = Reflect.ownKeys(input);
4677
4792
  const issues = [];
4678
4793
  for (const key of keys) {
4679
4794
  const issue = parser(key, options);
4680
4795
  if (issue !== undefined) {
4681
- issues.push(new Issue.Pointer([key], issue));
4796
+ issues.push(new SchemaIssue.Pointer([key], issue));
4682
4797
  if (options.errors === "first") break;
4683
4798
  }
4684
4799
  }
4685
4800
  if (Arr.isArrayNonEmpty(issues)) {
4686
- return new Issue.Composite(ast, Option_.some(input), issues);
4801
+ return new SchemaIssue.Composite(ast, Option_.some(input), issues);
4687
4802
  }
4688
4803
  return true;
4689
4804
  }, {
@@ -4692,7 +4807,7 @@ export function isPropertyNames(keySchema, annotations) {
4692
4807
  _tag: "isPropertyNames",
4693
4808
  propertyNames: propertyNames.ast
4694
4809
  },
4695
- [AST.STRUCTURAL_ANNOTATION_KEY]: true,
4810
+ [SchemaAST.STRUCTURAL_ANNOTATION_KEY]: true,
4696
4811
  ...annotations
4697
4812
  });
4698
4813
  }
@@ -4730,7 +4845,7 @@ export function isUnique(annotations) {
4730
4845
  * Schema for non-empty strings. Validates that a string has at least one
4731
4846
  * character.
4732
4847
  *
4733
- * @category String
4848
+ * @category string
4734
4849
  * @since 3.10.0
4735
4850
  */
4736
4851
  export const NonEmptyString = /*#__PURE__*/String.check(/*#__PURE__*/isNonEmpty());
@@ -4750,7 +4865,7 @@ export const NonEmptyString = /*#__PURE__*/String.check(/*#__PURE__*/isNonEmpty(
4750
4865
  * @see {@link NonEmptyString} for strings with length greater than zero
4751
4866
  * @see {@link isLengthBetween} for the underlying length check
4752
4867
  *
4753
- * @category String
4868
+ * @category string
4754
4869
  * @since 3.10.0
4755
4870
  */
4756
4871
  export const Char = /*#__PURE__*/String.check(/*#__PURE__*/isLengthBetween(1, 1));
@@ -4766,12 +4881,12 @@ export function Option(value) {
4766
4881
  if (Option_.isNone(input)) {
4767
4882
  return Effect.succeedNone;
4768
4883
  }
4769
- return Effect.mapBothEager(Parser.decodeUnknownEffect(value)(input.value, options), {
4884
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(value)(input.value, options), {
4770
4885
  onSuccess: Option_.some,
4771
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["value"], issue)])
4886
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["value"], issue)])
4772
4887
  });
4773
4888
  }
4774
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
4889
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
4775
4890
  }, {
4776
4891
  typeConstructor: {
4777
4892
  _tag: "effect/Option"
@@ -4787,7 +4902,7 @@ export function Option(value) {
4787
4902
  value
4788
4903
  }), Struct({
4789
4904
  _tag: Literal("None")
4790
- })]), Transformation.transform({
4905
+ })]), SchemaTransformation.transform({
4791
4906
  decode: e => e._tag === "None" ? Option_.none() : Option_.some(e.value),
4792
4907
  encode: o => Option_.isSome(o) ? {
4793
4908
  _tag: "Some",
@@ -4817,97 +4932,75 @@ export function Option(value) {
4817
4932
  *
4818
4933
  * **Details**
4819
4934
  *
4820
- * Decoding:
4821
- * - `null` is decoded as `None`
4822
- * - other values are decoded as `Some`
4823
- *
4824
- * Encoding:
4825
- * - `None` is encoded as `null`
4826
- * - `Some` is encoded as the value
4935
+ * Decoding maps `null` to `None` and all other values to `Some`. Encoding maps
4936
+ * `None` to `null` and maps `Some` to its value.
4827
4937
  *
4828
4938
  * @category Option
4829
4939
  * @since 3.10.0
4830
4940
  */
4831
4941
  export function OptionFromNullOr(schema) {
4832
- return NullOr(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromNullOr()));
4942
+ return NullOr(schema).pipe(decodeTo(Option(toType(schema)), SchemaTransformation.optionFromNullOr()));
4833
4943
  }
4834
4944
  /**
4835
- * Decodes an undefined-or value `T` to a required `Option<T>` value.
4945
+ * Decodes a required value that may be `undefined` to a required `Option<T>`
4946
+ * value.
4836
4947
  *
4837
4948
  * **Details**
4838
4949
  *
4839
- * Decoding:
4840
- * - `undefined` is decoded as `None`
4841
- * - other values are decoded as `Some`
4842
- *
4843
- * Encoding:
4844
- * - `None` is encoded as `undefined`
4845
- * - `Some` is encoded as the value
4950
+ * Decoding maps `undefined` to `None` and all other values to `Some`. Encoding
4951
+ * maps `None` to `undefined` and maps `Some` to its value.
4846
4952
  *
4847
4953
  * @category Option
4848
4954
  * @since 3.10.0
4849
4955
  */
4850
4956
  export function OptionFromUndefinedOr(schema) {
4851
- return UndefinedOr(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromUndefinedOr()));
4957
+ return UndefinedOr(schema).pipe(decodeTo(Option(toType(schema)), SchemaTransformation.optionFromUndefinedOr()));
4852
4958
  }
4853
4959
  /**
4854
4960
  * Decodes a nullish value `T` to a required `Option<T>` value.
4855
4961
  *
4856
4962
  * **Details**
4857
4963
  *
4858
- * Decoding:
4859
- * - `null` and `undefined` are decoded as `None`
4860
- * - other values are decoded as `Some`
4861
- *
4862
- * Encoding:
4863
- * - `None` is encoded as `null` or `undefined` depending on the provided `options.onNoneEncoding` (defaults to `undefined`)
4864
- * - `Some` is encoded as the value
4964
+ * Decoding maps `null` and `undefined` to `None` and all other values to
4965
+ * `Some`. Encoding maps `None` to `null` or `undefined` depending on
4966
+ * `options.onNoneEncoding`, which defaults to `undefined`, and maps `Some` to
4967
+ * its value.
4865
4968
  *
4866
4969
  * @category Option
4867
4970
  * @since 3.10.0
4868
4971
  */
4869
4972
  export function OptionFromNullishOr(schema, options) {
4870
- return NullishOr(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromNullishOr(options)));
4973
+ return NullishOr(schema).pipe(decodeTo(Option(toType(schema)), SchemaTransformation.optionFromNullishOr(options)));
4871
4974
  }
4872
4975
  /**
4873
4976
  * Decodes an optional value `A` to a required `Option<A>` value.
4874
4977
  *
4875
4978
  * **Details**
4876
4979
  *
4877
- * Decoding:
4878
- * - a missing key is decoded as `None`
4879
- * - a present value is decoded as `Some`
4880
- *
4881
- * Encoding:
4882
- * - `None` is encoded as missing key
4883
- * - `Some` is encoded as the value
4980
+ * Decoding maps a missing key to `None` and a present value to `Some`.
4981
+ * Encoding maps `None` to a missing key and maps `Some` to its value.
4884
4982
  *
4885
4983
  * @category Option
4886
4984
  * @since 4.0.0
4887
4985
  */
4888
4986
  export function OptionFromOptionalKey(schema) {
4889
- return optionalKey(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromOptionalKey()));
4987
+ return optionalKey(schema).pipe(decodeTo(Option(toType(schema)), SchemaTransformation.optionFromOptionalKey()));
4890
4988
  }
4891
4989
  /**
4892
- * Decodes an optional or `undefined` value `A` to an required `Option<A>`
4990
+ * Decodes an optional or `undefined` value `A` to a required `Option<A>`
4893
4991
  * value.
4894
4992
  *
4895
4993
  * **Details**
4896
4994
  *
4897
- * Decoding:
4898
- * - a missing key is decoded as `None`
4899
- * - a present key with an `undefined` value is decoded as `None`
4900
- * - all other values are decoded as `Some`
4901
- *
4902
- * Encoding:
4903
- * - `None` is encoded as missing key
4904
- * - `Some` is encoded as the value
4995
+ * Decoding maps a missing key or a present `undefined` value to `None`, and
4996
+ * maps all other values to `Some`. Encoding maps `None` to a missing key and
4997
+ * maps `Some` to its value.
4905
4998
  *
4906
4999
  * @category Option
4907
5000
  * @since 4.0.0
4908
5001
  */
4909
5002
  export function OptionFromOptional(schema) {
4910
- return optional(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromOptional()));
5003
+ return optional(schema).pipe(decodeTo(Option(toType(schema)), SchemaTransformation.optionFromOptional()));
4911
5004
  }
4912
5005
  /**
4913
5006
  * Decodes an optional or `null` or `undefined` value `A` to a required `Option<A>`
@@ -4915,17 +5008,10 @@ export function OptionFromOptional(schema) {
4915
5008
  *
4916
5009
  * **Details**
4917
5010
  *
4918
- * Decoding:
4919
- * - a missing key is decoded as `None`
4920
- * - a present key with an `undefined` value is decoded as `None`
4921
- * - a present key with a `null` value is decoded as `None`
4922
- * - all other values are decoded as `Some`
4923
- *
4924
- * Encoding (controlled by `options.onNoneEncoding`):
4925
- * - `"omit"` (default): `None` is encoded as a missing key
4926
- * - `null`: `None` is encoded as `null`
4927
- * - `undefined`: `None` is encoded as `undefined`
4928
- * - `Some` is always encoded as the value
5011
+ * Decoding maps a missing key, `undefined`, or `null` to `None`, and maps all
5012
+ * other values to `Some`. Encoding maps `Some` to its value. `None` is encoded
5013
+ * according to `options.onNoneEncoding`: `"omit"` encodes a missing key,
5014
+ * `null` encodes `null`, and `undefined` encodes `undefined`.
4929
5015
  *
4930
5016
  * @category Option
4931
5017
  * @since 4.0.0
@@ -4933,7 +5019,7 @@ export function OptionFromOptional(schema) {
4933
5019
  export function OptionFromOptionalNullOr(schema, options) {
4934
5020
  const onNoneEncoding = options === undefined ? "omit" : options.onNoneEncoding;
4935
5021
  const noneValue = onNoneEncoding === null ? null : undefined;
4936
- return optional(NullOr(schema)).pipe(decodeTo(Option(toType(schema)), Transformation.transformOptional({
5022
+ return optional(NullOr(schema)).pipe(decodeTo(Option(toType(schema)), SchemaTransformation.transformOptional({
4937
5023
  decode: oe => oe.pipe(Option_.filter(Predicate.isNotNullish), Option_.some),
4938
5024
  encode: onNoneEncoding === "omit" ? Option_.flatten : ot => Option_.some(Option_.getOrElse(Option_.flatten(ot), () => noneValue))
4939
5025
  })));
@@ -4947,18 +5033,18 @@ export function OptionFromOptionalNullOr(schema, options) {
4947
5033
  export function Result(success, failure) {
4948
5034
  const schema = declareConstructor()([success, failure], ([success, failure]) => (input, ast, options) => {
4949
5035
  if (!Result_.isResult(input)) {
4950
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5036
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
4951
5037
  }
4952
5038
  switch (input._tag) {
4953
5039
  case "Success":
4954
- return Effect.mapBothEager(Parser.decodeEffect(success)(input.success, options), {
5040
+ return Effect.mapBothEager(SchemaParser.decodeEffect(success)(input.success, options), {
4955
5041
  onSuccess: Result_.succeed,
4956
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["success"], issue)])
5042
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["success"], issue)])
4957
5043
  });
4958
5044
  case "Failure":
4959
- return Effect.mapBothEager(Parser.decodeEffect(failure)(input.failure, options), {
5045
+ return Effect.mapBothEager(SchemaParser.decodeEffect(failure)(input.failure, options), {
4960
5046
  onSuccess: Result_.fail,
4961
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["failure"], issue)])
5047
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["failure"], issue)])
4962
5048
  });
4963
5049
  }
4964
5050
  }, {
@@ -4977,7 +5063,7 @@ export function Result(success, failure) {
4977
5063
  }), Struct({
4978
5064
  _tag: Literal("Failure"),
4979
5065
  failure
4980
- })]), Transformation.transform({
5066
+ })]), SchemaTransformation.transform({
4981
5067
  decode: e => e._tag === "Success" ? Result_.succeed(e.success) : Result_.fail(e.failure),
4982
5068
  encode: r => Result_.isSuccess(r) ? {
4983
5069
  _tag: "Success",
@@ -5028,35 +5114,36 @@ export function Result(success, failure) {
5028
5114
  * @since 3.10.0
5029
5115
  */
5030
5116
  export function Redacted(value, options) {
5031
- const decodeLabel = typeof options?.label === "string" ? Parser.decodeUnknownEffect(Literal(options.label)) : undefined;
5117
+ const decodeLabel = typeof options?.label === "string" ? SchemaParser.decodeUnknownEffect(Literal(options.label)) : undefined;
5032
5118
  const schema = declareConstructor()([value], ([value]) => (input, ast, poptions) => {
5033
5119
  if (Redacted_.isRedacted(input)) {
5034
- const label = decodeLabel !== undefined ? Effect.mapErrorEager(decodeLabel(input.label, poptions), issue => new Issue.Pointer(["label"], issue)) : Effect.void;
5035
- return Effect.flatMapEager(label, () => Effect.mapBothEager(Parser.decodeUnknownEffect(value)(Redacted_.value(input), poptions), {
5120
+ const label = decodeLabel !== undefined ? Effect.mapErrorEager(decodeLabel(input.label, poptions), issue => new SchemaIssue.Pointer(["label"], issue)) : Effect.void;
5121
+ return Effect.flatMapEager(label, () => Effect.mapBothEager(SchemaParser.decodeUnknownEffect(value)(Redacted_.value(input), poptions), {
5036
5122
  onSuccess: () => input,
5037
5123
  onFailure: (/** ignore the actual issue because of security reasons */
5038
5124
  ) => {
5039
5125
  const oinput = Option_.some(input);
5040
- return new Issue.Composite(ast, oinput, [new Issue.Pointer(["value"], new Issue.InvalidValue(oinput))]);
5126
+ return new SchemaIssue.Composite(ast, oinput, [new SchemaIssue.Pointer(["value"], new SchemaIssue.InvalidValue(oinput))]);
5041
5127
  }
5042
5128
  }));
5043
5129
  }
5044
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5130
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5045
5131
  }, {
5046
5132
  typeConstructor: {
5047
- _tag: "effect/Redacted"
5133
+ _tag: "effect/Redacted",
5134
+ options
5048
5135
  },
5049
5136
  generation: {
5050
- runtime: `Schema.Redacted(?)`,
5137
+ runtime: options !== undefined ? `Schema.Redacted(?, ${format(options)})` : `Schema.Redacted(?)`,
5051
5138
  Type: `Redacted.Redacted<?>`,
5052
5139
  importDeclaration: `import * as Redacted from "effect/Redacted"`
5053
5140
  },
5054
5141
  expected: "Redacted",
5055
5142
  toCodecJson: ([value]) => link()(redact(value), {
5056
- decode: Getter.transform(e => Redacted_.make(e, {
5143
+ decode: SchemaGetter.transform(e => Redacted_.make(e, {
5057
5144
  label: options?.label
5058
5145
  })),
5059
- encode: options?.disallowJsonEncode ? Getter.forbidden(oe => "Cannot serialize Redacted" + (Option_.isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : Getter.transform(Redacted_.value)
5146
+ encode: options?.disallowJsonEncode ? SchemaGetter.forbidden(oe => "Cannot serialize Redacted" + (Option_.isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : SchemaGetter.transform(Redacted_.value)
5060
5147
  }),
5061
5148
  toArbitrary: ([value]) => () => value.map(a => Redacted_.make(a, {
5062
5149
  label: options?.label
@@ -5076,7 +5163,7 @@ export function Redacted(value, options) {
5076
5163
  * @since 4.0.0
5077
5164
  */
5078
5165
  export function redact(schema) {
5079
- return schema.pipe(middlewareDecoding(Effect.mapErrorEager(Issue.redact)));
5166
+ return schema.pipe(middlewareDecoding(Effect.mapErrorEager(SchemaIssue.redact)));
5080
5167
  }
5081
5168
  /**
5082
5169
  * Decodes a value and wraps it in `Redacted<A>`. Unlike {@link Redacted} which
@@ -5091,10 +5178,10 @@ export function RedactedFromValue(value, options) {
5091
5178
  label: options?.label,
5092
5179
  disallowJsonEncode: options?.disallowEncode
5093
5180
  }), {
5094
- decode: Getter.transform(t => Redacted_.make(t, {
5181
+ decode: SchemaGetter.transform(t => Redacted_.make(t, {
5095
5182
  label: options?.label
5096
5183
  })),
5097
- encode: options?.disallowEncode ? Getter.forbidden(oe => "Cannot encode Redacted" + (Option_.isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : Getter.transform(Redacted_.value)
5184
+ encode: options?.disallowEncode ? SchemaGetter.forbidden(oe => "Cannot encode Redacted" + (Option_.isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : SchemaGetter.transform(Redacted_.value)
5098
5185
  }));
5099
5186
  }
5100
5187
  /**
@@ -5103,8 +5190,8 @@ export function RedactedFromValue(value, options) {
5103
5190
  *
5104
5191
  * **When to use**
5105
5192
  *
5106
- * Use to validate, transform, or serialize individual `Cause.Reason` values
5107
- * when typed failures and unexpected defects need separate schemas.
5193
+ * Use when serializing or decoding individual cause reasons separately from a
5194
+ * full failure cause, with distinct schemas for typed errors and defects.
5108
5195
  *
5109
5196
  * **Details**
5110
5197
  *
@@ -5120,18 +5207,18 @@ export function RedactedFromValue(value, options) {
5120
5207
  export function CauseReason(error, defect) {
5121
5208
  const schema = declareConstructor()([error, defect], ([error, defect]) => (input, ast, options) => {
5122
5209
  if (!Cause_.isReason(input)) {
5123
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5210
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5124
5211
  }
5125
5212
  switch (input._tag) {
5126
5213
  case "Fail":
5127
- return Effect.mapBothEager(Parser.decodeUnknownEffect(error)(input.error, options), {
5214
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(error)(input.error, options), {
5128
5215
  onSuccess: Cause_.makeFailReason,
5129
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["error"], issue)])
5216
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["error"], issue)])
5130
5217
  });
5131
5218
  case "Die":
5132
- return Effect.mapBothEager(Parser.decodeUnknownEffect(defect)(input.defect, options), {
5219
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(defect)(input.defect, options), {
5133
5220
  onSuccess: Cause_.makeDieReason,
5134
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["defect"], issue)])
5221
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["defect"], issue)])
5135
5222
  });
5136
5223
  case "Interrupt":
5137
5224
  return Effect.succeed(input);
@@ -5155,7 +5242,7 @@ export function CauseReason(error, defect) {
5155
5242
  }), Struct({
5156
5243
  _tag: Literal("Interrupt"),
5157
5244
  fiberId: UndefinedOr(Finite)
5158
- })]), Transformation.transform({
5245
+ })]), SchemaTransformation.transform({
5159
5246
  decode: e => {
5160
5247
  switch (e._tag) {
5161
5248
  case "Fail":
@@ -5238,11 +5325,11 @@ export function Cause(error, defect) {
5238
5325
  const failures = ArraySchema(CauseReason(error, defect));
5239
5326
  return (input, ast, options) => {
5240
5327
  if (!Cause_.isCause(input)) {
5241
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5328
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5242
5329
  }
5243
- return Effect.mapBothEager(Parser.decodeUnknownEffect(failures)(input.reasons, options), {
5330
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(failures)(input.reasons, options), {
5244
5331
  onSuccess: Cause_.fromReasons,
5245
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["failures"], issue)])
5332
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["failures"], issue)])
5246
5333
  });
5247
5334
  };
5248
5335
  }, {
@@ -5255,7 +5342,7 @@ export function Cause(error, defect) {
5255
5342
  importDeclaration: `import * as Cause from "effect/Cause"`
5256
5343
  },
5257
5344
  expected: "Cause",
5258
- toCodec: ([error, defect]) => link()(ArraySchema(CauseReason(error, defect)), Transformation.transform({
5345
+ toCodec: ([error, defect]) => link()(ArraySchema(CauseReason(error, defect)), SchemaTransformation.transform({
5259
5346
  decode: Cause_.fromReasons,
5260
5347
  encode: ({
5261
5348
  reasons: failures
@@ -5310,7 +5397,7 @@ export const Error = /*#__PURE__*/instanceOf(globalThis.Error, {
5310
5397
  Type: `globalThis.Error`
5311
5398
  },
5312
5399
  expected: "Error",
5313
- toCodecJson: () => link()(ErrorJsonEncoded, Transformation.errorFromErrorJsonEncoded()),
5400
+ toCodecJson: () => link()(ErrorJsonEncoded, SchemaTransformation.errorFromErrorJsonEncoded()),
5314
5401
  toArbitrary: () => fc => fc.string().map(message => new globalThis.Error(message))
5315
5402
  });
5316
5403
  /**
@@ -5335,12 +5422,12 @@ export const ErrorWithStack = /*#__PURE__*/instanceOf(globalThis.Error, {
5335
5422
  Type: `globalThis.Error`
5336
5423
  },
5337
5424
  expected: "Error",
5338
- toCodecJson: () => link()(ErrorJsonEncoded, Transformation.errorFromErrorJsonEncoded({
5425
+ toCodecJson: () => link()(ErrorJsonEncoded, SchemaTransformation.errorFromErrorJsonEncoded({
5339
5426
  includeStack: true
5340
5427
  })),
5341
5428
  toArbitrary: () => fc => fc.string().map(message => new globalThis.Error(message))
5342
5429
  });
5343
- const defectTransformation = /*#__PURE__*/new Transformation.Transformation(/*#__PURE__*/Getter.passthrough(), /*#__PURE__*/Getter.transform(u => {
5430
+ const defectTransformation = /*#__PURE__*/new SchemaTransformation.Transformation(/*#__PURE__*/SchemaGetter.passthrough(), /*#__PURE__*/SchemaGetter.transform(u => {
5344
5431
  try {
5345
5432
  return JSON.parse(JSON.stringify(u));
5346
5433
  } catch {
@@ -5360,7 +5447,7 @@ const defectTransformation = /*#__PURE__*/new Transformation.Transformation(/*#_
5360
5447
  * @category constructors
5361
5448
  * @since 3.10.0
5362
5449
  */
5363
- export const Defect = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#__PURE__*/decodeTo(Error, /*#__PURE__*/Transformation.errorFromErrorJsonEncoded())), /*#__PURE__*/Any.pipe(/*#__PURE__*/decodeTo(/*#__PURE__*/Unknown.annotate({
5450
+ export const Defect = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#__PURE__*/decodeTo(Error, /*#__PURE__*/SchemaTransformation.errorFromErrorJsonEncoded())), /*#__PURE__*/Any.pipe(/*#__PURE__*/decodeTo(/*#__PURE__*/Unknown.annotate({
5364
5451
  toCodecJson: () => link()(Any, defectTransformation),
5365
5452
  toArbitrary: () => fc => fc.json()
5366
5453
  }), defectTransformation))]);
@@ -5370,7 +5457,7 @@ export const Defect = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#
5370
5457
  * @category Defect
5371
5458
  * @since 4.0.0
5372
5459
  */
5373
- export const DefectWithStack = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#__PURE__*/decodeTo(ErrorWithStack, /*#__PURE__*/Transformation.errorFromErrorJsonEncoded({
5460
+ export const DefectWithStack = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#__PURE__*/decodeTo(ErrorWithStack, /*#__PURE__*/SchemaTransformation.errorFromErrorJsonEncoded({
5374
5461
  includeStack: true
5375
5462
  }))), /*#__PURE__*/Any.pipe(/*#__PURE__*/decodeTo(/*#__PURE__*/Unknown.annotate({
5376
5463
  toCodecJson: () => link()(Any, defectTransformation),
@@ -5380,6 +5467,11 @@ export const DefectWithStack = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded
5380
5467
  * Creates a schema for `Exit` values using schemas for the success value, typed
5381
5468
  * failure, and unexpected defect channels.
5382
5469
  *
5470
+ * **When to use**
5471
+ *
5472
+ * Use when serializing or validating an effect outcome where success, typed
5473
+ * failure, and defects each need their own schema.
5474
+ *
5383
5475
  * @category Exit
5384
5476
  * @since 3.10.0
5385
5477
  */
@@ -5388,18 +5480,18 @@ export function Exit(value, error, defect) {
5388
5480
  const cause = Cause(error, defect);
5389
5481
  return (input, ast, options) => {
5390
5482
  if (!Exit_.isExit(input)) {
5391
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5483
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5392
5484
  }
5393
5485
  switch (input._tag) {
5394
5486
  case "Success":
5395
- return Effect.mapBothEager(Parser.decodeUnknownEffect(value)(input.value, options), {
5487
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(value)(input.value, options), {
5396
5488
  onSuccess: Exit_.succeed,
5397
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["value"], issue)])
5489
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["value"], issue)])
5398
5490
  });
5399
5491
  case "Failure":
5400
- return Effect.mapBothEager(Parser.decodeUnknownEffect(cause)(input.cause, options), {
5492
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(cause)(input.cause, options), {
5401
5493
  onSuccess: Exit_.failCause,
5402
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["cause"], issue)])
5494
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["cause"], issue)])
5403
5495
  });
5404
5496
  }
5405
5497
  };
@@ -5419,7 +5511,7 @@ export function Exit(value, error, defect) {
5419
5511
  }), Struct({
5420
5512
  _tag: Literal("Failure"),
5421
5513
  cause: Cause(error, defect)
5422
- })]), Transformation.transform({
5514
+ })]), SchemaTransformation.transform({
5423
5515
  decode: e => e._tag === "Success" ? Exit_.succeed(e.value) : Exit_.failCause(e.cause),
5424
5516
  encode: exit => Exit_.isSuccess(exit) ? {
5425
5517
  _tag: "Success",
@@ -5475,12 +5567,12 @@ export function ReadonlyMap(key, value) {
5475
5567
  const array = ArraySchema(Tuple([key, value]));
5476
5568
  return (input, ast, options) => {
5477
5569
  if (input instanceof globalThis.Map) {
5478
- return Effect.mapBothEager(Parser.decodeUnknownEffect(array)([...input], options), {
5570
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(array)([...input], options), {
5479
5571
  onSuccess: array => new globalThis.Map(array),
5480
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["entries"], issue)])
5572
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["entries"], issue)])
5481
5573
  });
5482
5574
  }
5483
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5575
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5484
5576
  };
5485
5577
  }, {
5486
5578
  typeConstructor: {
@@ -5491,7 +5583,7 @@ export function ReadonlyMap(key, value) {
5491
5583
  Type: `globalThis.ReadonlyMap<?, ?>`
5492
5584
  },
5493
5585
  expected: "ReadonlyMap",
5494
- toCodec: ([key, value]) => link()(ArraySchema(Tuple([key, value])), Transformation.transform({
5586
+ toCodec: ([key, value]) => link()(ArraySchema(Tuple([key, value])), SchemaTransformation.transform({
5495
5587
  decode: e => new globalThis.Map(e),
5496
5588
  encode: map => [...map.entries()]
5497
5589
  })),
@@ -5527,12 +5619,12 @@ export function HashMap(key, value) {
5527
5619
  const entries = ArraySchema(Tuple([key, value]));
5528
5620
  return (input, ast, options) => {
5529
5621
  if (HashMap_.isHashMap(input)) {
5530
- return Effect.mapBothEager(Parser.decodeUnknownEffect(entries)(HashMap_.toEntries(input), options), {
5622
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(entries)(HashMap_.toEntries(input), options), {
5531
5623
  onSuccess: HashMap_.fromIterable,
5532
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["entries"], issue)])
5624
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["entries"], issue)])
5533
5625
  });
5534
5626
  }
5535
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5627
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5536
5628
  };
5537
5629
  }, {
5538
5630
  typeConstructor: {
@@ -5544,7 +5636,7 @@ export function HashMap(key, value) {
5544
5636
  importDeclaration: `import * as HashMap from "effect/HashMap"`
5545
5637
  },
5546
5638
  expected: "HashMap",
5547
- toCodec: ([key, value]) => link()(ArraySchema(Tuple([key, value])), Transformation.transform({
5639
+ toCodec: ([key, value]) => link()(ArraySchema(Tuple([key, value])), SchemaTransformation.transform({
5548
5640
  decode: HashMap_.fromIterable,
5549
5641
  encode: HashMap_.toEntries
5550
5642
  })),
@@ -5580,12 +5672,12 @@ export function ReadonlySet(value) {
5580
5672
  const array = ArraySchema(value);
5581
5673
  return (input, ast, options) => {
5582
5674
  if (input instanceof globalThis.Set) {
5583
- return Effect.mapBothEager(Parser.decodeUnknownEffect(array)([...input], options), {
5675
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(array)([...input], options), {
5584
5676
  onSuccess: array => new globalThis.Set(array),
5585
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
5677
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["values"], issue)])
5586
5678
  });
5587
5679
  }
5588
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5680
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5589
5681
  };
5590
5682
  }, {
5591
5683
  typeConstructor: {
@@ -5596,7 +5688,7 @@ export function ReadonlySet(value) {
5596
5688
  Type: `globalThis.ReadonlySet<?>`
5597
5689
  },
5598
5690
  expected: "ReadonlySet",
5599
- toCodec: ([value]) => link()(ArraySchema(value), Transformation.transform({
5691
+ toCodec: ([value]) => link()(ArraySchema(value), SchemaTransformation.transform({
5600
5692
  decode: e => new globalThis.Set(e),
5601
5693
  encode: set => [...set.values()]
5602
5694
  })),
@@ -5631,12 +5723,12 @@ export function HashSet(value) {
5631
5723
  const values = ArraySchema(value);
5632
5724
  return (input, ast, options) => {
5633
5725
  if (HashSet_.isHashSet(input)) {
5634
- return Effect.mapBothEager(Parser.decodeUnknownEffect(values)(Arr.fromIterable(input), options), {
5726
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(values)(Arr.fromIterable(input), options), {
5635
5727
  onSuccess: HashSet_.fromIterable,
5636
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
5728
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["values"], issue)])
5637
5729
  });
5638
5730
  }
5639
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5731
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5640
5732
  };
5641
5733
  }, {
5642
5734
  typeConstructor: {
@@ -5647,7 +5739,7 @@ export function HashSet(value) {
5647
5739
  Type: `HashSet.HashSet<?>`
5648
5740
  },
5649
5741
  expected: "HashSet",
5650
- toCodec: ([value]) => link()(ArraySchema(value), Transformation.transform({
5742
+ toCodec: ([value]) => link()(ArraySchema(value), SchemaTransformation.transform({
5651
5743
  decode: HashSet_.fromIterable,
5652
5744
  encode: Arr.fromIterable
5653
5745
  })),
@@ -5682,12 +5774,12 @@ export function Chunk(value) {
5682
5774
  const values = ArraySchema(value);
5683
5775
  return (input, ast, options) => {
5684
5776
  if (Chunk_.isChunk(input)) {
5685
- return Effect.mapBothEager(Parser.decodeUnknownEffect(values)(Arr.fromIterable(input), options), {
5777
+ return Effect.mapBothEager(SchemaParser.decodeUnknownEffect(values)(Arr.fromIterable(input), options), {
5686
5778
  onSuccess: Chunk_.fromIterable,
5687
- onFailure: issue => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
5779
+ onFailure: issue => new SchemaIssue.Composite(ast, Option_.some(input), [new SchemaIssue.Pointer(["values"], issue)])
5688
5780
  });
5689
5781
  }
5690
- return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
5782
+ return Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
5691
5783
  };
5692
5784
  }, {
5693
5785
  typeConstructor: {
@@ -5698,7 +5790,7 @@ export function Chunk(value) {
5698
5790
  Type: `Chunk.Chunk<?>`
5699
5791
  },
5700
5792
  expected: "Chunk",
5701
- toCodec: ([value]) => link()(ArraySchema(value), Transformation.transform({
5793
+ toCodec: ([value]) => link()(ArraySchema(value), SchemaTransformation.transform({
5702
5794
  decode: Chunk_.fromIterable,
5703
5795
  encode: Arr.fromIterable
5704
5796
  })),
@@ -5744,10 +5836,10 @@ export const RegExp = /*#__PURE__*/instanceOf(globalThis.RegExp, {
5744
5836
  toCodecJson: () => link()(Struct({
5745
5837
  source: String,
5746
5838
  flags: String
5747
- }), Transformation.transformOrFail({
5839
+ }), SchemaTransformation.transformOrFail({
5748
5840
  decode: e => Effect.try({
5749
5841
  try: () => new globalThis.RegExp(e.source, e.flags),
5750
- catch: e => new Issue.InvalidValue(Option_.some(e), {
5842
+ catch: e => new SchemaIssue.InvalidValue(Option_.some(e), {
5751
5843
  message: globalThis.String(e)
5752
5844
  })
5753
5845
  }),
@@ -5787,7 +5879,7 @@ export const URL = /*#__PURE__*/instanceOf(globalThis.URL, {
5787
5879
  Type: `globalThis.URL`
5788
5880
  },
5789
5881
  expected: "URL",
5790
- toCodecJson: () => link()(URLString, Transformation.urlFromString),
5882
+ toCodecJson: () => link()(URLString, SchemaTransformation.urlFromString),
5791
5883
  toArbitrary: () => fc => fc.webUrl().map(s => new globalThis.URL(s)),
5792
5884
  toEquivalence: () => (a, b) => a.toString() === b.toString()
5793
5885
  });
@@ -5805,7 +5897,7 @@ export const URL = /*#__PURE__*/instanceOf(globalThis.URL, {
5805
5897
  * @category URL
5806
5898
  * @since 4.0.0
5807
5899
  */
5808
- export const URLFromString = /*#__PURE__*/URLString.pipe(/*#__PURE__*/decodeTo(URL, Transformation.urlFromString));
5900
+ export const URLFromString = /*#__PURE__*/URLString.pipe(/*#__PURE__*/decodeTo(URL, SchemaTransformation.urlFromString));
5809
5901
  const DateString = /*#__PURE__*/String.annotate({
5810
5902
  expected: "a string in ISO 8601 format that will be decoded as a Date"
5811
5903
  });
@@ -5814,8 +5906,8 @@ const DateString = /*#__PURE__*/String.annotate({
5814
5906
  *
5815
5907
  * **When to use**
5816
5908
  *
5817
- * Use to validate in-memory values that must already be JavaScript `Date`
5818
- * instances.
5909
+ * Use to validate in-memory values that must already be JavaScript date
5910
+ * objects.
5819
5911
  *
5820
5912
  * **Details**
5821
5913
  *
@@ -5846,7 +5938,7 @@ export const Date = /*#__PURE__*/instanceOf(globalThis.Date, {
5846
5938
  Type: `globalThis.Date`
5847
5939
  },
5848
5940
  expected: "Date",
5849
- toCodecJson: () => link()(DateString, Transformation.dateFromString),
5941
+ toCodecJson: () => link()(DateString, SchemaTransformation.dateFromString),
5850
5942
  toArbitrary: () => (fc, ctx) => fc.date(ctx?.constraints?.date)
5851
5943
  });
5852
5944
  /**
@@ -5876,7 +5968,7 @@ export const Date = /*#__PURE__*/instanceOf(globalThis.Date, {
5876
5968
  * @category Date
5877
5969
  * @since 3.10.0
5878
5970
  */
5879
- export const DateFromString = /*#__PURE__*/DateString.pipe(/*#__PURE__*/decodeTo(Date, Transformation.dateFromString));
5971
+ export const DateFromString = /*#__PURE__*/DateString.pipe(/*#__PURE__*/decodeTo(Date, SchemaTransformation.dateFromString));
5880
5972
  /**
5881
5973
  * Schema for **valid** JavaScript `Date` objects.
5882
5974
  *
@@ -5930,7 +6022,7 @@ export const Duration = /*#__PURE__*/declare(Duration_.isDuration, {
5930
6022
  }), Struct({
5931
6023
  _tag: Literal("Millis"),
5932
6024
  value: Int
5933
- })]), Transformation.transform({
6025
+ })]), SchemaTransformation.transform({
5934
6026
  decode: e => {
5935
6027
  switch (e._tag) {
5936
6028
  case "Infinity":
@@ -5988,7 +6080,7 @@ const DurationString = /*#__PURE__*/String.annotate({
5988
6080
  * @category Duration
5989
6081
  * @since 4.0.0
5990
6082
  */
5991
- export const DurationFromString = /*#__PURE__*/DurationString.pipe(/*#__PURE__*/decodeTo(Duration, Transformation.durationFromString));
6083
+ export const DurationFromString = /*#__PURE__*/DurationString.pipe(/*#__PURE__*/decodeTo(Duration, SchemaTransformation.durationFromString));
5992
6084
  const bigint0 = /*#__PURE__*/globalThis.BigInt(0);
5993
6085
  /**
5994
6086
  * Schema that decodes a non-negative `bigint` into a
@@ -6007,7 +6099,7 @@ const bigint0 = /*#__PURE__*/globalThis.BigInt(0);
6007
6099
  * @category Duration
6008
6100
  * @since 3.10.0
6009
6101
  */
6010
- export const DurationFromNanos = /*#__PURE__*/BigInt.check(isGreaterThanOrEqualToBigInt(bigint0)).pipe(/*#__PURE__*/decodeTo(Duration, Transformation.durationFromNanos));
6102
+ export const DurationFromNanos = /*#__PURE__*/BigInt.check(isGreaterThanOrEqualToBigInt(bigint0)).pipe(/*#__PURE__*/decodeTo(Duration, SchemaTransformation.durationFromNanos));
6011
6103
  /**
6012
6104
  * Schema that decodes a non-negative (possibly infinite)
6013
6105
  * integer into a `Duration`, treating the integer value as the duration in
@@ -6026,7 +6118,7 @@ export const DurationFromNanos = /*#__PURE__*/BigInt.check(isGreaterThanOrEqualT
6026
6118
  * @category Duration
6027
6119
  * @since 3.10.0
6028
6120
  */
6029
- export const DurationFromMillis = /*#__PURE__*/Number.check(isGreaterThanOrEqualTo(0)).pipe(/*#__PURE__*/decodeTo(Duration, Transformation.durationFromMillis));
6121
+ export const DurationFromMillis = /*#__PURE__*/Number.check(isGreaterThanOrEqualTo(0)).pipe(/*#__PURE__*/decodeTo(Duration, SchemaTransformation.durationFromMillis));
6030
6122
  const BigDecimalString = /*#__PURE__*/String.annotate({
6031
6123
  expected: "a string that will be decoded as a BigDecimal"
6032
6124
  });
@@ -6035,7 +6127,7 @@ const BigDecimalString = /*#__PURE__*/String.annotate({
6035
6127
  *
6036
6128
  * **When to use**
6037
6129
  *
6038
- * Use when values are already Effect decimal instances and need schema
6130
+ * Use when you already have Effect decimal instances and need schema
6039
6131
  * validation, formatting, equivalence, and JSON string serialization.
6040
6132
  *
6041
6133
  * **Details**
@@ -6059,7 +6151,7 @@ export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
6059
6151
  importDeclaration: `import * as BigDecimal from "effect/BigDecimal"`
6060
6152
  },
6061
6153
  expected: "BigDecimal",
6062
- toCodecJson: () => link()(BigDecimalString, Transformation.bigDecimalFromString),
6154
+ toCodecJson: () => link()(BigDecimalString, SchemaTransformation.bigDecimalFromString),
6063
6155
  toArbitrary: () => fc => fc.tuple(fc.bigInt(), fc.integer({
6064
6156
  min: 0,
6065
6157
  max: 20
@@ -6094,7 +6186,7 @@ export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
6094
6186
  * @category BigDecimal
6095
6187
  * @since 4.0.0
6096
6188
  */
6097
- export const BigDecimalFromString = /*#__PURE__*/BigDecimalString.pipe(/*#__PURE__*/decodeTo(BigDecimal, Transformation.bigDecimalFromString));
6189
+ export const BigDecimalFromString = /*#__PURE__*/BigDecimalString.pipe(/*#__PURE__*/decodeTo(BigDecimal, SchemaTransformation.bigDecimalFromString));
6098
6190
  /**
6099
6191
  * Schema that decodes a JSON-encoded string into an `unknown` value.
6100
6192
  *
@@ -6117,7 +6209,7 @@ export const BigDecimalFromString = /*#__PURE__*/BigDecimalString.pipe(/*#__PURE
6117
6209
  * // => { a: 1, b: 2 }
6118
6210
  * ```
6119
6211
  *
6120
- * @category JSON
6212
+ * @category schemas
6121
6213
  * @since 4.0.0
6122
6214
  */
6123
6215
  export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
@@ -6184,15 +6276,15 @@ export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
6184
6276
  * // }
6185
6277
  * ```
6186
6278
  *
6187
- * @category JSON
6279
+ * @category constructors
6188
6280
  * @since 4.0.0
6189
6281
  */
6190
6282
  export function fromJsonString(schema) {
6191
6283
  return String.annotate({
6192
6284
  expected: "a string that will be decoded as JSON",
6193
6285
  contentMediaType: "application/json",
6194
- contentSchema: AST.toEncoded(schema.ast)
6195
- }).pipe(decodeTo(schema, Transformation.fromJsonString));
6286
+ contentSchema: SchemaAST.toEncoded(schema.ast)
6287
+ }).pipe(decodeTo(schema, SchemaTransformation.fromJsonString));
6196
6288
  }
6197
6289
  /**
6198
6290
  * Schema for JavaScript `File` objects.
@@ -6202,7 +6294,7 @@ export function fromJsonString(schema) {
6202
6294
  * The default JSON serializer encodes a `File` as `{ data, type, name, lastModified }`
6203
6295
  * where `data` is base64-encoded.
6204
6296
  *
6205
- * @category File
6297
+ * @category file
6206
6298
  * @since 4.0.0
6207
6299
  */
6208
6300
  export const File = /*#__PURE__*/instanceOf(globalThis.File, {
@@ -6219,9 +6311,9 @@ export const File = /*#__PURE__*/instanceOf(globalThis.File, {
6219
6311
  type: String,
6220
6312
  name: String,
6221
6313
  lastModified: Number
6222
- }), Transformation.transformOrFail({
6314
+ }), SchemaTransformation.transformOrFail({
6223
6315
  decode: e => Result_.match(Encoding.decodeBase64(e.data), {
6224
- onFailure: error => Effect.fail(new Issue.InvalidValue(Option_.some(e.data), {
6316
+ onFailure: error => Effect.fail(new SchemaIssue.InvalidValue(Option_.some(e.data), {
6225
6317
  message: error.message
6226
6318
  })),
6227
6319
  onSuccess: bytes => {
@@ -6242,7 +6334,7 @@ export const File = /*#__PURE__*/instanceOf(globalThis.File, {
6242
6334
  lastModified: file.lastModified
6243
6335
  };
6244
6336
  },
6245
- catch: e => new Issue.InvalidValue(Option_.some(file), {
6337
+ catch: e => new SchemaIssue.InvalidValue(Option_.some(file), {
6246
6338
  message: globalThis.String(e)
6247
6339
  })
6248
6340
  })
@@ -6274,7 +6366,7 @@ export const FormData = /*#__PURE__*/instanceOf(globalThis.FormData, {
6274
6366
  }), Struct({
6275
6367
  _tag: tag("File"),
6276
6368
  value: File
6277
- })])])), Transformation.transformOrFail({
6369
+ })])])), SchemaTransformation.transformOrFail({
6278
6370
  decode: e => {
6279
6371
  const out = new globalThis.FormData();
6280
6372
  for (const [key, entry] of e) {
@@ -6388,7 +6480,7 @@ export const FormData = /*#__PURE__*/instanceOf(globalThis.FormData, {
6388
6480
  * @since 4.0.0
6389
6481
  */
6390
6482
  export function fromFormData(schema) {
6391
- return FormData.pipe(decodeTo(schema, Transformation.fromFormData));
6483
+ return FormData.pipe(decodeTo(schema, SchemaTransformation.fromFormData));
6392
6484
  }
6393
6485
  /**
6394
6486
  * Schema for JavaScript `URLSearchParams` objects.
@@ -6397,7 +6489,7 @@ export function fromFormData(schema) {
6397
6489
  *
6398
6490
  * The default JSON serializer encodes a `URLSearchParams` as a query string.
6399
6491
  *
6400
- * @category URLSearchParams
6492
+ * @category search params
6401
6493
  * @since 4.0.0
6402
6494
  */
6403
6495
  export const URLSearchParams = /*#__PURE__*/instanceOf(globalThis.URLSearchParams, {
@@ -6411,7 +6503,7 @@ export const URLSearchParams = /*#__PURE__*/instanceOf(globalThis.URLSearchParam
6411
6503
  expected: "URLSearchParams",
6412
6504
  toCodecJson: () => link()(String.annotate({
6413
6505
  expected: "a query string that will be decoded as URLSearchParams"
6414
- }), Transformation.transform({
6506
+ }), SchemaTransformation.transform({
6415
6507
  decode: e => new globalThis.URLSearchParams(e),
6416
6508
  encode: params => params.toString()
6417
6509
  }))
@@ -6497,7 +6589,7 @@ export const URLSearchParams = /*#__PURE__*/instanceOf(globalThis.URLSearchParam
6497
6589
  * @since 4.0.0
6498
6590
  */
6499
6591
  export function fromURLSearchParams(schema) {
6500
- return URLSearchParams.pipe(decodeTo(schema, Transformation.fromURLSearchParams));
6592
+ return URLSearchParams.pipe(decodeTo(schema, SchemaTransformation.fromURLSearchParams));
6501
6593
  }
6502
6594
  /**
6503
6595
  * Schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
@@ -6532,7 +6624,7 @@ export const Int = /*#__PURE__*/Number.check(/*#__PURE__*/isInt());
6532
6624
  */
6533
6625
  export const NumberFromString = /*#__PURE__*/String.annotate({
6534
6626
  expected: "a string that will be decoded as a number"
6535
- }).pipe(/*#__PURE__*/decodeTo(Number, Transformation.numberFromString));
6627
+ }).pipe(/*#__PURE__*/decodeTo(Number, SchemaTransformation.numberFromString));
6536
6628
  /**
6537
6629
  * Schema that parses a string into a finite number.
6538
6630
  *
@@ -6550,7 +6642,7 @@ export const NumberFromString = /*#__PURE__*/String.annotate({
6550
6642
  */
6551
6643
  export const FiniteFromString = /*#__PURE__*/String.annotate({
6552
6644
  expected: "a string that will be decoded as a finite number"
6553
- }).pipe(/*#__PURE__*/decodeTo(Finite, Transformation.numberFromString));
6645
+ }).pipe(/*#__PURE__*/decodeTo(Finite, SchemaTransformation.numberFromString));
6554
6646
  /**
6555
6647
  * Schema that parses a string into a `bigint`.
6556
6648
  *
@@ -6579,11 +6671,11 @@ export const FiniteFromString = /*#__PURE__*/String.annotate({
6579
6671
  * @category BigInt
6580
6672
  * @since 4.0.0
6581
6673
  */
6582
- export const BigIntFromString = /*#__PURE__*/make(AST.bigIntString).pipe(/*#__PURE__*/decodeTo(BigInt, Transformation.bigintFromString));
6674
+ export const BigIntFromString = /*#__PURE__*/make(SchemaAST.bigIntString).pipe(/*#__PURE__*/decodeTo(BigInt, SchemaTransformation.bigintFromString));
6583
6675
  /**
6584
6676
  * Schema for strings that contains no leading or trailing whitespaces.
6585
6677
  *
6586
- * @category String
6678
+ * @category string
6587
6679
  * @since 3.10.0
6588
6680
  */
6589
6681
  export const Trimmed = /*#__PURE__*/String.check(/*#__PURE__*/isTrimmed());
@@ -6598,12 +6690,12 @@ export const Trimmed = /*#__PURE__*/String.check(/*#__PURE__*/isTrimmed());
6598
6690
  * Encoding:
6599
6691
  * - The trimmed string is encoded as is.
6600
6692
  *
6601
- * @category String
6693
+ * @category string
6602
6694
  * @since 3.10.0
6603
6695
  */
6604
6696
  export const Trim = /*#__PURE__*/String.annotate({
6605
6697
  expected: "a string that will be decoded as a trimmed string"
6606
- }).pipe(/*#__PURE__*/decodeTo(Trimmed, /*#__PURE__*/Transformation.trim()));
6698
+ }).pipe(/*#__PURE__*/decodeTo(Trimmed, /*#__PURE__*/SchemaTransformation.trim()));
6607
6699
  /**
6608
6700
  * Decodes a base64 (RFC4648) encoded string into a UTF-8 string.
6609
6701
  *
@@ -6615,12 +6707,12 @@ export const Trim = /*#__PURE__*/String.annotate({
6615
6707
  * Encoding:
6616
6708
  * - A `string` is encoded as a base64-encoded string.
6617
6709
  *
6618
- * @category String
6710
+ * @category string
6619
6711
  * @since 3.10.0
6620
6712
  */
6621
6713
  export const StringFromBase64 = /*#__PURE__*/String.annotate({
6622
6714
  expected: "a base64 encoded string that will be decoded as a UTF-8 string"
6623
- }).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromBase64String));
6715
+ }).pipe(/*#__PURE__*/decodeTo(String, SchemaTransformation.stringFromBase64String));
6624
6716
  /**
6625
6717
  * Decodes a base64 (URL) encoded string into a UTF-8 string.
6626
6718
  *
@@ -6632,12 +6724,12 @@ export const StringFromBase64 = /*#__PURE__*/String.annotate({
6632
6724
  * Encoding:
6633
6725
  * - A `string` is encoded as a base64 (URL) encoded string.
6634
6726
  *
6635
- * @category String
6727
+ * @category string
6636
6728
  * @since 3.10.0
6637
6729
  */
6638
6730
  export const StringFromBase64Url = /*#__PURE__*/String.annotate({
6639
6731
  expected: "a base64 (URL) encoded string that will be decoded as a UTF-8 string"
6640
- }).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromBase64UrlString));
6732
+ }).pipe(/*#__PURE__*/decodeTo(String, SchemaTransformation.stringFromBase64UrlString));
6641
6733
  /**
6642
6734
  * Decodes a hex encoded string into a UTF-8 string.
6643
6735
  *
@@ -6649,12 +6741,12 @@ export const StringFromBase64Url = /*#__PURE__*/String.annotate({
6649
6741
  * Encoding:
6650
6742
  * - A `string` is encoded as a hex string.
6651
6743
  *
6652
- * @category String
6744
+ * @category string
6653
6745
  * @since 3.10.0
6654
6746
  */
6655
6747
  export const StringFromHex = /*#__PURE__*/String.annotate({
6656
6748
  expected: "a hex encoded string that will be decoded as a UTF-8 string"
6657
- }).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromHexString));
6749
+ }).pipe(/*#__PURE__*/decodeTo(String, SchemaTransformation.stringFromHexString));
6658
6750
  /**
6659
6751
  * Decodes a URI component encoded string into a UTF-8 string.
6660
6752
  * Can be used to store data in a URL.
@@ -6685,12 +6777,12 @@ export const StringFromHex = /*#__PURE__*/String.annotate({
6685
6777
  * // %7B%22maxItemPerPage%22%3A10%2C%22page%22%3A1%7D
6686
6778
  * ```
6687
6779
  *
6688
- * @category String
6780
+ * @category string
6689
6781
  * @since 3.12.0
6690
6782
  */
6691
6783
  export const StringFromUriComponent = /*#__PURE__*/String.annotate({
6692
6784
  expected: "a URI component encoded string that will be decoded as a UTF-8 string"
6693
- }).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromUriComponent));
6785
+ }).pipe(/*#__PURE__*/decodeTo(String, SchemaTransformation.stringFromUriComponent));
6694
6786
  /**
6695
6787
  * Schema for property keys accepted by Effect schemas: finite `number`,
6696
6788
  * `symbol`, or `string`.
@@ -6707,7 +6799,7 @@ export const PropertyKey = /*#__PURE__*/Union([Finite, Symbol, String]);
6707
6799
  * The result contains an `issues` array where each issue has a message and an
6708
6800
  * optional path made of property keys or keyed path segments.
6709
6801
  *
6710
- * @category StandardSchema
6802
+ * @category Standard Schema
6711
6803
  * @since 4.0.0
6712
6804
  */
6713
6805
  export const StandardSchemaV1FailureResult = /*#__PURE__*/Struct({
@@ -6734,10 +6826,10 @@ export const StandardSchemaV1FailureResult = /*#__PURE__*/Struct({
6734
6826
  * @see {@link Boolean} for validating values that are already booleans
6735
6827
  * @see {@link Literals} for keeping bit literals instead of decoding them
6736
6828
  *
6737
- * @category Boolean
6829
+ * @category boolean
6738
6830
  * @since 4.0.0
6739
6831
  */
6740
- export const BooleanFromBit = /*#__PURE__*/Literals([0, 1]).pipe(/*#__PURE__*/decodeTo(Boolean, /*#__PURE__*/Transformation.transform({
6832
+ export const BooleanFromBit = /*#__PURE__*/Literals([0, 1]).pipe(/*#__PURE__*/decodeTo(Boolean, /*#__PURE__*/SchemaTransformation.transform({
6741
6833
  decode: bit => bit === 1,
6742
6834
  encode: bool => bool ? 1 : 0
6743
6835
  })));
@@ -6767,7 +6859,7 @@ export const Uint8Array = /*#__PURE__*/instanceOf(globalThis.Uint8Array, {
6767
6859
  Type: `globalThis.Uint8Array`
6768
6860
  },
6769
6861
  expected: "Uint8Array",
6770
- toCodecJson: () => link()(Base64String, Transformation.uint8ArrayFromBase64String),
6862
+ toCodecJson: () => link()(Base64String, SchemaTransformation.uint8ArrayFromBase64String),
6771
6863
  toArbitrary: () => fc => fc.uint8Array()
6772
6864
  });
6773
6865
  /**
@@ -6785,7 +6877,7 @@ export const Uint8Array = /*#__PURE__*/instanceOf(globalThis.Uint8Array, {
6785
6877
  * @category Uint8Array
6786
6878
  * @since 3.10.0
6787
6879
  */
6788
- export const Uint8ArrayFromBase64 = /*#__PURE__*/Base64String.pipe(/*#__PURE__*/decodeTo(Uint8Array, Transformation.uint8ArrayFromBase64String));
6880
+ export const Uint8ArrayFromBase64 = /*#__PURE__*/Base64String.pipe(/*#__PURE__*/decodeTo(Uint8Array, SchemaTransformation.uint8ArrayFromBase64String));
6789
6881
  /**
6790
6882
  * Schema that decodes a base64 (URL) encoded string into a
6791
6883
  * `Uint8Array`.
@@ -6804,8 +6896,8 @@ export const Uint8ArrayFromBase64 = /*#__PURE__*/Base64String.pipe(/*#__PURE__*/
6804
6896
  export const Uint8ArrayFromBase64Url = /*#__PURE__*/String.annotate({
6805
6897
  expected: "a base64 (URL) encoded string that will be decoded as a Uint8Array"
6806
6898
  }).pipe(/*#__PURE__*/decodeTo(Uint8Array, {
6807
- decode: /*#__PURE__*/Getter.decodeBase64Url(),
6808
- encode: /*#__PURE__*/Getter.encodeBase64Url()
6899
+ decode: /*#__PURE__*/SchemaGetter.decodeBase64Url(),
6900
+ encode: /*#__PURE__*/SchemaGetter.encodeBase64Url()
6809
6901
  }));
6810
6902
  /**
6811
6903
  * Schema that decodes a hex encoded string into a
@@ -6825,8 +6917,8 @@ export const Uint8ArrayFromBase64Url = /*#__PURE__*/String.annotate({
6825
6917
  export const Uint8ArrayFromHex = /*#__PURE__*/String.annotate({
6826
6918
  expected: "a hex encoded string that will be decoded as a Uint8Array"
6827
6919
  }).pipe(/*#__PURE__*/decodeTo(Uint8Array, {
6828
- decode: /*#__PURE__*/Getter.decodeHex(),
6829
- encode: /*#__PURE__*/Getter.encodeHex()
6920
+ decode: /*#__PURE__*/SchemaGetter.decodeHex(),
6921
+ encode: /*#__PURE__*/SchemaGetter.encodeHex()
6830
6922
  }));
6831
6923
  /**
6832
6924
  * Schema for `DateTime.Utc` values.
@@ -6859,7 +6951,7 @@ export const DateTimeUtc = /*#__PURE__*/declare(u => DateTime.isDateTime(u) && D
6859
6951
  importDeclaration: `import * as DateTime from "effect/DateTime"`
6860
6952
  },
6861
6953
  expected: "DateTime.Utc",
6862
- toCodecJson: () => link()(String, Transformation.dateTimeUtcFromString),
6954
+ toCodecJson: () => link()(String, SchemaTransformation.dateTimeUtcFromString),
6863
6955
  toArbitrary: () => (fc, ctx) => fc.date({
6864
6956
  noInvalidDate: true,
6865
6957
  ...ctx?.constraints?.date
@@ -6872,8 +6964,8 @@ export const DateTimeUtc = /*#__PURE__*/declare(u => DateTime.isDateTime(u) && D
6872
6964
  *
6873
6965
  * **When to use**
6874
6966
  *
6875
- * Use when a boundary provides valid JavaScript `Date` objects but the decoded
6876
- * model should use `DateTime.Utc`.
6967
+ * Use when you need to decode valid JavaScript `Date` objects into
6968
+ * `DateTime.Utc` values.
6877
6969
  *
6878
6970
  * **Details**
6879
6971
  *
@@ -6892,8 +6984,8 @@ export const DateTimeUtc = /*#__PURE__*/declare(u => DateTime.isDateTime(u) && D
6892
6984
  * @since 3.12.0
6893
6985
  */
6894
6986
  export const DateTimeUtcFromDate = /*#__PURE__*/DateValid.pipe(/*#__PURE__*/decodeTo(DateTimeUtc, {
6895
- decode: /*#__PURE__*/Getter.dateTimeUtcFromInput(),
6896
- encode: /*#__PURE__*/Getter.transform(DateTime.toDateUtc)
6987
+ decode: /*#__PURE__*/SchemaGetter.dateTimeUtcFromInput(),
6988
+ encode: /*#__PURE__*/SchemaGetter.transform(DateTime.toDateUtc)
6897
6989
  }));
6898
6990
  /**
6899
6991
  * Schema that decodes a date-time string into a `DateTime.Utc`.
@@ -6914,7 +7006,7 @@ export const DateTimeUtcFromDate = /*#__PURE__*/DateValid.pipe(/*#__PURE__*/deco
6914
7006
  */
6915
7007
  export const DateTimeUtcFromString = /*#__PURE__*/String.annotate({
6916
7008
  expected: "a string that will be decoded as a DateTime.Utc"
6917
- }).pipe(/*#__PURE__*/decodeTo(DateTimeUtc, Transformation.dateTimeUtcFromString));
7009
+ }).pipe(/*#__PURE__*/decodeTo(DateTimeUtc, SchemaTransformation.dateTimeUtcFromString));
6918
7010
  /**
6919
7011
  * Schema that decodes a number into a `DateTime.Utc`.
6920
7012
  *
@@ -6930,8 +7022,8 @@ export const DateTimeUtcFromString = /*#__PURE__*/String.annotate({
6930
7022
  * @since 4.0.0
6931
7023
  */
6932
7024
  export const DateTimeUtcFromMillis = /*#__PURE__*/Number.pipe(/*#__PURE__*/decodeTo(DateTimeUtc, {
6933
- decode: /*#__PURE__*/Getter.dateTimeUtcFromInput(),
6934
- encode: /*#__PURE__*/Getter.transform(DateTime.toEpochMillis)
7025
+ decode: /*#__PURE__*/SchemaGetter.dateTimeUtcFromInput(),
7026
+ encode: /*#__PURE__*/SchemaGetter.transform(DateTime.toEpochMillis)
6935
7027
  }));
6936
7028
  /**
6937
7029
  * Schema for `DateTime.TimeZone.Offset` values.
@@ -6955,7 +7047,7 @@ export const TimeZoneOffset = /*#__PURE__*/declare(DateTime.isTimeZoneOffset, {
6955
7047
  importDeclaration: `import * as DateTime from "effect/DateTime"`
6956
7048
  },
6957
7049
  expected: "DateTime.TimeZone.Offset",
6958
- toCodecJson: () => link()(Number, Transformation.timeZoneOffsetFromNumber),
7050
+ toCodecJson: () => link()(Number, SchemaTransformation.timeZoneOffsetFromNumber),
6959
7051
  toArbitrary: () => fc => fc.integer({
6960
7052
  min: -12 * 60 * 60 * 1000,
6961
7053
  max: 14 * 60 * 60 * 1000
@@ -6988,7 +7080,7 @@ export const TimeZoneNamed = /*#__PURE__*/declare(DateTime.isTimeZoneNamed, {
6988
7080
  importDeclaration: `import * as DateTime from "effect/DateTime"`
6989
7081
  },
6990
7082
  expected: "DateTime.TimeZone.Named",
6991
- toCodecJson: () => link()(TimeZoneNamedString, Transformation.timeZoneNamedFromString),
7083
+ toCodecJson: () => link()(TimeZoneNamedString, SchemaTransformation.timeZoneNamedFromString),
6992
7084
  toArbitrary: () => fc => fc.constantFrom(...["UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney"].map(DateTime.zoneMakeNamedUnsafe)),
6993
7085
  toFormatter: () => tz => DateTime.zoneToString(tz),
6994
7086
  toEquivalence: () => (a, b) => a.id === b.id
@@ -7007,7 +7099,7 @@ export const TimeZoneNamed = /*#__PURE__*/declare(DateTime.isTimeZoneNamed, {
7007
7099
  * @category DateTime
7008
7100
  * @since 4.0.0
7009
7101
  */
7010
- export const TimeZoneNamedFromString = /*#__PURE__*/TimeZoneNamedString.pipe(/*#__PURE__*/decodeTo(TimeZoneNamed, Transformation.timeZoneNamedFromString));
7102
+ export const TimeZoneNamedFromString = /*#__PURE__*/TimeZoneNamedString.pipe(/*#__PURE__*/decodeTo(TimeZoneNamed, SchemaTransformation.timeZoneNamedFromString));
7011
7103
  const TimeZoneString = /*#__PURE__*/String.annotate({
7012
7104
  expected: "a time zone string (IANA identifier or offset like +03:00)"
7013
7105
  });
@@ -7034,7 +7126,7 @@ export const TimeZone = /*#__PURE__*/declare(DateTime.isTimeZone, {
7034
7126
  importDeclaration: `import * as DateTime from "effect/DateTime"`
7035
7127
  },
7036
7128
  expected: "DateTime.TimeZone",
7037
- toCodecJson: () => link()(TimeZoneString, Transformation.timeZoneFromString),
7129
+ toCodecJson: () => link()(TimeZoneString, SchemaTransformation.timeZoneFromString),
7038
7130
  toArbitrary: () => fc => fc.oneof(fc.integer({
7039
7131
  min: -12 * 60 * 60 * 1000,
7040
7132
  max: 14 * 60 * 60 * 1000
@@ -7056,7 +7148,7 @@ export const TimeZone = /*#__PURE__*/declare(DateTime.isTimeZone, {
7056
7148
  * @category DateTime
7057
7149
  * @since 4.0.0
7058
7150
  */
7059
- export const TimeZoneFromString = /*#__PURE__*/TimeZoneString.pipe(/*#__PURE__*/decodeTo(TimeZone, Transformation.timeZoneFromString));
7151
+ export const TimeZoneFromString = /*#__PURE__*/TimeZoneString.pipe(/*#__PURE__*/decodeTo(TimeZone, SchemaTransformation.timeZoneFromString));
7060
7152
  const DateTimeZonedString = /*#__PURE__*/String.annotate({
7061
7153
  expected: "a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"
7062
7154
  });
@@ -7085,7 +7177,7 @@ export const DateTimeZoned = /*#__PURE__*/declare(u => DateTime.isDateTime(u) &&
7085
7177
  importDeclaration: `import * as DateTime from "effect/DateTime"`
7086
7178
  },
7087
7179
  expected: "DateTime.Zoned",
7088
- toCodecJson: () => link()(DateTimeZonedString, Transformation.dateTimeZonedFromString),
7180
+ toCodecJson: () => link()(DateTimeZonedString, SchemaTransformation.dateTimeZonedFromString),
7089
7181
  toArbitrary: () => (fc, ctx) => fc.tuple(fc.date({
7090
7182
  noInvalidDate: true,
7091
7183
  min: new globalThis.Date(-8640000000000000 + 14 * 60 * 60 * 1000),
@@ -7111,7 +7203,7 @@ export const DateTimeZoned = /*#__PURE__*/declare(u => DateTime.isDateTime(u) &&
7111
7203
  * @category DateTime
7112
7204
  * @since 4.0.0
7113
7205
  */
7114
- export const DateTimeZonedFromString = /*#__PURE__*/DateTimeZonedString.pipe(/*#__PURE__*/decodeTo(DateTimeZoned, Transformation.dateTimeZonedFromString));
7206
+ export const DateTimeZonedFromString = /*#__PURE__*/DateTimeZonedString.pipe(/*#__PURE__*/decodeTo(DateTimeZoned, SchemaTransformation.dateTimeZonedFromString));
7115
7207
  const immerable = /*#__PURE__*/globalThis.Symbol.for("immer-draftable");
7116
7208
  function makeClass(Inherited, identifier, struct, annotations, proto) {
7117
7209
  const getClassSchema = getClassSchemaFactory(struct, identifier, annotations);
@@ -7148,19 +7240,19 @@ function makeClass(Inherited, identifier, struct, annotations, proto) {
7148
7240
  return new this(input, options);
7149
7241
  }
7150
7242
  static makeOption(input, options) {
7151
- return Parser.makeOption(getClassSchema(this))(input ?? {}, options);
7243
+ return SchemaParser.makeOption(getClassSchema(this))(input ?? {}, options);
7152
7244
  }
7153
7245
  static makeEffect(input, options) {
7154
7246
  return getClassSchema(this).makeEffect(input ?? {}, options);
7155
7247
  }
7156
7248
  static annotate(annotations) {
7157
- return this.rebuild(AST.annotate(this.ast, annotations));
7249
+ return this.rebuild(SchemaAST.annotate(this.ast, annotations));
7158
7250
  }
7159
7251
  static annotateKey(annotations) {
7160
- return this.rebuild(AST.annotateKey(this.ast, annotations));
7252
+ return this.rebuild(SchemaAST.annotateKey(this.ast, annotations));
7161
7253
  }
7162
7254
  static check(...checks) {
7163
- return this.rebuild(AST.appendChecks(this.ast, checks));
7255
+ return this.rebuild(SchemaAST.appendChecks(this.ast, checks));
7164
7256
  }
7165
7257
  static extend(identifier) {
7166
7258
  return (newFields, annotations) => {
@@ -7168,7 +7260,7 @@ function makeClass(Inherited, identifier, struct, annotations, proto) {
7168
7260
  ...struct.fields,
7169
7261
  ...newFields
7170
7262
  };
7171
- return makeClass(this, identifier, makeStruct(AST.struct(fields, struct.ast.checks, {
7263
+ return makeClass(this, identifier, makeStruct(SchemaAST.struct(fields, struct.ast.checks, {
7172
7264
  identifier
7173
7265
  }), fields), annotations, proto);
7174
7266
  };
@@ -7183,7 +7275,7 @@ function makeClass(Inherited, identifier, struct, annotations, proto) {
7183
7275
  return out;
7184
7276
  }
7185
7277
  function getClassTransformation(self) {
7186
- return new Transformation.Transformation(Getter.transform(input => new self(input)), Getter.passthrough());
7278
+ return new SchemaTransformation.Transformation(SchemaGetter.transform(input => new self(input)), SchemaGetter.passthrough());
7187
7279
  }
7188
7280
  function getClassTypeId(identifier) {
7189
7281
  return `~effect/Schema/Class/${identifier}`;
@@ -7193,15 +7285,15 @@ function getClassSchemaFactory(from, identifier, annotations) {
7193
7285
  return self => {
7194
7286
  if (memo === undefined) {
7195
7287
  const transformation = getClassTransformation(self);
7196
- const to = make(new AST.Declaration([from.ast], () => (input, ast) => {
7197
- return input instanceof self || Predicate.hasProperty(input, getClassTypeId(identifier)) ? Effect.succeed(input) : Effect.fail(new Issue.InvalidType(ast, Option_.some(input)));
7288
+ const to = make(new SchemaAST.Declaration([from.ast], () => (input, ast) => {
7289
+ return input instanceof self || Predicate.hasProperty(input, getClassTypeId(identifier)) ? Effect.succeed(input) : Effect.fail(new SchemaIssue.InvalidType(ast, Option_.some(input)));
7198
7290
  }, {
7199
7291
  identifier,
7200
- [AST.ClassTypeId]: ([from]) => new AST.Link(from, transformation),
7201
- toCodec: ([from]) => new AST.Link(from.ast, transformation),
7292
+ [SchemaAST.ClassTypeId]: ([from]) => new SchemaAST.Link(from, transformation),
7293
+ toCodec: ([from]) => new SchemaAST.Link(from.ast, transformation),
7202
7294
  toArbitrary: ([from]) => () => from.map(args => new self(args)),
7203
7295
  toFormatter: ([from]) => t => `${self.identifier}(${from(t)})`,
7204
- "~sentinels": AST.collectSentinels(from.ast),
7296
+ "~sentinels": SchemaAST.collectSentinels(from.ast),
7205
7297
  ...annotations
7206
7298
  }));
7207
7299
  memo = from.pipe(decodeTo(to, transformation));
@@ -7219,9 +7311,8 @@ function isStruct(schema) {
7219
7311
  *
7220
7312
  * **When to use**
7221
7313
  *
7222
- * Use to define a schema-backed data class when you want validated
7223
- * construction, schema-derived decoding/encoding, and class-style methods or
7224
- * inheritance.
7314
+ * Use when you need a schema-backed data class with validated construction,
7315
+ * schema-derived decoding/encoding, and class-style methods or inheritance.
7225
7316
  *
7226
7317
  * **Details**
7227
7318
  *
@@ -7473,7 +7564,7 @@ export function toFormatter(schema, options) {
7473
7564
  // ---------------------------------------------
7474
7565
  const annotation = InternalAnnotations.resolve(ast)?.["toFormatter"];
7475
7566
  if (typeof annotation === "function") {
7476
- return annotation(AST.isDeclaration(ast) ? ast.typeParameters.map(recur) : []);
7567
+ return annotation(SchemaAST.isDeclaration(ast) ? ast.typeParameters.map(recur) : []);
7477
7568
  }
7478
7569
  // ---------------------------------------------
7479
7570
  // handle onBefore
@@ -7509,7 +7600,7 @@ export function toFormatter(schema, options) {
7509
7600
  // ---------------------------------------------
7510
7601
  for (; i < elements.length; i++) {
7511
7602
  if (t.length < i + 1) {
7512
- if (AST.isOptional(ast.elements[i])) {
7603
+ if (SchemaAST.isOptional(ast.elements[i])) {
7513
7604
  continue;
7514
7605
  }
7515
7606
  } else {
@@ -7552,7 +7643,7 @@ export function toFormatter(schema, options) {
7552
7643
  const ps = ast.propertySignatures[i];
7553
7644
  const name = ps.name;
7554
7645
  visited.add(name);
7555
- if (AST.isOptional(ps.type) && !Object.hasOwn(t, name)) {
7646
+ if (SchemaAST.isOptional(ps.type) && !Object.hasOwn(t, name)) {
7556
7647
  continue;
7557
7648
  }
7558
7649
  out.push(`${formatPropertyKey(name)}: ${propertySignatures[i](t[name])}`);
@@ -7561,7 +7652,7 @@ export function toFormatter(schema, options) {
7561
7652
  // handle index signatures
7562
7653
  // ---------------------------------------------
7563
7654
  for (let i = 0; i < indexSignatures.length; i++) {
7564
- const keys = AST.getIndexSignatureKeys(t, ast.indexSignatures[i].parameter);
7655
+ const keys = SchemaAST.getIndexSignatureKeys(t, ast.indexSignatures[i].parameter);
7565
7656
  for (const key of keys) {
7566
7657
  if (visited.has(key)) {
7567
7658
  continue;
@@ -7575,10 +7666,10 @@ export function toFormatter(schema, options) {
7575
7666
  }
7576
7667
  case "Union":
7577
7668
  {
7578
- const getCandidates = t => AST.getCandidates(t, ast.types);
7669
+ const getCandidates = t => SchemaAST.getCandidates(t, ast.types);
7579
7670
  return t => {
7580
7671
  const candidates = getCandidates(t);
7581
- const refinements = candidates.map(Parser._is);
7672
+ const refinements = candidates.map(SchemaParser._is);
7582
7673
  for (let i = 0; i < candidates.length; i++) {
7583
7674
  const is = refinements[i];
7584
7675
  if (is(t)) {
@@ -7590,7 +7681,7 @@ export function toFormatter(schema, options) {
7590
7681
  }
7591
7682
  case "Suspend":
7592
7683
  {
7593
- const get = AST.memoizeThunk(() => recur(ast.thunk()));
7684
+ const get = SchemaAST.memoizeThunk(() => recur(ast.thunk()));
7594
7685
  return t => get()(t);
7595
7686
  }
7596
7687
  }
@@ -7605,10 +7696,10 @@ export function toFormatter(schema, options) {
7605
7696
  *
7606
7697
  * **When to use**
7607
7698
  *
7608
- * Use when the default structural equivalence derived by {@link toEquivalence}
7609
- * is not appropriate for a type.
7699
+ * Use when you need a custom equivalence instead of the default structural
7700
+ * equivalence derived by {@link toEquivalence}.
7610
7701
  *
7611
- * @category Equivalence
7702
+ * @category instances
7612
7703
  * @since 4.0.0
7613
7704
  */
7614
7705
  export function overrideToEquivalence(toEquivalence) {
@@ -7632,7 +7723,7 @@ export function overrideToEquivalence(toEquivalence) {
7632
7723
  * console.log(eq({ id: 1, name: "Alice" }, { id: 2, name: "Alice" })) // false
7633
7724
  * ```
7634
7725
  *
7635
- * @category Equivalence
7726
+ * @category instances
7636
7727
  * @since 4.0.0
7637
7728
  */
7638
7729
  export function toEquivalence(schema) {
@@ -7661,7 +7752,7 @@ export function toRepresentation(schema) {
7661
7752
  * properties and synthesized check descriptions; it does not change the draft
7662
7753
  * target.
7663
7754
  *
7664
- * @category JsonSchema
7755
+ * @category converting
7665
7756
  * @since 4.0.0
7666
7757
  */
7667
7758
  export function toJsonSchemaDocument(schema, options) {
@@ -7686,9 +7777,9 @@ export function toJsonSchemaDocument(schema, options) {
7686
7777
  export function toCodecJson(schema) {
7687
7778
  return make(toCodecJsonTop(schema.ast));
7688
7779
  }
7689
- const toCodecJsonTop = /*#__PURE__*/AST.toCodec(ast => {
7780
+ const toCodecJsonTop = /*#__PURE__*/SchemaAST.toCodec(ast => {
7690
7781
  const out = toCodecJsonBase(ast, toCodecJsonTop);
7691
- return out !== ast && AST.isOptional(ast) ? AST.optionalKeyLastLink(out) : out;
7782
+ return out !== ast && SchemaAST.isOptional(ast) ? SchemaAST.optionalKeyLastLink(out) : out;
7692
7783
  });
7693
7784
  function toCodecJsonBase(ast, recur) {
7694
7785
  switch (ast._tag) {
@@ -7696,16 +7787,16 @@ function toCodecJsonBase(ast, recur) {
7696
7787
  {
7697
7788
  const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
7698
7789
  if (Predicate.isFunction(getLink)) {
7699
- const tps = AST.isDeclaration(ast) ? ast.typeParameters.map(tp => InternalSchema.make(AST.toEncoded(tp))) : [];
7790
+ const tps = SchemaAST.isDeclaration(ast) ? ast.typeParameters.map(tp => InternalSchema.make(SchemaAST.toEncoded(tp))) : [];
7700
7791
  const link = getLink(tps);
7701
7792
  const to = recur(link.to);
7702
- return AST.replaceEncoding(ast, to === link.to ? [link] : [new AST.Link(to, link.transformation)]);
7793
+ return SchemaAST.replaceEncoding(ast, to === link.to ? [link] : [new SchemaAST.Link(to, link.transformation)]);
7703
7794
  }
7704
- return AST.replaceEncoding(ast, [AST.unknownToNull]);
7795
+ return SchemaAST.replaceEncoding(ast, [SchemaAST.unknownToNull]);
7705
7796
  }
7706
7797
  case "Unknown":
7707
7798
  case "ObjectKeyword":
7708
- return AST.replaceEncoding(ast, [AST.unknownToJson]);
7799
+ return SchemaAST.replaceEncoding(ast, [SchemaAST.unknownToJson]);
7709
7800
  case "Undefined":
7710
7801
  case "Void":
7711
7802
  case "Literal":
@@ -7728,7 +7819,7 @@ function toCodecJsonBase(ast, recur) {
7728
7819
  {
7729
7820
  const sortedTypes = InternalSchema.jsonReorder(ast.types);
7730
7821
  if (sortedTypes !== ast.types) {
7731
- return new AST.Union(sortedTypes, ast.mode, ast.annotations, ast.checks, ast.encoding, ast.context).recur(recur);
7822
+ return new SchemaAST.Union(sortedTypes, ast.mode, ast.annotations, ast.checks, ast.encoding, ast.context).recur(recur);
7732
7823
  }
7733
7824
  return ast.recur(recur);
7734
7825
  }
@@ -7747,11 +7838,11 @@ function toCodecJsonBase(ast, recur) {
7747
7838
  * @since 4.0.0
7748
7839
  */
7749
7840
  export function toCodecIso(schema) {
7750
- return make(toCodecIsoTop(AST.toType(schema.ast)));
7841
+ return make(toCodecIsoTop(SchemaAST.toType(schema.ast)));
7751
7842
  }
7752
7843
  const toCodecIsoTop = /*#__PURE__*/memoize(ast => {
7753
7844
  const out = toCodecIsoBase(ast, toCodecIsoTop);
7754
- return out !== ast && AST.isOptional(ast) ? AST.optionalKeyLastLink(out) : out;
7845
+ return out !== ast && SchemaAST.isOptional(ast) ? SchemaAST.optionalKeyLastLink(out) : out;
7755
7846
  });
7756
7847
  function toCodecIsoBase(ast, recur) {
7757
7848
  switch (ast._tag) {
@@ -7761,7 +7852,7 @@ function toCodecIsoBase(ast, recur) {
7761
7852
  if (Predicate.isFunction(getLink)) {
7762
7853
  const link = getLink(ast.typeParameters.map(tp => InternalSchema.make(tp)));
7763
7854
  const to = recur(link.to);
7764
- return AST.replaceEncoding(ast, to === link.to ? [link] : [new AST.Link(to, link.transformation)]);
7855
+ return SchemaAST.replaceEncoding(ast, to === link.to ? [link] : [new SchemaAST.Link(to, link.transformation)]);
7765
7856
  }
7766
7857
  return ast;
7767
7858
  }
@@ -7905,20 +7996,20 @@ function serializerTree(ast, recur, onMissingAnnotation) {
7905
7996
  {
7906
7997
  const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
7907
7998
  if (Predicate.isFunction(getLink)) {
7908
- const tps = AST.isDeclaration(ast) ? ast.typeParameters.map(tp => make(recur(AST.toEncoded(tp)))) : [];
7999
+ const tps = SchemaAST.isDeclaration(ast) ? ast.typeParameters.map(tp => make(recur(SchemaAST.toEncoded(tp)))) : [];
7909
8000
  const link = getLink(tps);
7910
8001
  const to = recur(link.to);
7911
- return AST.replaceEncoding(ast, to === link.to ? [link] : [new AST.Link(to, link.transformation)]);
8002
+ return SchemaAST.replaceEncoding(ast, to === link.to ? [link] : [new SchemaAST.Link(to, link.transformation)]);
7912
8003
  }
7913
8004
  return onMissingAnnotation(ast);
7914
8005
  }
7915
8006
  case "Null":
7916
- return AST.replaceEncoding(ast, [nullToString]);
8007
+ return SchemaAST.replaceEncoding(ast, [nullToString]);
7917
8008
  case "Boolean":
7918
- return AST.replaceEncoding(ast, [booleanToString]);
8009
+ return SchemaAST.replaceEncoding(ast, [booleanToString]);
7919
8010
  case "Unknown":
7920
8011
  case "ObjectKeyword":
7921
- return AST.replaceEncoding(ast, [AST.unknownToStringTree]);
8012
+ return SchemaAST.replaceEncoding(ast, [SchemaAST.unknownToStringTree]);
7922
8013
  case "Enum":
7923
8014
  case "Number":
7924
8015
  case "Literal":
@@ -7939,7 +8030,7 @@ function serializerTree(ast, recur, onMissingAnnotation) {
7939
8030
  {
7940
8031
  const sortedTypes = treeReorder(ast.types);
7941
8032
  if (sortedTypes !== ast.types) {
7942
- return new AST.Union(sortedTypes, ast.mode, ast.annotations, ast.checks, ast.encoding, ast.context).recur(recur);
8033
+ return new SchemaAST.Union(sortedTypes, ast.mode, ast.annotations, ast.checks, ast.encoding, ast.context).recur(recur);
7943
8034
  }
7944
8035
  return ast.recur(recur);
7945
8036
  }
@@ -7950,34 +8041,34 @@ function serializerTree(ast, recur, onMissingAnnotation) {
7950
8041
  // `Schema.Any` is used as an escape hatch
7951
8042
  return ast;
7952
8043
  }
7953
- const nullToString = /*#__PURE__*/new AST.Link(/*#__PURE__*/new AST.Literal("null"), /*#__PURE__*/new Transformation.Transformation(/*#__PURE__*/Getter.transform(() => null), /*#__PURE__*/Getter.transform(() => "null")));
7954
- const booleanToString = /*#__PURE__*/new AST.Link(/*#__PURE__*/new AST.Union([/*#__PURE__*/new AST.Literal("true"), /*#__PURE__*/new AST.Literal("false")], "anyOf"), /*#__PURE__*/new Transformation.Transformation(/*#__PURE__*/Getter.transform(s => s === "true"), /*#__PURE__*/Getter.String()));
7955
- const serializerStringTree = /*#__PURE__*/AST.toCodec(ast => {
7956
- const out = serializerTree(ast, serializerStringTree, ast => AST.replaceEncoding(ast, [unknownToUndefined]));
7957
- if (out !== ast && AST.isOptional(ast)) {
7958
- return AST.optionalKeyLastLink(out);
8044
+ const nullToString = /*#__PURE__*/new SchemaAST.Link(/*#__PURE__*/new SchemaAST.Literal("null"), /*#__PURE__*/new SchemaTransformation.Transformation(/*#__PURE__*/SchemaGetter.transform(() => null), /*#__PURE__*/SchemaGetter.transform(() => "null")));
8045
+ const booleanToString = /*#__PURE__*/new SchemaAST.Link(/*#__PURE__*/new SchemaAST.Union([/*#__PURE__*/new SchemaAST.Literal("true"), /*#__PURE__*/new SchemaAST.Literal("false")], "anyOf"), /*#__PURE__*/new SchemaTransformation.Transformation(/*#__PURE__*/SchemaGetter.transform(s => s === "true"), /*#__PURE__*/SchemaGetter.String()));
8046
+ const serializerStringTree = /*#__PURE__*/SchemaAST.toCodec(ast => {
8047
+ const out = serializerTree(ast, serializerStringTree, ast => SchemaAST.replaceEncoding(ast, [unknownToUndefined]));
8048
+ if (out !== ast && SchemaAST.isOptional(ast)) {
8049
+ return SchemaAST.optionalKeyLastLink(out);
7959
8050
  }
7960
8051
  return out;
7961
8052
  });
7962
- const unknownToUndefined = /*#__PURE__*/new AST.Link(AST.undefined, /*#__PURE__*/new Transformation.Transformation(/*#__PURE__*/Getter.passthrough(), /*#__PURE__*/Getter.transform(() => undefined)));
7963
- const serializerStringTreeKeepDeclarations = /*#__PURE__*/AST.toCodec(ast => {
8053
+ const unknownToUndefined = /*#__PURE__*/new SchemaAST.Link(SchemaAST.undefined, /*#__PURE__*/new SchemaTransformation.Transformation(/*#__PURE__*/SchemaGetter.passthrough(), /*#__PURE__*/SchemaGetter.transform(() => undefined)));
8054
+ const serializerStringTreeKeepDeclarations = /*#__PURE__*/SchemaAST.toCodec(ast => {
7964
8055
  const out = serializerTree(ast, serializerStringTreeKeepDeclarations, identity);
7965
- if (out !== ast && AST.isOptional(ast)) {
7966
- return AST.optionalKeyLastLink(out);
8056
+ if (out !== ast && SchemaAST.isOptional(ast)) {
8057
+ return SchemaAST.optionalKeyLastLink(out);
7967
8058
  }
7968
8059
  return out;
7969
8060
  });
7970
8061
  const SERIALIZER_ENSURE_ARRAY = "~effect/Schema/SERIALIZER_ENSURE_ARRAY";
7971
- const toCodecEnsureArray = /*#__PURE__*/AST.toCodec(ast => {
7972
- if (AST.isUnion(ast) && ast.annotations?.[SERIALIZER_ENSURE_ARRAY]) {
8062
+ const toCodecEnsureArray = /*#__PURE__*/SchemaAST.toCodec(ast => {
8063
+ if (SchemaAST.isUnion(ast) && ast.annotations?.[SERIALIZER_ENSURE_ARRAY]) {
7973
8064
  return ast;
7974
8065
  }
7975
8066
  const out = onSerializerEnsureArray(ast);
7976
- if (AST.isArrays(out)) {
7977
- const ensure = new AST.Union([out, AST.decodeTo(AST.string, out, new Transformation.Transformation(Getter.split(), Getter.passthrough()))], "anyOf", {
8067
+ if (SchemaAST.isArrays(out)) {
8068
+ const ensure = new SchemaAST.Union([out, SchemaAST.decodeTo(SchemaAST.string, out, new SchemaTransformation.Transformation(SchemaGetter.split(), SchemaGetter.passthrough()))], "anyOf", {
7978
8069
  [SERIALIZER_ENSURE_ARRAY]: true
7979
8070
  });
7980
- return AST.isOptional(ast) ? AST.optionalKey(ensure) : ensure;
8071
+ return SchemaAST.isOptional(ast) ? SchemaAST.optionalKey(ensure) : ensure;
7981
8072
  }
7982
8073
  return out;
7983
8074
  });
@@ -8005,7 +8096,7 @@ function onSerializerEnsureArray(ast) {
8005
8096
  */
8006
8097
  export function toIso(schema) {
8007
8098
  const serializer = toCodecIso(schema);
8008
- return Optic_.makeIso(Parser.encodeSync(serializer), Parser.decodeSync(serializer));
8099
+ return Optic_.makeIso(SchemaParser.encodeSync(serializer), SchemaParser.decodeSync(serializer));
8009
8100
  }
8010
8101
  /**
8011
8102
  * Returns an identity `Iso` over the schema's source (`Type`) side.
@@ -8044,8 +8135,8 @@ export function toIsoFocus(_) {
8044
8135
  */
8045
8136
  export function overrideToCodecIso(to, transformation) {
8046
8137
  return schema => {
8047
- return make(AST.annotate(schema.ast, {
8048
- toCodecIso: () => new AST.Link(to.ast, Transformation.make(transformation))
8138
+ return make(SchemaAST.annotate(schema.ast, {
8139
+ toCodecIso: () => new SchemaAST.Link(to.ast, SchemaTransformation.make(transformation))
8049
8140
  }), {
8050
8141
  schema
8051
8142
  });
@@ -8059,13 +8150,13 @@ export function overrideToCodecIso(to, transformation) {
8059
8150
  * {@link toCodecJson}), computes RFC 6902 JSON Patch operations between old
8060
8151
  * and new values, and can apply patches back to the typed value.
8061
8152
  *
8062
- * @category JsonPatch
8153
+ * @category converting
8063
8154
  * @since 4.0.0
8064
8155
  */
8065
8156
  export function toDifferJsonPatch(schema) {
8066
8157
  const serializer = toCodecJson(schema);
8067
- const get = Parser.encodeSync(serializer);
8068
- const set = Parser.decodeSync(serializer);
8158
+ const get = SchemaParser.encodeSync(serializer);
8159
+ const set = SchemaParser.decodeSync(serializer);
8069
8160
  return {
8070
8161
  empty: [],
8071
8162
  diff: (oldValue, newValue) => JsonPatch.get(get(oldValue), get(newValue)),
@@ -8102,18 +8193,18 @@ export function Tree(node) {
8102
8193
  * console.log(result._tag) // "Some"
8103
8194
  * ```
8104
8195
  *
8105
- * @category JSON
8196
+ * @category schemas
8106
8197
  * @since 4.0.0
8107
8198
  */
8108
- export const Json = /*#__PURE__*/make(AST.Json);
8199
+ export const Json = /*#__PURE__*/make(SchemaAST.Json);
8109
8200
  /**
8110
8201
  * Schema that accepts any mutable JSON-compatible value. See {@link Json} for
8111
8202
  * the immutable variant.
8112
8203
  *
8113
- * @category JSON
8204
+ * @category schemas
8114
8205
  * @since 4.0.0
8115
8206
  */
8116
- export const MutableJson = /*#__PURE__*/make(AST.MutableJson);
8207
+ export const MutableJson = /*#__PURE__*/make(SchemaAST.MutableJson);
8117
8208
  // -----------------------------------------------------------------------------
8118
8209
  // Annotations
8119
8210
  // -----------------------------------------------------------------------------