@openscout/scout 0.2.90 → 0.2.92

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 (283) hide show
  1. package/README.md +12 -4
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/{ActivityScreen-BUeb4ERK.js → ActivityScreen-DkUP7V7M.js} +1 -1
  5. package/dist/client/assets/{AddProjectForm-DtTfn4Zk.js → AddProjectForm-CpyytDf2.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-CneOa70z.js → AgentAvatar-D8ZtMluU.js} +1 -1
  7. package/dist/client/assets/{AgentConfigurationScreen-CkZ7EjZh.js → AgentConfigurationScreen-BlGI6fuM.js} +1 -1
  8. package/dist/client/assets/{AgentDefinitionsWorkspace-0Y3kqMtv.js → AgentDefinitionsWorkspace-CfaDVCVt.js} +1 -1
  9. package/dist/client/assets/{AgentDetailCard-Dtc02KUO.js → AgentDetailCard-BTiOmh-a.js} +1 -1
  10. package/dist/client/assets/{AgentFloorView-B5raPB_U.js → AgentFloorView-DjNLILLt.js} +1 -1
  11. package/dist/client/assets/{AgentInfoScreen-DFG4ElZD.js → AgentInfoScreen-DG5dlHb_.js} +1 -1
  12. package/dist/client/assets/{AgentLaneCard-BRAkw8YJ.js → AgentLaneCard-lfRNb7JD.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-T8QE5742.js → AgentLaneChrome-Dlwrbq3g.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-C8RYotnv.js → AgentLaneDetailSheet-BzYzBfcW.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-FyYweLo_.js → AgentLaneSummaryResize-6SOEWUnr.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-Crxx1srt.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-Cil3dNwu.js → AgentLanesPreflight-C3uOiOzd.js} +1 -1
  18. package/dist/client/assets/{AgentLanesView-DPfO8MOo.js → AgentLanesView-ChNlmY-F.js} +1 -1
  19. package/dist/client/assets/{AgentLiveActions-DwScaVRF.js → AgentLiveActions-BJ5dIfL3.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-DKoWA0Lm.js → AgentSessions-DpY0htZV.js} +1 -1
  21. package/dist/client/assets/{AgentsConsole-DoBIWGoq.js → AgentsConsole-CHyXrjhm.js} +1 -1
  22. package/dist/client/assets/{AgentsScreen-JuUiSuwY.js → AgentsScreen-BhCjX2lD.js} +1 -1
  23. package/dist/client/assets/AgentsSubnav-az_VDkri.js +1 -0
  24. package/dist/client/assets/{AtopView-ycxMrRwp.js → AtopView-BjjPM8OX.js} +1 -1
  25. package/dist/client/assets/{BackToPicker-D6WgIDb-.js → BackToPicker-D1LV6Cqp.js} +1 -1
  26. package/dist/client/assets/{BriefingDetailScreen-Zw-taW1s.js → BriefingDetailScreen-B7qJ90Np.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-BerYOoWS.js → BriefingsScreen-CW6N829d.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-Cu93j-Ga.js → BrokerMetadataPanel-BhjECqOK.js} +1 -1
  29. package/dist/client/assets/{BrokerScreen-CeN90URH.js → BrokerScreen-X3z50712.js} +1 -1
  30. package/dist/client/assets/{ChatCollapsedStrip-DdKyMSEM.js → ChatCollapsedStrip-DNR9osDy.js} +1 -1
  31. package/dist/client/assets/{CodeDiffPane-BjCOBLze.js → CodeDiffPane-Bx_2VAzv.js} +1 -1
  32. package/dist/client/assets/{CodeProjectPicker-NSGdCaK0.js → CodeProjectPicker-C1yOJKvs.js} +1 -1
  33. package/dist/client/assets/{CodeScreen-CA9Sq6Dx.js → CodeScreen-CIKK1LcZ.js} +1 -1
  34. package/dist/client/assets/{ContextMenu-DnFcmfMR.js → ContextMenu-CHIuVKz7.js} +1 -1
  35. package/dist/client/assets/{ConversationComposer-CjRXFkvY.js → ConversationComposer-Bf7Ga_49.js} +1 -1
  36. package/dist/client/assets/{ConversationFeedRows-CgRTIpAv.js → ConversationFeedRows-Cm1Lgo43.js} +1 -1
  37. package/dist/client/assets/{ConversationHeader-CRmdtuL7.js → ConversationHeader-B_GXrKR0.js} +1 -1
  38. package/dist/client/assets/{ConversationPanels-DCkcLIHk.js → ConversationPanels-BTBbEvrP.js} +2 -2
  39. package/dist/client/assets/{ConversationScreen-Br0QQ3xo.js → ConversationScreen-B3l2m3JI.js} +1 -1
  40. package/dist/client/assets/{ConversationStatus-BJ1CMbAv.js → ConversationStatus-BqhUHD85.js} +1 -1
  41. package/dist/client/assets/{DataTable-Dzqiaha4.js → DataTable-CJbbgBdA.js} +1 -1
  42. package/dist/client/assets/{DispatchAftermath-B0WMg_z3.js → DispatchAftermath-BDA9CrOd.js} +1 -1
  43. package/dist/client/assets/{DocumentFocusViewer-CZVVIAD5.js → DocumentFocusViewer-B9vodVmG.js} +1 -1
  44. package/dist/client/assets/{EmbeddableSurfacesLab-C3a7hJWO.js → EmbeddableSurfacesLab-BdsYRDky.js} +1 -1
  45. package/dist/client/assets/{EmptyState-CYNJZMrZ.js → EmptyState-BRY5jTpz.js} +1 -1
  46. package/dist/client/assets/{FileViewerPane-Fwt8_KmD.js → FileViewerPane-9Bveqm9c.js} +1 -1
  47. package/dist/client/assets/{FleetSearch-Dsi_l2KW.js → FleetSearch-Bj9SCl2f.js} +1 -1
  48. package/dist/client/assets/{FlightObserveScreen-g_tiGmvz.js → FlightObserveScreen-BVMdsiCC.js} +1 -1
  49. package/dist/client/assets/{FollowScreen-Bb_rcrzi.js → FollowScreen-BifwHWOV.js} +1 -1
  50. package/dist/client/assets/{HarnessMark-DrE57dUq.js → HarnessMark-BPAphNjx.js} +1 -1
  51. package/dist/client/assets/{HarnessesScreen-CAsCJ_tG.js → HarnessesScreen-fMnbnrD4.js} +1 -1
  52. package/dist/client/assets/{HerdrSession-1eVu9Owj.js → HerdrSession-BujfGzrP.js} +1 -1
  53. package/dist/client/assets/{HomeHero-W445QrG1.js → HomeHero-BgM6S39l.js} +1 -1
  54. package/dist/client/assets/{KnowledgeSearchInspector-CbPVg3fr.js → KnowledgeSearchInspector-B4ZY24xE.js} +1 -1
  55. package/dist/client/assets/{KnowledgeSearchScreen-C1lN1xJk.js → KnowledgeSearchScreen-Ch_WENUC.js} +1 -1
  56. package/dist/client/assets/{LaneToolHoverCard-BkBcDYm-.js → LaneToolHoverCard-B7KdvQvf.js} +1 -1
  57. package/dist/client/assets/{LaneTraceDetailSheet-CzTd44rf.js → LaneTraceDetailSheet-H3AnN-vN.js} +1 -1
  58. package/dist/client/assets/{LaneTraceEventFocus-BmMmPTyJ.js → LaneTraceEventFocus-mkMw2wJU.js} +1 -1
  59. package/dist/client/assets/{MeshCanvas-DwkjsiJ5.js → MeshCanvas-CpKcWxKy.js} +1 -1
  60. package/dist/client/assets/{MeshCanvasMinimap-vmCpU1sD.js → MeshCanvasMinimap-C9IoGHbe.js} +1 -1
  61. package/dist/client/assets/{MeshScreen-CkMepUpT.js → MeshScreen-48QkJSDI.js} +1 -1
  62. package/dist/client/assets/{MeshTopologyView-BD2xLE2C.js → MeshTopologyView-DFzr0IZM.js} +2 -2
  63. package/dist/client/assets/{MessageComposerSuggestions-qbalTne_.js → MessageComposerSuggestions-FdVHnT_q.js} +1 -1
  64. package/dist/client/assets/{MessagesScreen-C8UynyLC.js → MessagesScreen-BMOOfbWX.js} +1 -1
  65. package/dist/client/assets/{MissionContextRail-D5MEP2f4.js → MissionContextRail-Y8QxUZGE.js} +1 -1
  66. package/dist/client/assets/{MissionControlView-K_I7eftL.js → MissionControlView-BpsHKu1F.js} +1 -1
  67. package/dist/client/assets/{MissionFocusOverlay-CWKLdUKG.js → MissionFocusOverlay-BPnAEA3F.js} +1 -1
  68. package/dist/client/assets/{MissionLeftAgentRow-ByGrNAcs.js → MissionLeftAgentRow-iOZ6ds9L.js} +1 -1
  69. package/dist/client/assets/{MissionLogPane-ZwHJ137T.js → MissionLogPane-B0csI89E.js} +1 -1
  70. package/dist/client/assets/{NewAgentModal-Do9aVvan.js → NewAgentModal-DBHJR9Qm.js} +1 -1
  71. package/dist/client/assets/{NewChatComposer-DKlNX1UA.js → NewChatComposer-Hd7pI5Ac.js} +1 -1
  72. package/dist/client/assets/{NewChatOrigin-DXPvX-hh.js → NewChatOrigin-DmuJ32wa.js} +1 -1
  73. package/dist/client/assets/{ObserveEmbedScreen-Dghsq2on.js → ObserveEmbedScreen-DyArn7Id.js} +1 -1
  74. package/dist/client/assets/{ObserveTextFlow-DWNlmTVm.js → ObserveTextFlow-CkMrtT8s.js} +2 -2
  75. package/dist/client/assets/{ObservedTopologyPanel-BlmGoxCE.js → ObservedTopologyPanel-CaSZZP05.js} +1 -1
  76. package/dist/client/assets/{OpenScoutAppShell-DDqQi-oe.js → OpenScoutAppShell-BtlKkiuF.js} +1 -1
  77. package/dist/client/assets/{OpsAgentsView-Bn_fGBdo.js → OpsAgentsView-CnqrwbC2.js} +1 -1
  78. package/dist/client/assets/OpsScreen-DOlmlVkP.js +1 -0
  79. package/dist/client/assets/OpsSubnav-Dj3ShAKv.js +1 -0
  80. package/dist/client/assets/{PlanView-B6gKo543.js → PlanView-BLGdWDx6.js} +1 -1
  81. package/dist/client/assets/ProjectAgentProfile-Dv1sVnQl.js +1 -0
  82. package/dist/client/assets/{ProjectAgentProfileBar-C5QWwZCn.js → ProjectAgentProfileBar-BLVg5EeA.js} +1 -1
  83. package/dist/client/assets/{ProjectAgentProfileHero-DC7Dd8VL.js → ProjectAgentProfileHero-0-GDhsPT.js} +1 -1
  84. package/dist/client/assets/{ProjectsInbox-DCLrDmj1.js → ProjectsInbox-B3DpAI5b.js} +1 -1
  85. package/dist/client/assets/{ProjectsRail-C4hiXYSb.js → ProjectsRail-BDl7U9Jq.js} +1 -1
  86. package/dist/client/assets/ProjectsScreen-Dl2FcGrR.js +1 -0
  87. package/dist/client/assets/{ProjectsThreadAside-DYmL2dCY.js → ProjectsThreadAside-BcGC5mHE.js} +1 -1
  88. package/dist/client/assets/{Provider-p-xuaAoE.js → Provider-cJCdHAxu.js} +1 -1
  89. package/dist/client/assets/{RailRow-bRkkXIpR.js → RailRow-CLcVmywd.js} +1 -1
  90. package/dist/client/assets/{RawSessionsTable-B7WKmXrk.js → RawSessionsTable-DBto4Ts-.js} +1 -1
  91. package/dist/client/assets/{RealtimeVoiceScreen-BzP3BQq9.js → RealtimeVoiceScreen-DXEU5v3g.js} +1 -1
  92. package/dist/client/assets/{RepoDiffEmbedScreen-xjzjcJ_c.js → RepoDiffEmbedScreen-BCDXFE3D.js} +1 -1
  93. package/dist/client/assets/{RepoDiffPageScreen-DRzIY-dk.js → RepoDiffPageScreen-m62FiWXC.js} +1 -1
  94. package/dist/client/assets/{RepoDiffViewer-CNDp01KM.js → RepoDiffViewer-PaNeZMhJ.js} +1 -1
  95. package/dist/client/assets/RepoDiffViewerLazy-CWE5GxMP.js +2 -0
  96. package/dist/client/assets/{ReposScreen-CpaLC_NU.js → ReposScreen-Cksv1cAD.js} +1 -1
  97. package/dist/client/assets/{ScoutDeckSurface-DkpZ-0DH.js → ScoutDeckSurface-BCjPl7C4.js} +1 -1
  98. package/dist/client/assets/{ScoutSurface-BENBUt5-.js → ScoutSurface-CkgT7A-c.js} +1 -1
  99. package/dist/client/assets/{ScoutbotBroadcastChip-CGZyxS5H.js → ScoutbotBroadcastChip-DkiRCHuK.js} +1 -1
  100. package/dist/client/assets/{ScoutbotFxLab-Bk2ZsfPp.js → ScoutbotFxLab-D-kV5j4T.js} +1 -1
  101. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-n63LdBZs.js → ScoutbotRealtimeVoiceCall-1ixiEn1L.js} +1 -1
  102. package/dist/client/assets/{SecondaryNav-B4IsujYh.js → SecondaryNav-_wyKjwNf.js} +1 -1
  103. package/dist/client/assets/{SessionEmbedScreen-CPfH-jqN.js → SessionEmbedScreen-CJZmIBV7.js} +1 -1
  104. package/dist/client/assets/{SessionObserve-B-SkP3tu.js → SessionObserve-yYA8Gy5s.js} +1 -1
  105. package/dist/client/assets/{SessionObserveEvidence-CF5jnH3-.js → SessionObserveEvidence-cHdjYOJe.js} +1 -1
  106. package/dist/client/assets/{SessionRefScreen-C-4jjmVG.js → SessionRefScreen-OkTY7Szg.js} +1 -1
  107. package/dist/client/assets/SessionsScreen-B-GFjxIA.js +1 -0
  108. package/dist/client/assets/{SettingsDrawer-DATxwZrn.js → SettingsDrawer-Co11RFX0.js} +1 -1
  109. package/dist/client/assets/{SettingsScreen-Bu53X7J_.js → SettingsScreen-Cn09nq5_.js} +1 -1
  110. package/dist/client/assets/{ShikiPane-DH8yYDks.js → ShikiPane-dBS9hD-z.js} +1 -1
  111. package/dist/client/assets/{SlidePanel-RFXJpfUa.js → SlidePanel-CH-3-8_2.js} +1 -1
  112. package/dist/client/assets/{SpriteAvatar-CEYdCzem.js → SpriteAvatar-DS6Tmyua.js} +1 -1
  113. package/dist/client/assets/{StatusPill-9uy70ttd.js → StatusPill-C8m9ZymF.js} +1 -1
  114. package/dist/client/assets/{TailView-6bIrgdxN.js → TailView-B0BSopPs.js} +1 -1
  115. package/dist/client/assets/{Terminal-BI6km7H4.js → Terminal-U8gjIdm3.js} +1 -1
  116. package/dist/client/assets/{TerminalEmbedScreen-D4JOWwtm.js → TerminalEmbedScreen-CTmdE7us.js} +1 -1
  117. package/dist/client/assets/{TextDocumentSurface-BcP9vvji.js → TextDocumentSurface-BWJCGBZf.js} +1 -1
  118. package/dist/client/assets/{TmuxPeek-IaWqCgyJ.js → TmuxPeek-B4QdHbGm.js} +1 -1
  119. package/dist/client/assets/{VoicePermissionsPanel-C80iZxgy.js → VoicePermissionsPanel-Dd4ITJy_.js} +1 -1
  120. package/dist/client/assets/{WorkDetailScreen-CweZ6fEd.js → WorkDetailScreen-mJs0mb99.js} +1 -1
  121. package/dist/client/assets/{WorkFilesViewer-Dy_-06iI.js → WorkFilesViewer-ODzLXKxj.js} +1 -1
  122. package/dist/client/assets/{activity-DS0u0Itf.js → activity-CC8JzJNH.js} +1 -1
  123. package/dist/client/assets/{addon-fit-CN888B3D.js → addon-fit-CaZ-uLrg.js} +1 -1
  124. package/dist/client/assets/{addon-webgl-CoAnanQS.js → addon-webgl-B8utL3bM.js} +1 -1
  125. package/dist/client/assets/{agent-essentials-CuK4G_zS.js → agent-essentials-B3wcxg_v.js} +1 -1
  126. package/dist/client/assets/{arc.es-BET9ev6q.js → arc.es-uFv9UrHn.js} +1 -1
  127. package/dist/client/assets/{arrow-down-DxxPnPwh.js → arrow-down-w1HPzDSE.js} +1 -1
  128. package/dist/client/assets/{arrow-left-CXDkJuCg.js → arrow-left-B-3GJ7ct.js} +1 -1
  129. package/dist/client/assets/{arrow-up-right-Bj8RjSqW.js → arrow-up-right-G6bJXxhK.js} +1 -1
  130. package/dist/client/assets/{bot-BSGSicKC.js → bot-DzCOGKi6.js} +1 -1
  131. package/dist/client/assets/{check-BfA0T8UD.js → check-BX8nRgop.js} +1 -1
  132. package/dist/client/assets/{chevron-down-BVg09D6U.js → chevron-down-B3VVRJcV.js} +1 -1
  133. package/dist/client/assets/{chevron-right-CaEwYkxE.js → chevron-right-BYMV1511.js} +1 -1
  134. package/dist/client/assets/{chunk-HRAB3GC3-HhKwnZCi.js → chunk-HRAB3GC3-dRd2eQMJ.js} +1 -1
  135. package/dist/client/assets/{chunk-JTPDIGGW-DX2eTIQ_.js → chunk-JTPDIGGW-BjX67kHU.js} +3 -3
  136. package/dist/client/assets/{chunk-T65CQEWV-D-bOfuCH.js → chunk-T65CQEWV-kP6nJjkU.js} +1 -1
  137. package/dist/client/assets/{chunk-YOZR3KYS-oS9dlQCI.js → chunk-YOZR3KYS-C13bZPVd.js} +1 -1
  138. package/dist/client/assets/{clock-C3TUL7D7.js → clock-B9ukVaVn.js} +1 -1
  139. package/dist/client/assets/{code-xml-Dbvjk9Kw.js → code-xml-BFc3TMSm.js} +1 -1
  140. package/dist/client/assets/{content-CiOMtgQc.js → content-B8gahuBy.js} +1 -1
  141. package/dist/client/assets/content-BIqX06OQ.js +1 -0
  142. package/dist/client/assets/content-BKDZ6Fxe.js +1 -0
  143. package/dist/client/assets/content-C15Ya-iu.js +1 -0
  144. package/dist/client/assets/content-CDE9tJDF.js +1 -0
  145. package/dist/client/assets/content-CSAfI-PX.js +1 -0
  146. package/dist/client/assets/content-CTF9D60D.js +1 -0
  147. package/dist/client/assets/{content-CJuH5cDP.js → content-CbAGkYQO.js} +1 -1
  148. package/dist/client/assets/content-CtqLJOVp.js +1 -0
  149. package/dist/client/assets/content-Dvs1KRfo.js +1 -0
  150. package/dist/client/assets/content-DyJdVZjI.js +1 -0
  151. package/dist/client/assets/{content-C2TZOKSE.js → content-Ji7ATaf7.js} +1 -1
  152. package/dist/client/assets/content-eqZXKWcP.js +1 -0
  153. package/dist/client/assets/content-iyyQKwvA.js +1 -0
  154. package/dist/client/assets/content-pDE7Fpb9.js +1 -0
  155. package/dist/client/assets/content-pPSd2dua.js +1 -0
  156. package/dist/client/assets/{conversation-icons-DmC_Ak3z.js → conversation-icons-gpsv650H.js} +1 -1
  157. package/dist/client/assets/conversation-motion-features-DXtKlmuM.js +1 -0
  158. package/dist/client/assets/{copy-C79v_7D-.js → copy-BFmOcWof.js} +1 -1
  159. package/dist/client/assets/{createLucideIcon-DCq_3fQn.js → createLucideIcon-CFBn0Sdk.js} +1 -1
  160. package/dist/client/assets/{discover-IEnbrH8_.js → discover-DKf0aTr_.js} +2 -2
  161. package/dist/client/assets/embed-entry-RlQUTtc4.js +2 -0
  162. package/dist/client/assets/{external-link-Dd8xaveL.js → external-link-B1TI5yIt.js} +1 -1
  163. package/dist/client/assets/{eye-DkU59kfl.js → eye-1J4yOUoG.js} +1 -1
  164. package/dist/client/assets/{file-text-BITQqGtF.js → file-text-DcYSrI4v.js} +1 -1
  165. package/dist/client/assets/{gestures-B5rLNRpi.js → gestures-CcEOV6Sr.js} +1 -1
  166. package/dist/client/assets/{home-moving-signal-Bs635mVw.js → home-moving-signal-Bh2FugbH.js} +1 -1
  167. package/dist/client/assets/{home-now-card-VxlLjg1A.js → home-now-card-ByRH5fFx.js} +1 -1
  168. package/dist/client/assets/{home-now-card-nano-C06GMiwD.js → home-now-card-nano-y1EhBvVL.js} +1 -1
  169. package/dist/client/assets/{hooks-BWiLxTw1.js → hooks-DUZwL3Aq.js} +1 -1
  170. package/dist/client/assets/index-BBznYVWk.css +1 -0
  171. package/dist/client/assets/{index-BTj2MguM.js → index-BTuq-8Iv.js} +1 -1
  172. package/dist/client/assets/index-CmwGCxUk.js +1 -0
  173. package/dist/client/assets/{index-BZovGpDk.js → index-DmFAhGPj.js} +2 -2
  174. package/dist/client/assets/{index-vbaJ8sin.js → index-Dtaswdsh.js} +1 -1
  175. package/dist/client/assets/{inspector-panel-C96HcyK5.js → inspector-panel-DzgS5_Mv.js} +1 -1
  176. package/dist/client/assets/{keyboard-nav-CHo_xmjw.js → keyboard-nav-h1IdakpD.js} +1 -1
  177. package/dist/client/assets/{lane-roster-store-B6ybJlHJ.js → lane-roster-store-71vFgAem.js} +1 -1
  178. package/dist/client/assets/{left-DMJkmJOF.js → left-8NITBvFX.js} +1 -1
  179. package/dist/client/assets/{left-COMAiMfB.js → left-B2HEqrTM.js} +1 -1
  180. package/dist/client/assets/{left-C6Zj3cR4.js → left-CTYUvXbe.js} +1 -1
  181. package/dist/client/assets/{left-BuJ0wJW1.js → left-CwDRT50z.js} +1 -1
  182. package/dist/client/assets/{left-l92tw5Kc.js → left-CxlDLJlw.js} +1 -1
  183. package/dist/client/assets/{left-Ce4WKYPK.js → left-XFXxNd4g.js} +1 -1
  184. package/dist/client/assets/{left-agents-BuSyVNGE.js → left-agents-Ck4Xn-R8.js} +1 -1
  185. package/dist/client/assets/{left-default-DRHywOKX.js → left-default-BeOyS0bR.js} +1 -1
  186. package/dist/client/assets/{left-lanes-4-aUyyrV.js → left-lanes-DZp3jJMo.js} +1 -1
  187. package/dist/client/assets/{left-mission-e849d_Td.js → left-mission-CuKFQ5xL.js} +1 -1
  188. package/dist/client/assets/left-p1hkO6P0.js +1 -0
  189. package/dist/client/assets/{left-plan-MchYwAB_.js → left-plan-3rrFENhp.js} +1 -1
  190. package/dist/client/assets/{library-DygjpA6u.js → library-E--gKzEZ.js} +1 -1
  191. package/dist/client/assets/{loader-circle-B-l2Wj3-.js → loader-circle-d6PKL_KD.js} +1 -1
  192. package/dist/client/assets/{local-agents-Wof5knTJ.js → local-agents-B5pq17tZ.js} +1 -1
  193. package/dist/client/assets/{mentions-BjXfeF7t.js → mentions-agCGDgyA.js} +1 -1
  194. package/dist/client/assets/{mesh-ops-C1gq8zKf.js → mesh-ops-5pZCYptW.js} +1 -1
  195. package/dist/client/assets/{mesh-view-store-B56D3f77.js → mesh-view-store-KJzABIkN.js} +1 -1
  196. package/dist/client/assets/{message-circle-BwVx5X0q.js → message-circle-CJO-pi7b.js} +1 -1
  197. package/dist/client/assets/{message-markup-DlVX-iuc.js → message-markup-CyRDLdOn.js} +1 -1
  198. package/dist/client/assets/{message-square-BnkG6tae.js → message-square-D1hMsMj_.js} +1 -1
  199. package/dist/client/assets/{mission-control-store-CMgIVjLJ.js → mission-control-store-Ce6dOvnZ.js} +1 -1
  200. package/dist/client/assets/{observe-DVHAcIrv.js → observe-BSWVM8YA.js} +1 -1
  201. package/dist/client/assets/{page-status-Bg2hd27j.js → page-status-D2FQLJOX.js} +1 -1
  202. package/dist/client/assets/{paperclip-DblaLD_N.js → paperclip-iZmDMOS5.js} +1 -1
  203. package/dist/client/assets/{plus-BAI0t5g9.js → plus-gZ0T0eBI.js} +1 -1
  204. package/dist/client/assets/{profile-3Q4sUtvJ.js → profile-Dxj3VVOM.js} +1 -1
  205. package/dist/client/assets/{projects-inbox-Da2hYEn6.js → projects-inbox-Dzt_GQDv.js} +1 -1
  206. package/dist/client/assets/{radio-BGtkyCG9.js → radio-RMLfV4EO.js} +1 -1
  207. package/dist/client/assets/{refresh-cw-DtF8xPqX.js → refresh-cw-C4x1x6b_.js} +1 -1
  208. package/dist/client/assets/resolve-panes-C9gF0w4e.js +1 -0
  209. package/dist/client/assets/resolve-sidebar-context-DxbY5RCH.js +1 -0
  210. package/dist/client/assets/{right-Dd2DscRz.js → right-5L7Tn0zG.js} +1 -1
  211. package/dist/client/assets/{right-BU_W1kSH.js → right-CYtkMmRu.js} +1 -1
  212. package/dist/client/assets/{right-CUP-NIDG.js → right-CreoQzPP.js} +1 -1
  213. package/dist/client/assets/{right-c4PAdFYZ.js → right-D-k9Z1Fe.js} +1 -1
  214. package/dist/client/assets/{right-ByptvkVX.js → right-D9xFfy2b.js} +1 -1
  215. package/dist/client/assets/{right-BlR7h0US.js → right-DI7zHADe.js} +1 -1
  216. package/dist/client/assets/{right-BwgwTGGd.js → right-DUbJ3WVc.js} +1 -1
  217. package/dist/client/assets/{right-DmVHd8Xj.js → right-DiybhsiK.js} +1 -1
  218. package/dist/client/assets/{right-Ch_jrNe2.js → right-Jh_1Q88s.js} +1 -1
  219. package/dist/client/assets/{right-B8qg3JdB.js → right-udr1qTJG.js} +1 -1
  220. package/dist/client/assets/{rocket-BWh18pt_.js → rocket-CMM-IdLy.js} +1 -1
  221. package/dist/client/assets/{router-63XV_E7f.js → router-Cn_s9IGH.js} +1 -1
  222. package/dist/client/assets/{runtime-picker-BXKJbLot.js → runtime-picker--IW3cRry.js} +1 -1
  223. package/dist/client/assets/{scope-views-Dm2_-NPi.js → scope-views-BIfMTXU4.js} +1 -1
  224. package/dist/client/assets/{scout-voice-D8Q5sZOL.js → scout-voice-CwbOz6EN.js} +1 -1
  225. package/dist/client/assets/{scroll-text-DZb3mmYo.js → scroll-text-DPPYrqB9.js} +1 -1
  226. package/dist/client/assets/{search-1QMVOxF3.js → search-DAyagUtF.js} +1 -1
  227. package/dist/client/assets/{secondaryNavConfig-c0cz3MkJ.js → secondaryNavConfig-Dw3gS1jR.js} +1 -1
  228. package/dist/client/assets/{selection-bridge-O9C4kGfF.js → selection-bridge-BXw09aRF.js} +1 -1
  229. package/dist/client/assets/{send-horizontal-DbyEkGql.js → send-horizontal-IcG46D2M.js} +1 -1
  230. package/dist/client/assets/{server-Bncn9S7r.js → server-BySujhDV.js} +1 -1
  231. package/dist/client/assets/{session-catalog-DC6BlBBC.js → session-catalog-ClS9xf6i.js} +1 -1
  232. package/dist/client/assets/{session-table-BUPq9Viy.js → session-table-BdpHs1GN.js} +1 -1
  233. package/dist/client/assets/{sliders-horizontal-CMe8Bay1.js → sliders-horizontal-R5pWUUcH.js} +1 -1
  234. package/dist/client/assets/{sparkles-_7cTZsIH.js → sparkles-DJOBD_8l.js} +1 -1
  235. package/dist/client/assets/{sse-Bb0EOcU9.js → sse-CxXt4tqI.js} +1 -1
  236. package/dist/client/assets/{tail-events-C12pfUax.js → tail-events-BdvqZHLr.js} +1 -1
  237. package/dist/client/assets/{terminal-xGf_F3y7.js → terminal-DJPUp_Qn.js} +1 -1
  238. package/dist/client/assets/{terminal-relay-BgfVJXIL.js → terminal-relay-TffuSPGs.js} +1 -1
  239. package/dist/client/assets/{terminal-takeover--05EYhJm.js → terminal-takeover-BOFPRPjR.js} +1 -1
  240. package/dist/client/assets/{use-conversation-list-DWX02INv.js → use-conversation-list-C-dPcjQe.js} +1 -1
  241. package/dist/client/assets/{use-fleet-active-asks-Cnwa4hTK.js → use-fleet-active-asks-BHzeBZSW.js} +1 -1
  242. package/dist/client/assets/{use-mesh-ops-items-BRFm37oY.js → use-mesh-ops-items-KmaauBr_.js} +1 -1
  243. package/dist/client/assets/{use-reduced-motion-C8cWvIZ3.js → use-reduced-motion-CYqhYqHO.js} +1 -1
  244. package/dist/client/assets/{use-scout-dev-flags-FkMreOOb.js → use-scout-dev-flags-BJbw87PK.js} +1 -1
  245. package/dist/client/assets/{useAgentHoverCard-DvPZSJK3.js → useAgentHoverCard-C6o0tlat.js} +1 -1
  246. package/dist/client/assets/useContentSecondaryNav-DjHBrgnS.js +1 -0
  247. package/dist/client/assets/{usePierreRuntime-C8WJ0X3F.js → usePierreRuntime-Cm7-qdm0.js} +1 -1
  248. package/dist/client/assets/{wrench-_tHBGTop.js → wrench-CvRjjByE.js} +1 -1
  249. package/dist/client/assets/{x-CrGUKNRv.js → x-C8ayPBtj.js} +1 -1
  250. package/dist/client/assets/{xterm-Ks-VlLTq.js → xterm-B0ci4Q9a.js} +1 -1
  251. package/dist/client/index.html +2 -2
  252. package/dist/main.mjs +348 -254
  253. package/dist/scout-web-server.mjs +2 -96660
  254. package/package.json +3 -3
  255. package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +0 -1
  256. package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +0 -1
  257. package/dist/client/assets/OpsScreen-DHnT-Q9R.js +0 -1
  258. package/dist/client/assets/OpsSubnav-CJRD7MjM.js +0 -1
  259. package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +0 -1
  260. package/dist/client/assets/ProjectsScreen-jruZRjgD.js +0 -1
  261. package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +0 -2
  262. package/dist/client/assets/SessionsScreen-HAjFvmIq.js +0 -1
  263. package/dist/client/assets/content-BQuEedeL.js +0 -1
  264. package/dist/client/assets/content-BUae-L_N.js +0 -1
  265. package/dist/client/assets/content-BfG98J1k.js +0 -1
  266. package/dist/client/assets/content-BkVTfkAC.js +0 -1
  267. package/dist/client/assets/content-BsNMos_d.js +0 -1
  268. package/dist/client/assets/content-CCn98eSk.js +0 -1
  269. package/dist/client/assets/content-CYnPp9yo.js +0 -1
  270. package/dist/client/assets/content-CcrUhm4P.js +0 -1
  271. package/dist/client/assets/content-CxuVONeQ.js +0 -1
  272. package/dist/client/assets/content-Dmq9n1_L.js +0 -1
  273. package/dist/client/assets/content-DskHP2NI.js +0 -1
  274. package/dist/client/assets/content-DvvzL2HK.js +0 -1
  275. package/dist/client/assets/content-snCAUbwv.js +0 -1
  276. package/dist/client/assets/conversation-motion-features-DPiGTO21.js +0 -1
  277. package/dist/client/assets/embed-entry-XUPb-AzL.js +0 -2
  278. package/dist/client/assets/index-9as_JTUs.css +0 -1
  279. package/dist/client/assets/index-DiiEQwdc.js +0 -1
  280. package/dist/client/assets/left-DrCbY6ja.js +0 -1
  281. package/dist/client/assets/resolve-panes-D4tlKNCT.js +0 -1
  282. package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +0 -1
  283. package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +0 -1
