@openscout/scout 0.2.80 → 0.2.83

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 (358) hide show
  1. package/README.md +1 -1
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +4 -4
  4. package/dist/client/assets/ActivityScreen-aewI4Ul1.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-CtEiLQnm.js → AddProjectForm-Czb5uwou.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-CszU5eaU.js → AgentAvatar-DMov24_o.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-BjG6ECjl.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-D4MbSMXp.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-sZuHl1de.js → AgentDetailCard-Biq8b2gv.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-h9KDJdw0.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-SjhK_SBh.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-nB68f2CI.js → AgentLaneCard-C4DMQR-c.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-O9Yf0uR-.js → AgentLaneChrome-D1xNNf7A.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-BfhpaEQ3.js → AgentLaneDetailSheet-DnAKe4e3.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-Ct3b0TQR.js → AgentLaneSummaryResize-C9loK-st.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BNOYF16R.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-DNGvZvjd.js → AgentLanesPreflight-M7iDXdP2.js} +1 -1
  18. package/dist/client/assets/{AgentLanesView-DqRK5-d2.js → AgentLanesView-Ct-Gz5WD.js} +1 -1
  19. package/dist/client/assets/{AgentLiveActions-DI4ooSHW.js → AgentLiveActions-0iy8QZ1T.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-BxWIPkWh.js → AgentSessions-CDfSfNiE.js} +2 -2
  21. package/dist/client/assets/{AgentsConsole-D6VHSCfZ.js → AgentsConsole-BVxhBqRa.js} +1 -1
  22. package/dist/client/assets/AgentsScreen-Bww6HgFs.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-CiIuzxnZ.js +1 -0
  24. package/dist/client/assets/{AtopView-VZkk40v0.js → AtopView-h_aFoNkP.js} +1 -1
  25. package/dist/client/assets/BackToPicker-BXp5E2ck.js +1 -0
  26. package/dist/client/assets/{BriefingDetailScreen-BZU4qMwE.js → BriefingDetailScreen-C83o2YfN.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-Bfc3tqPp.js → BriefingsScreen-BTsvr5fv.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-CaFe6kdh.js → BrokerMetadataPanel-jg7odHQp.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-DplF8d_X.js +5 -0
  30. package/dist/client/assets/Canvas-BePL08RR.js +1 -0
  31. package/dist/client/assets/{ChatCollapsedStrip-Cov54p9V.js → ChatCollapsedStrip-BRljIymi.js} +1 -1
  32. package/dist/client/assets/{CodeDiffPane-C1ebFt-Y.js → CodeDiffPane-86odpBSt.js} +1 -1
  33. package/dist/client/assets/{CodeProjectPicker-tsCly-f3.js → CodeProjectPicker-8svr_S_A.js} +1 -1
  34. package/dist/client/assets/{CodeScreen-D0hpZNLP.js → CodeScreen-CJ2RgB32.js} +1 -1
  35. package/dist/client/assets/{ContextMenu-N-Z6X0Z1.js → ContextMenu-CxkmFQcN.js} +1 -1
  36. package/dist/client/assets/{ConversationComposer-CiEF7dhd.js → ConversationComposer-CWohCCmn.js} +1 -1
  37. package/dist/client/assets/ConversationFeedRows-IWh0JSIL.js +1 -0
  38. package/dist/client/assets/{ConversationHeader-BGgbITvr.js → ConversationHeader-BxTzXl8e.js} +1 -1
  39. package/dist/client/assets/ConversationPanels-D9UCwNkS.js +2 -0
  40. package/dist/client/assets/ConversationScreen-oZSitVtX.js +1 -0
  41. package/dist/client/assets/{ConversationStatus-COEj5loj.js → ConversationStatus-B6pAbo2w.js} +1 -1
  42. package/dist/client/assets/{DataTable-BoofV-_4.js → DataTable-CGw5CECG.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-OXYlMbT1.js → DispatchAftermath-DowTb7uO.js} +1 -1
  44. package/dist/client/assets/{DocumentFocusViewer-BCG2kOmd.js → DocumentFocusViewer-DRKjNG9s.js} +1 -1
  45. package/dist/client/assets/{EmbeddableSurfacesLab-C2SZvrHJ.js → EmbeddableSurfacesLab-CxfJXS2g.js} +1 -1
  46. package/dist/client/assets/{EmptyState-DypEjx0V.js → EmptyState-BUvllvA6.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-CXCq-oKj.js → FileViewerPane-BM4AD_bo.js} +1 -1
  48. package/dist/client/assets/{FleetSearch-Dj7-CfNi.js → FleetSearch-CYeWn85V.js} +1 -1
  49. package/dist/client/assets/FlightObserveScreen-DYJJ3Z2B.js +1 -0
  50. package/dist/client/assets/{FollowScreen-DRgYuAvp.js → FollowScreen-DG0osbUp.js} +1 -1
  51. package/dist/client/assets/{HarnessMark-BE-YSyci.js → HarnessMark-MztYnrGK.js} +1 -1
  52. package/dist/client/assets/HarnessesScreen-BWqirBjK.js +1 -0
  53. package/dist/client/assets/{HerdrSession-DKFCJMst.js → HerdrSession-6sFln7WX.js} +1 -1
  54. package/dist/client/assets/{HomeHero-CAEg8Yg5.js → HomeHero-BPBArHXa.js} +1 -1
  55. package/dist/client/assets/{KnowledgeSearchInspector-C2EZsQ5i.js → KnowledgeSearchInspector-BOIhFWd2.js} +1 -1
  56. package/dist/client/assets/KnowledgeSearchScreen-BP8tD-Bh.js +1 -0
  57. package/dist/client/assets/{LaneToolHoverCard-DrPXYZvQ.js → LaneToolHoverCard-CcEiQC6B.js} +1 -1
  58. package/dist/client/assets/LaneTraceDetailSheet-B4i1Ut4R.js +1 -0
  59. package/dist/client/assets/{LaneTraceEventFocus-X4-DDFEo.js → LaneTraceEventFocus-Bl9L0EYb.js} +1 -1
  60. package/dist/client/assets/{MeshCanvas-rtCBD7s6.js → MeshCanvas-ZjIuMiRo.js} +1 -1
  61. package/dist/client/assets/{MeshCanvasMinimap-CuvXOkc7.js → MeshCanvasMinimap-C-LQtiX6.js} +1 -1
  62. package/dist/client/assets/MeshScreen-Bs3soujg.js +1 -0
  63. package/dist/client/assets/{MeshTopologyView-CeTShs-U.js → MeshTopologyView-C0LUyT3K.js} +2 -2
  64. package/dist/client/assets/{MessageComposerSuggestions-Cs9u-F_3.js → MessageComposerSuggestions-Dfc3PH2y.js} +1 -1
  65. package/dist/client/assets/MessagesScreen-TgSL5KMc.js +1 -0
  66. package/dist/client/assets/{MissionContextRail-0O-Zu1Tn.js → MissionContextRail-CjGAEGu8.js} +1 -1
  67. package/dist/client/assets/MissionControlView-D629w2A8.js +1 -0
  68. package/dist/client/assets/{MissionFocusOverlay-LnjmqBiW.js → MissionFocusOverlay-Bubrr8Gc.js} +1 -1
  69. package/dist/client/assets/{MissionLeftAgentRow-nc1Jyq3D.js → MissionLeftAgentRow-DokImu4Y.js} +1 -1
  70. package/dist/client/assets/{MissionLogPane-lZ9vUftY.js → MissionLogPane-Cs0LuIkn.js} +1 -1
  71. package/dist/client/assets/{NewAgentModal-K1cvdmZr.js → NewAgentModal-D5e0YUAo.js} +1 -1
  72. package/dist/client/assets/{NewChatComposer-DXDxV2Mh.js → NewChatComposer-S08F6_La.js} +1 -1
  73. package/dist/client/assets/{NewChatOrigin-CnjoswTG.js → NewChatOrigin-BEz6jyqf.js} +1 -1
  74. package/dist/client/assets/{ObserveEmbedScreen-CRpzYf0Y.js → ObserveEmbedScreen-CHx2sEAA.js} +2 -2
  75. package/dist/client/assets/ObserveTextFlow-_ApDwRCO.js +2 -0
  76. package/dist/client/assets/{ObservedTopologyPanel-C1AQM0Mq.js → ObservedTopologyPanel-ByW7Ar7p.js} +1 -1
  77. package/dist/client/assets/OpenScoutAppShell-DTmnbG-h.js +88 -0
  78. package/dist/client/assets/OpsAgentsView-DiFuHcJs.js +1 -0
  79. package/dist/client/assets/OpsScreen-CCR3U_9P.js +1 -0
  80. package/dist/client/assets/OpsSubnav-CZs_OL2N.js +1 -0
  81. package/dist/client/assets/{PlanView-DDXdC19M.js → PlanView-C54eAzig.js} +1 -1
  82. package/dist/client/assets/ProjectAgentProfile-BEfYOaxc.js +1 -0
  83. package/dist/client/assets/{ProjectAgentProfileBar-MODhG0P6.js → ProjectAgentProfileBar-B1VpwzGD.js} +1 -1
  84. package/dist/client/assets/{ProjectAgentProfileHero-C1ImgGDu.js → ProjectAgentProfileHero-B4f_AoCr.js} +1 -1
  85. package/dist/client/assets/ProjectsInbox-DoPZ17FC.js +2 -0
  86. package/dist/client/assets/{ProjectsRail-B1zrQLZe.js → ProjectsRail-CWOkZjsY.js} +1 -1
  87. package/dist/client/assets/ProjectsScreen-Dse0Q6p6.js +1 -0
  88. package/dist/client/assets/ProjectsThreadAside-DMnfyPLE.js +1 -0
  89. package/dist/client/assets/Provider-DKZWuzSR.js +1 -0
  90. package/dist/client/assets/{RailRow-DerXOXQS.js → RailRow-DIGd3MMM.js} +1 -1
  91. package/dist/client/assets/RawSessionsTable-Zkl4YDvz.js +1 -0
  92. package/dist/client/assets/RealtimeVoiceScreen-B_PMJxY_.js +1 -0
  93. package/dist/client/assets/{RepoDiffEmbedScreen-C9oLCcZX.js → RepoDiffEmbedScreen-VLg4caej.js} +1 -1
  94. package/dist/client/assets/{RepoDiffPageScreen-CGEMAv2Z.js → RepoDiffPageScreen-BelnvgnP.js} +1 -1
  95. package/dist/client/assets/{RepoDiffViewer-CB8PSVey.js → RepoDiffViewer-VrUJw33u.js} +1 -1
  96. package/dist/client/assets/RepoDiffViewerLazy-BPg_JkYW.js +2 -0
  97. package/dist/client/assets/{ReposScreen-BN1lVjOj.js → ReposScreen-IINK-CFn.js} +2 -2
  98. package/dist/client/assets/ScoutDeckSurface-MbwGp6Ab.js +1 -0
  99. package/dist/client/assets/{ScoutSurface-BEnDlynn.js → ScoutSurface-x_QbcRyk.js} +1 -1
  100. package/dist/client/assets/ScoutbotBroadcastChip-DAKQKB25.js +2 -0
  101. package/dist/client/assets/{ScoutbotFxLab-fAROyIfz.js → ScoutbotFxLab-7t9JVvZg.js} +1 -1
  102. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-CDyFJX8m.js → ScoutbotRealtimeVoiceCall-Br4bYVAx.js} +1 -1
  103. package/dist/client/assets/{SecondaryNav-Hv5AJ3Fv.js → SecondaryNav-Dj30epYF.js} +1 -1
  104. package/dist/client/assets/{SessionEmbedScreen-CDRpQc3g.js → SessionEmbedScreen-s2mJ5Fg9.js} +1 -1
  105. package/dist/client/assets/{SessionObserve-BmmJ8dEh.js → SessionObserve-DaUrJCMq.js} +1 -1
  106. package/dist/client/assets/{SessionObserveEvidence-CEedIk2a.js → SessionObserveEvidence-ClUW8jpV.js} +1 -1
  107. package/dist/client/assets/SessionRefScreen-DLZNFZFK.js +1 -0
  108. package/dist/client/assets/SessionsScreen-D-hN1n4k.js +1 -0
  109. package/dist/client/assets/{SettingsDrawer-DL-SVLdd.js → SettingsDrawer-BFsnww-k.js} +3 -3
  110. package/dist/client/assets/SettingsScreen-Bc3Xtv5V.js +1 -0
  111. package/dist/client/assets/{ShikiPane-B7O4if20.js → ShikiPane-Dkwyx--r.js} +1 -1
  112. package/dist/client/assets/{SlidePanel-B3gc5HnM.js → SlidePanel-CuTeirnk.js} +1 -1
  113. package/dist/client/assets/{SpriteAvatar-BpQDpOkq.js → SpriteAvatar-DQ3PTb8L.js} +1 -1
  114. package/dist/client/assets/{StatusPill-B33sQinT.js → StatusPill-BJ1ierIR.js} +1 -1
  115. package/dist/client/assets/{TailView-DL3YZkzE.js → TailView-CufWcrvf.js} +2 -2
  116. package/dist/client/assets/Terminal-D_OmdFmr.js +1 -0
  117. package/dist/client/assets/TerminalEmbedScreen-D21ytNXW.js +1 -0
  118. package/dist/client/assets/TerminalRelay-rvUzI9Ek.js +46 -0
  119. package/dist/client/assets/{TextDocumentSurface-DRjctOIt.js → TextDocumentSurface-Bc-kHPgG.js} +1 -1
  120. package/dist/client/assets/{TmuxPeek-DNC4uWky.js → TmuxPeek-DLyDkq_D.js} +1 -1
  121. package/dist/client/assets/{VoicePermissionsPanel-WLN0V-Xv.js → VoicePermissionsPanel-CD903y9K.js} +1 -1
  122. package/dist/client/assets/{WorkDetailScreen-D2Yl0mYZ.js → WorkDetailScreen-D51oI0dH.js} +2 -2
  123. package/dist/client/assets/{WorkFilesViewer-BbVfcUN-.js → WorkFilesViewer-BDMNbxE4.js} +1 -1
  124. package/dist/client/assets/{activity-BxwKkT8z.js → activity-BvGruxWG.js} +1 -1
  125. package/dist/client/assets/{addon-fit-B9O2vJoh.js → addon-fit-Cfq4Ayjd.js} +1 -1
  126. package/dist/client/assets/{addon-webgl-BhRZFDcn.js → addon-webgl-B8sIf9-s.js} +1 -1
  127. package/dist/client/assets/{agent-essentials-SrzMYEXV.js → agent-essentials-yb4wIJlX.js} +1 -1
  128. package/dist/client/assets/{agent-lane-card-model-DSWdGu-v.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
  129. package/dist/client/assets/{agent-lanes-model-CPgQRenB.js → agent-lanes-model-VYQ5a68i.js} +1 -1
  130. package/dist/client/assets/{arc.es-NlJw-19N.js → arc.es-BBTfhvLE.js} +1 -1
  131. package/dist/client/assets/{arrow-left-_vS7itsV.js → arrow-left-BOht-YQu.js} +1 -1
  132. package/dist/client/assets/{arrow-up-right-CcrWONpD.js → arrow-up-right-hoR8_oUz.js} +1 -1
  133. package/dist/client/assets/{bot-BRINYlC6.js → bot-BUK7dOPS.js} +1 -1
  134. package/dist/client/assets/{check-COxArFXG.js → check--esHw52j.js} +1 -1
  135. package/dist/client/assets/{chevron-down-DRCbnzyY.js → chevron-down-NAhBUkFd.js} +1 -1
  136. package/dist/client/assets/{chevron-right-CNE6QAVr.js → chevron-right-C10o7t_X.js} +1 -1
  137. package/dist/client/assets/{chunk-HRAB3GC3-CAeEKaf5.js → chunk-HRAB3GC3-DF8R9rPv.js} +1 -1
  138. package/dist/client/assets/{clock-CyfvRmj6.js → clock-of01sAB6.js} +1 -1
  139. package/dist/client/assets/{code-xml--LjSM4Mv.js → code-xml-CLn3TDWF.js} +1 -1
  140. package/dist/client/assets/content-B-SUUhXj.js +1 -0
  141. package/dist/client/assets/content-BRY2vo1_.js +1 -0
  142. package/dist/client/assets/content-BTm0mVyD.js +1 -0
  143. package/dist/client/assets/content-BTqvyb5E.js +1 -0
  144. package/dist/client/assets/content-BjDaXmSD.js +1 -0
  145. package/dist/client/assets/content-BrR6deGh.js +1 -0
  146. package/dist/client/assets/content-C5yvBEMy.js +1 -0
  147. package/dist/client/assets/content-Cgj5AWqT.js +1 -0
  148. package/dist/client/assets/content-CkhG__-v.js +1 -0
  149. package/dist/client/assets/content-CudIBsiP.js +1 -0
  150. package/dist/client/assets/content-DBb7ppd5.js +1 -0
  151. package/dist/client/assets/content-DEw_kGyK.js +1 -0
  152. package/dist/client/assets/content-DIy0DCzK.js +1 -0
  153. package/dist/client/assets/content-THl9hRAo.js +1 -0
  154. package/dist/client/assets/content-vi9FbmV9.js +1 -0
  155. package/dist/client/assets/content-wcgPMGVf.js +1 -0
  156. package/dist/client/assets/{conversation-icons-c-hXv7hY.js → conversation-icons-ClBJi21l.js} +1 -1
  157. package/dist/client/assets/conversation-motion-features-zU0k3Agz.js +1 -0
  158. package/dist/client/assets/{copy-4LfKIdQJ.js → copy-Dty8ZYsM.js} +1 -1
  159. package/dist/client/assets/{createLucideIcon-ClCdc3F9.js → createLucideIcon-Bt67PWH-.js} +1 -1
  160. package/dist/client/assets/discover-NDAqNvKt.js +2 -0
  161. package/dist/client/assets/embed-entry-BVR09F6e.js +2 -0
  162. package/dist/client/assets/{external-link-CnaI1QFS.js → external-link-Dem738OJ.js} +1 -1
  163. package/dist/client/assets/{eye-BFlhMzQL.js → eye-B3lBIwJZ.js} +1 -1
  164. package/dist/client/assets/{file-text-DG-pufl1.js → file-text-iF0hyVyU.js} +1 -1
  165. package/dist/client/assets/{home-moving-signal-aNJusIzL.js → home-moving-signal-C8dTXieA.js} +1 -1
  166. package/dist/client/assets/{home-now-card-BQK4EFHx.js → home-now-card-BgvVcE83.js} +1 -1
  167. package/dist/client/assets/{home-now-card-nano-CdtzqSIF.js → home-now-card-nano-hZl9klbP.js} +1 -1
  168. package/dist/client/assets/hooks-DBIezYS2.js +2 -0
  169. package/dist/client/assets/index-BMwKgdz_.js +1 -0
  170. package/dist/client/assets/index-Bu-fckyR.css +1 -0
  171. package/dist/client/assets/index-BxoufAPA.js +1 -0
  172. package/dist/client/assets/index-Cj7NnSxI.js +1 -0
  173. package/dist/client/assets/{index-CzVeWScw.js → index-o4FKpU7Z.js} +2 -2
  174. package/dist/client/assets/{inspector-panel-DgOM8nCo.js → inspector-panel-Dy2cVTCi.js} +2 -2
  175. package/dist/client/assets/{keyboard-nav-BJnFoFDP.js → keyboard-nav-Chf51dns.js} +1 -1
  176. package/dist/client/assets/{lane-roster-store-pR4ZaYQm.js → lane-roster-store-BiIVlYmG.js} +1 -1
  177. package/dist/client/assets/left-BC7p5QbT.js +1 -0
  178. package/dist/client/assets/left-BCSGqccQ.js +1 -0
  179. package/dist/client/assets/left-BSyj8PuJ.js +2 -0
  180. package/dist/client/assets/left-DDnxNUxd.js +1 -0
  181. package/dist/client/assets/left-DLoDKxT5.js +2 -0
  182. package/dist/client/assets/left-O-TBH7JB.js +1 -0
  183. package/dist/client/assets/left-agents-Dk9Y89lb.js +1 -0
  184. package/dist/client/assets/left-default-B3JBRQNJ.js +1 -0
  185. package/dist/client/assets/left-lanes-30Oe_3RM.js +1 -0
  186. package/dist/client/assets/left-mission-DEl4-7xu.js +1 -0
  187. package/dist/client/assets/left-plan-B4qdm4Gn.js +2 -0
  188. package/dist/client/assets/left-rvUOB14X.js +1 -0
  189. package/dist/client/assets/library-DDKSLFJ_.js +1 -0
  190. package/dist/client/assets/{loader-circle-Byb9kSFx.js → loader-circle-4LDsy4Ke.js} +1 -1
  191. package/dist/client/assets/{local-agents-DBaUbP-_.js → local-agents-DIi2EacM.js} +1 -1
  192. package/dist/client/assets/{mentions-fbQJ2mBI.js → mentions-CvDaviLJ.js} +1 -1
  193. package/dist/client/assets/{mesh-ops-Cnw3vwAu.js → mesh-ops-JZwGuAPn.js} +1 -1
  194. package/dist/client/assets/{mesh-view-store-Btlyc7rW.js → mesh-view-store-Du7VqIT_.js} +1 -1
  195. package/dist/client/assets/{message-circle-aGOfQWm2.js → message-circle-BM3XgevU.js} +1 -1
  196. package/dist/client/assets/{message-markup-mGF07emJ.js → message-markup-BcY1lShv.js} +1 -1
  197. package/dist/client/assets/{message-square-CIXda-Y7.js → message-square-ER1_q2pe.js} +1 -1
  198. package/dist/client/assets/{mission-control-store-CcoNeQHG.js → mission-control-store-C6w5iVfg.js} +1 -1
  199. package/dist/client/assets/{observe-BNFzh-7B.js → observe-3-jn4SXb.js} +1 -1
  200. package/dist/client/assets/{page-status-DDvNdA8s.js → page-status-0LPfBC8S.js} +1 -1
  201. package/dist/client/assets/{plus-CmFQp9Uj.js → plus-C-2gTcPK.js} +1 -1
  202. package/dist/client/assets/profile-DW80Gn5k.js +1 -0
  203. package/dist/client/assets/{projects-inbox-Diddml6e.js → projects-inbox-DCeD3FfV.js} +1 -1
  204. package/dist/client/assets/provider-BvAxRQfE.js +1 -0
  205. package/dist/client/assets/{radio-PauJIekM.js → radio-v7UAMZGh.js} +1 -1
  206. package/dist/client/assets/{refresh-cw-4oeFn1Jn.js → refresh-cw-B5To7b6B.js} +1 -1
  207. package/dist/client/assets/resolve-panes-BDi9Qx4R.js +1 -0
  208. package/dist/client/assets/resolve-sidebar-context-HE-5eZYa.js +1 -0
  209. package/dist/client/assets/right-BDf_yTv6.js +1 -0
  210. package/dist/client/assets/{right-BcFnuse9.js → right-BvoGOUKH.js} +1 -1
  211. package/dist/client/assets/right-C-bgjYg-.js +1 -0
  212. package/dist/client/assets/right-C3JdEfYQ.js +1 -0
  213. package/dist/client/assets/right-CYIs2tEe.js +1 -0
  214. package/dist/client/assets/right-CyRCv6Up.js +1 -0
  215. package/dist/client/assets/right-DBYGtoRv.js +1 -0
  216. package/dist/client/assets/right-o3LHMiKa.js +1 -0
  217. package/dist/client/assets/right-oPrcx9MX.js +1 -0
  218. package/dist/client/assets/right-sSvBUK-j.js +1 -0
  219. package/dist/client/assets/{rocket-C-AskjZH.js → rocket-BQQQv2L5.js} +1 -1
  220. package/dist/client/assets/router-C65cZYPn.js +1 -0
  221. package/dist/client/assets/{runtime-picker-BCQD7d4K.js → runtime-picker-eDEvx2Mz.js} +1 -1
  222. package/dist/client/assets/{scope-views-BhkbIFPY.js → scope-views-BOOmgmwx.js} +1 -1
  223. package/dist/client/assets/{scout-voice-S5_YZ2v8.js → scout-voice-B7kXlkcl.js} +1 -1
  224. package/dist/client/assets/{scroll-text-BV-BB7v-.js → scroll-text-BuneRiAD.js} +1 -1
  225. package/dist/client/assets/{search-C3bSJluv.js → search-7_n7CxWl.js} +1 -1
  226. package/dist/client/assets/{secondaryNavConfig-Bg4Tc0gT.js → secondaryNavConfig-CSFDCQAf.js} +1 -1
  227. package/dist/client/assets/{selection-bridge-B1dmkX3P.js → selection-bridge-SlGsgHw2.js} +1 -1
  228. package/dist/client/assets/{send-horizontal-CqogPmbY.js → send-horizontal-DP16OOIW.js} +1 -1
  229. package/dist/client/assets/{server-Brw5Y1Gh.js → server-pYOMFjrT.js} +1 -1
  230. package/dist/client/assets/{session-catalog-9FqXmjBw.js → session-catalog-_QfQ7fhZ.js} +1 -1
  231. package/dist/client/assets/{session-table-1xdSxSXq.js → session-table-CYN8e4s3.js} +1 -1
  232. package/dist/client/assets/{sliders-horizontal-CUiOH26y.js → sliders-horizontal-D2Z8gz6J.js} +1 -1
  233. package/dist/client/assets/{sparkles-BjCA3Evu.js → sparkles-Bth2iK7t.js} +1 -1
  234. package/dist/client/assets/{sse-QcU9bikk.js → sse-CL6gctHY.js} +1 -1
  235. package/dist/client/assets/{tail-events-C6K7bCWB.js → tail-events-NLIWLq27.js} +1 -1
  236. package/dist/client/assets/{terminal-DrTkVXIj.js → terminal-By1Lw2i2.js} +1 -1
  237. package/dist/client/assets/{terminal-relay-BkXjjSkq.js → terminal-relay-CjkI5aUy.js} +1 -1
  238. package/dist/client/assets/{terminal-sessions-C3qU8tnY.js → terminal-sessions-AmSgHklm.js} +1 -1
  239. package/dist/client/assets/{terminal-takeover-KvmTwABa.js → terminal-takeover-7AvNpnkC.js} +1 -1
  240. package/dist/client/assets/{use-conversation-list-C5sF6WBR.js → use-conversation-list-BCzY032j.js} +1 -1
  241. package/dist/client/assets/{use-fleet-active-asks-BOMPW0nl.js → use-fleet-active-asks-CJ6-oj5k.js} +1 -1
  242. package/dist/client/assets/{use-mesh-ops-items-Co05vcTV.js → use-mesh-ops-items-D5L-CKe_.js} +1 -1
  243. package/dist/client/assets/use-reduced-motion-CqXpVXv-.js +1 -0
  244. package/dist/client/assets/use-scout-dev-flags-BohC8seq.js +1 -0
  245. package/dist/client/assets/{useAgentHoverCard-FtCmY-b9.js → useAgentHoverCard-RsLUYyeh.js} +1 -1
  246. package/dist/client/assets/useContentSecondaryNav-DOr5yHbT.js +1 -0
  247. package/dist/client/assets/usePersistentState-D3M4m2Ou.js +1 -0
  248. package/dist/client/assets/{usePierreRuntime-Bo4lD7Ui.js → usePierreRuntime-B4hbNWTz.js} +1 -1
  249. package/dist/client/assets/{wrench-CeCdjiPF.js → wrench-M4G7WtYB.js} +1 -1
  250. package/dist/client/assets/{x-D4X_y1j_.js → x-ynOfVadO.js} +1 -1
  251. package/dist/client/assets/{xterm-D2a5wrkJ.js → xterm-DZHyijPp.js} +1 -1
  252. package/dist/client/index.html +2 -2
  253. package/dist/main.mjs +41 -26
  254. package/dist/node/main.mjs +19 -5
  255. package/dist/pairing-runtime-controller.mjs +2 -2
  256. package/dist/runtime/broker-daemon.mjs +2 -2
  257. package/dist/scout-control-plane-web.mjs +21 -7
  258. package/dist/scout-web-server.mjs +21 -7
  259. package/package.json +4 -4
  260. package/dist/client/assets/ActivityScreen-BXm6nJ6L.js +0 -1
  261. package/dist/client/assets/AgentConfigurationScreen-CfBXxrsD.js +0 -1
  262. package/dist/client/assets/AgentDefinitionsWorkspace-4Z0aN8AR.js +0 -1
  263. package/dist/client/assets/AgentFloorView-DMivAYHU.js +0 -1
  264. package/dist/client/assets/AgentInfoScreen-CPkLg1pK.js +0 -1
  265. package/dist/client/assets/AgentLanesEmbedScreen-CjHMvy3v.js +0 -1
  266. package/dist/client/assets/AgentsScreen-zR6b2bUL.js +0 -1
  267. package/dist/client/assets/AgentsSubnav-q0xcZi6C.js +0 -1
  268. package/dist/client/assets/BackToPicker-DZg_4nHL.js +0 -1
  269. package/dist/client/assets/BrokerScreen-Chh8sGen.js +0 -5
  270. package/dist/client/assets/ConversationFeedRows-5it6QNBV.js +0 -1
  271. package/dist/client/assets/ConversationPanels-vI9YuQJh.js +0 -2
  272. package/dist/client/assets/ConversationScreen-C-PrCRz1.js +0 -1
  273. package/dist/client/assets/FlightObserveScreen-Yq5NtQQJ.js +0 -1
  274. package/dist/client/assets/HarnessesScreen-L-emPcXd.js +0 -1
  275. package/dist/client/assets/KnowledgeSearchScreen-DvdOFh-b.js +0 -1
  276. package/dist/client/assets/LaneTraceDetailSheet-Dl7foF88.js +0 -1
  277. package/dist/client/assets/MeshScreen-D5zzTn0o.js +0 -1
  278. package/dist/client/assets/MessagesScreen-BhOJ7_tj.js +0 -1
  279. package/dist/client/assets/MissionControlView-D2JO9u-y.js +0 -1
  280. package/dist/client/assets/ObserveTextFlow-DJxQc2H6.js +0 -2
  281. package/dist/client/assets/OpenScoutAppShell-DrHYD_pd.js +0 -87
  282. package/dist/client/assets/OpsAgentsView-BnMX0vEY.js +0 -1
  283. package/dist/client/assets/OpsScreen-BeC0lieE.js +0 -1
  284. package/dist/client/assets/OpsSubnav-D5Bpowtk.js +0 -1
  285. package/dist/client/assets/ProjectAgentProfile-zE1cApxw.js +0 -1
  286. package/dist/client/assets/ProjectsInbox-C3Jd6JTk.js +0 -2
  287. package/dist/client/assets/ProjectsScreen-PW_NH5VK.js +0 -1
  288. package/dist/client/assets/ProjectsThreadAside-DaCEUWN1.js +0 -1
  289. package/dist/client/assets/Provider-DSsb2gLR.js +0 -1
  290. package/dist/client/assets/RawSessionsTable-LWEvXJzj.js +0 -1
  291. package/dist/client/assets/RealtimeVoiceScreen-XtxbCjOs.js +0 -1
  292. package/dist/client/assets/RepoDiffViewerLazy-DIxkiMto.js +0 -2
  293. package/dist/client/assets/ScoutDeckSurface-BCpl0QCx.js +0 -1
  294. package/dist/client/assets/ScoutbotBroadcastChip-z9R_pC_U.js +0 -2
  295. package/dist/client/assets/SessionRefScreen-Dk-O4OVt.js +0 -1
  296. package/dist/client/assets/SessionsScreen-BJEjuo2X.js +0 -1
  297. package/dist/client/assets/SettingsScreen-DJ-BhBwR.js +0 -1
  298. package/dist/client/assets/Terminal-Dp1FSGIS.js +0 -1
  299. package/dist/client/assets/TerminalEmbedScreen-DP9IM4xf.js +0 -1
  300. package/dist/client/assets/arrow-down-D3-IbArq.js +0 -1
  301. package/dist/client/assets/chunk-JTPDIGGW-s6WbxdjC.js +0 -46
  302. package/dist/client/assets/chunk-T65CQEWV-CiZ_ICHW.js +0 -1
  303. package/dist/client/assets/chunk-YOZR3KYS-DLOc92uD.js +0 -2
  304. package/dist/client/assets/content-7ZeCPAEt.js +0 -1
  305. package/dist/client/assets/content-BHUcUCH5.js +0 -1
  306. package/dist/client/assets/content-BUhvLPkv.js +0 -1
  307. package/dist/client/assets/content-BomQ5YWo.js +0 -1
  308. package/dist/client/assets/content-C39ELNgC.js +0 -1
  309. package/dist/client/assets/content-C4RYKHut.js +0 -1
  310. package/dist/client/assets/content-CCiZfG4H.js +0 -1
  311. package/dist/client/assets/content-CDpDtVI-.js +0 -1
  312. package/dist/client/assets/content-CO-9CeFd.js +0 -1
  313. package/dist/client/assets/content-CuOLxp1x.js +0 -1
  314. package/dist/client/assets/content-CvtLIjXS.js +0 -1
  315. package/dist/client/assets/content-CzwTUb9n.js +0 -1
  316. package/dist/client/assets/content-DQXbo2RO.js +0 -1
  317. package/dist/client/assets/content-DRTQ9QQb.js +0 -1
  318. package/dist/client/assets/content-LCELs6zg.js +0 -1
  319. package/dist/client/assets/content-qsDjA4Au.js +0 -1
  320. package/dist/client/assets/conversation-motion-features-T8vF9zED.js +0 -1
  321. package/dist/client/assets/discover-7Ks00w-M.js +0 -2
  322. package/dist/client/assets/embed-entry-n2ThmSSX.js +0 -2
  323. package/dist/client/assets/gestures-CxG3Dphs.js +0 -1
  324. package/dist/client/assets/hooks-Dst1TH7n.js +0 -2
  325. package/dist/client/assets/index-9as_JTUs.css +0 -1
  326. package/dist/client/assets/index-CU9dtwJk.js +0 -1
  327. package/dist/client/assets/index-Dewd56RX.js +0 -1
  328. package/dist/client/assets/index-_YQXKEhb.js +0 -1
  329. package/dist/client/assets/left-BhzPp-_E.js +0 -1
  330. package/dist/client/assets/left-CN1MABD0.js +0 -2
  331. package/dist/client/assets/left-DDgbsio7.js +0 -1
  332. package/dist/client/assets/left-Dpf2R9uD.js +0 -1
  333. package/dist/client/assets/left-HwwbMVtl.js +0 -2
  334. package/dist/client/assets/left-YfH0daht.js +0 -1
  335. package/dist/client/assets/left-agents-CYUwAy2Z.js +0 -1
  336. package/dist/client/assets/left-default-vEGZALPv.js +0 -1
  337. package/dist/client/assets/left-lanes-bphF-vlX.js +0 -1
  338. package/dist/client/assets/left-mission-B54-c3hq.js +0 -1
  339. package/dist/client/assets/left-np5USKqG.js +0 -1
  340. package/dist/client/assets/left-plan-BNBuDoPQ.js +0 -2
  341. package/dist/client/assets/library-DbCVJG_O.js +0 -1
  342. package/dist/client/assets/paperclip-DfpJkR4s.js +0 -1
  343. package/dist/client/assets/profile-s3KRbip1.js +0 -1
  344. package/dist/client/assets/resolve-panes-cp6eNewO.js +0 -1
  345. package/dist/client/assets/resolve-sidebar-context-Dbo-5PWx.js +0 -1
  346. package/dist/client/assets/right-09W2JJFg.js +0 -1
  347. package/dist/client/assets/right-B-MKhiJ6.js +0 -1
  348. package/dist/client/assets/right-B91Zl8lQ.js +0 -1
  349. package/dist/client/assets/right-BdtMzn35.js +0 -1
  350. package/dist/client/assets/right-BqmKXLtf.js +0 -1
  351. package/dist/client/assets/right-BzeB-Dpt.js +0 -1
  352. package/dist/client/assets/right-CkGOs-sq.js +0 -1
  353. package/dist/client/assets/right-CzGiNBzB.js +0 -1
  354. package/dist/client/assets/right-Dc7uqv7l.js +0 -1
  355. package/dist/client/assets/router-B-K15T7B.js +0 -1
  356. package/dist/client/assets/use-reduced-motion-Dla-G_Jz.js +0 -1
  357. package/dist/client/assets/use-scout-dev-flags-BOQF3fW2.js +0 -1
  358. package/dist/client/assets/useContentSecondaryNav-BX7Sq7vy.js +0 -1
@@ -1 +1 @@
1
- import{r as t,j as e}from"./index-CzVeWScw.js";/* empty css */import{a as se}from"./api-h5zurxmi.js";import{B as ne,av as re,aw as A,A as te,ax as ae,ay as ie,az as Q,aA as ce,aB as B,aC as de,aD as oe,aE as le,G as he}from"./router-B-K15T7B.js";import{u as pe}from"./Provider-DSsb2gLR.js";import{c as P}from"./createLucideIcon-ClCdc3F9.js";import{X as ue}from"./x-D4X_y1j_.js";import{C as V}from"./check-COxArFXG.js";import{C as D}from"./copy-4LfKIdQJ.js";import{E as xe}from"./external-link-CnaI1QFS.js";import{L as me}from"./loader-circle-Byb9kSFx.js";const je=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],fe=P("file-braces",je);const ye=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],G=P("message-square-text",ye);const ve=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],ge=P("radio-tower",ve);function S({text:n,query:f}){return e.jsx(e.Fragment,{children:he(n,f).map((l,i)=>l.match?e.jsx("mark",{children:l.text},i):e.jsx("span",{children:l.text},i))})}function J(n){return n.renderedText||n.summary||n.raw}function ke({record:n,role:f,query:l,expanded:i,onToggle:k}){const h=t.useRef(null),[y,N]=t.useState(!1),u=J(n),x=t.useCallback(()=>{const d=h.current;!d||i||N(d.scrollHeight>d.clientHeight+1)},[i]);return t.useEffect(()=>{x();const d=h.current;if(!d||i||typeof ResizeObserver>"u")return;const w=new ResizeObserver(x);return w.observe(d),()=>w.disconnect()},[i,x,l,u]),e.jsxs("article",{className:`ks-excerpt-turn${n.matched?" ks-excerpt-turn--matched":""}`,children:[e.jsxs("header",{children:[e.jsx("span",{children:String(n.index).padStart(4,"0")}),e.jsx("strong",{children:f}),n.matched?e.jsx("em",{children:"match"}):null]}),e.jsx("p",{ref:h,className:i?"is-expanded":void 0,children:e.jsx(S,{text:u,query:l})}),y?e.jsx("button",{type:"button",className:"ks-excerpt-turn-expand","aria-expanded":i,onClick:k,children:i?"Collapse turn":"Show full turn"}):null]})}function U(){const{selectedKnowledgeHit:n,selectedKnowledgeQuery:f,clearKnowledgeHit:l,openFilePreview:i,navigate:k}=pe(),[h,y]=t.useState(null),[N,u]=t.useState(!1),[x,d]=t.useState(null),[w,_]=t.useState(!1),[b,M]=t.useState(!1),[X,I]=t.useState({}),[W,K]=t.useState({}),c=h&&h.hitId===n?.id?h.value:null,r=n?ne(n):null,v=n?re(n):null,$=n?A(n,"project"):"",L=n?A(n,"harness"):"",p=f.trim(),z=te(r),T=ae(r),q=r?.path??v?.path,m=n?ie(n):"",E=t.useMemo(()=>c?.records.filter(s=>s.matched).sort((s,o)=>{const a=Q(s)-Q(o);return a!==0?a:(o.matchCount??0)-(s.matchCount??0)}).at(0)??null,[c]),C=t.useMemo(()=>ce(c?.records??[],{contextRadius:4,maxTurns:6,centerRecordIndex:E?.index}),[c,E?.index]),O=t.useMemo(()=>{const s=C.flatMap(o=>o.kind==="turn"?[o.record.index]:o.records.map(a=>a.index));return s.length>0?[Math.min(...s),Math.max(...s)]:null},[C]),Y=c?.records.find(s=>s.matched)?.index??r?.recordRange?.[0];t.useEffect(()=>{I({}),K({}),M(!1),_(!1)},[n?.id]),t.useEffect(()=>{let s=!1;return(async()=>{if(y(null),d(null),!n||!r){u(!1);return}u(!0);try{const a=await se("/api/knowledge/source-preview",{method:"POST",body:JSON.stringify({sourceRef:r,contextRecords:4,maxRecords:80,q:p})});s||y({hitId:n.id,value:a})}catch(a){s||(y(null),d(a instanceof Error?a.message:String(a)))}finally{s||u(!1)}})(),()=>{s=!0}},[n?.id,r?.recordRange?.[0],r?.recordRange?.[1],p]);const Z=t.useCallback(()=>{const s=r??v;s&&i(B(s.path))},[r,v,i]),F=t.useCallback(async()=>{if(m)try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else if(typeof document<"u"){const s=document.createElement("textarea");s.value=m,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}M(!0),window.setTimeout(()=>M(!1),1600)}catch{}},[m]);return e.jsxs("div",{className:"ks-inspector",children:[x?e.jsx("div",{className:"ks-inspector-error",role:"alert",children:x}):null,e.jsx("section",{className:"ks-preview-panel","aria-label":"Selected search result preview",children:n?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"ks-preview-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"ks-panel-eyebrow",children:"Result"}),e.jsx("h2",{children:n.title})]}),e.jsx("button",{type:"button","aria-label":"Clear selected result",onClick:l,className:"ks-preview-close",children:e.jsx(ue,{size:14,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"ks-preview-meta",children:[$?e.jsx("span",{children:$}):null,L?e.jsx("span",{children:L}):null,n.freshness&&n.freshness!=="unknown"&&e.jsx("span",{children:n.freshness}),r?.recordRange?e.jsxs("span",{children:["records ",r.recordRange[0],"..",r.recordRange[1]]}):null]}),z||T||r||v||m?e.jsxs("div",{className:"ks-preview-actions","aria-label":"Selected result actions",children:[z?e.jsxs("button",{type:"button",className:"ks-action-primary",onClick:()=>k({view:"sessions",sessionId:z}),children:[e.jsx(G,{size:13,"aria-hidden":"true"}),"Open conversation"]}):null,T?e.jsxs("button",{type:"button",onClick:()=>k({view:"ops",mode:"tail",tailQuery:T}),children:[e.jsx(ge,{size:13,"aria-hidden":"true"}),"Observe window"]}):null,m?e.jsxs("button",{type:"button",onClick:()=>{F()},children:[b?e.jsx(V,{size:13,"aria-hidden":"true"}):e.jsx(D,{size:13,"aria-hidden":"true"}),b?"Copied":"Copy ref"]}):null,r||v?e.jsxs("button",{type:"button",onClick:Z,children:[e.jsx(xe,{size:13,"aria-hidden":"true"}),"Open file"]}):null]}):null,e.jsxs("details",{className:"ks-why-matched",children:[e.jsxs("summary",{children:[e.jsx("span",{children:de(n,p,E)}),e.jsx("em",{children:oe(n)})]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Index signal"}),e.jsx("dd",{children:n.scoreSource||"fts"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Origin"}),e.jsxs("dd",{children:[n.origin," · ",n.ownership]})]}),r?.recordRange?e.jsxs("div",{children:[e.jsx("dt",{children:"Records"}),e.jsxs("dd",{children:[r.recordRange[0],"…",r.recordRange[1]]})]}):null]})]}),N?e.jsxs("div",{className:"ks-preview-loading",children:[e.jsx(me,{size:15,className:"ks-spin","aria-hidden":"true"}),"Loading conversation…"]}):C.length>0?e.jsxs("section",{className:"ks-conversation-excerpt","aria-label":"Conversation excerpt",children:[e.jsxs("div",{className:"ks-rendered-head",children:[e.jsx(G,{size:14,"aria-hidden":"true"}),e.jsx("strong",{children:"Conversation"}),O?e.jsxs("span",{children:["records ",O[0],"…",O[1]]}):null]}),C.map((s,o)=>{if(s.kind==="folded"){const g=s.records[0]?.index??o,R=X[g]===!0;return e.jsxs("div",{className:"ks-excerpt-fold",children:[e.jsxs("button",{type:"button",className:"ks-excerpt-fold-toggle","aria-expanded":R,onClick:()=>I(j=>({...j,[g]:!R})),children:[e.jsx("span",{"aria-hidden":"true",children:R?"▾":"▸"}),s.summary]}),R?e.jsx("div",{className:"ks-excerpt-fold-body",children:s.records.map(j=>e.jsxs("article",{className:"ks-excerpt-turn ks-excerpt-turn--muted",children:[e.jsxs("header",{children:[e.jsx("span",{children:String(j.index).padStart(4,"0")}),e.jsx("strong",{children:le(j)})]}),e.jsx("p",{tabIndex:0,children:e.jsx(S,{text:J(j),query:p})})]},`fold-record:${j.index}`))}):null]},`fold:${g}`)}const{record:a,role:ee}=s,H=W[a.index]===!0;return e.jsx(ke,{record:a,role:ee,query:p,expanded:H,onToggle:()=>K(g=>({...g,[a.index]:!H}))},`turn:${a.index}`)})]}):e.jsxs("section",{className:"ks-indexed-snippet","aria-label":"Match snippet",children:[e.jsx("span",{children:"Match"}),e.jsx("p",{children:e.jsx(S,{text:n.snippet,query:p})})]}),q?e.jsxs("div",{className:"ks-preview-source",children:[e.jsx("span",{children:"Source"}),e.jsx("code",{children:B(q)}),e.jsxs("button",{type:"button",onClick:()=>{F()},"aria-label":"Copy source reference",children:[b?e.jsx(V,{size:12,"aria-hidden":"true"}):e.jsx(D,{size:12,"aria-hidden":"true"}),b?"Copied":"Copy ref"]})]}):null,c?e.jsxs("details",{className:"ks-jsonl-window",open:w,onToggle:s=>_(s.target.open),children:[e.jsxs("summary",{className:"ks-jsonl-window-head",children:[e.jsx("strong",{children:"Raw evidence (advanced)"}),e.jsxs("span",{children:["records ",c.previewRange[0],"..",c.previewRange[1]]})]}),c.records.map(s=>e.jsxs("details",{className:`ks-jsonl-record${s.matched?" ks-jsonl-record--matched":""}`,open:s.index===Y,children:[e.jsxs("summary",{children:[e.jsx("span",{children:String(s.index).padStart(4,"0")}),e.jsx("strong",{children:s.kind||s.role||s.type||"record"}),e.jsx("em",{children:e.jsx(S,{text:s.summary||"no summary",query:p})})]}),e.jsx("pre",{children:s.raw})]},`${c.path}:${s.index}`))]}):null]}):e.jsxs("div",{className:"ks-inspector-empty",children:[e.jsx(fe,{size:18,"aria-hidden":"true"}),e.jsx("strong",{children:"Select a result"}),e.jsx("span",{children:"Pick a match to see the conversation moment, jump to the session, or open the file."}),e.jsxs("span",{className:"ks-inspector-empty-hint",children:["Use ",e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," to walk the list, ",e.jsx("kbd",{children:"↵"})," to pick, ",e.jsx("kbd",{children:"⌘↵"})," to open the session."]})]})})]})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:U},Symbol.toStringTag,{value:"Module"})),_e=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:U},Symbol.toStringTag,{value:"Module"}));export{U as K,_e as a,Pe as r};
1
+ import{r as t,j as e}from"./index-o4FKpU7Z.js";/* empty css */import{a as se}from"./api-h5zurxmi.js";import{C as ne,au as re,av as Q,B as te,aw as ae,ax as ie,ay as A,az as ce,aA as B,aB as de,aC as oe,aD as le,H as he}from"./router-C65cZYPn.js";import{u as pe}from"./Provider-DKZWuzSR.js";import{c as P}from"./createLucideIcon-Bt67PWH-.js";import{X as ue}from"./x-ynOfVadO.js";import{C as V}from"./check--esHw52j.js";import{C as D}from"./copy-Dty8ZYsM.js";import{E as xe}from"./external-link-Dem738OJ.js";import{L as me}from"./loader-circle-4LDsy4Ke.js";const je=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],fe=P("file-braces",je);const ye=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],J=P("message-square-text",ye);const ve=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],ge=P("radio-tower",ve);function S({text:n,query:f}){return e.jsx(e.Fragment,{children:he(n,f).map((l,i)=>l.match?e.jsx("mark",{children:l.text},i):e.jsx("span",{children:l.text},i))})}function U(n){return n.renderedText||n.summary||n.raw}function ke({record:n,role:f,query:l,expanded:i,onToggle:k}){const h=t.useRef(null),[y,N]=t.useState(!1),u=U(n),x=t.useCallback(()=>{const d=h.current;!d||i||N(d.scrollHeight>d.clientHeight+1)},[i]);return t.useEffect(()=>{x();const d=h.current;if(!d||i||typeof ResizeObserver>"u")return;const w=new ResizeObserver(x);return w.observe(d),()=>w.disconnect()},[i,x,l,u]),e.jsxs("article",{className:`ks-excerpt-turn${n.matched?" ks-excerpt-turn--matched":""}`,children:[e.jsxs("header",{children:[e.jsx("span",{children:String(n.index).padStart(4,"0")}),e.jsx("strong",{children:f}),n.matched?e.jsx("em",{children:"match"}):null]}),e.jsx("p",{ref:h,className:i?"is-expanded":void 0,children:e.jsx(S,{text:u,query:l})}),y?e.jsx("button",{type:"button",className:"ks-excerpt-turn-expand","aria-expanded":i,onClick:k,children:i?"Collapse turn":"Show full turn"}):null]})}function X(){const{selectedKnowledgeHit:n,selectedKnowledgeQuery:f,clearKnowledgeHit:l,openFilePreview:i,navigate:k}=pe(),[h,y]=t.useState(null),[N,u]=t.useState(!1),[x,d]=t.useState(null),[w,_]=t.useState(!1),[b,M]=t.useState(!1),[G,I]=t.useState({}),[W,K]=t.useState({}),c=h&&h.hitId===n?.id?h.value:null,r=n?ne(n):null,v=n?re(n):null,$=n?Q(n,"project"):"",L=n?Q(n,"harness"):"",p=f.trim(),z=te(r),T=ae(r),q=r?.path??v?.path,m=n?ie(n):"",E=t.useMemo(()=>c?.records.filter(s=>s.matched).sort((s,o)=>{const a=A(s)-A(o);return a!==0?a:(o.matchCount??0)-(s.matchCount??0)}).at(0)??null,[c]),C=t.useMemo(()=>ce(c?.records??[],{contextRadius:4,maxTurns:6,centerRecordIndex:E?.index}),[c,E?.index]),O=t.useMemo(()=>{const s=C.flatMap(o=>o.kind==="turn"?[o.record.index]:o.records.map(a=>a.index));return s.length>0?[Math.min(...s),Math.max(...s)]:null},[C]),Y=c?.records.find(s=>s.matched)?.index??r?.recordRange?.[0];t.useEffect(()=>{I({}),K({}),M(!1),_(!1)},[n?.id]),t.useEffect(()=>{let s=!1;return(async()=>{if(y(null),d(null),!n||!r){u(!1);return}u(!0);try{const a=await se("/api/knowledge/source-preview",{method:"POST",body:JSON.stringify({sourceRef:r,contextRecords:4,maxRecords:80,q:p})});s||y({hitId:n.id,value:a})}catch(a){s||(y(null),d(a instanceof Error?a.message:String(a)))}finally{s||u(!1)}})(),()=>{s=!0}},[n?.id,r?.recordRange?.[0],r?.recordRange?.[1],p]);const Z=t.useCallback(()=>{const s=r??v;s&&i(B(s.path))},[r,v,i]),F=t.useCallback(async()=>{if(m)try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else if(typeof document<"u"){const s=document.createElement("textarea");s.value=m,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}M(!0),window.setTimeout(()=>M(!1),1600)}catch{}},[m]);return e.jsxs("div",{className:"ks-inspector",children:[x?e.jsx("div",{className:"ks-inspector-error",role:"alert",children:x}):null,e.jsx("section",{className:"ks-preview-panel","aria-label":"Selected search result preview",children:n?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"ks-preview-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"ks-panel-eyebrow",children:"Result"}),e.jsx("h2",{children:n.title})]}),e.jsx("button",{type:"button","aria-label":"Clear selected result",onClick:l,className:"ks-preview-close",children:e.jsx(ue,{size:14,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"ks-preview-meta",children:[$?e.jsx("span",{children:$}):null,L?e.jsx("span",{children:L}):null,n.freshness&&n.freshness!=="unknown"&&e.jsx("span",{children:n.freshness}),r?.recordRange?e.jsxs("span",{children:["records ",r.recordRange[0],"..",r.recordRange[1]]}):null]}),z||T||r||v||m?e.jsxs("div",{className:"ks-preview-actions","aria-label":"Selected result actions",children:[z?e.jsxs("button",{type:"button",className:"ks-action-primary",onClick:()=>k({view:"sessions",sessionId:z}),children:[e.jsx(J,{size:13,"aria-hidden":"true"}),"Open conversation"]}):null,T?e.jsxs("button",{type:"button",onClick:()=>k({view:"ops",mode:"tail",tailQuery:T}),children:[e.jsx(ge,{size:13,"aria-hidden":"true"}),"Observe window"]}):null,m?e.jsxs("button",{type:"button",onClick:()=>{F()},children:[b?e.jsx(V,{size:13,"aria-hidden":"true"}):e.jsx(D,{size:13,"aria-hidden":"true"}),b?"Copied":"Copy ref"]}):null,r||v?e.jsxs("button",{type:"button",onClick:Z,children:[e.jsx(xe,{size:13,"aria-hidden":"true"}),"Open file"]}):null]}):null,e.jsxs("details",{className:"ks-why-matched",children:[e.jsxs("summary",{children:[e.jsx("span",{children:de(n,p,E)}),e.jsx("em",{children:oe(n)})]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Index signal"}),e.jsx("dd",{children:n.scoreSource||"fts"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Origin"}),e.jsxs("dd",{children:[n.origin," · ",n.ownership]})]}),r?.recordRange?e.jsxs("div",{children:[e.jsx("dt",{children:"Records"}),e.jsxs("dd",{children:[r.recordRange[0],"…",r.recordRange[1]]})]}):null]})]}),N?e.jsxs("div",{className:"ks-preview-loading",children:[e.jsx(me,{size:15,className:"ks-spin","aria-hidden":"true"}),"Loading conversation…"]}):C.length>0?e.jsxs("section",{className:"ks-conversation-excerpt","aria-label":"Conversation excerpt",children:[e.jsxs("div",{className:"ks-rendered-head",children:[e.jsx(J,{size:14,"aria-hidden":"true"}),e.jsx("strong",{children:"Conversation"}),O?e.jsxs("span",{children:["records ",O[0],"…",O[1]]}):null]}),C.map((s,o)=>{if(s.kind==="folded"){const g=s.records[0]?.index??o,R=G[g]===!0;return e.jsxs("div",{className:"ks-excerpt-fold",children:[e.jsxs("button",{type:"button",className:"ks-excerpt-fold-toggle","aria-expanded":R,onClick:()=>I(j=>({...j,[g]:!R})),children:[e.jsx("span",{"aria-hidden":"true",children:R?"▾":"▸"}),s.summary]}),R?e.jsx("div",{className:"ks-excerpt-fold-body",children:s.records.map(j=>e.jsxs("article",{className:"ks-excerpt-turn ks-excerpt-turn--muted",children:[e.jsxs("header",{children:[e.jsx("span",{children:String(j.index).padStart(4,"0")}),e.jsx("strong",{children:le(j)})]}),e.jsx("p",{tabIndex:0,children:e.jsx(S,{text:U(j),query:p})})]},`fold-record:${j.index}`))}):null]},`fold:${g}`)}const{record:a,role:ee}=s,H=W[a.index]===!0;return e.jsx(ke,{record:a,role:ee,query:p,expanded:H,onToggle:()=>K(g=>({...g,[a.index]:!H}))},`turn:${a.index}`)})]}):e.jsxs("section",{className:"ks-indexed-snippet","aria-label":"Match snippet",children:[e.jsx("span",{children:"Match"}),e.jsx("p",{children:e.jsx(S,{text:n.snippet,query:p})})]}),q?e.jsxs("div",{className:"ks-preview-source",children:[e.jsx("span",{children:"Source"}),e.jsx("code",{children:B(q)}),e.jsxs("button",{type:"button",onClick:()=>{F()},"aria-label":"Copy source reference",children:[b?e.jsx(V,{size:12,"aria-hidden":"true"}):e.jsx(D,{size:12,"aria-hidden":"true"}),b?"Copied":"Copy ref"]})]}):null,c?e.jsxs("details",{className:"ks-jsonl-window",open:w,onToggle:s=>_(s.target.open),children:[e.jsxs("summary",{className:"ks-jsonl-window-head",children:[e.jsx("strong",{children:"Raw evidence (advanced)"}),e.jsxs("span",{children:["records ",c.previewRange[0],"..",c.previewRange[1]]})]}),c.records.map(s=>e.jsxs("details",{className:`ks-jsonl-record${s.matched?" ks-jsonl-record--matched":""}`,open:s.index===Y,children:[e.jsxs("summary",{children:[e.jsx("span",{children:String(s.index).padStart(4,"0")}),e.jsx("strong",{children:s.kind||s.role||s.type||"record"}),e.jsx("em",{children:e.jsx(S,{text:s.summary||"no summary",query:p})})]}),e.jsx("pre",{children:s.raw})]},`${c.path}:${s.index}`))]}):null]}):e.jsxs("div",{className:"ks-inspector-empty",children:[e.jsx(fe,{size:18,"aria-hidden":"true"}),e.jsx("strong",{children:"Select a result"}),e.jsx("span",{children:"Pick a match to see the conversation moment, jump to the session, or open the file."}),e.jsxs("span",{className:"ks-inspector-empty-hint",children:["Use ",e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," to walk the list, ",e.jsx("kbd",{children:"↵"})," to pick, ",e.jsx("kbd",{children:"⌘↵"})," to open the session."]})]})})]})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"})),_e=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"}));export{X as K,_e as a,Pe as r};
@@ -0,0 +1 @@
1
+ import{r as l,j as e}from"./index-o4FKpU7Z.js";/* empty css */import{a as F}from"./api-h5zurxmi.js";import{d as we}from"./time-Dhsh_2EG.js";import{u as ve}from"./Provider-DKZWuzSR.js";import{o as le,p as Ce,q as Ee,t as Ke,v as oe,K as m,S as qe,x as fe,y as Le,z as Ae,A as Ie,B as ce,C as ue,D as Te,E as He,F as Re,G as $e,H as De,I as Fe}from"./router-C65cZYPn.js";import{S as Me}from"./search-7_n7CxWl.js";import{X as We}from"./x-ynOfVadO.js";import{L as de}from"./loader-circle-4LDsy4Ke.js";import{c as Oe}from"./createLucideIcon-Bt67PWH-.js";import{S as Pe}from"./sparkles-Bth2iK7t.js";import{C as Ue}from"./chevron-down-NAhBUkFd.js";import{C as ze}from"./clock-of01sAB6.js";import"./provider-BvAxRQfE.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";const _e=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Be=Oe("funnel",_e);function y(i){return new Intl.NumberFormat("en-US").format(i||0)}function Ge({text:i,query:a}){return e.jsx(e.Fragment,{children:De(i,a).map((o,c)=>o.match?e.jsx("mark",{children:o.text},c):e.jsx("span",{children:o.text},c))})}function Je(i,a){i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),a()))}async function Xe(){return F("/api/knowledge/status")}async function Qe(i){const a=new URLSearchParams;for(const o of i)a.append("key",o);return a.set("limit","200"),F(`/api/knowledge/search-primitives?${a.toString()}`)}async function G(i,a){const o=new URLSearchParams({q:i,limit:String(m.hitLimit)});if(a.sourceKinds.length>0)for(const u of a.sourceKinds)o.append("sourceKind",u);for(const u of a.harness)o.append("harness",u);for(const u of a.project)o.append("project",u);const c=$e(a.timeWindow);return c!=null&&o.set("updatedAfterMs",String(c)),F(`/api/knowledge/search?${o.toString()}`)}async function he(i=!1){return F("/api/knowledge/sessions/index",{method:"POST",body:JSON.stringify({days:m.days,limit:m.sessionLimit,force:i})})}const Ve=Le;function I({active:i,onClick:a,count:o,label:c,ariaLabel:u}){return e.jsxs("button",{type:"button",className:`ks-chip${i?" ks-chip--active":""}`,onClick:a,"aria-pressed":i,"aria-label":u??c,children:[e.jsx("span",{className:"ks-chip-label",children:c}),typeof o=="number"?e.jsx("span",{className:"ks-chip-count","aria-hidden":"true",children:y(o)}):null]})}function xe(i){return i&&i.split(/[\s_-]+/u).filter(a=>a.length>0).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function me(i,a,o=6){return i?i.filter(c=>c.key===a&&c.value.length>0).sort((c,u)=>u.count-c.count||c.value.localeCompare(u.value)).slice(0,o):[]}function pe(i){return i.sourceKinds.length>0||i.harness.length>0||i.project.length>0||i.timeWindow!=="all"}function Ye(i){const a=[];return i.sourceKinds.length>0&&a.push(i.sourceKinds.map(o=>fe[o]??o).join(" + ")),i.harness.length>0&&a.push(i.harness.map(xe).join(" + ")),i.project.length>0&&a.push(i.project.join(" + ")),i.timeWindow!=="all"&&a.push(Fe(i.timeWindow)),a.length>0?`Filters: ${a.join(" · ")}`:""}function Ps({navigate:i,mode:a,hitId:o,routeFilters:c}){const{selectedKnowledgeHit:u,inspectKnowledgeHit:g,clearKnowledgeHit:S}=ve(),ke=l.useMemo(()=>c||(typeof window>"u"?le():Ce(window.location.search)),[c]),[E,T]=l.useState(null),[J,je]=l.useState(null),[n,M]=l.useState(ke),[w,X]=l.useState([]),[W,Q]=l.useState(!1),[K,H]=l.useState(!1),[O,b]=l.useState(null),[ye,R]=l.useState(!1),[V,Y]=l.useState(!1),q=l.useRef(n);q.current=n;const p=(E?.chunks??0)>0,$=E?.activeJobs[0]??null,v=l.useMemo(()=>Ee(w),[w]),Z=K||!!$,L=n.query.trim(),P=Ke(n);l.useEffect(()=>{c&&M(s=>oe(s,c)?s:c)},[c]);const f=l.useMemo(()=>{const s=[];for(const t of v)s.push(...t.moments);return s},[v]),C=l.useCallback((s,t)=>{X(t.hits),T(t.status);const d=(o?t.hits.find(x=>x.id===o):void 0)??t.hits[0];d?g(d,s.query,s):S()},[o,g,S]),U=l.useCallback(async s=>{const t=s.query.trim();if(!t){X([]),S();return}Q(!0);try{b(null),C(s,await G(t,s))}catch(r){b(r instanceof Error?r.message:String(r))}finally{Q(!1)}},[C,S]),ee=l.useCallback(async(s=!1)=>{H(!0);try{b(null);const t=await he(s);T(t.status),R(!0);const r=q.current;t.status.chunks>0&&r.query.trim()&&C(r,await G(r.query.trim(),r))}catch(t){b(t instanceof Error?t.message:String(t))}finally{H(!1)}},[C]);l.useEffect(()=>{let s=!1;return(async()=>{try{const t=await Xe();if(s)return;T(t),R(!0),b(null)}catch{}if(!s){H(!0);try{b(null);const t=await he(!1);if(s)return;T(t.status),R(!0);const r=q.current;t.status.chunks>0&&r.query.trim()&&C(r,await G(r.query.trim(),r))}catch(t){s||(b(t instanceof Error?t.message:String(t)),R(!0))}finally{s||H(!1)}}})(),()=>{s=!0}},[C]),l.useEffect(()=>{if(!p||V)return;let s=!1;return(async()=>{try{const t=await Qe(["harness","project","sourceKind"]);s||(je(t),Y(!0))}catch{s||Y(!0)}})(),()=>{s=!0}},[p,V]),l.useEffect(()=>{if(!p)return;const s=window.setTimeout(()=>{U(n)},m.debounceMs);return()=>window.clearTimeout(s)},[n,p,U]);const ge=s=>{if(s.preventDefault(),!p&&!K){ee(!1);return}U(n)},j=l.useCallback(s=>{M(t=>{const r={...t,...s};return oe(t,r)?t:(i({view:"search",...a?{mode:a}:{},filters:r},{replace:!0}),r)})},[a,i]),A=l.useCallback(()=>{const s=le();M(s),i({view:"search",...a?{mode:a}:{},filters:s},{replace:!0})},[a,i]),be=l.useCallback(()=>{f[0]&&g(f[0],q.current.query)},[f,g]);l.useEffect(()=>{function s(t){const r=t.target,d=r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable);if(t.key==="/"&&!d){t.preventDefault();const x=document.querySelector(".ks-search-input");x?.focus(),x?.select()}else if(t.key==="Escape"&&!d)f.length>0?S():A();else if(!d&&(t.key==="j"||t.key==="k")){if(f.length===0)return;t.preventDefault();const x=u?f.findIndex(z=>z.id===u.id):-1,N=t.key==="j"?Math.min(f.length-1,x+1):Math.max(0,x-1),D=f[N];D&&g(D,q.current.query)}}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[f,g,S,u,A]);const Ne=E?we(E.generatedAt)||"just now":"—",Se=Z?$?`Indexing ${y($.progress.indexed??0)} of ${y($.progress.discovered??0)}`:p?`Refreshing last ${m.days} days in the background`:`Building last ${m.days} days of sessions`:p?`${y(E?.chunks??0)} moments · last ${m.days} days · updated ${Ne}`:ye?"No index yet":"Loading index",se=me(J?.facets,"harness"),te=me(J?.facets,"project");return e.jsxs("main",{className:"ks-page",children:[e.jsxs("div",{className:"ks-shell",children:[e.jsx("header",{className:"ks-header",children:e.jsxs("div",{className:"ks-header-titles",children:[e.jsx("span",{className:"ks-eyebrow",children:"Search"}),e.jsx("h1",{children:"Find anything you ran, opened, or decided"}),e.jsxs("p",{children:["Search across sessions, skills, MCP tools, codebase, and context packs from the last ",m.days," days."]})]})}),e.jsxs("form",{className:"ks-search-form",onSubmit:ge,role:"search",children:[e.jsx(Me,{size:17,strokeWidth:1.75,"aria-hidden":"true"}),e.jsx("input",{value:n.query,onChange:s=>j({query:s.target.value}),placeholder:"Search topics, files, decisions, agents…",className:"ks-search-input",spellCheck:!1,autoFocus:!0,"aria-label":"Search OpenScout knowledge"}),n.query?e.jsx("button",{type:"button",className:"ks-search-clear",onClick:()=>j({query:""}),"aria-label":"Clear search",children:e.jsx(We,{size:14,"aria-hidden":"true"})}):e.jsx("span",{className:"ks-search-hint","aria-hidden":"true",children:"/"}),W?e.jsx(de,{size:15,className:"ks-spin","aria-hidden":"true"}):null]}),e.jsxs("section",{className:"ks-filterbar","aria-label":"Search filters",children:[e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Be,{size:12,"aria-hidden":"true"}),"Source"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Source kind filters",children:qe.map(s=>e.jsx(I,{active:n.sourceKinds.includes(s),onClick:()=>j({sourceKinds:n.sourceKinds.includes(s)?n.sourceKinds.filter(t=>t!==s):[...n.sourceKinds,s]}),label:fe[s]??s},s))})]}),se.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Pe,{size:12,"aria-hidden":"true"}),"Agent"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Harness filters",children:se.map(s=>e.jsx(I,{active:n.harness.includes(s.value),onClick:()=>j({harness:n.harness.includes(s.value)?n.harness.filter(t=>t!==s.value):[...n.harness,s.value]}),label:xe(s.value),count:s.count},`harness:${s.value}`))})]}):null,te.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Ue,{size:12,"aria-hidden":"true"}),"Project"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Project filters",children:te.map(s=>e.jsx(I,{active:n.project.includes(s.value),onClick:()=>j({project:n.project.includes(s.value)?n.project.filter(t=>t!==s.value):[...n.project,s.value]}),label:s.value,count:s.count},`project:${s.value}`))})]}):null,e.jsxs("div",{className:"ks-filterbar-row ks-filterbar-row--inline",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(ze,{size:12,"aria-hidden":"true"}),"Time"]}),e.jsxs("div",{className:"ks-chip-row",role:"group","aria-label":"Time window filter",children:[e.jsx(I,{active:n.timeWindow==="all",onClick:()=>j({timeWindow:"all"}),label:"Any time"}),Ve.map(s=>e.jsx(I,{active:n.timeWindow===s.value,onClick:()=>j({timeWindow:s.value}),label:s.label},s.value))]}),pe(n)?e.jsx("button",{type:"button",className:"ks-clear-all",onClick:A,children:"Clear filters"}):null]})]}),O?e.jsx("section",{className:"ks-error",role:"alert",children:O}):null,!p&&!O?e.jsxs("div",{className:"ks-empty-state",children:[e.jsx("strong",{children:K?"Preparing your session index":"Preparing search"}),e.jsxs("span",{children:["First load builds the last ",m.days," days"," ","(up to ",y(m.sessionLimit)," sessions). You can keep this page open — results appear as soon as the index is ready."]})]}):null,p?e.jsxs("div",{className:"ks-hit-list",role:"listbox","aria-label":"Search results",children:[e.jsxs("div",{className:"ks-hit-list-head","aria-live":"polite",children:[e.jsx("span",{children:W?"Searching…":L?`${y(v.length)} session${v.length===1?"":"s"}`:"Ready"}),L&&w.length>0?e.jsxs("span",{className:"ks-hit-list-meta",children:[y(w.length)," moment",w.length===1?"":"s",P?e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"ks-text-action",onClick:A,children:"Clear filters"})]}):null]}):null]}),L&&v.length===0&&!W?e.jsxs("div",{className:"ks-empty-hit",children:[e.jsxs("strong",{children:["No matches for “",L,"”"]}),e.jsxs("span",{children:["Try a project name, file path, or topic from recent work",P?", or clear one of the filters above.":"."]}),e.jsxs("div",{className:"ks-empty-hit-actions",children:[e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>j({query:""}),children:"Clear query"}),P?e.jsx("button",{type:"button",className:"ks-text-action",onClick:A,children:"Clear all filters"}):null]})]}):null,L?null:e.jsxs("div",{className:"ks-empty-hit ks-empty-hit--quiet",children:[e.jsx("strong",{children:"Start with a query"}),e.jsxs("span",{children:["Type a topic, file path, agent, or session hint. Use"," ",e.jsx("kbd",{children:"/"})," to focus this field, ",e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," to walk results, ",e.jsx("kbd",{children:"↵"})," to select, ",e.jsx("kbd",{children:"⌘↵"})," to open the session."]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:be,disabled:w.length===0,children:"Pick the first result automatically"})]}),e.jsx("div",{className:"ks-hit-list-body",children:v.map((s,t)=>{const r=s.best,d=Ae(r),x=Ie(r),N=ce(ue(r)),D=()=>{N&&i({view:"sessions",sessionId:N})},z=s.moments.some(k=>u?.id===k.id);return e.jsxs("section",{className:`ks-session${z?" ks-session--selected":""}`,"aria-label":`Session ${t+1}`,children:[e.jsxs("header",{className:"ks-session-head",children:[e.jsxs("div",{className:"ks-session-topline",children:[e.jsxs("div",{className:"ks-session-meta",children:[d.agent?e.jsx("span",{className:"ks-hit-chip",children:d.agent}):null,d.project?e.jsx("span",{children:d.project}):null,d.session?e.jsxs("span",{className:"ks-hit-session",title:N??d.session,children:["session ",d.session]}):null,e.jsxs("span",{className:"ks-session-count",children:[y(s.moments.length)," match",s.moments.length===1?"":"es"]})]}),d.when?e.jsx("time",{className:"ks-hit-when",children:d.when}):null]}),e.jsx("button",{type:"button",className:"ks-session-goal",onClick:D,title:N?"Open session":void 0,children:x})]}),e.jsx("div",{className:"ks-session-moments",children:s.moments.map(k=>{const ie=Te(k,n.query),ae=u?.id===k.id,_=He(k,n.query,200),ne=Re(k),B=()=>g(k,n.query),re=()=>{const h=ce(ue(k))??N;if(!h){B();return}i({view:"sessions",sessionId:h})};return e.jsx("article",{className:`ks-hit${ae?" ks-hit--selected":""}`,role:"option","aria-selected":ae,tabIndex:0,onClick:B,onDoubleClick:re,onKeyDown:h=>{if(h.key==="Enter"&&(h.metaKey||h.ctrlKey)){h.preventDefault(),re();return}Je(h,B)},children:e.jsxs("div",{className:"ks-hit-body",children:[ne.length>0?e.jsx("div",{className:"ks-hit-details ks-hit-details--moment","aria-label":"Turn",children:ne.map(h=>e.jsx("span",{className:"ks-hit-details-strong",children:h},h))}):null,e.jsx("h3",{className:"ks-hit-title",children:ie}),_&&_!==ie?e.jsx("p",{className:"ks-hit-snippet",children:e.jsx(Ge,{text:_,query:n.query})}):null]})},k.id)})})]},s.collectionId)})})]}):null]}),e.jsxs("footer",{className:"ks-foot-status","aria-live":"polite",children:[e.jsxs("span",{className:"ks-foot-status-facts",children:[Z?e.jsx(de,{size:12,className:"ks-spin","aria-hidden":"true"}):null,Se,pe(n)?e.jsxs(e.Fragment,{children:[" · ",Ye(n)]}):null]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>{ee(!0)},disabled:K,children:K?"Updating…":"Update index"})]})]})}export{Ps as KnowledgeSearchScreen};
@@ -1 +1 @@
1
- import{r as n,j as T}from"./index-CzVeWScw.js";import{r as j}from"./index-Dewd56RX.js";import{b as D,l as N}from"./lane-tool-detail-0WhMf4Vj.js";import"./lane-edit-display-C_Aujldz.js";const _=140,k=100,p=320,v=4,u=8,S=7;function y(e){return(e.querySelector(".s-observe-tool")??e).getBoundingClientRect()}function F(){return document.querySelector("[data-scout-theme]")??document.body}function q(e,t){return e===t?!0:!e||!t?!1:e.top===t.top&&e.left===t.left&&e.side===t.side&&e.caretTop===t.caretTop}function W(e,t){const l=window.innerWidth,f=window.innerHeight,E=e.top+e.height/2,d=l-e.right-u,m=e.left-u,R=d>=p+v,a=m>=p+v;let c="right",s=e.right+v,o=e.top;R?(c="right",s=e.right+v):a?(c="left",s=e.left-v-p):(c="right",s=Math.max(u,Math.min(e.right+v,l-p-u)),o=e.bottom+v),o+t>f-u&&(o=Math.max(u,e.top-t+e.height)),o=Math.max(u,Math.min(o,f-t-u)),s=Math.max(u,Math.min(s,l-p-u));const x=Math.max(S+4,Math.min(E-o,t-S-4));return{top:o,left:s,side:c,caretTop:x}}function G({model:e,position:t,cardRef:l,onMouseEnter:f,onMouseLeave:E}){const d=N(e),m=e.hoverFields.find(a=>a.label==="when"),R={position:"fixed",top:t.top,left:t.left,width:p,maxWidth:p,"--hover-caret-top":`${t.caretTop}px`};return T.jsxs("div",{ref:l,className:`s-observe-tool-hover-card s-observe-tool-hover-card--side-${t.side}`,style:R,onMouseEnter:f,onMouseLeave:E,role:"tooltip",children:[T.jsx("div",{className:"s-observe-tool-hover-card-cmd",children:e.command}),m&&T.jsx("div",{className:"s-observe-tool-hover-card-meta",children:m.value}),d.slice(1).map((a,c)=>T.jsx("div",{className:"s-observe-tool-hover-card-line",children:a},c)),T.jsx("div",{className:"s-observe-tool-hover-card-hint",children:"Click row for full detail"})]})}function $(e=!0){const[t,l]=n.useState(null),[f,E]=n.useState(null),d=n.useRef(new Map),m=n.useRef(new Map),R=n.useRef(new Map),a=n.useRef(new Map),c=n.useRef(null),s=n.useRef(null),o=n.useRef(null),x=n.useRef(null);c.current=t;const L=n.useCallback(()=>{s.current&&clearTimeout(s.current),o.current&&clearTimeout(o.current),s.current=null,o.current=null},[]),I=n.useMemo(()=>{if(!e||!t)return null;const r=R.current.get(t);if(!r)return null;const i=m.current.get(t);return D(r,i)},[e,t]),M=n.useCallback(r=>{E(i=>q(i,r)?i:r)},[]),g=n.useCallback(()=>{const r=c.current;if(!r){M(null);return}const i=d.current.get(r);if(!i)return;const w=y(i),h=x.current?.offsetHeight??132;M(W(w,h))},[M]);n.useEffect(()=>()=>L(),[L]),n.useLayoutEffect(()=>{if(!t){M(null);return}g();const r=requestAnimationFrame(g);return()=>cancelAnimationFrame(r)},[t,M,g]),n.useEffect(()=>{if(!t)return;const r=()=>g();return window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)}},[t,g]);const C=n.useCallback(r=>{e&&(o.current&&clearTimeout(o.current),o.current=null,c.current!==r&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{l(r),s.current=null},_)))},[e]),b=n.useCallback(()=>{s.current&&clearTimeout(s.current),s.current=null,c.current&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(null),o.current=null},k))},[]),A=n.useCallback((r,i)=>{R.current.set(r.id,r),m.current.set(r.id,i);let w=a.current.get(r.id);if(!w){const h=r.id;w={ref:P=>{P?d.current.set(h,P):d.current.delete(h)},onMouseEnter:()=>C(h),onMouseLeave:b,onFocus:()=>C(h),onBlur:b},a.current.set(h,w)}return w},[C,b]),H=e&&I&&f&&typeof document<"u"?j.createPortal(T.jsx(G,{model:I,position:f,cardRef:x,onMouseEnter:()=>{const r=c.current;r&&C(r)},onMouseLeave:b}),F()):null;return{bind:A,card:H,hoveredEventId:t}}export{$ as useLaneToolHoverCard};
1
+ import{r as n,j as T}from"./index-o4FKpU7Z.js";import{r as j}from"./index-BMwKgdz_.js";import{b as D,l as N}from"./lane-tool-detail-0WhMf4Vj.js";import"./lane-edit-display-C_Aujldz.js";const _=140,k=100,p=320,v=4,u=8,S=7;function y(e){return(e.querySelector(".s-observe-tool")??e).getBoundingClientRect()}function F(){return document.querySelector("[data-scout-theme]")??document.body}function q(e,t){return e===t?!0:!e||!t?!1:e.top===t.top&&e.left===t.left&&e.side===t.side&&e.caretTop===t.caretTop}function W(e,t){const l=window.innerWidth,f=window.innerHeight,E=e.top+e.height/2,d=l-e.right-u,m=e.left-u,R=d>=p+v,a=m>=p+v;let c="right",s=e.right+v,o=e.top;R?(c="right",s=e.right+v):a?(c="left",s=e.left-v-p):(c="right",s=Math.max(u,Math.min(e.right+v,l-p-u)),o=e.bottom+v),o+t>f-u&&(o=Math.max(u,e.top-t+e.height)),o=Math.max(u,Math.min(o,f-t-u)),s=Math.max(u,Math.min(s,l-p-u));const x=Math.max(S+4,Math.min(E-o,t-S-4));return{top:o,left:s,side:c,caretTop:x}}function G({model:e,position:t,cardRef:l,onMouseEnter:f,onMouseLeave:E}){const d=N(e),m=e.hoverFields.find(a=>a.label==="when"),R={position:"fixed",top:t.top,left:t.left,width:p,maxWidth:p,"--hover-caret-top":`${t.caretTop}px`};return T.jsxs("div",{ref:l,className:`s-observe-tool-hover-card s-observe-tool-hover-card--side-${t.side}`,style:R,onMouseEnter:f,onMouseLeave:E,role:"tooltip",children:[T.jsx("div",{className:"s-observe-tool-hover-card-cmd",children:e.command}),m&&T.jsx("div",{className:"s-observe-tool-hover-card-meta",children:m.value}),d.slice(1).map((a,c)=>T.jsx("div",{className:"s-observe-tool-hover-card-line",children:a},c)),T.jsx("div",{className:"s-observe-tool-hover-card-hint",children:"Click row for full detail"})]})}function $(e=!0){const[t,l]=n.useState(null),[f,E]=n.useState(null),d=n.useRef(new Map),m=n.useRef(new Map),R=n.useRef(new Map),a=n.useRef(new Map),c=n.useRef(null),s=n.useRef(null),o=n.useRef(null),x=n.useRef(null);c.current=t;const L=n.useCallback(()=>{s.current&&clearTimeout(s.current),o.current&&clearTimeout(o.current),s.current=null,o.current=null},[]),I=n.useMemo(()=>{if(!e||!t)return null;const r=R.current.get(t);if(!r)return null;const i=m.current.get(t);return D(r,i)},[e,t]),M=n.useCallback(r=>{E(i=>q(i,r)?i:r)},[]),g=n.useCallback(()=>{const r=c.current;if(!r){M(null);return}const i=d.current.get(r);if(!i)return;const w=y(i),h=x.current?.offsetHeight??132;M(W(w,h))},[M]);n.useEffect(()=>()=>L(),[L]),n.useLayoutEffect(()=>{if(!t){M(null);return}g();const r=requestAnimationFrame(g);return()=>cancelAnimationFrame(r)},[t,M,g]),n.useEffect(()=>{if(!t)return;const r=()=>g();return window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)}},[t,g]);const C=n.useCallback(r=>{e&&(o.current&&clearTimeout(o.current),o.current=null,c.current!==r&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{l(r),s.current=null},_)))},[e]),b=n.useCallback(()=>{s.current&&clearTimeout(s.current),s.current=null,c.current&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(null),o.current=null},k))},[]),A=n.useCallback((r,i)=>{R.current.set(r.id,r),m.current.set(r.id,i);let w=a.current.get(r.id);if(!w){const h=r.id;w={ref:P=>{P?d.current.set(h,P):d.current.delete(h)},onMouseEnter:()=>C(h),onMouseLeave:b,onFocus:()=>C(h),onBlur:b},a.current.set(h,w)}return w},[C,b]),H=e&&I&&f&&typeof document<"u"?j.createPortal(T.jsx(G,{model:I,position:f,cardRef:x,onMouseEnter:()=>{const r=c.current;r&&C(r)},onMouseLeave:b}),F()):null;return{bind:A,card:H,hoveredEventId:t}}export{$ as useLaneToolHoverCard};
@@ -0,0 +1 @@
1
+ import{r as f,j as e}from"./index-o4FKpU7Z.js";import{S as L}from"./SlidePanel-CuTeirnk.js";import{A as j}from"./AgentAvatar-DMov24_o.js";import{H as S}from"./HarnessMark-MztYnrGK.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as g,f as k,b as y}from"./lane-observe-BA3g9aVd.js";import{S as A}from"./SessionObserve-DaUrJCMq.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-Bl9L0EYb.js";import{b as T}from"./agent-lane-detail-BNNm6FNu.js";import{l as I,a as z}from"./agent-lanes-model-VYQ5a68i.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./colors-BtO5_zlx.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-CcEiQC6B.js";import"./index-BMwKgdz_.js";import"./lane-ask-display-B6iCAVcd.js";import"./api-h5zurxmi.js";import"./mentions-CvDaviLJ.js";import"./Provider-DKZWuzSR.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./openContent-C6XO6kr5.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.js";import"./message-markup-BcY1lShv.js";import"./ObservedTopologyPanel-ByW7Ar7p.js";import"./ObserveTextFlow-_ApDwRCO.js";import"./use-reduced-motion-CqXpVXv-.js";import"./SessionObserveEvidence-ClUW8jpV.js";import"./message-circle-BM3XgevU.js";import"./wrench-M4G7WtYB.js";import"./external-link-Dem738OJ.js";import"./context-budget-DX_fwUs3.js";const M={think:"Thought",tool:"Tool",ask:"Request",message:"Message",note:"Note",system:"System",boot:"Boot"};function Qe({target:d,onClose:n}){const{lane:i,event:t}=d,{agent:s,observe:l,source:r,lastActiveAt:a}=i,p=f.useMemo(()=>T(i),[i]),c=I(s,r),v=z(s,r),h=M[t.kind]??t.kind,u=l?.metadata?.session?.sessionStart,o=g(t,u),b=o!=null?k(o,a):void 0,x=o!=null?y(o):void 0,m=t.kind==="tool"||t.kind==="ask"?t:void 0;return e.jsxs(L,{open:!0,onClose:n,side:"right",owner:"openscout.lane-trace",layer:"elevated",resizable:!0,defaultSize:980,minSize:560,maxSize:1280,scrollLock:!0,ariaLabel:`${c} session trace`,className:"s-lane-trace-sheet",children:[e.jsxs("div",{className:"s-slide-header s-lane-trace-sheet-header",children:[e.jsx(j,{agent:s,placement:"row",size:28,presence:!1,className:"s-agent-lane-avatar"}),e.jsxs("div",{className:"s-lane-trace-sheet-header-copy",children:[e.jsx("div",{className:"s-lane-trace-sheet-title",children:c}),e.jsxs("div",{className:"s-lane-trace-sheet-sub",children:[v," · ",h,a?` · ${N(a)}`:""]})]}),e.jsx("span",{className:"s-slide-spacer"}),e.jsx(S,{harness:s.harness??p.harness,size:18,className:"s-lane-trace-sheet-hmark"}),e.jsx("button",{type:"button",className:"s-slide-close",onClick:n,"aria-label":"Close",children:"×"})]}),e.jsx("div",{className:"s-slide-body s-lane-trace-sheet-body",children:e.jsx(A,{data:l??void 0,agentId:r==="scout"?s.id:void 0,sessionId:s.harnessSessionId??p.sessionId,showRail:!0,variant:"default",initialCursorT:t.t,focusEventId:t.id,inlineFocusEventId:m?.id,inlineFocusContent:m?e.jsx(E,{event:m,wallLabel:b,wallTitle:x,variant:"inline"}):void 0})})]})}export{Qe as LaneTraceDetailSheet};
@@ -1 +1 @@
1
- import{j as e,r as o}from"./index-CzVeWScw.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-o4FKpU7Z.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-CzVeWScw.js";import{C as me}from"./chunk-T65CQEWV-CiZ_ICHW.js";import{u as te,t as de,b as pe,c as ue}from"./mesh-view-store-Btlyc7rW.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-DSsb2gLR.js";import{u as xe}from"./useAgentHoverCard-FtCmY-b9.js";import{b as ye}from"./mesh-buckets-CfAukILK.js";import"./plus-CmFQp9Uj.js";import"./createLucideIcon-ClCdc3F9.js";import"./router-B-K15T7B.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-C3qU8tnY.js";import"./api-h5zurxmi.js";import"./sse-QcU9bikk.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-N-Z6X0Z1.js";import"./DocumentFocusViewer-BCG2kOmd.js";import"./TextDocumentSurface-DRjctOIt.js";/* empty css */import"./file-text-DG-pufl1.js";import"./x-D4X_y1j_.js";import"./chevron-right-CNE6QAVr.js";import"./code-xml--LjSM4Mv.js";import"./arrow-left-_vS7itsV.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BJnFoFDP.js";import"./MessageComposerSuggestions-Cs9u-F_3.js";import"./NewChatComposer-DXDxV2Mh.js";import"./runtime-picker-BCQD7d4K.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./index-Dewd56RX.js";import"./HarnessMark-BE-YSyci.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-CnjoswTG.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-DRCbnzyY.js";import"./search-C3bSJluv.js";import"./chunk-HRAB3GC3-CAeEKaf5.js";import"./AgentDetailCard-sZuHl1de.js";import"./AgentLiveActions-DI4ooSHW.js";import"./terminal-takeover-KvmTwABa.js";import"./openContent-C6XO6kr5.js";import"./eye-BFlhMzQL.js";import"./terminal-DrTkVXIj.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-o4FKpU7Z.js";import{C as me}from"./Canvas-BePL08RR.js";import{u as te,t as de,b as pe,c as ue}from"./mesh-view-store-Du7VqIT_.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-DKZWuzSR.js";import{u as xe}from"./useAgentHoverCard-RsLUYyeh.js";import{b as ye}from"./mesh-buckets-CfAukILK.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./openContent-C6XO6kr5.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.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
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-CzVeWScw.js";import{u as v,d as $,t as C,a as M,r as b}from"./mesh-view-store-Btlyc7rW.js";import{u as w}from"./Provider-DSsb2gLR.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-o4FKpU7Z.js";import{u as v,d as $,t as C,a as M,r as b}from"./mesh-view-store-Du7VqIT_.js";import{u as w}from"./Provider-DKZWuzSR.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-o4FKpU7Z.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-DKZWuzSR.js";import{d as K}from"./router-C65cZYPn.js";import{MeshCanvas as U}from"./MeshCanvas-ZjIuMiRo.js";import{u as V}from"./useAgentHoverCard-RsLUYyeh.js";import{u as Q}from"./local-agents-DIi2EacM.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-Du7VqIT_.js";import{u as Z}from"./useContentSecondaryNav-DOr5yHbT.js";import{OpsSubnav as G}from"./OpsSubnav-CZs_OL2N.js";/* empty css *//* empty css */import"./provider-BvAxRQfE.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./Canvas-BePL08RR.js";import"./mesh-buckets-CfAukILK.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./openContent-C6XO6kr5.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.js";import"./SecondaryNav-Dj30epYF.js";import"./secondaryNavConfig-CSFDCQAf.js";import"./message-square-ER1_q2pe.js";import"./scroll-text-BuneRiAD.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-NlJw-19N.js","assets/index-CzVeWScw.js","assets/index-9as_JTUs.css"])))=>i.map(i=>d[i]);
2
- import{r as g,j as d,_ as j}from"./index-CzVeWScw.js";const E=g.lazy(()=>j(()=>import("./arc.es-NlJw-19N.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-BBTfhvLE.js","assets/index-o4FKpU7Z.js","assets/index-Bu-fckyR.css"])))=>i.map(i=>d[i]);
2
+ import{r as g,j as d,_ as j}from"./index-o4FKpU7Z.js";const E=g.lazy(()=>j(()=>import("./arc.es-BBTfhvLE.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 +1 @@
1
- import{a as x}from"./api-h5zurxmi.js";import{j as o}from"./index-CzVeWScw.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};
1
+ import{a as x}from"./api-h5zurxmi.js";import{j as o}from"./index-o4FKpU7Z.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-o4FKpU7Z.js";import{i as w,a as C}from"./conversation-model-CHwHZNw-.js";import{u as M,m as S,g as b}from"./Provider-DKZWuzSR.js";import{d as A}from"./router-C65cZYPn.js";import{l as I,i as B,s as E}from"./sessionRead-CvFz2RHv.js";import{u as L}from"./use-conversation-list-BCzY032j.js";import{u as R}from"./use-fleet-active-asks-CJ6-oj5k.js";import{ConversationScreen as D}from"./ConversationScreen-oZSitVtX.js";import{P as O}from"./plus-C-2gTcPK.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./provider-BvAxRQfE.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./ConversationComposer-CWohCCmn.js";import"./message-markup-BcY1lShv.js";import"./mentions-CvDaviLJ.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./openContent-C6XO6kr5.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.js";import"./message-visibility-kJM8XcSG.js";import"./clipboard-e3fSpeo7.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-BxTzXl8e.js";import"./BackToPicker-BXp5E2ck.js";import"./ConversationFeedRows-IWh0JSIL.js";import"./ConversationPanels-D9UCwNkS.js";import"./use-reduced-motion-CqXpVXv-.js";import"./activity-BvGruxWG.js";import"./message-circle-BM3XgevU.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-NLIWLq27.js";import"./ConversationStatus-B6pAbo2w.js";function nt({conversationId:s,navigate:c}){return s?e.jsx(D,{conversationId:s,navigate:c,showBackNav:!1}):e.jsx(P,{})}function P(){const{onlineCount:s,apiConnection:c,reload:j,route:N,agents:d,openContextCapture:k,navigate:u}=M(),{sessions:y,loading:p,loadError:n}=L(),[x]=a.useState(()=>I()),v=R(),t=c.status==="offline",i=A(N),f=a.useRef(!1),h=a.useMemo(()=>{const m=S(d,i);return[...b(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||t||r&&(f.current=!0,E(r.id),u({view:"messages",conversationId:r.id,...i?{machineId:i}:{}},{replace:!0}))},[r,p,n,t,i,u]);const l=!t&&!n&&(p||!!r);return e.jsx("div",{className:`s-conv-empty${t?" 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:t?"Connection":"Conversations"}),e.jsx("p",{className:"s-conv-empty-title",children:t?"Scout server offline":l?"Opening your latest conversation":n?"Chats unavailable":"Nothing open yet"}),e.jsx("p",{className:"s-conv-empty-detail",children:t?"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."}),t||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"}),t?"waiting for server":`${s} ${s===1?"agent":"agents"} active`]})]})})}function V(s){return s?C(s):"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{nt as MessagesScreen};
@@ -1 +1 @@
1
- import{r as h,j as s}from"./index-CzVeWScw.js";import{H as A}from"./HarnessMark-BE-YSyci.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-DDvNdA8s.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};
1
+ import{r as h,j as s}from"./index-o4FKpU7Z.js";import{H as A}from"./HarnessMark-MztYnrGK.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-0LPfBC8S.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-o4FKpU7Z.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-C6w5iVfg.js";import{u as be}from"./observe-3-jn4SXb.js";import{e as me}from"./NewChatComposer-S08F6_La.js";import{i as Ee,c as je}from"./keyboard-nav-Chf51dns.js";import{g as Me}from"./tail-display-BRcJltQa.js";import{u as Le}from"./tail-events-NLIWLq27.js";import{u as Te}from"./Provider-DKZWuzSR.js";import{MissionContextRail as ke}from"./MissionContextRail-CjGAEGu8.js";import{FocusOverlay as Ne}from"./MissionFocusOverlay-Bubrr8Gc.js";import{MissionLogPane as Ce}from"./MissionLogPane-Cs0LuIkn.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-eDEvx2Mz.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./createLucideIcon-Bt67PWH-.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-ynOfVadO.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./file-text-iF0hyVyU.js";import"./lane-edit-display-C_Aujldz.js";import"./index-BWHgHrtv.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CL6gctHY.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./bash-format-BRV5C6Gv.js";import"./context-budget-DX_fwUs3.js";import"./page-status-0LPfBC8S.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 ls({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{ls as MissionControlView};
@@ -1 +1 @@
1
- import{r as f,j as e}from"./index-CzVeWScw.js";import{d as w,c as N,n as $}from"./colors-BtO5_zlx.js";import{u as C}from"./keyboard-nav-BJnFoFDP.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-DDvNdA8s.js";import{M as S}from"./runtime-picker-BCQD7d4K.js";import"./index-Dewd56RX.js";import{K as k}from"./mission-control-model-C0fByIjm.js";import"./scout-voice-S5_YZ2v8.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Byb9kSFx.js";import"./createLucideIcon-ClCdc3F9.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};
1
+ import{r as f,j as e}from"./index-o4FKpU7Z.js";import{d as w,c as N,n as $}from"./colors-BtO5_zlx.js";import{u as C}from"./keyboard-nav-Chf51dns.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-0LPfBC8S.js";import{M as S}from"./runtime-picker-eDEvx2Mz.js";import"./index-BMwKgdz_.js";import{K as k}from"./mission-control-model-C0fByIjm.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./createLucideIcon-Bt67PWH-.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};
@@ -1 +1 @@
1
- import{j as l}from"./index-CzVeWScw.js";import{c as j}from"./colors-BtO5_zlx.js";import{s as x}from"./page-status-DDvNdA8s.js";import{t as i}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-DerXOXQS.js";import"./AgentAvatar-CszU5eaU.js";import"./SpriteAvatar-BpQDpOkq.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};
1
+ import{j as l}from"./index-o4FKpU7Z.js";import{c as j}from"./colors-BtO5_zlx.js";import{s as x}from"./page-status-0LPfBC8S.js";import{t as i}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-DIGd3MMM.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.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};