@henlii/pidance 0.2.57 → 0.2.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +9 -6
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +20 -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 +2 -2
- package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +2 -2
- 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 +4 -4
- package/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/about/route.js +1 -1
- 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]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/running/events/route.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/agent/submissions/[submissionId]/route.js +1 -1
- package/.next/server/app/api/agent-settings/route.js +2 -2
- package/.next/server/app/api/attachments/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/ui-session/route.js +1 -1
- package/.next/server/app/api/auth/ui-sessions/[id]/route.js +1 -1
- package/.next/server/app/api/auth/ui-sessions/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/create/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/files/save-as/route.js +1 -1
- package/.next/server/app/api/git/diff/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/message-media/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/raw/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/plugins/market/detail/route.js +1 -0
- package/.next/server/app/api/plugins/market/detail/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plugins/market/route.js +1 -0
- package/.next/server/app/api/plugins/market/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plugins/route.js +1 -1
- package/.next/server/app/api/plugins/search/route.js +1 -1
- package/.next/server/app/api/plugins/updates/route.js +2 -2
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/project-assets/route.js +2 -2
- package/.next/server/app/api/prompts/route.js +1 -1
- package/.next/server/app/api/pty/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/archive/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/command-entry/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]/export/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/info/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/lock/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/outline/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/stats/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/tail/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/tail/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/tool-results/[toolCallId]/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/settings/raw/route.js +2 -2
- package/.next/server/app/api/settings/remote/route.js +1 -1
- package/.next/server/app/api/skills/check/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/subagent-runs/route.js +1 -1
- package/.next/server/app/api/update/apply/route.js +2 -2
- package/.next/server/app/api/update/check/route.js +1 -1
- package/.next/server/app/icon.png/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +6 -6
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/index.segments/_full.segment.rsc +6 -6
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page.js +13 -13
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +9 -6
- package/.next/server/chunks/4511.js +1 -1
- package/.next/server/chunks/5274.js +1 -1
- package/.next/server/chunks/5304.js +1 -1
- package/.next/server/chunks/5582.js +1 -1
- package/.next/server/chunks/6609.js +1 -1
- package/.next/server/chunks/7594.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/aJFvPy5UYluh8Oa2DrTcW/_buildManifest.js +1 -0
- package/.next/static/chunks/9780-646c3ce0d750f3b7.js +1 -0
- package/.next/static/chunks/app/_global-error/page-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/about/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent/running/events/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent/submissions/[submissionId]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/agent-settings/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/attachments/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/ui-session/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/ui-sessions/[id]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/auth/ui-sessions/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/cwd/browse/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/cwd/create/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/cwd/validate/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/files/save-as/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/home/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/message-media/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/models/enabled/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/models/refresh/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/models/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/models-config/raw/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/plugins/market/detail/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/plugins/market/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/plugins/search/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/plugins/updates/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/project-assets/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/prompts/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/pty/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/archive/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/command-entry/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/info/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/lock/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/outline/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/state/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/stats/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/tail/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/tool-results/[toolCallId]/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/sessions/search/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/settings/raw/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/settings/remote/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/skills/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/subagent-runs/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/update/apply/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/api/update/check/route-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/app/page-3c3f0691d85527d5.js +24 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-2451d0c73eeb1448.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2451d0c73eeb1448.js +1 -0
- package/.next/static/css/{399372bf9c5d7d43.css → 2ee048eec7b70966.css} +1 -1
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/package.json +3 -3
- package/.next/static/3APuisM7BhjGq0I4-df0W/_buildManifest.js +0 -1
- package/.next/static/chunks/9780-c207c7a3c7869f6d.js +0 -1
- package/.next/static/chunks/app/_global-error/page-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/about/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent/running/events/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent/submissions/[submissionId]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/agent-settings/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/attachments/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/ui-session/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/ui-sessions/[id]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/auth/ui-sessions/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/cwd/browse/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/cwd/create/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/cwd/validate/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/files/save-as/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/home/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/message-media/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/models/enabled/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/models/refresh/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/models/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/models-config/raw/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/plugins/search/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/plugins/updates/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/project-assets/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/prompts/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/pty/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/archive/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/command-entry/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/info/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/lock/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/outline/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/state/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/stats/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/tool-results/[toolCallId]/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/sessions/search/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/settings/raw/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/settings/remote/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/skills/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/subagent-runs/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/update/apply/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/api/update/check/route-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/app/page-98dff9bf1228dd59.js +0 -24
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-adf1a35438d206bd.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-adf1a35438d206bd.js +0 -1
- /package/.next/static/{3APuisM7BhjGq0I4-df0W → aJFvPy5UYluh8Oa2DrTcW}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9742,a.ids=[9742],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10433:(a,b,c)=>{"use strict";c.d(b,{H7:()=>g,cS:()=>h});var d=c(89477),e=c(86697);let f="win32"===process.platform?"npm.cmd":"npm";function g(a=process.env,b=process.execPath){let c=a.npm_execpath?.trim();if(c&&(0,d.existsSync)(c))return c;let h=(0,e.join)((0,e.dirname)(b),f);return(0,d.existsSync)(h)?h:f}function h(a=process.env,b=g(a),c=process.execPath){let d=(0,e.dirname)(b===f?c:b);return{...a,PATH:`${d}${e.delimiter}${a.PATH??""}`}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear(),globalThis.__piModelRuntimeCache?.runtimes.clear()}function f(a,b){let c=d(),e=c.entries.get(a);if(e){if(e.expiresAt>Date.now())return Promise.resolve(e.data);c.entries.delete(a)}let f=c.inFlight.get(a);if(f)return f;let g=c.generation,h=Promise.resolve().then(b).then(b=>{if(c.generation===g&&c.inFlight.get(a)===h){let d=Date.now();for(let[a,b]of c.entries)b.expiresAt<=d&&c.entries.delete(a);for(;c.entries.size>=32;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(a,{data:b,expiresAt:d+6e4})}return b}).finally(()=>{c.inFlight.get(a)===h&&c.inFlight.delete(a)});return c.inFlight.set(a,h),h}c.d(b,{kn:()=>e,rC:()=>f})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},37418:a=>{"use strict";a.exports=require("node:util")},37827:(a,b,c)=>{"use strict";c.d(b,{SN:()=>q,TW:()=>r,_n:()=>k});var d=c(89477),e=c(62228),f=c(86697),g=c(73127),h=c(92395);let i=/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/;function j(){return{extensions:0,skills:0,prompts:0,themes:0}}function k(a){let b=a.trim(),c=b.match(i);return c?{name:c[1]??b,version:c[2]}:{name:b}}function l(a,b){if(b.isFile())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isFile()}catch{return!1}}function m(a,b){if(b.isDirectory())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isDirectory()}catch{return!1}}function n(a){try{return(0,d.readdirSync)(a,{withFileTypes:!0})}catch{return[]}}function o(a){return a.startsWith(".")||"node_modules"===a}function p(a,b,c){if((0,d.existsSync)(a))for(let d of n(a)){if(o(d.name))continue;let e=(0,f.join)(a,d.name);l(a,d)?b.test(d.name)&&c.push(e):m(a,d)&&p(e,b,c)}}function q(a){let b=[];for(let c of a.errors??[]){let a="string"==typeof c?.error&&c.error?c.error:"Extension failed to load.";b.push({type:"error",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}for(let c of a.warnings??[]){let a="string"==typeof c?.warning&&c.warning?c.warning:"Extension warning.";b.push({type:"warning",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}return b}function r(a){let b=(0,h.xH)({agentDir:a.agentDir,cwd:a.cwd}),c=[],i=j();return{packages:(function(a){let b=[],c=(c,h)=>{let i="string"==typeof c?c:c.source;b.push({source:i,scope:h,filtered:"object"==typeof c,install:function(a,b,c){let h,i=a.trim(),j=()=>"project"===b?(0,f.resolve)(c.cwd??"",".pi"):(0,f.resolve)(c.agentDir);if(i.startsWith("npm:")){let{name:a}=k(i.slice(4)),b=(0,f.join)(j(),"npm","node_modules",a);return{kind:"npm",installedPath:(0,d.existsSync)(b)?b:void 0}}if(!((h=i.trim()).startsWith("npm:")||h.startsWith("git:")||h.startsWith("github:")||h.startsWith("http:")||h.startsWith("https:")||h.startsWith("ssh:"))){let a=function(a,b){let c=a.trim();if(/^file:\/\//.test(c))try{c=(0,g.fileURLToPath)(c)}catch{}else{var d;c="~"===(d=c)?(0,e.homedir)():d.startsWith("~/")||"win32"===process.platform&&d.startsWith("~\\")?(0,f.join)((0,e.homedir)(),d.slice(2)):d}return(0,f.isAbsolute)(c)?(0,f.resolve)(c):(0,f.resolve)(b,c)}(i,j());return{kind:"local",installedPath:(0,d.existsSync)(a)?a:void 0}}let l=function(a){let b=a;if(b.startsWith("git:")&&(b=b.slice(4).trim()),b.startsWith("github:")){let a=b.slice(7).replace(/\.git$/,"").replace(/\/+$/,"");if(!a||!a.includes("/"))return;return{host:"github.com",path:a}}let c=b.indexOf("#");c>=0&&(b=b.slice(0,c));let d=b.match(/^git@([^:]+):(.+)$/);if(d)return{host:d[1],path:d[2].replace(/\.git$/,"").replace(/\/+$/,"")};let e=b.match(/^(?:https?|ssh|git):\/\/([^/]+)\/(.+)$/);if(e){let a=e[2].split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(!a)return;return{host:e[1],path:a}}let f=b.indexOf("/");if(f>0){let a=b.slice(0,f),c=b.slice(f+1).split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(c&&(a.includes(".")||"localhost"===a))return{host:a,path:c}}}(i);if(l){let a=(0,f.join)(j(),"git",l.host,l.path);return{kind:"git",installedPath:(0,d.existsSync)(a)?a:void 0}}return{kind:"git"}}(i,"project"===h?"project":"global",a)})};for(let b of(0,h.Ej)("global",{agentDir:a.agentDir}))c(b,"global");if(a.cwd)for(let b of(0,h.Ej)("project",{agentDir:a.agentDir,cwd:a.cwd}))c(b,"project");return b})(a).map(a=>{var e,g,h;let q=(e=a.source,g=a.scope,`${g}\0${e}`),r=b.get(q)??!1,s=j(),t=[];if(a.install.installedPath){let b,c,e,g,k,q,r,u=(h=a.install.installedPath,b=j(),c=[],e=(a,d)=>{let e="extension"===a?"extensions":"skill"===a?"skills":"prompt"===a?"prompts":"themes";for(let g of d)b[e]+=1,c.push({kind:a,name:function(a,b){let c=(0,f.basename)(a),d=(0,f.extname)(c);return"skill"===b&&"skill.md"===c.toLowerCase()?(0,f.basename)((0,f.dirname)(a)):("extension"===b||"theme"===b||"prompt"===b)&&d?"extension"===b&&/^index\.(ts|js)$/.test(c)?(0,f.basename)((0,f.dirname)(a)):c.slice(0,-d.length):c}(g,a),path:g,relativePath:function(a,b){let c=(0,f.relative)(b,a);return c&&!c.startsWith("..")?c:a}(g,h)})},!function a(b,c){if((0,d.existsSync)(b))for(let d of n(b)){if(o(d.name))continue;let e=(0,f.join)(b,d.name);l(b,d)?(d.name.endsWith(".ts")||d.name.endsWith(".js"))&&c.push(e):m(b,d)&&a(e,c)}}(h,g=[]),!function a(b,c,e){if(!(0,d.existsSync)(b))return;let g=n(b);for(let a of g)if("SKILL.md"===a.name&&l(b,a))return void e.push((0,f.join)(b,a.name));for(let d of g){if(o(d.name))continue;let g=(0,f.join)(b,d.name);l(b,d)&&b===c&&d.name.endsWith(".md")?e.push(g):m(b,d)&&a(g,c,e)}}(h,h,k=[]),p(h,/\.md$/,q=[]),p(h,/\.json$/,r=[]),e("extension",g),e("skill",k),e("prompt",q),e("theme",r),{counts:b,resources:c});for(let a of(s=u.counts,t=u.resources,["extensions","skills","prompts","themes"]))i[a]+=s[a]}else c.push({type:"warning",source:a.source,message:"Configured package path was not found."});let u=s.extensions+s.skills+s.prompts+s.themes,v=function(a){if(!a)return{};try{let b=(0,d.statSync)(a).isDirectory()?(0,f.join)(a,"package.json"):(0,f.join)((0,f.dirname)(a),"package.json");if(!(0,d.existsSync)(b))return{};let c=JSON.parse((0,d.readFileSync)(b,"utf8"));return{packageName:"string"==typeof c.name?c.name:void 0,version:"string"==typeof c.version?c.version:void 0}}catch{return{}}}(a.install.installedPath);return{source:a.source,scope:a.scope,filtered:a.filtered,disabled:r,installedPath:a.install.installedPath,packageName:v.packageName,version:v.version,configuredVersion:function(a){let b=a.trim();if(b.startsWith("npm:"))return k(b.slice(4)).version;if(b.startsWith("git:")||/^[a-z]+:\/\//.test(b)){let a=b.lastIndexOf("@");if(a>Math.max(b.lastIndexOf("/"),b.lastIndexOf(":")))return b.slice(a+1)||void 0}}(a.source),counts:s,resources:t,status:r?"disabled":u>0?"loaded":a.install.installedPath?"installed":"missing"}}),totals:i,diagnostics:c}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},60396:(a,b,c)=>{"use strict";c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64321:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>G,POST:()=>H,dynamic:()=>C});var d=c(23211),e=c(60396),f=c(92395),g=c(37827),h=c(70770),i=c(95398),j=c(89477),k=c(86697),l=c(37418),m=c(10433);class n extends Error{}let o=(0,l.promisify)(i.execFile),p={execFile:(a,b,c)=>o(a,b,c)};function q(a){let b=a.trim();if(!b.startsWith("npm:"))throw new n(`暂不支持的插件源(仅支持 npm:):${a}`);let c=b.slice(4).trim(),{name:d,version:e}=(0,g._n)(c);return{spec:c,name:d,version:e}}function r(a,b){return"project"===a?(0,k.join)((0,k.resolve)(b.cwd??""),".pi","npm"):(0,k.join)((0,k.resolve)(b.agentDir),"npm")}function s(a){(0,j.existsSync)(a)||(0,j.mkdirSync)(a,{recursive:!0});let b=(0,k.join)(a,"package.json");(0,j.existsSync)(b)||(0,j.writeFileSync)(b,JSON.stringify({name:"pi-extensions",private:!0},null,2),"utf8")}function t(a){return"string"==typeof a?a:a.source}function u(a){let b=a.trim();if(b.startsWith("npm:")){let{name:a}=(0,g._n)(b.slice(4).trim());return`npm:${a}`}return b}async function v(a,b,c){let d=(0,m.H7)();await a.execFile(d,b,{cwd:c,timeout:12e4,env:(0,m.cS)()})}async function w(a,b,c){let{spec:d}=q(a),e=c.runner??p,g=r(b,c);s(g),await v(e,["install",d,"--prefix",g,"--legacy-peer-deps"],g),function(a,b,c){let d=u(a),e=(0,f.Ej)(b,c),g=e.findIndex(a=>u(t(a))===d);if(-1!==g){let d=e[g];if(t(d)===a)return;let h=[...e];return h[g]="string"==typeof d?a:{...d,source:a},(0,f.Tj)(b,h,c)}(0,f.Tj)(b,[...e,a],c)}(a,b,c)}async function x(a,b,c){let d,e,g,{name:h}=q(a),i=c.runner??p,k=r(b,c);(0,j.existsSync)(k)&&await v(i,["uninstall",h,"--prefix",k,"--legacy-peer-deps"],k),d=u(a),(g=(e=(0,f.Ej)(b,c)).filter(a=>u(t(a))!==d)).length===e.length||(0,f.Tj)(b,g,c)}async function y(a,b,c){let{name:d}=q(a),e=function(a,b,c){let d=u(a);for(let a of(0,f.Ej)(b,c))if(u(t(a))===d)return t(a)}(a,b,c);if(!e)throw Error(`未在${"project"===b?"项目":"全局"}配置中找到匹配的插件包:${a}`);let h=c.runner??p,i=r(b,c);s(i);let j=e.startsWith("npm:")?e.slice(4).trim():"",k=(0,g._n)(j).version?j:`${d}@latest`;await v(h,["install",k,"--prefix",i,"--legacy-peer-deps"],i)}var z=c(78802),A=c(29096),B=c(28967);let C="force-dynamic";function D(a){return"project"===a?"project":"global"}function E(a,b,c,d){return(0,f.J7)(b,c,d,{agentDir:(0,e.$M)(),cwd:a})}async function F(a){let b=(0,g.TW)({agentDir:(0,e.$M)(),cwd:a});try{let c=await (0,h.aW)({cwd:a,agentDir:(0,e.$M)()});c.ok?b.diagnostics.push(...(0,g.SN)(c.value)):b.diagnostics.push({type:"error",message:c.error,source:"extensions"})}catch(a){b.diagnostics.push({type:"warning",message:String(a),source:"extensions"})}return b}async function G(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return d.NextResponse.json({error:"cwd required"},{status:400});try{return d.NextResponse.json(await F(c))}catch(a){return d.NextResponse.json({error:String(a)},{status:500})}}async function H(a){try{let b=await a.json();if(!b.cwd)return d.NextResponse.json({error:"cwd required"},{status:400});if(!b.action)return d.NextResponse.json({error:"action required"},{status:400});let c=b.source?.trim();if(D(b.scope),"install"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});await w(c,D(b.scope),{agentDir:(0,e.$M)(),cwd:b.cwd})}else if("remove"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});await x(c,D(b.scope),{agentDir:(0,e.$M)(),cwd:b.cwd})}else if("update"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});await y(c,D(b.scope),{agentDir:(0,e.$M)(),cwd:b.cwd})}else if("disable"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});E(b.cwd,c,D(b.scope),!0)}else{if("enable"!==b.action)return d.NextResponse.json({error:`Unsupported action: ${b.action}`},{status:400});if(!c)return d.NextResponse.json({error:"source required"},{status:400});E(b.cwd,c,D(b.scope),!1)}return(0,z.nd)(),(0,A.ng)(),(0,B.kn)(),d.NextResponse.json(await F(b.cwd))}catch(a){if(a instanceof n)return d.NextResponse.json({error:a.message},{status:400});return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},73127:a=>{"use strict";a.exports=require("node:url")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},78802:(a,b,c)=>{"use strict";c.d(b,{Uh:()=>j,nd:()=>i});var d=c(86697),e=c(70770);function f(a){return"object"!=typeof a||null===a||Array.isArray(a)?null:a}function g(a){return"string"==typeof a&&""!==a.trim()?a.trim():void 0}function h(a){let b=f(a)?.models;return Array.isArray(b)?b.filter(a=>null!==f(a)).length:0}function i(){let a=globalThis.__piPidanceExtensionProvidersCache;a&&(a.entries.clear(),a.inFlight.clear(),a.generation+=1),(0,e.Zd)()}async function j(a){let b=(0,d.resolve)(a.cwd),c=`${b}\0${a.agentDir?(0,d.resolve)(a.agentDir):""}`,i=(globalThis.__piPidanceExtensionProvidersCache||(globalThis.__piPidanceExtensionProvidersCache={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piPidanceExtensionProvidersCache);if(!a.bypassCache){let a=i.entries.get(c);if(a&&a.expiresAt>Date.now())return a.value;a&&i.entries.delete(c);let b=i.inFlight.get(c);if(b)return b}let j=(a.loaderFactory??function(a,b){return async()=>{let c=await (0,e.aW)({cwd:a,agentDir:b});if(!c.ok)throw Error(c.error);let d=c.value.runtime;return{configRegistrations:Array.isArray(d.pendingProviderRegistrations)?d.pendingProviderRegistrations:[],nativeProviders:Array.isArray(d.pendingNativeProviderRegistrations)?d.pendingNativeProviderRegistrations:[]}}})(b,a.agentDir),k=i.generation,l=Promise.resolve().then(j).then(a=>({providers:function(a){let b=[],c=new Set,d=a=>{!a||c.has(a.id)||(c.add(a.id),b.push(a))};for(let{provider:b,extensionPath:c}of a.nativeProviders??[]){let a=f(b),e=g(a?.id)??g(a?.name);e&&d({id:e,displayName:g(a?.name)??e,source:"extension",modelCount:h(a),...g(c)?{extensionPath:g(c)}:{}})}for(let{name:b,config:c,extensionPath:e}of a.configRegistrations??[]){let a=g(b);if(!a)continue;let i=f(c);d({id:a,displayName:g(i?.name)??a,source:"extension",modelCount:h(i),...g(e)?{extensionPath:g(e)}:{}})}return b.sort((a,b)=>a.displayName.localeCompare(b.displayName,void 0,{sensitivity:"base"})||a.id.localeCompare(b.id))}(a)})).catch(a=>({providers:[],error:a instanceof Error?a.message:String(a)})).then(b=>(a.bypassCache||i.generation!==k||i.entries.set(c,{value:b,expiresAt:Date.now()+3e4}),b)).finally(()=>{i.inFlight.get(c)===l&&i.inFlight.delete(c)});return a.bypassCache||i.inFlight.set(c,l),l}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{"use strict";a.exports=require("node:path")},89477:a=>{"use strict";a.exports=require("node:fs")},95398:a=>{"use strict";a.exports=require("node:child_process")},95440:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/plugins/route",pathname:"/api/plugins",filename:"route",bundlePath:"app/api/plugins/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/plugins/route.ts",nextConfigOutput:"",userland:()=>c(64321),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/plugins/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,9460],()=>b(b.s=95440));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9742,a.ids=[9742],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10433:(a,b,c)=>{"use strict";c.d(b,{H7:()=>g,cS:()=>h});var d=c(89477),e=c(86697);let f="win32"===process.platform?"npm.cmd":"npm";function g(a=process.env,b=process.execPath){let c=a.npm_execpath?.trim();if(c&&(0,d.existsSync)(c))return c;let h=(0,e.join)((0,e.dirname)(b),f);return(0,d.existsSync)(h)?h:f}function h(a=process.env,b=g(a),c=process.execPath){let d=(0,e.dirname)(b===f?c:b);return{...a,PATH:`${d}${e.delimiter}${a.PATH??""}`}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear(),globalThis.__piModelRuntimeCache?.runtimes.clear()}function f(a,b){let c=d(),e=c.entries.get(a);if(e){if(e.expiresAt>Date.now())return Promise.resolve(e.data);c.entries.delete(a)}let f=c.inFlight.get(a);if(f)return f;let g=c.generation,h=Promise.resolve().then(b).then(b=>{if(c.generation===g&&c.inFlight.get(a)===h){let d=Date.now();for(let[a,b]of c.entries)b.expiresAt<=d&&c.entries.delete(a);for(;c.entries.size>=32;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(a,{data:b,expiresAt:d+6e4})}return b}).finally(()=>{c.inFlight.get(a)===h&&c.inFlight.delete(a)});return c.inFlight.set(a,h),h}c.d(b,{kn:()=>e,rC:()=>f})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},37418:a=>{"use strict";a.exports=require("node:util")},37827:(a,b,c)=>{"use strict";c.d(b,{SN:()=>q,TW:()=>r,_n:()=>k});var d=c(89477),e=c(62228),f=c(86697),g=c(73127),h=c(92395);let i=/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/;function j(){return{extensions:0,skills:0,prompts:0,themes:0}}function k(a){let b=a.trim(),c=b.match(i);return c?{name:c[1]??b,version:c[2]}:{name:b}}function l(a,b){if(b.isFile())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isFile()}catch{return!1}}function m(a,b){if(b.isDirectory())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isDirectory()}catch{return!1}}function n(a){try{return(0,d.readdirSync)(a,{withFileTypes:!0})}catch{return[]}}function o(a){return a.startsWith(".")||"node_modules"===a}function p(a,b,c){if((0,d.existsSync)(a))for(let d of n(a)){if(o(d.name))continue;let e=(0,f.join)(a,d.name);l(a,d)?b.test(d.name)&&c.push(e):m(a,d)&&p(e,b,c)}}function q(a){let b=[];for(let c of a.errors??[]){let a="string"==typeof c?.error&&c.error?c.error:"Extension failed to load.";b.push({type:"error",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}for(let c of a.warnings??[]){let a="string"==typeof c?.warning&&c.warning?c.warning:"Extension warning.";b.push({type:"warning",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}return b}function r(a){let b=(0,h.xH)({agentDir:a.agentDir,cwd:a.cwd}),c=[],i=j();return{packages:(function(a){let b=[],c=(c,h)=>{let i="string"==typeof c?c:c.source;b.push({source:i,scope:h,filtered:"object"==typeof c,install:function(a,b,c){let h,i=a.trim(),j=()=>"project"===b?(0,f.resolve)(c.cwd??"",".pi"):(0,f.resolve)(c.agentDir);if(i.startsWith("npm:")){let{name:a}=k(i.slice(4)),b=(0,f.join)(j(),"npm","node_modules",a);return{kind:"npm",installedPath:(0,d.existsSync)(b)?b:void 0}}if(!((h=i.trim()).startsWith("npm:")||h.startsWith("git:")||h.startsWith("github:")||h.startsWith("http:")||h.startsWith("https:")||h.startsWith("ssh:"))){let a=function(a,b){let c=a.trim();if(/^file:\/\//.test(c))try{c=(0,g.fileURLToPath)(c)}catch{}else{var d;c="~"===(d=c)?(0,e.homedir)():d.startsWith("~/")||"win32"===process.platform&&d.startsWith("~\\")?(0,f.join)((0,e.homedir)(),d.slice(2)):d}return(0,f.isAbsolute)(c)?(0,f.resolve)(c):(0,f.resolve)(b,c)}(i,j());return{kind:"local",installedPath:(0,d.existsSync)(a)?a:void 0}}let l=function(a){let b=a;if(b.startsWith("git:")&&(b=b.slice(4).trim()),b.startsWith("github:")){let a=b.slice(7).replace(/\.git$/,"").replace(/\/+$/,"");if(!a||!a.includes("/"))return;return{host:"github.com",path:a}}let c=b.indexOf("#");c>=0&&(b=b.slice(0,c));let d=b.match(/^git@([^:]+):(.+)$/);if(d)return{host:d[1],path:d[2].replace(/\.git$/,"").replace(/\/+$/,"")};let e=b.match(/^(?:https?|ssh|git):\/\/([^/]+)\/(.+)$/);if(e){let a=e[2].split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(!a)return;return{host:e[1],path:a}}let f=b.indexOf("/");if(f>0){let a=b.slice(0,f),c=b.slice(f+1).split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(c&&(a.includes(".")||"localhost"===a))return{host:a,path:c}}}(i);if(l){let a=(0,f.join)(j(),"git",l.host,l.path);return{kind:"git",installedPath:(0,d.existsSync)(a)?a:void 0}}return{kind:"git"}}(i,"project"===h?"project":"global",a)})};for(let b of(0,h.Ej)("global",{agentDir:a.agentDir}))c(b,"global");if(a.cwd)for(let b of(0,h.Ej)("project",{agentDir:a.agentDir,cwd:a.cwd}))c(b,"project");return b})(a).map(a=>{var e,g,h;let q=(e=a.source,g=a.scope,`${g}\0${e}`),r=b.get(q)??!1,s=j(),t=[];if(a.install.installedPath){let b,c,e,g,k,q,r,u=(h=a.install.installedPath,b=j(),c=[],e=(a,d)=>{let e="extension"===a?"extensions":"skill"===a?"skills":"prompt"===a?"prompts":"themes";for(let g of d)b[e]+=1,c.push({kind:a,name:function(a,b){let c=(0,f.basename)(a),d=(0,f.extname)(c);return"skill"===b&&"skill.md"===c.toLowerCase()?(0,f.basename)((0,f.dirname)(a)):("extension"===b||"theme"===b||"prompt"===b)&&d?"extension"===b&&/^index\.(ts|js)$/.test(c)?(0,f.basename)((0,f.dirname)(a)):c.slice(0,-d.length):c}(g,a),path:g,relativePath:function(a,b){let c=(0,f.relative)(b,a);return c&&!c.startsWith("..")?c:a}(g,h)})},!function a(b,c){if((0,d.existsSync)(b))for(let d of n(b)){if(o(d.name))continue;let e=(0,f.join)(b,d.name);l(b,d)?(d.name.endsWith(".ts")||d.name.endsWith(".js"))&&c.push(e):m(b,d)&&a(e,c)}}(h,g=[]),!function a(b,c,e){if(!(0,d.existsSync)(b))return;let g=n(b);for(let a of g)if("SKILL.md"===a.name&&l(b,a))return void e.push((0,f.join)(b,a.name));for(let d of g){if(o(d.name))continue;let g=(0,f.join)(b,d.name);l(b,d)&&b===c&&d.name.endsWith(".md")?e.push(g):m(b,d)&&a(g,c,e)}}(h,h,k=[]),p(h,/\.md$/,q=[]),p(h,/\.json$/,r=[]),e("extension",g),e("skill",k),e("prompt",q),e("theme",r),{counts:b,resources:c});for(let a of(s=u.counts,t=u.resources,["extensions","skills","prompts","themes"]))i[a]+=s[a]}else c.push({type:"warning",source:a.source,message:"Configured package path was not found."});let u=s.extensions+s.skills+s.prompts+s.themes,v=function(a){if(!a)return{};try{let b=(0,d.statSync)(a).isDirectory()?(0,f.join)(a,"package.json"):(0,f.join)((0,f.dirname)(a),"package.json");if(!(0,d.existsSync)(b))return{};let c=JSON.parse((0,d.readFileSync)(b,"utf8"));return{packageName:"string"==typeof c.name?c.name:void 0,version:"string"==typeof c.version?c.version:void 0}}catch{return{}}}(a.install.installedPath);return{source:a.source,scope:a.scope,filtered:a.filtered,disabled:r,installedPath:a.install.installedPath,packageName:v.packageName,version:v.version,configuredVersion:function(a){let b=a.trim();if(b.startsWith("npm:"))return k(b.slice(4)).version;if(b.startsWith("git:")||/^[a-z]+:\/\//.test(b)){let a=b.lastIndexOf("@");if(a>Math.max(b.lastIndexOf("/"),b.lastIndexOf(":")))return b.slice(a+1)||void 0}}(a.source),counts:s,resources:t,status:r?"disabled":u>0?"loaded":a.install.installedPath?"installed":"missing"}}),totals:i,diagnostics:c}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},60396:(a,b,c)=>{"use strict";c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63368:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/plugins/route",pathname:"/api/plugins",filename:"route",bundlePath:"app/api/plugins/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/plugins/route.ts",nextConfigOutput:"",userland:()=>c(64321),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/plugins/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},64321:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>G,POST:()=>H,dynamic:()=>C});var d=c(23211),e=c(60396),f=c(92395),g=c(37827),h=c(70770),i=c(95398),j=c(89477),k=c(86697),l=c(37418),m=c(10433);class n extends Error{}let o=(0,l.promisify)(i.execFile),p={execFile:(a,b,c)=>o(a,b,c)};function q(a){let b=a.trim();if(!b.startsWith("npm:"))throw new n(`暂不支持的插件源(仅支持 npm:):${a}`);let c=b.slice(4).trim(),{name:d,version:e}=(0,g._n)(c);return{spec:c,name:d,version:e}}function r(a,b){return"project"===a?(0,k.join)((0,k.resolve)(b.cwd??""),".pi","npm"):(0,k.join)((0,k.resolve)(b.agentDir),"npm")}function s(a){(0,j.existsSync)(a)||(0,j.mkdirSync)(a,{recursive:!0});let b=(0,k.join)(a,"package.json");(0,j.existsSync)(b)||(0,j.writeFileSync)(b,JSON.stringify({name:"pi-extensions",private:!0},null,2),"utf8")}function t(a){return"string"==typeof a?a:a.source}function u(a){let b=a.trim();if(b.startsWith("npm:")){let{name:a}=(0,g._n)(b.slice(4).trim());return`npm:${a}`}return b}async function v(a,b,c){let d=(0,m.H7)();await a.execFile(d,b,{cwd:c,timeout:12e4,env:(0,m.cS)()})}async function w(a,b,c){let{spec:d}=q(a),e=c.runner??p,g=r(b,c);s(g),await v(e,["install",d,"--prefix",g,"--legacy-peer-deps"],g),function(a,b,c){let d=u(a),e=(0,f.Ej)(b,c),g=e.findIndex(a=>u(t(a))===d);if(-1!==g){let d=e[g];if(t(d)===a)return;let h=[...e];return h[g]="string"==typeof d?a:{...d,source:a},(0,f.Tj)(b,h,c)}(0,f.Tj)(b,[...e,a],c)}(a,b,c)}async function x(a,b,c){let d,e,g,{name:h}=q(a),i=c.runner??p,k=r(b,c);(0,j.existsSync)(k)&&await v(i,["uninstall",h,"--prefix",k,"--legacy-peer-deps"],k),d=u(a),(g=(e=(0,f.Ej)(b,c)).filter(a=>u(t(a))!==d)).length===e.length||(0,f.Tj)(b,g,c)}async function y(a,b,c){let{name:d}=q(a),e=function(a,b,c){let d=u(a);for(let a of(0,f.Ej)(b,c))if(u(t(a))===d)return t(a)}(a,b,c);if(!e)throw Error(`未在${"project"===b?"项目":"全局"}配置中找到匹配的插件包:${a}`);let h=c.runner??p,i=r(b,c);s(i);let j=e.startsWith("npm:")?e.slice(4).trim():"",k=(0,g._n)(j).version?j:`${d}@latest`;await v(h,["install",k,"--prefix",i,"--legacy-peer-deps"],i)}var z=c(78802),A=c(29096),B=c(28967);let C="force-dynamic";function D(a){return"project"===a?"project":"global"}function E(a,b,c,d){return(0,f.J7)(b,c,d,{agentDir:(0,e.$M)(),cwd:a})}async function F(a){let b=(0,g.TW)({agentDir:(0,e.$M)(),cwd:a});try{let c=await (0,h.aW)({cwd:a,agentDir:(0,e.$M)()});c.ok?b.diagnostics.push(...(0,g.SN)(c.value)):b.diagnostics.push({type:"error",message:c.error,source:"extensions"})}catch(a){b.diagnostics.push({type:"warning",message:String(a),source:"extensions"})}return b}async function G(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return d.NextResponse.json({error:"cwd required"},{status:400});try{return d.NextResponse.json(await F(c))}catch(a){return d.NextResponse.json({error:String(a)},{status:500})}}async function H(a){try{let b=await a.json();if(!b.cwd)return d.NextResponse.json({error:"cwd required"},{status:400});if(!b.action)return d.NextResponse.json({error:"action required"},{status:400});let c=b.source?.trim();if(D(b.scope),"install"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});await w(c,D(b.scope),{agentDir:(0,e.$M)(),cwd:b.cwd})}else if("remove"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});await x(c,D(b.scope),{agentDir:(0,e.$M)(),cwd:b.cwd})}else if("update"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});await y(c,D(b.scope),{agentDir:(0,e.$M)(),cwd:b.cwd})}else if("disable"===b.action){if(!c)return d.NextResponse.json({error:"source required"},{status:400});E(b.cwd,c,D(b.scope),!0)}else{if("enable"!==b.action)return d.NextResponse.json({error:`Unsupported action: ${b.action}`},{status:400});if(!c)return d.NextResponse.json({error:"source required"},{status:400});E(b.cwd,c,D(b.scope),!1)}return(0,z.nd)(),(0,A.ng)(),(0,B.kn)(),d.NextResponse.json(await F(b.cwd))}catch(a){if(a instanceof n)return d.NextResponse.json({error:a.message},{status:400});return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},73127:a=>{"use strict";a.exports=require("node:url")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},78802:(a,b,c)=>{"use strict";c.d(b,{Uh:()=>j,nd:()=>i});var d=c(86697),e=c(70770);function f(a){return"object"!=typeof a||null===a||Array.isArray(a)?null:a}function g(a){return"string"==typeof a&&""!==a.trim()?a.trim():void 0}function h(a){let b=f(a)?.models;return Array.isArray(b)?b.filter(a=>null!==f(a)).length:0}function i(){let a=globalThis.__piPidanceExtensionProvidersCache;a&&(a.entries.clear(),a.inFlight.clear(),a.generation+=1),(0,e.Zd)()}async function j(a){let b=(0,d.resolve)(a.cwd),c=`${b}\0${a.agentDir?(0,d.resolve)(a.agentDir):""}`,i=(globalThis.__piPidanceExtensionProvidersCache||(globalThis.__piPidanceExtensionProvidersCache={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piPidanceExtensionProvidersCache);if(!a.bypassCache){let a=i.entries.get(c);if(a&&a.expiresAt>Date.now())return a.value;a&&i.entries.delete(c);let b=i.inFlight.get(c);if(b)return b}let j=(a.loaderFactory??function(a,b){return async()=>{let c=await (0,e.aW)({cwd:a,agentDir:b});if(!c.ok)throw Error(c.error);let d=c.value.runtime;return{configRegistrations:Array.isArray(d.pendingProviderRegistrations)?d.pendingProviderRegistrations:[],nativeProviders:Array.isArray(d.pendingNativeProviderRegistrations)?d.pendingNativeProviderRegistrations:[]}}})(b,a.agentDir),k=i.generation,l=Promise.resolve().then(j).then(a=>({providers:function(a){let b=[],c=new Set,d=a=>{!a||c.has(a.id)||(c.add(a.id),b.push(a))};for(let{provider:b,extensionPath:c}of a.nativeProviders??[]){let a=f(b),e=g(a?.id)??g(a?.name);e&&d({id:e,displayName:g(a?.name)??e,source:"extension",modelCount:h(a),...g(c)?{extensionPath:g(c)}:{}})}for(let{name:b,config:c,extensionPath:e}of a.configRegistrations??[]){let a=g(b);if(!a)continue;let i=f(c);d({id:a,displayName:g(i?.name)??a,source:"extension",modelCount:h(i),...g(e)?{extensionPath:g(e)}:{}})}return b.sort((a,b)=>a.displayName.localeCompare(b.displayName,void 0,{sensitivity:"base"})||a.id.localeCompare(b.id))}(a)})).catch(a=>({providers:[],error:a instanceof Error?a.message:String(a)})).then(b=>(a.bypassCache||i.generation!==k||i.entries.set(c,{value:b,expiresAt:Date.now()+3e4}),b)).finally(()=>{i.inFlight.get(c)===l&&i.inFlight.delete(c)});return a.bypassCache||i.inFlight.set(c,l),l}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{"use strict";a.exports=require("node:path")},89477:a=>{"use strict";a.exports=require("node:fs")},95398:a=>{"use strict";a.exports=require("node:child_process")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,9460],()=>b(b.s=63368));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=4629,a.ids=[4629],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},24164:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>f,dynamic:()=>e});var d=c(23211);let e="force-dynamic";async function f(a){try{let b=await a.json().catch(()=>({})),c="string"==typeof b.query?b.query.trim():"";if(!c||c.length>100)return d.NextResponse.json({error:"query is required (max 100 chars)"},{status:400});let e=encodeURIComponent(c),f=await fetch(`https://registry.npmjs.org/-/v1/search?text=${e}&size=15`,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(15e3)});if(!f.ok)return d.NextResponse.json({error:`npm search failed: HTTP ${f.status}`},{status:502});let g=((await f.json()).objects??[]).map(a=>a.package).filter(a=>!!(a&&"string"==typeof a.name)).map(a=>({name:a.name,version:"string"==typeof a.version?a.version:"",description:"string"==typeof a.description?a.description:"",publisher:a.publisher&&"string"==typeof a.publisher.username?a.publisher.username:void 0}));return d.NextResponse.json({results:g})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},
|
|
1
|
+
(()=>{var a={};a.id=4629,a.ids=[4629],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},24164:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>f,dynamic:()=>e});var d=c(23211);let e="force-dynamic";async function f(a){try{let b=await a.json().catch(()=>({})),c="string"==typeof b.query?b.query.trim():"";if(!c||c.length>100)return d.NextResponse.json({error:"query is required (max 100 chars)"},{status:400});let e=encodeURIComponent(c),f=await fetch(`https://registry.npmjs.org/-/v1/search?text=${e}&size=15`,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(15e3)});if(!f.ok)return d.NextResponse.json({error:`npm search failed: HTTP ${f.status}`},{status:502});let g=((await f.json()).objects??[]).map(a=>a.package).filter(a=>!!(a&&"string"==typeof a.name)).map(a=>({name:a.name,version:"string"==typeof a.version?a.version:"",description:"string"==typeof a.description?a.description:"",publisher:a.publisher&&"string"==typeof a.publisher.username?a.publisher.username:void 0}));return d.NextResponse.json({results:g})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},37938:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/plugins/search/route",pathname:"/api/plugins/search",filename:"route",bundlePath:"app/api/plugins/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/plugins/search/route.ts",nextConfigOutput:"",userland:()=>c(24164),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/plugins/search/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=37938));module.exports=c})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6801,a.ids=[6801],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},26468:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>j,dynamic:()=>i});var d=c(23211),e=c(95398),f=c(37827);async function g(a,b,c){let d=Array(a.length),e=0,f=Array.from({length:Math.min(b,a.length)},async()=>{for(;e<a.length;){let b=e;e+=1,d[b]=await c(a[b])}});return await Promise.all(f),d}async function h(a){let b=a.filter(a=>a.source.trim().startsWith("npm:"));return[...await g(b,4,async({source:a,installed:b})=>{let c=(0,f._n)(a.slice(4)).name,d=c?function(a){try{let b=(0,e.execFileSync)("npm",["view",a,"version","--json","--no-update-notifier"],{encoding:"utf8",timeout:3e4,stdio:["ignore","pipe","ignore"]}).trim(),c=JSON.parse(b);return"string"==typeof c&&c?c:null}catch{return null}}(c):null,g=null!==d&&null!==b&&d!==b&&function(a,b){let c=a.split(".").map(a=>parseInt(a,10)||0),d=b.split(".").map(a=>parseInt(a,10)||0);for(let a=0;a<Math.max(c.length,d.length);a++){let b=(c[a]??0)-(d[a]??0);if(0!==b)return b}return 0}(d,b)>0;return{source:a,installed:b,latest:d,hasUpdate:g}}),...a.filter(a=>!a.source.trim().startsWith("npm:")).map(a=>({source:a.source,installed:a.installed,latest:null,hasUpdate:!1}))]}let i="force-dynamic";async function j(a){try{let b=await a.json().catch(()=>({}));if(!Array.isArray(b.packages)||b.packages.length>200)return d.NextResponse.json({error:"packages must be an array (max 200)"},{status:400});let c=b.packages.filter(a=>"string"==typeof a?.source&&a.source).map(a=>({source:a.source.trim(),installed:"string"==typeof a.installed&&a.installed?a.installed:null})),e=await h(c);return d.NextResponse.json({updates:e})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},37827:(a,b,c)=>{"use strict";c.d(b,{SN:()=>q,TW:()=>r,_n:()=>k});var d=c(89477),e=c(62228),f=c(86697),g=c(73127),h=c(92395);let i=/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/;function j(){return{extensions:0,skills:0,prompts:0,themes:0}}function k(a){let b=a.trim(),c=b.match(i);return c?{name:c[1]??b,version:c[2]}:{name:b}}function l(a,b){if(b.isFile())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isFile()}catch{return!1}}function m(a,b){if(b.isDirectory())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isDirectory()}catch{return!1}}function n(a){try{return(0,d.readdirSync)(a,{withFileTypes:!0})}catch{return[]}}function o(a){return a.startsWith(".")||"node_modules"===a}function p(a,b,c){if((0,d.existsSync)(a))for(let d of n(a)){if(o(d.name))continue;let e=(0,f.join)(a,d.name);l(a,d)?b.test(d.name)&&c.push(e):m(a,d)&&p(e,b,c)}}function q(a){let b=[];for(let c of a.errors??[]){let a="string"==typeof c?.error&&c.error?c.error:"Extension failed to load.";b.push({type:"error",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}for(let c of a.warnings??[]){let a="string"==typeof c?.warning&&c.warning?c.warning:"Extension warning.";b.push({type:"warning",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}return b}function r(a){let b=(0,h.xH)({agentDir:a.agentDir,cwd:a.cwd}),c=[],i=j();return{packages:(function(a){let b=[],c=(c,h)=>{let i="string"==typeof c?c:c.source;b.push({source:i,scope:h,filtered:"object"==typeof c,install:function(a,b,c){let h,i=a.trim(),j=()=>"project"===b?(0,f.resolve)(c.cwd??"",".pi"):(0,f.resolve)(c.agentDir);if(i.startsWith("npm:")){let{name:a}=k(i.slice(4)),b=(0,f.join)(j(),"npm","node_modules",a);return{kind:"npm",installedPath:(0,d.existsSync)(b)?b:void 0}}if(!((h=i.trim()).startsWith("npm:")||h.startsWith("git:")||h.startsWith("github:")||h.startsWith("http:")||h.startsWith("https:")||h.startsWith("ssh:"))){let a=function(a,b){let c=a.trim();if(/^file:\/\//.test(c))try{c=(0,g.fileURLToPath)(c)}catch{}else{var d;c="~"===(d=c)?(0,e.homedir)():d.startsWith("~/")||"win32"===process.platform&&d.startsWith("~\\")?(0,f.join)((0,e.homedir)(),d.slice(2)):d}return(0,f.isAbsolute)(c)?(0,f.resolve)(c):(0,f.resolve)(b,c)}(i,j());return{kind:"local",installedPath:(0,d.existsSync)(a)?a:void 0}}let l=function(a){let b=a;if(b.startsWith("git:")&&(b=b.slice(4).trim()),b.startsWith("github:")){let a=b.slice(7).replace(/\.git$/,"").replace(/\/+$/,"");if(!a||!a.includes("/"))return;return{host:"github.com",path:a}}let c=b.indexOf("#");c>=0&&(b=b.slice(0,c));let d=b.match(/^git@([^:]+):(.+)$/);if(d)return{host:d[1],path:d[2].replace(/\.git$/,"").replace(/\/+$/,"")};let e=b.match(/^(?:https?|ssh|git):\/\/([^/]+)\/(.+)$/);if(e){let a=e[2].split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(!a)return;return{host:e[1],path:a}}let f=b.indexOf("/");if(f>0){let a=b.slice(0,f),c=b.slice(f+1).split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(c&&(a.includes(".")||"localhost"===a))return{host:a,path:c}}}(i);if(l){let a=(0,f.join)(j(),"git",l.host,l.path);return{kind:"git",installedPath:(0,d.existsSync)(a)?a:void 0}}return{kind:"git"}}(i,"project"===h?"project":"global",a)})};for(let b of(0,h.Ej)("global",{agentDir:a.agentDir}))c(b,"global");if(a.cwd)for(let b of(0,h.Ej)("project",{agentDir:a.agentDir,cwd:a.cwd}))c(b,"project");return b})(a).map(a=>{var e,g,h;let q=(e=a.source,g=a.scope,`${g}\0${e}`),r=b.get(q)??!1,s=j(),t=[];if(a.install.installedPath){let b,c,e,g,k,q,r,u=(h=a.install.installedPath,b=j(),c=[],e=(a,d)=>{let e="extension"===a?"extensions":"skill"===a?"skills":"prompt"===a?"prompts":"themes";for(let g of d)b[e]+=1,c.push({kind:a,name:function(a,b){let c=(0,f.basename)(a),d=(0,f.extname)(c);return"skill"===b&&"skill.md"===c.toLowerCase()?(0,f.basename)((0,f.dirname)(a)):("extension"===b||"theme"===b||"prompt"===b)&&d?"extension"===b&&/^index\.(ts|js)$/.test(c)?(0,f.basename)((0,f.dirname)(a)):c.slice(0,-d.length):c}(g,a),path:g,relativePath:function(a,b){let c=(0,f.relative)(b,a);return c&&!c.startsWith("..")?c:a}(g,h)})},!function a(b,c){if((0,d.existsSync)(b))for(let d of n(b)){if(o(d.name))continue;let e=(0,f.join)(b,d.name);l(b,d)?(d.name.endsWith(".ts")||d.name.endsWith(".js"))&&c.push(e):m(b,d)&&a(e,c)}}(h,g=[]),!function a(b,c,e){if(!(0,d.existsSync)(b))return;let g=n(b);for(let a of g)if("SKILL.md"===a.name&&l(b,a))return void e.push((0,f.join)(b,a.name));for(let d of g){if(o(d.name))continue;let g=(0,f.join)(b,d.name);l(b,d)&&b===c&&d.name.endsWith(".md")?e.push(g):m(b,d)&&a(g,c,e)}}(h,h,k=[]),p(h,/\.md$/,q=[]),p(h,/\.json$/,r=[]),e("extension",g),e("skill",k),e("prompt",q),e("theme",r),{counts:b,resources:c});for(let a of(s=u.counts,t=u.resources,["extensions","skills","prompts","themes"]))i[a]+=s[a]}else c.push({type:"warning",source:a.source,message:"Configured package path was not found."});let u=s.extensions+s.skills+s.prompts+s.themes,v=function(a){if(!a)return{};try{let b=(0,d.statSync)(a).isDirectory()?(0,f.join)(a,"package.json"):(0,f.join)((0,f.dirname)(a),"package.json");if(!(0,d.existsSync)(b))return{};let c=JSON.parse((0,d.readFileSync)(b,"utf8"));return{packageName:"string"==typeof c.name?c.name:void 0,version:"string"==typeof c.version?c.version:void 0}}catch{return{}}}(a.install.installedPath);return{source:a.source,scope:a.scope,filtered:a.filtered,disabled:r,installedPath:a.install.installedPath,packageName:v.packageName,version:v.version,configuredVersion:function(a){let b=a.trim();if(b.startsWith("npm:"))return k(b.slice(4)).version;if(b.startsWith("git:")||/^[a-z]+:\/\//.test(b)){let a=b.lastIndexOf("@");if(a>Math.max(b.lastIndexOf("/"),b.lastIndexOf(":")))return b.slice(a+1)||void 0}}(a.source),counts:s,resources:t,status:r?"disabled":u>0?"loaded":a.install.installedPath?"installed":"missing"}}),totals:i,diagnostics:c}}},40420:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/plugins/updates/route",pathname:"/api/plugins/updates",filename:"route",bundlePath:"app/api/plugins/updates/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/plugins/updates/route.ts",nextConfigOutput:"",userland:()=>c(26468),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/plugins/updates/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},60396:(a,b,c)=>{"use strict";c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73127:a=>{"use strict";a.exports=require("node:url")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{"use strict";a.exports=require("node:path")},89477:a=>{"use strict";a.exports=require("node:fs")},92395:(a,b,c)=>{"use strict";c.d(b,{Ej:()=>q,FN:()=>j,J7:()=>s,Tj:()=>r,oK:()=>g,oT:()=>m,wq:()=>i,xH:()=>t});var d=c(89477),e=c(86697),f=c(60396);function g(a){return(0,e.join)((0,e.resolve)(a),".pi","settings.json")}function h(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function i(a){if(!(0,d.existsSync)(a))return{};try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return h(b)?{...b}:{}}catch{return{}}}function j(a,b){let c=(0,e.dirname)(a);(0,d.mkdirSync)(c,{recursive:!0});let f=`${a}.${process.pid}.${Date.now()}.tmp`,g=`${JSON.stringify(b,null,2)}
|
|
2
|
-
`;try{(0,d.writeFileSync)(f,g,{flag:"wx",mode:384}),(0,d.renameSync)(f,a)}catch(a){try{(0,d.unlinkSync)(f)}catch{}throw a}}function k(a){return"string"==typeof a&&a.length>0?a:void 0}function l(a,b){return"all"===a||"one-at-a-time"===a?a:b}class m{constructor(a={}){this.dirty=!1;const b=a.agentDir??(0,f.$M)();this.globalPath=(0,e.join)((0,e.resolve)(b),"settings.json"),this.global=i(this.globalPath)}static create(a,b){return new m({agentDir:b})}view(){return this.global}getDefaultProvider(){return k(this.view().defaultProvider)}getDefaultModel(){return k(this.view().defaultModel)}getDefaultThinkingLevel(){return k(this.view().defaultThinkingLevel)}getSteeringMode(){return l(this.view().steeringMode,"one-at-a-time")}getFollowUpMode(){return l(this.view().followUpMode,"one-at-a-time")}getCompactionSettings(){let a=h(this.view().compaction)?this.view().compaction:{};return{enabled:"boolean"!=typeof a.enabled||a.enabled,reserveTokens:"number"==typeof a.reserveTokens?a.reserveTokens:16384,keepRecentTokens:"number"==typeof a.keepRecentTokens?a.keepRecentTokens:2e4}}getRetrySettings(){let a=h(this.view().retry)?this.view().retry:{};return{enabled:"boolean"!=typeof a.enabled||a.enabled,maxRetries:"number"==typeof a.maxRetries?a.maxRetries:3,baseDelayMs:"number"==typeof a.baseDelayMs?a.baseDelayMs:2e3}}getPackages(){return this.global.packages}setDefaultProvider(a){this.global.defaultProvider=a,this.dirty=!0}setDefaultModel(a){this.global.defaultModel=a,this.dirty=!0}setDefaultModelAndProvider(a,b){this.global.defaultProvider=a,this.global.defaultModel=b,this.dirty=!0}setDefaultThinkingLevel(a){this.global.defaultThinkingLevel=a,this.dirty=!0}setSteeringMode(a){this.global.steeringMode=a,this.dirty=!0}setFollowUpMode(a){this.global.followUpMode=a,this.dirty=!0}setCompactionEnabled(a){let b=h(this.global.compaction)?{...this.global.compaction}:{};b.enabled=a,this.global.compaction=b,this.dirty=!0}setRetryEnabled(a){let b=h(this.global.retry)?{...this.global.retry}:{};b.enabled=a,this.global.retry=b,this.dirty=!0}setPackages(a){this.global.packages=a,this.dirty=!0}async flush(){this.dirty&&(j(this.globalPath,this.global),this.dirty=!1)}flushSync(){this.dirty&&(j(this.globalPath,this.global),this.dirty=!1)}}function n(a){return Array.isArray(a)?a:[]}function o(a){return"string"==typeof a?a:a.source}function p(a){return"string"!=typeof a&&Array.isArray(a.extensions)&&0===a.extensions.length&&Array.isArray(a.skills)&&0===a.skills.length&&Array.isArray(a.prompts)&&0===a.prompts.length&&Array.isArray(a.themes)&&0===a.themes.length}function q(a,b={}){return"global"===a?n(i(b.agentDir?(0,e.join)((0,e.resolve)(b.agentDir),"settings.json"):(0,f.pA)()).packages):b.cwd?n(i(g(b.cwd)).packages):[]}function r(a,b,c={}){if("global"===a){let a=c.agentDir?(0,e.join)((0,e.resolve)(c.agentDir),"settings.json"):(0,f.pA)(),d=i(a);d.packages=b,j(a,d);return}if(!c.cwd)throw Error("project packages 需要 cwd");let d=g(c.cwd),h=i(d);h.packages=b,j(d,h)}function s(a,b,c,d={}){let e=q(b,d),f=!1,g=e.map(b=>o(b)!==a?b:(f=!0,c)?{..."string"==typeof b?{source:b}:b,extensions:[],skills:[],prompts:[],themes:[]}:o(b));return!!f&&(r(b,g,d),!0)}function t(a){let b=new Map;for(let c of q("global",a))b.set(`global\0${o(c)}`,p(c));if(a.cwd)for(let c of q("project",a))b.set(`project\0${o(c)}`,p(c));return b}},95398:a=>{
|
|
1
|
+
"use strict";(()=>{var a={};a.id=6801,a.ids=[6801],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},26468:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>j});var d=c(23211),e=c(31974),f=c(37827);async function g(a,b=(0,e.dz)(),c=globalThis.fetch.bind(globalThis)){try{let d,e,f=await c((d=b.endsWith("/")?b:`${b}/`,e=a.startsWith("@")?a.replace("/","%2F"):a,new URL(`${e}/latest`,d).toString()),{headers:{Accept:"application/json"},signal:AbortSignal.timeout(12e3)});if(!f.ok)return null;let g=await f.json();return"string"==typeof g.version&&g.version.trim()?g.version.trim():null}catch{return null}}async function h(a,b,c){let d=Array(a.length),e=0,f=Array.from({length:Math.min(b,a.length)},async()=>{for(;e<a.length;){let b=e;e+=1,d[b]=await c(a[b])}});return await Promise.all(f),d}async function i(a,b={}){let c=b.registry??(0,e.dz)(),d=b.fetchImpl??globalThis.fetch.bind(globalThis),j=a.filter(a=>a.source.trim().startsWith("npm:"));return[...await h(j,4,async({source:a,installed:b})=>{let e=(0,f._n)(a.slice(4)).name,h=e?await g(e,c,d):null,i=null!==h&&null!==b&&h!==b&&function(a,b){let c=a.split(".").map(a=>parseInt(a,10)||0),d=b.split(".").map(a=>parseInt(a,10)||0);for(let a=0;a<Math.max(c.length,d.length);a++){let b=(c[a]??0)-(d[a]??0);if(0!==b)return b}return 0}(h,b)>0;return{source:a,installed:b,latest:h,hasUpdate:i}}),...a.filter(a=>!a.source.trim().startsWith("npm:")).map(a=>({source:a.source,installed:a.installed,latest:null,hasUpdate:!1}))]}let j="force-dynamic";async function k(a){try{let b=await a.json().catch(()=>({}));if(!Array.isArray(b.packages)||b.packages.length>200)return d.NextResponse.json({error:"packages must be an array (max 200)"},{status:400});let c=b.packages.filter(a=>"string"==typeof a?.source&&a.source).map(a=>({source:a.source.trim(),installed:"string"==typeof a.installed&&a.installed?a.installed:null})),e=await i(c);return d.NextResponse.json({updates:e})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},28788:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/plugins/updates/route",pathname:"/api/plugins/updates",filename:"route",bundlePath:"app/api/plugins/updates/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/plugins/updates/route.ts",nextConfigOutput:"",userland:()=>c(26468),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/plugins/updates/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},37418:a=>{a.exports=require("node:util")},37827:(a,b,c)=>{c.d(b,{SN:()=>q,TW:()=>r,_n:()=>k});var d=c(89477),e=c(62228),f=c(86697),g=c(73127),h=c(92395);let i=/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/;function j(){return{extensions:0,skills:0,prompts:0,themes:0}}function k(a){let b=a.trim(),c=b.match(i);return c?{name:c[1]??b,version:c[2]}:{name:b}}function l(a,b){if(b.isFile())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isFile()}catch{return!1}}function m(a,b){if(b.isDirectory())return!0;if(!b.isSymbolicLink())return!1;try{return(0,d.statSync)((0,f.join)(a,b.name)).isDirectory()}catch{return!1}}function n(a){try{return(0,d.readdirSync)(a,{withFileTypes:!0})}catch{return[]}}function o(a){return a.startsWith(".")||"node_modules"===a}function p(a,b,c){if((0,d.existsSync)(a))for(let d of n(a)){if(o(d.name))continue;let e=(0,f.join)(a,d.name);l(a,d)?b.test(d.name)&&c.push(e):m(a,d)&&p(e,b,c)}}function q(a){let b=[];for(let c of a.errors??[]){let a="string"==typeof c?.error&&c.error?c.error:"Extension failed to load.";b.push({type:"error",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}for(let c of a.warnings??[]){let a="string"==typeof c?.warning&&c.warning?c.warning:"Extension warning.";b.push({type:"warning",message:a,source:"extensions",...c?.path?{path:c.path}:{}})}return b}function r(a){let b=(0,h.xH)({agentDir:a.agentDir,cwd:a.cwd}),c=[],i=j();return{packages:(function(a){let b=[],c=(c,h)=>{let i="string"==typeof c?c:c.source;b.push({source:i,scope:h,filtered:"object"==typeof c,install:function(a,b,c){let h,i=a.trim(),j=()=>"project"===b?(0,f.resolve)(c.cwd??"",".pi"):(0,f.resolve)(c.agentDir);if(i.startsWith("npm:")){let{name:a}=k(i.slice(4)),b=(0,f.join)(j(),"npm","node_modules",a);return{kind:"npm",installedPath:(0,d.existsSync)(b)?b:void 0}}if(!((h=i.trim()).startsWith("npm:")||h.startsWith("git:")||h.startsWith("github:")||h.startsWith("http:")||h.startsWith("https:")||h.startsWith("ssh:"))){let a=function(a,b){let c=a.trim();if(/^file:\/\//.test(c))try{c=(0,g.fileURLToPath)(c)}catch{}else{var d;c="~"===(d=c)?(0,e.homedir)():d.startsWith("~/")||"win32"===process.platform&&d.startsWith("~\\")?(0,f.join)((0,e.homedir)(),d.slice(2)):d}return(0,f.isAbsolute)(c)?(0,f.resolve)(c):(0,f.resolve)(b,c)}(i,j());return{kind:"local",installedPath:(0,d.existsSync)(a)?a:void 0}}let l=function(a){let b=a;if(b.startsWith("git:")&&(b=b.slice(4).trim()),b.startsWith("github:")){let a=b.slice(7).replace(/\.git$/,"").replace(/\/+$/,"");if(!a||!a.includes("/"))return;return{host:"github.com",path:a}}let c=b.indexOf("#");c>=0&&(b=b.slice(0,c));let d=b.match(/^git@([^:]+):(.+)$/);if(d)return{host:d[1],path:d[2].replace(/\.git$/,"").replace(/\/+$/,"")};let e=b.match(/^(?:https?|ssh|git):\/\/([^/]+)\/(.+)$/);if(e){let a=e[2].split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(!a)return;return{host:e[1],path:a}}let f=b.indexOf("/");if(f>0){let a=b.slice(0,f),c=b.slice(f+1).split("@")[0].replace(/\.git$/,"").replace(/\/+$/,"");if(c&&(a.includes(".")||"localhost"===a))return{host:a,path:c}}}(i);if(l){let a=(0,f.join)(j(),"git",l.host,l.path);return{kind:"git",installedPath:(0,d.existsSync)(a)?a:void 0}}return{kind:"git"}}(i,"project"===h?"project":"global",a)})};for(let b of(0,h.Ej)("global",{agentDir:a.agentDir}))c(b,"global");if(a.cwd)for(let b of(0,h.Ej)("project",{agentDir:a.agentDir,cwd:a.cwd}))c(b,"project");return b})(a).map(a=>{var e,g,h;let q=(e=a.source,g=a.scope,`${g}\0${e}`),r=b.get(q)??!1,s=j(),t=[];if(a.install.installedPath){let b,c,e,g,k,q,r,u=(h=a.install.installedPath,b=j(),c=[],e=(a,d)=>{let e="extension"===a?"extensions":"skill"===a?"skills":"prompt"===a?"prompts":"themes";for(let g of d)b[e]+=1,c.push({kind:a,name:function(a,b){let c=(0,f.basename)(a),d=(0,f.extname)(c);return"skill"===b&&"skill.md"===c.toLowerCase()?(0,f.basename)((0,f.dirname)(a)):("extension"===b||"theme"===b||"prompt"===b)&&d?"extension"===b&&/^index\.(ts|js)$/.test(c)?(0,f.basename)((0,f.dirname)(a)):c.slice(0,-d.length):c}(g,a),path:g,relativePath:function(a,b){let c=(0,f.relative)(b,a);return c&&!c.startsWith("..")?c:a}(g,h)})},!function a(b,c){if((0,d.existsSync)(b))for(let d of n(b)){if(o(d.name))continue;let e=(0,f.join)(b,d.name);l(b,d)?(d.name.endsWith(".ts")||d.name.endsWith(".js"))&&c.push(e):m(b,d)&&a(e,c)}}(h,g=[]),!function a(b,c,e){if(!(0,d.existsSync)(b))return;let g=n(b);for(let a of g)if("SKILL.md"===a.name&&l(b,a))return void e.push((0,f.join)(b,a.name));for(let d of g){if(o(d.name))continue;let g=(0,f.join)(b,d.name);l(b,d)&&b===c&&d.name.endsWith(".md")?e.push(g):m(b,d)&&a(g,c,e)}}(h,h,k=[]),p(h,/\.md$/,q=[]),p(h,/\.json$/,r=[]),e("extension",g),e("skill",k),e("prompt",q),e("theme",r),{counts:b,resources:c});for(let a of(s=u.counts,t=u.resources,["extensions","skills","prompts","themes"]))i[a]+=s[a]}else c.push({type:"warning",source:a.source,message:"Configured package path was not found."});let u=s.extensions+s.skills+s.prompts+s.themes,v=function(a){if(!a)return{};try{let b=(0,d.statSync)(a).isDirectory()?(0,f.join)(a,"package.json"):(0,f.join)((0,f.dirname)(a),"package.json");if(!(0,d.existsSync)(b))return{};let c=JSON.parse((0,d.readFileSync)(b,"utf8"));return{packageName:"string"==typeof c.name?c.name:void 0,version:"string"==typeof c.version?c.version:void 0}}catch{return{}}}(a.install.installedPath);return{source:a.source,scope:a.scope,filtered:a.filtered,disabled:r,installedPath:a.install.installedPath,packageName:v.packageName,version:v.version,configuredVersion:function(a){let b=a.trim();if(b.startsWith("npm:"))return k(b.slice(4)).version;if(b.startsWith("git:")||/^[a-z]+:\/\//.test(b)){let a=b.lastIndexOf("@");if(a>Math.max(b.lastIndexOf("/"),b.lastIndexOf(":")))return b.slice(a+1)||void 0}}(a.source),counts:s,resources:t,status:r?"disabled":u>0?"loaded":a.install.installedPath?"installed":"missing"}}),totals:i,diagnostics:c}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},60396:(a,b,c)=>{c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{a.exports=require("node:os")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73127:a=>{a.exports=require("node:url")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{a.exports=require("node:path")},89477:a=>{a.exports=require("node:fs")},92395:(a,b,c)=>{c.d(b,{Ej:()=>q,FN:()=>j,J7:()=>s,Tj:()=>r,oK:()=>g,oT:()=>m,wq:()=>i,xH:()=>t});var d=c(89477),e=c(86697),f=c(60396);function g(a){return(0,e.join)((0,e.resolve)(a),".pi","settings.json")}function h(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function i(a){if(!(0,d.existsSync)(a))return{};try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return h(b)?{...b}:{}}catch{return{}}}function j(a,b){let c=(0,e.dirname)(a);(0,d.mkdirSync)(c,{recursive:!0});let f=`${a}.${process.pid}.${Date.now()}.tmp`,g=`${JSON.stringify(b,null,2)}
|
|
2
|
+
`;try{(0,d.writeFileSync)(f,g,{flag:"wx",mode:384}),(0,d.renameSync)(f,a)}catch(a){try{(0,d.unlinkSync)(f)}catch{}throw a}}function k(a){return"string"==typeof a&&a.length>0?a:void 0}function l(a,b){return"all"===a||"one-at-a-time"===a?a:b}class m{constructor(a={}){this.dirty=!1;const b=a.agentDir??(0,f.$M)();this.globalPath=(0,e.join)((0,e.resolve)(b),"settings.json"),this.global=i(this.globalPath)}static create(a,b){return new m({agentDir:b})}view(){return this.global}getDefaultProvider(){return k(this.view().defaultProvider)}getDefaultModel(){return k(this.view().defaultModel)}getDefaultThinkingLevel(){return k(this.view().defaultThinkingLevel)}getSteeringMode(){return l(this.view().steeringMode,"one-at-a-time")}getFollowUpMode(){return l(this.view().followUpMode,"one-at-a-time")}getCompactionSettings(){let a=h(this.view().compaction)?this.view().compaction:{};return{enabled:"boolean"!=typeof a.enabled||a.enabled,reserveTokens:"number"==typeof a.reserveTokens?a.reserveTokens:16384,keepRecentTokens:"number"==typeof a.keepRecentTokens?a.keepRecentTokens:2e4}}getRetrySettings(){let a=h(this.view().retry)?this.view().retry:{};return{enabled:"boolean"!=typeof a.enabled||a.enabled,maxRetries:"number"==typeof a.maxRetries?a.maxRetries:3,baseDelayMs:"number"==typeof a.baseDelayMs?a.baseDelayMs:2e3}}getPackages(){return this.global.packages}setDefaultProvider(a){this.global.defaultProvider=a,this.dirty=!0}setDefaultModel(a){this.global.defaultModel=a,this.dirty=!0}setDefaultModelAndProvider(a,b){this.global.defaultProvider=a,this.global.defaultModel=b,this.dirty=!0}setDefaultThinkingLevel(a){this.global.defaultThinkingLevel=a,this.dirty=!0}setSteeringMode(a){this.global.steeringMode=a,this.dirty=!0}setFollowUpMode(a){this.global.followUpMode=a,this.dirty=!0}setCompactionEnabled(a){let b=h(this.global.compaction)?{...this.global.compaction}:{};b.enabled=a,this.global.compaction=b,this.dirty=!0}setRetryEnabled(a){let b=h(this.global.retry)?{...this.global.retry}:{};b.enabled=a,this.global.retry=b,this.dirty=!0}setPackages(a){this.global.packages=a,this.dirty=!0}async flush(){this.dirty&&(j(this.globalPath,this.global),this.dirty=!1)}flushSync(){this.dirty&&(j(this.globalPath,this.global),this.dirty=!1)}}function n(a){return Array.isArray(a)?a:[]}function o(a){return"string"==typeof a?a:a.source}function p(a){return"string"!=typeof a&&Array.isArray(a.extensions)&&0===a.extensions.length&&Array.isArray(a.skills)&&0===a.skills.length&&Array.isArray(a.prompts)&&0===a.prompts.length&&Array.isArray(a.themes)&&0===a.themes.length}function q(a,b={}){return"global"===a?n(i(b.agentDir?(0,e.join)((0,e.resolve)(b.agentDir),"settings.json"):(0,f.pA)()).packages):b.cwd?n(i(g(b.cwd)).packages):[]}function r(a,b,c={}){if("global"===a){let a=c.agentDir?(0,e.join)((0,e.resolve)(c.agentDir),"settings.json"):(0,f.pA)(),d=i(a);d.packages=b,j(a,d);return}if(!c.cwd)throw Error("project packages 需要 cwd");let d=g(c.cwd),h=i(d);h.packages=b,j(d,h)}function s(a,b,c,d={}){let e=q(b,d),f=!1,g=e.map(b=>o(b)!==a?b:(f=!0,c)?{..."string"==typeof b?{source:b}:b,extensions:[],skills:[],prompts:[],themes:[]}:o(b));return!!f&&(r(b,g,d),!0)}function t(a){let b=new Map;for(let c of q("global",a))b.set(`global\0${o(c)}`,p(c));if(a.cwd)for(let c of q("project",a))b.set(`project\0${o(c)}`,p(c));return b}},95398:a=>{a.exports=require("node:child_process")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5274],()=>b(b.s=28788));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9560,a.ids=[9560],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},41979:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,PUT:()=>m,dynamic:()=>n});var e=c(23211),f=c(68524),g=c(75052),h=c(63726),i=c(72498),j=c(55687),k=a([i]);i=(k.then?(await k)():k)[0];let n="force-dynamic";async function l(){try{let a=(0,h.Z)();return e.NextResponse.json({prefs:(0,f.rV)(),revision:a.revision(),bootId:a.bootId()},{headers:{"Cache-Control":"no-store"}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function m(a){try{let b=await a.json().catch(()=>({}));if(Array.isArray(b.ops)){let a=b.ops.filter(a=>!!a&&"object"==typeof a&&"string"==typeof a.key&&"string"==typeof a.op&&(0,g.F)(a));if(0===a.length)return e.NextResponse.json({error:"ops 里没有受支持的命令"},{status:400});let c=(0,f.rV)(),d=(0,f.fN)(a),k=(0,f.rV)();if(0===Object.keys(d).length)return e.NextResponse.json({ok:!0,revision:(0,h.Z)().revision(),changed:{}});(0,i.zc)(c,k),(0,j.NG)(k);let l=(0,h.Z)().publish(d);return e.NextResponse.json({ok:!0,revision:l.revision,changed:d})}let c=b.prefs;if("object"!=typeof c||null===c||Array.isArray(c))return e.NextResponse.json({error:"prefs must be a JSON object"},{status:400});let d=JSON.stringify(c);if(Buffer.byteLength(d,"utf8")>1e6)return e.NextResponse.json({error:"preferences exceed 1000000 bytes"},{status:413});let{patch:k,dropped:l}=(0,f.Nj)(c);l.length>0&&console.warn(`[pidance] ignored host-owned queue preferences from client: ${l.join(", ")}`);let m=(0,f.rV)(),n=(0,f.Gc)(k),o=(0,f.rV)(),p=(0,h.Z)();if(0===Object.keys(n).length)return e.NextResponse.json({ok:!0,revision:p.revision(),changed:{}});(0,i.zc)(m,o),(0,j.NG)(o);let q=p.publish(n);return e.NextResponse.json({ok:!0,revision:q.revision,changed:n})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},57828:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/preferences/route",pathname:"/api/preferences",filename:"route",bundlePath:"app/api/preferences/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/preferences/route.ts",nextConfigOutput:"",userland:()=>c(41979),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/preferences/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},60396:(a,b,c)=>{"use strict";c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72498:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{zc:()=>n});var e=c(89477),f=c(86697),g=c(75430),h=c(60396),i=a([g]);function j(a,b){let c,d=(0,f.join)(b,"trust.json");if(!(0,e.existsSync)(d))return!1;try{let a=JSON.parse((0,e.readFileSync)(d,"utf8"));if("object"!=typeof a||null===a||Array.isArray(a))return!1;c=a}catch{return!1}let g=a;try{g=(0,e.realpathSync)(a)}catch{}return!0===c[g]||!0===c[a]}function k(a){return"object"!=typeof a||null===a||Array.isArray(a)?{}:a}function l(a,b){let c=k(a.sidebarUi);return function(a){if(!Array.isArray(a))return[];let b=[],c=new Set;for(let d of a){if("string"!=typeof d)continue;let a=d.trim();!a||c.has(a)||(c.add(a),b.push(a))}return b}(void 0!==c[b]?c[b]:a[b])}function m(a){return"string"==typeof a&&a.trim().length>0}function n(a,b,c=(0,h.$M)()){var d=c;try{let c=(()=>{let c,d,e;return c=new Set(l(k(a),"projectRoots")),d=l(k(b),"projectRoots"),e=new Set(d),{trust:d,revoke:[...c].filter(a=>!e.has(a))}})();if(0===c.trust.length&&0===c.revoke.length)return{trusted:0,revoked:0,failed:[]};return function(a,b=(0,h.$M)()){let c={trusted:0,revoked:0,failed:[]};for(let d of a.trust)if(m(d))try{(function(a,b=(0,h.$M)()){return!(!m(a)||j(a,b))&&(new g.ProjectTrustStore(b).set(a,!0),!0)})(d,b)&&(c.trusted+=1)}catch(a){c.failed.push(d),console.warn(`[pidance] failed to trust project ${d}: ${a instanceof Error?a.message:String(a)}`)}for(let d of a.revoke)if(m(d))try{(function(a,b=(0,h.$M)()){return!!m(a)&&!!j(a,b)&&(new g.ProjectTrustStore(b).set(a,null),!0)})(d,b)&&(c.revoked+=1)}catch(a){c.failed.push(d),console.warn(`[pidance] failed to revoke project trust ${d}: ${a instanceof Error?a.message:String(a)}`)}return c}(c,d)}catch(a){return console.warn(`[pidance] project trust sync failed: ${a instanceof Error?a.message:String(a)}`),{trusted:0,revoked:0,failed:[]}}}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{"use strict";a.exports=require("node:path")},89477:a=>{"use strict";a.exports=require("node:fs")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,9032],()=>b(b.s=57828));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9560,a.ids=[9560],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},41979:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,PUT:()=>m,dynamic:()=>n});var e=c(23211),f=c(68524),g=c(75052),h=c(63726),i=c(72498),j=c(55687),k=a([i]);i=(k.then?(await k)():k)[0];let n="force-dynamic";async function l(){try{let a=(0,h.Z)();return e.NextResponse.json({prefs:(0,f.rV)(),revision:a.revision(),bootId:a.bootId()},{headers:{"Cache-Control":"no-store"}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function m(a){try{let b=await a.json().catch(()=>({}));if(Array.isArray(b.ops)){let a=b.ops.filter(a=>!!a&&"object"==typeof a&&"string"==typeof a.key&&"string"==typeof a.op&&(0,g.F)(a));if(0===a.length)return e.NextResponse.json({error:"ops 里没有受支持的命令"},{status:400});let c=(0,f.rV)(),d=(0,f.fN)(a),k=(0,f.rV)();if(0===Object.keys(d).length)return e.NextResponse.json({ok:!0,revision:(0,h.Z)().revision(),changed:{}});(0,i.zc)(c,k),(0,j.NG)(k);let l=(0,h.Z)().publish(d);return e.NextResponse.json({ok:!0,revision:l.revision,changed:d})}let c=b.prefs;if("object"!=typeof c||null===c||Array.isArray(c))return e.NextResponse.json({error:"prefs must be a JSON object"},{status:400});let d=JSON.stringify(c);if(Buffer.byteLength(d,"utf8")>1e6)return e.NextResponse.json({error:"preferences exceed 1000000 bytes"},{status:413});let{patch:k,dropped:l}=(0,f.Nj)(c);l.length>0&&console.warn(`[pidance] ignored host-owned queue preferences from client: ${l.join(", ")}`);let m=(0,f.rV)(),n=(0,f.Gc)(k),o=(0,f.rV)(),p=(0,h.Z)();if(0===Object.keys(n).length)return e.NextResponse.json({ok:!0,revision:p.revision(),changed:{}});(0,i.zc)(m,o),(0,j.NG)(o);let q=p.publish(n);return e.NextResponse.json({ok:!0,revision:q.revision,changed:n})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},56020:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/preferences/route",pathname:"/api/preferences",filename:"route",bundlePath:"app/api/preferences/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/preferences/route.ts",nextConfigOutput:"",userland:()=>c(41979),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/preferences/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},60396:(a,b,c)=>{"use strict";c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72498:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{zc:()=>n});var e=c(89477),f=c(86697),g=c(75430),h=c(60396),i=a([g]);function j(a,b){let c,d=(0,f.join)(b,"trust.json");if(!(0,e.existsSync)(d))return!1;try{let a=JSON.parse((0,e.readFileSync)(d,"utf8"));if("object"!=typeof a||null===a||Array.isArray(a))return!1;c=a}catch{return!1}let g=a;try{g=(0,e.realpathSync)(a)}catch{}return!0===c[g]||!0===c[a]}function k(a){return"object"!=typeof a||null===a||Array.isArray(a)?{}:a}function l(a,b){let c=k(a.sidebarUi);return function(a){if(!Array.isArray(a))return[];let b=[],c=new Set;for(let d of a){if("string"!=typeof d)continue;let a=d.trim();!a||c.has(a)||(c.add(a),b.push(a))}return b}(void 0!==c[b]?c[b]:a[b])}function m(a){return"string"==typeof a&&a.trim().length>0}function n(a,b,c=(0,h.$M)()){var d=c;try{let c=(()=>{let c,d,e;return c=new Set(l(k(a),"projectRoots")),d=l(k(b),"projectRoots"),e=new Set(d),{trust:d,revoke:[...c].filter(a=>!e.has(a))}})();if(0===c.trust.length&&0===c.revoke.length)return{trusted:0,revoked:0,failed:[]};return function(a,b=(0,h.$M)()){let c={trusted:0,revoked:0,failed:[]};for(let d of a.trust)if(m(d))try{(function(a,b=(0,h.$M)()){return!(!m(a)||j(a,b))&&(new g.ProjectTrustStore(b).set(a,!0),!0)})(d,b)&&(c.trusted+=1)}catch(a){c.failed.push(d),console.warn(`[pidance] failed to trust project ${d}: ${a instanceof Error?a.message:String(a)}`)}for(let d of a.revoke)if(m(d))try{(function(a,b=(0,h.$M)()){return!!m(a)&&!!j(a,b)&&(new g.ProjectTrustStore(b).set(a,null),!0)})(d,b)&&(c.revoked+=1)}catch(a){c.failed.push(d),console.warn(`[pidance] failed to revoke project trust ${d}: ${a instanceof Error?a.message:String(a)}`)}return c}(c,d)}catch(a){return console.warn(`[pidance] project trust sync failed: ${a instanceof Error?a.message:String(a)}`),{trusted:0,revoked:0,failed:[]}}}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{"use strict";a.exports=require("node:path")},89477:a=>{"use strict";a.exports=require("node:fs")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,9032],()=>b(b.s=56020));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=4133,a.ids=[4133],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},716:a=>{a.exports=require("node:crypto")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},6230:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/project-assets/route",pathname:"/api/project-assets",filename:"route",bundlePath:"app/api/project-assets/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/project-assets/route.ts",nextConfigOutput:"",userland:()=>c(89516),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/project-assets/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},25252:(a,b,c)=>{c.d(b,{HM:()=>e,wz:()=>f});var d=c(50593);function e(){return globalThis.__piAdditionalAllowedRoots||(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots}function f(a){if(!a)return;let b=(0,d.Nw)(a);e().add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}},27910:a=>{a.exports=require("stream")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50593:(a,b,c)=>{function d(a){try{return decodeURIComponent(a)}catch{return a}}function e(a){return a.replace(/\\/g,"/")}c.d(b,{Nw:()=>e,ex:()=>d})},55511:a=>{a.exports=require("crypto")},62228:a=>{a.exports=require("node:os")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},69835:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$t:()=>w,Gt:()=>z,Lj:()=>y,Md:()=>x,eq:()=>n,fb:()=>u,fm:()=>v,ki:()=>r,qo:()=>m,uF:()=>o,vy:()=>t,xd:()=>q});var e=c(29021),f=c(33873),g=c(55511),h=c(27910),i=c(77725),j=c(60396),k=c(80547),l=a([k]);k=(l.then?(await l)():l)[0];let x=0x1900000,y=0x6400000,z=0x20000000;function m(a=(0,j.$M)()){return(0,k.Nw)((0,f.join)(a,"pidance-attachments"))}function n(a=(0,j.$M)()){let b=m(a);return(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0,mode:448}),(0,k.wz)(b),b}function o(a){let b=(a.replace(/\\/g,"/").split("/").pop()??"file").replace(/\0/g,"").replace(/^\.+/,"").trim()||"file";if(b.length<=180)return b;let c=b.lastIndexOf(".");if(c>0&&b.length-c<=20){let a=b.slice(c);return b.slice(0,180-a.length)+a}return b.slice(0,180)}function p(a,b=Date.now()){let c=o(a),d=new Date(b).toISOString().replace(/[:.]/g,"-"),e=(0,g.randomUUID)().slice(0,8);return`${d}_${e}_${c}`}async function q(a,b,c=(0,j.$M)(),d=z){let l=n(c),m=p(a),r=(0,f.join)(l,m),s=(0,f.join)(l,`.${m}.${(0,g.randomUUID)()}.tmp`),t=0,u=new h.Transform({transform(a,b,c){let e=Buffer.isBuffer(a)?a:Buffer.from(a);(t+=e.length)>d?c(Error(`message media exceeds ${d} bytes`)):c(null,e)}});try{await (0,i.pipeline)(h.Readable.fromWeb(b),u,(0,e.createWriteStream)(s,{flags:"wx",mode:384})),(0,e.renameSync)(s,r)}catch(a){try{(0,e.unlinkSync)(s)}catch{}throw a}return{path:(0,k.Nw)(r),name:o(a),storedName:m,size:t}}function r(a,b,c=(0,j.$M)()){let d=n(c),g=p(a),h=(0,f.join)(d,g);return(0,e.writeFileSync)(h,b,{flag:"wx",mode:384}),{path:(0,k.Nw)(h),name:o(a),storedName:g,size:b.length}}function s(a,b,c){let d=a.trim();if(!d)return null;try{let a=(0,k.Nw)((0,e.realpathSync)(n(b))),f=(0,k.Nw)((0,e.realpathSync)(d));if(f!==a&&!f.startsWith(`${a}/`)||!(0,e.statSync)(f).isFile())return null;return c(f)}catch{return null}}function t(a,b=(0,j.$M)()){return s(a,b,a=>(0,e.statSync)(a).size)}function u(a,b=(0,j.$M)(),c=0x1900000){return s(a,b,a=>(0,e.statSync)(a).size>c?null:(0,e.readFileSync)(a).toString("base64"))}function v(a,b=(0,j.$M)()){return s(a,b,a=>{try{return(0,e.unlinkSync)(a),!0}catch{return!1}})??!1}function w(a=(0,j.$M)()){let b=[];return function a(b,c){for(let d of(()=>{try{return(0,e.readdirSync)(b,{withFileTypes:!0})}catch{return[]}})()){let g=(0,f.join)(b,d.name);if(d.isDirectory()){a(g,c);continue}if(d.isFile())try{let a=(0,e.statSync)(g);c.push({path:(0,k.Nw)(g),size:a.size,mtimeMs:a.mtimeMs})}catch{}}}(m(a),b),b}d()}catch(a){d(a)}})},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},77725:a=>{a.exports=require("stream/promises")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>r,Nw:()=>j.Nw,bk:()=>q,mc:()=>p,uK:()=>o,wz:()=>k.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(60396),j=c(50593),k=c(25252),l=c(69835),m=c(40402),n=a([l,m]);[l,m]=n.then?(await n)():n;let s=/^[a-zA-Z]:[\\/]/;function o(a){return s.test(a)||a.startsWith("\\\\")||a.startsWith("//")}async function p(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,m.dQ)(),d=function(a){let b=new Set;for(let c of a)!0!==c.readOnly&&c.cwd&&b.add((0,j.Nw)(c.cwd)),!0!==c.readOnly&&c.projectRoot&&b.add((0,j.Nw)(c.projectRoot));return b}(c);try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^pi-cwd-\d{8}$/.test(a)&&d.add((0,j.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,k.HM)())d.add(a);try{d.add((0,l.qo)((0,i.$M)()))}catch{}return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function q(){return!0}function r(a,b){return!0}d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{a.exports=require("node:path")},89477:a=>{a.exports=require("node:fs")},89516:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,POST:()=>n,dynamic:()=>o});var e=c(23211),f=c(89477),g=c(86697),h=c(80547),i=a([h]);h=(i.then?(await i)():i)[0];let o="force-dynamic",p=/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/;function j(a){return(0,g.join)((0,g.resolve)(a),".agents","skills")}async function k(a){if("string"!=typeof a||!a)return"cwd is required";let b=await (0,h.mc)();return(0,h.A$)(a,b)?null:"cwd is not in allowed roots"}function l(a){try{return(0,f.readFileSync)(a,"utf8")}catch{return""}}async function m(a){try{let b=new URL(a.url).searchParams.get("cwd")??"",c=await k(b);if(c)return e.NextResponse.json({error:c},{status:403});let d=(0,g.join)((0,g.resolve)(b),"AGENTS.md"),h=(0,f.existsSync)(d)?l(d):"",i=function(a){let b,c=j(a);if(!(0,f.existsSync)(c))return[];try{b=(0,f.readdirSync)(c)}catch{return[]}let d=[];for(let a of b){let b=(0,g.join)(c,a);try{if(!(0,f.statSync)(b).isDirectory())continue}catch{continue}let e=(0,g.join)(b,"SKILL.md");if(!(0,f.existsSync)(e))continue;let h=l(e);d.push({name:a,enabled:!/^\s*disable-model-invocation:\s*true\s*$/m.test(h),content:h})}return d.sort((a,b)=>a.name.localeCompare(b.name))}(b);return e.NextResponse.json({rulesPath:d,rulesExists:(0,f.existsSync)(d),rulesContent:h,skills:i},{headers:{"Cache-Control":"no-store"}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function n(a){try{let b=await a.json().catch(()=>({})),c="string"==typeof b.cwd?b.cwd:"",d=await k(c);if(d)return e.NextResponse.json({error:d},{status:403});let h=b.kind;if("rules"===h){let a=b.content;if("string"!=typeof a)return e.NextResponse.json({error:"content must be a string"},{status:400});if(Buffer.byteLength(a,"utf8")>524288)return e.NextResponse.json({error:"content too large"},{status:413});let d=(0,g.join)((0,g.resolve)(c),"AGENTS.md");(0,f.mkdirSync)((0,g.dirname)(d),{recursive:!0});let h=`${d}.${process.pid}.${Date.now()}.tmp`;try{(0,f.writeFileSync)(h,a,{flag:"wx",mode:420}),(0,f.renameSync)(h,d)}catch(a){try{(0,f.unlinkSync)(h)}catch{}throw a}return e.NextResponse.json({ok:!0})}if("skill"===h){let a,d,h=b.action,i="string"==typeof b.name?b.name.trim():"";if(!i||!p.test(i))return e.NextResponse.json({error:"invalid skill name"},{status:400});let k=(0,g.join)(j(c),i),m=(0,g.join)(k,"SKILL.md");if(a=(0,g.resolve)(c),d=(0,g.relative)(a,(0,g.resolve)(m)),""===d||d.startsWith("..")||(0,g.resolve)(m).startsWith(`${a}${g.sep}`))return e.NextResponse.json({error:"skill path escapes project"},{status:403});if("create"===h){if((0,f.existsSync)(m))return e.NextResponse.json({error:"skill already exists"},{status:409});(0,f.mkdirSync)(k,{recursive:!0});let a=`---
|
|
1
|
+
"use strict";(()=>{var a={};a.id=4133,a.ids=[4133],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},716:a=>{a.exports=require("node:crypto")},1126:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/project-assets/route",pathname:"/api/project-assets",filename:"route",bundlePath:"app/api/project-assets/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/project-assets/route.ts",nextConfigOutput:"",userland:()=>c(89516),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/project-assets/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},25252:(a,b,c)=>{c.d(b,{HM:()=>e,wz:()=>f});var d=c(50593);function e(){return globalThis.__piAdditionalAllowedRoots||(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots}function f(a){if(!a)return;let b=(0,d.Nw)(a);e().add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}},27910:a=>{a.exports=require("stream")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50593:(a,b,c)=>{function d(a){try{return decodeURIComponent(a)}catch{return a}}function e(a){return a.replace(/\\/g,"/")}c.d(b,{Nw:()=>e,ex:()=>d})},55511:a=>{a.exports=require("crypto")},62228:a=>{a.exports=require("node:os")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},69835:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$t:()=>w,Gt:()=>z,Lj:()=>y,Md:()=>x,eq:()=>n,fb:()=>u,fm:()=>v,ki:()=>r,qo:()=>m,uF:()=>o,vy:()=>t,xd:()=>q});var e=c(29021),f=c(33873),g=c(55511),h=c(27910),i=c(77725),j=c(60396),k=c(80547),l=a([k]);k=(l.then?(await l)():l)[0];let x=0x1900000,y=0x6400000,z=0x20000000;function m(a=(0,j.$M)()){return(0,k.Nw)((0,f.join)(a,"pidance-attachments"))}function n(a=(0,j.$M)()){let b=m(a);return(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0,mode:448}),(0,k.wz)(b),b}function o(a){let b=(a.replace(/\\/g,"/").split("/").pop()??"file").replace(/\0/g,"").replace(/^\.+/,"").trim()||"file";if(b.length<=180)return b;let c=b.lastIndexOf(".");if(c>0&&b.length-c<=20){let a=b.slice(c);return b.slice(0,180-a.length)+a}return b.slice(0,180)}function p(a,b=Date.now()){let c=o(a),d=new Date(b).toISOString().replace(/[:.]/g,"-"),e=(0,g.randomUUID)().slice(0,8);return`${d}_${e}_${c}`}async function q(a,b,c=(0,j.$M)(),d=z){let l=n(c),m=p(a),r=(0,f.join)(l,m),s=(0,f.join)(l,`.${m}.${(0,g.randomUUID)()}.tmp`),t=0,u=new h.Transform({transform(a,b,c){let e=Buffer.isBuffer(a)?a:Buffer.from(a);(t+=e.length)>d?c(Error(`message media exceeds ${d} bytes`)):c(null,e)}});try{await (0,i.pipeline)(h.Readable.fromWeb(b),u,(0,e.createWriteStream)(s,{flags:"wx",mode:384})),(0,e.renameSync)(s,r)}catch(a){try{(0,e.unlinkSync)(s)}catch{}throw a}return{path:(0,k.Nw)(r),name:o(a),storedName:m,size:t}}function r(a,b,c=(0,j.$M)()){let d=n(c),g=p(a),h=(0,f.join)(d,g);return(0,e.writeFileSync)(h,b,{flag:"wx",mode:384}),{path:(0,k.Nw)(h),name:o(a),storedName:g,size:b.length}}function s(a,b,c){let d=a.trim();if(!d)return null;try{let a=(0,k.Nw)((0,e.realpathSync)(n(b))),f=(0,k.Nw)((0,e.realpathSync)(d));if(f!==a&&!f.startsWith(`${a}/`)||!(0,e.statSync)(f).isFile())return null;return c(f)}catch{return null}}function t(a,b=(0,j.$M)()){return s(a,b,a=>(0,e.statSync)(a).size)}function u(a,b=(0,j.$M)(),c=0x1900000){return s(a,b,a=>(0,e.statSync)(a).size>c?null:(0,e.readFileSync)(a).toString("base64"))}function v(a,b=(0,j.$M)()){return s(a,b,a=>{try{return(0,e.unlinkSync)(a),!0}catch{return!1}})??!1}function w(a=(0,j.$M)()){let b=[];return function a(b,c){for(let d of(()=>{try{return(0,e.readdirSync)(b,{withFileTypes:!0})}catch{return[]}})()){let g=(0,f.join)(b,d.name);if(d.isDirectory()){a(g,c);continue}if(d.isFile())try{let a=(0,e.statSync)(g);c.push({path:(0,k.Nw)(g),size:a.size,mtimeMs:a.mtimeMs})}catch{}}}(m(a),b),b}d()}catch(a){d(a)}})},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},77725:a=>{a.exports=require("stream/promises")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>r,Nw:()=>j.Nw,bk:()=>q,mc:()=>p,uK:()=>o,wz:()=>k.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(60396),j=c(50593),k=c(25252),l=c(69835),m=c(40402),n=a([l,m]);[l,m]=n.then?(await n)():n;let s=/^[a-zA-Z]:[\\/]/;function o(a){return s.test(a)||a.startsWith("\\\\")||a.startsWith("//")}async function p(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,m.dQ)(),d=function(a){let b=new Set;for(let c of a)!0!==c.readOnly&&c.cwd&&b.add((0,j.Nw)(c.cwd)),!0!==c.readOnly&&c.projectRoot&&b.add((0,j.Nw)(c.projectRoot));return b}(c);try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^pi-cwd-\d{8}$/.test(a)&&d.add((0,j.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,k.HM)())d.add(a);try{d.add((0,l.qo)((0,i.$M)()))}catch{}return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function q(){return!0}function r(a,b){return!0}d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{a.exports=require("node:path")},89477:a=>{a.exports=require("node:fs")},89516:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,POST:()=>n,dynamic:()=>o});var e=c(23211),f=c(89477),g=c(86697),h=c(80547),i=a([h]);h=(i.then?(await i)():i)[0];let o="force-dynamic",p=/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/;function j(a){return(0,g.join)((0,g.resolve)(a),".agents","skills")}async function k(a){if("string"!=typeof a||!a)return"cwd is required";let b=await (0,h.mc)();return(0,h.A$)(a,b)?null:"cwd is not in allowed roots"}function l(a){try{return(0,f.readFileSync)(a,"utf8")}catch{return""}}async function m(a){try{let b=new URL(a.url).searchParams.get("cwd")??"",c=await k(b);if(c)return e.NextResponse.json({error:c},{status:403});let d=(0,g.join)((0,g.resolve)(b),"AGENTS.md"),h=(0,f.existsSync)(d)?l(d):"",i=function(a){let b,c=j(a);if(!(0,f.existsSync)(c))return[];try{b=(0,f.readdirSync)(c)}catch{return[]}let d=[];for(let a of b){let b=(0,g.join)(c,a);try{if(!(0,f.statSync)(b).isDirectory())continue}catch{continue}let e=(0,g.join)(b,"SKILL.md");if(!(0,f.existsSync)(e))continue;let h=l(e);d.push({name:a,enabled:!/^\s*disable-model-invocation:\s*true\s*$/m.test(h),content:h})}return d.sort((a,b)=>a.name.localeCompare(b.name))}(b);return e.NextResponse.json({rulesPath:d,rulesExists:(0,f.existsSync)(d),rulesContent:h,skills:i},{headers:{"Cache-Control":"no-store"}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function n(a){try{let b=await a.json().catch(()=>({})),c="string"==typeof b.cwd?b.cwd:"",d=await k(c);if(d)return e.NextResponse.json({error:d},{status:403});let h=b.kind;if("rules"===h){let a=b.content;if("string"!=typeof a)return e.NextResponse.json({error:"content must be a string"},{status:400});if(Buffer.byteLength(a,"utf8")>524288)return e.NextResponse.json({error:"content too large"},{status:413});let d=(0,g.join)((0,g.resolve)(c),"AGENTS.md");(0,f.mkdirSync)((0,g.dirname)(d),{recursive:!0});let h=`${d}.${process.pid}.${Date.now()}.tmp`;try{(0,f.writeFileSync)(h,a,{flag:"wx",mode:420}),(0,f.renameSync)(h,d)}catch(a){try{(0,f.unlinkSync)(h)}catch{}throw a}return e.NextResponse.json({ok:!0})}if("skill"===h){let a,d,h=b.action,i="string"==typeof b.name?b.name.trim():"";if(!i||!p.test(i))return e.NextResponse.json({error:"invalid skill name"},{status:400});let k=(0,g.join)(j(c),i),m=(0,g.join)(k,"SKILL.md");if(a=(0,g.resolve)(c),d=(0,g.relative)(a,(0,g.resolve)(m)),""===d||d.startsWith("..")||(0,g.resolve)(m).startsWith(`${a}${g.sep}`))return e.NextResponse.json({error:"skill path escapes project"},{status:403});if("create"===h){if((0,f.existsSync)(m))return e.NextResponse.json({error:"skill already exists"},{status:409});(0,f.mkdirSync)(k,{recursive:!0});let a=`---
|
|
2
2
|
name: ${i}
|
|
3
3
|
description: ${i} skill
|
|
4
4
|
---
|
|
@@ -10,4 +10,4 @@ description: ${i} skill
|
|
|
10
10
|
disable-model-invocation: true
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
${c}`;let d=`${m}.${process.pid}.${Date.now()}.tmp`;try{(0,f.writeFileSync)(d,c,{flag:"wx",mode:420}),(0,f.renameSync)(d,m)}catch(a){try{(0,f.unlinkSync)(d)}catch{}throw a}return e.NextResponse.json({ok:!0})}if("delete"===h){if(!(0,f.existsSync)(m))return e.NextResponse.json({error:"skill not found"},{status:404});(0,f.unlinkSync)(m);try{(0,f.readdirSync)(k),function(a){try{0===(0,f.readdirSync)(a).length&&(0,f.rmdirSync)(a)}catch{}}(k)}catch{}return e.NextResponse.json({ok:!0})}return e.NextResponse.json({error:"unknown skill action"},{status:400})}return e.NextResponse.json({error:"kind must be rules | skill"},{status:400})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582],()=>b(b.s=
|
|
13
|
+
${c}`;let d=`${m}.${process.pid}.${Date.now()}.tmp`;try{(0,f.writeFileSync)(d,c,{flag:"wx",mode:420}),(0,f.renameSync)(d,m)}catch(a){try{(0,f.unlinkSync)(d)}catch{}throw a}return e.NextResponse.json({ok:!0})}if("delete"===h){if(!(0,f.existsSync)(m))return e.NextResponse.json({error:"skill not found"},{status:404});(0,f.unlinkSync)(m);try{(0,f.readdirSync)(k),function(a){try{0===(0,f.readdirSync)(a).length&&(0,f.rmdirSync)(a)}catch{}}(k)}catch{}return e.NextResponse.json({ok:!0})}return e.NextResponse.json({error:"unknown skill action"},{status:400})}return e.NextResponse.json({error:"kind must be rules | skill"},{status:400})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582],()=>b(b.s=1126));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=4459,a.ids=[4459],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},60396:(a,b,c)=>{"use strict";c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},81497:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>l,PUT:()=>m,dynamic:()=>i});var d=c(23211),e=c(89477),f=c(86697),g=c(60396);let h={system:"SYSTEM.md",systemAppend:"APPEND_SYSTEM.md",agents:"AGENTS.md"},i="force-dynamic";function j(){return(0,f.join)((0,g.$M)(),"pidance-prompt-drafts.json")}function k(){let a=j();if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if("object"==typeof b&&null!==b&&!Array.isArray(b))return b}catch{}return{}}async function l(){try{let a=(0,g.$M)(),b=k(),c=Object.keys(h).map(c=>{let d=(0,f.join)(a,h[c]),g=(0,e.existsSync)(d),i=g?(()=>{try{return(0,e.readFileSync)(d,"utf8")}catch{return b[c]??""}})():b[c]??"";return{key:c,enabled:g,content:i}});return d.NextResponse.json({entries:c},{headers:{"Cache-Control":"no-store"}})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function m(a){try{var b;let c=await a.json().catch(()=>({}));if(b=c.key,"string"!=typeof b||"system"!==b&&"systemAppend"!==b&&"agents"!==b)return d.NextResponse.json({error:"key must be system | systemAppend | agents"},{status:400});if(void 0!==c.enabled&&"boolean"!=typeof c.enabled)return d.NextResponse.json({error:"enabled must be a boolean"},{status:400});if(void 0!==c.content&&"string"!=typeof c.content)return d.NextResponse.json({error:"content must be a string"},{status:400});if(c.content&&Buffer.byteLength(c.content,"utf8")>524288)return d.NextResponse.json({error:"content exceeds 524288 bytes"},{status:413});let i=c.key,l=(0,g.$M)(),m=(0,f.join)(l,h[i]),n=k(),o=c.enabled??(0,e.existsSync)(m);void 0!==c.content&&(c.content?n[i]=c.content:delete n[i]);let p=j(),q=(0,f.dirname)(p);(0,e.existsSync)(q)||(0,e.mkdirSync)(q,{recursive:!0,mode:448});let r=`${p}.${process.pid}.${Date.now()}.tmp`;try{(0,e.writeFileSync)(r,JSON.stringify(n,null,2),{flag:"wx",mode:384}),(0,e.renameSync)(r,p)}catch(a){try{(0,e.unlinkSync)(r)}catch{}throw a}if(o){let a=c.content??n[i];null!=a?((0,e.mkdirSync)((0,f.dirname)(m),{recursive:!0}),(0,e.writeFileSync)(m,a,"utf8")):(0,e.existsSync)(m)||(0,e.writeFileSync)(m,"","utf8")}else(0,e.existsSync)(m)&&(0,e.unlinkSync)(m);return d.NextResponse.json({ok:!0})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{"use strict";a.exports=require("node:path")},89477:a=>{"use strict";a.exports=require("node:fs")},95368:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/prompts/route",pathname:"/api/prompts",filename:"route",bundlePath:"app/api/prompts/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/prompts/route.ts",nextConfigOutput:"",userland:()=>c(81497),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/prompts/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=95368));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=4459,a.ids=[4459],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45440:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/prompts/route",pathname:"/api/prompts",filename:"route",bundlePath:"app/api/prompts/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/prompts/route.ts",nextConfigOutput:"",userland:()=>c(81497),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/prompts/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},60396:(a,b,c)=>{"use strict";c.d(b,{$M:()=>g,CZ:()=>i,Mc:()=>h,Xr:()=>f,pA:()=>j});var d=c(62228),e=c(86697);function f(a,b=(0,d.homedir)()){return"~"===a?b:a.startsWith("~/")||a.startsWith("~\\")?(0,e.join)(b,a.slice(2)):a}function g(a=process.env){let b=a.PI_CODING_AGENT_DIR?.trim();return b?f(b):(0,e.join)((0,d.homedir)(),".pi","agent")}function h(a=process.env){return(0,e.join)(g(a),"models.json")}function i(a=process.env){return(0,e.join)(g(a),"auth.json")}function j(a=process.env){return(0,e.join)(g(a),"settings.json")}},62228:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},81497:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>l,PUT:()=>m,dynamic:()=>i});var d=c(23211),e=c(89477),f=c(86697),g=c(60396);let h={system:"SYSTEM.md",systemAppend:"APPEND_SYSTEM.md",agents:"AGENTS.md"},i="force-dynamic";function j(){return(0,f.join)((0,g.$M)(),"pidance-prompt-drafts.json")}function k(){let a=j();if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if("object"==typeof b&&null!==b&&!Array.isArray(b))return b}catch{}return{}}async function l(){try{let a=(0,g.$M)(),b=k(),c=Object.keys(h).map(c=>{let d=(0,f.join)(a,h[c]),g=(0,e.existsSync)(d),i=g?(()=>{try{return(0,e.readFileSync)(d,"utf8")}catch{return b[c]??""}})():b[c]??"";return{key:c,enabled:g,content:i}});return d.NextResponse.json({entries:c},{headers:{"Cache-Control":"no-store"}})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function m(a){try{var b;let c=await a.json().catch(()=>({}));if(b=c.key,"string"!=typeof b||"system"!==b&&"systemAppend"!==b&&"agents"!==b)return d.NextResponse.json({error:"key must be system | systemAppend | agents"},{status:400});if(void 0!==c.enabled&&"boolean"!=typeof c.enabled)return d.NextResponse.json({error:"enabled must be a boolean"},{status:400});if(void 0!==c.content&&"string"!=typeof c.content)return d.NextResponse.json({error:"content must be a string"},{status:400});if(c.content&&Buffer.byteLength(c.content,"utf8")>524288)return d.NextResponse.json({error:"content exceeds 524288 bytes"},{status:413});let i=c.key,l=(0,g.$M)(),m=(0,f.join)(l,h[i]),n=k(),o=c.enabled??(0,e.existsSync)(m);void 0!==c.content&&(c.content?n[i]=c.content:delete n[i]);let p=j(),q=(0,f.dirname)(p);(0,e.existsSync)(q)||(0,e.mkdirSync)(q,{recursive:!0,mode:448});let r=`${p}.${process.pid}.${Date.now()}.tmp`;try{(0,e.writeFileSync)(r,JSON.stringify(n,null,2),{flag:"wx",mode:384}),(0,e.renameSync)(r,p)}catch(a){try{(0,e.unlinkSync)(r)}catch{}throw a}if(o){let a=c.content??n[i];null!=a?((0,e.mkdirSync)((0,f.dirname)(m),{recursive:!0}),(0,e.writeFileSync)(m,a,"utf8")):(0,e.existsSync)(m)||(0,e.writeFileSync)(m,"","utf8")}else(0,e.existsSync)(m)&&(0,e.unlinkSync)(m);return d.NextResponse.json({ok:!0})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86697:a=>{"use strict";a.exports=require("node:path")},89477:a=>{"use strict";a.exports=require("node:fs")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=45440));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
(()=>{var a={};a.id=5403,a.ids=[5403],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12700:a=>{"use strict";function b(a){try{if(!a||!a.stdin||!1===a.stdin.writable)return!1;return a.stdin.write(`${JSON.stringify({type:"bye"})}
|
|
2
|
-
`),!0}catch{return!1}}a.exports={killPtyProcess:function(a,b="SIGTERM",c=process.platform){if(a&&a.pid>0){if("win32"!==c)try{process.kill(-a.pid,b)}catch{}if("function"==typeof a.kill)try{"win32"===c?a.kill():a.kill(b)}catch{}}},startParentWatchdog:function(a={}){let b=a.parentPid??process.ppid,c=a.intervalMs??5e3,d=a.missThreshold??2,e=a.setIntervalFn??setInterval,f=a.clearIntervalFn??clearInterval,g=a.isAlive??(a=>{try{return process.kill(a,0),!0}catch(a){return a&&"EPERM"===a.code}}),h=a.onGone??(()=>{}),i=0,j=e(()=>{if(g(b)){i=0;return}(i+=1)>=d&&h()},c);return j&&"function"==typeof j.unref&&j.unref(),()=>f(j)},requestWorkerShutdown:b,disposeWorkerChild:function(a,c={}){let d=c.platform??process.platform,e=c.graceMs??2e3,f=c.setTimer??setTimeout,g=c.clearTimer??clearTimeout,h=()=>{try{a.kill("SIGTERM")}catch{}};if("win32"===d&&b(a)){let b=f(h,e);b&&"function"==typeof b.unref&&b.unref(),"function"==typeof a.once&&a.once("exit",()=>g(b));return}h()}}},14566:a=>{"use strict";a.exports=require("node-pty")},15086:a=>{"use strict";a.exports=require("ws")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},54361:a=>{"use strict";function b(a){return/^[A-Za-z]:[\\/]/.test(a)||a.startsWith("\\\\")}a.exports={resolveShell:function(a,c){let d="string"==typeof c?.SHELL?c.SHELL.trim():"";return"win32"!==a?d||"/bin/bash":d&&b(d)?d:("string"==typeof c?.COMSPEC?c.COMSPEC.trim():"")||"powershell.exe"},looksLikeWindowsPath:b}},
|
|
2
|
+
`),!0}catch{return!1}}a.exports={killPtyProcess:function(a,b="SIGTERM",c=process.platform){if(a&&a.pid>0){if("win32"!==c)try{process.kill(-a.pid,b)}catch{}if("function"==typeof a.kill)try{"win32"===c?a.kill():a.kill(b)}catch{}}},startParentWatchdog:function(a={}){let b=a.parentPid??process.ppid,c=a.intervalMs??5e3,d=a.missThreshold??2,e=a.setIntervalFn??setInterval,f=a.clearIntervalFn??clearInterval,g=a.isAlive??(a=>{try{return process.kill(a,0),!0}catch(a){return a&&"EPERM"===a.code}}),h=a.onGone??(()=>{}),i=0,j=e(()=>{if(g(b)){i=0;return}(i+=1)>=d&&h()},c);return j&&"function"==typeof j.unref&&j.unref(),()=>f(j)},requestWorkerShutdown:b,disposeWorkerChild:function(a,c={}){let d=c.platform??process.platform,e=c.graceMs??2e3,f=c.setTimer??setTimeout,g=c.clearTimer??clearTimeout,h=()=>{try{a.kill("SIGTERM")}catch{}};if("win32"===d&&b(a)){let b=f(h,e);b&&"function"==typeof b.unref&&b.unref(),"function"==typeof a.once&&a.once("exit",()=>g(b));return}h()}}},14566:a=>{"use strict";a.exports=require("node-pty")},15086:a=>{"use strict";a.exports=require("ws")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},54361:a=>{"use strict";function b(a){return/^[A-Za-z]:[\\/]/.test(a)||a.startsWith("\\\\")}a.exports={resolveShell:function(a,c){let d="string"==typeof c?.SHELL?c.SHELL.trim():"";return"win32"!==a?d||"/bin/bash":d&&b(d)?d:("string"==typeof c?.COMSPEC?c.COMSPEC.trim():"")||"powershell.exe"},looksLikeWindowsPath:b}},55032:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});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(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/pty/route",pathname:"/api/pty",filename:"route",bundlePath:"app/api/pty/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/tmp/pidance-release-build/app/api/pty/route.ts",nextConfigOutput:"",userland:()=>c(69978),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/pty/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.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 u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,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=P.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")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63678:(a,b,c)=>{"use strict";let{existsSync:d,realpathSync:e}=c(29021),{WebSocketServer:f}=c(15086),{resolveShell:g}=c(54361),{killPtyProcess:h,disposeWorkerChild:i}=c(12700),j=new f({noServer:!0});function k(){try{let a=c(14566);if("function"!=typeof a.spawn)return null;return a}catch{return null}}function l(a){if(!d(a))throw Error("PTY cwd 不存在");return e(a)}function m(a,b={}){let c=b.intervalMs??3e4,d=b.maxMissed??2,e=b.setIntervalFn??setInterval,f=b.clearIntervalFn??clearInterval,g=b.isOpen??(()=>1===a.readyState),h=0,i=()=>{h=0};a.on("pong",i);let j=e(()=>{if(g()){if(h>=d){try{a.terminate()}catch{}return}h+=1;try{a.ping()}catch{}}},c);return j&&"function"==typeof j.unref&&j.unref(),()=>{f(j),"function"==typeof a.off&&a.off("pong",i)}}function n(a,b){let{spawn:d}=c(79646),e=c(33873).join(__dirname,"pty-worker.js"),f=!1,g=d(process.execPath,[e,b,"80","24"],{stdio:["pipe","pipe","pipe"],env:process.env});g.stdin.on("error",()=>{}),g.stderr.setEncoding("utf8"),g.stderr.on("data",a=>console.warn("[pidance] pty-worker stderr",a)),g.on("error",a=>console.warn("[pidance] pty-worker spawn",a.message));let h={pid:g.pid,write:a=>g.stdin.write(`${JSON.stringify({type:"in",d:a})}
|
|
3
3
|
`),resize:(a,b)=>g.stdin.write(`${JSON.stringify({type:"rs",cols:a,rows:b})}
|
|
4
|
-
`),dispose:()=>{f||(f=!0,i(g))}};g.stdout.setEncoding("utf8");let j="";g.stdout.on("data",b=>{let c;for(j+="string"==typeof b?b:Buffer.from(b).toString("utf8");(c=j.indexOf("\n"))>=0;){let b=j.slice(0,c);if(j=j.slice(c+1),b)try{let c=JSON.parse(b);c&&"out"===c.type&&"string"==typeof c.d&&a.send(JSON.stringify({type:"out",d:c.d}))}catch{try{a.send(b)}catch{}}}}),g.on("exit",b=>{try{1===a.readyState&&(a.send(JSON.stringify({type:"exit",code:b??0})),a.close())}catch{}}),a.on("message",a=>{let b,c="string"==typeof a?a:a.toString();try{b=JSON.parse(c)}catch{return}b&&"in"===b.type&&"string"==typeof b.d&&h.write(b.d),b&&"rs"===b.type&&b.cols>0&&b.rows>0&&h.resize(b.cols,b.rows)});let k=m(a),l=()=>{k(),h.dispose()};a.on("close",l),a.on("error",l);try{a.send(JSON.stringify({type:"out",d:"\r\n[pidance] terminal ready\r\n"}))}catch{}return h}a.exports={startPtySession:function(a){let b,c=void 0===a.pty?k():a.pty;if(!c)throw Error("node-pty 不可用");let d=l(a.cwd),e=a.cols&&a.cols>0?a.cols:80,f=a.rows&&a.rows>0?a.rows:24,i=g(process.platform,process.env),j=c.spawn(i,[],{name:"xterm-256color",cols:e,rows:f,cwd:d,env:(b={...a.env??process.env},delete b.PI_WEB_PASSWORD,delete b.PIDANCE_PASSWORD,b)}),m=!1,n=b=>{if(!m){let c="string"==typeof b?b:b.toString();a.onData(c)}};"function"==typeof j.on?j.on("data",n):"function"==typeof j.onData&&j.onData(n);let o=b=>{m||a.onExit("object"==typeof b&&b?b.exitCode:0)};return"function"==typeof j.on?j.on("exit",o):"function"==typeof j.onExit&&j.onExit(o),{pid:j.pid,write:a=>{m||j.write(a)},resize:(a,b)=>{!m&&a>0&&b>0&&j.resize(a,b)},dispose:()=>{m||(m=!0,h(j))}}},tryLoadNodePty:k,resolvePtyCwd:l,attachPtyToWebSocket:n,completePtyUpgrade:function(a,b,c,d){j.handleUpgrade(a,b,c,b=>{j.emit("connection",b,a),n(b,d)})},startPtyHeartbeat:m}},69978:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,dynamic:()=>f});var d=c(23211);let{tryLoadNodePty:e}=c(63678),f="force-dynamic";async function g(){return d.NextResponse.json({available:null!==e()})}},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=
|
|
4
|
+
`),dispose:()=>{f||(f=!0,i(g))}};g.stdout.setEncoding("utf8");let j="";g.stdout.on("data",b=>{let c;for(j+="string"==typeof b?b:Buffer.from(b).toString("utf8");(c=j.indexOf("\n"))>=0;){let b=j.slice(0,c);if(j=j.slice(c+1),b)try{let c=JSON.parse(b);c&&"out"===c.type&&"string"==typeof c.d&&a.send(JSON.stringify({type:"out",d:c.d}))}catch{try{a.send(b)}catch{}}}}),g.on("exit",b=>{try{1===a.readyState&&(a.send(JSON.stringify({type:"exit",code:b??0})),a.close())}catch{}}),a.on("message",a=>{let b,c="string"==typeof a?a:a.toString();try{b=JSON.parse(c)}catch{return}b&&"in"===b.type&&"string"==typeof b.d&&h.write(b.d),b&&"rs"===b.type&&b.cols>0&&b.rows>0&&h.resize(b.cols,b.rows)});let k=m(a),l=()=>{k(),h.dispose()};a.on("close",l),a.on("error",l);try{a.send(JSON.stringify({type:"out",d:"\r\n[pidance] terminal ready\r\n"}))}catch{}return h}a.exports={startPtySession:function(a){let b,c=void 0===a.pty?k():a.pty;if(!c)throw Error("node-pty 不可用");let d=l(a.cwd),e=a.cols&&a.cols>0?a.cols:80,f=a.rows&&a.rows>0?a.rows:24,i=g(process.platform,process.env),j=c.spawn(i,[],{name:"xterm-256color",cols:e,rows:f,cwd:d,env:(b={...a.env??process.env},delete b.PI_WEB_PASSWORD,delete b.PIDANCE_PASSWORD,b)}),m=!1,n=b=>{if(!m){let c="string"==typeof b?b:b.toString();a.onData(c)}};"function"==typeof j.on?j.on("data",n):"function"==typeof j.onData&&j.onData(n);let o=b=>{m||a.onExit("object"==typeof b&&b?b.exitCode:0)};return"function"==typeof j.on?j.on("exit",o):"function"==typeof j.onExit&&j.onExit(o),{pid:j.pid,write:a=>{m||j.write(a)},resize:(a,b)=>{!m&&a>0&&b>0&&j.resize(a,b)},dispose:()=>{m||(m=!0,h(j))}}},tryLoadNodePty:k,resolvePtyCwd:l,attachPtyToWebSocket:n,completePtyUpgrade:function(a,b,c,d){j.handleUpgrade(a,b,c,b=>{j.emit("connection",b,a),n(b,d)})},startPtyHeartbeat:m}},69978:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,dynamic:()=>f});var d=c(23211);let{tryLoadNodePty:e}=c(63678),f="force-dynamic";async function g(){return d.NextResponse.json({available:null!==e()})}},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=55032));module.exports=c})();
|