@langchain/core 1.1.32 → 1.1.33-dev-1773709997654

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 (1187) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +12 -22
  2. package/dist/_virtual/_rolldown/runtime.js +6 -11
  3. package/dist/agents.cjs +8 -10
  4. package/dist/agents.js +1 -2
  5. package/dist/caches/index.cjs +11 -12
  6. package/dist/caches/index.cjs.map +1 -1
  7. package/dist/caches/index.js +1 -2
  8. package/dist/caches/index.js.map +1 -1
  9. package/dist/callbacks/base.cjs +10 -11
  10. package/dist/callbacks/base.cjs.map +1 -1
  11. package/dist/callbacks/base.js +1 -2
  12. package/dist/callbacks/base.js.map +1 -1
  13. package/dist/callbacks/dispatch/index.cjs +7 -8
  14. package/dist/callbacks/dispatch/index.cjs.map +1 -1
  15. package/dist/callbacks/dispatch/index.d.ts +0 -2
  16. package/dist/callbacks/dispatch/index.d.ts.map +1 -1
  17. package/dist/callbacks/dispatch/index.js +1 -2
  18. package/dist/callbacks/dispatch/index.js.map +1 -1
  19. package/dist/callbacks/dispatch/web.cjs +3 -4
  20. package/dist/callbacks/dispatch/web.cjs.map +1 -1
  21. package/dist/callbacks/dispatch/web.d.ts +0 -2
  22. package/dist/callbacks/dispatch/web.d.ts.map +1 -1
  23. package/dist/callbacks/dispatch/web.js +1 -2
  24. package/dist/callbacks/dispatch/web.js.map +1 -1
  25. package/dist/callbacks/manager.cjs +18 -19
  26. package/dist/callbacks/manager.cjs.map +1 -1
  27. package/dist/callbacks/manager.js +1 -2
  28. package/dist/callbacks/manager.js.map +1 -1
  29. package/dist/callbacks/promises.cjs +9 -10
  30. package/dist/callbacks/promises.js +1 -2
  31. package/dist/chat_history.cjs +12 -13
  32. package/dist/chat_history.cjs.map +1 -1
  33. package/dist/chat_history.d.ts +0 -2
  34. package/dist/chat_history.d.ts.map +1 -1
  35. package/dist/chat_history.js +1 -2
  36. package/dist/chat_history.js.map +1 -1
  37. package/dist/context.cjs +6 -7
  38. package/dist/context.cjs.map +1 -1
  39. package/dist/context.js +1 -2
  40. package/dist/context.js.map +1 -1
  41. package/dist/document_loaders/base.cjs +8 -10
  42. package/dist/document_loaders/base.cjs.map +1 -1
  43. package/dist/document_loaders/base.js +1 -2
  44. package/dist/document_loaders/base.js.map +1 -1
  45. package/dist/document_loaders/langsmith.cjs +9 -10
  46. package/dist/document_loaders/langsmith.cjs.map +1 -1
  47. package/dist/document_loaders/langsmith.js +1 -2
  48. package/dist/document_loaders/langsmith.js.map +1 -1
  49. package/dist/documents/document.cjs +1 -2
  50. package/dist/documents/document.cjs.map +1 -1
  51. package/dist/documents/document.js +1 -1
  52. package/dist/documents/document.js.map +1 -1
  53. package/dist/documents/index.cjs +10 -11
  54. package/dist/documents/index.js +1 -2
  55. package/dist/documents/transformers.cjs +2 -3
  56. package/dist/documents/transformers.cjs.map +1 -1
  57. package/dist/documents/transformers.js +1 -2
  58. package/dist/documents/transformers.js.map +1 -1
  59. package/dist/embeddings.cjs +9 -10
  60. package/dist/embeddings.cjs.map +1 -1
  61. package/dist/embeddings.js +1 -2
  62. package/dist/embeddings.js.map +1 -1
  63. package/dist/errors/index.cjs +9 -10
  64. package/dist/errors/index.cjs.map +1 -1
  65. package/dist/errors/index.js +1 -2
  66. package/dist/errors/index.js.map +1 -1
  67. package/dist/example_selectors/base.cjs +2 -3
  68. package/dist/example_selectors/base.cjs.map +1 -1
  69. package/dist/example_selectors/base.js +1 -2
  70. package/dist/example_selectors/base.js.map +1 -1
  71. package/dist/example_selectors/conditional.cjs +1 -2
  72. package/dist/example_selectors/conditional.cjs.map +1 -1
  73. package/dist/example_selectors/conditional.js +1 -1
  74. package/dist/example_selectors/index.cjs +12 -13
  75. package/dist/example_selectors/index.js +1 -2
  76. package/dist/example_selectors/length_based.cjs +2 -3
  77. package/dist/example_selectors/length_based.cjs.map +1 -1
  78. package/dist/example_selectors/length_based.js +1 -2
  79. package/dist/example_selectors/length_based.js.map +1 -1
  80. package/dist/example_selectors/semantic_similarity.cjs +3 -4
  81. package/dist/example_selectors/semantic_similarity.cjs.map +1 -1
  82. package/dist/example_selectors/semantic_similarity.js +1 -2
  83. package/dist/example_selectors/semantic_similarity.js.map +1 -1
  84. package/dist/index.cjs +8 -10
  85. package/dist/index.js +1 -2
  86. package/dist/indexing/base.cjs +6 -7
  87. package/dist/indexing/base.cjs.map +1 -1
  88. package/dist/indexing/base.js +1 -2
  89. package/dist/indexing/base.js.map +1 -1
  90. package/dist/indexing/index.cjs +10 -11
  91. package/dist/indexing/index.js +1 -2
  92. package/dist/indexing/record_manager.cjs +2 -3
  93. package/dist/indexing/record_manager.cjs.map +1 -1
  94. package/dist/indexing/record_manager.js +1 -2
  95. package/dist/indexing/record_manager.js.map +1 -1
  96. package/dist/language_models/base.cjs +15 -16
  97. package/dist/language_models/base.cjs.map +1 -1
  98. package/dist/language_models/base.d.ts +0 -2
  99. package/dist/language_models/base.d.ts.map +1 -1
  100. package/dist/language_models/base.js +2 -3
  101. package/dist/language_models/base.js.map +1 -1
  102. package/dist/language_models/chat_models.cjs +26 -27
  103. package/dist/language_models/chat_models.cjs.map +1 -1
  104. package/dist/language_models/chat_models.d.ts +0 -3
  105. package/dist/language_models/chat_models.d.ts.map +1 -1
  106. package/dist/language_models/chat_models.js +1 -2
  107. package/dist/language_models/chat_models.js.map +1 -1
  108. package/dist/language_models/llms.cjs +13 -14
  109. package/dist/language_models/llms.cjs.map +1 -1
  110. package/dist/language_models/llms.d.ts +0 -1
  111. package/dist/language_models/llms.d.ts.map +1 -1
  112. package/dist/language_models/llms.js +1 -2
  113. package/dist/language_models/llms.js.map +1 -1
  114. package/dist/language_models/profile.cjs +8 -10
  115. package/dist/language_models/profile.js +1 -2
  116. package/dist/language_models/structured_output.cjs +19 -20
  117. package/dist/language_models/structured_output.cjs.map +1 -1
  118. package/dist/language_models/structured_output.d.ts +0 -5
  119. package/dist/language_models/structured_output.d.ts.map +1 -1
  120. package/dist/language_models/structured_output.js +1 -2
  121. package/dist/language_models/structured_output.js.map +1 -1
  122. package/dist/language_models/utils.cjs +1 -2
  123. package/dist/language_models/utils.cjs.map +1 -1
  124. package/dist/language_models/utils.js +1 -1
  125. package/dist/load/import_constants.cjs +1 -2
  126. package/dist/load/import_constants.cjs.map +1 -1
  127. package/dist/load/import_constants.js +1 -1
  128. package/dist/load/import_map.cjs +69 -70
  129. package/dist/load/import_map.js +1 -2
  130. package/dist/load/index.cjs +8 -9
  131. package/dist/load/index.cjs.map +1 -1
  132. package/dist/load/index.js +1 -2
  133. package/dist/load/index.js.map +1 -1
  134. package/dist/load/map_keys.cjs +2 -3
  135. package/dist/load/map_keys.cjs.map +1 -1
  136. package/dist/load/map_keys.js +1 -2
  137. package/dist/load/map_keys.js.map +1 -1
  138. package/dist/load/serializable.cjs +10 -11
  139. package/dist/load/serializable.cjs.map +1 -1
  140. package/dist/load/serializable.js +1 -2
  141. package/dist/load/serializable.js.map +1 -1
  142. package/dist/load/validation.cjs +3 -4
  143. package/dist/load/validation.cjs.map +1 -1
  144. package/dist/load/validation.js +3 -3
  145. package/dist/load/validation.js.map +1 -1
  146. package/dist/memory.cjs +8 -10
  147. package/dist/memory.cjs.map +1 -1
  148. package/dist/memory.js +1 -2
  149. package/dist/memory.js.map +1 -1
  150. package/dist/messages/ai.cjs +6 -7
  151. package/dist/messages/ai.cjs.map +1 -1
  152. package/dist/messages/ai.js +1 -2
  153. package/dist/messages/ai.js.map +1 -1
  154. package/dist/messages/base.cjs +8 -9
  155. package/dist/messages/base.cjs.map +1 -1
  156. package/dist/messages/base.js +1 -2
  157. package/dist/messages/base.js.map +1 -1
  158. package/dist/messages/block_translators/anthropic.cjs +2 -3
  159. package/dist/messages/block_translators/anthropic.cjs.map +1 -1
  160. package/dist/messages/block_translators/anthropic.js +1 -2
  161. package/dist/messages/block_translators/anthropic.js.map +1 -1
  162. package/dist/messages/block_translators/bedrock_converse.cjs +2 -3
  163. package/dist/messages/block_translators/bedrock_converse.cjs.map +1 -1
  164. package/dist/messages/block_translators/bedrock_converse.js +1 -2
  165. package/dist/messages/block_translators/bedrock_converse.js.map +1 -1
  166. package/dist/messages/block_translators/data.cjs +3 -4
  167. package/dist/messages/block_translators/data.cjs.map +1 -1
  168. package/dist/messages/block_translators/data.js +1 -2
  169. package/dist/messages/block_translators/data.js.map +1 -1
  170. package/dist/messages/block_translators/deepseek.cjs +2 -3
  171. package/dist/messages/block_translators/deepseek.cjs.map +1 -1
  172. package/dist/messages/block_translators/deepseek.js +1 -2
  173. package/dist/messages/block_translators/deepseek.js.map +1 -1
  174. package/dist/messages/block_translators/google.cjs +2 -3
  175. package/dist/messages/block_translators/google.cjs.map +1 -1
  176. package/dist/messages/block_translators/google.js +1 -2
  177. package/dist/messages/block_translators/google.js.map +1 -1
  178. package/dist/messages/block_translators/google_genai.cjs +2 -3
  179. package/dist/messages/block_translators/google_genai.cjs.map +1 -1
  180. package/dist/messages/block_translators/google_genai.js +1 -2
  181. package/dist/messages/block_translators/google_genai.js.map +1 -1
  182. package/dist/messages/block_translators/google_vertexai.cjs +2 -3
  183. package/dist/messages/block_translators/google_vertexai.cjs.map +1 -1
  184. package/dist/messages/block_translators/google_vertexai.js +1 -2
  185. package/dist/messages/block_translators/google_vertexai.js.map +1 -1
  186. package/dist/messages/block_translators/groq.cjs +2 -3
  187. package/dist/messages/block_translators/groq.cjs.map +1 -1
  188. package/dist/messages/block_translators/groq.js +1 -2
  189. package/dist/messages/block_translators/groq.js.map +1 -1
  190. package/dist/messages/block_translators/index.cjs +11 -12
  191. package/dist/messages/block_translators/index.cjs.map +1 -1
  192. package/dist/messages/block_translators/index.js +1 -2
  193. package/dist/messages/block_translators/index.js.map +1 -1
  194. package/dist/messages/block_translators/ollama.cjs +2 -3
  195. package/dist/messages/block_translators/ollama.cjs.map +1 -1
  196. package/dist/messages/block_translators/ollama.js +1 -2
  197. package/dist/messages/block_translators/ollama.js.map +1 -1
  198. package/dist/messages/block_translators/openai.cjs +29 -4
  199. package/dist/messages/block_translators/openai.cjs.map +1 -1
  200. package/dist/messages/block_translators/openai.js +27 -2
  201. package/dist/messages/block_translators/openai.js.map +1 -1
  202. package/dist/messages/block_translators/utils.cjs +1 -2
  203. package/dist/messages/block_translators/utils.cjs.map +1 -1
  204. package/dist/messages/block_translators/utils.js +1 -1
  205. package/dist/messages/block_translators/xai.cjs +2 -3
  206. package/dist/messages/block_translators/xai.cjs.map +1 -1
  207. package/dist/messages/block_translators/xai.js +1 -2
  208. package/dist/messages/block_translators/xai.js.map +1 -1
  209. package/dist/messages/chat.cjs +2 -3
  210. package/dist/messages/chat.cjs.map +1 -1
  211. package/dist/messages/chat.js +1 -2
  212. package/dist/messages/chat.js.map +1 -1
  213. package/dist/messages/content/data.cjs +1 -2
  214. package/dist/messages/content/data.cjs.map +1 -1
  215. package/dist/messages/content/data.js +1 -1
  216. package/dist/messages/content/index.cjs +3 -4
  217. package/dist/messages/content/index.cjs.map +1 -1
  218. package/dist/messages/content/index.js +1 -2
  219. package/dist/messages/content/index.js.map +1 -1
  220. package/dist/messages/content/multimodal.cjs +1 -2
  221. package/dist/messages/content/multimodal.cjs.map +1 -1
  222. package/dist/messages/content/multimodal.js +1 -1
  223. package/dist/messages/content/tools.cjs +1 -2
  224. package/dist/messages/content/tools.cjs.map +1 -1
  225. package/dist/messages/content/tools.js +1 -1
  226. package/dist/messages/format.cjs +1 -2
  227. package/dist/messages/format.cjs.map +1 -1
  228. package/dist/messages/format.js +1 -1
  229. package/dist/messages/function.cjs +2 -3
  230. package/dist/messages/function.cjs.map +1 -1
  231. package/dist/messages/function.js +1 -2
  232. package/dist/messages/function.js.map +1 -1
  233. package/dist/messages/human.cjs +2 -3
  234. package/dist/messages/human.cjs.map +1 -1
  235. package/dist/messages/human.js +1 -2
  236. package/dist/messages/human.js.map +1 -1
  237. package/dist/messages/index.cjs +22 -23
  238. package/dist/messages/index.js +1 -2
  239. package/dist/messages/message.cjs +1 -2
  240. package/dist/messages/message.cjs.map +1 -1
  241. package/dist/messages/message.js +1 -1
  242. package/dist/messages/metadata.cjs +2 -3
  243. package/dist/messages/metadata.cjs.map +1 -1
  244. package/dist/messages/metadata.js +1 -2
  245. package/dist/messages/metadata.js.map +1 -1
  246. package/dist/messages/modifier.cjs +2 -3
  247. package/dist/messages/modifier.cjs.map +1 -1
  248. package/dist/messages/modifier.js +1 -2
  249. package/dist/messages/modifier.js.map +1 -1
  250. package/dist/messages/system.cjs +2 -3
  251. package/dist/messages/system.cjs.map +1 -1
  252. package/dist/messages/system.js +1 -2
  253. package/dist/messages/system.js.map +1 -1
  254. package/dist/messages/tool.cjs +9 -10
  255. package/dist/messages/tool.cjs.map +1 -1
  256. package/dist/messages/tool.js +1 -2
  257. package/dist/messages/tool.js.map +1 -1
  258. package/dist/messages/transformers.cjs +11 -12
  259. package/dist/messages/transformers.cjs.map +1 -1
  260. package/dist/messages/transformers.js +1 -2
  261. package/dist/messages/transformers.js.map +1 -1
  262. package/dist/messages/utils.cjs +12 -13
  263. package/dist/messages/utils.cjs.map +1 -1
  264. package/dist/messages/utils.js +1 -2
  265. package/dist/messages/utils.js.map +1 -1
  266. package/dist/output_parsers/base.cjs +4 -5
  267. package/dist/output_parsers/base.cjs.map +1 -1
  268. package/dist/output_parsers/base.d.ts +0 -4
  269. package/dist/output_parsers/base.d.ts.map +1 -1
  270. package/dist/output_parsers/base.js +1 -2
  271. package/dist/output_parsers/base.js.map +1 -1
  272. package/dist/output_parsers/bytes.cjs +2 -3
  273. package/dist/output_parsers/bytes.cjs.map +1 -1
  274. package/dist/output_parsers/bytes.js +1 -2
  275. package/dist/output_parsers/bytes.js.map +1 -1
  276. package/dist/output_parsers/index.cjs +18 -19
  277. package/dist/output_parsers/index.js +1 -2
  278. package/dist/output_parsers/json.cjs +5 -6
  279. package/dist/output_parsers/json.cjs.map +1 -1
  280. package/dist/output_parsers/json.d.ts +0 -1
  281. package/dist/output_parsers/json.d.ts.map +1 -1
  282. package/dist/output_parsers/json.js +2 -3
  283. package/dist/output_parsers/json.js.map +1 -1
  284. package/dist/output_parsers/list.cjs +3 -4
  285. package/dist/output_parsers/list.cjs.map +1 -1
  286. package/dist/output_parsers/list.d.ts +0 -1
  287. package/dist/output_parsers/list.d.ts.map +1 -1
  288. package/dist/output_parsers/list.js +1 -2
  289. package/dist/output_parsers/list.js.map +1 -1
  290. package/dist/output_parsers/openai_functions/index.cjs +9 -10
  291. package/dist/output_parsers/openai_functions/index.js +1 -2
  292. package/dist/output_parsers/openai_functions/json_output_functions_parsers.cjs +7 -8
  293. package/dist/output_parsers/openai_functions/json_output_functions_parsers.cjs.map +1 -1
  294. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +0 -1
  295. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +1 -1
  296. package/dist/output_parsers/openai_functions/json_output_functions_parsers.js +1 -2
  297. package/dist/output_parsers/openai_functions/json_output_functions_parsers.js.map +1 -1
  298. package/dist/output_parsers/openai_tools/index.cjs +9 -10
  299. package/dist/output_parsers/openai_tools/index.js +1 -2
  300. package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +7 -8
  301. package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs.map +1 -1
  302. package/dist/output_parsers/openai_tools/json_output_tools_parsers.js +1 -2
  303. package/dist/output_parsers/openai_tools/json_output_tools_parsers.js.map +1 -1
  304. package/dist/output_parsers/standard_schema.cjs +4 -5
  305. package/dist/output_parsers/standard_schema.cjs.map +1 -1
  306. package/dist/output_parsers/standard_schema.js +1 -2
  307. package/dist/output_parsers/standard_schema.js.map +1 -1
  308. package/dist/output_parsers/string.cjs +2 -3
  309. package/dist/output_parsers/string.cjs.map +1 -1
  310. package/dist/output_parsers/string.d.ts +0 -1
  311. package/dist/output_parsers/string.d.ts.map +1 -1
  312. package/dist/output_parsers/string.js +1 -2
  313. package/dist/output_parsers/string.js.map +1 -1
  314. package/dist/output_parsers/structured.cjs +5 -6
  315. package/dist/output_parsers/structured.cjs.map +1 -1
  316. package/dist/output_parsers/structured.js +1 -2
  317. package/dist/output_parsers/structured.js.map +1 -1
  318. package/dist/output_parsers/transform.cjs +6 -7
  319. package/dist/output_parsers/transform.cjs.map +1 -1
  320. package/dist/output_parsers/transform.js +1 -2
  321. package/dist/output_parsers/transform.js.map +1 -1
  322. package/dist/output_parsers/xml.cjs +5 -6
  323. package/dist/output_parsers/xml.cjs.map +1 -1
  324. package/dist/output_parsers/xml.js +1 -2
  325. package/dist/output_parsers/xml.js.map +1 -1
  326. package/dist/outputs.cjs +8 -10
  327. package/dist/outputs.cjs.map +1 -1
  328. package/dist/outputs.js +1 -2
  329. package/dist/outputs.js.map +1 -1
  330. package/dist/prompt_values.cjs +11 -12
  331. package/dist/prompt_values.cjs.map +1 -1
  332. package/dist/prompt_values.js +1 -2
  333. package/dist/prompt_values.js.map +1 -1
  334. package/dist/prompts/base.cjs +2 -3
  335. package/dist/prompts/base.cjs.map +1 -1
  336. package/dist/prompts/base.d.ts +0 -2
  337. package/dist/prompts/base.d.ts.map +1 -1
  338. package/dist/prompts/base.js +1 -2
  339. package/dist/prompts/base.js.map +1 -1
  340. package/dist/prompts/chat.cjs +17 -18
  341. package/dist/prompts/chat.cjs.map +1 -1
  342. package/dist/prompts/chat.d.ts +0 -1
  343. package/dist/prompts/chat.d.ts.map +1 -1
  344. package/dist/prompts/chat.js +1 -2
  345. package/dist/prompts/chat.js.map +1 -1
  346. package/dist/prompts/dict.cjs +3 -4
  347. package/dist/prompts/dict.cjs.map +1 -1
  348. package/dist/prompts/dict.js +1 -2
  349. package/dist/prompts/dict.js.map +1 -1
  350. package/dist/prompts/few_shot.cjs +5 -6
  351. package/dist/prompts/few_shot.cjs.map +1 -1
  352. package/dist/prompts/few_shot.d.ts +0 -1
  353. package/dist/prompts/few_shot.d.ts.map +1 -1
  354. package/dist/prompts/few_shot.js +1 -2
  355. package/dist/prompts/few_shot.js.map +1 -1
  356. package/dist/prompts/image.cjs +4 -5
  357. package/dist/prompts/image.cjs.map +1 -1
  358. package/dist/prompts/image.d.ts +0 -1
  359. package/dist/prompts/image.d.ts.map +1 -1
  360. package/dist/prompts/image.js +1 -2
  361. package/dist/prompts/image.js.map +1 -1
  362. package/dist/prompts/index.cjs +18 -19
  363. package/dist/prompts/index.js +1 -2
  364. package/dist/prompts/pipeline.cjs +3 -4
  365. package/dist/prompts/pipeline.cjs.map +1 -1
  366. package/dist/prompts/pipeline.js +1 -2
  367. package/dist/prompts/pipeline.js.map +1 -1
  368. package/dist/prompts/prompt.cjs +3 -4
  369. package/dist/prompts/prompt.cjs.map +1 -1
  370. package/dist/prompts/prompt.d.ts +0 -1
  371. package/dist/prompts/prompt.d.ts.map +1 -1
  372. package/dist/prompts/prompt.js +1 -2
  373. package/dist/prompts/prompt.js.map +1 -1
  374. package/dist/prompts/serde.d.ts +0 -1
  375. package/dist/prompts/serde.d.ts.map +1 -1
  376. package/dist/prompts/string.cjs +3 -4
  377. package/dist/prompts/string.cjs.map +1 -1
  378. package/dist/prompts/string.js +1 -2
  379. package/dist/prompts/string.js.map +1 -1
  380. package/dist/prompts/structured.cjs +3 -4
  381. package/dist/prompts/structured.cjs.map +1 -1
  382. package/dist/prompts/structured.d.ts +0 -1
  383. package/dist/prompts/structured.d.ts.map +1 -1
  384. package/dist/prompts/structured.js +1 -2
  385. package/dist/prompts/structured.js.map +1 -1
  386. package/dist/prompts/template.cjs +3 -4
  387. package/dist/prompts/template.cjs.map +1 -1
  388. package/dist/prompts/template.d.ts +0 -2
  389. package/dist/prompts/template.d.ts.map +1 -1
  390. package/dist/prompts/template.js +1 -2
  391. package/dist/prompts/template.js.map +1 -1
  392. package/dist/retrievers/document_compressors/index.cjs +8 -10
  393. package/dist/retrievers/document_compressors/index.cjs.map +1 -1
  394. package/dist/retrievers/document_compressors/index.js +1 -2
  395. package/dist/retrievers/document_compressors/index.js.map +1 -1
  396. package/dist/retrievers/index.cjs +11 -12
  397. package/dist/retrievers/index.cjs.map +1 -1
  398. package/dist/retrievers/index.d.ts +0 -1
  399. package/dist/retrievers/index.d.ts.map +1 -1
  400. package/dist/retrievers/index.js +1 -2
  401. package/dist/retrievers/index.js.map +1 -1
  402. package/dist/runnables/base.cjs +32 -36
  403. package/dist/runnables/base.cjs.map +1 -1
  404. package/dist/runnables/base.d.cts.map +1 -1
  405. package/dist/runnables/base.d.ts.map +1 -1
  406. package/dist/runnables/base.js +15 -19
  407. package/dist/runnables/base.js.map +1 -1
  408. package/dist/runnables/branch.cjs +4 -5
  409. package/dist/runnables/branch.cjs.map +1 -1
  410. package/dist/runnables/branch.d.ts +0 -1
  411. package/dist/runnables/branch.d.ts.map +1 -1
  412. package/dist/runnables/branch.js +1 -2
  413. package/dist/runnables/branch.js.map +1 -1
  414. package/dist/runnables/config.cjs +4 -7
  415. package/dist/runnables/config.cjs.map +1 -1
  416. package/dist/runnables/config.js +2 -4
  417. package/dist/runnables/config.js.map +1 -1
  418. package/dist/runnables/graph.cjs +11 -12
  419. package/dist/runnables/graph.cjs.map +1 -1
  420. package/dist/runnables/graph.js +1 -2
  421. package/dist/runnables/graph.js.map +1 -1
  422. package/dist/runnables/graph_mermaid.cjs +2 -3
  423. package/dist/runnables/graph_mermaid.cjs.map +1 -1
  424. package/dist/runnables/graph_mermaid.js +1 -2
  425. package/dist/runnables/graph_mermaid.js.map +1 -1
  426. package/dist/runnables/history.cjs +7 -8
  427. package/dist/runnables/history.cjs.map +1 -1
  428. package/dist/runnables/history.d.ts +0 -2
  429. package/dist/runnables/history.d.ts.map +1 -1
  430. package/dist/runnables/history.js +1 -2
  431. package/dist/runnables/history.js.map +1 -1
  432. package/dist/runnables/index.cjs +15 -16
  433. package/dist/runnables/index.js +1 -2
  434. package/dist/runnables/iter.cjs +4 -5
  435. package/dist/runnables/iter.cjs.map +1 -1
  436. package/dist/runnables/iter.js +1 -2
  437. package/dist/runnables/iter.js.map +1 -1
  438. package/dist/runnables/passthrough.cjs +4 -5
  439. package/dist/runnables/passthrough.cjs.map +1 -1
  440. package/dist/runnables/passthrough.d.ts +0 -1
  441. package/dist/runnables/passthrough.d.ts.map +1 -1
  442. package/dist/runnables/passthrough.js +1 -2
  443. package/dist/runnables/passthrough.js.map +1 -1
  444. package/dist/runnables/router.cjs +3 -4
  445. package/dist/runnables/router.cjs.map +1 -1
  446. package/dist/runnables/router.d.ts +0 -1
  447. package/dist/runnables/router.d.ts.map +1 -1
  448. package/dist/runnables/router.js +1 -2
  449. package/dist/runnables/router.js.map +1 -1
  450. package/dist/runnables/utils.cjs +1 -2
  451. package/dist/runnables/utils.cjs.map +1 -1
  452. package/dist/runnables/utils.js +1 -1
  453. package/dist/runnables/utils.js.map +1 -1
  454. package/dist/runnables/wrappers.cjs +2 -3
  455. package/dist/runnables/wrappers.cjs.map +1 -1
  456. package/dist/runnables/wrappers.js +1 -2
  457. package/dist/runnables/wrappers.js.map +1 -1
  458. package/dist/singletons/async_local_storage/context.cjs +3 -4
  459. package/dist/singletons/async_local_storage/context.cjs.map +1 -1
  460. package/dist/singletons/async_local_storage/context.js +1 -2
  461. package/dist/singletons/async_local_storage/context.js.map +1 -1
  462. package/dist/singletons/async_local_storage/globals.cjs +1 -2
  463. package/dist/singletons/async_local_storage/globals.cjs.map +1 -1
  464. package/dist/singletons/async_local_storage/globals.js +1 -1
  465. package/dist/singletons/async_local_storage/globals.js.map +1 -1
  466. package/dist/singletons/async_local_storage/index.cjs +4 -5
  467. package/dist/singletons/async_local_storage/index.cjs.map +1 -1
  468. package/dist/singletons/async_local_storage/index.js +1 -2
  469. package/dist/singletons/async_local_storage/index.js.map +1 -1
  470. package/dist/singletons/callbacks.cjs +4 -5
  471. package/dist/singletons/callbacks.cjs.map +1 -1
  472. package/dist/singletons/callbacks.js +1 -2
  473. package/dist/singletons/callbacks.js.map +1 -1
  474. package/dist/singletons/index.cjs +10 -11
  475. package/dist/singletons/index.js +1 -2
  476. package/dist/singletons/tracer.cjs +3 -4
  477. package/dist/singletons/tracer.cjs.map +1 -1
  478. package/dist/singletons/tracer.js +1 -2
  479. package/dist/singletons/tracer.js.map +1 -1
  480. package/dist/stores.cjs +9 -10
  481. package/dist/stores.cjs.map +1 -1
  482. package/dist/stores.js +1 -2
  483. package/dist/stores.js.map +1 -1
  484. package/dist/structured_query/base.cjs +3 -4
  485. package/dist/structured_query/base.cjs.map +1 -1
  486. package/dist/structured_query/base.js +1 -2
  487. package/dist/structured_query/base.js.map +1 -1
  488. package/dist/structured_query/functional.cjs +4 -5
  489. package/dist/structured_query/functional.cjs.map +1 -1
  490. package/dist/structured_query/functional.js +1 -2
  491. package/dist/structured_query/functional.js.map +1 -1
  492. package/dist/structured_query/index.cjs +12 -13
  493. package/dist/structured_query/index.js +1 -2
  494. package/dist/structured_query/ir.cjs +1 -2
  495. package/dist/structured_query/ir.cjs.map +1 -1
  496. package/dist/structured_query/ir.js +1 -1
  497. package/dist/structured_query/ir.js.map +1 -1
  498. package/dist/structured_query/utils.cjs +1 -2
  499. package/dist/structured_query/utils.cjs.map +1 -1
  500. package/dist/structured_query/utils.js +1 -1
  501. package/dist/testing/fake_model_builder.cjs +6 -7
  502. package/dist/testing/fake_model_builder.cjs.map +1 -1
  503. package/dist/testing/fake_model_builder.d.ts +0 -1
  504. package/dist/testing/fake_model_builder.d.ts.map +1 -1
  505. package/dist/testing/fake_model_builder.js +1 -2
  506. package/dist/testing/fake_model_builder.js.map +1 -1
  507. package/dist/testing/index.cjs +10 -11
  508. package/dist/testing/index.js +1 -2
  509. package/dist/testing/matchers.cjs +7 -8
  510. package/dist/testing/matchers.cjs.map +1 -1
  511. package/dist/testing/matchers.js +1 -2
  512. package/dist/testing/matchers.js.map +1 -1
  513. package/dist/tools/index.cjs +20 -21
  514. package/dist/tools/index.cjs.map +1 -1
  515. package/dist/tools/index.d.cts +1 -1
  516. package/dist/tools/index.d.cts.map +1 -1
  517. package/dist/tools/index.d.ts +1 -3
  518. package/dist/tools/index.d.ts.map +1 -1
  519. package/dist/tools/index.js +1 -2
  520. package/dist/tools/index.js.map +1 -1
  521. package/dist/tools/types.cjs +3 -4
  522. package/dist/tools/types.cjs.map +1 -1
  523. package/dist/tools/types.d.ts +0 -2
  524. package/dist/tools/types.d.ts.map +1 -1
  525. package/dist/tools/types.js +1 -2
  526. package/dist/tools/types.js.map +1 -1
  527. package/dist/tools/utils.cjs +1 -2
  528. package/dist/tools/utils.cjs.map +1 -1
  529. package/dist/tools/utils.js +1 -1
  530. package/dist/tracers/base.cjs +10 -11
  531. package/dist/tracers/base.cjs.map +1 -1
  532. package/dist/tracers/base.js +1 -2
  533. package/dist/tracers/base.js.map +1 -1
  534. package/dist/tracers/console.cjs +9 -10
  535. package/dist/tracers/console.cjs.map +1 -1
  536. package/dist/tracers/console.js +1 -2
  537. package/dist/tracers/console.js.map +1 -1
  538. package/dist/tracers/event_stream.cjs +5 -6
  539. package/dist/tracers/event_stream.cjs.map +1 -1
  540. package/dist/tracers/event_stream.d.ts +0 -2
  541. package/dist/tracers/event_stream.d.ts.map +1 -1
  542. package/dist/tracers/event_stream.js +1 -2
  543. package/dist/tracers/event_stream.js.map +1 -1
  544. package/dist/tracers/log_stream.cjs +13 -14
  545. package/dist/tracers/log_stream.cjs.map +1 -1
  546. package/dist/tracers/log_stream.js +1 -2
  547. package/dist/tracers/log_stream.js.map +1 -1
  548. package/dist/tracers/root_listener.cjs +2 -3
  549. package/dist/tracers/root_listener.cjs.map +1 -1
  550. package/dist/tracers/root_listener.js +1 -2
  551. package/dist/tracers/root_listener.js.map +1 -1
  552. package/dist/tracers/run_collector.cjs +9 -10
  553. package/dist/tracers/run_collector.cjs.map +1 -1
  554. package/dist/tracers/run_collector.js +1 -2
  555. package/dist/tracers/run_collector.js.map +1 -1
  556. package/dist/tracers/tracer_langchain.cjs +12 -13
  557. package/dist/tracers/tracer_langchain.cjs.map +1 -1
  558. package/dist/tracers/tracer_langchain.js +1 -2
  559. package/dist/tracers/tracer_langchain.js.map +1 -1
  560. package/dist/types/stream.cjs +8 -10
  561. package/dist/types/stream.js +1 -2
  562. package/dist/utils/async_caller.cjs +10 -11
  563. package/dist/utils/async_caller.cjs.map +1 -1
  564. package/dist/utils/async_caller.js +1 -2
  565. package/dist/utils/async_caller.js.map +1 -1
  566. package/dist/utils/callbacks.cjs +2 -3
  567. package/dist/utils/callbacks.cjs.map +1 -1
  568. package/dist/utils/callbacks.js +1 -2
  569. package/dist/utils/callbacks.js.map +1 -1
  570. package/dist/utils/chunk_array.cjs +8 -10
  571. package/dist/utils/chunk_array.cjs.map +1 -1
  572. package/dist/utils/chunk_array.js +1 -2
  573. package/dist/utils/chunk_array.js.map +1 -1
  574. package/dist/utils/context.cjs +8 -10
  575. package/dist/utils/context.cjs.map +1 -1
  576. package/dist/utils/context.js +1 -2
  577. package/dist/utils/context.js.map +1 -1
  578. package/dist/utils/env.cjs +8 -10
  579. package/dist/utils/env.cjs.map +1 -1
  580. package/dist/utils/env.js +1 -2
  581. package/dist/utils/env.js.map +1 -1
  582. package/dist/utils/event_source_parse.cjs +9 -10
  583. package/dist/utils/event_source_parse.cjs.map +1 -1
  584. package/dist/utils/event_source_parse.js +1 -2
  585. package/dist/utils/event_source_parse.js.map +1 -1
  586. package/dist/utils/fast-json-patch/index.cjs +5 -16
  587. package/dist/utils/fast-json-patch/index.cjs.map +1 -1
  588. package/dist/utils/fast-json-patch/index.js +6 -17
  589. package/dist/utils/fast-json-patch/index.js.map +1 -1
  590. package/dist/utils/fast-json-patch/src/core.cjs +8 -9
  591. package/dist/utils/fast-json-patch/src/core.cjs.map +1 -1
  592. package/dist/utils/fast-json-patch/src/core.js +1 -2
  593. package/dist/utils/fast-json-patch/src/core.js.map +1 -1
  594. package/dist/utils/fast-json-patch/src/duplex.cjs +3 -4
  595. package/dist/utils/fast-json-patch/src/duplex.cjs.map +1 -1
  596. package/dist/utils/fast-json-patch/src/duplex.js +1 -2
  597. package/dist/utils/fast-json-patch/src/duplex.js.map +1 -1
  598. package/dist/utils/fast-json-patch/src/helpers.cjs +1 -2
  599. package/dist/utils/fast-json-patch/src/helpers.cjs.map +1 -1
  600. package/dist/utils/fast-json-patch/src/helpers.js +1 -1
  601. package/dist/utils/fast-json-patch/src/helpers.js.map +1 -1
  602. package/dist/utils/format.cjs +8 -10
  603. package/dist/utils/format.js +1 -2
  604. package/dist/utils/function_calling.cjs +10 -11
  605. package/dist/utils/function_calling.cjs.map +1 -1
  606. package/dist/utils/function_calling.js +1 -2
  607. package/dist/utils/function_calling.js.map +1 -1
  608. package/dist/utils/hash.cjs +9 -10
  609. package/dist/utils/hash.js +1 -2
  610. package/dist/utils/is-network-error/index.cjs +1 -2
  611. package/dist/utils/is-network-error/index.cjs.map +1 -1
  612. package/dist/utils/is-network-error/index.js +1 -1
  613. package/dist/utils/is-network-error/index.js.map +1 -1
  614. package/dist/utils/js-sha256/hash.cjs +1 -3
  615. package/dist/utils/js-sha256/hash.cjs.map +1 -1
  616. package/dist/utils/js-sha256/hash.js +1 -1
  617. package/dist/utils/js-sha256/hash.js.map +1 -1
  618. package/dist/utils/json.cjs +1 -2
  619. package/dist/utils/json.cjs.map +1 -1
  620. package/dist/utils/json.js +1 -1
  621. package/dist/utils/json_patch.cjs +11 -12
  622. package/dist/utils/json_patch.js +1 -2
  623. package/dist/utils/json_schema.cjs +22 -23
  624. package/dist/utils/json_schema.cjs.map +1 -1
  625. package/dist/utils/json_schema.d.ts +0 -1
  626. package/dist/utils/json_schema.d.ts.map +1 -1
  627. package/dist/utils/json_schema.js +1 -2
  628. package/dist/utils/json_schema.js.map +1 -1
  629. package/dist/utils/math.cjs +11 -12
  630. package/dist/utils/math.cjs.map +1 -1
  631. package/dist/utils/math.js +1 -2
  632. package/dist/utils/math.js.map +1 -1
  633. package/dist/utils/ml-distance/distances.cjs +1 -2
  634. package/dist/utils/ml-distance/distances.cjs.map +1 -1
  635. package/dist/utils/ml-distance/distances.js +1 -1
  636. package/dist/utils/ml-distance/similarities.cjs +1 -2
  637. package/dist/utils/ml-distance/similarities.cjs.map +1 -1
  638. package/dist/utils/ml-distance/similarities.js +1 -1
  639. package/dist/utils/ml-distance-euclidean/euclidean.cjs +1 -2
  640. package/dist/utils/ml-distance-euclidean/euclidean.cjs.map +1 -1
  641. package/dist/utils/ml-distance-euclidean/euclidean.js +1 -1
  642. package/dist/utils/namespace.cjs +1 -2
  643. package/dist/utils/namespace.cjs.map +1 -1
  644. package/dist/utils/namespace.js +1 -1
  645. package/dist/utils/p-retry/index.cjs +2 -3
  646. package/dist/utils/p-retry/index.cjs.map +1 -1
  647. package/dist/utils/p-retry/index.js +1 -2
  648. package/dist/utils/p-retry/index.js.map +1 -1
  649. package/dist/utils/sax-js/sax.cjs +1 -2
  650. package/dist/utils/sax-js/sax.cjs.map +1 -1
  651. package/dist/utils/sax-js/sax.js +1 -1
  652. package/dist/utils/signal.cjs +1 -2
  653. package/dist/utils/signal.cjs.map +1 -1
  654. package/dist/utils/signal.js +1 -1
  655. package/dist/utils/signal.js.map +1 -1
  656. package/dist/utils/ssrf.cjs +8 -10
  657. package/dist/utils/ssrf.cjs.map +1 -1
  658. package/dist/utils/ssrf.js +1 -2
  659. package/dist/utils/ssrf.js.map +1 -1
  660. package/dist/utils/standard_schema.cjs +8 -10
  661. package/dist/utils/standard_schema.cjs.map +1 -1
  662. package/dist/utils/standard_schema.js +1 -2
  663. package/dist/utils/standard_schema.js.map +1 -1
  664. package/dist/utils/stream.cjs +13 -14
  665. package/dist/utils/stream.cjs.map +1 -1
  666. package/dist/utils/stream.d.cts.map +1 -1
  667. package/dist/utils/stream.d.ts.map +1 -1
  668. package/dist/utils/stream.js +2 -3
  669. package/dist/utils/stream.js.map +1 -1
  670. package/dist/utils/testing/chat_models.cjs +7 -8
  671. package/dist/utils/testing/chat_models.cjs.map +1 -1
  672. package/dist/utils/testing/chat_models.d.ts +0 -1
  673. package/dist/utils/testing/chat_models.d.ts.map +1 -1
  674. package/dist/utils/testing/chat_models.js +1 -2
  675. package/dist/utils/testing/chat_models.js.map +1 -1
  676. package/dist/utils/testing/embeddings.cjs +2 -3
  677. package/dist/utils/testing/embeddings.cjs.map +1 -1
  678. package/dist/utils/testing/embeddings.js +1 -2
  679. package/dist/utils/testing/embeddings.js.map +1 -1
  680. package/dist/utils/testing/index.cjs +18 -19
  681. package/dist/utils/testing/index.js +1 -2
  682. package/dist/utils/testing/llms.cjs +2 -3
  683. package/dist/utils/testing/llms.cjs.map +1 -1
  684. package/dist/utils/testing/llms.js +1 -2
  685. package/dist/utils/testing/llms.js.map +1 -1
  686. package/dist/utils/testing/message_history.cjs +6 -7
  687. package/dist/utils/testing/message_history.cjs.map +1 -1
  688. package/dist/utils/testing/message_history.d.ts +0 -1
  689. package/dist/utils/testing/message_history.d.ts.map +1 -1
  690. package/dist/utils/testing/message_history.js +1 -2
  691. package/dist/utils/testing/message_history.js.map +1 -1
  692. package/dist/utils/testing/output_parsers.cjs +2 -3
  693. package/dist/utils/testing/output_parsers.cjs.map +1 -1
  694. package/dist/utils/testing/output_parsers.js +1 -2
  695. package/dist/utils/testing/output_parsers.js.map +1 -1
  696. package/dist/utils/testing/retrievers.cjs +3 -4
  697. package/dist/utils/testing/retrievers.cjs.map +1 -1
  698. package/dist/utils/testing/retrievers.js +1 -2
  699. package/dist/utils/testing/retrievers.js.map +1 -1
  700. package/dist/utils/testing/runnables.cjs +2 -3
  701. package/dist/utils/testing/runnables.cjs.map +1 -1
  702. package/dist/utils/testing/runnables.js +1 -2
  703. package/dist/utils/testing/runnables.js.map +1 -1
  704. package/dist/utils/testing/tools.cjs +2 -3
  705. package/dist/utils/testing/tools.cjs.map +1 -1
  706. package/dist/utils/testing/tools.js +1 -2
  707. package/dist/utils/testing/tools.js.map +1 -1
  708. package/dist/utils/testing/tracers.cjs +2 -3
  709. package/dist/utils/testing/tracers.cjs.map +1 -1
  710. package/dist/utils/testing/tracers.js +1 -2
  711. package/dist/utils/testing/tracers.js.map +1 -1
  712. package/dist/utils/testing/vectorstores.cjs +4 -5
  713. package/dist/utils/testing/vectorstores.cjs.map +1 -1
  714. package/dist/utils/testing/vectorstores.js +1 -2
  715. package/dist/utils/testing/vectorstores.js.map +1 -1
  716. package/dist/utils/tiktoken.cjs +9 -10
  717. package/dist/utils/tiktoken.cjs.map +1 -1
  718. package/dist/utils/tiktoken.js +1 -2
  719. package/dist/utils/tiktoken.js.map +1 -1
  720. package/dist/utils/types/index.cjs +9 -10
  721. package/dist/utils/types/index.js +1 -2
  722. package/dist/utils/types/zod.cjs +2 -3
  723. package/dist/utils/types/zod.cjs.map +1 -1
  724. package/dist/utils/types/zod.js +1 -2
  725. package/dist/utils/types/zod.js.map +1 -1
  726. package/dist/utils/zod-to-json-schema/Options.cjs +1 -2
  727. package/dist/utils/zod-to-json-schema/Options.cjs.map +1 -1
  728. package/dist/utils/zod-to-json-schema/Options.d.ts +1 -3
  729. package/dist/utils/zod-to-json-schema/Options.js +1 -1
  730. package/dist/utils/zod-to-json-schema/Options.js.map +1 -1
  731. package/dist/utils/zod-to-json-schema/Refs.cjs +2 -3
  732. package/dist/utils/zod-to-json-schema/Refs.cjs.map +1 -1
  733. package/dist/utils/zod-to-json-schema/Refs.d.ts +1 -3
  734. package/dist/utils/zod-to-json-schema/Refs.js +1 -2
  735. package/dist/utils/zod-to-json-schema/Refs.js.map +1 -1
  736. package/dist/utils/zod-to-json-schema/errorMessages.cjs +1 -2
  737. package/dist/utils/zod-to-json-schema/errorMessages.cjs.map +1 -1
  738. package/dist/utils/zod-to-json-schema/errorMessages.d.ts +0 -2
  739. package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +1 -1
  740. package/dist/utils/zod-to-json-schema/errorMessages.js +1 -1
  741. package/dist/utils/zod-to-json-schema/getRelativePath.cjs +1 -2
  742. package/dist/utils/zod-to-json-schema/getRelativePath.cjs.map +1 -1
  743. package/dist/utils/zod-to-json-schema/getRelativePath.js +1 -1
  744. package/dist/utils/zod-to-json-schema/index.cjs +37 -37
  745. package/dist/utils/zod-to-json-schema/index.d.ts +1 -14
  746. package/dist/utils/zod-to-json-schema/index.js +38 -39
  747. package/dist/utils/zod-to-json-schema/parseDef.cjs +5 -6
  748. package/dist/utils/zod-to-json-schema/parseDef.cjs.map +1 -1
  749. package/dist/utils/zod-to-json-schema/parseDef.d.ts +1 -3
  750. package/dist/utils/zod-to-json-schema/parseDef.js +1 -2
  751. package/dist/utils/zod-to-json-schema/parseDef.js.map +1 -1
  752. package/dist/utils/zod-to-json-schema/parsers/any.cjs +2 -3
  753. package/dist/utils/zod-to-json-schema/parsers/any.cjs.map +1 -1
  754. package/dist/utils/zod-to-json-schema/parsers/any.d.ts +0 -2
  755. package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +1 -1
  756. package/dist/utils/zod-to-json-schema/parsers/any.js +1 -2
  757. package/dist/utils/zod-to-json-schema/parsers/any.js.map +1 -1
  758. package/dist/utils/zod-to-json-schema/parsers/array.cjs +4 -5
  759. package/dist/utils/zod-to-json-schema/parsers/array.cjs.map +1 -1
  760. package/dist/utils/zod-to-json-schema/parsers/array.d.ts +0 -3
  761. package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +1 -1
  762. package/dist/utils/zod-to-json-schema/parsers/array.js +1 -2
  763. package/dist/utils/zod-to-json-schema/parsers/array.js.map +1 -1
  764. package/dist/utils/zod-to-json-schema/parsers/bigint.cjs +2 -3
  765. package/dist/utils/zod-to-json-schema/parsers/bigint.cjs.map +1 -1
  766. package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts +0 -3
  767. package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +1 -1
  768. package/dist/utils/zod-to-json-schema/parsers/bigint.js +1 -2
  769. package/dist/utils/zod-to-json-schema/parsers/bigint.js.map +1 -1
  770. package/dist/utils/zod-to-json-schema/parsers/boolean.cjs +1 -2
  771. package/dist/utils/zod-to-json-schema/parsers/boolean.cjs.map +1 -1
  772. package/dist/utils/zod-to-json-schema/parsers/boolean.js +1 -1
  773. package/dist/utils/zod-to-json-schema/parsers/branded.cjs +2 -3
  774. package/dist/utils/zod-to-json-schema/parsers/branded.cjs.map +1 -1
  775. package/dist/utils/zod-to-json-schema/parsers/branded.d.ts +1 -3
  776. package/dist/utils/zod-to-json-schema/parsers/branded.js +1 -2
  777. package/dist/utils/zod-to-json-schema/parsers/branded.js.map +1 -1
  778. package/dist/utils/zod-to-json-schema/parsers/catch.cjs +2 -3
  779. package/dist/utils/zod-to-json-schema/parsers/catch.cjs.map +1 -1
  780. package/dist/utils/zod-to-json-schema/parsers/catch.d.ts +1 -3
  781. package/dist/utils/zod-to-json-schema/parsers/catch.js +1 -2
  782. package/dist/utils/zod-to-json-schema/parsers/catch.js.map +1 -1
  783. package/dist/utils/zod-to-json-schema/parsers/date.cjs +2 -3
  784. package/dist/utils/zod-to-json-schema/parsers/date.cjs.map +1 -1
  785. package/dist/utils/zod-to-json-schema/parsers/date.d.ts +0 -4
  786. package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +1 -1
  787. package/dist/utils/zod-to-json-schema/parsers/date.js +1 -2
  788. package/dist/utils/zod-to-json-schema/parsers/date.js.map +1 -1
  789. package/dist/utils/zod-to-json-schema/parsers/default.cjs +2 -3
  790. package/dist/utils/zod-to-json-schema/parsers/default.cjs.map +1 -1
  791. package/dist/utils/zod-to-json-schema/parsers/default.d.ts +1 -3
  792. package/dist/utils/zod-to-json-schema/parsers/default.js +1 -2
  793. package/dist/utils/zod-to-json-schema/parsers/default.js.map +1 -1
  794. package/dist/utils/zod-to-json-schema/parsers/effects.cjs +3 -4
  795. package/dist/utils/zod-to-json-schema/parsers/effects.cjs.map +1 -1
  796. package/dist/utils/zod-to-json-schema/parsers/effects.d.ts +1 -3
  797. package/dist/utils/zod-to-json-schema/parsers/effects.js +1 -2
  798. package/dist/utils/zod-to-json-schema/parsers/effects.js.map +1 -1
  799. package/dist/utils/zod-to-json-schema/parsers/enum.cjs +1 -2
  800. package/dist/utils/zod-to-json-schema/parsers/enum.cjs.map +1 -1
  801. package/dist/utils/zod-to-json-schema/parsers/enum.d.ts +0 -2
  802. package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +1 -1
  803. package/dist/utils/zod-to-json-schema/parsers/enum.js +1 -1
  804. package/dist/utils/zod-to-json-schema/parsers/intersection.cjs +2 -3
  805. package/dist/utils/zod-to-json-schema/parsers/intersection.cjs.map +1 -1
  806. package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts +0 -3
  807. package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +1 -1
  808. package/dist/utils/zod-to-json-schema/parsers/intersection.js +1 -2
  809. package/dist/utils/zod-to-json-schema/parsers/intersection.js.map +1 -1
  810. package/dist/utils/zod-to-json-schema/parsers/literal.cjs +1 -2
  811. package/dist/utils/zod-to-json-schema/parsers/literal.cjs.map +1 -1
  812. package/dist/utils/zod-to-json-schema/parsers/literal.d.ts +0 -3
  813. package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +1 -1
  814. package/dist/utils/zod-to-json-schema/parsers/literal.js +1 -1
  815. package/dist/utils/zod-to-json-schema/parsers/map.cjs +4 -5
  816. package/dist/utils/zod-to-json-schema/parsers/map.cjs.map +1 -1
  817. package/dist/utils/zod-to-json-schema/parsers/map.d.ts +0 -4
  818. package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +1 -1
  819. package/dist/utils/zod-to-json-schema/parsers/map.js +1 -2
  820. package/dist/utils/zod-to-json-schema/parsers/map.js.map +1 -1
  821. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs +1 -2
  822. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs.map +1 -1
  823. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts +0 -2
  824. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -1
  825. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.js +1 -1
  826. package/dist/utils/zod-to-json-schema/parsers/never.cjs +2 -3
  827. package/dist/utils/zod-to-json-schema/parsers/never.cjs.map +1 -1
  828. package/dist/utils/zod-to-json-schema/parsers/never.d.ts +0 -2
  829. package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +1 -1
  830. package/dist/utils/zod-to-json-schema/parsers/never.js +1 -2
  831. package/dist/utils/zod-to-json-schema/parsers/never.js.map +1 -1
  832. package/dist/utils/zod-to-json-schema/parsers/null.cjs +1 -2
  833. package/dist/utils/zod-to-json-schema/parsers/null.cjs.map +1 -1
  834. package/dist/utils/zod-to-json-schema/parsers/null.d.ts +0 -2
  835. package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +1 -1
  836. package/dist/utils/zod-to-json-schema/parsers/null.js +1 -1
  837. package/dist/utils/zod-to-json-schema/parsers/nullable.cjs +3 -4
  838. package/dist/utils/zod-to-json-schema/parsers/nullable.cjs.map +1 -1
  839. package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts +0 -3
  840. package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +1 -1
  841. package/dist/utils/zod-to-json-schema/parsers/nullable.js +1 -2
  842. package/dist/utils/zod-to-json-schema/parsers/nullable.js.map +1 -1
  843. package/dist/utils/zod-to-json-schema/parsers/number.cjs +2 -3
  844. package/dist/utils/zod-to-json-schema/parsers/number.cjs.map +1 -1
  845. package/dist/utils/zod-to-json-schema/parsers/number.d.ts +0 -3
  846. package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +1 -1
  847. package/dist/utils/zod-to-json-schema/parsers/number.js +1 -2
  848. package/dist/utils/zod-to-json-schema/parsers/number.js.map +1 -1
  849. package/dist/utils/zod-to-json-schema/parsers/object.cjs +2 -3
  850. package/dist/utils/zod-to-json-schema/parsers/object.cjs.map +1 -1
  851. package/dist/utils/zod-to-json-schema/parsers/object.d.ts +0 -3
  852. package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +1 -1
  853. package/dist/utils/zod-to-json-schema/parsers/object.js +1 -2
  854. package/dist/utils/zod-to-json-schema/parsers/object.js.map +1 -1
  855. package/dist/utils/zod-to-json-schema/parsers/optional.cjs +3 -4
  856. package/dist/utils/zod-to-json-schema/parsers/optional.cjs.map +1 -1
  857. package/dist/utils/zod-to-json-schema/parsers/optional.d.ts +1 -3
  858. package/dist/utils/zod-to-json-schema/parsers/optional.js +1 -2
  859. package/dist/utils/zod-to-json-schema/parsers/optional.js.map +1 -1
  860. package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs +2 -3
  861. package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs.map +1 -1
  862. package/dist/utils/zod-to-json-schema/parsers/pipeline.d.ts +1 -4
  863. package/dist/utils/zod-to-json-schema/parsers/pipeline.js +1 -2
  864. package/dist/utils/zod-to-json-schema/parsers/pipeline.js.map +1 -1
  865. package/dist/utils/zod-to-json-schema/parsers/promise.cjs +2 -3
  866. package/dist/utils/zod-to-json-schema/parsers/promise.cjs.map +1 -1
  867. package/dist/utils/zod-to-json-schema/parsers/promise.d.ts +1 -3
  868. package/dist/utils/zod-to-json-schema/parsers/promise.js +1 -2
  869. package/dist/utils/zod-to-json-schema/parsers/promise.js.map +1 -1
  870. package/dist/utils/zod-to-json-schema/parsers/readonly.cjs +2 -3
  871. package/dist/utils/zod-to-json-schema/parsers/readonly.cjs.map +1 -1
  872. package/dist/utils/zod-to-json-schema/parsers/readonly.d.ts +1 -3
  873. package/dist/utils/zod-to-json-schema/parsers/readonly.js +1 -2
  874. package/dist/utils/zod-to-json-schema/parsers/readonly.js.map +1 -1
  875. package/dist/utils/zod-to-json-schema/parsers/record.cjs +6 -7
  876. package/dist/utils/zod-to-json-schema/parsers/record.cjs.map +1 -1
  877. package/dist/utils/zod-to-json-schema/parsers/record.d.ts +0 -3
  878. package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +1 -1
  879. package/dist/utils/zod-to-json-schema/parsers/record.js +1 -2
  880. package/dist/utils/zod-to-json-schema/parsers/record.js.map +1 -1
  881. package/dist/utils/zod-to-json-schema/parsers/set.cjs +3 -4
  882. package/dist/utils/zod-to-json-schema/parsers/set.cjs.map +1 -1
  883. package/dist/utils/zod-to-json-schema/parsers/set.d.ts +0 -3
  884. package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +1 -1
  885. package/dist/utils/zod-to-json-schema/parsers/set.js +1 -2
  886. package/dist/utils/zod-to-json-schema/parsers/set.js.map +1 -1
  887. package/dist/utils/zod-to-json-schema/parsers/string.cjs +2 -3
  888. package/dist/utils/zod-to-json-schema/parsers/string.cjs.map +1 -1
  889. package/dist/utils/zod-to-json-schema/parsers/string.d.ts +0 -3
  890. package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +1 -1
  891. package/dist/utils/zod-to-json-schema/parsers/string.js +1 -2
  892. package/dist/utils/zod-to-json-schema/parsers/string.js.map +1 -1
  893. package/dist/utils/zod-to-json-schema/parsers/tuple.cjs +2 -3
  894. package/dist/utils/zod-to-json-schema/parsers/tuple.cjs.map +1 -1
  895. package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts +0 -3
  896. package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +1 -1
  897. package/dist/utils/zod-to-json-schema/parsers/tuple.js +1 -2
  898. package/dist/utils/zod-to-json-schema/parsers/tuple.js.map +1 -1
  899. package/dist/utils/zod-to-json-schema/parsers/undefined.cjs +2 -3
  900. package/dist/utils/zod-to-json-schema/parsers/undefined.cjs.map +1 -1
  901. package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts +0 -2
  902. package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +1 -1
  903. package/dist/utils/zod-to-json-schema/parsers/undefined.js +1 -2
  904. package/dist/utils/zod-to-json-schema/parsers/undefined.js.map +1 -1
  905. package/dist/utils/zod-to-json-schema/parsers/union.cjs +2 -3
  906. package/dist/utils/zod-to-json-schema/parsers/union.cjs.map +1 -1
  907. package/dist/utils/zod-to-json-schema/parsers/union.d.ts +0 -3
  908. package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +1 -1
  909. package/dist/utils/zod-to-json-schema/parsers/union.js +1 -2
  910. package/dist/utils/zod-to-json-schema/parsers/union.js.map +1 -1
  911. package/dist/utils/zod-to-json-schema/parsers/unknown.cjs +2 -3
  912. package/dist/utils/zod-to-json-schema/parsers/unknown.cjs.map +1 -1
  913. package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts +0 -2
  914. package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +1 -1
  915. package/dist/utils/zod-to-json-schema/parsers/unknown.js +1 -2
  916. package/dist/utils/zod-to-json-schema/parsers/unknown.js.map +1 -1
  917. package/dist/utils/zod-to-json-schema/selectParser.cjs +32 -33
  918. package/dist/utils/zod-to-json-schema/selectParser.cjs.map +1 -1
  919. package/dist/utils/zod-to-json-schema/selectParser.d.ts +0 -2
  920. package/dist/utils/zod-to-json-schema/selectParser.js +1 -2
  921. package/dist/utils/zod-to-json-schema/selectParser.js.map +1 -1
  922. package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs +4 -5
  923. package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs.map +1 -1
  924. package/dist/utils/zod-to-json-schema/zodToJsonSchema.d.ts +1 -3
  925. package/dist/utils/zod-to-json-schema/zodToJsonSchema.js +1 -2
  926. package/dist/utils/zod-to-json-schema/zodToJsonSchema.js.map +1 -1
  927. package/dist/vectorstores.cjs +10 -11
  928. package/dist/vectorstores.cjs.map +1 -1
  929. package/dist/vectorstores.js +1 -2
  930. package/dist/vectorstores.js.map +1 -1
  931. package/package.json +1 -1
  932. package/agents.cjs +0 -1
  933. package/agents.d.cts +0 -1
  934. package/agents.d.ts +0 -1
  935. package/agents.js +0 -1
  936. package/caches.cjs +0 -1
  937. package/caches.d.cts +0 -1
  938. package/caches.d.ts +0 -1
  939. package/caches.js +0 -1
  940. package/callbacks/base.cjs +0 -1
  941. package/callbacks/base.d.cts +0 -1
  942. package/callbacks/base.d.ts +0 -1
  943. package/callbacks/base.js +0 -1
  944. package/callbacks/dispatch/web.cjs +0 -1
  945. package/callbacks/dispatch/web.d.cts +0 -1
  946. package/callbacks/dispatch/web.d.ts +0 -1
  947. package/callbacks/dispatch/web.js +0 -1
  948. package/callbacks/dispatch.cjs +0 -1
  949. package/callbacks/dispatch.d.cts +0 -1
  950. package/callbacks/dispatch.d.ts +0 -1
  951. package/callbacks/dispatch.js +0 -1
  952. package/callbacks/manager.cjs +0 -1
  953. package/callbacks/manager.d.cts +0 -1
  954. package/callbacks/manager.d.ts +0 -1
  955. package/callbacks/manager.js +0 -1
  956. package/callbacks/promises.cjs +0 -1
  957. package/callbacks/promises.d.cts +0 -1
  958. package/callbacks/promises.d.ts +0 -1
  959. package/callbacks/promises.js +0 -1
  960. package/chat_history.cjs +0 -1
  961. package/chat_history.d.cts +0 -1
  962. package/chat_history.d.ts +0 -1
  963. package/chat_history.js +0 -1
  964. package/context.cjs +0 -1
  965. package/context.d.cts +0 -1
  966. package/context.d.ts +0 -1
  967. package/context.js +0 -1
  968. package/document_loaders/base.cjs +0 -1
  969. package/document_loaders/base.d.cts +0 -1
  970. package/document_loaders/base.d.ts +0 -1
  971. package/document_loaders/base.js +0 -1
  972. package/document_loaders/langsmith.cjs +0 -1
  973. package/document_loaders/langsmith.d.cts +0 -1
  974. package/document_loaders/langsmith.d.ts +0 -1
  975. package/document_loaders/langsmith.js +0 -1
  976. package/documents.cjs +0 -1
  977. package/documents.d.cts +0 -1
  978. package/documents.d.ts +0 -1
  979. package/documents.js +0 -1
  980. package/embeddings.cjs +0 -1
  981. package/embeddings.d.cts +0 -1
  982. package/embeddings.d.ts +0 -1
  983. package/embeddings.js +0 -1
  984. package/errors.cjs +0 -1
  985. package/errors.d.cts +0 -1
  986. package/errors.d.ts +0 -1
  987. package/errors.js +0 -1
  988. package/example_selectors.cjs +0 -1
  989. package/example_selectors.d.cts +0 -1
  990. package/example_selectors.d.ts +0 -1
  991. package/example_selectors.js +0 -1
  992. package/indexing.cjs +0 -1
  993. package/indexing.d.cts +0 -1
  994. package/indexing.d.ts +0 -1
  995. package/indexing.js +0 -1
  996. package/language_models/base.cjs +0 -1
  997. package/language_models/base.d.cts +0 -1
  998. package/language_models/base.d.ts +0 -1
  999. package/language_models/base.js +0 -1
  1000. package/language_models/chat_models.cjs +0 -1
  1001. package/language_models/chat_models.d.cts +0 -1
  1002. package/language_models/chat_models.d.ts +0 -1
  1003. package/language_models/chat_models.js +0 -1
  1004. package/language_models/llms.cjs +0 -1
  1005. package/language_models/llms.d.cts +0 -1
  1006. package/language_models/llms.d.ts +0 -1
  1007. package/language_models/llms.js +0 -1
  1008. package/language_models/profile.cjs +0 -1
  1009. package/language_models/profile.d.cts +0 -1
  1010. package/language_models/profile.d.ts +0 -1
  1011. package/language_models/profile.js +0 -1
  1012. package/language_models/structured_output.cjs +0 -1
  1013. package/language_models/structured_output.d.cts +0 -1
  1014. package/language_models/structured_output.d.ts +0 -1
  1015. package/language_models/structured_output.js +0 -1
  1016. package/load/serializable.cjs +0 -1
  1017. package/load/serializable.d.cts +0 -1
  1018. package/load/serializable.d.ts +0 -1
  1019. package/load/serializable.js +0 -1
  1020. package/load.cjs +0 -1
  1021. package/load.d.cts +0 -1
  1022. package/load.d.ts +0 -1
  1023. package/load.js +0 -1
  1024. package/memory.cjs +0 -1
  1025. package/memory.d.cts +0 -1
  1026. package/memory.d.ts +0 -1
  1027. package/memory.js +0 -1
  1028. package/messages/tool.cjs +0 -1
  1029. package/messages/tool.d.cts +0 -1
  1030. package/messages/tool.d.ts +0 -1
  1031. package/messages/tool.js +0 -1
  1032. package/messages.cjs +0 -1
  1033. package/messages.d.cts +0 -1
  1034. package/messages.d.ts +0 -1
  1035. package/messages.js +0 -1
  1036. package/output_parsers/openai_functions.cjs +0 -1
  1037. package/output_parsers/openai_functions.d.cts +0 -1
  1038. package/output_parsers/openai_functions.d.ts +0 -1
  1039. package/output_parsers/openai_functions.js +0 -1
  1040. package/output_parsers/openai_tools.cjs +0 -1
  1041. package/output_parsers/openai_tools.d.cts +0 -1
  1042. package/output_parsers/openai_tools.d.ts +0 -1
  1043. package/output_parsers/openai_tools.js +0 -1
  1044. package/output_parsers.cjs +0 -1
  1045. package/output_parsers.d.cts +0 -1
  1046. package/output_parsers.d.ts +0 -1
  1047. package/output_parsers.js +0 -1
  1048. package/outputs.cjs +0 -1
  1049. package/outputs.d.cts +0 -1
  1050. package/outputs.d.ts +0 -1
  1051. package/outputs.js +0 -1
  1052. package/prompt_values.cjs +0 -1
  1053. package/prompt_values.d.cts +0 -1
  1054. package/prompt_values.d.ts +0 -1
  1055. package/prompt_values.js +0 -1
  1056. package/prompts.cjs +0 -1
  1057. package/prompts.d.cts +0 -1
  1058. package/prompts.d.ts +0 -1
  1059. package/prompts.js +0 -1
  1060. package/retrievers/document_compressors.cjs +0 -1
  1061. package/retrievers/document_compressors.d.cts +0 -1
  1062. package/retrievers/document_compressors.d.ts +0 -1
  1063. package/retrievers/document_compressors.js +0 -1
  1064. package/retrievers.cjs +0 -1
  1065. package/retrievers.d.cts +0 -1
  1066. package/retrievers.d.ts +0 -1
  1067. package/retrievers.js +0 -1
  1068. package/runnables/graph.cjs +0 -1
  1069. package/runnables/graph.d.cts +0 -1
  1070. package/runnables/graph.d.ts +0 -1
  1071. package/runnables/graph.js +0 -1
  1072. package/runnables.cjs +0 -1
  1073. package/runnables.d.cts +0 -1
  1074. package/runnables.d.ts +0 -1
  1075. package/runnables.js +0 -1
  1076. package/singletons.cjs +0 -1
  1077. package/singletons.d.cts +0 -1
  1078. package/singletons.d.ts +0 -1
  1079. package/singletons.js +0 -1
  1080. package/stores.cjs +0 -1
  1081. package/stores.d.cts +0 -1
  1082. package/stores.d.ts +0 -1
  1083. package/stores.js +0 -1
  1084. package/structured_query.cjs +0 -1
  1085. package/structured_query.d.cts +0 -1
  1086. package/structured_query.d.ts +0 -1
  1087. package/structured_query.js +0 -1
  1088. package/tools.cjs +0 -1
  1089. package/tools.d.cts +0 -1
  1090. package/tools.d.ts +0 -1
  1091. package/tools.js +0 -1
  1092. package/tracers/base.cjs +0 -1
  1093. package/tracers/base.d.cts +0 -1
  1094. package/tracers/base.d.ts +0 -1
  1095. package/tracers/base.js +0 -1
  1096. package/tracers/console.cjs +0 -1
  1097. package/tracers/console.d.cts +0 -1
  1098. package/tracers/console.d.ts +0 -1
  1099. package/tracers/console.js +0 -1
  1100. package/tracers/log_stream.cjs +0 -1
  1101. package/tracers/log_stream.d.cts +0 -1
  1102. package/tracers/log_stream.d.ts +0 -1
  1103. package/tracers/log_stream.js +0 -1
  1104. package/tracers/run_collector.cjs +0 -1
  1105. package/tracers/run_collector.d.cts +0 -1
  1106. package/tracers/run_collector.d.ts +0 -1
  1107. package/tracers/run_collector.js +0 -1
  1108. package/tracers/tracer_langchain.cjs +0 -1
  1109. package/tracers/tracer_langchain.d.cts +0 -1
  1110. package/tracers/tracer_langchain.d.ts +0 -1
  1111. package/tracers/tracer_langchain.js +0 -1
  1112. package/types/stream.cjs +0 -1
  1113. package/types/stream.d.cts +0 -1
  1114. package/types/stream.d.ts +0 -1
  1115. package/types/stream.js +0 -1
  1116. package/utils/async_caller.cjs +0 -1
  1117. package/utils/async_caller.d.cts +0 -1
  1118. package/utils/async_caller.d.ts +0 -1
  1119. package/utils/async_caller.js +0 -1
  1120. package/utils/chunk_array.cjs +0 -1
  1121. package/utils/chunk_array.d.cts +0 -1
  1122. package/utils/chunk_array.d.ts +0 -1
  1123. package/utils/chunk_array.js +0 -1
  1124. package/utils/context.cjs +0 -1
  1125. package/utils/context.d.cts +0 -1
  1126. package/utils/context.d.ts +0 -1
  1127. package/utils/context.js +0 -1
  1128. package/utils/env.cjs +0 -1
  1129. package/utils/env.d.cts +0 -1
  1130. package/utils/env.d.ts +0 -1
  1131. package/utils/env.js +0 -1
  1132. package/utils/event_source_parse.cjs +0 -1
  1133. package/utils/event_source_parse.d.cts +0 -1
  1134. package/utils/event_source_parse.d.ts +0 -1
  1135. package/utils/event_source_parse.js +0 -1
  1136. package/utils/format.cjs +0 -1
  1137. package/utils/format.d.cts +0 -1
  1138. package/utils/format.d.ts +0 -1
  1139. package/utils/format.js +0 -1
  1140. package/utils/function_calling.cjs +0 -1
  1141. package/utils/function_calling.d.cts +0 -1
  1142. package/utils/function_calling.d.ts +0 -1
  1143. package/utils/function_calling.js +0 -1
  1144. package/utils/hash.cjs +0 -1
  1145. package/utils/hash.d.cts +0 -1
  1146. package/utils/hash.d.ts +0 -1
  1147. package/utils/hash.js +0 -1
  1148. package/utils/json_patch.cjs +0 -1
  1149. package/utils/json_patch.d.cts +0 -1
  1150. package/utils/json_patch.d.ts +0 -1
  1151. package/utils/json_patch.js +0 -1
  1152. package/utils/json_schema.cjs +0 -1
  1153. package/utils/json_schema.d.cts +0 -1
  1154. package/utils/json_schema.d.ts +0 -1
  1155. package/utils/json_schema.js +0 -1
  1156. package/utils/math.cjs +0 -1
  1157. package/utils/math.d.cts +0 -1
  1158. package/utils/math.d.ts +0 -1
  1159. package/utils/math.js +0 -1
  1160. package/utils/ssrf.cjs +0 -1
  1161. package/utils/ssrf.d.cts +0 -1
  1162. package/utils/ssrf.d.ts +0 -1
  1163. package/utils/ssrf.js +0 -1
  1164. package/utils/standard_schema.cjs +0 -1
  1165. package/utils/standard_schema.d.cts +0 -1
  1166. package/utils/standard_schema.d.ts +0 -1
  1167. package/utils/standard_schema.js +0 -1
  1168. package/utils/stream.cjs +0 -1
  1169. package/utils/stream.d.cts +0 -1
  1170. package/utils/stream.d.ts +0 -1
  1171. package/utils/stream.js +0 -1
  1172. package/utils/testing.cjs +0 -1
  1173. package/utils/testing.d.cts +0 -1
  1174. package/utils/testing.d.ts +0 -1
  1175. package/utils/testing.js +0 -1
  1176. package/utils/tiktoken.cjs +0 -1
  1177. package/utils/tiktoken.d.cts +0 -1
  1178. package/utils/tiktoken.d.ts +0 -1
  1179. package/utils/tiktoken.js +0 -1
  1180. package/utils/types.cjs +0 -1
  1181. package/utils/types.d.cts +0 -1
  1182. package/utils/types.d.ts +0 -1
  1183. package/utils/types.js +0 -1
  1184. package/vectorstores.cjs +0 -1
  1185. package/vectorstores.d.cts +0 -1
  1186. package/vectorstores.d.ts +0 -1
  1187. package/vectorstores.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"zod.js","names":[],"sources":["../../../src/utils/types/zod.ts"],"sourcesContent":["import type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\nimport type * as z4Classic from \"zod/v4\";\n// Import from main \"zod\" package to get the types users would get with `import { z } from \"zod\"`\n// This is important for zod v4.x where the main package uses the classic/compat API\nimport type * as zodMain from \"zod\";\nimport {\n parse,\n parseAsync,\n globalRegistry,\n util,\n clone,\n _unknown,\n _never,\n $ZodUnknown,\n $ZodNever,\n $ZodOptional,\n} from \"zod/v4/core\";\nimport { SerializableSchema } from \"../standard_schema.js\";\n\nexport type ZodStringV3 = z3.ZodString;\n\nexport type ZodStringV4 = z4.$ZodType<string, unknown>;\n\n// ZodObject in zod v3 and zod v4's v3 compat layer has 5 type parameters:\n// T (shape), UnknownKeys, Catchall, Output, Input\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ZodObjectV3 = z3.ZodObject<any, any, any, any, any>;\n\n// Core $ZodObject type from \"zod/v4/core\"\nexport type ZodObjectV4 = z4.$ZodObject;\n\n// Classic ZodObject type from \"zod/v4\" (the classic/compat API)\n// This is what users get when using `import { z } from \"zod\"` with zod v4.x\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ZodObjectV4Classic = z4Classic.ZodObject<any, any>;\n\n// Main \"zod\" package ZodObject - the type users get with `import { z } from \"zod\"`\n// In zod v4.x, this uses the v4 classic API with 2 type params (Shape, Config)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ZodObjectMain = zodMain.ZodObject<any, any>;\n\nexport type ZodDefaultV3<T extends z3.ZodTypeAny> = z3.ZodDefault<T>;\nexport type ZodDefaultV4<T extends z4.SomeType> = z4.$ZodDefault<T>;\nexport type ZodOptionalV3<T extends z3.ZodTypeAny> = z3.ZodOptional<T>;\nexport type ZodOptionalV4<T extends z4.SomeType> = z4.$ZodOptional<T>;\nexport type ZodNullableV4<T extends z4.SomeType> = z4.$ZodNullable<T>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InteropZodType<Output = any, Input = Output> =\n | z3.ZodType<Output, z3.ZodTypeDef, Input>\n | z4.$ZodType<Output, Input>;\n\nexport type InteropZodObject =\n | ZodObjectV3\n | ZodObjectV4\n | ZodObjectV4Classic\n | ZodObjectMain;\nexport type InteropZodDefault<T = InteropZodObjectShape> =\n T extends z3.ZodTypeAny\n ? ZodDefaultV3<T>\n : T extends z4.SomeType\n ? ZodDefaultV4<T>\n : never;\nexport type InteropZodOptional<T = InteropZodObjectShape> =\n T extends z3.ZodTypeAny\n ? ZodOptionalV3<T>\n : T extends z4.SomeType\n ? ZodOptionalV4<T>\n : never;\n\nexport type InteropZodObjectShape<\n T extends InteropZodObject = InteropZodObject,\n> =\n T extends z3.ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : T extends z4.$ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : T extends z4Classic.ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : T extends zodMain.ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : never;\n\nexport type InteropZodIssue = z3.ZodIssue | z4.$ZodIssue;\n\n// Simplified type inference to avoid circular dependencies\nexport type InferInteropZodInput<T> =\n T extends z3.ZodType<unknown, z3.ZodTypeDef, infer Input>\n ? Input\n : T extends z4.$ZodType<unknown, infer Input>\n ? Input\n : T extends { _zod: { input: infer Input } }\n ? Input\n : never;\n\nexport type InferInteropZodOutput<T> =\n T extends z3.ZodType<infer Output, z3.ZodTypeDef, unknown>\n ? Output\n : T extends z4.$ZodType<infer Output, unknown>\n ? Output\n : T extends { _zod: { output: infer Output } }\n ? Output\n : never;\n\nexport type Mutable<T> = {\n -readonly [P in keyof T]: T[P];\n};\n\nexport function isZodSchemaV4(\n schema: unknown\n): schema is z4.$ZodType<unknown, unknown> {\n if (typeof schema !== \"object\" || schema === null) {\n return false;\n }\n\n const obj = schema as Record<string, unknown>;\n if (!(\"_zod\" in obj)) {\n return false;\n }\n\n const zod = obj._zod;\n return (\n typeof zod === \"object\" &&\n zod !== null &&\n \"def\" in (zod as Record<string, unknown>)\n );\n}\n\nexport function isZodSchemaV3(\n schema: unknown\n): schema is z3.ZodType<unknown, z3.ZodTypeDef, unknown> {\n if (typeof schema !== \"object\" || schema === null) {\n return false;\n }\n\n const obj = schema as Record<string, unknown>;\n if (!(\"_def\" in obj) || \"_zod\" in obj) {\n return false;\n }\n\n const def = obj._def;\n return (\n typeof def === \"object\" &&\n def != null &&\n \"typeName\" in (def as Record<string, unknown>)\n );\n}\n\n/** Backward compatible isZodSchema for Zod 3 */\nexport function isZodSchema<\n RunOutput extends Record<string, unknown> = Record<string, unknown>,\n>(\n schema: z3.ZodType<RunOutput> | Record<string, unknown>\n): schema is z3.ZodType<RunOutput> {\n if (isZodSchemaV4(schema)) {\n console.warn(\n \"[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior.\"\n );\n }\n return isZodSchemaV3(schema);\n}\n\n/**\n * Given either a Zod schema, or plain object, determine if the input is a Zod schema.\n *\n * @param {unknown} input\n * @returns {boolean} Whether or not the provided input is a Zod schema.\n */\nexport function isInteropZodSchema(input: unknown): input is InteropZodType {\n if (!input) {\n return false;\n }\n if (typeof input !== \"object\") {\n return false;\n }\n if (Array.isArray(input)) {\n return false;\n }\n if (\n isZodSchemaV4(input) ||\n isZodSchemaV3(input as z3.ZodType<Record<string, unknown>>)\n ) {\n return true;\n }\n return false;\n}\n\nexport type InteropZodLiteral = z3.ZodLiteral<unknown> | z4.$ZodLiteral;\n\nexport function isZodLiteralV3(obj: unknown): obj is z3.ZodLiteral<unknown> {\n // Zod v3 literal schemas have _def.typeName === \"ZodLiteral\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_def\" in obj &&\n typeof obj._def === \"object\" &&\n obj._def !== null &&\n \"typeName\" in obj._def &&\n obj._def.typeName === \"ZodLiteral\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodLiteralV4(obj: unknown): obj is z4.$ZodLiteral {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 literal schemas have _zod.def.type === \"literal\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"literal\"\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * Determines if the provided value is an InteropZodLiteral (Zod v3 or v4 literal schema).\n *\n * @param obj The value to check.\n * @returns {boolean} True if the value is a Zod v3 or v4 literal schema, false otherwise.\n */\nexport function isInteropZodLiteral(obj: unknown): obj is InteropZodLiteral {\n if (isZodLiteralV3(obj)) return true;\n if (isZodLiteralV4(obj)) return true;\n return false;\n}\n\ntype InteropZodSafeParseResult<T> = z3.SafeParseReturnType<T, T>;\n\n/**\n * Asynchronously parses the input using the provided Zod schema (v3 or v4) and returns a safe parse result.\n * This function handles both Zod v3 and v4 schemas, returning a result object indicating success or failure.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {Promise<InteropZodSafeParseResult<T>>} A promise that resolves to a safe parse result object.\n * @throws {Error} If the schema is not a recognized Zod v3 or v4 schema.\n */\nexport async function interopSafeParseAsync<T>(\n schema: InteropZodType<T>,\n input: unknown\n): Promise<InteropZodSafeParseResult<T>> {\n if (isZodSchemaV4(schema)) {\n try {\n const data = await parseAsync(schema, input);\n return {\n success: true,\n data,\n };\n } catch (error) {\n return {\n success: false,\n error: error as z3.ZodError<T>,\n };\n }\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return await schema.safeParseAsync(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Asynchronously parses the input using the provided Zod schema (v3 or v4) and returns the parsed value.\n * Throws an error if parsing fails or if the schema is not a recognized Zod v3 or v4 schema.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {Promise<T>} A promise that resolves to the parsed value.\n * @throws {Error} If parsing fails or the schema is not a recognized Zod v3 or v4 schema.\n */\nexport async function interopParseAsync<T>(\n schema: InteropZodType<T>,\n input: unknown\n): Promise<T> {\n if (isZodSchemaV4(schema)) {\n return await parseAsync(schema, input);\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return await schema.parseAsync(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Safely parses the input using the provided Zod schema (v3 or v4) and returns a result object\n * indicating success or failure. This function is compatible with both Zod v3 and v4 schemas.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {InteropZodSafeParseResult<T>} An object with either the parsed data (on success)\n * or the error (on failure).\n * @throws {Error} If the schema is not a recognized Zod v3 or v4 schema.\n */\nexport function interopSafeParse<T>(\n schema: InteropZodType<T>,\n input: unknown\n): InteropZodSafeParseResult<T> {\n if (isZodSchemaV4(schema)) {\n try {\n const data = parse(schema, input);\n return {\n success: true,\n data,\n };\n } catch (error) {\n return {\n success: false,\n error: error as z3.ZodError<T>,\n };\n }\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return schema.safeParse(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Parses the input using the provided Zod schema (v3 or v4) and returns the parsed value.\n * Throws an error if parsing fails or if the schema is not a recognized Zod v3 or v4 schema.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {T} The parsed value.\n * @throws {Error} If parsing fails or the schema is not a recognized Zod v3 or v4 schema.\n */\nexport function interopParse<T>(schema: InteropZodType<T>, input: unknown): T {\n if (isZodSchemaV4(schema)) {\n return parse(schema, input);\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return schema.parse(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Retrieves the description from a schema definition (v3, v4, standard schema, or plain object), if available.\n *\n * @param {unknown} schema - The schema to extract the description from.\n * @returns {string | undefined} The description of the schema, or undefined if not present.\n */\nexport function getSchemaDescription(\n schema: SerializableSchema | InteropZodType<unknown> | Record<string, unknown>\n): string | undefined {\n if (isZodSchemaV4(schema)) {\n return globalRegistry.get(schema)?.description;\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return (schema as z3.ZodType<Record<string, unknown>>).description;\n }\n if (\"description\" in schema && typeof schema.description === \"string\") {\n return schema.description;\n }\n return undefined;\n}\n\n/**\n * Determines if the provided Zod schema is \"shapeless\".\n * A shapeless schema is one that does not define any object shape,\n * such as ZodString, ZodNumber, ZodBoolean, ZodAny, etc.\n * For ZodObject, it must have no shape keys to be considered shapeless.\n * ZodRecord schemas are considered shapeless since they define dynamic\n * key-value mappings without fixed keys.\n *\n * @param schema The Zod schema to check.\n * @returns {boolean} True if the schema is shapeless, false otherwise.\n */\nexport function isShapelessZodSchema(schema: unknown): boolean {\n if (!isInteropZodSchema(schema)) {\n return false;\n }\n\n // Check for v3 schemas\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n // @ts-expect-error - zod v3 types are not compatible with zod v4 types\n const def = schema._def as { typeName?: string };\n\n // ZodObject is only shaped if it has actual shape keys\n if (def.typeName === \"ZodObject\") {\n const obj = schema as { shape?: Record<string, unknown> };\n return !obj.shape || Object.keys(obj.shape).length === 0;\n }\n\n // ZodRecord is shapeless (dynamic key-value mapping)\n if (def.typeName === \"ZodRecord\") {\n return true;\n }\n }\n\n // Check for v4 schemas\n if (isZodSchemaV4(schema)) {\n const def = schema._zod.def;\n\n // Object type is only shaped if it has actual shape keys\n if (def.type === \"object\") {\n const obj = schema as { shape?: Record<string, unknown> };\n return !obj.shape || Object.keys(obj.shape).length === 0;\n }\n\n // Record type is shapeless (dynamic key-value mapping)\n if (def.type === \"record\") {\n return true;\n }\n }\n\n // For other schemas, check if they have a `shape` property\n // If they don't have shape, they're likely shapeless\n if (typeof schema === \"object\" && schema !== null && !(\"shape\" in schema)) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Determines if the provided Zod schema should be treated as a simple string schema\n * that maps to DynamicTool. This aligns with the type-level constraint of\n * InteropZodType<string | undefined> which only matches basic string schemas.\n * If the provided schema is just z.string(), we can make the determination that\n * the tool is just a generic string tool that doesn't require any input validation.\n *\n * This function only returns true for basic ZodString schemas, including:\n * - Basic string schemas (z.string())\n * - String schemas with validations (z.string().min(1), z.string().email(), etc.)\n *\n * This function returns false for everything else, including:\n * - String schemas with defaults (z.string().default(\"value\"))\n * - Branded string schemas (z.string().brand<\"UserId\">())\n * - String schemas with catch operations (z.string().catch(\"default\"))\n * - Optional/nullable string schemas (z.string().optional())\n * - Transformed schemas (z.string().transform() or z.object().transform())\n * - Object or record schemas, even if they're empty\n * - Any other schema type\n *\n * @param schema The Zod schema to check.\n * @returns {boolean} True if the schema is a basic ZodString, false otherwise.\n */\nexport function isSimpleStringZodSchema(\n schema: unknown\n): schema is InteropZodType<string | undefined> {\n if (!isInteropZodSchema(schema)) {\n return false;\n }\n\n // For v3 schemas\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n // @ts-expect-error - zod v3 types are not compatible with zod v4 types\n const def = schema._def as { typeName?: string };\n\n // Only accept basic ZodString\n return def.typeName === \"ZodString\";\n }\n\n // For v4 schemas\n if (isZodSchemaV4(schema)) {\n const def = schema._zod.def;\n\n // Only accept basic string type\n return def.type === \"string\";\n }\n\n return false;\n}\n\nexport function isZodObjectV3(obj: unknown): obj is ZodObjectV3 {\n // Zod v3 object schemas have _def.typeName === \"ZodObject\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_def\" in obj &&\n typeof obj._def === \"object\" &&\n obj._def !== null &&\n \"typeName\" in obj._def &&\n obj._def.typeName === \"ZodObject\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodObjectV4(obj: unknown): obj is z4.$ZodObject {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 object schemas have _zod.def.type === \"object\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"object\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodArrayV4(obj: unknown): obj is z4.$ZodArray {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 array schemas have _zod.def.type === \"array\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"array\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodOptionalV4(obj: unknown): obj is z4.$ZodOptional {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 optional schemas have _zod.def.type === \"optional\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"optional\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodNullableV4(obj: unknown): obj is z4.$ZodNullable {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 nullable schemas have _zod.def.type === \"nullable\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"nullable\"\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * Determines if the provided value is an InteropZodObject (Zod v3 or v4 object schema).\n *\n * @param obj The value to check.\n * @returns {boolean} True if the value is a Zod v3 or v4 object schema, false otherwise.\n */\nexport function isInteropZodObject(obj: unknown): obj is InteropZodObject {\n if (isZodObjectV3(obj)) return true;\n if (isZodObjectV4(obj)) return true;\n return false;\n}\n\n/**\n * Retrieves the shape (fields) of a Zod object schema, supporting both Zod v3 and v4.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @returns {InteropZodObjectShape<T>} The shape of the object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function getInteropZodObjectShape<T extends InteropZodObject>(\n schema: T\n): InteropZodObjectShape<T> {\n if (isZodSchemaV3(schema)) {\n return schema.shape;\n }\n if (isZodSchemaV4(schema)) {\n return schema._zod.def.shape as InteropZodObjectShape<T>;\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Extends a Zod object schema with additional fields, supporting both Zod v3 and v4.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {InteropZodObjectShape} extension - The fields to add to the schema.\n * @returns {InteropZodObject} The extended Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function extendInteropZodObject<T extends InteropZodObject>(\n schema: T,\n extension: InteropZodObjectShape\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n return schema.extend(extension as z3.ZodRawShape);\n }\n if (isZodSchemaV4(schema)) {\n return util.extend(schema, extension);\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a partial version of a Zod object schema, making all fields optional.\n * Supports both Zod v3 and v4.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @returns {InteropZodObject} The partial Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectPartial<T extends InteropZodObject>(\n schema: T\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n // z3: .partial() exists and works as expected\n return schema.partial();\n }\n if (isZodSchemaV4(schema)) {\n // z4: util.partial exists and works as expected\n return util.partial($ZodOptional, schema, undefined);\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a strict version of a Zod object schema, disallowing unknown keys.\n * Supports both Zod v3 and v4 object schemas. If `recursive` is true, applies strictness\n * recursively to all nested object schemas and arrays of object schemas.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {boolean} [recursive=false] - Whether to apply strictness recursively to nested objects/arrays.\n * @returns {InteropZodObject} The strict Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectStrict<T extends InteropZodObject>(\n schema: T,\n recursive = false\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n // TODO: v3 schemas aren't recursively handled here\n // (currently not necessary since zodToJsonSchema handles this)\n return schema.strict();\n }\n if (isZodObjectV4(schema)) {\n const outputShape: Mutable<z4.$ZodShape> = schema._zod.def.shape;\n if (recursive) {\n for (const [key, keySchema] of Object.entries(schema._zod.def.shape)) {\n // If the shape key is a v4 object schema, we need to make it strict\n if (isZodObjectV4(keySchema)) {\n const outputSchema = interopZodObjectStrict(keySchema, recursive);\n outputShape[key] = outputSchema as ZodObjectV4;\n }\n // If the shape key is a v4 array schema, we need to make the element\n // schema strict if it's an object schema\n else if (isZodArrayV4(keySchema)) {\n let elementSchema = keySchema._zod.def.element;\n if (isZodObjectV4(elementSchema)) {\n elementSchema = interopZodObjectStrict(\n elementSchema,\n recursive\n ) as ZodObjectV4;\n }\n outputShape[key] = clone(keySchema, {\n ...keySchema._zod.def,\n element: elementSchema,\n });\n }\n // Otherwise, just use the keySchema\n else {\n outputShape[key] = keySchema;\n }\n // Assign meta fields to the keySchema\n const meta = globalRegistry.get(keySchema);\n if (meta) globalRegistry.add(outputShape[key], meta);\n }\n }\n const modifiedSchema = clone<ZodObjectV4>(schema, {\n ...schema._zod.def,\n shape: outputShape,\n catchall: _never($ZodNever),\n });\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(modifiedSchema, meta);\n return modifiedSchema;\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a passthrough version of a Zod object schema, allowing unknown keys.\n * Supports both Zod v3 and v4 object schemas. If `recursive` is true, applies passthrough\n * recursively to all nested object schemas and arrays of object schemas.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {boolean} [recursive=false] - Whether to apply passthrough recursively to nested objects/arrays.\n * @returns {InteropZodObject} The passthrough Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectPassthrough<T extends InteropZodObject>(\n schema: T,\n recursive = false\n): InteropZodObject {\n if (isZodObjectV3(schema)) {\n // TODO: v3 schemas aren't recursively handled here\n // (currently not necessary since zodToJsonSchema handles this)\n return schema.passthrough();\n }\n if (isZodObjectV4(schema)) {\n const outputShape: Mutable<z4.$ZodShape> = schema._zod.def.shape;\n if (recursive) {\n for (const [key, keySchema] of Object.entries(schema._zod.def.shape)) {\n // If the shape key is a v4 object schema, we need to make it passthrough\n if (isZodObjectV4(keySchema)) {\n const outputSchema = interopZodObjectPassthrough(\n keySchema,\n recursive\n );\n outputShape[key] = outputSchema as ZodObjectV4;\n }\n // If the shape key is a v4 array schema, we need to make the element\n // schema passthrough if it's an object schema\n else if (isZodArrayV4(keySchema)) {\n let elementSchema = keySchema._zod.def.element;\n if (isZodObjectV4(elementSchema)) {\n elementSchema = interopZodObjectPassthrough(\n elementSchema,\n recursive\n ) as ZodObjectV4;\n }\n outputShape[key] = clone(keySchema, {\n ...keySchema._zod.def,\n element: elementSchema,\n });\n }\n // Otherwise, just use the keySchema\n else {\n outputShape[key] = keySchema;\n }\n // Assign meta fields to the keySchema\n const meta = globalRegistry.get(keySchema);\n if (meta) globalRegistry.add(outputShape[key], meta);\n }\n }\n const modifiedSchema = clone<ZodObjectV4>(schema, {\n ...schema._zod.def,\n shape: outputShape,\n catchall: _unknown($ZodUnknown),\n });\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(modifiedSchema, meta);\n return modifiedSchema;\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a getter function for the default value of a Zod schema, if one is defined.\n * Supports both Zod v3 and v4 schemas. If the schema has a default value,\n * the returned function will return that value when called. If no default is defined,\n * returns undefined.\n *\n * @template T - The type of the Zod schema.\n * @param {T} schema - The Zod schema instance (either v3 or v4).\n * @returns {(() => InferInteropZodOutput<T>) | undefined} A function that returns the default value, or undefined if no default is set.\n */\nexport function getInteropZodDefaultGetter<T extends InteropZodType>(\n schema: T\n): (() => InferInteropZodOutput<T>) | undefined {\n if (isZodSchemaV3(schema)) {\n try {\n const defaultValue = schema.parse(undefined);\n return () => defaultValue as InferInteropZodOutput<T>;\n } catch {\n return undefined;\n }\n }\n if (isZodSchemaV4(schema)) {\n try {\n const defaultValue = parse(schema, undefined);\n return () => defaultValue as InferInteropZodOutput<T>;\n } catch {\n return undefined;\n }\n }\n return undefined;\n}\n\nfunction isZodTransformV3(\n schema: InteropZodType\n): schema is z3.ZodEffects<z3.ZodTypeAny> {\n return (\n isZodSchemaV3(schema) &&\n \"typeName\" in schema._def &&\n schema._def.typeName === \"ZodEffects\"\n );\n}\n\nfunction isZodTransformV4(schema: InteropZodType): schema is z4.$ZodPipe {\n return isZodSchemaV4(schema) && schema._zod.def.type === \"pipe\";\n}\n\nfunction interopZodTransformInputSchemaImpl(\n schema: InteropZodType,\n recursive: boolean,\n cache: WeakMap<InteropZodType, InteropZodType>\n): InteropZodType {\n const cached = cache.get(schema);\n if (cached !== undefined) {\n return cached;\n }\n\n // Zod v3: ._def.schema is the input schema for ZodEffects (transform)\n if (isZodSchemaV3(schema)) {\n if (isZodTransformV3(schema)) {\n return interopZodTransformInputSchemaImpl(\n schema._def.schema,\n recursive,\n cache\n );\n }\n // TODO: v3 schemas aren't recursively handled here\n // (currently not necessary since zodToJsonSchema handles this)\n return schema;\n }\n\n // Zod v4: _def.type is the input schema for ZodEffects (transform)\n if (isZodSchemaV4(schema)) {\n let outputSchema: InteropZodType = schema;\n if (isZodTransformV4(schema)) {\n outputSchema = interopZodTransformInputSchemaImpl(\n schema._zod.def.in,\n recursive,\n cache\n );\n }\n if (recursive) {\n // Handle nested object schemas\n if (isZodObjectV4(outputSchema)) {\n const outputShape: Mutable<z4.$ZodShape> = {};\n for (const [key, keySchema] of Object.entries(\n outputSchema._zod.def.shape\n )) {\n outputShape[key] = interopZodTransformInputSchemaImpl(\n keySchema,\n recursive,\n cache\n ) as z4.$ZodType;\n }\n outputSchema = clone<ZodObjectV4>(outputSchema, {\n ...outputSchema._zod.def,\n shape: outputShape,\n });\n }\n // Handle nested array schemas\n else if (isZodArrayV4(outputSchema)) {\n const elementSchema = interopZodTransformInputSchemaImpl(\n outputSchema._zod.def.element,\n recursive,\n cache\n );\n outputSchema = clone<z4.$ZodArray>(outputSchema, {\n ...outputSchema._zod.def,\n element: elementSchema as z4.$ZodType,\n });\n }\n // Handle optional schemas\n else if (isZodOptionalV4(outputSchema)) {\n const innerSchema = interopZodTransformInputSchemaImpl(\n outputSchema._zod.def.innerType as InteropZodType,\n recursive,\n cache\n );\n outputSchema = clone<z4.$ZodOptional>(outputSchema, {\n ...outputSchema._zod.def,\n innerType: innerSchema as z4.$ZodType,\n });\n }\n // Handle nullable schemas\n else if (isZodNullableV4(outputSchema)) {\n const innerSchema = interopZodTransformInputSchemaImpl(\n outputSchema._zod.def.innerType as InteropZodType,\n recursive,\n cache\n );\n outputSchema = clone<z4.$ZodNullable>(outputSchema, {\n ...outputSchema._zod.def,\n innerType: innerSchema as z4.$ZodType,\n });\n }\n }\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(outputSchema as z4.$ZodType, meta);\n cache.set(schema, outputSchema);\n return outputSchema;\n }\n\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Returns the input type of a Zod transform schema, for both v3 and v4.\n * If the schema is not a transform, returns undefined. If `recursive` is true,\n * recursively processes nested object schemas and arrays of object schemas.\n *\n * @param schema - The Zod schema instance (v3 or v4)\n * @param {boolean} [recursive=false] - Whether to recursively process nested objects/arrays.\n * @returns The input Zod schema of the transform, or undefined if not a transform\n */\nexport function interopZodTransformInputSchema(\n schema: InteropZodType,\n recursive = false\n): InteropZodType {\n const cache = new WeakMap<InteropZodType, InteropZodType>();\n return interopZodTransformInputSchemaImpl(schema, recursive, cache);\n}\n\n/**\n * Creates a modified version of a Zod object schema where fields matching a predicate are made optional.\n * Supports both Zod v3 and v4 schemas and preserves the original schema version.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {(key: string, value: InteropZodType) => boolean} predicate - Function to determine which fields should be optional.\n * @returns {InteropZodObject} The modified Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectMakeFieldsOptional<T extends InteropZodObject>(\n schema: T,\n predicate: (key: string, value: InteropZodType) => boolean\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n const shape = getInteropZodObjectShape(schema);\n const modifiedShape: Record<string, z3.ZodTypeAny> = {};\n\n for (const [key, value] of Object.entries(shape)) {\n if (predicate(key, value)) {\n // Make this field optional using v3 methods\n modifiedShape[key] = (value as z3.ZodTypeAny).optional();\n } else {\n // Keep field as-is\n modifiedShape[key] = value;\n }\n }\n\n // Use v3's extend method to create a new schema with the modified shape\n return schema.extend(modifiedShape as z3.ZodRawShape);\n }\n\n if (isZodSchemaV4(schema)) {\n const shape = getInteropZodObjectShape(schema);\n const outputShape: Mutable<z4.$ZodShape> = { ...schema._zod.def.shape };\n\n for (const [key, value] of Object.entries(shape)) {\n if (predicate(key, value)) {\n // Make this field optional using v4 methods\n outputShape[key] = new $ZodOptional({\n type: \"optional\" as const,\n innerType: value as z4.$ZodType,\n });\n }\n // Otherwise keep the field as-is (already in outputShape)\n }\n\n const modifiedSchema = clone<ZodObjectV4>(schema, {\n ...schema._zod.def,\n shape: outputShape,\n });\n\n // Preserve metadata\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(modifiedSchema, meta);\n\n return modifiedSchema;\n }\n\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\nexport function isInteropZodError(e: unknown) {\n return (\n // eslint-disable-next-line no-instanceof/no-instanceof\n e instanceof Error &&\n (e.constructor.name === \"ZodError\" || e.constructor.name === \"$ZodError\")\n );\n}\n"],"mappings":";;;AA6GA,SAAgB,cACd,QACyC;AACzC,KAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,QAAO;CAGT,MAAM,MAAM;AACZ,KAAI,EAAE,UAAU,KACd,QAAO;CAGT,MAAM,MAAM,IAAI;AAChB,QACE,OAAO,QAAQ,YACf,QAAQ,QACR,SAAU;;AAId,SAAgB,cACd,QACuD;AACvD,KAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,QAAO;CAGT,MAAM,MAAM;AACZ,KAAI,EAAE,UAAU,QAAQ,UAAU,IAChC,QAAO;CAGT,MAAM,MAAM,IAAI;AAChB,QACE,OAAO,QAAQ,YACf,OAAO,QACP,cAAe;;;AAKnB,SAAg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C,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,KAAI,UAAU,KAAK,MAAM,CAEvB,eAAc,OAAQ,MAAwB,UAAU;MAGxD,eAAc,OAAO;AAKzB,SAAO,OAAO,OAAO,cAAgC;;AAGvD,KAAI,cAAc,OAAO,EAAE;EACzB,MAAM,QAAQ,yBAAyB,OAAO;EAC9C,MAAM,cAAqC,EAAE,GAAG,OAAO,KAAK,IAAI,OAAO;AAEvE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,KAAI,UAAU,KAAK,MAAM,CAEvB,aAAY,OAAO,IAAI,aAAa;GAClC,MAAM;GACN,WAAW;GACZ,CAAC;EAKN,MAAM,iBAAiB,MAAmB,QAAQ;GAChD,GAAG,OAAO,KAAK;GACf,OAAO;GACR,CAAC;EAGF,MAAM,OAAO,eAAe,IAAI,OAAO;AACvC,MAAI,KAAM,gBAAe,IAAI,gBAAgB,KAAK;AAElD,SAAO;;AAGT,OAAM,IAAI,MACR,8DACD;;AAGH,SAAgB,kBAAkB,GAAY;AAC5C,QAEE,aAAa,UACZ,EAAE,YAAY,SAAS,cAAc,EAAE,YAAY,SAAS"}
1
+ {"version":3,"file":"zod.js","names":[],"sources":["../../../src/utils/types/zod.ts"],"sourcesContent":["import type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\nimport type * as z4Classic from \"zod/v4\";\n// Import from main \"zod\" package to get the types users would get with `import { z } from \"zod\"`\n// This is important for zod v4.x where the main package uses the classic/compat API\nimport type * as zodMain from \"zod\";\nimport {\n parse,\n parseAsync,\n globalRegistry,\n util,\n clone,\n _unknown,\n _never,\n $ZodUnknown,\n $ZodNever,\n $ZodOptional,\n} from \"zod/v4/core\";\nimport { SerializableSchema } from \"../standard_schema.js\";\n\nexport type ZodStringV3 = z3.ZodString;\n\nexport type ZodStringV4 = z4.$ZodType<string, unknown>;\n\n// ZodObject in zod v3 and zod v4's v3 compat layer has 5 type parameters:\n// T (shape), UnknownKeys, Catchall, Output, Input\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ZodObjectV3 = z3.ZodObject<any, any, any, any, any>;\n\n// Core $ZodObject type from \"zod/v4/core\"\nexport type ZodObjectV4 = z4.$ZodObject;\n\n// Classic ZodObject type from \"zod/v4\" (the classic/compat API)\n// This is what users get when using `import { z } from \"zod\"` with zod v4.x\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ZodObjectV4Classic = z4Classic.ZodObject<any, any>;\n\n// Main \"zod\" package ZodObject - the type users get with `import { z } from \"zod\"`\n// In zod v4.x, this uses the v4 classic API with 2 type params (Shape, Config)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ZodObjectMain = zodMain.ZodObject<any, any>;\n\nexport type ZodDefaultV3<T extends z3.ZodTypeAny> = z3.ZodDefault<T>;\nexport type ZodDefaultV4<T extends z4.SomeType> = z4.$ZodDefault<T>;\nexport type ZodOptionalV3<T extends z3.ZodTypeAny> = z3.ZodOptional<T>;\nexport type ZodOptionalV4<T extends z4.SomeType> = z4.$ZodOptional<T>;\nexport type ZodNullableV4<T extends z4.SomeType> = z4.$ZodNullable<T>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InteropZodType<Output = any, Input = Output> =\n | z3.ZodType<Output, z3.ZodTypeDef, Input>\n | z4.$ZodType<Output, Input>;\n\nexport type InteropZodObject =\n | ZodObjectV3\n | ZodObjectV4\n | ZodObjectV4Classic\n | ZodObjectMain;\nexport type InteropZodDefault<T = InteropZodObjectShape> =\n T extends z3.ZodTypeAny\n ? ZodDefaultV3<T>\n : T extends z4.SomeType\n ? ZodDefaultV4<T>\n : never;\nexport type InteropZodOptional<T = InteropZodObjectShape> =\n T extends z3.ZodTypeAny\n ? ZodOptionalV3<T>\n : T extends z4.SomeType\n ? ZodOptionalV4<T>\n : never;\n\nexport type InteropZodObjectShape<\n T extends InteropZodObject = InteropZodObject,\n> =\n T extends z3.ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : T extends z4.$ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : T extends z4Classic.ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : T extends zodMain.ZodObject<infer Shape>\n ? { [K in keyof Shape]: Shape[K] }\n : never;\n\nexport type InteropZodIssue = z3.ZodIssue | z4.$ZodIssue;\n\n// Simplified type inference to avoid circular dependencies\nexport type InferInteropZodInput<T> =\n T extends z3.ZodType<unknown, z3.ZodTypeDef, infer Input>\n ? Input\n : T extends z4.$ZodType<unknown, infer Input>\n ? Input\n : T extends { _zod: { input: infer Input } }\n ? Input\n : never;\n\nexport type InferInteropZodOutput<T> =\n T extends z3.ZodType<infer Output, z3.ZodTypeDef, unknown>\n ? Output\n : T extends z4.$ZodType<infer Output, unknown>\n ? Output\n : T extends { _zod: { output: infer Output } }\n ? Output\n : never;\n\nexport type Mutable<T> = {\n -readonly [P in keyof T]: T[P];\n};\n\nexport function isZodSchemaV4(\n schema: unknown\n): schema is z4.$ZodType<unknown, unknown> {\n if (typeof schema !== \"object\" || schema === null) {\n return false;\n }\n\n const obj = schema as Record<string, unknown>;\n if (!(\"_zod\" in obj)) {\n return false;\n }\n\n const zod = obj._zod;\n return (\n typeof zod === \"object\" &&\n zod !== null &&\n \"def\" in (zod as Record<string, unknown>)\n );\n}\n\nexport function isZodSchemaV3(\n schema: unknown\n): schema is z3.ZodType<unknown, z3.ZodTypeDef, unknown> {\n if (typeof schema !== \"object\" || schema === null) {\n return false;\n }\n\n const obj = schema as Record<string, unknown>;\n if (!(\"_def\" in obj) || \"_zod\" in obj) {\n return false;\n }\n\n const def = obj._def;\n return (\n typeof def === \"object\" &&\n def != null &&\n \"typeName\" in (def as Record<string, unknown>)\n );\n}\n\n/** Backward compatible isZodSchema for Zod 3 */\nexport function isZodSchema<\n RunOutput extends Record<string, unknown> = Record<string, unknown>,\n>(\n schema: z3.ZodType<RunOutput> | Record<string, unknown>\n): schema is z3.ZodType<RunOutput> {\n if (isZodSchemaV4(schema)) {\n console.warn(\n \"[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior.\"\n );\n }\n return isZodSchemaV3(schema);\n}\n\n/**\n * Given either a Zod schema, or plain object, determine if the input is a Zod schema.\n *\n * @param {unknown} input\n * @returns {boolean} Whether or not the provided input is a Zod schema.\n */\nexport function isInteropZodSchema(input: unknown): input is InteropZodType {\n if (!input) {\n return false;\n }\n if (typeof input !== \"object\") {\n return false;\n }\n if (Array.isArray(input)) {\n return false;\n }\n if (\n isZodSchemaV4(input) ||\n isZodSchemaV3(input as z3.ZodType<Record<string, unknown>>)\n ) {\n return true;\n }\n return false;\n}\n\nexport type InteropZodLiteral = z3.ZodLiteral<unknown> | z4.$ZodLiteral;\n\nexport function isZodLiteralV3(obj: unknown): obj is z3.ZodLiteral<unknown> {\n // Zod v3 literal schemas have _def.typeName === \"ZodLiteral\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_def\" in obj &&\n typeof obj._def === \"object\" &&\n obj._def !== null &&\n \"typeName\" in obj._def &&\n obj._def.typeName === \"ZodLiteral\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodLiteralV4(obj: unknown): obj is z4.$ZodLiteral {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 literal schemas have _zod.def.type === \"literal\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"literal\"\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * Determines if the provided value is an InteropZodLiteral (Zod v3 or v4 literal schema).\n *\n * @param obj The value to check.\n * @returns {boolean} True if the value is a Zod v3 or v4 literal schema, false otherwise.\n */\nexport function isInteropZodLiteral(obj: unknown): obj is InteropZodLiteral {\n if (isZodLiteralV3(obj)) return true;\n if (isZodLiteralV4(obj)) return true;\n return false;\n}\n\ntype InteropZodSafeParseResult<T> = z3.SafeParseReturnType<T, T>;\n\n/**\n * Asynchronously parses the input using the provided Zod schema (v3 or v4) and returns a safe parse result.\n * This function handles both Zod v3 and v4 schemas, returning a result object indicating success or failure.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {Promise<InteropZodSafeParseResult<T>>} A promise that resolves to a safe parse result object.\n * @throws {Error} If the schema is not a recognized Zod v3 or v4 schema.\n */\nexport async function interopSafeParseAsync<T>(\n schema: InteropZodType<T>,\n input: unknown\n): Promise<InteropZodSafeParseResult<T>> {\n if (isZodSchemaV4(schema)) {\n try {\n const data = await parseAsync(schema, input);\n return {\n success: true,\n data,\n };\n } catch (error) {\n return {\n success: false,\n error: error as z3.ZodError<T>,\n };\n }\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return await schema.safeParseAsync(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Asynchronously parses the input using the provided Zod schema (v3 or v4) and returns the parsed value.\n * Throws an error if parsing fails or if the schema is not a recognized Zod v3 or v4 schema.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {Promise<T>} A promise that resolves to the parsed value.\n * @throws {Error} If parsing fails or the schema is not a recognized Zod v3 or v4 schema.\n */\nexport async function interopParseAsync<T>(\n schema: InteropZodType<T>,\n input: unknown\n): Promise<T> {\n if (isZodSchemaV4(schema)) {\n return await parseAsync(schema, input);\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return await schema.parseAsync(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Safely parses the input using the provided Zod schema (v3 or v4) and returns a result object\n * indicating success or failure. This function is compatible with both Zod v3 and v4 schemas.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {InteropZodSafeParseResult<T>} An object with either the parsed data (on success)\n * or the error (on failure).\n * @throws {Error} If the schema is not a recognized Zod v3 or v4 schema.\n */\nexport function interopSafeParse<T>(\n schema: InteropZodType<T>,\n input: unknown\n): InteropZodSafeParseResult<T> {\n if (isZodSchemaV4(schema)) {\n try {\n const data = parse(schema, input);\n return {\n success: true,\n data,\n };\n } catch (error) {\n return {\n success: false,\n error: error as z3.ZodError<T>,\n };\n }\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return schema.safeParse(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Parses the input using the provided Zod schema (v3 or v4) and returns the parsed value.\n * Throws an error if parsing fails or if the schema is not a recognized Zod v3 or v4 schema.\n *\n * @template T - The expected output type of the schema.\n * @param {InteropZodType<T>} schema - The Zod schema (v3 or v4) to use for parsing.\n * @param {unknown} input - The input value to parse.\n * @returns {T} The parsed value.\n * @throws {Error} If parsing fails or the schema is not a recognized Zod v3 or v4 schema.\n */\nexport function interopParse<T>(schema: InteropZodType<T>, input: unknown): T {\n if (isZodSchemaV4(schema)) {\n return parse(schema, input);\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return schema.parse(input);\n }\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Retrieves the description from a schema definition (v3, v4, standard schema, or plain object), if available.\n *\n * @param {unknown} schema - The schema to extract the description from.\n * @returns {string | undefined} The description of the schema, or undefined if not present.\n */\nexport function getSchemaDescription(\n schema: SerializableSchema | InteropZodType<unknown> | Record<string, unknown>\n): string | undefined {\n if (isZodSchemaV4(schema)) {\n return globalRegistry.get(schema)?.description;\n }\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n return (schema as z3.ZodType<Record<string, unknown>>).description;\n }\n if (\"description\" in schema && typeof schema.description === \"string\") {\n return schema.description;\n }\n return undefined;\n}\n\n/**\n * Determines if the provided Zod schema is \"shapeless\".\n * A shapeless schema is one that does not define any object shape,\n * such as ZodString, ZodNumber, ZodBoolean, ZodAny, etc.\n * For ZodObject, it must have no shape keys to be considered shapeless.\n * ZodRecord schemas are considered shapeless since they define dynamic\n * key-value mappings without fixed keys.\n *\n * @param schema The Zod schema to check.\n * @returns {boolean} True if the schema is shapeless, false otherwise.\n */\nexport function isShapelessZodSchema(schema: unknown): boolean {\n if (!isInteropZodSchema(schema)) {\n return false;\n }\n\n // Check for v3 schemas\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n // @ts-expect-error - zod v3 types are not compatible with zod v4 types\n const def = schema._def as { typeName?: string };\n\n // ZodObject is only shaped if it has actual shape keys\n if (def.typeName === \"ZodObject\") {\n const obj = schema as { shape?: Record<string, unknown> };\n return !obj.shape || Object.keys(obj.shape).length === 0;\n }\n\n // ZodRecord is shapeless (dynamic key-value mapping)\n if (def.typeName === \"ZodRecord\") {\n return true;\n }\n }\n\n // Check for v4 schemas\n if (isZodSchemaV4(schema)) {\n const def = schema._zod.def;\n\n // Object type is only shaped if it has actual shape keys\n if (def.type === \"object\") {\n const obj = schema as { shape?: Record<string, unknown> };\n return !obj.shape || Object.keys(obj.shape).length === 0;\n }\n\n // Record type is shapeless (dynamic key-value mapping)\n if (def.type === \"record\") {\n return true;\n }\n }\n\n // For other schemas, check if they have a `shape` property\n // If they don't have shape, they're likely shapeless\n if (typeof schema === \"object\" && schema !== null && !(\"shape\" in schema)) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Determines if the provided Zod schema should be treated as a simple string schema\n * that maps to DynamicTool. This aligns with the type-level constraint of\n * InteropZodType<string | undefined> which only matches basic string schemas.\n * If the provided schema is just z.string(), we can make the determination that\n * the tool is just a generic string tool that doesn't require any input validation.\n *\n * This function only returns true for basic ZodString schemas, including:\n * - Basic string schemas (z.string())\n * - String schemas with validations (z.string().min(1), z.string().email(), etc.)\n *\n * This function returns false for everything else, including:\n * - String schemas with defaults (z.string().default(\"value\"))\n * - Branded string schemas (z.string().brand<\"UserId\">())\n * - String schemas with catch operations (z.string().catch(\"default\"))\n * - Optional/nullable string schemas (z.string().optional())\n * - Transformed schemas (z.string().transform() or z.object().transform())\n * - Object or record schemas, even if they're empty\n * - Any other schema type\n *\n * @param schema The Zod schema to check.\n * @returns {boolean} True if the schema is a basic ZodString, false otherwise.\n */\nexport function isSimpleStringZodSchema(\n schema: unknown\n): schema is InteropZodType<string | undefined> {\n if (!isInteropZodSchema(schema)) {\n return false;\n }\n\n // For v3 schemas\n if (isZodSchemaV3(schema as z3.ZodType<Record<string, unknown>>)) {\n // @ts-expect-error - zod v3 types are not compatible with zod v4 types\n const def = schema._def as { typeName?: string };\n\n // Only accept basic ZodString\n return def.typeName === \"ZodString\";\n }\n\n // For v4 schemas\n if (isZodSchemaV4(schema)) {\n const def = schema._zod.def;\n\n // Only accept basic string type\n return def.type === \"string\";\n }\n\n return false;\n}\n\nexport function isZodObjectV3(obj: unknown): obj is ZodObjectV3 {\n // Zod v3 object schemas have _def.typeName === \"ZodObject\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_def\" in obj &&\n typeof obj._def === \"object\" &&\n obj._def !== null &&\n \"typeName\" in obj._def &&\n obj._def.typeName === \"ZodObject\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodObjectV4(obj: unknown): obj is z4.$ZodObject {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 object schemas have _zod.def.type === \"object\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"object\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodArrayV4(obj: unknown): obj is z4.$ZodArray {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 array schemas have _zod.def.type === \"array\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"array\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodOptionalV4(obj: unknown): obj is z4.$ZodOptional {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 optional schemas have _zod.def.type === \"optional\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"optional\"\n ) {\n return true;\n }\n return false;\n}\n\nexport function isZodNullableV4(obj: unknown): obj is z4.$ZodNullable {\n if (!isZodSchemaV4(obj)) return false;\n // Zod v4 nullable schemas have _zod.def.type === \"nullable\"\n if (\n typeof obj === \"object\" &&\n obj !== null &&\n \"_zod\" in obj &&\n typeof obj._zod === \"object\" &&\n obj._zod !== null &&\n \"def\" in obj._zod &&\n typeof obj._zod.def === \"object\" &&\n obj._zod.def !== null &&\n \"type\" in obj._zod.def &&\n obj._zod.def.type === \"nullable\"\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * Determines if the provided value is an InteropZodObject (Zod v3 or v4 object schema).\n *\n * @param obj The value to check.\n * @returns {boolean} True if the value is a Zod v3 or v4 object schema, false otherwise.\n */\nexport function isInteropZodObject(obj: unknown): obj is InteropZodObject {\n if (isZodObjectV3(obj)) return true;\n if (isZodObjectV4(obj)) return true;\n return false;\n}\n\n/**\n * Retrieves the shape (fields) of a Zod object schema, supporting both Zod v3 and v4.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @returns {InteropZodObjectShape<T>} The shape of the object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function getInteropZodObjectShape<T extends InteropZodObject>(\n schema: T\n): InteropZodObjectShape<T> {\n if (isZodSchemaV3(schema)) {\n return schema.shape;\n }\n if (isZodSchemaV4(schema)) {\n return schema._zod.def.shape as InteropZodObjectShape<T>;\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Extends a Zod object schema with additional fields, supporting both Zod v3 and v4.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {InteropZodObjectShape} extension - The fields to add to the schema.\n * @returns {InteropZodObject} The extended Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function extendInteropZodObject<T extends InteropZodObject>(\n schema: T,\n extension: InteropZodObjectShape\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n return schema.extend(extension as z3.ZodRawShape);\n }\n if (isZodSchemaV4(schema)) {\n return util.extend(schema, extension);\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a partial version of a Zod object schema, making all fields optional.\n * Supports both Zod v3 and v4.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @returns {InteropZodObject} The partial Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectPartial<T extends InteropZodObject>(\n schema: T\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n // z3: .partial() exists and works as expected\n return schema.partial();\n }\n if (isZodSchemaV4(schema)) {\n // z4: util.partial exists and works as expected\n return util.partial($ZodOptional, schema, undefined);\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a strict version of a Zod object schema, disallowing unknown keys.\n * Supports both Zod v3 and v4 object schemas. If `recursive` is true, applies strictness\n * recursively to all nested object schemas and arrays of object schemas.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {boolean} [recursive=false] - Whether to apply strictness recursively to nested objects/arrays.\n * @returns {InteropZodObject} The strict Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectStrict<T extends InteropZodObject>(\n schema: T,\n recursive = false\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n // TODO: v3 schemas aren't recursively handled here\n // (currently not necessary since zodToJsonSchema handles this)\n return schema.strict();\n }\n if (isZodObjectV4(schema)) {\n const outputShape: Mutable<z4.$ZodShape> = schema._zod.def.shape;\n if (recursive) {\n for (const [key, keySchema] of Object.entries(schema._zod.def.shape)) {\n // If the shape key is a v4 object schema, we need to make it strict\n if (isZodObjectV4(keySchema)) {\n const outputSchema = interopZodObjectStrict(keySchema, recursive);\n outputShape[key] = outputSchema as ZodObjectV4;\n }\n // If the shape key is a v4 array schema, we need to make the element\n // schema strict if it's an object schema\n else if (isZodArrayV4(keySchema)) {\n let elementSchema = keySchema._zod.def.element;\n if (isZodObjectV4(elementSchema)) {\n elementSchema = interopZodObjectStrict(\n elementSchema,\n recursive\n ) as ZodObjectV4;\n }\n outputShape[key] = clone(keySchema, {\n ...keySchema._zod.def,\n element: elementSchema,\n });\n }\n // Otherwise, just use the keySchema\n else {\n outputShape[key] = keySchema;\n }\n // Assign meta fields to the keySchema\n const meta = globalRegistry.get(keySchema);\n if (meta) globalRegistry.add(outputShape[key], meta);\n }\n }\n const modifiedSchema = clone<ZodObjectV4>(schema, {\n ...schema._zod.def,\n shape: outputShape,\n catchall: _never($ZodNever),\n });\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(modifiedSchema, meta);\n return modifiedSchema;\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a passthrough version of a Zod object schema, allowing unknown keys.\n * Supports both Zod v3 and v4 object schemas. If `recursive` is true, applies passthrough\n * recursively to all nested object schemas and arrays of object schemas.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {boolean} [recursive=false] - Whether to apply passthrough recursively to nested objects/arrays.\n * @returns {InteropZodObject} The passthrough Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectPassthrough<T extends InteropZodObject>(\n schema: T,\n recursive = false\n): InteropZodObject {\n if (isZodObjectV3(schema)) {\n // TODO: v3 schemas aren't recursively handled here\n // (currently not necessary since zodToJsonSchema handles this)\n return schema.passthrough();\n }\n if (isZodObjectV4(schema)) {\n const outputShape: Mutable<z4.$ZodShape> = schema._zod.def.shape;\n if (recursive) {\n for (const [key, keySchema] of Object.entries(schema._zod.def.shape)) {\n // If the shape key is a v4 object schema, we need to make it passthrough\n if (isZodObjectV4(keySchema)) {\n const outputSchema = interopZodObjectPassthrough(\n keySchema,\n recursive\n );\n outputShape[key] = outputSchema as ZodObjectV4;\n }\n // If the shape key is a v4 array schema, we need to make the element\n // schema passthrough if it's an object schema\n else if (isZodArrayV4(keySchema)) {\n let elementSchema = keySchema._zod.def.element;\n if (isZodObjectV4(elementSchema)) {\n elementSchema = interopZodObjectPassthrough(\n elementSchema,\n recursive\n ) as ZodObjectV4;\n }\n outputShape[key] = clone(keySchema, {\n ...keySchema._zod.def,\n element: elementSchema,\n });\n }\n // Otherwise, just use the keySchema\n else {\n outputShape[key] = keySchema;\n }\n // Assign meta fields to the keySchema\n const meta = globalRegistry.get(keySchema);\n if (meta) globalRegistry.add(outputShape[key], meta);\n }\n }\n const modifiedSchema = clone<ZodObjectV4>(schema, {\n ...schema._zod.def,\n shape: outputShape,\n catchall: _unknown($ZodUnknown),\n });\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(modifiedSchema, meta);\n return modifiedSchema;\n }\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\n/**\n * Returns a getter function for the default value of a Zod schema, if one is defined.\n * Supports both Zod v3 and v4 schemas. If the schema has a default value,\n * the returned function will return that value when called. If no default is defined,\n * returns undefined.\n *\n * @template T - The type of the Zod schema.\n * @param {T} schema - The Zod schema instance (either v3 or v4).\n * @returns {(() => InferInteropZodOutput<T>) | undefined} A function that returns the default value, or undefined if no default is set.\n */\nexport function getInteropZodDefaultGetter<T extends InteropZodType>(\n schema: T\n): (() => InferInteropZodOutput<T>) | undefined {\n if (isZodSchemaV3(schema)) {\n try {\n const defaultValue = schema.parse(undefined);\n return () => defaultValue as InferInteropZodOutput<T>;\n } catch {\n return undefined;\n }\n }\n if (isZodSchemaV4(schema)) {\n try {\n const defaultValue = parse(schema, undefined);\n return () => defaultValue as InferInteropZodOutput<T>;\n } catch {\n return undefined;\n }\n }\n return undefined;\n}\n\nfunction isZodTransformV3(\n schema: InteropZodType\n): schema is z3.ZodEffects<z3.ZodTypeAny> {\n return (\n isZodSchemaV3(schema) &&\n \"typeName\" in schema._def &&\n schema._def.typeName === \"ZodEffects\"\n );\n}\n\nfunction isZodTransformV4(schema: InteropZodType): schema is z4.$ZodPipe {\n return isZodSchemaV4(schema) && schema._zod.def.type === \"pipe\";\n}\n\nfunction interopZodTransformInputSchemaImpl(\n schema: InteropZodType,\n recursive: boolean,\n cache: WeakMap<InteropZodType, InteropZodType>\n): InteropZodType {\n const cached = cache.get(schema);\n if (cached !== undefined) {\n return cached;\n }\n\n // Zod v3: ._def.schema is the input schema for ZodEffects (transform)\n if (isZodSchemaV3(schema)) {\n if (isZodTransformV3(schema)) {\n return interopZodTransformInputSchemaImpl(\n schema._def.schema,\n recursive,\n cache\n );\n }\n // TODO: v3 schemas aren't recursively handled here\n // (currently not necessary since zodToJsonSchema handles this)\n return schema;\n }\n\n // Zod v4: _def.type is the input schema for ZodEffects (transform)\n if (isZodSchemaV4(schema)) {\n let outputSchema: InteropZodType = schema;\n if (isZodTransformV4(schema)) {\n outputSchema = interopZodTransformInputSchemaImpl(\n schema._zod.def.in,\n recursive,\n cache\n );\n }\n if (recursive) {\n // Handle nested object schemas\n if (isZodObjectV4(outputSchema)) {\n const outputShape: Mutable<z4.$ZodShape> = {};\n for (const [key, keySchema] of Object.entries(\n outputSchema._zod.def.shape\n )) {\n outputShape[key] = interopZodTransformInputSchemaImpl(\n keySchema,\n recursive,\n cache\n ) as z4.$ZodType;\n }\n outputSchema = clone<ZodObjectV4>(outputSchema, {\n ...outputSchema._zod.def,\n shape: outputShape,\n });\n }\n // Handle nested array schemas\n else if (isZodArrayV4(outputSchema)) {\n const elementSchema = interopZodTransformInputSchemaImpl(\n outputSchema._zod.def.element,\n recursive,\n cache\n );\n outputSchema = clone<z4.$ZodArray>(outputSchema, {\n ...outputSchema._zod.def,\n element: elementSchema as z4.$ZodType,\n });\n }\n // Handle optional schemas\n else if (isZodOptionalV4(outputSchema)) {\n const innerSchema = interopZodTransformInputSchemaImpl(\n outputSchema._zod.def.innerType as InteropZodType,\n recursive,\n cache\n );\n outputSchema = clone<z4.$ZodOptional>(outputSchema, {\n ...outputSchema._zod.def,\n innerType: innerSchema as z4.$ZodType,\n });\n }\n // Handle nullable schemas\n else if (isZodNullableV4(outputSchema)) {\n const innerSchema = interopZodTransformInputSchemaImpl(\n outputSchema._zod.def.innerType as InteropZodType,\n recursive,\n cache\n );\n outputSchema = clone<z4.$ZodNullable>(outputSchema, {\n ...outputSchema._zod.def,\n innerType: innerSchema as z4.$ZodType,\n });\n }\n }\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(outputSchema as z4.$ZodType, meta);\n cache.set(schema, outputSchema);\n return outputSchema;\n }\n\n throw new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n\n/**\n * Returns the input type of a Zod transform schema, for both v3 and v4.\n * If the schema is not a transform, returns undefined. If `recursive` is true,\n * recursively processes nested object schemas and arrays of object schemas.\n *\n * @param schema - The Zod schema instance (v3 or v4)\n * @param {boolean} [recursive=false] - Whether to recursively process nested objects/arrays.\n * @returns The input Zod schema of the transform, or undefined if not a transform\n */\nexport function interopZodTransformInputSchema(\n schema: InteropZodType,\n recursive = false\n): InteropZodType {\n const cache = new WeakMap<InteropZodType, InteropZodType>();\n return interopZodTransformInputSchemaImpl(schema, recursive, cache);\n}\n\n/**\n * Creates a modified version of a Zod object schema where fields matching a predicate are made optional.\n * Supports both Zod v3 and v4 schemas and preserves the original schema version.\n *\n * @template T - The type of the Zod object schema.\n * @param {T} schema - The Zod object schema instance (either v3 or v4).\n * @param {(key: string, value: InteropZodType) => boolean} predicate - Function to determine which fields should be optional.\n * @returns {InteropZodObject} The modified Zod object schema.\n * @throws {Error} If the schema is not a Zod v3 or v4 object.\n */\nexport function interopZodObjectMakeFieldsOptional<T extends InteropZodObject>(\n schema: T,\n predicate: (key: string, value: InteropZodType) => boolean\n): InteropZodObject {\n if (isZodSchemaV3(schema)) {\n const shape = getInteropZodObjectShape(schema);\n const modifiedShape: Record<string, z3.ZodTypeAny> = {};\n\n for (const [key, value] of Object.entries(shape)) {\n if (predicate(key, value)) {\n // Make this field optional using v3 methods\n modifiedShape[key] = (value as z3.ZodTypeAny).optional();\n } else {\n // Keep field as-is\n modifiedShape[key] = value;\n }\n }\n\n // Use v3's extend method to create a new schema with the modified shape\n return schema.extend(modifiedShape as z3.ZodRawShape);\n }\n\n if (isZodSchemaV4(schema)) {\n const shape = getInteropZodObjectShape(schema);\n const outputShape: Mutable<z4.$ZodShape> = { ...schema._zod.def.shape };\n\n for (const [key, value] of Object.entries(shape)) {\n if (predicate(key, value)) {\n // Make this field optional using v4 methods\n outputShape[key] = new $ZodOptional({\n type: \"optional\" as const,\n innerType: value as z4.$ZodType,\n });\n }\n // Otherwise keep the field as-is (already in outputShape)\n }\n\n const modifiedSchema = clone<ZodObjectV4>(schema, {\n ...schema._zod.def,\n shape: outputShape,\n });\n\n // Preserve metadata\n const meta = globalRegistry.get(schema);\n if (meta) globalRegistry.add(modifiedSchema, meta);\n\n return modifiedSchema;\n }\n\n throw new Error(\n \"Schema must be an instance of z3.ZodObject or z4.$ZodObject\"\n );\n}\n\nexport function isInteropZodError(e: unknown) {\n return (\n // eslint-disable-next-line no-instanceof/no-instanceof\n e instanceof Error &&\n (e.constructor.name === \"ZodError\" || e.constructor.name === \"$ZodError\")\n );\n}\n"],"mappings":";;AA6GA,SAAgB,cACd,QACyC;AACzC,KAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,QAAO;CAGT,MAAM,MAAM;AACZ,KAAI,EAAE,UAAU,KACd,QAAO;CAGT,MAAM,MAAM,IAAI;AAChB,QACE,OAAO,QAAQ,YACf,QAAQ,QACR,SAAU;;AAId,SAAgB,cACd,QACuD;AACvD,KAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,QAAO;CAGT,MAAM,MAAM;AACZ,KAAI,EAAE,UAAU,QAAQ,UAAU,IAChC,QAAO;CAGT,MAAM,MAAM,IAAI;AAChB,QACE,OAAO,QAAQ,YACf,OAAO,QACP,cAAe;;;AAKnB,SAAgB,YAGd,QACiC;AACjC,KAAI,cAAc,OAAO,CACvB,SAAQ,KACN,4HACD;AAEH,QAAO,cAAc,OAAO;;;;;;;;AAS9B,SAAgB,mBAAmB,OAAyC;AAC1E,KAAI,CAAC,MACH,QAAO;AAET,KAAI,OAAO,UAAU,SACnB,QAAO;AAET,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO;AAET,KACE,cAAc,MAAM,IACpB,cAAc,MAA6C,CAE3D,QAAO;AAET,QAAO;;AAKT,SAAgB,eAAe,KAA6C;AAE1E,KACE,OAAO,QAAQ,YACf,QAAQ,QACR,UAAU,OACV,OAAO,IAAI,SAAS,YACpB,IAAI,SAAS,QACb,cAAc,IAAI,QAClB,IAAI,KAAK,aAAa,aAEtB,QAAO;AAET,QAAO;;AAGT,SAA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G,OAAO,KAAK;GACf,OAAO;GACR,CAAC;EAGF,MAAM,OAAO,eAAe,IAAI,OAAO;AACvC,MAAI,KAAM,gBAAe,IAAI,gBAAgB,KAAK;AAElD,SAAO;;AAGT,OAAM,IAAI,MACR,8DACD;;AAGH,SAAgB,kBAAkB,GAAY;AAC5C,QAEE,aAAa,UACZ,EAAE,YAAY,SAAS,cAAc,EAAE,YAAY,SAAS"}
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/utils/zod-to-json-schema/Options.ts
3
2
  const ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
4
3
  const defaultOptions = {
@@ -32,9 +31,9 @@ const getDefaultOptions = (options) => typeof options === "string" ? {
32
31
  ...defaultOptions,
33
32
  ...options
34
33
  };
35
-
36
34
  //#endregion
37
35
  exports.defaultOptions = defaultOptions;
38
36
  exports.getDefaultOptions = getDefaultOptions;
39
37
  exports.ignoreOverride = ignoreOverride;
38
+
40
39
  //# sourceMappingURL=Options.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Options.cjs","names":[],"sources":["../../../src/utils/zod-to-json-schema/Options.ts"],"sourcesContent":["import { ZodSchema, ZodTypeDef } from \"zod/v3\";\nimport { Refs, Seen } from \"./Refs\";\nimport { JsonSchema7Type } from \"./parseTypes\";\n\nexport type Targets =\n | \"jsonSchema7\"\n | \"jsonSchema2019-09\"\n | \"openApi3\"\n | \"openAi\";\n\nexport type DateStrategy =\n | \"format:date-time\"\n | \"format:date\"\n | \"string\"\n | \"integer\";\n\nexport const ignoreOverride = Symbol(\n \"Let zodToJsonSchema decide on which parser to use\"\n);\n\nexport type OverrideCallback = (\n def: ZodTypeDef,\n refs: Refs,\n seen: Seen | undefined,\n forceResolution?: boolean\n) => JsonSchema7Type | undefined | typeof ignoreOverride;\n\nexport type PostProcessCallback = (\n jsonSchema: JsonSchema7Type | undefined,\n def: ZodTypeDef,\n refs: Refs\n) => JsonSchema7Type | undefined;\n\nexport const jsonDescription: PostProcessCallback = (jsonSchema, def) => {\n if (def.description) {\n try {\n return {\n ...jsonSchema,\n ...JSON.parse(def.description),\n };\n } catch {}\n }\n\n return jsonSchema;\n};\n\nexport type Options<Target extends Targets = \"jsonSchema7\"> = {\n name: string | undefined;\n $refStrategy: \"root\" | \"relative\" | \"none\" | \"seen\";\n basePath: string[];\n effectStrategy: \"input\" | \"any\";\n pipeStrategy: \"input\" | \"output\" | \"all\";\n dateStrategy: DateStrategy | DateStrategy[];\n mapStrategy: \"entries\" | \"record\";\n removeAdditionalStrategy: \"passthrough\" | \"strict\";\n allowedAdditionalProperties: true | undefined;\n rejectedAdditionalProperties: false | undefined;\n target: Target;\n strictUnions: boolean;\n definitionPath: string;\n definitions: Record<string, ZodSchema>;\n errorMessages: boolean;\n markdownDescription: boolean;\n patternStrategy: \"escape\" | \"preserve\";\n applyRegexFlags: boolean;\n emailStrategy: \"format:email\" | \"format:idn-email\" | \"pattern:zod\";\n base64Strategy: \"format:binary\" | \"contentEncoding:base64\" | \"pattern:zod\";\n nameStrategy: \"ref\" | \"title\";\n override?: OverrideCallback;\n postProcess?: PostProcessCallback;\n openAiAnyTypeName: string;\n};\n\nexport const defaultOptions: Options = {\n name: undefined,\n $refStrategy: \"root\",\n basePath: [\"#\"],\n effectStrategy: \"input\",\n pipeStrategy: \"all\",\n dateStrategy: \"format:date-time\",\n mapStrategy: \"entries\",\n removeAdditionalStrategy: \"passthrough\",\n allowedAdditionalProperties: true,\n rejectedAdditionalProperties: false,\n definitionPath: \"definitions\",\n target: \"jsonSchema7\",\n strictUnions: false,\n definitions: {},\n errorMessages: false,\n markdownDescription: false,\n patternStrategy: \"escape\",\n applyRegexFlags: false,\n emailStrategy: \"format:email\",\n base64Strategy: \"contentEncoding:base64\",\n nameStrategy: \"ref\",\n openAiAnyTypeName: \"OpenAiAnyType\",\n};\n\nexport const getDefaultOptions = <Target extends Targets>(\n options: Partial<Options<Target>> | string | undefined\n) =>\n (typeof options === \"string\"\n ? {\n ...defaultOptions,\n name: options,\n }\n : {\n ...defaultOptions,\n ...options,\n }) as Options<Target>;\n"],"mappings":";;AAgBA,MAAa,iBAAiB,OAC5B,oDACD;AAuDD,MAAa,iBAA0B;CACrC,MAAM;CACN,cAAc;CACd,UAAU,CAAC,IAAI;CACf,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,aAAa;CACb,0BAA0B;CAC1B,6BAA6B;CAC7B,8BAA8B;CAC9B,gBAAgB;CAChB,QAAQ;CACR,cAAc;CACd,aAAa,EAAE;CACf,eAAe;CACf,qBAAqB;CACrB,iBAAiB;CACjB,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,cAAc;CACd,mBAAmB;CACpB;AAED,MAAa,qBACX,YAEC,OAAO,YAAY,WAChB;CACE,GAAG;CACH,MAAM;CACP,GACD;CACE,GAAG;CACH,GAAG;CACJ"}
1
+ {"version":3,"file":"Options.cjs","names":[],"sources":["../../../src/utils/zod-to-json-schema/Options.ts"],"sourcesContent":["import { ZodSchema, ZodTypeDef } from \"zod/v3\";\nimport { Refs, Seen } from \"./Refs\";\nimport { JsonSchema7Type } from \"./parseTypes\";\n\nexport type Targets =\n | \"jsonSchema7\"\n | \"jsonSchema2019-09\"\n | \"openApi3\"\n | \"openAi\";\n\nexport type DateStrategy =\n | \"format:date-time\"\n | \"format:date\"\n | \"string\"\n | \"integer\";\n\nexport const ignoreOverride = Symbol(\n \"Let zodToJsonSchema decide on which parser to use\"\n);\n\nexport type OverrideCallback = (\n def: ZodTypeDef,\n refs: Refs,\n seen: Seen | undefined,\n forceResolution?: boolean\n) => JsonSchema7Type | undefined | typeof ignoreOverride;\n\nexport type PostProcessCallback = (\n jsonSchema: JsonSchema7Type | undefined,\n def: ZodTypeDef,\n refs: Refs\n) => JsonSchema7Type | undefined;\n\nexport const jsonDescription: PostProcessCallback = (jsonSchema, def) => {\n if (def.description) {\n try {\n return {\n ...jsonSchema,\n ...JSON.parse(def.description),\n };\n } catch {}\n }\n\n return jsonSchema;\n};\n\nexport type Options<Target extends Targets = \"jsonSchema7\"> = {\n name: string | undefined;\n $refStrategy: \"root\" | \"relative\" | \"none\" | \"seen\";\n basePath: string[];\n effectStrategy: \"input\" | \"any\";\n pipeStrategy: \"input\" | \"output\" | \"all\";\n dateStrategy: DateStrategy | DateStrategy[];\n mapStrategy: \"entries\" | \"record\";\n removeAdditionalStrategy: \"passthrough\" | \"strict\";\n allowedAdditionalProperties: true | undefined;\n rejectedAdditionalProperties: false | undefined;\n target: Target;\n strictUnions: boolean;\n definitionPath: string;\n definitions: Record<string, ZodSchema>;\n errorMessages: boolean;\n markdownDescription: boolean;\n patternStrategy: \"escape\" | \"preserve\";\n applyRegexFlags: boolean;\n emailStrategy: \"format:email\" | \"format:idn-email\" | \"pattern:zod\";\n base64Strategy: \"format:binary\" | \"contentEncoding:base64\" | \"pattern:zod\";\n nameStrategy: \"ref\" | \"title\";\n override?: OverrideCallback;\n postProcess?: PostProcessCallback;\n openAiAnyTypeName: string;\n};\n\nexport const defaultOptions: Options = {\n name: undefined,\n $refStrategy: \"root\",\n basePath: [\"#\"],\n effectStrategy: \"input\",\n pipeStrategy: \"all\",\n dateStrategy: \"format:date-time\",\n mapStrategy: \"entries\",\n removeAdditionalStrategy: \"passthrough\",\n allowedAdditionalProperties: true,\n rejectedAdditionalProperties: false,\n definitionPath: \"definitions\",\n target: \"jsonSchema7\",\n strictUnions: false,\n definitions: {},\n errorMessages: false,\n markdownDescription: false,\n patternStrategy: \"escape\",\n applyRegexFlags: false,\n emailStrategy: \"format:email\",\n base64Strategy: \"contentEncoding:base64\",\n nameStrategy: \"ref\",\n openAiAnyTypeName: \"OpenAiAnyType\",\n};\n\nexport const getDefaultOptions = <Target extends Targets>(\n options: Partial<Options<Target>> | string | undefined\n) =>\n (typeof options === \"string\"\n ? {\n ...defaultOptions,\n name: options,\n }\n : {\n ...defaultOptions,\n ...options,\n }) as Options<Target>;\n"],"mappings":";AAgBA,MAAa,iBAAiB,OAC5B,oDACD;AAuDD,MAAa,iBAA0B;CACrC,MAAM,KAAA;CACN,cAAc;CACd,UAAU,CAAC,IAAI;CACf,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,aAAa;CACb,0BAA0B;CAC1B,6BAA6B;CAC7B,8BAA8B;CAC9B,gBAAgB;CAChB,QAAQ;CACR,cAAc;CACd,aAAa,EAAE;CACf,eAAe;CACf,qBAAqB;CACrB,iBAAiB;CACjB,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,cAAc;CACd,mBAAmB;CACpB;AAED,MAAa,qBACX,YAEC,OAAO,YAAY,WAChB;CACE,GAAG;CACH,MAAM;CACP,GACD;CACE,GAAG;CACH,GAAG;CACJ"}
@@ -1,3 +1 @@
1
- import "./parseTypes.js";
2
- import "./Refs.js";
3
- import "zod/v3";
1
+ export { };
@@ -31,7 +31,7 @@ const getDefaultOptions = (options) => typeof options === "string" ? {
31
31
  ...defaultOptions,
32
32
  ...options
33
33
  };
34
-
35
34
  //#endregion
36
35
  export { defaultOptions, getDefaultOptions, ignoreOverride };
36
+
37
37
  //# sourceMappingURL=Options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Options.js","names":[],"sources":["../../../src/utils/zod-to-json-schema/Options.ts"],"sourcesContent":["import { ZodSchema, ZodTypeDef } from \"zod/v3\";\nimport { Refs, Seen } from \"./Refs\";\nimport { JsonSchema7Type } from \"./parseTypes\";\n\nexport type Targets =\n | \"jsonSchema7\"\n | \"jsonSchema2019-09\"\n | \"openApi3\"\n | \"openAi\";\n\nexport type DateStrategy =\n | \"format:date-time\"\n | \"format:date\"\n | \"string\"\n | \"integer\";\n\nexport const ignoreOverride = Symbol(\n \"Let zodToJsonSchema decide on which parser to use\"\n);\n\nexport type OverrideCallback = (\n def: ZodTypeDef,\n refs: Refs,\n seen: Seen | undefined,\n forceResolution?: boolean\n) => JsonSchema7Type | undefined | typeof ignoreOverride;\n\nexport type PostProcessCallback = (\n jsonSchema: JsonSchema7Type | undefined,\n def: ZodTypeDef,\n refs: Refs\n) => JsonSchema7Type | undefined;\n\nexport const jsonDescription: PostProcessCallback = (jsonSchema, def) => {\n if (def.description) {\n try {\n return {\n ...jsonSchema,\n ...JSON.parse(def.description),\n };\n } catch {}\n }\n\n return jsonSchema;\n};\n\nexport type Options<Target extends Targets = \"jsonSchema7\"> = {\n name: string | undefined;\n $refStrategy: \"root\" | \"relative\" | \"none\" | \"seen\";\n basePath: string[];\n effectStrategy: \"input\" | \"any\";\n pipeStrategy: \"input\" | \"output\" | \"all\";\n dateStrategy: DateStrategy | DateStrategy[];\n mapStrategy: \"entries\" | \"record\";\n removeAdditionalStrategy: \"passthrough\" | \"strict\";\n allowedAdditionalProperties: true | undefined;\n rejectedAdditionalProperties: false | undefined;\n target: Target;\n strictUnions: boolean;\n definitionPath: string;\n definitions: Record<string, ZodSchema>;\n errorMessages: boolean;\n markdownDescription: boolean;\n patternStrategy: \"escape\" | \"preserve\";\n applyRegexFlags: boolean;\n emailStrategy: \"format:email\" | \"format:idn-email\" | \"pattern:zod\";\n base64Strategy: \"format:binary\" | \"contentEncoding:base64\" | \"pattern:zod\";\n nameStrategy: \"ref\" | \"title\";\n override?: OverrideCallback;\n postProcess?: PostProcessCallback;\n openAiAnyTypeName: string;\n};\n\nexport const defaultOptions: Options = {\n name: undefined,\n $refStrategy: \"root\",\n basePath: [\"#\"],\n effectStrategy: \"input\",\n pipeStrategy: \"all\",\n dateStrategy: \"format:date-time\",\n mapStrategy: \"entries\",\n removeAdditionalStrategy: \"passthrough\",\n allowedAdditionalProperties: true,\n rejectedAdditionalProperties: false,\n definitionPath: \"definitions\",\n target: \"jsonSchema7\",\n strictUnions: false,\n definitions: {},\n errorMessages: false,\n markdownDescription: false,\n patternStrategy: \"escape\",\n applyRegexFlags: false,\n emailStrategy: \"format:email\",\n base64Strategy: \"contentEncoding:base64\",\n nameStrategy: \"ref\",\n openAiAnyTypeName: \"OpenAiAnyType\",\n};\n\nexport const getDefaultOptions = <Target extends Targets>(\n options: Partial<Options<Target>> | string | undefined\n) =>\n (typeof options === \"string\"\n ? {\n ...defaultOptions,\n name: options,\n }\n : {\n ...defaultOptions,\n ...options,\n }) as Options<Target>;\n"],"mappings":";AAgBA,MAAa,iBAAiB,OAC5B,oDACD;AAuDD,MAAa,iBAA0B;CACrC,MAAM;CACN,cAAc;CACd,UAAU,CAAC,IAAI;CACf,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,aAAa;CACb,0BAA0B;CAC1B,6BAA6B;CAC7B,8BAA8B;CAC9B,gBAAgB;CAChB,QAAQ;CACR,cAAc;CACd,aAAa,EAAE;CACf,eAAe;CACf,qBAAqB;CACrB,iBAAiB;CACjB,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,cAAc;CACd,mBAAmB;CACpB;AAED,MAAa,qBACX,YAEC,OAAO,YAAY,WAChB;CACE,GAAG;CACH,MAAM;CACP,GACD;CACE,GAAG;CACH,GAAG;CACJ"}
1
+ {"version":3,"file":"Options.js","names":[],"sources":["../../../src/utils/zod-to-json-schema/Options.ts"],"sourcesContent":["import { ZodSchema, ZodTypeDef } from \"zod/v3\";\nimport { Refs, Seen } from \"./Refs\";\nimport { JsonSchema7Type } from \"./parseTypes\";\n\nexport type Targets =\n | \"jsonSchema7\"\n | \"jsonSchema2019-09\"\n | \"openApi3\"\n | \"openAi\";\n\nexport type DateStrategy =\n | \"format:date-time\"\n | \"format:date\"\n | \"string\"\n | \"integer\";\n\nexport const ignoreOverride = Symbol(\n \"Let zodToJsonSchema decide on which parser to use\"\n);\n\nexport type OverrideCallback = (\n def: ZodTypeDef,\n refs: Refs,\n seen: Seen | undefined,\n forceResolution?: boolean\n) => JsonSchema7Type | undefined | typeof ignoreOverride;\n\nexport type PostProcessCallback = (\n jsonSchema: JsonSchema7Type | undefined,\n def: ZodTypeDef,\n refs: Refs\n) => JsonSchema7Type | undefined;\n\nexport const jsonDescription: PostProcessCallback = (jsonSchema, def) => {\n if (def.description) {\n try {\n return {\n ...jsonSchema,\n ...JSON.parse(def.description),\n };\n } catch {}\n }\n\n return jsonSchema;\n};\n\nexport type Options<Target extends Targets = \"jsonSchema7\"> = {\n name: string | undefined;\n $refStrategy: \"root\" | \"relative\" | \"none\" | \"seen\";\n basePath: string[];\n effectStrategy: \"input\" | \"any\";\n pipeStrategy: \"input\" | \"output\" | \"all\";\n dateStrategy: DateStrategy | DateStrategy[];\n mapStrategy: \"entries\" | \"record\";\n removeAdditionalStrategy: \"passthrough\" | \"strict\";\n allowedAdditionalProperties: true | undefined;\n rejectedAdditionalProperties: false | undefined;\n target: Target;\n strictUnions: boolean;\n definitionPath: string;\n definitions: Record<string, ZodSchema>;\n errorMessages: boolean;\n markdownDescription: boolean;\n patternStrategy: \"escape\" | \"preserve\";\n applyRegexFlags: boolean;\n emailStrategy: \"format:email\" | \"format:idn-email\" | \"pattern:zod\";\n base64Strategy: \"format:binary\" | \"contentEncoding:base64\" | \"pattern:zod\";\n nameStrategy: \"ref\" | \"title\";\n override?: OverrideCallback;\n postProcess?: PostProcessCallback;\n openAiAnyTypeName: string;\n};\n\nexport const defaultOptions: Options = {\n name: undefined,\n $refStrategy: \"root\",\n basePath: [\"#\"],\n effectStrategy: \"input\",\n pipeStrategy: \"all\",\n dateStrategy: \"format:date-time\",\n mapStrategy: \"entries\",\n removeAdditionalStrategy: \"passthrough\",\n allowedAdditionalProperties: true,\n rejectedAdditionalProperties: false,\n definitionPath: \"definitions\",\n target: \"jsonSchema7\",\n strictUnions: false,\n definitions: {},\n errorMessages: false,\n markdownDescription: false,\n patternStrategy: \"escape\",\n applyRegexFlags: false,\n emailStrategy: \"format:email\",\n base64Strategy: \"contentEncoding:base64\",\n nameStrategy: \"ref\",\n openAiAnyTypeName: \"OpenAiAnyType\",\n};\n\nexport const getDefaultOptions = <Target extends Targets>(\n options: Partial<Options<Target>> | string | undefined\n) =>\n (typeof options === \"string\"\n ? {\n ...defaultOptions,\n name: options,\n }\n : {\n ...defaultOptions,\n ...options,\n }) as Options<Target>;\n"],"mappings":";AAgBA,MAAa,iBAAiB,OAC5B,oDACD;AAuDD,MAAa,iBAA0B;CACrC,MAAM,KAAA;CACN,cAAc;CACd,UAAU,CAAC,IAAI;CACf,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,aAAa;CACb,0BAA0B;CAC1B,6BAA6B;CAC7B,8BAA8B;CAC9B,gBAAgB;CAChB,QAAQ;CACR,cAAc;CACd,aAAa,EAAE;CACf,eAAe;CACf,qBAAqB;CACrB,iBAAiB;CACjB,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,cAAc;CACd,mBAAmB;CACpB;AAED,MAAa,qBACX,YAEC,OAAO,YAAY,WAChB;CACE,GAAG;CACH,MAAM;CACP,GACD;CACE,GAAG;CACH,GAAG;CACJ"}
@@ -1,5 +1,4 @@
1
- const require_Options = require('./Options.cjs');
2
-
1
+ const require_Options = require("./Options.cjs");
3
2
  //#region src/utils/zod-to-json-schema/Refs.ts
4
3
  const getRefs = (options) => {
5
4
  const _options = require_Options.getDefaultOptions(options);
@@ -24,7 +23,7 @@ const getRefs = (options) => {
24
23
  }]))
25
24
  };
26
25
  };
27
-
28
26
  //#endregion
29
27
  exports.getRefs = getRefs;
28
+
30
29
  //# sourceMappingURL=Refs.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Refs.cjs","names":["getDefaultOptions"],"sources":["../../../src/utils/zod-to-json-schema/Refs.ts"],"sourcesContent":["import { ZodTypeDef } from \"zod/v3\";\nimport { getDefaultOptions, Options, Targets } from \"./Options.js\";\nimport { JsonSchema7Type } from \"./parseTypes.js\";\n\nexport type Refs = {\n seen: Map<ZodTypeDef, Seen>;\n currentPath: string[];\n propertyPath: string[] | undefined;\n flags: { hasReferencedOpenAiAnyType: boolean };\n} & Options<Targets>;\n\nexport type Seen = {\n def: ZodTypeDef;\n path: string[];\n jsonSchema: JsonSchema7Type | undefined;\n};\n\nexport const getRefs = (options?: string | Partial<Options<Targets>>): Refs => {\n const _options = getDefaultOptions(options);\n const currentPath =\n _options.name !== undefined\n ? [..._options.basePath, _options.definitionPath, _options.name]\n : _options.basePath;\n return {\n ..._options,\n flags: { hasReferencedOpenAiAnyType: false },\n currentPath: currentPath,\n propertyPath: undefined,\n seen: new Map(\n Object.entries(_options.definitions).map(([name, def]) => [\n def._def,\n {\n def: def._def,\n path: [..._options.basePath, _options.definitionPath, name],\n // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.\n jsonSchema: undefined,\n },\n ])\n ),\n };\n};\n"],"mappings":";;;AAiBA,MAAa,WAAW,YAAuD;CAC7E,MAAM,WAAWA,kCAAkB,QAAQ;CAC3C,MAAM,cACJ,SAAS,SAAS,SACd;EAAC,GAAG,SAAS;EAAU,SAAS;EAAgB,SAAS;EAAK,GAC9D,SAAS;AACf,QAAO;EACL,GAAG;EACH,OAAO,EAAE,4BAA4B,OAAO;EAC/B;EACb,cAAc;EACd,MAAM,IAAI,IACR,OAAO,QAAQ,SAAS,YAAY,CAAC,KAAK,CAAC,MAAM,SAAS,CACxD,IAAI,MACJ;GACE,KAAK,IAAI;GACT,MAAM;IAAC,GAAG,SAAS;IAAU,SAAS;IAAgB;IAAK;GAE3D,YAAY;GACb,CACF,CAAC,CACH;EACF"}
1
+ {"version":3,"file":"Refs.cjs","names":["getDefaultOptions"],"sources":["../../../src/utils/zod-to-json-schema/Refs.ts"],"sourcesContent":["import { ZodTypeDef } from \"zod/v3\";\nimport { getDefaultOptions, Options, Targets } from \"./Options.js\";\nimport { JsonSchema7Type } from \"./parseTypes.js\";\n\nexport type Refs = {\n seen: Map<ZodTypeDef, Seen>;\n currentPath: string[];\n propertyPath: string[] | undefined;\n flags: { hasReferencedOpenAiAnyType: boolean };\n} & Options<Targets>;\n\nexport type Seen = {\n def: ZodTypeDef;\n path: string[];\n jsonSchema: JsonSchema7Type | undefined;\n};\n\nexport const getRefs = (options?: string | Partial<Options<Targets>>): Refs => {\n const _options = getDefaultOptions(options);\n const currentPath =\n _options.name !== undefined\n ? [..._options.basePath, _options.definitionPath, _options.name]\n : _options.basePath;\n return {\n ..._options,\n flags: { hasReferencedOpenAiAnyType: false },\n currentPath: currentPath,\n propertyPath: undefined,\n seen: new Map(\n Object.entries(_options.definitions).map(([name, def]) => [\n def._def,\n {\n def: def._def,\n path: [..._options.basePath, _options.definitionPath, name],\n // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.\n jsonSchema: undefined,\n },\n ])\n ),\n };\n};\n"],"mappings":";;AAiBA,MAAa,WAAW,YAAuD;CAC7E,MAAM,WAAWA,gBAAAA,kBAAkB,QAAQ;CAC3C,MAAM,cACJ,SAAS,SAAS,KAAA,IACd;EAAC,GAAG,SAAS;EAAU,SAAS;EAAgB,SAAS;EAAK,GAC9D,SAAS;AACf,QAAO;EACL,GAAG;EACH,OAAO,EAAE,4BAA4B,OAAO;EAC/B;EACb,cAAc,KAAA;EACd,MAAM,IAAI,IACR,OAAO,QAAQ,SAAS,YAAY,CAAC,KAAK,CAAC,MAAM,SAAS,CACxD,IAAI,MACJ;GACE,KAAK,IAAI;GACT,MAAM;IAAC,GAAG,SAAS;IAAU,SAAS;IAAgB;IAAK;GAE3D,YAAY,KAAA;GACb,CACF,CAAC,CACH;EACF"}
@@ -1,3 +1 @@
1
- import "./parseTypes.js";
2
- import "./Options.js";
3
- import "zod/v3";
1
+ export { };
@@ -1,5 +1,4 @@
1
1
  import { getDefaultOptions } from "./Options.js";
2
-
3
2
  //#region src/utils/zod-to-json-schema/Refs.ts
4
3
  const getRefs = (options) => {
5
4
  const _options = getDefaultOptions(options);
@@ -24,7 +23,7 @@ const getRefs = (options) => {
24
23
  }]))
