effect 4.0.0-beta.101 → 4.0.0-beta.103

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 (1580) hide show
  1. package/dist/Array.d.ts +971 -1037
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +462 -412
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +433 -756
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +200 -325
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +207 -267
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +107 -135
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +146 -188
  14. package/dist/Boolean.d.ts.map +1 -1
  15. package/dist/Boolean.js +64 -84
  16. package/dist/Boolean.js.map +1 -1
  17. package/dist/Brand.js.map +1 -1
  18. package/dist/Cache.d.ts +405 -254
  19. package/dist/Cache.d.ts.map +1 -1
  20. package/dist/Cache.js +166 -101
  21. package/dist/Cache.js.map +1 -1
  22. package/dist/Cause.d.ts +167 -277
  23. package/dist/Cause.d.ts.map +1 -1
  24. package/dist/Cause.js +122 -176
  25. package/dist/Cause.js.map +1 -1
  26. package/dist/Channel.d.ts +729 -768
  27. package/dist/Channel.d.ts.map +1 -1
  28. package/dist/Channel.js +541 -449
  29. package/dist/Channel.js.map +1 -1
  30. package/dist/ChannelSchema.d.ts +1 -1
  31. package/dist/ChannelSchema.d.ts.map +1 -1
  32. package/dist/ChannelSchema.js.map +1 -1
  33. package/dist/Chunk.d.ts +834 -1173
  34. package/dist/Chunk.d.ts.map +1 -1
  35. package/dist/Chunk.js +326 -439
  36. package/dist/Chunk.js.map +1 -1
  37. package/dist/Clock.d.ts +180 -49
  38. package/dist/Clock.d.ts.map +1 -1
  39. package/dist/Clock.js +96 -31
  40. package/dist/Clock.js.map +1 -1
  41. package/dist/Combiner.d.ts +20 -33
  42. package/dist/Combiner.d.ts.map +1 -1
  43. package/dist/Combiner.js +18 -30
  44. package/dist/Combiner.js.map +1 -1
  45. package/dist/Config.d.ts +226 -174
  46. package/dist/Config.d.ts.map +1 -1
  47. package/dist/Config.js +339 -267
  48. package/dist/Config.js.map +1 -1
  49. package/dist/ConfigProvider.d.ts +194 -68
  50. package/dist/ConfigProvider.d.ts.map +1 -1
  51. package/dist/ConfigProvider.js +122 -87
  52. package/dist/ConfigProvider.js.map +1 -1
  53. package/dist/Console.d.ts +233 -33
  54. package/dist/Console.d.ts.map +1 -1
  55. package/dist/Console.js +232 -32
  56. package/dist/Console.js.map +1 -1
  57. package/dist/Context.d.ts +151 -274
  58. package/dist/Context.d.ts.map +1 -1
  59. package/dist/Context.js +171 -214
  60. package/dist/Context.js.map +1 -1
  61. package/dist/Cron.d.ts +68 -77
  62. package/dist/Cron.d.ts.map +1 -1
  63. package/dist/Cron.js +57 -66
  64. package/dist/Cron.js.map +1 -1
  65. package/dist/Crypto.d.ts +13 -15
  66. package/dist/Crypto.d.ts.map +1 -1
  67. package/dist/Crypto.js +9 -10
  68. package/dist/Crypto.js.map +1 -1
  69. package/dist/Data.d.ts +60 -80
  70. package/dist/Data.d.ts.map +1 -1
  71. package/dist/Data.js +18 -24
  72. package/dist/Data.js.map +1 -1
  73. package/dist/DateTime.d.ts +562 -660
  74. package/dist/DateTime.d.ts.map +1 -1
  75. package/dist/DateTime.js +307 -362
  76. package/dist/DateTime.js.map +1 -1
  77. package/dist/Deferred.d.ts +253 -256
  78. package/dist/Deferred.d.ts.map +1 -1
  79. package/dist/Deferred.js +104 -96
  80. package/dist/Deferred.js.map +1 -1
  81. package/dist/Duration.d.ts +216 -308
  82. package/dist/Duration.d.ts.map +1 -1
  83. package/dist/Duration.js +132 -186
  84. package/dist/Duration.js.map +1 -1
  85. package/dist/Effect.d.ts +2897 -3342
  86. package/dist/Effect.d.ts.map +1 -1
  87. package/dist/Effect.js +1383 -1580
  88. package/dist/Effect.js.map +1 -1
  89. package/dist/Effectable.js.map +1 -1
  90. package/dist/Encoding.d.ts +22 -40
  91. package/dist/Encoding.d.ts.map +1 -1
  92. package/dist/Encoding.js +22 -40
  93. package/dist/Encoding.js.map +1 -1
  94. package/dist/Equal.d.ts +33 -37
  95. package/dist/Equal.d.ts.map +1 -1
  96. package/dist/Equal.js +29 -21
  97. package/dist/Equal.js.map +1 -1
  98. package/dist/Equivalence.d.ts +103 -105
  99. package/dist/Equivalence.d.ts.map +1 -1
  100. package/dist/Equivalence.js +77 -79
  101. package/dist/Equivalence.js.map +1 -1
  102. package/dist/ErrorReporter.d.ts +51 -27
  103. package/dist/ErrorReporter.d.ts.map +1 -1
  104. package/dist/ErrorReporter.js +50 -26
  105. package/dist/ErrorReporter.js.map +1 -1
  106. package/dist/ExecutionPlan.d.ts +13 -55
  107. package/dist/ExecutionPlan.d.ts.map +1 -1
  108. package/dist/ExecutionPlan.js +7 -28
  109. package/dist/ExecutionPlan.js.map +1 -1
  110. package/dist/Exit.d.ts +116 -192
  111. package/dist/Exit.d.ts.map +1 -1
  112. package/dist/Exit.js +82 -130
  113. package/dist/Exit.js.map +1 -1
  114. package/dist/Fiber.d.ts +82 -146
  115. package/dist/Fiber.d.ts.map +1 -1
  116. package/dist/Fiber.js +48 -87
  117. package/dist/Fiber.js.map +1 -1
  118. package/dist/FiberHandle.d.ts +152 -105
  119. package/dist/FiberHandle.d.ts.map +1 -1
  120. package/dist/FiberHandle.js +109 -75
  121. package/dist/FiberHandle.js.map +1 -1
  122. package/dist/FiberMap.d.ts +213 -168
  123. package/dist/FiberMap.d.ts.map +1 -1
  124. package/dist/FiberMap.js +114 -89
  125. package/dist/FiberMap.js.map +1 -1
  126. package/dist/FiberSet.d.ts +123 -81
  127. package/dist/FiberSet.d.ts.map +1 -1
  128. package/dist/FiberSet.js +85 -59
  129. package/dist/FiberSet.js.map +1 -1
  130. package/dist/FileSystem.d.ts +153 -264
  131. package/dist/FileSystem.d.ts.map +1 -1
  132. package/dist/FileSystem.js +42 -147
  133. package/dist/FileSystem.js.map +1 -1
  134. package/dist/Filter.d.ts +61 -33
  135. package/dist/Filter.d.ts.map +1 -1
  136. package/dist/Filter.js +26 -15
  137. package/dist/Filter.js.map +1 -1
  138. package/dist/Formatter.d.ts +25 -33
  139. package/dist/Formatter.d.ts.map +1 -1
  140. package/dist/Formatter.js +48 -49
  141. package/dist/Formatter.js.map +1 -1
  142. package/dist/Function.d.ts +76 -145
  143. package/dist/Function.d.ts.map +1 -1
  144. package/dist/Function.js +40 -57
  145. package/dist/Function.js.map +1 -1
  146. package/dist/Graph.d.ts +360 -714
  147. package/dist/Graph.d.ts.map +1 -1
  148. package/dist/Graph.js +168 -297
  149. package/dist/Graph.js.map +1 -1
  150. package/dist/HKT.d.ts +12 -6
  151. package/dist/HKT.d.ts.map +1 -1
  152. package/dist/Hash.d.ts +47 -83
  153. package/dist/Hash.d.ts.map +1 -1
  154. package/dist/Hash.js +46 -68
  155. package/dist/Hash.js.map +1 -1
  156. package/dist/HashMap.d.ts +319 -411
  157. package/dist/HashMap.d.ts.map +1 -1
  158. package/dist/HashMap.js +122 -166
  159. package/dist/HashMap.js.map +1 -1
  160. package/dist/HashRing.d.ts.map +1 -1
  161. package/dist/HashRing.js +1 -0
  162. package/dist/HashRing.js.map +1 -1
  163. package/dist/HashSet.d.ts +177 -284
  164. package/dist/HashSet.d.ts.map +1 -1
  165. package/dist/HashSet.js +68 -109
  166. package/dist/HashSet.js.map +1 -1
  167. package/dist/Inspectable.d.ts +12 -12
  168. package/dist/Inspectable.js +8 -8
  169. package/dist/Inspectable.js.map +1 -1
  170. package/dist/Iterable.d.ts +620 -786
  171. package/dist/Iterable.d.ts.map +1 -1
  172. package/dist/Iterable.js +230 -307
  173. package/dist/Iterable.js.map +1 -1
  174. package/dist/JsonPatch.d.ts +11 -13
  175. package/dist/JsonPatch.d.ts.map +1 -1
  176. package/dist/JsonPatch.js +46 -103
  177. package/dist/JsonPatch.js.map +1 -1
  178. package/dist/JsonPointer.d.ts +8 -8
  179. package/dist/JsonPointer.js +8 -8
  180. package/dist/JsonPointer.js.map +1 -1
  181. package/dist/JsonSchema.d.ts +98 -44
  182. package/dist/JsonSchema.d.ts.map +1 -1
  183. package/dist/JsonSchema.js +300 -239
  184. package/dist/JsonSchema.js.map +1 -1
  185. package/dist/Latch.d.ts +23 -35
  186. package/dist/Latch.d.ts.map +1 -1
  187. package/dist/Latch.js +16 -28
  188. package/dist/Latch.js.map +1 -1
  189. package/dist/Layer.d.ts +359 -260
  190. package/dist/Layer.d.ts.map +1 -1
  191. package/dist/Layer.js +195 -175
  192. package/dist/Layer.js.map +1 -1
  193. package/dist/LayerMap.d.ts +42 -29
  194. package/dist/LayerMap.d.ts.map +1 -1
  195. package/dist/LayerMap.js +31 -21
  196. package/dist/LayerMap.js.map +1 -1
  197. package/dist/LayerRef.d.ts +6 -2
  198. package/dist/LayerRef.d.ts.map +1 -1
  199. package/dist/LayerRef.js +6 -2
  200. package/dist/LayerRef.js.map +1 -1
  201. package/dist/LogLevel.d.ts +114 -214
  202. package/dist/LogLevel.d.ts.map +1 -1
  203. package/dist/LogLevel.js +41 -76
  204. package/dist/LogLevel.js.map +1 -1
  205. package/dist/Logger.d.ts +218 -467
  206. package/dist/Logger.d.ts.map +1 -1
  207. package/dist/Logger.js +207 -452
  208. package/dist/Logger.js.map +1 -1
  209. package/dist/ManagedRuntime.d.ts +16 -5
  210. package/dist/ManagedRuntime.d.ts.map +1 -1
  211. package/dist/ManagedRuntime.js +10 -5
  212. package/dist/ManagedRuntime.js.map +1 -1
  213. package/dist/Match.d.ts +217 -252
  214. package/dist/Match.d.ts.map +1 -1
  215. package/dist/Match.js +150 -183
  216. package/dist/Match.js.map +1 -1
  217. package/dist/Metric.d.ts +442 -993
  218. package/dist/Metric.d.ts.map +1 -1
  219. package/dist/Metric.js +202 -645
  220. package/dist/Metric.js.map +1 -1
  221. package/dist/MutableHashMap.d.ts +144 -173
  222. package/dist/MutableHashMap.d.ts.map +1 -1
  223. package/dist/MutableHashMap.js +68 -79
  224. package/dist/MutableHashMap.js.map +1 -1
  225. package/dist/MutableHashSet.d.ts +84 -89
  226. package/dist/MutableHashSet.d.ts.map +1 -1
  227. package/dist/MutableHashSet.js +44 -47
  228. package/dist/MutableHashSet.js.map +1 -1
  229. package/dist/MutableList.d.ts +71 -370
  230. package/dist/MutableList.d.ts.map +1 -1
  231. package/dist/MutableList.js +59 -284
  232. package/dist/MutableList.js.map +1 -1
  233. package/dist/MutableRef.d.ts +420 -243
  234. package/dist/MutableRef.d.ts.map +1 -1
  235. package/dist/MutableRef.js +209 -120
  236. package/dist/MutableRef.js.map +1 -1
  237. package/dist/Newtype.d.ts +21 -14
  238. package/dist/Newtype.d.ts.map +1 -1
  239. package/dist/Newtype.js +15 -13
  240. package/dist/Newtype.js.map +1 -1
  241. package/dist/NonEmptyIterable.d.ts +7 -137
  242. package/dist/NonEmptyIterable.d.ts.map +1 -1
  243. package/dist/NonEmptyIterable.js +5 -93
  244. package/dist/NonEmptyIterable.js.map +1 -1
  245. package/dist/Number.d.ts +196 -233
  246. package/dist/Number.d.ts.map +1 -1
  247. package/dist/Number.js +90 -109
  248. package/dist/Number.js.map +1 -1
  249. package/dist/Optic.d.ts +97 -189
  250. package/dist/Optic.d.ts.map +1 -1
  251. package/dist/Optic.js +190 -292
  252. package/dist/Optic.js.map +1 -1
  253. package/dist/Option.d.ts +447 -812
  254. package/dist/Option.d.ts.map +1 -1
  255. package/dist/Option.js +213 -393
  256. package/dist/Option.js.map +1 -1
  257. package/dist/Order.d.ts +109 -109
  258. package/dist/Order.js +91 -91
  259. package/dist/Order.js.map +1 -1
  260. package/dist/Ordering.d.ts +20 -23
  261. package/dist/Ordering.d.ts.map +1 -1
  262. package/dist/Ordering.js +8 -9
  263. package/dist/Ordering.js.map +1 -1
  264. package/dist/PartitionedSemaphore.d.ts.map +1 -1
  265. package/dist/PartitionedSemaphore.js +1 -4
  266. package/dist/PartitionedSemaphore.js.map +1 -1
  267. package/dist/Path.d.ts +38 -41
  268. package/dist/Path.d.ts.map +1 -1
  269. package/dist/Path.js +3 -4
  270. package/dist/Path.js.map +1 -1
  271. package/dist/Pipeable.d.ts +6 -5
  272. package/dist/Pipeable.d.ts.map +1 -1
  273. package/dist/Pipeable.js +2 -2
  274. package/dist/Pipeable.js.map +1 -1
  275. package/dist/PlatformError.d.ts +4 -4
  276. package/dist/PlatformError.js +3 -3
  277. package/dist/PlatformError.js.map +1 -1
  278. package/dist/Pool.d.ts +4 -2
  279. package/dist/Pool.d.ts.map +1 -1
  280. package/dist/Pool.js +4 -2
  281. package/dist/Pool.js.map +1 -1
  282. package/dist/Predicate.d.ts +200 -181
  283. package/dist/Predicate.d.ts.map +1 -1
  284. package/dist/Predicate.js +100 -108
  285. package/dist/Predicate.js.map +1 -1
  286. package/dist/PrimaryKey.d.ts +7 -7
  287. package/dist/PrimaryKey.js +5 -5
  288. package/dist/PrimaryKey.js.map +1 -1
  289. package/dist/PubSub.d.ts +425 -494
  290. package/dist/PubSub.d.ts.map +1 -1
  291. package/dist/PubSub.js +373 -362
  292. package/dist/PubSub.js.map +1 -1
  293. package/dist/Pull.d.ts +24 -18
  294. package/dist/Pull.d.ts.map +1 -1
  295. package/dist/Pull.js +11 -9
  296. package/dist/Pull.js.map +1 -1
  297. package/dist/Queue.d.ts +200 -159
  298. package/dist/Queue.d.ts.map +1 -1
  299. package/dist/Queue.js +162 -132
  300. package/dist/Queue.js.map +1 -1
  301. package/dist/Random.d.ts +49 -74
  302. package/dist/Random.d.ts.map +1 -1
  303. package/dist/Random.js +35 -54
  304. package/dist/Random.js.map +1 -1
  305. package/dist/RcMap.d.ts +121 -63
  306. package/dist/RcMap.d.ts.map +1 -1
  307. package/dist/RcMap.js +42 -21
  308. package/dist/RcMap.js.map +1 -1
  309. package/dist/RcRef.d.ts +24 -13
  310. package/dist/RcRef.d.ts.map +1 -1
  311. package/dist/RcRef.js +15 -9
  312. package/dist/RcRef.js.map +1 -1
  313. package/dist/Record.d.ts +361 -466
  314. package/dist/Record.d.ts.map +1 -1
  315. package/dist/Record.js +163 -216
  316. package/dist/Record.js.map +1 -1
  317. package/dist/Redactable.d.ts +6 -2
  318. package/dist/Redactable.d.ts.map +1 -1
  319. package/dist/Redactable.js +7 -2
  320. package/dist/Redactable.js.map +1 -1
  321. package/dist/Redacted.d.ts +25 -25
  322. package/dist/Redacted.d.ts.map +1 -1
  323. package/dist/Redacted.js +19 -20
  324. package/dist/Redacted.js.map +1 -1
  325. package/dist/Reducer.d.ts +8 -15
  326. package/dist/Reducer.d.ts.map +1 -1
  327. package/dist/Reducer.js +6 -12
  328. package/dist/Reducer.js.map +1 -1
  329. package/dist/Ref.d.ts +95 -165
  330. package/dist/Ref.d.ts.map +1 -1
  331. package/dist/Ref.js +75 -122
  332. package/dist/Ref.js.map +1 -1
  333. package/dist/References.d.ts +102 -213
  334. package/dist/References.d.ts.map +1 -1
  335. package/dist/References.js +102 -213
  336. package/dist/References.js.map +1 -1
  337. package/dist/RegExp.d.ts +10 -14
  338. package/dist/RegExp.d.ts.map +1 -1
  339. package/dist/RegExp.js +10 -14
  340. package/dist/RegExp.js.map +1 -1
  341. package/dist/Request.d.ts +31 -21
  342. package/dist/Request.d.ts.map +1 -1
  343. package/dist/Request.js +25 -19
  344. package/dist/Request.js.map +1 -1
  345. package/dist/RequestResolver.d.ts +201 -90
  346. package/dist/RequestResolver.d.ts.map +1 -1
  347. package/dist/RequestResolver.js +87 -41
  348. package/dist/RequestResolver.js.map +1 -1
  349. package/dist/Resource.js.map +1 -1
  350. package/dist/Result.d.ts +302 -470
  351. package/dist/Result.d.ts.map +1 -1
  352. package/dist/Result.js +135 -218
  353. package/dist/Result.js.map +1 -1
  354. package/dist/Runtime.d.ts +50 -75
  355. package/dist/Runtime.d.ts.map +1 -1
  356. package/dist/Runtime.js +39 -60
  357. package/dist/Runtime.js.map +1 -1
  358. package/dist/Schedule.d.ts +290 -1636
  359. package/dist/Schedule.d.ts.map +1 -1
  360. package/dist/Schedule.js +162 -803
  361. package/dist/Schedule.js.map +1 -1
  362. package/dist/Scheduler.d.ts +5 -5
  363. package/dist/Scheduler.d.ts.map +1 -1
  364. package/dist/Scheduler.js +18 -6
  365. package/dist/Scheduler.js.map +1 -1
  366. package/dist/Schema.d.ts +1835 -1060
  367. package/dist/Schema.d.ts.map +1 -1
  368. package/dist/Schema.js +2708 -1050
  369. package/dist/Schema.js.map +1 -1
  370. package/dist/SchemaAST.d.ts +29 -52
  371. package/dist/SchemaAST.d.ts.map +1 -1
  372. package/dist/SchemaAST.js +537 -391
  373. package/dist/SchemaAST.js.map +1 -1
  374. package/dist/SchemaError.d.ts +7 -6
  375. package/dist/SchemaError.d.ts.map +1 -1
  376. package/dist/SchemaError.js +8 -7
  377. package/dist/SchemaError.js.map +1 -1
  378. package/dist/SchemaGetter.d.ts +230 -185
  379. package/dist/SchemaGetter.d.ts.map +1 -1
  380. package/dist/SchemaGetter.js +252 -209
  381. package/dist/SchemaGetter.js.map +1 -1
  382. package/dist/SchemaIssue.d.ts +62 -190
  383. package/dist/SchemaIssue.d.ts.map +1 -1
  384. package/dist/SchemaIssue.js +74 -266
  385. package/dist/SchemaIssue.js.map +1 -1
  386. package/dist/SchemaParser.d.ts +2 -2
  387. package/dist/SchemaParser.d.ts.map +1 -1
  388. package/dist/SchemaParser.js +123 -86
  389. package/dist/SchemaParser.js.map +1 -1
  390. package/dist/SchemaRepresentation.d.ts +398 -1513
  391. package/dist/SchemaRepresentation.d.ts.map +1 -1
  392. package/dist/SchemaRepresentation.js +290 -2854
  393. package/dist/SchemaRepresentation.js.map +1 -1
  394. package/dist/SchemaTransformation.d.ts +116 -76
  395. package/dist/SchemaTransformation.d.ts.map +1 -1
  396. package/dist/SchemaTransformation.js +123 -88
  397. package/dist/SchemaTransformation.js.map +1 -1
  398. package/dist/Scope.d.ts +123 -151
  399. package/dist/Scope.d.ts.map +1 -1
  400. package/dist/Scope.js +72 -92
  401. package/dist/Scope.js.map +1 -1
  402. package/dist/ScopedCache.js.map +1 -1
  403. package/dist/ScopedRef.d.ts +3 -3
  404. package/dist/ScopedRef.js +2 -2
  405. package/dist/ScopedRef.js.map +1 -1
  406. package/dist/Semaphore.d.ts +101 -13
  407. package/dist/Semaphore.d.ts.map +1 -1
  408. package/dist/Semaphore.js +78 -39
  409. package/dist/Semaphore.js.map +1 -1
  410. package/dist/Sink.d.ts +117 -107
  411. package/dist/Sink.d.ts.map +1 -1
  412. package/dist/Sink.js +107 -100
  413. package/dist/Sink.js.map +1 -1
  414. package/dist/Stdio.d.ts +1 -1
  415. package/dist/Stdio.js.map +1 -1
  416. package/dist/Stream.d.ts +2430 -2958
  417. package/dist/Stream.d.ts.map +1 -1
  418. package/dist/Stream.js +1124 -1397
  419. package/dist/Stream.js.map +1 -1
  420. package/dist/String.d.ts +262 -308
  421. package/dist/String.d.ts.map +1 -1
  422. package/dist/String.js +184 -215
  423. package/dist/String.js.map +1 -1
  424. package/dist/Struct.d.ts +109 -114
  425. package/dist/Struct.d.ts.map +1 -1
  426. package/dist/Struct.js +46 -54
  427. package/dist/Struct.js.map +1 -1
  428. package/dist/SubscriptionRef.d.ts +282 -250
  429. package/dist/SubscriptionRef.d.ts.map +1 -1
  430. package/dist/SubscriptionRef.js +104 -92
  431. package/dist/SubscriptionRef.js.map +1 -1
  432. package/dist/Symbol.d.ts +3 -3
  433. package/dist/Symbol.js +3 -3
  434. package/dist/Symbol.js.map +1 -1
  435. package/dist/SynchronizedRef.js.map +1 -1
  436. package/dist/Take.js.map +1 -1
  437. package/dist/Terminal.d.ts +2 -2
  438. package/dist/Terminal.js +1 -1
  439. package/dist/Terminal.js.map +1 -1
  440. package/dist/Tracer.d.ts +100 -54
  441. package/dist/Tracer.d.ts.map +1 -1
  442. package/dist/Tracer.js +41 -24
  443. package/dist/Tracer.js.map +1 -1
  444. package/dist/Trie.d.ts +287 -679
  445. package/dist/Trie.d.ts.map +1 -1
  446. package/dist/Trie.js +109 -251
  447. package/dist/Trie.js.map +1 -1
  448. package/dist/Tuple.d.ts +92 -127
  449. package/dist/Tuple.d.ts.map +1 -1
  450. package/dist/Tuple.js +42 -57
  451. package/dist/Tuple.js.map +1 -1
  452. package/dist/TxChunk.d.ts +201 -121
  453. package/dist/TxChunk.d.ts.map +1 -1
  454. package/dist/TxChunk.js +85 -56
  455. package/dist/TxChunk.js.map +1 -1
  456. package/dist/TxDeferred.d.ts +62 -46
  457. package/dist/TxDeferred.d.ts.map +1 -1
  458. package/dist/TxDeferred.js +30 -22
  459. package/dist/TxDeferred.js.map +1 -1
  460. package/dist/TxHashMap.d.ts +631 -779
  461. package/dist/TxHashMap.d.ts.map +1 -1
  462. package/dist/TxHashMap.js +268 -330
  463. package/dist/TxHashMap.js.map +1 -1
  464. package/dist/TxHashSet.d.ts +297 -236
  465. package/dist/TxHashSet.d.ts.map +1 -1
  466. package/dist/TxHashSet.js +130 -100
  467. package/dist/TxHashSet.js.map +1 -1
  468. package/dist/TxPriorityQueue.d.ts +126 -95
  469. package/dist/TxPriorityQueue.d.ts.map +1 -1
  470. package/dist/TxPriorityQueue.js +74 -56
  471. package/dist/TxPriorityQueue.js.map +1 -1
  472. package/dist/TxPubSub.d.ts +101 -88
  473. package/dist/TxPubSub.d.ts.map +1 -1
  474. package/dist/TxPubSub.js +87 -66
  475. package/dist/TxPubSub.js.map +1 -1
  476. package/dist/TxQueue.d.ts +200 -180
  477. package/dist/TxQueue.d.ts.map +1 -1
  478. package/dist/TxQueue.js +160 -136
  479. package/dist/TxQueue.js.map +1 -1
  480. package/dist/TxReentrantLock.d.ts +97 -66
  481. package/dist/TxReentrantLock.d.ts.map +1 -1
  482. package/dist/TxReentrantLock.js +67 -45
  483. package/dist/TxReentrantLock.js.map +1 -1
  484. package/dist/TxRef.d.ts +51 -32
  485. package/dist/TxRef.d.ts.map +1 -1
  486. package/dist/TxRef.js +23 -15
  487. package/dist/TxRef.js.map +1 -1
  488. package/dist/TxSemaphore.d.ts +129 -95
  489. package/dist/TxSemaphore.d.ts.map +1 -1
  490. package/dist/TxSemaphore.js +85 -70
  491. package/dist/TxSemaphore.js.map +1 -1
  492. package/dist/TxSubscriptionRef.d.ts +97 -70
  493. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  494. package/dist/TxSubscriptionRef.js +44 -34
  495. package/dist/TxSubscriptionRef.js.map +1 -1
  496. package/dist/Types.d.ts +127 -70
  497. package/dist/Types.d.ts.map +1 -1
  498. package/dist/UndefinedOr.js.map +1 -1
  499. package/dist/Unify.d.ts +45 -65
  500. package/dist/Unify.d.ts.map +1 -1
  501. package/dist/Unify.js +6 -9
  502. package/dist/Unify.js.map +1 -1
  503. package/dist/Utils.d.ts +23 -16
  504. package/dist/Utils.d.ts.map +1 -1
  505. package/dist/Utils.js +3 -7
  506. package/dist/Utils.js.map +1 -1
  507. package/dist/index.d.ts +0 -4
  508. package/dist/index.d.ts.map +1 -1
  509. package/dist/index.js +0 -4
  510. package/dist/index.js.map +1 -1
  511. package/dist/internal/array.js.map +1 -1
  512. package/dist/internal/core.js +3 -2
  513. package/dist/internal/core.js.map +1 -1
  514. package/dist/internal/dateTime.js +4 -0
  515. package/dist/internal/dateTime.js.map +1 -1
  516. package/dist/internal/doNotation.js.map +1 -1
  517. package/dist/internal/effect.js +141 -61
  518. package/dist/internal/effect.js.map +1 -1
  519. package/dist/internal/equal.js.map +1 -1
  520. package/dist/internal/errors.js.map +1 -1
  521. package/dist/internal/executionPlan.js.map +1 -1
  522. package/dist/internal/hashMap.js.map +1 -1
  523. package/dist/internal/hashSet.js.map +1 -1
  524. package/dist/internal/layer.js.map +1 -1
  525. package/dist/internal/matcher.js +1 -1
  526. package/dist/internal/matcher.js.map +1 -1
  527. package/dist/internal/metric.js.map +1 -1
  528. package/dist/internal/option.js.map +1 -1
  529. package/dist/internal/persistence.d.ts +2 -0
  530. package/dist/internal/persistence.d.ts.map +1 -0
  531. package/dist/internal/persistence.js +3 -0
  532. package/dist/internal/persistence.js.map +1 -0
  533. package/dist/internal/random.js.map +1 -1
  534. package/dist/internal/rcRef.js.map +1 -1
  535. package/dist/internal/record.d.ts +0 -3
  536. package/dist/internal/record.d.ts.map +1 -1
  537. package/dist/internal/record.js +10 -5
  538. package/dist/internal/record.js.map +1 -1
  539. package/dist/internal/redacted.js.map +1 -1
  540. package/dist/internal/references.js +3 -4
  541. package/dist/internal/references.js.map +1 -1
  542. package/dist/internal/request.js.map +1 -1
  543. package/dist/internal/result.js.map +1 -1
  544. package/dist/internal/schedule.js.map +1 -1
  545. package/dist/internal/schema/annotations.js +12 -0
  546. package/dist/internal/schema/annotations.js.map +1 -1
  547. package/dist/internal/schema/cause.js.map +1 -1
  548. package/dist/internal/schema/fromJsonSchemaDocument.d.ts +2 -0
  549. package/dist/internal/schema/fromJsonSchemaDocument.d.ts.map +1 -0
  550. package/dist/internal/schema/fromJsonSchemaDocument.js +745 -0
  551. package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -0
  552. package/dist/internal/schema/fromRepresentation.d.ts +2 -0
  553. package/dist/internal/schema/fromRepresentation.d.ts.map +1 -0
  554. package/dist/internal/schema/fromRepresentation.js +245 -0
  555. package/dist/internal/schema/fromRepresentation.js.map +1 -0
  556. package/dist/internal/schema/parser.d.ts +14 -0
  557. package/dist/internal/schema/parser.d.ts.map +1 -0
  558. package/dist/internal/schema/parser.js +13 -0
  559. package/dist/internal/schema/parser.js.map +1 -0
  560. package/dist/internal/schema/schema.js +28 -40
  561. package/dist/internal/schema/schema.js.map +1 -1
  562. package/dist/internal/schema/{arbitrary.d.ts → toArbitrary.d.ts} +1 -1
  563. package/dist/internal/schema/toArbitrary.d.ts.map +1 -0
  564. package/dist/internal/schema/{arbitrary.js → toArbitrary.js} +8 -9
  565. package/dist/internal/schema/toArbitrary.js.map +1 -0
  566. package/dist/internal/schema/toCodeDocument.d.ts +2 -0
  567. package/dist/internal/schema/toCodeDocument.d.ts.map +1 -0
  568. package/dist/internal/schema/toCodeDocument.js +438 -0
  569. package/dist/internal/schema/toCodeDocument.js.map +1 -0
  570. package/dist/internal/schema/toEquivalence.d.ts +2 -0
  571. package/dist/internal/schema/toEquivalence.d.ts.map +1 -0
  572. package/dist/internal/schema/{equivalence.js → toEquivalence.js} +15 -13
  573. package/dist/internal/schema/toEquivalence.js.map +1 -0
  574. package/dist/internal/schema/toJsonSchemaDocument.d.ts +2 -0
  575. package/dist/internal/schema/toJsonSchemaDocument.d.ts.map +1 -0
  576. package/dist/internal/schema/toJsonSchemaDocument.js +508 -0
  577. package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -0
  578. package/dist/internal/schema/toRepresentation.d.ts +2 -0
  579. package/dist/internal/schema/toRepresentation.d.ts.map +1 -0
  580. package/dist/internal/schema/toRepresentation.js +349 -0
  581. package/dist/internal/schema/toRepresentation.js.map +1 -0
  582. package/dist/internal/stackTraceLimit.js +3 -6
  583. package/dist/internal/stackTraceLimit.js.map +1 -1
  584. package/dist/internal/stream.js.map +1 -1
  585. package/dist/internal/tracer.js.map +1 -1
  586. package/dist/internal/trie.js +13 -9
  587. package/dist/internal/trie.js.map +1 -1
  588. package/dist/testing/FastCheck.d.ts +8 -7
  589. package/dist/testing/FastCheck.d.ts.map +1 -1
  590. package/dist/testing/FastCheck.js +8 -7
  591. package/dist/testing/FastCheck.js.map +1 -1
  592. package/dist/testing/TestClock.d.ts +57 -28
  593. package/dist/testing/TestClock.d.ts.map +1 -1
  594. package/dist/testing/TestClock.js +54 -19
  595. package/dist/testing/TestClock.js.map +1 -1
  596. package/dist/testing/TestConsole.d.ts +32 -31
  597. package/dist/testing/TestConsole.d.ts.map +1 -1
  598. package/dist/testing/TestConsole.js +24 -22
  599. package/dist/testing/TestConsole.js.map +1 -1
  600. package/dist/testing/TestSchema.d.ts +29 -29
  601. package/dist/testing/TestSchema.js +25 -25
  602. package/dist/testing/TestSchema.js.map +1 -1
  603. package/dist/testing/index.js.map +1 -1
  604. package/dist/unstable/ai/AiError.d.ts +121 -144
  605. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  606. package/dist/unstable/ai/AiError.js +99 -121
  607. package/dist/unstable/ai/AiError.js.map +1 -1
  608. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +22 -7
  609. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
  610. package/dist/unstable/ai/AnthropicStructuredOutput.js +87 -317
  611. package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
  612. package/dist/unstable/ai/Chat.d.ts +132 -97
  613. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  614. package/dist/unstable/ai/Chat.js +55 -51
  615. package/dist/unstable/ai/Chat.js.map +1 -1
  616. package/dist/unstable/ai/EmbeddingModel.d.ts +1 -1
  617. package/dist/unstable/ai/EmbeddingModel.js +1 -1
  618. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  619. package/dist/unstable/ai/IdGenerator.d.ts +32 -28
  620. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  621. package/dist/unstable/ai/IdGenerator.js +26 -21
  622. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  623. package/dist/unstable/ai/LanguageModel.d.ts +111 -68
  624. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  625. package/dist/unstable/ai/LanguageModel.js +123 -81
  626. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  627. package/dist/unstable/ai/McpProtocol.d.ts +30 -0
  628. package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
  629. package/dist/unstable/ai/McpProtocol.js +20 -0
  630. package/dist/unstable/ai/McpProtocol.js.map +1 -0
  631. package/dist/unstable/ai/McpSchema.d.ts +316 -250
  632. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  633. package/dist/unstable/ai/McpSchema.js +71 -63
  634. package/dist/unstable/ai/McpSchema.js.map +1 -1
  635. package/dist/unstable/ai/McpServer.d.ts +71 -62
  636. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  637. package/dist/unstable/ai/McpServer.js +765 -245
  638. package/dist/unstable/ai/McpServer.js.map +1 -1
  639. package/dist/unstable/ai/Model.d.ts +8 -19
  640. package/dist/unstable/ai/Model.d.ts.map +1 -1
  641. package/dist/unstable/ai/Model.js +9 -20
  642. package/dist/unstable/ai/Model.js.map +1 -1
  643. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +33 -11
  644. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
  645. package/dist/unstable/ai/OpenAiStructuredOutput.js +194 -378
  646. package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
  647. package/dist/unstable/ai/Prompt.d.ts +112 -38
  648. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  649. package/dist/unstable/ai/Prompt.js +53 -17
  650. package/dist/unstable/ai/Prompt.js.map +1 -1
  651. package/dist/unstable/ai/Response.d.ts +47 -33
  652. package/dist/unstable/ai/Response.d.ts.map +1 -1
  653. package/dist/unstable/ai/Response.js +23 -18
  654. package/dist/unstable/ai/Response.js.map +1 -1
  655. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  656. package/dist/unstable/ai/Telemetry.d.ts +46 -13
  657. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  658. package/dist/unstable/ai/Telemetry.js +18 -7
  659. package/dist/unstable/ai/Telemetry.js.map +1 -1
  660. package/dist/unstable/ai/Tokenizer.d.ts +14 -3
  661. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  662. package/dist/unstable/ai/Tokenizer.js +10 -2
  663. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  664. package/dist/unstable/ai/Tool.d.ts +63 -44
  665. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  666. package/dist/unstable/ai/Tool.js +59 -42
  667. package/dist/unstable/ai/Tool.js.map +1 -1
  668. package/dist/unstable/ai/Toolkit.d.ts +35 -9
  669. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  670. package/dist/unstable/ai/Toolkit.js +32 -14
  671. package/dist/unstable/ai/Toolkit.js.map +1 -1
  672. package/dist/unstable/ai/index.d.ts +4 -0
  673. package/dist/unstable/ai/index.d.ts.map +1 -1
  674. package/dist/unstable/ai/index.js +4 -0
  675. package/dist/unstable/ai/index.js.map +1 -1
  676. package/dist/unstable/ai/internal/codec-transformer.js +15 -12
  677. package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
  678. package/dist/unstable/ai/internal/mcpProtocol.d.ts +21 -0
  679. package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
  680. package/dist/unstable/ai/internal/mcpProtocol.js +22 -0
  681. package/dist/unstable/ai/internal/mcpProtocol.js.map +1 -0
  682. package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts +2 -0
  683. package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts.map +1 -0
  684. package/dist/unstable/ai/internal/mcpProtocolRegistry.js +32 -0
  685. package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
  686. package/dist/unstable/ai/internal/structured-output.d.ts +2 -0
  687. package/dist/unstable/ai/internal/structured-output.d.ts.map +1 -0
  688. package/dist/unstable/ai/internal/structured-output.js +315 -0
  689. package/dist/unstable/ai/internal/structured-output.js.map +1 -0
  690. package/dist/unstable/cli/Argument.d.ts +273 -69
  691. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  692. package/dist/unstable/cli/Argument.js +111 -33
  693. package/dist/unstable/cli/Argument.js.map +1 -1
  694. package/dist/unstable/cli/CliConfig.js.map +1 -1
  695. package/dist/unstable/cli/CliError.d.ts +105 -74
  696. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  697. package/dist/unstable/cli/CliError.js +98 -63
  698. package/dist/unstable/cli/CliError.js.map +1 -1
  699. package/dist/unstable/cli/CliOutput.d.ts +35 -54
  700. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  701. package/dist/unstable/cli/CliOutput.js +26 -42
  702. package/dist/unstable/cli/CliOutput.js.map +1 -1
  703. package/dist/unstable/cli/Command.d.ts +705 -107
  704. package/dist/unstable/cli/Command.d.ts.map +1 -1
  705. package/dist/unstable/cli/Command.js +252 -47
  706. package/dist/unstable/cli/Command.js.map +1 -1
  707. package/dist/unstable/cli/Completions.js.map +1 -1
  708. package/dist/unstable/cli/Flag.d.ts +418 -138
  709. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  710. package/dist/unstable/cli/Flag.js +197 -71
  711. package/dist/unstable/cli/Flag.js.map +1 -1
  712. package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
  713. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  714. package/dist/unstable/cli/HelpDoc.d.ts +12 -4
  715. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  716. package/dist/unstable/cli/Param.d.ts +292 -78
  717. package/dist/unstable/cli/Param.d.ts.map +1 -1
  718. package/dist/unstable/cli/Param.js +131 -49
  719. package/dist/unstable/cli/Param.js.map +1 -1
  720. package/dist/unstable/cli/Primitive.d.ts +370 -149
  721. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  722. package/dist/unstable/cli/Primitive.js +345 -137
  723. package/dist/unstable/cli/Primitive.js.map +1 -1
  724. package/dist/unstable/cli/Prompt.d.ts +23 -14
  725. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  726. package/dist/unstable/cli/Prompt.js +23 -14
  727. package/dist/unstable/cli/Prompt.js.map +1 -1
  728. package/dist/unstable/cli/index.js.map +1 -1
  729. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  730. package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
  731. package/dist/unstable/cli/internal/command.d.ts +3 -1
  732. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  733. package/dist/unstable/cli/internal/command.js +11 -4
  734. package/dist/unstable/cli/internal/command.js.map +1 -1
  735. package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
  736. package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
  737. package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
  738. package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
  739. package/dist/unstable/cli/internal/config.d.ts +0 -48
  740. package/dist/unstable/cli/internal/config.d.ts.map +1 -1
  741. package/dist/unstable/cli/internal/config.js +8 -10
  742. package/dist/unstable/cli/internal/config.js.map +1 -1
  743. package/dist/unstable/cli/internal/help.js.map +1 -1
  744. package/dist/unstable/cli/internal/lexer.js +17 -7
  745. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  746. package/dist/unstable/cli/internal/parser.js +2 -2
  747. package/dist/unstable/cli/internal/parser.js.map +1 -1
  748. package/dist/unstable/cli/internal/wizard.js.map +1 -1
  749. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  750. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  751. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  752. package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
  753. package/dist/unstable/cluster/ClusterSchema.js +8 -8
  754. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  755. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  756. package/dist/unstable/cluster/ClusterWorkflowEngine.js +6 -2
  757. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  758. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  759. package/dist/unstable/cluster/Entity.d.ts +10 -10
  760. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  761. package/dist/unstable/cluster/Entity.js +9 -9
  762. package/dist/unstable/cluster/Entity.js.map +1 -1
  763. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  764. package/dist/unstable/cluster/EntityId.js.map +1 -1
  765. package/dist/unstable/cluster/EntityProxy.d.ts +4 -2
  766. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  767. package/dist/unstable/cluster/EntityProxy.js +4 -2
  768. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  769. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  770. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  771. package/dist/unstable/cluster/EntityResource.js +2 -2
  772. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  773. package/dist/unstable/cluster/EntityType.js.map +1 -1
  774. package/dist/unstable/cluster/Envelope.d.ts +3 -3
  775. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  776. package/dist/unstable/cluster/Envelope.js +5 -4
  777. package/dist/unstable/cluster/Envelope.js.map +1 -1
  778. package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
  779. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  780. package/dist/unstable/cluster/HttpRunner.js +6 -4
  781. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  782. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  783. package/dist/unstable/cluster/MachineId.js.map +1 -1
  784. package/dist/unstable/cluster/Message.d.ts +9 -9
  785. package/dist/unstable/cluster/Message.js +6 -6
  786. package/dist/unstable/cluster/Message.js.map +1 -1
  787. package/dist/unstable/cluster/MessageStorage.d.ts +15 -15
  788. package/dist/unstable/cluster/MessageStorage.js +5 -5
  789. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  790. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  791. package/dist/unstable/cluster/Reply.js +5 -5
  792. package/dist/unstable/cluster/Reply.js.map +1 -1
  793. package/dist/unstable/cluster/Runner.d.ts +1 -1
  794. package/dist/unstable/cluster/Runner.js +1 -1
  795. package/dist/unstable/cluster/Runner.js.map +1 -1
  796. package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
  797. package/dist/unstable/cluster/RunnerAddress.js +1 -1
  798. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  799. package/dist/unstable/cluster/RunnerHealth.d.ts +1 -1
  800. package/dist/unstable/cluster/RunnerHealth.js +1 -1
  801. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  802. package/dist/unstable/cluster/RunnerServer.d.ts +2 -1
  803. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  804. package/dist/unstable/cluster/RunnerServer.js +16 -16
  805. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  806. package/dist/unstable/cluster/RunnerStorage.d.ts +2 -2
  807. package/dist/unstable/cluster/RunnerStorage.js +1 -1
  808. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  809. package/dist/unstable/cluster/Runners.d.ts +6 -6
  810. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  811. package/dist/unstable/cluster/Runners.js +19 -10
  812. package/dist/unstable/cluster/Runners.js.map +1 -1
  813. package/dist/unstable/cluster/ShardId.js +1 -1
  814. package/dist/unstable/cluster/ShardId.js.map +1 -1
  815. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  816. package/dist/unstable/cluster/Sharding.js +128 -26
  817. package/dist/unstable/cluster/Sharding.js.map +1 -1
  818. package/dist/unstable/cluster/ShardingConfig.d.ts +13 -5
  819. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  820. package/dist/unstable/cluster/ShardingConfig.js +3 -3
  821. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  822. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  823. package/dist/unstable/cluster/SingleRunner.d.ts +4 -2
  824. package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
  825. package/dist/unstable/cluster/SingleRunner.js +2 -1
  826. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  827. package/dist/unstable/cluster/Singleton.js.map +1 -1
  828. package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
  829. package/dist/unstable/cluster/SingletonAddress.js +1 -1
  830. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  831. package/dist/unstable/cluster/Snowflake.d.ts +8 -8
  832. package/dist/unstable/cluster/Snowflake.js +8 -8
  833. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  834. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  835. package/dist/unstable/cluster/SqlMessageStorage.d.ts +7 -4
  836. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  837. package/dist/unstable/cluster/SqlMessageStorage.js +56 -25
  838. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  839. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  840. package/dist/unstable/cluster/SqlRunnerStorage.js +127 -65
  841. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  842. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  843. package/dist/unstable/cluster/index.js.map +1 -1
  844. package/dist/unstable/cluster/internal/entityManager.js +24 -12
  845. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  846. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  847. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  848. package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
  849. package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
  850. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  851. package/dist/unstable/cluster/internal/shardLock.d.ts +2 -0
  852. package/dist/unstable/cluster/internal/shardLock.d.ts.map +1 -0
  853. package/dist/unstable/cluster/internal/shardLock.js +4 -0
  854. package/dist/unstable/cluster/internal/shardLock.js.map +1 -0
  855. package/dist/unstable/devtools/DevTools.js.map +1 -1
  856. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  857. package/dist/unstable/devtools/DevToolsSchema.d.ts +20 -20
  858. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  859. package/dist/unstable/devtools/DevToolsSchema.js +8 -5
  860. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  861. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  862. package/dist/unstable/devtools/index.js.map +1 -1
  863. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  864. package/dist/unstable/encoding/Msgpack.js +6 -8
  865. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  866. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  867. package/dist/unstable/encoding/Sse.d.ts +72 -8
  868. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  869. package/dist/unstable/encoding/Sse.js +58 -8
  870. package/dist/unstable/encoding/Sse.js.map +1 -1
  871. package/dist/unstable/encoding/index.js.map +1 -1
  872. package/dist/unstable/eventlog/Event.d.ts +20 -20
  873. package/dist/unstable/eventlog/Event.js.map +1 -1
  874. package/dist/unstable/eventlog/EventGroup.d.ts +4 -4
  875. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  876. package/dist/unstable/eventlog/EventJournal.d.ts +16 -16
  877. package/dist/unstable/eventlog/EventJournal.js +14 -14
  878. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  879. package/dist/unstable/eventlog/EventLog.d.ts +3 -3
  880. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  881. package/dist/unstable/eventlog/EventLog.js +18 -14
  882. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  883. package/dist/unstable/eventlog/EventLogEncryption.d.ts +2 -2
  884. package/dist/unstable/eventlog/EventLogEncryption.js +2 -2
  885. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  886. package/dist/unstable/eventlog/EventLogMessage.d.ts +6 -6
  887. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
  888. package/dist/unstable/eventlog/EventLogMessage.js +9 -4
  889. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  890. package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
  891. package/dist/unstable/eventlog/EventLogRemote.js +1 -1
  892. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  893. package/dist/unstable/eventlog/EventLogServer.d.ts +11 -2
  894. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  895. package/dist/unstable/eventlog/EventLogServer.js +45 -21
  896. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  897. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +4 -4
  898. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  899. package/dist/unstable/eventlog/EventLogServerEncrypted.js +13 -5
  900. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  901. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -5
  902. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  903. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +14 -6
  904. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  905. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
  906. package/dist/unstable/eventlog/EventLogSessionAuth.js +1 -1
  907. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  908. package/dist/unstable/eventlog/SqlEventJournal.js +2 -2
  909. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  910. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +1 -1
  911. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  912. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +3 -3
  913. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  914. package/dist/unstable/eventlog/index.js.map +1 -1
  915. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
  916. package/dist/unstable/http/Cookies.d.ts +2 -2
  917. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  918. package/dist/unstable/http/Cookies.js +54 -40
  919. package/dist/unstable/http/Cookies.js.map +1 -1
  920. package/dist/unstable/http/Etag.d.ts +1 -1
  921. package/dist/unstable/http/Etag.js +1 -1
  922. package/dist/unstable/http/Etag.js.map +1 -1
  923. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  924. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  925. package/dist/unstable/http/Headers.d.ts +2 -2
  926. package/dist/unstable/http/Headers.js +10 -10
  927. package/dist/unstable/http/Headers.js.map +1 -1
  928. package/dist/unstable/http/HttpBody.d.ts +5 -3
  929. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  930. package/dist/unstable/http/HttpBody.js +11 -5
  931. package/dist/unstable/http/HttpBody.js.map +1 -1
  932. package/dist/unstable/http/HttpClient.d.ts +51 -44
  933. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  934. package/dist/unstable/http/HttpClient.js +46 -17
  935. package/dist/unstable/http/HttpClient.js.map +1 -1
  936. package/dist/unstable/http/HttpClientError.js.map +1 -1
  937. package/dist/unstable/http/HttpClientRequest.d.ts +44 -0
  938. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  939. package/dist/unstable/http/HttpClientRequest.js +16 -0
  940. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  941. package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
  942. package/dist/unstable/http/HttpClientResponse.js +2 -2
  943. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  944. package/dist/unstable/http/HttpEffect.d.ts +6 -6
  945. package/dist/unstable/http/HttpEffect.js +3 -3
  946. package/dist/unstable/http/HttpEffect.js.map +1 -1
  947. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  948. package/dist/unstable/http/HttpMethod.d.ts +6 -9
  949. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  950. package/dist/unstable/http/HttpMethod.js +6 -9
  951. package/dist/unstable/http/HttpMethod.js.map +1 -1
  952. package/dist/unstable/http/HttpMiddleware.d.ts +75 -9
  953. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  954. package/dist/unstable/http/HttpMiddleware.js +164 -39
  955. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  956. package/dist/unstable/http/HttpPlatform.d.ts +76 -0
  957. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  958. package/dist/unstable/http/HttpPlatform.js +32 -0
  959. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  960. package/dist/unstable/http/HttpRouter.d.ts +88 -89
  961. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  962. package/dist/unstable/http/HttpRouter.js +78 -79
  963. package/dist/unstable/http/HttpRouter.js.map +1 -1
  964. package/dist/unstable/http/HttpServer.d.ts +13 -13
  965. package/dist/unstable/http/HttpServer.js +6 -6
  966. package/dist/unstable/http/HttpServer.js.map +1 -1
  967. package/dist/unstable/http/HttpServerError.d.ts +2 -2
  968. package/dist/unstable/http/HttpServerError.js +2 -2
  969. package/dist/unstable/http/HttpServerError.js.map +1 -1
  970. package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
  971. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  972. package/dist/unstable/http/HttpServerRequest.js +9 -8
  973. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  974. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  975. package/dist/unstable/http/HttpServerResponse.d.ts +22 -0
  976. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  977. package/dist/unstable/http/HttpServerResponse.js +10 -0
  978. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  979. package/dist/unstable/http/HttpStaticServer.d.ts +35 -7
  980. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  981. package/dist/unstable/http/HttpStaticServer.js +35 -7
  982. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  983. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  984. package/dist/unstable/http/Multipart.d.ts +6 -6
  985. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  986. package/dist/unstable/http/Multipart.js +22 -20
  987. package/dist/unstable/http/Multipart.js.map +1 -1
  988. package/dist/unstable/http/Template.js +1 -1
  989. package/dist/unstable/http/Template.js.map +1 -1
  990. package/dist/unstable/http/Url.d.ts +33 -63
  991. package/dist/unstable/http/Url.d.ts.map +1 -1
  992. package/dist/unstable/http/Url.js +14 -28
  993. package/dist/unstable/http/Url.js.map +1 -1
  994. package/dist/unstable/http/UrlParams.d.ts +10 -18
  995. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  996. package/dist/unstable/http/UrlParams.js +26 -31
  997. package/dist/unstable/http/UrlParams.js.map +1 -1
  998. package/dist/unstable/http/index.js.map +1 -1
  999. package/dist/unstable/http/internal/compression.d.ts +2 -0
  1000. package/dist/unstable/http/internal/compression.d.ts.map +1 -0
  1001. package/dist/unstable/http/internal/compression.js +155 -0
  1002. package/dist/unstable/http/internal/compression.js.map +1 -0
  1003. package/dist/unstable/http/internal/preResponseHandler.js.map +1 -1
  1004. package/dist/unstable/httpapi/HttpApi.js +3 -3
  1005. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  1006. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
  1007. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  1008. package/dist/unstable/httpapi/HttpApiBuilder.js +10 -11
  1009. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  1010. package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -5
  1011. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  1012. package/dist/unstable/httpapi/HttpApiClient.js +16 -18
  1013. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  1014. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +42 -42
  1015. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1016. package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
  1017. package/dist/unstable/httpapi/HttpApiError.js +13 -13
  1018. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1019. package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
  1020. package/dist/unstable/httpapi/HttpApiGroup.js +1 -1
  1021. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1022. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +71 -24
  1023. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1024. package/dist/unstable/httpapi/HttpApiMiddleware.js +57 -10
  1025. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1026. package/dist/unstable/httpapi/HttpApiScalar.d.ts +0 -12
  1027. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1028. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1029. package/dist/unstable/httpapi/HttpApiSchema.d.ts +6 -6
  1030. package/dist/unstable/httpapi/HttpApiSchema.js +4 -4
  1031. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1032. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1033. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1034. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1035. package/dist/unstable/httpapi/OpenApi.d.ts +13 -13
  1036. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1037. package/dist/unstable/httpapi/OpenApi.js +50 -37
  1038. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1039. package/dist/unstable/httpapi/index.js.map +1 -1
  1040. package/dist/unstable/httpapi/internal/html.js.map +1 -1
  1041. package/dist/unstable/httpapi/internal/httpApiScalar.js.map +1 -1
  1042. package/dist/unstable/httpapi/internal/httpApiSwagger.js.map +1 -1
  1043. package/dist/unstable/httpapi/internal/mediaType.js.map +1 -1
  1044. package/dist/unstable/observability/Otlp.js.map +1 -1
  1045. package/dist/unstable/observability/OtlpExporter.d.ts +70 -1
  1046. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1047. package/dist/unstable/observability/OtlpExporter.js +84 -6
  1048. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1049. package/dist/unstable/observability/OtlpLogger.d.ts +4 -3
  1050. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1051. package/dist/unstable/observability/OtlpLogger.js +2 -2
  1052. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1053. package/dist/unstable/observability/OtlpMetrics.d.ts +11 -4
  1054. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1055. package/dist/unstable/observability/OtlpMetrics.js +5 -2
  1056. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1057. package/dist/unstable/observability/OtlpResource.d.ts +16 -7
  1058. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1059. package/dist/unstable/observability/OtlpResource.js +21 -12
  1060. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1061. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1062. package/dist/unstable/observability/OtlpTracer.d.ts +4 -3
  1063. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  1064. package/dist/unstable/observability/OtlpTracer.js +2 -2
  1065. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1066. package/dist/unstable/observability/PrometheusMetrics.d.ts +13 -4
  1067. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1068. package/dist/unstable/observability/PrometheusMetrics.js +10 -3
  1069. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1070. package/dist/unstable/observability/index.js.map +1 -1
  1071. package/dist/unstable/observability/internal/otlpEnv.js +1 -1
  1072. package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
  1073. package/dist/unstable/observability/internal/otlpProtobuf.js.map +1 -1
  1074. package/dist/unstable/observability/internal/protobuf.js +3 -0
  1075. package/dist/unstable/observability/internal/protobuf.js.map +1 -1
  1076. package/dist/unstable/persistence/KeyValueStore.d.ts +8 -3
  1077. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1078. package/dist/unstable/persistence/KeyValueStore.js +22 -13
  1079. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1080. package/dist/unstable/persistence/Persistable.d.ts +8 -8
  1081. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  1082. package/dist/unstable/persistence/Persistable.js +2 -1
  1083. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1084. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1085. package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
  1086. package/dist/unstable/persistence/PersistedQueue.js +6 -6
  1087. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1088. package/dist/unstable/persistence/Persistence.d.ts +3 -3
  1089. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1090. package/dist/unstable/persistence/Persistence.js +91 -15
  1091. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1092. package/dist/unstable/persistence/RateLimiter.d.ts +28 -17
  1093. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1094. package/dist/unstable/persistence/RateLimiter.js +26 -15
  1095. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1096. package/dist/unstable/persistence/Redis.d.ts +2 -2
  1097. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  1098. package/dist/unstable/persistence/Redis.js +3 -3
  1099. package/dist/unstable/persistence/Redis.js.map +1 -1
  1100. package/dist/unstable/persistence/index.js.map +1 -1
  1101. package/dist/unstable/process/ChildProcess.d.ts +64 -21
  1102. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1103. package/dist/unstable/process/ChildProcess.js +14 -5
  1104. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1105. package/dist/unstable/process/ChildProcessSpawner.d.ts +21 -10
  1106. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1107. package/dist/unstable/process/ChildProcessSpawner.js +4 -2
  1108. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1109. package/dist/unstable/process/index.js.map +1 -1
  1110. package/dist/unstable/reactivity/AsyncResult.d.ts +8 -8
  1111. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1112. package/dist/unstable/reactivity/AsyncResult.js +14 -13
  1113. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1114. package/dist/unstable/reactivity/Atom.d.ts +105 -19
  1115. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1116. package/dist/unstable/reactivity/Atom.js +44 -12
  1117. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1118. package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -1
  1119. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1120. package/dist/unstable/reactivity/AtomHttpApi.js +4 -1
  1121. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1122. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1123. package/dist/unstable/reactivity/AtomRegistry.js +25 -4
  1124. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1125. package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
  1126. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1127. package/dist/unstable/reactivity/AtomRpc.js +4 -1
  1128. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1129. package/dist/unstable/reactivity/Hydration.d.ts +1 -1
  1130. package/dist/unstable/reactivity/Hydration.js +1 -1
  1131. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1132. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1133. package/dist/unstable/reactivity/index.js.map +1 -1
  1134. package/dist/unstable/rpc/Rpc.d.ts +35 -33
  1135. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1136. package/dist/unstable/rpc/Rpc.js +4 -2
  1137. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1138. package/dist/unstable/rpc/RpcClient.d.ts +12 -12
  1139. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1140. package/dist/unstable/rpc/RpcClient.js +14 -12
  1141. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1142. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1143. package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
  1144. package/dist/unstable/rpc/RpcGroup.js +1 -1
  1145. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1146. package/dist/unstable/rpc/RpcMessage.d.ts +31 -30
  1147. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1148. package/dist/unstable/rpc/RpcMessage.js +6 -6
  1149. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1150. package/dist/unstable/rpc/RpcMiddleware.d.ts +10 -10
  1151. package/dist/unstable/rpc/RpcMiddleware.js +1 -1
  1152. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1153. package/dist/unstable/rpc/RpcSchema.d.ts +4 -4
  1154. package/dist/unstable/rpc/RpcSchema.js +3 -3
  1155. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1156. package/dist/unstable/rpc/RpcSerialization.d.ts +58 -7
  1157. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1158. package/dist/unstable/rpc/RpcSerialization.js +175 -96
  1159. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1160. package/dist/unstable/rpc/RpcServer.d.ts +13 -13
  1161. package/dist/unstable/rpc/RpcServer.js +17 -13
  1162. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1163. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1164. package/dist/unstable/rpc/RpcWorker.d.ts +5 -5
  1165. package/dist/unstable/rpc/RpcWorker.js +4 -4
  1166. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1167. package/dist/unstable/rpc/Utils.js.map +1 -1
  1168. package/dist/unstable/rpc/index.js.map +1 -1
  1169. package/dist/unstable/schema/Model.d.ts +52 -50
  1170. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1171. package/dist/unstable/schema/Model.js +35 -33
  1172. package/dist/unstable/schema/Model.js.map +1 -1
  1173. package/dist/unstable/schema/VariantSchema.d.ts +6 -7
  1174. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1175. package/dist/unstable/schema/VariantSchema.js +15 -12
  1176. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1177. package/dist/unstable/schema/index.js.map +1 -1
  1178. package/dist/unstable/socket/Socket.d.ts +12 -4
  1179. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1180. package/dist/unstable/socket/Socket.js +10 -5
  1181. package/dist/unstable/socket/Socket.js.map +1 -1
  1182. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1183. package/dist/unstable/socket/index.js.map +1 -1
  1184. package/dist/unstable/sql/Migrator.js.map +1 -1
  1185. package/dist/unstable/sql/SqlClient.d.ts +1 -1
  1186. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1187. package/dist/unstable/sql/SqlClient.js +2 -2
  1188. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1189. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1190. package/dist/unstable/sql/SqlError.d.ts +2 -2
  1191. package/dist/unstable/sql/SqlError.js +2 -2
  1192. package/dist/unstable/sql/SqlError.js.map +1 -1
  1193. package/dist/unstable/sql/SqlModel.d.ts +2 -2
  1194. package/dist/unstable/sql/SqlModel.js +2 -2
  1195. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1196. package/dist/unstable/sql/SqlResolver.d.ts +5 -5
  1197. package/dist/unstable/sql/SqlResolver.js +2 -2
  1198. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1199. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1200. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1201. package/dist/unstable/sql/Statement.d.ts +6 -6
  1202. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1203. package/dist/unstable/sql/Statement.js +22 -21
  1204. package/dist/unstable/sql/Statement.js.map +1 -1
  1205. package/dist/unstable/sql/index.js.map +1 -1
  1206. package/dist/unstable/workers/Transferable.d.ts +1 -1
  1207. package/dist/unstable/workers/Transferable.js +1 -1
  1208. package/dist/unstable/workers/Transferable.js.map +1 -1
  1209. package/dist/unstable/workers/Worker.d.ts +2 -2
  1210. package/dist/unstable/workers/Worker.js +2 -2
  1211. package/dist/unstable/workers/Worker.js.map +1 -1
  1212. package/dist/unstable/workers/WorkerError.d.ts +7 -7
  1213. package/dist/unstable/workers/WorkerError.js +6 -6
  1214. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1215. package/dist/unstable/workers/WorkerRunner.d.ts +1 -1
  1216. package/dist/unstable/workers/WorkerRunner.js +1 -1
  1217. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1218. package/dist/unstable/workers/index.js.map +1 -1
  1219. package/dist/unstable/workflow/Activity.d.ts +2 -2
  1220. package/dist/unstable/workflow/Activity.js +2 -2
  1221. package/dist/unstable/workflow/Activity.js.map +1 -1
  1222. package/dist/unstable/workflow/DurableClock.d.ts +1 -1
  1223. package/dist/unstable/workflow/DurableClock.js +1 -1
  1224. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1225. package/dist/unstable/workflow/DurableDeferred.d.ts +10 -10
  1226. package/dist/unstable/workflow/DurableDeferred.js +5 -5
  1227. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1228. package/dist/unstable/workflow/DurableQueue.d.ts +22 -20
  1229. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  1230. package/dist/unstable/workflow/DurableQueue.js +22 -20
  1231. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  1232. package/dist/unstable/workflow/Workflow.d.ts +21 -21
  1233. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1234. package/dist/unstable/workflow/Workflow.js +13 -14
  1235. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1236. package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
  1237. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1238. package/dist/unstable/workflow/WorkflowProxy.d.ts +4 -2
  1239. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1240. package/dist/unstable/workflow/WorkflowProxy.js +4 -2
  1241. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1242. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1243. package/dist/unstable/workflow/index.js.map +1 -1
  1244. package/dist/unstable/workflow/internal/crypto.js.map +1 -1
  1245. package/package.json +5 -6
  1246. package/src/Array.ts +1068 -1070
  1247. package/src/BigDecimal.ts +433 -756
  1248. package/src/BigInt.ts +213 -269
  1249. package/src/Boolean.ts +146 -188
  1250. package/src/Cache.ts +409 -255
  1251. package/src/Cause.ts +167 -277
  1252. package/src/Channel.ts +923 -830
  1253. package/src/ChannelSchema.ts +1 -1
  1254. package/src/Chunk.ts +841 -1181
  1255. package/src/Clock.ts +181 -49
  1256. package/src/Combiner.ts +20 -33
  1257. package/src/Config.ts +618 -334
  1258. package/src/ConfigProvider.ts +221 -127
  1259. package/src/Console.ts +289 -39
  1260. package/src/Context.ts +319 -378
  1261. package/src/Cron.ts +68 -77
  1262. package/src/Crypto.ts +13 -15
  1263. package/src/Data.ts +63 -82
  1264. package/src/DateTime.ts +564 -660
  1265. package/src/Deferred.ts +253 -256
  1266. package/src/Duration.ts +216 -308
  1267. package/src/Effect.ts +2958 -3390
  1268. package/src/Encoding.ts +22 -40
  1269. package/src/Equal.ts +49 -39
  1270. package/src/Equivalence.ts +103 -105
  1271. package/src/ErrorReporter.ts +51 -27
  1272. package/src/ExecutionPlan.ts +13 -55
  1273. package/src/Exit.ts +116 -192
  1274. package/src/Fiber.ts +81 -148
  1275. package/src/FiberHandle.ts +155 -107
  1276. package/src/FiberMap.ts +225 -174
  1277. package/src/FiberSet.ts +124 -82
  1278. package/src/FileSystem.ts +155 -263
  1279. package/src/Filter.ts +61 -33
  1280. package/src/Formatter.ts +54 -56
  1281. package/src/Function.ts +76 -145
  1282. package/src/Graph.ts +416 -770
  1283. package/src/HKT.ts +12 -6
  1284. package/src/Hash.ts +52 -83
  1285. package/src/HashMap.ts +319 -411
  1286. package/src/HashRing.ts +1 -0
  1287. package/src/HashSet.ts +177 -284
  1288. package/src/Inspectable.ts +12 -12
  1289. package/src/Iterable.ts +622 -787
  1290. package/src/JsonPatch.ts +60 -113
  1291. package/src/JsonPointer.ts +8 -8
  1292. package/src/JsonSchema.ts +405 -249
  1293. package/src/Latch.ts +23 -35
  1294. package/src/Layer.ts +359 -260
  1295. package/src/LayerMap.ts +49 -29
  1296. package/src/LayerRef.ts +6 -2
  1297. package/src/LogLevel.ts +114 -214
  1298. package/src/Logger.ts +347 -699
  1299. package/src/ManagedRuntime.ts +20 -5
  1300. package/src/Match.ts +217 -252
  1301. package/src/Metric.ts +520 -1092
  1302. package/src/MutableHashMap.ts +218 -255
  1303. package/src/MutableHashSet.ts +84 -89
  1304. package/src/MutableList.ts +73 -370
  1305. package/src/MutableRef.ts +420 -243
  1306. package/src/Newtype.ts +21 -14
  1307. package/src/NonEmptyIterable.ts +7 -137
  1308. package/src/Number.ts +196 -233
  1309. package/src/Optic.ts +246 -385
  1310. package/src/Option.ts +449 -813
  1311. package/src/Order.ts +109 -109
  1312. package/src/Ordering.ts +20 -23
  1313. package/src/PartitionedSemaphore.ts +1 -4
  1314. package/src/Path.ts +38 -41
  1315. package/src/Pipeable.ts +6 -5
  1316. package/src/PlatformError.ts +4 -4
  1317. package/src/Pool.ts +4 -2
  1318. package/src/Predicate.ts +200 -181
  1319. package/src/PrimaryKey.ts +7 -7
  1320. package/src/PubSub.ts +526 -552
  1321. package/src/Pull.ts +24 -18
  1322. package/src/Queue.ts +200 -159
  1323. package/src/Random.ts +49 -74
  1324. package/src/RcMap.ts +121 -63
  1325. package/src/RcRef.ts +24 -13
  1326. package/src/Record.ts +387 -487
  1327. package/src/Redactable.ts +10 -3
  1328. package/src/Redacted.ts +25 -25
  1329. package/src/Reducer.ts +8 -15
  1330. package/src/Ref.ts +221 -361
  1331. package/src/References.ts +102 -214
  1332. package/src/RegExp.ts +10 -14
  1333. package/src/Request.ts +36 -28
  1334. package/src/RequestResolver.ts +202 -91
  1335. package/src/Result.ts +314 -485
  1336. package/src/Runtime.ts +50 -75
  1337. package/src/Schedule.ts +308 -1734
  1338. package/src/Scheduler.ts +20 -7
  1339. package/src/Schema.ts +3156 -1634
  1340. package/src/SchemaAST.ts +676 -489
  1341. package/src/SchemaError.ts +8 -7
  1342. package/src/SchemaGetter.ts +277 -218
  1343. package/src/SchemaIssue.ts +90 -276
  1344. package/src/SchemaParser.ts +179 -116
  1345. package/src/SchemaRepresentation.ts +698 -3417
  1346. package/src/SchemaTransformation.ts +132 -91
  1347. package/src/Scope.ts +123 -151
  1348. package/src/ScopedRef.ts +4 -4
  1349. package/src/Semaphore.ts +157 -54
  1350. package/src/Sink.ts +128 -113
  1351. package/src/Stdio.ts +1 -1
  1352. package/src/Stream.ts +2665 -3142
  1353. package/src/String.ts +275 -312
  1354. package/src/Struct.ts +114 -118
  1355. package/src/SubscriptionRef.ts +284 -252
  1356. package/src/Symbol.ts +3 -3
  1357. package/src/Terminal.ts +2 -2
  1358. package/src/Tracer.ts +102 -55
  1359. package/src/Trie.ts +287 -679
  1360. package/src/Tuple.ts +92 -127
  1361. package/src/TxChunk.ts +201 -121
  1362. package/src/TxDeferred.ts +62 -46
  1363. package/src/TxHashMap.ts +645 -799
  1364. package/src/TxHashSet.ts +443 -356
  1365. package/src/TxPriorityQueue.ts +130 -98
  1366. package/src/TxPubSub.ts +107 -80
  1367. package/src/TxQueue.ts +214 -183
  1368. package/src/TxReentrantLock.ts +97 -66
  1369. package/src/TxRef.ts +51 -32
  1370. package/src/TxSemaphore.ts +129 -95
  1371. package/src/TxSubscriptionRef.ts +97 -70
  1372. package/src/Types.ts +127 -70
  1373. package/src/Unify.ts +45 -65
  1374. package/src/Utils.ts +23 -16
  1375. package/src/index.ts +0 -5
  1376. package/src/internal/core.ts +5 -4
  1377. package/src/internal/dateTime.ts +6 -0
  1378. package/src/internal/effect.ts +160 -79
  1379. package/src/internal/matcher.ts +1 -1
  1380. package/src/internal/persistence.ts +2 -0
  1381. package/src/internal/record.ts +11 -7
  1382. package/src/internal/references.ts +3 -7
  1383. package/src/internal/schema/annotations.ts +44 -0
  1384. package/src/internal/schema/fromJsonSchemaDocument.ts +959 -0
  1385. package/src/internal/schema/fromRepresentation.ts +339 -0
  1386. package/src/internal/schema/parser.ts +22 -0
  1387. package/src/internal/schema/schema.ts +45 -46
  1388. package/src/internal/schema/{arbitrary.ts → toArbitrary.ts} +8 -10
  1389. package/src/internal/schema/toCodeDocument.ts +572 -0
  1390. package/src/internal/schema/{equivalence.ts → toEquivalence.ts} +12 -7
  1391. package/src/internal/schema/toJsonSchemaDocument.ts +529 -0
  1392. package/src/internal/schema/toRepresentation.ts +386 -0
  1393. package/src/internal/stackTraceLimit.ts +3 -7
  1394. package/src/internal/trie.ts +10 -11
  1395. package/src/testing/FastCheck.ts +8 -7
  1396. package/src/testing/TestClock.ts +73 -31
  1397. package/src/testing/TestConsole.ts +32 -31
  1398. package/src/testing/TestSchema.ts +29 -29
  1399. package/src/unstable/ai/AiError.ts +100 -122
  1400. package/src/unstable/ai/AnthropicStructuredOutput.ts +103 -334
  1401. package/src/unstable/ai/Chat.ts +132 -97
  1402. package/src/unstable/ai/EmbeddingModel.ts +1 -1
  1403. package/src/unstable/ai/IdGenerator.ts +32 -28
  1404. package/src/unstable/ai/LanguageModel.ts +137 -95
  1405. package/src/unstable/ai/McpProtocol.ts +48 -0
  1406. package/src/unstable/ai/McpSchema.ts +75 -65
  1407. package/src/unstable/ai/McpServer.ts +1045 -303
  1408. package/src/unstable/ai/Model.ts +9 -20
  1409. package/src/unstable/ai/OpenAiStructuredOutput.ts +231 -396
  1410. package/src/unstable/ai/Prompt.ts +145 -43
  1411. package/src/unstable/ai/Response.ts +52 -38
  1412. package/src/unstable/ai/Telemetry.ts +46 -13
  1413. package/src/unstable/ai/Tokenizer.ts +14 -3
  1414. package/src/unstable/ai/Tool.ts +81 -48
  1415. package/src/unstable/ai/Toolkit.ts +45 -15
  1416. package/src/unstable/ai/index.ts +5 -0
  1417. package/src/unstable/ai/internal/codec-transformer.ts +13 -7
  1418. package/src/unstable/ai/internal/mcpProtocol.ts +85 -0
  1419. package/src/unstable/ai/internal/mcpProtocolRegistry.ts +70 -0
  1420. package/src/unstable/ai/internal/structured-output.ts +453 -0
  1421. package/src/unstable/cli/Argument.ts +273 -69
  1422. package/src/unstable/cli/CliError.ts +116 -77
  1423. package/src/unstable/cli/CliOutput.ts +44 -58
  1424. package/src/unstable/cli/Command.ts +709 -111
  1425. package/src/unstable/cli/Flag.ts +418 -138
  1426. package/src/unstable/cli/GlobalFlag.ts +1 -1
  1427. package/src/unstable/cli/HelpDoc.ts +12 -4
  1428. package/src/unstable/cli/Param.ts +295 -81
  1429. package/src/unstable/cli/Primitive.ts +371 -150
  1430. package/src/unstable/cli/Prompt.ts +28 -14
  1431. package/src/unstable/cli/internal/command.ts +13 -5
  1432. package/src/unstable/cli/internal/config.ts +8 -10
  1433. package/src/unstable/cli/internal/lexer.ts +8 -2
  1434. package/src/unstable/cli/internal/parser.ts +2 -2
  1435. package/src/unstable/cluster/ClusterSchema.ts +8 -8
  1436. package/src/unstable/cluster/ClusterWorkflowEngine.ts +8 -4
  1437. package/src/unstable/cluster/Entity.ts +16 -17
  1438. package/src/unstable/cluster/EntityProxy.ts +4 -2
  1439. package/src/unstable/cluster/EntityResource.ts +2 -2
  1440. package/src/unstable/cluster/Envelope.ts +5 -4
  1441. package/src/unstable/cluster/HttpRunner.ts +6 -4
  1442. package/src/unstable/cluster/Message.ts +9 -9
  1443. package/src/unstable/cluster/MessageStorage.ts +15 -15
  1444. package/src/unstable/cluster/Reply.ts +5 -7
  1445. package/src/unstable/cluster/Runner.ts +1 -1
  1446. package/src/unstable/cluster/RunnerAddress.ts +1 -1
  1447. package/src/unstable/cluster/RunnerHealth.ts +1 -1
  1448. package/src/unstable/cluster/RunnerServer.ts +41 -8
  1449. package/src/unstable/cluster/RunnerStorage.ts +2 -2
  1450. package/src/unstable/cluster/Runners.ts +23 -12
  1451. package/src/unstable/cluster/ShardId.ts +1 -1
  1452. package/src/unstable/cluster/Sharding.ts +168 -42
  1453. package/src/unstable/cluster/ShardingConfig.ts +8 -4
  1454. package/src/unstable/cluster/SingleRunner.ts +4 -2
  1455. package/src/unstable/cluster/SingletonAddress.ts +1 -1
  1456. package/src/unstable/cluster/Snowflake.ts +8 -8
  1457. package/src/unstable/cluster/SqlMessageStorage.ts +84 -36
  1458. package/src/unstable/cluster/SqlRunnerStorage.ts +205 -119
  1459. package/src/unstable/cluster/internal/entityManager.ts +42 -25
  1460. package/src/unstable/cluster/internal/shardLock.ts +9 -0
  1461. package/src/unstable/devtools/DevToolsSchema.ts +10 -5
  1462. package/src/unstable/encoding/Msgpack.ts +6 -8
  1463. package/src/unstable/encoding/Sse.ts +98 -16
  1464. package/src/unstable/eventlog/Event.ts +20 -20
  1465. package/src/unstable/eventlog/EventGroup.ts +4 -4
  1466. package/src/unstable/eventlog/EventJournal.ts +16 -16
  1467. package/src/unstable/eventlog/EventLog.ts +24 -14
  1468. package/src/unstable/eventlog/EventLogEncryption.ts +2 -2
  1469. package/src/unstable/eventlog/EventLogMessage.ts +12 -5
  1470. package/src/unstable/eventlog/EventLogRemote.ts +1 -1
  1471. package/src/unstable/eventlog/EventLogServer.ts +41 -7
  1472. package/src/unstable/eventlog/EventLogServerEncrypted.ts +13 -5
  1473. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +14 -6
  1474. package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
  1475. package/src/unstable/eventlog/SqlEventJournal.ts +2 -2
  1476. package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +1 -1
  1477. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +6 -3
  1478. package/src/unstable/http/Cookies.ts +64 -45
  1479. package/src/unstable/http/Etag.ts +1 -1
  1480. package/src/unstable/http/FetchHttpClient.ts +3 -1
  1481. package/src/unstable/http/Headers.ts +10 -10
  1482. package/src/unstable/http/HttpBody.ts +20 -5
  1483. package/src/unstable/http/HttpClient.ts +83 -55
  1484. package/src/unstable/http/HttpClientRequest.ts +59 -0
  1485. package/src/unstable/http/HttpClientResponse.ts +4 -4
  1486. package/src/unstable/http/HttpEffect.ts +8 -8
  1487. package/src/unstable/http/HttpMethod.ts +6 -9
  1488. package/src/unstable/http/HttpMiddleware.ts +202 -39
  1489. package/src/unstable/http/HttpPlatform.ts +95 -0
  1490. package/src/unstable/http/HttpRouter.ts +102 -98
  1491. package/src/unstable/http/HttpServer.ts +13 -13
  1492. package/src/unstable/http/HttpServerError.ts +2 -2
  1493. package/src/unstable/http/HttpServerRequest.ts +9 -8
  1494. package/src/unstable/http/HttpServerResponse.ts +30 -0
  1495. package/src/unstable/http/HttpStaticServer.ts +35 -7
  1496. package/src/unstable/http/Multipart.ts +22 -19
  1497. package/src/unstable/http/Template.ts +1 -1
  1498. package/src/unstable/http/Url.ts +33 -63
  1499. package/src/unstable/http/UrlParams.ts +27 -32
  1500. package/src/unstable/http/internal/compression.ts +196 -0
  1501. package/src/unstable/httpapi/HttpApi.ts +3 -3
  1502. package/src/unstable/httpapi/HttpApiBuilder.ts +10 -9
  1503. package/src/unstable/httpapi/HttpApiClient.ts +19 -19
  1504. package/src/unstable/httpapi/HttpApiEndpoint.ts +42 -42
  1505. package/src/unstable/httpapi/HttpApiError.ts +13 -13
  1506. package/src/unstable/httpapi/HttpApiGroup.ts +16 -16
  1507. package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
  1508. package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
  1509. package/src/unstable/httpapi/HttpApiSchema.ts +6 -6
  1510. package/src/unstable/httpapi/OpenApi.ts +65 -41
  1511. package/src/unstable/observability/OtlpExporter.ts +126 -10
  1512. package/src/unstable/observability/OtlpLogger.ts +5 -5
  1513. package/src/unstable/observability/OtlpMetrics.ts +12 -5
  1514. package/src/unstable/observability/OtlpResource.ts +26 -17
  1515. package/src/unstable/observability/OtlpTracer.ts +8 -4
  1516. package/src/unstable/observability/PrometheusMetrics.ts +13 -4
  1517. package/src/unstable/observability/internal/otlpEnv.ts +1 -1
  1518. package/src/unstable/observability/internal/protobuf.ts +3 -0
  1519. package/src/unstable/persistence/KeyValueStore.ts +72 -49
  1520. package/src/unstable/persistence/Persistable.ts +11 -10
  1521. package/src/unstable/persistence/PersistedQueue.ts +6 -6
  1522. package/src/unstable/persistence/Persistence.ts +126 -19
  1523. package/src/unstable/persistence/RateLimiter.ts +28 -17
  1524. package/src/unstable/persistence/Redis.ts +4 -4
  1525. package/src/unstable/process/ChildProcess.ts +64 -21
  1526. package/src/unstable/process/ChildProcessSpawner.ts +22 -11
  1527. package/src/unstable/reactivity/AsyncResult.ts +16 -16
  1528. package/src/unstable/reactivity/Atom.ts +117 -22
  1529. package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
  1530. package/src/unstable/reactivity/AtomRegistry.ts +25 -4
  1531. package/src/unstable/reactivity/AtomRpc.ts +5 -4
  1532. package/src/unstable/reactivity/Hydration.ts +1 -1
  1533. package/src/unstable/rpc/Rpc.ts +35 -33
  1534. package/src/unstable/rpc/RpcClient.ts +18 -16
  1535. package/src/unstable/rpc/RpcGroup.ts +8 -8
  1536. package/src/unstable/rpc/RpcMessage.ts +31 -30
  1537. package/src/unstable/rpc/RpcMiddleware.ts +10 -10
  1538. package/src/unstable/rpc/RpcSchema.ts +4 -4
  1539. package/src/unstable/rpc/RpcSerialization.ts +167 -68
  1540. package/src/unstable/rpc/RpcServer.ts +18 -15
  1541. package/src/unstable/rpc/RpcWorker.ts +5 -5
  1542. package/src/unstable/schema/Model.ts +52 -50
  1543. package/src/unstable/schema/VariantSchema.ts +19 -29
  1544. package/src/unstable/socket/Socket.ts +18 -5
  1545. package/src/unstable/sql/SqlClient.ts +5 -6
  1546. package/src/unstable/sql/SqlError.ts +2 -2
  1547. package/src/unstable/sql/SqlModel.ts +2 -2
  1548. package/src/unstable/sql/SqlResolver.ts +5 -5
  1549. package/src/unstable/sql/Statement.ts +31 -29
  1550. package/src/unstable/workers/Transferable.ts +1 -1
  1551. package/src/unstable/workers/Worker.ts +2 -2
  1552. package/src/unstable/workers/WorkerError.ts +7 -7
  1553. package/src/unstable/workers/WorkerRunner.ts +1 -1
  1554. package/src/unstable/workflow/Activity.ts +2 -2
  1555. package/src/unstable/workflow/DurableClock.ts +1 -1
  1556. package/src/unstable/workflow/DurableDeferred.ts +10 -10
  1557. package/src/unstable/workflow/DurableQueue.ts +22 -20
  1558. package/src/unstable/workflow/Workflow.ts +23 -23
  1559. package/src/unstable/workflow/WorkflowEngine.ts +1 -1
  1560. package/src/unstable/workflow/WorkflowProxy.ts +4 -2
  1561. package/dist/SchemaUtils.d.ts +0 -28
  1562. package/dist/SchemaUtils.d.ts.map +0 -1
  1563. package/dist/SchemaUtils.js +0 -45
  1564. package/dist/SchemaUtils.js.map +0 -1
  1565. package/dist/internal/schema/arbitrary.d.ts.map +0 -1
  1566. package/dist/internal/schema/arbitrary.js.map +0 -1
  1567. package/dist/internal/schema/equivalence.d.ts +0 -2
  1568. package/dist/internal/schema/equivalence.d.ts.map +0 -1
  1569. package/dist/internal/schema/equivalence.js.map +0 -1
  1570. package/dist/internal/schema/representation.d.ts +0 -2
  1571. package/dist/internal/schema/representation.d.ts.map +0 -1
  1572. package/dist/internal/schema/representation.js +0 -865
  1573. package/dist/internal/schema/representation.js.map +0 -1
  1574. package/dist/internal/version.d.ts +0 -3
  1575. package/dist/internal/version.d.ts.map +0 -1
  1576. package/dist/internal/version.js +0 -2
  1577. package/dist/internal/version.js.map +0 -1
  1578. package/src/SchemaUtils.ts +0 -51
  1579. package/src/internal/schema/representation.ts +0 -795
  1580. package/src/internal/version.ts +0 -2
