@vitemcp/server 1.9.10 → 1.9.12

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.
Files changed (41) hide show
  1. package/README.md +15 -11
  2. package/dist/{OAuthProvider-Dt3F-oDh.d.cts → OAuthProvider-B78zmLtB.d.cts} +11 -0
  3. package/dist/{OAuthProvider-Dt3F-oDh.d.ts → OAuthProvider-B78zmLtB.d.ts} +11 -0
  4. package/dist/ViteMCP.cjs +4 -4
  5. package/dist/ViteMCP.d.cts +2 -2
  6. package/dist/ViteMCP.d.ts +2 -2
  7. package/dist/ViteMCP.js +3 -3
  8. package/dist/auth/index.cjs +2 -2
  9. package/dist/auth/index.d.cts +7 -2
  10. package/dist/auth/index.d.ts +7 -2
  11. package/dist/auth/index.js +1 -1
  12. package/dist/bin/vitemcp.cjs +1 -0
  13. package/dist/bin/vitemcp.cjs.map +1 -1
  14. package/dist/bin/vitemcp.js +1 -0
  15. package/dist/bin/vitemcp.js.map +1 -1
  16. package/dist/{chunk-PNWCRGJY.cjs → chunk-2X4JCSQQ.cjs} +35 -2
  17. package/dist/chunk-2X4JCSQQ.cjs.map +1 -0
  18. package/dist/{chunk-2FAJF3V6.cjs → chunk-7T5D57AM.cjs} +63 -49
  19. package/dist/chunk-7T5D57AM.cjs.map +1 -0
  20. package/dist/{chunk-TYR2KJIV.js → chunk-JMDI672G.js} +44 -9
  21. package/dist/chunk-JMDI672G.js.map +1 -0
  22. package/dist/{chunk-ZVK5GKEO.js → chunk-NZ34AKP4.js} +35 -2
  23. package/dist/chunk-NZ34AKP4.js.map +1 -0
  24. package/dist/{chunk-DURXYPPR.cjs → chunk-QPVEGWOL.cjs} +44 -9
  25. package/dist/chunk-QPVEGWOL.cjs.map +1 -0
  26. package/dist/{chunk-UVKIOOZA.js → chunk-WBP37JPX.js} +25 -11
  27. package/dist/{chunk-UVKIOOZA.js.map → chunk-WBP37JPX.js.map} +1 -1
  28. package/dist/edge/index.cjs +5 -5
  29. package/dist/edge/index.js +1 -1
  30. package/dist/openapi/index.cjs +24 -14
  31. package/dist/openapi/index.cjs.map +1 -1
  32. package/dist/openapi/index.d.cts +1 -1
  33. package/dist/openapi/index.d.ts +1 -1
  34. package/dist/openapi/index.js +14 -4
  35. package/dist/openapi/index.js.map +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-2FAJF3V6.cjs.map +0 -1
  38. package/dist/chunk-DURXYPPR.cjs.map +0 -1
  39. package/dist/chunk-PNWCRGJY.cjs.map +0 -1
  40. package/dist/chunk-TYR2KJIV.js.map +0 -1
  41. package/dist/chunk-ZVK5GKEO.js.map +0 -1
