effect 4.0.2 → 4.0.4

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 (389) hide show
  1. package/AGENTS.md +24 -0
  2. package/CLAUDE.md +24 -0
  3. package/ai-docs/package.json +2 -2
  4. package/ai-docs/src/52_graphql/10_basics.ts +111 -0
  5. package/ai-docs/src/52_graphql/20_testing.ts +45 -0
  6. package/ai-docs/src/52_graphql/30_batching.ts +116 -0
  7. package/ai-docs/src/52_graphql/40_aliased-batching.ts +122 -0
  8. package/ai-docs/src/52_graphql/50_errors-and-retries.ts +74 -0
  9. package/ai-docs/src/52_graphql/index.md +6 -0
  10. package/dist/Context.d.ts.map +1 -1
  11. package/dist/Context.js +12 -3
  12. package/dist/Context.js.map +1 -1
  13. package/dist/Crypto.d.ts +33 -5
  14. package/dist/Crypto.d.ts.map +1 -1
  15. package/dist/Crypto.js +8 -2
  16. package/dist/Crypto.js.map +1 -1
  17. package/dist/DateTime.d.ts +9 -6
  18. package/dist/DateTime.d.ts.map +1 -1
  19. package/dist/DateTime.js +9 -6
  20. package/dist/DateTime.js.map +1 -1
  21. package/dist/Duration.d.ts +6 -6
  22. package/dist/Duration.d.ts.map +1 -1
  23. package/dist/Duration.js +27 -8
  24. package/dist/Duration.js.map +1 -1
  25. package/dist/FileSystem.d.ts +44 -2
  26. package/dist/FileSystem.d.ts.map +1 -1
  27. package/dist/FileSystem.js.map +1 -1
  28. package/dist/RequestResolver.d.ts.map +1 -1
  29. package/dist/RequestResolver.js +4 -10
  30. package/dist/RequestResolver.js.map +1 -1
  31. package/dist/Scheduler.d.ts +9 -0
  32. package/dist/Scheduler.d.ts.map +1 -1
  33. package/dist/Scheduler.js +9 -0
  34. package/dist/Scheduler.js.map +1 -1
  35. package/dist/Schema.d.ts +481 -1
  36. package/dist/Schema.d.ts.map +1 -1
  37. package/dist/Schema.js +362 -4
  38. package/dist/Schema.js.map +1 -1
  39. package/dist/SchemaGetter.d.ts +4 -0
  40. package/dist/SchemaGetter.d.ts.map +1 -1
  41. package/dist/SchemaGetter.js +52 -33
  42. package/dist/SchemaGetter.js.map +1 -1
  43. package/dist/Sink.d.ts.map +1 -1
  44. package/dist/Sink.js +38 -17
  45. package/dist/Sink.js.map +1 -1
  46. package/dist/Stdio.d.ts +7 -1
  47. package/dist/Stdio.d.ts.map +1 -1
  48. package/dist/Stdio.js +1 -0
  49. package/dist/Stdio.js.map +1 -1
  50. package/dist/Stream.d.ts +22 -11
  51. package/dist/Stream.d.ts.map +1 -1
  52. package/dist/Stream.js +21 -6
  53. package/dist/Stream.js.map +1 -1
  54. package/dist/Utils.js +8 -3
  55. package/dist/Utils.js.map +1 -1
  56. package/dist/ai/AnthropicStructuredOutput.js +0 -2
  57. package/dist/ai/AnthropicStructuredOutput.js.map +1 -1
  58. package/dist/ai/Chat.d.ts +2 -2
  59. package/dist/ai/Chat.d.ts.map +1 -1
  60. package/dist/ai/LanguageModel.d.ts +38 -7
  61. package/dist/ai/LanguageModel.d.ts.map +1 -1
  62. package/dist/ai/LanguageModel.js +25 -7
  63. package/dist/ai/LanguageModel.js.map +1 -1
  64. package/dist/ai/McpServer.d.ts +61 -0
  65. package/dist/ai/McpServer.d.ts.map +1 -1
  66. package/dist/ai/McpServer.js +196 -44
  67. package/dist/ai/McpServer.js.map +1 -1
  68. package/dist/ai/Prompt.d.ts.map +1 -1
  69. package/dist/ai/Prompt.js +28 -5
  70. package/dist/ai/Prompt.js.map +1 -1
  71. package/dist/ai/Response.d.ts +4 -3
  72. package/dist/ai/Response.d.ts.map +1 -1
  73. package/dist/ai/Response.js.map +1 -1
  74. package/dist/ai/internal/mcpProtocol/v2026_07_28.js +5 -0
  75. package/dist/ai/internal/mcpProtocol/v2026_07_28.js.map +1 -1
  76. package/dist/ai/internal/mcpProtocol.js.map +1 -1
  77. package/dist/ai/internal/mcpRuntime.js +1 -0
  78. package/dist/ai/internal/mcpRuntime.js.map +1 -1
  79. package/dist/cli/CliOutput.d.ts +27 -0
  80. package/dist/cli/CliOutput.d.ts.map +1 -1
  81. package/dist/cli/CliOutput.js +33 -10
  82. package/dist/cli/CliOutput.js.map +1 -1
  83. package/dist/cli/Command.d.ts.map +1 -1
  84. package/dist/cli/Command.js +6 -3
  85. package/dist/cli/Command.js.map +1 -1
  86. package/dist/cli/Completions.d.ts +3 -3
  87. package/dist/cli/Completions.d.ts.map +1 -1
  88. package/dist/cli/Completions.js +8 -5
  89. package/dist/cli/Completions.js.map +1 -1
  90. package/dist/cli/GlobalFlag.d.ts +5 -4
  91. package/dist/cli/GlobalFlag.d.ts.map +1 -1
  92. package/dist/cli/GlobalFlag.js +3 -3
  93. package/dist/cli/GlobalFlag.js.map +1 -1
  94. package/dist/cli/Prompt.d.ts +17 -1
  95. package/dist/cli/Prompt.d.ts.map +1 -1
  96. package/dist/cli/Prompt.js +119 -114
  97. package/dist/cli/Prompt.js.map +1 -1
  98. package/dist/cli/internal/ansi.d.ts +0 -1
  99. package/dist/cli/internal/ansi.d.ts.map +1 -1
  100. package/dist/cli/internal/ansi.js +20 -3
  101. package/dist/cli/internal/ansi.js.map +1 -1
  102. package/dist/cli/internal/completions/powershell.d.ts +2 -0
  103. package/dist/cli/internal/completions/powershell.d.ts.map +1 -0
  104. package/dist/cli/internal/completions/powershell.js +273 -0
  105. package/dist/cli/internal/completions/powershell.js.map +1 -0
  106. package/dist/cli/internal/completions/zsh.js +3 -2
  107. package/dist/cli/internal/completions/zsh.js.map +1 -1
  108. package/dist/cli/internal/wizard.d.ts +3 -3
  109. package/dist/cli/internal/wizard.d.ts.map +1 -1
  110. package/dist/cli/internal/wizard.js +21 -18
  111. package/dist/cli/internal/wizard.js.map +1 -1
  112. package/dist/cluster/ClusterSchema.d.ts +28 -0
  113. package/dist/cluster/ClusterSchema.d.ts.map +1 -1
  114. package/dist/cluster/ClusterSchema.js +30 -0
  115. package/dist/cluster/ClusterSchema.js.map +1 -1
  116. package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  117. package/dist/cluster/ClusterWorkflowEngine.js +56 -26
  118. package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
  119. package/dist/cluster/MessageStorage.d.ts +18 -3
  120. package/dist/cluster/MessageStorage.d.ts.map +1 -1
  121. package/dist/cluster/MessageStorage.js +31 -11
  122. package/dist/cluster/MessageStorage.js.map +1 -1
  123. package/dist/cluster/Runners.d.ts.map +1 -1
  124. package/dist/cluster/Runners.js +8 -2
  125. package/dist/cluster/Runners.js.map +1 -1
  126. package/dist/cluster/Sharding.d.ts.map +1 -1
  127. package/dist/cluster/Sharding.js +187 -66
  128. package/dist/cluster/Sharding.js.map +1 -1
  129. package/dist/cluster/SqlMessageStorage.d.ts +59 -19
  130. package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
  131. package/dist/cluster/SqlMessageStorage.js +84 -55
  132. package/dist/cluster/SqlMessageStorage.js.map +1 -1
  133. package/dist/cluster/SqlRunnerStorage.d.ts +68 -19
  134. package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
  135. package/dist/cluster/SqlRunnerStorage.js +191 -113
  136. package/dist/cluster/SqlRunnerStorage.js.map +1 -1
  137. package/dist/cluster/internal/entityManager.js +104 -37
  138. package/dist/cluster/internal/entityManager.js.map +1 -1
  139. package/dist/encoding/Sse.d.ts +6 -0
  140. package/dist/encoding/Sse.d.ts.map +1 -1
  141. package/dist/encoding/Sse.js +62 -70
  142. package/dist/encoding/Sse.js.map +1 -1
  143. package/dist/graphql/GraphQL.d.ts +349 -0
  144. package/dist/graphql/GraphQL.d.ts.map +1 -0
  145. package/dist/graphql/GraphQL.js +207 -0
  146. package/dist/graphql/GraphQL.js.map +1 -0
  147. package/dist/graphql/GraphQLClient.d.ts +562 -0
  148. package/dist/graphql/GraphQLClient.d.ts.map +1 -0
  149. package/dist/graphql/GraphQLClient.js +498 -0
  150. package/dist/graphql/GraphQLClient.js.map +1 -0
  151. package/dist/graphql/GraphQLClientError.d.ts +445 -0
  152. package/dist/graphql/GraphQLClientError.d.ts.map +1 -0
  153. package/dist/graphql/GraphQLClientError.js +479 -0
  154. package/dist/graphql/GraphQLClientError.js.map +1 -0
  155. package/dist/graphql/GraphQLGroup.d.ts +118 -0
  156. package/dist/graphql/GraphQLGroup.d.ts.map +1 -0
  157. package/dist/graphql/GraphQLGroup.js +109 -0
  158. package/dist/graphql/GraphQLGroup.js.map +1 -0
  159. package/dist/graphql/GraphQLMiddleware.d.ts +249 -0
  160. package/dist/graphql/GraphQLMiddleware.d.ts.map +1 -0
  161. package/dist/graphql/GraphQLMiddleware.js +130 -0
  162. package/dist/graphql/GraphQLMiddleware.js.map +1 -0
  163. package/dist/graphql/GraphQLProtocol.d.ts +731 -0
  164. package/dist/graphql/GraphQLProtocol.d.ts.map +1 -0
  165. package/dist/graphql/GraphQLProtocol.js +719 -0
  166. package/dist/graphql/GraphQLProtocol.js.map +1 -0
  167. package/dist/graphql/GraphQLResolver.d.ts +453 -0
  168. package/dist/graphql/GraphQLResolver.d.ts.map +1 -0
  169. package/dist/graphql/GraphQLResolver.js +552 -0
  170. package/dist/graphql/GraphQLResolver.js.map +1 -0
  171. package/dist/graphql/index.d.ts +40 -0
  172. package/dist/graphql/index.d.ts.map +1 -0
  173. package/dist/graphql/index.js +41 -0
  174. package/dist/graphql/index.js.map +1 -0
  175. package/dist/http/FindMyWay/internal/router.js +3 -6
  176. package/dist/http/FindMyWay/internal/router.js.map +1 -1
  177. package/dist/http/HttpClient.d.ts +21 -0
  178. package/dist/http/HttpClient.d.ts.map +1 -1
  179. package/dist/http/HttpClient.js +63 -12
  180. package/dist/http/HttpClient.js.map +1 -1
  181. package/dist/http/HttpEffect.d.ts.map +1 -1
  182. package/dist/http/HttpEffect.js +14 -7
  183. package/dist/http/HttpEffect.js.map +1 -1
  184. package/dist/http/HttpMiddleware.d.ts.map +1 -1
  185. package/dist/http/HttpMiddleware.js +31 -32
  186. package/dist/http/HttpMiddleware.js.map +1 -1
  187. package/dist/http/HttpRouter.d.ts +35 -0
  188. package/dist/http/HttpRouter.d.ts.map +1 -1
  189. package/dist/http/HttpRouter.js +35 -0
  190. package/dist/http/HttpRouter.js.map +1 -1
  191. package/dist/http/HttpServerResponse.d.ts +8 -6
  192. package/dist/http/HttpServerResponse.d.ts.map +1 -1
  193. package/dist/http/HttpServerResponse.js +27 -16
  194. package/dist/http/HttpServerResponse.js.map +1 -1
  195. package/dist/http/HttpTraceContext.d.ts.map +1 -1
  196. package/dist/http/HttpTraceContext.js +4 -2
  197. package/dist/http/HttpTraceContext.js.map +1 -1
  198. package/dist/http/Multipart.d.ts.map +1 -1
  199. package/dist/http/Multipart.js +15 -1
  200. package/dist/http/Multipart.js.map +1 -1
  201. package/dist/http-api/HttpApiScalar.d.ts +5 -0
  202. package/dist/http-api/HttpApiScalar.d.ts.map +1 -1
  203. package/dist/http-api/HttpApiScalar.js.map +1 -1
  204. package/dist/internal/dateTime.js +40 -35
  205. package/dist/internal/dateTime.js.map +1 -1
  206. package/dist/internal/effect.js +19 -9
  207. package/dist/internal/effect.js.map +1 -1
  208. package/dist/internal/graphql.d.ts +2 -0
  209. package/dist/internal/graphql.d.ts.map +1 -0
  210. package/dist/internal/graphql.js +195 -0
  211. package/dist/internal/graphql.js.map +1 -0
  212. package/dist/internal/graphqlHeaders.d.ts +4 -0
  213. package/dist/internal/graphqlHeaders.d.ts.map +1 -0
  214. package/dist/internal/graphqlHeaders.js +11 -0
  215. package/dist/internal/graphqlHeaders.js.map +1 -0
  216. package/dist/internal/request.js +20 -1
  217. package/dist/internal/request.js.map +1 -1
  218. package/dist/internal/schema/toCodeDocument.js +4 -1
  219. package/dist/internal/schema/toCodeDocument.js.map +1 -1
  220. package/dist/internal/schema/toJsonSchemaDocument.js +29 -5
  221. package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
  222. package/dist/internal/version.js +1 -1
  223. package/dist/net/AddressResolver.d.ts +145 -0
  224. package/dist/net/AddressResolver.d.ts.map +1 -0
  225. package/dist/net/AddressResolver.js +114 -0
  226. package/dist/net/AddressResolver.js.map +1 -0
  227. package/dist/net/Dns.d.ts +596 -0
  228. package/dist/net/Dns.d.ts.map +1 -0
  229. package/dist/net/Dns.js +549 -0
  230. package/dist/net/Dns.js.map +1 -0
  231. package/dist/net/Host.d.ts +369 -0
  232. package/dist/net/Host.d.ts.map +1 -0
  233. package/dist/net/Host.js +397 -0
  234. package/dist/net/Host.js.map +1 -0
  235. package/dist/net/IpInterface.d.ts +76 -3
  236. package/dist/net/IpInterface.d.ts.map +1 -1
  237. package/dist/net/IpInterface.js +53 -4
  238. package/dist/net/IpInterface.js.map +1 -1
  239. package/dist/net/IpNetwork.d.ts +82 -8
  240. package/dist/net/IpNetwork.d.ts.map +1 -1
  241. package/dist/net/IpNetwork.js +60 -4
  242. package/dist/net/IpNetwork.js.map +1 -1
  243. package/dist/net/NetAddress.d.ts +396 -35
  244. package/dist/net/NetAddress.d.ts.map +1 -1
  245. package/dist/net/NetAddress.js +358 -34
  246. package/dist/net/NetAddress.js.map +1 -1
  247. package/dist/net/index.d.ts +15 -0
  248. package/dist/net/index.d.ts.map +1 -1
  249. package/dist/net/index.js +15 -0
  250. package/dist/net/index.js.map +1 -1
  251. package/dist/observability/OtlpMetrics.d.ts.map +1 -1
  252. package/dist/observability/OtlpMetrics.js +15 -21
  253. package/dist/observability/OtlpMetrics.js.map +1 -1
  254. package/dist/observability/PrometheusMetrics.js +1 -0
  255. package/dist/observability/PrometheusMetrics.js.map +1 -1
  256. package/dist/persistence/PersistedQueue.d.ts +32 -3
  257. package/dist/persistence/PersistedQueue.d.ts.map +1 -1
  258. package/dist/persistence/PersistedQueue.js +75 -16
  259. package/dist/persistence/PersistedQueue.js.map +1 -1
  260. package/dist/rpc/RpcClient.d.ts +22 -6
  261. package/dist/rpc/RpcClient.d.ts.map +1 -1
  262. package/dist/rpc/RpcClient.js +12 -5
  263. package/dist/rpc/RpcClient.js.map +1 -1
  264. package/dist/rpc/RpcServer.d.ts +6 -0
  265. package/dist/rpc/RpcServer.d.ts.map +1 -1
  266. package/dist/rpc/RpcServer.js +78 -29
  267. package/dist/rpc/RpcServer.js.map +1 -1
  268. package/dist/socket/DatagramSocket.d.ts +456 -0
  269. package/dist/socket/DatagramSocket.d.ts.map +1 -0
  270. package/dist/socket/DatagramSocket.js +535 -0
  271. package/dist/socket/DatagramSocket.js.map +1 -0
  272. package/dist/socket/Socket.d.ts +20 -1
  273. package/dist/socket/Socket.d.ts.map +1 -1
  274. package/dist/socket/Socket.js +9 -1
  275. package/dist/socket/Socket.js.map +1 -1
  276. package/dist/socket/index.d.ts +5 -0
  277. package/dist/socket/index.d.ts.map +1 -1
  278. package/dist/socket/index.js +5 -0
  279. package/dist/socket/index.js.map +1 -1
  280. package/dist/sql/Migrator.d.ts.map +1 -1
  281. package/dist/sql/Migrator.js +7 -2
  282. package/dist/sql/Migrator.js.map +1 -1
  283. package/dist/sql/SqlClient.d.ts +7 -1
  284. package/dist/sql/SqlClient.d.ts.map +1 -1
  285. package/dist/sql/SqlClient.js +31 -6
  286. package/dist/sql/SqlClient.js.map +1 -1
  287. package/dist/testing/TestCrypto.d.ts +73 -0
  288. package/dist/testing/TestCrypto.d.ts.map +1 -0
  289. package/dist/testing/TestCrypto.js +87 -0
  290. package/dist/testing/TestCrypto.js.map +1 -0
  291. package/dist/testing/index.d.ts +5 -0
  292. package/dist/testing/index.d.ts.map +1 -1
  293. package/dist/testing/index.js +5 -0
  294. package/dist/testing/index.js.map +1 -1
  295. package/dist/workflow/DurableDeferred.d.ts +54 -0
  296. package/dist/workflow/DurableDeferred.d.ts.map +1 -1
  297. package/dist/workflow/DurableDeferred.js +108 -50
  298. package/dist/workflow/DurableDeferred.js.map +1 -1
  299. package/dist/workflow/WorkflowEngine.d.ts +24 -2
  300. package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
  301. package/dist/workflow/WorkflowEngine.js +13 -3
  302. package/dist/workflow/WorkflowEngine.js.map +1 -1
  303. package/package.json +6 -3
  304. package/src/Context.ts +12 -3
  305. package/src/Crypto.ts +43 -9
  306. package/src/DateTime.ts +9 -6
  307. package/src/Duration.ts +36 -16
  308. package/src/FileSystem.ts +48 -2
  309. package/src/RequestResolver.ts +4 -10
  310. package/src/Scheduler.ts +9 -0
  311. package/src/Schema.ts +677 -5
  312. package/src/SchemaGetter.ts +47 -35
  313. package/src/Sink.ts +45 -18
  314. package/src/Stdio.ts +9 -2
  315. package/src/Stream.ts +44 -15
  316. package/src/Utils.ts +8 -5
  317. package/src/ai/AnthropicStructuredOutput.ts +2 -2
  318. package/src/ai/Chat.ts +2 -2
  319. package/src/ai/LanguageModel.ts +96 -24
  320. package/src/ai/McpServer.ts +288 -94
  321. package/src/ai/Prompt.ts +24 -10
  322. package/src/ai/Response.ts +6 -3
  323. package/src/ai/internal/mcpProtocol/v2026_07_28.ts +5 -0
  324. package/src/ai/internal/mcpProtocol.ts +3 -0
  325. package/src/ai/internal/mcpRuntime.ts +2 -0
  326. package/src/cli/CliOutput.ts +33 -16
  327. package/src/cli/Command.ts +4 -3
  328. package/src/cli/Completions.ts +9 -6
  329. package/src/cli/GlobalFlag.ts +19 -11
  330. package/src/cli/Prompt.ts +159 -149
  331. package/src/cli/internal/ansi.ts +26 -3
  332. package/src/cli/internal/completions/powershell.ts +322 -0
  333. package/src/cli/internal/completions/zsh.ts +4 -2
  334. package/src/cli/internal/wizard.ts +34 -26
  335. package/src/cluster/ClusterSchema.ts +32 -0
  336. package/src/cluster/ClusterWorkflowEngine.ts +64 -36
  337. package/src/cluster/MessageStorage.ts +45 -14
  338. package/src/cluster/Runners.ts +8 -2
  339. package/src/cluster/Sharding.ts +219 -58
  340. package/src/cluster/SqlMessageStorage.ts +118 -84
  341. package/src/cluster/SqlRunnerStorage.ts +224 -128
  342. package/src/cluster/internal/entityManager.ts +151 -55
  343. package/src/encoding/Sse.ts +69 -79
  344. package/src/graphql/GraphQL.ts +494 -0
  345. package/src/graphql/GraphQLClient.ts +912 -0
  346. package/src/graphql/GraphQLClientError.ts +542 -0
  347. package/src/graphql/GraphQLGroup.ts +167 -0
  348. package/src/graphql/GraphQLMiddleware.ts +253 -0
  349. package/src/graphql/GraphQLProtocol.ts +1286 -0
  350. package/src/graphql/GraphQLResolver.ts +1010 -0
  351. package/src/graphql/index.ts +48 -0
  352. package/src/http/FindMyWay/internal/router.ts +4 -7
  353. package/src/http/HttpClient.ts +110 -12
  354. package/src/http/HttpEffect.ts +11 -5
  355. package/src/http/HttpMiddleware.ts +33 -34
  356. package/src/http/HttpRouter.ts +35 -0
  357. package/src/http/HttpServerResponse.ts +28 -16
  358. package/src/http/HttpTraceContext.ts +8 -2
  359. package/src/http/Multipart.ts +17 -1
  360. package/src/http-api/HttpApiScalar.ts +5 -0
  361. package/src/internal/dateTime.ts +13 -10
  362. package/src/internal/effect.ts +22 -15
  363. package/src/internal/graphql.ts +263 -0
  364. package/src/internal/graphqlHeaders.ts +11 -0
  365. package/src/internal/request.ts +31 -3
  366. package/src/internal/schema/toCodeDocument.ts +7 -1
  367. package/src/internal/schema/toJsonSchemaDocument.ts +34 -2
  368. package/src/internal/version.ts +1 -1
  369. package/src/net/AddressResolver.ts +222 -0
  370. package/src/net/Dns.ts +1035 -0
  371. package/src/net/Host.ts +544 -0
  372. package/src/net/IpInterface.ts +117 -7
  373. package/src/net/IpNetwork.ts +116 -17
  374. package/src/net/NetAddress.ts +620 -76
  375. package/src/net/index.ts +18 -0
  376. package/src/observability/OtlpMetrics.ts +12 -23
  377. package/src/observability/PrometheusMetrics.ts +1 -0
  378. package/src/persistence/PersistedQueue.ts +146 -53
  379. package/src/rpc/RpcClient.ts +41 -19
  380. package/src/rpc/RpcServer.ts +115 -40
  381. package/src/socket/DatagramSocket.ts +919 -0
  382. package/src/socket/Socket.ts +28 -2
  383. package/src/socket/index.ts +6 -0
  384. package/src/sql/Migrator.ts +21 -5
  385. package/src/sql/SqlClient.ts +39 -15
  386. package/src/testing/TestCrypto.ts +94 -0
  387. package/src/testing/index.ts +6 -0
  388. package/src/workflow/DurableDeferred.ts +160 -47
  389. package/src/workflow/WorkflowEngine.ts +50 -5
