@vitemcp/server 1.10.3 → 1.10.4

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withoutTrailingSlash
3
- } from "./chunk-KRS3VHYI.js";
3
+ } from "./chunk-3QRGEISD.js";
4
4
  import {
5
5
  formatBytes,
6
6
  ownKeysOnly,
@@ -1711,4 +1711,4 @@ export {
1711
1711
  ServerState,
1712
1712
  ViteMCP
1713
1713
  };
1714
- //# sourceMappingURL=chunk-EJVIGLUY.js.map
1714
+ //# sourceMappingURL=chunk-QYNWHXTM.js.map
@@ -3,8 +3,8 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkPH2BAR5Icjs = require('../chunk-PH2BAR5I.cjs');
7
- require('../chunk-IWNTAHGZ.cjs');
6
+ var _chunkK2UCX3GScjs = require('../chunk-K2UCX3GS.cjs');
7
+ require('../chunk-LVPE26OW.cjs');
8
8
  require('../chunk-R4RK2DR2.cjs');
9
9
 
10
10
  // src/openapi/parameters.ts
@@ -291,7 +291,7 @@ var buildBody = (binding, values, headers) => {
291
291
  var buildPath = (route, values) => {
292
292
  const unfilled = [...route.path.matchAll(/\{([^{}]*)\}/g)].filter(([, name]) => !values.has(name)).map(([placeholder]) => placeholder);
293
293
  if (unfilled.length > 0) {
294
- throw new (0, _chunkPH2BAR5Icjs.UserError)(
294
+ throw new (0, _chunkK2UCX3GScjs.UserError)(
295
295
  `${route.method.toUpperCase()} ${route.path} cannot be called: the OpenAPI document declares no path parameter for ${unfilled.join(", ")}.`
296
296
  );
297
297
  }
@@ -302,7 +302,7 @@ var buildPath = (route, values) => {
302
302
  const written = new Set(route.path.split("/").filter(isDotSegment));
303
303
  const introduced = path.split("/").find((segment) => isDotSegment(segment) && !written.has(segment));
304
304
  if (introduced !== void 0) {
305
- throw new (0, _chunkPH2BAR5Icjs.UserError)(
305
+ throw new (0, _chunkK2UCX3GScjs.UserError)(
306
306
  `${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.`
307
307
  );
308
308
  }
@@ -320,7 +320,7 @@ var readResponse = async (response, options) => {
320
320
  const mediaType = contentType.split(";")[0].trim().toLowerCase();
321
321
  const label = `${route.method.toUpperCase()} ${route.path}`;
322
322
  if (!response.ok) {
323
- throw new (0, _chunkPH2BAR5Icjs.UserError)(
323
+ throw new (0, _chunkK2UCX3GScjs.UserError)(
324
324
  `${label} failed with ${response.status} ${response.statusText}: ${truncate(
325
325
  await response.text(),
326
326
  2e3
@@ -332,7 +332,7 @@ var readResponse = async (response, options) => {
332
332
  if (bytes.byteLength <= MAX_INLINE_MEDIA_BYTES) {
333
333
  return mediaType.startsWith("image/") ? { data: toBase64(bytes), mimeType: mediaType, type: "image" } : { data: toBase64(bytes), mimeType: mediaType, type: "audio" };
334
334
  }
335
- throw new (0, _chunkPH2BAR5Icjs.UserError)(
335
+ throw new (0, _chunkK2UCX3GScjs.UserError)(
336
336
  `${label} returned ${bytes.byteLength} bytes of ${contentType}, too large to return inline.`
337
337
  );
338
338
  }
@@ -342,7 +342,7 @@ var readResponse = async (response, options) => {
342
342
  return { structuredContent: parsed };
343
343
  }
344
344
  if (binding.outputSchema) {
345
- throw new (0, _chunkPH2BAR5Icjs.UserError)(
345
+ throw new (0, _chunkK2UCX3GScjs.UserError)(
346
346
  `${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.`
347
347
  );
348
348
  }
@@ -364,7 +364,7 @@ var setHeader = (headers, name, value) => {
364
364
  try {
365
365
  headers.set(name, value);
366
366
  } catch (e2) {
367
- throw new (0, _chunkPH2BAR5Icjs.UserError)(
367
+ throw new (0, _chunkK2UCX3GScjs.UserError)(
368
368
  `"${name}" is not a valid header name, or the value given for it is not a valid header value.`
369
369
  );
370
370
  }
@@ -471,7 +471,7 @@ var readSpecText = async (spec) => {
471
471
  headers: { accept: "application/json, text/yaml, */*" }
472
472
  });
473
473
  if (!response.ok) {
474
- await _chunkPH2BAR5Icjs.cancelResponseBody.call(void 0, response);
474
+ await _chunkK2UCX3GScjs.cancelResponseBody.call(void 0, response);
475
475
  throw new Error(
476
476
  `Failed to fetch the OpenAPI document from ${spec}: ${response.status} ${response.statusText}`
477
477
  );
@@ -1114,7 +1114,7 @@ var fromOpenAPI = async (options) => {
1114
1114
  const selected = selectRoutes(extractRoutes(document), options);
1115
1115
  const names = generateToolNames(selected, options.toolNames);
1116
1116
  const normalizer = createSchemaNormalizer(document);
1117
- const server = _nullishCoalesce(options.server, () => ( new (0, _chunkPH2BAR5Icjs.ViteMCP)({
1117
+ const server = _nullishCoalesce(options.server, () => ( new (0, _chunkK2UCX3GScjs.ViteMCP)({
1118
1118
  description: _optionalChain([document, 'access', _25 => _25.info, 'optionalAccess', _26 => _26.description]),
1119
1119
  name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _27 => _27.info, 'optionalAccess', _28 => _28.title]))), () => ( "OpenAPI")),
1120
1120
  version: _nullishCoalesce(options.version, () => ( semanticVersion(_optionalChain([document, 'access', _29 => _29.info, 'optionalAccess', _30 => _30.version]))))
@@ -1153,8 +1153,8 @@ var fromOpenAPI = async (options) => {
1153
1153
  route
1154
1154
  }),
1155
1155
  name,
1156
- outputSchema: binding.outputSchema ? _chunkPH2BAR5Icjs.jsonSchemaAdapter.call(void 0, binding.outputSchema) : void 0,
1157
- parameters: _chunkPH2BAR5Icjs.jsonSchemaAdapter.call(void 0, binding.inputSchema),
1156
+ outputSchema: binding.outputSchema ? _chunkK2UCX3GScjs.jsonSchemaAdapter.call(void 0, binding.outputSchema) : void 0,
1157
+ parameters: _chunkK2UCX3GScjs.jsonSchemaAdapter.call(void 0, binding.inputSchema),
1158
1158
  timeoutMs: options.timeoutMs
1159
1159
  });
1160
1160
  }
@@ -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-DN--f3j1.cjs';
7
+ import '../OAuthProvider-DbC_47_h.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-DN--f3j1.js';
7
+ import '../OAuthProvider-DbC_47_h.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-EJVIGLUY.js";
7
- import "../chunk-KRS3VHYI.js";
6
+ } from "../chunk-QYNWHXTM.js";
7
+ import "../chunk-3QRGEISD.js";
8
8
  import "../chunk-YDEROYNS.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.10.3",
3
+ "version": "1.10.4",
4
4
  "main": "./dist/ViteMCP.cjs",
5
5
  "scripts": {
6
6
  "build": "tsup",