25
24
  };
26
25
  };
27
-
28
26
  //#endregion
29
27
  export { getRefs };
28
+
30
29
  //# sourceMappingURL=Refs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Refs.js","names":[],"sources":["../../../src/utils/zod-to-json-schema/Refs.ts"],"sourcesContent":["import { ZodTypeDef } from \"zod/v3\";\nimport { getDefaultOptions, Options, Targets } from \"./Options.js\";\nimport { JsonSchema7Type } from \"./parseTypes.js\";\n\nexport type Refs = {\n seen: Map<ZodTypeDef, Seen>;\n currentPath: string[];\n propertyPath: string[] | undefined;\n flags: { hasReferencedOpenAiAnyType: boolean };\n} & Options<Targets>;\n\nexport type Seen = {\n def: ZodTypeDef;\n path: string[];\n jsonSchema: JsonSchema7Type | undefined;\n};\n\nexport const getRefs = (options?: string | Partial<Options<Targets>>): Refs => {\n const _options = getDefaultOptions(options);\n const currentPath =\n _options.name !== undefined\n ? [..._options.basePath, _options.definitionPath, _options.name]\n : _options.basePath;\n return {\n ..._options,\n flags: { hasReferencedOpenAiAnyType: false },\n currentPath: currentPath,\n propertyPath: undefined,\n seen: new Map(\n Object.entries(_options.definitions).map(([name, def]) => [\n def._def,\n {\n def: def._def,\n path: [..._options.basePath, _options.definitionPath, name],\n // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.\n jsonSchema: undefined,\n },\n ])\n ),\n };\n};\n"],"mappings":";;;AAiBA,MAAa,WAAW,YAAuD;CAC7E,MAAM,WAAW,kBAAkB,QAAQ;CAC3C,MAAM,cACJ,SAAS,SAAS,SACd;EAAC,GAAG,SAAS;EAAU,SAAS;EAAgB,SAAS;EAAK,GAC9D,SAAS;AACf,QAAO;EACL,GAAG;EACH,OAAO,EAAE,4BAA4B,OAAO;EAC/B;EACb,cAAc;EACd,MAAM,IAAI,IACR,OAAO,QAAQ,SAAS,YAAY,CAAC,KAAK,CAAC,MAAM,SAAS,CACxD,IAAI,MACJ;GACE,KAAK,IAAI;GACT,MAAM;IAAC,GAAG,SAAS;IAAU,SAAS;IAAgB;IAAK;GAE3D,YAAY;GACb,CACF,CAAC,CACH;EACF"}
