@mcp-use/inspector 0.8.0 → 0.8.1-canary.1

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.
@@ -1,11 +1,11 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/display-YIYC6WJE-BgL49xvx.js","assets/index-CvZ3HDgz.js","assets/index-CwF__a_n.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/display-YIYC6WJE-oHQhi5o4.js","assets/index-CMtFn788.js","assets/index-CwF__a_n.css"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
6
- import { _ as __name, c as ZodIssueCode, u as unionType, a as anyType, d as booleanType, n as numberType, s as stringType, e as arrayType, o as objectType, f as nullType, Z as ZodFirstPartyTypeKind, h as custom, i as ZodType$1, l as literalType, j as undefinedType, k as functionType, p as promiseType, m as enumType, r as recordType, q as instanceOfType, t as logger, w as __vitePreload, v as v4$1 } from "./index-CvZ3HDgz.js";
7
- import { B, x, H, L, y, M, W, z } from "./index-CvZ3HDgz.js";
8
- import { u as rng, w as unsafeStringify, x as parse$1, y as $constructor, z as $ZodError, A as flattenError, B as formatError, C as _parse, D as _safeParse, E as _parseAsync, F as _safeParseAsync, G as _any, H as $ZodAny, I as $ZodType, d as clone, J as _overwrite, g as globalRegistry, K as _refine, L as normalizeParams, M as _array, N as $ZodCheck, O as issue, h as $ZodOptional, Q as $ZodNullable, R as $ZodNonOptional, S as $ZodUnion, U as $ZodIntersection, W as $ZodPipe, X as $ZodTransform, Y as $ZodDefault, Z as $ZodPrefault, a0 as $ZodCatch, a1 as $ZodReadonly, a2 as $ZodArray, a3 as _minLength, a4 as _maxLength, a5 as _length, a6 as $ZodCustom, a7 as camelCase, s as snakeCase, v as v4, P as PQueueMod, p as pRetry, a as v5, b as styles, c as parseAsync$1, i as parse$2, j as extend, f as partial, _ as _never, $ as $ZodNever, e as _unknown, k as $ZodUnknown, t as toJSONSchema, l as deepCompareStrict, V as Validator, m as dereference, n as validate$1, o as getEncodingNameForModel, T as Tiktoken, q as prettifyError, r as validate$2, a8 as $ZodRegistry } from "./chunk-VL2OQCWN-BjMsbc92.js";
6
+ import { n as __name, p as parseAsync, g as globalRegistry, i as $ZodOptional, c as clone, j as parse$1, k as extend, h as partial, _ as _never, d as $ZodNever, e as _unknown, f as $ZodUnknown, l as prettifyError, o as any, $ as $ZodRegistry, q as logger, r as __vitePreload, v as v4$1 } from "./index-CMtFn788.js";
7
+ import { B, s, H, L, t, M, W, u } from "./index-CMtFn788.js";
8
+ import { r as rng, u as unsafeStringify, j as parse, k as ZodIssueCode, l as unionType, f as anyType, m as booleanType, n as numberType, g as stringType, q as arrayType, o as objectType, w as nullType, x as camelCase, s as snakeCase, v as v4, P as PQueueMod, p as pRetry, a as v5, b as styles, Z as ZodFirstPartyTypeKind, t as toJSONSchema, d as deepCompareStrict, V as Validator, c as dereference, e as validate$1, h as getEncodingNameForModel, T as Tiktoken, i as validate$2, y as custom, z as ZodType, A as literalType, B as undefinedType, C as functionType, D as promiseType, E as enumType, F as recordType, G as instanceOfType } from "./chunk-VL2OQCWN-DkM9NuUB.js";
9
9
  import { o as os } from "./__vite-browser-external-CHS79mP1.js";
10
10
  import { j as join, d as dirname, i as isAbsolute } from "./path-QsnVvLoj.js";
11
11
  import "./index-DX0TIfSM.js";
@@ -77,7 +77,7 @@ function v1(options, buf, offset) {
77
77
  return buf || unsafeStringify(b);
78
78
  }
79
79
  function v1ToV6(uuid) {
80
- var v1Bytes = typeof uuid === "string" ? parse$1(uuid) : uuid;
80
+ var v1Bytes = typeof uuid === "string" ? parse(uuid) : uuid;
81
81
  var v6Bytes = _v1ToV6(v1Bytes);
82
82
  return typeof uuid === "string" ? unsafeStringify(v6Bytes) : v6Bytes;
83
83
  }
@@ -85,42 +85,42 @@ function _v1ToV6(v1Bytes, randomize = false) {
85
85
  return Uint8Array.of((v1Bytes[6] & 15) << 4 | v1Bytes[7] >> 4 & 15, (v1Bytes[7] & 15) << 4 | (v1Bytes[4] & 240) >> 4, (v1Bytes[4] & 15) << 4 | (v1Bytes[5] & 240) >> 4, (v1Bytes[5] & 15) << 4 | (v1Bytes[0] & 240) >> 4, (v1Bytes[0] & 15) << 4 | (v1Bytes[1] & 240) >> 4, (v1Bytes[1] & 15) << 4 | (v1Bytes[2] & 240) >> 4, 96 | v1Bytes[2] & 15, v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]);
86
86
  }
87
87
  function ownKeys(e, r) {
88
- var t = Object.keys(e);
88
+ var t2 = Object.keys(e);
89
89
  if (Object.getOwnPropertySymbols) {
90
90
  var o = Object.getOwnPropertySymbols(e);
91
91
  r && (o = o.filter(function(r2) {
92
92
  return Object.getOwnPropertyDescriptor(e, r2).enumerable;
93
- })), t.push.apply(t, o);
93
+ })), t2.push.apply(t2, o);
94
94
  }
95
- return t;
95
+ return t2;
96
96
  }
97
97
  function _objectSpread(e) {
98
98
  for (var r = 1; r < arguments.length; r++) {
99
- var t = null != arguments[r] ? arguments[r] : {};
100
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
101
- _defineProperty(e, r2, t[r2]);
102
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
103
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
99
+ var t2 = null != arguments[r] ? arguments[r] : {};
100
+ r % 2 ? ownKeys(Object(t2), true).forEach(function(r2) {
101
+ _defineProperty(e, r2, t2[r2]);
102
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r2) {
103
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
104
104
  });
105
105
  }
106
106
  return e;
107
107
  }