package/dist/Schema.d.ts CHANGED
@@ -30,9 +30,12 @@ import * as HashSet_ from "./HashSet.ts";
30
30
  import * as Cookies_ from "./http/Cookies.ts";
31
31
  import * as Headers_ from "./http/Headers.ts";
32
32
  import * as UrlParams_ from "./http/UrlParams.ts";
33
+ import { NodeInspectSymbol } from "./Inspectable.ts";
33
34
  import { SchemaErrorTypeId } from "./internal/schemaError.ts";
34
35
  import type * as JsonPatch from "./JsonPatch.ts";
35
36
  import type * as JsonSchema from "./JsonSchema.ts";
37
+ import * as Dns_ from "./net/Dns.ts";
38
+ import * as Host_ from "./net/Host.ts";
36
39
  import * as IpInterface_ from "./net/IpInterface.ts";
37
40
  import * as IpNetwork_ from "./net/IpNetwork.ts";
38
41
  import * as NetAddress_ from "./net/NetAddress.ts";
@@ -984,6 +987,14 @@ export declare class SchemaError extends SchemaError_base<{
984
987
  readonly [SchemaErrorTypeId]: typeof SchemaErrorTypeId;
985
988
  constructor(issue: SchemaIssue.Issue);
986
989
  get message(): string;
990
+ toJSON(): {
991
+ _tag: "SchemaError";
992
+ message: string;
993
+ };
994
+ [NodeInspectSymbol](): {
995
+ _tag: "SchemaError";
996
+ message: string;
997
+ };
987
998
  toString(): string;
988
999
  }
