Unverified Commit 73e89d9f authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

Replace deprecated `moduleResolution: "node"` (#92654)

parent 30b305e2
...@@ -351,7 +351,10 @@ ...@@ -351,7 +351,10 @@
"minizlib@3.1.0": "patches/minizlib@3.1.0.patch", "minizlib@3.1.0": "patches/minizlib@3.1.0.patch",
"http-proxy@1.18.1": "patches/http-proxy@1.18.1.patch", "http-proxy@1.18.1": "patches/http-proxy@1.18.1.patch",
"web-vitals@4.2.1": "patches/web-vitals@4.2.1.patch", "web-vitals@4.2.1": "patches/web-vitals@4.2.1.patch",
"@rspack/core@1.6.7": "patches/@rspack__core@1.6.7.patch" "@rspack/core@1.6.7": "patches/@rspack__core@1.6.7.patch",
"@modelcontextprotocol/sdk": "patches/@modelcontextprotocol__sdk.patch",
"@vercel/blob": "patches/@vercel__blob.patch",
"postcss-scss": "patches/postcss-scss.patch"
} }
} }
} }
{ {
"compilerOptions": { "compilerOptions": {
"target": "es2015", "target": "es2015",
"moduleResolution": "node", "module": "ESNext",
"ignoreDeprecations": "6.0", "moduleResolution": "bundler",
"strict": true, "strict": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
......
{ {
"compilerOptions": { "compilerOptions": {
"target": "es2022", "target": "es2022",
"moduleResolution": "node", "module": "ESNext",
"ignoreDeprecations": "6.0", "moduleResolution": "bundler",
"strict": true, "strict": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
......
...@@ -63,7 +63,7 @@ export async function lazyPostCSS( ...@@ -63,7 +63,7 @@ export async function lazyPostCSS(
) { ) {
if (!postcssInstancePromise) { if (!postcssInstancePromise) {
postcssInstancePromise = (async () => { postcssInstancePromise = (async () => {
const postcss = require('postcss') as typeof import('postcss') const postcss = require('postcss') as typeof import('postcss').default
// @ts-ignore backwards compat // @ts-ignore backwards compat
postcss.plugin = function postcssPlugin(name, initializer) { postcss.plugin = function postcssPlugin(name, initializer) {
function creator(...args: any) { function creator(...args: any) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
(()=>{"use strict";var e={142:e=>{e.exports=require("next/dist/compiled/content-type")},238:e=>{e.exports=require("next/dist/compiled/raw-body")},788:e=>{e.exports=require("next/dist/compiled/zod")},5:e=>{e.exports=require("node:crypto")},685:function(e,t,s){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.StreamableHTTPServerTransport=void 0;const a=s(383);const i=o(s(238));const n=o(s(142));const r=s(5);const c="4mb";class StreamableHTTPServerTransport{constructor(e){var t,s;this._started=false;this._streamMapping=new Map;this._requestToStreamMapping=new Map;this._requestResponseMap=new Map;this._initialized=false;this._enableJsonResponse=false;this._standaloneSseStreamId="_GET_stream";this.sessionIdGenerator=e.sessionIdGenerator;this._enableJsonResponse=(t=e.enableJsonResponse)!==null&&t!==void 0?t:false;this._eventStore=e.eventStore;this._onsessioninitialized=e.onsessioninitialized;this._onsessionclosed=e.onsessionclosed;this._allowedHosts=e.allowedHosts;this._allowedOrigins=e.allowedOrigins;this._enableDnsRebindingProtection=(s=e.enableDnsRebindingProtection)!==null&&s!==void 0?s:false}async start(){if(this._started){throw new Error("Transport already started")}this._started=true}validateRequestHeaders(e){if(!this._enableDnsRebindingProtection){return undefined}if(this._allowedHosts&&this._allowedHosts.length>0){const t=e.headers.host;if(!t||!this._allowedHosts.includes(t)){return`Invalid Host header: ${t}`}}if(this._allowedOrigins&&this._allowedOrigins.length>0){const t=e.headers.origin;if(!t||!this._allowedOrigins.includes(t)){return`Invalid Origin header: ${t}`}}return undefined}async handleRequest(e,t,s){var o;const a=this.validateRequestHeaders(e);if(a){t.writeHead(403).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:a},id:null}));(o=this.onerror)===null||o===void 0?void 0:o.call(this,new Error(a));return}if(e.method==="POST"){await this.handlePostRequest(e,t,s)}else if(e.method==="GET"){await this.handleGetRequest(e,t)}else if(e.method==="DELETE"){await this.handleDeleteRequest(e,t)}else{await this.handleUnsupportedRequest(t)}}async handleGetRequest(e,t){const s=e.headers.accept;if(!(s===null||s===void 0?void 0:s.includes("text/event-stream"))){t.writeHead(406).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Not Acceptable: Client must accept text/event-stream"},id:null}));return}if(!this.validateSession(e,t)){return}if(!this.validateProtocolVersion(e,t)){return}if(this._eventStore){const s=e.headers["last-event-id"];if(s){await this.replayEvents(s,t);return}}const o={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};if(this.sessionId!==undefined){o["mcp-session-id"]=this.sessionId}if(this._streamMapping.get(this._standaloneSseStreamId)!==undefined){t.writeHead(409).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Conflict: Only one SSE stream is allowed per session"},id:null}));return}t.writeHead(200,o).flushHeaders();this._streamMapping.set(this._standaloneSseStreamId,t);t.on("close",(()=>{this._streamMapping.delete(this._standaloneSseStreamId)}));t.on("error",(e=>{var t;(t=this.onerror)===null||t===void 0?void 0:t.call(this,e)}))}async replayEvents(e,t){var s,o;if(!this._eventStore){return}try{const o={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};if(this.sessionId!==undefined){o["mcp-session-id"]=this.sessionId}t.writeHead(200,o).flushHeaders();const a=await((s=this._eventStore)===null||s===void 0?void 0:s.replayEventsAfter(e,{send:async(e,s)=>{var o;if(!this.writeSSEEvent(t,s,e)){(o=this.onerror)===null||o===void 0?void 0:o.call(this,new Error("Failed replay events"));t.end()}}}));this._streamMapping.set(a,t);t.on("error",(e=>{var t;(t=this.onerror)===null||t===void 0?void 0:t.call(this,e)}))}catch(e){(o=this.onerror)===null||o===void 0?void 0:o.call(this,e)}}writeSSEEvent(e,t,s){let o=`event: message\n`;if(s){o+=`id: ${s}\n`}o+=`data: ${JSON.stringify(t)}\n\n`;return e.write(o)}async handleUnsupportedRequest(e){e.writeHead(405,{Allow:"GET, POST, DELETE"}).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}))}async handlePostRequest(e,t,s){var o,l,h,m,u;try{const u=e.headers.accept;if(!(u===null||u===void 0?void 0:u.includes("application/json"))||!u.includes("text/event-stream")){t.writeHead(406).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Not Acceptable: Client must accept both application/json and text/event-stream"},id:null}));return}const d=e.headers["content-type"];if(!d||!d.includes("application/json")){t.writeHead(415).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Unsupported Media Type: Content-Type must be application/json"},id:null}));return}const S=e.auth;const p={headers:e.headers};let z;if(s!==undefined){z=s}else{const t=n.default.parse(d);const s=await(0,i.default)(e,{limit:c,encoding:(o=t.parameters.charset)!==null&&o!==void 0?o:"utf-8"});z=JSON.parse(s.toString())}let R;if(Array.isArray(z)){R=z.map((e=>a.JSONRPCMessageSchema.parse(e)))}else{R=[a.JSONRPCMessageSchema.parse(z)]}const g=R.some(a.isInitializeRequest);if(g){if(this._initialized&&this.sessionId!==undefined){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Server already initialized"},id:null}));return}if(R.length>1){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Only one initialization request is allowed"},id:null}));return}this.sessionId=(l=this.sessionIdGenerator)===null||l===void 0?void 0:l.call(this);this._initialized=true;if(this.sessionId&&this._onsessioninitialized){await Promise.resolve(this._onsessioninitialized(this.sessionId))}}if(!g){if(!this.validateSession(e,t)){return}if(!this.validateProtocolVersion(e,t)){return}}const f=R.some(a.isJSONRPCRequest);if(!f){t.writeHead(202).end();for(const e of R){(h=this.onmessage)===null||h===void 0?void 0:h.call(this,e,{authInfo:S,requestInfo:p})}}else if(f){const e=(0,r.randomUUID)();if(!this._enableJsonResponse){const e={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};if(this.sessionId!==undefined){e["mcp-session-id"]=this.sessionId}t.writeHead(200,e)}for(const s of R){if((0,a.isJSONRPCRequest)(s)){this._streamMapping.set(e,t);this._requestToStreamMapping.set(s.id,e)}}t.on("close",(()=>{this._streamMapping.delete(e)}));t.on("error",(e=>{var t;(t=this.onerror)===null||t===void 0?void 0:t.call(this,e)}));for(const e of R){(m=this.onmessage)===null||m===void 0?void 0:m.call(this,e,{authInfo:S,requestInfo:p})}}}catch(e){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32700,message:"Parse error",data:String(e)},id:null}));(u=this.onerror)===null||u===void 0?void 0:u.call(this,e)}}async handleDeleteRequest(e,t){var s;if(!this.validateSession(e,t)){return}if(!this.validateProtocolVersion(e,t)){return}await Promise.resolve((s=this._onsessionclosed)===null||s===void 0?void 0:s.call(this,this.sessionId));await this.close();t.writeHead(200).end()}validateSession(e,t){if(this.sessionIdGenerator===undefined){return true}if(!this._initialized){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Server not initialized"},id:null}));return false}const s=e.headers["mcp-session-id"];if(!s){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header is required"},id:null}));return false}else if(Array.isArray(s)){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header must be a single value"},id:null}));return false}else if(s!==this.sessionId){t.writeHead(404).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32001,message:"Session not found"},id:null}));return false}return true}validateProtocolVersion(e,t){var s;let o=(s=e.headers["mcp-protocol-version"])!==null&&s!==void 0?s:a.DEFAULT_NEGOTIATED_PROTOCOL_VERSION;if(Array.isArray(o)){o=o[o.length-1]}if(!a.SUPPORTED_PROTOCOL_VERSIONS.includes(o)){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:`Bad Request: Unsupported protocol version (supported versions: ${a.SUPPORTED_PROTOCOL_VERSIONS.join(", ")})`},id:null}));return false}return true}async close(){var e;this._streamMapping.forEach((e=>{e.end()}));this._streamMapping.clear();this._requestResponseMap.clear();(e=this.onclose)===null||e===void 0?void 0:e.call(this)}async send(e,t){let s=t===null||t===void 0?void 0:t.relatedRequestId;if((0,a.isJSONRPCResponse)(e)||(0,a.isJSONRPCError)(e)){s=e.id}if(s===undefined){if((0,a.isJSONRPCResponse)(e)||(0,a.isJSONRPCError)(e)){throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request")}const t=this._streamMapping.get(this._standaloneSseStreamId);if(t===undefined){return}let s;if(this._eventStore){s=await this._eventStore.storeEvent(this._standaloneSseStreamId,e)}this.writeSSEEvent(t,e,s);return}const o=this._requestToStreamMapping.get(s);const i=this._streamMapping.get(o);if(!o){throw new Error(`No connection established for request ID: ${String(s)}`)}if(!this._enableJsonResponse){let t;if(this._eventStore){t=await this._eventStore.storeEvent(o,e)}if(i){this.writeSSEEvent(i,e,t)}}if((0,a.isJSONRPCResponse)(e)||(0,a.isJSONRPCError)(e)){this._requestResponseMap.set(s,e);const t=Array.from(this._requestToStreamMapping.entries()).filter((([e,t])=>this._streamMapping.get(t)===i)).map((([e])=>e));const o=t.every((e=>this._requestResponseMap.has(e)));if(o){if(!i){throw new Error(`No connection established for request ID: ${String(s)}`)}if(this._enableJsonResponse){const e={"Content-Type":"application/json"};if(this.sessionId!==undefined){e["mcp-session-id"]=this.sessionId}const s=t.map((e=>this._requestResponseMap.get(e)));i.writeHead(200,e);if(s.length===1){i.end(JSON.stringify(s[0]))}else{i.end(JSON.stringify(s))}}else{i.end()}for(const e of t){this._requestResponseMap.delete(e);this._requestToStreamMapping.delete(e)}}}}}t.StreamableHTTPServerTransport=StreamableHTTPServerTransport},383:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:true});t.SubscribeRequestSchema=t.ResourceListChangedNotificationSchema=t.ReadResourceResultSchema=t.ReadResourceRequestSchema=t.ListResourceTemplatesResultSchema=t.ListResourceTemplatesRequestSchema=t.ListResourcesResultSchema=t.ListResourcesRequestSchema=t.ResourceTemplateSchema=t.ResourceSchema=t.BlobResourceContentsSchema=t.TextResourceContentsSchema=t.ResourceContentsSchema=t.PaginatedResultSchema=t.PaginatedRequestSchema=t.ProgressNotificationSchema=t.ProgressSchema=t.PingRequestSchema=t.isInitializedNotification=t.InitializedNotificationSchema=t.InitializeResultSchema=t.ServerCapabilitiesSchema=t.isInitializeRequest=t.InitializeRequestSchema=t.ClientCapabilitiesSchema=t.ImplementationSchema=t.BaseMetadataSchema=t.IconSchema=t.CancelledNotificationSchema=t.EmptyResultSchema=t.JSONRPCMessageSchema=t.isJSONRPCError=t.JSONRPCErrorSchema=t.ErrorCode=t.isJSONRPCResponse=t.JSONRPCResponseSchema=t.isJSONRPCNotification=t.JSONRPCNotificationSchema=t.isJSONRPCRequest=t.JSONRPCRequestSchema=t.RequestIdSchema=t.ResultSchema=t.NotificationSchema=t.RequestSchema=t.CursorSchema=t.ProgressTokenSchema=t.JSONRPC_VERSION=t.SUPPORTED_PROTOCOL_VERSIONS=t.DEFAULT_NEGOTIATED_PROTOCOL_VERSION=t.LATEST_PROTOCOL_VERSION=void 0;t.ClientNotificationSchema=t.ClientRequestSchema=t.RootsListChangedNotificationSchema=t.ListRootsResultSchema=t.ListRootsRequestSchema=t.RootSchema=t.CompleteResultSchema=t.CompleteRequestSchema=t.PromptReferenceSchema=t.ResourceReferenceSchema=t.ResourceTemplateReferenceSchema=t.ElicitResultSchema=t.ElicitRequestSchema=t.PrimitiveSchemaDefinitionSchema=t.EnumSchemaSchema=t.NumberSchemaSchema=t.StringSchemaSchema=t.BooleanSchemaSchema=t.CreateMessageResultSchema=t.CreateMessageRequestSchema=t.SamplingMessageSchema=t.ModelPreferencesSchema=t.ModelHintSchema=t.LoggingMessageNotificationSchema=t.SetLevelRequestSchema=t.LoggingLevelSchema=t.ToolListChangedNotificationSchema=t.CallToolRequestSchema=t.CompatibilityCallToolResultSchema=t.CallToolResultSchema=t.ListToolsResultSchema=t.ListToolsRequestSchema=t.ToolSchema=t.ToolAnnotationsSchema=t.PromptListChangedNotificationSchema=t.GetPromptResultSchema=t.PromptMessageSchema=t.ContentBlockSchema=t.ResourceLinkSchema=t.EmbeddedResourceSchema=t.AudioContentSchema=t.ImageContentSchema=t.TextContentSchema=t.GetPromptRequestSchema=t.ListPromptsResultSchema=t.ListPromptsRequestSchema=t.PromptSchema=t.PromptArgumentSchema=t.ResourceUpdatedNotificationSchema=t.UnsubscribeRequestSchema=void 0;t.McpError=t.ServerResultSchema=t.ServerNotificationSchema=t.ServerRequestSchema=t.ClientResultSchema=void 0;const o=s(788);t.LATEST_PROTOCOL_VERSION="2025-06-18";t.DEFAULT_NEGOTIATED_PROTOCOL_VERSION="2025-03-26";t.SUPPORTED_PROTOCOL_VERSIONS=[t.LATEST_PROTOCOL_VERSION,"2025-03-26","2024-11-05","2024-10-07"];t.JSONRPC_VERSION="2.0";t.ProgressTokenSchema=o.z.union([o.z.string(),o.z.number().int()]);t.CursorSchema=o.z.string();const a=o.z.object({progressToken:o.z.optional(t.ProgressTokenSchema)}).passthrough();const i=o.z.object({_meta:o.z.optional(a)}).passthrough();t.RequestSchema=o.z.object({method:o.z.string(),params:o.z.optional(i)});const n=o.z.object({_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.NotificationSchema=o.z.object({method:o.z.string(),params:o.z.optional(n)});t.ResultSchema=o.z.object({_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.RequestIdSchema=o.z.union([o.z.string(),o.z.number().int()]);t.JSONRPCRequestSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema}).merge(t.RequestSchema).strict();const isJSONRPCRequest=e=>t.JSONRPCRequestSchema.safeParse(e).success;t.isJSONRPCRequest=isJSONRPCRequest;t.JSONRPCNotificationSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION)}).merge(t.NotificationSchema).strict();const isJSONRPCNotification=e=>t.JSONRPCNotificationSchema.safeParse(e).success;t.isJSONRPCNotification=isJSONRPCNotification;t.JSONRPCResponseSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema,result:t.ResultSchema}).strict();const isJSONRPCResponse=e=>t.JSONRPCResponseSchema.safeParse(e).success;t.isJSONRPCResponse=isJSONRPCResponse;var r;(function(e){e[e["ConnectionClosed"]=-32e3]="ConnectionClosed";e[e["RequestTimeout"]=-32001]="RequestTimeout";e[e["ParseError"]=-32700]="ParseError";e[e["InvalidRequest"]=-32600]="InvalidRequest";e[e["MethodNotFound"]=-32601]="MethodNotFound";e[e["InvalidParams"]=-32602]="InvalidParams";e[e["InternalError"]=-32603]="InternalError"})(r||(t.ErrorCode=r={}));t.JSONRPCErrorSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema,error:o.z.object({code:o.z.number().int(),message:o.z.string(),data:o.z.optional(o.z.unknown())})}).strict();const isJSONRPCError=e=>t.JSONRPCErrorSchema.safeParse(e).success;t.isJSONRPCError=isJSONRPCError;t.JSONRPCMessageSchema=o.z.union([t.JSONRPCRequestSchema,t.JSONRPCNotificationSchema,t.JSONRPCResponseSchema,t.JSONRPCErrorSchema]);t.EmptyResultSchema=t.ResultSchema.strict();t.CancelledNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/cancelled"),params:n.extend({requestId:t.RequestIdSchema,reason:o.z.string().optional()})});t.IconSchema=o.z.object({src:o.z.string(),mimeType:o.z.optional(o.z.string()),sizes:o.z.optional(o.z.string())}).passthrough();t.BaseMetadataSchema=o.z.object({name:o.z.string(),title:o.z.optional(o.z.string())}).passthrough();t.ImplementationSchema=t.BaseMetadataSchema.extend({version:o.z.string(),websiteUrl:o.z.optional(o.z.string()),icons:o.z.optional(o.z.array(t.IconSchema))});t.ClientCapabilitiesSchema=o.z.object({experimental:o.z.optional(o.z.object({}).passthrough()),sampling:o.z.optional(o.z.object({}).passthrough()),elicitation:o.z.optional(o.z.object({}).passthrough()),roots:o.z.optional(o.z.object({listChanged:o.z.optional(o.z.boolean())}).passthrough())}).passthrough();t.InitializeRequestSchema=t.RequestSchema.extend({method:o.z.literal("initialize"),params:i.extend({protocolVersion:o.z.string(),capabilities:t.ClientCapabilitiesSchema,clientInfo:t.ImplementationSchema})});const isInitializeRequest=e=>t.InitializeRequestSchema.safeParse(e).success;t.isInitializeRequest=isInitializeRequest;t.ServerCapabilitiesSchema=o.z.object({experimental:o.z.optional(o.z.object({}).passthrough()),logging:o.z.optional(o.z.object({}).passthrough()),completions:o.z.optional(o.z.object({}).passthrough()),prompts:o.z.optional(o.z.object({listChanged:o.z.optional(o.z.boolean())}).passthrough()),resources:o.z.optional(o.z.object({subscribe:o.z.optional(o.z.boolean()),listChanged:o.z.optional(o.z.boolean())}).passthrough()),tools:o.z.optional(o.z.object({listChanged:o.z.optional(o.z.boolean())}).passthrough())}).passthrough();t.InitializeResultSchema=t.ResultSchema.extend({protocolVersion:o.z.string(),capabilities:t.ServerCapabilitiesSchema,serverInfo:t.ImplementationSchema,instructions:o.z.optional(o.z.string())});t.InitializedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/initialized")});const isInitializedNotification=e=>t.InitializedNotificationSchema.safeParse(e).success;t.isInitializedNotification=isInitializedNotification;t.PingRequestSchema=t.RequestSchema.extend({method:o.z.literal("ping")});t.ProgressSchema=o.z.object({progress:o.z.number(),total:o.z.optional(o.z.number()),message:o.z.optional(o.z.string())}).passthrough();t.ProgressNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/progress"),params:n.merge(t.ProgressSchema).extend({progressToken:t.ProgressTokenSchema})});t.PaginatedRequestSchema=t.RequestSchema.extend({params:i.extend({cursor:o.z.optional(t.CursorSchema)}).optional()});t.PaginatedResultSchema=t.ResultSchema.extend({nextCursor:o.z.optional(t.CursorSchema)});t.ResourceContentsSchema=o.z.object({uri:o.z.string(),mimeType:o.z.optional(o.z.string()),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.TextResourceContentsSchema=t.ResourceContentsSchema.extend({text:o.z.string()});const c=o.z.string().refine((e=>{try{atob(e);return true}catch(e){return false}}),{message:"Invalid Base64 string"});t.BlobResourceContentsSchema=t.ResourceContentsSchema.extend({blob:c});t.ResourceSchema=t.BaseMetadataSchema.extend({uri:o.z.string(),description:o.z.optional(o.z.string()),mimeType:o.z.optional(o.z.string()),icons:o.z.optional(o.z.array(t.IconSchema)),_meta:o.z.optional(o.z.object({}).passthrough())});t.ResourceTemplateSchema=t.BaseMetadataSchema.extend({uriTemplate:o.z.string(),description:o.z.optional(o.z.string()),mimeType:o.z.optional(o.z.string()),_meta:o.z.optional(o.z.object({}).passthrough())});t.ListResourcesRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("resources/list")});t.ListResourcesResultSchema=t.PaginatedResultSchema.extend({resources:o.z.array(t.ResourceSchema)});t.ListResourceTemplatesRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("resources/templates/list")});t.ListResourceTemplatesResultSchema=t.PaginatedResultSchema.extend({resourceTemplates:o.z.array(t.ResourceTemplateSchema)});t.ReadResourceRequestSchema=t.RequestSchema.extend({method:o.z.literal("resources/read"),params:i.extend({uri:o.z.string()})});t.ReadResourceResultSchema=t.ResultSchema.extend({contents:o.z.array(o.z.union([t.TextResourceContentsSchema,t.BlobResourceContentsSchema]))});t.ResourceListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/resources/list_changed")});t.SubscribeRequestSchema=t.RequestSchema.extend({method:o.z.literal("resources/subscribe"),params:i.extend({uri:o.z.string()})});t.UnsubscribeRequestSchema=t.RequestSchema.extend({method:o.z.literal("resources/unsubscribe"),params:i.extend({uri:o.z.string()})});t.ResourceUpdatedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/resources/updated"),params:n.extend({uri:o.z.string()})});t.PromptArgumentSchema=o.z.object({name:o.z.string(),description:o.z.optional(o.z.string()),required:o.z.optional(o.z.boolean())}).passthrough();t.PromptSchema=t.BaseMetadataSchema.extend({description:o.z.optional(o.z.string()),arguments:o.z.optional(o.z.array(t.PromptArgumentSchema)),icons:o.z.optional(o.z.array(t.IconSchema)),_meta:o.z.optional(o.z.object({}).passthrough())});t.ListPromptsRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("prompts/list")});t.ListPromptsResultSchema=t.PaginatedResultSchema.extend({prompts:o.z.array(t.PromptSchema)});t.GetPromptRequestSchema=t.RequestSchema.extend({method:o.z.literal("prompts/get"),params:i.extend({name:o.z.string(),arguments:o.z.optional(o.z.record(o.z.string()))})});t.TextContentSchema=o.z.object({type:o.z.literal("text"),text:o.z.string(),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.ImageContentSchema=o.z.object({type:o.z.literal("image"),data:c,mimeType:o.z.string(),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.AudioContentSchema=o.z.object({type:o.z.literal("audio"),data:c,mimeType:o.z.string(),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.EmbeddedResourceSchema=o.z.object({type:o.z.literal("resource"),resource:o.z.union([t.TextResourceContentsSchema,t.BlobResourceContentsSchema]),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.ResourceLinkSchema=t.ResourceSchema.extend({type:o.z.literal("resource_link")});t.ContentBlockSchema=o.z.union([t.TextContentSchema,t.ImageContentSchema,t.AudioContentSchema,t.ResourceLinkSchema,t.EmbeddedResourceSchema]);t.PromptMessageSchema=o.z.object({role:o.z.enum(["user","assistant"]),content:t.ContentBlockSchema}).passthrough();t.GetPromptResultSchema=t.ResultSchema.extend({description:o.z.optional(o.z.string()),messages:o.z.array(t.PromptMessageSchema)});t.PromptListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/prompts/list_changed")});t.ToolAnnotationsSchema=o.z.object({title:o.z.optional(o.z.string()),readOnlyHint:o.z.optional(o.z.boolean()),destructiveHint:o.z.optional(o.z.boolean()),idempotentHint:o.z.optional(o.z.boolean()),openWorldHint:o.z.optional(o.z.boolean())}).passthrough();t.ToolSchema=t.BaseMetadataSchema.extend({description:o.z.optional(o.z.string()),inputSchema:o.z.object({type:o.z.literal("object"),properties:o.z.optional(o.z.object({}).passthrough()),required:o.z.optional(o.z.array(o.z.string()))}).passthrough(),outputSchema:o.z.optional(o.z.object({type:o.z.literal("object"),properties:o.z.optional(o.z.object({}).passthrough()),required:o.z.optional(o.z.array(o.z.string()))}).passthrough()),annotations:o.z.optional(t.ToolAnnotationsSchema),icons:o.z.optional(o.z.array(t.IconSchema)),_meta:o.z.optional(o.z.object({}).passthrough())});t.ListToolsRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("tools/list")});t.ListToolsResultSchema=t.PaginatedResultSchema.extend({tools:o.z.array(t.ToolSchema)});t.CallToolResultSchema=t.ResultSchema.extend({content:o.z.array(t.ContentBlockSchema).default([]),structuredContent:o.z.object({}).passthrough().optional(),isError:o.z.optional(o.z.boolean())});t.CompatibilityCallToolResultSchema=t.CallToolResultSchema.or(t.ResultSchema.extend({toolResult:o.z.unknown()}));t.CallToolRequestSchema=t.RequestSchema.extend({method:o.z.literal("tools/call"),params:i.extend({name:o.z.string(),arguments:o.z.optional(o.z.record(o.z.unknown()))})});t.ToolListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/tools/list_changed")});t.LoggingLevelSchema=o.z.enum(["debug","info","notice","warning","error","critical","alert","emergency"]);t.SetLevelRequestSchema=t.RequestSchema.extend({method:o.z.literal("logging/setLevel"),params:i.extend({level:t.LoggingLevelSchema})});t.LoggingMessageNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/message"),params:n.extend({level:t.LoggingLevelSchema,logger:o.z.optional(o.z.string()),data:o.z.unknown()})});t.ModelHintSchema=o.z.object({name:o.z.string().optional()}).passthrough();t.ModelPreferencesSchema=o.z.object({hints:o.z.optional(o.z.array(t.ModelHintSchema)),costPriority:o.z.optional(o.z.number().min(0).max(1)),speedPriority:o.z.optional(o.z.number().min(0).max(1)),intelligencePriority:o.z.optional(o.z.number().min(0).max(1))}).passthrough();t.SamplingMessageSchema=o.z.object({role:o.z.enum(["user","assistant"]),content:o.z.union([t.TextContentSchema,t.ImageContentSchema,t.AudioContentSchema])}).passthrough();t.CreateMessageRequestSchema=t.RequestSchema.extend({method:o.z.literal("sampling/createMessage"),params:i.extend({messages:o.z.array(t.SamplingMessageSchema),systemPrompt:o.z.optional(o.z.string()),includeContext:o.z.optional(o.z.enum(["none","thisServer","allServers"])),temperature:o.z.optional(o.z.number()),maxTokens:o.z.number().int(),stopSequences:o.z.optional(o.z.array(o.z.string())),metadata:o.z.optional(o.z.object({}).passthrough()),modelPreferences:o.z.optional(t.ModelPreferencesSchema)})});t.CreateMessageResultSchema=t.ResultSchema.extend({model:o.z.string(),stopReason:o.z.optional(o.z.enum(["endTurn","stopSequence","maxTokens"]).or(o.z.string())),role:o.z.enum(["user","assistant"]),content:o.z.discriminatedUnion("type",[t.TextContentSchema,t.ImageContentSchema,t.AudioContentSchema])});t.BooleanSchemaSchema=o.z.object({type:o.z.literal("boolean"),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),default:o.z.optional(o.z.boolean())}).passthrough();t.StringSchemaSchema=o.z.object({type:o.z.literal("string"),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),minLength:o.z.optional(o.z.number()),maxLength:o.z.optional(o.z.number()),format:o.z.optional(o.z.enum(["email","uri","date","date-time"]))}).passthrough();t.NumberSchemaSchema=o.z.object({type:o.z.enum(["number","integer"]),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),minimum:o.z.optional(o.z.number()),maximum:o.z.optional(o.z.number())}).passthrough();t.EnumSchemaSchema=o.z.object({type:o.z.literal("string"),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),enum:o.z.array(o.z.string()),enumNames:o.z.optional(o.z.array(o.z.string()))}).passthrough();t.PrimitiveSchemaDefinitionSchema=o.z.union([t.BooleanSchemaSchema,t.StringSchemaSchema,t.NumberSchemaSchema,t.EnumSchemaSchema]);t.ElicitRequestSchema=t.RequestSchema.extend({method:o.z.literal("elicitation/create"),params:i.extend({message:o.z.string(),requestedSchema:o.z.object({type:o.z.literal("object"),properties:o.z.record(o.z.string(),t.PrimitiveSchemaDefinitionSchema),required:o.z.optional(o.z.array(o.z.string()))}).passthrough()})});t.ElicitResultSchema=t.ResultSchema.extend({action:o.z.enum(["accept","decline","cancel"]),content:o.z.optional(o.z.record(o.z.string(),o.z.unknown()))});t.ResourceTemplateReferenceSchema=o.z.object({type:o.z.literal("ref/resource"),uri:o.z.string()}).passthrough();t.ResourceReferenceSchema=t.ResourceTemplateReferenceSchema;t.PromptReferenceSchema=o.z.object({type:o.z.literal("ref/prompt"),name:o.z.string()}).passthrough();t.CompleteRequestSchema=t.RequestSchema.extend({method:o.z.literal("completion/complete"),params:i.extend({ref:o.z.union([t.PromptReferenceSchema,t.ResourceTemplateReferenceSchema]),argument:o.z.object({name:o.z.string(),value:o.z.string()}).passthrough(),context:o.z.optional(o.z.object({arguments:o.z.optional(o.z.record(o.z.string(),o.z.string()))}))})});t.CompleteResultSchema=t.ResultSchema.extend({completion:o.z.object({values:o.z.array(o.z.string()).max(100),total:o.z.optional(o.z.number().int()),hasMore:o.z.optional(o.z.boolean())}).passthrough()});t.RootSchema=o.z.object({uri:o.z.string().startsWith("file://"),name:o.z.optional(o.z.string()),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.ListRootsRequestSchema=t.RequestSchema.extend({method:o.z.literal("roots/list")});t.ListRootsResultSchema=t.ResultSchema.extend({roots:o.z.array(t.RootSchema)});t.RootsListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/roots/list_changed")});t.ClientRequestSchema=o.z.union([t.PingRequestSchema,t.InitializeRequestSchema,t.CompleteRequestSchema,t.SetLevelRequestSchema,t.GetPromptRequestSchema,t.ListPromptsRequestSchema,t.ListResourcesRequestSchema,t.ListResourceTemplatesRequestSchema,t.ReadResourceRequestSchema,t.SubscribeRequestSchema,t.UnsubscribeRequestSchema,t.CallToolRequestSchema,t.ListToolsRequestSchema]);t.ClientNotificationSchema=o.z.union([t.CancelledNotificationSchema,t.ProgressNotificationSchema,t.InitializedNotificationSchema,t.RootsListChangedNotificationSchema]);t.ClientResultSchema=o.z.union([t.EmptyResultSchema,t.CreateMessageResultSchema,t.ElicitResultSchema,t.ListRootsResultSchema]);t.ServerRequestSchema=o.z.union([t.PingRequestSchema,t.CreateMessageRequestSchema,t.ElicitRequestSchema,t.ListRootsRequestSchema]);t.ServerNotificationSchema=o.z.union([t.CancelledNotificationSchema,t.ProgressNotificationSchema,t.LoggingMessageNotificationSchema,t.ResourceUpdatedNotificationSchema,t.ResourceListChangedNotificationSchema,t.ToolListChangedNotificationSchema,t.PromptListChangedNotificationSchema]);t.ServerResultSchema=o.z.union([t.EmptyResultSchema,t.InitializeResultSchema,t.CompleteResultSchema,t.GetPromptResultSchema,t.ListPromptsResultSchema,t.ListResourcesResultSchema,t.ListResourceTemplatesResultSchema,t.ReadResourceResultSchema,t.CallToolResultSchema,t.ListToolsResultSchema]);class McpError extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`);this.code=e;this.data=s;this.name="McpError"}}t.McpError=McpError}};var t={};function __nccwpck_require__(s){var o=t[s];if(o!==undefined){return o.exports}var a=t[s]={exports:{}};var i=true;try{e[s].call(a.exports,a,a.exports,__nccwpck_require__);i=false}finally{if(i)delete t[s]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s=__nccwpck_require__(685);module.exports=s})(); (()=>{"use strict";var e={142:e=>{e.exports=require("next/dist/compiled/content-type")},238:e=>{e.exports=require("next/dist/compiled/raw-body")},788:e=>{e.exports=require("next/dist/compiled/zod")},5:e=>{e.exports=require("node:crypto")},500:function(e,t,s){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.StreamableHTTPServerTransport=void 0;const a=s(705);const i=o(s(238));const n=o(s(142));const r=s(5);const c="4mb";class StreamableHTTPServerTransport{constructor(e){var t,s;this._started=false;this._streamMapping=new Map;this._requestToStreamMapping=new Map;this._requestResponseMap=new Map;this._initialized=false;this._enableJsonResponse=false;this._standaloneSseStreamId="_GET_stream";this.sessionIdGenerator=e.sessionIdGenerator;this._enableJsonResponse=(t=e.enableJsonResponse)!==null&&t!==void 0?t:false;this._eventStore=e.eventStore;this._onsessioninitialized=e.onsessioninitialized;this._onsessionclosed=e.onsessionclosed;this._allowedHosts=e.allowedHosts;this._allowedOrigins=e.allowedOrigins;this._enableDnsRebindingProtection=(s=e.enableDnsRebindingProtection)!==null&&s!==void 0?s:false}async start(){if(this._started){throw new Error("Transport already started")}this._started=true}validateRequestHeaders(e){if(!this._enableDnsRebindingProtection){return undefined}if(this._allowedHosts&&this._allowedHosts.length>0){const t=e.headers.host;if(!t||!this._allowedHosts.includes(t)){return`Invalid Host header: ${t}`}}if(this._allowedOrigins&&this._allowedOrigins.length>0){const t=e.headers.origin;if(!t||!this._allowedOrigins.includes(t)){return`Invalid Origin header: ${t}`}}return undefined}async handleRequest(e,t,s){var o;const a=this.validateRequestHeaders(e);if(a){t.writeHead(403).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:a},id:null}));(o=this.onerror)===null||o===void 0?void 0:o.call(this,new Error(a));return}if(e.method==="POST"){await this.handlePostRequest(e,t,s)}else if(e.method==="GET"){await this.handleGetRequest(e,t)}else if(e.method==="DELETE"){await this.handleDeleteRequest(e,t)}else{await this.handleUnsupportedRequest(t)}}async handleGetRequest(e,t){const s=e.headers.accept;if(!(s===null||s===void 0?void 0:s.includes("text/event-stream"))){t.writeHead(406).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Not Acceptable: Client must accept text/event-stream"},id:null}));return}if(!this.validateSession(e,t)){return}if(!this.validateProtocolVersion(e,t)){return}if(this._eventStore){const s=e.headers["last-event-id"];if(s){await this.replayEvents(s,t);return}}const o={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};if(this.sessionId!==undefined){o["mcp-session-id"]=this.sessionId}if(this._streamMapping.get(this._standaloneSseStreamId)!==undefined){t.writeHead(409).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Conflict: Only one SSE stream is allowed per session"},id:null}));return}t.writeHead(200,o).flushHeaders();this._streamMapping.set(this._standaloneSseStreamId,t);t.on("close",(()=>{this._streamMapping.delete(this._standaloneSseStreamId)}));t.on("error",(e=>{var t;(t=this.onerror)===null||t===void 0?void 0:t.call(this,e)}))}async replayEvents(e,t){var s,o;if(!this._eventStore){return}try{const o={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};if(this.sessionId!==undefined){o["mcp-session-id"]=this.sessionId}t.writeHead(200,o).flushHeaders();const a=await((s=this._eventStore)===null||s===void 0?void 0:s.replayEventsAfter(e,{send:async(e,s)=>{var o;if(!this.writeSSEEvent(t,s,e)){(o=this.onerror)===null||o===void 0?void 0:o.call(this,new Error("Failed replay events"));t.end()}}}));this._streamMapping.set(a,t);t.on("error",(e=>{var t;(t=this.onerror)===null||t===void 0?void 0:t.call(this,e)}))}catch(e){(o=this.onerror)===null||o===void 0?void 0:o.call(this,e)}}writeSSEEvent(e,t,s){let o=`event: message\n`;if(s){o+=`id: ${s}\n`}o+=`data: ${JSON.stringify(t)}\n\n`;return e.write(o)}async handleUnsupportedRequest(e){e.writeHead(405,{Allow:"GET, POST, DELETE"}).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}))}async handlePostRequest(e,t,s){var o,l,h,m,u;try{const u=e.headers.accept;if(!(u===null||u===void 0?void 0:u.includes("application/json"))||!u.includes("text/event-stream")){t.writeHead(406).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Not Acceptable: Client must accept both application/json and text/event-stream"},id:null}));return}const d=e.headers["content-type"];if(!d||!d.includes("application/json")){t.writeHead(415).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Unsupported Media Type: Content-Type must be application/json"},id:null}));return}const S=e.auth;const p={headers:e.headers};let z;if(s!==undefined){z=s}else{const t=n.default.parse(d);const s=await(0,i.default)(e,{limit:c,encoding:(o=t.parameters.charset)!==null&&o!==void 0?o:"utf-8"});z=JSON.parse(s.toString())}let R;if(Array.isArray(z)){R=z.map((e=>a.JSONRPCMessageSchema.parse(e)))}else{R=[a.JSONRPCMessageSchema.parse(z)]}const g=R.some(a.isInitializeRequest);if(g){if(this._initialized&&this.sessionId!==undefined){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Server already initialized"},id:null}));return}if(R.length>1){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Only one initialization request is allowed"},id:null}));return}this.sessionId=(l=this.sessionIdGenerator)===null||l===void 0?void 0:l.call(this);this._initialized=true;if(this.sessionId&&this._onsessioninitialized){await Promise.resolve(this._onsessioninitialized(this.sessionId))}}if(!g){if(!this.validateSession(e,t)){return}if(!this.validateProtocolVersion(e,t)){return}}const f=R.some(a.isJSONRPCRequest);if(!f){t.writeHead(202).end();for(const e of R){(h=this.onmessage)===null||h===void 0?void 0:h.call(this,e,{authInfo:S,requestInfo:p})}}else if(f){const e=(0,r.randomUUID)();if(!this._enableJsonResponse){const e={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};if(this.sessionId!==undefined){e["mcp-session-id"]=this.sessionId}t.writeHead(200,e)}for(const s of R){if((0,a.isJSONRPCRequest)(s)){this._streamMapping.set(e,t);this._requestToStreamMapping.set(s.id,e)}}t.on("close",(()=>{this._streamMapping.delete(e)}));t.on("error",(e=>{var t;(t=this.onerror)===null||t===void 0?void 0:t.call(this,e)}));for(const e of R){(m=this.onmessage)===null||m===void 0?void 0:m.call(this,e,{authInfo:S,requestInfo:p})}}}catch(e){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32700,message:"Parse error",data:String(e)},id:null}));(u=this.onerror)===null||u===void 0?void 0:u.call(this,e)}}async handleDeleteRequest(e,t){var s;if(!this.validateSession(e,t)){return}if(!this.validateProtocolVersion(e,t)){return}await Promise.resolve((s=this._onsessionclosed)===null||s===void 0?void 0:s.call(this,this.sessionId));await this.close();t.writeHead(200).end()}validateSession(e,t){if(this.sessionIdGenerator===undefined){return true}if(!this._initialized){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Server not initialized"},id:null}));return false}const s=e.headers["mcp-session-id"];if(!s){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header is required"},id:null}));return false}else if(Array.isArray(s)){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header must be a single value"},id:null}));return false}else if(s!==this.sessionId){t.writeHead(404).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32001,message:"Session not found"},id:null}));return false}return true}validateProtocolVersion(e,t){var s;let o=(s=e.headers["mcp-protocol-version"])!==null&&s!==void 0?s:a.DEFAULT_NEGOTIATED_PROTOCOL_VERSION;if(Array.isArray(o)){o=o[o.length-1]}if(!a.SUPPORTED_PROTOCOL_VERSIONS.includes(o)){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:`Bad Request: Unsupported protocol version (supported versions: ${a.SUPPORTED_PROTOCOL_VERSIONS.join(", ")})`},id:null}));return false}return true}async close(){var e;this._streamMapping.forEach((e=>{e.end()}));this._streamMapping.clear();this._requestResponseMap.clear();(e=this.onclose)===null||e===void 0?void 0:e.call(this)}async send(e,t){let s=t===null||t===void 0?void 0:t.relatedRequestId;if((0,a.isJSONRPCResponse)(e)||(0,a.isJSONRPCError)(e)){s=e.id}if(s===undefined){if((0,a.isJSONRPCResponse)(e)||(0,a.isJSONRPCError)(e)){throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request")}const t=this._streamMapping.get(this._standaloneSseStreamId);if(t===undefined){return}let s;if(this._eventStore){s=await this._eventStore.storeEvent(this._standaloneSseStreamId,e)}this.writeSSEEvent(t,e,s);return}const o=this._requestToStreamMapping.get(s);const i=this._streamMapping.get(o);if(!o){throw new Error(`No connection established for request ID: ${String(s)}`)}if(!this._enableJsonResponse){let t;if(this._eventStore){t=await this._eventStore.storeEvent(o,e)}if(i){this.writeSSEEvent(i,e,t)}}if((0,a.isJSONRPCResponse)(e)||(0,a.isJSONRPCError)(e)){this._requestResponseMap.set(s,e);const t=Array.from(this._requestToStreamMapping.entries()).filter((([e,t])=>this._streamMapping.get(t)===i)).map((([e])=>e));const o=t.every((e=>this._requestResponseMap.has(e)));if(o){if(!i){throw new Error(`No connection established for request ID: ${String(s)}`)}if(this._enableJsonResponse){const e={"Content-Type":"application/json"};if(this.sessionId!==undefined){e["mcp-session-id"]=this.sessionId}const s=t.map((e=>this._requestResponseMap.get(e)));i.writeHead(200,e);if(s.length===1){i.end(JSON.stringify(s[0]))}else{i.end(JSON.stringify(s))}}else{i.end()}for(const e of t){this._requestResponseMap.delete(e);this._requestToStreamMapping.delete(e)}}}}}t.StreamableHTTPServerTransport=StreamableHTTPServerTransport},705:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:true});t.SubscribeRequestSchema=t.ResourceListChangedNotificationSchema=t.ReadResourceResultSchema=t.ReadResourceRequestSchema=t.ListResourceTemplatesResultSchema=t.ListResourceTemplatesRequestSchema=t.ListResourcesResultSchema=t.ListResourcesRequestSchema=t.ResourceTemplateSchema=t.ResourceSchema=t.BlobResourceContentsSchema=t.TextResourceContentsSchema=t.ResourceContentsSchema=t.PaginatedResultSchema=t.PaginatedRequestSchema=t.ProgressNotificationSchema=t.ProgressSchema=t.PingRequestSchema=t.isInitializedNotification=t.InitializedNotificationSchema=t.InitializeResultSchema=t.ServerCapabilitiesSchema=t.isInitializeRequest=t.InitializeRequestSchema=t.ClientCapabilitiesSchema=t.ImplementationSchema=t.BaseMetadataSchema=t.IconSchema=t.CancelledNotificationSchema=t.EmptyResultSchema=t.JSONRPCMessageSchema=t.isJSONRPCError=t.JSONRPCErrorSchema=t.ErrorCode=t.isJSONRPCResponse=t.JSONRPCResponseSchema=t.isJSONRPCNotification=t.JSONRPCNotificationSchema=t.isJSONRPCRequest=t.JSONRPCRequestSchema=t.RequestIdSchema=t.ResultSchema=t.NotificationSchema=t.RequestSchema=t.CursorSchema=t.ProgressTokenSchema=t.JSONRPC_VERSION=t.SUPPORTED_PROTOCOL_VERSIONS=t.DEFAULT_NEGOTIATED_PROTOCOL_VERSION=t.LATEST_PROTOCOL_VERSION=void 0;t.ClientNotificationSchema=t.ClientRequestSchema=t.RootsListChangedNotificationSchema=t.ListRootsResultSchema=t.ListRootsRequestSchema=t.RootSchema=t.CompleteResultSchema=t.CompleteRequestSchema=t.PromptReferenceSchema=t.ResourceReferenceSchema=t.ResourceTemplateReferenceSchema=t.ElicitResultSchema=t.ElicitRequestSchema=t.PrimitiveSchemaDefinitionSchema=t.EnumSchemaSchema=t.NumberSchemaSchema=t.StringSchemaSchema=t.BooleanSchemaSchema=t.CreateMessageResultSchema=t.CreateMessageRequestSchema=t.SamplingMessageSchema=t.ModelPreferencesSchema=t.ModelHintSchema=t.LoggingMessageNotificationSchema=t.SetLevelRequestSchema=t.LoggingLevelSchema=t.ToolListChangedNotificationSchema=t.CallToolRequestSchema=t.CompatibilityCallToolResultSchema=t.CallToolResultSchema=t.ListToolsResultSchema=t.ListToolsRequestSchema=t.ToolSchema=t.ToolAnnotationsSchema=t.PromptListChangedNotificationSchema=t.GetPromptResultSchema=t.PromptMessageSchema=t.ContentBlockSchema=t.ResourceLinkSchema=t.EmbeddedResourceSchema=t.AudioContentSchema=t.ImageContentSchema=t.TextContentSchema=t.GetPromptRequestSchema=t.ListPromptsResultSchema=t.ListPromptsRequestSchema=t.PromptSchema=t.PromptArgumentSchema=t.ResourceUpdatedNotificationSchema=t.UnsubscribeRequestSchema=void 0;t.McpError=t.ServerResultSchema=t.ServerNotificationSchema=t.ServerRequestSchema=t.ClientResultSchema=void 0;const o=s(788);t.LATEST_PROTOCOL_VERSION="2025-06-18";t.DEFAULT_NEGOTIATED_PROTOCOL_VERSION="2025-03-26";t.SUPPORTED_PROTOCOL_VERSIONS=[t.LATEST_PROTOCOL_VERSION,"2025-03-26","2024-11-05","2024-10-07"];t.JSONRPC_VERSION="2.0";t.ProgressTokenSchema=o.z.union([o.z.string(),o.z.number().int()]);t.CursorSchema=o.z.string();const a=o.z.object({progressToken:o.z.optional(t.ProgressTokenSchema)}).passthrough();const i=o.z.object({_meta:o.z.optional(a)}).passthrough();t.RequestSchema=o.z.object({method:o.z.string(),params:o.z.optional(i)});const n=o.z.object({_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.NotificationSchema=o.z.object({method:o.z.string(),params:o.z.optional(n)});t.ResultSchema=o.z.object({_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.RequestIdSchema=o.z.union([o.z.string(),o.z.number().int()]);t.JSONRPCRequestSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema}).merge(t.RequestSchema).strict();const isJSONRPCRequest=e=>t.JSONRPCRequestSchema.safeParse(e).success;t.isJSONRPCRequest=isJSONRPCRequest;t.JSONRPCNotificationSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION)}).merge(t.NotificationSchema).strict();const isJSONRPCNotification=e=>t.JSONRPCNotificationSchema.safeParse(e).success;t.isJSONRPCNotification=isJSONRPCNotification;t.JSONRPCResponseSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema,result:t.ResultSchema}).strict();const isJSONRPCResponse=e=>t.JSONRPCResponseSchema.safeParse(e).success;t.isJSONRPCResponse=isJSONRPCResponse;var r;(function(e){e[e["ConnectionClosed"]=-32e3]="ConnectionClosed";e[e["RequestTimeout"]=-32001]="RequestTimeout";e[e["ParseError"]=-32700]="ParseError";e[e["InvalidRequest"]=-32600]="InvalidRequest";e[e["MethodNotFound"]=-32601]="MethodNotFound";e[e["InvalidParams"]=-32602]="InvalidParams";e[e["InternalError"]=-32603]="InternalError"})(r||(t.ErrorCode=r={}));t.JSONRPCErrorSchema=o.z.object({jsonrpc:o.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema,error:o.z.object({code:o.z.number().int(),message:o.z.string(),data:o.z.optional(o.z.unknown())})}).strict();const isJSONRPCError=e=>t.JSONRPCErrorSchema.safeParse(e).success;t.isJSONRPCError=isJSONRPCError;t.JSONRPCMessageSchema=o.z.union([t.JSONRPCRequestSchema,t.JSONRPCNotificationSchema,t.JSONRPCResponseSchema,t.JSONRPCErrorSchema]);t.EmptyResultSchema=t.ResultSchema.strict();t.CancelledNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/cancelled"),params:n.extend({requestId:t.RequestIdSchema,reason:o.z.string().optional()})});t.IconSchema=o.z.object({src:o.z.string(),mimeType:o.z.optional(o.z.string()),sizes:o.z.optional(o.z.string())}).passthrough();t.BaseMetadataSchema=o.z.object({name:o.z.string(),title:o.z.optional(o.z.string())}).passthrough();t.ImplementationSchema=t.BaseMetadataSchema.extend({version:o.z.string(),websiteUrl:o.z.optional(o.z.string()),icons:o.z.optional(o.z.array(t.IconSchema))});t.ClientCapabilitiesSchema=o.z.object({experimental:o.z.optional(o.z.object({}).passthrough()),sampling:o.z.optional(o.z.object({}).passthrough()),elicitation:o.z.optional(o.z.object({}).passthrough()),roots:o.z.optional(o.z.object({listChanged:o.z.optional(o.z.boolean())}).passthrough())}).passthrough();t.InitializeRequestSchema=t.RequestSchema.extend({method:o.z.literal("initialize"),params:i.extend({protocolVersion:o.z.string(),capabilities:t.ClientCapabilitiesSchema,clientInfo:t.ImplementationSchema})});const isInitializeRequest=e=>t.InitializeRequestSchema.safeParse(e).success;t.isInitializeRequest=isInitializeRequest;t.ServerCapabilitiesSchema=o.z.object({experimental:o.z.optional(o.z.object({}).passthrough()),logging:o.z.optional(o.z.object({}).passthrough()),completions:o.z.optional(o.z.object({}).passthrough()),prompts:o.z.optional(o.z.object({listChanged:o.z.optional(o.z.boolean())}).passthrough()),resources:o.z.optional(o.z.object({subscribe:o.z.optional(o.z.boolean()),listChanged:o.z.optional(o.z.boolean())}).passthrough()),tools:o.z.optional(o.z.object({listChanged:o.z.optional(o.z.boolean())}).passthrough())}).passthrough();t.InitializeResultSchema=t.ResultSchema.extend({protocolVersion:o.z.string(),capabilities:t.ServerCapabilitiesSchema,serverInfo:t.ImplementationSchema,instructions:o.z.optional(o.z.string())});t.InitializedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/initialized")});const isInitializedNotification=e=>t.InitializedNotificationSchema.safeParse(e).success;t.isInitializedNotification=isInitializedNotification;t.PingRequestSchema=t.RequestSchema.extend({method:o.z.literal("ping")});t.ProgressSchema=o.z.object({progress:o.z.number(),total:o.z.optional(o.z.number()),message:o.z.optional(o.z.string())}).passthrough();t.ProgressNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/progress"),params:n.merge(t.ProgressSchema).extend({progressToken:t.ProgressTokenSchema})});t.PaginatedRequestSchema=t.RequestSchema.extend({params:i.extend({cursor:o.z.optional(t.CursorSchema)}).optional()});t.PaginatedResultSchema=t.ResultSchema.extend({nextCursor:o.z.optional(t.CursorSchema)});t.ResourceContentsSchema=o.z.object({uri:o.z.string(),mimeType:o.z.optional(o.z.string()),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.TextResourceContentsSchema=t.ResourceContentsSchema.extend({text:o.z.string()});const c=o.z.string().refine((e=>{try{atob(e);return true}catch(e){return false}}),{message:"Invalid Base64 string"});t.BlobResourceContentsSchema=t.ResourceContentsSchema.extend({blob:c});t.ResourceSchema=t.BaseMetadataSchema.extend({uri:o.z.string(),description:o.z.optional(o.z.string()),mimeType:o.z.optional(o.z.string()),icons:o.z.optional(o.z.array(t.IconSchema)),_meta:o.z.optional(o.z.object({}).passthrough())});t.ResourceTemplateSchema=t.BaseMetadataSchema.extend({uriTemplate:o.z.string(),description:o.z.optional(o.z.string()),mimeType:o.z.optional(o.z.string()),_meta:o.z.optional(o.z.object({}).passthrough())});t.ListResourcesRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("resources/list")});t.ListResourcesResultSchema=t.PaginatedResultSchema.extend({resources:o.z.array(t.ResourceSchema)});t.ListResourceTemplatesRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("resources/templates/list")});t.ListResourceTemplatesResultSchema=t.PaginatedResultSchema.extend({resourceTemplates:o.z.array(t.ResourceTemplateSchema)});t.ReadResourceRequestSchema=t.RequestSchema.extend({method:o.z.literal("resources/read"),params:i.extend({uri:o.z.string()})});t.ReadResourceResultSchema=t.ResultSchema.extend({contents:o.z.array(o.z.union([t.TextResourceContentsSchema,t.BlobResourceContentsSchema]))});t.ResourceListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/resources/list_changed")});t.SubscribeRequestSchema=t.RequestSchema.extend({method:o.z.literal("resources/subscribe"),params:i.extend({uri:o.z.string()})});t.UnsubscribeRequestSchema=t.RequestSchema.extend({method:o.z.literal("resources/unsubscribe"),params:i.extend({uri:o.z.string()})});t.ResourceUpdatedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/resources/updated"),params:n.extend({uri:o.z.string()})});t.PromptArgumentSchema=o.z.object({name:o.z.string(),description:o.z.optional(o.z.string()),required:o.z.optional(o.z.boolean())}).passthrough();t.PromptSchema=t.BaseMetadataSchema.extend({description:o.z.optional(o.z.string()),arguments:o.z.optional(o.z.array(t.PromptArgumentSchema)),icons:o.z.optional(o.z.array(t.IconSchema)),_meta:o.z.optional(o.z.object({}).passthrough())});t.ListPromptsRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("prompts/list")});t.ListPromptsResultSchema=t.PaginatedResultSchema.extend({prompts:o.z.array(t.PromptSchema)});t.GetPromptRequestSchema=t.RequestSchema.extend({method:o.z.literal("prompts/get"),params:i.extend({name:o.z.string(),arguments:o.z.optional(o.z.record(o.z.string()))})});t.TextContentSchema=o.z.object({type:o.z.literal("text"),text:o.z.string(),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.ImageContentSchema=o.z.object({type:o.z.literal("image"),data:c,mimeType:o.z.string(),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.AudioContentSchema=o.z.object({type:o.z.literal("audio"),data:c,mimeType:o.z.string(),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.EmbeddedResourceSchema=o.z.object({type:o.z.literal("resource"),resource:o.z.union([t.TextResourceContentsSchema,t.BlobResourceContentsSchema]),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.ResourceLinkSchema=t.ResourceSchema.extend({type:o.z.literal("resource_link")});t.ContentBlockSchema=o.z.union([t.TextContentSchema,t.ImageContentSchema,t.AudioContentSchema,t.ResourceLinkSchema,t.EmbeddedResourceSchema]);t.PromptMessageSchema=o.z.object({role:o.z.enum(["user","assistant"]),content:t.ContentBlockSchema}).passthrough();t.GetPromptResultSchema=t.ResultSchema.extend({description:o.z.optional(o.z.string()),messages:o.z.array(t.PromptMessageSchema)});t.PromptListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/prompts/list_changed")});t.ToolAnnotationsSchema=o.z.object({title:o.z.optional(o.z.string()),readOnlyHint:o.z.optional(o.z.boolean()),destructiveHint:o.z.optional(o.z.boolean()),idempotentHint:o.z.optional(o.z.boolean()),openWorldHint:o.z.optional(o.z.boolean())}).passthrough();t.ToolSchema=t.BaseMetadataSchema.extend({description:o.z.optional(o.z.string()),inputSchema:o.z.object({type:o.z.literal("object"),properties:o.z.optional(o.z.object({}).passthrough()),required:o.z.optional(o.z.array(o.z.string()))}).passthrough(),outputSchema:o.z.optional(o.z.object({type:o.z.literal("object"),properties:o.z.optional(o.z.object({}).passthrough()),required:o.z.optional(o.z.array(o.z.string()))}).passthrough()),annotations:o.z.optional(t.ToolAnnotationsSchema),icons:o.z.optional(o.z.array(t.IconSchema)),_meta:o.z.optional(o.z.object({}).passthrough())});t.ListToolsRequestSchema=t.PaginatedRequestSchema.extend({method:o.z.literal("tools/list")});t.ListToolsResultSchema=t.PaginatedResultSchema.extend({tools:o.z.array(t.ToolSchema)});t.CallToolResultSchema=t.ResultSchema.extend({content:o.z.array(t.ContentBlockSchema).default([]),structuredContent:o.z.object({}).passthrough().optional(),isError:o.z.optional(o.z.boolean())});t.CompatibilityCallToolResultSchema=t.CallToolResultSchema.or(t.ResultSchema.extend({toolResult:o.z.unknown()}));t.CallToolRequestSchema=t.RequestSchema.extend({method:o.z.literal("tools/call"),params:i.extend({name:o.z.string(),arguments:o.z.optional(o.z.record(o.z.unknown()))})});t.ToolListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/tools/list_changed")});t.LoggingLevelSchema=o.z.enum(["debug","info","notice","warning","error","critical","alert","emergency"]);t.SetLevelRequestSchema=t.RequestSchema.extend({method:o.z.literal("logging/setLevel"),params:i.extend({level:t.LoggingLevelSchema})});t.LoggingMessageNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/message"),params:n.extend({level:t.LoggingLevelSchema,logger:o.z.optional(o.z.string()),data:o.z.unknown()})});t.ModelHintSchema=o.z.object({name:o.z.string().optional()}).passthrough();t.ModelPreferencesSchema=o.z.object({hints:o.z.optional(o.z.array(t.ModelHintSchema)),costPriority:o.z.optional(o.z.number().min(0).max(1)),speedPriority:o.z.optional(o.z.number().min(0).max(1)),intelligencePriority:o.z.optional(o.z.number().min(0).max(1))}).passthrough();t.SamplingMessageSchema=o.z.object({role:o.z.enum(["user","assistant"]),content:o.z.union([t.TextContentSchema,t.ImageContentSchema,t.AudioContentSchema])}).passthrough();t.CreateMessageRequestSchema=t.RequestSchema.extend({method:o.z.literal("sampling/createMessage"),params:i.extend({messages:o.z.array(t.SamplingMessageSchema),systemPrompt:o.z.optional(o.z.string()),includeContext:o.z.optional(o.z.enum(["none","thisServer","allServers"])),temperature:o.z.optional(o.z.number()),maxTokens:o.z.number().int(),stopSequences:o.z.optional(o.z.array(o.z.string())),metadata:o.z.optional(o.z.object({}).passthrough()),modelPreferences:o.z.optional(t.ModelPreferencesSchema)})});t.CreateMessageResultSchema=t.ResultSchema.extend({model:o.z.string(),stopReason:o.z.optional(o.z.enum(["endTurn","stopSequence","maxTokens"]).or(o.z.string())),role:o.z.enum(["user","assistant"]),content:o.z.discriminatedUnion("type",[t.TextContentSchema,t.ImageContentSchema,t.AudioContentSchema])});t.BooleanSchemaSchema=o.z.object({type:o.z.literal("boolean"),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),default:o.z.optional(o.z.boolean())}).passthrough();t.StringSchemaSchema=o.z.object({type:o.z.literal("string"),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),minLength:o.z.optional(o.z.number()),maxLength:o.z.optional(o.z.number()),format:o.z.optional(o.z.enum(["email","uri","date","date-time"]))}).passthrough();t.NumberSchemaSchema=o.z.object({type:o.z.enum(["number","integer"]),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),minimum:o.z.optional(o.z.number()),maximum:o.z.optional(o.z.number())}).passthrough();t.EnumSchemaSchema=o.z.object({type:o.z.literal("string"),title:o.z.optional(o.z.string()),description:o.z.optional(o.z.string()),enum:o.z.array(o.z.string()),enumNames:o.z.optional(o.z.array(o.z.string()))}).passthrough();t.PrimitiveSchemaDefinitionSchema=o.z.union([t.BooleanSchemaSchema,t.StringSchemaSchema,t.NumberSchemaSchema,t.EnumSchemaSchema]);t.ElicitRequestSchema=t.RequestSchema.extend({method:o.z.literal("elicitation/create"),params:i.extend({message:o.z.string(),requestedSchema:o.z.object({type:o.z.literal("object"),properties:o.z.record(o.z.string(),t.PrimitiveSchemaDefinitionSchema),required:o.z.optional(o.z.array(o.z.string()))}).passthrough()})});t.ElicitResultSchema=t.ResultSchema.extend({action:o.z.enum(["accept","decline","cancel"]),content:o.z.optional(o.z.record(o.z.string(),o.z.unknown()))});t.ResourceTemplateReferenceSchema=o.z.object({type:o.z.literal("ref/resource"),uri:o.z.string()}).passthrough();t.ResourceReferenceSchema=t.ResourceTemplateReferenceSchema;t.PromptReferenceSchema=o.z.object({type:o.z.literal("ref/prompt"),name:o.z.string()}).passthrough();t.CompleteRequestSchema=t.RequestSchema.extend({method:o.z.literal("completion/complete"),params:i.extend({ref:o.z.union([t.PromptReferenceSchema,t.ResourceTemplateReferenceSchema]),argument:o.z.object({name:o.z.string(),value:o.z.string()}).passthrough(),context:o.z.optional(o.z.object({arguments:o.z.optional(o.z.record(o.z.string(),o.z.string()))}))})});t.CompleteResultSchema=t.ResultSchema.extend({completion:o.z.object({values:o.z.array(o.z.string()).max(100),total:o.z.optional(o.z.number().int()),hasMore:o.z.optional(o.z.boolean())}).passthrough()});t.RootSchema=o.z.object({uri:o.z.string().startsWith("file://"),name:o.z.optional(o.z.string()),_meta:o.z.optional(o.z.object({}).passthrough())}).passthrough();t.ListRootsRequestSchema=t.RequestSchema.extend({method:o.z.literal("roots/list")});t.ListRootsResultSchema=t.ResultSchema.extend({roots:o.z.array(t.RootSchema)});t.RootsListChangedNotificationSchema=t.NotificationSchema.extend({method:o.z.literal("notifications/roots/list_changed")});t.ClientRequestSchema=o.z.union([t.PingRequestSchema,t.InitializeRequestSchema,t.CompleteRequestSchema,t.SetLevelRequestSchema,t.GetPromptRequestSchema,t.ListPromptsRequestSchema,t.ListResourcesRequestSchema,t.ListResourceTemplatesRequestSchema,t.ReadResourceRequestSchema,t.SubscribeRequestSchema,t.UnsubscribeRequestSchema,t.CallToolRequestSchema,t.ListToolsRequestSchema]);t.ClientNotificationSchema=o.z.union([t.CancelledNotificationSchema,t.ProgressNotificationSchema,t.InitializedNotificationSchema,t.RootsListChangedNotificationSchema]);t.ClientResultSchema=o.z.union([t.EmptyResultSchema,t.CreateMessageResultSchema,t.ElicitResultSchema,t.ListRootsResultSchema]);t.ServerRequestSchema=o.z.union([t.PingRequestSchema,t.CreateMessageRequestSchema,t.ElicitRequestSchema,t.ListRootsRequestSchema]);t.ServerNotificationSchema=o.z.union([t.CancelledNotificationSchema,t.ProgressNotificationSchema,t.LoggingMessageNotificationSchema,t.ResourceUpdatedNotificationSchema,t.ResourceListChangedNotificationSchema,t.ToolListChangedNotificationSchema,t.PromptListChangedNotificationSchema]);t.ServerResultSchema=o.z.union([t.EmptyResultSchema,t.InitializeResultSchema,t.CompleteResultSchema,t.GetPromptResultSchema,t.ListPromptsResultSchema,t.ListResourcesResultSchema,t.ListResourceTemplatesResultSchema,t.ReadResourceResultSchema,t.CallToolResultSchema,t.ListToolsResultSchema]);class McpError extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`);this.code=e;this.data=s;this.name="McpError"}}t.McpError=McpError}};var t={};function __nccwpck_require__(s){var o=t[s];if(o!==undefined){return o.exports}var a=t[s]={exports:{}};var i=true;try{e[s].call(a.exports,a,a.exports,__nccwpck_require__);i=false}finally{if(i)delete t[s]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s=__nccwpck_require__(500);module.exports=s})();
\ No newline at end of file \ No newline at end of file
...@@ -27777,7 +27777,7 @@ module.exports = require("string_decoder"); ...@@ -27777,7 +27777,7 @@ module.exports = require("string_decoder");
/***/ }), /***/ }),
/***/ 573: /***/ 8740:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict"; "use strict";
...@@ -29222,7 +29222,7 @@ Object.defineProperty(exports, "__esModule", ({value: true})); ...@@ -29222,7 +29222,7 @@ Object.defineProperty(exports, "__esModule", ({value: true}));
var _chunkZCP6UQNEcjs = __nccwpck_require__(573); var _chunkZCP6UQNEcjs = __nccwpck_require__(8740);
// src/del.ts // src/del.ts
async function del(urlOrPathname, options) { async function del(urlOrPathname, options) {
......
(()=>{var e={375:(e,t,r)=>{const{Container:s}=r(977);class NestedDeclaration extends s{constructor(e){super(e);this.type="decl";this.isNested=true;if(!this.nodes)this.nodes=[]}}e.exports=NestedDeclaration},969:(e,t,r)=>{let{Input:s}=r(977);let i=r(199);e.exports=function scssParse(e,t){let r=new s(e,t);let n=new i(r);n.parse();return n.root}},199:(e,t,r)=>{let{Comment:s}=r(977);let i=r(46);let n=r(375);let l=r(381);class ScssParser extends i{createTokenizer(){this.tokenizer=l(this.input)}rule(e){let t=false;let r=0;let s="";for(let i of e){if(t){if(i[0]!=="comment"&&i[0]!=="{"){s+=i[1]}}else if(i[0]==="space"&&i[1].includes("\n")){break}else if(i[0]==="("){r+=1}else if(i[0]===")"){r-=1}else if(r===0&&i[0]===":"){t=true}}if(!t||s.trim()===""||/^[#:A-Za-z-]/.test(s)){super.rule(e)}else{e.pop();let t=new n;this.init(t,e[0][2]);let r;for(let t=e.length-1;t>=0;t--){if(e[t][0]!=="space"){r=e[t];break}}if(r[3]){let e=this.input.fromOffset(r[3]);t.source.end={offset:r[3],line:e.line,column:e.col}}else{let e=this.input.fromOffset(r[2]);t.source.end={offset:r[2],line:e.line,column:e.col}}while(e[0][0]!=="word"){t.raws.before+=e.shift()[1]}if(e[0][2]){let r=this.input.fromOffset(e[0][2]);t.source.start={offset:e[0][2],line:r.line,column:r.col}}t.prop="";while(e.length){let r=e[0][0];if(r===":"||r==="space"||r==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";let s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(let r=e.length-1;r>0;r--){s=e[r];if(s[1]==="!important"){t.important=true;let s=this.stringFrom(e,r);s=this.spacesFromEnd(e)+s;if(s!==" !important"){t.raws.important=s}break}else if(s[1]==="important"){let s=e.slice(0);let i="";for(let e=r;e>0;e--){let t=s[e][0];if(i.trim().indexOf("!")===0&&t!=="space"){break}i=s.pop()[1]+i}if(i.trim().indexOf("!")===0){t.important=true;t.raws.important=i;e=s}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.includes(":")){this.checkMissedSemicolon(e)}this.current=t}}comment(e){if(e[4]==="inline"){let t=new s;this.init(t,e[2]);t.raws.inline=true;let r=this.input.fromOffset(e[3]);t.source.end={offset:e[3],line:r.line,column:r.col};let i=e[1].slice(2);if(/^\s*$/.test(i)){t.text="";t.raws.left=i;t.raws.right=""}else{let e=i.match(/^(\s*)([^]*\S)(\s*)$/);let r=e[2].replace(/(\*\/|\/\*)/g,"*//*");t.text=r;t.raws.left=e[1];t.raws.right=e[3];t.raws.text=e[2]}}else{super.comment(e)}}atrule(e){let t=e[1];let r=e;while(!this.tokenizer.endOfFile()){let e=this.tokenizer.nextToken();if(e[0]==="word"&&e[2]===r[3]+1){t+=e[1];r=e}else{this.tokenizer.back(e);break}}super.atrule(["at-word",t,e[2],r[3]])}raw(e,t,r){super.raw(e,t,r);if(e.raws[t]){let s=e.raws[t].raw;e.raws[t].raw=r.reduce(((e,t)=>{if(t[0]==="comment"&&t[4]==="inline"){let r=t[1].slice(2).replace(/(\*\/|\/\*)/g,"*//*");return e+"/*"+r+"*/"}else{return e+t[1]}}),"");if(s!==e.raws[t].raw){e.raws[t].scss=s}}}}e.exports=ScssParser},184:(e,t,r)=>{let s=r(534);class ScssStringifier extends s{comment(e){let t=this.raw(e,"left","commentLeft");let r=this.raw(e,"right","commentRight");if(e.raws.inline){let s=e.raws.text||e.text;this.builder("//"+t+s+r,e)}else{this.builder("/*"+t+e.text+r+"*/",e)}}decl(e,t){if(!e.isNested){super.decl(e,t)}else{let t=this.raw(e,"between","colon");let r=e.prop+t+this.rawValue(e,"value");if(e.important){r+=e.raws.important||" !important"}this.builder(r+"{",e,"start");let s;if(e.nodes&&e.nodes.length){this.body(e);s=this.raw(e,"after")}else{s=this.raw(e,"after","emptyBody")}if(s)this.builder(s);this.builder("}",e,"end")}}rawValue(e,t){let r=e[t];let s=e.raws[t];if(s&&s.value===r){return s.scss?s.scss:s.raw}else{return r}}}e.exports=ScssStringifier},760:(e,t,r)=>{let s=r(184);e.exports=function scssStringify(e,t){let r=new s(t);r.stringify(e)}},402:(e,t,r)=>{let s=r(760);let i=r(969);e.exports={parse:i,stringify:s}},381:e=>{"use strict";const t="'".charCodeAt(0);const r='"'.charCodeAt(0);const s="\\".charCodeAt(0);const i="/".charCodeAt(0);const n="\n".charCodeAt(0);const l=" ".charCodeAt(0);const a="\f".charCodeAt(0);const o="\t".charCodeAt(0);const f="\r".charCodeAt(0);const c="[".charCodeAt(0);const d="]".charCodeAt(0);const u="(".charCodeAt(0);const h=")".charCodeAt(0);const w="{".charCodeAt(0);const p="}".charCodeAt(0);const m=";".charCodeAt(0);const b="*".charCodeAt(0);const g=":".charCodeAt(0);const k="@".charCodeAt(0);const C=",".charCodeAt(0);const y="#".charCodeAt(0);const x=/[\t\n\f\r "#'()/;[\\\]{}]/g;const A=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g;const _=/.[\n"'(/\\]/;const S=/[\da-f]/i;const O=/[\n\f\r]/g;e.exports=function scssTokenize(e,v={}){let I=e.css.valueOf();let z=v.ignoreErrors;let B,D,q,F,R;let T,N,V,$;let E=I.length;let P=0;let U=[];let L=[];let M;function position(){return P}function unclosed(t){throw e.error("Unclosed "+t,P)}function endOfFile(){return L.length===0&&P>=E}function interpolation(){let e=1;let i=false;let n=false;while(e>0){D+=1;if(I.length<=D)unclosed("interpolation");B=I.charCodeAt(D);V=I.charCodeAt(D+1);if(i){if(!n&&B===i){i=false;n=false}else if(B===s){n=!n}else if(n){n=false}}else if(B===t||B===r){i=B}else if(B===p){e-=1}else if(B===y&&V===w){e+=1}}}function nextToken(e){if(L.length)return L.pop();if(P>=E)return;let v=e?e.ignoreUnclosed:false;B=I.charCodeAt(P);switch(B){case n:case l:case o:case f:case a:{D=P;do{D+=1;B=I.charCodeAt(D)}while(B===l||B===n||B===o||B===f||B===a);$=["space",I.slice(P,D)];P=D-1;break}case c:case d:case w:case p:case g:case m:case h:{let e=String.fromCharCode(B);$=[e,e,P];break}case C:{$=["word",",",P,P+1];break}case u:{N=U.length?U.pop()[1]:"";V=I.charCodeAt(P+1);if(N==="url"&&V!==t&&V!==r){M=1;T=false;D=P+1;while(D<=I.length-1){V=I.charCodeAt(D);if(V===s){T=!T}else if(V===u){M+=1}else if(V===h){M-=1;if(M===0)break}D+=1}F=I.slice(P,D+1);$=["brackets",F,P,D];P=D}else{D=I.indexOf(")",P+1);F=I.slice(P,D+1);if(D===-1||_.test(F)){$=["(","(",P]}else{$=["brackets",F,P,D];P=D}}break}case t:case r:{q=B;D=P;T=false;while(D<E){D++;if(D===E)unclosed("string");B=I.charCodeAt(D);V=I.charCodeAt(D+1);if(!T&&B===q){break}else if(B===s){T=!T}else if(T){T=false}else if(B===y&&V===w){interpolation()}}$=["string",I.slice(P,D+1),P,D];P=D;break}case k:{x.lastIndex=P+1;x.test(I);if(x.lastIndex===0){D=I.length-1}else{D=x.lastIndex-2}$=["at-word",I.slice(P,D+1),P,D];P=D;break}case s:{D=P;R=true;while(I.charCodeAt(D+1)===s){D+=1;R=!R}B=I.charCodeAt(D+1);if(R&&B!==i&&B!==l&&B!==n&&B!==o&&B!==f&&B!==a){D+=1;if(S.test(I.charAt(D))){while(S.test(I.charAt(D+1))){D+=1}if(I.charCodeAt(D+1)===l){D+=1}}}$=["word",I.slice(P,D+1),P,D];P=D;break}default:V=I.charCodeAt(P+1);if(B===y&&V===w){D=P;interpolation();F=I.slice(P,D+1);$=["word",F,P,D];P=D}else if(B===i&&V===b){D=I.indexOf("*/",P+2)+1;if(D===0){if(z||v){D=I.length}else{unclosed("comment")}}$=["comment",I.slice(P,D+1),P,D];P=D}else if(B===i&&V===i){O.lastIndex=P+1;O.test(I);if(O.lastIndex===0){D=I.length-1}else{D=O.lastIndex-2}F=I.slice(P,D+1);$=["comment",F,P,D,"inline"];P=D}else{A.lastIndex=P+1;A.test(I);if(A.lastIndex===0){D=I.length-1}else{D=A.lastIndex-2}$=["word",I.slice(P,D+1),P,D];U.push($);P=D}break}P++;return $}function back(e){L.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}},534:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}class Stringifier{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;let s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){r+=e.raws.afterName}else if(s){r+=" "}if(e.nodes){this.block(e,r+s)}else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+s+i,e)}}beforeAfter(e,t){let r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}let s=e.parent;let i=0;while(s&&s.type!=="root"){i+=1;s=s.parent}if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length){for(let e=0;e<i;e++)r+=t}}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let s;if(e.nodes&&e.nodes.length){this.body(e);s=this.raw(e,"after")}else{s=this.raw(e,"after","emptyBody")}if(s)this.builder(s);this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;while(t>0){if(e.nodes[t].type!=="comment")break;t-=1}let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let i=e.nodes[s];let n=this.raw(i,"before");if(n)this.builder(n);this.stringify(i,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft");let r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon");let s=e.prop+r+this.rawValue(e,"value");if(e.important){s+=e.raws.important||" !important"}if(t)s+=";";this.builder(s,e)}document(e){this.body(e)}raw(e,r,s){let i;if(!s)s=r;if(r){i=e.raws[r];if(typeof i!=="undefined")return i}let n=e.parent;if(s==="before"){if(!n||n.type==="root"&&n.first===e){return""}if(n&&n.type==="document"){return""}}if(!n)return t[s];let l=e.root();if(!l.rawCache)l.rawCache={};if(typeof l.rawCache[s]!=="undefined"){return l.rawCache[s]}if(s==="before"||s==="after"){return this.beforeAfter(e,s)}else{let t="raw"+capitalize(s);if(this[t]){i=this[t](l,e)}else{l.walk((e=>{i=e.raws[r];if(typeof i!=="undefined")return false}))}}if(typeof i==="undefined")i=t[s];l.rawCache[s]=i;return i}rawBeforeClose(e){let t;e.walk((e=>{if(e.nodes&&e.nodes.length>0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.includes("\n")){t=t.replace(/[^\n]+$/,"")}return false}}}));if(t)t=t.replace(/\S/g,"");return t}rawBeforeComment(e,t){let r;e.walkComments((e=>{if(typeof e.raws.before!=="undefined"){r=e.raws.before;if(r.includes("\n")){r=r.replace(/[^\n]+$/,"")}return false}}));if(typeof r==="undefined"){r=this.raw(t,null,"beforeDecl")}else if(r){r=r.replace(/\S/g,"")}return r}rawBeforeDecl(e,t){let r;e.walkDecls((e=>{if(typeof e.raws.before!=="undefined"){r=e.raws.before;if(r.includes("\n")){r=r.replace(/[^\n]+$/,"")}return false}}));if(typeof r==="undefined"){r=this.raw(t,null,"beforeRule")}else if(r){r=r.replace(/\S/g,"")}return r}rawBeforeOpen(e){let t;e.walk((e=>{if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}}));return t}rawBeforeRule(e){let t;e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)){if(typeof r.raws.before!=="undefined"){t=r.raws.before;if(t.includes("\n")){t=t.replace(/[^\n]+$/,"")}return false}}}));if(t)t=t.replace(/\S/g,"");return t}rawColon(e){let t;e.walkDecls((e=>{if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}}));return t}rawEmptyBody(e){let t;e.walk((e=>{if(e.nodes&&e.nodes.length===0){t=e.raws.after;if(typeof t!=="undefined")return false}}));return t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;e.walk((r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e){if(typeof r.raws.before!=="undefined"){let e=r.raws.before.split("\n");t=e[e.length-1];t=t.replace(/\S/g,"");return false}}}));return t}rawSemicolon(e){let t;e.walk((e=>{if(e.nodes&&e.nodes.length&&e.last.type==="decl"){t=e.raws.semicolon;if(typeof t!=="undefined")return false}}));return t}rawValue(e,t){let r=e[t];let s=e.raws[t];if(s&&s.value===r){return s.raw}return r}root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}}stringify(e,t){if(!this[e.type]){throw new Error("Unknown AST node type "+e.type+". "+"Maybe you need to change PostCSS stringifier.")}this[e.type](e,t)}}e.exports=Stringifier;Stringifier.default=Stringifier},977:e=>{"use strict";e.exports=require("postcss")},46:e=>{"use strict";e.exports=require("postcss/lib/parser")}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var i=t[r]={exports:{}};var n=true;try{e[r](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(402);module.exports=r})(); (()=>{var e={45:(e,t,r)=>{const{Container:s}=r(977);class NestedDeclaration extends s{constructor(e){super(e);this.type="decl";this.isNested=true;if(!this.nodes)this.nodes=[]}}e.exports=NestedDeclaration},56:(e,t,r)=>{let{Input:s}=r(977);let i=r(475);e.exports=function scssParse(e,t){let r=new s(e,t);let n=new i(r);n.parse();return n.root}},475:(e,t,r)=>{let{Comment:s}=r(977);let i=r(46);let n=r(45);let l=r(2);class ScssParser extends i{createTokenizer(){this.tokenizer=l(this.input)}rule(e){let t=false;let r=0;let s="";for(let i of e){if(t){if(i[0]!=="comment"&&i[0]!=="{"){s+=i[1]}}else if(i[0]==="space"&&i[1].includes("\n")){break}else if(i[0]==="("){r+=1}else if(i[0]===")"){r-=1}else if(r===0&&i[0]===":"){t=true}}if(!t||s.trim()===""||/^[#:A-Za-z-]/.test(s)){super.rule(e)}else{e.pop();let t=new n;this.init(t,e[0][2]);let r;for(let t=e.length-1;t>=0;t--){if(e[t][0]!=="space"){r=e[t];break}}if(r[3]){let e=this.input.fromOffset(r[3]);t.source.end={offset:r[3],line:e.line,column:e.col}}else{let e=this.input.fromOffset(r[2]);t.source.end={offset:r[2],line:e.line,column:e.col}}while(e[0][0]!=="word"){t.raws.before+=e.shift()[1]}if(e[0][2]){let r=this.input.fromOffset(e[0][2]);t.source.start={offset:e[0][2],line:r.line,column:r.col}}t.prop="";while(e.length){let r=e[0][0];if(r===":"||r==="space"||r==="comment"){break}t.prop+=e.shift()[1]}t.raws.between="";let s;while(e.length){s=e.shift();if(s[0]===":"){t.raws.between+=s[1];break}else{t.raws.between+=s[1]}}if(t.prop[0]==="_"||t.prop[0]==="*"){t.raws.before+=t.prop[0];t.prop=t.prop.slice(1)}t.raws.between+=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(let r=e.length-1;r>0;r--){s=e[r];if(s[1]==="!important"){t.important=true;let s=this.stringFrom(e,r);s=this.spacesFromEnd(e)+s;if(s!==" !important"){t.raws.important=s}break}else if(s[1]==="important"){let s=e.slice(0);let i="";for(let e=r;e>0;e--){let t=s[e][0];if(i.trim().indexOf("!")===0&&t!=="space"){break}i=s.pop()[1]+i}if(i.trim().indexOf("!")===0){t.important=true;t.raws.important=i;e=s}}if(s[0]!=="space"&&s[0]!=="comment"){break}}this.raw(t,"value",e);if(t.value.includes(":")){this.checkMissedSemicolon(e)}this.current=t}}comment(e){if(e[4]==="inline"){let t=new s;this.init(t,e[2]);t.raws.inline=true;let r=this.input.fromOffset(e[3]);t.source.end={offset:e[3],line:r.line,column:r.col};let i=e[1].slice(2);if(/^\s*$/.test(i)){t.text="";t.raws.left=i;t.raws.right=""}else{let e=i.match(/^(\s*)([^]*\S)(\s*)$/);let r=e[2].replace(/(\*\/|\/\*)/g,"*//*");t.text=r;t.raws.left=e[1];t.raws.right=e[3];t.raws.text=e[2]}}else{super.comment(e)}}atrule(e){let t=e[1];let r=e;while(!this.tokenizer.endOfFile()){let e=this.tokenizer.nextToken();if(e[0]==="word"&&e[2]===r[3]+1){t+=e[1];r=e}else{this.tokenizer.back(e);break}}super.atrule(["at-word",t,e[2],r[3]])}raw(e,t,r){super.raw(e,t,r);if(e.raws[t]){let s=e.raws[t].raw;e.raws[t].raw=r.reduce(((e,t)=>{if(t[0]==="comment"&&t[4]==="inline"){let r=t[1].slice(2).replace(/(\*\/|\/\*)/g,"*//*");return e+"/*"+r+"*/"}else{return e+t[1]}}),"");if(s!==e.raws[t].raw){e.raws[t].scss=s}}}}e.exports=ScssParser},523:(e,t,r)=>{let s=r(534);class ScssStringifier extends s{comment(e){let t=this.raw(e,"left","commentLeft");let r=this.raw(e,"right","commentRight");if(e.raws.inline){let s=e.raws.text||e.text;this.builder("//"+t+s+r,e)}else{this.builder("/*"+t+e.text+r+"*/",e)}}decl(e,t){if(!e.isNested){super.decl(e,t)}else{let t=this.raw(e,"between","colon");let r=e.prop+t+this.rawValue(e,"value");if(e.important){r+=e.raws.important||" !important"}this.builder(r+"{",e,"start");let s;if(e.nodes&&e.nodes.length){this.body(e);s=this.raw(e,"after")}else{s=this.raw(e,"after","emptyBody")}if(s)this.builder(s);this.builder("}",e,"end")}}rawValue(e,t){let r=e[t];let s=e.raws[t];if(s&&s.value===r){return s.scss?s.scss:s.raw}else{return r}}}e.exports=ScssStringifier},157:(e,t,r)=>{let s=r(523);e.exports=function scssStringify(e,t){let r=new s(t);r.stringify(e)}},673:(e,t,r)=>{let s=r(157);let i=r(56);e.exports={parse:i,stringify:s}},2:e=>{"use strict";const t="'".charCodeAt(0);const r='"'.charCodeAt(0);const s="\\".charCodeAt(0);const i="/".charCodeAt(0);const n="\n".charCodeAt(0);const l=" ".charCodeAt(0);const a="\f".charCodeAt(0);const o="\t".charCodeAt(0);const f="\r".charCodeAt(0);const c="[".charCodeAt(0);const d="]".charCodeAt(0);const u="(".charCodeAt(0);const h=")".charCodeAt(0);const w="{".charCodeAt(0);const p="}".charCodeAt(0);const m=";".charCodeAt(0);const b="*".charCodeAt(0);const g=":".charCodeAt(0);const k="@".charCodeAt(0);const C=",".charCodeAt(0);const y="#".charCodeAt(0);const x=/[\t\n\f\r "#'()/;[\\\]{}]/g;const A=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g;const _=/.[\n"'(/\\]/;const S=/[\da-f]/i;const O=/[\n\f\r]/g;e.exports=function scssTokenize(e,v={}){let I=e.css.valueOf();let z=v.ignoreErrors;let B,D,q,F,R;let T,N,V,$;let E=I.length;let P=0;let U=[];let L=[];let M;function position(){return P}function unclosed(t){throw e.error("Unclosed "+t,P)}function endOfFile(){return L.length===0&&P>=E}function interpolation(){let e=1;let i=false;let n=false;while(e>0){D+=1;if(I.length<=D)unclosed("interpolation");B=I.charCodeAt(D);V=I.charCodeAt(D+1);if(i){if(!n&&B===i){i=false;n=false}else if(B===s){n=!n}else if(n){n=false}}else if(B===t||B===r){i=B}else if(B===p){e-=1}else if(B===y&&V===w){e+=1}}}function nextToken(e){if(L.length)return L.pop();if(P>=E)return;let v=e?e.ignoreUnclosed:false;B=I.charCodeAt(P);switch(B){case n:case l:case o:case f:case a:{D=P;do{D+=1;B=I.charCodeAt(D)}while(B===l||B===n||B===o||B===f||B===a);$=["space",I.slice(P,D)];P=D-1;break}case c:case d:case w:case p:case g:case m:case h:{let e=String.fromCharCode(B);$=[e,e,P];break}case C:{$=["word",",",P,P+1];break}case u:{N=U.length?U.pop()[1]:"";V=I.charCodeAt(P+1);if(N==="url"&&V!==t&&V!==r){M=1;T=false;D=P+1;while(D<=I.length-1){V=I.charCodeAt(D);if(V===s){T=!T}else if(V===u){M+=1}else if(V===h){M-=1;if(M===0)break}D+=1}F=I.slice(P,D+1);$=["brackets",F,P,D];P=D}else{D=I.indexOf(")",P+1);F=I.slice(P,D+1);if(D===-1||_.test(F)){$=["(","(",P]}else{$=["brackets",F,P,D];P=D}}break}case t:case r:{q=B;D=P;T=false;while(D<E){D++;if(D===E)unclosed("string");B=I.charCodeAt(D);V=I.charCodeAt(D+1);if(!T&&B===q){break}else if(B===s){T=!T}else if(T){T=false}else if(B===y&&V===w){interpolation()}}$=["string",I.slice(P,D+1),P,D];P=D;break}case k:{x.lastIndex=P+1;x.test(I);if(x.lastIndex===0){D=I.length-1}else{D=x.lastIndex-2}$=["at-word",I.slice(P,D+1),P,D];P=D;break}case s:{D=P;R=true;while(I.charCodeAt(D+1)===s){D+=1;R=!R}B=I.charCodeAt(D+1);if(R&&B!==i&&B!==l&&B!==n&&B!==o&&B!==f&&B!==a){D+=1;if(S.test(I.charAt(D))){while(S.test(I.charAt(D+1))){D+=1}if(I.charCodeAt(D+1)===l){D+=1}}}$=["word",I.slice(P,D+1),P,D];P=D;break}default:V=I.charCodeAt(P+1);if(B===y&&V===w){D=P;interpolation();F=I.slice(P,D+1);$=["word",F,P,D];P=D}else if(B===i&&V===b){D=I.indexOf("*/",P+2)+1;if(D===0){if(z||v){D=I.length}else{unclosed("comment")}}$=["comment",I.slice(P,D+1),P,D];P=D}else if(B===i&&V===i){O.lastIndex=P+1;O.test(I);if(O.lastIndex===0){D=I.length-1}else{D=O.lastIndex-2}F=I.slice(P,D+1);$=["comment",F,P,D,"inline"];P=D}else{A.lastIndex=P+1;A.test(I);if(A.lastIndex===0){D=I.length-1}else{D=A.lastIndex-2}$=["word",I.slice(P,D+1),P,D];U.push($);P=D}break}P++;return $}function back(e){L.push(e)}return{back:back,nextToken:nextToken,endOfFile:endOfFile,position:position}}},534:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:false};function capitalize(e){return e[0].toUpperCase()+e.slice(1)}class Stringifier{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;let s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!=="undefined"){r+=e.raws.afterName}else if(s){r+=" "}if(e.nodes){this.block(e,r+s)}else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+s+i,e)}}beforeAfter(e,t){let r;if(e.type==="decl"){r=this.raw(e,null,"beforeDecl")}else if(e.type==="comment"){r=this.raw(e,null,"beforeComment")}else if(t==="before"){r=this.raw(e,null,"beforeRule")}else{r=this.raw(e,null,"beforeClose")}let s=e.parent;let i=0;while(s&&s.type!=="root"){i+=1;s=s.parent}if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length){for(let e=0;e<i;e++)r+=t}}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let s;if(e.nodes&&e.nodes.length){this.body(e);s=this.raw(e,"after")}else{s=this.raw(e,"after","emptyBody")}if(s)this.builder(s);this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;while(t>0){if(e.nodes[t].type!=="comment")break;t-=1}let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let i=e.nodes[s];let n=this.raw(i,"before");if(n)this.builder(n);this.stringify(i,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft");let r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon");let s=e.prop+r+this.rawValue(e,"value");if(e.important){s+=e.raws.important||" !important"}if(t)s+=";";this.builder(s,e)}document(e){this.body(e)}raw(e,r,s){let i;if(!s)s=r;if(r){i=e.raws[r];if(typeof i!=="undefined")return i}let n=e.parent;if(s==="before"){if(!n||n.type==="root"&&n.first===e){return""}if(n&&n.type==="document"){return""}}if(!n)return t[s];let l=e.root();if(!l.rawCache)l.rawCache={};if(typeof l.rawCache[s]!=="undefined"){return l.rawCache[s]}if(s==="before"||s==="after"){return this.beforeAfter(e,s)}else{let t="raw"+capitalize(s);if(this[t]){i=this[t](l,e)}else{l.walk((e=>{i=e.raws[r];if(typeof i!=="undefined")return false}))}}if(typeof i==="undefined")i=t[s];l.rawCache[s]=i;return i}rawBeforeClose(e){let t;e.walk((e=>{if(e.nodes&&e.nodes.length>0){if(typeof e.raws.after!=="undefined"){t=e.raws.after;if(t.includes("\n")){t=t.replace(/[^\n]+$/,"")}return false}}}));if(t)t=t.replace(/\S/g,"");return t}rawBeforeComment(e,t){let r;e.walkComments((e=>{if(typeof e.raws.before!=="undefined"){r=e.raws.before;if(r.includes("\n")){r=r.replace(/[^\n]+$/,"")}return false}}));if(typeof r==="undefined"){r=this.raw(t,null,"beforeDecl")}else if(r){r=r.replace(/\S/g,"")}return r}rawBeforeDecl(e,t){let r;e.walkDecls((e=>{if(typeof e.raws.before!=="undefined"){r=e.raws.before;if(r.includes("\n")){r=r.replace(/[^\n]+$/,"")}return false}}));if(typeof r==="undefined"){r=this.raw(t,null,"beforeRule")}else if(r){r=r.replace(/\S/g,"")}return r}rawBeforeOpen(e){let t;e.walk((e=>{if(e.type!=="decl"){t=e.raws.between;if(typeof t!=="undefined")return false}}));return t}rawBeforeRule(e){let t;e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)){if(typeof r.raws.before!=="undefined"){t=r.raws.before;if(t.includes("\n")){t=t.replace(/[^\n]+$/,"")}return false}}}));if(t)t=t.replace(/\S/g,"");return t}rawColon(e){let t;e.walkDecls((e=>{if(typeof e.raws.between!=="undefined"){t=e.raws.between.replace(/[^\s:]/g,"");return false}}));return t}rawEmptyBody(e){let t;e.walk((e=>{if(e.nodes&&e.nodes.length===0){t=e.raws.after;if(typeof t!=="undefined")return false}}));return t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;e.walk((r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e){if(typeof r.raws.before!=="undefined"){let e=r.raws.before.split("\n");t=e[e.length-1];t=t.replace(/\S/g,"");return false}}}));return t}rawSemicolon(e){let t;e.walk((e=>{if(e.nodes&&e.nodes.length&&e.last.type==="decl"){t=e.raws.semicolon;if(typeof t!=="undefined")return false}}));return t}rawValue(e,t){let r=e[t];let s=e.raws[t];if(s&&s.value===r){return s.raw}return r}root(e){this.body(e);if(e.raws.after)this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector"));if(e.raws.ownSemicolon){this.builder(e.raws.ownSemicolon,e,"end")}}stringify(e,t){if(!this[e.type]){throw new Error("Unknown AST node type "+e.type+". "+"Maybe you need to change PostCSS stringifier.")}this[e.type](e,t)}}e.exports=Stringifier;Stringifier.default=Stringifier},977:e=>{"use strict";e.exports=require("postcss")},46:e=>{"use strict";e.exports=require("postcss/lib/parser")}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var i=t[r]={exports:{}};var n=true;try{e[r](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(673);module.exports=r})();
\ No newline at end of file \ No newline at end of file
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
"jsx": "react-jsx", "jsx": "react-jsx",
"module": "ESNext", "module": "ESNext",
"target": "ES2018", "target": "ES2018",
"moduleResolution": "node", "moduleResolution": "bundler",
"ignoreDeprecations": "6.0",
"types": ["trusted-types", "jest", "node"], "types": ["trusted-types", "jest", "node"],
"paths": { "paths": {
// Required absolute paths. // Required absolute paths.
......
...@@ -485,9 +485,7 @@ declare module 'next/dist/compiled/@next/react-refresh-utils/dist/ReactRefreshWe ...@@ -485,9 +485,7 @@ declare module 'next/dist/compiled/@next/react-refresh-utils/dist/ReactRefreshWe
} }
declare module 'next/dist/compiled/commander' { declare module 'next/dist/compiled/commander' {
import commander from 'commander'
export * from 'commander' export * from 'commander'
export default commander
} }
declare module 'next/dist/compiled/node-html-parser' { declare module 'next/dist/compiled/node-html-parser' {
...@@ -571,11 +569,6 @@ declare module 'next/dist/compiled/@hapi/accept' { ...@@ -571,11 +569,6 @@ declare module 'next/dist/compiled/@hapi/accept' {
export = m export = m
} }
declare module 'next/dist/compiled/acorn' {
import m from 'acorn'
export = m
}
declare module 'next/dist/compiled/superstruct' { declare module 'next/dist/compiled/superstruct' {
import * as m from 'superstruct' import * as m from 'superstruct'
export = m export = m
...@@ -759,8 +752,7 @@ declare module 'next/dist/compiled/strip-ansi' { ...@@ -759,8 +752,7 @@ declare module 'next/dist/compiled/strip-ansi' {
export = m export = m
} }
declare module 'next/dist/compiled/@vercel/blob' { declare module 'next/dist/compiled/@vercel/blob' {
import m from '@vercel/blob' export * from '@vercel/blob'
export = m
} }
declare module 'next/dist/compiled/@vercel/nft' { declare module 'next/dist/compiled/@vercel/nft' {
import m from '@vercel/nft' import m from '@vercel/nft'
......
diff --git a/package.json b/package.json
index bb36a6d98d3f021a551543c868b10609c8dd7134..38bc7a65aad6bf5c0f0894c9b3619ee614ce66ef 100644
--- a/package.json
+++ b/package.json
@@ -32,6 +32,7 @@
"require": "./dist/cjs/server/index.js"
},
"./*": {
+ "types": "./dist/esm/*.d.ts",
"import": "./dist/esm/*",
"require": "./dist/cjs/*"
}
diff --git a/package.json b/package.json
index 7ac1dadcd87254c0ea5adb71dae477b9d38dcf83..293d7462e7efbbda826ab6d740c566e6e63a2989 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"type": "module",
"exports": {
".": {
+ "types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
diff --git a/package.json b/package.json
index 826e347ec40c413f99289c8069810702d79d2573..4419e5f77483599d2e6d4975415ac3b98e77215c 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"types": "lib/scss-syntax.d.ts",
"exports": {
".": {
+ "types": "./lib/scss-syntax.d.ts",
"require": "./lib/scss-syntax.js",
"import": "./lib/scss-syntax.mjs"
},
...@@ -25,18 +25,27 @@ overrides: ...@@ -25,18 +25,27 @@ overrides:
packageExtensionsChecksum: sha256-ylDR55omOZlT4Sfpfh6n7mO2r/cLCmlirAikJ/E/LAw= packageExtensionsChecksum: sha256-ylDR55omOZlT4Sfpfh6n7mO2r/cLCmlirAikJ/E/LAw=
patchedDependencies: patchedDependencies:
'@modelcontextprotocol/sdk':
hash: 680fe4edb7abd1de29d08cdf217a22506e815a8cc1c2282201d5d47aa3e5da12
path: patches/@modelcontextprotocol__sdk.patch
'@rspack/core@1.6.7': '@rspack/core@1.6.7':
hash: 4cf28ea116b0e27c7c80b09035905f9d16a7b18d1f2b7d312fc80d42cd57068d hash: 4cf28ea116b0e27c7c80b09035905f9d16a7b18d1f2b7d312fc80d42cd57068d
path: patches/@rspack__core@1.6.7.patch path: patches/@rspack__core@1.6.7.patch
'@types/node@20.17.6': '@types/node@20.17.6':
hash: 9c31d25336aea4076b3cb942c35e59fd160c540947f01ea455a060367153f9fd hash: 9c31d25336aea4076b3cb942c35e59fd160c540947f01ea455a060367153f9fd
path: patches/@types__node@20.17.6.patch path: patches/@types__node@20.17.6.patch
'@vercel/blob':
hash: cb53bfa5effb15b3a361e176003df667cadf757b27b7c9b458c2f0fce86ea893
path: patches/@vercel__blob.patch
http-proxy@1.18.1: http-proxy@1.18.1:
hash: 3aac1c597fabd03f9fb4e3fd6e689b87012758d4fed06f296541f9dc3b8d7b39 hash: 3aac1c597fabd03f9fb4e3fd6e689b87012758d4fed06f296541f9dc3b8d7b39
path: patches/http-proxy@1.18.1.patch path: patches/http-proxy@1.18.1.patch
minizlib@3.1.0: minizlib@3.1.0:
hash: 587688821244aaee46680929cd869947377a284ac1b30c9ae8660a5ea7d2be67 hash: 587688821244aaee46680929cd869947377a284ac1b30c9ae8660a5ea7d2be67
path: patches/minizlib@3.1.0.patch path: patches/minizlib@3.1.0.patch
postcss-scss:
hash: 88893e632b3e099730dc0ffcc93cf3654b31c277da9e2796e822f6b5aeedc093
path: patches/postcss-scss.patch
stacktrace-parser@0.1.10: stacktrace-parser@0.1.10:
hash: 5e07adcb70fa52f969ea76c939668fd09762774a60ec849622e44e5362354dd5 hash: 5e07adcb70fa52f969ea76c939668fd09762774a60ec849622e44e5362354dd5
path: patches/stacktrace-parser@0.1.10.patch path: patches/stacktrace-parser@0.1.10.patch
...@@ -1213,7 +1222,7 @@ importers: ...@@ -1213,7 +1222,7 @@ importers:
version: 29.5.0 version: 29.5.0
'@modelcontextprotocol/sdk': '@modelcontextprotocol/sdk':
specifier: 1.18.1 specifier: 1.18.1
version: 1.18.1 version: 1.18.1(patch_hash=680fe4edb7abd1de29d08cdf217a22506e815a8cc1c2282201d5d47aa3e5da12)
'@mswjs/interceptors': '@mswjs/interceptors':
specifier: 0.23.0 specifier: 0.23.0
version: 0.23.0 version: 0.23.0
...@@ -1384,7 +1393,7 @@ importers: ...@@ -1384,7 +1393,7 @@ importers:
version: 8.2.0 version: 8.2.0
'@vercel/blob': '@vercel/blob':
specifier: 2.3.2 specifier: 2.3.2
version: 2.3.2 version: 2.3.2(patch_hash=cb53bfa5effb15b3a361e176003df667cadf757b27b7c9b458c2f0fce86ea893)
'@vercel/ncc': '@vercel/ncc':
specifier: 0.34.0 specifier: 0.34.0
version: 0.34.0 version: 0.34.0
...@@ -1639,7 +1648,7 @@ importers: ...@@ -1639,7 +1648,7 @@ importers:
version: 6.0.0(postcss@8.4.31) version: 6.0.0(postcss@8.4.31)
postcss-scss: postcss-scss:
specifier: 4.0.3 specifier: 4.0.3
version: 4.0.3(postcss@8.4.31) version: 4.0.3(patch_hash=88893e632b3e099730dc0ffcc93cf3654b31c277da9e2796e822f6b5aeedc093)(postcss@8.4.31)
postcss-value-parser: postcss-value-parser:
specifier: 4.2.0 specifier: 4.2.0
version: 4.2.0 version: 4.2.0
...@@ -21638,7 +21647,7 @@ snapshots: ...@@ -21638,7 +21647,7 @@ snapshots:
'@types/react': 19.2.10 '@types/react': 19.2.10
react: 19.3.0-canary-fef12a01-20260413 react: 19.3.0-canary-fef12a01-20260413
'@modelcontextprotocol/sdk@1.18.1': '@modelcontextprotocol/sdk@1.18.1(patch_hash=680fe4edb7abd1de29d08cdf217a22506e815a8cc1c2282201d5d47aa3e5da12)':
dependencies: dependencies:
ajv: 6.12.6 ajv: 6.12.6
content-type: 1.0.5 content-type: 1.0.5
...@@ -24690,7 +24699,7 @@ snapshots: ...@@ -24690,7 +24699,7 @@ snapshots:
- react-native-b4a - react-native-b4a
- supports-color - supports-color
'@vercel/blob@2.3.2': '@vercel/blob@2.3.2(patch_hash=cb53bfa5effb15b3a361e176003df667cadf757b27b7c9b458c2f0fce86ea893)':
dependencies: dependencies:
async-retry: 1.3.3 async-retry: 1.3.3
is-buffer: 2.0.5 is-buffer: 2.0.5
...@@ -35495,7 +35504,7 @@ snapshots: ...@@ -35495,7 +35504,7 @@ snapshots:
dependencies: dependencies:
postcss: 8.4.31 postcss: 8.4.31
postcss-scss@4.0.3(postcss@8.4.31): postcss-scss@4.0.3(patch_hash=88893e632b3e099730dc0ffcc93cf3654b31c277da9e2796e822f6b5aeedc093)(postcss@8.4.31):
dependencies: dependencies:
postcss: 8.4.31 postcss: 8.4.31
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
"jsx": "react-jsx", "jsx": "react-jsx",
"module": "ESNext", "module": "ESNext",
"target": "ESNext", "target": "ESNext",
"moduleResolution": "node", "moduleResolution": "bundler",
"ignoreDeprecations": "6.0",
"types": ["react", "jest", "node", "trusted-types", "jest-extended"], "types": ["react", "jest", "node", "trusted-types", "jest-extended"],
"paths": { "paths": {
"development-sandbox": ["./test/lib/development-sandbox"], "development-sandbox": ["./test/lib/development-sandbox"],
......
...@@ -16,11 +16,10 @@ ...@@ -16,11 +16,10 @@
// environment // environment
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "esnext", "target": "esnext",
"ignoreDeprecations": "6.0",
// modules // modules
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "bundler",
// emit // emit
"noEmit": true, "noEmit": true,
......
// Compile with pnpm tsc turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map-merged/input/sourcemapped.ts --sourceMap --inlineSources --target esnext // Compile with pnpm tsc turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map-merged/sourcemapped.ts --sourceMap --inlineSources --target esnext
// tsc compile errors can be ignored // tsc compile errors can be ignored
type Fn<T> = () => T type Fn<T> = () => T
export function runExternalSourceMapped<T>(fn: Fn<T>): T { export function runExternalSourceMapped<T>(fn: Fn<T>): T {
......
// Compile with pnpm tsc turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/sourcemapped.ts --sourceMap --inlineSources --target esnext // Compile with pnpm tsc turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/sourcemapped.ts --sourceMap --inlineSources --target esnext
// tsc compile errors can be ignored // tsc compile errors can be ignored
type Fn<T> = () => T type Fn<T> = () => T
export function runExternalSourceMapped<T>(fn: Fn<T>): T { export function runExternalSourceMapped<T>(fn: Fn<T>): T {
......
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2018", "target": "ES2018",
"module": "commonjs", "module": "NodeNext",
"moduleResolution": "node", "moduleResolution": "NodeNext",
"ignoreDeprecations": "6.0",
"strict": true, "strict": true,
"importHelpers": false, "importHelpers": false,
"noEmitHelpers": false, "noEmitHelpers": false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment