@seqyuan/annovibe 0.8.92 → 0.8.93
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 +8 -7
- 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 +8 -0
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- 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/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/prepare/route.js +1 -0
- package/.next/server/app/api/agent/[id]/prepare/route_client-reference-manifest.js +1 -0
- 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 +1 -1
- package/.next/server/app/api/apps/[id]/[[...path]]/route.js +2 -2
- package/.next/server/app/api/apps/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/auth/totp/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +2 -2
- 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 +1 -1
- package/.next/server/app/api/im/gateway-status/route.js +1 -1
- package/.next/server/app/api/im/gateway-token/route.js +1 -1
- 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/session-ids/route.js +1 -1
- package/.next/server/app/api/im/turn/route.js +2 -2
- 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/dismiss/route.js +2 -2
- package/.next/server/app/api/memory/promote/route.js +2 -2
- 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/plot-kernels/route.js +1 -1
- package/.next/server/app/api/plot-kernels/save/route.js +1 -1
- package/.next/server/app/api/plot-kernels/status/route.js +1 -1
- package/.next/server/app/api/plot-kernels/stop/route.js +1 -1
- package/.next/server/app/api/projects/browse/route.js +1 -1
- package/.next/server/app/api/projects/route.js +2 -2
- 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]/kernel-state/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/plan/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/workbench-artifact/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/workbench-review/route.js +1 -1
- package/.next/server/app/api/sessions/new/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +2 -2
- 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/subagents/status/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- 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/page_client-reference-manifest.js +1 -1
- 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 +28 -28
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/page.js +3 -3
- package/.next/server/app/smoke/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke.html +1 -1
- package/.next/server/app/smoke.rsc +1 -1
- package/.next/server/app/smoke.segments/_full.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/_head.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/_index.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/smoke/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/smoke.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +8 -7
- package/.next/server/middleware-build-manifest.js +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/chunks/app/_global-error/page-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/prepare/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/agent/runtime/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/apps/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/auth/totp/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/harness/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/home/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/im/cancel/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/im/gateway-status/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/im/gateway-token/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/im/project/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/im/projects/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/im/session-ids/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/im/turn/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/images/upload/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/internal/runtime/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/memory/dismiss/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/memory/promote/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/models/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/save/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/status/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/stop/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/projects/browse/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/projects/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/search/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/kernel-state/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/plan/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/workbench-artifact/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/workbench-review/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/settings/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/skills/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/soul/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/subagents/status/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/api/version/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/favicon.ico/route-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/app/page-130dbbfd958ed443.js +67 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-fa0c1cd2174c1f0b.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-fa0c1cd2174c1f0b.js +1 -0
- package/package.json +1 -1
- package/.next/static/chunks/app/_global-error/page-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/agent/runtime/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/apps/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/auth/totp/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/harness/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/home/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/im/cancel/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/im/gateway-status/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/im/gateway-token/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/im/project/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/im/projects/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/im/session-ids/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/im/turn/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/images/upload/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/internal/runtime/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/memory/dismiss/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/memory/promote/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/models/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/save/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/status/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/stop/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/projects/browse/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/projects/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/search/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/kernel-state/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/plan/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/workbench-artifact/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/workbench-review/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/new/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/settings/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/skills/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/soul/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/subagents/status/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/api/version/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/favicon.ico/route-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/app/page-95a20c639bd2605d.js +0 -67
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-8ad668871a6e9fed.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-8ad668871a6e9fed.js +0 -1
- /package/.next/static/{YyOm-oLPna9JyGTclkwP_ → LGbNm6rizDBchmYepXdui}/_buildManifest.js +0 -0
- /package/.next/static/{YyOm-oLPna9JyGTclkwP_ → LGbNm6rizDBchmYepXdui}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6919,a.ids=[6919],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},
|
|
1
|
+
(()=>{var a={};a.id=6919,a.ids=[6919],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},15572:(a,b,c)=>{"use strict";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(69226),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/providers/route",pathname:"/api/auth/providers",filename:"route",bundlePath:"app/api/auth/providers/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/providers/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/auth/providers/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)}})},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},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")},69226:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>g,dynamic:()=>h});var e=c(75430),f=a([e]);e=(f.then?(await f)():f)[0];let h="force-dynamic";async function g(){let a=e.AuthStorage.create(),b=a.getOAuthProviders(),c=new Set(["anthropic"]),d={"openai-codex":"ChatGPT Plus/Pro","github-copilot":"GitHub Copilot"},f=await Promise.all(b.filter(a=>!c.has(a.id)).map(async b=>{let c=a.has(b.id);return{id:b.id,name:d[b.id]??b.name,usesCallbackServer:b.usesCallbackServer??!1,loggedIn:c}}));return Response.json({providers:f})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=15572));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=7473,a.ids=[7473],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")},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")},31828:(a,b,c)=>{"use strict";c.d(b,{zb:()=>D,Vn:()=>H,yL:()=>u,kR:()=>J,eh:()=>G,US:()=>l,oB:()=>v,I0:()=>B,y2:()=>r,pg:()=>w,yn:()=>E,OJ:()=>F,WG:()=>A,hx:()=>C,BE:()=>s,JZ:()=>K});var d=c(29021),e=c(33873),f=c(21820),g=c(34013);function h(){return process.env.ANNOVIBE_AUTH_SECRET??process.env.PIDEX_AUTH_SECRET??"annovibe-default-secret"}async function i(a,b){let c=new TextEncoder,d=await globalThis.crypto.subtle.importKey("raw",c.encode(a),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return Array.from(new Uint8Array(await globalThis.crypto.subtle.sign("HMAC",d,c.encode(b))),a=>a.toString(16).padStart(2,"0")).join("")}async function j(a){let b,c=a??h(),d=`${Date.now()}:${(b=new Uint8Array(16),globalThis.crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join(""))}`,e=await i(c,d);return`${d}:${e}`}async function k(a,b){try{let c=b??h(),d=a.split(":"),e=d.pop(),f=d.join(":");if(!e||!f)return!1;let g=await i(c,f);if(e.length!==g.length)return!1;let j=0;for(let a=0;a<e.length;a++)j|=e.charCodeAt(a)^g.charCodeAt(a);return 0===j}catch{return!1}}function l(a){return`annovibe-auth=${a}; HttpOnly; SameSite=Lax; Path=/; Max-Age=2592000`}var m=c(62814);function n(){return process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent")}function o(){return(0,e.join)(n(),"web-auth.json")}function p(){try{let a=o();if(!(0,d.existsSync)(a))return null;let b=(0,d.readFileSync)(a,"utf-8");return JSON.parse(b)}catch{return null}}function q(a){let b=n();(0,d.existsSync)(b)||(0,d.mkdirSync)(b,{recursive:!0}),(0,d.writeFileSync)(o(),JSON.stringify(a,null,2))}function r(){let a=p();return a?.enabled!==!1&&!!a?.passwordHash}function s(a){let b=p();return!!b?.passwordHash&&(0,g.Dm)(a,b.passwordHash)}function t(){let a=p();return a?.passwordHash??"annovibe-default-secret"}function u(){return j(t())}function v(){let a=p();return a?.totp??null}function w(){let a=p();return a?.totp?.status==="enabled"}let x=/^(1|true|yes|on)$/i;function y(a){var b,c;let d=(b=a.trim()).startsWith('"')&&b.endsWith('"')||b.startsWith("'")&&b.endsWith("'")?b.slice(1,-1):b;if(!d||"unknown"===d.toLowerCase())return null;if(d.startsWith("[")){let a=d.indexOf("]");a>0&&(d=d.slice(1,a))}else/^\d+\.\d+\.\d+\.\d+:\d+$/.test(d)&&(d=d.slice(0,d.lastIndexOf(":")));let e=d.indexOf("%");return e>=0&&(d=d.slice(0,e)),(c=d,/^\d+\.\d+\.\d+\.\d+$/.test(c)||c.includes(":"))?d:null}function z(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){let b=parseInt(a,10);if(isNaN(b)||b<0||b>255)return null;c=c<<8|b}return c>>>0}function A(a){let b=p();if(!b?.totp||"enabled"!==b.totp.status)return!1;if("always"===b.totp.requireMode||!b.totp.requireMode)return!0;let c=b.totp.trustedNetworks??["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"];return!function(a,b){if(!a)return!0;for(let c of b)if(function(a,b){if(b.includes(":")){let[c,d]=b.split("/");return 128===parseInt(d??"128",10)&&a===c}return function(a,b){let[c,d]=b.split("/"),e=parseInt(d??"32",10),f=z(a),g=z(c);if(null===f||null===g||e<0||e>32)return!1;let h=0===e?0:-1<<32-e;return(f&h)==(g&h)}(a,b)}(a,c))return!0;return!1}(function(a){if(!x.test(process.env.ANNOVIBE_TRUST_PROXY_HEADERS??""))return null;let b=a.headers.get("forwarded");if(b){let a=b.split(",")[0]?.trim();if(a)for(let b of a.split(";")){let[a,c]=b.split("=",2);if(a?.trim().toLowerCase()==="for"&&c){let a=y(c);if(a)return a}}}let c=a.headers.get("x-forwarded-for");if(c){let a=y(c.split(",")[0]??"");if(a)return a}let d=a.headers.get("x-real-ip");if(d){let a=y(d);if(a)return a}return null}(a),c)}function B(){let a=p();return a?.totp?.status==="enabled"&&a.totp.secret?a.totp.secret:null}function C(a){var b;let c,d=v();b={secret:a,status:"pending",requireMode:d?.requireMode??"always",trustedNetworks:d?.trustedNetworks},(c=p()??{passwordHash:"",enabled:!0}).totp=b,q(c),(0,m.L)("totp_setup_started")}function D(a){let b=p();if(!b?.totp?.secret)throw Error("No pending TOTP setup");b.totp.status="enabled",b.totp.recoveryCodes=a,b.totp.requireMode||(b.totp.requireMode="always"),b.totp.trustedNetworks||(b.totp.trustedNetworks=["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]),q(b),(0,m.L)("totp_enabled")}function E(a){let b=p();b?.totp&&(b.totp.requireMode=a,q(b))}function F(a){let b=p();b?.totp&&(b.totp.trustedNetworks=a,q(b))}function G(){let a=p();a?.totp&&(delete a.totp,q(a),(0,m.L)("totp_disabled"))}function H(a){let b=p();b?.totp?.recoveryCodes&&(b.totp.recoveryCodes=b.totp.recoveryCodes.filter(b=>b!==a),q(b),(0,m.L)("recovery_code_used"))}let I=":annovibe-temp-token";async function J(){let a=t()+I,b=await j(a);return`t:${b}`}async function K(a){if(!a.startsWith("t:"))return!1;let b=a.slice(2),c=t()+I;if(!await k(b,c))return!1;try{let a=b.split(":");if(a.length<3)return!1;let c=parseInt(a[0],10);if(Date.now()-c>12e4)return!1}catch{return!1}return!0}},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")},62814:(a,b,c)=>{"use strict";c.d(b,{L:()=>g});var d=c(29021),e=c(33873),f=c(21820);function g(a,b){try{let c=(0,e.join)(process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent"),"auth-audit.jsonl"),g=(0,e.dirname)(c);(0,d.existsSync)(g)||(0,d.mkdirSync)(g,{recursive:!0});let h={ts:new Date().toISOString(),...b?{ip:b}:{},action:a};(0,d.appendFileSync)(c,JSON.stringify(h)+"\n")}catch{}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75132:(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(31828);async function x(){return v.NextResponse.json({authEnabled:(0,w.y2)()})}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/status/route",pathname:"/api/auth/status",filename:"route",bundlePath:"app/api/auth/status/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/status/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/auth/status/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}}},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,4013],()=>b(b.s=75132));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=7473,a.ids=[7473],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")},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")},31828:(a,b,c)=>{"use strict";c.d(b,{zb:()=>D,Vn:()=>H,yL:()=>u,kR:()=>J,eh:()=>G,US:()=>l,oB:()=>v,I0:()=>B,y2:()=>r,pg:()=>w,yn:()=>E,OJ:()=>F,WG:()=>A,hx:()=>C,BE:()=>s,JZ:()=>K});var d=c(29021),e=c(33873),f=c(21820),g=c(34013);function h(){return process.env.ANNOVIBE_AUTH_SECRET??process.env.PIDEX_AUTH_SECRET??"annovibe-default-secret"}async function i(a,b){let c=new TextEncoder,d=await globalThis.crypto.subtle.importKey("raw",c.encode(a),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return Array.from(new Uint8Array(await globalThis.crypto.subtle.sign("HMAC",d,c.encode(b))),a=>a.toString(16).padStart(2,"0")).join("")}async function j(a){let b,c=a??h(),d=`${Date.now()}:${(b=new Uint8Array(16),globalThis.crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join(""))}`,e=await i(c,d);return`${d}:${e}`}async function k(a,b){try{let c=b??h(),d=a.split(":"),e=d.pop(),f=d.join(":");if(!e||!f)return!1;let g=await i(c,f);if(e.length!==g.length)return!1;let j=0;for(let a=0;a<e.length;a++)j|=e.charCodeAt(a)^g.charCodeAt(a);return 0===j}catch{return!1}}function l(a){return`annovibe-auth=${a}; HttpOnly; SameSite=Lax; Path=/; Max-Age=2592000`}var m=c(62814);function n(){return process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent")}function o(){return(0,e.join)(n(),"web-auth.json")}function p(){try{let a=o();if(!(0,d.existsSync)(a))return null;let b=(0,d.readFileSync)(a,"utf-8");return JSON.parse(b)}catch{return null}}function q(a){let b=n();(0,d.existsSync)(b)||(0,d.mkdirSync)(b,{recursive:!0}),(0,d.writeFileSync)(o(),JSON.stringify(a,null,2))}function r(){let a=p();return a?.enabled!==!1&&!!a?.passwordHash}function s(a){let b=p();return!!b?.passwordHash&&(0,g.Dm)(a,b.passwordHash)}function t(){let a=p();return a?.passwordHash??"annovibe-default-secret"}function u(){return j(t())}function v(){let a=p();return a?.totp??null}function w(){let a=p();return a?.totp?.status==="enabled"}let x=/^(1|true|yes|on)$/i;function y(a){var b,c;let d=(b=a.trim()).startsWith('"')&&b.endsWith('"')||b.startsWith("'")&&b.endsWith("'")?b.slice(1,-1):b;if(!d||"unknown"===d.toLowerCase())return null;if(d.startsWith("[")){let a=d.indexOf("]");a>0&&(d=d.slice(1,a))}else/^\d+\.\d+\.\d+\.\d+:\d+$/.test(d)&&(d=d.slice(0,d.lastIndexOf(":")));let e=d.indexOf("%");return e>=0&&(d=d.slice(0,e)),(c=d,/^\d+\.\d+\.\d+\.\d+$/.test(c)||c.includes(":"))?d:null}function z(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){let b=parseInt(a,10);if(isNaN(b)||b<0||b>255)return null;c=c<<8|b}return c>>>0}function A(a){let b=p();if(!b?.totp||"enabled"!==b.totp.status)return!1;if("always"===b.totp.requireMode||!b.totp.requireMode)return!0;let c=b.totp.trustedNetworks??["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"];return!function(a,b){if(!a)return!0;for(let c of b)if(function(a,b){if(b.includes(":")){let[c,d]=b.split("/");return 128===parseInt(d??"128",10)&&a===c}return function(a,b){let[c,d]=b.split("/"),e=parseInt(d??"32",10),f=z(a),g=z(c);if(null===f||null===g||e<0||e>32)return!1;let h=0===e?0:-1<<32-e;return(f&h)==(g&h)}(a,b)}(a,c))return!0;return!1}(function(a){if(!x.test(process.env.ANNOVIBE_TRUST_PROXY_HEADERS??""))return null;let b=a.headers.get("forwarded");if(b){let a=b.split(",")[0]?.trim();if(a)for(let b of a.split(";")){let[a,c]=b.split("=",2);if(a?.trim().toLowerCase()==="for"&&c){let a=y(c);if(a)return a}}}let c=a.headers.get("x-forwarded-for");if(c){let a=y(c.split(",")[0]??"");if(a)return a}let d=a.headers.get("x-real-ip");if(d){let a=y(d);if(a)return a}return null}(a),c)}function B(){let a=p();return a?.totp?.status==="enabled"&&a.totp.secret?a.totp.secret:null}function C(a){var b;let c,d=v();b={secret:a,status:"pending",requireMode:d?.requireMode??"always",trustedNetworks:d?.trustedNetworks},(c=p()??{passwordHash:"",enabled:!0}).totp=b,q(c),(0,m.L)("totp_setup_started")}function D(a){let b=p();if(!b?.totp?.secret)throw Error("No pending TOTP setup");b.totp.status="enabled",b.totp.recoveryCodes=a,b.totp.requireMode||(b.totp.requireMode="always"),b.totp.trustedNetworks||(b.totp.trustedNetworks=["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]),q(b),(0,m.L)("totp_enabled")}function E(a){let b=p();b?.totp&&(b.totp.requireMode=a,q(b))}function F(a){let b=p();b?.totp&&(b.totp.trustedNetworks=a,q(b))}function G(){let a=p();a?.totp&&(delete a.totp,q(a),(0,m.L)("totp_disabled"))}function H(a){let b=p();b?.totp?.recoveryCodes&&(b.totp.recoveryCodes=b.totp.recoveryCodes.filter(b=>b!==a),q(b),(0,m.L)("recovery_code_used"))}let I=":annovibe-temp-token";async function J(){let a=t()+I,b=await j(a);return`t:${b}`}async function K(a){if(!a.startsWith("t:"))return!1;let b=a.slice(2),c=t()+I;if(!await k(b,c))return!1;try{let a=b.split(":");if(a.length<3)return!1;let c=parseInt(a[0],10);if(Date.now()-c>12e4)return!1}catch{return!1}return!0}},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")},53370:(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(31828);async function x(){return v.NextResponse.json({authEnabled:(0,w.y2)()})}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/status/route",pathname:"/api/auth/status",filename:"route",bundlePath:"app/api/auth/status/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/status/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/auth/status/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}}},55511:a=>{"use strict";a.exports=require("crypto")},62814:(a,b,c)=>{"use strict";c.d(b,{L:()=>g});var d=c(29021),e=c(33873),f=c(21820);function g(a,b){try{let c=(0,e.join)(process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent"),"auth-audit.jsonl"),g=(0,e.dirname)(c);(0,d.existsSync)(g)||(0,d.mkdirSync)(g,{recursive:!0});let h={ts:new Date().toISOString(),...b?{ip:b}:{},action:a};(0,d.appendFileSync)(c,JSON.stringify(h)+"\n")}catch{}}},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,4013],()=>b(b.s=53370));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9240,a.ids=[9240],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1050:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>G,patchFetch:()=>F,routeModule:()=>B,serverHooks:()=>E,workAsyncStorage:()=>C,workUnitAsyncStorage:()=>D});var d={};c.r(d),c.d(d,{GET:()=>z,POST:()=>A});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(31828),x=c(2072),y=c(62814);async function z(){let a=(0,w.oB)();return v.NextResponse.json({status:a?.status??"disabled",enabled:(0,w.pg)(),requireMode:a?.requireMode??"always",trustedNetworks:a?.trustedNetworks??["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]})}async function A(a){try{let{action:b}=await a.json().catch(()=>({}));if("check-recovery"===b){let{recoveryCode:b}=await a.json();if(!b)return v.NextResponse.json({error:"Recovery code required"},{status:400});let c=(0,w.oB)();if(!c?.recoveryCodes?.length)return v.NextResponse.json({error:"No recovery codes available"},{status:400});let d=(0,x.Ak)(b,c.recoveryCodes);if(!d)return(0,y.L)("totp_verify_fail"),v.NextResponse.json({error:"Invalid recovery code"},{status:401});return(0,w.Vn)(d),v.NextResponse.json({success:!0})}if("setup"===b){let a=(0,x.VZ)();(0,w.hx)(a);let b=(0,x.Yb)(a,"AnnoVibe","AnnoVibe");return v.NextResponse.json({secret:a,uri:b})}if("verify-setup"===b){let b=(0,w.oB)();if(!b||"pending"!==b.status)return v.NextResponse.json({error:"No pending TOTP setup"},{status:400});let{code:c}=await a.json();if(!c||!/^\d{6}$/.test(c))return v.NextResponse.json({error:"6-digit verification code required"},{status:400});if(!await (0,x.z3)(b.secret,c))return(0,y.L)("totp_verify_fail"),v.NextResponse.json({error:"Invalid verification code"},{status:401});let{codes:d,hashes:e}=(0,x.b5)();return(0,w.zb)(e),v.NextResponse.json({success:!0,recoveryCodes:d})}if("disable"===b){let b=(0,w.oB)();if(!b||"enabled"!==b.status)return v.NextResponse.json({error:"TOTP is not enabled"},{status:400});let{code:c}=await a.json();if(!c||!/^\d{6}$/.test(c))return v.NextResponse.json({error:"6-digit verification code required"},{status:400});if(!await (0,x.z3)(b.secret,c))return(0,y.L)("totp_verify_fail"),v.NextResponse.json({error:"Invalid verification code"},{status:401});return(0,w.eh)(),v.NextResponse.json({success:!0})}if("get-recovery-codes"===b){let a=(0,w.oB)();return v.NextResponse.json({recoveryCodesLeft:a?.recoveryCodes?.length??0})}if("set-require-mode"===b){let{requireMode:b}=await a.json();if("always"!==b&&"untrusted"!==b)return v.NextResponse.json({error:"Invalid requireMode. Use 'always' or 'untrusted'"},{status:400});return(0,w.yn)(b),v.NextResponse.json({success:!0})}if("set-trusted-networks"===b){let{trustedNetworks:b}=await a.json();if(!Array.isArray(b))return v.NextResponse.json({error:"trustedNetworks must be an array of CIDR strings"},{status:400});return(0,w.OJ)(b),v.NextResponse.json({success:!0})}return v.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return v.NextResponse.json({error:String(a)},{status:500})}}let B=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/totp/route",pathname:"/api/auth/totp",filename:"route",bundlePath:"app/api/auth/totp/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/totp/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:E}=B;function F(){return(0,g.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})}async function G(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),B.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/totp/route";"/index"===d&&(d="/");let e=await B.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:A,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==A?void 0:A.render404)?await A.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||B.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===B.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==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await B.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)=>B.onRequestError(a,b,d,e,A)},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=>B.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 B.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),b}},k=await B.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 B.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},2072:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>n,VZ:()=>j,Yb:()=>k,b5:()=>o,z3:()=>l});var d=c(69554),e=c(63620),f=c(19426),g=c(34013);let h=null;function i(){if(!h){let a=new d.Xf,b=new e.gZ;h=new f._k({crypto:a,base32:b})}return h}function j(){return i().generateSecret()}function k(a,b,c="AnnoVibe"){return i().toURI({secret:a,label:b,issuer:c})}async function l(a,b){try{return(await i().verify(b,{secret:a,epochTolerance:1})).valid}catch{return!1}}function m(a){return(0,g.Y8)(a,10)}function n(a,b){for(let c of b)if((0,g.Dm)(a,c))return c;return null}function o(){let a=[];for(let b=0;b<8;b++){let b=new Uint8Array(6);globalThis.crypto.getRandomValues(b);let c=Array.from(b,a=>a.toString(16).padStart(2,"0")).join("");a.push(`${c.slice(0,4)}-${c.slice(4,8)}-${c.slice(8,12)}`)}return{codes:a,hashes:a.map(m)}}},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")},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")},31828:(a,b,c)=>{"use strict";c.d(b,{zb:()=>D,Vn:()=>H,yL:()=>u,kR:()=>J,eh:()=>G,US:()=>l,oB:()=>v,I0:()=>B,y2:()=>r,pg:()=>w,yn:()=>E,OJ:()=>F,WG:()=>A,hx:()=>C,BE:()=>s,JZ:()=>K});var d=c(29021),e=c(33873),f=c(21820),g=c(34013);function h(){return process.env.ANNOVIBE_AUTH_SECRET??process.env.PIDEX_AUTH_SECRET??"annovibe-default-secret"}async function i(a,b){let c=new TextEncoder,d=await globalThis.crypto.subtle.importKey("raw",c.encode(a),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return Array.from(new Uint8Array(await globalThis.crypto.subtle.sign("HMAC",d,c.encode(b))),a=>a.toString(16).padStart(2,"0")).join("")}async function j(a){let b,c=a??h(),d=`${Date.now()}:${(b=new Uint8Array(16),globalThis.crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join(""))}`,e=await i(c,d);return`${d}:${e}`}async function k(a,b){try{let c=b??h(),d=a.split(":"),e=d.pop(),f=d.join(":");if(!e||!f)return!1;let g=await i(c,f);if(e.length!==g.length)return!1;let j=0;for(let a=0;a<e.length;a++)j|=e.charCodeAt(a)^g.charCodeAt(a);return 0===j}catch{return!1}}function l(a){return`annovibe-auth=${a}; HttpOnly; SameSite=Lax; Path=/; Max-Age=2592000`}var m=c(62814);function n(){return process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent")}function o(){return(0,e.join)(n(),"web-auth.json")}function p(){try{let a=o();if(!(0,d.existsSync)(a))return null;let b=(0,d.readFileSync)(a,"utf-8");return JSON.parse(b)}catch{return null}}function q(a){let b=n();(0,d.existsSync)(b)||(0,d.mkdirSync)(b,{recursive:!0}),(0,d.writeFileSync)(o(),JSON.stringify(a,null,2))}function r(){let a=p();return a?.enabled!==!1&&!!a?.passwordHash}function s(a){let b=p();return!!b?.passwordHash&&(0,g.Dm)(a,b.passwordHash)}function t(){let a=p();return a?.passwordHash??"annovibe-default-secret"}function u(){return j(t())}function v(){let a=p();return a?.totp??null}function w(){let a=p();return a?.totp?.status==="enabled"}let x=/^(1|true|yes|on)$/i;function y(a){var b,c;let d=(b=a.trim()).startsWith('"')&&b.endsWith('"')||b.startsWith("'")&&b.endsWith("'")?b.slice(1,-1):b;if(!d||"unknown"===d.toLowerCase())return null;if(d.startsWith("[")){let a=d.indexOf("]");a>0&&(d=d.slice(1,a))}else/^\d+\.\d+\.\d+\.\d+:\d+$/.test(d)&&(d=d.slice(0,d.lastIndexOf(":")));let e=d.indexOf("%");return e>=0&&(d=d.slice(0,e)),(c=d,/^\d+\.\d+\.\d+\.\d+$/.test(c)||c.includes(":"))?d:null}function z(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){let b=parseInt(a,10);if(isNaN(b)||b<0||b>255)return null;c=c<<8|b}return c>>>0}function A(a){let b=p();if(!b?.totp||"enabled"!==b.totp.status)return!1;if("always"===b.totp.requireMode||!b.totp.requireMode)return!0;let c=b.totp.trustedNetworks??["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"];return!function(a,b){if(!a)return!0;for(let c of b)if(function(a,b){if(b.includes(":")){let[c,d]=b.split("/");return 128===parseInt(d??"128",10)&&a===c}return function(a,b){let[c,d]=b.split("/"),e=parseInt(d??"32",10),f=z(a),g=z(c);if(null===f||null===g||e<0||e>32)return!1;let h=0===e?0:-1<<32-e;return(f&h)==(g&h)}(a,b)}(a,c))return!0;return!1}(function(a){if(!x.test(process.env.ANNOVIBE_TRUST_PROXY_HEADERS??""))return null;let b=a.headers.get("forwarded");if(b){let a=b.split(",")[0]?.trim();if(a)for(let b of a.split(";")){let[a,c]=b.split("=",2);if(a?.trim().toLowerCase()==="for"&&c){let a=y(c);if(a)return a}}}let c=a.headers.get("x-forwarded-for");if(c){let a=y(c.split(",")[0]??"");if(a)return a}let d=a.headers.get("x-real-ip");if(d){let a=y(d);if(a)return a}return null}(a),c)}function B(){let a=p();return a?.totp?.status==="enabled"&&a.totp.secret?a.totp.secret:null}function C(a){var b;let c,d=v();b={secret:a,status:"pending",requireMode:d?.requireMode??"always",trustedNetworks:d?.trustedNetworks},(c=p()??{passwordHash:"",enabled:!0}).totp=b,q(c),(0,m.L)("totp_setup_started")}function D(a){let b=p();if(!b?.totp?.secret)throw Error("No pending TOTP setup");b.totp.status="enabled",b.totp.recoveryCodes=a,b.totp.requireMode||(b.totp.requireMode="always"),b.totp.trustedNetworks||(b.totp.trustedNetworks=["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]),q(b),(0,m.L)("totp_enabled")}function E(a){let b=p();b?.totp&&(b.totp.requireMode=a,q(b))}function F(a){let b=p();b?.totp&&(b.totp.trustedNetworks=a,q(b))}function G(){let a=p();a?.totp&&(delete a.totp,q(a),(0,m.L)("totp_disabled"))}function H(a){let b=p();b?.totp?.recoveryCodes&&(b.totp.recoveryCodes=b.totp.recoveryCodes.filter(b=>b!==a),q(b),(0,m.L)("recovery_code_used"))}let I=":annovibe-temp-token";async function J(){let a=t()+I,b=await j(a);return`t:${b}`}async function K(a){if(!a.startsWith("t:"))return!1;let b=a.slice(2),c=t()+I;if(!await k(b,c))return!1;try{let a=b.split(":");if(a.length<3)return!1;let c=parseInt(a[0],10);if(Date.now()-c>12e4)return!1}catch{return!1}return!0}},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")},62814:(a,b,c)=>{"use strict";c.d(b,{L:()=>g});var d=c(29021),e=c(33873),f=c(21820);function g(a,b){try{let c=(0,e.join)(process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent"),"auth-audit.jsonl"),g=(0,e.dirname)(c);(0,d.existsSync)(g)||(0,d.mkdirSync)(g,{recursive:!0});let h={ts:new Date().toISOString(),...b?{ip:b}:{},action:a};(0,d.appendFileSync)(c,JSON.stringify(h)+"\n")}catch{}}},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,4013,716],()=>b(b.s=1050));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9240,a.ids=[9240],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},2072:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>n,VZ:()=>j,Yb:()=>k,b5:()=>o,z3:()=>l});var d=c(69554),e=c(63620),f=c(19426),g=c(34013);let h=null;function i(){if(!h){let a=new d.Xf,b=new e.gZ;h=new f._k({crypto:a,base32:b})}return h}function j(){return i().generateSecret()}function k(a,b,c="AnnoVibe"){return i().toURI({secret:a,label:b,issuer:c})}async function l(a,b){try{return(await i().verify(b,{secret:a,epochTolerance:1})).valid}catch{return!1}}function m(a){return(0,g.Y8)(a,10)}function n(a,b){for(let c of b)if((0,g.Dm)(a,c))return c;return null}function o(){let a=[];for(let b=0;b<8;b++){let b=new Uint8Array(6);globalThis.crypto.getRandomValues(b);let c=Array.from(b,a=>a.toString(16).padStart(2,"0")).join("");a.push(`${c.slice(0,4)}-${c.slice(4,8)}-${c.slice(8,12)}`)}return{codes:a,hashes:a.map(m)}}},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")},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")},31828:(a,b,c)=>{"use strict";c.d(b,{zb:()=>D,Vn:()=>H,yL:()=>u,kR:()=>J,eh:()=>G,US:()=>l,oB:()=>v,I0:()=>B,y2:()=>r,pg:()=>w,yn:()=>E,OJ:()=>F,WG:()=>A,hx:()=>C,BE:()=>s,JZ:()=>K});var d=c(29021),e=c(33873),f=c(21820),g=c(34013);function h(){return process.env.ANNOVIBE_AUTH_SECRET??process.env.PIDEX_AUTH_SECRET??"annovibe-default-secret"}async function i(a,b){let c=new TextEncoder,d=await globalThis.crypto.subtle.importKey("raw",c.encode(a),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return Array.from(new Uint8Array(await globalThis.crypto.subtle.sign("HMAC",d,c.encode(b))),a=>a.toString(16).padStart(2,"0")).join("")}async function j(a){let b,c=a??h(),d=`${Date.now()}:${(b=new Uint8Array(16),globalThis.crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join(""))}`,e=await i(c,d);return`${d}:${e}`}async function k(a,b){try{let c=b??h(),d=a.split(":"),e=d.pop(),f=d.join(":");if(!e||!f)return!1;let g=await i(c,f);if(e.length!==g.length)return!1;let j=0;for(let a=0;a<e.length;a++)j|=e.charCodeAt(a)^g.charCodeAt(a);return 0===j}catch{return!1}}function l(a){return`annovibe-auth=${a}; HttpOnly; SameSite=Lax; Path=/; Max-Age=2592000`}var m=c(62814);function n(){return process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent")}function o(){return(0,e.join)(n(),"web-auth.json")}function p(){try{let a=o();if(!(0,d.existsSync)(a))return null;let b=(0,d.readFileSync)(a,"utf-8");return JSON.parse(b)}catch{return null}}function q(a){let b=n();(0,d.existsSync)(b)||(0,d.mkdirSync)(b,{recursive:!0}),(0,d.writeFileSync)(o(),JSON.stringify(a,null,2))}function r(){let a=p();return a?.enabled!==!1&&!!a?.passwordHash}function s(a){let b=p();return!!b?.passwordHash&&(0,g.Dm)(a,b.passwordHash)}function t(){let a=p();return a?.passwordHash??"annovibe-default-secret"}function u(){return j(t())}function v(){let a=p();return a?.totp??null}function w(){let a=p();return a?.totp?.status==="enabled"}let x=/^(1|true|yes|on)$/i;function y(a){var b,c;let d=(b=a.trim()).startsWith('"')&&b.endsWith('"')||b.startsWith("'")&&b.endsWith("'")?b.slice(1,-1):b;if(!d||"unknown"===d.toLowerCase())return null;if(d.startsWith("[")){let a=d.indexOf("]");a>0&&(d=d.slice(1,a))}else/^\d+\.\d+\.\d+\.\d+:\d+$/.test(d)&&(d=d.slice(0,d.lastIndexOf(":")));let e=d.indexOf("%");return e>=0&&(d=d.slice(0,e)),(c=d,/^\d+\.\d+\.\d+\.\d+$/.test(c)||c.includes(":"))?d:null}function z(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){let b=parseInt(a,10);if(isNaN(b)||b<0||b>255)return null;c=c<<8|b}return c>>>0}function A(a){let b=p();if(!b?.totp||"enabled"!==b.totp.status)return!1;if("always"===b.totp.requireMode||!b.totp.requireMode)return!0;let c=b.totp.trustedNetworks??["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"];return!function(a,b){if(!a)return!0;for(let c of b)if(function(a,b){if(b.includes(":")){let[c,d]=b.split("/");return 128===parseInt(d??"128",10)&&a===c}return function(a,b){let[c,d]=b.split("/"),e=parseInt(d??"32",10),f=z(a),g=z(c);if(null===f||null===g||e<0||e>32)return!1;let h=0===e?0:-1<<32-e;return(f&h)==(g&h)}(a,b)}(a,c))return!0;return!1}(function(a){if(!x.test(process.env.ANNOVIBE_TRUST_PROXY_HEADERS??""))return null;let b=a.headers.get("forwarded");if(b){let a=b.split(",")[0]?.trim();if(a)for(let b of a.split(";")){let[a,c]=b.split("=",2);if(a?.trim().toLowerCase()==="for"&&c){let a=y(c);if(a)return a}}}let c=a.headers.get("x-forwarded-for");if(c){let a=y(c.split(",")[0]??"");if(a)return a}let d=a.headers.get("x-real-ip");if(d){let a=y(d);if(a)return a}return null}(a),c)}function B(){let a=p();return a?.totp?.status==="enabled"&&a.totp.secret?a.totp.secret:null}function C(a){var b;let c,d=v();b={secret:a,status:"pending",requireMode:d?.requireMode??"always",trustedNetworks:d?.trustedNetworks},(c=p()??{passwordHash:"",enabled:!0}).totp=b,q(c),(0,m.L)("totp_setup_started")}function D(a){let b=p();if(!b?.totp?.secret)throw Error("No pending TOTP setup");b.totp.status="enabled",b.totp.recoveryCodes=a,b.totp.requireMode||(b.totp.requireMode="always"),b.totp.trustedNetworks||(b.totp.trustedNetworks=["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]),q(b),(0,m.L)("totp_enabled")}function E(a){let b=p();b?.totp&&(b.totp.requireMode=a,q(b))}function F(a){let b=p();b?.totp&&(b.totp.trustedNetworks=a,q(b))}function G(){let a=p();a?.totp&&(delete a.totp,q(a),(0,m.L)("totp_disabled"))}function H(a){let b=p();b?.totp?.recoveryCodes&&(b.totp.recoveryCodes=b.totp.recoveryCodes.filter(b=>b!==a),q(b),(0,m.L)("recovery_code_used"))}let I=":annovibe-temp-token";async function J(){let a=t()+I,b=await j(a);return`t:${b}`}async function K(a){if(!a.startsWith("t:"))return!1;let b=a.slice(2),c=t()+I;if(!await k(b,c))return!1;try{let a=b.split(":");if(a.length<3)return!1;let c=parseInt(a[0],10);if(Date.now()-c>12e4)return!1}catch{return!1}return!0}},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")},46060:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>G,patchFetch:()=>F,routeModule:()=>B,serverHooks:()=>E,workAsyncStorage:()=>C,workUnitAsyncStorage:()=>D});var d={};c.r(d),c.d(d,{GET:()=>z,POST:()=>A});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(31828),x=c(2072),y=c(62814);async function z(){let a=(0,w.oB)();return v.NextResponse.json({status:a?.status??"disabled",enabled:(0,w.pg)(),requireMode:a?.requireMode??"always",trustedNetworks:a?.trustedNetworks??["127.0.0.0/8","::1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]})}async function A(a){try{let{action:b}=await a.json().catch(()=>({}));if("check-recovery"===b){let{recoveryCode:b}=await a.json();if(!b)return v.NextResponse.json({error:"Recovery code required"},{status:400});let c=(0,w.oB)();if(!c?.recoveryCodes?.length)return v.NextResponse.json({error:"No recovery codes available"},{status:400});let d=(0,x.Ak)(b,c.recoveryCodes);if(!d)return(0,y.L)("totp_verify_fail"),v.NextResponse.json({error:"Invalid recovery code"},{status:401});return(0,w.Vn)(d),v.NextResponse.json({success:!0})}if("setup"===b){let a=(0,x.VZ)();(0,w.hx)(a);let b=(0,x.Yb)(a,"AnnoVibe","AnnoVibe");return v.NextResponse.json({secret:a,uri:b})}if("verify-setup"===b){let b=(0,w.oB)();if(!b||"pending"!==b.status)return v.NextResponse.json({error:"No pending TOTP setup"},{status:400});let{code:c}=await a.json();if(!c||!/^\d{6}$/.test(c))return v.NextResponse.json({error:"6-digit verification code required"},{status:400});if(!await (0,x.z3)(b.secret,c))return(0,y.L)("totp_verify_fail"),v.NextResponse.json({error:"Invalid verification code"},{status:401});let{codes:d,hashes:e}=(0,x.b5)();return(0,w.zb)(e),v.NextResponse.json({success:!0,recoveryCodes:d})}if("disable"===b){let b=(0,w.oB)();if(!b||"enabled"!==b.status)return v.NextResponse.json({error:"TOTP is not enabled"},{status:400});let{code:c}=await a.json();if(!c||!/^\d{6}$/.test(c))return v.NextResponse.json({error:"6-digit verification code required"},{status:400});if(!await (0,x.z3)(b.secret,c))return(0,y.L)("totp_verify_fail"),v.NextResponse.json({error:"Invalid verification code"},{status:401});return(0,w.eh)(),v.NextResponse.json({success:!0})}if("get-recovery-codes"===b){let a=(0,w.oB)();return v.NextResponse.json({recoveryCodesLeft:a?.recoveryCodes?.length??0})}if("set-require-mode"===b){let{requireMode:b}=await a.json();if("always"!==b&&"untrusted"!==b)return v.NextResponse.json({error:"Invalid requireMode. Use 'always' or 'untrusted'"},{status:400});return(0,w.yn)(b),v.NextResponse.json({success:!0})}if("set-trusted-networks"===b){let{trustedNetworks:b}=await a.json();if(!Array.isArray(b))return v.NextResponse.json({error:"trustedNetworks must be an array of CIDR strings"},{status:400});return(0,w.OJ)(b),v.NextResponse.json({success:!0})}return v.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return v.NextResponse.json({error:String(a)},{status:500})}}let B=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/totp/route",pathname:"/api/auth/totp",filename:"route",bundlePath:"app/api/auth/totp/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/totp/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:E}=B;function F(){return(0,g.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})}async function G(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),B.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/totp/route";"/index"===d&&(d="/");let e=await B.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:A,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==A?void 0:A.render404)?await A.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||B.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===B.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==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await B.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)=>B.onRequestError(a,b,d,e,A)},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=>B.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 B.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),b}},k=await B.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 B.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},55511:a=>{"use strict";a.exports=require("crypto")},62814:(a,b,c)=>{"use strict";c.d(b,{L:()=>g});var d=c(29021),e=c(33873),f=c(21820);function g(a,b){try{let c=(0,e.join)(process.env.PI_CODING_AGENT_DIR??(0,e.join)((0,f.homedir)(),".pi","agent"),"auth-audit.jsonl"),g=(0,e.dirname)(c);(0,d.existsSync)(g)||(0,d.mkdirSync)(g,{recursive:!0});let h={ts:new Date().toISOString(),...b?{ip:b}:{},action:a};(0,d.appendFileSync)(c,JSON.stringify(h)+"\n")}catch{}}},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,4013,716],()=>b(b.s=46060));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=976,a.ids=[976],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")},
|
|
1
|
+
(()=>{var a={};a.id=976,a.ids=[976],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")},24707:(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(21820),y=c(33873);async function z(){try{let a=new Date,b=[a.getFullYear(),String(a.getMonth()+1).padStart(2,"0"),String(a.getDate()).padStart(2,"0")].join(""),c=(0,y.join)((0,x.homedir)(),"annovibe","workspace",b);return(0,w.mkdirSync)(c,{recursive:!0}),v.NextResponse.json({cwd:c})}catch(a){return v.NextResponse.json({error:String(a)},{status:500})}}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/default-cwd/route",pathname:"/api/default-cwd",filename:"route",bundlePath:"app/api/default-cwd/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/default-cwd/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/default-cwd/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}}},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")},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=24707));module.exports=c})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(()=>{var a={};a.id=4037,a.ids=[4037],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1304:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>x,POST:()=>z,PUT:()=>y,dynamic:()=>A});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="force-dynamic",B=new Set(["node_modules",".git",".next","dist","build","__pycache__",".turbo",".cache","coverage",".pytest_cache",".mypy_cache","target","vendor",".DS_Store",".git"]),C=[".pyc"],D={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"},E={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"},F={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 D[l(a)]??null}function n(a){return E[l(a)]??null}function o(a){return F[l(a)]??null}let G={html:"text/html; charset=utf-8",htm:"text/html; charset=utf-8",css:"text/css; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",cjs:"text/javascript; charset=utf-8",json:"application/json; charset=utf-8",jsonl:"application/x-ndjson; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml; charset=utf-8",txt:"text/plain; charset=utf-8",md:"text/markdown; charset=utf-8",map:"application/json; charset=utf-8"},H={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 I=/^[a-zA-Z]:[\\/]/;function r(a){return I.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.__piAllowedRootsCache;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(),{readdirSync:g}=await Promise.resolve().then(c.t.bind(c,29021,23));try{for(let a of g(f))/^pi-cwd-\d{8}$/.test(a)&&e.add(i().join(f,a))}catch{}return globalThis.__piAllowedRootsCache={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("read"===h){let b;if(!c.isFile())return e.NextResponse.json({error:"Not a file"},{status:400});if("1"===a.nextUrl.searchParams.get("raw")){let b=m(f);if(b){if(c.size>0xa00000)return e.NextResponse.json({error:"Image too large (>10MB)"},{status:413});return w(f,c,b,a.headers.get("range"))}let d=n(f);if(d)return w(f,c,d,a.headers.get("range"));let g=o(f);if(g){if(c.size>0x3200000)return e.NextResponse.json({error:"Document too large (>50MB)"},{status:413});return w(f,c,g,a.headers.get("range"))}let h=G[l(f)]??null??"text/plain; charset=utf-8",i=p(f);if(c.size>i)return e.NextResponse.json({error:`File too large for preview (>${Math.round(i/1024/1024*10)/10}MB)`},{status:413});return w(f,c,h,a.headers.get("range"))}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 q=g().readFileSync(f,"utf-8"),r=(b=i().basename(f).toLowerCase(),"dockerfile"===b||b.startsWith("dockerfile.")?"dockerfile":".env"===b||b.startsWith(".env.")?"bash":"makefile"===b||"gnumakefile"===b?"makefile":H[b.split(".").pop()??""]??"text");return e.NextResponse.json({content:q,language:r,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=>!B.has(a)&&!C.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)}})},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")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},21820:a=>{"use strict";a.exports=require("os")},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")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>q,DK:()=>r,O8:()=>p,Uv:()=>s,dQ:()=>l,m1:()=>m,os:()=>o});var e=c(75430),f=c(12039),g=c(74788),h=c(29021),i=c(33873),j=a([e,g]);function k(a,b,c,d){return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}async function l(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=(0,g.tS)();return k(a,b,c,n())}async function m(a){let b=[];for(let c of a){let a=function(a){let b=(0,i.resolve)(a),c=`--${b.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`;return(0,i.join)((0,e.getAgentDir)(),"sessions",c)}(c);if((0,h.existsSync)(a))try{let c=await e.SessionManager.listAll(a);b.push(...c)}catch{}}let c=new Map;for(let a of b)c.set(a.path,a.id);let d=(0,g.tS)();return k(b,c,d,n())}function n(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function o(a){let b=n().get(a);return b||(await l(),n().get(a)??null)}function p(a,b){n().set(a,b)}function q(a){n().delete(a)}function r(a){return e.SessionManager.open(a).getEntries()}function s(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
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=>!B.has(a)&&!C.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)}})},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")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},16700:(a,b,c)=>{"use strict";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/annovibe/annovibe/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)}})},21820:a=>{"use strict";a.exports=require("os")},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")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>q,DK:()=>r,O8:()=>p,Uv:()=>s,dQ:()=>l,m1:()=>m,os:()=>o});var e=c(75430),f=c(12039),g=c(74788),h=c(29021),i=c(33873),j=a([e,g]);function k(a,b,c,d){return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}async function l(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=(0,g.tS)();return k(a,b,c,n())}async function m(a){let b=[];for(let c of a){let a=function(a){let b=(0,i.resolve)(a),c=`--${b.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`;return(0,i.join)((0,e.getAgentDir)(),"sessions",c)}(c);if((0,h.existsSync)(a))try{let c=await e.SessionManager.listAll(a);b.push(...c)}catch{}}let c=new Map;for(let a of b)c.set(a.path,a.id);let d=(0,g.tS)();return k(b,c,d,n())}function n(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function o(a){let b=n().get(a);return b||(await l(),n().get(a)??null)}function p(a,b){n().set(a,b)}function q(a){n().delete(a)}function r(a){return e.SessionManager.open(a).getEntries()}function s(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
5
5
|
|
|
6
|
-
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=j.then?(await j)():j,d()}catch(a){d(a)}})},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")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}
|
|
6
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=j.then?(await j)():j,d()}catch(a){d(a)}})},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")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},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=16700));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=2234,a.ids=[2234],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")},
|
|
1
|
+
(()=>{var a={};a.id=2234,a.ids=[2234],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")},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")},60110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>A,PUT:()=>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(23211),w=c(29021),x=c(33873),y=c(21820),z=c(66469);async function A(){try{let a,b=(a=process.env.PI_CODING_AGENT_DIR??(0,x.join)((0,y.homedir)(),".pi","agent"),(0,z.td)(a));if(!(0,w.existsSync)(b))return v.NextResponse.json({content:"",exists:!1});let c=(0,w.readFileSync)(b,"utf-8");return v.NextResponse.json({content:c,exists:!0,size:Buffer.byteLength(c,"utf-8")})}catch(a){return v.NextResponse.json({error:String(a)},{status:500})}}async function B(a){try{let b=await a.json();if("string"!=typeof b.content)return v.NextResponse.json({error:"Missing 'content' field"},{status:400});let c=(0,z.bo)(process.env.PI_CODING_AGENT_DIR??(0,x.join)((0,y.homedir)(),".pi","agent"));return(0,w.mkdirSync)((0,x.dirname)(c),{recursive:!0}),(0,w.writeFileSync)(c,b.content,"utf-8"),v.NextResponse.json({success:!0})}catch(a){return v.NextResponse.json({error:String(a)},{status:500})}}let C=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/annovibe/annovibe/app/api/harness/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/harness/route";"/index"===d&&(d="/");let e=await C.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:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.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||C.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===C.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==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await C.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)=>C.onRequestError(a,b,d,e,A)},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=>C.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&&B&&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 C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await C.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,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",B?"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 C.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66469:(a,b,c)=>{"use strict";c.d(b,{Is:()=>m,Ko:()=>h,M3:()=>k,Tg:()=>l,bo:()=>i,o7:()=>j,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){return(0,e.join)(a,"SOUL.md")}function i(a){return(0,e.join)(a,"HARNESS.md")}function j(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 k(a){return(0,e.join)(a,"MEMORY.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")}},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=60110));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")},16408:(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/annovibe/annovibe/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}}},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")},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=16408));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=7253,a.ids=[7253],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6276:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>m});var e=c(23211),f=c(29021),g=c(56429),h=c(31761),i=c(81896),j=c(40402),k=a([g,h,i,j]);[g,h,i,j]=k.then?(await k)():k;let m="force-dynamic";async function l(a){if(!(0,i.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});let b=await a.json(),c=(b.cwd??"").trim(),d=(b.userId??"").trim();if(!c||!d)return e.NextResponse.json({error:"Missing cwd or userId"},{status:400});if(!(0,f.existsSync)(c))return e.NextResponse.json({error:`Directory does not exist: ${c}`},{status:400});let k=(0,h.Mj)(c);if(!k?.sessionId)return e.NextResponse.json({ok:!1,cancelled:!1,reply:"No active session"});let l=(0,g.A4)(k.sessionId);if(!l?.isAlive()){let a=await (0,j.os)(k.sessionId);a&&(l=(await (0,g.OF)(k.sessionId,a,c,void 0,"im")).session)}if(!l?.isAlive()||!l.isBusy())return e.NextResponse.json({ok:!1,cancelled:!1,reply:"当前没有可取消的任务。",sessionId:k.sessionId});try{return await l.send({type:"abort"}),e.NextResponse.json({ok:!0,cancelled:!0,reply:"已取消当前任务。",sessionId:l.sessionId})}catch(a){return e.NextResponse.json({ok:!1,cancelled:!1,reply:a instanceof Error?a.message:String(a)})}}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")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},
|
|
1
|
+
"use strict";(()=>{var a={};a.id=7253,a.ids=[7253],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6276:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>m});var e=c(23211),f=c(29021),g=c(56429),h=c(31761),i=c(81896),j=c(40402),k=a([g,h,i,j]);[g,h,i,j]=k.then?(await k)():k;let m="force-dynamic";async function l(a){if(!(0,i.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});let b=await a.json(),c=(b.cwd??"").trim(),d=(b.userId??"").trim();if(!c||!d)return e.NextResponse.json({error:"Missing cwd or userId"},{status:400});if(!(0,f.existsSync)(c))return e.NextResponse.json({error:`Directory does not exist: ${c}`},{status:400});let k=(0,h.Mj)(c);if(!k?.sessionId)return e.NextResponse.json({ok:!1,cancelled:!1,reply:"No active session"});let l=(0,g.A4)(k.sessionId);if(!l?.isAlive()){let a=await (0,j.os)(k.sessionId);a&&(l=(await (0,g.OF)(k.sessionId,a,c,void 0,"im")).session)}if(!l?.isAlive()||!l.isBusy())return e.NextResponse.json({ok:!1,cancelled:!1,reply:"当前没有可取消的任务。",sessionId:k.sessionId});try{return await l.send({type:"abort"}),e.NextResponse.json({ok:!0,cancelled:!0,reply:"已取消当前任务。",sessionId:l.sessionId})}catch(a){return e.NextResponse.json({ok:!1,cancelled:!1,reply:a instanceof Error?a.message:String(a)})}}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")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},60036:(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(6276),w=a([v]);v=(w.then?(await w)():w)[0];let z=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/annovibe/annovibe/app/api/im/cancel/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/im/cancel/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")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},81896:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D:()=>h,N:()=>g});var e=c(31761),f=a([e]);function g(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 h(a){let b=(0,e.SR)(),c=b?.token?.trim();if(!c)return g(a);let d=a.headers.get("authorization");if(!d)return!1;let f=d.match(/^Bearer\s+(.+)$/i);return!!f&&f[1].trim()===c}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7914,6429,1761],()=>b(b.s=60036));module.exports=c})();
|