@@ -2,41 +2,123 @@ import type * as JsonSchema from "./JsonSchema.ts";
2
2
  import * as Schema from "./Schema.ts";
3
3
  import * as SchemaAST from "./SchemaAST.ts";
4
4
  /**
5
- * A custom type declaration, such as `Date`, `Option`, or `ReadonlySet`.
5
+ * Open persistence identity carried by declarations and opaque checks.
6
6
  *
7
- * **When to use**
8
- *
9
- * Use when inspecting or transforming non-primitive schema types.
7
+ * @category annotations
8
+ * @since 4.0.0
9
+ */
10
+ export interface RepresentationAnnotation {
11
+ readonly id: string;
12
+ readonly payload: Schema.Json;
13
+ }
14
+ /**
15
+ * Open persistence identity and schema dependencies carried by opaque checks.
10
16
  *
11
- * **Details**
17
+ * @category annotations
18
+ * @since 4.0.0
19
+ */
20
+ export interface CheckRepresentationAnnotation<S> extends RepresentationAnnotation {
21
+ readonly schemas?: ReadonlyArray<S> | undefined;
22
+ }
23
+ /**
24
+ * Input passed to JSON Schema compiler annotations.
12
25
  *
13
- * `typeParameters` holds the inner type arguments, such as the `A` in
14
- * `Option<A>`. `encodedSchema` is the fallback representation when no
15
- * {@link Reviver} recognizes this declaration. `annotations.typeConstructor`
16
- * identifies the declaration kind, such as `{ _tag: "effect/Option" }`.
26
+ * @since 4.0.0
27
+ */
28
+ export declare namespace ToJsonSchema {
29
+ /**
30
+ * Input for a check compiler.
31
+ *
32
+ * @category models
33
+ * @since 4.0.0
34
+ */
35
+ interface CheckInput {
36
+ readonly type: JsonSchema.Type | undefined;
37
+ readonly schemas: ReadonlyArray<JsonSchema.JsonSchema>;
38
+ }
39
+ /**
40
+ * JSON Schema compiler for a check.
41
+ *
42
+ * @category models
43
+ * @since 4.0.0
44
+ */
45
+ type Check = (input: CheckInput) => JsonSchema.JsonSchema;
46
+ }
47
+ /**
48
+ * Input and output contracts for code generation annotations.
17
49
  *
18
- * @see {@link Reviver}
19
- * @see {@link toSchemaDefaultReviver}
50
+ * @since 4.0.0
51
+ */
52
+ export declare namespace Generation {
53
+ /**
54
+ * Input for declaration code generation.
55
+ *
56
+ * @category models
57
+ * @since 4.0.0
58
+ */
59
+ interface DeclarationInput {
60
+ readonly typeParameters: ReadonlyArray<Code>;
61
+ }
62
+ /**
63
+ * Output of declaration code generation.
64
+ *
65
+ * @category models
66
+ * @since 4.0.0
67
+ */
68
+ interface DeclarationOutput {
69
+ readonly runtime: string;
70
+ readonly Type: string;
71
+ readonly importDeclarations?: ReadonlyArray<string> | undefined;
72
+ }
73
+ /**
74
+ * Declaration code generator.
75
+ *
76
+ * @category models
77
+ * @since 4.0.0
78
+ */
79
+ type Declaration = (input: DeclarationInput) => DeclarationOutput;
80
+ /**
81
+ * Input for check code generation.
82
+ *
83
+ * @category models
84
+ * @since 4.0.0
85
+ */
86
+ interface CheckInput {
87
+ readonly schemas: ReadonlyArray<Code>;
88
+ }
89
+ /**
90
+ * Output of check code generation.
91
+ *
92
+ * @category models
93
+ * @since 4.0.0
94
+ */
95
+ interface CheckOutput {
96
+ readonly runtime: string;
97
+ readonly importDeclarations?: ReadonlyArray<string> | undefined;
98
+ }
99
+ /**
100
+ * Check code generator.
101
+ *
102
+ * @category models
103
+ * @since 4.0.0
104
+ */
105
+ type Check = (input: CheckInput) => CheckOutput;
106
+ }
107
+ /**
108
+ * A custom opaque declaration.
20
109
  *
21
110
  * @category models
22
111
  * @since 4.0.0
23
112
  */