1
+ {"version":3,"file":"Refs.js","names":[],"sources":["../../../src/utils/zod-to-json-schema/Refs.ts"],"sourcesContent":["import { ZodTypeDef } from \"zod/v3\";\nimport { getDefaultOptions, Options, Targets } from \"./Options.js\";\nimport { JsonSchema7Type } from \"./parseTypes.js\";\n\nexport type Refs = {\n seen: Map<ZodTypeDef, Seen>;\n currentPath: string[];\n propertyPath: string[] | undefined;\n flags: { hasReferencedOpenAiAnyType: boolean };\n} & Options<Targets>;\n\nexport type Seen = {\n def: ZodTypeDef;\n path: string[];\n jsonSchema: JsonSchema7Type | undefined;\n};\n\nexport const getRefs = (options?: string | Partial<Options<Targets>>): Refs => {\n const _options = getDefaultOptions(options);\n const currentPath =\n _options.name !== undefined\n ? [..._options.basePath, _options.definitionPath, _options.name]\n : _options.basePath;\n return {\n ..._options,\n flags: { hasReferencedOpenAiAnyType: false },\n currentPath: currentPath,\n propertyPath: undefined,\n seen: new Map(\n Object.entries(_options.definitions).map(([name, def]) => [\n def._def,\n {\n def: def._def,\n path: [..._options.basePath, _options.definitionPath, name],\n // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.\n jsonSchema: undefined,\n },\n ])\n ),\n };\n};\n"],"mappings":";;AAiBA,MAAa,WAAW,YAAuD;CAC7E,MAAM,WAAW,kBAAkB,QAAQ;CAC3C,MAAM,cACJ,SAAS,SAAS,KAAA,IACd;EAAC,GAAG,SAAS;EAAU,SAAS;EAAgB,SAAS;EAAK,GAC9D,SAAS;AACf,QAAO;EACL,GAAG;EACH,OAAO,EAAE,4BAA4B,OAAO;EAC/B;EACb,cAAc,KAAA;EACd,MAAM,IAAI,IACR,OAAO,QAAQ,SAAS,YAAY,CAAC,KAAK,CAAC,MAAM,SAAS,CACxD,IAAI,MACJ;GACE,KAAK,IAAI;GACT,MAAM;IAAC,GAAG,SAAS;IAAU,SAAS;IAAgB;IAAK;GAE3D,YAAY,KAAA;GACb,CACF,CAAC,CACH;EACF"}
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/utils/zod-to-json-schema/errorMessages.ts
3
2
  function addErrorMessage(res, key, errorMessage, refs) {
4
3
  if (!refs?.errorMessages) return;
@@ -11,8 +10,8 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
11
10
  res[key] = value;
12
11
  addErrorMessage(res, key, errorMessage, refs);
13
12
  }
