@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.
Files changed (530) hide show
  1. package/dist/assets/AgentRosterView-C8j2NuD1.js +11 -0
  2. package/dist/assets/{AnalyticsDashboard-CkceglT6.js → AnalyticsDashboard-D2_HYmYw.js} +1 -1
  3. package/dist/assets/AudienceMemoryPanel-SzXptIQj.js +3 -0
  4. package/dist/assets/{ChangesView-DouwIaDk.js → ChangesView-D31wr7_h.js} +1 -1
  5. package/dist/assets/ChronicleDashboard-B7P4f1hr.js +1 -0
  6. package/dist/assets/CodeEditor-BRDwx8Y-.js +1 -0
  7. package/dist/assets/CodeMap-uabWaeJH.js +1 -0
  8. package/dist/assets/{CronJobsPanel-CAImDL8t.js → CronJobsPanel-C9shS0P2.js} +1 -1
  9. package/dist/assets/DeadCodeScanPanel-CHud_Ugp.js +2 -0
  10. package/dist/assets/{DebugDashboard-DLNPZIEI.js → DebugDashboard-DmqpGXnx.js} +1 -1
  11. package/dist/assets/{DesignGalleryView-D0azMq2e.js → DesignGalleryView-CnAHpKa1.js} +1 -1
  12. package/dist/assets/GoalView-DaptZIKr.js +1 -0
  13. package/dist/assets/KanbanView-DA5Ulb8C.js +3 -0
  14. package/dist/assets/MailboxDetailView-CQtHeWVs.js +1 -0
  15. package/dist/assets/MemoryManager-BWuSS0Pg.js +1 -0
  16. package/dist/assets/{ModelPicker-CN-UD3lc.js → ModelPicker-Dt0wCi90.js} +1 -1
  17. package/dist/assets/OfficeMapPanel-CUNRI3X7.js +4 -0
  18. package/dist/assets/{ProcessMonitor-ButM8C0T.js → ProcessMonitor-Dq760Vqm.js} +1 -1
  19. package/dist/assets/QueuePanel-ZcJliKcY.js +1 -0
  20. package/dist/assets/{RefreshDebugView-DVvWsh9A.js → RefreshDebugView-SivBV0LN.js} +1 -1
  21. package/dist/assets/SageTabs-CGrc4PuM.js +2 -0
  22. package/dist/assets/SddHub-oU47Hv8Y.js +2 -0
  23. package/dist/assets/SessionsDashboard-Dp-Mr844.js +1 -0
  24. package/dist/assets/SetupScreen-BWA_dTU0.js +1 -0
  25. package/dist/assets/SkillDetailView-DmRgd_uu.js +3 -0
  26. package/dist/assets/{SpecsView-BJs_okSx.js → SpecsView-CzYtHNbj.js} +1 -1
  27. package/dist/assets/TechStackView-p9PKj9pQ.js +1 -0
  28. package/dist/assets/{TerminalPanel-W2V0X7b9.js → TerminalPanel-BRSYloOD.js} +1 -1
  29. package/dist/assets/{Toaster-CbcX_Cou.js → Toaster-Bd6ckyrP.js} +1 -1
  30. package/dist/assets/{activity-CbbZyUMG.js → activity-Bo6DncWg.js} +1 -1
  31. package/dist/assets/{activity-C4z6-WoZ.js → activity-C34aPcFU.js} +1 -1
  32. package/dist/assets/{activity-B4Ngvkan.js → activity-CBdzUJQ_.js} +1 -1
  33. package/dist/assets/{activity-B8uejnae.js → activity-CLYyxeC6.js} +1 -1
  34. package/dist/assets/{activity-qoJ3grs0.js → activity-Cv_EIWjY.js} +1 -1
  35. package/dist/assets/{activity-B5MvPWYV.js → activity-Wr0_Gb8A.js} +1 -1
  36. package/dist/assets/{activity-D57y5l1T.js → activity-kCY0dGRC.js} +1 -1
  37. package/dist/assets/{button-uGqXvobk.js → button-Clh96jMK.js} +1 -1
  38. package/dist/assets/chat-store-CWhuSNod.js +17 -0
  39. package/dist/assets/{codemap-activity-store-DP3mCZu1.js → codemap-activity-store-C1XWbXeZ.js} +1 -1
  40. package/dist/assets/codemap-index-store-DDT3gP6t.js +1 -0
  41. package/dist/assets/common-BfVFjVhf.js +1 -0
  42. package/dist/assets/common-C5hY-d_0.js +1 -0
  43. package/dist/assets/{dialog-CT1PTjzK.js → dialog-DYJUM0p1.js} +1 -1
  44. package/dist/assets/{empty-state-CdyXy96A.js → empty-state-BV-Y8c35.js} +1 -1
  45. package/dist/assets/{i18n-1BkaqMgr.js → i18n-DOuSY1L8.js} +2 -2
  46. package/dist/assets/index-C09Opuro.css +1 -0
  47. package/dist/assets/index-DxZTscTk.js +132 -0
  48. package/dist/assets/{input-B-VCX2sG.js → input-CW-Yw2Wu.js} +1 -1
  49. package/dist/assets/{mailbox-store-DVoNbOZr.js → mailbox-store-_8voaug1.js} +1 -1
  50. package/dist/assets/markdown-sSmz-Ua_.js +44 -0
  51. package/dist/assets/{progress-ring-CFOvGxw7.js → progress-ring-DPV94fM-.js} +1 -1
  52. package/dist/assets/{roster-ws-DXm0krqH.js → roster-ws-q8Cp6us7.js} +1 -1
  53. package/dist/assets/session-store-D4JWBP5w.js +1 -0
  54. package/dist/assets/settings-B9EPDhAL.js +1 -0
  55. package/dist/assets/{settings-DEmKlLmn.js → settings-BBNOO9wC.js} +1 -1
  56. package/dist/assets/settings-BoXoFVdx.js +1 -0
  57. package/dist/assets/settings-CkXKHC77.js +1 -0
  58. package/dist/assets/settings-DWIDXI2K.js +1 -0
  59. package/dist/assets/settings-r_KOGrbF.js +1 -0
  60. package/dist/assets/settings-tyKsHhya.js +1 -0
  61. package/dist/assets/{shared-jvJxtKc5.js → shared-DidGznBo.js} +1 -1
  62. package/dist/assets/stores-CpZiOiOP.js +7 -0
  63. package/dist/assets/ui-store-C-oyG_br.js +1 -0
  64. package/dist/assets/useWebSocket-BTXT0rOW.js +28 -0
  65. package/dist/assets/{utils-CN2sfDVP.js → utils-DxDx8yib.js} +1 -1
  66. package/dist/assets/{vendor-2VBBgNb5.js → vendor-BTDGplXK.js} +28 -28
  67. package/dist/assets/{view-navigation-Cgy5xh9q.js → view-navigation-BRtuAwZo.js} +1 -1
  68. package/dist/assets/ws-client-DqIqzkfU.js +1 -0
  69. package/dist/components/ChatInput/refine-panel-host.d.ts +9 -1
  70. package/dist/components/DeadCodeScanPanel/DeadCodeScanPanel.d.ts +1 -3
  71. package/dist/components/PanelSuspense.d.ts +8 -0
  72. package/dist/components/SettingsPanel/DisplaySection.d.ts +20 -0
  73. package/dist/components/ViewRouter.d.ts +12 -0
  74. package/dist/components/WorkbenchTopbar.d.ts +53 -0
  75. package/dist/components/codemap-model.d.ts +2 -0
  76. package/dist/hooks/useViewport.d.ts +38 -0
  77. package/dist/hooks/useWebSocket.d.ts +1 -0
  78. package/dist/index.html +24 -25
  79. package/dist/index.js +55560 -54349
  80. package/dist/lib/view-navigation.d.ts +1 -1
  81. package/dist/lib/ws-client.d.ts +16 -8
  82. package/dist/providers.json +10 -0
  83. package/dist/stores/chat-store.d.ts +36 -3
  84. package/dist/stores/config-store.d.ts +0 -2
  85. package/dist/stores/local-prefs.d.ts +20 -0
  86. package/dist/stores/session-store.d.ts +3 -0
  87. package/dist/stores/ui-store.d.ts +8 -1
  88. package/dist/types/client-message.d.ts +1 -0
  89. package/dist/types/connections.d.ts +7 -1
  90. package/dist/types/system.d.ts +4 -0
  91. package/package.json +8 -7
  92. package/dist/App.d.ts.map +0 -1
  93. package/dist/assets/AgentRosterView-Cje2NBtU.js +0 -11
  94. package/dist/assets/AudienceMemoryPanel-DB-8ISNP.js +0 -3
  95. package/dist/assets/ChronicleDashboard-B4Khm6hu.js +0 -1
  96. package/dist/assets/CodeEditor-CrKbA5s8.js +0 -1
  97. package/dist/assets/CodeMap-Dz8yNlUe.js +0 -1
  98. package/dist/assets/DeadCodeScanPanel-C5ehBTQF.js +0 -2
  99. package/dist/assets/GoalView-gtQRK78W.js +0 -1
  100. package/dist/assets/KanbanView-BXKe19EI.js +0 -3
  101. package/dist/assets/LazyMarkdown-BGwFjYKr.js +0 -3
  102. package/dist/assets/MailboxDetailView-D4fXipos.js +0 -1
  103. package/dist/assets/MemoryManager-D_rquas9.js +0 -1
  104. package/dist/assets/OfficeMapPanel-CJFrTNmg.js +0 -4
  105. package/dist/assets/QueuePanel-C5oihwYM.js +0 -1
  106. package/dist/assets/SageTabs-C9vAgvCD.js +0 -2
  107. package/dist/assets/SddHub-D_nsWjuM.js +0 -2
  108. package/dist/assets/SessionsDashboard-DdwU3Ma5.js +0 -1
  109. package/dist/assets/SetupScreen-CQCfLdPI.js +0 -1
  110. package/dist/assets/SkillDetailView-mVxi-9jo.js +0 -3
  111. package/dist/assets/TechStackView-BZ4M7TYc.js +0 -1
  112. package/dist/assets/chat-store-CM1dMeuY.js +0 -17
  113. package/dist/assets/codemap-index-store-DyAe3ZYJ.js +0 -1
  114. package/dist/assets/common-D8_r1x8x.js +0 -1
  115. package/dist/assets/common-suUxW9sA.js +0 -1
  116. package/dist/assets/index-BPfIz78e.js +0 -131
  117. package/dist/assets/index-BlceaIyu.css +0 -1
  118. package/dist/assets/markdown-L6DLSM7f.js +0 -44
  119. package/dist/assets/session-store-BsNYnfOc.js +0 -1
  120. package/dist/assets/settings-C5F2tQ7C.js +0 -1
  121. package/dist/assets/settings-Cdk8i_p6.js +0 -1
  122. package/dist/assets/settings-D6wFOw5n.js +0 -1
  123. package/dist/assets/settings-DCEOkxYE.js +0 -1
  124. package/dist/assets/settings-DsflqNn0.js +0 -1
  125. package/dist/assets/settings-skShEZ2B.js +0 -1
  126. package/dist/assets/stores-mpa0202y.js +0 -6
  127. package/dist/assets/ui-store-CS-njcmT.js +0 -1
  128. package/dist/assets/useWebSocket-Dh3aAFDE.js +0 -28
  129. package/dist/assets/ws-client-WVGn8ORh.js +0 -1
  130. package/dist/components/AgentOfficeDetails.d.ts.map +0 -1
  131. package/dist/components/AgentOfficeView/model.d.ts.map +0 -1
  132. package/dist/components/AgentOfficeView.d.ts.map +0 -1
  133. package/dist/components/AgentRosterCatalogTab.d.ts.map +0 -1
  134. package/dist/components/AgentRosterChrome.d.ts.map +0 -1
  135. package/dist/components/AgentRosterLiveTab.d.ts.map +0 -1
  136. package/dist/components/AgentRosterSelfLearningTab.d.ts.map +0 -1
  137. package/dist/components/AgentRosterView.d.ts.map +0 -1
  138. package/dist/components/AgentRuntimePolicyEditor.d.ts.map +0 -1
  139. package/dist/components/AgentTranscript.d.ts.map +0 -1
  140. package/dist/components/AgentsMonitor.d.ts.map +0 -1
  141. package/dist/components/AgentsPage/format.d.ts.map +0 -1
  142. package/dist/components/AgentsPage.d.ts.map +0 -1
  143. package/dist/components/AnalyticsDashboard.d.ts.map +0 -1
  144. package/dist/components/AudienceMemoryPanel.d.ts.map +0 -1
  145. package/dist/components/AutonomyPicker.d.ts.map +0 -1
  146. package/dist/components/AvailabilityCalendarEditor.d.ts.map +0 -1
  147. package/dist/components/BoardView.d.ts.map +0 -1
  148. package/dist/components/ChangesView.d.ts.map +0 -1
  149. package/dist/components/ChatInput/code-detect.d.ts.map +0 -1
  150. package/dist/components/ChatInput/draft-token-counter.d.ts.map +0 -1
  151. package/dist/components/ChatInput/file-mention-picker.d.ts.map +0 -1
  152. package/dist/components/ChatInput/image-attach-control.d.ts.map +0 -1
  153. package/dist/components/ChatInput/image-attachments.d.ts.map +0 -1
  154. package/dist/components/ChatInput/queued-messages.d.ts.map +0 -1
  155. package/dist/components/ChatInput/refine-panel-host.d.ts.map +0 -1
  156. package/dist/components/ChatInput/slash-commands.d.ts.map +0 -1
  157. package/dist/components/ChatInput/slash-popup.d.ts.map +0 -1
  158. package/dist/components/ChatInput/slash-routing.d.ts.map +0 -1
  159. package/dist/components/ChatInput/stop-controls.d.ts.map +0 -1
  160. package/dist/components/ChatInput/use-paste-drop.d.ts.map +0 -1
  161. package/dist/components/ChatInput.d.ts.map +0 -1
  162. package/dist/components/ChatView/ThinkingBubble.d.ts.map +0 -1
  163. package/dist/components/ChatView/index.d.ts.map +0 -1
  164. package/dist/components/ChatView/utils.d.ts.map +0 -1
  165. package/dist/components/ChatView.d.ts.map +0 -1
  166. package/dist/components/CheckpointTimeline.d.ts.map +0 -1
  167. package/dist/components/ChipMultiSelect.d.ts.map +0 -1
  168. package/dist/components/ChronicleDashboard.d.ts.map +0 -1
  169. package/dist/components/ChroniclePipelineStrip.d.ts.map +0 -1
  170. package/dist/components/CodeEditor.d.ts.map +0 -1
  171. package/dist/components/CodeMap.d.ts.map +0 -1
  172. package/dist/components/CodeMapActivityDrawer.d.ts.map +0 -1
  173. package/dist/components/CodeMapActivityHelpers.d.ts.map +0 -1
  174. package/dist/components/CodeMapActivityStreamPanel.d.ts.map +0 -1
  175. package/dist/components/CodeMapCanvasSurface.d.ts.map +0 -1
  176. package/dist/components/CodeMapCanvasToolbar.d.ts.map +0 -1
  177. package/dist/components/CodeMapConfig.d.ts.map +0 -1
  178. package/dist/components/CodeMapDirectoryTree.d.ts.map +0 -1
  179. package/dist/components/CodeMapFlowState.d.ts.map +0 -1
  180. package/dist/components/CodeMapHeader.d.ts.map +0 -1
  181. package/dist/components/CodeMapLiveOverlay.d.ts.map +0 -1
  182. package/dist/components/CodeMapRelationInspector.d.ts.map +0 -1
  183. package/dist/components/CodeMapRelations.d.ts.map +0 -1
  184. package/dist/components/CodeMapSearchResults.d.ts.map +0 -1
  185. package/dist/components/CodeMapSelectedNodeSummary.d.ts.map +0 -1
  186. package/dist/components/CodeMapTreeSidebar.d.ts.map +0 -1
  187. package/dist/components/CodeMapVisuals.d.ts.map +0 -1
  188. package/dist/components/CollabPanel.d.ts.map +0 -1
  189. package/dist/components/CommandPalette/export-utils.d.ts.map +0 -1
  190. package/dist/components/CommandPalette/index.d.ts.map +0 -1
  191. package/dist/components/CommandPalette.d.ts.map +0 -1
  192. package/dist/components/ConfirmDialog.d.ts.map +0 -1
  193. package/dist/components/ConfirmModal.d.ts.map +0 -1
  194. package/dist/components/ConnectionBanner.d.ts.map +0 -1
  195. package/dist/components/ContextBar.d.ts.map +0 -1
  196. package/dist/components/ContextBreakdownModal.d.ts.map +0 -1
  197. package/dist/components/ContextDashboard.d.ts.map +0 -1
  198. package/dist/components/ContextMemoryMonitor.d.ts.map +0 -1
  199. package/dist/components/ContextModePicker.d.ts.map +0 -1
  200. package/dist/components/CostChip.d.ts.map +0 -1
  201. package/dist/components/CronJobsPanel.d.ts.map +0 -1
  202. package/dist/components/CronTrigger.d.ts.map +0 -1
  203. package/dist/components/CustomRosterPanel.d.ts.map +0 -1
  204. package/dist/components/DeadCodeScanPanel/DeadCodeScanPanel.d.ts.map +0 -1
  205. package/dist/components/DebugDashboard.d.ts.map +0 -1
  206. package/dist/components/DependencyGraph.d.ts.map +0 -1
  207. package/dist/components/DesignGalleryView.d.ts.map +0 -1
  208. package/dist/components/DiffView.d.ts.map +0 -1
  209. package/dist/components/ErrorBoundary.d.ts.map +0 -1
  210. package/dist/components/FallbackEditor.d.ts.map +0 -1
  211. package/dist/components/FileActivityDrawer.d.ts.map +0 -1
  212. package/dist/components/FileExplorer.d.ts.map +0 -1
  213. package/dist/components/FilePicker.d.ts.map +0 -1
  214. package/dist/components/FileReferenceChip.d.ts.map +0 -1
  215. package/dist/components/FleetMonitor.d.ts.map +0 -1
  216. package/dist/components/FleetPanel.d.ts.map +0 -1
  217. package/dist/components/GoalPanel.d.ts.map +0 -1
  218. package/dist/components/GoalView.d.ts.map +0 -1
  219. package/dist/components/InspectorPanel.d.ts.map +0 -1
  220. package/dist/components/KanbanAgentRunPanel.d.ts.map +0 -1
  221. package/dist/components/KanbanBoardChrome.d.ts.map +0 -1
  222. package/dist/components/KanbanBoardSidebar.d.ts.map +0 -1
  223. package/dist/components/KanbanBoardState.d.ts.map +0 -1
  224. package/dist/components/KanbanBoundaryEditor.d.ts.map +0 -1
  225. package/dist/components/KanbanCleanerAlert.d.ts.map +0 -1
  226. package/dist/components/KanbanColumnView.d.ts.map +0 -1
  227. package/dist/components/KanbanDecompositionPanel.d.ts.map +0 -1
  228. package/dist/components/KanbanQueueHealthBar.d.ts.map +0 -1
  229. package/dist/components/KanbanRunControls.d.ts.map +0 -1
  230. package/dist/components/KanbanTaskActivityRecorder.d.ts.map +0 -1
  231. package/dist/components/KanbanTaskCompletionChecks.d.ts.map +0 -1
  232. package/dist/components/KanbanTaskFields.d.ts.map +0 -1
  233. package/dist/components/KanbanTaskInspector.d.ts.map +0 -1
  234. package/dist/components/KanbanTaskOptions.d.ts.map +0 -1
  235. package/dist/components/KanbanTaskTree.d.ts.map +0 -1
  236. package/dist/components/KanbanVerificationDashboard.d.ts.map +0 -1
  237. package/dist/components/KanbanView.d.ts.map +0 -1
  238. package/dist/components/KanbanViewModeTabs.d.ts.map +0 -1
  239. package/dist/components/MailboxDetailView.d.ts.map +0 -1
  240. package/dist/components/MailboxPanel.d.ts.map +0 -1
  241. package/dist/components/MemoryManager/DeleteMemoryDialog.d.ts.map +0 -1
  242. package/dist/components/MemoryManager/MemoryDetail.d.ts.map +0 -1
  243. package/dist/components/MemoryManager/MemoryDrawer.d.ts.map +0 -1
  244. package/dist/components/MemoryManager/MemoryEditor.d.ts.map +0 -1
  245. package/dist/components/MemoryManager/MemoryFilters.d.ts.map +0 -1
  246. package/dist/components/MemoryManager/MemoryGraph.d.ts.map +0 -1
  247. package/dist/components/MemoryManager/MemoryInjectorTrace.d.ts.map +0 -1
  248. package/dist/components/MemoryManager/MemoryLifecycleTrace.d.ts.map +0 -1
  249. package/dist/components/MemoryManager/MemoryList.d.ts.map +0 -1
  250. package/dist/components/MemoryManager/MemoryManagerEmpty.d.ts.map +0 -1
  251. package/dist/components/MemoryManager/SageTabs.d.ts.map +0 -1
  252. package/dist/components/MemoryManager/index.d.ts.map +0 -1
  253. package/dist/components/MemoryManager/selectors.d.ts.map +0 -1
  254. package/dist/components/MemoryManager/shared.d.ts.map +0 -1
  255. package/dist/components/MessageBubble/AttachmentGallery.d.ts.map +0 -1
  256. package/dist/components/MessageBubble/CopyButton.d.ts.map +0 -1
  257. package/dist/components/MessageBubble/ErrorBody.d.ts.map +0 -1
  258. package/dist/components/MessageBubble/LazyMarkdown.d.ts.map +0 -1
  259. package/dist/components/MessageBubble/StreamingMarkdown.d.ts.map +0 -1
  260. package/dist/components/MessageBubble/ToolInputView.d.ts.map +0 -1
  261. package/dist/components/MessageBubble/ToolLedgerCard.d.ts.map +0 -1
  262. package/dist/components/MessageBubble/index.d.ts.map +0 -1
  263. package/dist/components/MessageBubble/utils.d.ts.map +0 -1
  264. package/dist/components/MessageBubble.d.ts.map +0 -1
  265. package/dist/components/ModePicker.d.ts.map +0 -1
  266. package/dist/components/ModelPickDialog.d.ts.map +0 -1
  267. package/dist/components/ModelPicker.d.ts.map +0 -1
  268. package/dist/components/ModelSelectDialog.d.ts.map +0 -1
  269. package/dist/components/MonacoDiffView.d.ts.map +0 -1
  270. package/dist/components/NextStepsBar.d.ts.map +0 -1
  271. package/dist/components/OfficeMapCanvas/CanvasPanels.d.ts.map +0 -1
  272. package/dist/components/OfficeMapCanvas/Hud.d.ts.map +0 -1
  273. package/dist/components/OfficeMapCanvas/Overlays.d.ts.map +0 -1
  274. package/dist/components/OfficeMapCanvas/SelectedNodeDetailPanel.d.ts.map +0 -1
  275. package/dist/components/OfficeMapCanvas/edges.d.ts.map +0 -1
  276. package/dist/components/OfficeMapCanvas/nodes.d.ts.map +0 -1
  277. package/dist/components/OfficeMapCanvas/resolve.d.ts.map +0 -1
  278. package/dist/components/OfficeMapCanvas/use-recently-finished.d.ts.map +0 -1
  279. package/dist/components/OfficeMapCanvas/utils.d.ts.map +0 -1
  280. package/dist/components/OfficeMapCanvas.d.ts.map +0 -1
  281. package/dist/components/OfficeMapPanel.d.ts.map +0 -1
  282. package/dist/components/OfficeMapSettingsPanel.d.ts.map +0 -1
  283. package/dist/components/PhasePanel.d.ts.map +0 -1
  284. package/dist/components/PlanPanel.d.ts.map +0 -1
  285. package/dist/components/ProcessMonitor.d.ts.map +0 -1
  286. package/dist/components/PromptLibraryModal.d.ts.map +0 -1
  287. package/dist/components/ProviderWaitingRoom.d.ts.map +0 -1
  288. package/dist/components/QueuePanel.d.ts.map +0 -1
  289. package/dist/components/QuickModelSwitcher.d.ts.map +0 -1
  290. package/dist/components/QuickModelSwitcher.filter.d.ts.map +0 -1
  291. package/dist/components/RefinePanel.d.ts.map +0 -1
  292. package/dist/components/RefreshDebugView.d.ts.map +0 -1
  293. package/dist/components/SageMemoryCard.d.ts.map +0 -1
  294. package/dist/components/SddActivityFeed.d.ts.map +0 -1
  295. package/dist/components/SddBoardView.d.ts.map +0 -1
  296. package/dist/components/SddDestroyDialog.d.ts.map +0 -1
  297. package/dist/components/SddFlowGraph.d.ts.map +0 -1
  298. package/dist/components/SddHub.d.ts.map +0 -1
  299. package/dist/components/SddKanbanView.d.ts.map +0 -1
  300. package/dist/components/SddTaskDrawer.d.ts.map +0 -1
  301. package/dist/components/SddWizard.d.ts.map +0 -1
  302. package/dist/components/SearchOverlay.d.ts.map +0 -1
  303. package/dist/components/SendButton.d.ts.map +0 -1
  304. package/dist/components/SessionWatchPanel.d.ts.map +0 -1
  305. package/dist/components/SessionsDashboard.d.ts.map +0 -1
  306. package/dist/components/SettingsPanel/BasicSettingsTabs.d.ts.map +0 -1
  307. package/dist/components/SettingsPanel/BrainSection.d.ts.map +0 -1
  308. package/dist/components/SettingsPanel/ChimeraSettingsPanel.d.ts.map +0 -1
  309. package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts.map +0 -1
  310. package/dist/components/SettingsPanel/ConnectionsHealthSection.d.ts.map +0 -1
  311. package/dist/components/SettingsPanel/FallbacksSection.d.ts.map +0 -1
  312. package/dist/components/SettingsPanel/FleetSection.d.ts.map +0 -1
  313. package/dist/components/SettingsPanel/IntegrationsSection.d.ts.map +0 -1
  314. package/dist/components/SettingsPanel/MCPSection.d.ts.map +0 -1
  315. package/dist/components/SettingsPanel/ModelSection.d.ts.map +0 -1
  316. package/dist/components/SettingsPanel/OAuthLoginSection.d.ts.map +0 -1
  317. package/dist/components/SettingsPanel/PluginToggleList.d.ts.map +0 -1
  318. package/dist/components/SettingsPanel/PreferenceControls.d.ts.map +0 -1
  319. package/dist/components/SettingsPanel/PreferenceToggle.d.ts.map +0 -1
  320. package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts.map +0 -1
  321. package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts.map +0 -1
  322. package/dist/components/SettingsPanel/ProviderSection.d.ts.map +0 -1
  323. package/dist/components/SettingsPanel/RoutingSection.d.ts.map +0 -1
  324. package/dist/components/SettingsPanel/SecuritySection.d.ts.map +0 -1
  325. package/dist/components/SettingsPanel/ShadowSection.d.ts.map +0 -1
  326. package/dist/components/SettingsPanel/ToolsSection.d.ts.map +0 -1
  327. package/dist/components/SettingsPanel/brain-section-options.d.ts.map +0 -1
  328. package/dist/components/SettingsPanel/index.d.ts.map +0 -1
  329. package/dist/components/SettingsPanel/local-presets.d.ts.map +0 -1
  330. package/dist/components/SettingsPanel/official-servers.d.ts.map +0 -1
  331. package/dist/components/SettingsPanel/settings-panel-reducers.d.ts.map +0 -1
  332. package/dist/components/SettingsPanel/undo-send-decision.d.ts.map +0 -1
  333. package/dist/components/SettingsPanel.d.ts.map +0 -1
  334. package/dist/components/SetupScreen/CustomProviderSection.d.ts.map +0 -1
  335. package/dist/components/SetupScreen/ModelEditor.d.ts.map +0 -1
  336. package/dist/components/SetupScreen/ProviderKeyCard.d.ts.map +0 -1
  337. package/dist/components/SetupScreen/key-operation.d.ts.map +0 -1
  338. package/dist/components/SetupScreen/popular-providers.d.ts.map +0 -1
  339. package/dist/components/SetupScreen/relative-time.d.ts.map +0 -1
  340. package/dist/components/SetupScreen/types.d.ts.map +0 -1
  341. package/dist/components/SetupScreen.d.ts.map +0 -1
  342. package/dist/components/ShortcutsOverlay.d.ts.map +0 -1
  343. package/dist/components/SideEffectTimeline.d.ts.map +0 -1
  344. package/dist/components/SidePanel/AgentsPanel.d.ts.map +0 -1
  345. package/dist/components/SidePanel/ChangesPanel.d.ts.map +0 -1
  346. package/dist/components/SidePanel/DesignStudioPanel.d.ts.map +0 -1
  347. package/dist/components/SidePanel/SessionList.d.ts.map +0 -1
  348. package/dist/components/SidePanel/SessionPanel.d.ts.map +0 -1
  349. package/dist/components/SidePanel/SkillsList.d.ts.map +0 -1
  350. package/dist/components/SidePanel/WorktreesPanel.d.ts.map +0 -1
  351. package/dist/components/SidePanel/index.d.ts.map +0 -1
  352. package/dist/components/SkillDetailView.d.ts.map +0 -1
  353. package/dist/components/SpecsView.d.ts.map +0 -1
  354. package/dist/components/TaskActivityTimeline.d.ts.map +0 -1
  355. package/dist/components/TaskBoard.d.ts.map +0 -1
  356. package/dist/components/TaskCard.d.ts.map +0 -1
  357. package/dist/components/TaskExecutionAttempts.d.ts.map +0 -1
  358. package/dist/components/TaskIntelligencePanel.d.ts.map +0 -1
  359. package/dist/components/TaskRiskPanel.d.ts.map +0 -1
  360. package/dist/components/TaskVerificationSection.d.ts.map +0 -1
  361. package/dist/components/TasksPanel.d.ts.map +0 -1
  362. package/dist/components/TechStackView/DependencyDetail.d.ts.map +0 -1
  363. package/dist/components/TechStackView/DependencyTable.d.ts.map +0 -1
  364. package/dist/components/TechStackView/FindingsPanel.d.ts.map +0 -1
  365. package/dist/components/TechStackView/TechStackToolbar.d.ts.map +0 -1
  366. package/dist/components/TechStackView/index.d.ts.map +0 -1
  367. package/dist/components/TechStackView/shared.d.ts.map +0 -1
  368. package/dist/components/TerminalPanel.d.ts.map +0 -1
  369. package/dist/components/ThemeProvider.d.ts.map +0 -1
  370. package/dist/components/Toaster.d.ts.map +0 -1
  371. package/dist/components/TodosPanel.d.ts.map +0 -1
  372. package/dist/components/ToolGroup.d.ts.map +0 -1
  373. package/dist/components/ToolResult.d.ts.map +0 -1
  374. package/dist/components/UpdateBanner.d.ts.map +0 -1
  375. package/dist/components/VerificationReportPanel.d.ts.map +0 -1
  376. package/dist/components/WatchMessageBubble.d.ts.map +0 -1
  377. package/dist/components/WelcomeScreen.d.ts.map +0 -1
  378. package/dist/components/WorkDashboard.d.ts.map +0 -1
  379. package/dist/components/WorkspaceDock.d.ts.map +0 -1
  380. package/dist/components/WorktreeGraph.d.ts.map +0 -1
  381. package/dist/components/WorktreeLanes.d.ts.map +0 -1
  382. package/dist/components/WorktreeOrphans.d.ts.map +0 -1
  383. package/dist/components/activity-bar/index.d.ts.map +0 -1
  384. package/dist/components/activity-bar/nav.d.ts.map +0 -1
  385. package/dist/components/agent-roster-data.d.ts.map +0 -1
  386. package/dist/components/agents/AgentDetailSection.d.ts.map +0 -1
  387. package/dist/components/agents/AgentRosterCard.d.ts.map +0 -1
  388. package/dist/components/agents/FleetSummaryBar.d.ts.map +0 -1
  389. package/dist/components/codemap-model.d.ts.map +0 -1
  390. package/dist/components/context-editor/ContextWindowEditor.d.ts.map +0 -1
  391. package/dist/components/dashboard-primitives.d.ts.map +0 -1
  392. package/dist/components/index.d.ts.map +0 -1
  393. package/dist/components/monaco-theme.d.ts.map +0 -1
  394. package/dist/components/toaster-helpers.d.ts.map +0 -1
  395. package/dist/components/ui/PickerCardList.d.ts.map +0 -1
  396. package/dist/components/ui/api-key-display.d.ts.map +0 -1
  397. package/dist/components/ui/badge.d.ts.map +0 -1
  398. package/dist/components/ui/button.d.ts.map +0 -1
  399. package/dist/components/ui/concurrency-gauge.d.ts.map +0 -1
  400. package/dist/components/ui/dialog.d.ts.map +0 -1
  401. package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
  402. package/dist/components/ui/empty-state.d.ts.map +0 -1
  403. package/dist/components/ui/event-timeline.d.ts.map +0 -1
  404. package/dist/components/ui/fleet-agent-row.d.ts.map +0 -1
  405. package/dist/components/ui/index.d.ts.map +0 -1
  406. package/dist/components/ui/input.d.ts.map +0 -1
  407. package/dist/components/ui/pagination.d.ts.map +0 -1
  408. package/dist/components/ui/progress-ring.d.ts.map +0 -1
  409. package/dist/components/ui/scroll-area.d.ts.map +0 -1
  410. package/dist/components/ui/sheet.d.ts.map +0 -1
  411. package/dist/components/ui/sparkline.d.ts.map +0 -1
  412. package/dist/components/ui/tabs.d.ts.map +0 -1
  413. package/dist/components/useAgentRosterData.d.ts.map +0 -1
  414. package/dist/components/useKanbanRegistrySessionIds.d.ts.map +0 -1
  415. package/dist/hooks/index.d.ts.map +0 -1
  416. package/dist/hooks/use-ws-handlers.d.ts.map +0 -1
  417. package/dist/hooks/useDesktopBridge.d.ts.map +0 -1
  418. package/dist/hooks/useF5Resilience.d.ts.map +0 -1
  419. package/dist/hooks/useFieldKeyboardNav.d.ts.map +0 -1
  420. package/dist/hooks/useFleetPolling.d.ts.map +0 -1
  421. package/dist/hooks/useGitInfo.d.ts.map +0 -1
  422. package/dist/hooks/useGlobalKeyboardShortcuts.d.ts.map +0 -1
  423. package/dist/hooks/useHorizontalScroll.d.ts.map +0 -1
  424. package/dist/hooks/useKanbanMeta.d.ts.map +0 -1
  425. package/dist/hooks/useMemoryForFile.d.ts.map +0 -1
  426. package/dist/hooks/usePagination.d.ts.map +0 -1
  427. package/dist/hooks/useProviderModels.d.ts.map +0 -1
  428. package/dist/hooks/useScrollPosition.d.ts.map +0 -1
  429. package/dist/hooks/useWebSocket.d.ts.map +0 -1
  430. package/dist/hooks/ws-handlers/chat-handlers.d.ts.map +0 -1
  431. package/dist/hooks/ws-handlers/coordinator-handlers.d.ts.map +0 -1
  432. package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts.map +0 -1
  433. package/dist/hooks/ws-handlers/fleet-handlers.d.ts.map +0 -1
  434. package/dist/hooks/ws-handlers/misc-handlers.d.ts.map +0 -1
  435. package/dist/hooks/ws-handlers/session-handlers.d.ts.map +0 -1
  436. package/dist/hooks/ws-handlers/techstack-handlers.d.ts.map +0 -1
  437. package/dist/hooks/ws-handlers.d.ts.map +0 -1
  438. package/dist/i18n/index.d.ts.map +0 -1
  439. package/dist/i18n/languages.d.ts.map +0 -1
  440. package/dist/index.css.map +0 -7
  441. package/dist/index.js.map +0 -7
  442. package/dist/lib/accent-colors.d.ts.map +0 -1
  443. package/dist/lib/agent-office.d.ts.map +0 -1
  444. package/dist/lib/agent-status.d.ts.map +0 -1
  445. package/dist/lib/chime.d.ts.map +0 -1
  446. package/dist/lib/color.d.ts.map +0 -1
  447. package/dist/lib/completion.d.ts.map +0 -1
  448. package/dist/lib/core-browser-shim.d.ts.map +0 -1
  449. package/dist/lib/default-prompt-pools.d.ts.map +0 -1
  450. package/dist/lib/desktop-host.d.ts.map +0 -1
  451. package/dist/lib/desktop-shell.d.ts.map +0 -1
  452. package/dist/lib/fallback-ref.d.ts.map +0 -1
  453. package/dist/lib/favicon.d.ts.map +0 -1
  454. package/dist/lib/file-icons.d.ts.map +0 -1
  455. package/dist/lib/goal.d.ts.map +0 -1
  456. package/dist/lib/index.d.ts.map +0 -1
  457. package/dist/lib/kanban-cleaner.d.ts.map +0 -1
  458. package/dist/lib/kanban-metadata.d.ts.map +0 -1
  459. package/dist/lib/kanban-verification.d.ts.map +0 -1
  460. package/dist/lib/model-calendar.d.ts.map +0 -1
  461. package/dist/lib/model-matrix-routes.d.ts.map +0 -1
  462. package/dist/lib/notify.d.ts.map +0 -1
  463. package/dist/lib/plugin-enablement.d.ts.map +0 -1
  464. package/dist/lib/roster-ws.d.ts.map +0 -1
  465. package/dist/lib/sage-block.d.ts.map +0 -1
  466. package/dist/lib/sdd-theme.d.ts.map +0 -1
  467. package/dist/lib/stream-coalescer.d.ts.map +0 -1
  468. package/dist/lib/terminal-dock.d.ts.map +0 -1
  469. package/dist/lib/tool-icon.d.ts.map +0 -1
  470. package/dist/lib/tool-summary.d.ts.map +0 -1
  471. package/dist/lib/utils.d.ts.map +0 -1
  472. package/dist/lib/view-navigation.d.ts.map +0 -1
  473. package/dist/lib/ws-client-actions.d.ts.map +0 -1
  474. package/dist/lib/ws-client-contracts.d.ts.map +0 -1
  475. package/dist/lib/ws-client-helpers.d.ts.map +0 -1
  476. package/dist/lib/ws-client-utils.d.ts.map +0 -1
  477. package/dist/lib/ws-client.d.ts.map +0 -1
  478. package/dist/main.d.ts.map +0 -1
  479. package/dist/protocol-compatibility.d.ts.map +0 -1
  480. package/dist/stores/auto-submit-streak.d.ts.map +0 -1
  481. package/dist/stores/chat-store.d.ts.map +0 -1
  482. package/dist/stores/codemap-activity-store.d.ts.map +0 -1
  483. package/dist/stores/codemap-index-store.d.ts.map +0 -1
  484. package/dist/stores/config-store.d.ts.map +0 -1
  485. package/dist/stores/context-editor-store.d.ts.map +0 -1
  486. package/dist/stores/coordinator-monitor-store.d.ts.map +0 -1
  487. package/dist/stores/cron-store.d.ts.map +0 -1
  488. package/dist/stores/file-reference-store.d.ts.map +0 -1
  489. package/dist/stores/file-store.d.ts.map +0 -1
  490. package/dist/stores/fleet-store.d.ts.map +0 -1
  491. package/dist/stores/git-changes-store.d.ts.map +0 -1
  492. package/dist/stores/git-info-store.d.ts.map +0 -1
  493. package/dist/stores/goal-assess-store.d.ts.map +0 -1
  494. package/dist/stores/goal-run-store.d.ts.map +0 -1
  495. package/dist/stores/goal-state-store.d.ts.map +0 -1
  496. package/dist/stores/goal-store.d.ts.map +0 -1
  497. package/dist/stores/history-store.d.ts.map +0 -1
  498. package/dist/stores/index.d.ts.map +0 -1
  499. package/dist/stores/kanban-store.d.ts.map +0 -1
  500. package/dist/stores/local-prefs.d.ts.map +0 -1
  501. package/dist/stores/mailbox-store.d.ts.map +0 -1
  502. package/dist/stores/memory-injector-store.d.ts.map +0 -1
  503. package/dist/stores/memory-lifecycle-store.d.ts.map +0 -1
  504. package/dist/stores/monitor-store.d.ts.map +0 -1
  505. package/dist/stores/office-map-store.d.ts.map +0 -1
  506. package/dist/stores/provider-status-store.d.ts.map +0 -1
  507. package/dist/stores/sdd-board-store.d.ts.map +0 -1
  508. package/dist/stores/sdd-wizard-store.d.ts.map +0 -1
  509. package/dist/stores/session-store.d.ts.map +0 -1
  510. package/dist/stores/side-effect-store.d.ts.map +0 -1
  511. package/dist/stores/specs-store.d.ts.map +0 -1
  512. package/dist/stores/techstack-store.d.ts.map +0 -1
  513. package/dist/stores/types.d.ts.map +0 -1
  514. package/dist/stores/ui-store.d.ts.map +0 -1
  515. package/dist/stores/viz-store.d.ts.map +0 -1
  516. package/dist/stores/worktree-store.d.ts.map +0 -1
  517. package/dist/types/brain.d.ts.map +0 -1
  518. package/dist/types/chronicle.d.ts.map +0 -1
  519. package/dist/types/client-message.d.ts.map +0 -1
  520. package/dist/types/collab.d.ts.map +0 -1
  521. package/dist/types/connections.d.ts.map +0 -1
  522. package/dist/types/goal-kanban-worktree.d.ts.map +0 -1
  523. package/dist/types/protocol-core.d.ts.map +0 -1
  524. package/dist/types/runtime.d.ts.map +0 -1
  525. package/dist/types/sage.d.ts.map +0 -1
  526. package/dist/types/server-message.d.ts.map +0 -1
  527. package/dist/types/skills-design.d.ts.map +0 -1
  528. package/dist/types/system.d.ts.map +0 -1
  529. package/dist/types.d.ts.map +0 -1
  530. package/dist/types.js.map +0 -7
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Di as t,Ei as n,Sa as r,et as i,gi as a,rn as o}from"./vendor-2VBBgNb5.js";import{A as s}from"./stores-mpa0202y.js";import{a as c,n as l,o as u,r as d,t as f}from"./dialog-CT1PTjzK.js";import{l as p,y as m}from"./index-BPfIz78e.js";var h=e(r(),1),g=i();function _(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}function v(e){if(!e)return`—`;let t=new Date(e),n=Date.now(),r=t.getTime()-n,i=Math.abs(r);if(i<6e4)return r>=0?`<1m`:`<1m ago`;if(i<36e5){let e=Math.round(i/6e4);return r>=0?`${e}m`:`${e}m ago`}if(i<864e5){let e=Math.round(i/36e5);return r>=0?`${e}h`:`${e}h ago`}return t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function y({enabled:e,overdue:r}){return e?r?(0,g.jsxs)(p,{variant:`destructive`,className:`gap-1`,children:[(0,g.jsx)(a,{className:`h-3 w-3`}),`Overdue`]}):(0,g.jsxs)(p,{variant:`default`,className:`gap-1 bg-emerald-600 hover:bg-emerald-600`,children:[(0,g.jsx)(n,{className:`h-3 w-3`}),`Active`]}):(0,g.jsxs)(p,{variant:`secondary`,className:`gap-1`,children:[(0,g.jsx)(t,{className:`h-3 w-3`}),`Disabled`]})}function b({open:e,onClose:t}){let n=s(e=>e.snapshot),r=s(e=>e.lastFiredAt);s(e=>e.revision);let i=n?.jobs??[],p=n?.count??0,b=n?.maxConcurrent??0,x=i.filter(e=>e.overdue).length,S=i.filter(e=>e.enabled).length,C=i.reduce((e,t)=>e+t.runCount,0);return(0,g.jsx)(f,{open:e,onOpenChange:(0,h.useCallback)(e=>{e||t()},[t]),children:(0,g.jsxs)(l,{className:`max-w-3xl max-h-[80vh] flex flex-col`,children:[(0,g.jsxs)(c,{children:[(0,g.jsxs)(u,{className:`flex items-center gap-2`,children:[(0,g.jsx)(o,{className:`h-5 w-5`}),`Cron Jobs`]}),(0,g.jsx)(d,{children:`Scheduled recurring tasks managed by the cron plugin.`})]}),p>0&&(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-muted-foreground border-b border-border/70 pb-3`,children:[(0,g.jsxs)(`span`,{className:`font-medium text-foreground`,children:[p,` job`,p===1?``:`s`]}),(0,g.jsxs)(`span`,{className:`text-emerald-500`,children:[S,` enabled`]}),x>0&&(0,g.jsxs)(`span`,{className:`text-destructive`,children:[x,` overdue`]}),(0,g.jsxs)(`span`,{children:[C,` total runs`]}),(0,g.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[`max `,b,` concurrent`]})]}),p===0&&(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-12 text-muted-foreground`,children:[(0,g.jsx)(a,{className:`h-8 w-8 opacity-40`}),(0,g.jsx)(`p`,{className:`text-sm`,children:`No cron jobs scheduled.`}),(0,g.jsxs)(`p`,{className:`text-xs`,children:[`Use `,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`cron_schedule`}),` to add one.`]})]}),p>0&&(0,g.jsx)(m,{className:`flex-1 -mx-6 px-6`,children:(0,g.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,g.jsx)(`thead`,{children:(0,g.jsxs)(`tr`,{className:`border-b border-border/50 text-left text-xs text-muted-foreground`,children:[(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Status`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Name`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Interval`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium text-right`,children:`Runs`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Next Run`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Last Run`}),(0,g.jsx)(`th`,{className:`pb-2 font-medium`,children:`Action`})]})}),(0,g.jsx)(`tbody`,{children:i.map(e=>(0,g.jsxs)(`tr`,{className:`border-b border-border/30 last:border-0`,children:[(0,g.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,g.jsx)(y,{enabled:e.enabled,overdue:e.overdue})}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs font-medium max-w-[160px] truncate`,title:e.name,children:e.name}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:_(e.intervalMs)}),(0,g.jsxs)(`td`,{className:`py-2.5 pr-3 text-right font-mono text-xs tabular-nums`,children:[e.runCount,r[e.name]&&(0,g.jsx)(`span`,{className:`ml-1 text-emerald-500`,title:`Last fired at ${r[e.name]}`,children:`●`})]}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:v(e.nextRun)}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:v(e.lastRun)}),(0,g.jsx)(`td`,{className:`py-2.5 font-mono text-xs max-w-[200px] truncate text-muted-foreground`,title:e.action,children:e.action})]},e.name))})]})}),p>0&&(0,g.jsxs)(`p`,{className:`text-xs text-muted-foreground pt-3 border-t border-border/70`,children:[`Use `,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-[11px]`,children:`cron_schedule`}),` to add,`,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-[11px] ml-1`,children:`cron_cancel`}),` to remove.`]})]})})}export{b as CronJobsPanel};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,Ti as n,et as r,mi as i,tn as a,wi as o}from"./vendor-BTDGplXK.js";import{A as s}from"./stores-CpZiOiOP.js";import{a as c,n as l,o as u,r as d,t as f}from"./dialog-DYJUM0p1.js";import{k as p,o as m}from"./index-DxZTscTk.js";var h=e(t(),1),g=r();function _(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}function v(e){if(!e)return`—`;let t=new Date(e),n=Date.now(),r=t.getTime()-n,i=Math.abs(r);if(i<6e4)return r>=0?`<1m`:`<1m ago`;if(i<36e5){let e=Math.round(i/6e4);return r>=0?`${e}m`:`${e}m ago`}if(i<864e5){let e=Math.round(i/36e5);return r>=0?`${e}h`:`${e}h ago`}return t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function y({enabled:e,overdue:t}){return e?t?(0,g.jsxs)(m,{variant:`destructive`,className:`gap-1`,children:[(0,g.jsx)(i,{className:`h-3 w-3`}),`Overdue`]}):(0,g.jsxs)(m,{variant:`default`,className:`gap-1 bg-emerald-600 hover:bg-emerald-600`,children:[(0,g.jsx)(o,{className:`h-3 w-3`}),`Active`]}):(0,g.jsxs)(m,{variant:`secondary`,className:`gap-1`,children:[(0,g.jsx)(n,{className:`h-3 w-3`}),`Disabled`]})}function b({open:e,onClose:t}){let n=s(e=>e.snapshot),r=s(e=>e.lastFiredAt);s(e=>e.revision);let o=n?.jobs??[],m=n?.count??0,b=n?.maxConcurrent??0,x=o.filter(e=>e.overdue).length,S=o.filter(e=>e.enabled).length,C=o.reduce((e,t)=>e+t.runCount,0);return(0,g.jsx)(f,{open:e,onOpenChange:(0,h.useCallback)(e=>{e||t()},[t]),children:(0,g.jsxs)(l,{className:`max-w-3xl max-h-[80vh] flex flex-col`,children:[(0,g.jsxs)(c,{children:[(0,g.jsxs)(u,{className:`flex items-center gap-2`,children:[(0,g.jsx)(a,{className:`h-5 w-5`}),`Cron Jobs`]}),(0,g.jsx)(d,{children:`Scheduled recurring tasks managed by the cron plugin.`})]}),m>0&&(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-muted-foreground border-b border-border/70 pb-3`,children:[(0,g.jsxs)(`span`,{className:`font-medium text-foreground`,children:[m,` job`,m===1?``:`s`]}),(0,g.jsxs)(`span`,{className:`text-emerald-500`,children:[S,` enabled`]}),x>0&&(0,g.jsxs)(`span`,{className:`text-destructive`,children:[x,` overdue`]}),(0,g.jsxs)(`span`,{children:[C,` total runs`]}),(0,g.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[`max `,b,` concurrent`]})]}),m===0&&(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-12 text-muted-foreground`,children:[(0,g.jsx)(i,{className:`h-8 w-8 opacity-40`}),(0,g.jsx)(`p`,{className:`text-sm`,children:`No cron jobs scheduled.`}),(0,g.jsxs)(`p`,{className:`text-xs`,children:[`Use `,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`cron_schedule`}),` to add one.`]})]}),m>0&&(0,g.jsx)(p,{className:`flex-1 -mx-6 px-6`,children:(0,g.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,g.jsx)(`thead`,{children:(0,g.jsxs)(`tr`,{className:`border-b border-border/50 text-left text-xs text-muted-foreground`,children:[(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Status`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Name`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Interval`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium text-right`,children:`Runs`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Next Run`}),(0,g.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Last Run`}),(0,g.jsx)(`th`,{className:`pb-2 font-medium`,children:`Action`})]})}),(0,g.jsx)(`tbody`,{children:o.map(e=>(0,g.jsxs)(`tr`,{className:`border-b border-border/30 last:border-0`,children:[(0,g.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,g.jsx)(y,{enabled:e.enabled,overdue:e.overdue})}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs font-medium max-w-[160px] truncate`,title:e.name,children:e.name}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:_(e.intervalMs)}),(0,g.jsxs)(`td`,{className:`py-2.5 pr-3 text-right font-mono text-xs tabular-nums`,children:[e.runCount,r[e.name]&&(0,g.jsx)(`span`,{className:`ml-1 text-emerald-500`,title:`Last fired at ${r[e.name]}`,children:`●`})]}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:v(e.nextRun)}),(0,g.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:v(e.lastRun)}),(0,g.jsx)(`td`,{className:`py-2.5 font-mono text-xs max-w-[200px] truncate text-muted-foreground`,title:e.action,children:e.action})]},e.name))})]})}),m>0&&(0,g.jsxs)(`p`,{className:`text-xs text-muted-foreground pt-3 border-t border-border/70`,children:[`Use `,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-[11px]`,children:`cron_schedule`}),` to add,`,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-[11px] ml-1`,children:`cron_cancel`}),` to remove.`]})]})})}export{b as CronJobsPanel};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,et as n}from"./vendor-BTDGplXK.js";var r=e(t(),1),i=n(),a={0:`P0 Dead Package`,1:`P1 Dead File`,2:`P2 Dead Symbol`},o={0:`hsl(var(--destructive))`,1:`hsl(var(--warning))`,2:`hsl(var(--info))`};async function s(e){let t=await e.text();try{return JSON.parse(t)}catch{let e=t.length>300?`${t.slice(0,300)}…`:t;throw console.warn(JSON.stringify({level:`warn`,event:`deadcode_parse_error`,preview:e,timestamp:new Date().toISOString()})),Error(`The server returned a non-JSON response (possibly an HTML error page). Check that the backend is running and the /api/deadcode/* routes are wired.`)}}function c(){let[e,t]=(0,r.useState)(`idle`),[n,c]=(0,r.useState)(`idle`),[l,p]=(0,r.useState)(null),[m,h]=(0,r.useState)(null),[g,_]=(0,r.useState)(null),v=(0,r.useCallback)(async()=>{t(`scanning`),_(null),p(null),h(null),c(`idle`);try{let e=await fetch(`/api/deadcode/scan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});if(!e.ok){let t=await s(e);throw Error(t.detail??t.error??`HTTP ${e.status}`)}let n=await s(e);p(n),t(`done`)}catch(e){_(e instanceof Error?e.message:String(e)),t(`error`)}},[]),y=(0,r.useCallback)(async()=>{if(l){c(`generating`),_(null);try{let e=await fetch(`/api/deadcode/action-plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(l)});if(!e.ok){let t=await s(e);throw Error(t.detail??t.error??`HTTP ${e.status}`)}let t=await s(e);h(t),c(`ready`)}catch(e){_(e instanceof Error?e.message:String(e)),c(`idle`)}}},[l]),b=(0,r.useCallback)(()=>{if(!m)return;c(`executing`);let e=[`# Dead-Code Cleanup Plan`,``,m.summary,``,`## Files to address (in priority order)`,...m.files.map((e,t)=>`${t+1}. [${a[e.priority]}] ${e.file} — ${e.symbolCount} symbol(s) to remove`+(e.symbols.length>0?`\n Symbols: ${e.symbols.slice(0,5).join(`, `)}${e.symbols.length>5?` and ${e.symbols.length-5} more`:``}`:``))].join(`
2
+ `),t=window.__WS;t&&t.readyState===WebSocket.OPEN?t.send(JSON.stringify({type:`user.message`,payload:{text:e,action:`send`}})):(navigator.clipboard.writeText(e),_(`Agent not connected. Plan copied to clipboard — paste it into the chat.`)),c(`idle`)},[m]);return(0,i.jsxs)(`div`,{style:{padding:`16px`,fontFamily:`var(--font-sans, system-ui, sans-serif)`,color:`hsl(var(--foreground))`,background:`hsl(var(--background))`},children:[(0,i.jsx)(`h2`,{style:{margin:`0 0 16px`,fontSize:`18px`,fontWeight:600,color:`hsl(var(--foreground))`},children:`🔍 Dead-Code Scan`}),(0,i.jsx)(`button`,{type:`button`,onClick:v,disabled:e===`scanning`,style:{padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:e===`scanning`?`hsl(var(--muted))`:`hsl(var(--primary))`,color:e===`scanning`?`hsl(var(--muted-foreground))`:`hsl(var(--primary-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:e===`scanning`?`not-allowed`:`pointer`},children:e===`scanning`?`Scanning…`:`Scan for Dead Code`}),g&&(0,i.jsxs)(`div`,{style:{marginTop:`12px`,padding:`8px 12px`,background:`hsl(var(--destructive) / 0.1)`,color:`hsl(var(--destructive))`,border:`1px solid hsl(var(--destructive) / 0.3)`,borderRadius:`0`,fontSize:`13px`},children:[g,(0,i.jsx)(`button`,{type:`button`,onClick:()=>_(null),style:{marginLeft:`12px`,background:`none`,border:`none`,cursor:`pointer`,fontWeight:600,color:`hsl(var(--destructive))`},children:`✕`})]}),l&&(0,i.jsxs)(`div`,{style:{marginTop:`16px`},children:[(0,i.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,marginBottom:`12px`},children:[(0,i.jsx)(u,{label:`Total Symbols`,value:l.stats.totalSymbols,token:`info`}),(0,i.jsx)(u,{label:`Alive`,value:l.stats.alive,token:`success`}),(0,i.jsx)(u,{label:`Dead`,value:l.stats.dead,token:`destructive`})]}),l.deadPackages.length>0&&(0,i.jsx)(d,{title:`Dead Packages (${l.deadPackages.length})`,token:`destructive`,children:l.deadPackages.map(e=>(0,i.jsx)(f,{columns:[e.package,e.path,`${e.fileCount} file(s)`]},e.package))}),l.deadFiles.length>0&&(0,i.jsx)(d,{title:`Dead Files (${l.deadFiles.length})`,token:`warning`,children:l.deadFiles.map(e=>(0,i.jsx)(f,{columns:[e.file,`${e.symbolCount} symbol(s)`,e.lang]},e.file))}),l.deadSymbols.length>0&&(0,i.jsxs)(d,{title:`Dead Symbols (${l.deadSymbols.length})`,token:`info`,children:[l.deadSymbols.slice(0,50).map(e=>(0,i.jsx)(f,{columns:[e.name,e.kind,e.file.split(`/`).pop()??e.file,`line ${e.line}`]},`${e.file}:${e.line}:${e.name}`)),l.deadSymbols.length>50&&(0,i.jsxs)(`div`,{style:{padding:`6px 8px`,color:`hsl(var(--muted-foreground))`,fontSize:`12px`},children:[`… and `,l.deadSymbols.length-50,` more`]})]}),e===`done`&&(0,i.jsx)(`button`,{type:`button`,onClick:y,disabled:n===`generating`,style:{marginTop:`12px`,padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:n===`generating`?`hsl(var(--muted))`:`hsl(var(--accent))`,color:n===`generating`?`hsl(var(--muted-foreground))`:`hsl(var(--accent-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:n===`generating`?`not-allowed`:`pointer`},children:n===`generating`?`Generating…`:`Generate Action Plan`})]}),m&&(0,i.jsxs)(`div`,{style:{marginTop:`16px`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,padding:`12px`,background:`hsl(var(--card))`},children:[(0,i.jsx)(`h3`,{style:{margin:`0 0 8px`,fontSize:`15px`,fontWeight:600,color:`hsl(var(--card-foreground))`},children:`📋 Action Plan`}),(0,i.jsx)(`p`,{style:{fontSize:`13px`,color:`hsl(var(--muted-foreground))`,margin:`0 0 12px`},children:m.summary}),m.files.map((e,t)=>(0,i.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:`8px`,padding:`6px 0`,borderBottom:t<m.files.length-1?`1px solid hsl(var(--border))`:`none`,fontSize:`13px`},children:[(0,i.jsx)(`span`,{style:{background:o[e.priority]??`hsl(var(--muted-foreground))`,color:`hsl(var(--primary-foreground))`,borderRadius:`0`,padding:`2px 6px`,fontSize:`11px`,fontWeight:600,whiteSpace:`nowrap`,flexShrink:0},children:a[e.priority]??`P${e.priority}`}),(0,i.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,i.jsx)(`div`,{style:{fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`hsl(var(--foreground))`},children:e.file}),(0,i.jsxs)(`div`,{style:{color:`hsl(var(--muted-foreground))`,fontSize:`12px`},children:[e.symbolCount,` symbol(s)`,e.symbols.length>0&&` · ${e.symbols.slice(0,2).join(`, `)}${e.symbols.length>2?`…`:``}`]})]})]},e.file)),(0,i.jsx)(`button`,{type:`button`,onClick:b,disabled:n===`executing`,style:{marginTop:`12px`,padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:n===`executing`?`hsl(var(--muted))`:`hsl(var(--success))`,color:`hsl(var(--primary-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:n===`executing`?`not-allowed`:`pointer`},children:n===`executing`?`Sending…`:`Execute Plan via Agent`})]})]})}var l={success:`hsl(var(--success))`,warning:`hsl(var(--warning))`,info:`hsl(var(--info))`,destructive:`hsl(var(--destructive))`,primary:`hsl(var(--primary))`};function u({label:e,value:t,token:n}){let r=l[n];return(0,i.jsxs)(`div`,{style:{flex:1,padding:`10px`,borderRadius:`0`,border:`1px solid hsl(var(--border))`,background:`hsl(var(--card))`,textAlign:`center`},children:[(0,i.jsx)(`div`,{style:{fontSize:`24px`,fontWeight:700,color:r},children:t}),(0,i.jsx)(`div`,{style:{fontSize:`12px`,color:`hsl(var(--muted-foreground))`,marginTop:`2px`},children:e})]})}function d({title:e,token:t,children:n}){let r=l[t];return(0,i.jsxs)(`div`,{style:{marginBottom:`12px`},children:[(0,i.jsx)(`h3`,{style:{margin:`0 0 6px`,fontSize:`14px`,fontWeight:600,color:r,borderLeft:`3px solid ${r}`,paddingLeft:`8px`},children:e}),(0,i.jsx)(`div`,{style:{border:`1px solid hsl(var(--border))`,borderRadius:`0`,overflow:`hidden`,fontSize:`13px`},children:n})]})}function f({columns:e}){return(0,i.jsx)(`div`,{style:{display:`flex`,gap:`8px`,padding:`5px 8px`,borderBottom:`1px solid hsl(var(--border))`,fontSize:`13px`,fontFamily:`var(--font-mono, monospace)`,background:`hsl(var(--card))`,color:`hsl(var(--card-foreground))`},children:e.map((e,t)=>(0,i.jsx)(`span`,{style:{flex:t===0?2:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e},t))})}export{c as DeadCodeScanPanel};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Cr as t,Hr as n,Mi as r,Sa as i,Vi as a,Yr as o,Yt as s,_a as c,ba as l,cn as u,et as d,gi as f,ma as p,xt as m}from"./vendor-2VBBgNb5.js";import"./i18n-1BkaqMgr.js";import{b as h}from"./index-BPfIz78e.js";var g=e(i(),1),_=d();function v({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:o}=c();return(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium`,children:e}),(0,_.jsx)(`p`,{className:`mt-1 truncate text-xl font-semibold tabular-nums sm:text-2xl ${i}`,children:t}),n&&(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n})]}),(0,_.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted/70 p-2 ${i}`,children:(0,_.jsx)(r,{className:`w-5 h-5`})})]}),a&&(0,_.jsxs)(`div`,{className:`mt-2 flex items-center gap-1`,children:[a===`up`&&(0,_.jsx)(m,{className:`w-3 h-3 text-success`}),a===`down`&&(0,_.jsx)(m,{className:`w-3 h-3 rotate-180 text-destructive`}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(a===`up`?`activity:debug.trendUp`:a===`down`?`activity:debug.trendDown`:`activity:debug.trendStable`)})]})]})}function y(){let{t:e}=c(),[i,d]=(0,g.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[y,C]=(0,g.useState)(!0),[w,T]=(0,g.useState)(2e3),E=(0,g.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/debug/watcher-metrics`),fetch(`/debug/system`,{cache:`no-store`})]),n=null,r=e.headers.get(`content-type`)??``;if(e.ok&&r.includes(`application/json`)&&(n=await e.json()),!t.ok)throw Error(`System metrics request failed (${t.status})`);let i=await t.json();d({fileWatcher:n,system:i,lastUpdated:new Date,error:null})}catch(e){d(t=>({...t,error:e instanceof Error?e.message:l.t(`activity:debug.fetchFailed`)}))}finally{C(!1)}},[]);return(0,g.useEffect)(()=>{E();let e=setInterval(E,w);return()=>clearInterval(e)},[E,w]),(0,_.jsx)(`div`,{ref:h(`debug`),className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-5`,children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`h1`,{className:`flex items-center gap-2 text-lg font-semibold sm:text-xl`,children:[(0,_.jsx)(a,{className:`h-5 w-5 text-primary`}),e(`activity:debug.heading`)]}),(0,_.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`activity:debug.subtitle`)})]}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,_.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,_.jsx)(u,{className:`w-4 h-4 text-muted-foreground`}),(0,_.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e(`activity:debug.refreshLabel`)}),(0,_.jsxs)(`select`,{value:w,onChange:e=>T(Number(e.target.value)),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm`,children:[(0,_.jsx)(`option`,{value:1e3,children:`1s`}),(0,_.jsx)(`option`,{value:2e3,children:`2s`}),(0,_.jsx)(`option`,{value:5e3,children:`5s`}),(0,_.jsx)(`option`,{value:1e4,children:`10s`})]})]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>{C(!0),E()},disabled:y,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 disabled:opacity-50`,children:[(0,_.jsx)(u,{className:`w-4 h-4 ${y?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),i.lastUpdated&&(0,_.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-card/55 px-3 py-2 text-sm text-muted-foreground`,children:[(0,_.jsx)(f,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:i.lastUpdated.toLocaleTimeString()})]}),i.error&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-destructive/25 bg-destructive/10 p-4 text-destructive`,children:[(0,_.jsx)(r,{className:`w-5 h-5 flex-shrink-0`}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`p`,{className:`font-medium`,children:e(`activity:debug.fetchFailed`)}),(0,_.jsx)(`p`,{className:`text-sm opacity-80`,children:i.error})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(o,{className:`h-4 w-4 text-primary`}),e(`activity:debug.fileWatcher`)]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.watcherStatus`),value:i.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:s,color:i.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,_.jsx)(v,{title:e(`activity:debug.activeProjects`),value:i.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:n,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.fileChanges`),value:i.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:p,color:`text-primary`,trend:`neutral`}),(0,_.jsx)(v,{title:e(`activity:debug.filesProcessed`),value:i.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:t,color:`text-success`})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.broadcastsSent`),value:i.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:m,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debug.debounceResets`),value:i.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:u,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.avgDebounce`),value:`${(i.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:f,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.totalDelay`),value:`${(i.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:a,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(t,{className:`h-4 w-4 text-primary`}),`WebUI Server Process`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Process RAM (RSS)`,value:b(i.system?.memoryUsage?.rss??0),subtitle:i.system?`PID ${i.system.pid}`:void 0,icon:s,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapUsed`),value:b(i.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:a,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapTotal`),value:b(i.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:a,color:`text-success`}),(0,_.jsx)(v,{title:`V8 Heap Limit`,value:b(i.system?.heapLimit??0),subtitle:`Configured old-space ceiling`,icon:t,color:`text-warning`}),(0,_.jsx)(v,{title:`Server Uptime`,value:S(i.system?.uptime??0),subtitle:`Since process start`,icon:f,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(p,{className:`h-4 w-4 text-primary`}),`Live WrongStack Processes`]}),(0,_.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:(0,_.jsxs)(`table`,{className:`w-full min-w-[980px] text-left text-xs`,children:[(0,_.jsx)(`thead`,{className:`border-b border-border/70 bg-muted/35 text-muted-foreground`,children:(0,_.jsxs)(`tr`,{children:[(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Surface`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Memory`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Growth / signal`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Workload`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`HQ offline queue`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Resources / hotspot`})]})}),(0,_.jsxs)(`tbody`,{children:[(i.system?.processes??[]).map(e=>{let t=[e.workload.messages===void 0?void 0:`${e.workload.messages} msgs`,e.workload.messageEstimatedTokens===void 0?void 0:`${e.workload.messageEstimatedTokens.toLocaleString()} ctx tokens`,e.workload.historyEntries===void 0?void 0:`${e.workload.historyMountedEntries??0}/${e.workload.historyEntries} history mounted`,e.workload.appRenders===void 0?void 0:`${e.workload.appRenders} renders`,e.workload.metricsDroppedObservations?`${e.workload.metricsDroppedObservations} metric drops`:void 0,e.workload.kanbanSyncActive?`kanban sync active`:void 0,e.workload.kanbanSyncPendingBoards?`${e.workload.kanbanSyncPendingBoards} kanban pending`:void 0,e.workload.kanbanSyncFullRescanPending?`kanban full rescan pending`:void 0,e.workload.kanbanSyncRemoteApplyQueued?`${e.workload.kanbanSyncPendingRemoteBoards??0} remote boards queued`:void 0,e.workload.kanbanSyncCoalescedRefreshes?`${e.workload.kanbanSyncCoalescedRefreshes} kanban coalesced`:void 0,e.workload.kanbanSupervisorSnapshots?`${e.workload.kanbanSupervisorSnapshots} supervised boards`:void 0,e.workload.kanbanSupervisorScheduledBoards?`${e.workload.kanbanSupervisorScheduledBoards} supervisor schedules`:void 0].filter(Boolean).join(` · `);return(0,_.jsxs)(`tr`,{className:`border-b border-border/50 align-top last:border-b-0`,children:[(0,_.jsxs)(`td`,{className:`px-3 py-3`,children:[(0,_.jsx)(`div`,{className:`font-medium text-foreground`,children:e.surface}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`PID `,e.pid]}),(0,_.jsx)(`div`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsxs)(`div`,{children:[`RSS `,b(e.memory.rss)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`heap `,b(e.memory.heapUsed),e.memory.retainedHeapUsed===void 0?``:` · retained ${b(e.memory.retainedHeapUsed)}`]}),e.memory.nativeResidual===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`native `,b(e.memory.nativeResidual)]}),e.memory.external===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`external `,b(e.memory.external),e.memory.arrayBuffers===void 0?``:` · buffers ${b(e.memory.arrayBuffers)}`]})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsx)(`div`,{className:e.signal===`stable`?`text-success`:e.signal?`text-warning`:`text-muted-foreground`,children:e.signal??`sampling`}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`heap `,x(e.heapGrowthBytesPerHour)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`RSS `,x(e.rssGrowthBytesPerHour)]})]}),(0,_.jsx)(`td`,{className:`px-3 py-3 text-muted-foreground`,children:t||`—`}),(0,_.jsx)(`td`,{className:`px-3 py-3 tabular-nums`,children:e.hqQueue?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{children:[e.hqQueue.entries,` frames ·`,` `,b(e.hqQueue.bytes),` /`,` `,b(e.hqQueue.maxBytes)]}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.hqQueue.coalescedFrames,` coalesced ·`,` `,e.hqQueue.droppedFrames,` dropped`]}),e.hqSnapshot?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`snapshot`,` `,e.hqSnapshot.inFlight?`in-flight`:e.hqSnapshot.pending?`pending`:e.hqSnapshot.timerScheduled?`scheduled`:`idle`]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`events`,` `,e.hqSnapshot.eventInFlight?`in-flight`:`idle`,` ·`,` `,e.hqSnapshot.pendingEvents,` pending ·`,` `,e.hqSnapshot.coalescedEvents,` coalesced ·`,` `,e.hqSnapshot.droppedEvents,` dropped`]})]}):null]}):(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,_.jsxs)(`td`,{className:`max-w-[360px] px-3 py-3 text-muted-foreground`,children:[(0,_.jsxs)(`div`,{children:[e.resources.active??0,` active`,e.resources.types?` · ${e.resources.types}`:``]}),e.profileTopStack?(0,_.jsxs)(`div`,{className:`mt-1 truncate`,title:e.profileTopStack,children:[e.profileTopStackBytes===void 0?``:`${b(e.profileTopStackBytes)} · `,e.profileTopStack]}):null]})]},e.pid)}),(i.system?.processes?.length??0)===0?(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{className:`px-3 py-5 text-muted-foreground`,colSpan:6,children:`Waiting for heap flight-recorder samples…`})}):null]})]})})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(s,{className:`h-4 w-4 text-primary`}),`Codebase Index Server`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Connection`,value:i.system?.codebaseIndexServer?.health?.status??i.system?.codebaseIndexServer?.status??`unknown`,subtitle:i.system?.codebaseIndexServer?.pid?`PID ${i.system.codebaseIndexServer.pid} · RTT ${i.system.codebaseIndexServer.health?.latencyMs??`—`}ms`:`No connected project server`,icon:p,color:i.system?.codebaseIndexServer?.health?.status===`healthy`?`text-success`:i.system?.codebaseIndexServer?.status===`unresponsive`||i.system?.codebaseIndexServer?.status===`error`?`text-destructive`:`text-warning`}),(0,_.jsx)(v,{title:`Index RAM (RSS)`,value:b(i.system?.codebaseIndexServer?.health?.server?.memory.rss??0),subtitle:`Heap ${b(i.system?.codebaseIndexServer?.health?.server?.memory.heapUsed??0)} / ${b(i.system?.codebaseIndexServer?.health?.server?.memory.heapTotal??0)}`,icon:a,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Workload`,value:`${i.system?.codebaseIndexServer?.health?.server?.activeRequests??0} requests`,subtitle:`${i.system?.codebaseIndexServer?.health?.server?.activeWrites??0} writes · ${i.system?.codebaseIndexServer?.health?.server?.queuedWrites??0} queued`,icon:t,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Watcher`,value:i.system?.codebaseIndexServer?.health?.server?.watchingExternal?`Active`:`Off`,subtitle:`${i.system?.codebaseIndexServer?.health?.server?.watchingClients??0} owners · ${i.system?.codebaseIndexServer?.health?.server?.pendingExternalFiles??0} pending`,icon:o,color:i.system?.codebaseIndexServer?.health?.server?.watchingExternal?`text-success`:`text-muted-foreground`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(p,{className:`h-4 w-4 text-primary`}),e(`activity:debug.rawData`)]}),(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsx)(`pre`,{className:`overflow-x-auto text-xs font-mono text-muted-foreground`,children:JSON.stringify({fileWatcher:i.fileWatcher,serverPid:i.system?.pid,serverMemory:i.system?.memoryUsage,serverHeapLimit:i.system?.heapLimit,serverUptime:i.system?.uptime,processes:i.system?.processes,codebaseIndexServer:i.system?.codebaseIndexServer},null,2)})})]})]})})}function b(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function x(e){return e===void 0?`—`:`${e>0?`+`:e<0?`−`:``}${b(Math.abs(e))}/h`}function S(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${(e/60).toFixed(1)}m`:`${(e/3600).toFixed(1)}h`}export{y as DebugDashboard};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ai as t,Br as n,Ca as r,et as i,fa as a,mi as o,on as s,qr as c,qt as l,va as u,xa as d,xr as f,yt as p,zi as m}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{c as h}from"./index-DxZTscTk.js";var g=e(r(),1),_=i();function v({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:o}=u();return(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium`,children:e}),(0,_.jsx)(`p`,{className:`mt-1 truncate text-xl font-semibold tabular-nums sm:text-2xl ${i}`,children:t}),n&&(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n})]}),(0,_.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted/70 p-2 ${i}`,children:(0,_.jsx)(r,{className:`w-5 h-5`})})]}),a&&(0,_.jsxs)(`div`,{className:`mt-2 flex items-center gap-1`,children:[a===`up`&&(0,_.jsx)(p,{className:`w-3 h-3 text-success`}),a===`down`&&(0,_.jsx)(p,{className:`w-3 h-3 rotate-180 text-destructive`}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(a===`up`?`activity:debug.trendUp`:a===`down`?`activity:debug.trendDown`:`activity:debug.trendStable`)})]})]})}function y(){let{t:e}=u(),[r,i]=(0,g.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[y,C]=(0,g.useState)(!0),[w,T]=(0,g.useState)(2e3),E=(0,g.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/debug/watcher-metrics`),fetch(`/debug/system`,{cache:`no-store`})]),n=null,r=e.headers.get(`content-type`)??``;if(e.ok&&r.includes(`application/json`)&&(n=await e.json()),!t.ok)throw Error(`System metrics request failed (${t.status})`);let a=await t.json();i({fileWatcher:n,system:a,lastUpdated:new Date,error:null})}catch(e){i(t=>({...t,error:e instanceof Error?e.message:d.t(`activity:debug.fetchFailed`)}))}finally{C(!1)}},[]);return(0,g.useEffect)(()=>{E();let e=setInterval(E,w);return()=>clearInterval(e)},[E,w]),(0,_.jsx)(`div`,{ref:h(`debug`),className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-5`,children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`h1`,{className:`flex items-center gap-2 text-lg font-semibold sm:text-xl`,children:[(0,_.jsx)(m,{className:`h-5 w-5 text-primary`}),e(`activity:debug.heading`)]}),(0,_.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`activity:debug.subtitle`)})]}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,_.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,_.jsx)(s,{className:`w-4 h-4 text-muted-foreground`}),(0,_.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e(`activity:debug.refreshLabel`)}),(0,_.jsxs)(`select`,{value:w,onChange:e=>T(Number(e.target.value)),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm`,children:[(0,_.jsx)(`option`,{value:1e3,children:`1s`}),(0,_.jsx)(`option`,{value:2e3,children:`2s`}),(0,_.jsx)(`option`,{value:5e3,children:`5s`}),(0,_.jsx)(`option`,{value:1e4,children:`10s`})]})]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>{C(!0),E()},disabled:y,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 disabled:opacity-50`,children:[(0,_.jsx)(s,{className:`w-4 h-4 ${y?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),r.lastUpdated&&(0,_.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-card/55 px-3 py-2 text-sm text-muted-foreground`,children:[(0,_.jsx)(o,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:r.lastUpdated.toLocaleTimeString()})]}),r.error&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-destructive/25 bg-destructive/10 p-4 text-destructive`,children:[(0,_.jsx)(t,{className:`w-5 h-5 flex-shrink-0`}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`p`,{className:`font-medium`,children:e(`activity:debug.fetchFailed`)}),(0,_.jsx)(`p`,{className:`text-sm opacity-80`,children:r.error})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(c,{className:`h-4 w-4 text-primary`}),e(`activity:debug.fileWatcher`)]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.watcherStatus`),value:r.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:l,color:r.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,_.jsx)(v,{title:e(`activity:debug.activeProjects`),value:r.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:n,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.fileChanges`),value:r.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:a,color:`text-primary`,trend:`neutral`}),(0,_.jsx)(v,{title:e(`activity:debug.filesProcessed`),value:r.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:f,color:`text-success`})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.broadcastsSent`),value:r.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:p,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debug.debounceResets`),value:r.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:s,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.avgDebounce`),value:`${(r.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:o,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.totalDelay`),value:`${(r.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:m,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(f,{className:`h-4 w-4 text-primary`}),`WebUI Server Process`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Process RAM (RSS)`,value:b(r.system?.memoryUsage?.rss??0),subtitle:r.system?`PID ${r.system.pid}`:void 0,icon:l,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapUsed`),value:b(r.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:m,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapTotal`),value:b(r.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:m,color:`text-success`}),(0,_.jsx)(v,{title:`V8 Heap Limit`,value:b(r.system?.heapLimit??0),subtitle:`Configured old-space ceiling`,icon:f,color:`text-warning`}),(0,_.jsx)(v,{title:`Server Uptime`,value:S(r.system?.uptime??0),subtitle:`Since process start`,icon:o,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(a,{className:`h-4 w-4 text-primary`}),`Live WrongStack Processes`]}),(0,_.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:(0,_.jsxs)(`table`,{className:`w-full min-w-[980px] text-left text-xs`,children:[(0,_.jsx)(`thead`,{className:`border-b border-border/70 bg-muted/35 text-muted-foreground`,children:(0,_.jsxs)(`tr`,{children:[(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Surface`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Memory`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Growth / signal`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Workload`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`HQ offline queue`}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:`Resources / hotspot`})]})}),(0,_.jsxs)(`tbody`,{children:[(r.system?.processes??[]).map(e=>{let t=[e.workload.messages===void 0?void 0:`${e.workload.messages} msgs`,e.workload.messageEstimatedTokens===void 0?void 0:`${e.workload.messageEstimatedTokens.toLocaleString()} ctx tokens`,e.workload.historyEntries===void 0?void 0:`${e.workload.historyMountedEntries??0}/${e.workload.historyEntries} history mounted`,e.workload.appRenders===void 0?void 0:`${e.workload.appRenders} renders`,e.workload.metricsDroppedObservations?`${e.workload.metricsDroppedObservations} metric drops`:void 0,e.workload.kanbanSyncActive?`kanban sync active`:void 0,e.workload.kanbanSyncPendingBoards?`${e.workload.kanbanSyncPendingBoards} kanban pending`:void 0,e.workload.kanbanSyncFullRescanPending?`kanban full rescan pending`:void 0,e.workload.kanbanSyncRemoteApplyQueued?`${e.workload.kanbanSyncPendingRemoteBoards??0} remote boards queued`:void 0,e.workload.kanbanSyncCoalescedRefreshes?`${e.workload.kanbanSyncCoalescedRefreshes} kanban coalesced`:void 0,e.workload.kanbanSupervisorSnapshots?`${e.workload.kanbanSupervisorSnapshots} supervised boards`:void 0,e.workload.kanbanSupervisorScheduledBoards?`${e.workload.kanbanSupervisorScheduledBoards} supervisor schedules`:void 0].filter(Boolean).join(` · `);return(0,_.jsxs)(`tr`,{className:`border-b border-border/50 align-top last:border-b-0`,children:[(0,_.jsxs)(`td`,{className:`px-3 py-3`,children:[(0,_.jsx)(`div`,{className:`font-medium text-foreground`,children:e.surface}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`PID `,e.pid]}),(0,_.jsx)(`div`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsxs)(`div`,{children:[`RSS `,b(e.memory.rss)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`heap `,b(e.memory.heapUsed),e.memory.retainedHeapUsed===void 0?``:` · retained ${b(e.memory.retainedHeapUsed)}`]}),e.memory.nativeResidual===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`native `,b(e.memory.nativeResidual)]}),e.memory.external===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`external `,b(e.memory.external),e.memory.arrayBuffers===void 0?``:` · buffers ${b(e.memory.arrayBuffers)}`]})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsx)(`div`,{className:e.signal===`stable`?`text-success`:e.signal?`text-warning`:`text-muted-foreground`,children:e.signal??`sampling`}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`heap `,x(e.heapGrowthBytesPerHour)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`RSS `,x(e.rssGrowthBytesPerHour)]})]}),(0,_.jsx)(`td`,{className:`px-3 py-3 text-muted-foreground`,children:t||`—`}),(0,_.jsx)(`td`,{className:`px-3 py-3 tabular-nums`,children:e.hqQueue?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{children:[e.hqQueue.entries,` frames ·`,` `,b(e.hqQueue.bytes),` /`,` `,b(e.hqQueue.maxBytes)]}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.hqQueue.coalescedFrames,` coalesced ·`,` `,e.hqQueue.droppedFrames,` dropped`]}),e.hqSnapshot?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`snapshot`,` `,e.hqSnapshot.inFlight?`in-flight`:e.hqSnapshot.pending?`pending`:e.hqSnapshot.timerScheduled?`scheduled`:`idle`]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`events`,` `,e.hqSnapshot.eventInFlight?`in-flight`:`idle`,` ·`,` `,e.hqSnapshot.pendingEvents,` pending ·`,` `,e.hqSnapshot.coalescedEvents,` coalesced ·`,` `,e.hqSnapshot.droppedEvents,` dropped`]})]}):null]}):(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,_.jsxs)(`td`,{className:`max-w-[360px] px-3 py-3 text-muted-foreground`,children:[(0,_.jsxs)(`div`,{children:[e.resources.active??0,` active`,e.resources.types?` · ${e.resources.types}`:``]}),e.profileTopStack?(0,_.jsxs)(`div`,{className:`mt-1 truncate`,title:e.profileTopStack,children:[e.profileTopStackBytes===void 0?``:`${b(e.profileTopStackBytes)} · `,e.profileTopStack]}):null]})]},e.pid)}),(r.system?.processes?.length??0)===0?(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{className:`px-3 py-5 text-muted-foreground`,colSpan:6,children:`Waiting for heap flight-recorder samples…`})}):null]})]})})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(l,{className:`h-4 w-4 text-primary`}),`Codebase Index Server`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Connection`,value:r.system?.codebaseIndexServer?.health?.status??r.system?.codebaseIndexServer?.status??`unknown`,subtitle:r.system?.codebaseIndexServer?.pid?`PID ${r.system.codebaseIndexServer.pid} · RTT ${r.system.codebaseIndexServer.health?.latencyMs??`—`}ms`:`No connected project server`,icon:a,color:r.system?.codebaseIndexServer?.health?.status===`healthy`?`text-success`:r.system?.codebaseIndexServer?.status===`unresponsive`||r.system?.codebaseIndexServer?.status===`error`?`text-destructive`:`text-warning`}),(0,_.jsx)(v,{title:`Index RAM (RSS)`,value:b(r.system?.codebaseIndexServer?.health?.server?.memory.rss??0),subtitle:`Heap ${b(r.system?.codebaseIndexServer?.health?.server?.memory.heapUsed??0)} / ${b(r.system?.codebaseIndexServer?.health?.server?.memory.heapTotal??0)}`,icon:m,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Workload`,value:`${r.system?.codebaseIndexServer?.health?.server?.activeRequests??0} requests`,subtitle:`${r.system?.codebaseIndexServer?.health?.server?.activeWrites??0} writes · ${r.system?.codebaseIndexServer?.health?.server?.queuedWrites??0} queued`,icon:f,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Watcher`,value:r.system?.codebaseIndexServer?.health?.server?.watchingExternal?`Active`:`Off`,subtitle:`${r.system?.codebaseIndexServer?.health?.server?.watchingClients??0} owners · ${r.system?.codebaseIndexServer?.health?.server?.pendingExternalFiles??0} pending`,icon:c,color:r.system?.codebaseIndexServer?.health?.server?.watchingExternal?`text-success`:`text-muted-foreground`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(a,{className:`h-4 w-4 text-primary`}),e(`activity:debug.rawData`)]}),(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsx)(`pre`,{className:`overflow-x-auto text-xs font-mono text-muted-foreground`,children:JSON.stringify({fileWatcher:r.fileWatcher,serverPid:r.system?.pid,serverMemory:r.system?.memoryUsage,serverHeapLimit:r.system?.heapLimit,serverUptime:r.system?.uptime,processes:r.system?.processes,codebaseIndexServer:r.system?.codebaseIndexServer},null,2)})})]})]})})}function b(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function x(e){return e===void 0?`—`:`${e>0?`+`:e<0?`−`:``}${b(Math.abs(e))}/h`}function S(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${(e/60).toFixed(1)}m`:`${(e/3600).toFixed(1)}h`}export{y as DebugDashboard};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Sa as t,Tn as n,Ut as r,Zt as i,_a as a,at as o,ba as s,et as c,ni as l,zi as u}from"./vendor-2VBBgNb5.js";import"./i18n-1BkaqMgr.js";import{t as d}from"./useWebSocket-Dh3aAFDE.js";import{t as f}from"./utils-CN2sfDVP.js";import{o as p}from"./view-navigation-Cgy5xh9q.js";import{b as m}from"./index-BPfIz78e.js";var h=e(t(),1);function g(e,t,n){return e<t?t:e>n?n:e}function _(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[g(r,0,1),Math.max(0,i),a]:null}function v(e){return g(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function y(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function b(e){let t=_(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${y(v(m))}${y(v(h))}${y(v(g))}`}function x(e){let t=e.trim(),n=b(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var S=c(),C=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],w=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function T(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function E({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e[`radius-md`]??e.radius??`0.5rem`,u=e[`font-sans`]??e.fontSans??`system-ui, sans-serif`,d=e[`font-display`]??e.fontDisplay??u,f=e[`shadow-2`]??(e.shadow&&e.shadow!==`none`?e.shadow:void 0);return(0,S.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,S.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,S.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,S.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,S.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,S.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,S.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,S.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,S.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function D({kit:e,overrides:t,onSet:n}){let[r,i]=(0,h.useState)(`light`),{t:o}=a(),s=T(r===`light`?e.light:e.dark,t,r);return(0,S.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:o(`activity:design.colors`)}),(0,S.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:f(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.filter(e=>s[e]).map(e=>{let t=x(s[e]??``)??`#000000`;return(0,S.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${s[e]}`,children:[(0,S.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,S.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function O({onTune:e}){let[t,n]=(0,h.useState)(``),r=({label:t,knob:n,values:r})=>(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>e({[n]:t}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-primary hover:text-primary-foreground`,children:t},t))})]});return(0,S.jsxs)(`div`,{className:`mt-1 flex flex-col gap-1.5 rounded-lg border border-border/60 bg-muted/30 p-2`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:`Tune`}),(0,S.jsx)(r,{label:`Radius`,knob:`radius`,values:[`none`,`sm`,`md`,`lg`,`xl`,`full`]}),(0,S.jsx)(r,{label:`Density`,knob:`density`,values:[`compact`,`cozy`,`comfortable`]}),(0,S.jsx)(r,{label:`Motion`,knob:`motion`,values:[`snappy`,`smooth`,`none`]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:`Font`}),(0,S.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onKeyDown:n=>{n.key===`Enter`&&t.trim()&&e({font:t.trim()})},placeholder:`Space Grotesk…`,className:`h-6 min-w-0 flex-1 rounded border border-border/60 bg-background/70 px-1.5 text-[10px]`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>t.trim()&&e({font:t.trim()}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-muted`,children:`Set`})]})]})}function k({className:e}){let{client:t}=d(),{t:c}=a(),[g,_]=(0,h.useState)([]),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)({}),[w,k]=(0,h.useState)(`web`),[A,j]=(0,h.useState)(``),[M,N]=(0,h.useState)(null);(0,h.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.payload;_(t?.kits??[]),y(t?.activeKit??null),x(t?.overrides??{})},n=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}))},r=e=>{let t=e.payload;t?.ok&&t.overrides&&x(t.overrides)},i=e=>{let t=e.payload;t?.ok&&t.overrides?(x(t.overrides),N(`Tuned`)):t?.error&&N(`Tune failed: ${t.error}`)},a=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}),N(`Swapped to ${t.kit}`))},o=e=>{let t=e.payload;N(t?.ok?s.t(`activity:design.wrote`,{path:t.path}):s.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},c=e=>{let t=e.payload;if(!t?.ok){N(s.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);N(t.violationCount?s.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):s.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return t.on(`design.list`,e),t.on(`design.use`,n),t.on(`design.set`,r),t.on(`design.tune`,i),t.on(`design.swap`,a),t.on(`design.materialize`,o),t.on(`design.verify`,c),t.send({type:`design.list`}),()=>{t.off(`design.list`,e),t.off(`design.use`,n),t.off(`design.set`,r),t.off(`design.tune`,i),t.off(`design.swap`,a),t.off(`design.materialize`,o),t.off(`design.verify`,c)}},[t]);let P=(0,h.useCallback)(e=>t?.send({type:`design.use`,payload:{kit:e,stack:w}}),[t,w]),F=(0,h.useCallback)((e,n)=>{x(t=>({...t,[e]:n})),t?.send({type:`design.set`,payload:{overrides:{[e]:n}}})},[t]),I=(0,h.useCallback)(e=>t?.send({type:`design.tune`,payload:{tune:e}}),[t]),L=(0,h.useCallback)(()=>{N(s.t(`activity:design.writing`)),t?.send({type:`design.materialize`,payload:{stack:w}})},[t,w]),R=(0,h.useCallback)(()=>{N(s.t(`activity:design.scanning`)),t?.send({type:`design.verify`})},[t]),z=(0,h.useMemo)(()=>{let e=A.trim().toLowerCase();return[...e?g.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):g].sort((e,t)=>e.name.localeCompare(t.name))},[g,A]);return(0,S.jsxs)(`div`,{className:f(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,S.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,S.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,S.jsx)(n,{className:`h-4 w-4`})}),(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:c(`activity:design.heading`)}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c(`activity:design.kitsCount`,{count:z.length})})]})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,S.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,S.jsx)(i,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,S.jsx)(`input`,{value:A,onChange:e=>j(e.target.value),placeholder:c(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,S.jsx)(`select`,{value:w,onChange:e=>k(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:c(`activity:design.stackTitle`),children:C.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))}),M&&(0,S.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:M}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:c(`common:action.close`),children:(0,S.jsx)(o,{className:`h-4 w-4`})})]})]})})}),(0,S.jsx)(`div`,{ref:m(`design-gallery`),className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain p-3 sm:p-4`,children:z.length===0?(0,S.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,S.jsx)(n,{className:`h-8 w-8 text-primary/60`}),(0,S.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:c(`activity:design.kitsCount`,{count:0})}),(0,S.jsx)(`p`,{className:`text-xs`,children:c(`activity:design.searchPlaceholder`)})]}):(0,S.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:z.map(e=>{let t=v===e.id,n=t?b:{};return(0,S.jsxs)(`div`,{className:f(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,S.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,S.jsx)(E,{t:T(e.light,n,`light`),label:c(`activity:designStudio.light`)}),(0,S.jsx)(E,{t:T(e.dark,n,`dark`),label:c(`activity:designStudio.dark`)})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,S.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,S.jsx)(u,{className:`w-3 h-3`}),` `,c(`activity:design.active`)]})]}),(0,S.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>P(e.id),className:f(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:c(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,S.jsxs)(`button`,{type:`button`,onClick:L,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:c(`activity:design.materializeTitle`,{stack:w}),children:[(0,S.jsx)(l,{className:`w-3 h-3`}),` `,c(`activity:design.materialize`)]}),t&&(0,S.jsxs)(`button`,{type:`button`,onClick:R,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:c(`activity:design.verifyTitle`),children:[(0,S.jsx)(r,{className:`w-3 h-3`}),` `,c(`activity:design.verify`)]}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,S.jsx)(D,{kit:e,overrides:n,onSet:F}),t&&(0,S.jsx)(O,{onTune:I})]})]},e.id)})})})]})}export{k as DesignGalleryView};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ca as t,Cn as n,Li as r,Vt as i,Yt as a,ei as o,et as s,nt as c,va as l,xa as u}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{t as d}from"./useWebSocket-BTXT0rOW.js";import{t as f}from"./utils-DxDx8yib.js";import{o as p}from"./view-navigation-BRtuAwZo.js";import{c as m}from"./index-DxZTscTk.js";var h=e(t(),1);function g(e,t,n){return e<t?t:e>n?n:e}function _(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[g(r,0,1),Math.max(0,i),a]:null}function v(e){return g(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function y(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function b(e){let t=_(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${y(v(m))}${y(v(h))}${y(v(g))}`}function x(e){let t=e.trim(),n=b(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var S=s(),C=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],w=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function T(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function E({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e[`radius-md`]??e.radius??`0.5rem`,u=e[`font-sans`]??e.fontSans??`system-ui, sans-serif`,d=e[`font-display`]??e.fontDisplay??u,f=e[`shadow-2`]??(e.shadow&&e.shadow!==`none`?e.shadow:void 0);return(0,S.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,S.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,S.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,S.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,S.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,S.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,S.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,S.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,S.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function D({kit:e,overrides:t,onSet:n}){let[r,i]=(0,h.useState)(`light`),{t:a}=l(),o=T(r===`light`?e.light:e.dark,t,r);return(0,S.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,S.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:f(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.filter(e=>o[e]).map(e=>{let t=x(o[e]??``)??`#000000`;return(0,S.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,S.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,S.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function O({onTune:e}){let[t,n]=(0,h.useState)(``),r=({label:t,knob:n,values:r})=>(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>e({[n]:t}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-primary hover:text-primary-foreground`,children:t},t))})]});return(0,S.jsxs)(`div`,{className:`mt-1 flex flex-col gap-1.5 rounded-lg border border-border/60 bg-muted/30 p-2`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:`Tune`}),(0,S.jsx)(r,{label:`Radius`,knob:`radius`,values:[`none`,`sm`,`md`,`lg`,`xl`,`full`]}),(0,S.jsx)(r,{label:`Density`,knob:`density`,values:[`compact`,`cozy`,`comfortable`]}),(0,S.jsx)(r,{label:`Motion`,knob:`motion`,values:[`snappy`,`smooth`,`none`]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:`Font`}),(0,S.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onKeyDown:n=>{n.key===`Enter`&&t.trim()&&e({font:t.trim()})},placeholder:`Space Grotesk…`,className:`h-6 min-w-0 flex-1 rounded border border-border/60 bg-background/70 px-1.5 text-[10px]`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>t.trim()&&e({font:t.trim()}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-muted`,children:`Set`})]})]})}function k({className:e}){let{client:t}=d(),{t:s}=l(),[g,_]=(0,h.useState)([]),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)({}),[w,k]=(0,h.useState)(`web`),[A,j]=(0,h.useState)(``),[M,N]=(0,h.useState)(null);(0,h.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.payload;_(t?.kits??[]),y(t?.activeKit??null),x(t?.overrides??{})},n=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}))},r=e=>{let t=e.payload;t?.ok&&t.overrides&&x(t.overrides)},i=e=>{let t=e.payload;t?.ok&&t.overrides?(x(t.overrides),N(`Tuned`)):t?.error&&N(`Tune failed: ${t.error}`)},a=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}),N(`Swapped to ${t.kit}`))},o=e=>{let t=e.payload;N(t?.ok?u.t(`activity:design.wrote`,{path:t.path}):u.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},s=e=>{let t=e.payload;if(!t?.ok){N(u.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);N(t.violationCount?u.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):u.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return t.on(`design.list`,e),t.on(`design.use`,n),t.on(`design.set`,r),t.on(`design.tune`,i),t.on(`design.swap`,a),t.on(`design.materialize`,o),t.on(`design.verify`,s),t.send({type:`design.list`}),()=>{t.off(`design.list`,e),t.off(`design.use`,n),t.off(`design.set`,r),t.off(`design.tune`,i),t.off(`design.swap`,a),t.off(`design.materialize`,o),t.off(`design.verify`,s)}},[t]);let P=(0,h.useCallback)(e=>t?.send({type:`design.use`,payload:{kit:e,stack:w}}),[t,w]),F=(0,h.useCallback)((e,n)=>{x(t=>({...t,[e]:n})),t?.send({type:`design.set`,payload:{overrides:{[e]:n}}})},[t]),I=(0,h.useCallback)(e=>t?.send({type:`design.tune`,payload:{tune:e}}),[t]),L=(0,h.useCallback)(()=>{N(u.t(`activity:design.writing`)),t?.send({type:`design.materialize`,payload:{stack:w}})},[t,w]),R=(0,h.useCallback)(()=>{N(u.t(`activity:design.scanning`)),t?.send({type:`design.verify`})},[t]),z=(0,h.useMemo)(()=>{let e=A.trim().toLowerCase();return[...e?g.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):g].sort((e,t)=>e.name.localeCompare(t.name))},[g,A]);return(0,S.jsxs)(`div`,{className:f(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,S.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,S.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,S.jsx)(n,{className:`h-4 w-4`})}),(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:s(`activity:design.heading`)}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s(`activity:design.kitsCount`,{count:z.length})})]})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,S.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,S.jsx)(a,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,S.jsx)(`input`,{value:A,onChange:e=>j(e.target.value),placeholder:s(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,S.jsx)(`select`,{value:w,onChange:e=>k(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:s(`activity:design.stackTitle`),children:C.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))}),M&&(0,S.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:M}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:s(`common:action.close`),children:(0,S.jsx)(c,{className:`h-4 w-4`})})]})]})})}),(0,S.jsx)(`div`,{ref:m(`design-gallery`),className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain p-3 sm:p-4`,children:z.length===0?(0,S.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,S.jsx)(n,{className:`h-8 w-8 text-primary/60`}),(0,S.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:s(`activity:design.kitsCount`,{count:0})}),(0,S.jsx)(`p`,{className:`text-xs`,children:s(`activity:design.searchPlaceholder`)})]}):(0,S.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:z.map(e=>{let t=v===e.id,n=t?b:{};return(0,S.jsxs)(`div`,{className:f(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,S.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,S.jsx)(E,{t:T(e.light,n,`light`),label:s(`activity:designStudio.light`)}),(0,S.jsx)(E,{t:T(e.dark,n,`dark`),label:s(`activity:designStudio.dark`)})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,S.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,S.jsx)(r,{className:`w-3 h-3`}),` `,s(`activity:design.active`)]})]}),(0,S.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>P(e.id),className:f(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:s(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,S.jsxs)(`button`,{type:`button`,onClick:L,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:s(`activity:design.materializeTitle`,{stack:w}),children:[(0,S.jsx)(o,{className:`w-3 h-3`}),` `,s(`activity:design.materialize`)]}),t&&(0,S.jsxs)(`button`,{type:`button`,onClick:R,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:s(`activity:design.verifyTitle`),children:[(0,S.jsx)(i,{className:`w-3 h-3`}),` `,s(`activity:design.verify`)]}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,S.jsx)(D,{kit:e,overrides:n,onSet:F}),t&&(0,S.jsx)(O,{onTune:I})]})]},e.id)})})})]})}export{k as DesignGalleryView};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-CWhuSNod.js";import{$t as n,At as r,Ca as i,Oi as a,Wn as o,_n as s,bi as c,dn as l,et as u,fn as d,gt as f,li as p,mi as m,nn as h,nr as g,nt as _,pt as v,rn as y,tt as ee,va as b,xa as x,yi as S}from"./vendor-BTDGplXK.js";import"./i18n-DOuSY1L8.js";import{t as C}from"./useWebSocket-BTXT0rOW.js";import{t as w}from"./utils-DxDx8yib.js";import{m as T,p as E,t as D}from"./stores-CpZiOiOP.js";import{o as O}from"./view-navigation-BRtuAwZo.js";import{t as k}from"./button-Clh96jMK.js";import{h as A,m as te,p as ne,y as j}from"./index-DxZTscTk.js";var M=e(i(),1),N=u(),P={pending:{icon:(0,N.jsx)(S,{className:`w-4 h-4`}),color:`text-muted-foreground`,label:`Pending`},in_progress:{icon:(0,N.jsx)(m,{className:`w-4 h-4 animate-spin`}),color:`text-primary`,label:`In Progress`},blocked:{icon:(0,N.jsx)(s,{className:`w-4 h-4`}),color:`text-warning`,label:`Blocked`},failed:{icon:(0,N.jsx)(c,{className:`w-4 h-4`}),color:`text-destructive`,label:`Failed`},review:{icon:(0,N.jsx)(h,{className:`w-4 h-4`}),color:`text-info`,label:`Review`},completed:{icon:(0,N.jsx)(a,{className:`w-4 h-4`}),color:`text-success`,label:`Done`}},F={critical:`bg-destructive/15 text-destructive`,high:`bg-warning/15 text-warning`,medium:`bg-info/15 text-info`,low:`bg-muted text-muted-foreground`},I={feature:`bg-success/15 text-success`,bugfix:`bg-destructive/15 text-destructive`,refactor:`bg-primary/15 text-primary`,docs:`bg-info/15 text-info`,test:`bg-primary/15 text-primary`,chore:`bg-muted text-muted-foreground`};function L(e){if(!e)return``;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function R({task:e,onStatusChange:t,onRetry:n,agents:r,onAssign:i,compact:a,className:o}){let{t:s}=b(),c=P[e.status],[l,u]=(0,M.useState)(!1),d=e.status===`in_progress`;return(0,N.jsxs)(`div`,{className:w(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,d?`border-primary/40 bg-primary/5`:e.status===`completed`?`border-success/35 bg-success/6`:e.status===`failed`?`border-destructive/40 bg-destructive/5`:`border-border bg-card`,o),children:[(0,N.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,N.jsx)(`span`,{className:w(`mt-0.5`,c.color),role:`img`,"aria-label":d?s(`common:status.inProgress`):void 0,children:c.icon}),(0,N.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,N.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,N.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,F[e.priority]),children:e.priority}),(0,N.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.type]),children:e.type})]}),e.description&&(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.description})]})]}),e.assignee&&(0,N.jsxs)(`div`,{className:w(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,d?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[d&&(0,N.jsx)(m,{className:`w-3 h-3 animate-spin`,"aria-label":s(`common:status.working`)}),(0,N.jsx)(`span`,{children:e.assignee})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.estimateHours?(0,N.jsxs)(`span`,{children:[`~`,e.estimateHours,`h`]}):null,e.actualHours?(0,N.jsxs)(`span`,{children:[`• `,e.actualHours,`h`]}):null,e.startedAt?(0,N.jsxs)(`span`,{children:[`• `,L(Date.now()-e.startedAt)]}):null]}),e.tags.length>0&&(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.tags.map(e=>(0,N.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))}),!a&&(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2`,children:[t&&e.status!==`in_progress`&&e.status!==`completed`&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`in_progress`),className:`px-2 py-0.5 text-[10px] rounded bg-primary/15 text-primary hover:bg-primary/25 transition-colors`,children:s(`activity:task.start`)}),t&&e.status===`in_progress`&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`completed`),className:`px-2 py-0.5 text-[10px] rounded bg-success/15 text-success hover:bg-success/25 transition-colors`,children:s(`activity:task.complete`)}),n&&(e.status===`failed`||e.status===`completed`)&&(0,N.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,children:[(0,N.jsx)(h,{className:`w-3 h-3`}),` `,s(`activity:task.retry`)]}),i&&r&&r.length>0&&(l?(0,N.jsxs)(`select`,{defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),u(!1)},onBlur:()=>u(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,N.jsx)(`option`,{value:``,children:s(`activity:task.unassigned`)}),r.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))]}):(0,N.jsxs)(`button`,{type:`button`,onClick:()=>u(!0),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,title:s(`activity:task.assignTitle`),children:[(0,N.jsx)(v,{className:`w-3 h-3`}),` `,s(`activity:task.assign`)]}))]})]})}var z=[{key:`pending`,label:`Pending`,match:[`pending`,`blocked`]},{key:`in_progress`,label:`In Progress`,match:[`in_progress`]},{key:`review`,label:`Review`,match:[`review`]},{key:`failed`,label:`Failed`,match:[`failed`]},{key:`completed`,label:`Done`,match:[`completed`]}],B={pending:`bg-muted text-muted-foreground`,ready:`bg-info/15 text-info`,running:`bg-primary/15 text-primary`,paused:`bg-warning/15 text-warning`,completed:`bg-success/15 text-success`,failed:`bg-destructive/15 text-destructive`,skipped:`bg-muted text-muted-foreground`};function re(){let{client:e}=C(),{t}=b(),r=E(e=>e.phases),i=E(e=>e.multiBoard),[a,o]=(0,M.useState)(`phase`),[s,c]=(0,M.useState)(null),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(0),m=Math.min(d,Math.max(0,r.length-1)),h=i?r[m]:void 0,g=(0,M.useMemo)(()=>r.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[r]),_=(0,M.useMemo)(()=>[...new Set(g.map(e=>e.assignee).filter(e=>!!e))],[g]),v=(0,M.useCallback)(t=>e?.send?.(t),[e]),y=(0,M.useCallback)((e,t)=>v({type:`goal.taskStatus`,payload:{taskId:e,status:t}}),[v]),ee=(0,M.useCallback)(e=>v({type:`goal.retryTask`,payload:{taskId:e}}),[v]),x=(0,M.useCallback)((e,t)=>v({type:`goal.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[v]),S=(0,M.useCallback)(e=>{j({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&v({type:`goal.addTask`,payload:{phaseId:e,title:t}})})},[v]),T=(0,M.useCallback)(e=>{s&&v({type:`goal.moveTask`,payload:{taskId:s,toPhaseId:e}}),c(null),u(null)},[s,v]),D=(0,M.useCallback)(e=>{s&&v({type:`goal.taskStatus`,payload:{taskId:s,status:e}}),c(null),u(null)},[s,v]),O={onStatusChange:y,onRetry:ee,agents:_,onAssign:x};function k(e){return{draggable:!0,onDragStart:t=>{c(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{c(null),u(null)}}}function A(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,l!==e&&u(e)},onDragLeave:()=>u(t=>t===e?null:t),onDrop:e=>{e.preventDefault(),t()},"data-hover":l===e||void 0}}return r.length===0?(0,N.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 items-center justify-center text-muted-foreground`,children:(0,N.jsx)(`p`,{className:`text-sm`,children:t(`activity:board.empty`)})}):(0,N.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2`,children:[(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:board.summary`,{phases:r.length,tasks:g.length})}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,N.jsxs)(`button`,{type:`button`,onClick:()=>o(`phase`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,a===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,N.jsx)(p,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,N.jsxs)(`button`,{type:`button`,onClick:()=>o(`status`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,a===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,N.jsx)(n,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),i&&h?(0,N.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,N.jsx)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b border-border px-3 py-1.5`,children:r.map((e,t)=>(0,N.jsxs)(`button`,{type:`button`,onClick:()=>f(t),className:w(`shrink-0 rounded-t px-3 py-1.5 text-xs font-medium transition-colors`,t===m?`border-primary/40 bg-primary/10 text-primary`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,N.jsx)(`span`,{className:`truncate`,children:e.name}),(0,N.jsxs)(`span`,{className:`ml-1.5 text-[10px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount]})]},e.id))}),(0,N.jsx)(U,{phase:h,allTasks:g,layout:a,dragId:s,hoverKey:l,callbacks:O,draggable:k,dropZone:A,dropToPhase:T,dropToStatus:D,onAddTask:S})]}):(0,N.jsx)(H,{phases:r,allTasks:g,layout:a,dragId:s,hoverKey:l,callbacks:O,draggable:k,dropZone:A,dropToPhase:T,dropToStatus:D,onAddTask:S})]})}function V({phase:e,phaseTasks:t,callbacks:n,draggable:r,dropZone:i,dropToPhase:a,onAddTask:o,dragId:s,hoverKey:c}){let{t:u}=b();return(0,N.jsxs)(`div`,{...i(`phase:${e.id}`,()=>a(e.id)),className:w(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,c===`phase:${e.id}`?`border-primary/60 bg-primary/5`:`border-border`),children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,N.jsx)(`span`,{className:w(`rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,B[e.status]),children:e.status})]}),(0,N.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount,` · `,e.progressPercent,`%`]})]}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>o(e.id),title:u(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,N.jsx)(l,{className:`h-4 w-4`})})]}),(0,N.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-2`,children:t.length===0?(0,N.jsx)(`p`,{className:`px-1 py-4 text-center text-[11px] text-muted-foreground`,children:u(`activity:board.dropHere`)}):t.map(e=>(0,N.jsx)(`div`,{...r(e.id),className:w(s===e.id&&`opacity-50`),children:(0,N.jsx)(R,{task:e,...n})},e.id))})]})}function H({phases:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:u}){return(0,N.jsx)(N.Fragment,{children:n===`phase`?(0,N.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:e.map(e=>(0,N.jsx)(V,{phase:e,phaseTasks:t.filter(t=>t.phaseId===e.id),callbacks:a,draggable:o,dropZone:s,dropToPhase:c,onAddTask:u,dragId:r,hoverKey:i},e.id))}):(0,N.jsx)(W,{phases:e,allTasks:t,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToStatus:l})})}function U({phase:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:u}){let d=t.filter(t=>t.phaseId===e.id),{t:f}=b();return n===`phase`?(0,N.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:(0,N.jsx)(V,{phase:e,phaseTasks:d,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,onAddTask:u,dragId:r,hoverKey:i})}):(0,N.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain p-3`,children:(0,N.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${z.length}, minmax(0, 1fr))`},children:[(0,N.jsx)(`div`,{}),z.map(e=>(0,N.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:f(`activity:board.status.${e.key}`)},e.key)),(0,N.jsxs)(G,{children:[(0,N.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,N.jsx)(`span`,{className:w(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,B[e.status]),children:e.status})]})}),z.map(t=>{let n=d.filter(e=>t.match.includes(e.status)),c=`cell:${e.id}:${t.key}`;return(0,N.jsx)(`div`,{...s(c,()=>l(t.key)),className:w(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,i===c?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:n.map(e=>(0,N.jsx)(`div`,{...o(e.id),className:w(r===e.id&&`opacity-50`),children:(0,N.jsx)(R,{task:e,compact:!0,...a})},e.id))},t.key)})]},e.id)]})})}function W({phases:e,allTasks:t,dragId:n,hoverKey:r,callbacks:i,draggable:a,dropZone:o,dropToStatus:s}){let{t:c}=b();return(0,N.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${z.length}, minmax(0, 1fr))`},children:[(0,N.jsx)(`div`,{}),z.map(e=>(0,N.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:c(`activity:board.status.${e.key}`)},e.key)),e.map(e=>(0,N.jsxs)(G,{children:[(0,N.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,N.jsx)(`span`,{className:w(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,B[e.status]),children:e.status})]})}),z.map(c=>{let l=t.filter(t=>t.phaseId===e.id&&c.match.includes(t.status)),u=`cell:${e.id}:${c.key}`;return(0,N.jsx)(`div`,{...o(u,()=>s(c.key)),className:w(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,r===u?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:l.map(e=>(0,N.jsx)(`div`,{...a(e.id),className:w(n===e.id&&`opacity-50`),children:(0,N.jsx)(R,{task:e,compact:!0,...i})},e.id))},c.key)})]},e.id))]})}function G({children:e}){return(0,N.jsx)(N.Fragment,{children:e})}function K({onClose:e}){let{client:n}=C(),{t:i}=b(),a=E(e=>e.phases),c=E(e=>e.overallPercent),u=E(e=>e.autonomous),p=E(e=>e.title),m=E(e=>e.goal),h=E(e=>e.status),v=E(e=>e.lastError),S=E(e=>e.graphs);(0,M.useEffect)(()=>{n?.send?.({type:`goal.list`}),n?.send?.({type:`goal.state`})},[n]);let j=D(e=>e.worktrees),P=D(e=>e.baseBranch),[F,I]=(0,M.useState)(``),[L,R]=(0,M.useState)(null),[z,B]=(0,M.useState)(!1),[V,H]=(0,M.useState)(!0),[U,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(!1),[q,ie]=(0,M.useState)(!1),J=T(e=>e.result),Y=T(e=>e.loading),X=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(X.current&&clearTimeout(X.current),!F.trim()){T.getState().clear();return}return X.current=setTimeout(()=>{T.getState().setLoading();let e=T.getState().nextSeq();n?.send?.({type:`goal.assess`,payload:{goal:F,seq:e}})},800),()=>{X.current&&clearTimeout(X.current)}},[F,n]),(0,M.useEffect)(()=>{!F.trim()&&!L&&T.getState().clear()},[F,L]);let Z=a.length>0,ae=L!=null&&!Z;(0,M.useEffect)(()=>{Z&&R(null)},[Z]);let Q=(0,M.useCallback)(()=>{let e=F.trim();if(!e||L!=null)return;let r=t.getState();r.addMessage({role:`user`,content:e}),r.addMessage({role:`assistant`,content:x.t(`activity:goalRun.planningAck`)}),R(e),I(``),n?.send?.({type:`goal.start`,payload:{title:e,autonomous:!0,worktrees:V,multiBoard:U,verifyTasks:G,chimeraReview:q}}),O(`chat`)},[F,L,n,V]),oe=(0,M.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}}),R(null)},[n]),se=(0,M.useCallback)(()=>{n?.send?.({type:`goal.toggleAutonomous`,payload:{}})},[n]),ce=(0,M.useCallback)(()=>{n?.send?.(h===`paused`?{type:`goal.resume`,payload:{}}:{type:`goal.pause`,payload:{}})},[n,h]),le=(0,M.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}})},[n]),ue=(0,M.useCallback)(()=>{n?.send?.({type:`goal.clear`,payload:{}}),E.getState().clear(),R(null),I(``)},[n]),[de,$]=(0,M.useState)(!1),fe=(0,M.useCallback)(()=>{n?.send?.({type:`goal.revert`,payload:{}}),$(!1)},[n]),pe=h===`running`||h===`paused`,me=h===`stopped`||h===`completed`||h===`failed`,he=(0,M.useCallback)(e=>{e&&n?.send?.({type:`goal.load`,payload:{graphId:e}})},[n]);return(0,N.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,N.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2 border-b bg-card px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,N.jsx)(g,{className:`h-5 w-5 text-muted-foreground`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h1`,{className:`text-lg font-semibold`,children:Z&&p||`Goal`}),Z&&(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`activity:goalRun.summary`,{count:a.length,pct:c})})]}),Z&&(0,N.jsx)(`span`,{className:w(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,h===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:h===`paused`||h===`stopped`?`border-warning/40 bg-warning/10 text-warning`:h===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:v??void 0,children:h})]}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[S.length>0&&(0,N.jsxs)(`select`,{value:Z?S.find(e=>e.title===p)?.id??``:``,onChange:e=>he(e.target.value),title:i(`activity:goalRun.switchBoard`),className:`min-w-0 flex-1 rounded border border-border bg-card px-2 py-1 text-xs text-foreground sm:w-72 sm:flex-none`,children:[(0,N.jsx)(`option`,{value:``,disabled:!0,children:i(`activity:goalRun.boardsCount`,{count:S.length})}),S.map(e=>(0,N.jsxs)(`option`,{value:e.id,children:[e.title,` · `,e.status]},e.id))]}),Z&&(0,N.jsxs)(`button`,{type:`button`,onClick:se,title:i(`activity:goalRun.toggleAutonomousTitle`),className:w(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,u?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,N.jsx)(ee,{className:`h-3.5 w-3.5`}),` `,i(u?`activity:goalRun.autonomous`:`activity:goalRun.manual`)]}),pe&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`button`,{type:`button`,onClick:ce,title:i(h===`paused`?`activity:goalRun.resumeTitle`:`activity:goalRun.pauseTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[h===`paused`?(0,N.jsx)(d,{className:`h-3.5 w-3.5`}):(0,N.jsx)(s,{className:`h-3.5 w-3.5`}),i(h===`paused`?`activity:goalRun.resume`:`activity:goalRun.pause`)]}),(0,N.jsxs)(`button`,{type:`button`,onClick:le,title:i(`activity:goalRun.stopTitle`),className:`inline-flex items-center gap-1 rounded border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,children:[(0,N.jsx)(r,{className:`h-3.5 w-3.5 fill-current`}),` `,i(`activity:goalRun.stop`)]})]}),Z&&me&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`button`,{type:`button`,onClick:ue,title:i(`activity:goalRun.newTitle`),className:`inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-2 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/20`,children:[(0,N.jsx)(l,{className:`h-3.5 w-3.5`}),` `,i(`activity:goalRun.newLabel`)]}),de?(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 text-xs`,children:[(0,N.jsx)(`span`,{className:`text-warning`,children:i(`activity:goalRun.revertConfirm`)}),(0,N.jsx)(`button`,{type:`button`,onClick:fe,className:`rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-destructive hover:bg-destructive/25`,children:i(`common:action.yes`)}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>$(!1),className:`rounded px-1.5 py-0.5 text-muted-foreground hover:text-foreground`,children:i(`common:action.no`)})]}):(0,N.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:i(`activity:goalRun.revertTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,N.jsx)(f,{className:`h-3.5 w-3.5`}),` `,i(`activity:goalRun.revert`)]})]}),(0,N.jsx)(k,{variant:`ghost`,size:`icon`,onClick:e,children:(0,N.jsx)(_,{className:`h-4 w-4`})})]})]}),Z&&m&&(0,N.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-muted/20 px-4 py-2.5`,children:[(0,N.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,N.jsx)(y,{className:`h-3 w-3`}),` `,i(`activity:goalRun.goal`)]}),(0,N.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:m})]}),Z?(0,N.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,N.jsx)(re,{})}):ae?(0,N.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,N.jsxs)(`div`,{className:`max-w-lg w-full space-y-5 text-center`,children:[(0,N.jsx)(o,{className:`h-10 w-10 mx-auto animate-spin text-primary/70`}),(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsx)(`h2`,{className:`text-xl font-semibold`,children:i(`activity:goalRun.planning`)}),(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`activity:goalRun.planningBody`)})]}),(0,N.jsxs)(`div`,{className:`rounded-lg border border-border bg-card px-4 py-3 text-left`,children:[(0,N.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,N.jsx)(y,{className:`h-3 w-3`}),` `,i(`activity:goalRun.goal`)]}),(0,N.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:L})]}),(0,N.jsxs)(k,{variant:`outline`,onClick:oe,className:`gap-2`,children:[(0,N.jsx)(r,{className:`h-4 w-4 fill-current`}),` `,i(`common:action.cancel`)]})]})}):(0,N.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,N.jsxs)(`div`,{className:`max-w-lg w-full space-y-6`,children:[(0,N.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,N.jsx)(y,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,N.jsx)(`h2`,{className:`text-xl font-semibold`,children:i(`activity:goalRun.startHeading`)}),(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`activity:goalRun.startBody`)})]}),(0,N.jsx)(`textarea`,{value:F,onChange:e=>I(e.target.value),placeholder:i(`activity:goalRun.startPlaceholder`),rows:5,className:`w-full rounded-lg border border-border bg-card px-4 py-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground/70`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),Q())}}),Y&&(0,N.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,N.jsx)(o,{className:`h-3 w-3 animate-spin`}),i(`activity:goalRun.assess.analyzing`)]}),!Y&&J&&!J.parseFailed&&(0,N.jsxs)(`div`,{className:w(`rounded-lg border px-3 py-2 text-xs space-y-1.5`,J.realistic?`border-success/40 bg-success/10`:`border-warning/40 bg-warning/10`),children:[(0,N.jsx)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:J.realistic?(0,N.jsx)(`span`,{className:`text-success`,children:i(`activity:goalRun.assess.realistic`)}):(0,N.jsx)(`span`,{className:`text-warning`,children:i(`activity:goalRun.assess.durationConcern`)})}),J.durationClaimed&&(0,N.jsx)(`p`,{className:`text-muted-foreground`,children:i(`activity:goalRun.assess.durationClaimed`,{duration:J.durationClaimed})}),(0,N.jsx)(`p`,{className:`text-muted-foreground`,children:J.explanation}),J.recommendedDuration&&(0,N.jsx)(`p`,{className:`text-muted-foreground`,children:i(`activity:goalRun.assess.recommendation`,{duration:J.recommendedDuration})}),J.concerns.length>0&&(0,N.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,N.jsx)(`p`,{className:`font-medium text-foreground/80`,children:i(`activity:goalRun.assess.concerns`)}),(0,N.jsx)(`ul`,{className:`list-disc pl-4 space-y-0.5 text-muted-foreground`,children:J.concerns.map((e,t)=>(0,N.jsx)(`li`,{children:e},t))})]})]}),!Y&&J?.parseFailed&&(0,N.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-muted/20 px-3 py-2 text-xs text-muted-foreground`,children:i(`activity:goalRun.assess.analysisFailed`)}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:V,onChange:e=>H(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),i(`activity:goalRun.isolateLabel`)]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-3 text-xs text-muted-foreground`,children:[(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>W(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),i(`activity:goalRun.multiBoardLabel`)]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:G,onChange:e=>K(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),i(`activity:goalRun.verifyTasksLabel`)]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:q,onChange:e=>ie(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),i(`activity:goalRun.chimeraReviewLabel`)]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[!Y&&J&&!J.realistic&&!J.parseFailed&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>T.getState().clear(),className:`shrink-0 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:i(`activity:goalRun.assess.overrideTitle`),children:i(`activity:goalRun.assess.override`)}),(0,N.jsxs)(k,{onClick:Q,disabled:!F.trim()||L!=null||Y||!Y&&J!=null&&!J.parseFailed&&!J.realistic,className:`flex-1 gap-2`,title:F.trim()&&!Y&&J&&!J.parseFailed&&!J.realistic?i(`activity:goalRun.assess.disableTitle`):``,children:[(0,N.jsx)(d,{className:`h-4 w-4`}),i(`activity:goalRun.startButton`)]})]}),(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[i(`activity:goalRun.ctrlHint`),` ·`,` `,i(V?`activity:goalRun.isolateOn`:`activity:goalRun.isolateOff`)]})]})}),j.length>0&&(0,N.jsxs)(`div`,{className:`border-t bg-card/50 shrink-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-4 pt-2 text-xs`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>B(!1),className:w(`rounded px-2 py-0.5 border transition-colors`,z?`border-border text-muted-foreground hover:text-foreground`:`bg-primary/10 border-primary/30 text-primary`),children:i(`activity:goalRun.lanes`)}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>B(!0),className:w(`rounded px-2 py-0.5 border transition-colors`,z?`bg-primary/10 border-primary/30 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:i(`activity:goalRun.graph`)})]}),(0,N.jsxs)(`div`,{className:`space-y-2 px-4 pb-3`,children:[(0,N.jsx)(ne,{}),z?(0,N.jsx)(A,{worktrees:j,baseBranch:P}):(0,N.jsx)(te,{worktrees:j,baseBranch:P})]})]})]})}export{K as GoalView};