@@ -1 +1 @@
1
- import{r as m,j as t}from"./index-BZovGpDk.js";import{u as re,L as W}from"./chunk-YOZR3KYS-oS9dlQCI.js";import{a as le,f as oe,b as ce,c as me,d as de,s as ue}from"./terminal-sessions-AmSgHklm.js";import{a as ve,b as pe,r as G,m as he}from"./keyboard-nav-CHo_xmjw.js";import{u as be}from"./Provider-p-xuaAoE.js";import{c as fe}from"./colors-BtO5_zlx.js";import{r as P,c as xe}from"./terminal-relay-BgfVJXIL.js";import{t as ye,a as H,s as je,b as y,P as ge}from"./session-table-BUPq9Viy.js";/* empty css */import{R as ke}from"./refresh-cw-DtF8xPqX.js";import{A as Ne}from"./activity-DS0u0Itf.js";import{C as we}from"./clock-C3TUL7D7.js";import{F as Se}from"./DocumentFocusViewer-CZVVIAD5.js";import{c as Ae}from"./createLucideIcon-DCq_3fQn.js";import{C as Ie}from"./chevron-right-CaEwYkxE.js";import{E as U}from"./eye-DkU59kfl.js";import{T as Ee}from"./terminal-xGf_F3y7.js";import"./arrow-down-DxxPnPwh.js";import"./api-h5zurxmi.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./TextDocumentSurface-BcP9vvji.js";import"./file-text-BITQqGtF.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-CrGUKNRv.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";/* empty css */const Te=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Ce=Ae("layers",Te),Re=[{id:"fleet",label:"Fleet",title:"Group by fleet: herdr, tmux, background"},{id:"places",label:"Places",title:"Group by project"},{id:"time",label:"Time",title:"Group by last activity"},{id:"attention",label:"Attention",title:"Group by attention state: attached, live, detached, exited"}],Me=[{id:"herdr",label:"Herdr"},{id:"tmux-named",label:"Tmux"},{id:"tmux-auto",label:"Tmux · auto"},{id:"external",label:"Background"}],Le=900*1e3,$e=1440*60*1e3,_e=10080*60*1e3,V=[{key:"now",label:"Now",maxAgeMs:Le},{key:"today",label:"Today",maxAgeMs:$e},{key:"week",label:"This week",maxAgeMs:_e},{key:"older",label:"Older",maxAgeMs:null},{key:"unknown",label:"Unknown",maxAgeMs:null}],Oe=[{key:"attached",label:"Attached",rank:3},{key:"live",label:"Live",rank:2},{key:"detached",label:"Detached",rank:1},{key:"exited",label:"Exited",rank:0}];function Fe(a){return Me.map(n=>({key:n.id,label:n.label,items:a.filter(l=>le(l)===n.id)})).filter(n=>n.items.length>0)}function Ke(a){const n=new Map;for(const i of a){const o=n.get(i.project);o?o.push(i):n.set(i.project,[i])}const l=new Set(["backend-only","unscoped"]),r=[...n.entries()].map(([i,o])=>({key:`project:${i}`,label:i,items:o,latestActivity:Math.max(...o.map(d=>H(d)??0)),isCatchAll:l.has(i)}));return r.sort((i,o)=>i.isCatchAll!==o.isCatchAll?i.isCatchAll?1:-1:i.latestActivity!==o.latestActivity?o.latestActivity-i.latestActivity:i.label.localeCompare(o.label,void 0,{numeric:!0,sensitivity:"base"})),r.map(({key:i,label:o,items:d})=>({key:i,label:o,items:d}))}function Be(a,n){const l=r=>{const i=H(r);if(i===null)return"unknown";const o=Math.max(0,n-i);for(const d of V)if(d.maxAgeMs!==null&&o<d.maxAgeMs)return d.key;return"older"};return V.map(r=>({key:r.key,label:r.label,items:a.filter(i=>l(i)===r.key)})).filter(r=>r.items.length>0)}function De(a){return Oe.map(n=>({key:n.key,label:n.label,items:a.filter(l=>ye(l)===n.rank)})).filter(n=>n.items.length>0)}function ze(a,n,l=Date.now()){switch(n){case"fleet":return Fe(a);case"places":return Ke(a);case"time":return Be(a,l);case"attention":return De(a)}}const We=8e3,Ge=[{id:"recent",label:"Recent"},{id:"name",label:"A–Z"}],Pe={fleet:Ce,places:Se,time:we,attention:Ne};function Gt(){const{route:a,navigate:n,agents:l}=be(),[r,i]=m.useState({state:"loading",sessions:[]}),[o,d]=m.useState(""),[f,Q]=m.useState("recent"),[A,Y]=re("terminal-nav-mode","fleet"),[Z,J]=m.useState(!1),[X,M]=m.useState(null),[L,$]=m.useState(null),_=m.useRef(null),O=m.useRef(null),ee=ve(),te=he(()=>O.current);pe(m.useCallback(()=>_.current,[]));const x=m.useCallback((e={})=>{e.silent||i(s=>({state:"loading",sessions:s.sessions})),oe({includeDiscovered:!0}).then(s=>{i({state:"ready",sessions:s})}).catch(s=>{e.silent||i(c=>({state:"failed",sessions:c.sessions,error:s instanceof Error?s.message:String(s)}))})},[]);m.useEffect(()=>{x()},[x]),m.useEffect(()=>{const e=()=>{document.visibilityState==="visible"&&x({silent:!0})},s=window.setInterval(e,We);return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.clearInterval(s),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[x]);const k=m.useMemo(()=>ce(r.sessions),[r.sessions]),p=m.useMemo(()=>je(me(k),f==="recent"?{column:"activity",direction:"desc"}:{column:"name",direction:"asc"}),[f,k]),j=m.useMemo(()=>Ue(l,f).filter(e=>{const s=P(e);return s?!k.some(c=>c.surface.backend===s.backend&&c.surface.sessionName===s.sessionName&&(s.paneId==null||c.surface.paneId===s.paneId)):!0}),[l,k,f]),u=o.trim().toLowerCase(),g=u?p.filter(e=>e.searchable.includes(u)):p,N=g.filter(e=>y(e)==="current"),ae=ze(N,A),w=g.filter(e=>y(e)==="inactive"),h=g.filter(e=>y(e)==="review"),F=u?w.length+h.length:p.filter(e=>y(e)!=="current").length,K=u?h.length:p.filter(e=>y(e)==="review").length,S=Z||!!u,v=u?j.filter(e=>qe(e).includes(u)):j,ne=a.view==="terminal"?a.terminalSurfaceKey??null:null,B=a.view==="terminal"?a.terminalSessionId??null:null,I=e=>de(e.key,ne)&&(!B||e.session.id===B),E=a.view==="terminal"&&a.agentId?`agent:${a.agentId}`:null,D=!!(N.some(I)||S&&[...w,...h].some(I)||E!=null&&v.some(e=>`agent:${e.id}`===E)),z=N[0]?.id??(S?w[0]?.id??h[0]?.id:void 0)??(v[0]?`agent:${v[0].id}`:void 0),se=r.state==="loading"?"Syncing":u?`${g.length+v.length}/${p.length+j.length}`:`${p.length+j.length} targets`,T=(e,s)=>({view:"terminal",terminalSessionId:e.session.id,terminalSurfaceKey:ue(e.surface),...s?{mode:s}:{}}),C=(e,s="takeover")=>({view:"terminal",agentId:e.id,mode:s}),ie=async e=>{if(e.surface.backend==="tmux"&&window.confirm(`Release inactive terminal ${e.surface.sessionName}? The tmux surface will stop, but any associated Scout agent remains available and can be started again.`)){M(e.id),$(null);try{await xe({backend:"tmux",sessionName:e.surface.sessionName,paneId:e.surface.paneId??null,socketDir:e.surface.socketDir??null},"release"),x({silent:!0})}catch(s){$(s instanceof Error?s.message:String(s))}finally{M(null)}}},R=e=>{const s=I(e),c=y(e),b=X===e.id;return t.jsxs("div",{className:`terminal-nav-row${s?" terminal-nav-row--active":""}${c==="review"?" terminal-nav-row--review":""}`,title:e.surface.sessionName,children:[t.jsxs("button",{type:"button","data-list-primary":!0,className:"terminal-nav-row-select",tabIndex:G(s,D,e.id===z),onClick:()=>n(T(e)),children:[t.jsx(Ee,{className:"terminal-nav-row-icon",size:14,strokeWidth:1.7}),t.jsxs("span",{className:"terminal-nav-row-main",children:[t.jsx("span",{className:"terminal-nav-row-title",children:t.jsx("span",{children:e.title})}),t.jsx("span",{className:"terminal-nav-row-detail",children:e.detail||e.session.sourceSessionId})]}),t.jsxs("span",{className:"terminal-nav-badges",children:[t.jsx("span",{className:"terminal-nav-badge terminal-nav-badge--backend",children:e.surface.backend}),t.jsx("span",{className:`terminal-nav-badge${c==="review"?" terminal-nav-badge--review":""}`,children:c==="current"?e.condition:c})]})]}),t.jsxs("div",{className:"terminal-nav-row-actions",children:[t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&s&&a.mode==="takeover"?" terminal-nav-action--selected":""}`,onClick:()=>n(T(e,"takeover")),title:"Enter this terminal","aria-label":"Enter this terminal",children:[t.jsx(W,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Enter"})]}),t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&s&&a.mode==="observe"?" terminal-nav-action--selected":""}`,onClick:()=>n(T(e,"observe")),title:"Observe this terminal read-only","aria-label":"Observe this terminal read-only",children:[t.jsx(U,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Observe"})]}),c==="review"&&e.surface.backend==="tmux"&&t.jsxs("button",{type:"button",className:"terminal-nav-action terminal-nav-action--release",onClick:()=>{ie(e)},disabled:b,title:"Release this inactive tmux surface; keep the agent","aria-label":"Release this inactive tmux surface; keep the agent",children:[t.jsx(ge,{size:12,strokeWidth:1.8}),t.jsx("span",{children:b?"Releasing":"Release"})]})]})]},e.id)};return t.jsxs("div",{className:"ctx-panel terminal-nav",children:[t.jsxs("div",{className:"terminal-nav-head",children:[t.jsxs("div",{children:[t.jsx("div",{className:"terminal-nav-title",children:"Terminals"}),t.jsx("div",{className:"terminal-nav-summary",children:se})]}),t.jsx("button",{type:"button",className:"terminal-nav-refresh",onClick:()=>x(),disabled:r.state==="loading",title:"Refresh terminals","aria-label":"Refresh terminals",children:t.jsx(ke,{size:14,strokeWidth:1.8})})]}),t.jsx("div",{className:"terminal-nav-modes",role:"group","aria-label":"Group terminals",children:Re.map(e=>{const s=Pe[e.id];return t.jsx("button",{type:"button",title:e.title,"aria-label":e.title,"aria-pressed":A===e.id,className:`terminal-nav-mode${A===e.id?" terminal-nav-mode--active":""}`,onClick:()=>Y(e.id),children:t.jsx(s,{size:13,strokeWidth:1.8})},e.id)})}),t.jsxs("div",{className:"ctx-panel-toolbar terminal-nav-toolbar",children:[t.jsx("input",{ref:_,type:"text",className:"ctx-panel-search-input",placeholder:"Search… (/)",value:o,onChange:e=>d(e.target.value),onKeyDown:te}),t.jsx("div",{className:"ctx-panel-sort",role:"group","aria-label":"Sort terminals",children:Ge.map(e=>t.jsx("button",{type:"button",title:e.id==="recent"?"Sort by most recent":"Sort alphabetically","aria-pressed":f===e.id,className:`ctx-panel-sort-option${f===e.id?" ctx-panel-sort-option--active":""}`,onClick:()=>Q(e.id),children:e.label},e.id))})]}),r.state==="failed"&&t.jsx("div",{className:"terminal-nav-error",children:r.error}),L&&t.jsx("div",{className:"terminal-nav-error",children:L}),t.jsx("div",{ref:O,className:"terminal-nav-list",onKeyDown:ee,children:g.length===0&&v.length===0&&r.state!=="loading"?t.jsx("div",{className:"ctx-panel-empty",children:p.length+j.length===0?"No terminal targets":"No matches"}):t.jsxs(t.Fragment,{children:[ae.map(e=>e.items.length===0?null:t.jsxs("div",{className:"terminal-nav-section",children:[t.jsxs("div",{className:"terminal-nav-section-title",children:[t.jsx("span",{children:e.label}),t.jsx("span",{children:e.items.length})]}),e.items.map(R)]},e.key)),N.length===0&&r.state!=="loading"&&t.jsx("div",{className:"terminal-nav-empty",children:"No sessions"}),F>0&&t.jsxs("div",{className:"terminal-nav-section terminal-nav-section--inactive",children:[t.jsxs("button",{type:"button",className:"terminal-nav-inactive-toggle","aria-expanded":S,onClick:()=>J(e=>!e),children:[t.jsx(Ie,{size:13,strokeWidth:1.8}),t.jsx("span",{children:"Inactive"}),t.jsx("span",{children:F}),K>0&&t.jsxs("span",{className:"terminal-nav-review-count",children:[K," review"]})]}),S&&t.jsxs(t.Fragment,{children:[w.map(R),h.length>0&&t.jsxs("div",{className:"terminal-nav-section-title terminal-nav-section-title--review",children:[t.jsx("span",{children:"Review after 30 days"}),t.jsx("span",{children:h.length})]}),h.map(R)]})]}),t.jsxs("div",{className:"terminal-nav-section",children:[t.jsxs("div",{className:"terminal-nav-section-title",children:[t.jsx("span",{children:"Available agents"}),t.jsx("span",{children:v.length})]}),v.map(e=>{const s=`agent:${e.id}`,c=s===E,b=P(e);return t.jsxs("div",{className:`terminal-nav-row terminal-nav-row--agent${c?" terminal-nav-row--active":""}`,title:e.name,children:[t.jsxs("button",{type:"button","data-list-primary":!0,className:"terminal-nav-row-select",tabIndex:G(c,D,s===z),onClick:()=>n(C(e)),children:[t.jsx("span",{className:`terminal-nav-agent-dot${b?" terminal-nav-agent-dot--bound":""}`,"aria-hidden":!0}),t.jsxs("span",{className:"terminal-nav-row-main",children:[t.jsx("span",{className:"terminal-nav-row-title",children:t.jsx("span",{children:e.name})}),t.jsx("span",{className:"terminal-nav-row-detail",children:Ve(e)})]}),t.jsxs("span",{className:"terminal-nav-badges",children:[t.jsx("span",{className:"terminal-nav-badge terminal-nav-badge--backend",children:b?.backend??e.harness??"agent"}),t.jsx("span",{className:"terminal-nav-badge",children:b?"bound":fe(e.state)})]})]}),t.jsxs("div",{className:"terminal-nav-row-actions",children:[t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&c&&a.mode==="takeover"?" terminal-nav-action--selected":""}`,onClick:()=>n(C(e,"takeover")),title:"Enter this agent terminal","aria-label":"Enter this agent terminal",children:[t.jsx(W,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Enter"})]}),b&&t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&c&&a.mode==="observe"?" terminal-nav-action--selected":""}`,onClick:()=>n(C(e,"observe")),title:"Observe this agent terminal read-only","aria-label":"Observe this agent terminal read-only",children:[t.jsx(U,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Observe"})]})]})]},e.id)}),v.length===0&&t.jsx("div",{className:"terminal-nav-empty",children:"No agents"})]})]})})]})}function Ue(a,n){return[...a].filter(l=>!l.retiredFromFleet&&!l.staleLocalRegistration).sort((l,r)=>{const i=l.name.localeCompare(r.name,void 0,{numeric:!0,sensitivity:"base"});return n==="name"?i||l.id.localeCompare(r.id):(r.updatedAt??0)-(l.updatedAt??0)||i||l.id.localeCompare(r.id)})}function Ve(a){const n=a.project??q(a.cwd)??q(a.projectRoot)??a.definitionId;return[a.handle?`@${a.handle}`:null,a.harness,n,a.branch].filter(Boolean).join(" · ")}function qe(a){return[a.name,a.handle,a.harness,a.state,a.project,a.branch,a.cwd,a.projectRoot,a.definitionId].filter(Boolean).join(" ").toLowerCase()}function q(a){const n=a?.trim().replace(/\/+$/u,"");return n?n.split("/").pop()||n:null}export{Gt as TerminalLeft};
1
+ import{r as m,j as t}from"./index-DmFAhGPj.js";import{u as re,L as W}from"./chunk-YOZR3KYS-C13bZPVd.js";import{a as le,f as oe,b as ce,c as me,d as de,s as ue}from"./terminal-sessions-AmSgHklm.js";import{a as ve,b as pe,r as G,m as he}from"./keyboard-nav-h1IdakpD.js";import{u as be}from"./Provider-cJCdHAxu.js";import{c as fe}from"./colors-BtO5_zlx.js";import{r as P,c as xe}from"./terminal-relay-TffuSPGs.js";import{t as ye,a as H,s as je,b as y,P as ge}from"./session-table-BdpHs1GN.js";/* empty css */import{R as ke}from"./refresh-cw-C4x1x6b_.js";import{A as Ne}from"./activity-CC8JzJNH.js";import{C as we}from"./clock-B9ukVaVn.js";import{F as Se}from"./DocumentFocusViewer-B9vodVmG.js";import{c as Ae}from"./createLucideIcon-CFBn0Sdk.js";import{C as Ie}from"./chevron-right-BYMV1511.js";import{E as U}from"./eye-1J4yOUoG.js";import{T as Ee}from"./terminal-DJPUp_Qn.js";import"./arrow-down-w1HPzDSE.js";import"./api-h5zurxmi.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./TextDocumentSurface-BWJCGBZf.js";import"./file-text-DcYSrI4v.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-C8ayPBtj.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";/* empty css */const Te=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Ce=Ae("layers",Te),Re=[{id:"fleet",label:"Fleet",title:"Group by fleet: herdr, tmux, background"},{id:"places",label:"Places",title:"Group by project"},{id:"time",label:"Time",title:"Group by last activity"},{id:"attention",label:"Attention",title:"Group by attention state: attached, live, detached, exited"}],Me=[{id:"herdr",label:"Herdr"},{id:"tmux-named",label:"Tmux"},{id:"tmux-auto",label:"Tmux · auto"},{id:"external",label:"Background"}],Le=900*1e3,$e=1440*60*1e3,_e=10080*60*1e3,V=[{key:"now",label:"Now",maxAgeMs:Le},{key:"today",label:"Today",maxAgeMs:$e},{key:"week",label:"This week",maxAgeMs:_e},{key:"older",label:"Older",maxAgeMs:null},{key:"unknown",label:"Unknown",maxAgeMs:null}],Oe=[{key:"attached",label:"Attached",rank:3},{key:"live",label:"Live",rank:2},{key:"detached",label:"Detached",rank:1},{key:"exited",label:"Exited",rank:0}];function Fe(a){return Me.map(n=>({key:n.id,label:n.label,items:a.filter(l=>le(l)===n.id)})).filter(n=>n.items.length>0)}function Ke(a){const n=new Map;for(const i of a){const o=n.get(i.project);o?o.push(i):n.set(i.project,[i])}const l=new Set(["backend-only","unscoped"]),r=[...n.entries()].map(([i,o])=>({key:`project:${i}`,label:i,items:o,latestActivity:Math.max(...o.map(d=>H(d)??0)),isCatchAll:l.has(i)}));return r.sort((i,o)=>i.isCatchAll!==o.isCatchAll?i.isCatchAll?1:-1:i.latestActivity!==o.latestActivity?o.latestActivity-i.latestActivity:i.label.localeCompare(o.label,void 0,{numeric:!0,sensitivity:"base"})),r.map(({key:i,label:o,items:d})=>({key:i,label:o,items:d}))}function Be(a,n){const l=r=>{const i=H(r);if(i===null)return"unknown";const o=Math.max(0,n-i);for(const d of V)if(d.maxAgeMs!==null&&o<d.maxAgeMs)return d.key;return"older"};return V.map(r=>({key:r.key,label:r.label,items:a.filter(i=>l(i)===r.key)})).filter(r=>r.items.length>0)}function De(a){return Oe.map(n=>({key:n.key,label:n.label,items:a.filter(l=>ye(l)===n.rank)})).filter(n=>n.items.length>0)}function ze(a,n,l=Date.now()){switch(n){case"fleet":return Fe(a);case"places":return Ke(a);case"time":return Be(a,l);case"attention":return De(a)}}const We=8e3,Ge=[{id:"recent",label:"Recent"},{id:"name",label:"A–Z"}],Pe={fleet:Ce,places:Se,time:we,attention:Ne};function Gt(){const{route:a,navigate:n,agents:l}=be(),[r,i]=m.useState({state:"loading",sessions:[]}),[o,d]=m.useState(""),[f,Q]=m.useState("recent"),[A,Y]=re("terminal-nav-mode","fleet"),[Z,J]=m.useState(!1),[X,M]=m.useState(null),[L,$]=m.useState(null),_=m.useRef(null),O=m.useRef(null),ee=ve(),te=he(()=>O.current);pe(m.useCallback(()=>_.current,[]));const x=m.useCallback((e={})=>{e.silent||i(s=>({state:"loading",sessions:s.sessions})),oe({includeDiscovered:!0}).then(s=>{i({state:"ready",sessions:s})}).catch(s=>{e.silent||i(c=>({state:"failed",sessions:c.sessions,error:s instanceof Error?s.message:String(s)}))})},[]);m.useEffect(()=>{x()},[x]),m.useEffect(()=>{const e=()=>{document.visibilityState==="visible"&&x({silent:!0})},s=window.setInterval(e,We);return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.clearInterval(s),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[x]);const k=m.useMemo(()=>ce(r.sessions),[r.sessions]),p=m.useMemo(()=>je(me(k),f==="recent"?{column:"activity",direction:"desc"}:{column:"name",direction:"asc"}),[f,k]),j=m.useMemo(()=>Ue(l,f).filter(e=>{const s=P(e);return s?!k.some(c=>c.surface.backend===s.backend&&c.surface.sessionName===s.sessionName&&(s.paneId==null||c.surface.paneId===s.paneId)):!0}),[l,k,f]),u=o.trim().toLowerCase(),g=u?p.filter(e=>e.searchable.includes(u)):p,N=g.filter(e=>y(e)==="current"),ae=ze(N,A),w=g.filter(e=>y(e)==="inactive"),h=g.filter(e=>y(e)==="review"),F=u?w.length+h.length:p.filter(e=>y(e)!=="current").length,K=u?h.length:p.filter(e=>y(e)==="review").length,S=Z||!!u,v=u?j.filter(e=>qe(e).includes(u)):j,ne=a.view==="terminal"?a.terminalSurfaceKey??null:null,B=a.view==="terminal"?a.terminalSessionId??null:null,I=e=>de(e.key,ne)&&(!B||e.session.id===B),E=a.view==="terminal"&&a.agentId?`agent:${a.agentId}`:null,D=!!(N.some(I)||S&&[...w,...h].some(I)||E!=null&&v.some(e=>`agent:${e.id}`===E)),z=N[0]?.id??(S?w[0]?.id??h[0]?.id:void 0)??(v[0]?`agent:${v[0].id}`:void 0),se=r.state==="loading"?"Syncing":u?`${g.length+v.length}/${p.length+j.length}`:`${p.length+j.length} targets`,T=(e,s)=>({view:"terminal",terminalSessionId:e.session.id,terminalSurfaceKey:ue(e.surface),...s?{mode:s}:{}}),C=(e,s="takeover")=>({view:"terminal",agentId:e.id,mode:s}),ie=async e=>{if(e.surface.backend==="tmux"&&window.confirm(`Release inactive terminal ${e.surface.sessionName}? The tmux surface will stop, but any associated Scout agent remains available and can be started again.`)){M(e.id),$(null);try{await xe({backend:"tmux",sessionName:e.surface.sessionName,paneId:e.surface.paneId??null,socketDir:e.surface.socketDir??null},"release"),x({silent:!0})}catch(s){$(s instanceof Error?s.message:String(s))}finally{M(null)}}},R=e=>{const s=I(e),c=y(e),b=X===e.id;return t.jsxs("div",{className:`terminal-nav-row${s?" terminal-nav-row--active":""}${c==="review"?" terminal-nav-row--review":""}`,title:e.surface.sessionName,children:[t.jsxs("button",{type:"button","data-list-primary":!0,className:"terminal-nav-row-select",tabIndex:G(s,D,e.id===z),onClick:()=>n(T(e)),children:[t.jsx(Ee,{className:"terminal-nav-row-icon",size:14,strokeWidth:1.7}),t.jsxs("span",{className:"terminal-nav-row-main",children:[t.jsx("span",{className:"terminal-nav-row-title",children:t.jsx("span",{children:e.title})}),t.jsx("span",{className:"terminal-nav-row-detail",children:e.detail||e.session.sourceSessionId})]}),t.jsxs("span",{className:"terminal-nav-badges",children:[t.jsx("span",{className:"terminal-nav-badge terminal-nav-badge--backend",children:e.surface.backend}),t.jsx("span",{className:`terminal-nav-badge${c==="review"?" terminal-nav-badge--review":""}`,children:c==="current"?e.condition:c})]})]}),t.jsxs("div",{className:"terminal-nav-row-actions",children:[t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&s&&a.mode==="takeover"?" terminal-nav-action--selected":""}`,onClick:()=>n(T(e,"takeover")),title:"Enter this terminal","aria-label":"Enter this terminal",children:[t.jsx(W,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Enter"})]}),t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&s&&a.mode==="observe"?" terminal-nav-action--selected":""}`,onClick:()=>n(T(e,"observe")),title:"Observe this terminal read-only","aria-label":"Observe this terminal read-only",children:[t.jsx(U,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Observe"})]}),c==="review"&&e.surface.backend==="tmux"&&t.jsxs("button",{type:"button",className:"terminal-nav-action terminal-nav-action--release",onClick:()=>{ie(e)},disabled:b,title:"Release this inactive tmux surface; keep the agent","aria-label":"Release this inactive tmux surface; keep the agent",children:[t.jsx(ge,{size:12,strokeWidth:1.8}),t.jsx("span",{children:b?"Releasing":"Release"})]})]})]},e.id)};return t.jsxs("div",{className:"ctx-panel terminal-nav",children:[t.jsxs("div",{className:"terminal-nav-head",children:[t.jsxs("div",{children:[t.jsx("div",{className:"terminal-nav-title",children:"Terminals"}),t.jsx("div",{className:"terminal-nav-summary",children:se})]}),t.jsx("button",{type:"button",className:"terminal-nav-refresh",onClick:()=>x(),disabled:r.state==="loading",title:"Refresh terminals","aria-label":"Refresh terminals",children:t.jsx(ke,{size:14,strokeWidth:1.8})})]}),t.jsx("div",{className:"terminal-nav-modes",role:"group","aria-label":"Group terminals",children:Re.map(e=>{const s=Pe[e.id];return t.jsx("button",{type:"button",title:e.title,"aria-label":e.title,"aria-pressed":A===e.id,className:`terminal-nav-mode${A===e.id?" terminal-nav-mode--active":""}`,onClick:()=>Y(e.id),children:t.jsx(s,{size:13,strokeWidth:1.8})},e.id)})}),t.jsxs("div",{className:"ctx-panel-toolbar terminal-nav-toolbar",children:[t.jsx("input",{ref:_,type:"text",className:"ctx-panel-search-input",placeholder:"Search… (/)",value:o,onChange:e=>d(e.target.value),onKeyDown:te}),t.jsx("div",{className:"ctx-panel-sort",role:"group","aria-label":"Sort terminals",children:Ge.map(e=>t.jsx("button",{type:"button",title:e.id==="recent"?"Sort by most recent":"Sort alphabetically","aria-pressed":f===e.id,className:`ctx-panel-sort-option${f===e.id?" ctx-panel-sort-option--active":""}`,onClick:()=>Q(e.id),children:e.label},e.id))})]}),r.state==="failed"&&t.jsx("div",{className:"terminal-nav-error",children:r.error}),L&&t.jsx("div",{className:"terminal-nav-error",children:L}),t.jsx("div",{ref:O,className:"terminal-nav-list",onKeyDown:ee,children:g.length===0&&v.length===0&&r.state!=="loading"?t.jsx("div",{className:"ctx-panel-empty",children:p.length+j.length===0?"No terminal targets":"No matches"}):t.jsxs(t.Fragment,{children:[ae.map(e=>e.items.length===0?null:t.jsxs("div",{className:"terminal-nav-section",children:[t.jsxs("div",{className:"terminal-nav-section-title",children:[t.jsx("span",{children:e.label}),t.jsx("span",{children:e.items.length})]}),e.items.map(R)]},e.key)),N.length===0&&r.state!=="loading"&&t.jsx("div",{className:"terminal-nav-empty",children:"No sessions"}),F>0&&t.jsxs("div",{className:"terminal-nav-section terminal-nav-section--inactive",children:[t.jsxs("button",{type:"button",className:"terminal-nav-inactive-toggle","aria-expanded":S,onClick:()=>J(e=>!e),children:[t.jsx(Ie,{size:13,strokeWidth:1.8}),t.jsx("span",{children:"Inactive"}),t.jsx("span",{children:F}),K>0&&t.jsxs("span",{className:"terminal-nav-review-count",children:[K," review"]})]}),S&&t.jsxs(t.Fragment,{children:[w.map(R),h.length>0&&t.jsxs("div",{className:"terminal-nav-section-title terminal-nav-section-title--review",children:[t.jsx("span",{children:"Review after 30 days"}),t.jsx("span",{children:h.length})]}),h.map(R)]})]}),t.jsxs("div",{className:"terminal-nav-section",children:[t.jsxs("div",{className:"terminal-nav-section-title",children:[t.jsx("span",{children:"Available agents"}),t.jsx("span",{children:v.length})]}),v.map(e=>{const s=`agent:${e.id}`,c=s===E,b=P(e);return t.jsxs("div",{className:`terminal-nav-row terminal-nav-row--agent${c?" terminal-nav-row--active":""}`,title:e.name,children:[t.jsxs("button",{type:"button","data-list-primary":!0,className:"terminal-nav-row-select",tabIndex:G(c,D,s===z),onClick:()=>n(C(e)),children:[t.jsx("span",{className:`terminal-nav-agent-dot${b?" terminal-nav-agent-dot--bound":""}`,"aria-hidden":!0}),t.jsxs("span",{className:"terminal-nav-row-main",children:[t.jsx("span",{className:"terminal-nav-row-title",children:t.jsx("span",{children:e.name})}),t.jsx("span",{className:"terminal-nav-row-detail",children:Ve(e)})]}),t.jsxs("span",{className:"terminal-nav-badges",children:[t.jsx("span",{className:"terminal-nav-badge terminal-nav-badge--backend",children:b?.backend??e.harness??"agent"}),t.jsx("span",{className:"terminal-nav-badge",children:b?"bound":fe(e.state)})]})]}),t.jsxs("div",{className:"terminal-nav-row-actions",children:[t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&c&&a.mode==="takeover"?" terminal-nav-action--selected":""}`,onClick:()=>n(C(e,"takeover")),title:"Enter this agent terminal","aria-label":"Enter this agent terminal",children:[t.jsx(W,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Enter"})]}),b&&t.jsxs("button",{type:"button",className:`terminal-nav-action${a.view==="terminal"&&c&&a.mode==="observe"?" terminal-nav-action--selected":""}`,onClick:()=>n(C(e,"observe")),title:"Observe this agent terminal read-only","aria-label":"Observe this agent terminal read-only",children:[t.jsx(U,{size:12,strokeWidth:1.8}),t.jsx("span",{children:"Observe"})]})]})]},e.id)}),v.length===0&&t.jsx("div",{className:"terminal-nav-empty",children:"No agents"})]})]})})]})}function Ue(a,n){return[...a].filter(l=>!l.retiredFromFleet&&!l.staleLocalRegistration).sort((l,r)=>{const i=l.name.localeCompare(r.name,void 0,{numeric:!0,sensitivity:"base"});return n==="name"?i||l.id.localeCompare(r.id):(r.updatedAt??0)-(l.updatedAt??0)||i||l.id.localeCompare(r.id)})}function Ve(a){const n=a.project??q(a.cwd)??q(a.projectRoot)??a.definitionId;return[a.handle?`@${a.handle}`:null,a.harness,n,a.branch].filter(Boolean).join(" · ")}function qe(a){return[a.name,a.handle,a.harness,a.state,a.project,a.branch,a.cwd,a.projectRoot,a.definitionId].filter(Boolean).join(" ").toLowerCase()}function q(a){const n=a?.trim().replace(/\/+$/u,"");return n?n.split("/").pop()||n:null}export{Gt as TerminalLeft};
@@ -1,2 +1,2 @@
1
- import{r,j as e}from"./index-BZovGpDk.js";/* empty css */import{n as k}from"./colors-BtO5_zlx.js";import{p as C,a as L}from"./api-h5zurxmi.js";import{u as F,m as $,e as D,h as H}from"./Provider-p-xuaAoE.js";import{b as O}from"./router-63XV_E7f.js";import{d as B,a as G}from"./operator-attention-BwSPeheT.js";import{u as K}from"./sse-Bb0EOcU9.js";import{t as f}from"./time-Dhsh_2EG.js";import{o as P}from"./openAgent-Dbv5wfuL.js";import{R as v}from"./RailRow-bRkkXIpR.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";const U=new Set(["message.posted","flight.updated","collaboration.event.appended","agent.updated"]),V=4,z=4,Q=3,N="/api/fleet",X=3e4;function Xt({prepend:t}){const{agents:o,agentsLoaded:a,navigate:c,route:n}=F(),[i]=r.useState(()=>C(N,X)),[l,E]=r.useState(i),[A,T]=r.useState(i!==null),[j,b]=r.useState(()=>new Set),p=O(n),I=r.useMemo(()=>$(o,p),[o,p]),m=r.useMemo(()=>D(o,p),[o,p]),u=r.useMemo(()=>H(l,I),[l,I]),d=r.useCallback(async()=>{try{E(await L(N))}catch{}finally{T(!0)}},[]);r.useEffect(()=>{d()},[d]),K(s=>{U.has(s.kind)&&d()});const w=r.useMemo(()=>Z(m).slice(0,V),[m]),R=r.useMemo(()=>(u?.activity??[]).slice(0,z),[u]),_=r.useMemo(()=>(u?.needsAttention??[]).filter(s=>!j.has(s.recordId)).slice(0,Q),[u,j]),M=r.useCallback(async s=>{b(h=>new Set(h).add(s.recordId));try{await B({recordKind:s.kind,recordId:s.recordId,itemUpdatedAt:s.updatedAt})}catch{b(h=>{const S=new Set(h);return S.delete(s.recordId),S});return}d()},[d]);return e.jsxs("div",{className:"ctx-panel base-rail",children:[t?e.jsx("div",{className:"base-rail-prepend",children:t}):null,e.jsx(Y,{agents:w,totalCount:m.length,loading:!a,onSelect:s=>P(c,s,{returnTo:n}),onSeeAll:()=>c({view:"agents-v2"})}),e.jsx(J,{items:R,loading:!A,onSelect:s=>c(tt(s)),onSeeAll:()=>c({view:"activity"})}),e.jsx(W,{items:_,loading:!A,onSelect:s=>c(G(s)),onDismiss:s=>{M(s)}})]})}function Y({agents:t,totalCount:o,loading:a,onSelect:c,onSeeAll:n}){return e.jsxs("section",{className:"ctx-panel-section base-rail-section",children:[e.jsx(g,{title:"Recent agents",onSeeAll:o>0?n:void 0}),a?e.jsx(x,{}):t.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"No agents yet"}):t.map(i=>e.jsx(v,{name:i.name||i.id,meta:i.updatedAt?f(i.updatedAt):void 0,tone:k(i.state),title:q(i),onClick:()=>c(i)},i.id))]})}function q(t){const o=[];return t.project&&o.push(`project: ${t.project}`),t.branch&&o.push(`branch: ${t.branch}`),t.harness&&o.push(`harness: ${t.harness}`),o.join(`
1
+ import{r,j as e}from"./index-DmFAhGPj.js";/* empty css */import{n as k}from"./colors-BtO5_zlx.js";import{p as C,a as L}from"./api-h5zurxmi.js";import{u as F,m as $,e as D,h as H}from"./Provider-cJCdHAxu.js";import{b as O}from"./router-Cn_s9IGH.js";import{d as B,a as G}from"./operator-attention-BwSPeheT.js";import{u as K}from"./sse-CxXt4tqI.js";import{t as f}from"./time-Dhsh_2EG.js";import{o as P}from"./openAgent-Dbv5wfuL.js";import{R as v}from"./RailRow-CLcVmywd.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";const U=new Set(["message.posted","flight.updated","collaboration.event.appended","agent.updated"]),V=4,z=4,Q=3,N="/api/fleet",X=3e4;function Xt({prepend:t}){const{agents:o,agentsLoaded:a,navigate:c,route:n}=F(),[i]=r.useState(()=>C(N,X)),[l,E]=r.useState(i),[A,T]=r.useState(i!==null),[j,b]=r.useState(()=>new Set),p=O(n),I=r.useMemo(()=>$(o,p),[o,p]),m=r.useMemo(()=>D(o,p),[o,p]),u=r.useMemo(()=>H(l,I),[l,I]),d=r.useCallback(async()=>{try{E(await L(N))}catch{}finally{T(!0)}},[]);r.useEffect(()=>{d()},[d]),K(s=>{U.has(s.kind)&&d()});const w=r.useMemo(()=>Z(m).slice(0,V),[m]),R=r.useMemo(()=>(u?.activity??[]).slice(0,z),[u]),_=r.useMemo(()=>(u?.needsAttention??[]).filter(s=>!j.has(s.recordId)).slice(0,Q),[u,j]),M=r.useCallback(async s=>{b(h=>new Set(h).add(s.recordId));try{await B({recordKind:s.kind,recordId:s.recordId,itemUpdatedAt:s.updatedAt})}catch{b(h=>{const S=new Set(h);return S.delete(s.recordId),S});return}d()},[d]);return e.jsxs("div",{className:"ctx-panel base-rail",children:[t?e.jsx("div",{className:"base-rail-prepend",children:t}):null,e.jsx(Y,{agents:w,totalCount:m.length,loading:!a,onSelect:s=>P(c,s,{returnTo:n}),onSeeAll:()=>c({view:"agents-v2"})}),e.jsx(J,{items:R,loading:!A,onSelect:s=>c(tt(s)),onSeeAll:()=>c({view:"activity"})}),e.jsx(W,{items:_,loading:!A,onSelect:s=>c(G(s)),onDismiss:s=>{M(s)}})]})}function Y({agents:t,totalCount:o,loading:a,onSelect:c,onSeeAll:n}){return e.jsxs("section",{className:"ctx-panel-section base-rail-section",children:[e.jsx(g,{title:"Recent agents",onSeeAll:o>0?n:void 0}),a?e.jsx(x,{}):t.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"No agents yet"}):t.map(i=>e.jsx(v,{name:i.name||i.id,meta:i.updatedAt?f(i.updatedAt):void 0,tone:k(i.state),title:q(i),onClick:()=>c(i)},i.id))]})}function q(t){const o=[];return t.project&&o.push(`project: ${t.project}`),t.branch&&o.push(`branch: ${t.branch}`),t.harness&&o.push(`harness: ${t.harness}`),o.join(`
2
2
  `)}function J({items:t,loading:o,onSelect:a,onSeeAll:c}){return e.jsxs("section",{className:"ctx-panel-section base-rail-section",children:[e.jsx(g,{title:"Recent activity",meta:(t.length>0,void 0),onSeeAll:t.length>0?c:void 0}),o?e.jsx(x,{}):t.length===0?e.jsx("div",{className:"ctx-panel-empty",children:"Quiet so far"}):t.map(n=>{const i=n.actorName??n.agentName??n.agentId??"system",l=n.title??n.summary??y(n.kind);return e.jsx(v,{name:l,meta:n.ts?f(n.ts):void 0,tone:"neutral",title:`${i} · ${y(n.kind)}`,onClick:()=>a(n)},n.id)})]})}function W({items:t,loading:o,onSelect:a,onDismiss:c}){return!o&&t.length===0?null:e.jsxs("section",{className:"ctx-panel-section base-rail-section",children:[e.jsx(g,{title:"Needs attention",meta:t.length>0?`${t.length}`:void 0}),o?e.jsx(x,{rows:2}):t.map(n=>{const i=n.agentName??n.agentId??"operator";return e.jsx(v,{name:n.title,meta:f(n.updatedAt),tone:"in_turn",unread:!0,title:`${i} · ${n.kind}`,onClick:()=>a(n),actions:e.jsx("button",{type:"button",className:"rr-row-action",title:"Dismiss — stop asking until this changes","aria-label":"Dismiss",onClick:l=>{l.stopPropagation(),c(n)},children:"Dismiss"})},n.recordId)})]})}function x({rows:t=3}){return e.jsx("div",{className:"base-rail-loading",role:"status","aria-label":"Loading",children:Array.from({length:t},(o,a)=>e.jsx("span",{"aria-hidden":"true"},a))})}function g({title:t,meta:o,onSeeAll:a}){return e.jsxs("div",{className:"ctx-panel-section-label base-rail-section-label",children:[e.jsx("span",{children:t}),e.jsxs("span",{className:"base-rail-section-trailing",children:[o?e.jsx("span",{className:"ctx-panel-count",children:o}):null,a?e.jsx("button",{type:"button",className:"base-rail-see-all",onClick:a,children:"all"}):null]})]})}function Z(t){return[...t].sort((o,a)=>(a.updatedAt??0)-(o.updatedAt??0))}function y(t){switch(t){case"message":return"Message";case"invocation":return"Invocation";case"flight":return"Flight update";case"collaboration":return"Collaboration";default:return t.replace(/_/g," ")}}function tt(t){return t.conversationId?{view:"conversation",conversationId:t.conversationId}:t.agentId?{view:"agents-v2",agentId:t.agentId}:{view:"activity"}}export{Xt as HomeLeft};
@@ -1 +1 @@
1
- import{r,j as t}from"./index-BZovGpDk.js";/* empty css */import"./NewChatComposer-DKlNX1UA.js";import{u as k,e as w}from"./Provider-p-xuaAoE.js";import{A as S}from"./AgentAvatar-CneOa70z.js";import{a as g}from"./api-h5zurxmi.js";import{b as y}from"./router-63XV_E7f.js";import{u as M}from"./sse-Bb0EOcU9.js";import{o as A,i as j}from"./surface-activity-B1rgWB1i.js";import{d as N,c as b,e as I,f as C,g as B,h as P}from"./model-Co0zkMIc.js";import"./runtime-picker-BXKJbLot.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./keyboard-nav-CHo_xmjw.js";import"./x-CrGUKNRv.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./file-text-BITQqGtF.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./text-DsBWV_4k.js";function W(){const{agents:n,route:d}=k(),m=y(d),l=r.useMemo(()=>w(n,m),[n,m]),[u,h]=r.useState([]),[v,s]=r.useState(null),[a,p]=r.useState(null),c=r.useCallback(async()=>{const[e,i,o]=await Promise.allSettled([g("/api/conversations"),g("/api/fleet"),g("/api/tail/discover")]);e.status==="fulfilled"&&h(e.value),i.status==="fulfilled"&&s(i.value),o.status==="fulfilled"&&p(o.value)},[]);r.useEffect(()=>{c()},[c]),r.useEffect(()=>{const e=()=>{j()&&c()},i=window.setInterval(e,1e4),o=A(e);return()=>{window.clearInterval(i),o()}},[c]),M(()=>{j()&&c()});const x=r.useMemo(()=>{const e=new Map;for(const i of v?.activeAsks??[]){const o=e.get(i.agentId)??[];o.push(i),e.set(i.agentId,o)}return e},[v?.activeAsks]);return{projects:r.useMemo(()=>{const{sessionByAgentId:e}=N(u),i=l.map(f=>b(f,e.get(f.id)??null,x.get(f.id)??[])),o=I(a,Date.now());return C(i,u,o)},[l,u,x,a])}}function Nt(){const{route:n,navigate:d,openContextCapture:m}=k(),{projects:l}=W(),u=n.view==="agents-v2"?n.projectSlug:void 0,h=n.view==="agents-v2"?n.agentId:void 0,v=u??l[0]?.slice.slug;return t.jsxs("div",{className:"ctx-panel s-agents-rail",children:[t.jsx("div",{className:"s-agents-recent s-rail-projects",children:l.length===0?t.jsx("div",{className:"ctx-panel-empty",children:"No projects yet"}):l.map(s=>{const a=B(s),p=P(s),c=s.slice.slug===v&&!h;return t.jsxs("button",{type:"button",className:"s-rail-proj","data-selected":c||void 0,"data-live":a>0||void 0,"data-needs":p||void 0,title:s.slice.root??void 0,onClick:()=>d({view:"agents-v2",projectSlug:s.slice.slug}),children:[t.jsx(S,{name:s.slice.title,size:22,tile:!0,presence:!1}),t.jsxs("span",{className:"s-rail-proj-name","data-idle":a===0||void 0,children:[t.jsx("span",{"aria-hidden":!0,style:{opacity:.4},children:"/"}),s.slice.title]}),a>0?t.jsx("span",{className:"s-rail-proj-count","data-needs":p||void 0,title:p?"needs you":void 0,children:a}):null]},s.slice.key)})}),t.jsxs("div",{className:"s-agents-foot s-rail-foot-icons",children:[t.jsx("button",{type:"button",className:"s-rail-icon",title:"Search","aria-label":"Search",onClick:()=>d({view:"search"}),children:t.jsx(E,{})}),t.jsx("button",{type:"button",className:"s-rail-icon",title:"New chat (⌘⌥N)","aria-label":"New chat",onClick:()=>m(),children:t.jsx(L,{})}),t.jsx("button",{type:"button",className:"s-rail-icon s-rail-icon--end",title:"Settings","aria-label":"Settings",onClick:()=>d({view:"settings"}),children:t.jsx(D,{})})]})]})}function E(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[t.jsx("circle",{cx:"7",cy:"7",r:"4.25",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M10.5 10.5 14 14",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function L(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:t.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function D(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[t.jsx("circle",{cx:"8",cy:"8",r:"2.25",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M8 1.5v1.6M8 12.9v1.6M14.5 8h-1.6M3.1 8H1.5M12.6 3.4l-1.1 1.1M4.5 11.5l-1.1 1.1M12.6 12.6l-1.1-1.1M4.5 4.5 3.4 3.4",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}export{Nt as AgentsLeft};
1
+ import{r,j as t}from"./index-DmFAhGPj.js";/* empty css */import"./NewChatComposer-Hd7pI5Ac.js";import{u as k,e as w}from"./Provider-cJCdHAxu.js";import{A as S}from"./AgentAvatar-D8ZtMluU.js";import{a as g}from"./api-h5zurxmi.js";import{b as y}from"./router-Cn_s9IGH.js";import{u as M}from"./sse-CxXt4tqI.js";import{o as A,i as j}from"./surface-activity-B1rgWB1i.js";import{d as N,c as b,e as I,f as C,g as B,h as P}from"./model-Co0zkMIc.js";import"./runtime-picker--IW3cRry.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./createLucideIcon-CFBn0Sdk.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./keyboard-nav-h1IdakpD.js";import"./x-C8ayPBtj.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./file-text-DcYSrI4v.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./text-DsBWV_4k.js";function W(){const{agents:n,route:d}=k(),m=y(d),l=r.useMemo(()=>w(n,m),[n,m]),[u,h]=r.useState([]),[v,s]=r.useState(null),[a,p]=r.useState(null),c=r.useCallback(async()=>{const[e,i,o]=await Promise.allSettled([g("/api/conversations"),g("/api/fleet"),g("/api/tail/discover")]);e.status==="fulfilled"&&h(e.value),i.status==="fulfilled"&&s(i.value),o.status==="fulfilled"&&p(o.value)},[]);r.useEffect(()=>{c()},[c]),r.useEffect(()=>{const e=()=>{j()&&c()},i=window.setInterval(e,1e4),o=A(e);return()=>{window.clearInterval(i),o()}},[c]),M(()=>{j()&&c()});const x=r.useMemo(()=>{const e=new Map;for(const i of v?.activeAsks??[]){const o=e.get(i.agentId)??[];o.push(i),e.set(i.agentId,o)}return e},[v?.activeAsks]);return{projects:r.useMemo(()=>{const{sessionByAgentId:e}=N(u),i=l.map(f=>b(f,e.get(f.id)??null,x.get(f.id)??[])),o=I(a,Date.now());return C(i,u,o)},[l,u,x,a])}}function Nt(){const{route:n,navigate:d,openContextCapture:m}=k(),{projects:l}=W(),u=n.view==="agents-v2"?n.projectSlug:void 0,h=n.view==="agents-v2"?n.agentId:void 0,v=u??l[0]?.slice.slug;return t.jsxs("div",{className:"ctx-panel s-agents-rail",children:[t.jsx("div",{className:"s-agents-recent s-rail-projects",children:l.length===0?t.jsx("div",{className:"ctx-panel-empty",children:"No projects yet"}):l.map(s=>{const a=B(s),p=P(s),c=s.slice.slug===v&&!h;return t.jsxs("button",{type:"button",className:"s-rail-proj","data-selected":c||void 0,"data-live":a>0||void 0,"data-needs":p||void 0,title:s.slice.root??void 0,onClick:()=>d({view:"agents-v2",projectSlug:s.slice.slug}),children:[t.jsx(S,{name:s.slice.title,size:22,tile:!0,presence:!1}),t.jsxs("span",{className:"s-rail-proj-name","data-idle":a===0||void 0,children:[t.jsx("span",{"aria-hidden":!0,style:{opacity:.4},children:"/"}),s.slice.title]}),a>0?t.jsx("span",{className:"s-rail-proj-count","data-needs":p||void 0,title:p?"needs you":void 0,children:a}):null]},s.slice.key)})}),t.jsxs("div",{className:"s-agents-foot s-rail-foot-icons",children:[t.jsx("button",{type:"button",className:"s-rail-icon",title:"Search","aria-label":"Search",onClick:()=>d({view:"search"}),children:t.jsx(E,{})}),t.jsx("button",{type:"button",className:"s-rail-icon",title:"New chat (⌘⌥N)","aria-label":"New chat",onClick:()=>m(),children:t.jsx(L,{})}),t.jsx("button",{type:"button",className:"s-rail-icon s-rail-icon--end",title:"Settings","aria-label":"Settings",onClick:()=>d({view:"settings"}),children:t.jsx(D,{})})]})]})}function E(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[t.jsx("circle",{cx:"7",cy:"7",r:"4.25",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M10.5 10.5 14 14",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function L(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:t.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function D(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[t.jsx("circle",{cx:"8",cy:"8",r:"2.25",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M8 1.5v1.6M8 12.9v1.6M14.5 8h-1.6M3.1 8H1.5M12.6 3.4l-1.1 1.1M4.5 11.5l-1.1 1.1M12.6 12.6l-1.1-1.1M4.5 4.5 3.4 3.4",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}export{Nt as AgentsLeft};
@@ -1,2 +1,2 @@
1
- import{r as h,j as i}from"./index-BZovGpDk.js";/* empty css */import{u as Ot,m as Gt,g as _t,i as Dt}from"./Provider-p-xuaAoE.js";import{a as Vt,b as Ft,m as Kt,r as qt}from"./keyboard-nav-CHo_xmjw.js";import{n as ct,g as wt}from"./colors-BtO5_zlx.js";import{j as Ht,a as N,k as jt,l as lt,i as Mt,n as Qt}from"./conversation-model-CHwHZNw-.js";import{l as Wt,i as $,a as M,p as yt,t as Yt,b as zt}from"./conversation-prefs-DNre-Lcx.js";import{i as Jt,l as Xt,s as Zt}from"./sessionRead-CvFz2RHv.js";import{u as te}from"./ContextMenu-DnFcmfMR.js";import{t as at}from"./time-Dhsh_2EG.js";import{u as ee}from"./use-conversation-list-DWX02INv.js";import{u as ne}from"./use-fleet-active-asks-Cnwa4hTK.js";import{b as oe}from"./router-63XV_E7f.js";import{R as Nt}from"./RailRow-bRkkXIpR.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";function Y(t){const n=t.split("/").filter(Boolean);return n[n.length-1]??t}function $t(t){const n=t.replace(/\/+$/,"").split("/");return n[n.length-1]??t}function se(t,n){const o=Y(n).toLowerCase(),r=t.filter(p=>!!p.projectRoot),c=r.filter(p=>$t(p.projectRoot).toLowerCase()===o),d=c.length>0?c:r,s=ie(d);return s?{label:(c.length>0?d.find(p=>p.projectRoot===s):[...d].sort((p,w)=>w.lastActivityAt-p.lastActivityAt)[0])?.project??Y(n),canonicalRoot:s}:{label:Y(n),canonicalRoot:null}}function ie(t){const n=new Map;for(const d of t){const s=n.get(d.projectRoot)??{count:0,latest:0};s.count+=1,s.latest=Math.max(s.latest,d.lastActivityAt),n.set(d.projectRoot,s)}let o=null,r=-1,c=-1;for(const[d,s]of n)(s.count>r||s.count===r&&s.latest>c)&&(o=d,r=s.count,c=s.latest);return o}function Ct(t,n,o,r){const c=new Map;for(const s of t){const f=Ht(s),p=s.agentId?n.get(s.agentId):void 0,w=p?.repoKey??null,u=p?.project??null,C=(s.agentName??N(s)).trim(),m=f?`channel:${s.id}`:w?`repo:${w.toLowerCase()}`:u?`project:${u.toLowerCase()}`:C?`name:${C.toLowerCase()}`:`dm:${s.id}`,y=f?N(s):w?Y(w):u??C??N(s);let j=c.get(m);if(j||(j={key:m,label:y,isChannel:f,conversations:[],bestState:"blocked",latestUpdate:0,unreadCount:0,canonicalRoot:null},c.set(m,j)),j.conversations.push(s),j.latestUpdate=Math.max(j.latestUpdate,s.lastMessageAt??0),Jt(s.lastMessageAt,s.id,o)&&(j.unreadCount+=1),!f&&p){const g=ct(p.state);wt(g)<wt(j.bestState)&&(j.bestState=g)}}for(const s of c.values()){if(s.key.startsWith("repo:")){const f=s.conversations.map(w=>{const u=w.agentId?n.get(w.agentId):void 0;return{project:u?.project??null,projectRoot:u?.projectRoot??null,lastActivityAt:w.lastMessageAt??0}}),p=se(f,s.key.slice(5));s.label=p.label,s.canonicalRoot=p.canonicalRoot}s.conversations.sort((f,p)=>(p.lastMessageAt??0)-(f.lastMessageAt??0))}const d=Array.from(c.values());return d.sort((s,f)=>f.latestUpdate-s.latestUpdate),d}const ae=12;function cn(){const{route:t,navigate:n,agents:o,apiConnection:r}=Ot(),{sessions:c,loading:d,loadError:s,reload:f}=ee(),[p,w]=h.useState(()=>Xt()),[u,C]=h.useState(()=>Wt()),[m,y]=h.useState(""),[j,g]=h.useState(()=>new Set),[b,l]=h.useState(!1),[R,L]=h.useState(!1),[q,J]=h.useState(!1),k=ne(),H=oe(t),O=h.useMemo(()=>Gt(o,H),[o,H]),I=h.useMemo(()=>{const e=new Map,a=O?o.filter(v=>O.has(v.id)):o;for(const v of a)e.set(v.id,v);return e},[o,O]),T=t.view==="messages"||t.view==="conversation"||t.view==="agent-info"||t.view==="agents-v2"?t.conversationId:void 0;h.useEffect(()=>{L(!1)},[m]);const G=h.useMemo(()=>_t(c,O,H),[c,O,H]),X=h.useMemo(()=>m?G.filter(e=>kt(e,m)):G,[G,m]),_=h.useMemo(()=>{const e=a=>(a.agentId?k.get(a.agentId)?.updatedAt:void 0)??0;return G.filter(a=>$(a.id,u)||!jt(a)?!1:(a.agentId?k.get(a.agentId):void 0)?.status==="needs_attention").sort((a,v)=>e(v)-e(a))},[G,u,k]),D=h.useMemo(()=>m?_.filter(e=>kt(e,m)):_,[_,m]),x=h.useMemo(()=>{const e=X.filter(A=>!$(A.id,u)),a=W(X.filter(A=>$(A.id,u))),v=e.filter(A=>M(A.id,u)).sort((A,xt)=>yt(xt.id,u)-yt(A.id,u)||(xt.lastMessageAt??0)-(A.lastMessageAt??0)),K=e.filter(A=>!M(A.id,u)),it=K.filter(lt),bt=K.filter(jt),Et=K.filter(Mt);return{pinned:v,channels:W(it),agents:Ct(W(bt),I,p),observed:Ct(W(Et),I,p),archived:a}},[X,I,p,u]),dt=te(),V=h.useCallback(e=>{C(a=>Yt(e,a))},[]),F=h.useCallback(e=>{C(a=>zt(e,a))},[]),S=h.useCallback(e=>{w(Zt(e.id)),n({view:"messages",conversationId:e.id})},[n]),P=h.useCallback((e,a)=>{const v=M(a.id,u),K=$(a.id,u),it=N(a);dt(e,[{kind:"action",label:"Open",onSelect:()=>S(a)},{kind:"separator"},{kind:"action",label:v?"Unpin":"Pin to top",onSelect:()=>V(a.id)},{kind:"action",label:K?"Unarchive":"Archive",onSelect:()=>F(a.id)},{kind:"separator"},{kind:"action",label:"Copy name",onSelect:()=>{navigator.clipboard?.writeText(it).catch(()=>{})}}])},[u,S,V,F,dt]),ut=e=>{g(a=>{const v=new Set(a);return v.has(e)?v.delete(e):v.add(e),v})},Tt=r.status==="offline"||Dt(s),pt=h.useRef(null),mt=h.useRef(null),Pt=Vt(),Ut=Kt(()=>pt.current);Ft(h.useCallback(()=>mt.current,[]));const Z=x.pinned.length,tt=x.channels.length,et=x.agents.reduce((e,a)=>e+a.conversations.length,0),nt=x.observed.reduce((e,a)=>e+a.conversations.length,0),Q=x.archived.length,ht=Z+tt+et+nt+Q,Bt=b||!!m,ot=h.useMemo(()=>{const e=[];for(const a of D)e.push({rowId:`ny-${a.id}`,id:a.id});for(const a of x.pinned)e.push({rowId:`pin-${a.id}`,id:a.id});for(const a of x.agents)for(const v of a.conversations)e.push({rowId:v.id,id:v.id});for(const a of x.channels)e.push({rowId:a.id,id:a.id});for(const a of x.observed)for(const v of a.conversations)e.push({rowId:v.id,id:v.id});for(const a of x.archived)e.push({rowId:`arch-${a.id}`,id:a.id});return e},[D,x]),U=h.useMemo(()=>({activeId:T,activeRowId:T?ot.find(e=>e.id===T)?.rowId:void 0,firstRowId:ot[0]?.rowId}),[T,ot]),vt=R||m?x.observed:x.observed.slice(0,ae),ft=Math.max(0,x.observed.length-vt.length),gt=e=>!!(m||j.has(e.key)||T&&e.conversations.some(a=>a.id===T)),st=e=>i.jsx(rt,{pinned:M(e.id,u),archived:$(e.id,u),onTogglePin:()=>V(e.id),onToggleArchive:()=>F(e.id)});return i.jsxs("div",{className:"ctx-panel",children:[i.jsxs("div",{className:"ctx-panel-toolbar",children:[i.jsx("input",{ref:mt,type:"text",className:"ctx-panel-search-input",placeholder:"Filter… (/)",value:m,onChange:e=>y(e.target.value),onKeyDown:Ut}),_.length>0&&i.jsx("span",{className:"ctx-panel-rail-stat",title:"Asks waiting on your reply",children:ce(_.length)})]}),i.jsx("div",{ref:pt,className:["ctx-panel-list","ctx-panel-list--scroll",ht===0&&"ctx-panel-list--empty"].filter(Boolean).join(" "),onKeyDown:Pt,children:ht===0?i.jsx(re,{query:m,loading:d,error:s,apiOffline:Tt,onRetry:()=>{f(!0)}}):i.jsxs(i.Fragment,{children:[D.length>0&&i.jsx(B,{label:"Needs you",count:D.length,hint:"Asks waiting on your reply",children:D.map(e=>i.jsx(E,{rowId:`ny-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,onSelect:S,onContextMenu:P},`ny-${e.id}`))}),Z>0&&i.jsx(B,{label:"Pinned",count:Z,hint:"Pinned conversations",children:x.pinned.map(e=>i.jsx(E,{rowId:`pin-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,pinned:!0,actions:st(e),onSelect:S,onContextMenu:P},`pin-${e.id}`))}),et>0&&i.jsx(B,{label:"Agents",count:et,children:x.agents.map(e=>i.jsx(At,{group:e,isOpen:gt(e),nav:U,agentById:I,asksByAgent:k,prefs:u,onToggle:()=>ut(e.key),onSelect:S,onTogglePin:V,onToggleArchive:F,onContextMenu:P},e.key))}),tt>0&&i.jsx(B,{label:"Channels",count:tt,children:x.channels.map(e=>i.jsx(E,{rowId:e.id,session:e,nav:U,agentById:I,asksByAgent:k,actions:st(e),onSelect:S,onContextMenu:P},e.id))}),nt>0&&i.jsxs(B,{label:"Observed",count:nt,hint:"Agent conversations you’re not in",open:Bt,onToggle:()=>l(e=>!e),children:[vt.map(e=>i.jsx(At,{group:e,isOpen:gt(e),nav:U,agentById:I,asksByAgent:k,prefs:u,observed:!0,onToggle:()=>ut(e.key),onSelect:S,onTogglePin:V,onToggleArchive:F,onContextMenu:P},e.key)),ft>0?i.jsxs("button",{type:"button",className:"ctx-panel-more",onClick:()=>L(!0),children:["+ ",ft," more observed"]}):null]}),Q>0&&i.jsxs(B,{label:"Archived",count:Q,hint:"Hidden from the main rail",children:[i.jsx("button",{type:"button",className:"ctx-panel-more",onClick:()=>J(e=>!e),children:q?"▾ hide archived":`› show ${Q} archived`}),q?x.archived.map(e=>i.jsx(E,{rowId:`arch-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,actions:st(e),onSelect:S,onContextMenu:P},`arch-${e.id}`)):null]})]})})]})}function B({label:t,count:n,hint:o,open:r,onToggle:c,children:d}){return c?i.jsxs("section",{className:"ctx-panel-rail-section","aria-label":t,children:[i.jsxs("button",{type:"button",className:"ctx-panel-section-label ctx-panel-section-toggle",title:o,"aria-expanded":!!r,onClick:c,children:[i.jsxs("span",{className:"ctx-panel-section-toggle-label",children:[i.jsx("span",{className:"ctx-panel-section-chevron","aria-hidden":!0,children:r?"▾":"▸"}),t]}),i.jsx("span",{className:"ctx-panel-count",children:n})]}),r?i.jsx("div",{className:"ctx-panel-rail-section-body",children:d}):null]}):i.jsxs("section",{className:"ctx-panel-rail-section","aria-label":t,children:[i.jsxs("div",{className:"ctx-panel-section-label",title:o,children:[i.jsx("span",{children:t}),i.jsx("span",{className:"ctx-panel-count",children:n})]}),i.jsx("div",{className:"ctx-panel-rail-section-body",children:d})]})}function rt({pinned:t,archived:n,onTogglePin:o,onToggleArchive:r}){return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:["rr-row-action",t&&"rr-row-action--on"].filter(Boolean).join(" "),title:t?"Unpin":"Pin to top","aria-label":t?"Unpin":"Pin",onClick:c=>{c.stopPropagation(),o()},children:t?"Unpin":"Pin"}),i.jsx("button",{type:"button",className:["rr-row-action",n&&"rr-row-action--on"].filter(Boolean).join(" "),title:n?"Unarchive":"Archive","aria-label":n?"Unarchive":"Archive",onClick:c=>{c.stopPropagation(),r()},children:n?"Restore":"Archive"})]})}function E({session:t,rowId:n,nav:o,agentById:r,asksByAgent:c,pinned:d,depth:s,actions:f,worktreeLabel:p,onSelect:w,onContextMenu:u}){const C=t.id===o.activeId,m=N(t),y=lt(t),j=Mt(t),g=t.agentId?r.get(t.agentId):void 0,b=t.agentId?c.get(t.agentId):void 0,l=!y&&!j&&b?.status==="needs_attention",R=Rt(t,g),L=y?`${t.participantIds.length} members`:R.toLowerCase()===m.toLowerCase()?void 0:R,q=!y&&b?ue(t,g,b):L;return i.jsx(Nt,{depth:s,name:s===1?It(t,g,b):m,sub:s===1?Rt(t,g):q,meta:b?at(b.updatedAt):t.lastMessageAt?at(t.lastMessageAt):void 0,tone:y?"channel":b?de(g,b):g?ct(g.state):"dm",avatarName:s===1?g?.name??It(t,g,b):m,avatarKind:y?"channel":"user",active:C,unread:l,pinned:d,activityLabel:b?Lt(b):void 0,activityTone:b?le(b):void 0,worktreeLabel:p??void 0,title:s===1?pe(t,g,b):void 0,actions:f,tabIndex:qt(n===o.activeRowId,o.activeRowId!==void 0,n===o.firstRowId),onClick:()=>w(t),onContextMenu:u?J=>u(J,t):void 0})}function At({group:t,isOpen:n,nav:o,agentById:r,asksByAgent:c,prefs:d,observed:s,onToggle:f,onSelect:p,onTogglePin:w,onToggleArchive:u,onContextMenu:C}){if(t.conversations.length===1){const l=t.conversations[0];return i.jsx(E,{rowId:l.id,session:l,nav:o,agentById:r,asksByAgent:c,pinned:M(l.id,d),actions:i.jsx(rt,{pinned:M(l.id,d),archived:$(l.id,d),onTogglePin:()=>w(l.id),onToggleArchive:()=>u(l.id)}),onSelect:p,onContextMenu:C})}const m=t.conversations.map(l=>l.agentId?c.get(l.agentId):void 0).filter(l=>!!l),y=m.length,j=m.filter(l=>l.status==="working").length,g=m.filter(l=>l.status==="needs_attention").length,b=t.conversations.some(l=>l.id===o.activeId);return i.jsxs("div",{children:[i.jsx(Nt,{name:t.label,meta:y>0?`${y} active · ${St(t)}`:St(t),tone:j>0?"in_turn":t.bestState,caret:n?"open":"closed",active:b&&!n,unread:!s&&g>0&&!n,activityLabel:y>0?`${y} active`:void 0,activityTone:g>0?"attention":j>0?"working":"pending",onClick:f}),n&&t.conversations.map(l=>{const R=l.agentId?r.get(l.agentId):void 0,L=t.canonicalRoot&&R?.projectRoot&&R.projectRoot!==t.canonicalRoot?$t(R.projectRoot):null;return i.jsx(E,{rowId:l.id,session:l,depth:1,nav:o,agentById:r,asksByAgent:c,pinned:M(l.id,d),worktreeLabel:L,actions:i.jsx(rt,{pinned:M(l.id,d),archived:$(l.id,d),onTogglePin:()=>w(l.id),onToggleArchive:()=>u(l.id)}),onSelect:p,onContextMenu:C},l.id)})]},t.key)}function re({query:t,loading:n,error:o,apiOffline:r,onRetry:c}){const d=t.trim().length>0,s=n?"Loading conversations":r?"Scout server offline":o?"Couldn't load conversations":d?"No matching conversations":"No conversations yet",f=n?"Checking the broker for your conversations, channels, and observed threads.":r?"Start or restart Scout services, then retry.":o||(d?"Try a shorter filter.":"Your conversations, channels, and observed agent threads will show here.");return i.jsxs("div",{className:"ctx-panel-empty-card","data-tone":r||o?"error":"neutral",children:[i.jsx("div",{className:"ctx-panel-empty-card-title",children:s}),i.jsx("div",{className:"ctx-panel-empty-card-detail",children:f}),(r||o)&&i.jsx("button",{type:"button",className:"ctx-panel-empty-card-action",onClick:c,children:"Retry"})]})}function kt(t,n){const o=n.toLowerCase();return N(t).toLowerCase().includes(o)||t.id.toLowerCase().includes(o)||(t.preview??"").toLowerCase().includes(o)||(t.agentName??"").toLowerCase().includes(o)}function ce(t){return t===1?"1 needs a reply":`${t} need a reply`}function Lt(t){return t.status==="queued"?"Starting":t.status==="working"?"Working":t.status==="needs_attention"?"Needs you":t.statusLabel||t.status}function le(t){return t.status==="queued"?"pending":t.status==="needs_attention"?"attention":"working"}function de(t,n){return n.status==="working"?"in_turn":t?ct(t.state):"dm"}function ue(t,n,o){const r=Lt(o),c=z(o.task)??z(o.summary)??z(t.preview)??t.currentBranch??n?.branch??"";return c?`${r} · ${c}`:r}function W(t){return[...t].sort((n,o)=>(o.lastMessageAt??0)-(n.lastMessageAt??0))}function It(t,n,o){const r=o?.task??z(t.preview)??t.currentBranch??n?.branch??"",c=n?.name??t.agentName??N(t);return r?`${c} · ${r}`:c}function pe(t,n,o){const r=[];return o&&r.push(`task: ${o.task}`),t.preview&&r.push(`preview: ${t.preview}`),(t.currentBranch??n?.branch)&&r.push(`branch: ${t.currentBranch??n?.branch}`),n?.harness&&r.push(`harness: ${n.harness}`),r.length>0?r.join(`
1
+ import{r as h,j as i}from"./index-DmFAhGPj.js";/* empty css */import{u as Ot,m as Gt,g as _t,i as Dt}from"./Provider-cJCdHAxu.js";import{a as Vt,b as Ft,m as Kt,r as qt}from"./keyboard-nav-h1IdakpD.js";import{n as ct,g as wt}from"./colors-BtO5_zlx.js";import{j as Ht,a as N,k as jt,l as lt,i as Mt,n as Qt}from"./conversation-model-CHwHZNw-.js";import{l as Wt,i as $,a as M,p as yt,t as Yt,b as zt}from"./conversation-prefs-DNre-Lcx.js";import{i as Jt,l as Xt,s as Zt}from"./sessionRead-CvFz2RHv.js";import{u as te}from"./ContextMenu-CHIuVKz7.js";import{t as at}from"./time-Dhsh_2EG.js";import{u as ee}from"./use-conversation-list-C-dPcjQe.js";import{u as ne}from"./use-fleet-active-asks-BHzeBZSW.js";import{b as oe}from"./router-Cn_s9IGH.js";import{R as Nt}from"./RailRow-CLcVmywd.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";function Y(t){const n=t.split("/").filter(Boolean);return n[n.length-1]??t}function $t(t){const n=t.replace(/\/+$/,"").split("/");return n[n.length-1]??t}function se(t,n){const o=Y(n).toLowerCase(),r=t.filter(p=>!!p.projectRoot),c=r.filter(p=>$t(p.projectRoot).toLowerCase()===o),d=c.length>0?c:r,s=ie(d);return s?{label:(c.length>0?d.find(p=>p.projectRoot===s):[...d].sort((p,w)=>w.lastActivityAt-p.lastActivityAt)[0])?.project??Y(n),canonicalRoot:s}:{label:Y(n),canonicalRoot:null}}function ie(t){const n=new Map;for(const d of t){const s=n.get(d.projectRoot)??{count:0,latest:0};s.count+=1,s.latest=Math.max(s.latest,d.lastActivityAt),n.set(d.projectRoot,s)}let o=null,r=-1,c=-1;for(const[d,s]of n)(s.count>r||s.count===r&&s.latest>c)&&(o=d,r=s.count,c=s.latest);return o}function Ct(t,n,o,r){const c=new Map;for(const s of t){const f=Ht(s),p=s.agentId?n.get(s.agentId):void 0,w=p?.repoKey??null,u=p?.project??null,C=(s.agentName??N(s)).trim(),m=f?`channel:${s.id}`:w?`repo:${w.toLowerCase()}`:u?`project:${u.toLowerCase()}`:C?`name:${C.toLowerCase()}`:`dm:${s.id}`,y=f?N(s):w?Y(w):u??C??N(s);let j=c.get(m);if(j||(j={key:m,label:y,isChannel:f,conversations:[],bestState:"blocked",latestUpdate:0,unreadCount:0,canonicalRoot:null},c.set(m,j)),j.conversations.push(s),j.latestUpdate=Math.max(j.latestUpdate,s.lastMessageAt??0),Jt(s.lastMessageAt,s.id,o)&&(j.unreadCount+=1),!f&&p){const g=ct(p.state);wt(g)<wt(j.bestState)&&(j.bestState=g)}}for(const s of c.values()){if(s.key.startsWith("repo:")){const f=s.conversations.map(w=>{const u=w.agentId?n.get(w.agentId):void 0;return{project:u?.project??null,projectRoot:u?.projectRoot??null,lastActivityAt:w.lastMessageAt??0}}),p=se(f,s.key.slice(5));s.label=p.label,s.canonicalRoot=p.canonicalRoot}s.conversations.sort((f,p)=>(p.lastMessageAt??0)-(f.lastMessageAt??0))}const d=Array.from(c.values());return d.sort((s,f)=>f.latestUpdate-s.latestUpdate),d}const ae=12;function cn(){const{route:t,navigate:n,agents:o,apiConnection:r}=Ot(),{sessions:c,loading:d,loadError:s,reload:f}=ee(),[p,w]=h.useState(()=>Xt()),[u,C]=h.useState(()=>Wt()),[m,y]=h.useState(""),[j,g]=h.useState(()=>new Set),[b,l]=h.useState(!1),[R,L]=h.useState(!1),[q,J]=h.useState(!1),k=ne(),H=oe(t),O=h.useMemo(()=>Gt(o,H),[o,H]),I=h.useMemo(()=>{const e=new Map,a=O?o.filter(v=>O.has(v.id)):o;for(const v of a)e.set(v.id,v);return e},[o,O]),T=t.view==="messages"||t.view==="conversation"||t.view==="agent-info"||t.view==="agents-v2"?t.conversationId:void 0;h.useEffect(()=>{L(!1)},[m]);const G=h.useMemo(()=>_t(c,O,H),[c,O,H]),X=h.useMemo(()=>m?G.filter(e=>kt(e,m)):G,[G,m]),_=h.useMemo(()=>{const e=a=>(a.agentId?k.get(a.agentId)?.updatedAt:void 0)??0;return G.filter(a=>$(a.id,u)||!jt(a)?!1:(a.agentId?k.get(a.agentId):void 0)?.status==="needs_attention").sort((a,v)=>e(v)-e(a))},[G,u,k]),D=h.useMemo(()=>m?_.filter(e=>kt(e,m)):_,[_,m]),x=h.useMemo(()=>{const e=X.filter(A=>!$(A.id,u)),a=W(X.filter(A=>$(A.id,u))),v=e.filter(A=>M(A.id,u)).sort((A,xt)=>yt(xt.id,u)-yt(A.id,u)||(xt.lastMessageAt??0)-(A.lastMessageAt??0)),K=e.filter(A=>!M(A.id,u)),it=K.filter(lt),bt=K.filter(jt),Et=K.filter(Mt);return{pinned:v,channels:W(it),agents:Ct(W(bt),I,p),observed:Ct(W(Et),I,p),archived:a}},[X,I,p,u]),dt=te(),V=h.useCallback(e=>{C(a=>Yt(e,a))},[]),F=h.useCallback(e=>{C(a=>zt(e,a))},[]),S=h.useCallback(e=>{w(Zt(e.id)),n({view:"messages",conversationId:e.id})},[n]),P=h.useCallback((e,a)=>{const v=M(a.id,u),K=$(a.id,u),it=N(a);dt(e,[{kind:"action",label:"Open",onSelect:()=>S(a)},{kind:"separator"},{kind:"action",label:v?"Unpin":"Pin to top",onSelect:()=>V(a.id)},{kind:"action",label:K?"Unarchive":"Archive",onSelect:()=>F(a.id)},{kind:"separator"},{kind:"action",label:"Copy name",onSelect:()=>{navigator.clipboard?.writeText(it).catch(()=>{})}}])},[u,S,V,F,dt]),ut=e=>{g(a=>{const v=new Set(a);return v.has(e)?v.delete(e):v.add(e),v})},Tt=r.status==="offline"||Dt(s),pt=h.useRef(null),mt=h.useRef(null),Pt=Vt(),Ut=Kt(()=>pt.current);Ft(h.useCallback(()=>mt.current,[]));const Z=x.pinned.length,tt=x.channels.length,et=x.agents.reduce((e,a)=>e+a.conversations.length,0),nt=x.observed.reduce((e,a)=>e+a.conversations.length,0),Q=x.archived.length,ht=Z+tt+et+nt+Q,Bt=b||!!m,ot=h.useMemo(()=>{const e=[];for(const a of D)e.push({rowId:`ny-${a.id}`,id:a.id});for(const a of x.pinned)e.push({rowId:`pin-${a.id}`,id:a.id});for(const a of x.agents)for(const v of a.conversations)e.push({rowId:v.id,id:v.id});for(const a of x.channels)e.push({rowId:a.id,id:a.id});for(const a of x.observed)for(const v of a.conversations)e.push({rowId:v.id,id:v.id});for(const a of x.archived)e.push({rowId:`arch-${a.id}`,id:a.id});return e},[D,x]),U=h.useMemo(()=>({activeId:T,activeRowId:T?ot.find(e=>e.id===T)?.rowId:void 0,firstRowId:ot[0]?.rowId}),[T,ot]),vt=R||m?x.observed:x.observed.slice(0,ae),ft=Math.max(0,x.observed.length-vt.length),gt=e=>!!(m||j.has(e.key)||T&&e.conversations.some(a=>a.id===T)),st=e=>i.jsx(rt,{pinned:M(e.id,u),archived:$(e.id,u),onTogglePin:()=>V(e.id),onToggleArchive:()=>F(e.id)});return i.jsxs("div",{className:"ctx-panel",children:[i.jsxs("div",{className:"ctx-panel-toolbar",children:[i.jsx("input",{ref:mt,type:"text",className:"ctx-panel-search-input",placeholder:"Filter… (/)",value:m,onChange:e=>y(e.target.value),onKeyDown:Ut}),_.length>0&&i.jsx("span",{className:"ctx-panel-rail-stat",title:"Asks waiting on your reply",children:ce(_.length)})]}),i.jsx("div",{ref:pt,className:["ctx-panel-list","ctx-panel-list--scroll",ht===0&&"ctx-panel-list--empty"].filter(Boolean).join(" "),onKeyDown:Pt,children:ht===0?i.jsx(re,{query:m,loading:d,error:s,apiOffline:Tt,onRetry:()=>{f(!0)}}):i.jsxs(i.Fragment,{children:[D.length>0&&i.jsx(B,{label:"Needs you",count:D.length,hint:"Asks waiting on your reply",children:D.map(e=>i.jsx(E,{rowId:`ny-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,onSelect:S,onContextMenu:P},`ny-${e.id}`))}),Z>0&&i.jsx(B,{label:"Pinned",count:Z,hint:"Pinned conversations",children:x.pinned.map(e=>i.jsx(E,{rowId:`pin-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,pinned:!0,actions:st(e),onSelect:S,onContextMenu:P},`pin-${e.id}`))}),et>0&&i.jsx(B,{label:"Agents",count:et,children:x.agents.map(e=>i.jsx(At,{group:e,isOpen:gt(e),nav:U,agentById:I,asksByAgent:k,prefs:u,onToggle:()=>ut(e.key),onSelect:S,onTogglePin:V,onToggleArchive:F,onContextMenu:P},e.key))}),tt>0&&i.jsx(B,{label:"Channels",count:tt,children:x.channels.map(e=>i.jsx(E,{rowId:e.id,session:e,nav:U,agentById:I,asksByAgent:k,actions:st(e),onSelect:S,onContextMenu:P},e.id))}),nt>0&&i.jsxs(B,{label:"Observed",count:nt,hint:"Agent conversations you’re not in",open:Bt,onToggle:()=>l(e=>!e),children:[vt.map(e=>i.jsx(At,{group:e,isOpen:gt(e),nav:U,agentById:I,asksByAgent:k,prefs:u,observed:!0,onToggle:()=>ut(e.key),onSelect:S,onTogglePin:V,onToggleArchive:F,onContextMenu:P},e.key)),ft>0?i.jsxs("button",{type:"button",className:"ctx-panel-more",onClick:()=>L(!0),children:["+ ",ft," more observed"]}):null]}),Q>0&&i.jsxs(B,{label:"Archived",count:Q,hint:"Hidden from the main rail",children:[i.jsx("button",{type:"button",className:"ctx-panel-more",onClick:()=>J(e=>!e),children:q?"▾ hide archived":`› show ${Q} archived`}),q?x.archived.map(e=>i.jsx(E,{rowId:`arch-${e.id}`,session:e,nav:U,agentById:I,asksByAgent:k,actions:st(e),onSelect:S,onContextMenu:P},`arch-${e.id}`)):null]})]})})]})}function B({label:t,count:n,hint:o,open:r,onToggle:c,children:d}){return c?i.jsxs("section",{className:"ctx-panel-rail-section","aria-label":t,children:[i.jsxs("button",{type:"button",className:"ctx-panel-section-label ctx-panel-section-toggle",title:o,"aria-expanded":!!r,onClick:c,children:[i.jsxs("span",{className:"ctx-panel-section-toggle-label",children:[i.jsx("span",{className:"ctx-panel-section-chevron","aria-hidden":!0,children:r?"▾":"▸"}),t]}),i.jsx("span",{className:"ctx-panel-count",children:n})]}),r?i.jsx("div",{className:"ctx-panel-rail-section-body",children:d}):null]}):i.jsxs("section",{className:"ctx-panel-rail-section","aria-label":t,children:[i.jsxs("div",{className:"ctx-panel-section-label",title:o,children:[i.jsx("span",{children:t}),i.jsx("span",{className:"ctx-panel-count",children:n})]}),i.jsx("div",{className:"ctx-panel-rail-section-body",children:d})]})}function rt({pinned:t,archived:n,onTogglePin:o,onToggleArchive:r}){return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:["rr-row-action",t&&"rr-row-action--on"].filter(Boolean).join(" "),title:t?"Unpin":"Pin to top","aria-label":t?"Unpin":"Pin",onClick:c=>{c.stopPropagation(),o()},children:t?"Unpin":"Pin"}),i.jsx("button",{type:"button",className:["rr-row-action",n&&"rr-row-action--on"].filter(Boolean).join(" "),title:n?"Unarchive":"Archive","aria-label":n?"Unarchive":"Archive",onClick:c=>{c.stopPropagation(),r()},children:n?"Restore":"Archive"})]})}function E({session:t,rowId:n,nav:o,agentById:r,asksByAgent:c,pinned:d,depth:s,actions:f,worktreeLabel:p,onSelect:w,onContextMenu:u}){const C=t.id===o.activeId,m=N(t),y=lt(t),j=Mt(t),g=t.agentId?r.get(t.agentId):void 0,b=t.agentId?c.get(t.agentId):void 0,l=!y&&!j&&b?.status==="needs_attention",R=Rt(t,g),L=y?`${t.participantIds.length} members`:R.toLowerCase()===m.toLowerCase()?void 0:R,q=!y&&b?ue(t,g,b):L;return i.jsx(Nt,{depth:s,name:s===1?It(t,g,b):m,sub:s===1?Rt(t,g):q,meta:b?at(b.updatedAt):t.lastMessageAt?at(t.lastMessageAt):void 0,tone:y?"channel":b?de(g,b):g?ct(g.state):"dm",avatarName:s===1?g?.name??It(t,g,b):m,avatarKind:y?"channel":"user",active:C,unread:l,pinned:d,activityLabel:b?Lt(b):void 0,activityTone:b?le(b):void 0,worktreeLabel:p??void 0,title:s===1?pe(t,g,b):void 0,actions:f,tabIndex:qt(n===o.activeRowId,o.activeRowId!==void 0,n===o.firstRowId),onClick:()=>w(t),onContextMenu:u?J=>u(J,t):void 0})}function At({group:t,isOpen:n,nav:o,agentById:r,asksByAgent:c,prefs:d,observed:s,onToggle:f,onSelect:p,onTogglePin:w,onToggleArchive:u,onContextMenu:C}){if(t.conversations.length===1){const l=t.conversations[0];return i.jsx(E,{rowId:l.id,session:l,nav:o,agentById:r,asksByAgent:c,pinned:M(l.id,d),actions:i.jsx(rt,{pinned:M(l.id,d),archived:$(l.id,d),onTogglePin:()=>w(l.id),onToggleArchive:()=>u(l.id)}),onSelect:p,onContextMenu:C})}const m=t.conversations.map(l=>l.agentId?c.get(l.agentId):void 0).filter(l=>!!l),y=m.length,j=m.filter(l=>l.status==="working").length,g=m.filter(l=>l.status==="needs_attention").length,b=t.conversations.some(l=>l.id===o.activeId);return i.jsxs("div",{children:[i.jsx(Nt,{name:t.label,meta:y>0?`${y} active · ${St(t)}`:St(t),tone:j>0?"in_turn":t.bestState,caret:n?"open":"closed",active:b&&!n,unread:!s&&g>0&&!n,activityLabel:y>0?`${y} active`:void 0,activityTone:g>0?"attention":j>0?"working":"pending",onClick:f}),n&&t.conversations.map(l=>{const R=l.agentId?r.get(l.agentId):void 0,L=t.canonicalRoot&&R?.projectRoot&&R.projectRoot!==t.canonicalRoot?$t(R.projectRoot):null;return i.jsx(E,{rowId:l.id,session:l,depth:1,nav:o,agentById:r,asksByAgent:c,pinned:M(l.id,d),worktreeLabel:L,actions:i.jsx(rt,{pinned:M(l.id,d),archived:$(l.id,d),onTogglePin:()=>w(l.id),onToggleArchive:()=>u(l.id)}),onSelect:p,onContextMenu:C},l.id)})]},t.key)}function re({query:t,loading:n,error:o,apiOffline:r,onRetry:c}){const d=t.trim().length>0,s=n?"Loading conversations":r?"Scout server offline":o?"Couldn't load conversations":d?"No matching conversations":"No conversations yet",f=n?"Checking the broker for your conversations, channels, and observed threads.":r?"Start or restart Scout services, then retry.":o||(d?"Try a shorter filter.":"Your conversations, channels, and observed agent threads will show here.");return i.jsxs("div",{className:"ctx-panel-empty-card","data-tone":r||o?"error":"neutral",children:[i.jsx("div",{className:"ctx-panel-empty-card-title",children:s}),i.jsx("div",{className:"ctx-panel-empty-card-detail",children:f}),(r||o)&&i.jsx("button",{type:"button",className:"ctx-panel-empty-card-action",onClick:c,children:"Retry"})]})}function kt(t,n){const o=n.toLowerCase();return N(t).toLowerCase().includes(o)||t.id.toLowerCase().includes(o)||(t.preview??"").toLowerCase().includes(o)||(t.agentName??"").toLowerCase().includes(o)}function ce(t){return t===1?"1 needs a reply":`${t} need a reply`}function Lt(t){return t.status==="queued"?"Starting":t.status==="working"?"Working":t.status==="needs_attention"?"Needs you":t.statusLabel||t.status}function le(t){return t.status==="queued"?"pending":t.status==="needs_attention"?"attention":"working"}function de(t,n){return n.status==="working"?"in_turn":t?ct(t.state):"dm"}function ue(t,n,o){const r=Lt(o),c=z(o.task)??z(o.summary)??z(t.preview)??t.currentBranch??n?.branch??"";return c?`${r} · ${c}`:r}function W(t){return[...t].sort((n,o)=>(o.lastMessageAt??0)-(n.lastMessageAt??0))}function It(t,n,o){const r=o?.task??z(t.preview)??t.currentBranch??n?.branch??"",c=n?.name??t.agentName??N(t);return r?`${c} · ${r}`:c}function pe(t,n,o){const r=[];return o&&r.push(`task: ${o.task}`),t.preview&&r.push(`preview: ${t.preview}`),(t.currentBranch??n?.branch)&&r.push(`branch: ${t.currentBranch??n?.branch}`),n?.harness&&r.push(`harness: ${n.harness}`),r.length>0?r.join(`
2
2
  `):void 0}function Rt(t,n){if(lt(t))return Qt(t);const o=n?.handle?.trim().replace(/^@+/,"");return o||(t.agentId?t.agentId.split(".")[0]??t.agentId:N(t))}function z(t){if(!t)return null;const n=t.replace(/\s+/g," ").trim();return n?n.length>60?`${n.slice(0,57)}…`:n:null}function St(t){const n=t.latestUpdate?at(t.latestUpdate):"",o=`${t.conversations.length}`;return n?`${o} · ${n}`:o}export{cn as ChatLeft};
@@ -1 +1 @@
1
- import{r as N,j as e}from"./index-BZovGpDk.js";import{a as I}from"./api-h5zurxmi.js";import{b as L,c as j,s as R}from"./router-63XV_E7f.js";import{u as $,r as y,s as b,i as C}from"./mesh-ops-C1gq8zKf.js";import{u as E,s as T}from"./mesh-view-store-B56D3f77.js";import{u as A}from"./Provider-p-xuaAoE.js";import{R as h}from"./RailRow-bRkkXIpR.js";import{u as U}from"./use-mesh-ops-items-BRFm37oY.js";/* empty css */import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";function S(s){return s.hostName?.split(".")[0]??s.name??s.id.slice(0,12)}function $t(){const{route:s,navigate:u}=A(),l=L(s),{items:i,unattributedOnly:m,lab:M,refreshToken:g}=$(),{meshSnapshot:r}=E();U(l);const[w]=N.useState(()=>y());N.useEffect(()=>{let t=!1;return I("/api/mesh").then(o=>{t||T(o)}).catch(()=>{}),()=>{t=!0}},[g]);const c=t=>{b(!1),u(t?R(s,t):j(s))},O=()=>{u(j(s)),b(!0)},p=r?.localNode??null,d=r?Object.values(r.nodes).filter(t=>t.id!==p?.id):[],a=t=>M.lastLook?t.filter(o=>C(o,w)).length:0,x=i.filter(t=>t.hostNodeId===null),f=t=>{const o=i.filter(k=>k.hostNodeId===t.id),n=a(o),v=l===t.id;return e.jsx(h,{name:S(t),meta:o.length>0?`${n>0?`${n}·`:""}${o.length}`:"—",tone:n>0?"needs_attention":"neutral",active:v,unread:n>0,onClick:()=>c(v?null:t.id),title:`Scope the list to ${S(t)}`},t.id)};return e.jsxs("div",{className:"ctx-panel mesh-ops-rail",children:[e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Mesh"}),e.jsx(h,{name:"everywhere",meta:`${a(i)>0?`${a(i)}·`:""}${i.length}`,tone:a(i)>0?"needs_attention":"neutral",active:l===null&&!m,onClick:()=>c(null),title:"Show items across all hosts"})]}),p&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"This host"}),f(p)]}),d.length>0&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Peers"}),d.map(t=>f(t))]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"No venue"}),e.jsx(h,{name:"unattributed",meta:x.length>0?String(x.length):"—",tone:"neutral",active:m,onClick:()=>m?c(null):O(),title:"Items with no venue host"})]}),!r&&e.jsx("div",{className:"ctx-panel-empty",children:"Loading mesh…"})]})}export{$t as MeshOpsLeft};
1
+ import{r as N,j as e}from"./index-DmFAhGPj.js";import{a as I}from"./api-h5zurxmi.js";import{b as L,c as j,s as R}from"./router-Cn_s9IGH.js";import{u as $,r as y,s as b,i as C}from"./mesh-ops-5pZCYptW.js";import{u as E,s as T}from"./mesh-view-store-KJzABIkN.js";import{u as A}from"./Provider-cJCdHAxu.js";import{R as h}from"./RailRow-CLcVmywd.js";import{u as U}from"./use-mesh-ops-items-KmaauBr_.js";/* empty css */import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";function S(s){return s.hostName?.split(".")[0]??s.name??s.id.slice(0,12)}function $t(){const{route:s,navigate:u}=A(),l=L(s),{items:i,unattributedOnly:m,lab:M,refreshToken:g}=$(),{meshSnapshot:r}=E();U(l);const[w]=N.useState(()=>y());N.useEffect(()=>{let t=!1;return I("/api/mesh").then(o=>{t||T(o)}).catch(()=>{}),()=>{t=!0}},[g]);const c=t=>{b(!1),u(t?R(s,t):j(s))},O=()=>{u(j(s)),b(!0)},p=r?.localNode??null,d=r?Object.values(r.nodes).filter(t=>t.id!==p?.id):[],a=t=>M.lastLook?t.filter(o=>C(o,w)).length:0,x=i.filter(t=>t.hostNodeId===null),f=t=>{const o=i.filter(k=>k.hostNodeId===t.id),n=a(o),v=l===t.id;return e.jsx(h,{name:S(t),meta:o.length>0?`${n>0?`${n}·`:""}${o.length}`:"—",tone:n>0?"needs_attention":"neutral",active:v,unread:n>0,onClick:()=>c(v?null:t.id),title:`Scope the list to ${S(t)}`},t.id)};return e.jsxs("div",{className:"ctx-panel mesh-ops-rail",children:[e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Mesh"}),e.jsx(h,{name:"everywhere",meta:`${a(i)>0?`${a(i)}·`:""}${i.length}`,tone:a(i)>0?"needs_attention":"neutral",active:l===null&&!m,onClick:()=>c(null),title:"Show items across all hosts"})]}),p&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"This host"}),f(p)]}),d.length>0&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Peers"}),d.map(t=>f(t))]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"No venue"}),e.jsx(h,{name:"unattributed",meta:x.length>0?String(x.length):"—",tone:"neutral",active:m,onClick:()=>m?c(null):O(),title:"Items with no venue host"})]}),!r&&e.jsx("div",{className:"ctx-panel-empty",children:"Loading mesh…"})]})}export{$t as MeshOpsLeft};
@@ -1 +1 @@
1
- import{j as e,r as A}from"./index-BZovGpDk.js";import{u as q,g as z,i as P,j as G,k as I,l as H,a as w,r as T}from"./mesh-view-store-B56D3f77.js";import{u as Q}from"./Provider-p-xuaAoE.js";import{n as b,a as V}from"./colors-BtO5_zlx.js";import{b as D}from"./mesh-buckets-CfAukILK.js";import{u as J}from"./use-fleet-active-asks-Cnwa4hTK.js";import{R as h}from"./RailRow-bRkkXIpR.js";import{F as U}from"./FleetSearch-Dsi_l2KW.js";import{o as W}from"./openAgent-Dbv5wfuL.js";/* empty css */import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";import"./openContent-C6XO6kr5.js";const X=["needs_attention","in_turn","in_flight","callable","blocked"],Y={in_turn:"in turn",in_flight:"in flight",needs_attention:"needs attention",callable:"callable",blocked:"blocked"},Z={in_turn:"working",in_flight:"working",needs_attention:"working",callable:"available",blocked:"offline"};function ee({active:a,onToggle:p}){return e.jsx("div",{className:"fleet-pills",role:"group","aria-label":"State filters",children:X.map(o=>{const l=a.has(o);return e.jsx("button",{type:"button",className:`fleet-pill fleet-pill--${Z[o]}${l?" fleet-pill--on":""}`,onClick:()=>p(o),"aria-pressed":l,children:Y[o]},o)})})}const _=10;function te(a){return b(a.state)}function C(a){return a.updatedAt??a.createdAt??0}function Ye(){const{agents:a,navigate:p}=Q(),{meshSnapshot:o,selectedId:l,selectedType:S,query:d,agentStateFilters:u,hiddenMachineIds:g,treeFullMachineIds:F}=q(),L=J(),m=A.useMemo(()=>o?D(a,o):[],[a,o]),y=A.useMemo(()=>{const n=d.trim().toLowerCase();return m.filter(s=>!g.has(s.machineId)).map(s=>{const t=s.agents.filter(r=>u.has(te(r))?n?`${r.name??""} ${r.project??""} ${r.branch??""} ${r.harness??""}`.toLowerCase().includes(n):!0:!1);return{...s,agents:t}})},[m,d,u,g]),f=A.useMemo(()=>{const n=new Map([["this",[]],["peer",[]],["tailnet",[]]]);for(const s of y){const t=s.reachability==="this"?"this":s.reachability==="peer"?"peer":"tailnet";n.get(t)?.push(s)}return n},[y]);if(!o)return e.jsx("div",{className:"ctx-panel ctx-panel--empty",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsx("div",{className:"ctx-panel-empty-hint",children:"Loading mesh…"})})});const $=n=>{const s=m.map(t=>t.machineId);H(n,s),w(n,"node"),T(n)},v=g.size,x=m.length,E=n=>{w(n.id,"agent");const s=n.authorityNodeId??n.homeNodeId;s&&T(s),W(p,n,{returnTo:{view:"mesh"}})},j=(n,s)=>s.length===0?null:e.jsxs("section",{className:"mesh-nav-group",children:[e.jsx("div",{className:"mesh-nav-group-label",children:n}),s.map(t=>{const r=F.has(t.machineId),c=[...t.agents].sort((i,k)=>C(k)-C(i)),M=r?c:c.slice(0,_),N=c.length-M.length,B=l===t.machineId&&S==="node",R=t.agents.filter(i=>V(i.state)).length,K=t.agents.length>0?`${R}/${t.agents.length}`:t.online?"—":"not ready";return e.jsxs("div",{className:"mesh-nav-machine",children:[e.jsx(h,{name:t.machineLabel,meta:K,tone:"neutral",active:B,onClick:()=>$(t.machineId),title:`Focus ${t.machineLabel} on the map`}),M.map(i=>{const k=l===i.id&&S==="agent",O=L.has(i.id);return e.jsx(h,{name:i.name,tone:b(i.state),depth:1,active:k,unread:O,onClick:()=>E(i),title:i.name},i.id)}),!r&&N>0&&e.jsx(h,{name:`see ${N} more`,depth:1,tone:"neutral",onClick:()=>I(t.machineId),title:"Show all agents on this machine"}),r&&c.length>_&&e.jsx(h,{name:"see less",depth:1,tone:"neutral",onClick:()=>I(t.machineId),title:"Show recent agents only"})]},t.machineId)})]},n);return e.jsxs("div",{className:"ctx-panel mesh-nav",children:[e.jsxs("div",{className:"mesh-nav-head",children:[e.jsx(U,{value:d,onChange:z,placeholder:"Find machines or agents…"}),e.jsx(ee,{active:u,onToggle:P}),v>0&&v<x&&e.jsxs("button",{type:"button",className:"mesh-nav-focus-chip",onClick:G,title:"Show all machines",children:[e.jsxs("span",{className:"mesh-nav-focus-chip-label",children:["focused · ",x-v,"/",x]}),e.jsx("span",{className:"mesh-nav-focus-chip-clear","aria-hidden":!0,children:"×"})]})]}),e.jsxs("div",{className:"mesh-nav-tree",children:[j("this host",f.get("this")??[]),j("peers",f.get("peer")??[]),j("tailnet",f.get("tailnet")??[])]})]})}export{Ye as MeshLeft};
1
+ import{j as e,r as A}from"./index-DmFAhGPj.js";import{u as q,g as z,i as P,j as G,k as I,l as H,a as w,r as T}from"./mesh-view-store-KJzABIkN.js";import{u as Q}from"./Provider-cJCdHAxu.js";import{n as b,a as V}from"./colors-BtO5_zlx.js";import{b as D}from"./mesh-buckets-CfAukILK.js";import{u as J}from"./use-fleet-active-asks-BHzeBZSW.js";import{R as h}from"./RailRow-CLcVmywd.js";import{F as U}from"./FleetSearch-Bj9SCl2f.js";import{o as W}from"./openAgent-Dbv5wfuL.js";/* empty css */import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./openContent-C6XO6kr5.js";const X=["needs_attention","in_turn","in_flight","callable","blocked"],Y={in_turn:"in turn",in_flight:"in flight",needs_attention:"needs attention",callable:"callable",blocked:"blocked"},Z={in_turn:"working",in_flight:"working",needs_attention:"working",callable:"available",blocked:"offline"};function ee({active:a,onToggle:p}){return e.jsx("div",{className:"fleet-pills",role:"group","aria-label":"State filters",children:X.map(o=>{const l=a.has(o);return e.jsx("button",{type:"button",className:`fleet-pill fleet-pill--${Z[o]}${l?" fleet-pill--on":""}`,onClick:()=>p(o),"aria-pressed":l,children:Y[o]},o)})})}const _=10;function te(a){return b(a.state)}function C(a){return a.updatedAt??a.createdAt??0}function Ye(){const{agents:a,navigate:p}=Q(),{meshSnapshot:o,selectedId:l,selectedType:S,query:d,agentStateFilters:u,hiddenMachineIds:g,treeFullMachineIds:F}=q(),L=J(),m=A.useMemo(()=>o?D(a,o):[],[a,o]),y=A.useMemo(()=>{const n=d.trim().toLowerCase();return m.filter(s=>!g.has(s.machineId)).map(s=>{const t=s.agents.filter(r=>u.has(te(r))?n?`${r.name??""} ${r.project??""} ${r.branch??""} ${r.harness??""}`.toLowerCase().includes(n):!0:!1);return{...s,agents:t}})},[m,d,u,g]),f=A.useMemo(()=>{const n=new Map([["this",[]],["peer",[]],["tailnet",[]]]);for(const s of y){const t=s.reachability==="this"?"this":s.reachability==="peer"?"peer":"tailnet";n.get(t)?.push(s)}return n},[y]);if(!o)return e.jsx("div",{className:"ctx-panel ctx-panel--empty",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsx("div",{className:"ctx-panel-empty-hint",children:"Loading mesh…"})})});const $=n=>{const s=m.map(t=>t.machineId);H(n,s),w(n,"node"),T(n)},v=g.size,x=m.length,E=n=>{w(n.id,"agent");const s=n.authorityNodeId??n.homeNodeId;s&&T(s),W(p,n,{returnTo:{view:"mesh"}})},j=(n,s)=>s.length===0?null:e.jsxs("section",{className:"mesh-nav-group",children:[e.jsx("div",{className:"mesh-nav-group-label",children:n}),s.map(t=>{const r=F.has(t.machineId),c=[...t.agents].sort((i,k)=>C(k)-C(i)),M=r?c:c.slice(0,_),N=c.length-M.length,B=l===t.machineId&&S==="node",R=t.agents.filter(i=>V(i.state)).length,K=t.agents.length>0?`${R}/${t.agents.length}`:t.online?"—":"not ready";return e.jsxs("div",{className:"mesh-nav-machine",children:[e.jsx(h,{name:t.machineLabel,meta:K,tone:"neutral",active:B,onClick:()=>$(t.machineId),title:`Focus ${t.machineLabel} on the map`}),M.map(i=>{const k=l===i.id&&S==="agent",O=L.has(i.id);return e.jsx(h,{name:i.name,tone:b(i.state),depth:1,active:k,unread:O,onClick:()=>E(i),title:i.name},i.id)}),!r&&N>0&&e.jsx(h,{name:`see ${N} more`,depth:1,tone:"neutral",onClick:()=>I(t.machineId),title:"Show all agents on this machine"}),r&&c.length>_&&e.jsx(h,{name:"see less",depth:1,tone:"neutral",onClick:()=>I(t.machineId),title:"Show recent agents only"})]},t.machineId)})]},n);return e.jsxs("div",{className:"ctx-panel mesh-nav",children:[e.jsxs("div",{className:"mesh-nav-head",children:[e.jsx(U,{value:d,onChange:z,placeholder:"Find machines or agents…"}),e.jsx(ee,{active:u,onToggle:P}),v>0&&v<x&&e.jsxs("button",{type:"button",className:"mesh-nav-focus-chip",onClick:G,title:"Show all machines",children:[e.jsxs("span",{className:"mesh-nav-focus-chip-label",children:["focused · ",x-v,"/",x]}),e.jsx("span",{className:"mesh-nav-focus-chip-clear","aria-hidden":!0,children:"×"})]})]}),e.jsxs("div",{className:"mesh-nav-tree",children:[j("this host",f.get("this")??[]),j("peers",f.get("peer")??[]),j("tailnet",f.get("tailnet")??[])]})]})}export{Ye as MeshLeft};
@@ -1 +1 @@
1
- import{r,j as o}from"./index-BZovGpDk.js";/* empty css */import{a as j}from"./api-h5zurxmi.js";import{u as v}from"./sse-Bb0EOcU9.js";import{u as N}from"./Provider-p-xuaAoE.js";import{u as g}from"./use-fleet-active-asks-Cnwa4hTK.js";import{i as w}from"./colors-BtO5_zlx.js";import{R as a}from"./RailRow-bRkkXIpR.js";import"./index-BWHgHrtv.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";const $=new Set(["message.posted","conversation.upserted","agent.updated"]);function k(e){const n=x(e.cwd),m=x(e.projectRoot);return e.authorityNodeName??e.homeNodeName??e.authorityNodeId??e.homeNodeId??e.transport??n??m??"local"}function b(e){return e.project??e.role??e.agentClass??"Unassigned"}function x(e){if(!e)return null;const n=e.split("/").filter(Boolean);return n[n.length-1]??null}function ht(){const{agents:e,navigate:n}=N(),[m,f]=r.useState([]),p=g(),c=r.useCallback(async()=>{const t=await j("/api/conversations").catch(()=>[]);f(t)},[]);r.useEffect(()=>{c()},[c]),v(t=>{$.has(t.kind)&&c()});const h=r.useMemo(()=>e.filter(t=>w(t.state)).length,[e]),l=r.useMemo(()=>{let t=0;for(const s of p.values())(s.status==="failed"||s.status==="needs_attention")&&(t+=1);return t},[p]),u=r.useMemo(()=>{const t=new Map;for(const s of e){const i=b(s);t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((s,i)=>i[1]-s[1]).slice(0,8)},[e]),d=r.useMemo(()=>{const t=new Map;for(const s of e){const i=k(s);t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((s,i)=>i[1]-s[1]).slice(0,8)},[e]);return o.jsxs("div",{className:"ctx-panel",children:[o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Agents"}),o.jsx(a,{name:"Overview",meta:`${e.length}`,tone:"neutral",onClick:()=>n({view:"inbox"})}),o.jsx(a,{name:"Agents",meta:`${h}`,tone:"callable",active:!0,onClick:()=>n({view:"ops",mode:"agents"})}),o.jsx(a,{name:"Sessions",meta:`${m.length}`,tone:"neutral",onClick:()=>n({view:"sessions"})}),o.jsx(a,{name:"Alerts",meta:`${l}`,tone:l>0?"in_turn":"neutral",unread:l>0,onClick:()=>n({view:"activity"})})]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Projects"}),u.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No projects"}):u.map(([t,s])=>o.jsx(a,{name:t,meta:`${s}`,tone:"neutral",title:`${s} agent${s===1?"":"s"} on ${t}`},t))]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Machines"}),d.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No machines"}):d.map(([t,s])=>o.jsx(a,{name:t,meta:`${s}`,tone:"neutral",title:`${s} agent${s===1?"":"s"} on ${t}`},t))]})]})}export{ht as OpsAgentsLeft};
1
+ import{r,j as o}from"./index-DmFAhGPj.js";/* empty css */import{a as j}from"./api-h5zurxmi.js";import{u as v}from"./sse-CxXt4tqI.js";import{u as N}from"./Provider-cJCdHAxu.js";import{u as g}from"./use-fleet-active-asks-BHzeBZSW.js";import{i as w}from"./colors-BtO5_zlx.js";import{R as a}from"./RailRow-CLcVmywd.js";import"./index-BWHgHrtv.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";const $=new Set(["message.posted","conversation.upserted","agent.updated"]);function k(e){const n=x(e.cwd),m=x(e.projectRoot);return e.authorityNodeName??e.homeNodeName??e.authorityNodeId??e.homeNodeId??e.transport??n??m??"local"}function b(e){return e.project??e.role??e.agentClass??"Unassigned"}function x(e){if(!e)return null;const n=e.split("/").filter(Boolean);return n[n.length-1]??null}function ht(){const{agents:e,navigate:n}=N(),[m,f]=r.useState([]),p=g(),c=r.useCallback(async()=>{const t=await j("/api/conversations").catch(()=>[]);f(t)},[]);r.useEffect(()=>{c()},[c]),v(t=>{$.has(t.kind)&&c()});const h=r.useMemo(()=>e.filter(t=>w(t.state)).length,[e]),l=r.useMemo(()=>{let t=0;for(const s of p.values())(s.status==="failed"||s.status==="needs_attention")&&(t+=1);return t},[p]),u=r.useMemo(()=>{const t=new Map;for(const s of e){const i=b(s);t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((s,i)=>i[1]-s[1]).slice(0,8)},[e]),d=r.useMemo(()=>{const t=new Map;for(const s of e){const i=k(s);t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((s,i)=>i[1]-s[1]).slice(0,8)},[e]);return o.jsxs("div",{className:"ctx-panel",children:[o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Agents"}),o.jsx(a,{name:"Overview",meta:`${e.length}`,tone:"neutral",onClick:()=>n({view:"inbox"})}),o.jsx(a,{name:"Agents",meta:`${h}`,tone:"callable",active:!0,onClick:()=>n({view:"ops",mode:"agents"})}),o.jsx(a,{name:"Sessions",meta:`${m.length}`,tone:"neutral",onClick:()=>n({view:"sessions"})}),o.jsx(a,{name:"Alerts",meta:`${l}`,tone:l>0?"in_turn":"neutral",unread:l>0,onClick:()=>n({view:"activity"})})]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Projects"}),u.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No projects"}):u.map(([t,s])=>o.jsx(a,{name:t,meta:`${s}`,tone:"neutral",title:`${s} agent${s===1?"":"s"} on ${t}`},t))]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Machines"}),d.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No machines"}):d.map(([t,s])=>o.jsx(a,{name:t,meta:`${s}`,tone:"neutral",title:`${s} agent${s===1?"":"s"} on ${t}`},t))]})]})}export{ht as OpsAgentsLeft};
@@ -1 +1 @@
1
- import{r,j as o}from"./index-BZovGpDk.js";/* empty css */import{a as h}from"./api-h5zurxmi.js";import{n as f}from"./colors-BtO5_zlx.js";import{a as g,r as j}from"./operator-attention-BwSPeheT.js";import{u as N}from"./sse-Bb0EOcU9.js";import{t as c}from"./time-Dhsh_2EG.js";import{u as A}from"./Provider-p-xuaAoE.js";import{o as l}from"./openContent-C6XO6kr5.js";import{R as m}from"./RailRow-bRkkXIpR.js";import"./index-BWHgHrtv.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";const w=[{name:"Control",route:{view:"ops",mode:"mission"},active:e=>e.view==="ops"&&(e.mode===void 0||e.mode==="mission")},{name:"Dispatch",route:{view:"broker"},active:e=>e.view==="broker"},{name:"Mesh",route:{view:"mesh"},active:e=>e.view==="mesh"},{name:"Tail",route:{view:"ops",mode:"tail"},active:e=>e.view==="ops"&&e.mode==="tail"},{name:"Runtime",route:{view:"ops",mode:"atop"},active:e=>e.view==="ops"&&e.mode==="atop"}];function xt(){const{navigate:e,route:n}=A(),[p,d]=r.useState(null),s=r.useCallback(async()=>{const t=await h("/api/fleet").catch(()=>null);d(t)},[]);r.useEffect(()=>{s()},[s]),N(t=>{(t.kind==="message.posted"||t.kind==="flight.updated"||t.kind==="collaboration.event.appended")&&s()});const i=p?.needsAttention??[],a=(p?.activeAsks??[]).filter(t=>t.status!=="needs_attention"),u=t=>{l(e,g(t),{returnTo:n})},v=t=>{l(e,j(t),{returnTo:n})};return o.jsxs("div",{className:"ctx-panel ctx-panel--ops",children:[o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Surfaces"}),w.map(t=>o.jsx(m,{name:t.name,tone:"neutral",active:t.active(n),onClick:()=>e(t.route)},t.name))]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsxs("div",{className:"ctx-panel-section-label",children:["Needs you",i.length>0&&o.jsx("span",{className:"ctx-panel-count",children:i.length})]}),i.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"All clear"}):i.slice(0,4).map(t=>{const x=t.agentName??t.agentId??"operator";return o.jsx(m,{name:t.title,meta:c(t.updatedAt),tone:"in_turn",unread:!0,title:`${x} · ${t.kind}`,onClick:()=>u(t)},t.recordId)})]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsxs("div",{className:"ctx-panel-section-label",children:["Active",a.length>0&&o.jsx("span",{className:"ctx-panel-count",children:a.length})]}),a.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No active requests"}):a.slice(0,10).map(t=>o.jsx(m,{name:t.task,meta:c(t.updatedAt),tone:f(t.agentState),title:`${t.agentName??t.agentId} · ${t.statusLabel}`,onClick:()=>v(t)},t.invocationId))]})]})}export{xt as OpsDefaultLeft};
1
+ import{r,j as o}from"./index-DmFAhGPj.js";/* empty css */import{a as h}from"./api-h5zurxmi.js";import{n as f}from"./colors-BtO5_zlx.js";import{a as g,r as j}from"./operator-attention-BwSPeheT.js";import{u as N}from"./sse-CxXt4tqI.js";import{t as c}from"./time-Dhsh_2EG.js";import{u as A}from"./Provider-cJCdHAxu.js";import{o as l}from"./openContent-C6XO6kr5.js";import{R as m}from"./RailRow-CLcVmywd.js";import"./index-BWHgHrtv.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";const w=[{name:"Control",route:{view:"ops",mode:"mission"},active:e=>e.view==="ops"&&(e.mode===void 0||e.mode==="mission")},{name:"Dispatch",route:{view:"broker"},active:e=>e.view==="broker"},{name:"Mesh",route:{view:"mesh"},active:e=>e.view==="mesh"},{name:"Tail",route:{view:"ops",mode:"tail"},active:e=>e.view==="ops"&&e.mode==="tail"},{name:"Runtime",route:{view:"ops",mode:"atop"},active:e=>e.view==="ops"&&e.mode==="atop"}];function xt(){const{navigate:e,route:n}=A(),[p,d]=r.useState(null),s=r.useCallback(async()=>{const t=await h("/api/fleet").catch(()=>null);d(t)},[]);r.useEffect(()=>{s()},[s]),N(t=>{(t.kind==="message.posted"||t.kind==="flight.updated"||t.kind==="collaboration.event.appended")&&s()});const i=p?.needsAttention??[],a=(p?.activeAsks??[]).filter(t=>t.status!=="needs_attention"),u=t=>{l(e,g(t),{returnTo:n})},v=t=>{l(e,j(t),{returnTo:n})};return o.jsxs("div",{className:"ctx-panel ctx-panel--ops",children:[o.jsxs("section",{className:"ctx-panel-section",children:[o.jsx("div",{className:"ctx-panel-section-label",children:"Surfaces"}),w.map(t=>o.jsx(m,{name:t.name,tone:"neutral",active:t.active(n),onClick:()=>e(t.route)},t.name))]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsxs("div",{className:"ctx-panel-section-label",children:["Needs you",i.length>0&&o.jsx("span",{className:"ctx-panel-count",children:i.length})]}),i.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"All clear"}):i.slice(0,4).map(t=>{const x=t.agentName??t.agentId??"operator";return o.jsx(m,{name:t.title,meta:c(t.updatedAt),tone:"in_turn",unread:!0,title:`${x} · ${t.kind}`,onClick:()=>u(t)},t.recordId)})]}),o.jsxs("section",{className:"ctx-panel-section",children:[o.jsxs("div",{className:"ctx-panel-section-label",children:["Active",a.length>0&&o.jsx("span",{className:"ctx-panel-count",children:a.length})]}),a.length===0?o.jsx("div",{className:"ctx-panel-empty",children:"No active requests"}):a.slice(0,10).map(t=>o.jsx(m,{name:t.task,meta:c(t.updatedAt),tone:f(t.agentState),title:`${t.agentName??t.agentId} · ${t.statusLabel}`,onClick:()=>v(t)},t.invocationId))]})]})}export{xt as OpsDefaultLeft};
@@ -1 +1 @@
1
- import{r as f,j as t}from"./index-BZovGpDk.js";/* empty css */import{t as x}from"./time-Dhsh_2EG.js";import{u as b}from"./Provider-p-xuaAoE.js";import{R as g}from"./RailRow-bRkkXIpR.js";import{S as v}from"./SpriteAvatar-CEYdCzem.js";import{n as L}from"./colors-BtO5_zlx.js";import{b as h,c as j,l as p,d as N}from"./agent-lanes-model-VYQ5a68i.js";import{u as _,b as A,g as n}from"./lane-roster-store-B6ybJlHJ.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./AgentAvatar-CneOa70z.js";import"./agent-identity-BxCsXnDp.js";import"./context-budget-DX_fwUs3.js";import"./lane-observe-BA3g9aVd.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";function c(s,e,i){const a=`[data-lane-id="${s.replace(/["\\]/g,"\\$&")}"]`,r=typeof document<"u"?document.querySelector(a):null;if(r){r.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),r.focus();return}e&&i({view:"agents-v2",agentId:e,tab:"profile"})}function R(s){return s.filter(e=>!h(e)&&j(e)).sort((e,i)=>{const a=(i.updatedAt??0)-(e.updatedAt??0);return a!==0?a:p(e,"scout").localeCompare(p(i,"scout"))}).map(e=>({id:e.id,label:p(e,"scout"),statusLabel:N(e,"scout"),tone:L(e.state,e),agentId:e.id,updatedAt:e.updatedAt??void 0}))}function _o(){const{agents:s,navigate:e}=b(),i=_(),a=A(),r=f.useMemo(()=>R(s),[s]),l=i??r,d=l.some(o=>o.floor);return t.jsx("div",{className:"ctx-panel ctx-panel--ops",children:t.jsxs("section",{className:"ctx-panel-section",children:[t.jsxs("div",{className:"ctx-panel-section-label",children:[d?"Fleet":"Lanes",l.length>0&&t.jsx("span",{className:"ctx-panel-count",children:l.length})]}),l.length===0?t.jsx("div",{className:"ctx-panel-empty",children:"No active lanes"}):l.map(o=>o.floor?t.jsxs("button",{type:"button",className:`agent-floor__ledger-row is-rail${a===o.id?" is-focus":""}`,onClick:()=>{const m=n();m?m.onSelect(o.id):c(o.id,o.agentId,e)},onPointerEnter:()=>n()?.onHover(o.id),onPointerLeave:()=>n()?.onHover(null),children:[t.jsxs("span",{className:"agent-floor__ledger-id",children:[t.jsx(v,{name:o.label,size:16,tile:!0}),t.jsx("span",{className:"agent-floor__ledger-name",children:o.label}),t.jsx("span",{className:`agent-floor__card-dot${o.floor.live?" is-live":""}`})]}),t.jsx("span",{className:"agent-floor__ledger-strip",children:o.floor.strip.slice(-6).map((m,u)=>t.jsx("span",{className:`agent-floor__ledger-cell is-${m}`},u))})]},o.id):t.jsx(g,{name:o.label,sub:o.statusLabel||void 0,meta:o.updatedAt?x(o.updatedAt):void 0,tone:o.tone,title:o.statusLabel,onClick:()=>c(o.id,o.agentId,e)},o.id))]})})}export{_o as OpsLanesLeft};
1
+ import{r as f,j as t}from"./index-DmFAhGPj.js";/* empty css */import{t as x}from"./time-Dhsh_2EG.js";import{u as b}from"./Provider-cJCdHAxu.js";import{R as g}from"./RailRow-CLcVmywd.js";import{S as v}from"./SpriteAvatar-DS6Tmyua.js";import{n as L}from"./colors-BtO5_zlx.js";import{b as h,c as j,l as p,d as N}from"./agent-lanes-model-VYQ5a68i.js";import{u as _,b as A,g as n}from"./lane-roster-store-71vFgAem.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./AgentAvatar-D8ZtMluU.js";import"./agent-identity-BxCsXnDp.js";import"./context-budget-DX_fwUs3.js";import"./lane-observe-BA3g9aVd.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";function c(s,e,i){const a=`[data-lane-id="${s.replace(/["\\]/g,"\\$&")}"]`,r=typeof document<"u"?document.querySelector(a):null;if(r){r.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),r.focus();return}e&&i({view:"agents-v2",agentId:e,tab:"profile"})}function R(s){return s.filter(e=>!h(e)&&j(e)).sort((e,i)=>{const a=(i.updatedAt??0)-(e.updatedAt??0);return a!==0?a:p(e,"scout").localeCompare(p(i,"scout"))}).map(e=>({id:e.id,label:p(e,"scout"),statusLabel:N(e,"scout"),tone:L(e.state,e),agentId:e.id,updatedAt:e.updatedAt??void 0}))}function _o(){const{agents:s,navigate:e}=b(),i=_(),a=A(),r=f.useMemo(()=>R(s),[s]),l=i??r,d=l.some(o=>o.floor);return t.jsx("div",{className:"ctx-panel ctx-panel--ops",children:t.jsxs("section",{className:"ctx-panel-section",children:[t.jsxs("div",{className:"ctx-panel-section-label",children:[d?"Fleet":"Lanes",l.length>0&&t.jsx("span",{className:"ctx-panel-count",children:l.length})]}),l.length===0?t.jsx("div",{className:"ctx-panel-empty",children:"No active lanes"}):l.map(o=>o.floor?t.jsxs("button",{type:"button",className:`agent-floor__ledger-row is-rail${a===o.id?" is-focus":""}`,onClick:()=>{const m=n();m?m.onSelect(o.id):c(o.id,o.agentId,e)},onPointerEnter:()=>n()?.onHover(o.id),onPointerLeave:()=>n()?.onHover(null),children:[t.jsxs("span",{className:"agent-floor__ledger-id",children:[t.jsx(v,{name:o.label,size:16,tile:!0}),t.jsx("span",{className:"agent-floor__ledger-name",children:o.label}),t.jsx("span",{className:`agent-floor__card-dot${o.floor.live?" is-live":""}`})]}),t.jsx("span",{className:"agent-floor__ledger-strip",children:o.floor.strip.slice(-6).map((m,u)=>t.jsx("span",{className:`agent-floor__ledger-cell is-${m}`},u))})]},o.id):t.jsx(g,{name:o.label,sub:o.statusLabel||void 0,meta:o.updatedAt?x(o.updatedAt):void 0,tone:o.tone,title:o.statusLabel,onClick:()=>c(o.id,o.agentId,e)},o.id))]})})}export{_o as OpsLanesLeft};
@@ -1 +1 @@
1
- import{r as c,j as i}from"./index-BZovGpDk.js";/* empty css */import{n as S}from"./colors-BtO5_zlx.js";import{u as M,s as A,a as h,b as I,M as C,c as k,d as w,e as F,r as R,t as E}from"./mission-control-store-CMgIVjLJ.js";import{u as K}from"./Provider-p-xuaAoE.js";import{a as T,b as q,r as B,m as D}from"./keyboard-nav-CHo_xmjw.js";import{MissionLeftAgentRow as L}from"./MissionLeftAgentRow-ByGrNAcs.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./page-status-Bg2hd27j.js";import"./RailRow-bRkkXIpR.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";function Ee(){const{navigate:r}=K(),s=M(),o=s.visibleAgents,m=c.useRef(null),p=c.useRef(null),v=T(),x=D(()=>m.current);q(c.useCallback(()=>p.current,[]));const[d,y]=c.useState(null),u=s.activityFilter==="active",a=s.selectedIds.length,j=e=>{y(t=>t===e?null:e)},N=()=>{if(a===0)return;const t=o.filter(l=>s.selectedIds.includes(l.id)).map(l=>l.handle??l.name).filter(Boolean).join("|");t&&r({view:"ops",mode:"tail",tailQuery:t})};return i.jsxs("div",{className:"ctx-panel ml-panel",children:[i.jsxs("div",{className:"ml-section",children:[i.jsx("div",{className:"ml-section-label",children:"Source"}),i.jsx("div",{className:"ml-chips ml-chips--primary",children:["all","scout","native"].map(e=>i.jsx("button",{type:"button",className:["ml-chip",s.sourceFilter===e&&"ml-chip--active"].filter(Boolean).join(" "),onClick:()=>A(e),children:e==="all"?"All":e==="scout"?"Scout":"Native"},e))})]}),i.jsx("div",{className:"ctx-panel-search",children:i.jsx("input",{ref:p,type:"text",className:"ctx-panel-search-input",placeholder:"Filter agents… (press /)",value:s.query,onChange:e=>h(e.target.value),onKeyDown:e=>{x(e),e.key==="Escape"&&s.query&&h("")}})}),i.jsx("div",{className:"ml-section ml-section--secondary",children:i.jsxs("div",{className:"ml-chips ml-chips--secondary",children:[["active","live","all"].map(e=>i.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",s.activityFilter===e&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>I(e),children:e==="active"?"Active":e==="live"?"Live":"Any"},e)),u&&i.jsx("span",{className:"ml-divider","aria-hidden":!0}),u&&C.map(e=>i.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",s.activityWindowMs===e.value&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>k(e.value),children:e.label},e.value))]})}),i.jsxs("div",{className:"ml-section ml-section--grouping",children:[i.jsx("div",{className:"ml-section-label",children:"Order by"}),i.jsx("div",{className:"ml-chips ml-chips--grouping",children:[["activity","Activity"],["workspace","Project"],["harness","Harness"],["state","Status"],["source","Source"]].map(([e,t])=>i.jsx("button",{type:"button",className:["ml-chip","ml-chip--group",s.groupMode===e&&"ml-chip--group-active"].filter(Boolean).join(" "),"aria-pressed":s.groupMode===e,onClick:()=>w(e),children:t},e))})]}),a>0?i.jsxs("div",{className:"ml-selection",children:[i.jsxs("span",{className:"ml-selection-label",children:[a," selected"]}),i.jsxs("div",{className:"ml-selection-actions",children:[i.jsx("button",{type:"button",className:"ml-selection-btn ml-selection-btn--primary",onClick:N,children:"Tail ↗"}),i.jsx("button",{type:"button",className:"ml-selection-btn",onClick:F,children:"Clear"})]})]}):i.jsxs("div",{className:"ml-count",children:[o.length," visible",i.jsx("span",{className:"ml-count-hint",children:"⌘-click · ⌘A all"})]}),i.jsx("div",{ref:m,className:"ctx-panel-list ctx-panel-list--scroll",onKeyDown:v,children:o.length===0?i.jsx("div",{className:"ctx-panel-empty",children:s.query?"No match":"Nothing visible"}):o.map((e,t)=>{const l=e.id===d,b=o.some(n=>n.id===d),g=s.selectedIds.includes(e.id),f=S(e.state);return i.jsx(L,{agent:e,state:f,isExpanded:l,isSelected:g,tabIndex:B(l,b,t===0),onToggle:n=>{n.metaKey||n.ctrlKey||n.shiftKey?E(e.id):j(e.id)},onReveal:()=>R(e.id),onOpen:()=>r({view:"agents-v2",agentId:e.id})},e.id)})})]})}export{Ee as OpsMissionLeft};
1
+ import{r as c,j as i}from"./index-DmFAhGPj.js";/* empty css */import{n as S}from"./colors-BtO5_zlx.js";import{u as M,s as A,a as h,b as I,M as C,c as k,d as w,e as F,r as R,t as E}from"./mission-control-store-Ce6dOvnZ.js";import{u as K}from"./Provider-cJCdHAxu.js";import{a as T,b as q,r as B,m as D}from"./keyboard-nav-h1IdakpD.js";import{MissionLeftAgentRow as L}from"./MissionLeftAgentRow-iOZ6ds9L.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./page-status-D2FQLJOX.js";import"./RailRow-CLcVmywd.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";function Ee(){const{navigate:r}=K(),s=M(),o=s.visibleAgents,m=c.useRef(null),p=c.useRef(null),v=T(),x=D(()=>m.current);q(c.useCallback(()=>p.current,[]));const[d,y]=c.useState(null),u=s.activityFilter==="active",a=s.selectedIds.length,j=e=>{y(t=>t===e?null:e)},N=()=>{if(a===0)return;const t=o.filter(l=>s.selectedIds.includes(l.id)).map(l=>l.handle??l.name).filter(Boolean).join("|");t&&r({view:"ops",mode:"tail",tailQuery:t})};return i.jsxs("div",{className:"ctx-panel ml-panel",children:[i.jsxs("div",{className:"ml-section",children:[i.jsx("div",{className:"ml-section-label",children:"Source"}),i.jsx("div",{className:"ml-chips ml-chips--primary",children:["all","scout","native"].map(e=>i.jsx("button",{type:"button",className:["ml-chip",s.sourceFilter===e&&"ml-chip--active"].filter(Boolean).join(" "),onClick:()=>A(e),children:e==="all"?"All":e==="scout"?"Scout":"Native"},e))})]}),i.jsx("div",{className:"ctx-panel-search",children:i.jsx("input",{ref:p,type:"text",className:"ctx-panel-search-input",placeholder:"Filter agents… (press /)",value:s.query,onChange:e=>h(e.target.value),onKeyDown:e=>{x(e),e.key==="Escape"&&s.query&&h("")}})}),i.jsx("div",{className:"ml-section ml-section--secondary",children:i.jsxs("div",{className:"ml-chips ml-chips--secondary",children:[["active","live","all"].map(e=>i.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",s.activityFilter===e&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>I(e),children:e==="active"?"Active":e==="live"?"Live":"Any"},e)),u&&i.jsx("span",{className:"ml-divider","aria-hidden":!0}),u&&C.map(e=>i.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",s.activityWindowMs===e.value&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>k(e.value),children:e.label},e.value))]})}),i.jsxs("div",{className:"ml-section ml-section--grouping",children:[i.jsx("div",{className:"ml-section-label",children:"Order by"}),i.jsx("div",{className:"ml-chips ml-chips--grouping",children:[["activity","Activity"],["workspace","Project"],["harness","Harness"],["state","Status"],["source","Source"]].map(([e,t])=>i.jsx("button",{type:"button",className:["ml-chip","ml-chip--group",s.groupMode===e&&"ml-chip--group-active"].filter(Boolean).join(" "),"aria-pressed":s.groupMode===e,onClick:()=>w(e),children:t},e))})]}),a>0?i.jsxs("div",{className:"ml-selection",children:[i.jsxs("span",{className:"ml-selection-label",children:[a," selected"]}),i.jsxs("div",{className:"ml-selection-actions",children:[i.jsx("button",{type:"button",className:"ml-selection-btn ml-selection-btn--primary",onClick:N,children:"Tail ↗"}),i.jsx("button",{type:"button",className:"ml-selection-btn",onClick:F,children:"Clear"})]})]}):i.jsxs("div",{className:"ml-count",children:[o.length," visible",i.jsx("span",{className:"ml-count-hint",children:"⌘-click · ⌘A all"})]}),i.jsx("div",{ref:m,className:"ctx-panel-list ctx-panel-list--scroll",onKeyDown:v,children:o.length===0?i.jsx("div",{className:"ctx-panel-empty",children:s.query?"No match":"Nothing visible"}):o.map((e,t)=>{const l=e.id===d,b=o.some(n=>n.id===d),g=s.selectedIds.includes(e.id),f=S(e.state);return i.jsx(L,{agent:e,state:f,isExpanded:l,isSelected:g,tabIndex:B(l,b,t===0),onToggle:n=>{n.metaKey||n.ctrlKey||n.shiftKey?E(e.id):j(e.id)},onReveal:()=>R(e.id),onOpen:()=>r({view:"agents-v2",agentId:e.id})},e.id)})})]})}export{Ee as OpsMissionLeft};
@@ -0,0 +1 @@
1
+ import{j as t}from"./index-DmFAhGPj.js";import{u as o}from"./Provider-cJCdHAxu.js";import{OpsAgentsLeft as m}from"./left-agents-Ck4Xn-R8.js";import{OpsDefaultLeft as p}from"./left-default-BeOyS0bR.js";import{OpsLanesLeft as i}from"./left-lanes-DZp3jJMo.js";import{OpsMissionLeft as s}from"./left-mission-CuKFQ5xL.js";import{OpsPlanLeft as e}from"./left-plan-3rrFENhp.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";/* empty css */import"./use-fleet-active-asks-BHzeBZSW.js";import"./RailRow-CLcVmywd.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./operator-attention-BwSPeheT.js";import"./openContent-C6XO6kr5.js";import"./agent-lanes-model-VYQ5a68i.js";import"./context-budget-DX_fwUs3.js";import"./lane-observe-BA3g9aVd.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-roster-store-71vFgAem.js";import"./mission-control-store-Ce6dOvnZ.js";import"./MissionLeftAgentRow-iOZ6ds9L.js";import"./page-status-D2FQLJOX.js";import"./FleetSearch-Bj9SCl2f.js";function Lt(){const{route:r}=o();if(r.view!=="ops")return null;switch(r.mode){case"mission":return t.jsx(s,{});case"agents":return t.jsx(m,{});case"plan":return t.jsx(e,{});case"lanes":return t.jsx(i,{});default:return t.jsx(p,{})}}export{Lt as OpsLeft};
@@ -1,2 +1,2 @@
1
- import{r as a,j as s}from"./index-BZovGpDk.js";/* empty css */import{a as k}from"./api-h5zurxmi.js";import{u as y}from"./sse-Bb0EOcU9.js";import{t as S}from"./time-Dhsh_2EG.js";import{u as w}from"./Provider-p-xuaAoE.js";import{F as C}from"./FleetSearch-Dsi_l2KW.js";import"./index-BWHgHrtv.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";const u={all:"All",claude:"Claude",codex:"Codex",openscout:"OpenScout",workspace:"Workspace",unknown:"Other"},L={active:"Active",archived:"Archived",blocked:"Blocked",completed:"Complete",draft:"Draft",unknown:"Unknown"};function b(e){const o=e.replace(/\\/g,"/").replace(/\/+$/g,""),l=o.lastIndexOf("/");return l>=0?o.slice(l+1):o}function A(e){return e.steps.length===0?"No steps":`${e.steps.filter(l=>l.status==="completed").length}/${e.steps.length} steps`}function E(e){return[e.title,e.summary,e.source,e.documentKind,e.status,e.path,e.workspaceName,e.agentName,e.tags.join(" "),e.steps.map(o=>o.text).join(" ")].filter(Boolean).join(" ").toLowerCase()}function vt(){const{route:e,navigate:o}=w(),[l,f]=a.useState(null),[i,m]=a.useState(""),[r,h]=a.useState("all"),[x,v]=a.useState(!0),p=a.useCallback(async()=>{const t=await k("/api/plan-documents").catch(()=>null);f(t),v(!1)},[]);a.useEffect(()=>{p()},[p]),y(t=>{(t.kind==="message.posted"||t.kind==="flight.updated"||t.kind==="collaboration.event.appended")&&p()});const n=l?.documents??[],j=e.view==="ops"&&e.mode==="plan"?e.planDocumentId:void 0,c=i.trim().toLowerCase(),g=a.useMemo(()=>{const t={all:n.length,claude:0,codex:0,openscout:0,workspace:0,unknown:0};for(const N of n)t[N.source]+=1;return t},[n]),d=a.useMemo(()=>n.filter(t=>r==="all"||t.source===r).filter(t=>!c||E(t).includes(c)),[n,c,r]);return s.jsxs("div",{className:"s-plan-left-nav",children:[s.jsx("div",{className:"s-left-roster-search",children:s.jsx(C,{value:i,onChange:m,placeholder:"Search plan documents...",onKeyDown:t=>{t.key==="Escape"&&(i?m(""):t.target.blur())}})}),s.jsx("div",{className:"s-plan-left-source-grid",children:["all","claude","codex","openscout","workspace"].map(t=>s.jsxs("button",{type:"button",className:`s-plan-left-source${r===t?" s-plan-left-source--active":""}`,onClick:()=>h(t),children:[s.jsx("span",{children:u[t]}),s.jsx("strong",{children:g[t]})]},t))}),s.jsx("div",{className:"s-plan-left-list",children:x&&n.length===0?s.jsx("div",{className:"s-left-roster-empty",children:"Indexing plan documents..."}):d.length===0?s.jsx("div",{className:"s-left-roster-empty",children:n.length===0?"No plan documents found":"No plans match"}):d.map(t=>s.jsxs("button",{type:"button",className:`s-plan-left-document${t.id===j?" s-plan-left-document--active":""}`,onClick:()=>o({view:"ops",mode:"plan",planDocumentId:t.id}),title:`${t.path}
1
+ import{r as a,j as s}from"./index-DmFAhGPj.js";/* empty css */import{a as k}from"./api-h5zurxmi.js";import{u as y}from"./sse-CxXt4tqI.js";import{t as S}from"./time-Dhsh_2EG.js";import{u as w}from"./Provider-cJCdHAxu.js";import{F as C}from"./FleetSearch-Bj9SCl2f.js";import"./index-BWHgHrtv.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";const u={all:"All",claude:"Claude",codex:"Codex",openscout:"OpenScout",workspace:"Workspace",unknown:"Other"},L={active:"Active",archived:"Archived",blocked:"Blocked",completed:"Complete",draft:"Draft",unknown:"Unknown"};function b(e){const o=e.replace(/\\/g,"/").replace(/\/+$/g,""),l=o.lastIndexOf("/");return l>=0?o.slice(l+1):o}function A(e){return e.steps.length===0?"No steps":`${e.steps.filter(l=>l.status==="completed").length}/${e.steps.length} steps`}function E(e){return[e.title,e.summary,e.source,e.documentKind,e.status,e.path,e.workspaceName,e.agentName,e.tags.join(" "),e.steps.map(o=>o.text).join(" ")].filter(Boolean).join(" ").toLowerCase()}function vt(){const{route:e,navigate:o}=w(),[l,f]=a.useState(null),[i,m]=a.useState(""),[r,h]=a.useState("all"),[x,v]=a.useState(!0),p=a.useCallback(async()=>{const t=await k("/api/plan-documents").catch(()=>null);f(t),v(!1)},[]);a.useEffect(()=>{p()},[p]),y(t=>{(t.kind==="message.posted"||t.kind==="flight.updated"||t.kind==="collaboration.event.appended")&&p()});const n=l?.documents??[],j=e.view==="ops"&&e.mode==="plan"?e.planDocumentId:void 0,c=i.trim().toLowerCase(),g=a.useMemo(()=>{const t={all:n.length,claude:0,codex:0,openscout:0,workspace:0,unknown:0};for(const N of n)t[N.source]+=1;return t},[n]),d=a.useMemo(()=>n.filter(t=>r==="all"||t.source===r).filter(t=>!c||E(t).includes(c)),[n,c,r]);return s.jsxs("div",{className:"s-plan-left-nav",children:[s.jsx("div",{className:"s-left-roster-search",children:s.jsx(C,{value:i,onChange:m,placeholder:"Search plan documents...",onKeyDown:t=>{t.key==="Escape"&&(i?m(""):t.target.blur())}})}),s.jsx("div",{className:"s-plan-left-source-grid",children:["all","claude","codex","openscout","workspace"].map(t=>s.jsxs("button",{type:"button",className:`s-plan-left-source${r===t?" s-plan-left-source--active":""}`,onClick:()=>h(t),children:[s.jsx("span",{children:u[t]}),s.jsx("strong",{children:g[t]})]},t))}),s.jsx("div",{className:"s-plan-left-list",children:x&&n.length===0?s.jsx("div",{className:"s-left-roster-empty",children:"Indexing plan documents..."}):d.length===0?s.jsx("div",{className:"s-left-roster-empty",children:n.length===0?"No plan documents found":"No plans match"}):d.map(t=>s.jsxs("button",{type:"button",className:`s-plan-left-document${t.id===j?" s-plan-left-document--active":""}`,onClick:()=>o({view:"ops",mode:"plan",planDocumentId:t.id}),title:`${t.path}
2
2
  ${t.summary??""}`,children:[s.jsxs("div",{className:"s-plan-left-document-top",children:[s.jsx("span",{className:`s-plan-left-status s-plan-left-status--${t.status}`,children:L[t.status]}),s.jsx("span",{children:u[t.source]}),s.jsx("time",{children:S(t.updatedAt)})]}),s.jsx("div",{className:"s-plan-left-document-title",children:t.title}),t.summary&&s.jsx("div",{className:"s-plan-left-document-summary",children:t.summary}),s.jsxs("div",{className:"s-plan-left-document-foot",children:[s.jsx("span",{children:A(t)}),s.jsx("span",{children:b(t.path)})]})]},t.id))})]})}export{vt as OpsPlanLeft};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./index-BZovGpDk.js";/* empty css */import{t as O}from"./time-Dhsh_2EG.js";import{u as H}from"./Provider-p-xuaAoE.js";import{S as $}from"./SpriteAvatar-CEYdCzem.js";import{H as R}from"./HarnessMark-DrE57dUq.js";import{AgentSessions as G}from"./AgentSessions-DKoWA0Lm.js";import{a as T}from"./api-h5zurxmi.js";import{u as J}from"./ContextMenu-DnFcmfMR.js";import{g as q,p as V,b as _}from"./agents-project-model-UYiamtrU.js";import{c as Q,e as X,f as Y,g as Z}from"./model-Co0zkMIc.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./agent-identity-BxCsXnDp.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-DsBWV_4k.js";const ee=30*6e4,D=a=>a==="pi"?"grok":a,K=a=>a?a.replace(/^claude-/,"").replace(/-\d{8}$/,""):null;function Xe({agents:a,fleet:d,sessionByAgentId:c,sessions:A,discovery:k,loading:C,navigate:x,selectedAgentId:S}){const{route:N,reload:p,openContextCapture:u}=H(),m=N.view==="agents-v2"?N.projectSlug:void 0,f=l.useMemo(()=>{const n=new Map;for(const b of d?.activeAsks??[]){const i=n.get(b.agentId)??[];i.push(b),n.set(b.agentId,i)}return n},[d?.activeAsks]),v=l.useMemo(()=>a.map(n=>Q(n,c.get(n.id)??null,f.get(n.id)??[])),[f,a,c]),g=l.useMemo(()=>X(k,Date.now()),[k]),h=l.useMemo(()=>Y(v,A,g),[v,A,g]),w=l.useMemo(()=>h.find(n=>n.slice.slug===m)??h[0]??null,[h,m]),r=w?.slice.slug,M={selectAgent:n=>x({view:"agents-v2",agentId:n.agent.id,...r?{projectSlug:r}:{}}),openAgentPage:n=>x({view:"agents-v2",agentId:n.agent.id,tab:"profile"}),startSession:n=>u({intent:"new-task",projectPath:n.agent.projectRoot??n.agent.cwd??void 0}),openSession:n=>x(n),configureAgent:n=>x({view:"agents-v2",agentId:n.agent.id,tab:"config"}),restartAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/config`,{method:"POST",body:JSON.stringify({restart:!0})}).catch(()=>{})},stopAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/interrupt`,{method:"POST",body:JSON.stringify({})}).catch(()=>{})},archiveAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/archive`,{method:"POST",body:JSON.stringify({archived:!0})}).then(()=>p()).catch(()=>{})}};return!w&&C?e.jsx("div",{className:"s-aproj","aria-busy":"true",children:e.jsx("div",{className:"ap-loading",role:"status","aria-label":"Loading agents",children:Array.from({length:7},(n,b)=>e.jsx("span",{"aria-hidden":"true"},b))})}):w?e.jsx("div",{className:"s-aproj",children:e.jsx(te,{project:w,selectedAgentId:S,gestures:M,sessions:A})}):e.jsx("div",{className:"s-aproj",children:e.jsx("div",{className:"ap-empty",children:"No agents discovered yet — they appear here as harnesses register and work."})})}function se(){return e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.2",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"m10.5 10.5 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function ae({tone:a}){return a==="idle"?null:e.jsx("span",{className:"ap-dot","data-tone":a,"aria-hidden":!0})}function ne({g:a,gestures:d,sessions:c,selected:A,cursor:k,rowRef:C}){const x=J(),S=Date.now()-a.lastActivityAt<ee,N=a.needs?"needs":S?"live":"idle",p=a.nodes[0];if(!p)return null;const u=p.row.agent.handle?.trim()||a.name,m=a.branches.length>0?a.branches:["main"],f=m.length>1,v=f?`${m.length} branches`:m[0],g=[...new Set(a.nodes.map(r=>r.row.agent.model).filter(r=>!!r))],h=g.length>1,w=[{kind:"action",label:"Configure…",onSelect:()=>d.configureAgent(p.row)},{kind:"action",label:"Restart",onSelect:()=>d.restartAgent(p.row)},{kind:"separator"},{kind:"action",label:"Stop",onSelect:()=>d.stopAgent(p.row)},{kind:"action",label:"Archive",onSelect:()=>d.archiveAgent(p.row)}];return e.jsxs("div",{ref:C,tabIndex:-1,className:"ap-row","data-tone":N,"data-selected":A||void 0,"data-cursor":k||void 0,children:[e.jsxs("div",{className:"ap-rowMain",onClick:()=>d.selectAgent(p.row),children:[e.jsxs("div",{className:"ap-rowBody",children:[e.jsxs("div",{className:"ap-rowTop",children:[e.jsx(ae,{tone:N}),e.jsxs("span",{className:"ap-rowName","data-idle":N==="idle"||void 0,children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"@"}),u]}),e.jsx("span",{className:"ap-rowMark","aria-hidden":!0,children:e.jsx(R,{harness:D(a.harness),size:11})}),a.needs?e.jsx("span",{className:"ap-needsWord",children:"needs you"}):N==="live"?e.jsx("span",{className:"ap-rowState",children:"working"}):null]}),e.jsxs("div",{className:"ap-rowMeta",children:[e.jsx("span",{className:"ap-rowBranch","data-dim":!0,title:f?m.join(" · "):void 0,children:v}),h?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ap-rowDivider","aria-hidden":!0}),e.jsxs("span",{className:"ap-rowDim",title:g.join(" · "),children:[g.length," models"]})]}):null,a.sessionCount?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ap-rowDivider","aria-hidden":!0}),e.jsxs("span",{className:"ap-rowDim",children:[a.sessionCount," session",a.sessionCount===1?"":"s"]})]}):null]})]}),e.jsxs("div",{className:"ap-rowTailWrap",children:[e.jsxs("div",{className:"ap-rowTail",children:[e.jsxs("div",{className:"ap-tailMeta","aria-hidden":N==="needs"||void 0,children:[e.jsx("span",{className:"ap-rowAgo",children:a.lastActivityAt?O(a.lastActivityAt):"—"}),!h&&K(a.model)?e.jsx("span",{className:"ap-rowModel",children:K(a.model)}):null]}),e.jsxs("div",{className:"ap-rowActions",children:[e.jsx("button",{type:"button",className:"ap-act ap-actPrimary",onClick:r=>{r.stopPropagation(),d.openAgentPage(p.row)},children:"Open ↗"}),e.jsx("button",{type:"button",className:"ap-act",onClick:r=>{r.stopPropagation(),d.startSession(p.row)},children:"+ Session"})]})]}),e.jsx("button",{type:"button",className:"ap-rowMore","aria-label":"Agent actions",title:"Configure · restart · stop",onClick:r=>{r.stopPropagation(),x(r,w)},children:"⋯"})]})]}),e.jsx(G,{agentIds:a.nodes.map(r=>r.row.agent.id),sessions:c})]})}function te({project:a,selectedAgentId:d,gestures:c,sessions:A}){const[k,C]=l.useState(""),[x,S]=l.useState(null),[N,p]=l.useState(!1),[u,m]=l.useState(-1),f=l.useRef(null),v=l.useRef(new Map),g=l.useMemo(()=>q(a),[a]),{primary:h,ephemeral:w}=l.useMemo(()=>V(g),[g]),r=l.useMemo(()=>_(a),[a]),M=l.useMemo(()=>[...new Set(h.map(s=>D(s.harness)))],[h]),n=k.trim().toLowerCase(),b=s=>(!x||D(s.harness)===x)&&(!n||s.name.toLowerCase().includes(n)||s.branches.some(t=>t.toLowerCase().includes(n))||s.harness.includes(n)),i=h.filter(b),I=w.filter(b),E=!!(n||x),o=i.find(s=>s.needs)??i[0],U=i.some(s=>s.needs),B=h.length<=1;Z(a);const W=g.reduce((s,t)=>s+t.sessionCount,0),z=s=>!!(d&&s.nodes.some(t=>t.row.agent.id===d));return l.useEffect(()=>{function s(t){const y=document.activeElement,L=!!y&&(y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.isContentEditable);if(t.key.toLowerCase()==="k"&&(t.metaKey||t.ctrlKey)||t.key==="/"&&!L){t.preventDefault(),f.current?.focus(),f.current?.select();return}if(t.key==="Escape"){L&&y?.blur();return}if(L)return;const F=i.length;if(F){if(t.key==="ArrowDown"||t.key==="j")t.preventDefault(),m(j=>j<0?0:Math.min(F-1,j+1));else if(t.key==="ArrowUp"||t.key==="k")t.preventDefault(),m(j=>j<0?0:Math.max(0,j-1));else if(t.key==="Enter"&&(t.metaKey||t.ctrlKey)){const j=i.find(P=>P.needs)??i[0];j&&(t.preventDefault(),m(i.indexOf(j)),c.selectAgent(j.nodes[0].row))}else if(t.key==="Enter"){const j=u<0?0:u,P=i[j];P&&(t.preventDefault(),m(j),c.selectAgent(P.nodes[0].row))}}}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[i,u,c]),l.useEffect(()=>{if(!(u<0)){if(u>=i.length){m(i.length-1);return}v.current.get(i[u]?.name??"")?.scrollIntoView({block:"nearest"})}},[u,i]),e.jsx("div",{className:"ap-view",children:e.jsxs("div",{className:"ap-content",children:[e.jsxs("header",{className:"ap-head",children:[e.jsx($,{name:a.slice.title,size:56,tile:!0}),e.jsxs("div",{className:"ap-headIdent",children:[e.jsx("div",{className:"ap-headTop",children:e.jsxs("h1",{className:"ap-headName",children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"/"}),a.slice.title]})}),a.slice.root?e.jsx("span",{className:"ap-headRoot",children:a.slice.root}):null]}),e.jsx("div",{className:"ap-headActions",children:e.jsx("button",{type:"button",className:"ap-headCta",disabled:!o,onClick:()=>o&&c.startSession(o.nodes[0].row),children:"+ New agent"})})]}),e.jsxs("div",{className:"ap-digest",children:[e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:h.length}),e.jsx("span",{className:"ap-statLbl",children:h.length===1?"agent":"agents"})]}),e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:W}),e.jsx("span",{className:"ap-statLbl",children:W===1?"session":"sessions"})]}),r.length>0?e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:r.length}),e.jsx("span",{className:"ap-statLbl",children:"in flight"})]}):null,e.jsx("span",{className:"ap-statMarks",children:M.map(s=>e.jsx("span",{title:s,"aria-hidden":!0,children:e.jsx(R,{harness:s,size:12})},s))})]}),o&&!E&&!B?e.jsxs("div",{className:"ap-resume","data-tone":o.needs?"needs":"live","aria-live":"polite",children:[e.jsx("span",{className:"ap-dot","data-tone":o.needs?"needs":"live","aria-hidden":!0}),e.jsx("span",{className:"ap-resumeLbl",children:o.needs?"Waiting on you":"Most recent"}),e.jsxs("span",{className:"ap-resumeWho",children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"@"}),o.nodes[0].row.agent.handle?.trim()||o.name]}),e.jsxs("span",{className:"ap-resumeMeta",children:[o.branches[0]??"main"," · ",o.lastActivityAt?O(o.lastActivityAt):"—"]}),e.jsxs("span",{className:"ap-resumeActions",children:[e.jsx("button",{type:"button",className:"ap-linkAccent",onClick:()=>c.selectAgent(o.nodes[0].row),children:o.needs?"Continue":"Resume"}),e.jsx("button",{type:"button",className:"ap-link",onClick:()=>c.openAgentPage(o.nodes[0].row),children:"Open ↗"})]})]}):null,B?null:e.jsxs("div",{className:"ap-find",children:[e.jsx("span",{className:"ap-findIco","aria-hidden":!0,children:e.jsx(se,{})}),e.jsx("input",{ref:f,className:"ap-findInput",placeholder:"Find an agent, branch, or harness… (⌘K)",value:k,onChange:s=>C(s.target.value)}),e.jsx("div",{className:"ap-findFilters",children:M.map(s=>e.jsxs("button",{type:"button",className:"ap-filter","data-on":x===s||void 0,onClick:()=>S(t=>t===s?null:s),children:[e.jsx(R,{harness:s,size:11}),s.charAt(0).toUpperCase()+s.slice(1)]},s))})]}),e.jsxs("div",{className:"ap-main",children:[e.jsxs("div",{className:"ap-sectionHead",children:[e.jsx("span",{className:"ap-sectionTitle",children:"Agents"}),e.jsxs("span",{className:"ap-sectionMeta",children:[i.length," shown",E?" · filtered":""]}),e.jsxs("span",{className:"ap-kbdHint","aria-hidden":!0,children:["↑↓ move · ↵ open",U?" · ⌘↵ needs":""]})]}),e.jsxs("div",{className:"ap-roster",children:[i.map((s,t)=>e.jsx(ne,{g:s,gestures:c,sessions:A,selected:z(s),cursor:u===t,rowRef:y=>{y?v.current.set(s.name,y):v.current.delete(s.name)}},s.name)),i.length===0?e.jsx("div",{className:"ap-empty",children:E?"No agents match.":I.length?"No primary agents — workflow & clone agents are in the fold below.":"No agents in this project yet."}):null]}),I.length?e.jsxs("div",{className:"ap-ephBlock",children:[e.jsxs("button",{type:"button",className:"ap-ephToggle",onClick:()=>p(s=>!s),children:[e.jsx("span",{className:"ap-ephCount",children:I.length})," ephemeral · workflow & clone agents",e.jsx("span",{className:"ap-ephCaret",children:N?"▴":"▾"})]}),N?e.jsx("div",{className:"ap-ephList",children:I.map(s=>e.jsxs("button",{type:"button",className:"ap-ephRow",onClick:()=>c.openAgentPage(s.nodes[0].row),children:[e.jsx("span",{className:"ap-ephMark","aria-hidden":!0,children:e.jsx(R,{harness:D(s.harness),size:10})}),e.jsx("span",{className:"ap-ephName",children:s.name}),e.jsx("span",{className:"ap-ephBranch",children:s.branches[0]??"main"}),e.jsx("span",{className:"ap-ephAgo",children:s.lastActivityAt?O(s.lastActivityAt):"—"})]},s.name))}):null]}):null,e.jsx("button",{type:"button",className:"ap-newAgent",disabled:!o,onClick:()=>o&&c.startSession(o.nodes[0].row),children:"+ New agent on this project"})]})]})})}export{Xe as AgentsLibrary};
