vibedoc 1.2.1 → 1.3.0
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/(app)/activity/page.js +1 -1
- package/.next/server/app/(app)/activity/page.js.nft.json +1 -1
- package/.next/server/app/(app)/board/page.js +1 -1
- package/.next/server/app/(app)/board/page.js.nft.json +1 -1
- package/.next/server/app/(app)/docs/page.js +1 -1
- package/.next/server/app/(app)/docs/page.js.nft.json +1 -1
- package/.next/server/app/(app)/explorer/page.js +1 -1
- package/.next/server/app/(app)/explorer/page.js.nft.json +1 -1
- package/.next/server/app/(app)/memory/page.js +1 -1
- package/.next/server/app/(app)/memory/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/page.js +1 -1
- package/.next/server/app/(app)/settings/page.js.nft.json +1 -1
- package/.next/server/app/(app)/setup/page.js +1 -1
- package/.next/server/app/(app)/setup/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page.js +1 -1
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/activity.html +1 -1
- package/.next/server/app/activity.rsc +1 -1
- package/.next/server/app/activity.segments/!KGFwcCk/activity/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/activity.segments/!KGFwcCk/activity.segment.rsc +1 -1
- package/.next/server/app/activity.segments/!KGFwcCk.segment.rsc +1 -1
- package/.next/server/app/activity.segments/_full.segment.rsc +1 -1
- package/.next/server/app/activity.segments/_head.segment.rsc +1 -1
- package/.next/server/app/activity.segments/_index.segment.rsc +1 -1
- package/.next/server/app/activity.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/activity/route.js.nft.json +1 -1
- package/.next/server/app/api/backlinks/route.js.nft.json +1 -1
- package/.next/server/app/api/context/route.js.nft.json +1 -1
- package/.next/server/app/api/decisions/route.js.nft.json +1 -1
- package/.next/server/app/api/docs/route.js.nft.json +1 -1
- package/.next/server/app/api/explorer/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/server/app/api/registry/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/registry/route/build-manifest.json +11 -0
- package/.next/server/app/api/registry/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/registry/route.js +7 -0
- package/.next/server/app/api/registry/route.js.map +5 -0
- package/.next/server/app/api/registry/route.js.nft.json +1 -0
- package/.next/server/app/api/registry/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/write/route.js.nft.json +1 -1
- package/.next/server/app/api/summary/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/board.html +1 -1
- package/.next/server/app/board.rsc +1 -1
- package/.next/server/app/board.segments/!KGFwcCk/board/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/board.segments/!KGFwcCk/board.segment.rsc +1 -1
- package/.next/server/app/board.segments/!KGFwcCk.segment.rsc +1 -1
- package/.next/server/app/board.segments/_full.segment.rsc +1 -1
- package/.next/server/app/board.segments/_head.segment.rsc +1 -1
- package/.next/server/app/board.segments/_index.segment.rsc +1 -1
- package/.next/server/app/board.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +1 -1
- package/.next/server/app/docs.segments/!KGFwcCk/docs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/docs.segments/!KGFwcCk/docs.segment.rsc +1 -1
- package/.next/server/app/docs.segments/!KGFwcCk.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_full.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/explorer.html +1 -1
- package/.next/server/app/explorer.rsc +1 -1
- package/.next/server/app/explorer.segments/!KGFwcCk/explorer/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/explorer.segments/!KGFwcCk/explorer.segment.rsc +1 -1
- package/.next/server/app/explorer.segments/!KGFwcCk.segment.rsc +1 -1
- package/.next/server/app/explorer.segments/_full.segment.rsc +1 -1
- package/.next/server/app/explorer.segments/_head.segment.rsc +1 -1
- package/.next/server/app/explorer.segments/_index.segment.rsc +1 -1
- package/.next/server/app/explorer.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/memory.html +1 -1
- package/.next/server/app/memory.rsc +1 -1
- package/.next/server/app/memory.segments/!KGFwcCk/memory/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/memory.segments/!KGFwcCk/memory.segment.rsc +1 -1
- package/.next/server/app/memory.segments/!KGFwcCk.segment.rsc +1 -1
- package/.next/server/app/memory.segments/_full.segment.rsc +1 -1
- package/.next/server/app/memory.segments/_head.segment.rsc +1 -1
- package/.next/server/app/memory.segments/_index.segment.rsc +1 -1
- package/.next/server/app/memory.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +1 -1
- package/.next/server/app/settings.segments/!KGFwcCk/settings/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings.segments/!KGFwcCk/settings.segment.rsc +1 -1
- package/.next/server/app/settings.segments/!KGFwcCk.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/setup.html +1 -1
- package/.next/server/app/setup.rsc +1 -1
- package/.next/server/app/setup.segments/!KGFwcCk/setup/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/setup.segments/!KGFwcCk/setup.segment.rsc +1 -1
- package/.next/server/app/setup.segments/!KGFwcCk.segment.rsc +1 -1
- package/.next/server/app/setup.segments/_full.segment.rsc +1 -1
- package/.next/server/app/setup.segments/_head.segment.rsc +1 -1
- package/.next/server/app/setup.segments/_index.segment.rsc +1 -1
- package/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/[root-of-the-server]__73d016a0._.js +7 -7
- package/.next/server/chunks/[root-of-the-server]__73d016a0._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__b4da5bcd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__b4da5bcd._.js.map +1 -0
- package/.next/server/chunks/_75927d0c._.js +11 -10
- package/.next/server/chunks/_75927d0c._.js.map +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_registry_route_actions_9502c56c.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_registry_route_actions_9502c56c.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__599128b8._.js → [root-of-the-server]__575af34a._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__59ae98dc._.js +3 -0
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/bin/vibedoc.js +7 -0
- package/package.json +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__7de63c62._.js +0 -3
- /package/.next/server/chunks/ssr/{[root-of-the-server]__599128b8._.js.map → [root-of-the-server]__575af34a._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__7de63c62._.js.map → [root-of-the-server]__59ae98dc._.js.map} +0 -0
- /package/.next/static/{Cel8IZo91rJRjbRQC_DUd → 0O_zNn9bF-68gq5ePCg2r}/_buildManifest.js +0 -0
- /package/.next/static/{Cel8IZo91rJRjbRQC_DUd → 0O_zNn9bF-68gq5ePCg2r}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{Cel8IZo91rJRjbRQC_DUd → 0O_zNn9bF-68gq5ePCg2r}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},98768,e=>{"use strict";class t{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){this.listeners.forEach(t=>{try{t(e)}catch{}})}}let r=globalThis,a=r.vibedocBus??(r.vibedocBus=new t);function n(e,t){a.emit({type:e,payload:t,ts:new Date().toISOString()})}e.s(["bus",0,a,"emitUpdate",()=>n])},72375,e=>e.a(async(t,r)=>{try{var a=e.i(52544),n=e.i(99501),s=e.i(98768),i=t([n]);async function o(e){try{let t=e.nextUrl.searchParams.get("root")||(0,n.getConfiguredRoot)(),r=await (0,n.readRegistry)(t);return a.NextResponse.json(r)}catch(e){return a.NextResponse.json({error:e.message},{status:500})}}async function l(e){try{let t=e.nextUrl.searchParams.get("root")||(0,n.getConfiguredRoot)(),r=await (0,n.rebuildRegistry)(t,"human");return(0,s.emitUpdate)("registry_rebuilt",{path:r.path,totalFiles:r.totalFiles}),a.NextResponse.json(r)}catch(e){return a.NextResponse.json({error:e.message},{status:500})}}[n]=i.then?(await i)():i,e.s(["GET",()=>o,"POST",()=>l]),r()}catch(e){r(e)}},!1),23387,e=>e.a(async(t,r)=>{try{var a=e.i(93771),n=e.i(97686),s=e.i(75526),i=e.i(58e3),o=e.i(89292),l=e.i(22218),d=e.i(70540),u=e.i(9350),p=e.i(69462),c=e.i(13673),h=e.i(59429),x=e.i(41690),R=e.i(55318),g=e.i(99382),v=e.i(20606),m=e.i(93695);e.i(75436);var f=e.i(39468),y=e.i(72375),w=t([y]);[y]=w.then?(await w)():w;let b=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/registry/route",pathname:"/api/registry",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/registry/route.ts",nextConfigOutput:"",userland:y}),{workAsyncStorage:A,workUnitAsyncStorage:N,serverHooks:P}=b;function E(){return(0,s.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:N})}async function C(e,t,r){b.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/registry/route";a=a.replace(/\/index$/,"")||"/";let s=await b.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:y,params:w,nextConfig:E,parsedUrl:C,isDraftMode:A,prerenderManifest:N,routerServerContext:P,isOnDemandRevalidate:T,revalidateOnlyGenerated:_,resolvedPathname:j,clientReferenceManifest:k,serverActionsManifest:O}=s,S=(0,d.normalizeAppPath)(a),q=!!(N.dynamicRoutes[S]||N.routes[j]),U=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,C,!1):t.end("This page could not be found"),null);if(q&&!A){let e=!!N.routes[j],t=N.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await U();throw new m.NoFallbackError}}let H=null;!q||b.isDev||A||(H=j,H="/index"===H?"/":H);let I=!0===b.isDev||!q,D=q&&!I;O&&k&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:k,serverActionsManifest:O});let M=e.method||"GET",F=(0,o.getTracer)(),$=F.getActiveScopeSpan(),K={params:w,prerenderManifest:N,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:I,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>b.onRequestError(e,t,a,n,P)},sharedContext:{buildId:y}},B=new u.NodeNextRequest(e),L=new u.NodeNextResponse(t),G=p.NextRequestAdapter.fromNodeNextRequest(B,(0,p.signalFromNodeResponse)(t));try{let s=async e=>b.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${a}`)}),l=!!(0,i.getRequestMeta)(e,"minimalMode"),d=async i=>{var o,d;let u=async({previousCacheEntry:n})=>{try{if(!l&&T&&_&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=K.renderOpts.fetchMetrics;let o=K.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let d=K.renderOpts.collectedTags;if(!q)return await (0,x.sendResponse)(B,L,a,K.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,R.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[v.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await b.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,P),t}},p=await b.handleResponse({req:e,nextConfig:E,cacheKey:H,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:_,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:l});if(!q)return null;if((null==p||null==(o=p.value)?void 0:o.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(d=p.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",T?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,R.fromNodeOutgoingHttpHeaders)(p.value.headers);return l&&q||c.delete(v.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,x.sendResponse)(B,L,new Response(p.value.body,{headers:c,status:p.value.status||200})),null};$?await d($):await F.withPropagatedContext(e.headers,()=>F.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${a}`,kind:o.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},d))}catch(t){if(t instanceof m.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,P),q)throw t;return await (0,x.sendResponse)(B,L,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>E,"routeModule",()=>b,"serverHooks",()=>P,"workAsyncStorage",()=>A,"workUnitAsyncStorage",()=>N]),r()}catch(e){r(e)}},!1),60830,e=>{e.v(t=>Promise.all(["server/chunks/39977_@anthropic-ai_sdk_index_mjs_b0ee562f._.js"].map(t=>e.l(t))).then(()=>t(48394)))}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__b4da5bcd._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/events.ts","../../../src/app/api/registry/route.ts","../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/templates/app-route.ts"],"sourcesContent":["/**\r\n * src/lib/events.ts\r\n * In-process SSE event bus.\r\n * API routes push events here; /api/events streams them to the browser.\r\n */\r\n\r\ntype Listener = (data: unknown) => void\r\n\r\nclass EventBus {\r\n private listeners = new Set<Listener>()\r\n\r\n subscribe(fn: Listener) {\r\n this.listeners.add(fn)\r\n return () => this.listeners.delete(fn)\r\n }\r\n\r\n emit(event: unknown) {\r\n this.listeners.forEach(fn => {\r\n try { fn(event) } catch {}\r\n })\r\n }\r\n}\r\n\r\n// Singleton — shared across all API routes in the same process\r\nconst globalForBus = globalThis as unknown as { vibedocBus?: EventBus }\r\nexport const bus = globalForBus.vibedocBus ?? (globalForBus.vibedocBus = new EventBus())\r\n\r\nexport function emitUpdate(type: string, payload: unknown) {\r\n bus.emit({ type, payload, ts: new Date().toISOString() })\r\n}\r\n","import { NextRequest, NextResponse } from 'next/server'\nimport { getConfiguredRoot, readRegistry, rebuildRegistry } from '@/lib/core'\nimport { emitUpdate } from '@/lib/events'\n\nexport async function GET(req: NextRequest) {\n try {\n const root = req.nextUrl.searchParams.get('root') || getConfiguredRoot()\n const result = await readRegistry(root)\n return NextResponse.json(result)\n } catch (e) {\n return NextResponse.json({ error: (e as Error).message }, { status: 500 })\n }\n}\n\nexport async function POST(req: NextRequest) {\n try {\n const root = req.nextUrl.searchParams.get('root') || getConfiguredRoot()\n const result = await rebuildRegistry(root, 'human')\n emitUpdate('registry_rebuilt', { path: result.path, totalFiles: result.totalFiles })\n return NextResponse.json(result)\n } catch (e) {\n return NextResponse.json({ error: (e as Error).message }, { status: 500 })\n }\n}\n","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport { addRequestMeta, getRequestMeta } from '../../server/request-meta'\nimport { getTracer, type Span, SpanKind } from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\n\nimport * as userland from 'VAR_USERLAND'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n userland,\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil: (prom: Promise<void>) => void\n }\n) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] ||\n prerenderManifest.routes[resolvedPathname]\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname])\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n\n const context: AppRouteRouteHandlerContext = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n try {\n const invokeRouteModule = async (span?: Span) => {\n return routeModule.handle(nextReq, context).finally(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n } else {\n span.updateName(`${method} ${srcPage}`)\n }\n })\n }\n const isMinimalMode = Boolean(\n process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode')\n )\n\n const handleResponse = async (currentSpan?: Span) => {\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await invokeRouteModule(currentSpan)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n response,\n context.renderOpts.pendingWaitUntil\n )\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return null\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan)\n } else {\n await tracer.withPropagatedContext(req.headers, () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n )\n )\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return null\n }\n}\n"],"names":["AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","getTracer","SpanKind","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","CachedRouteKind","userland","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","req","res","ctx","isDev","hrtime","bigint","srcPage","TURBOPACK","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isIsr","Boolean","dynamicRoutes","routes","render404","isPrerendered","prerenderInfo","fallback","experimental","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","context","renderOpts","authInterrupts","cacheComponents","incrementalCache","cacheLifeProfiles","cacheLife","onClose","cb","on","onAfterTaskError","undefined","onInstrumentationRequestError","error","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","invokeRouteModule","span","handle","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","get","handleRequest","console","warn","route","name","updateName","isMinimalMode","MINIMAL_MODE","handleResponse","currentSpan","cacheEntry","responseGenerator","previousCacheEntry","setHeader","response","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","headers","type","revalidate","collectedRevalidate","expire","collectedExpire","value","status","body","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","routeKind","isFallback","isRoutePPREnabled","Error","isMiss","delete","getHeader","set","Response","withPropagatedContext","trace","spanName","SERVER","attributes","url"],"mappings":"6iCAQA,OAAM,EACI,UAAY,IAAI,GAAe,CAEvC,UAAU,CAAY,CAAE,CAEtB,OADA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GACZ,IAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EACrC,CAEA,KAAK,CAAc,CAAE,CACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IACrB,GAAI,CAAE,EAAG,EAAO,CAAE,KAAM,CAAC,CAC3B,EACF,CACF,CAGA,IAAM,EAAe,WACR,EAAM,EAAa,UAAU,EAAK,EAAD,CAAc,UAAU,CAAG,IAAI,CAAA,CAAU,CAEhF,SAAS,EAAW,CAAY,CAAE,CAAgB,EACvD,EAAI,IAAI,CAAC,M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B,OALA,MAAA,CAAA,EAAM7I,EAAAA,YAAAA,EACJgG,EACAC,EACA,IAAI0D,SAAS,KAAM,CAAEpB,OAAQ,GAAI,IAE5B,IACT,CACF","ignoreList":[2]}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
module.exports=[79442,e=>e.a(async(t,
|
|
1
|
+
module.exports=[79442,e=>e.a(async(t,i)=>{try{var r=e.i(52544),a=e.i(99501),o=e.i(52681),n=e.i(98768),s=t([a]);function d(e,t){return r.NextResponse.json({jsonrpc:"2.0",id:e,result:t})}function c(e,t,i){return r.NextResponse.json({jsonrpc:"2.0",id:e,error:{code:t,message:i}})}[a]=s.then?(await s)():s;let h=[{name:"vibedoc_get_status",description:"Get project status overview: active tasks, blockers, doc count, memory. Call this at session start.",inputSchema:{type:"object",properties:{},required:[]}},{name:"vibedoc_read_doc",description:'Read a doc file by name. Use: "CLAUDE", "HLD", "EVENT_CATALOG", "MEMORY", "user-service/API", "ADR-001".',inputSchema:{type:"object",properties:{query:{type:"string",description:'Doc name, e.g. "CLAUDE", "HLD", "user-service/API"'}},required:["query"]}},{name:"vibedoc_list_docs",description:"List all documentation files grouped by section. Use to discover what docs exist.",inputSchema:{type:"object",properties:{},required:[]}},{name:"vibedoc_search_docs",description:"Full-text search across all docs. Returns files and line snippets.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search term"}},required:["query"]}},{name:"vibedoc_write_doc",description:'Write or create a documentation file. Use to add new docs or update existing ones. Path is relative to project root (e.g., "docs/api/endpoints.md"). Creates parent directories as needed. Triggers real-time browser update so the user can review.',inputSchema:{type:"object",properties:{path:{type:"string",description:'Relative path from project root, e.g. "docs/api/my-guide.md"'},content:{type:"string",description:"Full markdown content to write"}},required:["path","content"]}},{name:"vibedoc_list_tasks",description:"List all tasks as a kanban board. Filter by status optionally.",inputSchema:{type:"object",properties:{status:{type:"string",enum:["all","todo","in-progress","blocked","done","cancelled"]}},required:[]}},{name:"vibedoc_get_task",description:"Read a specific task file including scope, criteria, and definition of done.",inputSchema:{type:"object",properties:{taskId:{type:"string",description:'e.g. "T001", "T003"'}},required:["taskId"]}},{name:"vibedoc_update_task",description:"Update task status. Call when starting, finishing, or blocking a task. UI updates in real time.",inputSchema:{type:"object",properties:{taskId:{type:"string"},status:{type:"string",enum:["todo","in-progress","done","blocked","cancelled"]}},required:["taskId","status"]}},{name:"vibedoc_log_decision",description:"Write a new Architecture Decision Record (ADR) when making a technical decision.",inputSchema:{type:"object",properties:{title:{type:"string"},context:{type:"string"},decision:{type:"string"},rationale:{type:"string"},alternatives:{type:"array",items:{type:"object",properties:{option:{type:"string"},reason:{type:"string"}}}},consequences:{type:"string"}},required:["title","context","decision"]}},{name:"vibedoc_read_memory",description:"Read MEMORY.md — the session handoff file. Always call this at session start.",inputSchema:{type:"object",properties:{},required:[]}},{name:"vibedoc_update_memory",description:"Update MEMORY.md with session summary. Call at END of every session.",inputSchema:{type:"object",properties:{currentState:{type:"string"},justCompleted:{type:"array",items:{type:"string"}},workingOn:{type:"string"},upNext:{type:"array",items:{type:"string"}},issues:{type:"array",items:{type:"string"}},decisions:{type:"array",items:{type:"string"}},techDebt:{type:"array",items:{type:"string"}},handoff:{type:"string"}},required:["currentState","handoff"]}},{name:"vibedoc_create_doc",description:"Create a new doc from a template. Use vibedoc_list_templates to see available IDs. Fails if file exists.",inputSchema:{type:"object",properties:{path:{type:"string"},templateId:{type:"string",description:'Defaults to "blank"'}},required:["path"]}},{name:"vibedoc_list_templates",description:"List all doc templates with IDs, names, and default paths.",inputSchema:{type:"object",properties:{},required:[]}},{name:"vibedoc_get_context",description:"Bundle multiple docs into a single context block. Useful for loading several docs at once before starting a task.",inputSchema:{type:"object",properties:{paths:{type:"array",items:{type:"string"},description:"Array of relative doc paths to bundle"}},required:["paths"]}},{name:"vibedoc_append_doc",description:"Append content to an existing doc file. Adds two newlines before the appended content.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Relative path to the doc file"},content:{type:"string",description:"Content to append"}},required:["path","content"]}},{name:"vibedoc_rename_doc",description:"Rename or move a doc file to a new path.",inputSchema:{type:"object",properties:{oldPath:{type:"string",description:"Current path of the doc"},newPath:{type:"string",description:"New path for the doc"}},required:["oldPath","newPath"]}},{name:"vibedoc_delete_doc",description:"Delete a doc file. This action cannot be undone.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Path of the doc to delete"}},required:["path"]}},{name:"vibedoc_get_file_map",description:"Get a structured map of all documentation files with descriptions and last-modified dates. Use at session start to orient yourself without reading each file individually.",inputSchema:{type:"object",properties:{},required:[]}},{name:"vibedoc_read_registry",description:"Read docs/REGISTRY.md — file tree + annotations so you know which doc to open for any task. Call at session start after vibedoc_read_memory. If absent, call vibedoc_rebuild_registry first.",inputSchema:{type:"object",properties:{},required:[]}},{name:"vibedoc_rebuild_registry",description:"Regenerate docs/REGISTRY.md — refreshes the file tree, adds stub rows for new files, and preserves existing descriptions/keywords. Run after adding or removing docs.",inputSchema:{type:"object",properties:{},required:[]}},{name:"vibedoc_annotate_doc",description:"Add or update the description and keywords for one doc in the registry without a full rebuild.",inputSchema:{type:"object",properties:{path:{type:"string",description:'Relative path of the doc, e.g. "docs/api-reference.md"'},description:{type:"string",description:"Short description of what this doc contains"},keywords:{type:"string",description:"Comma-separated keywords for this doc"}},required:["path","description","keywords"]}}];async function p(e,t){let i=(0,a.getConfiguredRoot)();switch(e){case"vibedoc_get_status":{let e=await (0,a.getProjectSummary)(i),t=e.tasks.board,r=[`## ${e.name} — Project Status`,`**Docs:** ${e.docs.total} files`,`**Memory:** ${e.memory.exists?"exists":"not yet created"}`,"","### Board",`📋 Todo: ${t.todo} 🔨 In Progress: ${t["in-progress"]} 🚫 Blocked: ${t.blocked} ✅ Done: ${t.done}`];return e.tasks.active.length>0&&(r.push("","**Active:**"),e.tasks.active.forEach(e=>r.push(` 🔨 ${e.id}: ${e.title}`))),e.tasks.blocked.length>0&&(r.push("","**Blocked:**"),e.tasks.blocked.forEach(e=>r.push(` 🚫 ${e.id}: ${e.title}`))),r.join("\n")}case"vibedoc_read_doc":{let{path:e,content:r}=await (0,a.readDoc)(String(t.query),i);(0,n.emitUpdate)("doc_read",{path:e});let o=await (0,a.findBacklinks)(e,i),s=`## ${e}
|
|
2
2
|
|
|
3
|
-
${
|
|
4
|
-
`})),s}case"vibedoc_list_docs":{let e=await (0,
|
|
5
|
-
`];for(let[e,
|
|
6
|
-
`];for(let t of e)
|
|
7
|
-
`];for(let t of"all"===
|
|
3
|
+
${r}`;return o.length>0&&(s+="\n\n---\n\n## Referenced by\n",o.forEach(e=>{s+=`- ${e.file} (line ${e.line}): ${e.text}
|
|
4
|
+
`})),s}case"vibedoc_list_docs":{let e=await (0,a.listDocs)(i),t={};for(let i of e)t[i.section]||(t[i.section]=[]),t[i.section].push(i.path);let r=[`📚 ${e.length} files
|
|
5
|
+
`];for(let[e,i]of Object.entries(t))r.push(`**${e}** (${i.length})`),i.forEach(e=>r.push(` ${e}`)),r.push("");return r.join("\n")}case"vibedoc_search_docs":{let e=await (0,a.searchDocs)(String(t.query),i);if(!e.length)return`No results for "${t.query}"`;let r=[`🔍 "${t.query}" — ${e.length} file(s)
|
|
6
|
+
`];for(let t of e)r.push(`**${t.file}** (${t.totalHits} hits)`),t.hits.forEach(e=>r.push(` L${e.line}: ${e.text}`)),r.push("");return r.join("\n")}case"vibedoc_write_doc":{let e=String(t.path),r=String(t.content);return await (0,a.writeDoc)(e,r,i),(0,n.emitUpdate)("doc_updated",{path:e}),`✅ Written: ${e}`}case"vibedoc_list_tasks":{let{board:e,tasks:r}=await (0,a.listTasks)(i),o=t.status||"all",n=[`## Tasks (${r.length})
|
|
7
|
+
`];for(let t of"all"===o?["in-progress","blocked","todo","done","cancelled"]:[o]){let i=e[t]||[];n.push(`### ${t.toUpperCase()} (${i.length})`),i.length||n.push(" (empty)"),i.forEach(e=>n.push(` **${e.id}** ${e.title}${e.size?` — ${e.size}`:""}`)),n.push("")}return n.join("\n")}case"vibedoc_get_task":{let e=await (0,a.getTask)(String(t.taskId),i);return`## ${e.file}
|
|
8
8
|
|
|
9
|
-
${e.raw}`}case"vibedoc_update_task":{let e=await (0,
|
|
10
|
-
(was: ${e.previousStatus})`}case"vibedoc_log_decision":{let e=await (0,
|
|
11
|
-
File: ${e.path}`}case"vibedoc_read_memory":return await (0,
|
|
9
|
+
${e.raw}`}case"vibedoc_update_task":{let e=await (0,a.updateTaskStatus)(String(t.taskId),t.status,i,"ai");return(0,n.emitUpdate)("task_updated",{taskId:t.taskId,status:t.status,previousStatus:e.previousStatus,task:e.task}),`✅ **${e.task.id}** → **${e.task.status}**
|
|
10
|
+
(was: ${e.previousStatus})`}case"vibedoc_log_decision":{let e=await (0,a.logDecision)(t,i,"ai");return(0,n.emitUpdate)("decision_logged",e),`📝 **${e.adrNumber}** logged
|
|
11
|
+
File: ${e.path}`}case"vibedoc_read_memory":return await (0,a.logSessionStart)(i,"ai"),(0,n.emitUpdate)("session_start",{root:i}),(await (0,a.readMemory)(i)).content;case"vibedoc_update_memory":return await (0,a.updateMemory)(t,i,"ai"),(0,n.emitUpdate)("memory_updated",{root:i}),`🧠 MEMORY.md updated`;case"vibedoc_create_doc":{let e=String(t.path),r=t.templateId?String(t.templateId):"blank",s=o.TEMPLATES.find(e=>e.id===r)??o.TEMPLATES.find(e=>"blank"===e.id);return await (0,a.createDoc)(e,s.content,i),(0,n.emitUpdate)("doc_created",{path:e}),`✅ Created: ${e} (template: ${s.name})`}case"vibedoc_list_templates":return o.TEMPLATES.map(e=>`**${e.id}** — ${e.name}
|
|
12
12
|
${e.description}
|
|
13
|
-
Default: \`${e.defaultPath}\``).join("\n\n");case"vibedoc_get_context":{let e=t.paths,
|
|
13
|
+
Default: \`${e.defaultPath}\``).join("\n\n");case"vibedoc_get_context":{let e=t.paths,r=await (0,a.getContext)(e,i);if(!r)return"(no content — check paths are correct)";return r}case"vibedoc_append_doc":{let e=String(t.path),r=String(t.content);return await (0,a.appendDoc)(e,r,i),(0,n.emitUpdate)("doc_updated",{path:e}),`✅ Appended to: ${e}`}case"vibedoc_rename_doc":{let e=String(t.oldPath),r=String(t.newPath);return await (0,a.renameDoc)(e,r,i),(0,n.emitUpdate)("doc_renamed",{oldPath:e,newPath:r}),`✅ Renamed: ${e} → ${r}`}case"vibedoc_delete_doc":{let e=String(t.path);return await (0,a.deleteDoc)(e,i),(0,n.emitUpdate)("doc_deleted",{path:e}),`✅ Deleted: ${e}`}case"vibedoc_get_file_map":{let e=await (0,a.listExplorerFiles)(i);return JSON.stringify(e,null,2)}case"vibedoc_read_registry":{let{content:e,exists:t}=await (0,a.readRegistry)(i);if(!t)return`*(No REGISTRY.md found — call vibedoc_rebuild_registry to generate it)*`;return e}case"vibedoc_rebuild_registry":{let e=await (0,a.rebuildRegistry)(i,"ai");return(0,n.emitUpdate)("registry_rebuilt",{path:e.path,totalFiles:e.totalFiles}),`✅ Registry rebuilt: ${e.path}
|
|
14
|
+
${e.totalFiles} files indexed`}case"vibedoc_annotate_doc":{let e=String(t.path),r=String(t.description),o=String(t.keywords);return await (0,a.updateRegistryAnnotation)(e,r,o,i),(0,n.emitUpdate)("registry_rebuilt",{path:"docs/REGISTRY.md"}),`✅ Annotation updated for: ${e}`}default:throw Error(`Unknown tool: ${e}`)}}async function l(e){let t;try{t=await e.json()}catch{return c(null,-32700,"Parse error")}let{id:i,method:r,params:a}=t;if("initialize"===r)return d(i,{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"vibedoc",version:"1.0.0"}});if("tools/list"===r)return d(i,{tools:h});if("tools/call"===r){let e=a?.name||"",t=a?.arguments||{};try{let r=await p(e,t);return d(i,{content:[{type:"text",text:r}]})}catch(t){let e=t instanceof Error?t.message:String(t);return d(i,{content:[{type:"text",text:`❌ ${e}`}],isError:!0})}}return c(i,-32601,`Method not found: ${r}`)}async function u(){return r.NextResponse.json({name:"vibedoc",version:"1.0.0",status:"ready",tools:h.map(e=>e.name)})}e.s(["GET",()=>u,"POST",()=>l]),i()}catch(e){i(e)}},!1),81819,e=>e.a(async(t,i)=>{try{var r=e.i(93771),a=e.i(97686),o=e.i(75526),n=e.i(58e3),s=e.i(89292),d=e.i(22218),c=e.i(70540),p=e.i(9350),l=e.i(69462),u=e.i(13673),h=e.i(59429),m=e.i(41690),g=e.i(55318),y=e.i(99382),f=e.i(20606),b=e.i(93695);e.i(75436);var _=e.i(39468),v=e.i(79442),w=t([v]);[v]=w.then?(await w)():w;let k=new r.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/mcp/route",pathname:"/api/mcp",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/mcp/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:E,workUnitAsyncStorage:$,serverHooks:x}=k;function R(){return(0,o.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:$})}async function S(e,t,i){k.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let r="/api/mcp/route";r=r.replace(/\/index$/,"")||"/";let o=await k.prepare(e,t,{srcPage:r,multiZoneDraftMode:!1});if(!o)return t.statusCode=400,t.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:v,params:w,nextConfig:R,parsedUrl:S,isDraftMode:E,prerenderManifest:$,routerServerContext:x,isOnDemandRevalidate:C,revalidateOnlyGenerated:A,resolvedPathname:j,clientReferenceManifest:T,serverActionsManifest:q}=o,P=(0,c.normalizeAppPath)(r),U=!!($.dynamicRoutes[P]||$.routes[j]),D=async()=>((null==x?void 0:x.render404)?await x.render404(e,t,S,!1):t.end("This page could not be found"),null);if(U&&!E){let e=!!$.routes[j],t=$.dynamicRoutes[P];if(t&&!1===t.fallback&&!e){if(R.experimental.adapterPath)return await D();throw new b.NoFallbackError}}let I=null;!U||k.isDev||E||(I=j,I="/index"===I?"/":I);let N=!0===k.isDev||!U,O=U&&!N;q&&T&&(0,d.setManifestsSingleton)({page:r,clientReferenceManifest:T,serverActionsManifest:q});let M=e.method||"GET",H=(0,s.getTracer)(),F=H.getActiveScopeSpan(),L={params:w,prerenderManifest:$,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:N,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:R.cacheLife,waitUntil:i.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,i,r,a)=>k.onRequestError(e,t,r,a,x)},sharedContext:{buildId:v}},G=new p.NodeNextRequest(e),B=new p.NodeNextResponse(t),K=l.NextRequestAdapter.fromNodeNextRequest(G,(0,l.signalFromNodeResponse)(t));try{let o=async e=>k.handle(K,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let i=H.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${i.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=i.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${r}`)}),d=!!(0,n.getRequestMeta)(e,"minimalMode"),c=async n=>{var s,c;let p=async({previousCacheEntry:a})=>{try{if(!d&&C&&A&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await o(n);e.fetchMetrics=L.renderOpts.fetchMetrics;let s=L.renderOpts.pendingWaitUntil;s&&i.waitUntil&&(i.waitUntil(s),s=void 0);let c=L.renderOpts.collectedTags;if(!U)return await (0,m.sendResponse)(G,B,r,L.renderOpts.pendingWaitUntil),null;{let e=await r.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(r.headers);c&&(t[f.NEXT_CACHE_TAGS_HEADER]=c),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let i=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,a=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:_.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:i,expire:a}}}}catch(t){throw(null==a?void 0:a.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:r,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:O,isOnDemandRevalidate:C})},!1,x),t}},l=await k.handleResponse({req:e,nextConfig:R,cacheKey:I,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:$,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:A,responseGenerator:p,waitUntil:i.waitUntil,isMinimalMode:d});if(!U)return null;if((null==l||null==(s=l.value)?void 0:s.kind)!==_.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(c=l.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});d||t.setHeader("x-nextjs-cache",C?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,g.fromNodeOutgoingHttpHeaders)(l.value.headers);return d&&U||u.delete(f.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,y.getCacheControlHeader)(l.cacheControl)),await (0,m.sendResponse)(G,B,new Response(l.value.body,{headers:u,status:l.value.status||200})),null};F?await c(F):await H.withPropagatedContext(e.headers,()=>H.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${r}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},c))}catch(t){if(t instanceof b.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:P,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:O,isOnDemandRevalidate:C})},!1,x),U)throw t;return await (0,m.sendResponse)(G,B,new Response(null,{status:500})),null}}e.s(["handler",()=>S,"patchFetch",()=>R,"routeModule",()=>k,"serverHooks",()=>x,"workAsyncStorage",()=>E,"workUnitAsyncStorage",()=>$]),i()}catch(e){i(e)}},!1)];
|
|
14
15
|
|
|
15
16
|
//# sourceMappingURL=_75927d0c._.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/app/api/mcp/route.ts","../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/templates/app-route.ts"],"sourcesContent":["/**\r\n * /api/mcp\r\n *\r\n * MCP server over HTTP (Streamable HTTP transport).\r\n * AI agents (Claude Code, Cursor, Windsurf) connect here.\r\n *\r\n * Config in Claude Code:\r\n * {\r\n * \"mcpServers\": {\r\n * \"vibedoc\": {\r\n * \"url\": \"http://localhost:3000/api/mcp\"\r\n * }\r\n * }\r\n * }\r\n */\r\n\r\nimport { NextRequest, NextResponse } from 'next/server'\r\nimport {\r\n getConfiguredRoot, listDocs, readDoc, searchDocs, writeDoc, createDoc, getContext,\r\n getProjectSummary, listTasks, getTask, updateTaskStatus,\r\n logDecision, readMemory, updateMemory, logSessionStart,\r\n findBacklinks, appendDoc, renameDoc, deleteDoc, listExplorerFiles,\r\n TaskStatus,\r\n} from '@/lib/core'\r\nimport { TEMPLATES } from '@/lib/templates'\r\nimport { emitUpdate } from '@/lib/events'\r\nimport { z } from 'zod'\r\n\r\n// Simple hand-rolled MCP handler (avoids stdio transport issues in Next.js)\r\n// Implements the JSON-RPC 2.0 MCP protocol directly.\r\n\r\ntype JsonRpcRequest = {\r\n jsonrpc: '2.0'\r\n id: string | number | null\r\n method: string\r\n params?: Record<string, unknown>\r\n}\r\n\r\nfunction ok(id: JsonRpcRequest['id'], result: unknown) {\r\n return NextResponse.json({ jsonrpc: '2.0', id, result })\r\n}\r\n\r\nfunction err(id: JsonRpcRequest['id'], code: number, message: string) {\r\n return NextResponse.json({ jsonrpc: '2.0', id, error: { code, message } })\r\n}\r\n\r\nconst TOOLS = [\r\n {\r\n name: 'vibedoc_get_status',\r\n description: 'Get project status overview: active tasks, blockers, doc count, memory. Call this at session start.',\r\n inputSchema: { type: 'object', properties: {}, required: [] },\r\n },\r\n {\r\n name: 'vibedoc_read_doc',\r\n description: 'Read a doc file by name. Use: \"CLAUDE\", \"HLD\", \"EVENT_CATALOG\", \"MEMORY\", \"user-service/API\", \"ADR-001\".',\r\n inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Doc name, e.g. \"CLAUDE\", \"HLD\", \"user-service/API\"' } }, required: ['query'] },\r\n },\r\n {\r\n name: 'vibedoc_list_docs',\r\n description: 'List all documentation files grouped by section. Use to discover what docs exist.',\r\n inputSchema: { type: 'object', properties: {}, required: [] },\r\n },\r\n {\r\n name: 'vibedoc_search_docs',\r\n description: 'Full-text search across all docs. Returns files and line snippets.',\r\n inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term' } }, required: ['query'] },\r\n },\r\n {\r\n name: 'vibedoc_write_doc',\r\n description: 'Write or create a documentation file. Use to add new docs or update existing ones. Path is relative to project root (e.g., \"docs/api/endpoints.md\"). Creates parent directories as needed. Triggers real-time browser update so the user can review.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n path: { type: 'string', description: 'Relative path from project root, e.g. \"docs/api/my-guide.md\"' },\r\n content: { type: 'string', description: 'Full markdown content to write' },\r\n },\r\n required: ['path', 'content'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_list_tasks',\r\n description: 'List all tasks as a kanban board. Filter by status optionally.',\r\n inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['all', 'todo', 'in-progress', 'blocked', 'done', 'cancelled'] } }, required: [] },\r\n },\r\n {\r\n name: 'vibedoc_get_task',\r\n description: 'Read a specific task file including scope, criteria, and definition of done.',\r\n inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'e.g. \"T001\", \"T003\"' } }, required: ['taskId'] },\r\n },\r\n {\r\n name: 'vibedoc_update_task',\r\n description: 'Update task status. Call when starting, finishing, or blocking a task. UI updates in real time.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n taskId: { type: 'string' },\r\n status: { type: 'string', enum: ['todo', 'in-progress', 'done', 'blocked', 'cancelled'] },\r\n },\r\n required: ['taskId', 'status'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_log_decision',\r\n description: 'Write a new Architecture Decision Record (ADR) when making a technical decision.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n title: { type: 'string' },\r\n context: { type: 'string' },\r\n decision: { type: 'string' },\r\n rationale: { type: 'string' },\r\n alternatives: { type: 'array', items: { type: 'object', properties: { option: { type: 'string' }, reason: { type: 'string' } } } },\r\n consequences: { type: 'string' },\r\n },\r\n required: ['title', 'context', 'decision'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_read_memory',\r\n description: 'Read MEMORY.md — the session handoff file. Always call this at session start.',\r\n inputSchema: { type: 'object', properties: {}, required: [] },\r\n },\r\n {\r\n name: 'vibedoc_update_memory',\r\n description: 'Update MEMORY.md with session summary. Call at END of every session.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n currentState: { type: 'string' },\r\n justCompleted: { type: 'array', items: { type: 'string' } },\r\n workingOn: { type: 'string' },\r\n upNext: { type: 'array', items: { type: 'string' } },\r\n issues: { type: 'array', items: { type: 'string' } },\r\n decisions: { type: 'array', items: { type: 'string' } },\r\n techDebt: { type: 'array', items: { type: 'string' } },\r\n handoff: { type: 'string' },\r\n },\r\n required: ['currentState', 'handoff'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_create_doc',\r\n description: 'Create a new doc from a template. Use vibedoc_list_templates to see available IDs. Fails if file exists.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n path: { type: 'string' },\r\n templateId: { type: 'string', description: 'Defaults to \"blank\"' },\r\n },\r\n required: ['path'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_list_templates',\r\n description: 'List all doc templates with IDs, names, and default paths.',\r\n inputSchema: { type: 'object', properties: {}, required: [] },\r\n },\r\n {\r\n name: 'vibedoc_get_context',\r\n description: 'Bundle multiple docs into a single context block. Useful for loading several docs at once before starting a task.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n paths: { type: 'array', items: { type: 'string' }, description: 'Array of relative doc paths to bundle' },\r\n },\r\n required: ['paths'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_append_doc',\r\n description: 'Append content to an existing doc file. Adds two newlines before the appended content.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n path: { type: 'string', description: 'Relative path to the doc file' },\r\n content: { type: 'string', description: 'Content to append' },\r\n },\r\n required: ['path', 'content'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_rename_doc',\r\n description: 'Rename or move a doc file to a new path.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n oldPath: { type: 'string', description: 'Current path of the doc' },\r\n newPath: { type: 'string', description: 'New path for the doc' },\r\n },\r\n required: ['oldPath', 'newPath'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_delete_doc',\r\n description: 'Delete a doc file. This action cannot be undone.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n path: { type: 'string', description: 'Path of the doc to delete' },\r\n },\r\n required: ['path'],\r\n },\r\n },\r\n {\r\n name: 'vibedoc_get_file_map',\r\n description: 'Get a structured map of all documentation files with descriptions and last-modified dates. Use at session start to orient yourself without reading each file individually.',\r\n inputSchema: { type: 'object', properties: {}, required: [] },\r\n },\r\n]\r\n\r\nasync function handleTool(name: string, args: Record<string, unknown>) {\r\n const root = getConfiguredRoot()\r\n\r\n switch (name) {\r\n case 'vibedoc_get_status': {\r\n const s = await getProjectSummary(root)\r\n const b = s.tasks.board\r\n const lines = [\r\n `## ${s.name} — Project Status`,\r\n `**Docs:** ${s.docs.total} files`,\r\n `**Memory:** ${s.memory.exists ? 'exists' : 'not yet created'}`,\r\n '',\r\n '### Board',\r\n `📋 Todo: ${b.todo} 🔨 In Progress: ${b['in-progress']} 🚫 Blocked: ${b.blocked} ✅ Done: ${b.done}`,\r\n ]\r\n if (s.tasks.active.length > 0) {\r\n lines.push('', '**Active:**')\r\n s.tasks.active.forEach(t => lines.push(` 🔨 ${t.id}: ${t.title}`))\r\n }\r\n if (s.tasks.blocked.length > 0) {\r\n lines.push('', '**Blocked:**')\r\n s.tasks.blocked.forEach(t => lines.push(` 🚫 ${t.id}: ${t.title}`))\r\n }\r\n return lines.join('\\n')\r\n }\r\n\r\n case 'vibedoc_read_doc': {\r\n const { path: docPath, content } = await readDoc(String(args.query), root)\r\n emitUpdate('doc_read', { path: docPath })\r\n const backlinks = await findBacklinks(docPath, root)\r\n let result = `## ${docPath}\\n\\n${content}`\r\n if (backlinks.length > 0) {\r\n result += '\\n\\n---\\n\\n## Referenced by\\n'\r\n backlinks.forEach(b => {\r\n result += `- ${b.file} (line ${b.line}): ${b.text}\\n`\r\n })\r\n }\r\n return result\r\n }\r\n\r\n case 'vibedoc_list_docs': {\r\n const docs = await listDocs(root)\r\n const sections: Record<string, string[]> = {}\r\n for (const d of docs) {\r\n if (!sections[d.section]) sections[d.section] = []\r\n sections[d.section].push(d.path)\r\n }\r\n const lines = [`📚 ${docs.length} files\\n`]\r\n for (const [s, files] of Object.entries(sections)) {\r\n lines.push(`**${s}** (${files.length})`)\r\n files.forEach(f => lines.push(` ${f}`))\r\n lines.push('')\r\n }\r\n return lines.join('\\n')\r\n }\r\n\r\n case 'vibedoc_search_docs': {\r\n const results = await searchDocs(String(args.query), root)\r\n if (!results.length) return `No results for \"${args.query}\"`\r\n const lines = [`🔍 \"${args.query}\" — ${results.length} file(s)\\n`]\r\n for (const r of results) {\r\n lines.push(`**${r.file}** (${r.totalHits} hits)`)\r\n r.hits.forEach(h => lines.push(` L${h.line}: ${h.text}`))\r\n lines.push('')\r\n }\r\n return lines.join('\\n')\r\n }\r\n\r\n case 'vibedoc_write_doc': {\r\n const docPath = String(args.path)\r\n const content = String(args.content)\r\n await writeDoc(docPath, content, root)\r\n emitUpdate('doc_updated', { path: docPath })\r\n return `✅ Written: ${docPath}`\r\n }\r\n\r\n case 'vibedoc_list_tasks': {\r\n const { board, tasks } = await listTasks(root)\r\n const filter = (args.status as string) || 'all'\r\n const cols = filter === 'all' ? ['in-progress', 'blocked', 'todo', 'done', 'cancelled'] : [filter]\r\n const lines = [`## Tasks (${tasks.length})\\n`]\r\n for (const col of cols) {\r\n const items = board[col as TaskStatus] || []\r\n lines.push(`### ${col.toUpperCase()} (${items.length})`)\r\n if (!items.length) lines.push(' (empty)')\r\n items.forEach(t => lines.push(` **${t.id}** ${t.title}${t.size ? ` — ${t.size}` : ''}`))\r\n lines.push('')\r\n }\r\n return lines.join('\\n')\r\n }\r\n\r\n case 'vibedoc_get_task': {\r\n const task = await getTask(String(args.taskId), root)\r\n return `## ${task.file}\\n\\n${task.raw}`\r\n }\r\n\r\n case 'vibedoc_update_task': {\r\n const result = await updateTaskStatus(String(args.taskId), args.status as TaskStatus, root, 'ai')\r\n emitUpdate('task_updated', { taskId: args.taskId, status: args.status, previousStatus: result.previousStatus, task: result.task })\r\n return `✅ **${result.task.id}** → **${result.task.status}**\\n(was: ${result.previousStatus})`\r\n }\r\n\r\n case 'vibedoc_log_decision': {\r\n const result = await logDecision(args as unknown as Parameters<typeof logDecision>[0], root, 'ai')\r\n emitUpdate('decision_logged', result)\r\n return `📝 **${result.adrNumber}** logged\\nFile: ${result.path}`\r\n }\r\n\r\n case 'vibedoc_read_memory': {\r\n await logSessionStart(root, 'ai')\r\n emitUpdate('session_start', { root })\r\n const memory = await readMemory(root)\r\n return memory.content\r\n }\r\n\r\n case 'vibedoc_update_memory': {\r\n await updateMemory(args as unknown as Parameters<typeof updateMemory>[0], root, 'ai')\r\n emitUpdate('memory_updated', { root })\r\n return `🧠 MEMORY.md updated`\r\n }\r\n\r\n case 'vibedoc_create_doc': {\r\n const docPath = String(args.path)\r\n const templateId = args.templateId ? String(args.templateId) : 'blank'\r\n const template = TEMPLATES.find(t => t.id === templateId) ?? TEMPLATES.find(t => t.id === 'blank')!\r\n await createDoc(docPath, template.content, root)\r\n emitUpdate('doc_created', { path: docPath })\r\n return `✅ Created: ${docPath} (template: ${template.name})`\r\n }\r\n\r\n case 'vibedoc_list_templates': {\r\n return TEMPLATES.map(t => `**${t.id}** — ${t.name}\\n ${t.description}\\n Default: \\`${t.defaultPath}\\``).join('\\n\\n')\r\n }\r\n\r\n case 'vibedoc_get_context': {\r\n const paths = args.paths as string[]\r\n const context = await getContext(paths, root)\r\n if (!context) return '(no content — check paths are correct)'\r\n return context\r\n }\r\n\r\n case 'vibedoc_append_doc': {\r\n const docPath = String(args.path)\r\n const content = String(args.content)\r\n await appendDoc(docPath, content, root)\r\n emitUpdate('doc_updated', { path: docPath })\r\n return `✅ Appended to: ${docPath}`\r\n }\r\n\r\n case 'vibedoc_rename_doc': {\r\n const oldPath = String(args.oldPath)\r\n const newPath = String(args.newPath)\r\n await renameDoc(oldPath, newPath, root)\r\n emitUpdate('doc_renamed', { oldPath, newPath })\r\n return `✅ Renamed: ${oldPath} → ${newPath}`\r\n }\r\n\r\n case 'vibedoc_delete_doc': {\r\n const docPath = String(args.path)\r\n await deleteDoc(docPath, root)\r\n emitUpdate('doc_deleted', { path: docPath })\r\n return `✅ Deleted: ${docPath}`\r\n }\r\n\r\n case 'vibedoc_get_file_map': {\r\n const files = await listExplorerFiles(root)\r\n return JSON.stringify(files, null, 2)\r\n }\r\n\r\n default:\r\n throw new Error(`Unknown tool: ${name}`)\r\n }\r\n}\r\n\r\nexport async function POST(req: NextRequest) {\r\n let body: JsonRpcRequest\r\n try {\r\n body = await req.json()\r\n } catch {\r\n return err(null, -32700, 'Parse error')\r\n }\r\n\r\n const { id, method, params } = body\r\n\r\n // MCP initialize\r\n if (method === 'initialize') {\r\n return ok(id, {\r\n protocolVersion: '2024-11-05',\r\n capabilities: { tools: {} },\r\n serverInfo: { name: 'vibedoc', version: '1.0.0' },\r\n })\r\n }\r\n\r\n // tools/list\r\n if (method === 'tools/list') {\r\n return ok(id, { tools: TOOLS })\r\n }\r\n\r\n // tools/call\r\n if (method === 'tools/call') {\r\n const name = (params?.name as string) || ''\r\n const args = (params?.arguments as Record<string, unknown>) || {}\r\n try {\r\n const text = await handleTool(name, args)\r\n return ok(id, { content: [{ type: 'text', text }] })\r\n } catch (e: unknown) {\r\n const msg = e instanceof Error ? e.message : String(e)\r\n return ok(id, { content: [{ type: 'text', text: `❌ ${msg}` }], isError: true })\r\n }\r\n }\r\n\r\n return err(id, -32601, `Method not found: ${method}`)\r\n}\r\n\r\n// GET for connection test / SSE upgrade (some clients use GET)\r\nexport async function GET() {\r\n return NextResponse.json({ name: 'vibedoc', version: '1.0.0', status: 'ready', tools: TOOLS.map(t => t.name) })\r\n}\r\n","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport { addRequestMeta, getRequestMeta } from '../../server/request-meta'\nimport { getTracer, type Span, SpanKind } from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\n\nimport * as userland from 'VAR_USERLAND'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n userland,\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil: (prom: Promise<void>) => void\n }\n) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] ||\n prerenderManifest.routes[resolvedPathname]\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname])\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n\n const context: AppRouteRouteHandlerContext = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n try {\n const invokeRouteModule = async (span?: Span) => {\n return routeModule.handle(nextReq, context).finally(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n } else {\n span.updateName(`${method} ${srcPage}`)\n }\n })\n }\n const isMinimalMode = Boolean(\n process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode')\n )\n\n const handleResponse = async (currentSpan?: Span) => {\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await invokeRouteModule(currentSpan)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n response,\n context.renderOpts.pendingWaitUntil\n )\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return null\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan)\n } else {\n await tracer.withPropagatedContext(req.headers, () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n )\n )\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return null\n }\n}\n"],"names":["AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","getTracer","SpanKind","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","CachedRouteKind","userland","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","req","res","ctx","isDev","hrtime","bigint","srcPage","TURBOPACK","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isIsr","Boolean","dynamicRoutes","routes","render404","isPrerendered","prerenderInfo","fallback","experimental","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","context","renderOpts","authInterrupts","cacheComponents","incrementalCache","cacheLifeProfiles","cacheLife","onClose","cb","on","onAfterTaskError","undefined","onInstrumentationRequestError","error","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","invokeRouteModule","span","handle","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","get","handleRequest","console","warn","route","name","updateName","isMinimalMode","MINIMAL_MODE","handleResponse","currentSpan","cacheEntry","responseGenerator","previousCacheEntry","setHeader","response","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","headers","type","revalidate","collectedRevalidate","expire","collectedExpire","value","status","body","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","routeKind","isFallback","isRoutePPREnabled","Error","isMiss","delete","getHeader","set","Response","withPropagatedContext","trace","spanName","SERVER","attributes","url"],"mappings":"8CAgBA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAOA,EAAA,EAAA,CAAA,CAAA,OACA,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npm/next%4016.1.6_%40babel%2Bcore%407.29.0_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/templates/app-route.ts"],"sourcesContent":["/**\r\n * /api/mcp\r\n *\r\n * MCP server over HTTP (Streamable HTTP transport).\r\n * AI agents (Claude Code, Cursor, Windsurf) connect here.\r\n *\r\n * Config in Claude Code:\r\n * {\r\n * \"mcpServers\": {\r\n * \"vibedoc\": {\r\n * \"url\": \"http://localhost:3000/api/mcp\"\r\n * }\r\n * }\r\n * }\r\n */\r\n\r\nimport { NextRequest, NextResponse } from \"next/server\";\r\nimport {\r\n getConfiguredRoot,\r\n listDocs,\r\n readDoc,\r\n searchDocs,\r\n writeDoc,\r\n createDoc,\r\n getContext,\r\n getProjectSummary,\r\n listTasks,\r\n getTask,\r\n updateTaskStatus,\r\n logDecision,\r\n readMemory,\r\n updateMemory,\r\n logSessionStart,\r\n findBacklinks,\r\n appendDoc,\r\n renameDoc,\r\n deleteDoc,\r\n listExplorerFiles,\r\n readRegistry,\r\n rebuildRegistry,\r\n updateRegistryAnnotation,\r\n TaskStatus,\r\n} from \"@/lib/core\";\r\nimport { TEMPLATES } from \"@/lib/templates\";\r\nimport { emitUpdate } from \"@/lib/events\";\r\nimport { z } from \"zod\";\r\n\r\n// Simple hand-rolled MCP handler (avoids stdio transport issues in Next.js)\r\n// Implements the JSON-RPC 2.0 MCP protocol directly.\r\n\r\ntype JsonRpcRequest = {\r\n jsonrpc: \"2.0\";\r\n id: string | number | null;\r\n method: string;\r\n params?: Record<string, unknown>;\r\n};\r\n\r\nfunction ok(id: JsonRpcRequest[\"id\"], result: unknown) {\r\n return NextResponse.json({ jsonrpc: \"2.0\", id, result });\r\n}\r\n\r\nfunction err(id: JsonRpcRequest[\"id\"], code: number, message: string) {\r\n return NextResponse.json({ jsonrpc: \"2.0\", id, error: { code, message } });\r\n}\r\n\r\nconst TOOLS = [\r\n {\r\n name: \"vibedoc_get_status\",\r\n description:\r\n \"Get project status overview: active tasks, blockers, doc count, memory. Call this at session start.\",\r\n inputSchema: { type: \"object\", properties: {}, required: [] },\r\n },\r\n {\r\n name: \"vibedoc_read_doc\",\r\n description:\r\n 'Read a doc file by name. Use: \"CLAUDE\", \"HLD\", \"EVENT_CATALOG\", \"MEMORY\", \"user-service/API\", \"ADR-001\".',\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n query: {\r\n type: \"string\",\r\n description: 'Doc name, e.g. \"CLAUDE\", \"HLD\", \"user-service/API\"',\r\n },\r\n },\r\n required: [\"query\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_list_docs\",\r\n description:\r\n \"List all documentation files grouped by section. Use to discover what docs exist.\",\r\n inputSchema: { type: \"object\", properties: {}, required: [] },\r\n },\r\n {\r\n name: \"vibedoc_search_docs\",\r\n description:\r\n \"Full-text search across all docs. Returns files and line snippets.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: { query: { type: \"string\", description: \"Search term\" } },\r\n required: [\"query\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_write_doc\",\r\n description:\r\n 'Write or create a documentation file. Use to add new docs or update existing ones. Path is relative to project root (e.g., \"docs/api/endpoints.md\"). Creates parent directories as needed. Triggers real-time browser update so the user can review.',\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n path: {\r\n type: \"string\",\r\n description:\r\n 'Relative path from project root, e.g. \"docs/api/my-guide.md\"',\r\n },\r\n content: {\r\n type: \"string\",\r\n description: \"Full markdown content to write\",\r\n },\r\n },\r\n required: [\"path\", \"content\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_list_tasks\",\r\n description:\r\n \"List all tasks as a kanban board. Filter by status optionally.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n status: {\r\n type: \"string\",\r\n enum: [\"all\", \"todo\", \"in-progress\", \"blocked\", \"done\", \"cancelled\"],\r\n },\r\n },\r\n required: [],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_get_task\",\r\n description:\r\n \"Read a specific task file including scope, criteria, and definition of done.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n taskId: { type: \"string\", description: 'e.g. \"T001\", \"T003\"' },\r\n },\r\n required: [\"taskId\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_update_task\",\r\n description:\r\n \"Update task status. Call when starting, finishing, or blocking a task. UI updates in real time.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n taskId: { type: \"string\" },\r\n status: {\r\n type: \"string\",\r\n enum: [\"todo\", \"in-progress\", \"done\", \"blocked\", \"cancelled\"],\r\n },\r\n },\r\n required: [\"taskId\", \"status\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_log_decision\",\r\n description:\r\n \"Write a new Architecture Decision Record (ADR) when making a technical decision.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n title: { type: \"string\" },\r\n context: { type: \"string\" },\r\n decision: { type: \"string\" },\r\n rationale: { type: \"string\" },\r\n alternatives: {\r\n type: \"array\",\r\n items: {\r\n type: \"object\",\r\n properties: {\r\n option: { type: \"string\" },\r\n reason: { type: \"string\" },\r\n },\r\n },\r\n },\r\n consequences: { type: \"string\" },\r\n },\r\n required: [\"title\", \"context\", \"decision\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_read_memory\",\r\n description:\r\n \"Read MEMORY.md — the session handoff file. Always call this at session start.\",\r\n inputSchema: { type: \"object\", properties: {}, required: [] },\r\n },\r\n {\r\n name: \"vibedoc_update_memory\",\r\n description:\r\n \"Update MEMORY.md with session summary. Call at END of every session.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n currentState: { type: \"string\" },\r\n justCompleted: { type: \"array\", items: { type: \"string\" } },\r\n workingOn: { type: \"string\" },\r\n upNext: { type: \"array\", items: { type: \"string\" } },\r\n issues: { type: \"array\", items: { type: \"string\" } },\r\n decisions: { type: \"array\", items: { type: \"string\" } },\r\n techDebt: { type: \"array\", items: { type: \"string\" } },\r\n handoff: { type: \"string\" },\r\n },\r\n required: [\"currentState\", \"handoff\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_create_doc\",\r\n description:\r\n \"Create a new doc from a template. Use vibedoc_list_templates to see available IDs. Fails if file exists.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n path: { type: \"string\" },\r\n templateId: { type: \"string\", description: 'Defaults to \"blank\"' },\r\n },\r\n required: [\"path\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_list_templates\",\r\n description: \"List all doc templates with IDs, names, and default paths.\",\r\n inputSchema: { type: \"object\", properties: {}, required: [] },\r\n },\r\n {\r\n name: \"vibedoc_get_context\",\r\n description:\r\n \"Bundle multiple docs into a single context block. Useful for loading several docs at once before starting a task.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n paths: {\r\n type: \"array\",\r\n items: { type: \"string\" },\r\n description: \"Array of relative doc paths to bundle\",\r\n },\r\n },\r\n required: [\"paths\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_append_doc\",\r\n description:\r\n \"Append content to an existing doc file. Adds two newlines before the appended content.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n path: { type: \"string\", description: \"Relative path to the doc file\" },\r\n content: { type: \"string\", description: \"Content to append\" },\r\n },\r\n required: [\"path\", \"content\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_rename_doc\",\r\n description: \"Rename or move a doc file to a new path.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n oldPath: { type: \"string\", description: \"Current path of the doc\" },\r\n newPath: { type: \"string\", description: \"New path for the doc\" },\r\n },\r\n required: [\"oldPath\", \"newPath\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_delete_doc\",\r\n description: \"Delete a doc file. This action cannot be undone.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n path: { type: \"string\", description: \"Path of the doc to delete\" },\r\n },\r\n required: [\"path\"],\r\n },\r\n },\r\n {\r\n name: \"vibedoc_get_file_map\",\r\n description:\r\n \"Get a structured map of all documentation files with descriptions and last-modified dates. Use at session start to orient yourself without reading each file individually.\",\r\n inputSchema: { type: \"object\", properties: {}, required: [] },\r\n },\r\n {\r\n name: \"vibedoc_read_registry\",\r\n description:\r\n \"Read docs/REGISTRY.md — file tree + annotations so you know which doc to open for any task. Call at session start after vibedoc_read_memory. If absent, call vibedoc_rebuild_registry first.\",\r\n inputSchema: { type: \"object\", properties: {}, required: [] },\r\n },\r\n {\r\n name: \"vibedoc_rebuild_registry\",\r\n description:\r\n \"Regenerate docs/REGISTRY.md — refreshes the file tree, adds stub rows for new files, and preserves existing descriptions/keywords. Run after adding or removing docs.\",\r\n inputSchema: { type: \"object\", properties: {}, required: [] },\r\n },\r\n {\r\n name: \"vibedoc_annotate_doc\",\r\n description:\r\n \"Add or update the description and keywords for one doc in the registry without a full rebuild.\",\r\n inputSchema: {\r\n type: \"object\",\r\n properties: {\r\n path: {\r\n type: \"string\",\r\n description: 'Relative path of the doc, e.g. \"docs/api-reference.md\"',\r\n },\r\n description: {\r\n type: \"string\",\r\n description: \"Short description of what this doc contains\",\r\n },\r\n keywords: {\r\n type: \"string\",\r\n description: \"Comma-separated keywords for this doc\",\r\n },\r\n },\r\n required: [\"path\", \"description\", \"keywords\"],\r\n },\r\n },\r\n];\r\n\r\nasync function handleTool(name: string, args: Record<string, unknown>) {\r\n const root = getConfiguredRoot();\r\n\r\n switch (name) {\r\n case \"vibedoc_get_status\": {\r\n const s = await getProjectSummary(root);\r\n const b = s.tasks.board;\r\n const lines = [\r\n `## ${s.name} — Project Status`,\r\n `**Docs:** ${s.docs.total} files`,\r\n `**Memory:** ${s.memory.exists ? \"exists\" : \"not yet created\"}`,\r\n \"\",\r\n \"### Board\",\r\n `📋 Todo: ${b.todo} 🔨 In Progress: ${b[\"in-progress\"]} 🚫 Blocked: ${b.blocked} ✅ Done: ${b.done}`,\r\n ];\r\n if (s.tasks.active.length > 0) {\r\n lines.push(\"\", \"**Active:**\");\r\n s.tasks.active.forEach((t) => lines.push(` 🔨 ${t.id}: ${t.title}`));\r\n }\r\n if (s.tasks.blocked.length > 0) {\r\n lines.push(\"\", \"**Blocked:**\");\r\n s.tasks.blocked.forEach((t) => lines.push(` 🚫 ${t.id}: ${t.title}`));\r\n }\r\n return lines.join(\"\\n\");\r\n }\r\n\r\n case \"vibedoc_read_doc\": {\r\n const { path: docPath, content } = await readDoc(\r\n String(args.query),\r\n root,\r\n );\r\n emitUpdate(\"doc_read\", { path: docPath });\r\n const backlinks = await findBacklinks(docPath, root);\r\n let result = `## ${docPath}\\n\\n${content}`;\r\n if (backlinks.length > 0) {\r\n result += \"\\n\\n---\\n\\n## Referenced by\\n\";\r\n backlinks.forEach((b) => {\r\n result += `- ${b.file} (line ${b.line}): ${b.text}\\n`;\r\n });\r\n }\r\n return result;\r\n }\r\n\r\n case \"vibedoc_list_docs\": {\r\n const docs = await listDocs(root);\r\n const sections: Record<string, string[]> = {};\r\n for (const d of docs) {\r\n if (!sections[d.section]) sections[d.section] = [];\r\n sections[d.section].push(d.path);\r\n }\r\n const lines = [`📚 ${docs.length} files\\n`];\r\n for (const [s, files] of Object.entries(sections)) {\r\n lines.push(`**${s}** (${files.length})`);\r\n files.forEach((f) => lines.push(` ${f}`));\r\n lines.push(\"\");\r\n }\r\n return lines.join(\"\\n\");\r\n }\r\n\r\n case \"vibedoc_search_docs\": {\r\n const results = await searchDocs(String(args.query), root);\r\n if (!results.length) return `No results for \"${args.query}\"`;\r\n const lines = [`🔍 \"${args.query}\" — ${results.length} file(s)\\n`];\r\n for (const r of results) {\r\n lines.push(`**${r.file}** (${r.totalHits} hits)`);\r\n r.hits.forEach((h) => lines.push(` L${h.line}: ${h.text}`));\r\n lines.push(\"\");\r\n }\r\n return lines.join(\"\\n\");\r\n }\r\n\r\n case \"vibedoc_write_doc\": {\r\n const docPath = String(args.path);\r\n const content = String(args.content);\r\n await writeDoc(docPath, content, root);\r\n emitUpdate(\"doc_updated\", { path: docPath });\r\n return `✅ Written: ${docPath}`;\r\n }\r\n\r\n case \"vibedoc_list_tasks\": {\r\n const { board, tasks } = await listTasks(root);\r\n const filter = (args.status as string) || \"all\";\r\n const cols =\r\n filter === \"all\"\r\n ? [\"in-progress\", \"blocked\", \"todo\", \"done\", \"cancelled\"]\r\n : [filter];\r\n const lines = [`## Tasks (${tasks.length})\\n`];\r\n for (const col of cols) {\r\n const items = board[col as TaskStatus] || [];\r\n lines.push(`### ${col.toUpperCase()} (${items.length})`);\r\n if (!items.length) lines.push(\" (empty)\");\r\n items.forEach((t) =>\r\n lines.push(` **${t.id}** ${t.title}${t.size ? ` — ${t.size}` : \"\"}`),\r\n );\r\n lines.push(\"\");\r\n }\r\n return lines.join(\"\\n\");\r\n }\r\n\r\n case \"vibedoc_get_task\": {\r\n const task = await getTask(String(args.taskId), root);\r\n return `## ${task.file}\\n\\n${task.raw}`;\r\n }\r\n\r\n case \"vibedoc_update_task\": {\r\n const result = await updateTaskStatus(\r\n String(args.taskId),\r\n args.status as TaskStatus,\r\n root,\r\n \"ai\",\r\n );\r\n emitUpdate(\"task_updated\", {\r\n taskId: args.taskId,\r\n status: args.status,\r\n previousStatus: result.previousStatus,\r\n task: result.task,\r\n });\r\n return `✅ **${result.task.id}** → **${result.task.status}**\\n(was: ${result.previousStatus})`;\r\n }\r\n\r\n case \"vibedoc_log_decision\": {\r\n const result = await logDecision(\r\n args as unknown as Parameters<typeof logDecision>[0],\r\n root,\r\n \"ai\",\r\n );\r\n emitUpdate(\"decision_logged\", result);\r\n return `📝 **${result.adrNumber}** logged\\nFile: ${result.path}`;\r\n }\r\n\r\n case \"vibedoc_read_memory\": {\r\n await logSessionStart(root, \"ai\");\r\n emitUpdate(\"session_start\", { root });\r\n const memory = await readMemory(root);\r\n return memory.content;\r\n }\r\n\r\n case \"vibedoc_update_memory\": {\r\n await updateMemory(\r\n args as unknown as Parameters<typeof updateMemory>[0],\r\n root,\r\n \"ai\",\r\n );\r\n emitUpdate(\"memory_updated\", { root });\r\n return `🧠 MEMORY.md updated`;\r\n }\r\n\r\n case \"vibedoc_create_doc\": {\r\n const docPath = String(args.path);\r\n const templateId = args.templateId ? String(args.templateId) : \"blank\";\r\n const template =\r\n TEMPLATES.find((t) => t.id === templateId) ??\r\n TEMPLATES.find((t) => t.id === \"blank\")!;\r\n await createDoc(docPath, template.content, root);\r\n emitUpdate(\"doc_created\", { path: docPath });\r\n return `✅ Created: ${docPath} (template: ${template.name})`;\r\n }\r\n\r\n case \"vibedoc_list_templates\": {\r\n return TEMPLATES.map(\r\n (t) =>\r\n `**${t.id}** — ${t.name}\\n ${t.description}\\n Default: \\`${t.defaultPath}\\``,\r\n ).join(\"\\n\\n\");\r\n }\r\n\r\n case \"vibedoc_get_context\": {\r\n const paths = args.paths as string[];\r\n const context = await getContext(paths, root);\r\n if (!context) return \"(no content — check paths are correct)\";\r\n return context;\r\n }\r\n\r\n case \"vibedoc_append_doc\": {\r\n const docPath = String(args.path);\r\n const content = String(args.content);\r\n await appendDoc(docPath, content, root);\r\n emitUpdate(\"doc_updated\", { path: docPath });\r\n return `✅ Appended to: ${docPath}`;\r\n }\r\n\r\n case \"vibedoc_rename_doc\": {\r\n const oldPath = String(args.oldPath);\r\n const newPath = String(args.newPath);\r\n await renameDoc(oldPath, newPath, root);\r\n emitUpdate(\"doc_renamed\", { oldPath, newPath });\r\n return `✅ Renamed: ${oldPath} → ${newPath}`;\r\n }\r\n\r\n case \"vibedoc_delete_doc\": {\r\n const docPath = String(args.path);\r\n await deleteDoc(docPath, root);\r\n emitUpdate(\"doc_deleted\", { path: docPath });\r\n return `✅ Deleted: ${docPath}`;\r\n }\r\n\r\n case \"vibedoc_get_file_map\": {\r\n const files = await listExplorerFiles(root);\r\n return JSON.stringify(files, null, 2);\r\n }\r\n\r\n case \"vibedoc_read_registry\": {\r\n const { content, exists } = await readRegistry(root);\r\n if (!exists)\r\n return `*(No REGISTRY.md found — call vibedoc_rebuild_registry to generate it)*`;\r\n return content;\r\n }\r\n\r\n case \"vibedoc_rebuild_registry\": {\r\n const result = await rebuildRegistry(root, \"ai\");\r\n emitUpdate(\"registry_rebuilt\", {\r\n path: result.path,\r\n totalFiles: result.totalFiles,\r\n });\r\n return `✅ Registry rebuilt: ${result.path}\\n${result.totalFiles} files indexed`;\r\n }\r\n\r\n case \"vibedoc_annotate_doc\": {\r\n const docPath = String(args.path);\r\n const description = String(args.description);\r\n const keywords = String(args.keywords);\r\n await updateRegistryAnnotation(docPath, description, keywords, root);\r\n emitUpdate(\"registry_rebuilt\", { path: \"docs/REGISTRY.md\" });\r\n return `✅ Annotation updated for: ${docPath}`;\r\n }\r\n\r\n default:\r\n throw new Error(`Unknown tool: ${name}`);\r\n }\r\n}\r\n\r\nexport async function POST(req: NextRequest) {\r\n let body: JsonRpcRequest;\r\n try {\r\n body = await req.json();\r\n } catch {\r\n return err(null, -32700, \"Parse error\");\r\n }\r\n\r\n const { id, method, params } = body;\r\n\r\n // MCP initialize\r\n if (method === \"initialize\") {\r\n return ok(id, {\r\n protocolVersion: \"2024-11-05\",\r\n capabilities: { tools: {} },\r\n serverInfo: { name: \"vibedoc\", version: \"1.0.0\" },\r\n });\r\n }\r\n\r\n // tools/list\r\n if (method === \"tools/list\") {\r\n return ok(id, { tools: TOOLS });\r\n }\r\n\r\n // tools/call\r\n if (method === \"tools/call\") {\r\n const name = (params?.name as string) || \"\";\r\n const args = (params?.arguments as Record<string, unknown>) || {};\r\n try {\r\n const text = await handleTool(name, args);\r\n return ok(id, { content: [{ type: \"text\", text }] });\r\n } catch (e: unknown) {\r\n const msg = e instanceof Error ? e.message : String(e);\r\n return ok(id, {\r\n content: [{ type: \"text\", text: `❌ ${msg}` }],\r\n isError: true,\r\n });\r\n }\r\n }\r\n\r\n return err(id, -32601, `Method not found: ${method}`);\r\n}\r\n\r\n// GET for connection test / SSE upgrade (some clients use GET)\r\nexport async function GET() {\r\n return NextResponse.json({\r\n name: \"vibedoc\",\r\n version: \"1.0.0\",\r\n status: \"ready\",\r\n tools: TOOLS.map((t) => t.name),\r\n });\r\n}\r\n","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport { addRequestMeta, getRequestMeta } from '../../server/request-meta'\nimport { getTracer, type Span, SpanKind } from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\n\nimport * as userland from 'VAR_USERLAND'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n userland,\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil: (prom: Promise<void>) => void\n }\n) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] ||\n prerenderManifest.routes[resolvedPathname]\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname])\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n\n const context: AppRouteRouteHandlerContext = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n try {\n const invokeRouteModule = async (span?: Span) => {\n return routeModule.handle(nextReq, context).finally(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n } else {\n span.updateName(`${method} ${srcPage}`)\n }\n })\n }\n const isMinimalMode = Boolean(\n process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode')\n )\n\n const handleResponse = async (currentSpan?: Span) => {\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await invokeRouteModule(currentSpan)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n response,\n context.renderOpts.pendingWaitUntil\n )\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return null\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan)\n } else {\n await tracer.withPropagatedContext(req.headers, () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n )\n )\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return null\n }\n}\n"],"names":["AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","getTracer","SpanKind","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","CachedRouteKind","userland","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","req","res","ctx","isDev","hrtime","bigint","srcPage","TURBOPACK","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isIsr","Boolean","dynamicRoutes","routes","render404","isPrerendered","prerenderInfo","fallback","experimental","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","context","renderOpts","authInterrupts","cacheComponents","incrementalCache","cacheLifeProfiles","cacheLife","onClose","cb","on","onAfterTaskError","undefined","onInstrumentationRequestError","error","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","invokeRouteModule","span","handle","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","get","handleRequest","console","warn","route","name","updateName","isMinimalMode","MINIMAL_MODE","handleResponse","currentSpan","cacheEntry","responseGenerator","previousCacheEntry","setHeader","response","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","headers","type","revalidate","collectedRevalidate","expire","collectedExpire","value","status","body","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","routeKind","isFallback","isRoutePPREnabled","Error","isMiss","delete","getHeader","set","Response","withPropagatedContext","trace","spanName","SERVER","attributes","url"],"mappings":"8CAgBA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OA0BA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,gBAaA,SAAS,EAAG,CAAwB,CAAE,CAAe,EACnD,OAAO,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,QAAS,SAAO,SAAI,CAAO,EACxD,CAEA,SAAS,EAAI,CAAwB,CAAE,CAAY,CAAE,CAAe,EAClE,OAAO,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,QAAS,SAAO,EAAI,MAAO,MAAE,UAAM,CAAQ,CAAE,EAC1E,0BAEA,IAAM,EAAQ,CACZ,CACE,KAAM,qBACN,YACE,sGACF,YAAa,CAAE,KAAM,SAAU,WAAY,CAAC,EAAG,SAAU,EAAE,AAAC,CAC9D,EACA,CACE,KAAM,mBACN,YACE,2GACF,YAAa,CACX,KAAM,SACN,WAAY,CACV,MAAO,CACL,KAAM,SACN,YAAa,oDACf,CACF,EACA,SAAU,CAAC,QAAQ,AACrB,CACF,EACA,CACE,KAAM,oBACN,YACE,oFACF,YAAa,CAAE,KAAM,SAAU,WAAY,CAAC,EA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,CACV,cAAevF,EACf,cAAe5C,EAAIoI,GAAG,AACxB,CACF,EACA7C,GAIR,CAAE,MAAOyB,EAAK,CAuBZ,GAtBMA,aAAevI,EAAAA,eAAc,EAEjC,CAFqC,KAE/BG,EAAYqF,cAAc,CAC9BjE,EACAgH,EACA,CACEE,WAAY,aACZC,UAAWrF,EACXsF,UAAW,QACXC,iBAAAA,CAAAA,EAAkBnJ,EAAAA,mBAAAA,EAAoB,oBACpCyE,uBACAlB,CACF,EACF,GACAuC,AAbiB,EAcjBxC,GAOAO,EAAO,MAAMiF,EAQjB,OALA,MAAA,CAAA,EAAM7I,EAAAA,YAAAA,EACJgG,EACAC,EACA,IAAI0D,SAAS,KAAM,CAAEpB,OAAQ,GAAI,IAE5B,IACT,CACF","ignoreList":[1]}
|
package/.next/server/chunks/_next-internal_server_app_api_registry_route_actions_9502c56c.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[70406,(a,b,c)=>{b.exports=a.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},
|
|
1
|
+
module.exports=[14747,(a,b,c)=>{b.exports=a.x("path",()=>require("path"))},70406,(a,b,c)=>{b.exports=a.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},24361,(a,b,c)=>{b.exports=a.x("util",()=>require("util"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},66515,(a,b,c)=>{"use strict";b.exports=a.r(18622)},15098,(a,b,c)=>{"use strict";b.exports=a.r(66515).vendored["react-rsc"].ReactServerDOMTurbopackServer},89138,(a,b,c)=>{"use strict";b.exports=a.r(66515).vendored["react-rsc"].ReactJsxRuntime},12649,(a,b,c)=>{"use strict";b.exports=a.r(66515).vendored["react-rsc"].React},38341,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(15098);a.n(d("[project]/node_modules/.pnpm/next@16.1.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/client/components/builtin/global-error.js <module evaluation>"))},57677,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(15098);a.n(d("[project]/node_modules/.pnpm/next@16.1.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/client/components/builtin/global-error.js"))},30328,a=>{"use strict";a.i(38341);var b=a.i(57677);a.n(b)}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__575af34a._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[14747,(a,b,c)=>{b.exports=a.x("path",()=>require("path"))},70406,(a,b,c)=>{b.exports=a.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},24361,(a,b,c)=>{b.exports=a.x("util",()=>require("util"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},66515,(a,b,c)=>{"use strict";b.exports=a.r(18622)},15098,(a,b,c)=>{"use strict";b.exports=a.r(66515).vendored["react-rsc"].ReactServerDOMTurbopackServer},89138,(a,b,c)=>{"use strict";b.exports=a.r(66515).vendored["react-rsc"].ReactJsxRuntime},12649,(a,b,c)=>{"use strict";b.exports=a.r(66515).vendored["react-rsc"].React}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__59ae98dc._.js.map
|