108
- function _defineProperty(e, r, t) {
109
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
108
+ function _defineProperty(e, r, t2) {
109
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
110
110
  }
111
- function _toPropertyKey(t) {
112
- var i = _toPrimitive(t, "string");
111
+ function _toPropertyKey(t2) {
112
+ var i = _toPrimitive(t2, "string");
113
113
  return "symbol" == typeof i ? i : i + "";
114
114
  }
115
- function _toPrimitive(t, r) {
116
- if ("object" != typeof t || !t) return t;
117
- var e = t[Symbol.toPrimitive];
115
+ function _toPrimitive(t2, r) {
116
+ if ("object" != typeof t2 || !t2) return t2;
117
+ var e = t2[Symbol.toPrimitive];
118
118
  if (void 0 !== e) {
119
- var i = e.call(t, r);
119
+ var i = e.call(t2, r);
120
120
  if ("object" != typeof i) return i;
121
121
  throw new TypeError("@@toPrimitive must return a primitive value.");
122
122
  }
123
- return ("string" === r ? String : Number)(t);
123
+ return ("string" === r ? String : Number)(t2);
124
124
  }
125
125
  function v6(options = {}, buf, offset = 0) {
126
126
  var bytes = v1(_objectSpread(_objectSpread({}, options), {}, {
@@ -129,320 +129,6 @@ function v6(options = {}, buf, offset = 0) {
129
129
  bytes = v1ToV6(bytes);
130
130
  return unsafeStringify(bytes);
131
131
  }
132
- const initializer = (inst, issues) => {
133
- $ZodError.init(inst, issues);
134
- inst.name = "ZodError";
135
- Object.defineProperties(inst, {
136
- format: {
137
- value: (mapper) => formatError(inst, mapper)
138
- // enumerable: false,
139
- },
140
- flatten: {
141
- value: (mapper) => flattenError(inst, mapper)
142
- // enumerable: false,
143
- },
144
- addIssue: {
145
- value: (issue2) => inst.issues.push(issue2)
146
- // enumerable: false,
147
- },
148
- addIssues: {
149
- value: (issues2) => inst.issues.push(...issues2)
150
- // enumerable: false,
151
- },
152
- isEmpty: {
153
- get() {
154
- return inst.issues.length === 0;
155
- }
156
- // enumerable: false,
157
- }
158
- });
159
- };
160
- const ZodRealError = $constructor("ZodError", initializer, {
161
- Parent: Error
162
- });
163
- const parse = /* @__PURE__ */ _parse(ZodRealError);
164
- const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
165
- const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
166
- const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
167
- const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
168
- $ZodType.init(inst, def);
169
- inst.def = def;
170
- Object.defineProperty(inst, "_def", { value: def });
171
- inst.check = (...checks2) => {
172
- return inst.clone(
173
- {
174
- ...def,
175
- checks: [
176
- ...def.checks ?? [],
177
- ...checks2.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
178
- ]
179
- }
180
- // { parent: true }
181
- );
182
- };
183
- inst.clone = (def2, params) => clone(inst, def2, params);
184
- inst.brand = () => inst;
185
- inst.register = ((reg, meta) => {
186
- reg.add(inst, meta);
187
- return inst;
188
- });
189
- inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
190
- inst.safeParse = (data, params) => safeParse(inst, data, params);
191
- inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
192
- inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
193
- inst.spa = inst.safeParseAsync;
194
- inst.refine = (check2, params) => inst.check(refine(check2, params));
195
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
196
- inst.overwrite = (fn) => inst.check(_overwrite(fn));
197
- inst.optional = () => optional(inst);
198
- inst.nullable = () => nullable(inst);
199
- inst.nullish = () => optional(nullable(inst));
200
- inst.nonoptional = (params) => nonoptional(inst, params);
201
- inst.array = () => array(inst);
202
- inst.or = (arg) => union([inst, arg]);
203
- inst.and = (arg) => intersection(inst, arg);
204
- inst.transform = (tx) => pipe(inst, transform(tx));
205
- inst.default = (def2) => _default$1(inst, def2);
206
- inst.prefault = (def2) => prefault(inst, def2);
207
- inst.catch = (params) => _catch(inst, params);
208
- inst.pipe = (target) => pipe(inst, target);
209
- inst.readonly = () => readonly(inst);
210
- inst.describe = (description) => {
211
- const cl = inst.clone();
212
- globalRegistry.add(cl, { description });
213
- return cl;
214
- };
215
- Object.defineProperty(inst, "description", {
216
- get() {
217
- return globalRegistry.get(inst)?.description;
218
- },
219
- configurable: true
220
- });
221
- inst.meta = (...args) => {
222
- if (args.length === 0) {
223
- return globalRegistry.get(inst);
224
- }
225
- const cl = inst.clone();
226
- globalRegistry.add(cl, args[0]);
227
- return cl;
228
- };
229
- inst.isOptional = () => inst.safeParse(void 0).success;
230
- inst.isNullable = () => inst.safeParse(null).success;
231
- return inst;
232
- });
233
- const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
234
- $ZodAny.init(inst, def);
235
- ZodType.init(inst, def);
236
- });
237
- function any() {
238
- return _any(ZodAny);
239
- }
240
- const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
241
- $ZodArray.init(inst, def);
242
- ZodType.init(inst, def);
243
- inst.element = def.element;
244
- inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
245
- inst.nonempty = (params) => inst.check(_minLength(1, params));
246
- inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
247
- inst.length = (len, params) => inst.check(_length(len, params));
248
- inst.unwrap = () => inst.element;
249
- });
250
- function array(element, params) {
251
- return _array(ZodArray, element, params);
252
- }
253
- const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
254
- $ZodUnion.init(inst, def);
255
- ZodType.init(inst, def);
256
- inst.options = def.options;
257
- });
258
- function union(options, params) {
259
- return new ZodUnion({
260
- type: "union",
261
- options,
262
- ...normalizeParams(params)
263
- });
264
- }
265
- const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
266
- $ZodIntersection.init(inst, def);
267
- ZodType.init(inst, def);
268
- });
269
- function intersection(left, right) {
270
- return new ZodIntersection({
271
- type: "intersection",
272
- left,
273
- right
274
- });
275
- }
276
- const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
277
- $ZodTransform.init(inst, def);
278
- ZodType.init(inst, def);
279
- inst._zod.parse = (payload, _ctx) => {
280
- payload.addIssue = (issue$1) => {
281
- if (typeof issue$1 === "string") {
282
- payload.issues.push(issue(issue$1, payload.value, def));
283
- } else {
284
- const _issue = issue$1;
285
- if (_issue.fatal)
286
- _issue.continue = false;
287
- _issue.code ?? (_issue.code = "custom");
288
- _issue.input ?? (_issue.input = payload.value);
289
- _issue.inst ?? (_issue.inst = inst);
290
- _issue.continue ?? (_issue.continue = true);
291
- payload.issues.push(issue(_issue));
292
- }
293
- };
294
- const output = def.transform(payload.value, payload);
295
- if (output instanceof Promise) {
296
- return output.then((output2) => {
297
- payload.value = output2;
298
- return payload;
299
- });
300
- }
301
- payload.value = output;
302
- return payload;
303
- };
304
- });
305
- function transform(fn) {
306
- return new ZodTransform({
307
- type: "transform",
308
- transform: fn
309
- });
310
- }
311
- const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
312
- $ZodOptional.init(inst, def);
313
- ZodType.init(inst, def);
314
- inst.unwrap = () => inst._zod.def.innerType;
315
- });
316
- function optional(innerType) {
317
- return new ZodOptional({
318
- type: "optional",
319
- innerType
320
- });
321
- }
322
- const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
323
- $ZodNullable.init(inst, def);
324
- ZodType.init(inst, def);
325
- inst.unwrap = () => inst._zod.def.innerType;
326
- });
327
- function nullable(innerType) {
328
- return new ZodNullable({
329
- type: "nullable",
330
- innerType
331
- });
332
- }
333
- const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
334
- $ZodDefault.init(inst, def);
335
- ZodType.init(inst, def);
336
- inst.unwrap = () => inst._zod.def.innerType;
337
- inst.removeDefault = inst.unwrap;
338
- });
339
- function _default$1(innerType, defaultValue) {
340
- return new ZodDefault({
341
- type: "default",
342
- innerType,
343
- get defaultValue() {
344
- return typeof defaultValue === "function" ? defaultValue() : defaultValue;
345
- }
346
- });
347
- }
348
- const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
349
- $ZodPrefault.init(inst, def);
350
- ZodType.init(inst, def);
351
- inst.unwrap = () => inst._zod.def.innerType;
352
- });
353
- function prefault(innerType, defaultValue) {
354
- return new ZodPrefault({
355
- type: "prefault",
356
- innerType,
357
- get defaultValue() {
358
- return typeof defaultValue === "function" ? defaultValue() : defaultValue;
359
- }
360
- });
361
- }
362
- const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
363
- $ZodNonOptional.init(inst, def);
364
- ZodType.init(inst, def);
365
- inst.unwrap = () => inst._zod.def.innerType;
366
- });
367
- function nonoptional(innerType, params) {
368
- return new ZodNonOptional({
369
- type: "nonoptional",
370
- innerType,
371
- ...normalizeParams(params)
372
- });
373
- }
374
- const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
375
- $ZodCatch.init(inst, def);
376
- ZodType.init(inst, def);
377
- inst.unwrap = () => inst._zod.def.innerType;
378
- inst.removeCatch = inst.unwrap;
379
- });
380
- function _catch(innerType, catchValue) {
381
- return new ZodCatch({
382
- type: "catch",
383
- innerType,
384
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
385
- });
386
- }
387
- const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
388
- $ZodPipe.init(inst, def);
389
- ZodType.init(inst, def);
390
- inst.in = def.in;
391
- inst.out = def.out;
392
- });
393
- function pipe(in_, out) {
394
- return new ZodPipe({
395
- type: "pipe",
396
- in: in_,
397
- out
398
- // ...util.normalizeParams(params),
399
- });
400
- }
401
- const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
402
- $ZodReadonly.init(inst, def);
403
- ZodType.init(inst, def);
404
- });
405
- function readonly(innerType) {
406
- return new ZodReadonly({
407
- type: "readonly",
408
- innerType
409
- });
410
- }
411
- const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
412
- $ZodCustom.init(inst, def);
413
- ZodType.init(inst, def);
414
- });
415
- function check(fn) {
416
- const ch = new $ZodCheck({
417
- check: "custom"
418
- // ...util.normalizeParams(params),
419
- });
420
- ch._zod.check = fn;
421
- return ch;
422
- }
423
- function refine(fn, _params = {}) {
424
- return _refine(ZodCustom, fn, _params);
425
- }
426
- function superRefine(fn) {
427
- const ch = check((payload) => {
428
- payload.addIssue = (issue$1) => {
429
- if (typeof issue$1 === "string") {
430
- payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
431
- } else {
432
- const _issue = issue$1;
433
- if (_issue.fatal)
434
- _issue.continue = false;
435
- _issue.code ?? (_issue.code = "custom");
436
- _issue.input ?? (_issue.input = payload.value);
437
- _issue.inst ?? (_issue.inst = ch);
438
- _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
439
- payload.issues.push(issue(_issue));
440
- }
441
- };
442
- return fn(payload.value, payload);
443
- });
444
- return ch;
445
- }
446
132
  async function* streamEventsToAISDK(streamEvents) {
447
133
  for await (const event of streamEvents) {
448
134
  if (event.event === "on_chat_model_stream" && event.data?.chunk?.text) {
@@ -683,7 +369,7 @@ class JSONSchemaToZod {
683
369
  throw new Error("Expected schema.type to be an array");
684
370
  }
685
371
  const nonNullSchema = { ...schema };
686
- nonNullSchema.type = schema.type.filter((t) => t !== "null");
372
+ nonNullSchema.type = schema.type.filter((t2) => t2 !== "null");
687
373
  if (nonNullSchema.type.length === 1) {
688
374
  const singleTypeSchema = this.handleSingleType({ ...schema, type: nonNullSchema.type[0] });
689
375
  return singleTypeSchema.nullable();
@@ -2234,8 +1920,8 @@ var BaseMessageChunk = class extends BaseMessage {
2234
1920
  return super.isInstance(obj) && "concat" in obj && typeof obj.concat === "function";
2235
1921
  }
2236
1922
  };
2237
- function _isMessageFieldWithRole(x2) {
2238
- return typeof x2.role === "string";
1923
+ function _isMessageFieldWithRole(x) {
1924
+ return typeof x.role === "string";
2239
1925
  }
2240
1926
  function isBaseMessage(messageLike) {
2241
1927
  return typeof messageLike?._getType === "function";
@@ -2252,8 +1938,8 @@ __export$1(tool_exports, {
2252
1938
  isToolMessage: () => isToolMessage,
2253
1939
  isToolMessageChunk: () => isToolMessageChunk
2254
1940
  });
2255
- function isDirectToolOutput(x2) {
2256
- return x2 != null && typeof x2 === "object" && "lc_direct_tool_output" in x2 && x2.lc_direct_tool_output === true;
1941
+ function isDirectToolOutput(x) {
1942
+ return x != null && typeof x === "object" && "lc_direct_tool_output" in x && x.lc_direct_tool_output === true;
2257
1943
  }
2258
1944
  var ToolMessage = class extends BaseMessage {
2259
1945
  static lc_name() {
@@ -2371,11 +2057,11 @@ function defaultToolCallParser(rawToolCalls) {
2371
2057
  }
2372
2058
  return [toolCalls, invalidToolCalls];
2373
2059
  }
2374
- function isToolMessage(x2) {
2375
- return typeof x2 === "object" && x2 !== null && "getType" in x2 && typeof x2.getType === "function" && x2.getType() === "tool";
2060
+ function isToolMessage(x) {
2061
+ return typeof x === "object" && x !== null && "getType" in x && typeof x.getType === "function" && x.getType() === "tool";
2376
2062
  }
2377
- function isToolMessageChunk(x2) {
2378
- return x2._getType() === "tool";
2063
+ function isToolMessageChunk(x) {
2064
+ return x._getType() === "tool";
2379
2065
  }
2380
2066
  function _isToolCall(toolCall) {
2381
2067
  return !!(toolCall && typeof toolCall === "object" && "type" in toolCall && toolCall.type === "tool_call");
@@ -2390,11 +2076,11 @@ var ToolInputParsingException = class extends Error {
2390
2076
  this.output = output;
2391
2077
  }
2392
2078
  };
2393
- function parseJsonMarkdown(s, parser = parsePartialJson) {
2394
- s = s.trim();
2395
- const firstFenceIndex = s.indexOf("```");
2396
- if (firstFenceIndex === -1) return parser(s);
2397
- let contentAfterFence = s.substring(firstFenceIndex + 3);
2079
+ function parseJsonMarkdown(s2, parser = parsePartialJson) {
2080
+ s2 = s2.trim();
2081
+ const firstFenceIndex = s2.indexOf("```");
2082
+ if (firstFenceIndex === -1) return parser(s2);
2083
+ let contentAfterFence = s2.substring(firstFenceIndex + 3);
2398
2084
  if (contentAfterFence.startsWith("json\n")) contentAfterFence = contentAfterFence.substring(5);
2399
2085
  else if (contentAfterFence.startsWith("json")) contentAfterFence = contentAfterFence.substring(4);
2400
2086
  else if (contentAfterFence.startsWith("\n")) contentAfterFence = contentAfterFence.substring(1);
@@ -2403,17 +2089,17 @@ function parseJsonMarkdown(s, parser = parsePartialJson) {
2403
2089
  if (closingFenceIndex !== -1) finalContent = contentAfterFence.substring(0, closingFenceIndex);
2404
2090
  return parser(finalContent.trim());
2405
2091
  }
2406
- function parsePartialJson(s) {
2407
- if (typeof s === "undefined") return null;
2092
+ function parsePartialJson(s2) {
2093
+ if (typeof s2 === "undefined") return null;
2408
2094
  try {
2409
- return JSON.parse(s);
2095
+ return JSON.parse(s2);
2410
2096
  } catch {
2411
2097
  }
2412
2098
  let new_s = "";
2413
2099
  const stack = [];
2414
2100
  let isInsideString = false;
2415
2101
  let escaped = false;
2416
- for (let char of s) {
2102
+ for (let char of s2) {
2417
2103
  if (isInsideString) if (char === '"' && !escaped) isInsideString = false;
2418
2104
  else if (char === "\n" && !escaped) char = "\\n";
2419
2105
  else if (char === "\\") escaped = !escaped;
@@ -2945,11 +2631,11 @@ var AIMessage = class extends BaseMessage {
2945
2631
  return super.isInstance(obj) && obj.type === "ai";
2946
2632
  }
2947
2633
  };
2948
- function isAIMessage(x2) {
2949
- return x2._getType() === "ai";
2634
+ function isAIMessage(x) {
2635
+ return x._getType() === "ai";
2950
2636
  }
2951
- function isAIMessageChunk(x2) {
2952
- return x2._getType() === "ai";
2637
+ function isAIMessageChunk(x) {
2638
+ return x._getType() === "ai";
2953
2639
  }
2954
2640
  var AIMessageChunk = class extends BaseMessageChunk {
2955
2641
  type = "ai";
@@ -3147,11 +2833,11 @@ var ChatMessageChunk = class extends BaseMessageChunk {
3147
2833
  };
3148
2834
  }
3149
2835
  };
3150
- function isChatMessage(x2) {
3151
- return x2._getType() === "generic";
2836
+ function isChatMessage(x) {
2837
+ return x._getType() === "generic";
3152
2838
  }
3153
- function isChatMessageChunk(x2) {
3154
- return x2._getType() === "generic";
2839
+ function isChatMessageChunk(x) {
2840
+ return x._getType() === "generic";
3155
2841
  }
3156
2842
  var FunctionMessage = class extends BaseMessage {
3157
2843
  static lc_name() {
@@ -3180,11 +2866,11 @@ var FunctionMessageChunk = class extends BaseMessageChunk {
3180
2866
  });
3181
2867
  }
3182
2868
  };
3183
- function isFunctionMessage(x2) {
3184
- return x2._getType() === "function";
2869
+ function isFunctionMessage(x) {
2870
+ return x._getType() === "function";
3185
2871
  }
3186
- function isFunctionMessageChunk(x2) {
3187
- return x2._getType() === "function";
2872
+ function isFunctionMessageChunk(x) {
2873
+ return x._getType() === "function";
3188
2874
  }
3189
2875
  var HumanMessage = class extends BaseMessage {
3190
2876
  static lc_name() {
@@ -3219,11 +2905,11 @@ var HumanMessageChunk = class extends BaseMessageChunk {
3219
2905
  return super.isInstance(obj) && obj.type === "human";
3220
2906
  }
3221
2907
  };
3222
- function isHumanMessage(x2) {
3223
- return x2.getType() === "human";
2908
+ function isHumanMessage(x) {
2909
+ return x.getType() === "human";
3224
2910
  }
3225
- function isHumanMessageChunk(x2) {
3226
- return x2.getType() === "human";
2911
+ function isHumanMessageChunk(x) {
2912
+ return x.getType() === "human";
3227
2913
  }
3228
2914
  var SystemMessage = class extends BaseMessage {
3229
2915
  static lc_name() {
@@ -3258,11 +2944,11 @@ var SystemMessageChunk = class extends BaseMessageChunk {
3258
2944
  return super.isInstance(obj) && obj.type === "system";
3259
2945
  }
3260
2946
  };
3261
- function isSystemMessage(x2) {
3262
- return x2._getType() === "system";
2947
+ function isSystemMessage(x) {
2948
+ return x._getType() === "system";
3263
2949
  }
3264
- function isSystemMessageChunk(x2) {
3265
- return x2._getType() === "system";
2950
+ function isSystemMessageChunk(x) {
2951
+ return x._getType() === "system";
3266
2952
  }
3267
2953
  function addLangChainErrorFields(error, lc_error_code) {
3268
2954
  error.lc_error_code = lc_error_code;
@@ -3306,8 +2992,8 @@ function _coerceToolCall(toolCall) {
3306
2992
  };
3307
2993
  else return toolCall;
3308
2994
  }
3309
- function isSerializedConstructor(x2) {
3310
- return typeof x2 === "object" && x2 != null && x2.lc === 1 && Array.isArray(x2.id) && x2.kwargs != null && typeof x2.kwargs === "object";
2995
+ function isSerializedConstructor(x) {
2996
+ return typeof x === "object" && x != null && x.lc === 1 && Array.isArray(x.id) && x.kwargs != null && typeof x.kwargs === "object";
3311
2997
  }
3312
2998
  function _constructMessageFromParams(params) {
3313
2999
  let type;
@@ -3511,8 +3197,8 @@ __export$1(base_exports$5, {
3511
3197
  });
3512
3198
  var BaseCallbackHandlerMethodsClass = class {
3513
3199
  };
3514
- function callbackHandlerPrefersStreaming(x2) {
3515
- return "lc_prefer_streaming" in x2 && x2.lc_prefer_streaming;
3200
+ function callbackHandlerPrefersStreaming(x) {
3201
+ return "lc_prefer_streaming" in x && x.lc_prefer_streaming;
3516
3202
  }
3517
3203
  var BaseCallbackHandler = class extends BaseCallbackHandlerMethodsClass {
3518
3204
  lc_serializable = false;
@@ -3591,8 +3277,8 @@ var BaseCallbackHandler = class extends BaseCallbackHandlerMethodsClass {
3591
3277
  return new Handler();
3592
3278
  }
3593
3279
  };
3594
- const isBaseCallbackHandler = (x2) => {
3595
- const callbackHandler = x2;
3280
+ const isBaseCallbackHandler = (x) => {
3281
+ const callbackHandler = x;
3596
3282
  return callbackHandler !== void 0 && typeof callbackHandler.copy === "function" && typeof callbackHandler.name === "string" && typeof callbackHandler.awaitHandlers === "boolean";
3597
3283
  };
3598
3284
  const GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
@@ -5069,7 +4755,7 @@ class Client {
5069
4755
  const response = await this._getResponse(path, queryParams);
5070
4756
  return response.json();
5071
4757
  }
5072
- async *_getPaginated(path, queryParams = new URLSearchParams(), transform2) {
4758
+ async *_getPaginated(path, queryParams = new URLSearchParams(), transform) {
5073
4759
  let offset = Number(queryParams.get("offset")) || 0;
5074
4760
  const limit = Number(queryParams.get("limit")) || 100;
5075
4761
  while (true) {
@@ -5086,7 +4772,7 @@ class Client {
5086
4772
  await raiseForStatus(res, `fetch ${path}`);
5087
4773
  return res;
5088
4774
  });
5089
- const items = transform2 ? transform2(await response.json()) : await response.json();
4775
+ const items = transform ? transform(await response.json()) : await response.json();
5090
4776
  if (items.length === 0) {
5091
4777
  break;
5092
4778
  }
@@ -8814,22 +8500,22 @@ Object.defineProperty(RunTree, "sharedClient", {
8814
8500
  writable: true,
8815
8501
  value: null
8816
8502
  });
8817
- function isRunTree(x2) {
8818
- return x2 != null && typeof x2.createChild === "function" && typeof x2.postRun === "function";
8503
+ function isRunTree(x) {
8504
+ return x != null && typeof x.createChild === "function" && typeof x.postRun === "function";
8819
8505
  }
8820
- function isLangChainTracerLike(x2) {
8821
- return typeof x2 === "object" && x2 != null && typeof x2.name === "string" && x2.name === "langchain_tracer";
8506
+ function isLangChainTracerLike(x) {
8507
+ return typeof x === "object" && x != null && typeof x.name === "string" && x.name === "langchain_tracer";
8822
8508
  }
8823
- function containsLangChainTracerLike(x2) {
8824
- return Array.isArray(x2) && x2.some((callback) => isLangChainTracerLike(callback));
8509
+ function containsLangChainTracerLike(x) {
8510
+ return Array.isArray(x) && x.some((callback) => isLangChainTracerLike(callback));
8825
8511
  }
8826
- function isCallbackManagerLike(x2) {
8827
- return typeof x2 === "object" && x2 != null && Array.isArray(x2.handlers);
8512
+ function isCallbackManagerLike(x) {
8513
+ return typeof x === "object" && x != null && Array.isArray(x.handlers);
8828
8514
  }
8829
- function isRunnableConfigLike(x2) {
8830
- return x2 != null && typeof x2.callbacks === "object" && // Callback manager with a langchain tracer
8831
- (containsLangChainTracerLike(x2.callbacks?.handlers) || // Or it's an array with a LangChainTracerLike object within it
8832
- containsLangChainTracerLike(x2.callbacks));
8515
+ function isRunnableConfigLike(x) {
8516
+ return x != null && typeof x.callbacks === "object" && // Callback manager with a langchain tracer
8517
+ (containsLangChainTracerLike(x.callbacks?.handlers) || // Or it's an array with a LangChainTracerLike object within it
8518
+ containsLangChainTracerLike(x.callbacks));
8833
8519
  }
8834
8520
  function _parseDottedOrder(dottedOrder) {
8835
8521
  const parts = dottedOrder.split(".");
@@ -8949,8 +8635,8 @@ function convertRunToRunTree(run, parentRun) {
8949
8635
  function _coerceToDict$2(value, defaultKey) {
8950
8636
  return value && !Array.isArray(value) && typeof value === "object" ? value : { [defaultKey]: value };
8951
8637
  }
8952
- function isBaseTracer(x2) {
8953
- return typeof x2._addRunToRunMap === "function";
8638
+ function isBaseTracer(x) {
8639
+ return typeof x._addRunToRunMap === "function";
8954
8640
  }
8955
8641
  var BaseTracer = class extends BaseCallbackHandler {
8956
8642
  /** @deprecated Use `runTreeMap` instead. */
@@ -9578,8 +9264,8 @@ function getCurrentRunTree(permitAbsentRunTree = false) {
9578
9264
  }
9579
9265
  return runTree;
9580
9266
  }
9581
- function isTraceableFunction(x2) {
9582
- return typeof x2 === "function" && "langsmith:traceable" in x2;
9267
+ function isTraceableFunction(x) {
9268
+ return typeof x === "function" && "langsmith:traceable" in x;
9583
9269
  }
9584
9270
  var tracer_langchain_exports = {};
9585
9271
  __export$1(tracer_langchain_exports, { LangChainTracer: () => LangChainTracer });
@@ -10433,7 +10119,7 @@ function isInteropZodLiteral(obj) {
10433
10119
  }
10434
10120
  async function interopSafeParseAsync(schema, input) {
10435
10121
  if (isZodSchemaV4(schema)) try {
10436
- const data = await parseAsync$1(schema, input);
10122
+ const data = await parseAsync(schema, input);
10437
10123
  return {
10438
10124
  success: true,
10439
10125
  data
@@ -10448,13 +10134,13 @@ async function interopSafeParseAsync(schema, input) {
10448
10134
  throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType");
10449
10135
  }
10450
10136
  async function interopParseAsync(schema, input) {
10451
- if (isZodSchemaV4(schema)) return await parseAsync$1(schema, input);
10137
+ if (isZodSchemaV4(schema)) return await parseAsync(schema, input);
10452
10138
  if (isZodSchemaV3(schema)) return await schema.parseAsync(input);
10453
10139
  throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType");
10454
10140
  }
10455
10141
  function interopSafeParse(schema, input) {
10456
10142
  if (isZodSchemaV4(schema)) try {
10457
- const data = parse$2(schema, input);
10143
+ const data = parse$1(schema, input);
10458
10144
  return {
10459
10145
  success: true,
10460
10146
  data
@@ -10469,7 +10155,7 @@ function interopSafeParse(schema, input) {
10469
10155
  throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType");
10470
10156
  }
10471
10157
  function interopParse(schema, input) {
10472
- if (isZodSchemaV4(schema)) return parse$2(schema, input);
10158
+ if (isZodSchemaV4(schema)) return parse$1(schema, input);
10473
10159
  if (isZodSchemaV3(schema)) return schema.parse(input);
10474
10160
  throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType");
10475
10161
  }
@@ -10543,7 +10229,7 @@ function extendInteropZodObject(schema, extension) {
10543
10229
  }
10544
10230
  function interopZodObjectPartial(schema) {
10545
10231
  if (isZodSchemaV3(schema)) return schema.partial();
10546
- if (isZodSchemaV4(schema)) return partial($ZodOptional, schema);
10232
+ if (isZodSchemaV4(schema)) return partial($ZodOptional, schema, void 0);
10547
10233
  throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject");
10548
10234
  }
10549
10235
  function interopZodObjectStrict(schema, recursive = false) {
@@ -10614,7 +10300,7 @@ function getInteropZodDefaultGetter(schema) {
10614
10300
  return void 0;
10615
10301
  }
10616
10302
  if (isZodSchemaV4(schema)) try {
10617
- const defaultValue = parse$2(schema, void 0);
10303
+ const defaultValue = parse$1(schema, void 0);
10618
10304
  return () => defaultValue;
10619
10305
  } catch {
10620
10306
  return void 0;
@@ -10780,25 +10466,25 @@ function parseBigintDef$1(def, refs) {
10780
10466
  format: "int64"
10781
10467
  };
10782
10468
  if (!def.checks) return res;
10783
- for (const check2 of def.checks) switch (check2.kind) {
10469
+ for (const check of def.checks) switch (check.kind) {
10784
10470
  case "min":
10785
- if (refs.target === "jsonSchema7") if (check2.inclusive) setResponseValueAndErrors$1(res, "minimum", check2.value, check2.message, refs);
10786
- else setResponseValueAndErrors$1(res, "exclusiveMinimum", check2.value, check2.message, refs);
10471
+ if (refs.target === "jsonSchema7") if (check.inclusive) setResponseValueAndErrors$1(res, "minimum", check.value, check.message, refs);
10472
+ else setResponseValueAndErrors$1(res, "exclusiveMinimum", check.value, check.message, refs);
10787
10473
  else {
10788
- if (!check2.inclusive) res.exclusiveMinimum = true;
10789
- setResponseValueAndErrors$1(res, "minimum", check2.value, check2.message, refs);
10474
+ if (!check.inclusive) res.exclusiveMinimum = true;
10475
+ setResponseValueAndErrors$1(res, "minimum", check.value, check.message, refs);
10790
10476
  }
10791
10477
  break;
10792
10478
  case "max":
10793
- if (refs.target === "jsonSchema7") if (check2.inclusive) setResponseValueAndErrors$1(res, "maximum", check2.value, check2.message, refs);
10794
- else setResponseValueAndErrors$1(res, "exclusiveMaximum", check2.value, check2.message, refs);
10479
+ if (refs.target === "jsonSchema7") if (check.inclusive) setResponseValueAndErrors$1(res, "maximum", check.value, check.message, refs);
10480
+ else setResponseValueAndErrors$1(res, "exclusiveMaximum", check.value, check.message, refs);
10795
10481
  else {
10796
- if (!check2.inclusive) res.exclusiveMaximum = true;
10797
- setResponseValueAndErrors$1(res, "maximum", check2.value, check2.message, refs);
10482
+ if (!check.inclusive) res.exclusiveMaximum = true;
10483
+ setResponseValueAndErrors$1(res, "maximum", check.value, check.message, refs);
10798
10484
  }
10799
10485
  break;
10800
10486
  case "multipleOf":
10801
- setResponseValueAndErrors$1(res, "multipleOf", check2.value, check2.message, refs);
10487
+ setResponseValueAndErrors$1(res, "multipleOf", check.value, check.message, refs);
10802
10488
  break;
10803
10489
  }
10804
10490
  return res;
@@ -10837,12 +10523,12 @@ const integerDateParser$1 = (def, refs) => {
10837
10523
  format: "unix-time"
10838
10524
  };
10839
10525
  if (refs.target === "openApi3") return res;
10840
- for (const check2 of def.checks) switch (check2.kind) {
10526
+ for (const check of def.checks) switch (check.kind) {
10841
10527
  case "min":
10842
- setResponseValueAndErrors$1(res, "minimum", check2.value, check2.message, refs);
10528
+ setResponseValueAndErrors$1(res, "minimum", check.value, check.message, refs);
10843
10529
  break;
10844
10530
  case "max":
10845
- setResponseValueAndErrors$1(res, "maximum", check2.value, check2.message, refs);
10531
+ setResponseValueAndErrors$1(res, "maximum", check.value, check.message, refs);
10846
10532
  break;
10847
10533
  }
10848
10534
  return res;
@@ -10881,7 +10567,7 @@ function parseIntersectionDef$1(def, refs) {
10881
10567
  "allOf",
10882
10568
  "1"
10883
10569
  ]
10884
- })].filter((x2) => !!x2);
10570
+ })].filter((x) => !!x);
10885
10571
  let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
10886
10572
  const mergedAllOf = [];
10887
10573
  allOf.forEach((schema) => {
@@ -10936,101 +10622,101 @@ const zodPatterns$1 = {
10936
10622
  };
10937
10623
  function parseStringDef$1(def, refs) {
10938
10624
  const res = { type: "string" };
10939
- if (def.checks) for (const check2 of def.checks) switch (check2.kind) {
10625
+ if (def.checks) for (const check of def.checks) switch (check.kind) {
10940
10626
  case "min":
10941
- setResponseValueAndErrors$1(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check2.value) : check2.value, check2.message, refs);
10627
+ setResponseValueAndErrors$1(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
10942
10628
  break;
10943
10629
  case "max":
10944
- setResponseValueAndErrors$1(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check2.value) : check2.value, check2.message, refs);
10630
+ setResponseValueAndErrors$1(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
10945
10631
  break;
10946
10632
  case "email":
10947
10633
  switch (refs.emailStrategy) {
10948
10634
  case "format:email":
10949
- addFormat$1(res, "email", check2.message, refs);
10635
+ addFormat$1(res, "email", check.message, refs);
10950
10636
  break;
10951
10637
  case "format:idn-email":
10952
- addFormat$1(res, "idn-email", check2.message, refs);
10638
+ addFormat$1(res, "idn-email", check.message, refs);
10953
10639
  break;
10954
10640
  case "pattern:zod":
10955
- addPattern$1(res, zodPatterns$1.email, check2.message, refs);
10641
+ addPattern$1(res, zodPatterns$1.email, check.message, refs);
10956
10642
  break;
10957
10643
  }
10958
10644
  break;
10959
10645
  case "url":
10960
- addFormat$1(res, "uri", check2.message, refs);
10646
+ addFormat$1(res, "uri", check.message, refs);
10961
10647
  break;
10962
10648
  case "uuid":
10963
- addFormat$1(res, "uuid", check2.message, refs);
10649
+ addFormat$1(res, "uuid", check.message, refs);
10964
10650
  break;
10965
10651
  case "regex":
10966
- addPattern$1(res, check2.regex, check2.message, refs);
10652
+ addPattern$1(res, check.regex, check.message, refs);
10967
10653
  break;
10968
10654
  case "cuid":
10969
- addPattern$1(res, zodPatterns$1.cuid, check2.message, refs);
10655
+ addPattern$1(res, zodPatterns$1.cuid, check.message, refs);
10970
10656
  break;
10971
10657
  case "cuid2":
10972
- addPattern$1(res, zodPatterns$1.cuid2, check2.message, refs);
10658
+ addPattern$1(res, zodPatterns$1.cuid2, check.message, refs);
10973
10659
  break;
10974
10660
  case "startsWith":
10975
- addPattern$1(res, RegExp(`^${escapeLiteralCheckValue$1(check2.value, refs)}`), check2.message, refs);
10661
+ addPattern$1(res, RegExp(`^${escapeLiteralCheckValue$1(check.value, refs)}`), check.message, refs);
10976
10662
  break;
10977
10663
  case "endsWith":
10978
- addPattern$1(res, RegExp(`${escapeLiteralCheckValue$1(check2.value, refs)}$`), check2.message, refs);
10664
+ addPattern$1(res, RegExp(`${escapeLiteralCheckValue$1(check.value, refs)}$`), check.message, refs);
10979
10665
  break;
10980
10666
  case "datetime":
10981
- addFormat$1(res, "date-time", check2.message, refs);
10667
+ addFormat$1(res, "date-time", check.message, refs);
10982
10668
  break;
10983
10669
  case "date":
10984
- addFormat$1(res, "date", check2.message, refs);
10670
+ addFormat$1(res, "date", check.message, refs);
10985
10671
  break;
10986
10672
  case "time":
10987
- addFormat$1(res, "time", check2.message, refs);
10673
+ addFormat$1(res, "time", check.message, refs);
10988
10674
  break;
10989
10675
  case "duration":
10990
- addFormat$1(res, "duration", check2.message, refs);
10676
+ addFormat$1(res, "duration", check.message, refs);
10991
10677
  break;
10992
10678
  case "length":
10993
- setResponseValueAndErrors$1(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check2.value) : check2.value, check2.message, refs);
10994
- setResponseValueAndErrors$1(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check2.value) : check2.value, check2.message, refs);
10679
+ setResponseValueAndErrors$1(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
10680
+ setResponseValueAndErrors$1(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
10995
10681
  break;
10996
10682
  case "includes":
10997
- addPattern$1(res, RegExp(escapeLiteralCheckValue$1(check2.value, refs)), check2.message, refs);
10683
+ addPattern$1(res, RegExp(escapeLiteralCheckValue$1(check.value, refs)), check.message, refs);
10998
10684
  break;
10999
10685
  case "ip":
11000
- if (check2.version !== "v6") addFormat$1(res, "ipv4", check2.message, refs);
11001
- if (check2.version !== "v4") addFormat$1(res, "ipv6", check2.message, refs);
10686
+ if (check.version !== "v6") addFormat$1(res, "ipv4", check.message, refs);
10687
+ if (check.version !== "v4") addFormat$1(res, "ipv6", check.message, refs);
11002
10688
  break;
11003
10689
  case "base64url":
11004
- addPattern$1(res, zodPatterns$1.base64url, check2.message, refs);
10690
+ addPattern$1(res, zodPatterns$1.base64url, check.message, refs);
11005
10691
  break;
11006
10692
  case "jwt":
11007
- addPattern$1(res, zodPatterns$1.jwt, check2.message, refs);
10693
+ addPattern$1(res, zodPatterns$1.jwt, check.message, refs);
11008
10694
  break;
11009
10695
  case "cidr":
11010
- if (check2.version !== "v6") addPattern$1(res, zodPatterns$1.ipv4Cidr, check2.message, refs);
11011
- if (check2.version !== "v4") addPattern$1(res, zodPatterns$1.ipv6Cidr, check2.message, refs);
10696
+ if (check.version !== "v6") addPattern$1(res, zodPatterns$1.ipv4Cidr, check.message, refs);
10697
+ if (check.version !== "v4") addPattern$1(res, zodPatterns$1.ipv6Cidr, check.message, refs);
11012
10698
  break;
11013
10699
  case "emoji":
11014
- addPattern$1(res, zodPatterns$1.emoji(), check2.message, refs);
10700
+ addPattern$1(res, zodPatterns$1.emoji(), check.message, refs);
11015
10701
  break;
11016
10702
  case "ulid":
11017
- addPattern$1(res, zodPatterns$1.ulid, check2.message, refs);
10703
+ addPattern$1(res, zodPatterns$1.ulid, check.message, refs);
11018
10704
  break;
11019
10705
  case "base64":
11020
10706
  switch (refs.base64Strategy) {
11021
10707
  case "format:binary":
11022
- addFormat$1(res, "binary", check2.message, refs);
10708
+ addFormat$1(res, "binary", check.message, refs);
11023
10709
  break;
11024
10710
  case "contentEncoding:base64":
11025
- setResponseValueAndErrors$1(res, "contentEncoding", "base64", check2.message, refs);
10711
+ setResponseValueAndErrors$1(res, "contentEncoding", "base64", check.message, refs);
11026
10712
  break;
11027
10713
  case "pattern:zod":
11028
- addPattern$1(res, zodPatterns$1.base64, check2.message, refs);
10714
+ addPattern$1(res, zodPatterns$1.base64, check.message, refs);
11029
10715
  break;
11030
10716
  }
11031
10717
  break;
11032
10718
  case "nanoid":
11033
- addPattern$1(res, zodPatterns$1.nanoid, check2.message, refs);
10719
+ addPattern$1(res, zodPatterns$1.nanoid, check.message, refs);
11034
10720
  break;
11035
10721
  }
11036
10722
  return res;
@@ -11048,7 +10734,7 @@ function escapeNonAlphaNumeric$1(source) {
11048
10734
  return result;
11049
10735
  }
11050
10736
  function addFormat$1(schema, value, message, refs) {
11051
- if (schema.format || schema.anyOf?.some((x2) => x2.format)) {
10737
+ if (schema.format || schema.anyOf?.some((x) => x.format)) {
11052
10738
  if (!schema.anyOf) schema.anyOf = [];
11053
10739
  if (schema.format) {
11054
10740
  schema.anyOf.push({
@@ -11068,7 +10754,7 @@ function addFormat$1(schema, value, message, refs) {
11068
10754
  } else setResponseValueAndErrors$1(schema, "format", value, message, refs);
11069
10755
  }
11070
10756
  function addPattern$1(schema, regex, message, refs) {
11071
- if (schema.pattern || schema.allOf?.some((x2) => x2.pattern)) {
10757
+ if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
11072
10758
  if (!schema.allOf) schema.allOf = [];
11073
10759
  if (schema.pattern) {
11074
10760
  schema.allOf.push({
@@ -11263,15 +10949,15 @@ const primitiveMappings$1 = {
11263
10949
  function parseUnionDef$1(def, refs) {
11264
10950
  if (refs.target === "openApi3") return asAnyOf$1(def, refs);
11265
10951
  const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
11266
- if (options.every((x2) => x2._def.typeName in primitiveMappings$1 && (!x2._def.checks || !x2._def.checks.length))) {
11267
- const types = options.reduce((types$1, x2) => {
11268
- const type = primitiveMappings$1[x2._def.typeName];
10952
+ if (options.every((x) => x._def.typeName in primitiveMappings$1 && (!x._def.checks || !x._def.checks.length))) {
10953
+ const types = options.reduce((types$1, x) => {
10954
+ const type = primitiveMappings$1[x._def.typeName];
11269
10955
  return type && !types$1.includes(type) ? [...types$1, type] : types$1;
11270
10956
  }, []);
11271
10957
  return { type: types.length > 1 ? types : types[0] };
11272
- } else if (options.every((x2) => x2._def.typeName === "ZodLiteral" && !x2.description)) {
11273
- const types = options.reduce((acc, x2) => {
11274
- const type = typeof x2._def.value;
10958
+ } else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
10959
+ const types = options.reduce((acc, x) => {
10960
+ const type = typeof x._def.value;
11275
10961
  switch (type) {
11276
10962
  case "string":
11277
10963
  case "number":
@@ -11280,7 +10966,7 @@ function parseUnionDef$1(def, refs) {
11280
10966
  case "bigint":
11281
10967
  return [...acc, "integer"];
11282
10968
  case "object":
11283
- if (x2._def.value === null) return [...acc, "null"];
10969
+ if (x._def.value === null) return [...acc, "null"];
11284
10970
  return acc;
11285
10971
  case "symbol":
11286
10972
  case "undefined":
@@ -11290,29 +10976,29 @@ function parseUnionDef$1(def, refs) {
11290
10976
  }
11291
10977
  }, []);
11292
10978
  if (types.length === options.length) {
11293
- const uniqueTypes = types.filter((x2, i, a) => a.indexOf(x2) === i);
10979
+ const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
11294
10980
  return {
11295
10981
  type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
11296
- enum: options.reduce((acc, x2) => {
11297
- return acc.includes(x2._def.value) ? acc : [...acc, x2._def.value];
10982
+ enum: options.reduce((acc, x) => {
10983
+ return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
11298
10984
  }, [])
11299
10985
  };
11300
10986
  }
11301
- } else if (options.every((x2) => x2._def.typeName === "ZodEnum")) return {
10987
+ } else if (options.every((x) => x._def.typeName === "ZodEnum")) return {
11302
10988
  type: "string",
11303
- enum: options.reduce((acc, x2) => [...acc, ...x2._def.values.filter((x$1) => !acc.includes(x$1))], [])
10989
+ enum: options.reduce((acc, x) => [...acc, ...x._def.values.filter((x$1) => !acc.includes(x$1))], [])
11304
10990
  };
11305
10991
  return asAnyOf$1(def, refs);
11306
10992
  }
11307
10993
  const asAnyOf$1 = (def, refs) => {
11308
- const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x2, i) => parseDef$1(x2._def, {
10994
+ const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef$1(x._def, {
11309
10995
  ...refs,
11310
10996
  currentPath: [
11311
10997
  ...refs.currentPath,
11312
10998
  "anyOf",
11313
10999
  `${i}`
11314
11000
  ]
11315
- })).filter((x2) => !!x2 && (!refs.strictUnions || typeof x2 === "object" && Object.keys(x2).length > 0));
11001
+ })).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
11316
11002
  return anyOf.length ? { anyOf } : void 0;
11317
11003
  };
11318
11004
  function parseNullableDef$1(def, refs) {
@@ -11356,29 +11042,29 @@ function parseNullableDef$1(def, refs) {
11356
11042
  function parseNumberDef$1(def, refs) {
11357
11043
  const res = { type: "number" };
11358
11044
  if (!def.checks) return res;
11359
- for (const check2 of def.checks) switch (check2.kind) {
11045
+ for (const check of def.checks) switch (check.kind) {
11360
11046
  case "int":
11361
11047
  res.type = "integer";
11362
- addErrorMessage$1(res, "type", check2.message, refs);
11048
+ addErrorMessage$1(res, "type", check.message, refs);
11363
11049
  break;
11364
11050
  case "min":
11365
- if (refs.target === "jsonSchema7") if (check2.inclusive) setResponseValueAndErrors$1(res, "minimum", check2.value, check2.message, refs);
11366
- else setResponseValueAndErrors$1(res, "exclusiveMinimum", check2.value, check2.message, refs);
11051
+ if (refs.target === "jsonSchema7") if (check.inclusive) setResponseValueAndErrors$1(res, "minimum", check.value, check.message, refs);
11052
+ else setResponseValueAndErrors$1(res, "exclusiveMinimum", check.value, check.message, refs);
11367
11053
  else {
11368
- if (!check2.inclusive) res.exclusiveMinimum = true;
11369
- setResponseValueAndErrors$1(res, "minimum", check2.value, check2.message, refs);
11054
+ if (!check.inclusive) res.exclusiveMinimum = true;
11055
+ setResponseValueAndErrors$1(res, "minimum", check.value, check.message, refs);
11370
11056
  }
11371
11057
  break;
11372
11058
  case "max":
11373
- if (refs.target === "jsonSchema7") if (check2.inclusive) setResponseValueAndErrors$1(res, "maximum", check2.value, check2.message, refs);
11374
- else setResponseValueAndErrors$1(res, "exclusiveMaximum", check2.value, check2.message, refs);
11059
+ if (refs.target === "jsonSchema7") if (check.inclusive) setResponseValueAndErrors$1(res, "maximum", check.value, check.message, refs);
11060
+ else setResponseValueAndErrors$1(res, "exclusiveMaximum", check.value, check.message, refs);
11375
11061
  else {
11376
- if (!check2.inclusive) res.exclusiveMaximum = true;
11377
- setResponseValueAndErrors$1(res, "maximum", check2.value, check2.message, refs);
11062
+ if (!check.inclusive) res.exclusiveMaximum = true;
11063
+ setResponseValueAndErrors$1(res, "maximum", check.value, check.message, refs);
11378
11064
  }
11379
11065
  break;
11380
11066
  case "multipleOf":
11381
- setResponseValueAndErrors$1(res, "multipleOf", check2.value, check2.message, refs);
11067
+ setResponseValueAndErrors$1(res, "multipleOf", check.value, check.message, refs);
11382
11068
  break;
11383
11069
  }
11384
11070
  return res;
@@ -11474,7 +11160,7 @@ const parsePipelineDef$1 = (def, refs) => {
11474
11160
  a ? "1" : "0"
11475
11161
  ]
11476
11162
  });
11477
- return { allOf: [a, b].filter((x2) => x2 !== void 0) };
11163
+ return { allOf: [a, b].filter((x) => x !== void 0) };
11478
11164
  };
11479
11165
  function parsePromiseDef$1(def, refs) {
11480
11166
  return parseDef$1(def.type._def, refs);
@@ -11497,14 +11183,14 @@ function parseTupleDef$1(def, refs) {
11497
11183
  if (def.rest) return {
11498
11184
  type: "array",
11499
11185
  minItems: def.items.length,
11500
- items: def.items.map((x2, i) => parseDef$1(x2._def, {
11186
+ items: def.items.map((x, i) => parseDef$1(x._def, {
11501
11187
  ...refs,
11502
11188
  currentPath: [
11503
11189
  ...refs.currentPath,
11504
11190
  "items",
11505
11191
  `${i}`
11506
11192
  ]
11507
- })).reduce((acc, x2) => x2 === void 0 ? acc : [...acc, x2], []),
11193
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
11508
11194
  additionalItems: parseDef$1(def.rest._def, {
11509
11195
  ...refs,
11510
11196
  currentPath: [...refs.currentPath, "additionalItems"]
@@ -11514,14 +11200,14 @@ function parseTupleDef$1(def, refs) {
11514
11200
  type: "array",
11515
11201
  minItems: def.items.length,
11516
11202
  maxItems: def.items.length,
11517
- items: def.items.map((x2, i) => parseDef$1(x2._def, {
11203
+ items: def.items.map((x, i) => parseDef$1(x._def, {
11518
11204
  ...refs,
11519
11205
  currentPath: [
11520
11206
  ...refs.currentPath,
11521
11207
  "items",
11522
11208
  `${i}`
11523
11209
  ]
11524
- })).reduce((acc, x2) => x2 === void 0 ? acc : [...acc, x2], [])
11210
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
11525
11211
  };
11526
11212
  }
11527
11213
  function parseUndefinedDef$1(refs) {
@@ -11730,7 +11416,7 @@ function validatesOnlyStrings(schema) {
11730
11416
  if (!schema || typeof schema !== "object" || Object.keys(schema).length === 0 || Array.isArray(schema)) return false;
11731
11417
  if ("type" in schema) {
11732
11418
  if (typeof schema.type === "string") return schema.type === "string";
11733
- if (Array.isArray(schema.type)) return schema.type.every((t) => t === "string");
11419
+ if (Array.isArray(schema.type)) return schema.type.every((t2) => t2 === "string");
11734
11420
  return false;
11735
11421
  }
11736
11422
  if ("enum" in schema) return Array.isArray(schema.enum) && schema.enum.length > 0 && schema.enum.every((val) => typeof val === "string");
@@ -12217,7 +11903,7 @@ function applyOperation(document, operation, validateOperation = false, mutateDo
12217
11903
  const path = operation.path || "";
12218
11904
  const keys2 = path.split("/");
12219
11905
  let obj = document;
12220
- let t = 1;
11906
+ let t2 = 1;
12221
11907
  let len = keys2.length;
12222
11908
  let existingPathFragment = void 0;
12223
11909
  let key;
@@ -12225,34 +11911,34 @@ function applyOperation(document, operation, validateOperation = false, mutateDo
12225
11911
  if (typeof validateOperation == "function") validateFunction = validateOperation;
12226
11912
  else validateFunction = validator;
12227
11913
  while (true) {
12228
- key = keys2[t];
11914
+ key = keys2[t2];
12229
11915
  if (key && key.indexOf("~") != -1) key = unescapePathComponent(key);
12230
- if (banPrototypeModifications && (key == "__proto__" || key == "prototype" && t > 0 && keys2[t - 1] == "constructor")) throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");
11916
+ if (banPrototypeModifications && (key == "__proto__" || key == "prototype" && t2 > 0 && keys2[t2 - 1] == "constructor")) throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");
12231
11917
  if (validateOperation) {
12232
11918
  if (existingPathFragment === void 0) {
12233
- if (obj[key] === void 0) existingPathFragment = keys2.slice(0, t).join("/");
12234
- else if (t == len - 1) existingPathFragment = operation.path;
11919
+ if (obj[key] === void 0) existingPathFragment = keys2.slice(0, t2).join("/");
11920
+ else if (t2 == len - 1) existingPathFragment = operation.path;
12235
11921
  if (existingPathFragment !== void 0) validateFunction(operation, 0, document, existingPathFragment);
12236
11922
  }
12237
11923
  }
12238
- t++;
11924
+ t2++;
12239
11925
  if (Array.isArray(obj)) {
12240
11926
  if (key === "-") key = obj.length;
12241
11927
  else if (validateOperation && !isInteger(key)) throw new JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", index2, operation, document);
12242
11928
  else if (isInteger(key)) key = ~~key;
12243
- if (t >= len) {
11929
+ if (t2 >= len) {
12244
11930
  if (validateOperation && operation.op === "add" && key > obj.length) throw new JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", index2, operation, document);
12245
11931
  const returnValue = arrOps[operation.op].call(operation, obj, key, document);
12246
11932
  if (returnValue.test === false) throw new JsonPatchError("Test operation failed", "TEST_OPERATION_FAILED", index2, operation, document);
12247
11933
  return returnValue;
12248
11934
  }
12249
- } else if (t >= len) {
11935
+ } else if (t2 >= len) {
12250
11936
  const returnValue = objOps[operation.op].call(operation, obj, key, document);
12251
11937
  if (returnValue.test === false) throw new JsonPatchError("Test operation failed", "TEST_OPERATION_FAILED", index2, operation, document);
12252
11938
  return returnValue;
12253
11939
  }
12254
11940
  obj = obj[key];
12255
- if (validateOperation && t < len && (!obj || typeof obj !== "object")) throw new JsonPatchError("Cannot perform operation at the desired path", "OPERATION_PATH_UNRESOLVABLE", index2, operation, document);
11941
+ if (validateOperation && t2 < len && (!obj || typeof obj !== "object")) throw new JsonPatchError("Cannot perform operation at the desired path", "OPERATION_PATH_UNRESOLVABLE", index2, operation, document);
12256
11942
  }
12257
11943
  }
12258
11944
  }
@@ -12342,8 +12028,8 @@ function _generate(mirror, obj, patches, path, invertible) {
12342
12028
  var newKeys = _objectKeys(obj);
12343
12029
  var oldKeys = _objectKeys(mirror);
12344
12030
  var deleted = false;
12345
- for (var t = oldKeys.length - 1; t >= 0; t--) {
12346
- var key = oldKeys[t];
12031
+ for (var t2 = oldKeys.length - 1; t2 >= 0; t2--) {
12032
+ var key = oldKeys[t2];
12347
12033
  var oldVal = mirror[key];
12348
12034
  if (hasOwnProperty$9(obj, key) && !(obj[key] === void 0 && oldVal !== void 0 && Array.isArray(obj) === false)) {
12349
12035
  var newVal = obj[key];
@@ -12385,8 +12071,8 @@ function _generate(mirror, obj, patches, path, invertible) {
12385
12071
  }
12386
12072
  }
12387
12073
  if (!deleted && newKeys.length == oldKeys.length) return;
12388
- for (var t = 0; t < newKeys.length; t++) {
12389
- var key = newKeys[t];
12074
+ for (var t2 = 0; t2 < newKeys.length; t2++) {
12075
+ var key = newKeys[t2];
12390
12076
  if (!hasOwnProperty$9(mirror, key) && obj[key] !== void 0) patches.push({
12391
12077
  op: "add",
12392
12078
  path: path + "/" + escapePathComponent(key),
@@ -12468,8 +12154,8 @@ async function _getStandardizedOutputs(run, schemaFormat) {
12468
12154
  if (outputs !== void 0 && Object.keys(outputs).length === 1 && outputs?.output !== void 0) return outputs.output;
12469
12155
  return outputs;
12470
12156
  }
12471
- function isChatGenerationChunk$1(x2) {
12472
- return x2 !== void 0 && x2.message !== void 0;
12157
+ function isChatGenerationChunk$1(x) {
12158
+ return x !== void 0 && x.message !== void 0;
12473
12159
  }
12474
12160
  var LogStreamCallbackHandler = class extends BaseTracer {
12475
12161
  autoClose = true;
@@ -13384,7 +13070,7 @@ data: ${JSON.stringify(chunk)}
13384
13070
  function isIterableIterator(thing) {
13385
13071
  return typeof thing === "object" && thing !== null && typeof thing[Symbol.iterator] === "function" && typeof thing.next === "function";
13386
13072
  }
13387
- const isIterator = (x2) => x2 != null && typeof x2 === "object" && "next" in x2 && typeof x2.next === "function";
13073
+ const isIterator = (x) => x != null && typeof x === "object" && "next" in x && typeof x.next === "function";
13388
13074
  function isAsyncIterable(thing) {
13389
13075
  return typeof thing === "object" && thing !== null && typeof thing[Symbol.asyncIterator] === "function";
13390
13076
  }
@@ -13610,11 +13296,11 @@ var Runnable = class extends Serializable {
13610
13296
  }
13611
13297
  let runManager;
13612
13298
  try {
13613
- const pipe2 = await pipeGeneratorWithSetup(transformer.bind(this), wrapInputForTracing(), async () => callbackManager_?.handleChainStart(this.toJSON(), { input: "" }, config.runId, config.runType, void 0, void 0, config.runName ?? this.getName()), options?.signal, config);
13299
+ const pipe = await pipeGeneratorWithSetup(transformer.bind(this), wrapInputForTracing(), async () => callbackManager_?.handleChainStart(this.toJSON(), { input: "" }, config.runId, config.runType, void 0, void 0, config.runName ?? this.getName()), options?.signal, config);
13614
13300
  delete config.runId;
13615
- runManager = pipe2.setup;
13301
+ runManager = pipe.setup;
13616
13302
  const streamEventsHandler = runManager?.handlers.find(isStreamEventsHandler);
13617
- let iterator = pipe2.output;
13303
+ let iterator = pipe.output;
13618
13304
  if (streamEventsHandler !== void 0 && runManager !== void 0) iterator = streamEventsHandler.tapOutputIterable(runManager.runId, iterator);
13619
13305
  const streamLogHandler = runManager?.handlers.find(isLogStreamHandler);
13620
13306
  if (streamLogHandler !== void 0 && runManager !== void 0) iterator = streamLogHandler.tapOutputIterable(runManager.runId, iterator);
@@ -16062,9 +15748,9 @@ function arrayLikeKeys(value, inherited) {
16062
15748
  }
16063
15749
  return result;
16064
15750
  }
16065
- function overArg(func, transform2) {
15751
+ function overArg(func, transform) {
16066
15752
  return function(arg) {
16067
- return func(transform2(arg));
15753
+ return func(transform(arg));
16068
15754
  };
16069
15755
  }
16070
15756
  var nativeKeys = overArg(Object.keys, Object);
@@ -16136,10 +15822,10 @@ function listCacheClear() {
16136
15822
  this.__data__ = [];
16137
15823
  this.size = 0;
16138
15824
  }
16139
- function assocIndexOf(array2, key) {
16140
- var length = array2.length;
15825
+ function assocIndexOf(array, key) {
15826
+ var length = array.length;
16141
15827
  while (length--) {
16142
- if (eq(array2[length][0], key)) {
15828
+ if (eq(array[length][0], key)) {
16143
15829
  return length;
16144
15830
  }
16145
15831
  }
@@ -16238,12 +15924,12 @@ MapCache.prototype["delete"] = mapCacheDelete;
16238
15924
  MapCache.prototype.get = mapCacheGet;
16239
15925
  MapCache.prototype.has = mapCacheHas;
16240
15926
  MapCache.prototype.set = mapCacheSet;
16241
- function arrayPush(array2, values) {
16242
- var index2 = -1, length = values.length, offset = array2.length;
15927
+ function arrayPush(array, values) {
15928
+ var index2 = -1, length = values.length, offset = array.length;
16243
15929
  while (++index2 < length) {
16244
- array2[offset + index2] = values[index2];
15930
+ array[offset + index2] = values[index2];
16245
15931
  }
16246
- return array2;
15932
+ return array;
16247
15933
  }
16248
15934
  function stackClear() {
16249
15935
  this.__data__ = new ListCache();
@@ -16285,11 +15971,11 @@ Stack.prototype["delete"] = stackDelete;
16285
15971
  Stack.prototype.get = stackGet;
16286
15972
  Stack.prototype.has = stackHas;
16287
15973
  Stack.prototype.set = stackSet;
16288
- function arrayFilter(array2, predicate) {
16289
- var index2 = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
15974
+ function arrayFilter(array, predicate) {
15975
+ var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
16290
15976
  while (++index2 < length) {
16291
- var value = array2[index2];
16292
- if (predicate(value, index2, array2)) {
15977
+ var value = array[index2];
15978
+ if (predicate(value, index2, array)) {
16293
15979
  result[resIndex++] = value;
16294
15980
  }
16295
15981
  }
@@ -16362,10 +16048,10 @@ function SetCache(values) {
16362
16048
  }
16363
16049
  SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
16364
16050
  SetCache.prototype.has = setCacheHas;
16365
- function arraySome(array2, predicate) {
16366
- var index2 = -1, length = array2 == null ? 0 : array2.length;
16051
+ function arraySome(array, predicate) {
16052
+ var index2 = -1, length = array == null ? 0 : array.length;
16367
16053
  while (++index2 < length) {
16368
- if (predicate(array2[index2], index2, array2)) {
16054
+ if (predicate(array[index2], index2, array)) {
16369
16055
  return true;
16370
16056
  }
16371
16057
  }
@@ -16375,23 +16061,23 @@ function cacheHas(cache2, key) {
16375
16061
  return cache2.has(key);
16376
16062
  }
16377
16063
  var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
16378
- function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
16379
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array2.length, othLength = other.length;
16064
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
16065
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
16380
16066
  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
16381
16067
  return false;
16382
16068
  }
16383
- var arrStacked = stack.get(array2);
16069
+ var arrStacked = stack.get(array);
16384
16070
  var othStacked = stack.get(other);
16385
16071
  if (arrStacked && othStacked) {
16386
- return arrStacked == other && othStacked == array2;
16072
+ return arrStacked == other && othStacked == array;
16387
16073
  }
16388
16074
  var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
16389
- stack.set(array2, other);
16390
- stack.set(other, array2);
16075
+ stack.set(array, other);
16076
+ stack.set(other, array);
16391
16077
  while (++index2 < arrLength) {
16392
- var arrValue = array2[index2], othValue = other[index2];
16078
+ var arrValue = array[index2], othValue = other[index2];
16393
16079
  if (customizer) {
16394
- var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack);
16080
+ var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
16395
16081
  }
16396
16082
  if (compared !== void 0) {
16397
16083
  if (compared) {
@@ -16414,7 +16100,7 @@ function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
16414
16100
  break;
16415
16101
  }
16416
16102
  }
16417
- stack["delete"](array2);
16103
+ stack["delete"](array);
16418
16104
  stack["delete"](other);
16419
16105
  return result;
16420
16106
  }
@@ -16694,38 +16380,38 @@ function parseBigintDef(def, refs) {
16694
16380
  };
16695
16381
  if (!def.checks)
16696
16382
  return res;
16697
- for (const check2 of def.checks) {
16698
- switch (check2.kind) {
16383
+ for (const check of def.checks) {
16384
+ switch (check.kind) {
16699
16385
  case "min":
16700
16386
  if (refs.target === "jsonSchema7") {
16701
- if (check2.inclusive) {
16702
- setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
16387
+ if (check.inclusive) {
16388
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
16703
16389
  } else {
16704
- setResponseValueAndErrors(res, "exclusiveMinimum", check2.value, check2.message, refs);
16390
+ setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
16705
16391
  }
16706
16392
  } else {
16707
- if (!check2.inclusive) {
16393
+ if (!check.inclusive) {
16708
16394
  res.exclusiveMinimum = true;
16709
16395
  }
16710
- setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
16396
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
16711
16397
  }
16712
16398
  break;
16713
16399
  case "max":
16714
16400
  if (refs.target === "jsonSchema7") {
16715
- if (check2.inclusive) {
16716
- setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
16401
+ if (check.inclusive) {
16402
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
16717
16403
  } else {
16718
- setResponseValueAndErrors(res, "exclusiveMaximum", check2.value, check2.message, refs);
16404
+ setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
16719
16405
  }
16720
16406
  } else {
16721
- if (!check2.inclusive) {
16407
+ if (!check.inclusive) {
16722
16408
  res.exclusiveMaximum = true;
16723
16409
  }
16724
- setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
16410
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
16725
16411
  }
16726
16412
  break;
16727
16413
  case "multipleOf":
16728
- setResponseValueAndErrors(res, "multipleOf", check2.value, check2.message, refs);
16414
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
16729
16415
  break;
16730
16416
  }
16731
16417
  }
@@ -16773,15 +16459,15 @@ const integerDateParser = (def, refs) => {
16773
16459
  if (refs.target === "openApi3") {
16774
16460
  return res;
16775
16461
  }
16776
- for (const check2 of def.checks) {
16777
- switch (check2.kind) {
16462
+ for (const check of def.checks) {
16463
+ switch (check.kind) {
16778
16464
  case "min":
16779
16465
  setResponseValueAndErrors(
16780
16466
  res,
16781
16467
  "minimum",
16782
- check2.value,
16468
+ check.value,
16783
16469
  // This is in milliseconds
16784
- check2.message,
16470
+ check.message,
16785
16471
  refs
16786
16472
  );
16787
16473
  break;
@@ -16789,9 +16475,9 @@ const integerDateParser = (def, refs) => {
16789
16475
  setResponseValueAndErrors(
16790
16476
  res,
16791
16477
  "maximum",
16792
- check2.value,
16478
+ check.value,
16793
16479
  // This is in milliseconds
16794
- check2.message,
16480
+ check.message,
16795
16481
  refs
16796
16482
  );
16797
16483
  break;
@@ -16829,7 +16515,7 @@ function parseIntersectionDef(def, refs) {
16829
16515
  ...refs,
16830
16516
  currentPath: [...refs.currentPath, "allOf", "1"]
16831
16517
  })
16832
- ].filter((x2) => !!x2);
16518
+ ].filter((x) => !!x);
16833
16519
  let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
16834
16520
  const mergedAllOf = [];
16835
16521
  allOf.forEach((schema) => {
@@ -16925,118 +16611,118 @@ function parseStringDef(def, refs) {
16925
16611
  type: "string"
16926
16612
  };
16927
16613
  if (def.checks) {
16928
- for (const check2 of def.checks) {
16929
- switch (check2.kind) {
16614
+ for (const check of def.checks) {
16615
+ switch (check.kind) {
16930
16616
  case "min":
16931
- setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check2.value) : check2.value, check2.message, refs);
16617
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
16932
16618
  break;
16933
16619
  case "max":
16934
- setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check2.value) : check2.value, check2.message, refs);
16620
+ setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
16935
16621
  break;
16936
16622
  case "email":
16937
16623
  switch (refs.emailStrategy) {
16938
16624
  case "format:email":
16939
- addFormat(res, "email", check2.message, refs);
16625
+ addFormat(res, "email", check.message, refs);
16940
16626
  break;
16941
16627
  case "format:idn-email":
16942
- addFormat(res, "idn-email", check2.message, refs);
16628
+ addFormat(res, "idn-email", check.message, refs);
16943
16629
  break;
16944
16630
  case "pattern:zod":
16945
- addPattern(res, zodPatterns.email, check2.message, refs);
16631
+ addPattern(res, zodPatterns.email, check.message, refs);
16946
16632
  break;
16947
16633
  }
16948
16634
  break;
16949
16635
  case "url":
16950
- addFormat(res, "uri", check2.message, refs);
16636
+ addFormat(res, "uri", check.message, refs);
16951
16637
  break;
16952
16638
  case "uuid":
16953
- addFormat(res, "uuid", check2.message, refs);
16639
+ addFormat(res, "uuid", check.message, refs);
16954
16640
  break;
16955
16641
  case "regex":
16956
- addPattern(res, check2.regex, check2.message, refs);
16642
+ addPattern(res, check.regex, check.message, refs);
16957
16643
  break;
16958
16644
  case "cuid":
16959
- addPattern(res, zodPatterns.cuid, check2.message, refs);
16645
+ addPattern(res, zodPatterns.cuid, check.message, refs);
16960
16646
  break;
16961
16647
  case "cuid2":
16962
- addPattern(res, zodPatterns.cuid2, check2.message, refs);
16648
+ addPattern(res, zodPatterns.cuid2, check.message, refs);
16963
16649
  break;
16964
16650
  case "startsWith":
16965
- addPattern(res, RegExp(`^${escapeLiteralCheckValue(check2.value, refs)}`), check2.message, refs);
16651
+ addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
16966
16652
  break;
16967
16653
  case "endsWith":
16968
- addPattern(res, RegExp(`${escapeLiteralCheckValue(check2.value, refs)}$`), check2.message, refs);
16654
+ addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
16969
16655
  break;
16970
16656
  case "datetime":
16971
- addFormat(res, "date-time", check2.message, refs);
16657
+ addFormat(res, "date-time", check.message, refs);
16972
16658
  break;
16973
16659
  case "date":
16974
- addFormat(res, "date", check2.message, refs);
16660
+ addFormat(res, "date", check.message, refs);
16975
16661
  break;
16976
16662
  case "time":
16977
- addFormat(res, "time", check2.message, refs);
16663
+ addFormat(res, "time", check.message, refs);
16978
16664
  break;
16979
16665
  case "duration":
16980
- addFormat(res, "duration", check2.message, refs);
16666
+ addFormat(res, "duration", check.message, refs);
16981
16667
  break;
16982
16668
  case "length":
16983
- setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check2.value) : check2.value, check2.message, refs);
16984
- setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check2.value) : check2.value, check2.message, refs);
16669
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
16670
+ setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
16985
16671
  break;
16986
16672
  case "includes": {
16987
- addPattern(res, RegExp(escapeLiteralCheckValue(check2.value, refs)), check2.message, refs);
16673
+ addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
16988
16674
  break;
16989
16675
  }
16990
16676
  case "ip": {
16991
- if (check2.version !== "v6") {
16992
- addFormat(res, "ipv4", check2.message, refs);
16677
+ if (check.version !== "v6") {
16678
+ addFormat(res, "ipv4", check.message, refs);
16993
16679
  }
16994
- if (check2.version !== "v4") {
16995
- addFormat(res, "ipv6", check2.message, refs);
16680
+ if (check.version !== "v4") {
16681
+ addFormat(res, "ipv6", check.message, refs);
16996
16682
  }
16997
16683
  break;
16998
16684
  }
16999
16685
  case "base64url":
17000
- addPattern(res, zodPatterns.base64url, check2.message, refs);
16686
+ addPattern(res, zodPatterns.base64url, check.message, refs);
17001
16687
  break;
17002
16688
  case "jwt":
17003
- addPattern(res, zodPatterns.jwt, check2.message, refs);
16689
+ addPattern(res, zodPatterns.jwt, check.message, refs);
17004
16690
  break;
17005
16691
  case "cidr": {
17006
- if (check2.version !== "v6") {
17007
- addPattern(res, zodPatterns.ipv4Cidr, check2.message, refs);
16692
+ if (check.version !== "v6") {
16693
+ addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);
17008
16694
  }
17009
- if (check2.version !== "v4") {
17010
- addPattern(res, zodPatterns.ipv6Cidr, check2.message, refs);
16695
+ if (check.version !== "v4") {
16696
+ addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
17011
16697
  }
17012
16698
  break;
17013
16699
  }
17014
16700
  case "emoji":
17015
- addPattern(res, zodPatterns.emoji(), check2.message, refs);
16701
+ addPattern(res, zodPatterns.emoji(), check.message, refs);
17016
16702
  break;
17017
16703
  case "ulid": {
17018
- addPattern(res, zodPatterns.ulid, check2.message, refs);
16704
+ addPattern(res, zodPatterns.ulid, check.message, refs);
17019
16705
  break;
17020
16706
  }
17021
16707
  case "base64": {
17022
16708
  switch (refs.base64Strategy) {
17023
16709
  case "format:binary": {
17024
- addFormat(res, "binary", check2.message, refs);
16710
+ addFormat(res, "binary", check.message, refs);
17025
16711
  break;
17026
16712
  }
17027
16713
  case "contentEncoding:base64": {
17028
- setResponseValueAndErrors(res, "contentEncoding", "base64", check2.message, refs);
16714
+ setResponseValueAndErrors(res, "contentEncoding", "base64", check.message, refs);
17029
16715
  break;
17030
16716
  }
17031
16717
  case "pattern:zod": {
17032
- addPattern(res, zodPatterns.base64, check2.message, refs);
16718
+ addPattern(res, zodPatterns.base64, check.message, refs);
17033
16719
  break;
17034
16720
  }
17035
16721
  }
17036
16722
  break;
17037
16723
  }
17038
16724
  case "nanoid": {
17039
- addPattern(res, zodPatterns.nanoid, check2.message, refs);
16725
+ addPattern(res, zodPatterns.nanoid, check.message, refs);
17040
16726
  }
17041
16727
  }
17042
16728
  }
@@ -17058,7 +16744,7 @@ function escapeNonAlphaNumeric(source) {
17058
16744
  return result;
17059
16745
  }
17060
16746
  function addFormat(schema, value, message, refs) {
17061
- if (schema.format || schema.anyOf?.some((x2) => x2.format)) {
16747
+ if (schema.format || schema.anyOf?.some((x) => x.format)) {
17062
16748
  if (!schema.anyOf) {
17063
16749
  schema.anyOf = [];
17064
16750
  }
@@ -17086,7 +16772,7 @@ function addFormat(schema, value, message, refs) {
17086
16772
  }
17087
16773
  }
17088
16774
  function addPattern(schema, regex, message, refs) {
17089
- if (schema.pattern || schema.allOf?.some((x2) => x2.pattern)) {
16775
+ if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
17090
16776
  if (!schema.allOf) {
17091
16777
  schema.allOf = [];
17092
16778
  }
@@ -17300,17 +16986,17 @@ function parseUnionDef(def, refs) {
17300
16986
  if (refs.target === "openApi3")
17301
16987
  return asAnyOf(def, refs);
17302
16988
  const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
17303
- if (options.every((x2) => x2._def.typeName in primitiveMappings && (!x2._def.checks || !x2._def.checks.length))) {
17304
- const types = options.reduce((types2, x2) => {
17305
- const type = primitiveMappings[x2._def.typeName];
16989
+ if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
16990
+ const types = options.reduce((types2, x) => {
16991
+ const type = primitiveMappings[x._def.typeName];
17306
16992
  return type && !types2.includes(type) ? [...types2, type] : types2;
17307
16993
  }, []);
17308
16994
  return {
17309
16995
  type: types.length > 1 ? types : types[0]
17310
16996
  };
17311
- } else if (options.every((x2) => x2._def.typeName === "ZodLiteral" && !x2.description)) {
17312
- const types = options.reduce((acc, x2) => {
17313
- const type = typeof x2._def.value;
16997
+ } else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
16998
+ const types = options.reduce((acc, x) => {
16999
+ const type = typeof x._def.value;
17314
17000
  switch (type) {
17315
17001
  case "string":
17316
17002
  case "number":
@@ -17319,7 +17005,7 @@ function parseUnionDef(def, refs) {
17319
17005
  case "bigint":
17320
17006
  return [...acc, "integer"];
17321
17007
  case "object":
17322
- if (x2._def.value === null)
17008
+ if (x._def.value === null)
17323
17009
  return [...acc, "null"];
17324
17010
  case "symbol":
17325
17011
  case "undefined":
@@ -17329,30 +17015,30 @@ function parseUnionDef(def, refs) {
17329
17015
  }
17330
17016
  }, []);
17331
17017
  if (types.length === options.length) {
17332
- const uniqueTypes = types.filter((x2, i, a) => a.indexOf(x2) === i);
17018
+ const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
17333
17019
  return {
17334
17020
  type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
17335
- enum: options.reduce((acc, x2) => {
17336
- return acc.includes(x2._def.value) ? acc : [...acc, x2._def.value];
17021
+ enum: options.reduce((acc, x) => {
17022
+ return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
17337
17023
  }, [])
17338
17024
  };
17339
17025
  }
17340
- } else if (options.every((x2) => x2._def.typeName === "ZodEnum")) {
17026
+ } else if (options.every((x) => x._def.typeName === "ZodEnum")) {
17341
17027
  return {
17342
17028
  type: "string",
17343
- enum: options.reduce((acc, x2) => [
17029
+ enum: options.reduce((acc, x) => [
17344
17030
  ...acc,
17345
- ...x2._def.values.filter((x3) => !acc.includes(x3))
17031
+ ...x._def.values.filter((x2) => !acc.includes(x2))
17346
17032
  ], [])
17347
17033
  };
17348
17034
  }
17349
17035
  return asAnyOf(def, refs);
17350
17036
  }
17351
17037
  const asAnyOf = (def, refs) => {
17352
- const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x2, i) => parseDef(x2._def, {
17038
+ const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
17353
17039
  ...refs,
17354
17040
  currentPath: [...refs.currentPath, "anyOf", `${i}`]
17355
- })).filter((x2) => !!x2 && (!refs.strictUnions || typeof x2 === "object" && Object.keys(x2).length > 0));
17041
+ })).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
17356
17042
  return anyOf.length ? { anyOf } : void 0;
17357
17043
  };
17358
17044
  function parseNullableDef(def, refs) {
@@ -17391,42 +17077,42 @@ function parseNumberDef(def, refs) {
17391
17077
  };
17392
17078
  if (!def.checks)
17393
17079
  return res;
17394
- for (const check2 of def.checks) {
17395
- switch (check2.kind) {
17080
+ for (const check of def.checks) {
17081
+ switch (check.kind) {
17396
17082
  case "int":
17397
17083
  res.type = "integer";
17398
- addErrorMessage(res, "type", check2.message, refs);
17084
+ addErrorMessage(res, "type", check.message, refs);
17399
17085
  break;
17400
17086
  case "min":
17401
17087
  if (refs.target === "jsonSchema7") {
17402
- if (check2.inclusive) {
17403
- setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
17088
+ if (check.inclusive) {
17089
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
17404
17090
  } else {
17405
- setResponseValueAndErrors(res, "exclusiveMinimum", check2.value, check2.message, refs);
17091
+ setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
17406
17092
  }
17407
17093
  } else {
17408
- if (!check2.inclusive) {
17094
+ if (!check.inclusive) {
17409
17095
  res.exclusiveMinimum = true;
17410
17096
  }
17411
- setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
17097
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
17412
17098
  }
17413
17099
  break;
17414
17100
  case "max":
17415
17101
  if (refs.target === "jsonSchema7") {
17416
- if (check2.inclusive) {
17417
- setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
17102
+ if (check.inclusive) {
17103
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
17418
17104
  } else {
17419
- setResponseValueAndErrors(res, "exclusiveMaximum", check2.value, check2.message, refs);
17105
+ setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
17420
17106
  }
17421
17107
  } else {
17422
- if (!check2.inclusive) {
17108
+ if (!check.inclusive) {
17423
17109
  res.exclusiveMaximum = true;
17424
17110
  }
17425
- setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
17111
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
17426
17112
  }
17427
17113
  break;
17428
17114
  case "multipleOf":
17429
- setResponseValueAndErrors(res, "multipleOf", check2.value, check2.message, refs);
17115
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
17430
17116
  break;
17431
17117
  }
17432
17118
  }
@@ -17532,7 +17218,7 @@ const parsePipelineDef = (def, refs) => {
17532
17218
  currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
17533
17219
  });
17534
17220
  return {
17535
- allOf: [a, b].filter((x2) => x2 !== void 0)
17221
+ allOf: [a, b].filter((x) => x !== void 0)
17536
17222
  };
17537
17223
  };
17538
17224
  function parsePromiseDef(def, refs) {
@@ -17561,10 +17247,10 @@ function parseTupleDef(def, refs) {
17561
17247
  return {
17562
17248
  type: "array",
17563
17249
  minItems: def.items.length,
17564
- items: def.items.map((x2, i) => parseDef(x2._def, {
17250
+ items: def.items.map((x, i) => parseDef(x._def, {
17565
17251
  ...refs,
17566
17252
  currentPath: [...refs.currentPath, "items", `${i}`]
17567
- })).reduce((acc, x2) => x2 === void 0 ? acc : [...acc, x2], []),
17253
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
17568
17254
  additionalItems: parseDef(def.rest._def, {
17569
17255
  ...refs,
17570
17256
  currentPath: [...refs.currentPath, "additionalItems"]
@@ -17575,10 +17261,10 @@ function parseTupleDef(def, refs) {
17575
17261
  type: "array",
17576
17262
  minItems: def.items.length,
17577
17263
  maxItems: def.items.length,
17578
- items: def.items.map((x2, i) => parseDef(x2._def, {
17264
+ items: def.items.map((x, i) => parseDef(x._def, {
17579
17265
  ...refs,
17580
17266
  currentPath: [...refs.currentPath, "items", `${i}`]
17581
- })).reduce((acc, x2) => x2 === void 0 ? acc : [...acc, x2], [])
17267
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
17582
17268
  };
17583
17269
  }
17584
17270
  }
@@ -17786,14 +17472,14 @@ var __export = (target, all) => {
17786
17472
  });
17787
17473
  };
17788
17474
  const _isMessageType = (msg, types) => {
17789
- const typesAsStrings = [...new Set(types?.map((t) => {
17790
- if (typeof t === "string") return t;
17791
- const instantiatedMsgClass = new t({});
17475
+ const typesAsStrings = [...new Set(types?.map((t2) => {
17476
+ if (typeof t2 === "string") return t2;
17477
+ const instantiatedMsgClass = new t2({});
17792
17478
  if (!("getType" in instantiatedMsgClass) || typeof instantiatedMsgClass.getType !== "function") throw new Error("Invalid type provided.");
17793
17479
  return instantiatedMsgClass.getType();
17794
17480
  }))];
17795
17481
  const msgType = msg.getType();
17796
- return typesAsStrings.some((t) => t === msgType);
17482
+ return typesAsStrings.some((t2) => t2 === msgType);
17797
17483
  };
17798
17484
  function filterMessages(messagesOrOptions, options) {
17799
17485
  if (Array.isArray(messagesOrOptions)) return _filterMessages(messagesOrOptions, options);
@@ -18074,7 +17760,7 @@ function _chunkToMsg(chunk) {
18074
17760
  }
18075
17761
  function defaultTextSplitter(text) {
18076
17762
  const splits = text.split("\n");
18077
- return Promise.resolve([...splits.slice(0, -1).map((s) => `${s}
17763
+ return Promise.resolve([...splits.slice(0, -1).map((s2) => `${s2}
18078
17764
  `), splits[splits.length - 1]]);
18079
17765
  }
18080
17766
  const KNOWN_BLOCK_TYPES$1 = [
@@ -20227,12 +19913,12 @@ var LangSmithLoader = class extends BaseDocumentLoader {
20227
19913
  return documents;
20228
19914
  }
20229
19915
  };
20230
- function _stringify(x2) {
20231
- if (typeof x2 === "string") return x2;
19916
+ function _stringify(x) {
19917
+ if (typeof x === "string") return x;
20232
19918
  else try {
20233
- return JSON.stringify(x2, null, 2);
19919
+ return JSON.stringify(x, null, 2);
20234
19920
  } catch {
20235
- return String(x2);
19921
+ return String(x);
20236
19922
  }
20237
19923
  }
20238
19924
  var Document = class {
@@ -21136,7 +20822,7 @@ var CommaSeparatedListOutputParser = class extends ListOutputParser {
21136
20822
  */
21137
20823
  async parse(text) {
21138
20824
  try {
21139
- return text.trim().split(",").map((s) => s.trim());
20825
+ return text.trim().split(",").map((s2) => s2.trim());
21140
20826
  } catch {
21141
20827
  throw new OutputParserException(`Could not parse output: ${text}`, text);
21142
20828
  }
@@ -21172,7 +20858,7 @@ var CustomListOutputParser = class extends ListOutputParser {
21172
20858
  */
21173
20859
  async parse(text) {
21174
20860
  try {
21175
- const items = text.trim().split(this.separator).map((s) => s.trim());
20861
+ const items = text.trim().split(this.separator).map((s2) => s2.trim());
21176
20862
  if (this.length !== void 0 && items.length !== this.length) throw new OutputParserException(`Incorrect number of items. Expected ${this.length}, got ${items.length}.`);
21177
20863
  return items;
21178
20864
  } catch (e) {
@@ -21377,12 +21063,12 @@ ${this._schemaToInstruction(toJsonSchema(this.schema)).replaceAll("{", "{".repea
21377
21063
  _schemaToInstruction(schemaInput, indent = 2) {
21378
21064
  const schema = schemaInput;
21379
21065
  if ("type" in schema) {
21380
- let nullable2 = false;
21066
+ let nullable = false;
21381
21067
  let type;
21382
21068
  if (Array.isArray(schema.type)) {
21383
21069
  const nullIdx = schema.type.findIndex((type$1) => type$1 === "null");
21384
21070
  if (nullIdx !== -1) {
21385
- nullable2 = true;
21071
+ nullable = true;
21386
21072
  schema.type.splice(nullIdx, 1);
21387
21073
  }
21388
21074
  type = schema.type.join(" | ");
@@ -21403,11 +21089,11 @@ ${" ".repeat(indent - 2)}}${description$1}`;
21403
21089
  ${" ".repeat(indent)}${this._schemaToInstruction(schema.items, indent + 2)}
21404
21090
  ${" ".repeat(indent - 2)}] ${description$1}`;
21405
21091
  }
21406
- const isNullable = nullable2 ? " (nullable)" : "";
21092
+ const isNullable = nullable ? " (nullable)" : "";
21407
21093
  const description = schema.description ? ` // ${schema.description}` : "";
21408
21094
  return `${type}${description}${isNullable}`;
21409
21095
  }
21410
- if ("anyOf" in schema) return schema.anyOf.map((s) => this._schemaToInstruction(s, indent)).join(`
21096
+ if ("anyOf" in schema) return schema.anyOf.map((s2) => this._schemaToInstruction(s2, indent)).join(`
21411
21097
  ${" ".repeat(indent - 2)}`);
21412
21098
  throw new Error("unsupported schema type");
21413
21099
  }
@@ -21996,7 +21682,7 @@ const initializeSax = function() {
21996
21682
  var s$1 = typeof e === "number" ? String.fromCharCode(e) : e;
21997
21683
  sax$1.ENTITIES[key] = s$1;
21998
21684
  });
21999
- for (var s in sax$1.STATE) sax$1.STATE[sax$1.STATE[s]] = s;
21685
+ for (var s2 in sax$1.STATE) sax$1.STATE[sax$1.STATE[s2]] = s2;
22000
21686
  S = sax$1.STATE;
22001
21687
  function emit(parser, event, data) {
22002
21688
  parser[event] && parser[event](data);
@@ -22162,16 +21848,16 @@ const initializeSax = function() {
22162
21848
  emitNode(parser, "onscript", parser.script);
22163
21849
  parser.script = "";
22164
21850
  }
22165
- var t = parser.tags.length;
21851
+ var t2 = parser.tags.length;
22166
21852
  var tagName = parser.tagName;
22167
21853
  if (!parser.strict) tagName = tagName[parser.looseCase]();
22168
21854
  var closeTo = tagName;
22169
- while (t--) {
22170
- var close = parser.tags[t];
21855
+ while (t2--) {
21856
+ var close = parser.tags[t2];
22171
21857
  if (close.name !== closeTo) strictFail(parser, "Unexpected close tag");
22172
21858
  else break;
22173
21859
  }
22174
- if (t < 0) {
21860
+ if (t2 < 0) {
22175
21861
  strictFail(parser, "Unmatched closing tag: " + parser.tagName);
22176
21862
  parser.textNode += "</" + parser.tagName + ">";
22177
21863
  parser.state = S.TEXT;
@@ -22179,12 +21865,12 @@ const initializeSax = function() {
22179
21865
  }
22180
21866
  parser.tagName = tagName;
22181
21867
  var s$1 = parser.tags.length;
22182
- while (s$1-- > t) {
21868
+ while (s$1-- > t2) {
22183
21869
  var tag = parser.tag = parser.tags.pop();
22184
21870
  parser.tagName = parser.tag.name;
22185
21871
  emitNode(parser, "onclosetag", parser.tagName);
22186
- var x2 = {};
22187
- for (var i in tag.ns) x2[i] = tag.ns[i];
21872
+ var x = {};
21873
+ for (var i in tag.ns) x[i] = tag.ns[i];
22188
21874
  var parent = parser.tags[parser.tags.length - 1] || parser;
22189
21875
  if (parser.opt.xmlns && tag.ns !== parent.ns) Object.keys(tag.ns).forEach(function(p) {
22190
21876
  var n2 = tag.ns[p];
@@ -22194,7 +21880,7 @@ const initializeSax = function() {
22194
21880
  });
22195
21881
  });
22196
21882
  }
22197
- if (t === 0) parser.closedRoot = true;
21883
+ if (t2 === 0) parser.closedRoot = true;
22198
21884
  parser.tagName = parser.attribValue = parser.attribName = "";
22199
21885
  parser.attribList.length = 0;
22200
21886
  parser.state = S.TEXT;
@@ -22738,8 +22424,8 @@ const parseParsedResult = (input) => {
22738
22424
  return result;
22739
22425
  }
22740
22426
  };
22741
- function parseXMLMarkdown(s) {
22742
- const cleanedString = strip(s);
22427
+ function parseXMLMarkdown(s2) {
22428
+ const cleanedString = strip(s2);
22743
22429
  const parser = sax.parser(true);
22744
22430
  let parsedResult = {};
22745
22431
  const elementStack = [];
@@ -23207,8 +22893,8 @@ var entityMap = {
23207
22893
  "=": "&#x3D;"
23208
22894
  };
23209
22895
  function escapeHtml(string) {
23210
- return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
23211
- return entityMap[s];
22896
+ return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s2) {
22897
+ return entityMap[s2];
23212
22898
  });
23213
22899
  }
23214
22900
  var whiteRe = /\s*/;
@@ -23981,14 +23667,14 @@ var DictPromptTemplate = class extends Runnable {
23981
23667
  };
23982
23668
  function _getInputVariables(template, templateFormat) {
23983
23669
  const inputVariables = [];
23984
- for (const v of Object.values(template)) if (typeof v === "string") parseTemplate(v, templateFormat).forEach((t) => {
23985
- if (t.type === "variable") inputVariables.push(t.name);
23670
+ for (const v of Object.values(template)) if (typeof v === "string") parseTemplate(v, templateFormat).forEach((t2) => {
23671
+ if (t2.type === "variable") inputVariables.push(t2.name);
23986
23672
  });
23987
23673
  else if (Array.isArray(v)) {
23988
- for (const x2 of v) if (typeof x2 === "string") parseTemplate(x2, templateFormat).forEach((t) => {
23989
- if (t.type === "variable") inputVariables.push(t.name);
23674
+ for (const x of v) if (typeof x === "string") parseTemplate(x, templateFormat).forEach((t2) => {
23675
+ if (t2.type === "variable") inputVariables.push(t2.name);
23990
23676
  });
23991
- else if (typeof x2 === "object") inputVariables.push(..._getInputVariables(x2, templateFormat));
23677
+ else if (typeof x === "object") inputVariables.push(..._getInputVariables(x, templateFormat));
23992
23678
  } else if (typeof v === "object" && v !== null) inputVariables.push(..._getInputVariables(v, templateFormat));
23993
23679
  return Array.from(new Set(inputVariables));
23994
23680
  }
@@ -23997,8 +23683,8 @@ function _insertInputVariables(template, inputs, templateFormat) {
23997
23683
  for (const [k, v] of Object.entries(template)) if (typeof v === "string") formatted[k] = renderTemplate(v, templateFormat, inputs);
23998
23684
  else if (Array.isArray(v)) {
23999
23685
  const formattedV = [];
24000
- for (const x2 of v) if (typeof x2 === "string") formattedV.push(renderTemplate(x2, templateFormat, inputs));
24001
- else if (typeof x2 === "object") formattedV.push(_insertInputVariables(x2, inputs, templateFormat));
23686
+ for (const x of v) if (typeof x === "string") formattedV.push(renderTemplate(x, templateFormat, inputs));
23687
+ else if (typeof x === "object") formattedV.push(_insertInputVariables(x, inputs, templateFormat));
24002
23688
  formatted[k] = formattedV;
24003
23689
  } else if (typeof v === "object" && v !== null) formatted[k] = _insertInputVariables(v, inputs, templateFormat);
24004
23690
  else formatted[k] = v;
@@ -24350,8 +24036,8 @@ function _coerceMessagePromptTemplateLike(messagePromptTemplateLike, extra) {
24350
24036
  else if (ChatMessage.isInstance(message)) return ChatMessagePromptTemplate.fromTemplate(message.content, message.role, extra);
24351
24037
  else throw new Error(`Could not coerce message prompt template from input. Received message type: "${message._getType()}".`);
24352
24038
  }
24353
- function isMessagesPlaceholder(x2) {
24354
- return x2.constructor.lc_name() === "MessagesPlaceholder";
24039
+ function isMessagesPlaceholder(x) {
24040
+ return x.constructor.lc_name() === "MessagesPlaceholder";
24355
24041
  }
24356
24042
  var ChatPromptTemplate = class ChatPromptTemplate2 extends BaseChatPromptTemplate {
24357
24043
  static lc_name() {
@@ -24375,9 +24061,9 @@ var ChatPromptTemplate = class ChatPromptTemplate2 extends BaseChatPromptTemplat
24375
24061
  }
24376
24062
  const totalInputVariables = this.inputVariables;
24377
24063
  const inputVariablesInstance = new Set(this.partialVariables ? totalInputVariables.concat(Object.keys(this.partialVariables)) : totalInputVariables);
24378
- const difference = new Set([...inputVariablesInstance].filter((x2) => !inputVariablesMessages.has(x2)));
24064
+ const difference = new Set([...inputVariablesInstance].filter((x) => !inputVariablesMessages.has(x)));
24379
24065
  if (difference.size > 0) throw new Error(`Input variables \`${[...difference]}\` are not used in any of the prompt messages.`);
24380
- const otherDifference = new Set([...inputVariablesMessages].filter((x2) => !inputVariablesInstance.has(x2)));
24066
+ const otherDifference = new Set([...inputVariablesMessages].filter((x) => !inputVariablesInstance.has(x)));
24381
24067
  if (otherDifference.size > 0) throw new Error(`Input variables \`${[...otherDifference]}\` are used in prompt messages but not in the prompt template.`);
24382
24068
  }
24383
24069
  }
@@ -24731,11 +24417,11 @@ var PipelinePromptTemplate = class PipelinePromptTemplate2 extends BasePromptTem
24731
24417
  return "pipeline";
24732
24418
  }
24733
24419
  };
24734
- function isWithStructuredOutput(x2) {
24735
- return typeof x2 === "object" && x2 != null && "withStructuredOutput" in x2 && typeof x2.withStructuredOutput === "function";
24420
+ function isWithStructuredOutput(x) {
24421
+ return typeof x === "object" && x != null && "withStructuredOutput" in x && typeof x.withStructuredOutput === "function";
24736
24422
  }
24737
- function isRunnableBinding(x2) {
24738
- return typeof x2 === "object" && x2 != null && "lc_id" in x2 && Array.isArray(x2.lc_id) && x2.lc_id.join("/") === "langchain_core/runnables/RunnableBinding";
24423
+ function isRunnableBinding(x) {
24424
+ return typeof x === "object" && x != null && "lc_id" in x && Array.isArray(x.lc_id) && x.lc_id.join("/") === "langchain_core/runnables/RunnableBinding";
24739
24425
  }
24740
24426
  var StructuredPrompt = class StructuredPrompt2 extends ChatPromptTemplate {
24741
24427
  schema;
@@ -24806,8 +24492,8 @@ __export$1(prompts_exports, {
24806
24492
  var base_exports = {};
24807
24493
  __export$1(base_exports, { BaseDocumentCompressor: () => BaseDocumentCompressor });
24808
24494
  var BaseDocumentCompressor = class {
24809
- static isBaseDocumentCompressor(x2) {
24810
- return x2?.compressDocuments !== void 0;
24495
+ static isBaseDocumentCompressor(x) {
24496
+ return x?.compressDocuments !== void 0;
24811
24497
  }
24812
24498
  };
24813
24499
  const Operators = {
@@ -25443,16 +25129,16 @@ function maximalMarginalRelevance(queryEmbedding, embeddingList, lambda = 0.5, k
25443
25129
  }
25444
25130
  return selectedEmbeddingsIndexes;
25445
25131
  }
25446
- function argMax(array2) {
25447
- if (array2.length === 0) return {
25132
+ function argMax(array) {
25133
+ if (array.length === 0) return {
25448
25134
  maxIndex: -1,
25449
25135
  maxValue: NaN
25450
25136
  };
25451
- let maxValue = array2[0];
25137
+ let maxValue = array[0];
25452
25138
  let maxIndex = 0;
25453
- for (let i = 1; i < array2.length; i += 1) if (array2[i] > maxValue) {
25139
+ for (let i = 1; i < array.length; i += 1) if (array[i] > maxValue) {
25454
25140
  maxIndex = i;
25455
- maxValue = array2[i];
25141
+ maxValue = array[i];
25456
25142
  }
25457
25143
  return {
25458
25144
  maxIndex,
@@ -25460,7 +25146,7 @@ function argMax(array2) {
25460
25146
  };
25461
25147
  }
25462
25148
  function matrixMaxVal(arrays) {
25463
- return arrays.reduce((acc, array2) => Math.max(acc, argMax(array2).maxValue), 0);
25149
+ return arrays.reduce((acc, array) => Math.max(acc, argMax(array).maxValue), 0);
25464
25150
  }
25465
25151
  var FakeChatModel = class extends BaseChatModel {
25466
25152
  _combineLLMOutput() {
@@ -25508,34 +25194,34 @@ var FakeStreamingChatModel = class FakeStreamingChatModel2 extends BaseChatModel
25508
25194
  }
25509
25195
  bindTools(tools) {
25510
25196
  const merged = [...this.tools, ...tools];
25511
- const toolDicts = merged.map((t) => {
25197
+ const toolDicts = merged.map((t2) => {
25512
25198
  switch (this.toolStyle) {
25513
25199
  case "openai":
25514
25200
  return {
25515
25201
  type: "function",
25516
25202
  function: {
25517
- name: t.name,
25518
- description: t.description,
25519
- parameters: toJsonSchema(t.schema)
25203
+ name: t2.name,
25204
+ description: t2.description,
25205
+ parameters: toJsonSchema(t2.schema)
25520
25206
  }
25521
25207
  };
25522
25208
  case "anthropic":
25523
25209
  return {
25524
- name: t.name,
25525
- description: t.description,
25526
- input_schema: toJsonSchema(t.schema)
25210
+ name: t2.name,
25211
+ description: t2.description,
25212
+ input_schema: toJsonSchema(t2.schema)
25527
25213
  };
25528
25214
  case "bedrock":
25529
25215
  return { toolSpec: {
25530
- name: t.name,
25531
- description: t.description,
25532
- inputSchema: toJsonSchema(t.schema)
25216
+ name: t2.name,
25217
+ description: t2.description,
25218
+ inputSchema: toJsonSchema(t2.schema)
25533
25219
  } };
25534
25220
  case "google":
25535
25221
  return {
25536
- name: t.name,
25537
- description: t.description,
25538
- parameters: toJsonSchema(t.schema)
25222
+ name: t2.name,
25223
+ description: t2.description,
25224
+ parameters: toJsonSchema(t2.schema)
25539
25225
  };
25540
25226
  default:
25541
25227
  throw new Error(`Unsupported tool style: ${this.toolStyle}`);
@@ -25709,9 +25395,9 @@ var SyntheticEmbeddings = class extends Embeddings {
25709
25395
  const chunkSize = doc.length / this.vectorSize;
25710
25396
  const docChunk = [];
25711
25397
  for (let co = 0; co < doc.length; co += chunkSize) docChunk.push(doc.slice(co, co + chunkSize));
25712
- const ret = docChunk.map((s) => {
25398
+ const ret = docChunk.map((s2) => {
25713
25399
  let sum = 0;
25714
- for (let co = 0; co < s.length; co += 1) sum += s === " " ? 0 : s.charCodeAt(co);
25400
+ for (let co = 0; co < s2.length; co += 1) sum += s2 === " " ? 0 : s2.charCodeAt(co);
25715
25401
  const ret$1 = sum % 26 / 26;
25716
25402
  return ret$1;
25717
25403
  });
@@ -27008,8 +26694,8 @@ var LastValueAfterFinish = class LastValueAfterFinish2 extends BaseChannel {
27008
26694
  var AnnotationRoot = class {
27009
26695
  lc_graph_name = "AnnotationRoot";
27010
26696
  spec;
27011
- constructor(s) {
27012
- this.spec = s;
26697
+ constructor(s2) {
26698
+ this.spec = s2;
27013
26699
  }
27014
26700
  };
27015
26701
  const Annotation = function(annotation) {
@@ -27088,8 +26774,8 @@ var CommandInstance = class {
27088
26774
  this[COMMAND_SYMBOL] = args;
27089
26775
  }
27090
26776
  };
27091
- function _isSendInterface(x2) {
27092
- const operation = x2;
26777
+ function _isSendInterface(x) {
26778
+ const operation = x;
27093
26779
  return operation !== null && operation !== void 0 && typeof operation.node === "string" && operation.args !== void 0;
27094
26780
  }
27095
26781
  var Send = class {
@@ -27108,8 +26794,8 @@ var Send = class {
27108
26794
  };
27109
26795
  }
27110
26796
  };
27111
- function _isSend(x2) {
27112
- return x2 instanceof Send;
26797
+ function _isSend(x) {
26798
+ return x instanceof Send;
27113
26799
  }
27114
26800
  function isInterrupted(values) {
27115
26801
  if (!values || typeof values !== "object") return false;
@@ -27158,7 +26844,7 @@ var Command = class extends CommandInstance {
27158
26844
  */
27159
26845
  _updateAsTuples() {
27160
26846
  if (this.update && typeof this.update === "object" && !Array.isArray(this.update)) return Object.entries(this.update);
27161
- else if (Array.isArray(this.update) && this.update.every((t) => Array.isArray(t) && t.length === 2 && typeof t[0] === "string")) return this.update;
26847
+ else if (Array.isArray(this.update) && this.update.every((t2) => Array.isArray(t2) && t2.length === 2 && typeof t2[0] === "string")) return this.update;
27162
26848
  else return [["__root__", this.update]];
27163
26849
  }
27164
26850
  toJSON() {
@@ -27177,42 +26863,42 @@ var Command = class extends CommandInstance {
27177
26863
  };
27178
26864
  }
27179
26865
  };
27180
- function isCommand(x2) {
27181
- if (typeof x2 !== "object") return false;
27182
- if (x2 === null || x2 === void 0) return false;
27183
- if ("lg_name" in x2 && x2.lg_name === "Command") return true;
26866
+ function isCommand(x) {
26867
+ if (typeof x !== "object") return false;
26868
+ if (x === null || x === void 0) return false;
26869
+ if ("lg_name" in x && x.lg_name === "Command") return true;
27184
26870
  return false;
27185
26871
  }
27186
- function _deserializeCommandSendObjectGraph(x2, seen = /* @__PURE__ */ new Map()) {
27187
- if (x2 !== void 0 && x2 !== null && typeof x2 === "object") {
27188
- if (seen.has(x2)) return seen.get(x2);
26872
+ function _deserializeCommandSendObjectGraph(x, seen = /* @__PURE__ */ new Map()) {
26873
+ if (x !== void 0 && x !== null && typeof x === "object") {
26874
+ if (seen.has(x)) return seen.get(x);
27189
26875
  let result;
27190
- if (Array.isArray(x2)) {
26876
+ if (Array.isArray(x)) {
27191
26877
  result = [];
27192
- seen.set(x2, result);
27193
- x2.forEach((item, index2) => {
26878
+ seen.set(x, result);
26879
+ x.forEach((item, index2) => {
27194
26880
  result[index2] = _deserializeCommandSendObjectGraph(item, seen);
27195
26881
  });
27196
- } else if (isCommand(x2) && !(x2 instanceof Command)) {
27197
- result = new Command(x2);
27198
- seen.set(x2, result);
27199
- } else if (_isSendInterface(x2) && !(x2 instanceof Send)) {
27200
- result = new Send(x2.node, x2.args);
27201
- seen.set(x2, result);
27202
- } else if (isCommand(x2) || _isSend(x2)) {
27203
- result = x2;
27204
- seen.set(x2, result);
27205
- } else if ("lc_serializable" in x2 && x2.lc_serializable) {
27206
- result = x2;
27207
- seen.set(x2, result);
26882
+ } else if (isCommand(x) && !(x instanceof Command)) {
26883
+ result = new Command(x);
26884
+ seen.set(x, result);
26885
+ } else if (_isSendInterface(x) && !(x instanceof Send)) {
26886
+ result = new Send(x.node, x.args);
26887
+ seen.set(x, result);
26888
+ } else if (isCommand(x) || _isSend(x)) {
26889
+ result = x;
26890
+ seen.set(x, result);
26891
+ } else if ("lc_serializable" in x && x.lc_serializable) {
26892
+ result = x;
26893
+ seen.set(x, result);
27208
26894
  } else {
27209
26895
  result = {};
27210
- seen.set(x2, result);
27211
- for (const [key, value] of Object.entries(x2)) result[key] = _deserializeCommandSendObjectGraph(value, seen);
26896
+ seen.set(x, result);
26897
+ for (const [key, value] of Object.entries(x)) result[key] = _deserializeCommandSendObjectGraph(value, seen);
27212
26898
  }
27213
26899
  return result;
27214
26900
  }
27215
- return x2;
26901
+ return x;
27216
26902
  }
27217
26903
  const COPIABLE_KEYS = [
27218
26904
  "tags",
@@ -27502,8 +27188,8 @@ function XXH3_len_0to16_128b(data, seed) {
27502
27188
  if (len > 0) return XXH3_len_1to3_128b(data, kkey, seed);
27503
27189
  return XXH3_avalanche64(seed ^ kkey.getBigUint64(64, true) ^ kkey.getBigUint64(72, true)) | XXH3_avalanche64(seed ^ kkey.getBigUint64(80, true) ^ kkey.getBigUint64(88, true)) << n(64);
27504
27190
  }
27505
- function inv64(x2) {
27506
- return ~x2 + n(1) & mask64;
27191
+ function inv64(x) {
27192
+ return ~x + n(1) & mask64;
27507
27193
  }
27508
27194
  function XXH3_len_17to128_128b(data, secret, seed) {
27509
27195
  let acc = n(data.byteLength) * PRIME64_1 & mask64;
@@ -27640,12 +27326,12 @@ function patchConfigurable$1(config, patch) {
27640
27326
  }
27641
27327
  };
27642
27328
  }
27643
- function _isSkipWrite(x2) {
27644
- return typeof x2 === "object" && x2?.[Symbol.for("LG_SKIP_WRITE")] !== void 0;
27329
+ function _isSkipWrite(x) {
27330
+ return typeof x === "object" && x?.[Symbol.for("LG_SKIP_WRITE")] !== void 0;
27645
27331
  }
27646
27332
  const PASSTHROUGH = { [Symbol.for("LG_PASSTHROUGH")]: true };
27647
- function _isPassthrough(x2) {
27648
- return typeof x2 === "object" && x2?.[Symbol.for("LG_PASSTHROUGH")] !== void 0;
27333
+ function _isPassthrough(x) {
27334
+ return typeof x === "object" && x?.[Symbol.for("LG_PASSTHROUGH")] !== void 0;
27649
27335
  }
27650
27336
  const IS_WRITER = Symbol("IS_WRITER");
27651
27337
  var ChannelWrite = class ChannelWrite2 extends RunnableCallable$1 {
@@ -27714,11 +27400,11 @@ var ChannelWrite = class ChannelWrite2 extends RunnableCallable$1 {
27714
27400
  return Object.defineProperty(runnable, IS_WRITER, { value: true });
27715
27401
  }
27716
27402
  };
27717
- function _isChannelWriteEntry(x2) {
27718
- return x2 !== void 0 && typeof x2.channel === "string";
27403
+ function _isChannelWriteEntry(x) {
27404
+ return x !== void 0 && typeof x.channel === "string";
27719
27405
  }
27720
- function _isChannelWriteTupleEntry(x2) {
27721
- return x2 !== void 0 && !_isChannelWriteEntry(x2) && Runnable.isRunnable(x2.mapper);
27406
+ function _isChannelWriteTupleEntry(x) {
27407
+ return x !== void 0 && !_isChannelWriteEntry(x) && Runnable.isRunnable(x.mapper);
27722
27408
  }
27723
27409
  var ChannelRead = class ChannelRead2 extends RunnableCallable$1 {
27724
27410
  lc_graph_name = "ChannelRead";
@@ -27860,11 +27546,11 @@ var PregelNode = class PregelNode2 extends RunnableBinding {
27860
27546
  });
27861
27547
  }
27862
27548
  };
27863
- function isRunnableSequence(x2) {
27864
- return "steps" in x2 && Array.isArray(x2.steps);
27549
+ function isRunnableSequence(x) {
27550
+ return "steps" in x && Array.isArray(x.steps);
27865
27551
  }
27866
- function isPregelLike(x2) {
27867
- return "lg_is_pregel" in x2 && x2.lg_is_pregel === true;
27552
+ function isPregelLike(x) {
27553
+ return "lg_is_pregel" in x && x.lg_is_pregel === true;
27868
27554
  }
27869
27555
  function findSubgraphPregel(candidate) {
27870
27556
  const candidates = [candidate];
@@ -28023,8 +27709,8 @@ function patchCheckpointMap(config, metadata) {
28023
27709
  } });
28024
27710
  else return config;
28025
27711
  }
28026
- function combineAbortSignals(...x2) {
28027
- const signals = [...new Set(x2.filter(Boolean))];
27712
+ function combineAbortSignals(...x) {
27713
+ const signals = [...new Set(x.filter(Boolean))];
28028
27714
  if (signals.length === 0) return {
28029
27715
  signal: void 0,
28030
27716
  dispose: void 0
@@ -28035,17 +27721,17 @@ function combineAbortSignals(...x2) {
28035
27721
  };
28036
27722
  const combinedController = new AbortController();
28037
27723
  const listener = () => {
28038
- const reason = signals.find((s) => s.aborted)?.reason;
27724
+ const reason = signals.find((s2) => s2.aborted)?.reason;
28039
27725
  combinedController.abort(reason);
28040
- signals.forEach((s) => s.removeEventListener("abort", listener));
27726
+ signals.forEach((s2) => s2.removeEventListener("abort", listener));
28041
27727
  };
28042
- signals.forEach((s) => s.addEventListener("abort", listener, { once: true }));
28043
- const hasAlreadyAbortedSignal = signals.find((s) => s.aborted);
27728
+ signals.forEach((s2) => s2.addEventListener("abort", listener, { once: true }));
27729
+ const hasAlreadyAbortedSignal = signals.find((s2) => s2.aborted);
28044
27730
  if (hasAlreadyAbortedSignal) combinedController.abort(hasAlreadyAbortedSignal.reason);
28045
27731
  return {
28046
27732
  signal: combinedController.signal,
28047
27733
  dispose: () => {
28048
- signals.forEach((s) => s.removeEventListener("abort", listener));
27734
+ signals.forEach((s2) => s2.removeEventListener("abort", listener));
28049
27735
  }
28050
27736
  };
28051
27737
  }
@@ -28987,7 +28673,7 @@ function createDuplexStream(...streams) {
28987
28673
  passthroughFn: (value) => {
28988
28674
  for (const stream of streams) if (stream.modes.has(value[1])) stream.push(value);
28989
28675
  },
28990
- modes: new Set(streams.flatMap((s) => Array.from(s.modes)))
28676
+ modes: new Set(streams.flatMap((s2) => Array.from(s2.modes)))
28991
28677
  });
28992
28678
  }
28993
28679
  var AsyncBatchedCache = class extends BaseCache2 {
@@ -29267,7 +28953,7 @@ var PregelLoop = class PregelLoop2 {
29267
28953
  this.status = "interrupt_before";
29268
28954
  throw new GraphInterrupt();
29269
28955
  } else if (Object.values(this.tasks).every((task) => task.writes.length > 0)) {
29270
- const writes = Object.values(this.tasks).flatMap((t) => t.writes);
28956
+ const writes = Object.values(this.tasks).flatMap((t2) => t2.writes);
29271
28957
  this.updatedChannels = _applyWrites(this.checkpoint, this.channels, Object.values(this.tasks), this.checkpointerGetNextVersion, this.triggerToNodes);
29272
28958
  const valuesOutput = await gatherIterator(prefixGenerator(mapOutputValues(this.outputKeys, writes, this.channels), "values"));
29273
28959
  this._emit(valuesOutput);
@@ -29302,7 +28988,7 @@ var PregelLoop = class PregelLoop2 {
29302
28988
  if (this.skipDoneTasks && this.checkpointPendingWrites.length > 0) {
29303
28989
  for (const [tid, k, v] of this.checkpointPendingWrites) {
29304
28990
  if (k === ERROR$1 || k === INTERRUPT || k === RESUME) continue;
29305
- const task = Object.values(this.tasks).find((t) => t.id === tid);
28991
+ const task = Object.values(this.tasks).find((t2) => t2.id === tid);
29306
28992
  if (task) task.writes.push([k, v]);
29307
28993
  }
29308
28994
  for (const task of Object.values(this.tasks)) if (task.writes.length > 0) this._outputWrites(task.id, task.writes, true);
@@ -29326,7 +29012,7 @@ var PregelLoop = class PregelLoop2 {
29326
29012
  if (suppress) {
29327
29013
  if (this.tasks !== void 0 && this.checkpointPendingWrites.length > 0 && Object.values(this.tasks).some((task) => task.writes.length > 0)) {
29328
29014
  this.updatedChannels = _applyWrites(this.checkpoint, this.channels, Object.values(this.tasks), this.checkpointerGetNextVersion, this.triggerToNodes);
29329
- this._emit(gatherIteratorSync(prefixGenerator(mapOutputValues(this.outputKeys, Object.values(this.tasks).flatMap((t) => t.writes), this.channels), "values")));
29015
+ this._emit(gatherIteratorSync(prefixGenerator(mapOutputValues(this.outputKeys, Object.values(this.tasks).flatMap((t2) => t2.writes), this.channels), "values")));
29330
29016
  }
29331
29017
  if (isGraphInterrupt(error) && !error.interrupts.length) this._emit([["updates", { [INTERRUPT]: [] }], ["values", { [INTERRUPT]: [] }]]);
29332
29018
  }
@@ -29503,14 +29189,14 @@ var PregelLoop = class PregelLoop2 {
29503
29189
  _matchWrites(tasks) {
29504
29190
  for (const [tid, k, v] of this.checkpointPendingWrites) {
29505
29191
  if (k === ERROR$1 || k === INTERRUPT || k === RESUME) continue;
29506
- const task = Object.values(tasks).find((t) => t.id === tid);
29192
+ const task = Object.values(tasks).find((t2) => t2.id === tid);
29507
29193
  if (task) task.writes.push([k, v]);
29508
29194
  }
29509
29195
  for (const task of Object.values(tasks)) if (task.writes.length > 0) this._outputWrites(task.id, task.writes, true);
29510
29196
  }
29511
29197
  };
29512
- function isChatGenerationChunk(x2) {
29513
- return isBaseMessage(x2?.message);
29198
+ function isChatGenerationChunk(x) {
29199
+ return isBaseMessage(x?.message);
29514
29200
  }
29515
29201
  var StreamMessagesHandler = class extends BaseCallbackHandler {
29516
29202
  name = "StreamMessagesHandler";
@@ -29724,7 +29410,7 @@ var PregelRunner = class {
29724
29410
  const exceptionSignalController = new AbortController();
29725
29411
  const exceptionSignal = exceptionSignalController.signal;
29726
29412
  const stepTimeoutSignal = timeout ? AbortSignal.timeout(timeout) : void 0;
29727
- const pendingTasks = Object.values(this.loop.tasks).filter((t) => t.writes.length === 0);
29413
+ const pendingTasks = Object.values(this.loop.tasks).filter((t2) => t2.writes.length === 0);
29728
29414
  const { signals, disposeCombinedSignal } = this._initializeAbortSignals({
29729
29415
  exceptionSignal,
29730
29416
  stepTimeoutSignal,
@@ -30475,7 +30161,7 @@ var Pregel = class extends PartialRunnable {
30475
30161
  const checkpointer = startConfig.configurable?.[CONFIG_KEY_CHECKPOINTER] ?? this.checkpointer;
30476
30162
  if (!checkpointer) throw new GraphValueError("No checkpointer set", { lc_error_code: "MISSING_CHECKPOINTER" });
30477
30163
  if (supersteps.length === 0) throw new Error("No supersteps provided");
30478
- if (supersteps.some((s) => s.updates.length === 0)) throw new Error("No updates provided");
30164
+ if (supersteps.some((s2) => s2.updates.length === 0)) throw new Error("No updates provided");
30479
30165
  const checkpointNamespace = startConfig.configurable?.checkpoint_ns ?? "";
30480
30166
  if (checkpointNamespace !== "" && startConfig.configurable?.[CONFIG_KEY_CHECKPOINTER] === void 0) {
30481
30167
  const recastNamespace = recastCheckpointNamespace(checkpointNamespace);
@@ -31319,7 +31005,7 @@ var CompiledGraph = class extends Pregel {
31319
31005
  const startNodes = { [START]: graph.addNode({ schema: any() }, START) };
31320
31006
  const endNodes = {};
31321
31007
  let subgraphs = {};
31322
- if (xray) subgraphs = Object.fromEntries((await gatherIterator(this.getSubgraphsAsync())).filter((x2) => isCompiledGraph(x2[1])));
31008
+ if (xray) subgraphs = Object.fromEntries((await gatherIterator(this.getSubgraphsAsync())).filter((x) => isCompiledGraph(x[1])));
31323
31009
  function addEdge(start, end, label, conditional = false) {
31324
31010
  if (end === END && endNodes[END] === void 0) endNodes[END] = graph.addNode({ schema: any() }, END);
31325
31011
  if (startNodes[start] === void 0) return;
@@ -31355,11 +31041,11 @@ var CompiledGraph = class extends Pregel {
31355
31041
  }
31356
31042
  else return data.name ?? "UnknownSchema";
31357
31043
  };
31358
- const [e, s] = graph.extend(drawableSubgraph, displayKey);
31044
+ const [e, s2] = graph.extend(drawableSubgraph, displayKey);
31359
31045
  if (e === void 0) throw new Error(`Could not extend subgraph "${key}" due to missing entrypoint.`);
31360
- if (s !== void 0) startNodes[displayKey] = {
31361
- name: _nodeDataStr(s.id, s.data),
31362
- ...s
31046
+ if (s2 !== void 0) startNodes[displayKey] = {
31047
+ name: _nodeDataStr(s2.id, s2.data),
31048
+ ...s2
31363
31049
  };
31364
31050
  endNodes[displayKey] = {
31365
31051
  name: _nodeDataStr(e.id, e.data),
@@ -31408,7 +31094,7 @@ var CompiledGraph = class extends Pregel {
31408
31094
  const startNodes = { [START]: graph.addNode({ schema: any() }, START) };
31409
31095
  const endNodes = {};
31410
31096
  let subgraphs = {};
31411
- if (xray) subgraphs = Object.fromEntries(gatherIteratorSync(this.getSubgraphs()).filter((x2) => isCompiledGraph(x2[1])));
31097
+ if (xray) subgraphs = Object.fromEntries(gatherIteratorSync(this.getSubgraphs()).filter((x) => isCompiledGraph(x[1])));
31412
31098
  function addEdge(start, end, label, conditional = false) {
31413
31099
  if (end === END && endNodes[END] === void 0) endNodes[END] = graph.addNode({ schema: any() }, END);
31414
31100
  return graph.addEdge(startNodes[start], endNodes[end], label !== end ? label : void 0, conditional);
@@ -31442,11 +31128,11 @@ var CompiledGraph = class extends Pregel {
31442
31128
  }
31443
31129
  else return data.name ?? "UnknownSchema";
31444
31130
  };
31445
- const [e, s] = graph.extend(drawableSubgraph, displayKey);
31131
+ const [e, s2] = graph.extend(drawableSubgraph, displayKey);
31446
31132
  if (e === void 0) throw new Error(`Could not extend subgraph "${key}" due to missing entrypoint.`);
31447
- if (s !== void 0) startNodes[displayKey] = {
31448
- name: _nodeDataStr(s.id, s.data),
31449
- ...s
31133
+ if (s2 !== void 0) startNodes[displayKey] = {
31134
+ name: _nodeDataStr(s2.id, s2.data),
31135
+ ...s2
31450
31136
  };
31451
31137
  endNodes[displayKey] = {
31452
31138
  name: _nodeDataStr(e.id, e.data),
@@ -31484,8 +31170,8 @@ var CompiledGraph = class extends Pregel {
31484
31170
  return graph;
31485
31171
  }
31486
31172
  };
31487
- function isCompiledGraph(x2) {
31488
- return typeof x2.attachNode === "function" && typeof x2.attachEdge === "function";
31173
+ function isCompiledGraph(x) {
31174
+ return typeof x.attachNode === "function" && typeof x.attachEdge === "function";
31489
31175
  }
31490
31176
  function _escapeMermaidKeywords(key) {
31491
31177
  if (key === "subgraph") return `"${key}"`;
@@ -32202,8 +31888,8 @@ function applyPluginPrototype(prototype) {
32202
31888
  cache2.add(prototype);
32203
31889
  }
32204
31890
  try {
32205
- applyPluginPrototype(ZodType$1.prototype);
32206
- applyPluginPrototype(ZodType$1.prototype);
31891
+ applyPluginPrototype(ZodType.prototype);
31892
+ applyPluginPrototype(ZodType.prototype);
32207
31893
  } catch (error) {
32208
31894
  throw new Error("Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.", { cause: error });
32209
31895
  }
@@ -32461,7 +32147,7 @@ async function initializeMiddlewareStates(middlewareList, state) {
32461
32147
  Object.assign(middlewareStates, parseResult.data);
32462
32148
  continue;
32463
32149
  }
32464
- const requiredFields = parseResult.error.issues.filter((issue2) => issue2.code === "invalid_type" && issue2.message === "Required").map((issue2) => ` - ${issue2.path.join(".")}: ${issue2.message}`).join("\n");
32150
+ const requiredFields = parseResult.error.issues.filter((issue) => issue.code === "invalid_type" && issue.message === "Required").map((issue) => ` - ${issue.path.join(".")}: ${issue.message}`).join("\n");
32465
32151
  throw new Error(`Middleware "${middleware.name}" has required state fields that must be initialized:
32466
32152
  ${requiredFields}
32467
32153
 
@@ -32691,9 +32377,9 @@ var AgentNode = class extends RunnableCallable2 {
32691
32377
  };
32692
32378
  const handlerWithValidation = async (req) => {
32693
32379
  const modifiedTools = req.tools ?? [];
32694
- const newTools = modifiedTools.filter((tool2) => isClientTool(tool2) && !this.#options.toolClasses.some((t) => t.name === tool2.name));
32380
+ const newTools = modifiedTools.filter((tool2) => isClientTool(tool2) && !this.#options.toolClasses.some((t2) => t2.name === tool2.name));
32695
32381
  if (newTools.length > 0) throw new Error(`You have added a new tool in "wrapModelCall" hook of middleware "${currentMiddleware.name}": ${newTools.map((tool2) => tool2.name).join(", ")}. This is not supported.`);
32696
- const invalidTools = modifiedTools.filter((tool2) => isClientTool(tool2) && this.#options.toolClasses.every((t) => t !== tool2));
32382
+ const invalidTools = modifiedTools.filter((tool2) => isClientTool(tool2) && this.#options.toolClasses.every((t2) => t2 !== tool2));
32697
32383
  if (invalidTools.length > 0) throw new Error(`You have modified a tool in "wrapModelCall" hook of middleware "${currentMiddleware.name}": ${invalidTools.map((tool2) => tool2.name).join(", ")}. This is not supported.`);
32698
32384
  return innerHandler(req);
32699
32385
  };
@@ -32940,7 +32626,7 @@ var ToolNode = class extends RunnableCallable2 {
32940
32626
  interrupt: lgConfig?.interrupt,
32941
32627
  signal: lgConfig?.signal
32942
32628
  };
32943
- const tool$1 = this.tools.find((t) => t.name === call2.name);
32629
+ const tool$1 = this.tools.find((t2) => t2.name === call2.name);
32944
32630
  if (!tool$1) throw new Error(`Tool "${call2.name}" not found.`);
32945
32631
  const request = {
32946
32632
  toolCall: call2,
@@ -32995,8 +32681,8 @@ var ToolNode = class extends RunnableCallable2 {
32995
32681
  return combinedOutputs;
32996
32682
  }
32997
32683
  };
32998
- function isSend(x2) {
32999
- return x2 instanceof Send;
32684
+ function isSend(x) {
32685
+ return x instanceof Send;
33000
32686
  }
33001
32687
  var AgentContext = class {
33002
32688
  };
@@ -33295,7 +32981,7 @@ var ReactAgent = class {
33295
32981
  const nextDefault = isLast ? loopEntryNode : beforeAgentNodes[i + 1].name;
33296
32982
  if (node.allowed && node.allowed.length > 0) {
33297
32983
  const hasTools = toolClasses.filter(isClientTool).length > 0;
33298
- const allowedMapped = node.allowed.map((t) => parseJumpToTarget(t)).filter((dest) => dest !== "tools" || hasTools);
32984
+ const allowedMapped = node.allowed.map((t2) => parseJumpToTarget(t2)).filter((dest) => dest !== "tools" || hasTools);
33299
32985
  const destinations = Array.from(/* @__PURE__ */ new Set([nextDefault, ...allowedMapped.map((dest) => dest === END ? exitNode : dest)]));
33300
32986
  allNodeWorkflows.addConditionalEdges(current, this.#createBeforeAgentRouter(toolClasses.filter(isClientTool), nextDefault, exitNode), destinations);
33301
32987
  } else allNodeWorkflows.addEdge(current, nextDefault);
@@ -33307,7 +32993,7 @@ var ReactAgent = class {
33307
32993
  const nextDefault = isLast ? "model_request" : beforeModelNodes[i + 1].name;
33308
32994
  if (node.allowed && node.allowed.length > 0) {
33309
32995
  const hasTools = toolClasses.filter(isClientTool).length > 0;
33310
- const allowedMapped = node.allowed.map((t) => parseJumpToTarget(t)).filter((dest) => dest !== "tools" || hasTools);
32996
+ const allowedMapped = node.allowed.map((t2) => parseJumpToTarget(t2)).filter((dest) => dest !== "tools" || hasTools);
33311
32997
  const destinations = Array.from(/* @__PURE__ */ new Set([nextDefault, ...allowedMapped]));
33312
32998
  allNodeWorkflows.addConditionalEdges(current, this.#createBeforeModelRouter(toolClasses.filter(isClientTool), nextDefault), destinations);
33313
32999
  } else allNodeWorkflows.addEdge(current, nextDefault);
@@ -33326,7 +33012,7 @@ var ReactAgent = class {
33326
33012
  const nextDefault = afterModelNodes[i - 1].name;
33327
33013
  if (node.allowed && node.allowed.length > 0) {
33328
33014
  const hasTools = toolClasses.filter(isClientTool).length > 0;
33329
- const allowedMapped = node.allowed.map((t) => parseJumpToTarget(t)).filter((dest) => dest !== "tools" || hasTools);
33015
+ const allowedMapped = node.allowed.map((t2) => parseJumpToTarget(t2)).filter((dest) => dest !== "tools" || hasTools);
33330
33016
  const destinations = Array.from(/* @__PURE__ */ new Set([nextDefault, ...allowedMapped]));
33331
33017
  allNodeWorkflows.addConditionalEdges(current, this.#createAfterModelSequenceRouter(toolClasses.filter(isClientTool), node.allowed, nextDefault), destinations);
33332
33018
  } else allNodeWorkflows.addEdge(current, nextDefault);
@@ -33345,7 +33031,7 @@ var ReactAgent = class {
33345
33031
  const nextDefault = afterAgentNodes[i - 1].name;
33346
33032
  if (node.allowed && node.allowed.length > 0) {
33347
33033
  const hasTools = toolClasses.filter(isClientTool).length > 0;
33348
- const allowedMapped = node.allowed.map((t) => parseJumpToTarget(t)).filter((dest) => dest !== "tools" || hasTools);
33034
+ const allowedMapped = node.allowed.map((t2) => parseJumpToTarget(t2)).filter((dest) => dest !== "tools" || hasTools);
33349
33035
  const destinations = Array.from(/* @__PURE__ */ new Set([nextDefault, ...allowedMapped]));
33350
33036
  allNodeWorkflows.addConditionalEdges(current, this.#createAfterModelSequenceRouter(toolClasses.filter(isClientTool), node.allowed, nextDefault), destinations);
33351
33037
  } else allNodeWorkflows.addEdge(current, nextDefault);
@@ -33355,7 +33041,7 @@ var ReactAgent = class {
33355
33041
  const firstAfterAgentNode = firstAfterAgent.name;
33356
33042
  if (firstAfterAgent.allowed && firstAfterAgent.allowed.length > 0) {
33357
33043
  const hasTools = toolClasses.filter(isClientTool).length > 0;
33358
- const allowedMapped = firstAfterAgent.allowed.map((t) => parseJumpToTarget(t)).filter((dest) => dest !== "tools" || hasTools);
33044
+ const allowedMapped = firstAfterAgent.allowed.map((t2) => parseJumpToTarget(t2)).filter((dest) => dest !== "tools" || hasTools);
33359
33045
  const destinations = Array.from(/* @__PURE__ */ new Set([END, ...allowedMapped]));
33360
33046
  allNodeWorkflows.addConditionalEdges(firstAfterAgentNode, this.#createAfterModelSequenceRouter(toolClasses.filter(isClientTool), firstAfterAgent.allowed, END), destinations);
33361
33047
  } else allNodeWorkflows.addEdge(firstAfterAgentNode, END);
@@ -33477,7 +33163,7 @@ var ReactAgent = class {
33477
33163
  * honoring allowed jump targets and defaulting to the next node.
33478
33164
  */
33479
33165
  #createAfterModelSequenceRouter(toolClasses, allowed, nextDefault) {
33480
- const allowedSet = new Set(allowed.map((t) => parseJumpToTarget(t)));
33166
+ const allowedSet = new Set(allowed.map((t2) => parseJumpToTarget(t2)));
33481
33167
  return (state) => {
33482
33168
  if (state.jumpTo) {
33483
33169
  const dest = parseJumpToTarget(state.jumpTo);
@@ -33839,7 +33525,7 @@ function summarizationMiddleware(options) {
33839
33525
  let triggerConditions = [];
33840
33526
  if (resolvedTrigger === void 0) triggerConditions = [];
33841
33527
  else if (Array.isArray(resolvedTrigger))
33842
- triggerConditions = resolvedTrigger.map((t) => contextSizeSchema.parse(t));
33528
+ triggerConditions = resolvedTrigger.map((t2) => contextSizeSchema.parse(t2));
33843
33529
  else
33844
33530
  triggerConditions = [contextSizeSchema.parse(resolvedTrigger)];
33845
33531
  const requiresProfile = triggerConditions.some((c) => "fraction" in c) || "fraction" in validatedKeep;
@@ -35323,7 +35009,7 @@ var BaseAdapter = (_a = class {
35323
35009
  }
35324
35010
  this.connectorToolMap.set(connector, connectorTools);
35325
35011
  logger.debug(
35326
- `Loaded ${connectorTools.length} new tools for connector: ${connectorTools.map((t) => t?.name ?? String(t)).join(", ")}`
35012
+ `Loaded ${connectorTools.length} new tools for connector: ${connectorTools.map((t2) => t2?.name ?? String(t2)).join(", ")}`
35327
35013
  );
35328
35014
  return connectorTools;
35329
35015
  }
@@ -35481,7 +35167,7 @@ var AddMCPServerFromConfigTool = (_e = class extends StructuredTool {
35481
35167
  result += ` Session created and connected. '${serverName}' is now the active server with ${numTools} tools available.`;
35482
35168
  result += `
35483
35169
 
35484
- ${tools.map((t) => t.name).join("\n")}`;
35170
+ ${tools.map((t2) => t2.name).join("\n")}`;
35485
35171
  logger.info(result);
35486
35172
  return result;
35487
35173
  } catch (e) {
@@ -37259,8 +36945,8 @@ var MCPAgent = (_p = class {
37259
36945
  }
37260
36946
  if (this.useServerManager && this.serverManager) {
37261
36947
  const currentTools = this.serverManager.tools;
37262
- const currentToolNames = new Set(currentTools.map((t) => t.name));
37263
- const existingToolNames = new Set(this._tools.map((t) => t.name));
36948
+ const currentToolNames = new Set(currentTools.map((t2) => t2.name));
36949
+ const existingToolNames = new Set(this._tools.map((t2) => t2.name));
37264
36950
  if (currentToolNames.size !== existingToolNames.size || [...currentToolNames].some((n2) => !existingToolNames.has(n2))) {
37265
36951
  logger.info(
37266
36952
  `🔄 Tools changed before execution, updating agent. New tools: ${[...currentToolNames].join(", ")}`
@@ -37356,10 +37042,10 @@ var MCPAgent = (_p = class {
37356
37042
  if (this.useServerManager && this.serverManager) {
37357
37043
  const currentTools = this.serverManager.tools;
37358
37044
  const currentToolNames = new Set(
37359
- currentTools.map((t) => t.name)
37045
+ currentTools.map((t2) => t2.name)
37360
37046
  );
37361
37047
  const existingToolNames = new Set(
37362
- this._tools.map((t) => t.name)
37048
+ this._tools.map((t2) => t2.name)
37363
37049
  );
37364
37050
  if (currentToolNames.size !== existingToolNames.size || [...currentToolNames].some(
37365
37051
  (n2) => !existingToolNames.has(n2)
@@ -37470,7 +37156,7 @@ var MCPAgent = (_p = class {
37470
37156
  (connector) => connector.publicIdentifier
37471
37157
  ),
37472
37158
  totalToolsAvailable: toolsAvailable.length,
37473
- toolsAvailableNames: toolsAvailable.map((t) => t.name),
37159
+ toolsAvailableNames: toolsAvailable.map((t2) => t2.name),
37474
37160
  maxStepsConfigured: this.maxSteps,
37475
37161
  memoryEnabled: this.memoryEnabled,
37476
37162
  useServerManager: this.useServerManager,
@@ -37536,7 +37222,7 @@ var MCPAgent = (_p = class {
37536
37222
  */
37537
37223
  async *prettyStreamEvents(query, maxSteps, manageConnector = true, externalHistory, outputSchema) {
37538
37224
  const { prettyStreamEvents: prettyStream } = await __vitePreload(async () => {
37539
- const { prettyStreamEvents: prettyStream2 } = await import("./display-YIYC6WJE-BgL49xvx.js");
37225
+ const { prettyStreamEvents: prettyStream2 } = await import("./display-YIYC6WJE-oHQhi5o4.js");
37540
37226
  return { prettyStreamEvents: prettyStream2 };
37541
37227
  }, true ? __vite__mapDeps([0,1,2]) : void 0);
37542
37228
  const finalResponse = "";
@@ -37745,7 +37431,7 @@ var MCPAgent = (_p = class {
37745
37431
  (connector) => connector.publicIdentifier
37746
37432
  ),
37747
37433
  totalToolsAvailable: this._tools.length,
37748
- toolsAvailableNames: this._tools.map((t) => t.name),
37434
+ toolsAvailableNames: this._tools.map((t2) => t2.name),
37749
37435
  maxStepsConfigured: this.maxSteps,
37750
37436
  memoryEnabled: this.memoryEnabled,
37751
37437
  useServerManager: this.useServerManager,
@@ -38193,19 +37879,19 @@ const langfuseC4HKZ3NL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
38193
37879
  export {
38194
37880
  BaseAdapter,
38195
37881
  B as BaseConnector,
38196
- x as BrowserOAuthClientProvider,
37882
+ s as BrowserOAuthClientProvider,
38197
37883
  H as HttpConnector,
38198
37884
  LangChainAdapter,
38199
37885
  L as Logger,
38200
37886
  MCPAgent,
38201
- y as MCPClient,
37887
+ t as MCPClient,
38202
37888
  M as MCPSession,
38203
37889
  ObservabilityManager,
38204
37890
  RemoteAgent,
38205
37891
  W as WebSocketConnector,
38206
37892
  createReadableStreamFromGenerator,
38207
37893
  logger,
38208
- z as onMcpAuthorization,
37894
+ u as onMcpAuthorization,
38209
37895
  streamEventsToAISDK,
38210
37896
  streamEventsToAISDKWithTools
38211
37897
  };