@@ -1,12 +1,12 @@
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 _chunkPNWCRGJYcjs = require('./chunk-PNWCRGJY.cjs');
3
+ var _chunk2X4JCSQQcjs = require('./chunk-2X4JCSQQ.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
- var _chunkDURXYPPRcjs = require('./chunk-DURXYPPR.cjs');
9
+ var _chunkQPVEGWOLcjs = require('./chunk-QPVEGWOL.cjs');
10
10
 
11
11
  // src/ViteMCP.ts
12
12
 
@@ -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', _3 => _3.toLowerCase, 'call', _4 => _4(), 'access', _5 => _5.startsWith, 'call', _6 => _6("basic ")])) {
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
- `${basePath}/oauth/callback`,
243
- async (c) => proxy.handleCallback(c.req.raw)
244
- );
245
- app.all(
246
- `${basePath}/oauth/consent`,
247
- async (c) => proxy.handleConsent(c.req.raw)
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', _7 => _7.params, 'optionalAccess', _8 => _8.missingProperty]);
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', _9 => _9.startsWith, 'call', _10 => _10(`${kind}/`)])) {
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', _11 => _11.split, 'call', _12 => _12(";"), 'access', _13 => _13[0], 'access', _14 => _14.trim, 'call', _15 => _15(), 'access', _16 => _16.toLowerCase, 'call', _17 => _17()]);
505
- if (_optionalChain([declaredType, 'optionalAccess', _18 => _18.startsWith, 'call', _19 => _19(`${kind}/`)])) {
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', _20 => _20.mime]), declared)
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', _21 => _21.#httpServer, 'optionalAccess', _22 => _22.address, 'call', _23 => _23()]);
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', _24 => _24.#handler, 'optionalAccess', _25 => _25.notify, 'access', _26 => _26.resourceUpdated, 'call', _27 => _27(uri)]);
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', _28 => _28.#stdioHandle, 'optionalAccess', _29 => _29.close, 'optionalCall', _30 => _30()]);
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', _31 => _31.#handler, 'optionalAccess', _32 => _32.close, 'call', _33 => _33()]);
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', _34 => _34.controller, 'access', _35 => _35.signal])
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', _36 => _36.#authStore, 'access', _37 => _37.getStore, 'call', _38 => _38(), 'optionalAccess', _39 => _39.auth]);
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', _40 => _40.mcpReq]);
1147
- const scope = requestScope(_optionalChain([mcpReq, 'optionalAccess', _41 => _41.signal]), timeoutSignal);
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', _42 => _42.notify, 'optionalCall', _43 => _43(notification)]);
1167
+ await _optionalChain([mcpReq, 'optionalAccess', _43 => _43.notify, 'optionalCall', _44 => _44(notification)]);
1154
1168
  };
1155
- const requestedLevel = _optionalChain([mcpReq, 'optionalAccess', _44 => _44.envelope, 'optionalAccess', _45 => _45[_server.LOG_LEVEL_META_KEY]]);
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', _46 => _46.inputResponses]),
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', _47 => _47.inputResponses]),
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', _48 => _48._meta, 'optionalAccess', _49 => _49.progressToken]);
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', _50 => _50.id]),
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', _51 => _51.requestState, 'optionalCall', _52 => _52()]),
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', _53 => _53.#handler, 'optionalAccess', _54 => _54.notify]);
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', _55 => _55.#authStore, 'access', _56 => _56.getStore, 'call', _57 => _57(), 'optionalAccess', _58 => _58.auth]), {
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', _59 => _59.enabled]) !== false && (_nullishCoalesce(_nullishCoalesce(_optionalChain([oauth, 'optionalAccess', _60 => _60.proxy]), () => ( _optionalChain([oauth, 'optionalAccess', _61 => _61.authorizationServer]))), () => ( _optionalChain([oauth, 'optionalAccess', _62 => _62.protectedResource]))))) {
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', _63 => _63.enabled]) !== false) {
1316
+ if (_optionalChain([health, 'optionalAccess', _64 => _64.enabled]) !== false) {
1303
1317
  this.#honoApp.get(
1304
- _nullishCoalesce(_optionalChain([health, 'optionalAccess', _64 => _64.path]), () => ( "/health")),
1305
- (c) => c.text(_nullishCoalesce(_optionalChain([health, 'optionalAccess', _65 => _65.message]), () => ( "ok")), _nullishCoalesce(_optionalChain([health, 'optionalAccess', _66 => _66.status]), () => ( 200)))
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,11 +1353,11 @@ var ViteMCP = class {
1339
1353
  "Content-Type": "application/json"
1340
1354
  });
1341
1355
  req.resume();
1342
- res.once("finish", () => _optionalChain([res, 'access', _67 => _67.socket, 'optionalAccess', _68 => _68.end, 'call', _69 => _69()]));
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",
1346
- error_description: `Request body exceeds ${_chunkDURXYPPRcjs.formatBytes.call(void 0, maxBodySize)}`
1360
+ error_description: `Request body exceeds ${_chunkQPVEGWOLcjs.formatBytes.call(void 0, maxBodySize)}`
1347
1361
  })
