@openscout/scout 0.2.87 → 0.2.91

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 (486) hide show
  1. package/README.md +10 -5
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +4 -4
  4. package/dist/client/assets/ActivityScreen-BUeb4ERK.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-Dw2oyCcz.js → AddProjectForm-DtTfn4Zk.js} +1 -1
  6. package/dist/client/assets/AgentAvatar-CneOa70z.js +1 -0
  7. package/dist/client/assets/AgentConfigurationScreen-CkZ7EjZh.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-0Y3kqMtv.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-2DZQahiN.js → AgentDetailCard-Dtc02KUO.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-B5raPB_U.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-DFG4ElZD.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-CeSjWWwh.js → AgentLaneCard-BRAkw8YJ.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-Do7CXwin.js → AgentLaneChrome-T8QE5742.js} +1 -1
  14. package/dist/client/assets/AgentLaneDetailSheet-C8RYotnv.js +4 -0
  15. package/dist/client/assets/{AgentLaneSummaryResize--lHgnncr.js → AgentLaneSummaryResize-FyYweLo_.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-BwkGk8JH.js → AgentLanesPreflight-Cil3dNwu.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-DPfO8MOo.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-BmXDRxER.js → AgentLiveActions-DwScaVRF.js} +1 -1
  20. package/dist/client/assets/AgentSessions-DKoWA0Lm.js +6 -0
  21. package/dist/client/assets/AgentsConsole-DoBIWGoq.js +1 -0
  22. package/dist/client/assets/AgentsScreen-JuUiSuwY.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +1 -0
  24. package/dist/client/assets/{AtopView-DOKJbiJL.js → AtopView-ycxMrRwp.js} +1 -1
  25. package/dist/client/assets/BackToPicker-D6WgIDb-.js +1 -0
  26. package/dist/client/assets/BriefingDetailScreen-Zw-taW1s.js +6 -0
  27. package/dist/client/assets/{BriefingsScreen-DLIJ8eYj.js → BriefingsScreen-BerYOoWS.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-C8WERmHF.js → BrokerMetadataPanel-Cu93j-Ga.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-CeN90URH.js +5 -0
  30. package/dist/client/assets/ChatCollapsedStrip-DdKyMSEM.js +1 -0
  31. package/dist/client/assets/{CodeDiffPane-CtgqIuS0.js → CodeDiffPane-BjCOBLze.js} +1 -1
  32. package/dist/client/assets/{CodeProjectPicker-C4W_udc7.js → CodeProjectPicker-NSGdCaK0.js} +1 -1
  33. package/dist/client/assets/{CodeScreen-WhTvVUKY.js → CodeScreen-CA9Sq6Dx.js} +1 -1
  34. package/dist/client/assets/ContextMenu-DnFcmfMR.js +1 -0
  35. package/dist/client/assets/ConversationComposer-CjRXFkvY.js +1 -0
  36. package/dist/client/assets/ConversationFeedRows-CgRTIpAv.js +1 -0
  37. package/dist/client/assets/ConversationHeader-CRmdtuL7.js +1 -0
  38. package/dist/client/assets/ConversationPanels-DCkcLIHk.js +2 -0
  39. package/dist/client/assets/ConversationScreen-Br0QQ3xo.js +1 -0
  40. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
  41. package/dist/client/assets/ConversationStatus-BJ1CMbAv.js +1 -0
  42. package/dist/client/assets/{DataTable-DFacT2uu.js → DataTable-Dzqiaha4.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-D797PbCe.js → DispatchAftermath-B0WMg_z3.js} +1 -1
  44. package/dist/client/assets/DocumentFocusViewer-CZVVIAD5.js +1 -0
  45. package/dist/client/assets/{EmbeddableSurfacesLab-JczLmmF-.js → EmbeddableSurfacesLab-C3a7hJWO.js} +1 -1
  46. package/dist/client/assets/{EmptyState-uQbB-bvP.js → EmptyState-CYNJZMrZ.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-ebbCtnHE.js → FileViewerPane-Fwt8_KmD.js} +1 -1
  48. package/dist/client/assets/FleetSearch-Dsi_l2KW.js +1 -0
  49. package/dist/client/assets/FleetSearch-EXOe8ulE.css +1 -0
  50. package/dist/client/assets/FlightObserveScreen-g_tiGmvz.js +1 -0
  51. package/dist/client/assets/{FollowScreen-Bfu2_KtU.js → FollowScreen-Bb_rcrzi.js} +1 -1
  52. package/dist/client/assets/{HarnessMark-CEzmPFHC.js → HarnessMark-DrE57dUq.js} +1 -1
  53. package/dist/client/assets/HarnessesScreen-CAsCJ_tG.js +1 -0
  54. package/dist/client/assets/{HerdrSession-BDLa_rrK.js → HerdrSession-1eVu9Owj.js} +1 -1
  55. package/dist/client/assets/HomeHero-DEl-WBsT.css +1 -0
  56. package/dist/client/assets/HomeHero-W445QrG1.js +1 -0
  57. package/dist/client/assets/{KnowledgeSearchInspector-GjmxYBi_.js → KnowledgeSearchInspector-CbPVg3fr.js} +1 -1
  58. package/dist/client/assets/KnowledgeSearchScreen-C1lN1xJk.js +1 -0
  59. package/dist/client/assets/{LaneToolHoverCard-DCY-m0JK.js → LaneToolHoverCard-BkBcDYm-.js} +1 -1
  60. package/dist/client/assets/LaneTraceDetailSheet-CzTd44rf.js +1 -0
  61. package/dist/client/assets/{LaneTraceEventFocus-BfKZ7G5c.js → LaneTraceEventFocus-BmMmPTyJ.js} +1 -1
  62. package/dist/client/assets/{MeshCanvas-CZYHLTvw.js → MeshCanvas-DwkjsiJ5.js} +2 -2
  63. package/dist/client/assets/{MeshCanvasMinimap-D3mJ78CM.js → MeshCanvasMinimap-vmCpU1sD.js} +1 -1
  64. package/dist/client/assets/MeshScreen-CkMepUpT.js +1 -0
  65. package/dist/client/assets/{MeshTopologyView-A-wh0Ad1.js → MeshTopologyView-BD2xLE2C.js} +2 -2
  66. package/dist/client/assets/MessageComposerSuggestions-qbalTne_.js +1 -0
  67. package/dist/client/assets/MessagesScreen-C8UynyLC.js +1 -0
  68. package/dist/client/assets/{MissionContextRail-MTL2EAnr.js → MissionContextRail-D5MEP2f4.js} +1 -1
  69. package/dist/client/assets/MissionControlView-K_I7eftL.js +1 -0
  70. package/dist/client/assets/MissionFocusOverlay-CWKLdUKG.js +1 -0
  71. package/dist/client/assets/MissionLeftAgentRow-ByGrNAcs.js +1 -0
  72. package/dist/client/assets/MissionLogPane-ZwHJ137T.js +1 -0
  73. package/dist/client/assets/{NewAgentModal-Ctixol4_.js → NewAgentModal-Do9aVvan.js} +1 -1
  74. package/dist/client/assets/NewChatComposer-DKlNX1UA.js +19 -0
  75. package/dist/client/assets/{NewChatOrigin-CCiPg_WR.js → NewChatOrigin-DXPvX-hh.js} +1 -1
  76. package/dist/client/assets/ObserveEmbedScreen-Dghsq2on.js +2 -0
  77. package/dist/client/assets/ObserveTextFlow-DWNlmTVm.js +2 -0
  78. package/dist/client/assets/ObservedTopologyPanel-BlmGoxCE.js +2 -0
  79. package/dist/client/assets/OpenScoutAppShell-DDqQi-oe.js +87 -0
  80. package/dist/client/assets/OpsAgentsView-Bn_fGBdo.js +1 -0
  81. package/dist/client/assets/OpsScreen-DHnT-Q9R.js +1 -0
  82. package/dist/client/assets/OpsSubnav-CJRD7MjM.js +1 -0
  83. package/dist/client/assets/PlanView-B6gKo543.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +1 -0
  85. package/dist/client/assets/{ProjectAgentProfileBar-B4RqrI0Q.js → ProjectAgentProfileBar-C5QWwZCn.js} +1 -1
  86. package/dist/client/assets/ProjectAgentProfileHero-DC7Dd8VL.js +1 -0
  87. package/dist/client/assets/ProjectsInbox-DCLrDmj1.js +2 -0
  88. package/dist/client/assets/ProjectsRail-C4hiXYSb.js +1 -0
  89. package/dist/client/assets/ProjectsScreen-jruZRjgD.js +1 -0
  90. package/dist/client/assets/ProjectsThreadAside-DYmL2dCY.js +1 -0
  91. package/dist/client/assets/Provider-p-xuaAoE.js +1 -0
  92. package/dist/client/assets/RailRow-Cf9LOiEj.css +1 -0
  93. package/dist/client/assets/RailRow-bRkkXIpR.js +1 -0
  94. package/dist/client/assets/RawSessionsTable-B7WKmXrk.js +1 -0
  95. package/dist/client/assets/RealtimeVoiceScreen-BzP3BQq9.js +1 -0
  96. package/dist/client/assets/{RepoDiffEmbedScreen-Cr1SL5ht.js → RepoDiffEmbedScreen-xjzjcJ_c.js} +1 -1
  97. package/dist/client/assets/{RepoDiffPageScreen-DeC8fsh_.js → RepoDiffPageScreen-DRzIY-dk.js} +1 -1
  98. package/dist/client/assets/RepoDiffViewer-CNDp01KM.js +7 -0
  99. package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +2 -0
  100. package/dist/client/assets/{ReposScreen-BQwIShXf.js → ReposScreen-CpaLC_NU.js} +6 -6
  101. package/dist/client/assets/ScoutDeckSurface-DkpZ-0DH.js +1 -0
  102. package/dist/client/assets/{ScoutSurface-DdVzN3DA.js → ScoutSurface-BENBUt5-.js} +1 -1
  103. package/dist/client/assets/ScoutbotBroadcastChip-CGZyxS5H.js +2 -0
  104. package/dist/client/assets/{agent-autocomplete-C7xwIcwd.css → ScoutbotBroadcastChip-CxtYZWPZ.css} +1 -1
  105. package/dist/client/assets/{ScoutbotFxLab-sLjfSKtS.js → ScoutbotFxLab-Bk2ZsfPp.js} +1 -1
  106. package/dist/client/assets/ScoutbotRealtimeVoiceCall-n63LdBZs.js +1 -0
  107. package/dist/client/assets/{SecondaryNav-CCQqTT3e.js → SecondaryNav-B4IsujYh.js} +1 -1
  108. package/dist/client/assets/{SessionEmbedScreen-BrLMZJ3N.js → SessionEmbedScreen-CPfH-jqN.js} +1 -1
  109. package/dist/client/assets/{SessionObserve-pbozyqVv.js → SessionObserve-B-SkP3tu.js} +1 -1
  110. package/dist/client/assets/{SessionObserveEvidence-C54Xvbps.js → SessionObserveEvidence-CF5jnH3-.js} +1 -1
  111. package/dist/client/assets/SessionRefScreen-C-4jjmVG.js +1 -0
  112. package/dist/client/assets/SessionsScreen-HAjFvmIq.js +1 -0
  113. package/dist/client/assets/SettingsDrawer-DATxwZrn.js +3 -0
  114. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
  115. package/dist/client/assets/SettingsScreen-Bu53X7J_.js +1 -0
  116. package/dist/client/assets/{ShikiPane-CiVH-45m.js → ShikiPane-DH8yYDks.js} +1 -1
  117. package/dist/client/assets/{SlidePanel-BLrLF9dt.js → SlidePanel-RFXJpfUa.js} +1 -1
  118. package/dist/client/assets/{SpriteAvatar-vpHO-rXs.js → SpriteAvatar-CEYdCzem.js} +1 -1
  119. package/dist/client/assets/{StatusPill-a3XBw1GG.js → StatusPill-9uy70ttd.js} +1 -1
  120. package/dist/client/assets/{TailView-C3rjOV7i.js → TailView-6bIrgdxN.js} +2 -2
  121. package/dist/client/assets/Terminal-BI6km7H4.js +1 -0
  122. package/dist/client/assets/TerminalEmbedScreen-D4JOWwtm.js +1 -0
  123. package/dist/client/assets/{TextDocumentSurface-B29xZNlI.js → TextDocumentSurface-BcP9vvji.js} +1 -1
  124. package/dist/client/assets/{TmuxPeek-eVfqPB4m.js → TmuxPeek-IaWqCgyJ.js} +1 -1
  125. package/dist/client/assets/{VoicePermissionsPanel-DpInOlVq.js → VoicePermissionsPanel-C80iZxgy.js} +1 -1
  126. package/dist/client/assets/{WorkDetailScreen-DYwgGaJs.js → WorkDetailScreen-CweZ6fEd.js} +3 -3
  127. package/dist/client/assets/WorkFilesViewer-Dy_-06iI.js +1 -0
  128. package/dist/client/assets/{activity-DTqqWiyV.js → activity-DS0u0Itf.js} +1 -1
  129. package/dist/client/assets/{addon-fit-CcaylYTX.js → addon-fit-CN888B3D.js} +1 -1
  130. package/dist/client/assets/{addon-webgl-B37iuzOG.js → addon-webgl-CoAnanQS.js} +1 -1
  131. package/dist/client/assets/{agent-essentials-DbbJm3ne.js → agent-essentials-CuK4G_zS.js} +1 -1
  132. package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
  133. package/dist/client/assets/{agent-lane-card-model-CSugZCdy.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
  134. package/dist/client/assets/{agent-lane-detail-D5EIlX7_.js → agent-lane-detail-BNNm6FNu.js} +1 -1
  135. package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-C33Dwpn7.js} +1 -1
  136. package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-BDNktFBZ.css} +1 -1
  137. package/dist/client/assets/{agent-lanes-model-BKOs_32K.js → agent-lanes-model-VYQ5a68i.js} +2 -2
  138. package/dist/client/assets/{api-BHHEUSS3.js → api-BkjHJfgJ.js} +1 -1
  139. package/dist/client/assets/api-h5zurxmi.js +1 -0
  140. package/dist/client/assets/{arc.es-BRPqOKIx.js → arc.es-BET9ev6q.js} +1 -1
  141. package/dist/client/assets/arrow-down-DxxPnPwh.js +1 -0
  142. package/dist/client/assets/{arrow-left-B0CdJdAC.js → arrow-left-CXDkJuCg.js} +1 -1
  143. package/dist/client/assets/{arrow-up-right-CilNLf4t.js → arrow-up-right-Bj8RjSqW.js} +1 -1
  144. package/dist/client/assets/{bot-Ba3gcRVa.js → bot-BSGSicKC.js} +1 -1
  145. package/dist/client/assets/broker-display-pp33bLsu.js +2 -0
  146. package/dist/client/assets/{cache-BO2Bd_LV.js → cache-Dr0why2k.js} +1 -1
  147. package/dist/client/assets/{check-BdovFDz8.js → check-BfA0T8UD.js} +1 -1
  148. package/dist/client/assets/{chevron-down-Jh540uf3.js → chevron-down-BVg09D6U.js} +1 -1
  149. package/dist/client/assets/{chevron-right-CV7sEVBS.js → chevron-right-CaEwYkxE.js} +1 -1
  150. package/dist/client/assets/{chunk-HRAB3GC3-BYQZ1LOn.js → chunk-HRAB3GC3-HhKwnZCi.js} +1 -1
  151. package/dist/client/assets/chunk-JTPDIGGW-DX2eTIQ_.js +46 -0
  152. package/dist/client/assets/chunk-T65CQEWV-D-bOfuCH.js +1 -0
  153. package/dist/client/assets/chunk-YOZR3KYS-oS9dlQCI.js +2 -0
  154. package/dist/client/assets/{clock-DpfYdWcr.js → clock-C3TUL7D7.js} +1 -1
  155. package/dist/client/assets/{code-xml-CPzpZkhu.js → code-xml-Dbvjk9Kw.js} +1 -1
  156. package/dist/client/assets/collapsed-strip-Dz-of2SM.css +1 -0
  157. package/dist/client/assets/content-BQuEedeL.js +1 -0
  158. package/dist/client/assets/content-BUae-L_N.js +1 -0
  159. package/dist/client/assets/content-BfG98J1k.js +1 -0
  160. package/dist/client/assets/content-BkVTfkAC.js +1 -0
  161. package/dist/client/assets/content-BsNMos_d.js +1 -0
  162. package/dist/client/assets/content-C2TZOKSE.js +1 -0
  163. package/dist/client/assets/content-CCn98eSk.js +1 -0
  164. package/dist/client/assets/content-CJuH5cDP.js +1 -0
  165. package/dist/client/assets/content-CYnPp9yo.js +1 -0
  166. package/dist/client/assets/content-CcrUhm4P.js +1 -0
  167. package/dist/client/assets/content-CiOMtgQc.js +1 -0
  168. package/dist/client/assets/content-CxuVONeQ.js +1 -0
  169. package/dist/client/assets/content-Dmq9n1_L.js +1 -0
  170. package/dist/client/assets/content-DskHP2NI.js +1 -0
  171. package/dist/client/assets/content-DvvzL2HK.js +1 -0
  172. package/dist/client/assets/content-snCAUbwv.js +1 -0
  173. package/dist/client/assets/{conversation-icons-bHIIZ9z3.js → conversation-icons-DmC_Ak3z.js} +1 -1
  174. package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
  175. package/dist/client/assets/conversation-motion-features-DPiGTO21.js +1 -0
  176. package/dist/client/assets/{copy-DQAM0eSY.js → copy-C79v_7D-.js} +1 -1
  177. package/dist/client/assets/{createLucideIcon-Da0lq809.js → createLucideIcon-DCq_3fQn.js} +1 -1
  178. package/dist/client/assets/ctx-panel-B4s49N9e.css +1 -0
  179. package/dist/client/assets/discover-IEnbrH8_.js +2 -0
  180. package/dist/client/assets/embed-entry-XUPb-AzL.js +2 -0
  181. package/dist/client/assets/{external-link-BheHazeW.js → external-link-Dd8xaveL.js} +1 -1
  182. package/dist/client/assets/{eye-B908WSFH.js → eye-DkU59kfl.js} +1 -1
  183. package/dist/client/assets/{file-text-BGVkHS4_.js → file-text-BITQqGtF.js} +1 -1
  184. package/dist/client/assets/gestures-B5rLNRpi.js +1 -0
  185. package/dist/client/assets/home-moving-signal-Bs635mVw.js +1 -0
  186. package/dist/client/assets/home-moving-signal-CAa0V91u.css +1 -0
  187. package/dist/client/assets/home-now-card-VxlLjg1A.js +1 -0
  188. package/dist/client/assets/{home-now-card-nano-iwd10r9G.js → home-now-card-nano-C06GMiwD.js} +1 -1
  189. package/dist/client/assets/hooks-BWiLxTw1.js +2 -0
  190. package/dist/client/assets/index-9as_JTUs.css +1 -0
  191. package/dist/client/assets/index-BTj2MguM.js +1 -0
  192. package/dist/client/assets/index-BZovGpDk.js +10 -0
  193. package/dist/client/assets/index-CvF09yvf.css +1 -0
  194. package/dist/client/assets/index-DiiEQwdc.js +1 -0
  195. package/dist/client/assets/index-vbaJ8sin.js +1 -0
  196. package/dist/client/assets/inspector-panel-C96HcyK5.js +2 -0
  197. package/dist/client/assets/{keyboard-nav-feLCB3Zm.js → keyboard-nav-CHo_xmjw.js} +1 -1
  198. package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BA3g9aVd.js} +1 -1
  199. package/dist/client/assets/{lane-roster-store-BAmj273z.js → lane-roster-store-B6ybJlHJ.js} +1 -1
  200. package/dist/client/assets/left-Bk3XnxPD.css +1 -0
  201. package/dist/client/assets/left-BuJ0wJW1.js +2 -0
  202. package/dist/client/assets/left-C6Zj3cR4.js +1 -0
  203. package/dist/client/assets/left-CCoobxPS.css +1 -0
  204. package/dist/client/assets/left-COMAiMfB.js +2 -0
  205. package/dist/client/assets/left-Ce4WKYPK.js +1 -0
  206. package/dist/client/assets/left-DMJkmJOF.js +1 -0
  207. package/dist/client/assets/left-DrCbY6ja.js +1 -0
  208. package/dist/client/assets/left-agents-BuSyVNGE.js +1 -0
  209. package/dist/client/assets/left-default-DRHywOKX.js +1 -0
  210. package/dist/client/assets/left-l92tw5Kc.js +1 -0
  211. package/dist/client/assets/left-lanes-4-aUyyrV.js +1 -0
  212. package/dist/client/assets/left-mission-e849d_Td.js +1 -0
  213. package/dist/client/assets/left-plan-MchYwAB_.js +2 -0
  214. package/dist/client/assets/library-DygjpA6u.js +1 -0
  215. package/dist/client/assets/{loader-circle-Be0T8xv2.js → loader-circle-B-l2Wj3-.js} +1 -1
  216. package/dist/client/assets/{local-agents-Q6KQ12B9.js → local-agents-Wof5knTJ.js} +1 -1
  217. package/dist/client/assets/{mentions-KNASbAjG.js → mentions-BjXfeF7t.js} +1 -1
  218. package/dist/client/assets/{mesh-ops-C-i8OMiM.js → mesh-ops-C1gq8zKf.js} +1 -1
  219. package/dist/client/assets/{mesh-view-store-B0lqpw8M.js → mesh-view-store-B56D3f77.js} +1 -1
  220. package/dist/client/assets/{message-circle-2v9Udia0.js → message-circle-BwVx5X0q.js} +1 -1
  221. package/dist/client/assets/{message-markup-BP2nH9kQ.js → message-markup-DlVX-iuc.js} +1 -1
  222. package/dist/client/assets/{message-square-DURSOrUr.js → message-square-BnkG6tae.js} +1 -1
  223. package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
  224. package/dist/client/assets/{mission-control-store-HeCy97KT.js → mission-control-store-CMgIVjLJ.js} +1 -1
  225. package/dist/client/assets/model-Co0zkMIc.js +1 -0
  226. package/dist/client/assets/{observe-DkAhvkfn.js → observe-DVHAcIrv.js} +1 -1
  227. package/dist/client/assets/{operator-attention-BqoWAlhp.js → operator-attention-BwSPeheT.js} +1 -1
  228. package/dist/client/assets/{page-status-CEP5pGf3.js → page-status-Bg2hd27j.js} +1 -1
  229. package/dist/client/assets/paperclip-DblaLD_N.js +1 -0
  230. package/dist/client/assets/plan-view-D56fneVF.css +1 -0
  231. package/dist/client/assets/{plus-ZReaTFF-.js → plus-BAI0t5g9.js} +1 -1
  232. package/dist/client/assets/profile-3Q4sUtvJ.js +1 -0
  233. package/dist/client/assets/projects-inbox-Da2hYEn6.js +1 -0
  234. package/dist/client/assets/{radio-BC9TO5Pl.js → radio-BGtkyCG9.js} +1 -1
  235. package/dist/client/assets/{refresh-cw-C4E58VJK.js → refresh-cw-DtF8xPqX.js} +1 -1
  236. package/dist/client/assets/resolve-panes-D4tlKNCT.js +1 -0
  237. package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +1 -0
  238. package/dist/client/assets/right-B8qg3JdB.js +1 -0
  239. package/dist/client/assets/{right-BarpRgcv.js → right-BU_W1kSH.js} +1 -1
  240. package/dist/client/assets/right-BlR7h0US.js +1 -0
  241. package/dist/client/assets/right-BwgwTGGd.js +1 -0
  242. package/dist/client/assets/right-ByptvkVX.js +1 -0
  243. package/dist/client/assets/right-CUP-NIDG.js +1 -0
  244. package/dist/client/assets/right-Ch_jrNe2.js +1 -0
  245. package/dist/client/assets/right-Dd2DscRz.js +1 -0
  246. package/dist/client/assets/right-DmVHd8Xj.js +1 -0
  247. package/dist/client/assets/{right-CIzaNH58.js → right-c4PAdFYZ.js} +1 -1
  248. package/dist/client/assets/{rocket-BahfIwFz.js → rocket-BWh18pt_.js} +1 -1
  249. package/dist/client/assets/router-63XV_E7f.js +1 -0
  250. package/dist/client/assets/{text-B2UZi3l9.js → runtime-picker-BXKJbLot.js} +1 -1
  251. package/dist/client/assets/runtime-picker-vhm0gtLs.css +1 -0
  252. package/dist/client/assets/{scope-views-CmG2X_S0.js → scope-views-Dm2_-NPi.js} +1 -1
  253. package/dist/client/assets/scout-voice-D8Q5sZOL.js +1 -0
  254. package/dist/client/assets/{scoutbot-D4vuKzOL.js → scoutbot-BTIErYHo.js} +2 -2
  255. package/dist/client/assets/{scroll-text-uulNqrf7.js → scroll-text-DZb3mmYo.js} +1 -1
  256. package/dist/client/assets/{search-HmdKXdtR.js → search-1QMVOxF3.js} +1 -1
  257. package/dist/client/assets/secondaryNavConfig-c0cz3MkJ.js +1 -0
  258. package/dist/client/assets/{selection-bridge-n4wNTm1B.js → selection-bridge-O9C4kGfF.js} +1 -1
  259. package/dist/client/assets/{send-horizontal-DOjHkZCD.js → send-horizontal-DbyEkGql.js} +1 -1
  260. package/dist/client/assets/{server-CX-xQjJA.js → server-Bncn9S7r.js} +1 -1
  261. package/dist/client/assets/{session-catalog-b7B1Sof1.js → session-catalog-DC6BlBBC.js} +1 -1
  262. package/dist/client/assets/{session-table-Djain1Qr.js → session-table-BUPq9Viy.js} +1 -1
  263. package/dist/client/assets/{sliders-horizontal-D2O6QiDN.js → sliders-horizontal-CMe8Bay1.js} +1 -1
  264. package/dist/client/assets/{sparkles-CgTby-ap.js → sparkles-_7cTZsIH.js} +1 -1
  265. package/dist/client/assets/{sse-QSbhyq9A.js → sse-Bb0EOcU9.js} +1 -1
  266. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
  267. package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-BRcJltQa.js} +1 -1
  268. package/dist/client/assets/{tail-events-B7BrDaFi.js → tail-events-C12pfUax.js} +1 -1
  269. package/dist/client/assets/{terminal-relay-C2TUIuh1.js → terminal-relay-BgfVJXIL.js} +1 -1
  270. package/dist/client/assets/{terminal-sessions-D4dHTRkt.js → terminal-sessions-AmSgHklm.js} +1 -1
  271. package/dist/client/assets/{terminal-takeover-BArLfNtd.js → terminal-takeover--05EYhJm.js} +1 -1
  272. package/dist/client/assets/{terminal-DNZTCr6a.js → terminal-xGf_F3y7.js} +1 -1
  273. package/dist/client/assets/text-DsBWV_4k.js +1 -0
  274. package/dist/client/assets/{use-conversation-list-htp0Ui63.js → use-conversation-list-DWX02INv.js} +1 -1
  275. package/dist/client/assets/{use-fleet-active-asks-BhuTn5mV.js → use-fleet-active-asks-Cnwa4hTK.js} +1 -1
  276. package/dist/client/assets/{use-mesh-ops-items-CD-qsvNX.js → use-mesh-ops-items-BRFm37oY.js} +1 -1
  277. package/dist/client/assets/use-reduced-motion-C8cWvIZ3.js +1 -0
  278. package/dist/client/assets/use-scout-dev-flags-FkMreOOb.js +1 -0
  279. package/dist/client/assets/{useAgentHoverCard-BIrm8esH.js → useAgentHoverCard-DvPZSJK3.js} +1 -1
  280. package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +1 -0
  281. package/dist/client/assets/{usePierreRuntime-CVTMzChM.js → usePierreRuntime-C8WJ0X3F.js} +1 -1
  282. package/dist/client/assets/{wrench-DwFKomxg.js → wrench-_tHBGTop.js} +1 -1
  283. package/dist/client/assets/{x-DuzAbpk5.js → x-CrGUKNRv.js} +1 -1
  284. package/dist/client/assets/{xterm-xQGYNyB-.js → xterm-Ks-VlLTq.js} +1 -1
  285. package/dist/client/index.html +2 -2
  286. package/dist/main.mjs +38 -169
  287. package/dist/node/main.mjs +240 -272
  288. package/dist/pairing-runtime-controller.mjs +476 -394
  289. package/dist/runtime/base-daemon.mjs +121 -49
  290. package/dist/runtime/broker-daemon.mjs +60 -171
  291. package/dist/runtime/broker-process-manager.mjs +0 -6
  292. package/dist/runtime/mesh-discover.mjs +0 -6
  293. package/dist/scout-control-plane-web.mjs +477 -672
  294. package/dist/scout-web-server.mjs +477 -672
  295. package/package.json +7 -6
  296. package/dist/client/assets/ActivityScreen-DRHTQIxu.js +0 -1
  297. package/dist/client/assets/AgentAvatar-CQqJcwOQ.js +0 -1
  298. package/dist/client/assets/AgentAvatar-CUZZARWG.css +0 -1
  299. package/dist/client/assets/AgentConfigurationScreen-C3OI6JmZ.js +0 -1
  300. package/dist/client/assets/AgentDefinitionsWorkspace-D0LDEqfl.js +0 -1
  301. package/dist/client/assets/AgentFloorView-CoGh2q5f.js +0 -1
  302. package/dist/client/assets/AgentInfoScreen-5ybfIL9p.js +0 -1
  303. package/dist/client/assets/AgentLaneDetailSheet-BD8B51ka.js +0 -4
  304. package/dist/client/assets/AgentLanesEmbedScreen-FRTVASPw.js +0 -1
  305. package/dist/client/assets/AgentLanesView-Bm85ittm.js +0 -2
  306. package/dist/client/assets/AgentSessions-C_tAfGN2.js +0 -6
  307. package/dist/client/assets/AgentsConsole-DsHWsaOJ.js +0 -1
  308. package/dist/client/assets/AgentsScreen-Bod6AHlA.js +0 -1
  309. package/dist/client/assets/AgentsSubnav-CsvYzzQ-.js +0 -1
  310. package/dist/client/assets/AstronautSuit-C05Ezxl9.js +0 -1
  311. package/dist/client/assets/BackToPicker-CXsbxbHM.js +0 -1
  312. package/dist/client/assets/BriefingDetailScreen-Uvnk3t0v.js +0 -1
  313. package/dist/client/assets/BrokerScreen-LZ3T7hGG.js +0 -5
  314. package/dist/client/assets/Canvas-BO9mx5_P.js +0 -1
  315. package/dist/client/assets/ChatCollapsedStrip-CtLPTLTY.js +0 -1
  316. package/dist/client/assets/ConversationComposer-DPWu3HvK.js +0 -1
  317. package/dist/client/assets/ConversationFeedRows-MhcPfxUr.js +0 -1
  318. package/dist/client/assets/ConversationHeader-Ce7TENb9.js +0 -1
  319. package/dist/client/assets/ConversationPanels-D-b5SLO-.js +0 -6
  320. package/dist/client/assets/ConversationScreen-C5HnXd5w.css +0 -1
  321. package/dist/client/assets/ConversationScreen-D77SoLos.js +0 -1
  322. package/dist/client/assets/ConversationStatus-lIvSKRic.js +0 -1
  323. package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
  324. package/dist/client/assets/CrewWorkspaces-CdojnRMG.js +0 -1
  325. package/dist/client/assets/DocumentFocusViewer-CetjnYut.js +0 -1
  326. package/dist/client/assets/FlightObserveScreen-sqvt7HUO.js +0 -1
  327. package/dist/client/assets/HarnessesScreen-CGhRsqD5.js +0 -1
  328. package/dist/client/assets/HomeHero-7JwycwFY.css +0 -1
  329. package/dist/client/assets/HomeHero-DdxTQ-6a.js +0 -1
  330. package/dist/client/assets/HostAdvisorView-BAUi5ZxX.js +0 -1
  331. package/dist/client/assets/KnowledgeSearchScreen-CRei9pyl.js +0 -1
  332. package/dist/client/assets/LaneTraceDetailSheet-CFsCvKa3.js +0 -1
  333. package/dist/client/assets/MeshScreen-dxNxRtKm.js +0 -1
  334. package/dist/client/assets/MessagesScreen-CR5v-WIE.js +0 -1
  335. package/dist/client/assets/MissionControlView-BGj1qnI2.js +0 -1
  336. package/dist/client/assets/MissionFocusOverlay-hWi6y87j.js +0 -1
  337. package/dist/client/assets/MissionLeftAgentRow-BSRRiiig.js +0 -1
  338. package/dist/client/assets/MissionLogPane-bbG_pM9B.js +0 -1
  339. package/dist/client/assets/NewChatComposer-BPsg8shF.js +0 -19
  340. package/dist/client/assets/ObserveEmbedScreen-Be87Chod.js +0 -2
  341. package/dist/client/assets/ObserveTextFlow-CKYltTPJ.js +0 -2
  342. package/dist/client/assets/ObservedTopologyPanel-CfHYu-4Z.js +0 -2
  343. package/dist/client/assets/OpenScoutAppShell-DPeP1vtK.js +0 -88
  344. package/dist/client/assets/OpsAgentsView-dEtw9yt-.js +0 -1
  345. package/dist/client/assets/OpsScreen-QXRJY8Vf.js +0 -1
  346. package/dist/client/assets/OpsSubnav-BK9Fj3gU.js +0 -1
  347. package/dist/client/assets/ProjectAgentProfile-BjykZ2Xd.js +0 -1
  348. package/dist/client/assets/ProjectAgentProfileHero-Bc0g8rhW.js +0 -1
  349. package/dist/client/assets/ProjectsInbox--ZIqo-IE.js +0 -2
  350. package/dist/client/assets/ProjectsRail-CzS0qTCI.js +0 -1
  351. package/dist/client/assets/ProjectsScreen-0gx7f30h.js +0 -1
  352. package/dist/client/assets/ProjectsThreadAside-BsQRFbdy.js +0 -1
  353. package/dist/client/assets/Provider-Cd-QZltN.js +0 -1
  354. package/dist/client/assets/RailRow-B0sRaJc6.css +0 -1
  355. package/dist/client/assets/RailRow-BY6fxePa.js +0 -1
  356. package/dist/client/assets/RawSessionsTable-CbopOF34.js +0 -1
  357. package/dist/client/assets/RealtimeVoiceScreen-CU4uXz4C.js +0 -9
  358. package/dist/client/assets/RepoDiffViewer-CiTOWK_Z.js +0 -7
  359. package/dist/client/assets/RepoDiffViewerLazy-BU3V7Kwq.js +0 -2
  360. package/dist/client/assets/ScoutDeckSurface-BncYKicb.js +0 -1
  361. package/dist/client/assets/SessionRefScreen-UVNVrwAf.js +0 -1
  362. package/dist/client/assets/SessionsScreen-KeDb5gz4.js +0 -1
  363. package/dist/client/assets/SettingsDrawer-CWdj0VvN.js +0 -3
  364. package/dist/client/assets/SettingsDrawer-J-8x1eII.css +0 -1
  365. package/dist/client/assets/SettingsScreen-C7zJgZzj.js +0 -1
  366. package/dist/client/assets/Terminal-CMQFmHnn.js +0 -1
  367. package/dist/client/assets/TerminalEmbedScreen-GvpoGERN.js +0 -1
  368. package/dist/client/assets/TerminalRelay-CIHlLVf1.js +0 -46
  369. package/dist/client/assets/WorkFilesViewer-C7H5fXaZ.js +0 -1
  370. package/dist/client/assets/agent-autocomplete-cOPLtuhM.js +0 -2
  371. package/dist/client/assets/agent-identity-CIMT7oV6.js +0 -1
  372. package/dist/client/assets/agent-specialization-D3-sqwhU.js +0 -1
  373. package/dist/client/assets/api-DEHEgJ9m.js +0 -1
  374. package/dist/client/assets/archive-DPMdoW_D.js +0 -1
  375. package/dist/client/assets/arrow-right-YRBoTTyf.js +0 -1
  376. package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
  377. package/dist/client/assets/collapsed-strip-raJWthAH.css +0 -1
  378. package/dist/client/assets/compass-D5Io6BIV.js +0 -1
  379. package/dist/client/assets/content-3b_jmxEx.js +0 -1
  380. package/dist/client/assets/content-B-i0XY-t.js +0 -1
  381. package/dist/client/assets/content-BD-DNFmb.js +0 -1
  382. package/dist/client/assets/content-BGeo5tgd.js +0 -1
  383. package/dist/client/assets/content-BMvXPLiQ.js +0 -1
  384. package/dist/client/assets/content-BWTbfMDg.js +0 -1
  385. package/dist/client/assets/content-BwCmeUmF.js +0 -1
  386. package/dist/client/assets/content-C1K3NcZa.js +0 -1
  387. package/dist/client/assets/content-C34J5_Af.js +0 -1
  388. package/dist/client/assets/content-CGRtIS2m.js +0 -1
  389. package/dist/client/assets/content-CIJo_-JS.js +0 -1
  390. package/dist/client/assets/content-CvqIqVAV.js +0 -1
  391. package/dist/client/assets/content-DRnwm-Vu.js +0 -1
  392. package/dist/client/assets/content-Dh39SSvP.js +0 -1
  393. package/dist/client/assets/content-DoypqDj5.js +0 -1
  394. package/dist/client/assets/content-n3mvc6NQ.js +0 -1
  395. package/dist/client/assets/conversation-model-CIzM7aXT.js +0 -1
  396. package/dist/client/assets/conversation-motion-features-CrP5K-dk.js +0 -1
  397. package/dist/client/assets/cpu-CtQc0Z9D.js +0 -1
  398. package/dist/client/assets/credentials-qwds23lv.js +0 -1
  399. package/dist/client/assets/ctx-panel-D_HJ3nhb.css +0 -1
  400. package/dist/client/assets/discover-DdkMhTAV.js +0 -2
  401. package/dist/client/assets/embed-entry-DoSM1GZB.js +0 -2
  402. package/dist/client/assets/file-code-corner-C5Pc6znt.js +0 -1
  403. package/dist/client/assets/gauge-sc_gb5Zw.js +0 -1
  404. package/dist/client/assets/gestures-AzPBSf20.js +0 -1
  405. package/dist/client/assets/git-branch-CdJU49Af.js +0 -1
  406. package/dist/client/assets/home-moving-signal-CZo2bYBi.js +0 -1
  407. package/dist/client/assets/home-moving-signal-DMguaRWR.css +0 -1
  408. package/dist/client/assets/home-now-card-DgxfZHcR.js +0 -1
  409. package/dist/client/assets/hooks-CeCCO6Yg.js +0 -2
  410. package/dist/client/assets/host-advisor-B2Fqs5Dd.css +0 -1
  411. package/dist/client/assets/index-BIiI9gfa.js +0 -1
  412. package/dist/client/assets/index-CD2foMB8.js +0 -1
  413. package/dist/client/assets/index-DReHD_4U.js +0 -1
  414. package/dist/client/assets/index-DzlEgstl.css +0 -1
  415. package/dist/client/assets/index-NRbRrZw-.js +0 -10
  416. package/dist/client/assets/index-wLwc74Pu.css +0 -1
  417. package/dist/client/assets/inspector-panel-CBf8pW7s.js +0 -2
  418. package/dist/client/assets/layers-D9fblkql.js +0 -1
  419. package/dist/client/assets/layout-grid-Vd1chalc.js +0 -1
  420. package/dist/client/assets/left-41_3QKk1.js +0 -1
  421. package/dist/client/assets/left-B3ofA1Pr.js +0 -2
  422. package/dist/client/assets/left-BWBZQhxQ.js +0 -1
  423. package/dist/client/assets/left-BhA6essi.js +0 -1
  424. package/dist/client/assets/left-BmTKCv4f.js +0 -1
  425. package/dist/client/assets/left-CCGR6tIF.js +0 -2
  426. package/dist/client/assets/left-DH44V4I_.css +0 -1
  427. package/dist/client/assets/left-Dfwzkwh_.js +0 -1
  428. package/dist/client/assets/left-R2OOE7VG.css +0 -1
  429. package/dist/client/assets/left-advisor-yrzW1Kwz.js +0 -1
  430. package/dist/client/assets/left-agents-Bgahk0FF.js +0 -1
  431. package/dist/client/assets/left-default-CtkfAquc.js +0 -1
  432. package/dist/client/assets/left-lanes-CpujaVN3.js +0 -1
  433. package/dist/client/assets/left-mission-Bbd-fW6W.js +0 -1
  434. package/dist/client/assets/library-Dx14WNGd.js +0 -1
  435. package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
  436. package/dist/client/assets/persistent-state-Bm_0TmZL.js +0 -1
  437. package/dist/client/assets/profile-Y0X7HZHc.js +0 -1
  438. package/dist/client/assets/projects-inbox-Cbfj4Hx7.js +0 -1
  439. package/dist/client/assets/provider-Bq0ScH3v.js +0 -1
  440. package/dist/client/assets/proxy-DtC2iXnT.js +0 -1
  441. package/dist/client/assets/resolve-panes-BI3WdDS-.js +0 -1
  442. package/dist/client/assets/resolve-sidebar-context-_g0pIxOr.js +0 -1
  443. package/dist/client/assets/right-BA0F8fPI.js +0 -1
  444. package/dist/client/assets/right-C4GXB45w.js +0 -1
  445. package/dist/client/assets/right-CXetlD8X.js +0 -1
  446. package/dist/client/assets/right-CnRcQS_I.js +0 -1
  447. package/dist/client/assets/right-D2_rmbAH.js +0 -1
  448. package/dist/client/assets/right-Dqp--KwX.js +0 -1
  449. package/dist/client/assets/right-HJJzRuGD.js +0 -1
  450. package/dist/client/assets/right-WCMb8YXJ.js +0 -1
  451. package/dist/client/assets/router-Bx1tiwVe.js +0 -1
  452. package/dist/client/assets/scout-voice-BT3gYDhU.js +0 -1
  453. package/dist/client/assets/scoutbot-markdown-DIhLsYxz.js +0 -6
  454. package/dist/client/assets/secondaryNavConfig-BVQiyAXu.js +0 -1
  455. package/dist/client/assets/settings-BpKRzxOD.js +0 -1
  456. package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +0 -1
  457. package/dist/client/assets/text-rLpBg4_z.css +0 -1
  458. package/dist/client/assets/use-reduced-motion-0fAsybdo.js +0 -1
  459. package/dist/client/assets/use-scout-dev-flags-DV_I6URU.js +0 -1
  460. package/dist/client/assets/useContentSecondaryNav-4atpGgFw.js +0 -1
  461. package/dist/client/assets/usePersistentState-InmPXIN4.js +0 -1
  462. package/dist/client/assets/zap-CocRNtyr.js +0 -1
  463. package/dist/client/crew/brik-bust.webp +0 -0
  464. package/dist/client/crew/brik-chip-id.webp +0 -0
  465. package/dist/client/crew/lulu-bust.webp +0 -0
  466. package/dist/client/crew/milo-bust.webp +0 -0
  467. package/dist/client/crew/milo-chip-id.webp +0 -0
  468. package/dist/client/crew/nori-bust.webp +0 -0
  469. package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
  470. package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
  471. package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
  472. package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
  473. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  474. package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
  475. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  476. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  477. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  478. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  479. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  480. package/dist/client/crew/sprout-bust.webp +0 -0
  481. package/dist/client/crew/sprout-chip-id.webp +0 -0
  482. package/dist/client/crew/vex-bust.webp +0 -0
  483. package/dist/client/crew/vex-chip-id.webp +0 -0
  484. package/dist/client/crew/wrench-bust.webp +0 -0
  485. package/dist/client/crew/wrench-chip-id.webp +0 -0
  486. /package/dist/client/assets/{DocumentFocusViewer-BSC_JwVE.css → document-focus-viewer-BSC_JwVE.css} +0 -0
