@wix/mcp 1.0.14 → 1.0.16
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/build/bin-standalone.js +13 -8
- package/build/bin-standalone.js.map +3 -3
- package/build/cjs/index.cjs +591 -510
- package/build/cjs/index.cjs.map +4 -4
- package/build/dts/constants.d.ts +4 -0
- package/build/dts/constants.d.ts.map +1 -0
- package/build/dts/constants.js +4 -0
- package/build/dts/constants.js.map +1 -0
- package/build/dts/docs/fetch-article.d.ts.map +1 -1
- package/build/dts/docs/fetch-article.js +3 -2
- package/build/dts/docs/fetch-article.js.map +1 -1
- package/build/dts/resources/docs.d.ts.map +1 -1
- package/build/dts/resources/docs.js +3 -2
- package/build/dts/resources/docs.js.map +1 -1
- package/build/dts/wix-mcp-server.d.ts.map +1 -1
- package/build/dts/wix-mcp-server.js +5 -3
- package/build/dts/wix-mcp-server.js.map +1 -1
- package/build/esm/index.js +1487 -2727
- package/build/esm/index.js.map +4 -4
- package/package.json +12 -12
package/build/cjs/index.cjs
CHANGED
|
@@ -926,13 +926,13 @@ var init_md5 = __esm({
|
|
|
926
926
|
});
|
|
927
927
|
|
|
928
928
|
// ../../node_modules/@wix/panorama-common/node_modules/uuid/dist/esm-node/v3.js
|
|
929
|
-
var v3,
|
|
929
|
+
var v3, v3_default2;
|
|
930
930
|
var init_v3 = __esm({
|
|
931
931
|
"../../node_modules/@wix/panorama-common/node_modules/uuid/dist/esm-node/v3.js"() {
|
|
932
932
|
init_v35();
|
|
933
933
|
init_md5();
|
|
934
934
|
v3 = v35("v3", 48, md5_default);
|
|
935
|
-
|
|
935
|
+
v3_default2 = v3;
|
|
936
936
|
}
|
|
937
937
|
});
|
|
938
938
|
|
|
@@ -1033,7 +1033,7 @@ __export(esm_node_exports, {
|
|
|
1033
1033
|
parse: () => parse_default,
|
|
1034
1034
|
stringify: () => stringify_default,
|
|
1035
1035
|
v1: () => v1_default,
|
|
1036
|
-
v3: () =>
|
|
1036
|
+
v3: () => v3_default2,
|
|
1037
1037
|
v4: () => v4_default2,
|
|
1038
1038
|
v5: () => v5_default,
|
|
1039
1039
|
validate: () => validate_default,
|
|
@@ -15262,14 +15262,14 @@ function v4(options, buf, offset) {
|
|
|
15262
15262
|
}
|
|
15263
15263
|
var v4_default = v4;
|
|
15264
15264
|
|
|
15265
|
-
// ../../node_modules/@sentry/core/build/esm/
|
|
15266
|
-
var GLOBAL_OBJ = globalThis;
|
|
15267
|
-
|
|
15268
|
-
// ../../node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js
|
|
15265
|
+
// ../../node_modules/@sentry/core/build/esm/debug-build.js
|
|
15269
15266
|
var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
15270
15267
|
|
|
15271
15268
|
// ../../node_modules/@sentry/core/build/esm/utils-hoist/version.js
|
|
15272
|
-
var SDK_VERSION = "9.
|
|
15269
|
+
var SDK_VERSION = "9.22.0";
|
|
15270
|
+
|
|
15271
|
+
// ../../node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js
|
|
15272
|
+
var GLOBAL_OBJ = globalThis;
|
|
15273
15273
|
|
|
15274
15274
|
// ../../node_modules/@sentry/core/build/esm/carrier.js
|
|
15275
15275
|
function getMainCarrier() {
|
|
@@ -15287,6 +15287,18 @@ function getGlobalSingleton(name, creator, obj = GLOBAL_OBJ) {
|
|
|
15287
15287
|
return carrier[name] || (carrier[name] = creator());
|
|
15288
15288
|
}
|
|
15289
15289
|
|
|
15290
|
+
// ../../node_modules/@sentry/core/build/esm/utils-hoist/is.js
|
|
15291
|
+
var objectToString = Object.prototype.toString;
|
|
15292
|
+
function isBuiltin(wat, className) {
|
|
15293
|
+
return objectToString.call(wat) === `[object ${className}]`;
|
|
15294
|
+
}
|
|
15295
|
+
function isPlainObject(wat) {
|
|
15296
|
+
return isBuiltin(wat, "Object");
|
|
15297
|
+
}
|
|
15298
|
+
function isThenable(wat) {
|
|
15299
|
+
return Boolean(wat?.then && typeof wat.then === "function");
|
|
15300
|
+
}
|
|
15301
|
+
|
|
15290
15302
|
// ../../node_modules/@sentry/core/build/esm/utils-hoist/logger.js
|
|
15291
15303
|
var PREFIX = "Sentry Logger ";
|
|
15292
15304
|
var CONSOLE_LEVELS = [
|
|
@@ -15349,36 +15361,6 @@ function makeLogger() {
|
|
|
15349
15361
|
}
|
|
15350
15362
|
var logger = getGlobalSingleton("logger", makeLogger);
|
|
15351
15363
|
|
|
15352
|
-
// ../../node_modules/@sentry/core/build/esm/utils-hoist/time.js
|
|
15353
|
-
var ONE_SECOND_IN_MS = 1e3;
|
|
15354
|
-
function dateTimestampInSeconds() {
|
|
15355
|
-
return Date.now() / ONE_SECOND_IN_MS;
|
|
15356
|
-
}
|
|
15357
|
-
function createUnixTimestampInSecondsFunc() {
|
|
15358
|
-
const { performance: performance2 } = GLOBAL_OBJ;
|
|
15359
|
-
if (!performance2?.now) {
|
|
15360
|
-
return dateTimestampInSeconds;
|
|
15361
|
-
}
|
|
15362
|
-
const approxStartingTimeOrigin = Date.now() - performance2.now();
|
|
15363
|
-
const timeOrigin = performance2.timeOrigin == void 0 ? approxStartingTimeOrigin : performance2.timeOrigin;
|
|
15364
|
-
return () => {
|
|
15365
|
-
return (timeOrigin + performance2.now()) / ONE_SECOND_IN_MS;
|
|
15366
|
-
};
|
|
15367
|
-
}
|
|
15368
|
-
var timestampInSeconds = createUnixTimestampInSecondsFunc();
|
|
15369
|
-
|
|
15370
|
-
// ../../node_modules/@sentry/core/build/esm/utils-hoist/is.js
|
|
15371
|
-
var objectToString = Object.prototype.toString;
|
|
15372
|
-
function isBuiltin(wat, className) {
|
|
15373
|
-
return objectToString.call(wat) === `[object ${className}]`;
|
|
15374
|
-
}
|
|
15375
|
-
function isPlainObject(wat) {
|
|
15376
|
-
return isBuiltin(wat, "Object");
|
|
15377
|
-
}
|
|
15378
|
-
function isThenable(wat) {
|
|
15379
|
-
return Boolean(wat?.then && typeof wat.then === "function");
|
|
15380
|
-
}
|
|
15381
|
-
|
|
15382
15364
|
// ../../node_modules/@sentry/core/build/esm/utils-hoist/string.js
|
|
15383
15365
|
function truncate(str, max = 0) {
|
|
15384
15366
|
if (typeof str !== "string" || max === 0) {
|
|
@@ -15430,6 +15412,24 @@ function uuid4(crypto5 = getCrypto()) {
|
|
|
15430
15412
|
);
|
|
15431
15413
|
}
|
|
15432
15414
|
|
|
15415
|
+
// ../../node_modules/@sentry/core/build/esm/utils-hoist/time.js
|
|
15416
|
+
var ONE_SECOND_IN_MS = 1e3;
|
|
15417
|
+
function dateTimestampInSeconds() {
|
|
15418
|
+
return Date.now() / ONE_SECOND_IN_MS;
|
|
15419
|
+
}
|
|
15420
|
+
function createUnixTimestampInSecondsFunc() {
|
|
15421
|
+
const { performance: performance2 } = GLOBAL_OBJ;
|
|
15422
|
+
if (!performance2?.now) {
|
|
15423
|
+
return dateTimestampInSeconds;
|
|
15424
|
+
}
|
|
15425
|
+
const approxStartingTimeOrigin = Date.now() - performance2.now();
|
|
15426
|
+
const timeOrigin = performance2.timeOrigin == void 0 ? approxStartingTimeOrigin : performance2.timeOrigin;
|
|
15427
|
+
return () => {
|
|
15428
|
+
return (timeOrigin + performance2.now()) / ONE_SECOND_IN_MS;
|
|
15429
|
+
};
|
|
15430
|
+
}
|
|
15431
|
+
var timestampInSeconds = createUnixTimestampInSecondsFunc();
|
|
15432
|
+
|
|
15433
15433
|
// ../../node_modules/@sentry/core/build/esm/session.js
|
|
15434
15434
|
function updateSession(session, context = {}) {
|
|
15435
15435
|
if (context.user) {
|
|
@@ -15487,11 +15487,6 @@ function updateSession(session, context = {}) {
|
|
|
15487
15487
|
}
|
|
15488
15488
|
}
|
|
15489
15489
|
|
|
15490
|
-
// ../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js
|
|
15491
|
-
function generateTraceId() {
|
|
15492
|
-
return uuid4();
|
|
15493
|
-
}
|
|
15494
|
-
|
|
15495
15490
|
// ../../node_modules/@sentry/core/build/esm/utils/merge.js
|
|
15496
15491
|
function merge(initialObj, mergeObj, levels = 2) {
|
|
15497
15492
|
if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) {
|
|
@@ -15522,6 +15517,11 @@ function _getSpanForScope(scope) {
|
|
|
15522
15517
|
return scope[SCOPE_SPAN_FIELD];
|
|
15523
15518
|
}
|
|
15524
15519
|
|
|
15520
|
+
// ../../node_modules/@sentry/core/build/esm/utils-hoist/propagationContext.js
|
|
15521
|
+
function generateTraceId() {
|
|
15522
|
+
return uuid4();
|
|
15523
|
+
}
|
|
15524
|
+
|
|
15525
15525
|
// ../../node_modules/@sentry/core/build/esm/scope.js
|
|
15526
15526
|
var DEFAULT_MAX_BREADCRUMBS = 100;
|
|
15527
15527
|
var Scope = class _Scope {
|
|
@@ -16171,10 +16171,123 @@ function setTags(tags) {
|
|
|
16171
16171
|
getIsolationScope().setTags(tags);
|
|
16172
16172
|
}
|
|
16173
16173
|
|
|
16174
|
-
// ../../node_modules/zod/
|
|
16174
|
+
// ../../node_modules/zod/dist/esm/v3/external.js
|
|
16175
|
+
var external_exports = {};
|
|
16176
|
+
__export(external_exports, {
|
|
16177
|
+
BRAND: () => BRAND,
|
|
16178
|
+
DIRTY: () => DIRTY,
|
|
16179
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
16180
|
+
INVALID: () => INVALID,
|
|
16181
|
+
NEVER: () => NEVER,
|
|
16182
|
+
OK: () => OK,
|
|
16183
|
+
ParseStatus: () => ParseStatus,
|
|
16184
|
+
Schema: () => ZodType,
|
|
16185
|
+
ZodAny: () => ZodAny,
|
|
16186
|
+
ZodArray: () => ZodArray,
|
|
16187
|
+
ZodBigInt: () => ZodBigInt,
|
|
16188
|
+
ZodBoolean: () => ZodBoolean,
|
|
16189
|
+
ZodBranded: () => ZodBranded,
|
|
16190
|
+
ZodCatch: () => ZodCatch,
|
|
16191
|
+
ZodDate: () => ZodDate,
|
|
16192
|
+
ZodDefault: () => ZodDefault,
|
|
16193
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
16194
|
+
ZodEffects: () => ZodEffects,
|
|
16195
|
+
ZodEnum: () => ZodEnum,
|
|
16196
|
+
ZodError: () => ZodError,
|
|
16197
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
16198
|
+
ZodFunction: () => ZodFunction,
|
|
16199
|
+
ZodIntersection: () => ZodIntersection,
|
|
16200
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
16201
|
+
ZodLazy: () => ZodLazy,
|
|
16202
|
+
ZodLiteral: () => ZodLiteral,
|
|
16203
|
+
ZodMap: () => ZodMap,
|
|
16204
|
+
ZodNaN: () => ZodNaN,
|
|
16205
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
16206
|
+
ZodNever: () => ZodNever,
|
|
16207
|
+
ZodNull: () => ZodNull,
|
|
16208
|
+
ZodNullable: () => ZodNullable,
|
|
16209
|
+
ZodNumber: () => ZodNumber,
|
|
16210
|
+
ZodObject: () => ZodObject,
|
|
16211
|
+
ZodOptional: () => ZodOptional,
|
|
16212
|
+
ZodParsedType: () => ZodParsedType,
|
|
16213
|
+
ZodPipeline: () => ZodPipeline,
|
|
16214
|
+
ZodPromise: () => ZodPromise,
|
|
16215
|
+
ZodReadonly: () => ZodReadonly,
|
|
16216
|
+
ZodRecord: () => ZodRecord,
|
|
16217
|
+
ZodSchema: () => ZodType,
|
|
16218
|
+
ZodSet: () => ZodSet,
|
|
16219
|
+
ZodString: () => ZodString,
|
|
16220
|
+
ZodSymbol: () => ZodSymbol,
|
|
16221
|
+
ZodTransformer: () => ZodEffects,
|
|
16222
|
+
ZodTuple: () => ZodTuple,
|
|
16223
|
+
ZodType: () => ZodType,
|
|
16224
|
+
ZodUndefined: () => ZodUndefined,
|
|
16225
|
+
ZodUnion: () => ZodUnion,
|
|
16226
|
+
ZodUnknown: () => ZodUnknown,
|
|
16227
|
+
ZodVoid: () => ZodVoid,
|
|
16228
|
+
addIssueToContext: () => addIssueToContext,
|
|
16229
|
+
any: () => anyType,
|
|
16230
|
+
array: () => arrayType,
|
|
16231
|
+
bigint: () => bigIntType,
|
|
16232
|
+
boolean: () => booleanType,
|
|
16233
|
+
coerce: () => coerce,
|
|
16234
|
+
custom: () => custom,
|
|
16235
|
+
date: () => dateType,
|
|
16236
|
+
datetimeRegex: () => datetimeRegex,
|
|
16237
|
+
defaultErrorMap: () => en_default,
|
|
16238
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
16239
|
+
effect: () => effectsType,
|
|
16240
|
+
enum: () => enumType,
|
|
16241
|
+
function: () => functionType,
|
|
16242
|
+
getErrorMap: () => getErrorMap,
|
|
16243
|
+
getParsedType: () => getParsedType,
|
|
16244
|
+
instanceof: () => instanceOfType,
|
|
16245
|
+
intersection: () => intersectionType,
|
|
16246
|
+
isAborted: () => isAborted,
|
|
16247
|
+
isAsync: () => isAsync,
|
|
16248
|
+
isDirty: () => isDirty,
|
|
16249
|
+
isValid: () => isValid,
|
|
16250
|
+
late: () => late,
|
|
16251
|
+
lazy: () => lazyType,
|
|
16252
|
+
literal: () => literalType,
|
|
16253
|
+
makeIssue: () => makeIssue,
|
|
16254
|
+
map: () => mapType,
|
|
16255
|
+
nan: () => nanType,
|
|
16256
|
+
nativeEnum: () => nativeEnumType,
|
|
16257
|
+
never: () => neverType,
|
|
16258
|
+
null: () => nullType,
|
|
16259
|
+
nullable: () => nullableType,
|
|
16260
|
+
number: () => numberType,
|
|
16261
|
+
object: () => objectType,
|
|
16262
|
+
objectUtil: () => objectUtil,
|
|
16263
|
+
oboolean: () => oboolean,
|
|
16264
|
+
onumber: () => onumber,
|
|
16265
|
+
optional: () => optionalType,
|
|
16266
|
+
ostring: () => ostring,
|
|
16267
|
+
pipeline: () => pipelineType,
|
|
16268
|
+
preprocess: () => preprocessType,
|
|
16269
|
+
promise: () => promiseType,
|
|
16270
|
+
quotelessJson: () => quotelessJson,
|
|
16271
|
+
record: () => recordType,
|
|
16272
|
+
set: () => setType,
|
|
16273
|
+
setErrorMap: () => setErrorMap,
|
|
16274
|
+
strictObject: () => strictObjectType,
|
|
16275
|
+
string: () => stringType,
|
|
16276
|
+
symbol: () => symbolType,
|
|
16277
|
+
transformer: () => effectsType,
|
|
16278
|
+
tuple: () => tupleType,
|
|
16279
|
+
undefined: () => undefinedType,
|
|
16280
|
+
union: () => unionType,
|
|
16281
|
+
unknown: () => unknownType,
|
|
16282
|
+
util: () => util,
|
|
16283
|
+
void: () => voidType
|
|
16284
|
+
});
|
|
16285
|
+
|
|
16286
|
+
// ../../node_modules/zod/dist/esm/v3/helpers/util.js
|
|
16175
16287
|
var util;
|
|
16176
16288
|
(function(util2) {
|
|
16177
|
-
util2.assertEqual = (
|
|
16289
|
+
util2.assertEqual = (_) => {
|
|
16290
|
+
};
|
|
16178
16291
|
function assertIs(_arg) {
|
|
16179
16292
|
}
|
|
16180
16293
|
util2.assertIs = assertIs;
|
|
@@ -16218,7 +16331,7 @@ var util;
|
|
|
16218
16331
|
}
|
|
16219
16332
|
return void 0;
|
|
16220
16333
|
};
|
|
16221
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
16334
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
16222
16335
|
function joinValues(array, separator = " | ") {
|
|
16223
16336
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
16224
16337
|
}
|
|
@@ -16270,7 +16383,7 @@ var getParsedType = (data) => {
|
|
|
16270
16383
|
case "string":
|
|
16271
16384
|
return ZodParsedType.string;
|
|
16272
16385
|
case "number":
|
|
16273
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
16386
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
16274
16387
|
case "boolean":
|
|
16275
16388
|
return ZodParsedType.boolean;
|
|
16276
16389
|
case "function":
|
|
@@ -16303,6 +16416,8 @@ var getParsedType = (data) => {
|
|
|
16303
16416
|
return ZodParsedType.unknown;
|
|
16304
16417
|
}
|
|
16305
16418
|
};
|
|
16419
|
+
|
|
16420
|
+
// ../../node_modules/zod/dist/esm/v3/ZodError.js
|
|
16306
16421
|
var ZodIssueCode = util.arrayToEnum([
|
|
16307
16422
|
"invalid_type",
|
|
16308
16423
|
"invalid_literal",
|
|
@@ -16418,6 +16533,8 @@ ZodError.create = (issues) => {
|
|
|
16418
16533
|
const error = new ZodError(issues);
|
|
16419
16534
|
return error;
|
|
16420
16535
|
};
|
|
16536
|
+
|
|
16537
|
+
// ../../node_modules/zod/dist/esm/v3/locales/en.js
|
|
16421
16538
|
var errorMap = (issue, _ctx) => {
|
|
16422
16539
|
let message;
|
|
16423
16540
|
switch (issue.code) {
|
|
@@ -16516,13 +16633,18 @@ var errorMap = (issue, _ctx) => {
|
|
|
16516
16633
|
}
|
|
16517
16634
|
return { message };
|
|
16518
16635
|
};
|
|
16519
|
-
var
|
|
16636
|
+
var en_default = errorMap;
|
|
16637
|
+
|
|
16638
|
+
// ../../node_modules/zod/dist/esm/v3/errors.js
|
|
16639
|
+
var overrideErrorMap = en_default;
|
|
16520
16640
|
function setErrorMap(map) {
|
|
16521
16641
|
overrideErrorMap = map;
|
|
16522
16642
|
}
|
|
16523
16643
|
function getErrorMap() {
|
|
16524
16644
|
return overrideErrorMap;
|
|
16525
16645
|
}
|
|
16646
|
+
|
|
16647
|
+
// ../../node_modules/zod/dist/esm/v3/helpers/parseUtil.js
|
|
16526
16648
|
var makeIssue = (params) => {
|
|
16527
16649
|
const { data, path: path2, errorMaps, issueData } = params;
|
|
16528
16650
|
const fullPath = [...path2, ...issueData.path || []];
|
|
@@ -16562,7 +16684,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
16562
16684
|
// then schema-bound map if available
|
|
16563
16685
|
overrideMap,
|
|
16564
16686
|
// then global override map
|
|
16565
|
-
overrideMap ===
|
|
16687
|
+
overrideMap === en_default ? void 0 : en_default
|
|
16566
16688
|
// then global default map
|
|
16567
16689
|
].filter((x) => !!x)
|
|
16568
16690
|
});
|
|
@@ -16631,22 +16753,26 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
16631
16753
|
var isDirty = (x) => x.status === "dirty";
|
|
16632
16754
|
var isValid = (x) => x.status === "valid";
|
|
16633
16755
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
16634
|
-
|
|
16756
|
+
|
|
16757
|
+
// ../../node_modules/zod/dist/esm/v3/helpers/errorUtil.js
|
|
16758
|
+
var errorUtil;
|
|
16759
|
+
(function(errorUtil2) {
|
|
16760
|
+
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
16761
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
16762
|
+
})(errorUtil || (errorUtil = {}));
|
|
16763
|
+
|
|
16764
|
+
// ../../node_modules/zod/dist/esm/v3/types.js
|
|
16765
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
16635
16766
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
16636
16767
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16637
16768
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
16638
|
-
}
|
|
16639
|
-
|
|
16769
|
+
};
|
|
16770
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
16640
16771
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16641
16772
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16642
16773
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16643
16774
|
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
16644
|
-
}
|
|
16645
|
-
var errorUtil;
|
|
16646
|
-
(function(errorUtil2) {
|
|
16647
|
-
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
16648
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
16649
|
-
})(errorUtil || (errorUtil = {}));
|
|
16775
|
+
};
|
|
16650
16776
|
var _ZodEnum_cache;
|
|
16651
16777
|
var _ZodNativeEnum_cache;
|
|
16652
16778
|
var ParseInputLazyPath = class {
|
|
@@ -16659,7 +16785,7 @@ var ParseInputLazyPath = class {
|
|
|
16659
16785
|
}
|
|
16660
16786
|
get path() {
|
|
16661
16787
|
if (!this._cachedPath.length) {
|
|
16662
|
-
if (this._key
|
|
16788
|
+
if (Array.isArray(this._key)) {
|
|
16663
16789
|
this._cachedPath.push(...this._path, ...this._key);
|
|
16664
16790
|
} else {
|
|
16665
16791
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -16697,17 +16823,16 @@ function processCreateParams(params) {
|
|
|
16697
16823
|
if (errorMap2)
|
|
16698
16824
|
return { errorMap: errorMap2, description };
|
|
16699
16825
|
const customMap = (iss, ctx) => {
|
|
16700
|
-
var _a, _b;
|
|
16701
16826
|
const { message } = params;
|
|
16702
16827
|
if (iss.code === "invalid_enum_value") {
|
|
16703
|
-
return { message: message
|
|
16828
|
+
return { message: message ?? ctx.defaultError };
|
|
16704
16829
|
}
|
|
16705
16830
|
if (typeof ctx.data === "undefined") {
|
|
16706
|
-
return { message:
|
|
16831
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
16707
16832
|
}
|
|
16708
16833
|
if (iss.code !== "invalid_type")
|
|
16709
16834
|
return { message: ctx.defaultError };
|
|
16710
|
-
return { message:
|
|
16835
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
16711
16836
|
};
|
|
16712
16837
|
return { errorMap: customMap, description };
|
|
16713
16838
|
}
|
|
@@ -16759,14 +16884,13 @@ var ZodType = class {
|
|
|
16759
16884
|
throw result.error;
|
|
16760
16885
|
}
|
|
16761
16886
|
safeParse(data, params) {
|
|
16762
|
-
var _a;
|
|
16763
16887
|
const ctx = {
|
|
16764
16888
|
common: {
|
|
16765
16889
|
issues: [],
|
|
16766
|
-
async:
|
|
16767
|
-
contextualErrorMap: params
|
|
16890
|
+
async: params?.async ?? false,
|
|
16891
|
+
contextualErrorMap: params?.errorMap
|
|
16768
16892
|
},
|
|
16769
|
-
path:
|
|
16893
|
+
path: params?.path || [],
|
|
16770
16894
|
schemaErrorMap: this._def.errorMap,
|
|
16771
16895
|
parent: null,
|
|
16772
16896
|
data,
|
|
@@ -16776,7 +16900,6 @@ var ZodType = class {
|
|
|
16776
16900
|
return handleResult(ctx, result);
|
|
16777
16901
|
}
|
|
16778
16902
|
"~validate"(data) {
|
|
16779
|
-
var _a, _b;
|
|
16780
16903
|
const ctx = {
|
|
16781
16904
|
common: {
|
|
16782
16905
|
issues: [],
|
|
@@ -16797,7 +16920,7 @@ var ZodType = class {
|
|
|
16797
16920
|
issues: ctx.common.issues
|
|
16798
16921
|
};
|
|
16799
16922
|
} catch (err) {
|
|
16800
|
-
if (
|
|
16923
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
16801
16924
|
this["~standard"].async = true;
|
|
16802
16925
|
}
|
|
16803
16926
|
ctx.common = {
|
|
@@ -16822,10 +16945,10 @@ var ZodType = class {
|
|
|
16822
16945
|
const ctx = {
|
|
16823
16946
|
common: {
|
|
16824
16947
|
issues: [],
|
|
16825
|
-
contextualErrorMap: params
|
|
16948
|
+
contextualErrorMap: params?.errorMap,
|
|
16826
16949
|
async: true
|
|
16827
16950
|
},
|
|
16828
|
-
path:
|
|
16951
|
+
path: params?.path || [],
|
|
16829
16952
|
schemaErrorMap: this._def.errorMap,
|
|
16830
16953
|
parent: null,
|
|
16831
16954
|
data,
|
|
@@ -17054,12 +17177,14 @@ function isValidJWT(jwt, alg) {
|
|
|
17054
17177
|
const decoded = JSON.parse(atob(base64));
|
|
17055
17178
|
if (typeof decoded !== "object" || decoded === null)
|
|
17056
17179
|
return false;
|
|
17057
|
-
if (
|
|
17180
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
17181
|
+
return false;
|
|
17182
|
+
if (!decoded.alg)
|
|
17058
17183
|
return false;
|
|
17059
17184
|
if (alg && decoded.alg !== alg)
|
|
17060
17185
|
return false;
|
|
17061
17186
|
return true;
|
|
17062
|
-
} catch
|
|
17187
|
+
} catch {
|
|
17063
17188
|
return false;
|
|
17064
17189
|
}
|
|
17065
17190
|
}
|
|
@@ -17218,7 +17343,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
17218
17343
|
} else if (check.kind === "url") {
|
|
17219
17344
|
try {
|
|
17220
17345
|
new URL(input.data);
|
|
17221
|
-
} catch
|
|
17346
|
+
} catch {
|
|
17222
17347
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
17223
17348
|
addIssueToContext(ctx, {
|
|
17224
17349
|
validation: "url",
|
|
@@ -17430,7 +17555,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
17430
17555
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
17431
17556
|
}
|
|
17432
17557
|
datetime(options) {
|
|
17433
|
-
var _a, _b;
|
|
17434
17558
|
if (typeof options === "string") {
|
|
17435
17559
|
return this._addCheck({
|
|
17436
17560
|
kind: "datetime",
|
|
@@ -17442,10 +17566,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
17442
17566
|
}
|
|
17443
17567
|
return this._addCheck({
|
|
17444
17568
|
kind: "datetime",
|
|
17445
|
-
precision: typeof
|
|
17446
|
-
offset:
|
|
17447
|
-
local:
|
|
17448
|
-
...errorUtil.errToObj(options
|
|
17569
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
17570
|
+
offset: options?.offset ?? false,
|
|
17571
|
+
local: options?.local ?? false,
|
|
17572
|
+
...errorUtil.errToObj(options?.message)
|
|
17449
17573
|
});
|
|
17450
17574
|
}
|
|
17451
17575
|
date(message) {
|
|
@@ -17461,8 +17585,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
17461
17585
|
}
|
|
17462
17586
|
return this._addCheck({
|
|
17463
17587
|
kind: "time",
|
|
17464
|
-
precision: typeof
|
|
17465
|
-
...errorUtil.errToObj(options
|
|
17588
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
17589
|
+
...errorUtil.errToObj(options?.message)
|
|
17466
17590
|
});
|
|
17467
17591
|
}
|
|
17468
17592
|
duration(message) {
|
|
@@ -17479,8 +17603,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
17479
17603
|
return this._addCheck({
|
|
17480
17604
|
kind: "includes",
|
|
17481
17605
|
value,
|
|
17482
|
-
position: options
|
|
17483
|
-
...errorUtil.errToObj(options
|
|
17606
|
+
position: options?.position,
|
|
17607
|
+
...errorUtil.errToObj(options?.message)
|
|
17484
17608
|
});
|
|
17485
17609
|
}
|
|
17486
17610
|
startsWith(value, message) {
|
|
@@ -17612,11 +17736,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
17612
17736
|
}
|
|
17613
17737
|
};
|
|
17614
17738
|
ZodString.create = (params) => {
|
|
17615
|
-
var _a;
|
|
17616
17739
|
return new ZodString({
|
|
17617
17740
|
checks: [],
|
|
17618
17741
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
17619
|
-
coerce:
|
|
17742
|
+
coerce: params?.coerce ?? false,
|
|
17620
17743
|
...processCreateParams(params)
|
|
17621
17744
|
});
|
|
17622
17745
|
};
|
|
@@ -17624,9 +17747,9 @@ function floatSafeRemainder(val, step) {
|
|
|
17624
17747
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
17625
17748
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
17626
17749
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
17627
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
17628
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
17629
|
-
return valInt % stepInt /
|
|
17750
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
17751
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
17752
|
+
return valInt % stepInt / 10 ** decCount;
|
|
17630
17753
|
}
|
|
17631
17754
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
17632
17755
|
constructor() {
|
|
@@ -17836,7 +17959,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
17836
17959
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
17837
17960
|
}
|
|
17838
17961
|
get isFinite() {
|
|
17839
|
-
let max = null
|
|
17962
|
+
let max = null;
|
|
17963
|
+
let min = null;
|
|
17840
17964
|
for (const ch of this._def.checks) {
|
|
17841
17965
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
17842
17966
|
return true;
|
|
@@ -17855,7 +17979,7 @@ ZodNumber.create = (params) => {
|
|
|
17855
17979
|
return new ZodNumber({
|
|
17856
17980
|
checks: [],
|
|
17857
17981
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
17858
|
-
coerce:
|
|
17982
|
+
coerce: params?.coerce || false,
|
|
17859
17983
|
...processCreateParams(params)
|
|
17860
17984
|
});
|
|
17861
17985
|
};
|
|
@@ -17869,7 +17993,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
17869
17993
|
if (this._def.coerce) {
|
|
17870
17994
|
try {
|
|
17871
17995
|
input.data = BigInt(input.data);
|
|
17872
|
-
} catch
|
|
17996
|
+
} catch {
|
|
17873
17997
|
return this._getInvalidInput(input);
|
|
17874
17998
|
}
|
|
17875
17999
|
}
|
|
@@ -18024,11 +18148,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
18024
18148
|
}
|
|
18025
18149
|
};
|
|
18026
18150
|
ZodBigInt.create = (params) => {
|
|
18027
|
-
var _a;
|
|
18028
18151
|
return new ZodBigInt({
|
|
18029
18152
|
checks: [],
|
|
18030
18153
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
18031
|
-
coerce:
|
|
18154
|
+
coerce: params?.coerce ?? false,
|
|
18032
18155
|
...processCreateParams(params)
|
|
18033
18156
|
});
|
|
18034
18157
|
};
|
|
@@ -18053,7 +18176,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
18053
18176
|
ZodBoolean.create = (params) => {
|
|
18054
18177
|
return new ZodBoolean({
|
|
18055
18178
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
18056
|
-
coerce:
|
|
18179
|
+
coerce: params?.coerce || false,
|
|
18057
18180
|
...processCreateParams(params)
|
|
18058
18181
|
});
|
|
18059
18182
|
};
|
|
@@ -18072,7 +18195,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
18072
18195
|
});
|
|
18073
18196
|
return INVALID;
|
|
18074
18197
|
}
|
|
18075
|
-
if (isNaN(input.data.getTime())) {
|
|
18198
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
18076
18199
|
const ctx2 = this._getOrReturnCtx(input);
|
|
18077
18200
|
addIssueToContext(ctx2, {
|
|
18078
18201
|
code: ZodIssueCode.invalid_date
|
|
@@ -18161,7 +18284,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
18161
18284
|
ZodDate.create = (params) => {
|
|
18162
18285
|
return new ZodDate({
|
|
18163
18286
|
checks: [],
|
|
18164
|
-
coerce:
|
|
18287
|
+
coerce: params?.coerce || false,
|
|
18165
18288
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
18166
18289
|
...processCreateParams(params)
|
|
18167
18290
|
});
|
|
@@ -18436,7 +18559,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18436
18559
|
return this._cached;
|
|
18437
18560
|
const shape = this._def.shape();
|
|
18438
18561
|
const keys = util.objectKeys(shape);
|
|
18439
|
-
|
|
18562
|
+
this._cached = { shape, keys };
|
|
18563
|
+
return this._cached;
|
|
18440
18564
|
}
|
|
18441
18565
|
_parse(input) {
|
|
18442
18566
|
const parsedType = this._getType(input);
|
|
@@ -18486,8 +18610,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18486
18610
|
});
|
|
18487
18611
|
status.dirty();
|
|
18488
18612
|
}
|
|
18489
|
-
} else if (unknownKeys === "strip")
|
|
18490
|
-
else {
|
|
18613
|
+
} else if (unknownKeys === "strip") {
|
|
18614
|
+
} else {
|
|
18491
18615
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
18492
18616
|
}
|
|
18493
18617
|
} else {
|
|
@@ -18534,11 +18658,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18534
18658
|
unknownKeys: "strict",
|
|
18535
18659
|
...message !== void 0 ? {
|
|
18536
18660
|
errorMap: (issue, ctx) => {
|
|
18537
|
-
|
|
18538
|
-
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
|
|
18661
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
18539
18662
|
if (issue.code === "unrecognized_keys")
|
|
18540
18663
|
return {
|
|
18541
|
-
message:
|
|
18664
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
18542
18665
|
};
|
|
18543
18666
|
return {
|
|
18544
18667
|
message: defaultError
|
|
@@ -18669,11 +18792,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18669
18792
|
}
|
|
18670
18793
|
pick(mask) {
|
|
18671
18794
|
const shape = {};
|
|
18672
|
-
util.objectKeys(mask)
|
|
18795
|
+
for (const key of util.objectKeys(mask)) {
|
|
18673
18796
|
if (mask[key] && this.shape[key]) {
|
|
18674
18797
|
shape[key] = this.shape[key];
|
|
18675
18798
|
}
|
|
18676
|
-
}
|
|
18799
|
+
}
|
|
18677
18800
|
return new _ZodObject({
|
|
18678
18801
|
...this._def,
|
|
18679
18802
|
shape: () => shape
|
|
@@ -18681,11 +18804,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18681
18804
|
}
|
|
18682
18805
|
omit(mask) {
|
|
18683
18806
|
const shape = {};
|
|
18684
|
-
util.objectKeys(this.shape)
|
|
18807
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
18685
18808
|
if (!mask[key]) {
|
|
18686
18809
|
shape[key] = this.shape[key];
|
|
18687
18810
|
}
|
|
18688
|
-
}
|
|
18811
|
+
}
|
|
18689
18812
|
return new _ZodObject({
|
|
18690
18813
|
...this._def,
|
|
18691
18814
|
shape: () => shape
|
|
@@ -18699,14 +18822,14 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18699
18822
|
}
|
|
18700
18823
|
partial(mask) {
|
|
18701
18824
|
const newShape = {};
|
|
18702
|
-
util.objectKeys(this.shape)
|
|
18825
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
18703
18826
|
const fieldSchema = this.shape[key];
|
|
18704
18827
|
if (mask && !mask[key]) {
|
|
18705
18828
|
newShape[key] = fieldSchema;
|
|
18706
18829
|
} else {
|
|
18707
18830
|
newShape[key] = fieldSchema.optional();
|
|
18708
18831
|
}
|
|
18709
|
-
}
|
|
18832
|
+
}
|
|
18710
18833
|
return new _ZodObject({
|
|
18711
18834
|
...this._def,
|
|
18712
18835
|
shape: () => newShape
|
|
@@ -18714,7 +18837,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18714
18837
|
}
|
|
18715
18838
|
required(mask) {
|
|
18716
18839
|
const newShape = {};
|
|
18717
|
-
util.objectKeys(this.shape)
|
|
18840
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
18718
18841
|
if (mask && !mask[key]) {
|
|
18719
18842
|
newShape[key] = this.shape[key];
|
|
18720
18843
|
} else {
|
|
@@ -18725,7 +18848,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
18725
18848
|
}
|
|
18726
18849
|
newShape[key] = newField;
|
|
18727
18850
|
}
|
|
18728
|
-
}
|
|
18851
|
+
}
|
|
18729
18852
|
return new _ZodObject({
|
|
18730
18853
|
...this._def,
|
|
18731
18854
|
shape: () => newShape
|
|
@@ -19341,12 +19464,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
19341
19464
|
return makeIssue({
|
|
19342
19465
|
data: args,
|
|
19343
19466
|
path: ctx.path,
|
|
19344
|
-
errorMaps: [
|
|
19345
|
-
ctx.common.contextualErrorMap,
|
|
19346
|
-
ctx.schemaErrorMap,
|
|
19347
|
-
getErrorMap(),
|
|
19348
|
-
errorMap
|
|
19349
|
-
].filter((x) => !!x),
|
|
19467
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
19350
19468
|
issueData: {
|
|
19351
19469
|
code: ZodIssueCode.invalid_arguments,
|
|
19352
19470
|
argumentsError: error
|
|
@@ -19357,12 +19475,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
19357
19475
|
return makeIssue({
|
|
19358
19476
|
data: returns,
|
|
19359
19477
|
path: ctx.path,
|
|
19360
|
-
errorMaps: [
|
|
19361
|
-
ctx.common.contextualErrorMap,
|
|
19362
|
-
ctx.schemaErrorMap,
|
|
19363
|
-
getErrorMap(),
|
|
19364
|
-
errorMap
|
|
19365
|
-
].filter((x) => !!x),
|
|
19478
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
19366
19479
|
issueData: {
|
|
19367
19480
|
code: ZodIssueCode.invalid_return_type,
|
|
19368
19481
|
returnTypeError: error
|
|
@@ -19741,7 +19854,10 @@ var ZodEffects = class extends ZodType {
|
|
|
19741
19854
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
19742
19855
|
if (!isValid(base))
|
|
19743
19856
|
return base;
|
|
19744
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
19857
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
19858
|
+
status: status.value,
|
|
19859
|
+
value: result
|
|
19860
|
+
}));
|
|
19745
19861
|
});
|
|
19746
19862
|
}
|
|
19747
19863
|
}
|
|
@@ -20001,21 +20117,19 @@ function cleanParams(params, data) {
|
|
|
20001
20117
|
function custom(check, _params = {}, fatal) {
|
|
20002
20118
|
if (check)
|
|
20003
20119
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
20004
|
-
var _a, _b;
|
|
20005
20120
|
const r = check(data);
|
|
20006
20121
|
if (r instanceof Promise) {
|
|
20007
20122
|
return r.then((r2) => {
|
|
20008
|
-
var _a2, _b2;
|
|
20009
20123
|
if (!r2) {
|
|
20010
20124
|
const params = cleanParams(_params, data);
|
|
20011
|
-
const _fatal =
|
|
20125
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
20012
20126
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
20013
20127
|
}
|
|
20014
20128
|
});
|
|
20015
20129
|
}
|
|
20016
20130
|
if (!r) {
|
|
20017
20131
|
const params = cleanParams(_params, data);
|
|
20018
|
-
const _fatal =
|
|
20132
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
20019
20133
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
20020
20134
|
}
|
|
20021
20135
|
return;
|
|
@@ -20115,122 +20229,6 @@ var coerce = {
|
|
|
20115
20229
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
20116
20230
|
};
|
|
20117
20231
|
var NEVER = INVALID;
|
|
20118
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
20119
|
-
__proto__: null,
|
|
20120
|
-
defaultErrorMap: errorMap,
|
|
20121
|
-
setErrorMap,
|
|
20122
|
-
getErrorMap,
|
|
20123
|
-
makeIssue,
|
|
20124
|
-
EMPTY_PATH,
|
|
20125
|
-
addIssueToContext,
|
|
20126
|
-
ParseStatus,
|
|
20127
|
-
INVALID,
|
|
20128
|
-
DIRTY,
|
|
20129
|
-
OK,
|
|
20130
|
-
isAborted,
|
|
20131
|
-
isDirty,
|
|
20132
|
-
isValid,
|
|
20133
|
-
isAsync,
|
|
20134
|
-
get util() {
|
|
20135
|
-
return util;
|
|
20136
|
-
},
|
|
20137
|
-
get objectUtil() {
|
|
20138
|
-
return objectUtil;
|
|
20139
|
-
},
|
|
20140
|
-
ZodParsedType,
|
|
20141
|
-
getParsedType,
|
|
20142
|
-
ZodType,
|
|
20143
|
-
datetimeRegex,
|
|
20144
|
-
ZodString,
|
|
20145
|
-
ZodNumber,
|
|
20146
|
-
ZodBigInt,
|
|
20147
|
-
ZodBoolean,
|
|
20148
|
-
ZodDate,
|
|
20149
|
-
ZodSymbol,
|
|
20150
|
-
ZodUndefined,
|
|
20151
|
-
ZodNull,
|
|
20152
|
-
ZodAny,
|
|
20153
|
-
ZodUnknown,
|
|
20154
|
-
ZodNever,
|
|
20155
|
-
ZodVoid,
|
|
20156
|
-
ZodArray,
|
|
20157
|
-
ZodObject,
|
|
20158
|
-
ZodUnion,
|
|
20159
|
-
ZodDiscriminatedUnion,
|
|
20160
|
-
ZodIntersection,
|
|
20161
|
-
ZodTuple,
|
|
20162
|
-
ZodRecord,
|
|
20163
|
-
ZodMap,
|
|
20164
|
-
ZodSet,
|
|
20165
|
-
ZodFunction,
|
|
20166
|
-
ZodLazy,
|
|
20167
|
-
ZodLiteral,
|
|
20168
|
-
ZodEnum,
|
|
20169
|
-
ZodNativeEnum,
|
|
20170
|
-
ZodPromise,
|
|
20171
|
-
ZodEffects,
|
|
20172
|
-
ZodTransformer: ZodEffects,
|
|
20173
|
-
ZodOptional,
|
|
20174
|
-
ZodNullable,
|
|
20175
|
-
ZodDefault,
|
|
20176
|
-
ZodCatch,
|
|
20177
|
-
ZodNaN,
|
|
20178
|
-
BRAND,
|
|
20179
|
-
ZodBranded,
|
|
20180
|
-
ZodPipeline,
|
|
20181
|
-
ZodReadonly,
|
|
20182
|
-
custom,
|
|
20183
|
-
Schema: ZodType,
|
|
20184
|
-
ZodSchema: ZodType,
|
|
20185
|
-
late,
|
|
20186
|
-
get ZodFirstPartyTypeKind() {
|
|
20187
|
-
return ZodFirstPartyTypeKind;
|
|
20188
|
-
},
|
|
20189
|
-
coerce,
|
|
20190
|
-
any: anyType,
|
|
20191
|
-
array: arrayType,
|
|
20192
|
-
bigint: bigIntType,
|
|
20193
|
-
boolean: booleanType,
|
|
20194
|
-
date: dateType,
|
|
20195
|
-
discriminatedUnion: discriminatedUnionType,
|
|
20196
|
-
effect: effectsType,
|
|
20197
|
-
"enum": enumType,
|
|
20198
|
-
"function": functionType,
|
|
20199
|
-
"instanceof": instanceOfType,
|
|
20200
|
-
intersection: intersectionType,
|
|
20201
|
-
lazy: lazyType,
|
|
20202
|
-
literal: literalType,
|
|
20203
|
-
map: mapType,
|
|
20204
|
-
nan: nanType,
|
|
20205
|
-
nativeEnum: nativeEnumType,
|
|
20206
|
-
never: neverType,
|
|
20207
|
-
"null": nullType,
|
|
20208
|
-
nullable: nullableType,
|
|
20209
|
-
number: numberType,
|
|
20210
|
-
object: objectType,
|
|
20211
|
-
oboolean,
|
|
20212
|
-
onumber,
|
|
20213
|
-
optional: optionalType,
|
|
20214
|
-
ostring,
|
|
20215
|
-
pipeline: pipelineType,
|
|
20216
|
-
preprocess: preprocessType,
|
|
20217
|
-
promise: promiseType,
|
|
20218
|
-
record: recordType,
|
|
20219
|
-
set: setType,
|
|
20220
|
-
strictObject: strictObjectType,
|
|
20221
|
-
string: stringType,
|
|
20222
|
-
symbol: symbolType,
|
|
20223
|
-
transformer: effectsType,
|
|
20224
|
-
tuple: tupleType,
|
|
20225
|
-
"undefined": undefinedType,
|
|
20226
|
-
union: unionType,
|
|
20227
|
-
unknown: unknownType,
|
|
20228
|
-
"void": voidType,
|
|
20229
|
-
NEVER,
|
|
20230
|
-
ZodIssueCode,
|
|
20231
|
-
quotelessJson,
|
|
20232
|
-
ZodError
|
|
20233
|
-
});
|
|
20234
20232
|
|
|
20235
20233
|
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
20236
20234
|
var LATEST_PROTOCOL_VERSION = "2025-03-26";
|
|
@@ -20240,49 +20238,49 @@ var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
|
20240
20238
|
"2024-10-07"
|
|
20241
20239
|
];
|
|
20242
20240
|
var JSONRPC_VERSION = "2.0";
|
|
20243
|
-
var ProgressTokenSchema =
|
|
20244
|
-
var CursorSchema =
|
|
20245
|
-
var RequestMetaSchema =
|
|
20241
|
+
var ProgressTokenSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
|
|
20242
|
+
var CursorSchema = external_exports.string();
|
|
20243
|
+
var RequestMetaSchema = external_exports.object({
|
|
20246
20244
|
/**
|
|
20247
20245
|
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
20248
20246
|
*/
|
|
20249
|
-
progressToken:
|
|
20247
|
+
progressToken: external_exports.optional(ProgressTokenSchema)
|
|
20250
20248
|
}).passthrough();
|
|
20251
|
-
var BaseRequestParamsSchema =
|
|
20252
|
-
_meta:
|
|
20249
|
+
var BaseRequestParamsSchema = external_exports.object({
|
|
20250
|
+
_meta: external_exports.optional(RequestMetaSchema)
|
|
20253
20251
|
}).passthrough();
|
|
20254
|
-
var RequestSchema =
|
|
20255
|
-
method:
|
|
20256
|
-
params:
|
|
20252
|
+
var RequestSchema = external_exports.object({
|
|
20253
|
+
method: external_exports.string(),
|
|
20254
|
+
params: external_exports.optional(BaseRequestParamsSchema)
|
|
20257
20255
|
});
|
|
20258
|
-
var BaseNotificationParamsSchema =
|
|
20256
|
+
var BaseNotificationParamsSchema = external_exports.object({
|
|
20259
20257
|
/**
|
|
20260
20258
|
* This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
|
|
20261
20259
|
*/
|
|
20262
|
-
_meta:
|
|
20260
|
+
_meta: external_exports.optional(external_exports.object({}).passthrough())
|
|
20263
20261
|
}).passthrough();
|
|
20264
|
-
var NotificationSchema =
|
|
20265
|
-
method:
|
|
20266
|
-
params:
|
|
20262
|
+
var NotificationSchema = external_exports.object({
|
|
20263
|
+
method: external_exports.string(),
|
|
20264
|
+
params: external_exports.optional(BaseNotificationParamsSchema)
|
|
20267
20265
|
});
|
|
20268
|
-
var ResultSchema =
|
|
20266
|
+
var ResultSchema = external_exports.object({
|
|
20269
20267
|
/**
|
|
20270
20268
|
* This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
|
|
20271
20269
|
*/
|
|
20272
|
-
_meta:
|
|
20270
|
+
_meta: external_exports.optional(external_exports.object({}).passthrough())
|
|
20273
20271
|
}).passthrough();
|
|
20274
|
-
var RequestIdSchema =
|
|
20275
|
-
var JSONRPCRequestSchema =
|
|
20276
|
-
jsonrpc:
|
|
20272
|
+
var RequestIdSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
|
|
20273
|
+
var JSONRPCRequestSchema = external_exports.object({
|
|
20274
|
+
jsonrpc: external_exports.literal(JSONRPC_VERSION),
|
|
20277
20275
|
id: RequestIdSchema
|
|
20278
20276
|
}).merge(RequestSchema).strict();
|
|
20279
20277
|
var isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
20280
|
-
var JSONRPCNotificationSchema =
|
|
20281
|
-
jsonrpc:
|
|
20278
|
+
var JSONRPCNotificationSchema = external_exports.object({
|
|
20279
|
+
jsonrpc: external_exports.literal(JSONRPC_VERSION)
|
|
20282
20280
|
}).merge(NotificationSchema).strict();
|
|
20283
20281
|
var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
20284
|
-
var JSONRPCResponseSchema =
|
|
20285
|
-
jsonrpc:
|
|
20282
|
+
var JSONRPCResponseSchema = external_exports.object({
|
|
20283
|
+
jsonrpc: external_exports.literal(JSONRPC_VERSION),
|
|
20286
20284
|
id: RequestIdSchema,
|
|
20287
20285
|
result: ResultSchema
|
|
20288
20286
|
}).strict();
|
|
@@ -20297,26 +20295,26 @@ var ErrorCode;
|
|
|
20297
20295
|
ErrorCode2[ErrorCode2["InvalidParams"] = -32602] = "InvalidParams";
|
|
20298
20296
|
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
20299
20297
|
})(ErrorCode || (ErrorCode = {}));
|
|
20300
|
-
var JSONRPCErrorSchema =
|
|
20301
|
-
jsonrpc:
|
|
20298
|
+
var JSONRPCErrorSchema = external_exports.object({
|
|
20299
|
+
jsonrpc: external_exports.literal(JSONRPC_VERSION),
|
|
20302
20300
|
id: RequestIdSchema,
|
|
20303
|
-
error:
|
|
20301
|
+
error: external_exports.object({
|
|
20304
20302
|
/**
|
|
20305
20303
|
* The error type that occurred.
|
|
20306
20304
|
*/
|
|
20307
|
-
code:
|
|
20305
|
+
code: external_exports.number().int(),
|
|
20308
20306
|
/**
|
|
20309
20307
|
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
20310
20308
|
*/
|
|
20311
|
-
message:
|
|
20309
|
+
message: external_exports.string(),
|
|
20312
20310
|
/**
|
|
20313
20311
|
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
20314
20312
|
*/
|
|
20315
|
-
data:
|
|
20313
|
+
data: external_exports.optional(external_exports.unknown())
|
|
20316
20314
|
})
|
|
20317
20315
|
}).strict();
|
|
20318
20316
|
var isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
|
|
20319
|
-
var JSONRPCMessageSchema =
|
|
20317
|
+
var JSONRPCMessageSchema = external_exports.union([
|
|
20320
20318
|
JSONRPCRequestSchema,
|
|
20321
20319
|
JSONRPCNotificationSchema,
|
|
20322
20320
|
JSONRPCResponseSchema,
|
|
@@ -20324,7 +20322,7 @@ var JSONRPCMessageSchema = z.union([
|
|
|
20324
20322
|
]);
|
|
20325
20323
|
var EmptyResultSchema = ResultSchema.strict();
|
|
20326
20324
|
var CancelledNotificationSchema = NotificationSchema.extend({
|
|
20327
|
-
method:
|
|
20325
|
+
method: external_exports.literal("notifications/cancelled"),
|
|
20328
20326
|
params: BaseNotificationParamsSchema.extend({
|
|
20329
20327
|
/**
|
|
20330
20328
|
* The ID of the request to cancel.
|
|
@@ -20335,93 +20333,93 @@ var CancelledNotificationSchema = NotificationSchema.extend({
|
|
|
20335
20333
|
/**
|
|
20336
20334
|
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
20337
20335
|
*/
|
|
20338
|
-
reason:
|
|
20336
|
+
reason: external_exports.string().optional()
|
|
20339
20337
|
})
|
|
20340
20338
|
});
|
|
20341
|
-
var ImplementationSchema =
|
|
20342
|
-
name:
|
|
20343
|
-
version:
|
|
20339
|
+
var ImplementationSchema = external_exports.object({
|
|
20340
|
+
name: external_exports.string(),
|
|
20341
|
+
version: external_exports.string()
|
|
20344
20342
|
}).passthrough();
|
|
20345
|
-
var ClientCapabilitiesSchema =
|
|
20343
|
+
var ClientCapabilitiesSchema = external_exports.object({
|
|
20346
20344
|
/**
|
|
20347
20345
|
* Experimental, non-standard capabilities that the client supports.
|
|
20348
20346
|
*/
|
|
20349
|
-
experimental:
|
|
20347
|
+
experimental: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20350
20348
|
/**
|
|
20351
20349
|
* Present if the client supports sampling from an LLM.
|
|
20352
20350
|
*/
|
|
20353
|
-
sampling:
|
|
20351
|
+
sampling: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20354
20352
|
/**
|
|
20355
20353
|
* Present if the client supports listing roots.
|
|
20356
20354
|
*/
|
|
20357
|
-
roots:
|
|
20355
|
+
roots: external_exports.optional(external_exports.object({
|
|
20358
20356
|
/**
|
|
20359
20357
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
20360
20358
|
*/
|
|
20361
|
-
listChanged:
|
|
20359
|
+
listChanged: external_exports.optional(external_exports.boolean())
|
|
20362
20360
|
}).passthrough())
|
|
20363
20361
|
}).passthrough();
|
|
20364
20362
|
var InitializeRequestSchema = RequestSchema.extend({
|
|
20365
|
-
method:
|
|
20363
|
+
method: external_exports.literal("initialize"),
|
|
20366
20364
|
params: BaseRequestParamsSchema.extend({
|
|
20367
20365
|
/**
|
|
20368
20366
|
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
20369
20367
|
*/
|
|
20370
|
-
protocolVersion:
|
|
20368
|
+
protocolVersion: external_exports.string(),
|
|
20371
20369
|
capabilities: ClientCapabilitiesSchema,
|
|
20372
20370
|
clientInfo: ImplementationSchema
|
|
20373
20371
|
})
|
|
20374
20372
|
});
|
|
20375
|
-
var ServerCapabilitiesSchema =
|
|
20373
|
+
var ServerCapabilitiesSchema = external_exports.object({
|
|
20376
20374
|
/**
|
|
20377
20375
|
* Experimental, non-standard capabilities that the server supports.
|
|
20378
20376
|
*/
|
|
20379
|
-
experimental:
|
|
20377
|
+
experimental: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20380
20378
|
/**
|
|
20381
20379
|
* Present if the server supports sending log messages to the client.
|
|
20382
20380
|
*/
|
|
20383
|
-
logging:
|
|
20381
|
+
logging: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20384
20382
|
/**
|
|
20385
20383
|
* Present if the server supports sending completions to the client.
|
|
20386
20384
|
*/
|
|
20387
|
-
completions:
|
|
20385
|
+
completions: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20388
20386
|
/**
|
|
20389
20387
|
* Present if the server offers any prompt templates.
|
|
20390
20388
|
*/
|
|
20391
|
-
prompts:
|
|
20389
|
+
prompts: external_exports.optional(external_exports.object({
|
|
20392
20390
|
/**
|
|
20393
20391
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
20394
20392
|
*/
|
|
20395
|
-
listChanged:
|
|
20393
|
+
listChanged: external_exports.optional(external_exports.boolean())
|
|
20396
20394
|
}).passthrough()),
|
|
20397
20395
|
/**
|
|
20398
20396
|
* Present if the server offers any resources to read.
|
|
20399
20397
|
*/
|
|
20400
|
-
resources:
|
|
20398
|
+
resources: external_exports.optional(external_exports.object({
|
|
20401
20399
|
/**
|
|
20402
20400
|
* Whether this server supports clients subscribing to resource updates.
|
|
20403
20401
|
*/
|
|
20404
|
-
subscribe:
|
|
20402
|
+
subscribe: external_exports.optional(external_exports.boolean()),
|
|
20405
20403
|
/**
|
|
20406
20404
|
* Whether this server supports issuing notifications for changes to the resource list.
|
|
20407
20405
|
*/
|
|
20408
|
-
listChanged:
|
|
20406
|
+
listChanged: external_exports.optional(external_exports.boolean())
|
|
20409
20407
|
}).passthrough()),
|
|
20410
20408
|
/**
|
|
20411
20409
|
* Present if the server offers any tools to call.
|
|
20412
20410
|
*/
|
|
20413
|
-
tools:
|
|
20411
|
+
tools: external_exports.optional(external_exports.object({
|
|
20414
20412
|
/**
|
|
20415
20413
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
20416
20414
|
*/
|
|
20417
|
-
listChanged:
|
|
20415
|
+
listChanged: external_exports.optional(external_exports.boolean())
|
|
20418
20416
|
}).passthrough())
|
|
20419
20417
|
}).passthrough();
|
|
20420
20418
|
var InitializeResultSchema = ResultSchema.extend({
|
|
20421
20419
|
/**
|
|
20422
20420
|
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
|
20423
20421
|
*/
|
|
20424
|
-
protocolVersion:
|
|
20422
|
+
protocolVersion: external_exports.string(),
|
|
20425
20423
|
capabilities: ServerCapabilitiesSchema,
|
|
20426
20424
|
serverInfo: ImplementationSchema,
|
|
20427
20425
|
/**
|
|
@@ -20429,26 +20427,30 @@ var InitializeResultSchema = ResultSchema.extend({
|
|
|
20429
20427
|
*
|
|
20430
20428
|
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
|
20431
20429
|
*/
|
|
20432
|
-
instructions:
|
|
20430
|
+
instructions: external_exports.optional(external_exports.string())
|
|
20433
20431
|
});
|
|
20434
20432
|
var InitializedNotificationSchema = NotificationSchema.extend({
|
|
20435
|
-
method:
|
|
20433
|
+
method: external_exports.literal("notifications/initialized")
|
|
20436
20434
|
});
|
|
20437
20435
|
var PingRequestSchema = RequestSchema.extend({
|
|
20438
|
-
method:
|
|
20436
|
+
method: external_exports.literal("ping")
|
|
20439
20437
|
});
|
|
20440
|
-
var ProgressSchema =
|
|
20438
|
+
var ProgressSchema = external_exports.object({
|
|
20441
20439
|
/**
|
|
20442
20440
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
20443
20441
|
*/
|
|
20444
|
-
progress:
|
|
20442
|
+
progress: external_exports.number(),
|
|
20445
20443
|
/**
|
|
20446
20444
|
* Total number of items to process (or total progress required), if known.
|
|
20447
20445
|
*/
|
|
20448
|
-
total:
|
|
20446
|
+
total: external_exports.optional(external_exports.number()),
|
|
20447
|
+
/**
|
|
20448
|
+
* An optional message describing the current progress.
|
|
20449
|
+
*/
|
|
20450
|
+
message: external_exports.optional(external_exports.string())
|
|
20449
20451
|
}).passthrough();
|
|
20450
20452
|
var ProgressNotificationSchema = NotificationSchema.extend({
|
|
20451
|
-
method:
|
|
20453
|
+
method: external_exports.literal("notifications/progress"),
|
|
20452
20454
|
params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
|
|
20453
20455
|
/**
|
|
20454
20456
|
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
|
@@ -20462,7 +20464,7 @@ var PaginatedRequestSchema = RequestSchema.extend({
|
|
|
20462
20464
|
* An opaque token representing the current pagination position.
|
|
20463
20465
|
* If provided, the server should return results starting after this cursor.
|
|
20464
20466
|
*/
|
|
20465
|
-
cursor:
|
|
20467
|
+
cursor: external_exports.optional(CursorSchema)
|
|
20466
20468
|
}).optional()
|
|
20467
20469
|
});
|
|
20468
20470
|
var PaginatedResultSchema = ResultSchema.extend({
|
|
@@ -20470,211 +20472,211 @@ var PaginatedResultSchema = ResultSchema.extend({
|
|
|
20470
20472
|
* An opaque token representing the pagination position after the last returned result.
|
|
20471
20473
|
* If present, there may be more results available.
|
|
20472
20474
|
*/
|
|
20473
|
-
nextCursor:
|
|
20475
|
+
nextCursor: external_exports.optional(CursorSchema)
|
|
20474
20476
|
});
|
|
20475
|
-
var ResourceContentsSchema =
|
|
20477
|
+
var ResourceContentsSchema = external_exports.object({
|
|
20476
20478
|
/**
|
|
20477
20479
|
* The URI of this resource.
|
|
20478
20480
|
*/
|
|
20479
|
-
uri:
|
|
20481
|
+
uri: external_exports.string(),
|
|
20480
20482
|
/**
|
|
20481
20483
|
* The MIME type of this resource, if known.
|
|
20482
20484
|
*/
|
|
20483
|
-
mimeType:
|
|
20485
|
+
mimeType: external_exports.optional(external_exports.string())
|
|
20484
20486
|
}).passthrough();
|
|
20485
20487
|
var TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
20486
20488
|
/**
|
|
20487
20489
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
20488
20490
|
*/
|
|
20489
|
-
text:
|
|
20491
|
+
text: external_exports.string()
|
|
20490
20492
|
});
|
|
20491
20493
|
var BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
20492
20494
|
/**
|
|
20493
20495
|
* A base64-encoded string representing the binary data of the item.
|
|
20494
20496
|
*/
|
|
20495
|
-
blob:
|
|
20497
|
+
blob: external_exports.string().base64()
|
|
20496
20498
|
});
|
|
20497
|
-
var ResourceSchema =
|
|
20499
|
+
var ResourceSchema = external_exports.object({
|
|
20498
20500
|
/**
|
|
20499
20501
|
* The URI of this resource.
|
|
20500
20502
|
*/
|
|
20501
|
-
uri:
|
|
20503
|
+
uri: external_exports.string(),
|
|
20502
20504
|
/**
|
|
20503
20505
|
* A human-readable name for this resource.
|
|
20504
20506
|
*
|
|
20505
20507
|
* This can be used by clients to populate UI elements.
|
|
20506
20508
|
*/
|
|
20507
|
-
name:
|
|
20509
|
+
name: external_exports.string(),
|
|
20508
20510
|
/**
|
|
20509
20511
|
* A description of what this resource represents.
|
|
20510
20512
|
*
|
|
20511
20513
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
20512
20514
|
*/
|
|
20513
|
-
description:
|
|
20515
|
+
description: external_exports.optional(external_exports.string()),
|
|
20514
20516
|
/**
|
|
20515
20517
|
* The MIME type of this resource, if known.
|
|
20516
20518
|
*/
|
|
20517
|
-
mimeType:
|
|
20519
|
+
mimeType: external_exports.optional(external_exports.string())
|
|
20518
20520
|
}).passthrough();
|
|
20519
|
-
var ResourceTemplateSchema =
|
|
20521
|
+
var ResourceTemplateSchema = external_exports.object({
|
|
20520
20522
|
/**
|
|
20521
20523
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
20522
20524
|
*/
|
|
20523
|
-
uriTemplate:
|
|
20525
|
+
uriTemplate: external_exports.string(),
|
|
20524
20526
|
/**
|
|
20525
20527
|
* A human-readable name for the type of resource this template refers to.
|
|
20526
20528
|
*
|
|
20527
20529
|
* This can be used by clients to populate UI elements.
|
|
20528
20530
|
*/
|
|
20529
|
-
name:
|
|
20531
|
+
name: external_exports.string(),
|
|
20530
20532
|
/**
|
|
20531
20533
|
* A description of what this template is for.
|
|
20532
20534
|
*
|
|
20533
20535
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
20534
20536
|
*/
|
|
20535
|
-
description:
|
|
20537
|
+
description: external_exports.optional(external_exports.string()),
|
|
20536
20538
|
/**
|
|
20537
20539
|
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
|
20538
20540
|
*/
|
|
20539
|
-
mimeType:
|
|
20541
|
+
mimeType: external_exports.optional(external_exports.string())
|
|
20540
20542
|
}).passthrough();
|
|
20541
20543
|
var ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
20542
|
-
method:
|
|
20544
|
+
method: external_exports.literal("resources/list")
|
|
20543
20545
|
});
|
|
20544
20546
|
var ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
20545
|
-
resources:
|
|
20547
|
+
resources: external_exports.array(ResourceSchema)
|
|
20546
20548
|
});
|
|
20547
20549
|
var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
20548
|
-
method:
|
|
20550
|
+
method: external_exports.literal("resources/templates/list")
|
|
20549
20551
|
});
|
|
20550
20552
|
var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
20551
|
-
resourceTemplates:
|
|
20553
|
+
resourceTemplates: external_exports.array(ResourceTemplateSchema)
|
|
20552
20554
|
});
|
|
20553
20555
|
var ReadResourceRequestSchema = RequestSchema.extend({
|
|
20554
|
-
method:
|
|
20556
|
+
method: external_exports.literal("resources/read"),
|
|
20555
20557
|
params: BaseRequestParamsSchema.extend({
|
|
20556
20558
|
/**
|
|
20557
20559
|
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
|
20558
20560
|
*/
|
|
20559
|
-
uri:
|
|
20561
|
+
uri: external_exports.string()
|
|
20560
20562
|
})
|
|
20561
20563
|
});
|
|
20562
20564
|
var ReadResourceResultSchema = ResultSchema.extend({
|
|
20563
|
-
contents:
|
|
20565
|
+
contents: external_exports.array(external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
20564
20566
|
});
|
|
20565
20567
|
var ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
20566
|
-
method:
|
|
20568
|
+
method: external_exports.literal("notifications/resources/list_changed")
|
|
20567
20569
|
});
|
|
20568
20570
|
var SubscribeRequestSchema = RequestSchema.extend({
|
|
20569
|
-
method:
|
|
20571
|
+
method: external_exports.literal("resources/subscribe"),
|
|
20570
20572
|
params: BaseRequestParamsSchema.extend({
|
|
20571
20573
|
/**
|
|
20572
20574
|
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
|
20573
20575
|
*/
|
|
20574
|
-
uri:
|
|
20576
|
+
uri: external_exports.string()
|
|
20575
20577
|
})
|
|
20576
20578
|
});
|
|
20577
20579
|
var UnsubscribeRequestSchema = RequestSchema.extend({
|
|
20578
|
-
method:
|
|
20580
|
+
method: external_exports.literal("resources/unsubscribe"),
|
|
20579
20581
|
params: BaseRequestParamsSchema.extend({
|
|
20580
20582
|
/**
|
|
20581
20583
|
* The URI of the resource to unsubscribe from.
|
|
20582
20584
|
*/
|
|
20583
|
-
uri:
|
|
20585
|
+
uri: external_exports.string()
|
|
20584
20586
|
})
|
|
20585
20587
|
});
|
|
20586
20588
|
var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
20587
|
-
method:
|
|
20589
|
+
method: external_exports.literal("notifications/resources/updated"),
|
|
20588
20590
|
params: BaseNotificationParamsSchema.extend({
|
|
20589
20591
|
/**
|
|
20590
20592
|
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
20591
20593
|
*/
|
|
20592
|
-
uri:
|
|
20594
|
+
uri: external_exports.string()
|
|
20593
20595
|
})
|
|
20594
20596
|
});
|
|
20595
|
-
var PromptArgumentSchema =
|
|
20597
|
+
var PromptArgumentSchema = external_exports.object({
|
|
20596
20598
|
/**
|
|
20597
20599
|
* The name of the argument.
|
|
20598
20600
|
*/
|
|
20599
|
-
name:
|
|
20601
|
+
name: external_exports.string(),
|
|
20600
20602
|
/**
|
|
20601
20603
|
* A human-readable description of the argument.
|
|
20602
20604
|
*/
|
|
20603
|
-
description:
|
|
20605
|
+
description: external_exports.optional(external_exports.string()),
|
|
20604
20606
|
/**
|
|
20605
20607
|
* Whether this argument must be provided.
|
|
20606
20608
|
*/
|
|
20607
|
-
required:
|
|
20609
|
+
required: external_exports.optional(external_exports.boolean())
|
|
20608
20610
|
}).passthrough();
|
|
20609
|
-
var PromptSchema =
|
|
20611
|
+
var PromptSchema = external_exports.object({
|
|
20610
20612
|
/**
|
|
20611
20613
|
* The name of the prompt or prompt template.
|
|
20612
20614
|
*/
|
|
20613
|
-
name:
|
|
20615
|
+
name: external_exports.string(),
|
|
20614
20616
|
/**
|
|
20615
20617
|
* An optional description of what this prompt provides
|
|
20616
20618
|
*/
|
|
20617
|
-
description:
|
|
20619
|
+
description: external_exports.optional(external_exports.string()),
|
|
20618
20620
|
/**
|
|
20619
20621
|
* A list of arguments to use for templating the prompt.
|
|
20620
20622
|
*/
|
|
20621
|
-
arguments:
|
|
20623
|
+
arguments: external_exports.optional(external_exports.array(PromptArgumentSchema))
|
|
20622
20624
|
}).passthrough();
|
|
20623
20625
|
var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
20624
|
-
method:
|
|
20626
|
+
method: external_exports.literal("prompts/list")
|
|
20625
20627
|
});
|
|
20626
20628
|
var ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
20627
|
-
prompts:
|
|
20629
|
+
prompts: external_exports.array(PromptSchema)
|
|
20628
20630
|
});
|
|
20629
20631
|
var GetPromptRequestSchema = RequestSchema.extend({
|
|
20630
|
-
method:
|
|
20632
|
+
method: external_exports.literal("prompts/get"),
|
|
20631
20633
|
params: BaseRequestParamsSchema.extend({
|
|
20632
20634
|
/**
|
|
20633
20635
|
* The name of the prompt or prompt template.
|
|
20634
20636
|
*/
|
|
20635
|
-
name:
|
|
20637
|
+
name: external_exports.string(),
|
|
20636
20638
|
/**
|
|
20637
20639
|
* Arguments to use for templating the prompt.
|
|
20638
20640
|
*/
|
|
20639
|
-
arguments:
|
|
20641
|
+
arguments: external_exports.optional(external_exports.record(external_exports.string()))
|
|
20640
20642
|
})
|
|
20641
20643
|
});
|
|
20642
|
-
var TextContentSchema =
|
|
20643
|
-
type:
|
|
20644
|
+
var TextContentSchema = external_exports.object({
|
|
20645
|
+
type: external_exports.literal("text"),
|
|
20644
20646
|
/**
|
|
20645
20647
|
* The text content of the message.
|
|
20646
20648
|
*/
|
|
20647
|
-
text:
|
|
20649
|
+
text: external_exports.string()
|
|
20648
20650
|
}).passthrough();
|
|
20649
|
-
var ImageContentSchema =
|
|
20650
|
-
type:
|
|
20651
|
+
var ImageContentSchema = external_exports.object({
|
|
20652
|
+
type: external_exports.literal("image"),
|
|
20651
20653
|
/**
|
|
20652
20654
|
* The base64-encoded image data.
|
|
20653
20655
|
*/
|
|
20654
|
-
data:
|
|
20656
|
+
data: external_exports.string().base64(),
|
|
20655
20657
|
/**
|
|
20656
20658
|
* The MIME type of the image. Different providers may support different image types.
|
|
20657
20659
|
*/
|
|
20658
|
-
mimeType:
|
|
20660
|
+
mimeType: external_exports.string()
|
|
20659
20661
|
}).passthrough();
|
|
20660
|
-
var AudioContentSchema =
|
|
20661
|
-
type:
|
|
20662
|
+
var AudioContentSchema = external_exports.object({
|
|
20663
|
+
type: external_exports.literal("audio"),
|
|
20662
20664
|
/**
|
|
20663
20665
|
* The base64-encoded audio data.
|
|
20664
20666
|
*/
|
|
20665
|
-
data:
|
|
20667
|
+
data: external_exports.string().base64(),
|
|
20666
20668
|
/**
|
|
20667
20669
|
* The MIME type of the audio. Different providers may support different audio types.
|
|
20668
20670
|
*/
|
|
20669
|
-
mimeType:
|
|
20671
|
+
mimeType: external_exports.string()
|
|
20670
20672
|
}).passthrough();
|
|
20671
|
-
var EmbeddedResourceSchema =
|
|
20672
|
-
type:
|
|
20673
|
-
resource:
|
|
20673
|
+
var EmbeddedResourceSchema = external_exports.object({
|
|
20674
|
+
type: external_exports.literal("resource"),
|
|
20675
|
+
resource: external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema])
|
|
20674
20676
|
}).passthrough();
|
|
20675
|
-
var PromptMessageSchema =
|
|
20676
|
-
role:
|
|
20677
|
-
content:
|
|
20677
|
+
var PromptMessageSchema = external_exports.object({
|
|
20678
|
+
role: external_exports.enum(["user", "assistant"]),
|
|
20679
|
+
content: external_exports.union([
|
|
20678
20680
|
TextContentSchema,
|
|
20679
20681
|
ImageContentSchema,
|
|
20680
20682
|
AudioContentSchema,
|
|
@@ -20685,23 +20687,23 @@ var GetPromptResultSchema = ResultSchema.extend({
|
|
|
20685
20687
|
/**
|
|
20686
20688
|
* An optional description for the prompt.
|
|
20687
20689
|
*/
|
|
20688
|
-
description:
|
|
20689
|
-
messages:
|
|
20690
|
+
description: external_exports.optional(external_exports.string()),
|
|
20691
|
+
messages: external_exports.array(PromptMessageSchema)
|
|
20690
20692
|
});
|
|
20691
20693
|
var PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
20692
|
-
method:
|
|
20694
|
+
method: external_exports.literal("notifications/prompts/list_changed")
|
|
20693
20695
|
});
|
|
20694
|
-
var ToolAnnotationsSchema =
|
|
20696
|
+
var ToolAnnotationsSchema = external_exports.object({
|
|
20695
20697
|
/**
|
|
20696
20698
|
* A human-readable title for the tool.
|
|
20697
20699
|
*/
|
|
20698
|
-
title:
|
|
20700
|
+
title: external_exports.optional(external_exports.string()),
|
|
20699
20701
|
/**
|
|
20700
20702
|
* If true, the tool does not modify its environment.
|
|
20701
20703
|
*
|
|
20702
20704
|
* Default: false
|
|
20703
20705
|
*/
|
|
20704
|
-
readOnlyHint:
|
|
20706
|
+
readOnlyHint: external_exports.optional(external_exports.boolean()),
|
|
20705
20707
|
/**
|
|
20706
20708
|
* If true, the tool may perform destructive updates to its environment.
|
|
20707
20709
|
* If false, the tool performs only additive updates.
|
|
@@ -20710,7 +20712,7 @@ var ToolAnnotationsSchema = z.object({
|
|
|
20710
20712
|
*
|
|
20711
20713
|
* Default: true
|
|
20712
20714
|
*/
|
|
20713
|
-
destructiveHint:
|
|
20715
|
+
destructiveHint: external_exports.optional(external_exports.boolean()),
|
|
20714
20716
|
/**
|
|
20715
20717
|
* If true, calling the tool repeatedly with the same arguments
|
|
20716
20718
|
* will have no additional effect on the its environment.
|
|
@@ -20719,7 +20721,7 @@ var ToolAnnotationsSchema = z.object({
|
|
|
20719
20721
|
*
|
|
20720
20722
|
* Default: false
|
|
20721
20723
|
*/
|
|
20722
|
-
idempotentHint:
|
|
20724
|
+
idempotentHint: external_exports.optional(external_exports.boolean()),
|
|
20723
20725
|
/**
|
|
20724
20726
|
* If true, this tool may interact with an "open world" of external
|
|
20725
20727
|
* entities. If false, the tool's domain of interaction is closed.
|
|
@@ -20728,53 +20730,94 @@ var ToolAnnotationsSchema = z.object({
|
|
|
20728
20730
|
*
|
|
20729
20731
|
* Default: true
|
|
20730
20732
|
*/
|
|
20731
|
-
openWorldHint:
|
|
20733
|
+
openWorldHint: external_exports.optional(external_exports.boolean())
|
|
20732
20734
|
}).passthrough();
|
|
20733
|
-
var ToolSchema =
|
|
20735
|
+
var ToolSchema = external_exports.object({
|
|
20734
20736
|
/**
|
|
20735
20737
|
* The name of the tool.
|
|
20736
20738
|
*/
|
|
20737
|
-
name:
|
|
20739
|
+
name: external_exports.string(),
|
|
20738
20740
|
/**
|
|
20739
20741
|
* A human-readable description of the tool.
|
|
20740
20742
|
*/
|
|
20741
|
-
description:
|
|
20743
|
+
description: external_exports.optional(external_exports.string()),
|
|
20742
20744
|
/**
|
|
20743
20745
|
* A JSON Schema object defining the expected parameters for the tool.
|
|
20744
20746
|
*/
|
|
20745
|
-
inputSchema:
|
|
20746
|
-
type:
|
|
20747
|
-
properties:
|
|
20747
|
+
inputSchema: external_exports.object({
|
|
20748
|
+
type: external_exports.literal("object"),
|
|
20749
|
+
properties: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20750
|
+
required: external_exports.optional(external_exports.array(external_exports.string()))
|
|
20748
20751
|
}).passthrough(),
|
|
20752
|
+
/**
|
|
20753
|
+
* An optional JSON Schema object defining the structure of the tool's output returned in
|
|
20754
|
+
* the structuredContent field of a CallToolResult.
|
|
20755
|
+
*/
|
|
20756
|
+
outputSchema: external_exports.optional(external_exports.object({
|
|
20757
|
+
type: external_exports.literal("object"),
|
|
20758
|
+
properties: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20759
|
+
required: external_exports.optional(external_exports.array(external_exports.string()))
|
|
20760
|
+
}).passthrough()),
|
|
20749
20761
|
/**
|
|
20750
20762
|
* Optional additional tool information.
|
|
20751
20763
|
*/
|
|
20752
|
-
annotations:
|
|
20764
|
+
annotations: external_exports.optional(ToolAnnotationsSchema)
|
|
20753
20765
|
}).passthrough();
|
|
20754
20766
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
20755
|
-
method:
|
|
20767
|
+
method: external_exports.literal("tools/list")
|
|
20756
20768
|
});
|
|
20757
20769
|
var ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
20758
|
-
tools:
|
|
20770
|
+
tools: external_exports.array(ToolSchema)
|
|
20759
20771
|
});
|
|
20760
20772
|
var CallToolResultSchema = ResultSchema.extend({
|
|
20761
|
-
|
|
20762
|
-
|
|
20773
|
+
/**
|
|
20774
|
+
* A list of content objects that represent the result of the tool call.
|
|
20775
|
+
*
|
|
20776
|
+
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
20777
|
+
* For backwards compatibility, this field is always present, but it may be empty.
|
|
20778
|
+
*/
|
|
20779
|
+
content: external_exports.array(external_exports.union([
|
|
20780
|
+
TextContentSchema,
|
|
20781
|
+
ImageContentSchema,
|
|
20782
|
+
AudioContentSchema,
|
|
20783
|
+
EmbeddedResourceSchema
|
|
20784
|
+
])).default([]),
|
|
20785
|
+
/**
|
|
20786
|
+
* An object containing structured tool output.
|
|
20787
|
+
*
|
|
20788
|
+
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
20789
|
+
*/
|
|
20790
|
+
structuredContent: external_exports.object({}).passthrough().optional(),
|
|
20791
|
+
/**
|
|
20792
|
+
* Whether the tool call ended in an error.
|
|
20793
|
+
*
|
|
20794
|
+
* If not set, this is assumed to be false (the call was successful).
|
|
20795
|
+
*
|
|
20796
|
+
* Any errors that originate from the tool SHOULD be reported inside the result
|
|
20797
|
+
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
|
20798
|
+
* response. Otherwise, the LLM would not be able to see that an error occurred
|
|
20799
|
+
* and self-correct.
|
|
20800
|
+
*
|
|
20801
|
+
* However, any errors in _finding_ the tool, an error indicating that the
|
|
20802
|
+
* server does not support tool calls, or any other exceptional conditions,
|
|
20803
|
+
* should be reported as an MCP error response.
|
|
20804
|
+
*/
|
|
20805
|
+
isError: external_exports.optional(external_exports.boolean())
|
|
20763
20806
|
});
|
|
20764
20807
|
var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
20765
|
-
toolResult:
|
|
20808
|
+
toolResult: external_exports.unknown()
|
|
20766
20809
|
}));
|
|
20767
20810
|
var CallToolRequestSchema = RequestSchema.extend({
|
|
20768
|
-
method:
|
|
20811
|
+
method: external_exports.literal("tools/call"),
|
|
20769
20812
|
params: BaseRequestParamsSchema.extend({
|
|
20770
|
-
name:
|
|
20771
|
-
arguments:
|
|
20813
|
+
name: external_exports.string(),
|
|
20814
|
+
arguments: external_exports.optional(external_exports.record(external_exports.unknown()))
|
|
20772
20815
|
})
|
|
20773
20816
|
});
|
|
20774
20817
|
var ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
20775
|
-
method:
|
|
20818
|
+
method: external_exports.literal("notifications/tools/list_changed")
|
|
20776
20819
|
});
|
|
20777
|
-
var LoggingLevelSchema =
|
|
20820
|
+
var LoggingLevelSchema = external_exports.enum([
|
|
20778
20821
|
"debug",
|
|
20779
20822
|
"info",
|
|
20780
20823
|
"notice",
|
|
@@ -20785,7 +20828,7 @@ var LoggingLevelSchema = z.enum([
|
|
|
20785
20828
|
"emergency"
|
|
20786
20829
|
]);
|
|
20787
20830
|
var SetLevelRequestSchema = RequestSchema.extend({
|
|
20788
|
-
method:
|
|
20831
|
+
method: external_exports.literal("logging/setLevel"),
|
|
20789
20832
|
params: BaseRequestParamsSchema.extend({
|
|
20790
20833
|
/**
|
|
20791
20834
|
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
|
@@ -20794,7 +20837,7 @@ var SetLevelRequestSchema = RequestSchema.extend({
|
|
|
20794
20837
|
})
|
|
20795
20838
|
});
|
|
20796
20839
|
var LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
20797
|
-
method:
|
|
20840
|
+
method: external_exports.literal("notifications/message"),
|
|
20798
20841
|
params: BaseNotificationParamsSchema.extend({
|
|
20799
20842
|
/**
|
|
20800
20843
|
* The severity of this log message.
|
|
@@ -20803,154 +20846,154 @@ var LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
|
20803
20846
|
/**
|
|
20804
20847
|
* An optional name of the logger issuing this message.
|
|
20805
20848
|
*/
|
|
20806
|
-
logger:
|
|
20849
|
+
logger: external_exports.optional(external_exports.string()),
|
|
20807
20850
|
/**
|
|
20808
20851
|
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
20809
20852
|
*/
|
|
20810
|
-
data:
|
|
20853
|
+
data: external_exports.unknown()
|
|
20811
20854
|
})
|
|
20812
20855
|
});
|
|
20813
|
-
var ModelHintSchema =
|
|
20856
|
+
var ModelHintSchema = external_exports.object({
|
|
20814
20857
|
/**
|
|
20815
20858
|
* A hint for a model name.
|
|
20816
20859
|
*/
|
|
20817
|
-
name:
|
|
20860
|
+
name: external_exports.string().optional()
|
|
20818
20861
|
}).passthrough();
|
|
20819
|
-
var ModelPreferencesSchema =
|
|
20862
|
+
var ModelPreferencesSchema = external_exports.object({
|
|
20820
20863
|
/**
|
|
20821
20864
|
* Optional hints to use for model selection.
|
|
20822
20865
|
*/
|
|
20823
|
-
hints:
|
|
20866
|
+
hints: external_exports.optional(external_exports.array(ModelHintSchema)),
|
|
20824
20867
|
/**
|
|
20825
20868
|
* How much to prioritize cost when selecting a model.
|
|
20826
20869
|
*/
|
|
20827
|
-
costPriority:
|
|
20870
|
+
costPriority: external_exports.optional(external_exports.number().min(0).max(1)),
|
|
20828
20871
|
/**
|
|
20829
20872
|
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
20830
20873
|
*/
|
|
20831
|
-
speedPriority:
|
|
20874
|
+
speedPriority: external_exports.optional(external_exports.number().min(0).max(1)),
|
|
20832
20875
|
/**
|
|
20833
20876
|
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
20834
20877
|
*/
|
|
20835
|
-
intelligencePriority:
|
|
20878
|
+
intelligencePriority: external_exports.optional(external_exports.number().min(0).max(1))
|
|
20836
20879
|
}).passthrough();
|
|
20837
|
-
var SamplingMessageSchema =
|
|
20838
|
-
role:
|
|
20839
|
-
content:
|
|
20880
|
+
var SamplingMessageSchema = external_exports.object({
|
|
20881
|
+
role: external_exports.enum(["user", "assistant"]),
|
|
20882
|
+
content: external_exports.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
|
|
20840
20883
|
}).passthrough();
|
|
20841
20884
|
var CreateMessageRequestSchema = RequestSchema.extend({
|
|
20842
|
-
method:
|
|
20885
|
+
method: external_exports.literal("sampling/createMessage"),
|
|
20843
20886
|
params: BaseRequestParamsSchema.extend({
|
|
20844
|
-
messages:
|
|
20887
|
+
messages: external_exports.array(SamplingMessageSchema),
|
|
20845
20888
|
/**
|
|
20846
20889
|
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
20847
20890
|
*/
|
|
20848
|
-
systemPrompt:
|
|
20891
|
+
systemPrompt: external_exports.optional(external_exports.string()),
|
|
20849
20892
|
/**
|
|
20850
20893
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
|
|
20851
20894
|
*/
|
|
20852
|
-
includeContext:
|
|
20853
|
-
temperature:
|
|
20895
|
+
includeContext: external_exports.optional(external_exports.enum(["none", "thisServer", "allServers"])),
|
|
20896
|
+
temperature: external_exports.optional(external_exports.number()),
|
|
20854
20897
|
/**
|
|
20855
20898
|
* The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
|
|
20856
20899
|
*/
|
|
20857
|
-
maxTokens:
|
|
20858
|
-
stopSequences:
|
|
20900
|
+
maxTokens: external_exports.number().int(),
|
|
20901
|
+
stopSequences: external_exports.optional(external_exports.array(external_exports.string())),
|
|
20859
20902
|
/**
|
|
20860
20903
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
20861
20904
|
*/
|
|
20862
|
-
metadata:
|
|
20905
|
+
metadata: external_exports.optional(external_exports.object({}).passthrough()),
|
|
20863
20906
|
/**
|
|
20864
20907
|
* The server's preferences for which model to select.
|
|
20865
20908
|
*/
|
|
20866
|
-
modelPreferences:
|
|
20909
|
+
modelPreferences: external_exports.optional(ModelPreferencesSchema)
|
|
20867
20910
|
})
|
|
20868
20911
|
});
|
|
20869
20912
|
var CreateMessageResultSchema = ResultSchema.extend({
|
|
20870
20913
|
/**
|
|
20871
20914
|
* The name of the model that generated the message.
|
|
20872
20915
|
*/
|
|
20873
|
-
model:
|
|
20916
|
+
model: external_exports.string(),
|
|
20874
20917
|
/**
|
|
20875
20918
|
* The reason why sampling stopped.
|
|
20876
20919
|
*/
|
|
20877
|
-
stopReason:
|
|
20878
|
-
role:
|
|
20879
|
-
content:
|
|
20920
|
+
stopReason: external_exports.optional(external_exports.enum(["endTurn", "stopSequence", "maxTokens"]).or(external_exports.string())),
|
|
20921
|
+
role: external_exports.enum(["user", "assistant"]),
|
|
20922
|
+
content: external_exports.discriminatedUnion("type", [
|
|
20880
20923
|
TextContentSchema,
|
|
20881
20924
|
ImageContentSchema,
|
|
20882
20925
|
AudioContentSchema
|
|
20883
20926
|
])
|
|
20884
20927
|
});
|
|
20885
|
-
var ResourceReferenceSchema =
|
|
20886
|
-
type:
|
|
20928
|
+
var ResourceReferenceSchema = external_exports.object({
|
|
20929
|
+
type: external_exports.literal("ref/resource"),
|
|
20887
20930
|
/**
|
|
20888
20931
|
* The URI or URI template of the resource.
|
|
20889
20932
|
*/
|
|
20890
|
-
uri:
|
|
20933
|
+
uri: external_exports.string()
|
|
20891
20934
|
}).passthrough();
|
|
20892
|
-
var PromptReferenceSchema =
|
|
20893
|
-
type:
|
|
20935
|
+
var PromptReferenceSchema = external_exports.object({
|
|
20936
|
+
type: external_exports.literal("ref/prompt"),
|
|
20894
20937
|
/**
|
|
20895
20938
|
* The name of the prompt or prompt template
|
|
20896
20939
|
*/
|
|
20897
|
-
name:
|
|
20940
|
+
name: external_exports.string()
|
|
20898
20941
|
}).passthrough();
|
|
20899
20942
|
var CompleteRequestSchema = RequestSchema.extend({
|
|
20900
|
-
method:
|
|
20943
|
+
method: external_exports.literal("completion/complete"),
|
|
20901
20944
|
params: BaseRequestParamsSchema.extend({
|
|
20902
|
-
ref:
|
|
20945
|
+
ref: external_exports.union([PromptReferenceSchema, ResourceReferenceSchema]),
|
|
20903
20946
|
/**
|
|
20904
20947
|
* The argument's information
|
|
20905
20948
|
*/
|
|
20906
|
-
argument:
|
|
20949
|
+
argument: external_exports.object({
|
|
20907
20950
|
/**
|
|
20908
20951
|
* The name of the argument
|
|
20909
20952
|
*/
|
|
20910
|
-
name:
|
|
20953
|
+
name: external_exports.string(),
|
|
20911
20954
|
/**
|
|
20912
20955
|
* The value of the argument to use for completion matching.
|
|
20913
20956
|
*/
|
|
20914
|
-
value:
|
|
20957
|
+
value: external_exports.string()
|
|
20915
20958
|
}).passthrough()
|
|
20916
20959
|
})
|
|
20917
20960
|
});
|
|
20918
20961
|
var CompleteResultSchema = ResultSchema.extend({
|
|
20919
|
-
completion:
|
|
20962
|
+
completion: external_exports.object({
|
|
20920
20963
|
/**
|
|
20921
20964
|
* An array of completion values. Must not exceed 100 items.
|
|
20922
20965
|
*/
|
|
20923
|
-
values:
|
|
20966
|
+
values: external_exports.array(external_exports.string()).max(100),
|
|
20924
20967
|
/**
|
|
20925
20968
|
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
20926
20969
|
*/
|
|
20927
|
-
total:
|
|
20970
|
+
total: external_exports.optional(external_exports.number().int()),
|
|
20928
20971
|
/**
|
|
20929
20972
|
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
20930
20973
|
*/
|
|
20931
|
-
hasMore:
|
|
20974
|
+
hasMore: external_exports.optional(external_exports.boolean())
|
|
20932
20975
|
}).passthrough()
|
|
20933
20976
|
});
|
|
20934
|
-
var RootSchema =
|
|
20977
|
+
var RootSchema = external_exports.object({
|
|
20935
20978
|
/**
|
|
20936
20979
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
20937
20980
|
*/
|
|
20938
|
-
uri:
|
|
20981
|
+
uri: external_exports.string().startsWith("file://"),
|
|
20939
20982
|
/**
|
|
20940
20983
|
* An optional name for the root.
|
|
20941
20984
|
*/
|
|
20942
|
-
name:
|
|
20985
|
+
name: external_exports.optional(external_exports.string())
|
|
20943
20986
|
}).passthrough();
|
|
20944
20987
|
var ListRootsRequestSchema = RequestSchema.extend({
|
|
20945
|
-
method:
|
|
20988
|
+
method: external_exports.literal("roots/list")
|
|
20946
20989
|
});
|
|
20947
20990
|
var ListRootsResultSchema = ResultSchema.extend({
|
|
20948
|
-
roots:
|
|
20991
|
+
roots: external_exports.array(RootSchema)
|
|
20949
20992
|
});
|
|
20950
20993
|
var RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
20951
|
-
method:
|
|
20994
|
+
method: external_exports.literal("notifications/roots/list_changed")
|
|
20952
20995
|
});
|
|
20953
|
-
var ClientRequestSchema =
|
|
20996
|
+
var ClientRequestSchema = external_exports.union([
|
|
20954
20997
|
PingRequestSchema,
|
|
20955
20998
|
InitializeRequestSchema,
|
|
20956
20999
|
CompleteRequestSchema,
|
|
@@ -20965,23 +21008,23 @@ var ClientRequestSchema = z.union([
|
|
|
20965
21008
|
CallToolRequestSchema,
|
|
20966
21009
|
ListToolsRequestSchema
|
|
20967
21010
|
]);
|
|
20968
|
-
var ClientNotificationSchema =
|
|
21011
|
+
var ClientNotificationSchema = external_exports.union([
|
|
20969
21012
|
CancelledNotificationSchema,
|
|
20970
21013
|
ProgressNotificationSchema,
|
|
20971
21014
|
InitializedNotificationSchema,
|
|
20972
21015
|
RootsListChangedNotificationSchema
|
|
20973
21016
|
]);
|
|
20974
|
-
var ClientResultSchema =
|
|
21017
|
+
var ClientResultSchema = external_exports.union([
|
|
20975
21018
|
EmptyResultSchema,
|
|
20976
21019
|
CreateMessageResultSchema,
|
|
20977
21020
|
ListRootsResultSchema
|
|
20978
21021
|
]);
|
|
20979
|
-
var ServerRequestSchema =
|
|
21022
|
+
var ServerRequestSchema = external_exports.union([
|
|
20980
21023
|
PingRequestSchema,
|
|
20981
21024
|
CreateMessageRequestSchema,
|
|
20982
21025
|
ListRootsRequestSchema
|
|
20983
21026
|
]);
|
|
20984
|
-
var ServerNotificationSchema =
|
|
21027
|
+
var ServerNotificationSchema = external_exports.union([
|
|
20985
21028
|
CancelledNotificationSchema,
|
|
20986
21029
|
ProgressNotificationSchema,
|
|
20987
21030
|
LoggingMessageNotificationSchema,
|
|
@@ -20990,7 +21033,7 @@ var ServerNotificationSchema = z.union([
|
|
|
20990
21033
|
ToolListChangedNotificationSchema,
|
|
20991
21034
|
PromptListChangedNotificationSchema
|
|
20992
21035
|
]);
|
|
20993
|
-
var ServerResultSchema =
|
|
21036
|
+
var ServerResultSchema = external_exports.union([
|
|
20994
21037
|
EmptyResultSchema,
|
|
20995
21038
|
InitializeResultSchema,
|
|
20996
21039
|
CompleteResultSchema,
|
|
@@ -22861,7 +22904,7 @@ var McpServer = class {
|
|
|
22861
22904
|
});
|
|
22862
22905
|
this.server.setRequestHandler(ListToolsRequestSchema, () => ({
|
|
22863
22906
|
tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => {
|
|
22864
|
-
|
|
22907
|
+
const toolDefinition = {
|
|
22865
22908
|
name,
|
|
22866
22909
|
description: tool.description,
|
|
22867
22910
|
inputSchema: tool.inputSchema ? zodToJsonSchema(tool.inputSchema, {
|
|
@@ -22869,6 +22912,10 @@ var McpServer = class {
|
|
|
22869
22912
|
}) : EMPTY_OBJECT_JSON_SCHEMA,
|
|
22870
22913
|
annotations: tool.annotations
|
|
22871
22914
|
};
|
|
22915
|
+
if (tool.outputSchema) {
|
|
22916
|
+
toolDefinition.outputSchema = zodToJsonSchema(tool.outputSchema, { strictUnions: true });
|
|
22917
|
+
}
|
|
22918
|
+
return toolDefinition;
|
|
22872
22919
|
})
|
|
22873
22920
|
}));
|
|
22874
22921
|
this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
@@ -22879,6 +22926,7 @@ var McpServer = class {
|
|
|
22879
22926
|
if (!tool.enabled) {
|
|
22880
22927
|
throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
|
|
22881
22928
|
}
|
|
22929
|
+
let result;
|
|
22882
22930
|
if (tool.inputSchema) {
|
|
22883
22931
|
const parseResult = await tool.inputSchema.safeParseAsync(request.params.arguments);
|
|
22884
22932
|
if (!parseResult.success) {
|
|
@@ -22887,9 +22935,9 @@ var McpServer = class {
|
|
|
22887
22935
|
const args = parseResult.data;
|
|
22888
22936
|
const cb = tool.callback;
|
|
22889
22937
|
try {
|
|
22890
|
-
|
|
22938
|
+
result = await Promise.resolve(cb(args, extra));
|
|
22891
22939
|
} catch (error) {
|
|
22892
|
-
|
|
22940
|
+
result = {
|
|
22893
22941
|
content: [
|
|
22894
22942
|
{
|
|
22895
22943
|
type: "text",
|
|
@@ -22902,9 +22950,9 @@ var McpServer = class {
|
|
|
22902
22950
|
} else {
|
|
22903
22951
|
const cb = tool.callback;
|
|
22904
22952
|
try {
|
|
22905
|
-
|
|
22953
|
+
result = await Promise.resolve(cb(extra));
|
|
22906
22954
|
} catch (error) {
|
|
22907
|
-
|
|
22955
|
+
result = {
|
|
22908
22956
|
content: [
|
|
22909
22957
|
{
|
|
22910
22958
|
type: "text",
|
|
@@ -22915,6 +22963,16 @@ var McpServer = class {
|
|
|
22915
22963
|
};
|
|
22916
22964
|
}
|
|
22917
22965
|
}
|
|
22966
|
+
if (tool.outputSchema) {
|
|
22967
|
+
if (!result.structuredContent) {
|
|
22968
|
+
throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} has an output schema but no structured content was provided`);
|
|
22969
|
+
}
|
|
22970
|
+
const parseResult = await tool.outputSchema.safeParseAsync(result.structuredContent);
|
|
22971
|
+
if (!parseResult.success) {
|
|
22972
|
+
throw new McpError(ErrorCode.InvalidParams, `Invalid structured content for tool ${request.params.name}: ${parseResult.error.message}`);
|
|
22973
|
+
}
|
|
22974
|
+
}
|
|
22975
|
+
return result;
|
|
22918
22976
|
});
|
|
22919
22977
|
this._toolHandlersInitialized = true;
|
|
22920
22978
|
}
|
|
@@ -23148,33 +23206,13 @@ var McpServer = class {
|
|
|
23148
23206
|
return registeredResourceTemplate;
|
|
23149
23207
|
}
|
|
23150
23208
|
}
|
|
23151
|
-
|
|
23152
|
-
if (this._registeredTools[name]) {
|
|
23153
|
-
throw new Error(`Tool ${name} is already registered`);
|
|
23154
|
-
}
|
|
23155
|
-
let description;
|
|
23156
|
-
if (typeof rest[0] === "string") {
|
|
23157
|
-
description = rest.shift();
|
|
23158
|
-
}
|
|
23159
|
-
let paramsSchema;
|
|
23160
|
-
let annotations;
|
|
23161
|
-
if (rest.length > 1) {
|
|
23162
|
-
const firstArg = rest[0];
|
|
23163
|
-
if (isZodRawShape(firstArg)) {
|
|
23164
|
-
paramsSchema = rest.shift();
|
|
23165
|
-
if (rest.length > 1 && typeof rest[0] === "object" && rest[0] !== null && !isZodRawShape(rest[0])) {
|
|
23166
|
-
annotations = rest.shift();
|
|
23167
|
-
}
|
|
23168
|
-
} else if (typeof firstArg === "object" && firstArg !== null) {
|
|
23169
|
-
annotations = rest.shift();
|
|
23170
|
-
}
|
|
23171
|
-
}
|
|
23172
|
-
const cb = rest[0];
|
|
23209
|
+
_createRegisteredTool(name, description, inputSchema, outputSchema, annotations, callback) {
|
|
23173
23210
|
const registeredTool = {
|
|
23174
23211
|
description,
|
|
23175
|
-
inputSchema:
|
|
23212
|
+
inputSchema: inputSchema === void 0 ? void 0 : external_exports.object(inputSchema),
|
|
23213
|
+
outputSchema: outputSchema === void 0 ? void 0 : external_exports.object(outputSchema),
|
|
23176
23214
|
annotations,
|
|
23177
|
-
callback
|
|
23215
|
+
callback,
|
|
23178
23216
|
enabled: true,
|
|
23179
23217
|
disable: () => registeredTool.update({ enabled: false }),
|
|
23180
23218
|
enable: () => registeredTool.update({ enabled: true }),
|
|
@@ -23188,7 +23226,7 @@ var McpServer = class {
|
|
|
23188
23226
|
if (typeof updates.description !== "undefined")
|
|
23189
23227
|
registeredTool.description = updates.description;
|
|
23190
23228
|
if (typeof updates.paramsSchema !== "undefined")
|
|
23191
|
-
registeredTool.inputSchema =
|
|
23229
|
+
registeredTool.inputSchema = external_exports.object(updates.paramsSchema);
|
|
23192
23230
|
if (typeof updates.callback !== "undefined")
|
|
23193
23231
|
registeredTool.callback = updates.callback;
|
|
23194
23232
|
if (typeof updates.annotations !== "undefined")
|
|
@@ -23203,6 +23241,44 @@ var McpServer = class {
|
|
|
23203
23241
|
this.sendToolListChanged();
|
|
23204
23242
|
return registeredTool;
|
|
23205
23243
|
}
|
|
23244
|
+
/**
|
|
23245
|
+
* tool() implementation. Parses arguments passed to overrides defined above.
|
|
23246
|
+
*/
|
|
23247
|
+
tool(name, ...rest) {
|
|
23248
|
+
if (this._registeredTools[name]) {
|
|
23249
|
+
throw new Error(`Tool ${name} is already registered`);
|
|
23250
|
+
}
|
|
23251
|
+
let description;
|
|
23252
|
+
let inputSchema;
|
|
23253
|
+
let outputSchema;
|
|
23254
|
+
let annotations;
|
|
23255
|
+
if (typeof rest[0] === "string") {
|
|
23256
|
+
description = rest.shift();
|
|
23257
|
+
}
|
|
23258
|
+
if (rest.length > 1) {
|
|
23259
|
+
const firstArg = rest[0];
|
|
23260
|
+
if (isZodRawShape(firstArg)) {
|
|
23261
|
+
inputSchema = rest.shift();
|
|
23262
|
+
if (rest.length > 1 && typeof rest[0] === "object" && rest[0] !== null && !isZodRawShape(rest[0])) {
|
|
23263
|
+
annotations = rest.shift();
|
|
23264
|
+
}
|
|
23265
|
+
} else if (typeof firstArg === "object" && firstArg !== null) {
|
|
23266
|
+
annotations = rest.shift();
|
|
23267
|
+
}
|
|
23268
|
+
}
|
|
23269
|
+
const callback = rest[0];
|
|
23270
|
+
return this._createRegisteredTool(name, description, inputSchema, outputSchema, annotations, callback);
|
|
23271
|
+
}
|
|
23272
|
+
/**
|
|
23273
|
+
* Registers a tool with a config object and callback.
|
|
23274
|
+
*/
|
|
23275
|
+
registerTool(name, config, cb) {
|
|
23276
|
+
if (this._registeredTools[name]) {
|
|
23277
|
+
throw new Error(`Tool ${name} is already registered`);
|
|
23278
|
+
}
|
|
23279
|
+
const { description, inputSchema, outputSchema, annotations } = config;
|
|
23280
|
+
return this._createRegisteredTool(name, description, inputSchema, outputSchema, annotations, cb);
|
|
23281
|
+
}
|
|
23206
23282
|
prompt(name, ...rest) {
|
|
23207
23283
|
if (this._registeredPrompts[name]) {
|
|
23208
23284
|
throw new Error(`Prompt ${name} is already registered`);
|
|
@@ -23218,7 +23294,7 @@ var McpServer = class {
|
|
|
23218
23294
|
const cb = rest[0];
|
|
23219
23295
|
const registeredPrompt = {
|
|
23220
23296
|
description,
|
|
23221
|
-
argsSchema: argsSchema === void 0 ? void 0 :
|
|
23297
|
+
argsSchema: argsSchema === void 0 ? void 0 : external_exports.object(argsSchema),
|
|
23222
23298
|
callback: cb,
|
|
23223
23299
|
enabled: true,
|
|
23224
23300
|
disable: () => registeredPrompt.update({ enabled: false }),
|
|
@@ -23233,7 +23309,7 @@ var McpServer = class {
|
|
|
23233
23309
|
if (typeof updates.description !== "undefined")
|
|
23234
23310
|
registeredPrompt.description = updates.description;
|
|
23235
23311
|
if (typeof updates.argsSchema !== "undefined")
|
|
23236
|
-
registeredPrompt.argsSchema =
|
|
23312
|
+
registeredPrompt.argsSchema = external_exports.object(updates.argsSchema);
|
|
23237
23313
|
if (typeof updates.callback !== "undefined")
|
|
23238
23314
|
registeredPrompt.callback = updates.callback;
|
|
23239
23315
|
if (typeof updates.enabled !== "undefined")
|
|
@@ -23476,6 +23552,7 @@ var WixMcpServer = class extends McpServer {
|
|
|
23476
23552
|
} finally {
|
|
23477
23553
|
const endTime = performance.now();
|
|
23478
23554
|
const duration = Math.round(endTime - startTime);
|
|
23555
|
+
const clientName = this.server.getClientVersion()?.name;
|
|
23479
23556
|
if (!isDevEnvironment) {
|
|
23480
23557
|
if (this.getUserId) {
|
|
23481
23558
|
const userId = this.getUserId();
|
|
@@ -23485,14 +23562,15 @@ var WixMcpServer = class extends McpServer {
|
|
|
23485
23562
|
}
|
|
23486
23563
|
this.biLogger.report(
|
|
23487
23564
|
(0, import_v2.wixMcpRequestSrc39Evid1607)({
|
|
23565
|
+
clientName,
|
|
23566
|
+
duration,
|
|
23567
|
+
errorBody,
|
|
23488
23568
|
toolInvocationId,
|
|
23489
23569
|
toolName,
|
|
23490
23570
|
params: JSON.stringify(argsBeforeExtra),
|
|
23491
23571
|
origin: this.nodeEnv,
|
|
23492
|
-
duration,
|
|
23493
23572
|
sessionId: this.sessionId,
|
|
23494
|
-
executionResult: toolSucceeded ? "Success" : "Error"
|
|
23495
|
-
errorBody
|
|
23573
|
+
executionResult: toolSucceeded ? "Success" : "Error"
|
|
23496
23574
|
})
|
|
23497
23575
|
);
|
|
23498
23576
|
}
|
|
@@ -23623,9 +23701,14 @@ var runSemanticSearchAndFormat = async ({
|
|
|
23623
23701
|
return formatResultsContent(results, maxResultsToUse, linesInEachResult);
|
|
23624
23702
|
};
|
|
23625
23703
|
|
|
23704
|
+
// src/constants.ts
|
|
23705
|
+
var RAW_DOCS_API_URL = "https://dev.wix.com/rawdocs/api";
|
|
23706
|
+
var GET_ARTICLE_CONTENT_URL = `${RAW_DOCS_API_URL}/get-article-content`;
|
|
23707
|
+
var PORTAL_INDEX_URL = `${RAW_DOCS_API_URL}/portal-index`;
|
|
23708
|
+
|
|
23626
23709
|
// src/docs/fetch-article.ts
|
|
23627
23710
|
async function fetchArticleContentFromDigor(httpClient, articleUrl, mode, stripHeader = false) {
|
|
23628
|
-
const url = new URL(
|
|
23711
|
+
const url = new URL(GET_ARTICLE_CONTENT_URL);
|
|
23629
23712
|
url.searchParams.set("articleUrl", articleUrl);
|
|
23630
23713
|
const schema = mode === "methodSchema" ? "true" : "false";
|
|
23631
23714
|
url.searchParams.set("schema", schema);
|
|
@@ -23792,10 +23875,10 @@ var addDocsTools = (server, allowedTools = [
|
|
|
23792
23875
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
23793
23876
|
].join("\n"),
|
|
23794
23877
|
{
|
|
23795
|
-
searchTerm:
|
|
23878
|
+
searchTerm: external_exports.string().describe(
|
|
23796
23879
|
"The search term to search for in the Wix Design System Documentation"
|
|
23797
23880
|
),
|
|
23798
|
-
maxResults:
|
|
23881
|
+
maxResults: external_exports.number().describe(
|
|
23799
23882
|
"The maximum number of results to return, default is 5, max is 15"
|
|
23800
23883
|
).min(1).max(15).optional().default(10)
|
|
23801
23884
|
},
|
|
@@ -23847,10 +23930,10 @@ var addDocsTools = (server, allowedTools = [
|
|
|
23847
23930
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
23848
23931
|
].join("\n"),
|
|
23849
23932
|
{
|
|
23850
|
-
searchTerm:
|
|
23933
|
+
searchTerm: external_exports.string().describe(
|
|
23851
23934
|
"The search term to search for in the Wix REST API Documentation"
|
|
23852
23935
|
),
|
|
23853
|
-
maxResults:
|
|
23936
|
+
maxResults: external_exports.number().describe(
|
|
23854
23937
|
"The maximum number of results to return, default is 5, max is 15"
|
|
23855
23938
|
).min(1).max(15).optional().default(10)
|
|
23856
23939
|
},
|
|
@@ -23910,10 +23993,10 @@ var addDocsTools = (server, allowedTools = [
|
|
|
23910
23993
|
"2. Out of the returned list of articles that you will receive, you MUST select the most relevant one and use the ReadFullDocsArticle tool to fetch it."
|
|
23911
23994
|
].join("\n"),
|
|
23912
23995
|
{
|
|
23913
|
-
searchTerm:
|
|
23996
|
+
searchTerm: external_exports.string().describe(
|
|
23914
23997
|
'The search term for the required sample flow (e.g. "setup a new business")'
|
|
23915
23998
|
),
|
|
23916
|
-
maxResults:
|
|
23999
|
+
maxResults: external_exports.number().describe(
|
|
23917
24000
|
"The maximum number of results to return, default is 5, max is 15"
|
|
23918
24001
|
).min(1).max(15).optional().default(5)
|
|
23919
24002
|
},
|
|
@@ -23969,10 +24052,10 @@ var addDocsTools = (server, allowedTools = [
|
|
|
23969
24052
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
23970
24053
|
].join("\n"),
|
|
23971
24054
|
{
|
|
23972
|
-
searchTerm:
|
|
24055
|
+
searchTerm: external_exports.string().describe(
|
|
23973
24056
|
"The search term to search for in the Wix SDK Documentation"
|
|
23974
24057
|
),
|
|
23975
|
-
maxResults:
|
|
24058
|
+
maxResults: external_exports.number().describe(
|
|
23976
24059
|
"The maximum number of results to return, default is 5, max is 15"
|
|
23977
24060
|
).min(1).max(15).optional().default(5)
|
|
23978
24061
|
},
|
|
@@ -24031,10 +24114,10 @@ var addDocsTools = (server, allowedTools = [
|
|
|
24031
24114
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
24032
24115
|
].join("\n"),
|
|
24033
24116
|
{
|
|
24034
|
-
searchTerm:
|
|
24117
|
+
searchTerm: external_exports.string().describe(
|
|
24035
24118
|
"The search term to search for in the Build Apps Documentation"
|
|
24036
24119
|
),
|
|
24037
|
-
maxResults:
|
|
24120
|
+
maxResults: external_exports.number().describe(
|
|
24038
24121
|
"The maximum number of results to return, default is 5, max is 15"
|
|
24039
24122
|
).min(1).max(15).optional().default(5)
|
|
24040
24123
|
},
|
|
@@ -24085,10 +24168,10 @@ var addDocsTools = (server, allowedTools = [
|
|
|
24085
24168
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
24086
24169
|
].join("\n"),
|
|
24087
24170
|
{
|
|
24088
|
-
searchTerm:
|
|
24171
|
+
searchTerm: external_exports.string().describe(
|
|
24089
24172
|
"The search term to search for in the Headless Documentation"
|
|
24090
24173
|
),
|
|
24091
|
-
maxResults:
|
|
24174
|
+
maxResults: external_exports.number().describe(
|
|
24092
24175
|
"The maximum number of results to return, default is 5, max is 15"
|
|
24093
24176
|
).min(1).max(15).optional().default(5)
|
|
24094
24177
|
},
|
|
@@ -24136,7 +24219,7 @@ var addDocsTools = (server, allowedTools = [
|
|
|
24136
24219
|
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
24137
24220
|
].join("\n"),
|
|
24138
24221
|
{
|
|
24139
|
-
articleUrl:
|
|
24222
|
+
articleUrl: external_exports.string().describe(
|
|
24140
24223
|
"The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../.../..."
|
|
24141
24224
|
)
|
|
24142
24225
|
},
|
|
@@ -24187,7 +24270,7 @@ var addDocsTools = (server, allowedTools = [
|
|
|
24187
24270
|
"This will give you the entire request/response schema with all the fields and their descriptions."
|
|
24188
24271
|
].join("\n"),
|
|
24189
24272
|
{
|
|
24190
|
-
articleUrl:
|
|
24273
|
+
articleUrl: external_exports.string().describe(
|
|
24191
24274
|
"The URL of the documentation to fetch. Should be something like https://dev.wix.com/docs/.../.../..."
|
|
24192
24275
|
)
|
|
24193
24276
|
},
|
|
@@ -24277,14 +24360,14 @@ function addApiCallTool(server, strategy) {
|
|
|
24277
24360
|
"For any other error, use your default error handling mechanism"
|
|
24278
24361
|
].join("\n"),
|
|
24279
24362
|
{
|
|
24280
|
-
siteId:
|
|
24281
|
-
url:
|
|
24363
|
+
siteId: external_exports.string().describe("The id of the site selected using site selection tool"),
|
|
24364
|
+
url: external_exports.string().describe(
|
|
24282
24365
|
"The url of the api to call - ALWAYS get the information from the Wix REST docs or from the conversation context, the URL MUST BE ABSOLUTE URL"
|
|
24283
24366
|
),
|
|
24284
|
-
method:
|
|
24367
|
+
method: external_exports.string().describe(
|
|
24285
24368
|
"The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)"
|
|
24286
24369
|
),
|
|
24287
|
-
body:
|
|
24370
|
+
body: external_exports.string().optional().describe(
|
|
24288
24371
|
"A string representing of a valid JSON object to describe the body of the request"
|
|
24289
24372
|
)
|
|
24290
24373
|
},
|
|
@@ -24325,11 +24408,11 @@ function addApiCallTool(server, strategy) {
|
|
|
24325
24408
|
"ListWixSites",
|
|
24326
24409
|
"List Wix sites for the current user, by default it will return all sites, but you can filter by name",
|
|
24327
24410
|
{
|
|
24328
|
-
nameSearch:
|
|
24411
|
+
nameSearch: external_exports.string().optional().describe(
|
|
24329
24412
|
"optional filer by name, if not provided all sites will be returned"
|
|
24330
24413
|
),
|
|
24331
24414
|
// Hack for Cursor ignoring tools with no params (when nameSearch is optional)
|
|
24332
|
-
alwaysTrue:
|
|
24415
|
+
alwaysTrue: external_exports.boolean().describe("Always pass true to this parameter")
|
|
24333
24416
|
},
|
|
24334
24417
|
async ({ nameSearch }, { httpClient }) => {
|
|
24335
24418
|
const sitesRes = await httpClient.post(
|
|
@@ -24379,13 +24462,13 @@ function addApiCallTool(server, strategy) {
|
|
|
24379
24462
|
ALWAYS use "SearchWixRESTDocumentation" to search for the API you should invoke, NEVER GUESS THE SITE API URL
|
|
24380
24463
|
You should ALWAYS check the rest docs - "SearchWixRESTDocumentation" for the specific API you want to call, don't just call it without knowing what it does, CHECK THE DOCS`,
|
|
24381
24464
|
{
|
|
24382
|
-
url:
|
|
24465
|
+
url: external_exports.string().describe(
|
|
24383
24466
|
"The url of the api to call - ALWAYS get the information from the Wix REST docs DONT GUESS IT, the URL MUST BE ABSOLUTE URL"
|
|
24384
24467
|
),
|
|
24385
|
-
method:
|
|
24468
|
+
method: external_exports.string().describe(
|
|
24386
24469
|
"The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)"
|
|
24387
24470
|
),
|
|
24388
|
-
body:
|
|
24471
|
+
body: external_exports.string().optional().describe(
|
|
24389
24472
|
"A string representing of a valid JSON object to describe the body of the request"
|
|
24390
24473
|
)
|
|
24391
24474
|
},
|
|
@@ -24426,9 +24509,7 @@ function addApiCallTool(server, strategy) {
|
|
|
24426
24509
|
|
|
24427
24510
|
// src/resources/docs.ts
|
|
24428
24511
|
var getPortalIndex = async (portalName) => {
|
|
24429
|
-
const response = await fetch(
|
|
24430
|
-
`https://dev.wix.com/digor/api/portal-index?portalName=${portalName}`
|
|
24431
|
-
);
|
|
24512
|
+
const response = await fetch(`${PORTAL_INDEX_URL}?portalName=${portalName}`);
|
|
24432
24513
|
const data = await response.json();
|
|
24433
24514
|
return data;
|
|
24434
24515
|
};
|
|
@@ -24447,7 +24528,7 @@ var addPortalResources = async (server, portalName) => {
|
|
|
24447
24528
|
logger2.log(`fetching resource ${uri2}`);
|
|
24448
24529
|
const docsURL = uri2.toString().replace("wix-docs://", "https://dev.wix.com/docs/");
|
|
24449
24530
|
const response = await fetch(
|
|
24450
|
-
|
|
24531
|
+
`${GET_ARTICLE_CONTENT_URL}?articleUrl=${encodeURIComponent(docsURL)}`
|
|
24451
24532
|
);
|
|
24452
24533
|
const data = await response.json();
|
|
24453
24534
|
return {
|
|
@@ -24484,10 +24565,10 @@ function addSupportTool(server) {
|
|
|
24484
24565
|
"This tool is not sending the message, but formats it in order to another tool to actually send it"
|
|
24485
24566
|
].join("\n"),
|
|
24486
24567
|
{
|
|
24487
|
-
requestId:
|
|
24568
|
+
requestId: external_exports.string().optional().describe(
|
|
24488
24569
|
"request id if returned from the server in a failed API call to Wix"
|
|
24489
24570
|
),
|
|
24490
|
-
message:
|
|
24571
|
+
message: external_exports.string().describe("The message to send to Wix")
|
|
24491
24572
|
},
|
|
24492
24573
|
async ({ requestId, message }) => {
|
|
24493
24574
|
return {
|