@seqyuan/annodex 0.1.75 → 0.1.76
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 +9 -8
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.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 +2 -2
- 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/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/runtime/route.js +2 -2
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/status/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/extensions/discover/route.js +1 -1
- package/.next/server/app/api/extensions/mcp/route.js +1 -1
- package/.next/server/app/api/extensions/plugin/route.js +1 -1
- package/.next/server/app/api/extensions/plugin-marketplace/route.js +1 -1
- package/.next/server/app/api/extensions/route.js +1 -1
- package/.next/server/app/api/extensions/session/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +1 -1
- package/.next/server/app/api/harness/route.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/im/cancel/route.js +2 -0
- package/.next/server/app/api/im/cancel/route.js.nft.json +1 -0
- package/.next/server/app/api/im/cancel/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/im/gateway-status/route.js +2 -2
- package/.next/server/app/api/im/gateway-token/route.js +2 -2
- package/.next/server/app/api/im/project/route.js +2 -2
- package/.next/server/app/api/im/projects/route.js +2 -2
- package/.next/server/app/api/im/turn/route.js +3 -3
- package/.next/server/app/api/images/upload/route.js +1 -1
- package/.next/server/app/api/internal/runtime/route.js +1 -1
- package/.next/server/app/api/memory/promote/route.js +2 -2
- package/.next/server/app/api/memory/recall/route.js +4 -4
- package/.next/server/app/api/memory/reflect/route.js +1 -1
- package/.next/server/app/api/memory/retain/route.js +2 -2
- package/.next/server/app/api/memory/status/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/projects/browse/route.js +1 -1
- package/.next/server/app/api/projects/route.js +1 -1
- package/.next/server/app/api/search/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/new/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +2 -2
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/soul/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/docs/changelog/page.js +3 -3
- package/.next/server/app/docs/changelog.html +2 -2
- package/.next/server/app/docs/changelog.rsc +1 -1
- package/.next/server/app/docs/changelog.segments/_full.segment.rsc +1 -1
- package/.next/server/app/docs/changelog.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs/changelog.segments/_index.segment.rsc +1 -1
- package/.next/server/app/docs/changelog.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/docs/changelog.segments/docs/changelog/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/docs/changelog.segments/docs/changelog.segment.rsc +1 -1
- package/.next/server/app/docs/changelog.segments/docs.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/login/page.js +2 -2
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +1 -1
- package/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/workspace/page.js +4 -4
- package/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace.html +1 -1
- package/.next/server/app/workspace.rsc +2 -2
- package/.next/server/app/workspace.segments/_full.segment.rsc +2 -2
- package/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace.segments/_index.segment.rsc +1 -1
- package/.next/server/app/workspace.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace.segments/workspace.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +9 -8
- package/.next/server/chunks/6429.js +9 -1
- package/.next/server/chunks/6983.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/Z0pq0aCwepxcXabvqbI1m/_buildManifest.js +1 -0
- package/.next/static/chunks/app/_global-error/page-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/agent/runtime/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/extensions/discover/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/extensions/mcp/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/extensions/plugin/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/extensions/plugin-marketplace/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/extensions/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/extensions/session/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/harness/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/home/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/im/cancel/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/im/gateway-status/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/im/gateway-token/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/im/project/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/im/projects/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/im/turn/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/images/upload/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/internal/runtime/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/memory/promote/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/memory/recall/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/memory/reflect/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/memory/retain/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/memory/status/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/models/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/projects/browse/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/projects/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/search/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/settings/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/skills/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/soul/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/api/version/route-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/page-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/app/workspace/{page-205fe36cdc70dc1c.js → page-5b2132873d8cc141.js} +3 -3
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-3b3b807b930186b8.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3b3b807b930186b8.js +1 -0
- package/bin/annodex-im-gateway.js +19 -0
- package/lib/im-media.js +0 -11
- package/package.json +1 -1
- package/.next/static/3bvCFCK3i_Ntk7XEeeKag/_buildManifest.js +0 -1
- package/.next/static/chunks/app/_global-error/page-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/agent/runtime/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/extensions/discover/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/extensions/mcp/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/extensions/plugin/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/extensions/plugin-marketplace/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/extensions/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/extensions/session/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/harness/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/home/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/im/gateway-status/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/im/gateway-token/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/im/project/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/im/projects/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/im/turn/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/images/upload/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/internal/runtime/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/memory/promote/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/memory/recall/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/memory/reflect/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/memory/retain/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/memory/status/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/models/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/projects/browse/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/projects/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/search/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/sessions/new/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/settings/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/skills/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/soul/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/api/version/route-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/app/page-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-e99818a566cf3a8f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-e99818a566cf3a8f.js +0 -1
- /package/.next/static/{3bvCFCK3i_Ntk7XEeeKag → Z0pq0aCwepxcXabvqbI1m}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=3412,a.ids=[3412],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},5543:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(59203),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/extensions/plugin-marketplace/route",pathname:"/api/extensions/plugin-marketplace",filename:"route",bundlePath:"app/api/extensions/plugin-marketplace/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/extensions/plugin-marketplace/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/extensions/plugin-marketplace/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},59203:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>h,dynamic:()=>i,runtime:()=>j});var e=c(23211),f=c(98118),g=a([f]);f=(g.then?(await g)():g)[0];let i="force-dynamic",j="nodejs";async function h(a){try{let b=await a.json();if(!b.name?.trim())return e.NextResponse.json({error:"name is required"},{status:400});if("remove"===b.action){let a=await (0,f.ut)(b.name.trim());return e.NextResponse.json({success:!0,output:a})}if(!b.source?.trim())return e.NextResponse.json({error:"source is required"},{status:400});let c=await (0,f.bW)({name:b.name.trim(),source:b.source.trim(),ref:b.ref?.trim()||void 0});return e.NextResponse.json({success:!0,output:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},98118:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{BJ:()=>r,KA:()=>v,Ot:()=>p,QX:()=>u,XO:()=>q,a_:()=>n,bW:()=>s,d:()=>o,ut:()=>t,zw:()=>w});var e=c(79646),f=c(55132),g=c(46983),h=a([g]);function i(a){return(0,e.execFileSync)("codex",a,{encoding:"utf8",stdio:["ignore","pipe","pipe"],env:process.env})}function j(a){return a.split(/\r?\n/).map(a=>a.trimEnd()).filter(Boolean)}function k(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}async function l(a,b){let c=(0,f.Dw)(),d=await (0,g.gu)(a??process.cwd(),(0,g.H3)(c.providers));try{return await b((a,b)=>d.request(a,b))}finally{(0,g.sM)(d)}}function m(a){let b=[];for(let c of a??[]){let a="string"==typeof c.name?c.name:"",d="string"==typeof c.path?c.path:"";for(let e of c.plugins??[]){let c="string"==typeof e.name?e.name:"";if(!c)continue;let f="string"==typeof e.id&&e.id?e.id:a?`${c}@${a}`:c;b.push({plugin:f,name:c,marketplace:a,status:e.installed?"installed":"not installed",version:"string"==typeof e.localVersion?e.localVersion:"",path:d})}}return b}async function n(a){try{let b=await l(a,async a=>a("mcpServerStatus/list",{detail:"toolsAndAuthOnly"}));return(k(b)&&Array.isArray(b.data)?b.data:[]).map(a=>({name:"string"==typeof a.name?a.name:""})).filter(a=>a.name.length>0)}catch{let a=i(["mcp","list"]);if(/No MCP servers configured yet/i.test(a))return[];return j(a).filter(a=>!/^Name\s+/i.test(a)).map(a=>a.trim()).filter(Boolean).map(a=>({name:a}))}}async function o(a,b){try{let c=await l(b,async a=>a("mcpServerStatus/list",{detail:"full"})),d=(k(c)&&Array.isArray(c.data)?c.data:[]).find(b=>b.name===a);if(!d)return null;return{name:a,raw:d}}catch{try{let b=i(["mcp","get",a,"--json"]);return{name:a,raw:JSON.parse(b)}}catch{return null}}}async function p(a){let b=["mcp","add",a.name];if("http"===a.transport.type)b.push("--url",a.transport.url);else{for(let[c,d]of Object.entries(a.env??{}))b.push("--env",`${c}=${d}`);b.push("--",a.transport.command,...a.transport.args??[])}let c=i(b);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return c}async function q(a){let b=i(["mcp","remove",a]);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return b}async function r(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return(b?.marketplaces??[]).map(a=>({name:"string"==typeof a.name?a.name:"",root:"string"==typeof a.path?a.path:""})).filter(a=>a.name.length>0)}catch{let a=i(["plugin","marketplace","list"]);return j(a).filter(a=>!/^MARKETPLACE\s+ROOT\s*$/i.test(a)).map(a=>{let b=a.match(/^(\S+)\s+(\/.*)$/);return b?{name:b[1],root:b[2]}:null}).filter(a=>null!==a)}}async function s(a){try{return await l(void 0,async b=>b("marketplace/add",{source:a.source,...a.ref?{refName:a.ref}:{}}))}catch{let b=["plugin","marketplace","add",a.source];return a.ref&&b.push("--ref",a.ref),i(b)}}async function t(a){try{return await l(void 0,async b=>b("marketplace/remove",{name:a}))}catch{return i(["plugin","marketplace","remove",a])}}async function u(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{try{let b=await l(a,async b=>b("plugin/list",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{let a=i(["plugin","list"]),b=[];for(let c of j(a)){if(/^Marketplace\s+`/.test(c)||/^\/.*marketplace\.json$/.test(c)||/^PLUGIN\s+STATUS\s+VERSION\s+PATH/.test(c))continue;let a=c.match(/^(\S+)\s{2,}(installed|not installed)\s{2,}(\S*)\s{2,}(\/.*)$/i);if(!a)continue;let d=a[1],[e,f=""]=d.split("@");b.push({plugin:d,name:e,marketplace:f,status:a[2],version:a[3]||"",path:a[4]})}return b}}}async function v(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/install",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","add",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}async function w(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/uninstall",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","remove",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983],()=>b(b.s=5543));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=3412,a.ids=[3412],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19072:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(59203),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/extensions/plugin-marketplace/route",pathname:"/api/extensions/plugin-marketplace",filename:"route",bundlePath:"app/api/extensions/plugin-marketplace/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/extensions/plugin-marketplace/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/extensions/plugin-marketplace/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},59203:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>h,dynamic:()=>i,runtime:()=>j});var e=c(23211),f=c(98118),g=a([f]);f=(g.then?(await g)():g)[0];let i="force-dynamic",j="nodejs";async function h(a){try{let b=await a.json();if(!b.name?.trim())return e.NextResponse.json({error:"name is required"},{status:400});if("remove"===b.action){let a=await (0,f.ut)(b.name.trim());return e.NextResponse.json({success:!0,output:a})}if(!b.source?.trim())return e.NextResponse.json({error:"source is required"},{status:400});let c=await (0,f.bW)({name:b.name.trim(),source:b.source.trim(),ref:b.ref?.trim()||void 0});return e.NextResponse.json({success:!0,output:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},98118:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{BJ:()=>r,KA:()=>v,Ot:()=>p,QX:()=>u,XO:()=>q,a_:()=>n,bW:()=>s,d:()=>o,ut:()=>t,zw:()=>w});var e=c(79646),f=c(55132),g=c(46983),h=a([g]);function i(a){return(0,e.execFileSync)("codex",a,{encoding:"utf8",stdio:["ignore","pipe","pipe"],env:process.env})}function j(a){return a.split(/\r?\n/).map(a=>a.trimEnd()).filter(Boolean)}function k(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}async function l(a,b){let c=(0,f.Dw)(),d=await (0,g.gu)(a??process.cwd(),(0,g.H3)(c.providers));try{return await b((a,b)=>d.request(a,b))}finally{(0,g.sM)(d)}}function m(a){let b=[];for(let c of a??[]){let a="string"==typeof c.name?c.name:"",d="string"==typeof c.path?c.path:"";for(let e of c.plugins??[]){let c="string"==typeof e.name?e.name:"";if(!c)continue;let f="string"==typeof e.id&&e.id?e.id:a?`${c}@${a}`:c;b.push({plugin:f,name:c,marketplace:a,status:e.installed?"installed":"not installed",version:"string"==typeof e.localVersion?e.localVersion:"",path:d})}}return b}async function n(a){try{let b=await l(a,async a=>a("mcpServerStatus/list",{detail:"toolsAndAuthOnly"}));return(k(b)&&Array.isArray(b.data)?b.data:[]).map(a=>({name:"string"==typeof a.name?a.name:""})).filter(a=>a.name.length>0)}catch{let a=i(["mcp","list"]);if(/No MCP servers configured yet/i.test(a))return[];return j(a).filter(a=>!/^Name\s+/i.test(a)).map(a=>a.trim()).filter(Boolean).map(a=>({name:a}))}}async function o(a,b){try{let c=await l(b,async a=>a("mcpServerStatus/list",{detail:"full"})),d=(k(c)&&Array.isArray(c.data)?c.data:[]).find(b=>b.name===a);if(!d)return null;return{name:a,raw:d}}catch{try{let b=i(["mcp","get",a,"--json"]);return{name:a,raw:JSON.parse(b)}}catch{return null}}}async function p(a){let b=["mcp","add",a.name];if("http"===a.transport.type)b.push("--url",a.transport.url);else{for(let[c,d]of Object.entries(a.env??{}))b.push("--env",`${c}=${d}`);b.push("--",a.transport.command,...a.transport.args??[])}let c=i(b);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return c}async function q(a){let b=i(["mcp","remove",a]);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return b}async function r(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return(b?.marketplaces??[]).map(a=>({name:"string"==typeof a.name?a.name:"",root:"string"==typeof a.path?a.path:""})).filter(a=>a.name.length>0)}catch{let a=i(["plugin","marketplace","list"]);return j(a).filter(a=>!/^MARKETPLACE\s+ROOT\s*$/i.test(a)).map(a=>{let b=a.match(/^(\S+)\s+(\/.*)$/);return b?{name:b[1],root:b[2]}:null}).filter(a=>null!==a)}}async function s(a){try{return await l(void 0,async b=>b("marketplace/add",{source:a.source,...a.ref?{refName:a.ref}:{}}))}catch{let b=["plugin","marketplace","add",a.source];return a.ref&&b.push("--ref",a.ref),i(b)}}async function t(a){try{return await l(void 0,async b=>b("marketplace/remove",{name:a}))}catch{return i(["plugin","marketplace","remove",a])}}async function u(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{try{let b=await l(a,async b=>b("plugin/list",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{let a=i(["plugin","list"]),b=[];for(let c of j(a)){if(/^Marketplace\s+`/.test(c)||/^\/.*marketplace\.json$/.test(c)||/^PLUGIN\s+STATUS\s+VERSION\s+PATH/.test(c))continue;let a=c.match(/^(\S+)\s{2,}(installed|not installed)\s{2,}(\S*)\s{2,}(\/.*)$/i);if(!a)continue;let d=a[1],[e,f=""]=d.split("@");b.push({plugin:d,name:e,marketplace:f,status:a[2],version:a[3]||"",path:a[4]})}return b}}}async function v(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/install",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","add",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}async function w(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/uninstall",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","remove",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983],()=>b(b.s=19072));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=4352,a.ids=[4352],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74299:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>n,PUT:()=>o,dynamic:()=>p,runtime:()=>q});var e=c(23211),f=c(29021),g=c(75120),h=c(98118),i=a([h]);h=(i.then?(await i)():i)[0];let p="force-dynamic",q="nodejs";function j(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function k(a){return"string"==typeof a&&a.trim()?a.trim():null}function l(a,b){if(!j(a))return null;let c=k(a.id),d=k(a.name);if(!c||!d)return null;let e=j(a.transport)?a.transport:{},f="http"===e.type?"http":"stdio";return{id:c,name:d,description:"string"==typeof a.description?a.description:void 0,source:"string"==typeof a.source?a.source:void 0,enabled:"boolean"==typeof a.enabled?a.enabled:void 0,scope:b,installPath:"string"==typeof a.installPath?a.installPath:void 0,transport:{type:f,command:"string"==typeof e.command?e.command:void 0,args:Array.isArray(e.args)?e.args.filter(a=>"string"==typeof a):void 0,url:"string"==typeof e.url?e.url:void 0},env:j(a.env)?Object.fromEntries(Object.entries(a.env).filter(([,a])=>"string"==typeof a)):void 0,notes:"string"==typeof a.notes?a.notes:void 0}}async function m(a){if(!1!==a.enabled){if("http"===a.transport.type){if(!a.transport.url?.trim())return;await (0,h.Ot)({name:a.id,transport:{type:"http",url:a.transport.url.trim()}});return}a.transport.command?.trim()&&await (0,h.Ot)({name:a.id,transport:{type:"stdio",command:a.transport.command.trim(),args:a.transport.args??[]},env:a.env})}}async function n(a){let b=new URL(a.url),c=b.searchParams.get("cwd")?.trim()||null;return e.NextResponse.json({extensions:(0,g.nD)(c),sources:{global:(0,g.YJ)(),project:c?(0,g.wf)(c):{extensions:[]},globalPath:(0,g.d2)(),projectPath:c?(0,g.N8)(c):null}})}async function o(a){try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd:null,d="project"===b.scope?"project":"global",h="project"===d?c?(0,g.N8)(c):null:(0,g.d2)();if(!h)return e.NextResponse.json({error:"cwd is required for project extensions"},{status:400});if("project"===d&&c&&!(0,f.existsSync)(c))return e.NextResponse.json({error:`Directory does not exist: ${c}`},{status:400});if(b.extension){let a=l(b.extension,d);if(!a)return e.NextResponse.json({error:"Invalid extension"},{status:400});let c=(0,g.NR)(h,a);return await m(a),e.NextResponse.json({success:!0,extensions:c.extensions})}if(Array.isArray(b.extensions)){let a=b.extensions.map(a=>l(a,d)).filter(a=>null!==a);return(0,g.In)(h,{extensions:a}),await Promise.all(a.map(a=>m(a))),e.NextResponse.json({success:!0,extensions:a})}return e.NextResponse.json({error:"extension or extensions required"},{status:400})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},75120:(a,b,c)=>{c.d(b,{E9:()=>r,IE:()=>p,In:()=>m,N8:()=>h,NR:()=>n,YJ:()=>k,d2:()=>g,nD:()=>o,wf:()=>l});var d=c(29021),e=c(33873),f=c(21820);function g(){return(0,e.join)(process.env.ANNODEX_CONFIG_DIR??process.env.ANNOVIBE_CONFIG_DIR??(0,e.join)((0,f.homedir)(),".config","annodex"),"extensions.json")}function h(a){return(0,e.join)(a,".codex","extensions.json")}function i(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function j(a){let b=function(a){if(!(0,d.existsSync)(a))return null;try{return JSON.parse((0,d.readFileSync)(a,"utf-8"))}catch{return null}}(a),c=i(b)&&Array.isArray(b.extensions)?b.extensions:[],e=a.replace(/\\/g,"/").endsWith("/.codex/extensions.json")?"project":"global";return{extensions:c.map(a=>(function(a,b){var c;if(!i(a))return null;let d="string"==typeof a.id?a.id.trim():"",e="string"==typeof a.name?a.name.trim():"";return d&&e?{id:d,name:e,description:"string"==typeof a.description?a.description:void 0,source:"string"==typeof a.source?a.source:void 0,enabled:"boolean"==typeof a.enabled?a.enabled:void 0,scope:"project"===a.scope?"project":b,installPath:"string"==typeof a.installPath?a.installPath:void 0,transport:i(c=a.transport)?{type:"http"===c.type?"http":"stdio",command:"string"==typeof c.command?c.command:void 0,args:Array.isArray(c.args)?c.args.filter(a=>"string"==typeof a):void 0,url:"string"==typeof c.url?c.url:void 0}:{type:"stdio"},env:i(a.env)?Object.fromEntries(Object.entries(a.env).filter(([,a])=>"string"==typeof a)):void 0,notes:"string"==typeof a.notes?a.notes:void 0}:null})(a,e)).filter(a=>null!==a)}}function k(){return j(g())}function l(a){return j(h(a))}function m(a,b){let c;return c=(0,e.dirname)(a),(0,d.existsSync)(c)||(0,d.mkdirSync)(c,{recursive:!0}),(0,d.writeFileSync)(a,JSON.stringify({extensions:b.extensions},null,2),"utf-8"),b}function n(a,b){let c=j(a).extensions.filter(a=>a.id!==b.id).concat(b);return m(a,{extensions:c})}function o(a){let b=k().extensions.map(a=>({...a,scope:a.scope??"global"}));if(!a)return b;let c=l(a).extensions.map(a=>({...a,scope:"project"})),d=new Map;for(let a of b)d.set(a.id,a);for(let a of c)d.set(a.id,{...d.get(a.id),...a,scope:"project"});return[...d.values()].sort((a,b)=>a.name.localeCompare(b.name))}function p(a){return o(a).filter(a=>!1!==a.enabled)}let q="annodex-memory";function r(){let a=g(),b=j(a).extensions.find(a=>a.id===q);if(b)return b;let c=function(a="global"){return{id:q,name:"Annodex Memory",description:"Project working memory tools: retain, recall, reflect",scope:a,enabled:!0,source:"annodex",transport:{type:"stdio",command:"annodex-memory-mcp",args:[]},notes:"Requires annodex to be running. Stores JSONL working memory under ~/.config/annodex/memory/."}}("global");return n(a,c),c}},79646:a=>{a.exports=require("child_process")},80259:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(74299),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/extensions/route",pathname:"/api/extensions",filename:"route",bundlePath:"app/api/extensions/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/extensions/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/extensions/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},98118:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{BJ:()=>r,KA:()=>v,Ot:()=>p,QX:()=>u,XO:()=>q,a_:()=>n,bW:()=>s,d:()=>o,ut:()=>t,zw:()=>w});var e=c(79646),f=c(55132),g=c(46983),h=a([g]);function i(a){return(0,e.execFileSync)("codex",a,{encoding:"utf8",stdio:["ignore","pipe","pipe"],env:process.env})}function j(a){return a.split(/\r?\n/).map(a=>a.trimEnd()).filter(Boolean)}function k(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}async function l(a,b){let c=(0,f.Dw)(),d=await (0,g.gu)(a??process.cwd(),(0,g.H3)(c.providers));try{return await b((a,b)=>d.request(a,b))}finally{(0,g.sM)(d)}}function m(a){let b=[];for(let c of a??[]){let a="string"==typeof c.name?c.name:"",d="string"==typeof c.path?c.path:"";for(let e of c.plugins??[]){let c="string"==typeof e.name?e.name:"";if(!c)continue;let f="string"==typeof e.id&&e.id?e.id:a?`${c}@${a}`:c;b.push({plugin:f,name:c,marketplace:a,status:e.installed?"installed":"not installed",version:"string"==typeof e.localVersion?e.localVersion:"",path:d})}}return b}async function n(a){try{let b=await l(a,async a=>a("mcpServerStatus/list",{detail:"toolsAndAuthOnly"}));return(k(b)&&Array.isArray(b.data)?b.data:[]).map(a=>({name:"string"==typeof a.name?a.name:""})).filter(a=>a.name.length>0)}catch{let a=i(["mcp","list"]);if(/No MCP servers configured yet/i.test(a))return[];return j(a).filter(a=>!/^Name\s+/i.test(a)).map(a=>a.trim()).filter(Boolean).map(a=>({name:a}))}}async function o(a,b){try{let c=await l(b,async a=>a("mcpServerStatus/list",{detail:"full"})),d=(k(c)&&Array.isArray(c.data)?c.data:[]).find(b=>b.name===a);if(!d)return null;return{name:a,raw:d}}catch{try{let b=i(["mcp","get",a,"--json"]);return{name:a,raw:JSON.parse(b)}}catch{return null}}}async function p(a){let b=["mcp","add",a.name];if("http"===a.transport.type)b.push("--url",a.transport.url);else{for(let[c,d]of Object.entries(a.env??{}))b.push("--env",`${c}=${d}`);b.push("--",a.transport.command,...a.transport.args??[])}let c=i(b);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return c}async function q(a){let b=i(["mcp","remove",a]);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return b}async function r(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return(b?.marketplaces??[]).map(a=>({name:"string"==typeof a.name?a.name:"",root:"string"==typeof a.path?a.path:""})).filter(a=>a.name.length>0)}catch{let a=i(["plugin","marketplace","list"]);return j(a).filter(a=>!/^MARKETPLACE\s+ROOT\s*$/i.test(a)).map(a=>{let b=a.match(/^(\S+)\s+(\/.*)$/);return b?{name:b[1],root:b[2]}:null}).filter(a=>null!==a)}}async function s(a){try{return await l(void 0,async b=>b("marketplace/add",{source:a.source,...a.ref?{refName:a.ref}:{}}))}catch{let b=["plugin","marketplace","add",a.source];return a.ref&&b.push("--ref",a.ref),i(b)}}async function t(a){try{return await l(void 0,async b=>b("marketplace/remove",{name:a}))}catch{return i(["plugin","marketplace","remove",a])}}async function u(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{try{let b=await l(a,async b=>b("plugin/list",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{let a=i(["plugin","list"]),b=[];for(let c of j(a)){if(/^Marketplace\s+`/.test(c)||/^\/.*marketplace\.json$/.test(c)||/^PLUGIN\s+STATUS\s+VERSION\s+PATH/.test(c))continue;let a=c.match(/^(\S+)\s{2,}(installed|not installed)\s{2,}(\S*)\s{2,}(\/.*)$/i);if(!a)continue;let d=a[1],[e,f=""]=d.split("@");b.push({plugin:d,name:e,marketplace:f,status:a[2],version:a[3]||"",path:a[4]})}return b}}}async function v(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/install",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","add",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}async function w(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/uninstall",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","remove",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983],()=>b(b.s=80259));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=4352,a.ids=[4352],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47212:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(74299),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/extensions/route",pathname:"/api/extensions",filename:"route",bundlePath:"app/api/extensions/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/extensions/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/extensions/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74299:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>n,PUT:()=>o,dynamic:()=>p,runtime:()=>q});var e=c(23211),f=c(29021),g=c(75120),h=c(98118),i=a([h]);h=(i.then?(await i)():i)[0];let p="force-dynamic",q="nodejs";function j(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function k(a){return"string"==typeof a&&a.trim()?a.trim():null}function l(a,b){if(!j(a))return null;let c=k(a.id),d=k(a.name);if(!c||!d)return null;let e=j(a.transport)?a.transport:{},f="http"===e.type?"http":"stdio";return{id:c,name:d,description:"string"==typeof a.description?a.description:void 0,source:"string"==typeof a.source?a.source:void 0,enabled:"boolean"==typeof a.enabled?a.enabled:void 0,scope:b,installPath:"string"==typeof a.installPath?a.installPath:void 0,transport:{type:f,command:"string"==typeof e.command?e.command:void 0,args:Array.isArray(e.args)?e.args.filter(a=>"string"==typeof a):void 0,url:"string"==typeof e.url?e.url:void 0},env:j(a.env)?Object.fromEntries(Object.entries(a.env).filter(([,a])=>"string"==typeof a)):void 0,notes:"string"==typeof a.notes?a.notes:void 0}}async function m(a){if(!1!==a.enabled){if("http"===a.transport.type){if(!a.transport.url?.trim())return;await (0,h.Ot)({name:a.id,transport:{type:"http",url:a.transport.url.trim()}});return}a.transport.command?.trim()&&await (0,h.Ot)({name:a.id,transport:{type:"stdio",command:a.transport.command.trim(),args:a.transport.args??[]},env:a.env})}}async function n(a){let b=new URL(a.url),c=b.searchParams.get("cwd")?.trim()||null;return e.NextResponse.json({extensions:(0,g.nD)(c),sources:{global:(0,g.YJ)(),project:c?(0,g.wf)(c):{extensions:[]},globalPath:(0,g.d2)(),projectPath:c?(0,g.N8)(c):null}})}async function o(a){try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd:null,d="project"===b.scope?"project":"global",h="project"===d?c?(0,g.N8)(c):null:(0,g.d2)();if(!h)return e.NextResponse.json({error:"cwd is required for project extensions"},{status:400});if("project"===d&&c&&!(0,f.existsSync)(c))return e.NextResponse.json({error:`Directory does not exist: ${c}`},{status:400});if(b.extension){let a=l(b.extension,d);if(!a)return e.NextResponse.json({error:"Invalid extension"},{status:400});let c=(0,g.NR)(h,a);return await m(a),e.NextResponse.json({success:!0,extensions:c.extensions})}if(Array.isArray(b.extensions)){let a=b.extensions.map(a=>l(a,d)).filter(a=>null!==a);return(0,g.In)(h,{extensions:a}),await Promise.all(a.map(a=>m(a))),e.NextResponse.json({success:!0,extensions:a})}return e.NextResponse.json({error:"extension or extensions required"},{status:400})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},75120:(a,b,c)=>{c.d(b,{E9:()=>r,IE:()=>p,In:()=>m,N8:()=>h,NR:()=>n,YJ:()=>k,d2:()=>g,nD:()=>o,wf:()=>l});var d=c(29021),e=c(33873),f=c(21820);function g(){return(0,e.join)(process.env.ANNODEX_CONFIG_DIR??process.env.ANNOVIBE_CONFIG_DIR??(0,e.join)((0,f.homedir)(),".config","annodex"),"extensions.json")}function h(a){return(0,e.join)(a,".codex","extensions.json")}function i(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function j(a){let b=function(a){if(!(0,d.existsSync)(a))return null;try{return JSON.parse((0,d.readFileSync)(a,"utf-8"))}catch{return null}}(a),c=i(b)&&Array.isArray(b.extensions)?b.extensions:[],e=a.replace(/\\/g,"/").endsWith("/.codex/extensions.json")?"project":"global";return{extensions:c.map(a=>(function(a,b){var c;if(!i(a))return null;let d="string"==typeof a.id?a.id.trim():"",e="string"==typeof a.name?a.name.trim():"";return d&&e?{id:d,name:e,description:"string"==typeof a.description?a.description:void 0,source:"string"==typeof a.source?a.source:void 0,enabled:"boolean"==typeof a.enabled?a.enabled:void 0,scope:"project"===a.scope?"project":b,installPath:"string"==typeof a.installPath?a.installPath:void 0,transport:i(c=a.transport)?{type:"http"===c.type?"http":"stdio",command:"string"==typeof c.command?c.command:void 0,args:Array.isArray(c.args)?c.args.filter(a=>"string"==typeof a):void 0,url:"string"==typeof c.url?c.url:void 0}:{type:"stdio"},env:i(a.env)?Object.fromEntries(Object.entries(a.env).filter(([,a])=>"string"==typeof a)):void 0,notes:"string"==typeof a.notes?a.notes:void 0}:null})(a,e)).filter(a=>null!==a)}}function k(){return j(g())}function l(a){return j(h(a))}function m(a,b){let c;return c=(0,e.dirname)(a),(0,d.existsSync)(c)||(0,d.mkdirSync)(c,{recursive:!0}),(0,d.writeFileSync)(a,JSON.stringify({extensions:b.extensions},null,2),"utf-8"),b}function n(a,b){let c=j(a).extensions.filter(a=>a.id!==b.id).concat(b);return m(a,{extensions:c})}function o(a){let b=k().extensions.map(a=>({...a,scope:a.scope??"global"}));if(!a)return b;let c=l(a).extensions.map(a=>({...a,scope:"project"})),d=new Map;for(let a of b)d.set(a.id,a);for(let a of c)d.set(a.id,{...d.get(a.id),...a,scope:"project"});return[...d.values()].sort((a,b)=>a.name.localeCompare(b.name))}function p(a){return o(a).filter(a=>!1!==a.enabled)}let q="annodex-memory";function r(){let a=g(),b=j(a).extensions.find(a=>a.id===q);if(b)return b;let c=function(a="global"){return{id:q,name:"Annodex Memory",description:"Project working memory tools: retain, recall, reflect",scope:a,enabled:!0,source:"annodex",transport:{type:"stdio",command:"annodex-memory-mcp",args:[]},notes:"Requires annodex to be running. Stores JSONL working memory under ~/.config/annodex/memory/."}}("global");return n(a,c),c}},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},98118:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{BJ:()=>r,KA:()=>v,Ot:()=>p,QX:()=>u,XO:()=>q,a_:()=>n,bW:()=>s,d:()=>o,ut:()=>t,zw:()=>w});var e=c(79646),f=c(55132),g=c(46983),h=a([g]);function i(a){return(0,e.execFileSync)("codex",a,{encoding:"utf8",stdio:["ignore","pipe","pipe"],env:process.env})}function j(a){return a.split(/\r?\n/).map(a=>a.trimEnd()).filter(Boolean)}function k(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}async function l(a,b){let c=(0,f.Dw)(),d=await (0,g.gu)(a??process.cwd(),(0,g.H3)(c.providers));try{return await b((a,b)=>d.request(a,b))}finally{(0,g.sM)(d)}}function m(a){let b=[];for(let c of a??[]){let a="string"==typeof c.name?c.name:"",d="string"==typeof c.path?c.path:"";for(let e of c.plugins??[]){let c="string"==typeof e.name?e.name:"";if(!c)continue;let f="string"==typeof e.id&&e.id?e.id:a?`${c}@${a}`:c;b.push({plugin:f,name:c,marketplace:a,status:e.installed?"installed":"not installed",version:"string"==typeof e.localVersion?e.localVersion:"",path:d})}}return b}async function n(a){try{let b=await l(a,async a=>a("mcpServerStatus/list",{detail:"toolsAndAuthOnly"}));return(k(b)&&Array.isArray(b.data)?b.data:[]).map(a=>({name:"string"==typeof a.name?a.name:""})).filter(a=>a.name.length>0)}catch{let a=i(["mcp","list"]);if(/No MCP servers configured yet/i.test(a))return[];return j(a).filter(a=>!/^Name\s+/i.test(a)).map(a=>a.trim()).filter(Boolean).map(a=>({name:a}))}}async function o(a,b){try{let c=await l(b,async a=>a("mcpServerStatus/list",{detail:"full"})),d=(k(c)&&Array.isArray(c.data)?c.data:[]).find(b=>b.name===a);if(!d)return null;return{name:a,raw:d}}catch{try{let b=i(["mcp","get",a,"--json"]);return{name:a,raw:JSON.parse(b)}}catch{return null}}}async function p(a){let b=["mcp","add",a.name];if("http"===a.transport.type)b.push("--url",a.transport.url);else{for(let[c,d]of Object.entries(a.env??{}))b.push("--env",`${c}=${d}`);b.push("--",a.transport.command,...a.transport.args??[])}let c=i(b);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return c}async function q(a){let b=i(["mcp","remove",a]);try{await l(void 0,async a=>a("config/mcpServer/reload"))}catch{}return b}async function r(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return(b?.marketplaces??[]).map(a=>({name:"string"==typeof a.name?a.name:"",root:"string"==typeof a.path?a.path:""})).filter(a=>a.name.length>0)}catch{let a=i(["plugin","marketplace","list"]);return j(a).filter(a=>!/^MARKETPLACE\s+ROOT\s*$/i.test(a)).map(a=>{let b=a.match(/^(\S+)\s+(\/.*)$/);return b?{name:b[1],root:b[2]}:null}).filter(a=>null!==a)}}async function s(a){try{return await l(void 0,async b=>b("marketplace/add",{source:a.source,...a.ref?{refName:a.ref}:{}}))}catch{let b=["plugin","marketplace","add",a.source];return a.ref&&b.push("--ref",a.ref),i(b)}}async function t(a){try{return await l(void 0,async b=>b("marketplace/remove",{name:a}))}catch{return i(["plugin","marketplace","remove",a])}}async function u(a){try{let b=await l(a,async b=>b("plugin/installed",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{try{let b=await l(a,async b=>b("plugin/list",{cwds:a?[a]:void 0}));return m(b?.marketplaces)}catch{let a=i(["plugin","list"]),b=[];for(let c of j(a)){if(/^Marketplace\s+`/.test(c)||/^\/.*marketplace\.json$/.test(c)||/^PLUGIN\s+STATUS\s+VERSION\s+PATH/.test(c))continue;let a=c.match(/^(\S+)\s{2,}(installed|not installed)\s{2,}(\S*)\s{2,}(\/.*)$/i);if(!a)continue;let d=a[1],[e,f=""]=d.split("@");b.push({plugin:d,name:e,marketplace:f,status:a[2],version:a[3]||"",path:a[4]})}return b}}}async function v(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/install",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","add",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}async function w(a){let[b,c]=a.plugin.includes("@")?a.plugin.split("@"):[a.plugin,a.marketplace];try{return await l(void 0,async a=>a("plugin/uninstall",{pluginName:b,...c?{remoteMarketplaceName:c}:{}}))}catch{let b=["plugin","remove",a.plugin];return a.marketplace&&!a.plugin.includes("@")&&b.push("--marketplace",a.marketplace),i(b)}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983],()=>b(b.s=47212));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=9949,a.ids=[9949],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},
|
|
1
|
+
"use strict";(()=>{var a={};a.id=9949,a.ids=[9949],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1446:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(9028),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/extensions/session/route",pathname:"/api/extensions/session",filename:"route",bundlePath:"app/api/extensions/session/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/extensions/session/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/extensions/session/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},9028:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>j});var e=c(23211),f=c(29021),g=c(40402),h=c(56429),i=a([g,h]);async function j(a){try{let b=await a.json(),c="string"==typeof b.sessionId?b.sessionId:"";if(!c)return e.NextResponse.json({error:"sessionId is required"},{status:400});let d=Array.isArray(b.enabledExtensions)?b.enabledExtensions.filter(a=>"string"==typeof a):null;if(!d)return e.NextResponse.json({error:"enabledExtensions must be an array of strings"},{status:400});let i=(0,h.A4)(c);if(i?.isAlive()){let a=await i.send({type:"set_enabled_extensions",ids:d});return e.NextResponse.json({success:!0,data:a})}let j=await (0,g.os)(c);if(!j)return e.NextResponse.json({error:"Session not found"},{status:404});if(!function(a){try{return(0,f.statSync)(a).isDirectory()}catch{return!1}}(j))return e.NextResponse.json({error:`Project directory no longer exists: ${j}`},{status:400});let{session:k,realSessionId:l}=await (0,h.OF)(c,c,j),m=await k.send({type:"set_enabled_extensions",ids:d});return e.NextResponse.json({success:!0,data:m,...l!==c?{sessionId:l}:{}})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[g,h]=i.then?(await i)():i,d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983,402,6429],()=>b(b.s=1446));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";(()=>{var a={};a.id=4037,a.ids=[4037],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1304:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>x,POST:()=>z,PUT:()=>y});var e=c(23211),f=c(29021),g=c.n(f),h=c(33873),i=c.n(h),j=c(40402),k=a([j]);j=(k.then?(await k)():k)[0];let A=new Set(["node_modules",".git",".next","dist","build","__pycache__",".turbo",".cache","coverage",".pytest_cache",".mypy_cache","target","vendor",".DS_Store",".annodex-uploads"]),B=[".pyc"],C={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif"},D={mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",oga:"audio/ogg",opus:"audio/ogg",m4a:"audio/mp4",aac:"audio/aac",flac:"audio/flac",weba:"audio/webm",webm:"audio/webm"},E={pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",xls:"application/vnd.ms-excel",doc:"application/msword",ppt:"application/vnd.ms-powerpoint"};function l(a){return i().basename(a).toLowerCase().split(".").pop()??""}function m(a){return C[l(a)]??null}function n(a){return D[l(a)]??null}function o(a){return E[l(a)]??null}let F={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",html:"html",htm:"html",css:"css",scss:"css",less:"css",json:"json",jsonl:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",md:"markdown",mdx:"markdown",csv:"csv",tsv:"tsv",log:"text",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",tf:"hcl",hcl:"hcl",env:"bash",gitignore:"bash",txt:"text"};function p(a){let b=l(a);return"csv"===b||"tsv"===b||"md"===b||"mdx"===b||"txt"===b||"log"===b?2097152:262144}function q(a){return"object"==typeof a&&null!==a&&"name"in a&&"size"in a&&"arrayBuffer"in a}let G=/^[a-zA-Z]:[\\/]/;function r(a){return G.test(a)||a.startsWith("\\\\")||a.startsWith("//")}function s(a){let b=a.join("/"),c=b.replace(/\\/g,"/");return r(c)?c:"/"+b.replace(/^\/+/,"")}async function t(){let a=Date.now(),b=globalThis.__annodexAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let d=await (0,j.dQ)(),e=new Set;for(let a of d)a.cwd&&e.add(a.cwd);let f=(await Promise.resolve().then(c.t.bind(c,21820,23))).homedir(),{existsSync:g,readFileSync:h,readdirSync:k}=await Promise.resolve().then(c.t.bind(c,29021,23));for(let a of[i().join(f,".config","annodex","annodex-projects.json"),i().join(f,".config","annodex","annovibe-projects.json")])if(g(a))try{let b=JSON.parse(h(a,"utf8"));for(let[a,c]of Object.entries(b.projects??{})){if(c?.hidden===!0)continue;let b="string"==typeof c?.cwd?c.cwd:a;b&&e.add(b)}}catch{}for(let a of[i().join(f,"annodex","workspace"),i().join(f,"annovibe","workspace")])g(a)&&e.add(a);try{for(let a of k(f))/^pi-cwd-\d{8}$/.test(a)&&e.add(i().join(f,a))}catch{}return globalThis.__annodexAllowedRootsCache={roots:e,expiresAt:a+5e3},e}function u(a,b){for(let c of b){let b=r(a)||r(c),d=b?i().win32:i(),e=b?"\\":i().sep,f=d.resolve(a),g=d.resolve(c),h=b?f.toLowerCase():f,j=b?g.toLowerCase():g,k=j.endsWith(e)?j:j+e;if(h===j||h.startsWith(k))return!0}return!1}function v(a,b){let c=g().createReadStream(a,b),d=!1;return new ReadableStream({start(a){c.on("data",b=>{if(!d)try{a.enqueue(new Uint8Array(b))}catch{d=!0,c.destroy()}}),c.once("end",()=>{if(!d){d=!0;try{a.close()}catch{}}}),c.once("error",b=>{if(!d){d=!0;try{a.error(b)}catch{}}})},cancel(){d=!0,c.destroy()}})}function w(a,b,c,d){let e={"Content-Type":c,"Cache-Control":"no-cache","Accept-Ranges":"bytes"};if(!d)return new Response(v(a),{headers:{...e,"Content-Length":String(b.size)}});let f=/^bytes=(\d*)-(\d*)$/.exec(d);if(!f)return new Response(null,{status:416,headers:{...e,"Content-Range":`bytes */${b.size}`}});let g=f[1]?Number(f[1]):0,h=f[2]?Number(f[2]):b.size-1;if(!f[1]&&f[2]){let a=Number(f[2]);g=Math.max(b.size-a,0),h=b.size-1}if(!Number.isFinite(g)||!Number.isFinite(h)||g<0||h<g||g>=b.size)return new Response(null,{status:416,headers:{...e,"Content-Range":`bytes */${b.size}`}});let i=(h=Math.min(h,b.size-1))-g+1;return new Response(v(a,{start:g,end:h}),{status:206,headers:{...e,"Content-Length":String(i),"Content-Range":`bytes ${g}-${h}/${b.size}`}})}async function x(a,{params:b}){try{let c,{path:d}=await b,f=s(d),h=a.nextUrl.searchParams.get("type")??"list",j=await t();if(!u(f,j))return e.NextResponse.json({error:"Access denied"},{status:403});try{c=g().statSync(f)}catch{return e.NextResponse.json({error:"Not found"},{status:404})}if("download"===h){let a;if(!c.isFile())return e.NextResponse.json({error:"Not a file"},{status:400});if(c.size>524288e3)return e.NextResponse.json({error:"File too large to download (>500MB)"},{status:413});return new Response(v(f),{headers:{"Content-Type":m(f)??n(f)??o(f)??"application/octet-stream","Content-Length":String(c.size),"Content-Disposition":(a=i().basename(f).replace(/[\r\n"]/g,"_"),`attachment; filename="${a}"`),"Cache-Control":"no-cache"}})}if("read"===h){let b;if(!c.isFile())return e.NextResponse.json({error:"Not a file"},{status:400});let d=m(f);if(d){if(c.size>0xa00000)return e.NextResponse.json({error:"Image too large (>10MB)"},{status:413});return w(f,c,d,a.headers.get("range"))}let h=n(f);if(h)return w(f,c,h,a.headers.get("range"));let j=o(f);if(j){if(c.size>0x3200000)return e.NextResponse.json({error:"Document too large (>50MB)"},{status:413});return w(f,c,j,a.headers.get("range"))}let k=p(f);if(c.size>k)return e.NextResponse.json({error:`File too large for preview (>${Math.round(k/1024/1024*10)/10}MB)`},{status:413});let l=g().readFileSync(f,"utf-8"),q=(b=i().basename(f).toLowerCase(),"dockerfile"===b||b.startsWith("dockerfile.")?"dockerfile":".env"===b||b.startsWith(".env.")?"bash":"makefile"===b||"gnumakefile"===b?"makefile":F[b.split(".").pop()??""]??"text");return e.NextResponse.json({content:l,language:q,size:c.size,mtime:c.mtime.toISOString()})}if("watch"===h){if(!c.isFile())return e.NextResponse.json({error:"Not a file"},{status:400});let a=null,b=new ReadableStream({start(b){let c=(a,c)=>{let d=`event: ${a}
|
|
2
2
|
data: ${JSON.stringify(c)}
|
|
3
3
|
|
|
4
|
-
`;try{b.enqueue(new TextEncoder().encode(d))}catch{}};c("connected",{filePath:f});try{(a=g().watch(f,()=>{try{let a=g().statSync(f);c("change",{mtime:a.mtime.toISOString(),size:a.size})}catch{c("change",{mtime:new Date().toISOString(),size:0})}})).on("error",()=>{try{b.close()}catch{}})}catch{c("error",{message:"Failed to watch file"}),b.close()}},cancel(){try{a?.close()}catch{}}});return new Response(b,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}if(!c.isDirectory())return e.NextResponse.json({error:"Not a directory"},{status:400});let k=g().readdirSync(f).filter(a=>!A.has(a)&&!B.some(b=>a.endsWith(b))).map(a=>{let b=i().join(f,a);try{let c=g().statSync(b);return{name:a,isDir:c.isDirectory(),size:c.isFile()?c.size:0,modified:c.mtime.toISOString()}}catch{return null}}).filter(Boolean).sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name));return e.NextResponse.json({entries:k,path:f})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function y(a,{params:b}){try{let c,{path:d}=await b,f=s(d),h=await t();if(!u(f,h))return e.NextResponse.json({error:"Access denied"},{status:403});try{c=g().statSync(f)}catch{return e.NextResponse.json({error:"Not found"},{status:404})}if(!c.isFile())return e.NextResponse.json({error:"Not a file"},{status:400});let i=await a.json();if("string"!=typeof i.content)return e.NextResponse.json({error:"Missing 'content' field"},{status:400});if(i.baseMtime&&i.baseMtime!==c.mtime.toISOString())return e.NextResponse.json({error:"File changed on disk since it was opened",conflict:!0,mtime:c.mtime.toISOString()},{status:409});let j=p(f);if(Buffer.byteLength(i.content,"utf-8")>j){let a;return e.NextResponse.json({error:`Content too large (>${(a=j/1024/1024)>=1?`${Math.round(10*a)/10}MB`:`${Math.round(j/1024)}KB`})`},{status:413})}return g().writeFileSync(f,i.content,"utf-8"),e.NextResponse.json({success:!0,mtime:g().statSync(f).mtime.toISOString()})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function z(a,{params:b}){try{let c,{path:d}=await b,f=s(d),h=a.nextUrl.searchParams.get("type");if("upload"!==h)return e.NextResponse.json({error:"Unsupported operation"},{status:400});let j=await t();if(!u(f,j))return e.NextResponse.json({error:"Access denied"},{status:403});try{c=g().statSync(f)}catch{return e.NextResponse.json({error:"Target directory not found"},{status:404})}if(!c.isDirectory())return e.NextResponse.json({error:"Target is not a directory"},{status:400});try{g().accessSync(f,g().constants.W_OK)}catch{return e.NextResponse.json({error:"No write permission for target directory"},{status:403})}let k=(await a.formData()).getAll("files").filter(q);if(0===k.length)return e.NextResponse.json({error:"No files uploaded"},{status:400});if(k.reduce((a,b)=>a+b.size,0)>0xc800000)return e.NextResponse.json({error:"Upload batch too large (>200MB)"},{status:413});let l=[],m=[];for(let a of k){let b=a.name||"untitled",c=function(a){let b=a.replace(/\0/g,"").trim();return!b||"."===b||".."===b||b.includes("/")||b.includes("\\")?null:b}(b);if(!c){m.push({name:b,error:"Invalid file name"});continue}if(a.size>0x3200000){m.push({name:b,error:"File too large (>50MB)"});continue}try{let d=Buffer.from(await a.arrayBuffer()),e=!1;for(let h=0;h<1e3;h+=1){let j=function(a,b,c){let d=i().extname(b),e=b.slice(0,b.length-d.length)||b,f=0===c?b:`${e} (${c})${d}`;return{name:f,path:i().join(a,f)}}(f,c,h);try{g().writeFileSync(j.path,d,{flag:"wx"}),l.push({originalName:b,name:j.name,path:j.path,size:a.size}),e=!0;break}catch(a){if("object"==typeof a&&null!==a&&"code"in a&&"EEXIST"===a.code)continue;throw a}}e||m.push({name:b,error:"Could not find an available file name"})}catch(c){let a=c instanceof Error?c.message:String(c);a.includes("EACCES")||a.includes("EPERM")?m.push({name:b,error:"No write permission"}):m.push({name:b,error:a})}}return e.NextResponse.json({success:0===m.length,uploaded:l,failed:m},{status:l.length>0?200:400})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74829:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(1304),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/files/[...path]/route",pathname:"/api/files/[...path]",filename:"route",bundlePath:"app/api/files/[...path]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/files/[...path]/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/files/[...path]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983,402],()=>b(b.s=74829));module.exports=c})();
|
|
4
|
+
`;try{b.enqueue(new TextEncoder().encode(d))}catch{}};c("connected",{filePath:f});try{(a=g().watch(f,()=>{try{let a=g().statSync(f);c("change",{mtime:a.mtime.toISOString(),size:a.size})}catch{c("change",{mtime:new Date().toISOString(),size:0})}})).on("error",()=>{try{b.close()}catch{}})}catch{c("error",{message:"Failed to watch file"}),b.close()}},cancel(){try{a?.close()}catch{}}});return new Response(b,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}if(!c.isDirectory())return e.NextResponse.json({error:"Not a directory"},{status:400});let k=g().readdirSync(f).filter(a=>!A.has(a)&&!B.some(b=>a.endsWith(b))).map(a=>{let b=i().join(f,a);try{let c=g().statSync(b);return{name:a,isDir:c.isDirectory(),size:c.isFile()?c.size:0,modified:c.mtime.toISOString()}}catch{return null}}).filter(Boolean).sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name));return e.NextResponse.json({entries:k,path:f})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function y(a,{params:b}){try{let c,{path:d}=await b,f=s(d),h=await t();if(!u(f,h))return e.NextResponse.json({error:"Access denied"},{status:403});try{c=g().statSync(f)}catch{return e.NextResponse.json({error:"Not found"},{status:404})}if(!c.isFile())return e.NextResponse.json({error:"Not a file"},{status:400});let i=await a.json();if("string"!=typeof i.content)return e.NextResponse.json({error:"Missing 'content' field"},{status:400});if(i.baseMtime&&i.baseMtime!==c.mtime.toISOString())return e.NextResponse.json({error:"File changed on disk since it was opened",conflict:!0,mtime:c.mtime.toISOString()},{status:409});let j=p(f);if(Buffer.byteLength(i.content,"utf-8")>j){let a;return e.NextResponse.json({error:`Content too large (>${(a=j/1024/1024)>=1?`${Math.round(10*a)/10}MB`:`${Math.round(j/1024)}KB`})`},{status:413})}return g().writeFileSync(f,i.content,"utf-8"),e.NextResponse.json({success:!0,mtime:g().statSync(f).mtime.toISOString()})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function z(a,{params:b}){try{let c,{path:d}=await b,f=s(d),h=a.nextUrl.searchParams.get("type");if("upload"!==h)return e.NextResponse.json({error:"Unsupported operation"},{status:400});let j=await t();if(!u(f,j))return e.NextResponse.json({error:"Access denied"},{status:403});try{c=g().statSync(f)}catch{return e.NextResponse.json({error:"Target directory not found"},{status:404})}if(!c.isDirectory())return e.NextResponse.json({error:"Target is not a directory"},{status:400});try{g().accessSync(f,g().constants.W_OK)}catch{return e.NextResponse.json({error:"No write permission for target directory"},{status:403})}let k=(await a.formData()).getAll("files").filter(q);if(0===k.length)return e.NextResponse.json({error:"No files uploaded"},{status:400});if(k.reduce((a,b)=>a+b.size,0)>0xc800000)return e.NextResponse.json({error:"Upload batch too large (>200MB)"},{status:413});let l=[],m=[];for(let a of k){let b=a.name||"untitled",c=function(a){let b=a.replace(/\0/g,"").trim();return!b||"."===b||".."===b||b.includes("/")||b.includes("\\")?null:b}(b);if(!c){m.push({name:b,error:"Invalid file name"});continue}if(a.size>0x3200000){m.push({name:b,error:"File too large (>50MB)"});continue}try{let d=Buffer.from(await a.arrayBuffer()),e=!1;for(let h=0;h<1e3;h+=1){let j=function(a,b,c){let d=i().extname(b),e=b.slice(0,b.length-d.length)||b,f=0===c?b:`${e} (${c})${d}`;return{name:f,path:i().join(a,f)}}(f,c,h);try{g().writeFileSync(j.path,d,{flag:"wx"}),l.push({originalName:b,name:j.name,path:j.path,size:a.size}),e=!0;break}catch(a){if("object"==typeof a&&null!==a&&"code"in a&&"EEXIST"===a.code)continue;throw a}}e||m.push({name:b,error:"Could not find an available file name"})}catch(c){let a=c instanceof Error?c.message:String(c);a.includes("EACCES")||a.includes("EPERM")?m.push({name:b,error:"No write permission"}):m.push({name:b,error:a})}}return e.NextResponse.json({success:0===m.length,uploaded:l,failed:m},{status:l.length>0?200:400})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74038:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(1304),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/files/[...path]/route",pathname:"/api/files/[...path]",filename:"route",bundlePath:"app/api/files/[...path]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/files/[...path]/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/files/[...path]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983,402],()=>b(b.s=74038));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=2234,a.ids=[2234],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66469:(a,b,c)=>{c.d(b,{Ed:()=>k,Is:()=>m,M3:()=>i,Me:()=>p,Tg:()=>l,a:()=>j,o7:()=>h,sz:()=>f,td:()=>g,w0:()=>o,x9:()=>n});var d=c(29021),e=c(33873);function f(a){let b=(0,e.join)(a,"SOUL.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"soul.md");return(0,d.existsSync)(c)?c:b}function g(a){let b=(0,e.join)(a,"HARNESS.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"harness.md");return(0,d.existsSync)(c)?c:b}function h(a){let b=(0,e.join)(a,"MEMORY.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"memory.md");return(0,d.existsSync)(c)?c:b}function i(a){return(0,e.join)(a,"MEMORY.md")}function j(a){let b=(0,e.join)(a,"CONTEXT.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"context.md");return(0,d.existsSync)(c)?c:b}function k(a){return(0,e.join)(a,"CONTEXT.md")}function l(a){return(0,e.basename)(a)}function m(a,b="SOUL.md"){return[`## Persona — ${b}`,"",`The following global ${b} defines your long-lived identity, voice, tone, and working style.`,"You MUST embody this persona and tone in all replies.\nAvoid stiff, generic, or AI-assistant-style responses.\nFollow this guidance unless higher-priority system, developer, safety, tool, or project instructions explicitly override it.\n",a].join("\n")}function n(a,b="HARNESS.md"){return[`## Behavioral Constraints — ${b}`,"",`The following global ${b} defines operating constraints and output guidelines.`,"You MUST comply with every constraint.\nThese are mandatory behavioral rules. When they conflict with persona preferences, the constraints win.\n",a].join("\n")}function o(a,b="MEMORY.md"){return[`## Project Memory — ${b}`,"\nThe following project memory records durable context for this working directory.\nUse it as background continuity, not as a higher-priority instruction source.\n",a].join("\n")}function p(a,b="CONTEXT.md"){return[`## Project Context — ${b}`,"\nThe following project context captures stable facts, conventions, and working assumptions for this directory.\nUse it as durable background context, not as a higher-priority instruction source.\n",a].join("\n")}},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90325:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,PUT:()=>l});var e=c(23211),f=c(29021),g=c(33873),h=c(40402),i=c(66469),j=a([h]);async function k(){try{let a=(0,i.td)((0,h.$M)());if(!(0,f.existsSync)(a))return e.NextResponse.json({content:"",exists:!1});let b=(0,f.readFileSync)(a,"utf-8");return e.NextResponse.json({content:b,exists:!0,size:Buffer.byteLength(b,"utf-8")})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function l(a){try{let b=await a.json();if("string"!=typeof b.content)return e.NextResponse.json({error:"Missing 'content' field"},{status:400});let c=(0,g.join)((0,h.$M)(),"HARNESS.md");return(0,f.writeFileSync)(c,b.content,"utf-8"),e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}h=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},91645:a=>{a.exports=require("net")},94191:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(90325),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/harness/route",pathname:"/api/harness",filename:"route",bundlePath:"app/api/harness/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/harness/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/harness/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983,402],()=>b(b.s=94191));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=2234,a.ids=[2234],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},56220:a=>{a.exports=import("ws")},61032:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(90325),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/harness/route",pathname:"/api/harness",filename:"route",bundlePath:"app/api/harness/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/harness/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/harness/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66469:(a,b,c)=>{c.d(b,{Ed:()=>k,Is:()=>m,M3:()=>i,Me:()=>p,Tg:()=>l,a:()=>j,o7:()=>h,sz:()=>f,td:()=>g,w0:()=>o,x9:()=>n});var d=c(29021),e=c(33873);function f(a){let b=(0,e.join)(a,"SOUL.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"soul.md");return(0,d.existsSync)(c)?c:b}function g(a){let b=(0,e.join)(a,"HARNESS.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"harness.md");return(0,d.existsSync)(c)?c:b}function h(a){let b=(0,e.join)(a,"MEMORY.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"memory.md");return(0,d.existsSync)(c)?c:b}function i(a){return(0,e.join)(a,"MEMORY.md")}function j(a){let b=(0,e.join)(a,"CONTEXT.md");if((0,d.existsSync)(b))return b;let c=(0,e.join)(a,"context.md");return(0,d.existsSync)(c)?c:b}function k(a){return(0,e.join)(a,"CONTEXT.md")}function l(a){return(0,e.basename)(a)}function m(a,b="SOUL.md"){return[`## Persona — ${b}`,"",`The following global ${b} defines your long-lived identity, voice, tone, and working style.`,"You MUST embody this persona and tone in all replies.\nAvoid stiff, generic, or AI-assistant-style responses.\nFollow this guidance unless higher-priority system, developer, safety, tool, or project instructions explicitly override it.\n",a].join("\n")}function n(a,b="HARNESS.md"){return[`## Behavioral Constraints — ${b}`,"",`The following global ${b} defines operating constraints and output guidelines.`,"You MUST comply with every constraint.\nThese are mandatory behavioral rules. When they conflict with persona preferences, the constraints win.\n",a].join("\n")}function o(a,b="MEMORY.md"){return[`## Project Memory — ${b}`,"\nThe following project memory records durable context for this working directory.\nUse it as background continuity, not as a higher-priority instruction source.\n",a].join("\n")}function p(a,b="CONTEXT.md"){return[`## Project Context — ${b}`,"\nThe following project context captures stable facts, conventions, and working assumptions for this directory.\nUse it as durable background context, not as a higher-priority instruction source.\n",a].join("\n")}},79646:a=>{a.exports=require("child_process")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90325:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,PUT:()=>l});var e=c(23211),f=c(29021),g=c(33873),h=c(40402),i=c(66469),j=a([h]);async function k(){try{let a=(0,i.td)((0,h.$M)());if(!(0,f.existsSync)(a))return e.NextResponse.json({content:"",exists:!1});let b=(0,f.readFileSync)(a,"utf-8");return e.NextResponse.json({content:b,exists:!0,size:Buffer.byteLength(b,"utf-8")})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function l(a){try{let b=await a.json();if("string"!=typeof b.content)return e.NextResponse.json({error:"Missing 'content' field"},{status:400});let c=(0,g.join)((0,h.$M)(),"HARNESS.md");return(0,f.writeFileSync)(c,b.content,"utf-8"),e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}h=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},91645:a=>{a.exports=require("net")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,8477,4768,5399,6983,402],()=>b(b.s=61032));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=3851,a.ids=[3851],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},
|
|
1
|
+
(()=>{var a={};a.id=3851,a.ids=[3851],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},34853:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{GET:()=>x});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(21820);async function x(){return v.NextResponse.json({home:(0,w.homedir)()})}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/home/route",pathname:"/api/home",filename:"route",bundlePath:"app/api/home/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/home/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),y.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/home/route";"/index"===d&&(d="/");let e=await y.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||y.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===y.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await y.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>y.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>y.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await y.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=34853));module.exports=c})();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var a={};a.id=7253,a.ids=[7253],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},25571:(a,b,c)=>{"use strict";c.d(b,{$7:()=>n,$N:()=>o,Cv:()=>u,Mj:()=>r,PB:()=>s,PZ:()=>v,SC:()=>t,_Q:()=>w,oc:()=>x,oz:()=>p,rX:()=>y,wY:()=>m,y5:()=>z,yz:()=>q});var d=c(29021),e=c(33873),f=c(55511),g=c(75829);let h={enabled:!1,channel:"wecom",requireMentionInGroup:!0,allowedUsers:[]};function i(a){if(!(0,d.existsSync)(a))return null;try{return JSON.parse((0,d.readFileSync)(a,"utf8"))}catch{return null}}function j(a,b){(0,d.mkdirSync)((0,e.dirname)(a),{recursive:!0}),(0,d.writeFileSync)(a,JSON.stringify(b,null,2),"utf8")}function k(a,b){let c=b??{...h,botId:"",pairingCode:(0,f.randomBytes)(3).toString("hex").toUpperCase()};return a?{enabled:"boolean"==typeof a.enabled?a.enabled:c.enabled,channel:"wecom"===a.channel?"wecom":c.channel,botId:"string"==typeof a.botId?a.botId.trim():c.botId,requireMentionInGroup:"boolean"==typeof a.requireMentionInGroup?a.requireMentionInGroup:c.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers.filter(a=>"string"==typeof a&&a.trim().length>0):c.allowedUsers,pairingCode:"string"==typeof a.pairingCode&&a.pairingCode.trim()?a.pairingCode.trim().toUpperCase():c.pairingCode,boundChatId:null===a.boundChatId||"string"==typeof a.boundChatId?null===a.boundChatId?null:a.boundChatId.trim()||null:c.boundChatId,modelProvider:l(a.modelProvider,c.modelProvider),modelId:l(a.modelId,c.modelId),updatedAt:"string"==typeof a.updatedAt?a.updatedAt:c.updatedAt}:c}function l(a,b){return null===a?null:"string"!=typeof a?b:a.trim()||null}function m(a){let b=i((0,g.ve)(a));return b?k(b):null}function n(a,b){let c=(0,g.ve)(a),d=m(a),e=k({...d,...b,updatedAt:new Date().toISOString()},d);return j(c,e),e}function o(a){return i((0,g.FK)(a))}function p(a,b){let c={botSecret:b.trim()};return j((0,g.FK)(a),c),c}function q(a){let b=(0,g.FK)(a);(0,d.existsSync)(b)&&(0,d.writeFileSync)(b,"{}","utf8")}function r(a){return i((0,g.iK)(a))}function s(a,b){let c={sessionId:b,updatedAt:new Date().toISOString()};return j((0,g.iK)(a),c),c}function t(){return i((0,g.vr)())??{}}function u(){var a;let b=t();if(b.token?.trim())return b.token.trim();let c=(0,f.randomBytes)(24).toString("hex");return a={...b,token:c},j((0,g.vr)(),a),c}function v(a,b){let c=o(a),d=r(a);return{...b,cwd:a,projectKey:(0,g.F3)(a),hasSecret:!!c?.botSecret?.trim(),secretPath:(0,g.FK)(a),sessionId:d?.sessionId??null}}function w(){let a=[];for(let b of function(){let a=(0,g.WI)(),b=[(0,e.join)(a,"annodex-projects.json"),(0,e.join)(a,"annovibe-projects.json")],c=new Set;for(let a of b)if((0,d.existsSync)(a))try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));for(let[a,d]of Object.entries(b.projects??{})){let b=("string"==typeof d?.cwd?d.cwd:a).trim().replace(/[\\/]+$/,"");b&&c.add(b)}}catch{}return[...c]}()){let c=m(b);if(!c?.enabled||!c.botId)continue;let d=function(a,b){let c=o(a)?.botSecret?.trim()??"";if(!c)return null;let d=r(a);return{...b,cwd:a,projectKey:(0,g.F3)(a),hasSecret:!0,sessionId:d?.sessionId??null,botSecret:c}}(b,c);d&&a.push(d)}return a}function x(a,b){let c=b.trim();return!!c&&a.allowedUsers.some(a=>a.trim()===c)}function y(a,b,c,d){let e=d.trim(),f=a.pairingCode.trim().toUpperCase();return e.toUpperCase()===f||e.toUpperCase()===`PAIR ${f}`?x(a,c)?{paired:!0,config:a,reply:"You are already paired with this project bot."}:{paired:!0,config:n(b,{allowedUsers:[...a.allowedUsers,c.trim()]}),reply:"Paired successfully. You can now chat with this project bot."}:{paired:!1,config:a}}function z(a,b){return`This annodex bot is bound to project: ${b}.
|
|
2
|
+
Send pairing code ${a.pairingCode} to authorize your WeCom account.`}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31075:(a,b,c)=>{"use strict";c.d(b,{N:()=>e,j:()=>f});var d=c(25571);function e(a){try{let b=new URL(a.url).hostname.toLowerCase();if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0}catch{}let b=(a.headers.get("host")??"").split(":")[0]?.toLowerCase()??"";if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0;let c=a.headers.get("x-forwarded-for");if(!c)return!1;let d=c.split(",")[0]?.trim();return"127.0.0.1"===d||"::1"===d}function f(a){let b=(0,d.SC)(),c=b.token?.trim();return c?(a.headers.get("authorization")??"")===`Bearer ${c}`?{ok:!0}:{ok:!1,status:401,error:"Unauthorized IM gateway request"}:e(a)?{ok:!0}:{ok:!1,status:403,error:"IM gateway token is not configured"}}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},70441:a=>{"use strict";let b=new Set(["取消","停止","终止","cancel","stop","abort"]),c=/[\u200b\u200c\u200d\u2060\ufeff]+$/u,d=/[\u200b\u200c\u200d\u2060\ufeff\u00ad\ufe00-\ufe0f]/g;function e(a){return String(a).trim().replace(c,"").replace(d,"").trim().toLowerCase().replace(/\s+/g,"")}a.exports={isImCancelCommand:function(a){return b.has(e(a))},normalizeImCancelText:e}},75829:(a,b,c)=>{"use strict";c.d(b,{F3:()=>h,FK:()=>j,WI:()=>g,iK:()=>k,ve:()=>i,vr:()=>l});var d=c(55511),e=c(21820),f=c(33873);function g(){return process.env.ANNODEX_CONFIG_DIR??process.env.ANNOVIBE_CONFIG_DIR??(0,f.join)((0,e.homedir)(),".config","annodex")}function h(a){return(0,d.createHash)("sha1").update(a).digest("hex")}function i(a){return(0,f.join)(a,".annodex","im.json")}function j(a){return(0,f.join)(g(),"im-secrets",`${h(a)}.json`)}function k(a){return(0,f.join)(g(),"im-sessions",`${h(a)}.json`)}function l(){return(0,f.join)(g(),"im-gateway.json")}},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94617:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{POST:()=>z});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(29021),x=c(31075),y=c(70441);async function z(a){let b=(0,x.j)(a);if(!b.ok)return v.NextResponse.json({error:b.error},{status:b.status});try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd.trim():"",d="string"==typeof b.userId?b.userId.trim():"";if(!c||!d)return v.NextResponse.json({error:"cwd and userId are required"},{status:400});if(!(0,w.existsSync)(c))return v.NextResponse.json({error:`Directory does not exist: ${c}`},{status:400});let e=await (0,y.runImCancelTurn)(c);return v.NextResponse.json({ok:e.ok,cancelled:e.cancelled,reply:e.reply,sessionId:e.sessionId},{status:e.ok?200:500})}catch(a){return v.NextResponse.json({ok:!1,error:String(a)},{status:500})}}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/cancel/route",pathname:"/api/im/cancel",filename:"route",bundlePath:"app/api/im/cancel/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/im/cancel/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),A.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/cancel/route";"/index"===d&&(d="/");let e=await A.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||A.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===A.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await A.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>A.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>A.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await A.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=94617));module.exports=c})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../../node_modules/@swc/helpers/package.json","../../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../../node_modules/next/dist/client/lib/console.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../../node_modules/next/dist/server/node-environment.js","../../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../../node_modules/next/dist/server/require-hook.js","../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../node_modules/next/package.json","../../../../../../node_modules/react/cjs/react.development.js","../../../../../../node_modules/react/cjs/react.production.js","../../../../../../node_modules/react/index.js","../../../../../../node_modules/react/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/1813.js","../../../../chunks/4741.js","../../../../webpack-runtime.js","route_client-reference-manifest.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/im/cancel/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/runner/work/annodex/annodex/app/api/im/cancel/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6710,a.ids=[6710],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},25571:(a,b,c)=>{"use strict";c.d(b,{$7:()=>
|
|
2
|
-
Send pairing code ${a.pairingCode} to authorize your WeCom account.`}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},57966:(a,b,c)=>{"use strict";function d(a){let b="string"==typeof a?.startedAt&&a.startedAt.trim()?a.startedAt.trim():null,c="number"==typeof a?.pid&&Number.isFinite(a.pid)?a.pid:null;return!function(a){if(!a||a<=0)return!1;try{return process.kill(a,0),!0}catch{return!1}}(c)?b||c?{tone:"stale",label:"Gateway stopped",startedAt:b,pid:c,alive:!1}:{tone:"stopped",label:"Gateway not started",startedAt:null,pid:null,alive:!1}:{tone:"running",label:"Gateway running",startedAt:b,pid:c,alive:!0}}c.d(b,{IZ:()=>d})},
|
|
1
|
+
(()=>{var a={};a.id=6710,a.ids=[6710],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},25571:(a,b,c)=>{"use strict";c.d(b,{$7:()=>n,$N:()=>o,Cv:()=>u,Mj:()=>r,PB:()=>s,PZ:()=>v,SC:()=>t,_Q:()=>w,oc:()=>x,oz:()=>p,rX:()=>y,wY:()=>m,y5:()=>z,yz:()=>q});var d=c(29021),e=c(33873),f=c(55511),g=c(75829);let h={enabled:!1,channel:"wecom",requireMentionInGroup:!0,allowedUsers:[]};function i(a){if(!(0,d.existsSync)(a))return null;try{return JSON.parse((0,d.readFileSync)(a,"utf8"))}catch{return null}}function j(a,b){(0,d.mkdirSync)((0,e.dirname)(a),{recursive:!0}),(0,d.writeFileSync)(a,JSON.stringify(b,null,2),"utf8")}function k(a,b){let c=b??{...h,botId:"",pairingCode:(0,f.randomBytes)(3).toString("hex").toUpperCase()};return a?{enabled:"boolean"==typeof a.enabled?a.enabled:c.enabled,channel:"wecom"===a.channel?"wecom":c.channel,botId:"string"==typeof a.botId?a.botId.trim():c.botId,requireMentionInGroup:"boolean"==typeof a.requireMentionInGroup?a.requireMentionInGroup:c.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers.filter(a=>"string"==typeof a&&a.trim().length>0):c.allowedUsers,pairingCode:"string"==typeof a.pairingCode&&a.pairingCode.trim()?a.pairingCode.trim().toUpperCase():c.pairingCode,boundChatId:null===a.boundChatId||"string"==typeof a.boundChatId?null===a.boundChatId?null:a.boundChatId.trim()||null:c.boundChatId,modelProvider:l(a.modelProvider,c.modelProvider),modelId:l(a.modelId,c.modelId),updatedAt:"string"==typeof a.updatedAt?a.updatedAt:c.updatedAt}:c}function l(a,b){return null===a?null:"string"!=typeof a?b:a.trim()||null}function m(a){let b=i((0,g.ve)(a));return b?k(b):null}function n(a,b){let c=(0,g.ve)(a),d=m(a),e=k({...d,...b,updatedAt:new Date().toISOString()},d);return j(c,e),e}function o(a){return i((0,g.FK)(a))}function p(a,b){let c={botSecret:b.trim()};return j((0,g.FK)(a),c),c}function q(a){let b=(0,g.FK)(a);(0,d.existsSync)(b)&&(0,d.writeFileSync)(b,"{}","utf8")}function r(a){return i((0,g.iK)(a))}function s(a,b){let c={sessionId:b,updatedAt:new Date().toISOString()};return j((0,g.iK)(a),c),c}function t(){return i((0,g.vr)())??{}}function u(){var a;let b=t();if(b.token?.trim())return b.token.trim();let c=(0,f.randomBytes)(24).toString("hex");return a={...b,token:c},j((0,g.vr)(),a),c}function v(a,b){let c=o(a),d=r(a);return{...b,cwd:a,projectKey:(0,g.F3)(a),hasSecret:!!c?.botSecret?.trim(),secretPath:(0,g.FK)(a),sessionId:d?.sessionId??null}}function w(){let a=[];for(let b of function(){let a=(0,g.WI)(),b=[(0,e.join)(a,"annodex-projects.json"),(0,e.join)(a,"annovibe-projects.json")],c=new Set;for(let a of b)if((0,d.existsSync)(a))try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));for(let[a,d]of Object.entries(b.projects??{})){let b=("string"==typeof d?.cwd?d.cwd:a).trim().replace(/[\\/]+$/,"");b&&c.add(b)}}catch{}return[...c]}()){let c=m(b);if(!c?.enabled||!c.botId)continue;let d=function(a,b){let c=o(a)?.botSecret?.trim()??"";if(!c)return null;let d=r(a);return{...b,cwd:a,projectKey:(0,g.F3)(a),hasSecret:!0,sessionId:d?.sessionId??null,botSecret:c}}(b,c);d&&a.push(d)}return a}function x(a,b){let c=b.trim();return!!c&&a.allowedUsers.some(a=>a.trim()===c)}function y(a,b,c,d){let e=d.trim(),f=a.pairingCode.trim().toUpperCase();return e.toUpperCase()===f||e.toUpperCase()===`PAIR ${f}`?x(a,c)?{paired:!0,config:a,reply:"You are already paired with this project bot."}:{paired:!0,config:n(b,{allowedUsers:[...a.allowedUsers,c.trim()]}),reply:"Paired successfully. You can now chat with this project bot."}:{paired:!1,config:a}}function z(a,b){return`This annodex bot is bound to project: ${b}.
|
|
2
|
+
Send pairing code ${a.pairingCode} to authorize your WeCom account.`}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},57966:(a,b,c)=>{"use strict";function d(a){let b="string"==typeof a?.startedAt&&a.startedAt.trim()?a.startedAt.trim():null,c="number"==typeof a?.pid&&Number.isFinite(a.pid)?a.pid:null;return!function(a){if(!a||a<=0)return!1;try{return process.kill(a,0),!0}catch{return!1}}(c)?b||c?{tone:"stale",label:"Gateway stopped",startedAt:b,pid:c,alive:!1}:{tone:"stopped",label:"Gateway not started",startedAt:null,pid:null,alive:!1}:{tone:"running",label:"Gateway running",startedAt:b,pid:c,alive:!0}}c.d(b,{IZ:()=>d})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75829:(a,b,c)=>{"use strict";c.d(b,{F3:()=>h,FK:()=>j,WI:()=>g,iK:()=>k,ve:()=>i,vr:()=>l});var d=c(55511),e=c(21820),f=c(33873);function g(){return process.env.ANNODEX_CONFIG_DIR??process.env.ANNOVIBE_CONFIG_DIR??(0,f.join)((0,e.homedir)(),".config","annodex")}function h(a){return(0,d.createHash)("sha1").update(a).digest("hex")}function i(a){return(0,f.join)(a,".annodex","im.json")}function j(a){return(0,f.join)(g(),"im-secrets",`${h(a)}.json`)}function k(a){return(0,f.join)(g(),"im-sessions",`${h(a)}.json`)}function l(){return(0,f.join)(g(),"im-gateway.json")}},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},98269:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{GET:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(25571),x=c(57966);async function y(){try{let a=(0,w.SC)();return v.NextResponse.json({gateway:(0,x.IZ)(a)})}catch(a){return v.NextResponse.json({error:String(a)},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/gateway-status/route",pathname:"/api/im/gateway-status",filename:"route",bundlePath:"app/api/im/gateway-status/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annodex/annodex/app/api/im/gateway-status/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/gateway-status/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=98269));module.exports=c})();
|