@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,313 +1,322 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/**
|
|
3
|
-
* 提示词面板:把"发给模型的提示词从哪来"集中列出来,点某一项查看原文。
|
|
4
|
-
*
|
|
5
|
-
* 只读:文件类来源的路径来自 Pi 资源加载器(项目记忆 / 系统提示词覆盖 / 追加提示词 /
|
|
6
|
-
* 技能 / 提示模板,含扩展与 npm 包提供的那些);热会话额外给出"组装后的系统提示词"
|
|
7
|
-
* 与每个工具的定义,它们不是文件、没有路径,直接在本面板内展开查看。
|
|
8
|
-
*/
|
|
9
|
-
import { useCallback, useEffect, useState } from "react";
|
|
10
|
-
import { useI18n } from "@/i18n";
|
|
11
|
-
import { fmtBytes } from "@/lib/format";
|
|
12
|
-
import { IconRefreshOutline14, IconCloseOutline14 } from "@/components/icons";
|
|
13
|
-
|
|
14
|
-
export type PromptSourceKind = "system" | "append" | "agents" | "skill" | "template" | "tool" | "assembled";
|
|
15
|
-
|
|
16
|
-
export interface PromptSourceOrigin {
|
|
17
|
-
scope: "project" | "agent" | "package" | "extension";
|
|
18
|
-
name?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface PromptSource {
|
|
22
|
-
kind: PromptSourceKind;
|
|
23
|
-
name: string;
|
|
24
|
-
path?: string;
|
|
25
|
-
origin: PromptSourceOrigin;
|
|
26
|
-
bytes?: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface PromptToolView {
|
|
30
|
-
name: string;
|
|
31
|
-
description?: string;
|
|
32
|
-
parameters?: unknown;
|
|
33
|
-
promptGuidelines?: string[];
|
|
34
|
-
source: "builtin" | "extension";
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface PromptSourcesData {
|
|
38
|
-
sources: PromptSource[];
|
|
39
|
-
assembledSystemPrompt?: string;
|
|
40
|
-
/** 压缩摘要(同样进入上下文) */
|
|
41
|
-
compactedSummary?: string;
|
|
42
|
-
tools?: PromptToolView[];
|
|
43
|
-
sessionReady: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const GROUP_KINDS: PromptSourceKind[] = ["system", "append", "agents", "skill", "template", "tool", "assembled"];
|
|
47
|
-
|
|
48
|
-
function formatBytes(bytes: number | undefined): string {
|
|
49
|
-
return bytes ? fmtBytes(bytes) : "";
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function PromptPanel({
|
|
53
|
-
cwd,
|
|
54
|
-
sessionId,
|
|
55
|
-
refreshKey,
|
|
56
|
-
onOpenContent,
|
|
57
|
-
onClose,
|
|
58
|
-
}: {
|
|
59
|
-
cwd: string;
|
|
60
|
-
sessionId: string | null;
|
|
61
|
-
/** 变化即重新拉取(例如切换会话) */
|
|
62
|
-
refreshKey?: string | number | null;
|
|
63
|
-
/** 打开查看器显示内容(复用应用现有的文件查看器) */
|
|
64
|
-
onOpenContent?: (path: string, content: string) => void;
|
|
65
|
-
onClose: () => void;
|
|
66
|
-
}) {
|
|
67
|
-
const { t } = useI18n();
|
|
68
|
-
const [data, setData] = useState<PromptSourcesData | null>(null);
|
|
69
|
-
const [error, setError] = useState<string | null>(null);
|
|
70
|
-
const [busy, setBusy] = useState(false);
|
|
71
|
-
const [opening, setOpening] = useState<string | null>(null);
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}, [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* 提示词面板:把"发给模型的提示词从哪来"集中列出来,点某一项查看原文。
|
|
4
|
+
*
|
|
5
|
+
* 只读:文件类来源的路径来自 Pi 资源加载器(项目记忆 / 系统提示词覆盖 / 追加提示词 /
|
|
6
|
+
* 技能 / 提示模板,含扩展与 npm 包提供的那些);热会话额外给出"组装后的系统提示词"
|
|
7
|
+
* 与每个工具的定义,它们不是文件、没有路径,直接在本面板内展开查看。
|
|
8
|
+
*/
|
|
9
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
10
|
+
import { useI18n } from "@/i18n";
|
|
11
|
+
import { fmtBytes } from "@/lib/format";
|
|
12
|
+
import { IconRefreshOutline14, IconCloseOutline14 } from "@/components/icons";
|
|
13
|
+
|
|
14
|
+
export type PromptSourceKind = "system" | "append" | "agents" | "skill" | "template" | "tool" | "assembled";
|
|
15
|
+
|
|
16
|
+
export interface PromptSourceOrigin {
|
|
17
|
+
scope: "project" | "agent" | "package" | "extension";
|
|
18
|
+
name?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PromptSource {
|
|
22
|
+
kind: PromptSourceKind;
|
|
23
|
+
name: string;
|
|
24
|
+
path?: string;
|
|
25
|
+
origin: PromptSourceOrigin;
|
|
26
|
+
bytes?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface PromptToolView {
|
|
30
|
+
name: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
parameters?: unknown;
|
|
33
|
+
promptGuidelines?: string[];
|
|
34
|
+
source: "builtin" | "extension";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface PromptSourcesData {
|
|
38
|
+
sources: PromptSource[];
|
|
39
|
+
assembledSystemPrompt?: string;
|
|
40
|
+
/** 压缩摘要(同样进入上下文) */
|
|
41
|
+
compactedSummary?: string;
|
|
42
|
+
tools?: PromptToolView[];
|
|
43
|
+
sessionReady: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const GROUP_KINDS: PromptSourceKind[] = ["system", "append", "agents", "skill", "template", "tool", "assembled"];
|
|
47
|
+
|
|
48
|
+
function formatBytes(bytes: number | undefined): string {
|
|
49
|
+
return bytes ? fmtBytes(bytes) : "";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function PromptPanel({
|
|
53
|
+
cwd,
|
|
54
|
+
sessionId,
|
|
55
|
+
refreshKey,
|
|
56
|
+
onOpenContent,
|
|
57
|
+
onClose,
|
|
58
|
+
}: {
|
|
59
|
+
cwd: string;
|
|
60
|
+
sessionId: string | null;
|
|
61
|
+
/** 变化即重新拉取(例如切换会话) */
|
|
62
|
+
refreshKey?: string | number | null;
|
|
63
|
+
/** 打开查看器显示内容(复用应用现有的文件查看器) */
|
|
64
|
+
onOpenContent?: (path: string, content: string) => void;
|
|
65
|
+
onClose: () => void;
|
|
66
|
+
}) {
|
|
67
|
+
const { t } = useI18n();
|
|
68
|
+
const [data, setData] = useState<PromptSourcesData | null>(null);
|
|
69
|
+
const [error, setError] = useState<string | null>(null);
|
|
70
|
+
const [busy, setBusy] = useState(false);
|
|
71
|
+
const [opening, setOpening] = useState<string | null>(null);
|
|
72
|
+
/** 只认最后一次请求:快速切会话时,先发的请求后回来会把上一个会话的提示词盖到当前会话上 */
|
|
73
|
+
const latestRequest = useRef(0);
|
|
74
|
+
|
|
75
|
+
const load = useCallback(async () => {
|
|
76
|
+
const request = ++latestRequest.current;
|
|
77
|
+
setBusy(true);
|
|
78
|
+
setError(null);
|
|
79
|
+
try {
|
|
80
|
+
const query = new URLSearchParams({ cwd });
|
|
81
|
+
if (sessionId) query.set("session", sessionId);
|
|
82
|
+
const response = await fetch(`/api/prompts?${query.toString()}`);
|
|
83
|
+
const body = await response.json();
|
|
84
|
+
if (request !== latestRequest.current) return;
|
|
85
|
+
if (!response.ok || !body.success) throw new Error(body.error || `request failed (${response.status})`);
|
|
86
|
+
setData(body.data as PromptSourcesData);
|
|
87
|
+
} catch (err) {
|
|
88
|
+
if (request === latestRequest.current) setError(err instanceof Error ? err.message : String(err));
|
|
89
|
+
} finally {
|
|
90
|
+
if (request === latestRequest.current) setBusy(false);
|
|
91
|
+
}
|
|
92
|
+
}, [cwd, sessionId]);
|
|
93
|
+
|
|
94
|
+
// 换了工作区/会话:先清掉上一个的内容,别在加载期间把旧会话的提示词当成当前的
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
setData(null);
|
|
97
|
+
}, [cwd, sessionId]);
|
|
98
|
+
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
void load();
|
|
101
|
+
}, [load, refreshKey]);
|
|
102
|
+
|
|
103
|
+
const originLabel = (origin: PromptSourceOrigin): string => {
|
|
104
|
+
if (origin.scope === "project") return t.promptOriginProject;
|
|
105
|
+
if (origin.scope === "agent") return t.promptOriginAgent;
|
|
106
|
+
if (origin.scope === "package") return `${t.promptOriginPackage} ${origin.name ?? ""}`.trim();
|
|
107
|
+
return `${t.promptOriginExtension} ${origin.name ?? ""}`.trim();
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const kindLabel = (kind: PromptSourceKind): string => {
|
|
111
|
+
switch (kind) {
|
|
112
|
+
case "system": return t.promptKindSystem;
|
|
113
|
+
case "append": return t.promptKindAppend;
|
|
114
|
+
case "agents": return t.promptKindAgents;
|
|
115
|
+
case "skill": return t.promptKindSkill;
|
|
116
|
+
case "template": return t.promptKindTemplate;
|
|
117
|
+
case "tool": return t.promptKindTool;
|
|
118
|
+
case "assembled": return t.promptKindAssembled;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** 文件类:按需读内容,交给外部查看器 */
|
|
123
|
+
const openFile = async (source: PromptSource) => {
|
|
124
|
+
if (!source.path || !onOpenContent) return;
|
|
125
|
+
setOpening(source.path);
|
|
126
|
+
setError(null);
|
|
127
|
+
try {
|
|
128
|
+
const response = await fetch("/api/prompts", {
|
|
129
|
+
method: "POST",
|
|
130
|
+
headers: { "Content-Type": "application/json" },
|
|
131
|
+
body: JSON.stringify({ action: "read", filePath: source.path, cwd }),
|
|
132
|
+
});
|
|
133
|
+
const body = await response.json();
|
|
134
|
+
if (!response.ok || !body.success) throw new Error(body.error || "read failed");
|
|
135
|
+
onOpenContent(source.path, body.data.content as string);
|
|
136
|
+
} catch (err) {
|
|
137
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
138
|
+
} finally {
|
|
139
|
+
setOpening(null);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const groups = GROUP_KINDS.map((kind) => ({ kind, items: (data?.sources ?? []).filter((source) => source.kind === kind) })).filter(
|
|
144
|
+
(group) => group.items.length > 0,
|
|
145
|
+
);
|
|
146
|
+
const hasTools = (data?.tools?.length ?? 0) > 0;
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
150
|
+
<div className="hairline-b flex items-center gap-2 px-4 py-2.5">
|
|
151
|
+
<span className="min-w-0 flex-1 truncate" style={{ fontSize: 13.5, fontWeight: 600 }}>{t.promptPanel}</span>
|
|
152
|
+
<button type="button" className="icon-btn" style={{ width: 26, height: 26 }} title={t.promptRefresh} aria-label={t.promptRefresh} onClick={() => void load()}>
|
|
153
|
+
<span className={busy ? "piweb-spin" : undefined} style={{ display: "inline-flex" }}>
|
|
154
|
+
<IconRefreshOutline14 size={14} />
|
|
155
|
+
</span>
|
|
156
|
+
</button>
|
|
157
|
+
<button type="button" className="icon-btn" style={{ width: 26, height: 26 }} title={t.close} aria-label={t.close} onClick={onClose}>
|
|
158
|
+
<IconCloseOutline14 size={14} />
|
|
159
|
+
</button>
|
|
160
|
+
</div>
|
|
161
|
+
<div className="min-h-0 flex-1 overflow-auto px-3 py-3" style={{ fontSize: 12.5 }}>
|
|
162
|
+
{error && (
|
|
163
|
+
<div className="mb-2 rounded-lg px-2 py-1.5" style={{ background: "var(--dsw-hover)", color: "var(--dsw-danger)" }} role="alert">
|
|
164
|
+
{error}
|
|
165
|
+
</div>
|
|
166
|
+
)}
|
|
167
|
+
{!data && busy && <div style={{ color: "var(--dsw-label-tertiary)" }}>{t.promptLoading}</div>}
|
|
168
|
+
{data && !data.sessionReady && (
|
|
169
|
+
<div className="mb-2 rounded-lg px-2 py-1.5" style={{ background: "var(--dsw-hover)", color: "var(--dsw-label-caption)" }} role="status">
|
|
170
|
+
{t.promptColdHint}
|
|
171
|
+
</div>
|
|
172
|
+
)}
|
|
173
|
+
|
|
174
|
+
{groups.map((group) => (
|
|
175
|
+
<section key={group.kind} className="mb-3">
|
|
176
|
+
<div className="mb-1 px-1" style={{ fontSize: 11.5, color: "var(--dsw-label-caption)" }}>{kindLabel(group.kind)}</div>
|
|
177
|
+
<div className="flex flex-col gap-1.5">
|
|
178
|
+
{group.items.map((source) => (
|
|
179
|
+
<button
|
|
180
|
+
key={`${source.kind}:${source.path ?? source.name}`}
|
|
181
|
+
type="button"
|
|
182
|
+
className="flex w-full items-center gap-2 rounded-xl px-2.5 py-2 text-left transition-all"
|
|
183
|
+
style={{
|
|
184
|
+
background: opening === source.path ? "var(--dsw-active)" : "var(--dsw-bg-elevated)",
|
|
185
|
+
border: "1px solid var(--dsw-border-l2)",
|
|
186
|
+
transition: "all 0.2s var(--isx-ease)",
|
|
187
|
+
}}
|
|
188
|
+
title={source.path ?? source.name}
|
|
189
|
+
onMouseEnter={(e) => {
|
|
190
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l3)";
|
|
191
|
+
e.currentTarget.style.background = "var(--dsw-hover)";
|
|
192
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
193
|
+
}}
|
|
194
|
+
onMouseLeave={(e) => {
|
|
195
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l2)";
|
|
196
|
+
e.currentTarget.style.background = opening === source.path ? "var(--dsw-active)" : "var(--dsw-bg-elevated)";
|
|
197
|
+
e.currentTarget.style.transform = "none";
|
|
198
|
+
}}
|
|
199
|
+
onClick={() => void openFile(source)}
|
|
200
|
+
>
|
|
201
|
+
<span className="min-w-0 flex-1 truncate font-medium" style={{ color: "var(--dsw-label-primary)" }}>{source.name}</span>
|
|
202
|
+
<span className="flex-none font-mono" style={{ fontSize: 10.5, color: "var(--dsw-label-tertiary)" }}>{formatBytes(source.bytes)}</span>
|
|
203
|
+
<span className="flex-none rounded-full px-2 py-0.5" style={{ fontSize: 10.5, border: "1px solid var(--dsw-border-l2)", color: "var(--dsw-label-tertiary)", background: "var(--dsw-bg-base)" }}>
|
|
204
|
+
{originLabel(source.origin)}
|
|
205
|
+
</span>
|
|
206
|
+
</button>
|
|
207
|
+
))}
|
|
208
|
+
</div>
|
|
209
|
+
</section>
|
|
210
|
+
))}
|
|
211
|
+
|
|
212
|
+
{hasTools && (
|
|
213
|
+
<section className="mb-3">
|
|
214
|
+
<div className="mb-1 px-1" style={{ fontSize: 11.5, color: "var(--dsw-label-caption)" }}>{t.promptKindTool}</div>
|
|
215
|
+
<div className="flex flex-col gap-1.5">
|
|
216
|
+
{data!.tools!.map((tool) => (
|
|
217
|
+
<button
|
|
218
|
+
key={`tool:${tool.name}`}
|
|
219
|
+
type="button"
|
|
220
|
+
className="flex w-full items-center gap-2 rounded-xl px-2.5 py-2 text-left transition-all"
|
|
221
|
+
style={{
|
|
222
|
+
border: "1px solid var(--dsw-border-l2)",
|
|
223
|
+
background: "var(--dsw-bg-elevated)",
|
|
224
|
+
transition: "all 0.2s var(--isx-ease)",
|
|
225
|
+
}}
|
|
226
|
+
title={tool.name}
|
|
227
|
+
onMouseEnter={(e) => {
|
|
228
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l3)";
|
|
229
|
+
e.currentTarget.style.background = "var(--dsw-hover)";
|
|
230
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
231
|
+
}}
|
|
232
|
+
onMouseLeave={(e) => {
|
|
233
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l2)";
|
|
234
|
+
e.currentTarget.style.background = "var(--dsw-bg-elevated)";
|
|
235
|
+
e.currentTarget.style.transform = "none";
|
|
236
|
+
}}
|
|
237
|
+
onClick={() =>
|
|
238
|
+
onOpenContent?.(
|
|
239
|
+
`tool-${tool.name}.md`,
|
|
240
|
+
[
|
|
241
|
+
`# ${tool.name}`,
|
|
242
|
+
tool.source === "builtin" ? t.promptToolBuiltin : t.promptToolExtension,
|
|
243
|
+
tool.description ?? "",
|
|
244
|
+
...(tool.promptGuidelines?.length ? [t.promptGuidelines, ...tool.promptGuidelines.map((line) => `- ${line}`)] : []),
|
|
245
|
+
...(tool.parameters ? [t.promptParameters, "```json", JSON.stringify(tool.parameters, null, 2), "```"] : []),
|
|
246
|
+
]
|
|
247
|
+
.filter(Boolean)
|
|
248
|
+
.join("\n\n"),
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
>
|
|
252
|
+
<span className="min-w-0 flex-1 truncate font-mono text-[12px] font-semibold" style={{ color: "var(--dsw-label-primary)" }}>{tool.name}</span>
|
|
253
|
+
<span className="flex-none rounded-full px-2 py-0.5" style={{ fontSize: 10.5, border: "1px solid var(--dsw-border-l2)", color: "var(--dsw-label-tertiary)", background: "var(--dsw-bg-base)" }}>
|
|
254
|
+
{tool.source === "builtin" ? t.promptToolBuiltin : t.promptToolExtension}
|
|
255
|
+
</span>
|
|
256
|
+
</button>
|
|
257
|
+
))}
|
|
258
|
+
</div>
|
|
259
|
+
</section>
|
|
260
|
+
)}
|
|
261
|
+
|
|
262
|
+
{data?.assembledSystemPrompt && (
|
|
263
|
+
<section className="mb-3">
|
|
264
|
+
<div className="mb-1 px-1" style={{ fontSize: 11.5, color: "var(--dsw-label-caption)" }}>{t.promptKindAssembled}</div>
|
|
265
|
+
<button
|
|
266
|
+
type="button"
|
|
267
|
+
className="w-full rounded-xl px-2.5 py-2 text-left transition-all"
|
|
268
|
+
style={{
|
|
269
|
+
border: "1px solid var(--dsw-border-l2)",
|
|
270
|
+
background: "var(--dsw-bg-elevated)",
|
|
271
|
+
transition: "all 0.2s var(--isx-ease)",
|
|
272
|
+
}}
|
|
273
|
+
title={t.promptAssembledKey}
|
|
274
|
+
onMouseEnter={(e) => {
|
|
275
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l3)";
|
|
276
|
+
e.currentTarget.style.background = "var(--dsw-hover)";
|
|
277
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
278
|
+
}}
|
|
279
|
+
onMouseLeave={(e) => {
|
|
280
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l2)";
|
|
281
|
+
e.currentTarget.style.background = "var(--dsw-bg-elevated)";
|
|
282
|
+
e.currentTarget.style.transform = "none";
|
|
283
|
+
}}
|
|
284
|
+
onClick={() => onOpenContent?.("system-prompt.md", data.assembledSystemPrompt ?? "")}
|
|
285
|
+
>
|
|
286
|
+
<span className="truncate font-medium" style={{ color: "var(--dsw-label-primary)" }}>{t.promptAssembledKey}</span>
|
|
287
|
+
</button>
|
|
288
|
+
</section>
|
|
289
|
+
)}
|
|
290
|
+
|
|
291
|
+
{data?.compactedSummary && (
|
|
292
|
+
<section className="mb-3">
|
|
293
|
+
<div className="mb-1 px-1" style={{ fontSize: 11.5, color: "var(--dsw-label-caption)" }}>{t.promptKindCompacted}</div>
|
|
294
|
+
<button
|
|
295
|
+
type="button"
|
|
296
|
+
className="w-full rounded-xl px-2.5 py-2 text-left transition-all"
|
|
297
|
+
style={{
|
|
298
|
+
border: "1px solid var(--dsw-border-l2)",
|
|
299
|
+
background: "var(--dsw-bg-elevated)",
|
|
300
|
+
transition: "all 0.2s var(--isx-ease)",
|
|
301
|
+
}}
|
|
302
|
+
title={t.promptCompactedKey}
|
|
303
|
+
onMouseEnter={(e) => {
|
|
304
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l3)";
|
|
305
|
+
e.currentTarget.style.background = "var(--dsw-hover)";
|
|
306
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
307
|
+
}}
|
|
308
|
+
onMouseLeave={(e) => {
|
|
309
|
+
e.currentTarget.style.borderColor = "var(--dsw-border-l2)";
|
|
310
|
+
e.currentTarget.style.background = "var(--dsw-bg-elevated)";
|
|
311
|
+
e.currentTarget.style.transform = "none";
|
|
312
|
+
}}
|
|
313
|
+
onClick={() => onOpenContent?.("compacted-summary.md", data.compactedSummary ?? "")}
|
|
314
|
+
>
|
|
315
|
+
<span className="truncate font-medium" style={{ color: "var(--dsw-label-primary)" }}>{t.promptCompactedKey}</span>
|
|
316
|
+
</button>
|
|
317
|
+
</section>
|
|
318
|
+
)}
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
);
|
|
322
|
+
}
|