@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
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{c as t,m as n,p as r,s as i}from"./markdown-D0X23O-i.js";import{$ as a,Cr as o,Dn as s,Fr as c,Nr as l,Nt as u,Sn as d,X as f,Y as p,dn as m,et as h,fi as g,hi as _,in as v,it as y,jt as b,kn as x,nr as S,oi as C,or as w,pt as T,rt as E,un as ee,ur as D,xr as te}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{s as O}from"./ws-client-CwL51TNh.js";import{t as ne}from"./session-store-P-JnaPPK.js";import{t as k}from"./utils-CU_o9ioU.js";import{A,F as j,I as M,M as re,S as ie,c as ae,d as N,f as P,j as oe,l as se,u as F}from"./index-CyTNJHe8.js";import{a as I,c as L,d as ce,f as le,h as R,i as ue,l as de,m as z,n as fe,o as pe,p as me,r as he,s as ge,t as _e,u as ve}from"./xyflow-oYDGUYW6.js";var B=e(n(),1),V=r();function H(e){if(e<1e3)return`${e}ms`;let t=Math.round(e/100);return t<600?`${(t/10).toFixed(1)}s`:`${Math.floor(t/600)}m ${Math.round(t%600/10)}s`}var ye={user:{Icon:y,labelKey:`activity:message.roleYou`,avatarBg:`bg-primary`,avatarColor:`text-primary-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-primary/20`,bubbleBg:`bg-primary`,bubbleBorder:`border-transparent`,textColor:`text-primary-foreground`},assistant:{Icon:o,labelKey:`activity:message.roleAssistant`,avatarBg:`bg-accent`,avatarColor:`text-accent-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-accent/20`,bubbleBg:`bg-card`,bubbleBorder:`border-border`,textColor:`text-foreground`},tool:{Icon:T,labelKey:`activity:message.roleTool`,avatarBg:`bg-secondary`,avatarColor:`text-secondary-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-secondary/20`,bubbleBg:`bg-muted/80`,bubbleBorder:`border-border`,textColor:`text-foreground`},system:{Icon:o,labelKey:`activity:transcript.kindSystem`,avatarBg:`bg-muted`,avatarColor:`text-muted-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-muted/20`,bubbleBg:`bg-muted/50`,bubbleBorder:`border-border`,textColor:`text-muted-foreground`},error:{Icon:C,labelKey:`activity:transcript.kindError`,avatarBg:`bg-destructive`,avatarColor:`text-destructive-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-destructive/20`,bubbleBg:`bg-destructive/5`,bubbleBorder:`border-destructive/20`,textColor:`text-destructive`}};function U({entry:e}){let{t:n}=g();return e.role===`error`?(0,V.jsx)(se,{text:e.text}):e.role===`tool`?(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5 tool-details`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground`,children:[(0,V.jsx)(T,{className:`h-3 w-3`}),(0,V.jsx)(`span`,{className:`font-mono`,children:e.tool??n(`activity:watch.toolFallback`)}),e.durationMs!==void 0&&(0,V.jsxs)(`span`,{className:`ml-auto text-[10px] text-muted-foreground font-normal tabular-nums`,children:[(0,V.jsx)(D,{className:`h-3 w-3 inline mr-0.5 align-text-bottom`}),H(e.durationMs)]})]}),e.input!==void 0&&e.input!==null&&(0,V.jsx)(`div`,{className:`p-3 bg-muted/50 rounded-lg overflow-x-auto`,children:(0,V.jsx)(ae,{input:e.input})}),e.output!==void 0&&e.output!==null?(0,V.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:typeof e.output==`string`?(0,V.jsx)(t,{remarkPlugins:[i],rehypePlugins:P,components:N,children:e.output}):(0,V.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs bg-card rounded-lg p-2 border border-border overflow-x-auto`,children:JSON.stringify(e.output,null,2)})}):e.text?(0,V.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:(0,V.jsx)(t,{remarkPlugins:[i],rehypePlugins:P,components:N,children:e.text})}):null,e.isError&&(0,V.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2`,children:[(0,V.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:n(`activity:watch.toolFailed`)}),e.text&&(0,V.jsx)(`pre`,{className:`mt-1 text-xs whitespace-pre-wrap text-destructive/80`,children:e.text})]})]}):(0,V.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:(0,V.jsx)(t,{remarkPlugins:[i],rehypePlugins:P,components:N,children:e.text})})}function be({entry:e,isContinuation:t=!1}){let{t:n}=g(),r=ye[e.role],i=r.Icon;return(0,V.jsxs)(`div`,{className:`group flex gap-3 animate-message msg-bubble rounded-lg transition-shadow`,children:[t?(0,V.jsx)(`div`,{className:`flex-shrink-0 w-8`}):(0,V.jsx)(`div`,{className:k(`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center`,r.avatarBg,r.avatarColor,r.avatarRing),children:(0,V.jsx)(i,{className:`h-4 w-4`})}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5 min-w-0 flex-1`,children:[!t&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:k(`text-xs font-medium`,r.textColor),children:e.role===`tool`&&e.tool?e.tool:n(r.labelKey)}),(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),e.role===`tool`&&e.durationMs!==void 0&&(0,V.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[`· `,H(e.durationMs)]})]}),(0,V.jsx)(`div`,{className:k(`rounded-2xl px-4 py-3 border`,e.role===`user`&&`rounded-br-md`,e.role===`assistant`&&`rounded-bl-md`,e.role===`tool`&&`rounded-bl-sm`,e.role===`system`&&`rounded-bl-sm opacity-70`,e.role===`error`&&`rounded-bl-sm`,r.bubbleBg,r.bubbleBorder),children:(0,V.jsx)(`div`,{className:k(`text-sm leading-relaxed markdown-content`,r.textColor),children:(0,V.jsx)(U,{entry:e})})}),e.text&&e.role!==`error`&&(0,V.jsx)(`div`,{className:`opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,V.jsx)(F,{text:e.text,label:n(`common:action.copy`)})})]})]})}var xe=[`steer`,`ask`,`assign`,`note`],W=2500;function Se({sessionId:e,limit:t=200}){let[n,r]=(0,B.useState)(null),{t:i}=g(),[a,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(null),[m,h]=(0,B.useState)(`steer`),[v,y]=(0,B.useState)(`high`),[b,x]=(0,B.useState)([]),[S,C]=(0,B.useState)(!1),w=(0,B.useRef)(null),T=(0,B.useRef)(!0),E=(0,B.useRef)(!0),ee=oe(e=>e.liveSessions),D=(0,B.useMemo)(()=>ee.find(t=>t.sessionId===e),[ee,e]),te=(0,B.useMemo)(()=>{let e=D;return e?`${e.status}|${e.agents.map(e=>`${e.id}:${e.status}:${e.toolCalls??0}:${e.iterations??0}`).join(`,`)}`:``},[D]),O=D?.status===`active`||(D?.agents.some(e=>e.status===`running`||e.status===`streaming`)??!1),ne=(0,B.useMemo)(()=>{if(!D)return null;let e=D.agents.find(e=>e.status===`running`||e.status===`streaming`);return e?.currentTool?`🔧 ${e.currentTool}`:e?i(`activity:sessionWatch.working`,{name:e.name??e.id}):null},[D,i]),A=(0,B.useMemo)(()=>{if(!D)return null;let e=D.agents.find(e=>e.partialText&&(e.status===`streaming`||e.status===`running`))??D.agents.find(e=>e.partialText);return e?.partialText?{label:e.id===`leader`?i(`activity:sessionWatch.claude`):e.name||e.id,text:e.partialText}:null},[D,i]),j=(0,B.useCallback)(async()=>{try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/events?limit=${t}`);if(!n.ok)throw Error(`HTTP ${n.status}`);let i=await n.json();E.current&&(r(i),s(null))}catch(e){E.current&&s(e instanceof Error?e.message:String(e))}},[e,t]),M=(0,B.useCallback)(async()=>{try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/mailbox`);if(!t.ok)return;let n=await t.json();E.current&&Array.isArray(n.thread)&&x(n.thread)}catch{}},[e]);(0,B.useEffect)(()=>{E.current=!0,r(null),s(null),x([]),j(),M();let e=setInterval(()=>{document.hidden||(j(),M())},W);return()=>{E.current=!1,clearInterval(e)}},[j,M]),(0,B.useEffect)(()=>{te&&j()},[te,j]),(0,B.useEffect)(()=>{T.current&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[n,A]);let re=()=>{let e=w.current;e&&(T.current=e.scrollHeight-e.scrollTop-e.clientHeight<40)},ie=async()=>{let t=c.trim();if(!(!t||u)){d(!0),p(null);try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/message`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:t,type:m,priority:v})});if(!n.ok)throw Error(`HTTP ${n.status}`);l(``),p(O?_.t(`activity:sessionWatch.sentRunning`):_.t(`activity:sessionWatch.sentIdle`)),M()}catch(e){p(_.t(`activity:sessionWatch.sentFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{d(!1)}}},ae=async()=>{if(!S){C(!0),p(null);try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/interrupt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({reason:_.t(`activity:sessionWatch.interruptReason`)})});if(!t.ok)throw Error(`HTTP ${t.status}`);p(_.t(`activity:sessionWatch.interruptSent`)),M()}catch(e){p(_.t(`activity:sessionWatch.interruptFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{C(!1)}}},N=n?.entries??[];return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5 shrink-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:[(0,V.jsx)(`span`,{className:k(`h-1.5 w-1.5 rounded-full`,O?`bg-success animate-pulse`:`bg-muted-foreground`)}),i(`activity:sessionWatch.liveStream`)]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n&&(0,V.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[i(`activity:sessionWatch.events`,{count:n.total}),` · `,n.status]}),O&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>void ae(),disabled:S,title:i(`activity:sessionWatch.interruptTitle`),className:`rounded border border-destructive/40 bg-destructive/15 px-1.5 py-0.5 text-[10px] text-destructive hover:bg-destructive/25 disabled:opacity-40 transition-colors`,children:i(S?`activity:sessionWatch.interrupting`:`activity:sessionWatch.interrupt`)})]})]}),ne&&(0,V.jsxs)(`div`,{className:`mb-1.5 shrink-0 text-[10px] text-foreground truncate`,children:[`▶ `,ne]}),a&&(0,V.jsxs)(`div`,{className:`text-[11px] text-destructive mb-1 shrink-0`,children:[`· `,a]}),(0,V.jsxs)(`div`,{ref:w,onScroll:re,className:`min-h-0 min-w-0 flex-1 overflow-y-auto space-y-1.5 pr-1`,children:[N.length===0&&!a&&(0,V.jsx)(`div`,{className:`text-[11px] text-muted-foreground italic`,children:i(`activity:sessionWatch.loading`)}),N.map((e,t)=>(0,V.jsx)(be,{entry:e,isContinuation:t>0&&N[t-1].role===e.role},`${e.ts}-${t}`)),A&&(0,V.jsxs)(`div`,{className:`flex gap-3 animate-message`,children:[(0,V.jsx)(`div`,{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center bg-accent text-accent-foreground ring-2 ring-offset-2 ring-offset-background ring-accent/20`,children:(0,V.jsx)(o,{className:`h-4 w-4 animate-pulse`})}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5 max-w-[85%] min-w-0`,children:[(0,V.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground px-1`,children:A.label}),(0,V.jsx)(`div`,{className:`rounded-2xl rounded-bl-md px-4 py-3 bg-card border border-border`,children:(0,V.jsxs)(`span`,{className:`text-sm leading-relaxed text-foreground whitespace-pre-wrap break-words`,children:[A.text,(0,V.jsx)(`span`,{className:`animate-pulse text-primary`,children:`▋`})]})})]})]})]}),b.length>0&&(0,V.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border shrink-0 max-h-28 overflow-y-auto space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:i(`activity:mailbox.messages`)}),b.slice(-6).map(e=>{let t=e.completed?i(`activity:sessionWatch.done`):e.readByLeader?i(`activity:sessionWatch.read`):i(`activity:sessionWatch.delivered`);return(0,V.jsxs)(`div`,{className:`text-[10px] leading-snug`,children:[(0,V.jsx)(`span`,{className:k(`font-semibold mr-1.5`,e.fromLeader?`text-accent`:`text-primary`),children:e.fromLeader?i(`activity:sessionWatch.agent`):i(`activity:sessionWatch.you`)}),(0,V.jsx)(`span`,{className:`text-foreground whitespace-pre-wrap break-words`,children:e.body}),!e.fromLeader&&(0,V.jsx)(`span`,{className:k(`ml-1.5 text-[9px]`,e.completed?`text-success`:e.readByLeader?`text-primary`:`text-muted-foreground`),children:t})]},e.id)})]}),(0,V.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border shrink-0`,children:[(0,V.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5`,children:[(0,V.jsx)(`select`,{value:m,onChange:e=>h(e.target.value),title:i(`activity:sessionWatch.msgType.${m}Hint`),className:`rounded bg-muted border border-border px-1.5 py-0.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring`,children:xe.map(e=>(0,V.jsx)(`option`,{value:e,children:i(`activity:sessionWatch.msgType.${e}Label`)},e))}),(0,V.jsxs)(`select`,{value:v,onChange:e=>y(e.target.value),title:i(`activity:sessionWatch.priority`),className:`rounded bg-muted border border-border px-1.5 py-0.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring`,children:[(0,V.jsx)(`option`,{value:`high`,children:`high`}),(0,V.jsx)(`option`,{value:`normal`,children:`normal`}),(0,V.jsx)(`option`,{value:`low`,children:`low`})]})]}),(0,V.jsxs)(`div`,{className:`flex items-end gap-1.5`,children:[(0,V.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),ie())},rows:2,placeholder:i(`activity:sessionWatch.placeholder`,{label:i(`activity:sessionWatch.msgType.${m}Label`)}),className:`flex-1 resize-none rounded-md bg-muted border border-border px-2 py-1 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>void ie(),disabled:u||!c.trim(),className:`shrink-0 rounded-md bg-primary text-primary-foreground px-2.5 py-1.5 text-xs hover:bg-primary/90 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:u?`…`:i(`activity:sessionWatch.send`)})]}),f&&(0,V.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:f}),(0,V.jsx)(`div`,{className:`mt-0.5 text-[9px] text-muted-foreground`,children:i(`activity:sessionWatch.sendHint`)})]})]})}function G(e){return e==null||!Number.isFinite(e)?`0`:e<1e3?String(Math.round(e)):e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(1)}M`}function Ce(e,t){if(!e)return`never`;let n=Date.parse(e);if(!Number.isFinite(n))return`never`;let r=Math.max(0,Math.round((t-n)/1e3));return r<60?`${r}s ago`:r<3600?`${Math.round(r/60)}m ago`:r<86400?`${Math.round(r/3600)}h ago`:`${Math.round(r/86400)}d ago`}function we(e,t){if(!e)return``;let n=Date.parse(e);if(!Number.isFinite(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));return r<60?`${r}s`:r<3600?`${Math.round(r/60)}m`:`${Math.round(r/3600)}h`}function Te(e){if(!e)return;let t=e.split(`/`);return t[t.length-1]?.slice(0,18)}function Ee(e,t=380){let n=new Map,r=Math.max(1,e.length);return e.forEach((e,i)=>{let a=(i-(r-1)/2)*t;n.set(e,600+a)}),n}function De(e,t,n){let r=Math.min(3,n),i=Math.floor(t/r),a=t%r;return{x:e-(Math.min(r,n-i*r)-1)*190/2+a*190,y:640+i*150}}function Oe(e){return e===`tui`?`tui`:e===`repl`||e===`cli`?`repl`:`webui`}function ke(e){return e===`tui`?`TUI`:e===`repl`?`REPL`:`WebUI`}function K(e){switch(e){case`running`:case`active`:return`active`;case`idle`:return`idle`;case`completed`:return`completed`;case`failed`:case`error`:return`error`;case`stopped`:return`offline`;default:return`idle`}}function Ae(e,t){let n=new Set,r=[];for(let i of e){let e=Oe(i.clientType),a=`client-${i.pid??i.sessionId}`,o=[],s=!1;for(let e of i.agents){n.add(e.id);let r=t.get(e.id),i=K(r?.status??e.status);(i===`active`||i===`streaming`)&&(s=!0),o.push({officeId:`${a}__agent-${e.id}`,serverId:e.id,name:r?.name??e.name??e.id,status:i,iteration:r?.iteration??e.iterations??0,toolCalls:r?.toolCalls??e.toolCalls??0,costUsd:r?.costUsd??e.costUsd??0,tokensIn:r?.tokensIn??e.tokensIn??0,tokensOut:r?.tokensOut??e.tokensOut??0,ctxPct:r?.ctxPct??e.ctxPct,model:r?.model??e.model,lastActivityAt:e.lastActivityAt,currentTask:r?.currentTool??r?.lastTool??e.currentTool})}let c=i.status===`closing`||i.status===`stale`||i.status===`lost`?`offline`:s?`active`:`idle`;r.push({id:a,type:e,label:i.projectName||ke(e),sublabel:[ke(e),i.gitBranch?`⎇ ${i.gitBranch}`:``,i.pid?`pid ${i.pid}`:``].filter(Boolean).join(` · `),status:c,sessionId:i.sessionId,pid:i.pid,branch:i.gitBranch,workingDir:i.workingDir,startedAt:i.startedAt,agents:o})}let i=[...t.values()].filter(e=>!n.has(e.id));if(i.length>0){let e=r.find(e=>e.type===`webui`);e||(e={id:`client-self`,type:`webui`,label:`This WebUI`,sublabel:`Web UI`,status:`idle`,agents:[]},r.push(e));for(let t of i){let n=K(t.status);(n===`active`||n===`streaming`)&&(e.status=`active`),e.agents.push({officeId:`${e.id}__agent-${t.id}`,serverId:t.id,name:t.name,status:n,iteration:t.iteration??0,toolCalls:t.toolCalls??0,costUsd:t.costUsd??0,tokensIn:t.tokensIn??0,tokensOut:t.tokensOut??0,ctxPct:t.ctxPct,model:t.model,currentTask:t.currentTool??t.lastTool})}}return r.length===0&&r.push({id:`client-self`,type:`webui`,label:`This WebUI`,sublabel:`Web UI · connecting…`,status:`idle`,agents:[]}),r}function je(e){return e.startsWith(`tool`)?`hsl(var(--warning))`:e.startsWith(`mailbox`)?`hsl(var(--info))`:e.startsWith(`provider`)?`hsl(var(--primary))`:e.startsWith(`agent`)||e.startsWith(`subagent`)?`hsl(var(--success))`:e.includes(`error`)?`hsl(var(--destructive))`:`hsl(var(--primary))`}var q={primary:`hsl(var(--primary))`,info:`hsl(var(--info))`,success:`hsl(var(--success))`,warning:`hsl(var(--warning))`,destructive:`hsl(var(--destructive))`,muted:`hsl(var(--muted-foreground))`};function Me(e){return Math.min(100,Math.max(0,e??0))}function J({status:e,small:t,activity:n=0}){let r=t?`w-2 h-2`:`w-3 h-3`,i=t?4+n*4:6+n*6,a={idle:`bg-muted-foreground`,active:`bg-success`,streaming:`bg-primary`,completed:`bg-primary`,error:`bg-destructive`,offline:`bg-muted-foreground/60`},o={idle:q.muted,active:q.success,streaming:q.primary,completed:q.primary,error:q.destructive,offline:q.muted};return(0,V.jsx)(`span`,{className:k(`rounded-full`,r,n>0&&`animate-pulse`,a[e]),style:{boxShadow:n>0?`0 0 ${i}px ${o[e]}`:void 0}})}function Ne(){let{t:e}=g(),{clientCounts:t,currentSession:n,totalAgents:r,activeAgents:i,aggregate:a}=oe(p(e=>({clientCounts:e.clientCounts,currentSession:e.currentSession,totalAgents:e.totalAgents,activeAgents:e.activeAgents,aggregate:e.aggregate}))),s=t.tui+t.webui+t.repl,l=e=>e?.toLocaleString()??`0`;return(0,V.jsxs)(`div`,{className:`absolute left-4 top-20 z-10 rounded-xl border border-border/70 bg-card/90 p-3 text-foreground shadow-xl backdrop-blur`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,V.jsx)(c,{className:`h-3.5 w-3.5 text-success`}),(0,V.jsx)(`span`,{className:`text-[10px] font-bold uppercase text-muted-foreground`,children:e(`activity:office.sessionStats`)})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5 text-[10px]`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(E,{className:`h-3 w-3 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.clients`)})]}),(0,V.jsxs)(`span`,{className:`font-mono text-foreground`,children:[i,` `,(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),` `,(0,V.jsx)(`span`,{className:`text-success`,children:s})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 pl-4 text-[9px]`,children:[t.tui>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(T,{className:`h-2.5 w-2.5 text-success`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`TUI`}),(0,V.jsx)(`span`,{className:`font-mono text-success`,children:t.tui})]}),t.webui>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(v,{className:`h-2.5 w-2.5 text-primary`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`WebUI`}),(0,V.jsx)(`span`,{className:`font-mono text-primary`,children:t.webui})]}),t.repl>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(T,{className:`h-2.5 w-2.5 text-warning`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`REPL`}),(0,V.jsx)(`span`,{className:`font-mono text-warning`,children:t.repl})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(o,{className:`h-3 w-3 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.agents`)})]}),(0,V.jsxs)(`span`,{className:`font-mono text-foreground`,children:[i,` `,(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),` `,(0,V.jsx)(`span`,{className:`text-primary`,children:r})]})]}),n.model&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(w,{className:`h-3 w-3 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.model`)})]}),(0,V.jsx)(`span`,{className:`max-w-[120px] truncate font-mono text-primary`,title:n.model,children:n.model.split(`/`).pop()?.slice(0,16)})]}),n.mode&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(f,{className:`h-3 w-3 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.mode`)})]}),(0,V.jsx)(`span`,{className:k(`font-mono uppercase text-[9px] px-1.5 py-0.5 rounded`,n.mode===`auto`&&`bg-primary/10 text-primary`,n.mode===`suggest`&&`bg-success/10 text-success`,n.mode===`off`&&`bg-muted text-muted-foreground`,![`auto`,`suggest`,`off`].includes(n.mode||``)&&`bg-muted text-muted-foreground`),children:n.mode})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(x,{className:`h-3 w-3 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.toolCallsLabel`)})]}),(0,V.jsx)(`span`,{className:`font-mono text-warning`,children:l(a.toolCalls)})]}),(0,V.jsxs)(`div`,{className:`mt-1.5 space-y-1 border-t border-border/70 pt-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:`IN`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.input`)})]}),(0,V.jsx)(`span`,{className:`font-mono text-[9px] text-foreground`,children:l(a.tokensIn)})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:`OUT`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.output`)})]}),(0,V.jsx)(`span`,{className:`font-mono text-[9px] text-foreground`,children:l(a.tokensOut)})]})]}),(0,V.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-4 border-t border-border/70 pt-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(S,{className:`h-3 w-3 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.cost`)})]}),(0,V.jsx)(`span`,{className:`font-mono font-medium text-success`,children:(e=>e==null?`$0.0000`:`$${e.toFixed(4)}`)(a.costUsd)})]})]})]})}function Y(){let e={opacity:0,width:1,height:1,minWidth:0,border:`none`,background:`transparent`};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(I,{type:`target`,position:z.Top,style:e,isConnectable:!1}),(0,V.jsx)(I,{type:`source`,position:z.Bottom,style:e,isConnectable:!1})]})}function X({data:e}){let{t}=g();return(0,V.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-border/60 pt-1.5 text-[8px] text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`font-mono text-foreground`,children:e.agentCount??0}),` `,t(`activity:office.agentsSuffix`)]}),e.startedAt&&(0,V.jsx)(`span`,{children:t(`activity:office.upPrefix`,{time:we(e.startedAt,Date.now())})})]})}function Pe({data:e}){let{t}=g(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.status===`offline`,o=e.color||q.info;return(0,V.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[180px] transition-all backdrop-blur-sm`,n&&`shadow-lg shadow-primary/15`,r&&`border-destructive/50 bg-destructive/10`,i&&`border-border/70 bg-muted/35 opacity-60`,!n&&!r&&!i&&`border-primary/30 bg-primary/10`),children:[(0,V.jsx)(Y,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,V.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-primary/15`:`bg-primary/10`),children:(0,V.jsx)(v,{className:`h-5 w-5`,style:{color:o}})}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:o},children:e.label}),(0,V.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.webuiClient`)})]}),(0,V.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,V.jsx)(`div`,{className:`mb-2 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,V.jsx)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(h,{className:`h-3 w-3 text-muted-foreground`}),(0,V.jsx)(`span`,{children:t(`activity:office.disconnected`)})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(a,{className:`h-3 w-3 text-success`}),(0,V.jsx)(`span`,{children:t(`activity:office.connected`)})]})}),n&&(0,V.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-primary/20`,children:(0,V.jsx)(`div`,{className:`h-full animate-pulse bg-primary`,style:{width:`60%`}})}),(0,V.jsx)(X,{data:e})]})}function Z({data:e}){let{t}=g(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.color||q.success;return(0,V.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[180px] transition-all backdrop-blur-sm`,n&&`shadow-lg shadow-success/15`,r&&`border-destructive/50 bg-destructive/10`,!n&&!r&&`border-success/30 bg-success/10`),children:[(0,V.jsx)(Y,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,V.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-success/15`:`bg-success/10`),children:(0,V.jsx)(T,{className:`h-5 w-5`,style:{color:i}})}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:i},children:e.label}),(0,V.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.tuiClient`)})]}),(0,V.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,V.jsx)(`div`,{className:`mb-2 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,V.jsx)(T,{className:`h-3 w-3 text-success`}),(0,V.jsx)(`span`,{children:t(`activity:office.terminal`)})]}),(0,V.jsx)(X,{data:e})]})}function Fe({data:e}){let{t}=g(),n=e.status===`active`||e.status===`streaming`,r=e.color||q.warning;return(0,V.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[160px] transition-all backdrop-blur-sm`,n&&`shadow-lg shadow-warning/15`,!n&&`border-warning/30 bg-warning/10`),children:[(0,V.jsx)(Y,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,V.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-warning/15`:`bg-warning/10`),children:(0,V.jsx)(T,{className:`h-5 w-5`,style:{color:r}})}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:r},children:e.label}),(0,V.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.repl`)})]}),(0,V.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,V.jsx)(`div`,{className:`mb-1 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,V.jsx)(X,{data:e})]})}function Ie({data:e}){let{t}=g(),n=e.status===`active`||e.status===`streaming`,r=e.color||q.primary;return(0,V.jsxs)(`div`,{className:`relative min-w-[200px] rounded-xl border-2 border-border/70 bg-card/90 p-4 shadow-lg backdrop-blur-sm transition-all`,children:[(0,V.jsx)(Y,{}),(0,V.jsx)(`div`,{className:`absolute -top-3 left-1/2 -translate-x-1/2 rounded-full bg-primary px-2 py-0.5 text-[9px] font-bold text-primary-foreground`,children:t(`activity:office.coordinator`)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-3 mt-2`,children:[(0,V.jsx)(`div`,{className:k(`flex items-center justify-center w-12 h-12 rounded-xl`,n?`bg-primary/15`:`bg-primary/10`),children:(0,V.jsx)(w,{className:`h-6 w-6`,style:{color:r}})}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-bold truncate`,style:{color:r},children:e.label}),(0,V.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e.sublabel||t(`activity:office.fleetSummary`)})]}),(0,V.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] mb-2`,children:[(0,V.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,V.jsxs)(`div`,{className:`font-mono`,children:[(0,V.jsx)(`span`,{className:`text-success`,children:e.agentsActive||0}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,V.jsx)(`span`,{className:`text-primary`,children:e.agentsTotal||0})]}),(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:officeMap.agents`)})]}),(0,V.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,V.jsx)(`div`,{className:`font-mono text-warning`,children:(e.toolCalls||0).toLocaleString()}),(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.toolCallsLabel`)})]}),(0,V.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,V.jsx)(`div`,{className:`font-mono text-foreground`,children:G(e.tokensIn)}),(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.tokensLabel`)})]}),(0,V.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,V.jsxs)(`div`,{className:`font-mono text-success`,children:[`$`,(e.costUsd||0).toFixed(3)]}),(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.cost`)})]})]}),n&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-primary`,children:[(0,V.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-primary`}),t(`activity:office.coordinatingFleet`)]})]})}function Le({data:e}){let{t}=g(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.status===`completed`,a=e.color||q.primary,s=Me(e.ctxPct);return(0,V.jsxs)(`div`,{className:k(`rounded-lg border p-3 min-w-[150px] transition-all backdrop-blur-sm`,n&&`border-primary/50 bg-primary/10 shadow-lg shadow-primary/10`,r&&`border-destructive/50 bg-destructive/10`,i&&`border-border/70 bg-muted/35`,!n&&!r&&!i&&`border-primary/30 bg-primary/10`),children:[(0,V.jsx)(Y,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,V.jsx)(o,{className:`h-4 w-4 shrink-0`,style:{color:a}}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-[11px] font-bold truncate`,style:{color:a},children:e.label}),e.model&&(0,V.jsx)(`div`,{className:`truncate text-[8px] text-muted-foreground`,children:Te(e.model)})]}),(0,V.jsx)(J,{status:e.status,small:!0,activity:e.vizActivity??0})]}),e.currentTask&&(0,V.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1 truncate text-[9px] text-primary`,children:[(0,V.jsx)(`span`,{className:k(`h-1.5 w-1.5 shrink-0 rounded-full bg-primary`,n&&`animate-pulse`)}),(0,V.jsx)(`span`,{className:`truncate font-mono`,children:e.currentTask})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-0.5 text-[9px] mb-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`iter`}),(0,V.jsx)(`span`,{className:`font-mono text-foreground`,children:e.iteration||0})]}),(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`tools`}),(0,V.jsx)(`span`,{className:`font-mono text-warning`,children:e.toolCalls||0})]}),(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`tok`}),(0,V.jsx)(`span`,{className:`font-mono text-foreground`,children:G((e.tokensIn||0)+(e.tokensOut||0))})]}),(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`cost`}),(0,V.jsxs)(`span`,{className:`font-mono text-success`,children:[`$`,(e.costUsd||0).toFixed(3)]})]})]}),s>0&&(0,V.jsxs)(`div`,{className:`mb-1`,children:[(0,V.jsxs)(`div`,{className:`mb-0.5 flex justify-between text-[8px] text-muted-foreground`,children:[(0,V.jsx)(`span`,{children:`ctx`}),(0,V.jsxs)(`span`,{className:k(`font-mono`,s>=90?`text-destructive`:s>=70?`text-warning`:`text-muted-foreground`),children:[s,`%`]})]}),(0,V.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-muted`,children:(0,V.jsx)(`div`,{className:k(`h-full`,s>=90?`bg-destructive`:s>=70?`bg-warning`:`bg-primary`),style:{width:`${s}%`}})})]}),e.lastActivityAt&&(0,V.jsxs)(`div`,{className:k(`flex items-center gap-1 text-[8px]`,n?`text-muted-foreground/70`:`text-muted-foreground`),children:[i&&(0,V.jsx)(`span`,{className:`text-success`,children:t(`activity:office.donePrefix`)}),r&&(0,V.jsx)(`span`,{className:`text-destructive`,children:t(`activity:office.failedPrefix`)}),(0,V.jsx)(`span`,{children:t(`activity:office.seenPrefix`,{time:Ce(e.lastActivityAt,Date.now())})})]})]})}function Re({data:e}){let{t}=g();return(0,V.jsxs)(`div`,{className:k(`rounded-lg border border-dashed p-3 min-w-[120px] transition-all opacity-40`,`border-border/70 bg-muted/30`),children:[(0,V.jsx)(Y,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,V.jsx)(l,{className:`h-4 w-4 text-muted-foreground`}),(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,V.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.label})}),(0,V.jsx)(J,{status:e.status,small:!0,activity:e.vizActivity??0})]}),(0,V.jsx)(`div`,{className:`text-[9px] text-muted-foreground`,children:t(`activity:office.availableDesk`)})]})}function Q({data:e}){let{t}=g(),n=e.color||q.warning,r=(e.unreadCount||0)>0;return(0,V.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[160px] transition-all backdrop-blur-sm`,r&&`border-warning/50 bg-warning/10 shadow-lg shadow-warning/10`,!r&&`border-warning/30 bg-warning/6`),children:[(0,V.jsx)(Y,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,V.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,r?`bg-warning/18`:`bg-warning/10`),children:(0,V.jsx)(m,{className:`h-5 w-5`,style:{color:n}})}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-xs font-bold`,style:{color:n},children:t(`activity:office.mailboxHub`)}),(0,V.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:r?t(`activity:office.unreadSuffix`,{count:e.unreadCount||0}):t(`activity:office.allClear`)})]}),r&&(0,V.jsx)(`div`,{className:`flex h-5 w-5 items-center justify-center rounded-full bg-warning text-[10px] font-bold text-background`,children:e.unreadCount})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px]`,children:[(0,V.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-warning`,children:[(0,V.jsx)(b,{className:`h-3 w-3`}),(0,V.jsx)(`span`,{children:e.messageCount||0})]}),(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.total`)})]}),(0,V.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-success`,children:[(0,V.jsx)(s,{className:`h-3 w-3`}),(0,V.jsx)(`span`,{children:e.unreadCount||0})]}),(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.unreadLabel`)})]})]}),e.sublabel&&(0,V.jsxs)(`div`,{className:`mt-2 truncate border-t border-border/60 pt-1.5 text-[9px] text-muted-foreground`,children:[`✉ `,e.sublabel]})]})}var ze={webui:Pe,tui:Z,repl:Fe,coordinator:Ie,agent:Le,mailbox:Q,desk:Re},Be={wire:({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a,data:o,selected:s})=>{let c=o?.color||q.primary,l=A(e=>e.animateEdges),u=o?.animated&&l?Math.max(.15,o?.intensity??.6):0,[d,f,p]=R({sourceX:e,sourceY:t,sourcePosition:i??z.Bottom,targetX:n,targetY:r,targetPosition:a??z.Top,curvature:.28}),m=5+u*7,h=5+u*4,g=m+h,_=`${Math.max(.5,1.6-u).toFixed(2)}s`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{d,fill:`none`,stroke:c,strokeWidth:s?2.5:1.4,strokeOpacity:s?.9:.28,className:`react-flow__edge-path`}),u>.05&&(0,V.jsx)(`path`,{d,fill:`none`,stroke:c,strokeWidth:2.2,strokeOpacity:.45+u*.5,strokeDasharray:`${m} ${h}`,strokeLinecap:`round`,style:{filter:`drop-shadow(0 0 ${2+u*4}px ${c})`},children:(0,V.jsx)(`animate`,{attributeName:`stroke-dashoffset`,from:g,to:`0`,dur:_,repeatCount:`indefinite`})}),o?.label&&u>.1&&(0,V.jsx)(ue,{children:(0,V.jsx)(`div`,{style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${f}px, ${p}px)`},className:`pointer-events-none rounded-full border border-border/70 bg-card/90 px-1.5 py-0.5 text-[8px] font-medium text-foreground backdrop-blur-sm`,children:o.label})})]})}};function Ve({events:e,now:t}){let{t:n}=g(),r=e.slice(0,14);return(0,V.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 z-10 pointer-events-none px-3 pb-3`,children:(0,V.jsxs)(`div`,{className:`pointer-events-auto mx-auto max-w-3xl rounded-lg border border-border/70 bg-card/90 px-3 py-2 shadow-xl backdrop-blur`,children:[(0,V.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-[10px] uppercase text-primary`,children:[(0,V.jsx)(c,{className:`h-3 w-3`}),n(`activity:office.liveActivity`)]}),r.length===0?(0,V.jsx)(`div`,{className:`text-[11px] italic text-muted-foreground`,children:n(`activity:office.waitingActivity`)}):(0,V.jsx)(`div`,{className:`flex flex-col gap-0.5 max-h-32 overflow-hidden`,children:r.map(e=>{let r=Math.max(0,Math.round((t-e.timestamp)/1e3));return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] leading-tight`,children:[(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{backgroundColor:je(e.kind)}}),(0,V.jsx)(`span`,{className:`flex-1 truncate text-foreground`,children:e.label}),(0,V.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:r<1?n(`activity:office.now`):`${r}s`})]},e.id)})})]})})}function $(){let{t:e}=g(),{fitView:t}=me(),n=O(e=>e.events),r=M(e=>e.agents),i=M(e=>e.agentTranscripts),a=M(e=>e.leaderId),s=oe(e=>e.liveSessions),c=re(e=>e.messages),l=ne(e=>e.session),f=(0,B.useMemo)(()=>Ae(s,r),[s,r]),p=A(e=>e.showHud),h=A(e=>e.showLegend),_=A(e=>e.showMinimap),y=A(e=>e.showControls),x=A(e=>e.showFeed),S=A(e=>e.setShowFeed),C=A(e=>e.background),[E,D,ae]=le([]),[N,P,se]=ce([]),[F,I]=(0,B.useState)(null),[L,R]=(0,B.useState)(null),[ue,z]=(0,B.useState)(!1),[H,ye]=(0,B.useState)(``),[U,be]=(0,B.useState)(!1),[xe,W]=(0,B.useState)(null),Oe=(0,B.useMemo)(()=>{if(F?.data.kind!==`agent`)return j;let e=F.data.serverId??(F.id.includes(`__agent-`)?F.id.split(`__agent-`).pop():F.id.replace(/^agent-/,``));return e?i.get(e)??j:j},[i,F]),K=(0,B.useCallback)(async()=>{let e=H.trim();if(!(!e||U)){be(!0),W(null);try{let t=await fetch(`/api/fleet/broadcast`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();ye(``),W(`Delivered to ${n.delivered??0}/${n.targets??0} session(s)`)}catch(e){W(`Failed: ${e instanceof Error?e.message:String(e)}`)}finally{be(!1)}}},[H,U]),je=(0,B.useRef)(new Map),J=4e3,Y=(0,B.useRef)(new Map),X=(0,B.useRef)(new Map),Pe=(0,B.useRef)(new Map),Z=(0,B.useRef)(new Map),Fe=(0,B.useRef)(``);(0,B.useEffect)(()=>{let n=[],i=[],o=Date.now(),s=Math.max(1,...f.map(e=>e.agents.length||1)),l=Math.max(380,Math.min(3,s)*190+80),u=Ee(f.map(e=>e.id),l),d=c.filter(e=>!e.completed&&(e.readByCount??0)===0).length,p=c.length?[...c].sort((e,t)=>Date.parse(t.timestamp)-Date.parse(e.timestamp))[0]:void 0;n.push({id:`mailbox`,type:`mailbox`,position:{x:830,y:50},data:{label:e(`activity:office.mailboxHub`),kind:`mailbox`,status:d>0?`active`:`idle`,unreadCount:d,messageCount:c.length,sublabel:p?`${p.from} → ${p.to}: ${p.subject}`:void 0,color:q.warning}});let m=0,h=0,g=0,_=0,v=0;for(let e of f)for(let t of e.agents)h+=1,(t.status===`active`||t.status===`streaming`)&&(m+=1),g+=t.toolCalls,_+=t.costUsd,v+=t.tokensIn+t.tokensOut;let y=a?r.get(a):null,b=m>0;n.push({id:`coordinator`,type:`coordinator`,position:{x:370,y:50},data:{label:e(`activity:office.fleetHqLabel`),sublabel:e(`activity:office.clientsSuffix`,{count:f.length}),kind:`coordinator`,status:y?.status===`failed`?`error`:b?`active`:`idle`,connections:f.length,agentsActive:m,agentsTotal:h,toolCalls:g,costUsd:_,tokensIn:v,color:q.primary}});let x={tui:q.success,webui:q.info,repl:q.warning};for(let t of f){let r=u.get(t.id)??600,a=x[t.type],s=t.status===`active`;if(n.push({id:t.id,type:t.type,position:{x:r,y:370},data:{label:t.label,sublabel:t.sublabel,kind:t.type,status:t.status,sessionId:t.sessionId,pid:t.pid,branch:t.branch,workingDir:t.workingDir,startedAt:t.startedAt,agentCount:t.agents.length,color:a}}),i.push({id:`${t.id}->coordinator`,source:t.id,target:`coordinator`,type:`wire`,animated:s,data:{color:a,animated:s,label:e(`activity:office.controlLabel`),flowType:`task`}}),i.push({id:`mailbox->${t.id}`,source:`mailbox`,target:t.id,type:`wire`,animated:d>0,data:{color:q.warning,animated:d>0,label:d>0?`${d}`:void 0,flowType:`mail`}}),t.agents.length===0){n.push({id:`desk-${t.id}`,type:`desk`,position:{x:r,y:640},data:{label:e(`activity:office.idleDesk`),kind:`agent`,status:`idle`,color:q.muted}});continue}t.agents.forEach((a,s)=>{let c=a.status===`active`||a.status===`streaming`,l=Z.current.get(a.serverId);if(l&&(a.toolCalls>l.toolCalls||a.iteration>l.iteration)||c){je.current.set(a.officeId,o+J);let e=X.current.get(a.officeId)??0;X.current.set(a.officeId,Math.min(1,e+(1-e)*.5));for(let e of[`${t.id}->${a.officeId}`,`${t.id}->coordinator`]){let t=Y.current.get(e)??0;Y.current.set(e,Math.min(1,t+.5))}}Z.current.set(a.serverId,{toolCalls:a.toolCalls,iteration:a.iteration}),n.push({id:a.officeId,type:`agent`,position:De(r,s,t.agents.length),data:{label:a.name,kind:`agent`,status:a.status,serverId:a.serverId,sessionId:t.sessionId,currentTask:a.currentTask,iteration:a.iteration,toolCalls:a.toolCalls,costUsd:a.costUsd,tokensIn:a.tokensIn,tokensOut:a.tokensOut,ctxPct:a.ctxPct,model:a.model,lastActivityAt:a.lastActivityAt,color:q.primary}}),i.push({id:`${t.id}->${a.officeId}`,source:t.id,target:a.officeId,type:`wire`,animated:c,data:{color:q.primary,animated:c,label:c?a.currentTask??e(`activity:office.taskFallback`):void 0,flowType:`task`}})})}let S=new Set(f.flatMap(e=>e.agents.map(e=>e.serverId)));for(let e of[...Z.current.keys()])S.has(e)||Z.current.delete(e);let C=n.map(e=>{let t=je.current.get(e.id),n=X.current.get(e.id)??0;return t&&t>o&&e.data.status!==`error`&&e.data.status!==`offline`?{...e,data:{...e.data,status:`active`,vizActivity:n}}:{...e,data:{...e.data,vizActivity:n}}}),w=i.map(e=>{let t=Y.current.get(e.id)??0;return t>.05?{...e,animated:!0,data:{...e.data,animated:!0,intensity:t}}:e}),T=new Map;for(let e of C)T.set(e.id,{...e.position});Pe.current=T,D(C),P(w);let E=C.map(e=>e.id).sort().join(`|`);if(E!==Fe.current){Fe.current=E;let e=setTimeout(()=>t({padding:.2,duration:300}),50);return()=>clearTimeout(e)}},[f,a,r,c,l,J,D,P,t]);let Ie=f.flatMap(e=>e.agents.map(t=>({clientId:e.id,clientType:e.type,officeId:t.officeId,serverId:t.serverId}))),Le=f.map(e=>e.id),Re=new Map;for(let e of Ie)(!Re.has(e.serverId)||e.clientType===`webui`)&&Re.set(e.serverId,e.officeId);function Q(e){return Re.get(e)??`agent-${e}`}function $(e){let t=e.split(`__agent-`)[0];return t&&t!==e?`${t}->${e}`:`coordinator->${e}`}function He(e){switch(e.kind){case`mailbox:send`:case`mailbox:deliver`:return{nodes:[`mailbox`],edges:e.kind===`mailbox:send`?Le.map(e=>`mailbox->${e}`):[],status:`active`};case`agent:spawned`:{let t=Q(e.source);return{nodes:[`coordinator`,t],edges:[$(t)],status:`active`}}case`agent:tool`:case`tool:started`:case`tool:progress`:{let t=Q(e.source);return{nodes:[`coordinator`,t],edges:[$(t)],status:e.kind===`tool:progress`||e.kind===`tool:started`?`streaming`:`active`}}case`tool:executed`:{let t=Q(e.target??e.source);return{nodes:[t],edges:[$(t)],status:`active`}}case`provider:call`:case`provider:delta`:case`provider:response`:return{nodes:[`coordinator`],edges:[],status:e.kind===`provider:delta`?`streaming`:`active`};case`iteration:start`:case`iteration:end`:return{nodes:[`coordinator`],edges:Ie.map(e=>$(e.officeId)),status:e.kind===`iteration:start`?`streaming`:`active`};case`agent:text`:{let t=Q(e.source);return{nodes:[t],edges:[$(t)],status:`streaming`}}case`agent:status`:{let t=Q(e.source);return{nodes:[`coordinator`,t],edges:[$(t)],status:e.data&&typeof e.data==`object`&&`status`in e.data&&String(e.data.status)===`failed`?`error`:`completed`}}case`agent:ctx`:return{nodes:[Q(e.source)],edges:[],status:`active`};case`budget:extended`:return{nodes:[`coordinator`,Q(e.source)],edges:[],status:`active`};case`context:compacted`:case`context:repaired`:return{nodes:[`coordinator`],edges:[],status:`active`};case`error`:return{nodes:e.source?[Q(e.source)]:[],edges:[],status:`error`};case`cost:update`:return{nodes:[`coordinator`],edges:[],status:`active`};case`fleet:snapshot`:{let t=e.data?.sessions??[],n=[`coordinator`];for(let e of t)if(e.agents)for(let t of e.agents){let e=Q(t.id);n.includes(e)||n.push(e)}return{nodes:n,edges:[],status:`active`}}default:return{nodes:[],edges:[],status:`idle`}}}(0,B.useEffect)(()=>{if(n.length===0)return;let e=n[0];if(!e)return;let{nodes:t,edges:r,status:i}=He(e),a=Date.now();t.length>0&&(t.forEach(e=>{je.current.set(e,a+J);let t=X.current.get(e)??0;X.current.set(e,Math.min(1,t+(1-t)*.5))}),D(e=>e.map(e=>t.includes(e.id)?{...e,data:{...e.data,status:i,vizActivity:X.current.get(e.id)??0}}:e))),r.length>0&&(r.forEach(e=>{let t=Y.current.get(e)??0;Y.current.set(e,Math.min(1,t+.5))}),P(e=>e.map(e=>r.includes(e.id)?{...e,animated:!0,data:{...e.data,animated:!0,intensity:Y.current.get(e.id)??1}}:e)))},[n,D,P,J,r]),(0,B.useEffect)(()=>{let e=setInterval(()=>{let e=new Map,t=!1;for(let[n,r]of Y.current){let i=r*.85;i<.05?(Y.current.delete(n),e.set(n,{intensity:0,animated:!1}),t=!0):(Y.current.set(n,i),e.set(n,{intensity:i,animated:!0}),t=!0)}t&&P(t=>t.map(t=>{let n=e.get(t.id);return n?{...t,animated:n.animated,data:{...t.data,animated:n.animated,intensity:n.intensity}}:t}));let n=new Map,r=!1;for(let[e,t]of X.current){let i=t*.9;i<.03?(X.current.delete(e),n.set(e,0),r=!0):(X.current.set(e,i),n.set(e,i),r=!0)}r&&D(e=>e.map(e=>{let t=n.get(e.id);return t===void 0?e:{...e,data:{...e.data,vizActivity:t}}}))},1e3);return()=>clearInterval(e)},[P,D]);let Ue=(0,B.useCallback)(e=>P(t=>de({...e,type:`wire`},t)),[P]),We=(0,B.useCallback)((e,t)=>{I(t)},[]),Ge=(0,B.useCallback)(()=>{I(null)},[]);(0,B.useEffect)(()=>{if(!L)return;let e=e=>{e.key===`Escape`&&R(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L]);let Ke=(0,B.useCallback)(()=>{D(e=>e.map(e=>{let t=Pe.current.get(e.id);return t?{...e,position:{...t}}:e})),setTimeout(()=>t({padding:.2,duration:300}),50)},[D,t]),[,qe]=(0,B.useState)(0);return(0,B.useEffect)(()=>{let e=setInterval(()=>{document.hidden||qe(e=>e+1)},2e3);return()=>clearInterval(e)},[]),(0,V.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden bg-[hsl(var(--surface-2)/0.55)]`,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 opacity-[0.03]`,style:{backgroundImage:`
|
|
2
|
+
linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
|
|
3
|
+
linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px)
|
|
4
|
+
`,backgroundSize:`40px 40px`}}),p&&(0,V.jsx)(Ne,{}),(0,V.jsx)(`div`,{className:`absolute top-3 left-1/2 -translate-x-1/2 z-10`,children:(0,V.jsx)(`div`,{className:`rounded-lg border border-border/70 bg-card/90 px-4 py-2 shadow-xl backdrop-blur`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-bold text-foreground`,children:[(0,V.jsx)(te,{className:`h-4 w-4 text-primary`}),e(`activity:office.fleetHq`),(0,V.jsx)(`span`,{className:`ml-2 h-2 w-2 animate-pulse rounded-full bg-success`}),(0,V.jsx)(`span`,{className:`text-[10px] font-normal text-muted-foreground`,children:e(`activity:office.live`)})]})})}),h&&(0,V.jsxs)(`div`,{className:`absolute bottom-4 left-4 z-10 rounded-lg border border-border/70 bg-card/90 p-3 text-[10px] shadow-xl backdrop-blur`,children:[(0,V.jsx)(`div`,{className:`mb-2 font-bold text-foreground`,children:e(`activity:office.legendStatus`)}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-success`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendActive`)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-muted-foreground`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendIdle`)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-destructive`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendError`)})]})]})]}),h&&(0,V.jsxs)(`div`,{className:`absolute bottom-4 right-4 z-10 rounded-lg border border-border/70 bg-card/90 p-3 text-[10px] shadow-xl backdrop-blur`,children:[(0,V.jsx)(`div`,{className:`mb-2 font-bold text-foreground`,children:e(`activity:office.legendConnections`)}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-warning`,children:`✉`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendMail`)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-primary`,children:`→`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendTask`)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-success`,children:`●`}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendStatusConn`)})]})]})]}),(0,V.jsxs)(ve,{nodes:E,edges:N,onNodesChange:ae,onEdgesChange:se,onConnect:Ue,onNodeClick:We,onPaneClick:Ge,nodeTypes:ze,edgeTypes:Be,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,defaultEdgeOptions:{type:`wire`},proOptions:{hideAttribution:!0},children:[(0,V.jsxs)(ge,{position:`top-right`,className:`flex items-center gap-2`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:Ke,title:e(`activity:office.arrangeTitle`),className:`flex items-center gap-1.5 rounded-md border border-border/70 bg-card/90 px-2.5 py-1.5 text-xs text-foreground shadow-sm transition-colors hover:bg-accent`,children:[(0,V.jsx)(d,{className:`h-3.5 w-3.5`}),e(`activity:office.arrange`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>S(!x),title:e(`activity:office.feedTitle`),className:k(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border text-xs transition-colors`,x?`border-primary/35 bg-primary/10 text-primary`:`border-border/70 bg-card/90 text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,V.jsx)(u,{className:`h-3.5 w-3.5`}),e(`activity:office.feed`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>z(e=>!e),title:e(`activity:office.broadcastTitle`),className:k(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border text-xs transition-colors`,ue?`border-warning/35 bg-warning/10 text-warning`:`border-border/70 bg-card/90 text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,V.jsx)(b,{className:`h-3.5 w-3.5`}),e(`activity:office.broadcast`)]})]}),C!==`none`&&(0,V.jsx)(_e,{variant:C===`lines`?fe.Lines:C===`cross`?fe.Cross:fe.Dots,gap:20,size:1,color:`hsl(var(--border) / 0.35)`}),y&&(0,V.jsx)(he,{className:`rounded-lg border border-border/70 bg-card/90 [&>button]:bg-card [&>button]:text-foreground`}),_&&(0,V.jsx)(pe,{className:`rounded-lg border border-border/70 bg-card/90`,nodeColor:e=>{switch(e.data.kind){case`coordinator`:return q.primary;case`webui`:return q.info;case`tui`:return q.success;case`repl`:return q.warning;case`mailbox`:return q.warning;case`agent`:return q.primary;default:return q.primary}},maskColor:`hsl(var(--background) / 0.72)`})]}),x&&(0,V.jsx)(Ve,{events:n,now:Date.now()}),ue&&(0,V.jsxs)(`div`,{className:`absolute right-4 top-16 z-30 w-80 rounded-xl border border-warning/35 bg-card/95 p-3 shadow-2xl backdrop-blur`,children:[(0,V.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-semibold text-warning`,children:[(0,V.jsx)(b,{className:`h-3.5 w-3.5`}),` `,e(`activity:office.broadcastToAll`)]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>z(!1),className:`text-base leading-none text-muted-foreground hover:text-foreground`,children:`×`})]}),(0,V.jsx)(`textarea`,{value:H,onChange:e=>ye(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),K())},rows:3,placeholder:e(`activity:office.broadcastPlaceholder`),className:`w-full resize-none rounded-md border border-border/70 bg-background/70 px-2 py-1 text-[11px] text-foreground placeholder:text-muted-foreground focus:border-warning/45 focus:outline-none`}),(0,V.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:e(`activity:office.broadcastSendHint`)}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>void K(),disabled:U||!H.trim(),className:`rounded-md border border-warning/35 bg-warning/12 px-2.5 py-1 text-[11px] text-warning transition-colors hover:bg-warning/18 disabled:cursor-not-allowed disabled:opacity-40`,children:U?`…`:e(`activity:office.broadcast`)})]}),xe&&(0,V.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:xe})]}),F&&(0,V.jsxs)(`div`,{className:k(`absolute top-20 right-4 bg-background border border-border rounded-lg p-4 shadow-xl z-20`,F.data.kind===`agent`?`w-[28rem] max-w-[calc(100%-2rem)]`:F.data.sessionId?`w-80`:`w-64`),children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[F.data.kind===`webui`&&(0,V.jsx)(v,{className:`h-4 w-4 text-info`}),F.data.kind===`tui`&&(0,V.jsx)(T,{className:`h-4 w-4 text-success`}),F.data.kind===`coordinator`&&(0,V.jsx)(w,{className:`h-4 w-4 text-primary`}),F.data.kind===`agent`&&(0,V.jsx)(o,{className:`h-4 w-4 text-primary`}),F.data.kind===`mailbox`&&(0,V.jsx)(m,{className:`h-4 w-4 text-warning`}),(0,V.jsx)(`span`,{className:`text-sm font-bold text-foreground`,children:F.data.label})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[F.data.sessionId&&(0,V.jsx)(`button`,{type:`button`,title:e(`activity:office.openFullView`),onClick:()=>R({sessionId:F.data.sessionId,label:F.data.label}),className:`text-muted-foreground hover:text-primary`,children:(0,V.jsx)(ee,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(`button`,{onClick:Ge,className:`text-muted-foreground hover:text-foreground text-lg leading-none`,children:`×`})]})]}),(()=>{let t=F.data,n=Date.now(),r=({k:e,v:t,accent:n})=>(0,V.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e}),(0,V.jsx)(`span`,{className:k(`font-mono truncate text-right`,n??`text-foreground/80`),children:t})]}),i=t.kind===`agent`,a=t.kind===`webui`||t.kind===`tui`||t.kind===`repl`,o=(t.tokensIn||0)+(t.tokensOut||0),s=Me(t.ctxPct);return(0,V.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,V.jsx)(r,{k:`Status`,v:String(t.status).toUpperCase(),accent:k(t.status===`active`&&`text-success`,t.status===`streaming`&&`text-primary`,t.status===`error`&&`text-destructive`,t.status===`idle`&&`text-muted-foreground`,t.status===`offline`&&`text-muted-foreground/50`)}),i&&(0,V.jsxs)(V.Fragment,{children:[t.model&&(0,V.jsx)(r,{k:`Model`,v:Te(t.model),accent:`text-primary`}),t.currentTask&&(0,V.jsx)(r,{k:`Tool`,v:t.currentTask,accent:`text-primary`}),(0,V.jsx)(r,{k:`Iterations`,v:t.iteration||0,accent:`text-primary`}),(0,V.jsx)(r,{k:`Tool calls`,v:t.toolCalls||0,accent:`text-warning`}),(0,V.jsx)(r,{k:`Tokens in`,v:G(t.tokensIn)}),(0,V.jsx)(r,{k:`Tokens out`,v:G(t.tokensOut)}),(0,V.jsx)(r,{k:`Tokens total`,v:G(o)}),s>0&&(0,V.jsx)(r,{k:`Context`,v:`${s}%`,accent:s>=90?`text-destructive`:s>=70?`text-warning`:`text-foreground/70`}),(0,V.jsx)(r,{k:`Cost`,v:`$${(t.costUsd||0).toFixed(4)}`,accent:`text-success`}),t.lastActivityAt&&(0,V.jsx)(r,{k:`Last seen`,v:Ce(t.lastActivityAt,n),accent:`text-muted-foreground`}),(0,V.jsx)(`div`,{className:`pt-2`,children:(0,V.jsx)(ie,{entries:Oe,agentName:t.label,compact:!0,maxHeightClassName:`max-h-64`})})]}),a&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(r,{k:`Surface`,v:ke(t.kind),accent:`text-foreground/80`}),t.branch&&(0,V.jsx)(r,{k:`Branch`,v:`⎇ ${t.branch}`,accent:`text-foreground/70`}),t.pid!=null&&(0,V.jsx)(r,{k:`PID`,v:t.pid}),t.workingDir&&(0,V.jsx)(r,{k:`Dir`,v:t.workingDir,accent:`text-muted-foreground`}),(0,V.jsx)(r,{k:`Agents`,v:t.agentCount??0,accent:`text-primary`}),t.startedAt&&(0,V.jsx)(r,{k:`Uptime`,v:we(t.startedAt,n),accent:`text-foreground/70`})]}),t.kind===`mailbox`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(r,{k:`Total messages`,v:t.messageCount||0,accent:`text-warning`}),(0,V.jsx)(r,{k:`Unread`,v:t.unreadCount||0,accent:`text-warning`}),c.length>0&&(0,V.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-border pt-2`,children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e(`activity:office.recent`)}),[...c].sort((e,t)=>Date.parse(t.timestamp)-Date.parse(e.timestamp)).slice(0,6).map(t=>(0,V.jsxs)(`div`,{className:`flex items-start gap-1.5 text-[10px]`,children:[(0,V.jsx)(`span`,{className:k(`mt-1 h-1.5 w-1.5 shrink-0 rounded-full`,!t.completed&&(t.readByCount??0)===0?`bg-warning`:t.completed?`bg-success`:`bg-muted`)}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`truncate text-foreground/80`,children:t.subject||e(`activity:office.noSubject`)}),(0,V.jsxs)(`div`,{className:`truncate font-mono text-[9px] text-muted-foreground`,children:[t.from,` → `,t.to,` · `,Ce(t.timestamp,n)]})]})]},t.id))]})]}),t.kind===`coordinator`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(r,{k:`Connections`,v:t.connections||0,accent:`text-primary`}),(0,V.jsx)(r,{k:`Iterations`,v:t.iteration||0,accent:`text-primary`})]}),(i||a)&&t.sessionId&&(0,V.jsx)(`div`,{className:`mt-2 border-t border-border pt-2 h-72`,children:(0,V.jsx)(Se,{sessionId:t.sessionId})})]})})()]}),L&&(0,V.jsxs)(`div`,{className:`absolute inset-y-0 right-0 z-30 flex w-[min(680px,92%)] flex-col border-l border-border bg-background shadow-2xl`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2.5 shrink-0 bg-card`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,V.jsx)(o,{className:`h-4 w-4 text-primary shrink-0`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`truncate text-sm font-bold text-foreground`,children:L.label}),(0,V.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e(`activity:office.fullOperationStream`)})]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>R(null),title:e(`activity:office.closeEsc`),className:`text-muted-foreground hover:text-foreground text-xl leading-none shrink-0`,children:`×`})]}),(0,V.jsx)(`div`,{className:`flex-1 min-h-0 p-4`,children:(0,V.jsx)(Se,{sessionId:L.sessionId,limit:500})})]})]})}function He(){return(0,V.jsx)(L,{children:(0,V.jsx)($,{})})}export{He as OfficeMapPanel};
|
|
@@ -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{bt as r,fi as i,pt as a,wt as o}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{bt as r,fi as i,pt as a,wt as o}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as s}from"./utils-CU_o9ioU.js";import{C as c,_ as l,b as u,g as d,h as f,z as p}from"./index-CyTNJHe8.js";var m=e(t(),1),h=n();function g({open:e,onClose:t,className:n}){let{t:g}=i(),[_,v]=(0,m.useState)([]),y=c(),b=p(e=>e.wsConnected),x=(0,m.useRef)(null),S=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!(!e||!b||!y.client?.isConnected))return y.client.send?.({type:`process.list`}),x.current=y.client.on?.(`process.list`,e=>{let t=e?.payload;t?.processes&&v(t.processes)})??null,S.current=setInterval(()=>{y.client.send?.({type:`process.list`})},3e3),()=>{x.current?.(),S.current&&clearInterval(S.current)}},[e,b,y.client]);let C=(0,m.useCallback)(e=>{y.client.send?.({type:`process.kill`,payload:{pid:e}})},[y.client]),w=(0,m.useCallback)(()=>{y.client.send?.({type:`process.killAll`})},[y.client]),T=_.filter(e=>e.status===`running`);return(0,h.jsx)(f,{open:e,onOpenChange:e=>{e||t()},children:(0,h.jsxs)(d,{className:s(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[75dvh] pt-[10dvh]`,n),showCloseButton:!1,children:[(0,h.jsx)(u,{className:`sr-only`,children:g(`activity:process.heading`)}),(0,h.jsx)(l,{className:`sr-only`,children:g(`activity:process.subtitle`,{active:T.length,total:_.length})}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,h.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-warning/10 text-warning`,children:(0,h.jsx)(a,{className:`h-4 w-4`})}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h2`,{className:`text-sm font-semibold`,children:g(`activity:process.heading`)}),(0,h.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:g(`activity:process.subtitle`,{active:T.length,total:_.length})})]})]}),(0,h.jsx)(`div`,{className:`flex items-center gap-1`,children:T.length>0&&(0,h.jsxs)(`button`,{type:`button`,onClick:w,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,children:[(0,h.jsx)(r,{className:`h-3 w-3 fill-current`}),g(`activity:process.killAll`)]})})]}),(0,h.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:_.length===0?(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,h.jsx)(a,{className:`h-10 w-10 opacity-15`}),(0,h.jsx)(`p`,{className:`text-sm font-medium`,children:g(`activity:process.emptyTitle`)}),(0,h.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:g(`activity:process.emptyBody`)})]}):(0,h.jsx)(`div`,{className:`divide-y`,children:_.map(e=>{let t=e.status===`running`?Math.floor((Date.now()-e.startedAt)/1e3):null,n=t?t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`:null,i=e.protected===!0;return(0,h.jsxs)(`div`,{className:s(`flex items-center justify-between px-4 py-3 text-xs transition-colors`,e.status===`running`?`bg-background hover:bg-muted/30`:`bg-muted/20 text-muted-foreground`),children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,h.jsx)(`span`,{className:s(`led shrink-0`,e.status===`running`?i?`text-info`:`text-success led-pulse`:`text-muted-foreground`)}),(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:g(`activity:process.pidLabel`,{pid:e.pid})}),(0,h.jsx)(`span`,{className:`font-medium truncate`,children:e.tool}),i&&(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[9px] bg-info/10 text-info font-medium shrink-0`,title:g(`activity:process.protectedTitle`),children:[(0,h.jsx)(o,{className:`h-2.5 w-2.5`}),g(`activity:process.protected`)]})]}),(0,h.jsx)(`code`,{className:`text-[10px] text-muted-foreground/70 truncate block mt-0.5 font-mono`,children:e.command})]})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[n&&(0,h.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:n}),e.status===`running`&&!i&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>C(e.pid),className:`p-1.5 rounded-md hover:bg-destructive/10 hover:text-destructive transition-colors`,title:g(`activity:process.killTitle`,{pid:e.pid}),children:(0,h.jsx)(r,{className:`h-3.5 w-3.5 fill-current`})})]})]},e.pid)})})})]})})}export{g as ProcessMonitor};
|
|
@@ -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{Z as i,ci as a,dt as o,fi as s,li as c,vn as l}from"./vendor-CyLvG8N0.js";import"./i18n-
|
|
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{Z as i,ci as a,dt as o,fi as s,li as c,vn as l}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as u}from"./utils-CU_o9ioU.js";import{_ as d,b as f,g as p,h as m}from"./index-CyTNJHe8.js";var h=e(n(),1),g=r(),_={btw:{label:`btw`,titleKey:`btwTitle`,tone:`bg-primary/10 text-primary border-primary/30`},steer:{label:`steer`,titleKey:`steerTitle`,tone:`bg-warning/10 text-warning border-warning/35`},queue:{label:`queue`,titleKey:`queueTitle`,tone:`bg-info/10 text-info border-info/30`}};function v({open:e,onClose:n,className:r}){let{t:v}=s(),y=t(e=>e.queue),b=t(e=>e.removeQueued),x=t(e=>e.clearQueue),[S,C]=(0,h.useState)(`oldest`),w=(0,h.useCallback)(e=>{b(e)},[b]),T=(0,h.useMemo)(()=>{let e=y.map((e,t)=>({item:e,sourceIdx:t}));return e.sort((e,t)=>S===`newest`?t.item.addedAt-e.item.addedAt:e.item.addedAt-t.item.addedAt),e},[y,S]);return(0,g.jsx)(m,{open:e,onOpenChange:e=>{e||n()},children:(0,g.jsxs)(p,{className:u(`max-w-lg gap-0 overflow-hidden border-border/80 bg-card p-0 pt-[10dvh] flex flex-col max-h-[70dvh]`,r),showCloseButton:!1,children:[(0,g.jsx)(f,{className:`sr-only`,children:v(`activity:queue.heading`)}),(0,g.jsx)(d,{className:`sr-only`,children:v(`activity:queue.subtitle`,{count:y.length})}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/95 px-4 py-3 shrink-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,g.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-md border border-primary/20 bg-primary/10 text-primary`,children:(0,g.jsx)(l,{className:`h-4 w-4`})}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:v(`activity:queue.heading`)}),(0,g.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:v(`activity:queue.subtitle`,{count:y.length})})]})]}),(0,g.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,g.jsxs)(`button`,{type:`button`,onClick:()=>C(e=>e===`newest`?`oldest`:`newest`),className:u(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs transition-colors font-medium`,`text-muted-foreground hover:bg-muted hover:text-foreground`),title:v(S===`newest`?`activity:queue.sortNewestTitle`:`activity:queue.sortOldestTitle`),"data-testid":`queue-sort-toggle`,children:[S===`newest`?(0,g.jsx)(c,{className:`h-3 w-3`}):(0,g.jsx)(a,{className:`h-3 w-3`}),v(S===`newest`?`activity:queue.newest`:`activity:queue.oldest`)]}),y.length>0&&(0,g.jsxs)(`button`,{type:`button`,onClick:()=>x(),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,title:v(`activity:queue.clearTitle`),"data-testid":`queue-clear-all`,children:[(0,g.jsx)(o,{className:`h-3 w-3`}),v(`activity:queue.clear`)]})]})]}),(0,g.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:y.length===0?(0,g.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,g.jsx)(l,{className:`h-10 w-10 opacity-15`}),(0,g.jsx)(`p`,{className:`text-sm font-medium`,children:v(`activity:queue.emptyTitle`)}),(0,g.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:v(`activity:queue.emptyBody`)})]}):(0,g.jsx)(`ul`,{className:`divide-y divide-border/60`,"data-testid":`queue-list`,children:T.map(({item:e,sourceIdx:t},n)=>{let r=_[e.mode];return(0,g.jsxs)(`li`,{className:`flex items-start justify-between gap-3 px-4 py-3 text-xs transition-colors hover:bg-muted/35`,"data-testid":`queue-item`,children:[(0,g.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0 flex-1`,children:[(0,g.jsxs)(`span`,{className:`mt-1 text-[10px] font-mono text-muted-foreground shrink-0 w-5 text-right tabular-nums`,children:[n+1,`.`]}),(0,g.jsx)(`span`,{className:u(`shrink-0 inline-flex items-center justify-center rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,r.tone),title:v(`activity:queue.${r.titleKey}`),"data-testid":`queue-mode-${e.mode}`,children:r.label}),(0,g.jsx)(`p`,{className:`text-sm text-foreground leading-relaxed min-w-0 break-words`,children:e.text.length>120?`${e.text.slice(0,117)}…`:e.text})]}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>w(t),className:`ml-1 p-1.5 rounded-md shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors`,title:v(`activity:queue.removeTitle`),"data-testid":`queue-remove-${t}`,children:(0,g.jsx)(i,{className:`h-3.5 w-3.5`})})]},`${e.addedAt}-${t}`)})})}),y.length>0&&(0,g.jsx)(`div`,{className:`border-t border-border/70 bg-muted/20 px-4 py-2.5 shrink-0`,children:(0,g.jsx)(`p`,{className:`text-[10px] text-muted-foreground text-center`,children:v(`activity:queue.footer`)})})]})})}export{v as QueuePanel};
|
|
@@ -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{At as i,Fr as a,Ft as o,Lr as s,On as c,ai as l,fi as u,rr as d}from"./vendor-CyLvG8N0.js";import"./i18n-
|
|
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{At as i,Fr as a,Ft as o,Lr as s,On as c,ai as l,fi as u,rr as d}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as f}from"./session-store-P-JnaPPK.js";import{n as p}from"./ui-store-ComQYc5F.js";var m=e(n(),1),h=r();function g(){let e=f(e=>e.session),{t:n}=u(),r=f.getState().session?.id,g=f(e=>e.projectName),x=f(e=>e.cwd),S=f(e=>e.mode),C=f(e=>e.contextMode),w=f(e=>e.lastVisitedAt),T=t(e=>e.messages),E=t(e=>e.queue.length),D=t(e=>e.boundSessionId),O=p(e=>e.currentView),k=p(e=>e.dockSection),[A,j]=(0,m.useState)([]),M=(0,m.useMemo)(()=>{if(typeof window>`u`)return 0;let e=0;for(let t of[`wrongstack-session`,`wrongstack-chat`,`wrongstack-ui`,`wrongstack-config`]){let n=window.localStorage.getItem(t);typeof n==`string`&&(e+=n.length)}return e},[T.length]),N=typeof window<`u`&&!!window.__wrongstackSessionRehydrated,P=typeof window<`u`&&!!window.__wrongstackChatRehydrated;function F(e,t){j(n=>[{ts:Date.now(),note:e,ok:t},...n].slice(0,20))}function I(){F(n(`activity:refresh.simulatedF5`),!0)}let L=D!==null&&r!==void 0?D!==r:!1;return(0,h.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,h.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5 sm:space-y-6`,children:[(0,h.jsx)(`header`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-2 text-xl font-bold sm:text-2xl`,children:[(0,h.jsx)(o,{className:`h-6 w-6 shrink-0 text-primary sm:h-7 sm:w-7`}),n(`activity:refresh.heading`)]}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`activity:refresh.subtitle`)})]}),(0,h.jsx)(`button`,{type:`button`,onClick:I,className:`inline-flex h-9 w-full items-center justify-center rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 sm:w-auto`,children:n(`activity:refresh.recordProbe`)})]})}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(a,{className:`w-5 h-5`}),n(`activity:refresh.latestSession`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.restoredLocal`),ok:N,extra:r?n(`activity:refresh.sessionIdExtra`,{id:r}):n(`activity:refresh.noSessionYet`)}),(0,h.jsx)(_,{label:n(`activity:refresh.activePointer`),ok:!!e?.id,extra:e?y(e):`null`}),(0,h.jsx)(_,{label:n(`activity:refresh.lastVisited`),ok:w>0,extra:w>0?new Date(w).toISOString():n(`activity:refresh.never`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(d,{className:`w-5 h-5`}),n(`activity:refresh.persistedEnv`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`projectName`,value:g||`∅`}),(0,h.jsx)(v,{label:`cwd`,value:x||`∅`,mono:!0}),(0,h.jsx)(v,{label:`mode`,value:S,mono:!0}),(0,h.jsx)(v,{label:`contextMode`,value:C,mono:!0})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(c,{className:`w-5 h-5`}),n(`activity:refresh.transcriptRehydrate`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.localTranscript`),ok:P&&(T.length>0||D===null),extra:T.length===0?n(`activity:refresh.noMessages`):n(`activity:refresh.messagesExtra`,{count:T.length,queued:E})}),(0,h.jsx)(_,{label:n(`activity:refresh.noBleed`),ok:!L,extra:L?n(`activity:refresh.bleedExtra`,{bound:D??`∅`,active:r??`∅`}):n(`activity:refresh.transcriptBinds`),warn:L}),T.length>0&&(0,h.jsxs)(`div`,{className:`space-y-1 rounded-lg border border-border/70 bg-card/65 p-3 text-xs font-mono`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`first:`}),` `,b(T[0])]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`last:`}),` `,b(T[T.length-1]??T[0])]})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(i,{className:`w-5 h-5`}),n(`activity:refresh.uiWorkspace`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`currentView`,value:O,mono:!0}),(0,h.jsx)(v,{label:`dockSection`,value:k??n(`activity:refresh.noneValue`),mono:!0})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:refresh.payloadSize`,{count:M})})]}),(0,h.jsxs)(`section`,{className:`space-y-2`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold`,children:n(`activity:refresh.probeLog`)}),A.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:refresh.noProbes`)}):(0,h.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:A.map((e,t)=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.ok?(0,h.jsx)(l,{className:`w-4 h-4 text-success shrink-0`}):(0,h.jsx)(s,{className:`w-4 h-4 text-warning shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,h.jsx)(`span`,{children:e.note})]},`${e.ts}-${t}`))})]})]})})}function _({label:e,extra:t,ok:n,warn:r}){return(0,h.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${r?`border-warning/40 bg-warning/10 text-warning`:n?`border-success/40 bg-success/10 text-success`:`border-border bg-muted/40 text-muted-foreground`}`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium`,children:[n&&!r?(0,h.jsx)(l,{className:`h-4 w-4 shrink-0`}):(0,h.jsx)(s,{className:`h-4 w-4 shrink-0`}),(0,h.jsx)(`span`,{className:`min-w-0 break-words`,children:e})]}),(0,h.jsx)(`div`,{className:`text-xs font-mono mt-1 break-all`,children:t})]})}function v({label:e,value:t,mono:n}){return(0,h.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-card/75 p-3 shadow-sm`,children:[(0,h.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm break-all `+(n?`font-mono`:`font-medium`),children:t})]})}function y(e){let t=e.title?.trim();return t?`${e.id} — "${t}" (${e.provider}/${e.model})`:`${e.id} (${e.provider}/${e.model})`}function b(e){let t=(e.content??``).trim().replace(/\s+/g,` `);return`[${e.role}] ${t.length>100?`${t.slice(0,99)}…`:t}`}export{g as RefreshDebugView};
|
|
@@ -1,2 +1,2 @@
|
|
|
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,It as i,Kt as a,Lr as o,Pn as s,Wr as c,X as l,Xt as u,Z as d,ai as f,br as p,bt as m,ct as h,dt as g,er as ee,fi as _,hi as v,jr as y,ni as b,or as x,ot as S,ur as C,xt as w}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{Fr as r,It as i,Kt as a,Lr as o,Pn as s,Wr as c,X as l,Xt as u,Z as d,ai as f,br as p,bt as m,ct as h,dt as g,er as ee,fi as _,hi as v,jr as y,ni as b,or as x,ot as S,ur as C,xt as w}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as T}from"./utils-CU_o9ioU.js";import{C as E,_ as D,a as te,b as O,g as k,h as A,k as j,m as M,o as N,v as P,y as F}from"./index-CyTNJHe8.js";import{a as I,c as L,i as R,l as ne,n as z,o as B,r as V,s as re,t as H}from"./SddFlowGraph-MVMUCMEy.js";var U=e(t(),1),W=n();function ie({feed:e,now:t}){let{t:n}=_();return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border px-3 py-2 text-xs font-semibold text-foreground`,children:[(0,W.jsx)(r,{className:`h-3.5 w-3.5 text-warning`}),n(`activity:sdd.activityHeading`)]}),(0,W.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-1 overflow-auto p-2`,children:e.length===0?(0,W.jsx)(`p`,{className:`px-1 pt-4 text-center text-[11px] text-muted-foreground`,children:n(`activity:sdd.feedEmpty`)}):e.map((e,n)=>{let r=V[e.kind]??V.started,i=r.icon;return(0,W.jsxs)(`div`,{className:T(`sdd-rise flex items-start gap-2 rounded-md px-2 py-1.5 text-[11px]`,n===0?`bg-muted`:`hover:bg-muted`),children:[(0,W.jsx)(i,{className:T(`mt-0.5 h-3.5 w-3.5 shrink-0`,r.color)}),(0,W.jsx)(`span`,{className:`flex-1 leading-snug text-foreground`,children:e.text}),(0,W.jsx)(`span`,{className:`shrink-0 tabular-nums text-[10px] text-muted-foreground`,children:B(e.ts,t)})]},`${e.ts}-${n}`)})})]})}function G({open:e,onOpenChange:t,snapshot:n,busy:r,onConfirm:i}){let{t:a}=_(),s=n?.mergedCommits?.length??0,l=n?.baseBranch,[u,d]=(0,U.useState)(!1);(0,U.useEffect)(()=>{e&&d(!1)},[e]);let f=n?.status===`running`||n?.status===`paused`,p=(0,U.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.worktreeBranch&&e.add(t.worktreeBranch);return e.size},[n?.tasks]),m=(0,U.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.add(t.agentName);return e.size},[n?.tasks]);return(0,W.jsx)(A,{open:e,onOpenChange:e=>!r&&t(e),children:(0,W.jsxs)(k,{className:`sm:max-w-lg border-destructive/50`,children:[(0,W.jsxs)(F,{children:[(0,W.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,W.jsx)(g,{className:`h-5 w-5 text-destructive`}),a(`activity:sdd.destroyTitle`)]}),(0,W.jsx)(D,{children:a(`activity:sdd.destroyDesc`)})]}),(0,W.jsxs)(`ul`,{className:`space-y-1.5 py-1 text-sm`,children:[f&&(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,W.jsx)(`span`,{children:m>0?a(`activity:sdd.stopRunAgents`,{count:m}):a(`activity:sdd.stopRun`)})]}),(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,W.jsx)(`span`,{children:p>0?a(`activity:sdd.removeWorktreesCount`,{count:p}):a(`activity:sdd.removeWorktreesAll`)})]}),(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,W.jsx)(`span`,{children:a(`activity:sdd.deleteArtifacts`)})]})]}),s>0&&(0,W.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md border border-warning/30 bg-warning/5 p-2.5 text-sm`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked),className:`mt-0.5 h-4 w-4 accent-warning`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`font-medium`,children:a(`activity:sdd.revertMerged`,{count:s})}),` `,`on `,(0,W.jsx)(`code`,{className:`text-xs`,children:l??a(`activity:sdd.baseBranchFallback`)}),(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a(`activity:sdd.revertHint`)})]})]}),(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-muted/50 p-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(o,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-warning`}),a(s>0&&!u?`activity:sdd.noteLeaveMerged`:`activity:sdd.noteAbandon`)]}),(0,W.jsxs)(P,{className:`gap-2 sm:gap-2`,children:[(0,W.jsx)(M,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>t(!1),children:a(`common:action.cancel`)}),(0,W.jsx)(M,{size:`sm`,disabled:r,onClick:()=>i(u),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:r?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(c,{className:`mr-1 h-3.5 w-3.5 animate-spin`}),` `,a(`activity:sdd.destroying`)]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(g,{className:`mr-1 h-3.5 w-3.5`}),` `,a(`activity:sdd.destroyAll`)]})})]})]})})}var K=[{key:`pending`,labelKey:`kanbanBacklog`,accent:`border-border/70`,head:`text-muted-foreground`},{key:`queued`,labelKey:`kanbanReady`,accent:`border-primary/35`,head:`text-primary`},{key:`in_progress`,labelKey:`kanbanRunning`,accent:`border-warning/45`,head:`text-warning`},{key:`review`,labelKey:`kanbanReview`,accent:`border-primary/35`,head:`text-primary`},{key:`failed`,labelKey:`kanbanFailed`,accent:`border-destructive/35`,head:`text-destructive`},{key:`completed`,labelKey:`kanbanDone`,accent:`border-success/35`,head:`text-success`}];function q({tasks:e,selectedId:t,onTaskClick:n}){let{t:r}=_(),i=(0,U.useMemo)(()=>{let t=new Map;for(let e of K)t.set(e.key,[]);for(let n of e){let e=n.displayStatus===`blocked`?`pending`:n.displayStatus===`cancelled`?`failed`:n.displayStatus;(t.get(e)??t.get(`pending`))?.push(n)}return t},[e]);return(0,W.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 gap-3 overflow-x-auto p-4`,children:K.map(e=>{let a=i.get(e.key)??[];return(0,W.jsxs)(`div`,{className:`flex min-h-0 w-64 shrink-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:T(`mb-2 flex items-center gap-2 border-b-2 pb-1.5`,e.accent),children:[(0,W.jsx)(`span`,{className:T(`text-xs font-bold uppercase tracking-wide`,e.head),children:r(`activity:sdd.${e.labelKey}`)}),(0,W.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.length})]}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:[a.map(e=>(0,W.jsx)(J,{task:e,selected:e.id===t,onClick:()=>n(e.id)},e.id)),a.length===0&&(0,W.jsx)(`div`,{className:`rounded-md border border-dashed border-border py-6 text-center text-[10px] text-muted-foreground`,children:r(`activity:sdd.kanbanEmpty`)})]})]},e.key)})})}function J({task:e,selected:t,onClick:n}){let r=e.displayStatus===`in_progress`;return(0,W.jsxs)(`button`,{type:`button`,onClick:n,className:T(`sdd-node-enter w-full rounded-lg border bg-card/85 p-2 text-left shadow-sm transition hover:border-primary/35 hover:bg-accent/35`,t?`border-primary/55 ring-1 ring-primary/35`:`border-border/70`,r&&`sdd-node-running`,e.displayStatus===`completed`&&`sdd-node-complete`,e.displayStatus===`failed`&&`sdd-node-failed`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,W.jsx)(c,{className:`h-3 w-3 animate-spin text-warning`}),e.displayStatus===`completed`&&(0,W.jsx)(p,{className:`h-3 w-3 text-success`}),e.displayStatus===`failed`&&(0,W.jsx)(d,{className:`h-3 w-3 text-destructive`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.shortId}),(0,W.jsx)(`span`,{className:T(`ml-auto rounded px-1.5 text-[9px] font-bold uppercase`,L(e.priority).chip),children:e.priority})]}),(0,W.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:e.title}),(e.agentName||e.worktreeBranch||e.retries)&&(0,W.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[e.agentName&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:T(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,r?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:I(e.agentName)}),(0,W.jsx)(`span`,{className:`max-w-[80px] truncate text-[10px] text-muted-foreground`,children:e.agentName})]}),e.retries?(0,W.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-destructive`,children:[(0,W.jsx)(i,{className:`h-2.5 w-2.5`}),e.retries]}):null,e.worktreeBranch&&(0,W.jsx)(s,{className:`ml-auto h-2.5 w-2.5 text-muted-foreground`})]})]})}function ae({task:e,allTasks:t,feed:n,now:r,modelCandidates:a,defaultModel:o,onClose:c,onRetry:l,onReassign:u,onSetModel:f,onSetVerification:h,onCancel:ee,onDelete:v,onSplit:b,onSelectTask:x}){let{t:E}=_(),D=ne(e.displayStatus),O=D.icon,k=e.displayStatus===`in_progress`,A=e.displayStatus===`pending`||e.displayStatus===`blocked`||e.displayStatus===`queued`,[j,M]=(0,U.useState)(!1),[N,P]=(0,U.useState)(``),[F,R]=(0,U.useState)(null),[z,B]=(0,U.useState)(!1),[V,H]=(0,U.useState)(``),[ie,G]=(0,U.useState)(!1),[K,q]=(0,U.useState)(e.verificationCommand??``),J=()=>{N.trim()&&(u(e.id,N.trim()),M(!1),P(``))},ae=()=>{let t=V.split(`
|
|
2
2
|
`).map(e=>e.trim()).filter(Boolean).map(e=>{let[t,...n]=e.split(`::`),r=(t??``).trim();return{title:r,description:n.join(`::`).trim()||r}}).filter(e=>e.title);t.length&&(b(e.id,t),B(!1),H(``))},se=(0,U.useMemo)(()=>new Map(t.map(e=>[e.shortId,e])),[t]),X=(0,U.useMemo)(()=>t.filter(t=>t.deps.includes(e.shortId)),[t,e.shortId]),Z=(0,U.useMemo)(()=>n.filter(t=>t.taskShortId===e.shortId),[n,e.shortId]),ce=e.startedAt&&!e.completedAt?re(r-e.startedAt):e.startedAt&&e.completedAt?re(e.completedAt-e.startedAt):null;return(0,W.jsxs)(`div`,{className:`sdd-rise flex h-full min-h-0 min-w-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/70 bg-card/70 px-3 py-2`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:c,className:`text-muted-foreground hover:text-foreground`,title:E(`activity:sddTask.backTitle`),children:(0,W.jsx)(y,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,W.jsxs)(`span`,{className:T(`ml-auto flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]`,D.ring,D.text),children:[(0,W.jsx)(O,{className:T(`h-3 w-3`,k&&`animate-spin`)}),D.label]})]}),(0,W.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-3 overflow-auto p-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold leading-snug text-foreground`,children:e.title}),e.agentName&&(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/70 bg-muted/45 p-2`,children:[(0,W.jsx)(`span`,{className:T(`flex h-7 w-7 items-center justify-center rounded-full text-[10px] font-bold text-white`,k?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:I(e.agentName)}),(0,W.jsxs)(`div`,{className:`leading-tight`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:e.agentName}),(0,W.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:E(k?`activity:sddTask.workingOn`:`activity:sddTask.assigned`)})]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5 text-[11px]`,children:[(0,W.jsx)(Y,{label:E(`activity:sddTask.metaPriority`),children:(0,W.jsx)(`span`,{className:T(`font-medium uppercase`,L(e.priority).text),children:e.priority})}),(0,W.jsx)(Y,{label:E(`activity:sddTask.metaType`),children:e.type}),ce&&(0,W.jsx)(Y,{label:e.completedAt?E(`activity:sddTask.metaDuration`):E(`activity:sddTask.metaElapsed`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(C,{className:`h-3 w-3 text-muted-foreground`}),ce]})}),e.retries?(0,W.jsx)(Y,{label:E(`activity:sddTask.metaRetries`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 text-destructive`,children:[(0,W.jsx)(i,{className:`h-3 w-3`}),e.retries]})}):null,e.worktreeBranch&&(0,W.jsx)(Y,{label:E(`activity:sddTask.metaWorktree`),full:!0,children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-foreground`,title:e.worktreeBranch,children:[(0,W.jsx)(s,{className:`h-3 w-3 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`truncate`,children:e.worktreeBranch})]})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[E(`activity:sddTask.workerModel`),!e.model&&o&&(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,E(`activity:sddTask.runDefault`,{model:o})]})]}),(0,W.jsx)(te,{value:e.model,provider:e.provider,candidates:a,placeholder:o?E(`activity:sddTask.runDefaultPlaceholderModel`,{model:o}):E(`activity:sddTask.runDefaultPlaceholder`),onPick:(t,n)=>f(e.id,t,n),onReset:e.model?()=>f(e.id,void 0,void 0):void 0}),e.fallbackModels&&e.fallbackModels.length>0&&(0,W.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.fallbackModels.map((e,t)=>(0,W.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`↳ `,e]},t))})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[E(`activity:sddTask.verificationCmd`),(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,E(`activity:sddTask.gatesCompletion`)]})]}),ie?(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:K,onChange:e=>q(e.target.value),onKeyDown:t=>{t.key===`Enter`?(h(e.id,K.trim()||void 0),G(!1)):t.key===`Escape`&&(q(e.verificationCommand??``),G(!1))},placeholder:E(`activity:sddTask.verifyPlaceholder`),className:`w-full rounded border border-border bg-background px-2 py-1 font-mono text-[11px] text-foreground`}),(0,W.jsxs)(`div`,{className:`flex gap-1`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>{h(e.id,K.trim()||void 0),G(!1)},className:`rounded bg-primary px-2 py-0.5 text-[10px] text-primary-foreground hover:opacity-90`,children:E(`common:action.save`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{q(e.verificationCommand??``),G(!1)},className:`rounded bg-muted px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:E(`common:action.cancel`)})]})]}):e.verificationCommand?(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-foreground`,children:e.verificationCommand}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:E(`common:action.edit`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>h(e.id,void 0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:E(`common:action.clear`)})]}):(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded border border-dashed border-border px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,children:E(`activity:sddTask.addVerify`)})]}),e.description&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:E(`activity:sddTask.description`)}),(0,W.jsx)(`p`,{className:`whitespace-pre-wrap rounded-md bg-muted p-2 text-[11px] leading-relaxed text-foreground`,children:e.description})]}),Z.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:E(`activity:sddTask.timeline`)}),(0,W.jsx)(`div`,{className:`space-y-1 border-l border-border pl-2.5`,children:Z.map((e,t)=>(0,W.jsxs)(`div`,{className:`relative text-[11px] leading-snug text-foreground`,children:[(0,W.jsx)(`span`,{className:T(`absolute -left-[14px] top-1 h-1.5 w-1.5 rounded-full`,e.kind===`completed`?`bg-success`:e.kind===`failed`?`bg-destructive`:e.kind===`retrying`?`bg-warning`:`bg-primary`)}),e.text]},`${e.ts}-${t}`))})]}),e.deps.length>0&&(0,W.jsx)(oe,{title:E(`activity:sddTask.dependsOn`),shortIds:e.deps,byShort:se,onSelectTask:x}),X.length>0&&(0,W.jsx)(oe,{title:E(`activity:sddTask.blocks`),shortIds:X.map(e=>e.shortId),byShort:se,onSelectTask:x})]}),(0,W.jsxs)(`div`,{className:`border-t border-border p-2`,children:[j?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-1.5`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:N,onChange:e=>P(e.target.value),onKeyDown:e=>{e.key===`Enter`&&J(),e.key===`Escape`&&M(!1)},placeholder:E(`activity:sddTask.newWorkerPlaceholder`),className:`min-w-0 flex-1 rounded-md border border-border/70 bg-background px-2 py-1.5 text-xs outline-none focus:border-primary/60`}),(0,W.jsx)(`button`,{type:`button`,onClick:J,disabled:!N.trim(),className:`rounded-md bg-primary/10 px-2 py-1.5 text-xs font-medium text-primary hover:bg-primary/15 disabled:opacity-40`,children:(0,W.jsx)(p,{className:`h-3.5 w-3.5`})}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>M(!1),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]}):F?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`flex-1 text-xs text-foreground`,children:E(F===`stop`?`activity:sddTask.confirmStop`:`activity:sddTask.confirmDelete`)}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>{F===`stop`?ee(e.id):v(e.id),R(null)},className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,W.jsx)(p,{className:`h-3.5 w-3.5`}),` `,E(F===`stop`?`common:action.stop`:`common:action.delete`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>R(null),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]}):(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),title:E(`activity:sddTask.retryTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-warning/12 py-1.5 text-xs font-medium text-warning hover:bg-warning/18`,children:[(0,W.jsx)(i,{className:`h-3.5 w-3.5`}),` `,E(`common:action.retry`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>M(!0),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,W.jsx)(S,{className:`h-3.5 w-3.5`}),` `,E(`activity:sddTask.reassign`)]}),k&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>R(`stop`),title:E(`activity:sddTask.stopTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-destructive/10 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,W.jsx)(m,{className:`h-3.5 w-3.5`}),` `,E(`common:action.stop`)]}),!k&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>B(!0),title:E(`activity:sddTask.splitTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,W.jsx)(w,{className:`h-3.5 w-3.5`}),` `,E(`activity:sddTask.split`)]}),A&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>R(`delete`),title:E(`activity:sddTask.deleteTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-destructive/10 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,W.jsx)(g,{className:`h-3.5 w-3.5`}),` `,E(`common:action.delete`)]})]}),z&&(0,W.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,W.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,htmlFor:`sdd-split-input`,children:E(`activity:sddTask.splitHint`)}),(0,W.jsx)(`textarea`,{id:`sdd-split-input`,autoFocus:!0,rows:3,value:V,onChange:e=>H(e.target.value),placeholder:E(`activity:sddTask.splitPlaceholder`),className:`w-full resize-y rounded-md border border-border/70 bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:ae,className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,W.jsx)(w,{className:`h-3.5 w-3.5`}),` `,E(`activity:sddTask.splitInto`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{B(!1),H(``)},className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]})]})]})]})}function Y({label:e,children:t,full:n}){return(0,W.jsxs)(`div`,{className:T(`rounded-md border border-border bg-muted/50 px-2 py-1`,n&&`col-span-2`),children:[(0,W.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`text-foreground`,children:t})]})}function oe({title:e,shortIds:t,byShort:n,onSelectTask:r}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>{let t=n.get(e);return(0,W.jsxs)(`button`,{type:`button`,disabled:!t,onClick:()=>t&&r(t.id),className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-foreground hover:bg-muted disabled:opacity-50`,title:t?.title,children:[(0,W.jsx)(`span`,{className:T(`h-1.5 w-1.5 rounded-full`,ne(t?.displayStatus??`pending`).dot)}),(0,W.jsx)(`span`,{className:`font-mono`,children:e})]},e)})})]})}function se({pct:e}){let t=2*Math.PI*26,n=t-Math.max(0,Math.min(100,e))/100*t;return(0,W.jsxs)(`div`,{className:`relative h-16 w-16 shrink-0`,children:[(0,W.jsxs)(`svg`,{viewBox:`0 0 64 64`,className:`h-16 w-16 -rotate-90`,children:[(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`hsl(var(--muted))`,strokeWidth:`6`}),(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`url(#sddgrad)`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:t,strokeDashoffset:n,style:{transition:`stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1)`}}),(0,W.jsx)(`defs`,{children:(0,W.jsxs)(`linearGradient`,{id:`sddgrad`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--primary))`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--info))`})]})})]}),(0,W.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm font-bold text-foreground`,children:[Math.round(e),`%`]})]})}function X({onClose:e}){let{t}=_(),{client:n}=E(),s=j(e=>e.snapshot),c=j(e=>e.lifecycleResult),f=j(e=>e.destroying),p=j(e=>e.setDestroying),v=j(e=>e.setLifecycleResult),[y,b]=(0,U.useState)(()=>Date.now()),[S,C]=(0,U.useState)(null),[w,D]=(0,U.useState)(`graph`),[te,O]=(0,U.useState)(!1);(0,U.useEffect)(()=>{n?.send?.({type:`sdd.board.get`})},[n]);let k=s&&(s.status===`running`||s.status===`paused`);(0,U.useEffect)(()=>{if(!k)return;let e=setInterval(()=>b(Date.now()),1e3);return b(Date.now()),()=>clearInterval(e)},[k]);let A=(0,U.useCallback)(e=>n?.send?.(e),[n]),P=(0,U.useRef)(null),F=(0,U.useCallback)(e=>{P.current=null,A({type:`sdd.board.destroy`,payload:{revertMerged:e}})},[A]),L=(0,U.useCallback)(e=>{O(!1),v(null),p(!0),k?(A({type:`sdd.board.stop`,payload:{}}),P.current={revertMerged:e,deadline:Date.now()+2e4}):F(e)},[k,A,F,p,v]);(0,U.useEffect)(()=>{let e=P.current;e&&(!k||Date.now()>=e.deadline)&&F(e.revertMerged)},[k,s,F]);let ne=(0,U.useCallback)(()=>{v(null),A({type:`sdd.board.cleanup_worktrees`,payload:{}})},[A,v]),B=(0,U.useCallback)(()=>{v(null),A({type:`sdd.board.rollback`,payload:{}})},[A,v]),V=(0,U.useMemo)(()=>(s?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch})),[s?.tasks]),K=(0,U.useMemo)(()=>{let e=new Map;for(let t of s?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.set(t.agentName,{name:t.agentName,task:t.title});return[...e.values()]},[s?.tasks]),J=(0,U.useCallback)(e=>C(e),[]),Y=(0,U.useCallback)(e=>A({type:`sdd.board.retry`,payload:{taskId:e}}),[A]),oe=(0,U.useCallback)(()=>A({type:`sdd.board.retry_all_failed`,payload:{}}),[A]),X=(0,U.useCallback)((e,t)=>{let n=t.trim();n&&A({type:`sdd.board.reassign`,payload:{taskId:e,agentName:n}})},[A]),Z=(0,U.useCallback)((e,t,n)=>A({type:`sdd.board.set_task_model`,payload:{taskId:e,model:t,provider:n}}),[A]),le=(0,U.useCallback)((e,t)=>A({type:`sdd.board.set_task_verification`,payload:{taskId:e,verificationCommand:t}}),[A]),ue=(0,U.useCallback)(e=>A({type:`sdd.board.cancel_task`,payload:{taskId:e}}),[A]),de=(0,U.useCallback)(e=>{A({type:`sdd.board.delete_task`,payload:{taskId:e}}),C(null)},[A]),fe=(0,U.useCallback)((e,t)=>{A({type:`sdd.board.split_task`,payload:{taskId:e,subtasks:t}}),C(null)},[A]),pe=N(S!==null),me=(0,U.useMemo)(()=>s?.tasks.find(e=>e.id===S)??null,[s?.tasks,S]),$=s?.progress,he=s?.diagnostics?.deadlockChains??[];return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,W.jsxs)(`header`,{className:`sdd-sheen shrink-0 border-b border-border px-4 pb-3 pt-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(r,{className:`h-5 w-5 text-warning`}),(0,W.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:s?.title??t(`activity:sddBoard.titleFallback`)}),s&&(0,W.jsx)(`span`,{className:T(`rounded-full border px-2 py-0.5 text-[11px] font-medium capitalize`,R[s.status]??R.idle),children:s.status}),s?.defaultModel&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-muted-foreground`,title:t(`activity:sddBoard.defaultModelTitle`),children:[(0,W.jsx)(x,{className:`h-3 w-3 text-primary`}),s.defaultModel]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s&&(0,W.jsx)(`div`,{className:`flex items-center rounded-md border border-border bg-muted p-0.5 text-[11px]`,children:[`graph`,`kanban`].map(e=>(0,W.jsx)(`button`,{type:`button`,onClick:()=>D(e),className:T(`rounded px-2 py-0.5 capitalize transition`,w===e?`bg-primary/12 text-primary`:`text-muted-foreground hover:text-foreground`),children:t(e===`graph`?`activity:sddBoard.graphLabel`:`activity:sddBoard.kanbanLabel`)},e))}),k&&($?.failed??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:oe,title:t(`activity:sddBoard.retryAllTitle`),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,W.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.retryFailed`,{count:$?.failed??0})]}),k&&(0,W.jsxs)(W.Fragment,{children:[s?.status===`paused`?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A({type:`sdd.board.resume`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/25`,children:[(0,W.jsx)(a,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.resume`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A({type:`sdd.board.pause`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,W.jsx)(u,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.pause`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A({type:`sdd.board.stop`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-destructive/15 px-2.5 py-1 text-xs font-medium text-destructive hover:bg-destructive/25`,children:[(0,W.jsx)(m,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.stop`)]})]}),s&&!k&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,onClick:ne,title:t(`activity:sddBoard.cleanTitle`),className:`inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-muted/80`,children:[(0,W.jsx)(ee,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.cleanWorktrees`)]}),(s.mergedCommits?.length??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:B,title:t(`activity:sddBoard.rollbackTitle`,{count:s.mergedCommits?.length??0,base:s.baseBranch??t(`activity:sdd.baseBranchFallback`)}),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,W.jsx)(h,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.rollback`,{count:s.mergedCommits?.length??0})]})]}),s&&(f?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-destructive/15 px-2.5 py-1 text-xs font-medium text-destructive`,children:[(0,W.jsx)(i,{className:`h-3.5 w-3.5 animate-spin`}),` `,t(k?`activity:sddBoard.stopping`:`activity:sddBoard.destroying`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>O(!0),title:t(`activity:sddBoard.destroyTitle`),className:`inline-flex items-center gap-1 rounded-md bg-destructive px-2.5 py-1 text-xs font-medium text-destructive-foreground hover:bg-destructive/90`,children:[(0,W.jsx)(g,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.destroy`)]})),(0,W.jsx)(M,{variant:`ghost`,size:`icon`,onClick:e,children:(0,W.jsx)(d,{className:`h-4 w-4`})})]})]}),s&&$&&(0,W.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-5`,children:[(0,W.jsx)(se,{pct:$.percentComplete}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,W.jsx)(Q,{label:t(`activity:sddBoard.statDone`),value:`${$.completed}/${$.total}`,color:`text-success`}),$.inProgress>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statRunning`),value:$.inProgress,color:`text-warning`}),$.failed>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statFailed`),value:$.failed,color:`text-destructive`}),(0,W.jsx)(Q,{label:t(`activity:sddBoard.statWave`),value:s.wave+1,color:`text-primary`}),k&&s.startedAt>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statElapsed`),value:re(y-s.startedAt),color:`text-foreground`})]}),(0,W.jsx)(`div`,{className:`flex min-h-[24px] items-center gap-1.5`,children:K.length===0?(0,W.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`activity:sddBoard.noActiveWorkers`)}):K.map((e,t)=>(0,W.jsxs)(`span`,{title:`${e.name} → ${e.task}`,className:`flex items-center gap-1 rounded-full bg-muted py-0.5 pl-0.5 pr-2`,children:[(0,W.jsx)(`span`,{className:T(`sdd-agent-live flex h-5 w-5 items-center justify-center rounded-full text-[9px] font-bold text-white`,z[t%z.length]),children:I(e.name)}),(0,W.jsx)(`span`,{className:`max-w-[90px] truncate text-[11px] text-foreground`,children:e.name})]},e.name))})]})]})]}),c&&(0,W.jsx)(ce,{result:c,onDismiss:()=>v(null)}),he.length>0&&(0,W.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/30 bg-destructive/5 px-4 py-2 text-xs text-destructive`,children:[(0,W.jsx)(o,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`font-semibold`,children:t(`activity:sddBoard.deadlock`)}),he.map(e=>(0,W.jsxs)(`div`,{className:`font-mono`,children:[e.blocked,` ← `,e.blockedBy.join(`, `)]},e.blocked))]})]}),(0,W.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:s?w===`graph`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(H,{tasks:V,columns:s.columns,onTaskClick:J}),(0,W.jsx)(`div`,{className:`pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-black/40 px-2 py-0.5 text-[10px] text-muted-foreground backdrop-blur`,children:t(`activity:sddBoard.clickTaskHint`)})]}):(0,W.jsx)(q,{tasks:s.tasks,selectedId:S,onTaskClick:J}):(0,W.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sm text-muted-foreground`,children:[(0,W.jsx)(l,{className:`h-10 w-10 text-primary/40`}),(0,W.jsx)(`p`,{className:`text-foreground`,children:t(`activity:sddBoard.noRunTitle`)}),(0,W.jsx)(`p`,{className:`max-w-sm text-center text-xs text-muted-foreground`,children:t(`activity:sddBoard.noRunBody`)})]})}),s&&(0,W.jsx)(`aside`,{className:`w-80 shrink-0 border-l border-border bg-card`,children:me?(0,W.jsx)(ae,{task:me,allTasks:s.tasks,feed:s.feed??[],now:y,modelCandidates:pe,defaultModel:s.defaultModel,onClose:()=>C(null),onRetry:Y,onReassign:X,onSetModel:Z,onSetVerification:le,onCancel:ue,onDelete:de,onSplit:fe,onSelectTask:C},me.id):(0,W.jsx)(ie,{feed:s.feed??[],now:y})})]}),(0,W.jsx)(G,{open:te,onOpenChange:O,snapshot:s,busy:f,onConfirm:L})]})}function Z(e){let t=e.op===`cleanup_worktrees`?`lcClean`:e.op===`rollback`?`lcRollback`:`lcDestroy`,n=v.t(`activity:sddBoard.${t}`);if(!e.ok)return v.t(`activity:sddBoard.lcFailed`,{op:n,reason:e.reason??v.t(`activity:sddBoard.lcUnknownError`)});let r=[];typeof e.removed==`number`&&r.push(v.t(`activity:sddBoard.lcWorktrees`,{count:e.removed})),typeof e.reverted==`number`&&e.reverted>0&&r.push(v.t(`activity:sddBoard.lcCommits`,{count:e.reverted})),e.deleted?.length&&r.push(v.t(`activity:sddBoard.lcDeleted`,{items:e.deleted.join(`, `)}));let i=r.length?r.join(` · `):v.t(`activity:sddBoard.lcNothing`);return e.reason?v.t(`activity:sddBoard.lcNote`,{op:n,body:i,reason:e.reason}):v.t(`activity:sddBoard.lcOk`,{op:n,body:i})}function ce({result:e,onDismiss:t}){let n=!e.ok||!!e.reason;return(0,W.jsxs)(`div`,{className:T(`flex items-start gap-2 border-b px-4 py-2 text-xs`,n?`border-warning/30 bg-warning/5 text-warning`:`border-success/30 bg-success/5 text-success`),children:[n?(0,W.jsx)(b,{className:`mt-0.5 h-4 w-4 shrink-0`}):(0,W.jsx)(f,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{className:`flex-1`,children:Z(e)}),(0,W.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 opacity-60 hover:opacity-100`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]})}function Q({label:e,value:t,color:n}){return(0,W.jsxs)(`span`,{className:`flex items-baseline gap-1`,children:[(0,W.jsx)(`span`,{className:T(`font-semibold tabular-nums`,n),children:t}),(0,W.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e})]})}export{X as SddBoardView};
|
|
@@ -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{Er as r,Et as i,Gr as a,It as o,Kt as s,Lr as c,Mn as l,Pn as u,Sr as d,Wr as f,Z as p,br as m,fi as h,pr as g,xt as _}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{Er as r,Et as i,Gr as a,It as o,Kt as s,Lr as c,Mn as l,Pn as u,Sr as d,Wr as f,Z as p,br as m,fi as h,pr as g,xt as _}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as v}from"./utils-CU_o9ioU.js";import{a as y,c as b,m as x,n as S,o as C,p as w,r as T,t as E,u as D}from"./xyflow-oYDGUYW6.js";var O=e(t(),1),k={pending:{label:`Pending`,icon:g,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`},queued:{label:`Ready`,icon:g,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--primary))`},in_progress:{label:`Running`,icon:f,spin:!0,text:`text-warning`,ring:`border-warning/45 bg-warning/10`,dot:`bg-warning`,hex:`hsl(var(--warning))`},blocked:{label:`Blocked`,icon:g,text:`text-destructive`,ring:`border-destructive/30 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},review:{label:`Review`,icon:g,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--info))`},failed:{label:`Failed`,icon:p,text:`text-destructive`,ring:`border-destructive/45 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},completed:{label:`Done`,icon:m,text:`text-success`,ring:`border-success/35 bg-success/10`,dot:`bg-success`,hex:`hsl(var(--success))`},cancelled:{label:`Cancelled`,icon:r,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`}};function A(e){return k[e]??k.pending}var j={critical:{text:`text-destructive`,chip:`bg-destructive/10 text-destructive`},high:{text:`text-warning`,chip:`bg-warning/12 text-warning`},medium:{text:`text-primary`,chip:`bg-primary/10 text-primary`},low:{text:`text-muted-foreground`,chip:`bg-muted text-muted-foreground`}};function M(e){return j[e]??j.medium}var N={running:`border-primary/35 bg-primary/10 text-primary`,paused:`border-warning/35 bg-warning/10 text-warning`,stopped:`border-border/70 bg-muted text-muted-foreground`,completed:`border-success/35 bg-success/10 text-success`,failed:`border-destructive/35 bg-destructive/10 text-destructive`,deadlocked:`border-destructive/35 bg-destructive/10 text-destructive`,idle:`border-border bg-muted text-muted-foreground`},P=[`bg-warning`,`bg-primary`,`bg-success`,`bg-destructive`,`bg-secondary`,`bg-muted-foreground`,`bg-accent`],F={started:{icon:s,color:`text-warning`},completed:{icon:m,color:`text-success`},failed:{icon:p,color:`text-destructive`},retrying:{icon:o,color:`text-warning`},wave:{icon:a,color:`text-primary`},deadlock:{icon:c,color:`text-destructive`},verification_failed:{icon:i,color:`text-destructive`},conflict:{icon:l,color:`text-warning`},split:{icon:_,color:`text-primary`},supervisor:{icon:d,color:`text-primary`}};function I(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t[1]?.[0]??``)).toUpperCase()||`·`}function L(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m ${t%60}s`:`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function R(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m`:`${Math.floor(r/60)}h`}var z=n(),B=300,V=128,H=240,U={pending:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`},queued:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},in_progress:{ring:`border-warning/45`,chip:`bg-warning/12 text-warning`,dot:`bg-warning`},blocked:{ring:`border-destructive/30`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},review:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},failed:{ring:`border-destructive/45`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},completed:{ring:`border-success/35`,chip:`bg-success/12 text-success`,dot:`bg-success`},cancelled:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`}};function W({data:e}){let t=e.task,{t:n}=h(),r=U[t.displayStatus],i=t.displayStatus===`in_progress`,a=t.displayStatus===`completed`?m:t.displayStatus===`failed`?p:i?f:g;return(0,z.jsxs)(`div`,{className:v(`sdd-node-enter group relative rounded-lg border bg-card/95 px-2.5 py-2 text-left shadow-lg backdrop-blur`,r.ring,i&&`sdd-node-running`,t.displayStatus===`completed`&&`sdd-node-complete`,t.displayStatus===`failed`&&`sdd-node-failed`,e.onTaskClick&&`cursor-pointer hover:brightness-125`),style:{width:H,animationDelay:`${Math.min(e.index*45,600)}ms`},onClick:()=>e.onTaskClick?.(t.id),role:e.onTaskClick?`button`:void 0,tabIndex:e.onTaskClick?0:void 0,onKeyDown:n=>{e.onTaskClick&&(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e.onTaskClick(t.id))},children:[(0,z.jsx)(y,{type:`target`,position:x.Left,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,z.jsx)(y,{type:`source`,position:x.Right,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(a,{className:v(`h-3.5 w-3.5`,i&&`animate-spin`,r.chip.split(` `).find(e=>e.startsWith(`text`)))}),(0,z.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:t.shortId}),(0,z.jsx)(`span`,{className:v(`font-mono text-[10px] font-bold uppercase`,M(t.priority).text),children:t.priority[0]}),(0,z.jsx)(`span`,{className:v(`ml-auto rounded px-1.5 py-px text-[9px] font-medium`,r.chip),children:n(`activity:sdd.status.${t.displayStatus}`)})]}),(0,z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:t.title}),(t.agentName||t.worktreeBranch)&&(0,z.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.agentName&&(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`span`,{className:v(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,i?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:I(t.agentName)}),(0,z.jsx)(`span`,{className:`max-w-[88px] truncate text-[10px] text-muted-foreground`,children:t.agentName})]}),t.retries?(0,z.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-destructive`,children:[(0,z.jsx)(o,{className:`h-2.5 w-2.5`}),t.retries]}):null,t.worktreeBranch&&(0,z.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 text-[9px] text-muted-foreground`,title:t.worktreeBranch,children:[(0,z.jsx)(u,{className:`h-2.5 w-2.5`}),(0,z.jsx)(`span`,{className:`max-w-[70px] truncate`,children:t.worktreeBranch.replace(/^.*\//,``)})]})]})]})}function G({data:e}){return(0,z.jsx)(`div`,{className:`whitespace-nowrap text-[11px] font-bold uppercase text-muted-foreground`,children:e.label})}var K={task:W,colLabel:G};function q(e,t,n){let r=new Map(e.map(e=>[e.shortId,e])),i=[],a=0;t.forEach((e,t)=>{i.push({id:`__col_${t}`,position:{x:t*B,y:-52},data:{label:e.label},draggable:!1,selectable:!1,type:`colLabel`,style:{pointerEvents:`none`}}),e.taskIds.forEach((e,o)=>{let s=r.get(e);s&&i.push({id:s.id,position:{x:t*B,y:o*V},data:{task:s,index:a++,onTaskClick:n},type:`task`,draggable:!0})})});let o=[];for(let t of e)for(let e of t.deps){let n=r.get(e);if(!n)continue;let i=n.displayStatus===`completed`&&(t.displayStatus===`in_progress`||t.displayStatus===`queued`);o.push({id:`${n.id}->${t.id}`,source:n.id,target:t.id,animated:i,className:i?`sdd-edge-flow`:void 0,style:{stroke:A(t.displayStatus).hex,strokeWidth:i?2.2:1.4,opacity:t.displayStatus===`pending`?.4:.85}})}return{nodes:i,edges:o}}function J({tasks:e,columns:t,onTaskClick:n}){let{fitView:r}=w(),{nodes:i,edges:a}=(0,O.useMemo)(()=>q(e,t,n),[e,t,n]),o=e.length;return(0,O.useEffect)(()=>{let e=setTimeout(()=>r({padding:.18,duration:400}),60);return()=>clearTimeout(e)},[o,r]),(0,z.jsxs)(D,{nodes:i,edges:a,nodeTypes:K,fitView:!0,fitViewOptions:{padding:.18},minZoom:.2,maxZoom:1.6,proOptions:{hideAttribution:!0},nodesConnectable:!1,elementsSelectable:!!n,children:[(0,z.jsx)(E,{variant:S.Dots,gap:22,size:1,color:`hsl(var(--border))`}),(0,z.jsx)(T,{showInteractive:!1,className:`!bottom-2 !left-2`}),(0,z.jsx)(C,{pannable:!0,zoomable:!0,nodeStrokeWidth:2,maskColor:`hsl(var(--background) / 0.65)`,nodeColor:e=>{let t=e.data?.task?.displayStatus;return t?A(t).hex:`hsl(var(--muted-foreground))`},className:`!bottom-2 !right-2 !h-24 !w-40 overflow-hidden rounded-md border border-border/70 bg-card`})]})}function Y({tasks:e,columns:t,onTaskClick:n}){return(0,z.jsx)(b,{children:(0,z.jsx)(J,{tasks:e,columns:t,onTaskClick:n})})}export{I as a,M as c,N as i,A as l,P as n,R as o,F as r,L as s,Y as t};
|
|
@@ -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{Cr as r,Lt as i,St as a,Wr as o,Z as s,br as c,en as ee,fi as l,gr as u,it as d,jt as f,mt as te,yr as p,zr as m}from"./vendor-CyLvG8N0.js";import"./i18n-CkkVJCs9.js";import{t as h}from"./utils-CU_o9ioU.js";import{C as ne,O as g,a as re,i as ie,m as _,o as ae,w as oe}from"./index-BqAVsSCe.js";import{c as se,t as ce}from"./SddFlowGraph-BaWwH9Zc.js";var v=e(t(),1),y=n(),b={idle:`phaseStart`,questioning:`phaseInterview`,spec_review:`phaseSpecReview`,implementation:`phasePlanning`,task_review:`phaseTaskReview`,executing:`phaseRunning`,done:`phaseDone`},x=[`questioning`,`spec_review`,`implementation`,`task_review`,`executing`];function S({onClose:e}){let{t}=l(),{client:n}=ne(),r=g(e=>e.snapshot),d=g(e=>e.agentText),S=g(e=>e.error),T=g(e=>e.startedRunId),E=g(e=>e.setStartedRunId),[D,le]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!1),[M,ue]=(0,v.useState)(!0),[N,P]=(0,v.useState)(!0),[F,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)(void 0),[z,B]=(0,v.useState)(void 0),[V,H]=(0,v.useState)([]),[U,de]=(0,v.useState)(4),[W,fe]=(0,v.useState)(!0),G=ae(F),K=(0,v.useCallback)(e=>n?.send?.(e),[n]),q=(0,v.useRef)(null);(0,v.useEffect)(()=>{K({type:`sdd.spec.get`})},[K]),(0,v.useEffect)(()=>{q.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[r?.answers.length??0,d]),(0,v.useEffect)(()=>{T&&(oe(`sddboard`),E(null))},[T,E]);let J=r?.busy??!1,Y=r?.phase??`idle`,X=!!r;(0,v.useEffect)(()=>{X&&j(!1)},[X]);let pe=r?.answers[r.answers.length-1]?.question??``,me=!!r&&(r.taskCount>0||!!r.graphId||Y===`task_review`||Y===`executing`),Z=()=>{let e=D.trim();!e||J||A||(j(!0),K({type:`sdd.spec.start`,payload:{goal:e}}))},Q=()=>{let e=O.trim();!e||J||(K({type:`sdd.spec.message`,payload:{text:e}}),k(``))},he=()=>!J&&K({type:`sdd.spec.approve`,payload:{}}),ge=()=>{K({type:`sdd.run.start`,payload:{parallelSlots:U,worktrees:W,...L?{model:L,provider:z}:{},...V.length?{fallbackModels:V}:{}}}),I(!1)},$=(0,v.useMemo)(()=>(r?.board?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch,retries:e.retries})),[r?.board]),_e=$.length>0;return(0,y.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,y.jsxs)(`header`,{className:`sdd-sheen flex shrink-0 items-center justify-between border-b border-border px-4 py-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(m,{className:`h-5 w-5 text-primary`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`text-lg font-semibold`,children:r?.title||t(`activity:sddWizard.titleFallback`)}),X&&(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t(`activity:sddWizard.${b[Y]??`phaseStart`}`),Y===`questioning`&&` · ${t(`activity:sddWizard.questionsSuffix`,{cur:r?.questionCount??0,max:r?.maxQuestions??0})}`,r&&r.taskCount>0?` · ${t(`activity:sddWizard.tasksSuffix`,{count:r.taskCount})}`:``]})]}),J&&(0,y.jsx)(o,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[me&&(0,y.jsxs)(`div`,{className:`relative flex items-center gap-1.5`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:t(`activity:sddWizard.runCfgTitle`),className:h(`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium`,L||V.length?`border-primary/40 bg-primary/10 text-primary`:`border-border bg-muted text-muted-foreground hover:text-foreground`),children:[(0,y.jsx)(a,{className:`h-3.5 w-3.5`}),L||t(`activity:sddWizard.modelsLabel`)]}),(0,y.jsxs)(`button`,{type:`button`,onClick:ge,className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/25`,children:[(0,y.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddWizard.startRun`)]}),F&&(0,y.jsxs)(`div`,{className:`sdd-rise absolute right-0 top-9 z-50 w-72 rounded-lg border border-border bg-popover p-3 shadow-xl`,children:[(0,y.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.defaultWorkerModel`)}),(0,y.jsx)(re,{value:L,provider:z,candidates:G,placeholder:t(`activity:sddWizard.leaderDefaultPlaceholder`),resetLabel:t(`activity:sddWizard.useSessionDefault`),onPick:(e,t)=>{R(e),B(t)},onReset:L?()=>{R(void 0),B(void 0)}:void 0}),(0,y.jsx)(`div`,{className:`mb-1 mt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.fallbackChain`)}),(0,y.jsx)(ie,{value:V,candidates:G,onChange:H}),(0,y.jsx)(`p`,{className:`mt-2 text-[10px] text-muted-foreground`,children:t(`activity:sddWizard.appliesToAll`)}),(0,y.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,y.jsx)(`label`,{htmlFor:`sdd-slots`,className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.parallelAgents`)}),(0,y.jsx)(`input`,{id:`sdd-slots`,type:`number`,min:1,max:16,value:U,onChange:e=>{let t=Number.parseInt(e.target.value,10);de(Number.isFinite(t)?Math.min(16,Math.max(1,t)):1)},className:`w-16 rounded-md border border-border bg-background px-2 py-1 text-right text-xs outline-none focus:border-primary`})]}),(0,y.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.isolateWorktrees`)}),(0,y.jsx)(`input`,{type:`checkbox`,checked:W,onChange:e=>fe(e.target.checked),className:`h-3.5 w-3.5 accent-primary`})]}),(0,y.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:t(W?`activity:sddWizard.worktreeOn`:`activity:sddWizard.worktreeOff`)})]})]}),(0,y.jsx)(_,{variant:`ghost`,size:`icon`,onClick:e,children:(0,y.jsx)(s,{className:`h-4 w-4`})})]})]}),X&&(0,y.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 border-b bg-card/50 px-4 py-1.5 text-[11px]`,children:x.map((e,n)=>{let r=e===Y,i=x.indexOf(Y)>n;return(0,y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,y.jsxs)(`span`,{className:h(`rounded-full px-2 py-0.5`,r?`bg-primary/15 text-primary`:i?`text-success`:`text-muted-foreground`),children:[i&&(0,y.jsx)(c,{className:`mr-0.5 inline h-3 w-3`}),t(`activity:sddWizard.${b[e]}`)]}),n<x.length-1&&(0,y.jsx)(`span`,{className:`text-muted-foreground/40`,children:`→`})]},e)})}),(0,y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:[S&&(0,y.jsx)(`div`,{className:`mb-3 rounded-md border border-destructive/40 bg-destructive/5 p-2 text-xs text-destructive`,children:S}),X?(0,y.jsxs)(`div`,{className:`space-y-4`,children:[_e&&(0,y.jsxs)(`div`,{className:`sdd-rise overflow-hidden rounded-lg border border-primary/20 bg-[hsl(var(--surface-2)/0.85)]`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>ue(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-1.5 text-[11px] font-medium text-primary hover:bg-muted/40`,children:[M?(0,y.jsx)(p,{className:`h-3.5 w-3.5`}):(0,y.jsx)(u,{className:`h-3.5 w-3.5`}),(0,y.jsx)(ee,{className:`h-3.5 w-3.5`}),t(`activity:sddWizard.taskGraphSummary`,{count:r?.taskCount??0}),(0,y.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:t(M?`activity:sddWizard.dragToExplore`:`activity:sddWizard.show`)})]}),M&&(0,y.jsx)(`div`,{className:`h-[32dvh] min-h-[200px]`,children:(0,y.jsx)(ce,{tasks:$,columns:r?.board?.columns??[]})})]}),(0,y.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-3`,children:[r?.goal&&(0,y.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2`,children:[(0,y.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,y.jsx)(te,{className:`h-3 w-3`}),` `,t(`activity:sddWizard.goalLabel`)]}),(0,y.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:r.goal})]}),r?.answers.length||d&&Y===`questioning`||J?(0,y.jsxs)(`div`,{className:`space-y-2.5`,children:[r?.answers.map((e,t)=>(0,y.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,y.jsx)(w,{role:`assistant`,text:e.question}),(0,y.jsx)(w,{role:`user`,text:e.answer})]},t)),d&&Y===`questioning`&&d!==pe&&(0,y.jsx)(w,{role:`assistant`,text:d}),J&&(0,y.jsx)(w,{role:`assistant`,text:``,thinking:!0})]}):null,r?.spec&&(0,y.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card p-3`,children:[(0,y.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-sm font-semibold`,children:[(0,y.jsx)(m,{className:`h-3.5 w-3.5 text-primary`}),r.spec.title]}),(0,y.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:r.spec.overview}),(0,y.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:r.spec.requirements.map((e,t)=>(0,y.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,y.jsx)(`span`,{className:h(`shrink-0 font-mono uppercase`,se(e.priority).text),children:e.priority[0]}),(0,y.jsx)(`span`,{children:e.description})]},t))})]}),d&&(Y===`implementation`||Y===`task_review`)&&(0,y.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>P(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-2 text-sm font-semibold hover:bg-muted/40`,children:[N?(0,y.jsx)(p,{className:`h-3.5 w-3.5`}):(0,y.jsx)(u,{className:`h-3.5 w-3.5`}),(0,y.jsx)(m,{className:`h-3.5 w-3.5 text-primary`}),` `,t(`activity:sddWizard.implementationPlan`)]}),N&&(0,y.jsx)(`div`,{className:`max-h-[40dvh] overflow-auto px-3 py-2`,children:(0,y.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:C(d)})})]}),d&&Y!==`questioning`&&Y!==`implementation`&&Y!==`task_review`&&!r?.spec&&(0,y.jsx)(w,{role:`assistant`,text:d}),(Y===`spec_review`||Y===`implementation`||Y===`task_review`)&&(0,y.jsxs)(_,{variant:`secondary`,onClick:he,disabled:J,children:[(0,y.jsx)(c,{className:`mr-1.5 h-4 w-4`}),t(Y===`spec_review`?`activity:sddWizard.approveSpec`:Y===`task_review`?`activity:sddWizard.approveTasks`:`activity:sddWizard.approvePlan`)]}),(0,y.jsx)(`div`,{ref:q})]})]}):(0,y.jsxs)(`div`,{className:`mx-auto mt-8 max-w-xl`,children:[(0,y.jsx)(`label`,{className:`mb-2 block text-sm font-medium`,htmlFor:`sdd-goal`,children:t(`activity:sddWizard.goalPrompt`)}),(0,y.jsx)(`textarea`,{id:`sdd-goal`,value:D,onChange:e=>le(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&Z()},rows:4,placeholder:t(`activity:sddWizard.goalPlaceholder`),className:`w-full resize-none rounded-md border border-border bg-card px-3 py-2 text-sm outline-none focus:border-primary`}),(0,y.jsx)(_,{className:`mt-3`,onClick:Z,disabled:!D.trim()||A,children:A?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{className:`mr-1.5 h-4 w-4 animate-spin`}),` `,t(`activity:sddWizard.startingInterview`)]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(m,{className:`mr-1.5 h-4 w-4`}),` `,t(`activity:sddWizard.startInterview`)]})}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:t(`activity:sddWizard.introBody`)})]})]}),X&&Y!==`executing`&&Y!==`done`&&(0,y.jsxs)(`div`,{className:`flex shrink-0 items-end gap-2 border-t bg-card px-4 py-2`,children:[(0,y.jsx)(`textarea`,{value:O,onChange:e=>k(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Q())},rows:1,placeholder:t(Y===`questioning`?`activity:sddWizard.answerPlaceholder`:`activity:sddWizard.changePlaceholder`),disabled:J,className:`max-h-32 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary disabled:opacity-50`}),(0,y.jsx)(_,{size:`icon`,onClick:Q,disabled:J||!O.trim(),children:(0,y.jsx)(f,{className:`h-4 w-4`})})]})]})}function C(e){let t=e.replace(/```json[\s\S]*?```/gi,``).trim();return t.length>0?t:e.trim()}function w({role:e,text:t,live:n,thinking:i}){let a=e===`user`;return(0,y.jsxs)(`div`,{className:h(`sdd-rise flex items-start gap-2`,a&&`flex-row-reverse`),children:[(0,y.jsx)(`span`,{className:h(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full`,a?`bg-info/15 text-info`:`bg-primary/15 text-primary`,(n||i)&&`sdd-agent-live`),children:a?(0,y.jsx)(d,{className:`h-3.5 w-3.5`}):(0,y.jsx)(r,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(`div`,{className:h(`max-w-[80%] whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed text-foreground`,a?`rounded-tr-sm bg-info/10`:`rounded-tl-sm bg-muted`),children:i?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 py-0.5`,children:[(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-200ms]`}),(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-100ms]`}),(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground`})]}):t})]})}export{S as SddWizard};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Cr as r,Lt as i,St as a,Wr as o,Z as s,br as c,en as ee,fi as l,gr as u,it as d,jt as f,mt as te,yr as p,zr as m}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as h}from"./utils-CU_o9ioU.js";import{C as ne,O as g,a as re,i as ie,m as _,o as ae,w as oe}from"./index-CyTNJHe8.js";import{c as se,t as ce}from"./SddFlowGraph-MVMUCMEy.js";var v=e(t(),1),y=n(),b={idle:`phaseStart`,questioning:`phaseInterview`,spec_review:`phaseSpecReview`,implementation:`phasePlanning`,task_review:`phaseTaskReview`,executing:`phaseRunning`,done:`phaseDone`},x=[`questioning`,`spec_review`,`implementation`,`task_review`,`executing`];function S({onClose:e}){let{t}=l(),{client:n}=ne(),r=g(e=>e.snapshot),d=g(e=>e.agentText),S=g(e=>e.error),T=g(e=>e.startedRunId),E=g(e=>e.setStartedRunId),[D,le]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!1),[M,ue]=(0,v.useState)(!0),[N,P]=(0,v.useState)(!0),[F,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)(void 0),[z,B]=(0,v.useState)(void 0),[V,H]=(0,v.useState)([]),[U,de]=(0,v.useState)(4),[W,fe]=(0,v.useState)(!0),G=ae(F),K=(0,v.useCallback)(e=>n?.send?.(e),[n]),q=(0,v.useRef)(null);(0,v.useEffect)(()=>{K({type:`sdd.spec.get`})},[K]),(0,v.useEffect)(()=>{q.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[r?.answers.length??0,d]),(0,v.useEffect)(()=>{T&&(oe(`sddboard`),E(null))},[T,E]);let J=r?.busy??!1,Y=r?.phase??`idle`,X=!!r;(0,v.useEffect)(()=>{X&&j(!1)},[X]);let pe=r?.answers[r.answers.length-1]?.question??``,me=!!r&&(r.taskCount>0||!!r.graphId||Y===`task_review`||Y===`executing`),Z=()=>{let e=D.trim();!e||J||A||(j(!0),K({type:`sdd.spec.start`,payload:{goal:e}}))},Q=()=>{let e=O.trim();!e||J||(K({type:`sdd.spec.message`,payload:{text:e}}),k(``))},he=()=>!J&&K({type:`sdd.spec.approve`,payload:{}}),ge=()=>{K({type:`sdd.run.start`,payload:{parallelSlots:U,worktrees:W,...L?{model:L,provider:z}:{},...V.length?{fallbackModels:V}:{}}}),I(!1)},$=(0,v.useMemo)(()=>(r?.board?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch,retries:e.retries})),[r?.board]),_e=$.length>0;return(0,y.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,y.jsxs)(`header`,{className:`sdd-sheen flex shrink-0 items-center justify-between border-b border-border px-4 py-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(m,{className:`h-5 w-5 text-primary`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`text-lg font-semibold`,children:r?.title||t(`activity:sddWizard.titleFallback`)}),X&&(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t(`activity:sddWizard.${b[Y]??`phaseStart`}`),Y===`questioning`&&` · ${t(`activity:sddWizard.questionsSuffix`,{cur:r?.questionCount??0,max:r?.maxQuestions??0})}`,r&&r.taskCount>0?` · ${t(`activity:sddWizard.tasksSuffix`,{count:r.taskCount})}`:``]})]}),J&&(0,y.jsx)(o,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[me&&(0,y.jsxs)(`div`,{className:`relative flex items-center gap-1.5`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:t(`activity:sddWizard.runCfgTitle`),className:h(`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium`,L||V.length?`border-primary/40 bg-primary/10 text-primary`:`border-border bg-muted text-muted-foreground hover:text-foreground`),children:[(0,y.jsx)(a,{className:`h-3.5 w-3.5`}),L||t(`activity:sddWizard.modelsLabel`)]}),(0,y.jsxs)(`button`,{type:`button`,onClick:ge,className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/25`,children:[(0,y.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddWizard.startRun`)]}),F&&(0,y.jsxs)(`div`,{className:`sdd-rise absolute right-0 top-9 z-50 w-72 rounded-lg border border-border bg-popover p-3 shadow-xl`,children:[(0,y.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.defaultWorkerModel`)}),(0,y.jsx)(re,{value:L,provider:z,candidates:G,placeholder:t(`activity:sddWizard.leaderDefaultPlaceholder`),resetLabel:t(`activity:sddWizard.useSessionDefault`),onPick:(e,t)=>{R(e),B(t)},onReset:L?()=>{R(void 0),B(void 0)}:void 0}),(0,y.jsx)(`div`,{className:`mb-1 mt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.fallbackChain`)}),(0,y.jsx)(ie,{value:V,candidates:G,onChange:H}),(0,y.jsx)(`p`,{className:`mt-2 text-[10px] text-muted-foreground`,children:t(`activity:sddWizard.appliesToAll`)}),(0,y.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,y.jsx)(`label`,{htmlFor:`sdd-slots`,className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.parallelAgents`)}),(0,y.jsx)(`input`,{id:`sdd-slots`,type:`number`,min:1,max:16,value:U,onChange:e=>{let t=Number.parseInt(e.target.value,10);de(Number.isFinite(t)?Math.min(16,Math.max(1,t)):1)},className:`w-16 rounded-md border border-border bg-background px-2 py-1 text-right text-xs outline-none focus:border-primary`})]}),(0,y.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.isolateWorktrees`)}),(0,y.jsx)(`input`,{type:`checkbox`,checked:W,onChange:e=>fe(e.target.checked),className:`h-3.5 w-3.5 accent-primary`})]}),(0,y.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:t(W?`activity:sddWizard.worktreeOn`:`activity:sddWizard.worktreeOff`)})]})]}),(0,y.jsx)(_,{variant:`ghost`,size:`icon`,onClick:e,children:(0,y.jsx)(s,{className:`h-4 w-4`})})]})]}),X&&(0,y.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 border-b bg-card/50 px-4 py-1.5 text-[11px]`,children:x.map((e,n)=>{let r=e===Y,i=x.indexOf(Y)>n;return(0,y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,y.jsxs)(`span`,{className:h(`rounded-full px-2 py-0.5`,r?`bg-primary/15 text-primary`:i?`text-success`:`text-muted-foreground`),children:[i&&(0,y.jsx)(c,{className:`mr-0.5 inline h-3 w-3`}),t(`activity:sddWizard.${b[e]}`)]}),n<x.length-1&&(0,y.jsx)(`span`,{className:`text-muted-foreground/40`,children:`→`})]},e)})}),(0,y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:[S&&(0,y.jsx)(`div`,{className:`mb-3 rounded-md border border-destructive/40 bg-destructive/5 p-2 text-xs text-destructive`,children:S}),X?(0,y.jsxs)(`div`,{className:`space-y-4`,children:[_e&&(0,y.jsxs)(`div`,{className:`sdd-rise overflow-hidden rounded-lg border border-primary/20 bg-[hsl(var(--surface-2)/0.85)]`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>ue(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-1.5 text-[11px] font-medium text-primary hover:bg-muted/40`,children:[M?(0,y.jsx)(p,{className:`h-3.5 w-3.5`}):(0,y.jsx)(u,{className:`h-3.5 w-3.5`}),(0,y.jsx)(ee,{className:`h-3.5 w-3.5`}),t(`activity:sddWizard.taskGraphSummary`,{count:r?.taskCount??0}),(0,y.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:t(M?`activity:sddWizard.dragToExplore`:`activity:sddWizard.show`)})]}),M&&(0,y.jsx)(`div`,{className:`h-[32dvh] min-h-[200px]`,children:(0,y.jsx)(ce,{tasks:$,columns:r?.board?.columns??[]})})]}),(0,y.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-3`,children:[r?.goal&&(0,y.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2`,children:[(0,y.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,y.jsx)(te,{className:`h-3 w-3`}),` `,t(`activity:sddWizard.goalLabel`)]}),(0,y.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:r.goal})]}),r?.answers.length||d&&Y===`questioning`||J?(0,y.jsxs)(`div`,{className:`space-y-2.5`,children:[r?.answers.map((e,t)=>(0,y.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,y.jsx)(w,{role:`assistant`,text:e.question}),(0,y.jsx)(w,{role:`user`,text:e.answer})]},t)),d&&Y===`questioning`&&d!==pe&&(0,y.jsx)(w,{role:`assistant`,text:d}),J&&(0,y.jsx)(w,{role:`assistant`,text:``,thinking:!0})]}):null,r?.spec&&(0,y.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card p-3`,children:[(0,y.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-sm font-semibold`,children:[(0,y.jsx)(m,{className:`h-3.5 w-3.5 text-primary`}),r.spec.title]}),(0,y.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:r.spec.overview}),(0,y.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:r.spec.requirements.map((e,t)=>(0,y.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,y.jsx)(`span`,{className:h(`shrink-0 font-mono uppercase`,se(e.priority).text),children:e.priority[0]}),(0,y.jsx)(`span`,{children:e.description})]},t))})]}),d&&(Y===`implementation`||Y===`task_review`)&&(0,y.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>P(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-2 text-sm font-semibold hover:bg-muted/40`,children:[N?(0,y.jsx)(p,{className:`h-3.5 w-3.5`}):(0,y.jsx)(u,{className:`h-3.5 w-3.5`}),(0,y.jsx)(m,{className:`h-3.5 w-3.5 text-primary`}),` `,t(`activity:sddWizard.implementationPlan`)]}),N&&(0,y.jsx)(`div`,{className:`max-h-[40dvh] overflow-auto px-3 py-2`,children:(0,y.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:C(d)})})]}),d&&Y!==`questioning`&&Y!==`implementation`&&Y!==`task_review`&&!r?.spec&&(0,y.jsx)(w,{role:`assistant`,text:d}),(Y===`spec_review`||Y===`implementation`||Y===`task_review`)&&(0,y.jsxs)(_,{variant:`secondary`,onClick:he,disabled:J,children:[(0,y.jsx)(c,{className:`mr-1.5 h-4 w-4`}),t(Y===`spec_review`?`activity:sddWizard.approveSpec`:Y===`task_review`?`activity:sddWizard.approveTasks`:`activity:sddWizard.approvePlan`)]}),(0,y.jsx)(`div`,{ref:q})]})]}):(0,y.jsxs)(`div`,{className:`mx-auto mt-8 max-w-xl`,children:[(0,y.jsx)(`label`,{className:`mb-2 block text-sm font-medium`,htmlFor:`sdd-goal`,children:t(`activity:sddWizard.goalPrompt`)}),(0,y.jsx)(`textarea`,{id:`sdd-goal`,value:D,onChange:e=>le(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&Z()},rows:4,placeholder:t(`activity:sddWizard.goalPlaceholder`),className:`w-full resize-none rounded-md border border-border bg-card px-3 py-2 text-sm outline-none focus:border-primary`}),(0,y.jsx)(_,{className:`mt-3`,onClick:Z,disabled:!D.trim()||A,children:A?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{className:`mr-1.5 h-4 w-4 animate-spin`}),` `,t(`activity:sddWizard.startingInterview`)]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(m,{className:`mr-1.5 h-4 w-4`}),` `,t(`activity:sddWizard.startInterview`)]})}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:t(`activity:sddWizard.introBody`)})]})]}),X&&Y!==`executing`&&Y!==`done`&&(0,y.jsxs)(`div`,{className:`flex shrink-0 items-end gap-2 border-t bg-card px-4 py-2`,children:[(0,y.jsx)(`textarea`,{value:O,onChange:e=>k(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Q())},rows:1,placeholder:t(Y===`questioning`?`activity:sddWizard.answerPlaceholder`:`activity:sddWizard.changePlaceholder`),disabled:J,className:`max-h-32 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary disabled:opacity-50`}),(0,y.jsx)(_,{size:`icon`,onClick:Q,disabled:J||!O.trim(),children:(0,y.jsx)(f,{className:`h-4 w-4`})})]})]})}function C(e){let t=e.replace(/```json[\s\S]*?```/gi,``).trim();return t.length>0?t:e.trim()}function w({role:e,text:t,live:n,thinking:i}){let a=e===`user`;return(0,y.jsxs)(`div`,{className:h(`sdd-rise flex items-start gap-2`,a&&`flex-row-reverse`),children:[(0,y.jsx)(`span`,{className:h(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full`,a?`bg-info/15 text-info`:`bg-primary/15 text-primary`,(n||i)&&`sdd-agent-live`),children:a?(0,y.jsx)(d,{className:`h-3.5 w-3.5`}):(0,y.jsx)(r,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(`div`,{className:h(`max-w-[80%] whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed text-foreground`,a?`rounded-tr-sm bg-info/10`:`rounded-tl-sm bg-muted`),children:i?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 py-0.5`,children:[(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-200ms]`}),(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-100ms]`}),(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground`})]}):t})]})}export{S as SddWizard};
|
|
@@ -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{$ as r,Fr as i,Hn as a,Vt as o,Wr as s,ai as c,et as l,fi as u,hi as d,ii as f,oi as p,or as m,ur as h}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as g}from"./utils-CU_o9ioU.js";var _=e(t(),1),v=n();async function y(e){try{let t=await e.clone().json(),n=typeof t.error==`string`?t.error:t.message;if(typeof n==`string`&&n.trim())return n}catch{try{let t=await e.text();if(t.trim())return t.trim()}catch{}}return e.statusText||`HTTP ${e.status}`}function b(e){switch(e){case`running`:return{icon:(0,v.jsx)(i,{className:`h-3.5 w-3.5`}),cls:`text-success`};case`streaming`:return{icon:(0,v.jsx)(o,{className:`h-3.5 w-3.5`}),cls:`text-primary`};case`waiting_user`:return{icon:(0,v.jsx)(h,{className:`h-3.5 w-3.5`}),cls:`text-warning`};case`error`:return{icon:(0,v.jsx)(p,{className:`h-3.5 w-3.5`}),cls:`text-destructive`};case`idle`:return{icon:(0,v.jsx)(f,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`};default:return{icon:(0,v.jsx)(c,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`}}}function x(e){switch(e){case`active`:return{icon:(0,v.jsx)(r,{className:`h-3.5 w-3.5`}),cls:`text-success`,badge:`border-success/25 bg-success/8 text-success`};case`idle`:return{icon:(0,v.jsx)(l,{className:`h-3.5 w-3.5`}),cls:`text-primary`,badge:`border-primary/25 bg-primary/10 text-primary`};case`closing`:return{icon:(0,v.jsx)(h,{className:`h-3.5 w-3.5`}),cls:`text-warning`,badge:`border-warning/25 bg-warning/10 text-warning`};case`lost`:return{icon:(0,v.jsx)(l,{className:`h-3.5 w-3.5`}),cls:`text-destructive/60`,badge:`border-destructive/15 bg-destructive/5 text-destructive/70`};default:return{icon:(0,v.jsx)(l,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`,badge:`border-border bg-muted text-muted-foreground`}}}function S(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`<1m`;if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function C(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<10)return d.t(`common:time.justNow`);if(n<60)return d.t(`common:time.secondsAgo`,{count:n});let r=Math.floor(n/60);return r<60?d.t(`common:time.minutesAgo`,{count:r}):d.t(`common:time.hoursAgo`,{count:Math.floor(r/60)})}function w(){let{t:e}=u(),[t,n]=(0,_.useState)([]),[i,o]=(0,_.useState)(!0),[c,d]=(0,_.useState)(null),f=(0,_.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);if(!e.ok){if(e.status===404){d(null),n([]);return}throw Error(`HTTP ${e.status}: ${await y(e)}`)}if(!(e.headers.get(`content-type`)?.toLowerCase()??``).includes(`application/json`)){d(null),n([]);return}let t=await e.json();if(!Array.isArray(t)){d(null),n([]);return}n(e=>{let n=t;if(e.length===n.length){let t=!0;for(let r=0;r<n.length;r++){let i=n[r],a=e[r];if(i.sessionId!==a.sessionId||i.status!==a.status||i.agentCount!==a.agentCount||i.startedAt!==a.startedAt){t=!1;break}}if(t)return e}return n}),d(null)}catch(e){if(e instanceof SyntaxError){d(null),n([]);return}d(e instanceof Error?e.message:String(e))}finally{o(!1)}},[]);(0,_.useEffect)(()=>{f();let e=setInterval(f,5e3);return()=>clearInterval(e)},[f]);let w=t.filter(e=>e.status===`active`).length,T=t.reduce((e,t)=>e+t.agentCount,0);return i?(0,v.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,v.jsxs)(`div`,{className:`ws-surface flex items-center gap-2 rounded-xl px-4 py-3 text-sm text-muted-foreground`,children:[(0,v.jsx)(s,{className:`h-4 w-4 animate-spin text-primary`}),e(`activity:liveSessions.loading`)]})}):c?(0,v.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,v.jsxs)(`div`,{className:`ws-surface max-w-lg rounded-xl p-5 text-center`,children:[(0,v.jsx)(p,{className:`mx-auto h-8 w-8 text-warning`}),(0,v.jsx)(`p`,{className:`mt-3 text-sm font-medium`,children:e(`activity:liveSessions.apiUnavailable`)}),(0,v.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:c})]})}):t.length===0?(0,v.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,v.jsxs)(`div`,{className:`ws-surface max-w-md rounded-xl p-6 text-center text-muted-foreground`,children:[(0,v.jsx)(l,{className:`mx-auto h-9 w-9 opacity-50`}),(0,v.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:e(`activity:liveSessions.empty`)}),(0,v.jsx)(`p`,{className:`mt-1 text-xs`,children:e(`activity:liveSessions.autoRefresh`)})]})}):(0,v.jsx)(`div`,{className:`h-full min-h-0 overflow-y-auto bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,v.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4`,children:[(0,v.jsx)(`header`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,v.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(r,{className:`h-4 w-4 text-primary`}),(0,v.jsx)(`h2`,{className:`text-base font-semibold`,children:e(`activity:liveSessions.heading`,{count:t.length})})]}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:liveSessions.autoRefresh`)})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 text-center sm:min-w-[22rem]`,children:[(0,v.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/60 px-3 py-2`,children:[(0,v.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:t.length}),(0,v.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:`Sessions`})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/60 px-3 py-2`,children:[(0,v.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-success`,children:w}),(0,v.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:`Active`})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/60 px-3 py-2`,children:[(0,v.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:T}),(0,v.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:`Agents`})]})]})]})}),(0,v.jsx)(`div`,{className:`grid gap-3`,children:t.map(t=>{let n=x(t.status);return(0,v.jsxs)(`article`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm sm:p-4`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,v.jsx)(`span`,{className:n.cls,children:n.icon}),(0,v.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold`,title:t.projectName,children:t.projectName}),(0,v.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:t.projectSlug}),(0,v.jsx)(`span`,{className:`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase ${n.badge}`,children:t.status})]}),(0,v.jsxs)(`div`,{className:`mt-2 grid gap-1.5 text-xs text-muted-foreground md:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,v.jsx)(m,{className:`h-3.5 w-3.5 shrink-0`}),(0,v.jsx)(`span`,{className:`min-w-0 truncate font-mono`,title:t.workingDir,children:t.workingDir})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t.gitBranch?(0,v.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1 text-primary`,children:[(0,v.jsx)(a,{className:`h-3.5 w-3.5 shrink-0`}),(0,v.jsx)(`span`,{className:`truncate font-mono`,children:t.gitBranch})]}):null,(0,v.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,v.jsx)(h,{className:`h-3.5 w-3.5`}),S(t.startedAt)]}),(0,v.jsx)(`span`,{className:`font-mono`,children:e(`activity:liveSessions.pidLabel`,{pid:t.pid})})]})]})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs sm:grid-cols-3 lg:w-64`,children:[(0,v.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,v.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Agents`}),(0,v.jsx)(`div`,{className:`font-semibold tabular-nums`,children:t.agentCount})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,v.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Status`}),(0,v.jsx)(`div`,{className:`truncate font-mono font-semibold`,children:t.status})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,v.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Runtime`}),(0,v.jsx)(`div`,{className:`font-mono font-semibold`,children:S(t.startedAt)})]})]})]}),(0,v.jsxs)(`div`,{className:`mt-3 overflow-hidden rounded-lg border border-border/70 bg-background/45`,children:[t.agents.length===0?(0,v.jsx)(`div`,{className:`px-3 py-3 text-xs text-muted-foreground`,children:e(`activity:liveSessions.noAgents`)}):(0,v.jsx)(`div`,{className:`divide-y divide-border/60`,children:t.agents.slice(0,5).map(t=>{let n=b(t.status);return(0,v.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1 px-3 py-2 text-xs sm:grid-cols-[auto_minmax(0,1fr)_minmax(0,14rem)_auto]`,children:[(0,v.jsx)(`span`,{className:g(`mt-0.5 shrink-0`,n.cls),children:n.icon}),(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`div`,{className:`truncate font-medium`,title:t.name,children:t.name}),(0,v.jsx)(`div`,{className:`font-mono text-[10px] text-muted-foreground`,children:e(`activity:liveSessions.agentMeta`,{iter:t.iterations,tools:t.toolCalls,ago:C(t.lastActivityAt)})})]}),(0,v.jsx)(`div`,{className:`min-w-0 font-mono text-[10px] text-muted-foreground sm:text-xs`,children:t.currentTool?(0,v.jsx)(`span`,{className:`block truncate`,title:t.currentTool,children:t.currentTool}):(0,v.jsx)(`span`,{className:`text-muted-foreground/60`,children:t.status})}),(0,v.jsx)(`span`,{className:`hidden font-mono text-[10px] text-muted-foreground sm:block`,children:C(t.lastActivityAt)})]},t.id)})}),t.agents.length>5?(0,v.jsx)(`div`,{className:`border-t border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:e(`activity:liveSessions.andMore`,{count:t.agents.length-5})}):null]})]},t.sessionId)})})]})})}export{w as SessionsDashboard};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{c as t,m as n,o as r,p as i}from"./markdown-D0X23O-i.js";import{Bn as ee,Bt as te,Kn as ne,Or as a,Wr as o,Yt as re,Z as ie,Zt as ae,br as oe,cr as se,dt as s,fi as c,gr as l,hi as u,jn as ce,t as le,tr as ue,vr as de,wr as fe,zr as pe}from"./vendor-CyLvG8N0.js";import"./i18n-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{c as t,m as n,o as r,p as i}from"./markdown-D0X23O-i.js";import{Bn as ee,Bt as te,Kn as ne,Or as a,Wr as o,Yt as re,Z as ie,Zt as ae,br as oe,cr as se,dt as s,fi as c,gr as l,hi as u,jn as ce,t as le,tr as ue,vr as de,wr as fe,zr as pe}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{n as me}from"./ui-store-ComQYc5F.js";import{t as d}from"./utils-CU_o9ioU.js";import{C as he,T as ge,d as f}from"./index-CyTNJHe8.js";var p=e(n(),1),m=i();function h(e){return e===`project`||e===`user`}function g(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function _e({source:e}){let{t}=c(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,m.jsx)(`span`,{className:d(`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`border-success/25 bg-success/8 text-success`,n===`user`&&`border-primary/25 bg-primary/10 text-primary`,n===`bundled`&&`border-border/70 bg-muted/60 text-muted-foreground`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function _({className:e}){let{t:n}=c(),{client:i}=he(),_=me(e=>e.skillsState),v=me(e=>e.setSkillsState),y=_.selectedSkill,b=_.navHistory,x=_.historyIndex,[S,C]=(0,p.useState)(null),[ve,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(null),[D,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(``),[j,M]=(0,p.useState)(!1),[N,P]=(0,p.useState)(null),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(null),[z,B]=(0,p.useState)(!1),V=(0,p.useRef)(``),[H,ye]=(0,p.useState)(!1),[U,W]=(0,p.useState)(null),[be,xe]=(0,p.useState)(!1),[G,K]=(0,p.useState)(null),[q,Se]=(0,p.useState)(!1);(0,p.useEffect)(()=>{if(!G)return;let e=e=>{e.key===`Escape`&&K(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[G]);let[Ce,we]=(0,p.useState)([]),J=(0,p.useRef)(_);J.current=_;let Y=(0,p.useRef)(!1),X=(0,p.useMemo)(()=>k?{lines:k.split(`
|
|
2
2
|
`).length,words:k.trim()?k.trim().split(/\s+/).length:0,chars:k.length}:{lines:0,words:0,chars:0},[k]),Z=(0,p.useMemo)(()=>{if(!k)return null;let e=5*1024*1024,t=new Blob([k]).size;return t>=e?{level:`critical`,used:t,limit:e}:t>=4194304?{level:`warn`,used:t,limit:e}:null},[k]);(0,p.useEffect)(()=>{if(!L)return;let e=setTimeout(()=>R(null),2e3);return()=>clearTimeout(e)},[L]),(0,p.useEffect)(()=>{if(!D||!y)return;let e=setInterval(()=>{k&&k!==V.current&&(V.current=k,localStorage.setItem(`skills_draft_${y.name}`,JSON.stringify({content:k,savedAt:Date.now()})),R(Date.now()))},5e3);return()=>clearInterval(e)},[D,k,y]),(0,p.useEffect)(()=>{if(!y||!D)return;let e=localStorage.getItem(`skills_draft_${y.name}`);if(e)try{let{content:t}=JSON.parse(e);t&&t!==k&&t!==V.current&&(A(t),V.current=t,B(!0))}catch{}},[y?.name,D]),(0,p.useEffect)(()=>{if(!i||!y)return;w(!0),C(null),E(null);let e=setTimeout(()=>{w(!1),E(u.t(`activity:skillDetail.timeoutError`))},1e4),t=t=>{clearTimeout(e);let n=t;n.payload.error?E(n.payload.error):n.payload.name&&C(n.payload),w(!1)},n=e=>{let t=e;ye(!1);let n=J.current;if(t.payload.success){let e={...n.knownRefs};for(let n of t.payload.updated??[])e[n.name]=n.newRef;v({...n,knownRefs:e,updateAvailableCount:0}),W({updated:t.payload.updated??[],unchanged:t.payload.unchanged??[],errors:t.payload.errors??[]}),i.send({type:`skills.list`})}else W({updated:[],unchanged:[],errors:[{name:``,error:t.payload.error??u.t(`activity:skillDetail.updateFailed`)}]})},r=e=>{let t=e;t.payload.skills&&we(t.payload.skills)};return i.on(`skills.content`,t),i.on(`skills.updated`,n),i.on(`skills.list`,r),i.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),()=>{clearTimeout(e),i.off(`skills.content`,t),i.off(`skills.updated`,n),i.off(`skills.list`,r)}},[i,y?.name,y?.source]),(0,p.useEffect)(()=>{D&&(O(!1),A(``),P(null))},[y?.name]);let Q=(0,p.useCallback)(e=>Ce.find(t=>t.name.toLowerCase()===e.toLowerCase()),[Ce]),Te=(0,p.useCallback)(e=>{let t=Q(e);if(t){Y.current=!1;let e=b.slice(0,x+1);e.push(t),v({...J.current,selectedSkill:t,navHistory:e,historyIndex:e.length-1}),O(!1),A(``),W(null)}},[Q,b,x,v]),Ee=(0,p.useCallback)(()=>{if(x<=0)return;Y.current=!0;let e=x-1,t=b[e];v({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),W(null)},[x,b,v]),De=(0,p.useCallback)(()=>{if(x>=b.length-1)return;Y.current=!0;let e=x+1,t=b[e];v({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),W(null)},[x,b,v]),$=(0,p.useCallback)(()=>{ge(`chat`)},[]),Oe=(0,p.useCallback)(()=>{S&&(A(S.body),V.current=S.body,B(!1),P(null),O(!0),I(!1))},[S]),ke=(0,p.useCallback)(()=>{O(!1),A(``),P(null),I(!1),B(!1),y&&localStorage.removeItem(`skills_draft_${y.name}`)},[y]),Ae=(0,p.useCallback)(()=>{!y||!S||(B(!1),A(S.body),V.current=S.body,y&&localStorage.removeItem(`skills_draft_${y.name}`))},[y,S]),je=(0,p.useCallback)(()=>{if(!i||!y||!k.trim())return;M(!0),P(null);let e=t=>{let n=t;M(!1),n.payload.success?(V.current=``,localStorage.removeItem(`skills_draft_${y.name}`),B(!1),O(!1),i.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),i.send({type:`skills.list`})):P(n.payload.error??u.t(`activity:skillDetail.saveFailed`)),i.off(`skills.edited`,e)};i.on(`skills.edited`,e),i.editSkill(y.name,k)},[i,y,k]),Me=(0,p.useCallback)(()=>{!i||!y||(ye(!0),W(null),i.checkForUpdates(y.name,y.source===`user`))},[i,y]),Ne=(0,p.useCallback)(()=>{y?.sourceUrl&&navigator.clipboard.writeText(y.sourceUrl).then(()=>{xe(!0),setTimeout(()=>xe(!1),2e3)})},[y]),Pe=(0,p.useCallback)(()=>{if(!S?.body)return;let e=new Blob([S.body],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${S.name.replace(/\//g,`_`)}-SKILL.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},[S]),Fe=(0,p.useCallback)(async e=>{if(!i||!e)return;Se(!0);let t=e=>{let n=e;Se(!1),n.payload.success?(K(null),i.send({type:`skills.list`}),$()):P(n.payload.error??u.t(`activity:skillDetail.uninstallFailed`)),i.off(`skills.uninstalled`,t)};i.on(`skills.uninstalled`,t),i.uninstallSkill(e.name,e.source===`user`)},[i,$]);return y?(0,m.jsxs)(`div`,{className:d(`flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:[(0,m.jsxs)(`div`,{className:`shrink-0 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,m.jsx)(pe,{className:`h-4 w-4`})}),(0,m.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold`,children:y.name}),y.version&&(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,y.version]}),(0,m.jsx)(_e,{source:y.source})]}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:y.description||y.trigger}),y.sourceUrl&&(0,m.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1`,children:[(0,m.jsxs)(`a`,{href:`https://${y.sourceUrl.replace(`github:`,``)}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,title:n(`activity:skillDetail.openSourceRepo`),children:[(0,m.jsx)(ce,{className:`h-3 w-3 shrink-0`}),(0,m.jsx)(`span`,{className:`truncate font-mono`,children:y.sourceUrl})]}),(0,m.jsx)(`button`,{type:`button`,onClick:Ne,className:`flex shrink-0 items-center text-muted-foreground transition-colors hover:text-foreground`,title:n(`activity:skillDetail.copySourceUrl`),children:be?(0,m.jsx)(oe,{className:`h-3 w-3 text-success`}):(0,m.jsx)(se,{className:`h-3 w-3`})})]}),y.scope.length>0&&(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:y.scope.map(e=>(0,m.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:e},e))}),U&&(0,m.jsxs)(`div`,{className:`mt-2 text-xs space-y-1`,children:[U.updated.length>0&&(0,m.jsx)(`div`,{className:`text-success`,children:n(`activity:skillDetail.updatedLabel`,{list:U.updated.map(e=>`${e.name} (${e.oldRef} → ${e.newRef})`).join(`, `)})}),U.unchanged.length>0&&(0,m.jsx)(`div`,{className:`text-muted-foreground`,children:n(`activity:skillDetail.upToDateLabel`,{list:U.unchanged.join(`, `)})}),U.errors.length>0&&(0,m.jsx)(`div`,{className:`text-destructive`,children:n(`activity:skillDetail.errorsLabel`,{list:U.errors.map(e=>`${e.name?`${e.name}: `:``}${e.error}`).join(`; `)})})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 lg:ml-auto lg:shrink-0 lg:justify-end`,children:[h(y.source)&&y.sourceUrl&&(0,m.jsx)(`button`,{type:`button`,onClick:Me,disabled:H,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,title:n(`activity:skillDetail.checkUpdatesTitle`),children:H?(0,m.jsx)(o,{className:`h-3.5 w-3.5 animate-spin`}):(0,m.jsx)(te,{className:`h-3.5 w-3.5`})}),y.source!==`bundled`&&!D&&(0,m.jsx)(`button`,{type:`button`,onClick:Pe,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:n(`activity:skillDetail.exportTitle`),children:(0,m.jsx)(ue,{className:`h-3.5 w-3.5`})}),h(y.source)&&!D&&(0,m.jsx)(`button`,{type:`button`,onClick:Oe,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:n(`activity:skillDetail.editTitle`),children:(0,m.jsx)(re,{className:`h-3.5 w-3.5`})}),h(y.source)&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>K(y),className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,title:n(`activity:skillDetail.uninstallTitle`),children:(0,m.jsx)(s,{className:`h-3.5 w-3.5`})}),(0,m.jsx)(`button`,{type:`button`,onClick:$,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:n(`activity:skillDetail.closeTitle`),children:(0,m.jsx)(ie,{className:`h-4 w-4`})})]})]}),b.length>1&&(0,m.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1 rounded-lg border border-border/60 bg-muted/35 px-2 py-1`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:Ee,disabled:x<=0,className:d(`rounded p-1 transition-colors`,x<=0?`text-muted-foreground/40 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:n(`activity:skillDetail.backTitle`),children:(0,m.jsx)(de,{className:`h-4 w-4`})}),(0,m.jsx)(`button`,{type:`button`,onClick:De,disabled:x>=b.length-1,className:d(`rounded p-1 transition-colors`,x>=b.length-1?`text-muted-foreground/40 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:n(`activity:skillDetail.forwardTitle`),children:(0,m.jsx)(l,{className:`h-4 w-4`})}),(0,m.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto text-xs`,children:b.map((e,t)=>(0,m.jsxs)(`span`,{className:`flex items-center shrink-0`,children:[t>0&&(0,m.jsx)(l,{className:`h-3 w-3 text-muted-foreground/40 mx-0.5 shrink-0`}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>{t<x&&(Y.current=!0,v({...J.current,selectedSkill:e,historyIndex:t}),O(!1),A(``),W(null))},className:d(`hover:text-primary cursor-pointer transition-colors`,t===x?`text-primary font-medium`:`text-muted-foreground`),children:e.name})]},e.name+t))})]})]}),S&&(S.relatedFiles.length>0||S.references.length>0)&&(0,m.jsxs)(`div`,{className:`shrink-0 space-y-2 rounded-xl border border-border/70 bg-card/70 px-4 py-3 shadow-sm`,children:[S.relatedFiles.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,m.jsx)(ee,{className:`h-3 w-3`}),(0,m.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:n(`activity:skillDetail.relatedFiles`)})]}),S.relatedFiles.map(e=>{let t=g(e);return t&&Q(t)?(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Te(t),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] transition-colors hover:border-primary/40 hover:text-primary`,title:n(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,m.jsx)(a,{className:`h-2.5 w-2.5`}),e]},e):(0,m.jsx)(`span`,{className:`rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e},e)})]}),S.references.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,m.jsx)(ne,{className:`h-3 w-3`}),(0,m.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:n(`activity:skillDetail.references`)})]}),S.references.map(e=>{let t=g(e)??e.replace(/\.md$/,``);return Q(t)?(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Te(t),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] text-primary transition-colors hover:border-primary/30 hover:bg-primary/10`,title:n(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,m.jsx)(a,{className:`h-2.5 w-2.5`}),t]},e):(0,m.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:t},e)})]})]}),(0,m.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-xl border border-border/70 bg-card/70 shadow-sm`,children:ve?(0,m.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center text-muted-foreground`,children:[(0,m.jsx)(o,{className:`mx-auto mb-2 h-6 w-6 animate-spin text-primary`}),(0,m.jsx)(`p`,{children:n(`activity:skillDetail.loadingContent`)})]}):D?(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,m.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border/70 bg-muted/30 px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`activity:skillDetail.editingLabel`,{name:y.name})}),(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:n(`activity:skillDetail.editStats`,{lines:X.lines,words:X.words,chars:X.chars})}),Z&&(0,m.jsx)(`span`,{className:`text-xs tabular-nums ${Z.level===`critical`?`font-medium text-destructive`:`text-warning`}`,children:n(`activity:skillDetail.charsWarningFmt`,{used:(Z.used/(1024*1024)).toFixed(1),limit:(Z.limit/(1024*1024)).toFixed(0)})}),L&&(0,m.jsx)(`span`,{className:`text-xs text-success animate-pulse`,children:n(`activity:skillDetail.draftSaved`)}),z&&(0,m.jsx)(`span`,{className:`animate-pulse text-xs text-warning`,children:n(`activity:skillDetail.draftRestored`)})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[N&&(0,m.jsx)(`span`,{className:`text-xs text-destructive`,children:N}),z&&(0,m.jsx)(`button`,{type:`button`,onClick:Ae,className:`rounded-md border border-warning/35 px-2 py-1 text-[10px] text-warning transition-colors hover:bg-warning/10`,children:n(`activity:skillDetail.discardDraft`)}),(0,m.jsx)(`button`,{type:`button`,onClick:ke,className:`rounded-md border border-border/70 px-2 py-1 text-xs transition-colors hover:bg-accent`,children:n(`common:action.cancel`)}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:n(F?`activity:skillDetail.hidePreviewTitle`:`activity:skillDetail.splitViewTitle`),className:`rounded-md border px-2 py-1 text-xs transition-colors ${F?`border-primary/40 bg-primary/10 text-primary`:`border-border/70 text-muted-foreground hover:bg-accent`}`,children:(0,m.jsx)(ae,{className:`h-3 w-3 inline`})}),(0,m.jsx)(`button`,{type:`button`,onClick:je,disabled:j||!k.trim(),className:`rounded-md bg-primary px-3 py-1 text-xs text-primary-foreground shadow-sm shadow-primary/15 transition-colors hover:bg-primary/90 disabled:opacity-50`,children:j?(0,m.jsx)(o,{className:`h-3 w-3 animate-spin inline`}):n(`common:action.save`)})]})]}),F?(0,m.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-0.5`,children:[(0,m.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-0`,children:(0,m.jsx)(le,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:n(`activity:skillDetail.contentPlaceholder`)})}),(0,m.jsx)(`div`,{className:`w-px bg-border flex-shrink-0`}),(0,m.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-background/45 p-4 prose prose-sm dark:prose-invert max-w-none`,children:(0,m.jsx)(t,{rehypePlugins:[r],components:f,children:k})})]}):(0,m.jsx)(le,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:n(`activity:skillDetail.contentPlaceholder`)})]}):S?(0,m.jsx)(`div`,{className:`h-full min-h-0 overflow-y-auto p-5 sm:p-6 prose prose-sm dark:prose-invert max-w-none`,children:(0,m.jsx)(t,{rehypePlugins:[r],components:f,children:S.body})}):T?(0,m.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center`,children:[(0,m.jsx)(`p`,{className:`text-destructive mb-2`,children:n(`activity:skillDetail.loadFailed`)}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>{i&&y&&(w(!0),E(null),i.send({type:`skills.content`,payload:{name:y.name,source:y.source}}))},className:`mt-4 rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent`,children:n(`common:action.retry`)})]}):(0,m.jsx)(`div`,{className:`flex h-full min-h-[16rem] items-center justify-center p-8 text-center text-muted-foreground`,children:n(`activity:skillDetail.noContent`)})}),G&&(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/45 p-4 backdrop-blur-sm`,onClick:e=>{e.target===e.currentTarget&&K(null)},children:(0,m.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":n(`activity:skillDetail.uninstallSkillHeading`),className:`flex max-h-[calc(100dvh-2rem)] w-[380px] max-w-[90vw] flex-col overflow-hidden rounded-xl border border-border/70 bg-card shadow-2xl`,children:[(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-border/70 p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(s,{className:`h-4 w-4 text-destructive`}),(0,m.jsx)(`span`,{className:`font-semibold text-sm`,children:n(`activity:skillDetail.uninstallSkillHeading`)})]}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>K(null),"aria-label":n(`common:action.close`),className:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground`,children:(0,m.jsx)(ie,{className:`h-4 w-4`})})]}),(0,m.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-4`,children:[(0,m.jsx)(`p`,{className:`text-sm`,children:n(`activity:skillDetail.uninstallConfirm`,{name:G.name})}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:skillDetail.uninstallRemovePath`,{path:G.source===`user`?`~/.wrongstack/skills`:`.wrongstack/skills`})})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-border/70 bg-muted/20 p-4`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:()=>K(null),disabled:q,className:`rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent disabled:opacity-50`,children:n(`common:action.cancel`)}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Fe(G),disabled:q,className:`flex items-center gap-1.5 rounded-md bg-destructive px-3 py-1.5 text-xs text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50`,children:[q&&(0,m.jsx)(o,{className:`h-3 w-3 animate-spin`}),n(`activity:skillDetail.uninstallAction`)]})]})]})})]}):(0,m.jsx)(`div`,{className:d(`flex h-full min-h-0 flex-1 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4 text-muted-foreground`,e),children:(0,m.jsxs)(`div`,{className:`ws-surface flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center`,children:[(0,m.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,m.jsx)(fe,{className:`h-6 w-6`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`p`,{className:`text-base font-medium text-foreground`,children:n(`activity:skillDetail.noSkillSelected`)}),(0,m.jsx)(`p`,{className:`mt-1 text-sm`,children:n(`activity:skillDetail.selectSkillHint`)})]}),(0,m.jsx)(`button`,{type:`button`,onClick:$,className:`mt-1 rounded-md border border-border/70 bg-card/70 px-4 py-2 text-sm text-foreground shadow-sm transition-colors hover:bg-accent`,children:n(`activity:skillDetail.goToChat`)})]})})}export{_ as SkillDetailView};
|