@@ -1 +1 @@
1
- import{j as e,r as o}from"./index-NRbRrZw-.js";import{i as x,l as h}from"./lane-edit-display-C_Aujldz.js";import{b as p}from"./lane-ask-display-B6iCAVcd.js";import{f as m,b as j}from"./lane-tool-detail-0WhMf4Vj.js";const N=new Set(["detail","output","result","diff","change"]);function f({text:c,label:t}){return e.jsx("button",{type:"button",className:"s-lane-trace-focus-copy",onClick:()=>{navigator.clipboard?.writeText(c)},title:t,"aria-label":t,children:"Copy"})}function q({event:c,wallLabel:t,wallTitle:r,variant:n="sheet"}){return c.kind==="ask"?e.jsx(v,{event:c,wallLabel:t,wallTitle:r,variant:n}):e.jsx(y,{event:c,wallLabel:t,wallTitle:r,variant:n})}function y({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>j(c,{wallLabel:t,wallTitle:r,sessionOffset:`${m(c.t)} from start`}),[c,t,r]),{primarySection:i,secondarySections:d}=o.useMemo(()=>{if(!s)return{primarySection:null,secondarySections:[]};const a=s.sections.find(u=>N.has(u.title))??s.sections[0]??null,l=a?s.sections.filter(u=>u!==a):s.sections;return{primarySection:a,secondarySections:l}},[s]);return s?e.jsxs("section",{className:`s-lane-trace-focus${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected trace event",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this step":"Selected command"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.command}),x(c.tool)&&c.arg?.trim()&&(()=>{const a=h(c.arg.trim()),l=a.split("/").pop()??a;return a===l?null:e.jsx("div",{className:"s-lane-trace-focus-path",title:c.arg.trim(),children:a})})()]}),e.jsx(f,{text:s.copyText,label:"Copy event detail"})]}),s.hoverFields.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:s.hoverFields.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:a.label}),e.jsx("dd",{title:a.value,children:a.value})]},a.label))}),i&&e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:i.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:i.content})]}),d.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:a.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:a.content})]},a.title))]}):null}function v({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>p(c),[c]),i=o.useMemo(()=>{const l=[...s.fields];return t&&l.unshift({label:"when",value:r?`${t} · ${r}`:t}),l.push({label:"offset",value:`${m(c.t)} from start`}),l},[s.fields,c.t,t,r]),d=s.preview&&s.preview!==s.fullText,a=s.requestText&&s.requestText!==s.fullText&&s.requestText!==s.preview;return e.jsxs("section",{className:`s-lane-trace-focus s-lane-trace-focus--ask${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected request",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this request":"Selected request"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.title}),d?e.jsx("div",{className:"s-lane-trace-focus-ask-preview",children:s.preview}):null]}),e.jsx(f,{text:s.copyText,label:"Copy full request"})]}),i.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:i.map(l=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:l.label}),e.jsx("dd",{title:l.value,children:l.value})]},`${l.label}:${l.value}`))}),e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"full request"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.fullText})]}),a?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"request preview"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.requestText})]}):null,s.answer?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:s.answer.label}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.answer.text})]}):null]})}export{q as LaneTraceEventFocus};
1
+ import{j as e,r as o}from"./index-BZovGpDk.js";import{i as x,l as h}from"./lane-edit-display-C_Aujldz.js";import{b as p}from"./lane-ask-display-B6iCAVcd.js";import{f as m,b as j}from"./lane-tool-detail-0WhMf4Vj.js";const N=new Set(["detail","output","result","diff","change"]);function f({text:c,label:t}){return e.jsx("button",{type:"button",className:"s-lane-trace-focus-copy",onClick:()=>{navigator.clipboard?.writeText(c)},title:t,"aria-label":t,children:"Copy"})}function q({event:c,wallLabel:t,wallTitle:r,variant:n="sheet"}){return c.kind==="ask"?e.jsx(v,{event:c,wallLabel:t,wallTitle:r,variant:n}):e.jsx(y,{event:c,wallLabel:t,wallTitle:r,variant:n})}function y({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>j(c,{wallLabel:t,wallTitle:r,sessionOffset:`${m(c.t)} from start`}),[c,t,r]),{primarySection:i,secondarySections:d}=o.useMemo(()=>{if(!s)return{primarySection:null,secondarySections:[]};const a=s.sections.find(u=>N.has(u.title))??s.sections[0]??null,l=a?s.sections.filter(u=>u!==a):s.sections;return{primarySection:a,secondarySections:l}},[s]);return s?e.jsxs("section",{className:`s-lane-trace-focus${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected trace event",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this step":"Selected command"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.command}),x(c.tool)&&c.arg?.trim()&&(()=>{const a=h(c.arg.trim()),l=a.split("/").pop()??a;return a===l?null:e.jsx("div",{className:"s-lane-trace-focus-path",title:c.arg.trim(),children:a})})()]}),e.jsx(f,{text:s.copyText,label:"Copy event detail"})]}),s.hoverFields.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:s.hoverFields.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:a.label}),e.jsx("dd",{title:a.value,children:a.value})]},a.label))}),i&&e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:i.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:i.content})]}),d.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:a.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:a.content})]},a.title))]}):null}function v({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>p(c),[c]),i=o.useMemo(()=>{const l=[...s.fields];return t&&l.unshift({label:"when",value:r?`${t} · ${r}`:t}),l.push({label:"offset",value:`${m(c.t)} from start`}),l},[s.fields,c.t,t,r]),d=s.preview&&s.preview!==s.fullText,a=s.requestText&&s.requestText!==s.fullText&&s.requestText!==s.preview;return e.jsxs("section",{className:`s-lane-trace-focus s-lane-trace-focus--ask${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected request",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this request":"Selected request"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.title}),d?e.jsx("div",{className:"s-lane-trace-focus-ask-preview",children:s.preview}):null]}),e.jsx(f,{text:s.copyText,label:"Copy full request"})]}),i.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:i.map(l=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:l.label}),e.jsx("dd",{title:l.value,children:l.value})]},`${l.label}:${l.value}`))}),e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"full request"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.fullText})]}),a?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"request preview"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.requestText})]}):null,s.answer?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:s.answer.label}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.answer.text})]}):null]})}export{q as LaneTraceEventFocus};
@@ -1,3 +1,3 @@
1
- import{r as x,j as s}from"./index-NRbRrZw-.js";import{C as me}from"./Canvas-BO9mx5_P.js";import{u as te,t as de,b as pe,c as ue}from"./mesh-view-store-B0lqpw8M.js";import{n as T,s as B}from"./colors-BtO5_zlx.js";import{t as Q}from"./time-Dhsh_2EG.js";import{u as fe}from"./Provider-Cd-QZltN.js";import{u as xe}from"./useAgentHoverCard-BIrm8esH.js";import{b as ye}from"./mesh-buckets-CfAukILK.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./api-DEHEgJ9m.js";import"./sse-QSbhyq9A.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./index-CD2foMB8.js";import"./HarnessMark-CEzmPFHC.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./AgentDetailCard-2DZQahiN.js";import"./AgentLiveActions-BmXDRxER.js";import"./terminal-takeover-BArLfNtd.js";import"./openContent-C6XO6kr5.js";import"./eye-B908WSFH.js";import"./terminal-DNZTCr6a.js";function ge(e,t){if(t.type==="pan")return{...e,pan:{x:e.pan.x+t.delta.x,y:e.pan.y+t.delta.y}};if(t.type==="zoom"){const n=Math.max(.25,Math.min(4,e.scale*t.factor)),{mx:i,my:h,cx:c,cy:f}=t,m=(i-c)/e.scale-e.pan.x,d=(h-f)/e.scale-e.pan.y;return{scale:n,pan:{x:(i-c)/n-m,y:(h-f)/n-d}}}return e}const ce="openscout.mesh.canvas.viewport.v1";function we(){const e={pan:{x:0,y:0},scale:1};if(typeof window>"u")return e;try{const t=window.sessionStorage.getItem(ce);if(!t)return e;const n=JSON.parse(t);if(n&&typeof n=="object"&&typeof n.scale=="number"&&n.pan&&typeof n.pan.x=="number"&&typeof n.pan.y=="number")return{pan:{x:n.pan.x,y:n.pan.y},scale:n.scale}}catch{}return e}function ve(e){const t=e.name&&e.name.trim()||e.handle&&e.handle.trim()||e.harness&&e.harness.trim()||"agent";return{key:t.toLowerCase(),label:t}}function be(e){const t=new Map;for(const n of e){const{key:i,label:h}=ve(n);let c=t.get(i);c||(c={key:i,label:h,instances:[]},t.set(i,c)),c.instances.push(n)}return Array.from(t.values()).map(n=>(n.instances.sort((i,h)=>i.id.localeCompare(h.id)),n)).sort((n,i)=>{const h=n.label.localeCompare(i.label);return h!==0?h:i.instances.length-n.instances.length})}function je(e){switch(e){case"compact":return{density:e,instanceW:138,instanceH:32,stepX:144,stepY:38,clusterPadX:12,clusterPadY:12,labelH:22,clusterGap:16};case"spacious":return{density:e,instanceW:260,instanceH:68,stepX:268,stepY:76,clusterPadX:14,clusterPadY:14,labelH:26,clusterGap:16};default:return{density:"comfortable",instanceW:210,instanceH:52,stepX:218,stepY:60,clusterPadX:12,clusterPadY:12,labelH:24,clusterGap:14}}}function Ne(e,t){return Math.max(1,Math.round(Math.sqrt(e*t)))}function Ce(e,t,n){if(e.length===0)return[];const i=e.map(l=>{const H=l.instances.length,b=Ne(H,Math.max(.6,Math.min(n,2))),I=Math.ceil(H/b),N=b*t.stepX-(t.stepX-t.instanceW),A=I*t.stepY-(t.stepY-t.instanceH);return{cluster:l,cols:b,width:N+t.clusterPadX*2,height:A+t.clusterPadY*2+t.labelH}}),h=i.reduce((l,H)=>l+H.width*H.height,0),c=Math.max(Math.max(...i.map(l=>l.width)),Math.sqrt(h*n)),f=t.clusterGap,m=[];let d=0,j=0,v=0;for(const l of i)d>0&&d+l.width>c&&(j+=v+f,d=0,v=0),m.push({cluster:l.cluster,x:d,y:j,width:l.width,height:l.height,cols:l.cols}),d+=l.width+f,v=Math.max(v,l.height);const p=Math.min(...m.map(l=>l.x)),u=Math.max(...m.map(l=>l.x+l.width)),M=Math.min(...m.map(l=>l.y)),C=Math.max(...m.map(l=>l.y+l.height)),r=-((p+u)/2),g=-((M+C)/2);return m.map(l=>({...l,x:l.x+r,y:l.y+g}))}function Me(e,t,n){const i=e%t,h=Math.floor(e/t);return{x:n.clusterPadX+i*n.stepX,y:n.labelH+n.clusterPadY+h*n.stepY}}function Z(e){const t=e.harness?.trim(),n=e.model?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function ee(e){const t=e.project?.trim(),n=e.branch?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function D(e){return e.cwd||e.projectRoot||"—"}function se({onClick:e}){return s.jsx("button",{type:"button",className:"mesh-sheet-open",title:"Open agent view","aria-label":"Open agent view",onClick:t=>{t.stopPropagation(),e()},children:"↗"})}function Ie({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"",m=Z(e),d=ee(e);return s.jsxs("div",{...n??{},className:`mesh-instance-spec mesh-instance-spec--${h}${c?" mesh-instance-spec--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m} — ${d}`,children:[s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-primary",children:m}),f&&s.jsx("span",{className:"mesh-instance-spec-time",children:f})]}),s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-secondary",children:d}),s.jsx(se,{onClick:t})]})]})}function He({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"—",m=`${Z(e)} · ${ee(e)}`;return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--${h}${c?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m}
1
+ import{r as x,j as s}from"./index-BZovGpDk.js";import{C as me}from"./chunk-T65CQEWV-D-bOfuCH.js";import{u as te,t as de,b as pe,c as ue}from"./mesh-view-store-B56D3f77.js";import{n as T,s as B}from"./colors-BtO5_zlx.js";import{t as Q}from"./time-Dhsh_2EG.js";import{u as fe}from"./Provider-p-xuaAoE.js";import{u as xe}from"./useAgentHoverCard-DvPZSJK3.js";import{b as ye}from"./mesh-buckets-CfAukILK.js";import"./plus-BAI0t5g9.js";import"./createLucideIcon-DCq_3fQn.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./openContent-C6XO6kr5.js";import"./eye-DkU59kfl.js";import"./terminal-xGf_F3y7.js";function ge(e,t){if(t.type==="pan")return{...e,pan:{x:e.pan.x+t.delta.x,y:e.pan.y+t.delta.y}};if(t.type==="zoom"){const n=Math.max(.25,Math.min(4,e.scale*t.factor)),{mx:i,my:h,cx:c,cy:f}=t,m=(i-c)/e.scale-e.pan.x,d=(h-f)/e.scale-e.pan.y;return{scale:n,pan:{x:(i-c)/n-m,y:(h-f)/n-d}}}return e}const ce="openscout.mesh.canvas.viewport.v1";function we(){const e={pan:{x:0,y:0},scale:1};if(typeof window>"u")return e;try{const t=window.sessionStorage.getItem(ce);if(!t)return e;const n=JSON.parse(t);if(n&&typeof n=="object"&&typeof n.scale=="number"&&n.pan&&typeof n.pan.x=="number"&&typeof n.pan.y=="number")return{pan:{x:n.pan.x,y:n.pan.y},scale:n.scale}}catch{}return e}function ve(e){const t=e.name&&e.name.trim()||e.handle&&e.handle.trim()||e.harness&&e.harness.trim()||"agent";return{key:t.toLowerCase(),label:t}}function be(e){const t=new Map;for(const n of e){const{key:i,label:h}=ve(n);let c=t.get(i);c||(c={key:i,label:h,instances:[]},t.set(i,c)),c.instances.push(n)}return Array.from(t.values()).map(n=>(n.instances.sort((i,h)=>i.id.localeCompare(h.id)),n)).sort((n,i)=>{const h=n.label.localeCompare(i.label);return h!==0?h:i.instances.length-n.instances.length})}function je(e){switch(e){case"compact":return{density:e,instanceW:138,instanceH:32,stepX:144,stepY:38,clusterPadX:12,clusterPadY:12,labelH:22,clusterGap:16};case"spacious":return{density:e,instanceW:260,instanceH:68,stepX:268,stepY:76,clusterPadX:14,clusterPadY:14,labelH:26,clusterGap:16};default:return{density:"comfortable",instanceW:210,instanceH:52,stepX:218,stepY:60,clusterPadX:12,clusterPadY:12,labelH:24,clusterGap:14}}}function Ne(e,t){return Math.max(1,Math.round(Math.sqrt(e*t)))}function Ce(e,t,n){if(e.length===0)return[];const i=e.map(l=>{const H=l.instances.length,b=Ne(H,Math.max(.6,Math.min(n,2))),I=Math.ceil(H/b),N=b*t.stepX-(t.stepX-t.instanceW),A=I*t.stepY-(t.stepY-t.instanceH);return{cluster:l,cols:b,width:N+t.clusterPadX*2,height:A+t.clusterPadY*2+t.labelH}}),h=i.reduce((l,H)=>l+H.width*H.height,0),c=Math.max(Math.max(...i.map(l=>l.width)),Math.sqrt(h*n)),f=t.clusterGap,m=[];let d=0,j=0,v=0;for(const l of i)d>0&&d+l.width>c&&(j+=v+f,d=0,v=0),m.push({cluster:l.cluster,x:d,y:j,width:l.width,height:l.height,cols:l.cols}),d+=l.width+f,v=Math.max(v,l.height);const p=Math.min(...m.map(l=>l.x)),u=Math.max(...m.map(l=>l.x+l.width)),M=Math.min(...m.map(l=>l.y)),C=Math.max(...m.map(l=>l.y+l.height)),r=-((p+u)/2),g=-((M+C)/2);return m.map(l=>({...l,x:l.x+r,y:l.y+g}))}function Me(e,t,n){const i=e%t,h=Math.floor(e/t);return{x:n.clusterPadX+i*n.stepX,y:n.labelH+n.clusterPadY+h*n.stepY}}function Z(e){const t=e.harness?.trim(),n=e.model?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function ee(e){const t=e.project?.trim(),n=e.branch?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function D(e){return e.cwd||e.projectRoot||"—"}function se({onClick:e}){return s.jsx("button",{type:"button",className:"mesh-sheet-open",title:"Open agent view","aria-label":"Open agent view",onClick:t=>{t.stopPropagation(),e()},children:"↗"})}function Ie({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"",m=Z(e),d=ee(e);return s.jsxs("div",{...n??{},className:`mesh-instance-spec mesh-instance-spec--${h}${c?" mesh-instance-spec--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m} — ${d}`,children:[s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-primary",children:m}),f&&s.jsx("span",{className:"mesh-instance-spec-time",children:f})]}),s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-secondary",children:d}),s.jsx(se,{onClick:t})]})]})}function He({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"—",m=`${Z(e)} · ${ee(e)}`;return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--${h}${c?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m}
2
2
  ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsx("span",{className:"mesh-sheet-path",children:D(e)}),s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]})]})]})}function $e({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"—",m=`${Z(e)} · ${ee(e)}`,d=e.agentClass?.trim();return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--spacious mesh-instance-sheet--${h}${c?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m}
3
- ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsx("span",{className:"mesh-sheet-line",children:s.jsx("span",{className:"mesh-sheet-path",children:D(e)})}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]}),d&&s.jsx("span",{className:"mesh-sheet-tag",children:d})]})]})}function Ee({layout:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h}){const{cluster:c,x:f,y:m,width:d,height:j,cols:v}=e,p=x.useMemo(()=>{const u={working:0,ready:0,notReady:0};for(const M of c.instances){const C=T(M.state);C==="in_turn"||C==="in_flight"?u.working+=1:C==="callable"?u.ready+=1:u.notReady+=1}return u},[c.instances]);return s.jsxs("div",{className:"mesh-cluster",style:{position:"absolute",left:f,top:m,width:d,height:j},children:[s.jsxs("div",{className:"mesh-cluster-header",style:{height:t.labelH},children:[s.jsx("span",{className:"mesh-cluster-name",children:c.label}),s.jsx("span",{className:"mesh-cluster-count",children:c.instances.length}),s.jsxs("span",{className:"mesh-cluster-states",children:[p.working>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--working",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.working]}),p.ready>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--available",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.ready]}),p.notReady>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--offline",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.notReady]})]})]}),c.instances.map((u,M)=>{const C=Me(M,v,t);return s.jsx("div",{style:{position:"absolute",left:C.x,top:C.y,width:t.instanceW,height:t.instanceH},children:t.density==="compact"?s.jsx(Ie,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):t.density==="spacious"?s.jsx($e,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):s.jsx(He,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id})},u.id)})]})}const U=34,re=22,Se=6,ne=28,ae=10,F=12,ie=380,Ae=240,J=38;function _e(e,t,n,i,h,c){const f=[],m=[],d=[];for(const r of e)i[r.machineId]?d.push(r):m.push(r);let j=0,v=ie;const p=(r,g)=>{const H=t.has(r.machineId)||!r.online,b=n.has(r.machineId);let I=0,N=0,A=0;for(const L of r.agents){const S=T(L.state);S==="in_turn"||S==="in_flight"?I+=1:S==="callable"?N+=1:A+=1}const G=r.online?I>0?"working":N>0?"available":"offline":"offline";if(H)return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:!1,ghost:!0,pinned:g,x:0,y:0,width:Ae,height:J,headerHeight:J,chromeHeight:J,layouts:[]};const Y=b?[]:be(r.agents),E=b?[]:Ce(Y,h,c),z=b?ke():0,O=b?oe+z*re+Se:0,X=U+O;let k=0,P=0;if(!b&&E.length>0){const L=Math.min(...E.map(o=>o.x)),S=Math.max(...E.map(o=>o.x+o.width)),_=Math.min(...E.map(o=>o.y)),q=Math.max(...E.map(o=>o.y+o.height));k=S-L,P=q-_;const K=-L+F,a=-_+X+ae;for(const o of E)o.x+=K,o.y+=a}const R=Math.max(ie,k+F*2),V=b?X:X+ae+P+F;return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:b,ghost:!1,pinned:g,x:0,y:0,width:R,height:V,headerHeight:U,chromeHeight:X,layouts:E}};for(const r of m){const g=p(r,!1);g.x=0,g.y=j,f.push(g),v=Math.max(v,g.width),j+=g.height+ne}const u=Math.max(0,j-ne),M=-v/2,C=-u/2;for(const r of f)r.ghost||(r.width=v),r.x=M,r.y+=C;for(const r of d){const g=p(r,!0),l=i[r.machineId];g.x=l.x,g.y=l.y,f.push(g)}return f}function Ye({section:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h,onHeaderPointerDown:c,onHeaderClick:f,onGhostActivate:m}){const d=e.reachability==="this"?"this node":e.reachability==="peer"?"peer":e.reachability==="tailnet"?"tailnet":"",j=e.online?e.agentCount===0?"idle":"standby":"unreachable";if(e.ghost)return s.jsx("div",{"data-machine-id":e.machineId,className:"mesh-machine-ghost",style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},title:`${e.machineLabel} · ${j} — click to show`,children:s.jsxs("button",{type:"button",className:"mesh-machine-ghost-body",onPointerDown:p=>c(p,e),onClick:()=>m(e.machineId),children:[s.jsx("span",{className:"mesh-machine-ghost-led","aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-ghost-name",children:e.machineLabel}),s.jsx("span",{className:"mesh-machine-ghost-stamp",children:j}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability} mesh-machine-chip--ghost`,children:d}),s.jsxs("span",{className:"mesh-machine-ghost-counts",children:[s.jsx("span",{className:"mesh-machine-count",children:e.agentCount}),e.workingCount>0&&s.jsxs("span",{className:"mesh-machine-count mesh-machine-count--working",children:[e.workingCount,"W"]})]})]})});const v=e.collapsed?Oe(e):[];return s.jsxs("div",{"data-machine-id":e.machineId,className:`mesh-machine-section${e.collapsed?" mesh-machine-section--collapsed":""}${e.pinned?" mesh-machine-section--pinned":""}`,style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},children:[s.jsxs("button",{type:"button",className:"mesh-machine-header",style:{height:e.headerHeight},onPointerDown:p=>c(p,e),onClick:()=>f(e.machineId),"aria-expanded":!e.collapsed,children:[s.jsx("span",{className:`mesh-machine-led mesh-machine-led--${e.dominantState}`,style:{color:B(e.dominantState)},"aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-caret","aria-hidden":!0,children:e.collapsed?"▸":"▾"}),s.jsx("span",{className:"mesh-machine-grip","aria-hidden":!0,children:"⠿"}),s.jsx("span",{className:"mesh-machine-name",children:e.machineLabel}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability}`,children:d})]}),e.collapsed&&s.jsxs("div",{className:"mesh-machine-spec",children:[s.jsxs("div",{className:"mesh-machine-state-strip",style:{height:oe},children:[s.jsxs("div",{className:"mesh-machine-state-cell mesh-machine-state-cell--working",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.workingCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"working"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.availableCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.agentCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"total"})]})]}),v.map(p=>s.jsxs("div",{className:"mesh-machine-spec-row",style:{height:re},children:[s.jsx("span",{className:"mesh-machine-spec-label",children:p.label}),s.jsx("span",{className:"mesh-machine-spec-value",title:p.value,children:p.value})]},p.label))]}),!e.collapsed&&e.layouts.map(p=>s.jsx(Ee,{layout:p,metrics:t,onAgentOpen:n,bindFor:i,activeId:h},p.cluster.key))]})}function Oe(e){const t=e.host;return[{label:"os",value:t?.os??"—"},{label:"arch",value:t?.arch??"—"},{label:"cpu",value:t?.cpuCores?`${t.cpuCores}c`:"—"},{label:"ram",value:t?.memoryGb?`${t.memoryGb} G`:"—"},{label:"disk",value:t?.storageCapacityGb?`${t.storageCapacityGb} G`:"—"},{label:"network",value:t?.network??"—"},{label:"scout",value:t?.scoutVersion?`v${t.scoutVersion}`:"—"}]}const Xe=7,oe=54;function ke(e,t,n,i){return Xe}function Es({mesh:e,agents:t=[]}){const n=x.useRef(null),[i,h]=x.useState({w:0,h:0}),[c,f]=x.useReducer(ge,void 0,we);x.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(ce,JSON.stringify({pan:c.pan,scale:c.scale}))}catch{}},[c.pan,c.scale]);const{density:m,query:d,agentStateFilters:j,hiddenMachineIds:v,collapsedMachineIds:p,scrollTargetMachineId:u}=te(),{navigate:M}=fe();x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=()=>h({w:a.clientWidth,h:a.clientHeight});o();const w=new ResizeObserver(o);return w.observe(a),()=>w.disconnect()},[]),x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=w=>{w.preventDefault();const y=w.deltaY<0?1.12:1/1.12,$=a.getBoundingClientRect();f({type:"zoom",factor:y,mx:w.clientX-$.left,my:w.clientY-$.top,cx:$.width/2,cy:$.height/2})};return a.addEventListener("wheel",o,{passive:!1}),()=>a.removeEventListener("wheel",o)},[]);const{machinePositions:C}=te(),r=x.useMemo(()=>je(m),[m]),g=x.useMemo(()=>{const a=d.trim().toLowerCase();return t.filter(o=>{const y=T(o.state);return j.has(y)?a?`${o.name??""} ${o.handle??""} ${o.harness??""} ${o.project??""} ${o.branch??""}`.toLowerCase().includes(a):!0:!1})},[t,d,j]),l=x.useMemo(()=>ye(g,e),[g,e]),H=i.w>0&&i.h>0?i.w/i.h:1.6,b=x.useMemo(()=>_e(l,v,p,C,r,H),[l,v,p,C,r,H]),I=x.useRef(null),[N,A]=x.useState(null),G=x.useCallback((a,o)=>{if(a.button!==0)return;a.stopPropagation(),a.currentTarget.setPointerCapture(a.pointerId),I.current={machineId:o.machineId,startClientX:a.clientX,startClientY:a.clientY,startSectionX:o.x,startSectionY:o.y,pointerId:a.pointerId,moved:!1}},[]);x.useEffect(()=>{const a=w=>{const y=I.current;if(!y||w.pointerId!==y.pointerId)return;const $=w.clientX-y.startClientX,W=w.clientY-y.startClientY;if(!y.moved&&Math.hypot($,W)<4)return;y.moved=!0;const le=$/c.scale,he=W/c.scale;A({machineId:y.machineId,x:y.startSectionX+le,y:y.startSectionY+he})},o=w=>{const y=I.current;if(!(!y||w.pointerId!==y.pointerId)){if(I.current=null,y.moved){const $=(w.clientX-y.startClientX)/c.scale,W=(w.clientY-y.startClientY)/c.scale;ue(y.machineId,{x:y.startSectionX+$,y:y.startSectionY+W})}A(null)}};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o),()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)}},[c.scale]);const Y=x.useRef(!1);x.useEffect(()=>{if(N)Y.current=!0;else{const a=setTimeout(()=>{Y.current=!1},50);return()=>clearTimeout(a)}},[N]);const E=x.useCallback(a=>{Y.current||de(a)},[]),z=x.useCallback(a=>{Y.current||pe(a)},[]),O=x.useMemo(()=>N?b.map(a=>a.machineId===N.machineId?{...a,x:N.x,y:N.y,pinned:!0}:a):b,[b,N]);x.useEffect(()=>{if(!u)return;const a=O.find(o=>o.machineId===u);a&&f({type:"pan",delta:{x:-a.x-c.pan.x-a.width/2,y:-a.y-c.pan.y+i.h/4-U}})},[u,O,c.pan.x,c.pan.y,i.h]);const X=x.useCallback(a=>{a.agentClass!=="organic"&&M({view:"agents-v2",agentId:a.id})},[M]),k=x.useMemo(()=>g.filter(a=>a.agentClass!=="organic"),[g]),P=x.useMemo(()=>k.map(a=>a.id),[k]),R=xe({agents:k,orderedIds:P,navigate:M,selectMode:"preview"}),V=x.useCallback(a=>P.includes(a)?R.bind(a):null,[R,P]),L=R.activeAgent?.id??null,{pan:S,scale:_}=c,q=i.w/2,K=i.h/2;return s.jsxs("div",{ref:n,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[i.w>0&&s.jsx(me,{panOffset:S,scale:_,onPan:a=>f({type:"pan",delta:a}),gridOpacity:.7}),s.jsx("div",{style:{position:"absolute",left:0,top:0,width:0,height:0,transform:`translate(${q}px, ${K}px) translate(${S.x*_}px, ${S.y*_}px) scale(${_})`,transformOrigin:"0 0",pointerEvents:"none"},children:O.length===0?s.jsx("div",{style:{position:"absolute",left:-120,top:-20,width:240,textAlign:"center",pointerEvents:"none"},children:s.jsx("div",{className:"mesh-empty-pill",children:"no machines visible"})}):O.map(a=>s.jsx(Ye,{section:a,metrics:r,onAgentOpen:X,bindFor:V,activeId:L,onHeaderPointerDown:G,onHeaderClick:z,onGhostActivate:E},a.machineId))}),s.jsx("div",{className:"mesh-canvas-hint",children:"scroll to zoom · drag to pan"}),R.card]})}export{Es as MeshCanvas};
3
+ ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsx("span",{className:"mesh-sheet-line",children:s.jsx("span",{className:"mesh-sheet-path",children:D(e)})}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]}),d&&s.jsx("span",{className:"mesh-sheet-tag",children:d})]})]})}function Ee({layout:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h}){const{cluster:c,x:f,y:m,width:d,height:j,cols:v}=e,p=x.useMemo(()=>{const u={working:0,ready:0,notReady:0};for(const M of c.instances){const C=T(M.state);C==="in_turn"||C==="in_flight"?u.working+=1:C==="callable"?u.ready+=1:u.notReady+=1}return u},[c.instances]);return s.jsxs("div",{className:"mesh-cluster",style:{position:"absolute",left:f,top:m,width:d,height:j},children:[s.jsxs("div",{className:"mesh-cluster-header",style:{height:t.labelH},children:[s.jsx("span",{className:"mesh-cluster-name",children:c.label}),s.jsx("span",{className:"mesh-cluster-count",children:c.instances.length}),s.jsxs("span",{className:"mesh-cluster-states",children:[p.working>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--working",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.working]}),p.ready>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--available",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.ready]}),p.notReady>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--offline",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.notReady]})]})]}),c.instances.map((u,M)=>{const C=Me(M,v,t);return s.jsx("div",{style:{position:"absolute",left:C.x,top:C.y,width:t.instanceW,height:t.instanceH},children:t.density==="compact"?s.jsx(Ie,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):t.density==="spacious"?s.jsx($e,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):s.jsx(He,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id})},u.id)})]})}const U=34,re=22,Se=6,ne=28,ae=10,F=12,ie=380,Ae=240,J=38;function _e(e,t,n,i,h,c){const f=[],m=[],d=[];for(const r of e)i[r.machineId]?d.push(r):m.push(r);let j=0,v=ie;const p=(r,g)=>{const H=t.has(r.machineId)||!r.online,b=n.has(r.machineId);let I=0,N=0,A=0;for(const L of r.agents){const S=T(L.state);S==="in_turn"||S==="in_flight"?I+=1:S==="callable"?N+=1:A+=1}const G=r.online?I>0?"working":N>0?"available":"offline":"offline";if(H)return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:!1,ghost:!0,pinned:g,x:0,y:0,width:Ae,height:J,headerHeight:J,chromeHeight:J,layouts:[]};const Y=b?[]:be(r.agents),E=b?[]:Ce(Y,h,c),z=b?ke():0,O=b?oe+z*re+Se:0,X=U+O;let k=0,P=0;if(!b&&E.length>0){const L=Math.min(...E.map(o=>o.x)),S=Math.max(...E.map(o=>o.x+o.width)),_=Math.min(...E.map(o=>o.y)),q=Math.max(...E.map(o=>o.y+o.height));k=S-L,P=q-_;const K=-L+F,a=-_+X+ae;for(const o of E)o.x+=K,o.y+=a}const R=Math.max(ie,k+F*2),V=b?X:X+ae+P+F;return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:b,ghost:!1,pinned:g,x:0,y:0,width:R,height:V,headerHeight:U,chromeHeight:X,layouts:E}};for(const r of m){const g=p(r,!1);g.x=0,g.y=j,f.push(g),v=Math.max(v,g.width),j+=g.height+ne}const u=Math.max(0,j-ne),M=-v/2,C=-u/2;for(const r of f)r.ghost||(r.width=v),r.x=M,r.y+=C;for(const r of d){const g=p(r,!0),l=i[r.machineId];g.x=l.x,g.y=l.y,f.push(g)}return f}function Ye({section:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h,onHeaderPointerDown:c,onHeaderClick:f,onGhostActivate:m}){const d=e.reachability==="this"?"this node":e.reachability==="peer"?"peer":e.reachability==="tailnet"?"tailnet":"",j=e.online?e.agentCount===0?"idle":"standby":"unreachable";if(e.ghost)return s.jsx("div",{"data-machine-id":e.machineId,className:"mesh-machine-ghost",style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},title:`${e.machineLabel} · ${j} — click to show`,children:s.jsxs("button",{type:"button",className:"mesh-machine-ghost-body",onPointerDown:p=>c(p,e),onClick:()=>m(e.machineId),children:[s.jsx("span",{className:"mesh-machine-ghost-led","aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-ghost-name",children:e.machineLabel}),s.jsx("span",{className:"mesh-machine-ghost-stamp",children:j}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability} mesh-machine-chip--ghost`,children:d}),s.jsxs("span",{className:"mesh-machine-ghost-counts",children:[s.jsx("span",{className:"mesh-machine-count",children:e.agentCount}),e.workingCount>0&&s.jsxs("span",{className:"mesh-machine-count mesh-machine-count--working",children:[e.workingCount,"W"]})]})]})});const v=e.collapsed?Oe(e):[];return s.jsxs("div",{"data-machine-id":e.machineId,className:`mesh-machine-section${e.collapsed?" mesh-machine-section--collapsed":""}${e.pinned?" mesh-machine-section--pinned":""}`,style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},children:[s.jsxs("button",{type:"button",className:"mesh-machine-header",style:{height:e.headerHeight},onPointerDown:p=>c(p,e),onClick:()=>f(e.machineId),"aria-expanded":!e.collapsed,children:[s.jsx("span",{className:`mesh-machine-led mesh-machine-led--${e.dominantState}`,style:{color:B(e.dominantState)},"aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-caret","aria-hidden":!0,children:e.collapsed?"▸":"▾"}),s.jsx("span",{className:"mesh-machine-grip","aria-hidden":!0,children:"⠿"}),s.jsx("span",{className:"mesh-machine-name",children:e.machineLabel}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability}`,children:d})]}),e.collapsed&&s.jsxs("div",{className:"mesh-machine-spec",children:[s.jsxs("div",{className:"mesh-machine-state-strip",style:{height:oe},children:[s.jsxs("div",{className:"mesh-machine-state-cell mesh-machine-state-cell--working",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.workingCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"working"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.availableCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.agentCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"total"})]})]}),v.map(p=>s.jsxs("div",{className:"mesh-machine-spec-row",style:{height:re},children:[s.jsx("span",{className:"mesh-machine-spec-label",children:p.label}),s.jsx("span",{className:"mesh-machine-spec-value",title:p.value,children:p.value})]},p.label))]}),!e.collapsed&&e.layouts.map(p=>s.jsx(Ee,{layout:p,metrics:t,onAgentOpen:n,bindFor:i,activeId:h},p.cluster.key))]})}function Oe(e){const t=e.host;return[{label:"os",value:t?.os??"—"},{label:"arch",value:t?.arch??"—"},{label:"cpu",value:t?.cpuCores?`${t.cpuCores}c`:"—"},{label:"ram",value:t?.memoryGb?`${t.memoryGb} G`:"—"},{label:"disk",value:t?.storageCapacityGb?`${t.storageCapacityGb} G`:"—"},{label:"network",value:t?.network??"—"},{label:"scout",value:t?.scoutVersion?`v${t.scoutVersion}`:"—"}]}const Xe=7,oe=54;function ke(e,t,n,i){return Xe}function Ys({mesh:e,agents:t=[]}){const n=x.useRef(null),[i,h]=x.useState({w:0,h:0}),[c,f]=x.useReducer(ge,void 0,we);x.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(ce,JSON.stringify({pan:c.pan,scale:c.scale}))}catch{}},[c.pan,c.scale]);const{density:m,query:d,agentStateFilters:j,hiddenMachineIds:v,collapsedMachineIds:p,scrollTargetMachineId:u}=te(),{navigate:M}=fe();x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=()=>h({w:a.clientWidth,h:a.clientHeight});o();const w=new ResizeObserver(o);return w.observe(a),()=>w.disconnect()},[]),x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=w=>{w.preventDefault();const y=w.deltaY<0?1.12:1/1.12,$=a.getBoundingClientRect();f({type:"zoom",factor:y,mx:w.clientX-$.left,my:w.clientY-$.top,cx:$.width/2,cy:$.height/2})};return a.addEventListener("wheel",o,{passive:!1}),()=>a.removeEventListener("wheel",o)},[]);const{machinePositions:C}=te(),r=x.useMemo(()=>je(m),[m]),g=x.useMemo(()=>{const a=d.trim().toLowerCase();return t.filter(o=>{const y=T(o.state);return j.has(y)?a?`${o.name??""} ${o.handle??""} ${o.harness??""} ${o.project??""} ${o.branch??""}`.toLowerCase().includes(a):!0:!1})},[t,d,j]),l=x.useMemo(()=>ye(g,e),[g,e]),H=i.w>0&&i.h>0?i.w/i.h:1.6,b=x.useMemo(()=>_e(l,v,p,C,r,H),[l,v,p,C,r,H]),I=x.useRef(null),[N,A]=x.useState(null),G=x.useCallback((a,o)=>{if(a.button!==0)return;a.stopPropagation(),a.currentTarget.setPointerCapture(a.pointerId),I.current={machineId:o.machineId,startClientX:a.clientX,startClientY:a.clientY,startSectionX:o.x,startSectionY:o.y,pointerId:a.pointerId,moved:!1}},[]);x.useEffect(()=>{const a=w=>{const y=I.current;if(!y||w.pointerId!==y.pointerId)return;const $=w.clientX-y.startClientX,W=w.clientY-y.startClientY;if(!y.moved&&Math.hypot($,W)<4)return;y.moved=!0;const le=$/c.scale,he=W/c.scale;A({machineId:y.machineId,x:y.startSectionX+le,y:y.startSectionY+he})},o=w=>{const y=I.current;if(!(!y||w.pointerId!==y.pointerId)){if(I.current=null,y.moved){const $=(w.clientX-y.startClientX)/c.scale,W=(w.clientY-y.startClientY)/c.scale;ue(y.machineId,{x:y.startSectionX+$,y:y.startSectionY+W})}A(null)}};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o),()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)}},[c.scale]);const Y=x.useRef(!1);x.useEffect(()=>{if(N)Y.current=!0;else{const a=setTimeout(()=>{Y.current=!1},50);return()=>clearTimeout(a)}},[N]);const E=x.useCallback(a=>{Y.current||de(a)},[]),z=x.useCallback(a=>{Y.current||pe(a)},[]),O=x.useMemo(()=>N?b.map(a=>a.machineId===N.machineId?{...a,x:N.x,y:N.y,pinned:!0}:a):b,[b,N]);x.useEffect(()=>{if(!u)return;const a=O.find(o=>o.machineId===u);a&&f({type:"pan",delta:{x:-a.x-c.pan.x-a.width/2,y:-a.y-c.pan.y+i.h/4-U}})},[u,O,c.pan.x,c.pan.y,i.h]);const X=x.useCallback(a=>{a.agentClass!=="organic"&&M({view:"agents-v2",agentId:a.id})},[M]),k=x.useMemo(()=>g.filter(a=>a.agentClass!=="organic"),[g]),P=x.useMemo(()=>k.map(a=>a.id),[k]),R=xe({agents:k,orderedIds:P,navigate:M,selectMode:"preview"}),V=x.useCallback(a=>P.includes(a)?R.bind(a):null,[R,P]),L=R.activeAgent?.id??null,{pan:S,scale:_}=c,q=i.w/2,K=i.h/2;return s.jsxs("div",{ref:n,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[i.w>0&&s.jsx(me,{panOffset:S,scale:_,onPan:a=>f({type:"pan",delta:a}),gridOpacity:.7}),s.jsx("div",{style:{position:"absolute",left:0,top:0,width:0,height:0,transform:`translate(${q}px, ${K}px) translate(${S.x*_}px, ${S.y*_}px) scale(${_})`,transformOrigin:"0 0",pointerEvents:"none"},children:O.length===0?s.jsx("div",{style:{position:"absolute",left:-120,top:-20,width:240,textAlign:"center",pointerEvents:"none"},children:s.jsx("div",{className:"mesh-empty-pill",children:"no machines visible"})}):O.map(a=>s.jsx(Ye,{section:a,metrics:r,onAgentOpen:X,bindFor:V,activeId:L,onHeaderPointerDown:G,onHeaderClick:z,onGhostActivate:E},a.machineId))}),s.jsx("div",{className:"mesh-canvas-hint",children:"scroll to zoom · drag to pan"}),R.card]})}export{Ys as MeshCanvas};
@@ -1 +1 @@
1
- import{r as x,j as e}from"./index-NRbRrZw-.js";import{u as v,d as $,t as C,a as M,r as b}from"./mesh-view-store-B0lqpw8M.js";import{u as w}from"./Provider-Cd-QZltN.js";import{b as I}from"./mesh-buckets-CfAukILK.js";import{a as j,f as S,s as f}from"./colors-BtO5_zlx.js";function T(){const[i,o]=x.useState("rack"),{agents:r}=w(),{meshSnapshot:l,selectedId:s,selectedType:a,hiddenMachineIds:m,machinePositions:n}=v(),t=x.useMemo(()=>l?I(r,l):[],[r,l]);if(!l||t.length===0)return null;const h=t.filter(d=>!m.has(d.machineId)).length,p=t.length,g=Object.keys(n).length,c=d=>{M(d,"node"),b(d)};return e.jsxs("div",{className:"mesh-rail",children:[e.jsxs("div",{className:"mesh-rail-head",children:[e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0}),e.jsxs("div",{className:"mesh-rail-mode",role:"group","aria-label":"Bottom view",children:[e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="map"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("map"),"aria-pressed":i==="map",children:"map"}),e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="rack"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("rack"),"aria-pressed":i==="rack",children:"rack"})]}),e.jsx("span",{className:"mesh-rail-title-count",children:p}),e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0})]}),i==="rack"?e.jsx(k,{buckets:t,hiddenMachineIds:m,selectedId:s,selectedType:a,onFocus:c}):e.jsx(B,{buckets:t,selectedId:s,selectedType:a,onFocus:c}),e.jsxs("div",{className:"mesh-rail-foot",children:[e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0}),e.jsx("span",{className:"mesh-rail-foot-meta",children:i==="map"?`${p} machines`:`${h}/${p} shown`}),g>0&&i==="rack"?e.jsx("button",{type:"button",className:"mesh-rail-foot-reset",onClick:()=>$(),title:"Reset machine layout",children:"reset"}):e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0})]})]})}function k({buckets:i,hiddenMachineIds:o,selectedId:r,selectedType:l,onFocus:s}){return e.jsx("div",{className:"mesh-rail-body",children:i.map((a,m)=>{const n=o.has(a.machineId),t=r===a.machineId&&l==="node",h=a.agents.filter(u=>j(u.state)).length,p=a.agents.filter(u=>S(u.state)).length,g=a.online?a.agents.length===0?"offline":h>0?"working":"available":"offline",c=n||!a.online?void 0:f(g),d=a.reachability==="this"?"L":a.reachability==="peer"?"P":a.reachability==="tailnet"?"T":"·",N=String(m+1).padStart(2,"0"),y=a.online?a.agents.length===0?"idle":`${h}w · ${p}r`:"unreachable";return e.jsxs("div",{className:["mesh-rail-unit",n&&"mesh-rail-unit--off",!a.online&&"mesh-rail-unit--unreachable",t&&"mesh-rail-unit--active"].filter(Boolean).join(" "),children:[e.jsxs("button",{type:"button",className:"mesh-rail-unit-body",onClick:()=>s(a.machineId),title:`Focus ${a.machineLabel} on the map`,children:[e.jsx("span",{className:"mesh-rail-slot",children:N}),e.jsx("span",{className:`mesh-rail-led${n||!a.online?"":" mesh-rail-led--on"}`,style:c?{background:c,color:c}:void 0,"aria-hidden":!0}),e.jsxs("span",{className:"mesh-rail-unit-text",children:[e.jsx("span",{className:"mesh-rail-unit-name",title:a.machineLabel,children:a.machineLabel}),e.jsxs("span",{className:"mesh-rail-unit-sub",children:[e.jsx("span",{className:`mesh-rail-reach mesh-rail-reach--${a.reachability}`,children:d}),e.jsx("span",{className:"mesh-rail-unit-stamp",children:y})]})]}),e.jsx("span",{className:"mesh-rail-unit-count",children:a.agents.length})]}),e.jsx("div",{className:"mesh-rail-unit-actions",children:e.jsx("button",{type:"button",className:`mesh-rail-unit-eye${n?" mesh-rail-unit-eye--off":""}`,onClick:u=>{u.stopPropagation(),C(a.machineId)},title:n?"Show in workspace":"Hide from workspace","aria-pressed":!n,children:n?"○":"●"})}),e.jsx("span",{className:"mesh-rail-vent","aria-hidden":!0})]},a.machineId)})})}function B({buckets:i,selectedId:o,selectedType:r,onFocus:l}){return e.jsx("div",{className:"mesh-rail-body mesh-rail-body--map",children:e.jsx("div",{className:"mesh-mini-map",children:i.map(s=>{const a=o===s.machineId&&r==="node",m=s.agents.filter(h=>j(h.state)).length,n=s.online?s.agents.length===0?"offline":m>0?"working":"available":"offline",t=s.online?f(n):void 0;return e.jsxs("button",{type:"button",className:`mesh-mini-node mesh-mini-node--${n}${a?" mesh-mini-node--active":""}${s.online?"":" mesh-mini-node--off"}`,onClick:()=>l(s.machineId),title:`${s.machineLabel} — ${s.agents.length} agents`,children:[e.jsx("span",{className:"mesh-mini-led",style:t?{background:t}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"mesh-mini-label",children:s.machineLabel}),s.agents.length>0&&e.jsx("span",{className:"mesh-mini-count",children:s.agents.length})]},s.machineId)})})})}export{T as M};
1
+ import{r as x,j as e}from"./index-BZovGpDk.js";import{u as v,d as $,t as C,a as M,r as b}from"./mesh-view-store-B56D3f77.js";import{u as w}from"./Provider-p-xuaAoE.js";import{b as I}from"./mesh-buckets-CfAukILK.js";import{a as j,f as S,s as f}from"./colors-BtO5_zlx.js";function T(){const[i,o]=x.useState("rack"),{agents:r}=w(),{meshSnapshot:l,selectedId:s,selectedType:a,hiddenMachineIds:m,machinePositions:n}=v(),t=x.useMemo(()=>l?I(r,l):[],[r,l]);if(!l||t.length===0)return null;const h=t.filter(d=>!m.has(d.machineId)).length,p=t.length,g=Object.keys(n).length,c=d=>{M(d,"node"),b(d)};return e.jsxs("div",{className:"mesh-rail",children:[e.jsxs("div",{className:"mesh-rail-head",children:[e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0}),e.jsxs("div",{className:"mesh-rail-mode",role:"group","aria-label":"Bottom view",children:[e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="map"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("map"),"aria-pressed":i==="map",children:"map"}),e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="rack"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("rack"),"aria-pressed":i==="rack",children:"rack"})]}),e.jsx("span",{className:"mesh-rail-title-count",children:p}),e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0})]}),i==="rack"?e.jsx(k,{buckets:t,hiddenMachineIds:m,selectedId:s,selectedType:a,onFocus:c}):e.jsx(B,{buckets:t,selectedId:s,selectedType:a,onFocus:c}),e.jsxs("div",{className:"mesh-rail-foot",children:[e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0}),e.jsx("span",{className:"mesh-rail-foot-meta",children:i==="map"?`${p} machines`:`${h}/${p} shown`}),g>0&&i==="rack"?e.jsx("button",{type:"button",className:"mesh-rail-foot-reset",onClick:()=>$(),title:"Reset machine layout",children:"reset"}):e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0})]})]})}function k({buckets:i,hiddenMachineIds:o,selectedId:r,selectedType:l,onFocus:s}){return e.jsx("div",{className:"mesh-rail-body",children:i.map((a,m)=>{const n=o.has(a.machineId),t=r===a.machineId&&l==="node",h=a.agents.filter(u=>j(u.state)).length,p=a.agents.filter(u=>S(u.state)).length,g=a.online?a.agents.length===0?"offline":h>0?"working":"available":"offline",c=n||!a.online?void 0:f(g),d=a.reachability==="this"?"L":a.reachability==="peer"?"P":a.reachability==="tailnet"?"T":"·",N=String(m+1).padStart(2,"0"),y=a.online?a.agents.length===0?"idle":`${h}w · ${p}r`:"unreachable";return e.jsxs("div",{className:["mesh-rail-unit",n&&"mesh-rail-unit--off",!a.online&&"mesh-rail-unit--unreachable",t&&"mesh-rail-unit--active"].filter(Boolean).join(" "),children:[e.jsxs("button",{type:"button",className:"mesh-rail-unit-body",onClick:()=>s(a.machineId),title:`Focus ${a.machineLabel} on the map`,children:[e.jsx("span",{className:"mesh-rail-slot",children:N}),e.jsx("span",{className:`mesh-rail-led${n||!a.online?"":" mesh-rail-led--on"}`,style:c?{background:c,color:c}:void 0,"aria-hidden":!0}),e.jsxs("span",{className:"mesh-rail-unit-text",children:[e.jsx("span",{className:"mesh-rail-unit-name",title:a.machineLabel,children:a.machineLabel}),e.jsxs("span",{className:"mesh-rail-unit-sub",children:[e.jsx("span",{className:`mesh-rail-reach mesh-rail-reach--${a.reachability}`,children:d}),e.jsx("span",{className:"mesh-rail-unit-stamp",children:y})]})]}),e.jsx("span",{className:"mesh-rail-unit-count",children:a.agents.length})]}),e.jsx("div",{className:"mesh-rail-unit-actions",children:e.jsx("button",{type:"button",className:`mesh-rail-unit-eye${n?" mesh-rail-unit-eye--off":""}`,onClick:u=>{u.stopPropagation(),C(a.machineId)},title:n?"Show in workspace":"Hide from workspace","aria-pressed":!n,children:n?"○":"●"})}),e.jsx("span",{className:"mesh-rail-vent","aria-hidden":!0})]},a.machineId)})})}function B({buckets:i,selectedId:o,selectedType:r,onFocus:l}){return e.jsx("div",{className:"mesh-rail-body mesh-rail-body--map",children:e.jsx("div",{className:"mesh-mini-map",children:i.map(s=>{const a=o===s.machineId&&r==="node",m=s.agents.filter(h=>j(h.state)).length,n=s.online?s.agents.length===0?"offline":m>0?"working":"available":"offline",t=s.online?f(n):void 0;return e.jsxs("button",{type:"button",className:`mesh-mini-node mesh-mini-node--${n}${a?" mesh-mini-node--active":""}${s.online?"":" mesh-mini-node--off"}`,onClick:()=>l(s.machineId),title:`${s.machineLabel} — ${s.agents.length} agents`,children:[e.jsx("span",{className:"mesh-mini-led",style:t?{background:t}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"mesh-mini-label",children:s.machineLabel}),s.agents.length>0&&e.jsx("span",{className:"mesh-mini-count",children:s.agents.length})]},s.machineId)})})})}export{T as M};
@@ -0,0 +1 @@
1
+ import{r as d,j as e}from"./index-BZovGpDk.js";import{a as B}from"./api-h5zurxmi.js";import{t as A}from"./time-Dhsh_2EG.js";import{n as _,b as D,s as z,c as F}from"./colors-BtO5_zlx.js";import{u as O,e as H}from"./Provider-p-xuaAoE.js";import{b as K}from"./router-63XV_E7f.js";import{MeshCanvas as U}from"./MeshCanvas-DwkjsiJ5.js";import{u as V}from"./useAgentHoverCard-DvPZSJK3.js";import{u as Q}from"./local-agents-Wof5knTJ.js";import{u as J,a as W,s as X,e as E,f as I,g as Y,h as L}from"./mesh-view-store-B56D3f77.js";import{u as Z}from"./useContentSecondaryNav-CNlrhvvx.js";import{OpsSubnav as G}from"./OpsSubnav-CJRD7MjM.js";/* empty css *//* empty css */import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./chunk-T65CQEWV-D-bOfuCH.js";import"./plus-BAI0t5g9.js";import"./mesh-buckets-CfAukILK.js";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./openContent-C6XO6kr5.js";import"./eye-DkU59kfl.js";import"./terminal-xGf_F3y7.js";import"./SecondaryNav-B4IsujYh.js";import"./secondaryNavConfig-c0cz3MkJ.js";import"./message-square-BnkG6tae.js";import"./scroll-text-DZb3mmYo.js";/* empty css */function ee(c){const p=new Map,x=new Map;for(const a of c){const o=a.project??"Unassigned",i=o.toLowerCase(),m=a.branch??"—";let r=p.get(i);r||(r=new Map,p.set(i,r));const u=r.get(m)??[];u.push(a),r.set(m,u);let s=x.get(i);s||(s=new Map,x.set(i,s)),s.set(o,(s.get(o)??0)+1)}const g=a=>{const o=x.get(a);if(!o)return a;let i=null,m=-1;for(const[r,u]of o)u>m&&(i=r,m=u);return i??a},j=[];for(const[a,o]of p){const i=g(a),m=[];let r=0;const u={in_turn:0,in_flight:0,needs_attention:0,callable:0,blocked:0},s=[];for(const[l,n]of o){const t=[...n].sort((h,b)=>(b.updatedAt??0)-(h.updatedAt??0)),y=t.reduce((h,b)=>Math.max(h,b.updatedAt??0),0);r=Math.max(r,y);for(const h of t)u[_(h.state)]+=1,s.push(h);m.push({branch:l,agents:t,latest:y})}m.sort((l,n)=>n.latest-l.latest),j.push({project:i,branches:m,agents:s,latest:r,counts:u})}return j.sort((a,o)=>o.latest-a.latest),j}function T(c){return c?c.replace(/^\/Users\/[^/]+/,"~"):null}function se({agents:c,emptyTitle:p="No agents registered",emptyBody:x="Agents connected to this broker will appear here.",selectMode:g="preview"}){const{navigate:j}=O(),a=d.useMemo(()=>ee(c),[c]),[o,i]=d.useState(()=>new Set),m=d.useMemo(()=>{const s=[];for(const l of a)if(!o.has(l.project))for(const n of l.branches)for(const t of n.agents)s.push(t.id);return s},[a,o]),r=V({agents:c,orderedIds:m,navigate:j,selectMode:g});if(c.length===0)return e.jsxs("div",{className:"sys-list-empty",children:[e.jsx("h3",{children:p}),e.jsx("p",{children:x})]});const u=s=>{i(l=>{const n=new Set(l);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"mesh-tree",ref:r.containerRef,children:[a.map(s=>{const l=o.has(s.project);return e.jsxs("div",{className:`mesh-tree-group${l?" mesh-tree-group--collapsed":""}`,children:[e.jsxs("button",{type:"button",className:"mesh-tree-project",onClick:()=>u(s.project),"aria-expanded":!l,children:[e.jsx("span",{className:`mesh-tree-caret${l?"":" mesh-tree-caret--open"}`,"aria-hidden":!0,children:"›"}),e.jsx("span",{className:"mesh-tree-project-name",children:s.project}),e.jsx("span",{className:"mesh-tree-project-count",children:s.agents.length}),e.jsxs("span",{className:"mesh-tree-counts",children:[s.counts.in_turn+s.counts.in_flight+s.counts.needs_attention>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--working",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.in_turn+s.counts.in_flight+s.counts.needs_attention]}),s.counts.callable>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--available",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.callable]}),s.counts.blocked>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--offline",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.blocked]})]}),e.jsx("span",{className:"mesh-tree-project-time",children:s.latest?A(s.latest):""})]}),!l&&e.jsx("div",{className:"mesh-tree-branches",children:s.branches.map(n=>e.jsxs("div",{className:"mesh-tree-branch",children:[e.jsxs("div",{className:"mesh-tree-branch-head",children:[e.jsx("span",{className:"mesh-tree-branch-elbow","aria-hidden":!0,children:"└"}),e.jsx("span",{className:"mesh-tree-branch-name",children:n.branch})]}),e.jsx("div",{className:"mesh-tree-agents",children:n.agents.map(t=>{const y=_(t.state),h=D(t.state),b=t.agentClass==="organic",S=r.getState(t.id),k=T(t.cwd)??T(t.projectRoot),f=t.harnessSessionId?t.harnessSessionId.slice(0,8):null,v=[];k&&v.push({kind:"cwd",text:k}),t.harness&&v.push({kind:"harness",text:t.harness}),t.model&&v.push({kind:"model",text:t.model}),f&&v.push({kind:"sess",text:`sess:${f}`});const $=r.bind(t.id);return e.jsxs("button",{type:"button",className:`mesh-tree-agent${b?" mesh-tree-agent--organic":""}${S.isActive?" mesh-tree-agent--active":""}${S.isPinned?" mesh-tree-agent--pinned":""}`,title:b?`${t.harness??t.name} · organic session`:void 0,...$,children:[e.jsx("span",{className:`mesh-tree-agent-dot mesh-tree-agent-dot--${h}`,style:{background:z(t.state)}}),e.jsx("span",{className:"mesh-tree-agent-name",children:t.handle??t.name}),b&&e.jsx("span",{className:"mesh-tree-agent-organic","aria-label":"organic session",children:"○"}),e.jsx("span",{className:"mesh-tree-agent-inline",children:v.map((w,R)=>e.jsxs("span",{className:`mesh-tree-agent-inline-part mesh-tree-agent-inline-part--${w.kind}`,children:[R>0&&e.jsx("span",{className:"mesh-tree-agent-inline-sep",children:"·"}),w.text]},w.kind))}),e.jsx("span",{className:`mesh-tree-agent-state mesh-tree-agent-state--${h}`,children:F(y)}),e.jsx("span",{className:"mesh-tree-agent-time",children:t.updatedAt?A(t.updatedAt):""})]},t.id)})})]},n.branch))})]},s.project)}),r.card]})}function P({mode:c,density:p,query:x,stateFilter:g,loading:j,refreshing:a,error:o,lastLoadedAt:i,hasMesh:m,onRefresh:r}){return e.jsxs("div",{className:`mesh-hud mesh-hud--${c}`,children:[e.jsxs("div",{className:"mesh-hud-left",children:[e.jsxs("div",{className:"mesh-mode-toggle",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${c==="map"?" mesh-mode-btn--active":""}`,onClick:()=>E("map"),children:"Map"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${c==="tree"?" mesh-mode-btn--active":""}`,onClick:()=>E("tree"),children:"Tree"})]}),e.jsxs("div",{className:"mesh-mode-toggle mesh-density-toggle",role:"group","aria-label":"Density","aria-hidden":c!=="map","data-mode-only":"map",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="compact"?" mesh-mode-btn--active":""}`,onClick:()=>I("compact"),disabled:c!=="map",title:"Compact — dots",children:"Compact"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="comfortable"?" mesh-mode-btn--active":""}`,onClick:()=>I("comfortable"),disabled:c!=="map",title:"Comfortable — chips",children:"Comfortable"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="spacious"?" mesh-mode-btn--active":""}`,onClick:()=>I("spacious"),disabled:c!=="map",title:"Spacious — cards",children:"Spacious"})]})]}),m&&e.jsxs("div",{className:"mesh-hud-filters",children:[e.jsx("input",{type:"search",className:"mesh-hud-search",placeholder:"Filter agents…",value:x,onChange:u=>Y(u.target.value),spellCheck:!1,autoCorrect:"off",autoCapitalize:"off"}),e.jsxs("div",{className:"mesh-mode-toggle",role:"group","aria-label":"State",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="all"?" mesh-mode-btn--active":""}`,onClick:()=>L("all"),children:"All"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="in_turn"?" mesh-mode-btn--active":""}`,onClick:()=>L("in_turn"),children:"In turn"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="callable"?" mesh-mode-btn--active":""}`,onClick:()=>L("callable"),children:"Callable"})]})]}),e.jsxs("div",{className:"mesh-hud-right",children:[e.jsx("span",{className:"mesh-hud-sync",children:j?"Loading…":o&&m?`Last sync old — ${i?A(i):"unknown"}`:i?A(i):"—"}),e.jsx("button",{type:"button",className:"s-btn",disabled:j||a,onClick:r,children:a?"Refreshing…":"Refresh"})]})]})}function ls({navigate:c}){const[p,x]=d.useState(!0),[g,j]=d.useState(!1),[a,o]=d.useState(null),[i,m]=d.useState(null),{mode:r,density:u,query:s,stateFilter:l,meshSnapshot:n}=J(),{agents:t}=Q(),{route:y}=O(),h=K(y),b=d.useMemo(()=>H(t,h,n?.localNode?.id),[t,h,n?.localNode?.id]),S=d.useRef(null),k=d.useRef(0);d.useEffect(()=>{S.current=n},[n]),d.useEffect(()=>{h&&W(h,"node")},[h]);const f=d.useCallback(async(C="initial")=>{const N=++k.current;!(S.current!==null)&&C!=="background"?(x(!0),o(null)):j(!0);try{const M=await B("/api/mesh");if(N!==k.current)return;X(M),o(null),m(Date.now())}catch(M){if(N!==k.current)return;o(M instanceof Error?M.message:String(M))}finally{N===k.current&&(x(!1),j(!1))}},[]);d.useEffect(()=>{f("initial")},[f]),d.useEffect(()=>{const C=setInterval(()=>{f("background")},1e4);return()=>clearInterval(C)},[f]);const v=d.useMemo(()=>{const C=s.trim().toLowerCase();return b.filter(N=>l!=="all"&&_(N.state)!==l?!1:C?`${N.name??""} ${N.handle??""} ${N.harness??""} ${N.project??""} ${N.branch??""}`.toLowerCase().includes(C):!0)},[s,b,l]),$={mode:r,density:u,query:s,stateFilter:l,loading:p,refreshing:g,error:a,lastLoadedAt:i,hasMesh:!!n,onRefresh:()=>{f("manual")}},w=r==="map"?e.jsxs("div",{className:"mesh-map-canvas",children:[n&&e.jsx(U,{mesh:n,agents:v}),p&&!n&&e.jsx("div",{className:"mesh-canvas-center",children:e.jsx("p",{className:"mesh-canvas-center-label",children:"Loading mesh…"})}),!p&&!n&&a&&e.jsxs("div",{className:"mesh-canvas-center",children:[e.jsx("p",{className:"mesh-canvas-center-label",children:a}),e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{f("manual")},children:"Try again"})]}),e.jsx(P,{...$})]}):e.jsxs("div",{className:"mesh-tree-page",children:[e.jsx(P,{...$}),p&&!n&&e.jsxs("div",{className:"sys-panel sys-state-card mesh-tree-state",children:[e.jsx("h3",{className:"sys-state-title",children:"Loading mesh status"}),e.jsx("p",{className:"sys-state-body",children:"Inspecting broker reachability and peer discovery inputs."})]}),!p&&!n&&a&&e.jsxs("div",{className:"sys-panel sys-state-card sys-state-card-error mesh-tree-state",children:[e.jsx("h3",{className:"sys-state-title",children:"Mesh status is unavailable"}),e.jsx("p",{className:"sys-state-body",children:a}),e.jsx("div",{className:"sys-inline-actions",children:e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{f("manual")},children:"Try again"})})]}),n&&e.jsxs("section",{className:"mesh-tree-panel",children:[e.jsxs("div",{className:"mesh-tree-hint","aria-hidden":!0,children:[e.jsx("kbd",{children:"↑"}),e.jsx("kbd",{children:"↓"}),e.jsx("span",{children:"navigate"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"enter"}),e.jsx("span",{children:"pin"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"o"}),e.jsx("span",{children:"open"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"esc"}),e.jsx("span",{children:"clear"})]}),e.jsx(se,{agents:v,emptyTitle:b.length===0?h?"No agents on this machine":"No agents registered":"No agents match your filter",emptyBody:b.length===0?"Agents connected to this broker will appear here.":"Try clearing the search or switching the state pill back to All."})]})]}),R=Z();return e.jsxs("div",{className:"s-ops",children:[R?e.jsx("div",{className:"s-ops-header",children:e.jsx(G,{activeRoute:y,navigate:c})}):null,e.jsx("div",{className:"s-ops-body",children:w})]})}export{ls as MeshScreen};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/arc.es-BRPqOKIx.js","assets/index-NRbRrZw-.js","assets/index-DzlEgstl.css"])))=>i.map(i=>d[i]);
2
- import{r as g,j as d,_ as j}from"./index-NRbRrZw-.js";const E=g.lazy(()=>j(()=>import("./arc.es-BRPqOKIx.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/arc.es-BET9ev6q.js","assets/index-BZovGpDk.js","assets/index-9as_JTUs.css"])))=>i.map(i=>d[i]);
2
+ import{r as g,j as d,_ as j}from"./index-BZovGpDk.js";const E=g.lazy(()=>j(()=>import("./arc.es-BET9ev6q.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};
@@ -0,0 +1 @@
1
+ import{a as x}from"./api-h5zurxmi.js";import{j as o}from"./index-BZovGpDk.js";const m=new Set(["md","markdown","mdx","mdown","mkd"]),g=new Set(["c","cc","cpp","cxx","h","hh","hpp","hxx","cjs","mjs","js","jsx","ts","tsx","py","pyw","pyi","rs","go","java","kt","kts","swift","cs","rb","php","lua","r","sh","bash","zsh","fish","ps1","bat","cmd","sql","prisma","json","jsonc","json5","yaml","yml","toml","xml","html","htm","xhtml","css","scss","sass","less","vue","svelte","astro","graphql","gql","zig","ex","exs","erl","hrl","hs","clj","cljs","cljc","dart","tf","hcl","nix","env","ini","cfg","conf","properties","txt","log","cmake","gradle","groovy","patch","diff","proto","wat"]),w=new Set(["dockerfile","containerfile","makefile","gemfile","rakefile","procfile","brewfile"]),y=new Set(["text/markdown","text/x-markdown","text/plain","text/javascript","text/typescript","text/css","text/html","text/yaml","text/toml","text/x-shellscript","application/json","application/javascript"]);function p(e){return e.trim().split(/[/\\]/).pop()?.toLowerCase()??""}function l(e){const t=p(e),s=t.lastIndexOf(".");return s>=0?t.slice(s+1):""}function j(e){return m.has(l(e))}function v(e){const t=p(e);return w.has(t)?!0:g.has(l(e))}function d(e){return j(e)||v(e)}function f(e,t){if(!d(t))return null;const s=l(t);if(m.has(s))return"text/markdown";switch(s){case"json":case"jsonc":case"json5":return"application/json";case"yaml":case"yml":return"text/yaml";case"toml":return"text/toml";case"html":case"htm":case"xhtml":return"text/html";case"css":case"scss":case"sass":case"less":return"text/css";case"js":case"jsx":case"mjs":case"cjs":return"text/javascript";case"ts":case"tsx":return"text/typescript";case"sh":case"bash":case"zsh":case"fish":return"text/x-shellscript"}const r=e.trim().toLowerCase();return y.has(r)?r:"text/plain"}function k(e,t){const s=e.trim().toLowerCase();return s.startsWith("image/")||s.startsWith("video/")||s==="text/markdown"||s==="text/x-markdown"?!0:t?f(s,t)?!0:!s||s==="application/octet-stream"?d(t):!1:!1}function b(e){const t=e.type.trim().toLowerCase();return t.startsWith("image/")||t.startsWith("video/")?t:f(t,e.name)??t}function u(e){return k(e.type,e.name)}function E(e){return b(e)}function O(e){return e?e.files.length>0||[...e.types].some(t=>t.toLowerCase()==="files")?!0:[...e.items].some(t=>t.kind==="file"):!1}function C(e){if(!e)return[];const t=[...e.files];if(t.length>0)return t;const s=[];for(const r of e.items){if(r.kind!=="file")continue;const a=r.getAsFile();a&&s.push(a)}return s}function M(e){return C(e).filter(u)}function D(e){return M(e)}function F(e){return new Promise((t,s)=>{const r=new FileReader;r.onload=()=>{const a=typeof r.result=="string"?r.result:"",i=a.indexOf(",");t(i>=0?a.slice(i+1):a)},r.onerror=()=>s(r.error??new Error("Could not read file.")),r.readAsDataURL(e)})}async function N(e){if(!u(e))throw new Error("Only markdown, code, image, and video files can be routed.");const t=await F(e);return x("/api/blobs",{method:"POST",body:JSON.stringify({data:t,mediaType:E(e),fileName:e.name})})}async function R(e){const t=e.filter(u);if(t.length===0)throw new Error("Drop markdown, code, an image, or a video clip to route.");return(await Promise.all(t.map(r=>N(r)))).map((r,a)=>({id:r.id,mediaType:r.mediaType,fileName:r.fileName??t[a]?.name,url:r.url}))}function A({label:e,items:t,activeIndex:s,placement:r="above",onPick:a,onActiveIndexChange:i}){return t.length===0?null:o.jsxs("div",{className:"s-msg-compose-suggest","data-placement":r,role:"listbox","aria-label":e,children:[o.jsx("div",{className:"s-msg-compose-suggest-label",children:e}),t.map((n,c)=>o.jsxs("button",{type:"button",role:"option","aria-selected":c===s,className:["s-msg-compose-suggest-item",c===s&&"s-msg-compose-suggest-item--active"].filter(Boolean).join(" "),onMouseDown:h=>{h.preventDefault(),a(c)},onMouseEnter:()=>i(c),children:[n.avatar?o.jsx("span",{className:"s-ops-avatar s-msg-compose-suggest-avatar",style:{"--size":"20px",background:n.avatar.color},"aria-hidden":"true",children:n.avatar.label}):null,o.jsx("span",{className:"s-msg-compose-suggest-token",children:n.token}),o.jsx("span",{className:"s-msg-compose-suggest-desc",children:n.description})]},n.id))]})}export{A as M,M as a,C as b,O as d,u as i,D as r,R as u};
@@ -0,0 +1 @@
1
+ import{j as e,r as a}from"./index-BZovGpDk.js";import{i as w,a as C}from"./conversation-model-CHwHZNw-.js";import{u as b,m as M,g as S}from"./Provider-p-xuaAoE.js";import{b as A}from"./router-63XV_E7f.js";import{l as I,i as B,s as E}from"./sessionRead-CvFz2RHv.js";import{u as L}from"./use-conversation-list-DWX02INv.js";import{u as R}from"./use-fleet-active-asks-Cnwa4hTK.js";import{ConversationScreen as D}from"./ConversationScreen-Br0QQ3xo.js";import{P as O}from"./plus-BAI0t5g9.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./api-h5zurxmi.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./ConversationComposer-CjRXFkvY.js";import"./message-markup-DlVX-iuc.js";import"./mentions-BjXfeF7t.js";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./openContent-C6XO6kr5.js";import"./eye-DkU59kfl.js";import"./terminal-xGf_F3y7.js";import"./message-visibility-kJM8XcSG.js";import"./clipboard-e3fSpeo7.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-CRmdtuL7.js";import"./BackToPicker-D6WgIDb-.js";import"./ConversationFeedRows-CgRTIpAv.js";import"./ConversationPanels-DCkcLIHk.js";import"./use-reduced-motion-C8cWvIZ3.js";import"./activity-DS0u0Itf.js";import"./message-circle-BwVx5X0q.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-C12pfUax.js";import"./ConversationStatus-BJ1CMbAv.js";function os({conversationId:t,navigate:c}){return t?e.jsx(D,{conversationId:t,navigate:c,showBackNav:!1}):e.jsx(P,{})}function P(){const{onlineCount:t,apiConnection:c,reload:j,route:N,agents:d,openContextCapture:k,navigate:u}=b(),{sessions:y,loading:p,loadError:n}=L(),[x]=a.useState(()=>I()),v=R(),s=c.status==="offline",i=A(N),f=a.useRef(!1),h=a.useMemo(()=>{const m=M(d,i);return[...S(y,m,i)].sort((g,o)=>(o.lastMessageAt??0)-(g.lastMessageAt??0))},[y,d,i]),r=a.useMemo(()=>{const m=h.filter(o=>!w(o));return m.find(o=>o.agentId?v.get(o.agentId)?.status==="needs_attention"&&B(o.lastMessageAt,o.id,x):!1)??m[0]},[h,v,x]);a.useEffect(()=>{f.current||p||n||s||r&&(f.current=!0,E(r.id),u({view:"messages",conversationId:r.id,...i?{machineId:i}:{}},{replace:!0}))},[r,p,n,s,i,u]);const l=!s&&!n&&(p||!!r);return e.jsx("div",{className:`s-conv-empty${s?" s-conv-empty--offline":""}`,children:e.jsxs("div",{className:"s-conv-empty-inner",children:[e.jsx($,{}),e.jsx("div",{className:"s-conv-empty-eyebrow",children:s?"Connection":"Conversations"}),e.jsx("p",{className:"s-conv-empty-title",children:s?"Scout server offline":l?"Opening your latest conversation":n?"Chats unavailable":"Nothing open yet"}),e.jsx("p",{className:"s-conv-empty-detail",children:s?"Start or restart Scout services. Chats and context will appear when the server responds.":l?V(r):n||"Start a chat by choosing an agent and sending the first message."}),s||n?e.jsx("button",{type:"button",className:"s-conv-empty-action",onClick:()=>{j()},children:"Retry connection"}):l?null:e.jsxs("button",{type:"button",className:"s-conv-empty-new",onClick:()=>k(),children:[e.jsx(O,{size:16,"aria-hidden":"true"}),"New chat"]}),e.jsxs("div",{className:"s-conv-empty-ambient",children:[e.jsx("span",{className:"s-conv-empty-ambient-dot","aria-hidden":"true"}),s?"waiting for server":`${t} ${t===1?"agent":"agents"} active`]})]})})}function V(t){return t?C(t):"Finding where you left off."}function $(){return e.jsxs("svg",{className:"s-conv-empty-mesh",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"24",y2:"46"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"50",y2:"54"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"50",y1:"54",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"50",y2:"54"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"14",cy:"20",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"58",cy:"24",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"24",cy:"46",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"50",cy:"54",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node s-conv-empty-mesh-node--accent",cx:"36",cy:"12",r:"3.5"})]})}export{os as MessagesScreen};
@@ -1 +1 @@
1
- import{r as h,j as s}from"./index-NRbRrZw-.js";import{H as A}from"./HarnessMark-CEzmPFHC.js";import{s as C,t as M,b as k}from"./bash-format-BRV5C6Gv.js";import{d as E,c as S}from"./context-budget-DX_fwUs3.js";import{s as b}from"./page-status-CEP5pGf3.js";import{t as T}from"./time-Dhsh_2EG.js";import{b as y,a as B,l as O}from"./agent-lane-detail-D5EIlX7_.js";import{b as _}from"./agent-lane-preview-BhplDYGf.js";import{m as F}from"./mission-wall-CocIM1cF.js";import"./lane-observe-vfyACHi0.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-ask-display-B6iCAVcd.js";import"./mission-control-model-C0fByIjm.js";import"./colors-BtO5_zlx.js";const P=/^\[[a-z][a-z-]*\]$/i;function H(a,e){const l=w=>w.replace(/[…\s]+$/u,""),n=l(a),i=l(e);if(!n)return!0;const r=n.slice(0,Math.min(n.length,i.length));return i.startsWith(r)||n.startsWith(i)}function D(a,e){const l=a?.headline.trim();if(l&&!P.test(l)){const i=a?.detail?.trim(),r=a?.headFull??l;return i&&H(l,i)?{headline:i.length>l.length?i:l,full:r,detail:null}:{headline:l,full:r,detail:i??null}}const n=[...e?.events??[]].reverse().find(i=>i.kind==="tool");if(n){const i=n.arg?C(M(n.arg)).rest||n.arg:null,r=[n.tool,i].filter(Boolean).join(" · ").trim()||"Running tool";return{headline:r,full:r,detail:null}}return l?{headline:l,full:a?.headFull??l,detail:null}:null}const W=8,z=6,G={created:"+",modified:"~",read:"○"};function f(a,e=42){return a?a.length<=e?a:`…${a.slice(-(e-1))}`:"—"}function K(a){const e=a.replace(/\\/g,"/"),l=e.lastIndexOf("/");return l<0?{dir:"",base:e}:{dir:e.slice(0,l+1),base:e.slice(l+1)}}function ds({log:a,lane:e,onClose:l,onExpand:n,onTail:i,onOpenLog:r,onOpenFile:w}){const{agent:j,observe:o}=e,t=h.useMemo(()=>y(e),[e]),v=h.useMemo(()=>_(o,j,{isLive:a.live}),[o,j,a.live]),m=h.useMemo(()=>D(v,o),[v,o]),u=h.useMemo(()=>B(o,W),[o]),p=h.useMemo(()=>O(o,z),[o]),d=h.useMemo(()=>E(t.usage,{model:t.model,adapterType:t.harness}),[t.usage,t.model,t.harness]),N=F(a),g=[a.project,j.branch].filter(Boolean).join("/")||a.cwd||"—",L=u.filter(c=>c.state!=="read").length,$=[["MODEL",[t.harness,t.model].filter(Boolean).join("/")||"—",null],["BRANCH",t.branch??"—",null],["CWD",f(t.cwd),t.cwd],["SESSION",f(t.sessionId,30),t.sessionId],["LOG",f(a.logPath,30),a.logPath]];return s.jsxs("aside",{className:"s-wall-rail","aria-label":`${N} context`,children:[s.jsxs("div",{className:"s-wall-rail-head",children:[s.jsx("span",{className:`s-wall-rail-dot${a.live?" s-wall-rail-dot--live":""}`,"aria-hidden":"true"}),s.jsx(A,{harness:a.source,size:12,title:null}),s.jsxs("div",{className:"s-wall-rail-identity",children:[s.jsx("div",{className:"s-wall-rail-title",title:j.name,children:N}),s.jsxs("div",{className:"s-wall-rail-sub",title:a.cwd??g,children:[g," · ",a.lastActiveAt?T(a.lastActiveAt):"idle"]})]}),s.jsx("button",{type:"button",className:"s-wall-rail-close",onClick:l,"aria-label":"Close context (Esc)",title:"Close context (Esc)",children:"✕"})]}),s.jsxs("div",{className:"s-wall-rail-body",children:[s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:a.live?"executing now":"last action"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),m?s.jsxs("div",{className:"s-wall-rail-now",children:[s.jsx("div",{className:"s-wall-rail-headline",title:m.full,children:m.headline}),m.detail&&s.jsx("div",{className:"s-wall-rail-detail",title:m.detail,children:m.detail})]}):s.jsx("div",{className:"s-wall-rail-empty",children:"No interpreted trace yet — the pane is streaming raw output."}),s.jsxs("dl",{className:"s-wall-rail-stats",children:[s.jsx(x,{label:"events",value:t.events}),s.jsx(x,{label:"tools",value:t.tools}),s.jsx(x,{label:"edits",value:t.edits}),s.jsx(x,{label:"reads",value:t.reads}),s.jsx(x,{label:"files",value:t.files})]}),d&&s.jsxs("div",{className:`s-wall-rail-gauge${d.overLimit?" s-wall-rail-gauge--over":""}`,children:[s.jsxs("div",{className:"s-wall-rail-gauge-line",children:[s.jsx("span",{className:"s-wall-rail-gauge-label",children:"context"}),s.jsxs("span",{className:"s-wall-rail-gauge-value",children:[d.usedLabel,s.jsxs("span",{className:"s-wall-rail-gauge-of",children:[" / ",d.budgetLabel]})]}),s.jsxs("span",{className:"s-wall-rail-gauge-pct",children:[d.pct,"%",d.overLimit?" over":""]})]}),s.jsx("div",{className:"s-wall-rail-gauge-bar",role:"progressbar","aria-label":"Context budget","aria-valuenow":d.pct,"aria-valuemin":0,"aria-valuemax":Math.max(100,d.pct),children:s.jsx("span",{className:"s-wall-rail-gauge-fill",style:{width:`${S(d)}%`}})})]})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"runtime"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),s.jsx("dl",{className:"s-wall-rail-facts",children:$.map(([c,R,I])=>s.jsxs("div",{className:"s-wall-rail-fact",children:[s.jsx("dt",{className:"s-wall-rail-fact-label",children:c}),s.jsx("dd",{className:"s-wall-rail-fact-value",title:I??R,children:R})]},c))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"files"}),u.length>0&&s.jsxs("span",{className:"s-wall-rail-seccount",children:[L," changed · ",u.length-L," read"]}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),u.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No files touched in this window."}):s.jsx("div",{className:"s-wall-rail-files",children:u.map(c=>s.jsx(U,{file:c,onOpen:w},`${c.path}:${c.lastT}`))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"commands"}),p.length>0&&s.jsx("span",{className:"s-wall-rail-seccount",children:p.length}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),p.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No shell commands in this window."}):s.jsx("div",{className:"s-wall-rail-cmds",children:p.map(c=>s.jsx(q,{entry:c},c.id))})]})]}),s.jsxs("div",{className:"s-wall-rail-foot",children:[s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:n,...b({label:`Expand ${N}`}),children:"Expand"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:i,...b({label:`Tail · ${N}`,route:`/ops/tail?q=${encodeURIComponent(a.sessionId)}`}),children:"Tail ↗"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:r,...b({label:`Session · ${a.sessionId}`,route:`/sessions/${a.sessionId}`}),children:"Session ↗"}),s.jsxs("span",{className:"s-wall-rail-keys",children:[s.jsx("kbd",{children:"hjkl"})," move · ",s.jsx("kbd",{children:"esc"})," close"]})]})]})}function x({label:a,value:e}){return s.jsxs("div",{className:"s-wall-rail-stat",children:[s.jsx("dt",{className:"s-wall-rail-stat-label",children:a}),s.jsx("dd",{className:"s-wall-rail-stat-value",children:e>0?e.toLocaleString():"—"})]})}function U({file:a,onOpen:e}){const{dir:l,base:n}=K(a.path);return s.jsxs("button",{type:"button",className:"s-wall-rail-frow",title:a.path,onClick:()=>e(a.path),children:[s.jsx("span",{className:`s-wall-rail-fstate s-wall-rail-fstate--${a.state}`,"aria-hidden":"true",children:G[a.state]??"○"}),s.jsxs("span",{className:"s-wall-rail-fpath",children:[l&&s.jsx("span",{className:"s-wall-rail-fdir",children:l}),s.jsx("span",{className:"s-wall-rail-fbase",children:n})]})]})}function q({entry:a}){const{dir:e,rest:l}=C(M(a.command)),n=k(l||a.command);return s.jsxs("div",{className:"s-wall-rail-crow",title:a.command,children:[s.jsx("span",{className:"s-wall-rail-cmark","aria-hidden":"true",children:"❯"}),s.jsxs("span",{className:"s-wall-rail-ctext",children:[e&&s.jsxs("span",{className:"s-wall-rail-bash-dir",children:[e,"/"]}),n.map((i,r)=>s.jsxs("span",{className:`s-wall-rail-bash-${i.tier}${i.flag?" s-wall-rail-bash-flag":""}`,children:[r>0?" ":"",i.text]},r))]}),a.outcome&&s.jsx("span",{className:"s-wall-rail-cresult",children:a.outcome})]})}export{ds as MissionContextRail};
1
+ import{r as h,j as s}from"./index-BZovGpDk.js";import{H as A}from"./HarnessMark-DrE57dUq.js";import{s as C,t as M,b as k}from"./bash-format-BRV5C6Gv.js";import{d as E,c as S}from"./context-budget-DX_fwUs3.js";import{s as b}from"./page-status-Bg2hd27j.js";import{t as T}from"./time-Dhsh_2EG.js";import{b as y,a as B,l as O}from"./agent-lane-detail-BNNm6FNu.js";import{b as _}from"./agent-lane-preview-C33Dwpn7.js";import{m as F}from"./mission-wall-CocIM1cF.js";import"./lane-observe-BA3g9aVd.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-ask-display-B6iCAVcd.js";import"./mission-control-model-C0fByIjm.js";import"./colors-BtO5_zlx.js";const P=/^\[[a-z][a-z-]*\]$/i;function H(a,e){const l=w=>w.replace(/[…\s]+$/u,""),n=l(a),i=l(e);if(!n)return!0;const r=n.slice(0,Math.min(n.length,i.length));return i.startsWith(r)||n.startsWith(i)}function D(a,e){const l=a?.headline.trim();if(l&&!P.test(l)){const i=a?.detail?.trim(),r=a?.headFull??l;return i&&H(l,i)?{headline:i.length>l.length?i:l,full:r,detail:null}:{headline:l,full:r,detail:i??null}}const n=[...e?.events??[]].reverse().find(i=>i.kind==="tool");if(n){const i=n.arg?C(M(n.arg)).rest||n.arg:null,r=[n.tool,i].filter(Boolean).join(" · ").trim()||"Running tool";return{headline:r,full:r,detail:null}}return l?{headline:l,full:a?.headFull??l,detail:null}:null}const W=8,z=6,G={created:"+",modified:"~",read:"○"};function f(a,e=42){return a?a.length<=e?a:`…${a.slice(-(e-1))}`:"—"}function K(a){const e=a.replace(/\\/g,"/"),l=e.lastIndexOf("/");return l<0?{dir:"",base:e}:{dir:e.slice(0,l+1),base:e.slice(l+1)}}function ds({log:a,lane:e,onClose:l,onExpand:n,onTail:i,onOpenLog:r,onOpenFile:w}){const{agent:j,observe:o}=e,t=h.useMemo(()=>y(e),[e]),v=h.useMemo(()=>_(o,j,{isLive:a.live}),[o,j,a.live]),m=h.useMemo(()=>D(v,o),[v,o]),u=h.useMemo(()=>B(o,W),[o]),p=h.useMemo(()=>O(o,z),[o]),d=h.useMemo(()=>E(t.usage,{model:t.model,adapterType:t.harness}),[t.usage,t.model,t.harness]),N=F(a),g=[a.project,j.branch].filter(Boolean).join("/")||a.cwd||"—",L=u.filter(c=>c.state!=="read").length,$=[["MODEL",[t.harness,t.model].filter(Boolean).join("/")||"—",null],["BRANCH",t.branch??"—",null],["CWD",f(t.cwd),t.cwd],["SESSION",f(t.sessionId,30),t.sessionId],["LOG",f(a.logPath,30),a.logPath]];return s.jsxs("aside",{className:"s-wall-rail","aria-label":`${N} context`,children:[s.jsxs("div",{className:"s-wall-rail-head",children:[s.jsx("span",{className:`s-wall-rail-dot${a.live?" s-wall-rail-dot--live":""}`,"aria-hidden":"true"}),s.jsx(A,{harness:a.source,size:12,title:null}),s.jsxs("div",{className:"s-wall-rail-identity",children:[s.jsx("div",{className:"s-wall-rail-title",title:j.name,children:N}),s.jsxs("div",{className:"s-wall-rail-sub",title:a.cwd??g,children:[g," · ",a.lastActiveAt?T(a.lastActiveAt):"idle"]})]}),s.jsx("button",{type:"button",className:"s-wall-rail-close",onClick:l,"aria-label":"Close context (Esc)",title:"Close context (Esc)",children:"✕"})]}),s.jsxs("div",{className:"s-wall-rail-body",children:[s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:a.live?"executing now":"last action"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),m?s.jsxs("div",{className:"s-wall-rail-now",children:[s.jsx("div",{className:"s-wall-rail-headline",title:m.full,children:m.headline}),m.detail&&s.jsx("div",{className:"s-wall-rail-detail",title:m.detail,children:m.detail})]}):s.jsx("div",{className:"s-wall-rail-empty",children:"No interpreted trace yet — the pane is streaming raw output."}),s.jsxs("dl",{className:"s-wall-rail-stats",children:[s.jsx(x,{label:"events",value:t.events}),s.jsx(x,{label:"tools",value:t.tools}),s.jsx(x,{label:"edits",value:t.edits}),s.jsx(x,{label:"reads",value:t.reads}),s.jsx(x,{label:"files",value:t.files})]}),d&&s.jsxs("div",{className:`s-wall-rail-gauge${d.overLimit?" s-wall-rail-gauge--over":""}`,children:[s.jsxs("div",{className:"s-wall-rail-gauge-line",children:[s.jsx("span",{className:"s-wall-rail-gauge-label",children:"context"}),s.jsxs("span",{className:"s-wall-rail-gauge-value",children:[d.usedLabel,s.jsxs("span",{className:"s-wall-rail-gauge-of",children:[" / ",d.budgetLabel]})]}),s.jsxs("span",{className:"s-wall-rail-gauge-pct",children:[d.pct,"%",d.overLimit?" over":""]})]}),s.jsx("div",{className:"s-wall-rail-gauge-bar",role:"progressbar","aria-label":"Context budget","aria-valuenow":d.pct,"aria-valuemin":0,"aria-valuemax":Math.max(100,d.pct),children:s.jsx("span",{className:"s-wall-rail-gauge-fill",style:{width:`${S(d)}%`}})})]})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"runtime"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),s.jsx("dl",{className:"s-wall-rail-facts",children:$.map(([c,R,I])=>s.jsxs("div",{className:"s-wall-rail-fact",children:[s.jsx("dt",{className:"s-wall-rail-fact-label",children:c}),s.jsx("dd",{className:"s-wall-rail-fact-value",title:I??R,children:R})]},c))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"files"}),u.length>0&&s.jsxs("span",{className:"s-wall-rail-seccount",children:[L," changed · ",u.length-L," read"]}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),u.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No files touched in this window."}):s.jsx("div",{className:"s-wall-rail-files",children:u.map(c=>s.jsx(U,{file:c,onOpen:w},`${c.path}:${c.lastT}`))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"commands"}),p.length>0&&s.jsx("span",{className:"s-wall-rail-seccount",children:p.length}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),p.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No shell commands in this window."}):s.jsx("div",{className:"s-wall-rail-cmds",children:p.map(c=>s.jsx(q,{entry:c},c.id))})]})]}),s.jsxs("div",{className:"s-wall-rail-foot",children:[s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:n,...b({label:`Expand ${N}`}),children:"Expand"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:i,...b({label:`Tail · ${N}`,route:`/ops/tail?q=${encodeURIComponent(a.sessionId)}`}),children:"Tail ↗"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:r,...b({label:`Session · ${a.sessionId}`,route:`/sessions/${a.sessionId}`}),children:"Session ↗"}),s.jsxs("span",{className:"s-wall-rail-keys",children:[s.jsx("kbd",{children:"hjkl"})," move · ",s.jsx("kbd",{children:"esc"})," close"]})]})]})}function x({label:a,value:e}){return s.jsxs("div",{className:"s-wall-rail-stat",children:[s.jsx("dt",{className:"s-wall-rail-stat-label",children:a}),s.jsx("dd",{className:"s-wall-rail-stat-value",children:e>0?e.toLocaleString():"—"})]})}function U({file:a,onOpen:e}){const{dir:l,base:n}=K(a.path);return s.jsxs("button",{type:"button",className:"s-wall-rail-frow",title:a.path,onClick:()=>e(a.path),children:[s.jsx("span",{className:`s-wall-rail-fstate s-wall-rail-fstate--${a.state}`,"aria-hidden":"true",children:G[a.state]??"○"}),s.jsxs("span",{className:"s-wall-rail-fpath",children:[l&&s.jsx("span",{className:"s-wall-rail-fdir",children:l}),s.jsx("span",{className:"s-wall-rail-fbase",children:n})]})]})}function q({entry:a}){const{dir:e,rest:l}=C(M(a.command)),n=k(l||a.command);return s.jsxs("div",{className:"s-wall-rail-crow",title:a.command,children:[s.jsx("span",{className:"s-wall-rail-cmark","aria-hidden":"true",children:"❯"}),s.jsxs("span",{className:"s-wall-rail-ctext",children:[e&&s.jsxs("span",{className:"s-wall-rail-bash-dir",children:[e,"/"]}),n.map((i,r)=>s.jsxs("span",{className:`s-wall-rail-bash-${i.tier}${i.flag?" s-wall-rail-bash-flag":""}`,children:[r>0?" ":"",i.text]},r))]}),a.outcome&&s.jsx("span",{className:"s-wall-rail-cresult",children:a.outcome})]})}export{ds as MissionContextRail};
@@ -0,0 +1 @@
1
+ import{r as n,j as a}from"./index-BZovGpDk.js";/* empty css */import{a as K}from"./api-h5zurxmi.js";import{u as Ae,f as Re,g as ge,t as U,h as b,e as ue}from"./mission-control-store-CMgIVjLJ.js";import{u as be}from"./observe-DVHAcIrv.js";import{e as me}from"./NewChatComposer-DKlNX1UA.js";import{i as Ee,c as je}from"./keyboard-nav-CHo_xmjw.js";import{g as Me}from"./tail-display-BRcJltQa.js";import{u as Le}from"./tail-events-C12pfUax.js";import{u as Te}from"./Provider-p-xuaAoE.js";import{MissionContextRail as ke}from"./MissionContextRail-D5MEP2f4.js";import{FocusOverlay as Ne}from"./MissionFocusOverlay-CWKLdUKG.js";import{MissionLogPane as Ce}from"./MissionLogPane-ZwHJ137T.js";import{o as Fe}from"./agent-lanes-model-VYQ5a68i.js";import{A as Oe}from"./mission-control-model-C0fByIjm.js";import{b as Pe,s as _e,f as De,c as We,n as $e,d as Ke,m as Ve,W as qe}from"./mission-wall-CocIM1cF.js";import"./colors-BtO5_zlx.js";import"./surface-activity-B1rgWB1i.js";import"./runtime-picker-BXKJbLot.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-CrGUKNRv.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./file-text-BITQqGtF.js";import"./lane-edit-display-C_Aujldz.js";import"./index-BWHgHrtv.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-Bb0EOcU9.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./bash-format-BRV5C6Gv.js";import"./context-budget-DX_fwUs3.js";import"./page-status-Bg2hd27j.js";import"./agent-lane-detail-BNNm6FNu.js";import"./lane-observe-BA3g9aVd.js";import"./agent-lane-preview-C33Dwpn7.js";import"./lane-ask-display-B6iCAVcd.js";function He(t,o,r,c){if(o<=0)return-1;const d=o-1,x=Math.max(1,Math.floor(r));if(t<0||t>d)return c==="left"||c==="up"||c==="last"?d:0;switch(c){case"first":return 0;case"last":return d;case"left":return Math.max(0,t-1);case"right":return Math.min(d,t+1);case"up":{const v=t-x;return v>=0?v:t}case"down":{const v=t+x;return v<=d?v:d}}}function Be(t){switch(t){case"h":case"ArrowLeft":return"left";case"l":case"ArrowRight":return"right";case"k":case"ArrowUp":return"up";case"j":case"ArrowDown":return"down";case"g":case"Home":return"first";case"G":case"End":return"last";default:return null}}const $=4e3,Qe=250,ze=3e4,Ue=1500,Ge=1800;function Je(t,o){return t.map(r=>({id:r.id,name:r.name,handle:r.handle,state:r.state,project:r.project,branch:r.branch,harness:r.harness,model:r.model,sessionIds:o.get(r.id)??[]}))}function Ye(t){return{id:`native:${t.source}:${t.sessionId}`,definitionId:`native:${t.source}:${t.sessionId}`,name:`${t.source} · ${t.project}`,handle:t.sessionId.slice(0,8),agentClass:"native-session",harness:t.source,state:t.live?"working":"ready",projectRoot:t.cwd,cwd:t.cwd,updatedAt:t.lastActiveAt,createdAt:null,transport:"tail",selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:t.project,branch:t.attribution==="unattributed"?"native session":t.attribution,role:"native session",model:null,harnessSessionId:t.sessionId,terminalSurface:null,harnessLogPath:t.logPath,conversationId:null,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null}}function fe(t){return t.agentClass==="native-session"||t.id.startsWith("native:")}function de(t,o){if(t.agent){const r=o.find(c=>c.id===t.agent.id);if(r)return r}return Ye(t)}function Xe(t,o){const r=o.find(c=>c.sessionId?.trim()===t.sessionId);return r||{source:t.source,transcriptPath:t.logPath??"",sessionId:t.sessionId,cwd:t.cwd,project:t.project,harness:t.attribution,mtimeMs:t.lastActiveAt,size:0}}function Ze(t,o){const r=t.harnessSessionId?.trim();if(!r)throw new Error("This native session has no session id to continue.");const c=t.projectRoot?.trim()||t.cwd?.trim();if(!c)throw new Error("This native session has no project path to route from.");const d=t.harness?.trim(),x=t.model?.trim();return{target:{projectPath:c},execution:{session:"existing",targetSessionId:r,...d?{harness:d}:{},...x?{model:x}:{}},agent:{persistence:"one_time",...t.handle?.trim()?{handle:t.handle.trim()}:{}},seed:{instructions:o}}}async function et(t,o){if(fe(t)){await K("/api/sessions",{method:"POST",body:JSON.stringify(Ze(t,o))});return}const r=await me(t);await K("/api/send",{method:"POST",body:JSON.stringify({body:o,chatId:r,execution:{...t.harness?.trim()?{harness:t.harness.trim()}:{},...t.model?.trim()?{model:t.model.trim()}:{}}})})}function tt(t,o,r){return t.live?"active":t.lastActiveAt>0&&o-t.lastActiveAt<=r?"recent":"idle"}function as({navigate:t,agents:o}){const r=Ae(),{openFilePreview:c}=Te(),{activityFilter:d,sourceFilter:x,activityWindowMs:v,groupMode:G,query:J,focusedId:F,revealRequest:A}=r,[Y,X]=n.useState([]),[O,pe]=n.useState(null),[y,he]=n.useState(()=>Date.now()),T=be(o),P=n.useRef([]);Le(e=>{P.current.push(e)}),n.useEffect(()=>{const e=setInterval(()=>{if(P.current.length===0)return;const s=P.current;P.current=[],X(i=>{const p=new Set(i.map(w=>w.id)),u=s.filter(w=>!w.id||!p.has(w.id));if(u.length===0)return i;const h=i.concat(u);return h.length>$?h.slice(h.length-$):h})},Qe);return()=>clearInterval(e)},[]),n.useEffect(()=>{const e=setInterval(()=>he(Date.now()),1e4);return()=>clearInterval(e)},[]),n.useEffect(()=>{let e=!1;return K(`/api/tail/recent?limit=${Ue}`).then(s=>{if(e)return;const i=s.events??[];X(p=>{const u=new Set(p.map(w=>w.id)),h=i.filter(w=>!u.has(w.id)).concat(p);return h.length>$?h.slice(h.length-$):h})}).catch(()=>{}),()=>{e=!0}},[]),n.useEffect(()=>{let e=!1;const s=async()=>{try{const p=await K("/api/tail/discover");e||pe(p)}catch{}};s();const i=setInterval(()=>{s()},ze);return()=>{e=!0,clearInterval(i)}},[]);const Z=n.useMemo(()=>{const e=new Map;for(const s of o){const i=T[s.id],p=[s.harnessSessionId,i?.sessionId,i?.data.metadata?.session?.externalSessionId].map(u=>u?.trim()).filter(u=>!!u);e.set(s.id,[...new Set(p)])}return e},[o,T]),R=n.useMemo(()=>Pe({events:Me(Y),transcripts:O?.transcripts??[],agents:Je(o,Z),now:y,liveWindowMs:Oe}),[o,O?.transcripts,y,Z,Y]),[g,V]=n.useState(null),I=n.useMemo(()=>{const e=_e(De(R,{sourceFilter:x,activityFilter:d,query:J,now:y,activeWindowMs:v}),G);if(!g)return e;const s=e.find(i=>i.id===g);return s?[s,...e.filter(i=>i.id!==g)]:e},[d,v,G,R,y,g,J,x]),ee=n.useRef(null),q=n.useRef({w:0,h:0}),te=n.useRef(0);te.current=I.length;const[m,ve]=n.useState(()=>We(0,{w:0,h:0})),H=n.useRef(m),_=n.useCallback((e,s)=>{const i=$e(H.current,e,s);i!==H.current&&(H.current=i,ve(i))},[]);n.useEffect(()=>{const e=ee.current;if(!e)return;const s=new ResizeObserver(([i])=>{q.current={w:i.contentRect.width,h:i.contentRect.height},_(te.current,q.current)});return s.observe(e),()=>s.disconnect()},[_]),n.useLayoutEffect(()=>{_(I.length,q.current)},[I.length,_]);const E=n.useMemo(()=>I.slice(0,m.shown),[I,m.shown]),se=n.useRef(1);se.current=Math.max(1,m.cols),n.useEffect(()=>{Re(I.map(e=>({id:e.id,name:e.agent?.name??Ve(e),handle:e.agent?.handle??Ke(e),harness:e.source,branch:e.agent?.branch??null,project:e.project,model:e.agent?.model??null,state:e.agent?.state??null,agentClass:e.agent?"agent":"native-session",updatedAt:e.lastActiveAt,source:e.agent||e.attribution==="scout-managed"?"scout":"native",activity:tt(e,y,v),lastActiveAt:e.lastActiveAt})))},[v,y,I]);const[we,ne]=n.useState(null),re=n.useRef(null),k=n.useRef(null);n.useEffect(()=>{A&&re.current!==A.serial&&(re.current=A.serial,V(A.id),ne(A.id),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>ne(null),Ge),ge(A.serial))},[A]),n.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const N=F?R.find(e=>e.id===F)??null:null,f=n.useMemo(()=>N?de(N,o):null,[o,N]),Ie=N?.agent?T[N.agent.id]?.data??null:null,[S,C]=n.useState(null),[j,D]=n.useState(!1),xe=S?E.findIndex(e=>e.id===S):-1,ie=n.useRef({index:-1,ids:[]});ie.current={index:xe,ids:E.map(e=>e.id)};const B=S?R.find(e=>e.id===S)??null:null,l=j?B:null;n.useEffect(()=>{j&&!B&&D(!1)},[B,j]);const Q=n.useRef(new Map),ye=n.useCallback((e,s)=>{s?Q.current.set(e,s):Q.current.delete(e)},[]);n.useEffect(()=>{S&&Q.current.get(S)?.focus({preventScroll:!0})},[S]);const oe=n.useMemo(()=>{if(!l)return null;const e=de(l,o),s=(l.agent?T[l.agent.id]?.data??null:null)??Fe(Xe(l,O?.transcripts??[]),l.lines,l.live,{now:y});return{id:l.id,agent:e,source:l.agent?"scout":"native",observe:s,lastActiveAt:l.lastActiveAt,current:l.live}},[o,O?.transcripts,y,T,l]),ae=n.useCallback(e=>{t({view:"ops",mode:"tail",tailQuery:e.sessionId})},[t]),z=n.useCallback(e=>{C(e),D(!0)},[]),le=n.useRef({focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents});le.current={focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents},n.useEffect(()=>{const e=s=>{if(Ee(s.target))return;const i=le.current;if(i.focusedId){s.key==="Escape"&&b(null);return}if(je())return;if(s.key==="Escape"){i.railOpen?D(!1):i.selectedIds.length>0?ue():i.pinnedId?V(null):C(null);return}if((s.metaKey||s.ctrlKey)&&s.key==="a"){if(i.visibleAgents.length===0)return;s.preventDefault();const W=i.visibleAgents.map(L=>L.id);if(W.every(L=>i.selectedIds.includes(L))){ue();return}for(const L of W)i.selectedIds.includes(L)||U(L);return}if(s.metaKey||s.ctrlKey||s.altKey)return;const{index:p,ids:u}=ie.current;if(u.length===0)return;const h=Be(s.key);if(h){s.preventDefault();const W=He(p,u.length,se.current,h);C(u[W]??null);return}const w=p<0?0:p,M=u[w];if(M){if(s.key==="Enter"||s.key==="i"){s.preventDefault(),z(M);return}if(s.key==="o"){s.preventDefault(),C(M),b(M);return}(s.key==="x"||s.key===" ")&&(s.preventDefault(),C(M),U(M))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[z]);const Se=E.reduce((e,s)=>e+s.lines.length,0),ce=R.length-I.length;return a.jsxs("div",{className:"s-wall",children:[a.jsxs("div",{className:"s-wall-status",children:[a.jsx("span",{className:"s-wall-status-key",children:"logs"}),a.jsxs("span",{className:"s-wall-status-value",children:[m.shown,"/",I.length]}),a.jsx("span",{className:"s-wall-status-key",children:"grid"}),a.jsx("span",{className:"s-wall-status-value",children:m.cols>0?`${m.cols}×${m.rows}`:"—"}),a.jsx("span",{className:"s-wall-status-key",children:"lines"}),a.jsx("span",{className:"s-wall-status-value",children:Se}),m.hidden>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Least recently active logs are withheld to keep panes readable",children:[m.hidden," withheld"]}),ce>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Sessions discovery knows of that have produced no output to tail",children:[ce," quiet"]}),E.length>0&&a.jsxs("span",{className:"s-wall-status-keys",children:[a.jsx("kbd",{children:"hjkl"})," move · ",a.jsx("kbd",{children:"⏎"})," context · ",a.jsx("kbd",{children:"o"})," expand"]}),g&&a.jsx("button",{type:"button",className:"s-wall-status-pin",onClick:()=>V(null),children:"unpin"})]}),a.jsx("div",{ref:ee,className:`s-wall-grid${j?" s-wall-grid--railed":""}`,style:{gridTemplateColumns:`repeat(${Math.max(1,m.cols)}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${Math.max(1,m.rows)}, minmax(0, 1fr))`,gap:qe},children:E.length===0?a.jsxs("div",{className:"s-wall-empty",children:[a.jsx("div",{className:"s-wall-empty-title",children:R.length===0?"No logs on the wire":"No matching logs"}),a.jsx("div",{className:"s-wall-empty-sub",children:R.length===0?"Panes appear as sessions start writing to their transcripts.":"Widen the activity window or clear the filter."})]}):E.map(e=>a.jsx(Ce,{log:e,selected:r.selectedIds.includes(e.id),revealed:we===e.id,cursor:S===e.id,paneRef:s=>ye(e.id,s),onOpen:()=>z(e.id),onToggleSelected:()=>U(e.id),onOpenLog:()=>ae(e)},e.id))}),l&&oe&&a.jsx(ke,{log:l,lane:oe,onClose:()=>D(!1),onExpand:()=>b(l.id),onTail:()=>ae(l),onOpenLog:()=>t({view:"sessions",sessionId:l.sessionId}),onOpenFile:c}),f&&a.jsx(Ne,{agent:f,observe:Ie,onClose:()=>b(null),onSend:e=>et(f,e),onOpenConversation:()=>{if(b(null),fe(f)&&f.harnessSessionId){t({view:"sessions",sessionId:f.harnessSessionId});return}me(f).then(e=>t({view:"conversation",conversationId:e})).catch(()=>t({view:"agents-v2",agentId:f.id,tab:"message"}))},onTail:()=>{b(null),t({view:"ops",mode:"tail",tailQuery:f.harnessSessionId??f.handle??f.name})},onProfile:()=>{b(null),t({view:"agents-v2",agentId:f.id})}})]})}export{as as MissionControlView};
@@ -0,0 +1 @@
1
+ import{r as f,j as e}from"./index-BZovGpDk.js";import{d as w,c as N,n as $}from"./colors-BtO5_zlx.js";import{u as C}from"./keyboard-nav-CHo_xmjw.js";import{t as j}from"./time-Dhsh_2EG.js";import{f as M}from"./text-DsBWV_4k.js";import{s as v}from"./page-status-Bg2hd27j.js";import{M as S}from"./runtime-picker-BXKJbLot.js";import"./index-DiiEQwdc.js";import{K as k}from"./mission-control-model-C0fByIjm.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";function Q({agent:s,observe:a,onClose:l,onSend:o,onOpenConversation:r,onTail:d,onProfile:h}){const p=w(s.name),{ref:m,onKeyDown:u}=C(),[i,n]=f.useState("profile"),c=t=>{if(u(t),t.defaultPrevented)return;const y=t.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||(y?.isContentEditable??!1)||(t.key==="1"?(t.preventDefault(),n("profile")):t.key==="2"?(t.preventDefault(),n("activity")):t.key==="3"&&(t.preventDefault(),n("message")))};return e.jsx("div",{className:"s-mission-overlay",onClick:l,children:e.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":"mission-overlay-title",onClick:t=>t.stopPropagation(),onKeyDown:c,tabIndex:-1,className:"s-mission-overlay-dialog",children:[e.jsxs("div",{className:"s-mission-overlay-header",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:p},children:s.name[0]?.toUpperCase()}),e.jsxs("div",{className:"s-mission-overlay-identity",children:[e.jsxs("div",{className:"s-mission-overlay-name",id:"mission-overlay-title",children:[s.name," ",e.jsx("span",{className:"s-mission-overlay-handle",children:s.handle?`@${s.handle}`:""})]}),e.jsxs("div",{className:"s-mission-overlay-meta",children:[s.project??"—"," · ",s.branch??"main"," · ",N(s.state)]})]}),e.jsx("button",{className:"s-mission-overlay-close",onClick:l,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs",role:"tablist",children:[e.jsxs("div",{className:"s-mission-overlay-tabs-group",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":i==="profile",className:`s-mission-overlay-tab${i==="profile"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("profile"),children:"Profile"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="activity",className:`s-mission-overlay-tab${i==="activity"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("activity"),children:"Activity"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="message",className:`s-mission-overlay-tab${i==="message"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("message"),children:"Message"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs-action",children:[i==="profile"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:h,...v({label:`Open profile · ${s.handle??s.name}`,route:`/agents/${s.id}`}),children:"Open profile ↗"}),i==="activity"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:d,...v({label:`Tail · ${s.handle??s.name}`,route:`/ops/tail?q=${encodeURIComponent(s.handle??s.name)}`}),children:"Open in Tail ↗"}),i==="message"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:r,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"})]})]}),e.jsxs("div",{className:"s-mission-overlay-body",children:[i==="profile"&&e.jsx(E,{agent:s}),i==="activity"&&e.jsx(D,{agent:s,observe:a,onOpenConversation:r,onMessage:()=>n("message")}),i==="message"&&e.jsx(O,{agent:s,onSend:o,onOpenConversation:r})]})]})})}function E({agent:s}){const a=[["MODEL",[s.harness,s.model].filter(Boolean).join("/")||"—"],["AT",[s.project,s.branch].filter(Boolean).join("/")||"—"],["CWD",s.cwd||s.projectRoot||"—"],["AGENT",s.agentClass||"—"],["ROLE",s.role||s.transport||"—"],["MACHINE",s.authorityNodeName??s.homeNodeName??s.authorityNodeId??s.homeNodeId??"—"],["OWNER",s.ownerHandle??s.ownerName??s.ownerId??"—"],["SPAWNED",s.createdAt?j(s.createdAt):"—"],["STATE",N(s.state)]];return e.jsx("div",{className:"s-focus-tab",children:e.jsx("dl",{className:"s-focus-spec",children:a.map(([l,o])=>e.jsxs("div",{className:"s-focus-spec-row",children:[e.jsx("dt",{className:"s-focus-spec-label",children:l}),e.jsx("dd",{className:"s-focus-spec-value",title:o,children:o})]},l))})})}const T={tool:"▸",think:"·",ask:"?",message:"✉",note:"•",system:"◇",boot:"↑"};function A(s,a){if(a){const o=Date.now()-(a+s*1e3);return o<6e4?`${Math.max(0,Math.round(o/1e3))}s`:o<36e5?`${Math.round(o/6e4)}m`:o<864e5?`${Math.round(o/36e5)}h`:`${Math.round(o/864e5)}d`}const l=Math.max(0,Math.round(s));return l<60?`${l}s`:l<3600?`${Math.round(l/60)}m`:`${Math.round(l/3600)}h`}function I(s){if(s.kind==="tool"){const a=s.tool??"tool";return s.arg?`${a} · ${s.arg}`:a}return s.kind==="ask"?s.text||"request received":s.text||s.detail||k[s.kind]||s.kind}function D({agent:s,observe:a,onOpenConversation:l,onMessage:o}){const r=a?.events??[],d=a?.metadata?.usage,h=typeof a?.metadata?.session?.sessionStart=="number"?(a?.metadata?.session).sessionStart:null,p=r.slice(-14).reverse(),m=d?.assistantMessages??r.filter(t=>t.kind==="message").length,u=r.filter(t=>t.kind==="tool").length,i=r.filter(t=>t.kind==="tool"&&(t.tool==="edit"||t.tool==="write")).length,n=a?.contextUsage&&a.contextUsage.length>0?Math.round(a.contextUsage[a.contextUsage.length-1]*100):null,c=n!==null?`${n}%`:d?.contextWindowTokens&&d?.contextInputTokens?`${Math.round(d.contextInputTokens/d.contextWindowTokens*100)}%`:"—";return e.jsxs("div",{className:"s-focus-tab s-focus-tab--activity-preview",children:[e.jsxs("dl",{className:"s-focus-stats",children:[e.jsx(b,{label:"Turns",value:m||"—"}),e.jsx(b,{label:"Tools",value:u||"—"}),e.jsx(b,{label:"Edits",value:i||"—"}),e.jsx(b,{label:"Context",value:c})]}),p.length===0?e.jsx(L,{agent:s,onOpenConversation:l,onMessage:o}):e.jsx("ul",{className:"s-focus-activity-list",children:p.map(t=>e.jsxs("li",{className:`s-focus-activity-row s-focus-activity-row--${t.kind}`,children:[e.jsx("span",{className:"s-focus-activity-time",children:A(t.t,h)}),e.jsx("span",{className:"s-focus-activity-glyph","aria-hidden":!0,children:T[t.kind]??"·"}),e.jsx("span",{className:"s-focus-activity-kind",children:k[t.kind]??t.kind}),e.jsx("span",{className:"s-focus-activity-text",children:I(t)})]},t.id))})]})}function L({agent:s,onOpenConversation:a,onMessage:l}){const o=M(s.role),r=[s.harness,s.model].filter(Boolean).join("/"),d=[s.project,s.branch].filter(Boolean).join("/"),h=$(s.state),p=N(h),m=s.createdAt?j(s.createdAt):null,u=s.updatedAt?j(s.updatedAt):null,i=s.homeNodeName??s.homeNodeId,n=s.ownerHandle??s.ownerName??s.ownerId,c=[];return o&&c.push({label:"Role",value:o}),r&&c.push({label:"Stack",value:r}),d&&c.push({label:"At",value:d}),i&&c.push({label:"Home",value:i}),n&&c.push({label:"Owner",value:n}),m&&c.push({label:"Spawned",value:m}),c.push({label:"State",value:p}),u&&c.push({label:"Last seen",value:u}),e.jsxs("div",{className:"s-focus-activity-empty s-focus-activity-empty--rich",children:[e.jsxs("div",{className:"s-focus-activity-empty-head",children:[e.jsx("span",{className:"s-focus-activity-empty-eyebrow",children:"No tool or turn events recorded"}),e.jsx("span",{className:"s-focus-activity-empty-title",children:s.handle??s.name})]}),e.jsx("dl",{className:"s-focus-activity-empty-facts",children:c.map(t=>e.jsxs("div",{className:"s-focus-activity-empty-fact",children:[e.jsx("dt",{children:t.label}),e.jsx("dd",{title:t.value,children:t.value})]},t.label))}),e.jsxs("div",{className:"s-focus-activity-empty-actions",children:[e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn",onClick:a,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"}),e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn s-focus-activity-empty-btn--primary",onClick:l,...v({label:`Compose message · ${s.handle??s.name}`}),children:"Send a message"})]})]})}function b({label:s,value:a}){return e.jsxs("div",{className:"s-focus-stat",children:[e.jsx("dt",{className:"s-focus-stat-label",children:s}),e.jsx("dd",{className:"s-focus-stat-value",children:a})]})}function O({agent:s,onSend:a,onOpenConversation:l}){const[o,r]=f.useState(""),[d,h]=f.useState(!1),[p,m]=f.useState(!1),[u,i]=f.useState(null),n=f.useRef(null);f.useEffect(()=>{n.current?.focus()},[]);const c=async()=>{const y=o.trim();if(!(!y||d)){h(!0),i(null);try{await a(y),r(""),m(!0),setTimeout(()=>m(!1),1800)}catch(x){i(x instanceof Error?x.message:String(x))}finally{h(!1)}}},t=s.handle??s.name;return e.jsx("div",{className:"s-focus-tab",children:e.jsx("div",{className:"s-focus-compose",children:e.jsx(S,{density:"panel",value:o,onChange:r,onSend:()=>{c()},sending:d,placeholder:`Message @${t}…`,textareaRef:n,rows:4,"aria-label":`Message @${t}`,header:e.jsxs("div",{className:"s-focus-compose-label",children:["Message ",e.jsxs("span",{className:"s-focus-compose-target",children:["@",t]})]}),tools:e.jsx("div",{className:"s-focus-compose-hint",children:u?e.jsxs("span",{className:"s-focus-compose-error",children:["Send failed: ",u]}):p?e.jsxs("span",{className:"s-focus-compose-ok",children:["Sent ↗"," ",e.jsx("button",{type:"button",className:"s-focus-compose-link",onClick:l,children:"Open Chat"})]}):e.jsx("span",{children:"Send starts a Run, or steers the active Run when this agent is already working."})})})})})}export{Q as FocusOverlay};
@@ -0,0 +1 @@
1
+ import{j as l}from"./index-BZovGpDk.js";import{c as j}from"./colors-BtO5_zlx.js";import{s as x}from"./page-status-Bg2hd27j.js";import{t as i}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-bRkkXIpR.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";function E({agent:e,state:t,isExpanded:s,isSelected:a,tabIndex:n,onToggle:c,onReveal:m,onOpen:d}){const r=x({label:`Focus ${e.handle??e.name}`,route:`/ops/control · ${e.id}`}),p=l.jsxs(l.Fragment,{children:[l.jsxs("dl",{className:"rr-spec-list",children:[l.jsx(o,{label:"MODEL",value:[e.harness,e.model].filter(Boolean).join("/")||"—"}),l.jsx(o,{label:"AT",value:[e.project,e.branch].filter(Boolean).join("/")||"—"}),l.jsx(o,{label:"STATE",value:j(t)}),l.jsx(o,{label:"ACTIVITY",value:e.activity}),l.jsx(o,{label:"SOURCE",value:e.source})]}),l.jsxs("div",{className:"ml-detail-actions",children:[l.jsx("button",{type:"button",className:"ml-detail-btn",onClick:m,children:"Reveal on wall"}),l.jsx("button",{type:"button",className:"ml-detail-btn ml-detail-btn--primary",onClick:d,children:"Open ↗"})]})]});return l.jsx(b,{name:e.handle??e.name,meta:e.lastActiveAt?i(e.lastActiveAt):e.updatedAt?i(e.updatedAt):void 0,tone:t,caret:s?"open":"closed",selected:a,expanded:s,detail:p,tabIndex:n,onClick:u=>c(u),onPointerEnter:r.onPointerEnter,onPointerLeave:r.onPointerLeave})}function o({label:e,value:t}){return l.jsxs("div",{className:"rr-spec",children:[l.jsx("dt",{className:"rr-spec-label",children:e}),l.jsx("dd",{className:"rr-spec-value",title:t,children:t})]})}export{E as MissionLeftAgentRow};
@@ -0,0 +1 @@
1
+ import{r as n,j as a}from"./index-BZovGpDk.js";import{H as L}from"./HarnessMark-DrE57dUq.js";import{n as k}from"./colors-BtO5_zlx.js";import{s as y}from"./page-status-Bg2hd27j.js";import{c as P,T as I,b as T}from"./tail-display-BRcJltQa.js";import{d as A}from"./time-Dhsh_2EG.js";import{s as C}from"./mission-control-model-C0fByIjm.js";import{m as H,a as E}from"./mission-wall-CocIM1cF.js";import"./lane-edit-display-C_Aujldz.js";const K=24;function O({log:e,selected:u,revealed:f,cursor:t=!1,onOpen:c,onToggleSelected:h,onOpenLog:w,paneRef:x}){const i=n.useRef(null),p=n.useRef(!0),o=n.useMemo(()=>P(e.lines.map(s=>({event:s,meta:void 0}))),[e.lines]),j=n.useCallback(()=>{const s=i.current;if(!s)return;const l=s.scrollHeight-s.scrollTop-s.clientHeight;p.current=l<=K},[]);n.useEffect(()=>{const s=i.current;!s||!p.current||(s.scrollTop=s.scrollHeight)},[o.length,e.lastActiveAt]);const v=k(e.agent?.state??null),r=H(e),N=E(e),m=[e.project,e.agent?.branch].filter(Boolean).join("/")||e.cwd||"—",d=y({label:`Focus ${r}`,route:`/ops/control · ${e.sessionId}`}),b=s=>{if(s.metaKey||s.ctrlKey||s.shiftKey){h();return}c()};return a.jsxs("div",{ref:x,className:["s-wall-pane",e.live?"s-wall-pane--live":null,u?"s-wall-pane--selected":null,f?"s-wall-pane--revealed":null,t?"s-wall-pane--cursor":null].filter(Boolean).join(" "),"data-cursor":t?!0:void 0,tabIndex:t?0:-1,onClick:b,onPointerEnter:d.onPointerEnter,onPointerLeave:d.onPointerLeave,children:[a.jsxs("div",{className:"s-wall-pane-head",children:[a.jsx("span",{className:"s-wall-pane-dot",style:{background:e.agent?C(v):"var(--dim)"},"aria-hidden":!0}),a.jsx(L,{harness:e.source,size:11,title:null}),a.jsx("button",{type:"button",className:"s-wall-pane-title",title:e.agent?.name??e.sessionId,"aria-label":`Focus ${r}`,onClick:s=>{s.stopPropagation(),c()},children:r}),a.jsx("span",{className:"s-wall-pane-where",title:e.cwd??m,children:m}),a.jsx("span",{className:"s-wall-pane-spacer"}),e.live&&a.jsx("span",{className:"s-wall-pane-live",children:"live"}),a.jsx("button",{type:"button",className:"s-wall-pane-file",title:e.logPath??`session ${e.sessionId}`,onClick:s=>{s.stopPropagation(),w()},children:N})]}),a.jsx("div",{className:"s-wall-pane-body",ref:i,onScroll:j,children:o.length===0?a.jsx("div",{className:"s-wall-pane-idle",children:"no output since page load"}):o.map(({event:s,repeatCount:l})=>a.jsxs("div",{className:`s-wall-line s-wall-line--${s.kind}`,children:[a.jsx("span",{className:"s-wall-line-time",children:A(s.ts,{milliseconds:!1})||"—"}),a.jsx("span",{className:"s-wall-line-glyph",title:T[s.kind],children:I[s.kind]}),a.jsxs("span",{className:"s-wall-line-text",children:[s.summary,l>1&&a.jsxs("span",{className:"s-wall-line-repeat",title:`${l} identical events`,children:[" ","×",l]})]})]},s.id))})]})}export{O as MissionLogPane};
@@ -1 +1 @@
1
- import{r,j as e}from"./index-NRbRrZw-.js";import{r as se}from"./index-CD2foMB8.js";import{a as U}from"./api-DEHEgJ9m.js";import{u as ne}from"./keyboard-nav-feLCB3Zm.js";import{o as te}from"./openContent-C6XO6kr5.js";import{s as A,w as le}from"./project-overview-helpers-BQTc_Ous.js";import{X as ie}from"./x-DuzAbpk5.js";import{R as re}from"./rocket-BahfIwFz.js";import"./createLucideIcon-Da0lq809.js";const V=[{value:"codex",label:"Codex",runtimeId:"codex"},{value:"claude",label:"Claude",runtimeId:"claude"},{value:"pi",label:"Grok",runtimeId:"pi"}];function w(t){return t.trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function oe(t){const n=new Set;for(const o of t){if(!o)continue;const s=w(o);s&&n.add(s)}return n}function ce(t,n,o){const s=t.trim();if(!s)return{status:"auto",normalized:void 0,rewritten:!1,message:o==="sticky"?"Scout will assign a reusable handle from the name pool.":"Scout will assign a disposable handle from the name pool.",tone:"ok"};const l=w(s);return l?n.has(l)?{status:"conflict",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:`@${l} already exists here. Pick another handle or leave it blank for auto.`,tone:"warn"}:{status:"ok",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:null,tone:"ok"}:{status:"invalid",normalized:void 0,rewritten:!1,message:"Use letters, numbers, dot, or dash.",tone:"warn"}}function S(t){return t==="pi"?"grok":t}function de(t,n,o,s=3){const l=w(t)??"agent",m=[l,`${l}-${S(n)}`,`${l}-dev`,`${l}-2`,`${l}-${S(n)}-2`],u=[];for(const v of m){const x=w(v);if(!(!x||o.has(x)||u.includes(x))&&(u.push(x),u.length>=s))break}return u}function ue(t){const{handle:n,persistence:o,harness:s,projectRootLabel:l}=t,m="A card starts a fresh session for each request. Use session:<id> only to continue an exact run.";return o==="one_time"?{disposable:!0,card:null,cli:`scout ask --project ${l} --harness ${s} "…"`,resolves:"Disposable session — Scout assigns a provisional handle that may be recycled. Not addressable later.",note:m}:n?{disposable:!1,card:`@${n}`,cli:`scout ask @${n} "…"`,resolves:`Reusable ${S(s)} session on this project — @${n} routes here from any surface.`,note:m}:{disposable:!1,card:"@auto",cli:'scout ask @<assigned-handle> "…"',resolves:`Scout assigns a reusable ${S(s)} handle from the name pool.`,note:m}}const me={ready:"ready",configured:"configured",installed:"login needed",missing:"not found"},q={ready:"ok",configured:"ok",installed:"warn",missing:"off"};function ke({open:t,onClose:n,projectTitle:o,projectRoot:s,primaryWt:l,worktreeCount:m,branches:u,existingAgents:v,agentCount:x,sessionCount:H,route:D,navigate:C}){const{ref:J,onKeyDown:W}=ne(t),[h,G]=r.useState("codex"),[M,X]=r.useState(""),[d,E]=r.useState("sticky"),[$,P]=r.useState(""),[R,Q]=r.useState(""),[L,I]=r.useState("idle"),[_,j]=r.useState(null),[K,Y]=r.useState(null);r.useEffect(()=>{t&&(j(null),I("idle"))},[t]),r.useEffect(()=>{if(!t)return;let a=!1;return(async()=>{const c=await U("/api/agent-config/snapshot").catch(()=>null);if(a||!c)return;const f=new Map;for(const g of c.runtimes)f.set(g.id,{state:g.state,detail:g.detail,loginCommand:g.loginCommand});Y(f)})(),()=>{a=!0}},[t]),r.useEffect(()=>{if(!t)return;const a=c=>{c.key==="Escape"&&(c.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,n]);const k=r.useMemo(()=>oe(v.flatMap(a=>[a.name,a.handle])),[v]),i=r.useMemo(()=>ce($,k,d),[$,k,d]),z=r.useMemo(()=>de(o,h,k,3),[o,h,k]),T=s?A(s):"<no-root>",p=r.useMemo(()=>ue({handle:i.normalized,persistence:d,harness:h,projectRootLabel:T}),[i.normalized,d,h,T]),N=K?.get(V.find(a=>a.value===h)?.runtimeId??h);if(!t)return null;const Z=!!s&&L!=="starting"&&i.status!=="invalid"&&i.status!=="conflict",ee=L==="starting"?"Starting…":d==="one_time"?"Dispatch one-off":i.status==="conflict"?"Handle exists":i.normalized?`Create @${i.normalized}`:"Create with auto handle",O=async()=>{if(!(!s||L==="starting")){I("starting"),j(null);try{const a=M.trim(),c=R.trim(),f=i.normalized,g=await U("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:s},execution:{session:"new",harness:h,...a?{model:a}:{}},agent:{persistence:d,...f?{handle:f}:{}},...c?{seed:{instructions:c}}:{}})}),B=g.agentId?.trim(),F=g.sessionId?.trim(),y=g.conversationId?.trim();if(F){n(),te(C,{view:"sessions",sessionId:F},{returnTo:D});return}if(B){n(),C({...D,view:"agents-v2",agentId:B,selectedAgentId:void 0,sessionId:void 0,...y?{conversationId:y,tab:"message"}:{tab:"profile"}});return}if(y){n(),C({view:"conversation",conversationId:y});return}j("Agent start was accepted, but no target came back.")}catch(a){j(a instanceof Error?a.message:"Could not start an agent.")}finally{I("idle")}}},ae=a=>{if((a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault(),O();return}W(a)},b=[];return b.push({label:"root",value:s?A(s):"no project root",title:s??void 0}),l?b.push({label:"branch",value:le(l),title:l.path}):u.length>0&&b.push({label:"branch",value:u.length===1?u[0]:`${u.length} branches`}),m>1&&b.push({label:"worktrees",value:String(m)}),b.push({label:"existing",value:`${x} agent${x===1?"":"s"} · ${H} session${H===1?"":"s"}`}),se.createPortal(e.jsx("div",{className:"na-backdrop",role:"presentation",onClick:n,children:e.jsxs("div",{ref:J,className:"na-panel",role:"dialog","aria-modal":"true","aria-labelledby":"na-title",tabIndex:-1,onClick:a=>a.stopPropagation(),onKeyDown:ae,children:[e.jsxs("header",{className:"na-head",children:[e.jsxs("div",{className:"na-headIdent",children:[e.jsx("h2",{id:"na-title",className:"na-title",children:"New agent"}),e.jsxs("span",{className:"na-scope",children:["/",o]})]}),e.jsx("button",{type:"button",className:"na-close",onClick:n,"aria-label":"Close (Esc)",children:e.jsx(ie,{size:14,strokeWidth:2,"aria-hidden":!0})})]}),e.jsx("div",{className:"na-context",children:b.map(a=>e.jsxs("span",{className:"na-contextChip",title:a.title,children:[e.jsx("span",{className:"na-contextLabel",children:a.label}),e.jsx("span",{className:"na-contextValue",children:a.value})]},a.label))}),e.jsxs("div",{className:"na-body",children:[e.jsxs("section",{className:"na-section na-modeSection",children:[e.jsx("span",{className:"na-sectionLabel",children:"What are you creating?"}),e.jsxs("div",{className:"na-modeChoice",role:"radiogroup","aria-label":"Agent kind",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="one_time",className:"na-modeCard","data-active":d==="one_time"||void 0,onClick:()=>E("one_time"),children:[e.jsx("span",{className:"na-modeTitle",children:"One-off run"}),e.jsx("span",{className:"na-modeSub",children:"Disposable session · not addressable later"})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="sticky",className:"na-modeCard","data-active":d==="sticky"||void 0,onClick:()=>E("sticky"),children:[e.jsx("span",{className:"na-modeTitle",children:"Named agent"}),e.jsx("span",{className:"na-modeSub",children:"Reusable card · addressable by handle"})]})]})]}),e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Runtime"}),e.jsx("div",{className:"na-harnessRow",role:"radiogroup","aria-label":"Harness",children:V.map(a=>{const c=K?.get(a.runtimeId),f=h===a.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":f,className:"na-harness","data-active":f||void 0,onClick:()=>G(a.value),children:[e.jsx("span",{className:"na-harnessName",children:a.label}),c?e.jsxs("span",{className:"na-harnessState","data-tone":q[c.state],children:[e.jsx("span",{className:"na-dot","aria-hidden":!0}),me[c.state]]}):e.jsx("span",{className:"na-harnessState","data-tone":"off",children:"…"})]},a.value)})}),N&&N.state!=="ready"?e.jsxs("p",{className:"na-readinessNote","data-tone":q[N.state],children:[N.detail,N.loginCommand?e.jsxs("code",{className:"na-code",children:[" ",N.loginCommand]}):null]}):null,e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Model / profile"}),e.jsx("input",{value:M,placeholder:"default",onChange:a=>X(a.currentTarget.value)})]})]}),d==="sticky"?e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Handle (optional)"}),e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Address"}),e.jsxs("div",{className:"na-handleWrap","data-tone":i.tone,children:[e.jsx("span",{className:"na-handleAt",children:"@"}),e.jsx("input",{value:$,placeholder:z[0]??"auto","aria-invalid":i.tone==="warn",autoFocus:!0,onChange:a=>P(a.currentTarget.value)})]})]}),z.length>0?e.jsxs("div",{className:"na-suggestRow",children:[e.jsx("span",{className:"na-suggestLabel",children:"suggest"}),z.map(a=>e.jsxs("button",{type:"button",className:"na-suggest",onClick:()=>P(a),children:["@",a]},a))]}):null,i.message?e.jsx("p",{className:"na-validation","data-tone":i.tone,children:i.message}):i.rewritten&&i.normalized?e.jsxs("p",{className:"na-validation","data-tone":"ok",children:["Saved as ",e.jsxs("code",{className:"na-code",children:["@",i.normalized]})]}):null]}):null,e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"First instruction"}),e.jsx("textarea",{className:"na-prompt",value:R,rows:3,placeholder:`Start in /${o}…`,onChange:a=>Q(a.currentTarget.value)})]}),e.jsxs("section",{className:"na-section na-routing",children:[e.jsx("span",{className:"na-sectionLabel",children:p.disposable?"Dispatch preview":"Routing preview"}),p.disposable?e.jsxs("div",{className:"na-routingBody","data-disposable":!0,children:[e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("button",{type:"button",className:"na-promote",onClick:()=>E("sticky"),children:"Name it to keep it →"})]}):e.jsxs("div",{className:"na-routingBody",children:[p.card?e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"address"}),e.jsx("code",{className:"na-routingValue na-routingCard",children:p.card})]}):null,e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"cli"}),e.jsx("code",{className:"na-routingValue",children:p.cli})]}),e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("p",{className:"na-routingNote",children:p.note})]})]})]}),_?e.jsx("div",{className:"na-error",children:_}):null,e.jsxs("footer",{className:"na-foot",children:[e.jsx("span",{className:"na-footRoot",title:s??void 0,children:s?A(s):"No project root — cannot create."}),e.jsxs("div",{className:"na-footActions",children:[e.jsx("button",{type:"button",className:"na-cancel",onClick:n,children:"Cancel"}),e.jsxs("button",{type:"button",className:"na-create",disabled:!Z,onClick:()=>{O()},children:[e.jsx(re,{size:12,strokeWidth:2,"aria-hidden":!0}),ee]})]})]})]})}),document.body)}export{ke as NewAgentModal};
1
+ import{r,j as e}from"./index-BZovGpDk.js";import{r as se}from"./index-DiiEQwdc.js";import{a as U}from"./api-h5zurxmi.js";import{u as ne}from"./keyboard-nav-CHo_xmjw.js";import{o as te}from"./openContent-C6XO6kr5.js";import{s as A,w as le}from"./project-overview-helpers-BQTc_Ous.js";import{X as ie}from"./x-CrGUKNRv.js";import{R as re}from"./rocket-BWh18pt_.js";import"./createLucideIcon-DCq_3fQn.js";const V=[{value:"codex",label:"Codex",runtimeId:"codex"},{value:"claude",label:"Claude",runtimeId:"claude"},{value:"pi",label:"Grok",runtimeId:"pi"}];function w(t){return t.trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function oe(t){const n=new Set;for(const o of t){if(!o)continue;const s=w(o);s&&n.add(s)}return n}function ce(t,n,o){const s=t.trim();if(!s)return{status:"auto",normalized:void 0,rewritten:!1,message:o==="sticky"?"Scout will assign a reusable handle from the name pool.":"Scout will assign a disposable handle from the name pool.",tone:"ok"};const l=w(s);return l?n.has(l)?{status:"conflict",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:`@${l} already exists here. Pick another handle or leave it blank for auto.`,tone:"warn"}:{status:"ok",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:null,tone:"ok"}:{status:"invalid",normalized:void 0,rewritten:!1,message:"Use letters, numbers, dot, or dash.",tone:"warn"}}function S(t){return t==="pi"?"grok":t}function de(t,n,o,s=3){const l=w(t)??"agent",m=[l,`${l}-${S(n)}`,`${l}-dev`,`${l}-2`,`${l}-${S(n)}-2`],u=[];for(const v of m){const x=w(v);if(!(!x||o.has(x)||u.includes(x))&&(u.push(x),u.length>=s))break}return u}function ue(t){const{handle:n,persistence:o,harness:s,projectRootLabel:l}=t,m="A card starts a fresh session for each request. Use session:<id> only to continue an exact run.";return o==="one_time"?{disposable:!0,card:null,cli:`scout ask --project ${l} --harness ${s} "…"`,resolves:"Disposable session — Scout assigns a provisional handle that may be recycled. Not addressable later.",note:m}:n?{disposable:!1,card:`@${n}`,cli:`scout ask @${n} "…"`,resolves:`Reusable ${S(s)} session on this project — @${n} routes here from any surface.`,note:m}:{disposable:!1,card:"@auto",cli:'scout ask @<assigned-handle> "…"',resolves:`Scout assigns a reusable ${S(s)} handle from the name pool.`,note:m}}const me={ready:"ready",configured:"configured",installed:"login needed",missing:"not found"},q={ready:"ok",configured:"ok",installed:"warn",missing:"off"};function ke({open:t,onClose:n,projectTitle:o,projectRoot:s,primaryWt:l,worktreeCount:m,branches:u,existingAgents:v,agentCount:x,sessionCount:H,route:D,navigate:C}){const{ref:J,onKeyDown:W}=ne(t),[h,G]=r.useState("codex"),[M,X]=r.useState(""),[d,E]=r.useState("sticky"),[$,P]=r.useState(""),[R,Q]=r.useState(""),[L,I]=r.useState("idle"),[_,j]=r.useState(null),[K,Y]=r.useState(null);r.useEffect(()=>{t&&(j(null),I("idle"))},[t]),r.useEffect(()=>{if(!t)return;let a=!1;return(async()=>{const c=await U("/api/agent-config/snapshot").catch(()=>null);if(a||!c)return;const f=new Map;for(const g of c.runtimes)f.set(g.id,{state:g.state,detail:g.detail,loginCommand:g.loginCommand});Y(f)})(),()=>{a=!0}},[t]),r.useEffect(()=>{if(!t)return;const a=c=>{c.key==="Escape"&&(c.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,n]);const k=r.useMemo(()=>oe(v.flatMap(a=>[a.name,a.handle])),[v]),i=r.useMemo(()=>ce($,k,d),[$,k,d]),z=r.useMemo(()=>de(o,h,k,3),[o,h,k]),T=s?A(s):"<no-root>",p=r.useMemo(()=>ue({handle:i.normalized,persistence:d,harness:h,projectRootLabel:T}),[i.normalized,d,h,T]),N=K?.get(V.find(a=>a.value===h)?.runtimeId??h);if(!t)return null;const Z=!!s&&L!=="starting"&&i.status!=="invalid"&&i.status!=="conflict",ee=L==="starting"?"Starting…":d==="one_time"?"Dispatch one-off":i.status==="conflict"?"Handle exists":i.normalized?`Create @${i.normalized}`:"Create with auto handle",O=async()=>{if(!(!s||L==="starting")){I("starting"),j(null);try{const a=M.trim(),c=R.trim(),f=i.normalized,g=await U("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:s},execution:{session:"new",harness:h,...a?{model:a}:{}},agent:{persistence:d,...f?{handle:f}:{}},...c?{seed:{instructions:c}}:{}})}),B=g.agentId?.trim(),F=g.sessionId?.trim(),y=g.conversationId?.trim();if(F){n(),te(C,{view:"sessions",sessionId:F},{returnTo:D});return}if(B){n(),C({...D,view:"agents-v2",agentId:B,selectedAgentId:void 0,sessionId:void 0,...y?{conversationId:y,tab:"message"}:{tab:"profile"}});return}if(y){n(),C({view:"conversation",conversationId:y});return}j("Agent start was accepted, but no target came back.")}catch(a){j(a instanceof Error?a.message:"Could not start an agent.")}finally{I("idle")}}},ae=a=>{if((a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault(),O();return}W(a)},b=[];return b.push({label:"root",value:s?A(s):"no project root",title:s??void 0}),l?b.push({label:"branch",value:le(l),title:l.path}):u.length>0&&b.push({label:"branch",value:u.length===1?u[0]:`${u.length} branches`}),m>1&&b.push({label:"worktrees",value:String(m)}),b.push({label:"existing",value:`${x} agent${x===1?"":"s"} · ${H} session${H===1?"":"s"}`}),se.createPortal(e.jsx("div",{className:"na-backdrop",role:"presentation",onClick:n,children:e.jsxs("div",{ref:J,className:"na-panel",role:"dialog","aria-modal":"true","aria-labelledby":"na-title",tabIndex:-1,onClick:a=>a.stopPropagation(),onKeyDown:ae,children:[e.jsxs("header",{className:"na-head",children:[e.jsxs("div",{className:"na-headIdent",children:[e.jsx("h2",{id:"na-title",className:"na-title",children:"New agent"}),e.jsxs("span",{className:"na-scope",children:["/",o]})]}),e.jsx("button",{type:"button",className:"na-close",onClick:n,"aria-label":"Close (Esc)",children:e.jsx(ie,{size:14,strokeWidth:2,"aria-hidden":!0})})]}),e.jsx("div",{className:"na-context",children:b.map(a=>e.jsxs("span",{className:"na-contextChip",title:a.title,children:[e.jsx("span",{className:"na-contextLabel",children:a.label}),e.jsx("span",{className:"na-contextValue",children:a.value})]},a.label))}),e.jsxs("div",{className:"na-body",children:[e.jsxs("section",{className:"na-section na-modeSection",children:[e.jsx("span",{className:"na-sectionLabel",children:"What are you creating?"}),e.jsxs("div",{className:"na-modeChoice",role:"radiogroup","aria-label":"Agent kind",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="one_time",className:"na-modeCard","data-active":d==="one_time"||void 0,onClick:()=>E("one_time"),children:[e.jsx("span",{className:"na-modeTitle",children:"One-off run"}),e.jsx("span",{className:"na-modeSub",children:"Disposable session · not addressable later"})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="sticky",className:"na-modeCard","data-active":d==="sticky"||void 0,onClick:()=>E("sticky"),children:[e.jsx("span",{className:"na-modeTitle",children:"Named agent"}),e.jsx("span",{className:"na-modeSub",children:"Reusable card · addressable by handle"})]})]})]}),e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Runtime"}),e.jsx("div",{className:"na-harnessRow",role:"radiogroup","aria-label":"Harness",children:V.map(a=>{const c=K?.get(a.runtimeId),f=h===a.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":f,className:"na-harness","data-active":f||void 0,onClick:()=>G(a.value),children:[e.jsx("span",{className:"na-harnessName",children:a.label}),c?e.jsxs("span",{className:"na-harnessState","data-tone":q[c.state],children:[e.jsx("span",{className:"na-dot","aria-hidden":!0}),me[c.state]]}):e.jsx("span",{className:"na-harnessState","data-tone":"off",children:"…"})]},a.value)})}),N&&N.state!=="ready"?e.jsxs("p",{className:"na-readinessNote","data-tone":q[N.state],children:[N.detail,N.loginCommand?e.jsxs("code",{className:"na-code",children:[" ",N.loginCommand]}):null]}):null,e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Model / profile"}),e.jsx("input",{value:M,placeholder:"default",onChange:a=>X(a.currentTarget.value)})]})]}),d==="sticky"?e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Handle (optional)"}),e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Address"}),e.jsxs("div",{className:"na-handleWrap","data-tone":i.tone,children:[e.jsx("span",{className:"na-handleAt",children:"@"}),e.jsx("input",{value:$,placeholder:z[0]??"auto","aria-invalid":i.tone==="warn",autoFocus:!0,onChange:a=>P(a.currentTarget.value)})]})]}),z.length>0?e.jsxs("div",{className:"na-suggestRow",children:[e.jsx("span",{className:"na-suggestLabel",children:"suggest"}),z.map(a=>e.jsxs("button",{type:"button",className:"na-suggest",onClick:()=>P(a),children:["@",a]},a))]}):null,i.message?e.jsx("p",{className:"na-validation","data-tone":i.tone,children:i.message}):i.rewritten&&i.normalized?e.jsxs("p",{className:"na-validation","data-tone":"ok",children:["Saved as ",e.jsxs("code",{className:"na-code",children:["@",i.normalized]})]}):null]}):null,e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"First instruction"}),e.jsx("textarea",{className:"na-prompt",value:R,rows:3,placeholder:`Start in /${o}…`,onChange:a=>Q(a.currentTarget.value)})]}),e.jsxs("section",{className:"na-section na-routing",children:[e.jsx("span",{className:"na-sectionLabel",children:p.disposable?"Dispatch preview":"Routing preview"}),p.disposable?e.jsxs("div",{className:"na-routingBody","data-disposable":!0,children:[e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("button",{type:"button",className:"na-promote",onClick:()=>E("sticky"),children:"Name it to keep it →"})]}):e.jsxs("div",{className:"na-routingBody",children:[p.card?e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"address"}),e.jsx("code",{className:"na-routingValue na-routingCard",children:p.card})]}):null,e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"cli"}),e.jsx("code",{className:"na-routingValue",children:p.cli})]}),e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("p",{className:"na-routingNote",children:p.note})]})]})]}),_?e.jsx("div",{className:"na-error",children:_}):null,e.jsxs("footer",{className:"na-foot",children:[e.jsx("span",{className:"na-footRoot",title:s??void 0,children:s?A(s):"No project root — cannot create."}),e.jsxs("div",{className:"na-footActions",children:[e.jsx("button",{type:"button",className:"na-cancel",onClick:n,children:"Cancel"}),e.jsxs("button",{type:"button",className:"na-create",disabled:!Z,onClick:()=>{O()},children:[e.jsx(re,{size:12,strokeWidth:2,"aria-hidden":!0}),ee]})]})]})]})}),document.body)}export{ke as NewAgentModal};