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
@@ -2264,6 +2264,8 @@ function bracketPathToTokens(bracketPath: string): Array<string | number> {
2264
2264
  .map((part) => (Arr.isCanonicalArrayIndex(part) ? globalThis.Number(part) : part))
2265
2265
  }
2266
2266
 
2267
+ const MAX_ARRAY_HOLES = 20
2268
+
2267
2269
  /**
2268
2270
  * Builds a nested tree object from a list of bracket-path entries.
2269
2271
  *
@@ -2287,6 +2289,10 @@ function bracketPathToTokens(bracketPath: string): Array<string | number> {
2287
2289
  * - `""` → real empty key
2288
2290
  * - Numeric bracket segments become array indices only when they are valid
2289
2291
  * JavaScript array-index strings; otherwise they remain object keys.
2292
+ * - An indexed container becomes an array only when it has at most 20 holes
2293
+ * (missing indices below its highest index). Otherwise it is returned as an
2294
+ * object keyed by the index strings, so untrusted input such as
2295
+ * `a[4294967294]` cannot produce huge sparse arrays.
2290
2296
  * - Duplicate keys for the same path are merged into arrays.
2291
2297
  * - If a structural path conflicts with a previous leaf or a different container
2292
2298
  * type, the later structural path replaces the conflicting value.
@@ -2319,43 +2325,31 @@ export function makeTreeRecord<A>(
2319
2325
  const out: any = {}
2320
2326
  const containers = new WeakSet<object>()
2321
2327
  const duplicates = new WeakSet<object>()
2322
-
2323
- function getOrCreateContainer(self: any, key: PropertyKey, shouldBeArray: boolean): any {
2324
- const current = Object.hasOwn(self, key) ? self[key] : undefined
2325
- if (containers.has(current) && Array.isArray(current) === shouldBeArray) {
2326
- return current
2327
- }
2328
- const container = shouldBeArray ? [] : {}
2329
- containers.add(container)
2330
- InternalRecord.assignProperty(self, key, container)
2331
- return container
2332
- }
2328
+ // Indexed containers are built as plain objects so that large indices never
2329
+ // allocate sparse arrays, and are materialized once all entries are applied
2330
+ const indexed = new Map<object, { readonly parent: any; readonly key: PropertyKey; length: number }>()
2333
2331
 
2334
2332
  bracketPathEntries.forEach(([key, value]) => {
2335
2333
  const tokens = bracketPathToTokens(key)
2336
2334
  let cur: any = out
2337
- tokens.forEach((token, i) => {
2338
- const isLast = i === tokens.length - 1
2339
-
2340
- // We are inside an array and see "[]" (empty token) => append
2341
- if (Array.isArray(cur) && token === "") {
2342
- if (isLast) {
2343
- cur.push(value)
2344
- } else {
2345
- // bracket path: "foo[][bar]" => push a new element and descend into it
2346
- const next = tokens[i + 1]
2347
- const shouldBeArray = typeof next === "number" || next === ""
2348
- const index = cur.length
2349
- cur = getOrCreateContainer(cur, index, shouldBeArray)
2350
- }
2351
- } else if (isLast) {
2352
- // If we're setting a value at a path that already exists
2353
- // convert it to an array to support multiple values for the same key
2354
- const hasOwn = Object.hasOwn(cur, token)
2355
- if (hasOwn && Array.isArray(cur[token]) && (containers.has(cur[token]) || duplicates.has(cur[token]))) {
2356
- cur[token].push(value)
2335
+ for (let i = 0; i < tokens.length; i++) {
2336
+ const state = indexed.get(cur)
2337
+ // Resolve "[]" to the next index before handling leaves or containers
2338
+ const token = tokens[i] === "" && state !== undefined ? state.length : tokens[i]
2339
+ if (state !== undefined && typeof token === "number") {
2340
+ state.length = Math.max(state.length, token + 1)
2341
+ }
2342
+ const hasOwn = Object.hasOwn(cur, token)
2343
+ const current = hasOwn ? cur[token] : undefined
2344
+
2345
+ if (i === tokens.length - 1) {
2346
+ const currentState = indexed.get(current)
2347
+ if (currentState !== undefined) {
2348
+ InternalRecord.assignProperty(current, currentState.length++, value)
2349
+ } else if (duplicates.has(current)) {
2350
+ current.push(value)
2357
2351
  } else if (hasOwn) {
2358
- const values = [cur[token], value]
2352
+ const values = [current, value]
2359
2353
  duplicates.add(values)
2360
2354
  InternalRecord.assignProperty(cur, token, values)
2361
2355
  } else {
@@ -2363,12 +2357,30 @@ export function makeTreeRecord<A>(
2363
2357
  }
2364
2358
  } else {
2365
2359
  const next = tokens[i + 1]
2366
- // if next is a number OR "" (from []), we are building an array
2367
2360
  const shouldBeArray = typeof next === "number" || next === ""
2368
- cur = getOrCreateContainer(cur, token, shouldBeArray)
2361
+ if (containers.has(current) && indexed.has(current) === shouldBeArray) {
2362
+ cur = current
2363
+ } else {
2364
+ const container = {}
2365
+ containers.add(container)
2366
+ if (shouldBeArray) {
2367
+ indexed.set(container, { parent: cur, key: token, length: 0 })
2368
+ }
2369
+ InternalRecord.assignProperty(cur, token, container)
2370
+ cur = container
2371
+ }
2369
2372
  }
2370
- })
2373
+ }
2371
2374
  })
2375
+
2376
+ // Children are created after their parents, so materializing in reverse
2377
+ // creation order replaces every nested container before its parent is copied
2378
+ for (const [builder, { key, length, parent }] of Array.from(indexed).reverse()) {
2379
+ // A later conflicting path may have replaced the container in its parent
2380
+ if (parent[key] === builder && length - Object.keys(builder).length <= MAX_ARRAY_HOLES) {
2381
+ InternalRecord.assignProperty(parent, key, Object.assign(new Array(length), builder))
2382
+ }
2383
+ }
2372
2384
  return out
2373
2385
  }
2374
2386
 
package/src/Sink.ts CHANGED
@@ -2177,13 +2177,24 @@ export const takeWhileFilterEffect = <In, Out, X, E, R>(
2177
2177
  * @since 4.0.0
2178
2178
  */