14
-
15
13
  //#endregion
16
14
  exports.addErrorMessage = addErrorMessage;
17
15
  exports.setResponseValueAndErrors = setResponseValueAndErrors;
16
+
18
17
  //# sourceMappingURL=errorMessages.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessages.cjs","names":[],"sources":["../../../src/utils/zod-to-json-schema/errorMessages.ts"],"sourcesContent":["import { JsonSchema7TypeUnion } from \"./parseTypes.js\";\nimport { Refs } from \"./Refs.js\";\n\nexport type ErrorMessages<\n T extends JsonSchema7TypeUnion | { format: string } | { pattern: string },\n OmitProperties extends string = \"\",\n> = Partial<\n Omit<{ [key in keyof T]: string }, OmitProperties | \"type\" | \"errorMessages\">\n>;\n\nexport function addErrorMessage<\n T extends { errorMessage?: ErrorMessages<any> },\n>(res: T, key: keyof T, errorMessage: string | undefined, refs: Refs) {\n if (!refs?.errorMessages) return;\n if (errorMessage) {\n res.errorMessage = {\n ...res.errorMessage,\n [key]: errorMessage,\n };\n }\n}\n\nexport function setResponseValueAndErrors<\n Json7Type extends JsonSchema7TypeUnion & {\n errorMessage?: ErrorMessages<Json7Type>;\n },\n Key extends keyof Omit<Json7Type, \"errorMessage\">,\n>(\n res: Json7Type,\n key: Key,\n value: Json7Type[Key],\n errorMessage: string | undefined,\n refs: Refs,\n) {\n res[key] = value;\n addErrorMessage(res, key, errorMessage, refs);\n}\n"],"mappings":";;AAUA,SAAgB,gBAEd,KAAQ,KAAc,cAAkC,MAAY;AACpE,KAAI,CAAC,MAAM,cAAe;AAC1B,KAAI,aACF,KAAI,eAAe;EACjB,GAAG,IAAI;GACN,MAAM;EACR;;AAIL,SAAgB,0BAMd,KACA,KACA,OACA,cACA,MACA;AACA,KAAI,OAAO;AACX,iBAAgB,KAAK,KAAK,cAAc,KAAK"}
