effect 4.1.4 → 4.1.6

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 (890) hide show
  1. package/THIRD_PARTY_NOTICES.md +88 -0
  2. package/ai-docs/package.json +2 -2
  3. package/dist/Arbitrary.d.ts +44 -2
  4. package/dist/Arbitrary.d.ts.map +1 -1
  5. package/dist/Arbitrary.js +9 -1
  6. package/dist/Arbitrary.js.map +1 -1
  7. package/dist/BigInt.d.ts +200 -1
  8. package/dist/BigInt.d.ts.map +1 -1
  9. package/dist/BigInt.js +105 -9
  10. package/dist/BigInt.js.map +1 -1
  11. package/dist/Cache.d.ts.map +1 -1
  12. package/dist/Cache.js +4 -2
  13. package/dist/Cache.js.map +1 -1
  14. package/dist/Cause.d.ts +3 -3
  15. package/dist/Cause.js +1 -1
  16. package/dist/Channel.d.ts +104 -7
  17. package/dist/Channel.d.ts.map +1 -1
  18. package/dist/Channel.js +73 -4
  19. package/dist/Channel.js.map +1 -1
  20. package/dist/Chunk.d.ts +5 -0
  21. package/dist/Chunk.d.ts.map +1 -1
  22. package/dist/Chunk.js +7 -2
  23. package/dist/Chunk.js.map +1 -1
  24. package/dist/Clock.d.ts +5 -2
  25. package/dist/Clock.d.ts.map +1 -1
  26. package/dist/Clock.js +2 -1
  27. package/dist/Clock.js.map +1 -1
  28. package/dist/Codegen.d.ts +300 -0
  29. package/dist/Codegen.d.ts.map +1 -0
  30. package/dist/Codegen.js +526 -0
  31. package/dist/Codegen.js.map +1 -0
  32. package/dist/Config.d.ts +31 -2
  33. package/dist/Config.d.ts.map +1 -1
  34. package/dist/Config.js +12 -1
  35. package/dist/Config.js.map +1 -1
  36. package/dist/ConfigProvider.d.ts +11 -1
  37. package/dist/ConfigProvider.d.ts.map +1 -1
  38. package/dist/ConfigProvider.js +17 -6
  39. package/dist/ConfigProvider.js.map +1 -1
  40. package/dist/Effect.d.ts +1008 -127
  41. package/dist/Effect.d.ts.map +1 -1
  42. package/dist/Effect.js +410 -49
  43. package/dist/Effect.js.map +1 -1
  44. package/dist/Equal.d.ts +4 -4
  45. package/dist/Equal.d.ts.map +1 -1
  46. package/dist/Equal.js +78 -65
  47. package/dist/Equal.js.map +1 -1
  48. package/dist/Equivalence.d.ts +11 -9
  49. package/dist/Equivalence.d.ts.map +1 -1
  50. package/dist/Equivalence.js +15 -12
  51. package/dist/Equivalence.js.map +1 -1
  52. package/dist/Fiber.d.ts +58 -8
  53. package/dist/Fiber.d.ts.map +1 -1
  54. package/dist/Fiber.js +28 -4
  55. package/dist/Fiber.js.map +1 -1
  56. package/dist/FiberHandle.d.ts +81 -10
  57. package/dist/FiberHandle.d.ts.map +1 -1
  58. package/dist/FiberHandle.js +40 -8
  59. package/dist/FiberHandle.js.map +1 -1
  60. package/dist/FiberMap.d.ts +80 -10
  61. package/dist/FiberMap.d.ts.map +1 -1
  62. package/dist/FiberMap.js +37 -6
  63. package/dist/FiberMap.js.map +1 -1
  64. package/dist/FiberSet.d.ts +93 -8
  65. package/dist/FiberSet.d.ts.map +1 -1
  66. package/dist/FiberSet.js +46 -4
  67. package/dist/FiberSet.js.map +1 -1
  68. package/dist/Formatter.d.ts +2 -0
  69. package/dist/Formatter.d.ts.map +1 -1
  70. package/dist/Formatter.js +2 -0
  71. package/dist/Formatter.js.map +1 -1
  72. package/dist/Hash.d.ts.map +1 -1
  73. package/dist/Hash.js +24 -17
  74. package/dist/Hash.js.map +1 -1
  75. package/dist/LayerMap.d.ts +12 -3
  76. package/dist/LayerMap.d.ts.map +1 -1
  77. package/dist/LayerMap.js +12 -2
  78. package/dist/LayerMap.js.map +1 -1
  79. package/dist/LayerRef.d.ts +3 -3
  80. package/dist/LayerRef.d.ts.map +1 -1
  81. package/dist/LayerRef.js +3 -3
  82. package/dist/LayerRef.js.map +1 -1
  83. package/dist/Logger.d.ts +37 -13
  84. package/dist/Logger.d.ts.map +1 -1
  85. package/dist/Logger.js +39 -10
  86. package/dist/Logger.js.map +1 -1
  87. package/dist/Match.d.ts +35 -23
  88. package/dist/Match.d.ts.map +1 -1
  89. package/dist/Match.js +16 -0
  90. package/dist/Match.js.map +1 -1
  91. package/dist/Metric.js +1 -1
  92. package/dist/Metric.js.map +1 -1
  93. package/dist/Option.d.ts +4 -1
  94. package/dist/Option.d.ts.map +1 -1
  95. package/dist/Option.js +6 -2
  96. package/dist/Option.js.map +1 -1
  97. package/dist/Order.d.ts +7 -5
  98. package/dist/Order.d.ts.map +1 -1
  99. package/dist/Order.js +8 -3
  100. package/dist/Order.js.map +1 -1
  101. package/dist/Pool.d.ts +4 -3
  102. package/dist/Pool.d.ts.map +1 -1
  103. package/dist/Pool.js +21 -18
  104. package/dist/Pool.js.map +1 -1
  105. package/dist/Predicate.d.ts +4 -1
  106. package/dist/Predicate.d.ts.map +1 -1
  107. package/dist/Predicate.js +5 -1
  108. package/dist/Predicate.js.map +1 -1
  109. package/dist/Queue.d.ts +69 -22
  110. package/dist/Queue.d.ts.map +1 -1
  111. package/dist/Queue.js +40 -18
  112. package/dist/Queue.js.map +1 -1
  113. package/dist/Rational.d.ts +179 -0
  114. package/dist/Rational.d.ts.map +1 -1
  115. package/dist/Rational.js +63 -0
  116. package/dist/Rational.js.map +1 -1
  117. package/dist/Request.d.ts +20 -0
  118. package/dist/Request.d.ts.map +1 -1
  119. package/dist/Request.js +20 -0
  120. package/dist/Request.js.map +1 -1
  121. package/dist/Result.d.ts +3 -1
  122. package/dist/Result.d.ts.map +1 -1
  123. package/dist/Result.js +5 -2
  124. package/dist/Result.js.map +1 -1
  125. package/dist/Schema.d.ts +90 -19
  126. package/dist/Schema.d.ts.map +1 -1
  127. package/dist/Schema.js +92 -414
  128. package/dist/Schema.js.map +1 -1
  129. package/dist/SchemaAST.d.ts.map +1 -1
  130. package/dist/SchemaAST.js +11 -7
  131. package/dist/SchemaAST.js.map +1 -1
  132. package/dist/SchemaGetter.d.ts +5 -6
  133. package/dist/SchemaGetter.d.ts.map +1 -1
  134. package/dist/SchemaGetter.js +14 -10
  135. package/dist/SchemaGetter.js.map +1 -1
  136. package/dist/SchemaRepresentation.d.ts +19 -64
  137. package/dist/SchemaRepresentation.d.ts.map +1 -1
  138. package/dist/SchemaRepresentation.js +1 -28
  139. package/dist/SchemaRepresentation.js.map +1 -1
  140. package/dist/SchemaTransformation.d.ts +11 -10
  141. package/dist/SchemaTransformation.d.ts.map +1 -1
  142. package/dist/SchemaTransformation.js +12 -11
  143. package/dist/SchemaTransformation.js.map +1 -1
  144. package/dist/Scope.d.ts +12 -6
  145. package/dist/Scope.d.ts.map +1 -1
  146. package/dist/Scope.js +12 -6
  147. package/dist/Scope.js.map +1 -1
  148. package/dist/ScopedCache.d.ts.map +1 -1
  149. package/dist/ScopedCache.js +8 -5
  150. package/dist/ScopedCache.js.map +1 -1
  151. package/dist/Semaphore.d.ts.map +1 -1
  152. package/dist/Semaphore.js +18 -4
  153. package/dist/Semaphore.js.map +1 -1
  154. package/dist/Stream.d.ts +128 -5
  155. package/dist/Stream.d.ts.map +1 -1
  156. package/dist/Stream.js +179 -43
  157. package/dist/Stream.js.map +1 -1
  158. package/dist/String.d.ts +57 -3
  159. package/dist/String.d.ts.map +1 -1
  160. package/dist/String.js +63 -5
  161. package/dist/String.js.map +1 -1
  162. package/dist/Struct.d.ts +135 -1
  163. package/dist/Struct.d.ts.map +1 -1
  164. package/dist/Struct.js +64 -5
  165. package/dist/Struct.js.map +1 -1
  166. package/dist/TextDiff.d.ts +105 -0
  167. package/dist/TextDiff.d.ts.map +1 -1
  168. package/dist/TextDiff.js +137 -24
  169. package/dist/TextDiff.js.map +1 -1
  170. package/dist/Tracer.d.ts +10 -0
  171. package/dist/Tracer.d.ts.map +1 -1
  172. package/dist/Tracer.js +2 -0
  173. package/dist/Tracer.js.map +1 -1
  174. package/dist/TxPriorityQueue.js +2 -2
  175. package/dist/TxPriorityQueue.js.map +1 -1
  176. package/dist/ai/LanguageModel.d.ts.map +1 -1
  177. package/dist/ai/LanguageModel.js +1 -1
  178. package/dist/ai/LanguageModel.js.map +1 -1
  179. package/dist/ai/McpServer.d.ts +199 -4
  180. package/dist/ai/McpServer.d.ts.map +1 -1
  181. package/dist/ai/McpServer.js +143 -18
  182. package/dist/ai/McpServer.js.map +1 -1
  183. package/dist/ai/Prompt.d.ts +3 -1
  184. package/dist/ai/Prompt.d.ts.map +1 -1
  185. package/dist/ai/Prompt.js +17 -3
  186. package/dist/ai/Prompt.js.map +1 -1
  187. package/dist/ai/Skill.d.ts +172 -0
  188. package/dist/ai/Skill.d.ts.map +1 -0
  189. package/dist/ai/Skill.js +209 -0
  190. package/dist/ai/Skill.js.map +1 -0
  191. package/dist/ai/Tool.d.ts +3 -2
  192. package/dist/ai/Tool.d.ts.map +1 -1
  193. package/dist/ai/Tool.js +3 -2
  194. package/dist/ai/Tool.js.map +1 -1
  195. package/dist/ai/Toolkit.d.ts.map +1 -1
  196. package/dist/ai/Toolkit.js +5 -1
  197. package/dist/ai/Toolkit.js.map +1 -1
  198. package/dist/ai/index.d.ts +5 -0
  199. package/dist/ai/index.d.ts.map +1 -1
  200. package/dist/ai/index.js +5 -0
  201. package/dist/ai/index.js.map +1 -1
  202. package/dist/chat/Chat.d.ts +90 -0
  203. package/dist/chat/Chat.d.ts.map +1 -0
  204. package/dist/chat/Chat.js +127 -0
  205. package/dist/chat/Chat.js.map +1 -0
  206. package/dist/chat/ChatAdapter.d.ts +386 -0
  207. package/dist/chat/ChatAdapter.d.ts.map +1 -0
  208. package/dist/chat/ChatAdapter.js +110 -0
  209. package/dist/chat/ChatAdapter.js.map +1 -0
  210. package/dist/chat/ChatError.d.ts +500 -0
  211. package/dist/chat/ChatError.d.ts.map +1 -0
  212. package/dist/chat/ChatError.js +521 -0
  213. package/dist/chat/ChatError.js.map +1 -0
  214. package/dist/chat/ChatEvent.d.ts +321 -0
  215. package/dist/chat/ChatEvent.d.ts.map +1 -0
  216. package/dist/chat/ChatEvent.js +163 -0
  217. package/dist/chat/ChatEvent.js.map +1 -0
  218. package/dist/chat/ChatHandler.d.ts +81 -0
  219. package/dist/chat/ChatHandler.d.ts.map +1 -0
  220. package/dist/chat/ChatHandler.js +85 -0
  221. package/dist/chat/ChatHandler.js.map +1 -0
  222. package/dist/chat/ChatInteraction.d.ts +1519 -0
  223. package/dist/chat/ChatInteraction.d.ts.map +1 -0
  224. package/dist/chat/ChatInteraction.js +1052 -0
  225. package/dist/chat/ChatInteraction.js.map +1 -0
  226. package/dist/chat/ChatMarkdown.d.ts +280 -0
  227. package/dist/chat/ChatMarkdown.d.ts.map +1 -0
  228. package/dist/chat/ChatMarkdown.js +1172 -0
  229. package/dist/chat/ChatMarkdown.js.map +1 -0
  230. package/dist/chat/ChatMessage.d.ts +224 -0
  231. package/dist/chat/ChatMessage.d.ts.map +1 -0
  232. package/dist/chat/ChatMessage.js +172 -0
  233. package/dist/chat/ChatMessage.js.map +1 -0
  234. package/dist/chat/ChatTest.d.ts +407 -0
  235. package/dist/chat/ChatTest.d.ts.map +1 -0
  236. package/dist/chat/ChatTest.js +2145 -0
  237. package/dist/chat/ChatTest.js.map +1 -0
  238. package/dist/chat/ChatThread.d.ts +92 -0
  239. package/dist/chat/ChatThread.d.ts.map +1 -0
  240. package/dist/chat/ChatThread.js +116 -0
  241. package/dist/chat/ChatThread.js.map +1 -0
  242. package/dist/chat/ChatUi.d.ts +362 -0
  243. package/dist/chat/ChatUi.d.ts.map +1 -0
  244. package/dist/chat/ChatUi.js +209 -0
  245. package/dist/chat/ChatUi.js.map +1 -0
  246. package/dist/chat/index.d.ts +60 -0
  247. package/dist/chat/index.d.ts.map +1 -0
  248. package/dist/chat/index.js +61 -0
  249. package/dist/chat/index.js.map +1 -0
  250. package/dist/chat/internal/retries.d.ts +2 -0
  251. package/dist/chat/internal/retries.d.ts.map +1 -0
  252. package/dist/chat/internal/retries.js +7 -0
  253. package/dist/chat/internal/retries.js.map +1 -0
  254. package/dist/cli/CliOutput.d.ts.map +1 -1
  255. package/dist/cli/CliOutput.js +6 -7
  256. package/dist/cli/CliOutput.js.map +1 -1
  257. package/dist/cli/Command.d.ts +20 -2
  258. package/dist/cli/Command.d.ts.map +1 -1
  259. package/dist/cli/Command.js +4 -0
  260. package/dist/cli/Command.js.map +1 -1
  261. package/dist/cli/Prompt.d.ts +5 -6
  262. package/dist/cli/Prompt.d.ts.map +1 -1
  263. package/dist/cli/Prompt.js +9 -4
  264. package/dist/cli/Prompt.js.map +1 -1
  265. package/dist/cli/internal/command.d.ts +1 -1
  266. package/dist/cli/internal/command.d.ts.map +1 -1
  267. package/dist/cli/internal/config.d.ts +1 -1
  268. package/dist/cli/internal/config.d.ts.map +1 -1
  269. package/dist/cli/internal/config.js +3 -3
  270. package/dist/cli/internal/config.js.map +1 -1
  271. package/dist/cluster/ClusterCron.d.ts +21 -1
  272. package/dist/cluster/ClusterCron.d.ts.map +1 -1
  273. package/dist/cluster/ClusterCron.js +24 -6
  274. package/dist/cluster/ClusterCron.js.map +1 -1
  275. package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  276. package/dist/cluster/ClusterWorkflowEngine.js +183 -103
  277. package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
  278. package/dist/cluster/MessageStorage.d.ts +56 -0
  279. package/dist/cluster/MessageStorage.d.ts.map +1 -1
  280. package/dist/cluster/MessageStorage.js +18 -2
  281. package/dist/cluster/MessageStorage.js.map +1 -1
  282. package/dist/cluster/Sharding.d.ts.map +1 -1
  283. package/dist/cluster/Sharding.js +15 -3
  284. package/dist/cluster/Sharding.js.map +1 -1
  285. package/dist/cluster/ShardingConfig.d.ts +6 -0
  286. package/dist/cluster/ShardingConfig.d.ts.map +1 -1
  287. package/dist/cluster/ShardingConfig.js.map +1 -1
  288. package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
  289. package/dist/cluster/SqlMessageStorage.js +58 -37
  290. package/dist/cluster/SqlMessageStorage.js.map +1 -1
  291. package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
  292. package/dist/cluster/SqlRunnerStorage.js +18 -8
  293. package/dist/cluster/SqlRunnerStorage.js.map +1 -1
  294. package/dist/cluster/internal/entityActivation.js +2 -0
  295. package/dist/cluster/internal/entityActivation.js.map +1 -1
  296. package/dist/cluster/internal/entityManager.js +20 -13
  297. package/dist/cluster/internal/entityManager.js.map +1 -1
  298. package/dist/cluster/internal/entityReaper.js +1 -1
  299. package/dist/cluster/internal/entityReaper.js.map +1 -1
  300. package/dist/crypto/Kdf.d.ts +2 -1
  301. package/dist/crypto/Kdf.d.ts.map +1 -1
  302. package/dist/crypto/Kdf.js +2 -1
  303. package/dist/crypto/Kdf.js.map +1 -1
  304. package/dist/crypto/Password.d.ts +162 -0
  305. package/dist/crypto/Password.d.ts.map +1 -0
  306. package/dist/crypto/Password.js +217 -0
  307. package/dist/crypto/Password.js.map +1 -0
  308. package/dist/crypto/index.d.ts +5 -0
  309. package/dist/crypto/index.d.ts.map +1 -1
  310. package/dist/crypto/index.js +5 -0
  311. package/dist/crypto/index.js.map +1 -1
  312. package/dist/encoding/Base64.d.ts +63 -0
  313. package/dist/encoding/Base64.d.ts.map +1 -1
  314. package/dist/encoding/Base64.js +82 -1
  315. package/dist/encoding/Base64.js.map +1 -1
  316. package/dist/encoding/Base64Url.d.ts +1 -0
  317. package/dist/encoding/Base64Url.d.ts.map +1 -1
  318. package/dist/encoding/Base64Url.js +7 -1
  319. package/dist/encoding/Base64Url.js.map +1 -1
  320. package/dist/encoding/Csv.d.ts.map +1 -1
  321. package/dist/encoding/Csv.js +44 -16
  322. package/dist/encoding/Csv.js.map +1 -1
  323. package/dist/encoding/Hex.d.ts +5 -0
  324. package/dist/encoding/Hex.d.ts.map +1 -1
  325. package/dist/encoding/Hex.js +5 -0
  326. package/dist/encoding/Hex.js.map +1 -1
  327. package/dist/encoding/SchemaBinary.d.ts.map +1 -1
  328. package/dist/encoding/SchemaBinary.js +13 -124
  329. package/dist/encoding/SchemaBinary.js.map +1 -1
  330. package/dist/encoding/Sse.d.ts +1 -0
  331. package/dist/encoding/Sse.d.ts.map +1 -1
  332. package/dist/encoding/Sse.js +7 -5
  333. package/dist/encoding/Sse.js.map +1 -1
  334. package/dist/encoding/Xml.d.ts +153 -18
  335. package/dist/encoding/Xml.d.ts.map +1 -1
  336. package/dist/encoding/Xml.js +379 -57
  337. package/dist/encoding/Xml.js.map +1 -1
  338. package/dist/eventlog/EventJournal.d.ts.map +1 -1
  339. package/dist/eventlog/EventJournal.js +3 -8
  340. package/dist/eventlog/EventJournal.js.map +1 -1
  341. package/dist/eventlog/SqlEventLogServerEncrypted.js +6 -8
  342. package/dist/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  343. package/dist/http/FetchHttpClient.d.ts +2 -1
  344. package/dist/http/FetchHttpClient.d.ts.map +1 -1
  345. package/dist/http/FetchHttpClient.js +14 -10
  346. package/dist/http/FetchHttpClient.js.map +1 -1
  347. package/dist/http/FindMyWay/internal/router.js +163 -116
  348. package/dist/http/FindMyWay/internal/router.js.map +1 -1
  349. package/dist/http/FindMyWay.d.ts +99 -0
  350. package/dist/http/FindMyWay.d.ts.map +1 -1
  351. package/dist/http/FindMyWay.js +39 -0
  352. package/dist/http/FindMyWay.js.map +1 -1
  353. package/dist/http/Headers.d.ts +201 -3
  354. package/dist/http/Headers.d.ts.map +1 -1
  355. package/dist/http/Headers.js +205 -3
  356. package/dist/http/Headers.js.map +1 -1
  357. package/dist/http/HttpClient.d.ts.map +1 -1
  358. package/dist/http/HttpClient.js +12 -8
  359. package/dist/http/HttpClient.js.map +1 -1
  360. package/dist/http/HttpClientError.d.ts +1 -0
  361. package/dist/http/HttpClientError.d.ts.map +1 -1
  362. package/dist/http/HttpClientError.js +32 -9
  363. package/dist/http/HttpClientError.js.map +1 -1
  364. package/dist/http/HttpClientRequest.d.ts +46 -0
  365. package/dist/http/HttpClientRequest.d.ts.map +1 -1
  366. package/dist/http/HttpClientRequest.js +15 -0
  367. package/dist/http/HttpClientRequest.js.map +1 -1
  368. package/dist/http/HttpClientResponse.d.ts +132 -0
  369. package/dist/http/HttpClientResponse.d.ts.map +1 -1
  370. package/dist/http/HttpClientResponse.js +83 -0
  371. package/dist/http/HttpClientResponse.js.map +1 -1
  372. package/dist/http/HttpMiddleware.d.ts.map +1 -1
  373. package/dist/http/HttpMiddleware.js +16 -9
  374. package/dist/http/HttpMiddleware.js.map +1 -1
  375. package/dist/http/HttpRouter.d.ts +49 -1
  376. package/dist/http/HttpRouter.d.ts.map +1 -1
  377. package/dist/http/HttpRouter.js +70 -20
  378. package/dist/http/HttpRouter.js.map +1 -1
  379. package/dist/http/HttpServerResponse.d.ts +118 -0
  380. package/dist/http/HttpServerResponse.d.ts.map +1 -1
  381. package/dist/http/HttpServerResponse.js +67 -58
  382. package/dist/http/HttpServerResponse.js.map +1 -1
  383. package/dist/http/Mime.d.ts.map +1 -1
  384. package/dist/http/Mime.js +3 -2
  385. package/dist/http/Mime.js.map +1 -1
  386. package/dist/http/Multipart.d.ts.map +1 -1
  387. package/dist/http/Multipart.js +0 -5
  388. package/dist/http/Multipart.js.map +1 -1
  389. package/dist/http/MultipartParser/internal/contentType.d.ts +6 -0
  390. package/dist/http/MultipartParser/internal/contentType.d.ts.map +1 -1
  391. package/dist/http/MultipartParser/internal/contentType.js +1 -1
  392. package/dist/http/MultipartParser/internal/contentType.js.map +1 -1
  393. package/dist/http/internal/clientPath.d.ts +2 -0
  394. package/dist/http/internal/clientPath.d.ts.map +1 -0
  395. package/dist/http/internal/clientPath.js +24 -0
  396. package/dist/http/internal/clientPath.js.map +1 -0
  397. package/dist/http/internal/compression.d.ts.map +1 -1
  398. package/dist/http/internal/compression.js +2 -2
  399. package/dist/http/internal/compression.js.map +1 -1
  400. package/dist/http/internal/mediaType.d.ts.map +1 -0
  401. package/dist/{http-api → http}/internal/mediaType.js +4 -0
  402. package/dist/{http-api → http}/internal/mediaType.js.map +1 -1
  403. package/dist/http/internal/redactedPath.d.ts +2 -0
  404. package/dist/http/internal/redactedPath.d.ts.map +1 -0
  405. package/dist/http/internal/redactedPath.js +140 -0
  406. package/dist/http/internal/redactedPath.js.map +1 -0
  407. package/dist/http/internal/requestState.js +1 -0
  408. package/dist/http/internal/requestState.js.map +1 -1
  409. package/dist/http/internal/tracing.js +5 -3
  410. package/dist/http/internal/tracing.js.map +1 -1
  411. package/dist/http-api/HttpApi.d.ts +13 -2
  412. package/dist/http-api/HttpApi.d.ts.map +1 -1
  413. package/dist/http-api/HttpApi.js +43 -6
  414. package/dist/http-api/HttpApi.js.map +1 -1
  415. package/dist/http-api/HttpApiBuilder.d.ts.map +1 -1
  416. package/dist/http-api/HttpApiBuilder.js +7 -3
  417. package/dist/http-api/HttpApiBuilder.js.map +1 -1
  418. package/dist/http-api/HttpApiClient.d.ts.map +1 -1
  419. package/dist/http-api/HttpApiClient.js +29 -12
  420. package/dist/http-api/HttpApiClient.js.map +1 -1
  421. package/dist/http-api/HttpApiEndpoint.d.ts.map +1 -1
  422. package/dist/http-api/HttpApiEndpoint.js +1 -1
  423. package/dist/http-api/HttpApiEndpoint.js.map +1 -1
  424. package/dist/http-api/HttpApiScalar.d.ts +4 -0
  425. package/dist/http-api/HttpApiScalar.d.ts.map +1 -1
  426. package/dist/http-api/HttpApiScalar.js +10 -1
  427. package/dist/http-api/HttpApiScalar.js.map +1 -1
  428. package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
  429. package/dist/http-api/HttpApiSchema.js +1 -1
  430. package/dist/http-api/HttpApiSchema.js.map +1 -1
  431. package/dist/http-api/OpenApi.d.ts +2 -0
  432. package/dist/http-api/OpenApi.d.ts.map +1 -1
  433. package/dist/http-api/internal/httpApiScalar.js +5 -2
  434. package/dist/http-api/internal/httpApiScalar.js.map +1 -1
  435. package/dist/http-api/internal/redactedKeys.d.ts +2 -0
  436. package/dist/http-api/internal/redactedKeys.d.ts.map +1 -0
  437. package/dist/http-api/internal/redactedKeys.js +37 -0
  438. package/dist/http-api/internal/redactedKeys.js.map +1 -0
  439. package/dist/index.d.ts +5 -0
  440. package/dist/index.d.ts.map +1 -1
  441. package/dist/index.js +5 -0
  442. package/dist/index.js.map +1 -1
  443. package/dist/internal/arbitrary/model.js +0 -5
  444. package/dist/internal/arbitrary/model.js.map +1 -1
  445. package/dist/internal/arbitrary/regexp.js +2 -1
  446. package/dist/internal/arbitrary/regexp.js.map +1 -1
  447. package/dist/internal/arbitrary/runner.d.ts.map +1 -1
  448. package/dist/internal/arbitrary/runner.js +21 -16
  449. package/dist/internal/arbitrary/runner.js.map +1 -1
  450. package/dist/internal/arbitrary/schema.js +140 -23
  451. package/dist/internal/arbitrary/schema.js.map +1 -1
  452. package/dist/internal/base64.js +34 -2
  453. package/dist/internal/base64.js.map +1 -1
  454. package/dist/internal/codegen.d.ts +2 -0
  455. package/dist/internal/codegen.d.ts.map +1 -0
  456. package/dist/internal/codegen.js +59 -0
  457. package/dist/internal/codegen.js.map +1 -0
  458. package/dist/internal/core.js +3 -3
  459. package/dist/internal/core.js.map +1 -1
  460. package/dist/internal/dateTime.js +61 -29
  461. package/dist/internal/dateTime.js.map +1 -1
  462. package/dist/internal/effect.js +30 -8
  463. package/dist/internal/effect.js.map +1 -1
  464. package/dist/internal/equal.js +14 -13
  465. package/dist/internal/equal.js.map +1 -1
  466. package/dist/internal/hash.js +4 -1
  467. package/dist/internal/hash.js.map +1 -1
  468. package/dist/internal/hashMap.js +7 -7
  469. package/dist/internal/hashMap.js.map +1 -1
  470. package/dist/internal/matcher.js +19 -18
  471. package/dist/internal/matcher.js.map +1 -1
  472. package/dist/internal/record.js +18 -4
  473. package/dist/internal/record.js.map +1 -1
  474. package/dist/internal/result.js +1 -1
  475. package/dist/internal/result.js.map +1 -1
  476. package/dist/internal/schema/codeExpression.d.ts +4 -0
  477. package/dist/internal/schema/codeExpression.d.ts.map +1 -0
  478. package/dist/internal/schema/codeExpression.js +179 -0
  479. package/dist/internal/schema/codeExpression.js.map +1 -0
  480. package/dist/internal/schema/codeImports.d.ts +8 -0
  481. package/dist/internal/schema/codeImports.d.ts.map +1 -0
  482. package/dist/internal/schema/codeImports.js +135 -0
  483. package/dist/internal/schema/codeImports.js.map +1 -0
  484. package/dist/internal/schema/codeTokens.d.ts +8 -0
  485. package/dist/internal/schema/codeTokens.d.ts.map +1 -0
  486. package/dist/internal/schema/codeTokens.js +17 -0
  487. package/dist/internal/schema/codeTokens.js.map +1 -0
  488. package/dist/internal/schema/passthrough.d.ts +2 -0
  489. package/dist/internal/schema/passthrough.d.ts.map +1 -0
  490. package/dist/internal/schema/passthrough.js +8 -0
  491. package/dist/internal/schema/passthrough.js.map +1 -0
  492. package/dist/internal/schema/schemaCodegen.d.ts +2 -0
  493. package/dist/internal/schema/schemaCodegen.d.ts.map +1 -0
  494. package/dist/internal/schema/schemaCodegen.js +378 -0
  495. package/dist/internal/schema/schemaCodegen.js.map +1 -0
  496. package/dist/internal/schema/schemaCodegenBuiltIns.d.ts +2 -0
  497. package/dist/internal/schema/schemaCodegenBuiltIns.d.ts.map +1 -0
  498. package/dist/internal/schema/schemaCodegenBuiltIns.js +425 -0
  499. package/dist/internal/schema/schemaCodegenBuiltIns.js.map +1 -0
  500. package/dist/internal/schema/toEquivalence.js +3 -4
  501. package/dist/internal/schema/toEquivalence.js.map +1 -1
  502. package/dist/internal/schema/toJsonSchemaDocument.js +11 -4
  503. package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
  504. package/dist/internal/trie.js +51 -64
  505. package/dist/internal/trie.js.map +1 -1
  506. package/dist/internal/utf8.d.ts +2 -0
  507. package/dist/internal/utf8.d.ts.map +1 -0
  508. package/dist/internal/utf8.js +151 -0
  509. package/dist/internal/utf8.js.map +1 -0
  510. package/dist/internal/version.js +1 -1
  511. package/dist/jose/JoseError.d.ts +51 -1
  512. package/dist/jose/JoseError.d.ts.map +1 -1
  513. package/dist/jose/JoseError.js +25 -18
  514. package/dist/jose/JoseError.js.map +1 -1
  515. package/dist/jose/Jwks.d.ts +13 -0
  516. package/dist/jose/Jwks.d.ts.map +1 -1
  517. package/dist/jose/Jwks.js +10 -2
  518. package/dist/jose/Jwks.js.map +1 -1
  519. package/dist/jose/internal/compact.js +10 -5
  520. package/dist/jose/internal/compact.js.map +1 -1
  521. package/dist/observability/Otlp.d.ts +19 -0
  522. package/dist/observability/Otlp.d.ts.map +1 -1
  523. package/dist/observability/Otlp.js +10 -0
  524. package/dist/observability/Otlp.js.map +1 -1
  525. package/dist/observability/OtlpExporter.d.ts +49 -13
  526. package/dist/observability/OtlpExporter.d.ts.map +1 -1
  527. package/dist/observability/OtlpExporter.js +133 -50
  528. package/dist/observability/OtlpExporter.js.map +1 -1
  529. package/dist/observability/OtlpLogger.d.ts +14 -0
  530. package/dist/observability/OtlpLogger.d.ts.map +1 -1
  531. package/dist/observability/OtlpLogger.js +15 -5
  532. package/dist/observability/OtlpLogger.js.map +1 -1
  533. package/dist/observability/OtlpMetrics.d.ts.map +1 -1
  534. package/dist/observability/OtlpMetrics.js +2 -0
  535. package/dist/observability/OtlpMetrics.js.map +1 -1
  536. package/dist/observability/OtlpTracer.d.ts +14 -0
  537. package/dist/observability/OtlpTracer.d.ts.map +1 -1
  538. package/dist/observability/OtlpTracer.js +10 -2
  539. package/dist/observability/OtlpTracer.js.map +1 -1
  540. package/dist/observability/internal/otlpProtobuf.d.ts +4 -2
  541. package/dist/observability/internal/otlpProtobuf.d.ts.map +1 -1
  542. package/dist/observability/internal/otlpProtobuf.js +238 -156
  543. package/dist/observability/internal/otlpProtobuf.js.map +1 -1
  544. package/dist/persistence/KeyValueStore.d.ts.map +1 -1
  545. package/dist/persistence/KeyValueStore.js +6 -4
  546. package/dist/persistence/KeyValueStore.js.map +1 -1
  547. package/dist/persistence/PersistedQueue.d.ts.map +1 -1
  548. package/dist/persistence/PersistedQueue.js +20 -3
  549. package/dist/persistence/PersistedQueue.js.map +1 -1
  550. package/dist/protobuf/ProtobufDescriptor.d.ts +377 -0
  551. package/dist/protobuf/ProtobufDescriptor.d.ts.map +1 -0
  552. package/dist/protobuf/ProtobufDescriptor.js +135 -0
  553. package/dist/protobuf/ProtobufDescriptor.js.map +1 -0
  554. package/dist/protobuf/ProtobufDescriptorProto.d.ts +2083 -0
  555. package/dist/protobuf/ProtobufDescriptorProto.d.ts.map +1 -0
  556. package/dist/protobuf/ProtobufDescriptorProto.js +2674 -0
  557. package/dist/protobuf/ProtobufDescriptorProto.js.map +1 -0
  558. package/dist/protobuf/ProtobufMessage.d.ts +183 -0
  559. package/dist/protobuf/ProtobufMessage.d.ts.map +1 -0
  560. package/dist/protobuf/ProtobufMessage.js +232 -0
  561. package/dist/protobuf/ProtobufMessage.js.map +1 -0
  562. package/dist/protobuf/ProtobufReader.d.ts +350 -0
  563. package/dist/protobuf/ProtobufReader.d.ts.map +1 -0
  564. package/dist/protobuf/ProtobufReader.js +698 -0
  565. package/dist/protobuf/ProtobufReader.js.map +1 -0
  566. package/dist/protobuf/ProtobufWriter.d.ts +224 -0
  567. package/dist/protobuf/ProtobufWriter.d.ts.map +1 -0
  568. package/dist/protobuf/ProtobufWriter.js +483 -0
  569. package/dist/protobuf/ProtobufWriter.js.map +1 -0
  570. package/dist/protobuf/index.d.ts +30 -0
  571. package/dist/protobuf/index.d.ts.map +1 -0
  572. package/dist/protobuf/index.js +31 -0
  573. package/dist/protobuf/index.js.map +1 -0
  574. package/dist/protobuf/internal/binary.d.ts +2 -0
  575. package/dist/protobuf/internal/binary.d.ts.map +1 -0
  576. package/dist/protobuf/internal/binary.js +966 -0
  577. package/dist/protobuf/internal/binary.js.map +1 -0
  578. package/dist/protobuf/internal/resolve.d.ts +2 -0
  579. package/dist/protobuf/internal/resolve.d.ts.map +1 -0
  580. package/dist/protobuf/internal/resolve.js +463 -0
  581. package/dist/protobuf/internal/resolve.js.map +1 -0
  582. package/dist/protobuf/internal/wireType.d.ts +2 -0
  583. package/dist/protobuf/internal/wireType.d.ts.map +1 -0
  584. package/dist/protobuf/internal/wireType.js +10 -0
  585. package/dist/protobuf/internal/wireType.js.map +1 -0
  586. package/dist/reactivity/AsyncResult.d.ts +3 -0
  587. package/dist/reactivity/AsyncResult.d.ts.map +1 -1
  588. package/dist/reactivity/AsyncResult.js +4 -1
  589. package/dist/reactivity/AsyncResult.js.map +1 -1
  590. package/dist/reactivity/Atom.d.ts +10 -4
  591. package/dist/reactivity/Atom.d.ts.map +1 -1
  592. package/dist/reactivity/Atom.js +48 -22
  593. package/dist/reactivity/Atom.js.map +1 -1
  594. package/dist/reactivity/AtomHttpApi.d.ts +5 -0
  595. package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
  596. package/dist/reactivity/AtomHttpApi.js +5 -1
  597. package/dist/reactivity/AtomHttpApi.js.map +1 -1
  598. package/dist/reactivity/AtomRegistry.js +13 -0
  599. package/dist/reactivity/AtomRegistry.js.map +1 -1
  600. package/dist/reactivity/AtomRpc.d.ts +5 -0
  601. package/dist/reactivity/AtomRpc.d.ts.map +1 -1
  602. package/dist/reactivity/AtomRpc.js +6 -1
  603. package/dist/reactivity/AtomRpc.js.map +1 -1
  604. package/dist/rpc/Rpc.d.ts +25 -0
  605. package/dist/rpc/Rpc.d.ts.map +1 -1
  606. package/dist/rpc/Rpc.js +18 -0
  607. package/dist/rpc/Rpc.js.map +1 -1
  608. package/dist/rpc/RpcClient.d.ts.map +1 -1
  609. package/dist/rpc/RpcClient.js +70 -22
  610. package/dist/rpc/RpcClient.js.map +1 -1
  611. package/dist/rpc/RpcGroup.d.ts +6 -1
  612. package/dist/rpc/RpcGroup.d.ts.map +1 -1
  613. package/dist/rpc/RpcGroup.js +4 -0
  614. package/dist/rpc/RpcGroup.js.map +1 -1
  615. package/dist/rpc/RpcMiddleware.d.ts +9 -0
  616. package/dist/rpc/RpcMiddleware.d.ts.map +1 -1
  617. package/dist/rpc/RpcMiddleware.js.map +1 -1
  618. package/dist/rpc/RpcSerialization.d.ts +7 -1
  619. package/dist/rpc/RpcSerialization.d.ts.map +1 -1
  620. package/dist/rpc/RpcSerialization.js +22 -5
  621. package/dist/rpc/RpcSerialization.js.map +1 -1
  622. package/dist/rpc/RpcServer.d.ts.map +1 -1
  623. package/dist/rpc/RpcServer.js +33 -18
  624. package/dist/rpc/RpcServer.js.map +1 -1
  625. package/dist/schema/SchemaCompiler/runtime.js +2 -1
  626. package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
  627. package/dist/schema/VariantSchema.d.ts +10 -2
  628. package/dist/schema/VariantSchema.d.ts.map +1 -1
  629. package/dist/schema/VariantSchema.js +7 -1
  630. package/dist/schema/VariantSchema.js.map +1 -1
  631. package/dist/socket/Socket.d.ts +24 -10
  632. package/dist/socket/Socket.d.ts.map +1 -1
  633. package/dist/socket/Socket.js +52 -17
  634. package/dist/socket/Socket.js.map +1 -1
  635. package/dist/sql/Migrator.d.ts +3 -0
  636. package/dist/sql/Migrator.d.ts.map +1 -1
  637. package/dist/sql/Migrator.js +12 -6
  638. package/dist/sql/Migrator.js.map +1 -1
  639. package/dist/sql/SqlClient.d.ts.map +1 -1
  640. package/dist/sql/SqlClient.js +5 -1
  641. package/dist/sql/SqlClient.js.map +1 -1
  642. package/dist/sql/SqlModel.d.ts.map +1 -1
  643. package/dist/sql/SqlModel.js +1 -0
  644. package/dist/sql/SqlModel.js.map +1 -1
  645. package/dist/testing/TestConsole.d.ts +96 -0
  646. package/dist/testing/TestConsole.d.ts.map +1 -1
  647. package/dist/testing/TestConsole.js +78 -6
  648. package/dist/testing/TestConsole.js.map +1 -1
  649. package/dist/testing/TestSchema.d.ts +5 -1
  650. package/dist/testing/TestSchema.d.ts.map +1 -1
  651. package/dist/testing/TestSchema.js +7 -2
  652. package/dist/testing/TestSchema.js.map +1 -1
  653. package/dist/workers/SharedMemory.d.ts +115 -0
  654. package/dist/workers/SharedMemory.d.ts.map +1 -0
  655. package/dist/workers/SharedMemory.js +149 -0
  656. package/dist/workers/SharedMemory.js.map +1 -0
  657. package/dist/workers/Transferable.d.ts.map +1 -1
  658. package/dist/workers/Transferable.js +1 -4
  659. package/dist/workers/Transferable.js.map +1 -1
  660. package/dist/workers/index.d.ts +5 -0
  661. package/dist/workers/index.d.ts.map +1 -1
  662. package/dist/workers/index.js +5 -0
  663. package/dist/workers/index.js.map +1 -1
  664. package/dist/workflow/Activity.d.ts +18 -0
  665. package/dist/workflow/Activity.d.ts.map +1 -1
  666. package/dist/workflow/Activity.js +13 -4
  667. package/dist/workflow/Activity.js.map +1 -1
  668. package/dist/workflow/Workflow.d.ts +10 -9
  669. package/dist/workflow/Workflow.d.ts.map +1 -1
  670. package/dist/workflow/Workflow.js +33 -22
  671. package/dist/workflow/Workflow.js.map +1 -1
  672. package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
  673. package/dist/workflow/WorkflowEngine.js +28 -12
  674. package/dist/workflow/WorkflowEngine.js.map +1 -1
  675. package/dist/workflow/internal/retry.d.ts +2 -0
  676. package/dist/workflow/internal/retry.d.ts.map +1 -0
  677. package/dist/workflow/internal/retry.js +11 -0
  678. package/dist/workflow/internal/retry.js.map +1 -0
  679. package/dist/workflow/internal/scope.d.ts +2 -0
  680. package/dist/workflow/internal/scope.d.ts.map +1 -0
  681. package/dist/workflow/internal/scope.js +26 -0
  682. package/dist/workflow/internal/scope.js.map +1 -0
  683. package/package.json +8 -5
  684. package/src/Arbitrary.ts +60 -3
  685. package/src/BigInt.ts +247 -9
  686. package/src/Cache.ts +4 -2
  687. package/src/Cause.ts +3 -3
  688. package/src/Channel.ts +105 -8
  689. package/src/Chunk.ts +7 -3
  690. package/src/Clock.ts +5 -2
  691. package/src/Codegen.ts +746 -0
  692. package/src/Config.ts +35 -4
  693. package/src/ConfigProvider.ts +24 -7
  694. package/src/Effect.ts +1095 -157
  695. package/src/Equal.ts +85 -79
  696. package/src/Equivalence.ts +16 -13
  697. package/src/Fiber.ts +58 -8
  698. package/src/FiberHandle.ts +86 -12
  699. package/src/FiberMap.ts +83 -10
  700. package/src/FiberSet.ts +96 -8
  701. package/src/Formatter.ts +2 -0
  702. package/src/Hash.ts +30 -22
  703. package/src/LayerMap.ts +14 -4
  704. package/src/LayerRef.ts +8 -6
  705. package/src/Logger.ts +68 -25
  706. package/src/Match.ts +94 -50
  707. package/src/Metric.ts +1 -1
  708. package/src/Option.ts +9 -5
  709. package/src/Order.ts +10 -5
  710. package/src/Pool.ts +22 -17
  711. package/src/Predicate.ts +7 -3
  712. package/src/Queue.ts +84 -31
  713. package/src/Rational.ts +198 -0
  714. package/src/Request.ts +20 -0
  715. package/src/Result.ts +9 -6
  716. package/src/Schema.ts +145 -325
  717. package/src/SchemaAST.ts +15 -5
  718. package/src/SchemaGetter.ts +17 -10
  719. package/src/SchemaRepresentation.ts +19 -74
  720. package/src/SchemaTransformation.ts +12 -11
  721. package/src/Scope.ts +12 -6
  722. package/src/ScopedCache.ts +8 -5
  723. package/src/Semaphore.ts +18 -4
  724. package/src/Stream.ts +233 -53
  725. package/src/String.ts +84 -7
  726. package/src/Struct.ts +138 -5
  727. package/src/TextDiff.ts +186 -30
  728. package/src/Tracer.ts +10 -0
  729. package/src/TxPriorityQueue.ts +2 -2
  730. package/src/ai/LanguageModel.ts +2 -1
  731. package/src/ai/McpServer.ts +306 -26
  732. package/src/ai/Prompt.ts +20 -3
  733. package/src/ai/Skill.ts +236 -0
  734. package/src/ai/Tool.ts +3 -2
  735. package/src/ai/Toolkit.ts +3 -1
  736. package/src/ai/index.ts +6 -0
  737. package/src/chat/Chat.ts +164 -0
  738. package/src/chat/ChatAdapter.ts +444 -0
  739. package/src/chat/ChatError.ts +684 -0
  740. package/src/chat/ChatEvent.ts +221 -0
  741. package/src/chat/ChatHandler.ts +102 -0
  742. package/src/chat/ChatInteraction.ts +1979 -0
  743. package/src/chat/ChatMarkdown.ts +1406 -0
  744. package/src/chat/ChatMessage.ts +213 -0
  745. package/src/chat/ChatTest.ts +2606 -0
  746. package/src/chat/ChatThread.ts +132 -0
  747. package/src/chat/ChatUi.ts +320 -0
  748. package/src/chat/index.ts +72 -0
  749. package/src/chat/internal/retries.ts +7 -0
  750. package/src/cli/CliOutput.ts +4 -5
  751. package/src/cli/Command.ts +20 -2
  752. package/src/cli/Prompt.ts +15 -9
  753. package/src/cli/internal/config.ts +8 -8
  754. package/src/cluster/ClusterCron.ts +33 -10
  755. package/src/cluster/ClusterWorkflowEngine.ts +214 -119
  756. package/src/cluster/MessageStorage.ts +51 -2
  757. package/src/cluster/Sharding.ts +17 -3
  758. package/src/cluster/ShardingConfig.ts +3 -0
  759. package/src/cluster/SqlMessageStorage.ts +97 -54
  760. package/src/cluster/SqlRunnerStorage.ts +21 -8
  761. package/src/cluster/internal/entityActivation.ts +6 -0
  762. package/src/cluster/internal/entityManager.ts +27 -14
  763. package/src/cluster/internal/entityReaper.ts +1 -1
  764. package/src/crypto/Kdf.ts +2 -1
  765. package/src/crypto/Password.ts +258 -0
  766. package/src/crypto/index.ts +6 -0
  767. package/src/encoding/Base64.ts +84 -1
  768. package/src/encoding/Base64Url.ts +7 -1
  769. package/src/encoding/Csv.ts +47 -20
  770. package/src/encoding/Hex.ts +5 -0
  771. package/src/encoding/SchemaBinary.ts +13 -79
  772. package/src/encoding/Sse.ts +7 -5
  773. package/src/encoding/Xml.ts +485 -68
  774. package/src/eventlog/EventJournal.ts +3 -8
  775. package/src/eventlog/SqlEventLogServerEncrypted.ts +9 -9
  776. package/src/http/FetchHttpClient.ts +8 -5
  777. package/src/http/FindMyWay/internal/router.ts +181 -129
  778. package/src/http/FindMyWay.ts +106 -0
  779. package/src/http/Headers.ts +309 -3
  780. package/src/http/HttpClient.ts +21 -8
  781. package/src/http/HttpClientError.ts +42 -9
  782. package/src/http/HttpClientRequest.ts +51 -0
  783. package/src/http/HttpClientResponse.ts +156 -0
  784. package/src/http/HttpMiddleware.ts +23 -10
  785. package/src/http/HttpRouter.ts +84 -20
  786. package/src/http/HttpServerResponse.ts +159 -61
  787. package/src/http/Mime.ts +3 -2
  788. package/src/http/Multipart.ts +0 -5
  789. package/src/http/MultipartParser/internal/contentType.ts +1 -1
  790. package/src/http/internal/clientPath.ts +39 -0
  791. package/src/http/internal/compression.ts +2 -2
  792. package/src/{http-api → http}/internal/mediaType.ts +4 -0
  793. package/src/http/internal/redactedPath.ts +148 -0
  794. package/src/http/internal/requestState.ts +2 -0
  795. package/src/http/internal/tracing.ts +6 -3
  796. package/src/http-api/HttpApi.ts +50 -6
  797. package/src/http-api/HttpApiBuilder.ts +11 -3
  798. package/src/http-api/HttpApiClient.ts +40 -13
  799. package/src/http-api/HttpApiEndpoint.ts +1 -1
  800. package/src/http-api/HttpApiScalar.ts +9 -1
  801. package/src/http-api/HttpApiSchema.ts +1 -1
  802. package/src/http-api/OpenApi.ts +2 -0
  803. package/src/http-api/internal/httpApiScalar.ts +5 -1
  804. package/src/http-api/internal/redactedKeys.ts +40 -0
  805. package/src/index.ts +6 -0
  806. package/src/internal/arbitrary/model.ts +3 -9
  807. package/src/internal/arbitrary/regexp.ts +3 -1
  808. package/src/internal/arbitrary/runner.ts +28 -14
  809. package/src/internal/arbitrary/schema.ts +140 -35
  810. package/src/internal/base64.ts +57 -2
  811. package/src/internal/codegen.ts +53 -0
  812. package/src/internal/core.ts +3 -3
  813. package/src/internal/dateTime.ts +73 -37
  814. package/src/internal/effect.ts +56 -111
  815. package/src/internal/equal.ts +37 -17
  816. package/src/internal/hash.ts +5 -1
  817. package/src/internal/hashMap.ts +8 -7
  818. package/src/internal/matcher.ts +36 -114
  819. package/src/internal/record.ts +19 -4
  820. package/src/internal/result.ts +1 -1
  821. package/src/internal/schema/codeExpression.ts +179 -0
  822. package/src/internal/schema/codeImports.ts +142 -0
  823. package/src/internal/schema/codeTokens.ts +39 -0
  824. package/src/internal/schema/passthrough.ts +8 -0
  825. package/src/internal/schema/schemaCodegen.ts +544 -0
  826. package/src/internal/schema/schemaCodegenBuiltIns.ts +343 -0
  827. package/src/internal/schema/toEquivalence.ts +3 -5
  828. package/src/internal/schema/toJsonSchemaDocument.ts +13 -4
  829. package/src/internal/trie.ts +46 -60
  830. package/src/internal/utf8.ts +106 -0
  831. package/src/internal/version.ts +1 -1
  832. package/src/jose/JoseError.ts +34 -0
  833. package/src/jose/Jwks.ts +23 -4
  834. package/src/jose/internal/compact.ts +14 -5
  835. package/src/observability/Otlp.ts +29 -0
  836. package/src/observability/OtlpExporter.ts +209 -76
  837. package/src/observability/OtlpLogger.ts +29 -5
  838. package/src/observability/OtlpMetrics.ts +2 -0
  839. package/src/observability/OtlpTracer.ts +24 -3
  840. package/src/observability/internal/otlpProtobuf.ts +386 -457
  841. package/src/persistence/KeyValueStore.ts +17 -14
  842. package/src/persistence/PersistedQueue.ts +21 -4
  843. package/src/protobuf/ProtobufDescriptor.ts +503 -0
  844. package/src/protobuf/ProtobufDescriptorProto.ts +3611 -0
  845. package/src/protobuf/ProtobufMessage.ts +277 -0
  846. package/src/protobuf/ProtobufReader.ts +756 -0
  847. package/src/protobuf/ProtobufWriter.ts +530 -0
  848. package/src/protobuf/index.ts +36 -0
  849. package/src/protobuf/internal/binary.ts +1215 -0
  850. package/src/protobuf/internal/resolve.ts +533 -0
  851. package/src/protobuf/internal/wireType.ts +9 -0
  852. package/src/reactivity/AsyncResult.ts +6 -1
  853. package/src/reactivity/Atom.ts +67 -34
  854. package/src/reactivity/AtomHttpApi.ts +10 -1
  855. package/src/reactivity/AtomRegistry.ts +16 -0
  856. package/src/reactivity/AtomRpc.ts +11 -1
  857. package/src/rpc/Rpc.ts +31 -0
  858. package/src/rpc/RpcClient.ts +56 -22
  859. package/src/rpc/RpcGroup.ts +9 -1
  860. package/src/rpc/RpcMiddleware.ts +9 -0
  861. package/src/rpc/RpcSerialization.ts +26 -6
  862. package/src/rpc/RpcServer.ts +33 -20
  863. package/src/schema/SchemaCompiler/runtime.ts +2 -3
  864. package/src/schema/VariantSchema.ts +12 -4
  865. package/src/socket/Socket.ts +67 -20
  866. package/src/sql/Migrator.ts +10 -12
  867. package/src/sql/SqlClient.ts +14 -8
  868. package/src/sql/SqlModel.ts +4 -0
  869. package/src/testing/TestConsole.ts +119 -9
  870. package/src/testing/TestSchema.ts +8 -3
  871. package/src/workers/SharedMemory.ts +227 -0
  872. package/src/workers/Transferable.ts +1 -5
  873. package/src/workers/index.ts +6 -0
  874. package/src/workflow/Activity.ts +28 -4
  875. package/src/workflow/Workflow.ts +68 -44
  876. package/src/workflow/WorkflowEngine.ts +41 -16
  877. package/src/workflow/internal/retry.ts +12 -0
  878. package/src/workflow/internal/scope.ts +36 -0
  879. package/dist/http-api/internal/mediaType.d.ts.map +0 -1
  880. package/dist/internal/schema/toCodeDocument.d.ts +0 -2
  881. package/dist/internal/schema/toCodeDocument.d.ts.map +0 -1
  882. package/dist/internal/schema/toCodeDocument.js +0 -447
  883. package/dist/internal/schema/toCodeDocument.js.map +0 -1
  884. package/dist/observability/internal/protobuf.d.ts +0 -2
  885. package/dist/observability/internal/protobuf.d.ts.map +0 -1
  886. package/dist/observability/internal/protobuf.js +0 -169
  887. package/dist/observability/internal/protobuf.js.map +0 -1
  888. package/src/internal/schema/toCodeDocument.ts +0 -578
  889. package/src/observability/internal/protobuf.ts +0 -225
  890. /package/dist/{http-api → http}/internal/mediaType.d.ts +0 -0
