@vitemcp/server 1.9.10 → 1.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OAuthProvider-Dt3F-oDh.d.cts → OAuthProvider-B78zmLtB.d.cts} +11 -0
- package/dist/{OAuthProvider-Dt3F-oDh.d.ts → OAuthProvider-B78zmLtB.d.ts} +11 -0
- package/dist/ViteMCP.cjs +3 -3
- package/dist/ViteMCP.d.cts +2 -2
- package/dist/ViteMCP.d.ts +2 -2
- package/dist/ViteMCP.js +2 -2
- package/dist/auth/index.cjs +2 -2
- package/dist/auth/index.d.cts +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/bin/vitemcp.cjs +1 -0
- package/dist/bin/vitemcp.cjs.map +1 -1
- package/dist/bin/vitemcp.js +1 -0
- package/dist/bin/vitemcp.js.map +1 -1
- package/dist/{chunk-2FAJF3V6.cjs → chunk-C2VT2NXC.cjs} +58 -44
- package/dist/chunk-C2VT2NXC.cjs.map +1 -0
- package/dist/{chunk-UVKIOOZA.js → chunk-IAT55CW3.js} +24 -10
- package/dist/{chunk-UVKIOOZA.js.map → chunk-IAT55CW3.js.map} +1 -1
- package/dist/{chunk-ZVK5GKEO.js → chunk-KSEFUQF4.js} +29 -1
- package/dist/chunk-KSEFUQF4.js.map +1 -0
- package/dist/{chunk-PNWCRGJY.cjs → chunk-XGRRYN5Y.cjs} +29 -1
- package/dist/chunk-XGRRYN5Y.cjs.map +1 -0
- package/dist/openapi/index.cjs +20 -13
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +10 -3
- package/dist/openapi/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2FAJF3V6.cjs.map +0 -1
- package/dist/chunk-PNWCRGJY.cjs.map +0 -1
- package/dist/chunk-ZVK5GKEO.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXGRRYN5Ycjs = require('./chunk-XGRRYN5Y.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -52,6 +52,12 @@ var errorResponse = (error) => {
|
|
|
52
52
|
status: _nullishCoalesce(err.statusCode, () => ( 400))
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
+
var browserErrorResponse = (error) => {
|
|
56
|
+
if (typeof _optionalChain([error, 'optionalAccess', _3 => _3.toJSON]) !== "function") {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
return errorResponse(error);
|
|
60
|
+
};
|
|
55
61
|
var readCappedBody = async (request) => {
|
|
56
62
|
const declared = request.headers.get("content-length");
|
|
57
63
|
if (declared && Number(declared) > OAUTH_PROXY_MAX_BODY_SIZE) {
|
|
@@ -193,7 +199,7 @@ var createOAuthRouter = (options) => {
|
|
|
193
199
|
try {
|
|
194
200
|
const params = Object.fromEntries(new URLSearchParams(text).entries());
|
|
195
201
|
const authHeader = raw.headers.get("authorization");
|
|
196
|
-
if (_optionalChain([authHeader, 'optionalAccess',
|
|
202
|
+
if (_optionalChain([authHeader, 'optionalAccess', _4 => _4.toLowerCase, 'call', _5 => _5(), 'access', _6 => _6.startsWith, 'call', _7 => _7("basic ")])) {
|
|
197
203
|
const credentials = parseBasicCredentials(authHeader);
|
|
198
204
|
if (!credentials) {
|
|
199
205
|
return c.json(
|
|
@@ -238,14 +244,22 @@ var createOAuthRouter = (options) => {
|
|
|
238
244
|
return c.json(body, status, noStore);
|
|
239
245
|
}
|
|
240
246
|
});
|
|
241
|
-
app.get(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
);
|
|
247
|
+
app.get(`${basePath}/oauth/callback`, async (c) => {
|
|
248
|
+
try {
|
|
249
|
+
return await proxy.handleCallback(c.req.raw);
|
|
250
|
+
} catch (error) {
|
|
251
|
+
const { body, status } = browserErrorResponse(error);
|
|
252
|
+
return c.json(body, status);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
app.all(`${basePath}/oauth/consent`, async (c) => {
|
|
256
|
+
try {
|
|
257
|
+
return await proxy.handleConsent(c.req.raw);
|
|
258
|
+
} catch (error) {
|
|
259
|
+
const { body, status } = browserErrorResponse(error);
|
|
260
|
+
return c.json(body, status);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
249
263
|
return app;
|
|
250
264
|
};
|
|
251
265
|
|
|
@@ -450,7 +464,7 @@ function toIssue(error) {
|
|
|
450
464
|
const index = Number(segment);
|
|
451
465
|
return /^(?:0|[1-9]\d*)$/.test(segment) && Number.isSafeInteger(index) ? index : segment;
|
|
452
466
|
});
|
|
453
|
-
const missingProperty = _optionalChain([error, 'access',
|
|
467
|
+
const missingProperty = _optionalChain([error, 'access', _8 => _8.params, 'optionalAccess', _9 => _9.missingProperty]);
|
|
454
468
|
if (error.keyword === "required" && typeof missingProperty === "string") {
|
|
455
469
|
path.push(missingProperty);
|
|
456
470
|
}
|
|
@@ -492,7 +506,7 @@ var isSvg = (data) => {
|
|
|
492
506
|
return /^<svg[\s/>]/.test(text);
|
|
493
507
|
};
|
|
494
508
|
var mediaTypeOf = (data, kind, sniffed, declared) => {
|
|
495
|
-
if (_optionalChain([sniffed, 'optionalAccess',
|
|
509
|
+
if (_optionalChain([sniffed, 'optionalAccess', _10 => _10.startsWith, 'call', _11 => _11(`${kind}/`)])) {
|
|
496
510
|
return sniffed;
|
|
497
511
|
}
|
|
498
512
|
if (kind === "image" && isSvg(data)) {
|
|
@@ -501,8 +515,8 @@ var mediaTypeOf = (data, kind, sniffed, declared) => {
|
|
|
501
515
|
if (kind === "audio" && (sniffed === "video/mp4" || sniffed === "video/webm")) {
|
|
502
516
|
return sniffed.replace("video/", "audio/");
|
|
503
517
|
}
|
|
504
|
-
const declaredType = _optionalChain([declared, 'optionalAccess',
|
|
505
|
-
if (_optionalChain([declaredType, 'optionalAccess',
|
|
518
|
+
const declaredType = _optionalChain([declared, 'optionalAccess', _12 => _12.split, 'call', _13 => _13(";"), 'access', _14 => _14[0], 'access', _15 => _15.trim, 'call', _16 => _16(), 'access', _17 => _17.toLowerCase, 'call', _18 => _18()]);
|
|
519
|
+
if (_optionalChain([declaredType, 'optionalAccess', _19 => _19.startsWith, 'call', _20 => _20(`${kind}/`)])) {
|
|
506
520
|
return declaredType;
|
|
507
521
|
}
|
|
508
522
|
return _nullishCoalesce(sniffed, () => ( (kind === "image" ? "image/png" : "audio/mpeg")));
|
|
@@ -546,7 +560,7 @@ var readMedia = async (source, kind) => {
|
|
|
546
560
|
const sniffed = await fileTypeFromBuffer(rawData);
|
|
547
561
|
return {
|
|
548
562
|
data: rawData.toString("base64"),
|
|
549
|
-
mimeType: mediaTypeOf(rawData, kind, _optionalChain([sniffed, 'optionalAccess',
|
|
563
|
+
mimeType: mediaTypeOf(rawData, kind, _optionalChain([sniffed, 'optionalAccess', _21 => _21.mime]), declared)
|
|
550
564
|
};
|
|
551
565
|
};
|
|
552
566
|
var imageContent = async (source) => {
|
|
@@ -612,7 +626,7 @@ var ViteMCP = class {
|
|
|
612
626
|
* picking a port first and binding it afterwards.
|
|
613
627
|
*/
|
|
614
628
|
get port() {
|
|
615
|
-
const address = _optionalChain([this, 'access',
|
|
629
|
+
const address = _optionalChain([this, 'access', _22 => _22.#httpServer, 'optionalAccess', _23 => _23.address, 'call', _24 => _24()]);
|
|
616
630
|
return address && typeof address === "object" ? address.port : null;
|
|
617
631
|
}
|
|
618
632
|
get serverState() {
|
|
@@ -784,7 +798,7 @@ var ViteMCP = class {
|
|
|
784
798
|
* client is never reached.
|
|
785
799
|
*/
|
|
786
800
|
notifyResourceUpdated(uri) {
|
|
787
|
-
_optionalChain([this, 'access',
|
|
801
|
+
_optionalChain([this, 'access', _25 => _25.#handler, 'optionalAccess', _26 => _26.notify, 'access', _27 => _27.resourceUpdated, 'call', _28 => _28(uri)]);
|
|
788
802
|
}
|
|
789
803
|
removePrompt(name) {
|
|
790
804
|
this.#prompts = this.#prompts.filter((p) => p.name !== name);
|
|
@@ -853,9 +867,9 @@ var ViteMCP = class {
|
|
|
853
867
|
});
|
|
854
868
|
}
|
|
855
869
|
this.#connectedServers = [];
|
|
856
|
-
await _optionalChain([this, 'access',
|
|
870
|
+
await _optionalChain([this, 'access', _29 => _29.#stdioHandle, 'optionalAccess', _30 => _30.close, 'optionalCall', _31 => _31()]);
|
|
857
871
|
this.#stdioHandle = null;
|
|
858
|
-
await _optionalChain([this, 'access',
|
|
872
|
+
await _optionalChain([this, 'access', _32 => _32.#handler, 'optionalAccess', _33 => _33.close, 'call', _34 => _34()]);
|
|
859
873
|
this.#handler = null;
|
|
860
874
|
if (this.#httpServer) {
|
|
861
875
|
await new Promise(
|
|
@@ -942,7 +956,7 @@ var ViteMCP = class {
|
|
|
942
956
|
const { context, release } = this.#makeContext(
|
|
943
957
|
auth,
|
|
944
958
|
ctx,
|
|
945
|
-
_optionalChain([timeout, 'optionalAccess',
|
|
959
|
+
_optionalChain([timeout, 'optionalAccess', _35 => _35.controller, 'access', _36 => _36.signal])
|
|
946
960
|
);
|
|
947
961
|
try {
|
|
948
962
|
const result = await (timeout ? withTimeout(tool.execute(args, context), timeout, tool.name) : tool.execute(args, context));
|
|
@@ -1115,7 +1129,7 @@ var ViteMCP = class {
|
|
|
1115
1129
|
return {
|
|
1116
1130
|
publish: (event) => events.publish(event),
|
|
1117
1131
|
subscribe: (listener) => {
|
|
1118
|
-
const auth = _optionalChain([this, 'access',
|
|
1132
|
+
const auth = _optionalChain([this, 'access', _37 => _37.#authStore, 'access', _38 => _38.getStore, 'call', _39 => _39(), 'optionalAccess', _40 => _40.auth]);
|
|
1119
1133
|
return events.subscribe((event) => {
|
|
1120
1134
|
if (event.kind !== "resource_updated" || this.#canRead(event.uri, auth)) {
|
|
1121
1135
|
listener(event);
|
|
@@ -1143,16 +1157,16 @@ var ViteMCP = class {
|
|
|
1143
1157
|
*/
|
|
1144
1158
|
#makeContext(auth, rawCtx, timeoutSignal) {
|
|
1145
1159
|
const ctx = rawCtx;
|
|
1146
|
-
const mcpReq = _optionalChain([ctx, 'optionalAccess',
|
|
1147
|
-
const scope = requestScope(_optionalChain([mcpReq, 'optionalAccess',
|
|
1160
|
+
const mcpReq = _optionalChain([ctx, 'optionalAccess', _41 => _41.mcpReq]);
|
|
1161
|
+
const scope = requestScope(_optionalChain([mcpReq, 'optionalAccess', _42 => _42.signal]), timeoutSignal);
|
|
1148
1162
|
let settled = false;
|
|
1149
1163
|
const notify = async (notification) => {
|
|
1150
1164
|
if (settled || scope.signal.aborted) {
|
|
1151
1165
|
return;
|
|
1152
1166
|
}
|
|
1153
|
-
await _optionalChain([mcpReq, 'optionalAccess',
|
|
1167
|
+
await _optionalChain([mcpReq, 'optionalAccess', _43 => _43.notify, 'optionalCall', _44 => _44(notification)]);
|
|
1154
1168
|
};
|
|
1155
|
-
const requestedLevel = _optionalChain([mcpReq, 'optionalAccess',
|
|
1169
|
+
const requestedLevel = _optionalChain([mcpReq, 'optionalAccess', _45 => _45.envelope, 'optionalAccess', _46 => _46[_server.LOG_LEVEL_META_KEY]]);
|
|
1156
1170
|
const emit = (level, message, data) => {
|
|
1157
1171
|
if (!requestedLevel || LOG_LEVELS.indexOf(level) < LOG_LEVELS.indexOf(requestedLevel)) {
|
|
1158
1172
|
return;
|
|
@@ -1171,12 +1185,12 @@ var ViteMCP = class {
|
|
|
1171
1185
|
requestedSchema: params.requestedSchema
|
|
1172
1186
|
}),
|
|
1173
1187
|
input: (key, schema) => _server.acceptedContent.call(void 0,
|
|
1174
|
-
_optionalChain([mcpReq, 'optionalAccess',
|
|
1188
|
+
_optionalChain([mcpReq, 'optionalAccess', _47 => _47.inputResponses]),
|
|
1175
1189
|
key,
|
|
1176
1190
|
schema
|
|
1177
1191
|
),
|
|
1178
1192
|
inputRequired: (inputRequests, requestState) => _server.inputRequired.call(void 0, { inputRequests, requestState }),
|
|
1179
|
-
inputResponses: _optionalChain([mcpReq, 'optionalAccess',
|
|
1193
|
+
inputResponses: _optionalChain([mcpReq, 'optionalAccess', _48 => _48.inputResponses]),
|
|
1180
1194
|
log: {
|
|
1181
1195
|
debug: (m, d) => emit("debug", m, d),
|
|
1182
1196
|
error: (m, d) => emit("error", m, d),
|
|
@@ -1184,7 +1198,7 @@ var ViteMCP = class {
|
|
|
1184
1198
|
warn: (m, d) => emit("warning", m, d)
|
|
1185
1199
|
},
|
|
1186
1200
|
reportProgress: async (progress) => {
|
|
1187
|
-
const progressToken = _optionalChain([mcpReq, 'optionalAccess',
|
|
1201
|
+
const progressToken = _optionalChain([mcpReq, 'optionalAccess', _49 => _49._meta, 'optionalAccess', _50 => _50.progressToken]);
|
|
1188
1202
|
if (progressToken === void 0) {
|
|
1189
1203
|
return;
|
|
1190
1204
|
}
|
|
@@ -1198,10 +1212,10 @@ var ViteMCP = class {
|
|
|
1198
1212
|
}
|
|
1199
1213
|
});
|
|
1200
1214
|
},
|
|
1201
|
-
requestId: _optionalChain([mcpReq, 'optionalAccess',
|
|
1215
|
+
requestId: _optionalChain([mcpReq, 'optionalAccess', _51 => _51.id]),
|
|
1202
1216
|
// The SDK exposes this as an accessor; call it so callers get the
|
|
1203
1217
|
// value.
|
|
1204
|
-
requestState: _optionalChain([mcpReq, 'optionalAccess',
|
|
1218
|
+
requestState: _optionalChain([mcpReq, 'optionalAccess', _52 => _52.requestState, 'optionalCall', _53 => _53()]),
|
|
1205
1219
|
signal: scope.signal
|
|
1206
1220
|
},
|
|
1207
1221
|
release: () => {
|
|
@@ -1216,7 +1230,7 @@ var ViteMCP = class {
|
|
|
1216
1230
|
* no addressee on a stateless transport.
|
|
1217
1231
|
*/
|
|
1218
1232
|
#notifyListChanged(kind) {
|
|
1219
|
-
const notifier = _optionalChain([this, 'access',
|
|
1233
|
+
const notifier = _optionalChain([this, 'access', _54 => _54.#handler, 'optionalAccess', _55 => _55.notify]);
|
|
1220
1234
|
if (!notifier) {
|
|
1221
1235
|
return;
|
|
1222
1236
|
}
|
|
@@ -1264,7 +1278,7 @@ var ViteMCP = class {
|
|
|
1264
1278
|
// Authentication has already run in the route below, which is the only
|
|
1265
1279
|
// place that can turn a refusal into an HTTP status. What reaches here
|
|
1266
1280
|
// is either an authenticated session or a deliberately anonymous one.
|
|
1267
|
-
async ({ era }) => this.#buildServer(_optionalChain([this, 'access',
|
|
1281
|
+
async ({ era }) => this.#buildServer(_optionalChain([this, 'access', _56 => _56.#authStore, 'access', _57 => _57.getStore, 'call', _58 => _58(), 'optionalAccess', _59 => _59.auth]), {
|
|
1268
1282
|
era,
|
|
1269
1283
|
// A 2025-era client reads `resources.subscribe` as a promise of
|
|
1270
1284
|
// `resources/subscribe`, which is not served.
|
|
@@ -1285,7 +1299,7 @@ var ViteMCP = class {
|
|
|
1285
1299
|
provider.getOAuthConfig(),
|
|
1286
1300
|
_nullishCoalesce(config.endpoint, () => ( "/mcp"))
|
|
1287
1301
|
))));
|
|
1288
|
-
if (_optionalChain([oauth, 'optionalAccess',
|
|
1302
|
+
if (_optionalChain([oauth, 'optionalAccess', _60 => _60.enabled]) !== false && (_nullishCoalesce(_nullishCoalesce(_optionalChain([oauth, 'optionalAccess', _61 => _61.proxy]), () => ( _optionalChain([oauth, 'optionalAccess', _62 => _62.authorizationServer]))), () => ( _optionalChain([oauth, 'optionalAccess', _63 => _63.protectedResource]))))) {
|
|
1289
1303
|
this.#honoApp.route(
|
|
1290
1304
|
"/",
|
|
1291
1305
|
createOAuthRouter({
|
|
@@ -1299,10 +1313,10 @@ var ViteMCP = class {
|
|
|
1299
1313
|
this.#protectedResource = oauth.protectedResource;
|
|
1300
1314
|
}
|
|
1301
1315
|
const health = this.#options.health;
|
|
1302
|
-
if (_optionalChain([health, 'optionalAccess',
|
|
1316
|
+
if (_optionalChain([health, 'optionalAccess', _64 => _64.enabled]) !== false) {
|
|
1303
1317
|
this.#honoApp.get(
|
|
1304
|
-
_nullishCoalesce(_optionalChain([health, 'optionalAccess',
|
|
1305
|
-
(c) => c.text(_nullishCoalesce(_optionalChain([health, 'optionalAccess',
|
|
1318
|
+
_nullishCoalesce(_optionalChain([health, 'optionalAccess', _65 => _65.path]), () => ( "/health")),
|
|
1319
|
+
(c) => c.text(_nullishCoalesce(_optionalChain([health, 'optionalAccess', _66 => _66.message]), () => ( "ok")), _nullishCoalesce(_optionalChain([health, 'optionalAccess', _67 => _67.status]), () => ( 200)))
|
|
1306
1320
|
);
|
|
1307
1321
|
}
|
|
1308
1322
|
const endpoint = `${_nullishCoalesce(config.basePath, () => ( ""))}${_nullishCoalesce(config.endpoint, () => ( "/mcp"))}`;
|
|
@@ -1339,7 +1353,7 @@ var ViteMCP = class {
|
|
|
1339
1353
|
"Content-Type": "application/json"
|
|
1340
1354
|
});
|
|
1341
1355
|
req.resume();
|
|
1342
|
-
res.once("finish", () => _optionalChain([res, 'access',
|
|
1356
|
+
res.once("finish", () => _optionalChain([res, 'access', _68 => _68.socket, 'optionalAccess', _69 => _69.end, 'call', _70 => _70()]));
|
|
1343
1357
|
res.end(
|
|
1344
1358
|
JSON.stringify({
|
|
1345
1359
|
error: "invalid_request",
|
|
@@ -1459,7 +1473,7 @@ var withEndpointAsResource = (config, endpoint) => ({
|
|
|
1459
1473
|
...config,
|
|
1460
1474
|
protectedResource: {
|
|
1461
1475
|
...config.protectedResource,
|
|
1462
|
-
resource: `${
|
|
1476
|
+
resource: `${_chunkXGRRYN5Ycjs.withoutTrailingSlash.call(void 0, config.protectedResource.resource)}${endpoint}`
|
|
1463
1477
|
}
|
|
1464
1478
|
});
|
|
1465
1479
|
var nodeToWebRequest = (req, body, secure, signal) => {
|
|
@@ -1560,8 +1574,8 @@ var assertStandardSchema = (schema, toolName, field) => {
|
|
|
1560
1574
|
if (schema === void 0) {
|
|
1561
1575
|
return;
|
|
1562
1576
|
}
|
|
1563
|
-
const standard = _optionalChain([schema, 'optionalAccess',
|
|
1564
|
-
if (typeof _optionalChain([standard, 'optionalAccess',
|
|
1577
|
+
const standard = _optionalChain([schema, 'optionalAccess', _71 => _71["~standard"]]);
|
|
1578
|
+
if (typeof _optionalChain([standard, 'optionalAccess', _72 => _72.validate]) !== "function") {
|
|
1565
1579
|
throw new UnexpectedStateError(
|
|
1566
1580
|
`Tool '${toolName}' ${field} must implement Standard Schema. If you are using Zod, upgrade to version 3.24 or later.`,
|
|
1567
1581
|
{ toolName }
|
|
@@ -1583,21 +1597,21 @@ var matchesOutputSchema = async (schema, value) => {
|
|
|
1583
1597
|
};
|
|
1584
1598
|
var promptArgsSchema = (prompt) => {
|
|
1585
1599
|
const args = prompt.arguments;
|
|
1586
|
-
if (!_optionalChain([args, 'optionalAccess',
|
|
1600
|
+
if (!_optionalChain([args, 'optionalAccess', _73 => _73.length])) {
|
|
1587
1601
|
return void 0;
|
|
1588
1602
|
}
|
|
1589
1603
|
const shape = {};
|
|
1590
1604
|
for (const arg of args) {
|
|
1591
1605
|
const explicitCompleter = _nullishCoalesce(arg.complete, () => ( (prompt.complete ? (value) => prompt.complete(arg.name, value) : void 0)));
|
|
1592
1606
|
const enumValues = arg.enum;
|
|
1593
|
-
const completer = _nullishCoalesce(explicitCompleter, () => ( (_optionalChain([enumValues, 'optionalAccess',
|
|
1607
|
+
const completer = _nullishCoalesce(explicitCompleter, () => ( (_optionalChain([enumValues, 'optionalAccess', _74 => _74.length]) ? async (value) => ({
|
|
1594
1608
|
// An empty value is how an editor asks for the whole set before the
|
|
1595
1609
|
// user has typed anything; filtering it would answer with nothing.
|
|
1596
1610
|
values: value ? enumValues.filter(
|
|
1597
1611
|
(option) => option.toLowerCase().includes(value.toLowerCase())
|
|
1598
1612
|
) : [...enumValues]
|
|
1599
1613
|
}) : void 0)));
|
|
1600
|
-
const valueSchema = _optionalChain([enumValues, 'optionalAccess',
|
|
1614
|
+
const valueSchema = _optionalChain([enumValues, 'optionalAccess', _75 => _75.length]) ? _zod.z.enum(enumValues) : _zod.z.string();
|
|
1601
1615
|
const described = arg.description ? valueSchema.describe(arg.description) : valueSchema;
|
|
1602
1616
|
const base = completer ? _server.completable.call(void 0,
|
|
1603
1617
|
described,
|
|
@@ -1674,4 +1688,4 @@ var normalizeToolResult = (result, hasOutputSchema) => {
|
|
|
1674
1688
|
|
|
1675
1689
|
|
|
1676
1690
|
exports.cancelResponseBody = cancelResponseBody; exports.DiscoveryDocumentCache = DiscoveryDocumentCache; exports.jsonSchemaAdapter = jsonSchemaAdapter; exports.delay = _promises5.setTimeout; exports.MEDIA_FETCH_TIMEOUT_MS = MEDIA_FETCH_TIMEOUT_MS; exports.ViteMCPError = ViteMCPError; exports.UnexpectedStateError = UnexpectedStateError; exports.UserError = UserError; exports.imageContent = imageContent; exports.audioContent = audioContent; exports.ServerState = ServerState; exports.ViteMCP = ViteMCP;
|
|
1677
|
-
//# sourceMappingURL=chunk-
|
|
1691
|
+
//# sourceMappingURL=chunk-C2VT2NXC.cjs.map
|