@d5render/cli 0.1.56 → 0.1.58
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/.github/instructions/severity.instructions.md +34 -19
- package/.skills/code-review/SKILL.md +35 -6
- package/.skills/devops/{README.md → SKILL.md} +21 -15
- package/README.md +30 -2
- package/bin/d5cli +210 -314
- package/bin/{copilot.js → mcpServer.js} +964 -927
- package/package.json +26 -23
- package/.github/instructions/code-review.instructions.md +0 -43
- package/CHANGELOG.md +0 -10
|
@@ -2,7 +2,7 @@ import process$1, { argv } from "node:process";
|
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
6
|
var __create = Object.create;
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -30,53 +30,53 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
}) : target, mod));
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
33
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/util.js
|
|
34
34
|
var util;
|
|
35
|
-
(function(util
|
|
36
|
-
util
|
|
35
|
+
(function(util) {
|
|
36
|
+
util.assertEqual = (_) => {};
|
|
37
37
|
function assertIs(_arg) {}
|
|
38
|
-
util
|
|
38
|
+
util.assertIs = assertIs;
|
|
39
39
|
function assertNever(_x) {
|
|
40
40
|
throw new Error();
|
|
41
41
|
}
|
|
42
|
-
util
|
|
43
|
-
util
|
|
42
|
+
util.assertNever = assertNever;
|
|
43
|
+
util.arrayToEnum = (items) => {
|
|
44
44
|
const obj = {};
|
|
45
45
|
for (const item of items) obj[item] = item;
|
|
46
46
|
return obj;
|
|
47
47
|
};
|
|
48
|
-
util
|
|
49
|
-
const validKeys = util
|
|
48
|
+
util.getValidEnumValues = (obj) => {
|
|
49
|
+
const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
50
50
|
const filtered = {};
|
|
51
51
|
for (const k of validKeys) filtered[k] = obj[k];
|
|
52
|
-
return util
|
|
52
|
+
return util.objectValues(filtered);
|
|
53
53
|
};
|
|
54
|
-
util
|
|
55
|
-
return util
|
|
54
|
+
util.objectValues = (obj) => {
|
|
55
|
+
return util.objectKeys(obj).map(function(e) {
|
|
56
56
|
return obj[e];
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
util
|
|
59
|
+
util.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
60
60
|
const keys = [];
|
|
61
|
-
for (const key in object
|
|
61
|
+
for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key)) keys.push(key);
|
|
62
62
|
return keys;
|
|
63
63
|
};
|
|
64
|
-
util
|
|
64
|
+
util.find = (arr, checker) => {
|
|
65
65
|
for (const item of arr) if (checker(item)) return item;
|
|
66
66
|
};
|
|
67
|
-
util
|
|
68
|
-
function joinValues(array
|
|
69
|
-
return array
|
|
67
|
+
util.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
68
|
+
function joinValues(array, separator = " | ") {
|
|
69
|
+
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
70
70
|
}
|
|
71
|
-
util
|
|
72
|
-
util
|
|
71
|
+
util.joinValues = joinValues;
|
|
72
|
+
util.jsonStringifyReplacer = (_, value) => {
|
|
73
73
|
if (typeof value === "bigint") return value.toString();
|
|
74
74
|
return value;
|
|
75
75
|
};
|
|
76
76
|
})(util || (util = {}));
|
|
77
77
|
var objectUtil;
|
|
78
|
-
(function(objectUtil
|
|
79
|
-
objectUtil
|
|
78
|
+
(function(objectUtil) {
|
|
79
|
+
objectUtil.mergeShapes = (first, second) => {
|
|
80
80
|
return {
|
|
81
81
|
...first,
|
|
82
82
|
...second
|
|
@@ -127,7 +127,7 @@ const getParsedType = (data) => {
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
//#endregion
|
|
130
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
130
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/ZodError.js
|
|
131
131
|
const ZodIssueCode = util.arrayToEnum([
|
|
132
132
|
"invalid_type",
|
|
133
133
|
"invalid_literal",
|
|
@@ -166,24 +166,24 @@ var ZodError$1 = class ZodError$1 extends Error {
|
|
|
166
166
|
this.issues = issues;
|
|
167
167
|
}
|
|
168
168
|
format(_mapper) {
|
|
169
|
-
const mapper = _mapper || function(issue
|
|
170
|
-
return issue
|
|
169
|
+
const mapper = _mapper || function(issue) {
|
|
170
|
+
return issue.message;
|
|
171
171
|
};
|
|
172
172
|
const fieldErrors = { _errors: [] };
|
|
173
173
|
const processError = (error) => {
|
|
174
|
-
for (const issue
|
|
175
|
-
else if (issue
|
|
176
|
-
else if (issue
|
|
177
|
-
else if (issue
|
|
174
|
+
for (const issue of error.issues) if (issue.code === "invalid_union") issue.unionErrors.map(processError);
|
|
175
|
+
else if (issue.code === "invalid_return_type") processError(issue.returnTypeError);
|
|
176
|
+
else if (issue.code === "invalid_arguments") processError(issue.argumentsError);
|
|
177
|
+
else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
|
|
178
178
|
else {
|
|
179
179
|
let curr = fieldErrors;
|
|
180
180
|
let i = 0;
|
|
181
|
-
while (i < issue
|
|
182
|
-
const el = issue
|
|
183
|
-
if (!(i === issue
|
|
181
|
+
while (i < issue.path.length) {
|
|
182
|
+
const el = issue.path[i];
|
|
183
|
+
if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
|
|
184
184
|
else {
|
|
185
185
|
curr[el] = curr[el] || { _errors: [] };
|
|
186
|
-
curr[el]._errors.push(mapper(issue
|
|
186
|
+
curr[el]._errors.push(mapper(issue));
|
|
187
187
|
}
|
|
188
188
|
curr = curr[el];
|
|
189
189
|
i++;
|
|
@@ -205,7 +205,7 @@ var ZodError$1 = class ZodError$1 extends Error {
|
|
|
205
205
|
get isEmpty() {
|
|
206
206
|
return this.issues.length === 0;
|
|
207
207
|
}
|
|
208
|
-
flatten(mapper = (issue
|
|
208
|
+
flatten(mapper = (issue) => issue.message) {
|
|
209
209
|
const fieldErrors = Object.create(null);
|
|
210
210
|
const formErrors = [];
|
|
211
211
|
for (const sub of this.issues) if (sub.path.length > 0) {
|
|
@@ -227,28 +227,28 @@ ZodError$1.create = (issues) => {
|
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
//#endregion
|
|
230
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
231
|
-
const errorMap = (issue
|
|
230
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/locales/en.js
|
|
231
|
+
const errorMap = (issue, _ctx) => {
|
|
232
232
|
let message;
|
|
233
|
-
switch (issue
|
|
233
|
+
switch (issue.code) {
|
|
234
234
|
case ZodIssueCode.invalid_type:
|
|
235
|
-
if (issue
|
|
236
|
-
else message = `Expected ${issue
|
|
235
|
+
if (issue.received === ZodParsedType.undefined) message = "Required";
|
|
236
|
+
else message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
237
237
|
break;
|
|
238
238
|
case ZodIssueCode.invalid_literal:
|
|
239
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue
|
|
239
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
|
|
240
240
|
break;
|
|
241
241
|
case ZodIssueCode.unrecognized_keys:
|
|
242
|
-
message = `Unrecognized key(s) in object: ${util.joinValues(issue
|
|
242
|
+
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
|
|
243
243
|
break;
|
|
244
244
|
case ZodIssueCode.invalid_union:
|
|
245
245
|
message = `Invalid input`;
|
|
246
246
|
break;
|
|
247
247
|
case ZodIssueCode.invalid_union_discriminator:
|
|
248
|
-
message = `Invalid discriminator value. Expected ${util.joinValues(issue
|
|
248
|
+
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
|
249
249
|
break;
|
|
250
250
|
case ZodIssueCode.invalid_enum_value:
|
|
251
|
-
message = `Invalid enum value. Expected ${util.joinValues(issue
|
|
251
|
+
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
252
252
|
break;
|
|
253
253
|
case ZodIssueCode.invalid_arguments:
|
|
254
254
|
message = `Invalid function arguments`;
|
|
@@ -260,29 +260,29 @@ const errorMap = (issue$1, _ctx) => {
|
|
|
260
260
|
message = `Invalid date`;
|
|
261
261
|
break;
|
|
262
262
|
case ZodIssueCode.invalid_string:
|
|
263
|
-
if (typeof issue
|
|
264
|
-
message = `Invalid input: must include "${issue
|
|
265
|
-
if (typeof issue
|
|
266
|
-
} else if ("startsWith" in issue
|
|
267
|
-
else if ("endsWith" in issue
|
|
268
|
-
else util.assertNever(issue
|
|
269
|
-
else if (issue
|
|
263
|
+
if (typeof issue.validation === "object") if ("includes" in issue.validation) {
|
|
264
|
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
|
265
|
+
if (typeof issue.validation.position === "number") message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
|
266
|
+
} else if ("startsWith" in issue.validation) message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
267
|
+
else if ("endsWith" in issue.validation) message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
268
|
+
else util.assertNever(issue.validation);
|
|
269
|
+
else if (issue.validation !== "regex") message = `Invalid ${issue.validation}`;
|
|
270
270
|
else message = "Invalid";
|
|
271
271
|
break;
|
|
272
272
|
case ZodIssueCode.too_small:
|
|
273
|
-
if (issue
|
|
274
|
-
else if (issue
|
|
275
|
-
else if (issue
|
|
276
|
-
else if (issue
|
|
277
|
-
else if (issue
|
|
273
|
+
if (issue.type === "array") message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
274
|
+
else if (issue.type === "string") message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
275
|
+
else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
276
|
+
else if (issue.type === "bigint") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
277
|
+
else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
278
278
|
else message = "Invalid input";
|
|
279
279
|
break;
|
|
280
280
|
case ZodIssueCode.too_big:
|
|
281
|
-
if (issue
|
|
282
|
-
else if (issue
|
|
283
|
-
else if (issue
|
|
284
|
-
else if (issue
|
|
285
|
-
else if (issue
|
|
281
|
+
if (issue.type === "array") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
282
|
+
else if (issue.type === "string") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
283
|
+
else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
284
|
+
else if (issue.type === "bigint") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
285
|
+
else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
|
286
286
|
else message = "Invalid input";
|
|
287
287
|
break;
|
|
288
288
|
case ZodIssueCode.custom:
|
|
@@ -292,28 +292,28 @@ const errorMap = (issue$1, _ctx) => {
|
|
|
292
292
|
message = `Intersection results could not be merged`;
|
|
293
293
|
break;
|
|
294
294
|
case ZodIssueCode.not_multiple_of:
|
|
295
|
-
message = `Number must be a multiple of ${issue
|
|
295
|
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
296
296
|
break;
|
|
297
297
|
case ZodIssueCode.not_finite:
|
|
298
298
|
message = "Number must be finite";
|
|
299
299
|
break;
|
|
300
300
|
default:
|
|
301
301
|
message = _ctx.defaultError;
|
|
302
|
-
util.assertNever(issue
|
|
302
|
+
util.assertNever(issue);
|
|
303
303
|
}
|
|
304
304
|
return { message };
|
|
305
305
|
};
|
|
306
306
|
var en_default = errorMap;
|
|
307
307
|
|
|
308
308
|
//#endregion
|
|
309
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
309
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/errors.js
|
|
310
310
|
let overrideErrorMap = en_default;
|
|
311
311
|
function getErrorMap() {
|
|
312
312
|
return overrideErrorMap;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
//#endregion
|
|
316
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
316
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.js
|
|
317
317
|
const makeIssue = (params) => {
|
|
318
318
|
const { data, path, errorMaps, issueData } = params;
|
|
319
319
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -340,7 +340,7 @@ const makeIssue = (params) => {
|
|
|
340
340
|
};
|
|
341
341
|
function addIssueToContext(ctx, issueData) {
|
|
342
342
|
const overrideMap = getErrorMap();
|
|
343
|
-
const issue
|
|
343
|
+
const issue = makeIssue({
|
|
344
344
|
issueData,
|
|
345
345
|
data: ctx.data,
|
|
346
346
|
path: ctx.path,
|
|
@@ -351,7 +351,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
351
351
|
overrideMap === en_default ? void 0 : en_default
|
|
352
352
|
].filter((x) => !!x)
|
|
353
353
|
});
|
|
354
|
-
ctx.common.issues.push(issue
|
|
354
|
+
ctx.common.issues.push(issue);
|
|
355
355
|
}
|
|
356
356
|
var ParseStatus = class ParseStatus {
|
|
357
357
|
constructor() {
|
|
@@ -418,15 +418,15 @@ const isValid = (x) => x.status === "valid";
|
|
|
418
418
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
419
419
|
|
|
420
420
|
//#endregion
|
|
421
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
421
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/errorUtil.js
|
|
422
422
|
var errorUtil;
|
|
423
|
-
(function(errorUtil
|
|
424
|
-
errorUtil
|
|
425
|
-
errorUtil
|
|
423
|
+
(function(errorUtil) {
|
|
424
|
+
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
425
|
+
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
426
426
|
})(errorUtil || (errorUtil = {}));
|
|
427
427
|
|
|
428
428
|
//#endregion
|
|
429
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
429
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.js
|
|
430
430
|
var ParseInputLazyPath = class {
|
|
431
431
|
constructor(parent, value, path, key) {
|
|
432
432
|
this._cachedPath = [];
|
|
@@ -460,10 +460,10 @@ const handleResult = (ctx, result) => {
|
|
|
460
460
|
};
|
|
461
461
|
function processCreateParams(params) {
|
|
462
462
|
if (!params) return {};
|
|
463
|
-
const { errorMap
|
|
464
|
-
if (errorMap
|
|
465
|
-
if (errorMap
|
|
466
|
-
errorMap
|
|
463
|
+
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
464
|
+
if (errorMap && (invalid_type_error || required_error)) throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
465
|
+
if (errorMap) return {
|
|
466
|
+
errorMap,
|
|
467
467
|
description
|
|
468
468
|
};
|
|
469
469
|
const customMap = (iss, ctx) => {
|
|
@@ -698,14 +698,14 @@ var ZodType$1 = class {
|
|
|
698
698
|
and(incoming) {
|
|
699
699
|
return ZodIntersection$1.create(this, incoming, this._def);
|
|
700
700
|
}
|
|
701
|
-
transform(transform
|
|
701
|
+
transform(transform) {
|
|
702
702
|
return new ZodEffects({
|
|
703
703
|
...processCreateParams(this._def),
|
|
704
704
|
schema: this,
|
|
705
705
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
706
706
|
effect: {
|
|
707
707
|
type: "transform",
|
|
708
|
-
transform
|
|
708
|
+
transform
|
|
709
709
|
}
|
|
710
710
|
});
|
|
711
711
|
}
|
|
@@ -771,7 +771,7 @@ const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1
|
|
|
771
771
|
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
772
772
|
const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
773
773
|
const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
774
|
-
const dateRegex =
|
|
774
|
+
const dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
775
775
|
function timeRegexSource(args) {
|
|
776
776
|
let secondsRegexSource = `[0-5]\\d`;
|
|
777
777
|
if (args.precision) secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
@@ -780,7 +780,7 @@ function timeRegexSource(args) {
|
|
|
780
780
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
781
781
|
}
|
|
782
782
|
function timeRegex(args) {
|
|
783
|
-
return
|
|
783
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
784
784
|
}
|
|
785
785
|
function datetimeRegex(args) {
|
|
786
786
|
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
@@ -788,11 +788,11 @@ function datetimeRegex(args) {
|
|
|
788
788
|
opts.push(args.local ? `Z?` : `Z`);
|
|
789
789
|
if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
790
790
|
regex = `${regex}(${opts.join("|")})`;
|
|
791
|
-
return
|
|
791
|
+
return new RegExp(`^${regex}$`);
|
|
792
792
|
}
|
|
793
|
-
function isValidIP(ip, version
|
|
794
|
-
if ((version
|
|
795
|
-
if ((version
|
|
793
|
+
function isValidIP(ip, version) {
|
|
794
|
+
if ((version === "v4" || !version) && ipv4Regex.test(ip)) return true;
|
|
795
|
+
if ((version === "v6" || !version) && ipv6Regex.test(ip)) return true;
|
|
796
796
|
return false;
|
|
797
797
|
}
|
|
798
798
|
function isValidJWT$1(jwt, alg) {
|
|
@@ -800,8 +800,8 @@ function isValidJWT$1(jwt, alg) {
|
|
|
800
800
|
try {
|
|
801
801
|
const [header] = jwt.split(".");
|
|
802
802
|
if (!header) return false;
|
|
803
|
-
const base64
|
|
804
|
-
const decoded = JSON.parse(atob(base64
|
|
803
|
+
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
804
|
+
const decoded = JSON.parse(atob(base64));
|
|
805
805
|
if (typeof decoded !== "object" || decoded === null) return false;
|
|
806
806
|
if ("typ" in decoded && decoded?.typ !== "JWT") return false;
|
|
807
807
|
if (!decoded.alg) return false;
|
|
@@ -811,20 +811,20 @@ function isValidJWT$1(jwt, alg) {
|
|
|
811
811
|
return false;
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
function isValidCidr(ip, version
|
|
815
|
-
if ((version
|
|
816
|
-
if ((version
|
|
814
|
+
function isValidCidr(ip, version) {
|
|
815
|
+
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) return true;
|
|
816
|
+
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) return true;
|
|
817
817
|
return false;
|
|
818
818
|
}
|
|
819
819
|
var ZodString$1 = class ZodString$1 extends ZodType$1 {
|
|
820
820
|
_parse(input) {
|
|
821
821
|
if (this._def.coerce) input.data = String(input.data);
|
|
822
822
|
if (this._getType(input) !== ZodParsedType.string) {
|
|
823
|
-
const ctx
|
|
824
|
-
addIssueToContext(ctx
|
|
823
|
+
const ctx = this._getOrReturnCtx(input);
|
|
824
|
+
addIssueToContext(ctx, {
|
|
825
825
|
code: ZodIssueCode.invalid_type,
|
|
826
826
|
expected: ZodParsedType.string,
|
|
827
|
-
received: ctx
|
|
827
|
+
received: ctx.parsedType
|
|
828
828
|
});
|
|
829
829
|
return INVALID;
|
|
830
830
|
}
|
|
@@ -1396,11 +1396,11 @@ var ZodNumber$1 = class ZodNumber$1 extends ZodType$1 {
|
|
|
1396
1396
|
_parse(input) {
|
|
1397
1397
|
if (this._def.coerce) input.data = Number(input.data);
|
|
1398
1398
|
if (this._getType(input) !== ZodParsedType.number) {
|
|
1399
|
-
const ctx
|
|
1400
|
-
addIssueToContext(ctx
|
|
1399
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1400
|
+
addIssueToContext(ctx, {
|
|
1401
1401
|
code: ZodIssueCode.invalid_type,
|
|
1402
1402
|
expected: ZodParsedType.number,
|
|
1403
|
-
received: ctx
|
|
1403
|
+
received: ctx.parsedType
|
|
1404
1404
|
});
|
|
1405
1405
|
return INVALID;
|
|
1406
1406
|
}
|
|
@@ -1779,11 +1779,11 @@ var ZodDate = class ZodDate extends ZodType$1 {
|
|
|
1779
1779
|
_parse(input) {
|
|
1780
1780
|
if (this._def.coerce) input.data = new Date(input.data);
|
|
1781
1781
|
if (this._getType(input) !== ZodParsedType.date) {
|
|
1782
|
-
const ctx
|
|
1783
|
-
addIssueToContext(ctx
|
|
1782
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1783
|
+
addIssueToContext(ctx, {
|
|
1784
1784
|
code: ZodIssueCode.invalid_type,
|
|
1785
1785
|
expected: ZodParsedType.date,
|
|
1786
|
-
received: ctx
|
|
1786
|
+
received: ctx.parsedType
|
|
1787
1787
|
});
|
|
1788
1788
|
return INVALID;
|
|
1789
1789
|
}
|
|
@@ -2051,8 +2051,8 @@ var ZodArray$1 = class ZodArray$1 extends ZodType$1 {
|
|
|
2051
2051
|
}
|
|
2052
2052
|
if (ctx.common.async) return Promise.all([...ctx.data].map((item, i) => {
|
|
2053
2053
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
2054
|
-
})).then((result
|
|
2055
|
-
return ParseStatus.mergeArray(status, result
|
|
2054
|
+
})).then((result) => {
|
|
2055
|
+
return ParseStatus.mergeArray(status, result);
|
|
2056
2056
|
});
|
|
2057
2057
|
const result = [...ctx.data].map((item, i) => {
|
|
2058
2058
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
@@ -2148,11 +2148,11 @@ var ZodObject$1 = class ZodObject$1 extends ZodType$1 {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
_parse(input) {
|
|
2150
2150
|
if (this._getType(input) !== ZodParsedType.object) {
|
|
2151
|
-
const ctx
|
|
2152
|
-
addIssueToContext(ctx
|
|
2151
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2152
|
+
addIssueToContext(ctx, {
|
|
2153
2153
|
code: ZodIssueCode.invalid_type,
|
|
2154
2154
|
expected: ZodParsedType.object,
|
|
2155
|
-
received: ctx
|
|
2155
|
+
received: ctx.parsedType
|
|
2156
2156
|
});
|
|
2157
2157
|
return INVALID;
|
|
2158
2158
|
}
|
|
@@ -2235,9 +2235,9 @@ var ZodObject$1 = class ZodObject$1 extends ZodType$1 {
|
|
|
2235
2235
|
return new ZodObject$1({
|
|
2236
2236
|
...this._def,
|
|
2237
2237
|
unknownKeys: "strict",
|
|
2238
|
-
...message !== void 0 ? { errorMap: (issue
|
|
2239
|
-
const defaultError = this._def.errorMap?.(issue
|
|
2240
|
-
if (issue
|
|
2238
|
+
...message !== void 0 ? { errorMap: (issue, ctx) => {
|
|
2239
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
2240
|
+
if (issue.code === "unrecognized_keys") return { message: errorUtil.errToObj(message).message ?? defaultError };
|
|
2241
2241
|
return { message: defaultError };
|
|
2242
2242
|
} } : {}
|
|
2243
2243
|
});
|
|
@@ -2429,7 +2429,7 @@ var ZodUnion$1 = class extends ZodType$1 {
|
|
|
2429
2429
|
ctx.common.issues.push(...dirty.ctx.common.issues);
|
|
2430
2430
|
return dirty.result;
|
|
2431
2431
|
}
|
|
2432
|
-
const unionErrors = issues.map((issues
|
|
2432
|
+
const unionErrors = issues.map((issues) => new ZodError$1(issues));
|
|
2433
2433
|
addIssueToContext(ctx, {
|
|
2434
2434
|
code: ZodIssueCode.invalid_union,
|
|
2435
2435
|
unionErrors
|
|
@@ -2829,9 +2829,9 @@ var ZodSet = class ZodSet extends ZodType$1 {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
}
|
|
2831
2831
|
const valueType = this._def.valueType;
|
|
2832
|
-
function finalizeSet(elements
|
|
2832
|
+
function finalizeSet(elements) {
|
|
2833
2833
|
const parsedSet = /* @__PURE__ */ new Set();
|
|
2834
|
-
for (const element of elements
|
|
2834
|
+
for (const element of elements) {
|
|
2835
2835
|
if (element.status === "aborted") return INVALID;
|
|
2836
2836
|
if (element.status === "dirty") status.dirty();
|
|
2837
2837
|
parsedSet.add(element.value);
|
|
@@ -2842,7 +2842,7 @@ var ZodSet = class ZodSet extends ZodType$1 {
|
|
|
2842
2842
|
};
|
|
2843
2843
|
}
|
|
2844
2844
|
const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
|
|
2845
|
-
if (ctx.common.async) return Promise.all(elements).then((elements
|
|
2845
|
+
if (ctx.common.async) return Promise.all(elements).then((elements) => finalizeSet(elements));
|
|
2846
2846
|
else return finalizeSet(elements);
|
|
2847
2847
|
}
|
|
2848
2848
|
min(minSize, message) {
|
|
@@ -3186,10 +3186,10 @@ var ZodEffects = class extends ZodType$1 {
|
|
|
3186
3186
|
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
|
3187
3187
|
if (effect.type === "preprocess") {
|
|
3188
3188
|
const processed = effect.transform(ctx.data, checkCtx);
|
|
3189
|
-
if (ctx.common.async) return Promise.resolve(processed).then(async (processed
|
|
3189
|
+
if (ctx.common.async) return Promise.resolve(processed).then(async (processed) => {
|
|
3190
3190
|
if (status.value === "aborted") return INVALID;
|
|
3191
3191
|
const result = await this._def.schema._parseAsync({
|
|
3192
|
-
data: processed
|
|
3192
|
+
data: processed,
|
|
3193
3193
|
path: ctx.path,
|
|
3194
3194
|
parent: ctx
|
|
3195
3195
|
});
|
|
@@ -3281,12 +3281,12 @@ ZodEffects.create = (schema, effect, params) => {
|
|
|
3281
3281
|
...processCreateParams(params)
|
|
3282
3282
|
});
|
|
3283
3283
|
};
|
|
3284
|
-
ZodEffects.createWithPreprocess = (preprocess
|
|
3284
|
+
ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
|
|
3285
3285
|
return new ZodEffects({
|
|
3286
3286
|
schema,
|
|
3287
3287
|
effect: {
|
|
3288
3288
|
type: "preprocess",
|
|
3289
|
-
transform: preprocess
|
|
3289
|
+
transform: preprocess
|
|
3290
3290
|
},
|
|
3291
3291
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
3292
3292
|
...processCreateParams(params)
|
|
@@ -3362,10 +3362,10 @@ var ZodCatch$1 = class extends ZodType$1 {
|
|
|
3362
3362
|
path: newCtx.path,
|
|
3363
3363
|
parent: { ...newCtx }
|
|
3364
3364
|
});
|
|
3365
|
-
if (isAsync(result)) return result.then((result
|
|
3365
|
+
if (isAsync(result)) return result.then((result) => {
|
|
3366
3366
|
return {
|
|
3367
3367
|
status: "valid",
|
|
3368
|
-
value: result
|
|
3368
|
+
value: result.status === "valid" ? result.value : this._def.catchValue({
|
|
3369
3369
|
get error() {
|
|
3370
3370
|
return new ZodError$1(newCtx.common.issues);
|
|
3371
3371
|
},
|
|
@@ -3503,43 +3503,43 @@ ZodReadonly$1.create = (type, params) => {
|
|
|
3503
3503
|
};
|
|
3504
3504
|
const late = { object: ZodObject$1.lazycreate };
|
|
3505
3505
|
var ZodFirstPartyTypeKind;
|
|
3506
|
-
(function(ZodFirstPartyTypeKind
|
|
3507
|
-
ZodFirstPartyTypeKind
|
|
3508
|
-
ZodFirstPartyTypeKind
|
|
3509
|
-
ZodFirstPartyTypeKind
|
|
3510
|
-
ZodFirstPartyTypeKind
|
|
3511
|
-
ZodFirstPartyTypeKind
|
|
3512
|
-
ZodFirstPartyTypeKind
|
|
3513
|
-
ZodFirstPartyTypeKind
|
|
3514
|
-
ZodFirstPartyTypeKind
|
|
3515
|
-
ZodFirstPartyTypeKind
|
|
3516
|
-
ZodFirstPartyTypeKind
|
|
3517
|
-
ZodFirstPartyTypeKind
|
|
3518
|
-
ZodFirstPartyTypeKind
|
|
3519
|
-
ZodFirstPartyTypeKind
|
|
3520
|
-
ZodFirstPartyTypeKind
|
|
3521
|
-
ZodFirstPartyTypeKind
|
|
3522
|
-
ZodFirstPartyTypeKind
|
|
3523
|
-
ZodFirstPartyTypeKind
|
|
3524
|
-
ZodFirstPartyTypeKind
|
|
3525
|
-
ZodFirstPartyTypeKind
|
|
3526
|
-
ZodFirstPartyTypeKind
|
|
3527
|
-
ZodFirstPartyTypeKind
|
|
3528
|
-
ZodFirstPartyTypeKind
|
|
3529
|
-
ZodFirstPartyTypeKind
|
|
3530
|
-
ZodFirstPartyTypeKind
|
|
3531
|
-
ZodFirstPartyTypeKind
|
|
3532
|
-
ZodFirstPartyTypeKind
|
|
3533
|
-
ZodFirstPartyTypeKind
|
|
3534
|
-
ZodFirstPartyTypeKind
|
|
3535
|
-
ZodFirstPartyTypeKind
|
|
3536
|
-
ZodFirstPartyTypeKind
|
|
3537
|
-
ZodFirstPartyTypeKind
|
|
3538
|
-
ZodFirstPartyTypeKind
|
|
3539
|
-
ZodFirstPartyTypeKind
|
|
3540
|
-
ZodFirstPartyTypeKind
|
|
3541
|
-
ZodFirstPartyTypeKind
|
|
3542
|
-
ZodFirstPartyTypeKind
|
|
3506
|
+
(function(ZodFirstPartyTypeKind) {
|
|
3507
|
+
ZodFirstPartyTypeKind["ZodString"] = "ZodString";
|
|
3508
|
+
ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
|
|
3509
|
+
ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
|
|
3510
|
+
ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
|
|
3511
|
+
ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
|
|
3512
|
+
ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
|
|
3513
|
+
ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
|
|
3514
|
+
ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
|
|
3515
|
+
ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
|
|
3516
|
+
ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
|
|
3517
|
+
ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
|
|
3518
|
+
ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
|
|
3519
|
+
ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
|
|
3520
|
+
ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
|
|
3521
|
+
ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
|
|
3522
|
+
ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
|
|
3523
|
+
ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
|
|
3524
|
+
ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
|
|
3525
|
+
ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
|
|
3526
|
+
ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
|
|
3527
|
+
ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
|
|
3528
|
+
ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
|
|
3529
|
+
ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
|
|
3530
|
+
ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
|
|
3531
|
+
ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
|
|
3532
|
+
ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
|
|
3533
|
+
ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
|
|
3534
|
+
ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
|
|
3535
|
+
ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
|
|
3536
|
+
ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
|
|
3537
|
+
ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
|
|
3538
|
+
ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
|
|
3539
|
+
ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
|
|
3540
|
+
ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
|
|
3541
|
+
ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
|
|
3542
|
+
ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
|
|
3543
3543
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
3544
3544
|
const stringType = ZodString$1.create;
|
|
3545
3545
|
const numberType = ZodNumber$1.create;
|
|
@@ -3577,10 +3577,10 @@ const preprocessType = ZodEffects.createWithPreprocess;
|
|
|
3577
3577
|
const pipelineType = ZodPipeline.create;
|
|
3578
3578
|
|
|
3579
3579
|
//#endregion
|
|
3580
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
3580
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
|
|
3581
3581
|
/** A special constant with type `never` */
|
|
3582
3582
|
const NEVER = Object.freeze({ status: "aborted" });
|
|
3583
|
-
function $constructor(name
|
|
3583
|
+
function $constructor(name, initializer, params) {
|
|
3584
3584
|
function init(inst, def) {
|
|
3585
3585
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
3586
3586
|
value: {
|
|
@@ -3590,9 +3590,9 @@ function $constructor(name$1, initializer$2, params) {
|
|
|
3590
3590
|
},
|
|
3591
3591
|
enumerable: false
|
|
3592
3592
|
});
|
|
3593
|
-
if (inst._zod.traits.has(name
|
|
3594
|
-
inst._zod.traits.add(name
|
|
3595
|
-
initializer
|
|
3593
|
+
if (inst._zod.traits.has(name)) return;
|
|
3594
|
+
inst._zod.traits.add(name);
|
|
3595
|
+
initializer(inst, def);
|
|
3596
3596
|
const proto = _.prototype;
|
|
3597
3597
|
const keys = Object.keys(proto);
|
|
3598
3598
|
for (let i = 0; i < keys.length; i++) {
|
|
@@ -3602,21 +3602,21 @@ function $constructor(name$1, initializer$2, params) {
|
|
|
3602
3602
|
}
|
|
3603
3603
|
const Parent = params?.Parent ?? Object;
|
|
3604
3604
|
class Definition extends Parent {}
|
|
3605
|
-
Object.defineProperty(Definition, "name", { value: name
|
|
3605
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
3606
3606
|
function _(def) {
|
|
3607
|
-
var _a
|
|
3607
|
+
var _a;
|
|
3608
3608
|
const inst = params?.Parent ? new Definition() : this;
|
|
3609
3609
|
init(inst, def);
|
|
3610
|
-
(_a
|
|
3610
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
3611
3611
|
for (const fn of inst._zod.deferred) fn();
|
|
3612
3612
|
return inst;
|
|
3613
3613
|
}
|
|
3614
3614
|
Object.defineProperty(_, "init", { value: init });
|
|
3615
3615
|
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
3616
3616
|
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
3617
|
-
return inst?._zod?.traits?.has(name
|
|
3617
|
+
return inst?._zod?.traits?.has(name);
|
|
3618
3618
|
} });
|
|
3619
|
-
Object.defineProperty(_, "name", { value: name
|
|
3619
|
+
Object.defineProperty(_, "name", { value: name });
|
|
3620
3620
|
return _;
|
|
3621
3621
|
}
|
|
3622
3622
|
var $ZodAsyncError = class extends Error {
|
|
@@ -3625,8 +3625,8 @@ var $ZodAsyncError = class extends Error {
|
|
|
3625
3625
|
}
|
|
3626
3626
|
};
|
|
3627
3627
|
var $ZodEncodeError = class extends Error {
|
|
3628
|
-
constructor(name
|
|
3629
|
-
super(`Encountered unidirectional transform during encode: ${name
|
|
3628
|
+
constructor(name) {
|
|
3629
|
+
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
3630
3630
|
this.name = "ZodEncodeError";
|
|
3631
3631
|
}
|
|
3632
3632
|
};
|
|
@@ -3637,7 +3637,7 @@ function config(newConfig) {
|
|
|
3637
3637
|
}
|
|
3638
3638
|
|
|
3639
3639
|
//#endregion
|
|
3640
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
3640
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
|
|
3641
3641
|
function getEnumValues(entries) {
|
|
3642
3642
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
3643
3643
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -3676,9 +3676,9 @@ function floatSafeRemainder(val, step) {
|
|
|
3676
3676
|
return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
|
|
3677
3677
|
}
|
|
3678
3678
|
const EVALUATING = Symbol("evaluating");
|
|
3679
|
-
function defineLazy(object
|
|
3679
|
+
function defineLazy(object, key, getter) {
|
|
3680
3680
|
let value = void 0;
|
|
3681
|
-
Object.defineProperty(object
|
|
3681
|
+
Object.defineProperty(object, key, {
|
|
3682
3682
|
get() {
|
|
3683
3683
|
if (value === EVALUATING) return;
|
|
3684
3684
|
if (value === void 0) {
|
|
@@ -3688,7 +3688,7 @@ function defineLazy(object$2, key, getter) {
|
|
|
3688
3688
|
return value;
|
|
3689
3689
|
},
|
|
3690
3690
|
set(v) {
|
|
3691
|
-
Object.defineProperty(object
|
|
3691
|
+
Object.defineProperty(object, key, { value: v });
|
|
3692
3692
|
},
|
|
3693
3693
|
configurable: true
|
|
3694
3694
|
});
|
|
@@ -3914,8 +3914,8 @@ function aborted(x, startIndex = 0) {
|
|
|
3914
3914
|
}
|
|
3915
3915
|
function prefixIssues(path, issues) {
|
|
3916
3916
|
return issues.map((iss) => {
|
|
3917
|
-
var _a
|
|
3918
|
-
(_a
|
|
3917
|
+
var _a;
|
|
3918
|
+
(_a = iss).path ?? (_a.path = []);
|
|
3919
3919
|
iss.path.unshift(path);
|
|
3920
3920
|
return iss;
|
|
3921
3921
|
});
|
|
@@ -3923,12 +3923,12 @@ function prefixIssues(path, issues) {
|
|
|
3923
3923
|
function unwrapMessage(message) {
|
|
3924
3924
|
return typeof message === "string" ? message : message?.message;
|
|
3925
3925
|
}
|
|
3926
|
-
function finalizeIssue(iss, ctx, config
|
|
3926
|
+
function finalizeIssue(iss, ctx, config) {
|
|
3927
3927
|
const full = {
|
|
3928
3928
|
...iss,
|
|
3929
3929
|
path: iss.path ?? []
|
|
3930
3930
|
};
|
|
3931
|
-
if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config
|
|
3931
|
+
if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
3932
3932
|
delete full.inst;
|
|
3933
3933
|
delete full.continue;
|
|
3934
3934
|
if (!ctx?.reportInput) delete full.input;
|
|
@@ -3951,7 +3951,7 @@ function issue(...args) {
|
|
|
3951
3951
|
}
|
|
3952
3952
|
|
|
3953
3953
|
//#endregion
|
|
3954
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
3954
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
|
|
3955
3955
|
const initializer$1 = (inst, def) => {
|
|
3956
3956
|
inst.name = "$ZodError";
|
|
3957
3957
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -3970,7 +3970,7 @@ const initializer$1 = (inst, def) => {
|
|
|
3970
3970
|
};
|
|
3971
3971
|
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
3972
3972
|
const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
|
|
3973
|
-
function flattenError(error, mapper = (issue
|
|
3973
|
+
function flattenError(error, mapper = (issue) => issue.message) {
|
|
3974
3974
|
const fieldErrors = {};
|
|
3975
3975
|
const formErrors = [];
|
|
3976
3976
|
for (const sub of error.issues) if (sub.path.length > 0) {
|
|
@@ -3982,22 +3982,22 @@ function flattenError(error, mapper = (issue$1) => issue$1.message) {
|
|
|
3982
3982
|
fieldErrors
|
|
3983
3983
|
};
|
|
3984
3984
|
}
|
|
3985
|
-
function formatError(error, mapper = (issue
|
|
3985
|
+
function formatError(error, mapper = (issue) => issue.message) {
|
|
3986
3986
|
const fieldErrors = { _errors: [] };
|
|
3987
|
-
const processError = (error
|
|
3988
|
-
for (const issue
|
|
3989
|
-
else if (issue
|
|
3990
|
-
else if (issue
|
|
3991
|
-
else if (issue
|
|
3987
|
+
const processError = (error) => {
|
|
3988
|
+
for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }));
|
|
3989
|
+
else if (issue.code === "invalid_key") processError({ issues: issue.issues });
|
|
3990
|
+
else if (issue.code === "invalid_element") processError({ issues: issue.issues });
|
|
3991
|
+
else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
|
|
3992
3992
|
else {
|
|
3993
3993
|
let curr = fieldErrors;
|
|
3994
3994
|
let i = 0;
|
|
3995
|
-
while (i < issue
|
|
3996
|
-
const el = issue
|
|
3997
|
-
if (!(i === issue
|
|
3995
|
+
while (i < issue.path.length) {
|
|
3996
|
+
const el = issue.path[i];
|
|
3997
|
+
if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
|
|
3998
3998
|
else {
|
|
3999
3999
|
curr[el] = curr[el] || { _errors: [] };
|
|
4000
|
-
curr[el]._errors.push(mapper(issue
|
|
4000
|
+
curr[el]._errors.push(mapper(issue));
|
|
4001
4001
|
}
|
|
4002
4002
|
curr = curr[el];
|
|
4003
4003
|
i++;
|
|
@@ -4009,7 +4009,7 @@ function formatError(error, mapper = (issue$1) => issue$1.message) {
|
|
|
4009
4009
|
}
|
|
4010
4010
|
|
|
4011
4011
|
//#endregion
|
|
4012
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
4012
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
|
|
4013
4013
|
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
4014
4014
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
4015
4015
|
const result = schema._zod.run({
|
|
@@ -4113,7 +4113,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
4113
4113
|
const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
4114
4114
|
|
|
4115
4115
|
//#endregion
|
|
4116
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
4116
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js
|
|
4117
4117
|
const cuid = /^[cC][^\s-]{8,}$/;
|
|
4118
4118
|
const cuid2 = /^[0-9a-z]+$/;
|
|
4119
4119
|
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
@@ -4127,9 +4127,9 @@ const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9
|
|
|
4127
4127
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
4128
4128
|
*
|
|
4129
4129
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
4130
|
-
const uuid = (version
|
|
4131
|
-
if (!version
|
|
4132
|
-
return
|
|
4130
|
+
const uuid = (version) => {
|
|
4131
|
+
if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
4132
|
+
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
4133
4133
|
};
|
|
4134
4134
|
/** Practical email validation */
|
|
4135
4135
|
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
@@ -4151,19 +4151,19 @@ function timeSource(args) {
|
|
|
4151
4151
|
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
4152
4152
|
}
|
|
4153
4153
|
function time$1(args) {
|
|
4154
|
-
return
|
|
4154
|
+
return new RegExp(`^${timeSource(args)}$`);
|
|
4155
4155
|
}
|
|
4156
4156
|
function datetime$1(args) {
|
|
4157
|
-
const time
|
|
4157
|
+
const time = timeSource({ precision: args.precision });
|
|
4158
4158
|
const opts = ["Z"];
|
|
4159
4159
|
if (args.local) opts.push("");
|
|
4160
4160
|
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
4161
|
-
const timeRegex
|
|
4162
|
-
return
|
|
4161
|
+
const timeRegex = `${time}(?:${opts.join("|")})`;
|
|
4162
|
+
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
4163
4163
|
}
|
|
4164
4164
|
const string$1 = (params) => {
|
|
4165
4165
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
4166
|
-
return
|
|
4166
|
+
return new RegExp(`^${regex}$`);
|
|
4167
4167
|
};
|
|
4168
4168
|
const integer = /^-?\d+$/;
|
|
4169
4169
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
@@ -4173,12 +4173,12 @@ const lowercase = /^[^A-Z]*$/;
|
|
|
4173
4173
|
const uppercase = /^[^a-z]*$/;
|
|
4174
4174
|
|
|
4175
4175
|
//#endregion
|
|
4176
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
4176
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
|
|
4177
4177
|
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
4178
|
-
var _a
|
|
4178
|
+
var _a;
|
|
4179
4179
|
inst._zod ?? (inst._zod = {});
|
|
4180
4180
|
inst._zod.def = def;
|
|
4181
|
-
(_a
|
|
4181
|
+
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
4182
4182
|
});
|
|
4183
4183
|
const numericOriginMap = {
|
|
4184
4184
|
number: "number",
|
|
@@ -4188,8 +4188,8 @@ const numericOriginMap = {
|
|
|
4188
4188
|
const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
4189
4189
|
$ZodCheck.init(inst, def);
|
|
4190
4190
|
const origin = numericOriginMap[typeof def.value];
|
|
4191
|
-
inst._zod.onattach.push((inst
|
|
4192
|
-
const bag = inst
|
|
4191
|
+
inst._zod.onattach.push((inst) => {
|
|
4192
|
+
const bag = inst._zod.bag;
|
|
4193
4193
|
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
4194
4194
|
if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
|
|
4195
4195
|
else bag.exclusiveMaximum = def.value;
|
|
@@ -4210,8 +4210,8 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins
|
|
|
4210
4210
|
const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
4211
4211
|
$ZodCheck.init(inst, def);
|
|
4212
4212
|
const origin = numericOriginMap[typeof def.value];
|
|
4213
|
-
inst._zod.onattach.push((inst
|
|
4214
|
-
const bag = inst
|
|
4213
|
+
inst._zod.onattach.push((inst) => {
|
|
4214
|
+
const bag = inst._zod.bag;
|
|
4215
4215
|
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
4216
4216
|
if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
|
|
4217
4217
|
else bag.exclusiveMinimum = def.value;
|
|
@@ -4231,9 +4231,9 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
|
|
|
4231
4231
|
});
|
|
4232
4232
|
const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
4233
4233
|
$ZodCheck.init(inst, def);
|
|
4234
|
-
inst._zod.onattach.push((inst
|
|
4235
|
-
var _a
|
|
4236
|
-
(_a
|
|
4234
|
+
inst._zod.onattach.push((inst) => {
|
|
4235
|
+
var _a;
|
|
4236
|
+
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
4237
4237
|
});
|
|
4238
4238
|
inst._zod.check = (payload) => {
|
|
4239
4239
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -4254,8 +4254,8 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
4254
4254
|
const isInt = def.format?.includes("int");
|
|
4255
4255
|
const origin = isInt ? "int" : "number";
|
|
4256
4256
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
4257
|
-
inst._zod.onattach.push((inst
|
|
4258
|
-
const bag = inst
|
|
4257
|
+
inst._zod.onattach.push((inst) => {
|
|
4258
|
+
const bag = inst._zod.bag;
|
|
4259
4259
|
bag.format = def.format;
|
|
4260
4260
|
bag.minimum = minimum;
|
|
4261
4261
|
bag.maximum = maximum;
|
|
@@ -4320,15 +4320,15 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
4320
4320
|
};
|
|
4321
4321
|
});
|
|
4322
4322
|
const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
4323
|
-
var _a
|
|
4323
|
+
var _a;
|
|
4324
4324
|
$ZodCheck.init(inst, def);
|
|
4325
|
-
(_a
|
|
4325
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
4326
4326
|
const val = payload.value;
|
|
4327
4327
|
return !nullish(val) && val.length !== void 0;
|
|
4328
4328
|
});
|
|
4329
|
-
inst._zod.onattach.push((inst
|
|
4330
|
-
const curr = inst
|
|
4331
|
-
if (def.maximum < curr) inst
|
|
4329
|
+
inst._zod.onattach.push((inst) => {
|
|
4330
|
+
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
4331
|
+
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
4332
4332
|
});
|
|
4333
4333
|
inst._zod.check = (payload) => {
|
|
4334
4334
|
const input = payload.value;
|
|
@@ -4346,15 +4346,15 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
|
|
|
4346
4346
|
};
|
|
4347
4347
|
});
|
|
4348
4348
|
const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
4349
|
-
var _a
|
|
4349
|
+
var _a;
|
|
4350
4350
|
$ZodCheck.init(inst, def);
|
|
4351
|
-
(_a
|
|
4351
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
4352
4352
|
const val = payload.value;
|
|
4353
4353
|
return !nullish(val) && val.length !== void 0;
|
|
4354
4354
|
});
|
|
4355
|
-
inst._zod.onattach.push((inst
|
|
4356
|
-
const curr = inst
|
|
4357
|
-
if (def.minimum > curr) inst
|
|
4355
|
+
inst._zod.onattach.push((inst) => {
|
|
4356
|
+
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
4357
|
+
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
4358
4358
|
});
|
|
4359
4359
|
inst._zod.check = (payload) => {
|
|
4360
4360
|
const input = payload.value;
|
|
@@ -4372,14 +4372,14 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
|
|
|
4372
4372
|
};
|
|
4373
4373
|
});
|
|
4374
4374
|
const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
4375
|
-
var _a
|
|
4375
|
+
var _a;
|
|
4376
4376
|
$ZodCheck.init(inst, def);
|
|
4377
|
-
(_a
|
|
4377
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
4378
4378
|
const val = payload.value;
|
|
4379
4379
|
return !nullish(val) && val.length !== void 0;
|
|
4380
4380
|
});
|
|
4381
|
-
inst._zod.onattach.push((inst
|
|
4382
|
-
const bag = inst
|
|
4381
|
+
inst._zod.onattach.push((inst) => {
|
|
4382
|
+
const bag = inst._zod.bag;
|
|
4383
4383
|
bag.minimum = def.length;
|
|
4384
4384
|
bag.maximum = def.length;
|
|
4385
4385
|
bag.length = def.length;
|
|
@@ -4408,17 +4408,17 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
|
|
|
4408
4408
|
};
|
|
4409
4409
|
});
|
|
4410
4410
|
const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
4411
|
-
var _a
|
|
4411
|
+
var _a, _b;
|
|
4412
4412
|
$ZodCheck.init(inst, def);
|
|
4413
|
-
inst._zod.onattach.push((inst
|
|
4414
|
-
const bag = inst
|
|
4413
|
+
inst._zod.onattach.push((inst) => {
|
|
4414
|
+
const bag = inst._zod.bag;
|
|
4415
4415
|
bag.format = def.format;
|
|
4416
4416
|
if (def.pattern) {
|
|
4417
4417
|
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
4418
4418
|
bag.patterns.add(def.pattern);
|
|
4419
4419
|
}
|
|
4420
4420
|
});
|
|
4421
|
-
if (def.pattern) (_a
|
|
4421
|
+
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
4422
4422
|
def.pattern.lastIndex = 0;
|
|
4423
4423
|
if (def.pattern.test(payload.value)) return;
|
|
4424
4424
|
payload.issues.push({
|
|
@@ -4462,8 +4462,8 @@ const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (ins
|
|
|
4462
4462
|
const escapedRegex = escapeRegex(def.includes);
|
|
4463
4463
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
|
|
4464
4464
|
def.pattern = pattern;
|
|
4465
|
-
inst._zod.onattach.push((inst
|
|
4466
|
-
const bag = inst
|
|
4465
|
+
inst._zod.onattach.push((inst) => {
|
|
4466
|
+
const bag = inst._zod.bag;
|
|
4467
4467
|
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
4468
4468
|
bag.patterns.add(pattern);
|
|
4469
4469
|
});
|
|
@@ -4482,10 +4482,10 @@ const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (ins
|
|
|
4482
4482
|
});
|
|
4483
4483
|
const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
4484
4484
|
$ZodCheck.init(inst, def);
|
|
4485
|
-
const pattern =
|
|
4485
|
+
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
4486
4486
|
def.pattern ?? (def.pattern = pattern);
|
|
4487
|
-
inst._zod.onattach.push((inst
|
|
4488
|
-
const bag = inst
|
|
4487
|
+
inst._zod.onattach.push((inst) => {
|
|
4488
|
+
const bag = inst._zod.bag;
|
|
4489
4489
|
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
4490
4490
|
bag.patterns.add(pattern);
|
|
4491
4491
|
});
|
|
@@ -4504,10 +4504,10 @@ const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith",
|
|
|
4504
4504
|
});
|
|
4505
4505
|
const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
4506
4506
|
$ZodCheck.init(inst, def);
|
|
4507
|
-
const pattern =
|
|
4507
|
+
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
4508
4508
|
def.pattern ?? (def.pattern = pattern);
|
|
4509
|
-
inst._zod.onattach.push((inst
|
|
4510
|
-
const bag = inst
|
|
4509
|
+
inst._zod.onattach.push((inst) => {
|
|
4510
|
+
const bag = inst._zod.bag;
|
|
4511
4511
|
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
4512
4512
|
bag.patterns.add(pattern);
|
|
4513
4513
|
});
|
|
@@ -4532,7 +4532,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
|
|
|
4532
4532
|
});
|
|
4533
4533
|
|
|
4534
4534
|
//#endregion
|
|
4535
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
4535
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js
|
|
4536
4536
|
var Doc = class {
|
|
4537
4537
|
constructor(args = []) {
|
|
4538
4538
|
this.content = [];
|
|
@@ -4564,17 +4564,17 @@ var Doc = class {
|
|
|
4564
4564
|
};
|
|
4565
4565
|
|
|
4566
4566
|
//#endregion
|
|
4567
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
4567
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
|
|
4568
4568
|
const version = {
|
|
4569
4569
|
major: 4,
|
|
4570
4570
|
minor: 3,
|
|
4571
|
-
patch:
|
|
4571
|
+
patch: 6
|
|
4572
4572
|
};
|
|
4573
4573
|
|
|
4574
4574
|
//#endregion
|
|
4575
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
4575
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
|
|
4576
4576
|
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
4577
|
-
var _a
|
|
4577
|
+
var _a;
|
|
4578
4578
|
inst ?? (inst = {});
|
|
4579
4579
|
inst._zod.def = def;
|
|
4580
4580
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -4583,29 +4583,29 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
4583
4583
|
if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
|
|
4584
4584
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
4585
4585
|
if (checks.length === 0) {
|
|
4586
|
-
(_a
|
|
4586
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
4587
4587
|
inst._zod.deferred?.push(() => {
|
|
4588
4588
|
inst._zod.run = inst._zod.parse;
|
|
4589
4589
|
});
|
|
4590
4590
|
} else {
|
|
4591
|
-
const runChecks = (payload, checks
|
|
4592
|
-
let isAborted
|
|
4591
|
+
const runChecks = (payload, checks, ctx) => {
|
|
4592
|
+
let isAborted = aborted(payload);
|
|
4593
4593
|
let asyncResult;
|
|
4594
|
-
for (const ch of checks
|
|
4594
|
+
for (const ch of checks) {
|
|
4595
4595
|
if (ch._zod.def.when) {
|
|
4596
4596
|
if (!ch._zod.def.when(payload)) continue;
|
|
4597
|
-
} else if (isAborted
|
|
4597
|
+
} else if (isAborted) continue;
|
|
4598
4598
|
const currLen = payload.issues.length;
|
|
4599
4599
|
const _ = ch._zod.check(payload);
|
|
4600
4600
|
if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
|
|
4601
4601
|
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
4602
4602
|
await _;
|
|
4603
4603
|
if (payload.issues.length === currLen) return;
|
|
4604
|
-
if (!isAborted
|
|
4604
|
+
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
4605
4605
|
});
|
|
4606
4606
|
else {
|
|
4607
4607
|
if (payload.issues.length === currLen) continue;
|
|
4608
|
-
if (!isAborted
|
|
4608
|
+
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
4609
4609
|
}
|
|
4610
4610
|
}
|
|
4611
4611
|
if (asyncResult) return asyncResult.then(() => {
|
|
@@ -4621,7 +4621,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
4621
4621
|
const checkResult = runChecks(payload, checks, ctx);
|
|
4622
4622
|
if (checkResult instanceof Promise) {
|
|
4623
4623
|
if (ctx.async === false) throw new $ZodAsyncError();
|
|
4624
|
-
return checkResult.then((checkResult
|
|
4624
|
+
return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
|
|
4625
4625
|
}
|
|
4626
4626
|
return inst._zod.parse(checkResult, ctx);
|
|
4627
4627
|
};
|
|
@@ -4635,15 +4635,15 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
4635
4635
|
...ctx,
|
|
4636
4636
|
skipChecks: true
|
|
4637
4637
|
});
|
|
4638
|
-
if (canary instanceof Promise) return canary.then((canary
|
|
4639
|
-
return handleCanaryResult(canary
|
|
4638
|
+
if (canary instanceof Promise) return canary.then((canary) => {
|
|
4639
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
4640
4640
|
});
|
|
4641
4641
|
return handleCanaryResult(canary, payload, ctx);
|
|
4642
4642
|
}
|
|
4643
4643
|
const result = inst._zod.parse(payload, ctx);
|
|
4644
4644
|
if (result instanceof Promise) {
|
|
4645
4645
|
if (ctx.async === false) throw new $ZodAsyncError();
|
|
4646
|
-
return result.then((result
|
|
4646
|
+
return result.then((result) => runChecks(result, checks, ctx));
|
|
4647
4647
|
}
|
|
4648
4648
|
return runChecks(result, checks, ctx);
|
|
4649
4649
|
};
|
|
@@ -4667,7 +4667,7 @@ const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
|
4667
4667
|
inst._zod.parse = (payload, _) => {
|
|
4668
4668
|
if (def.coerce) try {
|
|
4669
4669
|
payload.value = String(payload.value);
|
|
4670
|
-
} catch (_
|
|
4670
|
+
} catch (_) {}
|
|
4671
4671
|
if (typeof payload.value === "string") return payload;
|
|
4672
4672
|
payload.issues.push({
|
|
4673
4673
|
expected: "string",
|
|
@@ -4873,8 +4873,8 @@ const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
4873
4873
|
});
|
|
4874
4874
|
function isValidBase64URL(data) {
|
|
4875
4875
|
if (!base64url.test(data)) return false;
|
|
4876
|
-
const base64
|
|
4877
|
-
return isValidBase64(base64
|
|
4876
|
+
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
4877
|
+
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
4878
4878
|
}
|
|
4879
4879
|
const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
4880
4880
|
def.pattern ?? (def.pattern = base64url);
|
|
@@ -5022,7 +5022,7 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
5022
5022
|
value: item,
|
|
5023
5023
|
issues: []
|
|
5024
5024
|
}, ctx);
|
|
5025
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
5025
|
+
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
5026
5026
|
else handleArrayResult(result, payload, i);
|
|
5027
5027
|
}
|
|
5028
5028
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
@@ -5066,7 +5066,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
5066
5066
|
value: input[key],
|
|
5067
5067
|
issues: []
|
|
5068
5068
|
}, ctx);
|
|
5069
|
-
if (r instanceof Promise) proms.push(r.then((r
|
|
5069
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
5070
5070
|
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
5071
5071
|
}
|
|
5072
5072
|
if (unrecognized.length) payload.issues.push({
|
|
@@ -5103,13 +5103,13 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
5103
5103
|
}
|
|
5104
5104
|
return propValues;
|
|
5105
5105
|
});
|
|
5106
|
-
const isObject$
|
|
5106
|
+
const isObject$2 = isObject;
|
|
5107
5107
|
const catchall = def.catchall;
|
|
5108
5108
|
let value;
|
|
5109
5109
|
inst._zod.parse = (payload, ctx) => {
|
|
5110
5110
|
value ?? (value = _normalized.value);
|
|
5111
5111
|
const input = payload.value;
|
|
5112
|
-
if (!isObject$
|
|
5112
|
+
if (!isObject$2(input)) {
|
|
5113
5113
|
payload.issues.push({
|
|
5114
5114
|
expected: "object",
|
|
5115
5115
|
code: "invalid_type",
|
|
@@ -5128,7 +5128,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
5128
5128
|
value: input[key],
|
|
5129
5129
|
issues: []
|
|
5130
5130
|
}, ctx);
|
|
5131
|
-
if (r instanceof Promise) proms.push(r.then((r
|
|
5131
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
5132
5132
|
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
5133
5133
|
}
|
|
5134
5134
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
@@ -5258,7 +5258,7 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
5258
5258
|
defineLazy(inst._zod, "pattern", () => {
|
|
5259
5259
|
if (def.options.every((o) => o._zod.pattern)) {
|
|
5260
5260
|
const patterns = def.options.map((o) => o._zod.pattern);
|
|
5261
|
-
return
|
|
5261
|
+
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
5262
5262
|
}
|
|
5263
5263
|
});
|
|
5264
5264
|
const single = def.options.length === 1;
|
|
@@ -5281,8 +5281,8 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
5281
5281
|
}
|
|
5282
5282
|
}
|
|
5283
5283
|
if (!async) return handleUnionResults(results, payload, inst, ctx);
|
|
5284
|
-
return Promise.all(results).then((results
|
|
5285
|
-
return handleUnionResults(results
|
|
5284
|
+
return Promise.all(results).then((results) => {
|
|
5285
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
5286
5286
|
});
|
|
5287
5287
|
};
|
|
5288
5288
|
});
|
|
@@ -5353,8 +5353,8 @@ const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst,
|
|
|
5353
5353
|
value: input,
|
|
5354
5354
|
issues: []
|
|
5355
5355
|
}, ctx);
|
|
5356
|
-
if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left
|
|
5357
|
-
return handleIntersectionResults(payload, left
|
|
5356
|
+
if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => {
|
|
5357
|
+
return handleIntersectionResults(payload, left, right);
|
|
5358
5358
|
});
|
|
5359
5359
|
return handleIntersectionResults(payload, left, right);
|
|
5360
5360
|
};
|
|
@@ -5464,9 +5464,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5464
5464
|
value: input[key],
|
|
5465
5465
|
issues: []
|
|
5466
5466
|
}, ctx);
|
|
5467
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
5468
|
-
if (result
|
|
5469
|
-
payload.value[key] = result
|
|
5467
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
5468
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5469
|
+
payload.value[key] = result.value;
|
|
5470
5470
|
}));
|
|
5471
5471
|
else {
|
|
5472
5472
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
@@ -5493,7 +5493,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5493
5493
|
issues: []
|
|
5494
5494
|
}, ctx);
|
|
5495
5495
|
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
5496
|
-
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length
|
|
5496
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
|
|
5497
5497
|
const retryResult = def.keyType._zod.run({
|
|
5498
5498
|
value: Number(key),
|
|
5499
5499
|
issues: []
|
|
@@ -5517,9 +5517,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5517
5517
|
value: input[key],
|
|
5518
5518
|
issues: []
|
|
5519
5519
|
}, ctx);
|
|
5520
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
5521
|
-
if (result
|
|
5522
|
-
payload.value[keyResult.value] = result
|
|
5520
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
5521
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5522
|
+
payload.value[keyResult.value] = result.value;
|
|
5523
5523
|
}));
|
|
5524
5524
|
else {
|
|
5525
5525
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
@@ -5536,7 +5536,7 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
5536
5536
|
const values = getEnumValues(def.entries);
|
|
5537
5537
|
const valuesSet = new Set(values);
|
|
5538
5538
|
inst._zod.values = valuesSet;
|
|
5539
|
-
inst._zod.pattern =
|
|
5539
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
5540
5540
|
inst._zod.parse = (payload, _ctx) => {
|
|
5541
5541
|
const input = payload.value;
|
|
5542
5542
|
if (valuesSet.has(input)) return payload;
|
|
@@ -5554,7 +5554,7 @@ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
5554
5554
|
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
5555
5555
|
const values = new Set(def.values);
|
|
5556
5556
|
inst._zod.values = values;
|
|
5557
|
-
inst._zod.pattern =
|
|
5557
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
5558
5558
|
inst._zod.parse = (payload, _ctx) => {
|
|
5559
5559
|
const input = payload.value;
|
|
5560
5560
|
if (values.has(input)) return payload;
|
|
@@ -5597,7 +5597,7 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
|
|
|
5597
5597
|
});
|
|
5598
5598
|
defineLazy(inst._zod, "pattern", () => {
|
|
5599
5599
|
const pattern = def.innerType._zod.pattern;
|
|
5600
|
-
return pattern ?
|
|
5600
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
5601
5601
|
});
|
|
5602
5602
|
inst._zod.parse = (payload, ctx) => {
|
|
5603
5603
|
if (def.innerType._zod.optin === "optional") {
|
|
@@ -5623,7 +5623,7 @@ const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) =>
|
|
|
5623
5623
|
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
5624
5624
|
defineLazy(inst._zod, "pattern", () => {
|
|
5625
5625
|
const pattern = def.innerType._zod.pattern;
|
|
5626
|
-
return pattern ?
|
|
5626
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
5627
5627
|
});
|
|
5628
5628
|
defineLazy(inst._zod, "values", () => {
|
|
5629
5629
|
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
|
|
@@ -5647,7 +5647,7 @@ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
|
5647
5647
|
return payload;
|
|
5648
5648
|
}
|
|
5649
5649
|
const result = def.innerType._zod.run(payload, ctx);
|
|
5650
|
-
if (result instanceof Promise) return result.then((result
|
|
5650
|
+
if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
|
|
5651
5651
|
return handleDefaultResult(result, def);
|
|
5652
5652
|
};
|
|
5653
5653
|
});
|
|
@@ -5673,7 +5673,7 @@ const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, d
|
|
|
5673
5673
|
});
|
|
5674
5674
|
inst._zod.parse = (payload, ctx) => {
|
|
5675
5675
|
const result = def.innerType._zod.run(payload, ctx);
|
|
5676
|
-
if (result instanceof Promise) return result.then((result
|
|
5676
|
+
if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst));
|
|
5677
5677
|
return handleNonOptionalResult(result, inst);
|
|
5678
5678
|
};
|
|
5679
5679
|
});
|
|
@@ -5694,12 +5694,12 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
|
5694
5694
|
inst._zod.parse = (payload, ctx) => {
|
|
5695
5695
|
if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
|
|
5696
5696
|
const result = def.innerType._zod.run(payload, ctx);
|
|
5697
|
-
if (result instanceof Promise) return result.then((result
|
|
5698
|
-
payload.value = result
|
|
5699
|
-
if (result
|
|
5697
|
+
if (result instanceof Promise) return result.then((result) => {
|
|
5698
|
+
payload.value = result.value;
|
|
5699
|
+
if (result.issues.length) {
|
|
5700
5700
|
payload.value = def.catchValue({
|
|
5701
5701
|
...payload,
|
|
5702
|
-
error: { issues: result
|
|
5702
|
+
error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
|
|
5703
5703
|
input: payload.value
|
|
5704
5704
|
});
|
|
5705
5705
|
payload.issues = [];
|
|
@@ -5727,11 +5727,11 @@ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
|
|
|
5727
5727
|
inst._zod.parse = (payload, ctx) => {
|
|
5728
5728
|
if (ctx.direction === "backward") {
|
|
5729
5729
|
const right = def.out._zod.run(payload, ctx);
|
|
5730
|
-
if (right instanceof Promise) return right.then((right
|
|
5730
|
+
if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
|
|
5731
5731
|
return handlePipeResult(right, def.in, ctx);
|
|
5732
5732
|
}
|
|
5733
5733
|
const left = def.in._zod.run(payload, ctx);
|
|
5734
|
-
if (left instanceof Promise) return left.then((left
|
|
5734
|
+
if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
|
|
5735
5735
|
return handlePipeResult(left, def.out, ctx);
|
|
5736
5736
|
};
|
|
5737
5737
|
});
|
|
@@ -5771,7 +5771,7 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
5771
5771
|
inst._zod.check = (payload) => {
|
|
5772
5772
|
const input = payload.value;
|
|
5773
5773
|
const r = def.fn(input);
|
|
5774
|
-
if (r instanceof Promise) return r.then((r
|
|
5774
|
+
if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
|
|
5775
5775
|
handleRefineResult(r, payload, input, inst);
|
|
5776
5776
|
};
|
|
5777
5777
|
});
|
|
@@ -5790,7 +5790,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
5790
5790
|
}
|
|
5791
5791
|
|
|
5792
5792
|
//#endregion
|
|
5793
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
5793
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
|
|
5794
5794
|
var _a;
|
|
5795
5795
|
var $ZodRegistry = class {
|
|
5796
5796
|
constructor() {
|
|
@@ -5798,9 +5798,9 @@ var $ZodRegistry = class {
|
|
|
5798
5798
|
this._idmap = /* @__PURE__ */ new Map();
|
|
5799
5799
|
}
|
|
5800
5800
|
add(schema, ..._meta) {
|
|
5801
|
-
const meta
|
|
5802
|
-
this._map.set(schema, meta
|
|
5803
|
-
if (meta
|
|
5801
|
+
const meta = _meta[0];
|
|
5802
|
+
this._map.set(schema, meta);
|
|
5803
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
|
|
5804
5804
|
return this;
|
|
5805
5805
|
}
|
|
5806
5806
|
clear() {
|
|
@@ -5809,8 +5809,8 @@ var $ZodRegistry = class {
|
|
|
5809
5809
|
return this;
|
|
5810
5810
|
}
|
|
5811
5811
|
remove(schema) {
|
|
5812
|
-
const meta
|
|
5813
|
-
if (meta
|
|
5812
|
+
const meta = this._map.get(schema);
|
|
5813
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
|
|
5814
5814
|
this._map.delete(schema);
|
|
5815
5815
|
return this;
|
|
5816
5816
|
}
|
|
@@ -5838,7 +5838,7 @@ function registry() {
|
|
|
5838
5838
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
5839
5839
|
|
|
5840
5840
|
//#endregion
|
|
5841
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
5841
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
5842
5842
|
/* @__NO_SIDE_EFFECTS__ */
|
|
5843
5843
|
function _string(Class, params) {
|
|
5844
5844
|
return new Class({
|
|
@@ -6330,10 +6330,10 @@ function _refine(Class, fn, _params) {
|
|
|
6330
6330
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6331
6331
|
function _superRefine(fn) {
|
|
6332
6332
|
const ch = /* @__PURE__ */ _check((payload) => {
|
|
6333
|
-
payload.addIssue = (issue$
|
|
6334
|
-
if (typeof issue$
|
|
6333
|
+
payload.addIssue = (issue$2) => {
|
|
6334
|
+
if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
|
|
6335
6335
|
else {
|
|
6336
|
-
const _issue = issue$
|
|
6336
|
+
const _issue = issue$2;
|
|
6337
6337
|
if (_issue.fatal) _issue.continue = false;
|
|
6338
6338
|
_issue.code ?? (_issue.code = "custom");
|
|
6339
6339
|
_issue.input ?? (_issue.input = payload.value);
|
|
@@ -6383,7 +6383,7 @@ function meta$2(metadata) {
|
|
|
6383
6383
|
}
|
|
6384
6384
|
|
|
6385
6385
|
//#endregion
|
|
6386
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
6386
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
|
|
6387
6387
|
function initializeContext(params) {
|
|
6388
6388
|
let target = params?.target ?? "draft-2020-12";
|
|
6389
6389
|
if (target === "draft-4") target = "draft-04";
|
|
@@ -6406,7 +6406,7 @@ function process$2(schema, ctx, _params = {
|
|
|
6406
6406
|
path: [],
|
|
6407
6407
|
schemaPath: []
|
|
6408
6408
|
}) {
|
|
6409
|
-
var _a
|
|
6409
|
+
var _a;
|
|
6410
6410
|
const def = schema._zod.def;
|
|
6411
6411
|
const seen = ctx.seen.get(schema);
|
|
6412
6412
|
if (seen) {
|
|
@@ -6443,13 +6443,13 @@ function process$2(schema, ctx, _params = {
|
|
|
6443
6443
|
ctx.seen.get(parent).isParent = true;
|
|
6444
6444
|
}
|
|
6445
6445
|
}
|
|
6446
|
-
const meta
|
|
6447
|
-
if (meta
|
|
6446
|
+
const meta = ctx.metadataRegistry.get(schema);
|
|
6447
|
+
if (meta) Object.assign(result.schema, meta);
|
|
6448
6448
|
if (ctx.io === "input" && isTransforming(schema)) {
|
|
6449
6449
|
delete result.schema.examples;
|
|
6450
6450
|
delete result.schema.default;
|
|
6451
6451
|
}
|
|
6452
|
-
if (ctx.io === "input" && result.schema._prefault) (_a
|
|
6452
|
+
if (ctx.io === "input" && result.schema._prefault) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
|
|
6453
6453
|
delete result.schema._prefault;
|
|
6454
6454
|
return ctx.seen.get(schema).schema;
|
|
6455
6455
|
}
|
|
@@ -6469,7 +6469,7 @@ function extractDefs(ctx, schema) {
|
|
|
6469
6469
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
6470
6470
|
if (ctx.external) {
|
|
6471
6471
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
6472
|
-
const uriGenerator = ctx.external.uri ?? ((id
|
|
6472
|
+
const uriGenerator = ctx.external.uri ?? ((id) => id);
|
|
6473
6473
|
if (externalId) return { ref: uriGenerator(externalId) };
|
|
6474
6474
|
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
6475
6475
|
entry[1].defId = id;
|
|
@@ -6492,9 +6492,9 @@ function extractDefs(ctx, schema) {
|
|
|
6492
6492
|
const { ref, defId } = makeURI(entry);
|
|
6493
6493
|
seen.def = { ...seen.schema };
|
|
6494
6494
|
if (defId) seen.defId = defId;
|
|
6495
|
-
const schema
|
|
6496
|
-
for (const key in schema
|
|
6497
|
-
schema
|
|
6495
|
+
const schema = seen.schema;
|
|
6496
|
+
for (const key in schema) delete schema[key];
|
|
6497
|
+
schema.$ref = ref;
|
|
6498
6498
|
};
|
|
6499
6499
|
if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
|
|
6500
6500
|
const seen = entry[1];
|
|
@@ -6537,8 +6537,8 @@ function finalize(ctx, schema) {
|
|
|
6537
6537
|
const flattenRef = (zodSchema) => {
|
|
6538
6538
|
const seen = ctx.seen.get(zodSchema);
|
|
6539
6539
|
if (seen.ref === null) return;
|
|
6540
|
-
const schema
|
|
6541
|
-
const _cached = { ...schema
|
|
6540
|
+
const schema = seen.def ?? seen.schema;
|
|
6541
|
+
const _cached = { ...schema };
|
|
6542
6542
|
const ref = seen.ref;
|
|
6543
6543
|
seen.ref = null;
|
|
6544
6544
|
if (ref) {
|
|
@@ -6546,17 +6546,17 @@ function finalize(ctx, schema) {
|
|
|
6546
6546
|
const refSeen = ctx.seen.get(ref);
|
|
6547
6547
|
const refSchema = refSeen.schema;
|
|
6548
6548
|
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
6549
|
-
schema
|
|
6550
|
-
schema
|
|
6551
|
-
} else Object.assign(schema
|
|
6552
|
-
Object.assign(schema
|
|
6553
|
-
if (zodSchema._zod.parent === ref) for (const key in schema
|
|
6549
|
+
schema.allOf = schema.allOf ?? [];
|
|
6550
|
+
schema.allOf.push(refSchema);
|
|
6551
|
+
} else Object.assign(schema, refSchema);
|
|
6552
|
+
Object.assign(schema, _cached);
|
|
6553
|
+
if (zodSchema._zod.parent === ref) for (const key in schema) {
|
|
6554
6554
|
if (key === "$ref" || key === "allOf") continue;
|
|
6555
|
-
if (!(key in _cached)) delete schema
|
|
6555
|
+
if (!(key in _cached)) delete schema[key];
|
|
6556
6556
|
}
|
|
6557
|
-
if (refSchema.$ref) for (const key in schema
|
|
6557
|
+
if (refSchema.$ref && refSeen.def) for (const key in schema) {
|
|
6558
6558
|
if (key === "$ref" || key === "allOf") continue;
|
|
6559
|
-
if (key in refSeen.def && JSON.stringify(schema
|
|
6559
|
+
if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
|
|
6560
6560
|
}
|
|
6561
6561
|
}
|
|
6562
6562
|
const parent = zodSchema._zod.parent;
|
|
@@ -6564,16 +6564,16 @@ function finalize(ctx, schema) {
|
|
|
6564
6564
|
flattenRef(parent);
|
|
6565
6565
|
const parentSeen = ctx.seen.get(parent);
|
|
6566
6566
|
if (parentSeen?.schema.$ref) {
|
|
6567
|
-
schema
|
|
6568
|
-
if (parentSeen.def) for (const key in schema
|
|
6567
|
+
schema.$ref = parentSeen.schema.$ref;
|
|
6568
|
+
if (parentSeen.def) for (const key in schema) {
|
|
6569
6569
|
if (key === "$ref" || key === "allOf") continue;
|
|
6570
|
-
if (key in parentSeen.def && JSON.stringify(schema
|
|
6570
|
+
if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key];
|
|
6571
6571
|
}
|
|
6572
6572
|
}
|
|
6573
6573
|
}
|
|
6574
6574
|
ctx.override({
|
|
6575
6575
|
zodSchema,
|
|
6576
|
-
jsonSchema: schema
|
|
6576
|
+
jsonSchema: schema,
|
|
6577
6577
|
path: seen.path ?? []
|
|
6578
6578
|
});
|
|
6579
6579
|
};
|
|
@@ -6669,7 +6669,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
6669
6669
|
};
|
|
6670
6670
|
|
|
6671
6671
|
//#endregion
|
|
6672
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
6672
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
|
|
6673
6673
|
const formatMap = {
|
|
6674
6674
|
guid: "uuid",
|
|
6675
6675
|
url: "uri",
|
|
@@ -6793,22 +6793,22 @@ const templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
|
6793
6793
|
};
|
|
6794
6794
|
const fileProcessor = (schema, _ctx, json, _params) => {
|
|
6795
6795
|
const _json = json;
|
|
6796
|
-
const file
|
|
6796
|
+
const file = {
|
|
6797
6797
|
type: "string",
|
|
6798
6798
|
format: "binary",
|
|
6799
6799
|
contentEncoding: "binary"
|
|
6800
6800
|
};
|
|
6801
6801
|
const { minimum, maximum, mime } = schema._zod.bag;
|
|
6802
|
-
if (minimum !== void 0) file
|
|
6803
|
-
if (maximum !== void 0) file
|
|
6802
|
+
if (minimum !== void 0) file.minLength = minimum;
|
|
6803
|
+
if (maximum !== void 0) file.maxLength = maximum;
|
|
6804
6804
|
if (mime) if (mime.length === 1) {
|
|
6805
|
-
file
|
|
6806
|
-
Object.assign(_json, file
|
|
6805
|
+
file.contentMediaType = mime[0];
|
|
6806
|
+
Object.assign(_json, file);
|
|
6807
6807
|
} else {
|
|
6808
|
-
Object.assign(_json, file
|
|
6808
|
+
Object.assign(_json, file);
|
|
6809
6809
|
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
6810
6810
|
}
|
|
6811
|
-
else Object.assign(_json, file
|
|
6811
|
+
else Object.assign(_json, file);
|
|
6812
6812
|
};
|
|
6813
6813
|
const successProcessor = (_schema, _ctx, json, _params) => {
|
|
6814
6814
|
json.type = "boolean";
|
|
@@ -7092,28 +7092,28 @@ const allProcessors = {
|
|
|
7092
7092
|
};
|
|
7093
7093
|
function toJSONSchema(input, params) {
|
|
7094
7094
|
if ("_idmap" in input) {
|
|
7095
|
-
const registry
|
|
7096
|
-
const ctx
|
|
7095
|
+
const registry = input;
|
|
7096
|
+
const ctx = initializeContext({
|
|
7097
7097
|
...params,
|
|
7098
7098
|
processors: allProcessors
|
|
7099
7099
|
});
|
|
7100
7100
|
const defs = {};
|
|
7101
|
-
for (const entry of registry
|
|
7101
|
+
for (const entry of registry._idmap.entries()) {
|
|
7102
7102
|
const [_, schema] = entry;
|
|
7103
|
-
process$2(schema, ctx
|
|
7103
|
+
process$2(schema, ctx);
|
|
7104
7104
|
}
|
|
7105
7105
|
const schemas = {};
|
|
7106
|
-
ctx
|
|
7107
|
-
registry
|
|
7106
|
+
ctx.external = {
|
|
7107
|
+
registry,
|
|
7108
7108
|
uri: params?.uri,
|
|
7109
7109
|
defs
|
|
7110
7110
|
};
|
|
7111
|
-
for (const entry of registry
|
|
7111
|
+
for (const entry of registry._idmap.entries()) {
|
|
7112
7112
|
const [key, schema] = entry;
|
|
7113
|
-
extractDefs(ctx
|
|
7114
|
-
schemas[key] = finalize(ctx
|
|
7113
|
+
extractDefs(ctx, schema);
|
|
7114
|
+
schemas[key] = finalize(ctx, schema);
|
|
7115
7115
|
}
|
|
7116
|
-
if (Object.keys(defs).length > 0) schemas.__shared = { [ctx
|
|
7116
|
+
if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
|
|
7117
7117
|
return { schemas };
|
|
7118
7118
|
}
|
|
7119
7119
|
const ctx = initializeContext({
|
|
@@ -7126,7 +7126,7 @@ function toJSONSchema(input, params) {
|
|
|
7126
7126
|
}
|
|
7127
7127
|
|
|
7128
7128
|
//#endregion
|
|
7129
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
7129
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/mini/schemas.js
|
|
7130
7130
|
const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
7131
7131
|
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
7132
7132
|
$ZodType.init(inst, def);
|
|
@@ -7149,8 +7149,8 @@ const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
|
7149
7149
|
inst.with = inst.check;
|
|
7150
7150
|
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
7151
7151
|
inst.brand = () => inst;
|
|
7152
|
-
inst.register = ((reg, meta
|
|
7153
|
-
reg.add(inst, meta
|
|
7152
|
+
inst.register = ((reg, meta) => {
|
|
7153
|
+
reg.add(inst, meta);
|
|
7154
7154
|
return inst;
|
|
7155
7155
|
});
|
|
7156
7156
|
inst.apply = (fn) => fn(inst);
|
|
@@ -7172,7 +7172,7 @@ const describe$1 = describe$2;
|
|
|
7172
7172
|
const meta$1 = meta$2;
|
|
7173
7173
|
|
|
7174
7174
|
//#endregion
|
|
7175
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
7175
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
7176
7176
|
function isZ4Schema(s) {
|
|
7177
7177
|
return !!s._zod;
|
|
7178
7178
|
}
|
|
@@ -7272,10 +7272,10 @@ function isSchemaOptional(schema) {
|
|
|
7272
7272
|
*/
|
|
7273
7273
|
function getLiteralValue(schema) {
|
|
7274
7274
|
if (isZ4Schema(schema)) {
|
|
7275
|
-
const def
|
|
7276
|
-
if (def
|
|
7277
|
-
if (def
|
|
7278
|
-
if (Array.isArray(def
|
|
7275
|
+
const def = schema._zod?.def;
|
|
7276
|
+
if (def) {
|
|
7277
|
+
if (def.value !== void 0) return def.value;
|
|
7278
|
+
if (Array.isArray(def.values) && def.values.length > 0) return def.values[0];
|
|
7279
7279
|
}
|
|
7280
7280
|
}
|
|
7281
7281
|
const def = schema._def;
|
|
@@ -7288,7 +7288,7 @@ function getLiteralValue(schema) {
|
|
|
7288
7288
|
}
|
|
7289
7289
|
|
|
7290
7290
|
//#endregion
|
|
7291
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
7291
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
|
|
7292
7292
|
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
7293
7293
|
$ZodISODateTime.init(inst, def);
|
|
7294
7294
|
ZodStringFormat.init(inst, def);
|
|
@@ -7319,19 +7319,19 @@ function duration(params) {
|
|
|
7319
7319
|
}
|
|
7320
7320
|
|
|
7321
7321
|
//#endregion
|
|
7322
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
7322
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
|
|
7323
7323
|
const initializer = (inst, issues) => {
|
|
7324
7324
|
$ZodError.init(inst, issues);
|
|
7325
7325
|
inst.name = "ZodError";
|
|
7326
7326
|
Object.defineProperties(inst, {
|
|
7327
7327
|
format: { value: (mapper) => formatError(inst, mapper) },
|
|
7328
7328
|
flatten: { value: (mapper) => flattenError(inst, mapper) },
|
|
7329
|
-
addIssue: { value: (issue
|
|
7330
|
-
inst.issues.push(issue
|
|
7329
|
+
addIssue: { value: (issue) => {
|
|
7330
|
+
inst.issues.push(issue);
|
|
7331
7331
|
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
7332
7332
|
} },
|
|
7333
|
-
addIssues: { value: (issues
|
|
7334
|
-
inst.issues.push(...issues
|
|
7333
|
+
addIssues: { value: (issues) => {
|
|
7334
|
+
inst.issues.push(...issues);
|
|
7335
7335
|
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
7336
7336
|
} },
|
|
7337
7337
|
isEmpty: { get() {
|
|
@@ -7343,7 +7343,7 @@ const ZodError = $constructor("ZodError", initializer);
|
|
|
7343
7343
|
const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
|
|
7344
7344
|
|
|
7345
7345
|
//#endregion
|
|
7346
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
7346
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js
|
|
7347
7347
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
7348
7348
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
7349
7349
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -7358,7 +7358,7 @@ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
|
7358
7358
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
7359
7359
|
|
|
7360
7360
|
//#endregion
|
|
7361
|
-
//#region node_modules/.pnpm/zod@4.3.
|
|
7361
|
+
//#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
|
|
7362
7362
|
const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
7363
7363
|
$ZodType.init(inst, def);
|
|
7364
7364
|
Object.assign(inst["~standard"], { jsonSchema: {
|
|
@@ -7377,10 +7377,10 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
7377
7377
|
} } : ch)] }), { parent: true });
|
|
7378
7378
|
};
|
|
7379
7379
|
inst.with = inst.check;
|
|
7380
|
-
inst.clone = (def
|
|
7380
|
+
inst.clone = (def, params) => clone(inst, def, params);
|
|
7381
7381
|
inst.brand = () => inst;
|
|
7382
|
-
inst.register = ((reg, meta
|
|
7383
|
-
reg.add(inst, meta
|
|
7382
|
+
inst.register = ((reg, meta) => {
|
|
7383
|
+
reg.add(inst, meta);
|
|
7384
7384
|
return inst;
|
|
7385
7385
|
});
|
|
7386
7386
|
inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
|
|
@@ -7408,8 +7408,8 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
7408
7408
|
inst.or = (arg) => union([inst, arg]);
|
|
7409
7409
|
inst.and = (arg) => intersection(inst, arg);
|
|
7410
7410
|
inst.transform = (tx) => pipe(inst, transform(tx));
|
|
7411
|
-
inst.default = (def
|
|
7412
|
-
inst.prefault = (def
|
|
7411
|
+
inst.default = (def) => _default(inst, def);
|
|
7412
|
+
inst.prefault = (def) => prefault(inst, def);
|
|
7413
7413
|
inst.catch = (params) => _catch(inst, params);
|
|
7414
7414
|
inst.pipe = (target) => pipe(inst, target);
|
|
7415
7415
|
inst.readonly = () => readonly(inst);
|
|
@@ -7835,8 +7835,8 @@ const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) =>
|
|
|
7835
7835
|
}
|
|
7836
7836
|
};
|
|
7837
7837
|
const output = def.transform(payload.value, payload);
|
|
7838
|
-
if (output instanceof Promise) return output.then((output
|
|
7839
|
-
payload.value = output
|
|
7838
|
+
if (output instanceof Promise) return output.then((output) => {
|
|
7839
|
+
payload.value = output;
|
|
7840
7840
|
return payload;
|
|
7841
7841
|
});
|
|
7842
7842
|
payload.value = output;
|
|
@@ -7990,7 +7990,7 @@ function preprocess(fn, schema) {
|
|
|
7990
7990
|
}
|
|
7991
7991
|
|
|
7992
7992
|
//#endregion
|
|
7993
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
7993
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
7994
7994
|
const LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
7995
7995
|
const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
7996
7996
|
LATEST_PROTOCOL_VERSION,
|
|
@@ -8097,15 +8097,15 @@ const isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse
|
|
|
8097
8097
|
* Error codes defined by the JSON-RPC specification.
|
|
8098
8098
|
*/
|
|
8099
8099
|
var ErrorCode;
|
|
8100
|
-
(function(ErrorCode
|
|
8101
|
-
ErrorCode
|
|
8102
|
-
ErrorCode
|
|
8103
|
-
ErrorCode
|
|
8104
|
-
ErrorCode
|
|
8105
|
-
ErrorCode
|
|
8106
|
-
ErrorCode
|
|
8107
|
-
ErrorCode
|
|
8108
|
-
ErrorCode
|
|
8100
|
+
(function(ErrorCode) {
|
|
8101
|
+
ErrorCode[ErrorCode["ConnectionClosed"] = -32e3] = "ConnectionClosed";
|
|
8102
|
+
ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout";
|
|
8103
|
+
ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError";
|
|
8104
|
+
ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest";
|
|
8105
|
+
ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound";
|
|
8106
|
+
ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams";
|
|
8107
|
+
ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError";
|
|
8108
|
+
ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
8109
8109
|
})(ErrorCode || (ErrorCode = {}));
|
|
8110
8110
|
/**
|
|
8111
8111
|
* A response to a request that indicates an error occurred.
|
|
@@ -9216,21 +9216,21 @@ const ServerResultSchema = union([
|
|
|
9216
9216
|
CreateTaskResultSchema
|
|
9217
9217
|
]);
|
|
9218
9218
|
var McpError = class McpError extends Error {
|
|
9219
|
-
constructor(code
|
|
9220
|
-
super(`MCP error ${code
|
|
9221
|
-
this.code = code
|
|
9219
|
+
constructor(code, message, data) {
|
|
9220
|
+
super(`MCP error ${code}: ${message}`);
|
|
9221
|
+
this.code = code;
|
|
9222
9222
|
this.data = data;
|
|
9223
9223
|
this.name = "McpError";
|
|
9224
9224
|
}
|
|
9225
9225
|
/**
|
|
9226
9226
|
* Factory method to create the appropriate error type based on the error code and data
|
|
9227
9227
|
*/
|
|
9228
|
-
static fromError(code
|
|
9229
|
-
if (code
|
|
9228
|
+
static fromError(code, message, data) {
|
|
9229
|
+
if (code === ErrorCode.UrlElicitationRequired && data) {
|
|
9230
9230
|
const errorData = data;
|
|
9231
9231
|
if (errorData.elicitations) return new UrlElicitationRequiredError(errorData.elicitations, message);
|
|
9232
9232
|
}
|
|
9233
|
-
return new McpError(code
|
|
9233
|
+
return new McpError(code, message, data);
|
|
9234
9234
|
}
|
|
9235
9235
|
};
|
|
9236
9236
|
/**
|
|
@@ -9247,7 +9247,7 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
9247
9247
|
};
|
|
9248
9248
|
|
|
9249
9249
|
//#endregion
|
|
9250
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
9250
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
9251
9251
|
/**
|
|
9252
9252
|
* Experimental task interfaces for MCP SDK.
|
|
9253
9253
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -9265,7 +9265,7 @@ function isTerminal(status) {
|
|
|
9265
9265
|
}
|
|
9266
9266
|
|
|
9267
9267
|
//#endregion
|
|
9268
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9268
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
9269
9269
|
const ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
9270
9270
|
const defaultOptions = {
|
|
9271
9271
|
name: void 0,
|
|
@@ -9300,7 +9300,7 @@ const getDefaultOptions = (options) => typeof options === "string" ? {
|
|
|
9300
9300
|
};
|
|
9301
9301
|
|
|
9302
9302
|
//#endregion
|
|
9303
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9303
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
9304
9304
|
const getRefs = (options) => {
|
|
9305
9305
|
const _options = getDefaultOptions(options);
|
|
9306
9306
|
const currentPath = _options.name !== void 0 ? [
|
|
@@ -9313,12 +9313,12 @@ const getRefs = (options) => {
|
|
|
9313
9313
|
flags: { hasReferencedOpenAiAnyType: false },
|
|
9314
9314
|
currentPath,
|
|
9315
9315
|
propertyPath: void 0,
|
|
9316
|
-
seen: new Map(Object.entries(_options.definitions).map(([name
|
|
9316
|
+
seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [def._def, {
|
|
9317
9317
|
def: def._def,
|
|
9318
9318
|
path: [
|
|
9319
9319
|
..._options.basePath,
|
|
9320
9320
|
_options.definitionPath,
|
|
9321
|
-
name
|
|
9321
|
+
name
|
|
9322
9322
|
],
|
|
9323
9323
|
jsonSchema: void 0
|
|
9324
9324
|
}]))
|
|
@@ -9326,7 +9326,7 @@ const getRefs = (options) => {
|
|
|
9326
9326
|
};
|
|
9327
9327
|
|
|
9328
9328
|
//#endregion
|
|
9329
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9329
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
9330
9330
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
9331
9331
|
if (!refs?.errorMessages) return;
|
|
9332
9332
|
if (errorMessage) res.errorMessage = {
|
|
@@ -9340,7 +9340,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
9340
9340
|
}
|
|
9341
9341
|
|
|
9342
9342
|
//#endregion
|
|
9343
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9343
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
9344
9344
|
const getRelativePath = (pathA, pathB) => {
|
|
9345
9345
|
let i = 0;
|
|
9346
9346
|
for (; i < pathA.length && i < pathB.length; i++) if (pathA[i] !== pathB[i]) break;
|
|
@@ -9348,7 +9348,7 @@ const getRelativePath = (pathA, pathB) => {
|
|
|
9348
9348
|
};
|
|
9349
9349
|
|
|
9350
9350
|
//#endregion
|
|
9351
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9351
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
9352
9352
|
function parseAnyDef(refs) {
|
|
9353
9353
|
if (refs.target !== "openAi") return {};
|
|
9354
9354
|
const anyDefinitionPath = [
|
|
@@ -9361,7 +9361,7 @@ function parseAnyDef(refs) {
|
|
|
9361
9361
|
}
|
|
9362
9362
|
|
|
9363
9363
|
//#endregion
|
|
9364
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9364
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
9365
9365
|
function parseArrayDef(def, refs) {
|
|
9366
9366
|
const res = { type: "array" };
|
|
9367
9367
|
if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) res.items = parseDef(def.type._def, {
|
|
@@ -9378,7 +9378,7 @@ function parseArrayDef(def, refs) {
|
|
|
9378
9378
|
}
|
|
9379
9379
|
|
|
9380
9380
|
//#endregion
|
|
9381
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9381
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
9382
9382
|
function parseBigintDef(def, refs) {
|
|
9383
9383
|
const res = {
|
|
9384
9384
|
type: "integer",
|
|
@@ -9410,25 +9410,25 @@ function parseBigintDef(def, refs) {
|
|
|
9410
9410
|
}
|
|
9411
9411
|
|
|
9412
9412
|
//#endregion
|
|
9413
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9413
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
9414
9414
|
function parseBooleanDef() {
|
|
9415
9415
|
return { type: "boolean" };
|
|
9416
9416
|
}
|
|
9417
9417
|
|
|
9418
9418
|
//#endregion
|
|
9419
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9419
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
9420
9420
|
function parseBrandedDef(_def, refs) {
|
|
9421
9421
|
return parseDef(_def.type._def, refs);
|
|
9422
9422
|
}
|
|
9423
9423
|
|
|
9424
9424
|
//#endregion
|
|
9425
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9425
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
9426
9426
|
const parseCatchDef = (def, refs) => {
|
|
9427
9427
|
return parseDef(def.innerType._def, refs);
|
|
9428
9428
|
};
|
|
9429
9429
|
|
|
9430
9430
|
//#endregion
|
|
9431
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9431
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
9432
9432
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
9433
9433
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
9434
9434
|
if (Array.isArray(strategy)) return { anyOf: strategy.map((item, i) => parseDateDef(def, refs, item)) };
|
|
@@ -9463,7 +9463,7 @@ const integerDateParser = (def, refs) => {
|
|
|
9463
9463
|
};
|
|
9464
9464
|
|
|
9465
9465
|
//#endregion
|
|
9466
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9466
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
9467
9467
|
function parseDefaultDef(_def, refs) {
|
|
9468
9468
|
return {
|
|
9469
9469
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -9472,13 +9472,13 @@ function parseDefaultDef(_def, refs) {
|
|
|
9472
9472
|
}
|
|
9473
9473
|
|
|
9474
9474
|
//#endregion
|
|
9475
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9475
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
9476
9476
|
function parseEffectsDef(_def, refs) {
|
|
9477
9477
|
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
|
|
9478
9478
|
}
|
|
9479
9479
|
|
|
9480
9480
|
//#endregion
|
|
9481
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9481
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
9482
9482
|
function parseEnumDef(def) {
|
|
9483
9483
|
return {
|
|
9484
9484
|
type: "string",
|
|
@@ -9487,7 +9487,7 @@ function parseEnumDef(def) {
|
|
|
9487
9487
|
}
|
|
9488
9488
|
|
|
9489
9489
|
//#endregion
|
|
9490
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9490
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
9491
9491
|
const isJsonSchema7AllOfType = (type) => {
|
|
9492
9492
|
if ("type" in type && type.type === "string") return false;
|
|
9493
9493
|
return "allOf" in type;
|
|
@@ -9530,7 +9530,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
9530
9530
|
}
|
|
9531
9531
|
|
|
9532
9532
|
//#endregion
|
|
9533
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9533
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
9534
9534
|
function parseLiteralDef(def, refs) {
|
|
9535
9535
|
const parsedType = typeof def.value;
|
|
9536
9536
|
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") return { type: Array.isArray(def.value) ? "array" : "object" };
|
|
@@ -9545,7 +9545,7 @@ function parseLiteralDef(def, refs) {
|
|
|
9545
9545
|
}
|
|
9546
9546
|
|
|
9547
9547
|
//#endregion
|
|
9548
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9548
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
9549
9549
|
let emojiRegex = void 0;
|
|
9550
9550
|
/**
|
|
9551
9551
|
* Generated from the regular expressions found here as of 2024-05-22:
|
|
@@ -9675,8 +9675,8 @@ function parseStringDef(def, refs) {
|
|
|
9675
9675
|
}
|
|
9676
9676
|
return res;
|
|
9677
9677
|
}
|
|
9678
|
-
function escapeLiteralCheckValue(literal
|
|
9679
|
-
return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal
|
|
9678
|
+
function escapeLiteralCheckValue(literal, refs) {
|
|
9679
|
+
return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal) : literal;
|
|
9680
9680
|
}
|
|
9681
9681
|
const ALPHA_NUMERIC = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
9682
9682
|
function escapeNonAlphaNumeric(source) {
|
|
@@ -9791,7 +9791,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
9791
9791
|
}
|
|
9792
9792
|
|
|
9793
9793
|
//#endregion
|
|
9794
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9794
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
9795
9795
|
function parseRecordDef(def, refs) {
|
|
9796
9796
|
if (refs.target === "openAi") console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
9797
9797
|
if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) return {
|
|
@@ -9839,7 +9839,7 @@ function parseRecordDef(def, refs) {
|
|
|
9839
9839
|
}
|
|
9840
9840
|
|
|
9841
9841
|
//#endregion
|
|
9842
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9842
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
9843
9843
|
function parseMapDef(def, refs) {
|
|
9844
9844
|
if (refs.mapStrategy === "record") return parseRecordDef(def, refs);
|
|
9845
9845
|
return {
|
|
@@ -9871,12 +9871,12 @@ function parseMapDef(def, refs) {
|
|
|
9871
9871
|
}
|
|
9872
9872
|
|
|
9873
9873
|
//#endregion
|
|
9874
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9874
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
9875
9875
|
function parseNativeEnumDef(def) {
|
|
9876
|
-
const object
|
|
9876
|
+
const object = def.values;
|
|
9877
9877
|
const actualValues = Object.keys(def.values).filter((key) => {
|
|
9878
|
-
return typeof object
|
|
9879
|
-
}).map((key) => object
|
|
9878
|
+
return typeof object[object[key]] !== "number";
|
|
9879
|
+
}).map((key) => object[key]);
|
|
9880
9880
|
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
|
|
9881
9881
|
return {
|
|
9882
9882
|
type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
@@ -9885,7 +9885,7 @@ function parseNativeEnumDef(def) {
|
|
|
9885
9885
|
}
|
|
9886
9886
|
|
|
9887
9887
|
//#endregion
|
|
9888
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9888
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
9889
9889
|
function parseNeverDef(refs) {
|
|
9890
9890
|
return refs.target === "openAi" ? void 0 : { not: parseAnyDef({
|
|
9891
9891
|
...refs,
|
|
@@ -9894,7 +9894,7 @@ function parseNeverDef(refs) {
|
|
|
9894
9894
|
}
|
|
9895
9895
|
|
|
9896
9896
|
//#endregion
|
|
9897
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9897
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
9898
9898
|
function parseNullDef(refs) {
|
|
9899
9899
|
return refs.target === "openApi3" ? {
|
|
9900
9900
|
enum: ["null"],
|
|
@@ -9903,7 +9903,7 @@ function parseNullDef(refs) {
|
|
|
9903
9903
|
}
|
|
9904
9904
|
|
|
9905
9905
|
//#endregion
|
|
9906
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9906
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
9907
9907
|
const primitiveMappings = {
|
|
9908
9908
|
ZodString: "string",
|
|
9909
9909
|
ZodNumber: "number",
|
|
@@ -9915,9 +9915,9 @@ function parseUnionDef(def, refs) {
|
|
|
9915
9915
|
if (refs.target === "openApi3") return asAnyOf(def, refs);
|
|
9916
9916
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
9917
9917
|
if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
|
|
9918
|
-
const types = options.reduce((types
|
|
9918
|
+
const types = options.reduce((types, x) => {
|
|
9919
9919
|
const type = primitiveMappings[x._def.typeName];
|
|
9920
|
-
return type && !types
|
|
9920
|
+
return type && !types.includes(type) ? [...types, type] : types;
|
|
9921
9921
|
}, []);
|
|
9922
9922
|
return { type: types.length > 1 ? types : types[0] };
|
|
9923
9923
|
} else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
|
|
@@ -9929,9 +9929,6 @@ function parseUnionDef(def, refs) {
|
|
|
9929
9929
|
case "boolean": return [...acc, type];
|
|
9930
9930
|
case "bigint": return [...acc, "integer"];
|
|
9931
9931
|
case "object": if (x._def.value === null) return [...acc, "null"];
|
|
9932
|
-
case "symbol":
|
|
9933
|
-
case "undefined":
|
|
9934
|
-
case "function":
|
|
9935
9932
|
default: return acc;
|
|
9936
9933
|
}
|
|
9937
9934
|
}, []);
|
|
@@ -9946,7 +9943,7 @@ function parseUnionDef(def, refs) {
|
|
|
9946
9943
|
}
|
|
9947
9944
|
} else if (options.every((x) => x._def.typeName === "ZodEnum")) return {
|
|
9948
9945
|
type: "string",
|
|
9949
|
-
enum: options.reduce((acc, x) => [...acc, ...x._def.values.filter((x
|
|
9946
|
+
enum: options.reduce((acc, x) => [...acc, ...x._def.values.filter((x) => !acc.includes(x))], [])
|
|
9950
9947
|
};
|
|
9951
9948
|
return asAnyOf(def, refs);
|
|
9952
9949
|
}
|
|
@@ -9963,7 +9960,7 @@ const asAnyOf = (def, refs) => {
|
|
|
9963
9960
|
};
|
|
9964
9961
|
|
|
9965
9962
|
//#endregion
|
|
9966
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
9963
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
9967
9964
|
function parseNullableDef(def, refs) {
|
|
9968
9965
|
if ([
|
|
9969
9966
|
"ZodString",
|
|
@@ -9979,16 +9976,16 @@ function parseNullableDef(def, refs) {
|
|
|
9979
9976
|
return { type: [primitiveMappings[def.innerType._def.typeName], "null"] };
|
|
9980
9977
|
}
|
|
9981
9978
|
if (refs.target === "openApi3") {
|
|
9982
|
-
const base
|
|
9979
|
+
const base = parseDef(def.innerType._def, {
|
|
9983
9980
|
...refs,
|
|
9984
9981
|
currentPath: [...refs.currentPath]
|
|
9985
9982
|
});
|
|
9986
|
-
if (base
|
|
9987
|
-
allOf: [base
|
|
9983
|
+
if (base && "$ref" in base) return {
|
|
9984
|
+
allOf: [base],
|
|
9988
9985
|
nullable: true
|
|
9989
9986
|
};
|
|
9990
|
-
return base
|
|
9991
|
-
...base
|
|
9987
|
+
return base && {
|
|
9988
|
+
...base,
|
|
9992
9989
|
nullable: true
|
|
9993
9990
|
};
|
|
9994
9991
|
}
|
|
@@ -10004,7 +10001,7 @@ function parseNullableDef(def, refs) {
|
|
|
10004
10001
|
}
|
|
10005
10002
|
|
|
10006
10003
|
//#endregion
|
|
10007
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10004
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
10008
10005
|
function parseNumberDef(def, refs) {
|
|
10009
10006
|
const res = { type: "number" };
|
|
10010
10007
|
if (!def.checks) return res;
|
|
@@ -10037,14 +10034,14 @@ function parseNumberDef(def, refs) {
|
|
|
10037
10034
|
}
|
|
10038
10035
|
|
|
10039
10036
|
//#endregion
|
|
10040
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10037
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
10041
10038
|
function parseObjectDef(def, refs) {
|
|
10042
10039
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
10043
10040
|
const result = {
|
|
10044
10041
|
type: "object",
|
|
10045
10042
|
properties: {}
|
|
10046
10043
|
};
|
|
10047
|
-
const required
|
|
10044
|
+
const required = [];
|
|
10048
10045
|
const shape = def.shape();
|
|
10049
10046
|
for (const propName in shape) {
|
|
10050
10047
|
let propDef = shape[propName];
|
|
@@ -10070,9 +10067,9 @@ function parseObjectDef(def, refs) {
|
|
|
10070
10067
|
});
|
|
10071
10068
|
if (parsedDef === void 0) continue;
|
|
10072
10069
|
result.properties[propName] = parsedDef;
|
|
10073
|
-
if (!propOptional) required
|
|
10070
|
+
if (!propOptional) required.push(propName);
|
|
10074
10071
|
}
|
|
10075
|
-
if (required
|
|
10072
|
+
if (required.length) result.required = required;
|
|
10076
10073
|
const additionalProperties = decideAdditionalProperties(def, refs);
|
|
10077
10074
|
if (additionalProperties !== void 0) result.additionalProperties = additionalProperties;
|
|
10078
10075
|
return result;
|
|
@@ -10097,7 +10094,7 @@ function safeIsOptional(schema) {
|
|
|
10097
10094
|
}
|
|
10098
10095
|
|
|
10099
10096
|
//#endregion
|
|
10100
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10097
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
10101
10098
|
const parseOptionalDef = (def, refs) => {
|
|
10102
10099
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) return parseDef(def.innerType._def, refs);
|
|
10103
10100
|
const innerSchema = parseDef(def.innerType._def, {
|
|
@@ -10112,7 +10109,7 @@ const parseOptionalDef = (def, refs) => {
|
|
|
10112
10109
|
};
|
|
10113
10110
|
|
|
10114
10111
|
//#endregion
|
|
10115
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10112
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
10116
10113
|
const parsePipelineDef = (def, refs) => {
|
|
10117
10114
|
if (refs.pipeStrategy === "input") return parseDef(def.in._def, refs);
|
|
10118
10115
|
else if (refs.pipeStrategy === "output") return parseDef(def.out._def, refs);
|
|
@@ -10135,13 +10132,13 @@ const parsePipelineDef = (def, refs) => {
|
|
|
10135
10132
|
};
|
|
10136
10133
|
|
|
10137
10134
|
//#endregion
|
|
10138
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10135
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
10139
10136
|
function parsePromiseDef(def, refs) {
|
|
10140
10137
|
return parseDef(def.type._def, refs);
|
|
10141
10138
|
}
|
|
10142
10139
|
|
|
10143
10140
|
//#endregion
|
|
10144
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10141
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
10145
10142
|
function parseSetDef(def, refs) {
|
|
10146
10143
|
const schema = {
|
|
10147
10144
|
type: "array",
|
|
@@ -10157,7 +10154,7 @@ function parseSetDef(def, refs) {
|
|
|
10157
10154
|
}
|
|
10158
10155
|
|
|
10159
10156
|
//#endregion
|
|
10160
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10157
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
10161
10158
|
function parseTupleDef(def, refs) {
|
|
10162
10159
|
if (def.rest) return {
|
|
10163
10160
|
type: "array",
|
|
@@ -10191,25 +10188,25 @@ function parseTupleDef(def, refs) {
|
|
|
10191
10188
|
}
|
|
10192
10189
|
|
|
10193
10190
|
//#endregion
|
|
10194
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10191
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
10195
10192
|
function parseUndefinedDef(refs) {
|
|
10196
10193
|
return { not: parseAnyDef(refs) };
|
|
10197
10194
|
}
|
|
10198
10195
|
|
|
10199
10196
|
//#endregion
|
|
10200
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10197
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
10201
10198
|
function parseUnknownDef(refs) {
|
|
10202
10199
|
return parseAnyDef(refs);
|
|
10203
10200
|
}
|
|
10204
10201
|
|
|
10205
10202
|
//#endregion
|
|
10206
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10203
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
10207
10204
|
const parseReadonlyDef = (def, refs) => {
|
|
10208
10205
|
return parseDef(def.innerType._def, refs);
|
|
10209
10206
|
};
|
|
10210
10207
|
|
|
10211
10208
|
//#endregion
|
|
10212
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10209
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
10213
10210
|
const selectParser = (def, typeName, refs) => {
|
|
10214
10211
|
switch (typeName) {
|
|
10215
10212
|
case ZodFirstPartyTypeKind.ZodString: return parseStringDef(def, refs);
|
|
@@ -10253,7 +10250,7 @@ const selectParser = (def, typeName, refs) => {
|
|
|
10253
10250
|
};
|
|
10254
10251
|
|
|
10255
10252
|
//#endregion
|
|
10256
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10253
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
10257
10254
|
function parseDef(def, refs, forceResolution = false) {
|
|
10258
10255
|
const seenItem = refs.seen.get(def);
|
|
10259
10256
|
if (refs.override) {
|
|
@@ -10303,27 +10300,27 @@ const addMeta = (def, refs, jsonSchema) => {
|
|
|
10303
10300
|
};
|
|
10304
10301
|
|
|
10305
10302
|
//#endregion
|
|
10306
|
-
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.
|
|
10303
|
+
//#region node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
10307
10304
|
const zodToJsonSchema = (schema, options) => {
|
|
10308
10305
|
const refs = getRefs(options);
|
|
10309
|
-
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name
|
|
10306
|
+
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name, schema]) => ({
|
|
10310
10307
|
...acc,
|
|
10311
|
-
[name
|
|
10308
|
+
[name]: parseDef(schema._def, {
|
|
10312
10309
|
...refs,
|
|
10313
10310
|
currentPath: [
|
|
10314
10311
|
...refs.basePath,
|
|
10315
10312
|
refs.definitionPath,
|
|
10316
|
-
name
|
|
10313
|
+
name
|
|
10317
10314
|
]
|
|
10318
10315
|
}, true) ?? parseAnyDef(refs)
|
|
10319
10316
|
}), {}) : void 0;
|
|
10320
|
-
const name
|
|
10321
|
-
const main = parseDef(schema._def, name
|
|
10317
|
+
const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
|
|
10318
|
+
const main = parseDef(schema._def, name === void 0 ? refs : {
|
|
10322
10319
|
...refs,
|
|
10323
10320
|
currentPath: [
|
|
10324
10321
|
...refs.basePath,
|
|
10325
10322
|
refs.definitionPath,
|
|
10326
|
-
name
|
|
10323
|
+
name
|
|
10327
10324
|
]
|
|
10328
10325
|
}, false) ?? parseAnyDef(refs);
|
|
10329
10326
|
const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
|
|
@@ -10346,18 +10343,18 @@ const zodToJsonSchema = (schema, options) => {
|
|
|
10346
10343
|
].join("/") }
|
|
10347
10344
|
};
|
|
10348
10345
|
}
|
|
10349
|
-
const combined = name
|
|
10346
|
+
const combined = name === void 0 ? definitions ? {
|
|
10350
10347
|
...main,
|
|
10351
10348
|
[refs.definitionPath]: definitions
|
|
10352
10349
|
} : main : {
|
|
10353
10350
|
$ref: [
|
|
10354
10351
|
...refs.$refStrategy === "relative" ? [] : refs.basePath,
|
|
10355
10352
|
refs.definitionPath,
|
|
10356
|
-
name
|
|
10353
|
+
name
|
|
10357
10354
|
].join("/"),
|
|
10358
10355
|
[refs.definitionPath]: {
|
|
10359
10356
|
...definitions,
|
|
10360
|
-
[name
|
|
10357
|
+
[name]: main
|
|
10361
10358
|
}
|
|
10362
10359
|
};
|
|
10363
10360
|
if (refs.target === "jsonSchema7") combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
@@ -10367,7 +10364,7 @@ const zodToJsonSchema = (schema, options) => {
|
|
|
10367
10364
|
};
|
|
10368
10365
|
|
|
10369
10366
|
//#endregion
|
|
10370
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
10367
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
10371
10368
|
function mapMiniTarget(t) {
|
|
10372
10369
|
if (!t) return "draft-7";
|
|
10373
10370
|
if (t === "jsonSchema7" || t === "draft-7") return "draft-7";
|
|
@@ -10398,7 +10395,7 @@ function parseWithCompat(schema, data) {
|
|
|
10398
10395
|
}
|
|
10399
10396
|
|
|
10400
10397
|
//#endregion
|
|
10401
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
10398
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
10402
10399
|
/**
|
|
10403
10400
|
* The default request timeout, in miliseconds.
|
|
10404
10401
|
*/
|
|
@@ -10800,34 +10797,34 @@ var Protocol = class {
|
|
|
10800
10797
|
};
|
|
10801
10798
|
} else throw new McpError(ErrorCode.InternalError, "Task creation did not return a task");
|
|
10802
10799
|
while (true) {
|
|
10803
|
-
const task
|
|
10800
|
+
const task = await this.getTask({ taskId }, options);
|
|
10804
10801
|
yield {
|
|
10805
10802
|
type: "taskStatus",
|
|
10806
|
-
task
|
|
10803
|
+
task
|
|
10807
10804
|
};
|
|
10808
|
-
if (isTerminal(task
|
|
10809
|
-
if (task
|
|
10805
|
+
if (isTerminal(task.status)) {
|
|
10806
|
+
if (task.status === "completed") yield {
|
|
10810
10807
|
type: "result",
|
|
10811
10808
|
result: await this.getTaskResult({ taskId }, resultSchema, options)
|
|
10812
10809
|
};
|
|
10813
|
-
else if (task
|
|
10810
|
+
else if (task.status === "failed") yield {
|
|
10814
10811
|
type: "error",
|
|
10815
10812
|
error: new McpError(ErrorCode.InternalError, `Task ${taskId} failed`)
|
|
10816
10813
|
};
|
|
10817
|
-
else if (task
|
|
10814
|
+
else if (task.status === "cancelled") yield {
|
|
10818
10815
|
type: "error",
|
|
10819
10816
|
error: new McpError(ErrorCode.InternalError, `Task ${taskId} was cancelled`)
|
|
10820
10817
|
};
|
|
10821
10818
|
return;
|
|
10822
10819
|
}
|
|
10823
|
-
if (task
|
|
10820
|
+
if (task.status === "input_required") {
|
|
10824
10821
|
yield {
|
|
10825
10822
|
type: "result",
|
|
10826
10823
|
result: await this.getTaskResult({ taskId }, resultSchema, options)
|
|
10827
10824
|
};
|
|
10828
10825
|
return;
|
|
10829
10826
|
}
|
|
10830
|
-
const pollInterval = task
|
|
10827
|
+
const pollInterval = task.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
10831
10828
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
10832
10829
|
options?.signal?.throwIfAborted();
|
|
10833
10830
|
}
|
|
@@ -11001,7 +10998,7 @@ var Protocol = class {
|
|
|
11001
10998
|
this.assertNotificationCapability(notification.method);
|
|
11002
10999
|
const relatedTaskId = options?.relatedTask?.taskId;
|
|
11003
11000
|
if (relatedTaskId) {
|
|
11004
|
-
const jsonrpcNotification
|
|
11001
|
+
const jsonrpcNotification = {
|
|
11005
11002
|
...notification,
|
|
11006
11003
|
jsonrpc: "2.0",
|
|
11007
11004
|
params: {
|
|
@@ -11014,7 +11011,7 @@ var Protocol = class {
|
|
|
11014
11011
|
};
|
|
11015
11012
|
await this._enqueueTaskMessage(relatedTaskId, {
|
|
11016
11013
|
type: "notification",
|
|
11017
|
-
message: jsonrpcNotification
|
|
11014
|
+
message: jsonrpcNotification,
|
|
11018
11015
|
timestamp: Date.now()
|
|
11019
11016
|
});
|
|
11020
11017
|
return;
|
|
@@ -11025,21 +11022,21 @@ var Protocol = class {
|
|
|
11025
11022
|
Promise.resolve().then(() => {
|
|
11026
11023
|
this._pendingDebouncedNotifications.delete(notification.method);
|
|
11027
11024
|
if (!this._transport) return;
|
|
11028
|
-
let jsonrpcNotification
|
|
11025
|
+
let jsonrpcNotification = {
|
|
11029
11026
|
...notification,
|
|
11030
11027
|
jsonrpc: "2.0"
|
|
11031
11028
|
};
|
|
11032
|
-
if (options?.relatedTask) jsonrpcNotification
|
|
11033
|
-
...jsonrpcNotification
|
|
11029
|
+
if (options?.relatedTask) jsonrpcNotification = {
|
|
11030
|
+
...jsonrpcNotification,
|
|
11034
11031
|
params: {
|
|
11035
|
-
...jsonrpcNotification
|
|
11032
|
+
...jsonrpcNotification.params,
|
|
11036
11033
|
_meta: {
|
|
11037
|
-
...jsonrpcNotification
|
|
11034
|
+
...jsonrpcNotification.params?._meta || {},
|
|
11038
11035
|
[RELATED_TASK_META_KEY]: options.relatedTask
|
|
11039
11036
|
}
|
|
11040
11037
|
}
|
|
11041
11038
|
};
|
|
11042
|
-
this._transport?.send(jsonrpcNotification
|
|
11039
|
+
this._transport?.send(jsonrpcNotification, options).catch((error) => this._onerror(error));
|
|
11043
11040
|
});
|
|
11044
11041
|
return;
|
|
11045
11042
|
}
|
|
@@ -11269,9 +11266,9 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11269
11266
|
};
|
|
11270
11267
|
exports.Name = Name;
|
|
11271
11268
|
var _Code = class extends _CodeOrName {
|
|
11272
|
-
constructor(code
|
|
11269
|
+
constructor(code) {
|
|
11273
11270
|
super();
|
|
11274
|
-
this._items = typeof code
|
|
11271
|
+
this._items = typeof code === "string" ? [code] : code;
|
|
11275
11272
|
}
|
|
11276
11273
|
toString() {
|
|
11277
11274
|
return this.str;
|
|
@@ -11282,12 +11279,12 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11282
11279
|
return item === "" || item === "\"\"";
|
|
11283
11280
|
}
|
|
11284
11281
|
get str() {
|
|
11285
|
-
var _a
|
|
11286
|
-
return (_a
|
|
11282
|
+
var _a;
|
|
11283
|
+
return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
|
|
11287
11284
|
}
|
|
11288
11285
|
get names() {
|
|
11289
|
-
var _a
|
|
11290
|
-
return (_a
|
|
11286
|
+
var _a;
|
|
11287
|
+
return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => {
|
|
11291
11288
|
if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1;
|
|
11292
11289
|
return names;
|
|
11293
11290
|
}, {});
|
|
@@ -11296,13 +11293,13 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11296
11293
|
exports._Code = _Code;
|
|
11297
11294
|
exports.nil = new _Code("");
|
|
11298
11295
|
function _(strs, ...args) {
|
|
11299
|
-
const code
|
|
11296
|
+
const code = [strs[0]];
|
|
11300
11297
|
let i = 0;
|
|
11301
11298
|
while (i < args.length) {
|
|
11302
|
-
addCodeArg(code
|
|
11303
|
-
code
|
|
11299
|
+
addCodeArg(code, args[i]);
|
|
11300
|
+
code.push(strs[++i]);
|
|
11304
11301
|
}
|
|
11305
|
-
return new _Code(code
|
|
11302
|
+
return new _Code(code);
|
|
11306
11303
|
}
|
|
11307
11304
|
exports._ = _;
|
|
11308
11305
|
const plus = new _Code("+");
|
|
@@ -11318,10 +11315,10 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11318
11315
|
return new _Code(expr);
|
|
11319
11316
|
}
|
|
11320
11317
|
exports.str = str;
|
|
11321
|
-
function addCodeArg(code
|
|
11322
|
-
if (arg instanceof _Code) code
|
|
11323
|
-
else if (arg instanceof Name) code
|
|
11324
|
-
else code
|
|
11318
|
+
function addCodeArg(code, arg) {
|
|
11319
|
+
if (arg instanceof _Code) code.push(...arg._items);
|
|
11320
|
+
else if (arg instanceof Name) code.push(arg);
|
|
11321
|
+
else code.push(interpolate(arg));
|
|
11325
11322
|
}
|
|
11326
11323
|
exports.addCodeArg = addCodeArg;
|
|
11327
11324
|
function optimize(expr) {
|
|
@@ -11386,9 +11383,9 @@ var require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11386
11383
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
11387
11384
|
const code_1 = require_code$1();
|
|
11388
11385
|
var ValueError = class extends Error {
|
|
11389
|
-
constructor(name
|
|
11390
|
-
super(`CodeGen: "code" for ${name
|
|
11391
|
-
this.value = name
|
|
11386
|
+
constructor(name) {
|
|
11387
|
+
super(`CodeGen: "code" for ${name} not defined`);
|
|
11388
|
+
this.value = name.value;
|
|
11392
11389
|
}
|
|
11393
11390
|
};
|
|
11394
11391
|
var UsedValueState;
|
|
@@ -11418,8 +11415,8 @@ var require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11418
11415
|
return `${prefix}${ng.index++}`;
|
|
11419
11416
|
}
|
|
11420
11417
|
_nameGroup(prefix) {
|
|
11421
|
-
var _a
|
|
11422
|
-
if (((_b = (_a
|
|
11418
|
+
var _a, _b;
|
|
11419
|
+
if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
|
|
11423
11420
|
return this._names[prefix] = {
|
|
11424
11421
|
prefix,
|
|
11425
11422
|
index: 0
|
|
@@ -11456,25 +11453,25 @@ var require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11456
11453
|
return new ValueScopeName(prefix, this._newName(prefix));
|
|
11457
11454
|
}
|
|
11458
11455
|
value(nameOrPrefix, value) {
|
|
11459
|
-
var _a
|
|
11456
|
+
var _a;
|
|
11460
11457
|
if (value.ref === void 0) throw new Error("CodeGen: ref must be passed in value");
|
|
11461
|
-
const name
|
|
11462
|
-
const { prefix } = name
|
|
11463
|
-
const valueKey = (_a
|
|
11458
|
+
const name = this.toName(nameOrPrefix);
|
|
11459
|
+
const { prefix } = name;
|
|
11460
|
+
const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
|
|
11464
11461
|
let vs = this._values[prefix];
|
|
11465
11462
|
if (vs) {
|
|
11466
11463
|
const _name = vs.get(valueKey);
|
|
11467
11464
|
if (_name) return _name;
|
|
11468
11465
|
} else vs = this._values[prefix] = /* @__PURE__ */ new Map();
|
|
11469
|
-
vs.set(valueKey, name
|
|
11466
|
+
vs.set(valueKey, name);
|
|
11470
11467
|
const s = this._scope[prefix] || (this._scope[prefix] = []);
|
|
11471
11468
|
const itemIndex = s.length;
|
|
11472
11469
|
s[itemIndex] = value.ref;
|
|
11473
|
-
name
|
|
11470
|
+
name.setValue(value, {
|
|
11474
11471
|
property: prefix,
|
|
11475
11472
|
itemIndex
|
|
11476
11473
|
});
|
|
11477
|
-
return name
|
|
11474
|
+
return name;
|
|
11478
11475
|
}
|
|
11479
11476
|
getValue(prefix, keyOrRef) {
|
|
11480
11477
|
const vs = this._values[prefix];
|
|
@@ -11482,36 +11479,36 @@ var require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11482
11479
|
return vs.get(keyOrRef);
|
|
11483
11480
|
}
|
|
11484
11481
|
scopeRefs(scopeName, values = this._values) {
|
|
11485
|
-
return this._reduceValues(values, (name
|
|
11486
|
-
if (name
|
|
11487
|
-
return (0, code_1._)`${scopeName}${name
|
|
11482
|
+
return this._reduceValues(values, (name) => {
|
|
11483
|
+
if (name.scopePath === void 0) throw new Error(`CodeGen: name "${name}" has no value`);
|
|
11484
|
+
return (0, code_1._)`${scopeName}${name.scopePath}`;
|
|
11488
11485
|
});
|
|
11489
11486
|
}
|
|
11490
11487
|
scopeCode(values = this._values, usedValues, getCode) {
|
|
11491
|
-
return this._reduceValues(values, (name
|
|
11492
|
-
if (name
|
|
11493
|
-
return name
|
|
11488
|
+
return this._reduceValues(values, (name) => {
|
|
11489
|
+
if (name.value === void 0) throw new Error(`CodeGen: name "${name}" has no value`);
|
|
11490
|
+
return name.value.code;
|
|
11494
11491
|
}, usedValues, getCode);
|
|
11495
11492
|
}
|
|
11496
11493
|
_reduceValues(values, valueCode, usedValues = {}, getCode) {
|
|
11497
|
-
let code
|
|
11494
|
+
let code = code_1.nil;
|
|
11498
11495
|
for (const prefix in values) {
|
|
11499
11496
|
const vs = values[prefix];
|
|
11500
11497
|
if (!vs) continue;
|
|
11501
11498
|
const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map();
|
|
11502
|
-
vs.forEach((name
|
|
11503
|
-
if (nameSet.has(name
|
|
11504
|
-
nameSet.set(name
|
|
11505
|
-
let c = valueCode(name
|
|
11499
|
+
vs.forEach((name) => {
|
|
11500
|
+
if (nameSet.has(name)) return;
|
|
11501
|
+
nameSet.set(name, UsedValueState.Started);
|
|
11502
|
+
let c = valueCode(name);
|
|
11506
11503
|
if (c) {
|
|
11507
11504
|
const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
|
|
11508
|
-
code
|
|
11509
|
-
} else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name
|
|
11510
|
-
else throw new ValueError(name
|
|
11511
|
-
nameSet.set(name
|
|
11505
|
+
code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;
|
|
11506
|
+
} else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) code = (0, code_1._)`${code}${c}${this.opts._n}`;
|
|
11507
|
+
else throw new ValueError(name);
|
|
11508
|
+
nameSet.set(name, UsedValueState.Completed);
|
|
11512
11509
|
});
|
|
11513
11510
|
}
|
|
11514
|
-
return code
|
|
11511
|
+
return code;
|
|
11515
11512
|
}
|
|
11516
11513
|
};
|
|
11517
11514
|
exports.ValueScope = ValueScope;
|
|
@@ -11619,10 +11616,10 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11619
11616
|
}
|
|
11620
11617
|
};
|
|
11621
11618
|
var Def = class extends Node {
|
|
11622
|
-
constructor(varKind, name
|
|
11619
|
+
constructor(varKind, name, rhs) {
|
|
11623
11620
|
super();
|
|
11624
11621
|
this.varKind = varKind;
|
|
11625
|
-
this.name = name
|
|
11622
|
+
this.name = name;
|
|
11626
11623
|
this.rhs = rhs;
|
|
11627
11624
|
}
|
|
11628
11625
|
render({ es5, _n }) {
|
|
@@ -11700,9 +11697,9 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11700
11697
|
}
|
|
11701
11698
|
};
|
|
11702
11699
|
var AnyCode = class extends Node {
|
|
11703
|
-
constructor(code
|
|
11700
|
+
constructor(code) {
|
|
11704
11701
|
super();
|
|
11705
|
-
this.code = code
|
|
11702
|
+
this.code = code;
|
|
11706
11703
|
}
|
|
11707
11704
|
render({ _n }) {
|
|
11708
11705
|
return `${this.code};` + _n;
|
|
@@ -11724,7 +11721,7 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11724
11721
|
this.nodes = nodes;
|
|
11725
11722
|
}
|
|
11726
11723
|
render(opts) {
|
|
11727
|
-
return this.nodes.reduce((code
|
|
11724
|
+
return this.nodes.reduce((code, n) => code + n.render(opts), "");
|
|
11728
11725
|
}
|
|
11729
11726
|
optimizeNodes() {
|
|
11730
11727
|
const { nodes } = this;
|
|
@@ -11766,9 +11763,9 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11766
11763
|
this.condition = condition;
|
|
11767
11764
|
}
|
|
11768
11765
|
render(opts) {
|
|
11769
|
-
let code
|
|
11770
|
-
if (this.else) code
|
|
11771
|
-
return code
|
|
11766
|
+
let code = `if(${this.condition})` + super.render(opts);
|
|
11767
|
+
if (this.else) code += "else " + this.else.render(opts);
|
|
11768
|
+
return code;
|
|
11772
11769
|
}
|
|
11773
11770
|
optimizeNodes() {
|
|
11774
11771
|
super.optimizeNodes();
|
|
@@ -11788,8 +11785,8 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11788
11785
|
return this;
|
|
11789
11786
|
}
|
|
11790
11787
|
optimizeNames(names, constants) {
|
|
11791
|
-
var _a
|
|
11792
|
-
this.else = (_a
|
|
11788
|
+
var _a;
|
|
11789
|
+
this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
|
|
11793
11790
|
if (!(super.optimizeNames(names, constants) || this.else)) return;
|
|
11794
11791
|
this.condition = optimizeExpr(this.condition, names, constants);
|
|
11795
11792
|
return this;
|
|
@@ -11822,28 +11819,28 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11822
11819
|
}
|
|
11823
11820
|
};
|
|
11824
11821
|
var ForRange = class extends For {
|
|
11825
|
-
constructor(varKind, name
|
|
11822
|
+
constructor(varKind, name, from, to) {
|
|
11826
11823
|
super();
|
|
11827
11824
|
this.varKind = varKind;
|
|
11828
|
-
this.name = name
|
|
11825
|
+
this.name = name;
|
|
11829
11826
|
this.from = from;
|
|
11830
11827
|
this.to = to;
|
|
11831
11828
|
}
|
|
11832
11829
|
render(opts) {
|
|
11833
11830
|
const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
|
|
11834
|
-
const { name
|
|
11835
|
-
return `for(${varKind} ${name
|
|
11831
|
+
const { name, from, to } = this;
|
|
11832
|
+
return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
|
|
11836
11833
|
}
|
|
11837
11834
|
get names() {
|
|
11838
11835
|
return addExprNames(addExprNames(super.names, this.from), this.to);
|
|
11839
11836
|
}
|
|
11840
11837
|
};
|
|
11841
11838
|
var ForIter = class extends For {
|
|
11842
|
-
constructor(loop, varKind, name
|
|
11839
|
+
constructor(loop, varKind, name, iterable) {
|
|
11843
11840
|
super();
|
|
11844
11841
|
this.loop = loop;
|
|
11845
11842
|
this.varKind = varKind;
|
|
11846
|
-
this.name = name
|
|
11843
|
+
this.name = name;
|
|
11847
11844
|
this.iterable = iterable;
|
|
11848
11845
|
}
|
|
11849
11846
|
render(opts) {
|
|
@@ -11859,9 +11856,9 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11859
11856
|
}
|
|
11860
11857
|
};
|
|
11861
11858
|
var Func = class extends BlockNode {
|
|
11862
|
-
constructor(name
|
|
11859
|
+
constructor(name, args, async) {
|
|
11863
11860
|
super();
|
|
11864
|
-
this.name = name
|
|
11861
|
+
this.name = name;
|
|
11865
11862
|
this.args = args;
|
|
11866
11863
|
this.async = async;
|
|
11867
11864
|
}
|
|
@@ -11878,22 +11875,22 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11878
11875
|
Return.kind = "return";
|
|
11879
11876
|
var Try = class extends BlockNode {
|
|
11880
11877
|
render(opts) {
|
|
11881
|
-
let code
|
|
11882
|
-
if (this.catch) code
|
|
11883
|
-
if (this.finally) code
|
|
11884
|
-
return code
|
|
11878
|
+
let code = "try" + super.render(opts);
|
|
11879
|
+
if (this.catch) code += this.catch.render(opts);
|
|
11880
|
+
if (this.finally) code += this.finally.render(opts);
|
|
11881
|
+
return code;
|
|
11885
11882
|
}
|
|
11886
11883
|
optimizeNodes() {
|
|
11887
|
-
var _a
|
|
11884
|
+
var _a, _b;
|
|
11888
11885
|
super.optimizeNodes();
|
|
11889
|
-
(_a
|
|
11886
|
+
(_a = this.catch) === null || _a === void 0 || _a.optimizeNodes();
|
|
11890
11887
|
(_b = this.finally) === null || _b === void 0 || _b.optimizeNodes();
|
|
11891
11888
|
return this;
|
|
11892
11889
|
}
|
|
11893
11890
|
optimizeNames(names, constants) {
|
|
11894
|
-
var _a
|
|
11891
|
+
var _a, _b;
|
|
11895
11892
|
super.optimizeNames(names, constants);
|
|
11896
|
-
(_a
|
|
11893
|
+
(_a = this.catch) === null || _a === void 0 || _a.optimizeNames(names, constants);
|
|
11897
11894
|
(_b = this.finally) === null || _b === void 0 || _b.optimizeNames(names, constants);
|
|
11898
11895
|
return this;
|
|
11899
11896
|
}
|
|
@@ -11943,9 +11940,9 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11943
11940
|
return this._extScope.name(prefix);
|
|
11944
11941
|
}
|
|
11945
11942
|
scopeValue(prefixOrName, value) {
|
|
11946
|
-
const name
|
|
11947
|
-
(this._values[name
|
|
11948
|
-
return name
|
|
11943
|
+
const name = this._extScope.value(prefixOrName, value);
|
|
11944
|
+
(this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set())).add(name);
|
|
11945
|
+
return name;
|
|
11949
11946
|
}
|
|
11950
11947
|
getScopeValue(prefix, keyOrRef) {
|
|
11951
11948
|
return this._extScope.getValue(prefix, keyOrRef);
|
|
@@ -11957,10 +11954,10 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11957
11954
|
return this._extScope.scopeCode(this._values);
|
|
11958
11955
|
}
|
|
11959
11956
|
_def(varKind, nameOrPrefix, rhs, constant) {
|
|
11960
|
-
const name
|
|
11961
|
-
if (rhs !== void 0 && constant) this._constants[name
|
|
11962
|
-
this._leafNode(new Def(varKind, name
|
|
11963
|
-
return name
|
|
11957
|
+
const name = this._scope.toName(nameOrPrefix);
|
|
11958
|
+
if (rhs !== void 0 && constant) this._constants[name.str] = rhs;
|
|
11959
|
+
this._leafNode(new Def(varKind, name, rhs));
|
|
11960
|
+
return name;
|
|
11964
11961
|
}
|
|
11965
11962
|
const(nameOrPrefix, rhs, _constant) {
|
|
11966
11963
|
return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
|
|
@@ -11983,17 +11980,17 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11983
11980
|
return this;
|
|
11984
11981
|
}
|
|
11985
11982
|
object(...keyValues) {
|
|
11986
|
-
const code
|
|
11983
|
+
const code = ["{"];
|
|
11987
11984
|
for (const [key, value] of keyValues) {
|
|
11988
|
-
if (code
|
|
11989
|
-
code
|
|
11985
|
+
if (code.length > 1) code.push(",");
|
|
11986
|
+
code.push(key);
|
|
11990
11987
|
if (key !== value || this.opts.es5) {
|
|
11991
|
-
code
|
|
11992
|
-
(0, code_1.addCodeArg)(code
|
|
11988
|
+
code.push(":");
|
|
11989
|
+
(0, code_1.addCodeArg)(code, value);
|
|
11993
11990
|
}
|
|
11994
11991
|
}
|
|
11995
|
-
code
|
|
11996
|
-
return new code_1._Code(code
|
|
11992
|
+
code.push("}");
|
|
11993
|
+
return new code_1._Code(code);
|
|
11997
11994
|
}
|
|
11998
11995
|
if(condition, thenBody, elseBody) {
|
|
11999
11996
|
this._blockNode(new If(condition));
|
|
@@ -12020,24 +12017,24 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12020
12017
|
return this._for(new ForLoop(iteration), forBody);
|
|
12021
12018
|
}
|
|
12022
12019
|
forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
|
|
12023
|
-
const name
|
|
12024
|
-
return this._for(new ForRange(varKind, name
|
|
12020
|
+
const name = this._scope.toName(nameOrPrefix);
|
|
12021
|
+
return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
|
|
12025
12022
|
}
|
|
12026
12023
|
forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
|
|
12027
|
-
const name
|
|
12024
|
+
const name = this._scope.toName(nameOrPrefix);
|
|
12028
12025
|
if (this.opts.es5) {
|
|
12029
12026
|
const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
|
|
12030
12027
|
return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i) => {
|
|
12031
|
-
this.var(name
|
|
12032
|
-
forBody(name
|
|
12028
|
+
this.var(name, (0, code_1._)`${arr}[${i}]`);
|
|
12029
|
+
forBody(name);
|
|
12033
12030
|
});
|
|
12034
12031
|
}
|
|
12035
|
-
return this._for(new ForIter("of", varKind, name
|
|
12032
|
+
return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
|
|
12036
12033
|
}
|
|
12037
12034
|
forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
|
|
12038
12035
|
if (this.opts.ownProperties) return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody);
|
|
12039
|
-
const name
|
|
12040
|
-
return this._for(new ForIter("in", varKind, name
|
|
12036
|
+
const name = this._scope.toName(nameOrPrefix);
|
|
12037
|
+
return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
|
|
12041
12038
|
}
|
|
12042
12039
|
endFor() {
|
|
12043
12040
|
return this._endBlockNode(For);
|
|
@@ -12087,8 +12084,8 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12087
12084
|
this._nodes.length = len;
|
|
12088
12085
|
return this;
|
|
12089
12086
|
}
|
|
12090
|
-
func(name
|
|
12091
|
-
this._blockNode(new Func(name
|
|
12087
|
+
func(name, args = code_1.nil, async, funcBody) {
|
|
12088
|
+
this._blockNode(new Func(name, args, async));
|
|
12092
12089
|
if (funcBody) this.code(funcBody).endFunc();
|
|
12093
12090
|
return this;
|
|
12094
12091
|
}
|
|
@@ -12257,9 +12254,9 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12257
12254
|
else f(xs);
|
|
12258
12255
|
}
|
|
12259
12256
|
exports.eachItem = eachItem;
|
|
12260
|
-
function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues
|
|
12257
|
+
function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) {
|
|
12261
12258
|
return (gen, from, to, toName) => {
|
|
12262
|
-
const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues
|
|
12259
|
+
const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues(from, to);
|
|
12263
12260
|
return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
|
|
12264
12261
|
};
|
|
12265
12262
|
}
|
|
@@ -12569,8 +12566,8 @@ var require_applicability = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12569
12566
|
}
|
|
12570
12567
|
exports.shouldUseGroup = shouldUseGroup;
|
|
12571
12568
|
function shouldUseRule(schema, rule) {
|
|
12572
|
-
var _a
|
|
12573
|
-
return schema[rule.keyword] !== void 0 || ((_a
|
|
12569
|
+
var _a;
|
|
12570
|
+
return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));
|
|
12574
12571
|
}
|
|
12575
12572
|
exports.shouldUseRule = shouldUseRule;
|
|
12576
12573
|
}));
|
|
@@ -12918,13 +12915,13 @@ var require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12918
12915
|
}
|
|
12919
12916
|
exports.macroKeywordCode = macroKeywordCode;
|
|
12920
12917
|
function funcKeywordCode(cxt, def) {
|
|
12921
|
-
var _a
|
|
12918
|
+
var _a;
|
|
12922
12919
|
const { gen, keyword, schema, parentSchema, $data, it } = cxt;
|
|
12923
12920
|
checkAsyncKeyword(it, def);
|
|
12924
12921
|
const validateRef = useKeyword(gen, keyword, !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate);
|
|
12925
12922
|
const valid = gen.let("valid");
|
|
12926
12923
|
cxt.block$data(valid, validateKeyword);
|
|
12927
|
-
cxt.ok((_a
|
|
12924
|
+
cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);
|
|
12928
12925
|
function validateKeyword() {
|
|
12929
12926
|
if (def.errors === false) {
|
|
12930
12927
|
assignValid();
|
|
@@ -12953,8 +12950,8 @@ var require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12953
12950
|
gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
|
|
12954
12951
|
}
|
|
12955
12952
|
function reportErrs(errors) {
|
|
12956
|
-
var _a
|
|
12957
|
-
gen.if((0, codegen_1.not)((_a
|
|
12953
|
+
var _a;
|
|
12954
|
+
gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);
|
|
12958
12955
|
}
|
|
12959
12956
|
}
|
|
12960
12957
|
exports.funcKeywordCode = funcKeywordCode;
|
|
@@ -13764,7 +13761,7 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13764
13761
|
const validate_1 = require_validate();
|
|
13765
13762
|
var SchemaEnv = class {
|
|
13766
13763
|
constructor(env) {
|
|
13767
|
-
var _a
|
|
13764
|
+
var _a;
|
|
13768
13765
|
this.refs = {};
|
|
13769
13766
|
this.dynamicAnchors = {};
|
|
13770
13767
|
let schema;
|
|
@@ -13772,7 +13769,7 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13772
13769
|
this.schema = env.schema;
|
|
13773
13770
|
this.schemaId = env.schemaId;
|
|
13774
13771
|
this.root = env.root || this;
|
|
13775
|
-
this.baseId = (_a
|
|
13772
|
+
this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
|
|
13776
13773
|
this.schemaPath = env.schemaPath;
|
|
13777
13774
|
this.localRefs = env.localRefs;
|
|
13778
13775
|
this.meta = env.meta;
|
|
@@ -13868,13 +13865,13 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13868
13865
|
}
|
|
13869
13866
|
exports.compileSchema = compileSchema;
|
|
13870
13867
|
function resolveRef(root, baseId, ref) {
|
|
13871
|
-
var _a
|
|
13868
|
+
var _a;
|
|
13872
13869
|
ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
|
|
13873
13870
|
const schOrFunc = root.refs[ref];
|
|
13874
13871
|
if (schOrFunc) return schOrFunc;
|
|
13875
13872
|
let _sch = resolve.call(this, root, ref);
|
|
13876
13873
|
if (_sch === void 0) {
|
|
13877
|
-
const schema = (_a
|
|
13874
|
+
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
13878
13875
|
const { schemaId } = this.opts;
|
|
13879
13876
|
if (schema) _sch = new SchemaEnv({
|
|
13880
13877
|
schema,
|
|
@@ -13940,8 +13937,8 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13940
13937
|
"definitions"
|
|
13941
13938
|
]);
|
|
13942
13939
|
function getJsonPointer(parsedRef, { baseId, schema, root }) {
|
|
13943
|
-
var _a
|
|
13944
|
-
if (((_a
|
|
13940
|
+
var _a;
|
|
13941
|
+
if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") return;
|
|
13945
13942
|
for (const part of parsedRef.fragment.slice(1).split("/")) {
|
|
13946
13943
|
if (typeof schema === "boolean") return;
|
|
13947
13944
|
const partSchema = schema[(0, util_1.unescapeFragment)(part)];
|
|
@@ -13995,18 +13992,18 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
13995
13992
|
*/
|
|
13996
13993
|
function stringArrayToHexStripped(input) {
|
|
13997
13994
|
let acc = "";
|
|
13998
|
-
let code
|
|
13995
|
+
let code = 0;
|
|
13999
13996
|
let i = 0;
|
|
14000
13997
|
for (i = 0; i < input.length; i++) {
|
|
14001
|
-
code
|
|
14002
|
-
if (code
|
|
14003
|
-
if (!(code
|
|
13998
|
+
code = input[i].charCodeAt(0);
|
|
13999
|
+
if (code === 48) continue;
|
|
14000
|
+
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return "";
|
|
14004
14001
|
acc += input[i];
|
|
14005
14002
|
break;
|
|
14006
14003
|
}
|
|
14007
14004
|
for (i += 1; i < input.length; i++) {
|
|
14008
|
-
code
|
|
14009
|
-
if (!(code
|
|
14005
|
+
code = input[i].charCodeAt(0);
|
|
14006
|
+
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return "";
|
|
14010
14007
|
acc += input[i];
|
|
14011
14008
|
}
|
|
14012
14009
|
return acc;
|
|
@@ -14108,13 +14105,13 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14108
14105
|
host,
|
|
14109
14106
|
isIPV6: false
|
|
14110
14107
|
};
|
|
14111
|
-
const ipv6
|
|
14112
|
-
if (!ipv6
|
|
14113
|
-
let newHost = ipv6
|
|
14114
|
-
let escapedHost = ipv6
|
|
14115
|
-
if (ipv6
|
|
14116
|
-
newHost += "%" + ipv6
|
|
14117
|
-
escapedHost += "%25" + ipv6
|
|
14108
|
+
const ipv6 = getIPV6(host);
|
|
14109
|
+
if (!ipv6.error) {
|
|
14110
|
+
let newHost = ipv6.address;
|
|
14111
|
+
let escapedHost = ipv6.address;
|
|
14112
|
+
if (ipv6.zone) {
|
|
14113
|
+
newHost += "%" + ipv6.zone;
|
|
14114
|
+
escapedHost += "%25" + ipv6.zone;
|
|
14118
14115
|
}
|
|
14119
14116
|
return {
|
|
14120
14117
|
host: newHost,
|
|
@@ -14215,8 +14212,8 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14215
14212
|
* @param {boolean} esc
|
|
14216
14213
|
* @returns {import('../types/index').URIComponent}
|
|
14217
14214
|
*/
|
|
14218
|
-
function normalizeComponentEncoding(component, esc
|
|
14219
|
-
const func = esc
|
|
14215
|
+
function normalizeComponentEncoding(component, esc) {
|
|
14216
|
+
const func = esc !== true ? escape : unescape;
|
|
14220
14217
|
if (component.scheme !== void 0) component.scheme = func(component.scheme);
|
|
14221
14218
|
if (component.userinfo !== void 0) component.userinfo = func(component.userinfo);
|
|
14222
14219
|
if (component.host !== void 0) component.host = func(component.host);
|
|
@@ -14280,8 +14277,8 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14280
14277
|
* @param {string} name
|
|
14281
14278
|
* @returns {name is SchemeName}
|
|
14282
14279
|
*/
|
|
14283
|
-
function isValidSchemeName(name
|
|
14284
|
-
return supportedSchemeNames.indexOf(name
|
|
14280
|
+
function isValidSchemeName(name) {
|
|
14281
|
+
return supportedSchemeNames.indexOf(name) !== -1;
|
|
14285
14282
|
}
|
|
14286
14283
|
/**
|
|
14287
14284
|
* @callback SchemeFn
|
|
@@ -14795,9 +14792,9 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14795
14792
|
};
|
|
14796
14793
|
const MAX_EXPRESSION = 200;
|
|
14797
14794
|
function requiredOptions(o) {
|
|
14798
|
-
var _a
|
|
14795
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
14799
14796
|
const s = o.strict;
|
|
14800
|
-
const _optz = (_a
|
|
14797
|
+
const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
|
|
14801
14798
|
const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
|
|
14802
14799
|
const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
|
|
14803
14800
|
const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
|
|
@@ -14867,18 +14864,18 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14867
14864
|
this.addKeyword("$async");
|
|
14868
14865
|
}
|
|
14869
14866
|
_addDefaultMetaSchema() {
|
|
14870
|
-
const { $data, meta
|
|
14867
|
+
const { $data, meta, schemaId } = this.opts;
|
|
14871
14868
|
let _dataRefSchema = $dataRefSchema;
|
|
14872
14869
|
if (schemaId === "id") {
|
|
14873
14870
|
_dataRefSchema = { ...$dataRefSchema };
|
|
14874
14871
|
_dataRefSchema.id = _dataRefSchema.$id;
|
|
14875
14872
|
delete _dataRefSchema.$id;
|
|
14876
14873
|
}
|
|
14877
|
-
if (meta
|
|
14874
|
+
if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
|
|
14878
14875
|
}
|
|
14879
14876
|
defaultMeta() {
|
|
14880
|
-
const { meta
|
|
14881
|
-
return this.opts.defaultMeta = typeof meta
|
|
14877
|
+
const { meta, schemaId } = this.opts;
|
|
14878
|
+
return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : void 0;
|
|
14882
14879
|
}
|
|
14883
14880
|
validate(schemaKeyRef, data) {
|
|
14884
14881
|
let v;
|
|
@@ -14894,10 +14891,10 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14894
14891
|
const sch = this._addSchema(schema, _meta);
|
|
14895
14892
|
return sch.validate || this._compileSchemaEnv(sch);
|
|
14896
14893
|
}
|
|
14897
|
-
compileAsync(schema, meta
|
|
14894
|
+
compileAsync(schema, meta) {
|
|
14898
14895
|
if (typeof this.opts.loadSchema != "function") throw new Error("options.loadSchema should be a function");
|
|
14899
14896
|
const { loadSchema } = this.opts;
|
|
14900
|
-
return runCompileAsync.call(this, schema, meta
|
|
14897
|
+
return runCompileAsync.call(this, schema, meta);
|
|
14901
14898
|
async function runCompileAsync(_schema, _meta) {
|
|
14902
14899
|
await loadMetaSchema.call(this, _schema.$schema);
|
|
14903
14900
|
const sch = this._addSchema(_schema, _meta);
|
|
@@ -14922,7 +14919,7 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14922
14919
|
async function loadMissingSchema(ref) {
|
|
14923
14920
|
const _schema = await _loadSchema.call(this, ref);
|
|
14924
14921
|
if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema);
|
|
14925
|
-
if (!this.refs[ref]) this.addSchema(_schema, ref, meta
|
|
14922
|
+
if (!this.refs[ref]) this.addSchema(_schema, ref, meta);
|
|
14926
14923
|
}
|
|
14927
14924
|
async function _loadSchema(ref) {
|
|
14928
14925
|
const p = this._loading[ref];
|
|
@@ -15066,9 +15063,9 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15066
15063
|
}
|
|
15067
15064
|
return this;
|
|
15068
15065
|
}
|
|
15069
|
-
addFormat(name
|
|
15066
|
+
addFormat(name, format) {
|
|
15070
15067
|
if (typeof format == "string") format = new RegExp(format);
|
|
15071
|
-
this.formats[name
|
|
15068
|
+
this.formats[name] = format;
|
|
15072
15069
|
return this;
|
|
15073
15070
|
}
|
|
15074
15071
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
@@ -15104,7 +15101,7 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15104
15101
|
}
|
|
15105
15102
|
}
|
|
15106
15103
|
}
|
|
15107
|
-
_addSchema(schema, meta
|
|
15104
|
+
_addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
15108
15105
|
let id;
|
|
15109
15106
|
const { schemaId } = this.opts;
|
|
15110
15107
|
if (typeof schema == "object") id = schema[schemaId];
|
|
@@ -15117,7 +15114,7 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15117
15114
|
sch = new compile_1.SchemaEnv({
|
|
15118
15115
|
schema,
|
|
15119
15116
|
schemaId,
|
|
15120
|
-
meta
|
|
15117
|
+
meta,
|
|
15121
15118
|
baseId,
|
|
15122
15119
|
localRefs
|
|
15123
15120
|
});
|
|
@@ -15169,9 +15166,9 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15169
15166
|
else for (const key in optsSchemas) this.addSchema(optsSchemas[key], key);
|
|
15170
15167
|
}
|
|
15171
15168
|
function addInitialFormats() {
|
|
15172
|
-
for (const name
|
|
15173
|
-
const format = this.opts.formats[name
|
|
15174
|
-
if (format) this.addFormat(name
|
|
15169
|
+
for (const name in this.opts.formats) {
|
|
15170
|
+
const format = this.opts.formats[name];
|
|
15171
|
+
if (format) this.addFormat(name, format);
|
|
15175
15172
|
}
|
|
15176
15173
|
}
|
|
15177
15174
|
function addInitialKeywords(defs) {
|
|
@@ -15213,7 +15210,7 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15213
15210
|
if (def.$data && !("code" in def || "validate" in def)) throw new Error("$data keyword must have \"code\" or \"validate\" function");
|
|
15214
15211
|
}
|
|
15215
15212
|
function addRule(keyword, definition, dataType) {
|
|
15216
|
-
var _a
|
|
15213
|
+
var _a;
|
|
15217
15214
|
const post = definition === null || definition === void 0 ? void 0 : definition.post;
|
|
15218
15215
|
if (dataType && post) throw new Error("keyword with \"post\" flag cannot have \"type\"");
|
|
15219
15216
|
const { RULES } = this;
|
|
@@ -15238,7 +15235,7 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15238
15235
|
if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before);
|
|
15239
15236
|
else ruleGroup.rules.push(rule);
|
|
15240
15237
|
RULES.all[keyword] = rule;
|
|
15241
|
-
(_a
|
|
15238
|
+
(_a = definition.implements) === null || _a === void 0 || _a.forEach((kwd) => this.addKeyword(kwd));
|
|
15242
15239
|
}
|
|
15243
15240
|
function addBeforeRule(ruleGroup, rule, before) {
|
|
15244
15241
|
const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
|
|
@@ -15356,9 +15353,9 @@ var require_ref = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15356
15353
|
gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
|
|
15357
15354
|
}
|
|
15358
15355
|
function addEvaluatedFrom(source) {
|
|
15359
|
-
var _a
|
|
15356
|
+
var _a;
|
|
15360
15357
|
if (!it.opts.unevaluated) return;
|
|
15361
|
-
const schEvaluated = (_a
|
|
15358
|
+
const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
|
|
15362
15359
|
if (it.props !== true) if (schEvaluated && !schEvaluated.dynamicProps) {
|
|
15363
15360
|
if (schEvaluated.props !== void 0) it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
|
|
15364
15361
|
} else {
|
|
@@ -16687,11 +16684,11 @@ var require_format$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
16687
16684
|
}
|
|
16688
16685
|
}
|
|
16689
16686
|
function getFormat(fmtDef) {
|
|
16690
|
-
const code
|
|
16687
|
+
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
|
|
16691
16688
|
const fmt = gen.scopeValue("formats", {
|
|
16692
16689
|
key: schema,
|
|
16693
16690
|
ref: fmtDef,
|
|
16694
|
-
code
|
|
16691
|
+
code
|
|
16695
16692
|
});
|
|
16696
16693
|
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) return [
|
|
16697
16694
|
fmtDef.type || "string",
|
|
@@ -16836,7 +16833,7 @@ var require_discriminator = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
16836
16833
|
return _valid;
|
|
16837
16834
|
}
|
|
16838
16835
|
function getMapping() {
|
|
16839
|
-
var _a
|
|
16836
|
+
var _a;
|
|
16840
16837
|
const oneOfMapping = {};
|
|
16841
16838
|
const topRequired = hasRequired(parentSchema);
|
|
16842
16839
|
let tagRequired = true;
|
|
@@ -16848,15 +16845,15 @@ var require_discriminator = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
16848
16845
|
if (sch instanceof compile_1.SchemaEnv) sch = sch.schema;
|
|
16849
16846
|
if (sch === void 0) throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
|
|
16850
16847
|
}
|
|
16851
|
-
const propSch = (_a
|
|
16848
|
+
const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
|
|
16852
16849
|
if (typeof propSch != "object") throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
|
|
16853
16850
|
tagRequired = tagRequired && (topRequired || hasRequired(sch));
|
|
16854
16851
|
addMappings(propSch, i);
|
|
16855
16852
|
}
|
|
16856
16853
|
if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`);
|
|
16857
16854
|
return oneOfMapping;
|
|
16858
|
-
function hasRequired({ required
|
|
16859
|
-
return Array.isArray(required
|
|
16855
|
+
function hasRequired({ required }) {
|
|
16856
|
+
return Array.isArray(required) && required.includes(tagName);
|
|
16860
16857
|
}
|
|
16861
16858
|
function addMappings(sch, i) {
|
|
16862
16859
|
if (sch.const) addMapping(sch.const, i);
|
|
@@ -17203,7 +17200,7 @@ var require_formats = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17203
17200
|
}
|
|
17204
17201
|
const TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
17205
17202
|
function getTime(strictTimeZone) {
|
|
17206
|
-
return function time
|
|
17203
|
+
return function time(str) {
|
|
17207
17204
|
const matches = TIME.exec(str);
|
|
17208
17205
|
if (!matches) return false;
|
|
17209
17206
|
const hr = +matches[1];
|
|
@@ -17240,10 +17237,10 @@ var require_formats = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17240
17237
|
}
|
|
17241
17238
|
const DATE_TIME_SEPARATOR = /t|\s/i;
|
|
17242
17239
|
function getDateTime(strictTimeZone) {
|
|
17243
|
-
const time
|
|
17240
|
+
const time = getTime(strictTimeZone);
|
|
17244
17241
|
return function date_time(str) {
|
|
17245
17242
|
const dateTime = str.split(DATE_TIME_SEPARATOR);
|
|
17246
|
-
return dateTime.length === 2 && date(dateTime[0]) && time
|
|
17243
|
+
return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);
|
|
17247
17244
|
};
|
|
17248
17245
|
}
|
|
17249
17246
|
function compareDateTime(dt1, dt2) {
|
|
@@ -17393,15 +17390,15 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
17393
17390
|
if (opts.keywords) (0, limit_1.default)(ajv);
|
|
17394
17391
|
return ajv;
|
|
17395
17392
|
};
|
|
17396
|
-
formatsPlugin.get = (name
|
|
17397
|
-
const f = (mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats)[name
|
|
17398
|
-
if (!f) throw new Error(`Unknown format "${name
|
|
17393
|
+
formatsPlugin.get = (name, mode = "full") => {
|
|
17394
|
+
const f = (mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats)[name];
|
|
17395
|
+
if (!f) throw new Error(`Unknown format "${name}"`);
|
|
17399
17396
|
return f;
|
|
17400
17397
|
};
|
|
17401
17398
|
function addFormats(ajv, list, fs, exportName) {
|
|
17402
|
-
var _a
|
|
17399
|
+
var _a;
|
|
17403
17400
|
var _b;
|
|
17404
|
-
(_a
|
|
17401
|
+
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`);
|
|
17405
17402
|
for (const f of list) ajv.addFormat(f, fs[f]);
|
|
17406
17403
|
}
|
|
17407
17404
|
module.exports = exports = formatsPlugin;
|
|
@@ -17410,7 +17407,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
17410
17407
|
}));
|
|
17411
17408
|
|
|
17412
17409
|
//#endregion
|
|
17413
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
17410
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
17414
17411
|
var import_ajv = /* @__PURE__ */ __toESM(require_ajv(), 1);
|
|
17415
17412
|
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
17416
17413
|
function createDefaultAjvInstance() {
|
|
@@ -17487,7 +17484,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
17487
17484
|
};
|
|
17488
17485
|
|
|
17489
17486
|
//#endregion
|
|
17490
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
17487
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
17491
17488
|
/**
|
|
17492
17489
|
* Experimental server task features for MCP SDK.
|
|
17493
17490
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -17578,7 +17575,7 @@ var ExperimentalServerTasks = class {
|
|
|
17578
17575
|
};
|
|
17579
17576
|
|
|
17580
17577
|
//#endregion
|
|
17581
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
17578
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
17582
17579
|
/**
|
|
17583
17580
|
* Experimental task capability assertion helpers.
|
|
17584
17581
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -17630,7 +17627,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
17630
17627
|
}
|
|
17631
17628
|
|
|
17632
17629
|
//#endregion
|
|
17633
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
17630
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
17634
17631
|
/**
|
|
17635
17632
|
* An MCP server on top of a pluggable transport.
|
|
17636
17633
|
*
|
|
@@ -17972,7 +17969,7 @@ var Server = class extends Protocol {
|
|
|
17972
17969
|
};
|
|
17973
17970
|
|
|
17974
17971
|
//#endregion
|
|
17975
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
17972
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
17976
17973
|
const COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
17977
17974
|
/**
|
|
17978
17975
|
* Checks if a schema is completable (has completion metadata).
|
|
@@ -17987,12 +17984,12 @@ function getCompleter(schema) {
|
|
|
17987
17984
|
return schema[COMPLETABLE_SYMBOL]?.complete;
|
|
17988
17985
|
}
|
|
17989
17986
|
var McpZodTypeKind;
|
|
17990
|
-
(function(McpZodTypeKind
|
|
17991
|
-
McpZodTypeKind
|
|
17987
|
+
(function(McpZodTypeKind) {
|
|
17988
|
+
McpZodTypeKind["Completable"] = "McpCompletable";
|
|
17992
17989
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
17993
17990
|
|
|
17994
17991
|
//#endregion
|
|
17995
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
17992
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
17996
17993
|
/**
|
|
17997
17994
|
* Tool name validation utilities according to SEP: Specify Format for Tool Names
|
|
17998
17995
|
*
|
|
@@ -18011,22 +18008,22 @@ const TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
|
18011
18008
|
* @param name - The tool name to validate
|
|
18012
18009
|
* @returns An object containing validation result and any warnings
|
|
18013
18010
|
*/
|
|
18014
|
-
function validateToolName(name
|
|
18011
|
+
function validateToolName(name) {
|
|
18015
18012
|
const warnings = [];
|
|
18016
|
-
if (name
|
|
18013
|
+
if (name.length === 0) return {
|
|
18017
18014
|
isValid: false,
|
|
18018
18015
|
warnings: ["Tool name cannot be empty"]
|
|
18019
18016
|
};
|
|
18020
|
-
if (name
|
|
18017
|
+
if (name.length > 128) return {
|
|
18021
18018
|
isValid: false,
|
|
18022
|
-
warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name
|
|
18019
|
+
warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]
|
|
18023
18020
|
};
|
|
18024
|
-
if (name
|
|
18025
|
-
if (name
|
|
18026
|
-
if (name
|
|
18027
|
-
if (name
|
|
18028
|
-
if (!TOOL_NAME_REGEX.test(name
|
|
18029
|
-
const invalidChars = name
|
|
18021
|
+
if (name.includes(" ")) warnings.push("Tool name contains spaces, which may cause parsing issues");
|
|
18022
|
+
if (name.includes(",")) warnings.push("Tool name contains commas, which may cause parsing issues");
|
|
18023
|
+
if (name.startsWith("-") || name.endsWith("-")) warnings.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");
|
|
18024
|
+
if (name.startsWith(".") || name.endsWith(".")) warnings.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");
|
|
18025
|
+
if (!TOOL_NAME_REGEX.test(name)) {
|
|
18026
|
+
const invalidChars = name.split("").filter((char) => !/[A-Za-z0-9._-]/.test(char)).filter((char, index, arr) => arr.indexOf(char) === index);
|
|
18030
18027
|
warnings.push(`Tool name contains invalid characters: ${invalidChars.map((c) => `"${c}"`).join(", ")}`, "Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)");
|
|
18031
18028
|
return {
|
|
18032
18029
|
isValid: false,
|
|
@@ -18043,9 +18040,9 @@ function validateToolName(name$1) {
|
|
|
18043
18040
|
* @param name - The tool name that triggered the warnings
|
|
18044
18041
|
* @param warnings - Array of warning messages
|
|
18045
18042
|
*/
|
|
18046
|
-
function issueToolNameWarning(name
|
|
18043
|
+
function issueToolNameWarning(name, warnings) {
|
|
18047
18044
|
if (warnings.length > 0) {
|
|
18048
|
-
console.warn(`Tool name validation warning for "${name
|
|
18045
|
+
console.warn(`Tool name validation warning for "${name}":`);
|
|
18049
18046
|
for (const warning of warnings) console.warn(` - ${warning}`);
|
|
18050
18047
|
console.warn("Tool registration will proceed, but this may cause compatibility issues.");
|
|
18051
18048
|
console.warn("Consider updating the tool name to conform to the MCP tool naming standard.");
|
|
@@ -18057,14 +18054,14 @@ function issueToolNameWarning(name$1, warnings) {
|
|
|
18057
18054
|
* @param name - The tool name to validate
|
|
18058
18055
|
* @returns true if the name is valid, false otherwise
|
|
18059
18056
|
*/
|
|
18060
|
-
function validateAndWarnToolName(name
|
|
18061
|
-
const result = validateToolName(name
|
|
18062
|
-
issueToolNameWarning(name
|
|
18057
|
+
function validateAndWarnToolName(name) {
|
|
18058
|
+
const result = validateToolName(name);
|
|
18059
|
+
issueToolNameWarning(name, result.warnings);
|
|
18063
18060
|
return result.isValid;
|
|
18064
18061
|
}
|
|
18065
18062
|
|
|
18066
18063
|
//#endregion
|
|
18067
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
18064
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
18068
18065
|
/**
|
|
18069
18066
|
* Experimental McpServer task features for MCP SDK.
|
|
18070
18067
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -18085,18 +18082,18 @@ var ExperimentalMcpServerTasks = class {
|
|
|
18085
18082
|
constructor(_mcpServer) {
|
|
18086
18083
|
this._mcpServer = _mcpServer;
|
|
18087
18084
|
}
|
|
18088
|
-
registerToolTask(name
|
|
18085
|
+
registerToolTask(name, config, handler) {
|
|
18089
18086
|
const execution = {
|
|
18090
18087
|
taskSupport: "required",
|
|
18091
|
-
...config
|
|
18088
|
+
...config.execution
|
|
18092
18089
|
};
|
|
18093
|
-
if (execution.taskSupport === "forbidden") throw new Error(`Cannot register task-based tool '${name
|
|
18094
|
-
return this._mcpServer._createRegisteredTool(name
|
|
18090
|
+
if (execution.taskSupport === "forbidden") throw new Error(`Cannot register task-based tool '${name}' with taskSupport 'forbidden'. Use registerTool() instead.`);
|
|
18091
|
+
return this._mcpServer._createRegisteredTool(name, config.title, config.description, config.inputSchema, config.outputSchema, config.annotations, execution, config._meta, handler);
|
|
18095
18092
|
}
|
|
18096
18093
|
};
|
|
18097
18094
|
|
|
18098
18095
|
//#endregion
|
|
18099
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
18096
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
18100
18097
|
/**
|
|
18101
18098
|
* High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
|
|
18102
18099
|
* For advanced usage (like sending notifications or setting custom request handlers), use the underlying
|
|
@@ -18144,9 +18141,9 @@ var McpServer = class {
|
|
|
18144
18141
|
this.server.assertCanSetRequestHandler(getMethodValue(ListToolsRequestSchema));
|
|
18145
18142
|
this.server.assertCanSetRequestHandler(getMethodValue(CallToolRequestSchema));
|
|
18146
18143
|
this.server.registerCapabilities({ tools: { listChanged: true } });
|
|
18147
|
-
this.server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name
|
|
18144
|
+
this.server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => {
|
|
18148
18145
|
const toolDefinition = {
|
|
18149
|
-
name
|
|
18146
|
+
name,
|
|
18150
18147
|
title: tool.title,
|
|
18151
18148
|
description: tool.description,
|
|
18152
18149
|
inputSchema: (() => {
|
|
@@ -18347,8 +18344,8 @@ var McpServer = class {
|
|
|
18347
18344
|
return { resources: [...resources, ...templateResources] };
|
|
18348
18345
|
});
|
|
18349
18346
|
this.server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => {
|
|
18350
|
-
return { resourceTemplates: Object.entries(this._registeredResourceTemplates).map(([name
|
|
18351
|
-
name
|
|
18347
|
+
return { resourceTemplates: Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({
|
|
18348
|
+
name,
|
|
18352
18349
|
uriTemplate: template.resourceTemplate.uriTemplate.toString(),
|
|
18353
18350
|
...template.metadata
|
|
18354
18351
|
})) };
|
|
@@ -18373,9 +18370,9 @@ var McpServer = class {
|
|
|
18373
18370
|
this.server.assertCanSetRequestHandler(getMethodValue(ListPromptsRequestSchema));
|
|
18374
18371
|
this.server.assertCanSetRequestHandler(getMethodValue(GetPromptRequestSchema));
|
|
18375
18372
|
this.server.registerCapabilities({ prompts: { listChanged: true } });
|
|
18376
|
-
this.server.setRequestHandler(ListPromptsRequestSchema, () => ({ prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name
|
|
18373
|
+
this.server.setRequestHandler(ListPromptsRequestSchema, () => ({ prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name, prompt]) => {
|
|
18377
18374
|
return {
|
|
18378
|
-
name
|
|
18375
|
+
name,
|
|
18379
18376
|
title: prompt.title,
|
|
18380
18377
|
description: prompt.description,
|
|
18381
18378
|
arguments: prompt.argsSchema ? promptArgumentsFromSchema(prompt.argsSchema) : void 0
|
|
@@ -18401,42 +18398,42 @@ var McpServer = class {
|
|
|
18401
18398
|
});
|
|
18402
18399
|
this._promptHandlersInitialized = true;
|
|
18403
18400
|
}
|
|
18404
|
-
resource(name
|
|
18401
|
+
resource(name, uriOrTemplate, ...rest) {
|
|
18405
18402
|
let metadata;
|
|
18406
18403
|
if (typeof rest[0] === "object") metadata = rest.shift();
|
|
18407
18404
|
const readCallback = rest[0];
|
|
18408
18405
|
if (typeof uriOrTemplate === "string") {
|
|
18409
18406
|
if (this._registeredResources[uriOrTemplate]) throw new Error(`Resource ${uriOrTemplate} is already registered`);
|
|
18410
|
-
const registeredResource = this._createRegisteredResource(name
|
|
18407
|
+
const registeredResource = this._createRegisteredResource(name, void 0, uriOrTemplate, metadata, readCallback);
|
|
18411
18408
|
this.setResourceRequestHandlers();
|
|
18412
18409
|
this.sendResourceListChanged();
|
|
18413
18410
|
return registeredResource;
|
|
18414
18411
|
} else {
|
|
18415
|
-
if (this._registeredResourceTemplates[name
|
|
18416
|
-
const registeredResourceTemplate = this._createRegisteredResourceTemplate(name
|
|
18412
|
+
if (this._registeredResourceTemplates[name]) throw new Error(`Resource template ${name} is already registered`);
|
|
18413
|
+
const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, void 0, uriOrTemplate, metadata, readCallback);
|
|
18417
18414
|
this.setResourceRequestHandlers();
|
|
18418
18415
|
this.sendResourceListChanged();
|
|
18419
18416
|
return registeredResourceTemplate;
|
|
18420
18417
|
}
|
|
18421
18418
|
}
|
|
18422
|
-
registerResource(name
|
|
18419
|
+
registerResource(name, uriOrTemplate, config, readCallback) {
|
|
18423
18420
|
if (typeof uriOrTemplate === "string") {
|
|
18424
18421
|
if (this._registeredResources[uriOrTemplate]) throw new Error(`Resource ${uriOrTemplate} is already registered`);
|
|
18425
|
-
const registeredResource = this._createRegisteredResource(name
|
|
18422
|
+
const registeredResource = this._createRegisteredResource(name, config.title, uriOrTemplate, config, readCallback);
|
|
18426
18423
|
this.setResourceRequestHandlers();
|
|
18427
18424
|
this.sendResourceListChanged();
|
|
18428
18425
|
return registeredResource;
|
|
18429
18426
|
} else {
|
|
18430
|
-
if (this._registeredResourceTemplates[name
|
|
18431
|
-
const registeredResourceTemplate = this._createRegisteredResourceTemplate(name
|
|
18427
|
+
if (this._registeredResourceTemplates[name]) throw new Error(`Resource template ${name} is already registered`);
|
|
18428
|
+
const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config.title, uriOrTemplate, config, readCallback);
|
|
18432
18429
|
this.setResourceRequestHandlers();
|
|
18433
18430
|
this.sendResourceListChanged();
|
|
18434
18431
|
return registeredResourceTemplate;
|
|
18435
18432
|
}
|
|
18436
18433
|
}
|
|
18437
|
-
_createRegisteredResource(name
|
|
18434
|
+
_createRegisteredResource(name, title, uri, metadata, readCallback) {
|
|
18438
18435
|
const registeredResource = {
|
|
18439
|
-
name
|
|
18436
|
+
name,
|
|
18440
18437
|
title,
|
|
18441
18438
|
metadata,
|
|
18442
18439
|
readCallback,
|
|
@@ -18460,7 +18457,7 @@ var McpServer = class {
|
|
|
18460
18457
|
this._registeredResources[uri] = registeredResource;
|
|
18461
18458
|
return registeredResource;
|
|
18462
18459
|
}
|
|
18463
|
-
_createRegisteredResourceTemplate(name
|
|
18460
|
+
_createRegisteredResourceTemplate(name, title, template, metadata, readCallback) {
|
|
18464
18461
|
const registeredResourceTemplate = {
|
|
18465
18462
|
resourceTemplate: template,
|
|
18466
18463
|
title,
|
|
@@ -18471,8 +18468,8 @@ var McpServer = class {
|
|
|
18471
18468
|
enable: () => registeredResourceTemplate.update({ enabled: true }),
|
|
18472
18469
|
remove: () => registeredResourceTemplate.update({ name: null }),
|
|
18473
18470
|
update: (updates) => {
|
|
18474
|
-
if (typeof updates.name !== "undefined" && updates.name !== name
|
|
18475
|
-
delete this._registeredResourceTemplates[name
|
|
18471
|
+
if (typeof updates.name !== "undefined" && updates.name !== name) {
|
|
18472
|
+
delete this._registeredResourceTemplates[name];
|
|
18476
18473
|
if (updates.name) this._registeredResourceTemplates[updates.name] = registeredResourceTemplate;
|
|
18477
18474
|
}
|
|
18478
18475
|
if (typeof updates.title !== "undefined") registeredResourceTemplate.title = updates.title;
|
|
@@ -18483,12 +18480,12 @@ var McpServer = class {
|
|
|
18483
18480
|
this.sendResourceListChanged();
|
|
18484
18481
|
}
|
|
18485
18482
|
};
|
|
18486
|
-
this._registeredResourceTemplates[name
|
|
18483
|
+
this._registeredResourceTemplates[name] = registeredResourceTemplate;
|
|
18487
18484
|
const variableNames = template.uriTemplate.variableNames;
|
|
18488
18485
|
if (Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v))) this.setCompletionRequestHandler();
|
|
18489
18486
|
return registeredResourceTemplate;
|
|
18490
18487
|
}
|
|
18491
|
-
_createRegisteredPrompt(name
|
|
18488
|
+
_createRegisteredPrompt(name, title, description, argsSchema, callback) {
|
|
18492
18489
|
const registeredPrompt = {
|
|
18493
18490
|
title,
|
|
18494
18491
|
description,
|
|
@@ -18499,8 +18496,8 @@ var McpServer = class {
|
|
|
18499
18496
|
enable: () => registeredPrompt.update({ enabled: true }),
|
|
18500
18497
|
remove: () => registeredPrompt.update({ name: null }),
|
|
18501
18498
|
update: (updates) => {
|
|
18502
|
-
if (typeof updates.name !== "undefined" && updates.name !== name
|
|
18503
|
-
delete this._registeredPrompts[name
|
|
18499
|
+
if (typeof updates.name !== "undefined" && updates.name !== name) {
|
|
18500
|
+
delete this._registeredPrompts[name];
|
|
18504
18501
|
if (updates.name) this._registeredPrompts[updates.name] = registeredPrompt;
|
|
18505
18502
|
}
|
|
18506
18503
|
if (typeof updates.title !== "undefined") registeredPrompt.title = updates.title;
|
|
@@ -18511,7 +18508,7 @@ var McpServer = class {
|
|
|
18511
18508
|
this.sendPromptListChanged();
|
|
18512
18509
|
}
|
|
18513
18510
|
};
|
|
18514
|
-
this._registeredPrompts[name
|
|
18511
|
+
this._registeredPrompts[name] = registeredPrompt;
|
|
18515
18512
|
if (argsSchema) {
|
|
18516
18513
|
if (Object.values(argsSchema).some((field) => {
|
|
18517
18514
|
return isCompletable(field instanceof ZodOptional ? field._def?.innerType : field);
|
|
@@ -18519,8 +18516,8 @@ var McpServer = class {
|
|
|
18519
18516
|
}
|
|
18520
18517
|
return registeredPrompt;
|
|
18521
18518
|
}
|
|
18522
|
-
_createRegisteredTool(name
|
|
18523
|
-
validateAndWarnToolName(name
|
|
18519
|
+
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, execution, _meta, handler) {
|
|
18520
|
+
validateAndWarnToolName(name);
|
|
18524
18521
|
const registeredTool = {
|
|
18525
18522
|
title,
|
|
18526
18523
|
description,
|
|
@@ -18535,9 +18532,9 @@ var McpServer = class {
|
|
|
18535
18532
|
enable: () => registeredTool.update({ enabled: true }),
|
|
18536
18533
|
remove: () => registeredTool.update({ name: null }),
|
|
18537
18534
|
update: (updates) => {
|
|
18538
|
-
if (typeof updates.name !== "undefined" && updates.name !== name
|
|
18535
|
+
if (typeof updates.name !== "undefined" && updates.name !== name) {
|
|
18539
18536
|
if (typeof updates.name === "string") validateAndWarnToolName(updates.name);
|
|
18540
|
-
delete this._registeredTools[name
|
|
18537
|
+
delete this._registeredTools[name];
|
|
18541
18538
|
if (updates.name) this._registeredTools[updates.name] = registeredTool;
|
|
18542
18539
|
}
|
|
18543
18540
|
if (typeof updates.title !== "undefined") registeredTool.title = updates.title;
|
|
@@ -18551,7 +18548,7 @@ var McpServer = class {
|
|
|
18551
18548
|
this.sendToolListChanged();
|
|
18552
18549
|
}
|
|
18553
18550
|
};
|
|
18554
|
-
this._registeredTools[name
|
|
18551
|
+
this._registeredTools[name] = registeredTool;
|
|
18555
18552
|
this.setToolRequestHandlers();
|
|
18556
18553
|
this.sendToolListChanged();
|
|
18557
18554
|
return registeredTool;
|
|
@@ -18559,8 +18556,8 @@ var McpServer = class {
|
|
|
18559
18556
|
/**
|
|
18560
18557
|
* tool() implementation. Parses arguments passed to overrides defined above.
|
|
18561
18558
|
*/
|
|
18562
|
-
tool(name
|
|
18563
|
-
if (this._registeredTools[name
|
|
18559
|
+
tool(name, ...rest) {
|
|
18560
|
+
if (this._registeredTools[name]) throw new Error(`Tool ${name} is already registered`);
|
|
18564
18561
|
let description;
|
|
18565
18562
|
let inputSchema;
|
|
18566
18563
|
let outputSchema;
|
|
@@ -18574,24 +18571,24 @@ var McpServer = class {
|
|
|
18574
18571
|
} else if (typeof firstArg === "object" && firstArg !== null) annotations = rest.shift();
|
|
18575
18572
|
}
|
|
18576
18573
|
const callback = rest[0];
|
|
18577
|
-
return this._createRegisteredTool(name
|
|
18574
|
+
return this._createRegisteredTool(name, void 0, description, inputSchema, outputSchema, annotations, { taskSupport: "forbidden" }, void 0, callback);
|
|
18578
18575
|
}
|
|
18579
18576
|
/**
|
|
18580
18577
|
* Registers a tool with a config object and callback.
|
|
18581
18578
|
*/
|
|
18582
|
-
registerTool(name
|
|
18583
|
-
if (this._registeredTools[name
|
|
18584
|
-
const { title, description, inputSchema, outputSchema, annotations, _meta } = config
|
|
18585
|
-
return this._createRegisteredTool(name
|
|
18579
|
+
registerTool(name, config, cb) {
|
|
18580
|
+
if (this._registeredTools[name]) throw new Error(`Tool ${name} is already registered`);
|
|
18581
|
+
const { title, description, inputSchema, outputSchema, annotations, _meta } = config;
|
|
18582
|
+
return this._createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, { taskSupport: "forbidden" }, _meta, cb);
|
|
18586
18583
|
}
|
|
18587
|
-
prompt(name
|
|
18588
|
-
if (this._registeredPrompts[name
|
|
18584
|
+
prompt(name, ...rest) {
|
|
18585
|
+
if (this._registeredPrompts[name]) throw new Error(`Prompt ${name} is already registered`);
|
|
18589
18586
|
let description;
|
|
18590
18587
|
if (typeof rest[0] === "string") description = rest.shift();
|
|
18591
18588
|
let argsSchema;
|
|
18592
18589
|
if (rest.length > 1) argsSchema = rest.shift();
|
|
18593
18590
|
const cb = rest[0];
|
|
18594
|
-
const registeredPrompt = this._createRegisteredPrompt(name
|
|
18591
|
+
const registeredPrompt = this._createRegisteredPrompt(name, void 0, description, argsSchema, cb);
|
|
18595
18592
|
this.setPromptRequestHandlers();
|
|
18596
18593
|
this.sendPromptListChanged();
|
|
18597
18594
|
return registeredPrompt;
|
|
@@ -18599,10 +18596,10 @@ var McpServer = class {
|
|
|
18599
18596
|
/**
|
|
18600
18597
|
* Registers a prompt with a config object and callback.
|
|
18601
18598
|
*/
|
|
18602
|
-
registerPrompt(name
|
|
18603
|
-
if (this._registeredPrompts[name
|
|
18604
|
-
const { title, description, argsSchema } = config
|
|
18605
|
-
const registeredPrompt = this._createRegisteredPrompt(name
|
|
18599
|
+
registerPrompt(name, config, cb) {
|
|
18600
|
+
if (this._registeredPrompts[name]) throw new Error(`Prompt ${name} is already registered`);
|
|
18601
|
+
const { title, description, argsSchema } = config;
|
|
18602
|
+
const registeredPrompt = this._createRegisteredPrompt(name, title, description, argsSchema, cb);
|
|
18606
18603
|
this.setPromptRequestHandlers();
|
|
18607
18604
|
this.sendPromptListChanged();
|
|
18608
18605
|
return registeredPrompt;
|
|
@@ -18691,9 +18688,9 @@ function getZodSchemaObject(schema) {
|
|
|
18691
18688
|
function promptArgumentsFromSchema(schema) {
|
|
18692
18689
|
const shape = getObjectShape(schema);
|
|
18693
18690
|
if (!shape) return [];
|
|
18694
|
-
return Object.entries(shape).map(([name
|
|
18691
|
+
return Object.entries(shape).map(([name, field]) => {
|
|
18695
18692
|
return {
|
|
18696
|
-
name
|
|
18693
|
+
name,
|
|
18697
18694
|
description: getSchemaDescription(field),
|
|
18698
18695
|
required: !isSchemaOptional(field)
|
|
18699
18696
|
};
|
|
@@ -18719,7 +18716,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
|
|
|
18719
18716
|
} };
|
|
18720
18717
|
|
|
18721
18718
|
//#endregion
|
|
18722
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
18719
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
18723
18720
|
/**
|
|
18724
18721
|
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
|
|
18725
18722
|
*/
|
|
@@ -18747,7 +18744,7 @@ function serializeMessage(message) {
|
|
|
18747
18744
|
}
|
|
18748
18745
|
|
|
18749
18746
|
//#endregion
|
|
18750
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
18747
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
18751
18748
|
/**
|
|
18752
18749
|
* Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout.
|
|
18753
18750
|
*
|
|
@@ -18802,57 +18799,53 @@ var StdioServerTransport = class {
|
|
|
18802
18799
|
};
|
|
18803
18800
|
|
|
18804
18801
|
//#endregion
|
|
18805
|
-
//#region
|
|
18802
|
+
//#region packages/env.ts
|
|
18806
18803
|
const name = "d5_mcp_review_builtin";
|
|
18807
18804
|
const report = "report";
|
|
18808
18805
|
const getHash = "hash";
|
|
18809
|
-
const
|
|
18810
|
-
const file = "bin/copilot.js";
|
|
18806
|
+
const file = "bin/mcpServer.js";
|
|
18811
18807
|
const RUNTIME_CWD = join(dirname(fileURLToPath(import.meta.url)), "../");
|
|
18812
18808
|
const serveFile = join(RUNTIME_CWD, file);
|
|
18813
18809
|
const envJson = buildEnv();
|
|
18814
|
-
const
|
|
18815
|
-
|
|
18816
|
-
|
|
18817
|
-
|
|
18818
|
-
|
|
18819
|
-
|
|
18820
|
-
|
|
18821
|
-
|
|
18822
|
-
|
|
18823
|
-
|
|
18824
|
-
|
|
18825
|
-
|
|
18826
|
-
|
|
18827
|
-
|
|
18828
|
-
|
|
18829
|
-
|
|
18830
|
-
|
|
18831
|
-
|
|
18832
|
-
const tools = [
|
|
18833
|
-
"--additional-mcp-config",
|
|
18834
|
-
JSON.stringify({ mcpServers: { [name]: {
|
|
18835
|
-
type: "local",
|
|
18836
|
-
command: "node",
|
|
18837
|
-
args: [serveFile, `--customizenv=${JSON.stringify(envUsed)}`],
|
|
18838
|
-
tools: ["*"]
|
|
18839
|
-
} } }),
|
|
18840
|
-
"--allow-all-paths",
|
|
18841
|
-
"--allow-all-tools",
|
|
18842
|
-
"--deny-tool",
|
|
18843
|
-
"write",
|
|
18844
|
-
"--deny-tool",
|
|
18845
|
-
"github-mcp-server"
|
|
18810
|
+
const envConfigKeys = [
|
|
18811
|
+
"CI_SERVER_URL",
|
|
18812
|
+
"CI_PROJECT_PATH",
|
|
18813
|
+
"CI_PROJECT_ID",
|
|
18814
|
+
"CI_PROJECT_NAME",
|
|
18815
|
+
"CI_COMMIT_SHA",
|
|
18816
|
+
"CI_COMMIT_BEFORE_SHA",
|
|
18817
|
+
"CI_MERGE_REQUEST_IID",
|
|
18818
|
+
"CI_MERGE_REQUEST_TITLE",
|
|
18819
|
+
"CI_MERGE_REQUEST_DESCRIPTION",
|
|
18820
|
+
"JIRA_BASE_URL",
|
|
18821
|
+
"DINGTALK_WEBHOOK",
|
|
18822
|
+
"GITLAB_TOKEN",
|
|
18823
|
+
"JIRA_PAT",
|
|
18824
|
+
"JIRA_COOKIE",
|
|
18825
|
+
"JIRA_USERNAME",
|
|
18826
|
+
"JIRA_PASSWORD",
|
|
18827
|
+
"TOKEN_USAGE"
|
|
18846
18828
|
];
|
|
18829
|
+
const envUsed = Object.defineProperty({}, "JIRA_BASE_URL", {
|
|
18830
|
+
get: () => toEnv("CI_SERVER_URL", "http://jira.d5techs.com.cn"),
|
|
18831
|
+
enumerable: true,
|
|
18832
|
+
configurable: true
|
|
18833
|
+
});
|
|
18834
|
+
envConfigKeys.forEach((key) => Object.defineProperty(envUsed, key, {
|
|
18835
|
+
get: () => toEnv(key),
|
|
18836
|
+
enumerable: true,
|
|
18837
|
+
configurable: true
|
|
18838
|
+
}));
|
|
18847
18839
|
function toEnv(key, defaultValue) {
|
|
18848
18840
|
return envJson[key] || process.env[key] || defaultValue;
|
|
18849
18841
|
}
|
|
18850
18842
|
function buildEnv() {
|
|
18851
18843
|
const envArg = argv.find((arg) => arg.startsWith("--customizenv="));
|
|
18852
|
-
let envJson
|
|
18853
|
-
if (envArg) envJson
|
|
18854
|
-
return envJson
|
|
18844
|
+
let envJson = {};
|
|
18845
|
+
if (envArg) envJson = JSON.parse(envArg.replace("--customizenv=", ""));
|
|
18846
|
+
return envJson;
|
|
18855
18847
|
}
|
|
18848
|
+
const noMandatory = "dont't call under non-mandatory conditions";
|
|
18856
18849
|
|
|
18857
18850
|
//#endregion
|
|
18858
18851
|
//#region packages/gitlab/url.ts
|
|
@@ -18901,59 +18894,57 @@ const commits = () => {
|
|
|
18901
18894
|
};
|
|
18902
18895
|
|
|
18903
18896
|
//#endregion
|
|
18904
|
-
//#region packages/gitlab/
|
|
18905
|
-
|
|
18906
|
-
|
|
18907
|
-
|
|
18908
|
-
if (
|
|
18909
|
-
|
|
18910
|
-
|
|
18911
|
-
|
|
18912
|
-
description: "commits from `merge pipeline`",
|
|
18913
|
-
text: `${commits$1.map((commit) => commit.id).join(",")}, the above review is from \`merge pipeline\` commits.`
|
|
18914
|
-
}] })).catch((error) => ({
|
|
18915
|
-
content: [{
|
|
18897
|
+
//#region packages/gitlab/index.ts
|
|
18898
|
+
function install$2(server) {
|
|
18899
|
+
server.registerTool(getHash, { description: noMandatory }, () => {
|
|
18900
|
+
const url = pipelineMerge();
|
|
18901
|
+
if (url) return fetch(`${url}/commits`, { headers: buildHeaders() }).then((res) => {
|
|
18902
|
+
if (!res.ok) throw new Error("请求GitLab API失败" + res.statusText);
|
|
18903
|
+
return res.json();
|
|
18904
|
+
}).then((commits) => ({ content: [{
|
|
18916
18905
|
type: "text",
|
|
18917
|
-
text:
|
|
18918
|
-
}]
|
|
18919
|
-
|
|
18920
|
-
|
|
18921
|
-
|
|
18922
|
-
|
|
18923
|
-
|
|
18924
|
-
|
|
18925
|
-
|
|
18926
|
-
|
|
18927
|
-
return { content: [{
|
|
18928
|
-
type: "text",
|
|
18929
|
-
text: `latest commit`
|
|
18930
|
-
}] };
|
|
18931
|
-
};
|
|
18932
|
-
const getMergeInfomation = () => {
|
|
18933
|
-
const { CI_MERGE_REQUEST_DESCRIPTION, CI_MERGE_REQUEST_TITLE } = envUsed;
|
|
18934
|
-
if (CI_MERGE_REQUEST_DESCRIPTION || CI_MERGE_REQUEST_TITLE) return { content: [{
|
|
18935
|
-
type: "text",
|
|
18936
|
-
text: `title: ${CI_MERGE_REQUEST_TITLE || ""}, description: ${CI_MERGE_REQUEST_DESCRIPTION || ""}`
|
|
18937
|
-
}] };
|
|
18938
|
-
return {
|
|
18939
|
-
content: [{
|
|
18906
|
+
text: `${commits.map((commit) => commit.id).join(",")}, the above review is from \`merge pipeline\` commits.`
|
|
18907
|
+
}] })).catch(() => ({
|
|
18908
|
+
content: [{
|
|
18909
|
+
type: "text",
|
|
18910
|
+
text: "latest commit"
|
|
18911
|
+
}],
|
|
18912
|
+
isError: true
|
|
18913
|
+
}));
|
|
18914
|
+
const { CI_COMMIT_SHA, CI_COMMIT_BEFORE_SHA } = envUsed;
|
|
18915
|
+
if (CI_COMMIT_SHA && CI_COMMIT_BEFORE_SHA) return { content: [{
|
|
18940
18916
|
type: "text",
|
|
18941
|
-
text:
|
|
18942
|
-
}]
|
|
18943
|
-
|
|
18944
|
-
|
|
18945
|
-
|
|
18946
|
-
|
|
18947
|
-
|
|
18948
|
-
|
|
18949
|
-
function install$2(server$1) {
|
|
18950
|
-
server$1.registerTool(getHash, { description: noMandatory }, getCommits);
|
|
18951
|
-
server$1.registerTool("getMergeDescription", {
|
|
18917
|
+
text: `from ${CI_COMMIT_BEFORE_SHA} to ${CI_COMMIT_SHA}.`
|
|
18918
|
+
}] };
|
|
18919
|
+
return { content: [{
|
|
18920
|
+
type: "text",
|
|
18921
|
+
text: `latest commit`
|
|
18922
|
+
}] };
|
|
18923
|
+
});
|
|
18924
|
+
server.registerTool("getMergeDescription", {
|
|
18952
18925
|
title: "merge pipeline description",
|
|
18953
18926
|
description: "When review task from `merge pipeline`, get the merge request description."
|
|
18954
|
-
},
|
|
18927
|
+
}, () => {
|
|
18928
|
+
let { CI_MERGE_REQUEST_DESCRIPTION: CMED, CI_MERGE_REQUEST_TITLE: CMRT } = envUsed;
|
|
18929
|
+
if (CMED || CMRT) {
|
|
18930
|
+
CMED = CMED ? `, description: ${CMED || ""}` : "";
|
|
18931
|
+
CMRT = CMRT ? `title: ${CMRT || ""}` : "";
|
|
18932
|
+
return { content: [{
|
|
18933
|
+
type: "text",
|
|
18934
|
+
text: CMRT + CMED
|
|
18935
|
+
}] };
|
|
18936
|
+
}
|
|
18937
|
+
return { content: [{
|
|
18938
|
+
type: "text",
|
|
18939
|
+
text: ""
|
|
18940
|
+
}] };
|
|
18941
|
+
});
|
|
18955
18942
|
}
|
|
18956
18943
|
|
|
18944
|
+
//#endregion
|
|
18945
|
+
//#region packages/jira/schema.ts
|
|
18946
|
+
const jiraSchema = { key: string().describe("JIRA task number such as `FUS-123`") };
|
|
18947
|
+
|
|
18957
18948
|
//#endregion
|
|
18958
18949
|
//#region packages/jira/url.ts
|
|
18959
18950
|
function commonHeaders() {
|
|
@@ -18970,100 +18961,70 @@ function commonHeaders() {
|
|
|
18970
18961
|
}
|
|
18971
18962
|
|
|
18972
18963
|
//#endregion
|
|
18973
|
-
//#region packages/jira/
|
|
18974
|
-
|
|
18964
|
+
//#region packages/jira/index.ts
|
|
18965
|
+
function install$1(server) {
|
|
18966
|
+
server.registerTool("get_jira_context", {
|
|
18967
|
+
title: "get jira context",
|
|
18968
|
+
description: "When the submission message contains a JIRA task number (e.g., `FUS-123`), this tool will be used to retrieve the contents of the JIRA task and supplement the current context.",
|
|
18969
|
+
inputSchema: jiraSchema
|
|
18970
|
+
}, caller);
|
|
18971
|
+
}
|
|
18972
|
+
async function caller(request) {
|
|
18975
18973
|
const { key } = request;
|
|
18976
18974
|
const { JIRA_BASE_URL } = envUsed;
|
|
18977
|
-
|
|
18978
|
-
const
|
|
18975
|
+
try {
|
|
18976
|
+
const headers = commonHeaders();
|
|
18977
|
+
const res = await (await fetch(`${JIRA_BASE_URL}/rest/api/latest/issue/${key}`, { headers })).json();
|
|
18978
|
+
if (!res.fields) throw new Error("JIRA issue not found");
|
|
18979
|
+
const { fields = {} } = res;
|
|
18979
18980
|
const { comment = {}, description = "", summary = "", priority = {} } = fields;
|
|
18980
18981
|
const { comments = [] } = comment;
|
|
18981
|
-
|
|
18982
|
-
|
|
18983
|
-
|
|
18984
|
-
|
|
18985
|
-
|
|
18986
|
-
|
|
18987
|
-
|
|
18988
|
-
|
|
18989
|
-
|
|
18982
|
+
const content = [
|
|
18983
|
+
...summary ? [{
|
|
18984
|
+
type: "text",
|
|
18985
|
+
description: "summary of the issue",
|
|
18986
|
+
text: summary
|
|
18987
|
+
}] : [],
|
|
18988
|
+
...priority.name ? [{
|
|
18989
|
+
type: "text",
|
|
18990
|
+
description: "priority of the issue",
|
|
18991
|
+
text: priority.name
|
|
18992
|
+
}] : [],
|
|
18993
|
+
...description ? [{
|
|
18994
|
+
type: "text",
|
|
18995
|
+
description: "description of the issue",
|
|
18996
|
+
text: description
|
|
18997
|
+
}] : [],
|
|
18998
|
+
...comments.map((v) => ({
|
|
18999
|
+
type: "text",
|
|
19000
|
+
description: "one of comment of the issue, format like `author` - `comment`",
|
|
19001
|
+
text: (v.author?.displayName || "nobody") + " - " + v.body
|
|
19002
|
+
}))
|
|
19003
|
+
];
|
|
19004
|
+
if (content.length > 0) content.unshift({
|
|
18990
19005
|
type: "text",
|
|
18991
|
-
description:
|
|
18992
|
-
text:
|
|
18993
|
-
}
|
|
19006
|
+
description: `tools has find the JIRA issue ${key}`,
|
|
19007
|
+
text: `JIRA ${key} find`
|
|
19008
|
+
});
|
|
19009
|
+
else content.push({
|
|
18994
19010
|
type: "text",
|
|
18995
|
-
description:
|
|
18996
|
-
text:
|
|
18997
|
-
}
|
|
19011
|
+
description: `tools has find the JIRA issue ${key}`,
|
|
19012
|
+
text: `JIRA ${key} find with no content`
|
|
19013
|
+
});
|
|
19014
|
+
return { content };
|
|
19015
|
+
} catch {
|
|
19016
|
+
return { content: [{
|
|
18998
19017
|
type: "text",
|
|
18999
|
-
|
|
19000
|
-
|
|
19001
|
-
|
|
19002
|
-
}).catch(() => ({ content: [{
|
|
19003
|
-
type: "text",
|
|
19004
|
-
text: `JIRA ${key} Non Exist.`
|
|
19005
|
-
}] }));
|
|
19006
|
-
};
|
|
19007
|
-
|
|
19008
|
-
//#endregion
|
|
19009
|
-
//#region packages/jira/schema.ts
|
|
19010
|
-
const jiraSchema = { key: string().describe("JIRA task number such as `FUS-123`") };
|
|
19011
|
-
|
|
19012
|
-
//#endregion
|
|
19013
|
-
//#region packages/jira/index.ts
|
|
19014
|
-
function install$1(server$1) {
|
|
19015
|
-
server$1.registerTool("get_jira_context", {
|
|
19016
|
-
title: "get jira context",
|
|
19017
|
-
description: "When the submission message contains a JIRA task number (e.g., `FUS-123`), this tool will be used to retrieve the contents of the JIRA task and supplement the current context.",
|
|
19018
|
-
inputSchema: jiraSchema
|
|
19019
|
-
}, getIssue);
|
|
19018
|
+
text: `JIRA ${key} Non Exist.`
|
|
19019
|
+
}] };
|
|
19020
|
+
}
|
|
19020
19021
|
}
|
|
19021
19022
|
|
|
19022
|
-
//#endregion
|
|
19023
|
-
//#region packages/message/props.ts
|
|
19024
|
-
const one = "If it can be explained in one sentence, then passing in one entry is sufficient.";
|
|
19025
|
-
const code = {
|
|
19026
|
-
file: string().optional().describe("The file path where the issue is found"),
|
|
19027
|
-
line: string().optional().describe("Line number, e.g., '1-345' pr '205' or '17,35', **must** provide the line of final file"),
|
|
19028
|
-
codeExample: string().optional().describe(`Code modification suggestions, recommended to use code in diff format, like: \`\`\`
|
|
19029
|
-
while (condition) {
|
|
19030
|
-
unchanged line;
|
|
19031
|
-
- remove this;
|
|
19032
|
-
+ replace it with this;
|
|
19033
|
-
+ and this;
|
|
19034
|
-
but keep this the same;
|
|
19035
|
-
}\`\`\`.`)
|
|
19036
|
-
};
|
|
19037
|
-
const severity = "such as CRITICAL, HIGH, MEDIUM, LOW";
|
|
19038
|
-
const reportSchema = {
|
|
19039
|
-
title: string().describe("Please describe the problem in the shortest possible way."),
|
|
19040
|
-
summary: array(string().describe(one)).optional().describe("Regarding the description of the current review, please summarize the main logic of the submission as concisely as possible."),
|
|
19041
|
-
issues: array(object({
|
|
19042
|
-
severity: string().optional().describe(`Bug severity levels, ${severity}.`),
|
|
19043
|
-
commitTitle: string().describe("The commit title associated with the issue"),
|
|
19044
|
-
commitAuthor: string().describe("The commit latest author associated with the issue"),
|
|
19045
|
-
commitSha: string().optional().describe("The commit SHA associated with the issue"),
|
|
19046
|
-
title: string().optional().describe("A short title for the issue"),
|
|
19047
|
-
details: array(string()).optional().describe("Details about the issue"),
|
|
19048
|
-
suggestions: array(string()).optional().describe("Improvement suggestion"),
|
|
19049
|
-
...code
|
|
19050
|
-
})).optional().describe(`List all bugs, order by 'severity' from heaviest to lightest, such as ${severity}`),
|
|
19051
|
-
jiras: array(object({
|
|
19052
|
-
key: string().describe("JIRA issue key, e.g., 'FUS-123'"),
|
|
19053
|
-
summary: string().describe("Summary of the JIRA issue")
|
|
19054
|
-
}).describe("Related JIRA issues")).optional().describe("List of related JIRA issues"),
|
|
19055
|
-
risks: array(string().describe(one).describe("A short summary of the risk")).optional().describe("After summarizing all the bugs, identify the main risks that could potentially impact the business."),
|
|
19056
|
-
suggestions: array(object({
|
|
19057
|
-
details: string().describe("Suggestions with the same meaning should be stated in one sentence; please do not increase the array length."),
|
|
19058
|
-
example: object(code).optional().describe("Pass in when you feel it is necessary to provide code.")
|
|
19059
|
-
})).optional().describe("After gaining a comprehensive understanding of the files involved in the commits, propose suggestions for code corrections beyond the diff.")
|
|
19060
|
-
};
|
|
19061
|
-
|
|
19062
19023
|
//#endregion
|
|
19063
19024
|
//#region packages/message/sendding.ts
|
|
19064
19025
|
async function sendding(title, text) {
|
|
19065
|
-
if (!envUsed.DINGTALK_WEBHOOK) throw new Error("non DINGTALK_WEBHOOK");
|
|
19066
19026
|
let res = new Response();
|
|
19027
|
+
if (!envUsed.DINGTALK_WEBHOOK) throw res;
|
|
19067
19028
|
for (const url of envUsed.DINGTALK_WEBHOOK.split(",")) res = await fetch(url, {
|
|
19068
19029
|
method: "POST",
|
|
19069
19030
|
headers: { "Content-Type": "application/json" },
|
|
@@ -19088,14 +19049,22 @@ const lastComment = { value: {} };
|
|
|
19088
19049
|
const schemaGitlabPipeline = "gitlab_pipeline";
|
|
19089
19050
|
const schemaGitlabCommit = "gitlab_commit";
|
|
19090
19051
|
const schemaDingdingTalk = "dingding_talk";
|
|
19052
|
+
const schemaRecord = "record";
|
|
19091
19053
|
function distReports(input) {
|
|
19092
|
-
const { CI_PROJECT_NAME = "", CI_COMMIT_SHA = "", JIRA_BASE_URL, CI_MERGE_REQUEST_IID, DINGTALK_WEBHOOK } = envUsed;
|
|
19093
|
-
const { title = "代码审查报告", summary = [], issues = [], jiras = [], risks = [], suggestions = [] } = input;
|
|
19054
|
+
const { CI_PROJECT_NAME = "", CI_COMMIT_SHA = "", JIRA_BASE_URL, CI_MERGE_REQUEST_IID, DINGTALK_WEBHOOK, TOKEN_USAGE = "" } = envUsed;
|
|
19055
|
+
const { title = "代码审查报告", summary: _summary = [], issues = [], jiras = [], risks: _risks = [], suggestions: _sugg = [] } = input;
|
|
19056
|
+
const usage = () => {
|
|
19057
|
+
if (TOKEN_USAGE) gitlabReportMessage += `\n\n> Last Token Usage: ${TOKEN_USAGE}`;
|
|
19058
|
+
};
|
|
19059
|
+
const summary = Array.isArray(_summary) ? _summary : [_summary];
|
|
19060
|
+
const risks = Array.isArray(_risks) ? _risks : [_risks];
|
|
19061
|
+
const suggestions = Array.isArray(_sugg) ? _sugg : [_sugg];
|
|
19094
19062
|
const mergeURL = pipelineMerge();
|
|
19095
19063
|
const commitsURL = commits();
|
|
19096
19064
|
let gitlabReportMessage = `## 📖 ${title}\n`;
|
|
19097
19065
|
const commitComments = [];
|
|
19098
19066
|
let dingdingReportMessage = "";
|
|
19067
|
+
let { url, type } = visitPipeline();
|
|
19099
19068
|
const gitlabReport = {
|
|
19100
19069
|
title: schemaGitlabPipeline,
|
|
19101
19070
|
report: [() => {
|
|
@@ -19119,8 +19088,10 @@ function distReports(input) {
|
|
|
19119
19088
|
method: "GET",
|
|
19120
19089
|
headers: buildHeaders()
|
|
19121
19090
|
})).then((res) => res.json()).then((res) => {
|
|
19122
|
-
|
|
19123
|
-
|
|
19091
|
+
if (res.length <= 0) return;
|
|
19092
|
+
const { notes = [] } = res.at(-1) || {};
|
|
19093
|
+
if (notes.length <= 0) return;
|
|
19094
|
+
lastComment.value = notes.at(-1) || {};
|
|
19124
19095
|
});
|
|
19125
19096
|
}
|
|
19126
19097
|
return Promise.resolve(void 0);
|
|
@@ -19144,15 +19115,32 @@ function distReports(input) {
|
|
|
19144
19115
|
});
|
|
19145
19116
|
}]
|
|
19146
19117
|
};
|
|
19118
|
+
let last_token_usage = Number(TOKEN_USAGE);
|
|
19119
|
+
last_token_usage = Number.isNaN(last_token_usage) ? null : last_token_usage;
|
|
19147
19120
|
const result = [
|
|
19148
19121
|
gitlabReport,
|
|
19149
19122
|
gitlabCommitReport,
|
|
19150
|
-
dingdingReport
|
|
19123
|
+
dingdingReport,
|
|
19124
|
+
{
|
|
19125
|
+
title: schemaRecord,
|
|
19126
|
+
report: [() => fetch("http://ai-code-review.d5techs.com.cn/api/code_review_logs", {
|
|
19127
|
+
method: "POST",
|
|
19128
|
+
headers: { "Content-Type": "application/json" },
|
|
19129
|
+
body: JSON.stringify({
|
|
19130
|
+
project_name: envUsed.CI_PROJECT_PATH || "unknown",
|
|
19131
|
+
commit_messages: url,
|
|
19132
|
+
last_token_usage,
|
|
19133
|
+
main_risk: risks.join("<br>"),
|
|
19134
|
+
review_result: gitlabReportMessage
|
|
19135
|
+
})
|
|
19136
|
+
})]
|
|
19137
|
+
}
|
|
19151
19138
|
];
|
|
19152
19139
|
if (issues.length === 0 && suggestions.length === 0) {
|
|
19153
19140
|
gitlabReport.report = [];
|
|
19154
19141
|
gitlabCommitReport.report = [];
|
|
19155
19142
|
dingdingReport.report = [];
|
|
19143
|
+
usage();
|
|
19156
19144
|
return result;
|
|
19157
19145
|
}
|
|
19158
19146
|
const fileMap = /* @__PURE__ */ new Map();
|
|
@@ -19160,34 +19148,34 @@ function distReports(input) {
|
|
|
19160
19148
|
const commitsSet = /* @__PURE__ */ new Set();
|
|
19161
19149
|
const commitsMap = /* @__PURE__ */ new Map();
|
|
19162
19150
|
const linkBase = visitCommit();
|
|
19163
|
-
function distCommitComments({ file
|
|
19151
|
+
function distCommitComments({ file, commitSha, severity = "NON", line = "", details = [], suggestions = [], codeExample = "" }) {
|
|
19164
19152
|
if (commitSha) {
|
|
19165
|
-
const lines = line.split(",").map((line
|
|
19166
|
-
const str = line
|
|
19167
|
-
const num = Number.parseInt(str
|
|
19153
|
+
const lines = line.split(",").map((line) => {
|
|
19154
|
+
const str = line.trim().split("-");
|
|
19155
|
+
const num = Number.parseInt(str.at(-1), 10);
|
|
19168
19156
|
return Number.isNaN(num) ? void 0 : num;
|
|
19169
19157
|
}).filter((v) => v !== void 0);
|
|
19170
|
-
const attach = file
|
|
19171
|
-
file
|
|
19172
|
-
line: lines.length > 0 ? lines
|
|
19158
|
+
const attach = file ? {
|
|
19159
|
+
file,
|
|
19160
|
+
line: lines.length > 0 ? lines.at(-1) : void 0
|
|
19173
19161
|
} : {};
|
|
19174
19162
|
commitComments.push({
|
|
19175
19163
|
sha: commitSha,
|
|
19176
|
-
note: `**${severity
|
|
19164
|
+
note: `**${severity}:** ${file}\n\n**问题:**\n\n - ${details.join("\n - ")}\n\n-------\n\n**修正建议:**\n - ${suggestions.join("\n - ")}${codeExample ? `\n------\n\n**代码示例:**\n${toCode(codeExample)}\n` : ""}`,
|
|
19177
19165
|
...attach
|
|
19178
19166
|
});
|
|
19179
19167
|
}
|
|
19180
19168
|
}
|
|
19181
|
-
for (const issue
|
|
19182
|
-
const { file
|
|
19183
|
-
const fileList = fileMap.get(file
|
|
19184
|
-
fileList.push(issue
|
|
19185
|
-
fileMap.set(file
|
|
19186
|
-
issueList.push(issue
|
|
19187
|
-
severityMap.set(severity
|
|
19169
|
+
for (const issue of issues) {
|
|
19170
|
+
const { file = "NON", commitSha = "", severity = "NON", commitSha: NCommitSha = "NON" } = issue;
|
|
19171
|
+
const fileList = fileMap.get(file) || [], issueList = severityMap.get(severity) || [];
|
|
19172
|
+
fileList.push(issue);
|
|
19173
|
+
fileMap.set(file, fileList);
|
|
19174
|
+
issueList.push(issue);
|
|
19175
|
+
severityMap.set(severity, issueList);
|
|
19188
19176
|
if (commitSha) commitsSet.add(commitSha);
|
|
19189
|
-
commitsMap.set(NCommitSha, issue
|
|
19190
|
-
distCommitComments(issue
|
|
19177
|
+
commitsMap.set(NCommitSha, issue);
|
|
19178
|
+
distCommitComments(issue);
|
|
19191
19179
|
}
|
|
19192
19180
|
if (summary && summary.length > 0) gitlabReportMessage += `> ${summary.join(" \n> ")}\n\n`;
|
|
19193
19181
|
if (risks.length > 0) gitlabReportMessage += "\n**📋 主要风险**\n - " + risks.join("\n - ");
|
|
@@ -19195,33 +19183,32 @@ function distReports(input) {
|
|
|
19195
19183
|
gitlabReportMessage += `\n### 🐛 问题列表`;
|
|
19196
19184
|
const cms = [...commitsSet].map((v) => `[${v.slice(0, 8)}](${linkBase}/${v})`);
|
|
19197
19185
|
if (cms.length > 0) gitlabReportMessage += `\n-----\n> 含问题的commits:${cms.join(",")}\n\n`;
|
|
19198
|
-
for (const [file
|
|
19199
|
-
gitlabReportMessage += `\n-----\n\n#### 文件: ${file
|
|
19200
|
-
for (const issue
|
|
19201
|
-
const { severity
|
|
19202
|
-
gitlabReportMessage += `\n\n**${severity
|
|
19203
|
-
gitlabReportMessage += `\n-
|
|
19204
|
-
gitlabReportMessage += `\n-
|
|
19186
|
+
for (const [file, fileIssues] of fileMap) {
|
|
19187
|
+
gitlabReportMessage += `\n-----\n\n#### 文件: ${file}`;
|
|
19188
|
+
for (const issue of fileIssues) {
|
|
19189
|
+
const { severity = "NON", line = "NON", title: issueTitle = "NON", details = [], suggestions: issueSuggestions = [], codeExample = "", score = "60" } = issue;
|
|
19190
|
+
gitlabReportMessage += `\n\n**${severity}** | ${line} | ${issueTitle}`;
|
|
19191
|
+
gitlabReportMessage += `\n- subagent 可信度:${score}`;
|
|
19192
|
+
gitlabReportMessage += `\n- 详情:${details.length === 1 ? ` ${details[0]}` : `\n - ${details.join("\n - ")}`}`;
|
|
19193
|
+
gitlabReportMessage += `\n- 建议:${issueSuggestions.length === 1 ? ` ${issueSuggestions[0]}` : `\n - ${issueSuggestions.join("\n - ")}`}`;
|
|
19205
19194
|
if (codeExample) gitlabReportMessage += `\n${toCode(codeExample)}\n`;
|
|
19206
19195
|
}
|
|
19207
19196
|
}
|
|
19208
19197
|
}
|
|
19209
19198
|
if (suggestions.length > 0) {
|
|
19210
|
-
gitlabReportMessage += "\n\n### 📈 其他建议\n
|
|
19199
|
+
gitlabReportMessage += "\n\n### 📈 其他建议\n";
|
|
19211
19200
|
let withNoFile = "", withFile = "";
|
|
19212
19201
|
for (const suggestion of suggestions) {
|
|
19213
|
-
const { details = "",
|
|
19214
|
-
|
|
19215
|
-
|
|
19216
|
-
withFile += `\n
|
|
19217
|
-
if (
|
|
19218
|
-
withFile += `\n- 详情:\n - ${details}`;
|
|
19219
|
-
if (codeExample) withFile += `\n${toCode(codeExample)}\n`;
|
|
19202
|
+
const { details = "", file = "", line = "", codeExample = "" } = typeof suggestion === "string" ? { details: suggestion } : suggestion;
|
|
19203
|
+
if (file) {
|
|
19204
|
+
withFile += `\n\n-----\n\n#### 文件: ${file}\n`;
|
|
19205
|
+
withFile += `\n\n**${line === "" ? "文件整体逻辑问题" : line}** | ` + details;
|
|
19206
|
+
if (codeExample) withFile += `\n\n${toCode(codeExample)}\n`;
|
|
19220
19207
|
} else withNoFile += `\n - ${details}`;
|
|
19221
19208
|
}
|
|
19222
19209
|
gitlabReportMessage += withNoFile + withFile;
|
|
19223
19210
|
}
|
|
19224
|
-
|
|
19211
|
+
let subCommitUrl = url;
|
|
19225
19212
|
if (DINGTALK_WEBHOOK) {
|
|
19226
19213
|
dingdingReportMessage = `### 📖 ${title}\n\n**共计**:${issues.length}个问题\n\n${risks.length > 0 ? "**主要风险**:\n\n" + risks.join("\n\n") + "\n\n" : "\n\n"}-----\n\n**项目名**:${CI_PROJECT_NAME}`;
|
|
19227
19214
|
if (type) {
|
|
@@ -19229,66 +19216,116 @@ function distReports(input) {
|
|
|
19229
19216
|
let { id: note = "" } = value || {};
|
|
19230
19217
|
note = note ? `#note_${note}` : "";
|
|
19231
19218
|
const commit = note ? "&评论" : "";
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19219
|
+
url += note;
|
|
19220
|
+
dingdingReportMessage += `${type === "merge_request" ? `\n\n**合并${commit}**:[${CI_MERGE_REQUEST_IID}](${url})` : `\n\n**提交${commit}**:[${CI_COMMIT_SHA.slice(0, 8)}](${url})`}`;
|
|
19221
|
+
}
|
|
19222
|
+
if (severityMap.size > 0) {
|
|
19223
|
+
dingdingReportMessage += `${commitsMap.size > 0 ? `\n\n含问题的commits:${[...commitsMap.keys()].map((v) => `[${v.slice(0, 8)}](${linkBase}/${v})`).join(", ")}` : ""}\n\n-----\n\n#### Issues 🐞\n\n`;
|
|
19224
|
+
let bugLength = 0;
|
|
19225
|
+
const maxBugLength = 5;
|
|
19226
|
+
for (const [severity, severityIssues] of severityMap) {
|
|
19227
|
+
if (bugLength > maxBugLength) break;
|
|
19228
|
+
dingdingReportMessage += `\n\n> **${severity}**`;
|
|
19229
|
+
for (const issue of severityIssues) {
|
|
19230
|
+
if (bugLength > maxBugLength) {
|
|
19231
|
+
dingdingReportMessage += `\n\n\n...以及其他 ${issues.length - bugLength} 个问题,[详见报告](${url})`;
|
|
19232
|
+
break;
|
|
19233
|
+
}
|
|
19234
|
+
const { title: issueTitle = "NON", commitSha = "", file = "NON", line = "NON", commitAuthor = "", score = "60" } = issue;
|
|
19235
|
+
const shortSha = (commitSha || "").slice(0, 8);
|
|
19236
|
+
const commitLink = linkBase && commitSha ? `${linkBase}/${commitSha}` : void 0;
|
|
19237
|
+
dingdingReportMessage += `\n- ${issueTitle}\n\n - score: ${score}\n\n - hash: ${commitLink ? `[${shortSha}](${commitLink}) ` : shortSha}\n\n - author: ${commitAuthor}\n\n - file: ${file}\n\n - line: ${line}`;
|
|
19238
|
+
bugLength++;
|
|
19245
19239
|
}
|
|
19246
|
-
const { title: issueTitle = "NON", commitSha = "", file: file$1 = "NON", line = "NON", commitAuthor = "" } = issue$1;
|
|
19247
|
-
const shortSha = (commitSha || "").slice(0, 8);
|
|
19248
|
-
const commitLink = linkBase && commitSha ? `${linkBase}/${commitSha}` : void 0;
|
|
19249
|
-
dingdingReportMessage += `\n- ${issueTitle}\n\n - hash: ${commitLink ? `[${shortSha}](${commitLink}) ` : shortSha}\n\n - author: ${commitAuthor}\n\n - file: ${file$1}\n\n - line: ${line}`;
|
|
19250
|
-
bugLength++;
|
|
19251
19240
|
}
|
|
19241
|
+
} else {
|
|
19242
|
+
const { value = {} } = lastComment;
|
|
19243
|
+
let { id = "" } = value || {};
|
|
19244
|
+
dingdingReportMessage += `\n\n-----\n\n#### [**改进建议请查看**](${url}#note_${id})\n`;
|
|
19252
19245
|
}
|
|
19253
|
-
if (jiras.length > 0) dingdingReportMessage += `\n\n\n\n
|
|
19246
|
+
if (jiras.length > 0) dingdingReportMessage += `\n\n#### JIRA 🔗\n\n\n\n${jiras.map((v) => `[${v.key}](${JIRA_BASE_URL}/browse/${v.key}): ${v.summary}`).join("\n\n")}`;
|
|
19254
19247
|
}
|
|
19255
|
-
if (commitsURL) gitlabCommitReport.report = commitComments.map(({ sha, file
|
|
19248
|
+
if (commitsURL) gitlabCommitReport.report = commitComments.map(({ sha, file, line, note }) => () => {
|
|
19256
19249
|
const { value = {} } = lastComment;
|
|
19257
19250
|
let { id = "" } = value || {};
|
|
19258
|
-
if (id) note +=
|
|
19259
|
-
|
|
19260
|
-
[**完整评论请查看**](${url}#note_${id})`;
|
|
19251
|
+
if (id) note += `\n\n[**完整评论请查看**](${subCommitUrl}#note_${id})`;
|
|
19261
19252
|
return fetch(`${commitsURL}/${sha}/comments`, {
|
|
19262
19253
|
method: "POST",
|
|
19263
19254
|
headers: buildHeaders(),
|
|
19264
19255
|
body: JSON.stringify({
|
|
19265
19256
|
note,
|
|
19266
|
-
path: file
|
|
19257
|
+
path: file,
|
|
19267
19258
|
line,
|
|
19268
19259
|
line_type: "new"
|
|
19269
19260
|
})
|
|
19270
19261
|
});
|
|
19271
19262
|
});
|
|
19263
|
+
usage();
|
|
19272
19264
|
return result;
|
|
19273
19265
|
}
|
|
19274
19266
|
async function runReport(input) {
|
|
19275
19267
|
let results = [];
|
|
19276
|
-
for (const item of input) results.push(await Promise.all(item.report.map((task) => task())).then(() => item).catch((error
|
|
19268
|
+
for (const item of input) results.push(await Promise.all(item.report.map((task) => task())).then(() => item).catch((error) => ({
|
|
19277
19269
|
title: item.title,
|
|
19278
|
-
error: error
|
|
19270
|
+
error: error.message || "未知错误"
|
|
19279
19271
|
})));
|
|
19280
19272
|
const error = results.find((v) => v.error);
|
|
19281
|
-
return error ? `error: ${error.title}\n${error.error}` : "✅
|
|
19273
|
+
return error ? `error: ${error.title}\n${error.error}` : "✅ Report Done";
|
|
19282
19274
|
}
|
|
19283
|
-
function toCode(code
|
|
19284
|
-
const ct = code
|
|
19285
|
-
return ct.startsWith("```") && ct.endsWith("```") ? code
|
|
19275
|
+
function toCode(code) {
|
|
19276
|
+
const ct = code.trim();
|
|
19277
|
+
return ct.startsWith("```") && ct.endsWith("```") ? code.endsWith("\n```") ? code : code.slice(0, -3) + "\n```" : `\`\`\`\n${code}\n\`\`\``;
|
|
19286
19278
|
}
|
|
19287
19279
|
|
|
19280
|
+
//#endregion
|
|
19281
|
+
//#region packages/message/schema.ts
|
|
19282
|
+
const code = {
|
|
19283
|
+
file: string().optional().describe("The file path where the issue is found"),
|
|
19284
|
+
line: string().optional().describe("Line number, e.g., '1-345' pr '205' or '17,35', **must** provide the line of final file"),
|
|
19285
|
+
codeExample: string().optional().describe(`Code modification suggestions, recommended to use code in diff format, like: \`\`\`
|
|
19286
|
+
while (condition) {
|
|
19287
|
+
unchanged line;
|
|
19288
|
+
- remove this;
|
|
19289
|
+
+ replace it with this;
|
|
19290
|
+
+ and this;
|
|
19291
|
+
but keep this the same;
|
|
19292
|
+
}\`\`\`.`)
|
|
19293
|
+
};
|
|
19294
|
+
const severity = "such as CRITICAL, HIGH, MEDIUM, LOW";
|
|
19295
|
+
const nonInfo = "When the current change no longer exists in the latest code, please take the relevant information from the most recent change.";
|
|
19296
|
+
const reportSchema = {
|
|
19297
|
+
title: string().describe("Describe the problem in the shortest possible way."),
|
|
19298
|
+
summary: union([string(), array(string())]).optional().describe("Regarding the description of the current review, please summarize the main logic of the submission as concisely as possible. If you need to split the summary into multiple points, please use Markdown's splitting syntax such as <br> to do so."),
|
|
19299
|
+
issues: array(object({
|
|
19300
|
+
severity: string().optional().describe(`Issue severity levels, ${severity}.`),
|
|
19301
|
+
score: string().optional().describe(`Issue credibility score, from 0-100`),
|
|
19302
|
+
commitTitle: string().describe(`The commit title associated with the issue, ${nonInfo}`),
|
|
19303
|
+
commitAuthor: string().describe(`The commit latest author associated with the issue, ${nonInfo}`),
|
|
19304
|
+
commitSha: string().describe(`The commit SHA associated with the issue, ${nonInfo}`),
|
|
19305
|
+
title: string().optional().describe("A short title for the issue"),
|
|
19306
|
+
details: array(string()).optional().describe("Details about the issue"),
|
|
19307
|
+
suggestions: array(string()).optional().describe("Improvement suggestion"),
|
|
19308
|
+
...code
|
|
19309
|
+
})).optional().describe(`List all bugs involved in the modified code. **Must** only list the issues related to the modified parts. **Must** order by 'severity' from heaviest to lightest, ${severity}`),
|
|
19310
|
+
jiras: array(object({
|
|
19311
|
+
key: string().describe("JIRA issue key, e.g., 'FUS-123'"),
|
|
19312
|
+
summary: string().describe("Summary of the JIRA issue")
|
|
19313
|
+
}).describe("Related JIRA issues")).optional().describe("List JIRA issues in review"),
|
|
19314
|
+
risks: union([string(), array(string())]).optional().describe("After summarizing all the bugs, identify the main risks that could potentially impact the business."),
|
|
19315
|
+
suggestions: union([
|
|
19316
|
+
string(),
|
|
19317
|
+
array(string()),
|
|
19318
|
+
array(object({
|
|
19319
|
+
details: string().describe("Suggestions with the same meaning should be stated in one sentence; please do not increase the array length."),
|
|
19320
|
+
...code
|
|
19321
|
+
})).describe("For other issues in the code, and for issues with a score below 50, please post the bugs and suggested fixes here.")
|
|
19322
|
+
]).optional().describe("Please provide other suggestions for modifying the code or related code.")
|
|
19323
|
+
};
|
|
19324
|
+
|
|
19288
19325
|
//#endregion
|
|
19289
19326
|
//#region packages/message/index.ts
|
|
19290
|
-
function install(server
|
|
19291
|
-
server
|
|
19327
|
+
function install(server) {
|
|
19328
|
+
server.registerTool(report, {
|
|
19292
19329
|
description: noMandatory,
|
|
19293
19330
|
inputSchema: reportSchema
|
|
19294
19331
|
}, async (input) => ({ content: [{
|
|
@@ -19298,7 +19335,7 @@ function install(server$1) {
|
|
|
19298
19335
|
}
|
|
19299
19336
|
|
|
19300
19337
|
//#endregion
|
|
19301
|
-
//#region
|
|
19338
|
+
//#region packages/server/index.ts
|
|
19302
19339
|
const server = new McpServer({
|
|
19303
19340
|
name,
|
|
19304
19341
|
version: "1.0.0"
|