@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.
- package/README.md +10 -0
- package/dist/{OAuthProvider-BaPwgWny.d.cts → OAuthProvider-Dt3F-oDh.d.cts} +54 -0
- package/dist/{OAuthProvider-BaPwgWny.d.ts → OAuthProvider-Dt3F-oDh.d.ts} +54 -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 +10 -2
- package/dist/auth/index.d.ts +10 -2
- package/dist/auth/index.js +1 -1
- package/dist/bin/vitemcp.cjs +31 -2
- package/dist/bin/vitemcp.cjs.map +1 -1
- package/dist/bin/vitemcp.js +31 -2
- package/dist/bin/vitemcp.js.map +1 -1
- package/dist/{chunk-XU7XBDZI.cjs → chunk-2FAJF3V6.cjs} +62 -15
- package/dist/chunk-2FAJF3V6.cjs.map +1 -0
- package/dist/{chunk-NLFL6ISL.cjs → chunk-PNWCRGJY.cjs} +213 -47
- package/dist/chunk-PNWCRGJY.cjs.map +1 -0
- package/dist/{chunk-QZ6S3FM5.js → chunk-UVKIOOZA.js} +57 -10
- package/dist/{chunk-QZ6S3FM5.js.map → chunk-UVKIOOZA.js.map} +1 -1
- package/dist/{chunk-76HUSLES.js → chunk-ZVK5GKEO.js} +213 -47
- package/dist/chunk-ZVK5GKEO.js.map +1 -0
- package/dist/openapi/index.cjs +12 -12
- package/dist/openapi/index.d.cts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +2 -2
- package/package.json +7 -2
- package/dist/chunk-76HUSLES.js.map +0 -1
- package/dist/chunk-NLFL6ISL.cjs.map +0 -1
- package/dist/chunk-XU7XBDZI.cjs.map +0 -1
package/dist/openapi/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../chunk-
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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 ?
|
|
1075
|
-
parameters:
|
|
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
|
}
|
package/dist/openapi/index.d.cts
CHANGED
|
@@ -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-
|
|
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
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -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-
|
|
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
|
package/dist/openapi/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitemcp/server",
|
|
3
|
-
"version": "1.9.
|
|
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",
|