@vitemcp/server 1.9.8 → 1.9.10

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.
@@ -3,8 +3,8 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkXU7XBDZIcjs = require('../chunk-XU7XBDZI.cjs');
7
- require('../chunk-NLFL6ISL.cjs');
6
+ var _chunk2FAJF3V6cjs = require('../chunk-2FAJF3V6.cjs');
7
+ require('../chunk-PNWCRGJY.cjs');
8
8
  require('../chunk-DURXYPPR.cjs');
9
9
 
10
10
  // src/openapi/parameters.ts
@@ -271,7 +271,7 @@ var buildBody = (binding, values, headers) => {
271
271
  var buildPath = (route, values) => {
272
272
  const unfilled = [...route.path.matchAll(/\{([^{}]*)\}/g)].filter(([, name]) => !values.has(name)).map(([placeholder]) => placeholder);
273
273
  if (unfilled.length > 0) {
274
- throw new (0, _chunkXU7XBDZIcjs.UserError)(
274
+ throw new (0, _chunk2FAJF3V6cjs.UserError)(
275
275
  `${route.method.toUpperCase()} ${route.path} cannot be called: the OpenAPI document declares no path parameter for ${unfilled.join(", ")}.`
276
276
  );
277
277
  }
@@ -282,7 +282,7 @@ var buildPath = (route, values) => {
282
282
  const written = new Set(route.path.split("/").filter(isDotSegment));
283
283
  const introduced = path.split("/").find((segment) => isDotSegment(segment) && !written.has(segment));
284
284
  if (introduced !== void 0) {
285
- throw new (0, _chunkXU7XBDZIcjs.UserError)(
285
+ throw new (0, _chunk2FAJF3V6cjs.UserError)(
286
286
  `${route.method.toUpperCase()} ${route.path} cannot be called with a path segment of "${introduced}": a URL resolves it as a step through the path, so the request would reach a different endpoint.`
287
287
  );
288
288
  }
@@ -300,7 +300,7 @@ var readResponse = async (response, options) => {
300
300
  const mediaType = contentType.split(";")[0].trim().toLowerCase();
301
301
  const label = `${route.method.toUpperCase()} ${route.path}`;
302
302
  if (!response.ok) {
303
- throw new (0, _chunkXU7XBDZIcjs.UserError)(
303
+ throw new (0, _chunk2FAJF3V6cjs.UserError)(
304
304
  `${label} failed with ${response.status} ${response.statusText}: ${truncate(
305
305
  await response.text(),
306
306
  2e3
@@ -312,7 +312,7 @@ var readResponse = async (response, options) => {
312
312
  if (bytes.byteLength <= MAX_INLINE_MEDIA_BYTES) {
313
313
  return mediaType.startsWith("image/") ? { data: toBase64(bytes), mimeType: mediaType, type: "image" } : { data: toBase64(bytes), mimeType: mediaType, type: "audio" };
314
314
  }
315
- throw new (0, _chunkXU7XBDZIcjs.UserError)(
315
+ throw new (0, _chunk2FAJF3V6cjs.UserError)(
316
316
  `${label} returned ${bytes.byteLength} bytes of ${contentType}, too large to return inline.`
317
317
  );
318
318
  }
@@ -322,7 +322,7 @@ var readResponse = async (response, options) => {
322
322
  return { structuredContent: parsed };
323
323
  }
324
324
  if (binding.outputSchema) {
325
- throw new (0, _chunkXU7XBDZIcjs.UserError)(
325
+ throw new (0, _chunk2FAJF3V6cjs.UserError)(
326
326
  `${label} declares a JSON object response but returned ${contentType || "an untyped body"}. Set \`outputSchema: false\` if this document's response schemas do not match the API.`
327
327
  );
328
328
  }
@@ -344,7 +344,7 @@ var setHeader = (headers, name, value) => {
344
344
  try {
345
345
  headers.set(name, value);
346
346
  } catch (e2) {
347
- throw new (0, _chunkXU7XBDZIcjs.UserError)(
347
+ throw new (0, _chunk2FAJF3V6cjs.UserError)(
348
348
  `"${name}" is not a valid header name, or the value given for it is not a valid header value.`
349
349
  );
350
350
  }
@@ -451,7 +451,7 @@ var readSpecText = async (spec) => {
451
451
  headers: { accept: "application/json, text/yaml, */*" }
452
452
  });
453
453
  if (!response.ok) {
454
- await _chunkXU7XBDZIcjs.cancelResponseBody.call(void 0, response);
454
+ await _chunk2FAJF3V6cjs.cancelResponseBody.call(void 0, response);
455
455
  throw new Error(
456
456
  `Failed to fetch the OpenAPI document from ${spec}: ${response.status} ${response.statusText}`
457
457
  );
@@ -1032,7 +1032,7 @@ var fromOpenAPI = async (options) => {
1032
1032
  const selected = selectRoutes(extractRoutes(document), options);
1033
1033
  const names = generateToolNames(selected, options.toolNames);
1034
1034
  const normalizer = createSchemaNormalizer(document);
1035
- const server = _nullishCoalesce(options.server, () => ( new (0, _chunkXU7XBDZIcjs.ViteMCP)({
1035
+ const server = _nullishCoalesce(options.server, () => ( new (0, _chunk2FAJF3V6cjs.ViteMCP)({
1036
1036
  description: _optionalChain([document, 'access', _23 => _23.info, 'optionalAccess', _24 => _24.description]),
1037
1037
  name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _25 => _25.info, 'optionalAccess', _26 => _26.title]))), () => ( "OpenAPI")),
1038
1038
  version: _nullishCoalesce(options.version, () => ( semanticVersion(_optionalChain([document, 'access', _27 => _27.info, 'optionalAccess', _28 => _28.version]))))
@@ -1071,8 +1071,8 @@ var fromOpenAPI = async (options) => {
1071
1071
  route
1072
1072
  }),
1073
1073
  name,
1074
- outputSchema: binding.outputSchema ? _chunkXU7XBDZIcjs.jsonSchemaAdapter.call(void 0, binding.outputSchema) : void 0,
1075
- parameters: _chunkXU7XBDZIcjs.jsonSchemaAdapter.call(void 0, binding.inputSchema),
1074
+ outputSchema: binding.outputSchema ? _chunk2FAJF3V6cjs.jsonSchemaAdapter.call(void 0, binding.outputSchema) : void 0,
1075
+ parameters: _chunk2FAJF3V6cjs.jsonSchemaAdapter.call(void 0, binding.inputSchema),
1076
1076
  timeoutMs: options.timeoutMs
1077
1077
  });
1078
1078
  }
@@ -4,7 +4,7 @@ import '@standard-schema/spec';
4
4
  import 'hono';
5
5
  import 'hono/cors';
6
6
  import 'timers/promises';
7
- import '../OAuthProvider-BaPwgWny.cjs';
7
+ import '../OAuthProvider-Dt3F-oDh.cjs';
8
8
 
9
9
  /**
10
10
  * A value that may depend on the calling request — a bearer token derived from
@@ -4,7 +4,7 @@ import '@standard-schema/spec';
4
4
  import 'hono';
5
5
  import 'hono/cors';
6
6
  import 'timers/promises';
7
- import '../OAuthProvider-BaPwgWny.js';
7
+ import '../OAuthProvider-Dt3F-oDh.js';
8
8
 
9
9
  /**
10
10
  * A value that may depend on the calling request — a bearer token derived from
@@ -3,8 +3,8 @@ import {
3
3
  ViteMCP,
4
4
  cancelResponseBody,
5
5
  jsonSchemaAdapter
6
- } from "../chunk-QZ6S3FM5.js";
7
- import "../chunk-76HUSLES.js";
6
+ } from "../chunk-UVKIOOZA.js";
7
+ import "../chunk-ZVK5GKEO.js";
8
8
  import "../chunk-TYR2KJIV.js";
9
9
 
10
10
  // src/openapi/parameters.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitemcp/server",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "main": "./dist/ViteMCP.cjs",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -86,7 +86,8 @@
86
86
  "@valibot/to-json-schema": "^1.0.0",
87
87
  "ajv": "^8.0.0",
88
88
  "ajv-formats": "^3.0.0",
89
- "jose": "^5.0.0 || ^6.0.0"
89
+ "jose": "^5.0.0 || ^6.0.0",
90
+ "tsx": "^4.0.0"
90
91
  },
91
92
  "peerDependenciesMeta": {
92
93
  "@apidevtools/swagger-parser": {
@@ -103,6 +104,9 @@
103
104
  },
104
105
  "jose": {
105
106
  "optional": true
107
+ },
108
+ "tsx": {
109
+ "optional": true
106
110
  }
107
111
  },
108
112
  "repository": {
@@ -153,6 +157,7 @@
153
157
  "prettier": "^3.7.4",
154
158
  "semantic-release": "^25.0.2",
155
159
  "tsup": "^8.5.1",
160
+ "tsx": "^4.21.0",
156
161
  "typescript": "^5.9.3",
157
162
  "typescript-eslint": "^8.48.1",
158
163
  "valibot": "^1.2.0",