@seqyuan/annodex 0.1.10 → 0.1.12
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/app/api/agent/[id]/events/route.ts +94 -0
- package/app/api/agent/[id]/route.ts +83 -0
- package/app/api/agent/new/route.ts +53 -0
- package/app/api/auth/all-providers/route.ts +21 -0
- package/app/api/auth/api-key/[provider]/route.ts +7 -0
- package/app/api/auth/login/[provider]/route.ts +7 -0
- package/app/api/auth/login/route.ts +22 -0
- package/app/api/auth/logout/[provider]/route.ts +7 -0
- package/app/api/auth/providers/route.ts +15 -0
- package/app/api/auth/status/route.ts +6 -0
- package/app/api/default-cwd/route.ts +22 -0
- package/app/api/files/[...path]/route.ts +621 -0
- package/app/api/harness/route.ts +47 -0
- package/app/api/home/route.ts +6 -0
- package/app/api/internal/runtime/route.ts +26 -0
- package/app/api/models/route.ts +67 -0
- package/app/api/models-config/discover/route.ts +42 -0
- package/app/api/models-config/route.ts +152 -0
- package/app/api/models-config/test/route.ts +154 -0
- package/app/api/projects/browse/route.ts +51 -0
- package/app/api/projects/route.ts +83 -0
- package/app/api/reports/[id]/route.ts +108 -0
- package/app/api/search/route.ts +122 -0
- package/app/api/sessions/[id]/context/route.ts +23 -0
- package/app/api/sessions/[id]/route.ts +124 -0
- package/app/api/sessions/new/route.ts +5 -0
- package/app/api/sessions/route.ts +16 -0
- package/app/api/settings/route.ts +51 -0
- package/app/api/skills/install/route.ts +249 -0
- package/app/api/skills/route.ts +161 -0
- package/app/api/skills/search/route.ts +121 -0
- package/app/api/soul/route.ts +47 -0
- package/app/api/version/route.ts +55 -0
- package/app/globals.css +736 -0
- package/app/layout.tsx +40 -0
- package/app/login/page.tsx +133 -0
- package/app/page.tsx +10 -0
- package/components/AppShell.tsx +1058 -0
- package/components/ChatInput.tsx +1103 -0
- package/components/ChatMinimap.tsx +381 -0
- package/components/ChatWindow.tsx +576 -0
- package/components/CodeMirrorEditor.tsx +137 -0
- package/components/ConversationSearch.tsx +369 -0
- package/components/DataTableViewer.tsx +248 -0
- package/components/FileExplorer.tsx +758 -0
- package/components/FileIcons.tsx +241 -0
- package/components/FileViewer.tsx +1273 -0
- package/components/GlobalFileEditor.tsx +98 -0
- package/components/MarkdownRenderer.tsx +331 -0
- package/components/MermaidDiagram.tsx +80 -0
- package/components/MessageView.tsx +1141 -0
- package/components/ModelsConfig.tsx +1991 -0
- package/components/ProjectContext.tsx +252 -0
- package/components/ProjectFolderPicker.tsx +202 -0
- package/components/ProjectsConfig.tsx +288 -0
- package/components/ProviderIcons.tsx +91 -0
- package/components/ReportPanel.tsx +237 -0
- package/components/ResizeHandle.tsx +105 -0
- package/components/SessionSidebar.tsx +1464 -0
- package/components/SettingsDialog.tsx +287 -0
- package/components/SkillsConfig.tsx +1093 -0
- package/components/SubagentPanel.tsx +191 -0
- package/components/TabBar.tsx +115 -0
- package/components/ToolPanel.tsx +131 -0
- package/components/WidgetRenderer.tsx +505 -0
- package/components/viewers/DocumentToolbar.tsx +78 -0
- package/components/viewers/DocxViewer.tsx +97 -0
- package/components/viewers/PdfViewer.tsx +206 -0
- package/components/viewers/PptxViewer.tsx +240 -0
- package/components/viewers/XlsxViewer.tsx +143 -0
- package/hooks/useAgentSession.ts +710 -0
- package/hooks/useAudio.ts +50 -0
- package/hooks/useDragDrop.ts +52 -0
- package/hooks/useResizable.ts +60 -0
- package/hooks/useTheme.ts +85 -0
- package/lib/agent-client.ts +39 -0
- package/lib/annodex-config.ts +556 -0
- package/lib/auth-token.ts +74 -0
- package/lib/auth.ts +90 -0
- package/lib/brand.ts +5 -0
- package/lib/code-theme.ts +32 -0
- package/lib/codex-compat-proxy.ts +1603 -0
- package/lib/codex-home.ts +6 -0
- package/lib/codex-server.ts +796 -0
- package/lib/codex-session.ts +590 -0
- package/lib/codex-usage.ts +213 -0
- package/lib/file-paths.ts +34 -0
- package/lib/model-discovery.ts +379 -0
- package/lib/normalize.ts +30 -0
- package/lib/npx.ts +87 -0
- package/lib/pi-types.ts +49 -0
- package/lib/projects.ts +269 -0
- package/lib/provider-api.ts +88 -0
- package/lib/report-prompt.ts +61 -0
- package/lib/report-store.ts +597 -0
- package/lib/report-update-parser.ts +66 -0
- package/lib/rpc-manager.ts +668 -0
- package/lib/runtime-state.ts +117 -0
- package/lib/session-reader.ts +903 -0
- package/lib/session-runtime.ts +105 -0
- package/lib/subagent-progress.ts +279 -0
- package/lib/types.ts +241 -0
- package/lib/widget-export.ts +318 -0
- package/lib/widget-guidelines.ts +288 -0
- package/lib/widget-prompt.ts +76 -0
- package/lib/widget-utils.ts +523 -0
- package/package.json +23 -18
- package/postcss.config.mjs +8 -0
- package/proxy.ts +64 -0
- package/scripts/postinstall.cjs +25 -0
- package/tsconfig.json +41 -0
- package/.next/BUILD_ID +0 -1
- package/.next/app-path-routes-manifest.json +0 -39
- package/.next/build-manifest.json +0 -20
- package/.next/diagnostics/build-diagnostics.json +0 -6
- package/.next/diagnostics/framework.json +0 -1
- package/.next/export-marker.json +0 -6
- package/.next/images-manifest.json +0 -68
- package/.next/next-minimal-server.js.nft.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -109
- package/.next/react-loadable-manifest.json +0 -2320
- package/.next/required-server-files.js +0 -343
- package/.next/required-server-files.json +0 -343
- package/.next/routes-manifest.json +0 -286
- package/.next/server/app/_global-error/page.js +0 -32
- package/.next/server/app/_global-error/page.js.nft.json +0 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +0 -1
- package/.next/server/app/_global-error.html +0 -1
- package/.next/server/app/_global-error.meta +0 -16
- package/.next/server/app/_global-error.rsc +0 -14
- package/.next/server/app/_global-error.segments/_full.segment.rsc +0 -14
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_head.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_index.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +0 -1
- package/.next/server/app/_not-found/page.js +0 -2
- package/.next/server/app/_not-found/page.js.nft.json +0 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
- package/.next/server/app/_not-found.html +0 -1
- package/.next/server/app/_not-found.meta +0 -16
- package/.next/server/app/_not-found.rsc +0 -18
- package/.next/server/app/_not-found.segments/_full.segment.rsc +0 -18
- package/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
- package/.next/server/app/_not-found.segments/_index.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +0 -4
- package/.next/server/app/api/agent/[id]/events/route.js +0 -3
- package/.next/server/app/api/agent/[id]/events/route.js.nft.json +0 -1
- package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/agent/[id]/route.js +0 -1
- package/.next/server/app/api/agent/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/agent/new/route.js +0 -1
- package/.next/server/app/api/agent/new/route.js.nft.json +0 -1
- package/.next/server/app/api/agent/new/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/all-providers/route.js +0 -1
- package/.next/server/app/api/auth/all-providers/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +0 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +0 -1
- package/.next/server/app/api/auth/login/[provider]/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/login/route.js +0 -1
- package/.next/server/app/api/auth/login/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +0 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/providers/route.js +0 -1
- package/.next/server/app/api/auth/providers/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/status/route.js +0 -1
- package/.next/server/app/api/auth/status/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/default-cwd/route.js +0 -1
- package/.next/server/app/api/default-cwd/route.js.nft.json +0 -1
- package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/files/[...path]/route.js +0 -4
- package/.next/server/app/api/files/[...path]/route.js.nft.json +0 -1
- package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/harness/route.js +0 -1
- package/.next/server/app/api/harness/route.js.nft.json +0 -1
- package/.next/server/app/api/harness/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/home/route.js +0 -1
- package/.next/server/app/api/home/route.js.nft.json +0 -1
- package/.next/server/app/api/home/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/internal/runtime/route.js +0 -1
- package/.next/server/app/api/internal/runtime/route.js.nft.json +0 -1
- package/.next/server/app/api/internal/runtime/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models/route.js +0 -1
- package/.next/server/app/api/models/route.js.nft.json +0 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models-config/discover/route.js +0 -1
- package/.next/server/app/api/models-config/discover/route.js.nft.json +0 -1
- package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models-config/route.js +0 -1
- package/.next/server/app/api/models-config/route.js.nft.json +0 -1
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models-config/test/route.js +0 -1
- package/.next/server/app/api/models-config/test/route.js.nft.json +0 -1
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/projects/browse/route.js +0 -1
- package/.next/server/app/api/projects/browse/route.js.nft.json +0 -1
- package/.next/server/app/api/projects/browse/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/projects/route.js +0 -1
- package/.next/server/app/api/projects/route.js.nft.json +0 -1
- package/.next/server/app/api/projects/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/reports/[id]/route.js +0 -10
- package/.next/server/app/api/reports/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/reports/[id]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/search/route.js +0 -1
- package/.next/server/app/api/search/route.js.nft.json +0 -1
- package/.next/server/app/api/search/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +0 -1
- package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/[id]/route.js +0 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/new/route.js +0 -1
- package/.next/server/app/api/sessions/new/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/new/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/route.js +0 -1
- package/.next/server/app/api/sessions/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/settings/route.js +0 -1
- package/.next/server/app/api/settings/route.js.nft.json +0 -1
- package/.next/server/app/api/settings/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/skills/install/route.js +0 -5
- package/.next/server/app/api/skills/install/route.js.nft.json +0 -1
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/skills/route.js +0 -6
- package/.next/server/app/api/skills/route.js.nft.json +0 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/skills/search/route.js +0 -1
- package/.next/server/app/api/skills/search/route.js.nft.json +0 -1
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/soul/route.js +0 -1
- package/.next/server/app/api/soul/route.js.nft.json +0 -1
- package/.next/server/app/api/soul/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/version/route.js +0 -1
- package/.next/server/app/api/version/route.js.nft.json +0 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +0 -1
- package/.next/server/app/index.html +0 -1
- package/.next/server/app/index.meta +0 -14
- package/.next/server/app/index.rsc +0 -17
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +0 -6
- package/.next/server/app/index.segments/_full.segment.rsc +0 -17
- package/.next/server/app/index.segments/_head.segment.rsc +0 -6
- package/.next/server/app/index.segments/_index.segment.rsc +0 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +0 -4
- package/.next/server/app/login/page.js +0 -2
- package/.next/server/app/login/page.js.nft.json +0 -1
- package/.next/server/app/login/page_client-reference-manifest.js +0 -1
- package/.next/server/app/login.html +0 -1
- package/.next/server/app/login.meta +0 -15
- package/.next/server/app/login.rsc +0 -22
- package/.next/server/app/login.segments/_full.segment.rsc +0 -22
- package/.next/server/app/login.segments/_head.segment.rsc +0 -6
- package/.next/server/app/login.segments/_index.segment.rsc +0 -5
- package/.next/server/app/login.segments/_tree.segment.rsc +0 -4
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +0 -9
- package/.next/server/app/login.segments/login.segment.rsc +0 -5
- package/.next/server/app/page.js +0 -261
- package/.next/server/app/page.js.nft.json +0 -1
- package/.next/server/app/page_client-reference-manifest.js +0 -1
- package/.next/server/app-paths-manifest.json +0 -39
- package/.next/server/chunks/1048.js +0 -1
- package/.next/server/chunks/1367.js +0 -77
- package/.next/server/chunks/1381.js +0 -1
- package/.next/server/chunks/165.js +0 -1
- package/.next/server/chunks/1681.js +0 -215
- package/.next/server/chunks/1688.js +0 -45
- package/.next/server/chunks/1703.js +0 -79
- package/.next/server/chunks/1712.js +0 -43
- package/.next/server/chunks/1813.js +0 -1
- package/.next/server/chunks/2325.js +0 -80
- package/.next/server/chunks/258.js +0 -1
- package/.next/server/chunks/2671.js +0 -287
- package/.next/server/chunks/2778.js +0 -1
- package/.next/server/chunks/2943.js +0 -1
- package/.next/server/chunks/3031.js +0 -226
- package/.next/server/chunks/3181.js +0 -1
- package/.next/server/chunks/3493.js +0 -1
- package/.next/server/chunks/3672.js +0 -1
- package/.next/server/chunks/3701.js +0 -104
- package/.next/server/chunks/4013.js +0 -1
- package/.next/server/chunks/402.js +0 -2
- package/.next/server/chunks/4035.js +0 -80
- package/.next/server/chunks/4248.js +0 -153
- package/.next/server/chunks/4367.js +0 -1
- package/.next/server/chunks/4406.js +0 -141
- package/.next/server/chunks/4741.js +0 -18
- package/.next/server/chunks/4768.js +0 -1
- package/.next/server/chunks/4858.js +0 -148
- package/.next/server/chunks/4980.js +0 -1
- package/.next/server/chunks/5155.js +0 -5
- package/.next/server/chunks/5293.js +0 -166
- package/.next/server/chunks/5399.js +0 -8
- package/.next/server/chunks/5409.js +0 -1
- package/.next/server/chunks/5797.js +0 -93
- package/.next/server/chunks/5851.js +0 -36
- package/.next/server/chunks/6206.js +0 -1
- package/.next/server/chunks/6296.js +0 -1
- package/.next/server/chunks/63.js +0 -45
- package/.next/server/chunks/6346.js +0 -1
- package/.next/server/chunks/6406.js +0 -23
- package/.next/server/chunks/642.js +0 -1
- package/.next/server/chunks/6429.js +0 -50
- package/.next/server/chunks/6729.js +0 -64
- package/.next/server/chunks/6907.js +0 -115
- package/.next/server/chunks/6980.js +0 -1
- package/.next/server/chunks/7073.js +0 -24
- package/.next/server/chunks/7233.js +0 -24
- package/.next/server/chunks/7307.js +0 -1
- package/.next/server/chunks/7362.js +0 -9
- package/.next/server/chunks/7567.js +0 -29
- package/.next/server/chunks/7765.js +0 -1
- package/.next/server/chunks/7890.js +0 -1
- package/.next/server/chunks/8065.js +0 -1
- package/.next/server/chunks/8238.js +0 -34
- package/.next/server/chunks/8276.js +0 -1
- package/.next/server/chunks/8336.js +0 -1
- package/.next/server/chunks/8477.js +0 -3
- package/.next/server/chunks/8490.js +0 -1
- package/.next/server/chunks/8916.js +0 -1
- package/.next/server/chunks/9280.js +0 -252
- package/.next/server/chunks/9315.js +0 -1
- package/.next/server/chunks/9537.js +0 -90
- package/.next/server/chunks/966.js +0 -1
- package/.next/server/chunks/9818.js +0 -21
- package/.next/server/chunks/static/media/pdf.worker.min.c476e1a0.mjs +0 -6
- package/.next/server/functions-config-manifest.json +0 -16
- package/.next/server/interception-route-rewrite-manifest.js +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/middleware.js +0 -18
- package/.next/server/middleware.js.nft.json +0 -1
- package/.next/server/next-font-manifest.js +0 -1
- package/.next/server/next-font-manifest.json +0 -1
- package/.next/server/pages/404.html +0 -1
- package/.next/server/pages/500.html +0 -1
- package/.next/server/pages-manifest.json +0 -4
- package/.next/server/prefetch-hints.json +0 -1
- package/.next/server/server-reference-manifest.js +0 -1
- package/.next/server/server-reference-manifest.json +0 -1
- package/.next/server/webpack-runtime.js +0 -1
- package/.next/static/6cuMSvcr0FVO-GiK5RJZh/_buildManifest.js +0 -1
- package/.next/static/6cuMSvcr0FVO-GiK5RJZh/_ssgManifest.js +0 -1
- package/.next/static/chunks/0b9a0da7.9075af772487e743.js +0 -62
- package/.next/static/chunks/1413.922d232de90c0c41.js +0 -115
- package/.next/static/chunks/1643.467a526a1f24f54d.js +0 -24
- package/.next/static/chunks/1852.5543122f11aa7fed.js +0 -1
- package/.next/static/chunks/1960.b1e26436d7a5f586.js +0 -1
- package/.next/static/chunks/2170a4aa.4213bb2183c9cdf9.js +0 -1
- package/.next/static/chunks/2274.6cd173f80a1405a2.js +0 -21
- package/.next/static/chunks/2419.347fdfe3c170854d.js +0 -166
- package/.next/static/chunks/2619.9aac8983f30c7c8a.js +0 -1
- package/.next/static/chunks/2623.d20fabd8e18197c6.js +0 -287
- package/.next/static/chunks/2729.f5365061a849d659.js +0 -34
- package/.next/static/chunks/2821.934bcf60fbdc28c6.js +0 -1
- package/.next/static/chunks/2918becc.abff2ece1de37bc1.js +0 -153
- package/.next/static/chunks/2947.114e51cb06d1c01a.js +0 -23
- package/.next/static/chunks/3079.4c511fa1144e3adf.js +0 -79
- package/.next/static/chunks/3274.208ca44844cd7d95.js +0 -148
- package/.next/static/chunks/3308.465a94263d04bfea.js +0 -73
- package/.next/static/chunks/3325.e4bfe1ca657f3b5b.js +0 -80
- package/.next/static/chunks/3506.2a7eaa08b9f55337.js +0 -90
- package/.next/static/chunks/363642f4-043c1475ab9af70e.js +0 -1
- package/.next/static/chunks/3794-123fdf632563f469.js +0 -32
- package/.next/static/chunks/3837.a755ccfe6f9c1c1c.js +0 -5
- package/.next/static/chunks/394.91597771688df6d0.js +0 -1
- package/.next/static/chunks/3997.1009c06025691712.js +0 -1
- package/.next/static/chunks/4453.91a357dc43c21745.js +0 -1
- package/.next/static/chunks/4491.44fdf20580ac72bd.js +0 -24
- package/.next/static/chunks/4829.cf1d50e43e6d9db5.js +0 -1
- package/.next/static/chunks/498.fe1d9da9ecad6c36.js +0 -1
- package/.next/static/chunks/4bd1b696-e356ca5ba0218e27.js +0 -1
- package/.next/static/chunks/5019.b5a1a2b8daf17525.js +0 -1
- package/.next/static/chunks/5034.8f16c3fa3ce75411.js +0 -1
- package/.next/static/chunks/5074.d16651da01ec4e02.js +0 -1
- package/.next/static/chunks/51fb665c.0950e1b79671348d.js +0 -45
- package/.next/static/chunks/532.5956ed631aff722b.js +0 -9
- package/.next/static/chunks/5326.69460442bdcd6cd3.js +0 -1
- package/.next/static/chunks/5403.ff110bf5bf600758.js +0 -64
- package/.next/static/chunks/547.902a733488cfe3f7.js +0 -77
- package/.next/static/chunks/5567.540d7fc108ad6ee5.js +0 -215
- package/.next/static/chunks/5590.ef62922166d308b4.js +0 -1
- package/.next/static/chunks/5690.9d6eb1edb1399995.js +0 -1
- package/.next/static/chunks/5749.25faee4a1e55b854.js +0 -226
- package/.next/static/chunks/58bb9007.1ccb6bba34b4c635.js +0 -80
- package/.next/static/chunks/6121.f3f43f1896ea0cd9.js +0 -1
- package/.next/static/chunks/6600.583c88eef37aa524.js +0 -1
- package/.next/static/chunks/6696.a41aec266e657d54.js +0 -141
- package/.next/static/chunks/6922.42148793782d2fe7.js +0 -1
- package/.next/static/chunks/7006.e191611ffc2b9528.js +0 -43
- package/.next/static/chunks/7343.9fbb58204d8ac681.js +0 -1
- package/.next/static/chunks/73972abe.25a4cffa03b2bcef.js +0 -119
- package/.next/static/chunks/7547.58bda8a2aabba0d4.js +0 -93
- package/.next/static/chunks/7648.4ae2f183b4db0353.js +0 -1
- package/.next/static/chunks/7874.8db6929b94cdf697.js +0 -1
- package/.next/static/chunks/7959.1f20a35df316216a.js +0 -104
- package/.next/static/chunks/83.85d62d7fc9850b75.js +0 -29
- package/.next/static/chunks/8436.cab94b59cca0a8ff.js +0 -1
- package/.next/static/chunks/8451.ff6ff72b57dc52e1.js +0 -1
- package/.next/static/chunks/8489.45f22859734f514f.js +0 -36
- package/.next/static/chunks/8568.f85d8b36fc9a9037.js +0 -1
- package/.next/static/chunks/8771-3e14b6810486df1f.js +0 -1
- package/.next/static/chunks/8863.be51033a67436277.js +0 -1
- package/.next/static/chunks/90542734.dc1a2723e4f6affb.js +0 -1
- package/.next/static/chunks/9500.1488aec06ee78127.js +0 -1
- package/.next/static/chunks/9633.155548b5fca6e580.js +0 -1
- package/.next/static/chunks/9779.673004a62d70e36a.js +0 -1
- package/.next/static/chunks/app/_global-error/page-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/_not-found/page-c72daab99269beff.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/harness/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/home/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/internal/runtime/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/projects/browse/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/projects/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/reports/[id]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/search/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/new/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/settings/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/skills/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/soul/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/version/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/layout-be148b7ae915b22a.js +0 -1
- package/.next/static/chunks/app/login/page-ebf0e6de99062783.js +0 -1
- package/.next/static/chunks/app/page-c45d98ea81c548ca.js +0 -260
- package/.next/static/chunks/d3ac728e.7964f816a1ca64e5.js +0 -1
- package/.next/static/chunks/framework-711ef29bc66f648c.js +0 -1
- package/.next/static/chunks/main-app-45a0f19af99d61b6.js +0 -1
- package/.next/static/chunks/main-f74964b7ae52493e.js +0 -5
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-9bfa08b9491621f2.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/.next/static/chunks/webpack-fcf4a889ecbd753c.js +0 -1
- package/.next/static/css/45029451a1d7255d.css +0 -3
- package/.next/static/media/15605e25b523335c-s.woff2 +0 -0
- package/.next/static/media/1a3dce5cfb5f7760-s.woff2 +0 -0
- package/.next/static/media/1cdd02902f937a18-s.woff2 +0 -0
- package/.next/static/media/4c4b3b30b6bcb2be-s.woff2 +0 -0
- package/.next/static/media/641a7b8a5800ee0e-s.woff2 +0 -0
- package/.next/static/media/7deddc85b7ffd1dc-s.p.woff2 +0 -0
- package/.next/static/media/ec14413c594b3356-s.p.woff2 +0 -0
- package/.next/static/media/pdf.worker.min.29aaf158.mjs +0 -6
- package/.next/trace +0 -74
- package/.next/trace-build +0 -1
- package/.next/types/app/api/agent/[id]/events/route.ts +0 -351
- package/.next/types/app/api/agent/[id]/route.ts +0 -351
- package/.next/types/app/api/agent/new/route.ts +0 -351
- package/.next/types/app/api/auth/all-providers/route.ts +0 -351
- package/.next/types/app/api/auth/api-key/[provider]/route.ts +0 -351
- package/.next/types/app/api/auth/login/[provider]/route.ts +0 -351
- package/.next/types/app/api/auth/login/route.ts +0 -351
- package/.next/types/app/api/auth/logout/[provider]/route.ts +0 -351
- package/.next/types/app/api/auth/providers/route.ts +0 -351
- package/.next/types/app/api/auth/status/route.ts +0 -351
- package/.next/types/app/api/default-cwd/route.ts +0 -351
- package/.next/types/app/api/files/[...path]/route.ts +0 -351
- package/.next/types/app/api/harness/route.ts +0 -351
- package/.next/types/app/api/home/route.ts +0 -351
- package/.next/types/app/api/internal/runtime/route.ts +0 -351
- package/.next/types/app/api/models/route.ts +0 -351
- package/.next/types/app/api/models-config/discover/route.ts +0 -351
- package/.next/types/app/api/models-config/route.ts +0 -351
- package/.next/types/app/api/models-config/test/route.ts +0 -351
- package/.next/types/app/api/projects/browse/route.ts +0 -351
- package/.next/types/app/api/projects/route.ts +0 -351
- package/.next/types/app/api/reports/[id]/route.ts +0 -351
- package/.next/types/app/api/search/route.ts +0 -351
- package/.next/types/app/api/sessions/[id]/context/route.ts +0 -351
- package/.next/types/app/api/sessions/[id]/route.ts +0 -351
- package/.next/types/app/api/sessions/new/route.ts +0 -351
- package/.next/types/app/api/sessions/route.ts +0 -351
- package/.next/types/app/api/settings/route.ts +0 -351
- package/.next/types/app/api/skills/install/route.ts +0 -351
- package/.next/types/app/api/skills/route.ts +0 -351
- package/.next/types/app/api/skills/search/route.ts +0 -351
- package/.next/types/app/api/soul/route.ts +0 -351
- package/.next/types/app/api/version/route.ts +0 -351
- package/.next/types/app/layout.ts +0 -87
- package/.next/types/app/login/page.ts +0 -87
- package/.next/types/app/page.ts +0 -87
- package/.next/types/package.json +0 -1
- package/.next/types/routes.d.ts +0 -106
- package/.next/types/validator.ts +0 -376
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import type { ProjectInfo } from "@/lib/types";
|
|
5
|
+
import { ProjectFolderPicker } from "./ProjectFolderPicker";
|
|
6
|
+
|
|
7
|
+
interface ProjectsConfigProps {
|
|
8
|
+
activeCwd: string | null;
|
|
9
|
+
onSelectProject?: (cwd: string) => void;
|
|
10
|
+
onProjectsChanged?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function formatRelativeTime(dateStr: string | null): string {
|
|
14
|
+
if (!dateStr) return "Never";
|
|
15
|
+
const date = new Date(dateStr);
|
|
16
|
+
const now = new Date();
|
|
17
|
+
const diff = now.getTime() - date.getTime();
|
|
18
|
+
const mins = Math.floor(diff / 60000);
|
|
19
|
+
const hours = Math.floor(diff / 3600000);
|
|
20
|
+
const days = Math.floor(diff / 86400000);
|
|
21
|
+
if (mins < 1) return "just now";
|
|
22
|
+
if (mins < 60) return `${mins}m ago`;
|
|
23
|
+
if (hours < 24) return `${hours}h ago`;
|
|
24
|
+
if (days < 7) return `${days}d ago`;
|
|
25
|
+
return date.toLocaleDateString();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function shortenPath(cwd: string): string {
|
|
29
|
+
const parts = cwd.split(/[\\/]/).filter(Boolean);
|
|
30
|
+
if (parts.length <= 3) return cwd;
|
|
31
|
+
return `.../${parts.slice(-3).join("/")}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function projectLastAccessed(project: ProjectInfo): string | null {
|
|
35
|
+
return project.lastAccessed ?? project.created ?? null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function ProjectsConfig({ activeCwd, onSelectProject, onProjectsChanged }: ProjectsConfigProps) {
|
|
39
|
+
const [projects, setProjects] = useState<ProjectInfo[]>([]);
|
|
40
|
+
const [loading, setLoading] = useState(true);
|
|
41
|
+
const [error, setError] = useState<string | null>(null);
|
|
42
|
+
const [pathValue, setPathValue] = useState("");
|
|
43
|
+
const [folderPickerOpen, setFolderPickerOpen] = useState(false);
|
|
44
|
+
const [busy, setBusy] = useState<string | null>(null);
|
|
45
|
+
const [editingCwd, setEditingCwd] = useState<string | null>(null);
|
|
46
|
+
const [renameValue, setRenameValue] = useState("");
|
|
47
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
48
|
+
|
|
49
|
+
const loadProjects = useCallback(async () => {
|
|
50
|
+
try {
|
|
51
|
+
setLoading(true);
|
|
52
|
+
const res = await fetch("/api/projects?sessionStats=1");
|
|
53
|
+
const data = await res.json() as { projects?: ProjectInfo[]; error?: string };
|
|
54
|
+
if (!res.ok || data.error) throw new Error(data.error ?? `HTTP ${res.status}`);
|
|
55
|
+
setProjects(data.projects ?? []);
|
|
56
|
+
setError(null);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
59
|
+
} finally {
|
|
60
|
+
setLoading(false);
|
|
61
|
+
}
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
void loadProjects();
|
|
66
|
+
}, [loadProjects]);
|
|
67
|
+
|
|
68
|
+
const totals = useMemo(() => ({
|
|
69
|
+
projects: projects.length,
|
|
70
|
+
chats: projects.reduce((sum, project) => sum + project.chatCount, 0),
|
|
71
|
+
}), [projects]);
|
|
72
|
+
|
|
73
|
+
const addProject = useCallback(async () => {
|
|
74
|
+
const cwd = pathValue.trim();
|
|
75
|
+
if (!cwd) return;
|
|
76
|
+
setBusy("add");
|
|
77
|
+
setError(null);
|
|
78
|
+
try {
|
|
79
|
+
const res = await fetch("/api/projects", {
|
|
80
|
+
method: "POST",
|
|
81
|
+
headers: { "Content-Type": "application/json" },
|
|
82
|
+
body: JSON.stringify({ cwd }),
|
|
83
|
+
});
|
|
84
|
+
const data = await res.json() as { error?: string };
|
|
85
|
+
if (!res.ok || data.error) throw new Error(data.error ?? `HTTP ${res.status}`);
|
|
86
|
+
setPathValue("");
|
|
87
|
+
onProjectsChanged?.();
|
|
88
|
+
onSelectProject?.(cwd);
|
|
89
|
+
void loadProjects();
|
|
90
|
+
} catch (err) {
|
|
91
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
92
|
+
} finally {
|
|
93
|
+
setBusy(null);
|
|
94
|
+
}
|
|
95
|
+
}, [loadProjects, onProjectsChanged, onSelectProject, pathValue]);
|
|
96
|
+
|
|
97
|
+
const addSelectedProject = useCallback(async (cwd: string) => {
|
|
98
|
+
setBusy("add");
|
|
99
|
+
setError(null);
|
|
100
|
+
try {
|
|
101
|
+
const res = await fetch("/api/projects", {
|
|
102
|
+
method: "POST",
|
|
103
|
+
headers: { "Content-Type": "application/json" },
|
|
104
|
+
body: JSON.stringify({ cwd }),
|
|
105
|
+
});
|
|
106
|
+
const data = await res.json() as { error?: string };
|
|
107
|
+
if (!res.ok || data.error) throw new Error(data.error ?? `HTTP ${res.status}`);
|
|
108
|
+
setPathValue("");
|
|
109
|
+
setFolderPickerOpen(false);
|
|
110
|
+
onProjectsChanged?.();
|
|
111
|
+
onSelectProject?.(cwd);
|
|
112
|
+
void loadProjects();
|
|
113
|
+
} catch (err) {
|
|
114
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
115
|
+
} finally {
|
|
116
|
+
setBusy(null);
|
|
117
|
+
}
|
|
118
|
+
}, [loadProjects, onProjectsChanged, onSelectProject]);
|
|
119
|
+
|
|
120
|
+
const saveRename = useCallback(async (cwd: string) => {
|
|
121
|
+
setBusy(`rename:${cwd}`);
|
|
122
|
+
setError(null);
|
|
123
|
+
try {
|
|
124
|
+
const res = await fetch("/api/projects", {
|
|
125
|
+
method: "PATCH",
|
|
126
|
+
headers: { "Content-Type": "application/json" },
|
|
127
|
+
body: JSON.stringify({ cwd, name: renameValue }),
|
|
128
|
+
});
|
|
129
|
+
const data = await res.json() as { error?: string };
|
|
130
|
+
if (!res.ok || data.error) throw new Error(data.error ?? `HTTP ${res.status}`);
|
|
131
|
+
setEditingCwd(null);
|
|
132
|
+
setRenameValue("");
|
|
133
|
+
await loadProjects();
|
|
134
|
+
onProjectsChanged?.();
|
|
135
|
+
} catch (err) {
|
|
136
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
137
|
+
} finally {
|
|
138
|
+
setBusy(null);
|
|
139
|
+
}
|
|
140
|
+
}, [loadProjects, onProjectsChanged, renameValue]);
|
|
141
|
+
|
|
142
|
+
const removeProject = useCallback(async (cwd: string) => {
|
|
143
|
+
setBusy(`remove:${cwd}`);
|
|
144
|
+
setError(null);
|
|
145
|
+
try {
|
|
146
|
+
const res = await fetch("/api/projects", {
|
|
147
|
+
method: "DELETE",
|
|
148
|
+
headers: { "Content-Type": "application/json" },
|
|
149
|
+
body: JSON.stringify({ cwd }),
|
|
150
|
+
});
|
|
151
|
+
const data = await res.json() as { error?: string };
|
|
152
|
+
if (!res.ok || data.error) throw new Error(data.error ?? `HTTP ${res.status}`);
|
|
153
|
+
await loadProjects();
|
|
154
|
+
onProjectsChanged?.();
|
|
155
|
+
} catch (err) {
|
|
156
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
157
|
+
} finally {
|
|
158
|
+
setBusy(null);
|
|
159
|
+
}
|
|
160
|
+
}, [loadProjects, onProjectsChanged]);
|
|
161
|
+
|
|
162
|
+
const beginRename = useCallback((project: ProjectInfo) => {
|
|
163
|
+
setEditingCwd(project.cwd);
|
|
164
|
+
setRenameValue(project.name ?? project.displayName);
|
|
165
|
+
window.setTimeout(() => inputRef.current?.select(), 0);
|
|
166
|
+
}, []);
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div style={{ height: "100%", overflowY: "auto", padding: 20 }}>
|
|
170
|
+
<div style={{ maxWidth: 900, display: "flex", flexDirection: "column", gap: 14 }}>
|
|
171
|
+
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }}>
|
|
172
|
+
<div>
|
|
173
|
+
<div style={{ fontSize: 15, fontWeight: 750, color: "var(--text)" }}>Projects</div>
|
|
174
|
+
<div style={{ marginTop: 4, fontSize: 12, color: "var(--text-muted)" }}>
|
|
175
|
+
{totals.projects} projects / {totals.chats} chats
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
<button
|
|
179
|
+
type="button"
|
|
180
|
+
onClick={() => void loadProjects()}
|
|
181
|
+
style={{ height: 30, padding: "0 10px", border: "1px solid var(--border)", borderRadius: 6, background: "var(--bg-panel)", color: "var(--text-muted)", cursor: "pointer", fontSize: 12 }}
|
|
182
|
+
>
|
|
183
|
+
Refresh
|
|
184
|
+
</button>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<div style={{ border: "1px solid var(--border)", borderRadius: 8, background: "var(--bg-panel)", padding: 12 }}>
|
|
188
|
+
<div style={{ display: "flex", gap: 8, alignItems: "center" }}>
|
|
189
|
+
<input
|
|
190
|
+
value={pathValue}
|
|
191
|
+
onChange={(event) => setPathValue(event.target.value)}
|
|
192
|
+
onKeyDown={(event) => {
|
|
193
|
+
if (event.key === "Enter") void addProject();
|
|
194
|
+
}}
|
|
195
|
+
placeholder="/path/to/project"
|
|
196
|
+
style={{ flex: 1, minWidth: 0, height: 32, padding: "0 10px", border: "1px solid var(--border)", borderRadius: 6, background: "var(--bg)", color: "var(--text)", fontFamily: "var(--font-mono)", fontSize: 12, outline: "none" }}
|
|
197
|
+
/>
|
|
198
|
+
<button
|
|
199
|
+
type="button"
|
|
200
|
+
onClick={() => setFolderPickerOpen(true)}
|
|
201
|
+
style={{ height: 32, padding: "0 12px", border: "1px solid var(--border)", borderRadius: 6, background: "var(--bg)", color: "var(--text-muted)", cursor: "pointer", fontSize: 12 }}
|
|
202
|
+
>
|
|
203
|
+
Browse
|
|
204
|
+
</button>
|
|
205
|
+
<button
|
|
206
|
+
type="button"
|
|
207
|
+
disabled={!pathValue.trim() || busy === "add"}
|
|
208
|
+
onClick={() => void addProject()}
|
|
209
|
+
style={{ height: 32, padding: "0 12px", border: "none", borderRadius: 6, background: pathValue.trim() ? "var(--accent)" : "var(--bg-hover)", color: pathValue.trim() ? "#fff" : "var(--text-dim)", cursor: pathValue.trim() ? "pointer" : "default", fontSize: 12, fontWeight: 650 }}
|
|
210
|
+
>
|
|
211
|
+
Add
|
|
212
|
+
</button>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
{error && (
|
|
217
|
+
<div style={{ padding: "9px 11px", border: "1px solid rgba(248,113,113,0.35)", borderRadius: 7, color: "#f87171", background: "rgba(248,113,113,0.08)", fontSize: 12 }}>
|
|
218
|
+
{error}
|
|
219
|
+
</div>
|
|
220
|
+
)}
|
|
221
|
+
|
|
222
|
+
<div style={{ border: "1px solid var(--border)", borderRadius: 8, overflow: "hidden" }}>
|
|
223
|
+
{loading ? (
|
|
224
|
+
<div style={{ padding: 16, color: "var(--text-muted)", fontSize: 12 }}>Loading...</div>
|
|
225
|
+
) : projects.length === 0 ? (
|
|
226
|
+
<div style={{ padding: 16, color: "var(--text-muted)", fontSize: 12 }}>No projects yet.</div>
|
|
227
|
+
) : (
|
|
228
|
+
projects.map((project) => {
|
|
229
|
+
const active = project.cwd === activeCwd;
|
|
230
|
+
const editing = editingCwd === project.cwd;
|
|
231
|
+
const last = projectLastAccessed(project);
|
|
232
|
+
return (
|
|
233
|
+
<div key={project.cwd} style={{ display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", gap: 12, alignItems: "center", padding: "12px 14px", borderBottom: "1px solid var(--border)", background: active ? "var(--bg-selected)" : "var(--bg)" }}>
|
|
234
|
+
<div style={{ minWidth: 0 }}>
|
|
235
|
+
{editing ? (
|
|
236
|
+
<input
|
|
237
|
+
ref={inputRef}
|
|
238
|
+
value={renameValue}
|
|
239
|
+
onChange={(event) => setRenameValue(event.target.value)}
|
|
240
|
+
onKeyDown={(event) => {
|
|
241
|
+
if (event.key === "Enter") void saveRename(project.cwd);
|
|
242
|
+
if (event.key === "Escape") setEditingCwd(null);
|
|
243
|
+
}}
|
|
244
|
+
style={{ width: "min(360px, 100%)", height: 30, padding: "0 9px", border: "1px solid var(--accent)", borderRadius: 6, background: "var(--bg)", color: "var(--text)", fontSize: 13, outline: "none" }}
|
|
245
|
+
/>
|
|
246
|
+
) : (
|
|
247
|
+
<div style={{ color: "var(--text)", fontSize: 13, fontWeight: active ? 750 : 650, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
|
248
|
+
{project.displayName}
|
|
249
|
+
</div>
|
|
250
|
+
)}
|
|
251
|
+
<div style={{ marginTop: 4, color: "var(--text-dim)", fontSize: 11, fontFamily: "var(--font-mono)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }} title={project.cwd}>
|
|
252
|
+
{shortenPath(project.cwd)}
|
|
253
|
+
</div>
|
|
254
|
+
<div style={{ marginTop: 5, color: "var(--text-muted)", fontSize: 11 }}>
|
|
255
|
+
{project.chatCount} chats / last {formatRelativeTime(last)}{!project.exists ? " / path missing" : ""}
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
<div style={{ display: "flex", alignItems: "center", gap: 6 }}>
|
|
259
|
+
{editing ? (
|
|
260
|
+
<>
|
|
261
|
+
<button type="button" disabled={busy === `rename:${project.cwd}`} onClick={() => void saveRename(project.cwd)} style={{ height: 28, padding: "0 9px", border: "none", borderRadius: 6, background: "var(--accent)", color: "#fff", cursor: "pointer", fontSize: 12 }}>Save</button>
|
|
262
|
+
<button type="button" onClick={() => setEditingCwd(null)} style={{ height: 28, padding: "0 9px", border: "1px solid var(--border)", borderRadius: 6, background: "var(--bg-panel)", color: "var(--text-muted)", cursor: "pointer", fontSize: 12 }}>Cancel</button>
|
|
263
|
+
</>
|
|
264
|
+
) : (
|
|
265
|
+
<>
|
|
266
|
+
<button type="button" onClick={() => onSelectProject?.(project.cwd)} style={{ height: 28, padding: "0 9px", border: "1px solid var(--border)", borderRadius: 6, background: active ? "var(--accent)" : "var(--bg-panel)", color: active ? "#fff" : "var(--text-muted)", cursor: "pointer", fontSize: 12 }}>
|
|
267
|
+
{active ? "Current" : "Switch"}
|
|
268
|
+
</button>
|
|
269
|
+
<button type="button" onClick={() => beginRename(project)} style={{ height: 28, padding: "0 9px", border: "1px solid var(--border)", borderRadius: 6, background: "var(--bg-panel)", color: "var(--text-muted)", cursor: "pointer", fontSize: 12 }}>Rename</button>
|
|
270
|
+
<button type="button" disabled={busy === `remove:${project.cwd}`} onClick={() => void removeProject(project.cwd)} style={{ height: 28, padding: "0 9px", border: "1px solid rgba(248,113,113,0.35)", borderRadius: 6, background: "transparent", color: "#f87171", cursor: "pointer", fontSize: 12 }}>Remove</button>
|
|
271
|
+
</>
|
|
272
|
+
)}
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
);
|
|
276
|
+
})
|
|
277
|
+
)}
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
<ProjectFolderPicker
|
|
281
|
+
open={folderPickerOpen}
|
|
282
|
+
initialPath={activeCwd}
|
|
283
|
+
onClose={() => setFolderPickerOpen(false)}
|
|
284
|
+
onSelect={(path) => void addSelectedProject(path)}
|
|
285
|
+
/>
|
|
286
|
+
</div>
|
|
287
|
+
);
|
|
288
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type IconProps = { size?: number | string; style?: React.CSSProperties };
|
|
4
|
+
|
|
5
|
+
function svgIcon(path: React.ReactNode, viewBox = "0 0 24 24"): React.ComponentType<IconProps> {
|
|
6
|
+
const Icon = ({ size = 24, style }: IconProps) => (
|
|
7
|
+
<svg width={size} height={size} viewBox={viewBox} fill="none" style={style}>
|
|
8
|
+
{path}
|
|
9
|
+
</svg>
|
|
10
|
+
);
|
|
11
|
+
Icon.displayName = "ProviderIcon";
|
|
12
|
+
return Icon;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Simple geometric provider icons. Mono icons use currentColor; Color icons use their brand color.
|
|
16
|
+
|
|
17
|
+
export const AnthropicIcon = svgIcon(
|
|
18
|
+
<path d="M17.5 3H6.5L3 21h4l1.2-6h7.6l1.2 6h4L17.5 3zm-2.3 9H8.8L12 5.5 15.2 12z" fill="currentColor" />
|
|
19
|
+
);
|
|
20
|
+
export const OpenAIIcon = svgIcon(
|
|
21
|
+
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round" />
|
|
22
|
+
);
|
|
23
|
+
export const GoogleIcon = svgIcon(
|
|
24
|
+
<><path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4"/><path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/><path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/><path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/></>
|
|
25
|
+
);
|
|
26
|
+
export const DeepSeekIcon = svgIcon(
|
|
27
|
+
<><rect x="2" y="4" width="20" height="16" rx="3" fill="#4D6BFE"/><text x="12" y="16" textAnchor="middle" fill="white" fontSize="10" fontWeight="bold" fontFamily="sans-serif">DS</text></>
|
|
28
|
+
);
|
|
29
|
+
export const GroqIcon = svgIcon(
|
|
30
|
+
<path d="M4 4h16v16H4z" fill="#F55036"/>, "0 0 24 24"
|
|
31
|
+
);
|
|
32
|
+
export const MistralIcon = svgIcon(
|
|
33
|
+
<path d="M4 4h5v5H4zm5.5 0h5v5h-5zM15 4h5v5h-5zM4 9.5h5v5H4zm5.5 5.5h5v5h-5zM15 9.5h5v5h-5z" fill="#FA6F00"/>
|
|
34
|
+
);
|
|
35
|
+
export const MoonshotIcon = svgIcon(
|
|
36
|
+
<circle cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="1.5" fill="none"/>, "0 0 24 24"
|
|
37
|
+
);
|
|
38
|
+
export const MinimaxIcon = svgIcon(
|
|
39
|
+
<><rect x="2" y="4" width="20" height="16" rx="3" fill="#00D4AA"/><text x="12" y="16" textAnchor="middle" fill="white" fontSize="9" fontWeight="bold" fontFamily="sans-serif">MM</text></>
|
|
40
|
+
);
|
|
41
|
+
export const FireworksIcon = svgIcon(
|
|
42
|
+
<circle cx="12" cy="12" r="10" fill="#FF5722"/>, "0 0 24 24"
|
|
43
|
+
);
|
|
44
|
+
export const HuggingFaceIcon = svgIcon(
|
|
45
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 5h2v3h-2V7zm0 4h2v2h-2v-2zm3 5H7v-2h7v2z" fill="#FFD21E"/>
|
|
46
|
+
);
|
|
47
|
+
export const CerebrasIcon = svgIcon(
|
|
48
|
+
<><rect x="2" y="4" width="20" height="16" rx="3" fill="#E84026"/><text x="12" y="16" textAnchor="middle" fill="white" fontSize="9" fontWeight="bold" fontFamily="sans-serif">CB</text></>
|
|
49
|
+
);
|
|
50
|
+
export const OpenRouterIcon = svgIcon(
|
|
51
|
+
<path d="M12 2l9 5v10l-9 5-9-5V7l9-5z" stroke="currentColor" strokeWidth="1.5" fill="none"/>
|
|
52
|
+
);
|
|
53
|
+
export const XAIIcon = svgIcon(
|
|
54
|
+
<path d="M4 4l8 8 8-8M4 20l8-8 8 8" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/>
|
|
55
|
+
);
|
|
56
|
+
export const CloudflareIcon = svgIcon(
|
|
57
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 5l4 3-4 3V7z" fill="#F38020"/>
|
|
58
|
+
);
|
|
59
|
+
export const VercelIcon = svgIcon(
|
|
60
|
+
<path d="M12 2L22 20H2L12 2z" fill="currentColor"/>
|
|
61
|
+
);
|
|
62
|
+
export const GithubCopilotIcon = svgIcon(
|
|
63
|
+
<circle cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="1.5" fill="none"/>, "0 0 24 24"
|
|
64
|
+
);
|
|
65
|
+
export const AwsIcon = svgIcon(
|
|
66
|
+
<path d="M3 15h2l1-3h2l1 3h2V9H9v3L8 9H6l-1 3V9H3v6zm9 0h2v-2h2v-2h-2V9h-2v2h-2v2h2v2z" fill="#FF9900"/>
|
|
67
|
+
);
|
|
68
|
+
export const AzureIcon = svgIcon(
|
|
69
|
+
<path d="M12 2L3 18h5l4-6 4 6h5L12 2z" fill="#0078D4"/>
|
|
70
|
+
);
|
|
71
|
+
export const KimiIcon = svgIcon(
|
|
72
|
+
<><rect x="2" y="4" width="20" height="16" rx="3" fill="#6C5CE7"/><text x="12" y="16" textAnchor="middle" fill="white" fontSize="10" fontWeight="bold" fontFamily="sans-serif">Ki</text></>
|
|
73
|
+
);
|
|
74
|
+
export const QwenIcon = svgIcon(
|
|
75
|
+
<><rect x="2" y="4" width="20" height="16" rx="3" fill="#615CED"/><text x="12" y="16" textAnchor="middle" fill="white" fontSize="9" fontWeight="bold" fontFamily="sans-serif">QW</text></>
|
|
76
|
+
);
|
|
77
|
+
export const ZhipuIcon = svgIcon(
|
|
78
|
+
<><rect x="2" y="4" width="20" height="16" rx="3" fill="#3859FF"/><text x="12" y="16" textAnchor="middle" fill="white" fontSize="9" fontWeight="bold" fontFamily="sans-serif">ZP</text></>
|
|
79
|
+
);
|
|
80
|
+
export const CohereIcon = svgIcon(
|
|
81
|
+
<path d="M4 8h16v2H4zm0 4h12v2H4zm0 4h8v2H4z" fill="#3059B1"/>
|
|
82
|
+
);
|
|
83
|
+
export const PerplexityIcon = svgIcon(
|
|
84
|
+
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" stroke="#1DB954" strokeWidth="1.5" fill="none" strokeLinejoin="round"/>
|
|
85
|
+
);
|
|
86
|
+
export const TogetherIcon = svgIcon(
|
|
87
|
+
<circle cx="12" cy="12" r="10" fill="#0F6CBD"/>, "0 0 24 24"
|
|
88
|
+
);
|
|
89
|
+
export const GrokIcon = svgIcon(
|
|
90
|
+
<circle cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="1.5" fill="none"/>, "0 0 24 24"
|
|
91
|
+
);
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { MarkdownRenderer } from "@/components/MarkdownRenderer";
|
|
5
|
+
import type { AnalysisReport, AnalysisReportSection } from "@/lib/report-store";
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
sessionId: string | null;
|
|
9
|
+
cwd?: string;
|
|
10
|
+
refreshKey?: number;
|
|
11
|
+
onOpenFile?: (filePath: string, fileName: string) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type ViewMode = "preview" | "sections" | "changes" | "source";
|
|
15
|
+
|
|
16
|
+
function statusLabel(status: AnalysisReportSection["status"]): string {
|
|
17
|
+
if (status === "needs_review") return "Needs review";
|
|
18
|
+
return status.slice(0, 1).toUpperCase() + status.slice(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function statusColor(status: AnalysisReportSection["status"]): string {
|
|
22
|
+
if (status === "verified") return "#16a34a";
|
|
23
|
+
if (status === "outdated") return "#ef4444";
|
|
24
|
+
if (status === "needs_review") return "rgba(234,179,8,0.95)";
|
|
25
|
+
return "var(--text-dim)";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function sectionSnippet(markdown: string): string {
|
|
29
|
+
const cleaned = markdown.replace(/[#*_`>|-]/g, " ").replace(/\s+/g, " ").trim();
|
|
30
|
+
return cleaned || "No curated content yet.";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function ReportPanel({ sessionId, cwd, refreshKey = 0, onOpenFile }: Props) {
|
|
34
|
+
const [report, setReport] = useState<AnalysisReport | null>(null);
|
|
35
|
+
const [loading, setLoading] = useState(false);
|
|
36
|
+
const [generating, setGenerating] = useState(false);
|
|
37
|
+
const [error, setError] = useState<string | null>(null);
|
|
38
|
+
const [viewMode, setViewMode] = useState<ViewMode>("preview");
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!sessionId) {
|
|
42
|
+
setReport(null);
|
|
43
|
+
setError(null);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let cancelled = false;
|
|
47
|
+
setLoading(true);
|
|
48
|
+
setError(null);
|
|
49
|
+
fetch(`/api/reports/${encodeURIComponent(sessionId)}`)
|
|
50
|
+
.then((res) => res.ok ? res.json() : res.json().then((data) => Promise.reject(new Error(data.error ?? `HTTP ${res.status}`))))
|
|
51
|
+
.then((data: { report: AnalysisReport }) => {
|
|
52
|
+
if (!cancelled) setReport(data.report);
|
|
53
|
+
})
|
|
54
|
+
.catch((err) => {
|
|
55
|
+
if (!cancelled) setError(err instanceof Error ? err.message : String(err));
|
|
56
|
+
})
|
|
57
|
+
.finally(() => {
|
|
58
|
+
if (!cancelled) setLoading(false);
|
|
59
|
+
});
|
|
60
|
+
return () => { cancelled = true; };
|
|
61
|
+
}, [sessionId, refreshKey]);
|
|
62
|
+
|
|
63
|
+
const handleGenerate = useCallback(() => {
|
|
64
|
+
if (!sessionId) return;
|
|
65
|
+
setGenerating(true);
|
|
66
|
+
setError(null);
|
|
67
|
+
fetch(`/api/reports/${encodeURIComponent(sessionId)}`, {
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers: { "Content-Type": "application/json" },
|
|
70
|
+
body: JSON.stringify({ action: "generate" }),
|
|
71
|
+
})
|
|
72
|
+
.then((res) => res.ok ? res.json() : res.json().then((data) => Promise.reject(new Error(data.error ?? `HTTP ${res.status}`))))
|
|
73
|
+
.then((data: { report: AnalysisReport }) => {
|
|
74
|
+
setReport(data.report);
|
|
75
|
+
setViewMode("preview");
|
|
76
|
+
})
|
|
77
|
+
.catch((err) => setError(err instanceof Error ? err.message : String(err)))
|
|
78
|
+
.finally(() => setGenerating(false));
|
|
79
|
+
}, [sessionId]);
|
|
80
|
+
|
|
81
|
+
const sourceBasePath = useMemo(() => {
|
|
82
|
+
if (!cwd) return undefined;
|
|
83
|
+
return `${cwd.replace(/\/+$/, "")}/analysis_report.md`;
|
|
84
|
+
}, [cwd]);
|
|
85
|
+
const populatedSections = useMemo(
|
|
86
|
+
() => report?.sections.filter((section) => section.markdown.trim()) ?? [],
|
|
87
|
+
[report],
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
if (!sessionId) {
|
|
91
|
+
return (
|
|
92
|
+
<div style={{ height: "100%", display: "flex", alignItems: "center", justifyContent: "center", padding: 24, color: "var(--text-dim)", fontSize: 12, textAlign: "center" }}>
|
|
93
|
+
Select or start a session to build an analysis report.
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div style={{ height: "100%", display: "flex", flexDirection: "column", overflow: "hidden" }}>
|
|
100
|
+
<div style={{
|
|
101
|
+
display: "flex",
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
gap: 6,
|
|
104
|
+
padding: "8px 10px",
|
|
105
|
+
borderBottom: "1px solid var(--border)",
|
|
106
|
+
background: "var(--bg)",
|
|
107
|
+
flexShrink: 0,
|
|
108
|
+
}}>
|
|
109
|
+
{(["preview", "sections", "changes", "source"] as ViewMode[]).map((mode) => (
|
|
110
|
+
<button
|
|
111
|
+
key={mode}
|
|
112
|
+
type="button"
|
|
113
|
+
onClick={() => setViewMode(mode)}
|
|
114
|
+
style={{
|
|
115
|
+
height: 28,
|
|
116
|
+
padding: "0 9px",
|
|
117
|
+
border: "1px solid var(--border)",
|
|
118
|
+
borderRadius: 7,
|
|
119
|
+
background: viewMode === mode ? "var(--bg-selected)" : "var(--bg-panel)",
|
|
120
|
+
color: viewMode === mode ? "var(--text)" : "var(--text-muted)",
|
|
121
|
+
cursor: "pointer",
|
|
122
|
+
fontSize: 11,
|
|
123
|
+
textTransform: "capitalize",
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
{mode}
|
|
127
|
+
</button>
|
|
128
|
+
))}
|
|
129
|
+
<div style={{ flex: 1 }} />
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
onClick={handleGenerate}
|
|
133
|
+
disabled={generating}
|
|
134
|
+
title="Refresh analysis report from this session"
|
|
135
|
+
style={{
|
|
136
|
+
height: 28,
|
|
137
|
+
padding: "0 10px",
|
|
138
|
+
border: "1px solid rgba(37,99,235,0.45)",
|
|
139
|
+
borderRadius: 7,
|
|
140
|
+
background: "var(--bg-selected)",
|
|
141
|
+
color: "var(--accent)",
|
|
142
|
+
cursor: generating ? "default" : "pointer",
|
|
143
|
+
fontSize: 11,
|
|
144
|
+
fontWeight: 600,
|
|
145
|
+
opacity: generating ? 0.65 : 1,
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
{generating ? "Updating..." : "Update"}
|
|
149
|
+
</button>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
{error && (
|
|
153
|
+
<div style={{ padding: "8px 12px", color: "#ef4444", fontSize: 12, borderBottom: "1px solid var(--border)", background: "rgba(239,68,68,0.08)" }}>
|
|
154
|
+
{error}
|
|
155
|
+
</div>
|
|
156
|
+
)}
|
|
157
|
+
|
|
158
|
+
{loading ? (
|
|
159
|
+
<div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center", color: "var(--text-muted)", fontSize: 12 }}>
|
|
160
|
+
Loading report...
|
|
161
|
+
</div>
|
|
162
|
+
) : !report ? (
|
|
163
|
+
<div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center", color: "var(--text-dim)", fontSize: 12 }}>
|
|
164
|
+
No report available.
|
|
165
|
+
</div>
|
|
166
|
+
) : (
|
|
167
|
+
<div style={{ flex: 1, overflow: "auto" }}>
|
|
168
|
+
{viewMode === "preview" && (
|
|
169
|
+
<MarkdownRenderer
|
|
170
|
+
content={report.markdown}
|
|
171
|
+
className="markdown-body markdown-file-preview"
|
|
172
|
+
style={{ padding: "22px 26px 40px", maxWidth: 860, margin: "0 auto" }}
|
|
173
|
+
codeBlockVariant="file"
|
|
174
|
+
baseFilePath={sourceBasePath}
|
|
175
|
+
onOpenLocalFile={onOpenFile}
|
|
176
|
+
/>
|
|
177
|
+
)}
|
|
178
|
+
|
|
179
|
+
{viewMode === "sections" && (
|
|
180
|
+
<div style={{ padding: 12, display: "flex", flexDirection: "column", gap: 10 }}>
|
|
181
|
+
{populatedSections.map((section) => (
|
|
182
|
+
<div
|
|
183
|
+
key={section.id}
|
|
184
|
+
style={{
|
|
185
|
+
border: "1px solid var(--border)",
|
|
186
|
+
borderRadius: 8,
|
|
187
|
+
background: "var(--bg)",
|
|
188
|
+
overflow: "hidden",
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<div style={{ display: "flex", alignItems: "center", gap: 8, padding: "9px 11px", borderBottom: "1px solid var(--border)", background: "var(--bg-panel)" }}>
|
|
192
|
+
<div style={{ fontSize: 12, fontWeight: 700, color: "var(--text)", flex: 1 }}>{section.title}</div>
|
|
193
|
+
<span style={{ fontSize: 10, color: statusColor(section.status), border: `1px solid ${statusColor(section.status)}`, borderRadius: 999, padding: "2px 7px" }}>
|
|
194
|
+
{statusLabel(section.status)}
|
|
195
|
+
</span>
|
|
196
|
+
</div>
|
|
197
|
+
<div style={{ padding: "9px 11px", color: "var(--text-muted)", fontSize: 12, lineHeight: 1.5 }}>
|
|
198
|
+
{sectionSnippet(section.markdown)}
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
))}
|
|
202
|
+
</div>
|
|
203
|
+
)}
|
|
204
|
+
|
|
205
|
+
{viewMode === "changes" && (
|
|
206
|
+
<div style={{ padding: 14 }}>
|
|
207
|
+
{report.changes.length === 0 ? (
|
|
208
|
+
<div style={{ color: "var(--text-dim)", fontSize: 12 }}>No report changes yet.</div>
|
|
209
|
+
) : report.changes.map((change) => (
|
|
210
|
+
<div key={change.id} style={{ padding: "10px 0", borderBottom: "1px solid var(--border)" }}>
|
|
211
|
+
<div style={{ fontSize: 12, fontWeight: 700, color: "var(--text)", marginBottom: 4 }}>{change.title}</div>
|
|
212
|
+
<div style={{ fontSize: 11, color: "var(--text-dim)", marginBottom: 6 }}>{new Date(change.timestamp).toLocaleString()}</div>
|
|
213
|
+
<div style={{ fontSize: 12, color: "var(--text-muted)", lineHeight: 1.5 }}>{change.detail}</div>
|
|
214
|
+
</div>
|
|
215
|
+
))}
|
|
216
|
+
</div>
|
|
217
|
+
)}
|
|
218
|
+
|
|
219
|
+
{viewMode === "source" && (
|
|
220
|
+
<pre style={{
|
|
221
|
+
margin: 0,
|
|
222
|
+
padding: 18,
|
|
223
|
+
whiteSpace: "pre-wrap",
|
|
224
|
+
wordBreak: "break-word",
|
|
225
|
+
fontFamily: "var(--font-mono)",
|
|
226
|
+
fontSize: 12,
|
|
227
|
+
lineHeight: 1.55,
|
|
228
|
+
color: "var(--text-muted)",
|
|
229
|
+
}}>
|
|
230
|
+
{report.markdown}
|
|
231
|
+
</pre>
|
|
232
|
+
)}
|
|
233
|
+
</div>
|
|
234
|
+
)}
|
|
235
|
+
</div>
|
|
236
|
+
);
|
|
237
|
+
}
|