989
1000
  /**
@@ -3346,6 +3357,7 @@ export declare namespace StructWithRest {
3346
3357
  */
3347
3358
  type Objects = Constraint & {
3348
3359
  readonly ast: SchemaAST.Objects;
3360
+ readonly Encoded: object;
3349
3361
  };
3350
3362
  /**
3351
3363
  * Readonly list of record schemas that provide the additional index signatures
@@ -3482,6 +3494,13 @@ export interface StructWithRest<S extends StructWithRest.Objects, Records extend
3482
3494
  *
3483
3495
  * **Gotchas**
3484
3496
  *
3497
+ * The base schema must have an object-shaped encoded type. Whole-object
3498
+ * transformations are not supported, even with an empty rest array. Apply
3499
+ * transformations such as `Schema.fromJsonString` to the completed
3500
+ * `StructWithRest` schema instead. Object-shaped encoded types alone do not
3501
+ * guarantee compatibility: unsupported encodings are still rejected at runtime.
3502
+ * Transformations on individual fields remain supported.
3503
+ *
3485
3504
  * TypeScript index signatures also apply to fixed keys. `StructWithRest` does
3486
3505
  * not reject incompatible fixed fields at the call site; use
3487
3506
  * `StructWithRest.ValidateRecords` when you want an explicit type-level
@@ -6092,7 +6111,8 @@ export declare function isMultipleOf(divisor: number, annotations?: Annotations.
6092
6111
  *
6093
6112
  * JSON Schema:
6094
6113
  *
6095
- * This check corresponds to the `type: "integer"` constraint in JSON Schema.
6114
+ * This check corresponds to `type: "integer"` with `minimum: Number.MIN_SAFE_INTEGER`
6115
+ * and `maximum: Number.MAX_SAFE_INTEGER` in JSON Schema.
6096
6116
  *
6097
6117
  * Arbitrary:
6098
6118
  *
@@ -9510,6 +9530,184 @@ export interface SocketAddress extends declare<NetAddress_.SocketAddress> {
9510
9530
  * @since 4.0.0
9511
9531
  */