1
+ {"version":3,"file":"errorMessages.cjs","names":[],"sources":["../../../src/utils/zod-to-json-schema/errorMessages.ts"],"sourcesContent":["import { JsonSchema7TypeUnion } from \"./parseTypes.js\";\nimport { Refs } from \"./Refs.js\";\n\nexport type ErrorMessages<\n T extends JsonSchema7TypeUnion | { format: string } | { pattern: string },\n OmitProperties extends string = \"\",\n> = Partial<\n Omit<{ [key in keyof T]: string }, OmitProperties | \"type\" | \"errorMessages\">\n>;\n\nexport function addErrorMessage<\n T extends { errorMessage?: ErrorMessages<any> },\n>(res: T, key: keyof T, errorMessage: string | undefined, refs: Refs) {\n if (!refs?.errorMessages) return;\n if (errorMessage) {\n res.errorMessage = {\n ...res.errorMessage,\n [key]: errorMessage,\n };\n }\n}\n\nexport function setResponseValueAndErrors<\n Json7Type extends JsonSchema7TypeUnion & {\n errorMessage?: ErrorMessages<Json7Type>;\n },\n Key extends keyof Omit<Json7Type, \"errorMessage\">,\n>(\n res: Json7Type,\n key: Key,\n value: Json7Type[Key],\n errorMessage: string | undefined,\n refs: Refs,\n) {\n res[key] = value;\n addErrorMessage(res, key, errorMessage, refs);\n}\n"],"mappings":";AAUA,SAAgB,gBAEd,KAAQ,KAAc,cAAkC,MAAY;AACpE,KAAI,CAAC,MAAM,cAAe;AAC1B,KAAI,aACF,KAAI,eAAe;EACjB,GAAG,IAAI;GACN,MAAM;EACR;;AAIL,SAAgB,0BAMd,KACA,KACA,OACA,cACA,MACA;AACA,KAAI,OAAO;AACX,iBAAgB,KAAK,KAAK,cAAc,KAAK"}
@@ -1,6 +1,4 @@
1
1
  import { JsonSchema7TypeUnion } from "./parseTypes.js";
