@vitemcp/server 1.9.11 → 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.
package/README.md CHANGED
@@ -258,17 +258,21 @@ server.addTool({
258
258
  ```
259
259
 
260
260
  Works for `outputSchema` too, and is advertised as written — as are Zod and
261
- ArkType schemas, which emit their own JSON Schema. Anything else (Valibot, for
262
- one) is converted to JSON Schema for `tools/list` only; arguments and results
263
- are still validated by the library itself, so a `v.transform()` reaches
264
- `execute` and a `v.check()` is enforced even though JSON Schema can express
265
- neither. Converted input schemas get `additionalProperties: false` on every
266
- object, except where a record or rest schema (`v.record()`,
267
- `v.objectWithRest()`) describes the extra keys, or where the keys are declared
268
- in the branches of a `v.union()`, `v.variant()` or `v.intersect()`, or behind
269
- the `$ref` a `v.lazy()` becomes; converted output schemas are left as they
270
- are. A tool whose schema cannot be converted at all is left out of the server
271
- and reported through the logger.
261
+ ArkType schemas, which emit their own JSON Schema. Where one of those holds
262
+ something JSON Schema cannot express — a `z.date()`, a `z.bigint()`, an ArkType
263
+ `narrow()` — that part alone is advertised as open, as `{}` or as the type a
264
+ `narrow()` narrows, and the library still enforces it. A schema from any other
265
+ library (Valibot, for one) is converted to JSON Schema for `tools/list` only;
266
+ arguments and results are still validated by the library itself, so a
267
+ `v.transform()` reaches `execute` and a `v.check()` is enforced even though
268
+ JSON Schema can express neither. Converted input schemas get
269
+ `additionalProperties: false` on every object, except where a record or rest
270
+ schema (`v.record()`, `v.objectWithRest()`) describes the extra keys, or where
271
+ the keys are declared in the branches of a `v.union()`, `v.variant()` or
272
+ `v.intersect()`, or behind the `$ref` a `v.lazy()` becomes; converted output
273
+ schemas are left as they are. A tool whose schema cannot be converted at all,
274
+ or whose `parameters` do not describe an object, is left out of the server and
275
+ reported through the logger.
272
276
 
273
277
  A plain JSON Schema is validated in the dialect its `$schema` declares —
274
278
  2020-12, 2019-09, draft-07 or draft-06 — and as 2020-12 when it declares none,
package/dist/ViteMCP.cjs CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
 
12
12
 
13
- var _chunkC2VT2NXCcjs = require('./chunk-C2VT2NXC.cjs');
13
+ var _chunk7T5D57AMcjs = require('./chunk-7T5D57AM.cjs');
14
14
 
15
15
 
16
16
 
@@ -25,8 +25,8 @@ var _chunkC2VT2NXCcjs = require('./chunk-C2VT2NXC.cjs');
25
25
 
26
26
 
27
27
 
28
- var _chunkXGRRYN5Ycjs = require('./chunk-XGRRYN5Y.cjs');
29
- require('./chunk-DURXYPPR.cjs');
28
+ var _chunk2X4JCSQQcjs = require('./chunk-2X4JCSQQ.cjs');
29
+ require('./chunk-QPVEGWOL.cjs');
30
30
 
31
31
 
32
32
 
@@ -52,5 +52,5 @@ require('./chunk-DURXYPPR.cjs');
52
52
 
53
53
 
54
54
 
55
- exports.AuthProvider = _chunkXGRRYN5Ycjs.AuthProvider; exports.AzureProvider = _chunkXGRRYN5Ycjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkC2VT2NXCcjs.DiscoveryDocumentCache; exports.GitHubProvider = _chunkXGRRYN5Ycjs.GitHubProvider; exports.GoogleProvider = _chunkXGRRYN5Ycjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkC2VT2NXCcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkXGRRYN5Ycjs.OAuthProvider; exports.OAuthProxy = _chunkXGRRYN5Ycjs.OAuthProxy; exports.OAuthProxyError = _chunkXGRRYN5Ycjs.OAuthProxyError; exports.ServerState = _chunkC2VT2NXCcjs.ServerState; exports.UnexpectedStateError = _chunkC2VT2NXCcjs.UnexpectedStateError; exports.UserError = _chunkC2VT2NXCcjs.UserError; exports.ViteMCP = _chunkC2VT2NXCcjs.ViteMCP; exports.ViteMCPError = _chunkC2VT2NXCcjs.ViteMCPError; exports.audioContent = _chunkC2VT2NXCcjs.audioContent; exports.delay = _chunkC2VT2NXCcjs.delay; exports.getAuthSession = _chunkXGRRYN5Ycjs.getAuthSession; exports.imageContent = _chunkC2VT2NXCcjs.imageContent; exports.jsonSchemaAdapter = _chunkC2VT2NXCcjs.jsonSchemaAdapter; exports.requireAll = _chunkXGRRYN5Ycjs.requireAll; exports.requireAny = _chunkXGRRYN5Ycjs.requireAny; exports.requireAuth = _chunkXGRRYN5Ycjs.requireAuth; exports.requireRole = _chunkXGRRYN5Ycjs.requireRole; exports.requireScopes = _chunkXGRRYN5Ycjs.requireScopes;
55
+ exports.AuthProvider = _chunk2X4JCSQQcjs.AuthProvider; exports.AzureProvider = _chunk2X4JCSQQcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunk7T5D57AMcjs.DiscoveryDocumentCache; exports.GitHubProvider = _chunk2X4JCSQQcjs.GitHubProvider; exports.GoogleProvider = _chunk2X4JCSQQcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunk7T5D57AMcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk2X4JCSQQcjs.OAuthProvider; exports.OAuthProxy = _chunk2X4JCSQQcjs.OAuthProxy; exports.OAuthProxyError = _chunk2X4JCSQQcjs.OAuthProxyError; exports.ServerState = _chunk7T5D57AMcjs.ServerState; exports.UnexpectedStateError = _chunk7T5D57AMcjs.UnexpectedStateError; exports.UserError = _chunk7T5D57AMcjs.UserError; exports.ViteMCP = _chunk7T5D57AMcjs.ViteMCP; exports.ViteMCPError = _chunk7T5D57AMcjs.ViteMCPError; exports.audioContent = _chunk7T5D57AMcjs.audioContent; exports.delay = _chunk7T5D57AMcjs.delay; exports.getAuthSession = _chunk2X4JCSQQcjs.getAuthSession; exports.imageContent = _chunk7T5D57AMcjs.imageContent; exports.jsonSchemaAdapter = _chunk7T5D57AMcjs.jsonSchemaAdapter; exports.requireAll = _chunk2X4JCSQQcjs.requireAll; exports.requireAny = _chunk2X4JCSQQcjs.requireAny; exports.requireAuth = _chunk2X4JCSQQcjs.requireAuth; exports.requireRole = _chunk2X4JCSQQcjs.requireRole; exports.requireScopes = _chunk2X4JCSQQcjs.requireScopes;
56
56
  //# sourceMappingURL=ViteMCP.cjs.map
package/dist/ViteMCP.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  delay,
11
11
  imageContent,
12
12
  jsonSchemaAdapter
13
- } from "./chunk-IAT55CW3.js";
13
+ } from "./chunk-WBP37JPX.js";
14
14
  import {
15
15
  AuthProvider,
16
16
  AzureProvider,
@@ -25,8 +25,8 @@ import {
25
25
  requireAuth,
26
26
  requireRole,
27
27
  requireScopes
28
- } from "./chunk-KSEFUQF4.js";
29
- import "./chunk-TYR2KJIV.js";
28
+ } from "./chunk-NZ34AKP4.js";
29
+ import "./chunk-JMDI672G.js";
30
30
  export {
31
31
  AuthProvider,
32
32
  AzureProvider,
@@ -24,7 +24,7 @@
24
24
 
25
25
 
26
26
 
27
- var _chunkXGRRYN5Ycjs = require('../chunk-XGRRYN5Y.cjs');
27
+ var _chunk2X4JCSQQcjs = require('../chunk-2X4JCSQQ.cjs');
28
28
 
29
29
 
30
30
 
@@ -51,5 +51,5 @@ var _chunkXGRRYN5Ycjs = require('../chunk-XGRRYN5Y.cjs');
51
51
 
52
52
 
53
53
 
54
- exports.AuthProvider = _chunkXGRRYN5Ycjs.AuthProvider; exports.AzureProvider = _chunkXGRRYN5Ycjs.AzureProvider; exports.ConsentManager = _chunkXGRRYN5Ycjs.ConsentManager; exports.DEFAULT_ACCESS_TOKEN_TTL = _chunkXGRRYN5Ycjs.DEFAULT_ACCESS_TOKEN_TTL; exports.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH = _chunkXGRRYN5Ycjs.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH; exports.DEFAULT_AUTHORIZATION_CODE_TTL = _chunkXGRRYN5Ycjs.DEFAULT_AUTHORIZATION_CODE_TTL; exports.DEFAULT_REFRESH_TOKEN_TTL = _chunkXGRRYN5Ycjs.DEFAULT_REFRESH_TOKEN_TTL; exports.DEFAULT_TRANSACTION_TTL = _chunkXGRRYN5Ycjs.DEFAULT_TRANSACTION_TTL; exports.DiskStore = _chunkXGRRYN5Ycjs.DiskStore; exports.EncryptedTokenStorage = _chunkXGRRYN5Ycjs.EncryptedTokenStorage; exports.GitHubProvider = _chunkXGRRYN5Ycjs.GitHubProvider; exports.GoogleProvider = _chunkXGRRYN5Ycjs.GoogleProvider; exports.JWKSVerifier = _chunkXGRRYN5Ycjs.JWKSVerifier; exports.JWTIssuer = _chunkXGRRYN5Ycjs.JWTIssuer; exports.MemoryTokenStorage = _chunkXGRRYN5Ycjs.MemoryTokenStorage; exports.OAuthProvider = _chunkXGRRYN5Ycjs.OAuthProvider; exports.OAuthProxy = _chunkXGRRYN5Ycjs.OAuthProxy; exports.OAuthProxyError = _chunkXGRRYN5Ycjs.OAuthProxyError; exports.PKCEUtils = _chunkXGRRYN5Ycjs.PKCEUtils; exports.getAuthSession = _chunkXGRRYN5Ycjs.getAuthSession; exports.requireAll = _chunkXGRRYN5Ycjs.requireAll; exports.requireAny = _chunkXGRRYN5Ycjs.requireAny; exports.requireAuth = _chunkXGRRYN5Ycjs.requireAuth; exports.requireRole = _chunkXGRRYN5Ycjs.requireRole; exports.requireScopes = _chunkXGRRYN5Ycjs.requireScopes;
54
+ exports.AuthProvider = _chunk2X4JCSQQcjs.AuthProvider; exports.AzureProvider = _chunk2X4JCSQQcjs.AzureProvider; exports.ConsentManager = _chunk2X4JCSQQcjs.ConsentManager; exports.DEFAULT_ACCESS_TOKEN_TTL = _chunk2X4JCSQQcjs.DEFAULT_ACCESS_TOKEN_TTL; exports.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH = _chunk2X4JCSQQcjs.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH; exports.DEFAULT_AUTHORIZATION_CODE_TTL = _chunk2X4JCSQQcjs.DEFAULT_AUTHORIZATION_CODE_TTL; exports.DEFAULT_REFRESH_TOKEN_TTL = _chunk2X4JCSQQcjs.DEFAULT_REFRESH_TOKEN_TTL; exports.DEFAULT_TRANSACTION_TTL = _chunk2X4JCSQQcjs.DEFAULT_TRANSACTION_TTL; exports.DiskStore = _chunk2X4JCSQQcjs.DiskStore; exports.EncryptedTokenStorage = _chunk2X4JCSQQcjs.EncryptedTokenStorage; exports.GitHubProvider = _chunk2X4JCSQQcjs.GitHubProvider; exports.GoogleProvider = _chunk2X4JCSQQcjs.GoogleProvider; exports.JWKSVerifier = _chunk2X4JCSQQcjs.JWKSVerifier; exports.JWTIssuer = _chunk2X4JCSQQcjs.JWTIssuer; exports.MemoryTokenStorage = _chunk2X4JCSQQcjs.MemoryTokenStorage; exports.OAuthProvider = _chunk2X4JCSQQcjs.OAuthProvider; exports.OAuthProxy = _chunk2X4JCSQQcjs.OAuthProxy; exports.OAuthProxyError = _chunk2X4JCSQQcjs.OAuthProxyError; exports.PKCEUtils = _chunk2X4JCSQQcjs.PKCEUtils; exports.getAuthSession = _chunk2X4JCSQQcjs.getAuthSession; exports.requireAll = _chunk2X4JCSQQcjs.requireAll; exports.requireAny = _chunk2X4JCSQQcjs.requireAny; exports.requireAuth = _chunk2X4JCSQQcjs.requireAuth; exports.requireRole = _chunk2X4JCSQQcjs.requireRole; exports.requireScopes = _chunk2X4JCSQQcjs.requireScopes;
55
55
  //# sourceMappingURL=index.cjs.map
@@ -18,6 +18,11 @@ declare class ConsentManager {
18
18
  createConsentResponse(transaction: OAuthTransaction, provider: string): Response;
19
19
  /**
20
20
  * Generate HTML for consent screen
21
+ *
22
+ * The form posts to `consent`, relative to the page it is on, rather than to
23
+ * `/oauth/consent`. The page is served at `<basePath>/oauth/authorize` with
24
+ * the consent route beside it, so under a base path the rooted address was
25
+ * one no route answers, and Approve came back 404.
21
26
  */
22
27
  generateConsentScreen(data: ConsentData): string;
23
28
  /**
@@ -18,6 +18,11 @@ declare class ConsentManager {
18
18
  createConsentResponse(transaction: OAuthTransaction, provider: string): Response;
19
19
  /**
20
20
  * Generate HTML for consent screen
21
+ *
22
+ * The form posts to `consent`, relative to the page it is on, rather than to
23
+ * `/oauth/consent`. The page is served at `<basePath>/oauth/authorize` with
24
+ * the consent route beside it, so under a base path the rooted address was
25
+ * one no route answers, and Approve came back 404.
21
26
  */
22
27
  generateConsentScreen(data: ConsentData): string;
23
28
  /**
@@ -24,7 +24,7 @@ import {
24
24
  requireAuth,
25
25
  requireRole,
26
26
  requireScopes
27
- } from "../chunk-KSEFUQF4.js";
27
+ } from "../chunk-NZ34AKP4.js";
28
28
  export {
29
29
  AuthProvider,
30
30
  AzureProvider,
@@ -731,6 +731,11 @@ var ConsentManager = class {
731
731
  }
732
732
  /**
733
733
  * Generate HTML for consent screen
734
+ *
735
+ * The form posts to `consent`, relative to the page it is on, rather than to
736
+ * `/oauth/consent`. The page is served at `<basePath>/oauth/authorize` with
737
+ * the consent route beside it, so under a base path the rooted address was
738
+ * one no route answers, and Approve came back 404.
734
739
  */
735
740
  generateConsentScreen(data) {
736
741
  const { clientName, provider, scope, transactionId } = data;
@@ -918,7 +923,7 @@ var ConsentManager = class {
918
923
  </p>
919
924
  </div>
920
925
 
921
- <form method="POST" action="/oauth/consent">
926
+ <form method="POST" action="consent">
922
927
  <input type="hidden" name="transaction_id" value="${this.escapeHtml(transactionId)}">
923
928
  <div class="actions">
924
929
  <button type="submit" name="action" value="deny" class="deny">
@@ -3656,4 +3661,4 @@ Original error: ${error.message}`
3656
3661
 
3657
3662
 
3658
3663
  exports.withoutTrailingSlash = withoutTrailingSlash; exports.getAuthSession = getAuthSession; exports.requireAll = requireAll; exports.requireAny = requireAny; exports.requireAuth = requireAuth; exports.requireRole = requireRole; exports.requireScopes = requireScopes; exports.DEFAULT_ACCESS_TOKEN_TTL = DEFAULT_ACCESS_TOKEN_TTL; exports.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH = DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH; exports.DEFAULT_REFRESH_TOKEN_TTL = DEFAULT_REFRESH_TOKEN_TTL; exports.DEFAULT_AUTHORIZATION_CODE_TTL = DEFAULT_AUTHORIZATION_CODE_TTL; exports.DEFAULT_TRANSACTION_TTL = DEFAULT_TRANSACTION_TTL; exports.ConsentManager = ConsentManager; exports.JWTIssuer = JWTIssuer; exports.PKCEUtils = PKCEUtils; exports.EncryptedTokenStorage = EncryptedTokenStorage; exports.MemoryTokenStorage = MemoryTokenStorage; exports.OAuthProxy = OAuthProxy; exports.OAuthProxyError = OAuthProxyError; exports.AuthProvider = AuthProvider; exports.AzureProvider = AzureProvider; exports.GitHubProvider = GitHubProvider; exports.GoogleProvider = GoogleProvider; exports.OAuthProvider = OAuthProvider; exports.DiskStore = DiskStore; exports.JWKSVerifier = JWKSVerifier;
3659
- //# sourceMappingURL=chunk-XGRRYN5Y.cjs.map
3664
+ //# sourceMappingURL=chunk-2X4JCSQQ.cjs.map