@seqyuan/annovibe 0.8.136 → 0.8.138
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 +11 -15
- package/.next/build-manifest.json +6 -6
- package/.next/diagnostics/framework.json +1 -1
- package/.next/prerender-manifest.json +33 -3
- package/.next/react-loadable-manifest.json +60 -60
- package/.next/required-server-files.js +45 -10
- package/.next/required-server-files.json +45 -10
- package/.next/routes-manifest.json +0 -30
- package/.next/server/app/_global-error/page.js +6 -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.meta +24 -5
- package/.next/server/app/_global-error.rsc +19 -12
- package/.next/server/app/_global-error.segments/_full.segment.rsc +19 -12
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +25 -4
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +3 -1
- package/.next/server/app/_not-found/page.js +5 -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.meta +24 -5
- package/.next/server/app/_not-found.rsc +24 -16
- package/.next/server/app/_not-found.segments/_full.segment.rsc +24 -16
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +30 -4
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -2
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/prepare/route.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +2 -2
- package/.next/server/app/api/agent/running/events/route.js +2 -2
- package/.next/server/app/api/agent/running/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 +2 -2
- 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/debug-models/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/file-index/route.js +1 -1
- package/.next/server/app/api/file-tree/delete/route.js +1 -1
- package/.next/server/app/api/file-tree/mkdir/route.js +1 -1
- package/.next/server/app/api/file-tree/rename/route.js +1 -1
- package/.next/server/app/api/file-tree/reveal/route.js +1 -1
- package/.next/server/app/api/file-tree/write/route.js +1 -1
- package/.next/server/app/api/file-watch/route.js +3 -3
- package/.next/server/app/api/files/[...path]/route.js +1 -1
- package/.next/server/app/api/harness/route.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/im/cancel/route.js +1 -1
- package/.next/server/app/api/im/gateway-status/route.js +1 -1
- package/.next/server/app/api/im/project/route.js +1 -1
- package/.next/server/app/api/im/projects/route.js +1 -1
- package/.next/server/app/api/im/session-ids/route.js +1 -1
- package/.next/server/app/api/im/turn/route.js +3 -3
- package/.next/server/app/api/images/upload/route.js +1 -1
- package/.next/server/app/api/internal/runtime/route.js +1 -1
- package/.next/server/app/api/memory/dismiss/route.js +3 -3
- package/.next/server/app/api/memory/promote/route.js +3 -3
- 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/plugins/route.js +1 -1
- package/.next/server/app/api/project-trust/route.js +1 -1
- package/.next/server/app/api/projects/browse/route.js +1 -1
- package/.next/server/app/api/projects/route.js +1 -1
- package/.next/server/app/api/search/route.js +1 -1
- package/.next/server/app/api/session-index/events/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +7 -8
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/media/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/shadowed/route.js +1 -1
- package/.next/server/app/api/sessions/new/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +5 -5
- package/.next/server/app/api/skills/route.js +5 -5
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/update/route.js +2 -2
- package/.next/server/app/api/smoke/prompt-admission/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/favicon.ico.meta +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/icon.svg.meta +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.meta +19 -4
- package/.next/server/app/index.rsc +33 -15
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +38 -5
- package/.next/server/app/index.segments/_full.segment.rsc +33 -15
- package/.next/server/app/index.segments/_tree.segment.rsc +3 -2
- package/.next/server/app/login/page.js +5 -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.meta +24 -5
- package/.next/server/app/login.rsc +29 -20
- package/.next/server/app/login.segments/_full.segment.rsc +29 -20
- package/.next/server/app/login.segments/_tree.segment.rsc +4 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +35 -8
- package/.next/server/app/page.js +14 -37
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/page.js +5 -6
- package/.next/server/app/smoke/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/session-stream/page.js +1 -2
- package/.next/server/app/smoke/session-stream/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/session-stream.html +1 -1
- package/.next/server/app/smoke/session-stream.meta +29 -6
- package/.next/server/app/smoke/session-stream.rsc +36 -20
- package/.next/server/app/smoke/session-stream.segments/_full.segment.rsc +36 -20
- package/.next/server/app/smoke/session-stream.segments/_tree.segment.rsc +5 -2
- package/.next/server/app/smoke/session-stream.segments/smoke/session-stream/__PAGE__.segment.rsc +43 -8
- package/.next/server/app/smoke.html +2 -2
- package/.next/server/app/smoke.meta +24 -5
- package/.next/server/app/smoke.rsc +37 -20
- package/.next/server/app/smoke.segments/_full.segment.rsc +37 -20
- package/.next/server/app/smoke.segments/_tree.segment.rsc +4 -2
- package/.next/server/app/smoke.segments/smoke/__PAGE__.segment.rsc +43 -8
- package/.next/server/app-paths-manifest.json +11 -15
- package/.next/server/chunks/1367.js +1 -1
- package/.next/server/chunks/1681.js +1 -1
- package/.next/server/chunks/1688.js +3 -3
- package/.next/server/chunks/1761.js +1 -1
- package/.next/server/chunks/1813.js +23 -1
- package/.next/server/chunks/2242.js +1 -1
- package/.next/server/chunks/2325.js +28 -28
- package/.next/server/chunks/2671.js +2 -2
- package/.next/server/chunks/2970.js +46 -0
- package/.next/server/chunks/402.js +1 -1
- package/.next/server/chunks/42.js +44 -44
- package/.next/server/chunks/4367.js +1 -1
- package/.next/server/chunks/4406.js +1 -1
- package/.next/server/chunks/4779.js +1 -0
- package/.next/server/chunks/4980.js +1 -1
- package/.next/server/chunks/5193.js +3 -3
- package/.next/server/chunks/5715.js +1 -1
- package/.next/server/chunks/5851.js +1 -1
- package/.next/server/chunks/6346.js +1 -1
- package/.next/server/chunks/6429.js +15 -15
- package/.next/server/chunks/6644.js +108 -0
- package/.next/server/chunks/707.js +1 -1
- package/.next/server/chunks/716.js +1 -1
- package/.next/server/chunks/7307.js +1 -1
- package/.next/server/chunks/7365.js +1 -1
- package/.next/server/chunks/7603.js +1 -0
- package/.next/server/chunks/7765.js +1 -1
- package/.next/server/chunks/7890.js +1 -1
- package/.next/server/chunks/8305.js +264 -0
- package/.next/server/chunks/8363.js +1 -1
- package/.next/server/chunks/8797.js +1 -1
- package/.next/server/chunks/8973.js +1 -1
- package/.next/server/chunks/9868.js +1 -1
- package/.next/server/chunks/static/media/pdf.worker.min.94f8ceaf.mjs +6 -0
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +54 -6
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/prefetch-hints.json +86 -1
- package/.next/server/preview-props.json +5 -0
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{0b9a0da7-9075af772487e743.js → 0b9a0da7-373b544740862358.js} +1 -1
- package/.next/static/chunks/{1209.6d037cb2674eafa2.js → 1209.4f7491c863d512f0.js} +1 -1
- package/.next/static/chunks/2170a4aa.4301f7c49f3f0a6e.js +1 -0
- package/.next/static/chunks/2254-db22997b60e1dc27.js +1 -0
- package/.next/static/chunks/2619.8f686be8e2479c20.js +1 -0
- package/.next/static/chunks/{2623.d20fabd8e18197c6.js → 2623.a6bf38491c50cb6e.js} +2 -2
- package/.next/static/chunks/2693-421c2e9d9c92a666.js +173 -0
- package/.next/static/chunks/{2774.0811cda036dfeb94.js → 2774.ba50ba9e8b3ebf4a.js} +1 -1
- package/.next/static/chunks/2821.d15f14bd03d9d290.js +1 -0
- package/.next/static/chunks/{291-bfdfc8bcf5d0a962.js → 291-e0c3c616f67fe126.js} +1 -1
- package/.next/static/chunks/{3307.e638f7fa43f28bac.js → 3307.c87aab94f4464604.js} +1 -1
- package/.next/static/chunks/363642f4-a09fcaca7af039e5.js +1 -0
- package/.next/static/chunks/{3689.0336d97dde6c9084.js → 3689.93592a22c737d185.js} +1 -1
- package/.next/static/chunks/3794-fba3f76785a3c234.js +52 -0
- package/.next/static/chunks/{425.9a3434a28926566a.js → 425.8fe80c34648b01ec.js} +1 -1
- package/.next/static/chunks/{4453.91a357dc43c21745.js → 4453.ba05c4805425ceeb.js} +1 -1
- package/.next/static/chunks/4936-799f05324bb5c236.js +1 -0
- package/.next/static/chunks/4bd1b696-8cd12253b448cc13.js +1 -0
- package/.next/static/chunks/51fb665c.b01d5a04c27e9091.js +45 -0
- package/.next/static/chunks/{547.902a733488cfe3f7.js → 547.0f08d4931c0f04a2.js} +1 -1
- package/.next/static/chunks/{5567.540d7fc108ad6ee5.js → 5567.6674301d1337d738.js} +1 -1
- package/.next/static/chunks/5618-8aecfc54df369be5.js +22 -0
- package/.next/static/chunks/{58bb9007.1ccb6bba34b4c635.js → 58bb9007.3d4e7356b1e96b6a.js} +28 -28
- package/.next/static/chunks/6121.333d793734b9abf7.js +1 -0
- package/.next/static/chunks/6586.775a449050e0e9cc.js +138 -0
- package/.next/static/chunks/{6696.a41aec266e657d54.js → 6696.345b3cd62db13cb6.js} +1 -1
- package/.next/static/chunks/{7874.8db6929b94cdf697.js → 7874.7faccf8fab087120.js} +1 -1
- package/.next/static/chunks/8489.514938fd5e801cf7.js +36 -0
- package/.next/static/chunks/{8863.8b769013468d83d4.js → 8863.2ae457485a63aa22.js} +1 -1
- package/.next/static/chunks/90542734.6b9fbcabf095d1a0.js +1 -0
- package/.next/static/chunks/9867-1b73c62e8b604095.js +260 -0
- package/.next/static/chunks/app/_global-error/page-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/prepare/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/agent/running/events/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/agent/runtime/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/apps/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/auth/totp/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/debug-models/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/file-tree/delete/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/file-tree/mkdir/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/file-tree/rename/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/file-tree/reveal/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/file-tree/write/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/file-watch/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/harness/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/home/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/im/cancel/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/im/gateway-status/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/im/project/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/im/projects/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/im/session-ids/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/im/turn/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/images/upload/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/internal/runtime/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/memory/dismiss/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/memory/promote/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/models/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/save/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/status/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/stop/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/project-trust/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/projects/browse/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/projects/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/search/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/session-index/events/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/media/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/shadowed/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/settings/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/skills/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/smoke/prompt-admission/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/soul/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/subagents/status/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/api/version/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/error-6309e3e4cdf79d40.js +3 -0
- package/.next/static/chunks/app/favicon.ico/route-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/app/global-error-7595c826cec2c048.js +3 -0
- package/.next/static/chunks/app/layout-31265427e43f6876.js +1 -0
- package/.next/static/chunks/app/page-2e2760a4cdaff534.js +22 -0
- package/.next/static/chunks/app/smoke/{page-32674afc320aa48b.js → page-82db33b4fdd2e0b4.js} +3 -3
- package/.next/static/chunks/framework-461b899b66554474.js +1 -0
- package/.next/static/chunks/main-4c5c62a3f03fc745.js +5 -0
- package/.next/static/chunks/main-app-a8a207cb34d209aa.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ebf7ae60150d40d4.js +1 -0
- package/.next/static/chunks/{webpack-0d1f7348ddb20bdc.js → webpack-36fa69ae1e15e7ce.js} +1 -1
- package/.next/static/css/{738b0b1c24aae500.css → d68ecb6695873888.css} +1 -1
- package/.next/static/media/pdf.worker.min.7a62f52c.mjs +6 -0
- package/.next/static/r3Awszl0kNf_sRFX-3vDi/_buildManifest.js +1 -0
- package/bin/annovibe-im-gateway.js +98 -21
- package/bin/pi-web.js +16 -9
- package/package.json +3 -3
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_head.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_index.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
- package/.next/server/app/_not-found.segments/_index.segment.rsc +0 -7
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
- package/.next/server/app/api/im/gateway-token/route.js +0 -1
- package/.next/server/app/api/im/gateway-token/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/[id]/kernel-state/route.js +0 -1
- package/.next/server/app/api/sessions/[id]/kernel-state/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/[id]/workbench-artifact/route.js +0 -1
- package/.next/server/app/api/sessions/[id]/workbench-artifact/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/[id]/workbench-review/route.js +0 -1
- package/.next/server/app/api/sessions/[id]/workbench-review/route_client-reference-manifest.js +0 -1
- package/.next/server/app/index.segments/_head.segment.rsc +0 -6
- package/.next/server/app/index.segments/_index.segment.rsc +0 -7
- package/.next/server/app/login.segments/_head.segment.rsc +0 -6
- package/.next/server/app/login.segments/_index.segment.rsc +0 -7
- package/.next/server/app/login.segments/login.segment.rsc +0 -5
- package/.next/server/app/smoke/session-stream.segments/_head.segment.rsc +0 -6
- package/.next/server/app/smoke/session-stream.segments/_index.segment.rsc +0 -7
- package/.next/server/app/smoke/session-stream.segments/smoke/session-stream.segment.rsc +0 -5
- package/.next/server/app/smoke/session-stream.segments/smoke.segment.rsc +0 -5
- package/.next/server/app/smoke.segments/_head.segment.rsc +0 -6
- package/.next/server/app/smoke.segments/_index.segment.rsc +0 -7
- package/.next/server/app/smoke.segments/smoke.segment.rsc +0 -5
- package/.next/server/chunks/2562.js +0 -12
- package/.next/server/chunks/4741.js +0 -18
- package/.next/server/chunks/63.js +0 -45
- package/.next/server/chunks/7303.js +0 -260
- package/.next/server/chunks/8304.js +0 -1
- package/.next/server/chunks/static/media/pdf.worker.min.c476e1a0.mjs +0 -6
- package/.next/static/chunks/2170a4aa.4213bb2183c9cdf9.js +0 -1
- package/.next/static/chunks/2254-fa3fcc88564ee18d.js +0 -1
- package/.next/static/chunks/2619.9aac8983f30c7c8a.js +0 -1
- package/.next/static/chunks/2693-52c358cf5d84b069.js +0 -173
- package/.next/static/chunks/2821.934bcf60fbdc28c6.js +0 -1
- package/.next/static/chunks/363642f4-dc35a7a659350f8e.js +0 -1
- package/.next/static/chunks/3794-123fdf632563f469.js +0 -32
- package/.next/static/chunks/4936-9558484c46c3ecc8.js +0 -1
- package/.next/static/chunks/4bd1b696-e356ca5ba0218e27.js +0 -1
- package/.next/static/chunks/51fb665c.e2bfdae35ef4d790.js +0 -45
- package/.next/static/chunks/5618-5e2e47e6ed401a75.js +0 -22
- package/.next/static/chunks/6121.f3f43f1896ea0cd9.js +0 -1
- package/.next/static/chunks/6586.8c2a88c2a55300d2.js +0 -138
- package/.next/static/chunks/8489.45f22859734f514f.js +0 -36
- package/.next/static/chunks/90542734.ecc36ada79772529.js +0 -1
- package/.next/static/chunks/9867-b1d15d9354f100e7.js +0 -260
- package/.next/static/chunks/app/_global-error/page-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/prepare/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/agent/running/events/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/agent/runtime/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/apps/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/auth/totp/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/debug-models/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/file-tree/delete/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/file-tree/mkdir/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/file-tree/rename/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/file-tree/reveal/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/file-tree/write/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/file-watch/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/harness/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/home/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/im/cancel/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/im/gateway-status/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/im/gateway-token/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/im/project/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/im/projects/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/im/session-ids/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/im/turn/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/images/upload/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/internal/runtime/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/memory/dismiss/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/memory/promote/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/models/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/save/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/status/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/stop/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/project-trust/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/projects/browse/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/projects/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/search/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/session-index/events/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/kernel-state/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/media/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/shadowed/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/workbench-artifact/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/workbench-review/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/new/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/settings/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/skills/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/smoke/prompt-admission/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/soul/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/subagents/status/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/api/version/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/favicon.ico/route-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/app/layout-101c4ccdf12880f0.js +0 -1
- package/.next/static/chunks/app/page-703d91d8bff67f70.js +0 -44
- package/.next/static/chunks/framework-594babcea68f40f6.js +0 -1
- package/.next/static/chunks/main-0371fd3122de9512.js +0 -5
- package/.next/static/chunks/main-app-8d81a93b58bb990f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-a7f3f044c72f9137.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dcc4d4b28dc1e9eb.js +0 -1
- package/.next/static/media/pdf.worker.min.29aaf158.mjs +0 -6
- package/.next/static/zeWki1Z47rqBkR2ph5H6N/_buildManifest.js +0 -1
- /package/.next/static/{zeWki1Z47rqBkR2ph5H6N → r3Awszl0kNf_sRFX-3vDi}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=2752,a.ids=[2752],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28327:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=c(96640),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){let b=new URL(a.url).searchParams.get("cwd");return e.NextResponse.json({runningVersion:"0.8.
|
|
1
|
+
"use strict";(()=>{var a={};a.id=2752,a.ids=[2752],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")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28327:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=c(96640),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){let b=new URL(a.url).searchParams.get("cwd");return e.NextResponse.json({runningVersion:"0.8.138",pid:process.pid,uptimeSeconds:Math.round(process.uptime()),...(0,f.Bj)(),memory:b?(0,g.Wb)(b):null})}d()}catch(a){d(a)}})},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")},32628:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/agent/runtime/route",pathname:"/api/agent/runtime",filename:"route",bundlePath:"app/api/agent/runtime/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/agent/runtime/route.ts",nextConfigOutput:"",userland:()=>c(28327),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/runtime/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.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==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},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")},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")},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,[2970,1813,5193,7831,402,6429],()=>b(b.s=32628));module.exports=c})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6442,a.ids=[6442],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8977:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>p,GET:()=>k,HEAD:()=>l,OPTIONS:()=>q,PATCH:()=>o,POST:()=>m,PUT:()=>n,dynamic:()=>r});var e=c(37625),f=a([e]);e=(f.then?(await f)():f)[0];let r="force-dynamic",s=new Set(["connection","content-encoding","content-length","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade"]),t=["text/html","application/javascript","text/javascript","application/json","text/css","application/manifest+json"];function g(a){return`/api/apps/${encodeURIComponent(a)}`}function h(a,b,c){let d=new URL(a.url),e=c?.length?`/${c.map(encodeURIComponent).join("/")}`:"/";return`http://127.0.0.1:${b}${e}${d.search}`}function i(a,b){return new Response(b,{status:503,headers:{"Content-Type":"text/plain; charset=utf-8","Cache-Control":"no-cache","Retry-After":"1",...a?.appType==="h5adexp"?{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}:{}}})}async function j(a,b,c){var d;let f,j,k=(0,e.N5)(b);if(!k||"starting"!==k.status&&"running"!==k.status)return new Response("App is not running",{status:404});if("h5adexp"===k.appType&&"starting"===k.status&&!await (0,e.Yq)(k,15e3))return i(k,k.error??`${k.title} is still starting.`);let l=new Headers(a.headers);for(let a of s)l.delete(a);l.delete("host");let m=a.method.toUpperCase(),n="GET"===m||"HEAD"===m?void 0:await a.arrayBuffer();try{f=await fetch(h(a,k.port,c),{method:m,headers:l,body:n,redirect:"manual"})}catch(b){if(!("h5adexp"===k.appType&&await (0,e.Yq)(k,2e3)))return i(k,b instanceof Error?b.message:String(b));f=await fetch(h(a,k.port,c),{method:m,headers:l,body:n,redirect:"manual"})}let o=new Headers;f.headers.forEach((a,b)=>{s.has(b.toLowerCase())||o.set(b,a)});let p=function(a,b){if(!a)return a;if(a.startsWith("/"))return`${g(b)}${a}`;try{let c=new URL(a);return`${g(b)}${c.pathname}${c.search}`}catch{return a}}(f.headers.get("location"),b);if(p&&o.set("location",p),o.set("Cache-Control","no-cache"),"h5adexp"===k.appType&&(o.delete("content-security-policy"),o.delete("x-frame-options"),o.set("Cross-Origin-Opener-Policy","same-origin"),o.set("Cross-Origin-Embedder-Policy","require-corp")),"h5adexp"===k.appType&&(j=(f.headers.get("content-type")??"").toLowerCase(),t.some(a=>j.includes(a)))){let a;return o.delete("content-length"),new Response((d=await f.text(),a=g(b),d.replace(/(["'(`])\/api\//g,`$1${a}/api/`).replace(/(["'`])\/api(["'`])/g,`$1${a}/api$2`).replace(/(["'(`])\/static\//g,`$1${a}/static/`).replace(/(["'(`])\/serviceworker\.js/g,`$1${a}/serviceworker.js`).replace(/(["'(`])\/service-worker\.js/g,`$1${a}/service-worker.js`).replace(/(["'(`])\/manifest\.json/g,`$1${a}/manifest.json`).replace(/(["'(`])\/favicon\.ico/g,`$1${a}/favicon.ico`).replace(/(["'(`])\/logo192\.png/g,`$1${a}/logo192.png`).replace(/url\((['"]?)\/static\//g,`url($1${a}/static/`).replace(/n\.p="\//g,`n.p="${a}/`)),{status:f.status,statusText:f.statusText,headers:o})}return new Response(f.body,{status:f.status,statusText:f.statusText,headers:o})}async function k(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function l(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function m(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function n(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function o(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function p(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function q(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},28354:a=>{"use strict";a.exports=require("util")},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")},31421:a=>{"use strict";a.exports=require("node:child_process")},33873:a=>{"use strict";a.exports=require("path")},37625:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$4:()=>C,N5:()=>D,PZ:()=>H,Yq:()=>v,el:()=>E,sg:()=>G,vN:()=>F});var e=c(79646),f=c(91645),g=c(29021),h=c(33873),i=c(55511),j=c(28354),k=c(75430),l=c(15193),m=a([k]);k=(m.then?(await m)():m)[0];let I=(0,j.promisify)(e.execFile);function n(){return globalThis.__annovibeExternalApps||(globalThis.__annovibeExternalApps=new Map),globalThis.__annovibeExternalApps}function o(a){return`${a.appType}:${a.cwd}:${a.sessionId??""}:${a.filePath}`}function p(a,b){let c=String(b).split(/\r?\n/).filter(Boolean);a.logs.push(...c.map(a=>`[${new Date().toISOString()}] ${a}`)),a.logs.length>160&&a.logs.splice(0,a.logs.length-160)}function q(a){if(!a)return!1;try{return process.kill(a,0),!0}catch{return!1}}function r(a){return"starting"!==a.status&&"running"!==a.status||q(a.pid)||(a.status="stopped",a.error??=`${a.title} process is no longer running.`),a}async function s(a){if(!a||!q(a))return null;try{let{stdout:b}=await I("ps",["-o","rss=","-p",String(a)],{timeout:2500}),c=Number(b.trim().split(/\s+/)[0]);return Number.isFinite(c)?1024*c:null}catch{return null}}function t(a){return new Promise(b=>setTimeout(b,a))}async function u(a,b){let c=new AbortController,d=setTimeout(()=>c.abort(),b);try{return await fetch(a,{signal:c.signal,cache:"no-store"})}finally{clearTimeout(d)}}async function v(a,b){if(r(a),"error"===a.status||"stopped"===a.status)return!1;if("h5adexp"!==a.appType)return await t(900),r(a),"starting"===a.status&&q(a.pid)&&(a.status="running"),"running"===a.status;let c=Date.now()+(b??45e3),d="";for(;Date.now()<c;){let b=r(a);if("error"===b.status||"stopped"===b.status)return!1;try{let b=await u(`http://127.0.0.1:${a.port}/api/health`,1500);if(b.ok)return a.status="running",a.error=void 0,a.lastActivity=new Date().toISOString(),!0;d=`health returned HTTP ${b.status}`}catch(a){d=a instanceof Error?a.message:String(a)}await t(250)}return"starting"===a.status&&(a.error=`${a.title} did not become ready within ${b??45e3}ms${d?`; last error: ${d}`:""}.`,p(a,a.error)),!1}async function w(){return new Promise((a,b)=>{let c=(0,f.createServer)();c.unref(),c.on("error",b),c.listen(0,"127.0.0.1",()=>{let b=c.address(),d="object"==typeof b&&b?b.port:0;c.close(()=>a(d))})})}function x(a){return"h5adexp"===a?[".h5ad"]:[".rds",".qs"]}function y(a){return x(a).join(" or ")}function z(a){return"h5adexp"===a?"H5AD Exp":"stexp"}async function A(a){return(0,l.EO)({language:"r",cwd:a,policy:l.sE})}async function B(a,b){if("stexp"===a.appType){let b,c=await A(a.cwd),d=(b=(0,h.resolve)(process.cwd(),"..","stexp"),(0,g.existsSync)((0,h.join)(b,"DESCRIPTION"))?b:null);return p(a,`Using R kernel: ${c.command} ${c.args.join(" ")} (${c.source}${c.kernelId?`:${c.kernelId}`:""})`),d&&p(a,`Using local stexp package source: ${d}`),(0,e.spawn)(c.command,[...c.args,"-e",[d?`if (!requireNamespace('stexp', quietly = TRUE)) {
|
|
1
|
+
(()=>{var a={};a.id=6442,a.ids=[6442],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},8977:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>p,GET:()=>k,HEAD:()=>l,OPTIONS:()=>q,PATCH:()=>o,POST:()=>m,PUT:()=>n,dynamic:()=>r});var e=c(37625),f=a([e]);e=(f.then?(await f)():f)[0];let r="force-dynamic",s=new Set(["connection","content-encoding","content-length","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade"]),t=["text/html","application/javascript","text/javascript","application/json","text/css","application/manifest+json"];function g(a){return`/api/apps/${encodeURIComponent(a)}`}function h(a,b,c){let d=new URL(a.url),e=c?.length?`/${c.map(encodeURIComponent).join("/")}`:"/";return`http://127.0.0.1:${b}${e}${d.search}`}function i(a,b){return new Response(b,{status:503,headers:{"Content-Type":"text/plain; charset=utf-8","Cache-Control":"no-cache","Retry-After":"1",...a?.appType==="h5adexp"?{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}:{}}})}async function j(a,b,c){var d;let f,j,k=(0,e.N5)(b);if(!k||"starting"!==k.status&&"running"!==k.status)return new Response("App is not running",{status:404});if("h5adexp"===k.appType&&"starting"===k.status&&!await (0,e.Yq)(k,15e3))return i(k,k.error??`${k.title} is still starting.`);let l=new Headers(a.headers);for(let a of s)l.delete(a);l.delete("host");let m=a.method.toUpperCase(),n="GET"===m||"HEAD"===m?void 0:await a.arrayBuffer();try{f=await fetch(h(a,k.port,c),{method:m,headers:l,body:n,redirect:"manual"})}catch(b){if(!("h5adexp"===k.appType&&await (0,e.Yq)(k,2e3)))return i(k,b instanceof Error?b.message:String(b));f=await fetch(h(a,k.port,c),{method:m,headers:l,body:n,redirect:"manual"})}let o=new Headers;f.headers.forEach((a,b)=>{s.has(b.toLowerCase())||o.set(b,a)});let p=function(a,b){if(!a)return a;if(a.startsWith("/"))return`${g(b)}${a}`;try{let c=new URL(a);return`${g(b)}${c.pathname}${c.search}`}catch{return a}}(f.headers.get("location"),b);if(p&&o.set("location",p),o.set("Cache-Control","no-cache"),"h5adexp"===k.appType&&(o.delete("content-security-policy"),o.delete("x-frame-options"),o.set("Cross-Origin-Opener-Policy","same-origin"),o.set("Cross-Origin-Embedder-Policy","require-corp")),"h5adexp"===k.appType&&(j=(f.headers.get("content-type")??"").toLowerCase(),t.some(a=>j.includes(a)))){let a;return o.delete("content-length"),new Response((d=await f.text(),a=g(b),d.replace(/(["'(`])\/api\//g,`$1${a}/api/`).replace(/(["'`])\/api(["'`])/g,`$1${a}/api$2`).replace(/(["'(`])\/static\//g,`$1${a}/static/`).replace(/(["'(`])\/serviceworker\.js/g,`$1${a}/serviceworker.js`).replace(/(["'(`])\/service-worker\.js/g,`$1${a}/service-worker.js`).replace(/(["'(`])\/manifest\.json/g,`$1${a}/manifest.json`).replace(/(["'(`])\/favicon\.ico/g,`$1${a}/favicon.ico`).replace(/(["'(`])\/logo192\.png/g,`$1${a}/logo192.png`).replace(/url\((['"]?)\/static\//g,`url($1${a}/static/`).replace(/n\.p="\//g,`n.p="${a}/`)),{status:f.status,statusText:f.statusText,headers:o})}return new Response(f.body,{status:f.status,statusText:f.statusText,headers:o})}async function k(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function l(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function m(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function n(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function o(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function p(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}async function q(a,{params:b}){let{id:c,path:d}=await b;return j(a,c,d)}d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},28354:a=>{"use strict";a.exports=require("util")},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")},31421:a=>{"use strict";a.exports=require("node:child_process")},33873:a=>{"use strict";a.exports=require("path")},37625:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$4:()=>C,N5:()=>D,PZ:()=>H,Yq:()=>v,el:()=>E,sg:()=>G,vN:()=>F});var e=c(79646),f=c(91645),g=c(29021),h=c(33873),i=c(55511),j=c(28354),k=c(75430),l=c(15193),m=a([k]);k=(m.then?(await m)():m)[0];let I=(0,j.promisify)(e.execFile);function n(){return globalThis.__annovibeExternalApps||(globalThis.__annovibeExternalApps=new Map),globalThis.__annovibeExternalApps}function o(a){return`${a.appType}:${a.cwd}:${a.sessionId??""}:${a.filePath}`}function p(a,b){let c=String(b).split(/\r?\n/).filter(Boolean);a.logs.push(...c.map(a=>`[${new Date().toISOString()}] ${a}`)),a.logs.length>160&&a.logs.splice(0,a.logs.length-160)}function q(a){if(!a)return!1;try{return process.kill(a,0),!0}catch{return!1}}function r(a){return"starting"!==a.status&&"running"!==a.status||q(a.pid)||(a.status="stopped",a.error??=`${a.title} process is no longer running.`),a}async function s(a){if(!a||!q(a))return null;try{let{stdout:b}=await I("ps",["-o","rss=","-p",String(a)],{timeout:2500}),c=Number(b.trim().split(/\s+/)[0]);return Number.isFinite(c)?1024*c:null}catch{return null}}function t(a){return new Promise(b=>setTimeout(b,a))}async function u(a,b){let c=new AbortController,d=setTimeout(()=>c.abort(),b);try{return await fetch(a,{signal:c.signal,cache:"no-store"})}finally{clearTimeout(d)}}async function v(a,b){if(r(a),"error"===a.status||"stopped"===a.status)return!1;if("h5adexp"!==a.appType)return await t(900),r(a),"starting"===a.status&&q(a.pid)&&(a.status="running"),"running"===a.status;let c=Date.now()+(b??45e3),d="";for(;Date.now()<c;){let b=r(a);if("error"===b.status||"stopped"===b.status)return!1;try{let b=await u(`http://127.0.0.1:${a.port}/api/health`,1500);if(b.ok)return a.status="running",a.error=void 0,a.lastActivity=new Date().toISOString(),!0;d=`health returned HTTP ${b.status}`}catch(a){d=a instanceof Error?a.message:String(a)}await t(250)}return"starting"===a.status&&(a.error=`${a.title} did not become ready within ${b??45e3}ms${d?`; last error: ${d}`:""}.`,p(a,a.error)),!1}async function w(){return new Promise((a,b)=>{let c=(0,f.createServer)();c.unref(),c.on("error",b),c.listen(0,"127.0.0.1",()=>{let b=c.address(),d="object"==typeof b&&b?b.port:0;c.close(()=>a(d))})})}function x(a){return"h5adexp"===a?[".h5ad"]:[".rds",".qs"]}function y(a){return x(a).join(" or ")}function z(a){return"h5adexp"===a?"H5AD Exp":"stexp"}async function A(a){return(0,l.EO)({language:"r",cwd:a,policy:l.sE})}async function B(a,b){if("stexp"===a.appType){let b,c=await A(a.cwd),d=(b=(0,h.resolve)(process.cwd(),"..","stexp"),(0,g.existsSync)((0,h.join)(b,"DESCRIPTION"))?b:null);return p(a,`Using R kernel: ${c.command} ${c.args.join(" ")} (${c.source}${c.kernelId?`:${c.kernelId}`:""})`),d&&p(a,`Using local stexp package source: ${d}`),(0,e.spawn)(c.command,[...c.args,"-e",[d?`if (!requireNamespace('stexp', quietly = TRUE)) {
|
|
2
2
|
install.packages(${JSON.stringify(d)}, repos = NULL, type = 'source')
|
|
3
|
-
}`:"if (!requireNamespace('stexp', quietly = TRUE)) stop('The stexp R package is required. Install it in the selected AnnoVibe R kernel environment.')","stexp::run_app(",` file = ${JSON.stringify(a.filePath)},`," host = '127.0.0.1',",` port = ${a.port},`," launch.browser = FALSE\n)"].join("\n")],{cwd:a.cwd,env:{...process.env,...c.env,ANNOVIBE_APP_ID:a.id,ANNOVIBE_STEXP_PATH:a.filePath,ANNOVIBE_RDS_PATH:a.filePath}})}let c=(0,h.join)((0,k.getAgentDir)(),"apps","h5adexp",a.id);(0,g.mkdirSync)(c,{recursive:!0});let d=function(){let a=(0,h.resolve)(process.cwd(),"..","h5adexp","bin","h5adexp.mjs");if((0,g.existsSync)(a))return{command:process.execPath,argsPrefix:[a]};let b=(process.env.PATH??"").split("win32"===process.platform?";":":").filter(Boolean),c="win32"===process.platform?["h5adexp.cmd","h5adexp.exe","h5adexp"]:["h5adexp"];if(!b.some(a=>c.some(b=>(0,g.existsSync)((0,h.join)(a,b)))))throw Error("h5adexp is not installed or not available on PATH. Install it with `npm install -g h5adexp`, or keep a local ../h5adexp checkout next to annovibe.");return{command:"h5adexp",argsPrefix:[]}}();return(0,e.spawn)(d.command,[...d.argsPrefix,"serve","--file",a.filePath,"--host","127.0.0.1","--port",String(a.port),"--embed","--origin",b,"--runtime-home",c],{cwd:a.cwd,env:{...process.env,H5ADEXP_HOME:c,ANNOVIBE_APP_ID:a.id}})}async function C(a){let b=a.appType,{cwd:c,filePath:d}=function(a,b,c){let d,e=(0,h.resolve)(b),f=(0,h.resolve)(c),i=(0,h.relative)(e,f);if(!i||i.startsWith("..")||i.startsWith("/")||i.startsWith("\\"))throw Error(`${y(a).toUpperCase()} file must be inside the active project.`);if(!(0,g.existsSync)(f)||!(0,g.statSync)(f).isFile())throw Error(`${y(a).toUpperCase()} file not found.`);if(d=f.toLowerCase(),!x(a).some(a=>d.endsWith(a)))throw Error(`Only ${y(a)} files can be opened with ${z(a)}.`);return{cwd:e,filePath:f}}(b,a.cwd,a.filePath),e=o({appType:b,cwd:c,filePath:d,sessionId:a.sessionId}),f=[...n().values()].find(a=>o({appType:a.appType,cwd:a.cwd,filePath:a.filePath,sessionId:a.sessionId})===e);if(f){if(r(f),"starting"===f.status||"running"===f.status)return f.lastActivity=new Date().toISOString(),"starting"===f.status&&await v(f),f;n().delete(f.id)}let j=(0,i.randomBytes)(9).toString("hex"),k=await w(),l=new Date().toISOString(),m=`/api/apps/${encodeURIComponent(j)}`,q=`http://127.0.0.1:${k}/`,s={id:j,appType:b,title:z(b),filePath:d,cwd:c,sessionId:a.sessionId??null,port:k,pid:null,status:"starting",url:m,directUrl:q,startedAt:l,lastActivity:l,logs:[]},t=await B(s,a.origin||"http://localhost:30141");return s.child=t,s.pid=t.pid??null,n().set(j,s),t.stdout.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running"),s.lastActivity=new Date().toISOString()}),t.stderr.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running")}),t.on("error",a=>{s.status="error",s.error=a.message,p(s,a.message)}),t.on("exit",(a,b)=>{s.status=0===a||"SIGTERM"===b?"stopped":"error",s.error="error"===s.status?`${s.title} exited with code ${a??"null"} signal ${b??"null"}`:s.error,p(s,`process exited: code=${a??"null"} signal=${b??"null"}`)}),await v(s),s}function D(a){let b=n().get(a);return b?r(b):null}function E(){return[...n().values()].map(a=>r(a))}async function F(a){let b=r(a),c=await s(b.pid),d=Date.now(),e=Date.parse(b.startedAt);return{id:b.id,appType:b.appType,title:b.title,filePath:b.filePath,cwd:b.cwd,sessionId:b.sessionId,port:b.port,pid:b.pid,status:b.status,url:b.url,directUrl:b.directUrl,startedAt:b.startedAt,lastActivity:b.lastActivity,uptimeMs:Number.isFinite(e)?Math.max(0,d-e):null,rssBytes:c,running:"starting"===b.status||"running"===b.status,logs:b.logs,error:b.error}}async function G(a){return Promise.all(a.map(a=>F(a)))}async function H(a){let b=n().get(a);return b?(b.lastActivity=new Date().toISOString(),b.child&&q(b.pid)&&(b.child.kill("SIGTERM"),await new Promise(a=>setTimeout(a,900)),q(b.pid)&&b.child.kill("SIGKILL")),b.status="stopped",b):null}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},83920:(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(8977),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/apps/[id]/[[...path]]/route",pathname:"/api/apps/[id]/[[...path]]",filename:"route",bundlePath:"app/api/apps/[id]/[[...path]]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/apps/[id]/[[...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/apps/[id]/[[...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)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{"use strict";a.exports=require("net")},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,5193],()=>b(b.s=83920));module.exports=c})();
|
|
3
|
+
}`:"if (!requireNamespace('stexp', quietly = TRUE)) stop('The stexp R package is required. Install it in the selected AnnoVibe R kernel environment.')","stexp::run_app(",` file = ${JSON.stringify(a.filePath)},`," host = '127.0.0.1',",` port = ${a.port},`," launch.browser = FALSE\n)"].join("\n")],{cwd:a.cwd,env:{...process.env,...c.env,ANNOVIBE_APP_ID:a.id,ANNOVIBE_STEXP_PATH:a.filePath,ANNOVIBE_RDS_PATH:a.filePath}})}let c=(0,h.join)((0,k.getAgentDir)(),"apps","h5adexp",a.id);(0,g.mkdirSync)(c,{recursive:!0});let d=function(){let a=(0,h.resolve)(process.cwd(),"..","h5adexp","bin","h5adexp.mjs");if((0,g.existsSync)(a))return{command:process.execPath,argsPrefix:[a]};let b=(process.env.PATH??"").split("win32"===process.platform?";":":").filter(Boolean),c="win32"===process.platform?["h5adexp.cmd","h5adexp.exe","h5adexp"]:["h5adexp"];if(!b.some(a=>c.some(b=>(0,g.existsSync)((0,h.join)(a,b)))))throw Error("h5adexp is not installed or not available on PATH. Install it with `npm install -g h5adexp`, or keep a local ../h5adexp checkout next to annovibe.");return{command:"h5adexp",argsPrefix:[]}}();return(0,e.spawn)(d.command,[...d.argsPrefix,"serve","--file",a.filePath,"--host","127.0.0.1","--port",String(a.port),"--embed","--origin",b,"--runtime-home",c],{cwd:a.cwd,env:{...process.env,H5ADEXP_HOME:c,ANNOVIBE_APP_ID:a.id}})}async function C(a){let b=a.appType,{cwd:c,filePath:d}=function(a,b,c){let d,e=(0,h.resolve)(b),f=(0,h.resolve)(c),i=(0,h.relative)(e,f);if(!i||i.startsWith("..")||i.startsWith("/")||i.startsWith("\\"))throw Error(`${y(a).toUpperCase()} file must be inside the active project.`);if(!(0,g.existsSync)(f)||!(0,g.statSync)(f).isFile())throw Error(`${y(a).toUpperCase()} file not found.`);if(d=f.toLowerCase(),!x(a).some(a=>d.endsWith(a)))throw Error(`Only ${y(a)} files can be opened with ${z(a)}.`);return{cwd:e,filePath:f}}(b,a.cwd,a.filePath),e=o({appType:b,cwd:c,filePath:d,sessionId:a.sessionId}),f=[...n().values()].find(a=>o({appType:a.appType,cwd:a.cwd,filePath:a.filePath,sessionId:a.sessionId})===e);if(f){if(r(f),"starting"===f.status||"running"===f.status)return f.lastActivity=new Date().toISOString(),"starting"===f.status&&await v(f),f;n().delete(f.id)}let j=(0,i.randomBytes)(9).toString("hex"),k=await w(),l=new Date().toISOString(),m=`/api/apps/${encodeURIComponent(j)}`,q=`http://127.0.0.1:${k}/`,s={id:j,appType:b,title:z(b),filePath:d,cwd:c,sessionId:a.sessionId??null,port:k,pid:null,status:"starting",url:m,directUrl:q,startedAt:l,lastActivity:l,logs:[]},t=await B(s,a.origin||"http://localhost:30141");return s.child=t,s.pid=t.pid??null,n().set(j,s),t.stdout.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running"),s.lastActivity=new Date().toISOString()}),t.stderr.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running")}),t.on("error",a=>{s.status="error",s.error=a.message,p(s,a.message)}),t.on("exit",(a,b)=>{s.status=0===a||"SIGTERM"===b?"stopped":"error",s.error="error"===s.status?`${s.title} exited with code ${a??"null"} signal ${b??"null"}`:s.error,p(s,`process exited: code=${a??"null"} signal=${b??"null"}`)}),await v(s),s}function D(a){let b=n().get(a);return b?r(b):null}function E(){return[...n().values()].map(a=>r(a))}async function F(a){let b=r(a),c=await s(b.pid),d=Date.now(),e=Date.parse(b.startedAt);return{id:b.id,appType:b.appType,title:b.title,filePath:b.filePath,cwd:b.cwd,sessionId:b.sessionId,port:b.port,pid:b.pid,status:b.status,url:b.url,directUrl:b.directUrl,startedAt:b.startedAt,lastActivity:b.lastActivity,uptimeMs:Number.isFinite(e)?Math.max(0,d-e):null,rssBytes:c,running:"starting"===b.status||"running"===b.status,logs:b.logs,error:b.error}}async function G(a){return Promise.all(a.map(a=>F(a)))}async function H(a){let b=n().get(a);return b?(b.lastActivity=new Date().toISOString(),b.child&&q(b.pid)&&(b.child.kill("SIGTERM"),await new Promise(a=>setTimeout(a,900)),q(b.pid)&&b.child.kill("SIGKILL")),b.status="stopped",b):null}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{"use strict";a.exports=require("net")},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()}}},95312:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/apps/[id]/[[...path]]/route",pathname:"/api/apps/[id]/[[...path]]",filename:"route",bundlePath:"app/api/apps/[id]/[[...path]]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/apps/[id]/[[...path]]/route.ts",nextConfigOutput:"",userland:()=>c(8977),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/apps/[id]/[[...path]]/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.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==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,5193],()=>b(b.s=95312));module.exports=c})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=3374,a.ids=[3374],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")},
|
|
1
|
+
(()=>{var a={};a.id=3374,a.ids=[3374],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")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28354:a=>{"use strict";a.exports=require("util")},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")},31421:a=>{"use strict";a.exports=require("node:child_process")},33873:a=>{"use strict";a.exports=require("path")},37625:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$4:()=>C,N5:()=>D,PZ:()=>H,Yq:()=>v,el:()=>E,sg:()=>G,vN:()=>F});var e=c(79646),f=c(91645),g=c(29021),h=c(33873),i=c(55511),j=c(28354),k=c(75430),l=c(15193),m=a([k]);k=(m.then?(await m)():m)[0];let I=(0,j.promisify)(e.execFile);function n(){return globalThis.__annovibeExternalApps||(globalThis.__annovibeExternalApps=new Map),globalThis.__annovibeExternalApps}function o(a){return`${a.appType}:${a.cwd}:${a.sessionId??""}:${a.filePath}`}function p(a,b){let c=String(b).split(/\r?\n/).filter(Boolean);a.logs.push(...c.map(a=>`[${new Date().toISOString()}] ${a}`)),a.logs.length>160&&a.logs.splice(0,a.logs.length-160)}function q(a){if(!a)return!1;try{return process.kill(a,0),!0}catch{return!1}}function r(a){return"starting"!==a.status&&"running"!==a.status||q(a.pid)||(a.status="stopped",a.error??=`${a.title} process is no longer running.`),a}async function s(a){if(!a||!q(a))return null;try{let{stdout:b}=await I("ps",["-o","rss=","-p",String(a)],{timeout:2500}),c=Number(b.trim().split(/\s+/)[0]);return Number.isFinite(c)?1024*c:null}catch{return null}}function t(a){return new Promise(b=>setTimeout(b,a))}async function u(a,b){let c=new AbortController,d=setTimeout(()=>c.abort(),b);try{return await fetch(a,{signal:c.signal,cache:"no-store"})}finally{clearTimeout(d)}}async function v(a,b){if(r(a),"error"===a.status||"stopped"===a.status)return!1;if("h5adexp"!==a.appType)return await t(900),r(a),"starting"===a.status&&q(a.pid)&&(a.status="running"),"running"===a.status;let c=Date.now()+(b??45e3),d="";for(;Date.now()<c;){let b=r(a);if("error"===b.status||"stopped"===b.status)return!1;try{let b=await u(`http://127.0.0.1:${a.port}/api/health`,1500);if(b.ok)return a.status="running",a.error=void 0,a.lastActivity=new Date().toISOString(),!0;d=`health returned HTTP ${b.status}`}catch(a){d=a instanceof Error?a.message:String(a)}await t(250)}return"starting"===a.status&&(a.error=`${a.title} did not become ready within ${b??45e3}ms${d?`; last error: ${d}`:""}.`,p(a,a.error)),!1}async function w(){return new Promise((a,b)=>{let c=(0,f.createServer)();c.unref(),c.on("error",b),c.listen(0,"127.0.0.1",()=>{let b=c.address(),d="object"==typeof b&&b?b.port:0;c.close(()=>a(d))})})}function x(a){return"h5adexp"===a?[".h5ad"]:[".rds",".qs"]}function y(a){return x(a).join(" or ")}function z(a){return"h5adexp"===a?"H5AD Exp":"stexp"}async function A(a){return(0,l.EO)({language:"r",cwd:a,policy:l.sE})}async function B(a,b){if("stexp"===a.appType){let b,c=await A(a.cwd),d=(b=(0,h.resolve)(process.cwd(),"..","stexp"),(0,g.existsSync)((0,h.join)(b,"DESCRIPTION"))?b:null);return p(a,`Using R kernel: ${c.command} ${c.args.join(" ")} (${c.source}${c.kernelId?`:${c.kernelId}`:""})`),d&&p(a,`Using local stexp package source: ${d}`),(0,e.spawn)(c.command,[...c.args,"-e",[d?`if (!requireNamespace('stexp', quietly = TRUE)) {
|
|
2
2
|
install.packages(${JSON.stringify(d)}, repos = NULL, type = 'source')
|
|
3
|
-
}`:"if (!requireNamespace('stexp', quietly = TRUE)) stop('The stexp R package is required. Install it in the selected AnnoVibe R kernel environment.')","stexp::run_app(",` file = ${JSON.stringify(a.filePath)},`," host = '127.0.0.1',",` port = ${a.port},`," launch.browser = FALSE\n)"].join("\n")],{cwd:a.cwd,env:{...process.env,...c.env,ANNOVIBE_APP_ID:a.id,ANNOVIBE_STEXP_PATH:a.filePath,ANNOVIBE_RDS_PATH:a.filePath}})}let c=(0,h.join)((0,k.getAgentDir)(),"apps","h5adexp",a.id);(0,g.mkdirSync)(c,{recursive:!0});let d=function(){let a=(0,h.resolve)(process.cwd(),"..","h5adexp","bin","h5adexp.mjs");if((0,g.existsSync)(a))return{command:process.execPath,argsPrefix:[a]};let b=(process.env.PATH??"").split("win32"===process.platform?";":":").filter(Boolean),c="win32"===process.platform?["h5adexp.cmd","h5adexp.exe","h5adexp"]:["h5adexp"];if(!b.some(a=>c.some(b=>(0,g.existsSync)((0,h.join)(a,b)))))throw Error("h5adexp is not installed or not available on PATH. Install it with `npm install -g h5adexp`, or keep a local ../h5adexp checkout next to annovibe.");return{command:"h5adexp",argsPrefix:[]}}();return(0,e.spawn)(d.command,[...d.argsPrefix,"serve","--file",a.filePath,"--host","127.0.0.1","--port",String(a.port),"--embed","--origin",b,"--runtime-home",c],{cwd:a.cwd,env:{...process.env,H5ADEXP_HOME:c,ANNOVIBE_APP_ID:a.id}})}async function C(a){let b=a.appType,{cwd:c,filePath:d}=function(a,b,c){let d,e=(0,h.resolve)(b),f=(0,h.resolve)(c),i=(0,h.relative)(e,f);if(!i||i.startsWith("..")||i.startsWith("/")||i.startsWith("\\"))throw Error(`${y(a).toUpperCase()} file must be inside the active project.`);if(!(0,g.existsSync)(f)||!(0,g.statSync)(f).isFile())throw Error(`${y(a).toUpperCase()} file not found.`);if(d=f.toLowerCase(),!x(a).some(a=>d.endsWith(a)))throw Error(`Only ${y(a)} files can be opened with ${z(a)}.`);return{cwd:e,filePath:f}}(b,a.cwd,a.filePath),e=o({appType:b,cwd:c,filePath:d,sessionId:a.sessionId}),f=[...n().values()].find(a=>o({appType:a.appType,cwd:a.cwd,filePath:a.filePath,sessionId:a.sessionId})===e);if(f){if(r(f),"starting"===f.status||"running"===f.status)return f.lastActivity=new Date().toISOString(),"starting"===f.status&&await v(f),f;n().delete(f.id)}let j=(0,i.randomBytes)(9).toString("hex"),k=await w(),l=new Date().toISOString(),m=`/api/apps/${encodeURIComponent(j)}`,q=`http://127.0.0.1:${k}/`,s={id:j,appType:b,title:z(b),filePath:d,cwd:c,sessionId:a.sessionId??null,port:k,pid:null,status:"starting",url:m,directUrl:q,startedAt:l,lastActivity:l,logs:[]},t=await B(s,a.origin||"http://localhost:30141");return s.child=t,s.pid=t.pid??null,n().set(j,s),t.stdout.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running"),s.lastActivity=new Date().toISOString()}),t.stderr.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running")}),t.on("error",a=>{s.status="error",s.error=a.message,p(s,a.message)}),t.on("exit",(a,b)=>{s.status=0===a||"SIGTERM"===b?"stopped":"error",s.error="error"===s.status?`${s.title} exited with code ${a??"null"} signal ${b??"null"}`:s.error,p(s,`process exited: code=${a??"null"} signal=${b??"null"}`)}),await v(s),s}function D(a){let b=n().get(a);return b?r(b):null}function E(){return[...n().values()].map(a=>r(a))}async function F(a){let b=r(a),c=await s(b.pid),d=Date.now(),e=Date.parse(b.startedAt);return{id:b.id,appType:b.appType,title:b.title,filePath:b.filePath,cwd:b.cwd,sessionId:b.sessionId,port:b.port,pid:b.pid,status:b.status,url:b.url,directUrl:b.directUrl,startedAt:b.startedAt,lastActivity:b.lastActivity,uptimeMs:Number.isFinite(e)?Math.max(0,d-e):null,rssBytes:c,running:"starting"===b.status||"running"===b.status,logs:b.logs,error:b.error}}async function G(a){return Promise.all(a.map(a=>F(a)))}async function H(a){let b=n().get(a);return b?(b.lastActivity=new Date().toISOString(),b.child&&q(b.pid)&&(b.child.kill("SIGTERM"),await new Promise(a=>setTimeout(a,900)),q(b.pid)&&b.child.kill("SIGKILL")),b.status="stopped",b):null}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66425:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(37625),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(a){let{searchParams:b}=new URL(a.url),c=b.get("appId");if(!c)return e.NextResponse.json({apps:await (0,f.sg)((0,f.el)())});let d=(0,f.N5)(c);return d?e.NextResponse.json({app:await (0,f.vN)(d)}):e.NextResponse.json({error:"App not found"},{status:404})}async function i(a){try{let b=await a.json(),c=b.action??"start";if("start"===c){if("string"!=typeof b.filePath||"string"!=typeof b.cwd)return e.NextResponse.json({error:"filePath and cwd are required"},{status:400});let c="h5adexp"===b.appType?"h5adexp":"stexp",d=new URL(a.url).origin,g=await (0,f.$4)({appType:c,filePath:b.filePath,cwd:b.cwd,sessionId:"string"==typeof b.sessionId?b.sessionId:null,origin:d});return e.NextResponse.json({app:await (0,f.vN)(g)})}if("stop"===c){if("string"!=typeof b.appId)return e.NextResponse.json({error:"appId is required"},{status:400});let a=await (0,f.PZ)(b.appId);if(!a)return e.NextResponse.json({error:"App not found"},{status:404});return e.NextResponse.json({app:await (0,f.vN)(a)})}return e.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{"use strict";a.exports=require("net")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193],()=>b(b.s=24752));module.exports=c})();
|
|
3
|
+
}`:"if (!requireNamespace('stexp', quietly = TRUE)) stop('The stexp R package is required. Install it in the selected AnnoVibe R kernel environment.')","stexp::run_app(",` file = ${JSON.stringify(a.filePath)},`," host = '127.0.0.1',",` port = ${a.port},`," launch.browser = FALSE\n)"].join("\n")],{cwd:a.cwd,env:{...process.env,...c.env,ANNOVIBE_APP_ID:a.id,ANNOVIBE_STEXP_PATH:a.filePath,ANNOVIBE_RDS_PATH:a.filePath}})}let c=(0,h.join)((0,k.getAgentDir)(),"apps","h5adexp",a.id);(0,g.mkdirSync)(c,{recursive:!0});let d=function(){let a=(0,h.resolve)(process.cwd(),"..","h5adexp","bin","h5adexp.mjs");if((0,g.existsSync)(a))return{command:process.execPath,argsPrefix:[a]};let b=(process.env.PATH??"").split("win32"===process.platform?";":":").filter(Boolean),c="win32"===process.platform?["h5adexp.cmd","h5adexp.exe","h5adexp"]:["h5adexp"];if(!b.some(a=>c.some(b=>(0,g.existsSync)((0,h.join)(a,b)))))throw Error("h5adexp is not installed or not available on PATH. Install it with `npm install -g h5adexp`, or keep a local ../h5adexp checkout next to annovibe.");return{command:"h5adexp",argsPrefix:[]}}();return(0,e.spawn)(d.command,[...d.argsPrefix,"serve","--file",a.filePath,"--host","127.0.0.1","--port",String(a.port),"--embed","--origin",b,"--runtime-home",c],{cwd:a.cwd,env:{...process.env,H5ADEXP_HOME:c,ANNOVIBE_APP_ID:a.id}})}async function C(a){let b=a.appType,{cwd:c,filePath:d}=function(a,b,c){let d,e=(0,h.resolve)(b),f=(0,h.resolve)(c),i=(0,h.relative)(e,f);if(!i||i.startsWith("..")||i.startsWith("/")||i.startsWith("\\"))throw Error(`${y(a).toUpperCase()} file must be inside the active project.`);if(!(0,g.existsSync)(f)||!(0,g.statSync)(f).isFile())throw Error(`${y(a).toUpperCase()} file not found.`);if(d=f.toLowerCase(),!x(a).some(a=>d.endsWith(a)))throw Error(`Only ${y(a)} files can be opened with ${z(a)}.`);return{cwd:e,filePath:f}}(b,a.cwd,a.filePath),e=o({appType:b,cwd:c,filePath:d,sessionId:a.sessionId}),f=[...n().values()].find(a=>o({appType:a.appType,cwd:a.cwd,filePath:a.filePath,sessionId:a.sessionId})===e);if(f){if(r(f),"starting"===f.status||"running"===f.status)return f.lastActivity=new Date().toISOString(),"starting"===f.status&&await v(f),f;n().delete(f.id)}let j=(0,i.randomBytes)(9).toString("hex"),k=await w(),l=new Date().toISOString(),m=`/api/apps/${encodeURIComponent(j)}`,q=`http://127.0.0.1:${k}/`,s={id:j,appType:b,title:z(b),filePath:d,cwd:c,sessionId:a.sessionId??null,port:k,pid:null,status:"starting",url:m,directUrl:q,startedAt:l,lastActivity:l,logs:[]},t=await B(s,a.origin||"http://localhost:30141");return s.child=t,s.pid=t.pid??null,n().set(j,s),t.stdout.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running"),s.lastActivity=new Date().toISOString()}),t.stderr.on("data",a=>{p(s,a);let b=String(a);"starting"===s.status&&("h5adexp"!==s.appType||b.includes("Listening on")||b.includes("[h5adexp] Ready"))&&(s.status="running")}),t.on("error",a=>{s.status="error",s.error=a.message,p(s,a.message)}),t.on("exit",(a,b)=>{s.status=0===a||"SIGTERM"===b?"stopped":"error",s.error="error"===s.status?`${s.title} exited with code ${a??"null"} signal ${b??"null"}`:s.error,p(s,`process exited: code=${a??"null"} signal=${b??"null"}`)}),await v(s),s}function D(a){let b=n().get(a);return b?r(b):null}function E(){return[...n().values()].map(a=>r(a))}async function F(a){let b=r(a),c=await s(b.pid),d=Date.now(),e=Date.parse(b.startedAt);return{id:b.id,appType:b.appType,title:b.title,filePath:b.filePath,cwd:b.cwd,sessionId:b.sessionId,port:b.port,pid:b.pid,status:b.status,url:b.url,directUrl:b.directUrl,startedAt:b.startedAt,lastActivity:b.lastActivity,uptimeMs:Number.isFinite(e)?Math.max(0,d-e):null,rssBytes:c,running:"starting"===b.status||"running"===b.status,logs:b.logs,error:b.error}}async function G(a){return Promise.all(a.map(a=>F(a)))}async function H(a){let b=n().get(a);return b?(b.lastActivity=new Date().toISOString(),b.child&&q(b.pid)&&(b.child.kill("SIGTERM"),await new Promise(a=>setTimeout(a,900)),q(b.pid)&&b.child.kill("SIGKILL")),b.status="stopped",b):null}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66425:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(37625),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(a){let{searchParams:b}=new URL(a.url),c=b.get("appId");if(!c)return e.NextResponse.json({apps:await (0,f.sg)((0,f.el)())});let d=(0,f.N5)(c);return d?e.NextResponse.json({app:await (0,f.vN)(d)}):e.NextResponse.json({error:"App not found"},{status:404})}async function i(a){try{let b=await a.json(),c=b.action??"start";if("start"===c){if("string"!=typeof b.filePath||"string"!=typeof b.cwd)return e.NextResponse.json({error:"filePath and cwd are required"},{status:400});let c="h5adexp"===b.appType?"h5adexp":"stexp",d=new URL(a.url).origin,g=await (0,f.$4)({appType:c,filePath:b.filePath,cwd:b.cwd,sessionId:"string"==typeof b.sessionId?b.sessionId:null,origin:d});return e.NextResponse.json({app:await (0,f.vN)(g)})}if("stop"===c){if("string"!=typeof b.appId)return e.NextResponse.json({error:"appId is required"},{status:400});let a=await (0,f.PZ)(b.appId);if(!a)return e.NextResponse.json({error:"App not found"},{status:404});return e.NextResponse.json({app:await (0,f.vN)(a)})}return e.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},67408:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/apps/route",pathname:"/api/apps",filename:"route",bundlePath:"app/api/apps/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/apps/route.ts",nextConfigOutput:"",userland:()=>c(66425),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/apps/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.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==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{"use strict";a.exports=require("net")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,5193],()=>b(b.s=67408));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=1541,a.ids=[1541],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")},13760:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(75430),f=c(89950),g=c(28247),h=a([e]);e=(h.then?(await h)():h)[0];let j="force-dynamic";async function i(){let a=await e.ModelRuntime.create(),b=(0,f.z)(await (0,g.z)(a));return Response.json({providers:b})}d()}catch(a){d(a)}})},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},28247:(a,b,c)=>{"use strict";async function d(a){let b=a.getModels(),c=new Map;try{for(let b of(await a.listCredentials()))("api_key"===b.type||"oauth"===b.type)&&c.set(b.providerId,b.type)}catch{}let d=new Map;for(let a of b)d.set(a.provider,(d.get(a.provider)??0)+1);let e=[];for(let b of a.getProviders()){let f=d.get(b.id)??0;if(0===f)continue;let g=a.getProviderAuthStatus(b.id);e.push({id:b.id,name:b.name,hasApiKeyLogin:!!b.auth.apiKey?.login,hasOAuth:!!b.auth.oauth,...b.auth.oauth?.name?{oauthName:b.auth.oauth.name}:{},status:g,...c.has(b.id)?{credentialType:c.get(b.id)}:{},modelCount:f})}return e}c.d(b,{z:()=>d})},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")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},83606:(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(13760),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/all-providers/route",pathname:"/api/auth/all-providers",filename:"route",bundlePath:"app/api/auth/all-providers/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/all-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/all-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)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89950:(a,b,c)=>{"use strict";c.d(b,{l:()=>h,z:()=>g});let d=new Set(["models_json_key","models_json_command"]),e={"openai-codex":"ChatGPT Plus/Pro","github-copilot":"GitHub Copilot"};function f(a){let b=new Set,c=[];for(let d of a)b.has(d.id)||(b.add(d.id),c.push(d));return c}function g(a){let b=[];for(let c of f(a)){if(!c.hasApiKeyLogin||c.status.source&&d.has(c.status.source))continue;let a=c.status.configured&&"oauth"!==c.credentialType;b.push({id:c.id,displayName:c.name,configured:a,...a&&c.status.source?{source:c.status.source}:{},modelCount:c.modelCount,supportsOAuth:c.hasOAuth})}return b}function h(a){let b=[];for(let c of f(a))c.hasOAuth&&b.push({id:c.id,name:e[c.id]??c.oauthName??c.name,usesCallbackServer:!1,loggedIn:"oauth"===c.credentialType,supportsApiKey:c.hasApiKeyLogin});return b}},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=83606));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=1541,a.ids=[1541],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13760:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(75430),f=c(89950),g=c(28247),h=a([e]);e=(h.then?(await h)():h)[0];let j="force-dynamic";async function i(){let a=await e.ModelRuntime.create(),b=(0,f.z)(await (0,g.z)(a));return Response.json({providers:b})}d()}catch(a){d(a)}})},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},28247:(a,b,c)=>{"use strict";async function d(a){let b=a.getModels(),c=new Map;try{for(let b of(await a.listCredentials()))("api_key"===b.type||"oauth"===b.type)&&c.set(b.providerId,b.type)}catch{}let d=new Map;for(let a of b)d.set(a.provider,(d.get(a.provider)??0)+1);let e=[];for(let b of a.getProviders()){let f=d.get(b.id)??0;if(0===f)continue;let g=a.getProviderAuthStatus(b.id);e.push({id:b.id,name:b.name,hasApiKeyLogin:!!b.auth.apiKey?.login,hasOAuth:!!b.auth.oauth,...b.auth.oauth?.name?{oauthName:b.auth.oauth.name}:{},status:g,...c.has(b.id)?{credentialType:c.get(b.id)}:{},modelCount:f})}return e}c.d(b,{z:()=>d})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73882:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/all-providers/route",pathname:"/api/auth/all-providers",filename:"route",bundlePath:"app/api/auth/all-providers/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/all-providers/route.ts",nextConfigOutput:"",userland:()=>c(13760),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/all-providers/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.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==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},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")},89950:(a,b,c)=>{"use strict";c.d(b,{l:()=>h,z:()=>g});let d=new Set(["models_json_key","models_json_command"]),e={"openai-codex":"ChatGPT Plus/Pro","github-copilot":"GitHub Copilot"};function f(a){let b=new Set,c=[];for(let d of a)b.has(d.id)||(b.add(d.id),c.push(d));return c}function g(a){let b=[];for(let c of f(a)){if(!c.hasApiKeyLogin||c.status.source&&d.has(c.status.source))continue;let a=c.status.configured&&"oauth"!==c.credentialType;b.push({id:c.id,displayName:c.name,configured:a,...a&&c.status.source?{source:c.status.source}:{},modelCount:c.modelCount,supportsOAuth:c.hasOAuth})}return b}function h(a){let b=[];for(let c of f(a))c.hasOAuth&&b.push({id:c.id,name:e[c.id]??c.oauthName??c.name,usesCallbackServer:!1,loggedIn:"oauth"===c.credentialType,supportsApiKey:c.hasApiKeyLogin});return b}},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,[2970],()=>b(b.s=73882));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=8743,a.ids=[8743],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")},18470:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>k,GET:()=>i,POST:()=>j,dynamic:()=>l});var e=c(75430),f=c(23211),g=c(28967),h=a([e]);e=(h.then?(await h)():h)[0];let l="force-dynamic";async function i(a,{params:b}){let{provider:c}=await b,d=await e.ModelRuntime.create(),g=d.getProviderAuthStatus(c),h=d.getProvider(c)?.name??c,j=d.getModels(c).length;return f.NextResponse.json({provider:c,displayName:h,configured:g.configured,source:g.source,models:j})}async function j(a,{params:b}){let{provider:c}=await b;try{let{apiKey:b}=await a.json();if(!b||"string"!=typeof b||!b.trim())return f.NextResponse.json({error:"apiKey is required"},{status:400});let d=await e.ModelRuntime.create(),h=d.getProvider(c);if(!h?.auth.apiKey?.login)return f.NextResponse.json({error:`${c} does not support API key login`},{status:400});let i=!1;try{await d.login(c,"api_key",{signal:a.signal,notify:()=>{},prompt:async a=>{if("select"===a.type){let b=a.options.find(a=>"api-key"===a.id||"bearer-token"===a.id);if(b)return b.id;throw Error(`${c} requires interactive authentication setup`)}if(!i&&"secret"===a.type)return i=!0,b.trim();throw Error(`${c} requires additional authentication settings`)}})}catch(a){if(!(a instanceof e.CredentialSynchronizationError))throw a}return(0,g.k)(),f.NextResponse.json({success:!0})}catch(a){return f.NextResponse.json({error:String(a)},{status:500})}}async function k(a,{params:b}){let{provider:c}=await b;try{let a=await e.ModelRuntime.create(),b=(await a.listCredentials()).find(a=>a.providerId===c);if(b&&"api_key"!==b.type)return f.NextResponse.json({error:`${c} is authenticated with OAuth, not an API key`},{status:409});return b&&await a.logout(c),(0,g.k)(),f.NextResponse.json({success:!0})}catch(a){return f.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__annovibeModelsCacheState||(globalThis.__annovibeModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__annovibeModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear()}function f(a,b){let c=d(),e=c.entries.get(a);if(e){if(e.expiresAt>Date.now())return Promise.resolve(e.data);c.entries.delete(a)}let f=c.inFlight.get(a);if(f)return f;let g=c.generation,h=Promise.resolve().then(b).then(b=>{if(c.generation===g&&c.inFlight.get(a)===h){let d=Date.now();for(let[a,b]of c.entries)b.expiresAt<=d&&c.entries.delete(a);for(;c.entries.size>=8;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(a,{data:b,expiresAt:d+6e4})}return b}).finally(()=>{c.inFlight.get(a)===h&&c.inFlight.delete(a)});return c.inFlight.set(a,h),h}c.d(b,{k:()=>e,r:()=>f})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},40046:(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(18470),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/api-key/[provider]/route",pathname:"/api/auth/api-key/[provider]",filename:"route",bundlePath:"app/api/auth/api-key/[provider]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/api-key/[provider]/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/api-key/[provider]/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)}})},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")},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=40046));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=8743,a.ids=[8743],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")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},18470:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>k,GET:()=>i,POST:()=>j,dynamic:()=>l});var e=c(75430),f=c(23211),g=c(28967),h=a([e]);e=(h.then?(await h)():h)[0];let l="force-dynamic";async function i(a,{params:b}){let{provider:c}=await b,d=await e.ModelRuntime.create(),g=d.getProviderAuthStatus(c),h=d.getProvider(c)?.name??c,j=d.getModels(c).length;return f.NextResponse.json({provider:c,displayName:h,configured:g.configured,source:g.source,models:j})}async function j(a,{params:b}){let{provider:c}=await b;try{let{apiKey:b}=await a.json();if(!b||"string"!=typeof b||!b.trim())return f.NextResponse.json({error:"apiKey is required"},{status:400});let d=await e.ModelRuntime.create(),h=d.getProvider(c);if(!h?.auth.apiKey?.login)return f.NextResponse.json({error:`${c} does not support API key login`},{status:400});let i=!1;try{await d.login(c,"api_key",{signal:a.signal,notify:()=>{},prompt:async a=>{if("select"===a.type){let b=a.options.find(a=>"api-key"===a.id||"bearer-token"===a.id);if(b)return b.id;throw Error(`${c} requires interactive authentication setup`)}if(!i&&"secret"===a.type)return i=!0,b.trim();throw Error(`${c} requires additional authentication settings`)}})}catch(a){if(!(a instanceof e.CredentialSynchronizationError))throw a}return(0,g.k)(),f.NextResponse.json({success:!0})}catch(a){return f.NextResponse.json({error:String(a)},{status:500})}}async function k(a,{params:b}){let{provider:c}=await b;try{let a=await e.ModelRuntime.create(),b=(await a.listCredentials()).find(a=>a.providerId===c);if(b&&"api_key"!==b.type)return f.NextResponse.json({error:`${c} is authenticated with OAuth, not an API key`},{status:409});return b&&await a.logout(c),(0,g.k)(),f.NextResponse.json({success:!0})}catch(a){return f.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__annovibeModelsCacheState||(globalThis.__annovibeModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__annovibeModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear()}function f(a,b){let c=d(),e=c.entries.get(a);if(e){if(e.expiresAt>Date.now())return Promise.resolve(e.data);c.entries.delete(a)}let f=c.inFlight.get(a);if(f)return f;let g=c.generation,h=Promise.resolve().then(b).then(b=>{if(c.generation===g&&c.inFlight.get(a)===h){let d=Date.now();for(let[a,b]of c.entries)b.expiresAt<=d&&c.entries.delete(a);for(;c.entries.size>=8;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(a,{data:b,expiresAt:d+6e4})}return b}).finally(()=>{c.inFlight.get(a)===h&&c.inFlight.delete(a)});return c.inFlight.set(a,h),h}c.d(b,{k:()=>e,r:()=>f})},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")},52626:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/api-key/[provider]/route",pathname:"/api/auth/api-key/[provider]",filename:"route",bundlePath:"app/api/auth/api-key/[provider]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/api-key/[provider]/route.ts",nextConfigOutput:"",userland:()=>c(18470),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/api-key/[provider]/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.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==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},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")},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,[2970,1813],()=>b(b.s=52626));module.exports=c})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=1004,a.ids=[1004],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")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__annovibeModelsCacheState||(globalThis.__annovibeModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__annovibeModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear()}function f(a,b){let c=d(),e=c.entries.get(a);if(e){if(e.expiresAt>Date.now())return Promise.resolve(e.data);c.entries.delete(a)}let f=c.inFlight.get(a);if(f)return f;let g=c.generation,h=Promise.resolve().then(b).then(b=>{if(c.generation===g&&c.inFlight.get(a)===h){let d=Date.now();for(let[a,b]of c.entries)b.expiresAt<=d&&c.entries.delete(a);for(;c.entries.size>=8;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(a,{data:b,expiresAt:d+6e4})}return b}).finally(()=>{c.inFlight.get(a)===h&&c.inFlight.delete(a)});return c.inFlight.set(a,h),h}c.d(b,{k:()=>e,r:()=>f})},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")},46879:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,POST:()=>i,dynamic:()=>k});var e=c(75430),f=c(28967),g=a([e]);e=(g.then?(await g)():g)[0];let k="force-dynamic";function h(){return globalThis.__piLoginCallbacks||(globalThis.__piLoginCallbacks=new Map),globalThis.__piLoginCallbacks}async function i(a,{params:b}){let{provider:c}=await b,{token:d,code:e}=await a.json();if(!d||!e)return Response.json({error:"token and code required"},{status:400});let f=h(),g=f.get(d);return g?d.startsWith(`${c}-`)?(g.resolve(e),f.delete(d),Response.json({ok:!0,provider:c})):Response.json({error:"Token does not match provider"},{status:400}):Response.json({error:"No pending login for token"},{status:404})}async function j(a,{params:b}){let{provider:c}=await b,d=new TextEncoder,g=(a,b)=>{a.enqueue(d.encode(`data: ${JSON.stringify(b)}
|
|
1
|
+
(()=>{var a={};a.id=1004,a.ids=[1004],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__annovibeModelsCacheState||(globalThis.__annovibeModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__annovibeModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear()}function f(a,b){let c=d(),e=c.entries.get(a);if(e){if(e.expiresAt>Date.now())return Promise.resolve(e.data);c.entries.delete(a)}let f=c.inFlight.get(a);if(f)return f;let g=c.generation,h=Promise.resolve().then(b).then(b=>{if(c.generation===g&&c.inFlight.get(a)===h){let d=Date.now();for(let[a,b]of c.entries)b.expiresAt<=d&&c.entries.delete(a);for(;c.entries.size>=8;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(a,{data:b,expiresAt:d+6e4})}return b}).finally(()=>{c.inFlight.get(a)===h&&c.inFlight.delete(a)});return c.inFlight.set(a,h),h}c.d(b,{k:()=>e,r:()=>f})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32252:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/login/[provider]/route",pathname:"/api/auth/login/[provider]",filename:"route",bundlePath:"app/api/auth/login/[provider]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/login/[provider]/route.ts",nextConfigOutput:"",userland:()=>c(46879),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/login/[provider]/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.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==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},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")},46879:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,POST:()=>i,dynamic:()=>k});var e=c(75430),f=c(28967),g=a([e]);e=(g.then?(await g)():g)[0];let k="force-dynamic";function h(){return globalThis.__piLoginCallbacks||(globalThis.__piLoginCallbacks=new Map),globalThis.__piLoginCallbacks}async function i(a,{params:b}){let{provider:c}=await b,{token:d,code:e}=await a.json();if(!d||!e)return Response.json({error:"token and code required"},{status:400});let f=h(),g=f.get(d);return g?d.startsWith(`${c}-`)?(g.resolve(e),f.delete(d),Response.json({ok:!0,provider:c})):Response.json({error:"Token does not match provider"},{status:400}):Response.json({error:"No pending login for token"},{status:404})}async function j(a,{params:b}){let{provider:c}=await b,d=new TextEncoder,g=(a,b)=>{a.enqueue(d.encode(`data: ${JSON.stringify(b)}
|
|
2
2
|
|
|
3
|
-
`))},i=new AbortController;a.signal.addEventListener("abort",()=>i.abort())
|
|
3
|
+
`))},i=new AbortController;return a.signal.addEventListener("abort",()=>i.abort()),new Response(new ReadableStream({async start(a){let b,d=await e.ModelRuntime.create();if(!d.getProvider(c)?.auth.oauth){g(a,{type:"error",message:`Unknown provider: ${c}`}),a.close();return}let j=h(),k=new Set,l=()=>{let a=`${c}-${Date.now()}-${Math.random().toString(36).slice(2)}`;k.add(a);let b=new Promise((b,c)=>{j.set(a,{resolve:c=>{k.delete(a),j.delete(a),b(c)},reject:b=>{k.delete(a),j.delete(a),c(b)}})});return{token:a,promise:b}},m=()=>(b||(b=l()).promise.finally(()=>{b=void 0}).catch(()=>{}),b),n=()=>{for(let a of k)j.get(a)?.reject(Error("Login cancelled")),j.delete(a);k.clear()};i.signal.addEventListener("abort",n);try{await d.login(c,"oauth",{prompt:async b=>{let c="manual_code"===b.type?m():l();return"select"===b.type?g(a,{type:"select_request",message:b.message,options:b.options,token:c.token}):g(a,{type:"prompt_request",message:b.message,placeholder:b.placeholder??null,token:c.token}),c.promise},notify:b=>{if("auth_url"===b.type){let c=m();g(a,{type:"auth",url:b.url,instructions:b.instructions??null,token:c.token})}else"device_code"===b.type?g(a,{type:"device_code",userCode:b.userCode,verificationUri:b.verificationUri,intervalSeconds:b.intervalSeconds??null,expiresInSeconds:b.expiresInSeconds??null}):g(a,{type:"progress",message:b.message})},signal:i.signal}),(0,f.k)(),g(a,{type:"success"})}catch(c){let b=c instanceof Error?c.message:String(c);i.signal.aborted||"Login cancelled"===b?g(a,{type:"cancelled"}):g(a,{type:"error",message:b})}finally{n(),a.close()}},cancel(){i.abort()}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}d()}catch(a){d(a)}})},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")},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,[2970],()=>b(b.s=32252));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=7758,a.ids=[7758],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")},31301:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>O,patchFetch:()=>N,routeModule:()=>J,serverHooks:()=>M,workAsyncStorage:()=>K,workUnitAsyncStorage:()=>L});var d={};c.r(d),c.d(d,{POST:()=>I});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);let y=new Map,z={failures:[],lockedUntil:0},A=/^(1|true|yes|on)$/i;function B(){return{failures:[],lockedUntil:0}}function C(a,b,c){for(;a.failures.length>0&&b-a.failures[0]>c;)a.failures.shift()}function D(a,b,c){return C(a,b,c),!(a.lockedUntil>b)&&(0!==a.lockedUntil&&(a.lockedUntil=0),!0)}function E(a,b,c,d,e){C(a,b,c),a.failures.push(b),a.failures.length>=d&&(a.lockedUntil=b+e,a.failures=[])}function F(a,b){0===b.failures.length&&0===b.lockedUntil?y.delete(a):y.set(a,b)}function G(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}var H=c(62814);async function I(a){try{let b=await a.json(),{rateLimitKey:c,auditIp:d}=function(a){if(!A.test(process.env.ANNOVIBE_TRUST_PROXY_HEADERS??""))return{rateLimitKey:"direct-client"};let b=function(a){let b=a.get("forwarded");if(b){let a=function(a){let b=a.split(",")[0]?.trim();if(!b)return null;for(let a of b.split(";")){let[b,c]=a.split("=",2);if(b?.trim().toLowerCase()==="for"&&c)return G(c)}return null}(b);if(a)return a}let c=a.get("x-forwarded-for");if(c){let a=G(c.split(",")[0]??"");if(a)return a}let d=a.get("x-real-ip");if(d){let a=G(d);if(a)return a}return null}(a.headers);return b?{rateLimitKey:`ip:${b}`,auditIp:b}:{rateLimitKey:"trusted-proxy:unknown"}}(a);if(!function(a){let b=Date.now();if(!D(z,b,36e5))return!1;let c=y.get(a)??B(),d=D(c,b,3e5);return F(a,c),d}(c))return(0,H.L)("login_rate_limited",d),v.NextResponse.json({error:"Too many login attempts. Try again later."},{status:429});if(b.password){let e;if(!(0,w.BE)(b.password)){let a,b;return a=Date.now(),b=y.get(c)??B(),E(b,a,3e5,5,9e5),F(c,b),E(z,a,36e5,10,18e5),(0,H.L)("login_fail",d),v.NextResponse.json({error:"Invalid password"},{status:401})}if(y.delete(c),e=Date.now(),C(z,e,36e5),0!==z.lockedUntil&&z.lockedUntil<=e&&(z.lockedUntil=0),(0,w.WG)(a)){let a=await (0,w.kR)();return v.NextResponse.json({step:"totp",tempToken:a})}(0,H.L)("login_success",d);let f=await (0,w.yL)(),g=v.NextResponse.json({success:!0});return g.headers.set("Set-Cookie",(0,w.US)(f)),g}if(b.tempToken){if(!await (0,w.JZ)(b.tempToken))return v.NextResponse.json({error:"Session expired. Please sign in again."},{status:401});let a=(0,w.I0)();if(!a)return v.NextResponse.json({error:"TOTP is not configured"},{status:400});if(b.totpCode&&/^\d{6}$/.test(b.totpCode)){if(!await (0,x.z3)(a,b.totpCode))return(0,H.L)("totp_verify_fail",d),v.NextResponse.json({error:"Invalid verification code"},{status:401});(0,H.L)("login_success",d);let c=await (0,w.yL)(),e=v.NextResponse.json({success:!0});return e.headers.set("Set-Cookie",(0,w.US)(c)),e}if(b.recoveryCode){let a=(0,w.oB)();if(!a?.recoveryCodes?.length)return v.NextResponse.json({error:"No recovery codes available"},{status:400});let c=(0,x.Ak)(b.recoveryCode,a.recoveryCodes);if(!c)return(0,H.L)("totp_verify_fail",d),v.NextResponse.json({error:"Invalid recovery code"},{status:401});(0,w.Vn)(c),(0,H.L)("login_success",d);let e=await (0,w.yL)(),f=v.NextResponse.json({success:!0,recoveryCodeUsed:!0});return f.headers.set("Set-Cookie",(0,w.US)(e)),f}return v.NextResponse.json({error:"Verification code or recovery code required"},{status:400})}return v.NextResponse.json({error:"Password required"},{status:400})}catch(a){return v.NextResponse.json({error:String(a)},{status:500})}}let J=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/login/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:K,workUnitAsyncStorage:L,serverHooks:M}=J;function N(){return(0,g.patchFetch)({workAsyncStorage:K,workUnitAsyncStorage:L})}async function O(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),J.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/login/route";"/index"===d&&(d="/");let e=await J.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:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:F}=e,G=(0,k.normalizeAppPath)(d),H=!!(z.dynamicRoutes[G]||z.routes[D]),I=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(H&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[G];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await I();throw new t.NoFallbackError}}let K=null;!H||J.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===J.isDev||!H,M=H&&!L;F&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:F});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 J.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)=>J.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=>J.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&&C&&!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(!H)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 J.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await J.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!H)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&&H||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 J.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),H)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},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-${function(){if(process.env.PORT)return process.env.PORT;let a=process.argv;for(let b=0;b<a.length;b++)if(("-p"===a[b]||"--port"===a[b])&&b+1<a.length)return a[b+1];return"30141"}()}=${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=31301));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=7758,a.ids=[7758],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")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},54475:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>q});var d=c(23211),e=c(20424),f=c(2072);let g=new Map,h={failures:[],lockedUntil:0},i=/^(1|true|yes|on)$/i;function j(){return{failures:[],lockedUntil:0}}function k(a,b,c){for(;a.failures.length>0&&b-a.failures[0]>c;)a.failures.shift()}function l(a,b,c){return k(a,b,c),!(a.lockedUntil>b)&&(0!==a.lockedUntil&&(a.lockedUntil=0),!0)}function m(a,b,c,d,e){k(a,b,c),a.failures.push(b),a.failures.length>=d&&(a.lockedUntil=b+e,a.failures=[])}function n(a,b){0===b.failures.length&&0===b.lockedUntil?g.delete(a):g.set(a,b)}function o(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}var p=c(62814);async function q(a){try{let b=await a.json(),{rateLimitKey:c,auditIp:q}=function(a){if(!i.test(process.env.ANNOVIBE_TRUST_PROXY_HEADERS??""))return{rateLimitKey:"direct-client"};let b=function(a){let b=a.get("forwarded");if(b){let a=function(a){let b=a.split(",")[0]?.trim();if(!b)return null;for(let a of b.split(";")){let[b,c]=a.split("=",2);if(b?.trim().toLowerCase()==="for"&&c)return o(c)}return null}(b);if(a)return a}let c=a.get("x-forwarded-for");if(c){let a=o(c.split(",")[0]??"");if(a)return a}let d=a.get("x-real-ip");if(d){let a=o(d);if(a)return a}return null}(a.headers);return b?{rateLimitKey:`ip:${b}`,auditIp:b}:{rateLimitKey:"trusted-proxy:unknown"}}(a);if(!function(a){let b=Date.now();if(!l(h,b,36e5))return!1;let c=g.get(a)??j(),d=l(c,b,3e5);return n(a,c),d}(c))return(0,p.L)("login_rate_limited",q),d.NextResponse.json({error:"Too many login attempts. Try again later."},{status:429});if(b.password){let f;if(!(0,e.BE)(b.password)){let a,b;return a=Date.now(),b=g.get(c)??j(),m(b,a,3e5,5,9e5),n(c,b),m(h,a,36e5,10,18e5),(0,p.L)("login_fail",q),d.NextResponse.json({error:"Invalid password"},{status:401})}if(g.delete(c),f=Date.now(),k(h,f,36e5),0!==h.lockedUntil&&h.lockedUntil<=f&&(h.lockedUntil=0),(0,e.WG)(a)){let a=await (0,e.kR)();return d.NextResponse.json({step:"totp",tempToken:a})}(0,p.L)("login_success",q);let i=await (0,e.yL)(),l=d.NextResponse.json({success:!0});return l.headers.set("Set-Cookie",(0,e.US)(i)),l}if(b.tempToken){if(!await (0,e.JZ)(b.tempToken))return d.NextResponse.json({error:"Session expired. Please sign in again."},{status:401});let a=(0,e.I0)();if(!a)return d.NextResponse.json({error:"TOTP is not configured"},{status:400});if(b.totpCode&&/^\d{6}$/.test(b.totpCode)){if(!await (0,f.z3)(a,b.totpCode))return(0,p.L)("totp_verify_fail",q),d.NextResponse.json({error:"Invalid verification code"},{status:401});(0,p.L)("login_success",q);let c=await (0,e.yL)(),g=d.NextResponse.json({success:!0});return g.headers.set("Set-Cookie",(0,e.US)(c)),g}if(b.recoveryCode){let a=(0,e.oB)();if(!a?.recoveryCodes?.length)return d.NextResponse.json({error:"No recovery codes available"},{status:400});let c=(0,f.Ak)(b.recoveryCode,a.recoveryCodes);if(!c)return(0,p.L)("totp_verify_fail",q),d.NextResponse.json({error:"Invalid recovery code"},{status:401});(0,e.Vn)(c),(0,p.L)("login_success",q);let g=await (0,e.yL)(),h=d.NextResponse.json({success:!0,recoveryCodeUsed:!0});return h.headers.set("Set-Cookie",(0,e.US)(g)),h}return d.NextResponse.json({error:"Verification code or recovery code required"},{status:400})}return d.NextResponse.json({error:"Password required"},{status:400})}catch(a){return d.NextResponse.json({error:String(a)},{status:500})}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73680:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/auth/login/route.ts",nextConfigOutput:"",userland:()=>c(54475),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/auth/login/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.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==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},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,[2970,1813,4013,716,7603],()=>b(b.s=73680));module.exports=c})();
|