package/src/Schema.ts CHANGED
@@ -78,7 +78,7 @@ import * as Order from "./Order.ts"
78
78
  import * as Pipeable from "./Pipeable.ts"
79
79
  import * as Predicate from "./Predicate.ts"
80
80
  import * as Rational_ from "./Rational.ts"
81
- import * as Record_ from "./Record.ts"
81
+ import type * as Record_ from "./Record.ts"
82
82
  import * as Redacted_ from "./Redacted.ts"
83
83
  import * as RegExp_ from "./RegExp.ts"
84
84
  import * as Result_ from "./Result.ts"
@@ -3574,11 +3574,14 @@ function makeStruct<const Fields extends Struct.Fields>(ast: SchemaAST.Objects,
3574
3574
  *
3575
3575
  * Each field value is a schema. Use {@link optionalKey} or {@link optional} to
3576
3576
  * mark fields as optional, and {@link mutableKey} to mark them as mutable.
3577
+ * Field definitions are discovered from own enumerable string and symbol
3578
+ * properties of `fields`. Non-enumerable and inherited definitions are ignored.
3577
3579
  *
3578
3580
  * The resulting schema's `Type` is a readonly object type with the fields'
3579
3581
  * decoded types. The `Encoded` form mirrors the field schemas' encoded types.
3580
- * Declared fields may be inherited and are copied to own properties in the
3581
- * output. The `__proto__` field is accepted only when it is an own property.
3582
+ * Declared fields on the input may be non-enumerable or inherited and are copied
3583
+ * to own properties in the output. The `__proto__` field is accepted only when
3584
+ * it is an own property.
3582
3585
  * Parsing does not guarantee that output keys retain their input order.
3583
3586
  *
3584
3587
  * **Example** (Defining a basic struct)
@@ -3680,6 +3683,10 @@ const canonicalPropertyKey = (key: PropertyKey): string | symbol =>
3680
3683
  * the renamed keys. Keys not present in the mapping are left unchanged.
3681
3684
  * If two existing fields would produce the same encoded key, construction
3682
3685
  * fails.
3686
+ * Only own enumerable string and symbol properties of the schema's `fields`
3687
+ * define fields to rename. Non-enumerable and inherited field definitions are
3688
+ * ignored. For each selected field, an own entry in `mapping` is used even if
3689
+ * that entry is non-enumerable; inherited mapping entries are ignored.
3683
3690
  *
3684
3691
  * **Example** (Renaming `name` to `full_name` in the encoded form)
3685
3692
  *
@@ -3706,7 +3713,7 @@ export function encodeKeys<
3706
3713
  const appliedMapping: any = Object.create(null)
3707
3714
  const reverseMapping: any = Object.create(null)
3708
3715
  const seenEncodedKeys = new Set<string | symbol>()
3709
- for (const k of Reflect.ownKeys(self.fields)) {
3716
+ for (const k of InternalRecord.ownEnumerableKeys(self.fields)) {
3710
3717
  const encoded = toEncoded(self.fields[k])
3711
3718
  const hasMapping = Object.hasOwn(mapping, k)
3712
3719
  const encodedKey = hasMapping ? (mapping as any)[k] as PropertyKey : k
@@ -3739,6 +3746,10 @@ export function encodeKeys<
3739
3746
  * returns `Option`. On encoding the derived fields are stripped. This allows
3740
3747
  * computed or enriched fields to live in the decoded type without appearing in
3741
3748
  * the encoded form.
3749
+ * Existing and added field definitions use own enumerable string and symbol
3750
+ * properties; non-enumerable and inherited definitions are ignored. Derivation
3751
+ * functions are looked up by the selected field names and may be non-enumerable
3752
+ * or inherited.
3742
3753
  *
3743
3754
  * **Example** (Adding a computed `fullName` field)
3744
3755
  *
@@ -3768,14 +3779,15 @@ export function extendTo<S extends Struct<Struct.Fields>, const Fields extends S
3768
3779
  return (
3769
3780
  self: S
3770
3781
  ): decodeTo<Struct<Simplify<{ [K in keyof S["fields"]]: toType<S["fields"][K]> } & Fields>>, S> => {
3771
- const f = Record_.map(self.fields, toType)
3782
+ const f = Struct_.map(self.fields, toType)
3772
3783
  const to = Struct({ ...f, ...fields })
3784
+ const keys = InternalRecord.ownEnumerableKeys(fields)
3773
3785
  return self.pipe(decodeTo(
3774
3786
  to,
3775
3787
  SchemaTransformation.transform({
3776
3788
  decode: (input) => {
3777
3789
  const out: any = { ...input }
3778
- for (const k in fields) {
3790
+ for (const k of keys) {
3779
3791
  const f = derive[k]
3780
3792
  const o = f(input)
3781
3793
  if (Option_.isSome(o)) {
@@ -3786,7 +3798,7 @@ export function extendTo<S extends Struct<Struct.Fields>, const Fields extends S
3786
3798
  },
3787
3799
  encode: (input) => {
3788
3800
  const out = { ...input }
3789
- for (const k in fields) {
3801
+ for (const k of keys) {
3790
3802
  delete out[k]
3791
3803
  }
3792
3804
  return out
@@ -6901,7 +6913,6 @@ export function isTrimmed(annotations?: Annotations.Filter) {
6901
6913
  payload: null
6902
6914
  },
6903
6915
  toJsonSchema: () => ({ pattern: regExp.source }),
6904
- toCode: () => ({ runtime: "Schema.isTrimmed()" }),
6905
6916
  arbitraryConstraint: {
6906
6917
  patterns: [{ source: TRIMMED_PATTERN, flags: "" }]
6907
6918
  },
@@ -6936,12 +6947,8 @@ export function isPattern(
6936
6947
  const source = regExp.source
6937
6948
  const flags = regExp.flags
6938
6949
  const canExport = /^[dg]*uy?$/.test(flags)
6939
- const runtimeRegExp = flags === ""
6940
- ? `new globalThis.RegExp(${format(source)})`
6941
- : `new globalThis.RegExp(${format(source)}, ${format(flags)})`
6942
6950
  return SchemaAST.isPattern(regExp, {
6943
6951
  toJsonSchema: () => canExport ? { pattern: flags.endsWith("y") ? `^(?:${source})` : source } : [{}, true],
6944
- toCode: () => ({ runtime: `Schema.isPattern(${runtimeRegExp})` }),
6945
6952
  ...annotations
6946
6953
  })
6947
6954
  }
@@ -6965,10 +6972,7 @@ export function isPattern(
6965
6972
  * @since 4.0.0
6966
6973
  */
6967
6974
  export function isStringFinite(annotations?: Annotations.Filter): SchemaAST.Filter<string> {
6968
- return SchemaAST.isStringFinite({
6969
- toCode: () => ({ runtime: "Schema.isStringFinite()" }),
6970
- ...annotations
6971
- })
6975
+ return SchemaAST.isStringFinite(annotations)
6972
6976
  }
6973
6977
  /**
6974
6978
  * Validates that a string is a signed base-10 integer literal for Effect's
@@ -6989,10 +6993,7 @@ export function isStringFinite(annotations?: Annotations.Filter): SchemaAST.Filt
6989
6993
  * @since 4.0.0
6990
6994
  */
6991
6995
  export function isStringBigInt(annotations?: Annotations.Filter): SchemaAST.Filter<string> {
6992
- return SchemaAST.isStringBigInt({
6993
- toCode: () => ({ runtime: "Schema.isStringBigInt()" }),
6994
- ...annotations
6995
- })
6996
+ return SchemaAST.isStringBigInt(annotations)
6996
6997
  }
6997
6998
  /**
6998
6999
  * Validates that a string has the `Symbol(description)` format used by Effect's
@@ -7008,10 +7009,7 @@ export function isStringBigInt(annotations?: Annotations.Filter): SchemaAST.Filt
7008
7009
  * @since 4.0.0
7009
7010
  */
7010
7011
  export function isStringSymbol(annotations?: Annotations.Filter): SchemaAST.Filter<string> {
7011
- return SchemaAST.isStringSymbol({
7012
- toCode: () => ({ runtime: "Schema.isStringSymbol()" }),
7013
- ...annotations
7014
- })
7012
+ return SchemaAST.isStringSymbol(annotations)
7015
7013
  }
7016
7014
 
7017
7015
  const getUUIDRegExp = (version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8): globalThis.RegExp => {
@@ -7064,7 +7062,6 @@ export function isUUID(version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8, annotations?: An
7064
7062
  payload: { version: version ?? null }
7065
7063
  },
7066
7064
  toJsonSchema: () => ({ pattern: regExp.source, format: "uuid" }),
7067
- toCode: () => ({ runtime: version === undefined ? "Schema.isUUID()" : `Schema.isUUID(${version})` }),
7068
7065
  ...annotations
7069
7066
  }
7070
7067
  )
@@ -7105,7 +7102,6 @@ export function isGUID(annotations?: Annotations.Filter) {
7105
7102
  id: "effect/schema/isGUID",
7106
7103
  payload: null
7107
7104
  },
7108
- toCode: () => ({ runtime: "Schema.isGUID()" }),
7109
7105
  ...annotations
7110
7106
  }
7111
7107
  )
@@ -7143,7 +7139,6 @@ export function isULID(annotations?: Annotations.Filter) {
7143
7139
  id: "effect/schema/isULID",
7144
7140
  payload: null
7145
7141
  },
7146
- toCode: () => ({ runtime: "Schema.isULID()" }),
7147
7142
  ...annotations
7148
7143
  }
7149
7144
  )
@@ -7188,7 +7183,6 @@ export function isAscii(annotations?: Annotations.Filter) {
7188
7183
  id: "effect/schema/isAscii",
7189
7184
  payload: null
7190
7185
  },
7191
- toCode: () => ({ runtime: "Schema.isAscii()" }),
7192
7186
  ...annotations
7193
7187
  }
7194
7188
  )
@@ -7228,7 +7222,6 @@ export function isBase64(annotations?: Annotations.Filter) {
7228
7222
  arbitraryConstraint: {
7229
7223
  patterns: [{ source: pattern, flags: "" }]
7230
7224
  },
7231
- toCode: () => ({ runtime: "Schema.isBase64()" }),
7232
7225
  ...annotations
7233
7226
  }
7234
7227
  )
@@ -7269,7 +7262,6 @@ export function isBase64Url(annotations?: Annotations.Filter) {
7269
7262
  arbitraryConstraint: {
7270
7263
  patterns: [{ source: pattern, flags: "" }]
7271
7264
  },
7272
- toCode: () => ({ runtime: "Schema.isBase64Url()" }),
7273
7265
  ...annotations
7274
7266
  }
7275
7267
  )
@@ -7311,7 +7303,6 @@ export function isStartingWith(startsWith: string, annotations?: Annotations.Fil
7311
7303
  payload: { startsWith }
7312
7304
  },
7313
7305
  toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, startsWith, `^${RegExp_.escape(jsonSchemaLiteral)}`),
7314
- toCode: () => ({ runtime: `Schema.isStartingWith(${format(startsWith)})` }),
7315
7306
  arbitraryConstraint: {
7316
7307
  patterns: [{ source: regExp.source, flags: regExp.flags }]
7317
7308
  },
@@ -7345,7 +7336,6 @@ export function isEndingWith(endsWith: string, annotations?: Annotations.Filter)
7345
7336
  payload: { endsWith }
7346
7337
  },
7347
7338
  toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, endsWith, `${RegExp_.escape(jsonSchemaLiteral)}$`),
7348
- toCode: () => ({ runtime: `Schema.isEndingWith(${format(endsWith)})` }),
7349
7339
  arbitraryConstraint: {
7350
7340
  patterns: [{ source: regExp.source, flags: regExp.flags }]
7351
7341
  },
@@ -7380,7 +7370,6 @@ export function isIncluding(includes: string, annotations?: Annotations.Filter)
7380
7370
  payload: { includes }
7381
7371
  },
7382
7372
  toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, includes, RegExp_.escape(jsonSchemaLiteral)),
