@openscout/scout 0.2.98 → 0.2.105

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 (669) hide show
  1. package/NOTICE +7 -0
  2. package/README.md +37 -0
  3. package/bin/scout.mjs +6 -0
  4. package/bin/scoutd +0 -0
  5. package/dist/build-manifest.json +4 -4
  6. package/dist/chat.mjs +285 -0
  7. package/dist/client/assets/ActivityScreen-CcDdQTBK.js +1 -0
  8. package/dist/client/assets/{AddProjectForm-fXndbzXT.js → AddProjectForm-CHNJ4NnS.js} +1 -1
  9. package/dist/client/assets/AdventureEvidence-B4mEvXeD.js +5 -0
  10. package/dist/client/assets/AdventureReader-ZsBDQITY.js +4 -0
  11. package/dist/client/assets/AdventureScenery-DSxDlqG1.js +1 -0
  12. package/dist/client/assets/AgentAdventures-BxrYq_2v.js +1 -0
  13. package/dist/client/assets/AgentAvatar-NZOqcsB2.js +1 -0
  14. package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +1 -0
  15. package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +1 -0
  16. package/dist/client/assets/AgentDetailCard-MIEBKw_S.js +1 -0
  17. package/dist/client/assets/AgentFloorView-A0dDRlRV.js +1 -0
  18. package/dist/client/assets/AgentFloorWorld-BTqwmK5G.js +1 -0
  19. package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +1 -0
  20. package/dist/client/assets/{AgentLaneCard-Cc9uyfBr.js → AgentLaneCard-C4rKLLdT.js} +1 -1
  21. package/dist/client/assets/{AgentLaneChrome-Dv2lBFoH.js → AgentLaneChrome-fGC-ZrJS.js} +1 -1
  22. package/dist/client/assets/{AgentLaneDetailSheet-CGqtqSHQ.js → AgentLaneDetailSheet-BTF4_th9.js} +2 -2
  23. package/dist/client/assets/{AgentLaneSummaryResize-Di4u6df2.js → AgentLaneSummaryResize-DgSeA_vS.js} +1 -1
  24. package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +1 -0
  25. package/dist/client/assets/{AgentLanesPreflight-CCGBArIb.js → AgentLanesPreflight-CcS23wij.js} +1 -1
  26. package/dist/client/assets/AgentLanesView-WZhEDBFE.js +2 -0
  27. package/dist/client/assets/AgentLiveActions-6Kfr1uOT.js +1 -0
  28. package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +1 -0
  29. package/dist/client/assets/AgentSessions-CO1WGa8Z.js +6 -0
  30. package/dist/client/assets/AgentsConsole-BQOWkj35.js +1 -0
  31. package/dist/client/assets/AgentsScreen-BMNAj1PH.js +1 -0
  32. package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +1 -0
  33. package/dist/client/assets/{AstronautSuit-CwB4Dw07.js → AstronautSuit-D67fIBdR.js} +1 -1
  34. package/dist/client/assets/AtopView-Ck30FbzG.js +1 -0
  35. package/dist/client/assets/BackToPicker-CkBhGRlD.js +1 -0
  36. package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +1 -0
  37. package/dist/client/assets/BriefingsScreen-DTxYMr3a.js +1 -0
  38. package/dist/client/assets/{BrokerMetadataPanel-BJSwU9XZ.js → BrokerMetadataPanel-crirZCdo.js} +1 -1
  39. package/dist/client/assets/BrokerScreen-CT37VQiL.js +8 -0
  40. package/dist/client/assets/Canvas-CRP0KjKb.js +1 -0
  41. package/dist/client/assets/{CastPicker-CkgTalIt.js → CastPicker-ZPomvOf-.js} +1 -1
  42. package/dist/client/assets/ChannelComposer-BVItWlEz.js +1 -0
  43. package/dist/client/assets/ChannelSidebar-B-2spawY.js +1 -0
  44. package/dist/client/assets/CharacterFamilyPreview-BniL8sEL.css +1 -0
  45. package/dist/client/assets/CharacterFamilyPreview-ckVkecDO.js +1 -0
  46. package/dist/client/assets/ChatAvatar-DKBsbOqk.js +1 -0
  47. package/dist/client/assets/ChatBits-CLJ71hTY.js +1 -0
  48. package/dist/client/assets/ChatCollapsedStrip-Co0NmqOO.js +1 -0
  49. package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +1 -0
  50. package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +1 -0
  51. package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +1 -0
  52. package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +1 -0
  53. package/dist/client/assets/{CodeDiffPane-DfluIWmO.js → CodeDiffPane-D-iv28LJ.js} +1 -1
  54. package/dist/client/assets/{CodeProjectPicker-By_Wz9ex.js → CodeProjectPicker-CZ3gDdiT.js} +1 -1
  55. package/dist/client/assets/CodeScreen-CSC-zbP9.js +1 -0
  56. package/dist/client/assets/CommsCanvas-BR2YS76H.css +1 -0
  57. package/dist/client/assets/CommsCanvas-DdNAwjGW.js +1 -0
  58. package/dist/client/assets/CommsDeck-mGWY7Ivi.js +1 -0
  59. package/dist/client/assets/CommsFlowGraph-vQucylxF.css +1 -0
  60. package/dist/client/assets/CommsFlowGraph-voDD9M5R.js +1 -0
  61. package/dist/client/assets/CommsFlowMap-C33sgD48.js +1 -0
  62. package/dist/client/assets/CommsSelection-BL8aYD7z.js +1 -0
  63. package/dist/client/assets/{ConversationComposer-BUIjWMBi.js → ConversationComposer-DNcn5U6D.js} +1 -1
  64. package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +1 -0
  65. package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +1 -0
  66. package/dist/client/assets/ConversationPanels-6pprBpmq.js +6 -0
  67. package/dist/client/assets/ConversationScreen-Brfas2y0.css +1 -0
  68. package/dist/client/assets/ConversationScreen-tpj4cqWs.js +2 -0
  69. package/dist/client/assets/ConversationStatus-Cv-7hErW.js +1 -0
  70. package/dist/client/assets/{CrewAvatar-CZ_faQ_s.js → CrewAvatar-zgzC3cbU.js} +1 -1
  71. package/dist/client/assets/CrewSprite-Dp9KBBGY.js +1 -0
  72. package/dist/client/assets/CrewSprite-DsQJdu3Z.css +1 -0
  73. package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
  74. package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +1 -0
  75. package/dist/client/assets/{DataTable-C6aMSilS.js → DataTable-av71ehJV.js} +1 -1
  76. package/dist/client/assets/DispatchAftermath-CcYGUB10.js +1 -0
  77. package/dist/client/assets/DocumentFocusViewer-DlMiEALb.js +1 -0
  78. package/dist/client/assets/{EmbeddableSurfacesLab-D3iZiS8o.js → EmbeddableSurfacesLab-CTkO_tQR.js} +1 -1
  79. package/dist/client/assets/{EmptyState-CKPWFSjq.js → EmptyState-CYUwYyAW.js} +1 -1
  80. package/dist/client/assets/{FileViewerPane-CxNbcTYf.js → FileViewerPane-Cxhixtks.js} +2 -2
  81. package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +1 -0
  82. package/dist/client/assets/FloorContextSheet-Vj_wVZq1.js +1 -0
  83. package/dist/client/assets/FloorExchangePanel-B3TFhjLk.css +1 -0
  84. package/dist/client/assets/FloorExchangePanel-CjHSDXad.js +1 -0
  85. package/dist/client/assets/FloorMessagePasses-BG4ebnX5.js +1 -0
  86. package/dist/client/assets/FloorMessagePasses-nxwwiUom.css +1 -0
  87. package/dist/client/assets/FloorReplay-BoYaGY9t.js +1 -0
  88. package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +1 -0
  89. package/dist/client/assets/FloorSavedWork-jbtRs-YE.js +1 -0
  90. package/dist/client/assets/FloorTacticalHUD-BhyOqlL5.js +1 -0
  91. package/dist/client/assets/FollowScreen-CupyOgt4.js +1 -0
  92. package/dist/client/assets/HarnessMark-DSvM_H7H.js +1 -0
  93. package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +1 -0
  94. package/dist/client/assets/{HerdrSession-DsuxCtfX.js → HerdrSession-Dcm3vf9U.js} +3 -3
  95. package/dist/client/assets/{HomeHero-DXJo2QSO.js → HomeHero-pIZtE1cC.js} +1 -1
  96. package/dist/client/assets/HostAdvisorView-Dv5meXo2.js +1 -0
  97. package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +1 -0
  98. package/dist/client/assets/InviteSheet--5Zjct25.js +1 -0
  99. package/dist/client/assets/JumpPalette-BmiSOEmp.js +1 -0
  100. package/dist/client/assets/KnowledgeSearchInspector-B8yiM524.js +1 -0
  101. package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +1 -0
  102. package/dist/client/assets/{LaneToolHoverCard-t7-XJP-h.js → LaneToolHoverCard-D2cnTeUd.js} +1 -1
  103. package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +1 -0
  104. package/dist/client/assets/{LaneTraceEventFocus-BB5DhFQm.js → LaneTraceEventFocus-BLhVHwff.js} +1 -1
  105. package/dist/client/assets/MeshCanvas-BR25OBTJ.js +3 -0
  106. package/dist/client/assets/MeshCanvasMinimap-ClVolr4-.js +1 -0
  107. package/dist/client/assets/MeshScreen-BW1dMFWF.js +1 -0
  108. package/dist/client/assets/{MeshTopologyView-Dc0GSrKa.js → MeshTopologyView-BT3ke2D1.js} +2 -2
  109. package/dist/client/assets/MessagesScreen-CtNMfIvC.js +1 -0
  110. package/dist/client/assets/MissionContextRail-CafjuseK.js +1 -0
  111. package/dist/client/assets/MissionControlView-BjPOViGY.js +1 -0
  112. package/dist/client/assets/MissionFocusOverlay-nhy3hkxQ.js +1 -0
  113. package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +1 -0
  114. package/dist/client/assets/MissionLogPane-DiUf3vWW.js +1 -0
  115. package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +1 -0
  116. package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +1 -0
  117. package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +1 -0
  118. package/dist/client/assets/NewAgentModal-BQ2wQ5gp.js +1 -0
  119. package/dist/client/assets/NewChatComposer-BEXS8vV6.js +19 -0
  120. package/dist/client/assets/{NewChatOrigin-DCn5cWPZ.js → NewChatOrigin-C8ROO4ps.js} +1 -1
  121. package/dist/client/assets/NodeDetailPanel-BNTqYC7m.js +1 -0
  122. package/dist/client/assets/NodeMenu-CcOeFRCB.js +1 -0
  123. package/dist/client/assets/ObserveEmbedScreen-Dh30EjAQ.js +2 -0
  124. package/dist/client/assets/{ObserveTextFlow-DCJ5EmD8.js → ObserveTextFlow-CC5mnngm.js} +2 -2
  125. package/dist/client/assets/{ObservedTopologyPanel-CJVqIqQ2.js → ObservedTopologyPanel-DF6tRZL_.js} +1 -1
  126. package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +31 -0
  127. package/dist/client/assets/OpsAgentsView-D3rM0udq.js +1 -0
  128. package/dist/client/assets/OpsScreen-DySeNQ1V.js +1 -0
  129. package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +1 -0
  130. package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +1 -0
  131. package/dist/client/assets/{ProjectAgentProfileBar-CUzZ4Rpx.js → ProjectAgentProfileBar-C8z22pJ2.js} +1 -1
  132. package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +1 -0
  133. package/dist/client/assets/ProjectsInbox-DfCXReZK.js +2 -0
  134. package/dist/client/assets/ProjectsRail-CELVubfJ.js +1 -0
  135. package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +1 -0
  136. package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +1 -0
  137. package/dist/client/assets/Provider-CNZluAZb.js +5 -0
  138. package/dist/client/assets/{RailRow-B0sRaJc6.css → RailRow-B25zKEub.css} +1 -1
  139. package/dist/client/assets/RailRow-DUPqXMZh.js +1 -0
  140. package/dist/client/assets/RailToggle-BwmY70B8.js +1 -0
  141. package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +1 -0
  142. package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +9 -0
  143. package/dist/client/assets/RenderedWorkerSprite-C8fxndAh.js +1 -0
  144. package/dist/client/assets/RenderedWorkerSprite-qnTfkd_4.css +1 -0
  145. package/dist/client/assets/ReplayClock-DUVJjrIu.js +1 -0
  146. package/dist/client/assets/ReplayLog-Bek1Vc4W.js +1 -0
  147. package/dist/client/assets/ReplayOutpost-DlRg3172.js +1 -0
  148. package/dist/client/assets/ReplayOutpost-Y1DvZgeu.css +1 -0
  149. package/dist/client/assets/{RepoDiffEmbedScreen-mexrJPhW.js → RepoDiffEmbedScreen-CVUMnt6A.js} +1 -1
  150. package/dist/client/assets/{RepoDiffPageScreen-DbqX4L3q.js → RepoDiffPageScreen-D9-s5PyB.js} +1 -1
  151. package/dist/client/assets/RepoDiffViewer-D7FN-oyY.js +7 -0
  152. package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +2 -0
  153. package/dist/client/assets/{ReposScreen-CzbO1Fuy.js → ReposScreen-BQ7HO1om.js} +2 -2
  154. package/dist/client/assets/RiggedWorkerCharacter-BpYECnyK.css +1 -0
  155. package/dist/client/assets/RiggedWorkerCharacter-CJMWlvV-.js +1 -0
  156. package/dist/client/assets/SageModelStudio-768dRQr4.css +1 -0
  157. package/dist/client/assets/SageModelStudio-B526NSnw.js +4108 -0
  158. package/dist/client/assets/ScoutDeckSurface-ChkvGyEW.js +1 -0
  159. package/dist/client/assets/{ScoutSurface-NlhDsPzg.js → ScoutSurface-6g1f5chk.js} +1 -1
  160. package/dist/client/assets/{ScoutbotFxLab-l2WAahCg.js → ScoutbotFxLab-BuwBdnPf.js} +1 -1
  161. package/dist/client/assets/{SecondaryNav-Cs0_FQdj.js → SecondaryNav-Bs-_VwTC.js} +1 -1
  162. package/dist/client/assets/SessionEmbedScreen-C2wf35-P.js +1 -0
  163. package/dist/client/assets/SessionObserve-B64YsYhy.js +12 -0
  164. package/dist/client/assets/{SessionObserve-CLrHfAKZ.css → SessionObserve-CDdJ7fAE.css} +1 -1
  165. package/dist/client/assets/SessionObserveEvidence-CS1aQBpQ.js +1 -0
  166. package/dist/client/assets/SessionRefScreen-DURV0MpF.js +1 -0
  167. package/dist/client/assets/SessionsScreen-D71ZR-8t.js +1 -0
  168. package/dist/client/assets/SettingsDrawer-Nz98oBVl.js +3 -0
  169. package/dist/client/assets/SettingsScreen-CYBHal6y.js +1 -0
  170. package/dist/client/assets/SharedFloorCharacter-Bi5_md4R.css +1 -0
  171. package/dist/client/assets/SharedFloorCharacter-V04kD5T9.js +1 -0
  172. package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +1 -0
  173. package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +2 -0
  174. package/dist/client/assets/{ShikiPane-C0TuCATU.js → ShikiPane-XwFI-pCp.js} +1 -1
  175. package/dist/client/assets/{SlidePanel-CETQ5NTx.js → SlidePanel-BMpkXai_.js} +1 -1
  176. package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +1 -0
  177. package/dist/client/assets/SpriteAvatar-aHeF4ZQZ.js +1 -0
  178. package/dist/client/assets/SproutActionSprite-DI5N3gOj.js +1 -0
  179. package/dist/client/assets/{StatusPill-BllrY-eg.js → StatusPill-Dw4LP7wu.js} +1 -1
  180. package/dist/client/assets/{TailView-_gKWfaQM.js → TailView-BofjmUMJ.js} +2 -2
  181. package/dist/client/assets/Terminal-jIqnIZZ6.js +4 -0
  182. package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +1 -0
  183. package/dist/client/assets/TerminalHeaderMount-CwbQhXcI.js +1 -0
  184. package/dist/client/assets/TerminalRelay--qOBwnbR.js +46 -0
  185. package/dist/client/assets/{TextDocumentSurface-2X1Gw4eA.js → TextDocumentSurface-BK6Qy41F.js} +1 -1
  186. package/dist/client/assets/{TmuxPeek-CqTJRhkI.js → TmuxPeek-DpUT9Tpc.js} +1 -1
  187. package/dist/client/assets/{VoicePermissionsPanel-C4vkU-sU.js → VoicePermissionsPanel-D35fOnQj.js} +1 -1
  188. package/dist/client/assets/{WorkDetailScreen-DqGnuK0e.js → WorkDetailScreen-Bcf_yHhU.js} +4 -4
  189. package/dist/client/assets/WorkFilesViewer-t8AEyx3Q.js +1 -0
  190. package/dist/client/assets/WorkRunView-CxwAZ2QQ.css +1 -0
  191. package/dist/client/assets/WorkRunView-_mhG_FR2.js +1 -0
  192. package/dist/client/assets/WorldActorTalk-CKerDikx.js +1 -0
  193. package/dist/client/assets/WorldCharacter-BRrj3MQN.js +1 -0
  194. package/dist/client/assets/WorldMinimap-DOptgrc4.js +1 -0
  195. package/dist/client/assets/WorldSky-D-RJzSa6.js +1 -0
  196. package/dist/client/assets/{activity-CzTJ-YMX.js → activity-BJqFrZyB.js} +1 -1
  197. package/dist/client/assets/{addon-fit-Zx3A7pGS.js → addon-fit-CHohcvS3.js} +1 -1
  198. package/dist/client/assets/{addon-webgl-DitJj-N0.js → addon-webgl-CaRy2x2b.js} +1 -1
  199. package/dist/client/assets/adventure-evidence-DgQbBmfa.css +1 -0
  200. package/dist/client/assets/adventure-habitats-v1-CVMbdB_Z.png +0 -0
  201. package/dist/client/assets/adventure-habitats-v1-M1lcpTJh.js +1 -0
  202. package/dist/client/assets/adventure-playback-DTfkhIc0.js +3 -0
  203. package/dist/client/assets/adventure-reader-DM5UDDm9.css +1 -0
  204. package/dist/client/assets/agent-adventures-DZtWpj6k.css +1 -0
  205. package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +2 -0
  206. package/dist/client/assets/{agent-essentials-K9B6kbTS.js → agent-essentials-bKWYOZaH.js} +1 -1
  207. package/dist/client/assets/{agent-floor-CuJr1iK1.css → agent-floor-Dmr9hZHL.css} +1 -1
  208. package/dist/client/assets/agent-floor-actor-DW8zLht0.js +1 -0
  209. package/dist/client/assets/agent-floor-world-Bnd1AtwK.css +1 -0
  210. package/dist/client/assets/agent-floor-world-layout-hfMjuoui.js +1 -0
  211. package/dist/client/assets/agent-lane-card-model-CeqQGp-8.js +1 -0
  212. package/dist/client/assets/{agent-lane-detail-ppJId6Jc.js → agent-lane-detail-Ti3trpfH.js} +1 -1
  213. package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
  214. package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-DmgipV9D.css} +1 -1
  215. package/dist/client/assets/agent-lanes-model-DMAdqCmK.js +4 -0
  216. package/dist/client/assets/agent-master-THmq-1k8.css +1 -0
  217. package/dist/client/assets/agent-master-model-C-KdOFDK.js +1 -0
  218. package/dist/client/assets/{agent-specialization-CtF_jI34.js → agent-specialization-BplZUa_0.js} +1 -1
  219. package/dist/client/assets/agent-state-DDhnFEEP.js +1 -0
  220. package/dist/client/assets/{api-HFH8wFyb.js → api-BQYTwoz6.js} +1 -1
  221. package/dist/client/assets/api-DSqpVKC7.js +1 -0
  222. package/dist/client/assets/{arc.es-BNXJqSw7.js → arc.es-CubLvQ4W.js} +1 -1
  223. package/dist/client/assets/{arrow-left-eToA6GxC.js → arrow-left-DFfKAq0d.js} +1 -1
  224. package/dist/client/assets/{arrow-right-DTX42clh.js → arrow-right-DmAWnyAH.js} +1 -1
  225. package/dist/client/assets/{arrow-up-right-B09GPwFl.js → arrow-up-right-B0aLKiyF.js} +1 -1
  226. package/dist/client/assets/at-sign-DM7xeppo.js +1 -0
  227. package/dist/client/assets/book-open-BL9qvhEI.js +1 -0
  228. package/dist/client/assets/{bot-WxKXYtEX.js → bot-BhAVbcCA.js} +1 -1
  229. package/dist/client/assets/broker-display-BkBzyvbR.js +2 -0
  230. package/dist/client/assets/{cache-CeWH_KzJ.js → cache-DGBo3vIf.js} +1 -1
  231. package/dist/client/assets/chat-api-BPVC0asu.js +1 -0
  232. package/dist/client/assets/chat-space-model-B6Jg2CY4.js +4 -0
  233. package/dist/client/assets/{check-Dz2SRHft.js → check-g7D7-c1J.js} +1 -1
  234. package/dist/client/assets/{chevron-down-D120PY4g.js → chevron-down-CDzRQQGl.js} +1 -1
  235. package/dist/client/assets/{chevron-right-CowuvuE6.js → chevron-right-DKGTLiqc.js} +1 -1
  236. package/dist/client/assets/chevron-up-DX7R6KY2.js +1 -0
  237. package/dist/client/assets/{chunk-HRAB3GC3-KjjrTLCU.js → chunk-HRAB3GC3-Dvk_QpRq.js} +1 -1
  238. package/dist/client/assets/{clock-_9FDplIT.js → clock-CQb4FeMf.js} +1 -1
  239. package/dist/client/assets/{code-xml-CkkNdRmu.js → code-xml-Cmadr3pQ.js} +1 -1
  240. package/dist/client/assets/coffee-ljG1_krY.js +1 -0
  241. package/dist/client/assets/colors-CFlbwC25.js +1 -0
  242. package/dist/client/assets/comms-deck-C8nVeMBh.css +1 -0
  243. package/dist/client/assets/comms-deck-CBhsXnY-.js +2 -0
  244. package/dist/client/assets/comms-gesture-_aGFo6g3.js +2 -0
  245. package/dist/client/assets/{compass-BdpImt_W.js → compass-CvzkzkIh.js} +1 -1
  246. package/dist/client/assets/content-0AXa0klu.js +1 -0
  247. package/dist/client/assets/content-BEyJ19Lx.js +1 -0
  248. package/dist/client/assets/content-BN5weWKW.js +1 -0
  249. package/dist/client/assets/content-BNokkm7C.js +1 -0
  250. package/dist/client/assets/content-BV4PUM9q.js +1 -0
  251. package/dist/client/assets/content-BxUPlcx5.js +1 -0
  252. package/dist/client/assets/content-CIC5sku8.js +1 -0
  253. package/dist/client/assets/content-CKJ9zb7Z.js +1 -0
  254. package/dist/client/assets/content-CdkTyxqk.js +1 -0
  255. package/dist/client/assets/content-CnhhSCZq.js +1 -0
  256. package/dist/client/assets/content-D1Ze_FG9.js +1 -0
  257. package/dist/client/assets/content-DY3F9Vfr.js +1 -0
  258. package/dist/client/assets/content-DrKBYpcb.js +1 -0
  259. package/dist/client/assets/content-LSStQYj5.js +1 -0
  260. package/dist/client/assets/content-YvU-D0hF.js +1 -0
  261. package/dist/client/assets/content-oKQMyVnH.js +1 -0
  262. package/dist/client/assets/{context-budget-DqxWzalx.js → context-budget-8qFKqM-j.js} +1 -1
  263. package/dist/client/assets/{conversation-icons-DHGc9wbT.js → conversation-icons-CIRaxmid.js} +1 -1
  264. package/dist/client/assets/conversation-model-m8HhzroS.js +1 -0
  265. package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +1 -0
  266. package/dist/client/assets/conversations-Cbg9h_Af.js +1 -0
  267. package/dist/client/assets/{copy-BzdzWsQd.js → copy-BGOC1tJB.js} +1 -1
  268. package/dist/client/assets/{cpu-CHFIGw87.js → cpu-Q6nrHFTN.js} +1 -1
  269. package/dist/client/assets/{createLucideIcon-Dv8H8m7J.js → createLucideIcon-ChvMq-zl.js} +1 -1
  270. package/dist/client/assets/{credentials-BTce3VP1.js → credentials-OeoF-VKJ.js} +1 -1
  271. package/dist/client/assets/discover-DlwbftpC.js +2 -0
  272. package/dist/client/assets/embed-entry-c0lwtjBG.js +2 -0
  273. package/dist/client/assets/embed-navigation-DayfkQau.js +1 -0
  274. package/dist/client/assets/{external-link-BvX5PfLh.js → external-link-BVccgH0n.js} +1 -1
  275. package/dist/client/assets/{eye-C9cGk5z6.js → eye-CsGfEVR6.js} +1 -1
  276. package/dist/client/assets/{file-code-corner-jlGFdr8d.js → file-code-corner-Be6da5l3.js} +1 -1
  277. package/dist/client/assets/{file-text-BHro8MkG.js → file-text-DP6txVW-.js} +1 -1
  278. package/dist/client/assets/flag-DAFE2wZ5.js +1 -0
  279. package/dist/client/assets/floor-character-name-CqJPOlXb.js +1 -0
  280. package/dist/client/assets/floor-context-model-rWKqaKmV.js +1 -0
  281. package/dist/client/assets/floor-context-sheet-BFnkFiY3.css +1 -0
  282. package/dist/client/assets/floor-memory-YMM8AlLY.js +1 -0
  283. package/dist/client/assets/floor-message-passes-CO3Ix_wR.js +1 -0
  284. package/dist/client/assets/floor-preview-text-HrORUJ7D.js +1 -0
  285. package/dist/client/assets/floor-replay-CccYqE-f.css +1 -0
  286. package/dist/client/assets/floor-tactical-hud-HL5Vja5Y.css +1 -0
  287. package/dist/client/assets/folder-B_S7gBVr.js +1 -0
  288. package/dist/client/assets/{gauge-DSflSery.js → gauge-DQCGlE3o.js} +1 -1
  289. package/dist/client/assets/{gestures-YA5IIwp-.js → gestures-CofqY4Km.js} +1 -1
  290. package/dist/client/assets/{git-branch-Bc_eDIpG.js → git-branch-DcUCsWdJ.js} +1 -1
  291. package/dist/client/assets/go-shortcuts-KQy-ZOpV.js +1 -0
  292. package/dist/client/assets/home-moving-signal-BIHUGNfI.js +1 -0
  293. package/dist/client/assets/home-now-card-CaLgZze2.js +1 -0
  294. package/dist/client/assets/{home-now-card-nano-Jmy7eJ6H.js → home-now-card-nano-CvU8B61b.js} +1 -1
  295. package/dist/client/assets/{hooks-D6NI15f6.css → hooks-D787lBmm.css} +1 -1
  296. package/dist/client/assets/hooks-DaUOREpP.js +2 -0
  297. package/dist/client/assets/index-CGbs0SBm.css +1 -0
  298. package/dist/client/assets/index-CbqBwfIW.js +1 -0
  299. package/dist/client/assets/index-CyPMl7Up.js +1 -0
  300. package/dist/client/assets/index-DReVb7jZ.js +10 -0
  301. package/dist/client/assets/index-PQpJveGO.js +1 -0
  302. package/dist/client/assets/index-kkXUq-zf.js +1 -0
  303. package/dist/client/assets/{inspector-panel-CwrHjRaQ.js → inspector-panel-CLU7wjnT.js} +2 -2
  304. package/dist/client/assets/{keyboard-nav-B8sQ_8IF.js → keyboard-nav-CJXPaHXj.js} +1 -1
  305. package/dist/client/assets/knowledge-search-BNdQweGz.css +1 -0
  306. package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
  307. package/dist/client/assets/{lane-edit-display-C_Aujldz.js → lane-edit-display-BjdT9oZl.js} +1 -1
  308. package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-CteDwdD-.js} +3 -3
  309. package/dist/client/assets/lane-roster-store-Ch9t6lb0.js +1 -0
  310. package/dist/client/assets/{lane-tool-detail-0WhMf4Vj.js → lane-tool-detail-Czggx8oM.js} +1 -1
  311. package/dist/client/assets/{layers-CW2-qHsG.js → layers-BOwyWodP.js} +1 -1
  312. package/dist/client/assets/{layout-grid-BoVnPOk-.js → layout-grid-B36Qsh0y.js} +1 -1
  313. package/dist/client/assets/left-0vBrvrBG.js +2 -0
  314. package/dist/client/assets/{left-DH44V4I_.css → left-BV9yMiTL.css} +1 -1
  315. package/dist/client/assets/left-C6SyaqlJ.js +1 -0
  316. package/dist/client/assets/left-CTuXysZR.js +2 -0
  317. package/dist/client/assets/left-Cc6s4DT2.js +1 -0
  318. package/dist/client/assets/left-DF5caiyh.js +1 -0
  319. package/dist/client/assets/left-DgT4tWCx.js +1 -0
  320. package/dist/client/assets/left-R0wppTTr.js +1 -0
  321. package/dist/client/assets/left-advisor-C-kt8V28.js +1 -0
  322. package/dist/client/assets/left-agents-thnBO156.js +1 -0
  323. package/dist/client/assets/left-default-CT42fnpF.js +1 -0
  324. package/dist/client/assets/left-lanes-CSmZgciK.js +1 -0
  325. package/dist/client/assets/left-mission-C86x6i9h.js +1 -0
  326. package/dist/client/assets/left-mission-DENnfshd.css +1 -0
  327. package/dist/client/assets/library-DdhYL_9v.js +1 -0
  328. package/dist/client/assets/{loader-circle-DmUG_YC7.js → loader-circle-DNUsuPWz.js} +1 -1
  329. package/dist/client/assets/{local-agents-VP1-ZlPw.js → local-agents-I40PawYA.js} +1 -1
  330. package/dist/client/assets/machine-children-CdhNzDF0.js +1 -0
  331. package/dist/client/assets/machine-scope-DJt9RZ2w.js +1 -0
  332. package/dist/client/assets/mentions-Ck_Vjnyp.js +1 -0
  333. package/dist/client/assets/{mesh-ops-CKSWgax2.js → mesh-ops-DSlvHp-D.js} +1 -1
  334. package/dist/client/assets/{mesh-screen-D1Yvo8fU.css → mesh-screen-DjA4mOaN.css} +1 -1
  335. package/dist/client/assets/mesh-view-store-C1-mdP3P.js +1 -0
  336. package/dist/client/assets/{message-circle-joGFxfj1.js → message-circle-cI5_A5mj.js} +1 -1
  337. package/dist/client/assets/{message-markup-DC0QFEZn.js → message-markup-6Tgo4qFJ.js} +1 -1
  338. package/dist/client/assets/{message-square-BLiFqpe_.js → message-square-CJW4WRlo.js} +1 -1
  339. package/dist/client/assets/{message-visibility-CGOmSSKs.js → message-visibility-DwxgcgYK.js} +1 -1
  340. package/dist/client/assets/mission-control-CsX3Yc58.css +1 -0
  341. package/dist/client/assets/mission-control-model-C30vU1Fe.js +1 -0
  342. package/dist/client/assets/mission-control-store-p_cboAm4.js +1 -0
  343. package/dist/client/assets/{mission-wall-CocIM1cF.js → mission-wall-DOuGOxQy.js} +1 -1
  344. package/dist/client/assets/monitor-C7_cHlkC.js +1 -0
  345. package/dist/client/assets/nav-destinations-CU_euC-Q.js +1 -0
  346. package/dist/client/assets/observe-CtS0l3zu.js +1 -0
  347. package/dist/client/assets/{operator-attention-RqieiSY8.js → operator-attention-DBaRg5ep.js} +1 -1
  348. package/dist/client/assets/ops-screen-CxYM0VOW.css +1 -0
  349. package/dist/client/assets/page-status-DwFR4wSw.js +1 -0
  350. package/dist/client/assets/panel-right-qP17MwMl.js +1 -0
  351. package/dist/client/assets/pause-B_hliKuR.js +1 -0
  352. package/dist/client/assets/{persistent-state-BubPQ7tT.js → persistent-state-BUsTTZFE.js} +1 -1
  353. package/dist/client/assets/pin-Oi4qHR6M.js +1 -0
  354. package/dist/client/assets/pip-idle-v1-Tt-CZsRG.png +0 -0
  355. package/dist/client/assets/pip-thinking-v1-BoHWSEye.png +0 -0
  356. package/dist/client/assets/pip-waiting-v1-DkuvJ-dN.png +0 -0
  357. package/dist/client/assets/pip-working-v1-wWQLRS1z.png +0 -0
  358. package/dist/client/assets/play-CVeRmqLH.js +1 -0
  359. package/dist/client/assets/{plus-BWKhylds.js → plus-D5NLH_fM.js} +1 -1
  360. package/dist/client/assets/profile-BegEUmB7.js +1 -0
  361. package/dist/client/assets/projects-inbox-CKPLZN8s.css +1 -0
  362. package/dist/client/assets/{projects-inbox-DFbgVlXL.js → projects-inbox-CfwxCTdN.js} +1 -1
  363. package/dist/client/assets/provider-DwmCoSlc.js +1 -0
  364. package/dist/client/assets/{proxy-DVDRhSRR.js → proxy-DgzP27W8.js} +1 -1
  365. package/dist/client/assets/{radio-CxIXS1nU.js → radio-Cas2qg1D.js} +1 -1
  366. package/dist/client/assets/{refresh-cw-Bkh7Cvnd.js → refresh-cw-IcD2lPoT.js} +1 -1
  367. package/dist/client/assets/resolve-panes-pfZTezKo.js +1 -0
  368. package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +1 -0
  369. package/dist/client/assets/right-BDaCJ0CF.js +1 -0
  370. package/dist/client/assets/right-BP6lXRFS.js +1 -0
  371. package/dist/client/assets/right-Cb1VCrdj.js +1 -0
  372. package/dist/client/assets/right-CeFaxfBo.js +1 -0
  373. package/dist/client/assets/right-Ck2SrYCj.js +1 -0
  374. package/dist/client/assets/right-D-uv5YfF.js +1 -0
  375. package/dist/client/assets/right-DJMSICky.js +1 -0
  376. package/dist/client/assets/right-Dnljs8ah.js +1 -0
  377. package/dist/client/assets/right-SdCSF8PP.js +1 -0
  378. package/dist/client/assets/{right-DVUq5374.js → right-cjPTwPXS.js} +2 -2
  379. package/dist/client/assets/{rocket-CnxqjX_K.js → rocket-DAqYvu8I.js} +1 -1
  380. package/dist/client/assets/router-C-MF5-mb.js +1 -0
  381. package/dist/client/assets/{runtime-picker-BYAFNLNq.css → runtime-picker-C3JwrDKP.css} +1 -1
  382. package/dist/client/assets/runtime-picker-C_AVYF63.js +1 -0
  383. package/dist/client/assets/{scope-views-KPY85UUx.js → scope-views-Dl3ml9OZ.js} +1 -1
  384. package/dist/client/assets/scout-voice-CqAyfblr.js +1 -0
  385. package/dist/client/assets/{scoutbot-D7kGGyK_.js → scoutbot-Bk3nyrkj.js} +2 -2
  386. package/dist/client/assets/{scoutbot-markdown-yb87JlSE.js → scoutbot-markdown-DwvGQOWo.js} +1 -1
  387. package/dist/client/assets/{scroll-text-DFcBYy5J.js → scroll-text-B0tKI9Sg.js} +1 -1
  388. package/dist/client/assets/{search-FB2vVxCp.js → search-UsM-9-_W.js} +1 -1
  389. package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
  390. package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +1 -0
  391. package/dist/client/assets/{selection-bridge-qBGFCJv8.js → selection-bridge-OTS2iFkt.js} +1 -1
  392. package/dist/client/assets/{send-horizontal-CS7mxVhX.js → send-horizontal-BlQsRK6C.js} +1 -1
  393. package/dist/client/assets/send-to-agent-session-C1mgqdow.js +1 -0
  394. package/dist/client/assets/{server-WY6gsbZz.js → server-DBlPW0Mp.js} +1 -1
  395. package/dist/client/assets/{session-catalog-CG4oL_yN.js → session-catalog-CnpZMB7C.js} +1 -1
  396. package/dist/client/assets/{session-table-uJh3v-ly.js → session-table-CGkfG5Yd.js} +1 -1
  397. package/dist/client/assets/sessions-view-Bge4XZ4I.js +1 -0
  398. package/dist/client/assets/{settings-DQEtqkM9.js → settings-C69Zjrpq.js} +1 -1
  399. package/dist/client/assets/shared-work-artifacts-DfNl9KTo.js +1 -0
  400. package/dist/client/assets/{sliders-horizontal-57e99_qO.js → sliders-horizontal-6bzeod7c.js} +1 -1
  401. package/dist/client/assets/solar-system-scope-2k-stars-points-1FwHnkj0.png +0 -0
  402. package/dist/client/assets/{sparkles-D0vWLTyC.js → sparkles-Cc5lPZRv.js} +1 -1
  403. package/dist/client/assets/sprout-action-sprite-DZ8C0fTl.css +1 -0
  404. package/dist/client/assets/sprout-actions-proof-v1-BzUdc812.png +0 -0
  405. package/dist/client/assets/{sse-B29iGBnw.js → sse-A8AyLH0g.js} +1 -1
  406. package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +1 -0
  407. package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-DHSNmvor.js} +2 -2
  408. package/dist/client/assets/{tail-events-LK29oCKm.js → tail-events-C4WdhVeK.js} +1 -1
  409. package/dist/client/assets/{terminal-UDy4lzV1.js → terminal-DMZjX1es.js} +1 -1
  410. package/dist/client/assets/{terminal-relay-CXHMdain.js → terminal-relay-mO89dX-Y.js} +1 -1
  411. package/dist/client/assets/terminal-screen-Bpb2SZrn.css +1 -0
  412. package/dist/client/assets/{terminal-sessions-Bdt2W3Y4.js → terminal-sessions-3RfJpen8.js} +1 -1
  413. package/dist/client/assets/{terminal-takeover-BMeBjBB2.js → terminal-takeover-CZZsnPzj.js} +1 -1
  414. package/dist/client/assets/use-beside-D3cJpA5p.js +1 -0
  415. package/dist/client/assets/use-conversation-list-D5EnpVba.js +1 -0
  416. package/dist/client/assets/{use-fleet-active-asks-CCGrll5q.js → use-fleet-active-asks-D_QOmjg5.js} +1 -1
  417. package/dist/client/assets/use-mesh-node-state-3V3ADQ-G.js +1 -0
  418. package/dist/client/assets/{use-mesh-ops-items-BjyeFJTz.js → use-mesh-ops-items-DI9GKWlF.js} +1 -1
  419. package/dist/client/assets/{use-reduced-motion-CPoX8iV2.js → use-reduced-motion-CiaZHMnk.js} +1 -1
  420. package/dist/client/assets/use-scout-dev-flags-CkdAHlDR.js +1 -0
  421. package/dist/client/assets/{useAgentHoverCard-BgTLNcF-.js → useAgentHoverCard-A3QGXqIy.js} +1 -1
  422. package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +1 -0
  423. package/dist/client/assets/{useEmbedHeadline-DuUnwTB7.js → useEmbedHeadline-atkQVfGw.js} +1 -1
  424. package/dist/client/assets/usePersistentState-Y8XwSTg-.js +1 -0
  425. package/dist/client/assets/{usePierreRuntime-35AHf9RQ.js → usePierreRuntime-DTvcwISe.js} +1 -1
  426. package/dist/client/assets/users-RLK3P5U4.js +1 -0
  427. package/dist/client/assets/worker-rendered-v1-DmGVMlVi.png +0 -0
  428. package/dist/client/assets/worker-thinking-v1-ujakpzrK.png +0 -0
  429. package/dist/client/assets/worker-waiting-v1-DbTSsfJJ.png +0 -0
  430. package/dist/client/assets/worker-working-v1-BROAvJ_z.png +0 -0
  431. package/dist/client/assets/world-outposts-v1-DOt0i98W.png +0 -0
  432. package/dist/client/assets/{wrench-BfVeded5.js → wrench-B4maQJai.js} +1 -1
  433. package/dist/client/assets/{x-DgmmnPKt.js → x-rlMdRqJF.js} +1 -1
  434. package/dist/client/assets/{xterm-DnJJmrCA.js → xterm-B1zHHOLQ.js} +1 -1
  435. package/dist/client/assets/{zap-Bcja1lHG.js → zap-B4X0OrEw.js} +1 -1
  436. package/dist/client/characters/sage/sage.glb +0 -0
  437. package/dist/client/crew/brik-bust.webp +0 -0
  438. package/dist/client/crew/brik-chip-id.webp +0 -0
  439. package/dist/client/crew/fenn-bust.webp +0 -0
  440. package/dist/client/crew/fenn-chip-id.webp +0 -0
  441. package/dist/client/crew/lulu-bust.webp +0 -0
  442. package/dist/client/crew/milo-bust.webp +0 -0
  443. package/dist/client/crew/milo-chip-id.webp +0 -0
  444. package/dist/client/crew/nori-bust.webp +0 -0
  445. package/dist/client/crew/pip-bust.webp +0 -0
  446. package/dist/client/crew/pip-chip-id.webp +0 -0
  447. package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
  448. package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
  449. package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
  450. package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
  451. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  452. package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
  453. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  454. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  455. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  456. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  457. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  458. package/dist/client/crew/sprout-bust.webp +0 -0
  459. package/dist/client/crew/sprout-chip-id.webp +0 -0
  460. package/dist/client/crew/tuck-bust.webp +0 -0
  461. package/dist/client/crew/tuck-chip-id.webp +0 -0
  462. package/dist/client/crew/vex-bust.webp +0 -0
  463. package/dist/client/crew/vex-chip-id.webp +0 -0
  464. package/dist/client/crew/wrench-bust.webp +0 -0
  465. package/dist/client/crew/wrench-chip-id.webp +0 -0
  466. package/dist/client/index.html +15 -3
  467. package/dist/drizzle/0017_wise_silver_sable.sql +26 -0
  468. package/dist/drizzle/0018_message_epoch_order.sql +1 -0
  469. package/dist/drizzle/0019_session_actor_targets.sql +227 -0
  470. package/dist/drizzle/README.md +19 -0
  471. package/dist/drizzle/meta/0017_snapshot.json +6785 -0
  472. package/dist/drizzle/meta/0018_snapshot.json +6804 -0
  473. package/dist/drizzle/meta/0019_snapshot.json +6804 -0
  474. package/dist/drizzle/meta/_journal.json +21 -0
  475. package/dist/highlights-eq9cgrbb.scm +604 -0
  476. package/dist/highlights-ghv9g403.scm +205 -0
  477. package/dist/highlights-hk7bwhj4.scm +284 -0
  478. package/dist/highlights-r812a2qc.scm +150 -0
  479. package/dist/highlights-x6tmsnaa.scm +115 -0
  480. package/dist/injections-73j83es3.scm +27 -0
  481. package/dist/main.mjs +32163 -29049
  482. package/dist/node/main.mjs +7189 -6285
  483. package/dist/openscout-terminal-relay.mjs +391 -9
  484. package/dist/pairing-runtime-controller.mjs +36724 -35406
  485. package/dist/runtime/base-daemon.mjs +14204 -63
  486. package/dist/runtime/broker-daemon.mjs +23498 -3137
  487. package/dist/runtime/broker-process-manager.mjs +19 -5
  488. package/dist/runtime/mesh-discover.mjs +18 -5
  489. package/dist/scout-control-plane-web.mjs +58517 -36972
  490. package/dist/statusline.mjs +1021 -35
  491. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  492. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  493. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  494. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  495. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  496. package/dist/update-helper.mjs +32235 -0
  497. package/package.json +2 -2
  498. package/dist/client/assets/ActivityScreen-sfonf5SR.js +0 -1
  499. package/dist/client/assets/AgentAvatar-Dz79iTxB.js +0 -1
  500. package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +0 -1
  501. package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +0 -1
  502. package/dist/client/assets/AgentDetailCard-8viaEY8b.js +0 -1
  503. package/dist/client/assets/AgentFloorView-DuyvyMMj.js +0 -1
  504. package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +0 -1
  505. package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +0 -1
  506. package/dist/client/assets/AgentLanesView-96lHsoX7.js +0 -2
  507. package/dist/client/assets/AgentLiveActions-DlSKL60c.js +0 -1
  508. package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +0 -1
  509. package/dist/client/assets/AgentSessions-DV9v34aq.js +0 -6
  510. package/dist/client/assets/AgentsConsole-DTpVhS67.js +0 -1
  511. package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +0 -1
  512. package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +0 -1
  513. package/dist/client/assets/AtopView-D7vyQDtE.js +0 -1
  514. package/dist/client/assets/BackToPicker-BHicJyfc.js +0 -1
  515. package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +0 -1
  516. package/dist/client/assets/BriefingsScreen-Cn4Mbam9.js +0 -1
  517. package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +0 -5
  518. package/dist/client/assets/ChatCollapsedStrip-7Wrg8Ge0.js +0 -1
  519. package/dist/client/assets/CodeScreen-cLC0tJ4S.js +0 -1
  520. package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +0 -1
  521. package/dist/client/assets/ConversationHeader-Bt2RBj93.js +0 -1
  522. package/dist/client/assets/ConversationPanels-o6W-cOoU.js +0 -6
  523. package/dist/client/assets/ConversationScreen-CkWnKXt6.css +0 -1
  524. package/dist/client/assets/ConversationScreen-DIU7m_aC.js +0 -2
  525. package/dist/client/assets/ConversationStatus-CTYOywFh.js +0 -1
  526. package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +0 -1
  527. package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
  528. package/dist/client/assets/DispatchAftermath-ZCEB75hh.js +0 -1
  529. package/dist/client/assets/DocumentFocusViewer-D8iB6SMt.js +0 -1
  530. package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +0 -1
  531. package/dist/client/assets/FollowScreen-CkR-okdL.js +0 -1
  532. package/dist/client/assets/HarnessMark-DttReffF.js +0 -1
  533. package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +0 -1
  534. package/dist/client/assets/HostAdvisorView-DeJ-8RZV.js +0 -1
  535. package/dist/client/assets/KnowledgeSearchInspector-W_zNIBRV.js +0 -1
  536. package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +0 -1
  537. package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +0 -1
  538. package/dist/client/assets/MeshCanvas-DZv2ipsy.js +0 -3
  539. package/dist/client/assets/MeshCanvasMinimap-BXHRNb7l.js +0 -1
  540. package/dist/client/assets/MeshScreen-DuNvpDC5.js +0 -1
  541. package/dist/client/assets/MessagesScreen-dNNPFwAc.js +0 -1
  542. package/dist/client/assets/MissionContextRail-DnCWPzAM.js +0 -1
  543. package/dist/client/assets/MissionControlView-DmaThhNR.js +0 -1
  544. package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +0 -1
  545. package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +0 -1
  546. package/dist/client/assets/MissionLogPane-BLvSSIdT.js +0 -1
  547. package/dist/client/assets/NewAgentModal-B7qxjZlW.js +0 -1
  548. package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +0 -19
  549. package/dist/client/assets/ObserveEmbedScreen-DvKGsaLv.js +0 -2
  550. package/dist/client/assets/OpenScoutAppShell-C9TOLB7u.js +0 -79
  551. package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +0 -1
  552. package/dist/client/assets/OpsScreen-CJBwshEp.js +0 -1
  553. package/dist/client/assets/OpsSubnav-CjDTnp64.js +0 -1
  554. package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +0 -1
  555. package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +0 -1
  556. package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +0 -2
  557. package/dist/client/assets/ProjectsRail-kMDA0yn4.js +0 -1
  558. package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +0 -1
  559. package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +0 -1
  560. package/dist/client/assets/Provider-D0bB7q6y.js +0 -1
  561. package/dist/client/assets/RailRow-B88JVr62.js +0 -1
  562. package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +0 -1
  563. package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +0 -1
  564. package/dist/client/assets/RepoDiffViewer-Bw5yMC4A.js +0 -7
  565. package/dist/client/assets/RepoDiffViewerLazy-DzfoFhbl.js +0 -2
  566. package/dist/client/assets/ScoutDeckSurface-DQoZofzH.js +0 -1
  567. package/dist/client/assets/SessionEmbedScreen-CpduQ0O9.js +0 -1
  568. package/dist/client/assets/SessionObserve-BVeTkcIl.js +0 -12
  569. package/dist/client/assets/SessionObserveEvidence-BkOezTGV.js +0 -1
  570. package/dist/client/assets/SessionRefScreen-DetLMkTT.js +0 -1
  571. package/dist/client/assets/SessionsScreen-B-McKw6d.js +0 -1
  572. package/dist/client/assets/SettingsDrawer-CPB32w0n.js +0 -3
  573. package/dist/client/assets/SettingsScreen-BEzYFdjz.js +0 -1
  574. package/dist/client/assets/SpriteAvatar-DFO4Kb4Z.js +0 -1
  575. package/dist/client/assets/Terminal-DWyZTZdY.js +0 -1
  576. package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +0 -1
  577. package/dist/client/assets/TerminalHeaderMount-CY7uIWBg.js +0 -1
  578. package/dist/client/assets/WorkFilesViewer-D8-4vF5l.js +0 -1
  579. package/dist/client/assets/agent-autocomplete-BlK8wY06.js +0 -10
  580. package/dist/client/assets/agent-lane-card-model-CY3OE1Xu.js +0 -1
  581. package/dist/client/assets/agent-lanes-model-tc-1hE6q.js +0 -2
  582. package/dist/client/assets/agent-master-I1W-5d-x.css +0 -1
  583. package/dist/client/assets/agent-master-model-DMcHeNq3.js +0 -1
  584. package/dist/client/assets/api-Co9aQ2Jw.js +0 -1
  585. package/dist/client/assets/arrow-down-BAGkhHA6.js +0 -1
  586. package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
  587. package/dist/client/assets/chunk-JTPDIGGW-COJ00z94.js +0 -46
  588. package/dist/client/assets/chunk-T65CQEWV-H2QEKfr1.js +0 -1
  589. package/dist/client/assets/chunk-YOZR3KYS-CrCgXw9l.js +0 -2
  590. package/dist/client/assets/colors-BtO5_zlx.js +0 -1
  591. package/dist/client/assets/content-0RBfbCIJ.js +0 -1
  592. package/dist/client/assets/content-BTmnk2bl.js +0 -1
  593. package/dist/client/assets/content-Bk5DKhyP.js +0 -1
  594. package/dist/client/assets/content-Bw_8GE_S.js +0 -1
  595. package/dist/client/assets/content-CI4gLEWi.js +0 -1
  596. package/dist/client/assets/content-CLCtp9Rb.js +0 -1
  597. package/dist/client/assets/content-C_FAGTNk.js +0 -1
  598. package/dist/client/assets/content-CnnzWOE3.js +0 -1
  599. package/dist/client/assets/content-DKlY98pO.js +0 -1
  600. package/dist/client/assets/content-Df7ndXTG.js +0 -1
  601. package/dist/client/assets/content-DkZDzzx3.js +0 -1
  602. package/dist/client/assets/content-DnGmb2L0.js +0 -1
  603. package/dist/client/assets/content-Ds-zs-Ss.js +0 -1
  604. package/dist/client/assets/content-JIWSyC0f.js +0 -1
  605. package/dist/client/assets/content-Q3TIYC8q.js +0 -1
  606. package/dist/client/assets/content-evaBfvxD.js +0 -1
  607. package/dist/client/assets/conversation-model-C2KuZUXc.js +0 -1
  608. package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +0 -1
  609. package/dist/client/assets/discover-DutlV0ZU.js +0 -2
  610. package/dist/client/assets/embed-entry-CJG7WEVw.js +0 -2
  611. package/dist/client/assets/home-moving-signal-PHSqSBu_.js +0 -1
  612. package/dist/client/assets/home-now-card-C_qsI6C6.js +0 -1
  613. package/dist/client/assets/hooks-ME7rmhpE.js +0 -2
  614. package/dist/client/assets/index-C1VaWNuD.js +0 -10
  615. package/dist/client/assets/index-C8UCRm2W.js +0 -1
  616. package/dist/client/assets/index-Cn0I2Hgi.js +0 -1
  617. package/dist/client/assets/index-Cx6Gbr6n.js +0 -1
  618. package/dist/client/assets/index-i7TMxlwW.css +0 -1
  619. package/dist/client/assets/knowledge-search-D_bLoYtC.css +0 -1
  620. package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
  621. package/dist/client/assets/lane-roster-store-DN2jxXF-.js +0 -1
  622. package/dist/client/assets/left-BRu9pnqx.js +0 -2
  623. package/dist/client/assets/left-BjS1dKNV.js +0 -2
  624. package/dist/client/assets/left-CL-TVLJ7.js +0 -1
  625. package/dist/client/assets/left-DLpsDi55.js +0 -1
  626. package/dist/client/assets/left-DPcM9o8Y.js +0 -1
  627. package/dist/client/assets/left-MmTJf1tK.js +0 -1
  628. package/dist/client/assets/left-P80i5V8L.js +0 -1
  629. package/dist/client/assets/left-advisor-CbXVzAqS.js +0 -1
  630. package/dist/client/assets/left-agents-7mJsiNyr.js +0 -1
  631. package/dist/client/assets/left-default-COK26l3H.js +0 -1
  632. package/dist/client/assets/left-lanes-Dbdm9Veu.js +0 -1
  633. package/dist/client/assets/left-mission-DSenPIyb.css +0 -1
  634. package/dist/client/assets/left-mission-DqGR5jby.js +0 -1
  635. package/dist/client/assets/library-COnWzUWv.js +0 -1
  636. package/dist/client/assets/mentions-BZ5SBMtc.js +0 -1
  637. package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +0 -1
  638. package/dist/client/assets/mesh-view-store-CBM1za_N.js +0 -1
  639. package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
  640. package/dist/client/assets/mission-control-model-C0fByIjm.js +0 -1
  641. package/dist/client/assets/mission-control-store-CM8mQGg8.js +0 -1
  642. package/dist/client/assets/observe-BLmy4quB.js +0 -1
  643. package/dist/client/assets/ops-screen-giu3If_N.css +0 -1
  644. package/dist/client/assets/page-status-BE0-J1xY.js +0 -1
  645. package/dist/client/assets/paperclip-Br7wUDFl.js +0 -1
  646. package/dist/client/assets/perf-PX8Rx0EP.js +0 -1
  647. package/dist/client/assets/profile-BCvk8jOQ.js +0 -1
  648. package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
  649. package/dist/client/assets/resolve-panes-DhD5qmQO.js +0 -1
  650. package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +0 -1
  651. package/dist/client/assets/right-B_08ilv6.js +0 -1
  652. package/dist/client/assets/right-Brm67HOL.js +0 -1
  653. package/dist/client/assets/right-BveAPKBW.js +0 -1
  654. package/dist/client/assets/right-CpTB_-Ya.js +0 -1
  655. package/dist/client/assets/right-CqC4Qdot.js +0 -1
  656. package/dist/client/assets/right-D91j9d5Y.js +0 -1
  657. package/dist/client/assets/right-DaLRhYl3.js +0 -1
  658. package/dist/client/assets/right-Dt1wOwA5.js +0 -1
  659. package/dist/client/assets/right-DtzqIZQF.js +0 -1
  660. package/dist/client/assets/router-kfcaYqZr.js +0 -1
  661. package/dist/client/assets/runtime-picker-C20lTGhV.js +0 -1
  662. package/dist/client/assets/scout-voice-Cg1qfepC.js +0 -1
  663. package/dist/client/assets/secondaryNavConfig-C0Srrmy8.js +0 -1
  664. package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
  665. package/dist/client/assets/system-surfaces-redesign-kuf3wuE_.css +0 -1
  666. package/dist/client/assets/terminal-screen-vMICbBJh.css +0 -1
  667. package/dist/client/assets/use-conversation-list-UG-tMN67.js +0 -1
  668. package/dist/client/assets/use-scout-dev-flags-DTseRrFi.js +0 -1
  669. package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +0 -1