9512
9532
  export declare const SocketAddress: SocketAddress;
9533
+ /**
9534
+ * Type-level representation of {@link DomainName}.
9535
+ *
9536
+ * @stability experimental
9537
+ * @category models
9538
+ * @since 4.0.0
9539
+ */
9540
+ export interface DomainName extends brand<String, "~effect/net/Host/DomainName"> {
9541
+ readonly "Rebuild": DomainName;
9542
+ }
9543
+ /**
9544
+ * Schema for normalized DNS domain names.
9545
+ *
9546
+ * **Details**
9547
+ *
9548
+ * Only names already in normalized form (lowercase ASCII, with
9549
+ * internationalized labels in `xn--` form) are accepted. Use
9550
+ * {@link DomainNameFromString} to normalize arbitrary input.
9551
+ *
9552
+ * @stability experimental
9553
+ * @category schemas
9554
+ * @since 4.0.0
9555
+ */
9556
+ export declare const DomainName: DomainName;
9557
+ /**
9558
+ * Type-level representation of {@link DomainNameFromString}.
9559
+ *
9560
+ * @stability experimental
9561
+ * @category models
9562
+ * @since 4.0.0
9563
+ */
9564
+ export interface DomainNameFromString extends decodeTo<DomainName, String> {
9565
+ readonly "Rebuild": DomainNameFromString;
9566
+ }
9567
+ /**
9568
+ * Schema for DNS domain names decoded from strings, normalizing case and
9569
+ * converting internationalized names to their ASCII form.
9570
+ *
9571
+ * @stability experimental
9572
+ * @category schemas
9573
+ * @since 4.0.0
9574
+ */
9575
+ export declare const DomainNameFromString: DomainNameFromString;
9576
+ /**
9577
+ * Type-level representation of {@link ScopedIpv6Literal}.
9578
+ *
9579
+ * @stability experimental
9580
+ * @category models
9581
+ * @since 4.0.0
9582
+ */
9583
+ export interface ScopedIpv6Literal extends brand<String, "~effect/net/NetAddress/ScopedIpv6Literal"> {
9584
+ readonly "Rebuild": ScopedIpv6Literal;
9585
+ }
9586
+ /**
9587
+ * Schema for canonical scoped IPv6 literals such as `fe80::1%eth0`.
9588
+ *
9589
+ * @stability experimental
9590
+ * @category schemas
9591
+ * @since 4.0.0
9592
+ */
9593
+ export declare const ScopedIpv6Literal: ScopedIpv6Literal;
9594
+ /**
9595
+ * Type-level representation of {@link ScopedIpv6LiteralFromString}.
9596
+ *
9597
+ * @stability experimental
9598
+ * @category models
9599
+ * @since 4.0.0
9600
+ */
9601
+ export interface ScopedIpv6LiteralFromString extends decodeTo<ScopedIpv6Literal, String> {
9602
+ readonly "Rebuild": ScopedIpv6LiteralFromString;
9603
+ }
9604
+ /**
9605
+ * Schema for scoped IPv6 literals decoded from strings, normalizing the address
9606
+ * and numeric zones.
9607
+ *
9608
+ * @stability experimental
9609
+ * @category schemas
9610
+ * @since 4.0.0
9611
+ */
9612
+ export declare const ScopedIpv6LiteralFromString: ScopedIpv6LiteralFromString;
9613
+ /**
9614
+ * Type-level representation of {@link Host}.
9615
+ *
9616
+ * @stability experimental
9617
+ * @category models
9618
+ * @since 4.0.0
9619
+ */
9620
+ export interface Host extends Union<readonly [IpAddress, ScopedIpv6Literal, DomainName]> {
9621
+ readonly "Rebuild": Host;
9622
+ }
9623
+ /**
9624
+ * Schema for hosts: numeric IP addresses, scoped IPv6 literals, or domain names.
9625
+ *
9626
+ * @stability experimental
9627
+ * @category schemas
9628
+ * @since 4.0.0
9629
+ */
9630
+ export declare const Host: Host;
9631
+ /**
9632
+ * Type-level representation of {@link HostFromString}.
9633
+ *
9634
+ * @stability experimental
9635
+ * @category models
9636
+ * @since 4.0.0
9637
+ */
9638
+ export interface HostFromString extends Union<readonly [IpAddressFromString, ScopedIpv6LiteralFromString, DomainNameFromString]> {
9639
+ readonly "Rebuild": HostFromString;
9640
+ }
9641
+ /**
9642
+ * Schema for hosts decoded from strings. Numeric IP strings decode to IP
9643
+ * addresses; other strings decode to scoped IPv6 literals or domain names.
9644
+ *
9645
+ * @stability experimental
9646
+ * @category schemas
9647
+ * @since 4.0.0
9648
+ */
9649
+ export declare const HostFromString: HostFromString;
9650
+ /**
9651
+ * Type-level representation of {@link HostPort}.
9652
+ *
9653
+ * @stability experimental
9654
+ * @category models
9655
+ * @since 4.0.0
9656
+ */
9657
+ export interface HostPort extends declare<Host_.HostPort> {
9658
+ readonly "Rebuild": HostPort;
9659
+ }
9660
+ /**
9661
+ * Schema for already-constructed unresolved host and port values.
9662
+ *
9663
+ * @stability experimental
9664
+ * @category schemas
9665
+ * @since 4.0.0
9666
+ */
9667
+ export declare const HostPort: HostPort;
9668
+ /**
9669
+ * Type-level representation of {@link HostPortFromString}.
9670
+ *
9671
+ * @stability experimental
9672
+ * @category models
9673
+ * @since 4.0.0
9674
+ */
9675
+ export interface HostPortFromString extends decodeTo<HostPort, String> {
9676
+ readonly "Rebuild": HostPortFromString;
9677
+ }
9678
+ /**
9679
+ * Schema for unresolved endpoints encoded as `host:port` or `[IPv6]:port`
9680
+ * strings.
9681
+ *
9682
+ * @stability experimental
9683
+ * @category schemas
9684
+ * @since 4.0.0
9685
+ */
9686
+ export declare const HostPortFromString: HostPortFromString;
9687
+ /**
9688
+ * Type-level representation of {@link Port}.
9689
+ *
9690
+ * @stability experimental
9691
+ * @category models
9692
+ * @since 4.0.0
9693
+ */
9694
+ export interface Port extends Int {
9695
+ readonly "Rebuild": Port;
9696
+ }
9697
+ /**
9698
+ * Schema for TCP and UDP port numbers from 0 through 65535.
9699
+ *
9700
+ * **Details**
9701
+ *
9702
+ * Port 0 is accepted because it asks the operating system to choose a port
9703
+ * when binding, and it matches the port range of `InetAddress` and `HostPort`.
9704
+ * `Config.Port` accepts only 1 through 65535.
9705
+ *
9706
+ * @stability experimental
9707
+ * @category schemas
9708
+ * @since 4.0.0
9709
+ */
9710
+ export declare const Port: Port;
9513
9711
  /**
9514
9712
  * Type-level representation of {@link Duration}.
9515
9713
  *
@@ -9629,6 +9827,284 @@ export interface DurationFromMillis extends decodeTo<Duration, Number> {
9629
9827
  * @since 3.10.0
9630
9828
  */