7383
- toCode: () => ({ runtime: `Schema.isIncluding(${format(includes)})` }),
7384
7373
  arbitraryConstraint: {
7385
7374
  patterns: [{ source: regExp.source, flags: regExp.flags }]
7386
7375
  },
@@ -7414,7 +7403,6 @@ export function isUppercased(annotations?: Annotations.Filter) {
7414
7403
  payload: null
7415
7404
  },
7416
7405
  toJsonSchema: () => [{ pattern: regExp.source }, true],
7417
- toCode: () => ({ runtime: "Schema.isUppercased()" }),
7418
7406
  arbitraryConstraint: {
7419
7407
  patterns: [{ source: UPPERCASED_PATTERN, flags: "" }]
7420
7408
  },
@@ -7448,7 +7436,6 @@ export function isLowercased(annotations?: Annotations.Filter) {
7448
7436
  payload: null
7449
7437
  },
7450
7438
  toJsonSchema: () => [{ pattern: regExp.source }, true],
7451
- toCode: () => ({ runtime: "Schema.isLowercased()" }),
7452
7439
  arbitraryConstraint: {
7453
7440
  patterns: [{ source: LOWERCASED_PATTERN, flags: "" }]
7454
7441
  },
@@ -7484,7 +7471,6 @@ export function isCapitalized(annotations?: Annotations.Filter) {
7484
7471
  payload: null
7485
7472
  },
