@wrongstack/webui 0.296.4 → 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 (532) hide show
  1. package/dist/assets/AgentRosterView-C8j2NuD1.js +11 -0
  2. package/dist/assets/AnalyticsDashboard-D2_HYmYw.js +1 -0
  3. package/dist/assets/AudienceMemoryPanel-SzXptIQj.js +3 -0
  4. package/dist/assets/{ChangesView-W_UTPolz.js → ChangesView-D31wr7_h.js} +1 -1
  5. package/dist/assets/{ChronicleDashboard-BivxCmdl.js → ChronicleDashboard-B7P4f1hr.js} +1 -1
  6. package/dist/assets/{CodeEditor-NAOGCzZS.js → CodeEditor-BRDwx8Y-.js} +1 -1
  7. package/dist/assets/CodeMap-uabWaeJH.js +1 -0
  8. package/dist/assets/{CronJobsPanel-0virGKLS.js → CronJobsPanel-C9shS0P2.js} +1 -1
  9. package/dist/assets/DeadCodeScanPanel-CHud_Ugp.js +2 -0
  10. package/dist/assets/DebugDashboard-DmqpGXnx.js +1 -0
  11. package/dist/assets/{DesignGalleryView-BSBDNBNf.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-CJBOoZME.js → ModelPicker-Dt0wCi90.js} +1 -1
  17. package/dist/assets/OfficeMapPanel-CUNRI3X7.js +4 -0
  18. package/dist/assets/{ProcessMonitor-d_5Iwyo7.js → ProcessMonitor-Dq760Vqm.js} +1 -1
  19. package/dist/assets/QueuePanel-ZcJliKcY.js +1 -0
  20. package/dist/assets/{RefreshDebugView-gPMro5jy.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-Bu8xHf5j.js → SpecsView-CzYtHNbj.js} +1 -1
  27. package/dist/assets/TechStackView-p9PKj9pQ.js +1 -0
  28. package/dist/assets/{TerminalPanel-gA6ThdVE.js → TerminalPanel-BRSYloOD.js} +1 -1
  29. package/dist/assets/{Toaster-DTJHnKyl.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-Bmh1yFe5.js → button-Clh96jMK.js} +1 -1
  38. package/dist/assets/chat-store-CWhuSNod.js +17 -0
  39. package/dist/assets/{codemap-activity-store-CkJTt5go.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-BLr7olIX.js → dialog-DYJUM0p1.js} +1 -1
  44. package/dist/assets/{empty-state-DoEewhfx.js → empty-state-BV-Y8c35.js} +1 -1
  45. package/dist/assets/{i18n-C2VyJ0Kz.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-BRS2rHSR.js → input-CW-Yw2Wu.js} +1 -1
  49. package/dist/assets/{mailbox-store-BN2cGkN_.js → mailbox-store-_8voaug1.js} +1 -1
  50. package/dist/assets/markdown-sSmz-Ua_.js +44 -0
  51. package/dist/assets/{progress-ring-BEsRLdjq.js → progress-ring-DPV94fM-.js} +1 -1
  52. package/dist/assets/{roster-ws-CVCrt_ih.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-DYL4K3aB.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-DzRQUvln.js → utils-DxDx8yib.js} +1 -1
  66. package/dist/assets/{vendor-9hC4n4Me.js → vendor-BTDGplXK.js} +28 -28
  67. package/dist/assets/{view-navigation-BSA3_knE.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/UpdateBanner.d.ts +8 -0
  74. package/dist/components/ViewRouter.d.ts +12 -0
  75. package/dist/components/WorkbenchTopbar.d.ts +53 -0
  76. package/dist/components/codemap-model.d.ts +2 -0
  77. package/dist/hooks/useViewport.d.ts +38 -0
  78. package/dist/hooks/useWebSocket.d.ts +1 -0
  79. package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +2 -1
  80. package/dist/index.html +24 -25
  81. package/dist/index.js +56726 -55208
  82. package/dist/lib/view-navigation.d.ts +1 -1
  83. package/dist/lib/ws-client.d.ts +16 -8
  84. package/dist/providers.json +10 -0
  85. package/dist/stores/chat-store.d.ts +53 -4
  86. package/dist/stores/config-store.d.ts +0 -2
  87. package/dist/stores/local-prefs.d.ts +20 -0
  88. package/dist/stores/session-store.d.ts +14 -0
  89. package/dist/stores/ui-store.d.ts +8 -1
  90. package/dist/types/client-message.d.ts +1 -0
  91. package/dist/types/connections.d.ts +7 -1
  92. package/dist/types/server-message.d.ts +9 -0
  93. package/dist/types/system.d.ts +4 -0
  94. package/package.json +8 -7
  95. package/dist/App.d.ts.map +0 -1
  96. package/dist/assets/AgentRosterView-DTbg5NoZ.js +0 -11
  97. package/dist/assets/AnalyticsDashboard-Xc8aG4ev.js +0 -1
  98. package/dist/assets/AudienceMemoryPanel-C1mj_XOq.js +0 -3
  99. package/dist/assets/CodeMap-BOhBy8OQ.js +0 -1
  100. package/dist/assets/DeadCodeScanPanel-DHsw8Nn4.js +0 -2
  101. package/dist/assets/DebugDashboard-DYEVc0PA.js +0 -1
  102. package/dist/assets/GoalView-C_wodXvj.js +0 -1
  103. package/dist/assets/KanbanView-D7SKeieE.js +0 -3
  104. package/dist/assets/LazyMarkdown-Bt3iw3ZV.js +0 -3
  105. package/dist/assets/MailboxDetailView-BaFQIyhC.js +0 -1
  106. package/dist/assets/MemoryManager-CWkdwf8F.js +0 -1
  107. package/dist/assets/OfficeMapPanel-BopbmfGN.js +0 -4
  108. package/dist/assets/QueuePanel-DlNF8CUn.js +0 -1
  109. package/dist/assets/SageTabs-yP5fr4lP.js +0 -2
  110. package/dist/assets/SddHub-DjeM7IaL.js +0 -2
  111. package/dist/assets/SessionsDashboard-D7b7aEse.js +0 -1
  112. package/dist/assets/SetupScreen-Dsek43zs.js +0 -1
  113. package/dist/assets/SkillDetailView-DxdqTQ5E.js +0 -3
  114. package/dist/assets/TechStackView--7TPHg0R.js +0 -1
  115. package/dist/assets/chat-store-DaSs2P3S.js +0 -13
  116. package/dist/assets/codemap-index-store-8v-MK2XF.js +0 -1
  117. package/dist/assets/common-D8_r1x8x.js +0 -1
  118. package/dist/assets/common-suUxW9sA.js +0 -1
  119. package/dist/assets/index-3CuRO3-V.css +0 -1
  120. package/dist/assets/index-DSXHr5yP.js +0 -131
  121. package/dist/assets/markdown-L6DLSM7f.js +0 -44
  122. package/dist/assets/session-store-w5G2euPs.js +0 -1
  123. package/dist/assets/settings-C5F2tQ7C.js +0 -1
  124. package/dist/assets/settings-Cdk8i_p6.js +0 -1
  125. package/dist/assets/settings-D6wFOw5n.js +0 -1
  126. package/dist/assets/settings-DCEOkxYE.js +0 -1
  127. package/dist/assets/settings-DsflqNn0.js +0 -1
  128. package/dist/assets/settings-skShEZ2B.js +0 -1
  129. package/dist/assets/stores-hEu6z1qz.js +0 -6
  130. package/dist/assets/ui-store-BI3LH2q8.js +0 -1
  131. package/dist/assets/useWebSocket-Ba38Sknk.js +0 -28
  132. package/dist/assets/ws-client-eyEv8wbm.js +0 -1
  133. package/dist/components/AgentOfficeDetails.d.ts.map +0 -1
  134. package/dist/components/AgentOfficeView/model.d.ts.map +0 -1
  135. package/dist/components/AgentOfficeView.d.ts.map +0 -1
  136. package/dist/components/AgentRosterCatalogTab.d.ts.map +0 -1
  137. package/dist/components/AgentRosterChrome.d.ts.map +0 -1
  138. package/dist/components/AgentRosterLiveTab.d.ts.map +0 -1
  139. package/dist/components/AgentRosterSelfLearningTab.d.ts.map +0 -1
  140. package/dist/components/AgentRosterView.d.ts.map +0 -1
  141. package/dist/components/AgentRuntimePolicyEditor.d.ts.map +0 -1
  142. package/dist/components/AgentTranscript.d.ts.map +0 -1
  143. package/dist/components/AgentsMonitor.d.ts.map +0 -1
  144. package/dist/components/AgentsPage/format.d.ts.map +0 -1
  145. package/dist/components/AgentsPage.d.ts.map +0 -1
  146. package/dist/components/AnalyticsDashboard.d.ts.map +0 -1
  147. package/dist/components/AudienceMemoryPanel.d.ts.map +0 -1
  148. package/dist/components/AutonomyPicker.d.ts.map +0 -1
  149. package/dist/components/AvailabilityCalendarEditor.d.ts.map +0 -1
  150. package/dist/components/BoardView.d.ts.map +0 -1
  151. package/dist/components/ChangesView.d.ts.map +0 -1
  152. package/dist/components/ChatInput/code-detect.d.ts.map +0 -1
  153. package/dist/components/ChatInput/draft-token-counter.d.ts.map +0 -1
  154. package/dist/components/ChatInput/file-mention-picker.d.ts.map +0 -1
  155. package/dist/components/ChatInput/image-attach-control.d.ts.map +0 -1
  156. package/dist/components/ChatInput/image-attachments.d.ts.map +0 -1
  157. package/dist/components/ChatInput/queued-messages.d.ts.map +0 -1
  158. package/dist/components/ChatInput/refine-panel-host.d.ts.map +0 -1
  159. package/dist/components/ChatInput/slash-commands.d.ts.map +0 -1
  160. package/dist/components/ChatInput/slash-popup.d.ts.map +0 -1
  161. package/dist/components/ChatInput/slash-routing.d.ts.map +0 -1
  162. package/dist/components/ChatInput/stop-controls.d.ts.map +0 -1
  163. package/dist/components/ChatInput/use-paste-drop.d.ts.map +0 -1
  164. package/dist/components/ChatInput.d.ts.map +0 -1
  165. package/dist/components/ChatView/ThinkingBubble.d.ts.map +0 -1
  166. package/dist/components/ChatView/index.d.ts.map +0 -1
  167. package/dist/components/ChatView/utils.d.ts.map +0 -1
  168. package/dist/components/ChatView.d.ts.map +0 -1
  169. package/dist/components/CheckpointTimeline.d.ts.map +0 -1
  170. package/dist/components/ChipMultiSelect.d.ts.map +0 -1
  171. package/dist/components/ChronicleDashboard.d.ts.map +0 -1
  172. package/dist/components/ChroniclePipelineStrip.d.ts.map +0 -1
  173. package/dist/components/CodeEditor.d.ts.map +0 -1
  174. package/dist/components/CodeMap.d.ts.map +0 -1
  175. package/dist/components/CodeMapActivityDrawer.d.ts.map +0 -1
  176. package/dist/components/CodeMapActivityHelpers.d.ts.map +0 -1
  177. package/dist/components/CodeMapActivityStreamPanel.d.ts.map +0 -1
  178. package/dist/components/CodeMapCanvasSurface.d.ts.map +0 -1
  179. package/dist/components/CodeMapCanvasToolbar.d.ts.map +0 -1
  180. package/dist/components/CodeMapConfig.d.ts.map +0 -1
  181. package/dist/components/CodeMapDirectoryTree.d.ts.map +0 -1
  182. package/dist/components/CodeMapFlowState.d.ts.map +0 -1
  183. package/dist/components/CodeMapHeader.d.ts.map +0 -1
  184. package/dist/components/CodeMapLiveOverlay.d.ts.map +0 -1
  185. package/dist/components/CodeMapRelationInspector.d.ts.map +0 -1
  186. package/dist/components/CodeMapRelations.d.ts.map +0 -1
  187. package/dist/components/CodeMapSearchResults.d.ts.map +0 -1
  188. package/dist/components/CodeMapSelectedNodeSummary.d.ts.map +0 -1
  189. package/dist/components/CodeMapTreeSidebar.d.ts.map +0 -1
  190. package/dist/components/CodeMapVisuals.d.ts.map +0 -1
  191. package/dist/components/CollabPanel.d.ts.map +0 -1
  192. package/dist/components/CommandPalette/export-utils.d.ts.map +0 -1
  193. package/dist/components/CommandPalette/index.d.ts.map +0 -1
  194. package/dist/components/CommandPalette.d.ts.map +0 -1
  195. package/dist/components/ConfirmDialog.d.ts.map +0 -1
  196. package/dist/components/ConfirmModal.d.ts.map +0 -1
  197. package/dist/components/ConnectionBanner.d.ts.map +0 -1
  198. package/dist/components/ContextBar.d.ts.map +0 -1
  199. package/dist/components/ContextBreakdownModal.d.ts.map +0 -1
  200. package/dist/components/ContextDashboard.d.ts.map +0 -1
  201. package/dist/components/ContextMemoryMonitor.d.ts.map +0 -1
  202. package/dist/components/ContextModePicker.d.ts.map +0 -1
  203. package/dist/components/CostChip.d.ts.map +0 -1
  204. package/dist/components/CronJobsPanel.d.ts.map +0 -1
  205. package/dist/components/CronTrigger.d.ts.map +0 -1
  206. package/dist/components/CustomRosterPanel.d.ts.map +0 -1
  207. package/dist/components/DeadCodeScanPanel/DeadCodeScanPanel.d.ts.map +0 -1
  208. package/dist/components/DebugDashboard.d.ts.map +0 -1
  209. package/dist/components/DependencyGraph.d.ts.map +0 -1
  210. package/dist/components/DesignGalleryView.d.ts.map +0 -1
  211. package/dist/components/DiffView.d.ts.map +0 -1
  212. package/dist/components/ErrorBoundary.d.ts.map +0 -1
  213. package/dist/components/FallbackEditor.d.ts.map +0 -1
  214. package/dist/components/FileActivityDrawer.d.ts.map +0 -1
  215. package/dist/components/FileExplorer.d.ts.map +0 -1
  216. package/dist/components/FilePicker.d.ts.map +0 -1
  217. package/dist/components/FileReferenceChip.d.ts.map +0 -1
  218. package/dist/components/FleetMonitor.d.ts.map +0 -1
  219. package/dist/components/FleetPanel.d.ts.map +0 -1
  220. package/dist/components/GoalPanel.d.ts.map +0 -1
  221. package/dist/components/GoalView.d.ts.map +0 -1
  222. package/dist/components/InspectorPanel.d.ts.map +0 -1
  223. package/dist/components/KanbanAgentRunPanel.d.ts.map +0 -1
  224. package/dist/components/KanbanBoardChrome.d.ts.map +0 -1
  225. package/dist/components/KanbanBoardSidebar.d.ts.map +0 -1
  226. package/dist/components/KanbanBoardState.d.ts.map +0 -1
  227. package/dist/components/KanbanBoundaryEditor.d.ts.map +0 -1
  228. package/dist/components/KanbanCleanerAlert.d.ts.map +0 -1
  229. package/dist/components/KanbanColumnView.d.ts.map +0 -1
  230. package/dist/components/KanbanDecompositionPanel.d.ts.map +0 -1
  231. package/dist/components/KanbanQueueHealthBar.d.ts.map +0 -1
  232. package/dist/components/KanbanRunControls.d.ts.map +0 -1
  233. package/dist/components/KanbanTaskActivityRecorder.d.ts.map +0 -1
  234. package/dist/components/KanbanTaskCompletionChecks.d.ts.map +0 -1
  235. package/dist/components/KanbanTaskFields.d.ts.map +0 -1
  236. package/dist/components/KanbanTaskInspector.d.ts.map +0 -1
  237. package/dist/components/KanbanTaskOptions.d.ts.map +0 -1
  238. package/dist/components/KanbanTaskTree.d.ts.map +0 -1
  239. package/dist/components/KanbanVerificationDashboard.d.ts.map +0 -1
  240. package/dist/components/KanbanView.d.ts.map +0 -1
  241. package/dist/components/KanbanViewModeTabs.d.ts.map +0 -1
  242. package/dist/components/MailboxDetailView.d.ts.map +0 -1
  243. package/dist/components/MailboxPanel.d.ts.map +0 -1
  244. package/dist/components/MemoryManager/DeleteMemoryDialog.d.ts.map +0 -1
  245. package/dist/components/MemoryManager/MemoryDetail.d.ts.map +0 -1
  246. package/dist/components/MemoryManager/MemoryDrawer.d.ts.map +0 -1
  247. package/dist/components/MemoryManager/MemoryEditor.d.ts.map +0 -1
  248. package/dist/components/MemoryManager/MemoryFilters.d.ts.map +0 -1
  249. package/dist/components/MemoryManager/MemoryGraph.d.ts.map +0 -1
  250. package/dist/components/MemoryManager/MemoryInjectorTrace.d.ts.map +0 -1
  251. package/dist/components/MemoryManager/MemoryLifecycleTrace.d.ts.map +0 -1
  252. package/dist/components/MemoryManager/MemoryList.d.ts.map +0 -1
  253. package/dist/components/MemoryManager/MemoryManagerEmpty.d.ts.map +0 -1
  254. package/dist/components/MemoryManager/SageTabs.d.ts.map +0 -1
  255. package/dist/components/MemoryManager/index.d.ts.map +0 -1
  256. package/dist/components/MemoryManager/selectors.d.ts.map +0 -1
  257. package/dist/components/MemoryManager/shared.d.ts.map +0 -1
  258. package/dist/components/MessageBubble/AttachmentGallery.d.ts.map +0 -1
  259. package/dist/components/MessageBubble/CopyButton.d.ts.map +0 -1
  260. package/dist/components/MessageBubble/ErrorBody.d.ts.map +0 -1
  261. package/dist/components/MessageBubble/LazyMarkdown.d.ts.map +0 -1
  262. package/dist/components/MessageBubble/StreamingMarkdown.d.ts.map +0 -1
  263. package/dist/components/MessageBubble/ToolInputView.d.ts.map +0 -1
  264. package/dist/components/MessageBubble/ToolLedgerCard.d.ts.map +0 -1
  265. package/dist/components/MessageBubble/index.d.ts.map +0 -1
  266. package/dist/components/MessageBubble/utils.d.ts.map +0 -1
  267. package/dist/components/MessageBubble.d.ts.map +0 -1
  268. package/dist/components/ModePicker.d.ts.map +0 -1
  269. package/dist/components/ModelPickDialog.d.ts.map +0 -1
  270. package/dist/components/ModelPicker.d.ts.map +0 -1
  271. package/dist/components/ModelSelectDialog.d.ts.map +0 -1
  272. package/dist/components/MonacoDiffView.d.ts.map +0 -1
  273. package/dist/components/NextStepsBar.d.ts.map +0 -1
  274. package/dist/components/OfficeMapCanvas/CanvasPanels.d.ts.map +0 -1
  275. package/dist/components/OfficeMapCanvas/Hud.d.ts.map +0 -1
  276. package/dist/components/OfficeMapCanvas/Overlays.d.ts.map +0 -1
  277. package/dist/components/OfficeMapCanvas/SelectedNodeDetailPanel.d.ts.map +0 -1
  278. package/dist/components/OfficeMapCanvas/edges.d.ts.map +0 -1
  279. package/dist/components/OfficeMapCanvas/nodes.d.ts.map +0 -1
  280. package/dist/components/OfficeMapCanvas/resolve.d.ts.map +0 -1
  281. package/dist/components/OfficeMapCanvas/use-recently-finished.d.ts.map +0 -1
  282. package/dist/components/OfficeMapCanvas/utils.d.ts.map +0 -1
  283. package/dist/components/OfficeMapCanvas.d.ts.map +0 -1
  284. package/dist/components/OfficeMapPanel.d.ts.map +0 -1
  285. package/dist/components/OfficeMapSettingsPanel.d.ts.map +0 -1
  286. package/dist/components/PhasePanel.d.ts.map +0 -1
  287. package/dist/components/PlanPanel.d.ts.map +0 -1
  288. package/dist/components/ProcessMonitor.d.ts.map +0 -1
  289. package/dist/components/PromptLibraryModal.d.ts.map +0 -1
  290. package/dist/components/ProviderWaitingRoom.d.ts.map +0 -1
  291. package/dist/components/QueuePanel.d.ts.map +0 -1
  292. package/dist/components/QuickModelSwitcher.d.ts.map +0 -1
  293. package/dist/components/QuickModelSwitcher.filter.d.ts.map +0 -1
  294. package/dist/components/RefinePanel.d.ts.map +0 -1
  295. package/dist/components/RefreshDebugView.d.ts.map +0 -1
  296. package/dist/components/SageMemoryCard.d.ts.map +0 -1
  297. package/dist/components/SddActivityFeed.d.ts.map +0 -1
  298. package/dist/components/SddBoardView.d.ts.map +0 -1
  299. package/dist/components/SddDestroyDialog.d.ts.map +0 -1
  300. package/dist/components/SddFlowGraph.d.ts.map +0 -1
  301. package/dist/components/SddHub.d.ts.map +0 -1
  302. package/dist/components/SddKanbanView.d.ts.map +0 -1
  303. package/dist/components/SddTaskDrawer.d.ts.map +0 -1
  304. package/dist/components/SddWizard.d.ts.map +0 -1
  305. package/dist/components/SearchOverlay.d.ts.map +0 -1
  306. package/dist/components/SendButton.d.ts.map +0 -1
  307. package/dist/components/SessionWatchPanel.d.ts.map +0 -1
  308. package/dist/components/SessionsDashboard.d.ts.map +0 -1
  309. package/dist/components/SettingsPanel/BasicSettingsTabs.d.ts.map +0 -1
  310. package/dist/components/SettingsPanel/BrainSection.d.ts.map +0 -1
  311. package/dist/components/SettingsPanel/ChimeraSettingsPanel.d.ts.map +0 -1
  312. package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts.map +0 -1
  313. package/dist/components/SettingsPanel/ConnectionsHealthSection.d.ts.map +0 -1
  314. package/dist/components/SettingsPanel/FallbacksSection.d.ts.map +0 -1
  315. package/dist/components/SettingsPanel/FleetSection.d.ts.map +0 -1
  316. package/dist/components/SettingsPanel/IntegrationsSection.d.ts.map +0 -1
  317. package/dist/components/SettingsPanel/MCPSection.d.ts.map +0 -1
  318. package/dist/components/SettingsPanel/ModelSection.d.ts.map +0 -1
  319. package/dist/components/SettingsPanel/OAuthLoginSection.d.ts.map +0 -1
  320. package/dist/components/SettingsPanel/PluginToggleList.d.ts.map +0 -1
  321. package/dist/components/SettingsPanel/PreferenceControls.d.ts.map +0 -1
  322. package/dist/components/SettingsPanel/PreferenceToggle.d.ts.map +0 -1
  323. package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts.map +0 -1
  324. package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts.map +0 -1
  325. package/dist/components/SettingsPanel/ProviderSection.d.ts.map +0 -1
  326. package/dist/components/SettingsPanel/RoutingSection.d.ts.map +0 -1
  327. package/dist/components/SettingsPanel/SecuritySection.d.ts.map +0 -1
  328. package/dist/components/SettingsPanel/ShadowSection.d.ts.map +0 -1
  329. package/dist/components/SettingsPanel/ToolsSection.d.ts.map +0 -1
  330. package/dist/components/SettingsPanel/brain-section-options.d.ts.map +0 -1
  331. package/dist/components/SettingsPanel/index.d.ts.map +0 -1
  332. package/dist/components/SettingsPanel/local-presets.d.ts.map +0 -1
  333. package/dist/components/SettingsPanel/official-servers.d.ts.map +0 -1
  334. package/dist/components/SettingsPanel/settings-panel-reducers.d.ts.map +0 -1
  335. package/dist/components/SettingsPanel/undo-send-decision.d.ts.map +0 -1
  336. package/dist/components/SettingsPanel.d.ts.map +0 -1
  337. package/dist/components/SetupScreen/CustomProviderSection.d.ts.map +0 -1
  338. package/dist/components/SetupScreen/ModelEditor.d.ts.map +0 -1
  339. package/dist/components/SetupScreen/ProviderKeyCard.d.ts.map +0 -1
  340. package/dist/components/SetupScreen/key-operation.d.ts.map +0 -1
  341. package/dist/components/SetupScreen/popular-providers.d.ts.map +0 -1
  342. package/dist/components/SetupScreen/relative-time.d.ts.map +0 -1
  343. package/dist/components/SetupScreen/types.d.ts.map +0 -1
  344. package/dist/components/SetupScreen.d.ts.map +0 -1
  345. package/dist/components/ShortcutsOverlay.d.ts.map +0 -1
  346. package/dist/components/SideEffectTimeline.d.ts.map +0 -1
  347. package/dist/components/SidePanel/AgentsPanel.d.ts.map +0 -1
  348. package/dist/components/SidePanel/ChangesPanel.d.ts.map +0 -1
  349. package/dist/components/SidePanel/DesignStudioPanel.d.ts.map +0 -1
  350. package/dist/components/SidePanel/SessionList.d.ts.map +0 -1
  351. package/dist/components/SidePanel/SessionPanel.d.ts.map +0 -1
  352. package/dist/components/SidePanel/SkillsList.d.ts.map +0 -1
  353. package/dist/components/SidePanel/WorktreesPanel.d.ts.map +0 -1
  354. package/dist/components/SidePanel/index.d.ts.map +0 -1
  355. package/dist/components/SkillDetailView.d.ts.map +0 -1
  356. package/dist/components/SpecsView.d.ts.map +0 -1
  357. package/dist/components/TaskActivityTimeline.d.ts.map +0 -1
  358. package/dist/components/TaskBoard.d.ts.map +0 -1
  359. package/dist/components/TaskCard.d.ts.map +0 -1
  360. package/dist/components/TaskExecutionAttempts.d.ts.map +0 -1
  361. package/dist/components/TaskIntelligencePanel.d.ts.map +0 -1
  362. package/dist/components/TaskRiskPanel.d.ts.map +0 -1
  363. package/dist/components/TaskVerificationSection.d.ts.map +0 -1
  364. package/dist/components/TasksPanel.d.ts.map +0 -1
  365. package/dist/components/TechStackView/DependencyDetail.d.ts.map +0 -1
  366. package/dist/components/TechStackView/DependencyTable.d.ts.map +0 -1
  367. package/dist/components/TechStackView/FindingsPanel.d.ts.map +0 -1
  368. package/dist/components/TechStackView/TechStackToolbar.d.ts.map +0 -1
  369. package/dist/components/TechStackView/index.d.ts.map +0 -1
  370. package/dist/components/TechStackView/shared.d.ts.map +0 -1
  371. package/dist/components/TerminalPanel.d.ts.map +0 -1
  372. package/dist/components/ThemeProvider.d.ts.map +0 -1
  373. package/dist/components/Toaster.d.ts.map +0 -1
  374. package/dist/components/TodosPanel.d.ts.map +0 -1
  375. package/dist/components/ToolGroup.d.ts.map +0 -1
  376. package/dist/components/ToolResult.d.ts.map +0 -1
  377. package/dist/components/VerificationReportPanel.d.ts.map +0 -1
  378. package/dist/components/WatchMessageBubble.d.ts.map +0 -1
  379. package/dist/components/WelcomeScreen.d.ts.map +0 -1
  380. package/dist/components/WorkDashboard.d.ts.map +0 -1
  381. package/dist/components/WorkspaceDock.d.ts.map +0 -1
  382. package/dist/components/WorktreeGraph.d.ts.map +0 -1
  383. package/dist/components/WorktreeLanes.d.ts.map +0 -1
  384. package/dist/components/WorktreeOrphans.d.ts.map +0 -1
  385. package/dist/components/activity-bar/index.d.ts.map +0 -1
  386. package/dist/components/activity-bar/nav.d.ts.map +0 -1
  387. package/dist/components/agent-roster-data.d.ts.map +0 -1
  388. package/dist/components/agents/AgentDetailSection.d.ts.map +0 -1
  389. package/dist/components/agents/AgentRosterCard.d.ts.map +0 -1
  390. package/dist/components/agents/FleetSummaryBar.d.ts.map +0 -1
  391. package/dist/components/codemap-model.d.ts.map +0 -1
  392. package/dist/components/context-editor/ContextWindowEditor.d.ts.map +0 -1
  393. package/dist/components/dashboard-primitives.d.ts.map +0 -1
  394. package/dist/components/index.d.ts.map +0 -1
  395. package/dist/components/monaco-theme.d.ts.map +0 -1
  396. package/dist/components/toaster-helpers.d.ts.map +0 -1
  397. package/dist/components/ui/PickerCardList.d.ts.map +0 -1
  398. package/dist/components/ui/api-key-display.d.ts.map +0 -1
  399. package/dist/components/ui/badge.d.ts.map +0 -1
  400. package/dist/components/ui/button.d.ts.map +0 -1
  401. package/dist/components/ui/concurrency-gauge.d.ts.map +0 -1
  402. package/dist/components/ui/dialog.d.ts.map +0 -1
  403. package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
  404. package/dist/components/ui/empty-state.d.ts.map +0 -1
  405. package/dist/components/ui/event-timeline.d.ts.map +0 -1
  406. package/dist/components/ui/fleet-agent-row.d.ts.map +0 -1
  407. package/dist/components/ui/index.d.ts.map +0 -1
  408. package/dist/components/ui/input.d.ts.map +0 -1
  409. package/dist/components/ui/pagination.d.ts.map +0 -1
  410. package/dist/components/ui/progress-ring.d.ts.map +0 -1
  411. package/dist/components/ui/scroll-area.d.ts.map +0 -1
  412. package/dist/components/ui/sheet.d.ts.map +0 -1
  413. package/dist/components/ui/sparkline.d.ts.map +0 -1
  414. package/dist/components/ui/tabs.d.ts.map +0 -1
  415. package/dist/components/useAgentRosterData.d.ts.map +0 -1
  416. package/dist/components/useKanbanRegistrySessionIds.d.ts.map +0 -1
  417. package/dist/hooks/index.d.ts.map +0 -1
  418. package/dist/hooks/use-ws-handlers.d.ts.map +0 -1
  419. package/dist/hooks/useDesktopBridge.d.ts.map +0 -1
  420. package/dist/hooks/useF5Resilience.d.ts.map +0 -1
  421. package/dist/hooks/useFieldKeyboardNav.d.ts.map +0 -1
  422. package/dist/hooks/useFleetPolling.d.ts.map +0 -1
  423. package/dist/hooks/useGitInfo.d.ts.map +0 -1
  424. package/dist/hooks/useGlobalKeyboardShortcuts.d.ts.map +0 -1
  425. package/dist/hooks/useHorizontalScroll.d.ts.map +0 -1
  426. package/dist/hooks/useKanbanMeta.d.ts.map +0 -1
  427. package/dist/hooks/useMemoryForFile.d.ts.map +0 -1
  428. package/dist/hooks/usePagination.d.ts.map +0 -1
  429. package/dist/hooks/useProviderModels.d.ts.map +0 -1
  430. package/dist/hooks/useScrollPosition.d.ts.map +0 -1
  431. package/dist/hooks/useWebSocket.d.ts.map +0 -1
  432. package/dist/hooks/ws-handlers/chat-handlers.d.ts.map +0 -1
  433. package/dist/hooks/ws-handlers/coordinator-handlers.d.ts.map +0 -1
  434. package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts.map +0 -1
  435. package/dist/hooks/ws-handlers/fleet-handlers.d.ts.map +0 -1
  436. package/dist/hooks/ws-handlers/misc-handlers.d.ts.map +0 -1
  437. package/dist/hooks/ws-handlers/session-handlers.d.ts.map +0 -1
  438. package/dist/hooks/ws-handlers/techstack-handlers.d.ts.map +0 -1
  439. package/dist/hooks/ws-handlers.d.ts.map +0 -1
  440. package/dist/i18n/index.d.ts.map +0 -1
  441. package/dist/i18n/languages.d.ts.map +0 -1
  442. package/dist/index.css.map +0 -7
  443. package/dist/index.js.map +0 -7
  444. package/dist/lib/accent-colors.d.ts.map +0 -1
  445. package/dist/lib/agent-office.d.ts.map +0 -1
  446. package/dist/lib/agent-status.d.ts.map +0 -1
  447. package/dist/lib/chime.d.ts.map +0 -1
  448. package/dist/lib/color.d.ts.map +0 -1
  449. package/dist/lib/completion.d.ts.map +0 -1
  450. package/dist/lib/core-browser-shim.d.ts.map +0 -1
  451. package/dist/lib/default-prompt-pools.d.ts.map +0 -1
  452. package/dist/lib/desktop-host.d.ts.map +0 -1
  453. package/dist/lib/desktop-shell.d.ts.map +0 -1
  454. package/dist/lib/fallback-ref.d.ts.map +0 -1
  455. package/dist/lib/favicon.d.ts.map +0 -1
  456. package/dist/lib/file-icons.d.ts.map +0 -1
  457. package/dist/lib/goal.d.ts.map +0 -1
  458. package/dist/lib/index.d.ts.map +0 -1
  459. package/dist/lib/kanban-cleaner.d.ts.map +0 -1
  460. package/dist/lib/kanban-metadata.d.ts.map +0 -1
  461. package/dist/lib/kanban-verification.d.ts.map +0 -1
  462. package/dist/lib/model-calendar.d.ts.map +0 -1
  463. package/dist/lib/model-matrix-routes.d.ts.map +0 -1
  464. package/dist/lib/notify.d.ts.map +0 -1
  465. package/dist/lib/plugin-enablement.d.ts.map +0 -1
  466. package/dist/lib/roster-ws.d.ts.map +0 -1
  467. package/dist/lib/sage-block.d.ts.map +0 -1
  468. package/dist/lib/sdd-theme.d.ts.map +0 -1
  469. package/dist/lib/stream-coalescer.d.ts.map +0 -1
  470. package/dist/lib/terminal-dock.d.ts.map +0 -1
  471. package/dist/lib/tool-icon.d.ts.map +0 -1
  472. package/dist/lib/tool-summary.d.ts.map +0 -1
  473. package/dist/lib/utils.d.ts.map +0 -1
  474. package/dist/lib/view-navigation.d.ts.map +0 -1
  475. package/dist/lib/ws-client-actions.d.ts.map +0 -1
  476. package/dist/lib/ws-client-contracts.d.ts.map +0 -1
  477. package/dist/lib/ws-client-helpers.d.ts.map +0 -1
  478. package/dist/lib/ws-client-utils.d.ts.map +0 -1
  479. package/dist/lib/ws-client.d.ts.map +0 -1
  480. package/dist/main.d.ts.map +0 -1
  481. package/dist/protocol-compatibility.d.ts.map +0 -1
  482. package/dist/stores/auto-submit-streak.d.ts.map +0 -1
  483. package/dist/stores/chat-store.d.ts.map +0 -1
  484. package/dist/stores/codemap-activity-store.d.ts.map +0 -1
  485. package/dist/stores/codemap-index-store.d.ts.map +0 -1
  486. package/dist/stores/config-store.d.ts.map +0 -1
  487. package/dist/stores/context-editor-store.d.ts.map +0 -1
  488. package/dist/stores/coordinator-monitor-store.d.ts.map +0 -1
  489. package/dist/stores/cron-store.d.ts.map +0 -1
  490. package/dist/stores/file-reference-store.d.ts.map +0 -1
  491. package/dist/stores/file-store.d.ts.map +0 -1
  492. package/dist/stores/fleet-store.d.ts.map +0 -1
  493. package/dist/stores/git-changes-store.d.ts.map +0 -1
  494. package/dist/stores/git-info-store.d.ts.map +0 -1
  495. package/dist/stores/goal-assess-store.d.ts.map +0 -1
  496. package/dist/stores/goal-run-store.d.ts.map +0 -1
  497. package/dist/stores/goal-state-store.d.ts.map +0 -1
  498. package/dist/stores/goal-store.d.ts.map +0 -1
  499. package/dist/stores/history-store.d.ts.map +0 -1
  500. package/dist/stores/index.d.ts.map +0 -1
  501. package/dist/stores/kanban-store.d.ts.map +0 -1
  502. package/dist/stores/local-prefs.d.ts.map +0 -1
  503. package/dist/stores/mailbox-store.d.ts.map +0 -1
  504. package/dist/stores/memory-injector-store.d.ts.map +0 -1
  505. package/dist/stores/memory-lifecycle-store.d.ts.map +0 -1
  506. package/dist/stores/monitor-store.d.ts.map +0 -1
  507. package/dist/stores/office-map-store.d.ts.map +0 -1
  508. package/dist/stores/provider-status-store.d.ts.map +0 -1
  509. package/dist/stores/sdd-board-store.d.ts.map +0 -1
  510. package/dist/stores/sdd-wizard-store.d.ts.map +0 -1
  511. package/dist/stores/session-store.d.ts.map +0 -1
  512. package/dist/stores/side-effect-store.d.ts.map +0 -1
  513. package/dist/stores/specs-store.d.ts.map +0 -1
  514. package/dist/stores/techstack-store.d.ts.map +0 -1
  515. package/dist/stores/types.d.ts.map +0 -1
  516. package/dist/stores/ui-store.d.ts.map +0 -1
  517. package/dist/stores/viz-store.d.ts.map +0 -1
  518. package/dist/stores/worktree-store.d.ts.map +0 -1
  519. package/dist/types/brain.d.ts.map +0 -1
  520. package/dist/types/chronicle.d.ts.map +0 -1
  521. package/dist/types/client-message.d.ts.map +0 -1
  522. package/dist/types/collab.d.ts.map +0 -1
  523. package/dist/types/connections.d.ts.map +0 -1
  524. package/dist/types/goal-kanban-worktree.d.ts.map +0 -1
  525. package/dist/types/protocol-core.d.ts.map +0 -1
  526. package/dist/types/runtime.d.ts.map +0 -1
  527. package/dist/types/sage.d.ts.map +0 -1
  528. package/dist/types/server-message.d.ts.map +0 -1
  529. package/dist/types/skills-design.d.ts.map +0 -1
  530. package/dist/types/system.d.ts.map +0 -1
  531. package/dist/types.d.ts.map +0 -1
  532. package/dist/types.js.map +0 -7
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ar as t,Dn as n,Dr as r,En as i,Et as a,Fi as o,Gr as s,Kn as c,Li as l,On as u,Ut as d,Zr as f,Zt as p,_ as m,a as h,at as g,br as _,c as v,et as y,f as b,fr as x,g as ee,h as te,i as S,ir as C,ln as w,m as ne,mn as T,n as re,oa as ie,p as ae,pa as E,qi as D,r as oe,rt as se,s as O,u as ce,xa as le,yn as ue}from"./vendor-9hC4n4Me.js";import{t as k}from"./utils-DzRQUvln.js";import{i as de,r as fe,t as pe}from"./codemap-activity-store-CkJTt5go.js";import{t as me}from"./codemap-index-store-8v-MK2XF.js";var A=e(le(),1),j=new Map;function M(e){let t=j.get(e);if(t!==void 0)return t;let n=e.replace(/\\/g,`/`).replace(/^\.\//,``).toLocaleLowerCase();return j.set(e,n),n}function N(e){return e.level===`packages`?`packages`:e.level===`files`?`files:${e.package}`:`symbols:${e.file}`}function he(e){return e.level===`packages`?`/api/codemap/packages`:e.level===`files`?`/api/codemap/files?package=${encodeURIComponent(e.package)}`:`/api/codemap/symbols?file=${encodeURIComponent(e.file)}`}function ge(e,t,n){let r=new Map(e.nodes.map(e=>[e.id,e])),i=[];for(let a of e.edges){let e=n===`incoming`?a.target===t?a.source:void 0:a.source===t?a.target:void 0;if(!e)continue;let o=r.get(e);o&&i.push({node:o,edge:a})}return i.sort((e,t)=>t.edge.weight-e.edge.weight||e.node.label.localeCompare(t.node.label))}function _e(e,t){let n=new Set([t]);for(let r of e.edges)r.source===t&&n.add(r.target),r.target===t&&n.add(r.source);return n}function P(e,t){let n=new Map(e.nodes.map(e=>[e.id,0]));for(let r of e.edges)!t.has(r.source)||!t.has(r.target)||(n.set(r.source,(n.get(r.source)??0)+r.weight),r.target!==r.source&&n.set(r.target,(n.get(r.target)??0)+r.weight));return n}function ve(e){let t=new Set(e.nodes.map(e=>e.id)),n=P(e,t),r=new Map(e.nodes.map(e=>[e.id,0])),i=new Map;for(let n of e.edges){if(!t.has(n.source)||!t.has(n.target)||n.source===n.target)continue;r.set(n.target,(r.get(n.target)??0)+1);let e=i.get(n.source)??[];e.push(n.target),i.set(n.source,e)}let a=new Map,o=e.nodes.filter(e=>(r.get(e.id)??0)===0).sort((e,t)=>(n.get(t.id)??0)-(n.get(e.id)??0)).map(e=>e.id);o.length===0&&e.nodes[0]&&o.push(e.nodes[0].id);for(let e of o)a.set(e,0);let s=new Set,c=0;for(;c<o.length;){let e=o[c++];if(!s.has(e)){s.add(e);for(let t of i.get(e)??[])a.set(t,Math.max(a.get(t)??0,Math.min((a.get(e)??0)+1,7))),r.set(t,(r.get(t)??1)-1),(r.get(t)??0)<=0&&o.push(t)}}let l=e.nodes.filter(e=>!a.has(e.id)).sort((e,t)=>(n.get(t.id)??0)-(n.get(e.id)??0));l.forEach((e,t)=>{a.set(e.id,t%Math.min(4,Math.max(1,l.length)))});let u=new Map;for(let t of e.nodes){let e=a.get(t.id)??0,n=u.get(e)??[];n.push(t),u.set(e,n)}for(let e of u.values())e.sort((e,t)=>Number(e.external)-Number(t.external)||(n.get(t.id)??0)-(n.get(e.id)??0)||e.label.localeCompare(t.label));let d=Math.max(1,...[...u.values()].map(e=>e.length))*160,f=[];for(let[e,t]of[...u.entries()].sort(([e],[t])=>e-t)){let n=(d-t.length*160)/2;t.forEach((t,r)=>{f.push({node:t,position:{x:e*386,y:n+r*160}})})}return f}function ye(e,t){if(e.nodes.length===0)return[];let n=P(e,new Set(e.nodes.map(e=>e.id))),r=e.nodes.find(e=>e.id===t)??[...e.nodes].sort((e,t)=>(n.get(t.id)??0)-(n.get(e.id)??0))[0],i=_e(e,r.id);i.delete(r.id);let a=e.nodes.filter(e=>i.has(e.id)),o=e.nodes.filter(e=>e.id!==r.id&&!i.has(e.id)),s=[{node:r,position:{x:0,y:0}}],c=(e,t,n)=>{e.forEach((r,i)=>{let a=n+Math.PI*2*i/Math.max(1,e.length);s.push({node:r,position:{x:Math.cos(a)*t,y:Math.sin(a)*t}})})};c(a,Math.max(330,a.length*34),-Math.PI/2);for(let e=0;e<o.length;e+=18)c(o.slice(e,e+18),620+Math.floor(e/18)*280,-Math.PI/2+.12);return s}function be(e,t,n){return t===`orbit`?ye(e,n):ve(e)}function F(e,t,n){if(e.length<=n)return e;let r=t?e.filter(e=>e.source===t||e.target===t):[],i=e.filter(e=>!t||e.source!==t&&e.target!==t).sort((e,t)=>t.weight-e.weight||e.source.localeCompare(t.source)||e.target.localeCompare(t.target)),a=Math.max(0,n-r.length);return[...r,...i.slice(0,a)]}function xe(e,t,n){if(n===`all`)return e;let r=e.nodes;if(e.nodes.length>96){let n=new Map(e.nodes.map(e=>[e.id,e])),i=new Map;for(let t of e.edges)i.set(t.source,(i.get(t.source)??0)+t.weight),i.set(t.target,(i.get(t.target)??0)+t.weight);let a=[...e.nodes].sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||e.label.localeCompare(t.label)),o=new Set,s=e=>{n.has(e)&&o.size<96&&o.add(e)};if(t&&n.has(t)){s(t);let n=e.edges.filter(e=>e.source===t||e.target===t).sort((e,t)=>t.weight-e.weight);for(let e of n)s(e.source),s(e.target);let r=new Set(o),i=e.edges.filter(e=>r.has(e.source)||r.has(e.target)).sort((e,t)=>t.weight-e.weight);for(let e of i)s(e.source),s(e.target)}else{let e=a.filter(e=>!e.external).slice(0,72),t=a.filter(e=>e.external).slice(0,24);for(let n of[...e,...t])s(n.id)}for(let e of a)s(e.id);r=e.nodes.filter(e=>o.has(e.id))}let i=new Set(r.map(e=>e.id)),a=e.edges.filter(e=>i.has(e.source)&&i.has(e.target));return{nodes:r,edges:F(a,t,180)}}function I(e){let t=(e.file??e.label).replace(/\\/g,`/`),n=e.package??``,r=n.startsWith(`@wrongstack/`)?`/packages/${n.slice(12)}/`:n.startsWith(`app:`)?`/apps/${n.slice(4)}/`:void 0;if(r){let e=t.indexOf(r);if(e>=0)return t.slice(e+r.length)}let i=t.lastIndexOf(`/src/`);return i>=0?t.slice(i+1):t.split(`/`).slice(-3).join(`/`)}var L=new WeakMap;function Se(e){let t=L.get(e);if(t)return t;let n={name:``,path:``,directories:[],files:[]};for(let t of e.filter(e=>e.kind===`file`&&!e.external)){let e=I(t).split(`/`).filter(Boolean),r=e.pop()??t.label,i=n;for(let t of e){let e=i.path?`${i.path}/${t}`:t,n=i.directories.find(e=>e.name===t);n||(n={name:t,path:e,directories:[],files:[]},i.directories.push(n)),i=n}i.files.push({...t,label:r})}let r=e=>{e.directories.sort((e,t)=>e.name.localeCompare(t.name)),e.files.sort((e,t)=>e.label.localeCompare(t.label)),e.directories.forEach(r)};return r(n),L.set(e,n),n}function Ce(e){let t=2166136261,n=e=>{for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)};for(let t of e.nodes)n(t.id);for(let r of e.edges)n(r.source),n(r.target),n(r.refType),t^=r.weight|0,t=Math.imul(t,16777619);return`${e.nodes.length}:${e.edges.length}:${t>>>0}`}function we(e,t,n,r){for(e.has(t)&&e.delete(t),e.set(t,n);e.size>r;){let t=e.keys().next().value;if(t===void 0)break;e.delete(t)}}function Te(e,t){if(!e||!t)return!1;let n=M(e),r=M(t);return n===r||n.endsWith(`/${r}`)||r.endsWith(`/${n}`)}function Ee(e){let t=M(e),n=t.match(/\/packages\/([^/]+)\//);if(n?.[1])return`@wrongstack/${n[1]}`;let r=t.match(/\/apps\/([^/]+)\//);return r?.[1]?`app:${r[1]}`:`(root)`}function De(e,t){return t.kind===`package`?Ee(e.filePath)===(t.package??t.label):Te(e.filePath,t.file)?t.kind!==`symbol`||e.symbol?.id===t.id:!1}function Oe(e){let t=new Map;for(let n of e){let e=M(n.filePath),r=t.get(e);r?r.push(n):t.set(e,[n])}return t}function ke(e,t){let n=new Map;if(t.length===0||e.length===0)return n;let r=Oe(t),i=new Map;for(let a of e){let e;if(a.kind===`package`){let n=a.package??a.label,r=i.get(n);r||(r=t.filter(e=>Ee(e.filePath)===n),i.set(n,r)),e=r}else if(a.file){let t=M(a.file),n=r.get(t);if(!n){n=[];for(let[e,i]of r)(e.endsWith(`/${t}`)||t.endsWith(`/${e}`))&&n.push(...i)}e=a.kind===`symbol`?n.filter(e=>e.symbol?.id===a.id):n}else e=[];e.length>0&&n.set(a.id,e)}return n}function Ae(e){if(e.length===0)return``;let t=`${e.length}`;for(let n=0;n<e.length;n++){let r=e[n];t+=`|${r.id??``}:${r.toolUseId??``}:${r.filePath}:${r.type}:${r.status??``}:${r.symbol?.id??``}:${r.timestamp}`}return t}function je(e,t){let n=t.filter(t=>t.kind===`symbol`&&!t.external&&Te(t.file,e.filePath));if(n.length===0)return;if(e.line)return[...n].sort((e,t)=>(t.line??0)-(e.line??0)).find(t=>(t.line??0)<=e.line)??n[0];let r=e.summary.toLocaleLowerCase();return n.find(e=>e.label.length>2&&(r.includes(e.label.toLocaleLowerCase())||!!(e.signature&&r.includes(e.signature.toLocaleLowerCase()))))}var R=y();function Me({historyFile:e,fileHistory:t,onClose:n}){return(0,R.jsxs)(`div`,{className:`absolute right-0 top-0 z-50 flex h-full w-[390px] max-w-[90%] flex-col border-l bg-card shadow-2xl`,children:[(0,R.jsxs)(`div`,{className:`flex h-12 items-center justify-between border-b px-4`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(E,{className:`h-4 w-4 shrink-0 text-warning`}),(0,R.jsx)(`span`,{className:`truncate font-mono text-[11px] font-semibold`,title:e,children:e})]}),(0,R.jsx)(`button`,{type:`button`,onClick:n,className:`flex h-7 w-7 items-center justify-center border text-muted-foreground hover:bg-muted`,"aria-label":`Close activity`,children:(0,R.jsx)(g,{className:`h-3.5 w-3.5`})})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:t.length===0?(0,R.jsx)(`p`,{className:`py-12 text-center text-[10px] text-muted-foreground`,children:`No activity recorded for this file yet.`}):t.map((e,t)=>(0,R.jsxs)(`div`,{className:`mb-1 flex items-start gap-2 border p-2 text-[10px]`,children:[(0,R.jsx)(`span`,{className:k(`border px-1.5 py-0.5 font-mono text-[8px] font-bold uppercase`,e.type===`delete`?`border-destructive/40 text-destructive`:e.type===`read`?`border-info/40 text-info`:`border-warning/40 text-warning`),children:e.type}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`font-mono text-[9px] text-muted-foreground`,children:new Date(e.timestamp).toLocaleTimeString()}),e.toolName&&(0,R.jsxs)(`div`,{className:`mt-1`,children:[`via `,e.toolName]}),e.agent&&(0,R.jsx)(`div`,{className:`text-muted-foreground`,children:e.agent}),e.summary&&(0,R.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:e.summary}),e.change&&(0,R.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 font-mono text-[8px]`,children:[(0,R.jsxs)(`span`,{className:`border border-success/40 bg-success/10 px-1 text-success`,children:[`+`,e.change.added]}),(0,R.jsxs)(`span`,{className:`border border-destructive/40 bg-destructive/10 px-1 text-destructive`,children:[`−`,e.change.removed]}),e.change.before&&(0,R.jsx)(`span`,{className:`ml-1 truncate text-destructive/80`,title:e.change.before,children:e.change.before}),e.change.after&&(0,R.jsxs)(`span`,{className:`truncate text-success/80`,title:e.change.after,children:[`→ `,e.change.after]})]}),(0,R.jsxs)(`div`,{className:`mt-1 flex gap-2 font-mono text-[8px] uppercase text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:e.status??`observed`}),(0,R.jsx)(`span`,{children:e.source??`legacy`}),e.durationMs!==void 0&&(0,R.jsxs)(`span`,{children:[e.durationMs,`ms`]}),e.watcherConfirmed&&(0,R.jsx)(`span`,{className:`text-success`,children:`fs verified`})]})]})]},`${e.timestamp}-${t}`))}),(0,R.jsxs)(`div`,{className:`border-t px-4 py-2 font-mono text-[9px] text-muted-foreground`,children:[t.length,` events · newest first`]})]})}var z={package:{icon:i,accent:`border-l-primary`,iconStyle:`bg-primary/12 text-primary`},file:{icon:s,accent:`border-l-info`,iconStyle:`bg-info/12 text-info`},symbol:{icon:D,accent:`border-l-success`,iconStyle:`bg-success/12 text-success`}},Ne={call:`hsl(var(--primary))`,import:`hsl(var(--info))`,type_ref:`hsl(var(--success))`,inherit:`hsl(var(--warning))`,implement:`hsl(var(--destructive))`},Pe={read:`ring-2 ring-info/60 shadow-info/20`,write:`ring-2 ring-warning/70 shadow-warning/30`,edit:`ring-2 ring-warning/80 shadow-warning/40`,delete:`ring-2 ring-destructive/70 shadow-destructive/30`,search:`ring-2 ring-primary/55 shadow-primary/20`,memory:`ring-2 ring-success/60 shadow-success/30`,index:`ring-2 ring-info/50 shadow-info/20`,execute:`ring-2 ring-primary/55 shadow-primary/25`},Fe=[`bg-primary text-primary-foreground`,`bg-info text-info-foreground`,`bg-success text-success-foreground`,`bg-warning text-warning-foreground`,`bg-destructive text-destructive-foreground`];function Ie(e){let t=e.trim().split(/[\s:_-]+/).filter(Boolean);return(t.length>1?`${t[0]?.[0]??``}${t[1]?.[0]??``}`:e.slice(0,2)).toLocaleUpperCase()}function Le(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)|0;return Fe[Math.abs(t)%Fe.length]??Fe[0]}function Re(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)|0;return`hsl(${Math.abs(t)%360} 82% 58%)`}function B(e){let t=e.replace(/\\/g,`/`),n=t.lastIndexOf(`/packages/`),r=t.lastIndexOf(`/apps/`),i=Math.max(n,r);return i>=0?t.slice(i+1):t.split(`/`).slice(-3).join(`/`)}function V(e){return[e.symbol?.name,e.line?`L${e.line}`:void 0].filter(Boolean).join(` · `)}function H({data:e}){let{graphNode:t,selected:n,dimmed:r,incoming:i,outgoing:a,isActive:o,activityType:s,activeOperations:c}=e,l=z[t.kind],u=l.icon,d=t.kind!==`symbol`,p=t.kind===`symbol`?`${t.symbolKind??`symbol`}${t.line?` · L${t.line}`:``}`:t.kind===`file`?I(t):`${t.fileCount??0} files · ${t.symbolCount??0} symbols`;return(0,R.jsxs)(`div`,{className:k(`group relative w-[236px] border border-l-[3px] bg-card text-card-foreground shadow-[0_8px_24px_hsl(var(--shadow-color)/0.08)] transition-[opacity,box-shadow,border-color,background-color]`,l.accent,n&&`border-primary bg-primary/5 shadow-[0_0_0_2px_hsl(var(--primary)/0.18),0_16px_36px_hsl(var(--shadow-color)/0.18)]`,t.external&&`border-dashed bg-muted/75`,r&&`opacity-25 grayscale`,o&&s&&Pe[s]),children:[c.length>0&&(0,R.jsxs)(`div`,{className:`absolute -top-5 left-2 z-20 flex max-w-[210px] items-center gap-1`,children:[c.slice(0,4).map(e=>{let t=e.agentName??e.agent??`External`,n=`${e.sessionId??`none`}:${e.agentId??t}`;return(0,R.jsxs)(`span`,{className:k(`flex h-6 items-center gap-1 border-2 border-background px-1.5 font-mono text-[8px] font-bold shadow-md`,Le(n)),title:`${t} · ${e.type} ${V(e)}`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse bg-current`}),Ie(t),e.symbol&&(0,R.jsx)(`span`,{className:`max-w-[80px] truncate`,children:e.symbol.name})]},e.id??`${n}:${e.filePath}`)}),c.length>4&&(0,R.jsxs)(`span`,{className:`border bg-card px-1 font-mono text-[8px] shadow`,children:[`+`,c.length-4]})]}),(0,R.jsx)(O,{type:`target`,position:m.Left,className:`!h-2.5 !w-2.5 !border-2 !border-card !bg-muted-foreground`}),(0,R.jsxs)(`button`,{type:`button`,className:`block w-full text-left`,onClick:n=>{if(n.shiftKey&&t.file){e.onShowHistory(t.file);return}e.onSelect(t)},onDoubleClick:()=>d&&e.onOpen(t),"aria-label":`${t.kind} ${t.label}`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 p-3 pr-10`,children:[(0,R.jsx)(`span`,{className:k(`flex h-8 w-8 shrink-0 items-center justify-center border`,l.iconStyle),children:(0,R.jsx)(u,{className:`h-4 w-4`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[9px] font-bold uppercase tracking-[0.18em] text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:t.kind}),t.external&&(0,R.jsx)(`span`,{className:`border border-border px-1 py-0.5 text-[8px] text-warning`,children:`external`}),t.lang&&(0,R.jsx)(`span`,{className:`ml-auto font-mono normal-case tracking-normal`,children:t.lang})]}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[13px] font-semibold`,title:t.label,children:t.label}),(0,R.jsx)(`div`,{className:`mt-1 truncate text-[10px] text-muted-foreground`,title:p,children:p})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 border-t bg-muted/30 px-3 py-1.5 font-mono text-[9px] text-muted-foreground`,children:[(0,R.jsxs)(`span`,{title:`Incoming relationships`,children:[`← `,i]}),(0,R.jsxs)(`span`,{title:`Outgoing relationships`,children:[`→ `,a]}),t.symbolCount!==void 0&&t.kind===`file`&&(0,R.jsxs)(`span`,{className:`ml-auto`,children:[t.symbolCount,` sym`]}),o&&(0,R.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 font-bold text-warning`,children:[(0,R.jsx)(w,{className:`h-2.5 w-2.5 animate-pulse`}),` LIVE`]})]})]}),d&&(0,R.jsx)(`button`,{type:`button`,className:`absolute right-2 top-2 z-10 flex h-7 w-7 items-center justify-center border border-transparent text-muted-foreground opacity-0 transition hover:border-border hover:bg-muted hover:text-foreground group-hover:opacity-100 focus:opacity-100`,onClick:()=>e.onOpen(t),title:t.kind===`package`?`Open file map`:`Open symbol map`,"aria-label":`Open ${t.label} map`,children:(0,R.jsx)(f,{className:`h-3.5 w-3.5`})}),(0,R.jsx)(O,{type:`source`,position:m.Right,className:`!h-2.5 !w-2.5 !border-2 !border-card !bg-muted-foreground`})]})}function ze(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Be(e,t){return e.graphNode===t.graphNode&&e.selected===t.selected&&e.dimmed===t.dimmed&&e.incoming===t.incoming&&e.outgoing===t.outgoing&&e.isActive===t.isActive&&e.activityType===t.activityType&&e.onSelect===t.onSelect&&e.onOpen===t.onOpen&&e.onShowHistory===t.onShowHistory&&ze(e.activeOperations,t.activeOperations)}var U={codemap:(0,A.memo)(H,(e,t)=>Be(e.data,t.data))},Ve={nodes:[],edges:[]};function He({loading:e,error:t,graph:n,canvasNodeCount:r,flowNodes:i,flowEdges:a,onNodesChange:o,onEdgesChange:s,agentTrailCount:l}){return(0,R.jsxs)(R.Fragment,{children:[e&&(0,R.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-background/75 backdrop-blur-sm`,children:[(0,R.jsx)(c,{className:`h-7 w-7 animate-spin text-primary`}),(0,R.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-widest text-muted-foreground`,children:`Mapping relationships`})]}),t&&!e&&(0,R.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,R.jsx)(u,{className:`h-10 w-10 text-destructive`}),(0,R.jsx)(`p`,{className:`font-mono text-sm text-destructive`,children:t}),(0,R.jsxs)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:[`The map needs a codebase index. Run`,` `,(0,R.jsx)(`code`,{className:`border bg-muted px-1.5 py-0.5`,children:`codebase-index`}),` once, then reopen this view.`]})]}),!e&&!t&&n.nodes.length===0&&(0,R.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-muted-foreground`,children:[(0,R.jsx)(u,{className:`h-8 w-8 opacity-40`}),(0,R.jsx)(`p`,{className:`text-xs`,children:`No indexed nodes at this level.`})]}),!e&&!t&&n.nodes.length>1&&n.edges.length===0&&(0,R.jsxs)(`div`,{className:`pointer-events-none absolute left-1/2 top-14 z-10 -translate-x-1/2 border border-warning/40 bg-warning/10 px-3 py-2 text-center shadow backdrop-blur`,children:[(0,R.jsx)(`div`,{className:`font-mono text-[9px] font-bold uppercase tracking-wider text-warning`,children:`No resolved relations in this scope`}),(0,R.jsx)(`div`,{className:`mt-0.5 text-[8px] text-muted-foreground`,children:`The upgraded index will rebuild and resolve call/import/type links automatically.`})]}),!t&&n.nodes.length>0&&(0,R.jsxs)(b,{nodes:i,edges:a,onNodesChange:o,onEdgesChange:s,nodeTypes:U,nodesConnectable:!1,nodesDraggable:!1,edgesFocusable:!1,elementsSelectable:!1,onlyRenderVisibleElements:!0,minZoom:.08,maxZoom:2.2,proOptions:{hideAttribution:!0},children:[(0,R.jsx)(oe,{variant:S.Dots,gap:r>60?32:22,size:1,color:`hsl(var(--muted-foreground))`,className:`!opacity-25`}),(0,R.jsx)(h,{position:`bottom-left`,showInteractive:!1,className:`!border !border-border !bg-card !shadow-md [&>button]:!border-border [&>button]:!bg-card [&>button]:!fill-foreground`}),r<=48&&(0,R.jsx)(v,{position:`bottom-right`,pannable:!0,zoomable:!0,className:`!h-[112px] !w-[180px] !border !border-border !bg-card !shadow-md`,maskColor:`hsl(var(--background) / 0.72)`,nodeColor:e=>{let t=e.data?.graphNode.kind;return t===`package`?`hsl(var(--primary))`:t===`file`?`hsl(var(--info))`:`hsl(var(--success))`}})]}),(0,R.jsxs)(`div`,{className:`pointer-events-none absolute bottom-3 left-1/2 z-10 flex -translate-x-1/2 items-center gap-3 border bg-card/90 px-3 py-1.5 font-mono text-[8px] text-muted-foreground shadow backdrop-blur`,children:[Object.entries(Ne).map(([e,t])=>(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`span`,{className:`h-0.5 w-3`,style:{backgroundColor:t}}),e.replace(`_`,` `)]},e)),(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-primary`,"data-testid":`agent-trail-count`,children:[(0,R.jsx)(`span`,{className:`w-4 border-t-2 border-dashed border-primary`}),`agent trail`,l>0?` ×${l}`:``]})]})]})}function Ue({layout:e,canvasMode:t,edgeFilter:r,canvasNodeCount:i,graphNodeCount:a,onLayoutChange:o,onCanvasModeChange:s,onEdgeFilterChange:c}){return(0,R.jsxs)(`div`,{className:`pointer-events-none absolute left-3 right-3 top-3 z-10 flex items-center gap-2`,children:[(0,R.jsxs)(`div`,{className:`pointer-events-auto flex border bg-card/95 shadow-md backdrop-blur`,children:[(0,R.jsxs)(`button`,{type:`button`,className:k(`flex h-8 items-center gap-1.5 border-r px-2.5 text-[9px] font-semibold uppercase tracking-wider`,e===`layers`?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted`),onClick:()=>o(`layers`),children:[(0,R.jsx)(C,{className:`h-3 w-3`}),` Layers`]}),(0,R.jsxs)(`button`,{type:`button`,className:k(`flex h-8 items-center gap-1.5 px-2.5 text-[9px] font-semibold uppercase tracking-wider`,e===`orbit`?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted`),onClick:()=>o(`orbit`),children:[(0,R.jsx)(n,{className:`h-3 w-3`}),` Relations`]})]}),(0,R.jsxs)(`div`,{className:`pointer-events-auto flex border bg-card/95 shadow-md backdrop-blur`,children:[(0,R.jsxs)(`button`,{type:`button`,className:k(`h-8 border-r px-2.5 font-mono text-[9px] font-bold`,t===`smart`?`bg-success text-success-foreground`:`text-muted-foreground hover:bg-muted`),onClick:()=>s(`smart`),title:`Keep the full tree, show the strongest relations and selected neighbourhood`,children:[`SMART `,i,`/`,a]}),(0,R.jsx)(`button`,{type:`button`,className:k(`h-8 px-2.5 font-mono text-[9px] font-bold`,t===`all`?`bg-foreground text-background`:`text-muted-foreground hover:bg-muted`),onClick:()=>s(`all`),title:`Render every node and relation in this scope`,children:`ALL`})]}),(0,R.jsx)(`div`,{className:`pointer-events-auto ml-auto flex max-w-[60%] overflow-x-auto border bg-card/95 shadow-md backdrop-blur`,children:[`all`,`import`,`call`,`type_ref`,`inherit`,`implement`].map(e=>(0,R.jsx)(`button`,{type:`button`,className:k(`h-8 whitespace-nowrap border-r px-2.5 font-mono text-[9px] last:border-r-0`,r===e?`bg-foreground text-background`:`text-muted-foreground hover:bg-muted`),onClick:()=>c(e),children:e===`all`?`ALL LINKS`:e.replace(`_`,` `).toUpperCase()},e))})]})}function We({scope:e,graph:t,agentPresences:n,edgeWeight:r,connectedNodeCount:i,navigate:a}){return(0,R.jsxs)(`header`,{className:`flex h-[62px] shrink-0 items-center gap-4 border-b bg-card px-4`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-[220px] items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center border border-primary bg-primary/10 text-primary`,children:(0,R.jsx)(u,{className:`h-4 w-4`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`font-display text-sm font-semibold tracking-tight`,children:`Code Atlas`}),(0,R.jsx)(`p`,{className:`text-[9px] uppercase tracking-[0.18em] text-muted-foreground`,children:`Architecture intelligence`})]})]}),(0,R.jsxs)(`nav`,{className:`flex min-w-0 flex-1 items-center gap-1 font-mono text-[10px]`,"aria-label":`Code map breadcrumb`,children:[e.level!==`packages`&&(0,R.jsx)(`button`,{type:`button`,className:`mr-1 flex h-7 w-7 items-center justify-center border text-muted-foreground hover:bg-muted`,onClick:()=>{e.level===`symbols`?a({level:`files`,package:e.package??`(root)`}):a({level:`packages`})},"aria-label":`Back`,children:(0,R.jsx)(ie,{className:`h-3.5 w-3.5`})}),(0,R.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1.5 px-1.5 py-1 text-muted-foreground hover:text-foreground`,onClick:()=>a({level:`packages`}),children:[(0,R.jsx)(x,{className:`h-3 w-3`}),` workspace`]}),e.level!==`packages`&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(o,{className:`h-3 w-3 text-muted-foreground`}),(0,R.jsx)(`button`,{type:`button`,className:`max-w-[220px] truncate px-1.5 py-1 hover:text-primary`,onClick:()=>a({level:`files`,package:e.package??`(root)`}),children:e.package??`(root)`})]}),e.level===`symbols`&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(o,{className:`h-3 w-3 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`truncate px-1.5 py-1 text-primary`,children:I({id:``,label:e.file,kind:`file`,file:e.file,package:e.package})})]})]}),(0,R.jsxs)(`div`,{className:`hidden items-center gap-5 xl:flex`,children:[(0,R.jsxs)(`div`,{className:k(`flex h-8 items-center gap-2 border px-2.5`,n.length>0?`border-success/50 bg-success/10 text-success`:`text-muted-foreground`),children:[(0,R.jsx)(w,{className:k(`h-3 w-3`,n.length>0&&`animate-pulse`)}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`font-mono text-[10px] font-bold`,children:[n.length,` LIVE`]}),(0,R.jsx)(`div`,{className:`text-[7px] uppercase tracking-wider`,children:`agents`})]})]}),(0,R.jsxs)(`div`,{className:`text-right`,children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-semibold`,children:t.nodes.length}),(0,R.jsx)(`div`,{className:`text-[8px] uppercase tracking-wider text-muted-foreground`,children:`nodes`})]}),(0,R.jsxs)(`div`,{className:`text-right`,children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-semibold`,children:t.edges.length}),(0,R.jsx)(`div`,{className:`text-[8px] uppercase tracking-wider text-muted-foreground`,children:`links`})]}),(0,R.jsxs)(`div`,{className:`text-right`,children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-semibold`,children:r}),(0,R.jsx)(`div`,{className:`text-[8px] uppercase tracking-wider text-muted-foreground`,children:`references`})]}),(0,R.jsxs)(`div`,{className:`text-right`,children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-semibold`,children:i}),(0,R.jsx)(`div`,{className:`text-[8px] uppercase tracking-wider text-muted-foreground`,children:`connected`})]})]})]})}function Ge({activity:e}){return(0,R.jsx)(`span`,{className:k(`shrink-0 border px-1.5 py-0.5 font-mono text-[8px] font-bold uppercase`,e.type===`delete`?`border-destructive/50 bg-destructive/10 text-destructive`:e.type===`read`?`border-info/50 bg-info/10 text-info`:e.type===`search`||e.type===`index`?`border-primary/50 bg-primary/10 text-primary`:`border-warning/50 bg-warning/10 text-warning`),children:e.filePath.startsWith(`(tool:`)?e.toolName:e.type})}function W({activity:e,onLocate:t,showAgent:n=!1}){let r=e.agentName??e.agent??`External process`,i=`${e.sessionId??`none`}:${e.agentId??r}`;return(0,R.jsxs)(`button`,{type:`button`,className:`group flex w-full items-start gap-2 border-b px-3 py-2 text-left last:border-b-0 hover:bg-muted/70`,onClick:()=>!e.filePath.startsWith(`(`)&&t(e),title:`Locate ${e.filePath}`,children:[n&&(0,R.jsx)(`span`,{className:k(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center font-mono text-[8px] font-black`,Le(i)),children:Ie(r)}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(Ge,{activity:e}),n&&(0,R.jsx)(`span`,{className:`truncate text-[9px] font-semibold`,children:r}),e.status===`active`&&(0,R.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 font-mono text-[8px] font-bold text-success`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse bg-success`}),` LIVE`]}),e.watcherConfirmed&&(0,R.jsx)(d,{className:`ml-auto h-3 w-3 text-success`,"aria-label":`Filesystem confirmed`}),e.attribution===`correlated`&&!e.watcherConfirmed&&(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[7px] uppercase text-warning`,title:`Correlated from the only active tool`,children:`~ correlated`}),e.attribution===`external`&&(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[7px] uppercase text-destructive`,children:`external`})]}),(0,R.jsx)(`div`,{className:`mt-1 truncate font-mono text-[9px] font-semibold`,title:e.filePath,children:B(e.filePath)}),(e.symbol||e.line)&&(0,R.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1 truncate font-mono text-[8px] text-success`,children:[(0,R.jsx)(a,{className:`h-2.5 w-2.5 shrink-0`}),e.symbol?.name??`line ${e.line}`,e.symbol?.kind&&(0,R.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,e.symbol.kind]})]}),e.change&&(0,R.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 font-mono text-[8px]`,children:[(0,R.jsxs)(`span`,{className:`border border-success/40 bg-success/10 px-1 text-success`,children:[`+`,e.change.added]}),(0,R.jsxs)(`span`,{className:`border border-destructive/40 bg-destructive/10 px-1 text-destructive`,children:[`−`,e.change.removed]}),e.durationMs!==void 0&&(0,R.jsxs)(`span`,{className:`ml-auto text-muted-foreground`,children:[e.durationMs,`ms`]})]}),e.summary&&e.summary!==e.toolName&&(0,R.jsx)(`div`,{className:`mt-1 line-clamp-2 text-[8px] leading-3 text-muted-foreground`,children:e.summary})]}),!e.filePath.startsWith(`(`)&&(0,R.jsx)(f,{className:`mt-1 h-3 w-3 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100`})]})}function Ke({presences:e,onLocate:t}){return e.length===0?null:(0,R.jsxs)(`section`,{className:`pointer-events-auto absolute left-3 top-14 z-20 w-[304px] border bg-card/95 shadow-xl backdrop-blur`,children:[(0,R.jsxs)(`div`,{className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,R.jsx)(w,{className:`h-3.5 w-3.5 animate-pulse text-success`}),(0,R.jsx)(`h2`,{className:`text-[9px] font-black uppercase tracking-[0.18em]`,children:`Live agent operations`}),(0,R.jsxs)(`span`,{className:`ml-auto bg-success px-1.5 py-0.5 font-mono text-[8px] font-bold text-success-foreground`,children:[e.length,` ONLINE`]})]}),(0,R.jsx)(`div`,{className:`max-h-[330px] overflow-y-auto`,children:e.map(e=>(0,R.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 bg-muted/35 px-3 py-1.5`,children:[(0,R.jsx)(`span`,{className:k(`flex h-6 w-6 items-center justify-center font-mono text-[8px] font-black`,Le(e.key)),children:Ie(e.agentName)}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`truncate text-[9px] font-bold`,children:e.agentName}),(0,R.jsxs)(`div`,{className:`truncate font-mono text-[7px] text-muted-foreground`,children:[`session `,e.sessionId.slice(0,12),` · agent `,e.agentId.slice(0,12)]})]}),(0,R.jsxs)(`span`,{className:`font-mono text-[8px] text-success`,children:[e.operations.length,` op`]})]}),e.operations.map(e=>(0,R.jsx)(W,{activity:e,onLocate:t},e.id??`${e.toolUseId}:${e.filePath}`))]},e.key))})]})}function qe({paused:e,followLive:t,agentFilter:n,agents:r,onTogglePaused:i,onToggleFollow:o,onAgentFilter:s}){return(0,R.jsxs)(`div`,{className:`pointer-events-auto absolute right-3 top-14 z-20 flex h-9 items-center border bg-card/95 shadow-lg backdrop-blur`,children:[(0,R.jsxs)(`button`,{type:`button`,className:k(`flex h-full items-center gap-1.5 border-r px-2.5 text-[8px] font-bold uppercase tracking-wider`,t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted`),onClick:o,title:`Automatically enter the file/function used by the newest visible agent`,children:[(0,R.jsx)(a,{className:`h-3 w-3`}),` Follow`]}),(0,R.jsxs)(`button`,{type:`button`,className:k(`flex h-full items-center gap-1.5 border-r px-2.5 text-[8px] font-bold uppercase tracking-wider`,e?`bg-warning text-warning-foreground`:`text-success hover:bg-success/10`),onClick:i,title:e?`Resume the live telemetry stream`:`Freeze the current telemetry frame`,children:[e?(0,R.jsx)(T,{className:`h-3 w-3`}):(0,R.jsx)(ue,{className:`h-3 w-3`}),e?`Resume`:`Live`]}),(0,R.jsxs)(`label`,{className:`flex h-full items-center gap-1.5 px-2 text-[8px] uppercase text-muted-foreground`,children:[`Agent`,(0,R.jsxs)(`select`,{"aria-label":`Filter CodeMap by agent and session`,className:`h-6 max-w-[170px] border bg-background px-1.5 font-mono text-[8px] text-foreground outline-none focus:border-primary`,value:n,onChange:e=>s(e.target.value),children:[(0,R.jsx)(`option`,{value:`all`,children:`ALL AGENTS`}),r.map(e=>(0,R.jsxs)(`option`,{value:e.key,children:[e.agentName,` · `,e.sessionId.slice(0,10)]},e.key))]})]})]})}function Je({activeOperations:e,recentActivities:t,activityTotalCount:n,onLocate:r}){return(0,R.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[e.length>0&&(0,R.jsxs)(`section`,{className:`border-b`,children:[(0,R.jsxs)(`div`,{className:`flex h-9 items-center gap-2 border-b bg-success/5 px-3`,children:[(0,R.jsx)(w,{className:`h-3 w-3 animate-pulse text-success`}),(0,R.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em]`,children:`Active now`}),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[9px] text-success`,children:e.length})]}),e.map(e=>(0,R.jsx)(W,{activity:e,onLocate:r,showAgent:!0},e.id??`${e.toolUseId}:${e.filePath}`))]}),(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,R.jsx)(E,{className:`h-3 w-3 text-muted-foreground`}),(0,R.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em]`,children:`Event stream`}),(0,R.jsxs)(`span`,{className:`ml-auto font-mono text-[8px] text-muted-foreground`,children:[n,` total`]})]}),t.length>0?t.map((e,t)=>(0,R.jsx)(W,{activity:e,onLocate:r,showAgent:!0},e.id??`${e.timestamp}:${t}`)):(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center px-7 py-16 text-center`,children:[(0,R.jsx)(`span`,{className:`mb-4 flex h-12 w-12 items-center justify-center border bg-muted text-muted-foreground`,children:(0,R.jsx)(_,{className:`h-5 w-5`})}),(0,R.jsx)(`h3`,{className:`text-xs font-semibold`,children:`Select a node or wait for an agent`}),(0,R.jsx)(`p`,{className:`mt-2 text-[10px] leading-relaxed text-muted-foreground`,children:`Relations appear on selection. Tool calls and external filesystem touches stream here live.`})]})]})]})}function Ye({node:e,incomingCount:t,outgoingCount:n,onOpenNode:r,onOpenActivity:i}){let a=z[e.kind].icon;return(0,R.jsxs)(`div`,{className:`border-b bg-muted/25 p-3`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:k(`flex h-8 w-8 items-center justify-center border`,z[e.kind].iconStyle),children:(0,R.jsx)(a,{className:`h-4 w-4`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`text-[8px] font-bold uppercase tracking-[0.18em] text-muted-foreground`,children:[e.external?`external `:``,e.kind]}),(0,R.jsx)(`div`,{className:`truncate font-mono text-xs font-semibold`,title:e.label,children:e.label})]})]}),(0,R.jsx)(`div`,{className:`break-all font-mono text-[9px] leading-relaxed text-muted-foreground`,children:e.file?I(e):e.package}),e.signature&&(0,R.jsx)(`pre`,{className:`mt-3 overflow-x-auto border bg-background p-2 font-mono text-[9px] leading-relaxed text-foreground`,children:e.signature}),(0,R.jsxs)(`div`,{className:`mt-3 grid grid-cols-3 border`,children:[(0,R.jsx)(Xe,{value:t,label:`incoming`,className:`border-r text-info`}),(0,R.jsx)(Xe,{value:n,label:`outgoing`,className:`border-r text-primary`}),(0,R.jsx)(Xe,{value:e.symbolCount??e.fileCount??e.line??`—`,label:e.kind===`package`?`files`:e.kind===`file`?`symbols`:`line`})]}),(0,R.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[e.kind!==`symbol`&&(0,R.jsxs)(`button`,{type:`button`,className:`flex h-7 flex-1 items-center justify-center gap-1.5 border bg-foreground text-[9px] font-semibold uppercase tracking-wider text-background hover:opacity-90`,onClick:()=>r(e),children:[(0,R.jsx)(f,{className:`h-3 w-3`}),` Open `,e.kind===`package`?`files`:`symbols`]}),e.file&&(0,R.jsxs)(`button`,{type:`button`,className:`flex h-7 items-center justify-center gap-1.5 border px-2 text-[9px] uppercase text-muted-foreground hover:bg-muted`,onClick:()=>i(e.file),children:[(0,R.jsx)(E,{className:`h-3 w-3`}),` Activity`]})]})]})}function Xe({value:e,label:t,className:n}){return(0,R.jsxs)(`div`,{className:k(`p-2 text-center`,n),children:[(0,R.jsx)(`div`,{className:`font-mono text-sm font-semibold`,children:e}),(0,R.jsx)(`div`,{className:`text-[8px] uppercase text-muted-foreground`,children:t})]})}function Ze(e){let{title:t,subtitle:n,items:r,graph:i,selectedId:a,expanded:s,onToggle:c,onSelect:u}=e;return(0,R.jsxs)(`section`,{className:`border-b py-3`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-end justify-between px-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.16em]`,children:t}),(0,R.jsx)(`p`,{className:`mt-0.5 text-[9px] text-muted-foreground`,children:n})]}),(0,R.jsx)(`span`,{className:`border bg-muted px-1.5 py-0.5 font-mono text-[9px]`,children:r.length})]}),r.length===0?(0,R.jsx)(`p`,{className:`px-3 py-2 text-[10px] text-muted-foreground`,children:`No relationships in this view.`}):r.map(e=>{let n=`${t}:${e.node.id}`,r=s.has(n),d=[...ge(i,e.node.id,`incoming`),...ge(i,e.node.id,`outgoing`)].filter((e,t,n)=>e.node.id!==a&&n.findIndex(t=>t.node.id===e.node.id)===t).slice(0,8);return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`group flex min-h-9 items-center gap-1 px-2 hover:bg-muted/70`,children:[(0,R.jsx)(`button`,{type:`button`,className:`flex h-6 w-5 shrink-0 items-center justify-center text-muted-foreground`,onClick:()=>d.length>0&&c(n),"aria-label":`${r?`Collapse`:`Expand`} relation ${e.node.label}`,children:d.length>0?r?(0,R.jsx)(l,{className:`h-3 w-3`}):(0,R.jsx)(o,{className:`h-3 w-3`}):(0,R.jsx)(`span`,{className:`h-px w-2 bg-border`})}),(0,R.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 py-1 text-left`,onClick:()=>u(e.node),children:[(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] font-semibold`,title:e.node.label,children:e.node.label}),(0,R.jsx)(`span`,{className:`block truncate text-[9px] text-muted-foreground`,children:e.node.package??e.node.symbolKind??e.node.kind})]}),(0,R.jsx)(`span`,{className:`border px-1 py-0.5 font-mono text-[8px] text-muted-foreground`,children:e.edge.refType}),(0,R.jsxs)(`span`,{className:`w-5 text-right font-mono text-[9px] text-muted-foreground`,children:[`×`,e.edge.weight]})]}),r&&d.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:`relative flex h-7 w-full items-center gap-2 border-l border-border pl-11 pr-3 text-left text-[9px] text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:()=>u(e.node),children:[(0,R.jsx)(`span`,{className:`absolute left-7 top-1/2 h-px w-3 bg-border`}),(0,R.jsx)(_,{className:`h-3 w-3 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate font-mono`,children:e.node.label}),(0,R.jsx)(`span`,{className:`ml-auto font-mono opacity-70`,children:e.edge.refType})]},`${n}:${e.node.id}`))]},n)})]})}function Qe({selectedNode:e,incoming:t,outgoing:n,filteredGraph:r,expandedRelations:i,activeOperations:a,recentActivities:o,activityTotalCount:s,selectedActivities:c,onClearSelection:l,onOpenNode:u,onOpenActivity:d,onLocateActivity:f,onToggleRelation:p,onSelectNode:m}){return(0,R.jsxs)(`aside`,{className:`flex w-[326px] shrink-0 flex-col border-l bg-card/80`,children:[(0,R.jsxs)(`div`,{className:`flex h-10 items-center justify-between border-b px-3`,children:[(0,R.jsx)(`h2`,{className:`text-[10px] font-bold uppercase tracking-[0.18em]`,children:`Relation inspector`}),e&&(0,R.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground`,onClick:l,"aria-label":`Clear selection`,children:(0,R.jsx)(g,{className:`h-3.5 w-3.5`})})]}),e?(0,R.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,R.jsx)(Ye,{node:e,incomingCount:t.length,outgoingCount:n.length,onOpenNode:u,onOpenActivity:d}),c.length>0&&(0,R.jsxs)(`section`,{className:`border-b bg-success/5 py-2`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 px-3`,children:[(0,R.jsx)(w,{className:`h-3 w-3 animate-pulse text-success`}),(0,R.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em]`,children:`Agents on this node`}),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[9px] text-success`,children:c.length})]}),c.map(e=>(0,R.jsx)(W,{activity:e,onLocate:f,showAgent:!0},e.id??`${e.toolUseId}:${e.filePath}`))]}),(0,R.jsx)(Ze,{title:`Incoming`,subtitle:`Who depends on this`,items:t,graph:r,selectedId:e.id,expanded:i,onToggle:p,onSelect:m}),(0,R.jsx)(Ze,{title:`Outgoing`,subtitle:`What this depends on`,items:n,graph:r,selectedId:e.id,expanded:i,onToggle:p,onSelect:m})]}):(0,R.jsx)(Je,{activeOperations:a,recentActivities:o,activityTotalCount:s,onLocate:f})]})}function $e({node:e,onSelect:t,virtual:n}){let r=z[e.kind].icon;return(0,R.jsxs)(`button`,{type:`button`,"data-index":n?.index,ref:n?e=>n.measureElement(e):void 0,className:k(`min-h-8 items-center gap-2 px-3 py-1 text-left hover:bg-muted`,n?`absolute left-0 flex w-full`:`flex w-full`),style:n?{transform:`translateY(${n.start}px)`}:void 0,onClick:()=>t(e),children:[(0,R.jsx)(r,{className:k(`h-3.5 w-3.5 shrink-0`,e.kind===`package`?`text-primary`:e.kind===`file`?`text-info`:`text-success`)}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px]`,children:e.label}),(0,R.jsx)(`span`,{className:`block truncate text-[8px] text-muted-foreground`,children:e.file??e.package??e.symbolKind})]}),(0,R.jsx)(`span`,{className:`text-[8px] uppercase text-muted-foreground`,children:e.kind.slice(0,3)})]},e.id)}var et=80,G=40;function tt(e,t){if(!e||t.size===0)return!1;let n=M(e);if(t.has(n))return!0;for(let e of t)if(e.endsWith(`/${n}`)||n.endsWith(`/${e}`))return!0;return!1}var K=(0,A.memo)(function e(n){let{directory:i,packageName:a,depth:u,expandedDirectories:d,expandedFiles:p,loadingBranches:m,graphForFile:h,onToggleDirectory:g,onToggleFile:_,onSelectFile:v,onOpenFile:y,onSelectSymbol:b,selectedId:x,activeFileNorms:ee,activeSymbolIds:te,revealAllKeys:S,onRevealAll:C}=n,ne=`files:${a}:${i.path||`.`}`,T=S.has(ne)?i.files:i.files.slice(0,et),re=i.files.length-T.length;return(0,R.jsxs)(R.Fragment,{children:[i.directories.map(i=>{let s=`${a}:${i.path}`,c=d.has(s);return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`button`,{type:`button`,className:`flex h-7 w-full items-center gap-1.5 pr-2 text-left text-[11px] text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:8+u*12},onClick:()=>g(s),children:[c?(0,R.jsx)(l,{className:`h-3 w-3`}):(0,R.jsx)(o,{className:`h-3 w-3`}),c?(0,R.jsx)(t,{className:`h-3.5 w-3.5 text-warning`}):(0,R.jsx)(r,{className:`h-3.5 w-3.5 text-warning`}),(0,R.jsx)(`span`,{className:`truncate`,children:i.name})]}),c&&(0,R.jsx)(e,{...n,directory:i,depth:u+1})]},s)}),T.map(e=>{let t=p.has(e.file??e.id),n=N({level:`symbols`,file:e.file??e.label}),r=(e.file?h(e.file):void 0)?.nodes.filter(t=>t.kind===`symbol`&&t.file===e.file&&!t.external)??[],i=`symbols:${e.file??e.id}`,a=S.has(i)?r:r.slice(0,G),d=r.length-a.length,g=tt(e.file,ee);return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:k(`group flex h-7 items-center pr-1 text-[11px] hover:bg-muted`,x===e.id&&`bg-primary/10 text-primary`),style:{paddingLeft:8+u*12},children:[(0,R.jsx)(`button`,{type:`button`,className:`flex h-6 w-4 shrink-0 items-center justify-center text-muted-foreground`,onClick:()=>_(e),"aria-label":`${t?`Collapse`:`Expand`} ${e.label}`,children:m.has(n)?(0,R.jsx)(c,{className:`h-3 w-3 animate-spin`}):t?(0,R.jsx)(l,{className:`h-3 w-3`}):(0,R.jsx)(o,{className:`h-3 w-3`})}),(0,R.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-1.5 text-left`,onClick:()=>v(e),onDoubleClick:()=>y(e),children:[(0,R.jsx)(s,{className:`h-3.5 w-3.5 shrink-0 text-info`}),g&&(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 animate-pulse bg-success`,title:`Live operation`}),(0,R.jsx)(`span`,{className:`truncate font-mono`,title:e.file,children:e.label}),(0,R.jsx)(`span`,{className:`ml-auto text-[9px] text-muted-foreground`,children:e.symbolCount??0})]}),(0,R.jsx)(`button`,{type:`button`,className:`ml-1 hidden h-5 w-5 items-center justify-center text-muted-foreground hover:text-foreground group-hover:flex`,onClick:()=>y(e),title:`Open symbol map`,"aria-label":`Open ${e.label} map`,children:(0,R.jsx)(f,{className:`h-3 w-3`})})]}),t&&a.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:k(`flex h-7 w-full items-center gap-1.5 pr-2 text-left text-[10px] hover:bg-muted`,x===e.id?`bg-primary/10 text-primary`:`text-muted-foreground`),style:{paddingLeft:38+u*12},onClick:()=>b(e),children:[(0,R.jsx)(D,{className:`h-3 w-3 shrink-0 text-success`}),te.has(e.id)&&(0,R.jsx)(w,{className:`h-3 w-3 shrink-0 animate-pulse text-success`}),(0,R.jsx)(`span`,{className:`truncate font-mono`,children:e.label}),e.line&&(0,R.jsxs)(`span`,{className:`ml-auto font-mono text-[8px] opacity-60`,children:[`:`,e.line]})]},e.id)),t&&d>0&&(0,R.jsxs)(`button`,{type:`button`,className:`flex h-7 w-full items-center text-left font-mono text-[9px] text-primary hover:bg-muted`,style:{paddingLeft:38+u*12},onClick:()=>C(i),children:[`Show `,d,` more symbols`]})]},e.id)}),re>0&&(0,R.jsxs)(`button`,{type:`button`,className:`flex h-7 w-full items-center text-left font-mono text-[9px] text-primary hover:bg-muted`,style:{paddingLeft:8+u*12},onClick:()=>C(ne),children:[`Show `,re,` more files`]})]})});function nt({rootGraph:e,search:t,searchInput:n,searchResults:r,virtualizeSearch:a,searchVirtualizer:s,treeScrollRef:u,selectedId:d,expandedPackages:m,expandedDirectories:h,expandedFiles:_,loadingBranches:v,activeFileNorms:y,activeSymbolIds:b,revealAllKeys:x,packageGraph:ee,graphForFile:te,navigate:S,togglePackage:C,toggleDirectory:w,toggleFile:ne,revealAllTree:T,selectFileFromTree:re,selectSymbolFromTree:ie,selectSearchResult:ae,handleOpenNode:E,onSearchInputChange:D,onSearchChange:oe}){return(0,R.jsxs)(`aside`,{className:`flex w-[286px] shrink-0 flex-col border-r bg-card/70`,children:[(0,R.jsxs)(`div`,{className:`border-b p-3`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,R.jsx)(`h2`,{className:`text-[10px] font-bold uppercase tracking-[0.18em]`,children:`Code tree`}),(0,R.jsxs)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:[e.nodes.length,` roots`]})]}),(0,R.jsxs)(`label`,{className:`flex h-8 items-center gap-2 border bg-background px-2 focus-within:border-primary`,children:[(0,R.jsx)(p,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,R.jsx)(`input`,{className:`min-w-0 flex-1 bg-transparent font-mono text-[10px] outline-none placeholder:text-muted-foreground`,value:n,onChange:e=>D(e.target.value),placeholder:`Find package, file, symbol…`}),n&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>{D(``),oe(``)},"aria-label":`Clear search`,children:(0,R.jsx)(g,{className:`h-3 w-3 text-muted-foreground`})})]})]}),(0,R.jsx)(`div`,{ref:u,className:`min-h-0 flex-1 overflow-y-auto py-2`,children:t.trim()?(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`px-3 pb-2 text-[9px] text-muted-foreground`,children:[r.length,` loaded-map results`]}),r.length===0?(0,R.jsxs)(`p`,{className:`px-3 py-8 text-center text-[10px] text-muted-foreground`,children:[`No match in loaded branches.`,(0,R.jsx)(`br`,{}),`Expand a package to search its files.`]}):a?(0,R.jsx)(`div`,{style:{height:`${s.getTotalSize()}px`,width:`100%`,position:`relative`},children:s.getVirtualItems().map(e=>{let t=r[e.index];return t?(0,R.jsx)($e,{node:t,onSelect:ae,virtual:{index:e.index,start:e.start,measureElement:s.measureElement}},t.id):null})}):r.map(e=>(0,R.jsx)($e,{node:e,onSelect:ae},e.id))]}):e.nodes.map(e=>{let t=e.package??e.label,n=m.has(t),r=N({level:`files`,package:t}),a=ee(t),s=a?Se(a.nodes):void 0;return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:k(`group flex h-8 items-center px-2 hover:bg-muted`,d===e.id&&`bg-primary/10 text-primary`),children:[(0,R.jsx)(`button`,{type:`button`,className:`flex h-6 w-5 items-center justify-center text-muted-foreground`,onClick:()=>C(e),"aria-label":`${n?`Collapse`:`Expand`} ${t}`,children:v.has(r)?(0,R.jsx)(c,{className:`h-3 w-3 animate-spin`}):n?(0,R.jsx)(l,{className:`h-3 w-3`}):(0,R.jsx)(o,{className:`h-3 w-3`})}),(0,R.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,onClick:()=>S({level:`packages`},e.id),onDoubleClick:()=>S({level:`files`,package:t}),children:[(0,R.jsx)(i,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,R.jsx)(`span`,{className:`truncate font-mono text-[10px] font-semibold`,children:e.label}),(0,R.jsx)(`span`,{className:`ml-auto text-[9px] text-muted-foreground`,children:e.fileCount??0})]}),(0,R.jsx)(`button`,{type:`button`,className:`ml-1 hidden h-5 w-5 items-center justify-center text-muted-foreground hover:text-foreground group-hover:flex`,onClick:()=>S({level:`files`,package:t}),title:`Open file map`,"aria-label":`Open ${t} map`,children:(0,R.jsx)(f,{className:`h-3 w-3`})})]}),n&&s&&(0,R.jsx)(K,{directory:s,packageName:t,depth:1,expandedDirectories:h,expandedFiles:_,loadingBranches:v,graphForFile:te,onToggleDirectory:w,onToggleFile:ne,onSelectFile:re,onOpenFile:E,onSelectSymbol:ie,selectedId:d,activeFileNorms:y,activeSymbolIds:b,revealAllKeys:x,onRevealAll:T})]},e.id)})}),(0,R.jsxs)(`div`,{className:`border-t px-3 py-2 text-[9px] leading-relaxed text-muted-foreground`,children:[`Click to focus · double-click to enter`,(0,R.jsx)(`br`,{}),`Branches stay open while the map changes`]})]})}function rt(e,t){let n=new Map(e.map(e=>[e.id,e])),r=e.length!==t.length,i=t.map((t,i)=>{let a=n.get(t.id);return a?a.type===t.type&&a.position.x===t.position.x&&a.position.y===t.position.y&&Be(a.data,t.data)?(e[i]!==a&&(r=!0),a):(r=!0,{...a,...t,measured:a.measured}):(r=!0,t)});return r?i:e}function it(e){return e.data?.renderKey}function at(e,t){let n=new Map(e.map(e=>[e.id,e])),r=e.length!==t.length,i=t.map((t,i)=>{let a=n.get(t.id);return a&&it(a)===it(t)?(e[i]!==a&&(r=!0),a):(r=!0,t)});return r?i:e}function q(){let[e,t]=(0,A.useState)({level:`packages`}),n=N(e),[r,i]=(0,A.useState)(Ve),[a,o]=(0,A.useState)(!0),[s,c]=(0,A.useState)(null),[l,u]=(0,A.useState)(null),[d,f]=(0,A.useState)(`layers`),[p,m]=(0,A.useState)(`smart`),[h,g]=(0,A.useState)(`all`),[_,v]=(0,A.useState)(``),[y,b]=(0,A.useState)(``),[x,S]=(0,A.useState)(new Set),[C,w]=(0,A.useState)(new Set),[T,ie]=(0,A.useState)(new Set),[E,D]=(0,A.useState)(new Set),[oe,O]=(0,A.useState)(new Set),[ce,le]=(0,A.useState)(new Set),[ue,k]=(0,A.useState)(0),[j,P]=(0,A.useState)(null),[ve,ye]=(0,A.useState)(!1),[F,I]=(0,A.useState)(`all`),[L,Oe]=(0,A.useState)(null),[z,Pe]=(0,A.useState)(null),[Fe,Le]=(0,A.useState)(0),B=(0,A.useRef)(new Map),V=(0,A.useRef)(null),H=(0,A.useRef)(null),ze=(0,A.useRef)(``),Be=(0,A.useRef)(``),U=(0,A.useRef)(null),Ge=(0,A.useRef)(new Set),{history:W,pulses:Je,activeOperationsMap:Ye,activityTotalCount:Xe,resolveActivitySymbol:Ze,getActivityForFile:$e,sweepActivity:et}=de(se(e=>({history:e.history,pulses:e.pulses,activeOperationsMap:e.activeOperations,activityTotalCount:e.totalCount,resolveActivitySymbol:e.resolveActivitySymbol,getActivityForFile:e.getActivityForFile,sweepActivity:e._sweep}))),G=(0,A.useMemo)(()=>[...Ye.values()].flat(),[Ye]),tt=(0,A.useMemo)(()=>[...Je.keys()].map(e=>W.get(e)?.[0]).filter(e=>!!e),[W,Je]),K=(0,A.useMemo)(()=>{let e=[];for(let t of W.values())e.push(...t.slice(0,16));return e.sort((e,t)=>t.timestamp-e.timestamp).slice(0,16)},[W]),it=(0,A.useMemo)(()=>fe([...G,...K]),[G,K]),q=(0,A.useMemo)(()=>{let e=L??G;return F===`all`?e:e.filter(e=>pe(e)===F)},[G,F,L]),ot=(0,A.useMemo)(()=>{let e=z??K;return F===`all`?e:e.filter(e=>pe(e)===F)},[F,z,K]),J=(0,A.useDeferredValue)(q),st=(0,A.useDeferredValue)(ot),ct=(0,A.useDeferredValue)(tt),lt=(0,A.useMemo)(()=>fe(q),[q]),[ut,dt,ft]=ne([]),[pt,mt,ht]=ae([]),{fitView:gt}=te(),Y=(0,A.useCallback)(async(e,t=!1)=>{let n=N(e),r=B.current.get(n);if(r&&!t)return we(B.current,n,r,48),r;let i=await fetch(he(e));if(!i.ok){let e=await i.json().catch(()=>({error:i.statusText}));throw Error(e.error??`HTTP ${i.status}`)}let a=await i.json();return we(B.current,n,a,48),k(e=>e+1),a},[]);(0,A.useEffect)(()=>{let e=window.setTimeout(()=>b(_),150);return()=>window.clearTimeout(e)},[_]);let _t=me(e=>e.generation),vt=(0,A.useRef)(0),yt=(0,A.useRef)(null);(0,A.useEffect)(()=>{let t=!1,n=_t>vt.current;return n&&(vt.current=_t,B.current.clear(),k(e=>e+1),S(new Set),w(new Set),ie(new Set),O(new Set)),o(!0),c(null),Y(e,n).then(e=>{if(!t){if(i(e),!n){let t=V.current;V.current=null,u(t&&e.nodes.some(e=>e.id===t)?t:null)}o(!1)}}).catch(e=>{t||(c(e instanceof Error?e.message:String(e)),i(Ve),o(!1))}),()=>{t=!0}},[n,Y,_t,e]);let X=(0,A.useCallback)((e,r)=>{if(V.current=r??null,N(e)===n){u(r??null),V.current=null;return}t(e)},[n]),bt=(0,A.useCallback)(async e=>{let t=N(e);if(!(B.current.has(t)||ce.has(t))){le(e=>new Set(e).add(t));try{await Y(e)}finally{le(e=>{let n=new Set(e);return n.delete(t),n})}}},[Y,ce]);(0,A.useEffect)(()=>{let e=!1,t=0;for(let n of G){if(t>=2)break;if(n.symbol||!n.toolUseId||n.filePath.startsWith(`(`))continue;let r=n.filePath;Ge.current.has(r)||(Ge.current.add(r),t+=1,Y({level:`symbols`,file:r}).then(t=>{if(e)return;let i=je(n,t.nodes);i&&Ze(n.toolUseId,r,{id:i.id,name:i.label,...i.symbolKind?{kind:i.symbolKind}:{},...i.line?{line:i.line}:{}})}).catch(()=>void 0).finally(()=>{Ge.current.delete(r)}))}return()=>{e=!0}},[G,Y,Ze]);let Z=(0,A.useMemo)(()=>({nodes:r.nodes,edges:h===`all`?r.edges:r.edges.filter(e=>e.refType===h)}),[r,h]),Q=r.nodes.find(e=>e.id===l),$=(0,A.useMemo)(()=>xe(Z,l,p),[p,Z,l]),xt=(0,A.useMemo)(()=>l?_e(Z,l):new Set,[Z,l]),{incomingCounts:St,outgoingCounts:Ct}=(0,A.useMemo)(()=>{let e=new Map,t=new Map;for(let n of Z.edges)t.set(n.source,(t.get(n.source)??0)+1),e.set(n.target,(e.get(n.target)??0)+1);return{incomingCounts:e,outgoingCounts:t}},[Z]),wt=d===`orbit`?l??void 0:void 0,Tt=(0,A.useMemo)(()=>be($,d,wt),[$,d,wt]),Et=(0,A.useMemo)(()=>[n,d,d===`orbit`?l??``:``,Ce($)].join(``),[$,n,d,l]),Dt=(0,A.useCallback)(e=>{u(e.id),D(new Set)},[]),Ot=(0,A.useCallback)(e=>{e.kind===`package`&&X({level:`files`,package:e.package??e.label}),e.kind===`file`&&e.file&&X({level:`symbols`,file:e.file,package:e.package})},[X]),kt=(0,A.useMemo)(()=>[Ae(J),Ae(ct),Ae(st)].join(``),[J,ct,st]),At=(0,A.useMemo)(()=>{let e=new Set;for(let t of q)e.add(M(t.filePath));return e},[q]),jt=(0,A.useMemo)(()=>{let e=new Set;for(let t of q)t.symbol?.id&&e.add(t.symbol.id);return e},[q]);(0,A.useEffect)(()=>{let e=()=>{let e=Tt.map(({node:e})=>e),t=ke(e,J),n=ke(e,ct),r=new Set(t.keys()),i=Tt.map(({node:e,position:r})=>{let i=t.get(e.id)??[],a=i[0]??n.get(e.id)?.[0];return{id:e.id,type:`codemap`,position:r,data:{graphNode:e,selected:e.id===l,dimmed:!!l&&!xt.has(e.id),incoming:St.get(e.id)??0,outgoing:Ct.get(e.id)??0,isActive:!!a,...a?{activityType:a.type}:{},activeOperations:i,onSelect:Dt,onOpen:Ot,onShowHistory:P}}});dt(e=>rt(e,i));let a=6,o=$.edges.map((e,t)=>{let n=!!l&&(e.source===l||e.target===l),i=r.has(e.source)||r.has(e.target),o=i&&(n||a>0);o&&--a;let s=Ne[e.refType]??`hsl(var(--muted-foreground))`,c=n||i?`smoothstep`:`default`;return{id:`edge:${e.source}:${e.target}:${t}`,source:e.source,target:e.target,type:c,animated:o,label:n?`${e.refType}${e.weight>1?` ×${e.weight}`:``}`:void 0,markerEnd:{type:ee.ArrowClosed,color:s,width:14,height:14},style:{stroke:s,strokeWidth:i?Math.min(2.5+Math.log2(e.weight+1)*.65,5):n?Math.min(1.25+Math.log2(e.weight+1)*.65,4):1,opacity:i?1:l?n?.88:.08:.52},labelStyle:{fontSize:9,fontFamily:`var(--font-mono)`,fill:`hsl(var(--muted-foreground))`},labelBgStyle:{fill:`hsl(var(--card))`,fillOpacity:.92},labelBgPadding:[4,2],zIndex:i?4:n?2:0,data:{renderKey:`${e.refType}:${e.weight}:${l?n?`focused`:`dimmed`:`idle`}:${i?`live`:`still`}:${o?`anim`:`still`}:${c}`}}}),s=new Map,c=new Set(J.map(pe));for(let e of[...st].sort((e,t)=>e.timestamp-t.timestamp)){let t=pe(e),n=s.get(t);n?n.push(e):s.set(t,[e])}let u=[...s.entries()].map(([e,t])=>({agentKey:e,activities:t,live:c.has(e),latest:t[t.length-1]?.timestamp??0})).sort((e,t)=>Number(t.live)-Number(e.live)||t.latest-e.latest).slice(0,4),d=[];for(let{agentKey:e,activities:t,live:n}of u){let r=t.slice(-7).map(e=>({activity:e,node:$.nodes.find(t=>De(e,t))})).filter(e=>!!e.node).filter((e,t,n)=>t===0||e.node.id!==n[t-1]?.node.id),i=Re(e);for(let t=1;t<r.length;t++){let o=r[t-1],s=r[t],c=n&&a>0;c&&--a,d.push({id:`trail:${e}:${o.activity.timestamp}:${s.activity.timestamp}`,source:o.node.id,target:s.node.id,type:`smoothstep`,animated:c,label:t===r.length-1?`${Ie(s.activity.agentName??s.activity.agent??`agent`)} TRAIL`:void 0,markerEnd:{type:ee.ArrowClosed,color:i,width:13,height:13},style:{stroke:i,strokeWidth:2.5,strokeDasharray:`7 5`,opacity:.9},labelStyle:{fontSize:8,fontWeight:700,fill:i},labelBgStyle:{fill:`hsl(var(--card))`,fillOpacity:.94},labelBgPadding:[4,2],zIndex:6,data:{renderKey:`${i}:${t===r.length-1?`label`:`plain`}:${n?`live`:`still`}:${c?`anim`:`still`}`}})}}Le(d.length),mt(e=>at(e,[...o,...d]))},t=Et,n=Be.current!==t;Be.current=t,U.current!==null&&(window.clearTimeout(U.current),U.current=null),n?e():U.current=window.setTimeout(()=>{U.current=null,e()},120);let r;return ze.current!==Et&&(r=window.setTimeout(()=>{ze.current=Et;let e=$.nodes.length>48?0:240;gt({padding:.2,duration:e,maxZoom:1.25})},20)),()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null),r!==void 0&&window.clearTimeout(r)}},[kt,$,l,J,st,ct,Et,xt,gt,Ot,Dt,St,Ct,Tt,mt,dt]),(0,A.useEffect)(()=>{let e=window.setInterval(()=>{et()},2e3);return()=>window.clearInterval(e)},[et]);let Mt=B.current.get(`packages`)??(e.level===`packages`?r:Ve),Nt=(0,A.useCallback)(e=>B.current.get(N({level:`files`,package:e})),[ue]),Pt=(0,A.useCallback)(e=>B.current.get(N({level:`symbols`,file:e})),[ue]),Ft=(0,A.useCallback)(e=>{let t=e.filePath,n=Ee(e.filePath),r=`file:${e.filePath}`;for(let i of B.current.values()){let a=i.nodes.find(t=>t.kind===`file`&&!t.external&&Te(t.file,e.filePath));if(a){t=a.file??t,n=a.package??n,r=a.id;break}}if(e.symbol){X({level:`symbols`,file:t,package:n},e.symbol.id);return}X({level:`files`,package:n},r)},[X]);(0,A.useEffect)(()=>{if(!ve||L)return;let e=[...q].filter(e=>!e.filePath.startsWith(`(`)).sort((e,t)=>t.timestamp-e.timestamp)[0];if(!e)return;let t=`${e.id??e.toolUseId}:${e.filePath}:${e.symbol?.id??`file`}`;H.current!==t&&(H.current=t,Ft(e))},[q,ve,Ft,L]);let It=(0,A.useCallback)(()=>{if(L){Oe(null),Pe(null);return}Oe([...G]),Pe([...K])},[G,L,K]),Lt=(0,A.useCallback)(e=>{let t=e.package??e.label,n=!x.has(t);S(e=>{let r=new Set(e);return n?r.add(t):r.delete(t),r}),n&&bt({level:`files`,package:t}).then(()=>{let e=B.current.get(N({level:`files`,package:t})),n=e?Se(e.nodes):void 0;n?.directories.length===1&&n.directories[0]&&w(e=>new Set(e).add(`${t}:${n.directories[0].path}`))}).catch(()=>void 0)},[bt,x]),Rt=(0,A.useCallback)(e=>{if(!e.file)return;let t=!T.has(e.file);ie(n=>{let r=new Set(n);return t?r.add(e.file):r.delete(e.file),r}),t&&bt({level:`symbols`,file:e.file,package:e.package}).catch(()=>void 0)},[bt,T]),zt=(0,A.useCallback)(e=>{w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Bt=(0,A.useCallback)(e=>{O(t=>new Set(t).add(e))},[]),Vt=(0,A.useCallback)(e=>{X({level:`files`,package:e.package??`(root)`},e.id)},[X]),Ht=(0,A.useCallback)(e=>{e.file&&X({level:`symbols`,file:e.file,package:e.package},e.id)},[X]),Ut=(0,A.useMemo)(()=>{let e=y.trim().toLocaleLowerCase();if(!e)return[];let t=new Map;for(let n of B.current.values())for(let r of n.nodes)`${r.label} ${r.file??``} ${r.signature??``} ${r.package??``}`.toLocaleLowerCase().includes(e)&&t.set(r.id,r);return[...t.values()].sort((e,t)=>e.kind.localeCompare(t.kind)||e.label.localeCompare(t.label)).slice(0,80)},[y,ue]),Wt=Ut.length>40,Gt=re({count:Ut.length,getScrollElement:()=>yt.current,estimateSize:()=>40,overscan:8,enabled:Wt}),Kt=(0,A.useCallback)(e=>{e.kind===`package`?X({level:`packages`},e.id):e.kind===`file`?X({level:`files`,package:e.package??`(root)`},e.id):e.file&&X({level:`symbols`,file:e.file,package:e.package},e.id)},[X]),{incoming:qt,outgoing:Jt}=(0,A.useMemo)(()=>({incoming:Q?ge(Z,Q.id,`incoming`):[],outgoing:Q?ge(Z,Q.id,`outgoing`):[]}),[Z,Q]),{edgeWeight:Yt,connectedNodeCount:Xt}=(0,A.useMemo)(()=>{let e=0,t=new Set;for(let n of Z.edges)e+=n.weight,t.add(n.source),t.add(n.target);return{edgeWeight:e,connectedNodeCount:t.size}},[Z]),Zt=Q?q.filter(e=>De(e,Q)):[],Qt=j?$e(j):[];return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,R.jsx)(We,{scope:e,graph:r,agentPresences:lt,edgeWeight:Yt,connectedNodeCount:Xt,navigate:X}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,R.jsx)(nt,{rootGraph:Mt,search:y,searchInput:_,searchResults:Ut,virtualizeSearch:Wt,searchVirtualizer:Gt,treeScrollRef:yt,selectedId:l,expandedPackages:x,expandedDirectories:C,expandedFiles:T,loadingBranches:ce,activeFileNorms:At,activeSymbolIds:jt,revealAllKeys:oe,packageGraph:Nt,graphForFile:Pt,navigate:X,togglePackage:Lt,toggleDirectory:zt,toggleFile:Rt,revealAllTree:Bt,selectFileFromTree:Vt,selectSymbolFromTree:Ht,selectSearchResult:Kt,handleOpenNode:Ot,onSearchInputChange:v,onSearchChange:b}),(0,R.jsxs)(`main`,{className:`relative min-w-0 flex-1 bg-[radial-gradient(circle_at_50%_0%,hsl(var(--primary)/0.055),transparent_38%)]`,children:[(0,R.jsx)(Ue,{layout:d,canvasMode:p,edgeFilter:h,canvasNodeCount:$.nodes.length,graphNodeCount:r.nodes.length,onLayoutChange:f,onCanvasModeChange:m,onEdgeFilterChange:g}),(0,R.jsx)(Ke,{presences:lt,onLocate:Ft}),(0,R.jsx)(qe,{paused:L!==null,followLive:ve,agentFilter:F,agents:it,onTogglePaused:It,onToggleFollow:()=>{H.current=null,ye(e=>!e)},onAgentFilter:e=>{H.current=null,I(e)}}),(0,R.jsx)(He,{loading:a,error:s,graph:r,canvasNodeCount:$.nodes.length,flowNodes:ut,flowEdges:pt,onNodesChange:ft,onEdgesChange:ht,agentTrailCount:Fe})]}),(0,R.jsx)(Qe,{selectedNode:Q,incoming:qt,outgoing:Jt,filteredGraph:Z,expandedRelations:E,activeOperations:q,recentActivities:ot,activityTotalCount:Xe,selectedActivities:Zt,onClearSelection:()=>u(null),onOpenNode:Ot,onOpenActivity:P,onLocateActivity:Ft,onToggleRelation:e=>D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelectNode:Dt})]}),j&&(0,R.jsx)(Me,{historyFile:j,fileHistory:Qt,onClose:()=>P(null)})]})}function ot(){return(0,R.jsx)(ce,{children:(0,R.jsx)(q,{})})}export{ot as CodeMap};
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{et as t,xa as n}from"./vendor-9hC4n4Me.js";var r=e(n(),1),i=t(),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({projectRoot:e}){let[t,n]=(0,r.useState)(`idle`),[c,l]=(0,r.useState)(`idle`),[p,m]=(0,r.useState)(null),[h,g]=(0,r.useState)(null),[_,v]=(0,r.useState)(null),y=(0,r.useCallback)(async()=>{n(`scanning`),v(null),m(null),g(null),l(`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 t=await s(e);m(t),n(`done`)}catch(e){v(e instanceof Error?e.message:String(e)),n(`error`)}},[]),b=(0,r.useCallback)(async()=>{if(p){l(`generating`),v(null);try{let e=await fetch(`/api/deadcode/action-plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(p)});if(!e.ok){let t=await s(e);throw Error(t.detail??t.error??`HTTP ${e.status}`)}let t=await s(e);g(t),l(`ready`)}catch(e){v(e instanceof Error?e.message:String(e)),l(`idle`)}}},[p]),x=(0,r.useCallback)(()=>{if(!h)return;l(`executing`);let e=[`# Dead-Code Cleanup Plan`,``,h.summary,``,`## Files to address (in priority order)`,...h.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),v(`Agent not connected. Plan copied to clipboard — paste it into the chat.`)),l(`idle`)},[h]);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`,{onClick:y,disabled:t===`scanning`,style:{padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:t===`scanning`?`hsl(var(--muted))`:`hsl(var(--primary))`,color:t===`scanning`?`hsl(var(--muted-foreground))`:`hsl(var(--primary-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:t===`scanning`?`not-allowed`:`pointer`},children:t===`scanning`?`Scanning…`:`Scan for Dead Code`}),_&&(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:[_,(0,i.jsx)(`button`,{onClick:()=>v(null),style:{marginLeft:`12px`,background:`none`,border:`none`,cursor:`pointer`,fontWeight:600,color:`hsl(var(--destructive))`},children:`✕`})]}),p&&(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:p.stats.totalSymbols,token:`info`}),(0,i.jsx)(u,{label:`Alive`,value:p.stats.alive,token:`success`}),(0,i.jsx)(u,{label:`Dead`,value:p.stats.dead,token:`destructive`})]}),p.deadPackages.length>0&&(0,i.jsx)(d,{title:`Dead Packages (${p.deadPackages.length})`,token:`destructive`,children:p.deadPackages.map(e=>(0,i.jsx)(f,{columns:[e.package,e.path,`${e.fileCount} file(s)`]},e.package))}),p.deadFiles.length>0&&(0,i.jsx)(d,{title:`Dead Files (${p.deadFiles.length})`,token:`warning`,children:p.deadFiles.map(e=>(0,i.jsx)(f,{columns:[e.file,`${e.symbolCount} symbol(s)`,e.lang]},e.file))}),p.deadSymbols.length>0&&(0,i.jsxs)(d,{title:`Dead Symbols (${p.deadSymbols.length})`,token:`info`,children:[p.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}`)),p.deadSymbols.length>50&&(0,i.jsxs)(`div`,{style:{padding:`6px 8px`,color:`hsl(var(--muted-foreground))`,fontSize:`12px`},children:[`… and `,p.deadSymbols.length-50,` more`]})]}),t===`done`&&(0,i.jsx)(`button`,{onClick:b,disabled:c===`generating`,style:{marginTop:`12px`,padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:c===`generating`?`hsl(var(--muted))`:`hsl(var(--accent))`,color:c===`generating`?`hsl(var(--muted-foreground))`:`hsl(var(--accent-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:c===`generating`?`not-allowed`:`pointer`},children:c===`generating`?`Generating…`:`Generate Action Plan`})]}),h&&(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:h.summary}),h.files.map((e,t)=>(0,i.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:`8px`,padding:`6px 0`,borderBottom:t<h.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`,{onClick:x,disabled:c===`executing`,style:{marginTop:`12px`,padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:c===`executing`?`hsl(var(--muted))`:`hsl(var(--success))`,color:`hsl(var(--primary-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:c===`executing`?`not-allowed`:`pointer`},children:c===`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 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Bi as t,Cr as n,Hr as r,Yr as i,Yt as a,cn as o,et as s,ga as c,gi as l,ji as u,pa as d,xa as f,xt as p,ya as m}from"./vendor-9hC4n4Me.js";import"./i18n-C2VyJ0Kz.js";import{b as h}from"./index-DSXHr5yP.js";var g=e(f(),1),_=s();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)(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}=c(),[s,f]=(0,g.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[y,S]=(0,g.useState)(!0),[C,w]=(0,g.useState)(2e3),T=(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();f({fileWatcher:n,system:i,lastUpdated:new Date,error:null})}catch(e){f(t=>({...t,error:e instanceof Error?e.message:m.t(`activity:debug.fetchFailed`)}))}finally{S(!1)}},[]);return(0,g.useEffect)(()=>{T();let e=setInterval(T,C);return()=>clearInterval(e)},[T,C]),(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)(t,{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)(o,{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:C,onChange:e=>w(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:()=>{S(!0),T()},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)(o,{className:`w-4 h-4 ${y?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),s.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)(l,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:s.lastUpdated.toLocaleTimeString()})]}),s.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)(u,{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:s.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)(i,{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:s.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:a,color:s.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,_.jsx)(v,{title:e(`activity:debug.activeProjects`),value:s.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:r,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.fileChanges`),value:s.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:d,color:`text-primary`,trend:`neutral`}),(0,_.jsx)(v,{title:e(`activity:debug.filesProcessed`),value:s.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:n,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:s.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:p,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debug.debounceResets`),value:s.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:o,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.avgDebounce`),value:`${(s.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:l,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.totalDelay`),value:`${(s.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:t,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)(n,{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(s.system?.memoryUsage?.rss??0),subtitle:s.system?`PID ${s.system.pid}`:void 0,icon:a,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapUsed`),value:b(s.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:t,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapTotal`),value:b(s.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:t,color:`text-success`}),(0,_.jsx)(v,{title:`V8 Heap Limit`,value:b(s.system?.heapLimit??0),subtitle:`Configured old-space ceiling`,icon:n,color:`text-warning`}),(0,_.jsx)(v,{title:`Server Uptime`,value:x(s.system?.uptime??0),subtitle:`Since process start`,icon:l,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`}),`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:s.system?.codebaseIndexServer?.health?.status??s.system?.codebaseIndexServer?.status??`unknown`,subtitle:s.system?.codebaseIndexServer?.pid?`PID ${s.system.codebaseIndexServer.pid} · RTT ${s.system.codebaseIndexServer.health?.latencyMs??`—`}ms`:`No connected project server`,icon:d,color:s.system?.codebaseIndexServer?.health?.status===`healthy`?`text-success`:s.system?.codebaseIndexServer?.status===`unresponsive`||s.system?.codebaseIndexServer?.status===`error`?`text-destructive`:`text-warning`}),(0,_.jsx)(v,{title:`Index RAM (RSS)`,value:b(s.system?.codebaseIndexServer?.health?.server?.memory.rss??0),subtitle:`Heap ${b(s.system?.codebaseIndexServer?.health?.server?.memory.heapUsed??0)} / ${b(s.system?.codebaseIndexServer?.health?.server?.memory.heapTotal??0)}`,icon:t,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Workload`,value:`${s.system?.codebaseIndexServer?.health?.server?.activeRequests??0} requests`,subtitle:`${s.system?.codebaseIndexServer?.health?.server?.activeWrites??0} writes · ${s.system?.codebaseIndexServer?.health?.server?.queuedWrites??0} queued`,icon:n,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Watcher`,value:s.system?.codebaseIndexServer?.health?.server?.watchingExternal?`Active`:`Off`,subtitle:`${s.system?.codebaseIndexServer?.health?.server?.watchingClients??0} owners · ${s.system?.codebaseIndexServer?.health?.server?.pendingExternalFiles??0} pending`,icon:i,color:s.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)(d,{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:s.fileWatcher,serverPid:s.system?.pid,serverMemory:s.system?.memoryUsage,serverHeapLimit:s.system?.heapLimit,serverUptime:s.system?.uptime,codebaseIndexServer:s.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<60?`${e.toFixed(0)}s`:e<3600?`${(e/60).toFixed(1)}m`:`${(e/3600).toFixed(1)}h`}export{y as DebugDashboard};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-DaSs2P3S.js";import{Ai as n,Kn as r,Mt as i,Si as a,an as o,at as s,di as c,et as l,ga as u,gi as d,gt as f,in as p,ir as m,it as h,mn as g,pn as _,tn as v,xa as y,xi as b,ya as x,yn as S,yt as C}from"./vendor-9hC4n4Me.js";import"./i18n-C2VyJ0Kz.js";import{t as w}from"./useWebSocket-Ba38Sknk.js";import{t as T}from"./utils-DzRQUvln.js";import{m as E,p as D,t as O}from"./stores-hEu6z1qz.js";import{o as k}from"./view-navigation-BSA3_knE.js";import{t as A}from"./button-Bmh1yFe5.js";import{S as j,n as M,r as ee,t as te}from"./index-DSXHr5yP.js";var N=e(y(),1),P=l(),F={pending:{icon:(0,P.jsx)(b,{className:`w-4 h-4`}),color:`text-muted-foreground`,label:`Pending`},in_progress:{icon:(0,P.jsx)(d,{className:`w-4 h-4 animate-spin`}),color:`text-primary`,label:`In Progress`},blocked:{icon:(0,P.jsx)(S,{className:`w-4 h-4`}),color:`text-warning`,label:`Blocked`},failed:{icon:(0,P.jsx)(a,{className:`w-4 h-4`}),color:`text-destructive`,label:`Failed`},review:{icon:(0,P.jsx)(p,{className:`w-4 h-4`}),color:`text-info`,label:`Review`},completed:{icon:(0,P.jsx)(n,{className:`w-4 h-4`}),color:`text-success`,label:`Done`}},I={critical:`bg-destructive/15 text-destructive`,high:`bg-warning/15 text-warning`,medium:`bg-info/15 text-info`,low:`bg-muted text-muted-foreground`},L={feature:`bg-success/15 text-success`,bugfix:`bg-destructive/15 text-destructive`,refactor:`bg-primary/15 text-primary`,docs:`bg-info/15 text-info`,test:`bg-primary/15 text-primary`,chore:`bg-muted text-muted-foreground`};function R(e){if(!e)return``;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function z({task:e,onStatusChange:t,onRetry:n,agents:r,onAssign:i,compact:a,className:o}){let{t:s}=u(),c=F[e.status],[l,m]=(0,N.useState)(!1),h=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:T(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,h?`border-primary/40 bg-primary/5`:e.status===`completed`?`border-success/35 bg-success/6`:e.status===`failed`?`border-destructive/40 bg-destructive/5`:`border-border bg-card`,o),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsx)(`span`,{className:T(`mt-0.5`,c.color),role:`img`,"aria-label":h?s(`common:status.inProgress`):void 0,children:c.icon}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,P.jsx)(`span`,{className:T(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:T(`px-1.5 py-0.5 rounded text-[10px] font-medium`,L[e.type]),children:e.type})]}),e.description&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.description})]})]}),e.assignee&&(0,P.jsxs)(`div`,{className:T(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,h?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[h&&(0,P.jsx)(d,{className:`w-3 h-3 animate-spin`,"aria-label":s(`common:status.working`)}),(0,P.jsx)(`span`,{children:e.assignee})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.estimateHours?(0,P.jsxs)(`span`,{children:[`~`,e.estimateHours,`h`]}):null,e.actualHours?(0,P.jsxs)(`span`,{children:[`• `,e.actualHours,`h`]}):null,e.startedAt?(0,P.jsxs)(`span`,{children:[`• `,R(Date.now()-e.startedAt)]}):null]}),e.tags.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.tags.map(e=>(0,P.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))}),!a&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2`,children:[t&&e.status!==`in_progress`&&e.status!==`completed`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`in_progress`),className:`px-2 py-0.5 text-[10px] rounded bg-primary/15 text-primary hover:bg-primary/25 transition-colors`,children:s(`activity:task.start`)}),t&&e.status===`in_progress`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`completed`),className:`px-2 py-0.5 text-[10px] rounded bg-success/15 text-success hover:bg-success/25 transition-colors`,children:s(`activity:task.complete`)}),n&&(e.status===`failed`||e.status===`completed`)&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,children:[(0,P.jsx)(p,{className:`w-3 h-3`}),` `,s(`activity:task.retry`)]}),i&&r&&r.length>0&&(l?(0,P.jsxs)(`select`,{defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),m(!1)},onBlur:()=>m(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,P.jsx)(`option`,{value:``,children:s(`activity:task.unassigned`)}),r.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>m(!0),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,title:s(`activity:task.assignTitle`),children:[(0,P.jsx)(f,{className:`w-3 h-3`}),` `,s(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,label:`Pending`,match:[`pending`,`blocked`]},{key:`in_progress`,label:`In Progress`,match:[`in_progress`]},{key:`review`,label:`Review`,match:[`review`]},{key:`failed`,label:`Failed`,match:[`failed`]},{key:`completed`,label:`Done`,match:[`completed`]}],V={pending:`bg-muted text-muted-foreground`,ready:`bg-info/15 text-info`,running:`bg-primary/15 text-primary`,paused:`bg-warning/15 text-warning`,completed:`bg-success/15 text-success`,failed:`bg-destructive/15 text-destructive`,skipped:`bg-muted text-muted-foreground`};function ne(){let{client:e}=w(),{t}=u(),n=D(e=>e.phases),r=D(e=>e.multiBoard),[i,a]=(0,N.useState)(`phase`),[o,s]=(0,N.useState)(null),[l,d]=(0,N.useState)(null),[f,p]=(0,N.useState)(0),m=Math.min(f,Math.max(0,n.length-1)),h=r?n[m]:void 0,g=(0,N.useMemo)(()=>n.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[n]),_=(0,N.useMemo)(()=>[...new Set(g.map(e=>e.assignee).filter(e=>!!e))],[g]),y=(0,N.useCallback)(t=>e?.send?.(t),[e]),b=(0,N.useCallback)((e,t)=>y({type:`goal.taskStatus`,payload:{taskId:e,status:t}}),[y]),x=(0,N.useCallback)(e=>y({type:`goal.retryTask`,payload:{taskId:e}}),[y]),S=(0,N.useCallback)((e,t)=>y({type:`goal.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[y]),C=(0,N.useCallback)(e=>{j({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&y({type:`goal.addTask`,payload:{phaseId:e,title:t}})})},[y]),E=(0,N.useCallback)(e=>{o&&y({type:`goal.moveTask`,payload:{taskId:o,toPhaseId:e}}),s(null),d(null)},[o,y]),O=(0,N.useCallback)(e=>{o&&y({type:`goal.taskStatus`,payload:{taskId:o,status:e}}),s(null),d(null)},[o,y]),k={onStatusChange:b,onRetry:x,agents:_,onAssign:S};function A(e){return{draggable:!0,onDragStart:t=>{s(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{s(null),d(null)}}}function M(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,l!==e&&d(e)},onDragLeave:()=>d(t=>t===e?null:t),onDrop:e=>{e.preventDefault(),t()},"data-hover":l===e||void 0}}return n.length===0?(0,P.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-sm`,children:t(`activity:board.empty`)})}):(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2`,children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:board.summary`,{phases:n.length,tasks:g.length})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`phase`),className:T(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,i===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(c,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`status`),className:T(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,i===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(v,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),r&&h?(0,P.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b border-border px-3 py-1.5`,children:n.map((e,t)=>(0,P.jsxs)(`button`,{type:`button`,onClick:()=>p(t),className:T(`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,P.jsx)(`span`,{className:`truncate`,children:e.name}),(0,P.jsxs)(`span`,{className:`ml-1.5 text-[10px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount]})]},e.id))}),(0,P.jsx)(W,{phase:h,allTasks:g,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:M,dropToPhase:E,dropToStatus:O,onAddTask:C})]}):(0,P.jsx)(U,{phases:n,allTasks:g,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:M,dropToPhase:E,dropToStatus:O,onAddTask:C})]})}function H({phase:e,phaseTasks:t,callbacks:n,draggable:r,dropZone:i,dropToPhase:a,onAddTask:o,dragId:s,hoverKey:c}){let{t:l}=u();return(0,P.jsxs)(`div`,{...i(`phase:${e.id}`,()=>a(e.id)),className:T(`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,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,P.jsx)(`span`,{className:T(`rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,V[e.status]),children:e.status})]}),(0,P.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount,` · `,e.progressPercent,`%`]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>o(e.id),title:l(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(_,{className:`h-4 w-4`})})]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-2`,children:t.length===0?(0,P.jsx)(`p`,{className:`px-1 py-4 text-center text-[11px] text-muted-foreground`,children:l(`activity:board.dropHere`)}):t.map(e=>(0,P.jsx)(`div`,{...r(e.id),className:T(s===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,...n})},e.id))})]})}function U({phases:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:u}){return(0,P.jsx)(P.Fragment,{children:n===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:e.map(e=>(0,P.jsx)(H,{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,P.jsx)(G,{phases:e,allTasks:t,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToStatus:l})})}function W({phase:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:d}){let f=t.filter(t=>t.phaseId===e.id),{t:p}=u();return n===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:(0,P.jsx)(H,{phase:e,phaseTasks:f,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,onAddTask:d,dragId:r,hoverKey:i})}):(0,P.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain p-3`,children:(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:p(`activity:board.status.${e.key}`)},e.key)),(0,P.jsxs)(K,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:T(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(t=>{let n=f.filter(e=>t.match.includes(e.status)),c=`cell:${e.id}:${t.key}`;return(0,P.jsx)(`div`,{...s(c,()=>l(t.key)),className:T(`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,P.jsx)(`div`,{...o(e.id),className:T(r===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...a})},e.id))},t.key)})]},e.id)]})})}function G({phases:e,allTasks:t,dragId:n,hoverKey:r,callbacks:i,draggable:a,dropZone:o,dropToStatus:s}){let{t:c}=u();return(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:c(`activity:board.status.${e.key}`)},e.key)),e.map(e=>(0,P.jsxs)(K,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:T(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(c=>{let l=t.filter(t=>t.phaseId===e.id&&c.match.includes(t.status)),u=`cell:${e.id}:${c.key}`;return(0,P.jsx)(`div`,{...o(u,()=>s(c.key)),className:T(`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,P.jsx)(`div`,{...a(e.id),className:T(n===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...i})},e.id))},c.key)})]},e.id))]})}function K({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function q({onClose:e}){let{client:n}=w(),{t:a}=u(),c=D(e=>e.phases),l=D(e=>e.overallPercent),d=D(e=>e.autonomous),f=D(e=>e.title),p=D(e=>e.goal),v=D(e=>e.status),y=D(e=>e.lastError),b=D(e=>e.graphs);(0,N.useEffect)(()=>{n?.send?.({type:`goal.list`}),n?.send?.({type:`goal.state`})},[n]);let j=O(e=>e.worktrees),F=O(e=>e.baseBranch),[I,L]=(0,N.useState)(``),[R,z]=(0,N.useState)(null),[B,V]=(0,N.useState)(!1),[H,U]=(0,N.useState)(!0),[W,G]=(0,N.useState)(!1),[K,q]=(0,N.useState)(!1),[J,re]=(0,N.useState)(!1),Y=E(e=>e.result),X=E(e=>e.loading),Z=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(Z.current&&clearTimeout(Z.current),!I.trim()){E.getState().clear();return}return Z.current=setTimeout(()=>{E.getState().setLoading();let e=E.getState().nextSeq();n?.send?.({type:`goal.assess`,payload:{goal:I,seq:e}})},800),()=>{Z.current&&clearTimeout(Z.current)}},[I,n]),(0,N.useEffect)(()=>{!I.trim()&&!R&&E.getState().clear()},[I,R]);let Q=c.length>0,ie=R!=null&&!Q;(0,N.useEffect)(()=>{Q&&z(null)},[Q]);let ae=(0,N.useCallback)(()=>{let e=I.trim();if(!e||R!=null)return;let r=t.getState();r.addMessage({role:`user`,content:e}),r.addMessage({role:`assistant`,content:x.t(`activity:goalRun.planningAck`)}),z(e),L(``),n?.send?.({type:`goal.start`,payload:{title:e,autonomous:!0,worktrees:H,multiBoard:W,verifyTasks:K,chimeraReview:J}}),k(`chat`)},[I,R,n,H]),oe=(0,N.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}}),z(null)},[n]),se=(0,N.useCallback)(()=>{n?.send?.({type:`goal.toggleAutonomous`,payload:{}})},[n]),ce=(0,N.useCallback)(()=>{n?.send?.(v===`paused`?{type:`goal.resume`,payload:{}}:{type:`goal.pause`,payload:{}})},[n,v]),le=(0,N.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}})},[n]),ue=(0,N.useCallback)(()=>{n?.send?.({type:`goal.clear`,payload:{}}),D.getState().clear(),z(null),L(``)},[n]),[de,$]=(0,N.useState)(!1),fe=(0,N.useCallback)(()=>{n?.send?.({type:`goal.revert`,payload:{}}),$(!1)},[n]),pe=v===`running`||v===`paused`,me=v===`stopped`||v===`completed`||v===`failed`,he=(0,N.useCallback)(e=>{e&&n?.send?.({type:`goal.load`,payload:{graphId:e}})},[n]);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,P.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2 border-b bg-card px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(m,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:Q&&f||`Goal`}),Q&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`activity:goalRun.summary`,{count:c.length,pct:l})})]}),Q&&(0,P.jsx)(`span`,{className:T(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,v===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:v===`paused`||v===`stopped`?`border-warning/40 bg-warning/10 text-warning`:v===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:y??void 0,children:v})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[b.length>0&&(0,P.jsxs)(`select`,{value:Q?b.find(e=>e.title===f)?.id??``:``,onChange:e=>he(e.target.value),title:a(`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,P.jsx)(`option`,{value:``,disabled:!0,children:a(`activity:goalRun.boardsCount`,{count:b.length})}),b.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.title,` · `,e.status]},e.id))]}),Q&&(0,P.jsxs)(`button`,{type:`button`,onClick:se,title:a(`activity:goalRun.toggleAutonomousTitle`),className:T(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,d?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(h,{className:`h-3.5 w-3.5`}),` `,a(d?`activity:goalRun.autonomous`:`activity:goalRun.manual`)]}),pe&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ce,title:a(v===`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:[v===`paused`?(0,P.jsx)(g,{className:`h-3.5 w-3.5`}):(0,P.jsx)(S,{className:`h-3.5 w-3.5`}),a(v===`paused`?`activity:goalRun.resume`:`activity:goalRun.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:le,title:a(`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,P.jsx)(i,{className:`h-3.5 w-3.5 fill-current`}),` `,a(`activity:goalRun.stop`)]})]}),Q&&me&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ue,title:a(`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,P.jsx)(_,{className:`h-3.5 w-3.5`}),` `,a(`activity:goalRun.newLabel`)]}),de?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 text-xs`,children:[(0,P.jsx)(`span`,{className:`text-warning`,children:a(`activity:goalRun.revertConfirm`)}),(0,P.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:a(`common:action.yes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>$(!1),className:`rounded px-1.5 py-0.5 text-muted-foreground hover:text-foreground`,children:a(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:a(`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,P.jsx)(C,{className:`h-3.5 w-3.5`}),` `,a(`activity:goalRun.revert`)]})]}),(0,P.jsx)(A,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(s,{className:`h-4 w-4`})})]})]}),Q&&p&&(0,P.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-muted/20 px-4 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(o,{className:`h-3 w-3`}),` `,a(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:p})]}),Q?(0,P.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,P.jsx)(ne,{})}):ie?(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-5 text-center`,children:[(0,P.jsx)(r,{className:`h-10 w-10 mx-auto animate-spin text-primary/70`}),(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:a(`activity:goalRun.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`activity:goalRun.planningBody`)})]}),(0,P.jsxs)(`div`,{className:`rounded-lg border border-border bg-card px-4 py-3 text-left`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(o,{className:`h-3 w-3`}),` `,a(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(A,{variant:`outline`,onClick:oe,className:`gap-2`,children:[(0,P.jsx)(i,{className:`h-4 w-4 fill-current`}),` `,a(`common:action.cancel`)]})]})}):(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-6`,children:[(0,P.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,P.jsx)(o,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:a(`activity:goalRun.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`activity:goalRun.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:a(`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(),ae())}}),X&&(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(r,{className:`h-3 w-3 animate-spin`}),a(`activity:goalRun.assess.analyzing`)]}),!X&&Y&&!Y.parseFailed&&(0,P.jsxs)(`div`,{className:T(`rounded-lg border px-3 py-2 text-xs space-y-1.5`,Y.realistic?`border-success/40 bg-success/10`:`border-warning/40 bg-warning/10`),children:[(0,P.jsx)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:Y.realistic?(0,P.jsx)(`span`,{className:`text-success`,children:a(`activity:goalRun.assess.realistic`)}):(0,P.jsx)(`span`,{className:`text-warning`,children:a(`activity:goalRun.assess.durationConcern`)})}),Y.durationClaimed&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:a(`activity:goalRun.assess.durationClaimed`,{duration:Y.durationClaimed})}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:Y.explanation}),Y.recommendedDuration&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:a(`activity:goalRun.assess.recommendation`,{duration:Y.recommendedDuration})}),Y.concerns.length>0&&(0,P.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,P.jsx)(`p`,{className:`font-medium text-foreground/80`,children:a(`activity:goalRun.assess.concerns`)}),(0,P.jsx)(`ul`,{className:`list-disc pl-4 space-y-0.5 text-muted-foreground`,children:Y.concerns.map((e,t)=>(0,P.jsx)(`li`,{children:e},t))})]})]}),!X&&Y?.parseFailed&&(0,P.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-muted/20 px-3 py-2 text-xs text-muted-foreground`,children:a(`activity:goalRun.assess.analysisFailed`)}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>U(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.isolateLabel`)]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-3 text-xs text-muted-foreground`,children:[(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:W,onChange:e=>G(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.multiBoardLabel`)]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:K,onChange:e=>q(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.verifyTasksLabel`)]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:J,onChange:e=>re(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.chimeraReviewLabel`)]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[!X&&Y&&!Y.realistic&&!Y.parseFailed&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>E.getState().clear(),className:`shrink-0 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:a(`activity:goalRun.assess.overrideTitle`),children:a(`activity:goalRun.assess.override`)}),(0,P.jsxs)(A,{onClick:ae,disabled:!I.trim()||R!=null||X||!X&&Y!=null&&!Y.parseFailed&&!Y.realistic,className:`flex-1 gap-2`,title:I.trim()&&!X&&Y&&!Y.parseFailed&&!Y.realistic?a(`activity:goalRun.assess.disableTitle`):``,children:[(0,P.jsx)(g,{className:`h-4 w-4`}),a(`activity:goalRun.startButton`)]})]}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[a(`activity:goalRun.ctrlHint`),` ·`,` `,a(H?`activity:goalRun.isolateOn`:`activity:goalRun.isolateOff`)]})]})}),j.length>0&&(0,P.jsxs)(`div`,{className:`border-t bg-card/50 shrink-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-4 pt-2 text-xs`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!1),className:T(`rounded px-2 py-0.5 border transition-colors`,B?`border-border text-muted-foreground hover:text-foreground`:`bg-primary/10 border-primary/30 text-primary`),children:a(`activity:goalRun.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:T(`rounded px-2 py-0.5 border transition-colors`,B?`bg-primary/10 border-primary/30 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:a(`activity:goalRun.graph`)})]}),(0,P.jsxs)(`div`,{className:`space-y-2 px-4 pb-3`,children:[(0,P.jsx)(te,{}),B?(0,P.jsx)(ee,{worktrees:j,baseBranch:F}):(0,P.jsx)(M,{worktrees:j,baseBranch:F})]})]})]})}export{q as GoalView};