9631
9829
  export declare const DurationFromMillis: DurationFromMillis;
9830
+ /**
9831
+ * Type-level representation of {@link DnsRecordType}.
9832
+ *
9833
+ * @stability experimental
9834
+ * @category models
9835
+ * @since 4.0.0
9836
+ */
9837
+ export interface DnsRecordType extends Literals<ReadonlyArray<Dns_.RecordType>> {
9838
+ }
9839
+ /**
9840
+ * Schema for supported DNS record types such as `"A"` or `"SRV"`.
9841
+ *
9842
+ * @stability experimental
9843
+ * @category schemas
9844
+ * @since 4.0.0
9845
+ */
9846
+ export declare const DnsRecordType: DnsRecordType;
9847
+ /**
9848
+ * Type-level representation of {@link DnsARecord}.
9849
+ *
9850
+ * @stability experimental
9851
+ * @category models
9852
+ * @since 4.0.0
9853
+ */
9854
+ export interface DnsARecord extends declare<Dns_.A> {
9855
+ readonly "Rebuild": DnsARecord;
9856
+ }
9857
+ /**
9858
+ * Schema for already-constructed IPv4 address (`A`) DNS records.
9859
+ *
9860
+ * @stability experimental
9861
+ * @category schemas
9862
+ * @since 4.0.0
9863
+ */
9864
+ export declare const DnsARecord: DnsARecord;
9865
+ /**
9866
+ * Type-level representation of {@link DnsAaaaRecord}.
9867
+ *
9868
+ * @stability experimental
9869
+ * @category models
9870
+ * @since 4.0.0
9871
+ */
9872
+ export interface DnsAaaaRecord extends declare<Dns_.Aaaa> {
9873
+ readonly "Rebuild": DnsAaaaRecord;
9874
+ }
9875
+ /**
9876
+ * Schema for already-constructed IPv6 address (`AAAA`) DNS records.
9877
+ *
9878
+ * @stability experimental
9879
+ * @category schemas
9880
+ * @since 4.0.0
9881
+ */
9882
+ export declare const DnsAaaaRecord: DnsAaaaRecord;
9883
+ /**
9884
+ * Type-level representation of {@link DnsCaaRecord}.
9885
+ *
9886
+ * @stability experimental
9887
+ * @category models
9888
+ * @since 4.0.0
9889
+ */
9890
+ export interface DnsCaaRecord extends declare<Dns_.Caa> {
9891
+ readonly "Rebuild": DnsCaaRecord;
9892
+ }
9893
+ /**
9894
+ * Schema for already-constructed certification authority authorization (`CAA`) DNS records.
9895
+ *
9896
+ * @stability experimental
9897
+ * @category schemas
9898
+ * @since 4.0.0
9899
+ */
9900
+ export declare const DnsCaaRecord: DnsCaaRecord;
9901
+ /**
9902
+ * Type-level representation of {@link DnsCnameRecord}.
9903
+ *
9904
+ * @stability experimental
9905
+ * @category models
9906
+ * @since 4.0.0
9907
+ */
9908
+ export interface DnsCnameRecord extends declare<Dns_.Cname> {
9909
+ readonly "Rebuild": DnsCnameRecord;
9910
+ }
9911
+ /**
9912
+ * Schema for already-constructed canonical name (`CNAME`) DNS records.
9913
+ *
9914
+ * @stability experimental
9915
+ * @category schemas
9916
+ * @since 4.0.0
9917
+ */
9918
+ export declare const DnsCnameRecord: DnsCnameRecord;
9919
+ /**
9920
+ * Type-level representation of {@link DnsMxRecord}.
9921
+ *
9922
+ * @stability experimental
9923
+ * @category models
9924
+ * @since 4.0.0
9925
+ */
9926
+ export interface DnsMxRecord extends declare<Dns_.Mx> {
9927
+ readonly "Rebuild": DnsMxRecord;
9928
+ }
9929
+ /**
9930
+ * Schema for already-constructed mail exchange (`MX`) DNS records.
9931
+ *
9932
+ * @stability experimental
9933
+ * @category schemas
9934
+ * @since 4.0.0
9935
+ */
9936
+ export declare const DnsMxRecord: DnsMxRecord;
9937
+ /**
9938
+ * Type-level representation of {@link DnsNaptrRecord}.
9939
+ *
9940
+ * @stability experimental
9941
+ * @category models
9942
+ * @since 4.0.0
9943
+ */
9944
+ export interface DnsNaptrRecord extends declare<Dns_.Naptr> {
9945
+ readonly "Rebuild": DnsNaptrRecord;
9946
+ }
9947
+ /**
9948
+ * Schema for already-constructed naming authority pointer (`NAPTR`) DNS records.
9949
+ *
9950
+ * @stability experimental
9951
+ * @category schemas
9952
+ * @since 4.0.0
9953
+ */
9954
+ export declare const DnsNaptrRecord: DnsNaptrRecord;
9955
+ /**
9956
+ * Type-level representation of {@link DnsNsRecord}.
9957
+ *
9958
+ * @stability experimental
9959
+ * @category models
9960
+ * @since 4.0.0
9961
+ */
9962
+ export interface DnsNsRecord extends declare<Dns_.Ns> {
9963
+ readonly "Rebuild": DnsNsRecord;
9964
+ }
9965
+ /**
9966
+ * Schema for already-constructed name server (`NS`) DNS records.
9967
+ *
9968
+ * @stability experimental
9969
+ * @category schemas
9970
+ * @since 4.0.0
9971
+ */
9972
+ export declare const DnsNsRecord: DnsNsRecord;
9973
+ /**
9974
+ * Type-level representation of {@link DnsPtrRecord}.
9975
+ *
9976
+ * @stability experimental
9977
+ * @category models
9978
+ * @since 4.0.0
9979
+ */
9980
+ export interface DnsPtrRecord extends declare<Dns_.Ptr> {
9981
+ readonly "Rebuild": DnsPtrRecord;
9982
+ }
9983
+ /**
9984
+ * Schema for already-constructed pointer (`PTR`) DNS records.
9985
+ *
9986
+ * @stability experimental
9987
+ * @category schemas
9988
+ * @since 4.0.0
9989
+ */
9990
+ export declare const DnsPtrRecord: DnsPtrRecord;
9991
+ /**
9992
+ * Type-level representation of {@link DnsSoaRecord}.
9993
+ *
9994
+ * @stability experimental
9995
+ * @category models
9996
+ * @since 4.0.0
9997
+ */
9998
+ export interface DnsSoaRecord extends declare<Dns_.Soa> {
9999
+ readonly "Rebuild": DnsSoaRecord;
10000
+ }
10001
+ /**
10002
+ * Schema for already-constructed start of authority (`SOA`) DNS records.
10003
+ *
10004
+ * @stability experimental
10005
+ * @category schemas
10006
+ * @since 4.0.0
10007
+ */
10008
+ export declare const DnsSoaRecord: DnsSoaRecord;
10009
+ /**
10010
+ * Type-level representation of {@link DnsSrvRecord}.
10011
+ *
10012
+ * @stability experimental
10013
+ * @category models
10014
+ * @since 4.0.0
10015
+ */
10016
+ export interface DnsSrvRecord extends declare<Dns_.Srv> {
10017
+ readonly "Rebuild": DnsSrvRecord;
10018
+ }
10019
+ /**
10020
+ * Schema for already-constructed service locator (`SRV`) DNS records.
10021
+ *
10022
+ * @stability experimental
10023
+ * @category schemas
10024
+ * @since 4.0.0
10025
+ */
10026
+ export declare const DnsSrvRecord: DnsSrvRecord;
10027
+ /**
10028
+ * Type-level representation of {@link DnsTlsaRecord}.
10029
+ *
10030
+ * @stability experimental
10031
+ * @category models
10032
+ * @since 4.0.0
10033
+ */
10034
+ export interface DnsTlsaRecord extends declare<Dns_.Tlsa> {
10035
+ readonly "Rebuild": DnsTlsaRecord;
10036
+ }
10037
+ /**
10038
+ * Schema for already-constructed TLS authentication (`TLSA`) DNS records.
10039
+ *
10040
+ * **Details**
10041
+ *
10042
+ * The default JSON serializer encodes the certificate association `data` as a
10043
+ * hex string.
10044
+ *
10045
+ * @stability experimental
10046
+ * @category schemas
10047
+ * @since 4.0.0
10048
+ */
10049
+ export declare const DnsTlsaRecord: DnsTlsaRecord;
10050
+ /**
10051
+ * Type-level representation of {@link DnsTxtRecord}.
10052
+ *
10053
+ * @stability experimental
10054
+ * @category models
10055
+ * @since 4.0.0
10056
+ */
10057
+ export interface DnsTxtRecord extends declare<Dns_.Txt> {
10058
+ readonly "Rebuild": DnsTxtRecord;
10059
+ }
10060
+ /**
10061
+ * Schema for already-constructed text (`TXT`) DNS records.
10062
+ *
10063
+ * @stability experimental
10064
+ * @category schemas
10065
+ * @since 4.0.0
10066
+ */
10067
+ export declare const DnsTxtRecord: DnsTxtRecord;
10068
+ /**
10069
+ * Type-level representation of {@link DnsRecord}.
10070
+ *
10071
+ * @stability experimental
10072
+ * @category models
10073
+ * @since 4.0.0
10074
+ */
10075
+ export interface DnsRecord extends Union<readonly [
10076
+ DnsARecord,
10077
+ DnsAaaaRecord,
10078
+ DnsCaaRecord,
10079
+ DnsCnameRecord,
10080
+ DnsMxRecord,
10081
+ DnsNaptrRecord,
10082
+ DnsNsRecord,
10083
+ DnsPtrRecord,
10084
+ DnsSoaRecord,
10085
+ DnsSrvRecord,
10086
+ DnsTlsaRecord,
10087
+ DnsTxtRecord
10088
+ ]> {
10089
+ readonly "Rebuild": DnsRecord;
10090
+ }
10091
+ /**
10092
+ * Schema for already-constructed DNS records of any supported record type.
10093
+ *
10094
+ * **Details**
10095
+ *
10096
+ * The default JSON serializer encodes records as objects tagged by record type,
10097
+ * with addresses and names as canonical strings, SOA timers as whole seconds,
10098
+ * and TLSA data as hex, such as
10099
+ * `{ "_tag": "SRV", "target": "db.internal", "port": 5432, "priority": 10, "weight": 5 }`.
10100
+ * Decoding accepts only canonical addresses and normalized domain names, and
10101
+ * reports invalid fields with their path.
10102
+ *
10103
+ * @stability experimental
10104
+ * @category schemas
10105
+ * @since 4.0.0
10106
+ */
10107
+ export declare const DnsRecord: DnsRecord;
9632
10108
  /**
9633
10109
  * Type-level representation returned by {@link Exit}.
9634
10110
  *
@@ -10334,6 +10810,10 @@ export interface Class<Self, S extends Constraint & {
10334
10810
  *
10335
10811
  * **Gotchas**
10336
10812
  *
10813
+ * Fields with the same name replace inherited fields. Use this to refine
10814
+ * validation or change encoding. Effect does not check compatibility; the
10815
+ * caller must ensure the replacement preserves the base class contract.
10816
+ *
10337
10817
  * Checks from a `Struct` argument are evaluated against the full subclass
10338
10818
  * value after inherited and extension fields are merged. Object-wide checks
10339
10819
  * such as `isMaxProperties` count inherited fields too.