1348
1362
  );
1349
1363
  return;
@@ -1418,7 +1432,7 @@ var ViteMCP = class {
1418
1432
  */
1419
1433
  async #toSdkSchema(schema, label, io) {
1420
1434
  try {
1421
- return await _chunkDURXYPPRcjs.toSdkSchema.call(void 0, schema, io, convertToJsonSchema);
1435
+ return await _chunkQPVEGWOLcjs.toSdkSchema.call(void 0, schema, io, convertToJsonSchema);
1422
1436
  } catch (error) {
1423
1437
  throw new UnexpectedStateError(
1424
1438
  `${label} is not a supported Standard Schema: ${error instanceof Error ? error.message : String(error)}`,
@@ -1459,7 +1473,7 @@ var withEndpointAsResource = (config, endpoint) => ({
1459
1473
  ...config,
1460
1474
  protectedResource: {
1461
1475
  ...config.protectedResource,
1462
- resource: `${_chunkPNWCRGJYcjs.withoutTrailingSlash.call(void 0, config.protectedResource.resource)}${endpoint}`
1476
+ resource: `${_chunk2X4JCSQQcjs.withoutTrailingSlash.call(void 0, config.protectedResource.resource)}${endpoint}`
1463
1477
  }
1464
1478
  });
1465
1479
  var nodeToWebRequest = (req, body, secure, signal) => {
@@ -1555,13 +1569,13 @@ var readCappedNodeBody = async (req, maxBytes) => {
1555
1569
  }
1556
1570
  return Buffer.concat(chunks);
1557
1571
  };
1558
- var convertToJsonSchema = async (schema, io) => schema["~standard"].vendor === "valibot" ? _chunkDURXYPPRcjs.valibotToJsonSchema.call(void 0, schema, io) : _xsschema.toJsonSchema.call(void 0, schema);
1572
+ var convertToJsonSchema = async (schema, io) => schema["~standard"].vendor === "valibot" ? _chunkQPVEGWOLcjs.valibotToJsonSchema.call(void 0, schema, io) : _xsschema.toJsonSchema.call(void 0, schema);
1559
1573
  var assertStandardSchema = (schema, toolName, field) => {
1560
1574
  if (schema === void 0) {
1561
1575
  return;
1562
1576
  }
1563
- const standard = _optionalChain([schema, 'optionalAccess', _70 => _70["~standard"]]);
1564
- if (typeof _optionalChain([standard, 'optionalAccess', _71 => _71.validate]) !== "function") {
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', _72 => _72.length])) {
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', _73 => _73.length]) ? async (value) => ({
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', _74 => _74.length]) ? _zod.z.enum(enumValues) : _zod.z.string();
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,
@@ -1605,7 +1619,7 @@ var promptArgsSchema = (prompt) => {
1605
1619
  ) : described;
1606
1620
  shape[arg.name] = arg.required ? base : base.optional();
1607
1621
  }
1608
- return _chunkDURXYPPRcjs.ownKeysOnly.call(void 0, _zod.z.object(shape));
1622
+ return _chunkQPVEGWOLcjs.ownKeysOnly.call(void 0, _zod.z.object(shape));
1609
1623
  };
1610
1624
  var isStructuredResult = (value) => {
1611
1625
  if (!Object.hasOwn(value, "structuredContent") || value.structuredContent === void 0) {
@@ -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-2FAJF3V6.cjs.map
1691
+ //# sourceMappingURL=chunk-7T5D57AM.cjs.map