@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
@@ -66,6 +66,11 @@ var isPlain = (value) => {
66
66
  };
67
67
 
68
68
  // src/toSdkSchema.ts
69
+ var SDK_TARGET = "draft-2020-12";
70
+ var LENIENT_OPTIONS = /* @__PURE__ */ new Map([
71
+ ["arktype", { fallback: (context) => context.base }],
72
+ ["zod", { unrepresentable: "any" }]
73
+ ]);
69
74
  var toSdkSchema = async (schema, io, convert) => {
70
75
  if (!schema) {
71
76
  return void 0;
@@ -74,16 +79,17 @@ var toSdkSchema = async (schema, io, convert) => {
74
79
  schema["~standard"]
75
80
  );
76
81
  if (standard.jsonSchema) {
77
- return { "~standard": standard };
82
+ const { json: json2, lenient } = nativeJsonSchema(
83
+ standard.jsonSchema,
84
+ standard.vendor,
85
+ io
86
+ );
87
+ assertDescribesArguments(json2, io);
88
+ return lenient ? advertising(standard, json2) : { "~standard": standard };
78
89
  }
79
90
  const json = await convert(schema, io);
80
- const advertised = io === "input" ? strictInputSchema(json) : json;
81
- return {
82
- "~standard": {
83
- ...standard,
84
- jsonSchema: { input: () => advertised, output: () => advertised }
85
- }
86
- };
91
+ assertDescribesArguments(json, io);
92
+ return advertising(standard, io === "input" ? strictInputSchema(json) : json);
87
93
  };
88
94
  var valibotToJsonSchema = async (schema, io) => {
89
95
  let converter;
@@ -99,6 +105,35 @@ var valibotToJsonSchema = async (schema, io) => {
99
105
  typeMode: io
100
106
  });
101
107
  };
