@wrongstack/webui 0.284.0 → 0.285.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +2 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/assets/{AnalyticsDashboard-BBoAzpgL.js → AnalyticsDashboard-Bn2wIgV0.js} +1 -1
- package/dist/assets/{AutoPhaseView-D053zOhN.js → AutoPhaseView-DWp3yHpI.js} +1 -1
- package/dist/assets/{ChangesView-4X9cQM4r.js → ChangesView-C_r4kccO.js} +1 -1
- package/dist/assets/{CodeEditor-C8hiA7LI.js → CodeEditor-DSpqZ-mS.js} +1 -1
- package/dist/assets/{DebugDashboard-DBPKvghW.js → DebugDashboard-DWKLI7lR.js} +1 -1
- package/dist/assets/{DesignGalleryView-CzF24Ppi.js → DesignGalleryView-Bk3HH3al.js} +1 -1
- package/dist/assets/KanbanView-CJqlvsbc.js +1 -0
- package/dist/assets/{MailboxDetailView-CCtq-c8u.js → MailboxDetailView-BwWagFay.js} +1 -1
- package/dist/assets/OfficeMapPanel-QFPaXTZ9.js +4 -0
- package/dist/assets/{ProcessMonitor-pm8Ih7-q.js → ProcessMonitor-dUyYv3Z4.js} +1 -1
- package/dist/assets/{QueuePanel-Lv54tvvk.js → QueuePanel-BdwvWRuB.js} +1 -1
- package/dist/assets/{RefreshDebugView-0VzJJqhZ.js → RefreshDebugView-eZwtZXgZ.js} +1 -1
- package/dist/assets/{SddBoardView-Q-k1UjLv.js → SddBoardView-OtKwEtAp.js} +1 -1
- package/dist/assets/{SddFlowGraph-BaWwH9Zc.js → SddFlowGraph-MVMUCMEy.js} +1 -1
- package/dist/assets/{SddWizard-C4wdyhYe.js → SddWizard-c7g68RFx.js} +1 -1
- package/dist/assets/SessionsDashboard-pMXfRTwN.js +1 -0
- package/dist/assets/{SkillDetailView-B4U0AtHj.js → SkillDetailView-CcdIF-85.js} +1 -1
- package/dist/assets/{SpecsView-QssXs9kF.js → SpecsView-yunV-Xfj.js} +1 -1
- package/dist/assets/{TerminalPanel-CSDEzJNZ.js → TerminalPanel-BIYT1IB3.js} +1 -1
- package/dist/assets/common-D8_r1x8x.js +1 -0
- package/dist/assets/common-suUxW9sA.js +1 -0
- package/dist/assets/{i18n-CkkVJCs9.js → i18n-BMePmaPJ.js} +2 -2
- package/dist/assets/index-CbrHWxbT.css +1 -0
- package/dist/assets/index-CyTNJHe8.js +154 -0
- package/dist/assets/local-prefs-BBMxai9I.js +1 -0
- package/dist/assets/settings-CKNx8p9I.js +1 -0
- package/dist/assets/settings-D-SHf0yS.js +1 -0
- package/dist/assets/ui-store-ComQYc5F.js +1 -0
- package/dist/assets/{ws-client-lDxBz-7w.js → ws-client-CwL51TNh.js} +1 -1
- package/dist/components/AgentTranscript.d.ts +13 -0
- package/dist/components/AgentTranscript.d.ts.map +1 -0
- package/dist/components/AgentsMonitor.d.ts +26 -0
- package/dist/components/AgentsMonitor.d.ts.map +1 -0
- package/dist/components/AgentsPage/format.d.ts +23 -0
- package/dist/components/AgentsPage/format.d.ts.map +1 -0
- package/dist/components/AgentsPage.d.ts +49 -0
- package/dist/components/AgentsPage.d.ts.map +1 -0
- package/dist/components/AnalyticsDashboard.d.ts +2 -0
- package/dist/components/AnalyticsDashboard.d.ts.map +1 -0
- package/dist/components/AutoPhaseView.d.ts +15 -0
- package/dist/components/AutoPhaseView.d.ts.map +1 -0
- package/dist/components/AutonomyPicker.d.ts +21 -0
- package/dist/components/AutonomyPicker.d.ts.map +1 -0
- package/dist/components/BoardView.d.ts +14 -0
- package/dist/components/BoardView.d.ts.map +1 -0
- package/dist/components/ChangesView.d.ts +10 -0
- package/dist/components/ChangesView.d.ts.map +1 -0
- package/dist/components/ChatInput/code-detect.d.ts +20 -0
- package/dist/components/ChatInput/code-detect.d.ts.map +1 -0
- package/dist/components/ChatInput/file-mention-picker.d.ts +15 -0
- package/dist/components/ChatInput/file-mention-picker.d.ts.map +1 -0
- package/dist/components/ChatInput/queued-messages.d.ts +9 -0
- package/dist/components/ChatInput/queued-messages.d.ts.map +1 -0
- package/dist/components/ChatInput/slash-commands.d.ts +17 -0
- package/dist/components/ChatInput/slash-commands.d.ts.map +1 -0
- package/dist/components/ChatInput/slash-routing.d.ts +79 -0
- package/dist/components/ChatInput/slash-routing.d.ts.map +1 -0
- package/dist/components/ChatInput/use-paste-drop.d.ts +29 -0
- package/dist/components/ChatInput/use-paste-drop.d.ts.map +1 -0
- package/dist/components/ChatInput.d.ts +5 -0
- package/dist/components/ChatInput.d.ts.map +1 -0
- package/dist/components/ChatView/ThinkingBubble.d.ts +8 -0
- package/dist/components/ChatView/ThinkingBubble.d.ts.map +1 -0
- package/dist/components/ChatView/index.d.ts +2 -0
- package/dist/components/ChatView/index.d.ts.map +1 -0
- package/dist/components/ChatView/utils.d.ts +44 -0
- package/dist/components/ChatView/utils.d.ts.map +1 -0
- package/dist/components/ChatView.d.ts +2 -0
- package/dist/components/ChatView.d.ts.map +1 -0
- package/dist/components/CheckpointTimeline.d.ts +7 -0
- package/dist/components/CheckpointTimeline.d.ts.map +1 -0
- package/dist/components/CodeEditor.d.ts +3 -0
- package/dist/components/CodeEditor.d.ts.map +1 -0
- package/dist/components/CollabPanel.d.ts +28 -0
- package/dist/components/CollabPanel.d.ts.map +1 -0
- package/dist/components/CommandPalette/export-utils.d.ts +10 -0
- package/dist/components/CommandPalette/export-utils.d.ts.map +1 -0
- package/dist/components/CommandPalette/index.d.ts +2 -0
- package/dist/components/CommandPalette/index.d.ts.map +1 -0
- package/dist/components/CommandPalette.d.ts +3 -0
- package/dist/components/CommandPalette.d.ts.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +2 -0
- package/dist/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmModal.d.ts +59 -0
- package/dist/components/ConfirmModal.d.ts.map +1 -0
- package/dist/components/ConnectionBanner.d.ts +13 -0
- package/dist/components/ConnectionBanner.d.ts.map +1 -0
- package/dist/components/ContextBar.d.ts +35 -0
- package/dist/components/ContextBar.d.ts.map +1 -0
- package/dist/components/ContextBreakdownModal.d.ts +7 -0
- package/dist/components/ContextBreakdownModal.d.ts.map +1 -0
- package/dist/components/ContextModePicker.d.ts +2 -0
- package/dist/components/ContextModePicker.d.ts.map +1 -0
- package/dist/components/CostChip.d.ts +12 -0
- package/dist/components/CostChip.d.ts.map +1 -0
- package/dist/components/DebugDashboard.d.ts +2 -0
- package/dist/components/DebugDashboard.d.ts.map +1 -0
- package/dist/components/DependencyGraph.d.ts +13 -0
- package/dist/components/DependencyGraph.d.ts.map +1 -0
- package/dist/components/DesignGalleryView.d.ts +14 -0
- package/dist/components/DesignGalleryView.d.ts.map +1 -0
- package/dist/components/DiffView.d.ts +33 -0
- package/dist/components/DiffView.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +40 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/FallbackEditor.d.ts +15 -0
- package/dist/components/FallbackEditor.d.ts.map +1 -0
- package/dist/components/FileExplorer.d.ts +2 -0
- package/dist/components/FileExplorer.d.ts.map +1 -0
- package/dist/components/FilePicker.d.ts +16 -0
- package/dist/components/FilePicker.d.ts.map +1 -0
- package/dist/components/FileReferenceChip.d.ts +8 -0
- package/dist/components/FileReferenceChip.d.ts.map +1 -0
- package/dist/components/FleetMonitor.d.ts +27 -0
- package/dist/components/FleetMonitor.d.ts.map +1 -0
- package/dist/components/FleetPanel.d.ts +17 -0
- package/dist/components/FleetPanel.d.ts.map +1 -0
- package/dist/components/GoalPanel.d.ts +7 -0
- package/dist/components/GoalPanel.d.ts.map +1 -0
- package/dist/components/InspectorPanel.d.ts +14 -0
- package/dist/components/InspectorPanel.d.ts.map +1 -0
- package/dist/components/KanbanView.d.ts +4 -0
- package/dist/components/KanbanView.d.ts.map +1 -0
- package/dist/components/MailboxDetailView.d.ts +8 -0
- package/dist/components/MailboxDetailView.d.ts.map +1 -0
- package/dist/components/MailboxPanel.d.ts +4 -0
- package/dist/components/MailboxPanel.d.ts.map +1 -0
- package/dist/components/MessageBubble/CopyButton.d.ts +6 -0
- package/dist/components/MessageBubble/CopyButton.d.ts.map +1 -0
- package/dist/components/MessageBubble/ErrorBody.d.ts +4 -0
- package/dist/components/MessageBubble/ErrorBody.d.ts.map +1 -0
- package/dist/components/MessageBubble/StreamingMarkdown.d.ts +24 -0
- package/dist/components/MessageBubble/StreamingMarkdown.d.ts.map +1 -0
- package/dist/components/MessageBubble/ToolInputView.d.ts +4 -0
- package/dist/components/MessageBubble/ToolInputView.d.ts.map +1 -0
- package/dist/components/MessageBubble/index.d.ts +9 -0
- package/dist/components/MessageBubble/index.d.ts.map +1 -0
- package/dist/components/MessageBubble/utils.d.ts +17 -0
- package/dist/components/MessageBubble/utils.d.ts.map +1 -0
- package/dist/components/MessageBubble.d.ts +2 -0
- package/dist/components/MessageBubble.d.ts.map +1 -0
- package/dist/components/ModePicker.d.ts +9 -0
- package/dist/components/ModePicker.d.ts.map +1 -0
- package/dist/components/ModelPicker.d.ts +18 -0
- package/dist/components/ModelPicker.d.ts.map +1 -0
- package/dist/components/MonacoDiffView.d.ts +13 -0
- package/dist/components/MonacoDiffView.d.ts.map +1 -0
- package/dist/components/NextStepsBar.d.ts +39 -0
- package/dist/components/NextStepsBar.d.ts.map +1 -0
- package/dist/components/OfficeMapCanvas/resolve.d.ts +48 -0
- package/dist/components/OfficeMapCanvas/resolve.d.ts.map +1 -0
- package/dist/components/OfficeMapCanvas/utils.d.ts +57 -0
- package/dist/components/OfficeMapCanvas/utils.d.ts.map +1 -0
- package/dist/components/OfficeMapCanvas.d.ts +10 -0
- package/dist/components/OfficeMapCanvas.d.ts.map +1 -0
- package/dist/components/OfficeMapPanel.d.ts +6 -0
- package/dist/components/OfficeMapPanel.d.ts.map +1 -0
- package/dist/components/OfficeMapSettingsPanel.d.ts +10 -0
- package/dist/components/OfficeMapSettingsPanel.d.ts.map +1 -0
- package/dist/components/PhasePanel.d.ts +42 -0
- package/dist/components/PhasePanel.d.ts.map +1 -0
- package/dist/components/PlanPanel.d.ts +14 -0
- package/dist/components/PlanPanel.d.ts.map +1 -0
- package/dist/components/ProcessMonitor.d.ts +7 -0
- package/dist/components/ProcessMonitor.d.ts.map +1 -0
- package/dist/components/PromptLibraryModal.d.ts +7 -0
- package/dist/components/PromptLibraryModal.d.ts.map +1 -0
- package/dist/components/QueuePanel.d.ts +11 -0
- package/dist/components/QueuePanel.d.ts.map +1 -0
- package/dist/components/QuickModelSwitcher.d.ts +10 -0
- package/dist/components/QuickModelSwitcher.d.ts.map +1 -0
- package/dist/components/QuickModelSwitcher.filter.d.ts +33 -0
- package/dist/components/QuickModelSwitcher.filter.d.ts.map +1 -0
- package/dist/components/RefinePanel.d.ts +24 -0
- package/dist/components/RefinePanel.d.ts.map +1 -0
- package/dist/components/RefreshDebugView.d.ts +32 -0
- package/dist/components/RefreshDebugView.d.ts.map +1 -0
- package/dist/components/SddActivityFeed.d.ts +11 -0
- package/dist/components/SddActivityFeed.d.ts.map +1 -0
- package/dist/components/SddBoardView.d.ts +9 -0
- package/dist/components/SddBoardView.d.ts.map +1 -0
- package/dist/components/SddDestroyDialog.d.ts +16 -0
- package/dist/components/SddDestroyDialog.d.ts.map +1 -0
- package/dist/components/SddFlowGraph.d.ts +23 -0
- package/dist/components/SddFlowGraph.d.ts.map +1 -0
- package/dist/components/SddKanbanView.d.ts +12 -0
- package/dist/components/SddKanbanView.d.ts.map +1 -0
- package/dist/components/SddTaskDrawer.d.ts +28 -0
- package/dist/components/SddTaskDrawer.d.ts.map +1 -0
- package/dist/components/SddWizard.d.ts +10 -0
- package/dist/components/SddWizard.d.ts.map +1 -0
- package/dist/components/SearchOverlay.d.ts +12 -0
- package/dist/components/SearchOverlay.d.ts.map +1 -0
- package/dist/components/SendButton.d.ts +2 -0
- package/dist/components/SendButton.d.ts.map +1 -0
- package/dist/components/SessionWatchPanel.d.ts +17 -0
- package/dist/components/SessionWatchPanel.d.ts.map +1 -0
- package/dist/components/SessionsDashboard.d.ts +3 -0
- package/dist/components/SessionsDashboard.d.ts.map +1 -0
- package/dist/components/SettingsPanel/BrainSection.d.ts +3 -0
- package/dist/components/SettingsPanel/BrainSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts +19 -0
- package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts.map +1 -0
- package/dist/components/SettingsPanel/MCPSection.d.ts +27 -0
- package/dist/components/SettingsPanel/MCPSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ModelSection.d.ts +31 -0
- package/dist/components/SettingsPanel/ModelSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/OAuthLoginSection.d.ts +14 -0
- package/dist/components/SettingsPanel/OAuthLoginSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/PreferenceControls.d.ts +23 -0
- package/dist/components/SettingsPanel/PreferenceControls.d.ts.map +1 -0
- package/dist/components/SettingsPanel/PreferenceToggle.d.ts +25 -0
- package/dist/components/SettingsPanel/PreferenceToggle.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts +46 -0
- package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts +110 -0
- package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ProviderSection.d.ts +63 -0
- package/dist/components/SettingsPanel/ProviderSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ShadowSection.d.ts +3 -0
- package/dist/components/SettingsPanel/ShadowSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ToolsSection.d.ts +12 -0
- package/dist/components/SettingsPanel/ToolsSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/index.d.ts +2 -0
- package/dist/components/SettingsPanel/index.d.ts.map +1 -0
- package/dist/components/SettingsPanel/local-presets.d.ts +31 -0
- package/dist/components/SettingsPanel/local-presets.d.ts.map +1 -0
- package/dist/components/SettingsPanel/official-servers.d.ts +30 -0
- package/dist/components/SettingsPanel/official-servers.d.ts.map +1 -0
- package/dist/components/SettingsPanel/settings-panel-reducers.d.ts +40 -0
- package/dist/components/SettingsPanel/settings-panel-reducers.d.ts.map +1 -0
- package/dist/components/SettingsPanel/undo-send-decision.d.ts +42 -0
- package/dist/components/SettingsPanel/undo-send-decision.d.ts.map +1 -0
- package/dist/components/SettingsPanel.d.ts +3 -0
- package/dist/components/SettingsPanel.d.ts.map +1 -0
- package/dist/components/SetupScreen.d.ts +2 -0
- package/dist/components/SetupScreen.d.ts.map +1 -0
- package/dist/components/ShortcutsOverlay.d.ts +2 -0
- package/dist/components/ShortcutsOverlay.d.ts.map +1 -0
- package/dist/components/SideEffectTimeline.d.ts +11 -0
- package/dist/components/SideEffectTimeline.d.ts.map +1 -0
- package/dist/components/SidePanel/AgentsPanel.d.ts +8 -0
- package/dist/components/SidePanel/AgentsPanel.d.ts.map +1 -0
- package/dist/components/SidePanel/ChangesPanel.d.ts +8 -0
- package/dist/components/SidePanel/ChangesPanel.d.ts.map +1 -0
- package/dist/components/SidePanel/DesignStudioPanel.d.ts +12 -0
- package/dist/components/SidePanel/DesignStudioPanel.d.ts.map +1 -0
- package/dist/components/SidePanel/HistoryPanel.d.ts +7 -0
- package/dist/components/SidePanel/HistoryPanel.d.ts.map +1 -0
- package/dist/components/SidePanel/SessionList.d.ts +24 -0
- package/dist/components/SidePanel/SessionList.d.ts.map +1 -0
- package/dist/components/SidePanel/SessionPanel.d.ts +10 -0
- package/dist/components/SidePanel/SessionPanel.d.ts.map +1 -0
- package/dist/components/SidePanel/SkillsList.d.ts +8 -0
- package/dist/components/SidePanel/SkillsList.d.ts.map +1 -0
- package/dist/components/SidePanel/WorktreesPanel.d.ts +8 -0
- package/dist/components/SidePanel/WorktreesPanel.d.ts.map +1 -0
- package/dist/components/SidePanel/index.d.ts +11 -0
- package/dist/components/SidePanel/index.d.ts.map +1 -0
- package/dist/components/SkillDetailView.d.ts +8 -0
- package/dist/components/SkillDetailView.d.ts.map +1 -0
- package/dist/components/SpecsView.d.ts +9 -0
- package/dist/components/SpecsView.d.ts.map +1 -0
- package/dist/components/TaskBoard.d.ts +20 -0
- package/dist/components/TaskBoard.d.ts.map +1 -0
- package/dist/components/TaskCard.d.ts +43 -0
- package/dist/components/TaskCard.d.ts.map +1 -0
- package/dist/components/TasksPanel.d.ts +14 -0
- package/dist/components/TasksPanel.d.ts.map +1 -0
- package/dist/components/TerminalPanel.d.ts +12 -0
- package/dist/components/TerminalPanel.d.ts.map +1 -0
- package/dist/components/ThemeProvider.d.ts +15 -0
- package/dist/components/ThemeProvider.d.ts.map +1 -0
- package/dist/components/Toaster.d.ts +40 -0
- package/dist/components/Toaster.d.ts.map +1 -0
- package/dist/components/TodosPanel.d.ts +14 -0
- package/dist/components/TodosPanel.d.ts.map +1 -0
- package/dist/components/ToolGroup.d.ts +18 -0
- package/dist/components/ToolGroup.d.ts.map +1 -0
- package/dist/components/ToolResult.d.ts +33 -0
- package/dist/components/ToolResult.d.ts.map +1 -0
- package/dist/components/WatchMessageBubble.d.ts +30 -0
- package/dist/components/WatchMessageBubble.d.ts.map +1 -0
- package/dist/components/WelcomeScreen.d.ts +2 -0
- package/dist/components/WelcomeScreen.d.ts.map +1 -0
- package/dist/components/WorkDashboard.d.ts +11 -0
- package/dist/components/WorkDashboard.d.ts.map +1 -0
- package/dist/components/WorkspaceDock.d.ts +16 -0
- package/dist/components/WorkspaceDock.d.ts.map +1 -0
- package/dist/components/WorktreeGraph.d.ts +21 -0
- package/dist/components/WorktreeGraph.d.ts.map +1 -0
- package/dist/components/WorktreeLanes.d.ts +11 -0
- package/dist/components/WorktreeLanes.d.ts.map +1 -0
- package/dist/components/WorktreeOrphans.d.ts +9 -0
- package/dist/components/WorktreeOrphans.d.ts.map +1 -0
- package/dist/components/activity-bar/index.d.ts +14 -0
- package/dist/components/activity-bar/index.d.ts.map +1 -0
- package/dist/components/activity-bar/nav.d.ts +17 -0
- package/dist/components/activity-bar/nav.d.ts.map +1 -0
- package/dist/components/dashboard-primitives.d.ts +22 -0
- package/dist/components/dashboard-primitives.d.ts.map +1 -0
- package/dist/components/index.d.ts +32 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/monaco-theme.d.ts +6 -0
- package/dist/components/monaco-theme.d.ts.map +1 -0
- package/dist/components/toaster-helpers.d.ts +34 -0
- package/dist/components/toaster-helpers.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/concurrency-gauge.d.ts +18 -0
- package/dist/components/ui/concurrency-gauge.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +29 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/event-timeline.d.ts +15 -0
- package/dist/components/ui/event-timeline.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +11 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +32 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sparkline.d.ts +16 -0
- package/dist/components/ui/sparkline.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-ws-handlers.d.ts +24 -0
- package/dist/hooks/use-ws-handlers.d.ts.map +1 -0
- package/dist/hooks/useGitInfo.d.ts +4 -0
- package/dist/hooks/useGitInfo.d.ts.map +1 -0
- package/dist/hooks/useProviderModels.d.ts +15 -0
- package/dist/hooks/useProviderModels.d.ts.map +1 -0
- package/dist/hooks/useWebSocket.d.ts +85 -0
- package/dist/hooks/useWebSocket.d.ts.map +1 -0
- package/dist/hooks/ws-handlers/chat-handlers.d.ts +21 -0
- package/dist/hooks/ws-handlers/chat-handlers.d.ts.map +1 -0
- package/dist/hooks/ws-handlers/coordinator-handlers.d.ts +3 -0
- package/dist/hooks/ws-handlers/coordinator-handlers.d.ts.map +1 -0
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +15 -0
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts.map +1 -0
- package/dist/hooks/ws-handlers/fleet-handlers.d.ts +13 -0
- package/dist/hooks/ws-handlers/fleet-handlers.d.ts.map +1 -0
- package/dist/hooks/ws-handlers/misc-handlers.d.ts +21 -0
- package/dist/hooks/ws-handlers/misc-handlers.d.ts.map +1 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts +34 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts.map +1 -0
- package/dist/hooks/ws-handlers.d.ts +24 -0
- package/dist/hooks/ws-handlers.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +12 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/languages.d.ts +40 -0
- package/dist/i18n/languages.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +7 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.html +8 -8
- package/dist/index.js +2513 -2174
- package/dist/index.js.map +7 -1
- package/dist/lib/accent-colors.d.ts +136 -0
- package/dist/lib/accent-colors.d.ts.map +1 -0
- package/dist/lib/agent-status.d.ts +41 -0
- package/dist/lib/agent-status.d.ts.map +1 -0
- package/dist/lib/analytics.d.ts +36 -0
- package/dist/lib/analytics.d.ts.map +1 -0
- package/dist/lib/chime.d.ts +20 -0
- package/dist/lib/chime.d.ts.map +1 -0
- package/dist/lib/color.d.ts +15 -0
- package/dist/lib/color.d.ts.map +1 -0
- package/dist/lib/completion.d.ts +27 -0
- package/dist/lib/completion.d.ts.map +1 -0
- package/dist/lib/core-browser-shim.d.ts +22 -0
- package/dist/lib/core-browser-shim.d.ts.map +1 -0
- package/dist/lib/desktop-host.d.ts +24 -0
- package/dist/lib/desktop-host.d.ts.map +1 -0
- package/dist/lib/desktop-shell.d.ts +3 -0
- package/dist/lib/desktop-shell.d.ts.map +1 -0
- package/dist/lib/favicon.d.ts +21 -0
- package/dist/lib/favicon.d.ts.map +1 -0
- package/dist/lib/file-icons.d.ts +10 -0
- package/dist/lib/file-icons.d.ts.map +1 -0
- package/dist/lib/goal.d.ts +32 -0
- package/dist/lib/goal.d.ts.map +1 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/model-matrix-routes.d.ts +203 -0
- package/dist/lib/model-matrix-routes.d.ts.map +1 -0
- package/dist/lib/notify.d.ts +15 -0
- package/dist/lib/notify.d.ts.map +1 -0
- package/dist/lib/sdd-theme.d.ts +52 -0
- package/dist/lib/sdd-theme.d.ts.map +1 -0
- package/dist/lib/stream-coalescer.d.ts +46 -0
- package/dist/lib/stream-coalescer.d.ts.map +1 -0
- package/dist/lib/terminal-dock.d.ts +6 -0
- package/dist/lib/terminal-dock.d.ts.map +1 -0
- package/dist/lib/tool-icon.d.ts +19 -0
- package/dist/lib/tool-icon.d.ts.map +1 -0
- package/dist/lib/tool-summary.d.ts +2 -0
- package/dist/lib/tool-summary.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/view-navigation.d.ts +15 -0
- package/dist/lib/view-navigation.d.ts.map +1 -0
- package/dist/lib/ws-client-helpers.d.ts +46 -0
- package/dist/lib/ws-client-helpers.d.ts.map +1 -0
- package/dist/lib/ws-client-utils.d.ts +87 -0
- package/dist/lib/ws-client-utils.d.ts.map +1 -0
- package/dist/lib/ws-client.d.ts +235 -0
- package/dist/lib/ws-client.d.ts.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/stores/auto-submit-streak.d.ts +40 -0
- package/dist/stores/auto-submit-streak.d.ts.map +1 -0
- package/dist/stores/autophase-store.d.ts +50 -0
- package/dist/stores/autophase-store.d.ts.map +1 -0
- package/dist/stores/chat-store.d.ts +128 -0
- package/dist/stores/chat-store.d.ts.map +1 -0
- package/dist/stores/config-store.d.ts +67 -0
- package/dist/stores/config-store.d.ts.map +1 -0
- package/dist/stores/coordinator-monitor-store.d.ts +133 -0
- package/dist/stores/coordinator-monitor-store.d.ts.map +1 -0
- package/dist/stores/file-reference-store.d.ts +36 -0
- package/dist/stores/file-reference-store.d.ts.map +1 -0
- package/dist/stores/file-store.d.ts +40 -0
- package/dist/stores/file-store.d.ts.map +1 -0
- package/dist/stores/fleet-store.d.ts +29 -0
- package/dist/stores/fleet-store.d.ts.map +1 -0
- package/dist/stores/git-changes-store.d.ts +38 -0
- package/dist/stores/git-changes-store.d.ts.map +1 -0
- package/dist/stores/git-info-store.d.ts +18 -0
- package/dist/stores/git-info-store.d.ts.map +1 -0
- package/dist/stores/goal-store.d.ts +12 -0
- package/dist/stores/goal-store.d.ts.map +1 -0
- package/dist/stores/history-store.d.ts +15 -0
- package/dist/stores/history-store.d.ts.map +1 -0
- package/dist/stores/index.d.ts +36 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/kanban-store.d.ts +22 -0
- package/dist/stores/kanban-store.d.ts.map +1 -0
- package/dist/stores/local-prefs.d.ts +117 -0
- package/dist/stores/local-prefs.d.ts.map +1 -0
- package/dist/stores/mailbox-store.d.ts +53 -0
- package/dist/stores/mailbox-store.d.ts.map +1 -0
- package/dist/stores/monitor-store.d.ts +116 -0
- package/dist/stores/monitor-store.d.ts.map +1 -0
- package/dist/stores/office-map-store.d.ts +47 -0
- package/dist/stores/office-map-store.d.ts.map +1 -0
- package/dist/stores/sdd-board-store.d.ts +88 -0
- package/dist/stores/sdd-board-store.d.ts.map +1 -0
- package/dist/stores/sdd-wizard-store.d.ts +64 -0
- package/dist/stores/sdd-wizard-store.d.ts.map +1 -0
- package/dist/stores/session-store.d.ts +125 -0
- package/dist/stores/session-store.d.ts.map +1 -0
- package/dist/stores/side-effect-store.d.ts +18 -0
- package/dist/stores/side-effect-store.d.ts.map +1 -0
- package/dist/stores/specs-store.d.ts +67 -0
- package/dist/stores/specs-store.d.ts.map +1 -0
- package/dist/stores/types.d.ts +240 -0
- package/dist/stores/types.d.ts.map +1 -0
- package/dist/stores/ui-store.d.ts +307 -0
- package/dist/stores/ui-store.d.ts.map +1 -0
- package/dist/stores/viz-store.d.ts +126 -0
- package/dist/stores/viz-store.d.ts.map +1 -0
- package/dist/stores/worktree-store.d.ts +47 -0
- package/dist/stores/worktree-store.d.ts.map +1 -0
- package/dist/types.d.ts +121 -118
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -1
- package/dist/types.js.map +7 -1
- package/package.json +12 -13
- package/dist/assets/KanbanView-DWBGErwm.js +0 -1
- package/dist/assets/OfficeMapPanel-BBKsytG0.js +0 -4
- package/dist/assets/SessionsDashboard-CveBdrQJ.js +0 -1
- package/dist/assets/common-B28qhvZh.js +0 -1
- package/dist/assets/common-CeTsF3jX.js +0 -1
- package/dist/assets/index-BqAVsSCe.js +0 -154
- package/dist/assets/index-DTFjO9oF.css +0 -1
- package/dist/assets/local-prefs-C1YdbI5g.js +0 -1
- package/dist/assets/settings-Os0ifjjB.js +0 -1
- package/dist/assets/settings-UGa_oSYC.js +0 -1
- package/dist/assets/ui-store-FTgDlcX2.js +0 -1
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AA8vCA,wBAAgB,GAAG,gCAQlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Fr as r,Lr as i,Wr as a,fi as o,lt as s,nr as c,or as l,pt as u,rt as d,si as f,sn as p}from"./vendor-CyLvG8N0.js";import"./i18n-CkkVJCs9.js";import{t as m}from"./ws-client-lDxBz-7w.js";import{z as h}from"./index-BqAVsSCe.js";var g=e(t(),1),_=n();function v(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m ${t%60}s`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function y(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function b(e){return e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function x(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function S(e){return e.includes(`error`)||e.includes(`fail`)?`text-destructive`:e.includes(`warn`)?`text-warning`:e.includes(`success`)||e.includes(`complete`)?`text-success`:`text-muted-foreground`}function C({icon:e,label:t,value:n,sub:r,color:i=`text-muted-foreground`}){return(0,_.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsx)(`div`,{className:`mt-0.5 ${i}`,children:e}),(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums text-foreground`,children:n}),(0,_.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t}),r?(0,_.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground/70`,children:r}):null]})]})}function w(){let{t:e}=o(),[t,n]=(0,g.useState)(null),[w,T]=(0,g.useState)([]),[E,D]=(0,g.useState)([]),[O,k]=(0,g.useState)(null),[A,j]=(0,g.useState)(!0),[M,N]=(0,g.useState)(!1),P=(0,g.useRef)(null),F=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/analytics/summary`);e.ok&&n(await e.json())}catch{}},[]),I=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/analytics?limit=50`);e.ok&&T((await e.json()).events)}catch{}},[]),L=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);e.ok&&D(await e.json())}catch{}},[]),R=(0,g.useCallback)(async()=>{if(!M){N(!0);try{let e=m(h.getState().wsUrl);P.current=e;let t=e.on(`stats.get`,e=>{let n=e.payload;k(n),N(!1),t()});e.getStats(),setTimeout(()=>{N(!1),t()},8e3)}catch{N(!1)}}},[M]);(0,g.useEffect)(()=>{let e=()=>{Promise.all([F(),I(),L(),R()]).finally(()=>j(!1))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[F,I,L,R]);let{totalAgents:z,activeAgents:B,totalToolCalls:V,totalIterations:H}=(0,g.useMemo)(()=>{let e=0,t=0,n=0,r=0;for(let i of E)for(let a of i.agents)e++,a.status===`running`&&t++,n+=a.toolCalls,r+=a.iterations;return{totalAgents:e,activeAgents:t,totalToolCalls:n,totalIterations:r}},[E]),U=(0,g.useMemo)(()=>t?Object.entries(t.categoryBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,8):[],[t]),W=(0,g.useMemo)(()=>t?Object.entries(t.eventBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,10):[],[t]),G=(0,g.useMemo)(()=>{if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t.eventBreakdown))n.toLowerCase().includes(`error`)&&(e+=r);return e},[t]),K=(0,g.useMemo)(()=>{if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t.eventBreakdown))n.toLowerCase().includes(`warn`)&&(e+=r);return e},[t]),q=(0,g.useMemo)(()=>[...w].reverse(),[w]);return A?(0,_.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,_.jsxs)(`div`,{className:`ws-surface flex items-center gap-2 rounded-xl px-4 py-3 text-sm text-muted-foreground`,children:[(0,_.jsx)(a,{className:`h-4 w-4 animate-spin text-primary`}),e(`activity:analytics.loading`)]})}):(0,_.jsx)(`div`,{className:`h-full min-h-0 min-w-0 overflow-y-auto bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-5`,children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,_.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,_.jsx)(f,{className:`h-4 w-4 text-primary`}),(0,_.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:e(`activity:analytics.heading`)})]}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.autoRefresh`)})]})}),(0,_.jsxs)(`div`,{className:`min-w-0 space-y-5`,children:[(0,_.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3`,children:[(0,_.jsx)(C,{icon:(0,_.jsx)(r,{className:`h-4 w-4`}),label:e(`activity:analytics.liveSessions`),value:E.length,color:`text-primary`}),(0,_.jsx)(C,{icon:(0,_.jsx)(d,{className:`h-4 w-4`}),label:e(`activity:analytics.agents`),value:`${B}/${z}`,sub:B>0?e(`activity:analytics.agentsActive`,{count:B}):void 0,color:`text-success`}),(0,_.jsx)(C,{icon:(0,_.jsx)(p,{className:`h-4 w-4`}),label:e(`activity:analytics.totalEvents`),value:t?.totalEvents??0,sub:e(`activity:analytics.categoriesSub`,{count:t?.uniqueCategories??0}),color:`text-warning`}),(0,_.jsx)(C,{icon:(0,_.jsx)(u,{className:`h-4 w-4`}),label:e(`activity:analytics.toolCalls`),value:V,sub:e(`activity:analytics.iterationsSub`,{count:H}),color:`text-success`}),(0,_.jsx)(C,{icon:(0,_.jsx)(c,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionCost`),value:O?b(O.cost):`—`,sub:O?e(`activity:analytics.tokensSub`,{input:y(O.usage.input),output:y(O.usage.output)}):void 0,color:`text-primary`}),(0,_.jsx)(C,{icon:(0,_.jsx)(l,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionDuration`),value:O?v(O.elapsedMs):`—`,sub:O?e(`activity:analytics.messagesSub`,{count:O.messages}):void 0,color:`text-muted-foreground`})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(s,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.eventsByCategory`)]}),U.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,_.jsx)(`div`,{className:`space-y-1.5`,children:U.map(([e,t])=>{let n=U[0]?.[1]??1,r=Math.round(t/n*100);return(0,_.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate text-foreground`,children:e}),(0,_.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,_.jsx)(`div`,{className:`h-full rounded-full bg-primary/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,_.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(f,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.topEvents`)]}),W.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,_.jsx)(`div`,{className:`space-y-1.5`,children:W.map(([e,t])=>{let n=W[0]?.[1]??1,r=Math.round(t/n*100);return(0,_.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,9rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate ${S(e)}`,children:e}),(0,_.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,_.jsx)(`div`,{className:`h-full rounded-full bg-warning/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,_.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(c,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.activeSessionUsage`)]}),O?(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,_.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.provider`)}),(0,_.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:O.provider})]}),(0,_.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.model`)}),(0,_.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:O.model})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.inputTokens`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:y(O.usage.input)})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.outputTokens`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:y(O.usage.output)})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheRatio`)}),(0,_.jsxs)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:[(O.cache.ratio*100).toFixed(1),`%`]})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.filesRead`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:O.readFiles})]})]}):(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noSession`)})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(i,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.healthErrors`)]}),(0,_.jsx)(`div`,{className:`space-y-2 text-xs`,children:t?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.errorEvents`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-destructive`,children:G})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.warningEvents`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-warning`,children:K})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheHitRate`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-success`,children:O?`${(O.cache.ratio*100).toFixed(1)}%`:`—`})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.totalCategories`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-foreground`,children:t.uniqueCategories})]})]}):(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:e(`activity:analytics.waitingData`)})})]})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(r,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.recentEvents`)]}),w.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noRecentEvents`)}):(0,_.jsx)(`div`,{className:`max-h-64 space-y-1 overflow-y-auto`,children:q.map((e,t)=>(0,_.jsxs)(`div`,{className:`grid grid-cols-[4rem_minmax(0,7rem)_minmax(0,6rem)_minmax(0,1fr)] items-start gap-2 rounded px-2 py-1 text-xs hover:bg-muted/60`,children:[(0,_.jsx)(`span`,{className:`tabular-nums text-muted-foreground/70`,children:x(e.timestamp)}),(0,_.jsx)(`span`,{className:`min-w-0 truncate ${S(e.event)}`,children:e.event}),(0,_.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:e.category}),(0,_.jsx)(`span`,{className:`min-w-0 truncate text-foreground/80`,children:e.label??e.sessionId??``})]},`${e.timestamp}-${t}`))})]})]})]})})}export{w as AnalyticsDashboard};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Fr as r,Lr as i,Wr as a,fi as o,lt as s,nr as c,or as l,pt as u,rt as d,si as f,sn as p}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as m}from"./ws-client-CwL51TNh.js";import{z as h}from"./index-CyTNJHe8.js";var g=e(t(),1),_=n();function v(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m ${t%60}s`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function y(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function b(e){return e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function x(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function S(e){return e.includes(`error`)||e.includes(`fail`)?`text-destructive`:e.includes(`warn`)?`text-warning`:e.includes(`success`)||e.includes(`complete`)?`text-success`:`text-muted-foreground`}function C({icon:e,label:t,value:n,sub:r,color:i=`text-muted-foreground`}){return(0,_.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsx)(`div`,{className:`mt-0.5 ${i}`,children:e}),(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums text-foreground`,children:n}),(0,_.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t}),r?(0,_.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground/70`,children:r}):null]})]})}function w(){let{t:e}=o(),[t,n]=(0,g.useState)(null),[w,T]=(0,g.useState)([]),[E,D]=(0,g.useState)([]),[O,k]=(0,g.useState)(null),[A,j]=(0,g.useState)(!0),[M,N]=(0,g.useState)(!1),P=(0,g.useRef)(null),F=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/analytics/summary`);e.ok&&n(await e.json())}catch{}},[]),I=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/analytics?limit=50`);e.ok&&T((await e.json()).events)}catch{}},[]),L=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);e.ok&&D(await e.json())}catch{}},[]),R=(0,g.useCallback)(async()=>{if(!M){N(!0);try{let e=m(h.getState().wsUrl);P.current=e;let t=e.on(`stats.get`,e=>{let n=e.payload;k(n),N(!1),t()});e.getStats(),setTimeout(()=>{N(!1),t()},8e3)}catch{N(!1)}}},[M]);(0,g.useEffect)(()=>{let e=()=>{Promise.all([F(),I(),L(),R()]).finally(()=>j(!1))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[F,I,L,R]);let{totalAgents:z,activeAgents:B,totalToolCalls:V,totalIterations:H}=(0,g.useMemo)(()=>{let e=0,t=0,n=0,r=0;for(let i of E)for(let a of i.agents)e++,a.status===`running`&&t++,n+=a.toolCalls,r+=a.iterations;return{totalAgents:e,activeAgents:t,totalToolCalls:n,totalIterations:r}},[E]),U=(0,g.useMemo)(()=>t?Object.entries(t.categoryBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,8):[],[t]),W=(0,g.useMemo)(()=>t?Object.entries(t.eventBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,10):[],[t]),G=(0,g.useMemo)(()=>{if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t.eventBreakdown))n.toLowerCase().includes(`error`)&&(e+=r);return e},[t]),K=(0,g.useMemo)(()=>{if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t.eventBreakdown))n.toLowerCase().includes(`warn`)&&(e+=r);return e},[t]),q=(0,g.useMemo)(()=>[...w].reverse(),[w]);return A?(0,_.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,_.jsxs)(`div`,{className:`ws-surface flex items-center gap-2 rounded-xl px-4 py-3 text-sm text-muted-foreground`,children:[(0,_.jsx)(a,{className:`h-4 w-4 animate-spin text-primary`}),e(`activity:analytics.loading`)]})}):(0,_.jsx)(`div`,{className:`h-full min-h-0 min-w-0 overflow-y-auto bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-5`,children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,_.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,_.jsx)(f,{className:`h-4 w-4 text-primary`}),(0,_.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:e(`activity:analytics.heading`)})]}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.autoRefresh`)})]})}),(0,_.jsxs)(`div`,{className:`min-w-0 space-y-5`,children:[(0,_.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3`,children:[(0,_.jsx)(C,{icon:(0,_.jsx)(r,{className:`h-4 w-4`}),label:e(`activity:analytics.liveSessions`),value:E.length,color:`text-primary`}),(0,_.jsx)(C,{icon:(0,_.jsx)(d,{className:`h-4 w-4`}),label:e(`activity:analytics.agents`),value:`${B}/${z}`,sub:B>0?e(`activity:analytics.agentsActive`,{count:B}):void 0,color:`text-success`}),(0,_.jsx)(C,{icon:(0,_.jsx)(p,{className:`h-4 w-4`}),label:e(`activity:analytics.totalEvents`),value:t?.totalEvents??0,sub:e(`activity:analytics.categoriesSub`,{count:t?.uniqueCategories??0}),color:`text-warning`}),(0,_.jsx)(C,{icon:(0,_.jsx)(u,{className:`h-4 w-4`}),label:e(`activity:analytics.toolCalls`),value:V,sub:e(`activity:analytics.iterationsSub`,{count:H}),color:`text-success`}),(0,_.jsx)(C,{icon:(0,_.jsx)(c,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionCost`),value:O?b(O.cost):`—`,sub:O?e(`activity:analytics.tokensSub`,{input:y(O.usage.input),output:y(O.usage.output)}):void 0,color:`text-primary`}),(0,_.jsx)(C,{icon:(0,_.jsx)(l,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionDuration`),value:O?v(O.elapsedMs):`—`,sub:O?e(`activity:analytics.messagesSub`,{count:O.messages}):void 0,color:`text-muted-foreground`})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(s,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.eventsByCategory`)]}),U.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,_.jsx)(`div`,{className:`space-y-1.5`,children:U.map(([e,t])=>{let n=U[0]?.[1]??1,r=Math.round(t/n*100);return(0,_.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate text-foreground`,children:e}),(0,_.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,_.jsx)(`div`,{className:`h-full rounded-full bg-primary/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,_.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(f,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.topEvents`)]}),W.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,_.jsx)(`div`,{className:`space-y-1.5`,children:W.map(([e,t])=>{let n=W[0]?.[1]??1,r=Math.round(t/n*100);return(0,_.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,9rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate ${S(e)}`,children:e}),(0,_.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,_.jsx)(`div`,{className:`h-full rounded-full bg-warning/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,_.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(c,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.activeSessionUsage`)]}),O?(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,_.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.provider`)}),(0,_.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:O.provider})]}),(0,_.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.model`)}),(0,_.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:O.model})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.inputTokens`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:y(O.usage.input)})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.outputTokens`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:y(O.usage.output)})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheRatio`)}),(0,_.jsxs)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:[(O.cache.ratio*100).toFixed(1),`%`]})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.filesRead`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:O.readFiles})]})]}):(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noSession`)})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(i,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.healthErrors`)]}),(0,_.jsx)(`div`,{className:`space-y-2 text-xs`,children:t?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.errorEvents`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-destructive`,children:G})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.warningEvents`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-warning`,children:K})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheHitRate`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-success`,children:O?`${(O.cache.ratio*100).toFixed(1)}%`:`—`})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.totalCategories`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-foreground`,children:t.uniqueCategories})]})]}):(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:e(`activity:analytics.waitingData`)})})]})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(r,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.recentEvents`)]}),w.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noRecentEvents`)}):(0,_.jsx)(`div`,{className:`max-h-64 space-y-1 overflow-y-auto`,children:q.map((e,t)=>(0,_.jsxs)(`div`,{className:`grid grid-cols-[4rem_minmax(0,7rem)_minmax(0,6rem)_minmax(0,1fr)] items-start gap-2 rounded px-2 py-1 text-xs hover:bg-muted/60`,children:[(0,_.jsx)(`span`,{className:`tabular-nums text-muted-foreground/70`,children:x(e.timestamp)}),(0,_.jsx)(`span`,{className:`min-w-0 truncate ${S(e.event)}`,children:e.event}),(0,_.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:e.category}),(0,_.jsx)(`span`,{className:`min-w-0 truncate text-foreground/80`,children:e.label??e.sessionId??``})]},`${e.timestamp}-${t}`))})]})]})]})})}export{w as AnalyticsDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-De7J1E26.js";import{m as n,p as r}from"./markdown-D0X23O-i.js";import{$r as i,Br as a,Gr as o,Gt as s,It as c,Kt as l,Lt as u,Wr as d,X as f,Xt as p,Z as m,ai as h,bt as g,ct as _,fi as v,fr as y,hi as b,ni as x,ot as S,ur as C}from"./vendor-CyLvG8N0.js";import"./i18n-CkkVJCs9.js";import{t as w}from"./utils-CU_o9ioU.js";import{B as T,C as E,E as D,T as O,m as k,n as A,r as ee,s as j,t as M}from"./index-BqAVsSCe.js";var N=e(n(),1),P=r(),F={pending:{icon:(0,P.jsx)(y,{className:`w-4 h-4`}),color:`text-muted-foreground`,label:`Pending`},in_progress:{icon:(0,P.jsx)(C,{className:`w-4 h-4 animate-spin`}),color:`text-primary`,label:`In Progress`},blocked:{icon:(0,P.jsx)(p,{className:`w-4 h-4`}),color:`text-warning`,label:`Blocked`},failed:{icon:(0,P.jsx)(x,{className:`w-4 h-4`}),color:`text-destructive`,label:`Failed`},review:{icon:(0,P.jsx)(c,{className:`w-4 h-4`}),color:`text-info`,label:`Review`},completed:{icon:(0,P.jsx)(h,{className:`w-4 h-4`}),color:`text-success`,label:`Done`}},I={critical:`bg-destructive/15 text-destructive`,high:`bg-warning/15 text-warning`,medium:`bg-info/15 text-info`,low:`bg-muted text-muted-foreground`},L={feature:`bg-success/15 text-success`,bugfix:`bg-destructive/15 text-destructive`,refactor:`bg-primary/15 text-primary`,docs:`bg-info/15 text-info`,test:`bg-primary/15 text-primary`,chore:`bg-muted text-muted-foreground`};function R(e){if(!e)return``;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function z({task:e,onStatusChange:t,onRetry:n,agents:r,onAssign:i,compact:a,className:o}){let{t:s}=v(),l=F[e.status],[u,d]=(0,N.useState)(!1),f=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:w(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,f?`border-primary/40 bg-primary/5`:e.status===`completed`?`border-success/35 bg-success/6`:e.status===`failed`?`border-destructive/40 bg-destructive/5`:`border-border bg-card`,o),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsx)(`span`,{className:w(`mt-0.5`,l.color),"aria-label":f?s(`common:status.inProgress`):void 0,children:l.icon}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,P.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,L[e.type]),children:e.type})]}),e.description&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.description})]})]}),e.assignee&&(0,P.jsxs)(`div`,{className:w(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,f?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[f&&(0,P.jsx)(C,{className:`w-3 h-3 animate-spin`,"aria-label":s(`common:status.working`)}),(0,P.jsx)(`span`,{children:e.assignee})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.estimateHours?(0,P.jsxs)(`span`,{children:[`~`,e.estimateHours,`h`]}):null,e.actualHours?(0,P.jsxs)(`span`,{children:[`• `,e.actualHours,`h`]}):null,e.startedAt?(0,P.jsxs)(`span`,{children:[`• `,R(Date.now()-e.startedAt)]}):null]}),e.tags.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.tags.map(e=>(0,P.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))}),!a&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2`,children:[t&&e.status!==`in_progress`&&e.status!==`completed`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`in_progress`),className:`px-2 py-0.5 text-[10px] rounded bg-primary/15 text-primary hover:bg-primary/25 transition-colors`,children:s(`activity:task.start`)}),t&&e.status===`in_progress`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`completed`),className:`px-2 py-0.5 text-[10px] rounded bg-success/15 text-success hover:bg-success/25 transition-colors`,children:s(`activity:task.complete`)}),n&&(e.status===`failed`||e.status===`completed`)&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,children:[(0,P.jsx)(c,{className:`w-3 h-3`}),` `,s(`activity:task.retry`)]}),i&&r&&r.length>0&&(u?(0,P.jsxs)(`select`,{autoFocus:!0,defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),d(!1)},onBlur:()=>d(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,P.jsx)(`option`,{value:``,children:s(`activity:task.unassigned`)}),r.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,title:s(`activity:task.assignTitle`),children:[(0,P.jsx)(S,{className:`w-3 h-3`}),` `,s(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,label:`Pending`,match:[`pending`,`blocked`]},{key:`in_progress`,label:`In Progress`,match:[`in_progress`]},{key:`review`,label:`Review`,match:[`review`]},{key:`failed`,label:`Failed`,match:[`failed`]},{key:`completed`,label:`Done`,match:[`completed`]}],V={pending:`bg-muted text-muted-foreground`,ready:`bg-info/15 text-info`,running:`bg-primary/15 text-primary`,paused:`bg-warning/15 text-warning`,completed:`bg-success/15 text-success`,failed:`bg-destructive/15 text-destructive`,skipped:`bg-muted text-muted-foreground`};function H(){let{client:e}=E(),{t}=v(),n=T(e=>e.phases),[r,o]=(0,N.useState)(`phase`),[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(null),f=(0,N.useMemo)(()=>n.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[n]),p=(0,N.useMemo)(()=>[...new Set(f.map(e=>e.assignee).filter(e=>!!e))],[f]),m=(0,N.useCallback)(t=>e?.send?.(t),[e]),h=(0,N.useCallback)((e,t)=>m({type:`autophase.taskStatus`,payload:{taskId:e,status:t}}),[m]),g=(0,N.useCallback)(e=>m({type:`autophase.retryTask`,payload:{taskId:e}}),[m]),_=(0,N.useCallback)((e,t)=>m({type:`autophase.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[m]),y=(0,N.useCallback)(e=>{j({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&m({type:`autophase.addTask`,payload:{phaseId:e,title:t}})})},[m]),b=(0,N.useCallback)(e=>{c&&m({type:`autophase.moveTask`,payload:{taskId:c,toPhaseId:e}}),l(null),d(null)},[c,m]),x=(0,N.useCallback)(e=>{c&&m({type:`autophase.taskStatus`,payload:{taskId:c,status:e}}),l(null),d(null)},[c,m]),S={onStatusChange:h,onRetry:g,agents:p,onAssign:_};function C(e){return{draggable:!0,onDragStart:t=>{l(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{l(null),d(null)}}}function D(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,u!==e&&d(e)},onDragLeave:()=>d(t=>t===e?null:t),onDrop:e=>{e.preventDefault(),t()},"data-hover":u===e||void 0}}return n.length===0?(0,P.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-sm`,children:t(`activity:board.empty`)})}):(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2`,children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:board.summary`,{phases:n.length,tasks:f.length})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>o(`phase`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,r===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>o(`status`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,r===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(a,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),r===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:n.map(e=>{let n=f.filter(t=>t.phaseId===e.id);return(0,P.jsxs)(`div`,{...D(`phase:${e.id}`,()=>b(e.id)),className:w(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,u===`phase:${e.id}`?`border-primary/60 bg-primary/5`:`border-border`),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,P.jsx)(`span`,{className:w(`rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,V[e.status]),children:e.status})]}),(0,P.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount,` · `,e.progressPercent,`%`]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>y(e.id),title:t(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(s,{className:`h-4 w-4`})})]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:n.length===0?(0,P.jsx)(`p`,{className:`px-1 py-4 text-center text-[11px] text-muted-foreground`,children:t(`activity:board.dropHere`)}):n.map(e=>(0,P.jsx)(`div`,{...C(e.id),className:w(c===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,...S})},e.id))})]},e.id)})}):(0,P.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto p-3`,children:(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:t(`activity:board.status.${e.key}`)},e.key)),n.map(e=>(0,P.jsxs)(U,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:w(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(t=>{let n=f.filter(n=>n.phaseId===e.id&&t.match.includes(n.status)),r=`cell:${e.id}:${t.key}`;return(0,P.jsx)(`div`,{...D(r,()=>x(t.key)),className:w(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,u===r?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:n.map(e=>(0,P.jsx)(`div`,{...C(e.id),className:w(c===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...S})},e.id))},t.key)})]},e.id))]})})]})}function U({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function W({onClose:e}){let{client:n}=E(),{t:r}=v(),i=T(e=>e.phases),a=T(e=>e.overallPercent),c=T(e=>e.autonomous),h=T(e=>e.title),y=T(e=>e.goal),x=T(e=>e.status),S=T(e=>e.lastError),C=T(e=>e.graphs);(0,N.useEffect)(()=>{n?.send?.({type:`autophase.list`}),n?.send?.({type:`autophase.state`})},[n]);let j=D(e=>e.worktrees),F=D(e=>e.baseBranch),[I,L]=(0,N.useState)(``),[R,z]=(0,N.useState)(null),[B,V]=(0,N.useState)(!1),[U,W]=(0,N.useState)(!0),G=i.length>0,K=R!=null&&!G;(0,N.useEffect)(()=>{G&&z(null)},[G]);let q=(0,N.useCallback)(()=>{let e=I.trim();if(!e||R!=null)return;let r=t.getState();r.addMessage({role:`user`,content:e}),r.addMessage({role:`assistant`,content:b.t(`activity:autoPhase.planningAck`)}),z(e),L(``),n?.send?.({type:`autophase.start`,payload:{title:e,autonomous:!0,worktrees:U}}),O(`chat`)},[I,R,n,U]),J=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.stop`,payload:{}}),z(null)},[n]),Y=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.toggleAutonomous`,payload:{}})},[n]),X=(0,N.useCallback)(()=>{n?.send?.(x===`paused`?{type:`autophase.resume`,payload:{}}:{type:`autophase.pause`,payload:{}})},[n,x]),Z=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.stop`,payload:{}})},[n]),Q=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.clear`,payload:{}}),T.getState().clear(),z(null),L(``)},[n]),[te,$]=(0,N.useState)(!1),ne=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.revert`,payload:{}}),$(!1)},[n]),re=x===`running`||x===`paused`,ie=x===`stopped`||x===`completed`||x===`failed`,ae=(0,N.useCallback)(e=>{e&&n?.send?.({type:`autophase.load`,payload:{graphId:e}})},[n]);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,P.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2 border-b bg-card px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(o,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:G&&h||`AutoPhase`}),G&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`activity:autoPhase.summary`,{count:i.length,pct:a})})]}),G&&(0,P.jsx)(`span`,{className:w(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,x===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:x===`paused`||x===`stopped`?`border-warning/40 bg-warning/10 text-warning`:x===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:S??void 0,children:x})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[C.length>0&&(0,P.jsxs)(`select`,{value:G?C.find(e=>e.title===h)?.id??``:``,onChange:e=>ae(e.target.value),title:r(`activity:autoPhase.switchBoard`),className:`min-w-0 flex-1 rounded border border-border bg-card px-2 py-1 text-xs text-foreground sm:w-72 sm:flex-none`,children:[(0,P.jsx)(`option`,{value:``,disabled:!0,children:r(`activity:autoPhase.boardsCount`,{count:C.length})}),C.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.title,` · `,e.status]},e.id))]}),G&&(0,P.jsxs)(`button`,{type:`button`,onClick:Y,title:r(`activity:autoPhase.toggleAutonomousTitle`),className:w(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,c?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(f,{className:`h-3.5 w-3.5`}),` `,r(c?`activity:autoPhase.autonomous`:`activity:autoPhase.manual`)]}),re&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:X,title:r(x===`paused`?`activity:autoPhase.resumeTitle`:`activity:autoPhase.pauseTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[x===`paused`?(0,P.jsx)(l,{className:`h-3.5 w-3.5`}):(0,P.jsx)(p,{className:`h-3.5 w-3.5`}),r(x===`paused`?`activity:autoPhase.resume`:`activity:autoPhase.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:Z,title:r(`activity:autoPhase.stopTitle`),className:`inline-flex items-center gap-1 rounded border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,children:[(0,P.jsx)(g,{className:`h-3.5 w-3.5 fill-current`}),` `,r(`activity:autoPhase.stop`)]})]}),G&&ie&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:Q,title:r(`activity:autoPhase.newTitle`),className:`inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-2 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/20`,children:[(0,P.jsx)(s,{className:`h-3.5 w-3.5`}),` `,r(`activity:autoPhase.newLabel`)]}),te?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 text-xs`,children:[(0,P.jsx)(`span`,{className:`text-warning`,children:r(`activity:autoPhase.revertConfirm`)}),(0,P.jsx)(`button`,{type:`button`,onClick:ne,className:`rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-destructive hover:bg-destructive/25`,children:r(`common:action.yes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>$(!1),className:`rounded px-1.5 py-0.5 text-muted-foreground hover:text-foreground`,children:r(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:r(`activity:autoPhase.revertTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,P.jsx)(_,{className:`h-3.5 w-3.5`}),` `,r(`activity:autoPhase.revert`)]})]}),(0,P.jsx)(k,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(m,{className:`h-4 w-4`})})]})]}),G&&y&&(0,P.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-muted/20 px-4 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(u,{className:`h-3 w-3`}),` `,r(`activity:autoPhase.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:y})]}),G?(0,P.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,P.jsx)(H,{})}):K?(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-5 text-center`,children:[(0,P.jsx)(d,{className:`h-10 w-10 mx-auto animate-spin text-primary/70`}),(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:r(`activity:autoPhase.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`activity:autoPhase.planningBody`)})]}),(0,P.jsxs)(`div`,{className:`rounded-lg border border-border bg-card px-4 py-3 text-left`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(u,{className:`h-3 w-3`}),` `,r(`activity:autoPhase.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(k,{variant:`outline`,onClick:J,className:`gap-2`,children:[(0,P.jsx)(g,{className:`h-4 w-4 fill-current`}),` `,r(`common:action.cancel`)]})]})}):(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-6`,children:[(0,P.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,P.jsx)(u,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:r(`activity:autoPhase.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`activity:autoPhase.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:r(`activity:autoPhase.startPlaceholder`),rows:5,className:`w-full rounded-lg border border-border bg-card px-4 py-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground/50`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),q())}}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>W(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),r(`activity:autoPhase.isolateLabel`)]}),(0,P.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,P.jsxs)(k,{onClick:q,disabled:!I.trim(),className:`flex-1 gap-2`,children:[(0,P.jsx)(l,{className:`h-4 w-4`}),r(`activity:autoPhase.startButton`)]})}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[r(`activity:autoPhase.ctrlHint`),` ·`,` `,r(U?`activity:autoPhase.isolateOn`:`activity:autoPhase.isolateOff`)]})]})}),j.length>0&&(0,P.jsxs)(`div`,{className:`border-t bg-card/50 shrink-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-4 pt-2 text-xs`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!1),className:w(`rounded px-2 py-0.5 border transition-colors`,B?`border-border text-muted-foreground hover:text-foreground`:`bg-primary/10 border-primary/30 text-primary`),children:r(`activity:autoPhase.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:w(`rounded px-2 py-0.5 border transition-colors`,B?`bg-primary/10 border-primary/30 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:r(`activity:autoPhase.graph`)})]}),(0,P.jsxs)(`div`,{className:`space-y-2 px-4 pb-3`,children:[(0,P.jsx)(M,{}),B?(0,P.jsx)(ee,{worktrees:j,baseBranch:F}):(0,P.jsx)(A,{worktrees:j,baseBranch:F})]})]})]})}export{W as AutoPhaseView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-De7J1E26.js";import{m as n,p as r}from"./markdown-D0X23O-i.js";import{$r as i,Br as a,Gr as o,Gt as s,It as c,Kt as l,Lt as u,Wr as d,X as f,Xt as p,Z as m,ai as h,bt as g,ct as _,fi as v,fr as y,hi as b,ni as x,ot as S,ur as C}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as w}from"./utils-CU_o9ioU.js";import{B as T,C as E,E as D,T as O,m as k,n as A,r as ee,s as j,t as M}from"./index-CyTNJHe8.js";var N=e(n(),1),P=r(),F={pending:{icon:(0,P.jsx)(y,{className:`w-4 h-4`}),color:`text-muted-foreground`,label:`Pending`},in_progress:{icon:(0,P.jsx)(C,{className:`w-4 h-4 animate-spin`}),color:`text-primary`,label:`In Progress`},blocked:{icon:(0,P.jsx)(p,{className:`w-4 h-4`}),color:`text-warning`,label:`Blocked`},failed:{icon:(0,P.jsx)(x,{className:`w-4 h-4`}),color:`text-destructive`,label:`Failed`},review:{icon:(0,P.jsx)(c,{className:`w-4 h-4`}),color:`text-info`,label:`Review`},completed:{icon:(0,P.jsx)(h,{className:`w-4 h-4`}),color:`text-success`,label:`Done`}},I={critical:`bg-destructive/15 text-destructive`,high:`bg-warning/15 text-warning`,medium:`bg-info/15 text-info`,low:`bg-muted text-muted-foreground`},L={feature:`bg-success/15 text-success`,bugfix:`bg-destructive/15 text-destructive`,refactor:`bg-primary/15 text-primary`,docs:`bg-info/15 text-info`,test:`bg-primary/15 text-primary`,chore:`bg-muted text-muted-foreground`};function R(e){if(!e)return``;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function z({task:e,onStatusChange:t,onRetry:n,agents:r,onAssign:i,compact:a,className:o}){let{t:s}=v(),l=F[e.status],[u,d]=(0,N.useState)(!1),f=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:w(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,f?`border-primary/40 bg-primary/5`:e.status===`completed`?`border-success/35 bg-success/6`:e.status===`failed`?`border-destructive/40 bg-destructive/5`:`border-border bg-card`,o),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsx)(`span`,{className:w(`mt-0.5`,l.color),"aria-label":f?s(`common:status.inProgress`):void 0,children:l.icon}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,P.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,L[e.type]),children:e.type})]}),e.description&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.description})]})]}),e.assignee&&(0,P.jsxs)(`div`,{className:w(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,f?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[f&&(0,P.jsx)(C,{className:`w-3 h-3 animate-spin`,"aria-label":s(`common:status.working`)}),(0,P.jsx)(`span`,{children:e.assignee})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.estimateHours?(0,P.jsxs)(`span`,{children:[`~`,e.estimateHours,`h`]}):null,e.actualHours?(0,P.jsxs)(`span`,{children:[`• `,e.actualHours,`h`]}):null,e.startedAt?(0,P.jsxs)(`span`,{children:[`• `,R(Date.now()-e.startedAt)]}):null]}),e.tags.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.tags.map(e=>(0,P.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))}),!a&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2`,children:[t&&e.status!==`in_progress`&&e.status!==`completed`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`in_progress`),className:`px-2 py-0.5 text-[10px] rounded bg-primary/15 text-primary hover:bg-primary/25 transition-colors`,children:s(`activity:task.start`)}),t&&e.status===`in_progress`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`completed`),className:`px-2 py-0.5 text-[10px] rounded bg-success/15 text-success hover:bg-success/25 transition-colors`,children:s(`activity:task.complete`)}),n&&(e.status===`failed`||e.status===`completed`)&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,children:[(0,P.jsx)(c,{className:`w-3 h-3`}),` `,s(`activity:task.retry`)]}),i&&r&&r.length>0&&(u?(0,P.jsxs)(`select`,{autoFocus:!0,defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),d(!1)},onBlur:()=>d(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,P.jsx)(`option`,{value:``,children:s(`activity:task.unassigned`)}),r.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,title:s(`activity:task.assignTitle`),children:[(0,P.jsx)(S,{className:`w-3 h-3`}),` `,s(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,label:`Pending`,match:[`pending`,`blocked`]},{key:`in_progress`,label:`In Progress`,match:[`in_progress`]},{key:`review`,label:`Review`,match:[`review`]},{key:`failed`,label:`Failed`,match:[`failed`]},{key:`completed`,label:`Done`,match:[`completed`]}],V={pending:`bg-muted text-muted-foreground`,ready:`bg-info/15 text-info`,running:`bg-primary/15 text-primary`,paused:`bg-warning/15 text-warning`,completed:`bg-success/15 text-success`,failed:`bg-destructive/15 text-destructive`,skipped:`bg-muted text-muted-foreground`};function H(){let{client:e}=E(),{t}=v(),n=T(e=>e.phases),[r,o]=(0,N.useState)(`phase`),[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(null),f=(0,N.useMemo)(()=>n.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[n]),p=(0,N.useMemo)(()=>[...new Set(f.map(e=>e.assignee).filter(e=>!!e))],[f]),m=(0,N.useCallback)(t=>e?.send?.(t),[e]),h=(0,N.useCallback)((e,t)=>m({type:`autophase.taskStatus`,payload:{taskId:e,status:t}}),[m]),g=(0,N.useCallback)(e=>m({type:`autophase.retryTask`,payload:{taskId:e}}),[m]),_=(0,N.useCallback)((e,t)=>m({type:`autophase.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[m]),y=(0,N.useCallback)(e=>{j({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&m({type:`autophase.addTask`,payload:{phaseId:e,title:t}})})},[m]),b=(0,N.useCallback)(e=>{c&&m({type:`autophase.moveTask`,payload:{taskId:c,toPhaseId:e}}),l(null),d(null)},[c,m]),x=(0,N.useCallback)(e=>{c&&m({type:`autophase.taskStatus`,payload:{taskId:c,status:e}}),l(null),d(null)},[c,m]),S={onStatusChange:h,onRetry:g,agents:p,onAssign:_};function C(e){return{draggable:!0,onDragStart:t=>{l(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{l(null),d(null)}}}function D(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,u!==e&&d(e)},onDragLeave:()=>d(t=>t===e?null:t),onDrop:e=>{e.preventDefault(),t()},"data-hover":u===e||void 0}}return n.length===0?(0,P.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-sm`,children:t(`activity:board.empty`)})}):(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2`,children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:board.summary`,{phases:n.length,tasks:f.length})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>o(`phase`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,r===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>o(`status`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,r===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(a,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),r===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:n.map(e=>{let n=f.filter(t=>t.phaseId===e.id);return(0,P.jsxs)(`div`,{...D(`phase:${e.id}`,()=>b(e.id)),className:w(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,u===`phase:${e.id}`?`border-primary/60 bg-primary/5`:`border-border`),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,P.jsx)(`span`,{className:w(`rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,V[e.status]),children:e.status})]}),(0,P.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount,` · `,e.progressPercent,`%`]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>y(e.id),title:t(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(s,{className:`h-4 w-4`})})]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:n.length===0?(0,P.jsx)(`p`,{className:`px-1 py-4 text-center text-[11px] text-muted-foreground`,children:t(`activity:board.dropHere`)}):n.map(e=>(0,P.jsx)(`div`,{...C(e.id),className:w(c===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,...S})},e.id))})]},e.id)})}):(0,P.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto p-3`,children:(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:t(`activity:board.status.${e.key}`)},e.key)),n.map(e=>(0,P.jsxs)(U,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:w(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(t=>{let n=f.filter(n=>n.phaseId===e.id&&t.match.includes(n.status)),r=`cell:${e.id}:${t.key}`;return(0,P.jsx)(`div`,{...D(r,()=>x(t.key)),className:w(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,u===r?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:n.map(e=>(0,P.jsx)(`div`,{...C(e.id),className:w(c===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...S})},e.id))},t.key)})]},e.id))]})})]})}function U({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function W({onClose:e}){let{client:n}=E(),{t:r}=v(),i=T(e=>e.phases),a=T(e=>e.overallPercent),c=T(e=>e.autonomous),h=T(e=>e.title),y=T(e=>e.goal),x=T(e=>e.status),S=T(e=>e.lastError),C=T(e=>e.graphs);(0,N.useEffect)(()=>{n?.send?.({type:`autophase.list`}),n?.send?.({type:`autophase.state`})},[n]);let j=D(e=>e.worktrees),F=D(e=>e.baseBranch),[I,L]=(0,N.useState)(``),[R,z]=(0,N.useState)(null),[B,V]=(0,N.useState)(!1),[U,W]=(0,N.useState)(!0),G=i.length>0,K=R!=null&&!G;(0,N.useEffect)(()=>{G&&z(null)},[G]);let q=(0,N.useCallback)(()=>{let e=I.trim();if(!e||R!=null)return;let r=t.getState();r.addMessage({role:`user`,content:e}),r.addMessage({role:`assistant`,content:b.t(`activity:autoPhase.planningAck`)}),z(e),L(``),n?.send?.({type:`autophase.start`,payload:{title:e,autonomous:!0,worktrees:U}}),O(`chat`)},[I,R,n,U]),J=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.stop`,payload:{}}),z(null)},[n]),Y=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.toggleAutonomous`,payload:{}})},[n]),X=(0,N.useCallback)(()=>{n?.send?.(x===`paused`?{type:`autophase.resume`,payload:{}}:{type:`autophase.pause`,payload:{}})},[n,x]),Z=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.stop`,payload:{}})},[n]),Q=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.clear`,payload:{}}),T.getState().clear(),z(null),L(``)},[n]),[te,$]=(0,N.useState)(!1),ne=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.revert`,payload:{}}),$(!1)},[n]),re=x===`running`||x===`paused`,ie=x===`stopped`||x===`completed`||x===`failed`,ae=(0,N.useCallback)(e=>{e&&n?.send?.({type:`autophase.load`,payload:{graphId:e}})},[n]);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,P.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2 border-b bg-card px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(o,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:G&&h||`AutoPhase`}),G&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`activity:autoPhase.summary`,{count:i.length,pct:a})})]}),G&&(0,P.jsx)(`span`,{className:w(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,x===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:x===`paused`||x===`stopped`?`border-warning/40 bg-warning/10 text-warning`:x===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:S??void 0,children:x})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[C.length>0&&(0,P.jsxs)(`select`,{value:G?C.find(e=>e.title===h)?.id??``:``,onChange:e=>ae(e.target.value),title:r(`activity:autoPhase.switchBoard`),className:`min-w-0 flex-1 rounded border border-border bg-card px-2 py-1 text-xs text-foreground sm:w-72 sm:flex-none`,children:[(0,P.jsx)(`option`,{value:``,disabled:!0,children:r(`activity:autoPhase.boardsCount`,{count:C.length})}),C.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.title,` · `,e.status]},e.id))]}),G&&(0,P.jsxs)(`button`,{type:`button`,onClick:Y,title:r(`activity:autoPhase.toggleAutonomousTitle`),className:w(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,c?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(f,{className:`h-3.5 w-3.5`}),` `,r(c?`activity:autoPhase.autonomous`:`activity:autoPhase.manual`)]}),re&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:X,title:r(x===`paused`?`activity:autoPhase.resumeTitle`:`activity:autoPhase.pauseTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[x===`paused`?(0,P.jsx)(l,{className:`h-3.5 w-3.5`}):(0,P.jsx)(p,{className:`h-3.5 w-3.5`}),r(x===`paused`?`activity:autoPhase.resume`:`activity:autoPhase.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:Z,title:r(`activity:autoPhase.stopTitle`),className:`inline-flex items-center gap-1 rounded border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,children:[(0,P.jsx)(g,{className:`h-3.5 w-3.5 fill-current`}),` `,r(`activity:autoPhase.stop`)]})]}),G&&ie&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:Q,title:r(`activity:autoPhase.newTitle`),className:`inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-2 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/20`,children:[(0,P.jsx)(s,{className:`h-3.5 w-3.5`}),` `,r(`activity:autoPhase.newLabel`)]}),te?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 text-xs`,children:[(0,P.jsx)(`span`,{className:`text-warning`,children:r(`activity:autoPhase.revertConfirm`)}),(0,P.jsx)(`button`,{type:`button`,onClick:ne,className:`rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-destructive hover:bg-destructive/25`,children:r(`common:action.yes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>$(!1),className:`rounded px-1.5 py-0.5 text-muted-foreground hover:text-foreground`,children:r(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:r(`activity:autoPhase.revertTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,P.jsx)(_,{className:`h-3.5 w-3.5`}),` `,r(`activity:autoPhase.revert`)]})]}),(0,P.jsx)(k,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(m,{className:`h-4 w-4`})})]})]}),G&&y&&(0,P.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-muted/20 px-4 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(u,{className:`h-3 w-3`}),` `,r(`activity:autoPhase.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:y})]}),G?(0,P.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,P.jsx)(H,{})}):K?(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-5 text-center`,children:[(0,P.jsx)(d,{className:`h-10 w-10 mx-auto animate-spin text-primary/70`}),(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:r(`activity:autoPhase.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`activity:autoPhase.planningBody`)})]}),(0,P.jsxs)(`div`,{className:`rounded-lg border border-border bg-card px-4 py-3 text-left`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(u,{className:`h-3 w-3`}),` `,r(`activity:autoPhase.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(k,{variant:`outline`,onClick:J,className:`gap-2`,children:[(0,P.jsx)(g,{className:`h-4 w-4 fill-current`}),` `,r(`common:action.cancel`)]})]})}):(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-6`,children:[(0,P.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,P.jsx)(u,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:r(`activity:autoPhase.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`activity:autoPhase.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:r(`activity:autoPhase.startPlaceholder`),rows:5,className:`w-full rounded-lg border border-border bg-card px-4 py-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground/50`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),q())}}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>W(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),r(`activity:autoPhase.isolateLabel`)]}),(0,P.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,P.jsxs)(k,{onClick:q,disabled:!I.trim(),className:`flex-1 gap-2`,children:[(0,P.jsx)(l,{className:`h-4 w-4`}),r(`activity:autoPhase.startButton`)]})}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[r(`activity:autoPhase.ctrlHint`),` ·`,` `,r(U?`activity:autoPhase.isolateOn`:`activity:autoPhase.isolateOff`)]})]})}),j.length>0&&(0,P.jsxs)(`div`,{className:`border-t bg-card/50 shrink-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-4 pt-2 text-xs`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!1),className:w(`rounded px-2 py-0.5 border transition-colors`,B?`border-border text-muted-foreground hover:text-foreground`:`bg-primary/10 border-primary/30 text-primary`),children:r(`activity:autoPhase.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:w(`rounded px-2 py-0.5 border transition-colors`,B?`bg-primary/10 border-primary/30 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:r(`activity:autoPhase.graph`)})]}),(0,P.jsxs)(`div`,{className:`space-y-2 px-4 pb-3`,children:[(0,P.jsx)(M,{}),B?(0,P.jsx)(ee,{worktrees:j,baseBranch:F}):(0,P.jsx)(A,{worktrees:j,baseBranch:F})]})]})]})}export{W as AutoPhaseView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Br as r,Bt as i,Pt as a,Wr as o,Yn as s,br as c,ei as l,fi as u}from"./vendor-CyLvG8N0.js";import"./i18n-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Br as r,Bt as i,Pt as a,Wr as o,Yn as s,br as c,ei as l,fi as u}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{i as d,r as f,s as p,t as m}from"./monaco-XnLmrAXJ.js";import{t as h}from"./ws-client-CwL51TNh.js";import{t as g}from"./utils-CU_o9ioU.js";import{P as _,p as v,z as y}from"./index-CyTNJHe8.js";import{t as b}from"./monaco-theme-Lsd14tM-.js";var x=e(t(),1),S=n();d.config({monaco:m});var C={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,json:`json`,css:`css`,scss:`scss`,html:`html`,md:`markdown`,py:`python`,go:`go`,rs:`rust`,java:`java`,c:`c`,cpp:`cpp`,cs:`csharp`,rb:`ruby`,php:`php`,sh:`shell`,bash:`shell`,yml:`yaml`,yaml:`yaml`,toml:`toml`,sql:`sql`};function w(e){return C[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function T({path:e,oldText:t,newText:n}){let{t:r}=u(),i=(0,x.useRef)(null),[s,l]=(0,x.useState)(!1),[d,m]=(0,x.useState)(!1),[g,_]=(0,x.useState)(null);(0,x.useEffect)(()=>{l(!1),m(!1),_(null)},[]);let v=(0,x.useCallback)(e=>{i.current=e,p.setTheme(b()),e.getModifiedEditor().onDidChangeModelContent(()=>l(!0))},[]),C=(0,x.useCallback)(()=>{let t=i.current?.getModifiedEditor().getValue();if(t==null)return;m(!0);let n=h(y.getState().wsUrl),r=n.on(`files.written`,t=>{t.type===`files.written`&&t.payload.filePath===e&&(r(),clearTimeout(a),m(!1),t.payload.success&&(l(!1),_(Date.now())))}),a=setTimeout(()=>{r(),m(!1)},5e3);n.send({type:`files.write`,payload:{filePath:e,content:t}})},[e]),T=w(e);return(0,S.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2 px-2 py-1.5 border-b border-border/40`,children:[(0,S.jsx)(`span`,{className:`text-xs font-mono text-muted-foreground truncate`,children:e}),(0,S.jsxs)(`button`,{type:`button`,onClick:C,disabled:!s||d,className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md border border-border text-xs font-medium disabled:opacity-40 enabled:hover:bg-muted transition-colors`,title:r(`activity:monacoDiff.applyTitle`),children:[d?(0,S.jsx)(o,{className:`h-3.5 w-3.5 animate-spin`}):g&&!s?(0,S.jsx)(c,{className:`h-3.5 w-3.5 text-success`}):(0,S.jsx)(a,{className:`h-3.5 w-3.5`}),r(d?`activity:monacoDiff.applying`:g&&!s?`activity:monacoDiff.applied`:`activity:monacoDiff.apply`)]})]}),(0,S.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden`,children:(0,S.jsx)(f,{original:t,modified:n,language:T,theme:b(),onMount:v,options:{renderSideBySide:!0,readOnly:!1,originalEditable:!1,minimap:{enabled:!1},fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0}})})]})}var E=1e4;function D({className:e}){let{t}=u(),n=_(e=>e.selectedPath),a=_(e=>e.diff),c=_(e=>e.loadingDiff),[d,f]=(0,x.useState)(`unified`),[p,m]=(0,x.useState)(!1),b=!!n&&(c||!a);(0,x.useEffect)(()=>{if(m(!1),!b)return;let e=setTimeout(()=>m(!0),E);return()=>clearTimeout(e)},[b,n]);let C=()=>{n&&(m(!1),_.getState().setDiffLoading(!0),h(y.getState().wsUrl).getGitDiff?.(n))};if(!n)return(0,S.jsx)(`div`,{className:g(`flex min-h-0 min-w-0 flex-1 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,e),children:(0,S.jsxs)(`div`,{className:`ws-surface flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,S.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,S.jsx)(s,{className:`h-6 w-6`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:`Source changes`}),(0,S.jsx)(`p`,{className:`mt-1 text-sm`,children:t(`activity:changes.selectPrompt`)})]})]})});let w=a&&!a.error&&!a.binary&&!a.tooLarge;return(0,S.jsx)(`div`,{className:g(`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:[(0,S.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border/70 px-3 py-2`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`div`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:`Source control`}),(0,S.jsx)(`div`,{className:`truncate font-mono text-xs text-foreground`,title:n,children:n})]}),w&&(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>f(`unified`),title:t(`activity:changes.unifiedTitle`),className:g(`inline-flex h-8 items-center gap-1 rounded-md border px-2 text-xs transition-colors`,d===`unified`?`border-primary/40 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[(0,S.jsx)(r,{className:`h-3.5 w-3.5`}),` `,t(`activity:changes.unified`)]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>f(`edit`),title:t(`activity:changes.editTitle`),className:g(`inline-flex h-8 items-center gap-1 rounded-md border px-2 text-xs transition-colors`,d===`edit`?`border-primary/40 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[(0,S.jsx)(l,{className:`h-3.5 w-3.5`}),` `,t(`activity:changes.edit`)]})]})]}),(0,S.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:c||!a?p?(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-4 text-center`,children:[(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`activity:changes.diffTimeout`)}),(0,S.jsxs)(`button`,{type:`button`,onClick:C,className:`inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-3 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,S.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`common:action.retry`)]})]}):(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(o,{className:`h-4 w-4 animate-spin`}),` `,t(`activity:changes.loadingDiff`)]}):a.error?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-sm text-destructive`,children:a.error}):a.binary?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-sm text-muted-foreground`,children:t(`activity:changes.binary`)}):a.tooLarge?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-sm text-muted-foreground`,children:t(`activity:changes.tooLarge`)}):d===`edit`?(0,S.jsx)(T,{path:a.path,oldText:a.oldText??``,newText:a.newText??``},a.path):(0,S.jsx)(v,{oldText:a.oldText,newText:a.newText,caption:a.path,fill:!0})})]})})}export{D as ChangesView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Kn as r,Z as i,fi as a,fr as o,jt as s}from"./vendor-CyLvG8N0.js";import"./i18n-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Kn as r,Z as i,fi as a,fr as o,jt as s}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{a as c,c as l,i as u,n as d,o as f,s as p,t as m}from"./monaco-XnLmrAXJ.js";import{t as h}from"./ws-client-CwL51TNh.js";import{t as g}from"./utils-CU_o9ioU.js";import{L as _,R as v,T as y,x as b,z as x}from"./index-CyTNJHe8.js";import{t as S}from"./monaco-theme-Lsd14tM-.js";var C={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,css:`css`,html:`html`,svg:`xml`,md:`markdown`,yml:`yaml`,yaml:`yaml`,toml:`toml`,sh:`shell`,bash:`shell`,ps1:`powershell`,py:`python`,rs:`rust`,go:`go`,rb:`ruby`,java:`java`,c:`c`,cpp:`cpp`,h:`c`,hpp:`cpp`,sql:`sql`,xml:`xml`},w=Array.from(new Set(Object.values(C))).filter(e=>e!==`plaintext`),T=12e3,E=4e3,D=5e3,O=1e4;function k(e){return C[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function A(e){return e.match(/([A-Za-z_$][\w$]*)$/)?.[1]??``}function j(e,t){return e.triggerCharacter?!0:t.length>=3}function M(e,t){return e.triggerCharacter===`.`?!0:e.triggerCharacter?!1:/^(findBy|findAllBy|create|update|delete|remove|get[A-Z_]|set[A-Z_]|use[A-Z_])/.test(t)}function N(e){return[e.filePath,e.language,e.lineNumber,e.column,e.versionId??``,e.triggerCharacter??``,e.linePrefix.slice(-160),e.suffix.slice(0,160)].join(`\0`)}var P=e(t(),1),F=n();u.config({monaco:m});function I(e){switch(e){case`method`:return l.CompletionItemKind.Method;case`function`:return l.CompletionItemKind.Function;case`constructor`:return l.CompletionItemKind.Constructor;case`field`:return l.CompletionItemKind.Field;case`variable`:return l.CompletionItemKind.Variable;case`class`:return l.CompletionItemKind.Class;case`interface`:return l.CompletionItemKind.Interface;case`module`:return l.CompletionItemKind.Module;case`property`:return l.CompletionItemKind.Property;case`unit`:return l.CompletionItemKind.Unit;case`value`:return l.CompletionItemKind.Value;case`enum`:return l.CompletionItemKind.Enum;case`keyword`:return l.CompletionItemKind.Keyword;case`snippet`:return l.CompletionItemKind.Snippet;case`file`:return l.CompletionItemKind.File;case`reference`:return l.CompletionItemKind.Reference;default:return l.CompletionItemKind.Text}}function L(){let e=_(e=>e.openFiles),t=_(e=>e.activeFilePath),n=_(e=>e.setActiveFile),r=_(e=>e.closeFile);return e.length===0?null:(0,F.jsx)(`div`,{className:`flex items-center border-b bg-muted/40 overflow-x-auto shrink-0`,children:e.map(e=>{let a=e.path===t,s=e.path.split(`/`).pop()??e.path;return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(e.path),onMouseDown:t=>{t.button===1&&(t.preventDefault(),r(e.path))},className:g(`group flex items-center gap-1.5 px-3 py-1.5 text-[11px] border-r whitespace-nowrap min-w-0 max-w-[180px] transition-colors`,a?`bg-background border-t-2 border-t-primary text-foreground -mb-px`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`),title:e.path,children:[e.dirty&&(0,F.jsx)(o,{className:`h-2 w-2 fill-current text-primary shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:s}),(0,F.jsx)(i,{className:g(`h-3 w-3 shrink-0 rounded-sm hover:bg-muted-foreground/20 opacity-0 group-hover:opacity-100 transition-opacity`,a&&`opacity-100`),onClick:t=>{t.stopPropagation(),r(e.path)}})]},e.path)})})}function R(){let{t:e}=a(),t=_(e=>e.openFiles),n=_(e=>e.activeFilePath),i=_(e=>e.updateContent),{theme:o}=b(),u=(0,P.useRef)(null),m=(0,P.useRef)(n),g=(0,P.useRef)(new Map),C=(0,P.useMemo)(()=>t.find(e=>e.path===n)??null,[t,n]),R=n?k(n):`plaintext`,z=S(),[B,V]=(0,P.useState)(!1);(0,P.useEffect)(()=>{m.current=n},[n]),(0,P.useEffect)(()=>{let e=S();p.setTheme(e)},[o]),(0,P.useEffect)(()=>{let e=w.map(e=>l.registerCompletionItemProvider(e,{triggerCharacters:[`.`,`_`],provideCompletionItems:async(e,t,n,r)=>{let i=m.current;if(!i)return{suggestions:[]};let a=e.getOffsetAt(t),o=e.getValue(),s=o.slice(Math.max(0,a-T),a),c=o.slice(a,a+E),u=e.getLineContent(t.lineNumber).slice(0,Math.max(0,t.column-1)),d=A(u),f={triggerCharacter:n.triggerCharacter,triggerKind:n.triggerKind};if(!j(f,d))return{suggestions:[]};let p=`cmp_${Date.now()}_${Math.random().toString(36).slice(2)}`,_=e.getWordUntilPosition(t),v={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:_.startColumn,endColumn:t.column},y=h(x.getState().wsUrl),b=e=>e.map((e,t)=>({label:e.label,kind:I(e.kind),insertText:e.insertText,detail:e.detail??(e.source?`WrongStack ${e.source}`:void 0),documentation:e.documentation,sortText:e.sortText??`${String(t).padStart(3,`0`)}-${e.label}`,range:v,insertTextRules:e.kind===`snippet`?l.CompletionItemInsertTextRule.InsertAsSnippet:void 0})),S=N({filePath:i,language:e.getLanguageId(),lineNumber:t.lineNumber,column:t.column,versionId:e.getVersionId(),triggerCharacter:n.triggerCharacter,linePrefix:u,suffix:c}),C=g.current.get(S);return C&&C.expiresAt>Date.now()?{suggestions:b(C.items)}:await new Promise(a=>{let l=!1,u=()=>{},m=null,h,_=e=>{l||(l=!0,u(),h!==void 0&&window.clearTimeout(h),m?.dispose(),a({suggestions:e}))};u=y.on(`completion.result`,e=>{let t=e;t.payload.requestId===p&&(g.current.set(S,{expiresAt:Date.now()+O,items:t.payload.items}),_(b(t.payload.items)))}),h=window.setTimeout(()=>_([]),D),m=r.onCancellationRequested(()=>_([])),y.requestCompletion({requestId:p,filePath:i,language:e.getLanguageId(),lineNumber:t.lineNumber,column:t.column,content:o.length<=5e5?o:void 0,prefix:s,suffix:c,triggerCharacter:n.triggerCharacter,triggerKind:n.triggerKind,allowLlm:M(f,d)})})}}));return()=>{e.forEach(e=>{e.dispose()})}},[]);let H=(0,P.useCallback)(()=>{let e=u.current;if(!e)return null;let t=e.getSelection();if(!t||t.isEmpty())return null;let n=e.getModel();if(!n)return null;let r=n.getValueInRange(t);return r.trim()?{content:r,startLine:t.startLineNumber,endLine:t.endLineNumber}:null},[]),U=(0,P.useCallback)(()=>{y(`chat`),requestAnimationFrame(()=>{document.querySelector(`textarea[placeholder*="agent"], textarea[placeholder*="follow-up"]`)?.focus()})},[]),W=(0,P.useCallback)(()=>{let e=m.current;if(!e)return;let t=H();t&&(v.getState().addRef({kind:`snippet`,path:e,startLine:t.startLine,endLine:t.endLine,content:t.content}),U())},[H,U]),G=(0,P.useCallback)(()=>{let e=m.current;e&&(v.getState().addRef({kind:`file`,path:e}),U())},[U]),K=(0,P.useCallback)(t=>{u.current=t,p.setTheme(S()),t.onDidChangeCursorSelection(()=>{let e=t.getSelection();V(!!e&&!e.isEmpty())}),t.addAction({id:`wrongstack-send-to-chat`,label:e(`activity:codeEditor.sendSelectionAction`),contextMenuGroupId:`wrongstack`,contextMenuOrder:0,precondition:void 0,keybindings:[f.CtrlCmd|f.Shift|c.KeyL],run:e=>{let t=e.getSelection();t&&!t.isEmpty()?W():G()}})},[W,G]),q=(0,P.useCallback)(e=>{n&&e!==void 0&&i(n,e)},[n,i]);return(0,P.useEffect)(()=>{let e=e=>{let t=e.ctrlKey||e.metaKey,r=e.target?.tagName?.toLowerCase()===`textarea`||e.target?.closest(`.monaco-editor`)!==null;!t||!r||(e.key.toLowerCase()===`s`&&(e.preventDefault(),window.dispatchEvent(new CustomEvent(`wrongstack:save-file`,{detail:{filePath:n}}))),e.key.toLowerCase()===`w`&&(e.preventDefault(),n&&_.getState().closeFile(n)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),t.length===0?(0,F.jsx)(`div`,{className:`flex h-full min-w-0 items-center justify-center`,children:(0,F.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`activity:codeEditor.noFilesOpen`)}),(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60`,children:e(`activity:codeEditor.selectToEdit`)})]})}):(0,F.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col overflow-hidden`,children:[(0,F.jsx)(L,{}),(0,F.jsxs)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(B||C)&&(0,F.jsx)(`div`,{className:`absolute top-2 right-2 z-10 flex items-center gap-1 rounded-lg border border-border bg-popover/95 backdrop-blur shadow-md p-1`,children:(0,F.jsxs)(`button`,{type:`button`,onClick:B?W:G,className:`inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[11px] text-foreground hover:bg-accent transition-colors`,title:e(B?`activity:codeEditor.sendSelectedTitle`:`activity:codeEditor.mentionFileTitle`),children:[B?(0,F.jsx)(s,{className:`h-3 w-3`}):(0,F.jsx)(r,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:e(B?`activity:codeEditor.sendToChat`:`activity:codeEditor.mentionFile`)})]})}),C?(0,F.jsx)(d,{language:R,value:C.content,onChange:q,theme:z,onMount:K,loading:(0,F.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,F.jsx)(`span`,{className:`text-[11px] text-muted-foreground animate-pulse`,children:e(`activity:codeEditor.loadingEditor`)})}),options:{minimap:{enabled:!1},fontSize:13,fontFamily:`'IBM Plex Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace`,lineNumbers:`on`,renderWhitespace:`selection`,scrollBeyondLastLine:!1,wordWrap:`off`,tabSize:2,smoothScrolling:!0,cursorBlinking:`smooth`,cursorSmoothCaretAnimation:`on`,bracketPairColorization:{enabled:!0},"semanticHighlighting.enabled":!0,automaticLayout:!0,padding:{top:8}}},C.path):(0,F.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e(`activity:codeEditor.selectTab`)})})]})]})}export{R as CodeEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{At as r,Bt as i,Fr as a,In as o,Jr as s,Zn as c,fi as l,hi as u,lt as d,oi as f,si as p,ur as m}from"./vendor-CyLvG8N0.js";import"./i18n-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{At as r,Bt as i,Fr as a,In as o,Jr as s,Zn as c,fi as l,hi as u,lt as d,oi as f,si as p,ur as m}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";var h=e(t(),1),g=n();function _({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:o}=l();return(0,g.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,g.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,g.jsxs)(`div`,{className:`min-w-0`,children:[(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium`,children:e}),(0,g.jsx)(`p`,{className:`mt-1 truncate text-xl font-semibold tabular-nums sm:text-2xl ${i}`,children:t}),n&&(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n})]}),(0,g.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted/70 p-2 ${i}`,children:(0,g.jsx)(r,{className:`w-5 h-5`})})]}),a&&(0,g.jsxs)(`div`,{className:`mt-2 flex items-center gap-1`,children:[a===`up`&&(0,g.jsx)(d,{className:`w-3 h-3 text-success`}),a===`down`&&(0,g.jsx)(d,{className:`w-3 h-3 rotate-180 text-destructive`}),(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(a===`up`?`activity:debug.trendUp`:a===`down`?`activity:debug.trendDown`:`activity:debug.trendStable`)})]})]})}function v(){let{t:e}=l(),[t,n]=(0,h.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[v,x]=(0,h.useState)(!0),[S,C]=(0,h.useState)(2e3),w=(0,h.useCallback)(async()=>{try{let e=await fetch(`/debug/watcher-metrics`),t=null,r=e.headers.get(`content-type`)??``;e.ok&&r.includes(`application/json`)&&(t=await e.json());let i={memoryUsage:{heapUsed:performance.memory?.usedJSHeapSize??0,heapTotal:performance.memory?.totalJSHeapSize??0,external:0,rss:0,arrayBuffers:0},uptime:performance.timeOrigin?performance.now()/1e3:0,cpuUsage:{user:0,system:0}};n({fileWatcher:t,system:i,lastUpdated:new Date,error:null})}catch(e){n(t=>({...t,error:e instanceof Error?e.message:u.t(`activity:debug.fetchFailed`)}))}finally{x(!1)}},[]);return(0,h.useEffect)(()=>{w();let e=setInterval(w,S);return()=>clearInterval(e)},[w,S]),(0,g.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,g.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-5`,children:[(0,g.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,g.jsxs)(`div`,{className:`min-w-0`,children:[(0,g.jsxs)(`h1`,{className:`flex items-center gap-2 text-lg font-semibold sm:text-xl`,children:[(0,g.jsx)(p,{className:`h-5 w-5 text-primary`}),e(`activity:debug.heading`)]}),(0,g.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`activity:debug.subtitle`)})]}),(0,g.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,g.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,g.jsx)(i,{className:`w-4 h-4 text-muted-foreground`}),(0,g.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e(`activity:debug.refreshLabel`)}),(0,g.jsxs)(`select`,{value:S,onChange:e=>C(Number(e.target.value)),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm`,children:[(0,g.jsx)(`option`,{value:1e3,children:`1s`}),(0,g.jsx)(`option`,{value:2e3,children:`2s`}),(0,g.jsx)(`option`,{value:5e3,children:`5s`}),(0,g.jsx)(`option`,{value:1e4,children:`10s`})]})]}),(0,g.jsxs)(`button`,{onClick:()=>{x(!0),w()},disabled:v,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 disabled:opacity-50`,children:[(0,g.jsx)(i,{className:`w-4 h-4 ${v?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),t.lastUpdated&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-card/55 px-3 py-2 text-sm text-muted-foreground`,children:[(0,g.jsx)(m,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:t.lastUpdated.toLocaleTimeString()})]}),t.error&&(0,g.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-destructive/25 bg-destructive/10 p-4 text-destructive`,children:[(0,g.jsx)(f,{className:`w-5 h-5 flex-shrink-0`}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`p`,{className:`font-medium`,children:e(`activity:debug.fetchFailed`)}),(0,g.jsx)(`p`,{className:`text-sm opacity-80`,children:t.error})]})]}),(0,g.jsxs)(`section`,{children:[(0,g.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,g.jsx)(c,{className:`h-4 w-4 text-primary`}),e(`activity:debug.fileWatcher`)]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,g.jsx)(_,{title:e(`activity:debug.watcherStatus`),value:t.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:r,color:t.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,g.jsx)(_,{title:e(`activity:debug.activeProjects`),value:t.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:s,color:`text-primary`}),(0,g.jsx)(_,{title:e(`activity:debug.fileChanges`),value:t.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:a,color:`text-primary`,trend:`neutral`}),(0,g.jsx)(_,{title:e(`activity:debug.filesProcessed`),value:t.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:o,color:`text-success`})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4`,children:[(0,g.jsx)(_,{title:e(`activity:debug.broadcastsSent`),value:t.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:d,color:`text-success`}),(0,g.jsx)(_,{title:e(`activity:debug.debounceResets`),value:t.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:i,color:`text-warning`}),(0,g.jsx)(_,{title:e(`activity:debug.avgDebounce`),value:`${(t.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:m,color:`text-warning`}),(0,g.jsx)(_,{title:e(`activity:debug.totalDelay`),value:`${(t.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:p,color:`text-primary`})]})]}),(0,g.jsxs)(`section`,{children:[(0,g.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,g.jsx)(o,{className:`h-4 w-4 text-primary`}),e(`activity:debug.browserPerf`)]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[(0,g.jsx)(_,{title:e(`activity:debug.heapUsed`),value:y(t.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:p,color:`text-primary`}),(0,g.jsx)(_,{title:e(`activity:debug.heapTotal`),value:y(t.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:p,color:`text-success`}),(0,g.jsx)(_,{title:e(`activity:debug.pageUptime`),value:b(t.system?.uptime??0),subtitle:e(`activity:debug.sinceLoad`),icon:m,color:`text-primary`})]})]}),(0,g.jsxs)(`section`,{children:[(0,g.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,g.jsx)(a,{className:`h-4 w-4 text-primary`}),e(`activity:debug.rawData`)]}),(0,g.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,g.jsx)(`pre`,{className:`overflow-x-auto text-xs font-mono text-muted-foreground`,children:JSON.stringify({fileWatcher:t.fileWatcher,browserMemory:t.system?.memoryUsage,pageUptime:t.system?.uptime},null,2)})})]})]})})}function y(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function b(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${(e/60).toFixed(1)}m`:`${(e/3600).toFixed(1)}h`}export{v as DebugDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Mt as r,Qt as i,Tt as a,Z as o,br as s,fi as c,hi as l,tr as u}from"./vendor-CyLvG8N0.js";import"./i18n-CkkVJCs9.js";import{t as d}from"./utils-CU_o9ioU.js";import{C as f,T as p}from"./index-BqAVsSCe.js";var m=e(t(),1);function h(e,t,n){return e<t?t:e>n?n:e}function g(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[h(r,0,1),Math.max(0,i),a]:null}function _(e){return h(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function v(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function y(e){let t=g(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,y=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${v(_(m))}${v(_(h))}${v(_(y))}`}function b(e){let t=e.trim(),n=y(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var x=n(),S=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],C=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function w(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function T({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e.radius??`0.5rem`,u=e.fontSans??`system-ui, sans-serif`,d=e.fontDisplay??u,f=e.shadow&&e.shadow!==`none`?e.shadow:void 0;return(0,x.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,x.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,x.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,x.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,x.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,x.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,x.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,x.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,x.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function E({kit:e,overrides:t,onSet:n}){let[r,i]=(0,m.useState)(`light`),{t:a}=c(),o=w(r===`light`?e.light:e.dark,t,r);return(0,x.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,x.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,x.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,x.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:d(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:C.filter(e=>o[e]).map(e=>{let t=b(o[e]??``)??`#000000`;return(0,x.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,x.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,x.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function D({className:e}){let{client:t}=f(),{t:n}=c(),[h,g]=(0,m.useState)([]),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)({}),[C,D]=(0,m.useState)(`web`),[O,k]=(0,m.useState)(``),[A,j]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.payload;g(t?.kits??[]),v(t?.activeKit??null),b(t?.overrides??{})},n=e=>{let t=e.payload;t?.ok&&t.kit&&(v(t.kit),b(t.overrides??{}))},r=e=>{let t=e.payload;t?.ok&&t.overrides&&b(t.overrides)},i=e=>{let t=e.payload;j(t?.ok?l.t(`activity:design.wrote`,{path:t.path}):l.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},a=e=>{let t=e.payload;if(!t?.ok){j(l.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);j(t.violationCount?l.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):l.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return t.on(`design.list`,e),t.on(`design.use`,n),t.on(`design.set`,r),t.on(`design.materialize`,i),t.on(`design.verify`,a),t.send({type:`design.list`}),()=>{t.off(`design.list`,e),t.off(`design.use`,n),t.off(`design.set`,r),t.off(`design.materialize`,i),t.off(`design.verify`,a)}},[t]);let M=(0,m.useCallback)(e=>t?.send({type:`design.use`,payload:{kit:e,stack:C}}),[t,C]),N=(0,m.useCallback)((e,n)=>{b(t=>({...t,[e]:n})),t?.send({type:`design.set`,payload:{overrides:{[e]:n}}})},[t]),P=(0,m.useCallback)(()=>{j(l.t(`activity:design.writing`)),t?.send({type:`design.materialize`,payload:{stack:C}})},[t,C]),F=(0,m.useCallback)(()=>{j(l.t(`activity:design.scanning`)),t?.send({type:`design.verify`})},[t]),I=(0,m.useMemo)(()=>{let e=O.trim().toLowerCase();return[...e?h.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):h].sort((e,t)=>e.name.localeCompare(t.name))},[h,O]);return(0,x.jsxs)(`div`,{className:d(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,x.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,x.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,x.jsx)(i,{className:`h-4 w-4`})}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:n(`activity:design.heading`)}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:design.kitsCount`,{count:I.length})})]})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,x.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,x.jsx)(r,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,x.jsx)(`input`,{value:O,onChange:e=>k(e.target.value),placeholder:n(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,x.jsx)(`select`,{value:C,onChange:e=>D(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:n(`activity:design.stackTitle`),children:S.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))}),A&&(0,x.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:A}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:n(`common:action.close`),children:(0,x.jsx)(o,{className:`h-4 w-4`})})]})]})})}),(0,x.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-3 sm:p-4`,children:I.length===0?(0,x.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,x.jsx)(i,{className:`h-8 w-8 text-primary/60`}),(0,x.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`activity:design.kitsCount`,{count:0})}),(0,x.jsx)(`p`,{className:`text-xs`,children:n(`activity:design.searchPlaceholder`)})]}):(0,x.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:I.map(e=>{let t=_===e.id,r=t?y:{};return(0,x.jsxs)(`div`,{className:d(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,x.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,x.jsx)(T,{t:w(e.light,r,`light`),label:n(`activity:designStudio.light`)}),(0,x.jsx)(T,{t:w(e.dark,r,`dark`),label:n(`activity:designStudio.dark`)})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,x.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,x.jsx)(s,{className:`w-3 h-3`}),` `,n(`activity:design.active`)]})]}),(0,x.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:()=>M(e.id),className:d(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:n(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:P,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.materializeTitle`,{stack:C}),children:[(0,x.jsx)(u,{className:`w-3 h-3`}),` `,n(`activity:design.materialize`)]}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:F,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.verifyTitle`),children:[(0,x.jsx)(a,{className:`w-3 h-3`}),` `,n(`activity:design.verify`)]}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,x.jsx)(E,{kit:e,overrides:r,onSet:N})]})]},e.id)})})})]})}export{D as DesignGalleryView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Mt as r,Qt as i,Tt as a,Z as o,br as s,fi as c,hi as l,tr as u}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as d}from"./utils-CU_o9ioU.js";import{C as f,T as p}from"./index-CyTNJHe8.js";var m=e(t(),1);function h(e,t,n){return e<t?t:e>n?n:e}function g(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[h(r,0,1),Math.max(0,i),a]:null}function _(e){return h(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function v(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function y(e){let t=g(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,y=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${v(_(m))}${v(_(h))}${v(_(y))}`}function b(e){let t=e.trim(),n=y(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var x=n(),S=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],C=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function w(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function T({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e.radius??`0.5rem`,u=e.fontSans??`system-ui, sans-serif`,d=e.fontDisplay??u,f=e.shadow&&e.shadow!==`none`?e.shadow:void 0;return(0,x.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,x.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,x.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,x.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,x.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,x.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,x.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,x.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,x.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function E({kit:e,overrides:t,onSet:n}){let[r,i]=(0,m.useState)(`light`),{t:a}=c(),o=w(r===`light`?e.light:e.dark,t,r);return(0,x.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,x.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,x.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,x.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:d(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:C.filter(e=>o[e]).map(e=>{let t=b(o[e]??``)??`#000000`;return(0,x.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,x.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,x.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function D({className:e}){let{client:t}=f(),{t:n}=c(),[h,g]=(0,m.useState)([]),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)({}),[C,D]=(0,m.useState)(`web`),[O,k]=(0,m.useState)(``),[A,j]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.payload;g(t?.kits??[]),v(t?.activeKit??null),b(t?.overrides??{})},n=e=>{let t=e.payload;t?.ok&&t.kit&&(v(t.kit),b(t.overrides??{}))},r=e=>{let t=e.payload;t?.ok&&t.overrides&&b(t.overrides)},i=e=>{let t=e.payload;j(t?.ok?l.t(`activity:design.wrote`,{path:t.path}):l.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},a=e=>{let t=e.payload;if(!t?.ok){j(l.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);j(t.violationCount?l.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):l.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return t.on(`design.list`,e),t.on(`design.use`,n),t.on(`design.set`,r),t.on(`design.materialize`,i),t.on(`design.verify`,a),t.send({type:`design.list`}),()=>{t.off(`design.list`,e),t.off(`design.use`,n),t.off(`design.set`,r),t.off(`design.materialize`,i),t.off(`design.verify`,a)}},[t]);let M=(0,m.useCallback)(e=>t?.send({type:`design.use`,payload:{kit:e,stack:C}}),[t,C]),N=(0,m.useCallback)((e,n)=>{b(t=>({...t,[e]:n})),t?.send({type:`design.set`,payload:{overrides:{[e]:n}}})},[t]),P=(0,m.useCallback)(()=>{j(l.t(`activity:design.writing`)),t?.send({type:`design.materialize`,payload:{stack:C}})},[t,C]),F=(0,m.useCallback)(()=>{j(l.t(`activity:design.scanning`)),t?.send({type:`design.verify`})},[t]),I=(0,m.useMemo)(()=>{let e=O.trim().toLowerCase();return[...e?h.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):h].sort((e,t)=>e.name.localeCompare(t.name))},[h,O]);return(0,x.jsxs)(`div`,{className:d(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,x.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,x.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,x.jsx)(i,{className:`h-4 w-4`})}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:n(`activity:design.heading`)}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:design.kitsCount`,{count:I.length})})]})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,x.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,x.jsx)(r,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,x.jsx)(`input`,{value:O,onChange:e=>k(e.target.value),placeholder:n(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,x.jsx)(`select`,{value:C,onChange:e=>D(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:n(`activity:design.stackTitle`),children:S.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))}),A&&(0,x.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:A}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:n(`common:action.close`),children:(0,x.jsx)(o,{className:`h-4 w-4`})})]})]})})}),(0,x.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-3 sm:p-4`,children:I.length===0?(0,x.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,x.jsx)(i,{className:`h-8 w-8 text-primary/60`}),(0,x.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`activity:design.kitsCount`,{count:0})}),(0,x.jsx)(`p`,{className:`text-xs`,children:n(`activity:design.searchPlaceholder`)})]}):(0,x.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:I.map(e=>{let t=_===e.id,r=t?y:{};return(0,x.jsxs)(`div`,{className:d(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,x.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,x.jsx)(T,{t:w(e.light,r,`light`),label:n(`activity:designStudio.light`)}),(0,x.jsx)(T,{t:w(e.dark,r,`dark`),label:n(`activity:designStudio.dark`)})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,x.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,x.jsx)(s,{className:`w-3 h-3`}),` `,n(`activity:design.active`)]})]}),(0,x.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:()=>M(e.id),className:d(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:n(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:P,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.materializeTitle`,{stack:C}),children:[(0,x.jsx)(u,{className:`w-3 h-3`}),` `,n(`activity:design.materialize`)]}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:F,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.verifyTitle`),children:[(0,x.jsx)(a,{className:`w-3 h-3`}),` `,n(`activity:design.verify`)]}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,x.jsx)(E,{kit:e,overrides:r,onSet:N})]})]},e.id)})})})]})}export{D as DesignGalleryView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$r as r,Bt as i,Gt as a,Z as o,at as s,br as c,cr as l,dt as u,jr as d,jt as f,tn as p}from"./vendor-CyLvG8N0.js";import{t as m}from"./ws-client-CwL51TNh.js";import{t as h}from"./utils-CU_o9ioU.js";import{N as g,z as _}from"./index-CyTNJHe8.js";var v=e(t(),1),y=n();function b({onClose:e}){let t=_(e=>e.wsUrl),{boards:n,activeBoardId:s,activeBoard:c,loading:f,error:p,queueHealth:b,setLoading:S,setActiveBoardId:C}=g(),[w,T]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(null),F=(0,v.useMemo)(()=>m(t),[t]),I=c?.tasks.find(e=>e.id===j)??null,L=(0,v.useMemo)(()=>c?c.tasks.filter(e=>e.status===`in_progress`||e.assignment?.status===`running`||e.assignment?.status===`queued`).reduce((e,t)=>e+(t.costCeilingUsd??0),0):0,[c]),R=(e,t={})=>{S(!0),F.send({type:e,payload:t})},z=()=>R(`kanban.list`),B=(e=s)=>{e&&R(`kanban.get`,{boardId:e})};(0,v.useEffect)(()=>{z()},[]),(0,v.useEffect)(()=>{!s&&n[0]?.id&&(C(n[0].id),R(`kanban.get`,{boardId:n[0].id}))},[n,s,C]),(0,v.useEffect)(()=>{c&&j&&!c.tasks.some(e=>e.id===j)&&M(null)},[c,j]),(0,v.useEffect)(()=>{s&&R(`kanban.health`,{boardId:s})},[s]),(0,v.useEffect)(()=>{if(!s)return;let e=setInterval(()=>{R(`kanban.get`,{boardId:s})},5e3);return()=>clearInterval(e)},[s]);let V=()=>{let e=w.trim();e&&(T(``),R(`kanban.create`,{title:e}))},H=()=>{if(!c)return;let e=D.trim();e&&(O(``),R(`kanban.task.add`,{boardId:c.id,title:e,columnId:c.columns[0]?.id??`backlog`}),window.setTimeout(()=>B(c.id),150))},U=()=>{if(!c)return;let e=k.trim();e&&(A(``),R(`kanban.column.add`,{boardId:c.id,title:e}),window.setTimeout(()=>B(c.id),150))},W=()=>{c&&(R(`kanban.delete`,{boardId:c.id}),window.setTimeout(z,150))},G=()=>{c&&(R(`kanban.duplicate`,{boardId:c.id,title:`${c.title} Copy`}),window.setTimeout(z,150))},K=e=>{c&&(R(`kanban.task.remove`,{boardId:c.id,taskId:e.id}),window.setTimeout(()=>B(c.id),150))},q=(e,t)=>{c&&(R(`kanban.task.move`,{boardId:c.id,taskId:e,columnId:t}),window.setTimeout(()=>B(c.id),150))};return(0,y.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background text-foreground md:flex-row`,children:[(0,y.jsxs)(`aside`,{className:`flex max-h-[45dvh] w-full shrink-0 flex-col border-b bg-card/40 md:max-h-none md:w-[280px] md:border-b-0 md:border-r`,children:[(0,y.jsxs)(`div`,{className:`flex h-12 items-center gap-2 border-b px-3`,children:[(0,y.jsx)(`button`,{type:`button`,title:`Back`,onClick:e,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,y.jsx)(d,{size:16})}),(0,y.jsx)(r,{size:17,className:`text-primary`}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:`Kanban`}),(0,y.jsxs)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:[n.length,` boards`]})]}),(0,y.jsx)(`button`,{type:`button`,title:`Refresh`,onClick:z,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,y.jsx)(i,{size:15,className:f?`animate-spin`:void 0})})]}),(0,y.jsxs)(`div`,{className:`flex gap-1 border-b p-2`,children:[(0,y.jsx)(`input`,{value:w,onChange:e=>T(e.target.value),onKeyDown:e=>{e.key===`Enter`&&V()},placeholder:`New board`,className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:border-primary`}),(0,y.jsx)(`button`,{type:`button`,title:`Create board`,onClick:V,className:`flex h-8 w-8 items-center justify-center rounded-md bg-primary text-primary-foreground hover:bg-primary/90`,children:(0,y.jsx)(a,{size:16})})]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:n.map(e=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{C(e.id),R(`kanban.get`,{boardId:e.id})},className:h(`mb-1 w-full rounded-md px-2 py-2 text-left transition-colors`,s===e.id?`bg-primary/10 text-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,y.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.title}),(0,y.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-between text-[11px]`,children:[(0,y.jsxs)(`span`,{children:[e.taskCount,` tasks`]}),(0,y.jsxs)(`span`,{children:[e.completedTaskCount,` done`]})]})]},e.id))})]}),(0,y.jsxs)(`main`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,y.jsxs)(`header`,{className:`flex min-h-12 shrink-0 flex-wrap items-center gap-2 border-b px-3 py-2 sm:px-4`,children:[(0,y.jsxs)(`div`,{className:`w-full min-w-0 sm:w-auto sm:flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:c?.title??`No board selected`}),(0,y.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:c?`${c.columns.length} columns / ${c.tasks.length} tasks`:`Create or select a board`})]}),c&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`input`,{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Enter`&&H()},placeholder:`New task`,className:`h-8 w-[calc(100%-2.5rem)] min-w-0 flex-none rounded-md border bg-background px-2 text-sm outline-none focus:border-primary sm:w-56`}),(0,y.jsx)(`button`,{type:`button`,title:`Add task`,onClick:H,className:`flex h-8 w-8 items-center justify-center rounded-md bg-primary text-primary-foreground hover:bg-primary/90`,children:(0,y.jsx)(a,{size:16})}),(0,y.jsx)(`input`,{value:k,onChange:e=>A(e.target.value),onKeyDown:e=>{e.key===`Enter`&&U()},placeholder:`New column`,className:`h-8 w-[calc(100%-2.5rem)] min-w-0 flex-none rounded-md border bg-background px-2 text-sm outline-none focus:border-primary sm:w-44`}),(0,y.jsx)(`button`,{type:`button`,title:`Add column`,onClick:U,className:`hidden h-8 w-8 items-center justify-center rounded-md border text-muted-foreground hover:bg-muted hover:text-foreground sm:flex`,children:(0,y.jsx)(r,{size:16})}),(0,y.jsx)(`button`,{type:`button`,title:`Duplicate board`,onClick:G,className:`flex h-8 w-8 items-center justify-center rounded-md border text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,y.jsx)(l,{size:16})}),(0,y.jsx)(`button`,{type:`button`,title:`Delete board`,onClick:W,className:`hidden h-8 w-8 items-center justify-center rounded-md border text-muted-foreground hover:bg-destructive/10 hover:text-destructive sm:flex`,children:(0,y.jsx)(u,{size:16})})]})]}),p&&(0,y.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-destructive/30 bg-destructive/10 px-4 text-sm text-destructive`,children:[(0,y.jsx)(o,{size:15}),(0,y.jsx)(`span`,{className:`truncate`,children:p})]}),(0,y.jsx)(`div`,{className:`kanban-scroll-area min-h-0 flex-1 overflow-x-auto overflow-y-hidden`,children:c?(0,y.jsxs)(y.Fragment,{children:[b&&(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-4 border-b px-4 py-2 text-xs text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`font-medium text-foreground`,children:`Queue health`}),b.counts.ready>0&&(0,y.jsxs)(`span`,{title:`Claimable tasks`,className:`inline-flex items-center gap-1 text-success`,children:[b.counts.ready,` ready`]}),b.counts.running>0&&(0,y.jsxs)(`span`,{title:`Running assignments`,className:`inline-flex items-center gap-1 text-warning`,children:[b.counts.running,` running`]}),b.counts.review>0&&(0,y.jsxs)(`span`,{title:`In review`,className:`inline-flex items-center gap-1 text-primary`,children:[b.counts.review,` review`]}),b.counts.blocked>0&&(0,y.jsxs)(`span`,{title:`Manually blocked`,className:`inline-flex items-center gap-1 text-destructive`,children:[b.counts.blocked,` blocked`]}),b.counts.failed>0&&(0,y.jsxs)(`span`,{title:`Failed tasks`,className:`inline-flex items-center gap-1 text-destructive`,children:[b.counts.failed,` failed`]}),b.dependencyBlocked.count>0&&(0,y.jsxs)(`span`,{title:`Ready/pending tasks blocked by dependencies`,className:`inline-flex items-center gap-1 rounded bg-warning/10 px-1.5 py-0.5 text-warning`,children:[b.dependencyBlocked.count,` blocked by deps`]}),b.staleAssignments.count>0&&(0,y.jsxs)(`span`,{title:`Expired lease assignments`,className:`inline-flex items-center gap-1 rounded bg-destructive/10 px-1.5 py-0.5 text-destructive`,children:[b.staleAssignments.count,` stale`]}),b.heartbeatDue.count===0&&b.staleAssignments.count===0&&b.dependencyBlocked.count===0&&(0,y.jsx)(`span`,{className:`text-success`,children:`healthy`}),L>0&&(0,y.jsxs)(`span`,{title:`Sum of costCeilingUsd for running/queued tasks`,className:`inline-flex items-center gap-1 text-info`,children:[`~$`,L.toFixed(2),` running cost`]})]}),(0,y.jsx)(`div`,{className:`flex h-full min-w-max gap-3 p-4`,children:[...c.columns].sort((e,t)=>e.order-t.order).map(e=>(0,y.jsx)(x,{board:c,column:e,selectedTaskId:j,dragTaskId:N,setDragTaskId:P,onSelectTask:M,onDeleteTask:K,onMoveTask:q},e.id))})]}):(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`No kanban board selected.`})})]}),(0,y.jsx)(E,{boards:n,board:c,task:I,onClose:()=>M(null),sendKanban:R,refreshBoard:B})]})}function x({board:e,column:t,selectedTaskId:n,dragTaskId:r,setDragTaskId:i,onSelectTask:a,onDeleteTask:o,onMoveTask:s}){let c=e.tasks.filter(e=>e.columnId===t.id).sort((e,t)=>e.order-t.order);return(0,y.jsxs)(`section`,{onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),r&&s(r,t.id),i(null)},className:h(`flex h-full shrink-0 flex-col rounded-md border bg-muted/25 transition-[width] duration-200`,c.length===0?`w-[180px]`:`w-[310px]`),children:[(0,y.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center gap-2 border-b px-3`,children:[(0,y.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full`,style:{background:t.color??`hsl(var(--primary))`}}),(0,y.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-sm font-semibold`,children:t.title}),(0,y.jsx)(`span`,{className:`rounded bg-background px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:c.length})]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:c.map(e=>(0,y.jsxs)(`article`,{draggable:!0,onDragStart:()=>i(e.id),onDragEnd:()=>i(null),onClick:()=>a(e.id),className:h(`cursor-pointer rounded-md border bg-background p-3 shadow-sm transition-colors`,n===e.id?`border-primary`:`hover:border-primary/50`),children:[(0,y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`line-clamp-2 text-sm font-medium leading-5`,children:e.title}),e.description&&(0,y.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs leading-4 text-muted-foreground`,children:e.description})]}),(0,y.jsx)(`button`,{type:`button`,title:`Delete task`,onClick:t=>{t.stopPropagation(),o(e)},className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive`,children:(0,y.jsx)(u,{size:14})})]}),(0,y.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 text-[11px]`,children:[(0,y.jsx)(`span`,{className:M(e.priority),children:e.priority}),(0,y.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-muted-foreground`,children:e.status}),e.assignedAgent&&(0,y.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-primary`,children:e.assignedAgent}),e.assignment?.model&&(0,y.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-muted-foreground`,children:e.assignment.model})]})]},e.id))})]})}var S=[`openai`,`anthropic`,`google`,`groq`,`together`,`fireworks`,`deepseek`,`mistral`,`cohere`,`perplexity`,`xai`,`custom`],C={openai:[`gpt-4o`,`gpt-4o-mini`,`gpt-4-turbo`,`gpt-4`,`gpt-3.5-turbo`,`o1`,`o1-mini`,`o3-mini`],anthropic:[`claude-sonnet-4-20250514`,`claude-sonnet-4`,`claude-3-5-sonnet-latest`,`claude-3-5-haiku-latest`,`claude-opus-4-20250514`,`claude-opus-4`],google:[`gemini-2.0-flash`,`gemini-2.0-flash-lite`,`gemini-1.5-pro`,`gemini-1.5-flash`],groq:[`llama-3.3-70b-versatile`,`llama-3.1-8b-instant`,`mixtral-8x7b-32768`],together:[`mixtral-8x22b`,`llama-3.3-70b`,`deepseek-coder`,`deepseek-r1`],fireworks:[`llama-3.1-405b`,`deepseek-r1`,`mixtral-8x22b`],deepseek:[`deepseek-chat`,`deepseek-reasoner`,`deepseek-r1`],mistral:[`mistral-large-latest`,`mistral-small-latest`,`codestral-latest`],cohere:[`command-r-plus`,`command-r`],perplexity:[`sonar-pro`,`sonar`],xai:[`grok-2`,`grok-2-mini`]},w=[`architect`,`developer`,`reviewer`,`tester`,`verifier`,`security`,`documenter`,`external`,`leader`,`shadow`,`subagent`],T=[`default`,`fast`,`cheap`,`quality`,`balanced`,`experimental`];function E({boards:e,board:t,task:n,onClose:r,sendKanban:i,refreshBoard:a}){let[u,d]=(0,v.useState)(``),[m,g]=(0,v.useState)(``),[_,b]=(0,v.useState)(``),[x,E]=(0,v.useState)(``),[M,N]=(0,v.useState)(``),[P,F]=(0,v.useState)(``),[I,L]=(0,v.useState)([]),[R,z]=(0,v.useState)([]),[B,V]=(0,v.useState)([]),[H,U]=(0,v.useState)(``);(0,v.useEffect)(()=>{d(n?.assignment?.agentId??n?.assignedAgent??``),g(n?.assignment?.name??``),b(n?.assignment?.role??``),E(n?.assignment?.provider??``),N(n?.assignment?.model??``),F(n?.assignment?.fallbackProfile??``),L(n?.assignment?.fallbackModels??[]),z(n?.assignment?.tools??[]),V(n?.assignment?.allowedCapabilities??[]),U(e.find(e=>e.id!==t?.id)?.id??``)},[t?.id,e,n]);let W=()=>({boardId:t?.id,taskId:n?.id,...u.trim()?{agentId:u.trim()}:{},...m.trim()?{name:m.trim()}:{},..._.trim()?{role:_.trim()}:{},...x.trim()?{provider:x.trim()}:{},...M.trim()?{model:M.trim()}:{},...P.trim()?{fallbackProfile:P.trim()}:{},...I.length>0?{fallbackModels:I}:{},...R.length>0?{tools:R}:{},...B.length>0?{allowedCapabilities:B}:{}});return(0,y.jsxs)(`aside`,{className:h(`w-full shrink-0 flex-col border-t bg-card/40 md:w-[340px] md:border-l md:border-t-0`,n?`flex max-h-[42dvh] md:max-h-none`:`hidden md:flex`),children:[(0,y.jsxs)(`div`,{className:`flex h-12 items-center gap-2 border-b px-3`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:n?`Task`:`Selection`}),(0,y.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:n?.id.slice(0,8)??`No task selected`})]}),(0,y.jsx)(`button`,{type:`button`,title:`Close`,onClick:r,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,y.jsx)(o,{size:16})})]}),n?(0,y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:[(0,y.jsx)(`div`,{className:`text-sm font-semibold leading-5`,children:n.title}),n.description&&(0,y.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-muted-foreground`,children:n.description}),(0,y.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2 text-xs`,children:[(0,y.jsx)(D,{label:`Status`,value:n.status}),(0,y.jsx)(D,{label:`Priority`,value:n.priority}),(0,y.jsx)(D,{label:`Run`,value:n.assignment?.status??`unassigned`}),(0,y.jsx)(D,{label:`Column`,value:n.columnId})]}),(0,y.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,y.jsx)(O,{label:`Agent ID`,value:u,onChange:d}),(0,y.jsx)(O,{label:`Name`,value:m,onChange:g}),(0,y.jsx)(A,{label:`Role`,value:_,options:w,placeholder:`Select a role…`,onChange:b}),(0,y.jsx)(A,{label:`Provider`,value:x,options:S,placeholder:`Select provider…`,onChange:e=>{E(e),N(``)}}),(0,y.jsx)(A,{label:`Model`,value:M,options:x&&C[x]?C[x]:k(),placeholder:x?`Select ${x} model…`:`Select a provider first…`,onChange:N}),(0,y.jsx)(A,{label:`Fallback profile`,value:P,options:T,placeholder:`None`,onChange:F}),(0,y.jsx)(j,{label:`Fallback models`,tags:I,onChange:L}),(0,y.jsx)(j,{label:`Tools`,tags:R,onChange:z}),(0,y.jsx)(j,{label:`Capabilities`,tags:B,onChange:V})]}),(0,y.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||(i(`kanban.task.assign`,W()),window.setTimeout(()=>a(t.id),150))},className:`inline-flex h-9 items-center justify-center gap-2 rounded-md border text-sm hover:bg-muted`,children:[(0,y.jsx)(s,{size:15}),`Assign`]}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||(i(`kanban.task.dispatch`,W()),window.setTimeout(()=>a(t.id),200))},className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary text-sm text-primary-foreground hover:bg-primary/90`,children:[(0,y.jsx)(f,{size:15}),`Dispatch`]})]}),e.length>1?(0,y.jsxs)(`div`,{className:`mt-4 space-y-2 rounded-md border bg-background p-2`,children:[(0,y.jsxs)(`label`,{className:`block`,children:[(0,y.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Target board`}),(0,y.jsx)(`select`,{value:H,onChange:e=>U(e.target.value),className:`h-8 w-full rounded-md border bg-background px-2 text-sm outline-none focus:border-primary`,children:e.filter(e=>e.id!==t?.id).map(e=>(0,y.jsx)(`option`,{value:e.id,children:e.title},e.id))})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||!H||i(`kanban.task.copy`,{boardId:t.id,taskId:n.id,targetBoardId:H})},disabled:!H,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md border text-sm hover:bg-muted disabled:opacity-50`,children:[(0,y.jsx)(l,{size:15}),`Copy`]}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||!H||i(`kanban.task.transfer`,{boardId:t.id,taskId:n.id,targetBoardId:H})},disabled:!H,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md border text-sm hover:bg-muted disabled:opacity-50`,children:[(0,y.jsx)(p,{size:15}),`Transfer`]})]})]}):null,n.successCriteria?.length?(0,y.jsxs)(`div`,{className:`mt-5`,children:[(0,y.jsx)(`div`,{className:`mb-2 text-xs font-semibold uppercase text-muted-foreground`,children:`Checks`}),(0,y.jsx)(`div`,{className:`space-y-1.5`,children:n.successCriteria.map(e=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-background px-2 py-1.5 text-xs`,children:[(0,y.jsx)(c,{size:13,className:e.status===`passed`?`text-success`:`text-muted-foreground`}),(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.description}),(0,y.jsx)(`span`,{className:`text-muted-foreground`,children:e.status})]},e.id))})]}):null]}):(0,y.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground`,children:`Select a task to edit assignment and dispatch settings.`})]})}function D({label:e,value:t}){return(0,y.jsxs)(`div`,{className:`rounded-md border bg-background px-2 py-1.5`,children:[(0,y.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e}),(0,y.jsx)(`div`,{className:`mt-0.5 truncate text-xs font-medium`,children:t})]})}function O({label:e,value:t,onChange:n}){return(0,y.jsxs)(`label`,{className:`block`,children:[(0,y.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:e}),(0,y.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),className:`h-8 w-full rounded-md border bg-background px-2 text-sm outline-none focus:border-primary`})]})}function k(){return[...new Set(Object.values(C).flat())]}function A({label:e,value:t,options:n,placeholder:r,onChange:i}){return(0,y.jsxs)(`label`,{className:`block`,children:[(0,y.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:e}),(0,y.jsxs)(`select`,{value:t,onChange:e=>i(e.target.value),className:`h-8 w-full rounded-md border bg-background px-2 text-sm outline-none focus:border-primary`,children:[r&&(0,y.jsx)(`option`,{value:``,children:r}),n.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))]})]})}function j({label:e,tags:t,onChange:n}){let[r,i]=(0,v.useState)(``),a=()=>{let e=r.trim();e&&(t.includes(e)||n([...t,e]),i(``))},s=e=>{n(t.filter(t=>t!==e))};return(0,y.jsxs)(`label`,{className:`block`,children:[(0,y.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:e}),(0,y.jsx)(`div`,{className:`rounded-md border bg-background px-2 py-1.5 focus-within:border-primary`,children:(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[t.map(e=>(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px]`,children:[(0,y.jsx)(`span`,{className:`max-w-[120px] truncate`,children:e}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`text-muted-foreground hover:text-destructive`,children:(0,y.jsx)(o,{size:12})})]},e)),(0,y.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`,`)&&(e.preventDefault(),a()),e.key===`Backspace`&&!r&&t.length>0&&s(t[t.length-1])},onBlur:a,placeholder:t.length===0?`Type and press Enter to add…`:`Add…`,className:`min-w-[60px] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]})})]})}function M(e){let t=`rounded px-1.5 py-0.5`;return e===`critical`?`${t} bg-destructive/10 text-destructive`:e===`high`?`${t} bg-warning/10 text-warning`:e===`low`?`${t} bg-muted text-muted-foreground`:`${t} bg-info/10 text-info`}export{b as KanbanView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{c as t,m as n,p as r}from"./markdown-D0X23O-i.js";import{Ft as i,Kn as a,Tr as o,Z as s,ai as c,dn as l,fi as u,fr as d,hi as f,ht as p,it as m,jr as h,jt as g,ri as _,sn as v,ur as y,zt as b}from"./vendor-CyLvG8N0.js";import"./i18n-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{c as t,m as n,p as r}from"./markdown-D0X23O-i.js";import{Ft as i,Kn as a,Tr as o,Z as s,ai as c,dn as l,fi as u,fr as d,hi as f,ht as p,it as m,jr as h,jt as g,ri as _,sn as v,ur as y,zt as b}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{n as x}from"./ui-store-ComQYc5F.js";import{t as S}from"./utils-CU_o9ioU.js";import{T as C,d as w}from"./index-CyTNJHe8.js";var T=e(n(),1),E=r(),D={note:a,ask:_,assign:g,steer:i,btw:o,broadcast:g,status:d,result:c},O={high:`border-destructive/25 bg-destructive/10 text-destructive`,normal:`border-border bg-muted text-muted-foreground`,low:`border-primary/20 bg-primary/10 text-primary`};function k(e){return new Date(e).toLocaleString()}function A(e){let t=new Date(e),n=Date.now()-t.getTime();return n<6e4?f.t(`common:time.justNow`):n<36e5?f.t(`common:time.minutesAgo`,{count:Math.round(n/6e4)}):n<864e5?f.t(`common:time.hoursAgo`,{count:Math.round(n/36e5)}):n<6048e5?f.t(`common:time.daysAgo`,{count:Math.round(n/864e5)}):t.toLocaleDateString()}function j(){let{t:e}=u();return(0,E.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,E.jsxs)(`div`,{className:`ws-surface flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,E.jsx)(l,{className:`h-6 w-6`})}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e(`activity:mailbox.emptyDetail`)}),(0,E.jsx)(`div`,{className:`mt-1 text-xs`,children:e(`activity:mailbox.emptyDetailHint`)})]})]})})}function M({readBy:e}){let{t}=u(),n=Object.entries(e);return n.length===0?null:(0,E.jsxs)(`div`,{className:`space-y-1`,children:[(0,E.jsx)(`div`,{className:`text-[10px] font-semibold text-muted-foreground uppercase tracking-wide`,children:t(`activity:mailbox.readBy`)}),(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:n.map(([e,t])=>(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-success/10 text-success`,title:k(t),children:[(0,E.jsx)(c,{className:`h-2.5 w-2.5`}),e]},e))})]})}function N({className:e}){let{t:n}=u(),r=x(e=>e.selectedMailMessage),i=x(e=>e.setSelectedMailMessage);(0,T.useEffect)(()=>()=>{i(null)},[i]);function a(){i(null),C(`chat`)}if(!r)return(0,E.jsx)(j,{});let o=D[r.type]??v,l=n(`activity:mailbox.type.${r.type}`,{defaultValue:r.type}),d=O[r.priority]??O.normal;return(0,E.jsx)(`div`,{className:S(`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:(0,E.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/70 px-3 py-3 sm:px-4 shrink-0`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:a,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:n(`activity:mailbox.backToChat`),children:(0,E.jsx)(h,{className:`h-4 w-4`})}),(0,E.jsx)(`div`,{className:S(`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,r.completed?`bg-success/10`:`bg-primary/10`),children:(0,E.jsx)(o,{className:S(`h-4 w-4`,r.completed?`text-success`:`text-primary`)})}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,E.jsx)(`h2`,{className:`text-sm font-semibold text-foreground truncate`,children:r.subject}),r.completed&&(0,E.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-success/25 bg-success/8 px-1.5 py-0.5 text-[10px] font-semibold text-success`,children:[(0,E.jsx)(c,{className:`h-3 w-3`}),n(`activity:mailbox.completed`)]}),(0,E.jsx)(`span`,{className:S(`rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,d),children:r.priority||`normal`})]}),(0,E.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/80`,children:r.from}),(0,E.jsx)(`span`,{children:`→`}),(0,E.jsx)(`span`,{className:`min-w-0 truncate`,children:r.to===`*`||r.to===`all`?n(`activity:mailbox.everyone`):r.to}),(0,E.jsx)(`span`,{className:`opacity-40`,children:`•`}),(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,E.jsx)(y,{className:`h-3 w-3`}),A(r.timestamp)]})]})]}),(0,E.jsx)(`button`,{type:`button`,onClick:a,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:n(`activity:mailbox.closeTitle`),children:(0,E.jsx)(s,{className:`h-4 w-4`})})]}),(0,E.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:(0,E.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-5`,children:(0,E.jsx)(`div`,{className:`markdown-content prose prose-sm dark:prose-invert max-w-none text-sm leading-relaxed`,children:(0,E.jsx)(t,{components:w,children:r.body})})})}),(0,E.jsxs)(`div`,{className:`border-t border-border/70 bg-muted/20 px-4 py-3 shrink-0`,children:[(0,E.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-x-6 gap-y-2 text-xs`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,E.jsx)(p,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{children:l})]}),(0,E.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,E.jsx)(`span`,{className:S(`rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,d),children:r.priority||`normal`})}),(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,E.jsx)(m,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,title:r.from,children:r.from})]}),(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,E.jsx)(y,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{children:k(r.timestamp)})]}),r.replyTo&&(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground col-span-2`,children:[(0,E.jsx)(b,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:n(`activity:mailbox.replyTo`,{id:r.replyTo})})]}),r.completed&&r.completedBy&&(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground col-span-2`,children:[(0,E.jsx)(c,{className:`h-3 w-3 shrink-0 text-success`}),(0,E.jsx)(`span`,{children:r.completedAt?n(`activity:mailbox.completedByAt`,{name:r.completedBy,time:k(r.completedAt)}):n(`activity:mailbox.completedBy`,{name:r.completedBy})})]}),r.outcome&&(0,E.jsxs)(`div`,{className:`flex items-start gap-1.5 text-muted-foreground col-span-2 sm:col-span-4`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide shrink-0 mt-0.5`,children:n(`activity:mailbox.outcome`)}),(0,E.jsx)(`span`,{children:r.outcome})]}),r.taskContext&&(0,E.jsxs)(`div`,{className:`flex items-start gap-1.5 text-muted-foreground col-span-2 sm:col-span-4`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide shrink-0 mt-0.5`,children:n(`activity:mailbox.task`)}),(0,E.jsx)(`span`,{children:r.taskContext})]})]}),Object.keys(r.readBy??{}).length>0&&(0,E.jsx)(`div`,{className:`mt-3 pt-3 border-t border-border/50`,children:(0,E.jsx)(M,{readBy:r.readBy})})]})]})})}export{N as MailboxDetailView};
|