@wrongstack/webui 0.313.0 → 0.316.1
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/assets/AgentRosterView-CESYPVXA.js +9 -0
- package/dist/assets/AnalyticsDashboard-zDBIqTxO.js +1 -0
- package/dist/assets/AudienceMemoryPanel-BnNJ0EhQ.js +3 -0
- package/dist/assets/ChangesView-CGwCocSR.js +1 -0
- package/dist/assets/ChimeraReviewsView-CFxZwJBI.js +1 -0
- package/dist/assets/ChronicleDashboard-DKiMK5nl.js +1 -0
- package/dist/assets/CodeEditor-CZcMPNTH.js +2 -0
- package/dist/assets/CodeMap-zPUlmh5G.js +1 -0
- package/dist/assets/ConfirmModal-CUGk-0lT.js +1 -0
- package/dist/assets/{CronJobsPanel-CUPHNDwl.js → CronJobsPanel-C_wutCVP.js} +1 -1
- package/dist/assets/{DeadCodeScanPanel-Dj-5SAEE.js → DeadCodeScanPanel-DCCjg17Q.js} +2 -2
- package/dist/assets/{DebugDashboard-DmgHPeuw.js → DebugDashboard-D-ogYAbO.js} +1 -1
- package/dist/assets/DesignGalleryView-CtlHZWOn.js +1 -0
- package/dist/assets/GoalView-Czksj2nD.js +1 -0
- package/dist/assets/KanbanView-C5_GD0qk.js +3 -0
- package/dist/assets/MailboxDetailView-2rWp3cTv.js +1 -0
- package/dist/assets/MemoryDrawer-D9Chtt6v.js +1 -0
- package/dist/assets/MemoryManager-Bj41s3KW.js +1 -0
- package/dist/assets/ModelPicker-vwrqLOL4.js +1 -0
- package/dist/assets/OfficeMapPanel-BfuePIGH.js +4 -0
- package/dist/assets/ProcessMonitor-CHPTCtyu.js +1 -0
- package/dist/assets/PromptJournalView-tOTjKpi8.js +1 -0
- package/dist/assets/QueuePanel-BIwoG-tG.js +1 -0
- package/dist/assets/RefreshDebugView-DesPEAAq.js +1 -0
- package/dist/assets/RequirementIntakeView-BonXC1a5.js +1 -0
- package/dist/assets/SageTabs-82lpgRh-.js +2 -0
- package/dist/assets/SddFlowGraph-CMedulJi.js +1 -0
- package/dist/assets/SddHub-D3Gm4Io2.js +2 -0
- package/dist/assets/SessionInspectView-BUs2B4mF.js +1 -0
- package/dist/assets/SessionList-DxQgJqgl.js +1 -0
- package/dist/assets/SessionsDashboard-JtwQf-N5.js +1 -0
- package/dist/assets/SetupScreen-XFBFjPbd.js +1 -0
- package/dist/assets/SkillDetailView-C_P_-783.js +3 -0
- package/dist/assets/{SpecsView-Bkrq2hhM.js → SpecsView-D6GqoZ2L.js} +1 -1
- package/dist/assets/TechStackView-BE4tdEYZ.js +2 -0
- package/dist/assets/TerminalPanel-BcizpYrZ.js +1 -0
- package/dist/assets/activity-B2_Vr2oD.js +10 -0
- package/dist/assets/activity-BF1idM4Y.js +10 -0
- package/dist/assets/activity-C-kOJZXC.js +10 -0
- package/dist/assets/activity-DPpMW8BU.js +10 -0
- package/dist/assets/activity-DYMBKGt0.js +10 -0
- package/dist/assets/activity-IxgYWPDt.js +10 -0
- package/dist/assets/activity-q85HXQNv.js +10 -0
- package/dist/assets/{button-Dhmop_yM.js → button-C_EYpeP-.js} +1 -1
- package/dist/assets/{chat-CR2B97dj.js → chat-B5a3cvps.js} +1 -1
- package/dist/assets/{chat-DResBrkV.js → chat-B60h8Cji.js} +1 -1
- package/dist/assets/{chat-BnkVCZ3Q.js → chat-BNWqeV-N.js} +1 -1
- package/dist/assets/chat-BlllxfpP.js +1 -0
- package/dist/assets/{chat-BfQBSiII.js → chat-BvKkSd09.js} +1 -1
- package/dist/assets/{chat-BPuAsrkF.js → chat-DTI7lNDx.js} +1 -1
- package/dist/assets/{chat-Di8o0wDz.js → chat-DlhXGxxi.js} +1 -1
- package/dist/assets/chat-store-x5w4ss_D.js +1 -0
- package/dist/assets/{codemap-activity-store-BWt_a7Gs.js → codemap-activity-store-ZCXcHlwd.js} +1 -1
- package/dist/assets/codemap-index-store-Cb5mn74P.js +1 -0
- package/dist/assets/{dialog-DPl7DolS.js → dialog-9eW9sG90.js} +1 -1
- package/dist/assets/{empty-state-IT10GzRA.js → empty-state-DJb_tw7Q.js} +1 -1
- package/dist/assets/i18n-DkMSw3tI.js +2 -0
- package/dist/assets/index-BSpLtv9S.css +1 -0
- package/dist/assets/index-CTyM4bm8.js +137 -0
- package/dist/assets/{input-C3rIQ26u.js → input-CsEvo8Oo.js} +1 -1
- package/dist/assets/{mailbox-store-DhAVkVJQ.js → mailbox-store-KHcrg_Fm.js} +1 -1
- package/dist/assets/{roster-ws-Vj_HH49O.js → roster-ws-CXnrEaEu.js} +1 -1
- package/dist/assets/settings-1o1gooaL.js +1 -0
- package/dist/assets/settings-BGvRM3vJ.js +1 -0
- package/dist/assets/{settings-BV1_j8_-.js → settings-BV8EFmpH.js} +1 -1
- package/dist/assets/settings-Ci_RMpCQ.js +1 -0
- package/dist/assets/settings-Cy_xp4Jt.js +1 -0
- package/dist/assets/settings-D-LlBmzO.js +1 -0
- package/dist/assets/settings-nWMBX3xS.js +1 -0
- package/dist/assets/{shared-BUXBOqyO.js → shared-sYlGVRJI.js} +1 -1
- package/dist/assets/stores-5ynEAenb.js +7 -0
- package/dist/assets/toasts-BsmyGP95.js +1 -0
- package/dist/assets/toasts-CgXHu8ZB.js +1 -0
- package/dist/assets/toasts-DZ6HdKgG.js +1 -0
- package/dist/assets/toasts-DizCJjAR.js +1 -0
- package/dist/assets/toasts-NC2MT4uN.js +1 -0
- package/dist/assets/toasts-bPl097de.js +1 -0
- package/dist/assets/toasts-tCVo15mP.js +1 -0
- package/dist/assets/ui-store-9b7zzi3V.js +1 -0
- package/dist/assets/useWebSocket-1kxFH7f8.js +27 -0
- package/dist/assets/utils-DIo8iytt.js +1 -0
- package/dist/assets/{vector-memory-panel-CBA4CK6N.js → vector-memory-panel-Dd3jXXYA.js} +1 -1
- package/dist/assets/{vendor-DZ9_OO6N.js → vendor-UFryhfbN.js} +30 -30
- package/dist/assets/view-navigation-ICwpL9qw.js +1 -0
- package/dist/assets/ws-client-Ccf_VLRQ.js +22 -0
- package/dist/components/AgentOfficeView/model.d.ts +4 -3
- package/dist/components/AgentRosterView.d.ts +8 -1
- package/dist/components/ChatInput/composer-button-bar.d.ts +6 -2
- package/dist/components/ChatInput/image-attachments.d.ts +2 -1
- package/dist/components/ChatInput/next-steps-helpers.d.ts +0 -16
- package/dist/components/ChatInput/refine-panel-host.d.ts +2 -2
- package/dist/components/ChatInput/session-effort-select.d.ts +16 -0
- package/dist/components/ChatInput/slash-commands.d.ts +2 -1
- package/dist/components/ChatInput/slash-routing.d.ts +8 -0
- package/dist/components/ChatInput/use-chat-input-mcp.d.ts +2 -1
- package/dist/components/ChatInput/use-paste-drop.d.ts +2 -1
- package/dist/components/ChatInput/use-refine-timeout.d.ts +2 -1
- package/dist/components/ChatInput/use-speech-recognition.d.ts +9 -0
- package/dist/components/ChatView/AgentTabs.d.ts +1 -1
- package/dist/components/ChatView/BrainDecisionCard.d.ts +9 -0
- package/dist/components/ChatView/ChatHeader.d.ts +3 -3
- package/dist/components/ChatView/ChatRowView.d.ts +3 -1
- package/dist/components/ChatView/ChimeraReportCard.d.ts +22 -0
- package/dist/components/ChatView/CouncilDecisionCard.d.ts +9 -0
- package/dist/components/ChatView/auto-collapse.d.ts +2 -1
- package/dist/components/ChatView/useChatViewState.d.ts +14 -28
- package/dist/components/ChatView/utils.d.ts +2 -1
- package/dist/components/ChimeraReviewsView.d.ts +2 -0
- package/dist/components/CodeMapActivityStreamPanel.d.ts +2 -1
- package/dist/components/CodeMapDirectoryTree.d.ts +2 -1
- package/dist/components/CodeMapLiveOverlay.d.ts +0 -3
- package/dist/components/CodeMapSelectedNodeSummary.d.ts +2 -1
- package/dist/components/CollabPanel.d.ts +2 -7
- package/dist/components/ConfirmModal.d.ts +6 -13
- package/dist/components/CronJobsPanel.d.ts +2 -1
- package/dist/components/CustomRosterPanel.d.ts +0 -1
- package/dist/components/DependencyGraph.d.ts +2 -1
- package/dist/components/FileActivityDrawer.d.ts +2 -2
- package/dist/components/FileExplorer/FileExplorerModals.d.ts +11 -6
- package/dist/components/FileExplorer/TreeRow.d.ts +2 -6
- package/dist/components/FileExplorer/tree-helpers.d.ts +7 -0
- package/dist/components/FleetPanel.d.ts +4 -13
- package/dist/components/InspectorPanel.d.ts +6 -1
- package/dist/components/KanbanBoardSidebar.d.ts +2 -1
- package/dist/components/KanbanBoardState.d.ts +1 -1
- package/dist/components/KanbanContractGraphView.d.ts +3 -2
- package/dist/components/KanbanQueueHealthBar.d.ts +2 -1
- package/dist/components/KanbanTaskActivityRecorder.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryDetail.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryEditor.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryFilters.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryList.d.ts +2 -1
- package/dist/components/MemoryManager/MemorySearchBreakdown.d.ts +2 -1
- package/dist/components/MemoryManager/ReviewQueue.d.ts +2 -1
- package/dist/components/MemoryManager/SageTabs.d.ts +2 -1
- package/dist/components/MemoryManager/shared.d.ts +0 -1
- package/dist/components/MessageBubble/FailedRunContinue.d.ts +12 -0
- package/dist/components/MessageBubble/utils.d.ts +6 -0
- package/dist/components/ModelPickDialog.d.ts +1 -1
- package/dist/components/ModelSelectDialog.d.ts +4 -3
- package/dist/components/NextStepsBar.d.ts +1 -6
- package/dist/components/NotificationMenu.d.ts +6 -0
- package/dist/components/OfficeMapCanvas/edges.d.ts +0 -6
- package/dist/components/OfficeMapCanvas/nodes.d.ts +0 -32
- package/dist/components/OfficeMapCanvas/use-recently-finished.d.ts +2 -1
- package/dist/components/OfficeMapCanvas/utils.d.ts +4 -10
- package/dist/components/ProcessMonitor.d.ts +2 -1
- package/dist/components/ProviderWaitingRoom.d.ts +8 -0
- package/dist/components/QueuePanel.d.ts +1 -1
- package/dist/components/QuickModelSwitcher.filter.d.ts +23 -7
- package/dist/components/RestoreTabsModal.d.ts +20 -0
- package/dist/components/SddFlowGraph.d.ts +3 -2
- package/dist/components/SessionTabBar/TabMap.d.ts +19 -0
- package/dist/components/SessionTabBar/summaries.d.ts +39 -0
- package/dist/components/SessionTabBar.d.ts +14 -0
- package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts +2 -1
- package/dist/components/SettingsPanel/ModelCatalogPicker.d.ts +2 -14
- package/dist/components/SettingsPanel/ModelEffortSelect.d.ts +12 -0
- package/dist/components/SettingsPanel/ModelListEditor.d.ts +2 -1
- package/dist/components/SettingsPanel/ModelSchemaEditor.d.ts +2 -1
- package/dist/components/SettingsPanel/ModelSection.d.ts +3 -1
- package/dist/components/SettingsPanel/ModelTiersSection.d.ts +7 -0
- package/dist/components/SettingsPanel/OAuthLoginSection.d.ts +2 -2
- package/dist/components/SettingsPanel/PluginToggleList.d.ts +3 -1
- package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts +2 -1
- package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts +2 -1
- package/dist/components/SettingsPanel/ProviderSection.d.ts +2 -2
- package/dist/components/SettingsPanel/ToolsSection.d.ts +0 -10
- package/dist/components/SettingsPanel/brain-section-options.d.ts +3 -10
- package/dist/components/SettingsPanel/contracts.d.ts +5 -3
- package/dist/components/SettingsPanel/sync-settings-preference.d.ts +8 -0
- package/dist/components/SettingsPanel/undo-send-decision.d.ts +2 -1
- package/dist/components/SidePanel/ChangesPanel.d.ts +0 -6
- package/dist/components/SidePanel/DesignStudioPanel.d.ts +7 -0
- package/dist/components/SidePanel/SessionList.d.ts +6 -6
- package/dist/components/SystemPromptDialog.d.ts +18 -0
- package/dist/components/TaskActivityTimeline.d.ts +3 -3
- package/dist/components/TaskBoard.d.ts +1 -1
- package/dist/components/TaskCard.d.ts +2 -7
- package/dist/components/TaskExecutionAttempts.d.ts +2 -1
- package/dist/components/TaskIntelligencePanel.d.ts +1 -1
- package/dist/components/TaskRiskPanel.d.ts +4 -3
- package/dist/components/TechStackView/DependencyDetail.d.ts +2 -1
- package/dist/components/TechStackView/DependencyTable.d.ts +2 -1
- package/dist/components/TechStackView/FindingsPanel.d.ts +2 -1
- package/dist/components/TechStackView/TechStackToolbar.d.ts +2 -1
- package/dist/components/TechStackView/shared.d.ts +5 -5
- package/dist/components/Toaster.d.ts +3 -31
- package/dist/components/ToolStatsModal.d.ts +15 -0
- package/dist/components/UpdateBanner.d.ts +6 -4
- package/dist/components/WorkbenchTopbar.d.ts +1 -3
- package/dist/components/agent-roster-data.d.ts +1 -1
- package/dist/components/agents/AgentDetailSection.d.ts +2 -1
- package/dist/components/agents/AgentRosterCard.d.ts +2 -1
- package/dist/components/agents/FleetSummaryBar.d.ts +6 -3
- package/dist/components/codemap-model.d.ts +3 -2
- package/dist/components/ui/PickerCardList.d.ts +3 -2
- package/dist/components/ui/badge.d.ts +2 -2
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/concurrency-gauge.d.ts +2 -1
- package/dist/components/ui/dialog.d.ts +5 -5
- package/dist/components/ui/dropdown-menu.d.ts +8 -8
- package/dist/components/ui/event-timeline.d.ts +2 -1
- package/dist/components/ui/fleet-agent-row.d.ts +2 -7
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/sheet.d.ts +2 -2
- package/dist/components/ui/sparkline.d.ts +2 -1
- package/dist/components/vector-memory-panel/model.d.ts +2 -7
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useDesktopBridge.d.ts +2 -1
- package/dist/hooks/useF5Resilience.d.ts +0 -14
- package/dist/hooks/useFleetPolling.d.ts +2 -1
- package/dist/hooks/useGlobalKeyboardShortcuts.d.ts +4 -1
- package/dist/hooks/useIntegrationStatus.d.ts +10 -0
- package/dist/hooks/useKanbanMeta.d.ts +4 -3
- package/dist/hooks/useLiveContextDebug.d.ts +4 -3
- package/dist/hooks/useMemoryForFile.d.ts +3 -2
- package/dist/hooks/usePagination.d.ts +2 -1
- package/dist/hooks/useProviderModels.d.ts +1 -0
- package/dist/hooks/useSessionSubscription.d.ts +15 -0
- package/dist/hooks/useViewport.d.ts +2 -3
- package/dist/hooks/useWebSocket.d.ts +6 -1
- package/dist/hooks/ws-handlers/chat-handlers.d.ts +22 -10
- package/dist/hooks/ws-handlers/coordinator-handlers.d.ts +7 -0
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +1 -3
- package/dist/hooks/ws-handlers/misc-handlers.d.ts +22 -0
- package/dist/hooks/ws-handlers/session-context-handlers.d.ts +24 -2
- package/dist/hooks/ws-handlers/session-execution-handlers.d.ts +13 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts +3 -3
- package/dist/hooks/ws-handlers/session-replay-handlers.d.ts +31 -2
- package/dist/hooks/ws-handlers/techstack-handlers.d.ts +0 -3
- package/dist/index.html +30 -26
- package/dist/index.js +77838 -67041
- package/dist/lib/agent-office.d.ts +3 -3
- package/dist/lib/agent-session.d.ts +19 -0
- package/dist/lib/agent-status.d.ts +5 -4
- package/dist/lib/completion.d.ts +3 -2
- package/dist/lib/delegate-format.d.ts +33 -0
- package/dist/lib/favicon.d.ts +2 -1
- package/dist/lib/kanban-verification.d.ts +3 -2
- package/dist/lib/model-matrix-routes.d.ts +3 -3
- package/dist/lib/plugin-enablement.d.ts +1 -1
- package/dist/lib/reasoning-effort.d.ts +76 -0
- package/dist/lib/sdd-theme.d.ts +4 -3
- package/dist/lib/task-brief-preview.d.ts +5 -0
- package/dist/lib/terminal-dock.d.ts +0 -1
- package/dist/lib/view-navigation.d.ts +2 -2
- package/dist/lib/ws-client-actions.d.ts +1 -0
- package/dist/lib/ws-client-domain-methods.d.ts +45 -5
- package/dist/lib/ws-client-utils.d.ts +33 -0
- package/dist/lib/ws-client.d.ts +135 -6
- package/dist/manifest.json +17 -0
- package/dist/protocol-compatibility.d.ts +0 -10
- package/dist/stores/auto-submit-streak.d.ts +3 -1
- package/dist/stores/chat-lanes.d.ts +279 -0
- package/dist/stores/chat-retention.d.ts +2 -4
- package/dist/stores/chat-store-types.d.ts +1 -0
- package/dist/stores/chat-store.d.ts +46 -25
- package/dist/stores/chimera-hub-store.d.ts +140 -0
- package/dist/stores/chimera-reports-store.d.ts +45 -0
- package/dist/stores/codemap-activity-store.d.ts +4 -4
- package/dist/stores/context-editor-store.d.ts +4 -5
- package/dist/stores/coordinator-monitor-store.d.ts +3 -2
- package/dist/stores/council-log-store.d.ts +6 -20
- package/dist/stores/file-store.d.ts +32 -13
- package/dist/stores/fleet-store.d.ts +49 -5
- package/dist/stores/git-changes-store.d.ts +25 -1
- package/dist/stores/goal-run-store.d.ts +2 -2
- package/dist/stores/history-store.d.ts +11 -0
- package/dist/stores/index.d.ts +17 -9
- package/dist/stores/local-prefs.d.ts +87 -0
- package/dist/stores/mailbox-store.d.ts +2 -2
- package/dist/stores/memory-injector-store.d.ts +2 -2
- package/dist/stores/memory-lifecycle-store.d.ts +6 -2
- package/dist/stores/monitor-store.d.ts +3 -2
- package/dist/stores/notification-store.d.ts +141 -0
- package/dist/stores/provider-status-store.d.ts +19 -0
- package/dist/stores/restore-tabs-store.d.ts +29 -0
- package/dist/stores/resume-progress-store.d.ts +58 -0
- package/dist/stores/session-inspect-store.d.ts +1 -1
- package/dist/stores/session-lanes.d.ts +242 -0
- package/dist/stores/session-scoped-store.d.ts +56 -0
- package/dist/stores/session-store.d.ts +97 -154
- package/dist/stores/session-tab-store.d.ts +197 -0
- package/dist/stores/side-effect-store.d.ts +9 -1
- package/dist/stores/system-prompt-store.d.ts +48 -0
- package/dist/stores/tool-stats-store.d.ts +52 -0
- package/dist/stores/types.d.ts +81 -4
- package/dist/stores/ui-store.d.ts +113 -11
- package/dist/types/brain.d.ts +17 -16
- package/dist/types/chronicle.d.ts +3 -2
- package/dist/types/client-message.d.ts +139 -23
- package/dist/types/collab.d.ts +0 -2
- package/dist/types/protocol-core.d.ts +62 -6
- package/dist/types/server-message.d.ts +204 -3
- package/dist/types/skills-design.d.ts +2 -1
- package/package.json +9 -9
- package/dist/assets/AgentRosterView-CoAI4zVY.js +0 -9
- package/dist/assets/AnalyticsDashboard-BHKB7MA7.js +0 -1
- package/dist/assets/AudienceMemoryPanel-B1Ddueaa.js +0 -3
- package/dist/assets/ChangesView-DEsqwAdJ.js +0 -1
- package/dist/assets/ChronicleDashboard-CCoGRIP2.js +0 -1
- package/dist/assets/CodeEditor-C8nAvIw1.js +0 -2
- package/dist/assets/CodeMap-BvqQN6MG.js +0 -1
- package/dist/assets/ConfirmModal-CRSE2t_c.js +0 -1
- package/dist/assets/DesignGalleryView-DHVayfgO.js +0 -1
- package/dist/assets/GoalView-BV0HgkVM.js +0 -1
- package/dist/assets/KanbanView-_S_44j5W.js +0 -3
- package/dist/assets/MailboxDetailView-DS0INWjY.js +0 -1
- package/dist/assets/MemoryDrawer-CASOliWm.js +0 -1
- package/dist/assets/MemoryManager-CHJccmRF.js +0 -1
- package/dist/assets/ModelPicker-BD-yKqK0.js +0 -1
- package/dist/assets/OfficeMapPanel-CeK44Zg_.js +0 -4
- package/dist/assets/ProcessMonitor-QErl6IY_.js +0 -1
- package/dist/assets/PromptJournalView-CoLmLGEt.js +0 -1
- package/dist/assets/QueuePanel-rdZBX64y.js +0 -1
- package/dist/assets/RefreshDebugView-CzGncYqB.js +0 -1
- package/dist/assets/RequirementIntakeView-exfkRXjK.js +0 -1
- package/dist/assets/SageTabs-he_mI7tp.js +0 -2
- package/dist/assets/SddFlowGraph-C484p5L9.js +0 -1
- package/dist/assets/SddHub-Fv-cENSK.js +0 -2
- package/dist/assets/SessionInspectView--89Niv2G.js +0 -1
- package/dist/assets/SessionList-DLmayeUi.js +0 -1
- package/dist/assets/SessionsDashboard-DiGHUFnB.js +0 -1
- package/dist/assets/SetupScreen-DHa4BQF7.js +0 -1
- package/dist/assets/SkillDetailView-CQ6luqj6.js +0 -3
- package/dist/assets/TechStackView-B4xMV0Z9.js +0 -2
- package/dist/assets/TerminalPanel-D25-VKJU.js +0 -1
- package/dist/assets/Toaster-CcgCyzaU.js +0 -1
- package/dist/assets/activity-BA8C9ueU.js +0 -9
- package/dist/assets/activity-BYnOci5N.js +0 -9
- package/dist/assets/activity-COQ9xSFu.js +0 -9
- package/dist/assets/activity-CuJqhGz7.js +0 -9
- package/dist/assets/activity-D3ZccGOh.js +0 -9
- package/dist/assets/activity-YMES6OPI.js +0 -9
- package/dist/assets/activity-zlMMaNE1.js +0 -9
- package/dist/assets/chat-CzaGXz_W.js +0 -1
- package/dist/assets/chat-store-BiEXyguk.js +0 -17
- package/dist/assets/codemap-index-store-CDhApwWQ.js +0 -1
- package/dist/assets/i18n-BeHaHx3x.js +0 -2
- package/dist/assets/index-B8J_xxU5.css +0 -1
- package/dist/assets/index-CGMJmLO0.js +0 -134
- package/dist/assets/session-store-CKpAwNIm.js +0 -1
- package/dist/assets/settings-BNbqEBSr.js +0 -1
- package/dist/assets/settings-BsZgLIo2.js +0 -1
- package/dist/assets/settings-C3OnmFrY.js +0 -1
- package/dist/assets/settings-C3bNf1Bx.js +0 -1
- package/dist/assets/settings-C9FOpDBt.js +0 -1
- package/dist/assets/settings-oeXlO4HA.js +0 -1
- package/dist/assets/stores-CHaV9Mb9.js +0 -7
- package/dist/assets/toasts-BCDGDcyq.js +0 -1
- package/dist/assets/toasts-BwQJwYLe.js +0 -1
- package/dist/assets/toasts-CFzweRH5.js +0 -1
- package/dist/assets/toasts-DDYQsJV8.js +0 -1
- package/dist/assets/toasts-DOfXc7Rt.js +0 -1
- package/dist/assets/toasts-Dm12Nq8t.js +0 -1
- package/dist/assets/toasts-frBt6fvE.js +0 -1
- package/dist/assets/ui-store-3HoYrTu5.js +0 -1
- package/dist/assets/useWebSocket-DJWEKY_A.js +0 -29
- package/dist/assets/utils-BecmXwgG.js +0 -1
- package/dist/assets/view-navigation-C1UDTk5R.js +0 -1
- package/dist/assets/ws-client-DXT4gi-N.js +0 -1
|
@@ -3,12 +3,12 @@ import type { ChronicleFacet, ChronicleFacetValue, ChronicleGraphResult, Chronic
|
|
|
3
3
|
import type { WSCollabAnnotationAdded, WSCollabAnnotationResolved, WSCollabEvent, WSCollabInjectionGranted, WSCollabParticipantJoined, WSCollabParticipantLeft, WSCollabPauseGranted, WSCollabPauseReleased, WSCollabState } from './collab.js';
|
|
4
4
|
import type { AutoHealStatusEvent, ConnectionsHealthReport, ServiceActionResult } from './connections.js';
|
|
5
5
|
import type { WSAgentStatusChanged, WSAgentTimelineMessage, WSEternalIteration, WSGoalAssessResult, WSGoalLifecycle, WSGoalList, WSGoalProgress, WSGoalState, WSKanbanResult, WSKanbanTaskActivity, WSModesList, WSWorktreeCleanupResult, WSWorktreeDiffResult, WSWorktreeEvent, WSWorktreeMergeResult, WSWorktreeOrphans, WSWorktreeState } from './goal-kanban-worktree.js';
|
|
6
|
-
import type { SessionScopedPayload, WSCodeMapToolExecuted, WSCodeMapToolStarted, WSIterationCompleted, WSIterationLimitReached, WSIterationStarted, WSProviderActiveBlocked, WSProviderError, WSProviderFallback, WSProviderFallbackPending, WSProviderResponse, WSProviderRetry, WSProviderStatusChanged, WSProviderStatusSnapshot, WSProviderStreamError, WSRunResult, WSSessionEnd, WSSessionStart, WSTextDelta, WSThinkingDelta, WSToolExecuted, WSToolProgress, WSToolUseStart } from './protocol-core.js';
|
|
6
|
+
import type { SessionScopedPayload, WSCodeMapToolExecuted, WSCodeMapToolStarted, WSIterationCompleted, WSIterationLimitReached, WSIterationStarted, WSProviderActiveBlocked, WSProviderAuditHistory, WSProviderError, WSProviderFallback, WSProviderFallbackPending, WSProviderResponse, WSProviderRetry, WSProviderStatusChanged, WSProviderStatusSnapshot, WSProviderStreamError, WSRunResult, WSSessionEnd, WSSessionResumeProgress, WSSessionRunState, WSSessionStart, WSTextDelta, WSThinkingDelta, WSToolExecuted, WSToolProgress, WSToolUseStart } from './protocol-core.js';
|
|
7
7
|
import type { WSCompactionFailed, WSContextCompacted, WSContextDebug, WSContextEditorApplied, WSContextEditorSnapshot, WSContextEditorValidation, WSContextMaxContext, WSContextModeChanged, WSContextModesList, WSContextPct, WSContextRepaired, WSDelegateCompleted, WSDelegateStarted, WSError, WSMemoryList, WSSessionStats, WSTokenCostEstimateUnavailable, WSTokenThreshold, WSToolConfirmNeeded, WSToolLoopDetected, WSToolsList, WSTopicAdviceResult, WSTrustPersisted } from './runtime.js';
|
|
8
8
|
import type { WSMemorySageBackfillRecoverable, WSMemorySageCandidateResolve, WSMemorySageDelete, WSMemorySageForFile, WSMemorySageGet, WSMemorySageGraph, WSMemorySageList, WSMemorySageListCandidates, WSMemorySageListPage, WSMemorySageRecover, WSMemorySageRemember, WSMemorySageSearchBreakdown, WSMemorySageUpdate } from './sage.js';
|
|
9
9
|
import type { WSDesignList, WSDesignMaterialize, WSDesignSet, WSDesignState, WSDesignSwap, WSDesignTune, WSDesignUse, WSDesignVerify, WSSkillContent, WSSkillsCreated, WSSkillsEdited, WSSkillsExported, WSSkillsInstalled, WSSkillsList, WSSkillsUninstalled, WSSkillsUpdated } from './skills-design.js';
|
|
10
10
|
import type { WSAuthOAuthStatus, WSCatalogModelSearchResult, WSCompletionResult, WSDiagGet, WSFilesList, WSKeyOperationResult, WSModelSwitchResult, WSProviderCatalog, WSProviderModels, WSProviderProbe, WSSavedProviders, WSSessionInspect, WSSessionsList, WSSideEffects, WSStatsGet, WSTodosCleared, WSTodosUpdated } from './system.js';
|
|
11
|
-
export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSThinkingDelta | WSToolUseStart | WSToolProgress | WSToolExecuted | WSCodeMapToolStarted | WSCodeMapToolExecuted | WSIterationStarted | WSIterationCompleted | WSIterationLimitReached | WSProviderResponse | WSProviderRetry | WSProviderError | WSProviderFallback | WSProviderFallbackPending | WSProviderStatusChanged | WSProviderStatusSnapshot | WSProviderActiveBlocked | WSProviderStreamError | WSRunResult | WSSessionStats | WSError | WSToolConfirmNeeded | WSTrustPersisted | WSToolLoopDetected | WSDelegateStarted | WSDelegateCompleted | WSContextDebug | WSContextCompacted | WSCompactionFailed | WSContextRepaired | WSContextEditorSnapshot | WSContextEditorValidation | WSContextEditorApplied | WSContextPct | WSTopicAdviceResult | WSContextMaxContext | WSTokenThreshold | WSTokenCostEstimateUnavailable | WSContextModesList | WSContextModeChanged | WSToolsList | WSMemoryList | WSMemorySageList | WSMemorySageListPage | WSMemorySageListCandidates | WSMemorySageGet | WSMemorySageGraph | WSMemorySageSearchBreakdown | WSMemorySageUpdate | WSMemorySageRemember | WSMemorySageDelete | WSMemorySageRecover | WSMemorySageCandidateResolve | WSMemorySageBackfillRecoverable | WSMemorySageForFile | WSSkillsList | WSSkillContent | WSDesignList | WSDesignUse | WSDesignState | WSDesignSet | WSDesignTune | WSDesignSwap | WSDesignMaterialize | WSDesignVerify | WSSkillsInstalled | WSSkillsUninstalled | WSSkillsUpdated | WSSkillsCreated | WSSkillsEdited | WSSkillsExported | WSDiagGet | WSStatsGet | {
|
|
11
|
+
export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSThinkingDelta | WSToolUseStart | WSToolProgress | WSToolExecuted | WSCodeMapToolStarted | WSCodeMapToolExecuted | WSIterationStarted | WSIterationCompleted | WSIterationLimitReached | WSProviderResponse | WSProviderRetry | WSProviderAuditHistory | WSProviderError | WSProviderFallback | WSProviderFallbackPending | WSProviderStatusChanged | WSProviderStatusSnapshot | WSProviderActiveBlocked | WSProviderStreamError | WSRunResult | WSSessionRunState | WSSessionResumeProgress | WSSessionStats | WSError | WSToolConfirmNeeded | WSTrustPersisted | WSToolLoopDetected | WSDelegateStarted | WSDelegateCompleted | WSContextDebug | WSContextCompacted | WSCompactionFailed | WSContextRepaired | WSContextEditorSnapshot | WSContextEditorValidation | WSContextEditorApplied | WSContextPct | WSTopicAdviceResult | WSContextMaxContext | WSTokenThreshold | WSTokenCostEstimateUnavailable | WSContextModesList | WSContextModeChanged | WSToolsList | WSMemoryList | WSMemorySageList | WSMemorySageListPage | WSMemorySageListCandidates | WSMemorySageGet | WSMemorySageGraph | WSMemorySageSearchBreakdown | WSMemorySageUpdate | WSMemorySageRemember | WSMemorySageDelete | WSMemorySageRecover | WSMemorySageCandidateResolve | WSMemorySageBackfillRecoverable | WSMemorySageForFile | WSSkillsList | WSSkillContent | WSDesignList | WSDesignUse | WSDesignState | WSDesignSet | WSDesignTune | WSDesignSwap | WSDesignMaterialize | WSDesignVerify | WSSkillsInstalled | WSSkillsUninstalled | WSSkillsUpdated | WSSkillsCreated | WSSkillsEdited | WSSkillsExported | WSDiagGet | WSStatsGet | {
|
|
12
12
|
type: 'connections.health_result';
|
|
13
13
|
payload: ConnectionsHealthReport;
|
|
14
14
|
} | {
|
|
@@ -72,13 +72,19 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
72
72
|
root: string;
|
|
73
73
|
tree: unknown[];
|
|
74
74
|
error?: string | undefined;
|
|
75
|
+
sessionId?: string | undefined;
|
|
75
76
|
};
|
|
76
77
|
} | {
|
|
77
78
|
type: 'files.read';
|
|
78
79
|
payload: {
|
|
79
80
|
filePath: string;
|
|
80
81
|
content: string;
|
|
82
|
+
/** Server refused content: NUL byte detected (see handleFilesRead). */
|
|
83
|
+
binary?: boolean | undefined;
|
|
84
|
+
/** Server refused content: file exceeds the 2 MB display cap. */
|
|
85
|
+
tooLarge?: boolean | undefined;
|
|
81
86
|
error?: string | undefined;
|
|
87
|
+
sessionId?: string | undefined;
|
|
82
88
|
};
|
|
83
89
|
} | {
|
|
84
90
|
type: 'files.skeleton_result';
|
|
@@ -100,6 +106,7 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
100
106
|
filePath: string;
|
|
101
107
|
success: boolean;
|
|
102
108
|
error?: string | undefined;
|
|
109
|
+
sessionId?: string | undefined;
|
|
103
110
|
};
|
|
104
111
|
} | {
|
|
105
112
|
type: 'files.created';
|
|
@@ -107,6 +114,7 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
107
114
|
filePath: string;
|
|
108
115
|
success: boolean;
|
|
109
116
|
error?: string | undefined;
|
|
117
|
+
sessionId?: string | undefined;
|
|
110
118
|
};
|
|
111
119
|
} | {
|
|
112
120
|
type: 'files.deleted';
|
|
@@ -114,6 +122,7 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
114
122
|
filePath: string;
|
|
115
123
|
success: boolean;
|
|
116
124
|
error?: string | undefined;
|
|
125
|
+
sessionId?: string | undefined;
|
|
117
126
|
};
|
|
118
127
|
} | {
|
|
119
128
|
type: 'files.renamed';
|
|
@@ -122,6 +131,7 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
122
131
|
newPath: string;
|
|
123
132
|
success: boolean;
|
|
124
133
|
error?: string | undefined;
|
|
134
|
+
sessionId?: string | undefined;
|
|
125
135
|
};
|
|
126
136
|
} | {
|
|
127
137
|
type: 'files.moved';
|
|
@@ -130,6 +140,7 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
130
140
|
destPath: string;
|
|
131
141
|
success: boolean;
|
|
132
142
|
error?: string | undefined;
|
|
143
|
+
sessionId?: string | undefined;
|
|
133
144
|
};
|
|
134
145
|
} | WSCompletionResult | WSTodosUpdated | WSTodosCleared | {
|
|
135
146
|
type: 'tasks.updated';
|
|
@@ -212,6 +223,9 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
212
223
|
} | {
|
|
213
224
|
type: 'prefs.updated';
|
|
214
225
|
payload: Record<string, unknown>;
|
|
226
|
+
} | {
|
|
227
|
+
type: 'system_prompt.info';
|
|
228
|
+
payload: WSSystemPromptInfo;
|
|
215
229
|
} | {
|
|
216
230
|
type: 'techstack.job.started';
|
|
217
231
|
payload: {
|
|
@@ -333,6 +347,7 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
333
347
|
} | {
|
|
334
348
|
type: 'process.list';
|
|
335
349
|
payload: {
|
|
350
|
+
sessionId?: string | undefined;
|
|
336
351
|
processes: Array<{
|
|
337
352
|
pid: number;
|
|
338
353
|
command: string;
|
|
@@ -341,6 +356,7 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
341
356
|
status: 'running' | 'exited' | 'killed';
|
|
342
357
|
protected?: boolean | undefined;
|
|
343
358
|
background?: boolean | undefined;
|
|
359
|
+
sessionId?: string | undefined;
|
|
344
360
|
}>;
|
|
345
361
|
};
|
|
346
362
|
} | WSSideEffects | {
|
|
@@ -353,6 +369,15 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
353
369
|
behind: number;
|
|
354
370
|
ahead: number;
|
|
355
371
|
};
|
|
372
|
+
} | {
|
|
373
|
+
type: 'git.action_result';
|
|
374
|
+
payload: {
|
|
375
|
+
action: 'stage' | 'unstage' | 'discard' | 'commit';
|
|
376
|
+
ok: boolean;
|
|
377
|
+
paths?: string[] | undefined;
|
|
378
|
+
message?: string | undefined;
|
|
379
|
+
error?: string | undefined;
|
|
380
|
+
};
|
|
356
381
|
} | {
|
|
357
382
|
type: 'git.changes';
|
|
358
383
|
payload: {
|
|
@@ -363,6 +388,14 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
363
388
|
deleted: number;
|
|
364
389
|
staged: boolean;
|
|
365
390
|
}>;
|
|
391
|
+
/**
|
|
392
|
+
* Aggregate status per directory (repo-relative keys): the
|
|
393
|
+
* highest-ranked child status, computed server-side — replaces the
|
|
394
|
+
* old client-side prefix-scan heuristic in FileExplorer.
|
|
395
|
+
*/
|
|
396
|
+
dirs?: Record<string, string> | undefined;
|
|
397
|
+
/** Repo→project path prefix ('' when equal) — see repoRelativePrefix. */
|
|
398
|
+
repoPrefix?: string | undefined;
|
|
366
399
|
error?: string | undefined;
|
|
367
400
|
};
|
|
368
401
|
} | {
|
|
@@ -882,6 +915,154 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
882
915
|
payload: Record<string, unknown> & {
|
|
883
916
|
error?: string | undefined;
|
|
884
917
|
};
|
|
918
|
+
} | {
|
|
919
|
+
type: 'chimera.reports';
|
|
920
|
+
payload: {
|
|
921
|
+
sessionId: string;
|
|
922
|
+
isQuery?: boolean | undefined;
|
|
923
|
+
reports: Array<{
|
|
924
|
+
reportId: string;
|
|
925
|
+
sessionId?: string | undefined;
|
|
926
|
+
agentId?: string | undefined;
|
|
927
|
+
reviewedAt: string;
|
|
928
|
+
reviewerModel?: string | undefined;
|
|
929
|
+
source?: string | undefined;
|
|
930
|
+
reviewStatus?: 'success' | 'failed' | undefined;
|
|
931
|
+
lifecycleStatus: string;
|
|
932
|
+
counts?: {
|
|
933
|
+
critical: number;
|
|
934
|
+
high: number;
|
|
935
|
+
medium: number;
|
|
936
|
+
low: number;
|
|
937
|
+
} | undefined;
|
|
938
|
+
totalFindings: number;
|
|
939
|
+
fileCount?: number | undefined;
|
|
940
|
+
durationSeconds?: number | undefined;
|
|
941
|
+
cascadeDepth?: number | undefined;
|
|
942
|
+
evidenceStatus?: string | undefined;
|
|
943
|
+
hasActionableFindings?: boolean | undefined;
|
|
944
|
+
}>;
|
|
945
|
+
};
|
|
946
|
+
} | {
|
|
947
|
+
type: 'chimera.report.detail';
|
|
948
|
+
payload: {
|
|
949
|
+
report: {
|
|
950
|
+
id: string;
|
|
951
|
+
reviewedAt: string;
|
|
952
|
+
sessionId: string;
|
|
953
|
+
agentId: string;
|
|
954
|
+
reviewerModel: string;
|
|
955
|
+
source: string;
|
|
956
|
+
reviewStatus: 'success' | 'failed';
|
|
957
|
+
lifecycle: string;
|
|
958
|
+
files: Array<{
|
|
959
|
+
path: string;
|
|
960
|
+
status: string;
|
|
961
|
+
}>;
|
|
962
|
+
counts: {
|
|
963
|
+
critical: number;
|
|
964
|
+
high: number;
|
|
965
|
+
medium: number;
|
|
966
|
+
low: number;
|
|
967
|
+
};
|
|
968
|
+
totalFindings: number;
|
|
969
|
+
unparseableCount: number;
|
|
970
|
+
durationSeconds?: number | undefined;
|
|
971
|
+
rawText: string;
|
|
972
|
+
cascadeDepth?: number | undefined;
|
|
973
|
+
evidenceStatus?: string | undefined;
|
|
974
|
+
evidenceChecks?: Array<{
|
|
975
|
+
name: string;
|
|
976
|
+
command: string;
|
|
977
|
+
ok: boolean;
|
|
978
|
+
claimedExitCode?: number | null;
|
|
979
|
+
actualExitCode?: number | null;
|
|
980
|
+
}> | undefined;
|
|
981
|
+
} | null;
|
|
982
|
+
findings: Array<{
|
|
983
|
+
finding: {
|
|
984
|
+
id: string;
|
|
985
|
+
fingerprint: string;
|
|
986
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
987
|
+
source: string;
|
|
988
|
+
location?: {
|
|
989
|
+
file: string;
|
|
990
|
+
line?: number | undefined;
|
|
991
|
+
} | undefined;
|
|
992
|
+
category?: string | undefined;
|
|
993
|
+
confidence?: string | undefined;
|
|
994
|
+
verification?: {
|
|
995
|
+
status: string;
|
|
996
|
+
reason: string;
|
|
997
|
+
evidence?: string | undefined;
|
|
998
|
+
} | undefined;
|
|
999
|
+
title: string;
|
|
1000
|
+
description: string;
|
|
1001
|
+
suggestedFix?: string | undefined;
|
|
1002
|
+
createdAt: string;
|
|
1003
|
+
status: string;
|
|
1004
|
+
resolution?: {
|
|
1005
|
+
outcome: string;
|
|
1006
|
+
resolvedAt: string;
|
|
1007
|
+
resolvedBy: string;
|
|
1008
|
+
commitSha?: string | undefined;
|
|
1009
|
+
notes?: string | undefined;
|
|
1010
|
+
} | undefined;
|
|
1011
|
+
originReport: {
|
|
1012
|
+
reportId: string;
|
|
1013
|
+
sessionId: string;
|
|
1014
|
+
agentId: string;
|
|
1015
|
+
reviewerModel: string;
|
|
1016
|
+
};
|
|
1017
|
+
};
|
|
1018
|
+
events: Array<{
|
|
1019
|
+
id: string;
|
|
1020
|
+
findingId: string;
|
|
1021
|
+
eventType: string;
|
|
1022
|
+
fromStatus: string | null;
|
|
1023
|
+
toStatus: string;
|
|
1024
|
+
actorId: string;
|
|
1025
|
+
actorKind: string;
|
|
1026
|
+
timestamp: string;
|
|
1027
|
+
reason?: string | undefined;
|
|
1028
|
+
}>;
|
|
1029
|
+
}>;
|
|
1030
|
+
events: Array<{
|
|
1031
|
+
id: string;
|
|
1032
|
+
reportId: string;
|
|
1033
|
+
eventType: string;
|
|
1034
|
+
fromLifecycle: string | null;
|
|
1035
|
+
toLifecycle: string;
|
|
1036
|
+
actorId: string;
|
|
1037
|
+
actorKind: string;
|
|
1038
|
+
timestamp: string;
|
|
1039
|
+
reason?: string | undefined;
|
|
1040
|
+
}>;
|
|
1041
|
+
error?: string | undefined;
|
|
1042
|
+
};
|
|
1043
|
+
} | {
|
|
1044
|
+
type: 'chimera.report.updated';
|
|
1045
|
+
payload: {
|
|
1046
|
+
reportId: string;
|
|
1047
|
+
lifecycle?: string | undefined;
|
|
1048
|
+
success: boolean;
|
|
1049
|
+
error?: string | undefined;
|
|
1050
|
+
};
|
|
1051
|
+
} | {
|
|
1052
|
+
type: 'chimera.report.note_added';
|
|
1053
|
+
payload: {
|
|
1054
|
+
reportId: string;
|
|
1055
|
+
success: boolean;
|
|
1056
|
+
error?: string | undefined;
|
|
1057
|
+
};
|
|
1058
|
+
} | {
|
|
1059
|
+
type: 'chimera.finding.updated';
|
|
1060
|
+
payload: {
|
|
1061
|
+
findingId: string;
|
|
1062
|
+
status?: string | undefined;
|
|
1063
|
+
success: boolean;
|
|
1064
|
+
error?: string | undefined;
|
|
1065
|
+
};
|
|
885
1066
|
} | {
|
|
886
1067
|
type: 'cron.snapshot';
|
|
887
1068
|
payload: {
|
|
@@ -923,7 +1104,6 @@ export type WSServerMessage = WSSessionStart | WSSessionEnd | WSTextDelta | WSTh
|
|
|
923
1104
|
type: 'prompts.journal';
|
|
924
1105
|
payload: WSPromptsJournalPayload;
|
|
925
1106
|
};
|
|
926
|
-
export type BroadcastFn = (msg: WSServerMessage) => void;
|
|
927
1107
|
/** One entry from the hierarchical prompt journal (mirrors core `PromptJournalEntry`). */
|
|
928
1108
|
export interface WSPromptJournalEntry {
|
|
929
1109
|
id: string;
|
|
@@ -953,4 +1133,25 @@ export interface WSPromptsJournalPayload {
|
|
|
953
1133
|
entries: WSPromptJournalEntry[];
|
|
954
1134
|
error?: string | undefined;
|
|
955
1135
|
}
|
|
1136
|
+
/** One selectable identity-prompt size, with its upper-bound token estimate. */
|
|
1137
|
+
export interface WSSystemPromptVariantInfo {
|
|
1138
|
+
variant: 'lite' | 'default' | 'pro';
|
|
1139
|
+
label: string;
|
|
1140
|
+
hint: string;
|
|
1141
|
+
tokens: number;
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* Payload of `system_prompt.info`.
|
|
1145
|
+
*
|
|
1146
|
+
* `chosen` is false until the user has explicitly picked a variant at least
|
|
1147
|
+
* once — the config loader materializes a default variant for every config, so
|
|
1148
|
+
* this flag is the only way the browser can tell a fresh install from a
|
|
1149
|
+
* deliberate "Standard" and decide whether to open the picker unprompted.
|
|
1150
|
+
*/
|
|
1151
|
+
export interface WSSystemPromptInfo {
|
|
1152
|
+
current: 'lite' | 'default' | 'pro';
|
|
1153
|
+
chosen: boolean;
|
|
1154
|
+
variants: WSSystemPromptVariantInfo[];
|
|
1155
|
+
error?: string | undefined;
|
|
1156
|
+
}
|
|
956
1157
|
//# sourceMappingURL=server-message.d.ts.map
|
|
@@ -29,7 +29,7 @@ export interface WSSkillContent {
|
|
|
29
29
|
sourceUrl?: string;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
interface WSDesignKitSummary {
|
|
33
33
|
id: string;
|
|
34
34
|
name: string;
|
|
35
35
|
aesthetic: string;
|
|
@@ -199,4 +199,5 @@ export interface WSSkillsExported {
|
|
|
199
199
|
error?: string | undefined;
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
|
+
export {};
|
|
202
203
|
//# sourceMappingURL=skills-design.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/webui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.316.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Browser-based WebUI for WrongStack — React + Vite frontend. The WebSocket backend lives in the separate @wrongstack/webui-server package (extracted in PR #018b to remove the CLI -> @wrongstack/webui/server cross-package edge).",
|
|
6
6
|
"keywords": [
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"tailwind-merge": "^3.6.0",
|
|
77
77
|
"virtua": "^0.50.4",
|
|
78
78
|
"zustand": "^5.0.15",
|
|
79
|
-
"@wrongstack/
|
|
80
|
-
"@wrongstack/
|
|
81
|
-
"@wrongstack/
|
|
82
|
-
"@wrongstack/
|
|
83
|
-
"@wrongstack/
|
|
84
|
-
"@wrongstack/webui-protocol": "0.
|
|
85
|
-
"@wrongstack/webui-server": "0.
|
|
79
|
+
"@wrongstack/core": "0.316.1",
|
|
80
|
+
"@wrongstack/plugins": "0.316.1",
|
|
81
|
+
"@wrongstack/providers": "0.316.1",
|
|
82
|
+
"@wrongstack/tools": "0.316.1",
|
|
83
|
+
"@wrongstack/kanban": "0.316.1",
|
|
84
|
+
"@wrongstack/webui-protocol": "0.316.1",
|
|
85
|
+
"@wrongstack/webui-server": "0.316.1"
|
|
86
86
|
},
|
|
87
87
|
"optionalDependencies": {
|
|
88
88
|
"node-pty": "1.2.0-beta.14"
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"typescript": "^7.0.2",
|
|
105
105
|
"vite": "^8.2.2",
|
|
106
106
|
"vitest": "^4.1.11",
|
|
107
|
-
"@wrongstack/sdd": "0.
|
|
107
|
+
"@wrongstack/sdd": "0.316.1"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
110
|
"dev": "vite",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./chat-store-BiEXyguk.js";import{Ba as n,Ga as r,Ji as i,Ni as a,Ot as o,Pa as s,Qr as c,Si as l,Wt as u,Zt as d,_r as f,an as p,dt as m,ft as h,ga as g,ha as _,hr as v,jt as y,lt as b,ma as x,na as S,or as C,tn as w,ut as T,xi as E,yn as D,zi as O}from"./vendor-DZ9_OO6N.js";import"./i18n-BeHaHx3x.js";import{t as k}from"./ws-client-DXT4gi-N.js";import{t as A}from"./utils-BecmXwgG.js";import{E as j}from"./stores-CHaV9Mb9.js";import{n as M}from"./ui-store-3HoYrTu5.js";import{i as N}from"./view-navigation-C1UDTk5R.js";import{n as P}from"./Toaster-CcgCyzaU.js";import{n as F,t as I}from"./ModelPicker-BD-yKqK0.js";import{o as L}from"./index-CGMJmLO0.js";import{t as R}from"./roster-ws-Vj_HH49O.js";var z=e(r(),1),B=b(),V=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],H=[[`timeoutMs`,`Total timeout (ms)`],[`idleTimeoutMs`,`Idle timeout (ms)`],[`maxIterations`,`Max iterations`],[`maxToolCalls`,`Max tool calls`],[`maxTokens`,`Max tokens`],[`maxCostUsd`,`Max cost (USD)`]];function U(e){return`${e.provider}/${e.model}`}function W(e){let t=e.indexOf(`/`);return t<0?{provider:``,model:e}:{provider:e.slice(0,t),model:e.slice(t+1)}}function G(e){return Array.isArray(e)?e.join(`, `):``}function K(e){return[...new Set(e.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean))]}function q({initialConfig:e,systemProtected:t,saving:r,onSave:i,onCancel:a}){let{t:o}=n(),[s,c]=(0,z.useState)(()=>structuredClone(e)),l=F(!0),u=s.modelPolicy,f=(0,z.useMemo)(()=>(u?.allowed??[]).map(U),[u?.allowed]),p=(0,z.useMemo)(()=>(u?.fallbacks??[]).map(U),[u?.fallbacks]),m=e=>c(t=>({...t,...e})),h=(e,t)=>{let n=K(t);c(t=>{let r={...t};return n.length?r[e]=n:delete r[e],r})},g=(e,t)=>{c(n=>{let r={...n.budget??{}};t===``?delete r[e]:r[e]=Number(t);let i={...n};return Object.keys(r).length?i.budget=r:delete i.budget,i})},_=e=>{let t=e.map(W),n=new Set(e);c(e=>({...e,modelPolicy:{allowed:t,fallbacks:(e.modelPolicy?.fallbacks??[]).filter(e=>n.has(U(e))),strict:e.modelPolicy?.strict??!0}}))};return(0,B.jsxs)(`div`,{className:`space-y-4 rounded-lg border border-border bg-card/40 p-4`,children:[t&&(0,B.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-warning/30 bg-warning/5 p-2 text-[11px] text-muted-foreground`,children:[(0,B.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 text-warning`}),(0,B.jsx)(`span`,{children:o(`activity:runtimePolicy.protectedSystemAgentRequiredToolsAnd`)})]}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`h4`,{className:`text-xs font-semibold`,children:o(`activity:runtimePolicy.providerAndModelPolicy`)}),(0,B.jsx)(I,{candidates:l,provider:s.provider,value:s.model,placeholder:o(`activity:runtimePolicy.useProjectDefaultModel`),resetLabel:`Use project default`,onReset:()=>{c(e=>{let t={...e};return delete t.provider,delete t.model,t})},onPick:(e,t)=>{let n=`${t}/${e}`;m({provider:t,model:e}),u&&!f.includes(n)&&_([...f,n])}}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:!!u,onChange:e=>{if(e.target.checked){let e=s.provider&&s.model?[{provider:s.provider,model:s.model}]:l[0]?[{provider:l[0].provider,model:l[0].model}]:[];e.length&&m({modelPolicy:{allowed:e,strict:!0}})}else c(e=>{let t={...e};return delete t.modelPolicy,t})}}),o(`activity:runtimePolicy.restrictThisAgentToAnExplicit`)]}),u&&(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`span`,{className:`text-[10px] font-medium`,children:o(`activity:runtimePolicy.allowedModels`)}),(0,B.jsx)(L,{value:f,candidates:l,onChange:_,placeholder:o(`activity:runtimePolicy.addAllowedModel`),emptyHint:`At least one model is required`})]}),(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`span`,{className:`text-[10px] font-medium`,children:o(`activity:runtimePolicy.orderedFallbackChain`)}),(0,B.jsx)(L,{value:p,candidates:l,onChange:e=>{let t=[...new Set([...f,...e])];c(n=>({...n,modelPolicy:{allowed:t.map(W),fallbacks:e.map(W),strict:n.modelPolicy?.strict??!0}}))},placeholder:o(`activity:runtimePolicy.addFallbackModel`),emptyHint:`No fallback; primary failure stops the task`})]})]})]}),(0,B.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-3`,children:[[`tools`,`Tools`,`read_file, search, bash`],[`skillNames`,`Skills`,`security-check, browser`],[`allowedCapabilities`,`Capabilities`,`fs.read, fs.write`]].map(([e,t,n])=>(0,B.jsxs)(`label`,{className:`space-y-1 text-[10px]`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:t}),(0,B.jsx)(`textarea`,{value:G(s[e]),onChange:t=>h(e,t.target.value),placeholder:n,className:`h-20 w-full resize-y rounded border border-border bg-background p-2 font-mono`})]},e))}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`h4`,{className:`text-xs font-semibold`,children:o(`activity:runtimePolicy.workspaceAndIsolation`)}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`label`,{className:`space-y-1 text-[10px]`,children:[(0,B.jsx)(`span`,{children:o(`activity:runtimePolicy.projectRelativeWorkingDirectory`)}),(0,B.jsx)(`input`,{value:s.cwd??``,onChange:e=>m({cwd:e.target.value||void 0}),placeholder:o(`activity:runtimePolicy.packagesWebui`),className:`h-8 w-full rounded border border-border bg-background px-2 font-mono`})]}),(0,B.jsxs)(`label`,{className:`space-y-1 text-[10px]`,children:[(0,B.jsx)(`span`,{children:o(`activity:runtimePolicy.gitWorktreeIsolation`)}),(0,B.jsxs)(`select`,{value:String(s.worktree??`auto`),onChange:e=>m({worktree:e.target.value}),className:`h-8 w-full rounded border border-border bg-background px-2`,children:[(0,B.jsx)(`option`,{value:`auto`,children:o(`activity:runtimePolicy.automatic`)}),(0,B.jsx)(`option`,{value:`required`,children:o(`activity:runtimePolicy.required`)}),(0,B.jsx)(`option`,{value:`off`,children:o(`activity:runtimePolicy.off`)})]})]})]})]}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`h4`,{className:`text-xs font-semibold`,children:o(`activity:runtimePolicy.limits`)}),(0,B.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:H.map(([e,t])=>(0,B.jsxs)(`label`,{className:`space-y-1 text-[10px]`,children:[(0,B.jsx)(`span`,{children:t}),(0,B.jsx)(`input`,{type:`number`,min:`0`,step:e===`maxCostUsd`?`0.01`:`1`,value:s.budget?.[e]??``,onChange:t=>g(e,t.target.value),className:`h-8 w-full rounded border border-border bg-background px-2`})]},e))})]}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs font-semibold`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:!!s.availability,onChange:e=>{e.target.checked?m({availability:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,days:[1,2,3,4,5],start:`09:00`,end:`18:00`,mode:t?`advisory`:`enforce`}}):c(e=>{let t={...e};return delete t.availability,t})}}),o(`activity:runtimePolicy.workingHours`)]}),s.availability&&(0,B.jsxs)(`div`,{className:`space-y-2 rounded border border-border p-2`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:V.map((e,t)=>(0,B.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px]`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:s.availability?.days.includes(t)??!1,onChange:e=>{let n=s.availability;if(!n)return;let r=e.target.checked?[...new Set([...n.days,t])].sort():n.days.filter(e=>e!==t);m({availability:{...n,days:r}})}}),e]},e))}),(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-4`,children:[(0,B.jsx)(`input`,{value:s.availability.timezone,onChange:e=>m({availability:{...s.availability,timezone:e.target.value}}),placeholder:o(`activity:runtimePolicy.europeKiev`),className:`h-8 rounded border border-border bg-background px-2 text-[10px]`}),(0,B.jsx)(`input`,{type:`time`,value:s.availability.start,onChange:e=>m({availability:{...s.availability,start:e.target.value}}),className:`h-8 rounded border border-border bg-background px-2 text-[10px]`}),(0,B.jsx)(`input`,{type:`time`,value:s.availability.end,onChange:e=>m({availability:{...s.availability,end:e.target.value}}),className:`h-8 rounded border border-border bg-background px-2 text-[10px]`}),(0,B.jsxs)(`select`,{value:t?`advisory`:s.availability.mode??`enforce`,disabled:t,onChange:e=>m({availability:{...s.availability,mode:e.target.value}}),className:`h-8 rounded border border-border bg-background px-2 text-[10px]`,children:[(0,B.jsx)(`option`,{value:`enforce`,children:o(`activity:runtimePolicy.enforce`)}),(0,B.jsx)(`option`,{value:`advisory`,children:o(`activity:runtimePolicy.advisory`)})]})]})]})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(`button`,{type:`button`,disabled:r||!!(u&&u.allowed.length===0),onClick:()=>i(s),className:`rounded bg-primary px-3 py-1.5 text-xs text-primary-foreground disabled:opacity-50`,children:r?`Saving…`:`Save runtime policy`}),(0,B.jsx)(`button`,{type:`button`,onClick:a,className:`rounded border border-border px-3 py-1.5 text-xs hover:bg-accent`,children:o(`activity:runtimePolicy.cancel`)})]})]})}var J=[{id:`live`,icon:(0,B.jsx)(s,{className:`h-4 w-4`}),labelKey:`activity:agentRoster.tabLive`},{id:`catalog`,icon:(0,B.jsx)(_,{className:`h-4 w-4`}),labelKey:`activity:agentRoster.tabCatalog`},{id:`learning`,icon:(0,B.jsx)(g,{className:`h-4 w-4`}),labelKey:`activity:agentRoster.tabLearning`},{id:`customize`,icon:(0,B.jsx)(w,{className:`h-4 w-4`}),labelKey:`activity:agentRoster.tabCustomize`}],Y=[{role:`generic`,name:`Generic Project Agent`,summary:`Flexible template that can be cloned into independently learning project roles.`,tools:0,budget:{maxIterations:2500,maxToolCalls:7500}},{role:`audit-log`,name:`Audit Log`,summary:`Analyzes session logs, event streams, and system traces.`,tools:12,budget:{timeoutMs:108e5,maxIterations:2500,maxToolCalls:7500}},{role:`bug-hunter`,name:`Bug Hunter`,summary:`Scans code for bugs, code smells, and anti-patterns.`,tools:15,budget:{timeoutMs:18e6,maxIterations:4e3,maxToolCalls:1e4}},{role:`refactor-planner`,name:`Refactor Planner`,summary:`Analyzes code structure and produces phased refactoring plans.`,tools:14,budget:{timeoutMs:144e5,maxIterations:3e3,maxToolCalls:9e3}},{role:`security-scanner`,name:`Security Scanner`,summary:`Scans code, configs, and dependencies for security issues.`,tools:18,budget:{timeoutMs:18e6,maxIterations:4e3,maxToolCalls:1e4}},{role:`critic`,name:`Critic`,summary:`Evaluates decisions, plans, and implementations.`,tools:10,budget:{timeoutMs:108e5,maxIterations:2e3,maxToolCalls:5e3}},{role:`shadow-agent`,name:`Shadow Agent`,summary:`Background monitoring agent that watches fleet health.`,tools:8,budget:{timeoutMs:36e6,maxIterations:500,maxToolCalls:2e3}},{role:`executor`,name:`Executor`,summary:`General-purpose task executor for delegated work.`,tools:20,budget:{timeoutMs:72e5,maxIterations:1500,maxToolCalls:4e3}},{role:`chimera`,name:`Chimera`,summary:`Post-session code quality review of changed files.`,tools:10,budget:{timeoutMs:72e5,maxIterations:1e3,maxToolCalls:3e3}},{role:`researcher`,name:`Researcher`,summary:`Web research and data gathering specialist.`,tools:8,budget:{timeoutMs:72e5,maxIterations:1e3,maxToolCalls:3e3}},{role:`tech-stack`,name:`Tech Stack Validator`,summary:`Validates package/library/framework choices.`,tools:9,budget:{timeoutMs:72e5,maxIterations:1e3,maxToolCalls:3e3}},{role:`orchestrator`,name:`Orchestrator`,summary:`Coordinates multi-agent task execution.`,tools:12,budget:{timeoutMs:144e5,maxIterations:3e3,maxToolCalls:8e3}},{role:`supervisor`,name:`Supervisor`,summary:`Oversees subagent execution and handles escalations.`,tools:10,budget:{timeoutMs:144e5,maxIterations:2e3,maxToolCalls:6e3}},{role:`quality-gate`,name:`Quality Gate`,summary:`Enforces quality gates on implementations.`,tools:8,budget:{timeoutMs:72e5,maxIterations:1e3,maxToolCalls:3e3}},{role:`architect`,name:`Architect`,summary:`Makes design and architecture decisions.`,tools:14,budget:{timeoutMs:144e5,maxIterations:3e3,maxToolCalls:8e3}},{role:`prompt-engineer`,name:`Prompt Engineer`,summary:`Designs and optimizes system prompts.`,tools:8,budget:{timeoutMs:72e5,maxIterations:1e3,maxToolCalls:3e3}},{role:`mnemosyne`,name:`Mnemosyne`,summary:`Memory curator — reviews and maintains SAGE integrity.`,tools:6,budget:{timeoutMs:72e5,maxIterations:500,maxToolCalls:2e3}},{role:`autophase`,name:`AutoPhase`,summary:`Manages multi-phase autonomous task execution.`,tools:10,budget:{timeoutMs:144e5,maxIterations:2e3,maxToolCalls:6e3}}];function X({customStats:e,rosterLoading:t,onRefresh:r}){let{t:i}=n();return(0,B.jsx)(`div`,{className:`shrink-0 border-b border-border/70 bg-card/80 px-4 py-2.5`,children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2 flex-nowrap min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 overflow-hidden`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 shrink-0 rounded-lg bg-primary/10`,children:(0,B.jsx)(v,{className:`h-4 w-4 text-primary`})}),(0,B.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[(0,B.jsx)(`h1`,{className:`text-sm font-semibold truncate`,children:i(`activity:agentRoster.heading`)}),(0,B.jsx)(`p`,{className:`text-[10px] text-muted-foreground truncate`,children:i(`activity:agentRoster.headerSummary`,{customized:e.filter(e=>e.exists||e.hasIdentity||e.hasConfig||e.hasKnowledge).length,entries:e.reduce((e,t)=>e+t.entryCount,0)})})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[t&&(0,B.jsx)(C,{className:`h-4 w-4 animate-spin text-muted-foreground shrink-0`}),(0,B.jsxs)(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 rounded border border-border/50 px-2 py-1 text-[10px] hover:bg-accent transition-colors shrink-0 whitespace-nowrap`,title:i(`activity:agentRoster.refreshRosterData`),children:[(0,B.jsx)(D,{className:`h-3 w-3`}),` `,i(`common:action.refresh`)]})]})]})})}function Z({activeTab:e,onTabChange:t}){let{t:r}=n();return(0,B.jsx)(`div`,{className:`shrink-0 border-b border-border/50 bg-muted/20 px-3 flex gap-0`,children:J.map(n=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(n.id),className:A(`flex items-center gap-1.5 px-3 py-2 text-[10px] font-medium border-b-2 transition-colors`,e===n.id?`border-primary text-primary`:`border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground/30`),children:[n.icon,r(n.labelKey)]},n.id))})}function ee({populated:e,selectedRole:t,onSelectRole:r,onBulkOptimize:i,bulkOptimizing:a}){let{t:o}=n(),s=e.filter(e=>e.needsSummarization);return(0,B.jsxs)(`div`,{className:A(`flex flex-col min-h-0 min-w-0 overflow-hidden border-r border-border/50`,t?`w-80 shrink-0`:`flex-1`),children:[(0,B.jsxs)(`div`,{className:`shrink-0 px-3 py-2 border-b border-border/50`,children:[(0,B.jsxs)(`h3`,{className:`text-xs font-semibold flex items-center gap-1.5`,children:[(0,B.jsx)(E,{className:`h-3.5 w-3.5 text-brand-2`}),o(`activity:agentRoster.allRosterAgents`)]}),s.length>0&&(0,B.jsxs)(`div`,{className:`mt-2 flex flex-col gap-1.5 rounded border border-warning/40 bg-warning/10 px-2 py-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(T,{className:`h-3 w-3 text-warning shrink-0`}),(0,B.jsxs)(`span`,{className:`text-[10px] text-warning leading-tight`,children:[s.length,` agent`,s.length>1?`s`:``,` need`,s.length===1?`s`:``,` optimization`]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{let e=s[0];e&&r(e.role)},className:`ml-auto text-[9px] text-warning underline hover:text-warning/80 shrink-0`,children:o(`activity:agentRoster.review`)})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>i(s.map(e=>e.role)),disabled:a,className:`flex items-center justify-center gap-1 rounded bg-warning/20 border border-warning/40 px-2 py-1 text-[10px] font-medium text-warning hover:bg-warning/30 transition-colors disabled:opacity-50`,children:[a?(0,B.jsx)(C,{className:`h-3 w-3 animate-spin`}):(0,B.jsx)(T,{className:`h-3 w-3`}),a?o(`activity:agentRoster.optimizing`):o(`activity:agentRoster.optimizeAll`,{count:s.length})]})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2 space-y-1`,children:e.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e.role),className:A(`w-full text-left rounded-lg border px-3 py-2 transition-colors`,t===e.role?`border-primary/50 bg-primary/[0.06]`:`border-border/60 hover:border-primary/30`,e.needsSummarization&&t!==e.role&&`border-warning/40`),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`span`,{className:`text-xs font-semibold`,children:e.role}),(0,B.jsx)(`span`,{className:A(`text-[9px] tabular-nums`,e.learningEnabled?`text-success`:`text-muted-foreground`),children:e.learningEnabled?o(`activity:agentRoster.learning`):o(`activity:agentRoster.paused`)})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-[9px] text-muted-foreground`,children:[(0,B.jsxs)(`span`,{className:`tabular-nums`,children:[e.entryCount,` entries`]}),e.sessionCaptureCount>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsxs)(`span`,{className:`text-success tabular-nums`,children:[`+`,e.sessionCaptureCount]})]}),typeof e.directiveHitRate==`number`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsxs)(`span`,{className:A(`tabular-nums`,e.directiveHitRate>=.7?`text-success`:e.directiveHitRate<.4&&`text-warning`),title:`Share of directive applications that ended in a successful task`,children:[Math.round(e.directiveHitRate*100),`%`]})]}),e.lastCapture&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsx)(`span`,{children:new Date(e.lastCapture).toLocaleDateString()})]}),e.needsSummarization&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-warning font-medium`,children:[(0,B.jsx)(T,{className:`h-2.5 w-2.5`}),`optimize`]})]})]},e.role))})]})}var te={size:`buffer reached the size threshold`,"pending-skills":`directives are waiting to reach their skill`,disabled:`auto-optimization is off`,"learning-paused":`learning is paused for this agent`,"too-few-entries":`not enough directives yet`,"below-threshold":`below the threshold`,"cooling-down":`recently optimized — cooling down`};function ne({selectedRole:e,selectedStats:t,saving:r,setLearningEnabled:a,optimizing:s,runOptimize:c,autoStatus:l,consolidatedContent:d,loadConsolidated:f,setConsolidatedContent:p,skills:m,toggleSkillBody:h,toggleSkillPin:v,openSkill:y,retired:b,showRetired:x,setShowRetired:S,loadEntries:w,loadingEntries:D,reviewEntries:O,reviewDecisions:k,setReviewEntries:j,setReviewDecisions:M,applyReview:N,teachInput:P,setTeachInput:F,runTeach:I,teachFeedback:L}){let{t:R}=n();return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`h3`,{className:`text-base font-semibold`,children:e}),(0,B.jsx)(`div`,{className:`flex gap-1`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>a(e,!t.learningEnabled),disabled:r,className:A(`inline-flex items-center gap-1 rounded border px-2 py-1 text-[10px] transition-colors disabled:opacity-50`,t.learningEnabled?`border-success/40 text-success hover:bg-success/10`:`border-border/50 text-muted-foreground hover:bg-accent`),children:[(0,B.jsx)(E,{className:`h-3 w-3`}),` `,t.learningEnabled?R(`activity:agentRoster.learningOn`):R(`activity:agentRoster.learningPaused`)]})})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:R(`activity:agentRoster.entries`)}),(0,B.jsx)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:t.entryCount})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:R(`activity:agentRoster.size`)}),(0,B.jsxs)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:[t.totalBytes,`B`]})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:R(`activity:agentRoster.lifetimeCaptures`)}),(0,B.jsx)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:t.lifetimeCaptureCount})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:R(`activity:agentRoster.lastCapture`)}),(0,B.jsx)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:t.lastCapture?new Date(t.lastCapture).toLocaleDateString():`—`})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,title:`Share of directive applications that ended in a successful task. Blank until a directive has actually been exercised on one.`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:R(`activity:agentRoster.hitRate`)}),(0,B.jsxs)(`div`,{className:A(`text-lg font-mono font-semibold mt-0.5`,typeof t.directiveHitRate==`number`&&(t.directiveHitRate>=.7?`text-success`:t.directiveHitRate<.4&&`text-warning`)),children:[typeof t.directiveHitRate==`number`?`${Math.round(t.directiveHitRate*100)}%`:`—`,typeof t.appliedEntryCount==`number`&&t.appliedEntryCount>0&&(0,B.jsxs)(`span`,{className:`text-[9px] text-muted-foreground font-sans ml-1`,children:[`of `,t.appliedEntryCount]})]})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,title:`Directives that have never been exercised on a task. Anchors — exact commands, paths, package names — are what let the runtime tell that a directive was applied.`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:R(`activity:agentRoster.neverUsed`)}),(0,B.jsx)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:typeof t.deadEntryCount==`number`?t.deadEntryCount:`—`})]})]}),t.needsSummarization&&(0,B.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-warning bg-warning/10 rounded-lg px-3 py-2.5`,children:[(0,B.jsx)(o,{className:`h-4 w-4 shrink-0`}),(0,B.jsx)(`span`,{className:`flex-1`,children:R(`activity:agentRoster.learningsLimitExceeded`,{bytes:t.totalBytes.toLocaleString()})}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>c(e),disabled:s,className:`inline-flex items-center gap-1 rounded bg-warning/20 text-warning border border-warning/40 px-2.5 py-1 text-[10px] font-medium hover:bg-warning/30 transition-colors disabled:opacity-50 shrink-0`,children:[s?(0,B.jsx)(C,{className:`h-3 w-3 animate-spin`}):(0,B.jsx)(T,{className:`h-3 w-3`}),s?R(`activity:agentRoster.optimizing`):`Optimize Now`]})]}),(0,B.jsxs)(`div`,{className:`space-y-2 border border-border rounded-lg p-3 bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(u,{className:`h-4 w-4 text-primary`}),(0,B.jsx)(`span`,{className:`text-xs font-semibold`,children:R(`activity:agentRoster.optimizeLearnings`)})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>c(e),disabled:s||t.entryCount===0,className:`inline-flex items-center gap-1 rounded bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50`,title:t.entryCount===0?`No raw entries to optimize`:`Synthesize raw entries into a consolidated, narrowly-scoped document`,children:[s?(0,B.jsx)(C,{className:`h-3.5 w-3.5 animate-spin`}):(0,B.jsx)(T,{className:`h-3.5 w-3.5`}),s?R(`activity:agentRoster.optimizing`):`Optimize`]})]}),l&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px]`,children:[(0,B.jsx)(`span`,{className:A(`inline-block h-1.5 w-1.5 rounded-full`,l.enabled?l.eligible?`bg-warning`:`bg-success`:`bg-muted-foreground`)}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:l.enabled?l.eligible?`Queued automatically: ${te[l.reason]??l.reason}.`:`Automatic — ${te[l.reason]??l.reason}.`:`Automatic optimization is off — run it manually.`})]}),(0,B.jsxs)(`p`,{className:`text-[10px] text-muted-foreground leading-relaxed`,children:[`Synthesizes all `,t.entryCount,` raw entries into a single reviewed document — narrowly scoped to this agent's skills, preserving every fact but reducing context volume. The result replaces raw entries in the agent's prompt.`]}),t.isConsolidated&&t.consolidation&&(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground pt-1 border-t border-border/50`,children:[(0,B.jsx)(i,{className:`h-3 w-3 text-success`}),(0,B.jsxs)(`span`,{children:[`Consolidated`,` `,new Date(t.consolidation.consolidatedAt).toLocaleDateString(),` ·`,` `,t.consolidation.sourceBytes,`B →`,` `,t.consolidation.consolidatedBytes,`B`,t.consolidation.sourceEntryCount<t.entryCount&&(0,B.jsxs)(`span`,{className:`text-warning ml-1`,children:[`· `,t.entryCount-t.consolidation.sourceEntryCount,` `,R(`activity:agentRoster.newPending`)]})]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{d===null?f(e):p(null)},className:`ml-auto underline text-primary hover:text-primary/80`,children:d===null?R(`activity:agentRoster.viewAction`):`Hide`})]}),d!==null&&(0,B.jsxs)(`div`,{className:`mt-2 max-h-72 overflow-y-auto rounded border border-border/50 bg-background/50 p-2`,children:[(0,B.jsxs)(`div`,{className:`text-[10px] text-muted-foreground mb-1 font-medium`,children:[`Consolidated knowledge for `,e]}),(0,B.jsx)(`pre`,{className:`text-[10px] whitespace-pre-wrap font-sans leading-relaxed`,children:d||`(empty)`})]})]}),m&&m.length>0&&(0,B.jsxs)(`div`,{className:`space-y-2 border border-border rounded-lg p-3 bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(g,{className:`h-4 w-4 text-brand-2`}),(0,B.jsx)(`span`,{className:`text-xs font-semibold`,children:`Skills`}),(0,B.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[m.filter(e=>e.developed).length,` of `,m.length,` developed for this project`]})]}),(0,B.jsxs)(`p`,{className:`text-[10px] text-muted-foreground leading-relaxed`,children:[`A developed skill carries a project addendum injected right after the bundled skill body — the agent reads one skill, refined for this codebase. Only the highest-ranked few are loaded per spawn; `,(0,B.jsx)(`span`,{className:`text-primary`,children:`loaded`}),` marks those.`]}),(0,B.jsx)(`div`,{className:`space-y-1`,children:m.map(t=>(0,B.jsxs)(`div`,{className:`rounded border border-border/60`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>h(e,t.skill),disabled:!t.developed,className:A(`text-[11px] font-mono text-left flex-1 truncate`,t.developed?`text-primary hover:underline`:`text-muted-foreground cursor-default`),children:t.skill}),t.eager&&(0,B.jsx)(`span`,{className:`text-[9px] rounded bg-primary/15 text-primary px-1.5 py-0.5`,title:`Ranked high enough to be loaded into a spawn of this role`,children:`loaded`}),t.developed&&(0,B.jsx)(`span`,{className:`text-[9px] rounded bg-success/15 text-success px-1.5 py-0.5`,children:`developed`}),t.affinity&&(0,B.jsxs)(`span`,{className:`text-[9px] text-muted-foreground tabular-nums`,children:[t.affinity.learned>0&&`${t.affinity.learned} learned · `,t.affinity.succeeded,`✓/`,t.affinity.failed,`✗`]}),typeof t.score==`number`&&(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground tabular-nums`,title:`Project affinity score — higher is loaded first`,children:t.score.toFixed(2)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>v(e,t.skill,!t.affinity?.pinned),className:A(`text-[9px] rounded border px-1.5 py-0.5 transition-colors`,t.affinity?.pinned?`border-primary/50 text-primary`:`border-border/50 text-muted-foreground hover:bg-accent`),children:t.affinity?.pinned?`pinned`:`pin`})]}),y?.skill===t.skill&&(0,B.jsx)(`div`,{className:`max-h-60 overflow-y-auto border-t border-border/50 bg-background/50 p-2`,children:(0,B.jsx)(`pre`,{className:`text-[10px] whitespace-pre-wrap font-sans leading-relaxed`,children:y.content||`(empty)`})})]},t.skill))})]}),b&&b.length>0&&(0,B.jsxs)(`div`,{className:`space-y-2 border border-border rounded-lg p-3 bg-card`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>S(e=>!e),className:`flex w-full items-center gap-1.5 text-left`,children:[(0,B.jsx)(o,{className:`h-4 w-4 text-warning`}),(0,B.jsx)(`span`,{className:`text-xs font-semibold`,children:`Retired`}),(0,B.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[b.length,` directive`,b.length===1?``:`s`,` no longer injected`]}),(0,B.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:x?`hide`:`show`})]}),x&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`text-[10px] text-muted-foreground leading-relaxed`,children:`Each of these was exercised repeatedly and kept correlating with failed tasks, so it was removed from the buffer and scrubbed out of the distilled documents.`}),(0,B.jsx)(`ul`,{className:`space-y-1`,children:b.map(e=>(0,B.jsxs)(`li`,{className:`rounded border border-border/60 px-2 py-1.5 text-[10px] leading-relaxed`,children:[e.skill&&(0,B.jsx)(`span`,{className:`mr-1.5 rounded bg-muted px-1 py-0.5 font-mono text-[9px] text-muted-foreground`,children:e.skill}),(0,B.jsx)(`span`,{className:`text-muted-foreground line-through`,children:e.what})]},e.what))})]})]}),t.entryCount>0&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>w(e),disabled:D,className:`inline-flex items-center gap-1 rounded border border-border/50 px-3 py-1.5 text-xs hover:bg-accent transition-colors`,children:[D?(0,B.jsx)(C,{className:`h-3 w-3 animate-spin`}):(0,B.jsx)(_,{className:`h-3 w-3`}),`Review Learned Entries (`,t.entryCount,`)`]})}),O&&(0,B.jsxs)(`div`,{className:`space-y-2 border border-border rounded-lg p-3 bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`span`,{className:`text-xs font-medium`,children:[O.filter((e,t)=>k[t]!==`drop`).length,`/`,O.length,` kept`]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:N,disabled:r,className:`inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[10px] text-primary-foreground hover:bg-primary/90 transition-colors`,children:r?R(`activity:agentRoster.applying`):`Apply Selection`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{j(null),M({})},className:`inline-flex items-center gap-1 rounded border border-border/50 px-2 py-1 text-[10px] hover:bg-accent transition-colors`,children:R(`activity:agentRoster.cancel`)})]})]}),(0,B.jsx)(`div`,{className:`max-h-72 overflow-y-auto space-y-2`,children:O.map((e,t)=>{let n=k[t]??`keep`,r=e.length>200?e.slice(0,200)+`…`:e;return(0,B.jsx)(`div`,{className:A(`rounded-lg border p-2 transition-colors`,n===`drop`?`border-destructive/40 bg-destructive/5 opacity-60`:`border-border`),children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,B.jsx)(`pre`,{className:`text-[10px] whitespace-pre-wrap flex-1 leading-relaxed font-sans`,children:r}),(0,B.jsxs)(`div`,{className:`flex gap-1 shrink-0`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>M(e=>({...e,[t]:`keep`})),className:A(`px-2 py-1 text-[9px] rounded`,n===`keep`?`bg-success/20 text-success`:`bg-muted text-muted-foreground`),children:R(`activity:agentRoster.keep`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>M(e=>({...e,[t]:`drop`})),className:A(`px-2 py-1 text-[9px] rounded`,n===`drop`?`bg-destructive/20 text-destructive`:`bg-muted text-muted-foreground`),children:R(`activity:agentRoster.drop`)})]})]})},t)})})]})]}),(0,B.jsxs)(`div`,{className:`space-y-2 pt-4 border-t border-border`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 text-sm font-medium`,children:[(0,B.jsx)(g,{className:`h-4 w-4 text-brand-2`}),` `,R(`activity:agentRoster.teachThisAgent`)]}),(0,B.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:R(`activity:agentRoster.describeACommandPatternOrBehavior`)}),(0,B.jsx)(`textarea`,{className:`w-full h-20 text-xs p-2 bg-card border border-border rounded resize-y`,value:P,onChange:e=>F(e.target.value),placeholder:R(`activity:agentRoster.eGAlwaysUsePnpmForThisProject`)}),(0,B.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:I,disabled:!P.trim()||r,className:`inline-flex items-center gap-1 rounded bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50`,children:[(0,B.jsx)(g,{className:`h-3.5 w-3.5`}),` `,R(`activity:agentRoster.teach`)]}),L&&(0,B.jsx)(`span`,{className:A(`text-xs`,L.ok?`text-success`:`text-destructive`),children:L.msg})]})]})]})}function re({customStats:e,onRefresh:r}){let{t:i}=n(),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)({}),[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(!1),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)(null),[x,S]=(0,z.useState)(!1),[C,w]=(0,z.useState)(!1),[T,E]=(0,z.useState)(null),[D,O]=(0,z.useState)(null),[A,j]=(0,z.useState)(!1),[N,F]=(0,z.useState)(null),[I,L]=(0,z.useState)(null),B=(0,z.useMemo)(()=>[...e].sort((e,t)=>e.role.localeCompare(t.role)),[e]),V=(0,z.useMemo)(()=>a?B.find(e=>e.role===a):null,[a,B]),H=(0,z.useCallback)(async e=>{v(!0),c(null);try{let t=await R(`agent-roster.read-learned`,{role:e});c(t.entries??[]),u({})}catch{}v(!1)},[]),U=(0,z.useCallback)(async()=>{if(!a||!s)return;g(!0);let e=s.filter((e,t)=>l[t]!==`drop`).join(`
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
`);try{await R(`agent-roster.update-learned`,{role:a,content:e}),c(null),u({})}catch{}g(!1)},[a,s,l]),W=(0,z.useCallback)(async()=>{if(!(!a||!d.trim())){m(null),g(!0);try{let e=`> Taught ${new Date().toISOString().slice(0,10)}\n\n${d.trim()}`;(await R(`agent-roster.append-learned`,{role:a,content:e})).success?(m({ok:!0,msg:i(`activity:customRoster.behaviorSaved`)}),f(``),r()):m({ok:!1,msg:i(`activity:agentRoster.saveFailed`)})}catch(e){m({ok:!1,msg:e instanceof Error?e.message:i(`activity:agentRoster.failed`)})}g(!1)}},[r,a,d,i]),G=(0,z.useCallback)(async(e,t)=>{g(!0),m(null);try{let n=await R(`agent-roster.update-learning`,{role:e,enabled:t});if(n.error)throw Error(n.error);m({ok:!0,msg:i(t?`activity:agentRoster.learningResumed`:`activity:agentRoster.autoLearningPaused`)}),r()}catch(e){m({ok:!1,msg:e instanceof Error?e.message:i(`activity:agentRoster.policyUpdateFailed`)})}finally{g(!1)}},[r,i]),K=(0,z.useCallback)(async e=>{try{let t=await R(`agent-roster.auto-optimize-status`,{role:e}),n=t.roles?.find(t=>t.role===e);F(n?{enabled:t.policy?.enabled!==!1,eligible:n.eligible,reason:n.reason}:null)}catch{F(null)}},[]),q=(0,z.useCallback)(async e=>{try{let t=await R(`agent-roster.skills`,{role:e});E(t.skills??[])}catch{E([])}},[]),J=(0,z.useCallback)(async e=>{try{let t=await R(`agent-roster.quarantine`,{role:e});O(t.retired??[])}catch{O([])}},[]),Y=(0,z.useCallback)(async(e,t)=>{if(I?.skill===t){L(null);return}try{let n=await R(`agent-roster.read-skill`,{role:e,skill:t});L({skill:t,content:n.content??``})}catch{L({skill:t,content:``})}},[I]),X=(0,z.useCallback)(async(e,t,n)=>{try{await R(`agent-roster.pin-skill`,{role:e,skill:t,pinned:n}),await q(e)}catch{}},[q]),Z=(0,z.useCallback)(async e=>{try{let t=await R(`agent-roster.read-consolidated`,{role:e});b(t.isConsolidated?t.content:null)}catch{b(null)}},[]);return{selectedRole:a,reviewEntries:s,setReviewEntries:c,reviewDecisions:l,setReviewDecisions:u,teachInput:d,setTeachInput:f,teachFeedback:p,saving:h,loadingEntries:_,consolidatedContent:y,setConsolidatedContent:b,optimizing:x,bulkOptimizing:C,skills:T,retired:D,showRetired:A,setShowRetired:j,autoStatus:N,openSkill:I,populated:B,selectedStats:V,loadEntries:H,applyReview:U,runTeach:W,setLearningEnabled:G,toggleSkillBody:Y,toggleSkillPin:X,loadConsolidated:Z,runOptimize:(0,z.useCallback)(async e=>{S(!0),m(null);try{let n=await R(`agent-roster.consolidate`,{role:e});if(n.error)throw Error(n.error);if(n.rawEntryCount===0){m({ok:!1,msg:i(`activity:agentRoster.noRawEntries`)});return}if(n.consolidated){await r(),await Z(e),await q(e),await K(e),await J(e),m({ok:!0,msg:i(`activity:agentRoster.optimizedOk`)}),P.success(n.model?i(`activity:agentRoster.consolidatedWithModel`,{model:n.model}):i(`activity:agentRoster.consolidatedPlain`));return}if(n.emptySynthesis){m({ok:!1,msg:i(`activity:agentRoster.emptySynthesis`)}),P.error(i(`activity:agentRoster.optimizationEmptyToast`));return}let a=n.instruction;if(!a)throw Error(`No consolidation instruction generated`);let o=t.getState();o.addMessage({role:`user`,content:a}),o.setLoading(!0),k().sendMessage(a);let s=M.getState();s.setSidebarOpen(!1),s.setCurrentView(`chat`),m({ok:!0,msg:i(`activity:agentRoster.noActiveModelMsg`)}),P.info(i(`activity:agentRoster.noActiveModelToast`))}catch(e){m({ok:!1,msg:e instanceof Error?e.message:i(`activity:agentRoster.optimizationFailed`)}),P.error(e instanceof Error?e.message:i(`activity:agentRoster.optimizationFailed`))}finally{S(!1)}},[r,Z,q,K,J,i]),runBulkOptimize:(0,z.useCallback)(async e=>{if(e.length!==0){w(!0),m(null);try{let n=[],r=0,i=0,o=``,s=[];for(let t of e)try{let e=await R(`agent-roster.consolidate`,{role:t});e.error?(i++,o=e.error):e.consolidated?n.push(t):e.rawEntryCount===0?r++:e.emptySynthesis?(i++,o=`Model returned an empty result`):e.instruction?s.push({role:t,instruction:e.instruction}):(i++,o=`No consolidation produced`)}catch(e){i++,o=e instanceof Error?e.message:String(e)}if(a&&n.includes(a)&&await Z(a),s.length>0){let e=`Optimize the learned data for ${s.length} agent${s.length>1?`s`:``}. For each agent below, read its raw learned entries, synthesize them into a single narrowly-scoped document preserving every fact, and save the result to its consolidated.md file.\n\n`+s.map(e=>`## Agent: ${e.role}\n\n${e.instruction}`).join(`
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
`),n=t.getState();n.addMessage({role:`user`,content:e}),n.setLoading(!0),k().sendMessage(e);let r=M.getState();r.setSidebarOpen(!1),r.setCurrentView(`chat`)}if(n.length===0&&s.length===0){if(i>0){let t=r>0?` ${r} skipped.`:``,n=`Bulk consolidate failed for ${i} of ${e.length} agent${e.length>1?`s`:``}.${o?` Last error: ${o}`:``}${t}`;m({ok:!1,msg:n});return}let t=r>0?`Bulk optimize: ${r} skipped (no entries to optimize).`:`No agents had optimizable entries.`;m({ok:!0,msg:t}),P.info(t,6e3);return}let c=[];n.length>0&&c.push(`${n.length} consolidated`),s.length>0&&c.push(`${s.length} sent to chat`),r>0&&c.push(`${r} skipped`),i>0&&c.push(`${i} failed`);let l=`Bulk optimize: ${c.join(`, `)}.`;m({ok:i===0,msg:l}),n.length>0&&s.length===0?P.success(l,6e3):P.info(l,6e3)}catch(e){m({ok:!1,msg:e instanceof Error?e.message:i(`activity:agentRoster.bulkOptimizationFailed`)}),P.error(e instanceof Error?e.message:i(`activity:agentRoster.bulkOptimizationFailed`))}finally{w(!1)}}},[a,Z,i]),selectRole:(0,z.useCallback)(e=>{o(e),c(null),b(null),L(null),O(null),j(!1),q(e),K(e),J(e)},[q,K,J])}}function ie({customStats:e,onRefresh:t}){let{t:r}=n(),i=re({customStats:e,onRefresh:t});return i.populated.length===0?(0,B.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-muted-foreground`,children:(0,B.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,B.jsx)(E,{className:`h-10 w-10 mx-auto opacity-30`}),(0,B.jsx)(`p`,{className:`text-sm`,children:r(`activity:agentRoster.noSelfLearningDataYet`)}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:r(`activity:agentRoster.learningsEmpty`)})]})}):(0,B.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,B.jsx)(ee,{populated:i.populated,selectedRole:i.selectedRole,onSelectRole:i.selectRole,onBulkOptimize:i.runBulkOptimize,bulkOptimizing:i.bulkOptimizing}),(0,B.jsxs)(`div`,{className:`flex-1 min-h-0 min-w-0 overflow-y-auto p-4`,children:[!i.selectedRole&&(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:r(`activity:agentRoster.selectAnAgentToViewLearning`)}),i.selectedRole&&i.selectedStats&&(0,B.jsx)(ne,{selectedRole:i.selectedRole,selectedStats:i.selectedStats,saving:i.saving,setLearningEnabled:i.setLearningEnabled,optimizing:i.optimizing,runOptimize:i.runOptimize,autoStatus:i.autoStatus,consolidatedContent:i.consolidatedContent,loadConsolidated:i.loadConsolidated,setConsolidatedContent:i.setConsolidatedContent,skills:i.skills,toggleSkillBody:i.toggleSkillBody,toggleSkillPin:i.toggleSkillPin,openSkill:i.openSkill,retired:i.retired,showRetired:i.showRetired,setShowRetired:i.setShowRetired,loadEntries:i.loadEntries,loadingEntries:i.loadingEntries,reviewEntries:i.reviewEntries,reviewDecisions:i.reviewDecisions,setReviewEntries:i.setReviewEntries,setReviewDecisions:i.setReviewDecisions,applyReview:i.applyReview,teachInput:i.teachInput,setTeachInput:i.setTeachInput,runTeach:i.runTeach,teachFeedback:i.teachFeedback})]})]})}function ae({customStats:e,catalog:t}){let{t:r}=n(),i=(0,z.useCallback)(e=>r(`activity:rosterRoles.${e.role}.name`,{defaultValue:e.name}),[r]),a=(0,z.useCallback)(e=>r(`activity:rosterRoles.${e.role}.summary`,{defaultValue:e.summary}),[r]),[o,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(null),f=(0,z.useMemo)(()=>new Set(e.filter(e=>e.exists||e.hasIdentity||e.hasConfig||e.hasKnowledge).map(e=>e.role)),[e]),h=(0,z.useMemo)(()=>{if(!o.trim())return t;let e=o.toLowerCase();return t.filter(t=>t.role.includes(e)||i(t).toLowerCase().includes(e)||a(t).toLowerCase().includes(e))},[t,o,i,a]),g=(0,z.useCallback)(t=>e.find(e=>e.role===t),[e]),_=h;return(0,B.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,B.jsx)(`div`,{className:`shrink-0 px-3 py-2 border-b border-border/50`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-background px-3 py-1.5`,children:[(0,B.jsx)(p,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,B.jsx)(`input`,{type:`text`,value:o,onChange:e=>l(e.target.value),placeholder:r(`activity:agentRoster.searchPlaceholder`),className:`flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground/50`}),o&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>l(``),className:`text-muted-foreground hover:text-foreground`,children:(0,B.jsx)(m,{className:`h-3 w-3`})})]})}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:[(0,B.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-2`,children:_.map(e=>{let t=g(e.role),n=f.has(e.role),o=u===e.role;return(0,B.jsxs)(`div`,{className:A(`rounded-lg border bg-card transition-colors`,o?`border-primary/40 ring-1 ring-primary/20`:`border-border/60 hover:border-primary/30`),children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>d(o?null:e.role),className:`w-full text-left p-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,B.jsx)(x,{className:`h-4 w-4 shrink-0 text-primary`}),(0,B.jsx)(`span`,{className:`text-sm font-semibold truncate`,children:i(e)}),(0,B.jsxs)(`code`,{className:`text-[9px] text-muted-foreground font-mono shrink-0`,children:[`@`,e.role]})]}),(0,B.jsx)(S,{className:A(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform`,o&&`rotate-180`)})]}),(0,B.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-1 leading-relaxed line-clamp-2`,children:a(e)}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground tabular-nums`,children:r(`activity:agentRoster.toolsCount`,{count:e.tools})}),e.budget.maxIterations&&(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground tabular-nums`,children:r(`activity:agentRoster.maxItShort`,{count:e.budget.maxIterations,value:e.budget.maxIterations.toLocaleString()})}),n&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded bg-brand-2/10 px-1 py-0.5 text-[8px] text-brand-2 font-medium`,children:[(0,B.jsx)(c,{className:`h-2.5 w-2.5`}),` `,r(`activity:agentRoster.customizedBadge`)]}),t?.needsSummarization&&(0,B.jsx)(`span`,{className:`text-[9px] text-warning`,children:r(`activity:agentRoster.needsSummary`)})]})]}),o&&(0,B.jsxs)(`div`,{className:`border-t border-border/50 px-3 py-2 space-y-2`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,B.jsxs)(`div`,{className:`rounded bg-muted/30 p-1.5`,children:[(0,B.jsx)(`span`,{className:`text-[8px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.maxIterations`)}),(0,B.jsx)(`div`,{className:`text-xs font-mono mt-0.5`,children:e.budget.maxIterations?.toLocaleString()??`—`})]}),(0,B.jsxs)(`div`,{className:`rounded bg-muted/30 p-1.5`,children:[(0,B.jsx)(`span`,{className:`text-[8px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.timeout`)}),(0,B.jsx)(`div`,{className:`text-xs font-mono mt-0.5`,children:e.budget.timeoutMs?`${Math.round(e.budget.timeoutMs/6e4)}m`:`—`})]}),(0,B.jsxs)(`div`,{className:`rounded bg-muted/30 p-1.5`,children:[(0,B.jsx)(`span`,{className:`text-[8px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.maxToolCalls`)}),(0,B.jsx)(`div`,{className:`text-xs font-mono mt-0.5`,children:e.budget.maxToolCalls?.toLocaleString()??`—`})]}),(0,B.jsxs)(`div`,{className:`rounded bg-muted/30 p-1.5`,children:[(0,B.jsx)(`span`,{className:`text-[8px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.customizedBadge`)}),(0,B.jsx)(`div`,{className:`text-xs font-mono mt-0.5`,children:r(n?`common:action.yes`:`common:action.no`)})]})]}),n&&t&&(0,B.jsxs)(`div`,{className:`rounded bg-accent/30 p-2 space-y-1`,children:[(0,B.jsx)(`span`,{className:`text-[9px] font-medium text-muted-foreground`,children:r(`activity:agentRoster.projectCustomizations`)}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[9px]`,children:[t.hasIdentity&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,B.jsx)(c,{className:`h-2.5 w-2.5 text-primary`}),` identity.md`]}),t.entryCount>0&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,B.jsx)(E,{className:`h-2.5 w-2.5 text-brand-2`}),` `,r(`activity:agentRoster.learnedEntriesCount`,{count:t.entryCount})]}),t.hasConfig&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,B.jsx)(w,{className:`h-2.5 w-2.5 text-muted-foreground`}),` config.json`]}),t.sessionCaptureCount>0&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,B.jsx)(s,{className:`h-2.5 w-2.5 text-success`}),` `,r(`activity:agentRoster.sessionCapturesCount`,{count:t.sessionCaptureCount})]})]})]})]})]},e.role)})}),_.length===0&&(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-40 text-muted-foreground`,children:[(0,B.jsx)(p,{className:`h-8 w-8 mb-2 opacity-30`}),(0,B.jsx)(`p`,{className:`text-sm`,children:r(`activity:agentRoster.noAgentsMatch`,{query:o})})]})]}),(0,B.jsxs)(`div`,{className:`shrink-0 border-t border-border/50 px-3 py-2 text-[10px] text-muted-foreground flex items-center gap-2`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:t.length}),` `,r(`activity:agentRoster.footerRosterRoles`,{count:t.length})]}),(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsxs)(`span`,{className:`text-brand-2`,children:[(0,B.jsx)(`strong`,{children:f.size}),` `,r(`activity:agentRoster.footerCustomized`,{count:f.size})]}),(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:e.reduce((e,t)=>e+t.entryCount,0)}),` `,r(`activity:agentRoster.footerTotalLearned`,{count:e.reduce((e,t)=>e+t.entryCount,0)})]})]})]})}var Q={running:{led:`bg-success`,badge:`bg-success/12 text-success`,icon:(0,B.jsx)(`span`,{className:`led text-success led-pulse`}),color:`text-success`},completed:{led:`bg-success`,badge:`bg-success/12 text-success`,icon:(0,B.jsx)(i,{className:`h-3.5 w-3.5`}),color:`text-success`},failed:{led:`bg-destructive`,badge:`bg-destructive/15 text-destructive`,icon:(0,B.jsx)(O,{className:`h-3.5 w-3.5`}),color:`text-destructive`},timeout:{led:`bg-warning`,badge:`bg-muted text-muted-foreground`,icon:(0,B.jsx)(a,{className:`h-3.5 w-3.5`}),color:`text-warning`},stopped:{led:`bg-muted-foreground`,badge:`bg-muted text-muted-foreground`,icon:(0,B.jsx)(`span`,{className:`led text-muted-foreground`}),color:`text-muted-foreground`},idle:{led:`bg-muted-foreground`,badge:`bg-muted text-muted-foreground`,icon:(0,B.jsx)(`span`,{className:`led text-muted-foreground`}),color:`text-muted-foreground`}};function $(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m ${t%60}s`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function oe(e){if(e==null||!Number.isFinite(e)||e<=0)return`$0`;if(e<.01){let t=e.toFixed(5);return t===`0.00000`?`$0`:`$`+t.replace(/(\d)0+$/,`$1`).replace(/\.$/,``)}return`$`+e.toFixed(3)}function se({nowTick:e}){let{t}=n(),r=j(e=>e.agents),i=j(e=>e.leaderId),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(`all`),u=(0,z.useMemo)(()=>{let e=Array.from(r.values());return e.sort((e,t)=>{let n=e.status===`running`?0:1,r=t.status===`running`?0:1;return n===r?t.startedAt-e.startedAt:n-r}),s===`all`?e:s===`running`?e.filter(e=>e.status===`running`):s===`done`?e.filter(e=>e.status===`completed`):s===`failed`?e.filter(e=>e.status===`failed`||e.status===`timeout`):e},[r,s]),d=(0,z.useMemo)(()=>{let e=0,t=0,n=0;for(let i of r.values())i.status===`running`?e++:i.status===`completed`?t++:(i.status===`failed`||i.status===`timeout`)&&n++;return{running:e,completed:t,failed:n,total:r.size}},[r]),p=j(e=>e.clearFinishedAgents),m=a?u.find(e=>e.id===a):null,h=(0,z.useCallback)(e=>{let t=M.getState();e?(t.setInspectorFocusedAgentId(e),t.setInspectorTab(`agents`)):t.setInspectorTab(`fleet`),t.setInspectorOpen(!0)},[]);return u.length===0?(0,B.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-muted-foreground`,children:(0,B.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,B.jsx)(x,{className:`h-10 w-10 mx-auto opacity-30`}),(0,B.jsx)(`p`,{className:`text-sm`,children:t(`activity:agentRoster.noActiveFleetAgents`)}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:t(`activity:agentRoster.liveEmpty`)})]})}):(0,B.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:A(`flex flex-col min-h-0 min-w-0 overflow-hidden`,m?`w-80 shrink-0 border-r border-border/50`:`flex-1`),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 px-3 py-2 border-b border-border/50`,children:[[`all`,`running`,`done`,`failed`].map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>c(e),className:A(`rounded px-2 py-0.5 text-[10px] font-medium transition-colors`,s===e?`bg-primary/10 text-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),children:[e===`all`&&t(`activity:agentRoster.filterAll`,{count:d.total}),e===`running`&&t(`activity:agentRoster.filterRunning`,{count:d.running}),e===`done`&&t(`activity:agentRoster.filterDone`,{count:d.completed}),e===`failed`&&t(`activity:agentRoster.filterFailed`,{count:d.failed})]},e)),(0,B.jsx)(`span`,{className:`flex-1`}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>N(`agents`),className:`inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors`,title:t(`activity:agentRoster.openAgentsPanel`),children:[(0,B.jsx)(x,{className:`h-3 w-3`}),t(`activity:agentRoster.openAgentsPanel`)]}),d.completed+d.failed>0&&(0,B.jsxs)(`button`,{type:`button`,onClick:p,className:`inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors`,children:[(0,B.jsx)(y,{className:`h-2.5 w-2.5`}),` `,t(`activity:agentRoster.clear`)]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2 space-y-1`,children:u.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>o(a===e.id?null:e.id),className:A(`w-full text-left rounded-lg border px-3 py-2 transition-colors flex items-center gap-2`,a===e.id?`border-primary/50 bg-primary/[0.06]`:`border-border/60 hover:border-primary/30 hover:bg-primary/[0.03]`),children:[(0,B.jsx)(`span`,{className:A(`led shrink-0`,Q[e.status]?.led??`bg-muted-foreground`,e.status===`running`&&`led-pulse`)}),(0,B.jsx)(`span`,{className:`text-xs font-semibold min-w-0 truncate max-w-[7rem]`,children:e.name}),e.id===i&&(0,B.jsx)(l,{className:`h-3 w-3 shrink-0 text-warning`}),e.model&&(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground font-mono truncate max-w-[6rem] shrink-0`,children:e.model}),(0,B.jsxs)(`span`,{className:`text-[9px] text-muted-foreground tabular-nums shrink-0`,children:[e.iteration,`it · `,e.toolCalls,`t`]}),e.status===`running`&&(0,B.jsx)(`span`,{className:`text-[9px] text-primary tabular-nums shrink-0 ml-auto`,children:$(Date.now()-e.startedAt)}),e.status!==`running`&&(0,B.jsx)(`span`,{className:A(`text-[9px] tabular-nums shrink-0 ml-auto`,Q[e.status]?.color??`text-muted-foreground`),children:e.status}),e.costUsd>0&&(0,B.jsx)(`span`,{className:`text-[9px] text-success tabular-nums font-medium shrink-0`,children:oe(e.costUsd)}),e.status===`running`&&e.currentTool&&(0,B.jsxs)(`span`,{className:`text-[9px] text-primary font-mono truncate max-w-[6rem] shrink-0`,children:[`→ `,e.currentTool]})]},e.id))}),(0,B.jsxs)(`div`,{className:`shrink-0 border-t border-border/50 px-3 py-2 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:`font-medium tabular-nums`,children:d.total}),` `,t(`activity:agentRoster.agentsTotal`),(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsx)(`span`,{className:`text-success tabular-nums`,children:d.running}),` running`,(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsx)(`span`,{className:`tabular-nums`,children:d.completed}),` done`,d.failed>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,B.jsx)(`span`,{className:`text-destructive tabular-nums`,children:d.failed}),` failed`]}),(0,B.jsx)(`span`,{className:`flex-1`}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>h(),className:`inline-flex items-center gap-1 rounded border border-border/50 px-2 py-1 hover:bg-accent transition-colors`,children:[(0,B.jsx)(f,{className:`h-3 w-3`}),t(`activity:agentRoster.fleetInspector`)]})]})]}),m&&(0,B.jsx)(`div`,{className:`flex-1 min-h-0 min-w-0 overflow-y-auto p-4`,children:(0,B.jsx)(ce,{agent:m,nowTick:e})})]})}function ce({agent:e,nowTick:t}){let{t:r}=n(),i=e.status===`running`?$(t-e.startedAt):e.completedAt?$(e.completedAt-e.startedAt):`-`,a=Math.min(100,Math.max(0,e.ctxPct)),o=e.currentTool||e.lastTool,s=j(e=>e.leaderId);return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-primary/10`,children:(0,B.jsx)(x,{className:`h-5 w-5 text-primary`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-base font-semibold`,children:e.name}),e.id===s&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/30 bg-warning/10 px-1.5 py-0.5 text-[9px] font-medium text-warning`,children:[(0,B.jsx)(l,{className:`h-2.5 w-2.5`}),` `,r(`activity:agentRoster.leader`)]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:A(`led`,Q[e.status]?.led,e.status===`running`&&`led-pulse`)}),(0,B.jsx)(`span`,{children:e.status}),e.model&&(0,B.jsxs)(`span`,{children:[`· `,e.provider,`/`,e.model]}),(0,B.jsxs)(`span`,{children:[`· `,i]})]})]})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-4 gap-2`,children:[(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.iterations`)}),(0,B.jsx)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:e.iteration})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.toolCalls`)}),(0,B.jsx)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:e.toolCalls})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.cost`)}),(0,B.jsx)(`div`,{className:`text-lg font-mono font-semibold mt-0.5 text-success`,children:oe(e.costUsd)})]}),(0,B.jsxs)(`div`,{className:`rounded-lg border bg-card p-2`,children:[(0,B.jsx)(`span`,{className:`text-[9px] text-muted-foreground uppercase tracking-wider`,children:r(`activity:agentRoster.context`)}),(0,B.jsxs)(`div`,{className:`text-lg font-mono font-semibold mt-0.5`,children:[a,`%`]})]})]}),e.maxContext>0&&(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`div`,{className:`flex justify-between text-[10px]`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:r(`activity:agentRoster.contextWindow`)}),(0,B.jsxs)(`span`,{className:A(`tabular font-medium`,a>=85?`text-destructive`:a>=70?`text-warning`:`text-success`),children:[e.ctxTokens.toLocaleString(),` / `,e.maxContext.toLocaleString(),` tokens`]})]}),(0,B.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-muted`,children:(0,B.jsx)(`div`,{className:A(`h-full rounded-full transition-all`,a>=85?`bg-destructive`:a>=70?`bg-warning`:`bg-primary`),style:{width:`${Math.max(2,a)}%`}})})]}),o&&(0,B.jsxs)(`div`,{className:A(`flex items-center gap-2 rounded-lg border px-3 py-2`,e.status===`running`?`border-primary/30 bg-primary/[0.04]`:`border-border bg-muted/30`),children:[(0,B.jsx)(h,{className:A(`h-4 w-4`,e.status===`running`?`text-primary animate-pulse`:`text-muted-foreground`)}),(0,B.jsx)(`span`,{className:`text-sm font-mono`,children:e.currentTool??e.lastTool}),(0,B.jsx)(`span`,{className:`text-[10px] text-muted-foreground ml-auto`,children:e.currentTool?r(`activity:agentRoster.running`):`Last tool`})]}),e.error&&(0,B.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-3`,children:[(0,B.jsx)(`span`,{className:`text-[10px] font-semibold text-destructive uppercase tracking-wider`,children:r(`activity:agentRoster.error`)}),(0,B.jsx)(`p`,{className:`text-xs text-destructive/90 mt-1`,children:e.error.message})]}),e.toolLog.length>0&&(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`span`,{className:`text-[10px] font-semibold text-muted-foreground uppercase tracking-wider`,children:[`Tool Log (`,e.toolLog.length,`)`]}),(0,B.jsx)(`div`,{className:`space-y-0.5`,children:e.toolLog.slice(0,10).map((e,t)=>(0,B.jsxs)(`div`,{className:A(`flex items-center gap-2 rounded px-2 py-1 text-[10px] font-mono`,e.ok?`bg-muted/30`:`bg-destructive/5 border border-destructive/20`),children:[(0,B.jsx)(`span`,{className:A(`led shrink-0`,e.ok?`text-success`:`text-destructive`)}),(0,B.jsx)(`span`,{className:`truncate flex-1`,children:e.name}),(0,B.jsxs)(`span`,{className:`tabular text-muted-foreground`,children:[e.durationMs,`ms`]}),!e.ok&&(0,B.jsx)(`span`,{className:`text-destructive`,children:`✗`})]},`${e.name}-${t}`))})]}),e.budgetWarning&&(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-lg bg-warning/10 border border-warning/25 text-xs`,children:[(0,B.jsx)(T,{className:`h-3.5 w-3.5 text-warning shrink-0`}),(0,B.jsxs)(`span`,{className:`text-warning`,children:[`Budget: `,e.budgetWarning.kind,` limit (`,e.budgetWarning.used,`/`,e.budgetWarning.limit,`)`]})]})]})}function le(){let[e,t]=(0,z.useState)([]),[n,r]=(0,z.useState)(Y),[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)(null),c=(0,z.useCallback)(async()=>{a(!0),s(null);try{let e=await R(`agent-roster.list`,{});e.stats&&t(e.stats),e.catalog?.length&&r(e.catalog)}catch(e){s(e instanceof Error?e.message:`Failed to load roster`)}a(!1)},[]);return(0,z.useEffect)(()=>{c()},[c]),(0,z.useEffect)(()=>{let e=null,t=k().on(`agent-roster.updated`,()=>{e&&clearTimeout(e),e=setTimeout(()=>{e=null,c()},300)});return()=>{e&&clearTimeout(e),t()}},[c]),{customStats:e,catalog:n,rosterLoading:i,rosterError:o,loadRoster:c}}function ue({customStats:e,catalog:r,onRefresh:i}){let{t:a}=n(),[o,s]=(0,z.useState)(null),[l,f]=(0,z.useState)(null),[p,m]=(0,z.useState)(``),[h,g]=(0,z.useState)(null),[v,b]=(0,z.useState)(!1),[x,S]=(0,z.useState)(null),[C,T]=(0,z.useState)(!1),[D,O]=(0,z.useState)({name:``,role:``,baseRole:`generic`,purpose:``,taskTypes:``}),j=(0,z.useMemo)(()=>o?e.find(e=>e.role===o):null,[o,e]),N=(0,z.useMemo)(()=>{let e=r.find(e=>e.role===o);return e?.systemProtected??!e?.custom},[r,o]),P=(0,z.useCallback)(async(e,t)=>{b(!0),S(null),s(e);try{let n=await R(`agent-roster.read-customization`,{role:e});m(t===`config`?`${JSON.stringify(n.config??{},null,2)}\n`:n[t]??``),f(t),g(null)}catch(e){S(e instanceof Error?e.message:a(`activity:agentRoster.loadCustomizationFailed`))}finally{b(!1)}},[]),F=(0,z.useCallback)(async e=>{b(!0),S(null),s(e);try{let t=await R(`agent-roster.read-customization`,{role:e});g(t.config??{}),f(null)}catch(e){S(e instanceof Error?e.message:a(`activity:agentRoster.loadRuntimePolicyFailed`))}finally{b(!1)}},[]),I=(0,z.useCallback)(async e=>{if(o){b(!0),S(null);try{await R(`agent-roster.update-config`,{role:o,config:e}),g(null),i()}catch(e){S(e instanceof Error?e.message:a(`activity:agentRoster.runtimePolicySaveFailed`))}finally{b(!1)}}},[i,o]),L=(0,z.useCallback)(async()=>{if(!(!o||!l)){b(!0);try{let e={identity:`agent-roster.update-identity`,learned:`agent-roster.update-learned`,config:`agent-roster.update-config`},t={role:o};if(l===`config`)try{t.config=JSON.parse(p)}catch{S(`config.json must contain valid JSON`),b(!1);return}else t.content=p;await R(e[l],t),f(null),S(null),i()}catch(e){S(e instanceof Error?e.message:a(`activity:agentRoster.saveFailed`))}b(!1)}},[o,l,p,i]),V=(0,z.useCallback)(async()=>{if(o)try{let e=await R(`agent-roster.llm-improve`,{role:o,prompt:`Improve this agent for optimal project performance`});if(!e.instruction)throw Error(`No improvement instruction generated`);let n=t.getState();n.addMessage({role:`user`,content:e.instruction}),n.setLoading(!0),k().sendMessage(e.instruction);let r=M.getState();r.setSidebarOpen(!1),r.setCurrentView(`chat`)}catch(e){S(e instanceof Error?e.message:a(`activity:agentRoster.llmImprovementFailed`))}},[o]),H=(0,z.useCallback)(async e=>{if(window.confirm(a(`activity:agentRoster.resetConfirm`,{role:e})))try{await R(`agent-roster.reset`,{role:e}),s(null),i()}catch{}},[i]),U=(0,z.useCallback)(async()=>{let e=D.taskTypes.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean);b(!0),S(null);try{let t=await R(`agent-roster.create`,{name:D.name,role:D.role,baseRole:D.baseRole,purpose:D.purpose,taskTypes:e});T(!1),O({name:``,role:``,baseRole:`generic`,purpose:``,taskTypes:``}),s(t.role),i()}catch(e){S(e instanceof Error?e.message:a(`activity:agentRoster.agentCreationFailed`))}finally{b(!1)}},[D,i]),W=(0,z.useMemo)(()=>[...e].sort((e,t)=>{let n=+!!e.hasIdentity+ +(e.entryCount>0)+ +!!e.hasConfig;return+!!t.hasIdentity+ +(t.entryCount>0)+ +!!t.hasConfig-n}),[e]);return(0,B.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`w-80 shrink-0 border-r border-border/50 flex flex-col overflow-hidden`,children:[(0,B.jsx)(`div`,{className:`shrink-0 border-b border-border/50 px-3 py-2`,children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold`,children:[(0,B.jsx)(w,{className:`h-3.5 w-3.5`}),a(`activity:agentRoster.projectAgents`)]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{T(!0),s(null),g(null),S(null)},className:`rounded border border-primary/40 px-1.5 py-1 text-[9px] text-primary hover:bg-primary/10`,children:a(`activity:agentRoster.clone`)})]})}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2 space-y-1`,children:[W.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>{s(e.role),g(null),f(null)},className:A(`w-full text-left rounded-lg border px-3 py-2 transition-colors`,o===e.role?`border-primary/50 bg-primary/[0.06]`:`border-border/60 hover:border-primary/30`),children:[(0,B.jsx)(`div`,{className:`text-xs font-semibold`,children:e.role}),(0,B.jsxs)(`div`,{className:`flex gap-2 mt-0.5 text-[9px] text-muted-foreground`,children:[e.hasIdentity&&(0,B.jsx)(`span`,{className:`text-primary`,children:`id`}),e.entryCount>0&&(0,B.jsxs)(`span`,{className:`text-brand-2`,children:[e.entryCount,`e`]}),e.hasConfig&&(0,B.jsx)(`span`,{children:`cfg`})]})]},e.role)),W.length===0&&(0,B.jsx)(`div`,{className:`text-[10px] text-muted-foreground text-center py-4`,children:a(`activity:agentRoster.noCustomizations`)})]})]}),(0,B.jsxs)(`div`,{className:`flex-1 min-h-0 min-w-0 overflow-y-auto p-4`,children:[C&&(0,B.jsxs)(`div`,{className:`max-w-2xl space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-base font-semibold`,children:a(`activity:agentRoster.createOrCloneTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:a(`activity:agentRoster.createOrCloneHint`)})]}),(0,B.jsxs)(`label`,{className:`block space-y-1 text-xs`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:a(`activity:agentRoster.cloneFromRole`)}),(0,B.jsx)(`select`,{value:D.baseRole,onChange:e=>O(t=>({...t,baseRole:e.target.value})),className:`h-9 w-full rounded border border-border bg-card px-2`,children:[...r].sort((e,t)=>e.name.localeCompare(t.name)).map(e=>(0,B.jsxs)(`option`,{value:e.role,children:[e.name,` (`,e.role,`)`]},e.role))}),(0,B.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:a(`activity:agentRoster.cloneHint`)})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`label`,{className:`space-y-1 text-xs`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:a(`activity:agentRoster.displayName`)}),(0,B.jsx)(`input`,{value:D.name,onChange:e=>O(t=>({...t,name:e.target.value})),placeholder:a(`activity:agentRoster.abc`),className:`h-9 w-full rounded border border-border bg-card px-2`})]}),(0,B.jsxs)(`label`,{className:`space-y-1 text-xs`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:a(`activity:agentRoster.roleIdOptional`)}),(0,B.jsx)(`input`,{value:D.role,onChange:e=>O(t=>({...t,role:e.target.value})),placeholder:a(`activity:agentRoster.abcGeneratedFromName`),className:`h-9 w-full rounded border border-border bg-card px-2 font-mono`})]})]}),(0,B.jsxs)(`label`,{className:`block space-y-1 text-xs`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:a(`activity:agentRoster.purpose`)}),(0,B.jsx)(`textarea`,{value:D.purpose,onChange:e=>O(t=>({...t,purpose:e.target.value})),placeholder:a(`activity:agentRoster.descriptionPlaceholder`),className:`h-24 w-full resize-y rounded border border-border bg-card p-2`})]}),(0,B.jsxs)(`label`,{className:`block space-y-1 text-xs`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:a(`activity:agentRoster.taskTypesCommaOrOnePer`)}),(0,B.jsx)(`textarea`,{value:D.taskTypes,onChange:e=>O(t=>({...t,taskTypes:e.target.value})),placeholder:a(`activity:agentRoster.taskTypesPlaceholder`),className:`h-24 w-full resize-y rounded border border-border bg-card p-2`})]}),x&&(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:x}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:U,disabled:v||!D.name.trim()||D.purpose.trim().length<10||!D.taskTypes.trim(),className:`rounded bg-primary px-3 py-1.5 text-xs text-primary-foreground disabled:opacity-50`,children:v?a(`activity:agentRoster.creating`):`Clone Agent`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>T(!1),className:`rounded border border-border px-3 py-1.5 text-xs hover:bg-accent`,children:a(`activity:agentRoster.cancel`)})]})]}),!C&&!o&&(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:a(`activity:agentRoster.selectAnAgentToEditCustomizations`)}),!C&&o&&j&&(0,B.jsxs)(`div`,{className:`space-y-4 max-w-2xl`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`h3`,{className:`text-base font-semibold`,children:o}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:V,className:`inline-flex items-center gap-1 rounded border border-border/50 px-2 py-1 text-[10px] hover:bg-accent transition-colors`,children:[(0,B.jsx)(u,{className:`h-3 w-3 text-brand-2`}),` `,a(`activity:agentRoster.llmImprove`)]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>H(o),className:`inline-flex items-center gap-1 rounded border border-destructive/30 px-2 py-1 text-[10px] text-destructive hover:bg-destructive/10 transition-colors`,children:[(0,B.jsx)(y,{className:`h-3 w-3`}),` `,a(`activity:agentRoster.reset`)]})]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[j.hasIdentity&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-primary/10 px-2 py-1 text-[10px] text-primary`,children:[(0,B.jsx)(c,{className:`h-3 w-3`}),` identity.md`]}),j.hasConfig&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-2 py-1 text-[10px] text-muted-foreground`,children:[(0,B.jsx)(w,{className:`h-3 w-3`}),` config.json`]}),j.hasKnowledge&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-2 py-1 text-[10px] text-muted-foreground`,children:[(0,B.jsx)(E,{className:`h-3 w-3`}),` knowledge.json`]}),j.entryCount>0&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-brand-2/10 px-2 py-1 text-[10px] text-brand-2`,children:[(0,B.jsx)(_,{className:`h-3 w-3`}),` `,j.entryCount,` learned entries`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>P(o,`identity`),className:`inline-flex items-center gap-1 rounded border border-border/50 px-3 py-1.5 text-xs hover:bg-accent transition-colors`,children:[(0,B.jsx)(c,{className:`h-3.5 w-3.5`}),` `,a(`activity:agentRoster.editIdentityMd`)]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>P(o,`learned`),className:`inline-flex items-center gap-1 rounded border border-border/50 px-3 py-1.5 text-xs hover:bg-accent transition-colors`,children:[(0,B.jsx)(_,{className:`h-3.5 w-3.5`}),` `,a(`activity:agentRoster.editLearnedMd`)]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>F(o),className:`inline-flex items-center gap-1 rounded border border-primary/40 bg-primary/5 px-3 py-1.5 text-xs text-primary hover:bg-primary/10 transition-colors`,children:[(0,B.jsx)(d,{className:`h-3.5 w-3.5`}),` `,a(`activity:agentRoster.runtimePolicy`)]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>P(o,`config`),className:`inline-flex items-center gap-1 rounded border border-border/50 px-3 py-1.5 text-xs hover:bg-accent transition-colors`,children:[(0,B.jsx)(w,{className:`h-3.5 w-3.5`}),` `,a(`activity:agentRoster.editConfigJson`)]})]}),x&&(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:x}),h&&(0,B.jsx)(q,{initialConfig:h,systemProtected:N,saving:v,onSave:I,onCancel:()=>g(null)},o),l&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`span`,{className:`text-xs font-medium`,children:[l,`.md / `,l,`.json`]}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:L,disabled:v,className:`inline-flex items-center gap-1 rounded bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50`,children:a(v?`activity:agentRoster.saving`:`common:action.save`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>f(null),className:`inline-flex items-center gap-1 rounded border border-border/50 px-3 py-1.5 text-xs hover:bg-accent transition-colors`,children:a(`activity:agentRoster.cancel`)})]})]}),(0,B.jsx)(`textarea`,{className:`w-full h-48 font-mono text-xs p-2 bg-card border border-border rounded resize-y`,value:p,onChange:e=>m(e.target.value),placeholder:l===`config`?`{ "tools": [...], "budget": {...} }`:`# Project identity for ${o}\n\nDescribe this agent's role…`})]})]})]})]})}function de({className:e}){let{t}=n(),[r,i]=(0,z.useState)(`live`),[a,s]=(0,z.useState)(Date.now()),{customStats:c,catalog:l,rosterLoading:u,rosterError:d,loadRoster:f}=le();return(0,z.useEffect)(()=>{let e=setInterval(()=>{document.hidden||s(Date.now())},2e3);return()=>clearInterval(e)},[]),(0,B.jsxs)(`div`,{className:A(`flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden`,e),children:[(0,B.jsx)(X,{customStats:c,rosterLoading:u,onRefresh:f}),(0,B.jsx)(Z,{activeTab:r,onTabChange:i}),(0,B.jsxs)(`div`,{className:`flex min-h-0 min-w-0 w-full flex-1 overflow-hidden bg-background/50`,children:[d&&(0,B.jsxs)(`div`,{className:`flex items-center justify-center w-full text-destructive text-xs gap-2`,children:[(0,B.jsx)(o,{className:`h-4 w-4`}),d,(0,B.jsx)(`button`,{type:`button`,onClick:f,className:`underline`,children:t(`activity:agentRoster.retry`)})]}),r===`live`&&(0,B.jsx)(se,{nowTick:a}),r===`catalog`&&(0,B.jsx)(ae,{customStats:c,catalog:l}),r===`learning`&&(0,B.jsx)(ie,{customStats:c,onRefresh:f}),r===`customize`&&(0,B.jsx)(ue,{customStats:c,catalog:l,onRefresh:f})]})]})}export{de as AgentRosterView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ba as t,Ci as n,Ga as r,Nt as i,Ot as a,Pa as o,Yn as s,bi as c,kt as l,lt as u,oa as d,or as f,yt as p}from"./vendor-DZ9_OO6N.js";import"./i18n-BeHaHx3x.js";import{t as m}from"./ws-client-DXT4gi-N.js";import{R as h}from"./stores-CHaV9Mb9.js";import{b as g,c as _,x as v}from"./index-CGMJmLO0.js";var y=e(r(),1),b=u();function x(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m ${t%60}s`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function S(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function C(e){return e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function w(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function T(e){return e.includes(`error`)||e.includes(`fail`)?`text-destructive`:e.includes(`warn`)?`text-warning`:e.includes(`success`)||e.includes(`complete`)?`text-success`:`text-muted-foreground`}function E({icon:e,label:t,value:n,sub:r,color:i=`text-muted-foreground`}){return(0,b.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,b.jsx)(`div`,{className:`mt-0.5 ${i}`,children:e}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums text-foreground`,children:n}),(0,b.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t}),r?(0,b.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground/70`,children:r}):null]})]})}function D(){let{t:e}=t(),[r,u]=(0,y.useState)(null),[D,O]=(0,y.useState)([]),[k,A]=(0,y.useState)([]),[j,M]=(0,y.useState)(null),[N,P]=(0,y.useState)(!0),[F,I]=(0,y.useState)(!1),L=(0,y.useRef)(null),R=(0,y.useCallback)(async()=>{try{let e=await fetch(`/api/analytics/summary`);if(e.ok){let t=await e.json();u(t)}}catch{}},[]),z=(0,y.useCallback)(async()=>{try{let e=await fetch(`/api/analytics?limit=50`);if(e.ok){let t=await e.json();O(t.events)}}catch{}},[]),B=(0,y.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);if(e.ok){let t=await e.json();A(t)}}catch{}},[]),V=(0,y.useCallback)(async()=>{if(F)return;I(!0);let e=null,t=null;try{let n=m(h.getState().wsUrl);L.current=n,t=n.on(`stats.get`,n=>{let r=n.payload;M(r),I(!1),t?.(),e!==null&&clearTimeout(e)}),n.getStats({echoToChat:!1}),e=setTimeout(()=>{t?.(),I(!1)},8e3)}catch{t?.(),e!==null&&clearTimeout(e),I(!1)}},[F]);(0,y.useEffect)(()=>{let e=()=>{Promise.all([R(),z(),B(),V()]).finally(()=>P(!1))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[R,z,B,V]);let{totalAgents:H,activeAgents:U,totalToolCalls:W,totalIterations:G}=(0,y.useMemo)(()=>{let e=0,t=0,n=0,r=0;for(let i of k)for(let a of i.agents)e++,a.status===`running`&&t++,n+=a.toolCalls,r+=a.iterations;return{totalAgents:e,activeAgents:t,totalToolCalls:n,totalIterations:r}},[k]),K=(0,y.useMemo)(()=>r?Object.entries(r.categoryBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,8):[],[r]),q=(0,y.useMemo)(()=>r?Object.entries(r.eventBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,10):[],[r]),J=(0,y.useMemo)(()=>{if(!r)return 0;let e=0;for(let[t,n]of Object.entries(r.eventBreakdown))t.toLowerCase().includes(`error`)&&(e+=n);return e},[r]),Y=(0,y.useMemo)(()=>{if(!r)return 0;let e=0;for(let[t,n]of Object.entries(r.eventBreakdown))t.toLowerCase().includes(`warn`)&&(e+=n);return e},[r]),X=(0,y.useMemo)(()=>[...D].reverse(),[D]),Z=v(X,20);return N?(0,b.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,b.jsxs)(`div`,{className:`ws-surface flex items-center gap-2 rounded-xl px-4 py-3 text-sm text-muted-foreground`,children:[(0,b.jsx)(f,{className:`h-4 w-4 animate-spin text-primary`}),e(`activity:analytics.loading`)]})}):(0,b.jsx)(`div`,{ref:_(`analytics`),className:`h-full min-h-0 min-w-0 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,b.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-5`,children:[(0,b.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,b.jsx)(d,{className:`h-4 w-4 text-primary`}),(0,b.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:e(`activity:analytics.heading`)})]}),(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.autoRefresh`)})]})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-5`,children:[(0,b.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3`,children:[(0,b.jsx)(E,{icon:(0,b.jsx)(o,{className:`h-4 w-4`}),label:e(`activity:analytics.liveSessions`),value:k.length,color:`text-primary`}),(0,b.jsx)(E,{icon:(0,b.jsx)(p,{className:`h-4 w-4`}),label:e(`activity:analytics.agents`),value:`${U}/${H}`,sub:U>0?e(`activity:analytics.agentsActive`,{count:U}):void 0,color:`text-success`}),(0,b.jsx)(E,{icon:(0,b.jsx)(s,{className:`h-4 w-4`}),label:e(`activity:analytics.totalEvents`),value:r?.totalEvents??0,sub:e(`activity:analytics.categoriesSub`,{count:r?.uniqueCategories??0}),color:`text-warning`}),(0,b.jsx)(E,{icon:(0,b.jsx)(i,{className:`h-4 w-4`}),label:e(`activity:analytics.toolCalls`),value:W,sub:e(`activity:analytics.iterationsSub`,{count:G}),color:`text-success`}),(0,b.jsx)(E,{icon:(0,b.jsx)(c,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionCost`),value:j?C(j.cost):`—`,sub:j?e(`activity:analytics.tokensSub`,{input:S(j.usage.input),output:S(j.usage.output)}):void 0,color:`text-primary`}),(0,b.jsx)(E,{icon:(0,b.jsx)(n,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionDuration`),value:j?x(j.elapsedMs):`—`,sub:j?e(`activity:analytics.messagesSub`,{count:j.messages}):void 0,color:`text-muted-foreground`})]}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,b.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,b.jsx)(l,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.eventsByCategory`)]}),K.length===0?(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,b.jsx)(`div`,{className:`space-y-1.5`,children:K.map(([e,t])=>{let n=K[0]?.[1]??1,r=Math.round(t/n*100);return(0,b.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,b.jsx)(`span`,{className:`min-w-0 truncate text-foreground`,children:e}),(0,b.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,b.jsx)(`div`,{className:`h-full rounded-full bg-primary/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,b.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]}),(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,b.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,b.jsx)(d,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.topEvents`)]}),q.length===0?(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,b.jsx)(`div`,{className:`space-y-1.5`,children:q.map(([e,t])=>{let n=q[0]?.[1]??1,r=Math.round(t/n*100);return(0,b.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,9rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,b.jsx)(`span`,{className:`min-w-0 truncate ${T(e)}`,children:e}),(0,b.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,b.jsx)(`div`,{className:`h-full rounded-full bg-warning/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,b.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]})]}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,b.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,b.jsx)(c,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.activeSessionUsage`)]}),j?(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,b.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.provider`)}),(0,b.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:j.provider})]}),(0,b.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.model`)}),(0,b.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:j.model})]}),(0,b.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.inputTokens`)}),(0,b.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:S(j.usage.input)})]}),(0,b.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.outputTokens`)}),(0,b.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:S(j.usage.output)})]}),(0,b.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheRatio`)}),(0,b.jsxs)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:[(j.cache.hitRatio*100).toFixed(1),`%`]})]}),(0,b.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.filesRead`)}),(0,b.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:j.readFiles})]}),(j.cache.providers?.length??0)>0?(0,b.jsxs)(`div`,{className:`col-span-2 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:`Provider cache breakdown`}),(0,b.jsx)(`div`,{className:`mt-1.5 space-y-1`,children:j.cache.providers?.map(e=>(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 font-mono`,children:[(0,b.jsx)(`span`,{className:`text-foreground`,children:e.provider}),(0,b.jsxs)(`span`,{className:`tabular-nums text-success`,children:[(e.hitRatio*100).toFixed(1),`% hit`]}),(0,b.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[S(e.cacheRead),` read · `,S(e.cacheWrite),` write`]})]},e.provider))})]}):null]}):(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noSession`)})]}),(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,b.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,b.jsx)(a,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.healthErrors`)]}),(0,b.jsx)(`div`,{className:`space-y-2 text-xs`,children:r?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`flex justify-between`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.errorEvents`)}),(0,b.jsx)(`span`,{className:`tabular-nums text-destructive`,children:J})]}),(0,b.jsxs)(`div`,{className:`flex justify-between`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.warningEvents`)}),(0,b.jsx)(`span`,{className:`tabular-nums text-warning`,children:Y})]}),(0,b.jsxs)(`div`,{className:`flex justify-between`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheHitRate`)}),(0,b.jsx)(`span`,{className:`tabular-nums text-success`,children:j?`${(j.cache.hitRatio*100).toFixed(1)}%`:`—`})]}),(0,b.jsxs)(`div`,{className:`flex justify-between`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.totalCategories`)}),(0,b.jsx)(`span`,{className:`tabular-nums text-foreground`,children:r.uniqueCategories})]})]}):(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:e(`activity:analytics.waitingData`)})})]})]}),(0,b.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,b.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,b.jsx)(o,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.recentEvents`)]}),D.length===0?(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noRecentEvents`)}):(0,b.jsx)(`div`,{className:`max-h-64 space-y-1 overflow-y-auto`,children:Z.pageItems.map((e,t)=>(0,b.jsxs)(`div`,{className:`grid grid-cols-[4rem_minmax(0,7rem)_minmax(0,6rem)_minmax(0,1fr)] items-start gap-2 rounded px-2 py-1 text-xs hover:bg-muted/60`,children:[(0,b.jsx)(`span`,{className:`tabular-nums text-muted-foreground/70`,children:w(e.timestamp)}),(0,b.jsx)(`span`,{className:`min-w-0 truncate ${T(e.event)}`,children:e.event}),(0,b.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:e.category}),(0,b.jsx)(`span`,{className:`min-w-0 truncate text-foreground/80`,children:e.label??e.sessionId??``})]},`${e.timestamp}-${t}`))}),(0,b.jsx)(g,{page:Z.page,pageSize:Z.pageSize,totalItems:Z.totalItems,onPageChange:Z.setPage,compact:!0,itemLabel:`events`,className:`mt-3 rounded-lg border`})]})]})]})})}export{D as AnalyticsDashboard};
|