dev3000 0.0.56 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mcp-server/.next/BUILD_ID +1 -1
- package/mcp-server/.next/build-manifest.json +2 -2
- package/mcp-server/.next/cache/.tsbuildinfo +1 -1
- package/mcp-server/.next/fallback-build-manifest.json +2 -2
- package/mcp-server/.next/server/app/_global-error.html +2 -2
- package/mcp-server/.next/server/app/_global-error.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found.html +1 -1
- package/mcp-server/.next/server/app/_not-found.rsc +1 -1
- package/mcp-server/.next/server/app/index.html +1 -1
- package/mcp-server/.next/server/app/index.rsc +1 -1
- package/mcp-server/.next/server/app/replay.html +1 -1
- package/mcp-server/.next/server/app/replay.rsc +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__82298dd3._.js +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__82298dd3._.js.map +1 -1
- package/mcp-server/.next/server/pages/404.html +1 -1
- package/mcp-server/.next/server/pages/500.html +2 -2
- package/mcp-server/.next/standalone/.next/BUILD_ID +1 -1
- package/mcp-server/.next/standalone/.next/build-manifest.json +2 -2
- package/mcp-server/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/mcp-server/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/mcp-server/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/mcp-server/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/mcp-server/.next/standalone/.next/server/app/index.html +1 -1
- package/mcp-server/.next/standalone/.next/server/app/index.rsc +1 -1
- package/mcp-server/.next/standalone/.next/server/app/replay.html +1 -1
- package/mcp-server/.next/standalone/.next/server/app/replay.rsc +1 -1
- package/mcp-server/.next/standalone/.next/server/chunks/[root-of-the-server]__82298dd3._.js +1 -1
- package/mcp-server/.next/standalone/.next/server/pages/404.html +1 -1
- package/mcp-server/.next/standalone/.next/server/pages/500.html +2 -2
- package/mcp-server/.next/standalone/app/api/mcp/[transport]/route.ts +1 -1
- package/mcp-server/.next/trace +1 -1
- package/mcp-server/app/api/mcp/[transport]/route.ts +1 -1
- package/package.json +3 -4
- /package/mcp-server/.next/static/{N6OEtGstY3aUCE305hVvb → mApgFwHCnTXuGrVRNheFT}/_buildManifest.js +0 -0
- /package/mcp-server/.next/static/{N6OEtGstY3aUCE305hVvb → mApgFwHCnTXuGrVRNheFT}/_clientMiddlewareManifest.json +0 -0
- /package/mcp-server/.next/static/{N6OEtGstY3aUCE305hVvb → mApgFwHCnTXuGrVRNheFT}/_ssgManifest.js +0 -0
|
@@ -13,7 +13,7 @@ data: ${JSON.stringify(e)}
|
|
|
13
13
|
`;return r&&(s+=`id: ${r}
|
|
14
14
|
`),s+=`data: ${JSON.stringify(t)}
|
|
15
15
|
|
|
16
|
-
`,e.write(s)}async handleUnsupportedRequest(e){e.writeHead(405,{Allow:"GET, POST, DELETE"}).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}))}async handlePostRequest(e,t,r){var s,n,i,a,o;try{let o,u,l=e.headers.accept;if(!(null==l?void 0:l.includes("application/json"))||!l.includes("text/event-stream"))return void t.writeHead(406).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Not Acceptable: Client must accept both application/json and text/event-stream"},id:null}));let c=e.headers["content-type"];if(!c||!c.includes("application/json"))return void t.writeHead(415).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Unsupported Media Type: Content-Type must be application/json"},id:null}));let d=e.auth,f={headers:e.headers};if(void 0!==r)o=r;else{let t=sH.default.parse(c),r=await (0,sG.default)(e,{limit:"4mb",encoding:null!=(s=t.parameters.charset)?s:"utf-8"});o=JSON.parse(r.toString())}let h=(u=Array.isArray(o)?o.map(e=>re.parse(e)):[re.parse(o)]).some(ro);if(h){if(this._initialized&&void 0!==this.sessionId)return void t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Server already initialized"},id:null}));if(u.length>1)return void t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Only one initialization request is allowed"},id:null}));this.sessionId=null==(n=this.sessionIdGenerator)?void 0:n.call(this),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!h&&(!this.validateSession(e,t)||!this.validateProtocolVersion(e,t)))return;let m=u.some(t8);if(m){if(m){let e=(0,s$.randomUUID)();if(!this._enableJsonResponse){let e={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};void 0!==this.sessionId&&(e["mcp-session-id"]=this.sessionId),t.writeHead(200,e)}for(let r of u)t8(r)&&(this._streamMapping.set(e,t),this._requestToStreamMapping.set(r.id,e));for(let r of(t.on("close",()=>{this._streamMapping.delete(e)}),u))null==(a=this.onmessage)||a.call(this,r,{authInfo:d,requestInfo:f})}}else for(let e of(t.writeHead(202).end(),u))null==(i=this.onmessage)||i.call(this,e,{authInfo:d,requestInfo:f})}catch(e){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32700,message:"Parse error",data:String(e)},id:null})),null==(o=this.onerror)||o.call(this,e)}}async handleDeleteRequest(e,t){var r;this.validateSession(e,t)&&this.validateProtocolVersion(e,t)&&(await Promise.resolve(null==(r=this._onsessionclosed)?void 0:r.call(this,this.sessionId)),await this.close(),t.writeHead(200).end())}validateSession(e,t){if(void 0===this.sessionIdGenerator)return!0;if(!this._initialized)return t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Server not initialized"},id:null})),!1;let r=e.headers["mcp-session-id"];return r?Array.isArray(r)?(t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header must be a single value"},id:null})),!1):r===this.sessionId||(t.writeHead(404).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32001,message:"Session not found"},id:null})),!1):(t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header is required"},id:null})),!1)}validateProtocolVersion(e,t){var r;let s=null!=(r=e.headers["mcp-protocol-version"])?r:"2025-03-26";return Array.isArray(s)&&(s=s[s.length-1]),!!tq.includes(s)||(t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:`Bad Request: Unsupported protocol version (supported versions: ${tq.join(", ")})`},id:null})),!1)}async close(){var e;this._streamMapping.forEach(e=>{e.end()}),this._streamMapping.clear(),this._requestResponseMap.clear(),null==(e=this.onclose)||e.call(this)}async send(e,t){let r=null==t?void 0:t.relatedRequestId;if((t9(e)||t7(e))&&(r=e.id),void 0===r){let t;if(t9(e)||t7(e))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let r=this._streamMapping.get(this._standaloneSseStreamId);if(void 0===r)return;this._eventStore&&(t=await this._eventStore.storeEvent(this._standaloneSseStreamId,e)),this.writeSSEEvent(r,e,t);return}let s=this._requestToStreamMapping.get(r),n=this._streamMapping.get(s);if(!s)throw Error(`No connection established for request ID: ${String(r)}`);if(!this._enableJsonResponse){let t;this._eventStore&&(t=await this._eventStore.storeEvent(s,e)),n&&this.writeSSEEvent(n,e,t)}if(t9(e)||t7(e)){this._requestResponseMap.set(r,e);let t=Array.from(this._requestToStreamMapping.entries()).filter(([e,t])=>this._streamMapping.get(t)===n).map(([e])=>e);if(t.every(e=>this._requestResponseMap.has(e))){if(!n)throw Error(`No connection established for request ID: ${String(r)}`);if(this._enableJsonResponse){let e={"Content-Type":"application/json"};void 0!==this.sessionId&&(e["mcp-session-id"]=this.sessionId);let r=t.map(e=>this._requestResponseMap.get(e));n.writeHead(200,e),1===r.length?n.end(JSON.stringify(r[0])):n.end(JSON.stringify(r))}else n.end();for(let e of t)this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e)}}}}var s0=e.i(49719),s1=e.i(10430),s4=e.i(27699);class s2 extends Error{constructor(e,t){super(e),this.errorUri=t,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class s8 extends s2{}s8.errorCode="invalid_request";class s6 extends s2{}s6.errorCode="invalid_client";class s5 extends s2{}s5.errorCode="invalid_grant";class s9 extends s2{}s9.errorCode="unauthorized_client";class s3 extends s2{}s3.errorCode="unsupported_grant_type";class s7 extends s2{}s7.errorCode="invalid_scope";class ne extends s2{}ne.errorCode="access_denied";class nt extends s2{}nt.errorCode="server_error";class nr extends s2{}nr.errorCode="temporarily_unavailable";class ns extends s2{}ns.errorCode="unsupported_response_type";class nn extends s2{}nn.errorCode="unsupported_token_type";class ni extends s2{}ni.errorCode="invalid_token";class na extends s2{}na.errorCode="method_not_allowed";class no extends s2{}no.errorCode="too_many_requests";class nu extends s2{}nu.errorCode="invalid_client_metadata";class nl extends s2{}nl.errorCode="insufficient_scope",s8.errorCode,s6.errorCode,s5.errorCode,s9.errorCode,s3.errorCode,s7.errorCode,ne.errorCode,nt.errorCode,nr.errorCode,ns.errorCode,nn.errorCode,ni.errorCode,na.errorCode,no.errorCode,nu.errorCode,nl.errorCode;var nc=class extends sZ.ServerResponse{constructor(e,t,r){super(e),this.onEvent=t,this.sessionId=r,this.requestId=crypto.randomUUID(),this.startTime=Date.now()}emitEvent(e){var t;this.onEvent&&this.onEvent((t=Y(F({},e),{sessionId:this.sessionId,requestId:this.requestId}),Y(F({},t),{timestamp:Date.now()})))}startSession(e,t){this.emitEvent({type:"SESSION_STARTED",transport:e,clientInfo:t})}endSession(e){this.emitEvent({type:"SESSION_ENDED",transport:e})}requestReceived(e,t){this.emitEvent({type:"REQUEST_RECEIVED",method:e,parameters:t,status:"success"})}requestCompleted(e,t,r){this.emitEvent({type:"REQUEST_COMPLETED",method:e,result:t,duration:Date.now()-this.startTime,status:r?"error":"success"}),r&&this.error(r,`Error executing request ${e}`,"request")}error(e,t,r="system",s="error"){this.emitEvent({type:"ERROR",error:e,context:t,source:r,severity:s})}end(e,t,r){let s=e,n=t,i=r;return"function"==typeof e?(i=e,s=void 0,n=void 0):"function"==typeof t&&(i=t,n=void 0),super.end(s,n,i)}},nd=new s1.AsyncLocalStorage,nf=new WeakMap,nh=null;function nm(e){return k(this,arguments,function*({redisUrl:e,logger:t}){if(c&&l)return{redis:c,redisPublisher:l};if(!e)throw Error("redisUrl is required");return c=(0,sz.createClient)({url:e}),l=(0,sz.createClient)({url:e}),c.on("error",e=>{t.error("Redis error",e)}),l.on("error",e=>{t.error("Redis error",e)}),yield Promise.all([c.connect(),l.connect()]),{redis:c,redisPublisher:l}})}function np(e={}){let{method:t="GET",url:r="/",headers:s={},body:n=null,socket:i=new sW.Socket}=e,a=new sJ.Readable;if(a._read=()=>{},n){if("string"==typeof n)a.push(n);else if(Buffer.isBuffer(n))a.push(n);else{let e=JSON.stringify(n);a.push(e)}a.push(null)}else a.push(null);let o=new sZ.IncomingMessage(i);o.method=t,o.url=r,o.headers=s;let u=e.auth||nd.getStore();return u&&(o.auth=u),o.push=a.push.bind(a),o.read=a.read.bind(a),o.on=a.on.bind(a),o.pipe=a.pipe.bind(a),o}e.i(66212),e.i(17953),e.i(60238);var n_=e.i(6281);e.i(3441),n_.default;var tG=tG;let ng=function(e,t,r){let s=function(e,t={},r={redisUrl:process.env.REDIS_URL||process.env.KV_URL,streamableHttpEndpoint:"/mcp",sseEndpoint:"/sse",sseMessageEndpoint:"/message",basePath:"",maxDuration:60,verboseLogs:!1,disableSse:!1}){let s,{redisUrl:n,basePath:i,streamableHttpEndpoint:a,sseEndpoint:o,sseMessageEndpoint:u,maxDuration:l,verboseLogs:c,disableSse:d}=r,{serverInfo:f={name:"mcp-typescript server on vercel",version:"0.1.0"}}=t,h=((e,t)=>{var r={};for(var s in e)x.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&L)for(var s of L(e))0>t.indexOf(s)&&M.call(e,s)&&(r[s]=e[s]);return r})(t,["serverInfo"]),{streamableHttpEndpoint:m,sseEndpoint:p,sseMessageEndpoint:_}=function({basePath:e,streamableHttpEndpoint:t="/mcp",sseEndpoint:r="/sse",sseMessageEndpoint:s="/message"}){let{streamableHttpEndpoint:n,sseEndpoint:i,sseMessageEndpoint:a}=null!=e?function(e){let t=e.replace(/\/$/,"");return{streamableHttpEndpoint:`${t}/mcp`,sseEndpoint:`${t}/sse`,sseMessageEndpoint:`${t}/message`}}(e):{streamableHttpEndpoint:t,sseEndpoint:r,sseMessageEndpoint:s};return{streamableHttpEndpoint:n,sseEndpoint:i,sseMessageEndpoint:a}}({basePath:i,streamableHttpEndpoint:a,sseEndpoint:o,sseMessageEndpoint:u}),g=function(e=!1){return{log:(...t)=>{e&&console.log(...t)},error:(...t)=>{e&&console.error(...t)},warn:(...t)=>{e&&console.warn(...t)},info:(...t)=>{e&&console.info(...t)},debug:(...t)=>{e&&console.debug(...t)}}}(c),v=[],y=new sQ({sessionIdGenerator:void 0});return nh||(nh=setInterval(()=>{let e=Date.now();v=v.filter(t=>{var r;let s=nf.get(t);if(!s){g.log("Removing orphaned server without metadata");try{(null==t?void 0:t.server)&&t.server.close()}catch(e){g.error("Error closing orphaned server:",e)}return!1}let n=e-s.createdAt.getTime();if(n>3e5){g.log(`Removing stale server (session ${s.sessionId}, age: ${n}ms)`);try{(null==t?void 0:t.server)&&t.server.close(),(null==(r=s.transport)?void 0:r.close)&&s.transport.close()}catch(e){g.error("Error closing stale server:",e)}return nf.delete(t),!1}return!0})},3e4)),function(i,a){return k(this,null,function*(){var o,u,c;let E=new URL(i.url||"","https://example.com");if(E.pathname===m){if("GET"===i.method){g.log("Received GET MCP request"),a.writeHead(405).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}));return}if("DELETE"===i.method){g.log("Received DELETE MCP request"),a.writeHead(405).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}));return}if("POST"===i.method){let t,n=new nc(np(),r.onEvent);s||(s=new sY(f,h),yield e(s),yield s.connect(y)),t=(i.headers.get("content-type")||"").includes("application/json")?yield i.json():yield i.text();let o=np({method:i.method,url:i.url,headers:Object.fromEntries(i.headers),body:t,auth:i.auth}),u=new nc(o,r.onEvent);Object.assign(u,a);try{yield y.handleRequest(o,u),"object"==typeof t&&t&&"method"in t&&n.requestCompleted(t.method,t)}catch(e){throw"object"==typeof t&&t&&"method"in t&&n.requestCompleted(t.method,void 0,e instanceof Error?e:String(e)),e}}}else if(E.pathname===p){if(d){a.statusCode=404,a.end("Not found");return}if("GET"!==i.method){g.log(`Rejected SSE connection with method ${i.method}`),a.writeHead(405,{"Content-Type":"text/plain"}).end("Method Not Allowed");return}let s=i.headers.get("accept")||i.headers.get("Accept");if(s&&!s.includes("text/event-stream")&&!s.includes("*/*")&&!s.includes("text/*")){g.log(`Rejected SSE connection with incompatible Accept header: ${s}`),a.writeHead(406,{"Content-Type":"text/plain"}).end("Not Acceptable");return}let{redis:h,redisPublisher:m}=yield nm({redisUrl:n,logger:g});g.log("Got new SSE connection"),(0,s0.default)(_,"sseMessageEndpoint is required");let p=new sV(_,a),y=p.sessionId,E=new nc(np(),r.onEvent,y);E.startSession("SSE",{userAgent:null!=(o=i.headers.get("user-agent"))?o:void 0,ip:null!=(c=null!=(u=i.headers.get("x-forwarded-for"))?u:i.headers.get("x-real-ip"))?c:void 0});let b=new sY(f,t),S=!1,R=null,I=null,A=null,T=null,O=[],N=e=>k(this,null,function*(){if(!S){if(S=!0,g.log(`Cleaning up SSE connection: ${e}`),I&&(clearTimeout(I),I=null),R&&(clearInterval(R),R=null),A&&(i.signal.removeEventListener("abort",A),A=null),T)try{yield h.unsubscribe(`requests:${y}`,T),g.log(`Unsubscribed from requests:${y}`)}catch(e){g.error("Error unsubscribing from Redis:",e)}try{(null==b?void 0:b.server)&&(yield b.server.close()),(null==p?void 0:p.close)&&(yield p.close())}catch(e){g.error("Error closing server/transport:",e)}v=v.filter(e=>e!==b),nf.delete(b),E.endSession("SSE"),O=[],a.headersSent||(a.statusCode=200,a.end())}});try{let t,s=function(e,...t){O.push({type:e,messages:t})};yield e(b),v.push(b),nf.set(b,{sessionId:y,createdAt:new Date,transport:p}),b.server.onclose=()=>{N("server closed")},T=e=>k(this,null,function*(){g.log("Received message from Redis",e),s("log","Received message from Redis",e);let t=JSON.parse(e),n=np({method:t.method,url:t.url,headers:t.headers,body:t.body}),i=new nc(n,r.onEvent,y),a=100,o="";i.writeHead=e=>(a=e,i),i.end=e=>(o=e,i);try{if(yield p.handlePostMessage(n,i),"object"==typeof t.body&&t.body&&"method"in t.body)try{let e=JSON.parse(o);E.requestCompleted(t.body.method,e)}catch(e){E.requestCompleted(t.body.method,o)}}catch(e){throw E.error(e instanceof Error?e:String(e),"Error handling SSE message","session"),e}yield m.publish(`responses:${y}:${t.requestId}`,JSON.stringify({status:a,body:o})),a>=200&&a<300?s("log",`Request ${y}:${t.requestId} succeeded: ${o}`):(s("error",`Message for ${y}:${t.requestId} failed with status ${a}: ${o}`),E.error(`Request failed with status ${a}`,o,"session"))}),R=setInterval(()=>{for(let e of O)g[e.type](...e.messages);O=[]},100),yield h.subscribe(`requests:${y}`,T),g.log(`Subscribed to requests:${y}`);let n=new Promise(e=>{t=e,I=setTimeout(()=>{e("max duration reached")},(null!=l?l:60)*1e3)});A=()=>t("client hang up"),i.signal.addEventListener("abort",A),a.on("close",()=>{N("response closed")}),a.on("error",e=>{g.error("Response error:",e),N("response error")}),yield b.connect(p);let o=yield n;g.log(o),yield N(String(o))}catch(e){throw g.error("Error in SSE handler:",e),yield N("error during setup"),e}}else if(E.pathname===_){let e;if(d){a.statusCode=404,a.end("Not found");return}let{redis:t,redisPublisher:r}=yield nm({redisUrl:n,logger:g});g.log("Received message");let s=yield i.text();try{e=JSON.parse(s)}catch(t){e=s}let o=E.searchParams.get("sessionId")||"";if(!o){a.statusCode=400,a.end("No sessionId provided");return}let u=crypto.randomUUID(),l={requestId:u,url:i.url||"",method:i.method||"",body:e,headers:Object.fromEntries(i.headers.entries())},c=null,f=!1,h=!1,m=()=>k(this,null,function*(){if(!h){h=!0,c&&(clearTimeout(c),c=null);try{yield t.unsubscribe(`responses:${o}:${u}`)}catch(e){g.error("Error unsubscribing from Redis response channel:",e)}}}),p=(e,t)=>k(this,null,function*(){f||(f=!0,a.statusCode=e,a.end(t),yield m())}),_=e=>k(this,null,function*(){try{let t=JSON.parse(e);yield p(t.status,t.body)}catch(e){g.error("Failed to parse response message:",e),yield p(500,"Internal server error")}});try{yield t.subscribe(`responses:${o}:${u}`,_),yield r.publish(`requests:${o}`,JSON.stringify(l)),g.log(`Published requests:${o}`,l),c=setTimeout(()=>k(this,null,function*(){yield p(408,"Request timed out")}),1e4),a.on("close",()=>k(this,null,function*(){f||(f=!0,yield m())})),a.on("error",e=>k(this,null,function*(){g.error("Response error in message handler:",e),f||(f=!0,yield m())}))}catch(e){g.error("Error in message handler:",e),yield m(),f||(a.statusCode=500,a.end("Internal server error"))}}else a.statusCode=404,a.end("Not found")})}}(e,t,r);return e=>(function(e,t){let r,s=new Promise(e=>{r=e});return new Promise(n=>{let i,a,o=!1,u=!1,l=200,c=(e,t)=>{if("string"==typeof t)throw Error("Status message of writeHead not supported");return u=!0,r({statusCode:l=e,headers:a=t}),m},d=[],f=(e,t)=>{if(t)throw Error("Encoding not supported");if(e instanceof Buffer)throw Error("Buffer not supported");return(u||c(l,a),i)?i.enqueue(new TextEncoder().encode(e)):d.push(new TextEncoder().encode(e)),!0},h=new s4.EventEmitter,m={writeHead:c,write:f,end:e=>{if(e&&f(e),!i)return o=!0,m;try{i.close()}catch(e){}return m},on:(e,t)=>(h.on(e,t),m),get statusCode(){return l},set statusCode(code){l=code,u&&r({statusCode:l,headers:a})}};e.addEventListener("abort",()=>{h.emit("close")}),t(m),k(this,null,function*(){let e=yield s;n(new Response(new ReadableStream({start(e){for(let t of(i=e,d))i.enqueue(t);o&&i.close()}}),{status:e.statusCode,headers:e.headers}))})})})(e.signal,t=>{s(e,t)})}(e=>{e.tool("get_current_timestamp","Get the current timestamp in ISO format - use this to mark points in time before/after user testing. WORKFLOW: Always capture timestamp before asking user to test changes, then capture again after they return, then use get_logs_between_timestamps to analyze what happened during testing.",{},async()=>{let e=new Date().toISOString();return{content:[{type:"text",text:`Current timestamp: ${e}`}]}}),e.tool("healthcheck","Simple healthcheck to verify MCP server is working. Use this to test connectivity and confirm the MCP server is responsive. Returns current timestamp and health status. Useful for initial connection testing or when debugging MCP connectivity issues.",{message:tG.string().optional().describe("Optional message to echo back")},async({message:e="MCP server is healthy!"})=>({content:[{type:"text",text:`✅ ${e} - Timestamp: ${new Date().toISOString()}`}]})),e.tool("read_consolidated_logs","Read recent consolidated development logs containing server output, browser console logs, network requests, user interactions, and screenshots. INSIGHTS: Use this for general log overview, recent error checking, or when you need to understand current application state. Logs include [PLAYWRIGHT] or [CHROME_EXTENSION] tags to distinguish monitoring sources. Filter by keywords like 'ERROR', 'NETWORK', 'INTERACTION', or 'SCREENSHOT' for focused analysis. Combine with search_logs for pattern-based analysis.",{lines:tG.number().optional().describe("Number of recent lines to read (default: 50)"),filter:tG.string().optional().describe("Filter logs by text content"),logPath:tG.string().optional().describe("Path to log file (default: ./ai-dev-tools/consolidated.log)")},async({lines:e=50,filter:t,logPath:r=process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log"})=>{try{if(!(0,P.existsSync)(r))return{content:[{type:"text",text:`No log file found at ${r}. Make sure the dev environment is running.`}]};let s=(0,P.readFileSync)(r,"utf-8").split("\n").filter(e=>e.trim());t&&(s=s.filter(e=>e.toLowerCase().includes(t.toLowerCase())));let n=s.slice(-e);return{content:[{type:"text",text:n.length>0?n.join("\n"):"No matching log entries found."}]}}catch(e){return{content:[{type:"text",text:`Error reading logs: ${e instanceof Error?e.message:String(e)}`}]}}}),e.tool("search_logs","Search through consolidated logs using regex patterns with context lines around matches. POWERFUL DEBUGGING: Essential for tracing error patterns, finding specific API calls, or tracking user interaction sequences. Use patterns like 'ERROR.*fetch', 'CLICK.*button', or 'NETWORK.*POST' to find relevant events. Context lines help understand what led to and followed each match. Great for correlating server errors with user actions.",{pattern:tG.string().describe("Regex pattern to search for"),context:tG.number().optional().describe("Number of lines of context around matches (default: 2)"),logPath:tG.string().optional().describe("Path to log file (default: ./ai-dev-tools/consolidated.log)")},async({pattern:e,context:t=2,logPath:r=process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log"})=>{try{if(!(0,P.existsSync)(r))return{content:[{type:"text",text:`No log file found at ${r}.`}]};let s=(0,P.readFileSync)(r,"utf-8").split("\n"),n=RegExp(e,"gi"),i=[];return s.forEach((e,r)=>{if(n.test(e)){let e=Math.max(0,r-t),n=Math.min(s.length,r+t+1),a=s.slice(e,n);i.push(`Match at line ${r+1}:
|
|
16
|
+
`,e.write(s)}async handleUnsupportedRequest(e){e.writeHead(405,{Allow:"GET, POST, DELETE"}).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}))}async handlePostRequest(e,t,r){var s,n,i,a,o;try{let o,u,l=e.headers.accept;if(!(null==l?void 0:l.includes("application/json"))||!l.includes("text/event-stream"))return void t.writeHead(406).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Not Acceptable: Client must accept both application/json and text/event-stream"},id:null}));let c=e.headers["content-type"];if(!c||!c.includes("application/json"))return void t.writeHead(415).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Unsupported Media Type: Content-Type must be application/json"},id:null}));let d=e.auth,f={headers:e.headers};if(void 0!==r)o=r;else{let t=sH.default.parse(c),r=await (0,sG.default)(e,{limit:"4mb",encoding:null!=(s=t.parameters.charset)?s:"utf-8"});o=JSON.parse(r.toString())}let h=(u=Array.isArray(o)?o.map(e=>re.parse(e)):[re.parse(o)]).some(ro);if(h){if(this._initialized&&void 0!==this.sessionId)return void t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Server already initialized"},id:null}));if(u.length>1)return void t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request: Only one initialization request is allowed"},id:null}));this.sessionId=null==(n=this.sessionIdGenerator)?void 0:n.call(this),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!h&&(!this.validateSession(e,t)||!this.validateProtocolVersion(e,t)))return;let m=u.some(t8);if(m){if(m){let e=(0,s$.randomUUID)();if(!this._enableJsonResponse){let e={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};void 0!==this.sessionId&&(e["mcp-session-id"]=this.sessionId),t.writeHead(200,e)}for(let r of u)t8(r)&&(this._streamMapping.set(e,t),this._requestToStreamMapping.set(r.id,e));for(let r of(t.on("close",()=>{this._streamMapping.delete(e)}),u))null==(a=this.onmessage)||a.call(this,r,{authInfo:d,requestInfo:f})}}else for(let e of(t.writeHead(202).end(),u))null==(i=this.onmessage)||i.call(this,e,{authInfo:d,requestInfo:f})}catch(e){t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32700,message:"Parse error",data:String(e)},id:null})),null==(o=this.onerror)||o.call(this,e)}}async handleDeleteRequest(e,t){var r;this.validateSession(e,t)&&this.validateProtocolVersion(e,t)&&(await Promise.resolve(null==(r=this._onsessionclosed)?void 0:r.call(this,this.sessionId)),await this.close(),t.writeHead(200).end())}validateSession(e,t){if(void 0===this.sessionIdGenerator)return!0;if(!this._initialized)return t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Server not initialized"},id:null})),!1;let r=e.headers["mcp-session-id"];return r?Array.isArray(r)?(t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header must be a single value"},id:null})),!1):r===this.sessionId||(t.writeHead(404).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32001,message:"Session not found"},id:null})),!1):(t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: Mcp-Session-Id header is required"},id:null})),!1)}validateProtocolVersion(e,t){var r;let s=null!=(r=e.headers["mcp-protocol-version"])?r:"2025-03-26";return Array.isArray(s)&&(s=s[s.length-1]),!!tq.includes(s)||(t.writeHead(400).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:`Bad Request: Unsupported protocol version (supported versions: ${tq.join(", ")})`},id:null})),!1)}async close(){var e;this._streamMapping.forEach(e=>{e.end()}),this._streamMapping.clear(),this._requestResponseMap.clear(),null==(e=this.onclose)||e.call(this)}async send(e,t){let r=null==t?void 0:t.relatedRequestId;if((t9(e)||t7(e))&&(r=e.id),void 0===r){let t;if(t9(e)||t7(e))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let r=this._streamMapping.get(this._standaloneSseStreamId);if(void 0===r)return;this._eventStore&&(t=await this._eventStore.storeEvent(this._standaloneSseStreamId,e)),this.writeSSEEvent(r,e,t);return}let s=this._requestToStreamMapping.get(r),n=this._streamMapping.get(s);if(!s)throw Error(`No connection established for request ID: ${String(r)}`);if(!this._enableJsonResponse){let t;this._eventStore&&(t=await this._eventStore.storeEvent(s,e)),n&&this.writeSSEEvent(n,e,t)}if(t9(e)||t7(e)){this._requestResponseMap.set(r,e);let t=Array.from(this._requestToStreamMapping.entries()).filter(([e,t])=>this._streamMapping.get(t)===n).map(([e])=>e);if(t.every(e=>this._requestResponseMap.has(e))){if(!n)throw Error(`No connection established for request ID: ${String(r)}`);if(this._enableJsonResponse){let e={"Content-Type":"application/json"};void 0!==this.sessionId&&(e["mcp-session-id"]=this.sessionId);let r=t.map(e=>this._requestResponseMap.get(e));n.writeHead(200,e),1===r.length?n.end(JSON.stringify(r[0])):n.end(JSON.stringify(r))}else n.end();for(let e of t)this._requestResponseMap.delete(e),this._requestToStreamMapping.delete(e)}}}}var s0=e.i(49719),s1=e.i(10430),s4=e.i(27699);class s2 extends Error{constructor(e,t){super(e),this.errorUri=t,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class s8 extends s2{}s8.errorCode="invalid_request";class s6 extends s2{}s6.errorCode="invalid_client";class s5 extends s2{}s5.errorCode="invalid_grant";class s9 extends s2{}s9.errorCode="unauthorized_client";class s3 extends s2{}s3.errorCode="unsupported_grant_type";class s7 extends s2{}s7.errorCode="invalid_scope";class ne extends s2{}ne.errorCode="access_denied";class nt extends s2{}nt.errorCode="server_error";class nr extends s2{}nr.errorCode="temporarily_unavailable";class ns extends s2{}ns.errorCode="unsupported_response_type";class nn extends s2{}nn.errorCode="unsupported_token_type";class ni extends s2{}ni.errorCode="invalid_token";class na extends s2{}na.errorCode="method_not_allowed";class no extends s2{}no.errorCode="too_many_requests";class nu extends s2{}nu.errorCode="invalid_client_metadata";class nl extends s2{}nl.errorCode="insufficient_scope",s8.errorCode,s6.errorCode,s5.errorCode,s9.errorCode,s3.errorCode,s7.errorCode,ne.errorCode,nt.errorCode,nr.errorCode,ns.errorCode,nn.errorCode,ni.errorCode,na.errorCode,no.errorCode,nu.errorCode,nl.errorCode;var nc=class extends sZ.ServerResponse{constructor(e,t,r){super(e),this.onEvent=t,this.sessionId=r,this.requestId=crypto.randomUUID(),this.startTime=Date.now()}emitEvent(e){var t;this.onEvent&&this.onEvent((t=Y(F({},e),{sessionId:this.sessionId,requestId:this.requestId}),Y(F({},t),{timestamp:Date.now()})))}startSession(e,t){this.emitEvent({type:"SESSION_STARTED",transport:e,clientInfo:t})}endSession(e){this.emitEvent({type:"SESSION_ENDED",transport:e})}requestReceived(e,t){this.emitEvent({type:"REQUEST_RECEIVED",method:e,parameters:t,status:"success"})}requestCompleted(e,t,r){this.emitEvent({type:"REQUEST_COMPLETED",method:e,result:t,duration:Date.now()-this.startTime,status:r?"error":"success"}),r&&this.error(r,`Error executing request ${e}`,"request")}error(e,t,r="system",s="error"){this.emitEvent({type:"ERROR",error:e,context:t,source:r,severity:s})}end(e,t,r){let s=e,n=t,i=r;return"function"==typeof e?(i=e,s=void 0,n=void 0):"function"==typeof t&&(i=t,n=void 0),super.end(s,n,i)}},nd=new s1.AsyncLocalStorage,nf=new WeakMap,nh=null;function nm(e){return k(this,arguments,function*({redisUrl:e,logger:t}){if(c&&l)return{redis:c,redisPublisher:l};if(!e)throw Error("redisUrl is required");return c=(0,sz.createClient)({url:e}),l=(0,sz.createClient)({url:e}),c.on("error",e=>{t.error("Redis error",e)}),l.on("error",e=>{t.error("Redis error",e)}),yield Promise.all([c.connect(),l.connect()]),{redis:c,redisPublisher:l}})}function np(e={}){let{method:t="GET",url:r="/",headers:s={},body:n=null,socket:i=new sW.Socket}=e,a=new sJ.Readable;if(a._read=()=>{},n){if("string"==typeof n)a.push(n);else if(Buffer.isBuffer(n))a.push(n);else{let e=JSON.stringify(n);a.push(e)}a.push(null)}else a.push(null);let o=new sZ.IncomingMessage(i);o.method=t,o.url=r,o.headers=s;let u=e.auth||nd.getStore();return u&&(o.auth=u),o.push=a.push.bind(a),o.read=a.read.bind(a),o.on=a.on.bind(a),o.pipe=a.pipe.bind(a),o}e.i(66212),e.i(17953),e.i(60238);var n_=e.i(6281);e.i(3441),n_.default;var tG=tG;let ng=function(e,t,r){let s=function(e,t={},r={redisUrl:process.env.REDIS_URL||process.env.KV_URL,streamableHttpEndpoint:"/mcp",sseEndpoint:"/sse",sseMessageEndpoint:"/message",basePath:"",maxDuration:60,verboseLogs:!1,disableSse:!1}){let s,{redisUrl:n,basePath:i,streamableHttpEndpoint:a,sseEndpoint:o,sseMessageEndpoint:u,maxDuration:l,verboseLogs:c,disableSse:d}=r,{serverInfo:f={name:"mcp-typescript server on vercel",version:"0.1.0"}}=t,h=((e,t)=>{var r={};for(var s in e)x.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&L)for(var s of L(e))0>t.indexOf(s)&&M.call(e,s)&&(r[s]=e[s]);return r})(t,["serverInfo"]),{streamableHttpEndpoint:m,sseEndpoint:p,sseMessageEndpoint:_}=function({basePath:e,streamableHttpEndpoint:t="/mcp",sseEndpoint:r="/sse",sseMessageEndpoint:s="/message"}){let{streamableHttpEndpoint:n,sseEndpoint:i,sseMessageEndpoint:a}=null!=e?function(e){let t=e.replace(/\/$/,"");return{streamableHttpEndpoint:`${t}/mcp`,sseEndpoint:`${t}/sse`,sseMessageEndpoint:`${t}/message`}}(e):{streamableHttpEndpoint:t,sseEndpoint:r,sseMessageEndpoint:s};return{streamableHttpEndpoint:n,sseEndpoint:i,sseMessageEndpoint:a}}({basePath:i,streamableHttpEndpoint:a,sseEndpoint:o,sseMessageEndpoint:u}),g=function(e=!1){return{log:(...t)=>{e&&console.log(...t)},error:(...t)=>{e&&console.error(...t)},warn:(...t)=>{e&&console.warn(...t)},info:(...t)=>{e&&console.info(...t)},debug:(...t)=>{e&&console.debug(...t)}}}(c),v=[],y=new sQ({sessionIdGenerator:void 0});return nh||(nh=setInterval(()=>{let e=Date.now();v=v.filter(t=>{var r;let s=nf.get(t);if(!s){g.log("Removing orphaned server without metadata");try{(null==t?void 0:t.server)&&t.server.close()}catch(e){g.error("Error closing orphaned server:",e)}return!1}let n=e-s.createdAt.getTime();if(n>3e5){g.log(`Removing stale server (session ${s.sessionId}, age: ${n}ms)`);try{(null==t?void 0:t.server)&&t.server.close(),(null==(r=s.transport)?void 0:r.close)&&s.transport.close()}catch(e){g.error("Error closing stale server:",e)}return nf.delete(t),!1}return!0})},3e4)),function(i,a){return k(this,null,function*(){var o,u,c;let E=new URL(i.url||"","https://example.com");if(E.pathname===m){if("GET"===i.method){g.log("Received GET MCP request"),a.writeHead(405).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}));return}if("DELETE"===i.method){g.log("Received DELETE MCP request"),a.writeHead(405).end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}));return}if("POST"===i.method){let t,n=new nc(np(),r.onEvent);s||(s=new sY(f,h),yield e(s),yield s.connect(y)),t=(i.headers.get("content-type")||"").includes("application/json")?yield i.json():yield i.text();let o=np({method:i.method,url:i.url,headers:Object.fromEntries(i.headers),body:t,auth:i.auth}),u=new nc(o,r.onEvent);Object.assign(u,a);try{yield y.handleRequest(o,u),"object"==typeof t&&t&&"method"in t&&n.requestCompleted(t.method,t)}catch(e){throw"object"==typeof t&&t&&"method"in t&&n.requestCompleted(t.method,void 0,e instanceof Error?e:String(e)),e}}}else if(E.pathname===p){if(d){a.statusCode=404,a.end("Not found");return}if("GET"!==i.method){g.log(`Rejected SSE connection with method ${i.method}`),a.writeHead(405,{"Content-Type":"text/plain"}).end("Method Not Allowed");return}let s=i.headers.get("accept")||i.headers.get("Accept");if(s&&!s.includes("text/event-stream")&&!s.includes("*/*")&&!s.includes("text/*")){g.log(`Rejected SSE connection with incompatible Accept header: ${s}`),a.writeHead(406,{"Content-Type":"text/plain"}).end("Not Acceptable");return}let{redis:h,redisPublisher:m}=yield nm({redisUrl:n,logger:g});g.log("Got new SSE connection"),(0,s0.default)(_,"sseMessageEndpoint is required");let p=new sV(_,a),y=p.sessionId,E=new nc(np(),r.onEvent,y);E.startSession("SSE",{userAgent:null!=(o=i.headers.get("user-agent"))?o:void 0,ip:null!=(c=null!=(u=i.headers.get("x-forwarded-for"))?u:i.headers.get("x-real-ip"))?c:void 0});let b=new sY(f,t),S=!1,R=null,I=null,A=null,T=null,O=[],N=e=>k(this,null,function*(){if(!S){if(S=!0,g.log(`Cleaning up SSE connection: ${e}`),I&&(clearTimeout(I),I=null),R&&(clearInterval(R),R=null),A&&(i.signal.removeEventListener("abort",A),A=null),T)try{yield h.unsubscribe(`requests:${y}`,T),g.log(`Unsubscribed from requests:${y}`)}catch(e){g.error("Error unsubscribing from Redis:",e)}try{(null==b?void 0:b.server)&&(yield b.server.close()),(null==p?void 0:p.close)&&(yield p.close())}catch(e){g.error("Error closing server/transport:",e)}v=v.filter(e=>e!==b),nf.delete(b),E.endSession("SSE"),O=[],a.headersSent||(a.statusCode=200,a.end())}});try{let t,s=function(e,...t){O.push({type:e,messages:t})};yield e(b),v.push(b),nf.set(b,{sessionId:y,createdAt:new Date,transport:p}),b.server.onclose=()=>{N("server closed")},T=e=>k(this,null,function*(){g.log("Received message from Redis",e),s("log","Received message from Redis",e);let t=JSON.parse(e),n=np({method:t.method,url:t.url,headers:t.headers,body:t.body}),i=new nc(n,r.onEvent,y),a=100,o="";i.writeHead=e=>(a=e,i),i.end=e=>(o=e,i);try{if(yield p.handlePostMessage(n,i),"object"==typeof t.body&&t.body&&"method"in t.body)try{let e=JSON.parse(o);E.requestCompleted(t.body.method,e)}catch(e){E.requestCompleted(t.body.method,o)}}catch(e){throw E.error(e instanceof Error?e:String(e),"Error handling SSE message","session"),e}yield m.publish(`responses:${y}:${t.requestId}`,JSON.stringify({status:a,body:o})),a>=200&&a<300?s("log",`Request ${y}:${t.requestId} succeeded: ${o}`):(s("error",`Message for ${y}:${t.requestId} failed with status ${a}: ${o}`),E.error(`Request failed with status ${a}`,o,"session"))}),R=setInterval(()=>{for(let e of O)g[e.type](...e.messages);O=[]},100),yield h.subscribe(`requests:${y}`,T),g.log(`Subscribed to requests:${y}`);let n=new Promise(e=>{t=e,I=setTimeout(()=>{e("max duration reached")},(null!=l?l:60)*1e3)});A=()=>t("client hang up"),i.signal.addEventListener("abort",A),a.on("close",()=>{N("response closed")}),a.on("error",e=>{g.error("Response error:",e),N("response error")}),yield b.connect(p);let o=yield n;g.log(o),yield N(String(o))}catch(e){throw g.error("Error in SSE handler:",e),yield N("error during setup"),e}}else if(E.pathname===_){let e;if(d){a.statusCode=404,a.end("Not found");return}let{redis:t,redisPublisher:r}=yield nm({redisUrl:n,logger:g});g.log("Received message");let s=yield i.text();try{e=JSON.parse(s)}catch(t){e=s}let o=E.searchParams.get("sessionId")||"";if(!o){a.statusCode=400,a.end("No sessionId provided");return}let u=crypto.randomUUID(),l={requestId:u,url:i.url||"",method:i.method||"",body:e,headers:Object.fromEntries(i.headers.entries())},c=null,f=!1,h=!1,m=()=>k(this,null,function*(){if(!h){h=!0,c&&(clearTimeout(c),c=null);try{yield t.unsubscribe(`responses:${o}:${u}`)}catch(e){g.error("Error unsubscribing from Redis response channel:",e)}}}),p=(e,t)=>k(this,null,function*(){f||(f=!0,a.statusCode=e,a.end(t),yield m())}),_=e=>k(this,null,function*(){try{let t=JSON.parse(e);yield p(t.status,t.body)}catch(e){g.error("Failed to parse response message:",e),yield p(500,"Internal server error")}});try{yield t.subscribe(`responses:${o}:${u}`,_),yield r.publish(`requests:${o}`,JSON.stringify(l)),g.log(`Published requests:${o}`,l),c=setTimeout(()=>k(this,null,function*(){yield p(408,"Request timed out")}),1e4),a.on("close",()=>k(this,null,function*(){f||(f=!0,yield m())})),a.on("error",e=>k(this,null,function*(){g.error("Response error in message handler:",e),f||(f=!0,yield m())}))}catch(e){g.error("Error in message handler:",e),yield m(),f||(a.statusCode=500,a.end("Internal server error"))}}else a.statusCode=404,a.end("Not found")})}}(e,t,r);return e=>(function(e,t){let r,s=new Promise(e=>{r=e});return new Promise(n=>{let i,a,o=!1,u=!1,l=200,c=(e,t)=>{if("string"==typeof t)throw Error("Status message of writeHead not supported");return u=!0,r({statusCode:l=e,headers:a=t}),m},d=[],f=(e,t)=>{if(t)throw Error("Encoding not supported");if(e instanceof Buffer)throw Error("Buffer not supported");return(u||c(l,a),i)?i.enqueue(new TextEncoder().encode(e)):d.push(new TextEncoder().encode(e)),!0},h=new s4.EventEmitter,m={writeHead:c,write:f,end:e=>{if(e&&f(e),!i)return o=!0,m;try{i.close()}catch(e){}return m},on:(e,t)=>(h.on(e,t),m),get statusCode(){return l},set statusCode(code){l=code,u&&r({statusCode:l,headers:a})}};e.addEventListener("abort",()=>{h.emit("close")}),t(m),k(this,null,function*(){let e=yield s;n(new Response(new ReadableStream({start(e){for(let t of(i=e,d))i.enqueue(t);o&&i.close()}}),{status:e.statusCode,headers:e.headers}))})})})(e.signal,t=>{s(e,t)})}(e=>{e.tool("get_current_timestamp","Get the current timestamp in ISO format - use this to mark points in time before/after user testing. WORKFLOW: Always capture timestamp before asking user to test changes, then capture again after they return, then use get_logs_between_timestamps to analyze what happened during testing.",{},async()=>{let e=new Date().toISOString();return{content:[{type:"text",text:`Current timestamp: ${e}`}]}}),e.tool("healthcheck","Internal healthcheck tool - rarely needed since MCP connection is already working if you can see this. Only use if explicitly asked to verify server health. Prefer read_consolidated_logs for debugging.",{message:tG.string().optional().describe("Optional message to echo back")},async({message:e="MCP server is healthy!"})=>({content:[{type:"text",text:`✅ ${e} - Timestamp: ${new Date().toISOString()}`}]})),e.tool("read_consolidated_logs","Read recent consolidated development logs containing server output, browser console logs, network requests, user interactions, and screenshots. INSIGHTS: Use this for general log overview, recent error checking, or when you need to understand current application state. Logs include [PLAYWRIGHT] or [CHROME_EXTENSION] tags to distinguish monitoring sources. Filter by keywords like 'ERROR', 'NETWORK', 'INTERACTION', or 'SCREENSHOT' for focused analysis. Combine with search_logs for pattern-based analysis.",{lines:tG.number().optional().describe("Number of recent lines to read (default: 50)"),filter:tG.string().optional().describe("Filter logs by text content"),logPath:tG.string().optional().describe("Path to log file (default: ./ai-dev-tools/consolidated.log)")},async({lines:e=50,filter:t,logPath:r=process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log"})=>{try{if(!(0,P.existsSync)(r))return{content:[{type:"text",text:`No log file found at ${r}. Make sure the dev environment is running.`}]};let s=(0,P.readFileSync)(r,"utf-8").split("\n").filter(e=>e.trim());t&&(s=s.filter(e=>e.toLowerCase().includes(t.toLowerCase())));let n=s.slice(-e);return{content:[{type:"text",text:n.length>0?n.join("\n"):"No matching log entries found."}]}}catch(e){return{content:[{type:"text",text:`Error reading logs: ${e instanceof Error?e.message:String(e)}`}]}}}),e.tool("search_logs","Search through consolidated logs using regex patterns with context lines around matches. POWERFUL DEBUGGING: Essential for tracing error patterns, finding specific API calls, or tracking user interaction sequences. Use patterns like 'ERROR.*fetch', 'CLICK.*button', or 'NETWORK.*POST' to find relevant events. Context lines help understand what led to and followed each match. Great for correlating server errors with user actions.",{pattern:tG.string().describe("Regex pattern to search for"),context:tG.number().optional().describe("Number of lines of context around matches (default: 2)"),logPath:tG.string().optional().describe("Path to log file (default: ./ai-dev-tools/consolidated.log)")},async({pattern:e,context:t=2,logPath:r=process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log"})=>{try{if(!(0,P.existsSync)(r))return{content:[{type:"text",text:`No log file found at ${r}.`}]};let s=(0,P.readFileSync)(r,"utf-8").split("\n"),n=RegExp(e,"gi"),i=[];return s.forEach((e,r)=>{if(n.test(e)){let e=Math.max(0,r-t),n=Math.min(s.length,r+t+1),a=s.slice(e,n);i.push(`Match at line ${r+1}:
|
|
17
17
|
${a.join("\n")}
|
|
18
18
|
---`)}}),{content:[{type:"text",text:i.length>0?i.join("\n\n"):"No matches found for the given pattern."}]}}catch(e){return{content:[{type:"text",text:`Error searching logs: ${e instanceof Error?e.message:String(e)}`}]}}}),e.tool("get_logs_between_timestamps","Get logs between two specific timestamps - CRITICAL for timestamp-based debugging workflow. WORKFLOW: (1) Use get_current_timestamp before user testing, (2) Ask user to reproduce issue/test changes, (3) Use get_current_timestamp after user returns, (4) Use this tool with both timestamps to see exactly what happened during testing. This eliminates noise and focuses analysis on the specific user session. Essential for correlating user actions with server/browser events.",{startTime:tG.string().describe("Start timestamp (ISO 8601 format: 2024-01-01T12:00:00.000Z)"),endTime:tG.string().describe("End timestamp (ISO 8601 format: 2024-01-01T12:30:00.000Z)"),filter:tG.string().optional().describe("Filter logs by text content (case insensitive)"),logPath:tG.string().optional().describe("Path to log file (default: ./ai-dev-tools/consolidated.log)")},async({startTime:e,endTime:t,filter:r,logPath:s=process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log"})=>{try{if(!(0,P.existsSync)(s))return{content:[{type:"text",text:`No log file found at ${s}.`}]};let n=new Date(e),i=new Date(t);if(Number.isNaN(n.getTime())||Number.isNaN(i.getTime()))return{content:[{type:"text",text:"Invalid timestamp format. Use ISO 8601 format: 2024-01-01T12:00:00.000Z"}]};if(n>=i)return{content:[{type:"text",text:"Start time must be before end time."}]};let a=(0,P.readFileSync)(s,"utf-8").split("\n").filter(e=>e.trim()).filter(e=>{let t=e.match(/\[(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\]/);if(t){let e=new Date(t[1]);return e>=n&&e<=i}return!1}),o=a;r&&(o=a.filter(e=>e.toLowerCase().includes(r.toLowerCase())));let u=`${n.toISOString()} to ${i.toISOString()}`,l=`Found ${o.length} logs between ${u}${r?` matching "${r}"`:""}`;return{content:[{type:"text",text:o.length>0?`${l}:
|
|
19
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--mApgFwHCnTXuGrVRNheFT--><html lang="en" class="h-full dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/dc9d08d2b5468dd7.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/941b6c341513efe6.js"/><script src="/_next/static/chunks/605beb21d5c11807.js" async=""></script><script src="/_next/static/chunks/14ca28aed9ba7e16.js" async=""></script><script src="/_next/static/chunks/3df53cad6e742c25.js" async=""></script><script src="/_next/static/chunks/turbopack-66b02875bc8e5dbd.js" async=""></script><script src="/_next/static/chunks/044e917a180dc576.js" async=""></script><script src="/_next/static/chunks/1415a83da347ea73.js" async=""></script><meta name="robots" content="noindex"/><title>🎯 dev3000</title><link rel="icon" href="/favicon.ico" sizes="32x32"/><link rel="icon" href="/favicon.svg" type="image/svg+xml"/><link rel="icon" href="/favicon-16.svg" type="image/svg+xml" sizes="16x16"/><link rel="apple-touch-icon" href="/favicon-180.png"/><meta name="theme-color" content="#1f2937"/><title>404: This page could not be found.</title><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="h-full"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/941b6c341513efe6.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[79442,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n3:I[91868,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n4:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"OutletBoundary\"]\n6:I[72445,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"AsyncMetadataOutlet\"]\n8:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"ViewportBoundary\"]\na:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[57588,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n:HL[\"/_next/static/chunks/dc9d08d2b5468dd7.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"mApgFwHCnTXuGrVRNheFT\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/dc9d08d2b5468dd7.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/044e917a180dc576.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/1415a83da347ea73.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"h-full dark\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"🎯 dev3000\"}],[\"$\",\"link\",null,{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"sizes\":\"32x32\"}],[\"$\",\"link\",null,{\"rel\":\"icon\",\"href\":\"/favicon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",null,{\"rel\":\"icon\",\"href\":\"/favicon-16.svg\",\"type\":\"image/svg+xml\",\"sizes\":\"16x16\"}],[\"$\",\"link\",null,{\"rel\":\"apple-touch-icon\",\"href\":\"/favicon-180.png\"}],[\"$\",\"meta\",null,{\"name\":\"theme-color\",\"content\":\"#1f2937\"}]]}],[\"$\",\"body\",null,{\"className\":\"h-full\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:1:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$L5\",[\"$\",\"$L6\",null,{\"promise\":\"$@7\"}]]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],null],[\"$\",\"$La\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$b\",null,{\"fallback\":null,\"children\":\"$Lc\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",\"$undefined\"],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n5:null\n"])</script><script>self.__next_f.push([1,"7:{\"metadata\":[],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"c:\"$7:metadata\"\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/941b6c341513efe6.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[79442,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n3:I[91868,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n4:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"OutletBoundary\"]\n6:I[72445,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"AsyncMetadataOutlet\"]\n8:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"ViewportBoundary\"]\na:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[57588,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--mApgFwHCnTXuGrVRNheFT--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/941b6c341513efe6.js"/><script src="/_next/static/chunks/605beb21d5c11807.js" async=""></script><script src="/_next/static/chunks/14ca28aed9ba7e16.js" async=""></script><script src="/_next/static/chunks/3df53cad6e742c25.js" async=""></script><script src="/_next/static/chunks/turbopack-66b02875bc8e5dbd.js" async=""></script><script src="/_next/static/chunks/044e917a180dc576.js" async=""></script><script src="/_next/static/chunks/1415a83da347ea73.js" async=""></script><title>500: Internal Server Error.</title><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/941b6c341513efe6.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[79442,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n3:I[91868,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n4:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"OutletBoundary\"]\n6:I[72445,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"AsyncMetadataOutlet\"]\n8:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"ViewportBoundary\"]\na:I[33058,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[57588,[\"/_next/static/chunks/044e917a180dc576.js\",\"/_next/static/chunks/1415a83da347ea73.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"mApgFwHCnTXuGrVRNheFT\",\"c\":[\"\",\"_global-error\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/044e917a180dc576.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/1415a83da347ea73.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L4\",null,{\"children\":[\"$L5\",[\"$\",\"$L6\",null,{\"promise\":\"$@7\"}]]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],null],[\"$\",\"$La\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$b\",null,{\"fallback\":null,\"children\":\"$Lc\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",\"$undefined\"],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n5:null\n"])</script><script>self.__next_f.push([1,"7:{\"metadata\":[],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"c:\"$7:metadata\"\n"])</script></body></html>
|
|
@@ -26,7 +26,7 @@ const handler = createMcpHandler(
|
|
|
26
26
|
// Healthcheck tool
|
|
27
27
|
server.tool(
|
|
28
28
|
"healthcheck",
|
|
29
|
-
"
|
|
29
|
+
"Internal healthcheck tool - rarely needed since MCP connection is already working if you can see this. Only use if explicitly asked to verify server health. Prefer read_consolidated_logs for debugging.",
|
|
30
30
|
{
|
|
31
31
|
message: z.string().optional().describe("Optional message to echo back")
|
|
32
32
|
},
|
package/mcp-server/.next/trace
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"generate-buildid","duration":
|
|
1
|
+
[{"name":"generate-buildid","duration":72,"timestamp":512161035644,"id":4,"parentId":1,"tags":{},"startTime":1757647931511,"traceId":"5e9c0644a4516d3e"},{"name":"load-custom-routes","duration":104,"timestamp":512161035746,"id":5,"parentId":1,"tags":{},"startTime":1757647931511,"traceId":"5e9c0644a4516d3e"},{"name":"create-dist-dir","duration":420,"timestamp":512161053702,"id":6,"parentId":1,"tags":{},"startTime":1757647931529,"traceId":"5e9c0644a4516d3e"},{"name":"create-pages-mapping","duration":82,"timestamp":512161151065,"id":7,"parentId":1,"tags":{},"startTime":1757647931626,"traceId":"5e9c0644a4516d3e"},{"name":"collect-app-files","duration":1301,"timestamp":512161151167,"id":8,"parentId":1,"tags":{},"startTime":1757647931626,"traceId":"5e9c0644a4516d3e"},{"name":"create-app-mapping","duration":729,"timestamp":512161152482,"id":9,"parentId":1,"tags":{},"startTime":1757647931628,"traceId":"5e9c0644a4516d3e"},{"name":"create-app-layouts","duration":51,"timestamp":512161153223,"id":10,"parentId":1,"tags":{},"startTime":1757647931628,"traceId":"5e9c0644a4516d3e"},{"name":"collect-default-files","duration":420,"timestamp":512161153717,"id":12,"parentId":1,"tags":{},"startTime":1757647931629,"traceId":"5e9c0644a4516d3e"},{"name":"generate-route-types","duration":7889,"timestamp":512161153423,"id":11,"parentId":1,"tags":{},"startTime":1757647931628,"traceId":"5e9c0644a4516d3e"},{"name":"public-dir-conflict-check","duration":30,"timestamp":512161161377,"id":13,"parentId":1,"tags":{},"startTime":1757647931636,"traceId":"5e9c0644a4516d3e"},{"name":"generate-routes-manifest","duration":735,"timestamp":512161161438,"id":14,"parentId":1,"tags":{},"startTime":1757647931636,"traceId":"5e9c0644a4516d3e"},{"name":"run-turbopack-compiler","duration":2522279,"timestamp":512161163968,"id":16,"parentId":1,"tags":{},"startTime":1757647931639,"traceId":"5e9c0644a4516d3e"},{"name":"verify-typescript-setup","duration":1215695,"timestamp":512163696029,"id":18,"parentId":1,"tags":{},"startTime":1757647934171,"traceId":"5e9c0644a4516d3e"},{"name":"check-static-error-page","duration":1113,"timestamp":512164920275,"id":21,"parentId":20,"tags":{},"startTime":1757647935395,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":164774,"timestamp":512164934886,"id":40,"parentId":29,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":168205,"timestamp":512164931637,"id":29,"parentId":20,"tags":{"page":"/api/logs/rotate"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":170244,"timestamp":512164935131,"id":44,"parentId":33,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":173744,"timestamp":512164931672,"id":33,"parentId":20,"tags":{"page":"/api/replay"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":172318,"timestamp":512164936282,"id":48,"parentId":23,"tags":{},"startTime":1757647935411,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":177158,"timestamp":512164931501,"id":23,"parentId":20,"tags":{"page":"/_global-error"},"startTime":1757647935406,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":178149,"timestamp":512164934810,"id":38,"parentId":27,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":181355,"timestamp":512164931625,"id":27,"parentId":20,"tags":{"page":"/api/logs/head"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":178778,"timestamp":512164934943,"id":42,"parentId":31,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":182088,"timestamp":512164931653,"id":31,"parentId":20,"tags":{"page":"/api/logs/tail"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":178275,"timestamp":512164935962,"id":47,"parentId":24,"tags":{},"startTime":1757647935411,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":182660,"timestamp":512164931592,"id":24,"parentId":20,"tags":{"page":"/api/config"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":183936,"timestamp":512164937517,"id":51,"parentId":36,"tags":{},"startTime":1757647935413,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":189763,"timestamp":512164931755,"id":36,"parentId":20,"tags":{"page":"/replay"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":189210,"timestamp":512164934916,"id":41,"parentId":30,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":192534,"timestamp":512164931643,"id":30,"parentId":20,"tags":{"page":"/api/logs/stream"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":187016,"timestamp":512164937277,"id":50,"parentId":34,"tags":{},"startTime":1757647935412,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":192635,"timestamp":512164931678,"id":34,"parentId":20,"tags":{"page":"/logs"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":187491,"timestamp":512164937179,"id":49,"parentId":35,"tags":{},"startTime":1757647935412,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":192992,"timestamp":512164931695,"id":35,"parentId":20,"tags":{"page":"/"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":192457,"timestamp":512164934854,"id":39,"parentId":28,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":195695,"timestamp":512164931631,"id":28,"parentId":20,"tags":{"page":"/api/logs/list"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":192786,"timestamp":512164935757,"id":45,"parentId":26,"tags":{},"startTime":1757647935411,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":196934,"timestamp":512164931618,"id":26,"parentId":20,"tags":{"page":"/api/logs/append"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":194586,"timestamp":512164934628,"id":37,"parentId":25,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":197614,"timestamp":512164931610,"id":25,"parentId":20,"tags":{"page":"/api/health"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":199817,"timestamp":512164935822,"id":46,"parentId":22,"tags":{},"startTime":1757647935411,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":204554,"timestamp":512164931108,"id":22,"parentId":20,"tags":{"page":"/_not-found"},"startTime":1757647935406,"traceId":"5e9c0644a4516d3e"},{"name":"is-page-static","duration":230471,"timestamp":512164935032,"id":43,"parentId":32,"tags":{},"startTime":1757647935410,"traceId":"5e9c0644a4516d3e"},{"name":"check-page","duration":233866,"timestamp":512164931665,"id":32,"parentId":20,"tags":{"page":"/api/mcp/[transport]"},"startTime":1757647935407,"traceId":"5e9c0644a4516d3e"},{"name":"static-check","duration":245546,"timestamp":512164919998,"id":20,"parentId":1,"tags":{},"startTime":1757647935395,"traceId":"5e9c0644a4516d3e"},{"name":"generate-required-server-files","duration":184,"timestamp":512165165749,"id":53,"parentId":1,"tags":{},"startTime":1757647935641,"traceId":"5e9c0644a4516d3e"},{"name":"write-routes-manifest","duration":224,"timestamp":512165166724,"id":54,"parentId":1,"tags":{},"startTime":1757647935642,"traceId":"5e9c0644a4516d3e"},{"name":"load-dotenv","duration":12,"timestamp":512165172089,"id":57,"parentId":56,"tags":{},"startTime":1757647935647,"traceId":"5e9c0644a4516d3e"},{"name":"run-export-path-map","duration":169,"timestamp":512165173654,"id":58,"parentId":56,"tags":{},"startTime":1757647935649,"traceId":"5e9c0644a4516d3e"},{"name":"next-export","duration":209428,"timestamp":512165171618,"id":56,"parentId":1,"tags":{},"startTime":1757647935647,"traceId":"5e9c0644a4516d3e"},{"name":"move-exported-app-not-found-","duration":330,"timestamp":512165381632,"id":59,"parentId":55,"tags":{},"startTime":1757647935857,"traceId":"5e9c0644a4516d3e"},{"name":"move-exported-app-global-error-","duration":203,"timestamp":512165381992,"id":60,"parentId":55,"tags":{},"startTime":1757647935857,"traceId":"5e9c0644a4516d3e"},{"name":"static-generation","duration":214207,"timestamp":512165168580,"id":55,"parentId":1,"tags":{},"startTime":1757647935644,"traceId":"5e9c0644a4516d3e"},{"name":"write-routes-manifest","duration":194,"timestamp":512165382823,"id":61,"parentId":1,"tags":{},"startTime":1757647935858,"traceId":"5e9c0644a4516d3e"},{"name":"write-standalone-directory","duration":168605,"timestamp":512165389752,"id":62,"parentId":1,"tags":{},"startTime":1757647935865,"traceId":"5e9c0644a4516d3e"},{"name":"print-tree-view","duration":1380,"timestamp":512165558537,"id":63,"parentId":1,"tags":{},"startTime":1757647936034,"traceId":"5e9c0644a4516d3e"},{"name":"telemetry-flush","duration":15,"timestamp":512165559922,"id":64,"parentId":1,"tags":{},"startTime":1757647936035,"traceId":"5e9c0644a4516d3e"},{"name":"next-build","duration":4642354,"timestamp":512160917586,"id":1,"tags":{"buildMode":"default","isTurboBuild":"true","version":"15.5.1-canary.30","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1757647931393,"traceId":"5e9c0644a4516d3e"}]
|
|
@@ -26,7 +26,7 @@ const handler = createMcpHandler(
|
|
|
26
26
|
// Healthcheck tool
|
|
27
27
|
server.tool(
|
|
28
28
|
"healthcheck",
|
|
29
|
-
"
|
|
29
|
+
"Internal healthcheck tool - rarely needed since MCP connection is already working if you can see this. Only use if explicitly asked to verify server health. Prefer read_consolidated_logs for debugging.",
|
|
30
30
|
{
|
|
31
31
|
message: z.string().optional().describe("Optional message to echo back")
|
|
32
32
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev3000",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
4
4
|
"description": "AI-powered development tools with browser monitoring and MCP server integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,12 +25,11 @@
|
|
|
25
25
|
"dev": "tsc --watch",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
27
|
"format": "biome format --write .",
|
|
28
|
-
"lint": "biome check
|
|
29
|
-
"lint:fix": "biome check --write
|
|
28
|
+
"lint": "biome check src mcp-server www scripts",
|
|
29
|
+
"lint:fix": "biome check --write src mcp-server www scripts",
|
|
30
30
|
"test": "vitest run",
|
|
31
31
|
"test-postinstall": "tsx scripts/test-postinstall.ts",
|
|
32
32
|
"prepare": "husky",
|
|
33
|
-
"postinstall": "echo 'Starting postinstall...' && cd mcp-server && echo 'Installing mcp-server dependencies...' && timeout 30s pnpm install --no-frozen-lockfile --ignore-scripts && echo 'Postinstall completed successfully!' || echo 'Postinstall failed or timed out, but continuing...'",
|
|
34
33
|
"release": "./scripts/release.sh",
|
|
35
34
|
"canary": "./scripts/canary.sh"
|
|
36
35
|
},
|
/package/mcp-server/.next/static/{N6OEtGstY3aUCE305hVvb → mApgFwHCnTXuGrVRNheFT}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/mcp-server/.next/static/{N6OEtGstY3aUCE305hVvb → mApgFwHCnTXuGrVRNheFT}/_ssgManifest.js
RENAMED
|
File without changes
|