pi-yun 0.2.9 → 0.3.1
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 +18 -16
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +12 -0
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +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 +3 -3
- package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +1 -1
- package/.next/server/app/api/agent/[id]/lease/route.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/debug/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +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/cache-miss-notices/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js.nft.json +2 -2
- package/.next/server/app/api/cwd/validate/route.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js.nft.json +2 -2
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/file-index/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +1 -1
- package/.next/server/app/api/git/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/mcp/route.js +2 -2
- package/.next/server/app/api/mcp/sign-in/[flowId]/route.js +1 -1
- package/.next/server/app/api/mcp/sign-in/route.js +1 -1
- package/.next/server/app/api/mcp/test/route.js +1 -1
- package/.next/server/app/api/models/default/route.js +1 -1
- package/.next/server/app/api/models/default/route.js.nft.json +2 -2
- package/.next/server/app/api/models/enabled/route.js +1 -1
- package/.next/server/app/api/models/enabled/route.js.nft.json +2 -2
- package/.next/server/app/api/models/refresh/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/catalog/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/open-in-explorer/route.js +1 -1
- package/.next/server/app/api/plugins/check/route.js +1 -1
- package/.next/server/app/api/plugins/route.js +1 -1
- package/.next/server/app/api/project-trust/route.js +1 -1
- package/.next/server/app/api/provider-usage/query/route.js +1 -1
- package/.next/server/app/api/push/config/route.js +1 -1
- package/.next/server/app/api/push/subscribe/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +1 -54
- package/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/sources/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/delete/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/search/route.js +1 -1
- package/.next/server/app/api/sessions/stats/route.js +1 -1
- package/.next/server/app/api/sessions/ui-state/route.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/content/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/remove/route.js +2 -0
- package/.next/server/app/api/skills/remove/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/remove/route_client-reference-manifest.js +1 -0
- 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/transfer/route.js +2 -0
- package/.next/server/app/api/skills/transfer/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/transfer/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/subagents/[id]/route.js +1 -1
- package/.next/server/app/api/subagents/profiles/route.js +1 -1
- package/.next/server/app/api/subagents/settings/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/events/route.js +2 -2
- package/.next/server/app/api/terminal/[id]/route.js +1 -1
- package/.next/server/app/api/terminal/route.js +1 -1
- package/.next/server/app/api/tools/settings/route.js +1 -1
- package/.next/server/app/api/web-auth/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +7 -7
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/index.segments/_full.segment.rsc +7 -7
- package/.next/server/app/index.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/login/page.js +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +5 -5
- package/.next/server/app/login.segments/_full.segment.rsc +5 -5
- package/.next/server/app/login.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/manifest.webmanifest/route.js +1 -1
- package/.next/server/app/page.js +82 -82
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/pet-preview/page.js +1 -1
- package/.next/server/app/pet-preview/page_client-reference-manifest.js +1 -1
- package/.next/server/app/pet-preview.html +1 -1
- package/.next/server/app/pet-preview.rsc +5 -5
- package/.next/server/app/pet-preview.segments/_full.segment.rsc +5 -5
- package/.next/server/app/pet-preview.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/pet-preview.segments/pet-preview/__PAGE__.segment.rsc +5 -5
- package/.next/server/app-paths-manifest.json +18 -16
- package/.next/server/chunks/1249.js +1 -0
- package/.next/server/chunks/2243.js +1 -1
- package/.next/server/chunks/4733.js +1 -1
- package/.next/server/chunks/7365.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/TYat038Iq8ooFwRZgTW8o/_buildManifest.js +1 -0
- package/.next/static/chunks/1278-86f5c53b328335a0.js +1 -0
- package/.next/static/chunks/app/_global-error/page-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/lease/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/agent/debug/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/app-update/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/cache-miss-notices/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/cwd/browse/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/cwd/validate/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/home/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/mcp/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/mcp/sign-in/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/mcp/test/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models/default/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models/enabled/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models/refresh/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models-config/catalog/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/open-in-explorer/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/plugins/check/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/project-trust/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/provider-usage/query/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/push/config/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/push/subscribe/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/fork/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/sources/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/state/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/delete/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/search/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/stats/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/sessions/ui-state/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/content/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/remove/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/transfer/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/subagents/[id]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/subagents/profiles/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/subagents/settings/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/events/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/terminal/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/tools/settings/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/web-auth/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/{layout-4111f1ce05960fb6.js → layout-dae7418409377927.js} +1 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/app/{page-076f04fd487bb3a1.js → page-716731f03b8fe47e.js} +15 -15
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-eea87d7c4840e5e7.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-eea87d7c4840e5e7.js +1 -0
- package/.next/static/css/056b419bdfbe7181.css +1 -0
- package/.next/static/css/d8604b3a09b288c1.css +1 -0
- package/.next/trace +190 -36
- package/.next/trace-build +1 -1
- package/.next/types/app/api/skills/remove/route.ts +355 -0
- package/.next/types/app/api/skills/transfer/route.ts +355 -0
- package/.next/types/routes.d.ts +3 -1
- package/.next/types/validator.ts +20 -0
- package/README.md +66 -103
- package/package.json +1 -1
- package/.next/static/GMnJIDnrO9liPdCob_JXE/_buildManifest.js +0 -1
- package/.next/static/chunks/1278-9248e1290eeb84bd.js +0 -1
- package/.next/static/chunks/app/_global-error/page-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/lease/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/agent/debug/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/app-update/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/cache-miss-notices/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/cwd/browse/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/cwd/validate/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/home/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/mcp/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/mcp/sign-in/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/mcp/test/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models/default/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models/enabled/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models/refresh/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models-config/catalog/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/open-in-explorer/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/plugins/check/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/project-trust/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/provider-usage/query/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/push/config/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/push/subscribe/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/fork/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/sources/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/state/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/delete/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/search/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/stats/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/sessions/ui-state/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/skills/content/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/skills/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/subagents/[id]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/subagents/profiles/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/subagents/settings/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/events/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/terminal/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/tools/settings/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/web-auth/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-147c253c096ab7d7.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-147c253c096ab7d7.js +0 -1
- package/.next/static/css/a08edf57b19c703e.css +0 -1
- package/.next/static/css/ade11af447318d1b.css +0 -1
- /package/.next/static/{GMnJIDnrO9liPdCob_JXE → TYat038Iq8ooFwRZgTW8o}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/skills/remove/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"D:\\yun\\pi-web-yun\\app\\api\\skills\\remove\\route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";(()=>{var a={};a.id=9968,a.ids=[9968],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")},3734:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{S:()=>g});var e=c(75430),f=a([e]);e=(f.then?(await f)():f)[0];let h="disable-model-invocation",i=`[ \\t]*(?:${h}|"${h}"|'${h}')[ \\t]*:`,j="\\r\\n|\\n|\\r";function g(a,b){let{frontmatter:c}=(0,e.parseFrontmatter)(a),d=Object.prototype.hasOwnProperty.call(c,h);if(!b&&!d)return a;let f=function(a){let b=RegExp(`^\\uFEFF?---[ \\t]*(${j})`).exec(a);if(!b)return;let c=a.slice(b[0].length),d=RegExp(`(^|${j})---`).exec(c);if(d)return{openingEnd:b[0].length,closingStart:b[0].length+d.index+d[1].length,newline:b[1]}}(a);if(b){if(d){if(!f)throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let b=a.slice(f.openingEnd,f.closingStart),c=RegExp(`(^|${j})(${i})[^\\r\\n]*`);if(!c.test(b))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let d=b.replace(c,"$1$2 true");return a.slice(0,f.openingEnd)+d+a.slice(f.closingStart)}if(!f){let b;if(b=+!!a.startsWith("\uFEFF"),a.startsWith("---",b))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let c=a.startsWith("\uFEFF")?"\uFEFF":"",d=c?a.slice(1):a;return`${c}---
|
|
2
2
|
${h}: true
|
|
3
3
|
---
|
|
4
|
-
${d}`}return a.slice(0,f.openingEnd)+`${h}: true${f.newline}`+a.slice(f.openingEnd)}if(!f)throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let g=a.slice(f.openingEnd,f.closingStart),k=RegExp(`(^|${j})${i}[^\\r\\n]*(?:${j}|$)`);if(!k.test(g))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let l=g.replace(k,"$1");return a.slice(0,f.openingEnd)+l+a.slice(f.closingStart)}d()}catch(a){d(a)}})},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")},10879:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$q:()=>x,Vy:()=>v,bA:()=>y,ej:()=>u,yh:()=>C});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=c(8102),k=c(63108),l=c(37431),m=c(12069),n=a([g]);g=(n.then?(await n)():n)[0];let z=new Set(["version","revision","sessions","projects","removedProjects","projectOrder","projectNames","__proto__"]),A=Symbol.for("pi-web:session-ui-state-write-queue"),B={realpath:!1,stale:1e4,retries:{retries:10,factor:2,minTimeout:25,maxTimeout:500},onCompromised:a=>{console.warn(`[pi-web] the session UI state lock was compromised: ${a.message}`)}};class C extends Error{constructor(a="Another process holds the session UI state lock"){super(a),this.name="SessionUiStateLockedError"}}function o(){return globalThis.__piWebSessionUiStateCache??={reads:new Map,revisions:new Map}}function p(a,b){let c=o().revisions;b>(c.get(a)??-1)&&c.set(a,b)}function q(a){return structuredClone(a)}function r(a=(0,g.getAgentDir)()){return(0,f.join)(a,"pi-web-session-state.json")}function s(a){let b;try{b=JSON.parse(a)}catch{return{ok:!1}}let c=(0,m.Jx)(b);return c?{ok:!0,state:c,raw:b}:{ok:!1}}function t(a){let b,c;try{b=(0,e.statSync)(a)}catch(c){let b=c?.code;if("ENOENT"===b||"ENOTDIR"===b)return o().reads.delete(a),(0,m.ly)();throw c}let d=o().reads.get(a);if(d&&d.mtimeMs===b.mtimeMs&&d.size===b.size&&d.ino===b.ino)return d.state;let f=(0,l.y)(a,4194304);if(void 0===f)return o().reads.delete(a),(0,m.ly)();let g=s(f);return g.ok?p(a,(c=g.state).revision):(console.warn(`[pi-web] ${a} is not valid session UI state; reading it as empty until the next change sets it aside`),c=(0,m.ly)()),o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:c}),c}function u(a){try{return q(t(a??r()))}catch(a){return console.warn(`[pi-web] could not read the session UI state: ${a instanceof Error?a.message:String(a)}`),(0,m.ly)()}}function v(a){try{return t(a??r()).revision}catch{return null}}function w(a,b){return(0,k.T)(A,a,async()=>{let c;(0,e.mkdirSync)((0,f.dirname)(a),{recursive:!0});try{c=await i().lock(a,B)}catch(a){if("ELOCKED"===a?.code)throw new C;throw a}try{let c,d=o().revisions.get(a)??0,f=(0,l.y)(a,4194304),g={},h=!1;if(void 0===f)c={...(0,m.ly)(),revision:d};else{let b=s(f);if(b.ok)for(let[a,d]of(c=b.state,Object.entries(b.raw)))z.has(a)||(g[a]=d);else{let b=`${a}.corrupt-${Date.now()}`;try{(0,e.renameSync)(a,b),console.warn(`[pi-web] ${a} could not be parsed; moved it to ${b} and started from an empty session UI state`)}catch(b){console.warn(`[pi-web] ${a} could not be parsed and could not be moved aside (${b instanceof Error?b.message:String(b)}); starting from an empty session UI state`)}c={...(0,m.ly)(),revision:d+1},h=!0}}let i=b(c);if(!i.changed&&!h)return q(c);let k={...i.state,version:m.fS,revision:c.revision+ +!!i.changed},n={version:k.version,revision:k.revision,sessions:k.sessions,projects:k.projects,...k.removedProjects&&Object.keys(k.removedProjects).length>0?{removedProjects:k.removedProjects}:{},...k.projectOrder?.length?{projectOrder:k.projectOrder}:{},...k.projectNames&&Object.keys(k.projectNames).length>0?{projectNames:k.projectNames}:{},...g};(0,j.$)(a,JSON.stringify(n,null,2)+"\n"),p(a,k.revision);try{let b=(0,e.statSync)(a);o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:q(k)})}catch{o().reads.delete(a)}return q(k)}finally{try{await c()}catch{}}})}function x(a,b){let c;try{c=b??r()}catch(a){return Promise.reject(a)}return w(c,b=>(0,m.D7)(b,a,Date.now()))}async function y(a,b){let c=b??r(),d=[...new Set(a)];if(0===d.length)return;let e=a=>d.some(b=>Object.prototype.hasOwnProperty.call(a.sessions,b));e(t(c))&&await w(c,a=>{if(!e(a))return{state:a,changed:!1};let b={...a.sessions};for(let a of d)delete b[a];return{state:{...a,sessions:b},changed:!0}})}d()}catch(a){d(a)}})},12412:a=>{a.exports=require("assert")},18206:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\yun\\pi-web-yun\\app\\api\\skills\\route.ts",nextConfigOutput:"",userland:()=>c(45403),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21278:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{y:()=>i});var e=c(75430),f=c(75805),g=c(72498),h=a([e,g]);async function i(a){let b=(0,e.getAgentDir)(),c=new e.DefaultResourceLoader({cwd:a,agentDir:b,noExtensions:!0});await c.reload((0,g.Fk)(a,b));let{skills:d,diagnostics:h}=c.getSkills();return{skills:(0,f._)(d,{cwd:a,agentDir:b}),diagnostics:h,projectResourcesLoaded:(0,g.Y1)(a,b).trusted}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>o,PATCH:()=>r,dynamic:()=>s});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c.n(h),j=c(75430),k=c(21278),l=c(3734),m=c(80547),n=a([j,k,l,m]);[j,k,l,m]=n.then?(await n)():n;let s="force-dynamic";async function o(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,m.mc)();if(!(0,m.B7)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await (0,k.y)(c))}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function p(){let a=new Set(await (0,m.mc)());a.add((0,j.getAgentDir)());let b=i().join((0,g.homedir)(),".agents","skills");return(0,f.existsSync)(b)&&a.add(b),a}function q(a,b,c){if(".md"!==i().extname(a).toLowerCase())return{status:400,error:"Not a skill file"};if(!(0,f.existsSync)(a))return{status:404,error:"file not found"};if(!(0,m.B7)(a,c))return{status:403,error:"Access denied"};let d=(0,f.readFileSync)(a,"utf8"),e=(0,l.S)(d,b);return e!==d&&(0,f.writeFileSync)(a,e,"utf8"),null}async function r(a){try{let{filePath:b,filePaths:c,disableModelInvocation:d}=await a.json();if(void 0!==c){if(!Array.isArray(c)||!c.every(a=>"string"==typeof a&&a))return e.NextResponse.json({error:"filePaths must be a list of paths"},{status:400});if("boolean"!=typeof d)return e.NextResponse.json({error:"disableModelInvocation must be a boolean"},{status:400});let a=await p(),b=[];for(let e of new Set(c))try{let c=q(e,d,a);b.push(c?{filePath:e,error:c.error}:{filePath:e})}catch(a){b.push({filePath:e,error:a instanceof Error?a.message:String(a)})}return e.NextResponse.json({results:b})}if(!b)return e.NextResponse.json({error:"filePath required"},{status:400});let f=q(b,d,await p());if(f)return e.NextResponse.json({error:f.error},{status:f.status});return e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},75805:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(29021),e=c(21820),f=c(33873);function g(a){try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return b.skills&&"object"==typeof b.skills?b.skills:{}}catch{return{}}}function h(a,b,c){var d;let e=function(a,b){if(a[b])return a[b];let c=b.toLowerCase(),d=Object.keys(a).find(a=>a.toLowerCase()===c);return d?a[d]:void 0}(a,b);if(!e||"string"!=typeof e.source||!e.source.trim())return;let f="string"==typeof e.sourceType?e.sourceType:void 0,g=(d=e.source.trim(),"github"!==f?d.replace(/\/$/,""):d.replace(/^git\+/,"").replace(/^https?:\/\/github\.com\//,"").replace(/^git@github\.com:/,"").replace(/\.git$/,"").replace(/\/$/,""));if(!g)return;let h="string"==typeof e.skillPath?e.skillPath:void 0,i="string"==typeof e.ref?e.ref:void 0,j="global"===c?e.skillFolderHash:e.computedHash,k="string"==typeof j&&j?j:void 0,l="github"===f&&/^[\w.-]+\/[\w.-]+$/.test(g);return{package:`${g}@${b}`,scope:c,source:g,sourceType:f,skillsShUrl:"local"===f?void 0:function(a,b){if(!a||a.includes("://")||a.startsWith("git@"))return;let c=a.split("/").filter(Boolean).map(encodeURIComponent).join("/");if(c)return`https://skills.sh/${c}/${encodeURIComponent(b)}`}(g,b),...h&&{skillPath:h},...i&&{ref:i},...k&&{versionHash:k},canCheckForUpdates:!!(l&&h&&k&&("global"===c||!i))}}function i(a,{cwd:b,agentDir:c,homeDir:j=(0,e.homedir)(),globalLockPath:k=function({homeDir:a=(0,e.homedir)(),xdgStateHome:b=process.env.XDG_STATE_HOME}={}){return b?(0,f.join)(b,"skills",".skill-lock.json"):(0,f.join)(a,".agents",".skill-lock.json")}({homeDir:j}),projectLockPath:l=(0,f.join)(b,"skills-lock.json")}){let m=g(k),n=g(l),o=[(0,f.join)(c,"skills"),(0,f.join)(j,".agents","skills")],p=[(0,f.join)(b,".pi","skills"),(0,f.join)(b,".agents","skills")],q=(a,b)=>b.some(b=>{let c;return""!==(c=(0,f.relative)((0,f.resolve)(b),(0,f.resolve)(a)))&&".."!==c&&!c.startsWith(`..${f.sep}`)&&!(0,f.isAbsolute)(c)});return a.map(a=>{if(!(0,d.existsSync)(a.filePath))return a;let b=q(a.filePath,o)?h(m,a.name,"global"):q(a.filePath,p)?h(n,a.name,"project"):void 0;return b?{...a,install:b}:a})}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>m,B7:()=>n,mc:()=>l,uK:()=>j.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(10879),i=c(12069),j=c(58864),k=a([g,h]);async function l(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);let f=(0,h.ej)();for(let[a,b]of Object.entries(f.projects))(0,i.KV)(f,a)||d.add((0,e.Nw)(b.root));return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function m(a,b){return(0,f.o4)(a,b)}function n(a,b){return(0,f.xk)(a,b)}[g,h]=k.then?(await k)():k,d()}catch(a){d(a)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,974,5582,5e3,2498],()=>b(b.s=18206));module.exports=c})();
|
|
4
|
+
${d}`}return a.slice(0,f.openingEnd)+`${h}: true${f.newline}`+a.slice(f.openingEnd)}if(!f)throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let g=a.slice(f.openingEnd,f.closingStart),k=RegExp(`(^|${j})${i}[^\\r\\n]*(?:${j}|$)`);if(!k.test(g))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let l=g.replace(k,"$1");return a.slice(0,f.openingEnd)+l+a.slice(f.closingStart)}d()}catch(a){d(a)}})},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")},10879:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$q:()=>x,Vy:()=>v,bA:()=>y,ej:()=>u,yh:()=>C});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=c(8102),k=c(63108),l=c(37431),m=c(12069),n=a([g]);g=(n.then?(await n)():n)[0];let z=new Set(["version","revision","sessions","projects","removedProjects","projectOrder","projectNames","__proto__"]),A=Symbol.for("pi-web:session-ui-state-write-queue"),B={realpath:!1,stale:1e4,retries:{retries:10,factor:2,minTimeout:25,maxTimeout:500},onCompromised:a=>{console.warn(`[pi-web] the session UI state lock was compromised: ${a.message}`)}};class C extends Error{constructor(a="Another process holds the session UI state lock"){super(a),this.name="SessionUiStateLockedError"}}function o(){return globalThis.__piWebSessionUiStateCache??={reads:new Map,revisions:new Map}}function p(a,b){let c=o().revisions;b>(c.get(a)??-1)&&c.set(a,b)}function q(a){return structuredClone(a)}function r(a=(0,g.getAgentDir)()){return(0,f.join)(a,"pi-web-session-state.json")}function s(a){let b;try{b=JSON.parse(a)}catch{return{ok:!1}}let c=(0,m.Jx)(b);return c?{ok:!0,state:c,raw:b}:{ok:!1}}function t(a){let b,c;try{b=(0,e.statSync)(a)}catch(c){let b=c?.code;if("ENOENT"===b||"ENOTDIR"===b)return o().reads.delete(a),(0,m.ly)();throw c}let d=o().reads.get(a);if(d&&d.mtimeMs===b.mtimeMs&&d.size===b.size&&d.ino===b.ino)return d.state;let f=(0,l.y)(a,4194304);if(void 0===f)return o().reads.delete(a),(0,m.ly)();let g=s(f);return g.ok?p(a,(c=g.state).revision):(console.warn(`[pi-web] ${a} is not valid session UI state; reading it as empty until the next change sets it aside`),c=(0,m.ly)()),o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:c}),c}function u(a){try{return q(t(a??r()))}catch(a){return console.warn(`[pi-web] could not read the session UI state: ${a instanceof Error?a.message:String(a)}`),(0,m.ly)()}}function v(a){try{return t(a??r()).revision}catch{return null}}function w(a,b){return(0,k.T)(A,a,async()=>{let c;(0,e.mkdirSync)((0,f.dirname)(a),{recursive:!0});try{c=await i().lock(a,B)}catch(a){if("ELOCKED"===a?.code)throw new C;throw a}try{let c,d=o().revisions.get(a)??0,f=(0,l.y)(a,4194304),g={},h=!1;if(void 0===f)c={...(0,m.ly)(),revision:d};else{let b=s(f);if(b.ok)for(let[a,d]of(c=b.state,Object.entries(b.raw)))z.has(a)||(g[a]=d);else{let b=`${a}.corrupt-${Date.now()}`;try{(0,e.renameSync)(a,b),console.warn(`[pi-web] ${a} could not be parsed; moved it to ${b} and started from an empty session UI state`)}catch(b){console.warn(`[pi-web] ${a} could not be parsed and could not be moved aside (${b instanceof Error?b.message:String(b)}); starting from an empty session UI state`)}c={...(0,m.ly)(),revision:d+1},h=!0}}let i=b(c);if(!i.changed&&!h)return q(c);let k={...i.state,version:m.fS,revision:c.revision+ +!!i.changed},n={version:k.version,revision:k.revision,sessions:k.sessions,projects:k.projects,...k.removedProjects&&Object.keys(k.removedProjects).length>0?{removedProjects:k.removedProjects}:{},...k.projectOrder?.length?{projectOrder:k.projectOrder}:{},...k.projectNames&&Object.keys(k.projectNames).length>0?{projectNames:k.projectNames}:{},...g};(0,j.$)(a,JSON.stringify(n,null,2)+"\n"),p(a,k.revision);try{let b=(0,e.statSync)(a);o().reads.set(a,{mtimeMs:b.mtimeMs,size:b.size,ino:b.ino,state:q(k)})}catch{o().reads.delete(a)}return q(k)}finally{try{await c()}catch{}}})}function x(a,b){let c;try{c=b??r()}catch(a){return Promise.reject(a)}return w(c,b=>(0,m.D7)(b,a,Date.now()))}async function y(a,b){let c=b??r(),d=[...new Set(a)];if(0===d.length)return;let e=a=>d.some(b=>Object.prototype.hasOwnProperty.call(a.sessions,b));e(t(c))&&await w(c,a=>{if(!e(a))return{state:a,changed:!1};let b={...a.sessions};for(let a of d)delete b[a];return{state:{...a,sessions:b},changed:!0}})}d()}catch(a){d(a)}})},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21278:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{y:()=>k});var e=c(75430),f=c(76760),g=c.n(f),h=c(75805),i=c(72498),j=a([e,i]);async function k(a,b={}){let c=(0,e.getAgentDir)(),d=new e.DefaultResourceLoader({cwd:a,agentDir:c,noExtensions:!0});await d.reload((0,i.Fk)(a,c));let{skills:f,diagnostics:j}=d.getSkills(),l=f.map(a=>({...a,loaded:!0}));if(b.includeShadowed)for(let a of j){let b=a.collision;if(b?.resourceType!=="skill"||l.some(a=>a.filePath===b.loserPath))continue;let c=(0,e.loadSkillsFromDir)({dir:g().dirname(b.loserPath),source:b.loserSource??"path"}).skills.find(a=>a.filePath===b.loserPath);c&&l.push({...c,loaded:!1})}return{skills:(0,h._)(l,{cwd:a,agentDir:c}),diagnostics:j,projectResourcesLoaded:(0,i.Y1)(a,c).trusted}}[e,i]=j.then?(await j)():j,d()}catch(a){d(a)}})},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>o,PATCH:()=>r,dynamic:()=>s});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c.n(h),j=c(75430),k=c(21278),l=c(3734),m=c(80547),n=a([j,k,l,m]);[j,k,l,m]=n.then?(await n)():n;let s="force-dynamic";async function o(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,m.mc)();if(!(0,m.B7)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await (0,k.y)(c,{includeShadowed:"1"===b.get("management")}))}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function p(){let a=new Set(await (0,m.mc)());a.add((0,j.getAgentDir)());let b=i().join((0,g.homedir)(),".agents","skills");return(0,f.existsSync)(b)&&a.add(b),a}function q(a,b,c){if(".md"!==i().extname(a).toLowerCase())return{status:400,error:"Not a skill file"};if(!(0,f.existsSync)(a))return{status:404,error:"file not found"};if(!(0,m.B7)(a,c))return{status:403,error:"Access denied"};let d=(0,f.readFileSync)(a,"utf8"),e=(0,l.S)(d,b);return e!==d&&(0,f.writeFileSync)(a,e,"utf8"),null}async function r(a){try{let{filePath:b,filePaths:c,disableModelInvocation:d}=await a.json();if(void 0!==c){if(!Array.isArray(c)||!c.every(a=>"string"==typeof a&&a))return e.NextResponse.json({error:"filePaths must be a list of paths"},{status:400});if("boolean"!=typeof d)return e.NextResponse.json({error:"disableModelInvocation must be a boolean"},{status:400});let a=await p(),b=[];for(let e of new Set(c))try{let c=q(e,d,a);b.push(c?{filePath:e,error:c.error}:{filePath:e})}catch(a){b.push({filePath:e,error:a instanceof Error?a.message:String(a)})}return e.NextResponse.json({results:b})}if(!b)return e.NextResponse.json({error:"filePath required"},{status:400});let f=q(b,d,await p());if(f)return e.NextResponse.json({error:f.error},{status:f.status});return e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},75805:(a,b,c)=>{c.d(b,{_:()=>j,i:()=>g});var d=c(29021),e=c(21820),f=c(33873);function g({homeDir:a=(0,e.homedir)(),xdgStateHome:b=process.env.XDG_STATE_HOME}={}){return b?(0,f.join)(b,"skills",".skill-lock.json"):(0,f.join)(a,".agents",".skill-lock.json")}function h(a){try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return b.skills&&"object"==typeof b.skills?b.skills:{}}catch{return{}}}function i(a,b,c){var d;let e=function(a,b){if(a[b])return a[b];let c=b.toLowerCase(),d=Object.keys(a).find(a=>a.toLowerCase()===c);return d?a[d]:void 0}(a,b);if(!e||"string"!=typeof e.source||!e.source.trim())return;let f="string"==typeof e.sourceType?e.sourceType:void 0,g=(d=e.source.trim(),"github"!==f?d.replace(/\/$/,""):d.replace(/^git\+/,"").replace(/^https?:\/\/github\.com\//,"").replace(/^git@github\.com:/,"").replace(/\.git$/,"").replace(/\/$/,""));if(!g)return;let h="string"==typeof e.skillPath?e.skillPath:void 0,i="string"==typeof e.ref?e.ref:void 0,j=("global"===c?e.skillFolderHash:e.computedHash)??e.piWebVersionHash,k="string"==typeof j&&j?j:void 0,l="github"===f&&/^[\w.-]+\/[\w.-]+$/.test(g);return{package:`${g}@${b}`,scope:c,source:g,sourceType:f,skillsShUrl:"local"===f?void 0:function(a,b){if(!a||a.includes("://")||a.startsWith("git@"))return;let c=a.split("/").filter(Boolean).map(encodeURIComponent).join("/");if(c)return`https://skills.sh/${c}/${encodeURIComponent(b)}`}(g,b),...h&&{skillPath:h},...i&&{ref:i},...k&&{versionHash:k},canCheckForUpdates:!!(l&&h&&k&&("global"===c||!i)&&!e.piWebVersionHash)}}function j(a,{cwd:b,agentDir:c,homeDir:k=(0,e.homedir)(),globalLockPath:l=g({homeDir:k}),projectLockPath:m=(0,f.join)(b,"skills-lock.json")}){let n=h(l),o=h(m),p=[(0,f.join)(c,"skills"),(0,f.join)(k,".agents","skills")],q=[(0,f.join)(b,".pi","skills"),(0,f.join)(b,".agents","skills")],r=(a,b)=>b.some(b=>{let c;return""!==(c=(0,f.relative)((0,f.resolve)(b),(0,f.resolve)(a)))&&".."!==c&&!c.startsWith(`..${f.sep}`)&&!(0,f.isAbsolute)(c)});return a.map(a=>{if(!(0,d.existsSync)(a.filePath))return a;let b=r(a.filePath,p)?i(n,a.name,"global"):r(a.filePath,q)?i(o,a.name,"project"):void 0;return b?{...a,install:b}:a})}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>m,B7:()=>n,mc:()=>l,uK:()=>j.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(10879),i=c(12069),j=c(58864),k=a([g,h]);async function l(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);let f=(0,h.ej)();for(let[a,b]of Object.entries(f.projects))(0,i.KV)(f,a)||d.add((0,e.Nw)(b.root));return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function m(a,b){return(0,f.o4)(a,b)}function n(a,b){return(0,f.xk)(a,b)}[g,h]=k.then?(await k)():k,d()}catch(a){d(a)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")},99275:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\yun\\pi-web-yun\\app\\api\\skills\\route.ts",nextConfigOutput:"",userland:()=>c(45403),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,974,5582,5e3,2498],()=>b(b.s=99275));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=3955,a.ids=[3955],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")},19771:a=>{"use strict";a.exports=require("process")},21361:(a,b,c)=>{"use strict";c.d(b,{f:()=>g});var d=c(29021),e=c(33873),f=c(19771);function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},69906:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\yun\\pi-web-yun\\app\\api\\skills\\search\\route.ts",nextConfigOutput:"",userland:()=>c(78638),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},78335:()=>{},78638:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>l,dynamic:()=>f});var d=c(23211),e=c(97990);let f="force-dynamic",g=/\x1B\[[0-9;]*m/g,h=process.env.SKILLS_API_URL||"https://skills.sh";function i(a){let b=a.replace(g,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function j(a,b){let c=`${h}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${h}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>k(b.installs)-k(a.installs))}function k(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function l(a){try{let b,{query:c,limit:f}=await a.json();if(!c?.trim())return d.NextResponse.json({error:"query required"},{status:400});let g=(b="number"==typeof f?f:Number(f),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await j(c.trim(),g);return d.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,e.a)(["skills","find",c.trim()],{timeout:2e4,env:{...process.env,FORCE_COLOR:"0"}}),f=i(a+b).slice(0,g);return d.NextResponse.json({results:f})}}catch(c){let a=(c.stdout??"")+(c.stderr??""),b=a?i(a):[];if(b.length>0)return d.NextResponse.json({results:b});return d.NextResponse.json({error:c.message??String(c)},{status:500})}}},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:()=>{},97990:(a,b,c)=>{"use strict";c.d(b,{a:()=>h});var d=c(79646),e=c(28354),f=c(21361);let g=(0,e.promisify)(d.execFile);async function h(a,b={}){let{command:c,args:d}=(0,f.f)("npx",a);return g(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813],()=>b(b.s=69906));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=3955,a.ids=[3955],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")},9095:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\yun\\pi-web-yun\\app\\api\\skills\\search\\route.ts",nextConfigOutput:"",userland:()=>c(78638),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},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")},19771:a=>{"use strict";a.exports=require("process")},21361:(a,b,c)=>{"use strict";c.d(b,{f:()=>g});var d=c(29021),e=c(33873),f=c(19771);function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},78638:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>l,dynamic:()=>f});var d=c(23211),e=c(97990);let f="force-dynamic",g=/\x1B\[[0-9;]*m/g,h=process.env.SKILLS_API_URL||"https://skills.sh";function i(a){let b=a.replace(g,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function j(a,b){let c=`${h}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${h}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>k(b.installs)-k(a.installs))}function k(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function l(a){try{let b,{query:c,limit:f}=await a.json();if(!c?.trim())return d.NextResponse.json({error:"query required"},{status:400});let g=(b="number"==typeof f?f:Number(f),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await j(c.trim(),g);return d.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,e.a)(["skills","find",c.trim()],{timeout:2e4,env:{...process.env,FORCE_COLOR:"0"}}),f=i(a+b).slice(0,g);return d.NextResponse.json({results:f})}}catch(c){let a=(c.stdout??"")+(c.stderr??""),b=a?i(a):[];if(b.length>0)return d.NextResponse.json({results:b});return d.NextResponse.json({error:c.message??String(c)},{status:500})}}},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:()=>{},97990:(a,b,c)=>{"use strict";c.d(b,{a:()=>h});var d=c(79646),e=c(28354),f=c(21361);let g=(0,e.promisify)(d.execFile);async function h(a,b={}){let{command:c,args:d}=(0,f.f)("npx",a);return g(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813],()=>b(b.s=9095));module.exports=c})();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(()=>{var a={};a.id=4762,a.ids=[4762],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},861:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/transfer/route",pathname:"/api/skills/transfer",filename:"route",bundlePath:"app/api/skills/transfer/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\yun\\pi-web-yun\\app\\api\\skills\\transfer\\route.ts",nextConfigOutput:"",userland:()=>c(6193),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/transfer/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=T.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6193:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>m,dynamic:()=>n});var e=c(23211),f=c(75430),g=c(80547),h=c(72498),i=c(66544),j=c(21278),k=c(67649),l=a([f,g,h,j]);[f,g,h,j]=l.then?(await l)():l;let n="force-dynamic";async function m(a){if(!(0,i.EN)(a))return e.NextResponse.json({code:"access-denied"},{status:403});if(!(0,i.E2)(a))return e.NextResponse.json({code:"invalid-request"},{status:415});try{let b=await a.json();if("string"!=typeof b.cwd||!["preview","apply","undo"].includes(String(b.action)))return e.NextResponse.json({code:"invalid-request"},{status:400});let c=b.cwd;if(!(0,g.B7)(c,await (0,g.mc)()))return e.NextResponse.json({code:"access-denied"},{status:403});let d=(0,f.getAgentDir)();if(!(0,h.Y1)(c,d).trusted)return e.NextResponse.json({code:"project-untrusted"},{status:403});if("undo"===b.action){if("string"!=typeof b.undoToken)return e.NextResponse.json({code:"invalid-request"},{status:400});return e.NextResponse.json(await (0,k.bg)(b.undoToken,c))}if("string"!=typeof b.filePath||"string"!=typeof b.package)return e.NextResponse.json({code:"invalid-request"},{status:400});let{skills:i}=await (0,j.y)(c,{includeShadowed:!0}),l=i.find(a=>a.filePath===b.filePath&&a.install?.package===b.package);if(!l?.install)return e.NextResponse.json({code:"source-changed"},{status:409});if("preview"===b.action)return e.NextResponse.json(await (0,k.hr)(l,c,d));if("move"!==b.mode&&"copy"!==b.mode||!0!==b.sharedAcknowledged)return e.NextResponse.json({code:"invalid-request"},{status:400});return e.NextResponse.json(await (0,k.$z)(l,b.mode,c,d))}catch(a){if(a instanceof k.b3)return e.NextResponse.json({code:a.code,targetPath:a.targetPath},{status:409});if(a instanceof Error&&a.message.startsWith("Linked skill roots"))return e.NextResponse.json({code:"linked-files"},{status:409});return e.NextResponse.json({code:"failed",details:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67649:(a,b,c)=>{c.d(b,{$z:()=>z,b3:()=>m,bg:()=>A,hr:()=>y});var d=c(51455),e=c(76760),f=c.n(e),g=c(48161),h=c(77598),i=c(80974),j=c.n(i),k=c(75805),l=c(89469);class m extends Error{constructor(a,b){super(a),this.code=a,this.targetPath=b}}let n=Symbol.for("pi-web.skill-transfer-undo"),o=globalThis,p=o[n]??=new Map;async function q(a,b=!1){let c=await (0,l.Nn)(a);if(!c&&b)return{version:1,skills:{}};if(!c?.isFile()||c.isSymbolicLink())throw new m("invalid-lock");let e=JSON.parse(await (0,d.readFile)(a,"utf8"));if(!e||"object"!=typeof e||!e.skills||"object"!=typeof e.skills||Array.isArray(e.skills))throw new m("invalid-lock");return e}function r(a){return a.trim().replace(/^git\+/,"").replace(/^https?:\/\/github\.com\//,"").replace(/^git@github\.com:/,"").replace(/\.git$/,"").replace(/\/$/,"")}function s(a,b,c,d){if(!a.install||!/^[a-z0-9][a-z0-9_-]*$/.test(a.name))throw new m("unsupported");let e=f().join(d,".agents","skills"),g=f().join(b,".agents","skills");if((0,l.Eb)(e,g))throw new m("overlap");let h=(0,k.i)({homeDir:d}),i=f().join(b,"skills-lock.json"),j=a.install.scope,n=f().dirname(a.filePath);if(!("global"===j?[e,f().join(c,"skills")]:[g,f().join(b,".pi","skills")]).some(b=>(0,l.Eb)(f().join(b,a.name,"SKILL.md"),a.filePath)))throw new m("unsupported");return{sourceDir:n,targetDir:f().join("global"===j?g:e,a.name),sourceLock:"global"===j?h:i,targetLock:"global"===j?i:h,targetScope:"global"===j?"project":"global"}}async function t(a,b,c,e,g){if(await (0,l.R4)(b.sourceDir),!(await (0,d.lstat)(f().join(b.sourceDir,"SKILL.md"))).isFile())throw new m("source-changed");let h=await q(b.sourceLock),i=h.skills[a.name];if(!i||"string"!=typeof i.source||r(i.source)!==r(a.install.source))throw new m("source-changed");for(let d of"project"===a.install.scope?[f().join(c,".pi","skills",a.name),f().join(c,".agents","skills",a.name)]:[f().join(e,"skills",a.name),f().join(g,".agents","skills",a.name)])if(!(0,l.Eb)(d,b.sourceDir)&&await (0,l.Nn)(d))throw new m("conflict",d);let j=await q(b.targetLock,!0),k="project"===b.targetScope?[f().join(c,".pi","skills",a.name)]:[f().join(e,"skills",a.name)];for(let a of[b.targetDir,...k])if(await (0,l.Nn)(a))throw new m("conflict",a);if(Object.keys(j.skills).some(b=>b.toLowerCase()===a.name.toLowerCase()))throw new m("conflict",b.targetDir);return{source:h,target:j,entry:i}}async function u(a){let b=(0,h.createHash)("sha256"),c=0,e=0;async function g(a,h){let i=await (0,d.lstat)(a);if(i.isSymbolicLink())throw new m("linked-files");if(b.update(h+"\0"),i.isDirectory())for(let c of(b.update("dir\0"),(await (0,d.readdir)(a)).sort()))await g(f().join(a,c),`${h}/${c}`);else if(i.isFile()){if(++c>2e4||(e+=i.size)>0xc800000)throw new m("too-large");b.update("file\0").update(await (0,d.readFile)(a)).update("\0")}else throw new m("unsupported")}return await g(a,""),b.digest("hex")}async function v(a){let b=a;for(;!await (0,l.Nn)(b);)b=f().dirname(b);await (0,l.R4)(b),await (0,d.mkdir)(a,{recursive:!0}),await (0,l.R4)(a)}async function w(a,b){let c=`${a}.${(0,h.randomUUID)()}.tmp`;try{let e=await (0,d.lstat)(a);await (0,d.writeFile)(c,"string"==typeof b?b:`${JSON.stringify(b,null,2)}
|
|
2
|
+
`,{flag:"wx",mode:511&e.mode}),await (0,d.rename)(c,a)}finally{await (0,d.unlink)(c).catch(()=>void 0)}}async function x(a,b,c){let e=[];try{for(let b of[...new Set(a)].sort()){if(await v(f().dirname(b)),b===c)try{await (0,d.writeFile)(b,JSON.stringify({version:".skill-lock.json"===f().basename(b)?3:1,skills:{}})+"\n",{flag:"wx",mode:384})}catch(a){if("EEXIST"!==a.code)throw a}await q(b),e.push(await j().lock(b,{realpath:!1,retries:{retries:10,minTimeout:50,maxTimeout:200}}))}return await b()}finally{for(let a of e.reverse())await a()}}async function y(a,b,c,d=(0,g.homedir)()){let e=s(a,b,c,d);return await t(a,e,b,c,d),await u(e.sourceDir),{targetPath:f().join(e.targetDir,"SKILL.md"),targetScope:e.targetScope}}async function z(a,b,c,e,i=(0,g.homedir)()){let j=s(a,c,e,i);return await t(a,j,c,e,i),x([j.sourceLock,j.targetLock],async()=>{let{source:g,target:k,entry:n}=await t(a,j,c,e,i),o=await (0,d.readFile)(j.sourceLock,"utf8"),q=await (0,d.readFile)(j.targetLock,"utf8"),r=await u(j.sourceDir),s=f().join(f().dirname(f().dirname(j.sourceDir)),".pi-web-skill-transfers");await v(s);let x=await (0,d.mkdtemp)(f().join(s,`${a.name}-`)),y=f().join(f().dirname(f().dirname(j.targetDir)),".pi-web-skill-transfers");await v(y);let z=await (0,d.mkdtemp)(f().join(y,`${a.name}-`)),A=f().join(z,"target");if(await (0,d.cp)(j.sourceDir,A,{recursive:!0,errorOnExist:!0,force:!1,preserveTimestamps:!0}),await u(A)!==r||await u(j.sourceDir)!==r)throw new m("source-changed");let B={...n,piWebVersionHash:a.install?.versionHash};delete B.skillFolderHash,delete B.computedHash,k.skills[a.name]=B,"move"===b&&delete g.skills[a.name],await (0,d.writeFile)(f().join(x,"manifest.json"),JSON.stringify({...j,mode:b,name:a.name,sourceEntry:n,targetEntry:B,stagingPath:z},null,2),{mode:384}),await (0,d.writeFile)(f().join(x,"source-lock.json"),o,{mode:384}),await (0,d.writeFile)(f().join(x,"target-lock.json"),q,{mode:384}),await v(f().dirname(j.targetDir));let C=!1,D=!1,E=!1,F=!1;try{if(await (0,l.Nn)(j.targetDir))throw new m("conflict",j.targetDir);if(await (0,d.readFile)(j.sourceLock,"utf8")!==o||await (0,d.readFile)(j.targetLock,"utf8")!==q)throw new m("source-changed");await (0,d.rename)(A,j.targetDir),C=!0,"move"===b&&(await (0,d.rename)(j.sourceDir,f().join(x,"source")),D=!0),await w(j.targetLock,k),E=!0,"move"===b&&(await w(j.sourceLock,g),F=!0)}catch(a){try{F&&await w(j.sourceLock,o),E&&await w(j.targetLock,q),D&&await (0,d.rename)(f().join(x,"source"),j.sourceDir),C&&await (0,d.rename)(j.targetDir,A)}catch{throw new m("recover",x)}throw a}for(let[a,b]of p)b.expires<Date.now()&&p.delete(a);p.size>=100&&p.delete(p.keys().next().value);let G=(0,h.randomUUID)();return p.set(G,{...j,cwd:c,name:a.name,mode:b,sourceEntry:n,targetEntry:B,backupPath:x,stagingPath:z,targetHash:r,expires:Date.now()+3e5}),{...j,targetPath:f().join(j.targetDir,"SKILL.md"),undoToken:G}},j.targetLock)}async function A(a,b){let c=p.get(a);if(!c||c.expires<Date.now()||!(0,l.Eb)(c.cwd,b))throw new m("undo-expired");return x([c.sourceLock,c.targetLock],async()=>{if(p.get(a)!==c)throw new m("undo-expired");let b=await q(c.sourceLock),e=await q(c.targetLock);if(JSON.stringify(e.skills[c.name])!==JSON.stringify(c.targetEntry)||(await (0,l.R4)(c.targetDir),await u(c.targetDir)!==c.targetHash))throw new m("undo-changed");if("move"===c.mode){if(b.skills[c.name]||await (0,l.Nn)(c.sourceDir))throw new m("conflict",c.sourceDir);if(await u(f().join(c.backupPath,"source"))!==c.targetHash)throw new m("undo-changed")}await (0,l.R4)(f().dirname(c.sourceDir)),await (0,l.R4)(c.backupPath),await (0,l.R4)(c.stagingPath);let g=await (0,d.readFile)(c.targetLock,"utf8"),h=!1,i=!1,j=!1;try{await (0,d.rename)(c.targetDir,f().join(c.stagingPath,"undone-target")),h=!0,"move"===c.mode&&(await (0,d.rename)(f().join(c.backupPath,"source"),c.sourceDir),i=!0,b.skills[c.name]=c.sourceEntry),delete e.skills[c.name],await w(c.targetLock,e),j=!0,"move"===c.mode&&await w(c.sourceLock,b)}catch(a){try{j&&await w(c.targetLock,g),i&&await (0,d.rename)(c.sourceDir,f().join(c.backupPath,"source")),h&&await (0,d.rename)(f().join(c.stagingPath,"undone-target"),c.targetDir)}catch{throw new m("recover",c.backupPath)}throw a}return p.delete(a),{targetPath:f().join(c.sourceDir,"SKILL.md")}})}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,974,5582,5e3,2498,1249],()=>b(b.s=861));module.exports=c})();
|