@openscout/scout 0.2.95 → 0.2.96

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 (360) hide show
  1. package/bin/scout +26 -10
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/{ActivityScreen--eANwuxa.js → ActivityScreen-BnoaUkVZ.js} +1 -1
  5. package/dist/client/assets/{AddProjectForm-CcD6qvV8.js → AddProjectForm-IqOtJfRs.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-CYhf6twS.js → AgentAvatar-6-KBVKUu.js} +1 -1
  7. package/dist/client/assets/{AgentConfigurationScreen-BTI24HQX.js → AgentConfigurationScreen-CuZJy07q.js} +1 -1
  8. package/dist/client/assets/{AgentDefinitionsWorkspace-srmN6-vj.js → AgentDefinitionsWorkspace-Iyl4BesU.js} +1 -1
  9. package/dist/client/assets/{AgentDetailCard-UqPNpcvB.js → AgentDetailCard-C9rn3Fj5.js} +1 -1
  10. package/dist/client/assets/{AgentFloorView-XXNgI5Cj.js → AgentFloorView-YT-Jjccf.js} +1 -1
  11. package/dist/client/assets/{AgentInfoScreen-CimdOnZ9.js → AgentInfoScreen-Dr99gQEZ.js} +1 -1
  12. package/dist/client/assets/{AgentLaneCard-Z-aOBR3W.js → AgentLaneCard-DI2iW9zO.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-CyhA1reW.js → AgentLaneChrome-D8bARHMx.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-BNzjMjIH.js → AgentLaneDetailSheet-52un7dKC.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-Box8-_rS.js → AgentLaneSummaryResize-CEBjmPTa.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-Dgcm7zd_.js +1 -0
  17. package/dist/client/assets/AgentLanesPreflight-q20mTjms.js +1 -0
  18. package/dist/client/assets/AgentLanesView-CetZZDyF.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-BwuzOE8h.js → AgentLiveActions-DrEJDJef.js} +1 -1
  20. package/dist/client/assets/AgentMasterScreen-DJPnstoD.js +1 -0
  21. package/dist/client/assets/{AgentSessions-CsZwoukw.js → AgentSessions-DCPCG4xb.js} +1 -1
  22. package/dist/client/assets/{AgentsConsole-KCao4XmX.js → AgentsConsole-CsYOoFJi.js} +1 -1
  23. package/dist/client/assets/{AgentsScreen-CtPAmwRX.js → AgentsScreen-k8LvBuU_.js} +1 -1
  24. package/dist/client/assets/AgentsSubnav-C4xpQhsv.js +1 -0
  25. package/dist/client/assets/{AstronautSuit-Ckx7lu7G.js → AstronautSuit-DbjQtfD_.js} +1 -1
  26. package/dist/client/assets/{AtopView-DYlpgEHf.js → AtopView-Daq_ob3z.js} +1 -1
  27. package/dist/client/assets/{BackToPicker-4JaeRvDm.js → BackToPicker-CXZjBRAe.js} +1 -1
  28. package/dist/client/assets/{BriefingDetailScreen-D6-xqrpo.js → BriefingDetailScreen-CUCXO-KH.js} +1 -1
  29. package/dist/client/assets/{BriefingsScreen-DKxSDEmk.js → BriefingsScreen-B5oMTGKv.js} +1 -1
  30. package/dist/client/assets/{BrokerMetadataPanel-BbREmsbK.js → BrokerMetadataPanel-BsiU8lTD.js} +1 -1
  31. package/dist/client/assets/{BrokerScreen-fbPIouMw.js → BrokerScreen-BPbOHhCS.js} +1 -1
  32. package/dist/client/assets/{CastPicker-BcA2vDDV.js → CastPicker-_5E5hNUe.js} +1 -1
  33. package/dist/client/assets/ChatCollapsedStrip-D-eXhzPf.js +1 -0
  34. package/dist/client/assets/{CodeDiffPane-Cn8Y9hAt.js → CodeDiffPane-n7W4iGUG.js} +1 -1
  35. package/dist/client/assets/{CodeProjectPicker-nPFktrco.js → CodeProjectPicker-CMsbSTDq.js} +1 -1
  36. package/dist/client/assets/{CodeScreen-BlAxtxE5.js → CodeScreen-CeuO3EhR.js} +1 -1
  37. package/dist/client/assets/{ConversationComposer-2HjbGPL9.js → ConversationComposer-CXPKx86g.js} +1 -1
  38. package/dist/client/assets/{ConversationFeedRows-C6wUqJrx.js → ConversationFeedRows-WrH-YI3L.js} +1 -1
  39. package/dist/client/assets/{ConversationHeader-C8vfXaTF.js → ConversationHeader-BQWzGzLK.js} +1 -1
  40. package/dist/client/assets/{ConversationPanels-CNCIbpqU.js → ConversationPanels-Dujvnmup.js} +2 -2
  41. package/dist/client/assets/ConversationScreen-CR9pWB65.js +2 -0
  42. package/dist/client/assets/{ConversationStatus-DZuyKsWN.js → ConversationStatus-DVzSb2Hv.js} +1 -1
  43. package/dist/client/assets/{CrewAvatar-CTIuxp4G.js → CrewAvatar-BwXjyg8N.js} +1 -1
  44. package/dist/client/assets/CrewWorkspaces-CkQDhyie.css +1 -0
  45. package/dist/client/assets/CrewWorkspaces-NKujRzwh.js +1 -0
  46. package/dist/client/assets/{DataTable-6IDhanr5.js → DataTable-Bp8tU9AK.js} +1 -1
  47. package/dist/client/assets/{DispatchAftermath-DC1u9itO.js → DispatchAftermath-B-6rmXzL.js} +1 -1
  48. package/dist/client/assets/{DocumentFocusViewer-DZVhS7as.js → DocumentFocusViewer-Do3wQ_3Z.js} +1 -1
  49. package/dist/client/assets/{EmbeddableSurfacesLab-BKUFJMCV.js → EmbeddableSurfacesLab-C1orRyP9.js} +1 -1
  50. package/dist/client/assets/{EmptyState-CeBl0iGd.js → EmptyState-CJzXj1l5.js} +1 -1
  51. package/dist/client/assets/{FileViewerPane-DQlpNt2S.js → FileViewerPane-Df6VzXjA.js} +1 -1
  52. package/dist/client/assets/FlightObserveScreen-6mGnmWQA.js +1 -0
  53. package/dist/client/assets/{FollowScreen-BXHOp3gb.js → FollowScreen-DvnxYLVh.js} +1 -1
  54. package/dist/client/assets/{HarnessMark-D5CA5uSp.js → HarnessMark-B979GCSB.js} +1 -1
  55. package/dist/client/assets/{HarnessesScreen-DhFXq1qz.js → HarnessesScreen-CHTuv8p6.js} +1 -1
  56. package/dist/client/assets/{HerdrSession-BRhs5LIR.js → HerdrSession-B3McuYgi.js} +1 -1
  57. package/dist/client/assets/{HomeHero-DMABJuze.js → HomeHero-CdUVPjkG.js} +1 -1
  58. package/dist/client/assets/{HostAdvisorView-RAociATV.js → HostAdvisorView-Bok5Sk5c.js} +1 -1
  59. package/dist/client/assets/{KnowledgeSearchInspector-CZPyVNSw.js → KnowledgeSearchInspector-B7XSoJsu.js} +1 -1
  60. package/dist/client/assets/{KnowledgeSearchScreen-mGTKIg00.js → KnowledgeSearchScreen-D3o3IODW.js} +1 -1
  61. package/dist/client/assets/{LaneToolHoverCard-D_DMlBeT.js → LaneToolHoverCard-HByf2ndx.js} +1 -1
  62. package/dist/client/assets/{LaneTraceDetailSheet-BEHg3LmH.js → LaneTraceDetailSheet-BUgHz-sd.js} +1 -1
  63. package/dist/client/assets/{LaneTraceEventFocus-DVimcizS.js → LaneTraceEventFocus-DM-hoPxG.js} +1 -1
  64. package/dist/client/assets/{MeshCanvas-BOuZx4AM.js → MeshCanvas-DCLJRsBy.js} +1 -1
  65. package/dist/client/assets/{MeshCanvasMinimap-wL-1N94e.js → MeshCanvasMinimap-cEFS9eW7.js} +1 -1
  66. package/dist/client/assets/{MeshScreen-DMY9Bmh5.js → MeshScreen-BcxPkhm6.js} +1 -1
  67. package/dist/client/assets/{MeshTopologyView-DiDcX5f4.js → MeshTopologyView-CCRPd8PU.js} +2 -2
  68. package/dist/client/assets/MessagesScreen-Bb5l13MO.js +1 -0
  69. package/dist/client/assets/{MissionContextRail-DrNKXG5u.js → MissionContextRail-DF0_kiU7.js} +1 -1
  70. package/dist/client/assets/{MissionControlView-ByBlHVN8.js → MissionControlView-E3V7bENU.js} +1 -1
  71. package/dist/client/assets/{MissionFocusOverlay-D1i6R6Zt.js → MissionFocusOverlay-h15sQFvP.js} +1 -1
  72. package/dist/client/assets/{MissionLeftAgentRow-DN9NcCML.js → MissionLeftAgentRow-KPdk9rSa.js} +1 -1
  73. package/dist/client/assets/{MissionLogPane-DSeIv3Xo.js → MissionLogPane-BbdDKjUl.js} +1 -1
  74. package/dist/client/assets/{NewAgentModal-V7yK6J6j.js → NewAgentModal-DfHxad34.js} +1 -1
  75. package/dist/client/assets/NewChatComposer-_Stj0fZy.js +19 -0
  76. package/dist/client/assets/{NewChatOrigin-DdpzE4kz.js → NewChatOrigin-B1u7ki70.js} +1 -1
  77. package/dist/client/assets/{ObserveEmbedScreen-l_Q3ts2q.js → ObserveEmbedScreen-Co0xTii6.js} +1 -1
  78. package/dist/client/assets/{ObserveTextFlow-BSEtYTxU.js → ObserveTextFlow-ZQWwrK3i.js} +2 -2
  79. package/dist/client/assets/{ObservedTopologyPanel-CdGUXxGR.js → ObservedTopologyPanel-BJUhDSuQ.js} +1 -1
  80. package/dist/client/assets/{OpenScoutAppShell-DN8dOSK4.js → OpenScoutAppShell-CUd2yOLu.js} +25 -25
  81. package/dist/client/assets/{OpsAgentsView-ntGr4pz4.js → OpsAgentsView-DI5wu1si.js} +1 -1
  82. package/dist/client/assets/OpsScreen-D8fQafCl.js +1 -0
  83. package/dist/client/assets/OpsSubnav-1K4Jaf__.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfile-Bdjd_dAx.js +1 -0
  85. package/dist/client/assets/{ProjectAgentProfileBar-BQET-qrY.js → ProjectAgentProfileBar-k2QHHHsQ.js} +1 -1
  86. package/dist/client/assets/{ProjectAgentProfileHero-Ck8mThtx.js → ProjectAgentProfileHero-Bpxk1ui2.js} +1 -1
  87. package/dist/client/assets/ProjectsInbox-C_bMHLCc.js +2 -0
  88. package/dist/client/assets/ProjectsRail-J-aH_pxT.js +1 -0
  89. package/dist/client/assets/ProjectsScreen-cVUkGbPz.js +1 -0
  90. package/dist/client/assets/ProjectsThreadAside-_ourdM-Q.js +1 -0
  91. package/dist/client/assets/{Provider-B2xuo3rf.js → Provider-CtXJeLrP.js} +1 -1
  92. package/dist/client/assets/{RailRow-B-GycCBx.js → RailRow-CEH2MFBw.js} +1 -1
  93. package/dist/client/assets/{RawSessionsTable-AQThi6sm.js → RawSessionsTable-CDyrom-F.js} +1 -1
  94. package/dist/client/assets/RealtimeVoiceScreen-DBl3DN1H.js +1 -0
  95. package/dist/client/assets/{RepoDiffEmbedScreen-DXWoRF_c.js → RepoDiffEmbedScreen-kY2pHjIs.js} +1 -1
  96. package/dist/client/assets/{RepoDiffPageScreen-D_274ExO.js → RepoDiffPageScreen-C6LhoKrn.js} +1 -1
  97. package/dist/client/assets/{RepoDiffViewer-DbedmHDX.js → RepoDiffViewer-BhcIIQQg.js} +1 -1
  98. package/dist/client/assets/{RepoDiffViewerLazy-C0--fPtk.js → RepoDiffViewerLazy-Csy_j9LD.js} +2 -2
  99. package/dist/client/assets/{ReposScreen-D39_YG4H.js → ReposScreen-B_cB0zu7.js} +1 -1
  100. package/dist/client/assets/ScoutDeckSurface-CSy_fjcG.js +1 -0
  101. package/dist/client/assets/{ScoutSurface-UsRy0t-I.js → ScoutSurface-CQVcSrin.js} +1 -1
  102. package/dist/client/assets/{ScoutbotFxLab-Fmdfboxs.js → ScoutbotFxLab-DqGiLYNy.js} +1 -1
  103. package/dist/client/assets/{SecondaryNav-o2RL9H8H.js → SecondaryNav-BR4VRdgh.js} +1 -1
  104. package/dist/client/assets/SessionEmbedScreen-BTlZ9gAg.js +1 -0
  105. package/dist/client/assets/{SessionObserve-Dsd0j05N.js → SessionObserve-dQDN23pP.js} +1 -1
  106. package/dist/client/assets/{SessionObserveEvidence-DopQYDkD.js → SessionObserveEvidence-BRBGKAgd.js} +1 -1
  107. package/dist/client/assets/SessionRefScreen-COVQMbtE.js +1 -0
  108. package/dist/client/assets/SessionsScreen--5OJ3p3v.js +1 -0
  109. package/dist/client/assets/{SettingsDrawer-_AwuopMS.js → SettingsDrawer-RGVK_bmE.js} +1 -1
  110. package/dist/client/assets/{SettingsScreen-Cw4DDfJP.js → SettingsScreen-CCxzy5IU.js} +1 -1
  111. package/dist/client/assets/{ShikiPane-BfHc_3pM.js → ShikiPane-DYI9Hkge.js} +1 -1
  112. package/dist/client/assets/{SlidePanel-C-q7XwTa.js → SlidePanel-B9ugxWgA.js} +1 -1
  113. package/dist/client/assets/{SpriteAvatar-Bs68ZENy.js → SpriteAvatar-z5hHesx9.js} +1 -1
  114. package/dist/client/assets/{StatusPill-ZZQwxB1a.js → StatusPill-BFvMjmZV.js} +1 -1
  115. package/dist/client/assets/{TailView-Q4FVMsUH.js → TailView-0uEIj2JH.js} +1 -1
  116. package/dist/client/assets/{Terminal-D7zqHwHV.js → Terminal-DouZeNxc.js} +1 -1
  117. package/dist/client/assets/{TerminalEmbedScreen-CXIJ7qv6.js → TerminalEmbedScreen-dMNUbzXr.js} +1 -1
  118. package/dist/client/assets/{TerminalHeaderMount-BnBLOPbb.js → TerminalHeaderMount-BL07cd0q.js} +1 -1
  119. package/dist/client/assets/{TextDocumentSurface-CKQP-cBT.js → TextDocumentSurface-BflAwXeZ.js} +1 -1
  120. package/dist/client/assets/{TmuxPeek-V9dGESfO.js → TmuxPeek-BTnjOQi0.js} +1 -1
  121. package/dist/client/assets/{VoicePermissionsPanel-k7sbLXx2.js → VoicePermissionsPanel-CgQ6GGS-.js} +1 -1
  122. package/dist/client/assets/{WorkDetailScreen-60p9litn.js → WorkDetailScreen-CaLG-zDs.js} +1 -1
  123. package/dist/client/assets/{WorkFilesViewer-BjJS7GyM.js → WorkFilesViewer-B9Sil_No.js} +1 -1
  124. package/dist/client/assets/{activity-Bj3Hnbj3.js → activity-DcrMApUY.js} +1 -1
  125. package/dist/client/assets/{addon-fit-BL-NTWRU.js → addon-fit-DMVrz5Sv.js} +1 -1
  126. package/dist/client/assets/{addon-webgl-CIMgmNjg.js → addon-webgl-BYvpZUyu.js} +1 -1
  127. package/dist/client/assets/{agent-autocomplete-DXlvdc4b.js → agent-autocomplete-B-5QTeas.js} +1 -1
  128. package/dist/client/assets/{agent-essentials-BOMHR0_U.js → agent-essentials-D7KRGYvF.js} +1 -1
  129. package/dist/client/assets/{agent-lane-card-model-CTLxf3R4.js → agent-lane-card-model-CNZMPkhc.js} +1 -1
  130. package/dist/client/assets/{agent-lanes-model-AfrjRNK5.js → agent-lanes-model-DXqjs0OK.js} +2 -2
  131. package/dist/client/assets/agent-master-I1W-5d-x.css +1 -0
  132. package/dist/client/assets/agent-master-model-DqjrVI2h.js +1 -0
  133. package/dist/client/assets/{agent-specialization-BIPIBW8u.js → agent-specialization-BujJVUTD.js} +1 -1
  134. package/dist/client/assets/{arc.es-IR5r6sj_.js → arc.es-NHqHWohb.js} +1 -1
  135. package/dist/client/assets/{arrow-down-BydciYFZ.js → arrow-down-CKtSUjmW.js} +1 -1
  136. package/dist/client/assets/{arrow-left-CghA0kTw.js → arrow-left-Czpf-AE4.js} +1 -1
  137. package/dist/client/assets/{arrow-right-iJFv3jNh.js → arrow-right-BuzMnLYP.js} +1 -1
  138. package/dist/client/assets/{arrow-up-right-CCfZXPqD.js → arrow-up-right-C6Wl-1uw.js} +1 -1
  139. package/dist/client/assets/{bot-B5sub1-i.js → bot-rd0awxD3.js} +1 -1
  140. package/dist/client/assets/{check-C18YQC90.js → check-ofKUE8yH.js} +1 -1
  141. package/dist/client/assets/{chevron-down-Mp9mu_yd.js → chevron-down-wciXnOQz.js} +1 -1
  142. package/dist/client/assets/{chevron-right-CzH-TaSF.js → chevron-right-D-HdlPg8.js} +1 -1
  143. package/dist/client/assets/{chunk-HRAB3GC3-swV8PA2k.js → chunk-HRAB3GC3-Tyv9rzx7.js} +1 -1
  144. package/dist/client/assets/{chunk-JTPDIGGW-BKXqcLKw.js → chunk-JTPDIGGW-BC2Mandc.js} +3 -3
  145. package/dist/client/assets/{chunk-T65CQEWV-vYbNJ8E6.js → chunk-T65CQEWV-C1AWTYZZ.js} +1 -1
  146. package/dist/client/assets/{chunk-YOZR3KYS-U65yUmqt.js → chunk-YOZR3KYS-DwHPHa6f.js} +1 -1
  147. package/dist/client/assets/{clock-B4PTFi5m.js → clock-B88r8OrZ.js} +1 -1
  148. package/dist/client/assets/{code-xml-Jtxsp5d1.js → code-xml-D7pOQM9l.js} +1 -1
  149. package/dist/client/assets/{compass-0_54-vz3.js → compass-Dt1AMXz2.js} +1 -1
  150. package/dist/client/assets/content-9K38QchR.js +1 -0
  151. package/dist/client/assets/content-BRgnyXWh.js +1 -0
  152. package/dist/client/assets/{content-CHghn-rT.js → content-BWPNyXJ0.js} +1 -1
  153. package/dist/client/assets/content-BdkI07v3.js +1 -0
  154. package/dist/client/assets/content-C4oWa8SB.js +1 -0
  155. package/dist/client/assets/content-C9ijJxyl.js +1 -0
  156. package/dist/client/assets/content-CFZ4rghn.js +1 -0
  157. package/dist/client/assets/content-CIqu_Ci_.js +1 -0
  158. package/dist/client/assets/content-CnJF9DGO.js +1 -0
  159. package/dist/client/assets/content-CriW8Y8u.js +1 -0
  160. package/dist/client/assets/content-DDCyPPk_.js +1 -0
  161. package/dist/client/assets/content-DtcZeh5m.js +1 -0
  162. package/dist/client/assets/content-U9tsdtle.js +1 -0
  163. package/dist/client/assets/content-hFLK3CON.js +1 -0
  164. package/dist/client/assets/{content-DMbawvqU.js → content-nkx0swDe.js} +1 -1
  165. package/dist/client/assets/content-p00KQrtD.js +1 -0
  166. package/dist/client/assets/{conversation-icons-BV10B2Me.js → conversation-icons-tp9BX6X2.js} +1 -1
  167. package/dist/client/assets/{conversation-model-CwF6Y9gx.js → conversation-model-Dc02NsGp.js} +1 -1
  168. package/dist/client/assets/conversation-motion-features-D9-RmBSq.js +1 -0
  169. package/dist/client/assets/{copy-Dtpx4FOE.js → copy-CWWAJ75H.js} +1 -1
  170. package/dist/client/assets/{cpu-BjVis9mc.js → cpu-DrqejfkB.js} +1 -1
  171. package/dist/client/assets/{createLucideIcon-DXpqZP7I.js → createLucideIcon-DezKXSG2.js} +1 -1
  172. package/dist/client/assets/{ctx-panel-D_HJ3nhb.css → ctx-panel-F05jXK4Q.css} +1 -1
  173. package/dist/client/assets/discover-C2CZO4Tk.js +2 -0
  174. package/dist/client/assets/embed-entry-BSMUykuG.js +2 -0
  175. package/dist/client/assets/{external-link-Ckiyzjwo.js → external-link-Dp_a2vRZ.js} +1 -1
  176. package/dist/client/assets/{eye-CpfyvdLq.js → eye-BRyD0jno.js} +1 -1
  177. package/dist/client/assets/{file-code-corner-7mo7EviR.js → file-code-corner-muIVH_xO.js} +1 -1
  178. package/dist/client/assets/{file-text-KijGBnME.js → file-text-CqJgwxmv.js} +1 -1
  179. package/dist/client/assets/{gauge-y-Xg8Mrv.js → gauge-hU--hKVP.js} +1 -1
  180. package/dist/client/assets/{gestures-Bq9XnSqY.js → gestures-DN4hEeqv.js} +1 -1
  181. package/dist/client/assets/{git-branch-BQ_x8KZL.js → git-branch-CK5v8F2v.js} +1 -1
  182. package/dist/client/assets/{home-moving-signal-DtRpiNa0.js → home-moving-signal-BjDtEJUP.js} +1 -1
  183. package/dist/client/assets/{home-now-card-DFb4GOgM.js → home-now-card-nF8OotI-.js} +1 -1
  184. package/dist/client/assets/{home-now-card-nano-D--m9jpq.js → home-now-card-nano-C-r_bBg5.js} +1 -1
  185. package/dist/client/assets/{hooks-9d1SoaQA.js → hooks-D46bABUP.js} +1 -1
  186. package/dist/client/assets/index-CPrU5q04.js +1 -0
  187. package/dist/client/assets/{index-CZ-05hKz.js → index-DvLtl7rV.js} +5 -5
  188. package/dist/client/assets/index-kL1WLbeS.js +1 -0
  189. package/dist/client/assets/index-zvhpRHao.js +1 -0
  190. package/dist/client/assets/{inspector-panel-C-EhEDYy.js → inspector-panel-Dkc7rLvY.js} +1 -1
  191. package/dist/client/assets/{keyboard-nav-DFhAJkW3.js → keyboard-nav-BLYDhL3Z.js} +1 -1
  192. package/dist/client/assets/{lane-roster-store-gUBsydNf.js → lane-roster-store-DOdI1O13.js} +1 -1
  193. package/dist/client/assets/{layers-CGou-LwV.js → layers-CSsg3JVP.js} +1 -1
  194. package/dist/client/assets/{layout-grid-BrZt31QH.js → layout-grid-DOChPJdZ.js} +1 -1
  195. package/dist/client/assets/left-B-SdEJSJ.js +1 -0
  196. package/dist/client/assets/{left-B_o51JV6.js → left-B3wSE6ql.js} +1 -1
  197. package/dist/client/assets/{left-CwHZCGO3.js → left-BNRFiRsb.js} +1 -1
  198. package/dist/client/assets/{left-DA0amyfu.js → left-BggzhgXN.js} +1 -1
  199. package/dist/client/assets/left-CARCvvxS.js +2 -0
  200. package/dist/client/assets/left-CpokZYHt.js +1 -0
  201. package/dist/client/assets/{left-CwLs0okF.js → left-YT7mIGuH.js} +1 -1
  202. package/dist/client/assets/{left-advisor-DU3s01gk.js → left-advisor-CCY0vkcO.js} +1 -1
  203. package/dist/client/assets/left-agents-trhO5sL8.js +1 -0
  204. package/dist/client/assets/{left-default-uvuvDmt0.js → left-default-CG33elBs.js} +1 -1
  205. package/dist/client/assets/{left-lanes-DnNLgec8.js → left-lanes-CitMgeTp.js} +1 -1
  206. package/dist/client/assets/{left-mission-DN3-NLPC.js → left-mission-Zl2m_5eU.js} +1 -1
  207. package/dist/client/assets/{library-DIo5NiGP.js → library-DkALuCh5.js} +1 -1
  208. package/dist/client/assets/{loader-circle-BiohlpM3.js → loader-circle-pM56HNhR.js} +1 -1
  209. package/dist/client/assets/{local-agents-wUIaBcEr.js → local-agents-C8xAhbO5.js} +1 -1
  210. package/dist/client/assets/{mentions-CcPFMbmZ.js → mentions-DG6OQrsc.js} +1 -1
  211. package/dist/client/assets/{mesh-buckets-ByyFXdKT.js → mesh-buckets-6y3ZIibI.js} +1 -1
  212. package/dist/client/assets/{mesh-ops-CvGyjK84.js → mesh-ops-BZ1h5RQs.js} +1 -1
  213. package/dist/client/assets/{mesh-roster-n2nDpEmA.js → mesh-roster-Bc7T4b7z.js} +1 -1
  214. package/dist/client/assets/{mesh-view-store-BpxGm71b.js → mesh-view-store-ChUOASK8.js} +1 -1
  215. package/dist/client/assets/{message-circle-B2ddzBrX.js → message-circle-mZCv8tvB.js} +1 -1
  216. package/dist/client/assets/{message-markup-RkfmDfME.js → message-markup-C2LQDm_k.js} +1 -1
  217. package/dist/client/assets/{message-square-D9YYWE0x.js → message-square-C7t_qtuj.js} +1 -1
  218. package/dist/client/assets/{message-visibility-DwxgcgYK.js → message-visibility-CGOmSSKs.js} +1 -1
  219. package/dist/client/assets/{mission-control-store-Bf4b54MV.js → mission-control-store-nDLdUZPA.js} +1 -1
  220. package/dist/client/assets/{observe-CJRIvOCn.js → observe-BpEm1INu.js} +1 -1
  221. package/dist/client/assets/{page-status-BptpTdQ-.js → page-status-E5jnk48p.js} +1 -1
  222. package/dist/client/assets/{paperclip-B1UNGl5d.js → paperclip-C64lkcbM.js} +1 -1
  223. package/dist/client/assets/{persistent-state-YI-WHSCF.js → persistent-state-EHXw8WNy.js} +1 -1
  224. package/dist/client/assets/{plus-CuU_X0-8.js → plus-Co-dqKul.js} +1 -1
  225. package/dist/client/assets/{profile-rY8jO38P.js → profile-APxDsN2P.js} +1 -1
  226. package/dist/client/assets/projects-inbox-Cg4X2lUQ.js +1 -0
  227. package/dist/client/assets/projects-inbox-DRBl2N85.css +1 -0
  228. package/dist/client/assets/{proxy-DnLpZIi9.js → proxy-BiW5suC7.js} +1 -1
  229. package/dist/client/assets/{radio-Dm1ItnA4.js → radio-BOxBQX-T.js} +1 -1
  230. package/dist/client/assets/{refresh-cw-BRn9Oxxl.js → refresh-cw-DMxGzDwn.js} +1 -1
  231. package/dist/client/assets/resolve-panes-DeVJbS9c.js +1 -0
  232. package/dist/client/assets/resolve-sidebar-context-BQe5J6xF.js +1 -0
  233. package/dist/client/assets/{right-BJltPRnd.js → right-Bmfd3pjP.js} +1 -1
  234. package/dist/client/assets/{right-Beh3nCUB.js → right-BqI-nr9G.js} +1 -1
  235. package/dist/client/assets/{right-D3aTKf1F.js → right-BuCgE0fZ.js} +1 -1
  236. package/dist/client/assets/{right-Shpw_xDy.js → right-BwlW6E57.js} +1 -1
  237. package/dist/client/assets/{right-CPP7GyOm.js → right-C0ybUw0j.js} +1 -1
  238. package/dist/client/assets/{right-BbyYdzHn.js → right-CdkcrmeD.js} +1 -1
  239. package/dist/client/assets/{right-CJnB_Bg7.js → right-CimaAvQN.js} +1 -1
  240. package/dist/client/assets/{right-C1yumXNx.js → right-CkCCPbCX.js} +1 -1
  241. package/dist/client/assets/{right-DI1B79nR.js → right-D3eSiy41.js} +1 -1
  242. package/dist/client/assets/{right-DtsRNX5b.js → right-Dz_xD0Vj.js} +1 -1
  243. package/dist/client/assets/{rocket-DOwXHKWA.js → rocket-BQm5_CvR.js} +1 -1
  244. package/dist/client/assets/router-B9vQkNJL.js +1 -0
  245. package/dist/client/assets/{scope-views-A4_vP97W.js → scope-views-1IYJdl41.js} +1 -1
  246. package/dist/client/assets/{scout-voice-BhPzrc6P.js → scout-voice-BVUqGhth.js} +1 -1
  247. package/dist/client/assets/{scoutbot-markdown-jh7tzFB1.js → scoutbot-markdown-BQ_Ee2Ic.js} +1 -1
  248. package/dist/client/assets/{scroll-text-DO0GQzvN.js → scroll-text-Dze_dXtQ.js} +1 -1
  249. package/dist/client/assets/{search-D1tJSAWe.js → search-CDko0PKE.js} +1 -1
  250. package/dist/client/assets/{secondaryNavConfig-B9IF8wXl.js → secondaryNavConfig-BoQ_zYR9.js} +1 -1
  251. package/dist/client/assets/{selection-bridge-i2S9zpf8.js → selection-bridge-Din6yV3h.js} +1 -1
  252. package/dist/client/assets/{send-horizontal-CgLppsIC.js → send-horizontal-CSjIm6xg.js} +1 -1
  253. package/dist/client/assets/{server-Dymv5Emh.js → server-Bzj7lPIx.js} +1 -1
  254. package/dist/client/assets/{session-catalog-DNaOEzoQ.js → session-catalog-DsaZJXZt.js} +1 -1
  255. package/dist/client/assets/session-ref-lookup-state-SATH_jAP.js +1 -0
  256. package/dist/client/assets/{session-table-PTQVoTyc.js → session-table-BQfR7u6r.js} +1 -1
  257. package/dist/client/assets/{settings-2fC_G9nX.js → settings-Dyvpkb1D.js} +1 -1
  258. package/dist/client/assets/{sliders-horizontal-BPSMHhbm.js → sliders-horizontal-C8njVwfg.js} +1 -1
  259. package/dist/client/assets/{sparkles-Dy8p5xN8.js → sparkles-CETYrxGA.js} +1 -1
  260. package/dist/client/assets/{sse-CiOSzE5n.js → sse-CD9MMUxl.js} +1 -1
  261. package/dist/client/assets/{tail-events-BMQmSx1n.js → tail-events-Ps8KpKah.js} +1 -1
  262. package/dist/client/assets/{terminal-yN9xN-h9.js → terminal-9GRS_Qdc.js} +1 -1
  263. package/dist/client/assets/{terminal-relay-9lhzEp2V.js → terminal-relay-GYMIvKs1.js} +1 -1
  264. package/dist/client/assets/{terminal-takeover-DANQfTcy.js → terminal-takeover-_Jyys4me.js} +1 -1
  265. package/dist/client/assets/{text-CnZ0e1-V.js → text-BP3oyl8-.js} +1 -1
  266. package/dist/client/assets/{text-rLpBg4_z.css → text-BYAFNLNq.css} +1 -1
  267. package/dist/client/assets/{use-conversation-list-D9BNLfnW.js → use-conversation-list-C9ABzjXI.js} +1 -1
  268. package/dist/client/assets/use-fleet-active-asks-DAspZQjE.js +1 -0
  269. package/dist/client/assets/{use-mesh-ops-items-BIvIHlqe.js → use-mesh-ops-items-Dh54ymEp.js} +1 -1
  270. package/dist/client/assets/{use-reduced-motion-CKkhq9c5.js → use-reduced-motion-x8pJMVrG.js} +1 -1
  271. package/dist/client/assets/{use-scout-dev-flags-B2KCzPxn.js → use-scout-dev-flags-DhCbiDK3.js} +1 -1
  272. package/dist/client/assets/{useAgentHoverCard-CHBsxcbp.js → useAgentHoverCard-DoBwV0LX.js} +1 -1
  273. package/dist/client/assets/useContentSecondaryNav-pZe2Zfk1.js +1 -0
  274. package/dist/client/assets/{usePierreRuntime-DUuXH5yp.js → usePierreRuntime-ejq9dCWV.js} +1 -1
  275. package/dist/client/assets/{wrench-YcXMlsh2.js → wrench-DjkoAOQt.js} +1 -1
  276. package/dist/client/assets/{x-e3h2hDsp.js → x-CAbNespN.js} +1 -1
  277. package/dist/client/assets/{xterm-Byp1Hep_.js → xterm-Cf-ngcGP.js} +1 -1
  278. package/dist/client/assets/{zap-nMcjPoWB.js → zap-Cq8eWkcF.js} +1 -1
  279. package/dist/client/index.html +1 -1
  280. package/dist/drizzle/0009_old_korg.sql +72 -0
  281. package/dist/drizzle/0010_sparkling_colonel_america.sql +2 -0
  282. package/dist/drizzle/0011_funny_onslaught.sql +4 -0
  283. package/dist/drizzle/0012_high_blazing_skull.sql +16 -0
  284. package/dist/drizzle/0013_perfect_juggernaut.sql +1 -0
  285. package/dist/drizzle/0014_legal_meggan.sql +6 -0
  286. package/dist/drizzle/0015_lame_marvel_boy.sql +12 -0
  287. package/dist/drizzle/0016_early_goliath.sql +6 -0
  288. package/dist/drizzle/meta/0009_snapshot.json +6262 -0
  289. package/dist/drizzle/meta/0010_snapshot.json +6286 -0
  290. package/dist/drizzle/meta/0011_snapshot.json +6337 -0
  291. package/dist/drizzle/meta/0012_snapshot.json +6458 -0
  292. package/dist/drizzle/meta/0013_snapshot.json +6465 -0
  293. package/dist/drizzle/meta/0014_snapshot.json +6503 -0
  294. package/dist/drizzle/meta/0015_snapshot.json +6596 -0
  295. package/dist/drizzle/meta/0016_snapshot.json +6611 -0
  296. package/dist/drizzle/meta/_journal.json +56 -0
  297. package/dist/main.mjs +1306 -360
  298. package/dist/node/main.mjs +314 -12
  299. package/dist/pairing-runtime-controller.mjs +608 -108
  300. package/dist/runtime/base-daemon.mjs +30 -3
  301. package/dist/runtime/broker-daemon.mjs +4771 -529
  302. package/dist/runtime/broker-process-manager.mjs +23 -2
  303. package/dist/runtime/mesh-discover.mjs +23 -2
  304. package/dist/scout-control-plane-web.mjs +1914 -478
  305. package/package.json +2 -2
  306. package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +0 -1
  307. package/dist/client/assets/AgentLanesPreflight-5B6sXvRB.js +0 -1
  308. package/dist/client/assets/AgentLanesView-DHyzVBk6.js +0 -2
  309. package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +0 -1
  310. package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +0 -1
  311. package/dist/client/assets/ConversationScreen-BNULZAp2.js +0 -2
  312. package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
  313. package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +0 -1
  314. package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +0 -1
  315. package/dist/client/assets/MessagesScreen-Eulveud3.js +0 -1
  316. package/dist/client/assets/NewChatComposer-hlWT-nbR.js +0 -19
  317. package/dist/client/assets/OpsScreen-Ppen_Lmj.js +0 -1
  318. package/dist/client/assets/OpsSubnav-GAKsoSor.js +0 -1
  319. package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +0 -1
  320. package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +0 -2
  321. package/dist/client/assets/ProjectsRail-DCfNMmnW.js +0 -1
  322. package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +0 -1
  323. package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +0 -1
  324. package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +0 -1
  325. package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +0 -1
  326. package/dist/client/assets/SessionEmbedScreen-RD5XOx7R.js +0 -1
  327. package/dist/client/assets/SessionRefScreen-B_cTv47v.js +0 -1
  328. package/dist/client/assets/SessionsScreen-Bq0Z77On.js +0 -1
  329. package/dist/client/assets/archive-BjcGiAy8.js +0 -1
  330. package/dist/client/assets/content-6RvWTrtk.js +0 -1
  331. package/dist/client/assets/content-BCgwMUqz.js +0 -1
  332. package/dist/client/assets/content-Bf2VLhx0.js +0 -1
  333. package/dist/client/assets/content-BrU_38-m.js +0 -1
  334. package/dist/client/assets/content-BvvJN8rN.js +0 -1
  335. package/dist/client/assets/content-CAeEqYPw.js +0 -1
  336. package/dist/client/assets/content-CI_Z9DXk.js +0 -1
  337. package/dist/client/assets/content-CbyKONhW.js +0 -1
  338. package/dist/client/assets/content-Czogvp43.js +0 -1
  339. package/dist/client/assets/content-DFk0zNzX.js +0 -1
  340. package/dist/client/assets/content-DHe4DgkA.js +0 -1
  341. package/dist/client/assets/content-DTz7cKjo.js +0 -1
  342. package/dist/client/assets/content-E3kudY-W.js +0 -1
  343. package/dist/client/assets/content-LpO0aO_U.js +0 -1
  344. package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +0 -1
  345. package/dist/client/assets/discover-CHbrEItO.js +0 -2
  346. package/dist/client/assets/embed-entry-vil28MyU.js +0 -2
  347. package/dist/client/assets/index-BVlMw8x_.js +0 -1
  348. package/dist/client/assets/index-Cn0GR-q1.js +0 -1
  349. package/dist/client/assets/index-DosI4AG9.js +0 -1
  350. package/dist/client/assets/left-BpgWnaah.js +0 -1
  351. package/dist/client/assets/left-Cx0kv6pe.js +0 -1
  352. package/dist/client/assets/left-agents-qL5PpUY-.js +0 -1
  353. package/dist/client/assets/left-z-6CkuBe.js +0 -2
  354. package/dist/client/assets/projects-inbox-BBs1hG13.css +0 -1
  355. package/dist/client/assets/projects-inbox-D-zAb9Gp.js +0 -1
  356. package/dist/client/assets/resolve-panes-DO6LkwhQ.js +0 -1
  357. package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +0 -1
  358. package/dist/client/assets/router-DJj2WbDg.js +0 -1
  359. package/dist/client/assets/use-fleet-active-asks-BeAdcl09.js +0 -1
  360. package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +0 -1