2
- import "./Refs.js";
3
-
4
2
  //#region src/utils/zod-to-json-schema/errorMessages.d.ts
5
3
  type ErrorMessages<T extends JsonSchema7TypeUnion | {
6
4
  format: string;
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessages.d.ts","names":[],"sources":["../../../src/utils/zod-to-json-schema/errorMessages.ts"],"mappings":";;;;KAGY,aAAA,WACA,oBAAA;EAAyB,MAAA;AAAA;EAAqB,OAAA;AAAA,yCAEtD,OAAA,CACF,IAAA,iBAAqB,CAAA,aAAc,cAAA"}
1
+ {"version":3,"file":"errorMessages.d.ts","names":[],"sources":["../../../src/utils/zod-to-json-schema/errorMessages.ts"],"mappings":";;KAGY,aAAA,WACA,oBAAA;EAAyB,MAAA;AAAA;EAAqB,OAAA;AAAA,yCAEtD,OAAA,CACF,IAAA,iBAAqB,CAAA,aAAc,cAAA"}
@@ -10,7 +10,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
10
10
  res[key] = value;
11
11
  addErrorMessage(res, key, errorMessage, refs);
12
12
  }
13
-
14
13
  //#endregion
15
14
  export { addErrorMessage, setResponseValueAndErrors };
