@tasselx/pi-web 1.2.0 → 1.3.0
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 +12 -10
- package/.next/build-manifest.json +4 -4
- package/.next/prerender-manifest.json +1 -157
- package/.next/react-loadable-manifest.json +2 -2
- package/.next/required-server-files.js +6 -6
- package/.next/required-server-files.json +6 -6
- 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]/bash-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/lease/route.js +1 -1
- package/.next/server/app/api/agent/[id]/lease/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/lease/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/debug/route.js +3 -0
- package/.next/server/app/api/agent/debug/route.js.nft.json +1 -0
- package/.next/server/app/api/agent/debug/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/new/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/agent/running/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/running/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/api/app-update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cache-miss-notices/route.js +1 -1
- package/.next/server/app/api/cache-miss-notices/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cwd/pick/route.js +1 -1
- package/.next/server/app/api/cwd/pick/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js +1 -1
- package/.next/server/app/api/cwd/validate/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/file-index/route.js +1 -1
- package/.next/server/app/api/file-index/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +3 -3
- package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/diff/route.js +2 -2
- package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/status/route.js +2 -2
- package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/home/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/mcp/route.js +2 -2
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/mcp/sign-in/[flowId]/route.js +1 -1
- package/.next/server/app/api/mcp/sign-in/[flowId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/mcp/sign-in/route.js +1 -1
- package/.next/server/app/api/mcp/sign-in/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/sign-in/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/mcp/test/route.js +1 -1
- package/.next/server/app/api/mcp/test/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/test/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/default/route.js +1 -1
- package/.next/server/app/api/models/default/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/enabled/route.js +1 -1
- package/.next/server/app/api/models/enabled/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/refresh/route.js +1 -1
- package/.next/server/app/api/models/refresh/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/catalog/route.js +1 -1
- package/.next/server/app/api/models-config/catalog/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/open-in-explorer/route.js +1 -1
- package/.next/server/app/api/open-in-explorer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plugins/check/route.js +1 -1
- package/.next/server/app/api/plugins/check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plugins/route.js +1 -1
- package/.next/server/app/api/plugins/route.js.nft.json +1 -1
- package/.next/server/app/api/plugins/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/project-trust/route.js +1 -1
- package/.next/server/app/api/project-trust/route.js.nft.json +1 -1
- package/.next/server/app/api/project-trust/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/provider-usage/query/route.js +1 -1
- package/.next/server/app/api/provider-usage/query/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/config/route.js +1 -1
- package/.next/server/app/api/push/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscribe/route.js +1 -1
- package/.next/server/app/api/push/subscribe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/auto-name/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.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]/thinking/route_client-reference-manifest.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]/entries/[entryId]/tool-result-image/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/export/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/fork/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/fork/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/state/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/delete/route.js +1 -1
- package/.next/server/app/api/sessions/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/search/route.js +1 -1
- package/.next/server/app/api/sessions/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/stats/route.js +1 -1
- package/.next/server/app/api/sessions/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/stats/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/ui-state/route.js +1 -1
- package/.next/server/app/api/sessions/ui-state/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/content/route.js +1 -1
- package/.next/server/app/api/skills/content/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/skills/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sleep-inhibit/route.js +1 -0
- package/.next/server/app/api/sleep-inhibit/route.js.nft.json +1 -0
- package/.next/server/app/api/sleep-inhibit/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/subagents/[id]/route.js +1 -1
- package/.next/server/app/api/subagents/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/subagents/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/subagents/profiles/route.js +1 -1
- package/.next/server/app/api/subagents/profiles/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/subagents/settings/route.js +1 -1
- package/.next/server/app/api/subagents/settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/terminal/[id]/events/route.js +3 -3
- package/.next/server/app/api/terminal/[id]/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/terminal/[id]/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/terminal/route.js +1 -1
- package/.next/server/app/api/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tools/settings/route.js +1 -1
- package/.next/server/app/api/tools/settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/web-auth/route.js +1 -1
- package/.next/server/app/api/web-auth/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.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 +9 -9
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +9 -9
- package/.next/server/app/index.segments/_full.segment.rsc +9 -9
- package/.next/server/app/index.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/login/page.js +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +6 -6
- package/.next/server/app/login.segments/_full.segment.rsc +6 -6
- package/.next/server/app/login.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +933 -88
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +12 -10
- package/.next/server/chunks/1906.js +1 -1
- package/.next/server/chunks/2243.js +1 -1
- package/.next/server/chunks/2430.js +3 -3
- package/.next/server/chunks/2650.js +1 -0
- package/.next/server/chunks/27.js +1 -1
- package/.next/server/chunks/2970.js +1 -1
- package/.next/server/chunks/3371.js +1 -0
- package/.next/server/chunks/3379.js +1 -1
- package/.next/server/chunks/3757.js +1 -1
- package/.next/server/chunks/3824.js +1 -1
- package/.next/server/chunks/4315.js +2 -2
- package/.next/server/chunks/5582.js +3 -3
- package/.next/server/chunks/6216.js +6 -0
- package/.next/server/chunks/6429.js +9 -10
- package/.next/server/chunks/8947.js +1 -0
- package/.next/server/functions-config-manifest.json +1 -0
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +4 -4
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +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/SZGRKeK7Rp-GLXlZwXVpN/_buildManifest.js +1 -0
- package/.next/static/chunks/1278-7900e52add02a581.js +1 -0
- package/.next/static/chunks/{9932-ad7f7fe74cc1f50a.js → 4908-f430833122ebb4b2.js} +2 -2
- package/.next/static/chunks/7379.078f0917cc6a0349.js +3 -0
- package/.next/static/chunks/app/_global-error/page-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/_not-found/{page-35dee0d93253f38c.js → page-d4722b111eb204ad.js} +1 -1
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/lease/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/agent/debug/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/app-update/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/cache-miss-notices/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/cwd/browse/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/cwd/pick/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/cwd/validate/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/home/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/mcp/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/mcp/sign-in/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/mcp/test/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models/default/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models/enabled/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models/refresh/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models-config/catalog/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/open-in-explorer/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/plugins/check/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/project-trust/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/provider-usage/query/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/push/config/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/push/subscribe/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/fork/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/state/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/delete/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/search/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/stats/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sessions/ui-state/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/skills/content/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/skills/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/sleep-inhibit/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/subagents/[id]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/subagents/profiles/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/subagents/settings/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/events/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/terminal/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/tools/settings/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/web-auth/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/{layout-e538e5d308a97d51.js → layout-fd5067066c05f1c1.js} +1 -1
- package/.next/static/chunks/app/login/{page-7d17aa0961f2fcbe.js → page-699dd04274c6737c.js} +1 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/app/page-e2c75ffccae708f8.js +1131 -0
- package/.next/static/chunks/{main-app-4b56fc85be3f7823.js → main-app-03bab309386a7cee.js} +1 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-7b03c800e367b0e2.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ff5f37ea6085322e.js +1 -0
- package/.next/static/chunks/{webpack-b3e6fd1801874f85.js → webpack-95292085cd40fbc6.js} +1 -1
- package/.next/static/css/{bf49b4e87f26e436.css → 600a486e13adbe4a.css} +1 -1
- package/.next/static/css/dc78b381ecea7676.css +1 -0
- package/.next/static/css/f38e4e9c1d25d157.css +1 -0
- package/.next/trace +181 -58
- package/.next/trace-build +1 -1
- package/.next/types/app/api/agent/[id]/bash-output/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/events/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/lease/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/route.ts +1 -1
- package/.next/types/app/api/agent/debug/route.ts +355 -0
- package/.next/types/app/api/agent/new/route.ts +1 -1
- package/.next/types/app/api/agent/running/route.ts +1 -1
- package/.next/types/app/api/app-update/route.ts +1 -1
- package/.next/types/app/api/auth/api-key/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/login/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/logout/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/providers/route.ts +1 -1
- package/.next/types/app/api/cache-miss-notices/route.ts +1 -1
- package/.next/types/app/api/cwd/browse/route.ts +1 -1
- package/.next/types/app/api/cwd/pick/route.ts +1 -1
- package/.next/types/app/api/cwd/validate/route.ts +1 -1
- package/.next/types/app/api/default-cwd/route.ts +1 -1
- package/.next/types/app/api/file-index/route.ts +1 -1
- package/.next/types/app/api/files/[...path]/route.ts +1 -1
- package/.next/types/app/api/git/diff/route.ts +1 -1
- package/.next/types/app/api/git/status/route.ts +1 -1
- package/.next/types/app/api/home/route.ts +1 -1
- package/.next/types/app/api/mcp/route.ts +1 -1
- package/.next/types/app/api/mcp/sign-in/[flowId]/route.ts +1 -1
- package/.next/types/app/api/mcp/sign-in/route.ts +1 -1
- package/.next/types/app/api/mcp/test/route.ts +1 -1
- package/.next/types/app/api/models/default/route.ts +1 -1
- package/.next/types/app/api/models/enabled/route.ts +1 -1
- package/.next/types/app/api/models/refresh/route.ts +1 -1
- package/.next/types/app/api/models/route.ts +1 -1
- package/.next/types/app/api/models-config/catalog/route.ts +1 -1
- package/.next/types/app/api/models-config/discover/route.ts +1 -1
- package/.next/types/app/api/models-config/route.ts +1 -1
- package/.next/types/app/api/models-config/test/route.ts +1 -1
- package/.next/types/app/api/open-in-explorer/route.ts +1 -1
- package/.next/types/app/api/plugins/check/route.ts +1 -1
- package/.next/types/app/api/plugins/route.ts +1 -1
- package/.next/types/app/api/project-trust/route.ts +1 -1
- package/.next/types/app/api/provider-usage/query/route.ts +1 -1
- package/.next/types/app/api/push/config/route.ts +1 -1
- package/.next/types/app/api/push/subscribe/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/auto-name/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/context/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/entries/[entryId]/thinking/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/export/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/fork/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/state/route.ts +1 -1
- package/.next/types/app/api/sessions/delete/route.ts +1 -1
- package/.next/types/app/api/sessions/route.ts +1 -1
- package/.next/types/app/api/sessions/search/route.ts +1 -1
- package/.next/types/app/api/sessions/stats/route.ts +1 -1
- package/.next/types/app/api/sessions/ui-state/route.ts +1 -1
- package/.next/types/app/api/skills/check/route.ts +1 -1
- package/.next/types/app/api/skills/content/route.ts +1 -1
- package/.next/types/app/api/skills/install/route.ts +1 -1
- package/.next/types/app/api/skills/route.ts +1 -1
- package/.next/types/app/api/skills/search/route.ts +1 -1
- package/.next/types/app/api/skills/update/route.ts +1 -1
- package/.next/types/app/api/sleep-inhibit/route.ts +355 -0
- package/.next/types/app/api/subagents/[id]/route.ts +1 -1
- package/.next/types/app/api/subagents/profiles/route.ts +1 -1
- package/.next/types/app/api/subagents/settings/route.ts +1 -1
- package/.next/types/app/api/terminal/[id]/events/route.ts +1 -1
- package/.next/types/app/api/terminal/[id]/route.ts +1 -1
- package/.next/types/app/api/terminal/route.ts +1 -1
- package/.next/types/app/api/tools/settings/route.ts +1 -1
- package/.next/types/app/api/web-auth/route.ts +1 -1
- package/.next/types/app/api/worktrees/route.ts +1 -1
- package/.next/types/app/layout.ts +1 -1
- package/.next/types/app/login/page.ts +1 -1
- package/.next/types/app/page.ts +1 -1
- package/.next/types/routes.d.ts +3 -1
- package/.next/types/validator.ts +20 -0
- package/README.md +2 -1
- package/bin/browser-opener.js +44 -1
- package/bin/network-addresses.js +62 -0
- package/bin/pi-web.js +10 -2
- package/package.json +1 -1
- package/.next/server/chunks/4698.js +0 -1
- package/.next/server/chunks/5924.js +0 -1
- package/.next/server/chunks/7979.js +0 -1
- package/.next/static/-g1KUgp8qZzNmZ5_sTyxp/_buildManifest.js +0 -1
- package/.next/static/chunks/1278-d56768cd20f66ed4.js +0 -1
- package/.next/static/chunks/7379.49eae68e886f95ce.js +0 -3
- package/.next/static/chunks/app/_global-error/page-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/lease/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/app-update/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/cache-miss-notices/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/cwd/browse/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/cwd/pick/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/cwd/validate/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/home/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/mcp/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/mcp/sign-in/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/mcp/test/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models/default/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models/enabled/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models/refresh/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models-config/catalog/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/open-in-explorer/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/plugins/check/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/project-trust/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/provider-usage/query/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/push/config/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/push/subscribe/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/fork/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/state/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/delete/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/search/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/stats/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/sessions/ui-state/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/skills/content/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/skills/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/subagents/[id]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/subagents/profiles/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/subagents/settings/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/events/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/terminal/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/tools/settings/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/web-auth/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/app/page-ae6a7d3a5517d7e9.js +0 -286
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-064e367d6001dbac.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-5d60af35a4bb1818.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-5d60af35a4bb1818.js +0 -1
- package/.next/static/css/992381f1f993c50d.css +0 -1
- package/.next/static/css/e423cf64c3a31a65.css +0 -1
- /package/.next/static/{-g1KUgp8qZzNmZ5_sTyxp → SZGRKeK7Rp-GLXlZwXVpN}/_ssgManifest.js +0 -0
package/.next/types/validator.ts
CHANGED
|
@@ -126,6 +126,16 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
126
126
|
type __Unused = __Check
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// Validate ../../app/api/agent/debug/route.ts
|
|
130
|
+
{
|
|
131
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/agent/debug">> = Specific
|
|
132
|
+
const handler = {} as typeof import("../../app/api/agent/debug/route.js")
|
|
133
|
+
type __Check = __IsExpected<typeof handler>
|
|
134
|
+
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
type __Unused = __Check
|
|
137
|
+
}
|
|
138
|
+
|
|
129
139
|
// Validate ../../app/api/agent/new/route.ts
|
|
130
140
|
{
|
|
131
141
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/agent/new">> = Specific
|
|
@@ -676,6 +686,16 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
676
686
|
type __Unused = __Check
|
|
677
687
|
}
|
|
678
688
|
|
|
689
|
+
// Validate ../../app/api/sleep-inhibit/route.ts
|
|
690
|
+
{
|
|
691
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/sleep-inhibit">> = Specific
|
|
692
|
+
const handler = {} as typeof import("../../app/api/sleep-inhibit/route.js")
|
|
693
|
+
type __Check = __IsExpected<typeof handler>
|
|
694
|
+
|
|
695
|
+
// @ts-ignore
|
|
696
|
+
type __Unused = __Check
|
|
697
|
+
}
|
|
698
|
+
|
|
679
699
|
// Validate ../../app/api/subagents/[id]/route.ts
|
|
680
700
|
{
|
|
681
701
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/subagents/[id]">> = Specific
|
package/README.md
CHANGED
|
@@ -81,6 +81,7 @@ For port and hostname, command-line options override the corresponding environme
|
|
|
81
81
|
| `PI_WEB_PASSWORD` | Enable browser password login; API clients may use Basic Auth with username `pi` | Authentication disabled |
|
|
82
82
|
| `PI_WEB_IDLE_TIMEOUT_MS` | Session idle timeout in milliseconds, up to `2147483647`; `0` disables idle shutdown; invalid or out-of-range values use the default | `600000` (10 min) |
|
|
83
83
|
| `PI_WEB_SHUTDOWN_DEADLINE_MS` | How long extensions get to handle `session_shutdown` before a closing session is disposed anyway, in milliseconds up to `2147483647`; `0`, invalid or out-of-range values use the default | `5000` (5 s) |
|
|
84
|
+
| `PI_CODEMODE_MAX_WORKERS` | pi's limit on codemode scripts running at once, shared by every session and subagent in the server; pi's own default is `2`, and pi-web sets `8` when the variable is unset or empty. Each script may use up to 256 MB | `8` |
|
|
84
85
|
|
|
85
86
|
Set `PI_WEB_APP_NAME` before starting the server (for example, `PI_WEB_APP_NAME='Work Pi' pi-web`). After changing it, restart the server to serve the new manifest; no rebuild is required. Updates to the name of an already installed PWA are managed by the browser and are not guaranteed to appear immediately. This does not change the page title or icons.
|
|
86
87
|
|
|
@@ -128,7 +129,7 @@ npx @tasselx/pi-web@latest
|
|
|
128
129
|
- **Agent data**: Pi Web reads pi data from `~/.pi/agent` by default, including session files under `sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl`. Set `PI_CODING_AGENT_DIR` to use another pi agent directory.
|
|
129
130
|
- **Filesystem access**: Pi Web must be able to read the agent data directory and the working directories recorded by its sessions. Run Pi Web in the same filesystem environment as pi when sharing existing sessions.
|
|
130
131
|
- **Shared configuration**: the Models panel uses pi's model, settings, and credential storage, so changes are visible to both interfaces. An open session applies a saved edit of its model when you select the model again.
|
|
131
|
-
- **Code mode workers**: pi
|
|
132
|
+
- **Code mode workers**: pi's own limit is two sandbox workers at a time; Pi Web raises it to eight unless `PI_CODEMODE_MAX_WORKERS` is set. The workers are shared by every session and in-process subagent of the Pi Web server, and a further script waits up to 60 seconds for a free worker. To change the limit, set `PI_CODEMODE_MAX_WORKERS` to a whole number before starting Pi Web; each worker's script may use up to 256 MB.
|
|
132
133
|
- **File access boundary**: the file browser is limited to working directories selected in Pi Web and project or session roots it already knows about; it is not a general filesystem browser.
|
|
133
134
|
- **Git worktrees**: see [Worktrees in Pi Web](./docs/worktrees.md) for switcher visibility, worktree creation, and removal behavior.
|
|
134
135
|
|
package/bin/browser-opener.js
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
4
4
|
const { spawn } = require("child_process");
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
6
|
+
const { getOpenUrl } = require("./run-records");
|
|
7
|
+
|
|
8
|
+
// Next.js prints "Ready" before it has loaded its request handlers, and the
|
|
9
|
+
// first request then also waits out the pi SDK import that instrumentation
|
|
10
|
+
// starts (#964): half a second on macOS, seconds on a slow disk, and a first
|
|
11
|
+
// navigation that outlasts the service worker's 8 s timeout shows
|
|
12
|
+
// offline.html (#1358). Past this limit the browser opens anyway.
|
|
13
|
+
const FIRST_PAGE_TIMEOUT_MS = 30_000;
|
|
14
|
+
const FIRST_PAGE_RETRY_MS = 250;
|
|
5
15
|
|
|
6
16
|
function openInBrowser(url, platform = process.platform) {
|
|
7
17
|
// Avoid `shell: true` to suppress Node.js DEP0190 deprecation
|
|
@@ -31,4 +41,37 @@ function openInBrowser(url, platform = process.platform) {
|
|
|
31
41
|
opener.unref();
|
|
32
42
|
}
|
|
33
43
|
|
|
34
|
-
|
|
44
|
+
// Resolves true once url has answered a GET with any HTTP status and the whole
|
|
45
|
+
// body has arrived, or false when nothing answered within timeoutMs. Never
|
|
46
|
+
// rejects. Redirects are followed: with PI_WEB_PASSWORD, / redirects to /login,
|
|
47
|
+
// the page the browser lands on, and the proxy sends that redirect while the
|
|
48
|
+
// pi SDK import is still running.
|
|
49
|
+
async function waitForFirstPage(url, {
|
|
50
|
+
fetchImpl = fetch,
|
|
51
|
+
timeoutMs = FIRST_PAGE_TIMEOUT_MS,
|
|
52
|
+
retryMs = FIRST_PAGE_RETRY_MS,
|
|
53
|
+
} = {}) {
|
|
54
|
+
const deadline = AbortSignal.timeout(timeoutMs);
|
|
55
|
+
while (!deadline.aborted) {
|
|
56
|
+
try {
|
|
57
|
+
const response = await fetchImpl(url, { signal: deadline });
|
|
58
|
+
// The page has rendered once its body has arrived, not its headers.
|
|
59
|
+
await response.arrayBuffer();
|
|
60
|
+
return true;
|
|
61
|
+
} catch {
|
|
62
|
+
if (!deadline.aborted) await new Promise((resolve) => setTimeout(resolve, retryMs));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Opens the browser once the server has served its first page, so the
|
|
69
|
+
// browser's own first navigation finds the page route loaded. A wildcard bind
|
|
70
|
+
// is asked on loopback. Port 0 leaves the real port unknown, so that browser
|
|
71
|
+
// opens at once. The launcher exits with Next.js, which ends the wait too.
|
|
72
|
+
function openWhenServing({ hostname, port, url, open = openInBrowser, wait = waitForFirstPage }) {
|
|
73
|
+
const served = port === "0" ? Promise.resolve() : wait(`${getOpenUrl(hostname, port)}/`);
|
|
74
|
+
return served.then(() => open(url));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = { openInBrowser, openWhenServing, waitForFirstPage };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
4
|
+
const os = require("os");
|
|
5
|
+
|
|
6
|
+
const WILDCARD_HOSTNAMES = new Set(["0.0.0.0", "::", "[::]"]);
|
|
7
|
+
|
|
8
|
+
function isWildcardHostname(hostname) {
|
|
9
|
+
return WILDCARD_HOSTNAMES.has(hostname);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// An IPv6 wildcard listens dual-stack (Node's default, and Next passes no
|
|
13
|
+
// ipv6Only), so it answers on every IPv4 address too.
|
|
14
|
+
function addressFamilies(hostname) {
|
|
15
|
+
return hostname.includes(":") ? ["IPv4", "IPv6"] : ["IPv4"];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Addresses another machine can open when the server binds a wildcard address:
|
|
19
|
+
// the wildcard itself routes nowhere, so list this host's interfaces instead.
|
|
20
|
+
function getReachableAddresses(hostname, { interfaces = os.networkInterfaces() } = {}) {
|
|
21
|
+
if (!isWildcardHostname(hostname)) return [];
|
|
22
|
+
const addresses = [];
|
|
23
|
+
for (const family of addressFamilies(hostname)) {
|
|
24
|
+
for (const [name, entries] of Object.entries(interfaces)) {
|
|
25
|
+
for (const entry of entries ?? []) {
|
|
26
|
+
// `internal` covers loopback; a scoped IPv6 address (fe80::/10) needs a
|
|
27
|
+
// zone id, so it cannot be pasted into another machine's browser.
|
|
28
|
+
if (entry.family !== family || entry.internal || entry.scopeid) continue;
|
|
29
|
+
addresses.push({ name, address: entry.address });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return addresses;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function formatUrl(address, port) {
|
|
37
|
+
const host = address.includes(":") ? `[${address}]` : address;
|
|
38
|
+
return `http://${host}:${port}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// The startup block that names each interface and the URL it serves. Empty when
|
|
42
|
+
// there is nothing to add: a concrete bind address, port 0 (the OS picks one we
|
|
43
|
+
// never learn), or no address of the bound family.
|
|
44
|
+
function formatReachableAddresses(hostname, port, options) {
|
|
45
|
+
if (String(port) === "0") return "";
|
|
46
|
+
const addresses = getReachableAddresses(hostname, options);
|
|
47
|
+
if (addresses.length === 0) return "";
|
|
48
|
+
const width = Math.max(...addresses.map(({ name }) => name.length));
|
|
49
|
+
return [
|
|
50
|
+
"Reachable at:",
|
|
51
|
+
...addresses.map(
|
|
52
|
+
({ name, address }) => ` ${name.padEnd(width)} ${formatUrl(address, port)}`,
|
|
53
|
+
),
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = {
|
|
58
|
+
formatReachableAddresses,
|
|
59
|
+
formatUrl,
|
|
60
|
+
getReachableAddresses,
|
|
61
|
+
isWildcardHostname,
|
|
62
|
+
};
|
package/bin/pi-web.js
CHANGED
|
@@ -24,11 +24,13 @@ const { wireChildProcessLifecycle } = require("./process-lifecycle");
|
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
25
25
|
const { rotatePreviewSecrets, getRotationWarning } = require("./rotate-preview-secrets");
|
|
26
26
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
27
|
-
const {
|
|
27
|
+
const { openWhenServing } = require("./browser-opener");
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
29
29
|
const { createRunRecordTracker, getOpenUrl, getRunDir } = require("./run-records");
|
|
30
30
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
31
31
|
const { getPackageVersion, runCommand } = require("./pi-web-commands");
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
33
|
+
const { formatReachableAddresses } = require("./network-addresses");
|
|
32
34
|
|
|
33
35
|
let launchOptions;
|
|
34
36
|
try {
|
|
@@ -144,14 +146,20 @@ function startServer({ port, hostname, openBrowser }) {
|
|
|
144
146
|
|
|
145
147
|
let serverReady = false;
|
|
146
148
|
const url = `http://${hostname}:${port}`;
|
|
149
|
+
// Next.js repeats the `-H` value in its own "Network:" line, which a wildcard
|
|
150
|
+
// bind makes unusable; name the interfaces and their addresses instead.
|
|
151
|
+
const reachable = formatReachableAddresses(hostname, port);
|
|
147
152
|
|
|
148
153
|
child.stdout.on("data", (chunk) => {
|
|
149
154
|
const text = chunk.toString();
|
|
150
155
|
process.stdout.write(text);
|
|
151
156
|
if (!serverReady && text.includes("Ready")) {
|
|
152
157
|
serverReady = true;
|
|
158
|
+
if (reachable) process.stdout.write(`${reachable}\n`);
|
|
159
|
+
// The record needs no wait: status, stop and open list a record only
|
|
160
|
+
// once its URL answers. The browser waits for the first page.
|
|
153
161
|
if (port !== "0") runRecord.markReady();
|
|
154
|
-
if (openBrowser)
|
|
162
|
+
if (openBrowser) openWhenServing({ hostname, port, url });
|
|
155
163
|
}
|
|
156
164
|
});
|
|
157
165
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=4698,exports.ids=[4698],exports.modules={305:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Up:()=>n,dp:()=>m,e5:()=>k,wQ:()=>i});var e=c(10674),f=a([e]);e=(f.then?(await f)():f)[0];let o=["read","bash","edit","write"],p=new Set(["bash","powershell"]);function g(a,b=process.platform){return"win32"===b&&a?.includes("powershell")===!0&&!a.includes("bash")}function h(a,b){let c=b?"powershell":"bash",d=[];for(let b of a){let a=p.has(b)?c:b;d.includes(a)||d.push(a)}return d}function i(a,b,c=process.platform){return h(a,g(b,c))}function j(a){return a.startsWith("+")||a.startsWith("-")}function k(a){let b=a.filter(a=>!j(a)),c=b.length>0||0===a.length?b:[...o];for(let b of a){if(!j(b))continue;let a=b.slice(1),d=c.indexOf(a);b.startsWith("+")&&-1===d&&a?c.push(a):b.startsWith("-")&&-1!==d&&c.splice(d,1)}return c}function l(a){let b=(0,e.cj)(a);return void 0===b?void 0:k(b)}async function m(a=(0,e.WD)(void 0),b=process.platform){return(0,e.lz)(a,a=>g(l(a),b))}async function n(a,b=(0,e.WD)(void 0),c=process.platform){if("win32"!==c)throw Error("PowerShell tool settings are only available on Windows");return await (0,e.AC)(b,b=>{let c=l(b)??o,d=h(c,a);c.some(a=>p.has(a))||d.push(a?"powershell":"bash"),b.defaultTools=d}),a}d()}catch(a){d(a)}})},2650:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{B6:()=>A,Db:()=>x,M7:()=>y,Vq:()=>u,cu:()=>m,n7:()=>z,t1:()=>q});var e=c(76760),f=c(75430),g=c(99999),h=c(43084),i=c(49507),j=c(72498),k=c(37431),l=a([f,g,h,i,j]);[f,g,h,i,j]=l.then?(await l)():l;let A="PI_WEB_DISABLE_MCP";function m(a=process.env){let b=a[A]?.trim().toLowerCase();return void 0!==b&&""!==b&&"0"!==b&&"false"!==b}async function n(){let a;if(await (0,f.createCodemodeExtension)({models:!1})({registerTool:b=>{a=b},getSettings:()=>({}),getAllTools:()=>[],appendEntry:()=>{}}),!a)throw Error("the codemode extension registered no tool");return a}async function o(a={}){let b,c=a.timeoutMs??1e4,d=new AbortController,e=new Promise((a,e)=>{b=setTimeout(()=>{d.abort(),e(Error(`the sandbox did not answer within ${c} ms`))},c),b.unref?.()});try{let b=(async()=>{let b=await (a.createDefinition??n)();return await b.execute("pi-web-self-test",{code:"return 6 * 7"},d.signal,void 0,void 0)})();b.catch(()=>{});let c=await Promise.race([b,e]),f=(c.content??[]).flatMap(a=>"text"===a.type&&void 0!==a.text?[a.text]:[]);if(c.isError)return{available:!1,reason:`the self-test script failed: ${f.join(" ").trim()||"no output"}`};if(!f.some(a=>"42"===a.trim()))return{available:!1,reason:`the self-test script returned ${JSON.stringify(f.join(" ").trim())}`};return{available:!0}}catch(a){return{available:!1,reason:a instanceof Error?a.message:String(a)}}finally{clearTimeout(b)}}let B=Symbol.for("pi-web.codemodeSandbox");function p(){let a=globalThis;return a[B]??=o().then(a=>(a.available||console.warn(`[pi-web] Code mode is off: ${a.reason}`),a))}let C=Symbol("not settled");async function q(){let a=globalThis[B];if(!a)return{checked:!1};let b=await Promise.race([a,Promise.resolve(C)]);return b===C?{checked:!1}:{checked:!0,...b}}let D=Symbol.for("pi-web.mcpOffWarned");async function r(){let a=function(a,b=process.env){return m(b)?{available:!1,reason:`${A} is set`}:a.ok?{available:!0,internals:a}:{available:!1,reason:a.reason}}(await (0,i.U)()),b=globalThis;return a.available||m()||b[D]===a.reason||(b[D]=a.reason,console.warn(`[pi-web] MCP is off: ${a.reason}`)),a}let E=["codemode","tool-search","mcp"];function s(a,b){let c,d=(0,k.y)(a,b);if(void 0===d)return;try{c=JSON.parse(65279===d.charCodeAt(0)?d.slice(1):d)}catch{return}let e="object"==typeof c&&null!==c?c.extensions:void 0;return Array.isArray(e)?e.filter(a=>"string"==typeof a):void 0}async function t(a,b,c){let{agentDir:d,cwd:e,projectTrusted:g}=a,h=new f.DefaultPackageManager({cwd:e,agentDir:d,settingsManager:f.SettingsManager.fromStorage({withLock:(a,c)=>{let d=b[a];c(d?JSON.stringify({extensions:d}):void 0)}},{projectTrusted:g}),builtinExtensions:[...E]}),i=await h.resolve(async()=>"skip"),j={};for(let a of E){let b=i.extensions.find(b=>b.path===`builtin:${a}`),d=b?.enabled??!0;j[a]=d?{enabled:d}:{enabled:d,settingsPath:b?.metadata.scope==="project"?c.project:c.global}}return j}async function u(a){let{agentDir:b}=a,c=void 0!==a.cwd&&a.projectTrusted,d=a.cwd??b,g={global:(0,e.join)(b,"settings.json"),project:(0,e.join)(d,f.CONFIG_DIR_NAME,"settings.json")},h=s(g.global),i=c?s(g.project,k.T):void 0,j=await t({agentDir:b,cwd:d,projectTrusted:c},{global:h,project:i},g);if(void 0===i)return j;let l=await t({agentDir:b,cwd:d,projectTrusted:!1},{global:h},g);for(let a of E)j[a].global=l[a];return j}let F=()=>{};function v(a,b){return{name:a,factory:b,replaceable:!0,builtin:!0}}function w(a,b){let c=b.gate??((a,b)=>b),d=a.available?new g.nx({...b.mcpHost,agentDir:b.agentDir,internals:a.internals,codemodeAvailable:b.codemodeAvailable}):void 0,e=[v("tool-search",c("tool-search",(0,f.createToolSearchExtension)())),v("mcp",c("mcp",a.available&&d?(0,f.createMcpExtension)({loadConfig:function(a,b,c=a=>(0,j.n)(a,b)){return d=>{let e;try{e=a.loadMcpConfig({agentDir:b,cwd:d.cwd,projectTrusted:c(d.cwd)}).autoEnableCodemode}catch{}return{servers:[],errors:[],...void 0===e?{}:{autoEnableCodemode:e}}}}(a.internals,b.agentDir),createTransport:d.wrapTransportFactory((0,h.Pn)(a.internals)),startupWaitMs:0,openUrl:()=>{}}):F))];return d&&e.push(d.extension()),{extensions:e,mcpHost:d}}async function x(a){let b=await p();if(!b.available)throw Error(`Code mode is unavailable: ${b.reason}`);let c=(0,f.createCodemodeExtension)();return{name:"codemode",replaceable:!0,factory:async b=>{(await u({agentDir:a.agentDir,cwd:a.cwd,projectTrusted:a.projectTrusted()})).codemode.enabled&&await c(b)}}}async function y(a){return w(await r(),{agentDir:a.agentDir,codemodeAvailable:()=>a.codemode,...a.mcpHost?{mcpHost:a.mcpHost}:{},gate:(b,c)=>async d=>{(await u({agentDir:a.agentDir,cwd:a.cwd,projectTrusted:a.projectTrusted()}))[b].enabled&&await c(d)}})}async function z(a){let[b,c]=await Promise.all([p(),r()]),{extensions:d,mcpHost:e}=w(c,{agentDir:a.agentDir,codemodeAvailable:()=>b.available,...a.mcpHost?{mcpHost:a.mcpHost}:{}});return{extensions:[v("codemode",b.available?(0,f.createCodemodeExtension)():F),...d],mcpHost:e}}d()}catch(a){d(a)}})},10674:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{AC:()=>o,WD:()=>k,cj:()=>m,lz:()=>n});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=a([g]);function k(a=(0,g.getAgentDir)()){return(0,f.join)(a,"settings.json")}function l(a){if(!(0,e.existsSync)(a))return{};let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if(!("object"==typeof b&&null!==b&&!Array.isArray(b)))throw Error("Invalid settings.json: expected an object");return b}function m(a){if(void 0!==a.defaultTools){if(!Array.isArray(a.defaultTools)||a.defaultTools.some(a=>"string"!=typeof a))throw Error("Invalid settings.json: defaultTools must be an array of strings");return[...a.defaultTools]}}async function n(a,b){if(!(0,e.existsSync)(a))return b({});let c=await i().lock(a,{realpath:!1,retries:10});try{return b(l(a))}finally{await c()}}async function o(a,b){(0,e.mkdirSync)((0,f.dirname)(a),{recursive:!0});try{(0,e.writeFileSync)(a,"{}",{flag:"wx",mode:384})}catch(a){if("EEXIST"!==a.code)throw a}let c=await i().lock(a,{realpath:!1,retries:10});try{let c=l(a),d=b(c);return(0,e.writeFileSync)(a,JSON.stringify(c,null,2),"utf8"),(0,e.chmodSync)(a,384),d}finally{await c()}}g=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},11784:(a,b,c)=>{c.d(b,{Y:()=>e,y:()=>g});let d=/^Unexpected token '([\s\S])', ([\s\S]*) is not valid JSON$/;function e(a,b){let c,e,f,g=a instanceof Error?a.message:String(a);if(!g.includes('"'))return g;let h=d.exec(g);if(!h)return"Not valid JSON";let[,i,j]=h,k=i.charCodeAt(0),l=/[\p{L}\p{N}]/u.test(i)?"":/[\p{P}\p{S}]/u.test(i)?` '${i}'`:` U+${k.toString(16).toUpperCase().padStart(4,"0")}`,m=function(a,b,c){let d,e=c.startsWith('..."'),f=c.endsWith('"...'),g=c.slice(3*!!e,f?-3:void 0);if(g.length<2||!g.startsWith('"')||!g.endsWith('"')||!e&&!f)return;let h=g.slice(1,-1);if(e)if(f){for(d=a.indexOf(h);d>=0&&a[d+10]!==b;)d=a.indexOf(h,d+1);if(d<0)return;d+=10}else{if(!a.endsWith(h))return;d=a.length-h.length+10}else{if(!a.startsWith(h))return;d=h.length-10}return a[d]===b?d:void 0}(b,i,j);return`Unexpected token${l} in JSON${void 0===m?"":` ${e=(c=b.slice(0,m)).split("\n").length,f=m-c.lastIndexOf("\n"),`at position ${m} (line ${e} column ${f})`}`}`}let f=/is not valid JSON$/;function g(a,b){let c=b.map(a=>`${a}: `).find(b=>a.startsWith(b))??"",d=a.slice(c.length);return f.test(d)?`${c}${e(d,"")}`:a}},37431:(a,b,c)=>{c.d(b,{T:()=>f,y:()=>g});var d=c(73024);let e=d.constants.O_RDONLY|(d.constants.O_NONBLOCK||0),f=1048576;function g(a,b){let c;try{c=(0,d.openSync)(a,e)}catch(b){let a;if("ENOENT"===(a=b?.code)||"ENOTDIR"===a)return;throw b}try{let e=(0,d.fstatSync)(c);if(!e.isFile())throw Error(`${a} is not a regular file`);if(void 0===b)return(0,d.readFileSync)(c,"utf8");if(e.size>b)throw Error(`${a} is larger than ${b} bytes`);let f=b+1,g=[],h=0;for(;h<f;){let a=Buffer.alloc(Math.min(f-h,65536)),b=(0,d.readSync)(c,a,0,a.length,null);if(0===b)break;g.push(a.subarray(0,b)),h+=b}if(h>b)throw Error(`${a} is larger than ${b} bytes`);return Buffer.concat(g,h).toString("utf8")}finally{(0,d.closeSync)(c)}}},44088:(a,b,c)=>{c.d(b,{Ai:()=>g,Ll:()=>e,pM:()=>d,zT:()=>f});let d="builtin:mcp";function e(a){return"mcp"===a.name&&a.sourceInfo?.path===d}function f(a){return"prompt"!==a.source&&("mcp"===a.name||/^mcp:\d+$/.test(a.name))}function g(a,b){if(!a.startsWith("/"))return"wait";let c=a.indexOf(" "),d=-1===c?a.slice(1):a.slice(1,c),f=b.find(a=>a.name===d);return f?e(f)?"register":"none":"wait"}},49507:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{U:()=>p});var e=c(75430),f=c(73024),g=c(98995),h=c(76760),i=c(73136),j=a([e]);e=(j.then?(await j)():j)[0];let q="@earendil-works/pi-coding-agent",r="@earendil-works/pi-mcp",s={mcpExtension:"dist/extensions/mcp/index.js",mcpRuntime:"dist/extensions/mcp/runtime.js",mcpConfig:"dist/extensions/mcp/config.js",mcpOAuth:"dist/extensions/mcp/oauth.js",mcpServers:"dist/core/mcp-servers.js",configValues:"dist/core/resolve-config-value.js"},t={McpServerConnection:{module:"mcpRuntime",kind:"class"},createDefaultTransport:{module:"mcpRuntime",kind:"function"},StdioTransport:{module:"mcpClient",kind:"class"},loadMcpConfig:{module:"mcpConfig",kind:"function"},addMcpServerConfig:{module:"mcpConfig",kind:"function"},updateMcpServerConfig:{module:"mcpConfig",kind:"function"},removeMcpServerConfig:{module:"mcpConfig",kind:"function"},validateMcpServerConfig:{module:"mcpServers",kind:"function"},getMcpToolExposure:{module:"mcpServers",kind:"function"},signInMcpServer:{module:"mcpOAuth",kind:"function"},McpOAuthCredentialStore:{module:"mcpOAuth",kind:"class"},McpSignInCancelledError:{module:"mcpOAuth",kind:"class"},resolveConfigValueOrThrow:{module:"configValues",kind:"function"},resolveHeadersOrThrow:{module:"configValues",kind:"function"},getConfigValueEnvVarNames:{module:"configValues",kind:"function"},isCommandConfigValue:{module:"configValues",kind:"function"}};function k(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function l(a){return a instanceof Error?a.message:String(a)}async function m(a){return await import((0,i.pathToFileURL)(a).href)}let u=new Set(["node","import","module-sync","node-addons","default"]);async function n(a){let b=Object.fromEntries(Object.entries(s).map(([b,c])=>[b,(0,h.join)(a,c)]));try{b.mcpClient=function(a){let b=(0,i.pathToFileURL)((0,h.join)(a,s.mcpRuntime)).href,c=(0,g.findPackageJSON)(r,b);if(!c)throw Error(`cannot resolve ${r}`);let d=function(a){if(!k(a))return;let{exports:b}=a;return void 0===b?"string"==typeof a.main?a.main:"index.js":function a(b){if("string"==typeof b||null===b)return b;for(let c of Array.isArray(b)?b:k(b)?Object.entries(b).filter(([a])=>u.has(a)).map(([,a])=>a):[]){let b=a(c);if(void 0!==b)return b}}(k(b)&&"."in b?b["."]:b)??void 0}(JSON.parse((0,f.readFileSync)(c,"utf8")));if(!d)throw Error(`${c} declares no import entry`);return(0,h.join)(c,"..",d)}(a)}catch(a){return`${r}: ${l(a)}`}let c={};for(let[a,d]of Object.entries(b))try{c[a]=await m(d)}catch(a){return`cannot load ${d}: ${l(a)}`}return c}async function o(a={}){var b;let c,{environment:d=process.env,cwd:j=process.cwd()}=a;if(d.PI_PACKAGE_DIR)return{ok:!1,reason:`PI_PACKAGE_DIR is set; MCP support loads only from the ${q} that Pi Web runs`};try{c=(0,f.realpathSync)((0,e.getPackageDir)());let a=function(a){let b=(0,g.findPackageJSON)(q,(0,i.pathToFileURL)((0,h.join)(a,"package.json")).href);if(!b)throw Error(`cannot resolve ${q} from ${a}`);return(0,f.realpathSync)((0,h.join)(b,".."))}(j);if(b=c,"win32"===process.platform?b.toLowerCase()!==a.toLowerCase():b!==a)return{ok:!1,reason:`${q} at ${c} is not the package Pi Web resolves (${a})`}}catch(a){return{ok:!1,reason:`cannot locate ${q}: ${l(a)}`}}let k=await n(c);if("string"==typeof k)return{ok:!1,reason:k};if(k.mcpExtension.createMcpExtension!==e.createMcpExtension)return{ok:!1,reason:`${s.mcpExtension} loaded as a second copy of ${q}`};let m=function(a){let b={};for(let[c,{module:d,kind:e}]of Object.entries(t)){let f=a[d][c];if("class"===e?!("function"==typeof f&&/^class[\s{]/.test(Function.prototype.toString.call(f))):"function"!=typeof f){let a="mcpClient"===d?r:s[d];return`${a} does not export ${c} as a ${e}`}b[c]=f}return b}(k);if("string"==typeof m)return{ok:!1,reason:m};let p={packageDir:c,...m};try{if(!(p.createDefaultTransport({name:"pi-web-probe",config:{command:"pi-web-probe"},source:"pi-web"},p.packageDir,void 0)instanceof p.StdioTransport))return{ok:!1,reason:`${r} resolved to another copy than ${s.mcpRuntime} uses`}}catch(a){return{ok:!1,reason:`${s.mcpRuntime}: ${l(a)}`}}return{ok:!0,...p}}let v=Symbol.for("pi-web.piSdkInternals");function p(){let a=globalThis;return a[v]??=o().catch(a=>({ok:!1,reason:l(a)}))}d()}catch(a){d(a)}})},76609:(a,b,c)=>{c.d(b,{U2:()=>i,dj:()=>f,qu:()=>h});var d=c(77598);function e(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function f(a,b=0){return Array.isArray(a)||e(a)?b>=64?"<too deep>":Array.isArray(a)?`[${a.map(a=>f(a,b+1)).join(",")}]`:`{${Object.keys(a).sort().map(c=>`${JSON.stringify(c)}:${f(a[c],b+1)}`).join(",")}}`:JSON.stringify(a)??"null"}let g=Symbol.for("pi-web:mcp-config-key-secret");function h(a){let b=globalThis,c=b[g]??=(0,d.randomBytes)(32);return(0,d.createHmac)("sha256",c).update(f(a)).digest("base64url")}function i(a,b){return h(e(b)?b:a)}},85825:(a,b,c)=>{c.d(b,{lW:()=>d,vN:()=>e,vR:()=>f});let d=["enabled","exposure","toolExposure"];function e(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)&&void 0===a.command&&void 0===a.url&&void 0===a.type}function f(a,b,c){return c?Object.keys(b).some(a=>!d.includes(a))?`server "${a}": an override can only set ${d.join(", ")}`:void 0:`server "${a}" needs "command" or "url", or a global server to override`}},99999:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{nx:()=>D});var e=c(73024),f=c(76760),g=c(75430),h=c(44088),i=c(76609),j=c(11784),k=c(85825),l=c(66479),m=c(23757),n=c(82536),o=c(72498),p=a([g,m,o]);[g,m,o]=p.then?(await p)():p;let w=new Set(["tools/list"]);function q(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function r(a){return a instanceof Error?a.message:String(a)}let x=Symbol.for("pi-web:mcp-config-errors-logged");function s(a){let b=globalThis,c=b[x]??=new Set;c.has(a)||(c.size>=200&&c.delete(c.values().next().value),c.add(a),console.warn(`[pi-web] MCP config: ${a}`))}let y=e.constants.O_RDONLY|(e.constants.O_NONBLOCK||0)|(e.constants.O_NOFOLLOW||0);function t(a){return a instanceof Error?a.name:void 0}let z={connecting:"connecting",ready:"connected",failed:"failed","needs-auth":"needs-auth",disconnected:"disconnected"};class A{constructor(a,b,c,d){this.configKey=a,this.scope=b,this.target=c,this.started=!1,this.settled=!1,this.waited=!1,this.released=!1,this.state="connecting",this.startedListeners=new Set,this.settledListeners=new Set,this.declaresTools=(d.exposure??"codemode")==="direct"||Object.values(d.toolExposure??{}).includes("direct")}markStarted(){if(!this.started){for(let a of(this.started=!0,this.startedListeners))a();this.startedListeners.clear()}}update(a,b={}){if(this.state=a,this.error=b.error,this.stderr=b.stderr,"connecting"!==a&&!this.settled){for(let a of(this.settled=!0,this.markStarted(),this.settledListeners))a();this.settledListeners.clear()}}whenStarted(){return this.started?Promise.resolve():new Promise(a=>this.startedListeners.add(a))}whenSettled(){return this.settled?Promise.resolve():new Promise(a=>this.settledListeners.add(a))}}let B=/is already registered by extension "(.+)"$/;function u(a){try{return a.sessionManager?.getSessionId()??""}catch{return""}}function v(a){let b;return{promise:new Promise(c=>{b=setTimeout(c,a),b.unref?.()}),cancel:()=>clearTimeout(b)}}class C{constructor(a,b){this.pi=a,this.options=b,this.active=!1,this.disposed=!1,this.attempts=new Map,this.abandoned=new Map,this.problems=new Map,this.problemReports=new Map,this.queue=Promise.resolve(),this.runActive=!1,this.preparing=0,this.isCommandValue=a=>this.options.internals.isCommandConfigValue?.(a)??a.startsWith("!"),a.on("session_start",(b,c)=>{if(this.disposed)return;this.ctx=c;let d=a.getCommands().filter(h.zT);this.active=d.some(h.Ll),this.reportActivity(c,this.active?void 0:d[0]?.sourceInfo?.path)}),a.on("before_agent_start",()=>{this.clearIdle(),this.sync()}),a.on("agent_start",()=>{this.runActive=!0,this.clearIdle()}),a.on("agent_end",()=>{this.runActive=!1,this.armIdle()}),a.on("session_shutdown",()=>{this.dispose()})}attemptFor(a){let b=this.attempts.get(a.name);return b&&!b.released&&b.configKey===(0,i.dj)(a.config)?b:void 0}refuseAbandoned(a){let b=`${a.name}\0${(0,i.dj)(a.config)}`,c=this.abandoned.get(b);return!!c&&(c>1?this.abandoned.set(b,c-1):this.abandoned.delete(b),console.warn(`[pi-web] MCP server "${a.name}" was unregistered before its connection opened; its transport is refused`),!0)}transportFailed(a,b,c){a.current=void 0;let d=(0,m.fR)(b.config,[],{isCommandConfigValue:this.isCommandValue});this.update(a,"failed",{error:(0,m.lL)(r(c),d)})}watch(a,b,c,d){let e;a.markStarted(),a.current=c,this.update(a,"connecting");let f=a=>(e??=(0,m.fR)(b.config,[c],{isCommandConfigValue:this.isCommandValue}))(a),g=a=>void 0===a?{}:{stderr:(0,m.zE)(a,f)};!function(a,b,c){var d;let e,f,g,h,i,j,k,l,m,n,o=!1,p=!1,r=!1,s=a=>{let c;"McpOAuthAuthorizationRequiredError"===(c=t(a))||b&&"McpAuthRequiredError"===c?p=!0:void 0===m&&"McpConnectionClosedError"!==t(a)&&(m=a)},u=()=>{let b="string"==typeof a.stderr?a.stderr.trim():"";return b?{stderr:b}:{}};if(d=a=>{"ready"===a?(o=!0,c({type:"ready"})):c({type:"failed",authRequired:p,...void 0===m?{}:{error:m},...u()})},f=!1,g=!1,h=0,i=new Set,j=a=>{f||(f=!0,d(a))},k=()=>{setImmediate(()=>{f||!g||void 0===e||i.size>0||e&&0===h||j("ready")})},l=a.send.bind(a),a.send=a=>(q(a)&&"string"==typeof a.method&&(void 0!==a.id&&w.has(a.method)?(i.add(a.id),h+=1):void 0===a.id&&"notifications/initialized"===a.method&&(g=!0,k())),l(a)),a.onMessage(a=>{if(q(a)&&void 0===a.method&&void 0!==a.id){if(void 0===e&&q(a.result)&&q(a.result.capabilities)){let{capabilities:b}=a.result;e=!!b.tools,k();return}i.delete(a.id)&&k()}}),a.onClose(()=>j("closed")),"function"==typeof a.start){let b=a.start;a.start=()=>b.call(a).catch(a=>{throw s(a),a})}let v=a.send;if(a.send=b=>(q(b)&&"initialize"===b.method&&void 0!==b.id&&(n=b.id),v.call(a,b).catch(a=>{throw s(a),a})),"function"==typeof a.close){let b=a.close;a.close=()=>(r=!0,b.call(a))}a.onMessage(a=>{void 0===m&&void 0!==n&&q(a)&&a.id===n&&q(a.error)&&"string"==typeof a.error.message&&(m=a.error.message)}),a.onClose(()=>{o&&c({type:"closed",dropped:!r,authRequired:p,...u()})})}(c,d,b=>{if(a.current===c)if("ready"===b.type)this.update(a,"ready");else if("failed"===b.type)if(b.authRequired)this.update(a,"needs-auth");else{let c=void 0===b.error?"The connection closed before the server was ready":r(b.error);this.update(a,"failed",{error:(0,m.lL)(c,f),...g(b.stderr)})}else b.authRequired?this.update(a,"needs-auth"):b.dropped&&this.update(a,"disconnected",g(b.stderr))})}sync(){let a=this.enqueue(async()=>{if(!this.active||!this.ctx)return;let a=this.desiredServers(this.ctx);for(let[b,c]of[...this.attempts]){let d=a.get(b);d&&(0,i.dj)(d.config)===c.configKey||await this.unregister(b)}for(let[b,c]of a)this.attempts.has(b)||this.register(b,c);this.reportProblems()});return a.then(()=>this.armIdle()),a}async prepareForPrompt(a,b){this.clearIdle(),this.runActive=!1,this.preparing+=1;try{await this.waitForServers(a,b)}finally{this.preparing-=1,this.armIdle()}}async waitForServers(a,b){let c=a.aborted?Promise.resolve():new Promise(b=>a.addEventListener("abort",()=>b(),{once:!0}));if(await Promise.race([this.sync(),c]),a.aborted||!b)return;let d=[...this.attempts.values()].filter(a=>a.declaresTools&&!a.settled&&!a.waited);if(0===d.length)return;let e=v(this.options.promptWaitMs),f=await Promise.race([Promise.all(d.map(a=>a.whenSettled())).then(()=>!1),e.promise.then(()=>!0),c.then(()=>!1)]);if(e.cancel(),f)for(let a of d)a.waited=!0}serverStates(){let a=[...this.problems.values()].map(a=>a.status);for(let[b,c]of this.attempts)a.push({name:b,scope:c.scope,state:c.state,...c.error?{error:c.error}:{},...c.stderr?{stderr:c.stderr}:{}});return a.sort((a,b)=>a.name.localeCompare(b.name)||a.scope.localeCompare(b.scope))}release(){return this.enqueue(async()=>{for(let a of[...this.attempts.keys()])await this.unregister(a)})}dispose(){this.disposed=!0,this.active=!1,this.clearIdle(),this.letGoOfAll(),this.reportActivity(void 0,void 0)}entryConfigKey(a,b){return(0,i.U2)(b,this.options.internals.validateMcpServerConfig?.(a,b))}projectEntryConfigKey(a,b,c){return q(b)&&(0,k.vN)(b)&&void 0===(0,k.vR)(a,b,void 0!==c)?this.entryConfigKey(a,{...c,...b}):this.entryConfigKey(a,b)}write(a,b){let c=this.ctx;if(!c)return;let d={origin:"session",state:b.state,sessionId:u(c),cwd:c.cwd,updatedAt:Date.now(),...b.error?{error:b.error}:{},...b.stderr?{stderr:b.stderr}:{},...b.conflict?{conflict:b.conflict}:{}};return(0,l.kY)(a,a.configKey,d),d}update(a,b,c={}){a.update(b,c),a.released||(a.recorded=this.write(a.target,{state:z[b],...c}))}letGo(a){a.released=!0;let{target:b,recorded:c}=a;c&&("connecting"===a.state?(0,l.My)(b,b.configKey,c):"ready"===a.state&&(0,l.vU)(b,b.configKey,c,{...c,closedAt:Date.now()}))}letGoOfAll(){for(let a of this.attempts.values())this.letGo(a);for(let{target:a,status:b}of this.problemReports.values())(0,l.My)(a,a.configKey,b);this.problemReports.clear()}reportProblems(){let a=new Set;for(let{target:b,report:c}of this.problems.values()){let d=(0,l.wf)(b);a.add(d);let e=[b.configKey,c.state,c.conflict??"",c.error??""].join("\0"),f=this.problemReports.get(d);if(f?.signature===e&&(0,l.Wu)(b,b.configKey,f.status))continue;let g=this.write(b,c);g&&this.problemReports.set(d,{signature:e,target:b,status:g})}for(let b of[...this.problemReports.keys()])a.has(b)||this.problemReports.delete(b)}reportActivity(a,b){if(this.inactiveReport&&(0,l.jQ)(this.inactiveReport.sessionId,this.inactiveReport.info),this.inactiveReport=void 0,!a)return;let c=u(a);if(!b)return void(0,l.jQ)(c);let d={owner:b,cwd:a.cwd,updatedAt:Date.now()};(0,l.Te)(c,d),this.inactiveReport={sessionId:c,info:d}}enqueue(a){let b=this.queue.then(a);return this.queue=b.catch(a=>{console.error("[pi-web] MCP host operation failed:",r(a))}),this.queue}desiredServers(a){let b;this.problems=new Map;let c=new Map,d=this.options.mayReadProjectConfig(a.cwd);try{b=this.options.internals.loadMcpConfig({agentDir:this.options.agentDir,cwd:a.cwd,projectTrusted:d})}catch(a){s(`cannot read mcp.json: ${r(a)}`)}let h=(0,f.join)(a.cwd,g.CONFIG_DIR_NAME,"mcp.json");if(!d){let c=function(a){let b,c=(0,f.join)(a,g.CONFIG_DIR_NAME,"mcp.json");try{if((0,n.TU)(c))return[];let d=(0,e.realpathSync)(c);if(!(0,n.o4)(d,(0,n.qy)(new Set([a]))))return[];b=(0,e.openSync)(d,y);let f=(0,e.fstatSync)(b);if(!f.isFile()||f.size>1048576)return[];let g=Buffer.alloc(f.size+1),h=0;for(;h<g.length;){let a=(0,e.readSync)(b,g,h,g.length-h,null);if(0===a)break;h+=a}if(h>f.size)return[];let i=JSON.parse(g.toString("utf8",0,h));return q(i)&&q(i.mcpServers)?Object.entries(i.mcpServers):[]}catch{return[]}finally{void 0!==b&&(0,e.closeSync)(b)}}(a.cwd),d=new Map((b?.servers??[]).map(a=>[a.name,a.config]));for(let[a,b]of c.slice(0,100))try{this.problems.set(`project\0${a}`,{status:{name:a,scope:"project",state:"not-trusted"},target:{scope:"project",sourcePath:h,name:a,configKey:this.projectEntryConfigKey(a,b,d.get(a))},report:{state:"not-trusted"}})}catch(b){s(`${h}: server "${a}" is not reported: ${r(b)}`)}c.length>100&&s(`${h}: ${c.length-100} more servers of this untrusted project are not reported`)}if(!b)return c;let k=[(0,f.join)(this.options.agentDir,"mcp.json"),h];for(let a of b.errors.slice(0,20))s((0,j.y)(a,k));for(let a of(b.errors.length>20&&s(`${b.errors.length-20} more errors in mcp.json are not logged`),b.servers)){if(!1===a.config.enabled)continue;let b=a.override,d="project"===a.scope||void 0!==b?"project":"global";try{c.set(a.name,{config:function(a,b){if(b)return a;let c=a=>"codemode"===a?"deferred":a,d=a.toolExposure?Object.fromEntries(Object.entries(a.toolExposure).map(([a,b])=>[a,c(b)])):void 0;return{...a,exposure:c(a.exposure??"codemode"),...d?{toolExposure:d}:{}}}(a.config,this.options.codemodeAvailable()),scope:d,target:{scope:d,sourcePath:b??a.source,name:a.name,configKey:(0,i.qu)(a.config)}})}catch(b){s(`${a.source}: server "${a.name}" is not connected: ${r(b)}`)}}return c}register(a,b){let{config:c,scope:d,target:e}=b,f=new A((0,i.dj)(c),d,e,c);this.attempts.set(a,f);try{this.pi.registerMcpServer(a,c)}catch(h){this.attempts.delete(a);let b=r(h),f=this.registeredOwner(a)??B.exec(b)?.[1],g=(0,m.fR)(c,[],{isCommandConfigValue:this.isCommandValue});this.problems.set(`${d}\0${a}`,{status:{name:a,scope:d,state:"not-registered",error:b,...f?{conflict:f}:{}},target:e,report:f?{state:"conflict",conflict:f}:{state:"failed",error:(0,m.lL)(b,g)}})}}registeredOwner(a){try{return this.pi.getMcpServers?.().find(b=>b.name===a)?.extensionPath}catch{return}}async unregister(a){let b=this.attempts.get(a);if(b&&!b.started){let a=v(this.options.replaceWaitMs);await Promise.race([b.whenStarted(),a.promise]),a.cancel()}if(this.attempts.delete(a),b&&!b.started){let c=`${a}\0${b.configKey}`;this.abandoned.set(c,(this.abandoned.get(c)??0)+1)}b&&this.letGo(b);try{this.pi.unregisterMcpServer(a)}catch(b){console.error(`[pi-web] cannot unregister MCP server "${a}":`,r(b))}}clearIdle(){clearTimeout(this.idleTimer),this.idleTimer=void 0}armIdle(){this.clearIdle(),this.runActive||this.preparing>0||this.options.idleMs<=0||0===this.attempts.size||(this.idleTimer=setTimeout(()=>{this.idleTimer=void 0,(!this.ctx||this.ctx.isIdle())&&this.release()},this.options.idleMs),this.idleTimer.unref?.())}}class D{constructor(a){this.options={idleMs:function(a=process.env.PI_WEB_MCP_IDLE_MS){if(void 0!==a&&""!==a.trim()){let b=Number(a);if(Number.isFinite(b)&&b>=0&&b<=0x7fffffff)return b;console.warn(`[pi-web] invalid PI_WEB_MCP_IDLE_MS "${a}", falling back to 10 minutes`)}return 6e5}(),promptWaitMs:1e4,replaceWaitMs:5e3,...a,mayReadProjectConfig:a.mayReadProjectConfig??(b=>(0,o.n)(b,a.agentDir))}}extension(){return{name:"pi-web-mcp-host",hidden:!0,factory:a=>{this.current?.dispose(),this.current=new C(a,this.options)}}}wrapTransportFactory(a){return(b,c,d)=>{let e,f=this.current,g=f?.attemptFor(b);if(!g&&f?.refuseAbandoned(b))throw Error(`MCP server "${b.name}" was removed before it connected, so Pi Web did not start it`);try{e=a(b,c,d)}catch(a){throw f&&g&&f.transportFailed(g,b,a),a}return f&&g&&f.watch(g,b,e,void 0!==d),e}}dispose(){this.current?.dispose()}prepareForPrompt(a,b={}){return this.current?.prepareForPrompt(a,b.wait??!0)??Promise.resolve()}serverStates(){return this.current?.serverStates()??[]}release(){return this.current?.release()??Promise.resolve()}}d()}catch(a){d(a)}})}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=5924,exports.ids=[5924],exports.modules={45924:(a,b,c)=>{c.d(b,{registerNodeInstrumentation:()=>t});var d=c(78474),e=c(48161),f=c(76760),g=c(73136),h=c(9956),i=c(73024);let j=i.constants.O_RDONLY|(i.constants.O_NONBLOCK||0),k=globalThis,l=globalThis.fetch,m=()=>{};function n(a){if("string"==typeof a){let b=a.trim();if("disabled"===b.toLowerCase())return 0;if(0===b.length)return;return n(Number(b))}if("number"==typeof a&&Number.isFinite(a)&&!(a<0))return Math.floor(a)}function o(a){return a instanceof d.EventEmitter&&d.EventEmitter.prototype.on.call(a,"error",m),a}function p(a,b){return o(new h.Client(a,b))}function q(a,b){return 1===b.connections?p(a,b):o(new h.Pool(a,{...b,factory:p}))}let r=Symbol.for("pi-web.agentEventStreamClosers"),s=globalThis[r]??=new Set;function t(){!function(a=3e5){if(k.__piWebHttpDispatcherConfigured)return;let b=n(a);if(void 0===b)throw Error(`Invalid HTTP idle timeout: ${String(a)}`);let c=o(new h.EnvHttpProxyAgent({allowH2:!1,proxyTunnel:!0,bodyTimeout:b,connect:{autoSelectFamilyAttemptTimeout:2e3},headersTimeout:b,clientFactory:p,factory:q}));h.setGlobalDispatcher(c),globalThis.fetch===l&&h.install?.(),k.__piWebHttpDispatcherConfigured=!0}(function(a=function(){let a=process.env.PI_CODING_AGENT_DIR;return a?("win32"===process.platform&&(a=function(a){if(!a.startsWith("/")||a.startsWith("//")||a.includes("\\"))return a;let b=a.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);return b?`${b[1].toUpperCase()}:\\${b[2]?.replaceAll("/","\\")??""}`:a}(a)),"~"===a)?(0,e.homedir)():a.startsWith("~/")||"win32"===process.platform&&a.startsWith("~\\")?(0,f.join)((0,e.homedir)(),a.slice(2)):/^file:\/\//.test(a)?(0,g.fileURLToPath)(a):a:(0,f.join)((0,e.homedir)(),".pi","agent")}()){let b,c;try{b=function(a){let b;try{b=(0,i.openSync)(a,j)}catch(b){let a;if("ENOENT"===(a=b?.code)||"ENOTDIR"===a)return;throw b}try{if(!(0,i.fstatSync)(b).isFile())throw Error(`${a} is not a regular file`);return(0,i.readFileSync)(b,"utf8")}finally{(0,i.closeSync)(b)}}((0,f.join)(a,"settings.json"))}catch{return}if(void 0!==b){try{c=JSON.parse(65279===b.charCodeAt(0)?b.slice(1):b)}catch{return}if("object"==typeof c&&null!==c)return n(c.httpIdleTimeoutMs)}}());let a=()=>(function(){for(let a of[...s])try{a("error")}catch{}})();process.on("SIGINT",a),process.on("SIGTERM",a),Promise.resolve().then(c.bind(c,75430)).catch(()=>{})}}};
|