7486
7473
  toJsonSchema: () => [{ pattern: CAPITALIZED_PATTERN }, true],
7487
- toCode: () => ({ runtime: "Schema.isCapitalized()" }),
7488
7474
  arbitraryConstraint: {
7489
7475
  patterns: [{ source: CAPITALIZED_PATTERN, flags: "" }]
7490
7476
  },
@@ -7520,7 +7506,6 @@ export function isUncapitalized(annotations?: Annotations.Filter) {
7520
7506
  payload: null
7521
7507
  },
7522
7508
  toJsonSchema: () => [{ pattern: UNCAPITALIZED_PATTERN }, true],
7523
- toCode: () => ({ runtime: "Schema.isUncapitalized()" }),
7524
7509
  arbitraryConstraint: {
7525
7510
  patterns: [{ source: UNCAPITALIZED_PATTERN, flags: "" }]
7526
7511
  },
@@ -7799,8 +7784,7 @@ export const isGreaterThan: (exclusiveMinimum: number, annotations?: Annotations
7799
7784
  id: "effect/schema/isGreaterThan",
7800
7785
  payload: { exclusiveMinimum: encodeNumberPayload(exclusiveMinimum) }
7801
7786
  },
7802
- toJsonSchema: () => ({ exclusiveMinimum }),
7803
- toCode: () => ({ runtime: `Schema.isGreaterThan(${format(exclusiveMinimum)})` })
7787
+ toJsonSchema: () => ({ exclusiveMinimum })
7804
7788
  })