15
+
16
16
  //# sourceMappingURL=errorMessages.js.map
@@ -1,11 +1,10 @@
1
-
2
1
  //#region src/utils/zod-to-json-schema/getRelativePath.ts
3
2
  const getRelativePath = (pathA, pathB) => {
4
3
  let i = 0;
5
4
  for (; i < pathA.length && i < pathB.length; i++) if (pathA[i] !== pathB[i]) break;
6
5
  return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
7
6
  };
8
-
9
7
  //#endregion
10
8
  exports.getRelativePath = getRelativePath;
9
+
11
10
  //# sourceMappingURL=getRelativePath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getRelativePath.cjs","names":[],"sources":["../../../src/utils/zod-to-json-schema/getRelativePath.ts"],"sourcesContent":["\nexport const getRelativePath = (pathA: string[], pathB: string[]) => {\n let i = 0;\n for (; i < pathA.length && i < pathB.length; i++) {\n if (pathA[i] !== pathB[i]) break;\n }\n return [(pathA.length - i).toString(), ...pathB.slice(i)].join(\"/\");\n};\n\n"],"mappings":";;AACA,MAAa,mBAAmB,OAAiB,UAAoB;CACnE,IAAI,IAAI;AACR,QAAO,IAAI,MAAM,UAAU,IAAI,MAAM,QAAQ,IAC3C,KAAI,MAAM,OAAO,MAAM,GAAI;AAE7B,QAAO,EAAE,MAAM,SAAS,GAAG,UAAU,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC,CAAC,KAAK,IAAI"}