@@ -1 +0,0 @@
1
- import{r as m,j as e}from"./index-C1VaWNuD.js";import{H as L,h as pe}from"./HarnessMark-DttReffF.js";import{p as me,a as Z}from"./api-Co9aQ2Jw.js";import{b as fe}from"./router-kfcaYqZr.js";import{n as S,t as J,f as O}from"./time-Dhsh_2EG.js";import{u as ge}from"./Provider-D0bB7q6y.js";import{u as xe}from"./useContentSecondaryNav-CoIoz7JU.js";import{OpsSubnav as be}from"./OpsSubnav-CjDTnp64.js";/* empty css */import{R as ve}from"./refresh-cw-Bkh7Cvnd.js";import{E as Y}from"./external-link-BvX5PfLh.js";import{c as je}from"./createLucideIcon-Dv8H8m7J.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./SecondaryNav-Cs0_FQdj.js";import"./secondaryNavConfig-C0Srrmy8.js";import"./message-square-BLiFqpe_.js";import"./compass-BdpImt_W.js";import"./settings-DQEtqkM9.js";import"./terminal-UDy4lzV1.js";import"./git-branch-Bc_eDIpG.js";import"./scroll-text-DFcBYy5J.js";/* empty css */const D=60*6e4,N=24*D,ke=["product_judgment","large_context_synthesis","adversarial_critique","evidence_inventory","implementation","code_review"],V={fable:j("Fable 5","claude","claude","claude-fable-5","max","Fable","Premium product taste, rapid design iterations, and premise-level critique.","Uses the premium shared Claude allowance; do not spend it on routine mechanical work."),sol:j("GPT-5.6 Sol","codex","codex","gpt-5.6-sol","xhigh",null,"Load-bearing coding, debugging, integration, and technically grounded judgment.","Highest Codex tier; reserve deep turns for work where failure is expensive."),grok:j("Grok 4.6","grok","grok","grok-4.6",null,"Grok","Independent assumption checking, deletion pressure, and adversarial critique.","Do not make it the sole implementation authority; verify conclusions against repository evidence."),kimi:j("Kimi Code","kimi","kimi",null,null,"Kimi","Dense repository and study synthesis through the native Kimi harness.","The harness owns the concrete model and quota telemetry can be stale; probe before large fan-out."),opus:j("Opus 5","claude","claude","claude-opus-5","high","Opus","Long-context synthesis, nuanced architecture, and coherent product reasoning.","Premium shared Claude quota; avoid routine scans and repetitive verification."),glm:j("GLM-5.2","opencode","opencode","opencode-go/glm-5.2",null,"OpenCode","Independent broad-context synthesis through OpenCode.","OpenCode quota is not visible in Scout; use a bounded canary before scaling."),terra:j("GPT-5.6 Terra","codex","codex","gpt-5.6-terra","high",null,"Balanced implementation, correctness review, and technical critique.","Prefer Sol for the hardest integration boundary when its additional spend is justified."),minimax:j("MiniMax M3","minimax","opencode","opencode-go/minimax-m3",null,"OpenCode","Cost-effective structured evidence collection and comparison.","Verify load-bearing conclusions with a stronger reviewer before acceptance."),luna:j("GPT-5.6 Luna","codex","codex","gpt-5.6-luna","medium",null,"Inexpensive source mapping, test enumeration, and mechanical audit work.","Keep it out of sole high-stakes product judgment and final acceptance."),haiku:j("Haiku 4.5","claude","claude","claude-haiku-4-5","low",null,"Fast narrow scans and classification inside the Claude harness.","Lighter reasoning and a smaller context window make broad synthesis a poor fit."),sonnet:j("Sonnet 4.6","claude","claude","claude-sonnet-4-6","high",null,"Strong generalist implementation with a large context window.","Shares Claude's provider allowance and can become a poor choice when that pool is guarded."),deepseek:j("DeepSeek V4 Pro","opencode","opencode","opencode-go/deepseek-v4-pro",null,"OpenCode","Code-centric review through an independent model lineage.","Quota is opaque and findings should not be the sole acceptance authority.")},ee={product_judgment:{label:"Product judgment",objective:"Strategic tradeoffs, UX prioritization, scope shaping, and high-level product decisions.",strategy:"Select models with high nuanced taste, product-level synthesis, and clear communication of architectural tradeoffs.",candidates:[b("fable",100,"Unmatched product taste, rapid design iteration synthesis, and high-fidelity UX direction."),b("sol",87,"Technically grounded product decisions with strong execution realism."),b("grok",82,"Unfiltered perspective on feature bloat and aggressive scope reduction.")]},large_context_synthesis:{label:"Large-context synthesis",objective:"Repository-wide investigations, deep architectural archaeology, and multi-file code synthesis.",strategy:"Select models with expansive effective context windows and high-density information compression.",candidates:[b("kimi",100,"Native long-context retrieval and dense codebase relationship synthesis."),b("opus",91,"Deep structural understanding across complex multi-package repositories."),b("glm",84,"Independent wide-window scanning and structural cross-referencing.")]},adversarial_critique:{label:"Adversarial critique",objective:"Challenging design assumptions, rapid design iteration critique, identifying UX/logic gaps, and applying deletion pressure.",strategy:"Select high-taste and contrarian model lineages that stress-test design iterations and probe corner cases without sycophantic approval.",candidates:[b("fable",100,"High-fidelity design critique, rapid UX/visual iteration stress-testing, and premise challenge."),b("grok",91,"Contrarian perspective, uncompromising edge-case discovery, and aggressive premise challenge."),b("terra",84,"Rigorous technical inspection of code correctness and runtime invariants.")]},evidence_inventory:{label:"Evidence inventory",objective:"Grep and AST inventory, reference tracing, log audit, and structured fact collection.",strategy:"Select fast, cost-effective models with high precision on structured evidence gathering.",candidates:[b("minimax",100,"Fast, cost-effective structured evidence indexing and pattern enumeration."),b("luna",95,"Low-latency source tracing, test inventory, and reference mapping."),b("haiku",87,"Rapid mechanical file scans and categorization.")]},implementation:{label:"Implementation",objective:"Code creation, refactoring, type checking, unit test writing, and bug fixing.",strategy:"Select code-generation champions with high instruction following and strong language typing skills.",candidates:[b("sol",100,"Deep technical accuracy, robust multi-file refactors, and complex logic execution."),b("terra",91,"Reliable structured implementation with strong type-system adherence."),b("sonnet",87,"Strong generalist coding with fast turn times and clear explanations.")]},code_review:{label:"Code review",objective:"Diff analysis, security audit, regression detection, and style conformity.",strategy:"Select models with high sensitivity to subtle bugs, invariant violations, and edge-case behaviors.",candidates:[b("terra",100,"Strict invariant checking, subtle logic flaw detection, and boundary test coverage."),b("opus",96,"High-level architectural consistency and API surface evolution review."),b("deepseek",87,"Independent second-opinion review focused on code-level edge cases.")]}};function $(s){return s.availability==="constrained"||s.availability==="guarded"||s.minimumRemainingPercent!==null&&s.minimumRemainingPercent<=20||s.pacing==="ahead"&&(s.minimumRemainingPercent??100)<=35}function se(s){return s.confidence==="fresh"&&s.minimumRemainingPercent!==null&&!$(s)}function ye(s){return $(s)?s.minimumRemainingPercent!==null&&s.minimumRemainingPercent<=15?`${s.providerLabel} is near capacity (${s.minimumRemainingPercent}% remaining). High risk of quota exhaustion.`:s.pacing==="ahead"?`${s.providerLabel} consumption rate exceeds window pace with limited buffer.`:`${s.providerLabel} quota availability is ${s.availability}. Failover recommended.`:null}function k(s){return[s.providerId,s.harness,s.model,s.effort,s.profile].join("|")}function Ne(s){return[s.profile?`profile ${s.profile}`:s.harness,s.model,s.effort].filter(Boolean).join(" / ")}function Re(s,n="<request>"){const a=s.profile?.trim().toLowerCase()??null,t=a!=="opencode"&&a!=="oc",i=s.profile&&t?["--profile",s.profile]:["--harness",s.harness,...s.model?["--model",s.model]:[]];return s.effort&&i.push("--effort",s.effort),i.push(n),i}function B(s,n="<request>"){return["scout","ask",...Re(s,n)].map(_e).join(" ")}function we(s,n={}){const a=ne(n.now)??Date.now(),t=n.bias??"balanced",i=Me(t),o=new Map(s.providers.map(h=>[h.id,qe(h,a)])),r=n.role?[n.role]:[...ke],c=r.map(h=>{const u=ee[h],d=u.candidates.map(f=>{const g=o.get(f.route.providerId)??ae(f.route.providerId);return{runtime:f,quota:g,score:f.fit+Ae(g,a)*i}}).sort((f,g)=>g.score-f.score||g.runtime.fit-f.runtime.fit),p=d[0],x=$(p.quota),v=d.slice(1);return x&&v.sort((f,g)=>{const q=K(f,p.runtime.route.providerId),T=K(g,p.runtime.route.providerId);return q-T||g.score-f.score||g.runtime.fit-f.runtime.fit}),{role:h,roleLabel:u.label,modelLabel:p.runtime.label,route:p.runtime.route,score:p.score,fit:p.runtime.fit,objective:u.objective,taskRationale:p.runtime.taskRationale,capability:p.runtime.capability,caution:p.runtime.caution,assertion:Le(p.quota),quotaRisk:x,quotaRiskMessage:ye(p.quota),quota:p.quota,alternatives:v.slice(0,2).map(({runtime:f,quota:g,score:q})=>({label:f.label,route:f.route,score:q,fit:f.fit,capability:f.capability,caution:f.caution,taskRationale:f.taskRationale,quotaRisk:$(g),quota:g}))}}),l=Se(r,o,a);return{generatedAt:s.generatedAt,generatedAtLocal:s.generatedAtLocal,evaluatedAt:a,assignments:c,models:l,bias:t}}function Se(s,n,a){const t=new Map;for(const i of s){const o=ee[i];for(const r of o.candidates){const c=k(r.route),l=t.get(c);l?l.roles.push({role:i,label:o.label}):t.set(c,{runtime:r,roles:[{role:i,label:o.label}]})}}return[...t.values()].map(({runtime:i,roles:o})=>{const r=n.get(i.route.providerId)??ae(i.route.providerId);return{modelLabel:i.label,route:i.route,roles:o,strengths:[i.capability],cautions:[i.caution],guidance:Ce(r,a),quotaRisk:$(r),quota:r}})}function qe(s,n){const a=s.windows.filter(h=>!/^video\b/iu.test(h.label)).map(h=>$e(h,n)),t=[...a].sort((h,u)=>h.percentRemaining-u.percentRemaining)[0]??null,i=a.filter(h=>h.paceRatio!==null).sort((h,u)=>u.paceRatio-h.paceRatio)[0]??null,o=a.map(h=>h.confidence),r=o.includes("stale")?"stale":o.includes("fresh")?"fresh":"unknown",c=[...a].filter(h=>h.resetAt!==null&&h.resetAt>n).sort((h,u)=>h.resetAt-u.resetAt)[0]??null,l=t?.percentRemaining??null;return{providerId:s.id,providerLabel:s.label,plan:s.plan,availability:Te(l),pacing:i?.status??"unknown",confidence:r,minimumRemainingPercent:l,bindingWindow:t?.label??null,nextResetAt:c?.resetAt??null,nextResetIn:c?.resetIn??"",windows:a}}function $e(s,n){const a=ne(s.windowMs)??Pe(s.label,s.resetAt),t=a!==null&&s.resetAt!==null?X(Ue(100-(s.resetAt-n)/a*100,0,100)):null,i=t!==null&&t>=1?De(s.usedPercent/t):null,o=i===null?null:X(i*100),r=Ie(s.usedPercent,t,i),c=a===null?N:Math.min(N,Math.max(D,a/4)),l=s.freshness.ageMs===null?"unknown":s.freshness.ageMs>c?"stale":"fresh";return{label:s.label,usedPercent:s.usedPercent,percentRemaining:s.percentRemaining,durationMs:a,elapsedPercent:t,paceRatio:i,projectedUsedPercent:o,status:r,resetAt:s.resetAt,resetIn:s.resetIn,freshness:s.freshness.label,confidence:l}}function j(s,n,a,t,i,o,r,c){return{label:s,route:{providerId:n,harness:a,model:t,effort:i,profile:o},capability:r,caution:c}}function b(s,n,a){return{...V[s],fit:n,taskRationale:a??V[s].capability}}function Ce(s,n){return $(s)?"conserve":s.confidence!=="fresh"?"probe_first":s.availability==="constrained"?"conserve":s.nextResetAt!==null&&s.nextResetAt>n&&s.nextResetAt-n<=N&&s.pacing!=="ahead"&&(s.minimumRemainingPercent??0)>=10?"use_now":s.availability==="guarded"?"conserve":s.pacing==="ahead"?"use_deliberately":s.availability==="abundant"&&s.pacing==="underused"?"use_now":"available"}function Me(s){switch(s){case"capability":return .25;case"quota":return 1.75;case"balanced":return 1}}function Ae(s,n){let a=0;switch(s.availability){case"abundant":a+=10;break;case"available":a+=5;break;case"guarded":a-=5;break;case"constrained":a-=30;break;case"unknown":a-=2;break}return s.pacing==="underused"&&(a+=5),s.pacing==="ahead"&&(a-=8),s.confidence==="stale"&&(a-=8),s.confidence==="unknown"&&(a-=3),s.pacing==="underused"&&s.nextResetAt!==null&&s.nextResetAt>n&&s.nextResetAt-n<=2*N&&(a+=3),a}function Le(s){if(s.minimumRemainingPercent===null)return`${te(s.providerId)} quota telemetry unavailable; use a bounded canary before scaling.`;const n=s.pacing==="on_track"?"usage tracks elapsed time":s.pacing==="underused"?"usage trails elapsed time":s.pacing==="ahead"?"usage exceeds elapsed time":"pace unknown",a=s.nextResetIn?` · next reset ${s.nextResetIn}`:"";return`${Oe(s.minimumRemainingPercent)} minimum remaining · ${n} · telemetry ${s.confidence}${a}.`}function ae(s){return{providerId:s,providerLabel:te(s),plan:null,availability:"unknown",pacing:"unknown",confidence:"unknown",minimumRemainingPercent:null,bindingWindow:null,nextResetAt:null,nextResetIn:"",windows:[]}}function Pe(s,n){const a=s.trim().toLowerCase(),t=a.match(/(?:^|\s)(\d+(?:\.\d+)?)([hd])$/u);if(t){const i=Number(t[1]);return t[2]==="h"?i*D:i*N}if(a==="weekly"||a==="week"||a==="7-day")return 7*N;if(a==="5-hour")return 5*D;if(a==="monthly"||a==="month"){if(n===null)return 30*N;const i=new Date(n),o=new Date(n);o.setUTCMonth(o.getUTCMonth()-1);const r=i.getTime()-o.getTime();return r>0?r:30*N}return null}function Ie(s,n,a){if(n===null||a===null)return"unknown";const t=s-n;return a>1.1&&t>3?"ahead":a<.7&&t<-10?"underused":"on_track"}function Te(s){return s===null?"unknown":s>=60?"abundant":s>=30?"available":s>=15?"guarded":"constrained"}function K(s,n){const a=se(s.quota),t=s.runtime.route.providerId!==n;return a&&t?0:a?1:t?2:3}function _e(s){return/^[A-Za-z0-9_./:@%+=,-]+$/u.test(s)?s:`'${s.replaceAll("'",`'"'"'`)}'`}function te(s){return s.split(/[-_\s]+/u).filter(Boolean).map(n=>`${n.charAt(0).toUpperCase()}${n.slice(1)}`).join(" ")||"Unknown"}function Oe(s){return`${Number.isInteger(s)?s.toFixed(0):s.toFixed(1)}%`}function ne(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function X(s){return Math.round(s*10)/10}function De(s){return Math.round(s*100)/100}function Ue(s,n,a){return Math.min(a,Math.max(n,s))}const Ee=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],Fe=je("clipboard-paste",Ee),Ge=3e4,M=[{value:"capability",label:"Capability"},{value:"balanced",label:"Balanced"},{value:"quota",label:"Quota"}],Be={codex:"Codex",claude:"Claude",kimi:"Kimi",minimax:"MiniMax",cursor:"Cursor",native:"Native",worker:"Worker",bridge:"Bridge",http:"HTTP",pi:"Pi",flue:"Flue",github:"GitHub",unknown:"Unknown"},ie=[{id:"claude",description:"Anthropic plan windows captured from Claude Code.",links:[{label:"Usage",href:"https://claude.ai/settings/usage"},{label:"Manage plan",href:"https://claude.ai/settings/billing"}]},{id:"codex",description:"OpenAI plan windows reported by local Codex sessions.",links:[{label:"Usage",href:"https://chatgpt.com/codex/settings/usage"},{label:"Open Codex",href:"https://chatgpt.com/codex"}]},{id:"kimi",description:"Kimi Code subscription windows and membership level.",links:[{label:"Kimi Code",href:"https://www.kimi.com/code"},{label:"Docs",href:"https://www.kimi.com/code/docs/en/"}]},{id:"grok",description:"SuperGrok quota reported by local Grok, with dashboard capture and local activity as fallbacks.",links:[{label:"Open Grok",href:"https://grok.com/"},{label:"Billing",href:"https://grok.com/?_s=billing"},{label:"Help",href:"https://docs.x.ai/grok/faq"}]},{id:"minimax",description:"MiniMax Token Plan 5-hour and weekly allowance.",links:[{label:"Usage",href:"https://platform.minimax.io/console/plan"},{label:"Docs",href:"https://platform.minimax.io/docs/token-plan/intro"}]},{id:"cursor",description:"Cursor membership detected locally, plus usage totals from an exported dashboard capture.",links:[{label:"Usage",href:"https://cursor.com/dashboard/usage"},{label:"Manage plan",href:"https://cursor.com/dashboard/billing"}]}],He={cloudflare:[{label:"Dashboard",href:"https://dash.cloudflare.com/"},{label:"Billing",href:"https://dash.cloudflare.com/?to=/:account/billing"}],vercel:[{label:"Dashboard",href:"https://vercel.com/dashboard"},{label:"Billing",href:"https://vercel.com/account/billing"}],exe:[{label:"VMs",href:"https://exe.dev/"},{label:"Billing",href:"https://exe.dev/user/billing"},{label:"Docs",href:"https://exe.dev/docs/what-is-exe"}]},ze={exe:{category:"Agent compute",description:"Persistent VMs for remote Scout agents and isolated workloads."},cloudflare:{category:"Edge platform",description:"Workers, networking, and edge infrastructure available for deployment."},vercel:{category:"App hosting",description:"Projects, preview environments, and production deployments."}};function Qe({provider:s}){return e.jsx("span",{className:`hs-cloud-mark hs-cloud-mark--${s}`,"aria-hidden":"true",children:s==="exe"?e.jsx("img",{src:"https://exe.dev/apple-touch-icon.png",alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:s==="cloudflare"?e.jsx("path",{d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268Zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"}):e.jsx("path",{d:"m12 1.608 12 20.784H0Z"})})})}function F(s){const n=(s??"").trim().toLowerCase();return n?n.includes("claude")?"claude":n.includes("codex")?"codex":n.includes("cursor")?"cursor":n.includes("kimi")||n.includes("moonshot")?"kimi":n.includes("minimax")?"minimax":n.includes("github")?"github":n.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown":"unknown"}function P(s){return Be[s]??pe(s)}function We(s){switch(s){case"weekly":return"7d";case"req/h":return"1h";default:return s||"quota"}}function I(s){return s.windows&&s.windows.length>0?s.windows:[{label:We(s.unitLabel),fill:s.fill,usedLabel:s.usedLabel,capLabel:s.capLabel,unitLabel:s.unitLabel,resetAt:s.resetAt}]}function Ve(s){return s.capLabel==="100%"&&s.usedLabel.endsWith("%")?s.usedLabel:`${s.usedLabel}/${s.capLabel}`}function re(s){return s>=.9?"err":s>=.75?"warn":"ok"}function Ke(s,n=30){const a=s??[];if(a.length<=n)return a;if(n<=1)return[a[a.length-1]];const t=(a.length-1)/(n-1);return Array.from({length:n},(i,o)=>a[Math.round(o*t)])}function H(s){const n=Math.floor((s-Date.now())/1e3),a=n<0,t=Math.abs(n);let i;if(t>=86400){const o=Math.floor(t/86400),r=Math.floor(t%86400/3600);i=r>0?`${o}d ${r}h`:`${o}d`}else if(t>=3600){const o=Math.floor(t/3600),r=Math.floor(t%3600/60);i=r>0?`${o}h ${r}m`:`${o}h`}else i=`${Math.max(1,Math.floor(t/60))}m`;return a?`stale ${i}`:i}function Xe(s){if(!s)return null;const n=S(s.capturedAt);if(n)return n;if(s.kind!=="quota")return null;const a=I(s).reduce((t,i)=>{const o=S(i.capturedAt);return Math.max(t??0,o??0)||t},null);return a||I(s).flatMap(t=>t.history??[]).reduce((t,i)=>{const o=S(i.capturedAt);return Math.max(t??0,o??0)||t},null)}function Ze({provider:s,onImported:n}){const[a,t]=m.useState(!1),[i,o]=m.useState(""),[r,c]=m.useState(!1),[l,h]=m.useState(null),u=`hs-${s}-dashboard-capture`,d=P(s);if(!a)return e.jsxs("button",{type:"button",className:"hs-dashboard-capture-trigger",onClick:()=>t(!0),children:[e.jsx(Fe,{size:12,"aria-hidden":"true"}),"Import dashboard"]});const p=async x=>{if(x.preventDefault(),!(!i.trim()||r)){c(!0),h(null);try{await Z("/api/service-budgets/dashboard-import",{method:"POST",body:JSON.stringify({provider:s,text:i})}),o(""),h("Usage snapshot imported."),await n()}catch(v){h(v instanceof Error?v.message:String(v))}finally{c(!1)}}};return e.jsxs("form",{className:"hs-dashboard-capture",onSubmit:x=>{p(x)},children:[e.jsxs("label",{htmlFor:u,children:[d," usage snapshot"]}),e.jsxs("p",{children:[s==="cursor"?"Paste the exported Usage CSV or copied usage table.":"Copy the signed-in Usage panel and paste it here."," ","Scout keeps only normalized totals, not this text."]}),e.jsx("textarea",{id:u,value:i,onChange:x=>o(x.target.value),maxLength:128*1024,rows:5,placeholder:s==="cursor"?"Date (UTC),Type,Model,Tokens,Cost…":"Weekly SuperGrok… Limit · 12% used · Resets…","aria-describedby":l?`${u}-message`:void 0}),l?e.jsx("span",{id:`${u}-message`,className:"hs-dashboard-capture-message",role:"status",children:l}):null,e.jsxs("div",{className:"hs-dashboard-capture-actions",children:[e.jsx("button",{type:"button",onClick:()=>{t(!1),h(null)},disabled:r,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!i.trim()||r,children:r?"Importing…":"Use snapshot"})]})]})}function Je(s){const n=new Map(s.map(a=>[F(a.id),a]));return ie.map(({id:a})=>({id:a,label:P(a),gauge:n.get(a)??null}))}function Ye({points:s}){const n=Ke(s);return n.length===0?e.jsx("span",{className:"hs-history hs-history-empty",children:"live"}):e.jsx("span",{className:"hs-history","aria-label":`${n.length} budget samples`,children:n.map((a,t)=>{const i=Math.max(.06,Math.min(1,a.fill));return e.jsx("span",{className:`hs-history-bar hs-history-bar--${re(a.fill)}`,style:{height:`${Math.round(i*100)}%`},title:`${O(a.capturedAt)||"unknown"} ${a.usedLabel}`},`${a.capturedAt}:${t}`)})})}function es({gauge:s,window:n}){const a=Math.max(0,Math.min(100,Math.round(n.fill*100))),t=100-a,i=re(n.fill),o=Number.isFinite(n.resetAt)?new Date(n.resetAt).toISOString():void 0;return e.jsxs("div",{className:"hs-subscription-window",children:[e.jsxs("div",{className:"hs-subscription-window-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"hs-subscription-window-label",children:[n.label," window"]}),e.jsxs("strong",{className:`hs-subscription-usage hs-subscription-usage--${i}`,children:[a,"% used"]})]}),e.jsxs("div",{className:"hs-subscription-remaining",children:[e.jsxs("strong",{children:[t,"%"]}),e.jsx("span",{children:"available"})]})]}),e.jsx("div",{className:"hs-subscription-meter",role:"progressbar","aria-label":`${s.label} ${n.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:e.jsx("span",{className:`hs-subscription-meter-fill hs-subscription-meter-fill--${i}`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"hs-subscription-window-meta",children:[e.jsxs("span",{children:[Ve(n)," ",n.unitLabel==="quota"?"quota":n.unitLabel]}),e.jsxs("span",{children:["resets in ",H(n.resetAt),o?e.jsx("time",{dateTime:o,title:O(n.resetAt)||void 0,children:` · ${O(n.resetAt)||""}`}):null]})]}),e.jsx(Ye,{points:n.history})]})}function ss(){return e.jsxs("div",{className:"hs-subscription-loading","aria-hidden":"true",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--label"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--value"}),e.jsx("span",{className:"hs-loading-meter"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--meta"}),e.jsx("span",{className:"hs-loading-history"})]})}function as(s,n,a){const t=s.flatMap(i=>{if(i.kind!=="quota")return[];const o=I(i).map(r=>{const c=S(r.capturedAt??i.capturedAt),l=Math.round(Math.max(0,Math.min(1,r.fill))*1e3)/10;return{label:r.label,usedPercent:l,percentRemaining:Math.round((100-l)*10)/10,windowMs:r.windowMs??null,resetAt:S(r.resetAt),resetIn:Number.isFinite(r.resetAt)?H(r.resetAt):"",freshness:{ageMs:c?Math.max(0,a-c):null,label:c?J(c)||"now":"unknown"}}});return[{id:F(i.id),label:P(F(i.id)),plan:i.plan??null,windows:o}]});return{generatedAt:n,generatedAtLocal:O(n)||"now",providers:t}}function U(s){switch(s){case"underused":return"usage trails elapsed time";case"on_track":return"usage tracks elapsed time";case"ahead":return"usage exceeds elapsed time";default:return"pace unknown"}}function A(s){return Ne(s)}function z({text:s,label:n="Copy rule"}){const[a,t]=m.useState("idle");m.useEffect(()=>{if(a==="idle")return;const o=window.setTimeout(()=>t("idle"),1800);return()=>window.clearTimeout(o)},[a]);const i=m.useCallback(async()=>{if(typeof navigator>"u"||!navigator.clipboard){t("failed");return}try{await navigator.clipboard.writeText(s),t("copied")}catch{t("failed")}},[s]);return e.jsx("button",{type:"button",className:"hs-advisor-dispatch-copy",onClick:()=>{i()},"aria-live":"polite","aria-atomic":"true",children:a==="copied"?"Copied!":a==="failed"?"Copy failed":n})}function G(s,n){return!!(s.quotaRisk&&n&&!n.quotaRisk&&se(n.quota)&&n.route.providerId!==s.route.providerId)}function oe(s){return s.minimumRemainingPercent===null?"quota unknown":`${s.minimumRemainingPercent}% minimum remaining`}function ts(s){switch(s){case"use_now":return"Use now";case"available":return"Available";case"use_deliberately":return"Use deliberately";case"probe_first":return"Probe first";case"conserve":return"Conserve"}}function le({providerLabel:s,quota:n}){return n.windows.length===0?e.jsxs("div",{className:"hs-advisor-no-quota",children:[e.jsx("strong",{children:"No quota telemetry"}),e.jsx("span",{children:"Use one bounded ask as a canary before scaling this route."})]}):e.jsx("div",{className:"hs-advisor-windows",children:n.windows.map(a=>{const t=Math.max(0,Math.min(100,a.usedPercent)),i=a.elapsedPercent===null?null:Math.max(0,Math.min(100,a.elapsedPercent)),o=i===null?"elapsed time unavailable":`${i}% of the window elapsed`,r=a.projectedUsedPercent===null?"projection unavailable":`${a.projectedUsedPercent}% projected at reset`;return e.jsxs("div",{className:"hs-advisor-window",children:[e.jsxs("div",{className:"hs-advisor-window-head",children:[e.jsx("strong",{children:a.label}),e.jsxs("span",{children:[a.usedPercent,"% used"]}),e.jsx("span",{children:U(a.status)})]}),e.jsxs("div",{className:"hs-advisor-window-meter",role:"progressbar","aria-label":`${s} ${a.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t),"aria-valuetext":`${a.usedPercent}% used; ${o}; ${r}; ${U(a.status)}`,children:[e.jsx("span",{className:`hs-advisor-window-fill hs-advisor-window-fill--${a.status}`,style:{width:`${t}%`}}),i!==null?e.jsx("span",{className:"hs-advisor-window-now",style:{left:`${i}%`},title:`${i}% of the window has elapsed`,"aria-hidden":"true"}):null]}),e.jsxs("div",{className:"hs-advisor-window-meta",children:[e.jsxs("span",{children:[a.percentRemaining,"% available"]}),e.jsx("span",{children:r}),e.jsx("span",{children:a.resetIn?`resets in ${a.resetIn}`:"reset unknown"})]})]},a.label)})})}function ce({assignment:s,selected:n,onSelect:a}){return e.jsxs("button",{type:"button",className:"hs-advisor-role","data-selected":n?"true":void 0,onClick:a,"aria-pressed":n,children:[e.jsx("span",{className:"hs-advisor-role-mark",children:e.jsx(L,{harness:s.route.harness,size:25,title:null})}),e.jsxs("span",{className:"hs-advisor-role-copy",children:[e.jsx("strong",{children:s.roleLabel}),e.jsx("span",{children:s.modelLabel}),e.jsxs("small",{children:[s.route.profile?`profile ${s.route.profile}`:s.route.harness," · Fit $",s.fit]})]}),e.jsx("span",{className:`hs-advisor-role-tag ${s.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:s.quotaRisk?`⚠️ ${s.quota.minimumRemainingPercent!==null?`${s.quota.minimumRemainingPercent}%`:"Risk"}`:s.fit>=100?"Primary":`Fit ${s.fit}`})]})}function ns({map:s}){const[n,a]=m.useState("implementation"),t=s.assignments.find(r=>r.role===n)??s.assignments[0];if(!t)return null;const i=B(t.route),o=t.alternatives.find(r=>G(t,r));return e.jsxs("div",{className:"hs-advisor-layout",children:[e.jsx("nav",{className:"hs-advisor-roles","aria-label":"Work roles",children:s.assignments.map(r=>e.jsx(ce,{assignment:r,selected:r.role===t.role,onSelect:()=>a(r.role)},r.role))}),e.jsxs("article",{className:"hs-advisor-detail","aria-live":"polite",children:[e.jsxs("header",{className:"hs-advisor-detail-head",children:[e.jsxs("div",{className:"hs-advisor-model",children:[e.jsx(L,{harness:t.route.harness,size:26,title:null}),e.jsxs("div",{children:[e.jsxs("span",{children:[t.roleLabel," · Role Routing"]}),e.jsx("h4",{children:t.modelLabel}),e.jsx("code",{children:A(t.route)})]})]}),e.jsx("span",{className:`hs-advisor-fit-badge ${t.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:t.quotaRisk?"⚠️ Quota Risk · Failover Active":`Primary Route · Fit ${t.fit}`})]}),t.quotaRisk?e.jsxs("div",{className:"hs-advisor-quota-alert",role:"alert",children:[e.jsxs("div",{className:"hs-advisor-quota-alert-head",children:[e.jsx("span",{className:"hs-advisor-quota-alert-badge",children:"⚠️ Quota Risk"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Quota Exhaustion Imminent · Elevated to Primary Concern"}),e.jsx("p",{children:t.quotaRiskMessage??`${t.quota.providerLabel} quota is near capacity.`})]})]}),e.jsx("div",{className:"hs-advisor-quota-alert-action",children:o?e.jsxs("span",{children:["Failover to ",e.jsx("strong",{children:o.label})," to move work off the constrained provider."]}):e.jsx("span",{children:"No quota-safe cross-provider fallback is currently available; keep the task bounded or wait for reset."})})]}):null,e.jsxs("div",{className:"hs-advisor-task-hero",children:[e.jsxs("div",{className:"hs-advisor-task-hero-head",children:[e.jsx("h5",{children:"Task Objective"}),e.jsx("span",{children:"Cognitive Strategy"})]}),e.jsx("p",{children:t.objective}),e.jsxs("small",{children:[e.jsx("strong",{children:"Execution Rationale:"})," ",t.taskRationale]})]}),e.jsxs("div",{className:"hs-advisor-assessment",children:[e.jsxs("section",{children:[e.jsx("h5",{children:"Strengths for this task"}),e.jsx("p",{children:t.capability})]}),e.jsxs("section",{children:[e.jsx("h5",{children:"Watchouts & Guardrails"}),e.jsx("p",{children:t.caution})]})]}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Dispatch rule"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:i}),e.jsx(z,{text:i,label:"Copy rule"})]})]}),e.jsxs("section",{className:"hs-advisor-ladder",children:[e.jsx("h5",{children:"Failover ladder"}),e.jsxs("div",{className:"hs-advisor-ladder-nodes",children:[e.jsxs("div",{className:`hs-advisor-ladder-node ${t.quotaRisk?"hs-advisor-ladder-node--primary hs-advisor-ladder-node--risk":"hs-advisor-ladder-node--primary"}`,children:[e.jsx("span",{className:"hs-advisor-ladder-badge",children:t.quotaRisk?"⚠️ Primary (Quota Risk)":"Primary"}),e.jsxs("div",{className:"hs-advisor-ladder-body",children:[e.jsx("strong",{children:t.modelLabel}),e.jsx("code",{children:A(t.route)}),e.jsx("small",{children:t.quotaRisk?`Exhaustion risk (${t.quota.minimumRemainingPercent}% remaining) · ${t.taskRationale}`:`Initial execution target · ${t.taskRationale}`})]})]}),t.alternatives.map((r,c)=>{const l=G(t,r);return e.jsxs("div",{className:`hs-advisor-ladder-node ${l?"hs-advisor-ladder-node--fallback-rec":""}`,children:[e.jsx("span",{className:"hs-advisor-ladder-badge",children:l?"⭐️ Quota-safe fallback":c===0?"Secondary":"Tertiary"}),e.jsxs("div",{className:"hs-advisor-ladder-body",children:[e.jsx("strong",{children:r.label}),e.jsx("code",{children:A(r.route)}),e.jsx("small",{children:l?`Moves work off ${t.quota.providerLabel} · ${r.taskRationale}`:r.quotaRisk?`Also quota constrained; use only if operationally necessary · ${r.taskRationale}`:`Fallback if ${t.modelLabel} encounters rate limits or errors · ${r.taskRationale}`})]})]},k(r.route))})]})]}),e.jsxs("section",{className:"hs-advisor-quota-secondary",children:[e.jsxs("div",{className:"hs-advisor-quota-secondary-head",children:[e.jsxs("h5",{children:["Provider Telemetry ",t.quotaRisk?"(Active Constraint)":"(Secondary)"]}),e.jsxs("span",{children:[t.quota.providerLabel,t.quota.plan?` · ${t.quota.plan}`:""]})]}),e.jsxs("div",{className:"hs-advisor-quota-compact-bar",children:[e.jsxs("span",{children:["Allowance: ",e.jsx("strong",{children:oe(t.quota)})]}),e.jsxs("span",{children:["Pacing: ",e.jsx("strong",{children:U(t.quota.pacing)})]}),e.jsxs("span",{children:["Telemetry: ",e.jsx("strong",{children:t.quota.confidence})]}),t.quota.nextResetIn?e.jsxs("span",{children:["Next reset: ",e.jsx("strong",{children:t.quota.nextResetIn})]}):null]}),t.quotaRisk?e.jsx("div",{style:{marginTop:"var(--space-sm)"},children:e.jsx(le,{providerLabel:t.quota.providerLabel,quota:t.quota})}):null]})]})]})}function is({models:s}){const n=s.find(r=>r.modelLabel==="GPT-5.6 Sol")??s[0],[a,t]=m.useState(()=>n?k(n.route):""),i=s.find(r=>k(r.route)===a)??n;if(!i)return null;const o=B(i.route);return e.jsxs("div",{className:"hs-model-guide-layout",children:[e.jsx("nav",{className:"hs-model-guide-list","aria-label":"Model Fleet",children:s.map(r=>{const c=k(r.route);return e.jsxs("button",{type:"button",className:"hs-model-guide-item","data-selected":c===k(i.route)?"true":void 0,"aria-pressed":c===k(i.route),onClick:()=>t(c),children:[e.jsx("span",{className:"hs-model-guide-mark",children:e.jsx(L,{harness:r.route.harness,size:23,title:null})}),e.jsxs("span",{className:"hs-model-guide-item-copy",children:[e.jsx("strong",{children:r.modelLabel}),e.jsxs("span",{children:[r.quota.providerLabel," · ",r.route.profile?`profile ${r.route.profile}`:r.route.harness]})]}),e.jsx("span",{className:`hs-advisor-role-tag ${r.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:r.quotaRisk?"⚠️ Conserve":ts(r.guidance)})]},c)})}),e.jsxs("article",{className:"hs-model-guide-detail","aria-live":"polite",children:[e.jsxs("header",{className:"hs-advisor-detail-head",children:[e.jsxs("div",{className:"hs-advisor-model",children:[e.jsx(L,{harness:i.route.harness,size:25,title:null}),e.jsxs("div",{children:[e.jsxs("span",{children:[i.quota.providerLabel,i.quota.plan?` · ${i.quota.plan}`:""]}),e.jsx("h4",{children:i.modelLabel}),e.jsx("code",{children:A(i.route)})]})]}),e.jsx("span",{className:`hs-advisor-fit-badge ${i.quotaRisk?"hs-advisor-role-tag--risk":""}`,children:i.quotaRisk?"⚠️ Quota Risk · Conserve":i.roles.length>0?`${i.roles.length} Assigned Roles`:"Model Fleet"})]}),i.quotaRisk?e.jsx("div",{className:"hs-advisor-quota-alert",role:"alert",children:e.jsxs("div",{className:"hs-advisor-quota-alert-head",children:[e.jsx("span",{className:"hs-advisor-quota-alert-badge",children:"⚠️ Quota Risk"}),e.jsxs("div",{children:[e.jsx("strong",{children:"High Quota Depletion · Conserve Model"}),e.jsxs("p",{children:[i.quota.providerLabel," allowance is near capacity (",i.quota.minimumRemainingPercent,"% remaining). Conserve this model for essential high-fit tasks."]})]})]})}):null,e.jsxs("div",{className:"hs-model-guide-roles",children:[e.jsx("strong",{children:"Assigned task roles"}),e.jsx("div",{className:"hs-model-guide-role-chips",children:i.roles.map(r=>e.jsx("span",{className:"hs-model-guide-role-chip",children:r.label},r.role))})]}),e.jsxs("div",{className:"hs-advisor-assessment",children:[e.jsxs("section",{children:[e.jsx("h5",{children:"Strengths & Cognitive Profile"}),e.jsx("p",{children:i.strengths.join(" ")})]}),e.jsxs("section",{children:[e.jsx("h5",{children:"Watchouts & Guardrails"}),e.jsx("p",{children:i.cautions.join(" ")})]})]}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Direct dispatch"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:o}),e.jsx(z,{text:o,label:"Copy command"})]})]}),e.jsxs("section",{className:"hs-advisor-quota-secondary",children:[e.jsxs("div",{className:"hs-advisor-quota-secondary-head",children:[e.jsxs("h5",{children:["Provider Telemetry ",i.quotaRisk?"(Active Constraint)":"(Secondary)"]}),e.jsxs("span",{children:[i.quota.providerLabel,i.quota.plan?` · ${i.quota.plan}`:""]})]}),e.jsxs("div",{className:"hs-advisor-quota-compact-bar",children:[e.jsxs("span",{children:["Allowance: ",e.jsx("strong",{children:oe(i.quota)})]}),e.jsxs("span",{children:["Pacing: ",e.jsx("strong",{children:U(i.quota.pacing)})]}),e.jsxs("span",{children:["Telemetry: ",e.jsx("strong",{children:i.quota.confidence})]}),i.quota.nextResetIn?e.jsxs("span",{children:["Next reset: ",e.jsx("strong",{children:i.quota.nextResetIn})]}):null]}),i.quotaRisk?e.jsx("div",{style:{marginTop:"var(--space-sm)"},children:e.jsx(le,{providerLabel:i.quota.providerLabel,quota:i.quota})}):null]})]})]})}function rs({assignments:s}){const[n,a]=m.useState("implementation"),[t,i]=m.useState({}),o=s.find(d=>d.role===n)??s[0];if(!o)return null;const r=[{label:o.modelLabel,route:o.route,capability:o.capability,taskRationale:o.taskRationale,quota:o.quota,quotaRisk:o.quotaRisk},...o.alternatives.map(d=>({label:d.label,route:d.route,capability:d.capability,taskRationale:d.taskRationale,quota:d.quota,quotaRisk:d.quotaRisk}))],c=t[o.role],l=c?c.flatMap(d=>{const p=r.find(x=>k(x.route)===d);return p?[p]:[]}):r,h=d=>{const p=l.map(x=>k(x.route));i(x=>({...x,[o.role]:[d,...p.filter(v=>v!==d)]}))},u=B(l[0].route);return e.jsxs("div",{className:"hs-cascade-layout",children:[e.jsx("nav",{className:"hs-advisor-roles","aria-label":"Cascade roles",children:s.map(d=>e.jsx(ce,{assignment:d,selected:d.role===o.role,onSelect:()=>a(d.role)},d.role))}),e.jsxs("article",{className:"hs-cascade-editor",children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsxs("span",{children:[o.roleLabel," · Failover Hierarchy"]}),e.jsx("h4",{children:"Task Escalation Sequence"}),e.jsx("p",{children:"Hierarchical fallback sequence when models encounter rate limits, timeouts, or task complexity thresholds."})]}),c?e.jsx("button",{type:"button",onClick:()=>i(d=>{const p={...d};return delete p[o.role],p}),children:"Reset suggested order"}):e.jsx("span",{children:"Default policy"})]}),e.jsx("ol",{className:"hs-cascade-workflow",children:l.map((d,p)=>{const x=k(d.route),v=p>0&&G(l[0],d),f=p===0?"Primary Route":p===1?"Secondary Fallback":"Tertiary Fallback",g=p===0?d.quotaRisk?`Initial target (⚠️ Quota Risk: ${d.quota.minimumRemainingPercent}% remaining) · ${d.taskRationale}`:`Initial execution target · ${d.taskRationale}`:p===1?v?`⭐️ Quota-safe route off ${l[0].quota.providerLabel} · ${d.taskRationale}`:`Triggered if primary encounters rate limits, errors, or complexity threshold · ${d.taskRationale}`:`Emergency baseline fallback · ${d.taskRationale}`;return e.jsxs("li",{className:"hs-cascade-node",children:[e.jsx("span",{className:"hs-cascade-node-index",children:p+1}),e.jsxs("div",{className:"hs-cascade-node-main",children:[e.jsx("span",{children:f}),e.jsx("strong",{children:d.label}),e.jsx("code",{children:A(d.route)}),e.jsx("p",{children:d.capability}),e.jsx("small",{children:g})]}),e.jsxs("div",{className:"hs-cascade-node-side",children:[e.jsx("em",{className:d.quotaRisk?"hs-advisor-tone--warn":"",children:d.quota.minimumRemainingPercent===null?"quota unknown":`${d.quota.minimumRemainingPercent}% quota remaining`}),p>0?e.jsx("button",{type:"button",onClick:()=>h(x),children:"Make primary"}):null]})]},`${o.role}:${x}`)})}),e.jsxs("section",{className:"hs-advisor-dispatch",children:[e.jsx("h5",{children:"Primary dispatch command"}),e.jsxs("div",{className:"hs-advisor-dispatch-snippet",children:[e.jsx("code",{children:u}),e.jsx(z,{text:u,label:"Copy primary command"})]})]})]})]})}function os({map:s,loading:n,bias:a,onBiasChange:t}){const[i,o]=m.useState("tasks"),r={tasks:"Task-first model routing: Map each role to the optimal cognitive profile and failover ladder.",models:"Model fleet inventory: Inspect cognitive strengths, guardrails, and assigned roles across all models.",cascades:"Failover & escalation rules: Review and customize the task escalation sequence for each role."};return e.jsxs("section",{className:"hs-advisor","aria-labelledby":"hs-orchestrator-map-title","aria-busy":n,children:[e.jsxs("div",{className:"hs-section-head hs-advisor-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-orchestrator-map-title",children:"Orchestrator map"}),e.jsx("p",{children:r[i]})]}),e.jsxs("div",{className:"hs-advisor-head-tools",children:[e.jsx("span",{className:"hs-section-meta",children:n?"refreshing inputs":"advisory · no dispatch"}),e.jsxs("label",{className:"hs-routing-bias",children:[e.jsx("span",{children:"Routing bias"}),e.jsx("input",{type:"range",min:0,max:M.length-1,step:1,value:M.findIndex(c=>c.value===a),"aria-valuetext":M.find(c=>c.value===a)?.label,onChange:c=>{const l=M[Number(c.target.value)];l&&t(l.value)}}),e.jsx("small",{"aria-hidden":"true",children:M.map(c=>e.jsx("i",{"data-active":c.value===a?"true":void 0,children:c.label},c.value))})]})]})]}),e.jsx("div",{className:"hs-routing-angles",role:"group","aria-label":"Orchestrator map angle",children:[["tasks","Task map"],["models","Model fleet"],["cascades","Cascades"]].map(([c,l])=>e.jsx("button",{type:"button","aria-pressed":i===c,onClick:()=>o(c),children:l},c))}),i==="tasks"?e.jsx(ns,{map:s}):null,i==="models"?e.jsx(is,{models:s.models}):null,i==="cascades"?e.jsx(rs,{assignments:s.assignments}):null]})}function ls({rows:s,loading:n,onImported:a}){const t=ie.map(l=>({provider:l,row:s.find(h=>h.id===l.id)??null})),i=t.filter(({row:l})=>l?.gauge).length,o=t.filter(({row:l})=>l?.gauge?.kind==="quota").length,r=t.filter(({row:l})=>l?.gauge?.kind==="quota"&&l.gauge.plan||l?.gauge?.kind==="status").length,c=t.flatMap(({row:l})=>l?.gauge?.kind==="quota"?I(l.gauge):[]).map(l=>l.resetAt).filter(l=>l>Date.now()).sort((l,h)=>l-h)[0];return e.jsxs("section",{className:"hs-subscriptions","aria-labelledby":"hs-subscriptions-title","aria-busy":n,children:[e.jsxs("div",{className:"hs-section-head hs-subscriptions-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-subscriptions-title",children:"Subscriptions"}),e.jsx("p",{children:"Plans, remaining allowance, reset windows, and the fastest path to each provider dashboard."})]}),e.jsxs("div",{className:"hs-subscription-summary","aria-label":"Subscription feed summary",children:[e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":i})," detected"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":o})," usage feeds"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":r})," plans named"]}),e.jsxs("span",{children:[e.jsx("strong",{children:n?"—":c?H(c):"-"})," next reset"]})]})]}),e.jsx("div",{className:"hs-subscription-grid",children:t.map(({provider:l,row:h})=>{const u=h?.gauge??null,d=n&&!u,p=d?"loading":u?"connected":"missing",x=u?.kind==="quota"?u.plan:u?.kind==="status"?u.statusLabel:null,v=Xe(u),f=u?.kind==="quota"?"Usage connected":u?.kind==="status"?u.detailLabel||"Subscription detected":d?"Checking":"Not detected";return e.jsxs("article",{className:`hs-subscription-card hs-subscription-card--${p}`,children:[e.jsxs("header",{className:"hs-subscription-card-head",children:[e.jsxs("div",{className:"hs-subscription-provider",children:[e.jsx(L,{harness:l.id,size:18,title:null,className:"hs-subscription-mark"}),e.jsxs("div",{children:[e.jsx("h4",{children:P(l.id)}),e.jsx("span",{children:d?"Checking local plan…":x||"Plan not reported"})]})]}),e.jsx("span",{className:`hs-subscription-state hs-subscription-state--${p}`,children:f})]}),e.jsx("p",{className:"hs-subscription-description",children:l.description}),d?e.jsx(ss,{}):u?.kind==="quota"?e.jsx("div",{className:"hs-subscription-windows",children:I(u).map(g=>e.jsx(es,{gauge:u,window:g},`${l.id}:${g.label}`))}):u?.kind==="status"?e.jsxs("div",{className:"hs-subscription-status-detail",children:[e.jsx("strong",{children:u.statusLabel}),e.jsx("span",{children:u.detailLabel||"Subscription detected locally. Open the provider dashboard for live usage."})]}):e.jsxs("div",{className:"hs-subscription-missing",children:[e.jsx("strong",{children:"No local subscription feed yet"}),e.jsx("span",{children:"Open the provider locally, then refresh Scout."})]}),l.id==="cursor"||l.id==="grok"&&u?.kind!=="quota"?e.jsx(Ze,{provider:l.id,onImported:a}):null,e.jsxs("footer",{className:"hs-subscription-footer",children:[e.jsxs("span",{children:[d?"checking local feed":v?`updated ${J(v)||"now"}`:u?"detected locally":"waiting for provider data",u?.source?` · ${u.source}`:""]}),e.jsx("nav",{"aria-label":`${P(l.id)} quick links`,children:l.links.map(g=>e.jsxs("a",{href:g.href,target:"_blank",rel:"noreferrer",children:[g.label,e.jsx(Y,{size:11,"aria-hidden":"true"})]},g.href))})]})]},l.id)})})]})}function cs({accounts:s,loading:n}){return s.length===0&&!n?null:e.jsxs("section",{className:"hs-cloud-accounts","aria-labelledby":"hs-cloud-accounts-title","aria-busy":n,children:[e.jsxs("div",{className:"hs-section-head hs-cloud-accounts-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-cloud-accounts-title",children:"Cloud accounts"}),e.jsx("p",{children:"Infrastructure available to Scout for deployment and agent compute."})]}),e.jsx("span",{className:"hs-section-meta",children:n?"checking accounts":`${s.length} connected`})]}),e.jsxs("div",{className:"hs-cloud-grid",children:[n&&s.length===0?Array.from({length:3},(a,t)=>e.jsxs("article",{className:"hs-cloud-card hs-cloud-card--loading","aria-hidden":"true",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsx("span",{className:"hs-loading-mark"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-title"})]}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-copy"}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-meta"}),e.jsx("span",{className:"hs-loading-actions"})]})]},t)):null,s.map(a=>{const t=ze[a.id];return e.jsxs("article",{className:"hs-cloud-card",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsxs("div",{className:"hs-cloud-identity",children:[e.jsx(Qe,{provider:a.id}),e.jsxs("div",{children:[e.jsx("span",{className:"hs-cloud-category",children:t.category}),e.jsx("h4",{children:a.label})]})]}),e.jsx("span",{className:"hs-subscription-state hs-subscription-state--connected",children:a.statusLabel})]}),e.jsx("p",{className:"hs-cloud-description",children:t.description}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsxs("span",{className:"hs-cloud-connection",children:[e.jsx("span",{className:"hs-cloud-dot","aria-hidden":"true"}),a.detailLabel]}),e.jsx("nav",{"aria-label":`${a.label} quick links`,children:He[a.id].map(i=>e.jsxs("a",{href:i.href,target:"_blank",rel:"noreferrer",children:[i.label,e.jsx(Y,{size:11,"aria-hidden":"true"})]},i.href))})]})]},a.id)})]})]})}function oa({navigate:s}){const{route:n}=ge(),a=fe(n),[t]=m.useState(()=>me("/api/service-budgets",Ge)),[i,o]=m.useState(t?.gauges??[]),[r,c]=m.useState(t?.cloudAccounts??[]),[l,h]=m.useState("budget"),[u,d]=m.useState(()=>S(t?.generatedAt)??Date.now()),[p,x]=m.useState("balanced"),[v,f]=m.useState(t===null),[g,q]=m.useState(!1),[T,Q]=m.useState(null),_=m.useRef(0),W=m.useRef(t!==null),R=m.useCallback(async(y=!1,C=!1)=>{const E=++_.current;C&&!W.current&&f(!0),q(!0),Q(null);try{const w=await Z(`/api/service-budgets${y?"?refresh=1":""}`);if(E!==_.current)return;W.current=!0,o(w.gauges??[]),d(S(w.generatedAt)??Date.now()),c(w.cloudAccounts??[])}catch(w){E===_.current&&Q(w instanceof Error?w.message:String(w))}finally{E===_.current&&(f(!1),q(!1))}},[]);m.useEffect(()=>{let y=!1,C;return R(!1,!0).then(()=>{y||(C=window.setTimeout(()=>{R(!0)},600))}),()=>{y=!0,C!==void 0&&window.clearTimeout(C)}},[R]),m.useEffect(()=>{const y=window.setInterval(()=>{R(!1)},3e4);return()=>window.clearInterval(y)},[R]);const de=m.useMemo(()=>Je(i),[i]),ue=m.useMemo(()=>{const y=Date.now();return we(as(i,u,y),{now:y,bias:p})},[u,p,i]),he=xe();return e.jsxs("div",{className:"s-ops",children:[he?e.jsx("div",{className:"s-ops-header",children:e.jsx(be,{activeRoute:{view:"harnesses",...a?{machineId:a}:{}},navigate:s})}):null,e.jsx("div",{className:"s-ops-body hs-body",children:e.jsxs("div",{className:"hs-page",children:[e.jsxs("header",{className:"hs-page-head",children:[e.jsxs("div",{className:"hs-title-group",children:[e.jsx("span",{className:"hs-kicker",children:"ops / provider central"}),e.jsx("h2",{children:"Agent Providers"}),e.jsx("p",{children:l==="budget"?"See what you pay for, how much remains, and where to use it.":"Map each kind of work to a model and provider route using live quota posture."})]}),e.jsxs("div",{className:"hs-page-actions",children:[e.jsxs("div",{className:"hs-view-switch",role:"group","aria-label":"Provider view",children:[e.jsx("button",{type:"button","aria-pressed":l==="budget",onClick:()=>h("budget"),children:"Budget"}),e.jsx("button",{type:"button","aria-pressed":l==="routing",onClick:()=>h("routing"),children:"Routing"})]}),e.jsxs("button",{type:"button",className:"hs-refresh",disabled:g,onClick:()=>{R(!0)},children:[e.jsx(ve,{size:14,className:g?"hs-refresh-icon-spinning":"","aria-hidden":"true"}),e.jsx("span",{children:g?"Refreshing":"Refresh"})]})]})]}),T&&e.jsxs("div",{className:"hs-error",role:"status","aria-live":"polite",children:["refresh: ",T]}),l==="budget"?e.jsxs("div",{id:"hs-budget-view",className:"hs-provider-view",children:[e.jsx(ls,{rows:de,loading:v,onImported:()=>R(!1)}),e.jsx(cs,{accounts:r,loading:v})]}):e.jsx("div",{id:"hs-routing-view",className:"hs-provider-view",children:e.jsx(os,{map:ue,loading:v,bias:p,onBiasChange:x})})]})})]})}export{oa as HarnessesScreen};
@@ -1 +0,0 @@
1
- import{r as c,j as s}from"./index-C1VaWNuD.js";/* empty css */import{H as ds}from"./HarnessMark-DttReffF.js";import{a as b}from"./api-Co9aQ2Jw.js";import{u as hs}from"./sse-B29iGBnw.js";import{t as C}from"./time-Dhsh_2EG.js";import{C as ms}from"./compass-BdpImt_W.js";import{F as us}from"./file-text-BHro8MkG.js";import{L as ps}from"./layout-grid-BoVnPOk-.js";import{R as xs}from"./refresh-cw-Bkh7Cvnd.js";import{A as H}from"./arrow-up-right-B09GPwFl.js";import{C as Ns}from"./cpu-CHFIGw87.js";import{G as fs,D as js}from"./gauge-DSflSery.js";import{c as gs}from"./createLucideIcon-Dv8H8m7J.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";const bs=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],ks=gs("folder-git-2",bs),vs=.8,ws=20,F="░",T="·",Ss=["▏","▎","▍","▌","▋","▊","▉"];function ys(a,r=ws){const o=Number.isFinite(a)?Math.min(1,Math.max(0,a)):0,d=Math.round(o*100);if(o<=0)return{filled:"",rest:T.repeat(r),cells:r,percent:0};const i=o*r;let h=Math.floor(i),m=Math.round((i-h)*8);return m===8&&(h+=1,m=0),h>=r?{filled:F.repeat(r),rest:"",cells:r,percent:d}:m===0?h===0?{filled:"▏",rest:T.repeat(r-1),cells:r,percent:d}:{filled:F.repeat(h),rest:T.repeat(r-h),cells:r,percent:d}:{filled:F.repeat(h)+Ss[m-1],rest:T.repeat(r-h-1),cells:r,percent:d}}function S(a){return a.kind==="status"||typeof a.fill!="number"||!Number.isFinite(a.fill)?null:Math.min(1,Math.max(0,a.fill))}function _(a){const r=S(a);return r!==null&&r>=vs}function J(a){return S(a)===0}function $s(a){if(a===null)return{verdict:"Reading",figures:"provider budgets still arriving",showGauges:!1,near:[],unused:0,configured:0,peakPercent:null};if(a.length===0)return{verdict:"All clear",figures:"no provider budgets reported",showGauges:!1,near:[],unused:0,configured:0,peakPercent:null};const r=[...a].filter(_).sort((v,D)=>(S(D)??0)-(S(v)??0)),o=a.filter(J).length,d=a.map(S).filter(v=>v!==null),i=d.length>0?Math.round(Math.max(...d)*100):null,h=a.length-o;let m;r.length>0?m=`${r.length} near ceiling`:h===0?m="Unused":m=`Peak ${i??0}%`;const f=[r.length>0?r.map(v=>`${v.label} ${Math.round((S(v)??0)*100)}%`).join(" · "):null,`${a.length} configured`,o>0&&h>0?`${o} unused`:null].filter(Boolean).join(" · ");return{verdict:m,figures:f,showGauges:!0,near:r,unused:o,configured:a.length,peakPercent:i}}function Es(a,r){if(!a)return r||"process";if(a.includes("--append-system-prompt")){const o=a.match(/session-[a-zA-Z0-9_-]+/);return o?`${r||"harness"} (relay ${o[0]})`:`${r||"harness"} (prompted relay)`}return a.length>70?`${a.slice(0,67)}...`:a}function I(a){if(!a)return"workspace";const r=a.replace(/\/+$/,"").split("/");return r[r.length-1]||a}function Rs(a){if(!a)return;const[r,o]=a.includes("-")?a.split("-"):["0",a],d=o.split(":").map(f=>Number.parseInt(f,10));if(d.length<2||d.some(f=>!Number.isFinite(f)))return;const[i,h,m]=d.length===3?d:[0,d[0],d[1]];return((Number.parseInt(r,10)||0)*24+i)*3600+h*60+m}function Z(a){if(a<60)return`${Math.round(a)}s`;const r=Math.floor(a/60);if(r<60)return`${r}m`;const o=Math.floor(r/60),d=r%60;return o<24?d?`${o}h${String(d).padStart(2,"0")}m`:`${o}h`:`${Math.floor(o/24)}d${o%24}h`}function As(a){const r=a.split("/").filter(Boolean);return r[r.length-1]||a}const X={stalled_relay:"relay",idle_process:"process",uncommitted_branch:"branch",unresumed_session:"session"};function Ps({gauge:a}){const r=S(a),o=_(a),d=J(a),i=ys(r??0),h=r!==null,m=o?"warn":d||!h?"unused":"ok",f=d?"UNUSED":a.resetAt?`RESET ${C(a.resetAt)}`:a.statusLabel||a.usedLabel||"";return s.jsxs("div",{className:`s-host-rack-row ${o?"s-host-rack-row--warn":""} ${d||!h?"s-host-rack-row--unused":""}`,children:[s.jsx("span",{className:"s-host-rack-name font-mono",children:a.label}),s.jsxs("span",{className:`s-host-gauge s-host-gauge--${m}`,role:"meter","aria-label":h?`${a.label} ${i.percent} percent`:`${a.label} ${a.statusLabel||"no quota"}`,"aria-valuemin":h?0:void 0,"aria-valuemax":h?100:void 0,"aria-valuenow":h?i.percent:void 0,children:[s.jsx("span",{className:"s-host-gauge-chrome","aria-hidden":"true",children:"["}),s.jsx("span",{className:"s-host-gauge-fill","aria-hidden":"true",children:i.filled}),s.jsx("span",{className:"s-host-gauge-rest","aria-hidden":"true",children:i.rest}),s.jsx("span",{className:"s-host-gauge-chrome","aria-hidden":"true",children:"]"})]}),s.jsx("span",{className:`s-host-rack-right font-mono ${o?"s-host-rack-age--warn":""} ${d||!h?"s-host-rack-dim":""}`,children:h?`${i.percent}%`:"—"}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono s-host-rack-truncate",children:f})]})}function se({navigate:a,agents:r}){const[o,d]=c.useState(null),[i,h]=c.useState(null),[m,f]=c.useState(null),[v,D]=c.useState(null),[z,ss]=c.useState(null),[L,es]=c.useState(null),[O,ts]=c.useState([]),[Ms,as]=c.useState(null),[V,ns]=c.useState([]),[Ts,rs]=c.useState([]),[Is,K]=c.useState(!0),[E,W]=c.useState(!1),[Cs,os]=c.useState(Date.now()),[G,Y]=c.useState("inquiry"),[ls,Ds]=c.useState(!1),[Ls,Os]=c.useState({"q-attention":!0,"q-dropped":!0,"q-quotas":!0,"q-posture":!0}),R=c.useCallback(async(e=!1)=>{e?W(!0):K(!0);try{const[t,n,l,k,P,p,N,M,B,q]=await Promise.allSettled([b("/.host-info"),b("/api/build"),b("/api/service-budgets"),b("/api/tail/discover"),b("/api/knowledge/status"),b("/api/pairing-state"),b("/api/terminal-sessions"),b("/api/fleet"),b("/api/sessions"),b("/api/activity")]);t.status==="fulfilled"&&d(t.value),n.status==="fulfilled"&&h(n.value),l.status==="fulfilled"?f(l.value?.gauges??[]):l.status==="rejected"&&f([]),k.status==="fulfilled"&&D(k.value),P.status==="fulfilled"&&ss(P.value),p.status==="fulfilled"&&es(p.value),N.status==="fulfilled"&&N.value?.sessions&&ts(N.value.sessions),M.status==="fulfilled"&&as(M.value),B.status==="fulfilled"&&Array.isArray(B.value)&&ns(B.value),q.status==="fulfilled"&&Array.isArray(q.value)&&rs(q.value),os(Date.now())}finally{K(!1),W(!1)}},[]);c.useEffect(()=>{R()},[R]),hs(()=>{R(!0)});const x=v?.processes??[],is=ls?x:x.slice(0,5);c.useMemo(()=>{const e={};for(const t of r){const n=t.harness||"other";e[n]||(e[n]={total:0,active:0}),e[n].total+=1,t.state==="working"&&(e[n].active+=1)}for(const t of x){const n=t.harness||"other";e[n]||(e[n]={total:0,active:0}),e[n].total=Math.max(e[n].total,1),e[n].active=Math.max(e[n].active,1)}return e},[r,x]);const $=c.useMemo(()=>{const e=new Map;for(const t of r){const n=t.projectRoot||t.cwd||"unknown";e.has(n)||e.set(n,{root:n,name:I(n),agents:[],branches:new Set,processes:[]});const l=e.get(n);l.agents.push(t),t.branch&&l.branches.add(t.branch)}for(const t of x)if(t.cwd)for(const[n,l]of e.entries())(t.cwd.startsWith(n)||n.startsWith(t.cwd))&&l.processes.push(t);return Array.from(e.values())},[r,x]),w=c.useMemo(()=>{const e=$.reduce((p,N)=>p+Math.max(1,N.agents.length+N.processes.length*3),0),t=$.map(p=>{const N=Math.max(1,p.agents.length+p.processes.length*3),M=e>0?Math.round(N/e*100):0;return{...p,weight:N,percent:M,primaryBranch:Array.from(p.branches)[0]||p.name==="openscout"&&i?.gitBranch||"main"}}).sort((p,N)=>N.weight-p.weight),n=t.slice(0,5),l=t[0],k=t.slice(5),P=k.reduce((p,N)=>p+N.percent,0);return{ranked:t,topProjects:n,topProject:l,otherProjects:k,otherPercent:P,totalProjects:t.length}},[$,i]),j=c.useMemo(()=>{const e=[];for(const t of x)if(t.command&&t.command.includes("--append-system-prompt")){const n=t.command.match(/session-[a-zA-Z0-9_-]+/),l=n?n[0]:`PID ${t.pid}`;e.push({id:`relay-${t.pid}`,kind:"stalled_relay",title:l,subtitle:`Launched in ${I(t.cwd)} · PID ${t.pid} · Runtime ${t.etime||"active"}`,ageLabel:t.etime||"active",ageSeconds:Rs(t.etime),projectRoot:t.cwd||void 0,harness:t.harness,pid:t.pid,severity:"warn",actionLabel:"Tail Process",actionRoute:{view:"ops",mode:"mission"}})}i?.gitBranch&&i.gitBranch!=="main"&&e.push({id:"branch-divergence",kind:"uncommitted_branch",title:i.gitBranch,subtitle:`Local worktree is ahead with uncommitted edits on ${i.runtime?.platform||"darwin"}`,ageLabel:"Unmerged",projectRoot:"/Users/art/dev/openscout",severity:"neutral",actionLabel:"Inspect Repos",actionRoute:{view:"repos"}});for(const t of V.slice(0,4))t.lastMessageAt&&Date.now()-t.lastMessageAt>3600*1e3&&e.push({id:`session-${t.id}`,kind:"unresumed_session",title:t.title||t.id,subtitle:`Last turn recorded ${C(t.lastMessageAt)} · ${t.messageCount} messages · ${I(t.workspaceRoot)}`,ageLabel:C(t.lastMessageAt),ageSeconds:(Date.now()-t.lastMessageAt)/1e3,conversationId:t.id,projectRoot:t.workspaceRoot||void 0,harness:t.harness||void 0,severity:"info",actionLabel:"Open Chat",actionRoute:{view:"conversation",conversationId:t.id}});return e},[x,i,V]),g=c.useMemo(()=>m?.length?[...m].sort((e,t)=>(t.fill??0)-(e.fill??0))[0]:null,[m]),u=c.useMemo(()=>{const e=w.ranked;if(e.length===0)return null;const t=e[0].percent,n=w.otherProjects;return{verdict:t>=50?"Concentrated":t>=25?"Weighted":"Scattered",topPercent:t,tailPercent:w.otherPercent,tailCount:n.length,tailAgents:n.reduce((l,k)=>l+k.agents.length,0),tailProcesses:n.reduce((l,k)=>l+k.processes.length,0),aboveTen:e.filter(l=>l.percent>=10).length}},[w]),y=c.useMemo(()=>{const e=j.reduce((n,l)=>(n[l.kind]=(n[l.kind]??0)+1,n),{}),t=j.map(n=>n.ageSeconds).filter(n=>typeof n=="number").sort((n,l)=>l-n)[0];return{verdict:j.length===0?"Nothing unattended":`${j.length} unattended`,byKind:e,oldestLabel:t?Z(t):null}},[j]),U=c.useMemo(()=>$s(m),[m]),A=c.useMemo(()=>{const e=O.length,t=z?.indexedSessions??0,n=L?.trustedPeerCount??0,l=o?.brokerUrl||(o?.ports?.broker?`127.0.0.1:${o.ports.broker}`:null);return[{key:"broker",label:"broker",detail:l?[l,o?.brokerSocketPath?As(o.brokerSocketPath):null].filter(Boolean).join(" · "):"endpoint not reported",state:l?"UP":"UNKNOWN",tone:l?"ok":"unknown"},{key:"pty",label:"pty relay",detail:e>0?`${e} socket${e===1?"":"s"}`:"0 sockets · latency unmeasured",state:e>0?"ACTIVE":"IDLE",tone:e>0?"ok":"idle"},{key:"knowledge",label:"knowledge",detail:t>0?`${t.toLocaleString()} transcript${t===1?"":"s"} indexed`:"0 transcripts indexed",state:t>0?"INDEXED":"EMPTY",tone:t>0?"ok":"warn",action:t>0?void 0:{label:"Index",route:{view:"search"}}},{key:"mesh",label:"mesh",detail:n>0?`${n} trusted peer${n===1?"":"s"} · scope ${o?.advertiseScope||"mesh"}`:`no trusted peers · scope ${o?.advertiseScope||"mesh"}`,state:n>0?"PAIRED":"UNPAIRED",tone:n>0?"ok":"idle"}]},[o,O,z,L]),Q=c.useMemo(()=>{const e=A.reduce((n,l)=>(n[l.tone]=(n[l.tone]??0)+1,n),{}),t=A.filter(n=>n.tone==="warn");return{verdict:t.length>0?`${t.length} ${t.length===1?"needs":"need"} attention`:"All nominal",figures:[e.ok?`${e.ok} up`:null,e.idle?`${e.idle} idle`:null,e.warn?`${e.warn} empty`:null,e.unknown?`${e.unknown} unknown`:null].filter(Boolean).join(" · ")}},[A]);o?.nodeName||o?.hostName;const cs=i?.runtime?`${i.runtime.platform} ${i.runtime.arch} · ${i.runtime.engine} ${i.runtime.engineVersion}`:"Darwin arm64";return s.jsxs("div",{className:"s-host-view",children:[s.jsxs("header",{className:"s-host-header",children:[s.jsxs("div",{className:"s-host-header-left",children:[s.jsxs("div",{className:"s-host-header-status-line",children:[s.jsx("span",{className:"dot dot--sm dot--working dot--pulse","aria-hidden":"true"}),s.jsxs("span",{className:"label-xs s-host-mono-dim",children:["NODE: ",o?.nodeId||"local"]}),s.jsx("span",{className:"s-host-header-divider",children:"/"}),s.jsx("span",{className:"label-xs s-host-mono-dim",children:cs}),i?.gitHash&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"s-host-header-divider",children:"/"}),s.jsxs("span",{className:"label-xs s-host-mono-dim",children:["git:",i.gitHash.slice(0,7)]})]})]}),s.jsxs("h1",{className:"s-host-title",children:[s.jsx(ms,{size:22,className:"s-host-title-icon"}),s.jsx("span",{children:"Host Advisor"})]})]}),s.jsxs("div",{className:"s-host-header-right",children:[s.jsxs("div",{className:"s-host-mode-toggle",role:"group","aria-label":"Advisor Format",children:[s.jsxs("button",{type:"button",className:`s-host-mode-btn ${G==="inquiry"?"s-host-mode-btn--active":""}`,onClick:()=>Y("inquiry"),title:"Formatted Executive Inquiries & Operator Answers",children:[s.jsx(us,{size:12}),s.jsx("span",{children:"Inquiries"})]}),s.jsxs("button",{type:"button",className:`s-host-mode-btn ${G==="matrix"?"s-host-mode-btn--active":""}`,onClick:()=>Y("matrix"),title:"Compact Infrastructure Matrix",children:[s.jsx(ps,{size:12}),s.jsx("span",{children:"Matrix"})]})]}),s.jsxs("button",{type:"button",className:`btn btn--sm ${E?"btn--accent":""}`,disabled:E,onClick:()=>{R(!0)},children:[s.jsx(xs,{size:12,className:E?"s-spin":""}),s.jsx("span",{children:E?"Scanning...":"Refresh"})]})]})]}),s.jsxs("section",{className:"s-host-readouts","aria-label":"Host Readouts",children:[s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"AGENTS"}),s.jsx("span",{className:"s-host-readout-figure",children:r.length}),s.jsxs("span",{className:"label-xs s-host-readout-qual",children:[x.length," PROCESS",x.length===1?"":"ES"]})]}),s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"ROOTS"}),s.jsx("span",{className:"s-host-readout-figure",children:$.length}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:u?`TOP SHARE ${u.topPercent}%`:"NONE ACTIVE"})]}),s.jsxs("div",{className:`s-host-readout ${g&&_(g)?"s-host-readout--warn":""}`,children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"PEAK BUDGET"}),s.jsx("span",{className:"s-host-readout-figure",children:g?`${Math.round((g.fill??0)*100)}%`:"—"}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:g?`${g.label}${g.resetAt?` · RESET ${C(g.resetAt)}`:""}`:"NO PROVIDERS CONFIGURED"})]}),s.jsxs("div",{className:`s-host-readout ${j.length>0?"s-host-readout--flag":""}`,children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"UNATTENDED"}),s.jsx("span",{className:"s-host-readout-figure",children:j.length}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:y.oldestLabel?`OLDEST ${y.oldestLabel}`:"NONE OPEN"})]}),s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"MESH PEERS"}),s.jsx("span",{className:"s-host-readout-figure",children:L?.trustedPeerCount??0}),s.jsxs("span",{className:"label-xs s-host-readout-qual",children:["SCOPE ",(o?.advertiseScope||"mesh").toUpperCase()]})]})]}),G==="inquiry"?s.jsxs("div",{className:"s-host-readings","aria-label":"Host Readings",children:[s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"01 // ATTENTION"}),s.jsx("span",{className:"s-host-reading-verdict",children:u?.verdict??"No active roots"}),s.jsx("span",{className:"s-host-reading-figures",children:u?s.jsxs(s.Fragment,{children:["top ",u.topPercent,"%",s.jsx("span",{className:"s-host-sep",children:"·"}),"tail ",u.tailPercent,"%",s.jsx("span",{className:"s-host-sep",children:"·"}),u.aboveTen," root",u.aboveTen===1?"":"s"," above 10%"]}):s.jsx(s.Fragment,{children:"no agents or processes bound to a workspace"})}),s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"repos"}),children:[s.jsx("span",{children:"Repos"}),s.jsx(H,{size:10})]})]}),w.ranked.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"s-host-share-bar",children:[w.topProjects.map((e,t)=>s.jsx("div",{className:`s-host-share-seg s-host-share-seg--${Math.min(t,4)}`,style:{width:`${e.percent}%`},title:`${e.name} ${e.percent}%`,children:s.jsxs("span",{className:"s-host-share-seg-label font-mono text-2xs",children:[e.name," ",e.percent,"%"]})},e.root)),u&&u.tailCount>0&&s.jsx("div",{className:"s-host-share-seg s-host-share-seg--tail",style:{flex:1},children:s.jsxs("span",{className:"s-host-share-seg-label font-mono text-2xs",children:[u.tailCount," OTHER ROOTS — ",u.tailPercent,"%"]})})]}),s.jsxs("div",{className:"s-host-rack s-host-rack--roots",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs",children:"ROOT"}),s.jsx("span",{className:"label-xs",children:"SHARE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PCT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"AGENTS"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PROCS"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"BRANCH"})]}),w.topProjects.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:"s-host-rack-name font-mono",children:e.name}),s.jsx("span",{className:"s-host-rack-track",children:s.jsx("span",{className:"s-host-rack-fill",style:{width:`${u&&u.topPercent>0?Math.round(e.percent/u.topPercent*100):0}%`}})}),s.jsxs("span",{className:"s-host-rack-right font-mono",children:[e.percent,"%"]}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.agents.length}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.processes.length}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono s-host-rack-truncate",children:e.primaryBranch})]},e.root)),u&&u.tailCount>0&&s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--tail",children:[s.jsxs("span",{className:"s-host-rack-name font-mono",children:["tail — ",u.tailCount," roots"]}),s.jsx("span",{className:"s-host-rack-track s-host-rack-track--hatch"}),s.jsxs("span",{className:"s-host-rack-right font-mono",children:[u.tailPercent,"%"]}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:u.tailAgents}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:u.tailProcesses}),s.jsxs("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:["each below ",w.topProjects.at(-1)?.percent??0,"%"]})]})]})]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"02 // UNATTENDED"}),s.jsx("span",{className:"s-host-reading-verdict",children:y.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:j.length>0?s.jsxs(s.Fragment,{children:[y.oldestLabel&&s.jsxs(s.Fragment,{children:["oldest ",y.oldestLabel,s.jsx("span",{className:"s-host-sep",children:"·"})]}),Object.entries(y.byKind).map(([e,t])=>`${t} ${X[e]??e}`).join(" · "),s.jsx("span",{className:"s-host-sep",children:"·"}),"of ",x.length," processes"]}):s.jsx(s.Fragment,{children:"no idle relays, diverged branches or stale conversations"})})]}),j.length>0&&s.jsxs("div",{className:"s-host-rack s-host-rack--unattended",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs"}),s.jsx("span",{className:"label-xs",children:"SIGNAL"}),s.jsx("span",{className:"label-xs",children:"ROOT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"REF"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"AGE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"ACTION"})]}),j.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:`dot dot--sm ${e.severity==="warn"?"dot--warning":"dot--neutral"}`,"aria-hidden":"true"}),s.jsx("span",{className:"s-host-rack-name font-mono s-host-rack-truncate",children:e.title}),s.jsx("span",{className:"s-host-rack-dim font-mono s-host-rack-truncate",children:e.projectRoot?I(e.projectRoot):"—"}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.pid?`pid ${e.pid}`:X[e.kind]??e.kind}),s.jsx("span",{className:`s-host-rack-right font-mono s-host-rack-age ${e.severity==="warn"?"s-host-rack-age--warn":""}`,children:e.ageSeconds?Z(e.ageSeconds):e.ageLabel}),s.jsx("span",{className:"s-host-rack-right s-host-rack-actions",children:e.actionRoute&&s.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>e.actionRoute&&a(e.actionRoute),children:e.actionLabel})})]},e.id))]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"03 // BUDGETS"}),s.jsx("span",{className:"s-host-reading-verdict",children:U.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:U.figures}),s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"harnesses"}),children:[s.jsx("span",{children:"Providers"}),s.jsx(H,{size:10})]})]}),U.showGauges&&m&&s.jsxs("div",{className:"s-host-rack s-host-rack--budgets",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs",children:"PROVIDER"}),s.jsx("span",{className:"label-xs",children:"GAUGE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PCT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"NOTE"})]}),m.map(e=>s.jsx(Ps,{gauge:e},e.id))]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"04 // SUBSYSTEMS"}),s.jsx("span",{className:"s-host-reading-verdict",children:Q.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:Q.figures})]}),s.jsxs("div",{className:"s-host-rack s-host-rack--subsystems",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs"}),s.jsx("span",{className:"label-xs",children:"SUBSYSTEM"}),s.jsx("span",{className:"label-xs",children:"DETAIL"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"STATE"})]}),A.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:`dot dot--sm s-host-dot--${e.tone}`,"aria-hidden":"true"}),s.jsx("span",{className:"s-host-rack-name font-mono",children:e.label}),s.jsx("span",{className:"s-host-rack-dim font-mono s-host-rack-truncate",children:e.detail}),s.jsxs("span",{className:"s-host-rack-right s-host-rack-actions",children:[e.action&&s.jsx("button",{type:"button",className:"btn btn--sm s-host-btn-accent",onClick:()=>e.action&&a(e.action.route),children:e.action.label}),s.jsx("span",{className:`chip chip--sm chip--mono s-host-state s-host-state--${e.tone}`,children:e.state})]})]},e.key))]})]})]}):s.jsxs("div",{className:"s-host-matrix-container",children:[s.jsxs("section",{className:"s-host-telemetry-grid","aria-label":"Host Telemetry Overview",children:[s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"REGISTERED AGENTS"}),s.jsx(Ns,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:r.length}),s.jsxs("span",{className:"s-host-stat-kicker",children:[x.length," background processes"]})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"SERVICE QUOTA RADAR"}),s.jsx(fs,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:g?`${Math.round((g.fill??0)*100)}%`:"Nominal"}),s.jsx("span",{className:"s-host-stat-kicker",children:"peak token consumption"})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"WORKSPACES & REPOS"}),s.jsx(ks,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:$.length}),s.jsx("span",{className:"s-host-stat-kicker",children:"registered project roots"})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"SUBSYSTEM RELAYS"}),s.jsx(js,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:O.length}),s.jsx("span",{className:"s-host-stat-kicker",children:"live terminal relays"})]})]})]}),s.jsxs("section",{className:"s-host-block","aria-label":"Active Processes",children:[s.jsx("div",{className:"s-host-block-head",children:s.jsxs("span",{className:"label-xs",children:["ACTIVE HARNESS PROCESSES (",x.length,")"]})}),s.jsx("div",{className:"s-host-table-box",children:s.jsx("div",{className:"s-host-table",children:is.map(e=>s.jsxs("div",{className:"s-host-table-row",children:[s.jsxs("div",{className:"s-host-table-cell-main",children:[s.jsx("span",{className:"dot dot--sm dot--working dot--pulse","aria-hidden":"true"}),s.jsx(ds,{harness:e.harness,size:13}),s.jsx("span",{className:"font-semibold text-xs font-mono",children:Es(e.command,e.harness)}),s.jsxs("span",{className:"chip chip--sm chip--ghost chip--mono",children:["PID ",e.pid]}),e.etime&&s.jsx("span",{className:"chip chip--sm chip--ghost chip--mono",children:e.etime})]}),s.jsx("div",{className:"s-host-table-cell-action",children:s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"ops",mode:"mission"}),children:[s.jsx("span",{children:"Tail"}),s.jsx(H,{size:10})]})})]},e.pid))})})]})]})]})}export{se as HostAdvisorView};
@@ -1 +0,0 @@
1
- import{r as t,j as e}from"./index-C1VaWNuD.js";/* empty css */import{a as se}from"./api-Co9aQ2Jw.js";import{I as ne,ax as re,ay as Q,H as te,az as ae,aA as ie,aB as A,aC as ce,aD as B,aE as de,aF as oe,aG as le,O as he}from"./router-kfcaYqZr.js";import{u as pe}from"./Provider-D0bB7q6y.js";import{c as P}from"./createLucideIcon-Dv8H8m7J.js";import{X as ue}from"./x-DgmmnPKt.js";import{C as V}from"./check-Dz2SRHft.js";import{C as D}from"./copy-BzdzWsQd.js";import{E as xe}from"./external-link-BvX5PfLh.js";import{L as me}from"./loader-circle-DmUG_YC7.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?Q(n,"project"):"",F=n?Q(n,"harness"):"",p=f.trim(),z=te(r),T=ae(r),L=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]),q=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,F?e.jsx("span",{children:F}):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:()=>{q()},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})})]}),L?e.jsxs("div",{className:"ks-preview-source",children:[e.jsx("span",{children:"Source"}),e.jsx("code",{children:B(L)}),e.jsxs("button",{type:"button",onClick:()=>{q()},"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 +0,0 @@
1
- import{r as l,j as e}from"./index-C1VaWNuD.js";/* empty css */import{a as $}from"./api-Co9aQ2Jw.js";import{d as Le}from"./time-Dhsh_2EG.js";import{u as Ae}from"./Provider-D0bB7q6y.js";import{t as qe,v as de,x as Ie,y as Te,z as De,A as he,K as f,B as Fe,C as be,D as Re,E as He,G as Me,H as me,I as pe,J as We,L as $e,M as Oe,N as Pe,O as _e,P as ze}from"./router-kfcaYqZr.js";import{S as Ue}from"./search-FB2vVxCp.js";import{X as Be}from"./x-DgmmnPKt.js";import{L as fe}from"./loader-circle-DmUG_YC7.js";import{c as Ge}from"./createLucideIcon-Dv8H8m7J.js";import{S as Je}from"./sparkles-D0vWLTyC.js";import{C as Xe}from"./chevron-down-D120PY4g.js";import{C as Qe}from"./clock-_9FDplIT.js";import"./perf-PX8Rx0EP.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";const Ve=[["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"}]],Ye=Ge("funnel",Ve),Ze=5*6e4;function xe(t){return qe(t).toString()}let Q={status:null,results:[],lastFilterKey:"",facets:null,indexedAt:null};function ke(){return Q}function T(t){Q={...Q,...t}}function g(t){return new Intl.NumberFormat("en-US").format(t||0)}function es({text:t,query:a}){return e.jsx(e.Fragment,{children:_e(t,a).map((o,c)=>o.match?e.jsx("mark",{children:o.text},c):e.jsx("span",{children:o.text},c))})}function ss(t,a){t.target===t.currentTarget&&(t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),a()))}async function ts(){return $("/api/knowledge/status")}async function ns(t){const a=new URLSearchParams;for(const o of t)a.append("key",o);return a.set("limit","200"),$(`/api/knowledge/search-primitives?${a.toString()}`)}async function X(t,a){const o=new URLSearchParams({q:t,limit:String(f.hitLimit)});if(a.sourceKinds.length>0)for(const h of a.sourceKinds)o.append("sourceKind",h);for(const h of a.harness)o.append("harness",h);for(const h of a.project)o.append("project",h);const c=Pe(a.timeWindow);return c!=null&&o.set("updatedAfterMs",String(c)),$(`/api/knowledge/search?${o.toString()}`)}async function je(t=!1){return $("/api/knowledge/sessions/index",{method:"POST",body:JSON.stringify({days:f.days,limit:f.sessionLimit,force:t})})}const as=Re;function D({active:t,onClick:a,count:o,label:c,ariaLabel:h}){return e.jsxs("button",{type:"button",className:`ks-chip${t?" ks-chip--active":""}`,onClick:a,"aria-pressed":t,"aria-label":h??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:g(o)}):null]})}function Se(t){return t&&t.split(/[\s_-]+/u).filter(a=>a.length>0).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function ye(t,a,o=6){return t?t.filter(c=>c.key===a&&c.value.length>0).sort((c,h)=>h.count-c.count||c.value.localeCompare(h.value)).slice(0,o):[]}function ge(t){return t.sourceKinds.length>0||t.harness.length>0||t.project.length>0||t.timeWindow!=="all"}function is(t){const a=[];return t.sourceKinds.length>0&&a.push(t.sourceKinds.map(o=>be[o]??o).join(" + ")),t.harness.length>0&&a.push(t.harness.map(Se).join(" + ")),t.project.length>0&&a.push(t.project.join(" + ")),t.timeWindow!=="all"&&a.push(ze(t.timeWindow)),a.length>0?`Filters: ${a.join(" · ")}`:""}function Bs({navigate:t,mode:a,hitId:o,routeFilters:c}){const{selectedKnowledgeHit:h,inspectKnowledgeHit:b,clearKnowledgeHit:w}=Ae(),V=l.useMemo(()=>c||(typeof window>"u"?de():Ie(window.location.search)),[c]),[S]=l.useState(()=>ke()),[K,F]=l.useState(S.status),[Y,Ne]=l.useState(S.facets),[i,O]=l.useState(V),[v,Z]=l.useState(()=>S.lastFilterKey&&S.lastFilterKey===xe(V)?S.results:[]),[P,ee]=l.useState(!1),[L,R]=l.useState(!1),[_,N]=l.useState(null),[we,H]=l.useState(S.status!==null),[se,te]=l.useState(S.facets!==null),A=l.useRef(i);A.current=i;const x=(K?.chunks??0)>0,M=K?.activeJobs[0]??null,C=l.useMemo(()=>Te(v),[v]),ne=L||!!M,q=i.query.trim(),z=De(i);l.useEffect(()=>{c&&O(s=>he(s,c)?s:c)},[c]);const k=l.useMemo(()=>{const s=[];for(const n of C)s.push(...n.moments);return s},[C]),E=l.useCallback((s,n)=>{Z(n.hits),F(n.status),T({results:n.hits,status:n.status,lastFilterKey:xe(s)});const d=(o?n.hits.find(u=>u.id===o):void 0)??n.hits[0];d?b(d,s.query,s):w()},[o,b,w]),U=l.useCallback(async s=>{const n=s.query.trim();if(!n){Z([]),w();return}ee(!0);try{N(null),E(s,await X(n,s))}catch(r){N(r instanceof Error?r.message:String(r))}finally{ee(!1)}},[E,w]),ae=l.useCallback(async(s=!1)=>{R(!0);try{N(null);const n=await je(s);F(n.status),H(!0),T({status:n.status,indexedAt:Date.now()});const r=A.current;n.status.chunks>0&&r.query.trim()&&E(r,await X(r.query.trim(),r))}catch(n){N(n instanceof Error?n.message:String(n))}finally{R(!1)}},[E]);l.useEffect(()=>{let s=!1;return(async()=>{let n=null;try{const u=await ts();if(s)return;n=u,F(u),H(!0),T({status:u}),N(null)}catch{}if(s)return;const{indexedAt:r}=ke();if(!(r!==null&&Date.now()-r<Ze&&(n?.chunks??0)>0)){R(!0);try{N(null);const u=await je(!1);if(s)return;F(u.status),H(!0),T({status:u.status,indexedAt:Date.now()});const m=A.current;u.status.chunks>0&&m.query.trim()&&E(m,await X(m.query.trim(),m))}catch(u){s||(N(u instanceof Error?u.message:String(u)),H(!0))}finally{s||R(!1)}}})(),()=>{s=!0}},[E]),l.useEffect(()=>{if(!x||se)return;let s=!1;return(async()=>{try{const n=await ns(["harness","project","sourceKind"]);s||(Ne(n),te(!0),T({facets:n}))}catch{s||te(!0)}})(),()=>{s=!0}},[x,se]),l.useEffect(()=>{if(!x)return;const s=window.setTimeout(()=>{U(i)},f.debounceMs);return()=>window.clearTimeout(s)},[i,x,U]);const ve=s=>{if(s.preventDefault(),!x&&!L){ae(!1);return}U(i)},y=l.useCallback(s=>{O(n=>{const r={...n,...s};return he(n,r)?n:(t({view:"search",...a?{mode:a}:{},filters:r},{replace:!0}),r)})},[a,t]),I=l.useCallback(()=>{const s=de();O(s),t({view:"search",...a?{mode:a}:{},filters:s},{replace:!0})},[a,t]),Ce=l.useCallback(()=>{k[0]&&b(k[0],A.current.query)},[k,b]);l.useEffect(()=>{function s(n){const r=n.target,d=r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable);if(n.key==="/"&&!d){n.preventDefault();const u=document.querySelector(".ks-search-input");u?.focus(),u?.select()}else if(n.key==="Escape"&&!d)k.length>0?w():I();else if(!d&&(n.key==="j"||n.key==="k")){if(k.length===0)return;n.preventDefault();const u=h?k.findIndex(B=>B.id===h.id):-1,m=n.key==="j"?Math.min(k.length-1,u+1):Math.max(0,u-1),W=k[m];W&&b(W,A.current.query)}}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[k,b,w,h,I]);const Ee=K?Le(K.generatedAt)||"just now":"—",Ke=ne?M?`Indexing ${g(M.progress.indexed??0)} of ${g(M.progress.discovered??0)}`:x?`Refreshing last ${f.days} days in the background`:`Building last ${f.days} days of sessions`:x?`${g(K?.chunks??0)} moments · last ${f.days} days · updated ${Ee}`:we?"No index yet":"Loading index",ie=ye(Y?.facets,"harness"),re=ye(Y?.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 ",f.days," days."]})]})}),e.jsxs("form",{className:"ks-search-form",onSubmit:ve,role:"search",children:[e.jsx(Ue,{size:17,strokeWidth:1.75,"aria-hidden":"true"}),e.jsx("input",{value:i.query,onChange:s=>y({query:s.target.value}),placeholder:"Search topics, files, decisions, agents…",className:"ks-search-input",spellCheck:!1,autoFocus:!0,"aria-label":"Search OpenScout knowledge"}),i.query?e.jsx("button",{type:"button",className:"ks-search-clear",onClick:()=>y({query:""}),"aria-label":"Clear search",children:e.jsx(Be,{size:14,"aria-hidden":"true"})}):e.jsx("span",{className:"ks-search-hint","aria-hidden":"true",children:"/"}),P?e.jsx(fe,{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(Ye,{size:12,"aria-hidden":"true"}),"Source"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Source kind filters",children:Fe.map(s=>e.jsx(D,{active:i.sourceKinds.includes(s),onClick:()=>y({sourceKinds:i.sourceKinds.includes(s)?i.sourceKinds.filter(n=>n!==s):[...i.sourceKinds,s]}),label:be[s]??s},s))})]}),ie.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Je,{size:12,"aria-hidden":"true"}),"Agent"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Harness filters",children:ie.map(s=>e.jsx(D,{active:i.harness.includes(s.value),onClick:()=>y({harness:i.harness.includes(s.value)?i.harness.filter(n=>n!==s.value):[...i.harness,s.value]}),label:Se(s.value),count:s.count},`harness:${s.value}`))})]}):null,re.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Xe,{size:12,"aria-hidden":"true"}),"Project"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Project filters",children:re.map(s=>e.jsx(D,{active:i.project.includes(s.value),onClick:()=>y({project:i.project.includes(s.value)?i.project.filter(n=>n!==s.value):[...i.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(Qe,{size:12,"aria-hidden":"true"}),"Time"]}),e.jsxs("div",{className:"ks-chip-row",role:"group","aria-label":"Time window filter",children:[e.jsx(D,{active:i.timeWindow==="all",onClick:()=>y({timeWindow:"all"}),label:"Any time"}),as.map(s=>e.jsx(D,{active:i.timeWindow===s.value,onClick:()=>y({timeWindow:s.value}),label:s.label},s.value))]}),ge(i)?e.jsx("button",{type:"button",className:"ks-clear-all",onClick:I,children:"Clear filters"}):null]})]}),_?e.jsx("section",{className:"ks-error",role:"alert",children:_}):null,!x&&!_?e.jsxs("div",{className:"ks-empty-state",children:[e.jsx("strong",{children:L?"Preparing your session index":"Preparing search"}),e.jsxs("span",{children:["First load builds the last ",f.days," days"," ","(up to ",g(f.sessionLimit)," sessions). You can keep this page open — results appear as soon as the index is ready."]})]}):null,x?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:P?"Searching…":q?`${g(C.length)} session${C.length===1?"":"s"}`:"Ready"}),q&&v.length>0?e.jsxs("span",{className:"ks-hit-list-meta",children:[g(v.length)," moment",v.length===1?"":"s",z?e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"ks-text-action",onClick:I,children:"Clear filters"})]}):null]}):null]}),q&&C.length===0&&!P?e.jsxs("div",{className:"ks-empty-hit",children:[e.jsxs("strong",{children:["No matches for “",q,"”"]}),e.jsxs("span",{children:["Try a project name, file path, or topic from recent work",z?", 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:()=>y({query:""}),children:"Clear query"}),z?e.jsx("button",{type:"button",className:"ks-text-action",onClick:I,children:"Clear all filters"}):null]})]}):null,q?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:Ce,disabled:v.length===0,children:"Pick the first result automatically"})]}),e.jsx("div",{className:"ks-hit-list-body",children:C.map((s,n)=>{const r=s.best,d=He(r),u=Me(r),m=me(pe(r)),W=()=>{m&&t({view:"sessions",sessionId:m})},B=s.moments.some(j=>h?.id===j.id);return e.jsxs("section",{className:`ks-session${B?" ks-session--selected":""}`,"aria-label":`Session ${n+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:m??d.session,children:["session ",d.session]}):null,e.jsxs("span",{className:"ks-session-count",children:[g(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:W,title:m?"Open session":void 0,children:u})]}),e.jsx("div",{className:"ks-session-moments",children:s.moments.map(j=>{const le=We(j,i.query),oe=h?.id===j.id,G=$e(j,i.query,200),ce=Oe(j),J=()=>b(j,i.query),ue=()=>{const p=me(pe(j))??m;if(!p){J();return}t({view:"sessions",sessionId:p})};return e.jsx("article",{className:`ks-hit${oe?" ks-hit--selected":""}`,role:"option","aria-selected":oe,tabIndex:0,onClick:J,onDoubleClick:ue,onKeyDown:p=>{if(p.key==="Enter"&&(p.metaKey||p.ctrlKey)){p.preventDefault(),ue();return}ss(p,J)},children:e.jsxs("div",{className:"ks-hit-body",children:[ce.length>0?e.jsx("div",{className:"ks-hit-details ks-hit-details--moment","aria-label":"Turn",children:ce.map(p=>e.jsx("span",{className:"ks-hit-details-strong",children:p},p))}):null,e.jsx("h3",{className:"ks-hit-title",children:le}),G&&G!==le?e.jsx("p",{className:"ks-hit-snippet",children:e.jsx(es,{text:G,query:i.query})}):null]})},j.id)})})]},s.collectionId)})})]}):null]}),e.jsxs("footer",{className:"ks-foot-status","aria-live":"polite",children:[e.jsxs("span",{className:"ks-foot-status-facts",children:[ne?e.jsx(fe,{size:12,className:"ks-spin","aria-hidden":"true"}):null,Ke,ge(i)?e.jsxs(e.Fragment,{children:[" · ",is(i)]}):null]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>{ae(!0)},disabled:L,children:L?"Updating…":"Update index"})]})]})}export{Bs as KnowledgeSearchScreen};
@@ -1 +0,0 @@
1
- import{r as f,j as e}from"./index-C1VaWNuD.js";import{S as L}from"./SlidePanel-CETQ5NTx.js";import{A as j}from"./AgentAvatar-Dz79iTxB.js";import{H as S}from"./HarnessMark-DttReffF.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as g,f as k,b as y}from"./lane-observe-vfyACHi0.js";import{S as A}from"./SessionObserve-BVeTkcIl.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-BB5DhFQm.js";import{b as T}from"./agent-lane-detail-ppJId6Jc.js";import{l as I,a as z}from"./agent-lanes-model-tc-1hE6q.js";import"./Provider-D0bB7q6y.js";import"./router-kfcaYqZr.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./api-Co9aQ2Jw.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-t7-XJP-h.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./openContent-C6XO6kr5.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./message-markup-DC0QFEZn.js";import"./ObservedTopologyPanel-CJVqIqQ2.js";import"./ObserveTextFlow-DCJ5EmD8.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./SessionObserveEvidence-BkOezTGV.js";import"./message-circle-joGFxfj1.js";import"./wrench-BfVeded5.js";import"./external-link-BvX5PfLh.js";import"./context-budget-DqxWzalx.js";const M={think:"Thought",tool:"Tool",ask:"Request",message:"Message",note:"Note",system:"System",boot:"Boot"};function Ge({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{Ge as LaneTraceDetailSheet};
@@ -1,3 +0,0 @@
1
- import{r as x,j as s}from"./index-C1VaWNuD.js";import{C as me}from"./chunk-T65CQEWV-H2QEKfr1.js";import{u as te,t as de,a as pe,b as ue}from"./mesh-view-store-CBM1za_N.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-D0bB7q6y.js";import{u as xe}from"./useAgentHoverCard-BgTLNcF-.js";import{b as ye}from"./mesh-buckets-CLYS8Jx8.js";import"./plus-BWKhylds.js";import"./createLucideIcon-Dv8H8m7J.js";import"./router-kfcaYqZr.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./api-Co9aQ2Jw.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./openContent-C6XO6kr5.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.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
- ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsx("span",{className:"mesh-sheet-path",children:D(e)}),s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]})]})]})}function $e({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"—",m=`${Z(e)} · ${ee(e)}`,d=e.agentClass?.trim();return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--spacious mesh-instance-sheet--${h}${c?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m}
3
- ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsx("span",{className:"mesh-sheet-line",children:s.jsx("span",{className:"mesh-sheet-path",children:D(e)})}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]}),d&&s.jsx("span",{className:"mesh-sheet-tag",children:d})]})]})}function Ee({layout:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h}){const{cluster:c,x:f,y:m,width:d,height:j,cols:v}=e,p=x.useMemo(()=>{const u={working:0,ready:0,notReady:0};for(const M of c.instances){const C=T(M.state);C==="in_turn"||C==="in_flight"?u.working+=1:C==="callable"?u.ready+=1:u.notReady+=1}return u},[c.instances]);return s.jsxs("div",{className:"mesh-cluster",style:{position:"absolute",left:f,top:m,width:d,height:j},children:[s.jsxs("div",{className:"mesh-cluster-header",style:{height:t.labelH},children:[s.jsx("span",{className:"mesh-cluster-name",children:c.label}),s.jsx("span",{className:"mesh-cluster-count",children:c.instances.length}),s.jsxs("span",{className:"mesh-cluster-states",children:[p.working>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--working",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.working]}),p.ready>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--available",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.ready]}),p.notReady>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--offline",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.notReady]})]})]}),c.instances.map((u,M)=>{const C=Me(M,v,t);return s.jsx("div",{style:{position:"absolute",left:C.x,top:C.y,width:t.instanceW,height:t.instanceH},children:t.density==="compact"?s.jsx(Ie,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):t.density==="spacious"?s.jsx($e,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):s.jsx(He,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id})},u.id)})]})}const U=34,re=22,Se=6,ne=28,ae=10,F=12,ie=380,Ae=240,J=38;function _e(e,t,n,i,h,c){const f=[],m=[],d=[];for(const r of e)i[r.machineId]?d.push(r):m.push(r);let j=0,v=ie;const p=(r,g)=>{const H=t.has(r.machineId)||!r.online,b=n.has(r.machineId);let I=0,N=0,A=0;for(const L of r.agents){const S=T(L.state);S==="in_turn"||S==="in_flight"?I+=1:S==="callable"?N+=1:A+=1}const G=r.online?I>0?"working":N>0?"available":"offline":"offline";if(H)return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:!1,ghost:!0,pinned:g,x:0,y:0,width:Ae,height:J,headerHeight:J,chromeHeight:J,layouts:[]};const Y=b?[]:be(r.agents),E=b?[]:Ce(Y,h,c),z=b?ke():0,O=b?oe+z*re+Se:0,X=U+O;let k=0,P=0;if(!b&&E.length>0){const L=Math.min(...E.map(o=>o.x)),S=Math.max(...E.map(o=>o.x+o.width)),_=Math.min(...E.map(o=>o.y)),q=Math.max(...E.map(o=>o.y+o.height));k=S-L,P=q-_;const K=-L+F,a=-_+X+ae;for(const o of E)o.x+=K,o.y+=a}const R=Math.max(ie,k+F*2),V=b?X:X+ae+P+F;return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:b,ghost:!1,pinned:g,x:0,y:0,width:R,height:V,headerHeight:U,chromeHeight:X,layouts:E}};for(const r of m){const g=p(r,!1);g.x=0,g.y=j,f.push(g),v=Math.max(v,g.width),j+=g.height+ne}const u=Math.max(0,j-ne),M=-v/2,C=-u/2;for(const r of f)r.ghost||(r.width=v),r.x=M,r.y+=C;for(const r of d){const g=p(r,!0),l=i[r.machineId];g.x=l.x,g.y=l.y,f.push(g)}return f}function Ye({section:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h,onHeaderPointerDown:c,onHeaderClick:f,onGhostActivate:m}){const d=e.reachability==="this"?"this node":e.reachability==="peer"?"peer":e.reachability==="tailnet"?"tailnet":"",j=e.online?e.agentCount===0?"idle":"standby":"unreachable";if(e.ghost)return s.jsx("div",{"data-machine-id":e.machineId,className:"mesh-machine-ghost",style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},title:`${e.machineLabel} · ${j} — click to show`,children:s.jsxs("button",{type:"button",className:"mesh-machine-ghost-body",onPointerDown:p=>c(p,e),onClick:()=>m(e.machineId),children:[s.jsx("span",{className:"mesh-machine-ghost-led","aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-ghost-name",children:e.machineLabel}),s.jsx("span",{className:"mesh-machine-ghost-stamp",children:j}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability} mesh-machine-chip--ghost`,children:d}),s.jsxs("span",{className:"mesh-machine-ghost-counts",children:[s.jsx("span",{className:"mesh-machine-count",children:e.agentCount}),e.workingCount>0&&s.jsxs("span",{className:"mesh-machine-count mesh-machine-count--working",children:[e.workingCount,"W"]})]})]})});const v=e.collapsed?Oe(e):[];return s.jsxs("div",{"data-machine-id":e.machineId,className:`mesh-machine-section${e.collapsed?" mesh-machine-section--collapsed":""}${e.pinned?" mesh-machine-section--pinned":""}`,style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},children:[s.jsxs("button",{type:"button",className:"mesh-machine-header",style:{height:e.headerHeight},onPointerDown:p=>c(p,e),onClick:()=>f(e.machineId),"aria-expanded":!e.collapsed,children:[s.jsx("span",{className:`mesh-machine-led mesh-machine-led--${e.dominantState}`,style:{color:B(e.dominantState)},"aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-caret","aria-hidden":!0,children:e.collapsed?"▸":"▾"}),s.jsx("span",{className:"mesh-machine-grip","aria-hidden":!0,children:"⠿"}),s.jsx("span",{className:"mesh-machine-name",children:e.machineLabel}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability}`,children:d})]}),e.collapsed&&s.jsxs("div",{className:"mesh-machine-spec",children:[s.jsxs("div",{className:"mesh-machine-state-strip",style:{height:oe},children:[s.jsxs("div",{className:"mesh-machine-state-cell mesh-machine-state-cell--working",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.workingCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"working"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.availableCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.agentCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"total"})]})]}),v.map(p=>s.jsxs("div",{className:"mesh-machine-spec-row",style:{height:re},children:[s.jsx("span",{className:"mesh-machine-spec-label",children:p.label}),s.jsx("span",{className:"mesh-machine-spec-value",title:p.value,children:p.value})]},p.label))]}),!e.collapsed&&e.layouts.map(p=>s.jsx(Ee,{layout:p,metrics:t,onAgentOpen:n,bindFor:i,activeId:h},p.cluster.key))]})}function Oe(e){const t=e.host;return[{label:"os",value:t?.os??"—"},{label:"arch",value:t?.arch??"—"},{label:"cpu",value:t?.cpuCores?`${t.cpuCores}c`:"—"},{label:"ram",value:t?.memoryGb?`${t.memoryGb} G`:"—"},{label:"disk",value:t?.storageCapacityGb?`${t.storageCapacityGb} G`:"—"},{label:"network",value:t?.network??"—"},{label:"scout",value:t?.scoutVersion?`v${t.scoutVersion}`:"—"}]}const Xe=7,oe=54;function ke(e,t,n,i){return Xe}function As({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{As as MeshCanvas};
@@ -1 +0,0 @@
1
- import{r as x,j as e}from"./index-C1VaWNuD.js";import{u as v,d as $,t as C,c as M,r as b}from"./mesh-view-store-CBM1za_N.js";import{u as w}from"./Provider-D0bB7q6y.js";import{b as I}from"./mesh-buckets-CLYS8Jx8.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 +0,0 @@
1
- import{r as m,j as e}from"./index-C1VaWNuD.js";import{a as D}from"./api-Co9aQ2Jw.js";import{t as A}from"./time-Dhsh_2EG.js";import{n as _,b as z,s as F,c as H}from"./colors-BtO5_zlx.js";import{u as O,a as K,i as U}from"./Provider-D0bB7q6y.js";import{b as V}from"./router-kfcaYqZr.js";import{MeshCanvas as Q}from"./MeshCanvas-DZv2ipsy.js";import{u as J}from"./useAgentHoverCard-BgTLNcF-.js";import{u as W}from"./local-agents-VP1-ZlPw.js";import{u as X,c as Y,s as Z,e as E,f as I,g as G,h as L}from"./mesh-view-store-CBM1za_N.js";import{u as ee}from"./useContentSecondaryNav-CoIoz7JU.js";import{OpsSubnav as se}from"./OpsSubnav-CjDTnp64.js";/* empty css *//* empty css */import"./perf-PX8Rx0EP.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./chunk-T65CQEWV-H2QEKfr1.js";import"./plus-BWKhylds.js";import"./mesh-buckets-CLYS8Jx8.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./openContent-C6XO6kr5.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./SecondaryNav-Cs0_FQdj.js";import"./secondaryNavConfig-C0Srrmy8.js";import"./message-square-BLiFqpe_.js";import"./compass-BdpImt_W.js";import"./settings-DQEtqkM9.js";import"./git-branch-Bc_eDIpG.js";import"./scroll-text-DFcBYy5J.js";/* empty css */function te(c){const p=new Map,f=new Map;for(const a of c){const o=a.project??"Unassigned",i=o.toLowerCase(),h=a.branch??"—";let r=p.get(i);r||(r=new Map,p.set(i,r));const u=r.get(h)??[];u.push(a),r.set(h,u);let s=f.get(i);s||(s=new Map,f.set(i,s)),s.set(o,(s.get(o)??0)+1)}const g=a=>{const o=f.get(a);if(!o)return a;let i=null,h=-1;for(const[r,u]of o)u>h&&(i=r,h=u);return i??a},j=[];for(const[a,o]of p){const i=g(a),h=[];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((d,x)=>(x.updatedAt??0)-(d.updatedAt??0)),v=t.reduce((d,x)=>Math.max(d,x.updatedAt??0),0);r=Math.max(r,v);for(const d of t)u[_(d.state)]+=1,s.push(d);h.push({branch:l,agents:t,latest:v})}h.sort((l,n)=>n.latest-l.latest),j.push({project:i,branches:h,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 ne({agents:c,emptyTitle:p="No agents registered",emptyBody:f="Agents connected to this broker will appear here.",selectMode:g="preview"}){const{navigate:j}=O(),a=m.useMemo(()=>te(c),[c]),[o,i]=m.useState(()=>new Set),h=m.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=J({agents:c,orderedIds:h,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:f})]});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 v=_(t.state),d=z(t.state),x=t.agentClass==="organic",y=r.getState(t.id),M=T(t.cwd)??T(t.projectRoot),k=t.harnessSessionId?t.harnessSessionId.slice(0,8):null,b=[];M&&b.push({kind:"cwd",text:M}),t.harness&&b.push({kind:"harness",text:t.harness}),t.model&&b.push({kind:"model",text:t.model}),k&&b.push({kind:"sess",text:`sess:${k}`});const $=r.bind(t.id);return e.jsxs("button",{type:"button",className:`mesh-tree-agent${x?" mesh-tree-agent--organic":""}${y.isActive?" mesh-tree-agent--active":""}${y.isPinned?" mesh-tree-agent--pinned":""}`,title:x?`${t.harness??t.name} · organic session`:void 0,...$,children:[e.jsx("span",{className:`mesh-tree-agent-dot mesh-tree-agent-dot--${d}`,style:{background:F(t.state)}}),e.jsx("span",{className:"mesh-tree-agent-name",children:t.handle??t.name}),x&&e.jsx("span",{className:"mesh-tree-agent-organic","aria-label":"organic session",children:"○"}),e.jsx("span",{className:"mesh-tree-agent-inline",children:b.map((C,R)=>e.jsxs("span",{className:`mesh-tree-agent-inline-part mesh-tree-agent-inline-part--${C.kind}`,children:[R>0&&e.jsx("span",{className:"mesh-tree-agent-inline-sep",children:"·"}),C.text]},C.kind))}),e.jsx("span",{className:`mesh-tree-agent-state mesh-tree-agent-state--${d}`,children:H(v)}),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:f,stateFilter:g,loading:j,refreshing:a,error:o,lastLoadedAt:i,hasMesh:h,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"})]})]}),h&&e.jsxs("div",{className:"mesh-hud-filters",children:[e.jsx("input",{type:"search",className:"mesh-hud-search",placeholder:"Filter agents…",value:f,onChange:u=>G(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&&h?`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 ds({navigate:c}){const[p,f]=m.useState(!0),[g,j]=m.useState(!1),[a,o]=m.useState(null),[i,h]=m.useState(null),{mode:r,density:u,query:s,stateFilter:l,meshSnapshot:n}=X(),{agents:t}=W(),{route:v}=O(),d=V(v),x=m.useMemo(()=>K(t),[t]),y=m.useMemo(()=>U(x,d,n?.localNode?.id),[x,d,n?.localNode?.id]),M=m.useRef(null),k=m.useRef(0);m.useEffect(()=>{M.current=n},[n]),m.useEffect(()=>{d&&Y(d,"node")},[d]);const b=m.useCallback(async(S="initial")=>{const N=++k.current;!(M.current!==null)&&S!=="background"?(f(!0),o(null)):j(!0);try{const w=await D("/api/mesh");if(N!==k.current)return;Z(w),o(null),h(Date.now())}catch(w){if(N!==k.current)return;o(w instanceof Error?w.message:String(w))}finally{N===k.current&&(f(!1),j(!1))}},[]);m.useEffect(()=>{b("initial")},[b]),m.useEffect(()=>{const S=setInterval(()=>{b("background")},1e4);return()=>clearInterval(S)},[b]);const $=m.useMemo(()=>{const S=s.trim().toLowerCase();return y.filter(N=>l!=="all"&&_(N.state)!==l?!1:S?`${N.name??""} ${N.handle??""} ${N.harness??""} ${N.project??""} ${N.branch??""}`.toLowerCase().includes(S):!0)},[s,y,l]),C={mode:r,density:u,query:s,stateFilter:l,loading:p,refreshing:g,error:a,lastLoadedAt:i,hasMesh:!!n,onRefresh:()=>{b("manual")}},R=r==="map"?e.jsxs("div",{className:"mesh-map-canvas",children:[n&&e.jsx(Q,{mesh:n,agents:$}),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:()=>{b("manual")},children:"Try again"})]}),e.jsx(P,{...C})]}):e.jsxs("div",{className:"mesh-tree-page",children:[e.jsx(P,{...C}),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:()=>{b("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(ne,{agents:$,emptyTitle:y.length===0?d?"No agents on this machine":"No agents registered":"No agents match your filter",emptyBody:y.length===0?"Agents connected to this broker will appear here.":"Try clearing the search or switching the state pill back to All."})]})]}),q=ee();return e.jsxs("div",{className:"s-ops",children:[q?e.jsx("div",{className:"s-ops-header",children:e.jsx(se,{activeRoute:v,navigate:c})}):null,e.jsx("div",{className:"s-ops-body",children:R})]})}export{ds as MeshScreen};
@@ -1 +0,0 @@
1
- import{j as e,r as a}from"./index-C1VaWNuD.js";import{i as w,a as C}from"./conversation-model-C2KuZUXc.js";import{u as S,m as M,j as b}from"./Provider-D0bB7q6y.js";import{u as A,f as E}from"./use-fleet-active-asks-CCGrll5q.js";import{b as L}from"./router-kfcaYqZr.js";import{l as B,i as R,s as D}from"./sessionRead-CvFz2RHv.js";import{u as F}from"./use-conversation-list-UG-tMN67.js";import{AgentMasterScreen as O}from"./AgentMasterScreen-DHrMuQ6_.js";import{ConversationScreen as P}from"./ConversationScreen-DIU7m_aC.js";import{P as V}from"./plus-BWKhylds.js";import"./createLucideIcon-Dv8H8m7J.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./AgentAvatar-Dz79iTxB.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";import"./agent-master-model-DMcHeNq3.js";import"./message-visibility-CGOmSSKs.js";/* empty css */import"./arrow-up-right-B09GPwFl.js";import"./ConversationComposer-BUIjWMBi.js";import"./zap-Bcja1lHG.js";import"./message-markup-DC0QFEZn.js";import"./mentions-BZ5SBMtc.js";import"./AgentDetailCard-8viaEY8b.js";import"./AgentLiveActions-DlSKL60c.js";import"./terminal-takeover-BMeBjBB2.js";import"./openContent-C6XO6kr5.js";import"./eye-C9cGk5z6.js";import"./terminal-UDy4lzV1.js";import"./operator-attention-RqieiSY8.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-Bt2RBj93.js";import"./BackToPicker-BHicJyfc.js";import"./AstronautSuit-CwB4Dw07.js";import"./ConversationFeedRows-Bx0gFyG_.js";import"./ConversationPanels-o6W-cOoU.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-CPoX8iV2.js";import"./proxy-DVDRhSRR.js";import"./activity-CzTJ-YMX.js";import"./message-circle-joGFxfj1.js";import"./tail-events-LK29oCKm.js";import"./ConversationStatus-CTYOywFh.js";import"./check-Dz2SRHft.js";import"./sparkles-D0vWLTyC.js";function us({conversationId:s,agentId:c,threadId:l,machineId:d,navigate:m}){return c?e.jsx(O,{agentId:c,threadId:l,machineId:d,navigate:m}):s?e.jsx(P,{conversationId:s,navigate:m,showBackNav:!1},s):e.jsx($,{})}function $(){const{onlineCount:s,apiConnection:c,reload:l,route:d,agents:m,openContextCapture:k,navigate:x}=S(),{sessions:v,loading:u,loadError:o}=F(),[f]=a.useState(()=>B()),h=A(),t=c.status==="offline",r=L(d),j=a.useRef(!1),N=a.useMemo(()=>{const p=M(m,r);return[...b(v,p,r)].sort((g,i)=>(i.lastMessageAt??0)-(g.lastMessageAt??0))},[v,m,r]),n=a.useMemo(()=>{const p=N.filter(i=>!w(i));return p.find(i=>E(h,i)?.status==="needs_attention"&&R(i.lastMessageAt,i.id,f))??p[0]},[N,h,f]);a.useEffect(()=>{j.current||u||o||t||n&&(j.current=!0,D(n.id),x({view:"messages",conversationId:n.id,...r?{machineId:r}:{}},{replace:!0}))},[n,u,o,t,r,x]);const y=!t&&!o&&(u||!!n);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(T,{}),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":y?"Opening your latest conversation":o?"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.":y?I(n):o||"Start a chat by choosing an agent and sending the first message."}),t||o?e.jsx("button",{type:"button",className:"s-conv-empty-action",onClick:()=>{l()},children:"Retry connection"}):y?null:e.jsxs("button",{type:"button",className:"s-conv-empty-new",onClick:()=>k(),children:[e.jsx(V,{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 I(s){return s?C(s):"Finding where you left off."}function T(){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{us as MessagesScreen};
@@ -1 +0,0 @@
1
- import{r as h,j as s}from"./index-C1VaWNuD.js";import{H as A}from"./HarnessMark-DttReffF.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-DqxWzalx.js";import{s as b}from"./page-status-BE0-J1xY.js";import{t as T}from"./time-Dhsh_2EG.js";import{b as y,a as B,l as O}from"./agent-lane-detail-ppJId6Jc.js";import{b as _}from"./agent-lane-preview-BhplDYGf.js";import{m as F}from"./mission-wall-CocIM1cF.js";import"./lane-observe-vfyACHi0.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-ask-display-B6iCAVcd.js";import"./mission-control-model-C0fByIjm.js";import"./colors-BtO5_zlx.js";const P=/^\[[a-z][a-z-]*\]$/i;function H(a,e){const l=w=>w.replace(/[…\s]+$/u,""),n=l(a),i=l(e);if(!n)return!0;const r=n.slice(0,Math.min(n.length,i.length));return i.startsWith(r)||n.startsWith(i)}function D(a,e){const l=a?.headline.trim();if(l&&!P.test(l)){const i=a?.detail?.trim(),r=a?.headFull??l;return i&&H(l,i)?{headline:i.length>l.length?i:l,full:r,detail:null}:{headline:l,full:r,detail:i??null}}const n=[...e?.events??[]].reverse().find(i=>i.kind==="tool");if(n){const i=n.arg?C(M(n.arg)).rest||n.arg:null,r=[n.tool,i].filter(Boolean).join(" · ").trim()||"Running tool";return{headline:r,full:r,detail:null}}return l?{headline:l,full:a?.headFull??l,detail:null}:null}const W=8,z=6,G={created:"+",modified:"~",read:"○"};function f(a,e=42){return a?a.length<=e?a:`…${a.slice(-(e-1))}`:"—"}function K(a){const e=a.replace(/\\/g,"/"),l=e.lastIndexOf("/");return l<0?{dir:"",base:e}:{dir:e.slice(0,l+1),base:e.slice(l+1)}}function ds({log:a,lane:e,onClose:l,onExpand:n,onTail:i,onOpenLog:r,onOpenFile:w}){const{agent:j,observe:o}=e,t=h.useMemo(()=>y(e),[e]),v=h.useMemo(()=>_(o,j,{isLive:a.live}),[o,j,a.live]),m=h.useMemo(()=>D(v,o),[v,o]),u=h.useMemo(()=>B(o,W),[o]),p=h.useMemo(()=>O(o,z),[o]),d=h.useMemo(()=>E(t.usage,{model:t.model,adapterType:t.harness}),[t.usage,t.model,t.harness]),N=F(a),g=[a.project,j.branch].filter(Boolean).join("/")||a.cwd||"—",L=u.filter(c=>c.state!=="read").length,$=[["MODEL",[t.harness,t.model].filter(Boolean).join("/")||"—",null],["BRANCH",t.branch??"—",null],["CWD",f(t.cwd),t.cwd],["SESSION",f(t.sessionId,30),t.sessionId],["LOG",f(a.logPath,30),a.logPath]];return s.jsxs("aside",{className:"s-wall-rail","aria-label":`${N} context`,children:[s.jsxs("div",{className:"s-wall-rail-head",children:[s.jsx("span",{className:`s-wall-rail-dot${a.live?" s-wall-rail-dot--live":""}`,"aria-hidden":"true"}),s.jsx(A,{harness:a.source,size:12,title:null}),s.jsxs("div",{className:"s-wall-rail-identity",children:[s.jsx("div",{className:"s-wall-rail-title",title:j.name,children:N}),s.jsxs("div",{className:"s-wall-rail-sub",title:a.cwd??g,children:[g," · ",a.lastActiveAt?T(a.lastActiveAt):"idle"]})]}),s.jsx("button",{type:"button",className:"s-wall-rail-close",onClick:l,"aria-label":"Close context (Esc)",title:"Close context (Esc)",children:"✕"})]}),s.jsxs("div",{className:"s-wall-rail-body",children:[s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:a.live?"executing now":"last action"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),m?s.jsxs("div",{className:"s-wall-rail-now",children:[s.jsx("div",{className:"s-wall-rail-headline",title:m.full,children:m.headline}),m.detail&&s.jsx("div",{className:"s-wall-rail-detail",title:m.detail,children:m.detail})]}):s.jsx("div",{className:"s-wall-rail-empty",children:"No interpreted trace yet — the pane is streaming raw output."}),s.jsxs("dl",{className:"s-wall-rail-stats",children:[s.jsx(x,{label:"events",value:t.events}),s.jsx(x,{label:"tools",value:t.tools}),s.jsx(x,{label:"edits",value:t.edits}),s.jsx(x,{label:"reads",value:t.reads}),s.jsx(x,{label:"files",value:t.files})]}),d&&s.jsxs("div",{className:`s-wall-rail-gauge${d.overLimit?" s-wall-rail-gauge--over":""}`,children:[s.jsxs("div",{className:"s-wall-rail-gauge-line",children:[s.jsx("span",{className:"s-wall-rail-gauge-label",children:"context"}),s.jsxs("span",{className:"s-wall-rail-gauge-value",children:[d.usedLabel,s.jsxs("span",{className:"s-wall-rail-gauge-of",children:[" / ",d.budgetLabel]})]}),s.jsxs("span",{className:"s-wall-rail-gauge-pct",children:[d.pct,"%",d.overLimit?" over":""]})]}),s.jsx("div",{className:"s-wall-rail-gauge-bar",role:"progressbar","aria-label":"Context budget","aria-valuenow":d.pct,"aria-valuemin":0,"aria-valuemax":Math.max(100,d.pct),children:s.jsx("span",{className:"s-wall-rail-gauge-fill",style:{width:`${S(d)}%`}})})]})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"runtime"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),s.jsx("dl",{className:"s-wall-rail-facts",children:$.map(([c,R,I])=>s.jsxs("div",{className:"s-wall-rail-fact",children:[s.jsx("dt",{className:"s-wall-rail-fact-label",children:c}),s.jsx("dd",{className:"s-wall-rail-fact-value",title:I??R,children:R})]},c))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"files"}),u.length>0&&s.jsxs("span",{className:"s-wall-rail-seccount",children:[L," changed · ",u.length-L," read"]}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),u.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No files touched in this window."}):s.jsx("div",{className:"s-wall-rail-files",children:u.map(c=>s.jsx(U,{file:c,onOpen:w},`${c.path}:${c.lastT}`))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"commands"}),p.length>0&&s.jsx("span",{className:"s-wall-rail-seccount",children:p.length}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),p.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No shell commands in this window."}):s.jsx("div",{className:"s-wall-rail-cmds",children:p.map(c=>s.jsx(q,{entry:c},c.id))})]})]}),s.jsxs("div",{className:"s-wall-rail-foot",children:[s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:n,...b({label:`Expand ${N}`}),children:"Expand"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:i,...b({label:`Tail · ${N}`,route:`/ops/tail?q=${encodeURIComponent(a.sessionId)}`}),children:"Tail ↗"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:r,...b({label:`Session · ${a.sessionId}`,route:`/sessions/${a.sessionId}`}),children:"Session ↗"}),s.jsxs("span",{className:"s-wall-rail-keys",children:[s.jsx("kbd",{children:"hjkl"})," move · ",s.jsx("kbd",{children:"esc"})," close"]})]})]})}function x({label:a,value:e}){return s.jsxs("div",{className:"s-wall-rail-stat",children:[s.jsx("dt",{className:"s-wall-rail-stat-label",children:a}),s.jsx("dd",{className:"s-wall-rail-stat-value",children:e>0?e.toLocaleString():"—"})]})}function U({file:a,onOpen:e}){const{dir:l,base:n}=K(a.path);return s.jsxs("button",{type:"button",className:"s-wall-rail-frow",title:a.path,onClick:()=>e(a.path),children:[s.jsx("span",{className:`s-wall-rail-fstate s-wall-rail-fstate--${a.state}`,"aria-hidden":"true",children:G[a.state]??"○"}),s.jsxs("span",{className:"s-wall-rail-fpath",children:[l&&s.jsx("span",{className:"s-wall-rail-fdir",children:l}),s.jsx("span",{className:"s-wall-rail-fbase",children:n})]})]})}function q({entry:a}){const{dir:e,rest:l}=C(M(a.command)),n=k(l||a.command);return s.jsxs("div",{className:"s-wall-rail-crow",title:a.command,children:[s.jsx("span",{className:"s-wall-rail-cmark","aria-hidden":"true",children:"❯"}),s.jsxs("span",{className:"s-wall-rail-ctext",children:[e&&s.jsxs("span",{className:"s-wall-rail-bash-dir",children:[e,"/"]}),n.map((i,r)=>s.jsxs("span",{className:`s-wall-rail-bash-${i.tier}${i.flag?" s-wall-rail-bash-flag":""}`,children:[r>0?" ":"",i.text]},r))]}),a.outcome&&s.jsx("span",{className:"s-wall-rail-cresult",children:a.outcome})]})}export{ds as MissionContextRail};
@@ -1 +0,0 @@
1
- import{r as n,j as a}from"./index-C1VaWNuD.js";/* empty css */import{a as K}from"./api-Co9aQ2Jw.js";import{u as Ae,f as Re,g as ge,t as U,h as b,e as ue}from"./mission-control-store-CM8mQGg8.js";import{u as be}from"./observe-BLmy4quB.js";import{h as me}from"./NewChatComposer-D2Ah4T-W.js";import{i as Ee,c as je}from"./keyboard-nav-B8sQ_8IF.js";import{g as Me}from"./tail-display-DcliDVkW.js";import{u as Le}from"./tail-events-LK29oCKm.js";import{u as Te}from"./Provider-D0bB7q6y.js";import{MissionContextRail as ke}from"./MissionContextRail-DnCWPzAM.js";import{FocusOverlay as Ne}from"./MissionFocusOverlay-K21ssTxv.js";import{MissionLogPane as Ce}from"./MissionLogPane-BLvSSIdT.js";import{o as Fe}from"./agent-lanes-model-tc-1hE6q.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"./perf-PX8Rx0EP.js";import"./colors-BtO5_zlx.js";import"./surface-activity-B1rgWB1i.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./time-Dhsh_2EG.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./lane-edit-display-C_Aujldz.js";import"./index-BWHgHrtv.js";import"./router-kfcaYqZr.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./sse-B29iGBnw.js";import"./scoutbot-D7kGGyK_.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./bash-format-BRV5C6Gv.js";import"./context-budget-DqxWzalx.js";import"./page-status-BE0-J1xY.js";import"./agent-lane-detail-ppJId6Jc.js";import"./lane-observe-vfyACHi0.js";import"./agent-lane-preview-BhplDYGf.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 is({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{is as MissionControlView};
@@ -1 +0,0 @@
1
- import{r as f,j as e}from"./index-C1VaWNuD.js";import{d as w,c as N,n as $}from"./colors-BtO5_zlx.js";import{u as C}from"./keyboard-nav-B8sQ_8IF.js";import{t as j}from"./time-Dhsh_2EG.js";import{M,f as S}from"./runtime-picker-C20lTGhV.js";import{s as v}from"./page-status-BE0-J1xY.js";import"./perf-PX8Rx0EP.js";import"./index-Cx6Gbr6n.js";import{K as k}from"./mission-control-model-C0fByIjm.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.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=S(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(M,{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 +0,0 @@
1
- import{j as o}from"./index-C1VaWNuD.js";import{c as j}from"./colors-BtO5_zlx.js";import{s as x}from"./page-status-BE0-J1xY.js";import{t as m}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-B88JVr62.js";import"./AgentAvatar-Dz79iTxB.js";import"./Provider-D0bB7q6y.js";import"./router-kfcaYqZr.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Bdt2W3Y4.js";import"./api-Co9aQ2Jw.js";import"./sse-B29iGBnw.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D7kGGyK_.js";import"./NewChatComposer-D2Ah4T-W.js";import"./runtime-picker-C20lTGhV.js";import"./scout-voice-Cg1qfepC.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DmUG_YC7.js";import"./createLucideIcon-Dv8H8m7J.js";import"./conversation-model-C2KuZUXc.js";import"./index-Cx6Gbr6n.js";import"./HarnessMark-DttReffF.js";import"./NewChatOrigin-DCn5cWPZ.js";import"./keyboard-nav-B8sQ_8IF.js";import"./x-DgmmnPKt.js";import"./chevron-down-D120PY4g.js";import"./search-FB2vVxCp.js";import"./file-text-BHro8MkG.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-D8iB6SMt.js";import"./TextDocumentSurface-2X1Gw4eA.js";import"./chevron-right-CowuvuE6.js";import"./code-xml-CkkNdRmu.js";import"./arrow-left-eToA6GxC.js";import"./arrow-right-DTX42clh.js";import"./chunk-HRAB3GC3-KjjrTLCU.js";import"./SpriteAvatar-DFO4Kb4Z.js";import"./CrewAvatar-CZ_faQ_s.js";function lt({agent:t,state:r,isExpanded:e,isSelected:s,tabIndex:p,onToggle:a,onReveal:n,onOpen:c}){const l=x({label:`Focus ${t.handle??t.name}`,route:`/ops/control · ${t.id}`}),d=o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"rr-spec-list",children:[o.jsx(i,{label:"MODEL",value:[t.harness,t.model].filter(Boolean).join("/")||"—"}),o.jsx(i,{label:"AT",value:[t.project,t.branch].filter(Boolean).join("/")||"—"}),o.jsx(i,{label:"STATE",value:j(r)}),o.jsx(i,{label:"ACTIVITY",value:t.activity}),o.jsx(i,{label:"SOURCE",value:t.source})]}),o.jsxs("div",{className:"ml-detail-actions",children:[o.jsx("button",{type:"button",className:"ml-detail-btn",onClick:n,children:"Reveal on wall"}),o.jsx("button",{type:"button",className:"ml-detail-btn ml-detail-btn--primary",onClick:c,children:"Open ↗"})]})]});return o.jsx(b,{name:t.handle??t.name,meta:t.lastActiveAt?m(t.lastActiveAt):t.updatedAt?m(t.updatedAt):void 0,tone:r,caret:e?"open":"closed",selected:s,expanded:e,detail:d,tabIndex:p,onClick:u=>a(u),onPointerEnter:l.onPointerEnter,onPointerLeave:l.onPointerLeave})}function i({label:t,value:r}){return o.jsxs("div",{className:"rr-spec",children:[o.jsx("dt",{className:"rr-spec-label",children:t}),o.jsx("dd",{className:"rr-spec-value",title:r,children:r})]})}export{lt as MissionLeftAgentRow};
@@ -1 +0,0 @@
1
- import{r as n,j as l}from"./index-C1VaWNuD.js";import{H as k}from"./HarnessMark-DttReffF.js";import{n as y}from"./colors-BtO5_zlx.js";import{s as P}from"./page-status-BE0-J1xY.js";import{c as T,b as I,T as A,d as C}from"./tail-display-DcliDVkW.js";import{d as E}from"./time-Dhsh_2EG.js";import{s as H}from"./mission-control-model-C0fByIjm.js";import{m as F,a as K}from"./mission-wall-CocIM1cF.js";import"./lane-edit-display-C_Aujldz.js";const R=24;function G({log:s,selected:f,revealed:h,cursor:t=!1,onOpen:c,onToggleSelected:w,onOpenLog:v,paneRef:j}){const i=n.useRef(null),m=n.useRef(!0),r=n.useMemo(()=>T(s.lines.map(e=>({event:e,meta:void 0}))).map(e=>({...e,outcome:e.event.kind==="tool-result"?I(e.event).result?.outcome??null:null})),[s.lines]),x=n.useCallback(()=>{const e=i.current;if(!e)return;const a=e.scrollHeight-e.scrollTop-e.clientHeight;m.current=a<=R},[]);n.useEffect(()=>{const e=i.current;!e||!m.current||(e.scrollTop=e.scrollHeight)},[r.length,s.lastActiveAt]);const N=y(s.agent?.state??null),o=F(s),b=K(s),p=[s.project,s.agent?.branch].filter(Boolean).join("/")||s.cwd||"—",d=P({label:`Focus ${o}`,route:`/ops/control · ${s.sessionId}`}),L=e=>{if(e.metaKey||e.ctrlKey||e.shiftKey){w();return}c()};return l.jsxs("div",{ref:j,className:["s-wall-pane",s.live?"s-wall-pane--live":null,f?"s-wall-pane--selected":null,h?"s-wall-pane--revealed":null,t?"s-wall-pane--cursor":null].filter(Boolean).join(" "),"data-cursor":t?!0:void 0,tabIndex:t?0:-1,onClick:L,onPointerEnter:d.onPointerEnter,onPointerLeave:d.onPointerLeave,children:[l.jsxs("div",{className:"s-wall-pane-head",children:[l.jsx("span",{className:"s-wall-pane-dot",style:{background:s.agent?H(N):"var(--dim)"},"aria-hidden":!0}),l.jsx(k,{harness:s.source,size:11,title:null}),l.jsx("button",{type:"button",className:"s-wall-pane-title",title:s.agent?.name??s.sessionId,"aria-label":`Focus ${o}`,onClick:e=>{e.stopPropagation(),c()},children:o}),l.jsx("span",{className:"s-wall-pane-where",title:s.cwd??p,children:p}),l.jsx("span",{className:"s-wall-pane-spacer"}),s.live&&l.jsx("span",{className:"s-wall-pane-live",children:"live"}),l.jsx("button",{type:"button",className:"s-wall-pane-file",title:s.logPath??`session ${s.sessionId}`,"aria-label":"Open raw tail",onClick:e=>{e.stopPropagation(),v()},children:b})]}),l.jsx("div",{className:"s-wall-pane-body",ref:i,onScroll:x,children:r.length===0?l.jsx("div",{className:"s-wall-pane-idle",children:"no output since page load"}):r.map(({event:e,repeatCount:a,outcome:u})=>l.jsxs("div",{className:["s-wall-line",`s-wall-line--${e.kind}`,u==="success"?"s-wall-line--result-ok":null,u==="error"?"s-wall-line--result-error":null].filter(Boolean).join(" "),children:[l.jsx("span",{className:"s-wall-line-time",children:E(e.ts,{milliseconds:!1})||"—"}),l.jsx("span",{className:"s-wall-line-glyph",title:C[e.kind],children:A[e.kind]}),l.jsxs("span",{className:"s-wall-line-text",children:[e.summary,a>1&&l.jsxs("span",{className:"s-wall-line-repeat",title:`${a} identical events`,children:[" ","×",a]})]})]},e.id))})]})}export{G as MissionLogPane};