2179
2179
  export const takeUntil = <In>(predicate: Predicate<In>): Sink<Array<In>, In, In> =>
2180
- suspend(() => {
2181
- let done = false
2182
- return takeWhile((i) => {
2183
- if (done) return false
2184
- done = predicate(i)
2185
- return true
2186
- })
2180
+ fromTransform((upstream) => {
2181
+ const out = Arr.empty<In>()
2182
+ return upstream.pipe(
2183
+ Effect.flatMap((arr) => {
2184
+ for (let i = 0; i < arr.length; i++) {
2185
+ out.push(arr[i])
2186
+ if (predicate(arr[i])) {
2187
+ const leftover: NonEmptyReadonlyArray<In> | undefined = (i + 1) < arr.length
2188
+ ? arr.slice(i + 1) as Arr.NonEmptyArray<In>
2189
+ : undefined
2190
+ return Cause.done([out, leftover] as const)
2191
+ }
2192
+ }
2193
+ return Effect.void
2194
+ }),
2195
+ Effect.forever({ disableYield: true }),
2196
+ Pull.catchDone((end) => Effect.succeed<End<Array<In>, In>>(end ?? [out]))
2197
+ )
2187
2198
  })
2188
2199
 
2189
2200
  /**
@@ -2201,17 +2212,33 @@ export const takeUntil = <In>(predicate: Predicate<In>): Sink<Array<In>, In, In>
2201
2212
  export const takeUntilEffect = <In, E, R>(
2202
2213
  predicate: (input: In) => Effect.Effect<boolean, E, R>
2203
2214
  ): Sink<Array<In>, In, In, E, R> =>
2204
- suspend(() => {
2205
- let done = false
2206
- return takeWhileEffect((input) => {
2207
- if (done) {
2208
- return Effect.succeed(false)
2209
- }
2210
- return Effect.map(predicate(input), (b) => {
2211
- done = b
2212
- return true
2213
- })
2214
- })
2215
+ fromTransform((upstream) => {
2216
+ const out = Arr.empty<In>()
2217
+ let leftover: NonEmptyReadonlyArray<In> | undefined = undefined
2218
+ return upstream.pipe(
2219
+ Effect.flatMap((arr) => {
2220
+ let i = 0
2221
+ return Effect.whileLoop({
2222
+ while: () => i < arr.length,
2223
+ body: () => {
2224
+ const input = arr[i++]
2225
+ return Effect.flatMap(predicate(input), (matched) => {
2226
+ out.push(input)
2227
+ if (!matched) {
2228
+ return Effect.void
2229
+ }
2230
+ if (i < arr.length) {
2231
+ leftover = arr.slice(i) as Arr.NonEmptyArray<In>
2232
+ }
2233
+ return Cause.done()
2234
+ })
2235
+ },
2236
+ step: constVoid
2237
+ })
2238
+ }),
2239
+ Effect.forever({ disableYield: true }),
2240
+ Pull.catchDone(() => Effect.succeed([out, leftover] as const))
2241
+ )
2215
2242
  })
2216
2243
 
2217
2244
  /**
package/src/Stdio.ts CHANGED
@@ -79,6 +79,12 @@ export interface Stdio {
79
79
  * @since 4.0.0
80
80
  */
81
81
  readonly stdoutIsTerminal: Effect.Effect<boolean>
82
+ /**
83
+ * Whether standard error is attached to a terminal.
84
+ *
85
+ * @since 4.0.0
86
+ */
87
+ readonly stderrIsTerminal: Effect.Effect<boolean>
82
88
  stdout(options?: {
83
89
  readonly endOnDone?: boolean | undefined
84
90
  }): Sink.Sink<void, string | Uint8Array, never, PlatformError>
@@ -127,12 +133,13 @@ export const Stdio: Context.Service<Stdio, Stdio> = Context.Service<Stdio>(TypeI
127
133
  */
128
134
  export const make = (
129
135
  options:
130
- & Omit<Stdio, TypeId | "stdinIsTerminal" | "stdoutIsTerminal">
131
- & Partial<Pick<Stdio, "stdinIsTerminal" | "stdoutIsTerminal">>
136
+ & Omit<Stdio, TypeId | "stdinIsTerminal" | "stdoutIsTerminal" | "stderrIsTerminal">
137
+ & Partial<Pick<Stdio, "stdinIsTerminal" | "stdoutIsTerminal" | "stderrIsTerminal">>
132
138
  ): Stdio => ({
133
139
  [TypeId]: TypeId,
134
140
  stdinIsTerminal: Effect.succeed(false),
135
141
  stdoutIsTerminal: Effect.succeed(false),
142
+ stderrIsTerminal: Effect.succeed(false),
136
143
  ...options
137
144
  })
138
145
 
package/src/Stream.ts CHANGED
@@ -20767,6 +20767,9 @@ export const mkUint8Array = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effec
20767
20767
  *
20768
20768
  * See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
20769
20769
  *
20770
+ * When `signal` aborts, the stream is interrupted even if the reader has
20771
+ * stopped pulling, and the `ReadableStream` closes.
20772
+ *
20770
20773
  * **Example** (Converting to a ReadableStream with services)
20771
20774
  *
20772
20775
  * ```ts import.meta.vitest
@@ -20774,7 +20777,7 @@ export const mkUint8Array = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effec
20774
20777
  *
20775
20778
  * const stream = Stream.make(1, 2, 3, 4, 5)
20776
20779
  * const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
20777
- * const values = await Array.fromAsync(readableStream)
20780
+ * const values = await globalThis.Array.fromAsync(readableStream)
20778
20781
  * values // => [ 1, 2, 3, 4, 5 ]
20779
20782
  * ```
20780
20783
  *
@@ -20795,6 +20798,9 @@ export const toReadableStreamWith: {
20795
20798
  *
20796
20799
  * See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
20797
20800
  *
20801
+ * When `signal` aborts, the stream is interrupted even if the reader has
20802
+ * stopped pulling, and the `ReadableStream` closes.
20803
+ *
20798
20804
  * **Example** (Converting to a ReadableStream with services)
20799
20805
  *
20800
20806
  * ```ts import.meta.vitest
@@ -20802,7 +20808,7 @@ export const toReadableStreamWith: {
20802
20808
  *
20803
20809
  * const stream = Stream.make(1, 2, 3, 4, 5)
20804
20810
  * const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
20805
- * const values = await Array.fromAsync(readableStream)
20811
+ * const values = await globalThis.Array.fromAsync(readableStream)
20806
20812
  * values // => [ 1, 2, 3, 4, 5 ]
20807
20813
  * ```
20808
20814
  *
@@ -20812,7 +20818,10 @@ export const toReadableStreamWith: {
20812
20818
  */
20813
20819
  <A, XR>(
20814
20820
  context: Context.Context<XR>,
20815
- options?: { readonly strategy?: QueuingStrategy<A> | undefined }
20821
+ options?: {
20822
+ readonly strategy?: QueuingStrategy<A> | undefined
20823
+ readonly signal?: AbortSignal | undefined
20824
+ }
20816
20825
  ): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
20817
20826
  /**
20818
20827
  * Converts the stream to a `ReadableStream` using the provided services.
@@ -20826,6 +20835,9 @@ export const toReadableStreamWith: {
20826
20835
  *
20827
20836
  * See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
20828
20837
  *
20838
+ * When `signal` aborts, the stream is interrupted even if the reader has
20839
+ * stopped pulling, and the `ReadableStream` closes.
20840
+ *
20829
20841
  * **Example** (Converting to a ReadableStream with services)
20830
20842
  *
20831
20843
  * ```ts import.meta.vitest
@@ -20833,7 +20845,7 @@ export const toReadableStreamWith: {
20833
20845
  *
20834
20846
  * const stream = Stream.make(1, 2, 3, 4, 5)
20835
20847
  * const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
20836
- * const values = await Array.fromAsync(readableStream)
20848
+ * const values = await globalThis.Array.fromAsync(readableStream)
20837
20849
  * values // => [ 1, 2, 3, 4, 5 ]
20838
20850
  * ```
20839
20851
  *
@@ -20844,18 +20856,28 @@ export const toReadableStreamWith: {
20844
20856
  <A, E, XR, R extends XR>(
20845
20857
  self: Stream<A, E, R>,
20846
20858
  context: Context.Context<XR>,
20847
- options?: { readonly strategy?: QueuingStrategy<A> | undefined }
20859
+ options?: {
20860
+ readonly strategy?: QueuingStrategy<A> | undefined
20861
+ readonly signal?: AbortSignal | undefined
20862
+ }
20848
20863
  ): ReadableStream<A>
20849
20864
  } = dual(
20850
20865
  (args) => isStream(args[0]),
20851
20866
  <A, E, XR, R extends XR>(
20852
20867
  self: Stream<A, E, R>,
20853
20868
  context: Context.Context<XR>,
20854
- options?: { readonly strategy?: QueuingStrategy<A> | undefined }
20869
+ options?: {
20870
+ readonly strategy?: QueuingStrategy<A> | undefined
20871
+ readonly signal?: AbortSignal | undefined
20872
+ }
20855
20873
  ): ReadableStream<A> => {
20856
20874
  let currentResolve: (() => void) | undefined = undefined
20857
20875
  let fiber: Fiber.Fiber<void, E> | undefined = undefined
20876
+ let cancelled = false
20858
20877
  const latch = Latch.makeUnsafe(false)
20878
+ const signal = options?.signal
20879
+ // Interrupting the fiber directly also stops a consumer waiting for a pull.
20880
+ const onAbort = () => fiber!.interruptUnsafe()
20859
20881
 
20860
20882
  return new ReadableStream<A>({
20861
20883
  start(controller) {
@@ -20872,12 +20894,18 @@ export const toReadableStreamWith: {
20872
20894
  context
20873
20895
  ))
20874
20896
  fiber.addObserver((exit) => {
20875
- if (exit._tag === "Failure") {
20897
+ signal?.removeEventListener("abort", onAbort)
20898
+ if (cancelled) return
20899
+ if (exit._tag === "Failure" && signal?.aborted !== true) {
20876
20900
  controller.error(Cause.squash(exit.cause))
20877
20901
  } else {
20878
20902
  controller.close()
20879
20903
  }
20880
20904
  })
20905
+ if (signal !== undefined && fiber.pollUnsafe() === undefined) {
20906
+ if (signal.aborted) onAbort()
20907
+ else signal.addEventListener("abort", onAbort, { once: true })
20908
+ }
20881
20909
  },
20882
20910
  pull() {
20883
20911
  return new Promise<void>((resolve) => {
@@ -20887,6 +20915,7 @@ export const toReadableStreamWith: {
20887
20915
  },
20888
20916
  cancel() {
20889
20917
  if (!fiber) return
20918
+ cancelled = true
20890
20919
  return Effect.runPromise(Effect.asVoid(Fiber.interrupt(fiber)))
20891
20920
  }
20892
20921
  }, options?.strategy)
@@ -20906,7 +20935,7 @@ export const toReadableStreamWith: {
20906
20935
  * import { Stream } from "effect"
20907
20936
  *
20908
20937
  * const readableStream = Stream.toReadableStream(Stream.make(1, 2, 3))
20909
- * const values = await Array.fromAsync(readableStream)
20938
+ * const values = await globalThis.Array.fromAsync(readableStream)
20910
20939
  * values // => [ 1, 2, 3 ]
20911
20940
  * ```
20912
20941
  *
@@ -20928,7 +20957,7 @@ export const toReadableStream: {
20928
20957
  * import { Stream } from "effect"
20929
20958
  *
20930
20959
  * const readableStream = Stream.toReadableStream(Stream.make(1, 2, 3))
20931
- * const values = await Array.fromAsync(readableStream)
20960
+ * const values = await globalThis.Array.fromAsync(readableStream)
20932
20961
  * values // => [ 1, 2, 3 ]
20933
20962
  * ```
20934
20963
  *
@@ -20952,7 +20981,7 @@ export const toReadableStream: {
20952
20981
  * import { Stream } from "effect"
20953
20982
  *
20954
20983
  * const readableStream = Stream.toReadableStream(Stream.make(1, 2, 3))
20955
- * const values = await Array.fromAsync(readableStream)
20984
+ * const values = await globalThis.Array.fromAsync(readableStream)
20956
20985
  * values // => [ 1, 2, 3 ]
20957
20986
  * ```
20958
20987
  *
@@ -21132,7 +21161,7 @@ export const toReadableStreamEffect: {
21132
21161
  * const stream = Stream.make(1, 2, 3)
21133
21162
  * const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
21134
21163
  *
21135
- * await Array.fromAsync(iterable) // => [1, 2, 3]
21164
+ * await globalThis.Array.fromAsync(iterable) // => [1, 2, 3]
21136
21165
  * ```
21137
21166
  *
21138
21167
  * @stability stable
@@ -21156,7 +21185,7 @@ export const toAsyncIterableWith: {
21156
21185
  * const stream = Stream.make(1, 2, 3)
21157
21186
  * const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
21158
21187
  *
21159
- * await Array.fromAsync(iterable) // => [1, 2, 3]
21188
+ * await globalThis.Array.fromAsync(iterable) // => [1, 2, 3]
21160
21189
  * ```
21161
21190
  *
21162
21191
  * @stability stable
@@ -21180,7 +21209,7 @@ export const toAsyncIterableWith: {
21180
21209
  * const stream = Stream.make(1, 2, 3)
21181
21210
  * const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
21182
21211
  *
21183
- * await Array.fromAsync(iterable) // => [1, 2, 3]
21212
+ * await globalThis.Array.fromAsync(iterable) // => [1, 2, 3]
21184
21213
  * ```
21185
21214
  *
21186
21215
  * @stability stable
@@ -21282,7 +21311,7 @@ export const toAsyncIterableWith: {
21282
21311
  *
21283
21312
  * const program = Effect.gen(function*() {
21284
21313
  * const iterable = yield* Stream.toAsyncIterableEffect(stream)
21285
- * return yield* Effect.promise(() => Array.fromAsync(iterable))
21314
+ * return yield* Effect.promise(() => globalThis.Array.fromAsync(iterable))
21286
21315
  * })
21287
21316
  *
21288
21317
  * await Effect.runPromise(program) // => [1, 2, 3]
@@ -21308,7 +21337,7 @@ export const toAsyncIterableEffect = <A, E, R>(self: Stream<A, E, R>): Effect.Ef
21308
21337
  *
21309
21338
  * const stream = Stream.make(1, 2, 3)
21310
21339
  *
21311
- * await Array.fromAsync(Stream.toAsyncIterable(stream)) // => [1, 2, 3]
21340
+ * await globalThis.Array.fromAsync(Stream.toAsyncIterable(stream)) // => [1, 2, 3]
21312
21341
  * ```
21313
21342
  *
21314
21343
  * @stability stable
package/src/Utils.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * @since 2.0.0
13
13
  */
14
14
  import type { Kind, TypeLambda } from "./HKT.ts"
15
- import { getStackTraceLimit } from "./internal/stackTraceLimit.ts"
15
+ import { getStackTraceLimit, setStackTraceLimit } from "./internal/stackTraceLimit.ts"
16
16
  import type * as Types from "./Types.ts"
17
17
 
18
18
  /**
@@ -209,10 +209,13 @@ const pickInternalCall = (): <A>(body: () => A) => A => {
209
209
  }
210
210
  }
211
211
 
212
- const isNotOptimizedAway = getStackTraceLimit() !== 0 &&
213
- standard[InternalTypeId](() => new Error().stack)?.includes(InternalTypeId) === true
214
-
215
- return isNotOptimizedAway ? standard[InternalTypeId] : forced[InternalTypeId]
212
+ const limit = getStackTraceLimit()
213
+ if (limit === 0) return forced[InternalTypeId]
214
+ // Only the callback and internal call frames are needed for detection.
215
+ setStackTraceLimit(2)
216
+ const error = standard[InternalTypeId](() => new Error())
217
+ setStackTraceLimit(limit)
218
+ return error.stack?.includes(InternalTypeId) === true ? standard[InternalTypeId] : forced[InternalTypeId]
216
219
  }
217
220
 
218
221
  /** @internal */
@@ -14,8 +14,8 @@ import type * as JsonSchema from "../JsonSchema.ts"
14
14
  import * as Rec from "../Record.ts"
15
15
  import * as Schema from "../Schema.ts"
16
16
  import * as InternalStructuredOutput from "./internal/structured-output.ts"
17
- import * as LanguageModel from "./LanguageModel.ts"
18
- import * as OpenAiStructuredOutput from "./OpenAiStructuredOutput.ts"
17
+ import type * as LanguageModel from "./LanguageModel.ts"
18
+ import type * as OpenAiStructuredOutput from "./OpenAiStructuredOutput.ts"
19
19
 
20
20
  /**
21
21
  * Converts a `Schema.Codec` to Anthropic structured-output JSON Schema and a
package/src/ai/Chat.ts CHANGED
@@ -228,7 +228,7 @@ export interface Chat {
228
228
  <Options extends NoExcessProperties<LanguageModel.GenerateTextOptions<{}>, Options>>(
229
229
  options: Options & { readonly toolkit?: undefined } & LanguageModel.GenerateTextOptions<{}>
230
230
  ): Effect.Effect<
231
- LanguageModel.GenerateTextResponse<{}>,
231
+ LanguageModel.GenerateTextResponse<{}, LanguageModel.ExtractToolParametersModeWithoutToolkit<Options>>,
232
232
  LanguageModel.ExtractError<Options>,
233
233
  LanguageModel.LanguageModel | LanguageModel.ExtractServices<Options>
234
234
  >
@@ -310,7 +310,7 @@ export interface Chat {
310
310
  <Options extends NoExcessProperties<LanguageModel.GenerateTextOptions<{}>, Options>>(
311
311
  options: Options & { readonly toolkit?: undefined } & LanguageModel.GenerateTextOptions<{}>
312
312
  ): Stream.Stream<
313
- Response.StreamPart<{}>,
313
+ Response.StreamPart<{}, LanguageModel.ExtractToolParametersModeWithoutToolkit<Options>>,
314
314
  LanguageModel.ExtractError<Options>,
315
315
  LanguageModel.LanguageModel | LanguageModel.ExtractServices<Options>
316
316
  >