1
+ {"version":3,"file":"getRelativePath.cjs","names":[],"sources":["../../../src/utils/zod-to-json-schema/getRelativePath.ts"],"sourcesContent":["\nexport const getRelativePath = (pathA: string[], pathB: string[]) => {\n let i = 0;\n for (; i < pathA.length && i < pathB.length; i++) {\n if (pathA[i] !== pathB[i]) break;\n }\n return [(pathA.length - i).toString(), ...pathB.slice(i)].join(\"/\");\n};\n\n"],"mappings":";AACA,MAAa,mBAAmB,OAAiB,UAAoB;CACnE,IAAI,IAAI;AACR,QAAO,IAAI,MAAM,UAAU,IAAI,MAAM,QAAQ,IAC3C,KAAI,MAAM,OAAO,MAAM,GAAI;AAE7B,QAAO,EAAE,MAAM,SAAS,GAAG,UAAU,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC,CAAC,KAAK,IAAI"}
@@ -4,7 +4,7 @@ const getRelativePath = (pathA, pathB) => {
4
4
  for (; i < pathA.length && i < pathB.length; i++) if (pathA[i] !== pathB[i]) break;
5
5
  return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
6
6
  };
7
-
8
7
  //#endregion
9
8
  export { getRelativePath };
9
+
10
10
  //# sourceMappingURL=getRelativePath.js.map
@@ -1,37 +1,37 @@
1
- const require_Options = require('./Options.cjs');
2
- const require_Refs = require('./Refs.cjs');
3
- const require_errorMessages = require('./errorMessages.cjs');
4
- const require_getRelativePath = require('./getRelativePath.cjs');
5
- const require_any = require('./parsers/any.cjs');
6
- const require_array = require('./parsers/array.cjs');
7
- const require_bigint = require('./parsers/bigint.cjs');
8
- const require_boolean = require('./parsers/boolean.cjs');
9
- const require_branded = require('./parsers/branded.cjs');
10
- const require_catch = require('./parsers/catch.cjs');
11
- const require_date = require('./parsers/date.cjs');
12
- const require_default = require('./parsers/default.cjs');
13
- const require_effects = require('./parsers/effects.cjs');
14
- const require_enum = require('./parsers/enum.cjs');
15
- const require_intersection = require('./parsers/intersection.cjs');
16
- const require_literal = require('./parsers/literal.cjs');
17
- const require_string = require('./parsers/string.cjs');
18
- const require_record = require('./parsers/record.cjs');
19
- const require_map = require('./parsers/map.cjs');
20
- const require_nativeEnum = require('./parsers/nativeEnum.cjs');
21
- const require_never = require('./parsers/never.cjs');
22
- const require_null = require('./parsers/null.cjs');
23
- const require_union = require('./parsers/union.cjs');
24
- const require_nullable = require('./parsers/nullable.cjs');
25
- const require_number = require('./parsers/number.cjs');
26
- const require_object = require('./parsers/object.cjs');
27
- const require_optional = require('./parsers/optional.cjs');
28
- const require_pipeline = require('./parsers/pipeline.cjs');
29
- const require_promise = require('./parsers/promise.cjs');
30
- const require_set = require('./parsers/set.cjs');
31
- const require_tuple = require('./parsers/tuple.cjs');
32
- const require_undefined = require('./parsers/undefined.cjs');
33
- const require_unknown = require('./parsers/unknown.cjs');
34
- const require_readonly = require('./parsers/readonly.cjs');
35
- const require_selectParser = require('./selectParser.cjs');
36
- const require_parseDef = require('./parseDef.cjs');
37
- const require_zodToJsonSchema = require('./zodToJsonSchema.cjs');
1
+ require("./Options.cjs");
2
+ require("./Refs.cjs");
3
+ require("./errorMessages.cjs");
4
+ require("./getRelativePath.cjs");
5
+ require("./parsers/any.cjs");
6
+ require("./parsers/array.cjs");
7
+ require("./parsers/bigint.cjs");
8
+ require("./parsers/boolean.cjs");
9
+ require("./parsers/branded.cjs");
10
+ require("./parsers/catch.cjs");
11
+ require("./parsers/date.cjs");
12
+ require("./parsers/default.cjs");
13
+ require("./parsers/effects.cjs");
14
+ require("./parsers/enum.cjs");
15
+ require("./parsers/intersection.cjs");
16
+ require("./parsers/literal.cjs");
17
+ require("./parsers/string.cjs");
18
+ require("./parsers/record.cjs");
19
+ require("./parsers/map.cjs");
20
+ require("./parsers/nativeEnum.cjs");
21
+ require("./parsers/never.cjs");
22
+ require("./parsers/null.cjs");
23
+ require("./parsers/union.cjs");
24
+ require("./parsers/nullable.cjs");
25
+ require("./parsers/number.cjs");
26
+ require("./parsers/object.cjs");
27
+ require("./parsers/optional.cjs");
28
+ require("./parsers/pipeline.cjs");
29
+ require("./parsers/promise.cjs");
30
+ require("./parsers/set.cjs");
31
+ require("./parsers/tuple.cjs");
32
+ require("./parsers/undefined.cjs");
33
+ require("./parsers/unknown.cjs");
34
+ require("./parsers/readonly.cjs");
35
+ require("./selectParser.cjs");
36
+ require("./parseDef.cjs");
37
+ require("./zodToJsonSchema.cjs");
@@ -21,17 +21,4 @@ import { JsonSchema7TupleType } from "./parsers/tuple.js";
21
21
  import { JsonSchema7UndefinedType } from "./parsers/undefined.js";
22
22
  import { JsonSchema7UnionType, primitiveMappings } from "./parsers/union.js";
23
23
  import { JsonSchema7UnknownType } from "./parsers/unknown.js";
24
- import { JsonSchema7Type, JsonSchema7TypeUnion } from "./parseTypes.js";
25
- import "./Refs.js";
26
- import "./Options.js";
27
- import "./parseDef.js";
28
- import "./parsers/branded.js";
29
- import "./parsers/catch.js";
30
- import "./parsers/default.js";
31
- import "./parsers/effects.js";
32
- import "./parsers/optional.js";
33
- import "./parsers/pipeline.js";
34
- import "./parsers/promise.js";
35
- import "./parsers/readonly.js";
36
- import "./selectParser.js";
37
- import "./zodToJsonSchema.js";
24
+ import { JsonSchema7Type, JsonSchema7TypeUnion } from "./parseTypes.js";