24
113
  export interface Declaration {
25
114
  readonly _tag: "Declaration";
115
+ readonly representation?: RepresentationAnnotation | undefined;
26
116
  readonly annotations?: Schema.Annotations.Annotations | undefined;
27
117
  readonly typeParameters: ReadonlyArray<Representation>;
28
- readonly checks: ReadonlyArray<Check<DeclarationMeta>>;
29
- readonly encodedSchema: Representation;
118
+ readonly checks: ReadonlyArray<Check>;
30
119
  }
31
120
  /**
32
- * A lazily resolved representation used for recursive schemas.
33
- *
34
- * **Details**
35
- *
36
- * `thunk` points to the actual representation, possibly via a
37
- * {@link Reference}. `checks` is always empty on `Suspend` nodes.
38
- *
39
- * @see {@link Reference}
121
+ * A lazily resolved representation.
40
122
  *
41
123
  * @category models
42
124
  * @since 4.0.0
@@ -48,25 +130,7 @@ export interface Suspend {
48
130
  readonly thunk: Representation;
49
131
  }
50
132
  /**
51
- * A named reference to a definition in the {@link References} map.
52
- *
53
- * **When to use**
54
- *
55
- * Use when a representation should point to a named definition instead of
56
- * embedding the definition inline.
57
- *
58
- * **Details**
59
- *
60
- * `$ref` is the key into `Document.references` or `MultiDocument.references`.
61
- * References are resolved lazily by {@link toSchema} and
62
- * {@link toCodeDocument}.
63
- *
64
- * **Gotchas**
65
- *
66
- * Resolution throws at runtime if the key is not found in the references map.
67
- *
68
- * @see {@link References}
69
- * @see {@link Document}
133
+ * A named reference.
70
134
  *
71
135
  * @category models
72
136
  * @since 4.0.0
@@ -75,227 +139,155 @@ export interface Reference {
75
139
  readonly _tag: "Reference";
76
140
  readonly $ref: string;
77
141
  }
142
+ interface Keyword<Tag extends string> {
143
+ readonly _tag: Tag;
144
+ readonly annotations?: Schema.Annotations.Annotations | undefined;
145
+ readonly checks: ReadonlyArray<Check>;
146
+ }
78
147
  /**
79
- * The `null` type.
148
+ * The null keyword representation.
80
149
  *
81
150
  * @category models
82
151
  * @since 4.0.0
83
152
  */
