@wrongstack/webui 0.297.0 → 0.298.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AgentRosterView-C8j2NuD1.js +11 -0
- package/dist/assets/{AnalyticsDashboard-CkceglT6.js → AnalyticsDashboard-D2_HYmYw.js} +1 -1
- package/dist/assets/AudienceMemoryPanel-SzXptIQj.js +3 -0
- package/dist/assets/{ChangesView-DouwIaDk.js → ChangesView-D31wr7_h.js} +1 -1
- package/dist/assets/ChronicleDashboard-B7P4f1hr.js +1 -0
- package/dist/assets/CodeEditor-BRDwx8Y-.js +1 -0
- package/dist/assets/CodeMap-uabWaeJH.js +1 -0
- package/dist/assets/{CronJobsPanel-CAImDL8t.js → CronJobsPanel-C9shS0P2.js} +1 -1
- package/dist/assets/DeadCodeScanPanel-CHud_Ugp.js +2 -0
- package/dist/assets/{DebugDashboard-DLNPZIEI.js → DebugDashboard-DmqpGXnx.js} +1 -1
- package/dist/assets/{DesignGalleryView-D0azMq2e.js → DesignGalleryView-CnAHpKa1.js} +1 -1
- package/dist/assets/GoalView-DaptZIKr.js +1 -0
- package/dist/assets/KanbanView-DA5Ulb8C.js +3 -0
- package/dist/assets/MailboxDetailView-CQtHeWVs.js +1 -0
- package/dist/assets/MemoryManager-BWuSS0Pg.js +1 -0
- package/dist/assets/{ModelPicker-CN-UD3lc.js → ModelPicker-Dt0wCi90.js} +1 -1
- package/dist/assets/OfficeMapPanel-CUNRI3X7.js +4 -0
- package/dist/assets/{ProcessMonitor-ButM8C0T.js → ProcessMonitor-Dq760Vqm.js} +1 -1
- package/dist/assets/QueuePanel-ZcJliKcY.js +1 -0
- package/dist/assets/{RefreshDebugView-DVvWsh9A.js → RefreshDebugView-SivBV0LN.js} +1 -1
- package/dist/assets/SageTabs-CGrc4PuM.js +2 -0
- package/dist/assets/SddHub-oU47Hv8Y.js +2 -0
- package/dist/assets/SessionsDashboard-Dp-Mr844.js +1 -0
- package/dist/assets/SetupScreen-BWA_dTU0.js +1 -0
- package/dist/assets/SkillDetailView-DmRgd_uu.js +3 -0
- package/dist/assets/{SpecsView-BJs_okSx.js → SpecsView-CzYtHNbj.js} +1 -1
- package/dist/assets/TechStackView-p9PKj9pQ.js +1 -0
- package/dist/assets/{TerminalPanel-W2V0X7b9.js → TerminalPanel-BRSYloOD.js} +1 -1
- package/dist/assets/{Toaster-CbcX_Cou.js → Toaster-Bd6ckyrP.js} +1 -1
- package/dist/assets/{activity-CbbZyUMG.js → activity-Bo6DncWg.js} +1 -1
- package/dist/assets/{activity-C4z6-WoZ.js → activity-C34aPcFU.js} +1 -1
- package/dist/assets/{activity-B4Ngvkan.js → activity-CBdzUJQ_.js} +1 -1
- package/dist/assets/{activity-B8uejnae.js → activity-CLYyxeC6.js} +1 -1
- package/dist/assets/{activity-qoJ3grs0.js → activity-Cv_EIWjY.js} +1 -1
- package/dist/assets/{activity-B5MvPWYV.js → activity-Wr0_Gb8A.js} +1 -1
- package/dist/assets/{activity-D57y5l1T.js → activity-kCY0dGRC.js} +1 -1
- package/dist/assets/{button-uGqXvobk.js → button-Clh96jMK.js} +1 -1
- package/dist/assets/chat-store-CWhuSNod.js +17 -0
- package/dist/assets/{codemap-activity-store-DP3mCZu1.js → codemap-activity-store-C1XWbXeZ.js} +1 -1
- package/dist/assets/codemap-index-store-DDT3gP6t.js +1 -0
- package/dist/assets/common-BfVFjVhf.js +1 -0
- package/dist/assets/common-C5hY-d_0.js +1 -0
- package/dist/assets/{dialog-CT1PTjzK.js → dialog-DYJUM0p1.js} +1 -1
- package/dist/assets/{empty-state-CdyXy96A.js → empty-state-BV-Y8c35.js} +1 -1
- package/dist/assets/{i18n-1BkaqMgr.js → i18n-DOuSY1L8.js} +2 -2
- package/dist/assets/index-C09Opuro.css +1 -0
- package/dist/assets/index-DxZTscTk.js +132 -0
- package/dist/assets/{input-B-VCX2sG.js → input-CW-Yw2Wu.js} +1 -1
- package/dist/assets/{mailbox-store-DVoNbOZr.js → mailbox-store-_8voaug1.js} +1 -1
- package/dist/assets/markdown-sSmz-Ua_.js +44 -0
- package/dist/assets/{progress-ring-CFOvGxw7.js → progress-ring-DPV94fM-.js} +1 -1
- package/dist/assets/{roster-ws-DXm0krqH.js → roster-ws-q8Cp6us7.js} +1 -1
- package/dist/assets/session-store-D4JWBP5w.js +1 -0
- package/dist/assets/settings-B9EPDhAL.js +1 -0
- package/dist/assets/{settings-DEmKlLmn.js → settings-BBNOO9wC.js} +1 -1
- package/dist/assets/settings-BoXoFVdx.js +1 -0
- package/dist/assets/settings-CkXKHC77.js +1 -0
- package/dist/assets/settings-DWIDXI2K.js +1 -0
- package/dist/assets/settings-r_KOGrbF.js +1 -0
- package/dist/assets/settings-tyKsHhya.js +1 -0
- package/dist/assets/{shared-jvJxtKc5.js → shared-DidGznBo.js} +1 -1
- package/dist/assets/stores-CpZiOiOP.js +7 -0
- package/dist/assets/ui-store-C-oyG_br.js +1 -0
- package/dist/assets/useWebSocket-BTXT0rOW.js +28 -0
- package/dist/assets/{utils-CN2sfDVP.js → utils-DxDx8yib.js} +1 -1
- package/dist/assets/{vendor-2VBBgNb5.js → vendor-BTDGplXK.js} +28 -28
- package/dist/assets/{view-navigation-Cgy5xh9q.js → view-navigation-BRtuAwZo.js} +1 -1
- package/dist/assets/ws-client-DqIqzkfU.js +1 -0
- package/dist/components/ChatInput/refine-panel-host.d.ts +9 -1
- package/dist/components/DeadCodeScanPanel/DeadCodeScanPanel.d.ts +1 -3
- package/dist/components/PanelSuspense.d.ts +8 -0
- package/dist/components/SettingsPanel/DisplaySection.d.ts +20 -0
- package/dist/components/ViewRouter.d.ts +12 -0
- package/dist/components/WorkbenchTopbar.d.ts +53 -0
- package/dist/components/codemap-model.d.ts +2 -0
- package/dist/hooks/useViewport.d.ts +38 -0
- package/dist/hooks/useWebSocket.d.ts +1 -0
- package/dist/index.html +24 -25
- package/dist/index.js +55560 -54349
- package/dist/lib/view-navigation.d.ts +1 -1
- package/dist/lib/ws-client.d.ts +16 -8
- package/dist/providers.json +10 -0
- package/dist/stores/chat-store.d.ts +36 -3
- package/dist/stores/config-store.d.ts +0 -2
- package/dist/stores/local-prefs.d.ts +20 -0
- package/dist/stores/session-store.d.ts +3 -0
- package/dist/stores/ui-store.d.ts +8 -1
- package/dist/types/client-message.d.ts +1 -0
- package/dist/types/connections.d.ts +7 -1
- package/dist/types/system.d.ts +4 -0
- package/package.json +8 -7
- package/dist/App.d.ts.map +0 -1
- package/dist/assets/AgentRosterView-Cje2NBtU.js +0 -11
- package/dist/assets/AudienceMemoryPanel-DB-8ISNP.js +0 -3
- package/dist/assets/ChronicleDashboard-B4Khm6hu.js +0 -1
- package/dist/assets/CodeEditor-CrKbA5s8.js +0 -1
- package/dist/assets/CodeMap-Dz8yNlUe.js +0 -1
- package/dist/assets/DeadCodeScanPanel-C5ehBTQF.js +0 -2
- package/dist/assets/GoalView-gtQRK78W.js +0 -1
- package/dist/assets/KanbanView-BXKe19EI.js +0 -3
- package/dist/assets/LazyMarkdown-BGwFjYKr.js +0 -3
- package/dist/assets/MailboxDetailView-D4fXipos.js +0 -1
- package/dist/assets/MemoryManager-D_rquas9.js +0 -1
- package/dist/assets/OfficeMapPanel-CJFrTNmg.js +0 -4
- package/dist/assets/QueuePanel-C5oihwYM.js +0 -1
- package/dist/assets/SageTabs-C9vAgvCD.js +0 -2
- package/dist/assets/SddHub-D_nsWjuM.js +0 -2
- package/dist/assets/SessionsDashboard-DdwU3Ma5.js +0 -1
- package/dist/assets/SetupScreen-CQCfLdPI.js +0 -1
- package/dist/assets/SkillDetailView-mVxi-9jo.js +0 -3
- package/dist/assets/TechStackView-BZ4M7TYc.js +0 -1
- package/dist/assets/chat-store-CM1dMeuY.js +0 -17
- package/dist/assets/codemap-index-store-DyAe3ZYJ.js +0 -1
- package/dist/assets/common-D8_r1x8x.js +0 -1
- package/dist/assets/common-suUxW9sA.js +0 -1
- package/dist/assets/index-BPfIz78e.js +0 -131
- package/dist/assets/index-BlceaIyu.css +0 -1
- package/dist/assets/markdown-L6DLSM7f.js +0 -44
- package/dist/assets/session-store-BsNYnfOc.js +0 -1
- package/dist/assets/settings-C5F2tQ7C.js +0 -1
- package/dist/assets/settings-Cdk8i_p6.js +0 -1
- package/dist/assets/settings-D6wFOw5n.js +0 -1
- package/dist/assets/settings-DCEOkxYE.js +0 -1
- package/dist/assets/settings-DsflqNn0.js +0 -1
- package/dist/assets/settings-skShEZ2B.js +0 -1
- package/dist/assets/stores-mpa0202y.js +0 -6
- package/dist/assets/ui-store-CS-njcmT.js +0 -1
- package/dist/assets/useWebSocket-Dh3aAFDE.js +0 -28
- package/dist/assets/ws-client-WVGn8ORh.js +0 -1
- package/dist/components/AgentOfficeDetails.d.ts.map +0 -1
- package/dist/components/AgentOfficeView/model.d.ts.map +0 -1
- package/dist/components/AgentOfficeView.d.ts.map +0 -1
- package/dist/components/AgentRosterCatalogTab.d.ts.map +0 -1
- package/dist/components/AgentRosterChrome.d.ts.map +0 -1
- package/dist/components/AgentRosterLiveTab.d.ts.map +0 -1
- package/dist/components/AgentRosterSelfLearningTab.d.ts.map +0 -1
- package/dist/components/AgentRosterView.d.ts.map +0 -1
- package/dist/components/AgentRuntimePolicyEditor.d.ts.map +0 -1
- package/dist/components/AgentTranscript.d.ts.map +0 -1
- package/dist/components/AgentsMonitor.d.ts.map +0 -1
- package/dist/components/AgentsPage/format.d.ts.map +0 -1
- package/dist/components/AgentsPage.d.ts.map +0 -1
- package/dist/components/AnalyticsDashboard.d.ts.map +0 -1
- package/dist/components/AudienceMemoryPanel.d.ts.map +0 -1
- package/dist/components/AutonomyPicker.d.ts.map +0 -1
- package/dist/components/AvailabilityCalendarEditor.d.ts.map +0 -1
- package/dist/components/BoardView.d.ts.map +0 -1
- package/dist/components/ChangesView.d.ts.map +0 -1
- package/dist/components/ChatInput/code-detect.d.ts.map +0 -1
- package/dist/components/ChatInput/draft-token-counter.d.ts.map +0 -1
- package/dist/components/ChatInput/file-mention-picker.d.ts.map +0 -1
- package/dist/components/ChatInput/image-attach-control.d.ts.map +0 -1
- package/dist/components/ChatInput/image-attachments.d.ts.map +0 -1
- package/dist/components/ChatInput/queued-messages.d.ts.map +0 -1
- package/dist/components/ChatInput/refine-panel-host.d.ts.map +0 -1
- package/dist/components/ChatInput/slash-commands.d.ts.map +0 -1
- package/dist/components/ChatInput/slash-popup.d.ts.map +0 -1
- package/dist/components/ChatInput/slash-routing.d.ts.map +0 -1
- package/dist/components/ChatInput/stop-controls.d.ts.map +0 -1
- package/dist/components/ChatInput/use-paste-drop.d.ts.map +0 -1
- package/dist/components/ChatInput.d.ts.map +0 -1
- package/dist/components/ChatView/ThinkingBubble.d.ts.map +0 -1
- package/dist/components/ChatView/index.d.ts.map +0 -1
- package/dist/components/ChatView/utils.d.ts.map +0 -1
- package/dist/components/ChatView.d.ts.map +0 -1
- package/dist/components/CheckpointTimeline.d.ts.map +0 -1
- package/dist/components/ChipMultiSelect.d.ts.map +0 -1
- package/dist/components/ChronicleDashboard.d.ts.map +0 -1
- package/dist/components/ChroniclePipelineStrip.d.ts.map +0 -1
- package/dist/components/CodeEditor.d.ts.map +0 -1
- package/dist/components/CodeMap.d.ts.map +0 -1
- package/dist/components/CodeMapActivityDrawer.d.ts.map +0 -1
- package/dist/components/CodeMapActivityHelpers.d.ts.map +0 -1
- package/dist/components/CodeMapActivityStreamPanel.d.ts.map +0 -1
- package/dist/components/CodeMapCanvasSurface.d.ts.map +0 -1
- package/dist/components/CodeMapCanvasToolbar.d.ts.map +0 -1
- package/dist/components/CodeMapConfig.d.ts.map +0 -1
- package/dist/components/CodeMapDirectoryTree.d.ts.map +0 -1
- package/dist/components/CodeMapFlowState.d.ts.map +0 -1
- package/dist/components/CodeMapHeader.d.ts.map +0 -1
- package/dist/components/CodeMapLiveOverlay.d.ts.map +0 -1
- package/dist/components/CodeMapRelationInspector.d.ts.map +0 -1
- package/dist/components/CodeMapRelations.d.ts.map +0 -1
- package/dist/components/CodeMapSearchResults.d.ts.map +0 -1
- package/dist/components/CodeMapSelectedNodeSummary.d.ts.map +0 -1
- package/dist/components/CodeMapTreeSidebar.d.ts.map +0 -1
- package/dist/components/CodeMapVisuals.d.ts.map +0 -1
- package/dist/components/CollabPanel.d.ts.map +0 -1
- package/dist/components/CommandPalette/export-utils.d.ts.map +0 -1
- package/dist/components/CommandPalette/index.d.ts.map +0 -1
- package/dist/components/CommandPalette.d.ts.map +0 -1
- package/dist/components/ConfirmDialog.d.ts.map +0 -1
- package/dist/components/ConfirmModal.d.ts.map +0 -1
- package/dist/components/ConnectionBanner.d.ts.map +0 -1
- package/dist/components/ContextBar.d.ts.map +0 -1
- package/dist/components/ContextBreakdownModal.d.ts.map +0 -1
- package/dist/components/ContextDashboard.d.ts.map +0 -1
- package/dist/components/ContextMemoryMonitor.d.ts.map +0 -1
- package/dist/components/ContextModePicker.d.ts.map +0 -1
- package/dist/components/CostChip.d.ts.map +0 -1
- package/dist/components/CronJobsPanel.d.ts.map +0 -1
- package/dist/components/CronTrigger.d.ts.map +0 -1
- package/dist/components/CustomRosterPanel.d.ts.map +0 -1
- package/dist/components/DeadCodeScanPanel/DeadCodeScanPanel.d.ts.map +0 -1
- package/dist/components/DebugDashboard.d.ts.map +0 -1
- package/dist/components/DependencyGraph.d.ts.map +0 -1
- package/dist/components/DesignGalleryView.d.ts.map +0 -1
- package/dist/components/DiffView.d.ts.map +0 -1
- package/dist/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/FallbackEditor.d.ts.map +0 -1
- package/dist/components/FileActivityDrawer.d.ts.map +0 -1
- package/dist/components/FileExplorer.d.ts.map +0 -1
- package/dist/components/FilePicker.d.ts.map +0 -1
- package/dist/components/FileReferenceChip.d.ts.map +0 -1
- package/dist/components/FleetMonitor.d.ts.map +0 -1
- package/dist/components/FleetPanel.d.ts.map +0 -1
- package/dist/components/GoalPanel.d.ts.map +0 -1
- package/dist/components/GoalView.d.ts.map +0 -1
- package/dist/components/InspectorPanel.d.ts.map +0 -1
- package/dist/components/KanbanAgentRunPanel.d.ts.map +0 -1
- package/dist/components/KanbanBoardChrome.d.ts.map +0 -1
- package/dist/components/KanbanBoardSidebar.d.ts.map +0 -1
- package/dist/components/KanbanBoardState.d.ts.map +0 -1
- package/dist/components/KanbanBoundaryEditor.d.ts.map +0 -1
- package/dist/components/KanbanCleanerAlert.d.ts.map +0 -1
- package/dist/components/KanbanColumnView.d.ts.map +0 -1
- package/dist/components/KanbanDecompositionPanel.d.ts.map +0 -1
- package/dist/components/KanbanQueueHealthBar.d.ts.map +0 -1
- package/dist/components/KanbanRunControls.d.ts.map +0 -1
- package/dist/components/KanbanTaskActivityRecorder.d.ts.map +0 -1
- package/dist/components/KanbanTaskCompletionChecks.d.ts.map +0 -1
- package/dist/components/KanbanTaskFields.d.ts.map +0 -1
- package/dist/components/KanbanTaskInspector.d.ts.map +0 -1
- package/dist/components/KanbanTaskOptions.d.ts.map +0 -1
- package/dist/components/KanbanTaskTree.d.ts.map +0 -1
- package/dist/components/KanbanVerificationDashboard.d.ts.map +0 -1
- package/dist/components/KanbanView.d.ts.map +0 -1
- package/dist/components/KanbanViewModeTabs.d.ts.map +0 -1
- package/dist/components/MailboxDetailView.d.ts.map +0 -1
- package/dist/components/MailboxPanel.d.ts.map +0 -1
- package/dist/components/MemoryManager/DeleteMemoryDialog.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryDetail.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryDrawer.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryEditor.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryFilters.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryGraph.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryInjectorTrace.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryLifecycleTrace.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryList.d.ts.map +0 -1
- package/dist/components/MemoryManager/MemoryManagerEmpty.d.ts.map +0 -1
- package/dist/components/MemoryManager/SageTabs.d.ts.map +0 -1
- package/dist/components/MemoryManager/index.d.ts.map +0 -1
- package/dist/components/MemoryManager/selectors.d.ts.map +0 -1
- package/dist/components/MemoryManager/shared.d.ts.map +0 -1
- package/dist/components/MessageBubble/AttachmentGallery.d.ts.map +0 -1
- package/dist/components/MessageBubble/CopyButton.d.ts.map +0 -1
- package/dist/components/MessageBubble/ErrorBody.d.ts.map +0 -1
- package/dist/components/MessageBubble/LazyMarkdown.d.ts.map +0 -1
- package/dist/components/MessageBubble/StreamingMarkdown.d.ts.map +0 -1
- package/dist/components/MessageBubble/ToolInputView.d.ts.map +0 -1
- package/dist/components/MessageBubble/ToolLedgerCard.d.ts.map +0 -1
- package/dist/components/MessageBubble/index.d.ts.map +0 -1
- package/dist/components/MessageBubble/utils.d.ts.map +0 -1
- package/dist/components/MessageBubble.d.ts.map +0 -1
- package/dist/components/ModePicker.d.ts.map +0 -1
- package/dist/components/ModelPickDialog.d.ts.map +0 -1
- package/dist/components/ModelPicker.d.ts.map +0 -1
- package/dist/components/ModelSelectDialog.d.ts.map +0 -1
- package/dist/components/MonacoDiffView.d.ts.map +0 -1
- package/dist/components/NextStepsBar.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/CanvasPanels.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/Hud.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/Overlays.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/SelectedNodeDetailPanel.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/edges.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/nodes.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/resolve.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/use-recently-finished.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas/utils.d.ts.map +0 -1
- package/dist/components/OfficeMapCanvas.d.ts.map +0 -1
- package/dist/components/OfficeMapPanel.d.ts.map +0 -1
- package/dist/components/OfficeMapSettingsPanel.d.ts.map +0 -1
- package/dist/components/PhasePanel.d.ts.map +0 -1
- package/dist/components/PlanPanel.d.ts.map +0 -1
- package/dist/components/ProcessMonitor.d.ts.map +0 -1
- package/dist/components/PromptLibraryModal.d.ts.map +0 -1
- package/dist/components/ProviderWaitingRoom.d.ts.map +0 -1
- package/dist/components/QueuePanel.d.ts.map +0 -1
- package/dist/components/QuickModelSwitcher.d.ts.map +0 -1
- package/dist/components/QuickModelSwitcher.filter.d.ts.map +0 -1
- package/dist/components/RefinePanel.d.ts.map +0 -1
- package/dist/components/RefreshDebugView.d.ts.map +0 -1
- package/dist/components/SageMemoryCard.d.ts.map +0 -1
- package/dist/components/SddActivityFeed.d.ts.map +0 -1
- package/dist/components/SddBoardView.d.ts.map +0 -1
- package/dist/components/SddDestroyDialog.d.ts.map +0 -1
- package/dist/components/SddFlowGraph.d.ts.map +0 -1
- package/dist/components/SddHub.d.ts.map +0 -1
- package/dist/components/SddKanbanView.d.ts.map +0 -1
- package/dist/components/SddTaskDrawer.d.ts.map +0 -1
- package/dist/components/SddWizard.d.ts.map +0 -1
- package/dist/components/SearchOverlay.d.ts.map +0 -1
- package/dist/components/SendButton.d.ts.map +0 -1
- package/dist/components/SessionWatchPanel.d.ts.map +0 -1
- package/dist/components/SessionsDashboard.d.ts.map +0 -1
- package/dist/components/SettingsPanel/BasicSettingsTabs.d.ts.map +0 -1
- package/dist/components/SettingsPanel/BrainSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ChimeraSettingsPanel.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ConnectionsHealthSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/FallbacksSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/FleetSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/IntegrationsSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/MCPSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ModelSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/OAuthLoginSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/PluginToggleList.d.ts.map +0 -1
- package/dist/components/SettingsPanel/PreferenceControls.d.ts.map +0 -1
- package/dist/components/SettingsPanel/PreferenceToggle.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ProviderSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/RoutingSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/SecuritySection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ShadowSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/ToolsSection.d.ts.map +0 -1
- package/dist/components/SettingsPanel/brain-section-options.d.ts.map +0 -1
- package/dist/components/SettingsPanel/index.d.ts.map +0 -1
- package/dist/components/SettingsPanel/local-presets.d.ts.map +0 -1
- package/dist/components/SettingsPanel/official-servers.d.ts.map +0 -1
- package/dist/components/SettingsPanel/settings-panel-reducers.d.ts.map +0 -1
- package/dist/components/SettingsPanel/undo-send-decision.d.ts.map +0 -1
- package/dist/components/SettingsPanel.d.ts.map +0 -1
- package/dist/components/SetupScreen/CustomProviderSection.d.ts.map +0 -1
- package/dist/components/SetupScreen/ModelEditor.d.ts.map +0 -1
- package/dist/components/SetupScreen/ProviderKeyCard.d.ts.map +0 -1
- package/dist/components/SetupScreen/key-operation.d.ts.map +0 -1
- package/dist/components/SetupScreen/popular-providers.d.ts.map +0 -1
- package/dist/components/SetupScreen/relative-time.d.ts.map +0 -1
- package/dist/components/SetupScreen/types.d.ts.map +0 -1
- package/dist/components/SetupScreen.d.ts.map +0 -1
- package/dist/components/ShortcutsOverlay.d.ts.map +0 -1
- package/dist/components/SideEffectTimeline.d.ts.map +0 -1
- package/dist/components/SidePanel/AgentsPanel.d.ts.map +0 -1
- package/dist/components/SidePanel/ChangesPanel.d.ts.map +0 -1
- package/dist/components/SidePanel/DesignStudioPanel.d.ts.map +0 -1
- package/dist/components/SidePanel/SessionList.d.ts.map +0 -1
- package/dist/components/SidePanel/SessionPanel.d.ts.map +0 -1
- package/dist/components/SidePanel/SkillsList.d.ts.map +0 -1
- package/dist/components/SidePanel/WorktreesPanel.d.ts.map +0 -1
- package/dist/components/SidePanel/index.d.ts.map +0 -1
- package/dist/components/SkillDetailView.d.ts.map +0 -1
- package/dist/components/SpecsView.d.ts.map +0 -1
- package/dist/components/TaskActivityTimeline.d.ts.map +0 -1
- package/dist/components/TaskBoard.d.ts.map +0 -1
- package/dist/components/TaskCard.d.ts.map +0 -1
- package/dist/components/TaskExecutionAttempts.d.ts.map +0 -1
- package/dist/components/TaskIntelligencePanel.d.ts.map +0 -1
- package/dist/components/TaskRiskPanel.d.ts.map +0 -1
- package/dist/components/TaskVerificationSection.d.ts.map +0 -1
- package/dist/components/TasksPanel.d.ts.map +0 -1
- package/dist/components/TechStackView/DependencyDetail.d.ts.map +0 -1
- package/dist/components/TechStackView/DependencyTable.d.ts.map +0 -1
- package/dist/components/TechStackView/FindingsPanel.d.ts.map +0 -1
- package/dist/components/TechStackView/TechStackToolbar.d.ts.map +0 -1
- package/dist/components/TechStackView/index.d.ts.map +0 -1
- package/dist/components/TechStackView/shared.d.ts.map +0 -1
- package/dist/components/TerminalPanel.d.ts.map +0 -1
- package/dist/components/ThemeProvider.d.ts.map +0 -1
- package/dist/components/Toaster.d.ts.map +0 -1
- package/dist/components/TodosPanel.d.ts.map +0 -1
- package/dist/components/ToolGroup.d.ts.map +0 -1
- package/dist/components/ToolResult.d.ts.map +0 -1
- package/dist/components/UpdateBanner.d.ts.map +0 -1
- package/dist/components/VerificationReportPanel.d.ts.map +0 -1
- package/dist/components/WatchMessageBubble.d.ts.map +0 -1
- package/dist/components/WelcomeScreen.d.ts.map +0 -1
- package/dist/components/WorkDashboard.d.ts.map +0 -1
- package/dist/components/WorkspaceDock.d.ts.map +0 -1
- package/dist/components/WorktreeGraph.d.ts.map +0 -1
- package/dist/components/WorktreeLanes.d.ts.map +0 -1
- package/dist/components/WorktreeOrphans.d.ts.map +0 -1
- package/dist/components/activity-bar/index.d.ts.map +0 -1
- package/dist/components/activity-bar/nav.d.ts.map +0 -1
- package/dist/components/agent-roster-data.d.ts.map +0 -1
- package/dist/components/agents/AgentDetailSection.d.ts.map +0 -1
- package/dist/components/agents/AgentRosterCard.d.ts.map +0 -1
- package/dist/components/agents/FleetSummaryBar.d.ts.map +0 -1
- package/dist/components/codemap-model.d.ts.map +0 -1
- package/dist/components/context-editor/ContextWindowEditor.d.ts.map +0 -1
- package/dist/components/dashboard-primitives.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/monaco-theme.d.ts.map +0 -1
- package/dist/components/toaster-helpers.d.ts.map +0 -1
- package/dist/components/ui/PickerCardList.d.ts.map +0 -1
- package/dist/components/ui/api-key-display.d.ts.map +0 -1
- package/dist/components/ui/badge.d.ts.map +0 -1
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/concurrency-gauge.d.ts.map +0 -1
- package/dist/components/ui/dialog.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/empty-state.d.ts.map +0 -1
- package/dist/components/ui/event-timeline.d.ts.map +0 -1
- package/dist/components/ui/fleet-agent-row.d.ts.map +0 -1
- package/dist/components/ui/index.d.ts.map +0 -1
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/pagination.d.ts.map +0 -1
- package/dist/components/ui/progress-ring.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/sheet.d.ts.map +0 -1
- package/dist/components/ui/sparkline.d.ts.map +0 -1
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/useAgentRosterData.d.ts.map +0 -1
- package/dist/components/useKanbanRegistrySessionIds.d.ts.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/use-ws-handlers.d.ts.map +0 -1
- package/dist/hooks/useDesktopBridge.d.ts.map +0 -1
- package/dist/hooks/useF5Resilience.d.ts.map +0 -1
- package/dist/hooks/useFieldKeyboardNav.d.ts.map +0 -1
- package/dist/hooks/useFleetPolling.d.ts.map +0 -1
- package/dist/hooks/useGitInfo.d.ts.map +0 -1
- package/dist/hooks/useGlobalKeyboardShortcuts.d.ts.map +0 -1
- package/dist/hooks/useHorizontalScroll.d.ts.map +0 -1
- package/dist/hooks/useKanbanMeta.d.ts.map +0 -1
- package/dist/hooks/useMemoryForFile.d.ts.map +0 -1
- package/dist/hooks/usePagination.d.ts.map +0 -1
- package/dist/hooks/useProviderModels.d.ts.map +0 -1
- package/dist/hooks/useScrollPosition.d.ts.map +0 -1
- package/dist/hooks/useWebSocket.d.ts.map +0 -1
- package/dist/hooks/ws-handlers/chat-handlers.d.ts.map +0 -1
- package/dist/hooks/ws-handlers/coordinator-handlers.d.ts.map +0 -1
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts.map +0 -1
- package/dist/hooks/ws-handlers/fleet-handlers.d.ts.map +0 -1
- package/dist/hooks/ws-handlers/misc-handlers.d.ts.map +0 -1
- package/dist/hooks/ws-handlers/session-handlers.d.ts.map +0 -1
- package/dist/hooks/ws-handlers/techstack-handlers.d.ts.map +0 -1
- package/dist/hooks/ws-handlers.d.ts.map +0 -1
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/languages.d.ts.map +0 -1
- package/dist/index.css.map +0 -7
- package/dist/index.js.map +0 -7
- package/dist/lib/accent-colors.d.ts.map +0 -1
- package/dist/lib/agent-office.d.ts.map +0 -1
- package/dist/lib/agent-status.d.ts.map +0 -1
- package/dist/lib/chime.d.ts.map +0 -1
- package/dist/lib/color.d.ts.map +0 -1
- package/dist/lib/completion.d.ts.map +0 -1
- package/dist/lib/core-browser-shim.d.ts.map +0 -1
- package/dist/lib/default-prompt-pools.d.ts.map +0 -1
- package/dist/lib/desktop-host.d.ts.map +0 -1
- package/dist/lib/desktop-shell.d.ts.map +0 -1
- package/dist/lib/fallback-ref.d.ts.map +0 -1
- package/dist/lib/favicon.d.ts.map +0 -1
- package/dist/lib/file-icons.d.ts.map +0 -1
- package/dist/lib/goal.d.ts.map +0 -1
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/kanban-cleaner.d.ts.map +0 -1
- package/dist/lib/kanban-metadata.d.ts.map +0 -1
- package/dist/lib/kanban-verification.d.ts.map +0 -1
- package/dist/lib/model-calendar.d.ts.map +0 -1
- package/dist/lib/model-matrix-routes.d.ts.map +0 -1
- package/dist/lib/notify.d.ts.map +0 -1
- package/dist/lib/plugin-enablement.d.ts.map +0 -1
- package/dist/lib/roster-ws.d.ts.map +0 -1
- package/dist/lib/sage-block.d.ts.map +0 -1
- package/dist/lib/sdd-theme.d.ts.map +0 -1
- package/dist/lib/stream-coalescer.d.ts.map +0 -1
- package/dist/lib/terminal-dock.d.ts.map +0 -1
- package/dist/lib/tool-icon.d.ts.map +0 -1
- package/dist/lib/tool-summary.d.ts.map +0 -1
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/view-navigation.d.ts.map +0 -1
- package/dist/lib/ws-client-actions.d.ts.map +0 -1
- package/dist/lib/ws-client-contracts.d.ts.map +0 -1
- package/dist/lib/ws-client-helpers.d.ts.map +0 -1
- package/dist/lib/ws-client-utils.d.ts.map +0 -1
- package/dist/lib/ws-client.d.ts.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/protocol-compatibility.d.ts.map +0 -1
- package/dist/stores/auto-submit-streak.d.ts.map +0 -1
- package/dist/stores/chat-store.d.ts.map +0 -1
- package/dist/stores/codemap-activity-store.d.ts.map +0 -1
- package/dist/stores/codemap-index-store.d.ts.map +0 -1
- package/dist/stores/config-store.d.ts.map +0 -1
- package/dist/stores/context-editor-store.d.ts.map +0 -1
- package/dist/stores/coordinator-monitor-store.d.ts.map +0 -1
- package/dist/stores/cron-store.d.ts.map +0 -1
- package/dist/stores/file-reference-store.d.ts.map +0 -1
- package/dist/stores/file-store.d.ts.map +0 -1
- package/dist/stores/fleet-store.d.ts.map +0 -1
- package/dist/stores/git-changes-store.d.ts.map +0 -1
- package/dist/stores/git-info-store.d.ts.map +0 -1
- package/dist/stores/goal-assess-store.d.ts.map +0 -1
- package/dist/stores/goal-run-store.d.ts.map +0 -1
- package/dist/stores/goal-state-store.d.ts.map +0 -1
- package/dist/stores/goal-store.d.ts.map +0 -1
- package/dist/stores/history-store.d.ts.map +0 -1
- package/dist/stores/index.d.ts.map +0 -1
- package/dist/stores/kanban-store.d.ts.map +0 -1
- package/dist/stores/local-prefs.d.ts.map +0 -1
- package/dist/stores/mailbox-store.d.ts.map +0 -1
- package/dist/stores/memory-injector-store.d.ts.map +0 -1
- package/dist/stores/memory-lifecycle-store.d.ts.map +0 -1
- package/dist/stores/monitor-store.d.ts.map +0 -1
- package/dist/stores/office-map-store.d.ts.map +0 -1
- package/dist/stores/provider-status-store.d.ts.map +0 -1
- package/dist/stores/sdd-board-store.d.ts.map +0 -1
- package/dist/stores/sdd-wizard-store.d.ts.map +0 -1
- package/dist/stores/session-store.d.ts.map +0 -1
- package/dist/stores/side-effect-store.d.ts.map +0 -1
- package/dist/stores/specs-store.d.ts.map +0 -1
- package/dist/stores/techstack-store.d.ts.map +0 -1
- package/dist/stores/types.d.ts.map +0 -1
- package/dist/stores/ui-store.d.ts.map +0 -1
- package/dist/stores/viz-store.d.ts.map +0 -1
- package/dist/stores/worktree-store.d.ts.map +0 -1
- package/dist/types/brain.d.ts.map +0 -1
- package/dist/types/chronicle.d.ts.map +0 -1
- package/dist/types/client-message.d.ts.map +0 -1
- package/dist/types/collab.d.ts.map +0 -1
- package/dist/types/connections.d.ts.map +0 -1
- package/dist/types/goal-kanban-worktree.d.ts.map +0 -1
- package/dist/types/protocol-core.d.ts.map +0 -1
- package/dist/types/runtime.d.ts.map +0 -1
- package/dist/types/sage.d.ts.map +0 -1
- package/dist/types/server-message.d.ts.map +0 -1
- package/dist/types/skills-design.d.ts.map +0 -1
- package/dist/types/system.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,Ii as n,Li as r,Pi as i,Pt as a,Rt as o,Wn as s,Wt as c,Yr as l,ar as u,dn as d,et as f,ha as p,hr as m,oi as h,on as g,qi as _,ra as v,t as y,va as b,xa as x,yr as S}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{t as ee}from"./useWebSocket-BTXT0rOW.js";import{t as C}from"./ws-client-DqIqzkfU.js";import{t as w}from"./utils-DxDx8yib.js";import{M as te}from"./stores-CpZiOiOP.js";import{o as T}from"./view-navigation-BRtuAwZo.js";import{n as E}from"./Toaster-Bd6ckyrP.js";import{a as D,n as ne,o as re,r as O,t as k}from"./dialog-DYJUM0p1.js";import{t as A}from"./button-Clh96jMK.js";import{t as j}from"./input-CW-Yw2Wu.js";import{C as M,S as N,a as P,i as F,k as I,r as L,t as R}from"./index-DxZTscTk.js";var z=e(t(),1);function B(e,t=8e3){return new Promise((n,r)=>{let i=setTimeout(()=>{a(),r(Error(`timeout`))},t),a=e.on(`key.operation_result`,e=>{clearTimeout(i),a(),n(e.payload)})})}var V=f();function ie({onKeySaved:e}){let{t}=b(),[n,r]=(0,z.useState)(!1),[a,o]=(0,z.useState)(``),[c,l]=(0,z.useState)(`openai-compatible`),[u,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(``),[h,g]=(0,z.useState)(!1),[_,v]=(0,z.useState)([]),{setFieldRef:y,handleKeyDown:x}=P(),S=async()=>{if(a.trim()){g(!0);try{let n=C(te.getState().wsUrl),i=B(n);n.send({type:`provider.add`,payload:{id:a.trim(),family:c,baseUrl:u.trim()||void 0,apiKey:p.trim()||void 0,models:_.length>0?_.map(e=>e.id):void 0,customModels:_.length>0?Object.fromEntries(_.filter(e=>e.name||e.maxOutput||e.capabilities).map(e=>[e.id,{...e.name&&e.name!==e.id?{name:e.name}:{},...e.maxOutput?{maxOutput:e.maxOutput}:{},...e.capabilities&&Object.values(e.capabilities).some(Boolean)?{capabilities:e.capabilities}:{}}])):void 0}});let s=await i;if(!s.success)throw Error(s.message);E.success(t(`setup:screen.toasts.providerAdded`,{id:a.trim()})),e(a.trim()),n.listSavedProviders(),n.probeProvider(a.trim()),o(``),f(``),m(``),v([]),r(!1)}catch(e){let n=e instanceof Error&&e.message&&e.message!==`timeout`?e.message:null;E.error(n??t(`setup:screen.toasts.providerAddFailed`))}finally{g(!1)}}};return(0,V.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/60 overflow-hidden`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>r(!n),className:`w-full flex items-center gap-3 p-4 text-left hover:bg-muted/30 transition-colors`,children:[(0,V.jsx)(`div`,{className:`w-10 h-10 rounded-lg bg-muted/50 flex items-center justify-center`,children:(0,V.jsx)(d,{className:`h-5 w-5 text-muted-foreground`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:t(`setup:screen.custom.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`setup:screen.custom.description`)})]}),(0,V.jsx)(i,{className:w(`h-4 w-4 text-muted-foreground transition-transform`,n&&`rotate-90`)})]}),n&&(0,V.jsxs)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/40`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5 pt-3`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground block`,children:t(`setup:screen.custom.localServers`)}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:L.map(e=>(0,V.jsx)(A,{type:`button`,size:`sm`,variant:a===e.id?`default`:`outline`,onClick:()=>{o(e.id),l(`openai-compatible`),f(e.defaultBaseUrl),e.noAuth&&m(``),v([])},title:e.hint,children:e.label},e.id))})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.providerId`)}),(0,V.jsx)(j,{placeholder:`e.g. my-llm`,value:a,onChange:e=>o(e.target.value),className:`text-sm`,ref:y(0),onKeyDown:e=>x(e,0)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.family`)}),(0,V.jsxs)(`select`,{value:c,onChange:e=>l(e.target.value),className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm`,ref:y(1),onKeyDown:e=>x(e,1),children:[(0,V.jsx)(`option`,{value:`openai-compatible`,children:t(`setup:screen.custom.familyOpenAiCompatible`)}),(0,V.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,V.jsx)(`option`,{value:`anthropic`,children:`Anthropic`}),(0,V.jsx)(`option`,{value:`google`,children:`Google`})]})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.baseUrl`)}),(0,V.jsx)(j,{placeholder:`e.g. http://localhost:11434/v1`,value:u,onChange:e=>f(e.target.value),className:`text-sm font-mono`,ref:y(2),onKeyDown:e=>x(e,2)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.apiKey`)}),(0,V.jsx)(j,{type:`password`,placeholder:t(`setup:screen.custom.apiKeyPlaceholder`),value:p,onChange:e=>m(e.target.value),className:`text-sm font-mono`,ref:y(3),onKeyDown:e=>x(e,3)})]}),(0,V.jsx)(R,{models:_,onChange:v}),(0,V.jsxs)(A,{onClick:S,disabled:!a.trim()||h,size:`sm`,ref:y(4),onKeyDown:e=>x(e,4,S),children:[h?(0,V.jsx)(s,{className:`h-4 w-4 animate-spin mr-2`}):null,t(`setup:screen.custom.add`)]})]})]})}var H=F();async function ae(e,t){try{let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`HTTP ${n.status}`);let r=await n.json();if(!Array.isArray(r))throw Error(`Expected JSON array`);let i=r.filter(e=>typeof e.id==`string`&&typeof e.name==`string`&&typeof e.family==`string`);return i.length>0?i:H}catch{return H}}function oe(e,t){let n=new Date().getTime()-e.getTime(),r=Math.floor(n/1e3);if(r<10)return t(`setup:screen.time.justNow`);if(r<60)return t(`setup:screen.time.secondsAgo`,{count:r});let i=Math.floor(r/60);if(i<60)return t(`setup:screen.time.minutesAgo`,{count:i});let a=Math.floor(i/60);return a<24?t(`setup:screen.time.hoursAgo`,{count:a}):t(`setup:screen.time.daysAgo`,{count:Math.floor(a/24)})}var se=e(y(),1);function ce({popular:e,catalogProvider:t,savedProvider:a,onKeySaved:o,probeResult:u}){let{t:d}=b(),[f,p]=(0,z.useState)(``),[m,g]=(0,z.useState)(!1),[_,v]=(0,z.useState)(!!a?.apiKeys.some(e=>e.isActive)),[y,x]=(0,z.useState)(!1),[ee,T]=(0,z.useState)(!1),[M,N]=(0,z.useState)(!1),[P,F]=(0,z.useState)(null);(0,z.useEffect)(()=>{M&&e.referral&&se.toDataURL(e.referral.url,{width:200,margin:2,color:{dark:`#000000`,light:`#ffffff`}}).then(e=>F(e)).catch(()=>F(null))},[M,e.referral]);let I=async()=>{if(f.trim()){g(!0);try{let n=C(te.getState().wsUrl),r=B(n);t?n.addKey(e.id,`default`,f.trim()):n.send({type:`provider.add`,payload:{id:e.id,family:e.family,apiKey:f.trim()}});let i=await r;if(!i.success)throw Error(i.message);v(!0),p(``),E.success(d(`setup:screen.toasts.keySaved`,{name:e.name})),o(e.id),n.listSavedProviders(),n.probeProvider(e.id)}catch(t){let n=t instanceof Error&&t.message&&t.message!==`timeout`?t.message:null;E.error(n??d(`setup:screen.toasts.keySaveFailed`,{name:e.name}))}finally{g(!1)}}},L=e=>{e.key===`Enter`&&f.trim()&&I()},R=async()=>{if(e.referral)try{await navigator.clipboard.writeText(e.referral.url),T(!0),E.success(d(`setup:screen.toasts.referralCopied`)),setTimeout(()=>T(!1),2e3)}catch{E.error(d(`setup:screen.toasts.referralCopyFailed`))}},ie=t&&t.modelCount>0;return(0,V.jsxs)(`div`,{className:w(`rounded-xl border p-4 transition-all`,_?`border-success/30 bg-success/5`:`bg-gradient-to-br ${e.color}`),children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`text-2xl shrink-0 mt-0.5`,children:e.icon}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),_&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-success/10 text-success border border-success/20`,children:[(0,V.jsx)(r,{className:`h-2.5 w-2.5`}),d(`setup:screen.card.keySaved`)]}),e.referral&&!_&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-warning/10 text-warning border border-warning/20`,children:[(0,V.jsx)(S,{className:`h-2.5 w-2.5`}),d(`setup:screen.card.referral`)]})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),e.referral&&!_&&(0,V.jsxs)(`p`,{className:`text-[11px] text-warning/80 mt-1`,children:[`🎁 `,e.referral.reward]}),_?_?(0,V.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[a?.baseUrl&&(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70 font-mono truncate`,title:a.baseUrl,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground/50`,children:`URL: `}),a.baseUrl]}),a?.models&&a.models.length>0&&(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground/50`,children:`Models: `}),a.pickedModelId??a.models[0],(0,V.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[` (+`,a.models.length-1,` more)`]})]}),u===`probing`?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground mt-1`,children:[(0,V.jsx)(s,{className:`h-3 w-3 animate-spin`}),d(`setup:screen.probe.checking`,`Checking connection…`)]}):u?.ok?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-success mt-1`,children:[(0,V.jsx)(r,{className:`h-3 w-3`}),(0,V.jsxs)(`span`,{children:[d(`setup:screen.probe.connected`,`Connected`),u.modelCount!=null&&` · ${u.modelCount} ${d(`setup:screen.probe.models`,`models`)}`,u.elapsedMs!=null&&` · ${u.elapsedMs}ms`]})]}):u&&!u.ok?(0,V.jsxs)(`div`,{className:`flex items-start gap-1.5 text-[11px] text-destructive mt-1`,children:[(0,V.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:`✕`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:d(`setup:screen.probe.failed`,`Probe failed`)}),u.status===`no_base_url`&&(0,V.jsx)(`span`,{className:`block text-destructive/70`,children:d(`setup:screen.probe.noBaseUrl`,`No base URL configured`)}),u.status===`unreachable`&&(0,V.jsxs)(`span`,{className:`block text-destructive/70`,children:[d(`setup:screen.probe.unreachable`,`Could not connect`),u.detail?`: ${u.detail}`:``]}),u.status!==`no_base_url`&&u.status!==`unreachable`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`block text-destructive/70`,children:u.httpStatus==null?u.status:`${d(`setup:screen.probe.httpStatus`,`Status`)} ${u.httpStatus}`}),u.detail&&(0,V.jsx)(`span`,{className:`block text-destructive/70 truncate max-w-[250px]`,title:u.detail,children:u.detail})]})]})]}):null,ie&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>x(!y),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[d(`setup:screen.providers.modelsAvailable`,{count:t?.modelCount??0}),y?(0,V.jsx)(n,{className:`h-3 w-3`}):(0,V.jsx)(i,{className:`h-3 w-3`})]})]}):null:(0,V.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(j,{type:`password`,placeholder:e.keyPlaceholder,value:f,onChange:e=>p(e.target.value),onKeyDown:L,className:`font-mono text-sm`}),(0,V.jsx)(A,{onClick:I,disabled:!f.trim()||m,size:`sm`,className:`shrink-0`,children:m?(0,V.jsx)(s,{className:`h-4 w-4 animate-spin`}):d(`setup:screen.card.save`)})]}),e.docsUrl&&(0,V.jsxs)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors`,children:[d(`setup:screen.card.getKey`),` `,(0,V.jsx)(l,{className:`h-3 w-3`})]}),e.referral&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:R,className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:ee?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(r,{className:`h-3 w-3`}),` `,d(`setup:screen.card.copied`)]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(h,{className:`h-3 w-3`}),` `,d(`setup:screen.card.copyReferral`)]})}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>N(!0),className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:[(0,V.jsx)(c,{className:`h-3 w-3`}),` `,d(`setup:screen.card.share`)]})]})]})]})]}),(0,V.jsx)(k,{open:M,onOpenChange:N,children:(0,V.jsxs)(ne,{className:`sm:max-w-md`,children:[(0,V.jsxs)(D,{children:[(0,V.jsxs)(re,{className:`flex items-center gap-2`,children:[(0,V.jsx)(S,{className:`h-4 w-4 text-warning`}),d(`setup:screen.share.title`,{name:e.name})]}),(0,V.jsx)(O,{children:d(`setup:screen.share.description`)})]}),(0,V.jsx)(`div`,{className:`flex flex-col items-center gap-4 py-4`,children:e.referral&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`text-sm text-center`,children:(0,V.jsxs)(`p`,{className:`font-medium text-warning`,children:[`🎁 `,e.referral.reward]})}),P?(0,V.jsx)(`div`,{className:`rounded-lg border border-border p-2 bg-white`,children:(0,V.jsx)(`img`,{src:P,alt:d(`setup:screen.card.qrAlt`,{name:e.name}),className:`w-[200px] h-[200px]`})}):(0,V.jsx)(`div`,{className:`w-[200px] h-[200px] rounded-lg border border-border flex items-center justify-center bg-muted`,children:(0,V.jsx)(s,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),(0,V.jsxs)(`div`,{className:`w-full space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://twitter.com/intent/tweet?text=${t}&url=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:d(`setup:screen.share.twitter`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})}),`X`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`Check out ${e.name}! ${e.referral.reward}`);window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${t}&summary=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:d(`setup:screen.share.linkedin`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`})}),`LinkedIn`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward} ${e.referral.url}`);window.open(`https://t.me/share/url?url=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:d(`setup:screen.share.telegram`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`})}),`Telegram`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://wa.me/?text=${t}%20${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:d(`setup:screen.share.whatsapp`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.134 1.585 5.934L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z`})}),`WhatsApp`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`${e.name} - ${e.referral.reward}`);window.open(`https://www.reddit.com/submit?url=${t}&title=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:d(`setup:screen.share.reddit`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 0 1.108-.701 1.25 1.25 0 0 1 2.144.33zm-8.811 8.748c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754zm7.944 0c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754z`})}),`Reddit`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://www.facebook.com/sharer/sharer.php?u=${n}"e=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:d(`setup:screen.share.facebook`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`})}),`Facebook`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`mailto:?subject=${t}&body=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs hover:bg-muted/80 transition-colors`,title:d(`setup:screen.share.email`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25H4.5a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75`})}),`Email`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(j,{value:e.referral.url,readOnly:!0,className:`font-mono text-xs flex-1`}),(0,V.jsx)(A,{size:`sm`,variant:`outline`,onClick:R,className:`shrink-0`,children:ee?(0,V.jsx)(r,{className:`h-4 w-4`}):(0,V.jsx)(h,{className:`h-4 w-4`})})]}),(0,V.jsx)(`p`,{className:`text-[11px] text-muted-foreground text-center`,children:d(`setup:screen.share.hint`)})]})]})})]})})]})}function U(){let{t:e}=b(),{model:t,setProvider:n,setModel:c,wsConnected:l,wsUrl:d}=te(p(e=>({model:e.model,setProvider:e.setProvider,setModel:e.setModel,wsConnected:e.wsConnected,wsUrl:e.wsUrl})));ee();let[f,h]=(0,z.useState)([]),[y,S]=(0,z.useState)({}),[D,ne]=(0,z.useState)([]),[re,O]=(0,z.useState)(!1),[k,j]=(0,z.useState)(null),[P,F]=(0,z.useState)(0),[L,R]=(0,z.useState)(new Set),[B,se]=(0,z.useState)({}),[U,le]=(0,z.useState)(H),[W,G]=(0,z.useState)(!1),[ue,de]=(0,z.useState)(0),[fe,pe]=(0,z.useState)(0),[K,me]=(0,z.useState)(null),q=(0,z.useRef)(!0);(0,z.useEffect)(()=>{let e=new AbortController,t=`${window.location.origin}/providers.json`;return G(!0),ae(t,e.signal).then(t=>{if(t!==H){if(le(t),G(!1),!q.current){let e=t.length-fe;e>0?E.success(x.t(`setup:screen.toasts.providersLoadedNew`,{count:t.length,diff:e})):e<0?E.success(x.t(`setup:screen.toasts.providersLoadedRemoved`,{count:t.length,diff:Math.abs(e)})):E.success(x.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:t.length})),pe(t.length)}me(new Date);return}return ae(`https://raw.githubusercontent.com/WrongStack/WrongStack/main/packages/webui/public/providers.json`,e.signal)}).then(e=>{if(e){if(le(e),!q.current){let t=e.length-fe;t>0?E.success(x.t(`setup:screen.toasts.providersLoadedNew`,{count:e.length,diff:t})):t<0?E.success(x.t(`setup:screen.toasts.providersLoadedRemoved`,{count:e.length,diff:Math.abs(t)})):E.success(x.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:e.length})),pe(e.length)}me(new Date)}}).catch(()=>{q.current||E.error(x.t(`setup:screen.toasts.providersRefreshFailed`))}).finally(()=>{G(!1),q.current=!1}),()=>e.abort()},[ue]);let[J,he]=(0,z.useState)(null),[Y,X]=(0,z.useState)(null),[ge,_e]=(0,z.useState)(!1);(0,z.useEffect)(()=>{if(!l)return;let e=C(d),n=setTimeout(()=>{n=null,O(!1),j(x.t(`setup:screen.errors.backendNotResponding`))},8e3),r=()=>{n&&=(clearTimeout(n),null)},i=e.on(`provider.catalog`,e=>{if(e.type===`provider.catalog`){r(),j(null);let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));h(t),O(!1)}}),a=e.on(`provider.models`,e=>{if(e.type===`provider.models`){let n=e.payload;if(n.provider!==J)return;S(e=>({...e,[n.provider]:n.models})),_e(!1),n.models.length===1?X(n.models[0].id):t&&n.models.some(e=>e.id===t)&&X(t)}}),o=e.on(`providers.saved`,e=>{if(e.type===`providers.saved`){let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));ne(t);let n=new Set(t.filter(e=>e.apiKeys.some(e=>e.isActive)).map(e=>e.id));R(n)}}),s=e.on(`provider.probe`,e=>{if(e.type!==`provider.probe`)return;let t=e.payload;se(e=>({...e,[t.providerId]:t}))});return j(null),O(!0),e.listProviders(),()=>{r(),i?.(),a?.(),o?.(),s?.()}},[l,d,t,P]);let ve=(0,z.useCallback)(()=>{j(null),F(e=>e+1)},[]),ye=(0,z.useCallback)(()=>{de(e=>e+1)},[]),be=(0,z.useCallback)(t=>oe(t,e),[e]),Z=(0,z.useCallback)(e=>{R(t=>new Set([...t,e])),he(e),X(null)},[]),xe=L.size>0;(0,z.useEffect)(()=>{if(!J||!l)return;let e=C(d);y[J]||(_e(!0),e.listProviderModels(J))},[J,l,d,y]);let Se=J?y[J]??[]:[],Ce=(0,z.useCallback)(async()=>{if(!J||!Y)return;if(!L.has(J)){E.error(`Please save the provider configuration before starting a session.`);return}n(J),c(Y);let e=C(d),t=await e.switchModel(J,Y,5e3);t.success?(e.newSession(),T(`chat`)):E.error(t.message||x.t(`setup:screen.errors.modelSwitchTimeout`))},[J,Y,n,c,d]),we=(0,z.useCallback)(async()=>{if(!J||!Y)return;n(J),c(Y);let e=await C(d).switchModel(J,Y,5e3);e.success?T(`chat`):E.error(e.message||x.t(`setup:screen.errors.modelSwitchTimeout`))},[J,Y,n,c,d]),Te=new Set(U.map(e=>e.id)),Ee=f.filter(e=>!Te.has(e.id)).sort((e,t)=>e.id.localeCompare(t.id)),Q=M(Ee,10);M(D,9);let $=M(Se,12,J);return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,V.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b bg-card px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,V.jsx)(`img`,{src:`/wrongstack.svg`,alt:`WrongStack`,draggable:!1,className:`ws-brand-logo h-10 w-10 shrink-0 border border-border/70 shadow-sm`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:e(`setup:screen.header.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground sm:truncate`,children:e(`setup:screen.header.subtitle`)})]})]}),xe&&J?(0,V.jsxs)(`span`,{className:`text-xs text-success/80`,children:[(0,V.jsx)(r,{className:`h-3 w-3 inline-block mr-1`}),e(`setup:screen.header.continue`)]}):null]}),(0,V.jsx)(I,{className:`min-h-0 flex-1`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-8 p-4 pb-4 sm:p-6`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm`,children:[(0,V.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,xe?`text-success`:`text-primary font-medium`),children:[(0,V.jsx)(u,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.addKeys`)})]}),(0,V.jsx)(i,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,J?`text-primary font-medium`:`text-muted-foreground`),children:[(0,V.jsx)(_,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.pickModel`)})]}),(0,V.jsx)(i,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,J&&Y?`text-primary font-medium`:`text-muted-foreground`),children:[(0,V.jsx)(a,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.start`)})]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-primary/20 bg-primary/5 p-4`,children:[(0,V.jsx)(o,{className:`h-5 w-5 text-primary shrink-0 mt-0.5`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium`,children:e(`setup:screen.security.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`setup:screen.security.body`)})]})]}),k?(0,V.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-4 py-12 rounded-xl border border-destructive/30 bg-destructive/5 px-6`,children:[(0,V.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-destructive/10 border border-destructive/30 flex items-center justify-center`,children:(0,V.jsx)(m,{className:`h-6 w-6 text-destructive`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e(`setup:screen.errors.backendUnreachable`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 max-w-sm`,children:k})]}),(0,V.jsxs)(A,{onClick:ve,size:`sm`,variant:`outline`,children:[(0,V.jsx)(s,{className:`h-4 w-4 mr-2`}),e(`setup:screen.errors.retry`)]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.popular`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[W&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,V.jsx)(s,{className:`h-3 w-3 animate-spin`}),e(`setup:screen.providers.updating`)]}),K&&!W&&(0,V.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,title:K.toLocaleString(),children:be(K)}),(0,V.jsxs)(`button`,{type:`button`,onClick:ye,disabled:W,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,title:e(`setup:screen.providers.refreshTitle`),children:[(0,V.jsx)(g,{className:w(`h-3 w-3`,W&&`animate-spin`)}),e(`setup:screen.providers.refresh`)]})]})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:U.map(e=>(0,V.jsx)(ce,{popular:e,catalogProvider:f.find(t=>t.id===e.id),savedProvider:D.find(t=>t.id===e.id),onKeySaved:Z,probeResult:B[e.id]},e.id))})]}),Ee.length>0&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.more`)}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:Q.pageItems.map(t=>(0,V.jsx)(ce,{popular:{id:t.id,name:t.name,description:e(`setup:screen.providers.catalogDescription`,{family:t.family,count:t.modelCount}),icon:`🔗`,color:`from-muted/60 to-muted/20 border-border hover:border-primary/40`,keyPlaceholder:`API key`,family:t.family},catalogProvider:t,savedProvider:D.find(e=>e.id===t.id),onKeySaved:Z,probeResult:B[t.id]},t.id))}),(0,V.jsx)(N,{page:Q.page,pageSize:Q.pageSize,totalItems:Q.totalItems,onPageChange:Q.setPage,itemLabel:`providers`})]}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.selfHosted`)}),(0,V.jsx)(ie,{onKeySaved:Z})]})]}),re&&(0,V.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,V.jsx)(s,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),J&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`h2`,{className:`text-base font-semibold flex items-center gap-2`,children:[(0,V.jsx)(a,{className:`h-4 w-4 text-primary`}),e(`setup:screen.start.chooseModel`)]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{he(null),X(null)},className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,children:e(`setup:screen.start.addMoreKeys`)})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`setup:screen.start.modelsFor`,{provider:J})}),ge?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,V.jsx)(s,{className:`h-6 w-6 animate-spin text-muted-foreground`})}):Se.length>0?(0,V.jsx)(`div`,{className:`grid grid-cols-1 gap-2`,children:$.pageItems.map(e=>{let t=e.contextWindow?`${(e.contextWindow/1e6).toFixed(0)}M ctx`:null;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>X(e.id),className:w(`w-full text-left rounded-xl border p-3 transition-all`,`hover:border-primary/40 hover:bg-primary/5`,Y===e.id?`border-primary bg-primary/10 ring-1 ring-primary/30`:`border-border bg-card`),children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`span`,{className:`font-medium text-sm`,children:e.name}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[t&&(0,V.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:t}),e.capabilities.slice(0,3).map(e=>(0,V.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20`,children:e},e))]})]}),Y===e.id&&(0,V.jsx)(`div`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary`,children:(0,V.jsx)(r,{className:`h-3 w-3 text-primary-foreground`})})]})},e.id)})}):(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground py-8 text-center`,children:e(`setup:screen.errors.noModels`)}),(0,V.jsx)(N,{page:$.page,pageSize:$.pageSize,totalItems:$.totalItems,onPageChange:$.setPage,itemLabel:`models`})]}),J&&Y&&(0,V.jsxs)(`div`,{className:`sticky bottom-0 -mx-4 border-t bg-background/80 px-4 py-4 backdrop-blur-sm sm:-mx-6 sm:px-6`,children:[(0,V.jsx)(`div`,{className:`mb-3 flex min-w-0 items-center justify-between gap-2 text-sm text-muted-foreground`,children:(0,V.jsxs)(`span`,{className:`min-w-0 truncate`,children:[J,` / `,Y]})}),(0,V.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,V.jsxs)(A,{onClick:Ce,className:`flex-1`,size:`lg`,children:[(0,V.jsx)(_,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.startSession`),(0,V.jsx)(v,{className:`h-4 w-4 ml-2`})]}),(0,V.jsxs)(A,{onClick:we,variant:`outline`,className:`flex-1`,size:`lg`,children:[(0,V.jsx)(r,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.saveConfig`)]})]}),(0,V.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60 text-center mt-2`,children:e(`setup:screen.start.saveConfigHint`)})]})]})})]})}export{U as SetupScreen};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-BTDGplXK.js","assets/rolldown-runtime-QTnfLwEv.js","assets/monaco-BLUV5g0U.js","assets/monaco-Bowa0-zp.css","assets/markdown-sSmz-Ua_.js","assets/vendor-BMdWcCR4.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,Fi as n,Li as r,Or as ee,Pi as te,Pr as ne,Pt as re,Wn as i,Yi as ie,ea as a,ei as ae,et as o,hn as oe,hr as se,nt as ce,oi as le,on as ue,va as de,xa as s,xt as fe,yn as pe}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{n as c}from"./ui-store-C-oyG_br.js";import{s as l}from"./monaco-BLUV5g0U.js";import{t as me}from"./useWebSocket-BTXT0rOW.js";import{t as u}from"./utils-DxDx8yib.js";import{o as he}from"./view-navigation-BRtuAwZo.js";import{a as ge,n as _e,o as ve,t as ye}from"./dialog-DYJUM0p1.js";import{p as be}from"./markdown-sSmz-Ua_.js";import{c as xe,g as Se,u as d}from"./index-DxZTscTk.js";import{t as Ce}from"./empty-state-BV-Y8c35.js";var f=e(t(),1),p=o(),m=(0,f.lazy)(()=>l(()=>import(`./vendor-BTDGplXK.js`).then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5])));function h(e){return e===`project`||e===`user`}function g(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function we({source:e}){let{t}=de(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,p.jsx)(`span`,{className:u(`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`border-success/25 bg-success/8 text-success`,n===`user`&&`border-primary/25 bg-primary/10 text-primary`,n===`bundled`&&`border-border/70 bg-muted/60 text-muted-foreground`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function _({className:e}){let{t}=de(),{client:o}=me(),l=c(e=>e.skillsState),_=c(e=>e.setSkillsState),v=l.selectedSkill,y=l.navHistory,b=l.historyIndex,[x,S]=(0,f.useState)(null),[Te,C]=(0,f.useState)(!1),[Ee,w]=(0,f.useState)(null),De=xe(`skill-detail`,!!x),[T,E]=(0,f.useState)(!1),[D,O]=(0,f.useState)(``),[k,A]=(0,f.useState)(!1),[j,M]=(0,f.useState)(null),[N,P]=(0,f.useState)(!1),[F,I]=(0,f.useState)(null),[L,R]=(0,f.useState)(!1),z=(0,f.useRef)(``),[B,V]=(0,f.useState)(!1),[H,U]=(0,f.useState)(null),[Oe,W]=(0,f.useState)(!1),[G,K]=(0,f.useState)(null),[q,ke]=(0,f.useState)(!1),[Ae,je]=(0,f.useState)([]),J=(0,f.useRef)(l);J.current=l;let Y=(0,f.useRef)(!1),X=(0,f.useMemo)(()=>D?{lines:D.split(`
|
|
3
|
+
`).length,words:D.trim()?D.trim().split(/\s+/).length:0,chars:D.length}:{lines:0,words:0,chars:0},[D]),Z=(0,f.useMemo)(()=>{if(!D)return null;let e=5*1024*1024,t=new Blob([D]).size;return t>=e?{level:`critical`,used:t,limit:e}:t>=4194304?{level:`warn`,used:t,limit:e}:null},[D]);(0,f.useEffect)(()=>{if(!F)return;let e=setTimeout(()=>I(null),2e3);return()=>clearTimeout(e)},[F]),(0,f.useEffect)(()=>{if(!T||!v)return;let e=setInterval(()=>{D&&D!==z.current&&(z.current=D,localStorage.setItem(`skills_draft_${v.name}`,JSON.stringify({content:D,savedAt:Date.now()})),I(Date.now()))},5e3);return()=>clearInterval(e)},[T,D,v]),(0,f.useEffect)(()=>{if(!v||!T)return;let e=localStorage.getItem(`skills_draft_${v.name}`);if(e)try{let{content:t}=JSON.parse(e);t&&t!==D&&t!==z.current&&(O(t),z.current=t,R(!0))}catch{}},[v?.name,T]),(0,f.useEffect)(()=>{if(!o||!v)return;C(!0),S(null),w(null);let e=setTimeout(()=>{C(!1),w(s.t(`activity:skillDetail.timeoutError`))},1e4),t=t=>{clearTimeout(e);let n=t;n.payload.error?w(n.payload.error):n.payload.name&&S(n.payload),C(!1)},n=e=>{let t=e;V(!1);let n=J.current;if(t.payload.success){let e={...n.knownRefs};for(let n of t.payload.updated??[])e[n.name]=n.newRef;_({...n,knownRefs:e,updateAvailableCount:0}),U({updated:t.payload.updated??[],unchanged:t.payload.unchanged??[],errors:t.payload.errors??[]}),o.send({type:`skills.list`},{echoToChat:!1})}else U({updated:[],unchanged:[],errors:[{name:``,error:t.payload.error??s.t(`activity:skillDetail.updateFailed`)}]})},r=e=>{let t=e;t.payload.skills&&je(t.payload.skills)};return o.on(`skills.content`,t),o.on(`skills.updated`,n),o.on(`skills.list`,r),o.send({type:`skills.content`,payload:{name:v.name,source:v.source}}),()=>{clearTimeout(e),o.off(`skills.content`,t),o.off(`skills.updated`,n),o.off(`skills.list`,r)}},[o,v?.name,v?.source]),(0,f.useEffect)(()=>{T&&(E(!1),O(``),M(null))},[v?.name]);let Q=(0,f.useCallback)(e=>Ae.find(t=>t.name.toLowerCase()===e.toLowerCase()),[Ae]),Me=(0,f.useCallback)(e=>{let t=Q(e);if(t){Y.current=!1;let e=y.slice(0,b+1);e.push(t),_({...J.current,selectedSkill:t,navHistory:e,historyIndex:e.length-1}),E(!1),O(``),U(null)}},[Q,y,b,_]),Ne=(0,f.useCallback)(()=>{if(b<=0)return;Y.current=!0;let e=b-1,t=y[e];_({...J.current,selectedSkill:t,historyIndex:e}),E(!1),O(``),U(null)},[b,y,_]),Pe=(0,f.useCallback)(()=>{if(b>=y.length-1)return;Y.current=!0;let e=b+1,t=y[e];_({...J.current,selectedSkill:t,historyIndex:e}),E(!1),O(``),U(null)},[b,y,_]),$=(0,f.useCallback)(()=>{he(`chat`)},[]),Fe=(0,f.useCallback)(()=>{x&&(O(x.body),z.current=x.body,R(!1),M(null),E(!0),P(!1))},[x]),Ie=(0,f.useCallback)(()=>{E(!1),O(``),M(null),P(!1),R(!1),v&&localStorage.removeItem(`skills_draft_${v.name}`)},[v]),Le=(0,f.useCallback)(()=>{!v||!x||(R(!1),O(x.body),z.current=x.body,v&&localStorage.removeItem(`skills_draft_${v.name}`))},[v,x]),Re=(0,f.useCallback)(()=>{if(!o||!v||!D.trim())return;A(!0),M(null);let e=t=>{let n=t;A(!1),n.payload.success?(z.current=``,localStorage.removeItem(`skills_draft_${v.name}`),R(!1),E(!1),o.send({type:`skills.content`,payload:{name:v.name,source:v.source}}),o.send({type:`skills.list`},{echoToChat:!1})):M(n.payload.error??s.t(`activity:skillDetail.saveFailed`)),o.off(`skills.edited`,e)};o.on(`skills.edited`,e),o.editSkill(v.name,D)},[o,v,D]),ze=(0,f.useCallback)(()=>{!o||!v||(V(!0),U(null),o.checkForUpdates(v.name,v.source===`user`))},[o,v]),Be=(0,f.useCallback)(()=>{v?.sourceUrl&&navigator.clipboard.writeText(v.sourceUrl).then(()=>{W(!0),setTimeout(()=>W(!1),2e3)})},[v]),Ve=(0,f.useCallback)(()=>{if(!x?.body)return;let e=new Blob([x.body],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${x.name.replace(/\//g,`_`)}-SKILL.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},[x]),He=(0,f.useCallback)(async e=>{if(!o||!e)return;ke(!0);let t=e=>{let n=e;ke(!1),n.payload.success?(K(null),o.send({type:`skills.list`},{echoToChat:!1}),$()):M(n.payload.error??s.t(`activity:skillDetail.uninstallFailed`)),o.off(`skills.uninstalled`,t)};o.on(`skills.uninstalled`,t),o.uninstallSkill(e.name,e.source===`user`)},[o,$]);return v?(0,p.jsxs)(`div`,{className:u(`flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:[(0,p.jsxs)(`div`,{className:`shrink-0 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,p.jsx)(re,{className:`h-4 w-4`})}),(0,p.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold`,children:v.name}),v.version&&(0,p.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,v.version]}),(0,p.jsx)(we,{source:v.source})]}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:v.description||v.trigger}),v.sourceUrl&&(0,p.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1`,children:[(0,p.jsxs)(`a`,{href:`https://${v.sourceUrl.replace(`github:`,``)}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,title:t(`activity:skillDetail.openSourceRepo`),children:[(0,p.jsx)(se,{className:`h-3 w-3 shrink-0`}),(0,p.jsx)(`span`,{className:`truncate font-mono`,children:v.sourceUrl})]}),(0,p.jsx)(`button`,{type:`button`,onClick:Be,className:`flex shrink-0 items-center text-muted-foreground transition-colors hover:text-foreground`,title:t(`activity:skillDetail.copySourceUrl`),children:Oe?(0,p.jsx)(r,{className:`h-3 w-3 text-success`}):(0,p.jsx)(le,{className:`h-3 w-3`})})]}),v.scope.length>0&&(0,p.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:v.scope.map(e=>(0,p.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:e},e))}),H&&(0,p.jsxs)(`div`,{className:`mt-2 text-xs space-y-1`,children:[H.updated.length>0&&(0,p.jsx)(`div`,{className:`text-success`,children:t(`activity:skillDetail.updatedLabel`,{list:H.updated.map(e=>`${e.name} (${e.oldRef} → ${e.newRef})`).join(`, `)})}),H.unchanged.length>0&&(0,p.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:skillDetail.upToDateLabel`,{list:H.unchanged.join(`, `)})}),H.errors.length>0&&(0,p.jsx)(`div`,{className:`text-destructive`,children:t(`activity:skillDetail.errorsLabel`,{list:H.errors.map(e=>`${e.name?`${e.name}: `:``}${e.error}`).join(`; `)})})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 lg:ml-auto lg:shrink-0 lg:justify-end`,children:[h(v.source)&&v.sourceUrl&&(0,p.jsx)(`button`,{type:`button`,onClick:ze,disabled:B,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,title:t(`activity:skillDetail.checkUpdatesTitle`),children:B?(0,p.jsx)(i,{className:`h-3.5 w-3.5 animate-spin`}):(0,p.jsx)(ue,{className:`h-3.5 w-3.5`})}),v.source!==`bundled`&&!T&&(0,p.jsx)(`button`,{type:`button`,onClick:Ve,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:skillDetail.exportTitle`),children:(0,p.jsx)(ae,{className:`h-3.5 w-3.5`})}),h(v.source)&&!T&&(0,p.jsx)(`button`,{type:`button`,onClick:Fe,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:skillDetail.editTitle`),children:(0,p.jsx)(oe,{className:`h-3.5 w-3.5`})}),h(v.source)&&(0,p.jsx)(`button`,{type:`button`,onClick:()=>K(v),className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,title:t(`activity:skillDetail.uninstallTitle`),children:(0,p.jsx)(fe,{className:`h-3.5 w-3.5`})}),(0,p.jsx)(`button`,{type:`button`,onClick:$,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:t(`activity:skillDetail.closeTitle`),children:(0,p.jsx)(ce,{className:`h-4 w-4`})})]})]}),y.length>1&&(0,p.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1 rounded-lg border border-border/60 bg-muted/35 px-2 py-1`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:Ne,disabled:b<=0,className:u(`rounded p-1 transition-colors`,b<=0?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:t(`activity:skillDetail.backTitle`),children:(0,p.jsx)(n,{className:`h-4 w-4`})}),(0,p.jsx)(`button`,{type:`button`,onClick:Pe,disabled:b>=y.length-1,className:u(`rounded p-1 transition-colors`,b>=y.length-1?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:t(`activity:skillDetail.forwardTitle`),children:(0,p.jsx)(te,{className:`h-4 w-4`})}),(0,p.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto text-xs`,children:y.map((e,t)=>(0,p.jsxs)(`span`,{className:`flex items-center shrink-0`,children:[t>0&&(0,p.jsx)(te,{className:`h-3 w-3 text-muted-foreground/65 mx-0.5 shrink-0`}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>{t<b&&(Y.current=!0,_({...J.current,selectedSkill:e,historyIndex:t}),E(!1),O(``),U(null))},className:u(`hover:text-primary cursor-pointer transition-colors`,t===b?`text-primary font-medium`:`text-muted-foreground`),children:e.name})]},e.name+t))})]})]}),x&&(x.relatedFiles.length>0||x.references.length>0)&&(0,p.jsxs)(`div`,{className:`shrink-0 space-y-2 rounded-xl border border-border/70 bg-card/70 px-4 py-3 shadow-sm`,children:[x.relatedFiles.length>0&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,p.jsx)(ee,{className:`h-3 w-3`}),(0,p.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:t(`activity:skillDetail.relatedFiles`)})]}),x.relatedFiles.map(e=>{let n=g(e);return n&&Q(n)?(0,p.jsxs)(`button`,{type:`button`,onClick:()=>Me(n),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] transition-colors hover:border-primary/40 hover:text-primary`,title:t(`activity:skillDetail.goToSkillTitle`,{name:n}),children:[(0,p.jsx)(a,{className:`h-2.5 w-2.5`}),e]},e):(0,p.jsx)(`span`,{className:`rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e},e)})]}),x.references.length>0&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,p.jsx)(ne,{className:`h-3 w-3`}),(0,p.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:t(`activity:skillDetail.references`)})]}),x.references.map(e=>{let n=g(e)??e.replace(/\.md$/,``);return Q(n)?(0,p.jsxs)(`button`,{type:`button`,onClick:()=>Me(n),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] text-primary transition-colors hover:border-primary/30 hover:bg-primary/10`,title:t(`activity:skillDetail.goToSkillTitle`,{name:n}),children:[(0,p.jsx)(a,{className:`h-2.5 w-2.5`}),n]},e):(0,p.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:n},e)})]})]}),(0,p.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-xl border border-border/70 bg-card/70 shadow-sm`,children:Te?(0,p.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center text-muted-foreground`,children:[(0,p.jsx)(i,{className:`mx-auto mb-2 h-6 w-6 animate-spin text-primary`}),(0,p.jsx)(`p`,{children:t(`activity:skillDetail.loadingContent`)})]}):T?(0,p.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,p.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border/70 bg-muted/30 px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,p.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,p.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:skillDetail.editingLabel`,{name:v.name})}),(0,p.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t(`activity:skillDetail.editStats`,{lines:X.lines,words:X.words,chars:X.chars})}),Z&&(0,p.jsx)(`span`,{className:`text-xs tabular-nums ${Z.level===`critical`?`font-medium text-destructive`:`text-warning`}`,children:t(`activity:skillDetail.charsWarningFmt`,{used:(Z.used/(1024*1024)).toFixed(1),limit:(Z.limit/(1024*1024)).toFixed(0)})}),F&&(0,p.jsx)(`span`,{className:`text-xs text-success animate-pulse`,children:t(`activity:skillDetail.draftSaved`)}),L&&(0,p.jsx)(`span`,{className:`animate-pulse text-xs text-warning`,children:t(`activity:skillDetail.draftRestored`)})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[j&&(0,p.jsx)(`span`,{className:`text-xs text-destructive`,children:j}),L&&(0,p.jsx)(`button`,{type:`button`,onClick:Le,className:`rounded-md border border-warning/35 px-2 py-1 text-[10px] text-warning transition-colors hover:bg-warning/10`,children:t(`activity:skillDetail.discardDraft`)}),(0,p.jsx)(`button`,{type:`button`,onClick:Ie,className:`rounded-md border border-border/70 px-2 py-1 text-xs transition-colors hover:bg-accent`,children:t(`common:action.cancel`)}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>P(e=>!e),title:t(N?`activity:skillDetail.hidePreviewTitle`:`activity:skillDetail.splitViewTitle`),className:`rounded-md border px-2 py-1 text-xs transition-colors ${N?`border-primary/40 bg-primary/10 text-primary`:`border-border/70 text-muted-foreground hover:bg-accent`}`,children:(0,p.jsx)(pe,{className:`h-3 w-3 inline`})}),(0,p.jsx)(`button`,{type:`button`,onClick:Re,disabled:k||!D.trim(),className:`rounded-md bg-primary px-3 py-1 text-xs text-primary-foreground shadow-sm shadow-primary/15 transition-colors hover:bg-primary/90 disabled:opacity-50`,children:k?(0,p.jsx)(i,{className:`h-3 w-3 animate-spin inline`}):t(`common:action.save`)})]})]}),N?(0,p.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-0.5`,children:[(0,p.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-0`,children:(0,p.jsx)(f.Suspense,{fallback:null,children:(0,p.jsx)(m,{value:D,onChange:e=>O(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:t(`activity:skillDetail.contentPlaceholder`)})})}),(0,p.jsx)(`div`,{className:`w-px bg-border flex-shrink-0`}),(0,p.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-background/45 p-4 prose prose-sm dark:prose-invert max-w-none`,children:(0,p.jsx)(d,{rehypePlugins:[be],components:Se,children:D})})]}):(0,p.jsx)(f.Suspense,{fallback:null,children:(0,p.jsx)(m,{value:D,onChange:e=>O(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:t(`activity:skillDetail.contentPlaceholder`)})})]}):x?(0,p.jsx)(`div`,{ref:De,className:`h-full min-h-0 overflow-y-auto overscroll-contain p-5 sm:p-6 prose prose-sm dark:prose-invert max-w-none`,children:(0,p.jsx)(d,{rehypePlugins:[be],components:Se,children:x.body})}):Ee?(0,p.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center`,children:[(0,p.jsx)(`p`,{className:`text-destructive mb-2`,children:t(`activity:skillDetail.loadFailed`)}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Ee}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>{o&&v&&(C(!0),w(null),o.send({type:`skills.content`,payload:{name:v.name,source:v.source}}))},className:`mt-4 rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent`,children:t(`common:action.retry`)})]}):(0,p.jsx)(`div`,{className:`flex h-full min-h-[16rem] items-center justify-center p-8 text-center text-muted-foreground`,children:t(`activity:skillDetail.noContent`)})}),(0,p.jsx)(ye,{open:!!G,onOpenChange:e=>{e||K(null)},children:(0,p.jsxs)(_e,{className:`flex max-h-[calc(100dvh-2rem)] w-[380px] max-w-[90vw] flex-col gap-0 overflow-hidden p-0`,showCloseButton:!1,children:[(0,p.jsxs)(ge,{className:`flex shrink-0 items-center justify-between border-b border-border/70 p-4 sm:flex-row sm:justify-between sm:space-y-0`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(fe,{className:`h-4 w-4 text-destructive`}),(0,p.jsx)(ve,{className:`font-semibold text-sm`,children:t(`activity:skillDetail.uninstallSkillHeading`)})]}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>K(null),"aria-label":t(`common:action.close`),className:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground`,children:(0,p.jsx)(ce,{className:`h-4 w-4`})})]}),(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-4`,children:[(0,p.jsx)(`p`,{className:`text-sm`,children:G&&t(`activity:skillDetail.uninstallConfirm`,{name:G.name})}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:G&&t(`activity:skillDetail.uninstallRemovePath`,{path:G.path})})]}),(0,p.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-border/70 bg-muted/20 p-4`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>K(null),disabled:q,className:`rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent disabled:opacity-50`,children:t(`common:action.cancel`)}),(0,p.jsxs)(`button`,{type:`button`,onClick:()=>G&&He(G),disabled:q,className:`flex items-center gap-1.5 rounded-md bg-destructive px-3 py-1.5 text-xs text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50`,children:[q&&(0,p.jsx)(i,{className:`h-3 w-3 animate-spin`}),t(`activity:skillDetail.uninstallAction`)]})]})]})})]}):(0,p.jsx)(Ce,{icon:(0,p.jsx)(ie,{className:`h-6 w-6`}),title:t(`activity:skillDetail.noSkillSelected`),description:t(`activity:skillDetail.selectSkillHint`),action:{label:t(`activity:skillDetail.goToChat`),onClick:$},className:e})}export{_ as SkillDetailView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ai as t,Ii as n,Ir as r,Kn as i,On as a,Ri as o,Sa as s,Si as c,Wn as l,_a as u,at as d,ea as f,et as p,gi as m,in as h,mn as g,nr as _,xi as v}from"./vendor-2VBBgNb5.js";import"./i18n-1BkaqMgr.js";import{t as y}from"./useWebSocket-Dh3aAFDE.js";import{t as b}from"./utils-CN2sfDVP.js";import{r as x}from"./stores-mpa0202y.js";import{r as S}from"./view-navigation-Cgy5xh9q.js";import{t as C}from"./button-uGqXvobk.js";var w=e(s(),1),T=p(),E={completed:{icon:(0,T.jsx)(t,{className:`h-3.5 w-3.5`}),label:`Completed`,text:`text-success`,ring:`border-success/35`},in_progress:{icon:(0,T.jsx)(i,{className:`h-3.5 w-3.5 animate-spin`}),label:`Running`,text:`text-primary`,ring:`border-primary/45`},queued:{icon:(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),label:`Queued`,text:`text-warning`,ring:`border-warning/35`},blocked:{icon:(0,T.jsx)(l,{className:`h-3.5 w-3.5`}),label:`Blocked`,text:`text-destructive`,ring:`border-destructive/30`},pending:{icon:(0,T.jsx)(v,{className:`h-3.5 w-3.5`}),label:`Pending`,text:`text-muted-foreground`,ring:`border-border/70`},review:{icon:(0,T.jsx)(h,{className:`h-3.5 w-3.5`}),label:`Review`,text:`text-primary`,ring:`border-primary/35`},failed:{icon:(0,T.jsx)(c,{className:`h-3.5 w-3.5`}),label:`Failed`,text:`text-destructive`,ring:`border-destructive/45`},cancelled:{icon:(0,T.jsx)(f,{className:`h-3.5 w-3.5`}),label:`Cancelled`,text:`text-muted-foreground`,ring:`border-border/70`}},D=[`completed`,`in_progress`,`queued`,`blocked`,`pending`,`failed`],O={critical:{label:`Crit`,cls:`bg-destructive/10 text-destructive`},high:{label:`High`,cls:`bg-destructive/10 text-destructive`},medium:{label:`Med`,cls:`bg-warning/12 text-warning`},low:{label:`Low`,cls:`bg-success/12 text-success`}};function k({columns:e,onTaskClick:t}){let{t:r}=u();return e.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:r(`activity:board.emptySpec`)}):(0,T.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,T.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-foreground`,children:r(`activity:board.depGraphHeading`)}),(0,T.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs`,children:D.map(e=>(0,T.jsxs)(`span`,{className:b(`inline-flex items-center gap-1.5`,E[e].text),children:[E[e].icon,(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:r(`activity:board.status.${e}`)})]},e))}),(0,T.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-2`,children:e.map((r,i)=>(0,T.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,T.jsxs)(`div`,{className:`w-60 shrink-0`,children:[(0,T.jsx)(`div`,{className:`mb-2 border-b border-border/60 pb-1 text-center text-xs font-medium uppercase text-muted-foreground`,children:r.label}),(0,T.jsx)(`div`,{className:`space-y-2`,children:r.tasks.map(e=>(0,T.jsx)(A,{task:e,onClick:t},e.id))})]}),i<e.length-1&&(0,T.jsx)(`div`,{className:`flex h-full items-center pt-8 text-muted-foreground/75`,children:(0,T.jsx)(n,{className:`h-5 w-5`})})]},r.label))})]})}function A({task:e,onClick:t}){let n=E[e.displayStatus],r=O[e.priority],{t:a}=u();return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.id),className:b(`w-full rounded-lg border bg-background/55 p-2.5 text-left shadow-sm transition-colors hover:border-primary/35 hover:bg-accent/35`,n.ring),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:b(`inline-flex items-center gap-1.5 text-xs font-medium`,n.text),children:[n.icon,(0,T.jsx)(`span`,{className:`font-mono text-foreground`,children:e.shortId})]}),(0,T.jsx)(`span`,{className:b(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r.cls),children:r.label})]}),(0,T.jsx)(`p`,{className:`mt-1.5 text-xs text-foreground`,children:e.title}),e.deps.length>0&&(0,T.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[`← `,e.deps.join(`, `)]}),e.agentName&&(0,T.jsxs)(`div`,{className:b(`mt-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]`,e.displayStatus===`in_progress`?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`),title:e.worktreeBranch?a(`activity:board.worktreePrefix`,{branch:e.worktreeBranch}):void 0,children:[e.displayStatus===`in_progress`&&(0,T.jsx)(i,{className:`h-3 w-3 animate-spin`}),(0,T.jsx)(`span`,{children:e.agentName})]})]})}function j(e){return e.columns.map(e=>({name:e.label,description:``,priority:`medium`,estimateHours:e.tasks.length,parallelizable:!1,taskTemplates:e.tasks.map(e=>({title:e.title,description:e.description,type:e.type,priority:e.priority,estimateHours:1}))}))}function M({onClose:e,onRunStarted:t}){let{client:i}=y(),{t:s}=u(),c=x(e=>e.specs),l=x(e=>e.detail),f=x(e=>e.expandedSpecId),p=x(e=>e.setExpanded),[m,h]=(0,w.useState)(`graph`),v=(0,w.useCallback)(e=>{!l||l.specId!==e.id||(i?.send?.({type:`goal.start`,payload:{title:e.title,phases:j(l),autonomous:!0}}),S(`goal`))},[l,i]),E=(0,w.useCallback)(e=>{let n=e.graphId??(l?.specId===e.id?l.graphId:void 0);n?i?.send?.({type:`sdd.run.from_graph`,payload:{graphId:n,worktrees:!0}}):i?.send?.({type:`sdd.run.from_spec`,payload:{specId:e.id,worktrees:!0}}),t?.(),S(`sddhub`)},[l,i,t]);(0,w.useEffect)(()=>{i?.send?.({type:`specs.list`})},[i]);let D=(0,w.useCallback)(e=>{f===e.id?p(null):(p(e.id),i?.send?.({type:`specs.get`,payload:{specId:e.id}}))},[f,p,i]),O=l?.columns.flatMap(e=>e.tasks)??[],A={done:O.filter(e=>e.status===`completed`).length,running:O.filter(e=>e.status===`in_progress`).length,pending:O.filter(e=>e.status===`pending`||e.displayStatus===`queued`).length};return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,T.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b bg-card px-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(r,{className:`h-5 w-5 text-warning`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:s(`activity:specs.heading`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s(`activity:specs.subtitle`)})]})]}),(0,T.jsx)(C,{variant:`ghost`,size:`icon`,onClick:e,children:(0,T.jsx)(d,{className:`h-4 w-4`})})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4`,children:c.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:s(`activity:specs.empty`,{command:`/sdd`})}):(0,T.jsx)(`div`,{className:`space-y-3`,children:c.map(e=>{let t=f===e.id,i=e.total>0?Math.round(e.completed/e.total*100):0;return(0,T.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/60`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>D(e),className:`flex w-full items-start gap-3 p-4 text-left`,children:[(0,T.jsx)(`span`,{className:`mt-1 text-muted-foreground`,children:t?(0,T.jsx)(o,{className:`h-4 w-4`}):(0,T.jsx)(n,{className:`h-4 w-4`})}),(0,T.jsx)(r,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.displayId}),(0,T.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] capitalize text-muted-foreground`,children:e.status})]}),(0,T.jsx)(`h2`,{className:`mt-1 text-base font-semibold`,children:e.title}),(0,T.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`h-2 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-success transition-all`,style:{width:`${i}%`}})}),(0,T.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:[e.completed,`/`,e.total]})]})]})]}),t&&(0,T.jsxs)(`div`,{className:`border-t border-border p-4`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{className:`text-sm font-medium`,children:[s(`activity:specs.tasks`,{count:l?.total??e.total}),l&&(0,T.jsxs)(`span`,{className:`ml-3 text-xs font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`text-success`,children:s(`activity:specs.doneCount`,{count:A.done})}),` `,(0,T.jsx)(`span`,{className:`text-primary`,children:s(`activity:specs.runningCount`,{count:A.running})}),` `,(0,T.jsx)(`span`,{children:s(`activity:specs.pendingCount`,{count:A.pending})})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>E(e),title:s(`activity:specs.runAsSddTitle`),className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success transition-colors hover:bg-success/25`,children:[(0,T.jsx)(g,{className:`h-3.5 w-3.5`}),` `,s(`activity:specs.runAsSdd`)]}),(0,T.jsxs)(`button`,{type:`button`,disabled:!l||l.specId!==e.id,onClick:()=>v(e),title:s(`activity:specs.runAsGoalTitle`),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning transition-colors hover:bg-warning/25 disabled:opacity-40`,children:[(0,T.jsx)(g,{className:`h-3.5 w-3.5`}),` `,s(`activity:specs.runAsGoal`)]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>h(`list`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,m===`list`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(_,{className:`h-3.5 w-3.5`}),` `,s(`activity:specs.list`)]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>h(`graph`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,m===`graph`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),` `,s(`activity:specs.graph`)]})]})]})]}),!l||l.specId!==e.id?(0,T.jsx)(`div`,{className:`flex h-24 items-center justify-center text-sm text-muted-foreground`,children:s(`activity:specs.loadingTasks`)}):m===`graph`?(0,T.jsx)(k,{columns:l.columns}):(0,T.jsx)(`div`,{className:`space-y-1.5`,children:O.map(e=>(0,T.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card px-3 py-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,T.jsx)(`span`,{className:`flex-1 text-sm`,children:e.title}),(0,T.jsx)(`span`,{className:`text-xs capitalize text-muted-foreground`,children:e.displayStatus.replace(`_`,` `)})]},e.id))})]})]},e.id)})})})]})}export{M as SpecsView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,En as n,Hn as r,Ii as i,Oi as a,Pi as o,Pr as s,Qi as c,Wn as l,bi as u,er as d,et as f,fn as p,mi as m,nn as h,nt as g,va as _,yi as v}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{t as y}from"./useWebSocket-BTXT0rOW.js";import{t as b}from"./utils-DxDx8yib.js";import{r as x}from"./stores-CpZiOiOP.js";import{r as S}from"./view-navigation-BRtuAwZo.js";import{t as C}from"./button-Clh96jMK.js";var w=e(t(),1),T=f(),E={completed:{icon:(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),label:`Completed`,text:`text-success`,ring:`border-success/35`},in_progress:{icon:(0,T.jsx)(l,{className:`h-3.5 w-3.5 animate-spin`}),label:`Running`,text:`text-primary`,ring:`border-primary/45`},queued:{icon:(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),label:`Queued`,text:`text-warning`,ring:`border-warning/35`},blocked:{icon:(0,T.jsx)(r,{className:`h-3.5 w-3.5`}),label:`Blocked`,text:`text-destructive`,ring:`border-destructive/30`},pending:{icon:(0,T.jsx)(v,{className:`h-3.5 w-3.5`}),label:`Pending`,text:`text-muted-foreground`,ring:`border-border/70`},review:{icon:(0,T.jsx)(h,{className:`h-3.5 w-3.5`}),label:`Review`,text:`text-primary`,ring:`border-primary/35`},failed:{icon:(0,T.jsx)(u,{className:`h-3.5 w-3.5`}),label:`Failed`,text:`text-destructive`,ring:`border-destructive/45`},cancelled:{icon:(0,T.jsx)(c,{className:`h-3.5 w-3.5`}),label:`Cancelled`,text:`text-muted-foreground`,ring:`border-border/70`}},D=[`completed`,`in_progress`,`queued`,`blocked`,`pending`,`failed`],O={critical:{label:`Crit`,cls:`bg-destructive/10 text-destructive`},high:{label:`High`,cls:`bg-destructive/10 text-destructive`},medium:{label:`Med`,cls:`bg-warning/12 text-warning`},low:{label:`Low`,cls:`bg-success/12 text-success`}};function k({columns:e,onTaskClick:t}){let{t:n}=_();return e.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:board.emptySpec`)}):(0,T.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,T.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-foreground`,children:n(`activity:board.depGraphHeading`)}),(0,T.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs`,children:D.map(e=>(0,T.jsxs)(`span`,{className:b(`inline-flex items-center gap-1.5`,E[e].text),children:[E[e].icon,(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:n(`activity:board.status.${e}`)})]},e))}),(0,T.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-2`,children:e.map((n,r)=>(0,T.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,T.jsxs)(`div`,{className:`w-60 shrink-0`,children:[(0,T.jsx)(`div`,{className:`mb-2 border-b border-border/60 pb-1 text-center text-xs font-medium uppercase text-muted-foreground`,children:n.label}),(0,T.jsx)(`div`,{className:`space-y-2`,children:n.tasks.map(e=>(0,T.jsx)(A,{task:e,onClick:t},e.id))})]}),r<e.length-1&&(0,T.jsx)(`div`,{className:`flex h-full items-center pt-8 text-muted-foreground/75`,children:(0,T.jsx)(o,{className:`h-5 w-5`})})]},n.label))})]})}function A({task:e,onClick:t}){let n=E[e.displayStatus],r=O[e.priority],{t:i}=_();return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.id),className:b(`w-full rounded-lg border bg-background/55 p-2.5 text-left shadow-sm transition-colors hover:border-primary/35 hover:bg-accent/35`,n.ring),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:b(`inline-flex items-center gap-1.5 text-xs font-medium`,n.text),children:[n.icon,(0,T.jsx)(`span`,{className:`font-mono text-foreground`,children:e.shortId})]}),(0,T.jsx)(`span`,{className:b(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r.cls),children:r.label})]}),(0,T.jsx)(`p`,{className:`mt-1.5 text-xs text-foreground`,children:e.title}),e.deps.length>0&&(0,T.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[`← `,e.deps.join(`, `)]}),e.agentName&&(0,T.jsxs)(`div`,{className:b(`mt-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]`,e.displayStatus===`in_progress`?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`),title:e.worktreeBranch?i(`activity:board.worktreePrefix`,{branch:e.worktreeBranch}):void 0,children:[e.displayStatus===`in_progress`&&(0,T.jsx)(l,{className:`h-3 w-3 animate-spin`}),(0,T.jsx)(`span`,{children:e.agentName})]})]})}function j(e){return e.columns.map(e=>({name:e.label,description:``,priority:`medium`,estimateHours:e.tasks.length,parallelizable:!1,taskTemplates:e.tasks.map(e=>({title:e.title,description:e.description,type:e.type,priority:e.priority,estimateHours:1}))}))}function M({onClose:e,onRunStarted:t}){let{client:r}=y(),{t:a}=_(),c=x(e=>e.specs),l=x(e=>e.detail),u=x(e=>e.expandedSpecId),f=x(e=>e.setExpanded),[m,h]=(0,w.useState)(`graph`),v=(0,w.useCallback)(e=>{!l||l.specId!==e.id||(r?.send?.({type:`goal.start`,payload:{title:e.title,phases:j(l),autonomous:!0}}),S(`goal`))},[l,r]),E=(0,w.useCallback)(e=>{let n=e.graphId??(l?.specId===e.id?l.graphId:void 0);n?r?.send?.({type:`sdd.run.from_graph`,payload:{graphId:n,worktrees:!0}}):r?.send?.({type:`sdd.run.from_spec`,payload:{specId:e.id,worktrees:!0}}),t?.(),S(`sddhub`)},[l,r,t]);(0,w.useEffect)(()=>{r?.send?.({type:`specs.list`})},[r]);let D=(0,w.useCallback)(e=>{u===e.id?f(null):(f(e.id),r?.send?.({type:`specs.get`,payload:{specId:e.id}}))},[u,f,r]),O=l?.columns.flatMap(e=>e.tasks)??[],A={done:O.filter(e=>e.status===`completed`).length,running:O.filter(e=>e.status===`in_progress`).length,pending:O.filter(e=>e.status===`pending`||e.displayStatus===`queued`).length};return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,T.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b bg-card px-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(s,{className:`h-5 w-5 text-warning`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:a(`activity:specs.heading`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`activity:specs.subtitle`)})]})]}),(0,T.jsx)(C,{variant:`ghost`,size:`icon`,onClick:e,children:(0,T.jsx)(g,{className:`h-4 w-4`})})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4`,children:c.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:a(`activity:specs.empty`,{command:`/sdd`})}):(0,T.jsx)(`div`,{className:`space-y-3`,children:c.map(e=>{let t=u===e.id,r=e.total>0?Math.round(e.completed/e.total*100):0;return(0,T.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/60`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>D(e),className:`flex w-full items-start gap-3 p-4 text-left`,children:[(0,T.jsx)(`span`,{className:`mt-1 text-muted-foreground`,children:t?(0,T.jsx)(i,{className:`h-4 w-4`}):(0,T.jsx)(o,{className:`h-4 w-4`})}),(0,T.jsx)(s,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.displayId}),(0,T.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] capitalize text-muted-foreground`,children:e.status})]}),(0,T.jsx)(`h2`,{className:`mt-1 text-base font-semibold`,children:e.title}),(0,T.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`h-2 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-success transition-all`,style:{width:`${r}%`}})}),(0,T.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:[e.completed,`/`,e.total]})]})]})]}),t&&(0,T.jsxs)(`div`,{className:`border-t border-border p-4`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{className:`text-sm font-medium`,children:[a(`activity:specs.tasks`,{count:l?.total??e.total}),l&&(0,T.jsxs)(`span`,{className:`ml-3 text-xs font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`text-success`,children:a(`activity:specs.doneCount`,{count:A.done})}),` `,(0,T.jsx)(`span`,{className:`text-primary`,children:a(`activity:specs.runningCount`,{count:A.running})}),` `,(0,T.jsx)(`span`,{children:a(`activity:specs.pendingCount`,{count:A.pending})})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>E(e),title:a(`activity:specs.runAsSddTitle`),className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success transition-colors hover:bg-success/25`,children:[(0,T.jsx)(p,{className:`h-3.5 w-3.5`}),` `,a(`activity:specs.runAsSdd`)]}),(0,T.jsxs)(`button`,{type:`button`,disabled:!l||l.specId!==e.id,onClick:()=>v(e),title:a(`activity:specs.runAsGoalTitle`),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning transition-colors hover:bg-warning/25 disabled:opacity-40`,children:[(0,T.jsx)(p,{className:`h-3.5 w-3.5`}),` `,a(`activity:specs.runAsGoal`)]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>h(`list`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,m===`list`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(d,{className:`h-3.5 w-3.5`}),` `,a(`activity:specs.list`)]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>h(`graph`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,m===`graph`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(n,{className:`h-3.5 w-3.5`}),` `,a(`activity:specs.graph`)]})]})]})]}),!l||l.specId!==e.id?(0,T.jsx)(`div`,{className:`flex h-24 items-center justify-center text-sm text-muted-foreground`,children:a(`activity:specs.loadingTasks`)}):m===`graph`?(0,T.jsx)(k,{columns:l.columns}):(0,T.jsx)(`div`,{className:`space-y-1.5`,children:O.map(e=>(0,T.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card px-3 py-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,T.jsx)(`span`,{className:`flex-1 text-sm`,children:e.title}),(0,T.jsx)(`span`,{className:`text-xs capitalize text-muted-foreground`,children:e.displayStatus.replace(`_`,` `)})]},e.id))})]})]},e.id)})})})]})}export{M as SpecsView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{An as t,C as n,Ca as r,Cr as i,Ct as a,Gi as o,Ki as s,Pt as c,Rt as l,Wn as u,Yr as d,Yt as f,aa as p,br as m,di as h,ei as ee,et as g,nt as te,on as _,pi as v,rn as ne,si as y,tt as b,ua as x,wn as S}from"./vendor-BTDGplXK.js";import{t as C}from"./utils-DxDx8yib.js";import{n as w}from"./stores-CpZiOiOP.js";import{t as T}from"./button-Clh96jMK.js";import{t as E}from"./input-CW-Yw2Wu.js";import{C as D,S as O}from"./index-DxZTscTk.js";var k=e(r(),1),A=g(),re={current:{label:`Current`,badge:`border-success/35 bg-success/10 text-success`,dot:`bg-success`,weight:0},update_available_safe:{label:`Update available`,badge:`border-info/35 bg-info/10 text-info`,dot:`bg-info`,weight:30},update_available_breaking:{label:`Major update`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:50},vulnerable:{label:`Vulnerable`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:100},deprecated:{label:`Deprecated`,badge:`border-destructive/35 bg-destructive/10 text-destructive`,dot:`bg-destructive`,weight:70},yanked:{label:`Yanked`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:80},unmaintained_suspected:{label:`Unmaintained?`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:60},blocked_by_constraints:{label:`Blocked`,badge:`border-warning/30 bg-warning/5 text-warning`,dot:`bg-warning`,weight:40},private_or_unresolved:{label:`Private`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:10},local_path:{label:`Local path`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},git_dependency:{label:`Git`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unsupported:{label:`Unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unknown:{label:`Unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:20}},ie={label:`Unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:0};function j(e){return re[e]??ie}var M={npm:{label:`npm / Node.js`,icon:S},python:{label:`Python`,icon:h},rust:{label:`Rust`,icon:l},go:{label:`Go`,icon:ne},dotnet:{label:`.NET`,icon:t},php:{label:`PHP`,icon:a},dart:{label:`Dart / Flutter`,icon:y},maven:{label:`Maven`,icon:x},gradle:{label:`Gradle`,icon:s},ruby:{label:`Ruby`,icon:m},swift:{label:`Swift`,icon:b},elixir:{label:`Elixir`,icon:a},cpp:{label:`C / C++`,icon:v}},N={label:`Unknown`};function P(e){return M[e]??N}function F({ecosystem:e,className:t=`size-3.5 shrink-0`}){let n=P(e);if(!n.icon)return null;let r=n.icon;return(0,A.jsx)(r,{className:t})}function ae(e){return j(e.status).weight>=50}var I=[`critical`,`high`,`medium`,`low`,`info`],L={critical:{label:`Critical`,badge:`border-destructive/45 bg-destructive/15 text-destructive`},high:{label:`High`,badge:`border-destructive/35 bg-destructive/10 text-destructive`},medium:{label:`Medium`,badge:`border-warning/35 bg-warning/10 text-warning`},low:{label:`Low`,badge:`border-info/35 bg-info/10 text-info`},info:{label:`Info`,badge:`border-border/70 bg-muted text-muted-foreground`}},R={none:`No action`,upgrade_patch:`Patch upgrade`,upgrade_minor:`Minor upgrade`,upgrade_major:`Major upgrade`,replace:`Replace`,remove:`Remove`,investigate:`Investigate`},z={full:{label:`Full`,badge:`border-success/35 bg-success/10 text-success`,note:void 0},partial:{label:`Partial`,badge:`border-warning/35 bg-warning/10 text-warning`,note:`limited`},unsupported:{label:`Unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,note:`best-effort`}};function B(e){return z[e]??z.unsupported}function V(e){if(!e)return null;let t=/^\D*(\d+)/.exec(e);if(!t?.[1])return null;let n=Number(t[1]);return Number.isFinite(n)?n:null}function H(e){let t=V(e.locked??e.installed??e.requested),n=V(e.latestStable);if(t===null||n===null||n<=t)return{majorsBehind:0,label:null};let r=n-t;return{majorsBehind:r,label:`${r} major${r===1?``:`s`} behind`}}function U(e){return e.locked??e.installed??e.requested??null}function W(e){return e.confidence<1}function G({className:e,children:t}){return(0,A.jsx)(`span`,{className:C(`inline-flex shrink-0 items-center gap-1 border px-1.5 py-0.5 text-[10px] font-medium`,e),children:t})}function K({label:e,value:t,hint:n,tone:r=`default`}){let i={default:`text-foreground`,success:`text-success`,warning:`text-warning`,info:`text-info`,destructive:`text-destructive`}[r];return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/55 px-3 py-2.5 shadow-[inset_0_1px_0_hsl(var(--foreground)/0.035)]`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:e}),(0,A.jsxs)(`div`,{className:`mt-1 flex items-end justify-between gap-2`,children:[(0,A.jsx)(`p`,{className:C(`font-mono text-xl font-bold tabular-nums`,i),children:t}),(0,A.jsx)(`p`,{className:`truncate text-[9px] text-muted-foreground`,children:n})]})]})}function oe({dependency:e,findings:t,deepDive:n,onDeepDive:r,onBack:i,coverage:a}){let o=j(e.status),s=U(e),l=H(e),f=a?B(a).note:void 0;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`header`,{className:`shrink-0 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:i,"aria-label":`Back to dependency list`,className:`shrink-0 md:hidden`,children:(0,A.jsx)(p,{className:`size-4`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`h2`,{className:`min-w-0 truncate font-mono text-sm font-bold text-foreground`,children:e.name}),(0,A.jsx)(G,{className:o.badge,children:o.label})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[P(e.ecosystem).label,` ·`,` `,e.direct?`direct`:`transitive`,` · `,e.scope,` ·`,` `,e.sourceType,f&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,A.jsx)(`span`,{className:`text-warning`,children:f})]})]})]})]}),(0,A.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-baseline gap-2 font-mono text-xs`,children:[(0,A.jsx)(`span`,{className:`text-foreground`,children:s??`—`}),e.latestStable&&e.latestStable!==s&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`text-info`,children:e.latestStable})]}),l.label&&(0,A.jsxs)(`span`,{className:`text-[10px] text-warning`,children:[`(`,l.label,`)`]})]})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`dl`,{className:`grid grid-cols-2 gap-px border border-border/70 bg-border/60`,children:[(0,A.jsx)(q,{label:`Constraint`,value:e.requested??`—`,mono:!0}),(0,A.jsx)(q,{label:`Locked`,value:e.locked??`—`,mono:!0}),(0,A.jsx)(q,{label:`Latest stable`,value:e.latestStable??`—`,mono:!0}),(0,A.jsx)(q,{label:`License`,value:e.license??`—`}),e.wanted&&(0,A.jsx)(q,{label:`Wanted`,value:e.wanted,mono:!0}),e.resolvable&&(0,A.jsx)(q,{label:`Resolvable`,value:e.resolvable,mono:!0}),e.purl&&(0,A.jsx)(q,{label:`PURL`,value:e.purl,mono:!0}),(0,A.jsx)(q,{label:`Registry flags`,value:[e.deprecated&&`deprecated`,e.yanked&&`yanked`].filter(Boolean).join(`, `)||`none`})]}),(0,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:`Findings`}),(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>r(e),disabled:n.status===`loading`,className:`h-7 text-[10px]`,children:[n.status===`loading`?(0,A.jsx)(u,{className:`size-3 animate-spin`}):(0,A.jsx)(c,{className:`size-3`}),n.status===`loading`?`Researching…`:`Deep dive`]})]}),n.status===`error`&&n.error&&(0,A.jsx)(`p`,{role:`alert`,className:`mb-1.5 text-[10px] text-destructive`,children:n.error}),t.length===0?(0,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Nothing flagged. Run a deep dive to have the model research this package against the web.`}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map(e=>(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:L[e.severity].badge,children:L[e.severity].label}),(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]??e.action}),W(e)&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(c,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.jsx)(`p`,{className:`mt-1 border-l-2 border-warning/40 pl-2 text-[10px] leading-relaxed text-warning`,children:e.breakingRisk})]},e.id))})]}),(0,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.jsx)(`h3`,{className:`mb-1.5 text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:`Evidence`}),e.evidence.length===0?(0,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`No evidence recorded.`}):(0,A.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.evidence.map((t,n)=>(0,A.jsxs)(`li`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:t.kind}),(0,A.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:new Date(t.retrievedAt).toLocaleString()})]}),t.source.startsWith(`http`)?(0,A.jsxs)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`mt-1 flex min-w-0 items-center gap-1 truncate text-[10px] text-info underline-offset-2 hover:underline`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:t.source}),(0,A.jsx)(d,{className:`size-2.5 shrink-0`})]}):(0,A.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground`,children:t.source}),t.detail&&(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] leading-relaxed text-muted-foreground`,children:t.detail})]},`${e.id}-evidence-${n}`))})]})]})]})}function q({label:e,value:t,mono:n}){return(0,A.jsxs)(`div`,{className:`bg-card/55 px-2.5 py-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:C(`mt-0.5 truncate text-[11px] text-foreground`,n&&`font-mono`),children:t})]})}var J=`grid grid-cols-[minmax(0,2.2fr)_minmax(0,1.6fr)_minmax(0,1.1fr)] gap-2`;function se({dependencies:e,selectedId:t,hasDependencies:r,coverageByWorkspaceId:i,onSelect:a}){let o=D(e,30);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:r?`No dependencies match the current filters.`:`No dependencies inventoried yet. Run a scan to populate the inventory.`})}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:C(J,`shrink-0 border-b border-border/70 bg-card/45 px-3 py-1.5 text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`),children:[(0,A.jsx)(`span`,{children:`Package`}),(0,A.jsx)(`span`,{children:`Installed → Latest`}),(0,A.jsx)(`span`,{children:`Status`})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,A.jsx)(n,{className:`h-full`,"aria-label":`Dependencies`,children:o.pageItems.map(e=>(0,A.jsx)(Y,{dependency:e,selected:e.id===t,coverage:i?.get(e.workspaceId),onSelect:a},e.id))})}),(0,A.jsx)(O,{page:o.page,pageSize:o.pageSize,totalItems:o.totalItems,onPageChange:o.setPage,itemLabel:`dependencies`})]})}function Y({dependency:e,selected:t,coverage:n,onSelect:r}){let i=j(e.status),a=U(e),o=H(e),s=n?B(n).note:void 0;return(0,A.jsxs)(`button`,{type:`button`,onClick:()=>r(e),"aria-current":t,className:C(J,`w-full items-center border-b border-border/40 px-3 py-2 text-left transition-colors hover:bg-accent/40`,t&&`bg-accent/60`),children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:C(`size-1.5 shrink-0`,i.dot),"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`truncate font-mono text-xs text-foreground`,children:e.name})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem,className:`mr-0.5 inline-block size-3 align-text-bottom`}),P(e.ecosystem).label,` · `,e.direct?`direct`:`transitive`,` · `,e.scope,s&&(0,A.jsxs)(A.Fragment,{children:[` · `,(0,A.jsx)(`span`,{className:`text-warning`,children:s})]})]})]}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5 font-mono text-[11px]`,children:[(0,A.jsx)(`span`,{className:`truncate text-foreground`,children:a??`—`}),e.latestStable&&e.latestStable!==a&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`truncate text-info`,children:e.latestStable})]})]}),o.label?(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-warning`,children:o.label}):e.requested&&(0,A.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:e.requested})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:[(0,A.jsx)(G,{className:i.badge,children:i.label}),e.deprecated&&(0,A.jsx)(G,{className:`border-destructive/35 bg-destructive/10 text-destructive`,children:`dep`}),e.yanked&&(0,A.jsx)(G,{className:`border-destructive/45 bg-destructive/15 text-destructive`,children:`yank`})]})]})}function ce({findings:e,dependenciesById:t,onSelectDependency:n}){let r=D(e,20);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsxs)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:[`No findings. Run `,(0,A.jsx)(`span`,{className:`font-mono text-foreground`,children:`Analyze`}),` to check versions and advisories against upstream registries, then interpret the results.`]})}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-4`,children:I.map(e=>[e,r.pageItems.filter(t=>t.severity===e)]).filter(([,e])=>e.length>0).map(([e,r])=>(0,A.jsxs)(`section`,{children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,A.jsx)(G,{className:L[e].badge,children:L[e].label}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] tabular-nums text-muted-foreground`,children:r.length})]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map(e=>(0,A.jsx)(X,{finding:e,dependency:t.get(e.dependencyId),onSelectDependency:n},e.id))})]},e))})}),(0,A.jsx)(O,{page:r.page,pageSize:r.pageSize,totalItems:r.totalItems,onPageChange:r.setPage,itemLabel:`findings`})]})}function X({finding:e,dependency:t,onSelectDependency:n}){let r=W(e);return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(e.dependencyId),className:`min-w-0 truncate font-mono text-xs text-foreground underline-offset-2 hover:underline`,children:t?.name??e.dependencyId}),(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]??e.action}),r&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(c,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.jsx)(`p`,{className:`mt-1 border-l-2 border-warning/40 pl-2 text-[10px] leading-relaxed text-warning`,children:e.breakingRisk}),e.evidence.length>0&&(0,A.jsx)(`ul`,{className:C(`mt-1.5 flex flex-col gap-0.5`),children:e.evidence.slice(0,4).map((t,n)=>(0,A.jsx)(`li`,{className:`min-w-0 truncate text-[10px]`,children:t.source.startsWith(`http`)?(0,A.jsx)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`text-info underline-offset-2 hover:underline`,children:t.detail??t.source}):(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:t.detail??t.source})},`${e.id}-${n}`))})]})}function le({searchQuery:e,ecosystemFilter:t,statusFilter:n,directOnly:r,sort:a,hasFilters:o,ecosystems:s,statuses:c,visibleCount:l,totalCount:u,onSearchChange:d,onEcosystemFilterChange:p,onStatusFilterChange:m,onToggleDirectOnly:h,onSortChange:ee,onClearFilters:g}){return(0,A.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,A.jsx)(f,{className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(E,{"aria-label":`Search dependencies`,value:e,onChange:e=>d(e.target.value),placeholder:`Search by package name…`,className:`h-10 min-w-0 bg-background pl-9 pr-8 text-xs`}),e&&(0,A.jsx)(`button`,{type:`button`,"aria-label":`Clear search`,onClick:()=>d(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,A.jsx)(te,{className:`size-3.5`})})]}),(0,A.jsx)(T,{variant:r?`default`:`outline`,size:`sm`,onClick:h,"aria-pressed":r,title:`Show only dependencies this project declares itself`,className:`shrink-0`,children:`Direct only`}),o&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:g,"aria-label":`Clear all filters`,title:`Clear all filters`,className:`shrink-0`,children:(0,A.jsx)(i,{className:`size-4`})})]}),(0,A.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-ecosystem-filter`,children:`Filter by ecosystem`}),(0,A.jsxs)(`select`,{id:`techstack-ecosystem-filter`,value:t,onChange:e=>p(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`all`,children:`All ecosystems`}),s.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[P(e).label,` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-status-filter`,children:`Filter by status`}),(0,A.jsxs)(`select`,{id:`techstack-status-filter`,value:n,onChange:e=>m(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`all`,children:`All statuses`}),c.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[j(e).label,` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-sort`,children:`Sort dependencies`}),(0,A.jsxs)(`select`,{id:`techstack-sort`,value:a,onChange:e=>ee(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`attention`,children:`Sort: needs attention`}),(0,A.jsx)(`option`,{value:`drift`,children:`Sort: most out of date`}),(0,A.jsx)(`option`,{value:`name`,children:`Sort: name`})]})]})]}),(0,A.jsx)(`p`,{className:C(`text-[10px] text-muted-foreground`,o&&`text-info`),children:l===u?`${u} dependencies`:`${l} of ${u} dependencies`})]})}var ue=[{id:`dependencies`,label:`Dependencies`},{id:`findings`,label:`Findings`},{id:`workspaces`,label:`Workspaces`},{id:`trends`,label:`Trends`},{id:`remediation`,label:`Remediation`}],Z=new Set([`npm`,`python`,`rust`,`go`,`php`,`dotnet`]);function de(){let e=w(e=>e.snapshot),t=w(e=>e.stale),n=w(e=>e.loading),r=w(e=>e.error),i=w(e=>e.activeJob),[a,o]=(0,k.useState)(`dependencies`),[s,l]=(0,k.useState)(``),[d,f]=(0,k.useState)(`all`),[p,m]=(0,k.useState)(`all`),[h,g]=(0,k.useState)(!1),[v,ne]=(0,k.useState)(`attention`),[y,b]=(0,k.useState)(null),[x,S]=(0,k.useState)([]),[E,D]=(0,k.useState)({status:`idle`,error:null}),[O,re]=(0,k.useState)(null),[ie,M]=(0,k.useState)(null),[N,P]=(0,k.useState)(new Set),[F,I]=(0,k.useState)(!1),L=(0,k.useCallback)(async()=>{let e=w.getState();e.setLoading(!0),e.setError(null);try{let t=await fetch(`/api/techstack/snapshot`);if(t.status===404){e.setSnapshot(null,!1);return}if(!t.ok)throw Error(`HTTP ${t.status}: ${t.statusText}`);let n=await t.json();e.setSnapshot(n.snapshot,n.stale)}catch(t){e.setError(t instanceof Error?t.message:String(t))}},[]),R=(0,k.useCallback)(async e=>{let t=w.getState();t.setLoading(!0),t.setError(null);try{let n=await fetch(`/api/techstack/${e}`,{method:`POST`}),r=await n.json();if(!n.ok||!r.jobId)throw Error(r.error??`HTTP ${n.status}: ${n.statusText}`);t.jobStarted(r.jobId,e)}catch(e){t.setError(e instanceof Error?e.message:String(e))}},[]),z=(0,k.useCallback)(async()=>{let e=w.getState().activeJob;if(e)try{let t=await fetch(`/api/techstack/jobs/${encodeURIComponent(e.id)}/cancel`,{method:`POST`});if(!t.ok)throw Error(`HTTP ${t.status}: ${t.statusText}`);w.getState().jobCancelled(e.id)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}},[]),B=(0,k.useCallback)(async e=>{D({status:`loading`,error:null});try{let t=await fetch(`/api/techstack/deps/${encodeURIComponent(e.id)}/research`,{method:`POST`}),n=await t.json();if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);S(n.findings??[]),D({status:`idle`,error:null})}catch(e){D({status:`error`,error:e instanceof Error?e.message:String(e)})}},[]);(0,k.useEffect)(()=>{L()},[L]),(0,k.useEffect)(()=>{a!==`trends`&&a!==`remediation`||fetch(`/api/techstack/${a===`trends`?`trends`:`remediation`}`).then(async e=>{let t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);t.trend&&re(t.trend),t.plan&&M(t.plan)}).catch(e=>w.getState().setError(e instanceof Error?e.message:String(e)))},[a,e?.id]);let V=(0,k.useCallback)(async()=>{if(N.size!==0){I(!0);try{let e=await fetch(`/api/techstack/remediation/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({approvedItems:[...N]})}),t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);P(new Set),await R(`inventory`)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}finally{I(!1)}}},[N,R]);(0,k.useEffect)(()=>{S([]),D({status:`idle`,error:null})},[e?.id]);let U=(0,k.useMemo)(()=>e?.dependencies??[],[e]),W=(0,k.useMemo)(()=>e?.findings??[],[e]),G=(0,k.useMemo)(()=>new Map(U.map(e=>[e.id,e])),[U]),q=(0,k.useMemo)(()=>ge(U.map(e=>e.ecosystem)),[U]),J=(0,k.useMemo)(()=>ge(U.map(e=>e.status)),[U]),Y=(0,k.useMemo)(()=>new Map(e?.workspaces.map(e=>[e.id,e.coverage])??[]),[e]),X=(0,k.useMemo)(()=>{let e=s.trim().toLowerCase(),t=[...U.filter(t=>!(e&&!t.name.toLowerCase().includes(e)||d!==`all`&&t.ecosystem!==d||p!==`all`&&t.status!==p||h&&!t.direct))];return v===`name`?t.sort((e,t)=>e.name.localeCompare(t.name)):v===`drift`?t.sort((e,t)=>H(t).majorsBehind-H(e).majorsBehind||e.name.localeCompare(t.name)):t.sort((e,t)=>j(t.status).weight-j(e.status).weight||Number(t.direct)-Number(e.direct)||e.name.localeCompare(t.name)),t},[U,s,d,p,h,v]),Z=y?G.get(y):void 0,de=(0,k.useMemo)(()=>Z?[...W.filter(e=>e.dependencyId===Z.id),...x.filter(e=>e.dependencyId===Z.id)]:[],[W,x,Z]),ve=(0,k.useMemo)(()=>U.filter(ae).length,[U]),ye=(0,k.useMemo)(()=>U.filter(e=>H(e).majorsBehind>0).length,[U]),be=(0,k.useMemo)(()=>U.filter(e=>e.status===`vulnerable`).length,[U]),xe=s.trim()!==``||d!==`all`||p!==`all`||h,Se=(0,k.useCallback)(()=>{l(``),f(`all`),m(`all`),g(!1)},[]),$=!!(i&&![`completed`,`failed`,`cancelled`].includes(i.status)),Ce=(0,k.useCallback)(e=>{b(e),o(`dependencies`)},[]);return(0,A.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,A.jsx)(`header`,{className:`shrink-0 border-b border-border/70 px-4 py-3`,children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h1`,{className:`text-base font-bold sm:text-lg`,children:`TechStack`}),(0,A.jsx)(`span`,{className:`border border-info/35 bg-info/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-info`,children:e?`${e.workspaces.length} workspaces`:`no scan yet`}),t&&(0,A.jsx)(`span`,{className:`border border-warning/35 bg-warning/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-warning`,children:`stale >24h`})]}),(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground sm:text-xs`,children:e?`${e.targetRoot} · scanned ${new Date(e.createdAt).toLocaleString()}`:`Scan the open project to inventory its dependencies.`})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>void R(`inventory`),disabled:$,title:`Offline: re-read manifests and lockfiles`,children:[(0,A.jsx)(_,{className:C(`size-3.5`,$&&`animate-spin`)}),(0,A.jsx)(`span`,{className:`hidden sm:inline`,children:`Refresh`})]}),(0,A.jsxs)(T,{size:`sm`,onClick:()=>void R(`analyze`),disabled:$,title:`Check registries and advisories, then interpret the results with the model`,children:[(0,A.jsx)(c,{className:`size-3.5`}),`Analyze`]}),$&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>void z(),"aria-label":`Cancel job`,children:(0,A.jsx)(te,{className:`size-4`})}),(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>e&&_e(e),disabled:!e,"aria-label":`Export snapshot as JSON`,title:`Export snapshot as JSON`,children:(0,A.jsx)(ee,{className:`size-4`})})]})]})}),e&&(0,A.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-px border-b border-border/70 bg-border/60 sm:grid-cols-4`,children:[(0,A.jsx)(K,{label:`Dependencies`,value:U.length,hint:`${X.length} visible`}),(0,A.jsx)(K,{label:`Outdated`,value:ye,hint:`majors behind`,tone:ye>0?`warning`:`success`}),(0,A.jsx)(K,{label:`Vulnerable`,value:be,hint:`known advisories`,tone:be>0?`destructive`:`success`}),(0,A.jsx)(K,{label:`Findings`,value:W.length,hint:`${ve} need attention`,tone:W.length>0?`info`:`default`})]}),($||r)&&(0,A.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-2`,"aria-live":`polite`,children:[$&&i&&(0,A.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 text-xs text-info`,children:[(0,A.jsx)(u,{className:`size-3.5 animate-spin`}),(0,A.jsx)(`span`,{className:`font-mono`,children:i.status}),i.progress&&(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[i.progress.completed,`/`,i.progress.total]})]}),r&&(0,A.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-destructive`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>void L(),className:`underline`,children:`Retry`})]})]}),n&&!e?(0,A.jsx)(Q,{}):e?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`nav`,{className:`flex shrink-0 gap-1 border-b border-border/70 px-2`,children:ue.map(e=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>o(e.id),"aria-current":a===e.id,className:C(`border-b-2 px-3 py-2 text-xs font-medium transition-colors`,a===e.id?`border-primary text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:[e.label,e.id===`findings`&&W.length>0&&(0,A.jsx)(`span`,{className:`ml-1.5 font-mono text-[10px] tabular-nums text-muted-foreground`,children:W.length})]},e.id))}),a===`dependencies`&&(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 md:grid-cols-[minmax(340px,1fr)_minmax(0,1.15fr)]`,children:[(0,A.jsxs)(`section`,{className:C(`min-h-0 border-r border-border/70`,Z?`hidden md:flex md:flex-col`:`flex flex-col`),"aria-label":`Dependency list`,children:[(0,A.jsx)(le,{searchQuery:s,ecosystemFilter:d,statusFilter:p,directOnly:h,sort:v,hasFilters:xe,ecosystems:q,statuses:J,visibleCount:X.length,totalCount:U.length,onSearchChange:l,onEcosystemFilterChange:f,onStatusFilterChange:m,onToggleDirectOnly:()=>g(e=>!e),onSortChange:ne,onClearFilters:Se}),(0,A.jsx)(se,{dependencies:X,selectedId:y,hasDependencies:U.length>0,coverageByWorkspaceId:Y,onSelect:e=>b(e.id)})]}),(0,A.jsx)(`section`,{className:C(`min-h-0`,Z?`flex flex-col`:`hidden md:flex md:flex-col`),"aria-label":`Dependency detail`,children:Z?(0,A.jsx)(oe,{dependency:Z,findings:de,deepDive:E,onDeepDive:B,onBack:()=>b(null),coverage:Y.get(Z.workspaceId)}):(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`Select a dependency to see its versions, evidence, and findings.`})})})]}),a===`findings`&&(0,A.jsx)(ce,{findings:W,dependenciesById:G,onSelectDependency:Ce}),a===`workspaces`&&(0,A.jsx)(me,{snapshot:e}),a===`trends`&&(0,A.jsx)(fe,{trend:O}),a===`remediation`&&(0,A.jsx)(pe,{plan:ie,approved:N,applying:F,onToggle:e=>P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onApply:()=>void V()})]}):(0,A.jsx)(he,{onScan:()=>void R(`inventory`),disabled:$})]})}function fe({trend:e}){return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[e.snapshots,` snapshots`,e.vulnerabilityHalfLifeMs===void 0?``:` · vulnerability half-life ${(e.vulnerabilityHalfLifeMs/864e5).toFixed(1)} days`]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.points.map(e=>(0,A.jsxs)(`div`,{className:`grid grid-cols-4 border border-border/70 bg-card/40 p-2 text-xs`,children:[(0,A.jsx)(`span`,{children:new Date(e.createdAt).toLocaleDateString()}),(0,A.jsxs)(`span`,{children:[e.dependencies,` deps`]}),(0,A.jsxs)(`span`,{className:`text-warning`,children:[e.outdated,` outdated`]}),(0,A.jsxs)(`span`,{className:`text-destructive`,children:[e.vulnerable,` vulnerable`]})]},e.snapshotId))})]}):(0,A.jsx)(Q,{})}function pe({plan:e,approved:t,applying:n,onToggle:r,onApply:i}){return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.warning}),(0,A.jsxs)(T,{size:`sm`,disabled:t.size===0||n,onClick:i,children:[n&&(0,A.jsx)(u,{className:`size-3.5 animate-spin`}),`Apply `,t.size>0?t.size:``]})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.items.map(e=>{let n=`${e.workspaceId}:${e.ecosystem}:${e.dependencyName}:${e.action}`,i=e.action===`replace`||e.action===`investigate`||!Z.has(e.ecosystem);return(0,A.jsxs)(`label`,{className:C(`flex gap-3 border border-border/70 bg-card/40 p-2.5`,i?`cursor-not-allowed opacity-65`:`cursor-pointer`),children:[(0,A.jsx)(`input`,{type:`checkbox`,disabled:i,checked:t.has(n),onChange:()=>r(n)}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`span`,{className:`block font-mono text-xs`,children:[e.dependencyName,` · `,e.action]}),(0,A.jsxs)(`span`,{className:`block text-[10px] text-muted-foreground`,children:[e.currentVersion??`?`,` → `,e.targetVersion??`latest`,` · `,e.rationale]}),i&&(0,A.jsx)(`span`,{className:`block text-[10px] text-warning`,children:`Requires a manual package choice.`})]})]},n)}),e.items.length===0&&(0,A.jsx)(`p`,{className:`p-8 text-center text-xs text-muted-foreground`,children:`No remediation needed.`})]})]}):(0,A.jsx)(Q,{})}function me({snapshot:e}){let t=(0,k.useMemo)(()=>{let t=new Map;for(let n of e.dependencies)t.set(n.workspaceId,(t.get(n.workspaceId)??0)+1);return t},[e]);return e.workspaces.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No workspaces detected.`})}):(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.workspaces.map(e=>{let n=z[e.coverage];return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate font-mono text-xs text-foreground`,children:e.relativeRoot}),(0,A.jsxs)(`p`,{className:`mt-0.5 flex items-center gap-1 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem}),(0,A.jsx)(`span`,{children:P(e.ecosystem).label}),e.packageManager?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(`span`,{children:e.packageManager})]}):null,(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsxs)(`span`,{children:[t.get(e.id)??0,` deps`]})]})]}),(0,A.jsx)(`span`,{className:C(`shrink-0 border px-1.5 py-0.5 text-[10px] font-medium`,n.badge),children:n.label})]}),e.manifests.length>0&&(0,A.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.manifests.map(e=>(0,A.jsx)(`span`,{className:`border border-border/70 bg-background/45 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:e.split(/[/\\]/).pop()},e))})]},e.id)})})})}function Q(){return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,A.jsx)(u,{className:`size-5 animate-spin text-muted-foreground`}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Loading snapshot…`})]})})}function he({onScan:e,disabled:t}){let n=(0,k.useMemo)(()=>Object.values(M).map(e=>e.label).join(`, `),[]);return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-3 text-center`,children:[(0,A.jsx)(`div`,{className:`flex size-14 items-center justify-center border border-info/25 bg-info/5 text-info`,children:(0,A.jsx)(o,{className:`size-6`})}),(0,A.jsx)(`h2`,{className:`text-sm font-semibold`,children:`No inventory yet`}),(0,A.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`TechStack reads every manifest and lockfile in the open project — `,n,` — and compares what you have against the upstream registries.`]}),(0,A.jsxs)(T,{size:`sm`,onClick:e,disabled:t,children:[(0,A.jsx)(_,{className:C(`size-3.5`,t&&`animate-spin`)}),`Scan this project`]})]})})}function ge(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))}function _e(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`techstack.json`,r.click(),URL.revokeObjectURL(n)}export{de as TechStackView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,dn as n,et as r,jt as i,nn as a,nt as o,va as s,xa as c,xt as l}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{n as u}from"./ui-store-C-oyG_br.js";import{t as d}from"./ws-client-DqIqzkfU.js";import{n as f,t as p}from"./utils-DxDx8yib.js";import{t as m}from"./session-store-D4JWBP5w.js";import{M as h}from"./stores-CpZiOiOP.js";import{n as g,t as _}from"./xterm-DUBp1lnG.js";var v=e(t(),1),y=`wrongstack.terminalDockHeight`;function b(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-260));return Math.min(Math.max(Math.round(e),140),t)}var x=r(),S={background:`#1e1e2e`,foreground:`#cdd6f4`,cursor:`#f5e0dc`,selectionBackground:`#585b70`,black:`#45475a`,red:`#f38ba8`,green:`#a6e3a1`,yellow:`#f9e2af`,blue:`#89b4fa`,magenta:`#f5c2e7`,cyan:`#94e2d5`,white:`#bac2de`,brightBlack:`#585b70`,brightRed:`#f38ba8`,brightGreen:`#a6e3a1`,brightYellow:`#f9e2af`,brightBlue:`#89b4fa`,brightMagenta:`#f5c2e7`,brightCyan:`#94e2d5`,brightWhite:`#a6adc8`},C=8;function w(e=!1){return typeof window>`u`?300:b(window.innerHeight*(e?.32:.4))}function T(e=!1){if(typeof window>`u`)return w(e);try{let t=window.localStorage.getItem(y),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?b(n):w(e)}catch{return w(e)}}function E(e){try{window.localStorage.setItem(y,String(b(e)))}catch{}}function D(){return f()}function O(e){return{id:D(),name:`Terminal ${e}`,status:`starting`}}function k({desktopShell:e=!1,onClose:t}){let r=(0,v.useRef)(null),{t:c}=s(),d=(0,v.useRef)(1),[f,h]=(0,v.useState)(()=>T(e)),[g,_]=(0,v.useState)(()=>[O(1)]),[y,S]=(0,v.useState)(()=>g[0]?.id??``),w=u(e=>e.terminalCreateNonce),k=(0,v.useRef)(w),j=m(e=>e.projectName),M=m(e=>e.cwd);(0,v.useEffect)(()=>{let e=()=>{h(e=>{let t=b(e);return E(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),r.current?.();let t=e.clientY,n=f,i=document.body.style.cursor,a=document.body.style.userSelect;document.body.style.cursor=`ns-resize`,document.body.style.userSelect=`none`;let o=e=>{let r=b(n+t-e.clientY);h(r),E(r)},s=()=>{document.body.style.cursor=i,document.body.style.userSelect=a,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),r.current===s&&(r.current=null)};r.current=s,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s,{once:!0}),window.addEventListener(`pointercancel`,s,{once:!0})};(0,v.useEffect)(()=>()=>r.current?.(),[]);let P=()=>{_(e=>{if(e.length>=C)return e;d.current+=1;let t=O(d.current);return S(t.id),[...e,t]})};(0,v.useEffect)(()=>{w!==k.current&&(k.current=w,P())},[w]);let F=e=>{_(n=>{let r=n.findIndex(t=>t.id===e);if(r===-1)return n;let i=n.filter(t=>t.id!==e);return i.length===0?(queueMicrotask(t),i):(y===e&&S(i[Math.max(0,r-1)]?.id??i[0]?.id??``),i)})},I=e=>{let t=D();_(n=>{let r=!1,i=n.map(n=>n.id===e?(r=!0,{...n,id:t,status:`starting`,exitCode:void 0}):n);return r&&S(t),i})},L=()=>{_([]),S(``),queueMicrotask(t)},R=(e,t)=>{_(n=>n.map(n=>n.id===e?{...n,...t}:n))},z=g.find(e=>e.id===y)??g[0]??null;return(0,x.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:f},"data-shell":e?`desktop`:`browser`,className:p(`z-30 flex min-h-0 shrink-0 flex-col border-t border-border/70 bg-card shadow-2xl`,e&&`ws-terminal-desktop`),children:[(0,x.jsx)(`hr`,{"aria-orientation":`horizontal`,tabIndex:0,title:c(`activity:terminal.resize`),onPointerDown:N,className:`h-1.5 cursor-ns-resize bg-muted/70 transition-colors hover:bg-primary/35 border-0`}),(0,x.jsxs)(`div`,{className:p(`flex min-w-0 items-center justify-between gap-3 border-b border-border/70 bg-card/85`,e?`px-2 py-1`:`px-3 py-1.5`),children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-foreground`,children:[(0,x.jsx)(i,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,x.jsx)(`span`,{className:`font-medium`,children:c(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,x.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:j||M||c(`activity:terminal.projectShell`)})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=C,title:g.length>=C?c(`activity:terminal.maxTerminals`,{count:C}):c(`activity:terminal.newTerminal`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,x.jsx)(n,{className:`h-4 w-4`})}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>z&&I(z.id),disabled:!z,title:c(`activity:terminal.restart`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,x.jsx)(a,{className:`h-3.5 w-3.5`})}),(0,x.jsx)(`button`,{type:`button`,onClick:L,disabled:g.length===0,title:c(`activity:terminal.closeAll`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,x.jsx)(l,{className:`h-3.5 w-3.5`})}),(0,x.jsx)(`button`,{type:`button`,onClick:t,title:c(`activity:terminal.closeDock`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:(0,x.jsx)(o,{className:`h-4 w-4`})})]})]}),(0,x.jsx)(`div`,{className:p(`flex min-w-0 items-center gap-1 overflow-x-auto border-b border-border/70 bg-[hsl(var(--surface-2)/0.45)]`,e?`px-1.5 py-0.5`:`px-2 py-1`),children:g.map(t=>(0,x.jsxs)(`div`,{className:p(`group inline-flex items-center rounded border text-xs transition-colors`,e?`h-6 min-w-[92px] max-w-[148px]`:`h-7 min-w-[112px] max-w-[180px]`,y===t.id?`border-primary/35 bg-primary/10 text-primary`:`border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,x.jsxs)(`button`,{type:`button`,onClick:()=>S(t.id),title:t.status===`exited`?`${t.name} exited`:t.name,className:`inline-flex min-w-0 flex-1 items-center gap-2 px-2 text-left`,children:[(0,x.jsx)(`span`,{className:p(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`&&`bg-success`,t.status===`starting`&&`bg-primary`,t.status===`exited`&&`bg-destructive`)}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,x.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),F(t.id)},className:`mr-1 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground opacity-70 hover:bg-accent hover:text-foreground hover:opacity-100`,title:c(`activity:terminal.closeTab`,{name:t.name}),children:(0,x.jsx)(o,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,x.jsx)(`div`,{className:`min-w-0 truncate border-b border-border/60 bg-muted/30 px-3 py-1 text-[11px] font-mono text-muted-foreground`,children:M}),(0,x.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,x.jsx)(A,{id:e.id,active:e.id===y,onRunning:()=>R(e.id,{status:`running`}),onExit:t=>R(e.id,{status:`exited`,exitCode:t})},e.id))})]})}function A({id:e,active:t,onRunning:n,onExit:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(n),l=(0,v.useRef)(r),u=h(e=>e.wsConnected);return(0,v.useEffect)(()=>{s.current=n,l.current=r},[r,n]),(0,v.useEffect)(()=>{let t=i.current;if(!t)return;let n=new _({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:S,scrollback:5e3}),r=new g;a.current=n,o.current=r,n.loadAddon(r),n.open(t);try{r.fit()}catch{}let u=d(h.getState().wsUrl);u.send({type:`terminal.create`,payload:{id:e,cols:n.cols,rows:n.rows}});let f=!1,p=u.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&(f||(f=!0,s.current()),n.write(t.payload.data))}),m=u.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(n.write(`\r\n\x1b[2m${c.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),l.current(t.payload.exitCode))}),v=n.onData(t=>{u.send({type:`terminal.input`,payload:{id:e,data:t}})}),y=new ResizeObserver(()=>{if(t.offsetParent)try{r.fit(),u.send({type:`terminal.resize`,payload:{id:e,cols:n.cols,rows:n.rows}})}catch{}});return y.observe(t),()=>{p(),m(),v.dispose(),y.disconnect(),u.send({type:`terminal.close`,payload:{id:e}}),n.dispose(),a.current=null,o.current=null}},[e,u]),(0,v.useEffect)(()=>{t&&window.requestAnimationFrame(()=>{try{o.current?.fit();let t=a.current;t&&(d(h.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:t.cols,rows:t.rows}}),t.focus())}catch{}})},[t,e]),(0,x.jsx)(`div`,{ref:i,className:p(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,t?`block`:`hidden`)})}export{k as TerminalPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,Oi as n,_a as r,bi as i,et as a,nt as o,or as s,va as c,vt as l,xa as u}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{n as d,t as f}from"./utils-DxDx8yib.js";var p=e(t(),1),m=a();function h(){return`toast_${d()}`}var g=8e3,_=r(e=>({toasts:[],push:t=>{let n=h();return e(e=>({toasts:[...e.toasts,{...t,id:n}]})),n},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))})),v={success:(e,t=3500)=>_.getState().push({message:e,variant:`success`,ttl:t}),error:(e,t=6e3)=>_.getState().push({message:e,variant:`error`,ttl:t}),warn:(e,t=4500)=>_.getState().push({message:e,variant:`warn`,ttl:t}),info:(e,t=3500)=>_.getState().push({message:e,variant:`info`,ttl:t}),undoable:(e,t,n=u.t(`common:action.undo`),r=g)=>_.getState().push({message:e,variant:`info`,ttl:r,action:{label:n,onClick:t}}),dismiss:e=>_.getState().dismiss(e)};function y({variant:e}){return e===`success`?(0,m.jsx)(n,{className:`h-4 w-4 text-success`}):e===`error`?(0,m.jsx)(i,{className:`h-4 w-4 text-destructive`}):e===`warn`?(0,m.jsx)(l,{className:`h-4 w-4 text-warning`}):(0,m.jsx)(s,{className:`h-4 w-4 text-info`})}function b({entry:e}){let{t}=c(),n=_(e=>e.dismiss);return(0,p.useEffect)(()=>{let t=setTimeout(()=>n(e.id),e.ttl);return()=>clearTimeout(t)},[e.id,e.ttl,n]),(0,m.jsxs)(`div`,{className:f(`flex items-start gap-2 rounded-lg border bg-popover shadow-lg px-3 py-2 text-sm max-w-sm`,`animate-message`,e.variant===`error`&&`border-destructive/40`,e.variant===`warn`&&`border-warning/40`,e.variant===`success`&&`border-success/40`),children:[(0,m.jsx)(y,{variant:e.variant}),(0,m.jsx)(`div`,{className:`flex-1 min-w-0 whitespace-pre-wrap break-words leading-snug`,children:e.message}),e.action&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.onClick(),n(e.id)},className:`shrink-0 font-medium text-primary hover:underline`,children:e.action.label}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>n(e.id),className:`text-muted-foreground hover:text-foreground`,title:t(`activity:toast.dismiss`),"aria-label":t(`activity:toast.dismiss`),children:(0,m.jsx)(o,{className:`h-3.5 w-3.5`})})]})}function x(){let e=_(e=>e.toasts);return e.length===0?null:(0,m.jsx)(`section`,{className:`fixed bottom-4 right-4 z-[60] flex flex-col gap-2 pointer-events-auto`,"aria-label":`Notifications`,"aria-live":`polite`,children:e.map(e=>(0,m.jsx)(b,{entry:e},e.id))})}export{v as n,x as t};
|