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