7805
7789
  })
7806
7790
  /**
@@ -7830,8 +7814,7 @@ export const isGreaterThanOrEqualTo: (minimum: number, annotations?: Annotations
7830
7814
  id: "effect/schema/isGreaterThanOrEqualTo",
7831
7815
  payload: { minimum: encodeNumberPayload(minimum) }
7832
7816
  },
7833
- toJsonSchema: () => ({ minimum }),
7834
- toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualTo(${format(minimum)})` })
7817
+ toJsonSchema: () => ({ minimum })
7835
7818
  })
7836
7819
  })
7837
7820
  /**
@@ -7861,8 +7844,7 @@ export const isLessThan: (exclusiveMaximum: number, annotations?: Annotations.Fi
7861
7844
  id: "effect/schema/isLessThan",
7862
7845
  payload: { exclusiveMaximum: encodeNumberPayload(exclusiveMaximum) }
7863
7846
  },
7864
- toJsonSchema: () => ({ exclusiveMaximum }),
7865
- toCode: () => ({ runtime: `Schema.isLessThan(${format(exclusiveMaximum)})` })
7847
+ toJsonSchema: () => ({ exclusiveMaximum })
7866
7848
  })
7867
7849
  })
7868
7850
  /**
@@ -7892,8 +7874,7 @@ export const isLessThanOrEqualTo: (maximum: number, annotations?: Annotations.Fi
7892
7874
  id: "effect/schema/isLessThanOrEqualTo",
7893
7875
  payload: { maximum: encodeNumberPayload(maximum) }
7894
7876
  },
7895
- toJsonSchema: () => ({ maximum }),
7896
- toCode: () => ({ runtime: `Schema.isLessThanOrEqualTo(${format(maximum)})` })
7877
+ toJsonSchema: () => ({ maximum })
7897
7878
  })
7898
7879
  })
7899
7880
  /**
@@ -7942,11 +7923,6 @@ export const isBetween: (options: {
7942
7923
  toJsonSchema: () => ({
7943
7924
  [exclusiveMinimum ? "exclusiveMinimum" : "minimum"]: options.minimum,
7944
7925
  [exclusiveMaximum ? "exclusiveMaximum" : "maximum"]: options.maximum
7945
- }),
7946
- toCode: () => ({
7947
- runtime: `Schema.isBetween({ minimum: ${format(options.minimum)}, maximum: ${
7948
- format(options.maximum)
7949
- }, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })`
7950
7926
  })
7951
7927
  }
7952
7928
  }
@@ -7987,7 +7963,6 @@ export function isMultipleOf(
7987
7963
  payload: { divisor }
7988
7964
  },
7989
7965
  toJsonSchema: () => ({ multipleOf: divisor }),
7990
- toCode: () => ({ runtime: `Schema.isMultipleOf(${format(divisor)})` }),
7991
7966
  ...annotations
7992
7967
  }
7993
7968
  )
@@ -8025,7 +8000,6 @@ export function isInt(annotations?: Annotations.Filter) {
8025
8000
  minimum: globalThis.Number.MIN_SAFE_INTEGER,
8026
8001
  maximum: globalThis.Number.MAX_SAFE_INTEGER
8027
8002
  }),
8028
- toCode: () => ({ runtime: "Schema.isInt()" }),
8029
8003
  arbitraryConstraint: {
8030
8004
  number: "integer"
8031
8005
  },
@@ -8147,9 +8121,6 @@ function encodeDatePayload(date: globalThis.Date): string {
8147
8121
  return date.toISOString()
8148
8122
  }
8149
8123
 
8150
- function formatDateRuntime(date: globalThis.Date): string {
8151
- return `new globalThis.Date(${format(date.getTime())})`
8152
- }
8153
8124
  /**
8154
8125
  * Validates that a Date is greater than the specified value (exclusive).
8155
8126
  *
@@ -8175,8 +8146,7 @@ export const isGreaterThanDate: (
8175
8146
  id: "effect/schema/isGreaterThanDate",
8176
8147
  payload: { exclusiveMinimum: encoded }
8177
8148
  },
8178
- toJsonSchema: () => [{}, true],
8179
- toCode: () => ({ runtime: `Schema.isGreaterThanDate(${formatDateRuntime(exclusiveMinimum)})` })
8149
+ toJsonSchema: () => [{}, true]
8180
8150
  }
8181
8151
  }
8182
8152
  })
@@ -8211,8 +8181,7 @@ export const isGreaterThanOrEqualToDate: (
8211
8181
  id: "effect/schema/isGreaterThanOrEqualToDate",
8212
8182
  payload: { minimum: encoded }
8213
8183
  },
8214
- toJsonSchema: () => [{}, true],
8215
- toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualToDate(${formatDateRuntime(minimum)})` })
8184
+ toJsonSchema: () => [{}, true]
8216
8185
  }
8217
8186
  }
8218
8187
  })
@@ -8241,8 +8210,7 @@ export const isLessThanDate: (
8241
8210
  id: "effect/schema/isLessThanDate",
8242
8211
  payload: { exclusiveMaximum: encoded }
8243
8212
  },
8244
- toJsonSchema: () => [{}, true],
8245
- toCode: () => ({ runtime: `Schema.isLessThanDate(${formatDateRuntime(exclusiveMaximum)})` })
8213
+ toJsonSchema: () => [{}, true]
8246
8214
  }
8247
8215
  }
8248
8216
  })
@@ -8277,8 +8245,7 @@ export const isLessThanOrEqualToDate: (
8277
8245
  id: "effect/schema/isLessThanOrEqualToDate",
8278
8246
  payload: { maximum: encoded }
8279
8247
  },
8280
- toJsonSchema: () => [{}, true],
8281
- toCode: () => ({ runtime: `Schema.isLessThanOrEqualToDate(${formatDateRuntime(maximum)})` })
8248
+ toJsonSchema: () => [{}, true]
8282
8249
  }
8283
8250
  }
8284
8251
  })
@@ -8322,12 +8289,7 @@ export const isBetweenDate: (options: {
8322
8289
  id: "effect/schema/isBetweenDate",
8323
8290
  payload
8324
8291
  },
8325
- toJsonSchema: () => [{}, true],
8326
- toCode: () => ({
8327
- runtime: `Schema.isBetweenDate({ minimum: ${formatDateRuntime(options.minimum)}, maximum: ${
8328
- formatDateRuntime(options.maximum)
8329
- }, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })`
8330
- })
8292
+ toJsonSchema: () => [{}, true]
8331
8293
  }
8332
8294
  }
8333
8295
  })
@@ -8356,8 +8318,7 @@ export const isGreaterThanBigInt: (
8356
8318
  id: "effect/schema/isGreaterThanBigInt",
8357
8319
  payload: { exclusiveMinimum: encoded }
8358
8320
  },
8359
- toJsonSchema: () => [{}, true],
8360
- toCode: () => ({ runtime: `Schema.isGreaterThanBigInt(${format(exclusiveMinimum)})` })
8321
+ toJsonSchema: () => [{}, true]
8361
8322
  }
8362
8323
  }
8363
8324
  })
@@ -8387,8 +8348,7 @@ export const isGreaterThanOrEqualToBigInt: (
8387
8348
  id: "effect/schema/isGreaterThanOrEqualToBigInt",
8388
8349
  payload: { minimum: encoded }
8389
8350
  },
8390
- toJsonSchema: () => [{}, true],
8391
- toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualToBigInt(${format(minimum)})` })
8351
+ toJsonSchema: () => [{}, true]
8392
8352
  }
8393
8353
  }
8394
8354
  })
@@ -8417,8 +8377,7 @@ export const isLessThanBigInt: (
8417
8377
  id: "effect/schema/isLessThanBigInt",
8418
8378
  payload: { exclusiveMaximum: encoded }
8419
8379
  },
8420
- toJsonSchema: () => [{}, true],
8421
- toCode: () => ({ runtime: `Schema.isLessThanBigInt(${format(exclusiveMaximum)})` })
8380
+ toJsonSchema: () => [{}, true]
8422
8381
  }
8423
8382
  }
8424
8383
  })
@@ -8448,8 +8407,7 @@ export const isLessThanOrEqualToBigInt: (
8448
8407
  id: "effect/schema/isLessThanOrEqualToBigInt",
8449
8408
  payload: { maximum: encoded }
8450
8409
  },
8451
- toJsonSchema: () => [{}, true],
8452
- toCode: () => ({ runtime: `Schema.isLessThanOrEqualToBigInt(${format(maximum)})` })
8410
+ toJsonSchema: () => [{}, true]
8453
8411
  }
8454
8412
  }
8455
8413
  })
@@ -8488,12 +8446,7 @@ export const isBetweenBigInt: (options: {
8488
8446
  id: "effect/schema/isBetweenBigInt",
8489
8447
  payload
8490
8448
  },
8491
- toJsonSchema: () => [{}, true],
8492
- toCode: () => ({
8493
- runtime: `Schema.isBetweenBigInt({ minimum: ${format(options.minimum)}, maximum: ${
8494
- format(options.maximum)
8495
- }, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })`
8496
- })
8449
+ toJsonSchema: () => [{}, true]
8497
8450
  }
8498
8451
  }
8499
8452
  })
@@ -8557,7 +8510,6 @@ function makeIsMinLength(minLength: number, minCodePoints: number, annotations?:
8557
8510
  : type === undefined
8558
8511
  ? [{ minLength: minCodePoints, minItems: minLength }, true]
8559
8512
  : [{}, true],
8560
- toCode: () => ({ runtime: `Schema.isMinLength(${minLength})` }),
8561
8513
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
8562
8514
  arbitraryConstraint: {
8563
8515
  minLength
@@ -8630,7 +8582,6 @@ export function isMaxLength(maxLength: number, annotations?: Annotations.Filter)
8630
8582
  : type === undefined
8631
8583
  ? [{ maxLength, maxItems: maxLength }, true]
8632
8584
  : [{}, true],
8633
- toCode: () => ({ runtime: `Schema.isMaxLength(${maxLength})` }),
8634
8585
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
8635
8586
  arbitraryConstraint: {
8636
8587
  maxLength
@@ -8692,7 +8643,6 @@ export function isBetweenLength(minimum: number, maximum: number, annotations?:
8692
8643
  maxItems: maximum
8693
8644
  }, true]
8694
8645
  : [{}, true],
8695
- toCode: () => ({ runtime: `Schema.isBetweenLength(${minimum}, ${maximum})` }),
8696
8646
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
8697
8647
  arbitraryConstraint: {
8698
8648
  minLength: minimum,
@@ -8735,7 +8685,6 @@ export function isMinCodePoints(minCodePoints: number, annotations?: Annotations
8735
8685
  payload: { minCodePoints }
8736
8686
  },
8737
8687
  toJsonSchema: () => ({ minLength: minCodePoints }),
8738
- toCode: () => ({ runtime: `Schema.isMinCodePoints(${minCodePoints})` }),
8739
8688
  arbitraryConstraint: { minCodePoints },
8740
8689
  ...annotations
8741
8690
  }
@@ -8774,7 +8723,6 @@ export function isMaxCodePoints(maxCodePoints: number, annotations?: Annotations
8774
8723
  payload: { maxCodePoints }
8775
8724
  },
8776
8725
  toJsonSchema: () => ({ maxLength: maxCodePoints }),
8777
- toCode: () => ({ runtime: `Schema.isMaxCodePoints(${maxCodePoints})` }),
8778
8726
  arbitraryConstraint: { maxCodePoints },
8779
8727
  ...annotations
8780
8728
  }
@@ -8819,7 +8767,6 @@ export function isBetweenCodePoints(minimum: number, maximum: number, annotation
8819
8767
  payload: { minimum, maximum }
8820
8768
  },
8821
8769
  toJsonSchema: () => ({ allOf: [{ minLength: minimum }, { maxLength: maximum }] }),
8822
- toCode: () => ({ runtime: `Schema.isBetweenCodePoints(${minimum}, ${maximum})` }),
8823
8770
  arbitraryConstraint: { minCodePoints: minimum, maxCodePoints: maximum },
8824
8771
  ...annotations
8825
8772
  }
@@ -8874,7 +8821,6 @@ export function isMinSize(minSize: number, annotations?: Annotations.Filter) {
8874
8821
  payload: { minSize }
8875
8822
  },
8876
8823
  toJsonSchema: () => [{}, true],
8877
- toCode: () => ({ runtime: `Schema.isMinSize(${minSize})` }),
8878
8824
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
8879
8825
  arbitraryConstraint: {
8880
8826
  minSize
@@ -8915,7 +8861,6 @@ export function isMaxSize(maxSize: number, annotations?: Annotations.Filter) {
8915
8861
  payload: { maxSize }
8916
8862
  },
8917
8863
  toJsonSchema: () => [{}, true],
8918
- toCode: () => ({ runtime: `Schema.isMaxSize(${maxSize})` }),
8919
8864
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
8920
8865
  arbitraryConstraint: {
8921
8866
  maxSize
@@ -8960,7 +8905,6 @@ export function isBetweenSize(minimum: number, maximum: number, annotations?: An
8960
8905
  payload: { minimum, maximum }
8961
8906
  },
8962
8907
  toJsonSchema: () => [{}, true],
8963
- toCode: () => ({ runtime: `Schema.isBetweenSize(${minimum}, ${maximum})` }),
8964
8908
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
8965
8909
  arbitraryConstraint: {
8966
8910
  minSize: minimum,
@@ -8972,8 +8916,7 @@ export function isBetweenSize(minimum: number, maximum: number, annotations?: An
8972
8916
  }
8973
8917
  /**
8974
8918
  * Validates that an object contains at least the specified number of
8975
- * properties. This includes both string and symbol keys when counting
8976
- * properties.
8919
+ * own enumerable properties, including both string and symbol keys.
8977
8920
  *
8978
8921
  * **Details**
8979
8922
  *
@@ -8997,7 +8940,7 @@ export function isBetweenSize(minimum: number, maximum: number, annotations?: An
8997
8940
  export function isMinProperties(minProperties: number, annotations?: Annotations.Filter) {
8998
8941
  minProperties = normalizeCardinality(minProperties)
8999
8942
  return makeFilter<object>(
9000
- (input) => Reflect.ownKeys(input).length >= minProperties,
8943
+ (input) => InternalRecord.ownEnumerableKeys(input).length >= minProperties,
9001
8944
  {
9002
8945
  expected: `a value with at least ${minProperties === 1 ? "1 entry" : `${minProperties} entries`}`,
9003
8946
  representation: {
@@ -9005,7 +8948,6 @@ export function isMinProperties(minProperties: number, annotations?: Annotations
9005
8948
  payload: { minProperties }
9006
8949
  },
9007
8950
  toJsonSchema: ({ type }) => type === "object" ? { minProperties } : [{ minProperties }, true],
9008
- toCode: () => ({ runtime: `Schema.isMinProperties(${minProperties})` }),
9009
8951
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
9010
8952
  arbitraryConstraint: {
9011
8953
  minProperties
@@ -9015,8 +8957,8 @@ export function isMinProperties(minProperties: number, annotations?: Annotations
9015
8957
  )
9016
8958
  }
9017
8959
  /**
9018
- * Validates that an object contains at most the specified number of properties.
9019
- * This includes both string and symbol keys when counting properties.
8960
+ * Validates that an object contains at most the specified number of own
8961
+ * enumerable properties, including both string and symbol keys.
9020
8962
  *
9021
8963
  * **Details**
9022
8964
  *
@@ -9040,7 +8982,7 @@ export function isMinProperties(minProperties: number, annotations?: Annotations
9040
8982
  export function isMaxProperties(maxProperties: number, annotations?: Annotations.Filter) {
9041
8983
  maxProperties = normalizeCardinality(maxProperties)
9042
8984
  return makeFilter<object>(
9043
- (input) => Reflect.ownKeys(input).length <= maxProperties,
8985
+ (input) => InternalRecord.ownEnumerableKeys(input).length <= maxProperties,
9044
8986
  {
9045
8987
  expected: `a value with at most ${maxProperties === 1 ? "1 entry" : `${maxProperties} entries`}`,
9046
8988
  representation: {
@@ -9048,7 +8990,6 @@ export function isMaxProperties(maxProperties: number, annotations?: Annotations
9048
8990
  payload: { maxProperties }
9049
8991
  },
9050
8992
  toJsonSchema: ({ type }) => type === "object" ? { maxProperties } : [{ maxProperties }, true],
9051
- toCode: () => ({ runtime: `Schema.isMaxProperties(${maxProperties})` }),
9052
8993
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
9053
8994
  arbitraryConstraint: {
9054
8995
  maxProperties
@@ -9058,8 +8999,8 @@ export function isMaxProperties(maxProperties: number, annotations?: Annotations
9058
8999
  )
9059
9000
  }
9060
9001
  /**
9061
- * Validates that an object contains between `minimum` and `maximum` properties (inclusive).
9062
- * This includes both string and symbol keys when counting properties.
9002
+ * Validates that an object contains between `minimum` and `maximum` own
9003
+ * enumerable properties (inclusive), including both string and symbol keys.
9063
9004
  *
9064
9005
  * **Details**
9065
9006
  *
@@ -9084,7 +9025,10 @@ export function isBetweenProperties(minimum: number, maximum: number, annotation
9084
9025
  minimum = normalizeCardinality(minimum)
9085
9026
  maximum = normalizeCardinality(maximum)
9086
9027
  return makeFilter<object>(
9087
- (input) => Reflect.ownKeys(input).length >= minimum && Reflect.ownKeys(input).length <= maximum,
9028
+ (input) => {
9029
+ const size = InternalRecord.ownEnumerableKeys(input).length
9030
+ return size >= minimum && size <= maximum
9031
+ },
9088
9032
  {
9089
9033
  expected: minimum === maximum
9090
9034
  ? `a value with exactly ${minimum === 1 ? "1 entry" : `${minimum} entries`}`
@@ -9098,7 +9042,6 @@ export function isBetweenProperties(minimum: number, maximum: number, annotation
9098
9042
  type === "object"
9099
9043
  ? { minProperties: minimum, maxProperties: maximum }
9100
9044
  : [{ minProperties: minimum, maxProperties: maximum }, true],
9101
- toCode: () => ({ runtime: `Schema.isBetweenProperties(${minimum}, ${maximum})` }),
9102
9045
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
9103
9046
  arbitraryConstraint: {
9104
9047
  minProperties: minimum,
@@ -9109,13 +9052,13 @@ export function isBetweenProperties(minimum: number, maximum: number, annotation
9109
9052
  )
9110
9053
  }
9111
9054
  /**
9112
- * Validates that every own property key of an object satisfies the encoded side
9055
+ * Validates that every own enumerable property key of an object satisfies the encoded side
9113
9056
  * of the provided key schema.
9114
9057
  *
9115
9058
  * **Details**
9116
9059
  *
9117
- * This check uses `Reflect.ownKeys`, so symbol keys are validated in addition to
9118
- * string property names.
9060
+ * Checks both string and symbol keys. Non-enumerable and inherited properties
9061
+ * are ignored.
9119
9062
  *
9120
9063
  * JSON Schema:
9121
9064
  * This check corresponds to `propertyNames` in JSON Schema. Effect checks the
@@ -9132,7 +9075,7 @@ export function isPropertyNames(keySchema: Constraint, annotations?: Annotations
9132
9075
  const parser = SchemaParser._issue(propertyNames.ast)
9133
9076
  return makeFilter<object>(
9134
9077
  (input, ast, options) => {
9135
- const keys = Reflect.ownKeys(input)
9078
+ const keys = InternalRecord.ownEnumerableKeys(input)
9136
9079
  const issues: Array<SchemaIssue.Issue> = []
9137
9080
  for (const key of keys) {
9138
9081
  const issue = parser(key, options)
@@ -9155,7 +9098,6 @@ export function isPropertyNames(keySchema: Constraint, annotations?: Annotations
9155
9098
  },
9156
9099
  toJsonSchema: ({ schemas, type }) =>
9157
9100
  type === "object" ? { propertyNames: schemas[0] } : [{ propertyNames: schemas[0] }, true],
9158
- toCode: ({ schemas }) => ({ runtime: `Schema.isPropertyNames(${schemas[0].runtime})` }),
9159
9101
  [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
9160
9102
  ...annotations
9161
9103
  }
@@ -9187,7 +9129,6 @@ export function isUnique<T>(annotations?: Annotations.Filter) {
9187
9129
  payload: null
9188
9130
  },
9189
9131
  toJsonSchema: () => ({ uniqueItems: true }),
9190
- toCode: () => ({ runtime: "Schema.isUnique()" }),
9191
9132
  arbitraryConstraint: {
9192
9133
  uniqueBy: identity
9193
9134
  },
@@ -9220,7 +9161,6 @@ export function isUniqueKey<Key, Value>(annotations?: Annotations.Filter) {
9220
9161
  id: "effect/schema/isUniqueKey",
9221
9162
  payload: null
9222
9163
  },
9223
- toCode: () => ({ runtime: "Schema.isUniqueKey()" }),
9224
9164
  arbitraryConstraint: {
9225
9165
  uniqueBy: (entry: readonly [Key, Value]) => entry[0]
9226
9166
  },
@@ -9364,12 +9304,6 @@ export function ErrorInstance(options?: ErrorOptions): ErrorInstance {
9364
9304
  id: "effect/schema/Error",
9365
9305
  payload: normalizedOptions ?? null
9366
9306
  },
9367
- toCode: () => ({
9368
- runtime: normalizedOptions !== undefined
9369
- ? `Schema.ErrorInstance(${format(normalizedOptions)})`
9370
- : `Schema.ErrorInstance()`,
9371
- Type: `globalThis.Error`
9372
- }),
9373
9307
  expected: "Error",
9374
9308
  toCodecJson: () => link<globalThis.Error>()(JsonError, SchemaTransformation.errorFromJsonError(normalizedOptions))
9375
9309
  })
@@ -9508,10 +9442,6 @@ export function ReadonlyMap<Key extends Constraint, Value extends Constraint>(
9508
9442
  id: "effect/schema/ReadonlyMap",
9509
9443
  payload: null
9510
9444
  },
9511
- toCode: ({ typeParameters }) => ({
9512
- runtime: `Schema.ReadonlyMap(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
9513
- Type: `globalThis.ReadonlyMap<${typeParameters[0].Type}, ${typeParameters[1].Type}>`
9514
- }),
9515
9445
  expected: "ReadonlyMap",
9516
9446
  toCodec: ([key, value]) =>
9517
9447
  link<globalThis.Map<Key["Encoded"], Value["Encoded"]>>()(
@@ -9586,10 +9516,6 @@ export function ReadonlySet<Value extends Constraint>(value: Value): $ReadonlySe
9586
9516
  id: "effect/schema/ReadonlySet",
9587
9517
  payload: null
9588
9518
  },
9589
- toCode: ({ typeParameters }) => ({
9590
- runtime: `Schema.ReadonlySet(${typeParameters[0].runtime})`,
9591
- Type: `globalThis.ReadonlySet<${typeParameters[0].Type}>`
9592
- }),
9593
9519
  expected: "ReadonlySet",
9594
9520
  toCodec: ([value]) =>
9595
9521
  link<globalThis.Set<Value["Encoded"]>>()(
@@ -9631,10 +9557,6 @@ export const RegExp: RegExp = instanceOf(
9631
9557
  id: "effect/schema/RegExp",
9632
9558
  payload: null
9633
9559
  },
9634
- toCode: () => ({
9635
- runtime: `Schema.RegExp`,
9636
- Type: `globalThis.RegExp`
9637
- }),
9638
9560
  expected: "RegExp",
9639
9561
  toCodecJson: () =>
9640
9562
  link<globalThis.RegExp>()(
@@ -9694,10 +9616,6 @@ export const URL: URL = instanceOf(
9694
9616
  id: "effect/schema/URL",
9695
9617
  payload: null
9696
9618
  },
9697
- toCode: () => ({
9698
- runtime: `Schema.URL`,
9699
- Type: `globalThis.URL`
9700
- }),
9701
9619
  expected: "URL",
9702
9620
  toCodecJson: () =>
9703
9621
  link<globalThis.URL>()(
@@ -9780,10 +9698,6 @@ export const Date: Date = declare(
9780
9698
  id: "effect/schema/Date",
9781
9699
  payload: null
9782
9700
  },
9783
- toCode: () => ({
9784
- runtime: `Schema.Date`,
9785
- Type: `globalThis.Date`
9786
- }),
9787
9701
  expected: "a valid Date",
9788
9702
  toCodecJson: () =>
9789
9703
  link<globalThis.Date>()(
@@ -9954,10 +9868,6 @@ export const File: File = instanceOf(globalThis.File, {
9954
9868
  id: "effect/schema/File",
9955
9869
  payload: null
9956
9870
  },
9957
- toCode: () => ({
9958
- runtime: `Schema.File`,
9959
- Type: `globalThis.File`
9960
- }),
9961
9871
  expected: "File",
9962
9872
  toCodecJson: () =>
9963
9873
  link<globalThis.File>()(
@@ -10035,10 +9945,6 @@ export const FormData: FormData = declare((u): u is globalThis.FormData => u ins
10035
9945
  id: "effect/schema/FormData",
10036
9946
  payload: null
10037
9947
  },
10038
- toCode: () => ({
10039
- runtime: `Schema.FormData`,
10040
- Type: `globalThis.FormData`
10041
- }),
10042
9948
  expected: "FormData",
10043
9949
  toCodecJson: () =>
10044
9950
  link<globalThis.FormData>()(
@@ -10195,10 +10101,6 @@ export const URLSearchParams: URLSearchParams = instanceOf(globalThis.URLSearchP
10195
10101
  id: "effect/schema/URLSearchParams",
10196
10102
  payload: null
10197
10103
  },
10198
- toCode: () => ({
10199
- runtime: `Schema.URLSearchParams`,
10200
- Type: `globalThis.URLSearchParams`
10201
- }),
10202
10104
  expected: "URLSearchParams",
10203
10105
  toCodecJson: () =>
10204
10106
  link<globalThis.URLSearchParams>()(
@@ -10322,7 +10224,7 @@ export interface NumberFromString extends decodeTo<Number, String> {
10322
10224
  * numbers.
10323
10225
  *
10324
10226
  * Encoding:
10325
- * A number is encoded as a `string`.
10227
+ * A number is encoded as a `string`, preserving negative zero as `"-0"`.
10326
10228
  *
10327
10229
  * @stability stable
10328
10230
  * @category schemas
@@ -10351,7 +10253,7 @@ export interface FiniteFromString extends decodeTo<Finite, String> {
10351
10253
  * `-Infinity` values.
10352
10254
  *
10353
10255
  * Encoding:
10354
- * - A finite number is encoded as a `string`.
10256
+ * - A finite number is encoded as a `string`, preserving negative zero as `"-0"`.
10355
10257
  *
10356
10258
  * @stability stable
10357
10259
  * @category schemas
@@ -10468,6 +10370,7 @@ export interface StringFromBase64 extends decodeTo<String, String> {
10468
10370
  *
10469
10371
  * Encoding:
10470
10372
  * - A `string` is encoded as a base64-encoded string.
10373
+ * - Encoding fails if the string contains an unpaired UTF-16 surrogate.
10471
10374
  *
10472
10375
  * @stability stable
10473
10376
  * @category schemas
@@ -10498,6 +10401,7 @@ export interface StringFromBase64Url extends decodeTo<String, String> {
10498
10401
  *
10499
10402
  * Encoding:
10500
10403
  * - A `string` is encoded as a base64 (URL) encoded string.
10404
+ * - Encoding fails if the string contains an unpaired UTF-16 surrogate.
10501
10405
  *
10502
10406
  * @stability stable
10503
10407
  * @category schemas
@@ -10528,6 +10432,7 @@ export interface StringFromHex extends decodeTo<String, String> {
10528
10432
  *
10529
10433
  * Encoding:
10530
10434
  * - A `string` is encoded as a hex string.
10435
+ * - Encoding fails if the string contains an unpaired UTF-16 surrogate.
10531
10436
  *
10532
10437
  * @stability stable
10533
10438
  * @category schemas
@@ -10559,6 +10464,7 @@ export interface StringFromUriComponent extends decodeTo<String, String> {
10559
10464
  *
10560
10465
  * Encoding:
10561
10466
  * - A `string` is encoded as a URI component encoded string.
10467
+ * - Encoding fails if the string contains an unpaired UTF-16 surrogate.
10562
10468
  *
10563
10469
  * **Example** (Decoding URI component strings)
10564
10470
  *
@@ -10704,10 +10610,6 @@ export const Uint8Array: Uint8Array = instanceOf(globalThis.Uint8Array<ArrayBuff
10704
10610
  id: "effect/schema/Uint8Array",
10705
10611
  payload: null
10706
10612
  },
10707
- toCode: () => ({
10708
- runtime: `Schema.Uint8Array`,
10709
- Type: `globalThis.Uint8Array`
10710
- }),
10711
10613
  expected: "Uint8Array",
10712
10614
  toCodecJson: () =>
10713
10615
  link<globalThis.Uint8Array<ArrayBufferLike>>()(
@@ -10950,11 +10852,6 @@ export const BigDecimal: BigDecimal = declare(
10950
10852
  id: "effect/schema/BigDecimal",
10951
10853
  payload: null
10952
10854
  },
10953
- toCode: () => ({
10954
- runtime: `Schema.BigDecimal`,
10955
- Type: `BigDecimal.BigDecimal`,
10956
- importDeclarations: [`import * as BigDecimal from "effect/BigDecimal"`]
10957
- }),
10958
10855
  expected: "BigDecimal",
10959
10856
  toCodecJson: () =>
10960
10857
  link<BigDecimal_.BigDecimal>()(
@@ -11062,11 +10959,6 @@ export const Rational: Rational = declare(
11062
10959
  id: "effect/schema/Rational",
11063
10960
  payload: null
11064
10961
  },
11065
- toCode: () => ({
11066
- runtime: `Schema.Rational`,
11067
- Type: `Rational.Rational`,
11068
- importDeclarations: [`import * as Rational from "effect/Rational"`]
11069
- }),
11070
10962
  expected: "Rational",
11071
10963
  toCodecArbitrary: () =>
11072
10964
  linkDecoding<Rational_.Rational>()(
@@ -11152,11 +11044,6 @@ export const ByteSize: ByteSize = declare(
11152
11044
  id: "effect/schema/ByteSize",
11153
11045
  payload: null
11154
11046
  },
11155
- toCode: () => ({
11156
- runtime: `Schema.ByteSize`,
11157
- Type: `ByteSize.ByteSize`,
11158
- importDeclarations: [`import * as ByteSize from "effect/ByteSize"`]
11159
- }),
11160
11047
  expected: "ByteSize",
11161
11048
  toCodecJson: () =>
11162
11049
  link<ByteSize_.ByteSize>()(
@@ -11302,7 +11189,7 @@ export type CauseReasonIso<E extends Constraint, D extends Constraint> = {
11302
11189
  readonly error: E["Iso"]
11303
11190
  } | {
11304
11191
  readonly _tag: "Die"
11305
- readonly error: D["Iso"]
11192
+ readonly defect: D["Iso"]
11306
11193
  } | {
11307
11194
  readonly _tag: "Interrupt"
11308
11195
  readonly fiberId: number | undefined
@@ -11368,11 +11255,6 @@ export function CauseReason<E extends Constraint, D extends Constraint>(
11368
11255
  id: "effect/schema/CauseReason",
11369
11256
  payload: null
11370
11257
  },
11371
- toCode: ({ typeParameters }) => ({
11372
- runtime: `Schema.CauseReason(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
11373
- Type: `Cause.Failure<${typeParameters[0].Type}, ${typeParameters[1].Type}>`,
11374
- importDeclarations: [`import * as Cause from "effect/Cause"`]
11375
- }),
11376
11258
  expected: "Cause.Failure",
11377
11259
  toCodec: ([error, defect]) =>
11378
11260
  link<Cause_.Reason<E["Encoded"]>>()(
@@ -11489,11 +11371,6 @@ export function Cause<E extends Constraint, D extends Constraint>(error: E, defe
11489
11371
  id: "effect/schema/Cause",
11490
11372
  payload: null
11491
11373
  },
11492
- toCode: ({ typeParameters }) => ({
11493
- runtime: `Schema.Cause(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
11494
- Type: `Cause.Cause<${typeParameters[0].Type}, ${typeParameters[1].Type}>`,
11495
- importDeclarations: [`import * as Cause from "effect/Cause"`]
11496
- }),
11497
11374
  expected: "Cause",
11498
11375
  toCodec: ([error, defect]) =>
11499
11376
  link<Cause_.Cause<E["Encoded"]>>()(
@@ -11516,7 +11393,7 @@ function chunkLink<Value>(values: Schema<ReadonlyArray<Value>>) {
11516
11393
  return link<Chunk_.Chunk<Value>>()(
11517
11394
  values,
11518
11395
  SchemaTransformation.transform({
11519
- decode: Chunk_.fromIterable,
11396
+ decode: Chunk_.fromArrayUnsafe,
11520
11397
  encode: Arr.fromIterable
11521
11398
  })
11522
11399
  )
@@ -11576,7 +11453,7 @@ export function Chunk<Value extends Constraint>(value: Value): Chunk<Value> {
11576
11453
  return Effect.mapBothEager(
11577
11454
  SchemaParser.decodeUnknownEffect(values)(Arr.fromIterable(input), options),
11578
11455
  {
11579
- onSuccess: Chunk_.fromIterable,
11456
+ onSuccess: Chunk_.fromArrayUnsafe,
11580
11457
  onFailure: (issue) => SchemaIssue.makeCompositeAtKey(ast, "values", issue, input, options)
11581
11458
  }
11582
11459
  )
@@ -11589,10 +11466,6 @@ export function Chunk<Value extends Constraint>(value: Value): Chunk<Value> {
11589
11466
  id: "effect/schema/Chunk",
11590
11467
  payload: null
11591
11468
  },
11592
- toCode: ({ typeParameters }) => ({
11593
- runtime: `Schema.Chunk(${typeParameters[0].runtime})`,
11594
- Type: `Chunk.Chunk<${typeParameters[0].Type}>`
11595
- }),
11596
11469
  expected: "Chunk",
11597
11470
  toCodec: ([value]) => chunkLink(ArraySchema(value)),
11598
11471
  toCodecArbitrary: ({ constraint, typeParameters: [value] }) =>
@@ -11777,11 +11650,6 @@ export const DateTimeUtc: DateTimeUtc = declare(
11777
11650
  id: "effect/schema/DateTimeUtc",
11778
11651
  payload: null
11779
11652
  },
11780
- toCode: () => ({
11781
- runtime: `Schema.DateTimeUtc`,
11782
- Type: `DateTime.Utc`,
11783
- importDeclarations: [`import * as DateTime from "effect/DateTime"`]
11784
- }),
11785
11653
  expected: "DateTime.Utc",
11786
11654
  toCodecArbitrary: ({ constraint }) => {
11787
11655
  const [minimum, maximum] = dateTimeArbitraryBounds(
@@ -12007,11 +11875,6 @@ export const TimeZoneOffset: TimeZoneOffset = declare(
12007
11875
  id: "effect/schema/TimeZoneOffset",
12008
11876
  payload: null
12009
11877
  },
12010
- toCode: () => ({
12011
- runtime: `Schema.TimeZoneOffset`,
12012
- Type: `DateTime.TimeZone.Offset`,
12013
- importDeclarations: [`import * as DateTime from "effect/DateTime"`]
12014
- }),
12015
11878
  expected: "DateTime.TimeZone.Offset",
12016
11879
  toCodecJson: () =>
12017
11880
  link<DateTime.TimeZone.Offset>()(
@@ -12052,11 +11915,6 @@ export const TimeZoneNamed: TimeZoneNamed = declare(
12052
11915
  id: "effect/schema/TimeZoneNamed",
12053
11916
  payload: null
12054
11917
  },
12055
- toCode: () => ({
12056
- runtime: `Schema.TimeZoneNamed`,
12057
- Type: `DateTime.TimeZone.Named`,
12058
- importDeclarations: [`import * as DateTime from "effect/DateTime"`]
12059
- }),
12060
11918
  expected: "DateTime.TimeZone.Named",
12061
11919
  toCodecArbitrary: () =>
12062
11920
  linkDecoding<DateTime.TimeZone.Named>()(
@@ -12133,11 +11991,6 @@ export const TimeZone: TimeZone = declare(
12133
11991
  id: "effect/schema/TimeZone",
12134
11992
  payload: null
12135
11993
  },
12136
- toCode: () => ({
12137
- runtime: `Schema.TimeZone`,
12138
- Type: `DateTime.TimeZone`,
12139
- importDeclarations: [`import * as DateTime from "effect/DateTime"`]
12140
- }),
12141
11994
  expected: "DateTime.TimeZone",
12142
11995
  toCodecArbitrary: () =>
12143
11996
  linkDecoding<DateTime.TimeZone>()(
@@ -12218,11 +12071,6 @@ export const DateTimeZoned: DateTimeZoned = declare(
12218
12071
  id: "effect/schema/DateTimeZoned",
12219
12072
  payload: null
12220
12073
  },
12221
- toCode: () => ({
12222
- runtime: `Schema.DateTimeZoned`,
12223
- Type: `DateTime.Zoned`,
12224
- importDeclarations: [`import * as DateTime from "effect/DateTime"`]
12225
- }),
12226
12074
  expected: "DateTime.Zoned",
12227
12075
  toCodecArbitrary: ({ constraint }) => {
12228
12076
  const [minimum, maximum] = dateTimeArbitraryBounds(
@@ -13961,11 +13809,6 @@ export const Duration: Duration = declare(
13961
13809
  id: "effect/schema/Duration",
13962
13810
  payload: null
13963
13811
  },
13964
- toCode: () => ({
13965
- runtime: `Schema.Duration`,
13966
- Type: `Duration.Duration`,
13967
- importDeclarations: [`import * as Duration from "effect/Duration"`]
13968
- }),
13969
13812
  expected: "Duration",
13970
13813
  toCodecJson: () =>
13971
13814
  link<Duration_.Duration>()(
@@ -14562,7 +14405,6 @@ export const DnsRecord: DnsRecord = Union([
14562
14405
  // Match operation parameters rather than object identity. RSA modulus length
14563
14406
  // affects generation only, so it is ignored here as on import.
14564
14407
  interface CryptoAlgorithm {
14565
- readonly _tag?: string
14566
14408
  readonly name: string
14567
14409
  readonly hash?: { readonly name: string }
14568
14410
  readonly modulusLength?: number
@@ -14573,20 +14415,6 @@ const cryptoAlgorithmEquals = (self: CryptoAlgorithm, that: CryptoAlgorithm): bo
14573
14415
  self === that ||
14574
14416
  (self.name === that.name && self.hash?.name === that.hash?.name && self.saltLength === that.saltLength)
14575
14417
 
14576
- const cryptoDigestCode = (hash: { readonly name: string }) => `Digest.${hash.name.toLowerCase().replace("-", "")}`
14577
-
14578
- const cryptoAlgorithmCode = (family: string, algorithm: CryptoAlgorithm): string => {
14579
- if (algorithm.modulusLength === undefined || algorithm.hash === undefined || algorithm._tag === undefined) {
14580
- const code = `${family}.${algorithm.name}`
14581
- return algorithm.hash === undefined ? code : `{ ...${code}, hash: ${cryptoDigestCode(algorithm.hash)} }`
14582
- }
14583
- const factory = algorithm._tag.charAt(0).toLowerCase() + algorithm._tag.slice(1)
14584
- const saltLength = algorithm.saltLength === undefined ? "" : `, saltLength: ${algorithm.saltLength}`
14585
- return `${family}.${factory}({ hash: ${
14586
- cryptoDigestCode(algorithm.hash)
14587
- }, modulusLength: ${algorithm.modulusLength}${saltLength} })`
14588
- }
14589
-
14590
14418
  const cryptoAlgorithmPayload = (algorithm: CryptoAlgorithm): Json => {
14591
14419
  const payload: { [key: string]: Json } = { name: algorithm.name }
14592
14420
  if (algorithm.hash !== undefined) payload.hash = algorithm.hash.name
@@ -14602,7 +14430,6 @@ const declareCryptoKey = <K extends { readonly algorithm: CryptoAlgorithm }>(
14602
14430
  is: (u: unknown) => boolean,
14603
14431
  algorithm: CryptoAlgorithm
14604
14432
  ): declare<K> => {
14605
- const code = cryptoAlgorithmCode(family, algorithm)
14606
14433
  const forbidden = SchemaGetter.forbidden<never, unknown>(() =>
14607
14434
  `Cannot serialize ${family}.${type} values as JSON, use Schema.${name}FromFormat to read and write keys`
14608
14435
  )
@@ -14611,14 +14438,6 @@ const declareCryptoKey = <K extends { readonly algorithm: CryptoAlgorithm }>(
14611
14438
  {
14612
14439
  expected: `${family}.${type} for ${algorithm.name}`,
14613
14440
  representation: { id: `effect/crypto/${name}`, payload: cryptoAlgorithmPayload(algorithm) },
14614
- toCode: () => ({
14615
- runtime: `Schema.${name}(${code})`,
14616
- Type: `${family}.${type}`,
14617
- importDeclarations: [
14618
- `import * as ${family} from "effect/crypto/${family}"`,
14619
- ...(code.includes("Digest.") ? [`import * as Digest from "effect/crypto/Digest"`] : [])
14620
- ]
14621
- }),
14622
14441
  toCodecJson: () => link<K>()(Unknown, { decode: forbidden, encode: forbidden }),
14623
14442
  // Keys have no Arbitrary: linking to `Never` makes derivation fail.
14624
14443
  toCodecArbitrary: () => link<K>()(Never, { decode: forbidden, encode: forbidden }),
@@ -15691,13 +15510,6 @@ export function Exit<
15691
15510
  id: "effect/schema/Exit",
15692
15511
  payload: null
15693
15512
  },
15694
- toCode: ({ typeParameters }) => ({
15695
- runtime: `Schema.Exit(${typeParameters[0].runtime}, ${typeParameters[1].runtime}, ${
15696
- typeParameters[2].runtime
15697
- })`,
15698
- Type: `Exit.Exit<${typeParameters[0].Type}, ${typeParameters[1].Type}, ${typeParameters[2].Type}>`,
15699
- importDeclarations: [`import * as Exit from "effect/Exit"`]
15700
- }),
15701
15513
  expected: "Exit",
15702
15514
  toCodec: ([value, error, defect]) =>
15703
15515
  link<Exit_.Exit<A["Encoded"], E["Encoded"]>>()(
@@ -15975,11 +15787,6 @@ export function Graph<T extends Graph_.Kind, Node extends Constraint, Edge exten
15975
15787
  id: "effect/schema/Graph",
15976
15788
  payload: type
15977
15789
  },
15978
- toCode: ({ typeParameters }) => ({
15979
- runtime: `Schema.Graph(${format(type)}, ${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
15980
- Type: `Graph.Graph<${typeParameters[0].Type}, ${typeParameters[1].Type}, ${format(type)}>`,
15981
- importDeclarations: [`import * as Graph from "effect/Graph"`]
15982
- }),
15983
15790
  expected: `an immutable ${type} Graph`,
15984
15791
  toCodec: ([node, edge]) =>
15985
15792
  link<Graph_.Graph<Node["Encoded"], Edge["Encoded"], T>>()(
@@ -16073,11 +15880,6 @@ export function HashMap<Key extends Constraint, Value extends Constraint>(key: K
16073
15880
  id: "effect/schema/HashMap",
16074
15881
  payload: null
16075
15882
  },
16076
- toCode: ({ typeParameters }) => ({
16077
- runtime: `Schema.HashMap(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
16078
- Type: `HashMap.HashMap<${typeParameters[0].Type}, ${typeParameters[1].Type}>`,
16079
- importDeclarations: [`import * as HashMap from "effect/HashMap"`]
16080
- }),
16081
15883
  expected: "HashMap",
16082
15884
  toCodec: ([key, value]) => hashMapLink(ArraySchema(Tuple([key, value]))),
16083
15885
  toCodecArbitrary: ({ constraint, typeParameters: [key, value] }) =>
@@ -16168,10 +15970,6 @@ export function HashSet<Value extends Constraint>(value: Value): HashSet<Value>
16168
15970
  id: "effect/schema/HashSet",
16169
15971
  payload: null
16170
15972
  },
16171
- toCode: ({ typeParameters }) => ({
16172
- runtime: `Schema.HashSet(${typeParameters[0].runtime})`,
16173
- Type: `HashSet.HashSet<${typeParameters[0].Type}>`
16174
- }),
16175
15973
  expected: "HashSet",
16176
15974
  toCodec: ([value]) => hashSetLink(ArraySchema(value)),
16177
15975
  toCodecArbitrary: ({ constraint, typeParameters: [value] }) =>
@@ -16262,11 +16060,6 @@ export function Option<A extends Constraint>(value: A): Option<A> {
16262
16060
  id: "effect/schema/Option",
16263
16061
  payload: null
16264
16062
  },
16265
- toCode: ({ typeParameters }) => ({
16266
- runtime: `Schema.Option(${typeParameters[0].runtime})`,
16267
- Type: `Option.Option<${typeParameters[0].Type}>`,
16268
- importDeclarations: [`import * as Option from "effect/Option"`]
16269
- }),
16270
16063
  expected: "Option",
16271
16064
  toCodec: ([value]) =>
16272
16065
  link<Option_.Option<A["Encoded"]>>()(
@@ -16401,11 +16194,6 @@ export const Cookie: Cookie = declare(
16401
16194
  id: "effect/http/Cookie",
16402
16195
  payload: null
16403
16196
  },
16404
- toCode: () => ({
16405
- runtime: "Schema.Cookie",
16406
- Type: "Cookies.Cookie",
16407
- importDeclarations: [`import * as Cookies from "effect/http/Cookies"`]
16408
- }),
16409
16197
  expected: "Cookie"
16410
16198
  }
16411
16199
  )
@@ -16445,11 +16233,6 @@ export const Cookies: Cookies = declare(
16445
16233
  id: "effect/http/Cookies",
16446
16234
  payload: null
16447
16235
  },
16448
- toCode: () => ({
16449
- runtime: "Schema.Cookies",
16450
- Type: "Cookies.Cookies",
16451
- importDeclarations: [`import * as Cookies from "effect/http/Cookies"`]
16452
- }),
16453
16236
  expected: "Cookies",
16454
16237
  toCodecJson: () =>
16455
16238
  link<Cookies_.Cookies>()(
@@ -16531,11 +16314,6 @@ export const Headers: Headers = declare(
16531
16314
  id: "effect/http/Headers",
16532
16315
  payload: null
16533
16316
  },
16534
- toCode: () => ({
16535
- runtime: "Schema.Headers",
16536
- Type: "Headers.Headers",
16537
- importDeclarations: [`import * as Headers from "effect/http/Headers"`]
16538
- }),
16539
16317
  expected: "Headers",
16540
16318
  toEquivalence: () => Headers_.Equivalence,
16541
16319
  toCodec: () =>
@@ -16653,6 +16431,66 @@ export const RetryAfterFromString: RetryAfterFromString = String.annotate({
16653
16431
  )
16654
16432
  )
16655
16433
 
16434
+ /**
16435
+ * Type-level representation of {@link LinkHeaderFromString}.
16436
+ *
16437
+ * @stability unstable
16438
+ * @category models
16439
+ * @since 4.1.6
16440
+ */
16441
+ export interface LinkHeaderFromString extends
16442
+ decodeTo<
16443
+ $Array<
16444
+ Struct<{
16445
+ readonly target: String
16446
+ readonly rel: $Array<String>
16447
+ readonly params: $Record<String, String>
16448
+ }>
16449
+ >,
16450
+ String
16451
+ >
16452
+ {
16453
+ readonly "Rebuild": LinkHeaderFromString
16454
+ }
16455
+
16456
+ /**
16457
+ * Schema for `Link` header values (RFC 8288), decoded with
16458
+ * `Headers.parseLink` and encoded with `Headers.formatLink`.
16459
+ *
16460
+ * **When to use**
16461
+ *
16462
+ * Use with `HttpClientResponse.schemaHeaders` or HTTP API header schemas
16463
+ * that carry a `Link` header.
16464
+ *
16465
+ * **Details**
16466
+ *
16467
+ * Decoding never fails on a string, because `Headers.parseLink` is lenient.
16468
+ *
16469
+ * **Example** (Decoding a Link header)
16470
+ *
16471
+ * ```ts
16472
+ * import { Schema } from "effect"
16473
+ *
16474
+ * const links = Schema.decodeSync(Schema.LinkHeaderFromString)('</items?page=2>; rel="next"')
16475
+ * // => [{ target: "/items?page=2", rel: ["next"], params: {} }]
16476
+ * ```
16477
+ *
16478
+ * @stability unstable
16479
+ * @category schemas
16480
+ * @since 4.1.6
16481
+ */
16482
+ export const LinkHeaderFromString: LinkHeaderFromString = String.annotate({
16483
+ expected: "a Link header value"
16484
+ }).pipe(
16485
+ decodeTo(
16486
+ ArraySchema(Struct({ target: String, rel: ArraySchema(String), params: Record(String, String) })),
16487
+ SchemaTransformation.transform<ReadonlyArray<Headers_.Link>, string>({
16488
+ decode: Headers_.parseLink,
16489
+ encode: Headers_.formatLink
16490
+ })
16491
+ )
16492
+ )
16493
+
16656
16494
  /**
16657
16495
  * Type-level representation of {@link UrlParams}.
16658
16496
  *
@@ -16687,11 +16525,6 @@ export const UrlParams: UrlParams = declare(
16687
16525
  id: "effect/http/UrlParams",
16688
16526
  payload: null
16689
16527
  },
16690
- toCode: () => ({
16691
- runtime: "Schema.UrlParams",
16692
- Type: "UrlParams.UrlParams",
16693
- importDeclarations: [`import * as UrlParams from "effect/http/UrlParams"`]
16694
- }),
16695
16528
  expected: "UrlParams",
16696
16529
  toEquivalence: () => UrlParams_.Equivalence,
16697
16530
  toCodec: () =>
@@ -17032,13 +16865,6 @@ export function Redacted<S extends Constraint>(value: S, options?: {
17032
16865
  id: "effect/schema/Redacted",
17033
16866
  payload: normalizedOptions ?? null
17034
16867
  },
17035
- toCode: ({ typeParameters }) => ({
17036
- runtime: normalizedOptions !== undefined
17037
- ? `Schema.Redacted(${typeParameters[0].runtime}, ${format(normalizedOptions)})`
17038
- : `Schema.Redacted(${typeParameters[0].runtime})`,
17039
- Type: `Redacted.Redacted<${typeParameters[0].Type}>`,
17040
- importDeclarations: [`import * as Redacted from "effect/Redacted"`]
17041
- }),
17042
16868
  expected: "Redacted",
17043
16869
  toCodecJson: ([value]) =>
17044
16870
  link<Redacted_.Redacted<S["Encoded"]>>()(
@@ -17180,11 +17006,6 @@ export function Result<A extends Constraint, E extends Constraint>(
17180
17006
  id: "effect/schema/Result",
17181
17007
  payload: null
17182
17008
  },
17183
- toCode: ({ typeParameters }) => ({
17184
- runtime: `Schema.Result(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
17185
- Type: `Result.Result<${typeParameters[0].Type}, ${typeParameters[1].Type}>`,
17186
- importDeclarations: [`import * as Result from "effect/Result"`]
17187
- }),
17188
17009
  expected: "Result",
17189
17010
  toCodec: ([success, failure]) =>
17190
17011
  link<Result_.Result<A["Encoded"], E["Encoded"]>>()(
@@ -17261,11 +17082,6 @@ export const SemVer: SemVer = declare(
17261
17082
  id: "effect/schema/SemVer",
17262
17083
  payload: null
17263
17084
  },
17264
- toCode: () => ({
17265
- runtime: `Schema.SemVer`,
17266
- Type: `SemVer.SemVer`,
17267
- importDeclarations: [`import * as SemVer from "effect/SemVer"`]
17268
- }),
17269
17085
  expected: "SemVer",
17270
17086
  toCodecArbitrary: () =>
17271
17087
  linkDecoding<SemVer_.SemVer>()(
@@ -17341,11 +17157,6 @@ export const SemVerRange: SemVerRange = declare(
17341
17157
  id: "effect/schema/SemVerRange",
17342
17158
  payload: null
17343
17159
  },
17344
- toCode: () => ({
17345
- runtime: `Schema.SemVerRange`,
17346
- Type: `SemVerRange.SemVerRange`,
17347
- importDeclarations: [`import * as SemVerRange from "effect/SemVerRange"`]
17348
- }),
17349
17160
  expected: "SemVerRange",
17350
17161
  toCodecArbitrary: () =>
17351
17162
  linkDecoding<SemVerRange_.SemVerRange>()(
@@ -19111,12 +18922,7 @@ export interface JsonObject {
19111
18922
  * @category schemas
19112
18923
  * @since 4.0.0
19113
18924
  */
