@openscout/scout 0.2.98 → 0.2.102

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 (622) hide show
  1. package/NOTICE +7 -0
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-DCALiEXY.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-fXndbzXT.js → AddProjectForm-DfbjlFfy.js} +1 -1
  6. package/dist/client/assets/AdventureEvidence-Dzz9VbuE.js +5 -0
  7. package/dist/client/assets/AdventureReader-ClMxT0e4.js +4 -0
  8. package/dist/client/assets/AdventureScenery-D548O0x4.js +1 -0
  9. package/dist/client/assets/AgentAdventures-NwTKeF0F.js +1 -0
  10. package/dist/client/assets/AgentAvatar-BIwg54Tj.js +1 -0
  11. package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +1 -0
  12. package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +1 -0
  13. package/dist/client/assets/AgentDetailCard-CFDE8TLi.js +1 -0
  14. package/dist/client/assets/AgentFloorView-l2wNKFob.js +1 -0
  15. package/dist/client/assets/AgentFloorWorld-BDJmXl3C.js +1 -0
  16. package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +1 -0
  17. package/dist/client/assets/{AgentLaneCard-Cc9uyfBr.js → AgentLaneCard-C6YmwPxQ.js} +1 -1
  18. package/dist/client/assets/{AgentLaneChrome-Dv2lBFoH.js → AgentLaneChrome-D9uJ4QY7.js} +1 -1
  19. package/dist/client/assets/{AgentLaneDetailSheet-CGqtqSHQ.js → AgentLaneDetailSheet-KYckCBCX.js} +2 -2
  20. package/dist/client/assets/{AgentLaneSummaryResize-Di4u6df2.js → AgentLaneSummaryResize-BBYBS3DO.js} +1 -1
  21. package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +1 -0
  22. package/dist/client/assets/{AgentLanesPreflight-CCGBArIb.js → AgentLanesPreflight-pw2vMO3Q.js} +1 -1
  23. package/dist/client/assets/AgentLanesView-aAyC7lHf.js +2 -0
  24. package/dist/client/assets/AgentLiveActions-lYzicnNa.js +1 -0
  25. package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +1 -0
  26. package/dist/client/assets/AgentSessions-Cox2zS-e.js +6 -0
  27. package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +1 -0
  28. package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +1 -0
  29. package/dist/client/assets/AgentsSubnav-BOobgtGE.js +1 -0
  30. package/dist/client/assets/{AstronautSuit-CwB4Dw07.js → AstronautSuit-C-4I5YKi.js} +1 -1
  31. package/dist/client/assets/AtopView-DKm-ERYC.js +1 -0
  32. package/dist/client/assets/BackToPicker-Bys9ColC.js +1 -0
  33. package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +1 -0
  34. package/dist/client/assets/BriefingsScreen-D4Zf31Y6.js +1 -0
  35. package/dist/client/assets/{BrokerMetadataPanel-BJSwU9XZ.js → BrokerMetadataPanel-1GoSl2BV.js} +1 -1
  36. package/dist/client/assets/BrokerScreen-CejzhRsB.js +8 -0
  37. package/dist/client/assets/{CastPicker-CkgTalIt.js → CastPicker-BuwE_JQp.js} +1 -1
  38. package/dist/client/assets/CharacterFamilyPreview-BniL8sEL.css +1 -0
  39. package/dist/client/assets/CharacterFamilyPreview-CfO3j8Of.js +1 -0
  40. package/dist/client/assets/ChatCollapsedStrip-TV0j1xTB.js +1 -0
  41. package/dist/client/assets/{CodeDiffPane-DfluIWmO.js → CodeDiffPane-DB6-mqtX.js} +1 -1
  42. package/dist/client/assets/{CodeProjectPicker-By_Wz9ex.js → CodeProjectPicker-B_LNLpIK.js} +1 -1
  43. package/dist/client/assets/CodeScreen-C9H160XS.js +1 -0
  44. package/dist/client/assets/CommsCanvas-BR2YS76H.css +1 -0
  45. package/dist/client/assets/CommsCanvas-DOKw3Q8i.js +1 -0
  46. package/dist/client/assets/CommsDeck-C18JA7rK.js +1 -0
  47. package/dist/client/assets/CommsFlowGraph-Czg-KTS0.js +1 -0
  48. package/dist/client/assets/CommsFlowGraph-vQucylxF.css +1 -0
  49. package/dist/client/assets/CommsFlowMap-CzBWvSa5.js +1 -0
  50. package/dist/client/assets/CommsSelection-g1twA-Lb.js +1 -0
  51. package/dist/client/assets/{ConversationComposer-BUIjWMBi.js → ConversationComposer-B7RU6LKd.js} +1 -1
  52. package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +1 -0
  53. package/dist/client/assets/ConversationHeader-CCSU8uo_.js +1 -0
  54. package/dist/client/assets/ConversationPanels-C9yCAoJy.js +6 -0
  55. package/dist/client/assets/ConversationScreen-Brfas2y0.css +1 -0
  56. package/dist/client/assets/ConversationScreen-tTP6B_F-.js +2 -0
  57. package/dist/client/assets/ConversationStatus-CK-YfLpi.js +1 -0
  58. package/dist/client/assets/{CrewAvatar-CZ_faQ_s.js → CrewAvatar-CJhuqTsJ.js} +1 -1
  59. package/dist/client/assets/CrewSprite-DsQJdu3Z.css +1 -0
  60. package/dist/client/assets/CrewSprite-hgpA3SWB.js +1 -0
  61. package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +1 -0
  62. package/dist/client/assets/{DataTable-C6aMSilS.js → DataTable-BMOZ1-z8.js} +1 -1
  63. package/dist/client/assets/DispatchAftermath-DDlwqSCY.js +1 -0
  64. package/dist/client/assets/DocumentFocusViewer-f12RRQpV.js +1 -0
  65. package/dist/client/assets/{EmbeddableSurfacesLab-D3iZiS8o.js → EmbeddableSurfacesLab-DGl9EMRV.js} +1 -1
  66. package/dist/client/assets/{EmptyState-CKPWFSjq.js → EmptyState-uyYN5piI.js} +1 -1
  67. package/dist/client/assets/{FileViewerPane-CxNbcTYf.js → FileViewerPane-HtiDbj9N.js} +2 -2
  68. package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +1 -0
  69. package/dist/client/assets/FloorContextSheet-DV-SYA0K.js +1 -0
  70. package/dist/client/assets/FloorExchangePanel-B3TFhjLk.css +1 -0
  71. package/dist/client/assets/FloorExchangePanel-D59nvRCF.js +1 -0
  72. package/dist/client/assets/FloorMessagePasses-BCwsz9VS.js +1 -0
  73. package/dist/client/assets/FloorMessagePasses-nxwwiUom.css +1 -0
  74. package/dist/client/assets/FloorReplay-BHo79HCD.js +1 -0
  75. package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +1 -0
  76. package/dist/client/assets/FloorSavedWork-2tjBoy06.js +1 -0
  77. package/dist/client/assets/FloorTacticalHUD-Bngao6sn.js +1 -0
  78. package/dist/client/assets/FollowScreen-eHXOlK-u.js +1 -0
  79. package/dist/client/assets/{HarnessMark-DttReffF.js → HarnessMark-Bt47OeHy.js} +1 -1
  80. package/dist/client/assets/HarnessesScreen-M84sFjWY.js +1 -0
  81. package/dist/client/assets/{HerdrSession-DsuxCtfX.js → HerdrSession-CtJOUn7H.js} +3 -3
  82. package/dist/client/assets/{HomeHero-DXJo2QSO.js → HomeHero-Cvwx2H0w.js} +1 -1
  83. package/dist/client/assets/HostAdvisorView-CTJXIc1Q.js +1 -0
  84. package/dist/client/assets/KnowledgeSearchInspector-DwGMVmFL.js +1 -0
  85. package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +1 -0
  86. package/dist/client/assets/{LaneToolHoverCard-t7-XJP-h.js → LaneToolHoverCard-C6YehJqD.js} +1 -1
  87. package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +1 -0
  88. package/dist/client/assets/{LaneTraceEventFocus-BB5DhFQm.js → LaneTraceEventFocus-WLNZZVi_.js} +1 -1
  89. package/dist/client/assets/MeshCanvas-FDDGE69h.js +3 -0
  90. package/dist/client/assets/MeshCanvasMinimap-CGRzQCac.js +1 -0
  91. package/dist/client/assets/MeshScreen-DlfiMlaR.js +1 -0
  92. package/dist/client/assets/{MeshTopologyView-Dc0GSrKa.js → MeshTopologyView-C2Cv_2gx.js} +2 -2
  93. package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +1 -0
  94. package/dist/client/assets/MissionContextRail-CVSZJnvX.js +1 -0
  95. package/dist/client/assets/MissionControlView-DpGhxG4a.js +1 -0
  96. package/dist/client/assets/MissionFocusOverlay-B9SiuO-i.js +1 -0
  97. package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +1 -0
  98. package/dist/client/assets/MissionLogPane-CMBiI29U.js +1 -0
  99. package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +1 -0
  100. package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +1 -0
  101. package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +1 -0
  102. package/dist/client/assets/NewAgentModal-Cl4nsGhu.js +1 -0
  103. package/dist/client/assets/NewChatComposer-JjLbm3W2.js +19 -0
  104. package/dist/client/assets/{NewChatOrigin-DCn5cWPZ.js → NewChatOrigin-CyPPWTJP.js} +1 -1
  105. package/dist/client/assets/NodeDetailPanel-BUG8rOb-.js +1 -0
  106. package/dist/client/assets/NodeMenu-Fw8ATWQA.js +1 -0
  107. package/dist/client/assets/ObserveEmbedScreen-BPiSXXvm.js +2 -0
  108. package/dist/client/assets/{ObserveTextFlow-DCJ5EmD8.js → ObserveTextFlow-ET0dD1wO.js} +2 -2
  109. package/dist/client/assets/{ObservedTopologyPanel-CJVqIqQ2.js → ObservedTopologyPanel-DkEkQzo-.js} +1 -1
  110. package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +22 -0
  111. package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +1 -0
  112. package/dist/client/assets/OpsScreen-DJq-aBmX.js +1 -0
  113. package/dist/client/assets/OpsSubnav-9sURjajO.js +1 -0
  114. package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +1 -0
  115. package/dist/client/assets/{ProjectAgentProfileBar-CUzZ4Rpx.js → ProjectAgentProfileBar-C1fR65Eh.js} +1 -1
  116. package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +1 -0
  117. package/dist/client/assets/ProjectsInbox-Bs8I__my.js +2 -0
  118. package/dist/client/assets/ProjectsRail-Deb38OJ1.js +1 -0
  119. package/dist/client/assets/ProjectsScreen-CgLiYiss.js +1 -0
  120. package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +1 -0
  121. package/dist/client/assets/Provider-5Hotn7NQ.js +5 -0
  122. package/dist/client/assets/{RailRow-B0sRaJc6.css → RailRow-B25zKEub.css} +1 -1
  123. package/dist/client/assets/RailRow-BYguXNm4.js +1 -0
  124. package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +1 -0
  125. package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +1 -0
  126. package/dist/client/assets/RenderedWorkerSprite-CvdWO32C.js +1 -0
  127. package/dist/client/assets/RenderedWorkerSprite-qnTfkd_4.css +1 -0
  128. package/dist/client/assets/ReplayClock-B7JLTp8A.js +1 -0
  129. package/dist/client/assets/ReplayLog-DZTpf2CW.js +1 -0
  130. package/dist/client/assets/ReplayOutpost-CvWQa30T.js +1 -0
  131. package/dist/client/assets/ReplayOutpost-Y1DvZgeu.css +1 -0
  132. package/dist/client/assets/{RepoDiffEmbedScreen-mexrJPhW.js → RepoDiffEmbedScreen-Cbu0_PJW.js} +1 -1
  133. package/dist/client/assets/{RepoDiffPageScreen-DbqX4L3q.js → RepoDiffPageScreen-Chwm6GXL.js} +1 -1
  134. package/dist/client/assets/RepoDiffViewer-C2mb0Wj-.js +7 -0
  135. package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +2 -0
  136. package/dist/client/assets/{ReposScreen-CzbO1Fuy.js → ReposScreen-C7JZQmyh.js} +2 -2
  137. package/dist/client/assets/RiggedWorkerCharacter-BpYECnyK.css +1 -0
  138. package/dist/client/assets/RiggedWorkerCharacter-DNe731GE.js +1 -0
  139. package/dist/client/assets/SageModelStudio-768dRQr4.css +1 -0
  140. package/dist/client/assets/SageModelStudio-BR1J2D4R.js +4108 -0
  141. package/dist/client/assets/ScoutDeckSurface-flRamdvE.js +1 -0
  142. package/dist/client/assets/{ScoutSurface-NlhDsPzg.js → ScoutSurface-BpklGmDL.js} +1 -1
  143. package/dist/client/assets/{ScoutbotFxLab-l2WAahCg.js → ScoutbotFxLab-DeK7ySWZ.js} +1 -1
  144. package/dist/client/assets/{SecondaryNav-Cs0_FQdj.js → SecondaryNav-BkTn5tkq.js} +1 -1
  145. package/dist/client/assets/SessionEmbedScreen-CcQN6xlo.js +1 -0
  146. package/dist/client/assets/{SessionObserve-CLrHfAKZ.css → SessionObserve-BOBJSfs0.css} +1 -1
  147. package/dist/client/assets/SessionObserve-DaqDhqDI.js +12 -0
  148. package/dist/client/assets/SessionObserveEvidence-Drv-D8Oh.js +1 -0
  149. package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +1 -0
  150. package/dist/client/assets/SessionsScreen-R8QKvoey.js +1 -0
  151. package/dist/client/assets/SettingsDrawer-BDapR4E9.js +3 -0
  152. package/dist/client/assets/SettingsScreen-DirtO7Z0.js +1 -0
  153. package/dist/client/assets/SharedFloorCharacter-Bi5_md4R.css +1 -0
  154. package/dist/client/assets/SharedFloorCharacter-CSYG_t9t.js +1 -0
  155. package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +1 -0
  156. package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +2 -0
  157. package/dist/client/assets/{ShikiPane-C0TuCATU.js → ShikiPane-BudrOxNK.js} +1 -1
  158. package/dist/client/assets/{SlidePanel-CETQ5NTx.js → SlidePanel-Datu7XG4.js} +1 -1
  159. package/dist/client/assets/SpriteAvatar-BW1JzkDt.js +1 -0
  160. package/dist/client/assets/SproutActionSprite-DveCzg6l.js +1 -0
  161. package/dist/client/assets/{StatusPill-BllrY-eg.js → StatusPill-MxYClPG5.js} +1 -1
  162. package/dist/client/assets/{TailView-_gKWfaQM.js → TailView-Dn7uWmPz.js} +2 -2
  163. package/dist/client/assets/Terminal-D-DsQlmV.js +4 -0
  164. package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +1 -0
  165. package/dist/client/assets/TerminalHeaderMount-DCGstkZ4.js +1 -0
  166. package/dist/client/assets/{TextDocumentSurface-2X1Gw4eA.js → TextDocumentSurface-BhYvAB0o.js} +1 -1
  167. package/dist/client/assets/{TmuxPeek-CqTJRhkI.js → TmuxPeek-BhK0V9Qt.js} +1 -1
  168. package/dist/client/assets/{VoicePermissionsPanel-C4vkU-sU.js → VoicePermissionsPanel-CecFWzva.js} +1 -1
  169. package/dist/client/assets/{WorkDetailScreen-DqGnuK0e.js → WorkDetailScreen-CwtRCm_-.js} +4 -4
  170. package/dist/client/assets/WorkFilesViewer-DJHftsH9.js +1 -0
  171. package/dist/client/assets/WorkRunView-CxwAZ2QQ.css +1 -0
  172. package/dist/client/assets/WorkRunView-x5PH1byG.js +1 -0
  173. package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +1 -0
  174. package/dist/client/assets/WorldCharacter-Dn4sIXNP.js +1 -0
  175. package/dist/client/assets/WorldMinimap-Blqg0d5r.js +1 -0
  176. package/dist/client/assets/WorldSky-DV9bpvXj.js +1 -0
  177. package/dist/client/assets/{activity-CzTJ-YMX.js → activity-CSUhvjD0.js} +1 -1
  178. package/dist/client/assets/{addon-fit-Zx3A7pGS.js → addon-fit-MR98IWES.js} +1 -1
  179. package/dist/client/assets/{addon-webgl-DitJj-N0.js → addon-webgl-CIIKXrvK.js} +1 -1
  180. package/dist/client/assets/adventure-evidence-DgQbBmfa.css +1 -0
  181. package/dist/client/assets/adventure-habitats-v1-CVMbdB_Z.png +0 -0
  182. package/dist/client/assets/adventure-habitats-v1-M1lcpTJh.js +1 -0
  183. package/dist/client/assets/adventure-playback-DTfkhIc0.js +3 -0
  184. package/dist/client/assets/adventure-reader-DM5UDDm9.css +1 -0
  185. package/dist/client/assets/agent-adventures-DZtWpj6k.css +1 -0
  186. package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +10 -0
  187. package/dist/client/assets/{agent-essentials-K9B6kbTS.js → agent-essentials-8t2il7PV.js} +1 -1
  188. package/dist/client/assets/{agent-floor-CuJr1iK1.css → agent-floor-Dmr9hZHL.css} +1 -1
  189. package/dist/client/assets/agent-floor-actor-3v9drnxh.js +1 -0
  190. package/dist/client/assets/agent-floor-world-Bnd1AtwK.css +1 -0
  191. package/dist/client/assets/agent-floor-world-layout-hfMjuoui.js +1 -0
  192. package/dist/client/assets/agent-lane-card-model-l0stnU9N.js +1 -0
  193. package/dist/client/assets/{agent-lane-detail-ppJId6Jc.js → agent-lane-detail-Db7KyAlf.js} +1 -1
  194. package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-B8lsQJOQ.js} +1 -1
  195. package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-DmgipV9D.css} +1 -1
  196. package/dist/client/assets/agent-lanes-model-CX0wTcnF.js +4 -0
  197. package/dist/client/assets/agent-master-THmq-1k8.css +1 -0
  198. package/dist/client/assets/agent-master-model-C-KdOFDK.js +1 -0
  199. package/dist/client/assets/{agent-specialization-CtF_jI34.js → agent-specialization-CiVxQsFT.js} +1 -1
  200. package/dist/client/assets/agent-state-DDhnFEEP.js +1 -0
  201. package/dist/client/assets/{api-HFH8wFyb.js → api-B9_IqFKY.js} +1 -1
  202. package/dist/client/assets/api-CaROe5_H.js +1 -0
  203. package/dist/client/assets/{arc.es-BNXJqSw7.js → arc.es-BzhWalCl.js} +1 -1
  204. package/dist/client/assets/{arrow-down-BAGkhHA6.js → arrow-down-WoVlkUmg.js} +1 -1
  205. package/dist/client/assets/{arrow-left-eToA6GxC.js → arrow-left-PuKdO3NM.js} +1 -1
  206. package/dist/client/assets/{arrow-right-DTX42clh.js → arrow-right-ldbfp4SZ.js} +1 -1
  207. package/dist/client/assets/{arrow-up-right-B09GPwFl.js → arrow-up-right-Hn754ybA.js} +1 -1
  208. package/dist/client/assets/book-open-BlJnpf2U.js +1 -0
  209. package/dist/client/assets/{bot-WxKXYtEX.js → bot-CfN9PSBF.js} +1 -1
  210. package/dist/client/assets/broker-display-BkBzyvbR.js +2 -0
  211. package/dist/client/assets/{cache-CeWH_KzJ.js → cache-DEy9E34b.js} +1 -1
  212. package/dist/client/assets/{check-Dz2SRHft.js → check-B8dMv3Is.js} +1 -1
  213. package/dist/client/assets/{chevron-down-D120PY4g.js → chevron-down-B5eMsn5c.js} +1 -1
  214. package/dist/client/assets/{chevron-right-CowuvuE6.js → chevron-right-C7UGFpkl.js} +1 -1
  215. package/dist/client/assets/chevron-up-BHOEgHcn.js +1 -0
  216. package/dist/client/assets/{chunk-HRAB3GC3-KjjrTLCU.js → chunk-HRAB3GC3-C5X-kFhb.js} +1 -1
  217. package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +46 -0
  218. package/dist/client/assets/{chunk-T65CQEWV-H2QEKfr1.js → chunk-T65CQEWV-CSVUz2rY.js} +1 -1
  219. package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +2 -0
  220. package/dist/client/assets/{clock-_9FDplIT.js → clock-DFcRbtrl.js} +1 -1
  221. package/dist/client/assets/{code-xml-CkkNdRmu.js → code-xml-BmyLM0I2.js} +1 -1
  222. package/dist/client/assets/coffee-C_D9zooM.js +1 -0
  223. package/dist/client/assets/colors-CFlbwC25.js +1 -0
  224. package/dist/client/assets/comms-deck-C8nVeMBh.css +1 -0
  225. package/dist/client/assets/comms-deck-CBhsXnY-.js +2 -0
  226. package/dist/client/assets/comms-gesture-_aGFo6g3.js +2 -0
  227. package/dist/client/assets/{compass-BdpImt_W.js → compass-DTZdCpv9.js} +1 -1
  228. package/dist/client/assets/content-B5Q4pb9R.js +1 -0
  229. package/dist/client/assets/content-BK1IfOZs.js +1 -0
  230. package/dist/client/assets/content-BeEsWLEm.js +1 -0
  231. package/dist/client/assets/content-BkOwEknW.js +1 -0
  232. package/dist/client/assets/content-C32W5kAG.js +1 -0
  233. package/dist/client/assets/content-CoqyLs9v.js +1 -0
  234. package/dist/client/assets/content-CwpdIS5b.js +1 -0
  235. package/dist/client/assets/content-DS2OkJ3Q.js +1 -0
  236. package/dist/client/assets/content-DXKaPDfn.js +1 -0
  237. package/dist/client/assets/content-DZt5-dkI.js +1 -0
  238. package/dist/client/assets/content-DbQJH8L1.js +1 -0
  239. package/dist/client/assets/content-DetoiaHq.js +1 -0
  240. package/dist/client/assets/content-Dhu3wL7J.js +1 -0
  241. package/dist/client/assets/content-Dpv34iZu.js +1 -0
  242. package/dist/client/assets/content-TtQJb61D.js +1 -0
  243. package/dist/client/assets/content-ymNb2R7g.js +1 -0
  244. package/dist/client/assets/{context-budget-DqxWzalx.js → context-budget-DemtXu7E.js} +1 -1
  245. package/dist/client/assets/{conversation-icons-DHGc9wbT.js → conversation-icons-BQ4OeOmr.js} +1 -1
  246. package/dist/client/assets/conversation-model-BGFHoxQ0.js +1 -0
  247. package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +1 -0
  248. package/dist/client/assets/conversations-Cbg9h_Af.js +1 -0
  249. package/dist/client/assets/{copy-BzdzWsQd.js → copy-D9WUpQRf.js} +1 -1
  250. package/dist/client/assets/{cpu-CHFIGw87.js → cpu-Ck_4tB_-.js} +1 -1
  251. package/dist/client/assets/{createLucideIcon-Dv8H8m7J.js → createLucideIcon-DkjnzvcJ.js} +1 -1
  252. package/dist/client/assets/{credentials-BTce3VP1.js → credentials-C4VXz2hr.js} +1 -1
  253. package/dist/client/assets/discover-C8IOY7_K.js +2 -0
  254. package/dist/client/assets/embed-entry-CG3CfCbm.js +2 -0
  255. package/dist/client/assets/embed-navigation-DayfkQau.js +1 -0
  256. package/dist/client/assets/{external-link-BvX5PfLh.js → external-link-RT4Ph-6-.js} +1 -1
  257. package/dist/client/assets/{eye-C9cGk5z6.js → eye-CtqSV8BS.js} +1 -1
  258. package/dist/client/assets/{file-code-corner-jlGFdr8d.js → file-code-corner-D_Aptal2.js} +1 -1
  259. package/dist/client/assets/{file-text-BHro8MkG.js → file-text-ChtICwub.js} +1 -1
  260. package/dist/client/assets/flag-CqdOxVkI.js +1 -0
  261. package/dist/client/assets/floor-character-name-CqJPOlXb.js +1 -0
  262. package/dist/client/assets/floor-context-model-DZBpo_oD.js +1 -0
  263. package/dist/client/assets/floor-context-sheet-BFnkFiY3.css +1 -0
  264. package/dist/client/assets/floor-memory-YMM8AlLY.js +1 -0
  265. package/dist/client/assets/floor-message-passes-CJh9f8Jp.js +1 -0
  266. package/dist/client/assets/floor-preview-text-HrORUJ7D.js +1 -0
  267. package/dist/client/assets/floor-replay-CccYqE-f.css +1 -0
  268. package/dist/client/assets/floor-tactical-hud-HL5Vja5Y.css +1 -0
  269. package/dist/client/assets/folder-0fWevPvQ.js +1 -0
  270. package/dist/client/assets/{gauge-DSflSery.js → gauge-Dgtfxf_o.js} +1 -1
  271. package/dist/client/assets/{gestures-YA5IIwp-.js → gestures-BDCZ1FRG.js} +1 -1
  272. package/dist/client/assets/{git-branch-Bc_eDIpG.js → git-branch-CA3cHKCI.js} +1 -1
  273. package/dist/client/assets/go-shortcuts-DKtw4qYx.js +1 -0
  274. package/dist/client/assets/home-moving-signal-B7m-ngb2.js +1 -0
  275. package/dist/client/assets/home-now-card-DduXkHRR.js +1 -0
  276. package/dist/client/assets/{home-now-card-nano-Jmy7eJ6H.js → home-now-card-nano-D1ScGrgv.js} +1 -1
  277. package/dist/client/assets/hooks-C6VyQTQe.js +2 -0
  278. package/dist/client/assets/{hooks-D6NI15f6.css → hooks-D787lBmm.css} +1 -1
  279. package/dist/client/assets/index-C5cX8dkl.js +1 -0
  280. package/dist/client/assets/{index-C1VaWNuD.js → index-C8uS5szO.js} +5 -5
  281. package/dist/client/assets/index-Ck1__1yL.css +1 -0
  282. package/dist/client/assets/index-ClOOrVG1.js +1 -0
  283. package/dist/client/assets/index-Crtgfc9I.js +1 -0
  284. package/dist/client/assets/index-CvsM3jm8.js +1 -0
  285. package/dist/client/assets/{inspector-panel-CwrHjRaQ.js → inspector-panel-BLhDODb3.js} +2 -2
  286. package/dist/client/assets/{keyboard-nav-B8sQ_8IF.js → keyboard-nav-CXfav14z.js} +1 -1
  287. package/dist/client/assets/knowledge-search-BNdQweGz.css +1 -0
  288. package/dist/client/assets/{lane-edit-display-C_Aujldz.js → lane-edit-display-BjdT9oZl.js} +1 -1
  289. package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BD21P8BB.js} +2 -2
  290. package/dist/client/assets/lane-roster-store-DzNHP392.js +1 -0
  291. package/dist/client/assets/{lane-tool-detail-0WhMf4Vj.js → lane-tool-detail-Czggx8oM.js} +1 -1
  292. package/dist/client/assets/{layers-CW2-qHsG.js → layers-Bolb8ejU.js} +1 -1
  293. package/dist/client/assets/{layout-grid-BoVnPOk-.js → layout-grid-DI9tVJ2E.js} +1 -1
  294. package/dist/client/assets/left-B-_z_nqj.js +2 -0
  295. package/dist/client/assets/left-B1LY7rJc.js +1 -0
  296. package/dist/client/assets/{left-DH44V4I_.css → left-BV9yMiTL.css} +1 -1
  297. package/dist/client/assets/left-C6bdjWcG.js +2 -0
  298. package/dist/client/assets/left-CF4iuqlz.js +1 -0
  299. package/dist/client/assets/left-DLtNyZl1.js +1 -0
  300. package/dist/client/assets/left-Fpxoq-VY.js +1 -0
  301. package/dist/client/assets/left-N2wXfTlp.js +1 -0
  302. package/dist/client/assets/left-advisor-CeIjCKbd.js +1 -0
  303. package/dist/client/assets/left-agents-upjHVlOj.js +1 -0
  304. package/dist/client/assets/left-default-08gmdCtb.js +1 -0
  305. package/dist/client/assets/left-lanes-Cvsp73Hw.js +1 -0
  306. package/dist/client/assets/left-mission-DENnfshd.css +1 -0
  307. package/dist/client/assets/left-mission-W1LLaz74.js +1 -0
  308. package/dist/client/assets/library-DLKBVUJ6.js +1 -0
  309. package/dist/client/assets/{loader-circle-DmUG_YC7.js → loader-circle-DurUYl7E.js} +1 -1
  310. package/dist/client/assets/{local-agents-VP1-ZlPw.js → local-agents-D9fYYRyj.js} +1 -1
  311. package/dist/client/assets/machine-children-RGS4Q0r6.js +1 -0
  312. package/dist/client/assets/machine-scope-DJt9RZ2w.js +1 -0
  313. package/dist/client/assets/mentions-Ctw1ECUC.js +1 -0
  314. package/dist/client/assets/{mesh-ops-CKSWgax2.js → mesh-ops-CGpRk4ik.js} +1 -1
  315. package/dist/client/assets/{mesh-screen-D1Yvo8fU.css → mesh-screen-DjA4mOaN.css} +1 -1
  316. package/dist/client/assets/mesh-view-store-CliSYsmt.js +1 -0
  317. package/dist/client/assets/{message-circle-joGFxfj1.js → message-circle-CSiJj6yo.js} +1 -1
  318. package/dist/client/assets/{message-markup-DC0QFEZn.js → message-markup-DgFSyb3f.js} +1 -1
  319. package/dist/client/assets/{message-square-BLiFqpe_.js → message-square-NmXWtWLR.js} +1 -1
  320. package/dist/client/assets/{message-visibility-CGOmSSKs.js → message-visibility-DwxgcgYK.js} +1 -1
  321. package/dist/client/assets/mission-control-CsX3Yc58.css +1 -0
  322. package/dist/client/assets/mission-control-model-C30vU1Fe.js +1 -0
  323. package/dist/client/assets/mission-control-store-DZ29Mlj1.js +1 -0
  324. package/dist/client/assets/{mission-wall-CocIM1cF.js → mission-wall-DOuGOxQy.js} +1 -1
  325. package/dist/client/assets/nav-destinations-CyXnw9kh.js +1 -0
  326. package/dist/client/assets/observe-CkfOxYx_.js +1 -0
  327. package/dist/client/assets/{operator-attention-RqieiSY8.js → operator-attention-DGR4kOog.js} +1 -1
  328. package/dist/client/assets/ops-screen-CxYM0VOW.css +1 -0
  329. package/dist/client/assets/page-status-CkS3SZu-.js +1 -0
  330. package/dist/client/assets/panel-right-BNTJhy8M.js +1 -0
  331. package/dist/client/assets/pause-DWS7YGQ3.js +1 -0
  332. package/dist/client/assets/{persistent-state-BubPQ7tT.js → persistent-state-xsuk6Kc-.js} +1 -1
  333. package/dist/client/assets/pin-DWlD1BOF.js +1 -0
  334. package/dist/client/assets/pip-idle-v1-Tt-CZsRG.png +0 -0
  335. package/dist/client/assets/pip-thinking-v1-BoHWSEye.png +0 -0
  336. package/dist/client/assets/pip-waiting-v1-DkuvJ-dN.png +0 -0
  337. package/dist/client/assets/pip-working-v1-wWQLRS1z.png +0 -0
  338. package/dist/client/assets/play-D_Pggug4.js +1 -0
  339. package/dist/client/assets/{plus-BWKhylds.js → plus-D_wLGJGT.js} +1 -1
  340. package/dist/client/assets/profile-C3KgiZvc.js +1 -0
  341. package/dist/client/assets/{projects-inbox-DFbgVlXL.js → projects-inbox-DvbqJO3q.js} +1 -1
  342. package/dist/client/assets/{proxy-DVDRhSRR.js → proxy-DOG46ja4.js} +1 -1
  343. package/dist/client/assets/{radio-CxIXS1nU.js → radio-C_jtwbFP.js} +1 -1
  344. package/dist/client/assets/{refresh-cw-Bkh7Cvnd.js → refresh-cw-Da9DDLk2.js} +1 -1
  345. package/dist/client/assets/resolve-panes-DuowGRTk.js +1 -0
  346. package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +1 -0
  347. package/dist/client/assets/right-B9OUA6Ho.js +1 -0
  348. package/dist/client/assets/right-BDQnjetX.js +1 -0
  349. package/dist/client/assets/{right-DVUq5374.js → right-BLJsc2-p.js} +2 -2
  350. package/dist/client/assets/right-BUbKHmRH.js +1 -0
  351. package/dist/client/assets/right-Ci2IcD4s.js +1 -0
  352. package/dist/client/assets/right-CmCce3e5.js +1 -0
  353. package/dist/client/assets/right-D7w0zM5a.js +1 -0
  354. package/dist/client/assets/right-DIoON_bv.js +1 -0
  355. package/dist/client/assets/right-E0Jr3VN5.js +1 -0
  356. package/dist/client/assets/right-lCdAk9dW.js +1 -0
  357. package/dist/client/assets/{rocket-CnxqjX_K.js → rocket-DyrYDo8V.js} +1 -1
  358. package/dist/client/assets/router-BKiMcYa7.js +1 -0
  359. package/dist/client/assets/{runtime-picker-BYAFNLNq.css → runtime-picker-C3JwrDKP.css} +1 -1
  360. package/dist/client/assets/runtime-picker-DdsttHHc.js +1 -0
  361. package/dist/client/assets/{scope-views-KPY85UUx.js → scope-views-B7PZGlhY.js} +1 -1
  362. package/dist/client/assets/scout-voice-DOQ_B77g.js +1 -0
  363. package/dist/client/assets/{scoutbot-D7kGGyK_.js → scoutbot-Bk3nyrkj.js} +2 -2
  364. package/dist/client/assets/{scoutbot-markdown-yb87JlSE.js → scoutbot-markdown-Bz0Vbto2.js} +1 -1
  365. package/dist/client/assets/{scroll-text-DFcBYy5J.js → scroll-text-DwC8r2g6.js} +1 -1
  366. package/dist/client/assets/{search-FB2vVxCp.js → search-C4VlW_0l.js} +1 -1
  367. package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +1 -0
  368. package/dist/client/assets/{selection-bridge-qBGFCJv8.js → selection-bridge-B5jqyMR9.js} +1 -1
  369. package/dist/client/assets/{send-horizontal-CS7mxVhX.js → send-horizontal-pOtGI7FM.js} +1 -1
  370. package/dist/client/assets/send-to-agent-session-BZGq_ycy.js +1 -0
  371. package/dist/client/assets/{server-WY6gsbZz.js → server-ms1yxUYJ.js} +1 -1
  372. package/dist/client/assets/{session-catalog-CG4oL_yN.js → session-catalog-s-T_w41t.js} +1 -1
  373. package/dist/client/assets/{session-table-uJh3v-ly.js → session-table-CDx_16xf.js} +1 -1
  374. package/dist/client/assets/sessions-view-DzYGsKWS.js +1 -0
  375. package/dist/client/assets/{settings-DQEtqkM9.js → settings-TJIkkZ0P.js} +1 -1
  376. package/dist/client/assets/shared-work-artifacts-4IIQXQfc.js +1 -0
  377. package/dist/client/assets/{sliders-horizontal-57e99_qO.js → sliders-horizontal-CHf3ntw0.js} +1 -1
  378. package/dist/client/assets/solar-system-scope-2k-stars-points-1FwHnkj0.png +0 -0
  379. package/dist/client/assets/{sparkles-D0vWLTyC.js → sparkles-BbOFw3d0.js} +1 -1
  380. package/dist/client/assets/sprout-action-sprite-DZ8C0fTl.css +1 -0
  381. package/dist/client/assets/sprout-actions-proof-v1-BzUdc812.png +0 -0
  382. package/dist/client/assets/{sse-B29iGBnw.js → sse-v5QLsOHV.js} +1 -1
  383. package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +1 -0
  384. package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-DHSNmvor.js} +2 -2
  385. package/dist/client/assets/{tail-events-LK29oCKm.js → tail-events-DQ46QBW1.js} +1 -1
  386. package/dist/client/assets/{terminal-UDy4lzV1.js → terminal-96JWDYDL.js} +1 -1
  387. package/dist/client/assets/{terminal-relay-CXHMdain.js → terminal-relay-Bfx8pg80.js} +1 -1
  388. package/dist/client/assets/terminal-screen-Bpb2SZrn.css +1 -0
  389. package/dist/client/assets/{terminal-sessions-Bdt2W3Y4.js → terminal-sessions-Ch9aYlgi.js} +1 -1
  390. package/dist/client/assets/{terminal-takeover-BMeBjBB2.js → terminal-takeover-BlpxpvSp.js} +1 -1
  391. package/dist/client/assets/use-beside-Df-F2Uvg.js +1 -0
  392. package/dist/client/assets/use-conversation-list-A_YUf8lo.js +1 -0
  393. package/dist/client/assets/{use-fleet-active-asks-CCGrll5q.js → use-fleet-active-asks-DFs_u-vM.js} +1 -1
  394. package/dist/client/assets/use-mesh-node-state-Ck9CYplv.js +1 -0
  395. package/dist/client/assets/{use-mesh-ops-items-BjyeFJTz.js → use-mesh-ops-items-Be1WmwCg.js} +1 -1
  396. package/dist/client/assets/{use-reduced-motion-CPoX8iV2.js → use-reduced-motion-D7n3vK8t.js} +1 -1
  397. package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +1 -0
  398. package/dist/client/assets/{useAgentHoverCard-BgTLNcF-.js → useAgentHoverCard-Dr-OjNFF.js} +1 -1
  399. package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +1 -0
  400. package/dist/client/assets/{useEmbedHeadline-DuUnwTB7.js → useEmbedHeadline-BL8wQawZ.js} +1 -1
  401. package/dist/client/assets/{usePierreRuntime-35AHf9RQ.js → usePierreRuntime-DJkRHMoe.js} +1 -1
  402. package/dist/client/assets/worker-rendered-v1-DmGVMlVi.png +0 -0
  403. package/dist/client/assets/worker-thinking-v1-ujakpzrK.png +0 -0
  404. package/dist/client/assets/worker-waiting-v1-DbTSsfJJ.png +0 -0
  405. package/dist/client/assets/worker-working-v1-BROAvJ_z.png +0 -0
  406. package/dist/client/assets/world-outposts-v1-DOt0i98W.png +0 -0
  407. package/dist/client/assets/{wrench-BfVeded5.js → wrench-BsMTSeji.js} +1 -1
  408. package/dist/client/assets/{x-DgmmnPKt.js → x-DI1ktCYb.js} +1 -1
  409. package/dist/client/assets/{xterm-DnJJmrCA.js → xterm-B1YBE4Gq.js} +1 -1
  410. package/dist/client/assets/{zap-Bcja1lHG.js → zap-sKPkh4sQ.js} +1 -1
  411. package/dist/client/characters/sage/sage.glb +0 -0
  412. package/dist/client/crew/brik-bust.webp +0 -0
  413. package/dist/client/crew/brik-chip-id.webp +0 -0
  414. package/dist/client/crew/fenn-bust.webp +0 -0
  415. package/dist/client/crew/fenn-chip-id.webp +0 -0
  416. package/dist/client/crew/lulu-bust.webp +0 -0
  417. package/dist/client/crew/milo-bust.webp +0 -0
  418. package/dist/client/crew/milo-chip-id.webp +0 -0
  419. package/dist/client/crew/nori-bust.webp +0 -0
  420. package/dist/client/crew/pip-bust.webp +0 -0
  421. package/dist/client/crew/pip-chip-id.webp +0 -0
  422. package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
  423. package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
  424. package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
  425. package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
  426. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  427. package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
  428. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  429. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  430. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  431. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  432. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  433. package/dist/client/crew/sprout-bust.webp +0 -0
  434. package/dist/client/crew/sprout-chip-id.webp +0 -0
  435. package/dist/client/crew/tuck-bust.webp +0 -0
  436. package/dist/client/crew/tuck-chip-id.webp +0 -0
  437. package/dist/client/crew/vex-bust.webp +0 -0
  438. package/dist/client/crew/vex-chip-id.webp +0 -0
  439. package/dist/client/crew/wrench-bust.webp +0 -0
  440. package/dist/client/crew/wrench-chip-id.webp +0 -0
  441. package/dist/client/index.html +2 -2
  442. package/dist/drizzle/0017_wise_silver_sable.sql +26 -0
  443. package/dist/drizzle/0018_message_epoch_order.sql +1 -0
  444. package/dist/drizzle/meta/0017_snapshot.json +6785 -0
  445. package/dist/drizzle/meta/0018_snapshot.json +6804 -0
  446. package/dist/drizzle/meta/_journal.json +14 -0
  447. package/dist/main.mjs +26906 -24284
  448. package/dist/node/main.mjs +7077 -6284
  449. package/dist/openscout-terminal-relay.mjs +391 -9
  450. package/dist/pairing-runtime-controller.mjs +35541 -34446
  451. package/dist/runtime/base-daemon.mjs +31 -8
  452. package/dist/runtime/broker-daemon.mjs +7864 -2578
  453. package/dist/runtime/broker-process-manager.mjs +15 -3
  454. package/dist/runtime/mesh-discover.mjs +14 -3
  455. package/dist/scout-control-plane-web.mjs +37053 -33186
  456. package/dist/statusline.mjs +1021 -35
  457. package/dist/update-helper.mjs +32169 -0
  458. package/package.json +2 -2
  459. package/dist/client/assets/ActivityScreen-sfonf5SR.js +0 -1
  460. package/dist/client/assets/AgentAvatar-Dz79iTxB.js +0 -1
  461. package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +0 -1
  462. package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +0 -1
  463. package/dist/client/assets/AgentDetailCard-8viaEY8b.js +0 -1
  464. package/dist/client/assets/AgentFloorView-DuyvyMMj.js +0 -1
  465. package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +0 -1
  466. package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +0 -1
  467. package/dist/client/assets/AgentLanesView-96lHsoX7.js +0 -2
  468. package/dist/client/assets/AgentLiveActions-DlSKL60c.js +0 -1
  469. package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +0 -1
  470. package/dist/client/assets/AgentSessions-DV9v34aq.js +0 -6
  471. package/dist/client/assets/AgentsConsole-DTpVhS67.js +0 -1
  472. package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +0 -1
  473. package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +0 -1
  474. package/dist/client/assets/AtopView-D7vyQDtE.js +0 -1
  475. package/dist/client/assets/BackToPicker-BHicJyfc.js +0 -1
  476. package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +0 -1
  477. package/dist/client/assets/BriefingsScreen-Cn4Mbam9.js +0 -1
  478. package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +0 -5
  479. package/dist/client/assets/ChatCollapsedStrip-7Wrg8Ge0.js +0 -1
  480. package/dist/client/assets/CodeScreen-cLC0tJ4S.js +0 -1
  481. package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +0 -1
  482. package/dist/client/assets/ConversationHeader-Bt2RBj93.js +0 -1
  483. package/dist/client/assets/ConversationPanels-o6W-cOoU.js +0 -6
  484. package/dist/client/assets/ConversationScreen-CkWnKXt6.css +0 -1
  485. package/dist/client/assets/ConversationScreen-DIU7m_aC.js +0 -2
  486. package/dist/client/assets/ConversationStatus-CTYOywFh.js +0 -1
  487. package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +0 -1
  488. package/dist/client/assets/DispatchAftermath-ZCEB75hh.js +0 -1
  489. package/dist/client/assets/DocumentFocusViewer-D8iB6SMt.js +0 -1
  490. package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +0 -1
  491. package/dist/client/assets/FollowScreen-CkR-okdL.js +0 -1
  492. package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +0 -1
  493. package/dist/client/assets/HostAdvisorView-DeJ-8RZV.js +0 -1
  494. package/dist/client/assets/KnowledgeSearchInspector-W_zNIBRV.js +0 -1
  495. package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +0 -1
  496. package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +0 -1
  497. package/dist/client/assets/MeshCanvas-DZv2ipsy.js +0 -3
  498. package/dist/client/assets/MeshCanvasMinimap-BXHRNb7l.js +0 -1
  499. package/dist/client/assets/MeshScreen-DuNvpDC5.js +0 -1
  500. package/dist/client/assets/MessagesScreen-dNNPFwAc.js +0 -1
  501. package/dist/client/assets/MissionContextRail-DnCWPzAM.js +0 -1
  502. package/dist/client/assets/MissionControlView-DmaThhNR.js +0 -1
  503. package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +0 -1
  504. package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +0 -1
  505. package/dist/client/assets/MissionLogPane-BLvSSIdT.js +0 -1
  506. package/dist/client/assets/NewAgentModal-B7qxjZlW.js +0 -1
  507. package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +0 -19
  508. package/dist/client/assets/ObserveEmbedScreen-DvKGsaLv.js +0 -2
  509. package/dist/client/assets/OpenScoutAppShell-C9TOLB7u.js +0 -79
  510. package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +0 -1
  511. package/dist/client/assets/OpsScreen-CJBwshEp.js +0 -1
  512. package/dist/client/assets/OpsSubnav-CjDTnp64.js +0 -1
  513. package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +0 -1
  514. package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +0 -1
  515. package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +0 -2
  516. package/dist/client/assets/ProjectsRail-kMDA0yn4.js +0 -1
  517. package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +0 -1
  518. package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +0 -1
  519. package/dist/client/assets/Provider-D0bB7q6y.js +0 -1
  520. package/dist/client/assets/RailRow-B88JVr62.js +0 -1
  521. package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +0 -1
  522. package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +0 -1
  523. package/dist/client/assets/RepoDiffViewer-Bw5yMC4A.js +0 -7
  524. package/dist/client/assets/RepoDiffViewerLazy-DzfoFhbl.js +0 -2
  525. package/dist/client/assets/ScoutDeckSurface-DQoZofzH.js +0 -1
  526. package/dist/client/assets/SessionEmbedScreen-CpduQ0O9.js +0 -1
  527. package/dist/client/assets/SessionObserve-BVeTkcIl.js +0 -12
  528. package/dist/client/assets/SessionObserveEvidence-BkOezTGV.js +0 -1
  529. package/dist/client/assets/SessionRefScreen-DetLMkTT.js +0 -1
  530. package/dist/client/assets/SessionsScreen-B-McKw6d.js +0 -1
  531. package/dist/client/assets/SettingsDrawer-CPB32w0n.js +0 -3
  532. package/dist/client/assets/SettingsScreen-BEzYFdjz.js +0 -1
  533. package/dist/client/assets/SpriteAvatar-DFO4Kb4Z.js +0 -1
  534. package/dist/client/assets/Terminal-DWyZTZdY.js +0 -1
  535. package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +0 -1
  536. package/dist/client/assets/TerminalHeaderMount-CY7uIWBg.js +0 -1
  537. package/dist/client/assets/WorkFilesViewer-D8-4vF5l.js +0 -1
  538. package/dist/client/assets/agent-autocomplete-BlK8wY06.js +0 -10
  539. package/dist/client/assets/agent-lane-card-model-CY3OE1Xu.js +0 -1
  540. package/dist/client/assets/agent-lanes-model-tc-1hE6q.js +0 -2
  541. package/dist/client/assets/agent-master-I1W-5d-x.css +0 -1
  542. package/dist/client/assets/agent-master-model-DMcHeNq3.js +0 -1
  543. package/dist/client/assets/api-Co9aQ2Jw.js +0 -1
  544. package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
  545. package/dist/client/assets/chunk-JTPDIGGW-COJ00z94.js +0 -46
  546. package/dist/client/assets/chunk-YOZR3KYS-CrCgXw9l.js +0 -2
  547. package/dist/client/assets/colors-BtO5_zlx.js +0 -1
  548. package/dist/client/assets/content-0RBfbCIJ.js +0 -1
  549. package/dist/client/assets/content-BTmnk2bl.js +0 -1
  550. package/dist/client/assets/content-Bk5DKhyP.js +0 -1
  551. package/dist/client/assets/content-Bw_8GE_S.js +0 -1
  552. package/dist/client/assets/content-CI4gLEWi.js +0 -1
  553. package/dist/client/assets/content-CLCtp9Rb.js +0 -1
  554. package/dist/client/assets/content-C_FAGTNk.js +0 -1
  555. package/dist/client/assets/content-CnnzWOE3.js +0 -1
  556. package/dist/client/assets/content-DKlY98pO.js +0 -1
  557. package/dist/client/assets/content-Df7ndXTG.js +0 -1
  558. package/dist/client/assets/content-DkZDzzx3.js +0 -1
  559. package/dist/client/assets/content-DnGmb2L0.js +0 -1
  560. package/dist/client/assets/content-Ds-zs-Ss.js +0 -1
  561. package/dist/client/assets/content-JIWSyC0f.js +0 -1
  562. package/dist/client/assets/content-Q3TIYC8q.js +0 -1
  563. package/dist/client/assets/content-evaBfvxD.js +0 -1
  564. package/dist/client/assets/conversation-model-C2KuZUXc.js +0 -1
  565. package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +0 -1
  566. package/dist/client/assets/discover-DutlV0ZU.js +0 -2
  567. package/dist/client/assets/embed-entry-CJG7WEVw.js +0 -2
  568. package/dist/client/assets/home-moving-signal-PHSqSBu_.js +0 -1
  569. package/dist/client/assets/home-now-card-C_qsI6C6.js +0 -1
  570. package/dist/client/assets/hooks-ME7rmhpE.js +0 -2
  571. package/dist/client/assets/index-C8UCRm2W.js +0 -1
  572. package/dist/client/assets/index-Cn0I2Hgi.js +0 -1
  573. package/dist/client/assets/index-Cx6Gbr6n.js +0 -1
  574. package/dist/client/assets/index-i7TMxlwW.css +0 -1
  575. package/dist/client/assets/knowledge-search-D_bLoYtC.css +0 -1
  576. package/dist/client/assets/lane-roster-store-DN2jxXF-.js +0 -1
  577. package/dist/client/assets/left-BRu9pnqx.js +0 -2
  578. package/dist/client/assets/left-BjS1dKNV.js +0 -2
  579. package/dist/client/assets/left-CL-TVLJ7.js +0 -1
  580. package/dist/client/assets/left-DLpsDi55.js +0 -1
  581. package/dist/client/assets/left-DPcM9o8Y.js +0 -1
  582. package/dist/client/assets/left-MmTJf1tK.js +0 -1
  583. package/dist/client/assets/left-P80i5V8L.js +0 -1
  584. package/dist/client/assets/left-advisor-CbXVzAqS.js +0 -1
  585. package/dist/client/assets/left-agents-7mJsiNyr.js +0 -1
  586. package/dist/client/assets/left-default-COK26l3H.js +0 -1
  587. package/dist/client/assets/left-lanes-Dbdm9Veu.js +0 -1
  588. package/dist/client/assets/left-mission-DSenPIyb.css +0 -1
  589. package/dist/client/assets/left-mission-DqGR5jby.js +0 -1
  590. package/dist/client/assets/library-COnWzUWv.js +0 -1
  591. package/dist/client/assets/mentions-BZ5SBMtc.js +0 -1
  592. package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +0 -1
  593. package/dist/client/assets/mesh-view-store-CBM1za_N.js +0 -1
  594. package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
  595. package/dist/client/assets/mission-control-model-C0fByIjm.js +0 -1
  596. package/dist/client/assets/mission-control-store-CM8mQGg8.js +0 -1
  597. package/dist/client/assets/observe-BLmy4quB.js +0 -1
  598. package/dist/client/assets/ops-screen-giu3If_N.css +0 -1
  599. package/dist/client/assets/page-status-BE0-J1xY.js +0 -1
  600. package/dist/client/assets/paperclip-Br7wUDFl.js +0 -1
  601. package/dist/client/assets/perf-PX8Rx0EP.js +0 -1
  602. package/dist/client/assets/profile-BCvk8jOQ.js +0 -1
  603. package/dist/client/assets/resolve-panes-DhD5qmQO.js +0 -1
  604. package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +0 -1
  605. package/dist/client/assets/right-B_08ilv6.js +0 -1
  606. package/dist/client/assets/right-Brm67HOL.js +0 -1
  607. package/dist/client/assets/right-BveAPKBW.js +0 -1
  608. package/dist/client/assets/right-CpTB_-Ya.js +0 -1
  609. package/dist/client/assets/right-CqC4Qdot.js +0 -1
  610. package/dist/client/assets/right-D91j9d5Y.js +0 -1
  611. package/dist/client/assets/right-DaLRhYl3.js +0 -1
  612. package/dist/client/assets/right-Dt1wOwA5.js +0 -1
  613. package/dist/client/assets/right-DtzqIZQF.js +0 -1
  614. package/dist/client/assets/router-kfcaYqZr.js +0 -1
  615. package/dist/client/assets/runtime-picker-C20lTGhV.js +0 -1
  616. package/dist/client/assets/scout-voice-Cg1qfepC.js +0 -1
  617. package/dist/client/assets/secondaryNavConfig-C0Srrmy8.js +0 -1
  618. package/dist/client/assets/system-surfaces-redesign-kuf3wuE_.css +0 -1
  619. package/dist/client/assets/terminal-screen-vMICbBJh.css +0 -1
  620. package/dist/client/assets/use-conversation-list-UG-tMN67.js +0 -1
  621. package/dist/client/assets/use-scout-dev-flags-DTseRrFi.js +0 -1
  622. package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as d,j as e}from"./index-C1VaWNuD.js";import{L as K,u as X}from"./chunk-YOZR3KYS-CrCgXw9l.js";import{c as Q}from"./clipboard-e3fSpeo7.js";import{e as A}from"./terminal-sessions-Bdt2W3Y4.js";import{a as C}from"./api-Co9aQ2Jw.js";import{H as D}from"./HarnessMark-DttReffF.js";import{T as H}from"./terminal-UDy4lzV1.js";import{R as V}from"./refresh-cw-Bkh7Cvnd.js";import{C as Z}from"./check-Dz2SRHft.js";import{C as ee}from"./copy-BzdzWsQd.js";import{E as G}from"./eye-C9cGk5z6.js";import{c as te}from"./createLucideIcon-Dv8H8m7J.js";import{X as se}from"./x-DgmmnPKt.js";const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],J=te("crosshair",ne);async function re(){return C("/api/terminal-hosts")}async function ae(t,s){return C(`/api/terminal-hosts/${encodeURIComponent(t)}/sessions`,{method:"POST",body:JSON.stringify(s)})}let $=null,O=null;function ie(){return $?Promise.resolve($):(O??=re().then(t=>($=t,t)).finally(()=>{O=null}),O)}function Ae(){const[t,s]=d.useState($);return d.useEffect(()=>{if(t)return;let n=!1;return ie().then(a=>{n||s(a)}).catch(()=>{}),()=>{n=!0}},[t]),{hosts:t?.hosts??[],preferredHostId:t?.preferredHostId??null,loaded:t!==null}}async function le(t){return(await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/topology`)).topology}async function F(t,s){await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/focus`,{method:"POST",body:JSON.stringify({target:s})})}async function Y(t,s,n=48){const a=new URLSearchParams({backend:"herdr",sessionName:t,paneId:s,lines:String(n)}),i=await C(`/api/terminal-sessions/peek?${a.toString()}`);return i.available?{body:i.body,reason:null}:{body:null,reason:i.reason??"No preview available."}}const oe=3e3;function ce(t,s,n={}){const a=n.enabled??!0,i=n.lines??48,c=n.pollMs??oe,[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!s||!a)return;let l=!1;m(null);const b=()=>{Y(t,s,i).then(h=>{l||m(h)}).catch(h=>{if(l)return;const r=h instanceof Error?h.message:String(h);m(g=>({body:g?.body??null,reason:r}))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,s,i,a,c,u]),{body:p?.body??null,reason:p?.reason??null,loading:p===null,refresh:()=>o(l=>l+1)}}const de=15e3;function ue(t,s,n={}){const a=n.enabled??!0,i=n.lines??6,c=n.pollMs??de,[p,m]=d.useState({}),u=s.join(`
1
+ import{r as d,j as e}from"./index-C8uS5szO.js";import{L as K,u as X}from"./chunk-YOZR3KYS-B59jqwO0.js";import{c as Q}from"./clipboard-e3fSpeo7.js";import{e as A}from"./terminal-sessions-Ch9aYlgi.js";import{a as C}from"./api-CaROe5_H.js";import{H as D}from"./HarnessMark-Bt47OeHy.js";import{T as $}from"./terminal-96JWDYDL.js";import{R as V}from"./refresh-cw-Da9DDLk2.js";import{C as Z}from"./check-B8dMv3Is.js";import{C as ee}from"./copy-D9WUpQRf.js";import{E as G}from"./eye-CtqSV8BS.js";import{c as te}from"./createLucideIcon-DkjnzvcJ.js";import{X as se}from"./x-DI1ktCYb.js";const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],J=te("crosshair",ne);async function re(){return C("/api/terminal-hosts")}async function ae(t,s){return C(`/api/terminal-hosts/${encodeURIComponent(t)}/sessions`,{method:"POST",body:JSON.stringify(s)})}let H=null,O=null;function le(){return H?Promise.resolve(H):(O??=re().then(t=>(H=t,t)).finally(()=>{O=null}),O)}function Ae(){const[t,s]=d.useState(H);return d.useEffect(()=>{if(t)return;let n=!1;return le().then(a=>{n||s(a)}).catch(()=>{}),()=>{n=!0}},[t]),{hosts:t?.hosts??[],preferredHostId:t?.preferredHostId??null,loaded:t!==null}}async function ie(t){return(await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/topology`)).topology}async function F(t,s){await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/focus`,{method:"POST",body:JSON.stringify({target:s})})}async function Y(t,s,n=48){const a=new URLSearchParams({backend:"herdr",sessionName:t,paneId:s,lines:String(n)}),l=await C(`/api/terminal-sessions/peek?${a.toString()}`);return l.available?{body:l.body,reason:null}:{body:null,reason:l.reason??"No preview available."}}const oe=3e3;function ce(t,s,n={}){const a=n.enabled??!0,l=n.lines??48,c=n.pollMs??oe,[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!s||!a)return;let i=!1;m(null);const b=()=>{Y(t,s,l).then(h=>{i||m(h)}).catch(h=>{if(i)return;const r=h instanceof Error?h.message:String(h);m(g=>({body:g?.body??null,reason:r}))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{i=!0,window.clearInterval(j)}},[t,s,l,a,c,u]),{body:p?.body??null,reason:p?.reason??null,loading:p===null,refresh:()=>o(i=>i+1)}}const de=15e3;function ue(t,s,n={}){const a=n.enabled??!0,l=n.lines??6,c=n.pollMs??de,[p,m]=d.useState({}),u=s.join(`
2
2
  `);return d.useEffect(()=>{const o=u?u.split(`
3
- `):[];if(!t||!a||o.length===0)return;let l=!1;const b=()=>{Promise.all(o.map(async h=>{try{const r=await Y(t,h,i);return[h,r.body]}catch{return[h,void 0]}})).then(h=>{l||m(r=>{const g={};for(const[S,k]of h)g[S]=k===void 0?r[S]??null:k;return g})})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,u,i,a,c]),p}const he=3e3;function pe(t,s={}){const n=s.enabled??!0,a=s.pollMs??he,[i,c]=d.useState(null),[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!n)return;let l=!1;const b=()=>{le(t).then(h=>{l||(c(h),m(null))}).catch(h=>{l||m(h instanceof Error?h.message:String(h))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},a);return()=>{l=!0,window.clearInterval(j)}},[t,n,a,u]),{topology:i,error:p,refresh:()=>o(l=>l+1)}}const me={column:"status",direction:"desc"},z=[{id:"pane",label:"Pane",initialDirection:"asc"},{id:"harness",label:"Harness",initialDirection:"asc"},{id:"status",label:"Status",initialDirection:"desc"},{id:"directory",label:"Directory",initialDirection:"asc"},{id:"tab",label:"Tab",initialDirection:"asc"},{id:"drift",label:"Drift",initialDirection:"desc"},{id:"output",label:"Last output",initialDirection:"asc"}];function U(t){switch(t){case"working":return 4;case"blocked":return 3;case"idle":return 2;case"done":return 1;case"unknown":return 0}}function T(t){return t.label??t.paneId}function M(t){return t.foregroundCwd??t.cwd??""}function R(t){return t.scroll?.offsetFromBottom??null}function L(t){if(!t)return null;const n=t.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g,"").split(`
4
- `);for(let a=n.length-1;a>=0;a-=1){const i=n[a].trim();if(i)return i}return null}function N(t,s){return t.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}function be(t,s){const n=s.direction==="asc"?1:-1;return[...t].sort((a,i)=>{const c=fe(a,i,s.column);if(c!==0)return c;const p=xe(a,i,s.column)*n;return p!==0?p:N(T(a.pane),T(i.pane))})}function fe(t,s,n){const a=p=>n==="drift"?R(p.pane):n==="output"?L(p.output):!0,i=a(t),c=a(s);return i===null&&c===null?0:i===null?1:c===null?-1:0}function xe(t,s,n){switch(n){case"pane":return N(T(t.pane),T(s.pane));case"harness":return N(t.pane.agent??"",s.pane.agent??"");case"status":return U(t.pane.agentStatus)-U(s.pane.agentStatus);case"directory":return N(M(t.pane),M(s.pane));case"tab":return N(t.tabLabel,s.tabLabel);case"drift":return B(R(t.pane),R(s.pane));case"output":return B(L(t.output),L(s.output))}}function B(t,s){return t===null&&s===null?0:t===null?-1:s===null?1:typeof t=="string"&&typeof s=="string"?N(t,s):Number(t)-Number(s)}function je(t,s){if(t.column===s)return{column:s,direction:t.direction==="asc"?"desc":"asc"};const n=z.find(a=>a.id===s)?.initialDirection??"asc";return{column:s,direction:n}}const ye="openscout.herdr.pane-table-sort.v1";function W(t){return{view:"terminal",terminalBackend:"herdr",terminalAgent:"shell",terminalTabId:`herdr-${t}`,terminalSessionName:t}}function ge({sessionName:t,navigate:s}){const{topology:n,error:a,refresh:i}=pe(t),[c,p]=d.useState(null),[m,u]=d.useState(null),[o,l]=d.useState("idle"),[b,j]=d.useState(null),h=t==="default"?"herdr":`herdr session attach ${t}`,r=n?.running??!1,g=d.useCallback(()=>{l("starting"),j(null),ae("herdr",{sessionName:t}).then(()=>{l("idle"),i()}).catch(y=>{l("failed"),j(y instanceof Error?y.message:String(y))})},[t,i]),S=d.useCallback(()=>{s(W(t))},[s,t]),k=d.useCallback(y=>{F(t,y.terminalId??y.paneId).catch(()=>{}),s(W(t))},[s,t]);return e.jsxs("div",{className:"s-term s-herdr",children:[e.jsxs("header",{className:"s-herdr-header",children:[e.jsxs("div",{className:"s-herdr-title",children:[e.jsx("span",{className:"s-herdr-mark",children:e.jsx(H,{size:16,strokeWidth:1.8})}),e.jsx("strong",{children:t}),e.jsx("span",{className:`s-herdr-state ${r?"s-herdr-state--live":""}`,children:n?r?"running":"stopped":"loading"})]}),e.jsxs("div",{className:"s-herdr-actions",children:[r&&e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:S,title:"Open a live web terminal attached to this session",children:[e.jsx(K,{size:13,strokeWidth:1.8}),"Open terminal"]}),e.jsx(we,{command:h}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:i,title:"Refresh","aria-label":"Refresh",children:e.jsx(V,{size:14,strokeWidth:1.8})})]})]}),a&&e.jsx("div",{className:"s-herdr-error",children:a}),n&&!r&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx(H,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"This herdr session is stopped."}),e.jsx("span",{children:"The session still exists — herdr sessions are persistent. Start it and the projection fills in."}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:g,disabled:o==="starting",children:o==="starting"?"Starting…":"Start it"}),b&&e.jsx("code",{children:b})]}),n&&r&&n.workspaces.length===0&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx(H,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"No workspaces yet."}),e.jsx("span",{children:"Open this session in herdr to create one — layout is herdr's job, Scout just watches."})]}),n&&r&&n.workspaces.length>0&&(()=>{const y=n.workspaces.flatMap(f=>f.tabs.map(x=>({workspace:f,tab:x})));if(y.length===0)return null;const v=n.workspaces.find(f=>f.focused)?.activeTabId??n.workspaces[0]?.activeTabId??null,E=y.find(f=>f.tab.tabId===c)??y.find(f=>f.tab.tabId===v)??y[0],{workspace:w,tab:I}=E,q=f=>{p(f),u(null)};return e.jsxs("section",{className:"s-herdr-workspace",children:[e.jsxs("div",{className:"s-herdr-workspace-head",children:[e.jsx("span",{className:"s-herdr-workspace-label",children:w.label??w.workspaceId}),e.jsx(_,{status:w.agentStatus})]}),e.jsx("div",{className:"s-herdr-tabs",role:"tablist",children:y.map(({workspace:f,tab:x})=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x.tabId===I.tabId,className:`s-herdr-tab ${x.tabId===I.tabId?"s-herdr-tab--active":""}`,title:`${f.label??f.workspaceId} · ${x.label??x.tabId}`,onClick:()=>q(x.tabId),children:[e.jsx(P,{status:x.agentStatus}),e.jsx("span",{children:x.label??`Tab ${x.number??""}`}),e.jsx(Ne,{tab:x}),e.jsx("span",{className:"s-herdr-tab-count",children:x.panes.length})]},x.tabId))}),I.layout&&e.jsx(ke,{tab:I,diveInPaneId:m,onEnterPane:k,onToggleDiveIn:f=>u(x=>x===f?null:f)}),e.jsx(ve,{sessionName:t,tab:I,onEnterPane:k}),m&&(()=>{const f=I.panes.find(x=>x.paneId===m);return f?e.jsx(Se,{sessionName:t,pane:f,onClose:()=>u(null)}):null})()]})})()]})}function ke({tab:t,diveInPaneId:s,onEnterPane:n,onToggleDiveIn:a}){const i=t.layout;if(!i)return null;const{area:c}=i,p=new Map(t.panes.map(u=>[u.paneId,u])),m=`${c.width} / ${Math.max(c.height*2,1)}`;return e.jsxs("div",{className:"s-herdr-layout-window",children:[e.jsxs("div",{className:"s-herdr-layout-titlebar",children:[e.jsxs("span",{className:"s-herdr-layout-lights","aria-hidden":"true",children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-herdr-layout-title",children:[t.label??`Tab ${t.number??""}`," — ",i.panes.length," ",i.panes.length===1?"pane":"panes"]}),e.jsx("span",{className:"s-herdr-layout-hint",children:"click a pane to enter"})]}),e.jsx("div",{className:"s-herdr-layout",style:{aspectRatio:m},role:"group","aria-label":`Layout of ${t.label??t.tabId}`,children:i.panes.map(u=>{const o=p.get(u.paneId),{rect:l}=u,b={left:`${(l.x-c.x)/c.width*100}%`,top:`${(l.y-c.y)/c.height*100}%`,width:`${l.width/c.width*100}%`,height:`${l.height/c.height*100}%`},j=o?.paneId===s;return e.jsxs("div",{role:"button",tabIndex:0,className:`s-herdr-layout-pane ${u.focused?"s-herdr-layout-pane--focused":""}`,style:b,onClick:()=>o&&n(o),onKeyDown:h=>{o&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),n(o))},title:o?`Enter ${o.label??o.paneId} — focus it and open the web terminal`:u.paneId,children:[e.jsxs("span",{className:"s-herdr-layout-pane-head",children:[o&&e.jsx(P,{status:o.agentStatus}),o?.agent&&e.jsx(D,{harness:o.agent,size:12,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:o?.label??u.paneId})]}),o?.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(o.foregroundCwd)}),o&&e.jsx("button",{type:"button",className:`s-herdr-layout-pane-peek ${j?"s-herdr-layout-pane-peek--active":""}`,onClick:h=>{h.stopPropagation(),a(o.paneId)},title:j?"Close the live view":"Watch this pane live","aria-label":j?"Close the live view":"Watch this pane live","aria-pressed":j,children:e.jsx(G,{size:13,strokeWidth:1.8})})]},u.paneId)})})]})}function ve({sessionName:t,tab:s,onEnterPane:n}){const[a,i]=X(ye,me),[c,p]=d.useState(null),[m,u]=d.useState(null),o=d.useMemo(()=>s.panes.map(r=>r.paneId),[s.panes]),l=ue(t,o,{lines:6}),b=s.label??`Tab ${s.number??""}`,j=d.useMemo(()=>be(s.panes.map(r=>({pane:r,tabLabel:b,output:l[r.paneId]??null})),a),[s.panes,b,l,a]),h=d.useCallback(r=>{u(null),F(t,r.terminalId??r.paneId).catch(g=>u(g instanceof Error?g.message:String(g)))},[t]);return e.jsxs("div",{className:"s-herdr-table-wrap",children:[e.jsxs("table",{className:"s-herdr-table","aria-label":`Panes of ${b}`,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[z.map(r=>e.jsx("th",{scope:"col","aria-sort":a.column===r.id?a.direction==="asc"?"ascending":"descending":"none",children:e.jsxs("button",{type:"button",onClick:()=>i(je(a,r.id)),children:[e.jsx("span",{children:r.label}),e.jsx("em",{"aria-hidden":"true",children:a.column===r.id?a.direction==="asc"?"▲":"▼":"·"})]})},r.id)),e.jsx("th",{scope:"col","aria-label":"Actions"})]})}),e.jsx("tbody",{children:j.map(({pane:r,tabLabel:g,output:S})=>{const k=r.paneId===c,y=L(S),v=R(r),E=M(r);return e.jsxs(d.Fragment,{children:[e.jsxs("tr",{className:r.focused?"is-focused":void 0,onClick:()=>n(r),title:`Enter ${T(r)} — focus it and open the web terminal`,children:[e.jsxs("td",{className:"s-herdr-table-pane",children:[e.jsx(P,{status:r.agentStatus}),e.jsx("strong",{title:r.paneId,children:T(r)}),r.focused&&e.jsx("span",{className:"s-herdr-focused",children:"focused in herdr"})]}),e.jsx("td",{className:"s-herdr-table-harness",children:r.agent?e.jsx("span",{title:r.agent,className:"s-herdr-table-harness-mark",children:e.jsx(D,{harness:r.agent,size:13,className:"s-herdr-agent-mark"})}):e.jsx("span",{title:"shell — no agent running",className:"s-herdr-table-harness-mark",children:e.jsx(H,{size:12,strokeWidth:1.8})})}),e.jsx("td",{children:r.agentStatus==="unknown"?"—":e.jsx(_,{status:r.agentStatus})}),e.jsx("td",{className:"s-herdr-table-dir",title:E||void 0,children:E?A(E):"—"}),e.jsx("td",{children:g}),e.jsx("td",{className:"s-herdr-table-drift",title:v===null?void 0:v===0?"Pinned to live output":`Scrolled up ${v} ${v===1?"line":"lines"} from the live edge`,children:v===null?"—":v===0?"live":`↑${v}`}),e.jsx("td",{className:"s-herdr-table-output",title:y??void 0,children:y??"—"}),e.jsxs("td",{className:"s-herdr-table-actions",children:[e.jsx("button",{type:"button",className:`s-term-icon-button${k?" is-active":""}`,onClick:w=>{w.stopPropagation(),p(I=>I===r.paneId?null:r.paneId)},title:k?"Hide the pane's last lines":"Show the pane's last lines","aria-label":k?"Hide the pane's last lines":"Show the pane's last lines","aria-pressed":k,children:e.jsx(G,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),h(r)},title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),n(r)},title:"Enter — focus it and open the web terminal","aria-label":"Enter — focus it and open the web terminal",children:e.jsx(K,{size:13,strokeWidth:1.8})})]})]}),k&&e.jsx("tr",{className:"s-herdr-table-expand",children:e.jsx("td",{colSpan:z.length+1,children:S?e.jsx("pre",{children:S}):e.jsx("span",{className:"s-herdr-peek-reason",children:"No output captured yet."})})})]},r.paneId)})})]}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})}function we({command:t}){const[s,n]=d.useState(!1);return e.jsxs("button",{type:"button",className:"s-herdr-attach",title:"Copy attach command — open this session in the herdr client",onClick:()=>{Q(t).then(()=>{n(!0),window.setTimeout(()=>n(!1),1500)})},children:[s?e.jsx(Z,{size:13,strokeWidth:2}):e.jsx(ee,{size:13,strokeWidth:1.8}),e.jsx("code",{children:t})]})}function Se({sessionName:t,pane:s,onClose:n}){const{body:a,reason:i,loading:c,refresh:p}=ce(t,s.paneId,{lines:48}),[m,u]=d.useState(null);d.useEffect(()=>{const l=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n]);const o=d.useCallback(()=>{u(null),F(t,s.terminalId??s.paneId).catch(l=>u(l instanceof Error?l.message:String(l)))},[t,s.terminalId,s.paneId]);return e.jsx("div",{className:"s-herdr-lightbox",onClick:n,role:"presentation",children:e.jsxs("section",{className:"s-herdr-live","aria-label":`Live view of ${s.label??s.paneId}`,onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"s-herdr-live-head",children:[e.jsx(P,{status:s.agentStatus}),s.agent&&e.jsx(D,{harness:s.agent,size:13,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:s.label??s.paneId}),e.jsx(_,{status:s.agentStatus}),s.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(s.foregroundCwd)}),e.jsx("span",{className:"s-herdr-pane-spacer"}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:o,title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:p,title:"Refresh now","aria-label":"Refresh now",children:e.jsx(V,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:n,title:"Close the live view (Esc)","aria-label":"Close the live view",children:e.jsx(se,{size:14,strokeWidth:1.8})})]}),e.jsx("div",{className:"s-herdr-live-body",children:a!==null?e.jsx("pre",{children:a}):c?e.jsx("span",{className:"s-herdr-peek-reason",children:"Loading…"}):e.jsx("span",{className:"s-herdr-peek-reason",children:i??"No preview available."})}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})})}function Ie(t){return t}function P({status:t}){return e.jsx("span",{className:`s-herdr-dot s-herdr-dot--${t}`,"aria-hidden":"true"})}function _({status:t}){return t==="unknown"?null:e.jsx("span",{className:`s-herdr-badge s-herdr-badge--${t}`,children:t})}function Ne({tab:t}){const s=[...new Set(t.panes.map(n=>n.agent).filter(n=>!!n))].slice(0,4);return s.length===0?null:e.jsx("span",{className:"s-herdr-tab-marks",children:s.map(n=>e.jsx(D,{harness:n,size:11,className:"s-herdr-agent-mark"},n))})}function Te(t){return{label:t.label??`Tab ${t.number??""}`,statuses:t.panes.map(s=>s.agentStatus)}}const Fe=Object.freeze(Object.defineProperty({__proto__:null,AgentStatusBadge:_,AgentStatusDot:P,HerdrSessionScreen:ge,herdrAgentStatusLabel:Ie,herdrTabSummary:Te,herdrTerminalRoute:W},Symbol.toStringTag,{value:"Module"}));export{P as A,ge as H,pe as a,Te as b,ae as c,Fe as d,W as h,Ae as u};
3
+ `):[];if(!t||!a||o.length===0)return;let i=!1;const b=()=>{Promise.all(o.map(async h=>{try{const r=await Y(t,h,l);return[h,r.body]}catch{return[h,void 0]}})).then(h=>{i||m(r=>{const g={};for(const[S,k]of h)g[S]=k===void 0?r[S]??null:k;return g})})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{i=!0,window.clearInterval(j)}},[t,u,l,a,c]),p}const he=3e3;function pe(t,s={}){const n=s.enabled??!0,a=s.pollMs??he,[l,c]=d.useState(null),[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!n)return;let i=!1;const b=()=>{ie(t).then(h=>{i||(c(h),m(null))}).catch(h=>{i||m(h instanceof Error?h.message:String(h))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},a);return()=>{i=!0,window.clearInterval(j)}},[t,n,a,u]),{topology:l,error:p,refresh:()=>o(i=>i+1)}}const me={column:"status",direction:"desc"},z=[{id:"pane",label:"Pane",initialDirection:"asc"},{id:"harness",label:"Harness",initialDirection:"asc"},{id:"status",label:"Status",initialDirection:"desc"},{id:"directory",label:"Directory",initialDirection:"asc"},{id:"tab",label:"Tab",initialDirection:"asc"},{id:"drift",label:"Drift",initialDirection:"desc"},{id:"output",label:"Last output",initialDirection:"asc"}];function U(t){switch(t){case"working":return 4;case"blocked":return 3;case"idle":return 2;case"done":return 1;case"unknown":return 0}}function E(t){return t.label??t.paneId}function M(t){return t.foregroundCwd??t.cwd??""}function R(t){return t.scroll?.offsetFromBottom??null}function L(t){if(!t)return null;const n=t.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g,"").split(`
4
+ `);for(let a=n.length-1;a>=0;a-=1){const l=n[a].trim();if(l)return l}return null}function N(t,s){return t.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}function be(t,s){const n=s.direction==="asc"?1:-1;return[...t].sort((a,l)=>{const c=fe(a,l,s.column);if(c!==0)return c;const p=xe(a,l,s.column)*n;return p!==0?p:N(E(a.pane),E(l.pane))})}function fe(t,s,n){const a=p=>n==="drift"?R(p.pane):n==="output"?L(p.output):!0,l=a(t),c=a(s);return l===null&&c===null?0:l===null?1:c===null?-1:0}function xe(t,s,n){switch(n){case"pane":return N(E(t.pane),E(s.pane));case"harness":return N(t.pane.agent??"",s.pane.agent??"");case"status":return U(t.pane.agentStatus)-U(s.pane.agentStatus);case"directory":return N(M(t.pane),M(s.pane));case"tab":return N(t.tabLabel,s.tabLabel);case"drift":return B(R(t.pane),R(s.pane));case"output":return B(L(t.output),L(s.output))}}function B(t,s){return t===null&&s===null?0:t===null?-1:s===null?1:typeof t=="string"&&typeof s=="string"?N(t,s):Number(t)-Number(s)}function je(t,s){if(t.column===s)return{column:s,direction:t.direction==="asc"?"desc":"asc"};const n=z.find(a=>a.id===s)?.initialDirection??"asc";return{column:s,direction:n}}const ye="openscout.herdr.pane-table-sort.v1";function W(t){return{view:"terminal",terminalBackend:"herdr",terminalAgent:"shell",terminalTabId:`herdr-${t}`,terminalSessionName:t}}function ge({sessionName:t,navigate:s}){const{topology:n,error:a,refresh:l}=pe(t),[c,p]=d.useState(null),[m,u]=d.useState(null),[o,i]=d.useState("idle"),[b,j]=d.useState(null),h=t==="default"?"herdr":`herdr session attach ${t}`,r=n?.running??!1,g=d.useCallback(()=>{i("starting"),j(null),ae("herdr",{sessionName:t}).then(()=>{i("idle"),l()}).catch(y=>{i("failed"),j(y instanceof Error?y.message:String(y))})},[t,l]),S=d.useCallback(()=>{s(W(t))},[s,t]),k=d.useCallback(y=>{F(t,y.terminalId??y.paneId).catch(()=>{}),s(W(t))},[s,t]);return e.jsxs("div",{className:"s-term s-herdr",children:[e.jsxs("header",{className:"s-herdr-header",children:[e.jsxs("div",{className:"s-herdr-title",children:[e.jsx("span",{className:"s-herdr-mark",children:e.jsx($,{size:16,strokeWidth:1.8})}),e.jsx("strong",{children:t}),e.jsx("span",{className:`s-herdr-state ${r?"s-herdr-state--live":""}`,children:n?r?"running":"stopped":"loading"})]}),e.jsxs("div",{className:"s-herdr-actions",children:[r&&e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:S,title:"Open a live web terminal attached to this session",children:[e.jsx(K,{size:13,strokeWidth:1.8}),"Open terminal"]}),e.jsx(we,{command:h}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:l,title:"Refresh","aria-label":"Refresh",children:e.jsx(V,{size:14,strokeWidth:1.8})})]})]}),a&&e.jsx("div",{className:"s-herdr-error",children:a}),n&&!r&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx($,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"This herdr session is stopped."}),e.jsx("span",{children:"The session still exists — herdr sessions are persistent. Start it and the projection fills in."}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:g,disabled:o==="starting",children:o==="starting"?"Starting…":"Start it"}),b&&e.jsx("code",{children:b})]}),n&&r&&n.workspaces.length===0&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx($,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"No workspaces yet."}),e.jsx("span",{children:"Open this session in herdr to create one — layout is herdr's job, Scout just watches."})]}),n&&r&&n.workspaces.length>0&&(()=>{const y=n.workspaces.flatMap(f=>f.tabs.map(x=>({workspace:f,tab:x})));if(y.length===0)return null;const v=n.workspaces.find(f=>f.focused)?.activeTabId??n.workspaces[0]?.activeTabId??null,T=y.find(f=>f.tab.tabId===c)??y.find(f=>f.tab.tabId===v)??y[0],{workspace:w,tab:I}=T,q=f=>{p(f),u(null)};return e.jsxs("section",{className:"s-herdr-workspace",children:[e.jsxs("div",{className:"s-herdr-workspace-head",children:[e.jsx("span",{className:"s-herdr-workspace-label",children:w.label??w.workspaceId}),e.jsx(_,{status:w.agentStatus})]}),e.jsx("div",{className:"s-herdr-tabs",role:"tablist",children:y.map(({workspace:f,tab:x})=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x.tabId===I.tabId,className:`s-herdr-tab ${x.tabId===I.tabId?"s-herdr-tab--active":""}`,title:`${f.label??f.workspaceId} · ${x.label??x.tabId}`,onClick:()=>q(x.tabId),children:[e.jsx(P,{status:x.agentStatus}),e.jsx("span",{children:x.label??`Tab ${x.number??""}`}),e.jsx(Ne,{tab:x}),e.jsx("span",{className:"s-herdr-tab-count",children:x.panes.length})]},x.tabId))}),I.layout&&e.jsx(ke,{tab:I,diveInPaneId:m,onEnterPane:k,onToggleDiveIn:f=>u(x=>x===f?null:f)}),e.jsx(ve,{sessionName:t,tab:I,onEnterPane:k}),m&&(()=>{const f=I.panes.find(x=>x.paneId===m);return f?e.jsx(Se,{sessionName:t,pane:f,onClose:()=>u(null)}):null})()]})})()]})}function ke({tab:t,diveInPaneId:s,onEnterPane:n,onToggleDiveIn:a}){const l=t.layout;if(!l)return null;const{area:c}=l,p=new Map(t.panes.map(u=>[u.paneId,u])),m=`${c.width} / ${Math.max(c.height*2,1)}`;return e.jsxs("div",{className:"s-herdr-layout-window",children:[e.jsxs("div",{className:"s-herdr-layout-titlebar",children:[e.jsxs("span",{className:"s-herdr-layout-lights","aria-hidden":"true",children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-herdr-layout-title",children:[t.label??`Tab ${t.number??""}`," — ",l.panes.length," ",l.panes.length===1?"pane":"panes"]}),e.jsx("span",{className:"s-herdr-layout-hint",children:"click a pane to enter"})]}),e.jsx("div",{className:"s-herdr-layout",style:{aspectRatio:m},role:"group","aria-label":`Layout of ${t.label??t.tabId}`,children:l.panes.map(u=>{const o=p.get(u.paneId),{rect:i}=u,b={left:`${(i.x-c.x)/c.width*100}%`,top:`${(i.y-c.y)/c.height*100}%`,width:`${i.width/c.width*100}%`,height:`${i.height/c.height*100}%`},j=o?.paneId===s;return e.jsxs("div",{role:"button",tabIndex:0,className:`s-herdr-layout-pane ${u.focused?"s-herdr-layout-pane--focused":""}`,style:b,onClick:()=>o&&n(o),onKeyDown:h=>{o&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),n(o))},title:o?`Enter ${o.label??o.paneId} — focus it and open the web terminal`:u.paneId,children:[e.jsxs("span",{className:"s-herdr-layout-pane-head",children:[o&&e.jsx(P,{status:o.agentStatus}),o?.agent&&e.jsx(D,{harness:o.agent,size:12,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:o?.label??u.paneId})]}),o?.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(o.foregroundCwd)}),o&&e.jsx("button",{type:"button",className:`s-herdr-layout-pane-peek ${j?"s-herdr-layout-pane-peek--active":""}`,onClick:h=>{h.stopPropagation(),a(o.paneId)},title:j?"Close the live view":"Watch this pane live","aria-label":j?"Close the live view":"Watch this pane live","aria-pressed":j,children:e.jsx(G,{size:13,strokeWidth:1.8})})]},u.paneId)})})]})}function ve({sessionName:t,tab:s,onEnterPane:n}){const[a,l]=X(ye,me),[c,p]=d.useState(null),[m,u]=d.useState(null),o=d.useMemo(()=>s.panes.map(r=>r.paneId),[s.panes]),i=ue(t,o,{lines:6}),b=s.label??`Tab ${s.number??""}`,j=d.useMemo(()=>be(s.panes.map(r=>({pane:r,tabLabel:b,output:i[r.paneId]??null})),a),[s.panes,b,i,a]),h=d.useCallback(r=>{u(null),F(t,r.terminalId??r.paneId).catch(g=>u(g instanceof Error?g.message:String(g)))},[t]);return e.jsxs("div",{className:"s-herdr-table-wrap",children:[e.jsxs("table",{className:"s-herdr-table","aria-label":`Panes of ${b}`,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[z.map(r=>e.jsx("th",{scope:"col","aria-sort":a.column===r.id?a.direction==="asc"?"ascending":"descending":"none",children:e.jsxs("button",{type:"button",onClick:()=>l(je(a,r.id)),children:[e.jsx("span",{children:r.label}),e.jsx("em",{"aria-hidden":"true",children:a.column===r.id?a.direction==="asc"?"▲":"▼":"·"})]})},r.id)),e.jsx("th",{scope:"col","aria-label":"Actions"})]})}),e.jsx("tbody",{children:j.map(({pane:r,tabLabel:g,output:S})=>{const k=r.paneId===c,y=L(S),v=R(r),T=M(r);return e.jsxs(d.Fragment,{children:[e.jsxs("tr",{className:r.focused?"is-focused":void 0,onClick:()=>n(r),title:`Enter ${E(r)} — focus it and open the web terminal`,children:[e.jsxs("td",{className:"s-herdr-table-pane",children:[e.jsx(P,{status:r.agentStatus}),e.jsx("strong",{title:r.paneId,children:E(r)}),r.focused&&e.jsx("span",{className:"s-herdr-focused",children:"focused in herdr"})]}),e.jsx("td",{className:"s-herdr-table-harness",children:r.agent?e.jsx("span",{title:r.agent,className:"s-herdr-table-harness-mark",children:e.jsx(D,{harness:r.agent,size:13,className:"s-herdr-agent-mark"})}):e.jsx("span",{title:"shell — no agent running",className:"s-herdr-table-harness-mark",children:e.jsx($,{size:12,strokeWidth:1.8})})}),e.jsx("td",{children:r.agentStatus==="unknown"?"—":e.jsx(_,{status:r.agentStatus})}),e.jsx("td",{className:"s-herdr-table-dir",title:T||void 0,children:T?A(T):"—"}),e.jsx("td",{children:g}),e.jsx("td",{className:"s-herdr-table-drift",title:v===null?void 0:v===0?"Pinned to live output":`Scrolled up ${v} ${v===1?"line":"lines"} from the live edge`,children:v===null?"—":v===0?"live":`↑${v}`}),e.jsx("td",{className:"s-herdr-table-output",title:y??void 0,children:y??"—"}),e.jsxs("td",{className:"s-herdr-table-actions",children:[e.jsx("button",{type:"button",className:`s-term-icon-button${k?" is-active":""}`,onClick:w=>{w.stopPropagation(),p(I=>I===r.paneId?null:r.paneId)},title:k?"Hide the pane's last lines":"Show the pane's last lines","aria-label":k?"Hide the pane's last lines":"Show the pane's last lines","aria-pressed":k,children:e.jsx(G,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),h(r)},title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),n(r)},title:"Enter — focus it and open the web terminal","aria-label":"Enter — focus it and open the web terminal",children:e.jsx(K,{size:13,strokeWidth:1.8})})]})]}),k&&e.jsx("tr",{className:"s-herdr-table-expand",children:e.jsx("td",{colSpan:z.length+1,children:S?e.jsx("pre",{children:S}):e.jsx("span",{className:"s-herdr-peek-reason",children:"No output captured yet."})})})]},r.paneId)})})]}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})}function we({command:t}){const[s,n]=d.useState(!1);return e.jsxs("button",{type:"button",className:"s-herdr-attach",title:"Copy attach command — open this session in the herdr client",onClick:()=>{Q(t).then(()=>{n(!0),window.setTimeout(()=>n(!1),1500)})},children:[s?e.jsx(Z,{size:13,strokeWidth:2}):e.jsx(ee,{size:13,strokeWidth:1.8}),e.jsx("code",{children:t})]})}function Se({sessionName:t,pane:s,onClose:n}){const{body:a,reason:l,loading:c,refresh:p}=ce(t,s.paneId,{lines:48}),[m,u]=d.useState(null);d.useEffect(()=>{const i=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n]);const o=d.useCallback(()=>{u(null),F(t,s.terminalId??s.paneId).catch(i=>u(i instanceof Error?i.message:String(i)))},[t,s.terminalId,s.paneId]);return e.jsx("div",{className:"s-herdr-lightbox",onClick:n,role:"presentation",children:e.jsxs("section",{className:"s-herdr-live","aria-label":`Live view of ${s.label??s.paneId}`,onClick:i=>i.stopPropagation(),children:[e.jsxs("div",{className:"s-herdr-live-head",children:[e.jsx(P,{status:s.agentStatus}),s.agent&&e.jsx(D,{harness:s.agent,size:13,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:s.label??s.paneId}),e.jsx(_,{status:s.agentStatus}),s.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(s.foregroundCwd)}),e.jsx("span",{className:"s-herdr-pane-spacer"}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:o,title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:p,title:"Refresh now","aria-label":"Refresh now",children:e.jsx(V,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:n,title:"Close the live view (Esc)","aria-label":"Close the live view",children:e.jsx(se,{size:14,strokeWidth:1.8})})]}),e.jsx("div",{className:"s-herdr-live-body",children:a!==null?e.jsx("pre",{children:a}):c?e.jsx("span",{className:"s-herdr-peek-reason",children:"Loading…"}):e.jsx("span",{className:"s-herdr-peek-reason",children:l??"No preview available."})}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})})}function Ie(t){return t}function P({status:t}){return e.jsx("span",{className:`s-herdr-dot s-herdr-dot--${t}`,"aria-hidden":"true"})}function _({status:t}){return t==="unknown"?null:e.jsx("span",{className:`s-herdr-badge s-herdr-badge--${t}`,children:t})}function Ne({tab:t}){const s=[...new Set(t.panes.map(n=>n.agent).filter(n=>!!n))].slice(0,4);return s.length===0?null:e.jsx("span",{className:"s-herdr-tab-marks",children:s.map(n=>e.jsx(D,{harness:n,size:11,className:"s-herdr-agent-mark"},n))})}function Ee(t,s){const n=t.label??t.workspaceId,a=t.number!=null?`${n} ${t.number}`:n,l=s.label&&s.label!==String(s.number??"")?s.label:null;return{label:l?`${a} · ${l}`:a,statuses:s.panes.map(c=>c.agentStatus)}}const Fe=Object.freeze(Object.defineProperty({__proto__:null,AgentStatusBadge:_,AgentStatusDot:P,HerdrSessionScreen:ge,herdrAgentStatusLabel:Ie,herdrTabSummary:Ee,herdrTerminalRoute:W},Symbol.toStringTag,{value:"Module"}));export{P as A,ge as H,pe as a,Ee as b,ae as c,Fe as d,ie as f,W as h,Ae as u};
@@ -1 +1 @@
1
- import{r as v,j as t}from"./index-C1VaWNuD.js";import{R as H}from"./refresh-cw-Bkh7Cvnd.js";import{A as _}from"./activity-CzTJ-YMX.js";import"./createLucideIcon-Dv8H8m7J.js";const q=3,I=2;function W(e){return e>=.9?"err":e>=.75?"warn":"ok"}const O=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function A(e,a){const s=e-a.getTime(),c=new Date(e).toDateString()===a.toDateString(),r=new Date(e),n=String(r.getHours()).padStart(2,"0"),l=String(r.getMinutes()).padStart(2,"0"),i=s>0&&s<6*3600*1e3;return c?{label:`${n}:${l}`,imminent:i}:{label:`${O[r.getDay()]} ${n}:${l}`,imminent:i}}function G(e,a){const s=Math.floor((e-a.getTime())/1e3),c=s<0,r=Math.abs(s);let n;if(r>=86400){const l=Math.floor(r/86400),i=Math.floor(r%86400/3600);n=i>0?`${l}d ${i}h`:`${l}d`}else if(r>=3600){const l=Math.floor(r/3600),i=Math.floor(r%3600/60);n=i>0?`${l}h ${i}m`:`${l}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return c?`stale ${n}`:n}function w(e){return e.windows&&e.windows.length>0?e.windows:[{label:z(e.unitLabel),fill:e.fill,usedLabel:e.usedLabel,capLabel:e.capLabel,unitLabel:e.unitLabel,resetAt:e.resetAt}]}function z(e){switch(e){case"weekly":return"7d";case"req/h":return"1h";default:return e||"quota"}}function E(e,a){return w(e).map(s=>{const c=A(s.resetAt,a),r=G(s.resetAt,a);return`${s.label}: ${s.usedLabel} / ${s.capLabel} ${s.unitLabel} · resets ${c.label} (in ${r})`}).join(" · ")}function S(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([mhd])$/i);if(!a)return null;const s=Number(a[1]);if(!Number.isFinite(s))return null;switch(a[2]?.toLowerCase()){case"m":return s;case"h":return s*60;case"d":return s*24*60;default:return null}}function Q(e){const a=[...e].sort((r,n)=>(S(r.label)??Number.MAX_SAFE_INTEGER)-(S(n.label)??Number.MAX_SAFE_INTEGER)),s=a.find(r=>(S(r.label)??0)>=1440)??(a.length>1?a[a.length-1]:null);return{shortWindow:a.find(r=>r!==s)??null,longWindow:s}}function V(e){return e.capLabel==="100%"&&e.usedLabel.endsWith("%")?e.usedLabel:`${e.usedLabel}/${e.capLabel}`}function N(){return t.jsx("span",{className:"hd-gauge-cell hd-gauge-cell--empty",children:"—"})}function T({window:e}){if(!e)return t.jsx(N,{});const a=Math.round(e.fill*100),s=W(e.fill);return t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.label}),t.jsx("span",{className:"hd-gauge-bar","aria-hidden":"true",children:t.jsx("span",{className:`hd-gauge-bar-fill hd-gauge-bar-fill--${s}`,style:{width:`${a}%`}})}),t.jsx("span",{className:"hd-gauge-window-used",children:V(e)})]})}function R({window:e,now:a,featured:s=!1}){if(!e)return t.jsx(N,{});if(s){const n=P(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset hd-gauge-reset--featured hd-gauge-reset--${n.tone}`,"aria-live":"off","aria-label":n.ariaLabel,children:[t.jsx("strong",{children:n.primary}),n.dateTime?t.jsx("time",{dateTime:n.dateTime,children:n.secondary}):t.jsx("span",{children:n.secondary})]})}const c=A(e.resetAt,a),r=G(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset${c.imminent?" hd-gauge-reset--imminent":""}`,children:["↻ ",r]})}function P(e,a){if(!Number.isFinite(e))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const s=e-a.getTime(),c=new Date(e);if(!Number.isFinite(c.getTime()))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const r=c.toISOString();if(s<=0){const u=Math.abs(s);if(u<=9e4)return{primary:"reset due",secondary:"refreshing…",ariaLabel:"Weekly reset due; refreshing usage",tone:"due",dateTime:r};const x=Math.floor(u/6e4),$=x>=60?`+${Math.floor(x/60)}h ${x%60}m`:`+${Math.max(1,x)}m`;return{primary:u<=360*6e4?"reset due":"stale",secondary:$,ariaLabel:`Weekly reset data ${$} overdue`,tone:u<=360*6e4?"due":"stale",dateTime:r}}const n=Math.floor(s/1e3),l=Math.floor(n/86400),i=Math.floor(n%86400/3600),o=Math.floor(n%3600/60),d=n%60,h=[i,o,d].map(u=>String(u).padStart(2,"0")).join(":"),b=l>0?`${l}d ${h}`:h,m=c.toDateString()===a.toDateString(),f=c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),g=m?`today ${f}`:`${c.toLocaleDateString([],{weekday:"short"})} ${f}`,p=l>0?`${l} ${l===1?"day":"days"} ${i} hours`:`${i} hours ${o} minutes`;return{primary:b,secondary:g,ariaLabel:`Weekly quota resets in ${p}; ${g}`,tone:s<360*6e4?"imminent":"normal",dateTime:r}}function B(e){if(e.length===0)return"";if(e.length===1)return`M ${e[0].x} ${e[0].y}`;const a=[`M ${e[0].x} ${e[0].y}`];for(let s=0;s<e.length-1;s++){const c=e[s-1]??e[s],r=e[s],n=e[s+1],l=e[s+2]??n,i=r.x+(n.x-c.x)/6,o=r.y+(n.y-c.y)/6,d=n.x-(l.x-r.x)/6,h=n.y-(l.y-r.y)/6;a.push(`C ${i} ${o}, ${d} ${h}, ${n.x} ${n.y}`)}return a.join(" ")}function U(e){const a=v.useRef(null),[s,c]=v.useState(e);return v.useLayoutEffect(()=>{const r=a.current;if(!r)return;const n=i=>{const o=Math.round(i);o>0&&c(d=>d===o?d:o)};n(r.getBoundingClientRect().width);const l=new ResizeObserver(i=>{n(i[0]?.contentRect.width??0)});return l.observe(r),()=>l.disconnect()},[]),[a,s]}function X({buckets:e}){const[a,s]=U(372),c=72,r=8,n=54,l=67,i=e.length,o=i<2||e.every(p=>p.count===0),d=Math.max(1,s-4),h={viewBox:`0 0 ${s} ${c}`,style:{width:"100%",height:c,display:"block"}};if(o)return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsx("svg",{...h,children:t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"})})});const b=d/(i-1),m=e.map((p,u)=>({x:u*b,y:n-Math.max(0,Math.min(1,p.value))*(n-r)})),f=B(m),g=`${f} L ${d} ${n} L 0 ${n} Z`;return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsxs("svg",{...h,children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"hrdFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--accent)",stopOpacity:"0.28"}),t.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0.0"})]})}),t.jsx("line",{x1:"0",y1:r,x2:s,y2:r,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:(r+n)/2,x2:s,y2:(r+n)/2,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"}),t.jsx("path",{d:g,fill:"url(#hrdFill)"}),t.jsx("path",{d:f,fill:"none",stroke:"var(--accent)",strokeWidth:"1.75",strokeLinecap:"round"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"3",fill:"var(--accent)"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"6",fill:"var(--accent)",opacity:"0.25"}),t.jsx("text",{x:"0",y:l,fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"7d"}),t.jsx("text",{x:s/2,y:l,textAnchor:"middle",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"3d"}),t.jsx("text",{x:s,y:l,textAnchor:"end",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"now"})]})})}function K({gauge:e,now:a,onClick:s}){const c=s?"button":"span",r=s?{type:"button",onClick:s}:{};if(e.kind==="status")return t.jsxs(c,{className:`hd-gauge hd-gauge--status hd-gauge--${e.tone}${s?" hd-gauge--interactive":""}`,"aria-label":`${e.label} subscription usage`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsx("span",{className:`hd-gauge-dot hd-gauge-dot--${e.tone}`,"aria-hidden":"true"})]}),t.jsx(N,{}),t.jsx(N,{}),t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage hd-gauge-cell--status",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.windowLabel??"usage"}),t.jsx("span",{className:"hd-gauge-status",children:e.statusLabel})]}),t.jsx("span",{className:"hd-gauge-cell hd-gauge-reset",children:e.detailLabel??"quota n/a"})]});const n=w(e),{shortWindow:l,longWindow:i}=Q(n),o=W(Math.max(...n.map(h=>h.fill))),d=Math.round(Math.max(...n.map(h=>h.fill))*100);return t.jsxs(c,{className:`hd-gauge hd-gauge--${o}${s?" hd-gauge--interactive":""}`,title:E(e,a),"aria-label":`${e.label} subscription usage. ${E(e,a)}`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsxs("span",{className:`hd-gauge-pct hd-gauge-pct--${o}`,children:[d,"%"]})]}),t.jsx(T,{window:l}),t.jsx(R,{window:l,now:a}),t.jsx(T,{window:i}),t.jsx(R,{window:i,now:a,featured:!0})]})}function Y(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([kKmM])?$/u);if(!a)return 0;const s=Number(a[1]);if(!Number.isFinite(s))return 0;switch(a[2]?.toLowerCase()){case"m":return s*1e6;case"k":return s*1e3;default:return s}}function Z(e){return e.kind==="quota"?Math.max(e.fill,...w(e).map(a=>a.fill)):Y(e.statusLabel)>0?.01:0}function J(e){return e.kind==="quota"}function ee(e){return C(e).slice(0,I)}function C(e){return e.map((a,s)=>({gauge:a,index:s,score:Z(a)})).sort((a,s)=>s.score-a.score||a.index-s.index).map(({gauge:a})=>a)}function re(e){const{now:a,operatorName:s,syncLabel:c,error:r,loading:n,refreshing:l,onRefresh:i,navigate:o,heartrate:d,heartrateWindow:h,heartrateBucketLabel:b,heartrateVisibleEventThreshold:m=q,serviceGauges:f}=e,[g,p]=v.useState(!1),u=r?"err":"ok",x=f.filter(J),$=C(x),k=ee(x),y=g?$:k,F=x.length>k.length,L=d.reduce((j,D)=>j+D.count,0),M=L>=m;return t.jsxs("section",{className:"hd","aria-label":"Fleet Cockpit and Service Cluster",children:[t.jsxs("div",{className:"hd-vitals-band",children:[t.jsxs("div",{className:"hd-vitals-left",children:[t.jsx("span",{className:"label-sm hd-vitals-title",children:"Fleet Cockpit"}),s&&t.jsx("span",{className:"chip chip--neutral chip--mono chip--sm hd-vitals-callsign",children:s})]}),t.jsxs("div",{className:"hd-vitals-right",children:[r&&t.jsx("span",{className:"dot dot--warning","aria-hidden":"true"}),t.jsx("span",{className:`hd-meta hd-meta--${u}`,children:c}),t.jsx("button",{type:"button",className:"hd-refresh-btn",disabled:n||l,onClick:i,title:"Refresh status (r)","aria-label":l?"Refreshing status":"Refresh status",children:t.jsx(H,{size:11,className:l?"hd-spin":"","aria-hidden":"true"})})]})]}),(y.length>0||M)&&t.jsxs("div",{className:`hd-telemetry-grid ${M&&y.length>0?"hd-telemetry-grid--split":"hd-telemetry-grid--single"}`,children:[y.length>0&&t.jsxs("div",{className:"hd-card hd-card--quotas",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx("span",{className:"label-xs hd-card-title",children:"Subscriptions & Quotas"}),t.jsxs("span",{className:"chip chip--neutral chip--mono chip--sm",children:[y.length," Active"]})]}),F&&t.jsxs("button",{type:"button",className:"hd-gauge-toggle","aria-expanded":g,onClick:()=>p(j=>!j),children:["[",g?"Top 2":`All ${x.length}`,"]"]})]}),t.jsxs("div",{className:"hd-gauge-set",children:[t.jsxs("div",{className:"hd-gauge-table-head label-xs","aria-hidden":"true",children:[t.jsx("span",{children:"Service"}),t.jsx("span",{children:"Short Window"}),t.jsx("span",{children:"Resets"}),t.jsx("span",{children:"Long Window"}),t.jsx("span",{children:"Reset Countdown"})]}),y.map(j=>t.jsx("span",{className:"hd-gauge-wrap",children:t.jsx(K,{gauge:j,now:a,onClick:()=>o({view:"harnesses"})})},j.id))]})]}),M&&t.jsxs("div",{className:"hd-card hd-card--heartrate",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx(_,{size:12,className:"hd-heartrate-icon","aria-hidden":"true"}),t.jsx("span",{className:"label-xs hd-card-title",children:"Fleet Velocity"})]}),t.jsxs("div",{className:"hd-card-head-right",children:[t.jsxs("span",{className:"label-xs hd-card-sub",children:[h," ",b?`· ${b}`:""]}),t.jsxs("span",{className:"chip chip--working chip--mono chip--sm",children:[L," ",L===1?"Event":"Events"]})]})]}),t.jsx("div",{className:"hd-heartrate-plot-body",children:t.jsx(X,{buckets:d})})]})]})]})}export{re as default};
1
+ import{r as v,j as t}from"./index-C8uS5szO.js";import{R as H}from"./refresh-cw-Da9DDLk2.js";import{A as _}from"./activity-CSUhvjD0.js";import"./createLucideIcon-DkjnzvcJ.js";const q=3,I=2;function W(e){return e>=.9?"err":e>=.75?"warn":"ok"}const O=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function A(e,a){const s=e-a.getTime(),c=new Date(e).toDateString()===a.toDateString(),r=new Date(e),n=String(r.getHours()).padStart(2,"0"),l=String(r.getMinutes()).padStart(2,"0"),i=s>0&&s<6*3600*1e3;return c?{label:`${n}:${l}`,imminent:i}:{label:`${O[r.getDay()]} ${n}:${l}`,imminent:i}}function G(e,a){const s=Math.floor((e-a.getTime())/1e3),c=s<0,r=Math.abs(s);let n;if(r>=86400){const l=Math.floor(r/86400),i=Math.floor(r%86400/3600);n=i>0?`${l}d ${i}h`:`${l}d`}else if(r>=3600){const l=Math.floor(r/3600),i=Math.floor(r%3600/60);n=i>0?`${l}h ${i}m`:`${l}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return c?`stale ${n}`:n}function w(e){return e.windows&&e.windows.length>0?e.windows:[{label:z(e.unitLabel),fill:e.fill,usedLabel:e.usedLabel,capLabel:e.capLabel,unitLabel:e.unitLabel,resetAt:e.resetAt}]}function z(e){switch(e){case"weekly":return"7d";case"req/h":return"1h";default:return e||"quota"}}function E(e,a){return w(e).map(s=>{const c=A(s.resetAt,a),r=G(s.resetAt,a);return`${s.label}: ${s.usedLabel} / ${s.capLabel} ${s.unitLabel} · resets ${c.label} (in ${r})`}).join(" · ")}function S(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([mhd])$/i);if(!a)return null;const s=Number(a[1]);if(!Number.isFinite(s))return null;switch(a[2]?.toLowerCase()){case"m":return s;case"h":return s*60;case"d":return s*24*60;default:return null}}function Q(e){const a=[...e].sort((r,n)=>(S(r.label)??Number.MAX_SAFE_INTEGER)-(S(n.label)??Number.MAX_SAFE_INTEGER)),s=a.find(r=>(S(r.label)??0)>=1440)??(a.length>1?a[a.length-1]:null);return{shortWindow:a.find(r=>r!==s)??null,longWindow:s}}function V(e){return e.capLabel==="100%"&&e.usedLabel.endsWith("%")?e.usedLabel:`${e.usedLabel}/${e.capLabel}`}function N(){return t.jsx("span",{className:"hd-gauge-cell hd-gauge-cell--empty",children:"—"})}function T({window:e}){if(!e)return t.jsx(N,{});const a=Math.round(e.fill*100),s=W(e.fill);return t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.label}),t.jsx("span",{className:"hd-gauge-bar","aria-hidden":"true",children:t.jsx("span",{className:`hd-gauge-bar-fill hd-gauge-bar-fill--${s}`,style:{width:`${a}%`}})}),t.jsx("span",{className:"hd-gauge-window-used",children:V(e)})]})}function R({window:e,now:a,featured:s=!1}){if(!e)return t.jsx(N,{});if(s){const n=P(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset hd-gauge-reset--featured hd-gauge-reset--${n.tone}`,"aria-live":"off","aria-label":n.ariaLabel,children:[t.jsx("strong",{children:n.primary}),n.dateTime?t.jsx("time",{dateTime:n.dateTime,children:n.secondary}):t.jsx("span",{children:n.secondary})]})}const c=A(e.resetAt,a),r=G(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset${c.imminent?" hd-gauge-reset--imminent":""}`,children:["↻ ",r]})}function P(e,a){if(!Number.isFinite(e))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const s=e-a.getTime(),c=new Date(e);if(!Number.isFinite(c.getTime()))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const r=c.toISOString();if(s<=0){const u=Math.abs(s);if(u<=9e4)return{primary:"reset due",secondary:"refreshing…",ariaLabel:"Weekly reset due; refreshing usage",tone:"due",dateTime:r};const x=Math.floor(u/6e4),$=x>=60?`+${Math.floor(x/60)}h ${x%60}m`:`+${Math.max(1,x)}m`;return{primary:u<=360*6e4?"reset due":"stale",secondary:$,ariaLabel:`Weekly reset data ${$} overdue`,tone:u<=360*6e4?"due":"stale",dateTime:r}}const n=Math.floor(s/1e3),l=Math.floor(n/86400),i=Math.floor(n%86400/3600),o=Math.floor(n%3600/60),d=n%60,h=[i,o,d].map(u=>String(u).padStart(2,"0")).join(":"),b=l>0?`${l}d ${h}`:h,m=c.toDateString()===a.toDateString(),f=c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),g=m?`today ${f}`:`${c.toLocaleDateString([],{weekday:"short"})} ${f}`,p=l>0?`${l} ${l===1?"day":"days"} ${i} hours`:`${i} hours ${o} minutes`;return{primary:b,secondary:g,ariaLabel:`Weekly quota resets in ${p}; ${g}`,tone:s<360*6e4?"imminent":"normal",dateTime:r}}function B(e){if(e.length===0)return"";if(e.length===1)return`M ${e[0].x} ${e[0].y}`;const a=[`M ${e[0].x} ${e[0].y}`];for(let s=0;s<e.length-1;s++){const c=e[s-1]??e[s],r=e[s],n=e[s+1],l=e[s+2]??n,i=r.x+(n.x-c.x)/6,o=r.y+(n.y-c.y)/6,d=n.x-(l.x-r.x)/6,h=n.y-(l.y-r.y)/6;a.push(`C ${i} ${o}, ${d} ${h}, ${n.x} ${n.y}`)}return a.join(" ")}function U(e){const a=v.useRef(null),[s,c]=v.useState(e);return v.useLayoutEffect(()=>{const r=a.current;if(!r)return;const n=i=>{const o=Math.round(i);o>0&&c(d=>d===o?d:o)};n(r.getBoundingClientRect().width);const l=new ResizeObserver(i=>{n(i[0]?.contentRect.width??0)});return l.observe(r),()=>l.disconnect()},[]),[a,s]}function X({buckets:e}){const[a,s]=U(372),c=72,r=8,n=54,l=67,i=e.length,o=i<2||e.every(p=>p.count===0),d=Math.max(1,s-4),h={viewBox:`0 0 ${s} ${c}`,style:{width:"100%",height:c,display:"block"}};if(o)return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsx("svg",{...h,children:t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"})})});const b=d/(i-1),m=e.map((p,u)=>({x:u*b,y:n-Math.max(0,Math.min(1,p.value))*(n-r)})),f=B(m),g=`${f} L ${d} ${n} L 0 ${n} Z`;return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsxs("svg",{...h,children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"hrdFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--accent)",stopOpacity:"0.28"}),t.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0.0"})]})}),t.jsx("line",{x1:"0",y1:r,x2:s,y2:r,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:(r+n)/2,x2:s,y2:(r+n)/2,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"}),t.jsx("path",{d:g,fill:"url(#hrdFill)"}),t.jsx("path",{d:f,fill:"none",stroke:"var(--accent)",strokeWidth:"1.75",strokeLinecap:"round"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"3",fill:"var(--accent)"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"6",fill:"var(--accent)",opacity:"0.25"}),t.jsx("text",{x:"0",y:l,fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"7d"}),t.jsx("text",{x:s/2,y:l,textAnchor:"middle",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"3d"}),t.jsx("text",{x:s,y:l,textAnchor:"end",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"now"})]})})}function K({gauge:e,now:a,onClick:s}){const c=s?"button":"span",r=s?{type:"button",onClick:s}:{};if(e.kind==="status")return t.jsxs(c,{className:`hd-gauge hd-gauge--status hd-gauge--${e.tone}${s?" hd-gauge--interactive":""}`,"aria-label":`${e.label} subscription usage`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsx("span",{className:`hd-gauge-dot hd-gauge-dot--${e.tone}`,"aria-hidden":"true"})]}),t.jsx(N,{}),t.jsx(N,{}),t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage hd-gauge-cell--status",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.windowLabel??"usage"}),t.jsx("span",{className:"hd-gauge-status",children:e.statusLabel})]}),t.jsx("span",{className:"hd-gauge-cell hd-gauge-reset",children:e.detailLabel??"quota n/a"})]});const n=w(e),{shortWindow:l,longWindow:i}=Q(n),o=W(Math.max(...n.map(h=>h.fill))),d=Math.round(Math.max(...n.map(h=>h.fill))*100);return t.jsxs(c,{className:`hd-gauge hd-gauge--${o}${s?" hd-gauge--interactive":""}`,title:E(e,a),"aria-label":`${e.label} subscription usage. ${E(e,a)}`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsxs("span",{className:`hd-gauge-pct hd-gauge-pct--${o}`,children:[d,"%"]})]}),t.jsx(T,{window:l}),t.jsx(R,{window:l,now:a}),t.jsx(T,{window:i}),t.jsx(R,{window:i,now:a,featured:!0})]})}function Y(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([kKmM])?$/u);if(!a)return 0;const s=Number(a[1]);if(!Number.isFinite(s))return 0;switch(a[2]?.toLowerCase()){case"m":return s*1e6;case"k":return s*1e3;default:return s}}function Z(e){return e.kind==="quota"?Math.max(e.fill,...w(e).map(a=>a.fill)):Y(e.statusLabel)>0?.01:0}function J(e){return e.kind==="quota"}function ee(e){return C(e).slice(0,I)}function C(e){return e.map((a,s)=>({gauge:a,index:s,score:Z(a)})).sort((a,s)=>s.score-a.score||a.index-s.index).map(({gauge:a})=>a)}function re(e){const{now:a,operatorName:s,syncLabel:c,error:r,loading:n,refreshing:l,onRefresh:i,navigate:o,heartrate:d,heartrateWindow:h,heartrateBucketLabel:b,heartrateVisibleEventThreshold:m=q,serviceGauges:f}=e,[g,p]=v.useState(!1),u=r?"err":"ok",x=f.filter(J),$=C(x),k=ee(x),y=g?$:k,F=x.length>k.length,L=d.reduce((j,D)=>j+D.count,0),M=L>=m;return t.jsxs("section",{className:"hd","aria-label":"Fleet Cockpit and Service Cluster",children:[t.jsxs("div",{className:"hd-vitals-band",children:[t.jsxs("div",{className:"hd-vitals-left",children:[t.jsx("span",{className:"label-sm hd-vitals-title",children:"Fleet Cockpit"}),s&&t.jsx("span",{className:"chip chip--neutral chip--mono chip--sm hd-vitals-callsign",children:s})]}),t.jsxs("div",{className:"hd-vitals-right",children:[r&&t.jsx("span",{className:"dot dot--warning","aria-hidden":"true"}),t.jsx("span",{className:`hd-meta hd-meta--${u}`,children:c}),t.jsx("button",{type:"button",className:"hd-refresh-btn",disabled:n||l,onClick:i,title:"Refresh status (r)","aria-label":l?"Refreshing status":"Refresh status",children:t.jsx(H,{size:11,className:l?"hd-spin":"","aria-hidden":"true"})})]})]}),(y.length>0||M)&&t.jsxs("div",{className:`hd-telemetry-grid ${M&&y.length>0?"hd-telemetry-grid--split":"hd-telemetry-grid--single"}`,children:[y.length>0&&t.jsxs("div",{className:"hd-card hd-card--quotas",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx("span",{className:"label-xs hd-card-title",children:"Subscriptions & Quotas"}),t.jsxs("span",{className:"chip chip--neutral chip--mono chip--sm",children:[y.length," Active"]})]}),F&&t.jsxs("button",{type:"button",className:"hd-gauge-toggle","aria-expanded":g,onClick:()=>p(j=>!j),children:["[",g?"Top 2":`All ${x.length}`,"]"]})]}),t.jsxs("div",{className:"hd-gauge-set",children:[t.jsxs("div",{className:"hd-gauge-table-head label-xs","aria-hidden":"true",children:[t.jsx("span",{children:"Service"}),t.jsx("span",{children:"Short Window"}),t.jsx("span",{children:"Resets"}),t.jsx("span",{children:"Long Window"}),t.jsx("span",{children:"Reset Countdown"})]}),y.map(j=>t.jsx("span",{className:"hd-gauge-wrap",children:t.jsx(K,{gauge:j,now:a,onClick:()=>o({view:"harnesses"})})},j.id))]})]}),M&&t.jsxs("div",{className:"hd-card hd-card--heartrate",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx(_,{size:12,className:"hd-heartrate-icon","aria-hidden":"true"}),t.jsx("span",{className:"label-xs hd-card-title",children:"Fleet Velocity"})]}),t.jsxs("div",{className:"hd-card-head-right",children:[t.jsxs("span",{className:"label-xs hd-card-sub",children:[h," ",b?`· ${b}`:""]}),t.jsxs("span",{className:"chip chip--working chip--mono chip--sm",children:[L," ",L===1?"Event":"Events"]})]})]}),t.jsx("div",{className:"hd-heartrate-plot-body",children:t.jsx(X,{buckets:d})})]})]})]})}export{re as default};
@@ -0,0 +1 @@
1
+ import{r as c,j as s}from"./index-C8uS5szO.js";/* empty css */import{H as ds}from"./HarnessMark-Bt47OeHy.js";import{a as b}from"./api-CaROe5_H.js";import{u as hs}from"./sse-v5QLsOHV.js";import{t as C}from"./time-Dhsh_2EG.js";import{C as ms}from"./compass-DTZdCpv9.js";import{F as us}from"./file-text-ChtICwub.js";import{L as ps}from"./layout-grid-DI9tVJ2E.js";import{R as xs}from"./refresh-cw-Da9DDLk2.js";import{A as H}from"./arrow-up-right-Hn754ybA.js";import{C as Ns}from"./cpu-Ck_4tB_-.js";import{G as fs,D as js}from"./gauge-Dgtfxf_o.js";import{c as gs}from"./createLucideIcon-DkjnzvcJ.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 Js({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{Js as HostAdvisorView};
@@ -0,0 +1 @@
1
+ import{r as t,j as e}from"./index-C8uS5szO.js";/* empty css */import{a as re}from"./api-CaROe5_H.js";import{J as te,ax as ae,ay as A,I as ie,az as ce,aA as de,aB as B,aC as oe,aD as J,aE as le,aF as he,aG as pe,P as ue}from"./router-BKiMcYa7.js";import{u as xe}from"./Provider-5Hotn7NQ.js";import{c as P}from"./createLucideIcon-DkjnzvcJ.js";import{X as me}from"./x-DI1ktCYb.js";import{C as V}from"./check-B8dMv3Is.js";import{C as D}from"./copy-D9WUpQRf.js";import{E as je}from"./external-link-RT4Ph-6-.js";import{L as fe}from"./loader-circle-DurUYl7E.js";const ye=[["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"}]],ve=P("file-braces",ye);const ge=[["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",ge);const ke=[["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"}]],we=P("radio-tower",ke);function N({text:i,query:n}){return e.jsx(e.Fragment,{children:ue(i,n).map((h,c)=>h.match?e.jsx("mark",{children:h.text},c):e.jsx("span",{children:h.text},c))})}function U(i){return i.renderedText||i.summary||i.raw}function be({record:i,role:n,query:h,expanded:c,onToggle:w}){const j=t.useRef(null),[b,f]=t.useState(!1),u=U(i),y=t.useCallback(()=>{const d=j.current;!d||c||f(d.scrollHeight>d.clientHeight+1)},[c]);return t.useEffect(()=>{y();const d=j.current;if(!d||c||typeof ResizeObserver>"u")return;const v=new ResizeObserver(y);return v.observe(d),()=>v.disconnect()},[c,y,h,u]),e.jsxs("article",{className:`ks-excerpt-turn${i.matched?" ks-excerpt-turn--matched":""}`,children:[e.jsxs("header",{children:[e.jsx("span",{children:String(i.index).padStart(4,"0")}),e.jsx("strong",{children:n}),i.matched?e.jsx("em",{children:"match"}):null]}),e.jsx("p",{ref:j,className:c?"is-expanded":void 0,children:e.jsx(N,{text:u,query:h})}),b?e.jsx("button",{type:"button",className:"ks-excerpt-turn-expand","aria-expanded":c,onClick:w,children:c?"Collapse turn":"Show full turn"}):null]})}function X({navigate:i}={}){const{selectedKnowledgeHit:n,selectedKnowledgeQuery:h,clearKnowledgeHit:c,openFilePreview:w,navigate:j}=xe(),b=i??j,[f,u]=t.useState(null),[y,d]=t.useState(!1),[v,_]=t.useState(null),[W,I]=t.useState(!1),[C,M]=t.useState(!1),[Y,K]=t.useState({}),[Z,$]=t.useState({}),o=f&&f.hitId===n?.id?f.value:null,r=n?te(n):null,g=n?ae(n):null,F=n?A(n,"project"):"",L=n?A(n,"harness"):"",p=h.trim(),z=ie(r),T=ce(r),q=r?.path??g?.path,x=n?de(n):"",E=t.useMemo(()=>o?.records.filter(s=>s.matched).sort((s,l)=>{const a=B(s)-B(l);return a!==0?a:(l.matchCount??0)-(s.matchCount??0)}).at(0)??null,[o]),R=t.useMemo(()=>oe(o?.records??[],{contextRadius:4,maxTurns:6,centerRecordIndex:E?.index}),[o,E?.index]),O=t.useMemo(()=>{const s=R.flatMap(l=>l.kind==="turn"?[l.record.index]:l.records.map(a=>a.index));return s.length>0?[Math.min(...s),Math.max(...s)]:null},[R]),ee=o?.records.find(s=>s.matched)?.index??r?.recordRange?.[0];t.useEffect(()=>{K({}),$({}),M(!1),I(!1)},[n?.id]),t.useEffect(()=>{let s=!1;return(async()=>{if(u(null),_(null),!n||!r){d(!1);return}d(!0);try{const a=await re("/api/knowledge/source-preview",{method:"POST",body:JSON.stringify({sourceRef:r,contextRecords:4,maxRecords:80,q:p})});s||u({hitId:n.id,value:a})}catch(a){s||(u(null),_(a instanceof Error?a.message:String(a)))}finally{s||d(!1)}})(),()=>{s=!0}},[n?.id,r?.recordRange?.[0],r?.recordRange?.[1],p]);const se=t.useCallback(()=>{const s=r??g;s&&w(J(s.path))},[r,g,w]),H=t.useCallback(async()=>{if(x)try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(x);else if(typeof document<"u"){const s=document.createElement("textarea");s.value=x,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{}},[x]);return e.jsxs("div",{className:"ks-inspector",children:[v?e.jsx("div",{className:"ks-inspector-error",role:"alert",children:v}):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:c,className:"ks-preview-close",children:e.jsx(me,{size:14,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"ks-preview-meta",children:[F?e.jsx("span",{children:F}):null,L?e.jsx("span",{children:L}):null,n.freshness&&n.freshness!=="unknown"&&e.jsx("span",{children:n.freshness}),r?.recordRange?e.jsxs("span",{children:["records ",r.recordRange[0],"..",r.recordRange[1]]}):null]}),z||T||r||g||x?e.jsxs("div",{className:"ks-preview-actions","aria-label":"Selected result actions",children:[z?e.jsxs("button",{type:"button",className:"ks-action-primary",onClick:()=>b({view:"sessions",sessionId:z}),children:[e.jsx(G,{size:13,"aria-hidden":"true"}),"Open conversation"]}):null,T?e.jsxs("button",{type:"button",onClick:()=>b({view:"ops",mode:"tail",tailQuery:T}),children:[e.jsx(we,{size:13,"aria-hidden":"true"}),"Observe window"]}):null,x?e.jsxs("button",{type:"button",onClick:()=>{H()},children:[C?e.jsx(V,{size:13,"aria-hidden":"true"}):e.jsx(D,{size:13,"aria-hidden":"true"}),C?"Copied":"Copy ref"]}):null,r||g?e.jsxs("button",{type:"button",onClick:se,children:[e.jsx(je,{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:le(n,p,E)}),e.jsx("em",{children:he(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]})]}),y?e.jsxs("div",{className:"ks-preview-loading",children:[e.jsx(fe,{size:15,className:"ks-spin","aria-hidden":"true"}),"Loading conversation…"]}):R.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]}),R.map((s,l)=>{if(s.kind==="folded"){const k=s.records[0]?.index??l,S=Y[k]===!0;return e.jsxs("div",{className:"ks-excerpt-fold",children:[e.jsxs("button",{type:"button",className:"ks-excerpt-fold-toggle","aria-expanded":S,onClick:()=>K(m=>({...m,[k]:!S})),children:[e.jsx("span",{"aria-hidden":"true",children:S?"▾":"▸"}),s.summary]}),S?e.jsx("div",{className:"ks-excerpt-fold-body",children:s.records.map(m=>e.jsxs("article",{className:"ks-excerpt-turn ks-excerpt-turn--muted",children:[e.jsxs("header",{children:[e.jsx("span",{children:String(m.index).padStart(4,"0")}),e.jsx("strong",{children:pe(m)})]}),e.jsx("p",{tabIndex:0,children:e.jsx(N,{text:U(m),query:p})})]},`fold-record:${m.index}`))}):null]},`fold:${k}`)}const{record:a,role:ne}=s,Q=Z[a.index]===!0;return e.jsx(be,{record:a,role:ne,query:p,expanded:Q,onToggle:()=>$(k=>({...k,[a.index]:!Q}))},`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(N,{text:n.snippet,query:p})})]}),q?e.jsxs("div",{className:"ks-preview-source",children:[e.jsx("span",{children:"Source"}),e.jsx("code",{children:J(q)}),e.jsxs("button",{type:"button",onClick:()=>{H()},"aria-label":"Copy source reference",children:[C?e.jsx(V,{size:12,"aria-hidden":"true"}):e.jsx(D,{size:12,"aria-hidden":"true"}),C?"Copied":"Copy ref"]})]}):null,o?e.jsxs("details",{className:"ks-jsonl-window",open:W,onToggle:s=>I(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 ",o.previewRange[0],"..",o.previewRange[1]]})]}),o.records.map(s=>e.jsxs("details",{className:`ks-jsonl-record${s.matched?" ks-jsonl-record--matched":""}`,open:s.index===ee,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(N,{text:s.summary||"no summary",query:p})})]}),e.jsx("pre",{children:s.raw})]},`${o.path}:${s.index}`))]}):null]}):e.jsxs("div",{className:"ks-inspector-empty",children:[e.jsx(ve,{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 Ie=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"})),Ke=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"}));export{X as K,Ke as a,Ie as r};
@@ -0,0 +1 @@
1
+ import{r,j as e}from"./index-C8uS5szO.js";/* empty css */import{a as _}from"./api-CaROe5_H.js";import{d as Pe}from"./time-Dhsh_2EG.js";import{u as We}from"./Provider-5Hotn7NQ.js";import{v as $e,x as Se,y as Oe,z as _e,A as Ue,B as Ne,K as k,C as ze,D as Fe,E as Be,G as Ge,H as Je,I as be,J as we,L as Xe,M as Qe,N as Ve,O as Ye,P as Ze,Q as es}from"./router-BKiMcYa7.js";import{S as ss}from"./search-C4VlW_0l.js";import{X as ts}from"./x-DI1ktCYb.js";import{L as ve}from"./loader-circle-DurUYl7E.js";import{c as ns}from"./createLucideIcon-DkjnzvcJ.js";import{S as as}from"./sparkles-BbOFw3d0.js";import{C as is}from"./chevron-down-B5eMsn5c.js";import{C as rs}from"./clock-DFcRbtrl.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./conversation-model-BGFHoxQ0.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";const ls=[["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"}]],os=ns("funnel",ls);function cs(t){return!!t.query.trim()&&t.hasIndex&&t.filterKey!==t.settledFilterKey&&t.filterKey!==t.failedFilterKey}const us=5*6e4;function y(t){return $e(t).toString()}let ae={status:null,results:[],lastFilterKey:"",facets:null,indexedAt:null};function Ce(){return ae}function I(t){ae={...ae,...t}}const ds=220;function N(t){return new Intl.NumberFormat("en-US").format(t||0)}function hs({text:t,query:a}){return e.jsx(e.Fragment,{children:Ze(t,a).map((c,u)=>c.match?e.jsx("mark",{children:c.text},u):e.jsx("span",{children:c.text},u))})}function ms(t,a){t.target===t.currentTarget&&(t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),a()))}async function ps(){return _("/api/knowledge/status")}async function fs(t){const a=new URLSearchParams;for(const c of t)a.append("key",c);return a.set("limit","200"),_(`/api/knowledge/search-primitives?${a.toString()}`)}async function ne(t,a){const c=new URLSearchParams({q:t,limit:String(k.hitLimit)});if(a.sourceKinds.length>0)for(const m of a.sourceKinds)c.append("sourceKind",m);for(const m of a.harness)c.append("harness",m);for(const m of a.project)c.append("project",m);const u=Ye(a.timeWindow);return u!=null&&c.set("updatedAfterMs",String(u)),_(`/api/knowledge/search?${c.toString()}`)}async function Ke(t=!1){return _("/api/knowledge/sessions/index",{method:"POST",body:JSON.stringify({days:k.days,limit:k.sessionLimit,force:t})})}const ks=Be;function R({active:t,onClick:a,count:c,label:u,ariaLabel:m}){return e.jsxs("button",{type:"button",className:`ks-chip${t?" ks-chip--active":""}`,onClick:a,"aria-pressed":t,"aria-label":m??u,children:[e.jsx("span",{className:"ks-chip-label",children:u}),typeof c=="number"?e.jsx("span",{className:"ks-chip-count","aria-hidden":"true",children:N(c)}):null]})}function qe(t){return t&&t.split(/[\s_-]+/u).filter(a=>a.length>0).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Ee(t,a,c=6){return t?t.filter(u=>u.key===a&&u.value.length>0).sort((u,m)=>m.count-u.count||u.value.localeCompare(m.value)).slice(0,c):[]}function Ae(t){return t.sourceKinds.length>0||t.harness.length>0||t.project.length>0||t.timeWindow!=="all"}function xs(t){const a=[];return t.sourceKinds.length>0&&a.push(t.sourceKinds.map(c=>Fe[c]??c).join(" + ")),t.harness.length>0&&a.push(t.harness.map(qe).join(" + ")),t.project.length>0&&a.push(t.project.join(" + ")),t.timeWindow!=="all"&&a.push(es(t.timeWindow)),a.length>0?`Filters: ${a.join(" · ")}`:""}function ct({navigate:t,mode:a,hitId:c,routeFilters:u}){const{selectedKnowledgeHit:m,inspectKnowledgeHit:b,clearKnowledgeHit:E}=We(),D=r.useMemo(()=>u||(typeof window>"u"?Se():Oe(window.location.search)),[u]),[g]=r.useState(()=>Ce()),[q,H]=r.useState(g.status),[ie,Le]=r.useState(g.facets),[i,U]=r.useState(D),[A,re]=r.useState(()=>g.lastFilterKey&&g.lastFilterKey===y(D)?g.results:[]),[z,B]=r.useState(!1),[le,oe]=r.useState(!1),[Te,ce]=r.useState(()=>g.lastFilterKey===y(D)?y(D):null),[G,M]=r.useState(null),J=r.useRef(0),[L,P]=r.useState(!1),[X,w]=r.useState(null),[Ie,W]=r.useState(g.status!==null),[ue,de]=r.useState(g.facets!==null),v=r.useRef(i);v.current=i;const f=(q?.chunks??0)>0,$=q?.activeJobs[0]??null,C=r.useMemo(()=>_e(A),[A]),he=L||!!$,K=i.query.trim(),Q=y(i),me=cs({query:K,hasIndex:f,filterKey:Q,settledFilterKey:Te,failedFilterKey:G}),V=!!K&&(me||z),Y=Ue(i);r.useEffect(()=>{u&&U(s=>Ne(s,u)?s:u)},[u]);const x=r.useMemo(()=>{const s=[];for(const n of C)s.push(...n.moments);return s},[C]),F=r.useCallback((s,n)=>{const l=y(s);if(l!==y(v.current))return;re(n.hits),ce(l),M(null),H(n.status),I({results:n.hits,status:n.status,lastFilterKey:y(s)});const o=(c?n.hits.find(d=>d.id===c):void 0)??n.hits[0];o?b(o,s.query,s):E()},[c,b,E]),Z=r.useCallback(async s=>{const n=++J.current,l=y(s),h=()=>n===J.current&&l===y(v.current),o=s.query.trim();if(!o){re([]),ce(l),M(null),B(!1),E();return}B(!0),M(null);try{w(null);const d=await ne(o,s);h()&&F(s,d)}catch(d){h()&&(M(l),w(d instanceof Error?d.message:String(d)))}finally{n===J.current&&B(!1)}},[F,E]),pe=r.useCallback(async(s=!1)=>{P(!0);try{w(null);const n=await Ke(s);H(n.status),W(!0),I({status:n.status,indexedAt:Date.now()});const l=v.current;n.status.chunks>0&&l.query.trim()&&F(l,await ne(l.query.trim(),l))}catch(n){w(n instanceof Error?n.message:String(n))}finally{P(!1)}},[F]);r.useEffect(()=>{let s=!1;return(async()=>{let n=null;try{const o=await ps();if(s)return;n=o,H(o),W(!0),I({status:o}),w(null)}catch{}if(s)return;const{indexedAt:l}=Ce();if(!(l!==null&&Date.now()-l<us&&(n?.chunks??0)>0)){P(!0);try{w(null);const o=await Ke(!1);if(s)return;H(o.status),W(!0),I({status:o.status,indexedAt:Date.now()});const d=v.current;o.status.chunks>0&&d.query.trim()&&F(d,await ne(d.query.trim(),d))}catch(o){s||(w(o instanceof Error?o.message:String(o)),W(!0))}finally{s||P(!1)}}})(),()=>{s=!0}},[F]),r.useEffect(()=>{if(!f||ue)return;let s=!1;return(async()=>{try{const n=await fs(["harness","project","sourceKind"]);s||(Le(n),de(!0),I({facets:n}))}catch{s||de(!0)}})(),()=>{s=!0}},[f,ue]),r.useEffect(()=>{if(!V){oe(!1);return}const s=window.setTimeout(()=>oe(!0),ds);return()=>window.clearTimeout(s)},[V]),r.useEffect(()=>{if(!f)return;const s=window.setTimeout(()=>{Z(i)},k.debounceMs);return()=>window.clearTimeout(s)},[i,f,Z]);const Re=s=>{if(s.preventDefault(),!f&&!L){pe(!1);return}Z(i)},S=r.useCallback(s=>{U(n=>{const l={...n,...s};return Ne(n,l)?n:(t({view:"search",...a?{mode:a}:{},filters:l},{replace:!0}),l)})},[a,t]),T=r.useCallback(()=>{const s=Se();U(s),t({view:"search",...a?{mode:a}:{},filters:s},{replace:!0})},[a,t]),De=r.useCallback(()=>{x[0]&&b(x[0],v.current.query)},[x,b]);r.useEffect(()=>{function s(n){const l=n.target,h=l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable);if(n.key==="/"&&!h){n.preventDefault();const o=document.querySelector(".ks-search-input");o?.focus(),o?.select()}else if(n.key==="Escape"&&!h)x.length>0?E():T();else if(!h&&(n.key==="j"||n.key==="k")){if(x.length===0)return;n.preventDefault();const o=m?x.findIndex(ee=>ee.id===m.id):-1,d=n.key==="j"?Math.min(x.length-1,o+1):Math.max(0,o-1),O=x[d];O&&b(O,v.current.query)}}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[x,b,E,m,T]);const He=q?Pe(q.generatedAt)||"just now":"—",Me=he?$?`Indexing ${N($.progress.indexed??0)} of ${N($.progress.discovered??0)}`:f?`Refreshing last ${k.days} days in the background`:`Building last ${k.days} days of sessions`:f?`${N(q?.chunks??0)} moments · last ${k.days} days · updated ${He}`:Ie?"No index yet":"Loading index",fe=Ee(ie?.facets,"harness"),ke=Ee(ie?.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 ",k.days," days."]})]})}),e.jsxs("form",{className:"ks-search-form",onSubmit:Re,role:"search",children:[e.jsx(ss,{size:17,strokeWidth:1.75,"aria-hidden":"true"}),e.jsx("input",{value:i.query,onChange:s=>S({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:()=>S({query:""}),"aria-label":"Clear search",children:e.jsx(ts,{size:14,"aria-hidden":"true"})}):e.jsx("span",{className:"ks-search-hint","aria-hidden":"true",children:"/"}),le?e.jsx(ve,{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(os,{size:12,"aria-hidden":"true"}),"Source"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Source kind filters",children:ze.map(s=>e.jsx(R,{active:i.sourceKinds.includes(s),onClick:()=>S({sourceKinds:i.sourceKinds.includes(s)?i.sourceKinds.filter(n=>n!==s):[...i.sourceKinds,s]}),label:Fe[s]??s},s))})]}),fe.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(as,{size:12,"aria-hidden":"true"}),"Agent"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Harness filters",children:fe.map(s=>e.jsx(R,{active:i.harness.includes(s.value),onClick:()=>S({harness:i.harness.includes(s.value)?i.harness.filter(n=>n!==s.value):[...i.harness,s.value]}),label:qe(s.value),count:s.count},`harness:${s.value}`))})]}):null,ke.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(is,{size:12,"aria-hidden":"true"}),"Project"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Project filters",children:ke.map(s=>e.jsx(R,{active:i.project.includes(s.value),onClick:()=>S({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(rs,{size:12,"aria-hidden":"true"}),"Time"]}),e.jsxs("div",{className:"ks-chip-row",role:"group","aria-label":"Time window filter",children:[e.jsx(R,{active:i.timeWindow==="all",onClick:()=>S({timeWindow:"all"}),label:"Any time"}),ks.map(s=>e.jsx(R,{active:i.timeWindow===s.value,onClick:()=>S({timeWindow:s.value}),label:s.label},s.value))]}),Ae(i)?e.jsx("button",{type:"button",className:"ks-clear-all",onClick:T,children:"Clear filters"}):null]})]}),X?e.jsx("section",{className:"ks-error",role:"alert",children:X}):null,!f&&!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 ",k.days," days"," ","(up to ",N(k.sessionLimit)," sessions). You can keep this page open — results appear as soon as the index is ready."]})]}):null,f?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:G===Q?"Search failed":V?"Searching…":K?`${N(C.length)} session${C.length===1?"":"s"}`:"Ready"}),K&&A.length>0?e.jsxs("span",{className:"ks-hit-list-meta",children:[N(A.length)," moment",A.length===1?"":"s",Y?e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"ks-text-action",onClick:T,children:"Clear filters"})]}):null]}):null]}),le&&C.length===0?e.jsx("div",{className:"ks-skeleton","aria-hidden":"true",children:[0,1,2].map(s=>e.jsxs("section",{className:"ks-skeleton-session",children:[e.jsx("span",{className:"ks-skeleton-line ks-skeleton-line--meta"}),e.jsx("span",{className:"ks-skeleton-line ks-skeleton-line--goal"}),e.jsxs("div",{className:"ks-skeleton-moments",children:[e.jsx("span",{className:"ks-skeleton-line ks-skeleton-line--title"}),e.jsx("span",{className:"ks-skeleton-line ks-skeleton-line--snippet"}),e.jsx("span",{className:"ks-skeleton-line ks-skeleton-line--snippet-short"})]})]},s))}):null,K&&C.length===0&&!me&&!z&&G!==Q?e.jsxs("div",{className:"ks-empty-hit",children:[e.jsxs("strong",{children:["No matches for “",K,"”"]}),e.jsxs("span",{children:["Try a project name, file path, or topic from recent work",Y?", 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:()=>S({query:""}),children:"Clear query"}),Y?e.jsx("button",{type:"button",className:"ks-text-action",onClick:T,children:"Clear all filters"}):null]})]}):null,K?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:De,disabled:A.length===0,children:"Pick the first result automatically"})]}),e.jsx("div",{className:"ks-hit-list-body","aria-busy":z,children:C.map((s,n)=>{const l=s.best,h=Ge(l),o=Je(l),d=be(we(l)),O=()=>{d&&t({view:"sessions",sessionId:d})},ee=s.moments.some(j=>m?.id===j.id);return e.jsxs("section",{className:`ks-session${ee?" 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:[h.agent?e.jsx("span",{className:"ks-hit-chip",children:h.agent}):null,h.project?e.jsx("span",{children:h.project}):null,h.session?e.jsxs("span",{className:"ks-hit-session",title:d??h.session,children:["session ",h.session]}):null,e.jsxs("span",{className:"ks-session-count",children:[N(s.moments.length)," match",s.moments.length===1?"":"es"]})]}),h.when?e.jsx("time",{className:"ks-hit-when",children:h.when}):null]}),e.jsx("button",{type:"button",className:"ks-session-goal",onClick:O,title:d?"Open session":void 0,children:o})]}),e.jsx("div",{className:"ks-session-moments",children:s.moments.map(j=>{const xe=Xe(j,i.query),je=m?.id===j.id,se=Qe(j,i.query,200),ye=Ve(j),te=()=>b(j,i.query),ge=()=>{const p=be(we(j))??d;if(!p){te();return}t({view:"sessions",sessionId:p})};return e.jsx("article",{className:`ks-hit${je?" ks-hit--selected":""}`,role:"option","aria-selected":je,tabIndex:0,onClick:te,onDoubleClick:ge,onKeyDown:p=>{if(p.key==="Enter"&&(p.metaKey||p.ctrlKey)){p.preventDefault(),ge();return}ms(p,te)},children:e.jsxs("div",{className:"ks-hit-body",children:[ye.length>0?e.jsx("div",{className:"ks-hit-details ks-hit-details--moment","aria-label":"Turn",children:ye.map(p=>e.jsx("span",{className:"ks-hit-details-strong",children:p},p))}):null,e.jsx("h3",{className:"ks-hit-title",children:xe}),se&&se!==xe?e.jsx("p",{className:"ks-hit-snippet",children:e.jsx(hs,{text:se,query:i.query})}):null]})},j.id)})})]},s.collectionId)})})]}):null]}),e.jsx("footer",{className:"ks-foot-status","aria-live":"polite",children:e.jsxs("div",{className:"ks-foot-status-shell",children:[e.jsxs("span",{className:"ks-foot-status-facts",children:[he?e.jsx(ve,{size:12,className:"ks-spin","aria-hidden":"true"}):null,Me,Ae(i)?e.jsxs(e.Fragment,{children:[" · ",xs(i)]}):null]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>{pe(!0)},disabled:L,children:L?"Updating…":"Update index"})]})})]})}export{ct as KnowledgeSearchScreen};
@@ -1 +1 @@
1
- import{r as n,j as T}from"./index-C1VaWNuD.js";import{r as j}from"./index-Cx6Gbr6n.js";import{b as D,l as N}from"./lane-tool-detail-0WhMf4Vj.js";import"./lane-edit-display-C_Aujldz.js";const _=140,k=100,p=320,v=4,u=8,S=7;function y(e){return(e.querySelector(".s-observe-tool")??e).getBoundingClientRect()}function F(){return document.querySelector("[data-scout-theme]")??document.body}function q(e,t){return e===t?!0:!e||!t?!1:e.top===t.top&&e.left===t.left&&e.side===t.side&&e.caretTop===t.caretTop}function W(e,t){const l=window.innerWidth,f=window.innerHeight,E=e.top+e.height/2,d=l-e.right-u,m=e.left-u,R=d>=p+v,a=m>=p+v;let c="right",s=e.right+v,o=e.top;R?(c="right",s=e.right+v):a?(c="left",s=e.left-v-p):(c="right",s=Math.max(u,Math.min(e.right+v,l-p-u)),o=e.bottom+v),o+t>f-u&&(o=Math.max(u,e.top-t+e.height)),o=Math.max(u,Math.min(o,f-t-u)),s=Math.max(u,Math.min(s,l-p-u));const x=Math.max(S+4,Math.min(E-o,t-S-4));return{top:o,left:s,side:c,caretTop:x}}function G({model:e,position:t,cardRef:l,onMouseEnter:f,onMouseLeave:E}){const d=N(e),m=e.hoverFields.find(a=>a.label==="when"),R={position:"fixed",top:t.top,left:t.left,width:p,maxWidth:p,"--hover-caret-top":`${t.caretTop}px`};return T.jsxs("div",{ref:l,className:`s-observe-tool-hover-card s-observe-tool-hover-card--side-${t.side}`,style:R,onMouseEnter:f,onMouseLeave:E,role:"tooltip",children:[T.jsx("div",{className:"s-observe-tool-hover-card-cmd",children:e.command}),m&&T.jsx("div",{className:"s-observe-tool-hover-card-meta",children:m.value}),d.slice(1).map((a,c)=>T.jsx("div",{className:"s-observe-tool-hover-card-line",children:a},c)),T.jsx("div",{className:"s-observe-tool-hover-card-hint",children:"Click row for full detail"})]})}function $(e=!0){const[t,l]=n.useState(null),[f,E]=n.useState(null),d=n.useRef(new Map),m=n.useRef(new Map),R=n.useRef(new Map),a=n.useRef(new Map),c=n.useRef(null),s=n.useRef(null),o=n.useRef(null),x=n.useRef(null);c.current=t;const L=n.useCallback(()=>{s.current&&clearTimeout(s.current),o.current&&clearTimeout(o.current),s.current=null,o.current=null},[]),I=n.useMemo(()=>{if(!e||!t)return null;const r=R.current.get(t);if(!r)return null;const i=m.current.get(t);return D(r,i)},[e,t]),M=n.useCallback(r=>{E(i=>q(i,r)?i:r)},[]),g=n.useCallback(()=>{const r=c.current;if(!r){M(null);return}const i=d.current.get(r);if(!i)return;const w=y(i),h=x.current?.offsetHeight??132;M(W(w,h))},[M]);n.useEffect(()=>()=>L(),[L]),n.useLayoutEffect(()=>{if(!t){M(null);return}g();const r=requestAnimationFrame(g);return()=>cancelAnimationFrame(r)},[t,M,g]),n.useEffect(()=>{if(!t)return;const r=()=>g();return window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)}},[t,g]);const C=n.useCallback(r=>{e&&(o.current&&clearTimeout(o.current),o.current=null,c.current!==r&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{l(r),s.current=null},_)))},[e]),b=n.useCallback(()=>{s.current&&clearTimeout(s.current),s.current=null,c.current&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(null),o.current=null},k))},[]),A=n.useCallback((r,i)=>{R.current.set(r.id,r),m.current.set(r.id,i);let w=a.current.get(r.id);if(!w){const h=r.id;w={ref:P=>{P?d.current.set(h,P):d.current.delete(h)},onMouseEnter:()=>C(h),onMouseLeave:b,onFocus:()=>C(h),onBlur:b},a.current.set(h,w)}return w},[C,b]),H=e&&I&&f&&typeof document<"u"?j.createPortal(T.jsx(G,{model:I,position:f,cardRef:x,onMouseEnter:()=>{const r=c.current;r&&C(r)},onMouseLeave:b}),F()):null;return{bind:A,card:H,hoveredEventId:t}}export{$ as useLaneToolHoverCard};
1
+ import{r as n,j as T}from"./index-C8uS5szO.js";import{r as j}from"./index-C5cX8dkl.js";import{b as D,l as N}from"./lane-tool-detail-Czggx8oM.js";import"./lane-edit-display-BjdT9oZl.js";const _=140,k=100,p=320,v=4,u=8,S=7;function y(e){return(e.querySelector(".s-observe-tool")??e).getBoundingClientRect()}function F(){return document.querySelector("[data-scout-theme]")??document.body}function q(e,t){return e===t?!0:!e||!t?!1:e.top===t.top&&e.left===t.left&&e.side===t.side&&e.caretTop===t.caretTop}function W(e,t){const l=window.innerWidth,f=window.innerHeight,E=e.top+e.height/2,d=l-e.right-u,m=e.left-u,R=d>=p+v,a=m>=p+v;let c="right",s=e.right+v,o=e.top;R?(c="right",s=e.right+v):a?(c="left",s=e.left-v-p):(c="right",s=Math.max(u,Math.min(e.right+v,l-p-u)),o=e.bottom+v),o+t>f-u&&(o=Math.max(u,e.top-t+e.height)),o=Math.max(u,Math.min(o,f-t-u)),s=Math.max(u,Math.min(s,l-p-u));const x=Math.max(S+4,Math.min(E-o,t-S-4));return{top:o,left:s,side:c,caretTop:x}}function G({model:e,position:t,cardRef:l,onMouseEnter:f,onMouseLeave:E}){const d=N(e),m=e.hoverFields.find(a=>a.label==="when"),R={position:"fixed",top:t.top,left:t.left,width:p,maxWidth:p,"--hover-caret-top":`${t.caretTop}px`};return T.jsxs("div",{ref:l,className:`s-observe-tool-hover-card s-observe-tool-hover-card--side-${t.side}`,style:R,onMouseEnter:f,onMouseLeave:E,role:"tooltip",children:[T.jsx("div",{className:"s-observe-tool-hover-card-cmd",children:e.command}),m&&T.jsx("div",{className:"s-observe-tool-hover-card-meta",children:m.value}),d.slice(1).map((a,c)=>T.jsx("div",{className:"s-observe-tool-hover-card-line",children:a},c)),T.jsx("div",{className:"s-observe-tool-hover-card-hint",children:"Click row for full detail"})]})}function $(e=!0){const[t,l]=n.useState(null),[f,E]=n.useState(null),d=n.useRef(new Map),m=n.useRef(new Map),R=n.useRef(new Map),a=n.useRef(new Map),c=n.useRef(null),s=n.useRef(null),o=n.useRef(null),x=n.useRef(null);c.current=t;const L=n.useCallback(()=>{s.current&&clearTimeout(s.current),o.current&&clearTimeout(o.current),s.current=null,o.current=null},[]),I=n.useMemo(()=>{if(!e||!t)return null;const r=R.current.get(t);if(!r)return null;const i=m.current.get(t);return D(r,i)},[e,t]),M=n.useCallback(r=>{E(i=>q(i,r)?i:r)},[]),g=n.useCallback(()=>{const r=c.current;if(!r){M(null);return}const i=d.current.get(r);if(!i)return;const w=y(i),h=x.current?.offsetHeight??132;M(W(w,h))},[M]);n.useEffect(()=>()=>L(),[L]),n.useLayoutEffect(()=>{if(!t){M(null);return}g();const r=requestAnimationFrame(g);return()=>cancelAnimationFrame(r)},[t,M,g]),n.useEffect(()=>{if(!t)return;const r=()=>g();return window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)}},[t,g]);const C=n.useCallback(r=>{e&&(o.current&&clearTimeout(o.current),o.current=null,c.current!==r&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{l(r),s.current=null},_)))},[e]),b=n.useCallback(()=>{s.current&&clearTimeout(s.current),s.current=null,c.current&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(null),o.current=null},k))},[]),A=n.useCallback((r,i)=>{R.current.set(r.id,r),m.current.set(r.id,i);let w=a.current.get(r.id);if(!w){const h=r.id;w={ref:P=>{P?d.current.set(h,P):d.current.delete(h)},onMouseEnter:()=>C(h),onMouseLeave:b,onFocus:()=>C(h),onBlur:b},a.current.set(h,w)}return w},[C,b]),H=e&&I&&f&&typeof document<"u"?j.createPortal(T.jsx(G,{model:I,position:f,cardRef:x,onMouseEnter:()=>{const r=c.current;r&&C(r)},onMouseLeave:b}),F()):null;return{bind:A,card:H,hoveredEventId:t}}export{$ as useLaneToolHoverCard};
@@ -0,0 +1 @@
1
+ import{r as f,j as e}from"./index-C8uS5szO.js";import{S as L}from"./SlidePanel-Datu7XG4.js";import{A as j}from"./AgentAvatar-BIwg54Tj.js";import{H as S}from"./HarnessMark-Bt47OeHy.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as g,f as k,a as y}from"./lane-observe-BD21P8BB.js";import{S as A}from"./SessionObserve-DaqDhqDI.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-WLNZZVi_.js";import{b as T}from"./agent-lane-detail-Db7KyAlf.js";import{l as I,a as z}from"./agent-lanes-model-CX0wTcnF.js";import"./Provider-5Hotn7NQ.js";import"./router-BKiMcYa7.js";import"./api-CaROe5_H.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./conversation-model-BGFHoxQ0.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./SpriteAvatar-BW1JzkDt.js";import"./CrewAvatar-CJhuqTsJ.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-Czggx8oM.js";import"./LaneToolHoverCard-C6YehJqD.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-Ctw1ECUC.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./openContent-C6XO6kr5.js";import"./eye-CtqSV8BS.js";import"./terminal-96JWDYDL.js";import"./message-markup-DgFSyb3f.js";import"./ObservedTopologyPanel-DkEkQzo-.js";import"./ObserveTextFlow-ET0dD1wO.js";import"./use-reduced-motion-D7n3vK8t.js";import"./proxy-DOG46ja4.js";import"./SessionObserveEvidence-Drv-D8Oh.js";import"./message-circle-CSiJj6yo.js";import"./wrench-BsMTSeji.js";import"./external-link-RT4Ph-6-.js";import"./context-budget-DemtXu7E.js";const M={think:"Thought",tool:"Tool",ask:"Request",message:"Message",note:"Note",system:"System",boot:"Boot"};function Ye({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{Ye as LaneTraceDetailSheet};
@@ -1 +1 @@
1
- import{j as e,r as o}from"./index-C1VaWNuD.js";import{i as x,l as h}from"./lane-edit-display-C_Aujldz.js";import{b as p}from"./lane-ask-display-B6iCAVcd.js";import{f as m,b as j}from"./lane-tool-detail-0WhMf4Vj.js";const N=new Set(["detail","output","result","diff","change"]);function f({text:c,label:t}){return e.jsx("button",{type:"button",className:"s-lane-trace-focus-copy",onClick:()=>{navigator.clipboard?.writeText(c)},title:t,"aria-label":t,children:"Copy"})}function q({event:c,wallLabel:t,wallTitle:r,variant:n="sheet"}){return c.kind==="ask"?e.jsx(v,{event:c,wallLabel:t,wallTitle:r,variant:n}):e.jsx(y,{event:c,wallLabel:t,wallTitle:r,variant:n})}function y({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>j(c,{wallLabel:t,wallTitle:r,sessionOffset:`${m(c.t)} from start`}),[c,t,r]),{primarySection:i,secondarySections:d}=o.useMemo(()=>{if(!s)return{primarySection:null,secondarySections:[]};const a=s.sections.find(u=>N.has(u.title))??s.sections[0]??null,l=a?s.sections.filter(u=>u!==a):s.sections;return{primarySection:a,secondarySections:l}},[s]);return s?e.jsxs("section",{className:`s-lane-trace-focus${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected trace event",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this step":"Selected command"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.command}),x(c.tool)&&c.arg?.trim()&&(()=>{const a=h(c.arg.trim()),l=a.split("/").pop()??a;return a===l?null:e.jsx("div",{className:"s-lane-trace-focus-path",title:c.arg.trim(),children:a})})()]}),e.jsx(f,{text:s.copyText,label:"Copy event detail"})]}),s.hoverFields.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:s.hoverFields.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:a.label}),e.jsx("dd",{title:a.value,children:a.value})]},a.label))}),i&&e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:i.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:i.content})]}),d.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:a.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:a.content})]},a.title))]}):null}function v({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>p(c),[c]),i=o.useMemo(()=>{const l=[...s.fields];return t&&l.unshift({label:"when",value:r?`${t} · ${r}`:t}),l.push({label:"offset",value:`${m(c.t)} from start`}),l},[s.fields,c.t,t,r]),d=s.preview&&s.preview!==s.fullText,a=s.requestText&&s.requestText!==s.fullText&&s.requestText!==s.preview;return e.jsxs("section",{className:`s-lane-trace-focus s-lane-trace-focus--ask${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected request",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this request":"Selected request"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.title}),d?e.jsx("div",{className:"s-lane-trace-focus-ask-preview",children:s.preview}):null]}),e.jsx(f,{text:s.copyText,label:"Copy full request"})]}),i.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:i.map(l=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:l.label}),e.jsx("dd",{title:l.value,children:l.value})]},`${l.label}:${l.value}`))}),e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"full request"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.fullText})]}),a?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"request preview"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.requestText})]}):null,s.answer?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:s.answer.label}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.answer.text})]}):null]})}export{q as LaneTraceEventFocus};
1
+ import{j as e,r as o}from"./index-C8uS5szO.js";import{i as x,l as h}from"./lane-edit-display-BjdT9oZl.js";import{b as p}from"./lane-ask-display-B6iCAVcd.js";import{f as m,b as j}from"./lane-tool-detail-Czggx8oM.js";const N=new Set(["detail","output","result","diff","change"]);function f({text:c,label:t}){return e.jsx("button",{type:"button",className:"s-lane-trace-focus-copy",onClick:()=>{navigator.clipboard?.writeText(c)},title:t,"aria-label":t,children:"Copy"})}function q({event:c,wallLabel:t,wallTitle:r,variant:n="sheet"}){return c.kind==="ask"?e.jsx(v,{event:c,wallLabel:t,wallTitle:r,variant:n}):e.jsx(y,{event:c,wallLabel:t,wallTitle:r,variant:n})}function y({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>j(c,{wallLabel:t,wallTitle:r,sessionOffset:`${m(c.t)} from start`}),[c,t,r]),{primarySection:i,secondarySections:d}=o.useMemo(()=>{if(!s)return{primarySection:null,secondarySections:[]};const a=s.sections.find(u=>N.has(u.title))??s.sections[0]??null,l=a?s.sections.filter(u=>u!==a):s.sections;return{primarySection:a,secondarySections:l}},[s]);return s?e.jsxs("section",{className:`s-lane-trace-focus${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected trace event",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this step":"Selected command"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.command}),x(c.tool)&&c.arg?.trim()&&(()=>{const a=h(c.arg.trim()),l=a.split("/").pop()??a;return a===l?null:e.jsx("div",{className:"s-lane-trace-focus-path",title:c.arg.trim(),children:a})})()]}),e.jsx(f,{text:s.copyText,label:"Copy event detail"})]}),s.hoverFields.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:s.hoverFields.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:a.label}),e.jsx("dd",{title:a.value,children:a.value})]},a.label))}),i&&e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:i.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:i.content})]}),d.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:a.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:a.content})]},a.title))]}):null}function v({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>p(c),[c]),i=o.useMemo(()=>{const l=[...s.fields];return t&&l.unshift({label:"when",value:r?`${t} · ${r}`:t}),l.push({label:"offset",value:`${m(c.t)} from start`}),l},[s.fields,c.t,t,r]),d=s.preview&&s.preview!==s.fullText,a=s.requestText&&s.requestText!==s.fullText&&s.requestText!==s.preview;return e.jsxs("section",{className:`s-lane-trace-focus s-lane-trace-focus--ask${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected request",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this request":"Selected request"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.title}),d?e.jsx("div",{className:"s-lane-trace-focus-ask-preview",children:s.preview}):null]}),e.jsx(f,{text:s.copyText,label:"Copy full request"})]}),i.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:i.map(l=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:l.label}),e.jsx("dd",{title:l.value,children:l.value})]},`${l.label}:${l.value}`))}),e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"full request"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.fullText})]}),a?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"request preview"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.requestText})]}):null,s.answer?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:s.answer.label}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.answer.text})]}):null]})}export{q as LaneTraceEventFocus};
@@ -0,0 +1,3 @@
1
+ import{r as u,j as s}from"./index-C8uS5szO.js";import{C as pe}from"./chunk-T65CQEWV-CSVUz2rY.js";import{u as ne,t as oe,a as D,b as ue,c as fe,d as xe,e as ye,f as we}from"./mesh-view-store-CliSYsmt.js";import{NodeMenu as ge,nodeMenuRowProps as be}from"./NodeMenu-Fw8ATWQA.js";import{c as ve,b as Ne}from"./machine-children-RGS4Q0r6.js";import{u as je,s as Ce,r as Me}from"./use-mesh-node-state-Ck9CYplv.js";import{n as T}from"./agent-state-DDhnFEEP.js";import{s as z}from"./colors-CFlbwC25.js";import{t as Z}from"./time-Dhsh_2EG.js";import{u as Ie}from"./Provider-5Hotn7NQ.js";import{u as He}from"./useAgentHoverCard-Dr-OjNFF.js";import"./plus-D_wLGJGT.js";import"./createLucideIcon-DkjnzvcJ.js";import"./index-C5cX8dkl.js";import"./api-CaROe5_H.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./conversation-model-BGFHoxQ0.js";import"./conversations-Cbg9h_Af.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./openContent-C6XO6kr5.js";import"./eye-CtqSV8BS.js";import"./terminal-96JWDYDL.js";function $e(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:d,cx:o,cy:f}=t,p=(i-o)/e.scale-e.pan.x,y=(d-f)/e.scale-e.pan.y;return{scale:n,pan:{x:(i-o)/n-p,y:(d-f)/n-y}}}return e}const re="openscout.mesh.canvas.viewport.v1";function Se(){const e={pan:{x:0,y:0},scale:1};if(typeof window>"u")return e;try{const t=window.sessionStorage.getItem(re);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 ke(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 Ee(e){const t=new Map;for(const n of e){const{key:i,label:d}=ke(n);let o=t.get(i);o||(o={key:i,label:d,instances:[]},t.set(i,o)),o.instances.push(n)}return Array.from(t.values()).map(n=>(n.instances.sort((i,d)=>i.id.localeCompare(d.id)),n)).sort((n,i)=>{const d=n.label.localeCompare(i.label);return d!==0?d:i.instances.length-n.instances.length})}function Ae(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 _e(e,t){return Math.max(1,Math.round(Math.sqrt(e*t)))}function Ye(e,t,n){if(e.length===0)return[];const i=e.map(h=>{const I=h.instances.length,r=_e(I,Math.max(.6,Math.min(n,2))),H=Math.ceil(I/r),C=r*t.stepX-(t.stepX-t.instanceW),E=H*t.stepY-(t.stepY-t.instanceH);return{cluster:h,cols:r,width:C+t.clusterPadX*2,height:E+t.clusterPadY*2+t.labelH}}),d=i.reduce((h,I)=>h+I.width*I.height,0),o=Math.max(Math.max(...i.map(h=>h.width)),Math.sqrt(d*n)),f=t.clusterGap,p=[];let y=0,M=0,g=0;for(const h of i)y>0&&y+h.width>o&&(M+=g+f,y=0,g=0),p.push({cluster:h.cluster,x:y,y:M,width:h.width,height:h.height,cols:h.cols}),y+=h.width+f,g=Math.max(g,h.height);const b=Math.min(...p.map(h=>h.x)),l=Math.max(...p.map(h=>h.x+h.width)),v=Math.min(...p.map(h=>h.y)),j=Math.max(...p.map(h=>h.y+h.height)),c=-((b+l)/2),x=-((v+j)/2);return p.map(h=>({...h,x:h.x+c,y:h.y+x}))}function Pe(e,t,n){const i=e%t,d=Math.floor(e/t);return{x:n.clusterPadX+i*n.stepX,y:n.labelH+n.clusterPadY+d*n.stepY}}function ee(e){const t=e.harness?.trim(),n=e.model?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function se(e){const t=e.project?.trim(),n=e.branch?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function B(e){return e.cwd||e.projectRoot||"—"}function te({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 Oe({agent:e,onOpen:t,bindings:n,active:i}){const d=T(e.state),o=e.agentClass==="organic",f=e.updatedAt?Z(e.updatedAt):"",p=ee(e),y=se(e);return s.jsxs("div",{...n??{},className:`mesh-instance-spec mesh-instance-spec--${d}${o?" mesh-instance-spec--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":z(e.state)},title:`${p} — ${y}`,children:[s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-primary",children:p}),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:y}),s.jsx(te,{onClick:t})]})]})}function Xe({agent:e,onOpen:t,bindings:n,active:i}){const d=T(e.state),o=e.agentClass==="organic",f=e.updatedAt?Z(e.updatedAt):"—",p=`${ee(e)} · ${se(e)}`;return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--${d}${o?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":z(e.state)},title:`${p}
2
+ ${B(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:p}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(te,{onClick:t})]}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsx("span",{className:"mesh-sheet-path",children:B(e)}),s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]})]})]})}function Le({agent:e,onOpen:t,bindings:n,active:i}){const d=T(e.state),o=e.agentClass==="organic",f=e.updatedAt?Z(e.updatedAt):"—",p=`${ee(e)} · ${se(e)}`,y=e.agentClass?.trim();return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--spacious mesh-instance-sheet--${d}${o?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":z(e.state)},title:`${p}
3
+ ${B(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:p}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(te,{onClick:t})]}),s.jsx("span",{className:"mesh-sheet-line",children:s.jsx("span",{className:"mesh-sheet-path",children:B(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"})," —"]}),y&&s.jsx("span",{className:"mesh-sheet-tag",children:y})]})]})}function Re({layout:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:d}){const{cluster:o,x:f,y:p,width:y,height:M,cols:g}=e,b=u.useMemo(()=>{const l={working:0,ready:0,notReady:0};for(const v of o.instances){const j=T(v.state);j==="in_turn"||j==="in_flight"?l.working+=1:j==="callable"?l.ready+=1:l.notReady+=1}return l},[o.instances]);return s.jsxs("div",{className:"mesh-cluster",style:{position:"absolute",left:f,top:p,width:y,height:M},children:[s.jsxs("div",{className:"mesh-cluster-header",style:{height:t.labelH},children:[s.jsx("span",{className:"mesh-cluster-name",children:o.label}),s.jsx("span",{className:"mesh-cluster-count",children:o.instances.length}),s.jsxs("span",{className:"mesh-cluster-states",children:[b.working>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--working",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),b.working]}),b.ready>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--available",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),b.ready]}),b.notReady>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--offline",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),b.notReady]})]})]}),o.instances.map((l,v)=>{const j=Pe(v,g,t);return s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:t.instanceW,height:t.instanceH},children:t.density==="compact"?s.jsx(Oe,{agent:l,onOpen:()=>n(l),bindings:i(l.id),active:d===l.id}):t.density==="spacious"?s.jsx(Le,{agent:l,onOpen:()=>n(l),bindings:i(l.id),active:d===l.id}):s.jsx(Xe,{agent:l,onOpen:()=>n(l),bindings:i(l.id),active:d===l.id})},l.id)})]})}const Q=34,le=22,Te=6,ae=28,ie=10,F=12,ce=380,Ge=240,J=38;function We(e,t,n,i,d,o){const f=[],p=[],y=[];for(const c of e)i[c.machineId]?y.push(c):p.push(c);let M=0,g=ce;const b=(c,x)=>{const I=t.has(c.machineId)||!c.online,r=n.has(c.machineId);let H=0,C=0,E=0;for(const R of c.agents){const k=T(R.state);k==="in_turn"||k==="in_flight"?H+=1:k==="callable"?C+=1:E+=1}const G=c.online?H>0?"working":C>0?"available":"offline":"offline";if(I)return{machineId:c.machineId,machineLabel:c.machineLabel,reachability:c.reachability,online:c.online,agentCount:c.agents.length,workingCount:H,availableCount:C,offlineCount:E,dominantState:G,host:c.host,collapsed:!1,ghost:!0,pinned:x,x:0,y:0,width:Ge,height:J,headerHeight:J,chromeHeight:J,layouts:[]};const Y=r?[]:Ee(c.agents),S=r?[]:Ye(Y,d,o),V=r?Ve():0,A=r?he+V*le+Te:0,P=Q+A;let O=0,X=0;if(!r&&S.length>0){const R=Math.min(...S.map(m=>m.x)),k=Math.max(...S.map(m=>m.x+m.width)),_=Math.min(...S.map(m=>m.y)),K=Math.max(...S.map(m=>m.y+m.height));O=k-R,X=K-_;const U=-R+F,a=-_+P+ie;for(const m of S)m.x+=U,m.y+=a}const L=Math.max(ce,O+F*2),q=r?P:P+ie+X+F+(c.kind==="this"?0:64);return{machineId:c.machineId,machineLabel:c.machineLabel,reachability:c.reachability,online:c.online,agentCount:c.agents.length,workingCount:H,availableCount:C,offlineCount:E,dominantState:G,host:c.host,collapsed:r,ghost:!1,pinned:x,x:0,y:0,width:L,height:q,headerHeight:Q,chromeHeight:P,layouts:S}};for(const c of p){const x=b(c,!1);x.x=0,x.y=M,f.push(x),g=Math.max(g,x.width),M+=x.height+ae}const l=Math.max(0,M-ae),v=-g/2,j=-l/2;for(const c of f)c.ghost||(c.width=g),c.x=v,c.y+=j;for(const c of y){const x=b(c,!0),h=i[c.machineId];x.x=h.x,x.y=h.y,f.push(x)}return f}function De({section:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:d,anyHidden:o,machineIds:f,onHeaderPointerDown:p,onHeaderClick:y,onGhostActivate:M}){const g=u.useRef(null),b=je(e.machineId),l=b?.view??null,v=Ce(l),j=s.jsx(ge,{ref:g,machineLabel:e.machineLabel,className:"mesh-machine-menu-btn",actions:Ne({machineId:e.machineId,machineLabel:e.machineLabel,nodeId:l?.node?.id??null,brokerUrl:l?.node?.brokerUrl??null,hidden:e.ghost,anyHidden:o,positioned:e.pinned,canCopy:typeof navigator<"u"&&!!navigator.clipboard,checking:b?.loading??!1,on:{select:r=>D(r,"node"),refresh:r=>{Me(r)},focus:r=>{we(r,f),D(r,"node")},toggleHidden:r=>oe(r),showAll:()=>ye(),clearPosition:r=>xe(r),copy:r=>{navigator.clipboard?.writeText(r)}}})}),c=be(g),x=e.reachability==="this"?"this node":e.reachability==="peer"?"peer":e.reachability==="tailnet"?"tailnet":"",h=l?v.label.toLowerCase():e.online?"not checked":"unreachable";if(e.ghost)return s.jsxs("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} · ${h} — click to show`,...c,children:[j,s.jsxs("button",{type:"button",className:"mesh-machine-ghost-body",onPointerDown:r=>p(r,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:h}),x&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability} mesh-machine-chip--ghost`,children:x}),s.jsxs("span",{className:"mesh-machine-ghost-counts",children:[s.jsx("span",{className:"mesh-machine-count",children:e.reachability==="this"?e.agentCount:l?.workload?.total??"—"}),e.workingCount>0&&s.jsxs("span",{className:"mesh-machine-count mesh-machine-count--working",children:[e.workingCount,"W"]})]})]})]});const I=e.collapsed?Be(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"},...c,children:[j,s.jsxs("button",{type:"button",className:"mesh-machine-header",style:{height:e.headerHeight},onPointerDown:r=>p(r,e),onClick:()=>y(e.machineId),"aria-expanded":!e.collapsed,children:[s.jsx("span",{className:`mesh-machine-led mesh-machine-led--${e.dominantState}`,style:{color:z(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}),x&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability}`,children:x}),s.jsx("span",{className:`mesh-machine-reach mesh-node-reach--${v.tone}`,title:v.detail??v.label,children:v.label})]}),e.collapsed&&s.jsxs("div",{className:"mesh-machine-spec",children:[s.jsxs("div",{className:"mesh-machine-state-strip",style:{height:he},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.reachability==="this"?e.workingCount:l?.workload?.working??"—"}),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.reachability==="this"?e.availableCount:l?.workload?.available??"—"}),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.reachability==="this"?e.agentCount:l?.workload?.total??"—"}),s.jsx("span",{className:"mesh-machine-state-label",children:"total"})]})]}),I.map(r=>s.jsxs("div",{className:"mesh-machine-spec-row",style:{height:le},children:[s.jsx("span",{className:"mesh-machine-spec-label",children:r.label}),s.jsx("span",{className:"mesh-machine-spec-value",title:r.value,children:r.value})]},r.label))]}),!e.collapsed&&e.reachability!=="this"&&s.jsx("button",{type:"button",className:"mesh-machine-detail-link",onClick:()=>D(e.machineId,"node"),children:l?.workload?`${l.workload.total} registered here${l.stale?" · last known":""} — view agents and activity`:"View this node’s agents and activity"}),!e.collapsed&&e.layouts.map(r=>s.jsx(Re,{layout:r,metrics:t,onAgentOpen:n,bindFor:i,activeId:d},r.cluster.key))]})}function Be(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 ze=7,he=54;function Ve(e,t,n,i){return ze}function Ks({mesh:e,agents:t=[]}){const n=u.useRef(null),[i,d]=u.useState({w:0,h:0}),[o,f]=u.useReducer($e,void 0,Se);u.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(re,JSON.stringify({pan:o.pan,scale:o.scale}))}catch{}},[o.pan,o.scale]);const{density:p,query:y,agentStateFilters:M,hiddenMachineIds:g,collapsedMachineIds:b,scrollTargetMachineId:l}=ne(),{navigate:v}=Ie();u.useLayoutEffect(()=>{const a=n.current;if(!a)return;const m=()=>d({w:a.clientWidth,h:a.clientHeight});m();const N=new ResizeObserver(m);return N.observe(a),()=>N.disconnect()},[]),u.useLayoutEffect(()=>{const a=n.current;if(!a)return;const m=N=>{N.preventDefault();const w=N.deltaY<0?1.12:1/1.12,$=a.getBoundingClientRect();f({type:"zoom",factor:w,mx:N.clientX-$.left,my:N.clientY-$.top,cx:$.width/2,cy:$.height/2})};return a.addEventListener("wheel",m,{passive:!1}),()=>a.removeEventListener("wheel",m)},[]);const{machinePositions:j}=ne(),c=u.useMemo(()=>Ae(p),[p]),x=u.useMemo(()=>{const a=y.trim().toLowerCase();return t.filter(m=>{const w=T(m.state);return M.has(w)?a?`${m.name??""} ${m.handle??""} ${m.harness??""} ${m.project??""} ${m.branch??""}`.toLowerCase().includes(a):!0:!1})},[t,y,M]),h=u.useMemo(()=>ve(x,e),[x,e]),I=i.w>0&&i.h>0?i.w/i.h:1.6,r=u.useMemo(()=>We(h,g,b,j,c,I),[h,g,b,j,c,I]),H=u.useRef(null),[C,E]=u.useState(null),G=u.useCallback((a,m)=>{if(a.button!==0)return;a.stopPropagation(),a.currentTarget.setPointerCapture(a.pointerId),H.current={machineId:m.machineId,startClientX:a.clientX,startClientY:a.clientY,startSectionX:m.x,startSectionY:m.y,pointerId:a.pointerId,moved:!1}},[]);u.useEffect(()=>{const a=N=>{const w=H.current;if(!w||N.pointerId!==w.pointerId)return;const $=N.clientX-w.startClientX,W=N.clientY-w.startClientY;if(!w.moved&&Math.hypot($,W)<4)return;w.moved=!0;const me=$/o.scale,de=W/o.scale;E({machineId:w.machineId,x:w.startSectionX+me,y:w.startSectionY+de})},m=N=>{const w=H.current;if(!(!w||N.pointerId!==w.pointerId)){if(H.current=null,w.moved){const $=(N.clientX-w.startClientX)/o.scale,W=(N.clientY-w.startClientY)/o.scale;fe(w.machineId,{x:w.startSectionX+$,y:w.startSectionY+W})}E(null)}};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m),()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}},[o.scale]);const Y=u.useRef(!1);u.useEffect(()=>{if(C)Y.current=!0;else{const a=setTimeout(()=>{Y.current=!1},50);return()=>clearTimeout(a)}},[C]);const S=u.useCallback(a=>{Y.current||oe(a)},[]),V=u.useCallback(a=>{Y.current||(D(a,"node"),ue(a))},[]),A=u.useMemo(()=>C?r.map(a=>a.machineId===C.machineId?{...a,x:C.x,y:C.y,pinned:!0}:a):r,[r,C]);u.useEffect(()=>{if(!l)return;const a=A.find(m=>m.machineId===l);a&&f({type:"pan",delta:{x:-a.x-o.pan.x-a.width/2,y:-a.y-o.pan.y+i.h/4-Q}})},[l,A,o.pan.x,o.pan.y,i.h]);const P=u.useCallback(a=>{a.agentClass!=="organic"&&v({view:"agents-v2",agentId:a.id})},[v]),O=u.useMemo(()=>x.filter(a=>a.agentClass!=="organic"),[x]),X=u.useMemo(()=>O.map(a=>a.id),[O]),L=He({agents:O,orderedIds:X,navigate:v,selectMode:"preview"}),q=u.useCallback(a=>X.includes(a)?L.bind(a):null,[L,X]),R=L.activeAgent?.id??null,{pan:k,scale:_}=o,K=i.w/2,U=i.h/2;return s.jsxs("div",{ref:n,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[i.w>0&&s.jsx(pe,{panOffset:k,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(${K}px, ${U}px) translate(${k.x*_}px, ${k.y*_}px) scale(${_})`,transformOrigin:"0 0",pointerEvents:"none"},children:A.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"})}):A.map(a=>s.jsx(De,{section:a,metrics:c,onAgentOpen:P,bindFor:q,activeId:R,anyHidden:g.size>0,machineIds:A.map(m=>m.machineId),onHeaderPointerDown:G,onHeaderClick:V,onGhostActivate:S},a.machineId))}),s.jsx("div",{className:"mesh-canvas-hint",children:"scroll to zoom · drag to pan"}),L.card]})}export{Ks as MeshCanvas};
@@ -0,0 +1 @@
1
+ import{r as g,j as e}from"./index-C8uS5szO.js";import{u as I,g as S,t as k,a as b,r as B}from"./mesh-view-store-CliSYsmt.js";import{u as L}from"./Provider-5Hotn7NQ.js";import{a as N,e as P}from"./agent-state-DDhnFEEP.js";import{a as v}from"./use-mesh-node-state-Ck9CYplv.js";import{c as R,m as y}from"./machine-children-RGS4Q0r6.js";import{s as w}from"./colors-CFlbwC25.js";function D(){const[i,m]=g.useState("rack"),{agents:c}=L(),{meshSnapshot:t,selectedId:h,selectedType:a,hiddenMachineIds:s,machinePositions:r}=I(),n=g.useMemo(()=>t?R(c,t):[],[c,t]);if(!t||n.length===0)return null;const u=n.filter(p=>!s.has(p.machineId)).length,l=n.length,d=Object.keys(r).length,o=p=>{b(p,"node"),B(p)};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:()=>m("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:()=>m("rack"),"aria-pressed":i==="rack",children:"rack"})]}),e.jsx("span",{className:"mesh-rail-title-count",children:l}),e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0})]}),i==="rack"?e.jsx(A,{buckets:n,hiddenMachineIds:s,selectedId:h,selectedType:a,onFocus:o}):e.jsx(F,{buckets:n,selectedId:h,selectedType:a,onFocus:o}),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"?`${l} machines`:`${u}/${l} shown`}),d>0&&i==="rack"?e.jsx("button",{type:"button",className:"mesh-rail-foot-reset",onClick:()=>S(),title:"Reset machine layout",children:"reset"}):e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0})]})]})}function A({buckets:i,hiddenMachineIds:m,selectedId:c,selectedType:t,onFocus:h}){const{entries:a}=v();return e.jsx("div",{className:"mesh-rail-body",children:i.map((s,r)=>{const n=m.has(s.machineId),u=c===s.machineId&&t==="node",l=s.agents.filter(x=>N(x.state)).length;s.agents.filter(x=>P(x.state)).length;const d=s.online?s.agents.length===0?"offline":l>0?"working":"available":"offline",o=n||!s.online?void 0:w(d),p=s.reachability==="this"?"L":s.reachability==="peer"?"P":s.reachability==="tailnet"?"T":"·",M=String(r+1).padStart(2,"0"),f=a[s.machineId],j=f?.view??null,C=y(s,j,f?.loading??!1),$=s.kind==="this"?s.agents.length:j?.workload?.total??"—";return e.jsxs("div",{className:["mesh-rail-unit",n&&"mesh-rail-unit--off",!s.online&&"mesh-rail-unit--unreachable",u&&"mesh-rail-unit--active"].filter(Boolean).join(" "),children:[e.jsxs("button",{type:"button",className:"mesh-rail-unit-body",onClick:()=>h(s.machineId),title:`Focus ${s.machineLabel} on the map`,children:[e.jsx("span",{className:"mesh-rail-slot",children:M}),e.jsx("span",{className:`mesh-rail-led${n||!s.online?"":" mesh-rail-led--on"}`,style:o?{background:o,color:o}:void 0,"aria-hidden":!0}),e.jsxs("span",{className:"mesh-rail-unit-text",children:[e.jsx("span",{className:"mesh-rail-unit-name",title:s.machineLabel,children:s.machineLabel}),e.jsxs("span",{className:"mesh-rail-unit-sub",children:[e.jsx("span",{className:`mesh-rail-reach mesh-rail-reach--${s.reachability}`,children:p}),e.jsx("span",{className:"mesh-rail-unit-stamp",children:C})]})]}),e.jsx("span",{className:"mesh-rail-unit-count",children:$})]}),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:x=>{x.stopPropagation(),k(s.machineId)},title:n?"Show in workspace":"Hide from workspace","aria-pressed":!n,children:n?"○":"●"})}),e.jsx("span",{className:"mesh-rail-vent","aria-hidden":!0})]},s.machineId)})})}function F({buckets:i,selectedId:m,selectedType:c,onFocus:t}){const{entries:h}=v();return e.jsx("div",{className:"mesh-rail-body mesh-rail-body--map",children:e.jsx("div",{className:"mesh-mini-map",children:i.map(a=>{const s=h[a.machineId],r=a.kind==="this"?a.agents.length:s?.view?.workload?.total,n=m===a.machineId&&c==="node",u=a.agents.filter(o=>N(o.state)).length,l=a.online?a.agents.length===0?"offline":u>0?"working":"available":"offline",d=a.online?w(l):void 0;return e.jsxs("button",{type:"button",className:`mesh-mini-node mesh-mini-node--${l}${n?" mesh-mini-node--active":""}${a.online?"":" mesh-mini-node--off"}`,onClick:()=>t(a.machineId),title:`${a.machineLabel} — ${y(a,s?.view??null,s?.loading??!1)}`,children:[e.jsx("span",{className:"mesh-mini-led",style:d?{background:d}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"mesh-mini-label",children:a.machineLabel}),r!==void 0&&r>0&&e.jsx("span",{className:"mesh-mini-count",children:r})]},a.machineId)})})})}export{D as M};
@@ -0,0 +1 @@
1
+ import{r as m,j as e}from"./index-C8uS5szO.js";import{a as z}from"./api-CaROe5_H.js";import{b as E}from"./use-mesh-node-state-Ck9CYplv.js";import{t as A}from"./time-Dhsh_2EG.js";import{n as _,b as F,c as H}from"./agent-state-DDhnFEEP.js";import{b as K}from"./machine-scope-DJt9RZ2w.js";import{u as q,g as U}from"./Provider-5Hotn7NQ.js";import{b as V}from"./router-BKiMcYa7.js";import{MeshCanvas as Q}from"./MeshCanvas-FDDGE69h.js";import{s as J}from"./colors-CFlbwC25.js";import{u as W}from"./useAgentHoverCard-Dr-OjNFF.js";import{u as X}from"./local-agents-D9fYYRyj.js";import{u as Y,a as Z,s as G,h as T,i as R,j as ee,k as L}from"./mesh-view-store-CliSYsmt.js";import{u as se}from"./useContentSecondaryNav-CGvMOVGY.js";import{OpsSubnav as te}from"./OpsSubnav-9sURjajO.js";/* empty css *//* empty css */import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./conversation-model-BGFHoxQ0.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./chunk-T65CQEWV-CSVUz2rY.js";import"./plus-D_wLGJGT.js";import"./NodeMenu-Fw8ATWQA.js";import"./machine-children-RGS4Q0r6.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./openContent-C6XO6kr5.js";import"./eye-CtqSV8BS.js";import"./terminal-96JWDYDL.js";import"./SecondaryNav-BkTn5tkq.js";import"./secondaryNavConfig-DAXIFtVd.js";import"./nav-destinations-CyXnw9kh.js";import"./message-square-NmXWtWLR.js";import"./compass-DTZdCpv9.js";import"./settings-TJIkkZ0P.js";import"./git-branch-CA3cHKCI.js";import"./scroll-text-DwC8r2g6.js";/* empty css */function ne(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)),y=t.reduce((d,x)=>Math.max(d,x.updatedAt??0),0);r=Math.max(r,y);for(const d of t)u[_(d.state)]+=1,s.push(d);h.push({branch:l,agents:t,latest:y})}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 P(c){return c?c.replace(/^\/Users\/[^/]+/,"~"):null}function ae({agents:c,emptyTitle:p="No agents registered",emptyBody:f="Agents connected to this broker will appear here.",selectMode:g="preview"}){const{navigate:j}=q(),a=m.useMemo(()=>ne(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=W({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 y=_(t.state),d=F(t.state),x=t.agentClass==="organic",k=r.getState(t.id),M=P(t.cwd)??P(t.projectRoot),C=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}),C&&b.push({kind:"sess",text:`sess:${C}`});const $=r.bind(t.id);return e.jsxs("button",{type:"button",className:`mesh-tree-agent${x?" mesh-tree-agent--organic":""}${k.isActive?" mesh-tree-agent--active":""}${k.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:J(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((S,I)=>e.jsxs("span",{className:`mesh-tree-agent-inline-part mesh-tree-agent-inline-part--${S.kind}`,children:[I>0&&e.jsx("span",{className:"mesh-tree-agent-inline-sep",children:"·"}),S.text]},S.kind))}),e.jsx("span",{className:`mesh-tree-agent-state mesh-tree-agent-state--${d}`,children:H(y)}),e.jsx("span",{className:"mesh-tree-agent-time",children:t.updatedAt?A(t.updatedAt):""})]},t.id)})})]},n.branch))})]},s.project)}),r.card]})}function O({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:()=>T("map"),children:"Map"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${c==="tree"?" mesh-mode-btn--active":""}`,onClick:()=>T("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:()=>R("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:()=>R("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:()=>R("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=>ee(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 vs({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}=Y(),{agents:t}=X(),{route:y}=q(),d=V(y),x=m.useMemo(()=>U(t),[t]),k=m.useMemo(()=>K(x,d,n?.localNode?.id),[x,d,n?.localNode?.id]),M=m.useRef(null),C=m.useRef(0);m.useEffect(()=>{M.current=n},[n]),m.useEffect(()=>{d&&Z(d,"node")},[d]);const b=m.useCallback(async(v="initial")=>{const N=++C.current;!(M.current!==null)&&v!=="background"?(f(!0),o(null)):j(!0);try{const w=await z("/api/mesh");if(N!==C.current)return;G(w),o(null),h(Date.now())}catch(w){if(N!==C.current)return;o(w instanceof Error?w.message:String(w))}finally{N===C.current&&(f(!1),j(!1))}},[]);m.useEffect(()=>{b("initial")},[b]),m.useEffect(()=>{const v=setInterval(()=>{b("background")},1e4);return()=>clearInterval(v)},[b]),m.useEffect(()=>{E();const v=setInterval(()=>{E()},15e3);return()=>clearInterval(v)},[]);const $=m.useMemo(()=>{const v=s.trim().toLowerCase();return k.filter(N=>l!=="all"&&_(N.state)!==l?!1:v?`${N.name??""} ${N.handle??""} ${N.harness??""} ${N.project??""} ${N.branch??""}`.toLowerCase().includes(v):!0)},[s,k,l]),S={mode:r,density:u,query:s,stateFilter:l,loading:p,refreshing:g,error:a,lastLoadedAt:i,hasMesh:!!n,onRefresh:()=>{b("manual")}},I=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(O,{...S})]}):e.jsxs("div",{className:"mesh-tree-page",children:[e.jsx(O,{...S}),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(ae,{agents:$,emptyTitle:k.length===0?d?"No agents on this machine":"No agents registered":"No agents match your filter",emptyBody:k.length===0?"Agents connected to this broker will appear here.":"Try clearing the search or switching the state pill back to All."})]})]}),B=se();return e.jsxs("div",{className:"s-ops",children:[B?e.jsx("div",{className:"s-ops-header",children:e.jsx(te,{activeRoute:y,navigate:c})}):null,e.jsx("div",{className:"s-ops-body",children:I})]})}export{vs as MeshScreen};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/arc.es-BNXJqSw7.js","assets/index-C1VaWNuD.js","assets/index-i7TMxlwW.css"])))=>i.map(i=>d[i]);
2
- import{r as g,j as d,_ as j}from"./index-C1VaWNuD.js";const E=g.lazy(()=>j(()=>import("./arc.es-BNXJqSw7.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/arc.es-BzhWalCl.js","assets/index-C8uS5szO.js","assets/index-Ck1__1yL.css"])))=>i.map(i=>d[i]);
2
+ import{r as g,j as d,_ as j}from"./index-C8uS5szO.js";const E=g.lazy(()=>j(()=>import("./arc.es-BzhWalCl.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};