langgraph-ui-components 0.0.7 → 0.0.8

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 (283) hide show
  1. package/dist/index.es100.js +25 -157
  2. package/dist/index.es100.js.map +1 -1
  3. package/dist/index.es101.js +3130 -176
  4. package/dist/index.es101.js.map +1 -1
  5. package/dist/index.es102.js +36 -13
  6. package/dist/index.es102.js.map +1 -1
  7. package/dist/index.es103.js +5 -30
  8. package/dist/index.es103.js.map +1 -1
  9. package/dist/index.es104.js +69 -30
  10. package/dist/index.es104.js.map +1 -1
  11. package/dist/index.es105.js +28 -3148
  12. package/dist/index.es105.js.map +1 -1
  13. package/dist/index.es106.js +5 -16
  14. package/dist/index.es106.js.map +1 -1
  15. package/dist/index.es107.js +2 -7
  16. package/dist/index.es107.js.map +1 -1
  17. package/dist/index.es108.js +13 -2
  18. package/dist/index.es108.js.map +1 -1
  19. package/dist/index.es109.js +499 -9
  20. package/dist/index.es109.js.map +1 -1
  21. package/dist/index.es11.js +2 -2
  22. package/dist/index.es11.js.map +1 -1
  23. package/dist/index.es110.js +5 -501
  24. package/dist/index.es110.js.map +1 -1
  25. package/dist/index.es111.js +2 -7
  26. package/dist/index.es111.js.map +1 -1
  27. package/dist/index.es112.js +148 -2
  28. package/dist/index.es112.js.map +1 -1
  29. package/dist/index.es113.js +878 -118
  30. package/dist/index.es113.js.map +1 -1
  31. package/dist/index.es114.js +251 -877
  32. package/dist/index.es114.js.map +1 -1
  33. package/dist/index.es115.js +3 -281
  34. package/dist/index.es115.js.map +1 -1
  35. package/dist/index.es116.js +445 -3
  36. package/dist/index.es116.js.map +1 -1
  37. package/dist/index.es117.js +39 -437
  38. package/dist/index.es117.js.map +1 -1
  39. package/dist/index.es118.js +22 -46
  40. package/dist/index.es118.js.map +1 -1
  41. package/dist/index.es119.js +78 -21
  42. package/dist/index.es119.js.map +1 -1
  43. package/dist/index.es120.js +126 -76
  44. package/dist/index.es120.js.map +1 -1
  45. package/dist/index.es121.js +45 -125
  46. package/dist/index.es121.js.map +1 -1
  47. package/dist/index.es122.js +9 -48
  48. package/dist/index.es122.js.map +1 -1
  49. package/dist/index.es123.js +45 -10
  50. package/dist/index.es123.js.map +1 -1
  51. package/dist/index.es124.js +97 -43
  52. package/dist/index.es124.js.map +1 -1
  53. package/dist/index.es125.js +48 -94
  54. package/dist/index.es125.js.map +1 -1
  55. package/dist/index.es126.js +14 -51
  56. package/dist/index.es126.js.map +1 -1
  57. package/dist/index.es127.js +13 -162
  58. package/dist/index.es127.js.map +1 -1
  59. package/dist/index.es128.js +89 -2
  60. package/dist/index.es128.js.map +1 -1
  61. package/dist/index.es129.js +2 -15
  62. package/dist/index.es129.js.map +1 -1
  63. package/dist/index.es130.js +54 -87
  64. package/dist/index.es130.js.map +1 -1
  65. package/dist/index.es131.js +100 -2
  66. package/dist/index.es131.js.map +1 -1
  67. package/dist/index.es132.js +186 -51
  68. package/dist/index.es132.js.map +1 -1
  69. package/dist/index.es133.js +97 -87
  70. package/dist/index.es133.js.map +1 -1
  71. package/dist/index.es134.js +31 -187
  72. package/dist/index.es134.js.map +1 -1
  73. package/dist/index.es135.js +10 -110
  74. package/dist/index.es135.js.map +1 -1
  75. package/dist/index.es136.js +11 -35
  76. package/dist/index.es136.js.map +1 -1
  77. package/dist/index.es137.js +12 -10
  78. package/dist/index.es137.js.map +1 -1
  79. package/dist/index.es138.js +90 -10
  80. package/dist/index.es138.js.map +1 -1
  81. package/dist/index.es139.js +274 -11
  82. package/dist/index.es139.js.map +1 -1
  83. package/dist/index.es140.js +2 -91
  84. package/dist/index.es140.js.map +1 -1
  85. package/dist/index.es141.js +150 -261
  86. package/dist/index.es141.js.map +1 -1
  87. package/dist/index.es142.js +51 -2
  88. package/dist/index.es142.js.map +1 -1
  89. package/dist/index.es143.js +34 -158
  90. package/dist/index.es143.js.map +1 -1
  91. package/dist/index.es144.js +34 -50
  92. package/dist/index.es144.js.map +1 -1
  93. package/dist/index.es145.js +32 -32
  94. package/dist/index.es145.js.map +1 -1
  95. package/dist/index.es146.js +23 -34
  96. package/dist/index.es146.js.map +1 -1
  97. package/dist/index.es147.js +583 -32
  98. package/dist/index.es147.js.map +1 -1
  99. package/dist/index.es148.js +121 -20
  100. package/dist/index.es148.js.map +1 -1
  101. package/dist/index.es149.js +158 -585
  102. package/dist/index.es149.js.map +1 -1
  103. package/dist/index.es15.js +15 -15
  104. package/dist/index.es150.js +2 -125
  105. package/dist/index.es150.js.map +1 -1
  106. package/dist/index.es157.js +2 -2
  107. package/dist/index.es159.js +2 -2
  108. package/dist/index.es161.js +64 -25
  109. package/dist/index.es161.js.map +1 -1
  110. package/dist/index.es162.js +22 -12
  111. package/dist/index.es162.js.map +1 -1
  112. package/dist/index.es163.js +5 -53
  113. package/dist/index.es163.js.map +1 -1
  114. package/dist/index.es164.js +337 -52
  115. package/dist/index.es164.js.map +1 -1
  116. package/dist/index.es165.js +24 -21
  117. package/dist/index.es165.js.map +1 -1
  118. package/dist/index.es166.js +12 -6
  119. package/dist/index.es166.js.map +1 -1
  120. package/dist/index.es167.js +49 -344
  121. package/dist/index.es167.js.map +1 -1
  122. package/dist/index.es175.js +1 -1
  123. package/dist/index.es178.js +1 -1
  124. package/dist/index.es183.js +1 -1
  125. package/dist/index.es195.js +2 -2
  126. package/dist/index.es197.js +2 -2
  127. package/dist/index.es200.js +1 -1
  128. package/dist/index.es201.js +1 -1
  129. package/dist/index.es203.js +1 -1
  130. package/dist/index.es204.js +2 -2
  131. package/dist/index.es206.js +1 -1
  132. package/dist/index.es209.js +3 -3
  133. package/dist/index.es21.js +1 -1
  134. package/dist/index.es210.js +2 -2
  135. package/dist/index.es212.js +1 -1
  136. package/dist/index.es214.js +1 -1
  137. package/dist/index.es215.js +1 -1
  138. package/dist/index.es217.js +1 -1
  139. package/dist/index.es218.js +2 -2
  140. package/dist/index.es219.js +1 -1
  141. package/dist/index.es220.js +1 -1
  142. package/dist/index.es221.js +1 -1
  143. package/dist/index.es222.js +1 -1
  144. package/dist/index.es223.js +1 -1
  145. package/dist/index.es224.js +1 -1
  146. package/dist/index.es225.js +1 -1
  147. package/dist/index.es229.js +2 -2
  148. package/dist/index.es28.js +7 -7
  149. package/dist/index.es29.js +1 -1
  150. package/dist/index.es32.js +4 -4
  151. package/dist/index.es33.js +15 -1191
  152. package/dist/index.es33.js.map +1 -1
  153. package/dist/index.es34.js +117 -6
  154. package/dist/index.es34.js.map +1 -1
  155. package/dist/index.es35.js +70 -8
  156. package/dist/index.es35.js.map +1 -1
  157. package/dist/index.es36.js +19 -148
  158. package/dist/index.es36.js.map +1 -1
  159. package/dist/index.es37.js +255 -112
  160. package/dist/index.es37.js.map +1 -1
  161. package/dist/index.es38.js +40 -68
  162. package/dist/index.es38.js.map +1 -1
  163. package/dist/index.es39.js +214 -17
  164. package/dist/index.es39.js.map +1 -1
  165. package/dist/index.es40.js +53 -247
  166. package/dist/index.es40.js.map +1 -1
  167. package/dist/index.es41.js +123 -24
  168. package/dist/index.es41.js.map +1 -1
  169. package/dist/index.es42.js +14 -205
  170. package/dist/index.es42.js.map +1 -1
  171. package/dist/index.es43.js +221 -58
  172. package/dist/index.es43.js.map +1 -1
  173. package/dist/index.es44.js +7 -140
  174. package/dist/index.es44.js.map +1 -1
  175. package/dist/index.es45.js +1185 -17
  176. package/dist/index.es45.js.map +1 -1
  177. package/dist/index.es46.js +6 -229
  178. package/dist/index.es46.js.map +1 -1
  179. package/dist/index.es47.js +146 -15
  180. package/dist/index.es47.js.map +1 -1
  181. package/dist/index.es49.js +7 -90
  182. package/dist/index.es49.js.map +1 -1
  183. package/dist/index.es50.js +92 -6
  184. package/dist/index.es50.js.map +1 -1
  185. package/dist/index.es51.js +3 -14
  186. package/dist/index.es51.js.map +1 -1
  187. package/dist/index.es52.js +36 -8
  188. package/dist/index.es52.js.map +1 -1
  189. package/dist/index.es53.js +61 -83
  190. package/dist/index.es53.js.map +1 -1
  191. package/dist/index.es54.js +37 -3
  192. package/dist/index.es54.js.map +1 -1
  193. package/dist/index.es55.js +304 -34
  194. package/dist/index.es55.js.map +1 -1
  195. package/dist/index.es56.js +9 -72
  196. package/dist/index.es56.js.map +1 -1
  197. package/dist/index.es57.js +85 -32
  198. package/dist/index.es57.js.map +1 -1
  199. package/dist/index.es58.js +6 -304
  200. package/dist/index.es58.js.map +1 -1
  201. package/dist/index.es59.js +15 -9
  202. package/dist/index.es59.js.map +1 -1
  203. package/dist/index.es60.js +142 -5
  204. package/dist/index.es60.js.map +1 -1
  205. package/dist/index.es61.js +285 -148
  206. package/dist/index.es61.js.map +1 -1
  207. package/dist/index.es62.js +62 -668
  208. package/dist/index.es62.js.map +1 -1
  209. package/dist/index.es63.js +201 -131
  210. package/dist/index.es63.js.map +1 -1
  211. package/dist/index.es64.js +29 -295
  212. package/dist/index.es64.js.map +1 -1
  213. package/dist/index.es65.js +8 -65
  214. package/dist/index.es65.js.map +1 -1
  215. package/dist/index.es66.js +9 -210
  216. package/dist/index.es66.js.map +1 -1
  217. package/dist/index.es67.js +181 -28
  218. package/dist/index.es67.js.map +1 -1
  219. package/dist/index.es68.js +23 -8
  220. package/dist/index.es68.js.map +1 -1
  221. package/dist/index.es69.js +1397 -9
  222. package/dist/index.es69.js.map +1 -1
  223. package/dist/index.es70.js +9 -187
  224. package/dist/index.es70.js.map +1 -1
  225. package/dist/index.es71.js +8 -24
  226. package/dist/index.es71.js.map +1 -1
  227. package/dist/index.es72.js +5 -1399
  228. package/dist/index.es72.js.map +1 -1
  229. package/dist/index.es73.js +163 -9
  230. package/dist/index.es73.js.map +1 -1
  231. package/dist/index.es74.js +672 -8
  232. package/dist/index.es74.js.map +1 -1
  233. package/dist/index.es75.js +11 -36
  234. package/dist/index.es75.js.map +1 -1
  235. package/dist/index.es76.js +40 -5
  236. package/dist/index.es76.js.map +1 -1
  237. package/dist/index.es77.js +32 -71
  238. package/dist/index.es77.js.map +1 -1
  239. package/dist/index.es78.js +225 -30
  240. package/dist/index.es78.js.map +1 -1
  241. package/dist/index.es79.js +29 -11
  242. package/dist/index.es79.js.map +1 -1
  243. package/dist/index.es80.js +72 -37
  244. package/dist/index.es80.js.map +1 -1
  245. package/dist/index.es81.js +74 -32
  246. package/dist/index.es81.js.map +1 -1
  247. package/dist/index.es82.js +46 -226
  248. package/dist/index.es82.js.map +1 -1
  249. package/dist/index.es83.js +6 -6
  250. package/dist/index.es83.js.map +1 -1
  251. package/dist/index.es84.js +39 -71
  252. package/dist/index.es84.js.map +1 -1
  253. package/dist/index.es85.js +54 -73
  254. package/dist/index.es85.js.map +1 -1
  255. package/dist/index.es86.js +13 -52
  256. package/dist/index.es86.js.map +1 -1
  257. package/dist/index.es87.js +135 -28
  258. package/dist/index.es87.js.map +1 -1
  259. package/dist/index.es88.js +20 -42
  260. package/dist/index.es88.js.map +1 -1
  261. package/dist/index.es89.js +175 -50
  262. package/dist/index.es89.js.map +1 -1
  263. package/dist/index.es90.js +240 -12
  264. package/dist/index.es90.js.map +1 -1
  265. package/dist/index.es91.js +348 -130
  266. package/dist/index.es91.js.map +1 -1
  267. package/dist/index.es92.js +134 -18
  268. package/dist/index.es92.js.map +1 -1
  269. package/dist/index.es93.js +62 -174
  270. package/dist/index.es93.js.map +1 -1
  271. package/dist/index.es94.js +30 -234
  272. package/dist/index.es94.js.map +1 -1
  273. package/dist/index.es95.js +26 -344
  274. package/dist/index.es95.js.map +1 -1
  275. package/dist/index.es96.js +156 -127
  276. package/dist/index.es96.js.map +1 -1
  277. package/dist/index.es97.js +196 -63
  278. package/dist/index.es97.js.map +1 -1
  279. package/dist/index.es98.js +14 -37
  280. package/dist/index.es98.js.map +1 -1
  281. package/dist/index.es99.js +27 -34
  282. package/dist/index.es99.js.map +1 -1
  283. package/package.json +1 -1