19114
- export const Json: Codec<Json> = make(SchemaAST.annotate(SchemaAST.Json, {
19115
- toCode: () => ({
19116
- runtime: "Schema.Json",
19117
- Type: "Schema.Json"
19118
- })
19119
- }))
18925
+ export const Json: Codec<Json> = make(SchemaAST.Json)
19120
18926
  /**
19121
18927
  * Schema for readonly string-keyed records whose values are JSON-compatible.
19122
18928
  *
@@ -19181,12 +18987,7 @@ const JsonError = Struct({
19181
18987
  * @category schemas
19182
18988
  * @since 4.0.0
19183
18989
  */
19184
- export const MutableJson: Codec<MutableJson> = make(SchemaAST.annotate(SchemaAST.MutableJson, {
19185
- toCode: () => ({
19186
- runtime: "Schema.MutableJson",
19187
- Type: "Schema.MutableJson"
19188
- })
19189
- }))
18990
+ export const MutableJson: Codec<MutableJson> = make(SchemaAST.MutableJson)
19190
18991
  /**
19191
18992
  * Resolves the typed annotations from a schema. The term "resolve" (rather
19192
18993
  * than "get") reflects the lookup strategy: if the schema has checks, the
@@ -19214,6 +19015,27 @@ export function resolveAnnotations<S extends Constraint>(
19214
19015
  export function resolveAnnotationsKey<S extends Constraint>(schema: S): Annotations.Key<S["Type"]> | undefined {
19215
19016
  return schema.ast.context?.annotations
19216
19017
  }
19018
+
19019
+ interface DeclarationCodeGenerationAnnotations {
19020
+ /**
19021
+ * Generates runtime and TypeScript source for this declaration.
19022
+ *
19023
+ * @stability experimental
19024
+ * @since 4.0.0
19025
+ */
19026
+ readonly toCode?: SchemaRepresentation.Generation.Declaration | undefined
19027
+ }
19028
+
19029
+ interface FilterCodeGenerationAnnotations {
19030
+ /**
19031
+ * Generates runtime source for this filter.
19032
+ *
19033
+ * @stability experimental
19034
+ * @since 4.0.0
19035
+ */
19036
+ readonly toCode?: SchemaRepresentation.Generation.Check | undefined
19037
+ }
19038
+
19217
19039
  /**
19218
19040
  * The `Annotations` namespace groups all annotation interfaces used to attach
19219
19041
  * metadata to schemas. Annotations control documentation, validation messages,
@@ -19408,7 +19230,7 @@ export declare namespace Annotations {
19408
19230
  * @since 4.0.0
19409
19231
  */