1
+ import{r as l,j as e}from"./index-DmFAhGPj.js";/* empty css */import{t as O}from"./time-Dhsh_2EG.js";import{u as H}from"./Provider-cJCdHAxu.js";import{S as $}from"./SpriteAvatar-DS6Tmyua.js";import{H as R}from"./HarnessMark-BPAphNjx.js";import{AgentSessions as G}from"./AgentSessions-DpY0htZV.js";import{a as T}from"./api-h5zurxmi.js";import{u as J}from"./ContextMenu-CHIuVKz7.js";import{g as q,p as V,b as _}from"./agents-project-model-UYiamtrU.js";import{c as Q,e as X,f as Y,g as Z}from"./model-Co0zkMIc.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./agent-identity-BxCsXnDp.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-DsBWV_4k.js";const ee=30*6e4,D=a=>a==="pi"?"grok":a,K=a=>a?a.replace(/^claude-/,"").replace(/-\d{8}$/,""):null;function Xe({agents:a,fleet:d,sessionByAgentId:c,sessions:A,discovery:k,loading:C,navigate:x,selectedAgentId:S}){const{route:N,reload:p,openContextCapture:u}=H(),m=N.view==="agents-v2"?N.projectSlug:void 0,f=l.useMemo(()=>{const n=new Map;for(const b of d?.activeAsks??[]){const i=n.get(b.agentId)??[];i.push(b),n.set(b.agentId,i)}return n},[d?.activeAsks]),v=l.useMemo(()=>a.map(n=>Q(n,c.get(n.id)??null,f.get(n.id)??[])),[f,a,c]),g=l.useMemo(()=>X(k,Date.now()),[k]),h=l.useMemo(()=>Y(v,A,g),[v,A,g]),w=l.useMemo(()=>h.find(n=>n.slice.slug===m)??h[0]??null,[h,m]),r=w?.slice.slug,M={selectAgent:n=>x({view:"agents-v2",agentId:n.agent.id,...r?{projectSlug:r}:{}}),openAgentPage:n=>x({view:"agents-v2",agentId:n.agent.id,tab:"profile"}),startSession:n=>u({intent:"new-task",projectPath:n.agent.projectRoot??n.agent.cwd??void 0}),openSession:n=>x(n),configureAgent:n=>x({view:"agents-v2",agentId:n.agent.id,tab:"config"}),restartAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/config`,{method:"POST",body:JSON.stringify({restart:!0})}).catch(()=>{})},stopAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/interrupt`,{method:"POST",body:JSON.stringify({})}).catch(()=>{})},archiveAgent:n=>{T(`/api/agents/${encodeURIComponent(n.agent.id)}/archive`,{method:"POST",body:JSON.stringify({archived:!0})}).then(()=>p()).catch(()=>{})}};return!w&&C?e.jsx("div",{className:"s-aproj","aria-busy":"true",children:e.jsx("div",{className:"ap-loading",role:"status","aria-label":"Loading agents",children:Array.from({length:7},(n,b)=>e.jsx("span",{"aria-hidden":"true"},b))})}):w?e.jsx("div",{className:"s-aproj",children:e.jsx(te,{project:w,selectedAgentId:S,gestures:M,sessions:A})}):e.jsx("div",{className:"s-aproj",children:e.jsx("div",{className:"ap-empty",children:"No agents discovered yet — they appear here as harnesses register and work."})})}function se(){return e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.2",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"m10.5 10.5 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function ae({tone:a}){return a==="idle"?null:e.jsx("span",{className:"ap-dot","data-tone":a,"aria-hidden":!0})}function ne({g:a,gestures:d,sessions:c,selected:A,cursor:k,rowRef:C}){const x=J(),S=Date.now()-a.lastActivityAt<ee,N=a.needs?"needs":S?"live":"idle",p=a.nodes[0];if(!p)return null;const u=p.row.agent.handle?.trim()||a.name,m=a.branches.length>0?a.branches:["main"],f=m.length>1,v=f?`${m.length} branches`:m[0],g=[...new Set(a.nodes.map(r=>r.row.agent.model).filter(r=>!!r))],h=g.length>1,w=[{kind:"action",label:"Configure…",onSelect:()=>d.configureAgent(p.row)},{kind:"action",label:"Restart",onSelect:()=>d.restartAgent(p.row)},{kind:"separator"},{kind:"action",label:"Stop",onSelect:()=>d.stopAgent(p.row)},{kind:"action",label:"Archive",onSelect:()=>d.archiveAgent(p.row)}];return e.jsxs("div",{ref:C,tabIndex:-1,className:"ap-row","data-tone":N,"data-selected":A||void 0,"data-cursor":k||void 0,children:[e.jsxs("div",{className:"ap-rowMain",onClick:()=>d.selectAgent(p.row),children:[e.jsxs("div",{className:"ap-rowBody",children:[e.jsxs("div",{className:"ap-rowTop",children:[e.jsx(ae,{tone:N}),e.jsxs("span",{className:"ap-rowName","data-idle":N==="idle"||void 0,children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"@"}),u]}),e.jsx("span",{className:"ap-rowMark","aria-hidden":!0,children:e.jsx(R,{harness:D(a.harness),size:11})}),a.needs?e.jsx("span",{className:"ap-needsWord",children:"needs you"}):N==="live"?e.jsx("span",{className:"ap-rowState",children:"working"}):null]}),e.jsxs("div",{className:"ap-rowMeta",children:[e.jsx("span",{className:"ap-rowBranch","data-dim":!0,title:f?m.join(" · "):void 0,children:v}),h?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ap-rowDivider","aria-hidden":!0}),e.jsxs("span",{className:"ap-rowDim",title:g.join(" · "),children:[g.length," models"]})]}):null,a.sessionCount?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ap-rowDivider","aria-hidden":!0}),e.jsxs("span",{className:"ap-rowDim",children:[a.sessionCount," session",a.sessionCount===1?"":"s"]})]}):null]})]}),e.jsxs("div",{className:"ap-rowTailWrap",children:[e.jsxs("div",{className:"ap-rowTail",children:[e.jsxs("div",{className:"ap-tailMeta","aria-hidden":N==="needs"||void 0,children:[e.jsx("span",{className:"ap-rowAgo",children:a.lastActivityAt?O(a.lastActivityAt):"—"}),!h&&K(a.model)?e.jsx("span",{className:"ap-rowModel",children:K(a.model)}):null]}),e.jsxs("div",{className:"ap-rowActions",children:[e.jsx("button",{type:"button",className:"ap-act ap-actPrimary",onClick:r=>{r.stopPropagation(),d.openAgentPage(p.row)},children:"Open ↗"}),e.jsx("button",{type:"button",className:"ap-act",onClick:r=>{r.stopPropagation(),d.startSession(p.row)},children:"+ Session"})]})]}),e.jsx("button",{type:"button",className:"ap-rowMore","aria-label":"Agent actions",title:"Configure · restart · stop",onClick:r=>{r.stopPropagation(),x(r,w)},children:"⋯"})]})]}),e.jsx(G,{agentIds:a.nodes.map(r=>r.row.agent.id),sessions:c})]})}function te({project:a,selectedAgentId:d,gestures:c,sessions:A}){const[k,C]=l.useState(""),[x,S]=l.useState(null),[N,p]=l.useState(!1),[u,m]=l.useState(-1),f=l.useRef(null),v=l.useRef(new Map),g=l.useMemo(()=>q(a),[a]),{primary:h,ephemeral:w}=l.useMemo(()=>V(g),[g]),r=l.useMemo(()=>_(a),[a]),M=l.useMemo(()=>[...new Set(h.map(s=>D(s.harness)))],[h]),n=k.trim().toLowerCase(),b=s=>(!x||D(s.harness)===x)&&(!n||s.name.toLowerCase().includes(n)||s.branches.some(t=>t.toLowerCase().includes(n))||s.harness.includes(n)),i=h.filter(b),I=w.filter(b),E=!!(n||x),o=i.find(s=>s.needs)??i[0],U=i.some(s=>s.needs),B=h.length<=1;Z(a);const W=g.reduce((s,t)=>s+t.sessionCount,0),z=s=>!!(d&&s.nodes.some(t=>t.row.agent.id===d));return l.useEffect(()=>{function s(t){const y=document.activeElement,L=!!y&&(y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.isContentEditable);if(t.key.toLowerCase()==="k"&&(t.metaKey||t.ctrlKey)||t.key==="/"&&!L){t.preventDefault(),f.current?.focus(),f.current?.select();return}if(t.key==="Escape"){L&&y?.blur();return}if(L)return;const F=i.length;if(F){if(t.key==="ArrowDown"||t.key==="j")t.preventDefault(),m(j=>j<0?0:Math.min(F-1,j+1));else if(t.key==="ArrowUp"||t.key==="k")t.preventDefault(),m(j=>j<0?0:Math.max(0,j-1));else if(t.key==="Enter"&&(t.metaKey||t.ctrlKey)){const j=i.find(P=>P.needs)??i[0];j&&(t.preventDefault(),m(i.indexOf(j)),c.selectAgent(j.nodes[0].row))}else if(t.key==="Enter"){const j=u<0?0:u,P=i[j];P&&(t.preventDefault(),m(j),c.selectAgent(P.nodes[0].row))}}}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[i,u,c]),l.useEffect(()=>{if(!(u<0)){if(u>=i.length){m(i.length-1);return}v.current.get(i[u]?.name??"")?.scrollIntoView({block:"nearest"})}},[u,i]),e.jsx("div",{className:"ap-view",children:e.jsxs("div",{className:"ap-content",children:[e.jsxs("header",{className:"ap-head",children:[e.jsx($,{name:a.slice.title,size:56,tile:!0}),e.jsxs("div",{className:"ap-headIdent",children:[e.jsx("div",{className:"ap-headTop",children:e.jsxs("h1",{className:"ap-headName",children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"/"}),a.slice.title]})}),a.slice.root?e.jsx("span",{className:"ap-headRoot",children:a.slice.root}):null]}),e.jsx("div",{className:"ap-headActions",children:e.jsx("button",{type:"button",className:"ap-headCta",disabled:!o,onClick:()=>o&&c.startSession(o.nodes[0].row),children:"+ New agent"})})]}),e.jsxs("div",{className:"ap-digest",children:[e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:h.length}),e.jsx("span",{className:"ap-statLbl",children:h.length===1?"agent":"agents"})]}),e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:W}),e.jsx("span",{className:"ap-statLbl",children:W===1?"session":"sessions"})]}),r.length>0?e.jsxs("span",{className:"ap-stat",children:[e.jsx("span",{className:"ap-statNum",children:r.length}),e.jsx("span",{className:"ap-statLbl",children:"in flight"})]}):null,e.jsx("span",{className:"ap-statMarks",children:M.map(s=>e.jsx("span",{title:s,"aria-hidden":!0,children:e.jsx(R,{harness:s,size:12})},s))})]}),o&&!E&&!B?e.jsxs("div",{className:"ap-resume","data-tone":o.needs?"needs":"live","aria-live":"polite",children:[e.jsx("span",{className:"ap-dot","data-tone":o.needs?"needs":"live","aria-hidden":!0}),e.jsx("span",{className:"ap-resumeLbl",children:o.needs?"Waiting on you":"Most recent"}),e.jsxs("span",{className:"ap-resumeWho",children:[e.jsx("span",{className:"ap-sigil","aria-hidden":!0,children:"@"}),o.nodes[0].row.agent.handle?.trim()||o.name]}),e.jsxs("span",{className:"ap-resumeMeta",children:[o.branches[0]??"main"," · ",o.lastActivityAt?O(o.lastActivityAt):"—"]}),e.jsxs("span",{className:"ap-resumeActions",children:[e.jsx("button",{type:"button",className:"ap-linkAccent",onClick:()=>c.selectAgent(o.nodes[0].row),children:o.needs?"Continue":"Resume"}),e.jsx("button",{type:"button",className:"ap-link",onClick:()=>c.openAgentPage(o.nodes[0].row),children:"Open ↗"})]})]}):null,B?null:e.jsxs("div",{className:"ap-find",children:[e.jsx("span",{className:"ap-findIco","aria-hidden":!0,children:e.jsx(se,{})}),e.jsx("input",{ref:f,className:"ap-findInput",placeholder:"Find an agent, branch, or harness… (⌘K)",value:k,onChange:s=>C(s.target.value)}),e.jsx("div",{className:"ap-findFilters",children:M.map(s=>e.jsxs("button",{type:"button",className:"ap-filter","data-on":x===s||void 0,onClick:()=>S(t=>t===s?null:s),children:[e.jsx(R,{harness:s,size:11}),s.charAt(0).toUpperCase()+s.slice(1)]},s))})]}),e.jsxs("div",{className:"ap-main",children:[e.jsxs("div",{className:"ap-sectionHead",children:[e.jsx("span",{className:"ap-sectionTitle",children:"Agents"}),e.jsxs("span",{className:"ap-sectionMeta",children:[i.length," shown",E?" · filtered":""]}),e.jsxs("span",{className:"ap-kbdHint","aria-hidden":!0,children:["↑↓ move · ↵ open",U?" · ⌘↵ needs":""]})]}),e.jsxs("div",{className:"ap-roster",children:[i.map((s,t)=>e.jsx(ne,{g:s,gestures:c,sessions:A,selected:z(s),cursor:u===t,rowRef:y=>{y?v.current.set(s.name,y):v.current.delete(s.name)}},s.name)),i.length===0?e.jsx("div",{className:"ap-empty",children:E?"No agents match.":I.length?"No primary agents — workflow & clone agents are in the fold below.":"No agents in this project yet."}):null]}),I.length?e.jsxs("div",{className:"ap-ephBlock",children:[e.jsxs("button",{type:"button",className:"ap-ephToggle",onClick:()=>p(s=>!s),children:[e.jsx("span",{className:"ap-ephCount",children:I.length})," ephemeral · workflow & clone agents",e.jsx("span",{className:"ap-ephCaret",children:N?"▴":"▾"})]}),N?e.jsx("div",{className:"ap-ephList",children:I.map(s=>e.jsxs("button",{type:"button",className:"ap-ephRow",onClick:()=>c.openAgentPage(s.nodes[0].row),children:[e.jsx("span",{className:"ap-ephMark","aria-hidden":!0,children:e.jsx(R,{harness:D(s.harness),size:10})}),e.jsx("span",{className:"ap-ephName",children:s.name}),e.jsx("span",{className:"ap-ephBranch",children:s.branches[0]??"main"}),e.jsx("span",{className:"ap-ephAgo",children:s.lastActivityAt?O(s.lastActivityAt):"—"})]},s.name))}):null]}):null,e.jsx("button",{type:"button",className:"ap-newAgent",disabled:!o,onClick:()=>o&&c.startSession(o.nodes[0].row),children:"+ New agent on this project"})]})]})})}export{Xe as AgentsLibrary};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-DCq_3fQn.js";const e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=c("loader-circle",e);export{a as L};
1
+ import{c}from"./createLucideIcon-CFBn0Sdk.js";const e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=c("loader-circle",e);export{a as L};
@@ -1 +1 @@
1
- import{r}from"./index-BZovGpDk.js";import{a as d}from"./api-h5zurxmi.js";import{u as f}from"./Provider-p-xuaAoE.js";function p(e){if(!e)return null;const s=e.split("/").filter(Boolean);return s[s.length-1]??null}function m(e,s){if(!e)return[];const l=new Set;for(const t of s)t.cwd&&l.add(t.cwd),t.projectRoot&&l.add(t.projectRoot);const o=new Map;for(const t of e.transcripts){if(!t.cwd)continue;const n=o.get(t.cwd),a=t.lastEventAt??t.mtimeMs,c=n?.lastEventAt??n?.mtimeMs??0;(!n||a>c)&&o.set(t.cwd,t)}const i=[];for(const t of e.processes){if(t.harness==="scout-managed"||t.cwd&&l.has(t.cwd))continue;const n=t.cwd?o.get(t.cwd):void 0,a=n?.project??p(t.cwd)??null,c=n?.lastEventAt??n?.mtimeMs??e.generatedAt,u=n?.sessionId??null;i.push({id:`harness:${t.source}:${t.pid}`,definitionId:`harness:${t.source}:${t.pid}`,name:t.source,handle:null,agentClass:"organic",harness:t.source,state:"working",projectRoot:t.cwd,cwd:t.cwd,updatedAt:c,createdAt:null,transport:null,selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:a,branch:null,role:null,model:null,harnessSessionId:u,terminalSurface:null,harnessLogPath:n?.transcriptPath??null,conversationId:u??`harness:${t.pid}`,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null})}return i}function A(){const{agents:e}=f(),[s,l]=r.useState(null);r.useEffect(()=>{let t=!1;const n=async()=>{const c=await d("/api/tail/discover").catch(()=>null);t||l(c)};n();const a=setInterval(()=>{n()},1e4);return()=>{t=!0,clearInterval(a)}},[]);const o=r.useMemo(()=>m(s,e),[s,e]);return{agents:r.useMemo(()=>[...e,...o],[e,o]),scoutAgents:e,organicAgents:o,discovery:s}}export{A as u};
1
+ import{r}from"./index-DmFAhGPj.js";import{a as d}from"./api-h5zurxmi.js";import{u as f}from"./Provider-cJCdHAxu.js";function p(e){if(!e)return null;const s=e.split("/").filter(Boolean);return s[s.length-1]??null}function m(e,s){if(!e)return[];const l=new Set;for(const t of s)t.cwd&&l.add(t.cwd),t.projectRoot&&l.add(t.projectRoot);const o=new Map;for(const t of e.transcripts){if(!t.cwd)continue;const n=o.get(t.cwd),a=t.lastEventAt??t.mtimeMs,c=n?.lastEventAt??n?.mtimeMs??0;(!n||a>c)&&o.set(t.cwd,t)}const i=[];for(const t of e.processes){if(t.harness==="scout-managed"||t.cwd&&l.has(t.cwd))continue;const n=t.cwd?o.get(t.cwd):void 0,a=n?.project??p(t.cwd)??null,c=n?.lastEventAt??n?.mtimeMs??e.generatedAt,u=n?.sessionId??null;i.push({id:`harness:${t.source}:${t.pid}`,definitionId:`harness:${t.source}:${t.pid}`,name:t.source,handle:null,agentClass:"organic",harness:t.source,state:"working",projectRoot:t.cwd,cwd:t.cwd,updatedAt:c,createdAt:null,transport:null,selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:a,branch:null,role:null,model:null,harnessSessionId:u,terminalSurface:null,harnessLogPath:n?.transcriptPath??null,conversationId:u??`harness:${t.pid}`,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null})}return i}function A(){const{agents:e}=f(),[s,l]=r.useState(null);r.useEffect(()=>{let t=!1;const n=async()=>{const c=await d("/api/tail/discover").catch(()=>null);t||l(c)};n();const a=setInterval(()=>{n()},1e4);return()=>{t=!0,clearInterval(a)}},[]);const o=r.useMemo(()=>m(s,e),[s,e]);return{agents:r.useMemo(()=>[...e,...o],[e,o]),scoutAgents:e,organicAgents:o,discovery:s}}export{A as u};