108
+ var advertising = (standard, advertised) => ({
109
+ "~standard": {
110
+ ...standard,
111
+ jsonSchema: { input: () => advertised, output: () => advertised }
112
+ }
113
+ });
114
+ var assertDescribesArguments = (json, io) => {
115
+ if (io === "input" && json.type !== void 0 && json.type !== "object") {
116
+ throw new Error(
117
+ `A tool's arguments are an object, and this schema describes ${JSON.stringify(
118
+ json.type
119
+ )}. Wrap it in an object schema.`
120
+ );
121
+ }
122
+ };
123
+ var nativeJsonSchema = (native, vendor, io) => {
124
+ try {
125
+ return { json: native[io]({ target: SDK_TARGET }), lenient: false };
126
+ } catch (error) {
127
+ const libraryOptions = LENIENT_OPTIONS.get(vendor);
128
+ if (!libraryOptions) {
129
+ throw error;
130
+ }
131
+ return {
132
+ json: native[io]({ libraryOptions, target: SDK_TARGET }),
133
+ lenient: true
134
+ };
135
+ }
136
+ };
102
137
  var strictInputSchema = (schema) => ({
103
138
  ...schema,
104
139
  ...!(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(schema.allOf, () => ( schema.anyOf)), () => ( schema.oneOf)), () => ( schema.$ref))) && {
@@ -120,4 +155,4 @@ var strictInputSchema = (schema) => ({
120
155
 
121
156
 
122
157
  exports.formatBytes = formatBytes; exports.ownKeysOnly = ownKeysOnly; exports.toSdkSchema = toSdkSchema; exports.valibotToJsonSchema = valibotToJsonSchema;
123
- //# sourceMappingURL=chunk-DURXYPPR.cjs.map
158
+ //# sourceMappingURL=chunk-QPVEGWOL.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/server/server/dist/chunk-QPVEGWOL.cjs","../src/formatBytes.ts","../src/ownKeysOnly.ts","../src/toSdkSchema.ts"],"names":[],"mappings":"AAAA;ACCO,IAAM,YAAA,EAAc,CAAC,KAAA,EAAA,GAA0B;AACpD,EAAA,GAAA,CAAI,MAAA,GAAS,KAAA,EAAO,KAAA,GAAQ,MAAA,EAAA,CAAS,KAAA,EAAO,IAAA,EAAA,IAAU,CAAA,EAAG;AACvD,IAAA,OAAO,CAAA,EAAA;AACT,EAAA;AAEI,EAAA;AACK,IAAA;AACT,EAAA;AAEU,EAAA;AACZ;ADDY;AACA;AEMC;AACL,EAAA;AAEC,EAAA;AACE,IAAA;AACF,MAAA;AACH,MAAA;AACF,IAAA;AACD,EAAA;AACH;AAkBa;AAGR,EAAA;AACO,EAAA;AACF,IAAA;AACA,IAAA;AAED,IAAA;AACH,MAAA;AACF,IAAA;AAEO,IAAA;AACT,EAAA;AACF;AAQM;AAIC,EAAA;AACI,IAAA;AACT,EAAA;AAEM,EAAA;AAEF,EAAA;AACK,IAAA;AACT,EAAA;AAEM,EAAA;AAIC,EAAA;AAEP,EAAA;AACU,IAAA;AACV,EAAA;AAEO,EAAA;AACT;AAMM;AAKC,EAAA;AACH,IAAA;AACF,EAAA;AAES,EAAA;AAEL,EAAA;AACK,IAAA;AACT,EAAA;AAEA,EAAA;AACE,IAAA;AACF,EAAA;AACF;AAMM;AACA,EAAA;AACK,IAAA;AACT,EAAA;AAEM,EAAA;AAGJ,EAAA;AAEJ;AFjEY;AACA;AGvCN;AAWA;AACH,EAAA;AACS,EAAA;AACX;AA8BY;AAKN,EAAA;AACI,IAAA;AACT,EAAA;AAEM,EAAA;AAOF,IAAA;AACJ,EAAA;AAEI,EAAA;AACM,IAAA;AACN,MAAA;AACA,MAAA;AACA,MAAA;AACF,IAAA;AAEA,IAAA;AAEO,IAAA;AACT,EAAA;AAEM,EAAA;AAEN,EAAA;AAEO,EAAA;AACT;AAgBa;AACP,EAAA;AAEA,EAAA;AACF,IAAA;AACM,EAAA;AACA,IAAA;AACJ,MAAA;AAEF,IAAA;AACF,EAAA;AAEO,EAAA;AACL,IAAA;AACA,IAAA;AACD,EAAA;AACH;AAGM;AAIJ,EAAA;AACK,IAAA;AACH,IAAA;AACF,EAAA;AACF;AAQM;AAIA,EAAA;AACI,IAAA;AACJ,MAAA;AACE,QAAA;AACD,MAAA;AACH,IAAA;AACF,EAAA;AACF;AAMM;AAKA,EAAA;AACK,IAAA;AACA,EAAA;AACD,IAAA;AAED,IAAA;AACG,MAAA;AACR,IAAA;AAEO,IAAA;AACC,MAAA;AACN,MAAA;AACF,IAAA;AACF,EAAA;AACF;AAeM;AACD,EAAA;AACG,EAAA;AACJ,IAAA;AAIF,EAAA;AACW,EAAA;AACT,IAAA;AACE,MAAA;AACE,QAAA;AACA,QAAA;AAGD,MAAA;AACH,IAAA;AACF,EAAA;AACF;AH9EY;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/server/server/dist/chunk-QPVEGWOL.cjs","sourcesContent":[null,"/** Renders a byte cap the way the error message should read (e.g. \"1 MiB\"). */\nexport const formatBytes = (bytes: number): string => {\n if (bytes >= 1024 * 1024 && bytes % (1024 * 1024) === 0) {\n return `${bytes / (1024 * 1024)} MiB`;\n }\n\n if (bytes >= 1024 && bytes % 1024 === 0) {\n return `${bytes / 1024} KiB`;\n }\n\n return `${bytes} bytes`;\n};\n","import type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\n/**\n * Has `schema` validate by own keys only — see `withOwnKeysOnly` — by\n * replacing its `~standard` in place. The schema keeps its `shape`, which the\n * SDK reads to complete an argument, and its JSON Schema, which `prompts/list`\n * is built from.\n *\n * For the argument schemas `ViteMCP` and `EdgeViteMCP` build for their\n * prompts. A tool's schemas belong to whoever wrote the tool, so\n * `toSdkSchema` wraps them instead.\n *\n * An argument map the request left out validates as an empty one, as the SDK\n * already arranges for a tool's. `prompts/get` may omit `arguments`, and the\n * SDK validates the map as it was sent, so a prompt whose arguments are all\n * optional refused the request as \"expected object, received undefined\".\n */\nexport const ownKeysOnly = <S extends StandardSchemaV1>(schema: S): S => {\n const standard = withOwnKeysOnly(schema[\"~standard\"]);\n\n return Object.defineProperty(schema, \"~standard\", {\n value: {\n ...standard,\n validate: (value: unknown) => standard.validate(value ?? {}),\n },\n });\n};\n\n/**\n * `standard`, with a `validate` that sees only the keys an object has of its\n * own.\n *\n * Zod and Valibot look each key up with `in` and read it with `[]`, and both\n * walk the prototype chain, so a key that was left out reads as present when\n * `Object.prototype` has a member by that name. An optional argument called\n * `toString`, `constructor` or `valueOf`, at any depth, failed every request\n * that left it out, as \"expected string, received function\", and a required\n * one was reported as the wrong type instead of as missing. Validating a copy\n * whose objects have no prototype leaves the library nothing to inherit.\n *\n * A library that hands its input back, as ArkType and `jsonSchemaAdapter` do,\n * hands back the copy, so the copied objects get their prototype back before\n * the value goes on: `execute` still receives ordinary objects.\n */\nexport const withOwnKeysOnly = <P extends StandardSchemaV1.Props>(\n standard: P,\n): P => ({\n ...standard,\n validate: async (value: unknown) => {\n const copies = new Map<object, object>();\n const result = await standard.validate(withoutPrototypes(value, copies));\n\n if (!result.issues && copies.size > 0) {\n restorePrototypes(result.value, new Set(copies.values()), new Set());\n }\n\n return result;\n },\n});\n\n/**\n * `value`, with each plain object in it, at any depth, copied onto one without\n * a prototype, and each array copied to reach them. `copies` maps every\n * original to its copy, so one that occurs twice, or inside itself, is copied\n * once.\n */\nconst withoutPrototypes = (\n value: unknown,\n copies: Map<object, object>,\n): unknown => {\n if (!isPlain(value)) {\n return value;\n }\n\n const existing = copies.get(value);\n\n if (existing) {\n return existing;\n }\n\n const copy: Record<string, unknown> = Array.isArray(value)\n ? []\n : Object.create(null);\n\n copies.set(value, copy);\n\n for (const [key, item] of Object.entries(value)) {\n copy[key] = withoutPrototypes(item, copies);\n }\n\n return copy;\n};\n\n/**\n * Gives each object copy in `copies` that `value` holds, at any depth,\n * `Object.prototype` back.\n */\nconst restorePrototypes = (\n value: unknown,\n copies: Set<object>,\n seen: Set<object>,\n): void => {\n if (!isPlain(value) || seen.has(value)) {\n return;\n }\n\n seen.add(value);\n\n if (copies.has(value) && !Array.isArray(value)) {\n Object.setPrototypeOf(value, Object.prototype);\n }\n\n for (const item of Object.values(value)) {\n restorePrototypes(item, copies, seen);\n }\n};\n\n/**\n * An array, or an object made by a literal or without a prototype: what JSON\n * parses to, and the only kinds of object that are copied.\n */\nconst isPlain = (value: unknown): value is Record<string, unknown> => {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const prototype: unknown = Object.getPrototypeOf(value);\n\n return (\n Array.isArray(value) || prototype === Object.prototype || prototype === null\n );\n};\n","import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type { JsonSchema } from \"xsschema\";\n\nimport { withOwnKeysOnly } from \"./ownKeysOnly.js\";\n\n/**\n * Turns a Standard Schema that carries no JSON Schema into one. Which\n * libraries that can be done for depends on the runtime, so each entry point\n * supplies its own.\n */\nexport type JsonSchemaConverter = (\n schema: StandardSchemaV1,\n io: \"input\" | \"output\",\n) => Promise<JsonSchema>;\n\n/**\n * `~standard.jsonSchema`, as Zod v4 and ArkType implement it. Declared here\n * because `@standard-schema/spec` 1.0 predates it.\n */\ntype NativeJsonSchema = Record<\n \"input\" | \"output\",\n (options: {\n libraryOptions?: Record<string, unknown>;\n target: string;\n }) => JsonSchema\n>;\n\n/** The draft the SDK asks a schema for when `tools/list` describes a tool. */\nconst SDK_TARGET = \"draft-2020-12\";\n\n/**\n * What a library is told so that it leaves open the parts of a schema JSON\n * Schema cannot say, rather than refuse the schema over them. Zod describes\n * such a part as `{}`. ArkType hands over what it had worked out before it\n * reached the part: `{}` for a `Date`, `{ type: \"string\" }` for a string under\n * a `narrow()`.\n *\n * A library not named here is left to refuse, and its tool is not served.\n */\nconst LENIENT_OPTIONS = new Map<string, Record<string, unknown>>([\n [\"arktype\", { fallback: (context: { base: JsonSchema }) => context.base }],\n [\"zod\", { unrepresentable: \"any\" }],\n]);\n\n/**\n * A tool's schema as the SDK registers it: one that validates by own keys only\n * (see `withOwnKeysOnly`) and carries a JSON Schema. The schema itself is left\n * as it was, since whoever wrote it may use it elsewhere.\n *\n * Zod v4 and ArkType emit JSON Schema natively, and theirs is kept; anything\n * else (Valibot, say) is converted, and the conversion is only what\n * `tools/list` advertises. Validation stays with the library the schema was\n * written in: the conversion drops what JSON Schema cannot say — a transform,\n * a `check()` — so validating against it instead would pass `execute`\n * arguments the schema never produced.\n *\n * A native schema is converted here too, once, the way the SDK will for\n * `tools/list`. The SDK converts every tool in the one handler, so a schema\n * its library refused to convert — a `z.date()`, a `z.bigint()`, an ArkType\n * `narrow()` — failed the list for every tool, though each could still be\n * called. One refused is asked for again with what JSON Schema cannot say left\n * open (see `LENIENT_OPTIONS`), which is what Valibot's converter is already\n * told, and that copy is advertised in place of the library's own.\n *\n * Converted inputs are closed with `strictInputSchema`. Outputs are left as\n * converted, since closing them would misdescribe results the schema allows.\n *\n * Shared by `ViteMCP` and `EdgeViteMCP`, so what a tool advertises does not\n * depend on which of them serves it. Rejects when `convert` does, when a\n * library refuses a schema even leniently, and for an input schema that does\n * not describe an object: each caller leaves that tool out and serves the rest.\n */\nexport const toSdkSchema = async (\n schema: unknown,\n io: \"input\" | \"output\",\n convert: JsonSchemaConverter,\n): Promise<unknown> => {\n if (!schema) {\n return undefined;\n }\n\n const standard = withOwnKeysOnly(\n (\n schema as {\n \"~standard\": {\n jsonSchema?: NativeJsonSchema;\n } & StandardSchemaV1.Props;\n }\n )[\"~standard\"],\n );\n\n if (standard.jsonSchema) {\n const { json, lenient } = nativeJsonSchema(\n standard.jsonSchema,\n standard.vendor,\n io,\n );\n\n assertDescribesArguments(json, io);\n\n return lenient ? advertising(standard, json) : { \"~standard\": standard };\n }\n\n const json = await convert(schema as StandardSchemaV1, io);\n\n assertDescribesArguments(json, io);\n\n return advertising(standard, io === \"input\" ? strictInputSchema(json) : json);\n};\n\n/**\n * JSON Schema for a Valibot schema, for advertising.\n *\n * Valibot's converter is called directly so it can be told to skip what JSON\n * Schema cannot express — a transform, a `check()` — rather than refuse the\n * whole schema. Valibot still validates, so the copy only has to describe what\n * a caller sends (`typeMode: \"input\"`, which stops at the first transform) or\n * receives (`\"output\"`).\n *\n * The `import()` has to stay inside the `try`. An edge bundle is built with\n * every import resolved ahead of time, and a bundler fails the build over one\n * it cannot resolve — unless it can see the failure is handled, in which case\n * a server that never touches Valibot builds without the converter installed.\n */\nexport const valibotToJsonSchema: JsonSchemaConverter = async (schema, io) => {\n let converter;\n\n try {\n converter = await import(\"@valibot/to-json-schema\");\n } catch {\n throw new Error(\n 'The \"@valibot/to-json-schema\" package is required to describe Valibot ' +\n \"schemas. Install it with: npm install @valibot/to-json-schema\",\n );\n }\n\n return converter.toJsonSchema(schema as never, {\n errorMode: \"ignore\",\n typeMode: io,\n }) as JsonSchema;\n};\n\n/** `standard`, carrying `advertised` as its JSON Schema, input and output. */\nconst advertising = <P extends StandardSchemaV1.Props>(\n standard: P,\n advertised: JsonSchema,\n) => ({\n \"~standard\": {\n ...standard,\n jsonSchema: { input: () => advertised, output: () => advertised },\n },\n});\n\n/**\n * Refuses an input schema that describes anything but an object. A tool's\n * arguments are always one, and the SDK will not list a schema that says\n * otherwise: `parameters: z.string()` failed `tools/list` for every tool, as an\n * unconvertible schema did.\n */\nconst assertDescribesArguments = (\n json: JsonSchema,\n io: \"input\" | \"output\",\n): void => {\n if (io === \"input\" && json.type !== undefined && json.type !== \"object\") {\n throw new Error(\n `A tool's arguments are an object, and this schema describes ${JSON.stringify(\n json.type,\n )}. Wrap it in an object schema.`,\n );\n }\n};\n\n/**\n * A schema's own JSON Schema, and whether it had to be asked for leniently.\n * Throws what the library does when it refuses the schema either way.\n */\nconst nativeJsonSchema = (\n native: NativeJsonSchema,\n vendor: string,\n io: \"input\" | \"output\",\n): { json: JsonSchema; lenient: boolean } => {\n try {\n return { json: native[io]({ target: SDK_TARGET }), lenient: false };\n } catch (error) {\n const libraryOptions = LENIENT_OPTIONS.get(vendor);\n\n if (!libraryOptions) {\n throw error;\n }\n\n return {\n json: native[io]({ libraryOptions, target: SDK_TARGET }),\n lenient: true,\n };\n }\n};\n\n/**\n * Closes an advertised input schema's objects to undeclared keys, except where\n * the schema describes those keys itself. A record's value schema, or an\n * object's rest schema, arrives as `additionalProperties`; replacing it with\n * `false` would tell clients the tool takes none of those keys, so a\n * `v.record()` argument could only ever be sent as `{}`.\n *\n * Nor is an object closed whose keys are declared elsewhere: in its `allOf`,\n * `anyOf` or `oneOf` branches — a `v.intersect()`, `v.union()` or\n * `v.variant()` — or behind a `$ref`, which is how a `v.lazy()` arrives.\n * `additionalProperties` sees only the `properties` beside it, so closing one\n * refused every key declared elsewhere, and every argument with them.\n */\nconst strictInputSchema = (schema: JsonSchema): JsonSchema => ({\n ...schema,\n ...(!(schema.allOf ?? schema.anyOf ?? schema.oneOf ?? schema.$ref) && {\n additionalProperties:\n typeof schema.additionalProperties === \"object\"\n ? schema.additionalProperties\n : false,\n }),\n ...(schema.properties && {\n properties: Object.fromEntries(\n Object.entries(schema.properties).map(([key, value]) => [\n key,\n typeof value === \"object\" && value.type === \"object\"\n ? strictInputSchema(value)\n : value,\n ]),\n ),\n }),\n});\n"]}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  withoutTrailingSlash
3
- } from "./chunk-ZVK5GKEO.js";
3
+ } from "./chunk-NZ34AKP4.js";
4
4
  import {
5
5
  formatBytes,
6
6
  ownKeysOnly,
7
7
  toSdkSchema,
8
8
  valibotToJsonSchema
9
- } from "./chunk-TYR2KJIV.js";
9
+ } from "./chunk-JMDI672G.js";
10
10
 
11
11
  // src/ViteMCP.ts
12
12
  import {
@@ -52,6 +52,12 @@ var errorResponse = (error) => {
52
52
  status: err.statusCode ?? 400
53
53
  };
54
54
  };
55
+ var browserErrorResponse = (error) => {
56
+ if (typeof error?.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) {
@@ -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
 
@@ -1674,4 +1688,4 @@ export {
1674
1688
  ServerState,
1675
1689
  ViteMCP
1676
1690
  };
1677
- //# sourceMappingURL=chunk-UVKIOOZA.js.map
1691
+ //# sourceMappingURL=chunk-WBP37JPX.js.map