@mcy2015/pi-web 0.17.1 → 0.17.2
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 +16 -15
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +4 -4
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +5 -5
- package/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -4
- package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/lease/route.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/debug/route.js +2 -2
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auto-title/route.js +2 -2
- package/.next/server/app/api/automations/route.js +2 -2
- package/.next/server/app/api/cache-miss-notices/route.js +1 -1
- package/.next/server/app/api/channels/route.js +2 -2
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/validate/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/files/[...path]/route.js +1 -1
- package/.next/server/app/api/git/commit/route.js +1 -1
- package/.next/server/app/api/git/diff/route.js +2 -2
- package/.next/server/app/api/git/graph/route.js +1 -1
- package/.next/server/app/api/git/status/route.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/mcp/route.js +2 -2
- package/.next/server/app/api/mcp/sign-in/[flowId]/route.js +1 -1
- package/.next/server/app/api/mcp/sign-in/route.js +1 -1
- package/.next/server/app/api/mcp/test/route.js +1 -1
- package/.next/server/app/api/models/default/route.js +1 -1
- package/.next/server/app/api/models/enabled/route.js +1 -1
- package/.next/server/app/api/models/refresh/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/catalog/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/open-in-explorer/route.js +1 -1
- package/.next/server/app/api/plugins/check/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/provider-usage/query/route.js +1 -1
- package/.next/server/app/api/push/config/route.js +1 -1
- package/.next/server/app/api/push/subscribe/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/share/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/delete/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/search/route.js +1 -1
- package/.next/server/app/api/sessions/stats/route.js +1 -1
- package/.next/server/app/api/sessions/ui-state/route.js +1 -1
- package/.next/server/app/api/shares/route.js +1 -0
- package/.next/server/app/api/shares/route.js.nft.json +1 -0
- package/.next/server/app/api/shares/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/content/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/subagents/[id]/route.js +1 -1
- package/.next/server/app/api/subagents/profiles/route.js +1 -1
- package/.next/server/app/api/subagents/settings/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/events/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/route.js +1 -1
- package/.next/server/app/api/terminal/route.js +1 -1
- package/.next/server/app/api/tools/settings/route.js +1 -1
- package/.next/server/app/api/usage/route.js +1 -1
- package/.next/server/app/api/web-auth/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/files/page.js +1 -1
- package/.next/server/app/files/page.js.nft.json +1 -1
- package/.next/server/app/files/page_client-reference-manifest.js +1 -1
- package/.next/server/app/files.html +1 -1
- package/.next/server/app/files.rsc +10 -10
- package/.next/server/app/files.segments/_full.segment.rsc +10 -10
- package/.next/server/app/files.segments/_tree.segment.rsc +4 -4
- package/.next/server/app/files.segments/files/__PAGE__.segment.rsc +10 -10
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +11 -11
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +11 -11
- package/.next/server/app/index.segments/_full.segment.rsc +11 -11
- package/.next/server/app/index.segments/_tree.segment.rsc +4 -4
- package/.next/server/app/login/page.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +6 -6
- package/.next/server/app/login.segments/_full.segment.rsc +6 -6
- package/.next/server/app/login.segments/_tree.segment.rsc +4 -4
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/manifest.webmanifest/route.js +1 -1
- package/.next/server/app/page.js +7 -7
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[code]/page.js +1 -1
- package/.next/server/app/share/[code]/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +16 -15
- package/.next/server/chunks/1795.js +1 -1
- package/.next/server/chunks/1975.js +1 -1
- package/.next/server/chunks/210.js +2 -2
- package/.next/server/chunks/2243.js +1 -1
- package/.next/server/chunks/{6277.js → 3314.js} +4 -4
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1278-876b99533141f279.js +1 -0
- package/.next/static/chunks/284-e1e783d9e5143323.js +1 -0
- package/.next/static/chunks/{9176-f11528109e7d83c1.js → 7676-b24da124462459f3.js} +4 -4
- package/.next/static/chunks/app/_global-error/{page-88c7e2580138ec1c.js → page-d609aac1f93b26f5.js} +1 -1
- package/.next/static/chunks/app/api/agent/[id]/bash-output/{route-88c7e2580138ec1c.js → route-d609aac1f93b26f5.js} +1 -1
- package/.next/static/chunks/app/api/agent/[id]/events/{route-88c7e2580138ec1c.js → route-d609aac1f93b26f5.js} +1 -1
- package/.next/static/chunks/app/api/agent/[id]/lease/{route-88c7e2580138ec1c.js → route-d609aac1f93b26f5.js} +1 -1
- package/.next/static/chunks/app/api/agent/[id]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/agent/debug/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/app-update/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/auto-title/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/automations/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/cache-miss-notices/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/channels/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/cwd/browse/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/cwd/validate/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/git/commit/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/git/graph/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/home/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/mcp/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/mcp/sign-in/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/mcp/test/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models/default/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models/enabled/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models/refresh/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models-config/catalog/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/open-in-explorer/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/plugins/check/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/project-trust/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/provider-usage/query/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/push/config/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/push/subscribe/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/fork/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/share/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/state/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/delete/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/search/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/stats/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/sessions/ui-state/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/shares/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/skills/content/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/skills/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/subagents/[id]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/subagents/profiles/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/subagents/settings/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/events/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/terminal/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/tools/settings/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/usage/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/web-auth/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/files/{page-40308d21a9d1a26a.js → page-352f61869d357327.js} +1 -1
- package/.next/static/chunks/app/{layout-eda1fa79c5ba3062.js → layout-4ca77cad75a0bfc8.js} +1 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/app/page-ebc3272cf64b5bd8.js +1457 -0
- package/.next/static/chunks/app/share/[code]/page-4fde087c2bde8c42.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d609aac1f93b26f5.js +1 -0
- package/.next/static/chunks/{webpack-44982447a18652d3.js → webpack-5da211d332d8592e.js} +1 -1
- package/.next/static/css/{5739c029a2a29694.css → a14d8fc049aae12c.css} +1 -1
- package/.next/static/css/d53051ff70f97c47.css +1 -0
- package/.next/static/css/d948f02f49c0cac8.css +1 -0
- package/.next/static/xtVraug33Zuh6-oCFF6TA/_buildManifest.js +1 -0
- package/.next/trace +38 -208
- package/.next/trace-build +1 -1
- package/.next/types/app/api/shares/route.ts +355 -0
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +10 -0
- package/package.json +1 -1
- package/.next/static/_884wk2ryoAjRUvJAc4GP/_buildManifest.js +0 -1
- package/.next/static/chunks/1278-21d0e32dd826a688.js +0 -1
- package/.next/static/chunks/8045-5d165548a0c7f7c5.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/agent/debug/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/app-update/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/auto-title/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/automations/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/cache-miss-notices/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/channels/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/cwd/browse/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/cwd/validate/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/git/commit/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/git/graph/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/home/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/mcp/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/mcp/sign-in/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/mcp/test/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models/default/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models/enabled/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models/refresh/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models-config/catalog/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/open-in-explorer/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/plugins/check/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/project-trust/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/provider-usage/query/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/push/config/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/push/subscribe/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/fork/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/share/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/state/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/delete/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/search/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/stats/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/sessions/ui-state/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/skills/content/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/skills/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/subagents/[id]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/subagents/profiles/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/subagents/settings/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/events/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/terminal/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/tools/settings/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/usage/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/web-auth/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/app/page-73ec0dba1c5214c8.js +0 -1457
- package/.next/static/chunks/app/share/[code]/page-f4850ac677cd51a1.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-88c7e2580138ec1c.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-88c7e2580138ec1c.js +0 -1
- package/.next/static/css/83a179aa16591ae4.css +0 -1
- package/.next/static/css/c99d24fe85e139cc.css +0 -1
- /package/.next/static/{_884wk2ryoAjRUvJAc4GP → xtVraug33Zuh6-oCFF6TA}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=6945,a.ids=[6945],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")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},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")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},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")},50755:a=>{a.exports=require("node:url")},51181:a=>{a.exports=require("web-push")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},77927:(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/sessions/stats/route",pathname:"/api/sessions/stats",filename:"route",bundlePath:"app/api/sessions/stats/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/Data Vault/PiSpace/pi-web/app/api/sessions/stats/route.ts",nextConfigOutput:"",userland:()=>c(93752),...{}}),{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/sessions/stats/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)}},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88914:(a,b,c)=>{function d(a,b){b&&(a.tokens.input+=b.input??0,a.tokens.output+=b.output??0,a.tokens.cacheRead+=b.cacheRead??0,a.tokens.cacheWrite+=b.cacheWrite??0,a.cost+=b.cost?.total??0)}function e(a){var b;let c={userMessages:0,assistantMessages:0,toolCalls:0,toolResults:0,totalMessages:0,tokens:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},cost:0};for(let e of a){if("compaction"===e.type||"branch_summary"===e.type||"usage"===e.type){d(c,e.usage);continue}"message"===e.type&&(b=e.message,c.totalMessages+=1,"user"===b.role?c.userMessages+=1:"toolResult"===b.role?(c.toolResults+=1,d(c,b.usage)):"assistant"===b.role&&(c.assistantMessages+=1,Array.isArray(b.content)&&(c.toolCalls+=b.content.filter(a=>"toolCall"===a.type).length),d(c,b.usage)))}return c.tokens.total=c.tokens.input+c.tokens.output+c.tokens.cacheRead+c.tokens.cacheWrite,c}c.d(b,{P:()=>e})},93752:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>p,dynamic:()=>q});var e=c(23211),f=c(66544),g=c(56429),h=c(40402),i=c(88914),j=c(89691),k=c(32812),l=c(12069),m=a([g,h,k]);[g,h,k]=m.then?(await m)():m;let q="force-dynamic",r={"Cache-Control":"no-store"},s=new WeakMap;function n(a,b){return e.NextResponse.json({error:b},{status:a,headers:r})}async function o(a){let b,c=(0,g.hH)(a);if(c?.isAlive())b=c.inner.sessionManager;else{let c=await (0,h.os)(a);if(!c)return null;b=(0,h.G1)(c)}let d=b.getEntries(),e=d[d.length-1]?.id,f=b.getLeafId(),l=s.get(b);if(l&&l.entryCount===d.length&&l.lastEntryId===e&&l.leafId===f)return l.summary;let m=(0,k.sq)(d),n=(0,i.P)(m),o={tokens:n.tokens,cost:n.cost,toolCalls:n.toolCalls,totalActiveMs:(0,j.c)(m),...(0,h.is)(d,f)};return s.set(b,{entryCount:d.length,lastEntryId:e,leafId:f,summary:o}),o}async function p(a){let b;if(!(0,f.EN)(a))return n(403,"Untrusted API request");if(!(0,f.E2)(a))return n(415,"Content-Type must be application/json");try{b=await a.json()}catch{return n(400,"Invalid JSON body")}let c="object"!=typeof b||null===b||Array.isArray(b)?void 0:b.ids;if(!Array.isArray(c)||0===c.length)return n(400,"ids must be a non-empty array");if(c.length>200)return n(400,"ids may hold at most 200 session ids");if(!c.every(a=>"string"==typeof a&&l.Id.test(a)))return n(400,"ids must be session ids");let d={};for(let a of new Set(c))try{let b=await o(a);b&&(d[a]=b)}catch{}return e.NextResponse.json({stats:d},{headers:r})}d()}catch(a){d(a)}})},94735:a=>{a.exports=require("events")},98995:a=>{a.exports=require("node:module")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,8045,974,5138,5582,426,3757,4698,2243,6429,2069],()=>b(b.s=77927));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=6945,a.ids=[6945],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")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},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")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},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")},50755:a=>{a.exports=require("node:url")},51181:a=>{a.exports=require("web-push")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},79183:(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/sessions/stats/route",pathname:"/api/sessions/stats",filename:"route",bundlePath:"app/api/sessions/stats/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/Data Vault/PiSpace/pi-web/app/api/sessions/stats/route.ts",nextConfigOutput:"",userland:()=>c(93752),...{}}),{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/sessions/stats/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)}},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88914:(a,b,c)=>{function d(a,b){b&&(a.tokens.input+=b.input??0,a.tokens.output+=b.output??0,a.tokens.cacheRead+=b.cacheRead??0,a.tokens.cacheWrite+=b.cacheWrite??0,a.cost+=b.cost?.total??0)}function e(a){var b;let c={userMessages:0,assistantMessages:0,toolCalls:0,toolResults:0,totalMessages:0,tokens:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},cost:0};for(let e of a){if("compaction"===e.type||"branch_summary"===e.type||"usage"===e.type){d(c,e.usage);continue}"message"===e.type&&(b=e.message,c.totalMessages+=1,"user"===b.role?c.userMessages+=1:"toolResult"===b.role?(c.toolResults+=1,d(c,b.usage)):"assistant"===b.role&&(c.assistantMessages+=1,Array.isArray(b.content)&&(c.toolCalls+=b.content.filter(a=>"toolCall"===a.type).length),d(c,b.usage)))}return c.tokens.total=c.tokens.input+c.tokens.output+c.tokens.cacheRead+c.tokens.cacheWrite,c}c.d(b,{P:()=>e})},93752:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>p,dynamic:()=>q});var e=c(23211),f=c(66544),g=c(56429),h=c(40402),i=c(88914),j=c(89691),k=c(32812),l=c(12069),m=a([g,h,k]);[g,h,k]=m.then?(await m)():m;let q="force-dynamic",r={"Cache-Control":"no-store"},s=new WeakMap;function n(a,b){return e.NextResponse.json({error:b},{status:a,headers:r})}async function o(a){let b,c=(0,g.hH)(a);if(c?.isAlive())b=c.inner.sessionManager;else{let c=await (0,h.os)(a);if(!c)return null;b=(0,h.G1)(c)}let d=b.getEntries(),e=d[d.length-1]?.id,f=b.getLeafId(),l=s.get(b);if(l&&l.entryCount===d.length&&l.lastEntryId===e&&l.leafId===f)return l.summary;let m=(0,k.sq)(d),n=(0,i.P)(m),o={tokens:n.tokens,cost:n.cost,toolCalls:n.toolCalls,totalActiveMs:(0,j.c)(m),...(0,h.is)(d,f)};return s.set(b,{entryCount:d.length,lastEntryId:e,leafId:f,summary:o}),o}async function p(a){let b;if(!(0,f.EN)(a))return n(403,"Untrusted API request");if(!(0,f.E2)(a))return n(415,"Content-Type must be application/json");try{b=await a.json()}catch{return n(400,"Invalid JSON body")}let c="object"!=typeof b||null===b||Array.isArray(b)?void 0:b.ids;if(!Array.isArray(c)||0===c.length)return n(400,"ids must be a non-empty array");if(c.length>200)return n(400,"ids may hold at most 200 session ids");if(!c.every(a=>"string"==typeof a&&l.Id.test(a)))return n(400,"ids must be session ids");let d={};for(let a of new Set(c))try{let b=await o(a);b&&(d[a]=b)}catch{}return e.NextResponse.json({stats:d},{headers:r})}d()}catch(a){d(a)}})},94735:a=>{a.exports=require("events")},98995:a=>{a.exports=require("node:module")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,8045,974,5138,5582,426,3757,4698,2243,6429,2069],()=>b(b.s=79183));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=1438,a.ids=[1438],a.modules={97:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,POST:()=>l,dynamic:()=>m});var e=c(23211),f=c(66544),g=c(10879),h=c(12069),i=a([g]);g=(i.then?(await i)():i)[0];let m="force-dynamic",n={"Cache-Control":"no-store"};function j(a,b,c){return e.NextResponse.json({error:c,reason:b},{status:a,headers:n})}async function k(){return e.NextResponse.json({state:(0,g.ej)()},{headers:n})}async function l(a){let b;if(!(0,f.EN)(a))return j(403,"request-denied","Untrusted API request");if(!(0,f.E2)(a))return j(415,"content-type","Content-Type must be application/json");try{b=await a.json()}catch{return j(400,"invalid-request","Invalid JSON body")}if("object"!=typeof b||null===b||Array.isArray(b))return j(400,"invalid-request","Expected a JSON object");let c=(0,h.KI)(b);if(!c.ok)return j(400,"invalid-request",c.error);let{request:d}=c;try{let a=await (0,g.$q)(d);if("rename-project"===d.action&&null!==d.name&&(0,h.Q3)(a,d.projectKey)!==d.name)return j(409,"full",`No room for another project name (at most ${h.cx}, ${h.Kk/1024} KiB in all)`);return e.NextResponse.json({state:a},{headers:n})}catch(a){if(a instanceof g.yh)return j(409,"locked",a.message);return j(500,"internal",a instanceof Error?a.message:String(a))}}d()}catch(a){d(a)}})},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")},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},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")},10879:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$q:()=>x,Vy:()=>v,bA:()=>y,ej:()=>u,yh:()=>C});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=c(8102),k=c(63108),l=c(37431),m=c(12069),n=a([g]);g=(n.then?(await n)():n)[0];let z=new Set(["version","revision","sessions","projects","projectOrder","projectNames","readAt","__proto__"]),A=Symbol.for("pi-web:session-ui-state-write-queue"),B={realpath:!1,stale:1e4,retries:{retries:10,factor:2,minTimeout:25,maxTimeout:500},onCompromised:a=>{console.warn(`[pi-web] the session UI state lock was compromised: ${a.message}`)}};class C extends Error{constructor(a="Another process holds the session UI state lock"){super(a),this.name="SessionUiStateLockedError"}}function o(){return globalThis.__piWebSessionUiStateCache??={reads:new Map,revisions:new Map}}function p(a,b){let c=o().revisions;b>(c.get(a)??-1)&&c.set(a,b)}function q(a){return structuredClone(a)}function r(a=(0,g.getAgentDir)()){return(0,f.join)(a,"pi-web-session-state.json")}function s(a){let b;try{b=JSON.parse(a)}catch{return{ok:!1}}let c=(0,m.Jx)(b);return c?{ok:!0,state:c,raw:b}:{ok:!1}}function t(a){let b,c;try{b=(0,e.statSync)(a)}catch(c){let b=c?.code;if("ENOENT"===b||"ENOTDIR"===b)return o().reads.delete(a),(0,m.ly)();throw c}let d=o().reads.get(a);if(d&&d.mtimeMs===b.mtimeMs&&d.size===b.size&&d.ino===b.ino)return d.state;let f=(0,l.y)(a,4194304);if(void 0===f)return o().reads.delete(a),(0,m.ly)();let g=s(f);return g.ok?p(a,(c=g.state).revision):(console.warn(`[pi-web] ${a} is not valid session UI state; reading it as empty until the next change sets it aside`),c=(0,m.ly)()),o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:c}),c}function u(a){try{return q(t(a??r()))}catch(a){return console.warn(`[pi-web] could not read the session UI state: ${a instanceof Error?a.message:String(a)}`),(0,m.ly)()}}function v(a){try{return t(a??r()).revision}catch{return null}}function w(a,b){return(0,k.T)(A,a,async()=>{let c;(0,e.mkdirSync)((0,f.dirname)(a),{recursive:!0});try{c=await i().lock(a,B)}catch(a){if("ELOCKED"===a?.code)throw new C;throw a}try{let c,d=o().revisions.get(a)??0,f=(0,l.y)(a,4194304),g={},h=!1;if(void 0===f)c={...(0,m.ly)(),revision:d};else{let b=s(f);if(b.ok)for(let[a,d]of(c=b.state,Object.entries(b.raw)))z.has(a)||(g[a]=d);else{let b=`${a}.corrupt-${Date.now()}`;try{(0,e.renameSync)(a,b),console.warn(`[pi-web] ${a} could not be parsed; moved it to ${b} and started from an empty session UI state`)}catch(b){console.warn(`[pi-web] ${a} could not be parsed and could not be moved aside (${b instanceof Error?b.message:String(b)}); starting from an empty session UI state`)}c={...(0,m.ly)(),revision:d+1},h=!0}}let i=b(c);if(!i.changed&&!h)return q(c);let k={...i.state,version:m.fS,revision:c.revision+ +!!i.changed},n={version:k.version,revision:k.revision,sessions:k.sessions,projects:k.projects,...k.projectOrder?.length?{projectOrder:k.projectOrder}:{},...k.projectNames&&Object.keys(k.projectNames).length>0?{projectNames:k.projectNames}:{},...k.readAt&&Object.keys(k.readAt).length>0?{readAt:k.readAt}:{},...g};(0,j.$)(a,JSON.stringify(n,null,2)+"\n"),p(a,k.revision);try{let b=(0,e.statSync)(a);o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:q(k)})}catch{o().reads.delete(a)}return q(k)}finally{try{await c()}catch{}}})}function x(a,b){let c;try{c=b??r()}catch(a){return Promise.reject(a)}return w(c,b=>(0,m.D7)(b,a,Date.now()))}async function y(a,b){let c=b??r(),d=[...new Set(a)];if(0===d.length)return;let e=(a,b)=>void 0!==a&&Object.prototype.hasOwnProperty.call(a,b),f=a=>d.some(b=>e(a.sessions,b)||e(a.readAt,b));f(t(c))&&await w(c,a=>{if(!f(a))return{state:a,changed:!1};let b={...a.sessions},c={...a.readAt};for(let a of d)delete b[a],delete c[a];let e={...a,sessions:b};return Object.keys(c).length>0?e.readAt=c:delete e.readAt,{state:e,changed:!0}})}d()}catch(a){d(a)}})},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{"use strict";a.exports=require("stream")},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")},33873:a=>{"use strict";a.exports=require("path")},37431:(a,b,c)=>{"use strict";c.d(b,{T:()=>f,y:()=>g});var d=c(73024);let e=d.constants.O_RDONLY|(d.constants.O_NONBLOCK||0),f=1048576;function g(a,b){let c;try{c=(0,d.openSync)(a,e)}catch(b){let a;if("ENOENT"===(a=b?.code)||"ENOTDIR"===a)return;throw b}try{let e=(0,d.fstatSync)(c);if(!e.isFile())throw Error(`${a} is not a regular file`);if(void 0===b)return(0,d.readFileSync)(c,"utf8");if(e.size>b)throw Error(`${a} is larger than ${b} bytes`);let f=b+1,g=[],h=0;for(;h<f;){let a=Buffer.alloc(Math.min(f-h,65536)),b=(0,d.readSync)(c,a,0,a.length,null);if(0===b)break;g.push(a.subarray(0,b)),h+=b}if(h>b)throw Error(`${a} is larger than ${b} bytes`);return Buffer.concat(g,h).toString("utf8")}finally{(0,d.closeSync)(c)}}},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")},63108:(a,b,c)=>{"use strict";function d(a,b,c){let d=globalThis,e=d[a]??=new Map,f=(e.get(b)??Promise.resolve()).then(c),g=f.then(()=>void 0,()=>void 0);return e.set(b,g),g.then(()=>{e.get(b)===g&&e.delete(b)}),f}c.d(b,{T:()=>d})},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},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")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},81115:a=>{"use strict";a.exports=require("constants")},83439:(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/sessions/ui-state/route",pathname:"/api/sessions/ui-state",filename:"route",bundlePath:"app/api/sessions/ui-state/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/Data Vault/PiSpace/pi-web/app/api/sessions/ui-state/route.ts",nextConfigOutput:"",userland:()=>c(97),...{}}),{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/sessions/ui-state/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=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,974,2069],()=>b(b.s=83439));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=1438,a.ids=[1438],a.modules={97:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,POST:()=>l,dynamic:()=>m});var e=c(23211),f=c(66544),g=c(10879),h=c(12069),i=a([g]);g=(i.then?(await i)():i)[0];let m="force-dynamic",n={"Cache-Control":"no-store"};function j(a,b,c){return e.NextResponse.json({error:c,reason:b},{status:a,headers:n})}async function k(){return e.NextResponse.json({state:(0,g.ej)()},{headers:n})}async function l(a){let b;if(!(0,f.EN)(a))return j(403,"request-denied","Untrusted API request");if(!(0,f.E2)(a))return j(415,"content-type","Content-Type must be application/json");try{b=await a.json()}catch{return j(400,"invalid-request","Invalid JSON body")}if("object"!=typeof b||null===b||Array.isArray(b))return j(400,"invalid-request","Expected a JSON object");let c=(0,h.KI)(b);if(!c.ok)return j(400,"invalid-request",c.error);let{request:d}=c;try{let a=await (0,g.$q)(d);if("rename-project"===d.action&&null!==d.name&&(0,h.Q3)(a,d.projectKey)!==d.name)return j(409,"full",`No room for another project name (at most ${h.cx}, ${h.Kk/1024} KiB in all)`);return e.NextResponse.json({state:a},{headers:n})}catch(a){if(a instanceof g.yh)return j(409,"locked",a.message);return j(500,"internal",a instanceof Error?a.message:String(a))}}d()}catch(a){d(a)}})},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")},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},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")},10879:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$q:()=>x,Vy:()=>v,bA:()=>y,ej:()=>u,yh:()=>C});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=c(8102),k=c(63108),l=c(37431),m=c(12069),n=a([g]);g=(n.then?(await n)():n)[0];let z=new Set(["version","revision","sessions","projects","projectOrder","projectNames","readAt","__proto__"]),A=Symbol.for("pi-web:session-ui-state-write-queue"),B={realpath:!1,stale:1e4,retries:{retries:10,factor:2,minTimeout:25,maxTimeout:500},onCompromised:a=>{console.warn(`[pi-web] the session UI state lock was compromised: ${a.message}`)}};class C extends Error{constructor(a="Another process holds the session UI state lock"){super(a),this.name="SessionUiStateLockedError"}}function o(){return globalThis.__piWebSessionUiStateCache??={reads:new Map,revisions:new Map}}function p(a,b){let c=o().revisions;b>(c.get(a)??-1)&&c.set(a,b)}function q(a){return structuredClone(a)}function r(a=(0,g.getAgentDir)()){return(0,f.join)(a,"pi-web-session-state.json")}function s(a){let b;try{b=JSON.parse(a)}catch{return{ok:!1}}let c=(0,m.Jx)(b);return c?{ok:!0,state:c,raw:b}:{ok:!1}}function t(a){let b,c;try{b=(0,e.statSync)(a)}catch(c){let b=c?.code;if("ENOENT"===b||"ENOTDIR"===b)return o().reads.delete(a),(0,m.ly)();throw c}let d=o().reads.get(a);if(d&&d.mtimeMs===b.mtimeMs&&d.size===b.size&&d.ino===b.ino)return d.state;let f=(0,l.y)(a,4194304);if(void 0===f)return o().reads.delete(a),(0,m.ly)();let g=s(f);return g.ok?p(a,(c=g.state).revision):(console.warn(`[pi-web] ${a} is not valid session UI state; reading it as empty until the next change sets it aside`),c=(0,m.ly)()),o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:c}),c}function u(a){try{return q(t(a??r()))}catch(a){return console.warn(`[pi-web] could not read the session UI state: ${a instanceof Error?a.message:String(a)}`),(0,m.ly)()}}function v(a){try{return t(a??r()).revision}catch{return null}}function w(a,b){return(0,k.T)(A,a,async()=>{let c;(0,e.mkdirSync)((0,f.dirname)(a),{recursive:!0});try{c=await i().lock(a,B)}catch(a){if("ELOCKED"===a?.code)throw new C;throw a}try{let c,d=o().revisions.get(a)??0,f=(0,l.y)(a,4194304),g={},h=!1;if(void 0===f)c={...(0,m.ly)(),revision:d};else{let b=s(f);if(b.ok)for(let[a,d]of(c=b.state,Object.entries(b.raw)))z.has(a)||(g[a]=d);else{let b=`${a}.corrupt-${Date.now()}`;try{(0,e.renameSync)(a,b),console.warn(`[pi-web] ${a} could not be parsed; moved it to ${b} and started from an empty session UI state`)}catch(b){console.warn(`[pi-web] ${a} could not be parsed and could not be moved aside (${b instanceof Error?b.message:String(b)}); starting from an empty session UI state`)}c={...(0,m.ly)(),revision:d+1},h=!0}}let i=b(c);if(!i.changed&&!h)return q(c);let k={...i.state,version:m.fS,revision:c.revision+ +!!i.changed},n={version:k.version,revision:k.revision,sessions:k.sessions,projects:k.projects,...k.projectOrder?.length?{projectOrder:k.projectOrder}:{},...k.projectNames&&Object.keys(k.projectNames).length>0?{projectNames:k.projectNames}:{},...k.readAt&&Object.keys(k.readAt).length>0?{readAt:k.readAt}:{},...g};(0,j.$)(a,JSON.stringify(n,null,2)+"\n"),p(a,k.revision);try{let b=(0,e.statSync)(a);o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:q(k)})}catch{o().reads.delete(a)}return q(k)}finally{try{await c()}catch{}}})}function x(a,b){let c;try{c=b??r()}catch(a){return Promise.reject(a)}return w(c,b=>(0,m.D7)(b,a,Date.now()))}async function y(a,b){let c=b??r(),d=[...new Set(a)];if(0===d.length)return;let e=(a,b)=>void 0!==a&&Object.prototype.hasOwnProperty.call(a,b),f=a=>d.some(b=>e(a.sessions,b)||e(a.readAt,b));f(t(c))&&await w(c,a=>{if(!f(a))return{state:a,changed:!1};let b={...a.sessions},c={...a.readAt};for(let a of d)delete b[a],delete c[a];let e={...a,sessions:b};return Object.keys(c).length>0?e.readAt=c:delete e.readAt,{state:e,changed:!0}})}d()}catch(a){d(a)}})},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{"use strict";a.exports=require("stream")},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")},33873:a=>{"use strict";a.exports=require("path")},37431:(a,b,c)=>{"use strict";c.d(b,{T:()=>f,y:()=>g});var d=c(73024);let e=d.constants.O_RDONLY|(d.constants.O_NONBLOCK||0),f=1048576;function g(a,b){let c;try{c=(0,d.openSync)(a,e)}catch(b){let a;if("ENOENT"===(a=b?.code)||"ENOTDIR"===a)return;throw b}try{let e=(0,d.fstatSync)(c);if(!e.isFile())throw Error(`${a} is not a regular file`);if(void 0===b)return(0,d.readFileSync)(c,"utf8");if(e.size>b)throw Error(`${a} is larger than ${b} bytes`);let f=b+1,g=[],h=0;for(;h<f;){let a=Buffer.alloc(Math.min(f-h,65536)),b=(0,d.readSync)(c,a,0,a.length,null);if(0===b)break;g.push(a.subarray(0,b)),h+=b}if(h>b)throw Error(`${a} is larger than ${b} bytes`);return Buffer.concat(g,h).toString("utf8")}finally{(0,d.closeSync)(c)}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51063:(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/sessions/ui-state/route",pathname:"/api/sessions/ui-state",filename:"route",bundlePath:"app/api/sessions/ui-state/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/Data Vault/PiSpace/pi-web/app/api/sessions/ui-state/route.ts",nextConfigOutput:"",userland:()=>c(97),...{}}),{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/sessions/ui-state/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")},63108:(a,b,c)=>{"use strict";function d(a,b,c){let d=globalThis,e=d[a]??=new Map,f=(e.get(b)??Promise.resolve()).then(c),g=f.then(()=>void 0,()=>void 0);return e.set(b,g),g.then(()=>{e.get(b)===g&&e.delete(b)}),f}c.d(b,{T:()=>d})},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},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")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,974,2069],()=>b(b.s=51063));module.exports=c})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var a={};a.id=7910,a.ids=[7910],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")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20451:(a,b,c)=>{c.d(b,{$S:()=>f,$_:()=>g,BQ:()=>d,zF:()=>h});let d=/^[A-Za-z0-9_-]{22}$/,e=[1,7,30],f=7;function g(a){return null===a||"number"==typeof a&&e.includes(a)}function h(a){if(void 0!==a.durationDays)return a.durationDays;if(null==a.expiresAt)return null;let b=Date.parse(a.expiresAt)-Date.parse(a.createdAt);if(!Number.isFinite(b))return f;let c=Math.round(b/864e5);return e.includes(c)?c:f}},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},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")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},33873:a=>{a.exports=require("path")},35505:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{L:()=>h});var e=c(52359),f=c(20451),g=a([e]);function h(a,b=(0,e.eQ)()){return Object.entries((0,e.xA)(b).shares).map(([b,c])=>({sessionId:b,code:c.code,title:c.snapshot.title,createdAt:c.createdAt,expiresAt:c.expiresAt??null,durationDays:(0,f.zF)(c),expired:(0,e.pQ)(c),orphan:!a.has(b)})).sort((a,b)=>b.createdAt.localeCompare(a.createdAt))}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},50755:a=>{a.exports=require("node:url")},51181:a=>{a.exports=require("web-push")},51455:a=>{a.exports=require("node:fs/promises")},52359:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{DR:()=>x,FW:()=>z,G:()=>B,Hl:()=>u,N2:()=>C,ZY:()=>A,eQ:()=>p,er:()=>t,pQ:()=>v,xA:()=>s});var e=c(77598),f=c(73024),g=c(76760),h=c(75430),i=c(80974),j=c.n(i),k=c(8102),l=c(63108),m=c(37431),n=c(20451),o=a([h]);h=(o.then?(await o)():o)[0];let D=Symbol.for("pi-web:share-store-write-queue"),E={realpath:!1,stale:1e4,retries:{retries:10,factor:2,minTimeout:25,maxTimeout:500},compromised:a=>{console.warn(`[pi-web] the share store lock was compromised: ${a.message}`)}};class F extends Error{constructor(){super("The share store is busy")}}function p(a=(0,h.getAgentDir)()){return(0,g.join)(a,"pi-web-shares.json")}function q(){return{version:1,shares:{}}}function r(a){return"string"==typeof a&&n.BQ.test(a)}function s(a=p()){let b=(0,m.y)(a,0x8000000);if(void 0===b)return q();try{let a=function(a){if(!a||"object"!=typeof a)return null;let b=a.shares;if(!b||"object"!=typeof b||Array.isArray(b))return null;let c={},d=0;for(let[a,e]of Object.entries(b)){if(d>=1e3||!e||"object"!=typeof e)return null;let b=e.code,f=e.createdAt,g=e.expiresAt,h=e.durationDays,i=e.snapshot;if(!r(b)||"string"!=typeof f||null!=g&&"string"!=typeof g||"string"==typeof g&&Number.isNaN(Date.parse(g))||void 0!==h&&!(0,n.$_)(h)||!i||"object"!=typeof i||!Array.isArray(i.messages))return null;c[a]={code:b,createdAt:f,...void 0===g?{}:{expiresAt:g},...void 0===h?{}:{durationDays:h},snapshot:i},d++}return{version:1,shares:c}}(JSON.parse(b));if(a)return a}catch{}let c=`${a}.corrupt-${Date.now()}`;try{(0,f.renameSync)(a,c),console.warn(`[pi-web] ${a} could not be parsed; moved it to ${c} and started from empty shares`)}catch(b){console.warn(`[pi-web] ${a} could not be parsed and could not be moved aside (${b instanceof Error?b.message:String(b)}); starting from empty shares`)}return q()}function t(a,b=p()){return s(b).shares[a]??null}function u(a){return{code:a.code,createdAt:a.createdAt,expiresAt:a.expiresAt??null,durationDays:(0,n.zF)(a),title:a.snapshot.title}}function v(a,b=new Date){if("string"!=typeof a.expiresAt)return!1;let c=Date.parse(a.expiresAt);return Number.isFinite(c)&&b.getTime()>=c}function w(a,b=new Date){return null===a?null:new Date(b.getTime()+864e5*a).toISOString()}function x(a,b=p()){if(!r(a))return null;for(let[c,d]of Object.entries(s(b).shares))if(d.code===a)return{sessionId:c,share:d};return null}function y(a,b){return(0,l.T)(D,a,async()=>{let c;(0,f.mkdirSync)((0,g.dirname)(a),{recursive:!0});try{c=await j().lock(a,E)}catch(a){if("ELOCKED"===a.code)throw new F;throw a}try{let c=s(a),{result:d,changed:e}=b(c);return e&&(0,k.$)(a,JSON.stringify(c,null,2)+"\n"),d}finally{await c()}})}function z(a,b,c=p(),d={}){return y(c,c=>{let f=c.shares[a],g=d.now??new Date,h=void 0===d.durationDays?n.$S:d.durationDays,i={code:f?.code??(0,e.randomBytes)(16).toString("base64url"),createdAt:g.toISOString(),expiresAt:w(h,g),durationDays:h,snapshot:b};return c.shares[a]=i,{result:i,changed:!0}})}function A(a,b,c=p(),d={}){return y(c,c=>{let e=c.shares[a];if(!e)return{result:null,changed:!1};let f={...e,expiresAt:w(b,d.now),durationDays:b};return c.shares[a]=f,{result:f,changed:!0}})}function B(a,b=p()){return y(b,b=>{let c=void 0!==b.shares[a];return c&&delete b.shares[a],{result:c,changed:c}})}function C(a,b=p()){return y(b,b=>{let c=[];for(let d of new Set(a))void 0!==b.shares[d]&&(delete b.shares[d],c.push(d));return{result:c,changed:c.length>0}})}d()}catch(a){d(a)}})},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73873:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>o,POST:()=>p,dynamic:()=>q});var e=c(23211),f=c(56429),g=c(35505),h=c(87515),i=c(52359),j=c(66544),k=c(40402),l=c(12069),m=a([f,g,i,k]);[f,g,i,k]=m.then?(await m)():m;let q="force-dynamic",r={"Cache-Control":"no-store"};function n(a,b){return e.NextResponse.json({error:b},{status:a,headers:r})}async function o(a){if(!(0,j.EN)(a))return n(403,"Untrusted API request");try{let a=(0,k.O5)(await (0,k.dQ)({force:!0}),(0,f.Bp)({includeTransient:!0})),b=new Set(a.map(a=>a.id));return e.NextResponse.json({shares:(0,g.L)(b)},{headers:r})}catch(a){return n(500,a instanceof Error?a.message:String(a))}}async function p(a){let b;if(!(0,j.EN)(a))return n(403,"Untrusted API request");if(!(0,j.E2)(a))return n(415,"Content-Type must be application/json");try{b=await a.json()}catch{return n(400,"Invalid JSON body")}let c="object"!=typeof b||null===b||Array.isArray(b)?null:b,d=c?.action;if("revoke"===d){let a=c?.ids;if(!Array.isArray(a)||0===a.length)return n(400,"ids must be a non-empty array");if(!a.every(a=>"string"==typeof a&&l.Id.test(a)))return n(400,"ids must be session ids");let b=[...new Set(a)];if(b.length>500)return n(400,"ids may hold at most 500 session ids");try{let a=await (0,i.N2)(b);return e.NextResponse.json({ok:!0,revoked:a},{headers:r})}catch(a){return n(500,a instanceof Error?a.message:String(a))}}if("renew"===d){let a=c?.sessionId;if("string"!=typeof a||!l.Id.test(a))return n(400,"sessionId must be a session id");let d=(0,h.D)(b);if(!d.ok)return n(400,d.error);try{let b=await (0,i.ZY)(a,d.durationDays);if(!b)return n(404,"No share for that session");return e.NextResponse.json({share:(0,i.Hl)(b)},{headers:r})}catch(a){return n(500,a instanceof Error?a.message:String(a))}}return n(400,"action must be revoke or renew")}d()}catch(a){d(a)}})},74599:(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/shares/route",pathname:"/api/shares",filename:"route",bundlePath:"app/api/shares/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/Data Vault/PiSpace/pi-web/app/api/shares/route.ts",nextConfigOutput:"",userland:()=>c(73873),...{}}),{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/shares/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=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87515:(a,b,c)=>{c.d(b,{D:()=>e});var d=c(20451);function e(a){if(null===a||"object"!=typeof a||Array.isArray(a))return{ok:!1,error:"Body must be a JSON object"};let b=a.durationDays;return void 0===b?{ok:!0,durationDays:d.$S}:(0,d.$_)(b)?{ok:!0,durationDays:b}:{ok:!1,error:"durationDays must be 1, 7, 30 or null"}}},94735:a=>{a.exports=require("events")},98995:a=>{a.exports=require("node:module")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,8045,974,5138,5582,426,3757,4698,2243,6429,2069],()=>b(b.s=74599));module.exports=c})();
|