@@ -1 +1 @@
1
- import{r as f,j as t}from"./index-CZ-05hKz.js";/* empty css */import{t as x}from"./time-Dhsh_2EG.js";import{u as b}from"./Provider-B2xuo3rf.js";import{R as g}from"./RailRow-B-GycCBx.js";import{S as v}from"./SpriteAvatar-Bs68ZENy.js";import{n as L}from"./colors-BtO5_zlx.js";import{b as h,c as j,l as n,d as N}from"./agent-lanes-model-AfrjRNK5.js";import{u as _,b as A,g as p}from"./lane-roster-store-gUBsydNf.js";import"./router-DJj2WbDg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./index-BVlMw8x_.js";import"./HarnessMark-D5CA5uSp.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./AgentAvatar-CYhf6twS.js";import"./CrewAvatar-CTIuxp4G.js";import"./context-budget-DX_fwUs3.js";import"./lane-observe-vfyACHi0.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";function c(s,e,a){const i=`[data-lane-id="${s.replace(/["\\]/g,"\\$&")}"]`,r=typeof document<"u"?document.querySelector(i):null;if(r){r.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),r.focus();return}e&&a({view:"agents-v2",agentId:e,tab:"profile"})}function R(s){return s.filter(e=>!h(e)&&j(e)).sort((e,a)=>{const i=(a.updatedAt??0)-(e.updatedAt??0);return i!==0?i:n(e,"scout").localeCompare(n(a,"scout"))}).map(e=>({id:e.id,label:n(e,"scout"),statusLabel:N(e,"scout"),tone:L(e.state,e),agentId:e.id,updatedAt:e.updatedAt??void 0}))}function ho(){const{agents:s,navigate:e}=b(),a=_(),i=A(),r=f.useMemo(()=>R(s),[s]),l=a??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${i===o.id?" is-focus":""}`,onClick:()=>{const m=p();m?m.onSelect(o.id):c(o.id,o.agentId,e)},onPointerEnter:()=>p()?.onHover(o.id),onPointerLeave:()=>p()?.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{ho as OpsLanesLeft};
1
+ import{r as f,j as t}from"./index-DvLtl7rV.js";/* empty css */import{t as x}from"./time-Dhsh_2EG.js";import{u as b}from"./Provider-CtXJeLrP.js";import{R as g}from"./RailRow-CEH2MFBw.js";import{S as v}from"./SpriteAvatar-z5hHesx9.js";import{n as L}from"./colors-BtO5_zlx.js";import{b as h,c as j,l as n,d as N}from"./agent-lanes-model-DXqjs0OK.js";import{u as _,b as A,g as p}from"./lane-roster-store-DOdI1O13.js";import"./router-B9vQkNJL.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./index-zvhpRHao.js";import"./HarnessMark-B979GCSB.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./AgentAvatar-6-KBVKUu.js";import"./CrewAvatar-BwXjyg8N.js";import"./context-budget-DX_fwUs3.js";import"./lane-observe-vfyACHi0.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";function c(s,e,a){const i=`[data-lane-id="${s.replace(/["\\]/g,"\\$&")}"]`,r=typeof document<"u"?document.querySelector(i):null;if(r){r.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),r.focus();return}e&&a({view:"agents-v2",agentId:e,tab:"profile"})}function R(s){return s.filter(e=>!h(e)&&j(e)).sort((e,a)=>{const i=(a.updatedAt??0)-(e.updatedAt??0);return i!==0?i:n(e,"scout").localeCompare(n(a,"scout"))}).map(e=>({id:e.id,label:n(e,"scout"),statusLabel:N(e,"scout"),tone:L(e.state,e),agentId:e.id,updatedAt:e.updatedAt??void 0}))}function ho(){const{agents:s,navigate:e}=b(),a=_(),i=A(),r=f.useMemo(()=>R(s),[s]),l=a??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${i===o.id?" is-focus":""}`,onClick:()=>{const m=p();m?m.onSelect(o.id):c(o.id,o.agentId,e)},onPointerEnter:()=>p()?.onHover(o.id),onPointerLeave:()=>p()?.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{ho as OpsLanesLeft};
@@ -1 +1 @@
1
- import{r as c,j as s}from"./index-CZ-05hKz.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-Bf4b54MV.js";import{u as K}from"./Provider-B2xuo3rf.js";import{a as T,b as q,r as B,m as D}from"./keyboard-nav-DFhAJkW3.js";import{MissionLeftAgentRow as L}from"./MissionLeftAgentRow-DN9NcCML.js";import"./router-DJj2WbDg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./NewChatComposer-hlWT-nbR.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./time-Dhsh_2EG.js";import"./index-BVlMw8x_.js";import"./HarnessMark-D5CA5uSp.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./page-status-BptpTdQ-.js";import"./RailRow-B-GycCBx.js";import"./AgentAvatar-CYhf6twS.js";import"./SpriteAvatar-Bs68ZENy.js";import"./CrewAvatar-CTIuxp4G.js";function we(){const{navigate:r}=K(),i=M(),o=i.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=i.activityFilter==="active",a=i.selectedIds.length,j=e=>{y(t=>t===e?null:e)},N=()=>{if(a===0)return;const t=o.filter(l=>i.selectedIds.includes(l.id)).map(l=>l.handle??l.name).filter(Boolean).join("|");t&&r({view:"ops",mode:"tail",tailQuery:t})};return s.jsxs("div",{className:"ctx-panel ml-panel",children:[s.jsxs("div",{className:"ml-section",children:[s.jsx("div",{className:"ml-section-label",children:"Source"}),s.jsx("div",{className:"ml-chips ml-chips--primary",children:["all","scout","native"].map(e=>s.jsx("button",{type:"button",className:["ml-chip",i.sourceFilter===e&&"ml-chip--active"].filter(Boolean).join(" "),onClick:()=>A(e),children:e==="all"?"All":e==="scout"?"Scout":"Native"},e))})]}),s.jsx("div",{className:"ctx-panel-search",children:s.jsx("input",{ref:p,type:"text",className:"ctx-panel-search-input",placeholder:"Filter agents… (press /)",value:i.query,onChange:e=>h(e.target.value),onKeyDown:e=>{x(e),e.key==="Escape"&&i.query&&h("")}})}),s.jsx("div",{className:"ml-section ml-section--secondary",children:s.jsxs("div",{className:"ml-chips ml-chips--secondary",children:[["active","live","all"].map(e=>s.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",i.activityFilter===e&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>I(e),children:e==="active"?"Active":e==="live"?"Live":"Any"},e)),u&&s.jsx("span",{className:"ml-divider","aria-hidden":!0}),u&&C.map(e=>s.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",i.activityWindowMs===e.value&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>k(e.value),children:e.label},e.value))]})}),s.jsxs("div",{className:"ml-section ml-section--grouping",children:[s.jsx("div",{className:"ml-section-label",children:"Order by"}),s.jsx("div",{className:"ml-chips ml-chips--grouping",children:[["activity","Activity"],["workspace","Project"],["harness","Harness"],["state","Status"],["source","Source"]].map(([e,t])=>s.jsx("button",{type:"button",className:["ml-chip","ml-chip--group",i.groupMode===e&&"ml-chip--group-active"].filter(Boolean).join(" "),"aria-pressed":i.groupMode===e,onClick:()=>w(e),children:t},e))})]}),a>0?s.jsxs("div",{className:"ml-selection",children:[s.jsxs("span",{className:"ml-selection-label",children:[a," selected"]}),s.jsxs("div",{className:"ml-selection-actions",children:[s.jsx("button",{type:"button",className:"ml-selection-btn ml-selection-btn--primary",onClick:N,children:"Tail ↗"}),s.jsx("button",{type:"button",className:"ml-selection-btn",onClick:F,children:"Clear"})]})]}):s.jsxs("div",{className:"ml-count",children:[o.length," visible",s.jsx("span",{className:"ml-count-hint",children:"⌘-click · ⌘A all"})]}),s.jsx("div",{ref:m,className:"ctx-panel-list ctx-panel-list--scroll",onKeyDown:v,children:o.length===0?s.jsx("div",{className:"ctx-panel-empty",children:i.query?"No match":"Nothing visible"}):o.map((e,t)=>{const l=e.id===d,b=o.some(n=>n.id===d),g=i.selectedIds.includes(e.id),f=S(e.state);return s.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{we as OpsMissionLeft};
1
+ import{r as c,j as s}from"./index-DvLtl7rV.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-nDLdUZPA.js";import{u as K}from"./Provider-CtXJeLrP.js";import{a as T,b as q,r as B,m as D}from"./keyboard-nav-BLYDhL3Z.js";import{MissionLeftAgentRow as L}from"./MissionLeftAgentRow-KPdk9rSa.js";import"./router-B9vQkNJL.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./time-Dhsh_2EG.js";import"./index-zvhpRHao.js";import"./HarnessMark-B979GCSB.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./page-status-E5jnk48p.js";import"./RailRow-CEH2MFBw.js";import"./AgentAvatar-6-KBVKUu.js";import"./SpriteAvatar-z5hHesx9.js";import"./CrewAvatar-BwXjyg8N.js";function we(){const{navigate:r}=K(),i=M(),o=i.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=i.activityFilter==="active",a=i.selectedIds.length,j=e=>{y(t=>t===e?null:e)},N=()=>{if(a===0)return;const t=o.filter(l=>i.selectedIds.includes(l.id)).map(l=>l.handle??l.name).filter(Boolean).join("|");t&&r({view:"ops",mode:"tail",tailQuery:t})};return s.jsxs("div",{className:"ctx-panel ml-panel",children:[s.jsxs("div",{className:"ml-section",children:[s.jsx("div",{className:"ml-section-label",children:"Source"}),s.jsx("div",{className:"ml-chips ml-chips--primary",children:["all","scout","native"].map(e=>s.jsx("button",{type:"button",className:["ml-chip",i.sourceFilter===e&&"ml-chip--active"].filter(Boolean).join(" "),onClick:()=>A(e),children:e==="all"?"All":e==="scout"?"Scout":"Native"},e))})]}),s.jsx("div",{className:"ctx-panel-search",children:s.jsx("input",{ref:p,type:"text",className:"ctx-panel-search-input",placeholder:"Filter agents… (press /)",value:i.query,onChange:e=>h(e.target.value),onKeyDown:e=>{x(e),e.key==="Escape"&&i.query&&h("")}})}),s.jsx("div",{className:"ml-section ml-section--secondary",children:s.jsxs("div",{className:"ml-chips ml-chips--secondary",children:[["active","live","all"].map(e=>s.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",i.activityFilter===e&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>I(e),children:e==="active"?"Active":e==="live"?"Live":"Any"},e)),u&&s.jsx("span",{className:"ml-divider","aria-hidden":!0}),u&&C.map(e=>s.jsx("button",{type:"button",className:["ml-chip ml-chip--ghost",i.activityWindowMs===e.value&&"ml-chip--ghost-active"].filter(Boolean).join(" "),onClick:()=>k(e.value),children:e.label},e.value))]})}),s.jsxs("div",{className:"ml-section ml-section--grouping",children:[s.jsx("div",{className:"ml-section-label",children:"Order by"}),s.jsx("div",{className:"ml-chips ml-chips--grouping",children:[["activity","Activity"],["workspace","Project"],["harness","Harness"],["state","Status"],["source","Source"]].map(([e,t])=>s.jsx("button",{type:"button",className:["ml-chip","ml-chip--group",i.groupMode===e&&"ml-chip--group-active"].filter(Boolean).join(" "),"aria-pressed":i.groupMode===e,onClick:()=>w(e),children:t},e))})]}),a>0?s.jsxs("div",{className:"ml-selection",children:[s.jsxs("span",{className:"ml-selection-label",children:[a," selected"]}),s.jsxs("div",{className:"ml-selection-actions",children:[s.jsx("button",{type:"button",className:"ml-selection-btn ml-selection-btn--primary",onClick:N,children:"Tail ↗"}),s.jsx("button",{type:"button",className:"ml-selection-btn",onClick:F,children:"Clear"})]})]}):s.jsxs("div",{className:"ml-count",children:[o.length," visible",s.jsx("span",{className:"ml-count-hint",children:"⌘-click · ⌘A all"})]}),s.jsx("div",{ref:m,className:"ctx-panel-list ctx-panel-list--scroll",onKeyDown:v,children:o.length===0?s.jsx("div",{className:"ctx-panel-empty",children:i.query?"No match":"Nothing visible"}):o.map((e,t)=>{const l=e.id===d,b=o.some(n=>n.id===d),g=i.selectedIds.includes(e.id),f=S(e.state);return s.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{we as OpsMissionLeft};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./index-CZ-05hKz.js";/* empty css */import{t as O}from"./time-Dhsh_2EG.js";import{u as H,a as $}from"./Provider-B2xuo3rf.js";import{S as G}from"./SpriteAvatar-Bs68ZENy.js";import{H as R}from"./HarnessMark-D5CA5uSp.js";import{AgentSessions as J}from"./AgentSessions-CsZwoukw.js";import{a as T}from"./api-Co9aQ2Jw.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"./NewChatComposer-hlWT-nbR.js";import"./router-DJj2WbDg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-CiOSzE5n.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./createLucideIcon-DXpqZP7I.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./file-text-KijGBnME.js";import"./x-e3h2hDsp.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-DFhAJkW3.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-CnZ0e1-V.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./conversation-model-CwF6Y9gx.js";import"./index-BVlMw8x_.js";import"./NewChatOrigin-DdpzE4kz.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";const ee=30*6e4,D=a=>a==="pi"?"grok":a,K=a=>a?a.replace(/^claude-/,"").replace(/-\d{8}$/,""):null;function qe({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,v=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]),f=l.useMemo(()=>a.map(n=>Q(n,c.get(n.id)??null,v.get(n.id)??[])),[v,a,c]),g=l.useMemo(()=>X(k,Date.now()),[k]),h=l.useMemo(()=>Y(f,A,g),[f,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=$(),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"],v=m.length>1,f=v?`${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:v?m.join(" · "):void 0,children:f}),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(J,{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),v=l.useRef(null),f=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(),v.current?.focus(),v.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}f.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(G,{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:v,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?f.current.set(s.name,y):f.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{qe as AgentsLibrary};
1
+ import{r as l,j as e}from"./index-DvLtl7rV.js";/* empty css */import{t as O}from"./time-Dhsh_2EG.js";import{u as H,a as $}from"./Provider-CtXJeLrP.js";import{S as G}from"./SpriteAvatar-z5hHesx9.js";import{H as R}from"./HarnessMark-B979GCSB.js";import{AgentSessions as J}from"./AgentSessions-DCPCG4xb.js";import{a as T}from"./api-Co9aQ2Jw.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"./NewChatComposer-_Stj0fZy.js";import"./router-B9vQkNJL.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./index-zvhpRHao.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";const ee=30*6e4,D=a=>a==="pi"?"grok":a,K=a=>a?a.replace(/^claude-/,"").replace(/-\d{8}$/,""):null;function qe({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,v=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]),f=l.useMemo(()=>a.map(n=>Q(n,c.get(n.id)??null,v.get(n.id)??[])),[v,a,c]),g=l.useMemo(()=>X(k,Date.now()),[k]),h=l.useMemo(()=>Y(f,A,g),[f,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=$(),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"],v=m.length>1,f=v?`${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:v?m.join(" · "):void 0,children:f}),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(J,{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),v=l.useRef(null),f=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(),v.current?.focus(),v.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}f.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(G,{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:v,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?f.current.set(s.name,y):f.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{qe as AgentsLibrary};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-DXpqZP7I.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-DezKXSG2.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-CZ-05hKz.js";import{a as d}from"./api-Co9aQ2Jw.js";import{u as f}from"./Provider-B2xuo3rf.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-DvLtl7rV.js";import{a as d}from"./api-Co9aQ2Jw.js";import{u as f}from"./Provider-CtXJeLrP.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 +1 @@
1
- import{j as l,r as d}from"./index-CZ-05hKz.js";import{n as y,e as F,f as V,d as K}from"./colors-BtO5_zlx.js";import{r as T}from"./index-BVlMw8x_.js";import{a as Z}from"./api-Co9aQ2Jw.js";import{u as N}from"./Provider-B2xuo3rf.js";import{A as U}from"./AgentDetailCard-UqPNpcvB.js";const X={workspace:"workspace",worktree:"workspace",branch:"workspace",profile:"profile",persona:"profile",harness:"harness",runtime:"harness",model:"model",node:"node",host:"node"};function G(e){return e.trim().replace(/^@+/,"").replace(/[.,!?;)\]]+$/,"")}function m(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const Y="scout";function B(e){return X[m(e)]??null}function D(e){const n=m(e.definitionId),t=e.workspaceQualifier?m(e.workspaceQualifier):void 0,r=e.profile?m(e.profile):void 0,o=e.harness?m(e.harness):void 0,i=o==="oc"?"opencode":o,s=e.model?m(e.model):void 0,c=e.nodeQualifier?m(e.nodeQualifier):void 0;return n?{definitionId:n,...t?{workspaceQualifier:t}:{},...r?{profile:r}:{},...i?{harness:i}:{},...s?{model:s}:{},...c?{nodeQualifier:c}:{}}:null}function O(e){const n=e.split(".").filter(Boolean),t=n.shift();if(!t)return null;const r={definitionId:t},o=[];for(const i of n){if(i.includes(":")){const[s,c=""]=i.split(":",2),a=B(s),u=m(c);if(!a||!u)return null;a==="workspace"?r.workspaceQualifier=u:a==="profile"?r.profile=u:a==="harness"?r.harness=u:a==="model"?r.model=u:a==="node"&&(r.nodeQualifier=u);continue}o.push(i)}if(o.length===1){const i=m(o[0]);if(!i)return null;r.workspaceQualifier=i}else if(o.length===2){const i=m(o[0]),s=m(o[1]);if(!i||!s)return null;r.workspaceQualifier||(r.workspaceQualifier=i),r.nodeQualifier||(r.nodeQualifier=s)}else if(o.length>2)return null;return M(r,{raw:e})}function J(e){const n=e.indexOf("#"),t=e.indexOf("?");if(n===-1&&t===-1||e.indexOf("#",n+1)!==-1||e.indexOf("?",t+1)!==-1||n!==-1&&t!==-1&&t<n)return null;const r=Math.min(...[n,t].filter(a=>a>=0)),o=e.slice(0,r);if(!o)return null;const i=O(o);if(!i)return null;const s=n>=0?e.slice(n+1,t>=0?t:e.length):"",c=t>=0?e.slice(t+1):"";return n>=0&&!s||t>=0&&!c||s.includes("#")||s.includes("?")||c.includes("#")||c.includes("?")||i.harness&&s||i.model&&c?null:M({definitionId:i.definitionId,nodeQualifier:i.nodeQualifier,workspaceQualifier:i.workspaceQualifier,profile:i.profile,harness:s||i.harness,model:c||i.model},{raw:e})}function q(e){const n=G(e);return!n||n.includes("@")?null:n.includes("#")||n.includes("?")?J(n):O(n)}function L(e,n={}){const t=D(e);if(!t)return n.includeSigil===!1?"":"@";const o=[`${n.includeSigil===!1?"":"@"}${t.definitionId}`];return t.workspaceQualifier&&o.push(t.workspaceQualifier),t.profile&&o.push(`profile:${t.profile}`),t.harness&&o.push(`harness:${t.harness}`),t.model&&o.push(`model:${t.model}`),t.nodeQualifier&&o.push(`node:${t.nodeQualifier}`),o.join(".")}function M(e,n={}){const t=D(e);return t?{raw:n.raw??L(t,{includeSigil:!1}),label:L(t),definitionId:t.definitionId,...t.nodeQualifier?{nodeQualifier:t.nodeQualifier}:{},...t.workspaceQualifier?{workspaceQualifier:t.workspaceQualifier}:{},...t.profile?{profile:t.profile}:{},...t.harness?{harness:t.harness}:{},...t.model?{model:t.model}:{}}:null}function ee(e){return ne(e).parsed}function ne(e){const n=Array.from(e.matchAll(/(^|[\s([{'"`])@([a-z0-9][a-z0-9._/:-]*(?:#[a-z0-9][a-z0-9._/:-]*)?(?:\?[a-z0-9][a-z0-9._/:-]*)?)(?=$|[\s)\]}",.!?:;'"`])/gi)),t=new Map,r=[];for(const o of n){const i=o[2]??"",s=q(i);if(!s){i&&r.push(`@${i}`);continue}t.set(s.label,s)}return{parsed:Array.from(t.values()),unparsed:Array.from(new Set(r))}}const te=280,re=120,E=320,j=8,Q=new Map,ie=1e4;function p(e){const n=e?.trim().replace(/^@+/,"").toLowerCase();return n&&n.length>0?n:null}function W(e){const n=new Set,t=r=>{const o=p(r);o&&n.add(o)};return t(e.id),t(e.handle),t(e.name),t(e.selector),t(e.defaultSelector),t(e.definitionId),e.definitionId&&e.workspaceQualifier&&t(`${e.definitionId}.${e.workspaceQualifier}`),e.definitionId&&e.workspaceQualifier&&e.nodeQualifier&&(t(`${e.definitionId}.${e.workspaceQualifier}.${e.nodeQualifier}`),t(`${e.definitionId}.${e.workspaceQualifier}.node:${e.nodeQualifier}`)),e.definitionId&&e.nodeQualifier&&t(`${e.definitionId}.node:${e.nodeQualifier}`),n}function oe(e,n){const t=p(n.label),r=p(n.raw),o=W(e);return t&&o.has(t)||r&&o.has(r)?!0:n.definitionId&&p(e.definitionId)!==p(n.definitionId)||n.workspaceQualifier&&p(e.workspaceQualifier)!==p(n.workspaceQualifier)||n.nodeQualifier&&p(e.nodeQualifier)!==p(n.nodeQualifier)||n.harness&&p(e.harness)!==p(n.harness)||n.model&&p(e.model)!==p(n.model)?!1:!!n.definitionId}function _(e,n){const t=p(n.label),r=p(n.raw),o=W(e),i=t&&o.has(t)||r&&o.has(r)?1e3:0,s=[n.workspaceQualifier,n.nodeQualifier,n.harness,n.model,n.profile].filter(Boolean).length*100;y(e.state);const c=F(e.state,e)?30:V(e.state,e)?20:0;return i+s+c+Math.min(e.updatedAt??0,9999999999)/1e9}function se(e){const n=p(e.raw);return n&&n.split(".").length>=3?n:null}function H(e,n){const t=n.filter(r=>oe(r,e)).sort((r,o)=>_(o,e)-_(r,e));return t[0]?t[0]:null}async function le(e,n){const t=H(e,n),r=t?.id??se(e),o=r??e.label,i=Q.get(o);if(i&&Date.now()-i.fetchedAt<ie)return i.agent;if(!r)return Q.set(o,{agent:t,fetchedAt:Date.now()}),t;try{const s=await Z(`/api/agents/${encodeURIComponent(r)}`);return Q.set(o,{agent:s,fetchedAt:Date.now()}),s}catch{return Q.set(o,{agent:t,fetchedAt:Date.now()}),t}}function C(e){const n=window.innerWidth,t=window.innerHeight,r=Math.max(j,Math.min(n-E-j,e.left+e.width/2-E/2)),o=e.top-j;return o>200||e.bottom>t-200?{top:o,left:r,placement:"above"}:{top:e.bottom+j,left:r,placement:"below"}}function ae(e){let n=e;for(;n;){if(n instanceof HTMLElement&&n.dataset.scoutTheme)return n;n=n.parentElement??null}return document.body}function ce({identity:e,agent:n,triggerEl:t,onRequestClose:r}){const{agents:o,navigate:i}=N(),[s,c]=d.useState(()=>n??H(e,o)),[a,u]=d.useState(!n),[f,w]=d.useState(()=>C(t.getBoundingClientRect())),x=d.useRef(null),g=ae(t);d.useEffect(()=>{if(n){c(n),u(!1);return}let h=!1;return u(!0),le(e,o).then(I=>{h||(c(I),u(!1))}),()=>{h=!0}},[e,o,n]),d.useEffect(()=>{const h=()=>{w(C(t.getBoundingClientRect()))};return window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[t]),d.useEffect(()=>{const h=I=>{I.key==="Escape"&&r()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r]);const k=d.useCallback(()=>{s&&(i({view:"agents-v2",agentId:s.id}),r())},[s,i,r]),b=f.placement==="above"?"bottom center":"top center",A=f.placement==="above"?"translateY(-100%)":"",$={position:"fixed",top:f.top,left:f.left,width:E,transform:A,transformOrigin:b};return s?T.createPortal(l.jsx("div",{onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx(U,{ref:x,agent:s,pinned:!0,onOpen:k,onClose:r,onAction:r,style:$,className:"agent-card--mention"})}),g):T.createPortal(l.jsx("div",{ref:x,className:"agent-card agent-card--pinned agent-card--mention",role:"dialog","aria-label":`${e.label} snapshot`,style:$,onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx("div",{style:{fontSize:"12px",color:"var(--dim)",padding:"4px 2px"},children:a?"loading…":l.jsxs(l.Fragment,{children:["No agent registered as ",l.jsx("code",{children:e.label}),"."]})})}),g)}function ue(e){return M({definitionId:e.definitionId,workspaceQualifier:e.workspaceQualifier??void 0,nodeQualifier:e.nodeQualifier??void 0,harness:e.harness??void 0,model:e.model??void 0})}function fe(e){const{agent:n,identity:t}=e,[r,o]=d.useState(!1),[i,s]=d.useState(!1),c=d.useRef(null),a=d.useRef(null),u=d.useRef(null),f=d.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),w=d.useCallback(()=>{r||(f(),a.current=window.setTimeout(()=>o(!0),te))},[r,f]),x=d.useCallback(()=>{i||(f(),u.current=window.setTimeout(()=>o(!1),re))},[i,f]),g=d.useCallback(()=>{f(),o(!1),s(!1)},[f]);d.useEffect(()=>()=>f(),[f]);const k=d.useMemo(()=>t??(n?ue(n):null),[t,n]),b=!!k,A=d.useCallback(v=>{if(v.preventDefault(),v.stopPropagation(),r&&i){g();return}f(),s(!0),o(!0)},[r,i,g,f]),$=d.useCallback(v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),s(!0),o(!0))},[]),h=b?{ref:c,onMouseEnter:w,onMouseLeave:x,onFocus:w,onBlur:x,onClick:A,onKeyDown:$,"data-hover-open":r?"true":void 0,"aria-haspopup":"dialog","aria-expanded":r}:{ref:c},I=r&&c.current&&k?l.jsx(ce,{identity:k,agent:n??null,triggerEl:c.current,onRequestClose:()=>{i?g():x()}}):null;return{triggerProps:h,popover:I,open:r,pinned:i}}function de({identity:e,color:n}){const{triggerProps:t,popover:r}=fe({identity:e});return l.jsxs(l.Fragment,{children:[l.jsx("span",{...t,className:"s-mention",role:"button",tabIndex:0,style:{"--mention-color":n},children:e.label}),r]})}const pe=["ts","tsx","js","jsx","mjs","cjs","md","mdx","txt","log","json","jsonc","yaml","yml","toml","css","scss","html","htm","sh","py","rb","go","rs","swift","kt","java","c","cpp","h","png","jpg","jpeg","gif","svg","webp","avif","env","conf","ini","gitignore","sql","xml"],he=pe.join("|"),S=new RegExp(`\\.(?:${he})(?:$|[?#])`,"i"),me=/^(?:\/Users\/|\/home\/|\/Volumes\/|\/var\/|\/etc\/|\/opt\/|\/tmp\/|\/private\/|\/mnt\/|\/Applications\/|\/usr\/|\/Library\/)/u,we=/(?:^|[\s(\[`'"])((?:~\/|\.\/|\.\.\/|\/)[A-Za-z0-9._/\-]+|[A-Za-z0-9._\-]+(?:\/[A-Za-z0-9._\-]+)+)/g;function xe(e){return e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")?!0:e.startsWith("/")&&me.test(e)||S.test(e)}function P(e){const n=[],t=new RegExp(we.source,"g");let r;for(;(r=t.exec(e))!==null;){const o=r[1];if(!o)continue;const i=o.replace(/[.,;:!?]+$/u,"");if(!i||!xe(i))continue;const s=r[0].lastIndexOf(o);if(s<0)continue;const c=r.index+s;n.push({start:c,end:c+i.length,path:i})}return n}function ge(e){return/\.(png|jpe?g|gif|svg|webp|avif)(?:$|[?#])/iu.test(e)}function ve(e){return e.endsWith("/")?!0:!(e.split("/").pop()??"").includes(".")&&!e.startsWith("./")&&!e.startsWith("../")}function ke({kind:e}){return e==="dir"?l.jsx("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:l.jsx("path",{d:"M2 5a1 1 0 0 1 1-1h3.5l1.5 1.5h5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1Z"})}):e==="image"?l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),l.jsx("circle",{cx:"6",cy:"7",r:"1"}),l.jsx("path",{d:"m3 12 3.5-3 2.5 2 3-2.5L14 11"})]}):l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z"}),l.jsx("path",{d:"M9 2v3h3"})]})}function R({path:e}){const{openFilePreview:n}=N(),t=ge(e)?"image":ve(e)?"dir":"file";return l.jsxs("button",{type:"button",className:"s-path-token",onClick:r=>{r.preventDefault(),r.stopPropagation(),n(e)},title:`Open ${e}`,children:[l.jsx(ke,{kind:t}),e]})}function Ie(e,n){if(n.length===0)return[{kind:"text",value:e}];const t=new Map;for(const s of n)t.set(s.label.toLowerCase(),s);const r=[];let o=e;const i=/@([a-z0-9][a-z0-9._/:-]*)/i;for(;o.length>0;){const s=i.exec(o);if(!s||s.index===void 0){r.push({kind:"text",value:o});break}s.index>0&&r.push({kind:"text",value:o.slice(0,s.index)});const c=s[0],a=c.toLowerCase(),u=t.get(a);u?r.push({kind:"mention",identity:u}):r.push({kind:"text",value:c}),o=o.slice(s.index+c.length)}return r}function $e(e,n){const t=[],r=/`([^`\n]+)`|\*\*(.+?)\*\*|\*([^*\s][^*]*?)\*|\[([^\]\n]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>"')\]]+)/g;let o=0,i,s=0;const c=a=>{if(!a)return;const u=P(a);if(u.length===0){t.push(l.jsx("span",{children:a},`${n}-${s++}`));return}let f=0;for(const w of u)w.start>f&&t.push(l.jsx("span",{children:a.slice(f,w.start)},`${n}-${s++}`)),t.push(l.jsx(R,{path:w.path},`${n}-${s++}`)),f=w.end;f<a.length&&t.push(l.jsx("span",{children:a.slice(f)},`${n}-${s++}`))};for(;(i=r.exec(e))!==null;){if(i.index>o&&c(e.slice(o,i.index)),i[1]!==void 0){const a=i[1],u=P(` ${a}`);u.length===1&&u[0].path===a?t.push(l.jsx(R,{path:a},`${n}-${s++}`)):t.push(l.jsx("code",{className:"s-inline-code",children:a},`${n}-${s++}`))}else if(i[2]!==void 0)t.push(l.jsx("strong",{children:i[2]},`${n}-${s++}`));else if(i[3]!==void 0)t.push(l.jsx("em",{children:i[3]},`${n}-${s++}`));else if(i[4]!==void 0&&i[5]!==void 0&&z(i[5]))t.push(l.jsx("a",{className:"s-inline-link",href:i[5],target:"_blank",rel:"noreferrer",children:i[4]},`${n}-${s++}`));else if(i[6]!==void 0&&z(i[6])){const a=i[6].replace(/[.,;:!?]+$/u,""),u=i[6].slice(a.length);t.push(l.jsx("a",{className:"s-inline-link",href:a,target:"_blank",rel:"noreferrer",children:a},`${n}-${s++}`)),u&&t.push(l.jsx("span",{children:u},`${n}-${s++}`))}else t.push(l.jsx("span",{children:i[0]},`${n}-${s++}`));o=i.index+i[0].length}return o<e.length&&c(e.slice(o)),t.length>0?t:[l.jsx("span",{children:e},n)]}function z(e){return/^(?:https?:\/\/|mailto:|\/|#)/iu.test(e)}function Te(e){if(!e)return e??"";const n=ee(e);return Ie(e,n).flatMap((r,o)=>{if(r.kind==="text")return $e(r.value,o*100);const{identity:i}=r,c=i.definitionId===Y?"var(--accent)":K(i.definitionId);return l.jsx(de,{identity:i,color:c},o)})}export{Te as r};
1
+ import{j as l,r as d}from"./index-DvLtl7rV.js";import{n as y,e as F,f as V,d as K}from"./colors-BtO5_zlx.js";import{r as T}from"./index-zvhpRHao.js";import{a as Z}from"./api-Co9aQ2Jw.js";import{u as N}from"./Provider-CtXJeLrP.js";import{A as U}from"./AgentDetailCard-C9rn3Fj5.js";const X={workspace:"workspace",worktree:"workspace",branch:"workspace",profile:"profile",persona:"profile",harness:"harness",runtime:"harness",model:"model",node:"node",host:"node"};function G(e){return e.trim().replace(/^@+/,"").replace(/[.,!?;)\]]+$/,"")}function m(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const Y="scout";function B(e){return X[m(e)]??null}function D(e){const n=m(e.definitionId),t=e.workspaceQualifier?m(e.workspaceQualifier):void 0,r=e.profile?m(e.profile):void 0,o=e.harness?m(e.harness):void 0,i=o==="oc"?"opencode":o,s=e.model?m(e.model):void 0,c=e.nodeQualifier?m(e.nodeQualifier):void 0;return n?{definitionId:n,...t?{workspaceQualifier:t}:{},...r?{profile:r}:{},...i?{harness:i}:{},...s?{model:s}:{},...c?{nodeQualifier:c}:{}}:null}function O(e){const n=e.split(".").filter(Boolean),t=n.shift();if(!t)return null;const r={definitionId:t},o=[];for(const i of n){if(i.includes(":")){const[s,c=""]=i.split(":",2),a=B(s),u=m(c);if(!a||!u)return null;a==="workspace"?r.workspaceQualifier=u:a==="profile"?r.profile=u:a==="harness"?r.harness=u:a==="model"?r.model=u:a==="node"&&(r.nodeQualifier=u);continue}o.push(i)}if(o.length===1){const i=m(o[0]);if(!i)return null;r.workspaceQualifier=i}else if(o.length===2){const i=m(o[0]),s=m(o[1]);if(!i||!s)return null;r.workspaceQualifier||(r.workspaceQualifier=i),r.nodeQualifier||(r.nodeQualifier=s)}else if(o.length>2)return null;return M(r,{raw:e})}function J(e){const n=e.indexOf("#"),t=e.indexOf("?");if(n===-1&&t===-1||e.indexOf("#",n+1)!==-1||e.indexOf("?",t+1)!==-1||n!==-1&&t!==-1&&t<n)return null;const r=Math.min(...[n,t].filter(a=>a>=0)),o=e.slice(0,r);if(!o)return null;const i=O(o);if(!i)return null;const s=n>=0?e.slice(n+1,t>=0?t:e.length):"",c=t>=0?e.slice(t+1):"";return n>=0&&!s||t>=0&&!c||s.includes("#")||s.includes("?")||c.includes("#")||c.includes("?")||i.harness&&s||i.model&&c?null:M({definitionId:i.definitionId,nodeQualifier:i.nodeQualifier,workspaceQualifier:i.workspaceQualifier,profile:i.profile,harness:s||i.harness,model:c||i.model},{raw:e})}function q(e){const n=G(e);return!n||n.includes("@")?null:n.includes("#")||n.includes("?")?J(n):O(n)}function L(e,n={}){const t=D(e);if(!t)return n.includeSigil===!1?"":"@";const o=[`${n.includeSigil===!1?"":"@"}${t.definitionId}`];return t.workspaceQualifier&&o.push(t.workspaceQualifier),t.profile&&o.push(`profile:${t.profile}`),t.harness&&o.push(`harness:${t.harness}`),t.model&&o.push(`model:${t.model}`),t.nodeQualifier&&o.push(`node:${t.nodeQualifier}`),o.join(".")}function M(e,n={}){const t=D(e);return t?{raw:n.raw??L(t,{includeSigil:!1}),label:L(t),definitionId:t.definitionId,...t.nodeQualifier?{nodeQualifier:t.nodeQualifier}:{},...t.workspaceQualifier?{workspaceQualifier:t.workspaceQualifier}:{},...t.profile?{profile:t.profile}:{},...t.harness?{harness:t.harness}:{},...t.model?{model:t.model}:{}}:null}function ee(e){return ne(e).parsed}function ne(e){const n=Array.from(e.matchAll(/(^|[\s([{'"`])@([a-z0-9][a-z0-9._/:-]*(?:#[a-z0-9][a-z0-9._/:-]*)?(?:\?[a-z0-9][a-z0-9._/:-]*)?)(?=$|[\s)\]}",.!?:;'"`])/gi)),t=new Map,r=[];for(const o of n){const i=o[2]??"",s=q(i);if(!s){i&&r.push(`@${i}`);continue}t.set(s.label,s)}return{parsed:Array.from(t.values()),unparsed:Array.from(new Set(r))}}const te=280,re=120,E=320,j=8,Q=new Map,ie=1e4;function p(e){const n=e?.trim().replace(/^@+/,"").toLowerCase();return n&&n.length>0?n:null}function W(e){const n=new Set,t=r=>{const o=p(r);o&&n.add(o)};return t(e.id),t(e.handle),t(e.name),t(e.selector),t(e.defaultSelector),t(e.definitionId),e.definitionId&&e.workspaceQualifier&&t(`${e.definitionId}.${e.workspaceQualifier}`),e.definitionId&&e.workspaceQualifier&&e.nodeQualifier&&(t(`${e.definitionId}.${e.workspaceQualifier}.${e.nodeQualifier}`),t(`${e.definitionId}.${e.workspaceQualifier}.node:${e.nodeQualifier}`)),e.definitionId&&e.nodeQualifier&&t(`${e.definitionId}.node:${e.nodeQualifier}`),n}function oe(e,n){const t=p(n.label),r=p(n.raw),o=W(e);return t&&o.has(t)||r&&o.has(r)?!0:n.definitionId&&p(e.definitionId)!==p(n.definitionId)||n.workspaceQualifier&&p(e.workspaceQualifier)!==p(n.workspaceQualifier)||n.nodeQualifier&&p(e.nodeQualifier)!==p(n.nodeQualifier)||n.harness&&p(e.harness)!==p(n.harness)||n.model&&p(e.model)!==p(n.model)?!1:!!n.definitionId}function _(e,n){const t=p(n.label),r=p(n.raw),o=W(e),i=t&&o.has(t)||r&&o.has(r)?1e3:0,s=[n.workspaceQualifier,n.nodeQualifier,n.harness,n.model,n.profile].filter(Boolean).length*100;y(e.state);const c=F(e.state,e)?30:V(e.state,e)?20:0;return i+s+c+Math.min(e.updatedAt??0,9999999999)/1e9}function se(e){const n=p(e.raw);return n&&n.split(".").length>=3?n:null}function H(e,n){const t=n.filter(r=>oe(r,e)).sort((r,o)=>_(o,e)-_(r,e));return t[0]?t[0]:null}async function le(e,n){const t=H(e,n),r=t?.id??se(e),o=r??e.label,i=Q.get(o);if(i&&Date.now()-i.fetchedAt<ie)return i.agent;if(!r)return Q.set(o,{agent:t,fetchedAt:Date.now()}),t;try{const s=await Z(`/api/agents/${encodeURIComponent(r)}`);return Q.set(o,{agent:s,fetchedAt:Date.now()}),s}catch{return Q.set(o,{agent:t,fetchedAt:Date.now()}),t}}function C(e){const n=window.innerWidth,t=window.innerHeight,r=Math.max(j,Math.min(n-E-j,e.left+e.width/2-E/2)),o=e.top-j;return o>200||e.bottom>t-200?{top:o,left:r,placement:"above"}:{top:e.bottom+j,left:r,placement:"below"}}function ae(e){let n=e;for(;n;){if(n instanceof HTMLElement&&n.dataset.scoutTheme)return n;n=n.parentElement??null}return document.body}function ce({identity:e,agent:n,triggerEl:t,onRequestClose:r}){const{agents:o,navigate:i}=N(),[s,c]=d.useState(()=>n??H(e,o)),[a,u]=d.useState(!n),[f,w]=d.useState(()=>C(t.getBoundingClientRect())),x=d.useRef(null),g=ae(t);d.useEffect(()=>{if(n){c(n),u(!1);return}let h=!1;return u(!0),le(e,o).then(I=>{h||(c(I),u(!1))}),()=>{h=!0}},[e,o,n]),d.useEffect(()=>{const h=()=>{w(C(t.getBoundingClientRect()))};return window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[t]),d.useEffect(()=>{const h=I=>{I.key==="Escape"&&r()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r]);const k=d.useCallback(()=>{s&&(i({view:"agents-v2",agentId:s.id}),r())},[s,i,r]),b=f.placement==="above"?"bottom center":"top center",A=f.placement==="above"?"translateY(-100%)":"",$={position:"fixed",top:f.top,left:f.left,width:E,transform:A,transformOrigin:b};return s?T.createPortal(l.jsx("div",{onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx(U,{ref:x,agent:s,pinned:!0,onOpen:k,onClose:r,onAction:r,style:$,className:"agent-card--mention"})}),g):T.createPortal(l.jsx("div",{ref:x,className:"agent-card agent-card--pinned agent-card--mention",role:"dialog","aria-label":`${e.label} snapshot`,style:$,onMouseEnter:()=>{},onMouseLeave:r,children:l.jsx("div",{style:{fontSize:"12px",color:"var(--dim)",padding:"4px 2px"},children:a?"loading…":l.jsxs(l.Fragment,{children:["No agent registered as ",l.jsx("code",{children:e.label}),"."]})})}),g)}function ue(e){return M({definitionId:e.definitionId,workspaceQualifier:e.workspaceQualifier??void 0,nodeQualifier:e.nodeQualifier??void 0,harness:e.harness??void 0,model:e.model??void 0})}function fe(e){const{agent:n,identity:t}=e,[r,o]=d.useState(!1),[i,s]=d.useState(!1),c=d.useRef(null),a=d.useRef(null),u=d.useRef(null),f=d.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),w=d.useCallback(()=>{r||(f(),a.current=window.setTimeout(()=>o(!0),te))},[r,f]),x=d.useCallback(()=>{i||(f(),u.current=window.setTimeout(()=>o(!1),re))},[i,f]),g=d.useCallback(()=>{f(),o(!1),s(!1)},[f]);d.useEffect(()=>()=>f(),[f]);const k=d.useMemo(()=>t??(n?ue(n):null),[t,n]),b=!!k,A=d.useCallback(v=>{if(v.preventDefault(),v.stopPropagation(),r&&i){g();return}f(),s(!0),o(!0)},[r,i,g,f]),$=d.useCallback(v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),s(!0),o(!0))},[]),h=b?{ref:c,onMouseEnter:w,onMouseLeave:x,onFocus:w,onBlur:x,onClick:A,onKeyDown:$,"data-hover-open":r?"true":void 0,"aria-haspopup":"dialog","aria-expanded":r}:{ref:c},I=r&&c.current&&k?l.jsx(ce,{identity:k,agent:n??null,triggerEl:c.current,onRequestClose:()=>{i?g():x()}}):null;return{triggerProps:h,popover:I,open:r,pinned:i}}function de({identity:e,color:n}){const{triggerProps:t,popover:r}=fe({identity:e});return l.jsxs(l.Fragment,{children:[l.jsx("span",{...t,className:"s-mention",role:"button",tabIndex:0,style:{"--mention-color":n},children:e.label}),r]})}const pe=["ts","tsx","js","jsx","mjs","cjs","md","mdx","txt","log","json","jsonc","yaml","yml","toml","css","scss","html","htm","sh","py","rb","go","rs","swift","kt","java","c","cpp","h","png","jpg","jpeg","gif","svg","webp","avif","env","conf","ini","gitignore","sql","xml"],he=pe.join("|"),S=new RegExp(`\\.(?:${he})(?:$|[?#])`,"i"),me=/^(?:\/Users\/|\/home\/|\/Volumes\/|\/var\/|\/etc\/|\/opt\/|\/tmp\/|\/private\/|\/mnt\/|\/Applications\/|\/usr\/|\/Library\/)/u,we=/(?:^|[\s(\[`'"])((?:~\/|\.\/|\.\.\/|\/)[A-Za-z0-9._/\-]+|[A-Za-z0-9._\-]+(?:\/[A-Za-z0-9._\-]+)+)/g;function xe(e){return e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")?!0:e.startsWith("/")&&me.test(e)||S.test(e)}function P(e){const n=[],t=new RegExp(we.source,"g");let r;for(;(r=t.exec(e))!==null;){const o=r[1];if(!o)continue;const i=o.replace(/[.,;:!?]+$/u,"");if(!i||!xe(i))continue;const s=r[0].lastIndexOf(o);if(s<0)continue;const c=r.index+s;n.push({start:c,end:c+i.length,path:i})}return n}function ge(e){return/\.(png|jpe?g|gif|svg|webp|avif)(?:$|[?#])/iu.test(e)}function ve(e){return e.endsWith("/")?!0:!(e.split("/").pop()??"").includes(".")&&!e.startsWith("./")&&!e.startsWith("../")}function ke({kind:e}){return e==="dir"?l.jsx("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:l.jsx("path",{d:"M2 5a1 1 0 0 1 1-1h3.5l1.5 1.5h5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1Z"})}):e==="image"?l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),l.jsx("circle",{cx:"6",cy:"7",r:"1"}),l.jsx("path",{d:"m3 12 3.5-3 2.5 2 3-2.5L14 11"})]}):l.jsxs("svg",{className:"s-path-token-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z"}),l.jsx("path",{d:"M9 2v3h3"})]})}function R({path:e}){const{openFilePreview:n}=N(),t=ge(e)?"image":ve(e)?"dir":"file";return l.jsxs("button",{type:"button",className:"s-path-token",onClick:r=>{r.preventDefault(),r.stopPropagation(),n(e)},title:`Open ${e}`,children:[l.jsx(ke,{kind:t}),e]})}function Ie(e,n){if(n.length===0)return[{kind:"text",value:e}];const t=new Map;for(const s of n)t.set(s.label.toLowerCase(),s);const r=[];let o=e;const i=/@([a-z0-9][a-z0-9._/:-]*)/i;for(;o.length>0;){const s=i.exec(o);if(!s||s.index===void 0){r.push({kind:"text",value:o});break}s.index>0&&r.push({kind:"text",value:o.slice(0,s.index)});const c=s[0],a=c.toLowerCase(),u=t.get(a);u?r.push({kind:"mention",identity:u}):r.push({kind:"text",value:c}),o=o.slice(s.index+c.length)}return r}function $e(e,n){const t=[],r=/`([^`\n]+)`|\*\*(.+?)\*\*|\*([^*\s][^*]*?)\*|\[([^\]\n]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>"')\]]+)/g;let o=0,i,s=0;const c=a=>{if(!a)return;const u=P(a);if(u.length===0){t.push(l.jsx("span",{children:a},`${n}-${s++}`));return}let f=0;for(const w of u)w.start>f&&t.push(l.jsx("span",{children:a.slice(f,w.start)},`${n}-${s++}`)),t.push(l.jsx(R,{path:w.path},`${n}-${s++}`)),f=w.end;f<a.length&&t.push(l.jsx("span",{children:a.slice(f)},`${n}-${s++}`))};for(;(i=r.exec(e))!==null;){if(i.index>o&&c(e.slice(o,i.index)),i[1]!==void 0){const a=i[1],u=P(` ${a}`);u.length===1&&u[0].path===a?t.push(l.jsx(R,{path:a},`${n}-${s++}`)):t.push(l.jsx("code",{className:"s-inline-code",children:a},`${n}-${s++}`))}else if(i[2]!==void 0)t.push(l.jsx("strong",{children:i[2]},`${n}-${s++}`));else if(i[3]!==void 0)t.push(l.jsx("em",{children:i[3]},`${n}-${s++}`));else if(i[4]!==void 0&&i[5]!==void 0&&z(i[5]))t.push(l.jsx("a",{className:"s-inline-link",href:i[5],target:"_blank",rel:"noreferrer",children:i[4]},`${n}-${s++}`));else if(i[6]!==void 0&&z(i[6])){const a=i[6].replace(/[.,;:!?]+$/u,""),u=i[6].slice(a.length);t.push(l.jsx("a",{className:"s-inline-link",href:a,target:"_blank",rel:"noreferrer",children:a},`${n}-${s++}`)),u&&t.push(l.jsx("span",{children:u},`${n}-${s++}`))}else t.push(l.jsx("span",{children:i[0]},`${n}-${s++}`));o=i.index+i[0].length}return o<e.length&&c(e.slice(o)),t.length>0?t:[l.jsx("span",{children:e},n)]}function z(e){return/^(?:https?:\/\/|mailto:|\/|#)/iu.test(e)}function Te(e){if(!e)return e??"";const n=ee(e);return Ie(e,n).flatMap((r,o)=>{if(r.kind==="text")return $e(r.value,o*100);const{identity:i}=r,c=i.definitionId===Y?"var(--accent)":K(i.definitionId);return l.jsx(de,{identity:i,color:c},o)})}export{Te as r};
@@ -1 +1 @@
1
- import{f as b}from"./mesh-roster-n2nDpEmA.js";function i(t){return t?t.replace(/^https?:\/\//,"").split("/")[0].split(":")[0].split(".")[0]||t.slice(0,8):""}function h(t){return t&&((t.hostName?i(t.hostName):null)||t.name)||"this host"}function w(t){if(!t)return"Host";const e=h(t.localNode);return e==="this host"?"Host":e}function L(t){return i(t.hostName)||t.name||"tailnet peer"}function N(t){return i(t.dnsName)||i(t.hostName)||(t.name??"").toLowerCase()}function p(t){return i(t.hostName)||(t.name?i(t.name):"")}function y(t){const e=(t.hostName??t.dnsName??t.name??"").trim().toLowerCase();return e?i(e).toLowerCase()==="localhost"||e==="127.0.0.1"||e.startsWith("localhost."):!1}function C(t,e){const u=b(t),s=new Map,l=e.localNode?.id??"local",f=h(e.localNode),m=(e.localNode&&e.nodes?.[e.localNode.id]?.host)??e.nodes?.[l]?.host;s.set(l,{machineId:l,machineLabel:f,reachability:"this",online:!0,host:m,agents:[]});for(const o of u){const n=o.authorityNodeId??o.homeNodeId??l;if(n!==l&&!e.nodes?.[n])continue;let a=s.get(n);if(!a){const c=e.nodes?.[n];a={machineId:n,machineLabel:h(c)||o.authorityNodeName||o.homeNodeName||n,reachability:"peer",online:!0,host:c?.host,agents:[]},s.set(n,a)}a.agents.push(o)}const r=new Set;for(const o of s.values()){r.add(o.machineLabel.toLowerCase());const n=e.nodes?.[o.machineId];if(n){const a=p(n);a&&r.add(a.toLowerCase())}}for(const o of e.tailscale?.peers??[]){if(y(o))continue;const n=L(o),a=N(o).toLowerCase();if(a&&r.has(a)||r.has(n.toLowerCase()))continue;const c=`tailnet:${o.id}`;s.has(c)||(s.set(c,{machineId:c,machineLabel:n,reachability:"tailnet",online:!!(o.online&&e.tailscale?.running),agents:[]}),a&&r.add(a),r.add(n.toLowerCase()))}const d=o=>o.reachability==="this"?0:o.reachability==="peer"?1:2;return Array.from(s.values()).sort((o,n)=>{const a=d(o)-d(n);return a!==0?a:o.machineLabel.localeCompare(n.machineLabel)})}export{C as b,w as l};
1
+ import{f as b}from"./mesh-roster-Bc7T4b7z.js";function i(t){return t?t.replace(/^https?:\/\//,"").split("/")[0].split(":")[0].split(".")[0]||t.slice(0,8):""}function h(t){return t&&((t.hostName?i(t.hostName):null)||t.name)||"this host"}function w(t){if(!t)return"Host";const e=h(t.localNode);return e==="this host"?"Host":e}function L(t){return i(t.hostName)||t.name||"tailnet peer"}function N(t){return i(t.dnsName)||i(t.hostName)||(t.name??"").toLowerCase()}function p(t){return i(t.hostName)||(t.name?i(t.name):"")}function y(t){const e=(t.hostName??t.dnsName??t.name??"").trim().toLowerCase();return e?i(e).toLowerCase()==="localhost"||e==="127.0.0.1"||e.startsWith("localhost."):!1}function C(t,e){const u=b(t),s=new Map,l=e.localNode?.id??"local",f=h(e.localNode),m=(e.localNode&&e.nodes?.[e.localNode.id]?.host)??e.nodes?.[l]?.host;s.set(l,{machineId:l,machineLabel:f,reachability:"this",online:!0,host:m,agents:[]});for(const o of u){const n=o.authorityNodeId??o.homeNodeId??l;if(n!==l&&!e.nodes?.[n])continue;let a=s.get(n);if(!a){const c=e.nodes?.[n];a={machineId:n,machineLabel:h(c)||o.authorityNodeName||o.homeNodeName||n,reachability:"peer",online:!0,host:c?.host,agents:[]},s.set(n,a)}a.agents.push(o)}const r=new Set;for(const o of s.values()){r.add(o.machineLabel.toLowerCase());const n=e.nodes?.[o.machineId];if(n){const a=p(n);a&&r.add(a.toLowerCase())}}for(const o of e.tailscale?.peers??[]){if(y(o))continue;const n=L(o),a=N(o).toLowerCase();if(a&&r.has(a)||r.has(n.toLowerCase()))continue;const c=`tailnet:${o.id}`;s.has(c)||(s.set(c,{machineId:c,machineLabel:n,reachability:"tailnet",online:!!(o.online&&e.tailscale?.running),agents:[]}),a&&r.add(a),r.add(n.toLowerCase()))}const d=o=>o.reachability==="this"?0:o.reachability==="peer"?1:2;return Array.from(s.values()).sort((o,n)=>{const a=d(o)-d(n);return a!==0?a:o.machineLabel.localeCompare(n.machineLabel)})}export{C as b,w as l};
@@ -1 +1 @@
1
- import{r as p}from"./index-CZ-05hKz.js";const M={active:"active",moving:"moving",done:"done",archive:"archive"},b=["active","moving","done","archive"],h=300*1e3,O=1800*1e3,S=1440*60*1e3;function L(t,n=Date.now()){const o=n-u(t);return o<=h?"active":o<=O?"moving":o<=S?"done":"archive"}const i="openscout.meshOps.lastLookAt";function y(){if(typeof window>"u")return 0;try{const t=window.localStorage.getItem(i);return t?Number(t)||0:Date.now()}catch{return Date.now()}}function A(){if(!(typeof window>"u"))try{window.localStorage.setItem(i,String(Date.now()))}catch{}}function E(t,n){return u(t)>n}function v(t){if(t.labels.length>0)return t.labels[0];if(t.projectRoot){const n=t.projectRoot.split("/").filter(Boolean);return n[n.length-1]??t.projectRoot}return"unlabeled"}function u(t){return t.lastMeaningfulAt??t.updatedAt}const l="openscout.mesh-ops.lab.",r={lastLook:!0,routeStrip:!0,compact:!1,relays:!1,simulateHosts:!1};function m(){if(typeof window>"u")return r;const t=n=>{try{const o=window.localStorage.getItem(`${l}${n}`);return o===null?r[n]:o==="1"}catch{return r[n]}};return{lastLook:t("lastLook"),routeStrip:t("routeStrip"),compact:t("compact"),relays:t("relays"),simulateHosts:t("simulateHosts")}}function _(t,n){if(!(typeof window>"u"))try{window.localStorage.setItem(`${l}${t}`,n?"1":"0")}catch{}}let e={status:"idle",error:null,generatedAt:null,items:[],hosts:[],machineId:null,selectedItemId:null,groupBy:"family",attnFilter:null,unattributedOnly:!1,lab:m(),refreshToken:0};const a=new Set;function s(){for(const t of a)t()}function D(t){e={...e,status:"loading",error:null,machineId:t},s()}function R(t,n,o,c=[]){const f=e.selectedItemId!==null&&!n.some(d=>d.id===e.selectedItemId);e={...e,status:"ready",error:null,items:n,hosts:c,generatedAt:o,machineId:t,selectedItemId:f?null:e.selectedItemId},s()}function F(t,n){e={...e,status:"error",error:n,machineId:t},s()}function T(t){e.selectedItemId!==t&&(e={...e,selectedItemId:t},s())}function H(t){e.groupBy!==t&&(e={...e,groupBy:t},s())}function N(t){e.attnFilter!==t&&(e={...e,attnFilter:t},s())}function B(t){e.unattributedOnly!==t&&(e={...e,unattributedOnly:t},s())}function G(t){const n={...e.lab,[t]:!e.lab[t]};_(t,n[t]),e={...e,lab:n},s()}function P(){e={...e,refreshToken:e.refreshToken+1},s()}function g(t){return a.add(t),()=>{a.delete(t)}}function I(){return e}function W(){return p.useSyncExternalStore(g,I)}function k(){return e}export{b as M,T as a,A as b,u as c,M as d,N as e,v as f,H as g,G as h,E as i,P as j,D as k,R as l,k as m,F as n,y as r,B as s,L as t,W as u};
1
+ import{r as p}from"./index-DvLtl7rV.js";const M={active:"active",moving:"moving",done:"done",archive:"archive"},b=["active","moving","done","archive"],h=300*1e3,O=1800*1e3,S=1440*60*1e3;function L(t,n=Date.now()){const o=n-u(t);return o<=h?"active":o<=O?"moving":o<=S?"done":"archive"}const i="openscout.meshOps.lastLookAt";function y(){if(typeof window>"u")return 0;try{const t=window.localStorage.getItem(i);return t?Number(t)||0:Date.now()}catch{return Date.now()}}function A(){if(!(typeof window>"u"))try{window.localStorage.setItem(i,String(Date.now()))}catch{}}function E(t,n){return u(t)>n}function v(t){if(t.labels.length>0)return t.labels[0];if(t.projectRoot){const n=t.projectRoot.split("/").filter(Boolean);return n[n.length-1]??t.projectRoot}return"unlabeled"}function u(t){return t.lastMeaningfulAt??t.updatedAt}const l="openscout.mesh-ops.lab.",r={lastLook:!0,routeStrip:!0,compact:!1,relays:!1,simulateHosts:!1};function m(){if(typeof window>"u")return r;const t=n=>{try{const o=window.localStorage.getItem(`${l}${n}`);return o===null?r[n]:o==="1"}catch{return r[n]}};return{lastLook:t("lastLook"),routeStrip:t("routeStrip"),compact:t("compact"),relays:t("relays"),simulateHosts:t("simulateHosts")}}function _(t,n){if(!(typeof window>"u"))try{window.localStorage.setItem(`${l}${t}`,n?"1":"0")}catch{}}let e={status:"idle",error:null,generatedAt:null,items:[],hosts:[],machineId:null,selectedItemId:null,groupBy:"family",attnFilter:null,unattributedOnly:!1,lab:m(),refreshToken:0};const a=new Set;function s(){for(const t of a)t()}function D(t){e={...e,status:"loading",error:null,machineId:t},s()}function R(t,n,o,c=[]){const f=e.selectedItemId!==null&&!n.some(d=>d.id===e.selectedItemId);e={...e,status:"ready",error:null,items:n,hosts:c,generatedAt:o,machineId:t,selectedItemId:f?null:e.selectedItemId},s()}function F(t,n){e={...e,status:"error",error:n,machineId:t},s()}function T(t){e.selectedItemId!==t&&(e={...e,selectedItemId:t},s())}function H(t){e.groupBy!==t&&(e={...e,groupBy:t},s())}function N(t){e.attnFilter!==t&&(e={...e,attnFilter:t},s())}function B(t){e.unattributedOnly!==t&&(e={...e,unattributedOnly:t},s())}function G(t){const n={...e.lab,[t]:!e.lab[t]};_(t,n[t]),e={...e,lab:n},s()}function P(){e={...e,refreshToken:e.refreshToken+1},s()}function g(t){return a.add(t),()=>{a.delete(t)}}function I(){return e}function W(){return p.useSyncExternalStore(g,I)}function k(){return e}export{b as M,T as a,A as b,u as c,M as d,N as e,v as f,H as g,G as h,E as i,P as j,D as k,R as l,k as m,F as n,y as r,B as s,L as t,W as u};
@@ -1 +1 @@
1
- function r(t){const e=t.id.trim();return e.startsWith("session-")||e.startsWith("local-session-agent-")}function i(t){return!!(r(t)||t.handle?.trim().toLowerCase()?.startsWith("session-")||t.definitionId?.trim().toLowerCase()?.startsWith("session-")||/^session\s+/i.test(t.name.trim())||`${t.selector??""} ${t.defaultSelector??""}`.toLowerCase().includes("@session-"))}function n(t){return!!(t.project?.trim()||t.projectRoot?.trim())}function o(t){const e=t.handle?.trim();if(e&&!e.toLowerCase().startsWith("session-")||t.role?.trim())return!0;const s=t.definitionId?.trim();return!!(s&&!s.toLowerCase().startsWith("session-")&&!s.toLowerCase().startsWith("local-session-agent-"))}function u(t){return t.retiredFromFleet||t.staleLocalRegistration||t.agentClass==="organic"||i(t)?!1:n(t)||o(t)}function l(t){return t.filter(u)}export{l as f};
1
+ function r(t){const e=t.id.trim();return e.startsWith("session-")||e.startsWith("local-session-agent-")}function i(t){return!!(r(t)||t.handle?.trim().toLowerCase()?.startsWith("session-")||t.definitionId?.trim().toLowerCase()?.startsWith("session-")||/^session\s+/i.test(t.name.trim())||`${t.selector??""} ${t.defaultSelector??""}`.toLowerCase().includes("@session-"))}function n(t){return!!(t.project?.trim()||t.projectRoot?.trim())}function o(t){const e=t.handle?.trim();if(e&&!e.toLowerCase().startsWith("session-")||t.role?.trim())return!0;const s=t.definitionId?.trim();return!!(s&&!s.toLowerCase().startsWith("session-")&&!s.toLowerCase().startsWith("local-session-agent-"))}function u(t){return t.retiredFromFleet||t.staleLocalRegistration||t.agentClass==="organic"||i(t)?!1:n(t)||o(t)}function f(t){return t.filter(u)}export{i as a,f,n as h,u as i};
@@ -1 +1 @@
1
- import{r as d}from"./index-CZ-05hKz.js";const u=new Set(["in_turn","in_flight","needs_attention","callable","blocked"]),l="openscout.mesh.machinePositions.v1";function f(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(l);if(!e)return{};const n=JSON.parse(e);if(n&&typeof n=="object"){const i={};for(const[c,o]of Object.entries(n))o&&typeof o=="object"&&typeof o.x=="number"&&typeof o.y=="number"&&(i[c]={x:o.x,y:o.y});return i}}catch{}return{}}function r(e){if(!(typeof window>"u"))try{window.localStorage.setItem(l,JSON.stringify(e))}catch{}}let t={mode:"map",density:"comfortable",selectedId:null,selectedType:null,meshSnapshot:null,probeCache:{},query:"",stateFilter:"all",agentStateFilters:u,hiddenMachineIds:new Set,collapsedMachineIds:new Set,treeFullMachineIds:new Set,scrollTargetMachineId:null,machinePositions:f()};const a=new Set;function s(){for(const e of a)e()}function p(e){t.mode!==e&&(t={...t,mode:e},s())}function g(e){t.density!==e&&(t={...t,density:e},s())}function w(e,n){t.selectedId===e&&t.selectedType===n||(t={...t,selectedId:e,selectedType:n},s())}function y(e){t={...t,meshSnapshot:e},s()}function I(e){t.query!==e&&(t={...t,query:e},s())}function b(e){t.stateFilter!==e&&(t={...t,stateFilter:e},s())}function T(e){const n=new Set(t.agentStateFilters);n.has(e)?n.delete(e):n.add(e),t={...t,agentStateFilters:n},s()}function x(e){const n=new Set(t.treeFullMachineIds);n.has(e)?n.delete(e):n.add(e),t={...t,treeFullMachineIds:n},s()}function P(e){const n=new Set(t.hiddenMachineIds);n.has(e)?n.delete(e):n.add(e),t={...t,hiddenMachineIds:n},s()}function _(e,n){const i=new Set;for(const c of n)c!==e&&i.add(c);t={...t,hiddenMachineIds:i},s()}function m(){t.hiddenMachineIds.size!==0&&(t={...t,hiddenMachineIds:new Set},s())}function F(e){const n=new Set(t.collapsedMachineIds);n.has(e)?n.delete(e):n.add(e),t={...t,collapsedMachineIds:n},s()}function A(e,n){const i={...t.machinePositions,[e]:n};t={...t,machinePositions:i},r(i),s()}function O(){if(Object.keys(t.machinePositions).length===0)return;const e={};t={...t,machinePositions:e},r(e),s()}function E(e){t={...t,scrollTargetMachineId:e},s(),queueMicrotask(()=>{t.scrollTargetMachineId===e&&(t={...t,scrollTargetMachineId:null},s())})}function h(e){return a.add(e),()=>{a.delete(e)}}function S(){return t}function j(){return d.useSyncExternalStore(h,S)}export{F as a,A as b,w as c,O as d,p as e,g as f,I as g,b as h,T as i,m as j,x as k,_ as l,E as r,y as s,P as t,j as u};
1
+ import{r as d}from"./index-DvLtl7rV.js";const u=new Set(["in_turn","in_flight","needs_attention","callable","blocked"]),l="openscout.mesh.machinePositions.v1";function f(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(l);if(!e)return{};const n=JSON.parse(e);if(n&&typeof n=="object"){const i={};for(const[c,o]of Object.entries(n))o&&typeof o=="object"&&typeof o.x=="number"&&typeof o.y=="number"&&(i[c]={x:o.x,y:o.y});return i}}catch{}return{}}function r(e){if(!(typeof window>"u"))try{window.localStorage.setItem(l,JSON.stringify(e))}catch{}}let t={mode:"map",density:"comfortable",selectedId:null,selectedType:null,meshSnapshot:null,probeCache:{},query:"",stateFilter:"all",agentStateFilters:u,hiddenMachineIds:new Set,collapsedMachineIds:new Set,treeFullMachineIds:new Set,scrollTargetMachineId:null,machinePositions:f()};const a=new Set;function s(){for(const e of a)e()}function p(e){t.mode!==e&&(t={...t,mode:e},s())}function g(e){t.density!==e&&(t={...t,density:e},s())}function w(e,n){t.selectedId===e&&t.selectedType===n||(t={...t,selectedId:e,selectedType:n},s())}function y(e){t={...t,meshSnapshot:e},s()}function I(e){t.query!==e&&(t={...t,query:e},s())}function b(e){t.stateFilter!==e&&(t={...t,stateFilter:e},s())}function T(e){const n=new Set(t.agentStateFilters);n.has(e)?n.delete(e):n.add(e),t={...t,agentStateFilters:n},s()}function x(e){const n=new Set(t.treeFullMachineIds);n.has(e)?n.delete(e):n.add(e),t={...t,treeFullMachineIds:n},s()}function P(e){const n=new Set(t.hiddenMachineIds);n.has(e)?n.delete(e):n.add(e),t={...t,hiddenMachineIds:n},s()}function _(e,n){const i=new Set;for(const c of n)c!==e&&i.add(c);t={...t,hiddenMachineIds:i},s()}function m(){t.hiddenMachineIds.size!==0&&(t={...t,hiddenMachineIds:new Set},s())}function F(e){const n=new Set(t.collapsedMachineIds);n.has(e)?n.delete(e):n.add(e),t={...t,collapsedMachineIds:n},s()}function A(e,n){const i={...t.machinePositions,[e]:n};t={...t,machinePositions:i},r(i),s()}function O(){if(Object.keys(t.machinePositions).length===0)return;const e={};t={...t,machinePositions:e},r(e),s()}function E(e){t={...t,scrollTargetMachineId:e},s(),queueMicrotask(()=>{t.scrollTargetMachineId===e&&(t={...t,scrollTargetMachineId:null},s())})}function h(e){return a.add(e),()=>{a.delete(e)}}function S(){return t}function j(){return d.useSyncExternalStore(h,S)}export{F as a,A as b,w as c,O as d,p as e,g as f,I as g,b as h,T as i,m as j,x as k,_ as l,E as r,y as s,P as t,j as u};
@@ -1 +1 @@
1
- import{c as e}from"./createLucideIcon-DXpqZP7I.js";const c=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],a=e("message-circle",c);export{a as M};
1
+ import{c as e}from"./createLucideIcon-DezKXSG2.js";const c=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],a=e("message-circle",c);export{a as M};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./index-CZ-05hKz.js";import{r as c}from"./mentions-CcPFMbmZ.js";const h=/^```([a-z0-9_-]+)?\s*$/iu,E=/^(#{1,6})\s+(.+)$/u,L=/^(?:-{3,}|\*{3,}|_{3,})$/u,_=/^\s*[-*]\s+(.+)$/u,M=/^\s*\d+[.)]\s+(.+)$/u,w=/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?$/u;function B(e){return/[\r\n]/u.test(e)||!(/(?:(?:\\r)?\\n){2}/u.test(e)||/(?:\\r)?\\n(?=\s*(?:#{1,6}\s|[-*+]\s|>\s|\d+[.)]\s|[A-Z][A-Za-z ]{0,40}:))/u.test(e))?e:e.replace(/\\r\\n|\\n|\\r/gu,`
1
+ import{j as i}from"./index-DvLtl7rV.js";import{r as c}from"./mentions-DG6OQrsc.js";const h=/^```([a-z0-9_-]+)?\s*$/iu,E=/^(#{1,6})\s+(.+)$/u,L=/^(?:-{3,}|\*{3,}|_{3,})$/u,_=/^\s*[-*]\s+(.+)$/u,M=/^\s*\d+[.)]\s+(.+)$/u,w=/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?$/u;function B(e){return/[\r\n]/u.test(e)||!(/(?:(?:\\r)?\\n){2}/u.test(e)||/(?:\\r)?\\n(?=\s*(?:#{1,6}\s|[-*+]\s|>\s|\d+[.)]\s|[A-Z][A-Za-z ]{0,40}:))/u.test(e))?e:e.replace(/\\r\\n|\\n|\\r/gu,`
2
2
  `)}function P(e){const s=B(e).replace(/\r\n?/gu,`
3
3
  `).trim();return s?s.replace(/([^\n])\s+---\s+(?=(?:#{1,6}\s|\*\*|[A-Z0-9]))/gu,`$1
4
4
 
@@ -1 +1 @@
1
- import{c as a}from"./createLucideIcon-DXpqZP7I.js";const e=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],o=a("message-square",e);export{o as M};
1
+ import{c as a}from"./createLucideIcon-DezKXSG2.js";const e=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],o=a("message-square",e);export{o as M};
@@ -1 +1 @@
1
- const l=/^(.+?) failed to respond\.(?:\r?\n([\s\S]*))?$/i,f=/^(.+?) sent a request to (.+?), but no operator session accepted it\.$/i,h=/^(?:target agent|agent|endpoint)\s+(\S+) is a superseded local registration replaced by current setup(?:; replacement agent is (\S+))?\.?$/i;function m(t){const e=t.trim();return/^openscout-/i.test(e)&&e.replace(/^openscout-/i,"").replace(/-\d+$/,"").split(/[-_]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")||e}function u(t){return t?/no rollout found for thread id|no conversation found with session id/i.test(t)?"The session linked to this conversation is no longer available.":/working directory|cwd does not exist|project (?:folder|directory).+does not exist/i.test(t)?"Its project folder is no longer available.":"Scout couldn’t complete the request.":"Scout couldn’t complete the request."}function c(t){return t.replace(/^endpoint\./,"").split(".")[0]?.trim()||null}function T(t){return t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function g(t){if(t.class==="system"&&(t.actorId==="scout"||t.actorId==="system")){const o=h.exec(t.body.trim());if(!o)return null;const i=o[1]?.trim()??"",a=o[2]?.trim()||null,s=c(a||i),d=s?T(s):"This agent",p=a?.split(".")[1]??null;return{target:d,explanation:a?`This chat points at a retired session of the agent — it now runs on ${p??"a new branch"}. Start a fresh chat with @${s} to reach it.`:"This chat points at a retired session of the agent, and no replacement is registered.",technicalDetail:t.body.trim()}}if(t.class!=="status"||t.actorId!=="system")return null;const e=l.exec(t.body.trim());if(!e){const i=f.exec(t.body.trim())?.[2]?.trim();return i?{target:i,explanation:"No available Scout session accepted this request.",technicalDetail:null}:null}const r=e[1]?.trim();if(!r)return null;const n=e[2]?.trim()||null;return{target:r,explanation:u(n),technicalDetail:n}}function E(t){const e=l.exec(t.trim());if(!e)return t;const r=e[1]?.trim();if(!r)return t;const n=e[2]?.trim()||null;return`${m(r)} couldn’t reply. ${u(n)}`}function y(t){return t.class!=="status"||t.actorId!=="system"?!1:t.body.includes("failed to respond")&&t.body.includes("snapshot.messages")}export{g as a,m as b,E as c,y as i};
1
+ const l=/^(.+?) failed to respond\.(?:\r?\n([\s\S]*))?$/i,f=/^(.+?) sent a request to (.+?), but no operator session accepted it\.$/i,h=/^(?:target agent|agent|endpoint)\s+(\S+) is a superseded local registration replaced by current setup(?:; replacement agent is (\S+))?\.?$/i;function m(t){const e=t.trim();return/^openscout-/i.test(e)&&e.replace(/^openscout-/i,"").replace(/-\d+$/,"").split(/[-_]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")||e}function u(t){return t?/no rollout found for thread id|no conversation found with session id/i.test(t)?"The session linked to this conversation is no longer available.":/working directory|cwd does not exist|project (?:folder|directory).+does not exist/i.test(t)?"Its project folder is no longer available.":"Scout couldn’t complete the request.":"Scout couldn’t complete the request."}function c(t){return t.replace(/^endpoint\./,"").split(".")[0]?.trim()||null}function T(t){return t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function g(t){if(t.class==="system"&&(t.actorId==="scout"||t.actorId==="system")){const o=h.exec(t.body.trim());if(!o)return null;const i=o[1]?.trim()??"",a=o[2]?.trim()||null,s=c(a||i),d=s?T(s):"This agent",p=a?.split(".")[1]??null;return{target:d,explanation:a?`This chat points at a retired session of the agent — it now runs on ${p??"a new branch"}. Start a fresh chat with @${s} to reach it.`:"This chat points at a retired session of the agent, and no replacement is registered.",technicalDetail:t.body.trim()}}if(t.class!=="status"||t.actorId!=="system")return null;const e=l.exec(t.body.trim());if(!e){const i=f.exec(t.body.trim())?.[2]?.trim();return i?{target:i,explanation:"No available Scout session accepted this request.",technicalDetail:null}:null}const r=e[1]?.trim();if(!r)return null;const n=e[2]?.trim()||null;return{target:r,explanation:u(n),technicalDetail:n}}function E(t){const e=l.exec(t.trim());if(!e)return t;const r=e[1]?.trim();if(!r)return t;const n=e[2]?.trim()||null;return`${m(r)} couldn’t reply. ${u(n)}`}function y(t){return t.class!=="status"||t.actorId!=="system"?!1:t.body.includes("failed to respond")&&t.body.includes("snapshot.messages")}export{E as a,m as b,g as c,y as i};
@@ -1 +1 @@
1
- import{r as o}from"./index-CZ-05hKz.js";const c=[{label:"5m",value:5*6e4},{label:"30m",value:30*6e4},{label:"4h",value:240*6e4},{label:"24h",value:1440*6e4}];let t={activityFilter:"active",sourceFilter:"all",activityWindowMs:c[3].value,groupMode:"activity",query:"",focusedId:null,revealRequest:null,visibleAgents:[],selectedIds:[]};const u=new Set;let a=0;function s(){for(const e of u)e()}function I(e){t.activityFilter!==e&&(t={...t,activityFilter:e},s())}function g(e){t.sourceFilter!==e&&(t={...t,sourceFilter:e},s())}function y(e){t.activityWindowMs!==e&&(t={...t,activityWindowMs:e},s())}function A(e){t.groupMode!==e&&(t={...t,groupMode:e},s())}function S(e){t.query!==e&&(t={...t,query:e},s())}function h(e){t.focusedId!==e&&(t={...t,focusedId:e},s())}function b(e){a+=1,t={...t,revealRequest:{id:e,serial:a}},s()}function p(e){t.revealRequest?.serial===e&&(t={...t,revealRequest:null},s())}function f(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++){const r=e[i],l=n[i];if(r.id!==l.id||r.state!==l.state||r.updatedAt!==l.updatedAt||r.activity!==l.activity||r.lastActiveAt!==l.lastActiveAt)return!1}return!0}function q(e){f(t.visibleAgents,e)||(t={...t,visibleAgents:e},s())}function _(e){const n=t.selectedIds.includes(e);t={...t,selectedIds:n?t.selectedIds.filter(i=>i!==e):[...t.selectedIds,e]},s()}function R(){t.selectedIds.length!==0&&(t={...t,selectedIds:[]},s())}function d(e){return u.add(e),()=>{u.delete(e)}}function v(){return t}function F(){return o.useSyncExternalStore(d,v)}export{c as M,S as a,I as b,y as c,A as d,R as e,q as f,p as g,h,b as r,g as s,_ as t,F as u};
1
+ import{r as o}from"./index-DvLtl7rV.js";const c=[{label:"5m",value:5*6e4},{label:"30m",value:30*6e4},{label:"4h",value:240*6e4},{label:"24h",value:1440*6e4}];let t={activityFilter:"active",sourceFilter:"all",activityWindowMs:c[3].value,groupMode:"activity",query:"",focusedId:null,revealRequest:null,visibleAgents:[],selectedIds:[]};const u=new Set;let a=0;function s(){for(const e of u)e()}function I(e){t.activityFilter!==e&&(t={...t,activityFilter:e},s())}function g(e){t.sourceFilter!==e&&(t={...t,sourceFilter:e},s())}function y(e){t.activityWindowMs!==e&&(t={...t,activityWindowMs:e},s())}function A(e){t.groupMode!==e&&(t={...t,groupMode:e},s())}function S(e){t.query!==e&&(t={...t,query:e},s())}function h(e){t.focusedId!==e&&(t={...t,focusedId:e},s())}function b(e){a+=1,t={...t,revealRequest:{id:e,serial:a}},s()}function p(e){t.revealRequest?.serial===e&&(t={...t,revealRequest:null},s())}function f(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++){const r=e[i],l=n[i];if(r.id!==l.id||r.state!==l.state||r.updatedAt!==l.updatedAt||r.activity!==l.activity||r.lastActiveAt!==l.lastActiveAt)return!1}return!0}function q(e){f(t.visibleAgents,e)||(t={...t,visibleAgents:e},s())}function _(e){const n=t.selectedIds.includes(e);t={...t,selectedIds:n?t.selectedIds.filter(i=>i!==e):[...t.selectedIds,e]},s()}function R(){t.selectedIds.length!==0&&(t={...t,selectedIds:[]},s())}function d(e){return u.add(e),()=>{u.delete(e)}}function v(){return t}function F(){return o.useSyncExternalStore(d,v)}export{c as M,S as a,I as b,y as c,A as d,R as e,q as f,p as g,h,b as r,g as s,_ as t,F as u};
@@ -1 +1 @@
1
- import{r}from"./index-CZ-05hKz.js";import{a as L}from"./api-Co9aQ2Jw.js";import{a as S}from"./colors-BtO5_zlx.js";import{i as y,o as E}from"./surface-activity-B1rgWB1i.js";const _=1e4,b=6e4;function O(t,s){const[p,i]=r.useState({}),c=s?.enabled??!0,o=r.useRef(!0),f=r.useRef(!1),l=r.useRef(!1),u=s?.pauseWhenHidden??!1,d=t.map(e=>e.id.trim()).filter(e=>e.length>0).join(","),I=t.some(e=>S(e.state))?s?.activeIntervalMs??_:s?.idleIntervalMs??b,n=r.useCallback(async()=>{if(c){if(t.length===0){i({});return}if(!(u&&!y())){if(f.current){l.current=!0;return}f.current=!0;try{const e=d?`?ids=${encodeURIComponent(d)}`:"",v=await L(`/api/observe/agents${e}`);if(!o.current)return;i(h=>{const m={};for(const a of t)m[a.id]=h[a.id];for(const a of v){const{agentId:R,...A}=a;m[R]=A}return m})}finally{f.current=!1,l.current&&(l.current=!1,n())}}}},[d,t,c,u]);return r.useEffect(()=>{if(o.current=!0,!c||t.length===0)return i({}),()=>{o.current=!1};n();const e=setInterval(()=>{n()},I),v=u?E(()=>{n()}):null;return()=>{o.current=!1,clearInterval(e),v?.()}},[t.length,c,n,u,I]),p}export{O as u};
1
+ import{r}from"./index-DvLtl7rV.js";import{a as L}from"./api-Co9aQ2Jw.js";import{a as S}from"./colors-BtO5_zlx.js";import{i as y,o as E}from"./surface-activity-B1rgWB1i.js";const _=1e4,b=6e4;function O(t,s){const[p,i]=r.useState({}),c=s?.enabled??!0,o=r.useRef(!0),f=r.useRef(!1),l=r.useRef(!1),u=s?.pauseWhenHidden??!1,d=t.map(e=>e.id.trim()).filter(e=>e.length>0).join(","),I=t.some(e=>S(e.state))?s?.activeIntervalMs??_:s?.idleIntervalMs??b,n=r.useCallback(async()=>{if(c){if(t.length===0){i({});return}if(!(u&&!y())){if(f.current){l.current=!0;return}f.current=!0;try{const e=d?`?ids=${encodeURIComponent(d)}`:"",v=await L(`/api/observe/agents${e}`);if(!o.current)return;i(h=>{const m={};for(const a of t)m[a.id]=h[a.id];for(const a of v){const{agentId:R,...A}=a;m[R]=A}return m})}finally{f.current=!1,l.current&&(l.current=!1,n())}}}},[d,t,c,u]);return r.useEffect(()=>{if(o.current=!0,!c||t.length===0)return i({}),()=>{o.current=!1};n();const e=setInterval(()=>{n()},I),v=u?E(()=>{n()}):null;return()=>{o.current=!1,clearInterval(e),v?.()}},[t.length,c,n,u,I]),p}export{O as u};
@@ -1 +1 @@
1
- import{r as u}from"./index-CZ-05hKz.js";let e={hover:null,content:null};const n=new Set;function s(){for(const t of n)t()}function i(t){return n.add(t),()=>{n.delete(t)}}function r(){return e}function c(){return u.useSyncExternalStore(i,r,r)}function o(t){e.hover!==t&&(e={...e,hover:t},s())}function f(t){return!t||!t.route&&!t.label?{onPointerEnter:void 0,onPointerLeave:void 0}:{onPointerEnter:()=>o(t),onPointerLeave:()=>{e.hover===t&&o(null)}}}export{f as s,c as u};
1
+ import{r as u}from"./index-DvLtl7rV.js";let e={hover:null,content:null};const n=new Set;function s(){for(const t of n)t()}function i(t){return n.add(t),()=>{n.delete(t)}}function r(){return e}function c(){return u.useSyncExternalStore(i,r,r)}function o(t){e.hover!==t&&(e={...e,hover:t},s())}function f(t){return!t||!t.route&&!t.label?{onPointerEnter:void 0,onPointerLeave:void 0}:{onPointerEnter:()=>o(t),onPointerLeave:()=>{e.hover===t&&o(null)}}}export{f as s,c as u};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-DXpqZP7I.js";const a=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],o=c("paperclip",a);export{o as P};
1
+ import{c}from"./createLucideIcon-DezKXSG2.js";const a=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],o=c("paperclip",a);export{o as P};
@@ -1 +1 @@
1
- import{r as a}from"./index-CZ-05hKz.js";const i="openscout:persistent-state-change";function d(t,e){typeof window>"u"||window.dispatchEvent(new CustomEvent(i,{detail:{key:t,value:e}}))}function w(t){try{return window.localStorage.getItem(t)}catch{return null}}function c(t,e){try{window.localStorage.setItem(t,e)}catch{}d(t,e)}function l(t){const[e,n]=a.useState(()=>typeof window>"u"?null:w(t));return a.useEffect(()=>{n(w(t));const s=r=>{const u=r.detail;!u||u.key!==t||n(u.value)},o=r=>{r.key===t&&n(r.newValue)};return window.addEventListener(i,s),window.addEventListener("storage",o),()=>{window.removeEventListener(i,s),window.removeEventListener("storage",o)}},[t]),e}function m(t,e){const n=l(t),s=n===null?e:n==="true",o=a.useCallback(r=>{c(t,r?"true":"false")},[t]);return[s,o]}function g(t,e){const n=l(t),s=n===null?Number.NaN:Number(n),o=Number.isFinite(s)?s:e,r=a.useCallback(u=>{c(t,String(u))},[t]);return[o,r]}function E(t,e){const s=l(t)??e,o=a.useCallback(r=>{c(t,r)},[t]);return[s,o]}export{E as a,m as b,g as u};
1
+ import{r as a}from"./index-DvLtl7rV.js";const i="openscout:persistent-state-change";function d(t,e){typeof window>"u"||window.dispatchEvent(new CustomEvent(i,{detail:{key:t,value:e}}))}function w(t){try{return window.localStorage.getItem(t)}catch{return null}}function c(t,e){try{window.localStorage.setItem(t,e)}catch{}d(t,e)}function l(t){const[e,n]=a.useState(()=>typeof window>"u"?null:w(t));return a.useEffect(()=>{n(w(t));const s=r=>{const u=r.detail;!u||u.key!==t||n(u.value)},o=r=>{r.key===t&&n(r.newValue)};return window.addEventListener(i,s),window.addEventListener("storage",o),()=>{window.removeEventListener(i,s),window.removeEventListener("storage",o)}},[t]),e}function m(t,e){const n=l(t),s=n===null?e:n==="true",o=a.useCallback(r=>{c(t,r?"true":"false")},[t]);return[s,o]}function g(t,e){const n=l(t),s=n===null?Number.NaN:Number(n),o=Number.isFinite(s)?s:e,r=a.useCallback(u=>{c(t,String(u))},[t]);return[o,r]}function E(t,e){const s=l(t)??e,o=a.useCallback(r=>{c(t,r)},[t]);return[s,o]}export{E as a,m as b,g as u};
@@ -1 +1 @@
1
- import{c as e}from"./createLucideIcon-DXpqZP7I.js";const o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c=e("plus",o);export{c as P};
1
+ import{c as e}from"./createLucideIcon-DezKXSG2.js";const o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c=e("plus",o);export{c as P};
@@ -1 +1 @@
1
- import{r as u,j as s}from"./index-CZ-05hKz.js";import{A as Z}from"./AgentAvatar-CYhf6twS.js";import{a as B}from"./api-Co9aQ2Jw.js";import{d as _,c as rs}from"./context-budget-DX_fwUs3.js";import{b as ls,p as K,n as ss,h as q}from"./NewChatComposer-hlWT-nbR.js";import{b as Q,r as es,s as ts,a as ns}from"./session-catalog-DNaOEzoQ.js";import{u as X}from"./sse-CiOSzE5n.js";import{t as z}from"./time-Dhsh_2EG.js";import{B as cs}from"./BackToPicker-4JaeRvDm.js";import{o as F}from"./openContent-C6XO6kr5.js";import{u as G}from"./Provider-B2xuo3rf.js";import{ConversationScreen as ds}from"./ConversationScreen-BNULZAp2.js";import{S as ms}from"./SessionObserve-Dsd0j05N.js";import{H as as}from"./HarnessMark-D5CA5uSp.js";/* empty css */import{AgentDefinitionsWorkspace as ps}from"./AgentDefinitionsWorkspace-srmN6-vj.js";import{AgentEssentialsGlyph as us}from"./agent-essentials-BOMHR0_U.js";import"./SpriteAvatar-Bs68ZENy.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-CTIuxp4G.js";import"./perf-PX8Rx0EP.js";import"./text-CnZ0e1-V.js";import"./scout-voice-BhPzrc6P.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-BiohlpM3.js";import"./createLucideIcon-DXpqZP7I.js";import"./conversation-model-CwF6Y9gx.js";import"./index-BVlMw8x_.js";import"./NewChatOrigin-DdpzE4kz.js";import"./keyboard-nav-DFhAJkW3.js";import"./x-e3h2hDsp.js";import"./chevron-down-Mp9mu_yd.js";import"./search-D1tJSAWe.js";import"./file-text-KijGBnME.js";import"./terminal-relay-9lhzEp2V.js";import"./router-DJj2WbDg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DZVhS7as.js";import"./TextDocumentSurface-CKQP-cBT.js";import"./chevron-right-CzH-TaSF.js";import"./code-xml-Jtxsp5d1.js";import"./arrow-left-CghA0kTw.js";import"./arrow-right-iJFv3jNh.js";import"./chunk-HRAB3GC3-swV8PA2k.js";import"./ConversationComposer-2HjbGPL9.js";import"./zap-nMcjPoWB.js";import"./message-markup-RkfmDfME.js";import"./mentions-CcPFMbmZ.js";import"./AgentDetailCard-UqPNpcvB.js";import"./AgentLiveActions-BwuzOE8h.js";import"./terminal-takeover-DANQfTcy.js";import"./eye-CpfyvdLq.js";import"./terminal-yN9xN-h9.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C8vfXaTF.js";import"./AstronautSuit-Ckx7lu7G.js";import"./ConversationFeedRows-C6wUqJrx.js";import"./ConversationPanels-CNCIbpqU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CKkhq9c5.js";import"./proxy-DnLpZIi9.js";import"./activity-Bj3Hnbj3.js";import"./message-circle-B2ddzBrX.js";import"./tail-events-BMQmSx1n.js";import"./ConversationStatus-DZuyKsWN.js";import"./check-C18YQC90.js";import"./sparkles-Dy8p5xN8.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-D_DMlBeT.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CdGUXxGR.js";import"./ObserveTextFlow-BSEtYTxU.js";import"./SessionObserveEvidence-DopQYDkD.js";import"./wrench-YcXMlsh2.js";import"./external-link-Ckiyzjwo.js";import"./agent-specialization-BIPIBW8u.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-DQlpNt2S.js";/* empty css */function hs(e){if(e===null)return"age unknown";const t=Math.max(0,Math.round(e/6e4));if(t<60)return`${t}m old`;const o=Math.floor(t/60),c=t%60;return c>0?`${o}h ${c}m old`:`${o}h old`}function Y(e){return`${e.turnCount} turn${e.turnCount===1?"":"s"}`}function xs(e){return e?e.startsWith("/Users/")?"~/"+e.split("/").slice(3).join("/"):e:null}function is(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu.test(e)?e:e.length>16?`${e.slice(0,8)}…${e.slice(-4)}`:e}function vs(e){return e.replace(/^relay-/u,"").replace(/-arts-mac-mini-local-(claude|codex)$/u,"")}function fs(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:`${e}`}function U(e){return typeof e!="number"||!Number.isFinite(e)?"-":Math.abs(e)<1e3?`${Math.round(e)}`:Math.abs(e)<1e6?`${(e/1e3).toFixed(e%1e3===0?0:1)}k`:`${(e/1e6).toFixed(1)}m`}function js(e){if(!Number.isFinite(e)||e<=0)return"0s";if(e<60)return`${Math.round(e)}s`;const t=Math.round(e),o=Math.floor(t/3600),c=Math.floor(t%3600/60),i=t%60;return o>0?`${o}h ${c}m`:c>=10||i===0?`${c}m`:`${c}m ${i}s`}function Ns(e,t=32){if(e.length===0)return[];const o=e[e.length-1].t||1,c=new Array(t).fill(0);for(const i of e){const m=Math.min(t-1,Math.max(0,Math.floor(i.t/o*t)));c[m]+=1}return c}function bs(e){return e.kind!=="boot"&&e.kind!=="system"}function ws({buckets:e,emptyTitle:t,emptyDetail:o}){if(e.length===0)return s.jsxs("div",{className:"s-sum-observed-empty",children:[s.jsx("span",{children:t}),s.jsx("strong",{children:o})]});const c=Math.max(...e,1),i=240,m=20,r=1,p=(i-r*(e.length-1))/e.length;return s.jsxs("div",{className:"s-sum-spark",children:[s.jsx("svg",{viewBox:`0 0 ${i} ${m}`,preserveAspectRatio:"none",className:"s-sum-spark-svg","aria-hidden":!0,children:e.map((l,h)=>{const x=Math.max(1,l/c*m);return s.jsx("rect",{x:h*(p+r),y:m-x,width:p,height:x,fill:"var(--accent)",opacity:.22+.62*(l/c)},h)})}),s.jsxs("div",{className:"s-sum-spark-axis",children:[s.jsx("span",{children:"session start"}),s.jsx("span",{children:"now"})]})]})}function ys({agentId:e,session:t,active:o,onPrimary:c,primaryLabel:i,primaryTitle:m}){const[r,p]=u.useState(null),[l,h]=u.useState(null),x=u.useCallback(async()=>{const g=new URLSearchParams({sessionId:t.id}),[P,J]=await Promise.all([B(`/api/agents/${encodeURIComponent(e)}/observe?${g}`).catch(()=>null),B(`/api/agents/${encodeURIComponent(e)}/session/context`).catch(()=>null)]);p(P),h(J)},[e,t.id]);u.useEffect(()=>{x()},[x]),X(()=>{x()});const N=r?.data,v=(N?.events??[]).filter(bs),w=v.filter(g=>g.kind==="tool"),S=w.filter(g=>g.tool==="edit"||g.tool==="write"),y=w.filter(g=>g.tool==="read"),f=N?.files.length??0,b=N?.metadata?.session?.turnCount,$=l?.activeSessionId===t.id?l.turnCount:void 0,C=v.length>0||f>0,d=r?r.source==="unavailable"?"unavailable":C?"observed":"waiting":"loading",R=d==="loading"?"Loading trace":d==="unavailable"?"No trace source":"Session created",L=d==="loading"?"checking for terminal or transcript activity":d==="unavailable"?"this session has no observable transcript attached":"no agent work has been recorded yet",H=[{k:"turns",v:U(b??$)},{k:"tools",v:U(w.length)},{k:"edits",v:U(S.length)},{k:"reads",v:U(y.length)},{k:"files",v:U(f)},{k:"window",v:js(v.length>0?v[v.length-1].t:0)}],D=N?.metadata?.usage,a=_(D,{model:N?.metadata?.session?.model??t.model,adapterType:t.harness}),E=a?`${a.usedLabel} / ${a.budgetLabel} ctx`:l?Y(l):"context",T=a?`${a.pct}%${a.overLimit?" over":""}`:"tokens unavailable",O=l&&l.sessionAgeMs!==null?hs(l.sessionAgeMs):null,A=a&&l?`${Y(l)}${O?` · ${O}`:""}`:O,n=r?.sessionId?.trim()||r?.data.metadata?.session?.externalSessionId?.trim()||r?.data.metadata?.session?.threadId?.trim()||null,j=t.harnessSessionId?.trim()||t.threadId?.trim()||t.externalSessionId?.trim()||(o?n:null)||null,k=t.runtimeSessionId?.trim()||t.surfaceSessionId?.trim()||(j&&j!==t.id?t.id:null),M=j??t.id,W=j&&t.harness==="codex"?"codex session id":j&&t.harness?`${t.harness} session id`:t.id.startsWith("relay-")?"runtime id":"session id",V=t.cwd?K(t.cwd):"workspace";return s.jsxs("div",{className:"s-sum",children:[s.jsxs("div",{className:"s-sum-session-state",children:[s.jsx("span",{className:`s-sum-session-dot${o?" s-sum-session-dot--active":""}`}),s.jsxs("span",{className:"s-sum-session-copy",children:[s.jsx("strong",{children:o?"Session attached":"Previous session"}),s.jsxs("span",{className:"s-sum-session-ref",title:M,children:[s.jsx("span",{children:W}),s.jsx("code",{children:M})]}),k&&k!==M&&s.jsxs("span",{className:"s-sum-session-profile",title:k,children:["runtime ",k]}),s.jsx("small",{title:t.cwd||void 0,children:V})]}),d!=="observed"?s.jsx("span",{className:`s-sum-trace-pill s-sum-trace-pill--${d}`,children:d==="waiting"?"waiting for work":d==="loading"?"checking trace":"no trace"}):null]}),s.jsxs("div",{className:"s-sum-cols",children:[s.jsxs("div",{className:"s-sum-col s-sum-col--activity",children:[s.jsx("div",{className:"s-sum-label",children:"Observed work"}),s.jsx(ws,{buckets:Ns(v),emptyTitle:R,emptyDetail:L})]}),s.jsxs("div",{className:"s-sum-col s-sum-col--context",children:[s.jsx("div",{className:"s-sum-label",children:"Context"}),s.jsxs("div",{className:"s-sum-ctx-head",children:[s.jsx("span",{className:"s-sum-ctx-size",children:E}),s.jsx("span",{className:"s-sum-ctx-pct",children:T})]}),a?s.jsx("div",{className:"s-sum-gauge","aria-label":`Context ${a.pct}%`,children:s.jsx("div",{className:"s-sum-gauge-fill",style:{width:`${rs(a)}%`}})}):s.jsx("div",{className:"s-sum-ctx-unavailable",children:"No token-window usage yet"}),A&&s.jsx("div",{className:"s-sum-ctx-runway",children:A})]})]}),s.jsxs("div",{className:"s-sum-foot",children:[C?s.jsx("div",{className:"s-sum-stats",children:H.map((g,P)=>s.jsxs("span",{className:"s-sum-stat",children:[P>0&&s.jsx("span",{className:"s-sum-stat-sep",children:"·"}),s.jsx("span",{className:"s-sum-stat-v",children:g.v}),s.jsx("span",{className:"s-sum-stat-k",children:g.k})]},g.k))}):s.jsx("div",{className:"s-sum-status-note",children:o?"The session exists, but no turn/tool/file activity has reached Scout yet.":"This prior session has no observable work trace."}),s.jsx("button",{type:"button",className:"s-sess-explore-primary",onClick:c,title:m,children:i})]})]})}function mt({agent:e,name:t,sessionCatalog:o,conversationId:c,navigate:i,route:m,homeView:r="agents-v2"}){const{focusedSession:p,focusSession:l}=G(),h=es(e,o),x=u.useMemo(()=>ts(o?.sessions??[],h),[o?.sessions,h]),N=x.find(n=>n.id===h)??null,I=N?.model??null,v=N?.reasoningEffort??e.reasoningEffort??null,S=[!!(I&&I!==e.model)&&I?`Session model: ${I}`:null,v?`Effort: ${v}`:null].filter(Boolean).join(" · ")||null,[y,f]=u.useState("idle"),[b,$]=u.useState(null),[C,d]=u.useState("idle"),[R,L]=u.useState(null);u.useEffect(()=>{f("idle"),$(null),d("idle"),L(null)},[e.id]);const H=m.view==="agents-v2"&&m.agentId===e.id?m.sessionId:null,D=ns(e.id,p,h,x,H),a=Q(H,x);u.useEffect(()=>{a&&(p?.agentId===e.id&&p.sessionId===a||l(e.id,a))},[e.id,p?.agentId,p?.sessionId,l,a]);const E=async()=>{if(C!=="opening"){d("opening"),L(null);try{const n=await q({...e,conversationId:c});i({view:r,agentId:e.id,conversationId:n,tab:"message"})}catch(n){L(n instanceof Error?n.message:"Could not open chat.")}finally{d("idle")}}},T=async()=>{if(y!=="starting"){f("starting"),$(null);try{const n=await B("/api/sessions",{method:"POST",body:JSON.stringify(ss(e))}),j=n.sessionId?.trim();if(j){F(i,{view:"sessions",sessionId:j},{returnTo:m});return}const k=n.conversationId?.trim();if(!k)throw new Error("Session started, but no conversation was returned.");i({view:r,agentId:n.agentId?.trim()||e.id,conversationId:k,tab:"message"})}catch(n){$(n instanceof Error?n.message:"Could not start a new session.")}finally{f("idle")}}},O=n=>F(i,{view:"sessions",sessionId:n.id},{returnTo:m}),A=n=>{l(e.id,n)};return s.jsxs("div",{className:"s-sess-root",children:[s.jsxs("header",{className:"s-sess-head",children:[s.jsxs("div",{className:"s-sess-id",children:[s.jsx("span",{className:"s-sess-avatar",children:s.jsx(Z,{agent:e,size:46,tile:!0,presence:!1})}),s.jsxs("div",{className:"s-sess-id-copy",children:[s.jsxs("div",{className:"s-sess-name-row",children:[s.jsx("span",{className:"s-sess-name",children:t}),e.handle&&s.jsxs("span",{className:"s-sess-handle",children:["@",e.handle.replace(/^@+/,"")]})]}),s.jsx(us,{agent:e,chipTitle:S})]})]}),s.jsxs("div",{className:"s-sess-head-actions",children:[s.jsx("button",{type:"button",className:"s-sess-action",onClick:()=>i({view:r,agentId:e.id,tab:"config"}),children:"Edit config"}),s.jsx("button",{type:"button",className:"s-sess-action s-sess-action--accent",disabled:y==="starting",onClick:T,children:y==="starting"?"Starting...":"+ New session"}),b&&s.jsx("div",{className:"s-sess-action-error",children:b}),R&&s.jsx("div",{className:"s-sess-action-error",children:R})]})]}),s.jsxs("section",{className:"s-sess-band",children:[s.jsxs("header",{className:"s-sess-band-head",children:[s.jsx("span",{className:"s-sess-band-label",children:"Recent sessions"}),x.length>0&&s.jsxs("span",{className:"s-sess-band-meta",children:[x.length," sessions"]})]}),s.jsx("div",{className:"s-sess-list",children:x.length===0?s.jsxs("div",{className:"s-sess-empty",children:["No sessions yet — start a new session for ",t,"."]}):x.map(n=>{const j=n.id===h,k=n.id===D,M=n.harness??e.harness??"session",W=n.model??e.model,V=W&&M&&W.startsWith(`${M}-`)?W.slice(M.length+1):W,g=[M,V,n.reasoningEffort].filter(os=>!!os).join(" · "),P=n.surfaceSessionId?`${n.transport??e.transport??"terminal"} surface ${vs(n.surfaceSessionId)}`:n.transport&&n.transport!==M?`${n.transport} surface`:null,J=j?"now":n.endedAt?`ended · ${z(n.endedAt)||"recent"}`:z(n.startedAt)||"recent";return s.jsxs("div",{className:`s-sess-item${k?" s-sess-item--selected":""}`,children:[s.jsxs("button",{type:"button",className:`s-sess-row${j?" s-sess-row--active":""}${k?" s-sess-row--selected":""}`,onClick:()=>A(n.id),"aria-expanded":k,children:[s.jsx("span",{className:"s-mod-dot s-sess-row-dot",style:{background:j?"var(--accent)":"var(--dim)",opacity:j?1:.55}}),s.jsxs("span",{className:"s-sess-row-main",children:[s.jsxs("span",{className:"s-sess-row-top",children:[s.jsx("span",{className:"s-sess-row-id",title:n.id,children:is(n.id)}),s.jsx("span",{className:"s-sess-row-tag",children:g})]}),s.jsxs("span",{className:"s-sess-row-sub",title:P??void 0,children:[n.cwd?K(n.cwd):"workspace",P?` · ${P}`:""]})]}),s.jsx("span",{className:`s-sess-row-when${j?" s-sess-row-when--active":""}`,children:J})]}),k&&s.jsx(ys,{agentId:e.id,session:n,active:j,onPrimary:()=>j?void E():O(n),primaryLabel:j?"Continue":"Resume",primaryTitle:j?"Send a message into this conversation":"Reopen this conversation and message it"})]},n.id)})})]})]})}function Ss(e){let t;if(e.kind==="tool"){const o=e.arg?.trim()||e.text?.trim()||"";t=`${e.tool??"tool"}${o?` ${o}`:""}`.trim()}else t=e.text?.trim()||e.kind;return t.length>160?`${t.slice(0,157)}…`:t}function ks({agent:e,session:t,active:o,onContinue:c,onTakeover:i,onOpen:m}){const[r,p]=u.useState(null),l=u.useCallback(async()=>{const d=await B(`/api/agents/${encodeURIComponent(e.id)}/observe`).catch(()=>null);p(d)},[e.id]);u.useEffect(()=>{p(null),l()},[l]),X(()=>{l()});const h=r?.data.events??[],x=e.branch||(t.cwd?K(t.cwd):"main"),N=e.model&&e.harness&&e.model.startsWith(`${e.harness}-`)?e.model.slice(e.harness.length+1):e.model??null,I=t.harness??e.harness??"session",v=(()=>{for(const d of h)if((d.kind==="message"||d.kind==="ask")&&d.text?.trim())return d.text.trim();return null})()??(t.cwd?K(t.cwd):null)??e.name,w=r?.data.metadata?.usage??null,S=w?.assistantMessages??null,y=_(w,{model:r?.data.metadata?.session?.model??N,adapterType:I}),f=y?Math.min(100,y.pct):null,b=o?"live":"idle",$=h.length,C=h.slice(-6).map(d=>({t:d.at??d.t?z(d.at??d.t):"",text:Ss(d),kind:d.kind}));return s.jsxs("section",{className:"ap-focus ap-profileCard","data-tone":b,"aria-label":v,children:[s.jsxs("header",{className:"ap-focusHead",children:[s.jsx("h1",{className:"ap-focusTitle",children:v}),s.jsx("span",{className:"ap-focusState","data-tone":b,children:o?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ap-dot","data-tone":"live","aria-hidden":!0})," working"]}):"idle"}),s.jsx("button",{type:"button",className:"ap-focusOpen",onClick:m,children:"Open ↗"})]}),s.jsxs("div",{className:"ap-focusAttr",children:[s.jsxs("span",{className:"ap-focusAttrText",children:[x,N?` · ${N}`:""]}),s.jsx("span",{className:"ap-rowMark","aria-hidden":!0,children:s.jsx(as,{harness:I,size:11})})]}),s.jsxs("div",{className:"ap-decision",children:[s.jsx("button",{type:"button",className:"ap-decisionPrimary",onClick:c,children:o?"Continue":"Resume"}),s.jsx("button",{type:"button",className:"ap-decisionGhost",onClick:i,children:"Take over"}),s.jsxs("span",{className:"ap-decisionMeta",children:[f!=null?s.jsxs("span",{children:[s.jsx("span",{className:"ap-metaKey",children:"ctx"}),f,"%"]}):null,w&&(w.inputTokens||w.outputTokens)?s.jsxs("span",{children:[s.jsx("span",{className:"ap-metaKey",children:"tokens"}),fs(w.inputTokens??0)," in"]}):null,S!=null?s.jsxs("span",{children:[s.jsx("span",{className:"ap-metaKey",children:"turns"}),S]}):null]})]}),s.jsxs("div",{className:"ap-logHead",children:[s.jsx("span",{className:"ap-logHeadTitle",children:"Session log"}),s.jsx("span",{className:"ap-logHeadMeta",children:r===null?"loading…":`${r.source} · ${$} events`})]}),s.jsx("div",{className:"ap-log",children:r===null?s.jsx("div",{className:"ap-traceLoading",children:"Resolving the most recent session…"}):C.length===0?s.jsx("div",{className:"ap-traceLoading",children:"No activity captured for this session yet."}):C.map((d,R)=>s.jsxs("div",{className:"ap-logLine","data-kind":d.kind,children:[s.jsx("span",{className:"ap-logT",children:d.t}),s.jsx("span",{className:"ap-logText",children:d.text})]},R))})]})}function gs({agent:e,name:t,sessionCatalog:o,conversationId:c,navigate:i,route:m}){const{focusedSession:r,focusSession:p}=G(),l=es(e,o),h=u.useMemo(()=>ts(o?.sessions??[],l),[o?.sessions,l]),x=h.find(a=>a.id===l)??h[0]??null,N=m.view==="agents-v2"&&m.agentId===e.id?m.sessionId:null,I=ns(e.id,r,l,h,N),v=Q(N,h);u.useEffect(()=>{v&&(r?.agentId===e.id&&r.sessionId===v||p(e.id,v))},[e.id,r?.agentId,r?.sessionId,p,v]);const w=e.model&&e.harness&&e.model.startsWith(`${e.harness}-`)?e.model.slice(e.harness.length+1):e.model??null,S=e.cwd?xs(e.cwd)??e.cwd:null,y=e.homeNodeName?e.homeNodeName.replace(/\.local$/i,""):null,f=e.handle?.trim().replace(/^@+/,"")||null,b=f?`@${f}`:t,$=f&&t.toLowerCase()!==f.toLowerCase()?t:[e.project?`/${e.project}`:null,e.branch,w].filter(Boolean).join(" · "),C=a=>m.view==="agents-v2"?{...m,...a,view:"agents-v2"}:{view:"agents-v2",agentId:e.id,...a},d=async()=>{try{const a=await q({...e,conversationId:c});i(C({agentId:e.id,conversationId:a,tab:"message"}))}catch{}},R=async()=>{try{const a=await B("/api/sessions",{method:"POST",body:JSON.stringify(ss(e))}),E=a.sessionId?.trim();if(E){F(i,{view:"sessions",sessionId:E},{returnTo:m});return}const T=a.conversationId?.trim();i(C({agentId:a.agentId?.trim()||e.id,...T?{conversationId:T}:{},tab:"message"}))}catch{}},L=a=>F(i,{view:"sessions",sessionId:a.id},{returnTo:m}),H=()=>F(i,{view:"terminal",agentId:e.id,mode:"takeover"},{returnTo:m}),D=a=>{p(e.id,a)};return s.jsxs("div",{className:"ap-profile",children:[s.jsxs("header",{className:"ap-profileHead",children:[s.jsx(Z,{agent:e,size:48,tile:!0,presence:!1}),s.jsxs("div",{className:"ap-profileIdent",children:[s.jsxs("div",{className:"ap-profileTop",children:[s.jsx("h1",{className:"ap-profileName",title:b,children:b}),e.harness?s.jsx("span",{className:"ap-rowMark","aria-hidden":!0,children:s.jsx(as,{harness:e.harness,size:13})}):null]}),s.jsx("span",{className:"ap-profileSub",title:$,children:$||S||"—"}),f&&t.toLowerCase()!==f.toLowerCase()?s.jsx("span",{className:"ap-profileId",title:e.id,children:t}):null]}),s.jsxs("div",{className:"ap-headActions",children:[s.jsx("button",{type:"button",className:"ap-headGhost",onClick:()=>i(C({agentId:e.id,tab:"config"})),children:"Edit config"}),s.jsx("button",{type:"button",className:"ap-headCta",onClick:()=>{R()},children:"+ New session"})]})]}),s.jsxs("div",{className:"ap-profileBody",children:[s.jsxs("div",{className:"ap-profileMain",children:[s.jsx("div",{className:"ap-profileSection",children:"Current session"}),x?s.jsx(ks,{agent:e,session:x,active:x.id===l,onContinue:()=>{d()},onTakeover:H,onOpen:()=>{d()}}):s.jsxs("div",{className:"ap-traceLoading",children:["No active session for ",t,"."]}),s.jsxs("div",{className:"ap-profileSection",children:["Sessions ",s.jsx("span",{className:"ap-profileCount",children:h.length})]}),h.length===0?s.jsxs("div",{className:"ap-empty",children:["No sessions yet — start a new session for ",t,"."]}):s.jsxs("div",{className:"ap-sessTable",children:[s.jsxs("div",{className:"ap-sessTableHead","aria-hidden":!0,children:[s.jsx("span",{}),s.jsx("span",{children:"Session"}),s.jsx("span",{children:"Engine"}),s.jsx("span",{children:"Last"})]}),h.map(a=>{const E=a.id===l,T=E?"now":a.endedAt?`ended · ${z(a.endedAt)||"recent"}`:z(a.startedAt)||"recent",O=a.cwd?K(a.cwd):is(a.id),A=a.harness??e.harness??"session",n=a.model??e.model,j=n&&n.startsWith(`${A}-`)?n.slice(A.length+1):n,k=[A,j,a.reasoningEffort].filter(Boolean).join(" · ");return s.jsxs("button",{type:"button",className:"ap-sessRow","data-tone":E?"live":"idle","data-selected":a.id===I||void 0,onClick:()=>E?D(a.id):L(a),children:[E?s.jsx("span",{className:"ap-dot","data-tone":"live","aria-hidden":!0}):s.jsx("span",{className:"ap-sessRowDot","aria-hidden":!0}),s.jsx("span",{className:"ap-sessRowName",title:a.id,children:O}),s.jsx("span",{className:"ap-sessRowEngine",children:k}),s.jsx("span",{className:"ap-sessRowWhen",children:T})]},a.id)})]})]}),s.jsxs("aside",{className:"ap-profileAside",children:[s.jsxs("div",{className:"ap-group",children:[s.jsx("div",{className:"ap-groupHead",children:"Place"}),S?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"root"}),s.jsx("span",{className:"ap-kvVal",children:S})]}):null,y?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"host"}),s.jsx("span",{className:"ap-kvVal",children:y})]}):null,e.branch?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"branch"}),s.jsx("span",{className:"ap-kvVal",children:e.branch})]}):null]}),s.jsxs("div",{className:"ap-group",children:[s.jsx("div",{className:"ap-groupHead",children:"Runtime"}),e.harness?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"harness"}),s.jsx("span",{className:"ap-kvVal",children:e.harness})]}):null,w?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"model"}),s.jsx("span",{className:"ap-kvVal",children:w})]}):null]})]})]})]})}function pt({agent:e,allAgents:t,conversationId:o,navigate:c,activeTab:i,renderProfile:m}){const{name:r}=ls(e,t),[p,l]=u.useState(null),[h,x]=u.useState(!1),[N,I]=u.useState(null),{route:v}=G(),w=v.view==="agents-v2"&&v.agentId===e.id?v.sessionId??null:null,S=Q(w,N?.sessions??[])??w,y=u.useCallback(async()=>{const b=await B(`/api/agents/${encodeURIComponent(e.id)}/session-catalog`).catch(()=>null);I(b)},[e.id]),f=u.useCallback(async()=>{x(!0);try{const b=S?new URLSearchParams({sessionId:S}):null,$=await B(`/api/agents/${encodeURIComponent(e.id)}/observe${b?`?${b}`:""}`);l($)}catch{l({agentId:e.id,source:"unavailable",fidelity:"synthetic",historyPath:null,sessionId:null,updatedAt:Date.now(),data:{events:[{id:`${e.id}:observe-error`,t:0,kind:"system",text:"Observer data is temporarily unavailable.",detail:"Retrying will resume once the session source becomes reachable."}],files:[],contextUsage:[],live:!1}})}finally{x(!1)}},[e.id,S]);return u.useEffect(()=>{I(null),y();const b=window.setTimeout(()=>{y()},3e3);return()=>window.clearTimeout(b)},[y]),u.useEffect(()=>{l(null),x(!1)},[e.id,S]),u.useEffect(()=>{i==="observe"&&f()},[i,f]),X(()=>{y(),i==="observe"&&f()}),u.useEffect(()=>{if(i!=="observe"||!p?.data.live)return;const b=setInterval(()=>{f()},2500);return()=>clearInterval(b)},[i,p?.data.live,f]),s.jsxs("div",{className:`s-profile-center${i!=="profile"?" s-profile-center--tabbed":" s-profile-center--modular"}`,children:[i==="profile"&&(m?m({agent:e,sessionCatalog:N,conversationId:o,navigate:c,route:v}):s.jsx("div",{className:"s-aproj s-aproj--profile",children:s.jsx(gs,{agent:e,name:r,sessionCatalog:N,conversationId:o,navigate:c,route:v})})),i==="config"&&s.jsx(ps,{agent:e,navigate:c,homeView:"agents-v2"}),i==="observe"&&s.jsx("div",{className:"s-profile-tab-conversation",children:h&&!p?s.jsxs("div",{className:"s-profile-activity-empty",children:[s.jsx("div",{className:"s-profile-activity-empty-title",children:"Loading trace"}),s.jsx("div",{className:"s-profile-activity-empty-detail",children:"Resolving the best available live or history-backed session stream for this agent."})]}):s.jsx(ms,{data:p?.data,agentId:e.id,sessionId:p?.sessionId,observeSource:p?.source,observeFidelity:p?.fidelity,showRail:!1})}),i==="message"&&(o?s.jsx("div",{className:"s-profile-tab-conversation",children:s.jsx(ds,{conversationId:o,navigate:c,embedded:!0})}):s.jsx(Is,{agent:e,navigate:c}))]})}function Is({agent:e,navigate:t}){const{route:o}=G(),[c,i]=u.useState("idle"),[m,r]=u.useState(null),p=async()=>{if(c!=="opening"){i("opening"),r(null);try{const l=await q(e);t(o.view==="agents-v2"?{...o,view:"agents-v2",agentId:e.id,conversationId:l,tab:"message"}:{view:"agents-v2",agentId:e.id,conversationId:l,tab:"message"})}catch(l){r(l instanceof Error?l.message:"Could not open chat.")}finally{i("idle")}}};return s.jsx("div",{className:"s-profile-tab-conversation",children:s.jsxs("div",{className:"s-profile-activity-empty",children:[s.jsx("div",{className:"s-profile-activity-empty-title",children:"No chat yet"}),s.jsxs("div",{className:"s-profile-activity-empty-detail",children:["Open a direct chat with ",e.name,". The broker will create a real chat ID and keep routing by this agent identity."]}),m&&s.jsx("div",{className:"s-sess-action-error",children:m}),s.jsx("button",{type:"button",className:"s-sess-action",disabled:c==="opening",onClick:()=>{p()},children:c==="opening"?"Opening...":"Open chat"})]})})}function ut({agent:e,conversationId:t,activeTab:o,navigate:c}){const i=[{key:"profile",label:"Sessions"},{key:"config",label:"Config"},{key:"observe",label:"Trace"},{key:"message",label:"Message"}],m=r=>c({view:"agents-v2",agentId:e.id,...t?{conversationId:t}:{},tab:r});return s.jsxs("div",{className:"s-agent-bar",children:[s.jsx(cs,{slot:"agents",fallback:{view:"agents-v2"},navigate:c,className:"s-agent-bar-back"}),s.jsx("nav",{className:"s-profile-tabs s-agent-bar-tabs",children:i.map(r=>s.jsx("button",{type:"button",className:`s-profile-tab${o===r.key?" s-profile-tab--active":""}`,disabled:r.disabled,onClick:()=>m(r.key),children:r.label},r.key))})]})}export{pt as AgentDetailWithRail,ut as AgentProfileBar,mt as AgentProfileSessionsCenter,ks as CurrentSessionCard};
1
+ import{r as u,j as s}from"./index-DvLtl7rV.js";import{A as Z}from"./AgentAvatar-6-KBVKUu.js";import{a as B}from"./api-Co9aQ2Jw.js";import{d as _,c as rs}from"./context-budget-DX_fwUs3.js";import{b as ls,p as K,n as ss,h as q}from"./NewChatComposer-_Stj0fZy.js";import{b as Q,r as es,s as ts,a as ns}from"./session-catalog-DsaZJXZt.js";import{u as X}from"./sse-CD9MMUxl.js";import{t as z}from"./time-Dhsh_2EG.js";import{B as cs}from"./BackToPicker-CXZjBRAe.js";import{o as F}from"./openContent-C6XO6kr5.js";import{u as G}from"./Provider-CtXJeLrP.js";import{ConversationScreen as ds}from"./ConversationScreen-CR9pWB65.js";import{S as ms}from"./SessionObserve-dQDN23pP.js";import{H as as}from"./HarnessMark-B979GCSB.js";/* empty css */import{AgentDefinitionsWorkspace as ps}from"./AgentDefinitionsWorkspace-Iyl4BesU.js";import{AgentEssentialsGlyph as us}from"./agent-essentials-D7KRGYvF.js";import"./SpriteAvatar-z5hHesx9.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-BwXjyg8N.js";import"./perf-PX8Rx0EP.js";import"./text-BP3oyl8-.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./createLucideIcon-DezKXSG2.js";import"./conversation-model-Dc02NsGp.js";import"./index-zvhpRHao.js";import"./NewChatOrigin-B1u7ki70.js";import"./keyboard-nav-BLYDhL3Z.js";import"./x-CAbNespN.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./file-text-CqJgwxmv.js";import"./terminal-relay-GYMIvKs1.js";import"./router-B9vQkNJL.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./ConversationComposer-CXPKx86g.js";import"./zap-Cq8eWkcF.js";import"./message-markup-C2LQDm_k.js";import"./mentions-DG6OQrsc.js";import"./AgentDetailCard-C9rn3Fj5.js";import"./AgentLiveActions-DrEJDJef.js";import"./terminal-takeover-_Jyys4me.js";import"./eye-BRyD0jno.js";import"./terminal-9GRS_Qdc.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-BQWzGzLK.js";import"./AstronautSuit-DbjQtfD_.js";import"./ConversationFeedRows-WrH-YI3L.js";import"./ConversationPanels-Dujvnmup.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-x8pJMVrG.js";import"./proxy-BiW5suC7.js";import"./activity-DcrMApUY.js";import"./message-circle-mZCv8tvB.js";import"./tail-events-Ps8KpKah.js";import"./ConversationStatus-DVzSb2Hv.js";import"./check-ofKUE8yH.js";import"./sparkles-CETYrxGA.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-HByf2ndx.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-BJUhDSuQ.js";import"./ObserveTextFlow-ZQWwrK3i.js";import"./SessionObserveEvidence-BRBGKAgd.js";import"./wrench-DjkoAOQt.js";import"./external-link-Dp_a2vRZ.js";import"./agent-specialization-BujJVUTD.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-Df6VzXjA.js";/* empty css */function hs(e){if(e===null)return"age unknown";const t=Math.max(0,Math.round(e/6e4));if(t<60)return`${t}m old`;const o=Math.floor(t/60),c=t%60;return c>0?`${o}h ${c}m old`:`${o}h old`}function Y(e){return`${e.turnCount} turn${e.turnCount===1?"":"s"}`}function xs(e){return e?e.startsWith("/Users/")?"~/"+e.split("/").slice(3).join("/"):e:null}function is(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu.test(e)?e:e.length>16?`${e.slice(0,8)}…${e.slice(-4)}`:e}function vs(e){return e.replace(/^relay-/u,"").replace(/-arts-mac-mini-local-(claude|codex)$/u,"")}function fs(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:`${e}`}function U(e){return typeof e!="number"||!Number.isFinite(e)?"-":Math.abs(e)<1e3?`${Math.round(e)}`:Math.abs(e)<1e6?`${(e/1e3).toFixed(e%1e3===0?0:1)}k`:`${(e/1e6).toFixed(1)}m`}function js(e){if(!Number.isFinite(e)||e<=0)return"0s";if(e<60)return`${Math.round(e)}s`;const t=Math.round(e),o=Math.floor(t/3600),c=Math.floor(t%3600/60),i=t%60;return o>0?`${o}h ${c}m`:c>=10||i===0?`${c}m`:`${c}m ${i}s`}function Ns(e,t=32){if(e.length===0)return[];const o=e[e.length-1].t||1,c=new Array(t).fill(0);for(const i of e){const m=Math.min(t-1,Math.max(0,Math.floor(i.t/o*t)));c[m]+=1}return c}function bs(e){return e.kind!=="boot"&&e.kind!=="system"}function ws({buckets:e,emptyTitle:t,emptyDetail:o}){if(e.length===0)return s.jsxs("div",{className:"s-sum-observed-empty",children:[s.jsx("span",{children:t}),s.jsx("strong",{children:o})]});const c=Math.max(...e,1),i=240,m=20,r=1,p=(i-r*(e.length-1))/e.length;return s.jsxs("div",{className:"s-sum-spark",children:[s.jsx("svg",{viewBox:`0 0 ${i} ${m}`,preserveAspectRatio:"none",className:"s-sum-spark-svg","aria-hidden":!0,children:e.map((l,h)=>{const x=Math.max(1,l/c*m);return s.jsx("rect",{x:h*(p+r),y:m-x,width:p,height:x,fill:"var(--accent)",opacity:.22+.62*(l/c)},h)})}),s.jsxs("div",{className:"s-sum-spark-axis",children:[s.jsx("span",{children:"session start"}),s.jsx("span",{children:"now"})]})]})}function ys({agentId:e,session:t,active:o,onPrimary:c,primaryLabel:i,primaryTitle:m}){const[r,p]=u.useState(null),[l,h]=u.useState(null),x=u.useCallback(async()=>{const g=new URLSearchParams({sessionId:t.id}),[P,J]=await Promise.all([B(`/api/agents/${encodeURIComponent(e)}/observe?${g}`).catch(()=>null),B(`/api/agents/${encodeURIComponent(e)}/session/context`).catch(()=>null)]);p(P),h(J)},[e,t.id]);u.useEffect(()=>{x()},[x]),X(()=>{x()});const N=r?.data,v=(N?.events??[]).filter(bs),w=v.filter(g=>g.kind==="tool"),S=w.filter(g=>g.tool==="edit"||g.tool==="write"),y=w.filter(g=>g.tool==="read"),f=N?.files.length??0,b=N?.metadata?.session?.turnCount,$=l?.activeSessionId===t.id?l.turnCount:void 0,C=v.length>0||f>0,d=r?r.source==="unavailable"?"unavailable":C?"observed":"waiting":"loading",R=d==="loading"?"Loading trace":d==="unavailable"?"No trace source":"Session created",L=d==="loading"?"checking for terminal or transcript activity":d==="unavailable"?"this session has no observable transcript attached":"no agent work has been recorded yet",H=[{k:"turns",v:U(b??$)},{k:"tools",v:U(w.length)},{k:"edits",v:U(S.length)},{k:"reads",v:U(y.length)},{k:"files",v:U(f)},{k:"window",v:js(v.length>0?v[v.length-1].t:0)}],D=N?.metadata?.usage,a=_(D,{model:N?.metadata?.session?.model??t.model,adapterType:t.harness}),E=a?`${a.usedLabel} / ${a.budgetLabel} ctx`:l?Y(l):"context",T=a?`${a.pct}%${a.overLimit?" over":""}`:"tokens unavailable",O=l&&l.sessionAgeMs!==null?hs(l.sessionAgeMs):null,A=a&&l?`${Y(l)}${O?` · ${O}`:""}`:O,n=r?.sessionId?.trim()||r?.data.metadata?.session?.externalSessionId?.trim()||r?.data.metadata?.session?.threadId?.trim()||null,j=t.harnessSessionId?.trim()||t.threadId?.trim()||t.externalSessionId?.trim()||(o?n:null)||null,k=t.runtimeSessionId?.trim()||t.surfaceSessionId?.trim()||(j&&j!==t.id?t.id:null),M=j??t.id,W=j&&t.harness==="codex"?"codex session id":j&&t.harness?`${t.harness} session id`:t.id.startsWith("relay-")?"runtime id":"session id",V=t.cwd?K(t.cwd):"workspace";return s.jsxs("div",{className:"s-sum",children:[s.jsxs("div",{className:"s-sum-session-state",children:[s.jsx("span",{className:`s-sum-session-dot${o?" s-sum-session-dot--active":""}`}),s.jsxs("span",{className:"s-sum-session-copy",children:[s.jsx("strong",{children:o?"Session attached":"Previous session"}),s.jsxs("span",{className:"s-sum-session-ref",title:M,children:[s.jsx("span",{children:W}),s.jsx("code",{children:M})]}),k&&k!==M&&s.jsxs("span",{className:"s-sum-session-profile",title:k,children:["runtime ",k]}),s.jsx("small",{title:t.cwd||void 0,children:V})]}),d!=="observed"?s.jsx("span",{className:`s-sum-trace-pill s-sum-trace-pill--${d}`,children:d==="waiting"?"waiting for work":d==="loading"?"checking trace":"no trace"}):null]}),s.jsxs("div",{className:"s-sum-cols",children:[s.jsxs("div",{className:"s-sum-col s-sum-col--activity",children:[s.jsx("div",{className:"s-sum-label",children:"Observed work"}),s.jsx(ws,{buckets:Ns(v),emptyTitle:R,emptyDetail:L})]}),s.jsxs("div",{className:"s-sum-col s-sum-col--context",children:[s.jsx("div",{className:"s-sum-label",children:"Context"}),s.jsxs("div",{className:"s-sum-ctx-head",children:[s.jsx("span",{className:"s-sum-ctx-size",children:E}),s.jsx("span",{className:"s-sum-ctx-pct",children:T})]}),a?s.jsx("div",{className:"s-sum-gauge","aria-label":`Context ${a.pct}%`,children:s.jsx("div",{className:"s-sum-gauge-fill",style:{width:`${rs(a)}%`}})}):s.jsx("div",{className:"s-sum-ctx-unavailable",children:"No token-window usage yet"}),A&&s.jsx("div",{className:"s-sum-ctx-runway",children:A})]})]}),s.jsxs("div",{className:"s-sum-foot",children:[C?s.jsx("div",{className:"s-sum-stats",children:H.map((g,P)=>s.jsxs("span",{className:"s-sum-stat",children:[P>0&&s.jsx("span",{className:"s-sum-stat-sep",children:"·"}),s.jsx("span",{className:"s-sum-stat-v",children:g.v}),s.jsx("span",{className:"s-sum-stat-k",children:g.k})]},g.k))}):s.jsx("div",{className:"s-sum-status-note",children:o?"The session exists, but no turn/tool/file activity has reached Scout yet.":"This prior session has no observable work trace."}),s.jsx("button",{type:"button",className:"s-sess-explore-primary",onClick:c,title:m,children:i})]})]})}function mt({agent:e,name:t,sessionCatalog:o,conversationId:c,navigate:i,route:m,homeView:r="agents-v2"}){const{focusedSession:p,focusSession:l}=G(),h=es(e,o),x=u.useMemo(()=>ts(o?.sessions??[],h),[o?.sessions,h]),N=x.find(n=>n.id===h)??null,I=N?.model??null,v=N?.reasoningEffort??e.reasoningEffort??null,S=[!!(I&&I!==e.model)&&I?`Session model: ${I}`:null,v?`Effort: ${v}`:null].filter(Boolean).join(" · ")||null,[y,f]=u.useState("idle"),[b,$]=u.useState(null),[C,d]=u.useState("idle"),[R,L]=u.useState(null);u.useEffect(()=>{f("idle"),$(null),d("idle"),L(null)},[e.id]);const H=m.view==="agents-v2"&&m.agentId===e.id?m.sessionId:null,D=ns(e.id,p,h,x,H),a=Q(H,x);u.useEffect(()=>{a&&(p?.agentId===e.id&&p.sessionId===a||l(e.id,a))},[e.id,p?.agentId,p?.sessionId,l,a]);const E=async()=>{if(C!=="opening"){d("opening"),L(null);try{const n=await q({...e,conversationId:c});i({view:r,agentId:e.id,conversationId:n,tab:"message"})}catch(n){L(n instanceof Error?n.message:"Could not open chat.")}finally{d("idle")}}},T=async()=>{if(y!=="starting"){f("starting"),$(null);try{const n=await B("/api/sessions",{method:"POST",body:JSON.stringify(ss(e))}),j=n.sessionId?.trim();if(j){F(i,{view:"sessions",sessionId:j},{returnTo:m});return}const k=n.conversationId?.trim();if(!k)throw new Error("Session started, but no conversation was returned.");i({view:r,agentId:n.agentId?.trim()||e.id,conversationId:k,tab:"message"})}catch(n){$(n instanceof Error?n.message:"Could not start a new session.")}finally{f("idle")}}},O=n=>F(i,{view:"sessions",sessionId:n.id},{returnTo:m}),A=n=>{l(e.id,n)};return s.jsxs("div",{className:"s-sess-root",children:[s.jsxs("header",{className:"s-sess-head",children:[s.jsxs("div",{className:"s-sess-id",children:[s.jsx("span",{className:"s-sess-avatar",children:s.jsx(Z,{agent:e,size:46,tile:!0,presence:!1})}),s.jsxs("div",{className:"s-sess-id-copy",children:[s.jsxs("div",{className:"s-sess-name-row",children:[s.jsx("span",{className:"s-sess-name",children:t}),e.handle&&s.jsxs("span",{className:"s-sess-handle",children:["@",e.handle.replace(/^@+/,"")]})]}),s.jsx(us,{agent:e,chipTitle:S})]})]}),s.jsxs("div",{className:"s-sess-head-actions",children:[s.jsx("button",{type:"button",className:"s-sess-action",onClick:()=>i({view:r,agentId:e.id,tab:"config"}),children:"Edit config"}),s.jsx("button",{type:"button",className:"s-sess-action s-sess-action--accent",disabled:y==="starting",onClick:T,children:y==="starting"?"Starting...":"+ New session"}),b&&s.jsx("div",{className:"s-sess-action-error",children:b}),R&&s.jsx("div",{className:"s-sess-action-error",children:R})]})]}),s.jsxs("section",{className:"s-sess-band",children:[s.jsxs("header",{className:"s-sess-band-head",children:[s.jsx("span",{className:"s-sess-band-label",children:"Recent sessions"}),x.length>0&&s.jsxs("span",{className:"s-sess-band-meta",children:[x.length," sessions"]})]}),s.jsx("div",{className:"s-sess-list",children:x.length===0?s.jsxs("div",{className:"s-sess-empty",children:["No sessions yet — start a new session for ",t,"."]}):x.map(n=>{const j=n.id===h,k=n.id===D,M=n.harness??e.harness??"session",W=n.model??e.model,V=W&&M&&W.startsWith(`${M}-`)?W.slice(M.length+1):W,g=[M,V,n.reasoningEffort].filter(os=>!!os).join(" · "),P=n.surfaceSessionId?`${n.transport??e.transport??"terminal"} surface ${vs(n.surfaceSessionId)}`:n.transport&&n.transport!==M?`${n.transport} surface`:null,J=j?"now":n.endedAt?`ended · ${z(n.endedAt)||"recent"}`:z(n.startedAt)||"recent";return s.jsxs("div",{className:`s-sess-item${k?" s-sess-item--selected":""}`,children:[s.jsxs("button",{type:"button",className:`s-sess-row${j?" s-sess-row--active":""}${k?" s-sess-row--selected":""}`,onClick:()=>A(n.id),"aria-expanded":k,children:[s.jsx("span",{className:"s-mod-dot s-sess-row-dot",style:{background:j?"var(--accent)":"var(--dim)",opacity:j?1:.55}}),s.jsxs("span",{className:"s-sess-row-main",children:[s.jsxs("span",{className:"s-sess-row-top",children:[s.jsx("span",{className:"s-sess-row-id",title:n.id,children:is(n.id)}),s.jsx("span",{className:"s-sess-row-tag",children:g})]}),s.jsxs("span",{className:"s-sess-row-sub",title:P??void 0,children:[n.cwd?K(n.cwd):"workspace",P?` · ${P}`:""]})]}),s.jsx("span",{className:`s-sess-row-when${j?" s-sess-row-when--active":""}`,children:J})]}),k&&s.jsx(ys,{agentId:e.id,session:n,active:j,onPrimary:()=>j?void E():O(n),primaryLabel:j?"Continue":"Resume",primaryTitle:j?"Send a message into this conversation":"Reopen this conversation and message it"})]},n.id)})})]})]})}function Ss(e){let t;if(e.kind==="tool"){const o=e.arg?.trim()||e.text?.trim()||"";t=`${e.tool??"tool"}${o?` ${o}`:""}`.trim()}else t=e.text?.trim()||e.kind;return t.length>160?`${t.slice(0,157)}…`:t}function ks({agent:e,session:t,active:o,onContinue:c,onTakeover:i,onOpen:m}){const[r,p]=u.useState(null),l=u.useCallback(async()=>{const d=await B(`/api/agents/${encodeURIComponent(e.id)}/observe`).catch(()=>null);p(d)},[e.id]);u.useEffect(()=>{p(null),l()},[l]),X(()=>{l()});const h=r?.data.events??[],x=e.branch||(t.cwd?K(t.cwd):"main"),N=e.model&&e.harness&&e.model.startsWith(`${e.harness}-`)?e.model.slice(e.harness.length+1):e.model??null,I=t.harness??e.harness??"session",v=(()=>{for(const d of h)if((d.kind==="message"||d.kind==="ask")&&d.text?.trim())return d.text.trim();return null})()??(t.cwd?K(t.cwd):null)??e.name,w=r?.data.metadata?.usage??null,S=w?.assistantMessages??null,y=_(w,{model:r?.data.metadata?.session?.model??N,adapterType:I}),f=y?Math.min(100,y.pct):null,b=o?"live":"idle",$=h.length,C=h.slice(-6).map(d=>({t:d.at??d.t?z(d.at??d.t):"",text:Ss(d),kind:d.kind}));return s.jsxs("section",{className:"ap-focus ap-profileCard","data-tone":b,"aria-label":v,children:[s.jsxs("header",{className:"ap-focusHead",children:[s.jsx("h1",{className:"ap-focusTitle",children:v}),s.jsx("span",{className:"ap-focusState","data-tone":b,children:o?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ap-dot","data-tone":"live","aria-hidden":!0})," working"]}):"idle"}),s.jsx("button",{type:"button",className:"ap-focusOpen",onClick:m,children:"Open ↗"})]}),s.jsxs("div",{className:"ap-focusAttr",children:[s.jsxs("span",{className:"ap-focusAttrText",children:[x,N?` · ${N}`:""]}),s.jsx("span",{className:"ap-rowMark","aria-hidden":!0,children:s.jsx(as,{harness:I,size:11})})]}),s.jsxs("div",{className:"ap-decision",children:[s.jsx("button",{type:"button",className:"ap-decisionPrimary",onClick:c,children:o?"Continue":"Resume"}),s.jsx("button",{type:"button",className:"ap-decisionGhost",onClick:i,children:"Take over"}),s.jsxs("span",{className:"ap-decisionMeta",children:[f!=null?s.jsxs("span",{children:[s.jsx("span",{className:"ap-metaKey",children:"ctx"}),f,"%"]}):null,w&&(w.inputTokens||w.outputTokens)?s.jsxs("span",{children:[s.jsx("span",{className:"ap-metaKey",children:"tokens"}),fs(w.inputTokens??0)," in"]}):null,S!=null?s.jsxs("span",{children:[s.jsx("span",{className:"ap-metaKey",children:"turns"}),S]}):null]})]}),s.jsxs("div",{className:"ap-logHead",children:[s.jsx("span",{className:"ap-logHeadTitle",children:"Session log"}),s.jsx("span",{className:"ap-logHeadMeta",children:r===null?"loading…":`${r.source} · ${$} events`})]}),s.jsx("div",{className:"ap-log",children:r===null?s.jsx("div",{className:"ap-traceLoading",children:"Resolving the most recent session…"}):C.length===0?s.jsx("div",{className:"ap-traceLoading",children:"No activity captured for this session yet."}):C.map((d,R)=>s.jsxs("div",{className:"ap-logLine","data-kind":d.kind,children:[s.jsx("span",{className:"ap-logT",children:d.t}),s.jsx("span",{className:"ap-logText",children:d.text})]},R))})]})}function gs({agent:e,name:t,sessionCatalog:o,conversationId:c,navigate:i,route:m}){const{focusedSession:r,focusSession:p}=G(),l=es(e,o),h=u.useMemo(()=>ts(o?.sessions??[],l),[o?.sessions,l]),x=h.find(a=>a.id===l)??h[0]??null,N=m.view==="agents-v2"&&m.agentId===e.id?m.sessionId:null,I=ns(e.id,r,l,h,N),v=Q(N,h);u.useEffect(()=>{v&&(r?.agentId===e.id&&r.sessionId===v||p(e.id,v))},[e.id,r?.agentId,r?.sessionId,p,v]);const w=e.model&&e.harness&&e.model.startsWith(`${e.harness}-`)?e.model.slice(e.harness.length+1):e.model??null,S=e.cwd?xs(e.cwd)??e.cwd:null,y=e.homeNodeName?e.homeNodeName.replace(/\.local$/i,""):null,f=e.handle?.trim().replace(/^@+/,"")||null,b=f?`@${f}`:t,$=f&&t.toLowerCase()!==f.toLowerCase()?t:[e.project?`/${e.project}`:null,e.branch,w].filter(Boolean).join(" · "),C=a=>m.view==="agents-v2"?{...m,...a,view:"agents-v2"}:{view:"agents-v2",agentId:e.id,...a},d=async()=>{try{const a=await q({...e,conversationId:c});i(C({agentId:e.id,conversationId:a,tab:"message"}))}catch{}},R=async()=>{try{const a=await B("/api/sessions",{method:"POST",body:JSON.stringify(ss(e))}),E=a.sessionId?.trim();if(E){F(i,{view:"sessions",sessionId:E},{returnTo:m});return}const T=a.conversationId?.trim();i(C({agentId:a.agentId?.trim()||e.id,...T?{conversationId:T}:{},tab:"message"}))}catch{}},L=a=>F(i,{view:"sessions",sessionId:a.id},{returnTo:m}),H=()=>F(i,{view:"terminal",agentId:e.id,mode:"takeover"},{returnTo:m}),D=a=>{p(e.id,a)};return s.jsxs("div",{className:"ap-profile",children:[s.jsxs("header",{className:"ap-profileHead",children:[s.jsx(Z,{agent:e,size:48,tile:!0,presence:!1}),s.jsxs("div",{className:"ap-profileIdent",children:[s.jsxs("div",{className:"ap-profileTop",children:[s.jsx("h1",{className:"ap-profileName",title:b,children:b}),e.harness?s.jsx("span",{className:"ap-rowMark","aria-hidden":!0,children:s.jsx(as,{harness:e.harness,size:13})}):null]}),s.jsx("span",{className:"ap-profileSub",title:$,children:$||S||"—"}),f&&t.toLowerCase()!==f.toLowerCase()?s.jsx("span",{className:"ap-profileId",title:e.id,children:t}):null]}),s.jsxs("div",{className:"ap-headActions",children:[s.jsx("button",{type:"button",className:"ap-headGhost",onClick:()=>i(C({agentId:e.id,tab:"config"})),children:"Edit config"}),s.jsx("button",{type:"button",className:"ap-headCta",onClick:()=>{R()},children:"+ New session"})]})]}),s.jsxs("div",{className:"ap-profileBody",children:[s.jsxs("div",{className:"ap-profileMain",children:[s.jsx("div",{className:"ap-profileSection",children:"Current session"}),x?s.jsx(ks,{agent:e,session:x,active:x.id===l,onContinue:()=>{d()},onTakeover:H,onOpen:()=>{d()}}):s.jsxs("div",{className:"ap-traceLoading",children:["No active session for ",t,"."]}),s.jsxs("div",{className:"ap-profileSection",children:["Sessions ",s.jsx("span",{className:"ap-profileCount",children:h.length})]}),h.length===0?s.jsxs("div",{className:"ap-empty",children:["No sessions yet — start a new session for ",t,"."]}):s.jsxs("div",{className:"ap-sessTable",children:[s.jsxs("div",{className:"ap-sessTableHead","aria-hidden":!0,children:[s.jsx("span",{}),s.jsx("span",{children:"Session"}),s.jsx("span",{children:"Engine"}),s.jsx("span",{children:"Last"})]}),h.map(a=>{const E=a.id===l,T=E?"now":a.endedAt?`ended · ${z(a.endedAt)||"recent"}`:z(a.startedAt)||"recent",O=a.cwd?K(a.cwd):is(a.id),A=a.harness??e.harness??"session",n=a.model??e.model,j=n&&n.startsWith(`${A}-`)?n.slice(A.length+1):n,k=[A,j,a.reasoningEffort].filter(Boolean).join(" · ");return s.jsxs("button",{type:"button",className:"ap-sessRow","data-tone":E?"live":"idle","data-selected":a.id===I||void 0,onClick:()=>E?D(a.id):L(a),children:[E?s.jsx("span",{className:"ap-dot","data-tone":"live","aria-hidden":!0}):s.jsx("span",{className:"ap-sessRowDot","aria-hidden":!0}),s.jsx("span",{className:"ap-sessRowName",title:a.id,children:O}),s.jsx("span",{className:"ap-sessRowEngine",children:k}),s.jsx("span",{className:"ap-sessRowWhen",children:T})]},a.id)})]})]}),s.jsxs("aside",{className:"ap-profileAside",children:[s.jsxs("div",{className:"ap-group",children:[s.jsx("div",{className:"ap-groupHead",children:"Place"}),S?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"root"}),s.jsx("span",{className:"ap-kvVal",children:S})]}):null,y?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"host"}),s.jsx("span",{className:"ap-kvVal",children:y})]}):null,e.branch?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"branch"}),s.jsx("span",{className:"ap-kvVal",children:e.branch})]}):null]}),s.jsxs("div",{className:"ap-group",children:[s.jsx("div",{className:"ap-groupHead",children:"Runtime"}),e.harness?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"harness"}),s.jsx("span",{className:"ap-kvVal",children:e.harness})]}):null,w?s.jsxs("div",{className:"ap-kv",children:[s.jsx("span",{className:"ap-kvKey",children:"model"}),s.jsx("span",{className:"ap-kvVal",children:w})]}):null]})]})]})]})}function pt({agent:e,allAgents:t,conversationId:o,navigate:c,activeTab:i,renderProfile:m}){const{name:r}=ls(e,t),[p,l]=u.useState(null),[h,x]=u.useState(!1),[N,I]=u.useState(null),{route:v}=G(),w=v.view==="agents-v2"&&v.agentId===e.id?v.sessionId??null:null,S=Q(w,N?.sessions??[])??w,y=u.useCallback(async()=>{const b=await B(`/api/agents/${encodeURIComponent(e.id)}/session-catalog`).catch(()=>null);I(b)},[e.id]),f=u.useCallback(async()=>{x(!0);try{const b=S?new URLSearchParams({sessionId:S}):null,$=await B(`/api/agents/${encodeURIComponent(e.id)}/observe${b?`?${b}`:""}`);l($)}catch{l({agentId:e.id,source:"unavailable",fidelity:"synthetic",historyPath:null,sessionId:null,updatedAt:Date.now(),data:{events:[{id:`${e.id}:observe-error`,t:0,kind:"system",text:"Observer data is temporarily unavailable.",detail:"Retrying will resume once the session source becomes reachable."}],files:[],contextUsage:[],live:!1}})}finally{x(!1)}},[e.id,S]);return u.useEffect(()=>{I(null),y();const b=window.setTimeout(()=>{y()},3e3);return()=>window.clearTimeout(b)},[y]),u.useEffect(()=>{l(null),x(!1)},[e.id,S]),u.useEffect(()=>{i==="observe"&&f()},[i,f]),X(()=>{y(),i==="observe"&&f()}),u.useEffect(()=>{if(i!=="observe"||!p?.data.live)return;const b=setInterval(()=>{f()},2500);return()=>clearInterval(b)},[i,p?.data.live,f]),s.jsxs("div",{className:`s-profile-center${i!=="profile"?" s-profile-center--tabbed":" s-profile-center--modular"}`,children:[i==="profile"&&(m?m({agent:e,sessionCatalog:N,conversationId:o,navigate:c,route:v}):s.jsx("div",{className:"s-aproj s-aproj--profile",children:s.jsx(gs,{agent:e,name:r,sessionCatalog:N,conversationId:o,navigate:c,route:v})})),i==="config"&&s.jsx(ps,{agent:e,navigate:c,homeView:"agents-v2"}),i==="observe"&&s.jsx("div",{className:"s-profile-tab-conversation",children:h&&!p?s.jsxs("div",{className:"s-profile-activity-empty",children:[s.jsx("div",{className:"s-profile-activity-empty-title",children:"Loading trace"}),s.jsx("div",{className:"s-profile-activity-empty-detail",children:"Resolving the best available live or history-backed session stream for this agent."})]}):s.jsx(ms,{data:p?.data,agentId:e.id,sessionId:p?.sessionId,observeSource:p?.source,observeFidelity:p?.fidelity,showRail:!1})}),i==="message"&&(o?s.jsx("div",{className:"s-profile-tab-conversation",children:s.jsx(ds,{conversationId:o,navigate:c,embedded:!0})}):s.jsx(Is,{agent:e,navigate:c}))]})}function Is({agent:e,navigate:t}){const{route:o}=G(),[c,i]=u.useState("idle"),[m,r]=u.useState(null),p=async()=>{if(c!=="opening"){i("opening"),r(null);try{const l=await q(e);t(o.view==="agents-v2"?{...o,view:"agents-v2",agentId:e.id,conversationId:l,tab:"message"}:{view:"agents-v2",agentId:e.id,conversationId:l,tab:"message"})}catch(l){r(l instanceof Error?l.message:"Could not open chat.")}finally{i("idle")}}};return s.jsx("div",{className:"s-profile-tab-conversation",children:s.jsxs("div",{className:"s-profile-activity-empty",children:[s.jsx("div",{className:"s-profile-activity-empty-title",children:"No chat yet"}),s.jsxs("div",{className:"s-profile-activity-empty-detail",children:["Open a direct chat with ",e.name,". The broker will create a real chat ID and keep routing by this agent identity."]}),m&&s.jsx("div",{className:"s-sess-action-error",children:m}),s.jsx("button",{type:"button",className:"s-sess-action",disabled:c==="opening",onClick:()=>{p()},children:c==="opening"?"Opening...":"Open chat"})]})})}function ut({agent:e,conversationId:t,activeTab:o,navigate:c}){const i=[{key:"profile",label:"Sessions"},{key:"config",label:"Config"},{key:"observe",label:"Trace"},{key:"message",label:"Message"}],m=r=>c({view:"agents-v2",agentId:e.id,...t?{conversationId:t}:{},tab:r});return s.jsxs("div",{className:"s-agent-bar",children:[s.jsx(cs,{slot:"agents",fallback:{view:"agents-v2"},navigate:c,className:"s-agent-bar-back"}),s.jsx("nav",{className:"s-profile-tabs s-agent-bar-tabs",children:i.map(r=>s.jsx("button",{type:"button",className:`s-profile-tab${o===r.key?" s-profile-tab--active":""}`,disabled:r.disabled,onClick:()=>m(r.key),children:r.label},r.key))})]})}export{pt as AgentDetailWithRail,ut as AgentProfileBar,mt as AgentProfileSessionsCenter,ks as CurrentSessionCard};