84
- export interface Null {
85
- readonly _tag: "Null";
86
- readonly annotations?: Schema.Annotations.Annotations | undefined;
153
+ export interface Null extends Keyword<"Null"> {
87
154
  }
88
155
  /**
89
- * The `undefined` type.
156
+ * The undefined keyword representation.
90
157
  *
91
158
  * @category models
92
159
  * @since 4.0.0
93
160
  */
94
- export interface Undefined {
95
- readonly _tag: "Undefined";
96
- readonly annotations?: Schema.Annotations.Annotations | undefined;
161
+ export interface Undefined extends Keyword<"Undefined"> {
97
162
  }
98
163
  /**
99
- * The `void` type.
164
+ * The void keyword representation.
100
165
  *
101
166
  * @category models
102
167
  * @since 4.0.0
103
168
  */
104
- export interface Void {
105
- readonly _tag: "Void";
106
- readonly annotations?: Schema.Annotations.Annotations | undefined;
169
+ export interface Void extends Keyword<"Void"> {
107
170
  }
108
171
  /**
109
- * The `never` type (no valid values).
172
+ * The never keyword representation.
110
173
  *
111
174
  * @category models
112
175
  * @since 4.0.0
113
176
  */
114
- export interface Never {
115
- readonly _tag: "Never";
116
- readonly annotations?: Schema.Annotations.Annotations | undefined;
177
+ export interface Never extends Keyword<"Never"> {
117
178
  }
118
179
  /**
119
- * The `unknown` type (any value accepted).
180
+ * The unknown keyword representation.
120
181
  *
121
182
  * @category models
122
183
  * @since 4.0.0
123
184
  */
124
- export interface Unknown {
125
- readonly _tag: "Unknown";
126
- readonly annotations?: Schema.Annotations.Annotations | undefined;
185
+ export interface Unknown extends Keyword<"Unknown"> {
127
186
  }
128
187
  /**
129
- * The `any` type.
188
+ * The any keyword representation.
130
189
  *
131
190
  * @category models
132
191
  * @since 4.0.0
133
192
  */
134
- export interface Any {
135
- readonly _tag: "Any";
136
- readonly annotations?: Schema.Annotations.Annotations | undefined;
193
+ export interface Any extends Keyword<"Any"> {
137
194
  }
138
195
  /**
139
- * The `string` type with optional validation checks.
140
- *
141
- * **Details**
142
- *
143
- * `checks` holds string-specific constraints, such as min/max length, pattern,
144
- * and UUID checks. `contentMediaType` and `contentSchema` indicate that the
145
- * string contains encoded data, such as `"application/json"` with a nested
146
- * schema.
147
- *
148
- * @see {@link StringMeta}
149
- * @see {@link Check}
196
+ * A string representation.
150
197
  *
151
198
  * @category models
152
199
  * @since 4.0.0
153
200
  */
154
- export interface String {
155
- readonly _tag: "String";
156
- readonly annotations?: Schema.Annotations.Annotations | undefined;
157
- readonly checks: ReadonlyArray<Check<StringMeta>>;
158
- readonly contentMediaType?: string | undefined;
159
- readonly contentSchema?: Representation | undefined;
201
+ export interface String extends Keyword<"String"> {
160
202
  }
161
203
  /**
162
- * The `number` type with optional validation checks.
163
- *
164
- * **Details**
165
- *
166
- * `checks` holds number-specific constraints, such as int, finite, min, max,
167
- * multipleOf, and between checks.
168
- *
169
- * @see {@link NumberMeta}
204
+ * A number representation.
170
205
  *
171
206
  * @category models
172
207
  * @since 4.0.0
173
208
  */
174
- export interface Number {
175
- readonly _tag: "Number";
176
- readonly annotations?: Schema.Annotations.Annotations | undefined;
177
- readonly checks: ReadonlyArray<Check<NumberMeta>>;
209
+ export interface Number extends Keyword<"Number"> {
178
210
  }
179
211
  /**
180
- * The `boolean` type.
212
+ * A boolean representation.
181
213
  *
182
214
  * @category models
183
215
  * @since 4.0.0
184
216
  */
185
- export interface Boolean {
186
- readonly _tag: "Boolean";
187
- readonly annotations?: Schema.Annotations.Annotations | undefined;
217
+ export interface Boolean extends Keyword<"Boolean"> {
188
218
  }
189
219
  /**
190
- * The `bigint` type with optional validation checks.
191
- *
192
- * @see {@link BigIntMeta}
220
+ * A bigint representation.
193
221
  *
194
222
  * @category models
195
223
  * @since 4.0.0
196
224
  */
197
- export interface BigInt {
198
- readonly _tag: "BigInt";
199
- readonly annotations?: Schema.Annotations.Annotations | undefined;
200
- readonly checks: ReadonlyArray<Check<BigIntMeta>>;
225
+ export interface BigInt extends Keyword<"BigInt"> {
201
226
  }
202
227
  /**
203
- * The `symbol` type.
228
+ * A symbol representation.
204
229
  *
205
230
  * @category models
206
231
  * @since 4.0.0
207
232
  */
208
- export interface Symbol {
209
- readonly _tag: "Symbol";
210
- readonly annotations?: Schema.Annotations.Annotations | undefined;
233
+ export interface Symbol extends Keyword<"Symbol"> {
211
234
  }
212
235
  /**
213
- * A specific literal value (`string`, `number`, `boolean`, or `bigint`).
236
+ * A literal representation.
237
+ *
238
+ * **Details**
239
+ *
240
+ * The live representation stores the native literal value. Persistent codecs
241
+ * add an explicit type discriminator when encoding it.
214
242
  *
215
243
  * @category models
216
244
  * @since 4.0.0
217
245
  */
218
- export interface Literal {
219
- readonly _tag: "Literal";
220
- readonly annotations?: Schema.Annotations.Annotations | undefined;
221
- readonly literal: string | number | boolean | bigint;
246
+ export interface Literal extends Keyword<"Literal"> {
247
+ readonly literal: SchemaAST.LiteralValue;
222
248
  }
223
249
  /**
224
- * A specific unique `symbol` value.
250
+ * A unique global symbol representation.
225
251
  *
226
252
  * @category models
227
253
  * @since 4.0.0
228
254
  */
229
- export interface UniqueSymbol {
230
- readonly _tag: "UniqueSymbol";
231
- readonly annotations?: Schema.Annotations.Annotations | undefined;
255
+ export interface UniqueSymbol extends Keyword<"UniqueSymbol"> {
232
256
  readonly symbol: symbol;
233
257
  }
234
258
  /**
235
- * The `object` keyword type (matches any non-primitive).
259
+ * The object keyword representation.
236
260
  *
237
261
  * @category models
238
262
  * @since 4.0.0
239
263
  */
240
- export interface ObjectKeyword {
241
- readonly _tag: "ObjectKeyword";
242
- readonly annotations?: Schema.Annotations.Annotations | undefined;
264
+ export interface ObjectKeyword extends Keyword<"ObjectKeyword"> {
243
265
  }
244
266
  /**
245
- * A TypeScript-style enum. Each entry is a `[name, value]` pair.
267
+ * An enum representation.
268
+ *
269
+ * **Details**
270
+ *
271
+ * Enum members are stored as native string or number values. Persistent
272
+ * codecs add an explicit type discriminator when encoding them.
246
273
  *
247
274
  * @category models
248
275
  * @since 4.0.0
249
276
  */
250
- export interface Enum {
251
- readonly _tag: "Enum";
252
- readonly annotations?: Schema.Annotations.Annotations | undefined;
277
+ export interface Enum extends Keyword<"Enum"> {
253
278
  readonly enums: ReadonlyArray<readonly [string, string | number]>;
254
279
  }
255
280
  /**
256
- * A template literal type composed of a sequence of parts (literals, strings,
257
- * numbers, etc.).
281
+ * A template literal representation.
258
282
  *
259
283
  * @category models
260
284
  * @since 4.0.0
261
285
  */
262
- export interface TemplateLiteral {
263
- readonly _tag: "TemplateLiteral";
264
- readonly annotations?: Schema.Annotations.Annotations | undefined;
286
+ export interface TemplateLiteral extends Keyword<"TemplateLiteral"> {
265
287
  readonly parts: ReadonlyArray<Representation>;
266
288
  }
267
289
  /**
268
- * An array or tuple type.
269
- *
270
- * **Details**
271
- *
272
- * `elements` are the fixed positional elements, or tuple prefix, and each may
273
- * be optional. `rest` contains the variadic tail types; a single-element
274
- * `rest` with no `elements` produces a plain `Array<T>`. `checks` holds
275
- * array-specific constraints, such as minLength, maxLength, and unique checks.
276
- *
277
- * @see {@link Element}
278
- * @see {@link ArraysMeta}
279
- *
280
- * @category models
281
- * @since 4.0.0
282
- */
283
- export interface Arrays {
284
- readonly _tag: "Arrays";
285
- readonly annotations?: Schema.Annotations.Annotations | undefined;
286
- readonly elements: ReadonlyArray<Element>;
287
- readonly rest: ReadonlyArray<Representation>;
288
- readonly checks: ReadonlyArray<Check<ArraysMeta>>;
289
- }
290
- /**
291
- * A positional element within an {@link Arrays} tuple.
292
- *
293
- * **Details**
294
- *
295
- * `isOptional` indicates whether this element can be absent. `type` is the
296
- * schema representation for this element's value.
297
- *
298
- * @see {@link Arrays}
290
+ * A tuple element.
299
291
  *
300
292
  * @category models
301
293
  * @since 4.0.0
@@ -306,38 +298,27 @@ export interface Element {
306
298
  readonly annotations?: Schema.Annotations.Annotations | undefined;
307
299
  }
308
300
  /**
309
- * An object/struct type with named properties and optional index signatures.
310
- *
311
- * **Details**
312
- *
313
- * `propertySignatures` are the explicitly named fields. `indexSignatures`
314
- * define catch-all key/value types, such as `Record<string, T>`. `checks`
315
- * holds object-specific constraints, such as minProperties and maxProperties.
316
- *
317
- * @see {@link PropertySignature}
318
- * @see {@link IndexSignature}
319
- * @see {@link ObjectsMeta}
301
+ * An array or tuple representation.
320
302
  *
321
303
  * @category models
322
304
  * @since 4.0.0
323
305
  */
324
- export interface Objects {
325
- readonly _tag: "Objects";
326
- readonly annotations?: Schema.Annotations.Annotations | undefined;
327
- readonly propertySignatures: ReadonlyArray<PropertySignature>;
328
- readonly indexSignatures: ReadonlyArray<IndexSignature>;
329
- readonly checks: ReadonlyArray<Check<ObjectsMeta>>;
306
+ export interface Arrays extends Keyword<"Arrays"> {
307
+ readonly elements: ReadonlyArray<Element>;
308
+ readonly rest: ReadonlyArray<Representation>;
330
309
  }
331
310
  /**
332
- * A named property within an {@link Objects} representation.
311
+ * A property signature.
333
312
  *
334
313
  * **Details**
335
314
  *
336
- * `name` is the property key, which can be a string, number, or symbol.
337
- * `isOptional` indicates whether the key can be absent. `isMutable` indicates
338
- * whether the property is mutable rather than readonly.
315
+ * The live representation stores the native property key. Persistent codecs
316
+ * add an explicit type discriminator when encoding it.
339
317
  *
340
- * @see {@link Objects}
318
+ * **Gotchas**
319
+ *
320
+ * Local symbols can be represented while the schema is live, but persistent
321
+ * codecs reject them because they cannot be reconstructed by identity.
341
322
  *
342
323
  * @category models
343
324
  * @since 4.0.0
@@ -350,15 +331,7 @@ export interface PropertySignature {
350
331
  readonly annotations?: Schema.Annotations.Annotations | undefined;
351
332
  }
352
333
  /**
353
- * An index signature, such as `[key: string]: number`, within an
354
- * {@link Objects}.
355
- *
356
- * **Details**
357
- *
358
- * `parameter` is the key type representation. `type` is the value type
359
- * representation.
360
- *
361
- * @see {@link Objects}
334
+ * An index signature.
362
335
  *
363
336
  * @category models
364
337
  * @since 4.0.0
@@ -368,1581 +341,493 @@ export interface IndexSignature {
368
341
  readonly type: Representation;
369
342
  }
370
343
  /**
371
- * A union of multiple representations.
372
- *
373
- * **Details**
344
+ * An object representation.
374
345
  *
375
- * `types` are the union members. `mode` controls JSON Schema output as either
376
- * `"anyOf"` (the default) or mutually exclusive `"oneOf"`.
346
+ * @category models
347
+ * @since 4.0.0
348
+ */
349
+ export interface Objects extends Keyword<"Objects"> {
350
+ readonly propertySignatures: ReadonlyArray<PropertySignature>;
351
+ readonly indexSignatures: ReadonlyArray<IndexSignature>;
352
+ }
353
+ /**
354
+ * A union representation.
377
355
  *
378
356
  * @category models
379
357
  * @since 4.0.0
380
358
  */
381
- export interface Union {
382
- readonly _tag: "Union";
383
- readonly annotations?: Schema.Annotations.Annotations | undefined;
359
+ export interface Union extends Keyword<"Union"> {
384
360
  readonly types: ReadonlyArray<Representation>;
385
361
  readonly mode: "anyOf" | "oneOf";
386
362
  }
387
363
  /**
388
- * The core tagged union of all supported schema shapes.
389
- *
390
- * **Details**
391
- *
392
- * Each variant has a `_tag` discriminator. Switch on `_tag` to handle each
393
- * shape. Most variants carry optional `annotations` and some carry `checks`
394
- * for validation constraints.
395
- *
396
- * @see {@link Document}
397
- * @see {@link fromAST}
364
+ * The structural schema representation.
398
365
  *
399
366
  * @category models
400
367
  * @since 4.0.0
401
368
  */
402
369
  export type Representation = Declaration | Reference | Suspend | Null | Undefined | Void | Never | Unknown | Any | String | Number | Boolean | BigInt | Symbol | Literal | UniqueSymbol | ObjectKeyword | Enum | TemplateLiteral | Arrays | Objects | Union;
403
370
  /**
404
- * A validation constraint attached to a type. Either a single {@link Filter}
405
- * or a {@link FilterGroup} combining multiple checks.
406
- *
407
- * @see {@link Filter}
408
- * @see {@link FilterGroup}
371
+ * A structural check.
409
372
  *
410
373
  * @category models
411
374
  * @since 4.0.0
412
375
  */
413
- export type Check<M> = Filter<M> | FilterGroup<M>;
376
+ export type Check = Filter | FilterGroup;
414
377
  /**
415
- * A single validation constraint with typed metadata describing the check
416
- * (e.g. `{ _tag: "isMinLength", minLength: 3 }`).
417
- *
418
- * @see {@link Check}
378
+ * An opaque leaf check.
419
379
  *
420
380
  * @category models
421
381
  * @since 4.0.0
422
382
  */
423
- export interface Filter<M> {
383
+ export interface Filter {
424
384
  readonly _tag: "Filter";
425
- readonly annotations?: Schema.Annotations.Filter | undefined;
426
- readonly meta: M;
385
+ readonly representation?: CheckRepresentationAnnotation<Representation> | undefined;
386
+ readonly annotations?: Schema.Annotations.Annotations | undefined;
387
+ readonly aborted: boolean;
427
388
  }
428
389
  /**
429
- * A group of validation constraints that are logically combined. Contains
430
- * at least one {@link Check}.
431
- *
432
- * @see {@link Check}
390
+ * A non-empty group of checks.
433
391
  *
434
392
  * @category models
435
393
  * @since 4.0.0
436
394
  */
437
- export interface FilterGroup<M> {
395
+ export interface FilterGroup {
438
396
  readonly _tag: "FilterGroup";
439
- readonly annotations?: Schema.Annotations.Filter | undefined;
440
- readonly checks: readonly [Check<M>, ...Array<Check<M>>];
397
+ readonly representation?: CheckRepresentationAnnotation<Representation> | undefined;
398
+ readonly annotations?: Schema.Annotations.Annotations | undefined;
399
+ readonly checks: readonly [Check, ...Array<Check>];
441
400
  }
442
401
  /**
443
- * Metadata union for string-specific validation checks (minLength, maxLength,
444
- * pattern, UUID, trimmed, etc.).
445
- *
446
- * @see {@link String}
447
- * @see {@link Check}
402
+ * Named representation definitions.
448
403
  *
449
404
  * @category models
450
405
  * @since 4.0.0
451
406
  */
452
- export type StringMeta = Schema.Annotations.BuiltInMetaDefinitions["isStringFinite" | "isStringBigInt" | "isStringSymbol" | "isMinLength" | "isMaxLength" | "isPattern" | "isLengthBetween" | "isTrimmed" | "isUUID" | "isGUID" | "isULID" | "isBase64" | "isBase64Url" | "isStartsWith" | "isEndsWith" | "isIncludes" | "isUppercased" | "isLowercased" | "isCapitalized" | "isUncapitalized"];
407
+ export interface References {
408
+ readonly [$ref: string]: Representation;
409
+ }
453
410
  /**
454
- * Metadata union for number-specific validation checks (int, finite,
455
- * min, max, multipleOf, between).
456
- *
457
- * @see {@link Number}
458
- * @see {@link Check}
411
+ * A single representation and its definitions.
459
412
  *
460
413
  * @category models
461
414
  * @since 4.0.0
462
415
  */
463
- export type NumberMeta = Schema.Annotations.BuiltInMetaDefinitions["isInt" | "isFinite" | "isMultipleOf" | "isGreaterThanOrEqualTo" | "isLessThanOrEqualTo" | "isGreaterThan" | "isLessThan" | "isBetween"];
416
+ export interface Document {
417
+ readonly representation: Representation;
418
+ readonly references: References;
419
+ }
464
420
  /**
465
- * Metadata union for bigint-specific validation checks (min, max, between).
466
- *
467
- * @see {@link BigInt}
468
- * @see {@link Check}
421
+ * Multiple representations sharing definitions.
469
422
  *
470
423
  * @category models
471
424
  * @since 4.0.0
472
425
  */
473
- export type BigIntMeta = Schema.Annotations.BuiltInMetaDefinitions["isGreaterThanOrEqualToBigInt" | "isLessThanOrEqualToBigInt" | "isGreaterThanBigInt" | "isLessThanBigInt" | "isBetweenBigInt"];
426
+ export interface MultiDocument {
427
+ readonly representations: readonly [Representation, ...Array<Representation>];
428
+ readonly references: References;
429
+ }
474
430
  /**
475
- * Metadata union for array-specific validation checks (minLength, maxLength,
476
- * length, unique).
477
- *
478
- * @see {@link Arrays}
479
- * @see {@link Check}
431
+ * Reviver for a declaration.
480
432
  *
481
433
  * @category models
482
434
  * @since 4.0.0
483
435
  */
484
- export type ArraysMeta = Schema.Annotations.BuiltInMetaDefinitions["isMinLength" | "isMaxLength" | "isLengthBetween" | "isUnique"];
436
+ export interface DeclarationReviver<P> {
437
+ readonly id: string;
438
+ readonly payloadSchema: Schema.Decoder<P>;
439
+ readonly revive: (input: {
440
+ readonly payload: P;
441
+ readonly typeParameters: ReadonlyArray<Schema.Top>;
442
+ readonly annotations: Schema.Annotations.Annotations | undefined;
443
+ }) => Schema.Top;
444
+ }
485
445
  /**
486
- * Metadata union for object-specific validation checks (minProperties,
487
- * maxProperties, propertiesLength, propertyNames).
488
- *
489
- * @see {@link Objects}
490
- * @see {@link Check}
446
+ * Reviver for a leaf check.
491
447
  *
492
448
  * @category models
493
449
  * @since 4.0.0
494
450
  */
495
- export type ObjectsMeta = Schema.Annotations.BuiltInMetaDefinitions["isMinProperties" | "isMaxProperties" | "isPropertiesLengthBetween"] | {
496
- readonly _tag: "isPropertyNames";
497
- readonly propertyNames: Representation;
498
- };
451
+ export interface FilterReviver<P> {
452
+ readonly id: string;
453
+ readonly payloadSchema: Schema.Decoder<P>;
454
+ readonly revive: (input: {
455
+ readonly payload: P;
456
+ readonly schemas: ReadonlyArray<Schema.Top>;
457
+ readonly annotations: Schema.Annotations.Filter | undefined;
458
+ }) => SchemaAST.Filter<any>;
459
+ }
499
460
  /**
500
- * Metadata union for Date-specific validation checks (valid, min, max, between).
501
- *
502
- * @see {@link Declaration}
503
- * @see {@link DeclarationMeta}
461
+ * Reviver for a check group.
504
462
  *
505
463
  * @category models
506
464
  * @since 4.0.0
507
465
  */
508
- export type DateMeta = Schema.Annotations.BuiltInMetaDefinitions["isDateValid" | "isGreaterThanDate" | "isGreaterThanOrEqualToDate" | "isLessThanDate" | "isLessThanOrEqualToDate" | "isBetweenDate"];
466
+ export interface FilterGroupReviver<P> {
467
+ readonly id: string;
468
+ readonly payloadSchema: Schema.Decoder<P>;
469
+ readonly revive: (input: {
470
+ readonly payload: P;
471
+ readonly schemas: ReadonlyArray<Schema.Top>;
472
+ readonly annotations: Schema.Annotations.Filter | undefined;
473
+ }) => SchemaAST.FilterGroup<any>;
474
+ }
509
475
  /**
510
- * Metadata union for size-based validation checks (minSize, maxSize, size).
511
- * Used for collection types like `Set`, `Map`.
512
- *
513
- * @see {@link Declaration}
514
- * @see {@link DeclarationMeta}
476
+ * A check reviver.
515
477
  *
516
478
  * @category models
517
479
  * @since 4.0.0
518
480
  */
519
- export type SizeMeta = Schema.Annotations.BuiltInMetaDefinitions["isMinSize" | "isMaxSize" | "isSizeBetween"];
481
+ export type CheckReviver<P> = FilterReviver<P> | FilterGroupReviver<P>;
520
482
  /**
521
- * Metadata union for {@link Declaration} checks — either {@link DateMeta}
522
- * or {@link SizeMeta}.
483
+ * A typed reviver.
523
484
  *
524
485
  * @category models
525
486
  * @since 4.0.0
526
487
  */
527
- export type DeclarationMeta = DateMeta | SizeMeta;
488
+ export type Reviver<P> = DeclarationReviver<P> | CheckReviver<P>;
528
489
  /**
529
- * A string-keyed map of named {@link Representation} definitions. Used by
530
- * {@link Document} and {@link MultiDocument} for `$ref` resolution (analogous
531
- * to JSON Schema `$defs`).
532
- *
533
- * @see {@link Reference}
534
- * @see {@link Document}
490
+ * A reviver erased only at collection boundaries.
535
491
  *
536
492
  * @category models
537
493
  * @since 4.0.0
538
494
  */
539
- export interface References {
540
- readonly [$ref: string]: Representation;
541
- }
495
+ export type AnyReviver = Reviver<any>;
542
496
  /**
543
- * A single {@link Representation} together with its named {@link References}.
544
- *
545
- * **When to use**
497
+ * Creates a declaration reviver while inferring its payload type from `payloadSchema`.
546
498
  *
547
- * Use when representing a single Schema AST together with its named references
548
- * before reconstructing a runtime Schema, converting to JSON Schema, or
549
- * wrapping it as a {@link MultiDocument}.
550
- *
551
- * @see {@link MultiDocument}
552
- * @see {@link fromAST}
553
- *
554
- * @category models
499
+ * @category constructors
555
500
  * @since 4.0.0
556
501
  */
557
- export type Document = {
558
- readonly representation: Representation;
559
- readonly references: References;
560
- };
502
+ export declare const makeDeclarationReviver: <P>(id: string, payloadSchema: Schema.Decoder<P>, revive: DeclarationReviver<P>["revive"]) => DeclarationReviver<P>;
561
503
  /**
562
- * One or more {@link Representation}s sharing a common {@link References} map.
563
- *
564
- * **When to use**
504
+ * Creates a filter reviver while inferring its payload type from `payloadSchema`.
565
505
  *
566
- * Use when you use {@link fromASTs} to create this from multiple Schema ASTs,
567
- * {@link toCodeDocument} to generate TypeScript code, and
568
- * {@link toJsonSchemaMultiDocument} to convert to JSON Schema.
569
- *
570
- * @see {@link Document}
571
- * @see {@link fromASTs}
572
- *
573
- * @category models
506
+ * @category constructors
574
507
  * @since 4.0.0
575
508
  */
576
- export type MultiDocument = {
577
- readonly representations: readonly [Representation, ...Array<Representation>];
578
- readonly references: References;
579
- };
509
+ export declare const makeFilterReviver: <P>(id: string, payloadSchema: Schema.Decoder<P>, revive: FilterReviver<P>["revive"]) => FilterReviver<P>;
580
510
  /**
581
- * A tree of primitive values used to serialize annotations to JSON.
511
+ * Creates a filter group reviver while inferring its payload type from `payloadSchema`.
582
512
  *
583
- * @category Tree
513
+ * @category constructors
584
514
  * @since 4.0.0
585
515
  */
586
- export type PrimitiveTree = Schema.Tree<null | number | boolean | bigint | symbol | string>;
516
+ export declare const makeFilterGroupReviver: <P>(id: string, payloadSchema: Schema.Decoder<P>, revive: FilterGroupReviver<P>["revive"]) => FilterGroupReviver<P>;
587
517
  /**
588
- * Schema for {@link PrimitiveTree}.
518
+ * Options for importing JSON Schema Draft 2020-12 documents.
589
519
  *
590
520
  * **When to use**
591
521
  *
592
- * Use to validate recursive annotation metadata trees whose leaves are `null`,
593
- * `number`, `boolean`, `bigint`, `symbol`, or `string`.
522
+ * Use when each JSON Schema node must be transformed before it is translated.
594
523
  *
595
- * @see {@link PrimitiveTree} for the recursive tree type accepted by this codec
596
- * @see {@link $Annotations} for the annotation codec that filters values through this codec
524
+ * **Gotchas**
597
525
  *
598
- * @category schemas
526
+ * `onEnter` must return a JSON Schema object. Its result is used directly, and exceptions raised by the callback pass through unchanged.
527
+ *
528
+ * @category models
599
529
  * @since 4.0.0
600
530
  */
601
- export declare const $PrimitiveTree: Schema.Codec<PrimitiveTree>;
531
+ export interface FromJsonSchemaOptions {
532
+ readonly onEnter?: ((schema: JsonSchema.JsonSchema) => JsonSchema.JsonSchema) | undefined;
533
+ }
602
534
  /**
603
- * Schema for serializing public `Schema.Annotations.Annotations` values. It
604
- * filters out internal annotation keys and non-primitive values during
605
- * encoding.
606
- *
607
- * **When to use**
535
+ * Runtime and TypeScript source generated for one schema.
608
536
  *
609
- * Use to serialize schema annotations in representation schemas while retaining
610
- * only primitive-tree metadata.
611
- *
612
- * **Details**
613
- *
614
- * Decoding is passthrough. Encoding removes internal annotation keys and values
615
- * that are not accepted by `$PrimitiveTree`.
616
- *
617
- * @see {@link $PrimitiveTree} for the codec used to filter annotation values
618
- *
619
- * @category schemas
537
+ * @category models
620
538
  * @since 4.0.0
621
539
  */
622
- export declare const $Annotations: Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>;
540
+ export interface Code {
541
+ readonly runtime: string;
542
+ readonly Type: string;
543
+ }
623
544
  /**
624
- * Schema for the {@link Null} representation node.
545
+ * Creates generated runtime and TypeScript source strings for a schema.
625
546
  *
626
- * @category schemas
547
+ * @category constructors
627
548
  * @since 4.0.0
628
549
  */
629
- export declare const $Null: Schema.Struct<{
630
- readonly _tag: Schema.tag<"Null">;
631
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
632
- }>;
550
+ export declare const makeCode: (runtime: string, Type: string) => Code;
633
551
  /**
634
- * Schema for the {@link Undefined} representation node.
552
+ * Auxiliary source artifact emitted while generating schema code.
635
553
  *
636
- * @category schemas
554
+ * @category models
637
555
  * @since 4.0.0
638
556
  */
639
- export declare const $Undefined: Schema.Struct<{
640
- readonly _tag: Schema.tag<"Undefined">;
641
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
642
- }>;
557
+ export type Artifact = {
558
+ readonly _tag: "Symbol";
559
+ readonly identifier: string;
560
+ readonly code: Code;
561
+ } | {
562
+ readonly _tag: "Enum";
563
+ readonly identifier: string;
564
+ readonly code: Code;
565
+ } | {
566
+ readonly _tag: "Import";
567
+ readonly importDeclaration: string;
568
+ };
643
569
  /**
644
- * Schema for the {@link Void} representation node.
570
+ * Generated schema code together with named references and auxiliary artifacts.
645
571
  *
646
- * @category schemas
572
+ * @category models
647
573
  * @since 4.0.0
648
- */
649
- export declare const $Void: Schema.Struct<{
650
- readonly _tag: Schema.tag<"Void">;
651
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
652
- }>;
653
- /**
654
- * Schema for the {@link Never} representation node.
655
- *
656
- * @category schemas
657
- * @since 4.0.0
658
- */
659
- export declare const $Never: Schema.Struct<{
660
- readonly _tag: Schema.tag<"Never">;
661
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
662
- }>;
574
+ */
575
+ export interface CodeDocument {
576
+ readonly codes: ReadonlyArray<Code>;
577
+ readonly references: {
578
+ readonly nonRecursives: ReadonlyArray<{
579
+ readonly $ref: string;
580
+ readonly code: Code;
581
+ }>;
582
+ readonly recursives: Readonly<Record<string, Code>>;
583
+ };
584
+ readonly artifacts: ReadonlyArray<Artifact>;
585
+ }
663
586
  /**
664
- * Schema for the {@link Unknown} representation node.
665
- *
666
- * @category schemas
667
- * @since 4.0.0
668
- */
669
- export declare const $Unknown: Schema.Struct<{
670
- readonly _tag: Schema.tag<"Unknown">;
671
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
672
- }>;
673
- /**
674
- * Schema for the {@link Any} representation node.
675
- *
676
- * @category schemas
677
- * @since 4.0.0
678
- */
679
- export declare const $Any: Schema.Struct<{
680
- readonly _tag: Schema.tag<"Any">;
681
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
682
- }>;
683
- /**
684
- * Schema for {@link StringMeta}.
685
- *
686
- * @category schemas
687
- * @since 4.0.0
688
- */
689
- export declare const $StringMeta: Schema.Union<readonly [Schema.Struct<{
690
- readonly _tag: Schema.tag<"isStringFinite">;
691
- readonly regExp: Schema.RegExp;
692
- }>, Schema.Struct<{
693
- readonly _tag: Schema.tag<"isStringBigInt">;
694
- readonly regExp: Schema.RegExp;
695
- }>, Schema.Struct<{
696
- readonly _tag: Schema.tag<"isStringSymbol">;
697
- readonly regExp: Schema.RegExp;
698
- }>, Schema.Struct<{
699
- readonly _tag: Schema.tag<"isTrimmed">;
700
- readonly regExp: Schema.RegExp;
701
- }>, Schema.Struct<{
702
- readonly _tag: Schema.tag<"isUUID">;
703
- readonly regExp: Schema.RegExp;
704
- readonly version: Schema.UndefinedOr<Schema.Literals<readonly [1, 2, 3, 4, 5, 6, 7, 8]>>;
705
- }>, Schema.Struct<{
706
- readonly _tag: Schema.tag<"isGUID">;
707
- readonly regExp: Schema.RegExp;
708
- }>, Schema.Struct<{
709
- readonly _tag: Schema.tag<"isULID">;
710
- readonly regExp: Schema.RegExp;
711
- }>, Schema.Struct<{
712
- readonly _tag: Schema.tag<"isBase64">;
713
- readonly regExp: Schema.RegExp;
714
- }>, Schema.Struct<{
715
- readonly _tag: Schema.tag<"isBase64Url">;
716
- readonly regExp: Schema.RegExp;
717
- }>, Schema.Struct<{
718
- readonly _tag: Schema.tag<"isStartsWith">;
719
- readonly startsWith: Schema.String;
720
- readonly regExp: Schema.RegExp;
721
- }>, Schema.Struct<{
722
- readonly _tag: Schema.tag<"isEndsWith">;
723
- readonly endsWith: Schema.String;
724
- readonly regExp: Schema.RegExp;
725
- }>, Schema.Struct<{
726
- readonly _tag: Schema.tag<"isIncludes">;
727
- readonly includes: Schema.String;
728
- readonly regExp: Schema.RegExp;
729
- }>, Schema.Struct<{
730
- readonly _tag: Schema.tag<"isUppercased">;
731
- readonly regExp: Schema.RegExp;
732
- }>, Schema.Struct<{
733
- readonly _tag: Schema.tag<"isLowercased">;
734
- readonly regExp: Schema.RegExp;
735
- }>, Schema.Struct<{
736
- readonly _tag: Schema.tag<"isCapitalized">;
737
- readonly regExp: Schema.RegExp;
738
- }>, Schema.Struct<{
739
- readonly _tag: Schema.tag<"isUncapitalized">;
740
- readonly regExp: Schema.RegExp;
741
- }>, Schema.Struct<{
742
- readonly _tag: Schema.tag<"isMinLength">;
743
- readonly minLength: Schema.Int;
744
- }>, Schema.Struct<{
745
- readonly _tag: Schema.tag<"isMaxLength">;
746
- readonly maxLength: Schema.Int;
747
- }>, Schema.Struct<{
748
- readonly _tag: Schema.tag<"isPattern">;
749
- readonly regExp: Schema.RegExp;
750
- }>, Schema.Struct<{
751
- readonly _tag: Schema.tag<"isLengthBetween">;
752
- readonly minimum: Schema.Int;
753
- readonly maximum: Schema.Int;
754
- }>]>;
755
- /**
756
- * Schema for the {@link String} representation node.
757
- *
758
- * @category schemas
759
- * @since 4.0.0
760
- */
761
- export declare const $String: Schema.Struct<{
762
- readonly _tag: Schema.tag<"String">;
763
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
764
- readonly checks: Schema.$Array<Schema.Codec<Check<{
765
- readonly _tag: "isStringFinite";
766
- readonly regExp: RegExp;
767
- } | {
768
- readonly _tag: "isStringBigInt";
769
- readonly regExp: RegExp;
770
- } | {
771
- readonly _tag: "isStringSymbol";
772
- readonly regExp: RegExp;
773
- } | {
774
- readonly _tag: "isTrimmed";
775
- readonly regExp: RegExp;
776
- } | {
777
- readonly _tag: "isUUID";
778
- readonly regExp: RegExp;
779
- readonly version: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | undefined;
780
- } | {
781
- readonly _tag: "isGUID";
782
- readonly regExp: RegExp;
783
- } | {
784
- readonly _tag: "isULID";
785
- readonly regExp: RegExp;
786
- } | {
787
- readonly _tag: "isBase64";
788
- readonly regExp: RegExp;
789
- } | {
790
- readonly _tag: "isBase64Url";
791
- readonly regExp: RegExp;
792
- } | {
793
- readonly _tag: "isStartsWith";
794
- readonly startsWith: string;
795
- readonly regExp: RegExp;
796
- } | {
797
- readonly _tag: "isEndsWith";
798
- readonly endsWith: string;
799
- readonly regExp: RegExp;
800
- } | {
801
- readonly _tag: "isIncludes";
802
- readonly includes: string;
803
- readonly regExp: RegExp;
804
- } | {
805
- readonly _tag: "isUppercased";
806
- readonly regExp: RegExp;
807
- } | {
808
- readonly _tag: "isLowercased";
809
- readonly regExp: RegExp;
810
- } | {
811
- readonly _tag: "isCapitalized";
812
- readonly regExp: RegExp;
813
- } | {
814
- readonly _tag: "isUncapitalized";
815
- readonly regExp: RegExp;
816
- } | {
817
- readonly _tag: "isMinLength";
818
- readonly minLength: number;
819
- } | {
820
- readonly _tag: "isMaxLength";
821
- readonly maxLength: number;
822
- } | {
823
- readonly _tag: "isPattern";
824
- readonly regExp: RegExp;
825
- } | {
826
- readonly _tag: "isLengthBetween";
827
- readonly minimum: number;
828
- readonly maximum: number;
829
- }>, Check<{
830
- readonly _tag: "isStringFinite";
831
- readonly regExp: RegExp;
832
- } | {
833
- readonly _tag: "isStringBigInt";
834
- readonly regExp: RegExp;
835
- } | {
836
- readonly _tag: "isStringSymbol";
837
- readonly regExp: RegExp;
838
- } | {
839
- readonly _tag: "isTrimmed";
840
- readonly regExp: RegExp;
841
- } | {
842
- readonly _tag: "isUUID";
843
- readonly regExp: RegExp;
844
- readonly version: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | undefined;
845
- } | {
846
- readonly _tag: "isGUID";
847
- readonly regExp: RegExp;
848
- } | {
849
- readonly _tag: "isULID";
850
- readonly regExp: RegExp;
851
- } | {
852
- readonly _tag: "isBase64";
853
- readonly regExp: RegExp;
854
- } | {
855
- readonly _tag: "isBase64Url";
856
- readonly regExp: RegExp;
857
- } | {
858
- readonly _tag: "isStartsWith";
859
- readonly startsWith: string;
860
- readonly regExp: RegExp;
861
- } | {
862
- readonly _tag: "isEndsWith";
863
- readonly endsWith: string;
864
- readonly regExp: RegExp;
865
- } | {
866
- readonly _tag: "isIncludes";
867
- readonly includes: string;
868
- readonly regExp: RegExp;
869
- } | {
870
- readonly _tag: "isUppercased";
871
- readonly regExp: RegExp;
872
- } | {
873
- readonly _tag: "isLowercased";
874
- readonly regExp: RegExp;
875
- } | {
876
- readonly _tag: "isCapitalized";
877
- readonly regExp: RegExp;
878
- } | {
879
- readonly _tag: "isUncapitalized";
880
- readonly regExp: RegExp;
881
- } | {
882
- readonly _tag: "isMinLength";
883
- readonly minLength: number;
884
- } | {
885
- readonly _tag: "isMaxLength";
886
- readonly maxLength: number;
887
- } | {
888
- readonly _tag: "isPattern";
889
- readonly regExp: RegExp;
890
- } | {
891
- readonly _tag: "isLengthBetween";
892
- readonly minimum: number;
893
- readonly maximum: number;
894
- }>, never, never>>;
895
- readonly contentMediaType: Schema.optional<Schema.String>;
896
- readonly contentSchema: Schema.optional<Schema.suspend<$Representation>>;
897
- }>;
898
- /**
899
- * Schema for {@link NumberMeta}.
900
- *
901
- * @category schemas
902
- * @since 4.0.0
903
- */
904
- export declare const $NumberMeta: Schema.Union<readonly [Schema.Struct<{
905
- readonly _tag: Schema.tag<"isInt">;
906
- }>, Schema.Struct<{
907
- readonly _tag: Schema.tag<"isMultipleOf">;
908
- readonly divisor: Schema.Finite;
909
- }>, Schema.Struct<{
910
- readonly _tag: Schema.tag<"isFinite">;
911
- }>, Schema.Struct<{
912
- readonly _tag: Schema.tag<"isGreaterThan">;
913
- readonly exclusiveMinimum: Schema.Finite;
914
- }>, Schema.Struct<{
915
- readonly _tag: Schema.tag<"isGreaterThanOrEqualTo">;
916
- readonly minimum: Schema.Finite;
917
- }>, Schema.Struct<{
918
- readonly _tag: Schema.tag<"isLessThan">;
919
- readonly exclusiveMaximum: Schema.Finite;
920
- }>, Schema.Struct<{
921
- readonly _tag: Schema.tag<"isLessThanOrEqualTo">;
922
- readonly maximum: Schema.Finite;
923
- }>, Schema.Struct<{
924
- readonly _tag: Schema.tag<"isBetween">;
925
- readonly minimum: Schema.Finite;
926
- readonly maximum: Schema.Finite;
927
- readonly exclusiveMinimum: Schema.optional<Schema.Boolean>;
928
- readonly exclusiveMaximum: Schema.optional<Schema.Boolean>;
929
- }>]>;
930
- /**
931
- * Schema for the {@link Number} representation node.
932
- *
933
- * @category schemas
934
- * @since 4.0.0
935
- */
936
- export declare const $Number: Schema.Struct<{
937
- readonly _tag: Schema.tag<"Number">;
938
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
939
- readonly checks: Schema.$Array<Schema.Codec<Check<{
940
- readonly _tag: "isInt";
941
- } | {
942
- readonly _tag: "isMultipleOf";
943
- readonly divisor: number;
944
- } | {
945
- readonly _tag: "isFinite";
946
- } | {
947
- readonly _tag: "isGreaterThan";
948
- readonly exclusiveMinimum: number;
949
- } | {
950
- readonly _tag: "isGreaterThanOrEqualTo";
951
- readonly minimum: number;
952
- } | {
953
- readonly _tag: "isLessThan";
954
- readonly exclusiveMaximum: number;
955
- } | {
956
- readonly _tag: "isLessThanOrEqualTo";
957
- readonly maximum: number;
958
- } | {
959
- readonly _tag: "isBetween";
960
- readonly minimum: number;
961
- readonly maximum: number;
962
- readonly exclusiveMinimum?: boolean | undefined;
963
- readonly exclusiveMaximum?: boolean | undefined;
964
- }>, Check<{
965
- readonly _tag: "isInt";
966
- } | {
967
- readonly _tag: "isMultipleOf";
968
- readonly divisor: number;
969
- } | {
970
- readonly _tag: "isFinite";
971
- } | {
972
- readonly _tag: "isGreaterThan";
973
- readonly exclusiveMinimum: number;
974
- } | {
975
- readonly _tag: "isGreaterThanOrEqualTo";
976
- readonly minimum: number;
977
- } | {
978
- readonly _tag: "isLessThan";
979
- readonly exclusiveMaximum: number;
980
- } | {
981
- readonly _tag: "isLessThanOrEqualTo";
982
- readonly maximum: number;
983
- } | {
984
- readonly _tag: "isBetween";
985
- readonly minimum: number;
986
- readonly maximum: number;
987
- readonly exclusiveMinimum?: boolean | undefined;
988
- readonly exclusiveMaximum?: boolean | undefined;
989
- }>, never, never>>;
990
- }>;
991
- /**
992
- * Schema for the {@link Boolean} representation node.
993
- *
994
- * @category schemas
995
- * @since 4.0.0
996
- */
997
- export declare const $Boolean: Schema.Struct<{
998
- readonly _tag: Schema.tag<"Boolean">;
999
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1000
- }>;
1001
- /**
1002
- * Schema for the {@link BigInt} representation node.
1003
- *
1004
- * **When to use**
1005
- *
1006
- * Use to encode, decode, or validate serialized `BigInt` representation nodes,
1007
- * not application `bigint` values.
587
+ * Lowers the encoded side of an AST to a live representation document.
1008
588
  *
1009
589
  * **Details**
1010
590
  *
1011
- * Accepts representation nodes with `_tag: "BigInt"`, optional annotations,
1012
- * and bigint-specific validation metadata in `checks`.
591
+ * Apply `SchemaAST.toType` to the AST first to lower its type side instead.
1013
592
  *
1014
- * @see {@link BigIntMeta} for the metadata accepted by the `checks` array
1015
- *
1016
- * @category schemas
1017
- * @since 4.0.0
1018
- */
1019
- export declare const $BigInt: Schema.Struct<{
1020
- readonly _tag: Schema.tag<"BigInt">;
1021
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1022
- readonly checks: Schema.$Array<Schema.Codec<Check<{
1023
- readonly _tag: "isGreaterThanBigInt";
1024
- readonly exclusiveMinimum: bigint;
1025
- } | {
1026
- readonly _tag: "isGreaterThanOrEqualToBigInt";
1027
- readonly minimum: bigint;
1028
- } | {
1029
- readonly _tag: "isLessThanBigInt";
1030
- readonly exclusiveMaximum: bigint;
1031
- } | {
1032
- readonly _tag: "isLessThanOrEqualToBigInt";
1033
- readonly maximum: bigint;
1034
- } | {
1035
- readonly _tag: "isBetweenBigInt";
1036
- readonly minimum: bigint;
1037
- readonly maximum: bigint;
1038
- readonly exclusiveMinimum?: boolean | undefined;
1039
- readonly exclusiveMaximum?: boolean | undefined;
1040
- }>, Check<{
1041
- readonly _tag: "isGreaterThanBigInt";
1042
- readonly exclusiveMinimum: bigint;
1043
- } | {
1044
- readonly _tag: "isGreaterThanOrEqualToBigInt";
1045
- readonly minimum: bigint;
1046
- } | {
1047
- readonly _tag: "isLessThanBigInt";
1048
- readonly exclusiveMaximum: bigint;
1049
- } | {
1050
- readonly _tag: "isLessThanOrEqualToBigInt";
1051
- readonly maximum: bigint;
1052
- } | {
1053
- readonly _tag: "isBetweenBigInt";
1054
- readonly minimum: bigint;
1055
- readonly maximum: bigint;
1056
- readonly exclusiveMinimum?: boolean | undefined;
1057
- readonly exclusiveMaximum?: boolean | undefined;
1058
- }>, never, never>>;
1059
- }>;
1060
- /**
1061
- * Schema for the {@link Symbol} representation node.
1062
- *
1063
- * @category schemas
1064
- * @since 4.0.0
1065
- */
1066
- export declare const $Symbol: Schema.Struct<{
1067
- readonly _tag: Schema.tag<"Symbol">;
1068
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1069
- }>;
1070
- /**
1071
- * Schema for the literal value types allowed in a {@link Literal} node
1072
- * (string, finite number, boolean, or bigint).
1073
- *
1074
- * @category schemas
593
+ * @category constructors
1075
594
  * @since 4.0.0
1076
595
  */
1077
- export declare const $LiteralValue: Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.BigInt]>;
1078
- /**
1079
- * Schema for the {@link Literal} representation node.
1080
- *
1081
- * @category schemas
1082
- * @since 4.0.0
1083
- */
1084
- export declare const $Literal: Schema.Struct<{
1085
- readonly _tag: Schema.tag<"Literal">;
1086
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1087
- readonly literal: Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.BigInt]>;
1088
- }>;
596
+ export declare function toRepresentation(ast: SchemaAST.AST): Document;
1089
597
  /**
1090
- * Schema for the {@link UniqueSymbol} representation node.
598
+ * Lowers one or more AST encoded sides in a shared reference environment.
1091
599
  *
1092
- * @category schemas
1093
- * @since 4.0.0
1094
- */
1095
- export declare const $UniqueSymbol: Schema.Struct<{
1096
- readonly _tag: Schema.tag<"UniqueSymbol">;
1097
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1098
- readonly symbol: Schema.Symbol;
1099
- }>;
1100
- /**
1101
- * Schema for the {@link ObjectKeyword} representation node.
600
+ * **Details**
1102
601
  *
1103
- * @category schemas
1104
- * @since 4.0.0
1105
- */
1106
- export declare const $ObjectKeyword: Schema.Struct<{
1107
- readonly _tag: Schema.tag<"ObjectKeyword">;
1108
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1109
- }>;
1110
- /**
1111
- * Schema for the {@link Enum} representation node.
602
+ * Apply `SchemaAST.toType` to an AST first to lower its type side instead.
1112
603
  *
1113
- * @category schemas
604
+ * @category constructors
1114
605
  * @since 4.0.0
1115
606
  */
1116
- export declare const $Enum: Schema.Struct<{
1117
- readonly _tag: Schema.tag<"Enum">;
1118
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1119
- readonly enums: Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Union<readonly [Schema.String, Schema.Number]>]>>;
1120
- }>;
1121
- /**
1122
- * Schema for the {@link TemplateLiteral} representation node.
1123
- *
1124
- * @category schemas
1125
- * @since 4.0.0
1126
- */
1127
- export declare const $TemplateLiteral: Schema.Struct<{
1128
- readonly _tag: Schema.tag<"TemplateLiteral">;
1129
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1130
- readonly parts: Schema.$Array<Schema.suspend<$Representation>>;
1131
- }>;
607
+ export declare function toRepresentations(asts: readonly [SchemaAST.AST, ...Array<SchemaAST.AST>]): MultiDocument;
1132
608
  /**
1133
- * Schema for the {@link Element} type (positional tuple element).
609
+ * Wraps a single representation document as a multi-document with one root.
1134
610
  *
1135
- * @category schemas
1136
- * @since 4.0.0
1137
- */
1138
- export declare const $Element: Schema.Struct<{
1139
- readonly isOptional: Schema.Boolean;
1140
- readonly type: Schema.suspend<$Representation>;
1141
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1142
- }>;
1143
- /**
1144
- * Schema for the {@link Arrays} representation node.
611
+ * **When to use**
1145
612
  *
1146
- * @category schemas
1147
- * @since 4.0.0
1148
- */
1149
- export declare const $Arrays: Schema.Struct<{
1150
- readonly _tag: Schema.tag<"Arrays">;
1151
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1152
- readonly elements: Schema.$Array<Schema.Struct<{
1153
- readonly isOptional: Schema.Boolean;
1154
- readonly type: Schema.suspend<$Representation>;
1155
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1156
- }>>;
1157
- readonly rest: Schema.$Array<Schema.suspend<$Representation>>;
1158
- readonly checks: Schema.$Array<Schema.Codec<Check<{
1159
- readonly _tag: "isMinLength";
1160
- readonly minLength: number;
1161
- } | {
1162
- readonly _tag: "isMaxLength";
1163
- readonly maxLength: number;
1164
- } | {
1165
- readonly _tag: "isLengthBetween";
1166
- readonly minimum: number;
1167
- readonly maximum: number;
1168
- } | {
1169
- readonly _tag: "isUnique";
1170
- }>, Check<{
1171
- readonly _tag: "isMinLength";
1172
- readonly minLength: number;
1173
- } | {
1174
- readonly _tag: "isMaxLength";
1175
- readonly maxLength: number;
1176
- } | {
1177
- readonly _tag: "isLengthBetween";
1178
- readonly minimum: number;
1179
- readonly maximum: number;
1180
- } | {
1181
- readonly _tag: "isUnique";
1182
- }>, never, never>>;
1183
- }>;
1184
- /**
1185
- * Schema for the {@link PropertySignature} type.
1186
- *
1187
- * @category schemas
1188
- * @since 4.0.0
1189
- */
1190
- export declare const $PropertySignature: Schema.Struct<{
1191
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1192
- readonly name: Schema.Union<readonly [Schema.Finite, Schema.Symbol, Schema.String]>;
1193
- readonly type: Schema.suspend<$Representation>;
1194
- readonly isOptional: Schema.Boolean;
1195
- readonly isMutable: Schema.Boolean;
1196
- }>;
1197
- /**
1198
- * Schema for the {@link IndexSignature} type.
1199
- *
1200
- * @category schemas
1201
- * @since 4.0.0
1202
- */
1203
- export declare const $IndexSignature: Schema.Struct<{
1204
- readonly parameter: Schema.suspend<$Representation>;
1205
- readonly type: Schema.suspend<$Representation>;
1206
- }>;
1207
- /**
1208
- * Schema for {@link ObjectsMeta}.
1209
- *
1210
- * @category schemas
1211
- * @since 4.0.0
1212
- */
1213
- export declare const $ObjectsMeta: Schema.Union<readonly [Schema.Struct<{
1214
- readonly _tag: Schema.tag<"isMinProperties">;
1215
- readonly minProperties: Schema.Int;
1216
- }>, Schema.Struct<{
1217
- readonly _tag: Schema.tag<"isMaxProperties">;
1218
- readonly maxProperties: Schema.Int;
1219
- }>, Schema.Struct<{
1220
- readonly _tag: Schema.tag<"isPropertiesLengthBetween">;
1221
- readonly minimum: Schema.Int;
1222
- readonly maximum: Schema.Int;
1223
- }>, Schema.Struct<{
1224
- readonly _tag: Schema.tag<"isPropertyNames">;
1225
- readonly propertyNames: Schema.suspend<$Representation>;
1226
- }>]>;
1227
- /**
1228
- * Schema for the {@link Objects} representation node.
1229
- *
1230
- * @category schemas
1231
- * @since 4.0.0
1232
- */
1233
- export declare const $Objects: Schema.Struct<{
1234
- readonly _tag: Schema.tag<"Objects">;
1235
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1236
- readonly propertySignatures: Schema.$Array<Schema.Struct<{
1237
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1238
- readonly name: Schema.Union<readonly [Schema.Finite, Schema.Symbol, Schema.String]>;
1239
- readonly type: Schema.suspend<$Representation>;
1240
- readonly isOptional: Schema.Boolean;
1241
- readonly isMutable: Schema.Boolean;
1242
- }>>;
1243
- readonly indexSignatures: Schema.$Array<Schema.Struct<{
1244
- readonly parameter: Schema.suspend<$Representation>;
1245
- readonly type: Schema.suspend<$Representation>;
1246
- }>>;
1247
- readonly checks: Schema.$Array<Schema.Codec<Check<{
1248
- readonly _tag: "isMinProperties";
1249
- readonly minProperties: number;
1250
- } | {
1251
- readonly _tag: "isMaxProperties";
1252
- readonly maxProperties: number;
1253
- } | {
1254
- readonly _tag: "isPropertiesLengthBetween";
1255
- readonly minimum: number;
1256
- readonly maximum: number;
1257
- } | {
1258
- readonly _tag: "isPropertyNames";
1259
- readonly propertyNames: Representation;
1260
- }>, Check<{
1261
- readonly _tag: "isMinProperties";
1262
- readonly minProperties: number;
1263
- } | {
1264
- readonly _tag: "isMaxProperties";
1265
- readonly maxProperties: number;
1266
- } | {
1267
- readonly _tag: "isPropertiesLengthBetween";
1268
- readonly minimum: number;
1269
- readonly maximum: number;
1270
- } | {
1271
- readonly _tag: "isPropertyNames";
1272
- readonly propertyNames: Representation;
1273
- }>, never, never>>;
1274
- }>;
1275
- /**
1276
- * Schema for the {@link Union} representation node.
1277
- *
1278
- * @category schemas
1279
- * @since 4.0.0
1280
- */
1281
- export declare const $Union: Schema.Struct<{
1282
- readonly _tag: Schema.tag<"Union">;
1283
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1284
- readonly types: Schema.$Array<Schema.suspend<$Representation>>;
1285
- readonly mode: Schema.Literals<readonly ["anyOf", "oneOf"]>;
1286
- }>;
1287
- /**
1288
- * Schema for the {@link Reference} representation node.
1289
- *
1290
- * @category schemas
1291
- * @since 4.0.0
1292
- */
1293
- export declare const $Reference: Schema.Struct<{
1294
- readonly _tag: Schema.tag<"Reference">;
1295
- readonly $ref: Schema.String;
1296
- }>;
1297
- /**
1298
- * Schema for {@link DateMeta}.
1299
- *
1300
- * @category schemas
1301
- * @since 4.0.0
1302
- */
1303
- export declare const $DateMeta: Schema.Union<readonly [Schema.Struct<{
1304
- readonly _tag: Schema.tag<"isDateValid">;
1305
- }>, Schema.Struct<{
1306
- readonly _tag: Schema.tag<"isGreaterThanDate">;
1307
- readonly exclusiveMinimum: Schema.Date;
1308
- }>, Schema.Struct<{
1309
- readonly _tag: Schema.tag<"isGreaterThanOrEqualToDate">;
1310
- readonly minimum: Schema.Date;
1311
- }>, Schema.Struct<{
1312
- readonly _tag: Schema.tag<"isLessThanDate">;
1313
- readonly exclusiveMaximum: Schema.Date;
1314
- }>, Schema.Struct<{
1315
- readonly _tag: Schema.tag<"isLessThanOrEqualToDate">;
1316
- readonly maximum: Schema.Date;
1317
- }>, Schema.Struct<{
1318
- readonly _tag: Schema.tag<"isBetweenDate">;
1319
- readonly minimum: Schema.Date;
1320
- readonly maximum: Schema.Date;
1321
- readonly exclusiveMinimum: Schema.optional<Schema.Boolean>;
1322
- readonly exclusiveMaximum: Schema.optional<Schema.Boolean>;
1323
- }>]>;
1324
- /**
1325
- * Schema for {@link SizeMeta}.
1326
- *
1327
- * @category schemas
1328
- * @since 4.0.0
1329
- */
1330
- export declare const $SizeMeta: Schema.Union<readonly [Schema.Struct<{
1331
- readonly _tag: Schema.tag<"isMinSize">;
1332
- readonly minSize: Schema.Int;
1333
- }>, Schema.Struct<{
1334
- readonly _tag: Schema.tag<"isMaxSize">;
1335
- readonly maxSize: Schema.Int;
1336
- }>, Schema.Struct<{
1337
- readonly _tag: Schema.tag<"isSizeBetween">;
1338
- readonly minimum: Schema.Int;
1339
- readonly maximum: Schema.Int;
1340
- }>]>;
1341
- /**
1342
- * Schema for {@link DeclarationMeta}.
1343
- *
1344
- * @category schemas
1345
- * @since 4.0.0
1346
- */
1347
- export declare const $DeclarationMeta: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1348
- readonly _tag: Schema.tag<"isDateValid">;
1349
- }>, Schema.Struct<{
1350
- readonly _tag: Schema.tag<"isGreaterThanDate">;
1351
- readonly exclusiveMinimum: Schema.Date;
1352
- }>, Schema.Struct<{
1353
- readonly _tag: Schema.tag<"isGreaterThanOrEqualToDate">;
1354
- readonly minimum: Schema.Date;
1355
- }>, Schema.Struct<{
1356
- readonly _tag: Schema.tag<"isLessThanDate">;
1357
- readonly exclusiveMaximum: Schema.Date;
1358
- }>, Schema.Struct<{
1359
- readonly _tag: Schema.tag<"isLessThanOrEqualToDate">;
1360
- readonly maximum: Schema.Date;
1361
- }>, Schema.Struct<{
1362
- readonly _tag: Schema.tag<"isBetweenDate">;
1363
- readonly minimum: Schema.Date;
1364
- readonly maximum: Schema.Date;
1365
- readonly exclusiveMinimum: Schema.optional<Schema.Boolean>;
1366
- readonly exclusiveMaximum: Schema.optional<Schema.Boolean>;
1367
- }>]>, Schema.Union<readonly [Schema.Struct<{
1368
- readonly _tag: Schema.tag<"isMinSize">;
1369
- readonly minSize: Schema.Int;
1370
- }>, Schema.Struct<{
1371
- readonly _tag: Schema.tag<"isMaxSize">;
1372
- readonly maxSize: Schema.Int;
1373
- }>, Schema.Struct<{
1374
- readonly _tag: Schema.tag<"isSizeBetween">;
1375
- readonly minimum: Schema.Int;
1376
- readonly maximum: Schema.Int;
1377
- }>]>]>;
1378
- /**
1379
- * Schema for the {@link Declaration} representation node.
1380
- *
1381
- * @category schemas
1382
- * @since 4.0.0
1383
- */
1384
- export declare const $Declaration: Schema.Struct<{
1385
- readonly _tag: Schema.tag<"Declaration">;
1386
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1387
- readonly typeParameters: Schema.$Array<Schema.suspend<$Representation>>;
1388
- readonly checks: Schema.$Array<Schema.Codec<Check<{
1389
- readonly _tag: "isDateValid";
1390
- } | {
1391
- readonly _tag: "isGreaterThanDate";
1392
- readonly exclusiveMinimum: Date;
1393
- } | {
1394
- readonly _tag: "isGreaterThanOrEqualToDate";
1395
- readonly minimum: Date;
1396
- } | {
1397
- readonly _tag: "isLessThanDate";
1398
- readonly exclusiveMaximum: Date;
1399
- } | {
1400
- readonly _tag: "isLessThanOrEqualToDate";
1401
- readonly maximum: Date;
1402
- } | {
1403
- readonly _tag: "isBetweenDate";
1404
- readonly minimum: Date;
1405
- readonly maximum: Date;
1406
- readonly exclusiveMinimum?: boolean | undefined;
1407
- readonly exclusiveMaximum?: boolean | undefined;
1408
- } | {
1409
- readonly _tag: "isMinSize";
1410
- readonly minSize: number;
1411
- } | {
1412
- readonly _tag: "isMaxSize";
1413
- readonly maxSize: number;
1414
- } | {
1415
- readonly _tag: "isSizeBetween";
1416
- readonly minimum: number;
1417
- readonly maximum: number;
1418
- }>, Check<{
1419
- readonly _tag: "isDateValid";
1420
- } | {
1421
- readonly _tag: "isGreaterThanDate";
1422
- readonly exclusiveMinimum: Date;
1423
- } | {
1424
- readonly _tag: "isGreaterThanOrEqualToDate";
1425
- readonly minimum: Date;
1426
- } | {
1427
- readonly _tag: "isLessThanDate";
1428
- readonly exclusiveMaximum: Date;
1429
- } | {
1430
- readonly _tag: "isLessThanOrEqualToDate";
1431
- readonly maximum: Date;
1432
- } | {
1433
- readonly _tag: "isBetweenDate";
1434
- readonly minimum: Date;
1435
- readonly maximum: Date;
1436
- readonly exclusiveMinimum?: boolean | undefined;
1437
- readonly exclusiveMaximum?: boolean | undefined;
1438
- } | {
1439
- readonly _tag: "isMinSize";
1440
- readonly minSize: number;
1441
- } | {
1442
- readonly _tag: "isMaxSize";
1443
- readonly maxSize: number;
1444
- } | {
1445
- readonly _tag: "isSizeBetween";
1446
- readonly minimum: number;
1447
- readonly maximum: number;
1448
- }>, never, never>>;
1449
- readonly encodedSchema: Schema.suspend<$Representation>;
1450
- }>;
1451
- /**
1452
- * Schema for the {@link Suspend} representation node.
1453
- *
1454
- * @category schemas
1455
- * @since 4.0.0
1456
- */
1457
- export declare const $Suspend: Schema.Struct<{
1458
- readonly _tag: Schema.tag<"Suspend">;
1459
- readonly annotations: Schema.optional<Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.$Record<Schema.String, Schema.Codec<PrimitiveTree, PrimitiveTree, never, never>>, never, never>>;
1460
- readonly checks: Schema.Tuple<readonly []>;
1461
- readonly thunk: Schema.suspend<$Representation>;
1462
- }>;
1463
- /**
1464
- * Type-level helper for the recursive {@link $Representation} codec.
1465
- *
1466
- * @category schemas
1467
- * @since 4.0.0
1468
- */
1469
- export interface $Representation extends Schema.Codec<Representation> {
1470
- }
1471
- /**
1472
- * Schema for the full {@link Representation} union. It recursively validates
1473
- * and encodes any representation node.
613
+ * Use when an API such as `toCodeDocument` requires a `MultiDocument`.
1474
614
  *
1475
- * @category schemas
615
+ * @category transforming
1476
616
  * @since 4.0.0
1477
617
  */
1478
- export declare const $Representation: $Representation;
618
+ export declare function toMultiDocument(document: Document): MultiDocument;
1479
619
  /**
1480
- * Schema for {@link Document}.
620
+ * Compiles a live representation document to JSON Schema Draft 2020-12.
1481
621
  *
1482
622
  * **When to use**
1483
623
  *
1484
- * Use to validate or serialize a single schema representation document with
1485
- * `Schema.decodeUnknownSync` or `Schema.encodeSync`.
624
+ * Use when you need JSON Schema output from a representation whose checks carry compiler annotations.
1486
625
  *
1487
626
  * **Gotchas**
1488
627
  *
1489
- * This codec validates document structure but does not resolve `$ref` keys
1490
- * against `references`.
628
+ * Opaque declarations are represented by an unconstrained JSON Schema. Check callback results are used directly, and exceptions raised by a callback pass through unchanged.
1491
629
  *
1492
- * @see {@link DocumentFromJson} for the JSON-string codec wrapper
1493
- * @see {@link $MultiDocument} for validating documents with multiple root representations
630
+ * @see {@link toJsonSchemaMultiDocument} for multiple roots sharing definitions
1494
631
  *
1495
- * @category schemas
1496
- * @since 4.0.0
1497
- */
1498
- export declare const $Document: Schema.Struct<{
1499
- readonly representation: $Representation;
1500
- readonly references: Schema.$Record<Schema.String, $Representation>;
1501
- }>;
1502
- /**
1503
- * Schema for {@link MultiDocument}.
1504
- *
1505
- * @category schemas
632
+ * @category transforming
1506
633
  * @since 4.0.0
1507
634
  */
1508
- export declare const $MultiDocument: Schema.Struct<{
1509
- readonly representations: Schema.NonEmptyArray<$Representation>;
1510
- readonly references: Schema.$Record<Schema.String, $Representation>;
1511
- }>;
635
+ export declare function toJsonSchemaDocument(document: Document, options?: Schema.ToJsonSchemaOptions): JsonSchema.Document<"draft-2020-12">;
1512
636
  /**
1513
- * Converts a Schema AST into a {@link Document}.
637
+ * Compiles multiple live representations to a shared JSON Schema Draft 2020-12 document.
1514
638
  *
1515
639
  * **When to use**
1516
640
  *
1517
- * Use when you have a single Schema AST and need a schema representation
1518
- * document.
1519
- *
1520
- * **Details**
1521
- *
1522
- * Shared/recursive sub-schemas are extracted into the `references` map.
641
+ * Use when several representation roots must share the same JSON Schema definitions.
1523
642
  *
1524
- * **Example** (Converting a Schema to a Document)
1525
- *
1526
- * ```ts
1527
- * import { Schema, SchemaRepresentation } from "effect"
1528
- *
1529
- * const Person = Schema.Struct({
1530
- * name: Schema.String,
1531
- * age: Schema.Number
1532
- * })
643
+ * **Gotchas**
1533
644
  *
1534
- * const doc = SchemaRepresentation.fromAST(Person.ast)
1535
- * console.log(doc.representation._tag)
1536
- * // "Objects"
1537
- * ```
645
+ * Every definition is compiled, including definitions that are not reachable from a root.
1538
646
  *
1539
- * @see {@link Document}
1540
- * @see {@link fromASTs}
647
+ * @see {@link toJsonSchemaDocument} for a single root
1541
648
  *
1542
- * @category constructors
649
+ * @category transforming
1543
650
  * @since 4.0.0
1544
651
  */
1545
- export declare const fromAST: (ast: SchemaAST.AST) => Document;
652
+ export declare function toJsonSchemaMultiDocument(document: MultiDocument, options?: Schema.ToJsonSchemaOptions): JsonSchema.MultiDocument<"draft-2020-12">;
1546
653
  /**
1547
- * Converts one or more Schema ASTs into a {@link MultiDocument}.
654
+ * Generates TypeScript source for live schema representations and their definitions.
1548
655
  *
1549
656
  * **When to use**
1550
657
  *
1551
- * Use when you have multiple Schema ASTs and need one schema representation
1552
- * `MultiDocument` with shared references.
1553
- *
1554
- * **Details**
658
+ * Use when custom declarations and checks provide `toCode` callbacks and must be emitted without a central handler registry.
1555
659
  *
1556
- * All schemas share a single `references` map.
660
+ * **Gotchas**
1557
661
  *
1558
- * @see {@link MultiDocument}
1559
- * @see {@link fromAST}
662
+ * Opaque declarations and leaf checks require `toCode` callbacks. Callback results are used directly, and exceptions raised by a callback pass through unchanged.
1560
663
  *
1561
- * @category constructors
664
+ * @category transforming
1562
665
  * @since 4.0.0
1563
666
  */
1564
- export declare const fromASTs: (asts: readonly [SchemaAST.AST, ...Array<SchemaAST.AST>]) => MultiDocument;
667
+ export declare function toCodeDocument(document: MultiDocument): CodeDocument;
1565
668
  /**
1566
- * Schema that decodes a {@link Document} from JSON and encodes it back.
669
+ * Projects a live single-root representation document and encodes it as JSON.
1567
670
  *
1568
671
  * **When to use**
1569
672
  *
1570
- * Use when you need a JSON codec for schema representation documents with
1571
- * `Schema.decodeUnknownSync` or `Schema.encodeSync`.
673
+ * Use when you need a stable JSON value for storage or transport after calling `toRepresentation`.
1572
674
  *
1573
- * **Example** (Round-tripping a Document through JSON)
1574
- *
1575
- * ```ts
1576
- * import { Schema, SchemaRepresentation } from "effect"
675
+ * **Gotchas**
1577
676
  *
1578
- * const doc = SchemaRepresentation.fromAST(Schema.String.ast)
1579
- * const json = Schema.encodeSync(SchemaRepresentation.DocumentFromJson)(doc)
1580
- * const back = Schema.decodeUnknownSync(SchemaRepresentation.DocumentFromJson)(json)
1581
- * ```
677
+ * Generic annotations that are not JSON are omitted. Invalid persistence identities and unsupported structural values throw an `Error` containing their representation path.
1582
678
  *
1583
- * @see {@link $Document}
1584
- * @see {@link MultiDocumentFromJson}
679
+ * @see {@link toRepresentation} for constructing the live document
680
+ * @see {@link toJsonMultiDocument} for documents with multiple roots
1585
681
  *
1586
- * @category schemas
682
+ * @category encoding
1587
683
  * @since 4.0.0
1588
684
  */
1589
- export declare const DocumentFromJson: Schema.Codec<Document, Schema.Json>;
685
+ export declare function toJson(document: Document): Schema.Json;
1590
686
  /**
1591
- * Schema for `MultiDocument` values encoded as JSON.
1592
- *
1593
- * @see {@link $MultiDocument}
1594
- * @see {@link DocumentFromJson}
1595
- *
1596
- * @category schemas
1597
- * @since 4.0.0
1598
- */
1599
- export declare const MultiDocumentFromJson: Schema.Codec<MultiDocument, Schema.Json>;
1600
- /**
1601
- * Wraps a single {@link Document} as a {@link MultiDocument} with one
1602
- * representation.
687
+ * Projects a live multi-root representation document and encodes it as JSON.
1603
688
  *
1604
689
  * **When to use**
1605
690
  *
1606
- * Use when you need to pass a single schema representation `Document` where an
1607
- * API expects a `MultiDocument`.
1608
- *
1609
- * @see {@link Document}
1610
- * @see {@link MultiDocument}
1611
- *
1612
- * @category transforming
1613
- * @since 4.0.0
1614
- */
1615
- export declare function toMultiDocument(document: Document): MultiDocument;
1616
- /**
1617
- * A callback that handles {@link Declaration} nodes during reconstruction
1618
- * ({@link toSchema}) or code generation ({@link toCodeDocument}).
691
+ * Use when you need one JSON value for multiple live roots that share a reference environment.
1619
692
  *
1620
- * **Details**
693
+ * **Gotchas**
1621
694
  *
1622
- * Return a value to handle the declaration. Return `undefined` to fall back to
1623
- * default behavior, which uses `encodedSchema` for `toSchema` or the
1624
- * `generation` annotation for `toCodeDocument`. `recur` processes child
1625
- * representations recursively.
695
+ * The root order and shared reference keys are preserved, while non-JSON generic annotations are omitted.
1626
696
  *
1627
- * @see {@link toSchema}
1628
- * @see {@link toSchemaDefaultReviver}
1629
- * @see {@link toCodeDocument}
697
+ * @see {@link toRepresentations} for constructing the live multi-document
698
+ * @see {@link toJson} for a single-root document
1630
699
  *
1631
- * @category models
700
+ * @category encoding
1632
701
  * @since 4.0.0
1633
702
  */
1634
- export type Reviver<T> = (declaration: Declaration, recur: (representation: Representation) => T) => T | undefined;
703
+ export declare function toJsonMultiDocument(document: MultiDocument): Schema.Json;
1635
704
  /**
1636
- * Default {@link Reviver} for {@link toSchema} that handles built-in Effect
1637
- * types, including Option, Result, Redacted, Cause, Exit, ReadonlyMap, HashMap,
1638
- * ReadonlySet, Date, Duration, URL, and RegExp.
705
+ * Decodes a persisted single-root representation document from JSON.
1639
706
  *
1640
707
  * **When to use**
1641
708
  *
1642
- * Use when you need the default `options.reviver` for {@link toSchema} to
1643
- * reconstruct runtime schemas for built-in Effect declarations.
709
+ * Use when reading a representation document from storage or transport before inspecting it or passing it to `fromRepresentation`.
1644
710
  *
1645
- * **Details**
711
+ * **Gotchas**
1646
712
  *
1647
- * The reviver returns `undefined` for unrecognized declarations, causing
1648
- * fallback to `encodedSchema`.
713
+ * Invalid documents throw a schema decoding error. Decoding does not reconstruct runtime callbacks.
1649
714
  *
1650
- * @see {@link toSchema}
1651
- * @see {@link Reviver}
715
+ * @see {@link toJson} for encoding a document
716
+ * @see {@link fromRepresentation} for reconstructing a runtime schema
717
+ * @see {@link fromJsonMultiDocument} for multiple roots sharing references
1652
718
  *
1653
- * @category transforming
719
+ * @category decoding
1654
720
  * @since 4.0.0
1655
721
  */
1656
- export declare const toSchemaDefaultReviver: Reviver<Schema.Top>;
722
+ export declare function fromJson(input: Schema.Json): Document;
1657
723
  /**
1658
- * Creates a runtime Schema from a {@link Document}.
724
+ * Decodes a persisted multi-root representation document from JSON.
1659
725
  *
1660
726
  * **When to use**
1661
727
  *
1662
- * Use when you have a serialized or computed schema representation document and
1663
- * need a runtime Schema for decoding/encoding.
1664
- *
1665
- * **Details**
1666
- *
1667
- * Pass `options.reviver`, such as {@link toSchemaDefaultReviver}, to handle
1668
- * {@link Declaration} nodes for types like `Date` and `Option`. Without a
1669
- * reviver, declarations fall back to their `encodedSchema`. Circular references
1670
- * are handled via lazy `Schema.suspend`.
728
+ * Use when reading multiple representation roots that share references before inspecting them or passing them to `fromRepresentations`.
1671
729
  *
1672
730
  * **Gotchas**
1673
731
  *
1674
- * This throws if a `$ref` is not found in `document.references`.
1675
- *
1676
- * **Example** (Reconstructing a Schema)
732
+ * Invalid documents throw a schema decoding error. Decoding does not reconstruct runtime callbacks.
1677
733
  *
1678
- * ```ts
1679
- * import { Schema, SchemaRepresentation } from "effect"
1680
- *
1681
- * const doc = SchemaRepresentation.fromAST(
1682
- * Schema.Struct({ name: Schema.String }).ast
1683
- * )
734
+ * @see {@link toJsonMultiDocument} for encoding a multi-document
735
+ * @see {@link fromRepresentations} for reconstructing runtime schemas
736
+ * @see {@link fromJson} for a single root
1684
737
  *
1685
- * const schema = SchemaRepresentation.toSchema(doc)
1686
- * console.log(JSON.stringify(Schema.toJsonSchemaDocument(schema), null, 2))
1687
- * ```
1688
- *
1689
- * @see {@link Document}
1690
- * @see {@link Reviver}
1691
- * @see {@link toSchemaDefaultReviver}
1692
- *
1693
- * @category Runtime Generation
738
+ * @category decoding
1694
739
  * @since 4.0.0
1695
740
  */
1696
- export declare function toSchema<S extends Schema.Top = Schema.Top>(document: Document, options?: {
1697
- readonly reviver?: Reviver<Schema.Top> | undefined;
1698
- }): S;
741
+ export declare function fromJsonMultiDocument(input: Schema.Json): MultiDocument;
1699
742
  /**
1700
- * Converts a {@link Document} to a Draft 2020-12 JSON Schema document.
743
+ * Reconstructs a runtime schema from a representation document.
1701
744
  *
1702
745
  * **When to use**
1703
746
  *
1704
- * Use when you need to produce a standard JSON Schema document from a schema
1705
- * representation `Document`.
747
+ * Use when you have decoded or constructed a document whose declaration and check annotations may require revivers.
1706
748
  *
1707
749
  * **Gotchas**
1708
750
  *
1709
- * JSON Schema generation is best-effort. Some Effect schema representation
1710
- * semantics cannot be represented exactly in JSON Schema, and importing an
1711
- * emitted JSON Schema may produce an equivalent approximation rather than the
1712
- * original representation shape.
751
+ * Revivers are resolved locally by `id`; none are installed implicitly. Reviver results are used directly, and exceptions raised by a reviver pass through unchanged.
1713
752
  *
1714
- * **Example** (Generating JSON Schema)
753
+ * **Example** (Restoring a persisted schema)
1715
754
  *
1716
- * ```ts
755
+ * ```ts import.meta.vitest
1717
756
  * import { Schema, SchemaRepresentation } from "effect"
1718
757
  *
1719
- * const doc = SchemaRepresentation.fromAST(Schema.String.ast)
1720
- * const jsonSchema = SchemaRepresentation.toJsonSchemaDocument(doc)
1721
- * console.log(jsonSchema.schema.type)
1722
- * // "string"
758
+ * const document = SchemaRepresentation.toRepresentation(Schema.Struct({ name: Schema.String }).ast)
759
+ * const persisted = SchemaRepresentation.toJson(document)
760
+ * const restored = SchemaRepresentation.fromJson(persisted)
761
+ * const schema = SchemaRepresentation.fromRepresentation(restored, { revivers: [] })
762
+ * const Person = Schema.make<Schema.Codec<{ readonly name: string }>>(schema.ast)
763
+ *
764
+ * Schema.decodeUnknownSync(Person)({ name: "Ada" }) // => { name: "Ada" }
1723
765
  * ```
1724
766
  *
1725
- * @see {@link Document}
1726
- * @see {@link toJsonSchemaMultiDocument}
1727
- * @see {@link fromJsonSchemaDocument}
767
+ * @see {@link fromJson} for decoding a persisted document
768
+ * @see {@link fromRepresentations} for multiple roots sharing references
1728
769
  *
1729
770
  * @category transforming
1730
771
  * @since 4.0.0
1731
772
  */
1732
- export declare const toJsonSchemaDocument: (document: Document, options?: Schema.ToJsonSchemaOptions) => JsonSchema.Document<"draft-2020-12">;
773
+ export declare function fromRepresentation(document: Document, options: {
774
+ readonly revivers: ReadonlyArray<AnyReviver>;
775
+ }): Schema.Top;
1733
776
  /**
1734
- * Converts a {@link MultiDocument} to a Draft 2020-12 JSON Schema
1735
- * multi-document.
777
+ * Reconstructs multiple runtime schemas from a representation multi-document.
1736
778
  *
1737
779
  * **When to use**
1738
780
  *
1739
- * Use when you need to export related schema representation documents together
1740
- * so shared definitions stay in multi-document JSON Schema form.
781
+ * Use when multiple roots must be rebuilt in one shared reference environment.
1741
782
  *
1742
783
  * **Gotchas**
1743
784
  *
1744
- * JSON Schema generation is best-effort. Some Effect schema representation
1745
- * semantics cannot be represented exactly in JSON Schema, and importing an
1746
- * emitted JSON Schema may produce equivalent approximations rather than the
1747
- * original representation shapes.
785
+ * Only references reachable from a root are revived. Revivers are resolved locally by `id`; none are installed implicitly.
1748
786
  *
1749
- * @see {@link MultiDocument}
1750
- * @see {@link toJsonSchemaDocument}
1751
- * @see {@link fromJsonSchemaMultiDocument}
787
+ * @see {@link fromJsonMultiDocument} for decoding a persisted multi-document
788
+ * @see {@link fromRepresentation} for a single root
1752
789
  *
1753
790
  * @category transforming
1754
791
  * @since 4.0.0
1755
792
  */
1756
- export declare const toJsonSchemaMultiDocument: (document: MultiDocument, options?: Schema.ToJsonSchemaOptions) => JsonSchema.MultiDocument<"draft-2020-12">;
1757
- /**
1758
- * A pair of TypeScript source strings for a schema: `runtime` is the
1759
- * executable Schema expression, `Type` is the corresponding TypeScript type.
1760
- *
1761
- * @see {@link makeCode}
1762
- * @see {@link CodeDocument}
1763
- *
1764
- * @category Code Generation
1765
- * @since 4.0.0
1766
- */
1767
- export type Code = {
1768
- readonly runtime: string;
1769
- readonly Type: string;
1770
- };
1771
- /**
1772
- * Constructs a {@link Code} value from a runtime expression string and a
1773
- * TypeScript type string.
1774
- *
1775
- * @see {@link Code}
1776
- *
1777
- * @category Code Generation
1778
- * @since 4.0.0
1779
- */
1780
- export declare function makeCode(runtime: string, Type: string): Code;
1781
- /**
1782
- * An auxiliary code artifact produced during code generation — a symbol
1783
- * declaration, an enum declaration, or an import statement.
1784
- *
1785
- * @see {@link CodeDocument}
1786
- * @see {@link toCodeDocument}
1787
- *
1788
- * @category Code Generation
1789
- * @since 4.0.0
1790
- */
1791
- export type Artifact = {
1792
- readonly _tag: "Symbol";
1793
- readonly identifier: string;
1794
- readonly generation: Code;
1795
- } | {
1796
- readonly _tag: "Enum";
1797
- readonly identifier: string;
1798
- readonly generation: Code;
1799
- } | {
1800
- readonly _tag: "Import";
1801
- readonly importDeclaration: string;
1802
- };
1803
- /**
1804
- * The output of {@link toCodeDocument}: generated TypeScript code for one or
1805
- * more schemas plus their shared references and auxiliary artifacts.
1806
- *
1807
- * **Details**
1808
- *
1809
- * `codes` contains one {@link Code} per input representation.
1810
- * `references.nonRecursives` contains topologically sorted non-recursive
1811
- * definitions. `references.recursives` contains definitions involved in cycles.
1812
- * `artifacts` contains symbols, enums, and import statements needed by the
1813
- * code.
1814
- *
1815
- * @see {@link toCodeDocument}
1816
- * @see {@link Code}
1817
- * @see {@link Artifact}
1818
- *
1819
- * @category Code Generation
1820
- * @since 4.0.0
1821
- */
1822
- export type CodeDocument = {
1823
- readonly codes: ReadonlyArray<Code>;
1824
- readonly references: {
1825
- readonly nonRecursives: ReadonlyArray<{
1826
- readonly $ref: string;
1827
- readonly code: Code;
1828
- }>;
1829
- readonly recursives: {
1830
- readonly [$ref: string]: Code;
1831
- };
1832
- };
1833
- readonly artifacts: ReadonlyArray<Artifact>;
1834
- };
1835
- /**
1836
- * Generates TypeScript code strings from a {@link MultiDocument}.
1837
- *
1838
- * **When to use**
1839
- *
1840
- * Use when you need to produce source code for Effect Schema definitions from a
1841
- * schema representation `MultiDocument`.
1842
- *
1843
- * **Details**
1844
- *
1845
- * `options.reviver` can customize code generation for {@link Declaration}
1846
- * nodes. Return `undefined` to fall back to the default logic, which uses
1847
- * `generation` annotations or the encoded schema. References are
1848
- * topologically sorted so non-recursive definitions are emitted before their
1849
- * dependents. `$ref` keys are converted to sanitized JavaScript identifiers.
1850
- *
1851
- * **Example** (Generating TypeScript code)
1852
- *
1853
- * ```ts
1854
- * import { Schema, SchemaRepresentation } from "effect"
1855
- *
1856
- * const Person = Schema.Struct({
1857
- * name: Schema.String,
1858
- * age: Schema.Int
1859
- * })
1860
- *
1861
- * const multi = SchemaRepresentation.toMultiDocument(
1862
- * SchemaRepresentation.fromAST(Person.ast)
1863
- * )
1864
- * const codeDoc = SchemaRepresentation.toCodeDocument(multi)
1865
- * console.log(codeDoc.codes[0].runtime)
1866
- * // Schema.Struct({ ... })
1867
- * ```
1868
- *
1869
- * @see {@link CodeDocument}
1870
- * @see {@link MultiDocument}
1871
- * @see {@link Reviver}
1872
- *
1873
- * @category Code Generation
1874
- * @since 4.0.0
1875
- */
1876
- export declare function toCodeDocument(multiDocument: MultiDocument, options?: {
1877
- /**
1878
- * The reviver can return `undefined` to indicate that the generation should be generated by the default logic
1879
- */
1880
- readonly reviver?: Reviver<Code> | undefined;
1881
- }): CodeDocument;
793
+ export declare function fromRepresentations(document: MultiDocument, options: {
794
+ readonly revivers: ReadonlyArray<AnyReviver>;
795
+ }): readonly [Schema.Top, ...Array<Schema.Top>];
1882
796
  /**
1883
- * Parses a Draft 2020-12 JSON Schema document into a {@link Document}.
797
+ * Imports a JSON Schema Draft 2020-12 document as a runtime schema.
1884
798
  *
1885
799
  * **When to use**
1886
800
  *
1887
- * Use when you need to import a Draft 2020-12 JSON Schema document into the
1888
- * Effect schema representation system.
1889
- *
1890
- * **Details**
1891
- *
1892
- * `options.onEnter` is an optional hook called on each JSON Schema node before
1893
- * processing, allowing pre-transformation.
801
+ * Use when you need to validate or transform values described by an external JSON Schema document.
1894
802
  *
1895
803
  * **Gotchas**
1896
804
  *
1897
- * JSON Schema import is best-effort. Some JSON Schema constructs do not map
1898
- * exactly to Effect schema representations, and importing a schema previously
1899
- * emitted by `toJsonSchemaDocument` may produce an equivalent approximation
1900
- * rather than the original representation shape.
805
+ * Import is best-effort. Built-in declarations and checks are reconstructed with importer-owned revivers. Callback results are used directly, and exceptions raised by a callback pass through unchanged.
1901
806
  *
1902
- * This throws if a `$ref` cannot be resolved within the document's definitions.
1903
- * Circular `$ref`s are detected and cause an error.
1904
- *
1905
- * @see {@link Document}
1906
- * @see {@link toJsonSchemaDocument}
1907
- * @see {@link fromJsonSchemaMultiDocument}
807
+ * @see {@link fromJsonSchemaMultiDocument} for multiple roots sharing definitions
808
+ * @see {@link toRepresentation} for converting the result to a representation document
1908
809
  *
1909
810
  * @category constructors
1910
811
  * @since 4.0.0
1911
812
  */
1912
- export declare function fromJsonSchemaDocument(document: JsonSchema.Document<"draft-2020-12">, options?: {
1913
- readonly onEnter?: ((js: JsonSchema.JsonSchema) => JsonSchema.JsonSchema) | undefined;
1914
- }): Document;
813
+ export declare function fromJsonSchemaDocument(document: JsonSchema.Document<"draft-2020-12">, options?: FromJsonSchemaOptions): Schema.Top;
1915
814
  /**
1916
- * Parses a Draft 2020-12 JSON Schema multi-document into a
1917
- * {@link MultiDocument}.
815
+ * Imports multiple JSON Schema Draft 2020-12 roots as runtime schemas with shared definitions.
1918
816
  *
1919
817
  * **When to use**
1920
818
  *
1921
- * Use when you need to import a Draft 2020-12 JSON Schema multi-document whose
1922
- * schemas share definitions.
1923
- *
1924
- * **Details**
1925
- *
1926
- * `options.onEnter` is an optional hook called on each JSON Schema node before
1927
- * processing.
819
+ * Use when multiple imported roots share reachable definitions, aliases, or recursion.
1928
820
  *
1929
821
  * **Gotchas**
1930
822
  *
1931
- * JSON Schema import is best-effort. Some JSON Schema constructs do not map
1932
- * exactly to Effect schema representations, and importing schemas previously
1933
- * emitted by `toJsonSchemaMultiDocument` may produce equivalent approximations
1934
- * rather than the original representation shapes.
1935
- *
1936
- * This throws if a `$ref` cannot be resolved.
823
+ * Only definitions reachable from a root are translated. Callback results are used directly, and exceptions raised by a callback pass through unchanged.
1937
824
  *
1938
- * @see {@link MultiDocument}
1939
- * @see {@link toJsonSchemaMultiDocument}
1940
- * @see {@link fromJsonSchemaDocument}
825
+ * @see {@link fromJsonSchemaDocument} for a single root
826
+ * @see {@link toRepresentations} for converting the returned schema ASTs to a representation document
1941
827
  *
1942
828
  * @category constructors
1943
829
  * @since 4.0.0
1944
830
  */
1945
- export declare function fromJsonSchemaMultiDocument(document: JsonSchema.MultiDocument<"draft-2020-12">, options?: {
1946
- readonly onEnter?: ((js: JsonSchema.JsonSchema) => JsonSchema.JsonSchema) | undefined;
1947
- }): MultiDocument;
831
+ export declare function fromJsonSchemaMultiDocument(document: JsonSchema.MultiDocument<"draft-2020-12">, options?: FromJsonSchemaOptions): readonly [Schema.Top, ...Array<Schema.Top>];
832
+ export {};
1948
833
  //# sourceMappingURL=SchemaRepresentation.d.ts.map