@rexvane/piweb 0.3.25 → 0.3.26
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 +6 -5
- package/.next/build-manifest.json +4 -4
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +4 -4
- package/.next/react-loadable-manifest.json +14 -26
- package/.next/required-server-files.js +26 -26
- package/.next/required-server-files.json +26 -26
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- 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.js.nft.json +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 +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- 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]/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/[id]/tree/route.js +1 -1
- package/.next/server/app/api/agent/[id]/tree/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/tree/route_client-reference-manifest.js +1 -1
- 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/resources/route.js +1 -0
- package/.next/server/app/api/agent/resources/route.js.nft.json +1 -0
- package/.next/server/app/api/agent/resources/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/config/route.js +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/files/route.js +1 -1
- package/.next/server/app/api/files/route.js.nft.json +1 -1
- package/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/route.js +1 -1
- package/.next/server/app/api/fs/route.js.nft.json +1 -1
- package/.next/server/app/api/fs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/route.js +4 -4
- package/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/github/route.js +4 -4
- package/.next/server/app/api/github/route.js.nft.json +1 -1
- package/.next/server/app/api/github/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/growth/route.js +1 -1
- package/.next/server/app/api/growth/route.js.nft.json +1 -1
- package/.next/server/app/api/growth/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/health/route.js +1 -1
- package/.next/server/app/api/health/route.js.nft.json +1 -1
- package/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/defaults/route.js +1 -1
- package/.next/server/app/api/models/defaults/route.js.nft.json +1 -1
- package/.next/server/app/api/models/defaults/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models/route.js.nft.json +1 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/pi-settings/route.js +1 -1
- package/.next/server/app/api/pi-settings/route.js.nft.json +1 -1
- package/.next/server/app/api/pi-settings/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/prompts/route.js +1 -1
- package/.next/server/app/api/prompts/route.js.nft.json +1 -1
- package/.next/server/app/api/prompts/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/route.js +2 -2
- package/.next/server/app/api/remote/route.js.nft.json +1 -1
- package/.next/server/app/api/remote/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/security/route.js +1 -1
- package/.next/server/app/api/security/route.js.nft.json +1 -1
- package/.next/server/app/api/security/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/export/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/import/route.js +2 -2
- package/.next/server/app/api/sessions/import/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/import/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/skills/route.js +2 -2
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/update/route.js +2 -2
- package/.next/server/app/api/update/route.js.nft.json +1 -1
- package/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/web-auth/route.js +2 -2
- package/.next/server/app/api/web-auth/route.js.nft.json +1 -1
- package/.next/server/app/api/web-auth/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspaces/route.js +1 -1
- package/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/.next/server/app/api/workspaces/route_client-reference-manifest.js +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/icon.svg/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +5 -5
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- 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 +4 -4
- package/.next/server/app/login.segments/_full.segment.rsc +4 -4
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/page.js +1 -1
- 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 +6 -5
- package/.next/server/chunks/{813.js → 1813.js} +1 -1
- package/.next/server/chunks/{430.js → 2430.js} +5 -5
- package/.next/server/chunks/{970.js → 2970.js} +1 -1
- package/.next/server/chunks/3924.js +6 -0
- package/.next/server/chunks/4807.js +1 -0
- package/.next/server/chunks/5393.js +1 -0
- package/.next/server/chunks/5802.js +2 -0
- package/.next/server/chunks/620.js +1 -1
- package/.next/server/chunks/6229.js +1 -0
- package/.next/server/chunks/7496.js +1 -0
- package/.next/server/chunks/7662.js +2 -0
- package/.next/server/chunks/8686.js +1 -0
- package/.next/server/chunks/{593.js → 974.js} +1 -1
- package/.next/server/chunks/{920.js → 9920.js} +1 -1
- 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 +5 -5
- 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/server/webpack-runtime.js +1 -1
- package/.next/static/QJCtqgDKzGS2BdKABd9ch/_buildManifest.js +1 -0
- package/.next/static/chunks/2577.86c8538fbf05a8b2.js +1 -0
- package/.next/static/chunks/2716.fa561519675a3ff1.js +1 -0
- package/.next/static/chunks/2906.8a0e09bb47605cf1.js +1 -0
- package/.next/static/chunks/4673.ea36e55005c0f82f.js +1 -0
- package/.next/static/chunks/4686-4dc565817a160351.js +1 -0
- package/.next/static/chunks/4778.0d2c5d75b791d352.js +1 -0
- package/.next/static/chunks/app/_global-error/page-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/_not-found/page-2d40d1d7d916666a.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/tree/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/agent/resources/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/config/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/files/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/fs/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/git/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/github/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/growth/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/health/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/models/defaults/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/models/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/pi-settings/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/prompts/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/remote/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/security/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/sessions/import/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/skills/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/update/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/version/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/web-auth/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/api/workspaces/route-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/app/{layout-7f64fa67ea6ce980.js → layout-50d06e2078d6ce76.js} +1 -1
- package/.next/static/chunks/app/login/{page-00dbd2f395b364d5.js → page-5e276a1eeb8867df.js} +1 -1
- package/.next/static/chunks/app/page-71f2d3b3ed864b3d.js +1 -0
- package/.next/static/chunks/main-5403f0764579e5fe.js +5 -0
- package/.next/static/chunks/{main-app-56863ace24eb152f.js → main-app-e9b53f0e1c6591b2.js} +1 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-a7e260f8cc2582d7.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f2d93969c0bcf406.js +1 -0
- package/.next/static/chunks/webpack-ffc09b5fcc8aaa6d.js +1 -0
- package/.next/static/css/7e3caf797e4cb19a.css +1 -0
- package/.next/types/app/api/agent/[id]/events/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/tree/route.ts +1 -1
- package/.next/types/app/api/agent/new/route.ts +1 -1
- package/.next/types/app/api/agent/resources/route.ts +355 -0
- package/.next/types/app/api/config/route.ts +1 -1
- package/.next/types/app/api/files/route.ts +1 -1
- package/.next/types/app/api/fs/route.ts +1 -1
- package/.next/types/app/api/git/route.ts +1 -1
- package/.next/types/app/api/github/route.ts +1 -1
- package/.next/types/app/api/growth/route.ts +1 -1
- package/.next/types/app/api/health/route.ts +1 -1
- package/.next/types/app/api/models/defaults/route.ts +1 -1
- package/.next/types/app/api/models/route.ts +1 -1
- package/.next/types/app/api/pi-settings/route.ts +1 -1
- package/.next/types/app/api/plugins/route.ts +1 -1
- package/.next/types/app/api/prompts/route.ts +1 -1
- package/.next/types/app/api/remote/route.ts +1 -1
- package/.next/types/app/api/security/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/export/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/route.ts +1 -1
- package/.next/types/app/api/sessions/import/route.ts +1 -1
- package/.next/types/app/api/sessions/route.ts +1 -1
- package/.next/types/app/api/skills/route.ts +1 -1
- package/.next/types/app/api/update/route.ts +1 -1
- package/.next/types/app/api/version/route.ts +1 -1
- package/.next/types/app/api/web-auth/route.ts +1 -1
- package/.next/types/app/api/workspaces/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 +2 -1
- package/.next/types/validator.ts +10 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/bin/pi.js +0 -0
- package/bin/piweb.js +0 -0
- package/package.json +1 -1
- package/scripts/build-output.mjs +0 -0
- package/scripts/dev.mjs +0 -0
- package/scripts/entrypoint.mjs +0 -0
- package/scripts/install-build.mjs +0 -0
- package/scripts/launcher.mjs +0 -0
- package/scripts/pick-folder.ps1 +0 -0
- package/scripts/postinstall.mjs +0 -0
- package/scripts/process-runner.mjs +0 -0
- package/scripts/release.mjs +0 -0
- package/scripts/sync-file-icons.mjs +0 -0
- package/scripts/sync-provider-icons.mjs +0 -0
- package/src/app/api/agent/resources/route.ts +18 -0
- package/src/app/api/remote/route.ts +5 -7
- package/src/app/api/sessions/[id]/export/route.ts +3 -1
- package/src/app/globals.css +16 -0
- package/src/components/AppShell.tsx +68 -21
- package/src/components/ChatInput.tsx +98 -27
- package/src/components/ChatWindow.tsx +68 -11
- package/src/components/ContextMeter.tsx +24 -4
- package/src/components/ExtensionUI.tsx +9 -3
- package/src/components/FileViewer.tsx +24 -21
- package/src/components/GitPanel.tsx +449 -449
- package/src/components/GrowthTree.tsx +3 -1
- package/src/components/ImageViewer.tsx +72 -0
- package/src/components/MarkdownBlock.tsx +6 -3
- package/src/components/PreviewImage.tsx +33 -0
- package/src/components/ProjectPanel.tsx +5 -3
- package/src/components/PromptPanel.tsx +322 -313
- package/src/components/RemoteSection.tsx +2 -1
- package/src/components/SessionSidebar.tsx +22 -4
- package/src/components/SettingsPanel.tsx +2654 -2639
- package/src/components/composer/ComposerImages.tsx +1 -79
- package/src/hooks/usePiWeb.ts +47 -2
- package/src/i18n.tsx +24 -0
- package/src/lib/agent-manager.ts +275 -18
- package/src/lib/chat/skill-expansion.ts +10 -0
- package/src/lib/extension-ui.ts +25 -1
- package/src/lib/git-service.ts +291 -289
- package/src/lib/github-identity.ts +245 -245
- package/src/lib/growth-turns.ts +3 -1
- package/src/lib/session-reader.ts +25 -13
- package/src/lib/session-retention.ts +11 -8
- package/src/lib/slash-command-token.ts +14 -0
- package/src/lib/trajectory.ts +17 -6
- package/src/lib/types.ts +24 -2
- package/src/lib/workspace-store.ts +36 -1
- package/.next/diagnostics/build-diagnostics.json +0 -6
- package/.next/diagnostics/framework.json +0 -1
- package/.next/server/chunks/229.js +0 -1
- package/.next/server/chunks/393.js +0 -1
- package/.next/server/chunks/612.js +0 -1
- package/.next/server/chunks/662.js +0 -2
- package/.next/server/chunks/686.js +0 -1
- package/.next/server/chunks/802.js +0 -2
- package/.next/server/chunks/807.js +0 -1
- package/.next/server/chunks/924.js +0 -6
- package/.next/static/4snUelZTEIiQYCkB5nTW7/_buildManifest.js +0 -1
- package/.next/static/chunks/1966.1560d0f43ac9a41a.js +0 -1
- package/.next/static/chunks/2577.eebf2cf291a811ad.js +0 -1
- package/.next/static/chunks/2716.a5228b0eeedbe4c8.js +0 -1
- package/.next/static/chunks/2906.546a64377e12dfbc.js +0 -1
- package/.next/static/chunks/3899.55a0943bf5e7fec7.js +0 -1
- package/.next/static/chunks/4673.8eff281cb63e2799.js +0 -1
- package/.next/static/chunks/4686-f03275819a719fd8.js +0 -1
- package/.next/static/chunks/4778.2dae0c6a9e396326.js +0 -1
- package/.next/static/chunks/app/_global-error/page-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/_not-found/page-851dc3883a1937aa.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/tree/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/config/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/files/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/fs/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/git/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/github/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/growth/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/health/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/models/defaults/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/models/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/pi-settings/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/prompts/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/remote/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/security/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/sessions/import/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/skills/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/update/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/version/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/web-auth/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/api/workspaces/route-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/app/page-0159987118376f42.js +0 -1
- package/.next/static/chunks/main-22ccebc2da4d291e.js +0 -5
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-c37b7707077f50ce.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f977af7f858990a2.js +0 -1
- package/.next/static/chunks/webpack-c1b43c269867b64f.js +0 -1
- package/.next/static/css/93ed3daa6f3fbc35.css +0 -1
- package/.next/trace +0 -58
- package/.next/trace-build +0 -1
- /package/.next/static/{4snUelZTEIiQYCkB5nTW7 → QJCtqgDKzGS2BdKABd9ch}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=
|
|
1
|
+
exports.id=2970,exports.ids=[2970],exports.modules={146:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c={createLinkPrefetchPartialError:function(){return f},createUnrenderedSegmentError:function(){return e}};for(var d in c)Object.defineProperty(b,d,{enumerable:!0,get:c[d]});function e(a,b){let c=`Route "${a}": Could not validate that a segment in your UI has instant navigation.`;if(b.length>0){let a=1===b.length?"Dropped segment":"Dropped segments";c+=`
|
|
2
2
|
|
|
3
3
|
This segment was dropped from rendering. Issues that would prevent instant navigation will go undetected.
|
|
4
4
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";exports.id=3924,exports.ids=[3924,5393],exports.modules={1175:(a,b,c)=>{c.d(b,{Fu:()=>h}),c(77598),c(73024);var d=c(48161),e=c.n(d),f=c(76760),g=c.n(f);function h(){let a=process.env.PI_CODING_AGENT_DIR;if(a)return"~"===a?e().homedir():a.startsWith("~/")||a.startsWith("~\\")?g().join(e().homedir(),a.slice(2)):a;return g().join(e().homedir(),".pi","agent")}},3924:(a,b,c)=>{c.d(b,{remoteBlocked:()=>u,remoteLanEnabled:()=>x,startLan:()=>B}),c(31421);var d=c(73024),e=c.n(d);c(44708);var f=c(48161),g=c.n(f),h=c(76760),i=c.n(h),j=c(75393),k=c(1175),l=c(37067),m=c.n(l),n=c(57075),o=c(38522),p=c.n(o);c(77030);let q=JSON.parse('{"A":"/*\\n * 手机端适配。不改 PiWeb,只在经代理的远程页面上生效\\n * (本机直连 127.0.0.1:30141 的桌面页面完全不加载它)。\\n *\\n * 取值参照 dsh-remote 为 DSH 定的那套移动适配(同作者),并针对 PiWeb 的实测问题:\\n * 390px 下输入框 304px、markdown 表格 442px 超出视口、底部统计行被截断。\\n */\\n@media (max-width: 840px) {\\n\\t/* 1) 输入框自适应高度失控。\\n\\t 实测:视口 390 → 304px,500 → 43px,700+ → 22px;而自然内容高始终 22px。\\n\\t 原因在 ChatInput 的 autoSize():它把\\"被 flex 拉伸后\\"的 scrollHeight 写进了\\n\\t inline height,写回后又把自己撑住,形成自锁。inline 样式不是 important,\\n\\t 所以这里用 max-height !important 把它夹住。 */\\n\\ttextarea {\\n\\t\\tmax-height: 132px !important;\\n\\t\\toverflow-y: auto !important;\\n\\t}\\n\\n\\t/* 2) Markdown 宽表格超出视口被裁掉(实测 442 > 390,body 又是 overflow-x:hidden,\\n\\t 等于右侧内容既看不到也滑不到)。让表格自己横向滚动。 */\\n\\t.md table {\\n\\t\\tdisplay: block !important;\\n\\t\\tmax-width: 100% !important;\\n\\t\\toverflow-x: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\n\\t/* 3) 全局溢出护栏(dsh-remote 同款):任何一块都不许把文档撑宽 */\\n\\thtml,\\n\\tbody {\\n\\t\\tmax-width: 100vw !important;\\n\\t\\toverflow-x: hidden !important;\\n\\t}\\n\\tpre {\\n\\t\\tmax-width: 100% !important;\\n\\t\\toverflow-x: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\timg,\\n\\tsvg,\\n\\tvideo,\\n\\tcanvas {\\n\\t\\tmax-width: 100% !important;\\n\\t}\\n\\n\\t/* 4) 底部统计行原本 nowrap + ellipsis,手机上「| 输入 2…」之后永远看不到。\\n\\t 改成可横向滑动,滚动条隐藏,信息不再丢。 */\\n\\tdiv.text-center > div.overflow-hidden.text-ellipsis.whitespace-nowrap {\\n\\t\\toverflow-x: auto !important;\\n\\t\\toverflow-y: hidden !important;\\n\\t\\ttext-overflow: clip !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t\\tscrollbar-width: none;\\n\\t}\\n\\tdiv.text-center > div.overflow-hidden.text-ellipsis.whitespace-nowrap::-webkit-scrollbar {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t/* 5) 给手机的手势条留位置(没有 insets 的设备 env() 为 0,等于没写) */\\n\\t.pi-main {\\n\\t\\tpadding-bottom: env(safe-area-inset-bottom) !important;\\n\\t}\\n\\n\\t/* 6) 左上角的抽屉按钮。原来是个悬浮的圆角方块(12px/12px、34px),盖在内容上、\\n\\t 和右边那排图标也不在一条水平线上。按 dsh-remote 对 DSH 左侧的做法收成贴角圆形,\\n\\t 尺寸和位置改成与右侧图标完全一致(实测右侧图标是 top 12 / 30\xd730,中心 y=27),\\n\\t 这样整行对齐,按钮底边 42 也在头部分隔线(y=43)之上,不会压住那条线。 */\\n\\t.pi-mobile-menu {\\n\\t\\twidth: 30px !important;\\n\\t\\theight: 30px !important;\\n\\t\\tborder-radius: 999px !important;\\n\\t\\tleft: calc(env(safe-area-inset-left) + 12px) !important;\\n\\t\\ttop: calc(env(safe-area-inset-top) + 12px) !important;\\n\\t}\\n\\t.pi-main > .hairline-b {\\n\\t\\tpadding-left: 52px !important;\\n\\t}\\n\\n\\t/* 7) 右侧大纲导轨是绝对定位的(right-2 + 约 34px 宽的竖条),正文和用户气泡\\n\\t 会从它下面穿过去。不动条宽——那是层级信息——而是把导轨贴边收窄,\\n\\t 再给滚动区留出它实际占的宽度。 */\\n\\t.outline-rail {\\n\\t\\tright: 2px !important;\\n\\t}\\n\\t.outline-rail > div {\\n\\t\\tpadding-left: 6px !important;\\n\\t\\tpadding-right: 2px !important;\\n\\t}\\n\\t.pi-main div.min-h-0.flex-1.overflow-y-auto {\\n\\t\\tpadding-right: 30px !important;\\n\\t}\\n\\n\\t/* 8) 设置弹窗:高度用 100vh(移动端的大视口),内容列又没有 min-height:0\\n\\t 也没有 overflow-y,于是 1986px 的内容被 overflow:hidden 裁在 828px 里,\\n\\t 手机上完全滑不动。实测 client=828 / scroll=1986。 */\\n\\t.settings-dialog {\\n\\t\\theight: calc(100vh - 16px) !important;\\n\\t}\\n\\t.settings-dialog > div:not(.settings-nav) {\\n\\t\\tmin-height: 0 !important;\\n\\t\\toverflow-y: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\n\\t/* 9) 模型 / 思考等级浮层锚在胶囊自己的 relative 容器上,right-0 是**胶囊**右缘,\\n\\t 312px 往左展开就顶出屏幕左边(实测 left 为负)。把胶囊容器解除定位,\\n\\t 浮层改用整张输入卡(上一层 relative)做定位父级,right-0 落在卡片右缘就装得下。\\n\\t :has() 在移动端 Safari 15.4+ / Chrome 105+ 都可用。 */\\n\\tdiv.relative:has(> button.chip[aria-haspopup=\\"menu\\"]) {\\n\\t\\tposition: static !important;\\n\\t}\\n\\n\\t/* 10) 设置→模型 的提供方卡片:那一行是 nowrap,中间的名字列被右侧一串按钮挤成\\n\\t 0 宽(实测 w=0),于是「凭据: auth.json」竖着拆行、「编辑」拆成「编/辑」、\\n\\t 右侧的按钮还被裁掉。手机上让这行能换行,并给名字列一个真实的最小宽度。 */\\n\\t.settings-dialog div.flex.items-center.gap-3:has(> div.min-w-0.flex-1) {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\trow-gap: 8px !important;\\n\\t}\\n\\t.settings-dialog div.flex.items-center.gap-3:has(> div.min-w-0.flex-1) > div.min-w-0.flex-1 {\\n\\t\\tflex: 1 1 140px !important;\\n\\t\\tmin-width: 140px !important;\\n\\t}\\n\\n\\t/* 11) 设置里 Row 那一套([文字列][控件列] 两栏)。控件列是 flex-none,\\n\\t 有的行右侧很宽(「开关 + 两个数字输入框」≈272px、「繁忙时 Enter」的下拉≈233px),\\n\\t 于是 390px 下文字列只剩 70px 左右,中文按每行一两字竖排,行高被撑到\\n\\t 122px / 218px(实测 70\xd7122、69\xd7218)。\\n\\t 试过的几种写法与实测结论:\\n\\t - 只给文字列 flex 增长权重:完全没用(那行没有空闲空间)\\n\\t - 只缩小 gap:只能缓解(70\xd7122 → 86\xd798)\\n\\t - 让所有 Row 都上下排(flex:1 1 100%):能修好,但把本来正常的行也撑高\\n\\t (界面语言 53→85、字体步进 95→105),是密度回退\\n\\t - 正解:文字列 flex-basis 设 0、只留 min-width 当\\"不许被压到多窄\\"的下限。\\n\\t 换行判断用的是 flex-basis(max-content 会很大,所以上一版全换行了),\\n\\t 设成 0 之后判断就只看 min-width:\\n\\t 控件窄的行(界面语言 77px、字体步进 116px)→ 仍并排,保持紧凑\\n\\t 控件宽的行(272px / 233px)→ 控件换到下一行,文字拿满 326px\\n\\t 实测:界面语言 53 不变、界面字体 95→71、繁忙时Enter 239→135、\\n\\t 自动压缩 143→111、自动重试 119→111,全部不再竖排。 */\\n\\t.settings-dialog div.hairline-b.gap-6 {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\tgap: 8px !important;\\n\\t}\\n\\t.settings-dialog div.hairline-b.gap-6 > div.min-w-0 {\\n\\t\\tflex: 1 1 0 !important;\\n\\t\\tmin-width: 45% !important;\\n\\t}\\n\\t.settings-dialog div.hairline-b.gap-6 > div.flex-none > div.flex.items-center {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\tjustify-content: flex-end !important;\\n\\t\\trow-gap: 6px !important;\\n\\t}\\n\\n\\t/* 12) 外观主题卡片。卡片是 flex: 1 1 150px 的两列网格,但左右各留 32px 内边距,\\n\\t 159px 的卡片只剩 95px 给标题,于是「石灰与煤炭」「亚麻与苔绿」掉到第二行,\\n\\t 卡片高度变成 110px 而其余是 88px,网格参差(实测 6 张卡:4 张 88 / 2 张 110)。\\n\\t 把左右内边距收到 10px,6 张卡全部回到 88px,标题一行放得下。 */\\n\\t.settings-dialog button[aria-pressed] {\\n\\t\\tpadding-left: 10px !important;\\n\\t\\tpadding-right: 10px !important;\\n\\t}\\n\\n\\t/* 13) 可点目标偏小(实测:字体步进器 26\xd726、reset 48\xd724、开关 36\xd720)。\\n\\t 只扩**热区**,绝不改可见尺寸:开关的滑块位置在 PiWeb 里是写死的\\n\\t (left: 18px / 2px),把开关拉宽会让滑块错位、变成被拉长的怪药丸\\n\\t —— 我第一版写的 min-width:44px 就是这个后果,用户报了\\"启动按钮好丑\\"。\\n\\t 另外这里只做**纵向**扩张(左右不扩):字体步进器 −/+/ 之间只有 8px,\\n\\t 横向扩到 44px 会让两个按钮的热区重叠约 10px,点 − 反而命中 +。 */\\n\\t.settings-dialog .icon-btn,\\n\\t.settings-dialog button.h-6,\\n\\t.settings-dialog button.h-5,\\n\\t.settings-dialog [role=\\"switch\\"] {\\n\\t\\tposition: relative !important;\\n\\t}\\n\\t.settings-dialog .icon-btn::after,\\n\\t.settings-dialog button.h-6::after,\\n\\t.settings-dialog button.h-5::after,\\n\\t.settings-dialog [role=\\"switch\\"]::after {\\n\\t\\tcontent: \\"\\" !important;\\n\\t\\tposition: absolute !important;\\n\\t\\tleft: 0 !important;\\n\\t\\tright: 0 !important;\\n\\t\\ttop: 50% !important;\\n\\t\\theight: max(100%, 44px) !important;\\n\\t\\ttransform: translateY(-50%) !important;\\n\\t\\tborder-radius: 999px !important;\\n\\t}\\n}\\n\\n/* 手机上的浮层统一兜底:不许比屏幕宽,不许比屏幕高,超出就自己滚。 */\\n@media (max-width: 840px) {\\n\\t.popover {\\n\\t\\tmax-width: calc(100vw - 16px) !important;\\n\\t\\tmax-height: 420px !important;\\n\\t\\toverflow-y: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n}\\n\\n/* 上下文弹窗(圆环)额外收紧:它右对齐在圆环上,而圆环离屏幕右缘还有 60-70px\\n (主输入框 ~71px、旁聊面板 ~63px)。上面「统一兜底」的 100vw-16px 在 360px 以下\\n 的机型仍会把左边顶出屏幕(实测 344px → left −15px、320px → left −39px)。\\n 这里按视口留出 96px:主输入框与旁聊面板实测 left ≥ 25px,且不越出旁聊面板左缘。 */\\n@media (max-width: 840px) {\\n\\t.popover.pw-context-popover {\\n\\t\\tmax-width: calc(100vw - 96px) !important;\\n\\t}\\n}\\n\\n/* 11) 模型名太长时跑马灯。取值与做法照搬 dsh-remote 对 DSH 的:\\n\\t 名字窗口固定 28vw 并允许被压缩,装得下就完全不动;装不下时由注入的\\n\\t mobile-fit.js 打上 data-piweb-marquee,再由这里的两份伪元素首尾相接匀速左移。\\n\\t 一份走完另一份正好接上(travel 已含间隔),所以循环处看不出接缝。 */\\n@media (max-width: 840px) {\\n\\tbutton.chip[aria-haspopup=\\"menu\\"] > span.truncate {\\n\\t\\tmin-width: 0 !important;\\n\\t\\tmax-width: 28vw !important;\\n\\t}\\n\\t[data-piweb-marquee] {\\n\\t\\tposition: relative !important;\\n\\t\\tdisplay: block !important;\\n\\t\\twidth: 28vw !important;\\n\\t\\tflex: none !important;\\n\\t\\ttext-overflow: clip !important;\\n\\t\\twhite-space: nowrap !important;\\n\\t\\toverflow: hidden !important;\\n\\t\\ttext-indent: 0 !important;\\n\\t\\tcontain: layout paint !important;\\n\\t\\tcolor: transparent !important;\\n\\t\\tline-height: 20px !important;\\n\\t}\\n\\t[data-piweb-marquee]::before,\\n\\t[data-piweb-marquee]::after {\\n\\t\\tcontent: attr(data-piweb-text);\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tcolor: var(--piweb-marquee-color, var(--dsw-label-primary));\\n\\t\\tfont-size: 13px;\\n\\t\\tline-height: 20px;\\n\\t\\twhite-space: nowrap;\\n\\t\\twill-change: transform;\\n\\t\\ttransform: translate3d(0, 0, 0);\\n\\t\\tanimation: piweb-mfit-marquee var(--piweb-marquee-duration, 8s) linear infinite both;\\n\\t}\\n\\t[data-piweb-marquee]::after {\\n\\t\\tleft: var(--piweb-marquee-text, 0px);\\n\\t}\\n\\t@keyframes piweb-mfit-marquee {\\n\\t\\tfrom { transform: translate3d(0, 0, 0); }\\n\\t\\tto { transform: translate3d(calc(-1 * var(--piweb-marquee-text, 0px)), 0, 0); }\\n\\t}\\n}\\n\\n/* dvh 是\\"实际可见高度\\",比 100vh(移动 Chrome 的大视口)可靠;\\n 不支持时上面那两条固定值兜底。 */\\n@supports (height: 100dvh) {\\n\\t@media (max-width: 840px) {\\n\\t\\ttextarea {\\n\\t\\t\\tmax-height: min(132px, 26dvh) !important;\\n\\t\\t}\\n\\t\\t.popover {\\n\\t\\t\\tmax-height: min(60dvh, 420px) !important;\\n\\t\\t}\\n\\t\\t.settings-dialog {\\n\\t\\t\\theight: calc(100dvh - 16px) !important;\\n\\t\\t}\\n\\t}\\n}\\n","js":"/*\\n * 手机端脚本(配合 mobile-fit.css)。\\n *\\n * 做两件事:\\n * 1) 模型名太长时改成「跑马灯」。做法照搬 dsh-remote 对 DSH 的处理——\\n * 名字窗口固定 28vw,装得下就完全不动;装不下时才把两份文本首尾相接匀速左移,\\n * 一份走完另一份正好接上,循环没有空档。CSS 负责动画,这里只负责\\"量\\"和\\"打标记\\"。\\n * 为什么必须用 JS 量:纯 CSS 判断不了\\"是否真的被截断\\",只能用省略号一裁了之,\\n * 名字的尾巴就永远看不到了。\\n * 2) 设置里「文字 + 开关」那种行,手机上点文字也能切开关。\\n * 手机断点下这行是上下排(见 mobile-fit.css 第 11 条),文字占满一行、开关缩在下面,\\n * 而 PiWeb 只让那个 36\xd720 的小开关可点 —— 用户点最显眼的标题文字毫无反应,\\n * 看起来就是\\"这个开关坏了\\"。实测:点文字 0 次请求,点开关才发请求。\\n */\\n(function () {\\n\\t\\"use strict\\";\\n\\n\\tvar ATTR = \\"data-piweb-marquee\\";\\n\\tvar TEXT_ATTR = \\"data-piweb-text\\";\\n\\tvar TEXT_VAR = \\"--piweb-marquee-text\\";\\n\\tvar DURATION_VAR = \\"--piweb-marquee-duration\\";\\n\\tvar COLOR_VAR = \\"--piweb-marquee-color\\";\\n\\tvar /** 两份文本之间留的间隔,也是 travel 里多出来的那一段 */\\n\\t\\tGAP = 40;\\n\\tvar /** 每秒移动多少像素,太长就慢一点 */\\n\\t\\tSPEED = 22;\\n\\tvar MIN_CYCLE = 6;\\n\\tvar ROW_BOUND_ATTR = \\"data-piweb-row-bound\\";\\n\\n\\t/** 模型胶囊里的名字(ModelSelector 里那个 span.truncate) */\\n\\tfunction label() {\\n\\t\\treturn document.querySelector(\'button.chip[aria-haspopup=\\"menu\\"] > span.truncate\');\\n\\t}\\n\\n\\tfunction apply() {\\n\\t\\tvar el = label();\\n\\t\\tif (!el) return;\\n\\t\\tvar text = el.textContent || \\"\\";\\n\\t\\tif (!text) return;\\n\\n\\t\\t// 同一个名字已经标过就别再动它:重设属性会把 CSS 动画从头开始,看起来是\\"一直重启\\"\\n\\t\\tif (el.hasAttribute(ATTR) && el.getAttribute(TEXT_ATTR) === text) return;\\n\\n\\t\\t// 量必须在\\"静止态\\"下做:先摘掉标记,否则量到的是被 28vw 框死之后的宽度\\n\\t\\tif (el.hasAttribute(ATTR)) el.removeAttribute(ATTR);\\n\\t\\tvar natural = el.scrollWidth;\\n\\t\\tvar windowWidth = el.clientWidth;\\n\\t\\tif (!windowWidth || natural <= windowWidth + 1) return; // 装得下,什么都不做\\n\\n\\t\\tel.style.setProperty(COLOR_VAR, getComputedStyle(el).color);\\n\\t\\tel.style.setProperty(TEXT_VAR, natural + GAP + \\"px\\");\\n\\t\\tel.style.setProperty(DURATION_VAR, Math.max(MIN_CYCLE, (natural + GAP) / SPEED).toFixed(1) + \\"s\\");\\n\\t\\tel.setAttribute(TEXT_ATTR, text);\\n\\t\\tel.setAttribute(ATTR, \\"\\");\\n\\t}\\n\\n\\t/**\\n\\t * 设置里「文字 + 开关」的行:把文字列变成开关的\\"大号按钮\\"。\\n\\t *\\n\\t * 只绑文字列(Row 里那个 min-w-0 的直系子元素),不碰控件列:\\n\\t * 控件列里有数字输入框,整行可点会把\\"点输入框\\"也变成切开关。\\n\\t * React 重渲染会换掉节点,所以每次轮询都重查;用属性做幂等标记,重复绑不会叠加。\\n\\t */\\n\\tfunction bindSwitchRows() {\\n\\t\\tvar switches = document.querySelectorAll(\'.settings-dialog [role=\\"switch\\"]\');\\n\\t\\tfor (var i = 0; i < switches.length; i++) {\\n\\t\\t\\tvar sw = switches[i];\\n\\t\\t\\tvar row = sw.closest(\\".hairline-b\\");\\n\\t\\t\\tif (!row || row.getAttribute(ROW_BOUND_ATTR) === \\"1\\") continue;\\n\\t\\t\\t// Row 的文字列:hairline-b 的直系子元素里带 min-w-0 的那个\\n\\t\\t\\tvar label = null;\\n\\t\\t\\tfor (var c = 0; c < row.children.length; c += 1) {\\n\\t\\t\\t\\tif (row.children[c].classList.contains(\\"min-w-0\\")) { label = row.children[c]; break; }\\n\\t\\t\\t}\\n\\t\\t\\tif (!label) continue;\\n\\t\\t\\trow.setAttribute(ROW_BOUND_ATTR, \\"1\\");\\n\\t\\t\\t(function (button, labelEl) {\\n\\t\\t\\t\\tlabelEl.style.cursor = \\"pointer\\";\\n\\t\\t\\t\\tlabelEl.addEventListener(\\"click\\", function (event) {\\n\\t\\t\\t\\t\\t// 文字里可能有链接/按钮,别抢它们\\n\\t\\t\\t\\t\\tif (event.target.closest(\\"a, button, input, select, textarea\\")) return;\\n\\t\\t\\t\\t\\tif (button.disabled) return;\\n\\t\\t\\t\\t\\tevent.preventDefault();\\n\\t\\t\\t\\t\\tbutton.click();\\n\\t\\t\\t\\t});\\n\\t\\t\\t})(sw, label);\\n\\t\\t}\\n\\t}\\n\\n\\t// 模型名会随会话/选择变化,输入卡也会整体重挂载;轮询最省事,且因为有上面的\\n\\t// 提前返回,稳态下每次只花一个 querySelector。\\n\\tfunction start() {\\n\\t\\tapply();\\n\\t\\tbindSwitchRows();\\n\\t\\tsetInterval(function () { apply(); bindSwitchRows(); }, 800);\\n\\t\\twindow.addEventListener(\\"resize\\", apply, { passive: true });\\n\\t\\twindow.addEventListener(\\"orientationchange\\", apply, { passive: true });\\n\\t}\\n\\n\\tif (document.readyState === \\"loading\\") document.addEventListener(\\"DOMContentLoaded\\", start, { once: true });\\n\\telse start();\\n})();"}'),r="piweb-mobile-fit",s=q.A,t=q.js;function u(a=process.env){return(0,j.authEnabled)(a)?"development"===a.NODE_ENV?"dev":null:"auth"}function v(){let a=globalThis,b=Symbol.for("piweb:remote-supervisor"),c=a[b];if(c)return c;let d={lan:null,tunnel:null,lanError:null,publicError:null,enginePath:null,engineChecked:!1};return a[b]=d,d}function w(a=process.env){for(let b of[a.PIWEB_PORT,a.PORT]){let a=Number(b);if(Number.isInteger(a)&&a>=1&&a<=65535)return a}return 30141}function x(a=process.env){let b;return"0"!==(b=(a.PIWEB_REMOTE_LAN??"").trim().toLowerCase())&&"false"!==b&&"off"!==b&&"no"!==b}let y=/vmware|virtualbox|vboxnet|vethernet|hyper-v|wsl|docker|^br-|^veth/i;function z(){let a=v(),b=a.lan?.port??null;return{plugin:"builtin-remote",pluginEnabled:A(),targetPort:w(),blocked:u(),lan:{running:!!a.lan,port:b,urls:b?(function(a=g().networkInterfaces()){let b=[],c=[];for(let[d,e]of Object.entries(a))for(let a of e??[])!("IPv4"!==a.family||a.internal||a.address.startsWith("169.254."))&&(/^198\.1[89]\./.test(a.address)||(y.test(d)?c:b).push(a.address));return[...b,...c]})().map(a=>`http://${a}:${b}`):[],styled:!!a.lan?.styled,error:a.lanError},public:{running:!!a.tunnel,url:a.tunnel?.url??null,ready:!!a.tunnel?.ready,engine:a.tunnel?"cloudflared":null,engineAvailable:!a.engineChecked||null!==a.enginePath,error:a.publicError}}}function A(){try{let a=JSON.parse(e().readFileSync(i().join((0,k.Fu)(),"remote-plugin.json"),"utf8"));return a?.enabled!==!1}catch{return!0}}function B(a=function(a=process.env){let b=Number(a.PIWEB_REMOTE_LAN_PORT);return Number.isInteger(b)&&b>=1&&b<=65535?b:30142}(),b="0.0.0.0",c=w()){let d=v();if(d.lan)return Promise.resolve(z().lan);if(d.lanStarting)return d.lanStarting;let e=C(a,b,c).finally(()=>{d.lanStarting===e&&(d.lanStarting=null)});return d.lanStarting=e,e}async function C(a,b,c){let d=v();d.lanError=null;let e=A(),f=function({targetPort:a,targetHost:b="127.0.0.1",css:c=null,js:d=null,log:e=()=>{}}){let f=new(m()).Agent({keepAlive:!0,scheduling:"lifo",timeout:5e3}),g=m().createServer((g,h)=>{let i,j={...g.headers},k=!!(c||d)&&!("localhost"===(i=(function(a){let b=String(a??"").trim().toLowerCase();if(b.startsWith("[")){let a=b.indexOf("]");return a>=0?b.slice(1,a):b.slice(1)}return 1===(b.match(/:/g)??[]).length?b.slice(0,b.indexOf(":")):b})(j.host).trim().toLowerCase().replace(/^\[|\]$/g,""))||i.endsWith(".localhost")||"::1"===i||"0:0:0:0:0:0:0:1"===i||/^127(?:\.\d{1,3}){3}$/.test(i));k&&String(j.accept??"").includes("text/html")&&(j["accept-encoding"]="identity");let l=m().request({host:b,port:a,method:g.method,path:g.url??"/",headers:j,agent:f},a=>{let b=String(a.headers["content-type"]??"");if(!k||!b.includes("text/html")){h.writeHead(a.statusCode??502,a.headers),(0,n.pipeline)(a,h,()=>void 0);return}let f=[];a.on("error",a=>{e(`[远程连接] 上游中途断开:${a.message}`),h.destroy()}),a.on("data",a=>f.push(a)),a.on("end",()=>{let b,g=Buffer.concat(f);try{b=Buffer.from(function(a,{css:b=null,js:c=null}={}){if(!b&&!c||a.includes(`id="${r}"`))return a;let d=[];b&&d.push(`<style id="${r}">
|
|
2
|
+
${b}
|
|
3
|
+
</style>`),c&&d.push(`<script id="${r}-js">
|
|
4
|
+
${c}
|
|
5
|
+
<\/script>`);let e=d.join("\n"),f=a.indexOf("</head>");if(f>=0)return`${a.slice(0,f)}${e}
|
|
6
|
+
${a.slice(f)}`;let g=a.indexOf("<body");if(g>=0){let b=a.indexOf(">",g);if(b>=0)return`${a.slice(0,b+1)}${e}${a.slice(b+1)}`}return e+a}((function(a,b){let c=String(b??"").toLowerCase();if(!c||"identity"===c)return a;if("gzip"===c||"x-gzip"===c)return p().gunzipSync(a);if("deflate"===c)return p().inflateSync(a);if("br"===c)return p().brotliDecompressSync(a);throw Error(`不支持的 content-encoding:${b}`)})(g,a.headers["content-encoding"]).toString("utf8"),{css:c,js:d}),"utf8")}catch(c){e(`[远程连接] 注入失败,原样返回:${c instanceof Error?c.message:String(c)}`);let b={...a.headers};delete b["content-encoding"],delete b["content-length"],h.writeHead(a.statusCode??200,b),h.end(g);return}let i={...a.headers};delete i["content-encoding"],delete i["transfer-encoding"],delete i.etag,i["content-length"]=String(b.byteLength),i["cache-control"]="no-store",h.writeHead(a.statusCode??200,i),h.end(b)})}),o=!1;l.on("error",a=>{o||(e(`[远程连接] 代理连不上 PiWeb:${a.message}`),h.headersSent||h.writeHead(502,{"content-type":"text/plain; charset=utf-8"}),h.end(`[远程连接] 连不上 PiWeb(${a.message})`))}),h.on("close",()=>{h.writableFinished||(o=!0,l.destroy())}),g.pipe(l)});return g.on("close",()=>f.destroy()),g}({targetPort:c,css:e?s:null,js:e?t:null,log:a=>console.warn(a)});try{await new Promise((c,d)=>{f.once("error",d),f.listen(a,b,c)})}catch(a){return d.lanError=a instanceof Error?a.message:String(a),f.close(),z().lan}return d.lan={server:f,port:a,styled:e},z().lan}},75393:(a,b,c)=>{function d(a=process.env){let b=(a.PI_WEB_AUTH??"").trim().toLowerCase();return"1"===b||"true"===b||"on"===b||"yes"===b}c.d(b,{authEnabled:()=>d}),c(77598)}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=4807,exports.ids=[4807],exports.modules={24807:(a,b,c)=>{c.d(b,{registerNode:()=>d});async function d(){if("phase-production-build"===process.env.NEXT_PHASE)return;let{authEnabled:a}=await c.e(5393).then(c.bind(c,75393));a()&&(await c.e(5802).then(c.bind(c,95802))).publishLaunchToken(),(await c.e(7662).then(c.bind(c,47662))).ensureStartupCheck().catch(()=>{});let{remoteBlocked:b,remoteLanEnabled:d,startLan:e}=await c.e(3924).then(c.bind(c,3924));if(!d())return;let f=b();if("auth"===f)return void console.warn("[远程连接] 已跳过局域网入口:认证没开。请设 PI_WEB_AUTH=1。");if("dev"===f)return void console.warn("[远程连接] 已跳过局域网入口:开发模式只服务本机(认证保护不了 Next 开发工具端点)。");let g=await e();g.running?console.log(`[远程连接] 局域网入口已就绪:${g.urls.join(" ")}`):console.warn(`[远程连接] 局域网入口启动失败:${g.error}`)}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=5393,exports.ids=[5393],exports.modules={75393:(a,b,c)=>{function d(a=process.env){let b=(a.PI_WEB_AUTH??"").trim().toLowerCase();return"1"===b||"true"===b||"on"===b||"yes"===b}c.d(b,{authEnabled:()=>d}),c(77598)}};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";exports.id=5802,exports.ids=[5802],exports.modules={1175:(a,b,c)=>{c.d(b,{Fu:()=>h}),c(77598),c(73024);var d=c(48161),e=c.n(d),f=c(76760),g=c.n(f);function h(){let a=process.env.PI_CODING_AGENT_DIR;if(a)return"~"===a?e().homedir():a.startsWith("~/")||a.startsWith("~\\")?g().join(e().homedir(),a.slice(2)):a;return g().join(e().homedir(),".pi","agent")}},95802:(a,b,c)=>{c.r(b),c.d(b,{TOKEN_BYTES:()=>k,TOKEN_QUERY:()=>j,launchTokenFile:()=>m,publishLaunchToken:()=>n,validLaunchToken:()=>l});var d=c(77598),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(1175);let j="token",k=32;function l(a,b){if(!a||!b)return!1;let c=Buffer.from(a,"utf8"),e=Buffer.from(b,"utf8");return c.byteLength===e.byteLength&&(0,d.timingSafeEqual)(c,e)}function m(a){return h().join((0,i.Fu)(),"web-launch",`${a}.token`)}function n(a=process.env){let b=a.PI_WEB_LAUNCH_TOKEN,c=a.PIWEB_PORT;if(!b||!c)return;let d=m(c);try{f().mkdirSync(h().dirname(d),{recursive:!0}),f().writeFileSync(d,`${b}
|
|
2
|
+
`,{mode:384})}catch{return}process.once("exit",()=>{try{f().readFileSync(d,"utf8").trim()===b&&f().unlinkSync(d)}catch{}})}}};
|