@@ -1,140 +1,169 @@
1
- import { isNetworkError } from "./index.es119.js";
2
- function validateRetries(retries) {
3
- if (typeof retries === "number") {
4
- if (retries < 0) throw new TypeError("Expected `retries` to be a non-negative number.");
5
- if (Number.isNaN(retries)) throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.");
6
- } else if (retries !== void 0) throw new TypeError("Expected `retries` to be a number or Infinity.");
1
+ import { clone } from "./index.es119.js";
2
+ import { $ZodNever } from "./index.es120.js";
3
+ import { globalRegistry } from "./index.es121.js";
4
+ import { _never } from "./index.es122.js";
5
+ import { parseAsync } from "./index.es123.js";
6
+ function isZodSchemaV4(schema) {
7
+ if (typeof schema !== "object" || schema === null) return false;
8
+ const obj = schema;
9
+ if (!("_zod" in obj)) return false;
10
+ const zod = obj._zod;
11
+ return typeof zod === "object" && zod !== null && "def" in zod;
7
12
  }
8
- function validateNumberOption(name, value, { min = 0, allowInfinity = false } = {}) {
9
- if (value === void 0) return;
10
- if (typeof value !== "number" || Number.isNaN(value)) throw new TypeError(`Expected \`${name}\` to be a number${allowInfinity ? " or Infinity" : ""}.`);
11
- if (!allowInfinity && !Number.isFinite(value)) throw new TypeError(`Expected \`${name}\` to be a finite number.`);
12
- if (value < min) throw new TypeError(`Expected \`${name}\` to be ≥ ${min}.`);
13
+ function isZodSchemaV3(schema) {
14
+ if (typeof schema !== "object" || schema === null) return false;
15
+ const obj = schema;
16
+ if (!("_def" in obj) || "_zod" in obj) return false;
17
+ const def = obj._def;
18
+ return typeof def === "object" && def != null && "typeName" in def;
13
19
  }
14
- var AbortError = class extends Error {
15
- constructor(message) {
16
- super();
17
- if (message instanceof Error) {
18
- this.originalError = message;
19
- ({ message } = message);
20
- } else {
21
- this.originalError = new Error(message);
22
- this.originalError.stack = this.stack;
23
- }
24
- this.name = "AbortError";
25
- this.message = message;
26
- }
27
- };
28
- function calculateDelay(retriesConsumed, options) {
29
- const attempt = Math.max(1, retriesConsumed + 1);
30
- const random = options.randomize ? Math.random() + 1 : 1;
31
- let timeout = Math.round(random * options.minTimeout * options.factor ** (attempt - 1));
32
- timeout = Math.min(timeout, options.maxTimeout);
33
- return timeout;
20
+ function isInteropZodSchema(input) {
21
+ if (!input) return false;
22
+ if (typeof input !== "object") return false;
23
+ if (Array.isArray(input)) return false;
24
+ if (isZodSchemaV4(input) || isZodSchemaV3(input)) return true;
25
+ return false;
26
+ }
27
+ async function interopParseAsync(schema, input) {
28
+ if (isZodSchemaV4(schema)) return await parseAsync(schema, input);
29
+ if (isZodSchemaV3(schema)) return await schema.parseAsync(input);
30
+ throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType");
34
31
  }
35
- function calculateRemainingTime(start, max) {
36
- if (!Number.isFinite(max)) return max;
37
- return max - (performance.now() - start);
32
+ function getSchemaDescription(schema) {
33
+ if (isZodSchemaV4(schema)) return globalRegistry.get(schema)?.description;
34
+ if (isZodSchemaV3(schema)) return schema.description;
35
+ if ("description" in schema && typeof schema.description === "string") return schema.description;
36
+ return void 0;
38
37
  }
39
- async function onAttemptFailure({ error, attemptNumber, retriesConsumed, startTime, options }) {
40
- const normalizedError = error instanceof Error ? error : /* @__PURE__ */ new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
41
- if (normalizedError instanceof AbortError) throw normalizedError.originalError;
42
- const retriesLeft = Number.isFinite(options.retries) ? Math.max(0, options.retries - retriesConsumed) : options.retries;
43
- const maxRetryTime = options.maxRetryTime ?? Number.POSITIVE_INFINITY;
44
- const context = Object.freeze({
45
- error: normalizedError,
46
- attemptNumber,
47
- retriesLeft,
48
- retriesConsumed
49
- });
50
- await options.onFailedAttempt(context);
51
- if (calculateRemainingTime(startTime, maxRetryTime) <= 0) throw normalizedError;
52
- const consumeRetry = await options.shouldConsumeRetry(context);
53
- const remainingTime = calculateRemainingTime(startTime, maxRetryTime);
54
- if (remainingTime <= 0 || retriesLeft <= 0) throw normalizedError;
55
- if (normalizedError instanceof TypeError && !isNetworkError(normalizedError)) {
56
- if (consumeRetry) throw normalizedError;
57
- options.signal?.throwIfAborted();
58
- return false;
38
+ function isSimpleStringZodSchema(schema) {
39
+ if (!isInteropZodSchema(schema)) return false;
40
+ if (isZodSchemaV3(schema)) {
41
+ const def = schema._def;
42
+ return def.typeName === "ZodString";
59
43
  }
60
- if (!await options.shouldRetry(context)) throw normalizedError;
61
- if (!consumeRetry) {
62
- options.signal?.throwIfAborted();
63
- return false;
44
+ if (isZodSchemaV4(schema)) {
45
+ const def = schema._zod.def;
46
+ return def.type === "string";
64
47
  }
65
- const delayTime = calculateDelay(retriesConsumed, options);
66
- const finalDelay = Math.min(delayTime, remainingTime);
67
- if (finalDelay > 0) await new Promise((resolve, reject) => {
68
- const onAbort = () => {
69
- clearTimeout(timeoutToken);
70
- options.signal?.removeEventListener("abort", onAbort);
71
- reject(options.signal.reason);
72
- };
73
- const timeoutToken = setTimeout(() => {
74
- options.signal?.removeEventListener("abort", onAbort);
75
- resolve();
76
- }, finalDelay);
77
- if (options.unref) timeoutToken.unref?.();
78
- options.signal?.addEventListener("abort", onAbort, { once: true });
79
- });
80
- options.signal?.throwIfAborted();
81
- return true;
48
+ return false;
49
+ }
50
+ function isZodObjectV4(obj) {
51
+ if (!isZodSchemaV4(obj)) return false;
52
+ if (typeof obj === "object" && obj !== null && "_zod" in obj && typeof obj._zod === "object" && obj._zod !== null && "def" in obj._zod && typeof obj._zod.def === "object" && obj._zod.def !== null && "type" in obj._zod.def && obj._zod.def.type === "object") return true;
53
+ return false;
54
+ }
55
+ function isZodArrayV4(obj) {
56
+ if (!isZodSchemaV4(obj)) return false;
57
+ if (typeof obj === "object" && obj !== null && "_zod" in obj && typeof obj._zod === "object" && obj._zod !== null && "def" in obj._zod && typeof obj._zod.def === "object" && obj._zod.def !== null && "type" in obj._zod.def && obj._zod.def.type === "array") return true;
58
+ return false;
59
+ }
60
+ function isZodOptionalV4(obj) {
61
+ if (!isZodSchemaV4(obj)) return false;
62
+ if (typeof obj === "object" && obj !== null && "_zod" in obj && typeof obj._zod === "object" && obj._zod !== null && "def" in obj._zod && typeof obj._zod.def === "object" && obj._zod.def !== null && "type" in obj._zod.def && obj._zod.def.type === "optional") return true;
63
+ return false;
64
+ }
65
+ function isZodNullableV4(obj) {
66
+ if (!isZodSchemaV4(obj)) return false;
67
+ if (typeof obj === "object" && obj !== null && "_zod" in obj && typeof obj._zod === "object" && obj._zod !== null && "def" in obj._zod && typeof obj._zod.def === "object" && obj._zod.def !== null && "type" in obj._zod.def && obj._zod.def.type === "nullable") return true;
68
+ return false;
82
69
  }
83
- async function pRetry(input, options = {}) {
84
- options = { ...options };
85
- validateRetries(options.retries);
86
- if (Object.hasOwn(options, "forever")) throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");
87
- options.retries ??= 10;
88
- options.factor ??= 2;
89
- options.minTimeout ??= 1e3;
90
- options.maxTimeout ??= Number.POSITIVE_INFINITY;
91
- options.maxRetryTime ??= Number.POSITIVE_INFINITY;
92
- options.randomize ??= false;
93
- options.onFailedAttempt ??= () => {
94
- };
95
- options.shouldRetry ??= () => true;
96
- options.shouldConsumeRetry ??= () => true;
97
- validateNumberOption("factor", options.factor, {
98
- min: 0,
99
- allowInfinity: false
100
- });
101
- validateNumberOption("minTimeout", options.minTimeout, {
102
- min: 0,
103
- allowInfinity: false
104
- });
105
- validateNumberOption("maxTimeout", options.maxTimeout, {
106
- min: 0,
107
- allowInfinity: true
108
- });
109
- validateNumberOption("maxRetryTime", options.maxRetryTime, {
110
- min: 0,
111
- allowInfinity: true
112
- });
113
- if (!(options.factor > 0)) options.factor = 1;
114
- options.signal?.throwIfAborted();
115
- let attemptNumber = 0;
116
- let retriesConsumed = 0;
117
- const startTime = performance.now();
118
- while (Number.isFinite(options.retries) ? retriesConsumed <= options.retries : true) {
119
- attemptNumber++;
120
- try {
121
- options.signal?.throwIfAborted();
122
- const result = await input(attemptNumber);
123
- options.signal?.throwIfAborted();
124
- return result;
125
- } catch (error) {
126
- if (await onAttemptFailure({
127
- error,
128
- attemptNumber,
129
- retriesConsumed,
130
- startTime,
131
- options
132
- })) retriesConsumed++;
70
+ function interopZodObjectStrict(schema, recursive = false) {
71
+ if (isZodSchemaV3(schema)) return schema.strict();
72
+ if (isZodObjectV4(schema)) {
73
+ const outputShape = schema._zod.def.shape;
74
+ if (recursive) for (const [key, keySchema] of Object.entries(schema._zod.def.shape)) {
75
+ if (isZodObjectV4(keySchema)) {
76
+ const outputSchema = interopZodObjectStrict(keySchema, recursive);
77
+ outputShape[key] = outputSchema;
78
+ } else if (isZodArrayV4(keySchema)) {
79
+ let elementSchema = keySchema._zod.def.element;
80
+ if (isZodObjectV4(elementSchema)) elementSchema = interopZodObjectStrict(elementSchema, recursive);
81
+ outputShape[key] = clone(keySchema, {
82
+ ...keySchema._zod.def,
83
+ element: elementSchema
84
+ });
85
+ } else outputShape[key] = keySchema;
86
+ const meta$1 = globalRegistry.get(keySchema);
87
+ if (meta$1) globalRegistry.add(outputShape[key], meta$1);
133
88
  }
89
+ const modifiedSchema = clone(schema, {
90
+ ...schema._zod.def,
91
+ shape: outputShape,
92
+ catchall: _never($ZodNever)
93
+ });
94
+ const meta = globalRegistry.get(schema);
95
+ if (meta) globalRegistry.add(modifiedSchema, meta);
96
+ return modifiedSchema;
134
97
  }
135
- throw new Error("Retry attempts exhausted without throwing an error.");
98
+ throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject");
99
+ }
100
+ function isZodTransformV3(schema) {
101
+ return isZodSchemaV3(schema) && "typeName" in schema._def && schema._def.typeName === "ZodEffects";
102
+ }
103
+ function isZodTransformV4(schema) {
104
+ return isZodSchemaV4(schema) && schema._zod.def.type === "pipe";
105
+ }
106
+ function interopZodTransformInputSchemaImpl(schema, recursive, cache) {
107
+ const cached = cache.get(schema);
108
+ if (cached !== void 0) return cached;
109
+ if (isZodSchemaV3(schema)) {
110
+ if (isZodTransformV3(schema)) return interopZodTransformInputSchemaImpl(schema._def.schema, recursive, cache);
111
+ return schema;
112
+ }
113
+ if (isZodSchemaV4(schema)) {
114
+ let outputSchema = schema;
115
+ if (isZodTransformV4(schema)) outputSchema = interopZodTransformInputSchemaImpl(schema._zod.def.in, recursive, cache);
116
+ if (recursive) {
117
+ if (isZodObjectV4(outputSchema)) {
118
+ const outputShape = {};
119
+ for (const [key, keySchema] of Object.entries(outputSchema._zod.def.shape)) outputShape[key] = interopZodTransformInputSchemaImpl(keySchema, recursive, cache);
120
+ outputSchema = clone(outputSchema, {
121
+ ...outputSchema._zod.def,
122
+ shape: outputShape
123
+ });
124
+ } else if (isZodArrayV4(outputSchema)) {
125
+ const elementSchema = interopZodTransformInputSchemaImpl(outputSchema._zod.def.element, recursive, cache);
126
+ outputSchema = clone(outputSchema, {
127
+ ...outputSchema._zod.def,
128
+ element: elementSchema
129
+ });
130
+ } else if (isZodOptionalV4(outputSchema)) {
131
+ const innerSchema = interopZodTransformInputSchemaImpl(outputSchema._zod.def.innerType, recursive, cache);
132
+ outputSchema = clone(outputSchema, {
133
+ ...outputSchema._zod.def,
134
+ innerType: innerSchema
135
+ });
136
+ } else if (isZodNullableV4(outputSchema)) {
137
+ const innerSchema = interopZodTransformInputSchemaImpl(outputSchema._zod.def.innerType, recursive, cache);
138
+ outputSchema = clone(outputSchema, {
139
+ ...outputSchema._zod.def,
140
+ innerType: innerSchema
141
+ });
142
+ }
143
+ }
144
+ const meta = globalRegistry.get(schema);
145
+ if (meta) globalRegistry.add(outputSchema, meta);
146
+ cache.set(schema, outputSchema);
147
+ return outputSchema;
148
+ }
149
+ throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType");
150
+ }
151
+ function interopZodTransformInputSchema(schema, recursive = false) {
152
+ const cache = /* @__PURE__ */ new WeakMap();
153
+ return interopZodTransformInputSchemaImpl(schema, recursive, cache);
136
154
  }
137
155
  export {
138
- pRetry
156
+ getSchemaDescription,
157
+ interopParseAsync,
158
+ interopZodObjectStrict,
159
+ interopZodTransformInputSchema,
160
+ isInteropZodSchema,
161
+ isSimpleStringZodSchema,
162
+ isZodArrayV4,
163
+ isZodNullableV4,
164
+ isZodObjectV4,
165
+ isZodOptionalV4,
166
+ isZodSchemaV3,
167
+ isZodSchemaV4
139
168
  };
140
169
  //# sourceMappingURL=index.es96.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es96.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/p-retry/index.js"],"sourcesContent":["import { isNetworkError } from \"../is-network-error/index.js\";\n\n//#region src/utils/p-retry/index.js\nfunction validateRetries(retries) {\n\tif (typeof retries === \"number\") {\n\t\tif (retries < 0) throw new TypeError(\"Expected `retries` to be a non-negative number.\");\n\t\tif (Number.isNaN(retries)) throw new TypeError(\"Expected `retries` to be a valid number or Infinity, got NaN.\");\n\t} else if (retries !== void 0) throw new TypeError(\"Expected `retries` to be a number or Infinity.\");\n}\nfunction validateNumberOption(name, value, { min = 0, allowInfinity = false } = {}) {\n\tif (value === void 0) return;\n\tif (typeof value !== \"number\" || Number.isNaN(value)) throw new TypeError(`Expected \\`${name}\\` to be a number${allowInfinity ? \" or Infinity\" : \"\"}.`);\n\tif (!allowInfinity && !Number.isFinite(value)) throw new TypeError(`Expected \\`${name}\\` to be a finite number.`);\n\tif (value < min) throw new TypeError(`Expected \\`${name}\\` to be \\u2265 ${min}.`);\n}\nvar AbortError = class extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\t\tthis.name = \"AbortError\";\n\t\tthis.message = message;\n\t}\n};\nfunction calculateDelay(retriesConsumed, options) {\n\tconst attempt = Math.max(1, retriesConsumed + 1);\n\tconst random = options.randomize ? Math.random() + 1 : 1;\n\tlet timeout = Math.round(random * options.minTimeout * options.factor ** (attempt - 1));\n\ttimeout = Math.min(timeout, options.maxTimeout);\n\treturn timeout;\n}\nfunction calculateRemainingTime(start, max) {\n\tif (!Number.isFinite(max)) return max;\n\treturn max - (performance.now() - start);\n}\nasync function onAttemptFailure({ error, attemptNumber, retriesConsumed, startTime, options }) {\n\tconst normalizedError = error instanceof Error ? error : /* @__PURE__ */ new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`);\n\tif (normalizedError instanceof AbortError) throw normalizedError.originalError;\n\tconst retriesLeft = Number.isFinite(options.retries) ? Math.max(0, options.retries - retriesConsumed) : options.retries;\n\tconst maxRetryTime = options.maxRetryTime ?? Number.POSITIVE_INFINITY;\n\tconst context = Object.freeze({\n\t\terror: normalizedError,\n\t\tattemptNumber,\n\t\tretriesLeft,\n\t\tretriesConsumed\n\t});\n\tawait options.onFailedAttempt(context);\n\tif (calculateRemainingTime(startTime, maxRetryTime) <= 0) throw normalizedError;\n\tconst consumeRetry = await options.shouldConsumeRetry(context);\n\tconst remainingTime = calculateRemainingTime(startTime, maxRetryTime);\n\tif (remainingTime <= 0 || retriesLeft <= 0) throw normalizedError;\n\tif (normalizedError instanceof TypeError && !isNetworkError(normalizedError)) {\n\t\tif (consumeRetry) throw normalizedError;\n\t\toptions.signal?.throwIfAborted();\n\t\treturn false;\n\t}\n\tif (!await options.shouldRetry(context)) throw normalizedError;\n\tif (!consumeRetry) {\n\t\toptions.signal?.throwIfAborted();\n\t\treturn false;\n\t}\n\tconst delayTime = calculateDelay(retriesConsumed, options);\n\tconst finalDelay = Math.min(delayTime, remainingTime);\n\tif (finalDelay > 0) await new Promise((resolve, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tclearTimeout(timeoutToken);\n\t\t\toptions.signal?.removeEventListener(\"abort\", onAbort);\n\t\t\treject(options.signal.reason);\n\t\t};\n\t\tconst timeoutToken = setTimeout(() => {\n\t\t\toptions.signal?.removeEventListener(\"abort\", onAbort);\n\t\t\tresolve();\n\t\t}, finalDelay);\n\t\tif (options.unref) timeoutToken.unref?.();\n\t\toptions.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\toptions.signal?.throwIfAborted();\n\treturn true;\n}\nasync function pRetry(input, options = {}) {\n\toptions = { ...options };\n\tvalidateRetries(options.retries);\n\tif (Object.hasOwn(options, \"forever\")) throw new Error(\"The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.\");\n\toptions.retries ??= 10;\n\toptions.factor ??= 2;\n\toptions.minTimeout ??= 1e3;\n\toptions.maxTimeout ??= Number.POSITIVE_INFINITY;\n\toptions.maxRetryTime ??= Number.POSITIVE_INFINITY;\n\toptions.randomize ??= false;\n\toptions.onFailedAttempt ??= () => {};\n\toptions.shouldRetry ??= () => true;\n\toptions.shouldConsumeRetry ??= () => true;\n\tvalidateNumberOption(\"factor\", options.factor, {\n\t\tmin: 0,\n\t\tallowInfinity: false\n\t});\n\tvalidateNumberOption(\"minTimeout\", options.minTimeout, {\n\t\tmin: 0,\n\t\tallowInfinity: false\n\t});\n\tvalidateNumberOption(\"maxTimeout\", options.maxTimeout, {\n\t\tmin: 0,\n\t\tallowInfinity: true\n\t});\n\tvalidateNumberOption(\"maxRetryTime\", options.maxRetryTime, {\n\t\tmin: 0,\n\t\tallowInfinity: true\n\t});\n\tif (!(options.factor > 0)) options.factor = 1;\n\toptions.signal?.throwIfAborted();\n\tlet attemptNumber = 0;\n\tlet retriesConsumed = 0;\n\tconst startTime = performance.now();\n\twhile (Number.isFinite(options.retries) ? retriesConsumed <= options.retries : true) {\n\t\tattemptNumber++;\n\t\ttry {\n\t\t\toptions.signal?.throwIfAborted();\n\t\t\tconst result = await input(attemptNumber);\n\t\t\toptions.signal?.throwIfAborted();\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (await onAttemptFailure({\n\t\t\t\terror,\n\t\t\t\tattemptNumber,\n\t\t\t\tretriesConsumed,\n\t\t\t\tstartTime,\n\t\t\t\toptions\n\t\t\t})) retriesConsumed++;\n\t\t}\n\t}\n\tthrow new Error(\"Retry attempts exhausted without throwing an error.\");\n}\n\n//#endregion\nexport { pRetry };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";AAGA,SAAS,gBAAgB,SAAS;AACjC,MAAI,OAAO,YAAY,UAAU;AAChC,QAAI,UAAU,EAAG,OAAM,IAAI,UAAU,iDAAiD;A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eAAc;AAC9B,aAAO;AAAA,IACR,SAAS,OAAO;AACf,UAAI,MAAM,iBAAiB;AAAA,QAC1B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ,CAAI,EAAG;AAAA,IACL;AAAA,EACD;AACA,QAAM,IAAI,MAAM,qDAAqD;AACtE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es96.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/types/zod.js"],"sourcesContent":["import { $ZodNever, $ZodOptional, $ZodUnknown, _never, _unknown, clone, globalRegistry, parse, parseAsync, util } from \"zod/v4/core\";\n\n//#region src/utils/types/zod.ts\nfunction isZodSchemaV4(schema) {\n\tif (typeof schema !== \"object\" || schema === null) return false;\n\tconst obj = schema;\n\tif (!(\"_zod\" in obj)) return false;\n\tconst zod = obj._zod;\n\treturn typeof zod === \"object\" && zod !== null && \"def\" in zod;\n}\nfunction isZodSchemaV3(schema) {\n\tif (typeof schema !== \"object\" || schema === null) return false;\n\tconst obj = schema;\n\tif (!(\"_def\" in obj) || \"_zod\" in obj) return false;\n\tconst def = obj._def;\n\treturn typeof def === \"object\" && def != null && \"typeName\" in def;\n}\n/** Backward compatible isZodSchema for Zod 3 */\nfunction isZodSchema(schema) {\n\tif (isZodSchemaV4(schema)) console.warn(\"[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior.\");\n\treturn isZodSchemaV3(schema);\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*/\nfunction isInteropZodSchema(input) {\n\tif (!input) return false;\n\tif (typeof input !== \"object\") return false;\n\tif (Array.isArray(input)) return false;\n\tif (isZodSchemaV4(input) || isZodSchemaV3(input)) return true;\n\treturn false;\n}\nfunction isZodLiteralV3(obj) {\n\tif (typeof obj === \"object\" && obj !== null && \"_def\" in obj && typeof obj._def === \"object\" && obj._def !== null && \"typeName\" in obj._def && obj._def.typeName === \"ZodLiteral\") return true;\n\treturn false;\n}\nfunction isZodLiteralV4(obj) {\n\tif (!isZodSchemaV4(obj)) return false;\n\tif (typeof obj === \"object\" && obj !== null && \"_zod\" in obj && typeof obj._zod === \"object\" && obj._zod !== null && \"def\" in obj._zod && typeof obj._zod.def === \"object\" && obj._zod.def !== null && \"type\" in obj._zod.def && obj._zod.def.type === \"literal\") return true;\n\treturn false;\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*/\nfunction isInteropZodLiteral(obj) {\n\tif (isZodLiteralV3(obj)) return true;\n\tif (isZodLiteralV4(obj)) return true;\n\treturn false;\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*/\nasync function interopSafeParseAsync(schema, input) {\n\tif (isZodSchemaV4(schema)) try {\n\t\tconst data = await parseAsync(schema, input);\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror\n\t\t};\n\t}\n\tif (isZodSchemaV3(schema)) return await schema.safeParseAsync(input);\n\tthrow new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\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*/\nasync function interopParseAsync(schema, input) {\n\tif (isZodSchemaV4(schema)) return await parseAsync(schema, input);\n\tif (isZodSchemaV3(schema)) return await schema.parseAsync(input);\n\tthrow new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\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*/\nfunction interopSafeParse(schema, input) {\n\tif (isZodSchemaV4(schema)) try {\n\t\tconst data = parse(schema, input);\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror\n\t\t};\n\t}\n\tif (isZodSchemaV3(schema)) return schema.safeParse(input);\n\tthrow new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\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*/\nfunction interopParse(schema, input) {\n\tif (isZodSchemaV4(schema)) return parse(schema, input);\n\tif (isZodSchemaV3(schema)) return schema.parse(input);\n\tthrow new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\n}\n/**\n* Retrieves the description from a schema definition (v3, v4, 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*/\nfunction getSchemaDescription(schema) {\n\tif (isZodSchemaV4(schema)) return globalRegistry.get(schema)?.description;\n\tif (isZodSchemaV3(schema)) return schema.description;\n\tif (\"description\" in schema && typeof schema.description === \"string\") return schema.description;\n\treturn void 0;\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*/\nfunction isShapelessZodSchema(schema) {\n\tif (!isInteropZodSchema(schema)) return false;\n\tif (isZodSchemaV3(schema)) {\n\t\tconst def = schema._def;\n\t\tif (def.typeName === \"ZodObject\") {\n\t\t\tconst obj = schema;\n\t\t\treturn !obj.shape || Object.keys(obj.shape).length === 0;\n\t\t}\n\t\tif (def.typeName === \"ZodRecord\") return true;\n\t}\n\tif (isZodSchemaV4(schema)) {\n\t\tconst def = schema._zod.def;\n\t\tif (def.type === \"object\") {\n\t\t\tconst obj = schema;\n\t\t\treturn !obj.shape || Object.keys(obj.shape).length === 0;\n\t\t}\n\t\tif (def.type === \"record\") return true;\n\t}\n\tif (typeof schema === \"object\" && schema !== null && !(\"shape\" in schema)) return true;\n\treturn false;\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*/\nfunction isSimpleStringZodSchema(schema) {\n\tif (!isInteropZodSchema(schema)) return false;\n\tif (isZodSchemaV3(schema)) {\n\t\tconst def = schema._def;\n\t\treturn def.typeName === \"ZodString\";\n\t}\n\tif (isZodSchemaV4(schema)) {\n\t\tconst def = schema._zod.def;\n\t\treturn def.type === \"string\";\n\t}\n\treturn false;\n}\nfunction isZodObjectV3(obj) {\n\tif (typeof obj === \"object\" && obj !== null && \"_def\" in obj && typeof obj._def === \"object\" && obj._def !== null && \"typeName\" in obj._def && obj._def.typeName === \"ZodObject\") return true;\n\treturn false;\n}\nfunction isZodObjectV4(obj) {\n\tif (!isZodSchemaV4(obj)) return false;\n\tif (typeof obj === \"object\" && obj !== null && \"_zod\" in obj && typeof obj._zod === \"object\" && obj._zod !== null && \"def\" in obj._zod && typeof obj._zod.def === \"object\" && obj._zod.def !== null && \"type\" in obj._zod.def && obj._zod.def.type === \"object\") return true;\n\treturn false;\n}\nfunction isZodArrayV4(obj) {\n\tif (!isZodSchemaV4(obj)) return false;\n\tif (typeof obj === \"object\" && obj !== null && \"_zod\" in obj && typeof obj._zod === \"object\" && obj._zod !== null && \"def\" in obj._zod && typeof obj._zod.def === \"object\" && obj._zod.def !== null && \"type\" in obj._zod.def && obj._zod.def.type === \"array\") return true;\n\treturn false;\n}\nfunction isZodOptionalV4(obj) {\n\tif (!isZodSchemaV4(obj)) return false;\n\tif (typeof obj === \"object\" && obj !== null && \"_zod\" in obj && typeof obj._zod === \"object\" && obj._zod !== null && \"def\" in obj._zod && typeof obj._zod.def === \"object\" && obj._zod.def !== null && \"type\" in obj._zod.def && obj._zod.def.type === \"optional\") return true;\n\treturn false;\n}\nfunction isZodNullableV4(obj) {\n\tif (!isZodSchemaV4(obj)) return false;\n\tif (typeof obj === \"object\" && obj !== null && \"_zod\" in obj && typeof obj._zod === \"object\" && obj._zod !== null && \"def\" in obj._zod && typeof obj._zod.def === \"object\" && obj._zod.def !== null && \"type\" in obj._zod.def && obj._zod.def.type === \"nullable\") return true;\n\treturn false;\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*/\nfunction isInteropZodObject(obj) {\n\tif (isZodObjectV3(obj)) return true;\n\tif (isZodObjectV4(obj)) return true;\n\treturn false;\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*/\nfunction getInteropZodObjectShape(schema) {\n\tif (isZodSchemaV3(schema)) return schema.shape;\n\tif (isZodSchemaV4(schema)) return schema._zod.def.shape;\n\tthrow new Error(\"Schema must be an instance of z3.ZodObject or z4.$ZodObject\");\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*/\nfunction extendInteropZodObject(schema, extension) {\n\tif (isZodSchemaV3(schema)) return schema.extend(extension);\n\tif (isZodSchemaV4(schema)) return util.extend(schema, extension);\n\tthrow new Error(\"Schema must be an instance of z3.ZodObject or z4.$ZodObject\");\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*/\nfunction interopZodObjectPartial(schema) {\n\tif (isZodSchemaV3(schema)) return schema.partial();\n\tif (isZodSchemaV4(schema)) return util.partial($ZodOptional, schema, void 0);\n\tthrow new Error(\"Schema must be an instance of z3.ZodObject or z4.$ZodObject\");\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*/\nfunction interopZodObjectStrict(schema, recursive = false) {\n\tif (isZodSchemaV3(schema)) return schema.strict();\n\tif (isZodObjectV4(schema)) {\n\t\tconst outputShape = schema._zod.def.shape;\n\t\tif (recursive) for (const [key, keySchema] of Object.entries(schema._zod.def.shape)) {\n\t\t\tif (isZodObjectV4(keySchema)) {\n\t\t\t\tconst outputSchema = interopZodObjectStrict(keySchema, recursive);\n\t\t\t\toutputShape[key] = outputSchema;\n\t\t\t} else if (isZodArrayV4(keySchema)) {\n\t\t\t\tlet elementSchema = keySchema._zod.def.element;\n\t\t\t\tif (isZodObjectV4(elementSchema)) elementSchema = interopZodObjectStrict(elementSchema, recursive);\n\t\t\t\toutputShape[key] = clone(keySchema, {\n\t\t\t\t\t...keySchema._zod.def,\n\t\t\t\t\telement: elementSchema\n\t\t\t\t});\n\t\t\t} else outputShape[key] = keySchema;\n\t\t\tconst meta$1 = globalRegistry.get(keySchema);\n\t\t\tif (meta$1) globalRegistry.add(outputShape[key], meta$1);\n\t\t}\n\t\tconst modifiedSchema = clone(schema, {\n\t\t\t...schema._zod.def,\n\t\t\tshape: outputShape,\n\t\t\tcatchall: _never($ZodNever)\n\t\t});\n\t\tconst meta = globalRegistry.get(schema);\n\t\tif (meta) globalRegistry.add(modifiedSchema, meta);\n\t\treturn modifiedSchema;\n\t}\n\tthrow new Error(\"Schema must be an instance of z3.ZodObject or z4.$ZodObject\");\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*/\nfunction interopZodObjectPassthrough(schema, recursive = false) {\n\tif (isZodObjectV3(schema)) return schema.passthrough();\n\tif (isZodObjectV4(schema)) {\n\t\tconst outputShape = schema._zod.def.shape;\n\t\tif (recursive) for (const [key, keySchema] of Object.entries(schema._zod.def.shape)) {\n\t\t\tif (isZodObjectV4(keySchema)) {\n\t\t\t\tconst outputSchema = interopZodObjectPassthrough(keySchema, recursive);\n\t\t\t\toutputShape[key] = outputSchema;\n\t\t\t} else if (isZodArrayV4(keySchema)) {\n\t\t\t\tlet elementSchema = keySchema._zod.def.element;\n\t\t\t\tif (isZodObjectV4(elementSchema)) elementSchema = interopZodObjectPassthrough(elementSchema, recursive);\n\t\t\t\toutputShape[key] = clone(keySchema, {\n\t\t\t\t\t...keySchema._zod.def,\n\t\t\t\t\telement: elementSchema\n\t\t\t\t});\n\t\t\t} else outputShape[key] = keySchema;\n\t\t\tconst meta$1 = globalRegistry.get(keySchema);\n\t\t\tif (meta$1) globalRegistry.add(outputShape[key], meta$1);\n\t\t}\n\t\tconst modifiedSchema = clone(schema, {\n\t\t\t...schema._zod.def,\n\t\t\tshape: outputShape,\n\t\t\tcatchall: _unknown($ZodUnknown)\n\t\t});\n\t\tconst meta = globalRegistry.get(schema);\n\t\tif (meta) globalRegistry.add(modifiedSchema, meta);\n\t\treturn modifiedSchema;\n\t}\n\tthrow new Error(\"Schema must be an instance of z3.ZodObject or z4.$ZodObject\");\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*/\nfunction getInteropZodDefaultGetter(schema) {\n\tif (isZodSchemaV3(schema)) try {\n\t\tconst defaultValue = schema.parse(void 0);\n\t\treturn () => defaultValue;\n\t} catch {\n\t\treturn void 0;\n\t}\n\tif (isZodSchemaV4(schema)) try {\n\t\tconst defaultValue = parse(schema, void 0);\n\t\treturn () => defaultValue;\n\t} catch {\n\t\treturn void 0;\n\t}\n\treturn void 0;\n}\nfunction isZodTransformV3(schema) {\n\treturn isZodSchemaV3(schema) && \"typeName\" in schema._def && schema._def.typeName === \"ZodEffects\";\n}\nfunction isZodTransformV4(schema) {\n\treturn isZodSchemaV4(schema) && schema._zod.def.type === \"pipe\";\n}\nfunction interopZodTransformInputSchemaImpl(schema, recursive, cache) {\n\tconst cached = cache.get(schema);\n\tif (cached !== void 0) return cached;\n\tif (isZodSchemaV3(schema)) {\n\t\tif (isZodTransformV3(schema)) return interopZodTransformInputSchemaImpl(schema._def.schema, recursive, cache);\n\t\treturn schema;\n\t}\n\tif (isZodSchemaV4(schema)) {\n\t\tlet outputSchema = schema;\n\t\tif (isZodTransformV4(schema)) outputSchema = interopZodTransformInputSchemaImpl(schema._zod.def.in, recursive, cache);\n\t\tif (recursive) {\n\t\t\tif (isZodObjectV4(outputSchema)) {\n\t\t\t\tconst outputShape = {};\n\t\t\t\tfor (const [key, keySchema] of Object.entries(outputSchema._zod.def.shape)) outputShape[key] = interopZodTransformInputSchemaImpl(keySchema, recursive, cache);\n\t\t\t\toutputSchema = clone(outputSchema, {\n\t\t\t\t\t...outputSchema._zod.def,\n\t\t\t\t\tshape: outputShape\n\t\t\t\t});\n\t\t\t} else if (isZodArrayV4(outputSchema)) {\n\t\t\t\tconst elementSchema = interopZodTransformInputSchemaImpl(outputSchema._zod.def.element, recursive, cache);\n\t\t\t\toutputSchema = clone(outputSchema, {\n\t\t\t\t\t...outputSchema._zod.def,\n\t\t\t\t\telement: elementSchema\n\t\t\t\t});\n\t\t\t} else if (isZodOptionalV4(outputSchema)) {\n\t\t\t\tconst innerSchema = interopZodTransformInputSchemaImpl(outputSchema._zod.def.innerType, recursive, cache);\n\t\t\t\toutputSchema = clone(outputSchema, {\n\t\t\t\t\t...outputSchema._zod.def,\n\t\t\t\t\tinnerType: innerSchema\n\t\t\t\t});\n\t\t\t} else if (isZodNullableV4(outputSchema)) {\n\t\t\t\tconst innerSchema = interopZodTransformInputSchemaImpl(outputSchema._zod.def.innerType, recursive, cache);\n\t\t\t\toutputSchema = clone(outputSchema, {\n\t\t\t\t\t...outputSchema._zod.def,\n\t\t\t\t\tinnerType: innerSchema\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst meta = globalRegistry.get(schema);\n\t\tif (meta) globalRegistry.add(outputSchema, meta);\n\t\tcache.set(schema, outputSchema);\n\t\treturn outputSchema;\n\t}\n\tthrow new Error(\"Schema must be an instance of z3.ZodType or z4.$ZodType\");\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*/\nfunction interopZodTransformInputSchema(schema, recursive = false) {\n\tconst cache = /* @__PURE__ */ new WeakMap();\n\treturn interopZodTransformInputSchemaImpl(schema, recursive, cache);\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*/\nfunction interopZodObjectMakeFieldsOptional(schema, predicate) {\n\tif (isZodSchemaV3(schema)) {\n\t\tconst shape = getInteropZodObjectShape(schema);\n\t\tconst modifiedShape = {};\n\t\tfor (const [key, value] of Object.entries(shape)) if (predicate(key, value)) modifiedShape[key] = value.optional();\n\t\telse modifiedShape[key] = value;\n\t\treturn schema.extend(modifiedShape);\n\t}\n\tif (isZodSchemaV4(schema)) {\n\t\tconst shape = getInteropZodObjectShape(schema);\n\t\tconst outputShape = { ...schema._zod.def.shape };\n\t\tfor (const [key, value] of Object.entries(shape)) if (predicate(key, value)) outputShape[key] = new $ZodOptional({\n\t\t\ttype: \"optional\",\n\t\t\tinnerType: value\n\t\t});\n\t\tconst modifiedSchema = clone(schema, {\n\t\t\t...schema._zod.def,\n\t\t\tshape: outputShape\n\t\t});\n\t\tconst meta = globalRegistry.get(schema);\n\t\tif (meta) globalRegistry.add(modifiedSchema, meta);\n\t\treturn modifiedSchema;\n\t}\n\tthrow new Error(\"Schema must be an instance of z3.ZodObject or z4.$ZodObject\");\n}\nfunction isInteropZodError(e) {\n\treturn e instanceof Error && (e.constructor.name === \"ZodError\" || e.constructor.name === \"$ZodError\");\n}\n\n//#endregion\nexport { extendInteropZodObject, getInteropZodDefaultGetter, getInteropZodObjectShape, getSchemaDescription, interopParse, interopParseAsync, interopSafeParse, interopSafeParseAsync, interopZodObjectMakeFieldsOptional, interopZodObjectPartial, interopZodObjectPassthrough, interopZodObjectStrict, interopZodTransformInputSchema, isInteropZodError, isInteropZodLiteral, isInteropZodObject, isInteropZodSchema, isShapelessZodSchema, isSimpleStringZodSchema, isZodArrayV4, isZodLiteralV3, isZodLiteralV4, isZodNullableV4, isZodObjectV3, isZodObjectV4, isZodOptionalV4, isZodSchema, isZodSchemaV3, isZodSchemaV4 };\n//# sourceMappingURL=zod.js.map"],"names":[],"mappings":";;;;;AAGA,SAAS,cAAc,QAAQ;AAC9B,MAAI,OAAO,WAAW,YAAY,WAAW,KAAM,QAAO;AAC1D,QAAM,MAAM;AACZ,MAAI,EAAE,UAAU,KAAM,QAAO;AAC7B,QAAM,MAAM,IAAI;AAChB,SAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,SAAS;AAC5D;AACA,SAAS,cAAc,QAAQ;AAC9B,MAAI,OAAO,WAAW,YAAY,WAAW,KAAM,QAAO;AAC1D,QAAM,MAAM;AACZ,MAAI,EAAE,UAAU,QAAQ,UAAU,IAAK,QAAO;AAC9C,QAAM,MAAM,IAAI;AAChB,SAAO,OAAO,QAAQ,YAAY,OAAO,QAAQ,cAAc;AAChE;AAYA,SAAS,mBAAmB,OAAO;AAClC,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,MAAI,cAAc,KAAK,KAAK,cAAc,KAAK,EAAG,QAAO;AACzD,SAAO;AACR;AAyDA,eAAe,kBAAkB,QAAQ,OAAO;AAC/C,MAAI,cAAc,MAAM,EAAG,QAAO,MAAM,WAAW,QAAQ,KAAK;AAChE,MAAI,cAAc,MAAM,EAAG,QAAO,MAAM,OAAO,WAAW,KAAK;AAC/D,QAAM,IAAI,MAAM,yDAAyD;AAC1E;AAiDA,SAAS,qBAAqB,QAAQ;AACrC,MAAI,cAAc,MAAM,EAAG,QAAO,eAAe,IAAI,MAAM,GAAG;AAC9D,MAAI,cAAc,MAAM,EAAG,QAAO,OAAO;AACzC,MAAI,iB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