19410
19232
  interface Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>
19411
- extends Bottom<T, TypeParameters>
19233
+ extends Bottom<T, TypeParameters>, DeclarationCodeGenerationAnnotations
19412
19234
  {
19413
19235
  readonly representation?: SchemaRepresentation.RepresentationAnnotation | undefined
19414
19236
  /**
@@ -19470,7 +19292,6 @@ export declare namespace Annotations {
19470
19292
  readonly toCodecArbitrary?: ToArbitrary.Declaration<T, TypeParameters> | undefined
19471
19293
  readonly toEquivalence?: ToEquivalence.Declaration<T, TypeParameters> | undefined
19472
19294
  readonly toFormatter?: ToFormatter.Declaration<T, TypeParameters> | undefined
19473
- readonly toCode?: SchemaRepresentation.Generation.Declaration | undefined
19474
19295
  /**
19475
19296
  * Used to collect sentinels from a Declaration SchemaAST.
19476
19297
  *
@@ -19486,7 +19307,7 @@ export declare namespace Annotations {
19486
19307
  * @category models
19487
19308
  * @since 4.0.0
19488
19309
  */
19489
- interface Filter extends Augment {
19310
+ interface Filter extends Augment, FilterCodeGenerationAnnotations {
19490
19311
  readonly representation?: SchemaRepresentation.CheckRepresentationAnnotation<SchemaAST.AST> | undefined
19491
19312
  /**
19492
19313
  * Compiles this filter to a JSON Schema fragment.
@@ -19508,7 +19329,6 @@ export declare namespace Annotations {
19508
19329
  * @see {@link SchemaRepresentation.ToJsonSchema.CheckOutput} for the result contract
19509
19330
  */
19510
19331
  readonly toJsonSchema?: SchemaRepresentation.ToJsonSchema.Check | undefined
19511
- readonly toCode?: SchemaRepresentation.Generation.Check | undefined
19512
19332
  /**
19513
19333
  * Complete message to use when this filter or refinement fails.
19514
19334
  *