@mcp-use/inspector 20.0.0-beta.22 → 20.0.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import{createServer as qr}from"http";import{Http2ServerRequest as yt,constants as zr}from"http2";import{Http2ServerRequest as _e}from"http2";import{Readable as mt}from"stream";import rn from"crypto";var N=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},Wr=e=>e instanceof N?e:new N(e.message,{cause:e}),Vr=global.Request,Z=class extends Vr{constructor(e,t){typeof e=="object"&&V in e&&(e=e[V]()),typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},Gr=e=>{let t=[],r=e.rawHeaders;for(let n=0;n<r.length;n+=2){let{[n]:o,[n+1]:s}=r;o.charCodeAt(0)!==58&&t.push([o,s])}return new Headers(t)},bt=Symbol("wrapBodyStream"),Kr=(e,t,r,n,o)=>{let s={method:e,headers:r,signal:o.signal};if(e==="TRACE"){s.method="GET";let i=new Z(t,s);return Object.defineProperty(i,"method",{get(){return"TRACE"}}),i}if(!(e==="GET"||e==="HEAD"))if("rawBody"in n&&n.rawBody instanceof Buffer)s.body=new ReadableStream({start(i){i.enqueue(n.rawBody),i.close()}});else if(n[bt]){let i;s.body=new ReadableStream({async pull(a){try{i||=mt.toWeb(n).getReader();let{done:c,value:l}=await i.read();c?a.close():a.enqueue(l)}catch(c){a.error(c)}}})}else s.body=mt.toWeb(n);return new Z(t,s)},V=Symbol("getRequestCache"),Xr=Symbol("requestCache"),ae=Symbol("incomingKey"),ce=Symbol("urlKey"),Jr=Symbol("headersKey"),W=Symbol("abortControllerKey"),Yr=Symbol("getAbortController"),le={get method(){return this[ae].method||"GET"},get url(){return this[ce]},get headers(){return this[Jr]||=Gr(this[ae])},[Yr](){return this[V](),this[W]},[V](){return this[W]||=new AbortController,this[Xr]||=Kr(this.method,this[ce],this.headers,this[ae],this[W])}};["body","bodyUsed","cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","signal","keepalive"].forEach(e=>{Object.defineProperty(le,e,{get(){return this[V]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(le,e,{value:function(){return this[V]()[e]()}})});Object.setPrototypeOf(le,Z.prototype);var Qr=(e,t)=>{let r=Object.create(le);r[ae]=e;let n=e.url||"";if(n[0]!=="/"&&(n.startsWith("http://")||n.startsWith("https://"))){if(e instanceof _e)throw new N("Absolute URL for :path is not allowed in HTTP/2");try{let a=new URL(n);r[ce]=a.href}catch(a){throw new N("Invalid absolute URL",{cause:a})}return r}let o=(e instanceof _e?e.authority:e.headers.host)||t;if(!o)throw new N("Missing host header");let s;if(e instanceof _e){if(s=e.scheme,!(s==="http"||s==="https"))throw new N("Unsupported scheme")}else s=e.socket&&e.socket.encrypted?"https":"http";let i=new URL(`${s}://${o}${n}`);if(i.hostname.length!==o.length&&i.hostname!==o.replace(/:\d+$/,""))throw new N("Invalid host header");return r[ce]=i.href,r},gt=Symbol("responseCache"),z=Symbol("getResponseCache"),$=Symbol("cache"),Ue=global.Response,ee=class vt{#t;#e;[z](){return delete this[$],this[gt]||=new Ue(this.#t,this.#e)}constructor(t,r){let n;if(this.#t=t,r instanceof vt){let o=r[gt];if(o){this.#e=o,this[z]();return}else this.#e=r.#e,n=new Headers(r.#e.headers)}else this.#e=r;(typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[$]=[r?.status||200,t,n||r?.headers])}get headers(){let t=this[$];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||{"content-type":"text/plain; charset=UTF-8"})),t[2]):this[z]().headers}get status(){return this[$]?.[0]??this[z]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(ee.prototype,e,{get(){return this[z]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(ee.prototype,e,{value:function(){return this[z]()[e]()}})});Object.setPrototypeOf(ee,Ue);Object.setPrototypeOf(ee.prototype,Ue.prototype);async function Zr(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function xt(e,t,r){let n=a=>{e.cancel(a).catch(()=>{})};return t.on("close",n),t.on("error",n),(r??e.read()).then(i,o),e.closed.finally(()=>{t.off("close",n),t.off("error",n)});function o(a){a&&t.destroy(a)}function s(){e.read().then(i,o)}function i({done:a,value:c}){try{if(a)t.end();else if(!t.write(c))t.once("drain",s);else return e.read().then(i,o)}catch(l){o(l)}}}function en(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:xt(e.getReader(),t)}var Le=e=>{let t={};e instanceof Headers||(e=new Headers(e??void 0));let r=[];for(let[n,o]of e)n==="set-cookie"?r.push(o):t[n]=o;return r.length>0&&(t["set-cookie"]=r),t["content-type"]??="text/plain; charset=UTF-8",t},tn="x-hono-already-sent";typeof global.crypto>"u"&&(global.crypto=rn);var Me=Symbol("outgoingEnded"),wt=Symbol("incomingDraining"),nn=500,on=64*1024*1024,Te=e=>{let t=e;if(e.destroyed||t[wt])return;if(t[wt]=!0,e instanceof yt){try{e.stream?.close?.(zr.NGHTTP2_NO_ERROR)}catch{}return}let r=0,n=()=>{clearTimeout(s),e.off("data",i),e.off("end",n),e.off("error",n)},o=()=>{n();let a=e.socket;a&&!a.destroyed&&a.destroySoon()},s=setTimeout(o,nn);s.unref?.();let i=a=>{r+=a.length,r>on&&o()};e.on("data",i),e.on("end",n),e.on("error",n),e.resume()},sn=()=>new Response(null,{status:400}),Rt=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),ke=(e,t)=>{let r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},Et=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},St=async(e,t)=>{let[r,n,o]=e[$],s=!1;if(!o)o={"content-type":"text/plain; charset=UTF-8"};else if(o instanceof Headers)s=o.has("content-length"),o=Le(o);else if(Array.isArray(o)){let i=new Headers(o);s=i.has("content-length"),o=Le(i)}else for(let i in o)if(i.length===14&&i.toLowerCase()==="content-length"){s=!0;break}s||(typeof n=="string"?o["Content-Length"]=Buffer.byteLength(n):n instanceof Uint8Array?o["Content-Length"]=n.byteLength:n instanceof Blob&&(o["Content-Length"]=n.size)),t.writeHead(r,o),typeof n=="string"||n instanceof Uint8Array?t.end(n):n instanceof Blob?t.end(new Uint8Array(await n.arrayBuffer())):(Et(t),await en(n,t)?.catch(i=>ke(i,t))),t[Me]?.()},an=e=>typeof e.then=="function",cn=async(e,t,r={})=>{if(an(e))if(r.errorHandler)try{e=await e}catch(o){let s=await r.errorHandler(o);if(!s)return;e=s}else e=await e.catch(Rt);if($ in e)return St(e,t);let n=Le(e.headers);if(e.body){let o=e.body.getReader(),s=[],i=!1,a;if(n["transfer-encoding"]!=="chunked"){let c=2;for(let l=0;l<c;l++){a||=o.read();let u=await Zr(a).catch(d=>{console.error(d),i=!0});if(!u){if(l===1){await new Promise(d=>setTimeout(d)),c=3;continue}break}if(a=void 0,u.value&&s.push(u.value),u.done){i=!0;break}}i&&!("content-length"in n)&&(n["content-length"]=s.reduce((l,u)=>l+u.length,0))}t.writeHead(e.status,n),s.forEach(c=>{t.write(c)}),i?t.end():(s.length===0&&Et(t),await xt(o,t,a))}else n[tn]||(t.writeHead(e.status,n),t.end());t[Me]?.()},ln=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==Z&&(Object.defineProperty(global,"Request",{value:Z}),Object.defineProperty(global,"Response",{value:ee})),async(n,o)=>{let s,i;try{i=Qr(n,t.hostname);let a=!r||n.method==="GET"||n.method==="HEAD";if(a||(n[bt]=!0,n.on("end",()=>{a=!0}),n instanceof yt&&(o[Me]=()=>{a||setTimeout(()=>{a||setTimeout(()=>{Te(n)})})}),o.on("finish",()=>{a||Te(n)})),o.on("close",()=>{i[W]&&(n.errored?i[W].abort(n.errored.toString()):o.writableFinished||i[W].abort("Client connection prematurely closed.")),a||setTimeout(()=>{a||setTimeout(()=>{Te(n)})})}),s=e(i,{incoming:n,outgoing:o}),$ in s)return St(s,o)}catch(a){if(s)return ke(a,o);if(t.errorHandler){if(s=await t.errorHandler(i?a:Wr(a)),!s)return}else i?s=Rt(a):s=sn()}try{return await cn(s,o,t)}catch(a){return ke(a,o)}}},un=e=>{let t=e.fetch,r=ln(t,{hostname:e.hostname,overrideGlobalObjects:e.overrideGlobalObjects,autoCleanupIncoming:e.autoCleanupIncoming});return(e.createServer||qr)(e.serverOptions||{},r)},Pt=(e,t)=>{let r=un(e);return r.listen(e?.port??3e3,e.hostname,()=>{let n=r.address();t&&t(n)}),r};var Ie=(e,t,r)=>(n,o)=>{let s=-1;return i(0);async function i(a){if(a<=s)throw new Error("next() called multiple times");s=a;let c,l=!1,u;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&o||void 0,u)try{c=await u(n,()=>i(a+1))}catch(d){if(d instanceof Error&&t)n.error=d,c=await t(d,n),l=!0;else throw d}else n.finalized===!1&&r&&(c=await r(n));return c&&(n.finalized===!1||l)&&(n.res=c),n}};var At=Symbol();var Ct=async(e,t=Object.create(null))=>{let{all:r=!1,dot:n=!1}=t,s=(e instanceof ue?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?dn(e,{all:r,dot:n}):{}};async function dn(e,t){let r=await e.formData();return r?pn(r,t):{}}function pn(e,t){let r=Object.create(null);return e.forEach((n,o)=>{t.all||o.endsWith("[]")?fn(r,o,n):r[o]=n}),t.dot&&Object.entries(r).forEach(([n,o])=>{n.includes(".")&&(hn(r,n,o),delete r[n])}),r}var fn=(e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},hn=(e,t,r)=>{if(/(?:^|\.)__proto__\./.test(t))return;let n=e,o=t.split(".");o.forEach((s,i)=>{i===o.length-1?n[s]=r:((!n[s]||typeof n[s]!="object"||Array.isArray(n[s])||n[s]instanceof File)&&(n[s]=Object.create(null)),n=n[s])})};var je=e=>{let t=e.split("/");return t[0]===""&&t.shift(),t},Ot=e=>{let{groups:t,path:r}=mn(e),n=je(r);return gn(n,t)},mn=e=>{let t=[];return e=e.replace(/\{[^}]+\}/g,(r,n)=>{let o=`@${n}`;return t.push([o,r]),o}),{groups:t,path:e}},gn=(e,t)=>{for(let r=t.length-1;r>=0;r--){let[n]=t[r];for(let o=e.length-1;o>=0;o--)if(e[o].includes(n)){e[o]=e[o].replace(n,t[r][1]);break}}return e},de={},_t=(e,t)=>{if(e==="*")return"*";let r=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(r){let n=`${e}#${t}`;return de[n]||(r[2]?de[n]=t&&t[0]!==":"&&t[0]!=="*"?[n,r[1],new RegExp(`^${r[2]}(?=/${t})`)]:[e,r[1],new RegExp(`^${r[2]}$`)]:de[n]=[e,r[1],!0]),de[n]}return null},pe=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},wn=e=>pe(e,decodeURI),Ne=e=>{let t=e.url,r=t.indexOf("/",t.indexOf(":")+4),n=r;for(;n<t.length;n++){let o=t.charCodeAt(n);if(o===37){let s=t.indexOf("?",n),i=t.indexOf("#",n),a=s===-1?i===-1?void 0:i:i===-1?s:Math.min(s,i),c=t.slice(r,a);return wn(c.includes("%25")?c.replace(/%25/g,"%2525"):c)}else if(o===63||o===35)break}return t.slice(r,n)};var Tt=e=>{let t=Ne(e);return t.length>1&&t.at(-1)==="/"?t.slice(0,-1):t},H=(e,t,...r)=>(r.length&&(t=H(t,...r)),`${e?.[0]==="/"?"":"/"}${e}${t==="/"?"":`${e?.at(-1)==="/"?"":"/"}${t?.[0]==="/"?t.slice(1):t}`}`),fe=e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(":"))return null;let t=e.split("/"),r=[],n="";return t.forEach(o=>{if(o!==""&&!/\:/.test(o))n+="/"+o;else if(/\:/.test(o))if(/\?/.test(o)){r.length===0&&n===""?r.push("/"):r.push(n);let s=o.replace("?","");n+="/"+s,r.push(n)}else n+="/"+o}),r.filter((o,s,i)=>i.indexOf(o)===s)},He=e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?pe(e,$e):e):e,Lt=(e,t,r)=>{let n;if(!r&&t&&!/[%+]/.test(t)){let i=e.indexOf("?",8);if(i===-1)return;for(e.startsWith(t,i+1)||(i=e.indexOf(`&${t}`,i+1));i!==-1;){let a=e.charCodeAt(i+t.length+1);if(a===61){let c=i+t.length+2,l=e.indexOf("&",c);return He(e.slice(c,l===-1?void 0:l))}else if(a==38||isNaN(a))return"";i=e.indexOf(`&${t}`,i+1)}if(n=/[%+]/.test(e),!n)return}let o={};n??=/[%+]/.test(e);let s=e.indexOf("?",8);for(;s!==-1;){let i=e.indexOf("&",s+1),a=e.indexOf("=",s);a>i&&i!==-1&&(a=-1);let c=e.slice(s+1,a===-1?i===-1?void 0:i:a);if(n&&(c=He(c)),s=i,c==="")continue;let l;a===-1?l="":(l=e.slice(a+1,i===-1?void 0:i),n&&(l=He(l))),r?(o[c]&&Array.isArray(o[c])||(o[c]=[]),o[c].push(l)):o[c]??=l}return t?o[t]:o},kt=Lt,Ut=(e,t)=>Lt(e,t,!0),$e=decodeURIComponent;var Mt=e=>pe(e,$e),ue=class{raw;#t;#e;routeIndex=0;path;bodyCache={};constructor(e,t="/",r=[[]]){this.raw=e,this.path=t,this.#e=r,this.#t={}}param(e){return e?this.#r(e):this.#s()}#r(e){let t=this.#e[0][this.routeIndex][1][e],r=this.#o(t);return r&&/\%/.test(r)?Mt(r):r}#s(){let e={},t=Object.keys(this.#e[0][this.routeIndex][1]);for(let r of t){let n=this.#o(this.#e[0][this.routeIndex][1][r]);n!==void 0&&(e[r]=/\%/.test(n)?Mt(n):n)}return e}#o(e){return this.#e[1]?this.#e[1][e]:e}query(e){return kt(this.url,e)}queries(e){return Ut(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t={};return this.raw.headers.forEach((r,n)=>{t[n]=r}),t}async parseBody(e){return Ct(this,e)}#n=e=>{let{bodyCache:t,raw:r}=this,n=t[e];if(n)return n;let o=Object.keys(t)[0];return o?t[o].then(s=>(o==="json"&&(s=JSON.stringify(s)),new Response(s)[e]())):t[e]=r[e]()};json(){return this.#n("text").then(e=>JSON.parse(e))}text(){return this.#n("text")}arrayBuffer(){return this.#n("arrayBuffer")}bytes(){return this.#n("arrayBuffer").then(e=>new Uint8Array(e))}blob(){return this.#n("blob")}formData(){return this.#n("formData")}addValidatedData(e,t){this.#t[e]=t}valid(e){return this.#t[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[At](){return this.#e}get matchedRoutes(){return this.#e[0].map(([[,e]])=>e)}get routePath(){return this.#e[0].map(([[,e]])=>e)[this.routeIndex].path}};var It={Stringify:1,BeforeStream:2,Stream:3},yn=(e,t)=>{let r=new String(e);return r.isEscaped=!0,r.callbacks=t,r};var Be=async(e,t,r,n,o)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let s=e.callbacks;if(!s?.length)return Promise.resolve(e);o?o[0]+=e:o=[e];let i=Promise.all(s.map(a=>a({phase:t,buffer:o,context:n}))).then(a=>Promise.all(a.filter(Boolean).map(c=>Be(c,t,!1,n,o))).then(()=>o[0]));return r?yn(await i,s):i};var bn="text/plain; charset=UTF-8",De=(e,t)=>({"Content-Type":e,...t}),te=(e,t)=>new Response(e,t),Fe=class{#t;#e;env={};#r;finalized=!1;error;#s;#o;#n;#u;#c;#l;#a;#d;#p;constructor(e,t){this.#t=e,t&&(this.#o=t.executionCtx,this.env=t.env,this.#l=t.notFoundHandler,this.#p=t.path,this.#d=t.matchResult)}get req(){return this.#e??=new ue(this.#t,this.#p,this.#d),this.#e}get event(){if(this.#o&&"respondWith"in this.#o)return this.#o;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#o)return this.#o;throw Error("This context has no ExecutionContext")}get res(){return this.#n||=te(null,{headers:this.#a??=new Headers})}set res(e){if(this.#n&&e){e=te(e.body,e);for(let[t,r]of this.#n.headers.entries())if(t!=="content-type")if(t==="set-cookie"){let n=this.#n.headers.getSetCookie();e.headers.delete("set-cookie");for(let o of n)e.headers.append("set-cookie",o)}else e.headers.set(t,r)}this.#n=e,this.finalized=!0}render=(...e)=>(this.#c??=t=>this.html(t),this.#c(...e));setLayout=e=>this.#u=e;getLayout=()=>this.#u;setRenderer=e=>{this.#c=e};header=(e,t,r)=>{this.finalized&&(this.#n=te(this.#n.body,this.#n));let n=this.#n?this.#n.headers:this.#a??=new Headers;t===void 0?n.delete(e):r?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#s=e};set=(e,t)=>{this.#r??=new Map,this.#r.set(e,t)};get=e=>this.#r?this.#r.get(e):void 0;get var(){return this.#r?Object.fromEntries(this.#r):{}}#i(e,t,r){let n=this.#n?new Headers(this.#n.headers):this.#a??new Headers;if(typeof t=="object"&&"headers"in t){let s=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[i,a]of s)i.toLowerCase()==="set-cookie"?n.append(i,a):n.set(i,a)}if(r)for(let[s,i]of Object.entries(r))if(typeof i=="string")n.set(s,i);else{n.delete(s);for(let a of i)n.append(s,a)}let o=typeof t=="number"?t:t?.status??this.#s;return te(e,{status:o,headers:n})}newResponse=(...e)=>this.#i(...e);body=(e,t,r)=>this.#i(e,t,r);text=(e,t,r)=>!this.#a&&!this.#s&&!t&&!r&&!this.finalized?new Response(e):this.#i(e,t,De(bn,r));json=(e,t,r)=>this.#i(JSON.stringify(e),t,De("application/json",r));html=(e,t,r)=>{let n=o=>this.#i(o,t,De("text/html; charset=UTF-8",r));return typeof e=="object"?Be(e,It.Stringify,!1,{}).then(n):n(e)};redirect=(e,t)=>{let r=String(e);return this.header("Location",/[^\x00-\xFF]/.test(r)?encodeURI(r):r),this.newResponse(null,t??302)};notFound=()=>(this.#l??=()=>te(),this.#l(this))};var y="ALL",Ht="all",jt=["get","post","put","delete","options","patch"],he="Can not add a route since the matcher is already built.",me=class extends Error{};var Nt="__COMPOSED_HANDLER";var vn=e=>e.text("404 Not Found",404),$t=(e,t)=>{if("getResponse"in e){let r=e.getResponse();return t.newResponse(r.body,r)}return console.error(e),t.text("Internal Server Error",500)},Bt=class Dt{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#t="/";routes=[];constructor(t={}){[...jt,Ht].forEach(s=>{this[s]=(i,...a)=>(typeof i=="string"?this.#t=i:this.#s(s,this.#t,i),a.forEach(c=>{this.#s(s,this.#t,c)}),this)}),this.on=(s,i,...a)=>{for(let c of[i].flat()){this.#t=c;for(let l of[s].flat())a.map(u=>{this.#s(l.toUpperCase(),this.#t,u)})}return this},this.use=(s,...i)=>(typeof s=="string"?this.#t=s:(this.#t="*",i.unshift(s)),i.forEach(a=>{this.#s(y,this.#t,a)}),this);let{strict:n,...o}=t;Object.assign(this,o),this.getPath=n??!0?t.getPath??Ne:Tt}#e(){let t=new Dt({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#r=this.#r,t.routes=this.routes,t}#r=vn;errorHandler=$t;route(t,r){let n=this.basePath(t);return r.routes.map(o=>{let s;r.errorHandler===$t?s=o.handler:(s=async(i,a)=>(await Ie([],r.errorHandler)(i,()=>o.handler(i,a))).res,s[Nt]=o.handler),n.#s(o.method,o.path,s,o.basePath)}),this}basePath(t){let r=this.#e();return r._basePath=H(this._basePath,t),r}onError=t=>(this.errorHandler=t,this);notFound=t=>(this.#r=t,this);mount(t,r,n){let o,s;n&&(typeof n=="function"?s=n:(s=n.optionHandler,n.replaceRequest===!1?o=c=>c:o=n.replaceRequest));let i=s?c=>{let l=s(c);return Array.isArray(l)?l:[l]}:c=>{let l;try{l=c.executionCtx}catch{}return[c.env,l]};o||=(()=>{let c=H(this._basePath,t),l=c==="/"?0:c.length;return u=>{let d=new URL(u.url);return d.pathname=this.getPath(u).slice(l)||"/",new Request(d,u)}})();let a=async(c,l)=>{let u=await r(o(c.req.raw),...i(c));if(u)return u;await l()};return this.#s(y,H(t,"*"),a),this}#s(t,r,n,o){t=t.toUpperCase(),r=H(this._basePath,r);let s={basePath:o!==void 0?H(this._basePath,o):this._basePath,path:r,method:t,handler:n};this.router.add(t,r,[n,s]),this.routes.push(s)}#o(t,r){if(t instanceof Error)return this.errorHandler(t,r);throw t}#n(t,r,n,o){if(o==="HEAD")return(async()=>new Response(null,await this.#n(t,r,n,"GET")))();let s=this.getPath(t,{env:n}),i=this.router.match(o,s),a=new Fe(t,{path:s,matchResult:i,env:n,executionCtx:r,notFoundHandler:this.#r});if(i[0].length===1){let l;try{l=i[0][0][0][0](a,async()=>{a.res=await this.#r(a)})}catch(u){return this.#o(u,a)}return l instanceof Promise?l.then(u=>u||(a.finalized?a.res:this.#r(a))).catch(u=>this.#o(u,a)):l??this.#r(a)}let c=Ie(i[0],this.errorHandler,this.#r);return(async()=>{try{let l=await c(a);if(!l.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return l.res}catch(l){return this.#o(l,a)}})()}fetch=(t,...r)=>this.#n(t,r[1],r[0],t.method);request=(t,r,n,o)=>t instanceof Request?this.fetch(r?new Request(t,r):t,n,o):(t=t.toString(),this.fetch(new Request(/^https?:\/\//.test(t)?t:`http://localhost${H("/",t)}`,r),n,o));fire=()=>{addEventListener("fetch",t=>{t.respondWith(this.#n(t.request,t,void 0,t.request.method))})}};var ge=[];function qe(e,t){let r=this.buildAllMatchers(),n=((o,s)=>{let i=r[o]||r[y],a=i[2][s];if(a)return a;let c=s.match(i[0]);if(!c)return[[],ge];let l=c.indexOf("",1);return[i[1][l],c]});return this.match=n,n(e,t)}var we="[^/]+",re=".*",ne="(?:|/.*)",B=Symbol(),xn=new Set(".\\+*[^]$()");function Rn(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1||e===re||e===ne?1:t===re||t===ne?-1:e===we?1:t===we?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Ft=class ze{#t;#e;#r=Object.create(null);insert(t,r,n,o,s){if(t.length===0){if(this.#t!==void 0)throw B;if(s)return;this.#t=r;return}let[i,...a]=t,c=i==="*"?a.length===0?["","",re]:["","",we]:i==="/*"?["","",ne]:i.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),l;if(c){let u=c[1],d=c[2]||we;if(u&&c[2]&&(d===".*"||(d=d.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(d))))throw B;if(l=this.#r[d],!l){if(Object.keys(this.#r).some(h=>h!==re&&h!==ne))throw B;if(s)return;l=this.#r[d]=new ze,u!==""&&(l.#e=o.varIndex++)}!s&&u!==""&&n.push([u,l.#e])}else if(l=this.#r[i],!l){if(Object.keys(this.#r).some(u=>u.length>1&&u!==re&&u!==ne))throw B;if(s)return;l=this.#r[i]=new ze}l.insert(a,r,n,o,s)}buildRegExpStr(){let r=Object.keys(this.#r).sort(Rn).map(n=>{let o=this.#r[n];return(typeof o.#e=="number"?`(${n})@${o.#e}`:xn.has(n)?`\\${n}`:n)+o.buildRegExpStr()});return typeof this.#t=="number"&&r.unshift(`#${this.#t}`),r.length===0?"":r.length===1?r[0]:"(?:"+r.join("|")+")"}};var qt=class{#t={varIndex:0};#e=new Ft;insert(e,t,r){let n=[],o=[];for(let i=0;;){let a=!1;if(e=e.replace(/\{[^}]+\}/g,c=>{let l=`@\\${i}`;return o[i]=[l,c],i++,a=!0,l}),!a)break}let s=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let i=o.length-1;i>=0;i--){let[a]=o[i];for(let c=s.length-1;c>=0;c--)if(s[c].indexOf(a)!==-1){s[c]=s[c].replace(a,o[i][1]);break}}return this.#e.insert(s,t,n,this.#t,r),n}buildRegExp(){let e=this.#e.buildRegExpStr();if(e==="")return[/^$/,[],[]];let t=0,r=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,(o,s,i)=>s!==void 0?(r[++t]=Number(s),"$()"):(i!==void 0&&(n[Number(i)]=++t),"")),[new RegExp(`^${e}`),r,n]}};var En=[/^$/,[],Object.create(null)],zt=Object.create(null);function Wt(e){return zt[e]??=new RegExp(e==="*"?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,(t,r)=>r?`\\${r}`:"(?:|/.*)")}$`)}function Sn(){zt=Object.create(null)}function Pn(e){let t=new qt,r=[];if(e.length===0)return En;let n=e.map(l=>[!/\*|\/:/.test(l[0]),...l]).sort(([l,u],[d,h])=>l?1:d?-1:u.length-h.length),o=Object.create(null);for(let l=0,u=-1,d=n.length;l<d;l++){let[h,f,g]=n[l];h?o[f]=[g.map(([w])=>[w,Object.create(null)]),ge]:u++;let p;try{p=t.insert(f,u,h)}catch(w){throw w===B?new me(f):w}h||(r[u]=g.map(([w,m])=>{let x=Object.create(null);for(m-=1;m>=0;m--){let[C,L]=p[m];x[C]=L}return[w,x]}))}let[s,i,a]=t.buildRegExp();for(let l=0,u=r.length;l<u;l++)for(let d=0,h=r[l].length;d<h;d++){let f=r[l][d]?.[1];if(!f)continue;let g=Object.keys(f);for(let p=0,w=g.length;p<w;p++)f[g[p]]=a[f[g[p]]]}let c=[];for(let l in i)c[l]=r[i[l]];return[s,c,o]}function G(e,t){if(e){for(let r of Object.keys(e).sort((n,o)=>o.length-n.length))if(Wt(r).test(t))return[...e[r]]}}var ye=class{name="RegExpRouter";#t;#e;constructor(){this.#t={[y]:Object.create(null)},this.#e={[y]:Object.create(null)}}add(e,t,r){let n=this.#t,o=this.#e;if(!n||!o)throw new Error(he);n[e]||[n,o].forEach(a=>{a[e]=Object.create(null),Object.keys(a[y]).forEach(c=>{a[e][c]=[...a[y][c]]})}),t==="/*"&&(t="*");let s=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){let a=Wt(t);e===y?Object.keys(n).forEach(c=>{n[c][t]||=G(n[c],t)||G(n[y],t)||[]}):n[e][t]||=G(n[e],t)||G(n[y],t)||[],Object.keys(n).forEach(c=>{(e===y||e===c)&&Object.keys(n[c]).forEach(l=>{a.test(l)&&n[c][l].push([r,s])})}),Object.keys(o).forEach(c=>{(e===y||e===c)&&Object.keys(o[c]).forEach(l=>a.test(l)&&o[c][l].push([r,s]))});return}let i=fe(t)||[t];for(let a=0,c=i.length;a<c;a++){let l=i[a];Object.keys(o).forEach(u=>{(e===y||e===u)&&(o[u][l]||=[...G(n[u],l)||G(n[y],l)||[]],o[u][l].push([r,s-c+a+1]))})}}match=qe;buildAllMatchers(){let e=Object.create(null);return Object.keys(this.#e).concat(Object.keys(this.#t)).forEach(t=>{e[t]||=this.#r(t)}),this.#t=this.#e=void 0,Sn(),e}#r(e){let t=[],r=e===y;return[this.#t,this.#e].forEach(n=>{let o=n[e]?Object.keys(n[e]).map(s=>[s,n[e][s]]):[];o.length!==0?(r||=!0,t.push(...o)):e!==y&&t.push(...Object.keys(n[y]).map(s=>[s,n[y][s]]))}),r?Pn(t):null}};var We=class{name="SmartRouter";#t=[];#e=[];constructor(e){this.#t=e.routers}add(e,t,r){if(!this.#e)throw new Error(he);this.#e.push([e,t,r])}match(e,t){if(!this.#e)throw new Error("Fatal error");let r=this.#t,n=this.#e,o=r.length,s=0,i;for(;s<o;s++){let a=r[s];try{for(let c=0,l=n.length;c<l;c++)a.add(...n[c]);i=a.match(e,t)}catch(c){if(c instanceof me)continue;throw c}this.match=a.match.bind(a),this.#t=[a],this.#e=void 0;break}if(s===o)throw new Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,i}get activeRouter(){if(this.#e||this.#t.length!==1)throw new Error("No active router has been determined yet.");return this.#t[0]}};var oe=Object.create(null),An=e=>{for(let t in e)return!0;return!1},Vt=class Gt{#t;#e;#r;#s=0;#o=oe;constructor(t,r,n){if(this.#e=n||Object.create(null),this.#t=[],t&&r){let o=Object.create(null);o[t]={handler:r,possibleKeys:[],score:0},this.#t=[o]}this.#r=[]}insert(t,r,n){this.#s=++this.#s;let o=this,s=Ot(r),i=[];for(let a=0,c=s.length;a<c;a++){let l=s[a],u=s[a+1],d=_t(l,u),h=Array.isArray(d)?d[0]:l;if(h in o.#e){o=o.#e[h],d&&i.push(d[1]);continue}o.#e[h]=new Gt,d&&(o.#r.push(d),i.push(d[1])),o=o.#e[h]}return o.#t.push({[t]:{handler:n,possibleKeys:i.filter((a,c,l)=>l.indexOf(a)===c),score:this.#s}}),o}#n(t,r,n,o,s){for(let i=0,a=r.#t.length;i<a;i++){let c=r.#t[i],l=c[n]||c[y],u={};if(l!==void 0&&(l.params=Object.create(null),t.push(l),o!==oe||s&&s!==oe))for(let d=0,h=l.possibleKeys.length;d<h;d++){let f=l.possibleKeys[d],g=u[l.score];l.params[f]=s?.[f]&&!g?s[f]:o[f]??s?.[f],u[l.score]=!0}}}search(t,r){let n=[];this.#o=oe;let s=[this],i=je(r),a=[],c=i.length,l=null;for(let u=0;u<c;u++){let d=i[u],h=u===c-1,f=[];for(let p=0,w=s.length;p<w;p++){let m=s[p],x=m.#e[d];x&&(x.#o=m.#o,h?(x.#e["*"]&&this.#n(n,x.#e["*"],t,m.#o),this.#n(n,x,t,m.#o)):f.push(x));for(let C=0,L=m.#r.length;C<L;C++){let R=m.#r[C],b=m.#o===oe?{}:{...m.#o};if(R==="*"){let U=m.#e["*"];U&&(this.#n(n,U,t,m.#o),U.#o=b,f.push(U));continue}let[P,v,A]=R;if(!d&&!(A instanceof RegExp))continue;let E=m.#e[P];if(A instanceof RegExp){if(l===null){l=new Array(c);let q=r[0]==="/"?1:0;for(let _=0;_<c;_++)l[_]=q,q+=i[_].length+1}let U=r.substring(l[u]),Q=A.exec(U);if(Q){if(b[v]=Q[0],this.#n(n,E,t,m.#o,b),An(E.#e)){E.#o=b;let q=Q[0].match(/\//)?.length??0;(a[q]||=[]).push(E)}continue}}(A===!0||A.test(d))&&(b[v]=d,h?(this.#n(n,E,t,b,m.#o),E.#e["*"]&&this.#n(n,E.#e["*"],t,b,m.#o)):(E.#o=b,f.push(E)))}}let g=a.shift();s=g?f.concat(g):f}return n.length>1&&n.sort((u,d)=>u.score-d.score),[n.map(({handler:u,params:d})=>[u,d])]}};var Ve=class{name="TrieRouter";#t;constructor(){this.#t=new Vt}add(e,t,r){let n=fe(t);if(n){for(let o=0,s=n.length;o<s;o++)this.#t.insert(e,n[o],r);return}this.#t.insert(e,t,r)}match(e,t){return this.#t.search(e,t)}};var Ge=class extends Bt{constructor(e={}){super(e),this.router=e.router??new We({routers:[new ye,new Ve]})}};var be=e=>{let t={origin:"*",allowMethods:["GET","HEAD","PUT","POST","DELETE","PATCH"],allowHeaders:[],exposeHeaders:[],...e},r=(o=>typeof o=="string"?o==="*"?()=>o:s=>o===s?s:null:typeof o=="function"?o:s=>o.includes(s)?s:null)(t.origin),n=(o=>typeof o=="function"?o:Array.isArray(o)?()=>o:()=>[])(t.allowMethods);return async function(s,i){function a(l,u){s.res.headers.set(l,u)}let c=await r(s.req.header("origin")||"",s);if(c&&a("Access-Control-Allow-Origin",c),t.credentials&&a("Access-Control-Allow-Credentials","true"),t.exposeHeaders?.length&&a("Access-Control-Expose-Headers",t.exposeHeaders.join(",")),s.req.method==="OPTIONS"){t.origin!=="*"&&a("Vary","Origin"),t.maxAge!=null&&a("Access-Control-Max-Age",t.maxAge.toString());let l=await n(s.req.header("origin")||"",s);l.length&&a("Access-Control-Allow-Methods",l.join(","));let u=t.allowHeaders;if(!u?.length){let d=s.req.header("Access-Control-Request-Headers");d&&(u=d.split(/\s*,\s*/))}return u?.length&&(a("Access-Control-Allow-Headers",u.join(",")),s.res.headers.append("Vary","Access-Control-Request-Headers")),s.res.headers.delete("Content-Length"),s.res.headers.delete("Content-Type"),new Response(null,{headers:s.res.headers,status:204,statusText:"No Content"})}await i(),t.origin!=="*"&&s.header("Vary","Origin",{append:!0})}};import ur from"process";import dr from"path";import{fileURLToPath as oo}from"url";import so from"child_process";import io,{constants as ao}from"fs/promises";import{promisify as jn}from"util";import Nn from"child_process";import Qe,{constants as er}from"fs/promises";import Jt from"process";import Ln from"os";import kn from"fs";import _n from"fs";import Kt from"fs";var Ke;function Cn(){try{return Kt.statSync("/.dockerenv"),!0}catch{return!1}}function On(){try{return Kt.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Xe(){return Ke===void 0&&(Ke=Cn()||On()),Ke}var Je,Tn=()=>{try{return _n.statSync("/run/.containerenv"),!0}catch{return!1}};function K(){return Je===void 0&&(Je=Tn()||Xe()),Je}var Xt=()=>{if(Jt.platform!=="linux")return!1;if(Ln.release().toLowerCase().includes("microsoft"))return!K();try{return kn.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!K():!1}catch{return!1}},M=Jt.env.__IS_WSL_TEST__?Xt:Xt();import Yt from"process";import{Buffer as Un}from"buffer";import{promisify as Mn}from"util";import In from"child_process";import Ni,{constants as $i}from"fs/promises";var Hn=Mn(In.execFile),Ye=()=>`${Yt.env.SYSTEMROOT||Yt.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;var T=async(e,t={})=>{let{powerShellPath:r,...n}=t,o=T.encodeCommand(e);return Hn(r??Ye(),[...T.argumentsPrefix,o],{encoding:"utf8",...n})};T.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];T.encodeCommand=e=>Un.from(e,"utf16le").toString("base64");T.escapeArgument=e=>`'${String(e).replaceAll("'","''")}'`;function Qt(e){for(let t of e.split(`
3
3
  `)){if(/^\s*#/.test(t))continue;let r=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(r)return r.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var $n=jn(Nn.execFile),Bn=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let r="/etc/wsl.conf",n=!1;try{await Qe.access(r,er.F_OK),n=!0}catch{}if(!n)return e;let o=await Qe.readFile(r,{encoding:"utf8"}),s=Qt(o);return s===void 0?e:(t=s,t=t.endsWith("/")?t:`${t}/`,t)}})(),Dn=async()=>`${await Bn()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,ve=M?Dn:Ye,Zt,tr=async()=>(Zt??=(async()=>{try{let e=await ve();return await Qe.access(e,er.X_OK),!0}catch{return!1}})(),Zt),rr=async()=>{let e=await ve(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:r}=await T(t,{powerShellPath:e});return r.trim()},nr=async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await $n("wslpath",["-aw",e],{encoding:"utf8"});return t.trim()}catch{return e}};function D(e,t,r){let n=o=>Object.defineProperty(e,t,{value:o,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),e}import{promisify as Zn}from"util";import ot from"process";import{execFile as eo}from"child_process";import{promisify as Fn}from"util";import qn from"process";import{execFile as zn}from"child_process";var Wn=Fn(zn);async function Ze(){if(qn.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await Wn("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),r=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari";return r==="com.apple.safari"?"com.apple.Safari":r}import Vn from"process";import{promisify as Gn}from"util";import{execFile as Kn,execFileSync as oa}from"child_process";var Xn=Gn(Kn);async function or(e,{humanReadableOutput:t=!0,signal:r}={}){if(Vn.platform!=="darwin")throw new Error("macOS only");let n=t?[]:["-ss"],o={};r&&(o.signal=r);let{stdout:s}=await Xn("osascript",["-e",e,n],o);return s.trim()}async function et(e){return or(`tell application "Finder" to set app_path to application file id "${e}" as string
4
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as Jn}from"util";import{execFile as Yn}from"child_process";var Qn=Jn(Yn),xe={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},rt=new Map(Object.entries(xe)),tt=class extends Error{};async function nt(e=Qn){let{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!r)throw new tt(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:n}=r.groups,o=n.lastIndexOf("."),s=n.lastIndexOf("-"),i=o===-1?void 0:n.slice(0,o),a=s===-1?void 0:n.slice(0,s);return xe[n]??xe[i]??xe[a]??{name:n,id:n}}var to=Zn(eo),ro=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,t=>t.toUpperCase());async function st(){if(ot.platform==="darwin"){let e=await Ze();return{name:await et(e),id:e}}if(ot.platform==="linux"){let{stdout:e}=await to("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:ro(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if(ot.platform==="win32")return nt();throw new Error("Only macOS, Linux, and Windows are supported")}import it from"process";var no=!!(it.env.SSH_CONNECTION||it.env.SSH_CLIENT||it.env.SSH_TTY),sr=no;var Re=Symbol("fallbackAttempt"),at=import.meta.url?dr.dirname(oo(import.meta.url)):"",ir=dr.join(at,"xdg-open"),{platform:X,arch:ar}=ur,cr=async(e,t)=>{if(e.length===0)return;let r=[];for(let n of e)try{return await t(n)}catch(o){r.push(o)}throw new AggregateError(r,"Failed to open in all supported apps")},Ee=async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[Re]===!0;if(delete e[Re],Array.isArray(e.app))return cr(e.app,l=>Ee({...e,app:l,[Re]:!0}));let{name:r,arguments:n=[]}=e.app??{};if(n=[...n],Array.isArray(r))return cr(r,l=>Ee({...e,app:{name:l,arguments:n},[Re]:!0}));if(r==="browser"||r==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d;if(M){let h=await rr();d=rt.get(h)??{}}else d=await st();if(d.id in l){let h=l[d.id.toLowerCase()];if(r==="browserPrivate"){if(h==="safari")throw new Error("Safari doesn't support opening in private mode via command line");n.push(u[h])}return Ee({...e,app:{name:J[h],arguments:n}})}throw new Error(`${d.name} is not supported as a default browser`)}let o,s=[],i={},a=!1;if(M&&!K()&&!sr&&!r&&(a=await tr()),X==="darwin")o="open",e.wait&&s.push("--wait-apps"),e.background&&s.push("--background"),e.newInstance&&s.push("--new"),r&&s.push("-a",r);else if(X==="win32"||a){o=await ve(),s.push(...T.argumentsPrefix),M||(i.windowsVerbatimArguments=!0),M&&e.target&&(e.target=await nr(e.target));let l=["$ProgressPreference = 'SilentlyContinue';","Start"];e.wait&&l.push("-Wait"),r?(l.push(T.escapeArgument(r)),e.target&&n.push(e.target)):e.target&&l.push(T.escapeArgument(e.target)),n.length>0&&(n=n.map(u=>T.escapeArgument(u)),l.push("-ArgumentList",n.join(","))),e.target=T.encodeCommand(l.join(" ")),e.wait||(i.stdio="ignore")}else{if(r)o=r;else{let l=!at||at==="/",u=!1;try{await io.access(ir,ao.X_OK),u=!0}catch{}o=ur.versions.electron??(X==="android"||l||!u)?"xdg-open":ir}n.length>0&&s.push(...n),e.wait||(i.stdio="ignore",i.detached=!0)}X==="darwin"&&n.length>0&&s.push("--args",...n),e.target&&s.push(e.target);let c=so.spawn(o,s,i);return e.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!e.allowNonzeroExitCode&&d!==0){u(new Error(`Exited with code ${d}`));return}l(c)})}):t?new Promise((l,u)=>{c.once("error",u),c.once("spawn",()=>{c.once("close",d=>{if(c.off("error",u),d!==0){u(new Error(`Exited with code ${d}`));return}c.unref(),l(c)})})}):(c.unref(),new Promise((l,u)=>{c.once("error",u),c.once("spawn",()=>{c.off("error",u),l(c)})}))},co=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return Ee({...t,target:e})};function lr(e){if(typeof e=="string"||Array.isArray(e))return e;let{[ar]:t}=e;if(!t)throw new Error(`${ar} is not supported`);return t}function se({[X]:e},{wsl:t}={}){if(t&&M)return lr(t);if(!e)throw new Error(`${X} is not supported`);return lr(e)}var J={browser:"browser",browserPrivate:"browserPrivate"};D(J,"chrome",()=>se({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));D(J,"brave",()=>se({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));D(J,"firefox",()=>se({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));D(J,"edge",()=>se({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));D(J,"safari",()=>se({darwin:"Safari"}));var pr=co;function fr(e=""){return`<link rel="icon" type="image/svg+xml" href="${`${e.replace(/\/$/,"")}/favicon-black.svg?v=4`}" />`}import{existsSync as hr,readFileSync as lo}from"fs";import I from"path";import{fileURLToPath as uo}from"url";import{gunzipSync as po}from"zlib";var fo={".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".webmanifest":"application/manifest+json"};function ho(){let e=I.dirname(uo(import.meta.url));for(let t of[I.resolve(e,"app"),I.resolve(e,"../app"),I.resolve(e,"../../dist/app")])if(hr(I.join(t,"inspector.js.gz")))return t;throw new Error("Inspector bundle not found (expected dist/app/inspector.js.gz)")}function mr(e,t="/inspector/assets"){let r=ho(),n=new Map;e.get(`${t}/*`,o=>{let s=o.req.path.slice(t.length),i=s.startsWith("/")?s.slice(1):s;if(!i||i.includes(".."))return o.notFound();let a=i==="inspector.js"||i==="inspector.css"?`${i}.gz`:i,c=I.resolve(r,a),l=r.endsWith(I.sep)?r:`${r}${I.sep}`;if(!c.startsWith(l)||!hr(c))return o.notFound();let u=I.extname(i),d=a.endsWith(".gz"),h=/(?:^|,)\s*gzip\s*(?:,|$)/i.test(o.req.header("accept-encoding")??""),f=lo(c),g=d&&!h?n.get(c)??mo(n,c,f):f,p=g.buffer.slice(g.byteOffset,g.byteOffset+g.byteLength);return o.body(p,200,{"Content-Type":fo[u]??"application/octet-stream",...d&&h?{"Content-Encoding":"gzip"}:{},...d?{Vary:"Accept-Encoding"}:{},"Cache-Control":"no-cache"})})}function mo(e,t,r){let n=po(r);return e.set(t,n),n}var gr={name:"@mcp-use/inspector",type:"module",version:"20.0.0-beta.21",description:"MCP Inspector - A tool for inspecting and debugging MCP servers",author:"",license:"MIT",homepage:"https://github.com/mcp-use/mcp-use#readme",repository:{type:"git",url:"git+https://github.com/mcp-use/mcp-use.git",directory:"libraries/typescript/packages/inspector"},bugs:{url:"https://github.com/mcp-use/mcp-use/issues"},keywords:["mcp","inspector","debug","tools"],exports:{".":{types:"./dist/server/index.d.ts",import:"./dist/server/index.js"},"./client":{types:"./dist/client/index.d.ts",import:"./dist/client/index.js"}},main:"./dist/server/index.js",types:"./dist/server/index.d.ts",bin:{"mcp-inspect":"./dist/cli.js"},files:["dist"],scripts:{dev:"rimraf node_modules/.vite && VITE_MANUFACT_CHAT_URL=${VITE_MANUFACT_CHAT_URL:-http://localhost:8000/api/v1/inspector/chat/stream} vite --strictPort","dev:client":"pnpm run dev","dev:server":"VITE_DEV=true tsx watch src/server/server.ts","dev:standalone":"tsx watch src/server/server.ts",clean:"rimraf dist",build:"npm run clean && npm run build:client-exports && npm run build:server && npm run build:app && npm run verify:package","build:app":"vite build --config vite.app.config.ts && node scripts/compress-app.mjs","watch:app":"vite build --watch --config vite.app.config.ts","preview:app":"vite preview --config vite.app.config.ts --host 127.0.0.1","serve:app":"pnpm build:app && pnpm preview:app","analyze:app":"ANALYZE=true vite build --config vite.app.config.ts","build:client-exports":"tsup --config tsup.client.ts","build:server":"tsup --config tsup.server.ts","verify:package":"node scripts/verify-package.mjs",prepublishOnly:"pnpm --filter @mcp-use/client build && pnpm build",start:"node dist/cli.js --port 3000",preview:"vite preview","type-check":"tsc --noEmit",lint:"eslint .","lint:fix":"eslint . --fix","test:e2e":"playwright test","test:e2e:ui":"playwright test --ui","test:e2e:debug":"playwright test --debug","test:e2e:builtin":"node tests/e2e/scripts/run-test-matrix.mjs builtin","test:e2e:prod":"node tests/e2e/scripts/run-test-matrix.mjs prod","test:e2e:mix":"node tests/e2e/scripts/run-test-matrix.mjs mix","test:e2e:prod:ui":"TEST_MODE=production playwright test --ui","test:e2e:codegen":"playwright codegen http://localhost:3000/inspector","test:e2e:report":"playwright show-report","test:e2e:python":"node tests/e2e/scripts/run-python-e2e.mjs","test:unit":"vitest run","test:unit:watch":"vitest","test:e2e:tunnel":"node tests/e2e/scripts/run-tunnel-test.mjs","install:pnpm":"pnpm install","install:npm":"npm install","lint:npm":"npm run lint:fix","lint:pnpm":"pnpm lint:fix"},engines:{node:">=22.22.2"},peerDependencies:{"@base-ui/react":"^1.6.0","@mcp-use/agent":"^2.0.0-alpha.0","@mcp-use/client":"^2.0.0-alpha.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",express:"^4.21.2 || ^5.0.0","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4","mcp-use":"workspace:*",motion:"^12.34.2",react:"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","react-resizable-panels":"^4.6.4",sonner:"^2.0.7","tailwind-merge":"^3.5.0"},peerDependenciesMeta:{"@base-ui/react":{optional:!0},"@mcp-use/agent":{optional:!0},"@mcp-use/client":{optional:!0},"class-variance-authority":{optional:!0},clsx:{optional:!0},express:{optional:!0},"lucide-react":{optional:!0},"markdown-to-jsx":{optional:!0},motion:{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-resizable-panels":{optional:!0},sonner:{optional:!0},"tailwind-merge":{optional:!0}},dependencies:{},publishConfig:{access:"public"},devDependencies:{"@base-ui/react":"^1.6.0","@hono/node-server":"^1.19.13","@mcp-use/agent":"workspace:*","@mcp-use/client":"workspace:*","@playwright/test":"^1.58.2","@tailwindcss/vite":"^4.2.0","@types/express":"^5.0.6","@vitejs/plugin-react":"^6.0.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",emulate:"0.5.0",eslint:"^9.39.2",express:"^5.2.1",hono:"^4.12.12","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4",motion:"^12.34.2","oauth2-mock-server":"^8.2.2",open:"^11.0.0",react:"^19.2.3","react-dom":"^19.2.3","react-router":"^7.12.0","react-resizable-panels":"^4.6.4","rollup-plugin-visualizer":"^6.0.3",sonner:"^2.0.7","tailwind-merge":"^3.5.0",tailwindcss:"^4.2.0",tsup:"^8.5.1",tsx:"^4.21.0","tw-animate-css":"^1.4.0",typescript:"^5.9.3",vite:"^8.0.16",vitest:"^4.1.0","wait-on":"^9.0.4",zod:"^4.2.0"}};var wo=gr.version;function Se(){return wo}var wr=Se(),yo=`<!doctype html>
4
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as Jn}from"util";import{execFile as Yn}from"child_process";var Qn=Jn(Yn),xe={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},rt=new Map(Object.entries(xe)),tt=class extends Error{};async function nt(e=Qn){let{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!r)throw new tt(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:n}=r.groups,o=n.lastIndexOf("."),s=n.lastIndexOf("-"),i=o===-1?void 0:n.slice(0,o),a=s===-1?void 0:n.slice(0,s);return xe[n]??xe[i]??xe[a]??{name:n,id:n}}var to=Zn(eo),ro=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,t=>t.toUpperCase());async function st(){if(ot.platform==="darwin"){let e=await Ze();return{name:await et(e),id:e}}if(ot.platform==="linux"){let{stdout:e}=await to("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:ro(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if(ot.platform==="win32")return nt();throw new Error("Only macOS, Linux, and Windows are supported")}import it from"process";var no=!!(it.env.SSH_CONNECTION||it.env.SSH_CLIENT||it.env.SSH_TTY),sr=no;var Re=Symbol("fallbackAttempt"),at=import.meta.url?dr.dirname(oo(import.meta.url)):"",ir=dr.join(at,"xdg-open"),{platform:X,arch:ar}=ur,cr=async(e,t)=>{if(e.length===0)return;let r=[];for(let n of e)try{return await t(n)}catch(o){r.push(o)}throw new AggregateError(r,"Failed to open in all supported apps")},Ee=async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[Re]===!0;if(delete e[Re],Array.isArray(e.app))return cr(e.app,l=>Ee({...e,app:l,[Re]:!0}));let{name:r,arguments:n=[]}=e.app??{};if(n=[...n],Array.isArray(r))return cr(r,l=>Ee({...e,app:{name:l,arguments:n},[Re]:!0}));if(r==="browser"||r==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d;if(M){let h=await rr();d=rt.get(h)??{}}else d=await st();if(d.id in l){let h=l[d.id.toLowerCase()];if(r==="browserPrivate"){if(h==="safari")throw new Error("Safari doesn't support opening in private mode via command line");n.push(u[h])}return Ee({...e,app:{name:J[h],arguments:n}})}throw new Error(`${d.name} is not supported as a default browser`)}let o,s=[],i={},a=!1;if(M&&!K()&&!sr&&!r&&(a=await tr()),X==="darwin")o="open",e.wait&&s.push("--wait-apps"),e.background&&s.push("--background"),e.newInstance&&s.push("--new"),r&&s.push("-a",r);else if(X==="win32"||a){o=await ve(),s.push(...T.argumentsPrefix),M||(i.windowsVerbatimArguments=!0),M&&e.target&&(e.target=await nr(e.target));let l=["$ProgressPreference = 'SilentlyContinue';","Start"];e.wait&&l.push("-Wait"),r?(l.push(T.escapeArgument(r)),e.target&&n.push(e.target)):e.target&&l.push(T.escapeArgument(e.target)),n.length>0&&(n=n.map(u=>T.escapeArgument(u)),l.push("-ArgumentList",n.join(","))),e.target=T.encodeCommand(l.join(" ")),e.wait||(i.stdio="ignore")}else{if(r)o=r;else{let l=!at||at==="/",u=!1;try{await io.access(ir,ao.X_OK),u=!0}catch{}o=ur.versions.electron??(X==="android"||l||!u)?"xdg-open":ir}n.length>0&&s.push(...n),e.wait||(i.stdio="ignore",i.detached=!0)}X==="darwin"&&n.length>0&&s.push("--args",...n),e.target&&s.push(e.target);let c=so.spawn(o,s,i);return e.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!e.allowNonzeroExitCode&&d!==0){u(new Error(`Exited with code ${d}`));return}l(c)})}):t?new Promise((l,u)=>{c.once("error",u),c.once("spawn",()=>{c.once("close",d=>{if(c.off("error",u),d!==0){u(new Error(`Exited with code ${d}`));return}c.unref(),l(c)})})}):(c.unref(),new Promise((l,u)=>{c.once("error",u),c.once("spawn",()=>{c.off("error",u),l(c)})}))},co=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return Ee({...t,target:e})};function lr(e){if(typeof e=="string"||Array.isArray(e))return e;let{[ar]:t}=e;if(!t)throw new Error(`${ar} is not supported`);return t}function se({[X]:e},{wsl:t}={}){if(t&&M)return lr(t);if(!e)throw new Error(`${X} is not supported`);return lr(e)}var J={browser:"browser",browserPrivate:"browserPrivate"};D(J,"chrome",()=>se({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));D(J,"brave",()=>se({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));D(J,"firefox",()=>se({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));D(J,"edge",()=>se({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));D(J,"safari",()=>se({darwin:"Safari"}));var pr=co;function fr(e=""){return`<link rel="icon" type="image/svg+xml" href="${`${e.replace(/\/$/,"")}/favicon-black.svg?v=4`}" />`}import{existsSync as hr,readFileSync as lo}from"fs";import I from"path";import{fileURLToPath as uo}from"url";import{gunzipSync as po}from"zlib";var fo={".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".webmanifest":"application/manifest+json"};function ho(){let e=I.dirname(uo(import.meta.url));for(let t of[I.resolve(e,"app"),I.resolve(e,"../app"),I.resolve(e,"../../dist/app")])if(hr(I.join(t,"inspector.js.gz")))return t;throw new Error("Inspector bundle not found (expected dist/app/inspector.js.gz)")}function mr(e,t="/inspector/assets"){let r=ho(),n=new Map;e.get(`${t}/*`,o=>{let s=o.req.path.slice(t.length),i=s.startsWith("/")?s.slice(1):s;if(!i||i.includes(".."))return o.notFound();let a=i==="inspector.js"||i==="inspector.css"?`${i}.gz`:i,c=I.resolve(r,a),l=r.endsWith(I.sep)?r:`${r}${I.sep}`;if(!c.startsWith(l)||!hr(c))return o.notFound();let u=I.extname(i),d=a.endsWith(".gz"),h=/(?:^|,)\s*gzip\s*(?:,|$)/i.test(o.req.header("accept-encoding")??""),f=lo(c),g=d&&!h?n.get(c)??mo(n,c,f):f,p=g.buffer.slice(g.byteOffset,g.byteOffset+g.byteLength);return o.body(p,200,{"Content-Type":fo[u]??"application/octet-stream",...d&&h?{"Content-Encoding":"gzip"}:{},...d?{Vary:"Accept-Encoding"}:{},"Cache-Control":"no-cache"})})}function mo(e,t,r){let n=po(r);return e.set(t,n),n}var gr={name:"@mcp-use/inspector",type:"module",version:"20.0.0-beta.22",description:"MCP Inspector - A tool for inspecting and debugging MCP servers",author:"",license:"MIT",homepage:"https://github.com/mcp-use/mcp-use#readme",repository:{type:"git",url:"git+https://github.com/mcp-use/mcp-use.git",directory:"libraries/typescript/packages/inspector"},bugs:{url:"https://github.com/mcp-use/mcp-use/issues"},keywords:["mcp","inspector","debug","tools"],exports:{".":{types:"./dist/server/index.d.ts",import:"./dist/server/index.js"},"./client":{types:"./dist/client/index.d.ts",import:"./dist/client/index.js"}},main:"./dist/server/index.js",types:"./dist/server/index.d.ts",bin:{"mcp-inspect":"./dist/cli.js"},files:["dist"],scripts:{dev:"rimraf node_modules/.vite && VITE_MANUFACT_CHAT_URL=${VITE_MANUFACT_CHAT_URL:-http://localhost:8000/api/v1/inspector/chat/stream} vite --strictPort","dev:client":"pnpm run dev","dev:server":"VITE_DEV=true tsx watch src/server/server.ts","dev:standalone":"tsx watch src/server/server.ts",clean:"rimraf dist",build:"npm run clean && npm run build:client-exports && npm run build:server && npm run build:app && npm run verify:package","build:app":"vite build --config vite.app.config.ts && node scripts/compress-app.mjs","watch:app":"vite build --watch --config vite.app.config.ts","preview:app":"vite preview --config vite.app.config.ts --host 127.0.0.1","serve:app":"pnpm build:app && pnpm preview:app","analyze:app":"ANALYZE=true vite build --config vite.app.config.ts","build:client-exports":"tsup --config tsup.client.ts","build:server":"tsup --config tsup.server.ts","verify:package":"node scripts/verify-package.mjs",prepublishOnly:"pnpm --filter @mcp-use/client build && pnpm build",start:"node dist/cli.js --port 3000",preview:"vite preview","type-check":"tsc --noEmit",lint:"eslint .","lint:fix":"eslint . --fix","test:e2e":"playwright test","test:e2e:ui":"playwright test --ui","test:e2e:debug":"playwright test --debug","test:e2e:builtin":"node tests/e2e/scripts/run-test-matrix.mjs builtin","test:e2e:prod":"node tests/e2e/scripts/run-test-matrix.mjs prod","test:e2e:mix":"node tests/e2e/scripts/run-test-matrix.mjs mix","test:e2e:prod:ui":"TEST_MODE=production playwright test --ui","test:e2e:codegen":"playwright codegen http://localhost:3000/inspector","test:e2e:report":"playwright show-report","test:e2e:python":"node tests/e2e/scripts/run-python-e2e.mjs","test:unit":"vitest run","test:unit:watch":"vitest","test:e2e:tunnel":"node tests/e2e/scripts/run-tunnel-test.mjs","install:pnpm":"pnpm install","install:npm":"npm install","lint:npm":"npm run lint:fix","lint:pnpm":"pnpm lint:fix"},engines:{node:">=22.22.2"},peerDependencies:{"@base-ui/react":"^1.6.0","@mcp-use/agent":"^2.0.0-alpha.0","@mcp-use/client":"^2.0.0-alpha.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",express:"^4.21.2 || ^5.0.0","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4","mcp-use":"workspace:*",motion:"^12.34.2",react:"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","react-resizable-panels":"^4.6.4",sonner:"^2.0.7","tailwind-merge":"^3.5.0"},peerDependenciesMeta:{"@base-ui/react":{optional:!0},"@mcp-use/agent":{optional:!0},"@mcp-use/client":{optional:!0},"class-variance-authority":{optional:!0},clsx:{optional:!0},express:{optional:!0},"lucide-react":{optional:!0},"markdown-to-jsx":{optional:!0},motion:{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-resizable-panels":{optional:!0},sonner:{optional:!0},"tailwind-merge":{optional:!0}},dependencies:{},publishConfig:{access:"public"},devDependencies:{"@base-ui/react":"^1.6.0","@hono/node-server":"^1.19.13","@mcp-use/agent":"workspace:*","@mcp-use/client":"workspace:*","@playwright/test":"^1.58.2","@tailwindcss/vite":"^4.2.0","@types/express":"^5.0.6","@vitejs/plugin-react":"^6.0.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",emulate:"0.5.0",eslint:"^9.39.2",express:"^5.2.1",hono:"^4.12.12","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4",motion:"^12.34.2","oauth2-mock-server":"^8.2.2",open:"^11.0.0",react:"^19.2.3","react-dom":"^19.2.3","react-router":"^7.12.0","react-resizable-panels":"^4.6.4","rollup-plugin-visualizer":"^6.0.3",sonner:"^2.0.7","tailwind-merge":"^3.5.0",tailwindcss:"^4.2.0",tsup:"^8.5.1",tsx:"^4.21.0","tw-animate-css":"^1.4.0",typescript:"^5.9.3",vite:"^8.0.16",vitest:"^4.1.0","wait-on":"^9.0.4",zod:"^4.2.0"}};var wo=gr.version;function Se(){return wo}var wr=Se(),yo=`<!doctype html>
5
5
  <html lang="en"><head><meta charset="utf-8"><title>Signed in</title><meta name="robots" content="noindex"><style>html,body{margin:0;height:100%;display:flex;align-items:center;justify-content:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#4b5563;background:#fff}</style></head>
6
6
  <body><div>Signed in. You can close this window.</div>
7
7
  <script>try{if(window.opener&&!window.opener.closed)window.opener.postMessage({type:"manufact:oauth-complete"},"*")}catch(e){}try{window.close()}catch(e){}</script>
@@ -1,4 +1,4 @@
1
- var ne=(e,t,r)=>(n,o)=>{let s=-1;return i(0);async function i(a){if(a<=s)throw new Error("next() called multiple times");s=a;let c,l=!1,u;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&o||void 0,u)try{c=await u(n,()=>i(a+1))}catch(p){if(p instanceof Error&&t)n.error=p,c=await t(p,n),l=!0;else throw p}else n.finalized===!1&&r&&(c=await r(n));return c&&(n.finalized===!1||l)&&(n.res=c),n}};var Pe=Symbol();var Oe=async(e,t=Object.create(null))=>{let{all:r=!1,dot:n=!1}=t,s=(e instanceof F?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?Pt(e,{all:r,dot:n}):{}};async function Pt(e,t){let r=await e.formData();return r?Ot(r,t):{}}function Ot(e,t){let r=Object.create(null);return e.forEach((n,o)=>{t.all||o.endsWith("[]")?Ct(r,o,n):r[o]=n}),t.dot&&Object.entries(r).forEach(([n,o])=>{n.includes(".")&&(_t(r,n,o),delete r[n])}),r}var Ct=(e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},_t=(e,t,r)=>{if(/(?:^|\.)__proto__\./.test(t))return;let n=e,o=t.split(".");o.forEach((s,i)=>{i===o.length-1?n[s]=r:((!n[s]||typeof n[s]!="object"||Array.isArray(n[s])||n[s]instanceof File)&&(n[s]=Object.create(null)),n=n[s])})};var se=e=>{let t=e.split("/");return t[0]===""&&t.shift(),t},Ce=e=>{let{groups:t,path:r}=St(e),n=se(r);return Tt(n,t)},St=e=>{let t=[];return e=e.replace(/\{[^}]+\}/g,(r,n)=>{let o=`@${n}`;return t.push([o,r]),o}),{groups:t,path:e}},Tt=(e,t)=>{for(let r=t.length-1;r>=0;r--){let[n]=t[r];for(let o=e.length-1;o>=0;o--)if(e[o].includes(n)){e[o]=e[o].replace(n,t[r][1]);break}}return e},W={},_e=(e,t)=>{if(e==="*")return"*";let r=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(r){let n=`${e}#${t}`;return W[n]||(r[2]?W[n]=t&&t[0]!==":"&&t[0]!=="*"?[n,r[1],new RegExp(`^${r[2]}(?=/${t})`)]:[e,r[1],new RegExp(`^${r[2]}$`)]:W[n]=[e,r[1],!0]),W[n]}return null},V=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},kt=e=>V(e,decodeURI),ie=e=>{let t=e.url,r=t.indexOf("/",t.indexOf(":")+4),n=r;for(;n<t.length;n++){let o=t.charCodeAt(n);if(o===37){let s=t.indexOf("?",n),i=t.indexOf("#",n),a=s===-1?i===-1?void 0:i:i===-1?s:Math.min(s,i),c=t.slice(r,a);return kt(c.includes("%25")?c.replace(/%25/g,"%2525"):c)}else if(o===63||o===35)break}return t.slice(r,n)};var Se=e=>{let t=ie(e);return t.length>1&&t.at(-1)==="/"?t.slice(0,-1):t},L=(e,t,...r)=>(r.length&&(t=L(t,...r)),`${e?.[0]==="/"?"":"/"}${e}${t==="/"?"":`${e?.at(-1)==="/"?"":"/"}${t?.[0]==="/"?t.slice(1):t}`}`),K=e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(":"))return null;let t=e.split("/"),r=[],n="";return t.forEach(o=>{if(o!==""&&!/\:/.test(o))n+="/"+o;else if(/\:/.test(o))if(/\?/.test(o)){r.length===0&&n===""?r.push("/"):r.push(n);let s=o.replace("?","");n+="/"+s,r.push(n)}else n+="/"+o}),r.filter((o,s,i)=>i.indexOf(o)===s)},oe=e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?V(e,ae):e):e,Te=(e,t,r)=>{let n;if(!r&&t&&!/[%+]/.test(t)){let i=e.indexOf("?",8);if(i===-1)return;for(e.startsWith(t,i+1)||(i=e.indexOf(`&${t}`,i+1));i!==-1;){let a=e.charCodeAt(i+t.length+1);if(a===61){let c=i+t.length+2,l=e.indexOf("&",c);return oe(e.slice(c,l===-1?void 0:l))}else if(a==38||isNaN(a))return"";i=e.indexOf(`&${t}`,i+1)}if(n=/[%+]/.test(e),!n)return}let o={};n??=/[%+]/.test(e);let s=e.indexOf("?",8);for(;s!==-1;){let i=e.indexOf("&",s+1),a=e.indexOf("=",s);a>i&&i!==-1&&(a=-1);let c=e.slice(s+1,a===-1?i===-1?void 0:i:a);if(n&&(c=oe(c)),s=i,c==="")continue;let l;a===-1?l="":(l=e.slice(a+1,i===-1?void 0:i),n&&(l=oe(l))),r?(o[c]&&Array.isArray(o[c])||(o[c]=[]),o[c].push(l)):o[c]??=l}return t?o[t]:o},ke=Te,Ue=(e,t)=>Te(e,t,!0),ae=decodeURIComponent;var Le=e=>V(e,ae),F=class{raw;#t;#e;routeIndex=0;path;bodyCache={};constructor(e,t="/",r=[[]]){this.raw=e,this.path=t,this.#e=r,this.#t={}}param(e){return e?this.#r(e):this.#s()}#r(e){let t=this.#e[0][this.routeIndex][1][e],r=this.#o(t);return r&&/\%/.test(r)?Le(r):r}#s(){let e={},t=Object.keys(this.#e[0][this.routeIndex][1]);for(let r of t){let n=this.#o(this.#e[0][this.routeIndex][1][r]);n!==void 0&&(e[r]=/\%/.test(n)?Le(n):n)}return e}#o(e){return this.#e[1]?this.#e[1][e]:e}query(e){return ke(this.url,e)}queries(e){return Ue(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t={};return this.raw.headers.forEach((r,n)=>{t[n]=r}),t}async parseBody(e){return Oe(this,e)}#n=e=>{let{bodyCache:t,raw:r}=this,n=t[e];if(n)return n;let o=Object.keys(t)[0];return o?t[o].then(s=>(o==="json"&&(s=JSON.stringify(s)),new Response(s)[e]())):t[e]=r[e]()};json(){return this.#n("text").then(e=>JSON.parse(e))}text(){return this.#n("text")}arrayBuffer(){return this.#n("arrayBuffer")}bytes(){return this.#n("arrayBuffer").then(e=>new Uint8Array(e))}blob(){return this.#n("blob")}formData(){return this.#n("formData")}addValidatedData(e,t){this.#t[e]=t}valid(e){return this.#t[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[Pe](){return this.#e}get matchedRoutes(){return this.#e[0].map(([[,e]])=>e)}get routePath(){return this.#e[0].map(([[,e]])=>e)[this.routeIndex].path}};var Me={Stringify:1,BeforeStream:2,Stream:3},Ut=(e,t)=>{let r=new String(e);return r.isEscaped=!0,r.callbacks=t,r};var ce=async(e,t,r,n,o)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let s=e.callbacks;if(!s?.length)return Promise.resolve(e);o?o[0]+=e:o=[e];let i=Promise.all(s.map(a=>a({phase:t,buffer:o,context:n}))).then(a=>Promise.all(a.filter(Boolean).map(c=>ce(c,t,!1,n,o))).then(()=>o[0]));return r?Ut(await i,s):i};var Lt="text/plain; charset=UTF-8",le=(e,t)=>({"Content-Type":e,...t}),D=(e,t)=>new Response(e,t),ue=class{#t;#e;env={};#r;finalized=!1;error;#s;#o;#n;#u;#c;#l;#a;#d;#p;constructor(e,t){this.#t=e,t&&(this.#o=t.executionCtx,this.env=t.env,this.#l=t.notFoundHandler,this.#p=t.path,this.#d=t.matchResult)}get req(){return this.#e??=new F(this.#t,this.#p,this.#d),this.#e}get event(){if(this.#o&&"respondWith"in this.#o)return this.#o;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#o)return this.#o;throw Error("This context has no ExecutionContext")}get res(){return this.#n||=D(null,{headers:this.#a??=new Headers})}set res(e){if(this.#n&&e){e=D(e.body,e);for(let[t,r]of this.#n.headers.entries())if(t!=="content-type")if(t==="set-cookie"){let n=this.#n.headers.getSetCookie();e.headers.delete("set-cookie");for(let o of n)e.headers.append("set-cookie",o)}else e.headers.set(t,r)}this.#n=e,this.finalized=!0}render=(...e)=>(this.#c??=t=>this.html(t),this.#c(...e));setLayout=e=>this.#u=e;getLayout=()=>this.#u;setRenderer=e=>{this.#c=e};header=(e,t,r)=>{this.finalized&&(this.#n=D(this.#n.body,this.#n));let n=this.#n?this.#n.headers:this.#a??=new Headers;t===void 0?n.delete(e):r?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#s=e};set=(e,t)=>{this.#r??=new Map,this.#r.set(e,t)};get=e=>this.#r?this.#r.get(e):void 0;get var(){return this.#r?Object.fromEntries(this.#r):{}}#i(e,t,r){let n=this.#n?new Headers(this.#n.headers):this.#a??new Headers;if(typeof t=="object"&&"headers"in t){let s=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[i,a]of s)i.toLowerCase()==="set-cookie"?n.append(i,a):n.set(i,a)}if(r)for(let[s,i]of Object.entries(r))if(typeof i=="string")n.set(s,i);else{n.delete(s);for(let a of i)n.append(s,a)}let o=typeof t=="number"?t:t?.status??this.#s;return D(e,{status:o,headers:n})}newResponse=(...e)=>this.#i(...e);body=(e,t,r)=>this.#i(e,t,r);text=(e,t,r)=>!this.#a&&!this.#s&&!t&&!r&&!this.finalized?new Response(e):this.#i(e,t,le(Lt,r));json=(e,t,r)=>this.#i(JSON.stringify(e),t,le("application/json",r));html=(e,t,r)=>{let n=o=>this.#i(o,t,le("text/html; charset=UTF-8",r));return typeof e=="object"?ce(e,Me.Stringify,!1,{}).then(n):n(e)};redirect=(e,t)=>{let r=String(e);return this.header("Location",/[^\x00-\xFF]/.test(r)?encodeURI(r):r),this.newResponse(null,t??302)};notFound=()=>(this.#l??=()=>D(),this.#l(this))};var y="ALL",Ie="all",je=["get","post","put","delete","options","patch"],G="Can not add a route since the matcher is already built.",J=class extends Error{};var He="__COMPOSED_HANDLER";var Mt=e=>e.text("404 Not Found",404),$e=(e,t)=>{if("getResponse"in e){let r=e.getResponse();return t.newResponse(r.body,r)}return console.error(e),t.text("Internal Server Error",500)},Ne=class De{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#t="/";routes=[];constructor(t={}){[...je,Ie].forEach(s=>{this[s]=(i,...a)=>(typeof i=="string"?this.#t=i:this.#s(s,this.#t,i),a.forEach(c=>{this.#s(s,this.#t,c)}),this)}),this.on=(s,i,...a)=>{for(let c of[i].flat()){this.#t=c;for(let l of[s].flat())a.map(u=>{this.#s(l.toUpperCase(),this.#t,u)})}return this},this.use=(s,...i)=>(typeof s=="string"?this.#t=s:(this.#t="*",i.unshift(s)),i.forEach(a=>{this.#s(y,this.#t,a)}),this);let{strict:n,...o}=t;Object.assign(this,o),this.getPath=n??!0?t.getPath??ie:Se}#e(){let t=new De({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#r=this.#r,t.routes=this.routes,t}#r=Mt;errorHandler=$e;route(t,r){let n=this.basePath(t);return r.routes.map(o=>{let s;r.errorHandler===$e?s=o.handler:(s=async(i,a)=>(await ne([],r.errorHandler)(i,()=>o.handler(i,a))).res,s[He]=o.handler),n.#s(o.method,o.path,s,o.basePath)}),this}basePath(t){let r=this.#e();return r._basePath=L(this._basePath,t),r}onError=t=>(this.errorHandler=t,this);notFound=t=>(this.#r=t,this);mount(t,r,n){let o,s;n&&(typeof n=="function"?s=n:(s=n.optionHandler,n.replaceRequest===!1?o=c=>c:o=n.replaceRequest));let i=s?c=>{let l=s(c);return Array.isArray(l)?l:[l]}:c=>{let l;try{l=c.executionCtx}catch{}return[c.env,l]};o||=(()=>{let c=L(this._basePath,t),l=c==="/"?0:c.length;return u=>{let p=new URL(u.url);return p.pathname=this.getPath(u).slice(l)||"/",new Request(p,u)}})();let a=async(c,l)=>{let u=await r(o(c.req.raw),...i(c));if(u)return u;await l()};return this.#s(y,L(t,"*"),a),this}#s(t,r,n,o){t=t.toUpperCase(),r=L(this._basePath,r);let s={basePath:o!==void 0?L(this._basePath,o):this._basePath,path:r,method:t,handler:n};this.router.add(t,r,[n,s]),this.routes.push(s)}#o(t,r){if(t instanceof Error)return this.errorHandler(t,r);throw t}#n(t,r,n,o){if(o==="HEAD")return(async()=>new Response(null,await this.#n(t,r,n,"GET")))();let s=this.getPath(t,{env:n}),i=this.router.match(o,s),a=new ue(t,{path:s,matchResult:i,env:n,executionCtx:r,notFoundHandler:this.#r});if(i[0].length===1){let l;try{l=i[0][0][0][0](a,async()=>{a.res=await this.#r(a)})}catch(u){return this.#o(u,a)}return l instanceof Promise?l.then(u=>u||(a.finalized?a.res:this.#r(a))).catch(u=>this.#o(u,a)):l??this.#r(a)}let c=ne(i[0],this.errorHandler,this.#r);return(async()=>{try{let l=await c(a);if(!l.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return l.res}catch(l){return this.#o(l,a)}})()}fetch=(t,...r)=>this.#n(t,r[1],r[0],t.method);request=(t,r,n,o)=>t instanceof Request?this.fetch(r?new Request(t,r):t,n,o):(t=t.toString(),this.fetch(new Request(/^https?:\/\//.test(t)?t:`http://localhost${L("/",t)}`,r),n,o));fire=()=>{addEventListener("fetch",t=>{t.respondWith(this.#n(t.request,t,void 0,t.request.method))})}};var X=[];function de(e,t){let r=this.buildAllMatchers(),n=((o,s)=>{let i=r[o]||r[y],a=i[2][s];if(a)return a;let c=s.match(i[0]);if(!c)return[[],X];let l=c.indexOf("",1);return[i[1][l],c]});return this.match=n,n(e,t)}var Y="[^/]+",B=".*",z="(?:|/.*)",I=Symbol(),It=new Set(".\\+*[^]$()");function jt(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1||e===B||e===z?1:t===B||t===z?-1:e===Y?1:t===Y?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Be=class pe{#t;#e;#r=Object.create(null);insert(t,r,n,o,s){if(t.length===0){if(this.#t!==void 0)throw I;if(s)return;this.#t=r;return}let[i,...a]=t,c=i==="*"?a.length===0?["","",B]:["","",Y]:i==="/*"?["","",z]:i.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),l;if(c){let u=c[1],p=c[2]||Y;if(u&&c[2]&&(p===".*"||(p=p.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(p))))throw I;if(l=this.#r[p],!l){if(Object.keys(this.#r).some(g=>g!==B&&g!==z))throw I;if(s)return;l=this.#r[p]=new pe,u!==""&&(l.#e=o.varIndex++)}!s&&u!==""&&n.push([u,l.#e])}else if(l=this.#r[i],!l){if(Object.keys(this.#r).some(u=>u.length>1&&u!==B&&u!==z))throw I;if(s)return;l=this.#r[i]=new pe}l.insert(a,r,n,o,s)}buildRegExpStr(){let r=Object.keys(this.#r).sort(jt).map(n=>{let o=this.#r[n];return(typeof o.#e=="number"?`(${n})@${o.#e}`:It.has(n)?`\\${n}`:n)+o.buildRegExpStr()});return typeof this.#t=="number"&&r.unshift(`#${this.#t}`),r.length===0?"":r.length===1?r[0]:"(?:"+r.join("|")+")"}};var ze=class{#t={varIndex:0};#e=new Be;insert(e,t,r){let n=[],o=[];for(let i=0;;){let a=!1;if(e=e.replace(/\{[^}]+\}/g,c=>{let l=`@\\${i}`;return o[i]=[l,c],i++,a=!0,l}),!a)break}let s=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let i=o.length-1;i>=0;i--){let[a]=o[i];for(let c=s.length-1;c>=0;c--)if(s[c].indexOf(a)!==-1){s[c]=s[c].replace(a,o[i][1]);break}}return this.#e.insert(s,t,n,this.#t,r),n}buildRegExp(){let e=this.#e.buildRegExpStr();if(e==="")return[/^$/,[],[]];let t=0,r=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,(o,s,i)=>s!==void 0?(r[++t]=Number(s),"$()"):(i!==void 0&&(n[Number(i)]=++t),"")),[new RegExp(`^${e}`),r,n]}};var Ht=[/^$/,[],Object.create(null)],qe=Object.create(null);function Fe(e){return qe[e]??=new RegExp(e==="*"?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,(t,r)=>r?`\\${r}`:"(?:|/.*)")}$`)}function $t(){qe=Object.create(null)}function Nt(e){let t=new ze,r=[];if(e.length===0)return Ht;let n=e.map(l=>[!/\*|\/:/.test(l[0]),...l]).sort(([l,u],[p,g])=>l?1:p?-1:u.length-g.length),o=Object.create(null);for(let l=0,u=-1,p=n.length;l<p;l++){let[g,h,m]=n[l];g?o[h]=[m.map(([w])=>[w,Object.create(null)]),X]:u++;let d;try{d=t.insert(h,u,g)}catch(w){throw w===I?new J(h):w}g||(r[u]=m.map(([w,f])=>{let R=Object.create(null);for(f-=1;f>=0;f--){let[O,S]=d[f];R[O]=S}return[w,R]}))}let[s,i,a]=t.buildRegExp();for(let l=0,u=r.length;l<u;l++)for(let p=0,g=r[l].length;p<g;p++){let h=r[l][p]?.[1];if(!h)continue;let m=Object.keys(h);for(let d=0,w=m.length;d<w;d++)h[m[d]]=a[h[m[d]]]}let c=[];for(let l in i)c[l]=r[i[l]];return[s,c,o]}function $(e,t){if(e){for(let r of Object.keys(e).sort((n,o)=>o.length-n.length))if(Fe(r).test(t))return[...e[r]]}}var Q=class{name="RegExpRouter";#t;#e;constructor(){this.#t={[y]:Object.create(null)},this.#e={[y]:Object.create(null)}}add(e,t,r){let n=this.#t,o=this.#e;if(!n||!o)throw new Error(G);n[e]||[n,o].forEach(a=>{a[e]=Object.create(null),Object.keys(a[y]).forEach(c=>{a[e][c]=[...a[y][c]]})}),t==="/*"&&(t="*");let s=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){let a=Fe(t);e===y?Object.keys(n).forEach(c=>{n[c][t]||=$(n[c],t)||$(n[y],t)||[]}):n[e][t]||=$(n[e],t)||$(n[y],t)||[],Object.keys(n).forEach(c=>{(e===y||e===c)&&Object.keys(n[c]).forEach(l=>{a.test(l)&&n[c][l].push([r,s])})}),Object.keys(o).forEach(c=>{(e===y||e===c)&&Object.keys(o[c]).forEach(l=>a.test(l)&&o[c][l].push([r,s]))});return}let i=K(t)||[t];for(let a=0,c=i.length;a<c;a++){let l=i[a];Object.keys(o).forEach(u=>{(e===y||e===u)&&(o[u][l]||=[...$(n[u],l)||$(n[y],l)||[]],o[u][l].push([r,s-c+a+1]))})}}match=de;buildAllMatchers(){let e=Object.create(null);return Object.keys(this.#e).concat(Object.keys(this.#t)).forEach(t=>{e[t]||=this.#r(t)}),this.#t=this.#e=void 0,$t(),e}#r(e){let t=[],r=e===y;return[this.#t,this.#e].forEach(n=>{let o=n[e]?Object.keys(n[e]).map(s=>[s,n[e][s]]):[];o.length!==0?(r||=!0,t.push(...o)):e!==y&&t.push(...Object.keys(n[y]).map(s=>[s,n[y][s]]))}),r?Nt(t):null}};var he=class{name="SmartRouter";#t=[];#e=[];constructor(e){this.#t=e.routers}add(e,t,r){if(!this.#e)throw new Error(G);this.#e.push([e,t,r])}match(e,t){if(!this.#e)throw new Error("Fatal error");let r=this.#t,n=this.#e,o=r.length,s=0,i;for(;s<o;s++){let a=r[s];try{for(let c=0,l=n.length;c<l;c++)a.add(...n[c]);i=a.match(e,t)}catch(c){if(c instanceof J)continue;throw c}this.match=a.match.bind(a),this.#t=[a],this.#e=void 0;break}if(s===o)throw new Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,i}get activeRouter(){if(this.#e||this.#t.length!==1)throw new Error("No active router has been determined yet.");return this.#t[0]}};var q=Object.create(null),Dt=e=>{for(let t in e)return!0;return!1},We=class Ve{#t;#e;#r;#s=0;#o=q;constructor(t,r,n){if(this.#e=n||Object.create(null),this.#t=[],t&&r){let o=Object.create(null);o[t]={handler:r,possibleKeys:[],score:0},this.#t=[o]}this.#r=[]}insert(t,r,n){this.#s=++this.#s;let o=this,s=Ce(r),i=[];for(let a=0,c=s.length;a<c;a++){let l=s[a],u=s[a+1],p=_e(l,u),g=Array.isArray(p)?p[0]:l;if(g in o.#e){o=o.#e[g],p&&i.push(p[1]);continue}o.#e[g]=new Ve,p&&(o.#r.push(p),i.push(p[1])),o=o.#e[g]}return o.#t.push({[t]:{handler:n,possibleKeys:i.filter((a,c,l)=>l.indexOf(a)===c),score:this.#s}}),o}#n(t,r,n,o,s){for(let i=0,a=r.#t.length;i<a;i++){let c=r.#t[i],l=c[n]||c[y],u={};if(l!==void 0&&(l.params=Object.create(null),t.push(l),o!==q||s&&s!==q))for(let p=0,g=l.possibleKeys.length;p<g;p++){let h=l.possibleKeys[p],m=u[l.score];l.params[h]=s?.[h]&&!m?s[h]:o[h]??s?.[h],u[l.score]=!0}}}search(t,r){let n=[];this.#o=q;let s=[this],i=se(r),a=[],c=i.length,l=null;for(let u=0;u<c;u++){let p=i[u],g=u===c-1,h=[];for(let d=0,w=s.length;d<w;d++){let f=s[d],R=f.#e[p];R&&(R.#o=f.#o,g?(R.#e["*"]&&this.#n(n,R.#e["*"],t,f.#o),this.#n(n,R,t,f.#o)):h.push(R));for(let O=0,S=f.#r.length;O<S;O++){let v=f.#r[O],b=f.#o===q?{}:{...f.#o};if(v==="*"){let k=f.#e["*"];k&&(this.#n(n,k,t,f.#o),k.#o=b,h.push(k));continue}let[A,x,P]=v;if(!p&&!(P instanceof RegExp))continue;let E=f.#e[A];if(P instanceof RegExp){if(l===null){l=new Array(c);let H=r[0]==="/"?1:0;for(let _=0;_<c;_++)l[_]=H,H+=i[_].length+1}let k=r.substring(l[u]),N=P.exec(k);if(N){if(b[x]=N[0],this.#n(n,E,t,f.#o,b),Dt(E.#e)){E.#o=b;let H=N[0].match(/\//)?.length??0;(a[H]||=[]).push(E)}continue}}(P===!0||P.test(p))&&(b[x]=p,g?(this.#n(n,E,t,b,f.#o),E.#e["*"]&&this.#n(n,E.#e["*"],t,b,f.#o)):(E.#o=b,h.push(E)))}}let m=a.shift();s=m?h.concat(m):h}return n.length>1&&n.sort((u,p)=>u.score-p.score),[n.map(({handler:u,params:p})=>[u,p])]}};var fe=class{name="TrieRouter";#t;constructor(){this.#t=new We}add(e,t,r){let n=K(t);if(n){for(let o=0,s=n.length;o<s;o++)this.#t.insert(e,n[o],r);return}this.#t.insert(e,t,r)}match(e,t){return this.#t.search(e,t)}};var ge=class extends Ne{constructor(e={}){super(e),this.router=e.router??new he({routers:[new Q,new fe]})}};import{Readable as Pr}from"stream";function Ke(e=""){return`<link rel="icon" type="image/svg+xml" href="${`${e.replace(/\/$/,"")}/favicon-black.svg?v=4`}" />`}import{existsSync as Ge,readFileSync as Bt}from"fs";import U from"path";import{fileURLToPath as zt}from"url";import{gunzipSync as qt}from"zlib";var Ft={".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".webmanifest":"application/manifest+json"};function Wt(){let e=U.dirname(zt(import.meta.url));for(let t of[U.resolve(e,"app"),U.resolve(e,"../app"),U.resolve(e,"../../dist/app")])if(Ge(U.join(t,"inspector.js.gz")))return t;throw new Error("Inspector bundle not found (expected dist/app/inspector.js.gz)")}function Je(e,t="/inspector/assets"){let r=Wt(),n=new Map;e.get(`${t}/*`,o=>{let s=o.req.path.slice(t.length),i=s.startsWith("/")?s.slice(1):s;if(!i||i.includes(".."))return o.notFound();let a=i==="inspector.js"||i==="inspector.css"?`${i}.gz`:i,c=U.resolve(r,a),l=r.endsWith(U.sep)?r:`${r}${U.sep}`;if(!c.startsWith(l)||!Ge(c))return o.notFound();let u=U.extname(i),p=a.endsWith(".gz"),g=/(?:^|,)\s*gzip\s*(?:,|$)/i.test(o.req.header("accept-encoding")??""),h=Bt(c),m=p&&!g?n.get(c)??Vt(n,c,h):h,d=m.buffer.slice(m.byteOffset,m.byteOffset+m.byteLength);return o.body(d,200,{"Content-Type":Ft[u]??"application/octet-stream",...p&&g?{"Content-Encoding":"gzip"}:{},...p?{Vary:"Accept-Encoding"}:{},"Cache-Control":"no-cache"})})}function Vt(e,t,r){let n=qt(r);return e.set(t,n),n}var Xe={name:"@mcp-use/inspector",type:"module",version:"20.0.0-beta.21",description:"MCP Inspector - A tool for inspecting and debugging MCP servers",author:"",license:"MIT",homepage:"https://github.com/mcp-use/mcp-use#readme",repository:{type:"git",url:"git+https://github.com/mcp-use/mcp-use.git",directory:"libraries/typescript/packages/inspector"},bugs:{url:"https://github.com/mcp-use/mcp-use/issues"},keywords:["mcp","inspector","debug","tools"],exports:{".":{types:"./dist/server/index.d.ts",import:"./dist/server/index.js"},"./client":{types:"./dist/client/index.d.ts",import:"./dist/client/index.js"}},main:"./dist/server/index.js",types:"./dist/server/index.d.ts",bin:{"mcp-inspect":"./dist/cli.js"},files:["dist"],scripts:{dev:"rimraf node_modules/.vite && VITE_MANUFACT_CHAT_URL=${VITE_MANUFACT_CHAT_URL:-http://localhost:8000/api/v1/inspector/chat/stream} vite --strictPort","dev:client":"pnpm run dev","dev:server":"VITE_DEV=true tsx watch src/server/server.ts","dev:standalone":"tsx watch src/server/server.ts",clean:"rimraf dist",build:"npm run clean && npm run build:client-exports && npm run build:server && npm run build:app && npm run verify:package","build:app":"vite build --config vite.app.config.ts && node scripts/compress-app.mjs","watch:app":"vite build --watch --config vite.app.config.ts","preview:app":"vite preview --config vite.app.config.ts --host 127.0.0.1","serve:app":"pnpm build:app && pnpm preview:app","analyze:app":"ANALYZE=true vite build --config vite.app.config.ts","build:client-exports":"tsup --config tsup.client.ts","build:server":"tsup --config tsup.server.ts","verify:package":"node scripts/verify-package.mjs",prepublishOnly:"pnpm --filter @mcp-use/client build && pnpm build",start:"node dist/cli.js --port 3000",preview:"vite preview","type-check":"tsc --noEmit",lint:"eslint .","lint:fix":"eslint . --fix","test:e2e":"playwright test","test:e2e:ui":"playwright test --ui","test:e2e:debug":"playwright test --debug","test:e2e:builtin":"node tests/e2e/scripts/run-test-matrix.mjs builtin","test:e2e:prod":"node tests/e2e/scripts/run-test-matrix.mjs prod","test:e2e:mix":"node tests/e2e/scripts/run-test-matrix.mjs mix","test:e2e:prod:ui":"TEST_MODE=production playwright test --ui","test:e2e:codegen":"playwright codegen http://localhost:3000/inspector","test:e2e:report":"playwright show-report","test:e2e:python":"node tests/e2e/scripts/run-python-e2e.mjs","test:unit":"vitest run","test:unit:watch":"vitest","test:e2e:tunnel":"node tests/e2e/scripts/run-tunnel-test.mjs","install:pnpm":"pnpm install","install:npm":"npm install","lint:npm":"npm run lint:fix","lint:pnpm":"pnpm lint:fix"},engines:{node:">=22.22.2"},peerDependencies:{"@base-ui/react":"^1.6.0","@mcp-use/agent":"^2.0.0-alpha.0","@mcp-use/client":"^2.0.0-alpha.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",express:"^4.21.2 || ^5.0.0","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4","mcp-use":"workspace:*",motion:"^12.34.2",react:"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","react-resizable-panels":"^4.6.4",sonner:"^2.0.7","tailwind-merge":"^3.5.0"},peerDependenciesMeta:{"@base-ui/react":{optional:!0},"@mcp-use/agent":{optional:!0},"@mcp-use/client":{optional:!0},"class-variance-authority":{optional:!0},clsx:{optional:!0},express:{optional:!0},"lucide-react":{optional:!0},"markdown-to-jsx":{optional:!0},motion:{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-resizable-panels":{optional:!0},sonner:{optional:!0},"tailwind-merge":{optional:!0}},dependencies:{},publishConfig:{access:"public"},devDependencies:{"@base-ui/react":"^1.6.0","@hono/node-server":"^1.19.13","@mcp-use/agent":"workspace:*","@mcp-use/client":"workspace:*","@playwright/test":"^1.58.2","@tailwindcss/vite":"^4.2.0","@types/express":"^5.0.6","@vitejs/plugin-react":"^6.0.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",emulate:"0.5.0",eslint:"^9.39.2",express:"^5.2.1",hono:"^4.12.12","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4",motion:"^12.34.2","oauth2-mock-server":"^8.2.2",open:"^11.0.0",react:"^19.2.3","react-dom":"^19.2.3","react-router":"^7.12.0","react-resizable-panels":"^4.6.4","rollup-plugin-visualizer":"^6.0.3",sonner:"^2.0.7","tailwind-merge":"^3.5.0",tailwindcss:"^4.2.0",tsup:"^8.5.1",tsx:"^4.21.0","tw-animate-css":"^1.4.0",typescript:"^5.9.3",vite:"^8.0.16",vitest:"^4.1.0","wait-on":"^9.0.4",zod:"^4.2.0"}};var Gt=Xe.version;function Ye(){return Gt}var Qe=Ye(),Jt=`<!doctype html>
1
+ var ne=(e,t,r)=>(n,o)=>{let s=-1;return i(0);async function i(a){if(a<=s)throw new Error("next() called multiple times");s=a;let c,l=!1,u;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&o||void 0,u)try{c=await u(n,()=>i(a+1))}catch(p){if(p instanceof Error&&t)n.error=p,c=await t(p,n),l=!0;else throw p}else n.finalized===!1&&r&&(c=await r(n));return c&&(n.finalized===!1||l)&&(n.res=c),n}};var Pe=Symbol();var Oe=async(e,t=Object.create(null))=>{let{all:r=!1,dot:n=!1}=t,s=(e instanceof F?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?Pt(e,{all:r,dot:n}):{}};async function Pt(e,t){let r=await e.formData();return r?Ot(r,t):{}}function Ot(e,t){let r=Object.create(null);return e.forEach((n,o)=>{t.all||o.endsWith("[]")?Ct(r,o,n):r[o]=n}),t.dot&&Object.entries(r).forEach(([n,o])=>{n.includes(".")&&(_t(r,n,o),delete r[n])}),r}var Ct=(e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},_t=(e,t,r)=>{if(/(?:^|\.)__proto__\./.test(t))return;let n=e,o=t.split(".");o.forEach((s,i)=>{i===o.length-1?n[s]=r:((!n[s]||typeof n[s]!="object"||Array.isArray(n[s])||n[s]instanceof File)&&(n[s]=Object.create(null)),n=n[s])})};var se=e=>{let t=e.split("/");return t[0]===""&&t.shift(),t},Ce=e=>{let{groups:t,path:r}=St(e),n=se(r);return Tt(n,t)},St=e=>{let t=[];return e=e.replace(/\{[^}]+\}/g,(r,n)=>{let o=`@${n}`;return t.push([o,r]),o}),{groups:t,path:e}},Tt=(e,t)=>{for(let r=t.length-1;r>=0;r--){let[n]=t[r];for(let o=e.length-1;o>=0;o--)if(e[o].includes(n)){e[o]=e[o].replace(n,t[r][1]);break}}return e},W={},_e=(e,t)=>{if(e==="*")return"*";let r=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(r){let n=`${e}#${t}`;return W[n]||(r[2]?W[n]=t&&t[0]!==":"&&t[0]!=="*"?[n,r[1],new RegExp(`^${r[2]}(?=/${t})`)]:[e,r[1],new RegExp(`^${r[2]}$`)]:W[n]=[e,r[1],!0]),W[n]}return null},V=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},kt=e=>V(e,decodeURI),ie=e=>{let t=e.url,r=t.indexOf("/",t.indexOf(":")+4),n=r;for(;n<t.length;n++){let o=t.charCodeAt(n);if(o===37){let s=t.indexOf("?",n),i=t.indexOf("#",n),a=s===-1?i===-1?void 0:i:i===-1?s:Math.min(s,i),c=t.slice(r,a);return kt(c.includes("%25")?c.replace(/%25/g,"%2525"):c)}else if(o===63||o===35)break}return t.slice(r,n)};var Se=e=>{let t=ie(e);return t.length>1&&t.at(-1)==="/"?t.slice(0,-1):t},L=(e,t,...r)=>(r.length&&(t=L(t,...r)),`${e?.[0]==="/"?"":"/"}${e}${t==="/"?"":`${e?.at(-1)==="/"?"":"/"}${t?.[0]==="/"?t.slice(1):t}`}`),K=e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(":"))return null;let t=e.split("/"),r=[],n="";return t.forEach(o=>{if(o!==""&&!/\:/.test(o))n+="/"+o;else if(/\:/.test(o))if(/\?/.test(o)){r.length===0&&n===""?r.push("/"):r.push(n);let s=o.replace("?","");n+="/"+s,r.push(n)}else n+="/"+o}),r.filter((o,s,i)=>i.indexOf(o)===s)},oe=e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?V(e,ae):e):e,Te=(e,t,r)=>{let n;if(!r&&t&&!/[%+]/.test(t)){let i=e.indexOf("?",8);if(i===-1)return;for(e.startsWith(t,i+1)||(i=e.indexOf(`&${t}`,i+1));i!==-1;){let a=e.charCodeAt(i+t.length+1);if(a===61){let c=i+t.length+2,l=e.indexOf("&",c);return oe(e.slice(c,l===-1?void 0:l))}else if(a==38||isNaN(a))return"";i=e.indexOf(`&${t}`,i+1)}if(n=/[%+]/.test(e),!n)return}let o={};n??=/[%+]/.test(e);let s=e.indexOf("?",8);for(;s!==-1;){let i=e.indexOf("&",s+1),a=e.indexOf("=",s);a>i&&i!==-1&&(a=-1);let c=e.slice(s+1,a===-1?i===-1?void 0:i:a);if(n&&(c=oe(c)),s=i,c==="")continue;let l;a===-1?l="":(l=e.slice(a+1,i===-1?void 0:i),n&&(l=oe(l))),r?(o[c]&&Array.isArray(o[c])||(o[c]=[]),o[c].push(l)):o[c]??=l}return t?o[t]:o},ke=Te,Ue=(e,t)=>Te(e,t,!0),ae=decodeURIComponent;var Le=e=>V(e,ae),F=class{raw;#t;#e;routeIndex=0;path;bodyCache={};constructor(e,t="/",r=[[]]){this.raw=e,this.path=t,this.#e=r,this.#t={}}param(e){return e?this.#r(e):this.#s()}#r(e){let t=this.#e[0][this.routeIndex][1][e],r=this.#o(t);return r&&/\%/.test(r)?Le(r):r}#s(){let e={},t=Object.keys(this.#e[0][this.routeIndex][1]);for(let r of t){let n=this.#o(this.#e[0][this.routeIndex][1][r]);n!==void 0&&(e[r]=/\%/.test(n)?Le(n):n)}return e}#o(e){return this.#e[1]?this.#e[1][e]:e}query(e){return ke(this.url,e)}queries(e){return Ue(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t={};return this.raw.headers.forEach((r,n)=>{t[n]=r}),t}async parseBody(e){return Oe(this,e)}#n=e=>{let{bodyCache:t,raw:r}=this,n=t[e];if(n)return n;let o=Object.keys(t)[0];return o?t[o].then(s=>(o==="json"&&(s=JSON.stringify(s)),new Response(s)[e]())):t[e]=r[e]()};json(){return this.#n("text").then(e=>JSON.parse(e))}text(){return this.#n("text")}arrayBuffer(){return this.#n("arrayBuffer")}bytes(){return this.#n("arrayBuffer").then(e=>new Uint8Array(e))}blob(){return this.#n("blob")}formData(){return this.#n("formData")}addValidatedData(e,t){this.#t[e]=t}valid(e){return this.#t[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[Pe](){return this.#e}get matchedRoutes(){return this.#e[0].map(([[,e]])=>e)}get routePath(){return this.#e[0].map(([[,e]])=>e)[this.routeIndex].path}};var Me={Stringify:1,BeforeStream:2,Stream:3},Ut=(e,t)=>{let r=new String(e);return r.isEscaped=!0,r.callbacks=t,r};var ce=async(e,t,r,n,o)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let s=e.callbacks;if(!s?.length)return Promise.resolve(e);o?o[0]+=e:o=[e];let i=Promise.all(s.map(a=>a({phase:t,buffer:o,context:n}))).then(a=>Promise.all(a.filter(Boolean).map(c=>ce(c,t,!1,n,o))).then(()=>o[0]));return r?Ut(await i,s):i};var Lt="text/plain; charset=UTF-8",le=(e,t)=>({"Content-Type":e,...t}),D=(e,t)=>new Response(e,t),ue=class{#t;#e;env={};#r;finalized=!1;error;#s;#o;#n;#u;#c;#l;#a;#d;#p;constructor(e,t){this.#t=e,t&&(this.#o=t.executionCtx,this.env=t.env,this.#l=t.notFoundHandler,this.#p=t.path,this.#d=t.matchResult)}get req(){return this.#e??=new F(this.#t,this.#p,this.#d),this.#e}get event(){if(this.#o&&"respondWith"in this.#o)return this.#o;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#o)return this.#o;throw Error("This context has no ExecutionContext")}get res(){return this.#n||=D(null,{headers:this.#a??=new Headers})}set res(e){if(this.#n&&e){e=D(e.body,e);for(let[t,r]of this.#n.headers.entries())if(t!=="content-type")if(t==="set-cookie"){let n=this.#n.headers.getSetCookie();e.headers.delete("set-cookie");for(let o of n)e.headers.append("set-cookie",o)}else e.headers.set(t,r)}this.#n=e,this.finalized=!0}render=(...e)=>(this.#c??=t=>this.html(t),this.#c(...e));setLayout=e=>this.#u=e;getLayout=()=>this.#u;setRenderer=e=>{this.#c=e};header=(e,t,r)=>{this.finalized&&(this.#n=D(this.#n.body,this.#n));let n=this.#n?this.#n.headers:this.#a??=new Headers;t===void 0?n.delete(e):r?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#s=e};set=(e,t)=>{this.#r??=new Map,this.#r.set(e,t)};get=e=>this.#r?this.#r.get(e):void 0;get var(){return this.#r?Object.fromEntries(this.#r):{}}#i(e,t,r){let n=this.#n?new Headers(this.#n.headers):this.#a??new Headers;if(typeof t=="object"&&"headers"in t){let s=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[i,a]of s)i.toLowerCase()==="set-cookie"?n.append(i,a):n.set(i,a)}if(r)for(let[s,i]of Object.entries(r))if(typeof i=="string")n.set(s,i);else{n.delete(s);for(let a of i)n.append(s,a)}let o=typeof t=="number"?t:t?.status??this.#s;return D(e,{status:o,headers:n})}newResponse=(...e)=>this.#i(...e);body=(e,t,r)=>this.#i(e,t,r);text=(e,t,r)=>!this.#a&&!this.#s&&!t&&!r&&!this.finalized?new Response(e):this.#i(e,t,le(Lt,r));json=(e,t,r)=>this.#i(JSON.stringify(e),t,le("application/json",r));html=(e,t,r)=>{let n=o=>this.#i(o,t,le("text/html; charset=UTF-8",r));return typeof e=="object"?ce(e,Me.Stringify,!1,{}).then(n):n(e)};redirect=(e,t)=>{let r=String(e);return this.header("Location",/[^\x00-\xFF]/.test(r)?encodeURI(r):r),this.newResponse(null,t??302)};notFound=()=>(this.#l??=()=>D(),this.#l(this))};var y="ALL",Ie="all",je=["get","post","put","delete","options","patch"],G="Can not add a route since the matcher is already built.",J=class extends Error{};var He="__COMPOSED_HANDLER";var Mt=e=>e.text("404 Not Found",404),$e=(e,t)=>{if("getResponse"in e){let r=e.getResponse();return t.newResponse(r.body,r)}return console.error(e),t.text("Internal Server Error",500)},Ne=class De{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#t="/";routes=[];constructor(t={}){[...je,Ie].forEach(s=>{this[s]=(i,...a)=>(typeof i=="string"?this.#t=i:this.#s(s,this.#t,i),a.forEach(c=>{this.#s(s,this.#t,c)}),this)}),this.on=(s,i,...a)=>{for(let c of[i].flat()){this.#t=c;for(let l of[s].flat())a.map(u=>{this.#s(l.toUpperCase(),this.#t,u)})}return this},this.use=(s,...i)=>(typeof s=="string"?this.#t=s:(this.#t="*",i.unshift(s)),i.forEach(a=>{this.#s(y,this.#t,a)}),this);let{strict:n,...o}=t;Object.assign(this,o),this.getPath=n??!0?t.getPath??ie:Se}#e(){let t=new De({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#r=this.#r,t.routes=this.routes,t}#r=Mt;errorHandler=$e;route(t,r){let n=this.basePath(t);return r.routes.map(o=>{let s;r.errorHandler===$e?s=o.handler:(s=async(i,a)=>(await ne([],r.errorHandler)(i,()=>o.handler(i,a))).res,s[He]=o.handler),n.#s(o.method,o.path,s,o.basePath)}),this}basePath(t){let r=this.#e();return r._basePath=L(this._basePath,t),r}onError=t=>(this.errorHandler=t,this);notFound=t=>(this.#r=t,this);mount(t,r,n){let o,s;n&&(typeof n=="function"?s=n:(s=n.optionHandler,n.replaceRequest===!1?o=c=>c:o=n.replaceRequest));let i=s?c=>{let l=s(c);return Array.isArray(l)?l:[l]}:c=>{let l;try{l=c.executionCtx}catch{}return[c.env,l]};o||=(()=>{let c=L(this._basePath,t),l=c==="/"?0:c.length;return u=>{let p=new URL(u.url);return p.pathname=this.getPath(u).slice(l)||"/",new Request(p,u)}})();let a=async(c,l)=>{let u=await r(o(c.req.raw),...i(c));if(u)return u;await l()};return this.#s(y,L(t,"*"),a),this}#s(t,r,n,o){t=t.toUpperCase(),r=L(this._basePath,r);let s={basePath:o!==void 0?L(this._basePath,o):this._basePath,path:r,method:t,handler:n};this.router.add(t,r,[n,s]),this.routes.push(s)}#o(t,r){if(t instanceof Error)return this.errorHandler(t,r);throw t}#n(t,r,n,o){if(o==="HEAD")return(async()=>new Response(null,await this.#n(t,r,n,"GET")))();let s=this.getPath(t,{env:n}),i=this.router.match(o,s),a=new ue(t,{path:s,matchResult:i,env:n,executionCtx:r,notFoundHandler:this.#r});if(i[0].length===1){let l;try{l=i[0][0][0][0](a,async()=>{a.res=await this.#r(a)})}catch(u){return this.#o(u,a)}return l instanceof Promise?l.then(u=>u||(a.finalized?a.res:this.#r(a))).catch(u=>this.#o(u,a)):l??this.#r(a)}let c=ne(i[0],this.errorHandler,this.#r);return(async()=>{try{let l=await c(a);if(!l.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return l.res}catch(l){return this.#o(l,a)}})()}fetch=(t,...r)=>this.#n(t,r[1],r[0],t.method);request=(t,r,n,o)=>t instanceof Request?this.fetch(r?new Request(t,r):t,n,o):(t=t.toString(),this.fetch(new Request(/^https?:\/\//.test(t)?t:`http://localhost${L("/",t)}`,r),n,o));fire=()=>{addEventListener("fetch",t=>{t.respondWith(this.#n(t.request,t,void 0,t.request.method))})}};var X=[];function de(e,t){let r=this.buildAllMatchers(),n=((o,s)=>{let i=r[o]||r[y],a=i[2][s];if(a)return a;let c=s.match(i[0]);if(!c)return[[],X];let l=c.indexOf("",1);return[i[1][l],c]});return this.match=n,n(e,t)}var Y="[^/]+",B=".*",z="(?:|/.*)",I=Symbol(),It=new Set(".\\+*[^]$()");function jt(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1||e===B||e===z?1:t===B||t===z?-1:e===Y?1:t===Y?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Be=class pe{#t;#e;#r=Object.create(null);insert(t,r,n,o,s){if(t.length===0){if(this.#t!==void 0)throw I;if(s)return;this.#t=r;return}let[i,...a]=t,c=i==="*"?a.length===0?["","",B]:["","",Y]:i==="/*"?["","",z]:i.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),l;if(c){let u=c[1],p=c[2]||Y;if(u&&c[2]&&(p===".*"||(p=p.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(p))))throw I;if(l=this.#r[p],!l){if(Object.keys(this.#r).some(g=>g!==B&&g!==z))throw I;if(s)return;l=this.#r[p]=new pe,u!==""&&(l.#e=o.varIndex++)}!s&&u!==""&&n.push([u,l.#e])}else if(l=this.#r[i],!l){if(Object.keys(this.#r).some(u=>u.length>1&&u!==B&&u!==z))throw I;if(s)return;l=this.#r[i]=new pe}l.insert(a,r,n,o,s)}buildRegExpStr(){let r=Object.keys(this.#r).sort(jt).map(n=>{let o=this.#r[n];return(typeof o.#e=="number"?`(${n})@${o.#e}`:It.has(n)?`\\${n}`:n)+o.buildRegExpStr()});return typeof this.#t=="number"&&r.unshift(`#${this.#t}`),r.length===0?"":r.length===1?r[0]:"(?:"+r.join("|")+")"}};var ze=class{#t={varIndex:0};#e=new Be;insert(e,t,r){let n=[],o=[];for(let i=0;;){let a=!1;if(e=e.replace(/\{[^}]+\}/g,c=>{let l=`@\\${i}`;return o[i]=[l,c],i++,a=!0,l}),!a)break}let s=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let i=o.length-1;i>=0;i--){let[a]=o[i];for(let c=s.length-1;c>=0;c--)if(s[c].indexOf(a)!==-1){s[c]=s[c].replace(a,o[i][1]);break}}return this.#e.insert(s,t,n,this.#t,r),n}buildRegExp(){let e=this.#e.buildRegExpStr();if(e==="")return[/^$/,[],[]];let t=0,r=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,(o,s,i)=>s!==void 0?(r[++t]=Number(s),"$()"):(i!==void 0&&(n[Number(i)]=++t),"")),[new RegExp(`^${e}`),r,n]}};var Ht=[/^$/,[],Object.create(null)],qe=Object.create(null);function Fe(e){return qe[e]??=new RegExp(e==="*"?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,(t,r)=>r?`\\${r}`:"(?:|/.*)")}$`)}function $t(){qe=Object.create(null)}function Nt(e){let t=new ze,r=[];if(e.length===0)return Ht;let n=e.map(l=>[!/\*|\/:/.test(l[0]),...l]).sort(([l,u],[p,g])=>l?1:p?-1:u.length-g.length),o=Object.create(null);for(let l=0,u=-1,p=n.length;l<p;l++){let[g,h,m]=n[l];g?o[h]=[m.map(([w])=>[w,Object.create(null)]),X]:u++;let d;try{d=t.insert(h,u,g)}catch(w){throw w===I?new J(h):w}g||(r[u]=m.map(([w,f])=>{let R=Object.create(null);for(f-=1;f>=0;f--){let[O,S]=d[f];R[O]=S}return[w,R]}))}let[s,i,a]=t.buildRegExp();for(let l=0,u=r.length;l<u;l++)for(let p=0,g=r[l].length;p<g;p++){let h=r[l][p]?.[1];if(!h)continue;let m=Object.keys(h);for(let d=0,w=m.length;d<w;d++)h[m[d]]=a[h[m[d]]]}let c=[];for(let l in i)c[l]=r[i[l]];return[s,c,o]}function $(e,t){if(e){for(let r of Object.keys(e).sort((n,o)=>o.length-n.length))if(Fe(r).test(t))return[...e[r]]}}var Q=class{name="RegExpRouter";#t;#e;constructor(){this.#t={[y]:Object.create(null)},this.#e={[y]:Object.create(null)}}add(e,t,r){let n=this.#t,o=this.#e;if(!n||!o)throw new Error(G);n[e]||[n,o].forEach(a=>{a[e]=Object.create(null),Object.keys(a[y]).forEach(c=>{a[e][c]=[...a[y][c]]})}),t==="/*"&&(t="*");let s=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){let a=Fe(t);e===y?Object.keys(n).forEach(c=>{n[c][t]||=$(n[c],t)||$(n[y],t)||[]}):n[e][t]||=$(n[e],t)||$(n[y],t)||[],Object.keys(n).forEach(c=>{(e===y||e===c)&&Object.keys(n[c]).forEach(l=>{a.test(l)&&n[c][l].push([r,s])})}),Object.keys(o).forEach(c=>{(e===y||e===c)&&Object.keys(o[c]).forEach(l=>a.test(l)&&o[c][l].push([r,s]))});return}let i=K(t)||[t];for(let a=0,c=i.length;a<c;a++){let l=i[a];Object.keys(o).forEach(u=>{(e===y||e===u)&&(o[u][l]||=[...$(n[u],l)||$(n[y],l)||[]],o[u][l].push([r,s-c+a+1]))})}}match=de;buildAllMatchers(){let e=Object.create(null);return Object.keys(this.#e).concat(Object.keys(this.#t)).forEach(t=>{e[t]||=this.#r(t)}),this.#t=this.#e=void 0,$t(),e}#r(e){let t=[],r=e===y;return[this.#t,this.#e].forEach(n=>{let o=n[e]?Object.keys(n[e]).map(s=>[s,n[e][s]]):[];o.length!==0?(r||=!0,t.push(...o)):e!==y&&t.push(...Object.keys(n[y]).map(s=>[s,n[y][s]]))}),r?Nt(t):null}};var he=class{name="SmartRouter";#t=[];#e=[];constructor(e){this.#t=e.routers}add(e,t,r){if(!this.#e)throw new Error(G);this.#e.push([e,t,r])}match(e,t){if(!this.#e)throw new Error("Fatal error");let r=this.#t,n=this.#e,o=r.length,s=0,i;for(;s<o;s++){let a=r[s];try{for(let c=0,l=n.length;c<l;c++)a.add(...n[c]);i=a.match(e,t)}catch(c){if(c instanceof J)continue;throw c}this.match=a.match.bind(a),this.#t=[a],this.#e=void 0;break}if(s===o)throw new Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,i}get activeRouter(){if(this.#e||this.#t.length!==1)throw new Error("No active router has been determined yet.");return this.#t[0]}};var q=Object.create(null),Dt=e=>{for(let t in e)return!0;return!1},We=class Ve{#t;#e;#r;#s=0;#o=q;constructor(t,r,n){if(this.#e=n||Object.create(null),this.#t=[],t&&r){let o=Object.create(null);o[t]={handler:r,possibleKeys:[],score:0},this.#t=[o]}this.#r=[]}insert(t,r,n){this.#s=++this.#s;let o=this,s=Ce(r),i=[];for(let a=0,c=s.length;a<c;a++){let l=s[a],u=s[a+1],p=_e(l,u),g=Array.isArray(p)?p[0]:l;if(g in o.#e){o=o.#e[g],p&&i.push(p[1]);continue}o.#e[g]=new Ve,p&&(o.#r.push(p),i.push(p[1])),o=o.#e[g]}return o.#t.push({[t]:{handler:n,possibleKeys:i.filter((a,c,l)=>l.indexOf(a)===c),score:this.#s}}),o}#n(t,r,n,o,s){for(let i=0,a=r.#t.length;i<a;i++){let c=r.#t[i],l=c[n]||c[y],u={};if(l!==void 0&&(l.params=Object.create(null),t.push(l),o!==q||s&&s!==q))for(let p=0,g=l.possibleKeys.length;p<g;p++){let h=l.possibleKeys[p],m=u[l.score];l.params[h]=s?.[h]&&!m?s[h]:o[h]??s?.[h],u[l.score]=!0}}}search(t,r){let n=[];this.#o=q;let s=[this],i=se(r),a=[],c=i.length,l=null;for(let u=0;u<c;u++){let p=i[u],g=u===c-1,h=[];for(let d=0,w=s.length;d<w;d++){let f=s[d],R=f.#e[p];R&&(R.#o=f.#o,g?(R.#e["*"]&&this.#n(n,R.#e["*"],t,f.#o),this.#n(n,R,t,f.#o)):h.push(R));for(let O=0,S=f.#r.length;O<S;O++){let v=f.#r[O],b=f.#o===q?{}:{...f.#o};if(v==="*"){let k=f.#e["*"];k&&(this.#n(n,k,t,f.#o),k.#o=b,h.push(k));continue}let[A,x,P]=v;if(!p&&!(P instanceof RegExp))continue;let E=f.#e[A];if(P instanceof RegExp){if(l===null){l=new Array(c);let H=r[0]==="/"?1:0;for(let _=0;_<c;_++)l[_]=H,H+=i[_].length+1}let k=r.substring(l[u]),N=P.exec(k);if(N){if(b[x]=N[0],this.#n(n,E,t,f.#o,b),Dt(E.#e)){E.#o=b;let H=N[0].match(/\//)?.length??0;(a[H]||=[]).push(E)}continue}}(P===!0||P.test(p))&&(b[x]=p,g?(this.#n(n,E,t,b,f.#o),E.#e["*"]&&this.#n(n,E.#e["*"],t,b,f.#o)):(E.#o=b,h.push(E)))}}let m=a.shift();s=m?h.concat(m):h}return n.length>1&&n.sort((u,p)=>u.score-p.score),[n.map(({handler:u,params:p})=>[u,p])]}};var fe=class{name="TrieRouter";#t;constructor(){this.#t=new We}add(e,t,r){let n=K(t);if(n){for(let o=0,s=n.length;o<s;o++)this.#t.insert(e,n[o],r);return}this.#t.insert(e,t,r)}match(e,t){return this.#t.search(e,t)}};var ge=class extends Ne{constructor(e={}){super(e),this.router=e.router??new he({routers:[new Q,new fe]})}};import{Readable as Pr}from"stream";function Ke(e=""){return`<link rel="icon" type="image/svg+xml" href="${`${e.replace(/\/$/,"")}/favicon-black.svg?v=4`}" />`}import{existsSync as Ge,readFileSync as Bt}from"fs";import U from"path";import{fileURLToPath as zt}from"url";import{gunzipSync as qt}from"zlib";var Ft={".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".webmanifest":"application/manifest+json"};function Wt(){let e=U.dirname(zt(import.meta.url));for(let t of[U.resolve(e,"app"),U.resolve(e,"../app"),U.resolve(e,"../../dist/app")])if(Ge(U.join(t,"inspector.js.gz")))return t;throw new Error("Inspector bundle not found (expected dist/app/inspector.js.gz)")}function Je(e,t="/inspector/assets"){let r=Wt(),n=new Map;e.get(`${t}/*`,o=>{let s=o.req.path.slice(t.length),i=s.startsWith("/")?s.slice(1):s;if(!i||i.includes(".."))return o.notFound();let a=i==="inspector.js"||i==="inspector.css"?`${i}.gz`:i,c=U.resolve(r,a),l=r.endsWith(U.sep)?r:`${r}${U.sep}`;if(!c.startsWith(l)||!Ge(c))return o.notFound();let u=U.extname(i),p=a.endsWith(".gz"),g=/(?:^|,)\s*gzip\s*(?:,|$)/i.test(o.req.header("accept-encoding")??""),h=Bt(c),m=p&&!g?n.get(c)??Vt(n,c,h):h,d=m.buffer.slice(m.byteOffset,m.byteOffset+m.byteLength);return o.body(d,200,{"Content-Type":Ft[u]??"application/octet-stream",...p&&g?{"Content-Encoding":"gzip"}:{},...p?{Vary:"Accept-Encoding"}:{},"Cache-Control":"no-cache"})})}function Vt(e,t,r){let n=qt(r);return e.set(t,n),n}var Xe={name:"@mcp-use/inspector",type:"module",version:"20.0.0-beta.22",description:"MCP Inspector - A tool for inspecting and debugging MCP servers",author:"",license:"MIT",homepage:"https://github.com/mcp-use/mcp-use#readme",repository:{type:"git",url:"git+https://github.com/mcp-use/mcp-use.git",directory:"libraries/typescript/packages/inspector"},bugs:{url:"https://github.com/mcp-use/mcp-use/issues"},keywords:["mcp","inspector","debug","tools"],exports:{".":{types:"./dist/server/index.d.ts",import:"./dist/server/index.js"},"./client":{types:"./dist/client/index.d.ts",import:"./dist/client/index.js"}},main:"./dist/server/index.js",types:"./dist/server/index.d.ts",bin:{"mcp-inspect":"./dist/cli.js"},files:["dist"],scripts:{dev:"rimraf node_modules/.vite && VITE_MANUFACT_CHAT_URL=${VITE_MANUFACT_CHAT_URL:-http://localhost:8000/api/v1/inspector/chat/stream} vite --strictPort","dev:client":"pnpm run dev","dev:server":"VITE_DEV=true tsx watch src/server/server.ts","dev:standalone":"tsx watch src/server/server.ts",clean:"rimraf dist",build:"npm run clean && npm run build:client-exports && npm run build:server && npm run build:app && npm run verify:package","build:app":"vite build --config vite.app.config.ts && node scripts/compress-app.mjs","watch:app":"vite build --watch --config vite.app.config.ts","preview:app":"vite preview --config vite.app.config.ts --host 127.0.0.1","serve:app":"pnpm build:app && pnpm preview:app","analyze:app":"ANALYZE=true vite build --config vite.app.config.ts","build:client-exports":"tsup --config tsup.client.ts","build:server":"tsup --config tsup.server.ts","verify:package":"node scripts/verify-package.mjs",prepublishOnly:"pnpm --filter @mcp-use/client build && pnpm build",start:"node dist/cli.js --port 3000",preview:"vite preview","type-check":"tsc --noEmit",lint:"eslint .","lint:fix":"eslint . --fix","test:e2e":"playwright test","test:e2e:ui":"playwright test --ui","test:e2e:debug":"playwright test --debug","test:e2e:builtin":"node tests/e2e/scripts/run-test-matrix.mjs builtin","test:e2e:prod":"node tests/e2e/scripts/run-test-matrix.mjs prod","test:e2e:mix":"node tests/e2e/scripts/run-test-matrix.mjs mix","test:e2e:prod:ui":"TEST_MODE=production playwright test --ui","test:e2e:codegen":"playwright codegen http://localhost:3000/inspector","test:e2e:report":"playwright show-report","test:e2e:python":"node tests/e2e/scripts/run-python-e2e.mjs","test:unit":"vitest run","test:unit:watch":"vitest","test:e2e:tunnel":"node tests/e2e/scripts/run-tunnel-test.mjs","install:pnpm":"pnpm install","install:npm":"npm install","lint:npm":"npm run lint:fix","lint:pnpm":"pnpm lint:fix"},engines:{node:">=22.22.2"},peerDependencies:{"@base-ui/react":"^1.6.0","@mcp-use/agent":"^2.0.0-alpha.0","@mcp-use/client":"^2.0.0-alpha.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",express:"^4.21.2 || ^5.0.0","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4","mcp-use":"workspace:*",motion:"^12.34.2",react:"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","react-resizable-panels":"^4.6.4",sonner:"^2.0.7","tailwind-merge":"^3.5.0"},peerDependenciesMeta:{"@base-ui/react":{optional:!0},"@mcp-use/agent":{optional:!0},"@mcp-use/client":{optional:!0},"class-variance-authority":{optional:!0},clsx:{optional:!0},express:{optional:!0},"lucide-react":{optional:!0},"markdown-to-jsx":{optional:!0},motion:{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-resizable-panels":{optional:!0},sonner:{optional:!0},"tailwind-merge":{optional:!0}},dependencies:{},publishConfig:{access:"public"},devDependencies:{"@base-ui/react":"^1.6.0","@hono/node-server":"^1.19.13","@mcp-use/agent":"workspace:*","@mcp-use/client":"workspace:*","@playwright/test":"^1.58.2","@tailwindcss/vite":"^4.2.0","@types/express":"^5.0.6","@vitejs/plugin-react":"^6.0.0","class-variance-authority":"^0.7.1",clsx:"^2.1.1",emulate:"0.5.0",eslint:"^9.39.2",express:"^5.2.1",hono:"^4.12.12","lucide-react":"^0.562.0","markdown-to-jsx":"^9.7.4",motion:"^12.34.2","oauth2-mock-server":"^8.2.2",open:"^11.0.0",react:"^19.2.3","react-dom":"^19.2.3","react-router":"^7.12.0","react-resizable-panels":"^4.6.4","rollup-plugin-visualizer":"^6.0.3",sonner:"^2.0.7","tailwind-merge":"^3.5.0",tailwindcss:"^4.2.0",tsup:"^8.5.1",tsx:"^4.21.0","tw-animate-css":"^1.4.0",typescript:"^5.9.3",vite:"^8.0.16",vitest:"^4.1.0","wait-on":"^9.0.4",zod:"^4.2.0"}};var Gt=Xe.version;function Ye(){return Gt}var Qe=Ye(),Jt=`<!doctype html>
2
2
  <html lang="en"><head><meta charset="utf-8"><title>Signed in</title><meta name="robots" content="noindex"><style>html,body{margin:0;height:100%;display:flex;align-items:center;justify-content:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#4b5563;background:#fff}</style></head>
3
3
  <body><div>Signed in. You can close this window.</div>
4
4
  <script>try{if(window.opener&&!window.opener.closed)window.opener.postMessage({type:"manufact:oauth-complete"},"*")}catch(e){}try{window.close()}catch(e){}</script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mcp-use/inspector",
3
3
  "type": "module",
4
- "version": "20.0.0-beta.22",
4
+ "version": "20.0.0-beta.23",
5
5
  "description": "MCP Inspector - A tool for inspecting and debugging MCP servers",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  "react-resizable-panels": "^4.6.4",
57
57
  "sonner": "^2.0.7",
58
58
  "tailwind-merge": "^3.5.0",
59
- "mcp-use": "2.0.0-beta.30"
59
+ "mcp-use": "2.0.0-beta.31"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "@base-ui/react": {
@@ -140,8 +140,8 @@
140
140
  "vitest": "^4.1.0",
141
141
  "wait-on": "^9.0.4",
142
142
  "zod": "^4.2.0",
143
- "@mcp-use/agent": "2.0.0-beta.12",
144
- "@mcp-use/client": "2.0.0-beta.11"
143
+ "@mcp-use/agent": "2.0.0-beta.13",
144
+ "@mcp-use/client": "2.0.0-beta.12"
145
145
  },
146
146
  "scripts": {
147
147
  "dev": "rimraf node_modules/.vite && VITE_MANUFACT_CHAT_URL=${VITE_MANUFACT_CHAT_URL:-http://localhost:8000/api/v1/inspector/chat/stream} vite --strictPort",