@openscout/scout 0.2.105 → 0.2.107

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 (575) hide show
  1. package/README.md +26 -0
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/chat.mjs +23 -1
  5. package/dist/client/assets/ActivityScreen-CZmGwQ2U.js +1 -0
  6. package/dist/client/assets/{AddProjectForm-CHNJ4NnS.js → AddProjectForm-CusDRiVO.js} +1 -1
  7. package/dist/client/assets/{AdventureEvidence-B4mEvXeD.js → AdventureEvidence-CyegKk1V.js} +1 -1
  8. package/dist/client/assets/{AdventureReader-ZsBDQITY.js → AdventureReader-X-hbTOi0.js} +1 -1
  9. package/dist/client/assets/{AdventureScenery-DSxDlqG1.js → AdventureScenery-LPXSVP67.js} +1 -1
  10. package/dist/client/assets/AgentAdventures-BAgxdOF8.js +1 -0
  11. package/dist/client/assets/AgentAvatar-CrP1eXxk.js +1 -0
  12. package/dist/client/assets/AgentConfigurationScreen-1L0IQm2w.js +1 -0
  13. package/dist/client/assets/AgentDefinitionsWorkspace-DguGs7jZ.js +1 -0
  14. package/dist/client/assets/{AgentDetailCard-MIEBKw_S.js → AgentDetailCard-DtHT3sCo.js} +1 -1
  15. package/dist/client/assets/AgentFloorView-DH4jiDgw.js +1 -0
  16. package/dist/client/assets/{AgentFloorWorld-BTqwmK5G.js → AgentFloorWorld-CjoIa6jA.js} +1 -1
  17. package/dist/client/assets/AgentInfoScreen-DYtmKkeE.js +1 -0
  18. package/dist/client/assets/{AgentLaneCard-C4rKLLdT.js → AgentLaneCard-BaZ2g-f8.js} +1 -1
  19. package/dist/client/assets/{AgentLaneChrome-fGC-ZrJS.js → AgentLaneChrome-TF1SlJSc.js} +1 -1
  20. package/dist/client/assets/{AgentLaneDetailSheet-BTF4_th9.js → AgentLaneDetailSheet-EzEPsn3g.js} +1 -1
  21. package/dist/client/assets/{AgentLaneSummaryResize-DgSeA_vS.js → AgentLaneSummaryResize-dpp7YvrX.js} +1 -1
  22. package/dist/client/assets/AgentLanesEmbedScreen-BlSof_6S.js +1 -0
  23. package/dist/client/assets/{AgentLanesPreflight-CcS23wij.js → AgentLanesPreflight-Ry-aqDTr.js} +1 -1
  24. package/dist/client/assets/AgentLanesView-BJi9xXz6.js +2 -0
  25. package/dist/client/assets/{AgentLiveActions-6Kfr1uOT.js → AgentLiveActions-CfTupTEl.js} +1 -1
  26. package/dist/client/assets/AgentMasterScreen-EJhmuKgl.js +1 -0
  27. package/dist/client/assets/AgentSessions-B1gOhDBf.js +6 -0
  28. package/dist/client/assets/AgentsConsole-RXGqRvcb.js +1 -0
  29. package/dist/client/assets/AgentsScreen-ChwMBs11.js +1 -0
  30. package/dist/client/assets/AgentsSubnav-DwNX4yy0.js +1 -0
  31. package/dist/client/assets/{AstronautSuit-D67fIBdR.js → AstronautSuit-Cchnc4Ug.js} +1 -1
  32. package/dist/client/assets/{AtopView-Ck30FbzG.js → AtopView-gkEp4y__.js} +1 -1
  33. package/dist/client/assets/{BackToPicker-CkBhGRlD.js → BackToPicker-CUkjnoVk.js} +1 -1
  34. package/dist/client/assets/BriefingDetailScreen-DrlC3qkm.js +1 -0
  35. package/dist/client/assets/{BriefingsScreen-DTxYMr3a.js → BriefingsScreen-B1HlBMGZ.js} +1 -1
  36. package/dist/client/assets/{BrokerMetadataPanel-crirZCdo.js → BrokerMetadataPanel-Dk242Yh_.js} +1 -1
  37. package/dist/client/assets/BrokerScreen-DwOF6bMA.js +8 -0
  38. package/dist/client/assets/{Canvas-CRP0KjKb.js → Canvas-X9pVSkw3.js} +1 -1
  39. package/dist/client/assets/{CastPicker-ZPomvOf-.js → CastPicker-BXUtPAGC.js} +1 -1
  40. package/dist/client/assets/ChannelComposer-DoK7IDGa.js +1 -0
  41. package/dist/client/assets/ChannelSidebar-e9DOPulb.js +1 -0
  42. package/dist/client/assets/{CharacterFamilyPreview-ckVkecDO.js → CharacterFamilyPreview-DMfw7UM_.js} +1 -1
  43. package/dist/client/assets/{ChatAvatar-DKBsbOqk.js → ChatAvatar-C3a_o5Hj.js} +1 -1
  44. package/dist/client/assets/ChatBits-CsvxbToF.js +1 -0
  45. package/dist/client/assets/{ChatCollapsedStrip-Co0NmqOO.js → ChatCollapsedStrip-FEmQ_G9J.js} +1 -1
  46. package/dist/client/assets/ChatRichInput-DhtwFxQE.js +31 -0
  47. package/dist/client/assets/ChatRightPanel-C1h_aIkn.js +1 -0
  48. package/dist/client/assets/ChatSpaceSurface-BXyLYKHn.js +1 -0
  49. package/dist/client/assets/ChatSpaceTheme-3wLZGsvT.css +1 -0
  50. package/dist/client/assets/ChatSpaceTheme-CUH8bTZc.js +1 -0
  51. package/dist/client/assets/{CodeDiffPane-D-iv28LJ.js → CodeDiffPane-DuQRwpgK.js} +1 -1
  52. package/dist/client/assets/{CodeProjectPicker-CZ3gDdiT.js → CodeProjectPicker-ZQ6gSBpg.js} +1 -1
  53. package/dist/client/assets/{CodeScreen-CSC-zbP9.js → CodeScreen-BXyKeL5T.js} +1 -1
  54. package/dist/client/assets/{CommsCanvas-DdNAwjGW.js → CommsCanvas-THp0r_U8.js} +1 -1
  55. package/dist/client/assets/{CommsDeck-mGWY7Ivi.js → CommsDeck-BVmSMV2V.js} +1 -1
  56. package/dist/client/assets/{CommsFlowGraph-voDD9M5R.js → CommsFlowGraph-DxoOaLF_.js} +1 -1
  57. package/dist/client/assets/{CommsFlowMap-C33sgD48.js → CommsFlowMap-Vi8ziCPg.js} +1 -1
  58. package/dist/client/assets/{CommsSelection-BL8aYD7z.js → CommsSelection-BUoRbu9o.js} +1 -1
  59. package/dist/client/assets/ComposerAttachments-DW0AIb8k.js +1 -0
  60. package/dist/client/assets/ConversationComposer-CUQyArlk.js +1 -0
  61. package/dist/client/assets/ConversationFeedRows-DWiOfT-y.js +1 -0
  62. package/dist/client/assets/ConversationHeader-C-ZWscKj.js +1 -0
  63. package/dist/client/assets/{ConversationPanels-6pprBpmq.js → ConversationPanels-D9oC0xG5.js} +2 -2
  64. package/dist/client/assets/ConversationScreen-9MlMnEo4.css +1 -0
  65. package/dist/client/assets/ConversationScreen-CUfsQ4MR.js +2 -0
  66. package/dist/client/assets/ConversationStatus--IPm2nGh.js +1 -0
  67. package/dist/client/assets/{CrewAvatar-D0c9z5Qr.css → CrewAvatar-BnIPIn_Z.css} +1 -1
  68. package/dist/client/assets/CrewAvatar-kTznzqcO.js +1 -0
  69. package/dist/client/assets/{CrewSprite-Dp9KBBGY.js → CrewSprite-Dhryjx2c.js} +1 -1
  70. package/dist/client/assets/CrewStage-vdO0qm3D.js +1 -0
  71. package/dist/client/assets/CrewWorkspaces-DCBzAAS4.js +1 -0
  72. package/dist/client/assets/{DataTable-av71ehJV.js → DataTable-aH-jCyDq.js} +1 -1
  73. package/dist/client/assets/{DispatchAftermath-CcYGUB10.js → DispatchAftermath-66uQAorV.js} +1 -1
  74. package/dist/client/assets/{DocumentFocusViewer-DlMiEALb.js → DocumentFocusViewer-DJr0v0D_.js} +1 -1
  75. package/dist/client/assets/{EmbeddableSurfacesLab-CTkO_tQR.js → EmbeddableSurfacesLab-BBa70EhJ.js} +1 -1
  76. package/dist/client/assets/{EmptyState-CYUwYyAW.js → EmptyState-CZlrHXy-.js} +1 -1
  77. package/dist/client/assets/{FileViewerPane-Cxhixtks.js → FileViewerPane-BAO6mtjD.js} +1 -1
  78. package/dist/client/assets/FleetRollCallHud-C5q2567n.js +1 -0
  79. package/dist/client/assets/FlightObserveScreen-DZ2mrw91.js +1 -0
  80. package/dist/client/assets/{FloorContextSheet-Vj_wVZq1.js → FloorContextSheet-2_NVPQor.js} +1 -1
  81. package/dist/client/assets/{FloorExchangePanel-CjHSDXad.js → FloorExchangePanel-BU1pPu8K.js} +1 -1
  82. package/dist/client/assets/{FloorMessagePasses-BG4ebnX5.js → FloorMessagePasses-cLW2UGNP.js} +1 -1
  83. package/dist/client/assets/{FloorReplay-BoYaGY9t.js → FloorReplay-VFzA6Kxc.js} +1 -1
  84. package/dist/client/assets/FloorResourcesSheet-C-kQ6Ren.js +1 -0
  85. package/dist/client/assets/{FloorSavedWork-jbtRs-YE.js → FloorSavedWork-BeHDejWz.js} +1 -1
  86. package/dist/client/assets/FloorTacticalHUD-CO-iiFpb.js +1 -0
  87. package/dist/client/assets/{FollowScreen-CupyOgt4.js → FollowScreen-CFfkIbc6.js} +1 -1
  88. package/dist/client/assets/HarnessMark-C4naWc16.js +1 -0
  89. package/dist/client/assets/HarnessesScreen-DX3NLcDG.js +1 -0
  90. package/dist/client/assets/{HerdrSession-Dcm3vf9U.js → HerdrSession-_t7yM8vX.js} +2 -2
  91. package/dist/client/assets/{HomeHero-pIZtE1cC.js → HomeHero-DouPyNmz.js} +1 -1
  92. package/dist/client/assets/{HostAdvisorView-Dv5meXo2.js → HostAdvisorView-CnM1i8hW.js} +1 -1
  93. package/dist/client/assets/InviteLandingScreen-CEjG2E34.js +1 -0
  94. package/dist/client/assets/InviteSheet-CwxZtWCl.js +1 -0
  95. package/dist/client/assets/{JumpPalette-BmiSOEmp.js → JumpPalette-O1aJE9gR.js} +1 -1
  96. package/dist/client/assets/{KnowledgeSearchInspector-B8yiM524.js → KnowledgeSearchInspector-32n9baT-.js} +1 -1
  97. package/dist/client/assets/KnowledgeSearchScreen-Dd6jrQ0A.js +1 -0
  98. package/dist/client/assets/{LaneToolHoverCard-D2cnTeUd.js → LaneToolHoverCard-CJa110yk.js} +1 -1
  99. package/dist/client/assets/LaneTraceDetailSheet-DYrd0BIf.js +1 -0
  100. package/dist/client/assets/{LaneTraceEventFocus-BLhVHwff.js → LaneTraceEventFocus-TbrNHRj_.js} +1 -1
  101. package/dist/client/assets/{MeshCanvas-BR25OBTJ.js → MeshCanvas-DWZHYh1A.js} +2 -2
  102. package/dist/client/assets/{MeshCanvasMinimap-ClVolr4-.js → MeshCanvasMinimap-iswYFpIb.js} +1 -1
  103. package/dist/client/assets/MeshScreen-8nAzQVbm.js +1 -0
  104. package/dist/client/assets/{MeshTopologyView-BT3ke2D1.js → MeshTopologyView-BVvtqI8q.js} +2 -2
  105. package/dist/client/assets/MessageEmbeds-ksPazAKH.js +1 -0
  106. package/dist/client/assets/MessagesScreen-C3WB4T21.js +1 -0
  107. package/dist/client/assets/{MissionContextRail-CafjuseK.js → MissionContextRail-D62-Wis8.js} +1 -1
  108. package/dist/client/assets/MissionControlView-B9cNPXvl.js +1 -0
  109. package/dist/client/assets/{MissionFocusOverlay-nhy3hkxQ.js → MissionFocusOverlay-C1zys3Jv.js} +1 -1
  110. package/dist/client/assets/MissionLeftAgentRow-vycMV77n.js +1 -0
  111. package/dist/client/assets/{MissionLogPane-DiUf3vWW.js → MissionLogPane-B19lYSY9.js} +1 -1
  112. package/dist/client/assets/NativeAreaScreen-B1RLa85C.js +1 -0
  113. package/dist/client/assets/NativeAreaScreen-CV0OhGra.js +1 -0
  114. package/dist/client/assets/NativeAreaScreen-CzuZt6o1.js +1 -0
  115. package/dist/client/assets/{NewAgentModal-BQ2wQ5gp.js → NewAgentModal-Bh-L-emz.js} +1 -1
  116. package/dist/client/assets/NewChatComposer-C97-iTMK.js +19 -0
  117. package/dist/client/assets/{NewChatOrigin-C8ROO4ps.js → NewChatOrigin-DFbF_XvR.js} +1 -1
  118. package/dist/client/assets/{NodeDetailPanel-BNTqYC7m.js → NodeDetailPanel-CElOEpCh.js} +1 -1
  119. package/dist/client/assets/{NodeMenu-CcOeFRCB.js → NodeMenu-B-jjHf1c.js} +1 -1
  120. package/dist/client/assets/ObserveEmbedScreen-B7Qt69Ms.js +2 -0
  121. package/dist/client/assets/{ObserveTextFlow-CC5mnngm.js → ObserveTextFlow-PFnG_10h.js} +2 -2
  122. package/dist/client/assets/{ObservedTopologyPanel-DF6tRZL_.js → ObservedTopologyPanel-CUTIoLZJ.js} +1 -1
  123. package/dist/client/assets/OpenScoutAppShell-37PDFfA4.js +31 -0
  124. package/dist/client/assets/OpsAgentsView-DajlX8LO.js +1 -0
  125. package/dist/client/assets/OpsScreen-jVcaBKGi.js +1 -0
  126. package/dist/client/assets/OpsSubnav-BOOYShHE.js +1 -0
  127. package/dist/client/assets/ProjectAgentProfile-D_wlW4sQ.js +1 -0
  128. package/dist/client/assets/{ProjectAgentProfileBar-C8z22pJ2.js → ProjectAgentProfileBar-DHuMKJj-.js} +1 -1
  129. package/dist/client/assets/ProjectAgentProfileHero-Dbebtug1.js +1 -0
  130. package/dist/client/assets/ProjectsInbox-B8zYE4vP.css +1 -0
  131. package/dist/client/assets/ProjectsInbox-Cgu7B4--.js +2 -0
  132. package/dist/client/assets/ProjectsRail-CDWocin_.js +1 -0
  133. package/dist/client/assets/ProjectsScreen-B_CJycqW.js +1 -0
  134. package/dist/client/assets/ProjectsThreadAside-1MMl_qUD.js +1 -0
  135. package/dist/client/assets/Provider-C35yu29I.js +5 -0
  136. package/dist/client/assets/{RailRow-DUPqXMZh.js → RailRow-BjmWK420.js} +1 -1
  137. package/dist/client/assets/RawSessionsTable-DzT90hWu.js +1 -0
  138. package/dist/client/assets/RealtimeVoiceScreen-B6ylX3WQ.js +16 -0
  139. package/dist/client/assets/{RenderedWorkerSprite-C8fxndAh.js → RenderedWorkerSprite-Dhlyg89J.js} +1 -1
  140. package/dist/client/assets/{ReplayClock-DUVJjrIu.js → ReplayClock-348f17bW.js} +1 -1
  141. package/dist/client/assets/{ReplayLog-Bek1Vc4W.js → ReplayLog-CBnAM3ui.js} +1 -1
  142. package/dist/client/assets/{ReplayOutpost-DlRg3172.js → ReplayOutpost-DyRPfNFx.js} +1 -1
  143. package/dist/client/assets/{RepoDiffEmbedScreen-CVUMnt6A.js → RepoDiffEmbedScreen-BWxvRDrS.js} +1 -1
  144. package/dist/client/assets/{RepoDiffPageScreen-D9-s5PyB.js → RepoDiffPageScreen-DN94irmY.js} +1 -1
  145. package/dist/client/assets/{RepoDiffViewer-D7FN-oyY.js → RepoDiffViewer-_4JVXBIW.js} +1 -1
  146. package/dist/client/assets/RepoDiffViewerLazy-XGVC3WXv.js +2 -0
  147. package/dist/client/assets/{ReposScreen-BQ7HO1om.js → ReposScreen-uMCpt0e9.js} +2 -2
  148. package/dist/client/assets/{RiggedWorkerCharacter-CJMWlvV-.js → RiggedWorkerCharacter-q6QRc7_o.js} +1 -1
  149. package/dist/client/assets/{SageModelStudio-B526NSnw.js → SageModelStudio-CNDhZhgD.js} +1 -1
  150. package/dist/client/assets/{ScoutDeckSurface-ChkvGyEW.js → ScoutDeckSurface-CUaU4R6T.js} +1 -1
  151. package/dist/client/assets/{ScoutSurface-6g1f5chk.js → ScoutSurface-3_25USO_.js} +1 -1
  152. package/dist/client/assets/{ScoutbotFxLab-BuwBdnPf.js → ScoutbotFxLab-CRqhYe0a.js} +1 -1
  153. package/dist/client/assets/{SecondaryNav-Bs-_VwTC.js → SecondaryNav-D7dbV2qo.js} +1 -1
  154. package/dist/client/assets/SessionContextStrip-CXfs9hUD.js +1 -0
  155. package/dist/client/assets/SessionContextStrip-DAIXwtHd.css +1 -0
  156. package/dist/client/assets/{SessionEmbedScreen-C2wf35-P.js → SessionEmbedScreen-D0zFmou-.js} +1 -1
  157. package/dist/client/assets/SessionHopMenu-E6VJZrE0.js +1 -0
  158. package/dist/client/assets/{SessionObserve-B64YsYhy.js → SessionObserve-DXxBvejJ.js} +9 -9
  159. package/dist/client/assets/SessionObserveEvidence-Cuj_KHxR.js +1 -0
  160. package/dist/client/assets/SessionRefScreen-DqLSUlCE.js +1 -0
  161. package/dist/client/assets/SessionsScreen-BLIRkohT.js +1 -0
  162. package/dist/client/assets/SettingsDrawer-juCpnbH6.js +3 -0
  163. package/dist/client/assets/SettingsScreen-BtGzE2-O.js +1 -0
  164. package/dist/client/assets/{SharedFloorCharacter-V04kD5T9.js → SharedFloorCharacter-DNEiaOUh.js} +1 -1
  165. package/dist/client/assets/SharedWorkFloor-0rqtdF-n.css +1 -0
  166. package/dist/client/assets/SharedWorkFloor-D9mf9KSg.js +2 -0
  167. package/dist/client/assets/{ShikiPane-XwFI-pCp.js → ShikiPane-CRtTYkMj.js} +1 -1
  168. package/dist/client/assets/{SlidePanel-BMpkXai_.js → SlidePanel-_CHAQdOa.js} +1 -1
  169. package/dist/client/assets/SpaceSwitcher-BLgSCf_T.js +1 -0
  170. package/dist/client/assets/{SpriteAvatar-aHeF4ZQZ.js → SpriteAvatar-CpZWf54-.js} +1 -1
  171. package/dist/client/assets/{SproutActionSprite-DI5N3gOj.js → SproutActionSprite-BSiTS4en.js} +1 -1
  172. package/dist/client/assets/{StatusPill-Dw4LP7wu.js → StatusPill-2gCP6H7A.js} +1 -1
  173. package/dist/client/assets/{TailView-BofjmUMJ.js → TailView-CYSijNTy.js} +2 -2
  174. package/dist/client/assets/Terminal-Bi97yb5s.js +4 -0
  175. package/dist/client/assets/TerminalEmbedScreen-Bqop67Bq.js +1 -0
  176. package/dist/client/assets/{TerminalHeaderMount-CwbQhXcI.js → TerminalHeaderMount-Cq4OD_xN.js} +1 -1
  177. package/dist/client/assets/{TerminalRelay--qOBwnbR.js → TerminalRelay-DrikpUSJ.js} +3 -3
  178. package/dist/client/assets/{TextDocumentSurface-BK6Qy41F.js → TextDocumentSurface-D52m7Vd8.js} +1 -1
  179. package/dist/client/assets/{TmuxPeek-DpUT9Tpc.js → TmuxPeek-CXFeweMg.js} +1 -1
  180. package/dist/client/assets/VoiceControlWell-DF3bjcYA.js +1 -0
  181. package/dist/client/assets/VoicePathDiagram-CmpHWfO-.js +1 -0
  182. package/dist/client/assets/{VoicePermissionsPanel-D35fOnQj.js → VoicePermissionsPanel-Ok2nfxHw.js} +1 -1
  183. package/dist/client/assets/VoiceTurnDetails-wAByRaNB.js +8 -0
  184. package/dist/client/assets/VoiceTurnStage-edoJalLV.js +1 -0
  185. package/dist/client/assets/VoiceTurnView-D-8g5E4r.js +1 -0
  186. package/dist/client/assets/WorkDetailScreen-zQkNVy2F.js +5 -0
  187. package/dist/client/assets/{WorkFilesViewer-t8AEyx3Q.js → WorkFilesViewer-vNt01sDd.js} +1 -1
  188. package/dist/client/assets/{WorkRunView-_mhG_FR2.js → WorkRunView-BDkR7Edq.js} +1 -1
  189. package/dist/client/assets/WorldActorTalk-BvSg_b1y.js +1 -0
  190. package/dist/client/assets/{WorldCharacter-BRrj3MQN.js → WorldCharacter-CIIlutQq.js} +1 -1
  191. package/dist/client/assets/WorldMinimap-B6HNgcDe.js +1 -0
  192. package/dist/client/assets/{WorldSky-D-RJzSa6.js → WorldSky-Jm2Z6dfW.js} +1 -1
  193. package/dist/client/assets/{activity-BJqFrZyB.js → activity-CIlFrfPJ.js} +1 -1
  194. package/dist/client/assets/{addon-fit-CHohcvS3.js → addon-fit-dFpj9Kfq.js} +1 -1
  195. package/dist/client/assets/{addon-webgl-CaRy2x2b.js → addon-webgl-BFCGRtGh.js} +1 -1
  196. package/dist/client/assets/{agent-essentials-bKWYOZaH.js → agent-essentials-BGGvT5G6.js} +1 -1
  197. package/dist/client/assets/{agent-master-model-C-KdOFDK.js → agent-master-model-Bk_yuUXJ.js} +1 -1
  198. package/dist/client/assets/{agent-specialization-BplZUa_0.js → agent-specialization-DDc7mLCW.js} +1 -1
  199. package/dist/client/assets/agents-screen-BYakbO50.css +1 -0
  200. package/dist/client/assets/{arc.es-CubLvQ4W.js → arc.es-C1SQHJ3k.js} +1 -1
  201. package/dist/client/assets/{arrow-left-DFfKAq0d.js → arrow-left-MVUKauwQ.js} +1 -1
  202. package/dist/client/assets/{arrow-right-DmAWnyAH.js → arrow-right-Bp-FpE5V.js} +1 -1
  203. package/dist/client/assets/{arrow-up-right-B0aLKiyF.js → arrow-up-right-BPedAgxO.js} +1 -1
  204. package/dist/client/assets/{book-open-BL9qvhEI.js → book-open-CV98WMSp.js} +1 -1
  205. package/dist/client/assets/{bot-BhAVbcCA.js → bot-B4zLQ4IN.js} +1 -1
  206. package/dist/client/assets/chat-api-DSJMBYoT.js +2 -0
  207. package/dist/client/assets/chat-message-markup-91DIry6R.js +1 -0
  208. package/dist/client/assets/chat-space-model-aW3Fd8_U.js +4 -0
  209. package/dist/client/assets/chat-transport-DNS5CB2I.js +1 -0
  210. package/dist/client/assets/{check-g7D7-c1J.js → check-lrJ3a73a.js} +1 -1
  211. package/dist/client/assets/{chevron-down-CDzRQQGl.js → chevron-down-l1mrh5S9.js} +1 -1
  212. package/dist/client/assets/{chevron-right-DKGTLiqc.js → chevron-right-DrfqcerI.js} +1 -1
  213. package/dist/client/assets/{chevron-up-DX7R6KY2.js → chevron-up-CETZJzjV.js} +1 -1
  214. package/dist/client/assets/{chunk-HRAB3GC3-Dvk_QpRq.js → chunk-HRAB3GC3-DbVLgbWX.js} +1 -1
  215. package/dist/client/assets/{clock-CQb4FeMf.js → clock-BV1aqPkK.js} +1 -1
  216. package/dist/client/assets/{code-xml-Cmadr3pQ.js → code-xml-BhcNbLWU.js} +1 -1
  217. package/dist/client/assets/{coffee-ljG1_krY.js → coffee-D7EAOdCk.js} +1 -1
  218. package/dist/client/assets/{compass-CvzkzkIh.js → compass-63TUaz5_.js} +1 -1
  219. package/dist/client/assets/content-B1lgE8qr.js +1 -0
  220. package/dist/client/assets/content-B5l11YyQ.js +1 -0
  221. package/dist/client/assets/content-BNZOZEpX.js +1 -0
  222. package/dist/client/assets/content-BRIxP155.js +1 -0
  223. package/dist/client/assets/content-BWd8gt8L.js +1 -0
  224. package/dist/client/assets/content-BfwS2jAK.js +1 -0
  225. package/dist/client/assets/content-C4p43_eT.js +1 -0
  226. package/dist/client/assets/content-CdYfaoDV.js +1 -0
  227. package/dist/client/assets/content-CzldLxw0.js +1 -0
  228. package/dist/client/assets/content-D-olnc4U.js +1 -0
  229. package/dist/client/assets/content-DTioimq4.js +1 -0
  230. package/dist/client/assets/content-LOebm3_d.js +1 -0
  231. package/dist/client/assets/{content-CKJ9zb7Z.js → content-nGlEZhUI.js} +1 -1
  232. package/dist/client/assets/{content-D1Ze_FG9.js → content-oyzDM-LK.js} +1 -1
  233. package/dist/client/assets/content-x1PHxED7.js +1 -0
  234. package/dist/client/assets/content-zX3ZY3T9.js +1 -0
  235. package/dist/client/assets/{conversation-icons-CIRaxmid.js → conversation-icons-Tqba2d56.js} +1 -1
  236. package/dist/client/assets/conversation-model-FxDeWlle.js +1 -0
  237. package/dist/client/assets/conversation-motion-features-C5zjuNwE.js +1 -0
  238. package/dist/client/assets/conversations-DoAAO6kA.js +1 -0
  239. package/dist/client/assets/{copy-BGOC1tJB.js → copy-xKeM5ZtU.js} +1 -1
  240. package/dist/client/assets/{cpu-Q6nrHFTN.js → cpu-BOTa_WLr.js} +1 -1
  241. package/dist/client/assets/{createLucideIcon-ChvMq-zl.js → createLucideIcon-zZ8Hx7er.js} +1 -1
  242. package/dist/client/assets/ctx-panel-BC8fpcWJ.css +1 -0
  243. package/dist/client/assets/direct-voice-BbLPuJ04.js +2 -0
  244. package/dist/client/assets/direct-voice-DbO7CSv_.css +1 -0
  245. package/dist/client/assets/discover-DJFxyV1k.js +2 -0
  246. package/dist/client/assets/embed-entry-Lyvu0Kfc.js +2 -0
  247. package/dist/client/assets/{external-link-BVccgH0n.js → external-link-CUObqmgX.js} +1 -1
  248. package/dist/client/assets/{eye-CsGfEVR6.js → eye-LrO-cXQt.js} +1 -1
  249. package/dist/client/assets/{file-code-corner-Be6da5l3.js → file-code-corner-CsU7jJpu.js} +1 -1
  250. package/dist/client/assets/{file-text-DP6txVW-.js → file-text-CnISiiw6.js} +1 -1
  251. package/dist/client/assets/{flag-DAFE2wZ5.js → flag-C4wl8z2-.js} +1 -1
  252. package/dist/client/assets/fleet-roll-call-BUgf7w-V.css +1 -0
  253. package/dist/client/assets/{folder-B_S7gBVr.js → folder-D5prSkzz.js} +1 -1
  254. package/dist/client/assets/{gauge-DQCGlE3o.js → gauge-D9_5iJEm.js} +1 -1
  255. package/dist/client/assets/{gestures-CofqY4Km.js → gestures-QZub3Ot9.js} +1 -1
  256. package/dist/client/assets/{git-branch-DcUCsWdJ.js → git-branch-B0_fPLO7.js} +1 -1
  257. package/dist/client/assets/{go-shortcuts-KQy-ZOpV.js → go-shortcuts-DicR7sUf.js} +1 -1
  258. package/dist/client/assets/home-moving-signal-rpMhsOJB.js +1 -0
  259. package/dist/client/assets/home-now-card-ByE6Umcx.js +1 -0
  260. package/dist/client/assets/{home-now-card-nano-CvU8B61b.js → home-now-card-nano-B5Dv3-pb.js} +1 -1
  261. package/dist/client/assets/hooks-_eCZZPsR.js +2 -0
  262. package/dist/client/assets/index-724SdE6r.js +1 -0
  263. package/dist/client/assets/{index-kkXUq-zf.js → index-CHD0qcfL.js} +1 -1
  264. package/dist/client/assets/index-CN4rBB_s.css +1 -0
  265. package/dist/client/assets/index-D1d98iYf.js +1 -0
  266. package/dist/client/assets/{index-DReVb7jZ.js → index-EsrkGBcv.js} +8 -8
  267. package/dist/client/assets/index-gGHPA-By.js +1 -0
  268. package/dist/client/assets/{inspector-panel-CLU7wjnT.js → inspector-panel-BkgUDn6G.js} +2 -2
  269. package/dist/client/assets/{keyboard-nav-CJXPaHXj.js → keyboard-nav-DDHegDbx.js} +1 -1
  270. package/dist/client/assets/{lane-roster-store-Ch9t6lb0.js → lane-roster-store-D-RSWjb-.js} +1 -1
  271. package/dist/client/assets/{layers-BOwyWodP.js → layers-C8PDiMul.js} +1 -1
  272. package/dist/client/assets/{layout-grid-B36Qsh0y.js → layout-grid-Cor2frzj.js} +1 -1
  273. package/dist/client/assets/left-Bn5X7x2o.js +2 -0
  274. package/dist/client/assets/left-BqS0fYX1.js +1 -0
  275. package/dist/client/assets/left-CTCeeeD3.js +1 -0
  276. package/dist/client/assets/left-DhtVPVux.js +1 -0
  277. package/dist/client/assets/left-K39b-Wvx.js +2 -0
  278. package/dist/client/assets/left-KGmueNPt.js +1 -0
  279. package/dist/client/assets/left-P_GOYB-s.js +1 -0
  280. package/dist/client/assets/left-advisor-B0N47De2.js +1 -0
  281. package/dist/client/assets/left-agents-CsSNc51Y.js +1 -0
  282. package/dist/client/assets/left-default-BlO5LP2T.js +1 -0
  283. package/dist/client/assets/left-lanes-C4PhaJE6.js +1 -0
  284. package/dist/client/assets/left-mission-BjTE5vPa.js +1 -0
  285. package/dist/client/assets/library-CkWNPHRp.js +1 -0
  286. package/dist/client/assets/{loader-circle-DNUsuPWz.js → loader-circle-OvccU82H.js} +1 -1
  287. package/dist/client/assets/{local-agents-I40PawYA.js → local-agents-BqnoxJrq.js} +1 -1
  288. package/dist/client/assets/log-in-7SnYqW5w.js +1 -0
  289. package/dist/client/assets/{machine-children-CdhNzDF0.js → machine-children-DxcqCLmd.js} +1 -1
  290. package/dist/client/assets/media-blobs-Bi8pxr1u.js +1 -0
  291. package/dist/client/assets/{mentions-Ck_Vjnyp.js → mentions-ByUvhS-v.js} +1 -1
  292. package/dist/client/assets/{mesh-ops-DSlvHp-D.js → mesh-ops-CiZ8xSAx.js} +1 -1
  293. package/dist/client/assets/{mesh-view-store-C1-mdP3P.js → mesh-view-store-DZvJC4KU.js} +1 -1
  294. package/dist/client/assets/{message-circle-cI5_A5mj.js → message-circle-CxRVKNE-.js} +1 -1
  295. package/dist/client/assets/message-markup-BQW5jdJw.js +15 -0
  296. package/dist/client/assets/message-markup-Zwo3t4cI.js +1 -0
  297. package/dist/client/assets/{message-square-CJW4WRlo.js → message-square-BxesYglW.js} +1 -1
  298. package/dist/client/assets/mission-control-model-BpJHDV5D.js +1 -0
  299. package/dist/client/assets/{mission-control-store-p_cboAm4.js → mission-control-store-elEEsIvb.js} +1 -1
  300. package/dist/client/assets/{mission-wall-DOuGOxQy.js → mission-wall-CAo4BKfa.js} +1 -1
  301. package/dist/client/assets/{monitor-C7_cHlkC.js → monitor-DTTYEb73.js} +1 -1
  302. package/dist/client/assets/{nav-destinations-CU_euC-Q.js → nav-destinations-uorRqFxf.js} +1 -1
  303. package/dist/client/assets/{observe-CtS0l3zu.js → observe-BJqERJVj.js} +1 -1
  304. package/dist/client/assets/{page-status-DwFR4wSw.js → page-status-BswZLqvA.js} +1 -1
  305. package/dist/client/assets/{panel-right-qP17MwMl.js → panel-right-Bv7sP_fc.js} +1 -1
  306. package/dist/client/assets/paperclip-BjcuP_Hx.js +1 -0
  307. package/dist/client/assets/{pause-B_hliKuR.js → pause-C2XTlkjs.js} +1 -1
  308. package/dist/client/assets/{persistent-state-BUsTTZFE.js → persistent-state-KRk_yb0q.js} +1 -1
  309. package/dist/client/assets/{pin-Oi4qHR6M.js → pin-C2mFOV1l.js} +1 -1
  310. package/dist/client/assets/{play-CVeRmqLH.js → play-FT6K3It1.js} +1 -1
  311. package/dist/client/assets/{plus-D5NLH_fM.js → plus-DFDDeGKu.js} +1 -1
  312. package/dist/client/assets/profile-DTmzN16I.js +1 -0
  313. package/dist/client/assets/{projects-inbox-CfwxCTdN.js → projects-inbox-C0FUCv_p.js} +1 -1
  314. package/dist/client/assets/projects-inbox-ColX6lpx.css +1 -0
  315. package/dist/client/assets/{provider-DwmCoSlc.js → provider-Dojd8quC.js} +1 -1
  316. package/dist/client/assets/{proxy-DgzP27W8.js → proxy-AJsmwA6h.js} +1 -1
  317. package/dist/client/assets/{radio-Cas2qg1D.js → radio-DRoOZsws.js} +1 -1
  318. package/dist/client/assets/{refresh-cw-IcD2lPoT.js → refresh-cw-BmVr7sCD.js} +1 -1
  319. package/dist/client/assets/resolve-panes-pbY1fCWi.js +1 -0
  320. package/dist/client/assets/resolve-sidebar-context-YWkZTq1t.js +1 -0
  321. package/dist/client/assets/right-49kO-6nD.js +1 -0
  322. package/dist/client/assets/right-APtItA8A.js +1 -0
  323. package/dist/client/assets/right-BJwhPqtn.js +1 -0
  324. package/dist/client/assets/right-BPqrf4ek.js +1 -0
  325. package/dist/client/assets/right-D7djOy6K.js +1 -0
  326. package/dist/client/assets/right-DKOUCRob.js +1 -0
  327. package/dist/client/assets/right-DMNrVzg7.js +1 -0
  328. package/dist/client/assets/{right-cjPTwPXS.js → right-DWPVB-nK.js} +1 -1
  329. package/dist/client/assets/right-DppeMCy4.js +1 -0
  330. package/dist/client/assets/right-GAL5Mw1v.js +1 -0
  331. package/dist/client/assets/{rocket-DAqYvu8I.js → rocket-CGl4RTV7.js} +1 -1
  332. package/dist/client/assets/router-DCtl8wqb.js +1 -0
  333. package/dist/client/assets/runtime-picker-DXu2bOTh.js +1 -0
  334. package/dist/client/assets/{scope-views-Dl3ml9OZ.js → scope-views-RUWwCVAr.js} +1 -1
  335. package/dist/client/assets/scout-voice-CZx60X6E.js +1 -0
  336. package/dist/client/assets/{scoutbot-markdown-DwvGQOWo.js → scoutbot-markdown-BKEBSbG0.js} +1 -1
  337. package/dist/client/assets/{scroll-text-B0tKI9Sg.js → scroll-text-DNjxhyO2.js} +1 -1
  338. package/dist/client/assets/{search-UsM-9-_W.js → search-DT42oyRW.js} +1 -1
  339. package/dist/client/assets/secondaryNavConfig-CS1svh6n.js +1 -0
  340. package/dist/client/assets/{selection-bridge-OTS2iFkt.js → selection-bridge-x3wFUjxj.js} +1 -1
  341. package/dist/client/assets/{send-horizontal-BlQsRK6C.js → send-horizontal-CH0-fbZE.js} +1 -1
  342. package/dist/client/assets/{send-to-agent-session-C1mgqdow.js → send-to-agent-session-DoKCDBJ4.js} +1 -1
  343. package/dist/client/assets/{server-DBlPW0Mp.js → server-QfsgMLk1.js} +1 -1
  344. package/dist/client/assets/{session-catalog-CnpZMB7C.js → session-catalog-CvSdPHPe.js} +1 -1
  345. package/dist/client/assets/session-recap-lanes-D-eVJnpY.js +1 -0
  346. package/dist/client/assets/session-recap-queue-41l2XVkI.js +1 -0
  347. package/dist/client/assets/{session-table-CGkfG5Yd.js → session-table-L-pns6Zl.js} +1 -1
  348. package/dist/client/assets/{sessions-view-Bge4XZ4I.js → sessions-view-Dc-QAa7O.js} +1 -1
  349. package/dist/client/assets/{settings-C69Zjrpq.js → settings-BVh7kldq.js} +1 -1
  350. package/dist/client/assets/{sliders-horizontal-6bzeod7c.js → sliders-horizontal-782VC_yy.js} +1 -1
  351. package/dist/client/assets/{sparkles-Cc5lPZRv.js → sparkles-BjHq_DNK.js} +1 -1
  352. package/dist/client/assets/{sse-A8AyLH0g.js → sse-BCPRocpq.js} +1 -1
  353. package/dist/client/assets/system-surfaces-redesign-q2BmCB7e.css +1 -0
  354. package/dist/client/assets/{tail-events-C4WdhVeK.js → tail-events-d0yAYxR0.js} +1 -1
  355. package/dist/client/assets/{terminal-DMZjX1es.js → terminal-hQKQygcf.js} +1 -1
  356. package/dist/client/assets/{terminal-relay-mO89dX-Y.js → terminal-relay-Bxs1hp-j.js} +1 -1
  357. package/dist/client/assets/{terminal-takeover-CZZsnPzj.js → terminal-takeover-Ay5C2c-M.js} +1 -1
  358. package/dist/client/assets/theme-vars-DNK0nn3k.js +1 -0
  359. package/dist/client/assets/triangle-alert-CHoRGdVO.js +1 -0
  360. package/dist/client/assets/{use-beside-D3cJpA5p.js → use-beside-DoRC1nt0.js} +1 -1
  361. package/dist/client/assets/{use-conversation-list-D5EnpVba.js → use-conversation-list-CY4JciOV.js} +1 -1
  362. package/dist/client/assets/{use-fleet-active-asks-D_QOmjg5.js → use-fleet-active-asks-CymmXWH4.js} +1 -1
  363. package/dist/client/assets/{use-mesh-node-state-3V3ADQ-G.js → use-mesh-node-state-BvaqtODo.js} +1 -1
  364. package/dist/client/assets/{use-mesh-ops-items-DI9GKWlF.js → use-mesh-ops-items-BSYaqH_0.js} +1 -1
  365. package/dist/client/assets/{use-reduced-motion-CiaZHMnk.js → use-reduced-motion-3gMYZNIp.js} +1 -1
  366. package/dist/client/assets/{use-scout-dev-flags-CkdAHlDR.js → use-scout-dev-flags-DS_pYYQd.js} +1 -1
  367. package/dist/client/assets/{useAgentHoverCard-A3QGXqIy.js → useAgentHoverCard-BANmpjMh.js} +1 -1
  368. package/dist/client/assets/useContentSecondaryNav-C6OBu-3_.js +1 -0
  369. package/dist/client/assets/{useEmbedHeadline-atkQVfGw.js → useEmbedHeadline-D6pJRxUg.js} +1 -1
  370. package/dist/client/assets/usePersistentState-B8lP7TRb.js +1 -0
  371. package/dist/client/assets/{usePierreRuntime-DTvcwISe.js → usePierreRuntime-BAQdiN0L.js} +1 -1
  372. package/dist/client/assets/useSidebarCollapse-OL_8J5cL.js +1 -0
  373. package/dist/client/assets/{users-RLK3P5U4.js → users-BUjx36gx.js} +1 -1
  374. package/dist/client/assets/voice-paths-CJUuBPh3.css +1 -0
  375. package/dist/client/assets/voice-turn-DftA0iIb.css +1 -0
  376. package/dist/client/assets/voice-turn-ledger-BMZxlSjg.js +1 -0
  377. package/dist/client/assets/{wrench-B4maQJai.js → wrench-DR0i5BU7.js} +1 -1
  378. package/dist/client/assets/{x-rlMdRqJF.js → x-DAehov0E.js} +1 -1
  379. package/dist/client/assets/{xterm-B1zHHOLQ.js → xterm-BXQiLVnI.js} +1 -1
  380. package/dist/client/assets/{zap-B4X0OrEw.js → zap-CEjZNZbI.js} +1 -1
  381. package/dist/client/crew/sheets/eye-plate-v1/look-down-left.webp +0 -0
  382. package/dist/client/crew/sheets/eye-plate-v1/look-down-right.webp +0 -0
  383. package/dist/client/crew/sheets/eye-plate-v1/look-down.webp +0 -0
  384. package/dist/client/crew/sheets/eye-plate-v1/look-up-left.webp +0 -0
  385. package/dist/client/crew/sheets/eye-plate-v1/look-up-right.webp +0 -0
  386. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  387. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  388. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  389. package/dist/client/crew/sheets/sprout/look-down-left.webp +0 -0
  390. package/dist/client/crew/sheets/sprout/look-down-right.webp +0 -0
  391. package/dist/client/crew/sheets/sprout/look-down.webp +0 -0
  392. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  393. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  394. package/dist/client/crew/sheets/sprout/look-up-left.webp +0 -0
  395. package/dist/client/crew/sheets/sprout/look-up-right.webp +0 -0
  396. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  397. package/dist/client/index.html +2 -2
  398. package/dist/drizzle/0020_message_reactions.sql +11 -0
  399. package/dist/drizzle/meta/_journal.json +7 -0
  400. package/dist/main.mjs +542 -150
  401. package/dist/node/main.mjs +131 -17
  402. package/dist/pairing-runtime-controller.mjs +375 -78
  403. package/dist/runtime/base-daemon.mjs +98 -5
  404. package/dist/runtime/broker-daemon.mjs +1879 -1198
  405. package/dist/runtime/broker-process-manager.mjs +96 -3
  406. package/dist/runtime/mesh-discover.mjs +96 -3
  407. package/dist/scout-control-plane-web.mjs +4817 -1616
  408. package/dist/update-helper.mjs +211 -39
  409. package/package.json +5 -3
  410. package/server.json +31 -0
  411. package/dist/client/assets/ActivityScreen-CcDdQTBK.js +0 -1
  412. package/dist/client/assets/AgentAdventures-BxrYq_2v.js +0 -1
  413. package/dist/client/assets/AgentAvatar-NZOqcsB2.js +0 -1
  414. package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +0 -1
  415. package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +0 -1
  416. package/dist/client/assets/AgentFloorView-A0dDRlRV.js +0 -1
  417. package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +0 -1
  418. package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +0 -1
  419. package/dist/client/assets/AgentLanesView-WZhEDBFE.js +0 -2
  420. package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +0 -1
  421. package/dist/client/assets/AgentSessions-CO1WGa8Z.js +0 -6
  422. package/dist/client/assets/AgentsConsole-BQOWkj35.js +0 -1
  423. package/dist/client/assets/AgentsScreen-BMNAj1PH.js +0 -1
  424. package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +0 -1
  425. package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +0 -1
  426. package/dist/client/assets/BrokerScreen-CT37VQiL.js +0 -8
  427. package/dist/client/assets/ChannelComposer-BVItWlEz.js +0 -1
  428. package/dist/client/assets/ChannelSidebar-B-2spawY.js +0 -1
  429. package/dist/client/assets/ChatBits-CLJ71hTY.js +0 -1
  430. package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +0 -1
  431. package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +0 -1
  432. package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +0 -1
  433. package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +0 -1
  434. package/dist/client/assets/ConversationComposer-DNcn5U6D.js +0 -1
  435. package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +0 -1
  436. package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +0 -1
  437. package/dist/client/assets/ConversationScreen-Brfas2y0.css +0 -1
  438. package/dist/client/assets/ConversationScreen-tpj4cqWs.js +0 -2
  439. package/dist/client/assets/ConversationStatus-Cv-7hErW.js +0 -1
  440. package/dist/client/assets/CrewAvatar-zgzC3cbU.js +0 -1
  441. package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +0 -1
  442. package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +0 -1
  443. package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +0 -1
  444. package/dist/client/assets/FloorTacticalHUD-BhyOqlL5.js +0 -1
  445. package/dist/client/assets/HarnessMark-DSvM_H7H.js +0 -1
  446. package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +0 -1
  447. package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +0 -1
  448. package/dist/client/assets/InviteSheet--5Zjct25.js +0 -1
  449. package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +0 -1
  450. package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +0 -1
  451. package/dist/client/assets/MeshScreen-BW1dMFWF.js +0 -1
  452. package/dist/client/assets/MessagesScreen-CtNMfIvC.js +0 -1
  453. package/dist/client/assets/MissionControlView-BjPOViGY.js +0 -1
  454. package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +0 -1
  455. package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +0 -1
  456. package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +0 -1
  457. package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +0 -1
  458. package/dist/client/assets/NewChatComposer-BEXS8vV6.js +0 -19
  459. package/dist/client/assets/ObserveEmbedScreen-Dh30EjAQ.js +0 -2
  460. package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +0 -31
  461. package/dist/client/assets/OpsAgentsView-D3rM0udq.js +0 -1
  462. package/dist/client/assets/OpsScreen-DySeNQ1V.js +0 -1
  463. package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +0 -1
  464. package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +0 -1
  465. package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +0 -1
  466. package/dist/client/assets/ProjectsInbox-DfCXReZK.js +0 -2
  467. package/dist/client/assets/ProjectsRail-CELVubfJ.js +0 -1
  468. package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +0 -1
  469. package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +0 -1
  470. package/dist/client/assets/Provider-CNZluAZb.js +0 -5
  471. package/dist/client/assets/RailToggle-BwmY70B8.js +0 -1
  472. package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +0 -1
  473. package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +0 -9
  474. package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +0 -2
  475. package/dist/client/assets/SessionObserveEvidence-CS1aQBpQ.js +0 -1
  476. package/dist/client/assets/SessionRefScreen-DURV0MpF.js +0 -1
  477. package/dist/client/assets/SessionsScreen-D71ZR-8t.js +0 -1
  478. package/dist/client/assets/SettingsDrawer-Nz98oBVl.js +0 -3
  479. package/dist/client/assets/SettingsScreen-CYBHal6y.js +0 -1
  480. package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +0 -1
  481. package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +0 -2
  482. package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +0 -1
  483. package/dist/client/assets/Terminal-jIqnIZZ6.js +0 -4
  484. package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +0 -1
  485. package/dist/client/assets/WorkDetailScreen-Bcf_yHhU.js +0 -5
  486. package/dist/client/assets/WorldActorTalk-CKerDikx.js +0 -1
  487. package/dist/client/assets/WorldMinimap-DOptgrc4.js +0 -1
  488. package/dist/client/assets/agent-autocomplete-C7xwIcwd.css +0 -1
  489. package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +0 -2
  490. package/dist/client/assets/agents-screen-BMu6PpRY.css +0 -1
  491. package/dist/client/assets/at-sign-DM7xeppo.js +0 -1
  492. package/dist/client/assets/chat-api-BPVC0asu.js +0 -1
  493. package/dist/client/assets/chat-space-model-B6Jg2CY4.js +0 -4
  494. package/dist/client/assets/content-0AXa0klu.js +0 -1
  495. package/dist/client/assets/content-BEyJ19Lx.js +0 -1
  496. package/dist/client/assets/content-BN5weWKW.js +0 -1
  497. package/dist/client/assets/content-BNokkm7C.js +0 -1
  498. package/dist/client/assets/content-BV4PUM9q.js +0 -1
  499. package/dist/client/assets/content-BxUPlcx5.js +0 -1
  500. package/dist/client/assets/content-CIC5sku8.js +0 -1
  501. package/dist/client/assets/content-CdkTyxqk.js +0 -1
  502. package/dist/client/assets/content-CnhhSCZq.js +0 -1
  503. package/dist/client/assets/content-DY3F9Vfr.js +0 -1
  504. package/dist/client/assets/content-DrKBYpcb.js +0 -1
  505. package/dist/client/assets/content-LSStQYj5.js +0 -1
  506. package/dist/client/assets/content-YvU-D0hF.js +0 -1
  507. package/dist/client/assets/content-oKQMyVnH.js +0 -1
  508. package/dist/client/assets/conversation-model-m8HhzroS.js +0 -1
  509. package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +0 -1
  510. package/dist/client/assets/conversations-Cbg9h_Af.js +0 -1
  511. package/dist/client/assets/ctx-panel-F05jXK4Q.css +0 -1
  512. package/dist/client/assets/discover-DlwbftpC.js +0 -2
  513. package/dist/client/assets/embed-entry-c0lwtjBG.js +0 -2
  514. package/dist/client/assets/home-moving-signal-BIHUGNfI.js +0 -1
  515. package/dist/client/assets/home-now-card-CaLgZze2.js +0 -1
  516. package/dist/client/assets/hooks-DaUOREpP.js +0 -2
  517. package/dist/client/assets/index-CGbs0SBm.css +0 -1
  518. package/dist/client/assets/index-CbqBwfIW.js +0 -1
  519. package/dist/client/assets/index-CyPMl7Up.js +0 -1
  520. package/dist/client/assets/index-PQpJveGO.js +0 -1
  521. package/dist/client/assets/left-0vBrvrBG.js +0 -2
  522. package/dist/client/assets/left-C6SyaqlJ.js +0 -1
  523. package/dist/client/assets/left-CTuXysZR.js +0 -2
  524. package/dist/client/assets/left-Cc6s4DT2.js +0 -1
  525. package/dist/client/assets/left-DF5caiyh.js +0 -1
  526. package/dist/client/assets/left-DgT4tWCx.js +0 -1
  527. package/dist/client/assets/left-R0wppTTr.js +0 -1
  528. package/dist/client/assets/left-advisor-C-kt8V28.js +0 -1
  529. package/dist/client/assets/left-agents-thnBO156.js +0 -1
  530. package/dist/client/assets/left-default-CT42fnpF.js +0 -1
  531. package/dist/client/assets/left-lanes-CSmZgciK.js +0 -1
  532. package/dist/client/assets/left-mission-C86x6i9h.js +0 -1
  533. package/dist/client/assets/library-DdhYL_9v.js +0 -1
  534. package/dist/client/assets/message-markup-6Tgo4qFJ.js +0 -15
  535. package/dist/client/assets/mission-control-model-C30vU1Fe.js +0 -1
  536. package/dist/client/assets/profile-BegEUmB7.js +0 -1
  537. package/dist/client/assets/projects-inbox-CKPLZN8s.css +0 -1
  538. package/dist/client/assets/resolve-panes-pfZTezKo.js +0 -1
  539. package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +0 -1
  540. package/dist/client/assets/right-BDaCJ0CF.js +0 -1
  541. package/dist/client/assets/right-BP6lXRFS.js +0 -1
  542. package/dist/client/assets/right-Cb1VCrdj.js +0 -1
  543. package/dist/client/assets/right-CeFaxfBo.js +0 -1
  544. package/dist/client/assets/right-Ck2SrYCj.js +0 -1
  545. package/dist/client/assets/right-D-uv5YfF.js +0 -1
  546. package/dist/client/assets/right-DJMSICky.js +0 -1
  547. package/dist/client/assets/right-Dnljs8ah.js +0 -1
  548. package/dist/client/assets/right-SdCSF8PP.js +0 -1
  549. package/dist/client/assets/router-C-MF5-mb.js +0 -1
  550. package/dist/client/assets/runtime-picker-C_AVYF63.js +0 -1
  551. package/dist/client/assets/scout-voice-CqAyfblr.js +0 -1
  552. package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +0 -1
  553. package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +0 -1
  554. package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +0 -1
  555. package/dist/client/assets/usePersistentState-Y8XwSTg-.js +0 -1
  556. package/dist/drizzle/meta/0000_snapshot.json +0 -4575
  557. package/dist/drizzle/meta/0001_snapshot.json +0 -4624
  558. package/dist/drizzle/meta/0002_snapshot.json +0 -4631
  559. package/dist/drizzle/meta/0003_snapshot.json +0 -4952
  560. package/dist/drizzle/meta/0004_snapshot.json +0 -5235
  561. package/dist/drizzle/meta/0005_snapshot.json +0 -5599
  562. package/dist/drizzle/meta/0006_snapshot.json +0 -5606
  563. package/dist/drizzle/meta/0007_snapshot.json +0 -5767
  564. package/dist/drizzle/meta/0008_snapshot.json +0 -5774
  565. package/dist/drizzle/meta/0009_snapshot.json +0 -6262
  566. package/dist/drizzle/meta/0010_snapshot.json +0 -6286
  567. package/dist/drizzle/meta/0011_snapshot.json +0 -6337
  568. package/dist/drizzle/meta/0012_snapshot.json +0 -6458
  569. package/dist/drizzle/meta/0013_snapshot.json +0 -6465
  570. package/dist/drizzle/meta/0014_snapshot.json +0 -6503
  571. package/dist/drizzle/meta/0015_snapshot.json +0 -6596
  572. package/dist/drizzle/meta/0016_snapshot.json +0 -6611
  573. package/dist/drizzle/meta/0017_snapshot.json +0 -6785
  574. package/dist/drizzle/meta/0018_snapshot.json +0 -6804
  575. package/dist/drizzle/meta/0019_snapshot.json +0 -6804
@@ -1 +1 @@
1
- import{r as t,j as e}from"./index-DReVb7jZ.js";/* empty css */import{a as re}from"./api-DSqpVKC7.js";import{J as te,aw as ae,ax as A,I as ie,ay as ce,az as de,aA as B,aB as oe,aC as J,aD as le,aE as he,aF as pe,P as ue}from"./router-C-MF5-mb.js";import{u as xe}from"./Provider-CNZluAZb.js";import{c as P}from"./createLucideIcon-ChvMq-zl.js";import{X as me}from"./x-rlMdRqJF.js";import{C as V}from"./check-g7D7-c1J.js";import{C as D}from"./copy-BGOC1tJB.js";import{E as je}from"./external-link-BVccgH0n.js";import{L as fe}from"./loader-circle-DNUsuPWz.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"}]],U=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 X(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=X(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 G({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(U,{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(U,{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:X(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:G},Symbol.toStringTag,{value:"Module"})),Ke=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:G},Symbol.toStringTag,{value:"Module"}));export{G as K,Ke as a,Ie as r};
1
+ import{r as t,j as e}from"./index-EsrkGBcv.js";/* empty css */import{a as re}from"./api-DSqpVKC7.js";import{J as te,aw as ae,ax as A,I as ie,ay as ce,az as de,aA as B,aB as oe,aC as J,aD as le,aE as he,aF as pe,P as ue}from"./router-DCtl8wqb.js";import{u as xe}from"./Provider-C35yu29I.js";import{c as P}from"./createLucideIcon-zZ8Hx7er.js";import{X as me}from"./x-DAehov0E.js";import{C as V}from"./check-lrJ3a73a.js";import{C as D}from"./copy-xKeM5ZtU.js";import{E as je}from"./external-link-CUObqmgX.js";import{L as fe}from"./loader-circle-OvccU82H.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"}]],U=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 X(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=X(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 G({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(U,{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(U,{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:X(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:G},Symbol.toStringTag,{value:"Module"})),Ke=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:G},Symbol.toStringTag,{value:"Module"}));export{G as K,Ke as a,Ie as r};
@@ -0,0 +1 @@
1
+ import{r,j as e}from"./index-EsrkGBcv.js";/* empty css */import{a as _}from"./api-DSqpVKC7.js";import{d as Pe}from"./time-Dhsh_2EG.js";import{u as We}from"./Provider-C35yu29I.js";import{x as $e,y as Se,z as Oe,A as _e,B as Ue,C as Ne,K as k,D as ze,E as Ae,F 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-DCtl8wqb.js";import{S as ss}from"./search-DT42oyRW.js";import{X as ts}from"./x-DAehov0E.js";import{L as ve}from"./loader-circle-OvccU82H.js";import{c as ns}from"./createLucideIcon-zZ8Hx7er.js";import{S as as}from"./sparkles-BjHq_DNK.js";import{C as is}from"./chevron-down-l1mrh5S9.js";import{C as rs}from"./clock-BV1aqPkK.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./HarnessMark-C4naWc16.js";import"./conversation-model-FxDeWlle.js";import"./conversations-DoAAO6kA.js";import"./colors-CFlbwC25.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.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 Fe(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=>Ae[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 mt({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),[F,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(F),[F]),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]),A=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()&&A(s,d)}catch(d){h()&&(M(l),w(d instanceof Error?d.message:String(d)))}finally{n===J.current&&B(!1)}},[A,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()&&A(l,await ne(l.query.trim(),l))}catch(n){w(n instanceof Error?n.message:String(n))}finally{P(!1)}},[A]);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()&&A(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}},[A]),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:Ae[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))]}),Fe(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&&F.length>0?e.jsxs("span",{className:"ks-hit-list-meta",children:[N(F.length)," moment",F.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:F.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,Fe(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{mt as KnowledgeSearchScreen};
@@ -1 +1 @@
1
- import{r as n,j as T}from"./index-DReVb7jZ.js";import{r as j}from"./index-CbqBwfIW.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};
1
+ import{r as n,j as T}from"./index-EsrkGBcv.js";import{r as j}from"./index-724SdE6r.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 t}from"./index-EsrkGBcv.js";import{S as L}from"./SlidePanel-_CHAQdOa.js";import{A as j}from"./AgentAvatar-CrP1eXxk.js";import{H as S}from"./HarnessMark-C4naWc16.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as g,f as k,a as y}from"./lane-observe-CteDwdD-.js";import{S as A}from"./SessionObserve-DXxBvejJ.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-TbrNHRj_.js";import{b as T}from"./agent-lane-detail-Ti3trpfH.js";import{l as I,a as z}from"./agent-lanes-model-DMAdqCmK.js";import"./Provider-C35yu29I.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./router-DCtl8wqb.js";import"./api-DSqpVKC7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./createLucideIcon-zZ8Hx7er.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./conversation-model-FxDeWlle.js";import"./conversations-DoAAO6kA.js";import"./colors-CFlbwC25.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.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-CJa110yk.js";import"./lane-ask-display-BTVSakyo.js";import"./mentions-ByUvhS-v.js";import"./AgentDetailCard-DtHT3sCo.js";import"./AgentLiveActions-CfTupTEl.js";import"./terminal-takeover-Ay5C2c-M.js";import"./openContent-C6XO6kr5.js";import"./eye-LrO-cXQt.js";import"./terminal-hQKQygcf.js";import"./message-markup-Zwo3t4cI.js";import"./message-markup-BQW5jdJw.js";import"./SessionHopMenu-E6VJZrE0.js";import"./external-link-CUObqmgX.js";import"./ObservedTopologyPanel-CUTIoLZJ.js";import"./ObserveTextFlow-PFnG_10h.js";import"./use-reduced-motion-3gMYZNIp.js";import"./proxy-AJsmwA6h.js";import"./SessionObserveEvidence-Cuj_KHxR.js";import"./SessionContextStrip-CXfs9hUD.js";import"./message-circle-CxRVKNE-.js";import"./wrench-DR0i5BU7.js";import"./context-budget-8qFKqM-j.js";const M={think:"Thought",tool:"Tool",ask:"Request",message:"Message",note:"Note",system:"System",boot:"Boot"};function re({target:d,onClose:n}){const{lane:i,event:e}=d,{agent:o,observe:p,source:r,lastActiveAt:a}=i,l=f.useMemo(()=>T(i),[i]),c=I(o,r),v=z(o,r),h=M[e.kind]??e.kind,u=p?.metadata?.session?.sessionStart,s=g(e,u),b=s!=null?k(s,a):void 0,x=s!=null?y(s):void 0,m=e.kind==="tool"||e.kind==="ask"?e:void 0;return t.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:[t.jsxs("div",{className:"s-slide-header s-lane-trace-sheet-header",children:[t.jsx(j,{agent:o,placement:"row",size:28,presence:!1,className:"s-agent-lane-avatar"}),t.jsxs("div",{className:"s-lane-trace-sheet-header-copy",children:[t.jsx("div",{className:"s-lane-trace-sheet-title",children:c}),t.jsxs("div",{className:"s-lane-trace-sheet-sub",children:[v," · ",h,a?` · ${N(a)}`:""]})]}),t.jsx("span",{className:"s-slide-spacer"}),t.jsx(S,{harness:o.harness??l.harness,size:18,className:"s-lane-trace-sheet-hmark"}),t.jsx("button",{type:"button",className:"s-slide-close",onClick:n,"aria-label":"Close",children:"×"})]}),t.jsx("div",{className:"s-slide-body s-lane-trace-sheet-body",children:t.jsx(A,{data:p??void 0,agentId:r==="scout"?o.id:void 0,sessionId:o.harnessSessionId??l.sessionId,showRail:!0,variant:"default",initialCursorT:e.t,focusEventId:e.id,inlineFocusEventId:m?.id,inlineFocusContent:m?t.jsx(E,{event:m,wallLabel:b,wallTitle:x,variant:"inline"}):void 0})})]})}export{re as LaneTraceDetailSheet};
@@ -1 +1 @@
1
- import{j as e,r as o}from"./index-DReVb7jZ.js";import{i as x,l as h}from"./lane-edit-display-BjdT9oZl.js";import{b as p}from"./lane-ask-display-BTVSakyo.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};
1
+ import{j as e,r as o}from"./index-EsrkGBcv.js";import{i as x,l as h}from"./lane-edit-display-BjdT9oZl.js";import{b as p}from"./lane-ask-display-BTVSakyo.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};
@@ -1,3 +1,3 @@
1
- import{r as u,j as s}from"./index-DReVb7jZ.js";import{C as pe}from"./Canvas-CRP0KjKb.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-C1-mdP3P.js";import{NodeMenu as ge,nodeMenuRowProps as be}from"./NodeMenu-CcOeFRCB.js";import{c as ve,b as Ne}from"./machine-children-CdhNzDF0.js";import{u as je,s as Ce,r as Me}from"./use-mesh-node-state-3V3ADQ-G.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-CNZluAZb.js";import{u as He}from"./useAgentHoverCard-A3QGXqIy.js";import"./index-CbqBwfIW.js";import"./api-DSqpVKC7.js";import"./provider-DwmCoSlc.js";import"./router-C-MF5-mb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-A8AyLH0g.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-BEXS8vV6.js";import"./runtime-picker-C_AVYF63.js";import"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DNUsuPWz.js";import"./createLucideIcon-ChvMq-zl.js";import"./conversation-model-m8HhzroS.js";import"./conversations-Cbg9h_Af.js";import"./HarnessMark-DSvM_H7H.js";import"./NewChatOrigin-C8ROO4ps.js";import"./keyboard-nav-CJXPaHXj.js";import"./x-rlMdRqJF.js";import"./chevron-down-CDzRQQGl.js";import"./search-UsM-9-_W.js";import"./file-text-DP6txVW-.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DlMiEALb.js";import"./TextDocumentSurface-BK6Qy41F.js";import"./index-kkXUq-zf.js";import"./chevron-right-DKGTLiqc.js";import"./folder-B_S7gBVr.js";import"./chevron-up-DX7R6KY2.js";import"./code-xml-Cmadr3pQ.js";import"./arrow-left-DFfKAq0d.js";import"./arrow-right-DmAWnyAH.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";import"./AgentDetailCard-MIEBKw_S.js";import"./AgentLiveActions-6Kfr1uOT.js";import"./terminal-takeover-CZZsnPzj.js";import"./openContent-C6XO6kr5.js";import"./eye-CsGfEVR6.js";import"./terminal-DMZjX1es.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}
1
+ import{r as u,j as s}from"./index-EsrkGBcv.js";import{C as pe}from"./Canvas-X9pVSkw3.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-DZvJC4KU.js";import{NodeMenu as ge,nodeMenuRowProps as be}from"./NodeMenu-B-jjHf1c.js";import{c as ve,b as Ne}from"./machine-children-DxcqCLmd.js";import{u as je,s as Ce,r as Me}from"./use-mesh-node-state-BvaqtODo.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-C35yu29I.js";import{u as He}from"./useAgentHoverCard-BANmpjMh.js";import"./index-724SdE6r.js";import"./api-DSqpVKC7.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./router-DCtl8wqb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./createLucideIcon-zZ8Hx7er.js";import"./media-blobs-Bi8pxr1u.js";import"./HarnessMark-C4naWc16.js";import"./conversation-model-FxDeWlle.js";import"./conversations-DoAAO6kA.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./AgentDetailCard-DtHT3sCo.js";import"./AgentLiveActions-CfTupTEl.js";import"./terminal-takeover-Ay5C2c-M.js";import"./openContent-C6XO6kr5.js";import"./eye-LrO-cXQt.js";import"./terminal-hQKQygcf.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
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};
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 Js({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{Js as MeshCanvas};
@@ -1 +1 @@
1
- import{r as g,j as e}from"./index-DReVb7jZ.js";import{u as I,g as S,t as k,a as b,r as B}from"./mesh-view-store-C1-mdP3P.js";import{u as L}from"./Provider-CNZluAZb.js";import{a as N,e as P}from"./agent-state-DDhnFEEP.js";import{a as v}from"./use-mesh-node-state-3V3ADQ-G.js";import{c as R,m as y}from"./machine-children-CdhNzDF0.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};
1
+ import{r as g,j as e}from"./index-EsrkGBcv.js";import{u as I,g as S,t as k,a as b,r as B}from"./mesh-view-store-DZvJC4KU.js";import{u as L}from"./Provider-C35yu29I.js";import{a as N,e as P}from"./agent-state-DDhnFEEP.js";import{a as v}from"./use-mesh-node-state-BvaqtODo.js";import{c as R,m as y}from"./machine-children-DxcqCLmd.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-EsrkGBcv.js";import{a as z}from"./api-DSqpVKC7.js";import{b as E}from"./use-mesh-node-state-BvaqtODo.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-C35yu29I.js";import{d as V}from"./router-DCtl8wqb.js";import{MeshCanvas as Q}from"./MeshCanvas-DWZHYh1A.js";import{s as J}from"./colors-CFlbwC25.js";import{u as W}from"./useAgentHoverCard-BANmpjMh.js";import{u as X}from"./local-agents-BqnoxJrq.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-DZvJC4KU.js";import{u as se}from"./useContentSecondaryNav-C6OBu-3_.js";import{OpsSubnav as te}from"./OpsSubnav-BOOYShHE.js";/* empty css *//* empty css */import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./createLucideIcon-zZ8Hx7er.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./HarnessMark-C4naWc16.js";import"./conversation-model-FxDeWlle.js";import"./conversations-DoAAO6kA.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./Canvas-X9pVSkw3.js";import"./NodeMenu-B-jjHf1c.js";import"./machine-children-DxcqCLmd.js";import"./AgentDetailCard-DtHT3sCo.js";import"./AgentLiveActions-CfTupTEl.js";import"./terminal-takeover-Ay5C2c-M.js";import"./openContent-C6XO6kr5.js";import"./eye-LrO-cXQt.js";import"./terminal-hQKQygcf.js";import"./SecondaryNav-D7dbV2qo.js";import"./secondaryNavConfig-CS1svh6n.js";import"./nav-destinations-uorRqFxf.js";import"./message-square-BxesYglW.js";import"./compass-63TUaz5_.js";import"./settings-BVh7kldq.js";import"./git-branch-B0_fPLO7.js";import"./scroll-text-DNjxhyO2.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 Cs({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{Cs as MeshScreen};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/arc.es-CubLvQ4W.js","assets/index-DReVb7jZ.js","assets/index-CGbs0SBm.css"])))=>i.map(i=>d[i]);
2
- import{r as g,j as d,_ as j}from"./index-DReVb7jZ.js";const E=g.lazy(()=>j(()=>import("./arc.es-CubLvQ4W.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-C1SQHJ3k.js","assets/index-EsrkGBcv.js","assets/index-CN4rBB_s.css"])))=>i.map(i=>d[i]);
2
+ import{r as g,j as d,_ as j}from"./index-EsrkGBcv.js";const E=g.lazy(()=>j(()=>import("./arc.es-C1SQHJ3k.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};
@@ -0,0 +1 @@
1
+ import{j as a,r as b}from"./index-EsrkGBcv.js";const N=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,x=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function o(e){if(typeof e!="string")return null;try{const t=new URL(e.trim());return t.protocol==="http:"||t.protocol==="https:"?t.toString():null}catch{return null}}function i(e,t){const n=e?.[t];return typeof n=="string"&&n.trim()?n.trim():null}function j(e){return e.mediaType.toLowerCase().startsWith("image/")}function y(e){return N.test(e)}function U(e){try{const t=new URL(e),n=[t.pathname==="/"?"":t.pathname,t.search].join("").trim();return{host:t.hostname.replace(/^www\./iu,""),detail:n||t.hostname}}catch{return{host:e,detail:e}}}function E(e){const t=new Set,n=[];for(const r of e.matchAll(x)){const l=r[0]?.replace(/[.,;:!?]+$/u,""),m=o(l);!m||t.has(m)||(t.add(m),n.push(m))}return n}const T=/^\/api\/blobs\/[^/]+$/u;function g(e){try{const t=new URL(e);return T.test(t.pathname)?`${t.pathname}${t.search}`:e}catch{return e}}function u(e){return o(e.url)??o(i(e.metadata,"url"))??o(i(e.metadata,"href"))}function k(e){const t=e.metadata??null,n=i(t,"kind")??i(t,"type"),r=u(e);if(!r||n!=="link_preview"&&n!=="link-preview"&&e.mediaType!=="text/x-uri")return null;const l=U(r);return{id:e.id,url:r,title:i(t,"title")??l.host,description:i(t,"description"),imageUrl:o(i(t,"imageUrl")??i(t,"image")),siteName:i(t,"siteName")??l.host}}function w({src:e,alt:t}){const[n,r]=b.useState(!1);return n?a.jsxs("a",{className:"s-message-embed s-message-embed--file",href:e,target:"_blank",rel:"noreferrer",children:[a.jsx("span",{className:"s-message-embed-title",children:t}),a.jsx("span",{className:"s-message-embed-description",children:"Preview unavailable"})]}):a.jsx("a",{className:"s-message-embed s-message-embed--image",href:e,target:"_blank",rel:"noreferrer",children:a.jsx("img",{src:e,alt:t,loading:"lazy",decoding:"async",onError:()=>r(!0)})})}function A({preview:e}){return a.jsxs("a",{className:"s-message-embed s-message-embed--link",href:e.url,target:"_blank",rel:"noreferrer",children:[e.imageUrl&&a.jsx("span",{className:"s-message-embed-thumb",children:a.jsx("img",{src:e.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),a.jsxs("span",{className:"s-message-embed-copy",children:[e.siteName&&a.jsx("span",{className:"s-message-embed-site",children:e.siteName}),a.jsx("span",{className:"s-message-embed-title",children:e.title}),e.description&&a.jsx("span",{className:"s-message-embed-description",children:e.description})]})]})}function L({message:e}){const t=e.attachments??[],n=new Set,r=[],l=[];for(const s of t){const c=u(s);if(c&&j(s)){n.add(s.id),r.push({id:s.id,src:g(c),alt:s.fileName??"Image attachment"});continue}const d=k(s);d&&(n.add(s.id),l.push(d))}const m=new Set(l.map(s=>s.url)),f=new Set(t.map(u).filter(s=>!!s));for(const s of E(e.body))f.has(s)||m.has(s)||y(s)&&r.push({id:s,src:g(s),alt:"Embedded image"});const p=t.filter(s=>!n.has(s.id));return r.length===0&&l.length===0&&p.length===0?null:a.jsxs("div",{className:"s-message-embeds",children:[r.map(s=>a.jsx(w,{src:s.src,alt:s.alt},s.id)),l.slice(0,1).map(s=>a.jsx(A,{preview:s},s.id)),p.map(s=>{const c=u(s),d=c?g(c):null,h=s.fileName??i(s.metadata,"title")??s.mediaType;return d?a.jsxs("a",{className:"s-message-embed s-message-embed--file",href:d,target:"_blank",rel:"noreferrer",children:[a.jsx("span",{className:"s-message-embed-title",children:h}),a.jsx("span",{className:"s-message-embed-description",children:s.mediaType})]},s.id):a.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[a.jsx("span",{className:"s-message-embed-title",children:h}),a.jsx("span",{className:"s-message-embed-description",children:s.mediaType})]},s.id)})]})}export{L as M,g as s};
@@ -0,0 +1 @@
1
+ import{j as e,r as c}from"./index-EsrkGBcv.js";import{a as w,c as b}from"./conversations-DoAAO6kA.js";import{m as M,c as A}from"./machine-scope-DJt9RZ2w.js";import{u as B,f as L}from"./use-fleet-active-asks-CymmXWH4.js";import{u as I,g as R,d as E}from"./router-DCtl8wqb.js";import{l as D,i as F,s as T}from"./sessionRead-CvFz2RHv.js";import{u as $}from"./use-conversation-list-CY4JciOV.js";import{u as C}from"./Provider-C35yu29I.js";import{AgentMasterScreen as O}from"./AgentMasterScreen-EJhmuKgl.js";import{CommsDeck as P}from"./CommsDeck-BVmSMV2V.js";import{ConversationScreen as S}from"./ConversationScreen-CUfsQ4MR.js";import{u as V,a as Y}from"./use-beside-DoRC1nt0.js";/* empty css */import{P as z}from"./plus-DFDDeGKu.js";import"./time-Dhsh_2EG.js";import"./api-DSqpVKC7.js";import"./sse-BCPRocpq.js";import"./index-BWHgHrtv.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-C97-iTMK.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./createLucideIcon-zZ8Hx7er.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./HarnessMark-C4naWc16.js";import"./conversation-model-FxDeWlle.js";import"./colors-CFlbwC25.js";import"./NewChatOrigin-DFbF_XvR.js";import"./keyboard-nav-DDHegDbx.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./AgentAvatar-CrP1eXxk.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";import"./sessions-view-Dc-QAa7O.js";import"./message-visibility-DwxgcgYK.js";import"./CommsFlowGraph-DxoOaLF_.js";import"./comms-gesture-_aGFo6g3.js";import"./CommsCanvas-THp0r_U8.js";import"./comms-deck-CBhsXnY-.js";import"./CommsFlowMap-Vi8ziCPg.js";import"./CommsSelection-BUoRbu9o.js";/* empty css */import"./agent-master-model-Bk_yuUXJ.js";import"./panel-right-Bv7sP_fc.js";import"./arrow-up-right-BPedAgxO.js";import"./ComposerAttachments-DW0AIb8k.js";import"./message-markup-Zwo3t4cI.js";import"./message-markup-BQW5jdJw.js";import"./mentions-ByUvhS-v.js";import"./AgentDetailCard-DtHT3sCo.js";import"./AgentLiveActions-CfTupTEl.js";import"./terminal-takeover-Ay5C2c-M.js";import"./openContent-C6XO6kr5.js";import"./eye-LrO-cXQt.js";import"./terminal-hQKQygcf.js";import"./operator-attention-DBaRg5ep.js";import"./clipboard-e3fSpeo7.js";import"./MessageEmbeds-ksPazAKH.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C-ZWscKj.js";import"./BackToPicker-CUkjnoVk.js";import"./AstronautSuit-Cchnc4Ug.js";import"./ConversationComposer-CUQyArlk.js";import"./zap-CEjZNZbI.js";import"./ConversationFeedRows-DWiOfT-y.js";import"./ConversationPanels-D9oC0xG5.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-3gMYZNIp.js";import"./proxy-AJsmwA6h.js";import"./activity-CIlFrfPJ.js";import"./message-circle-CxRVKNE-.js";import"./tail-events-d0yAYxR0.js";import"./ConversationStatus--IPm2nGh.js";import"./check-lrJ3a73a.js";import"./sparkles-BjHq_DNK.js";import"./triangle-alert-CHoRGdVO.js";import"./SessionContextStrip-CXfs9hUD.js";function _t({conversationId:s,agentId:l,threadId:x,machineId:m,navigate:r}){const t=V(),d=Y(r,m);let n;return l?n=e.jsx(O,{agentId:l,threadId:x,machineId:m,navigate:r}):s?n=e.jsx(U,{conversationId:s,navigate:r,beside:t}):n=e.jsx(_,{}),e.jsxs("div",{className:"amv",children:[e.jsx("section",{className:"amv-main",children:n}),e.jsx(P,{ids:t.ids,onClose:t.remove,onStage:o=>{d(o),t.remove(o)},renderConversation:o=>e.jsx(S,{conversationId:o,navigate:r,embedded:!0,showBackNav:!1},o)})]})}function U({conversationId:s,navigate:l,beside:x}){const{agents:m}=C(),r=I(),t=c.useMemo(()=>R(r.state),[r.state]),d=c.useMemo(()=>!t||t.view!=="messages"||!t.agentId?void 0:`Back to ${m.find(o=>o.id===t.agentId)?.name??t.agentId.split(".")[0]??t.agentId}`,[t,m]);return e.jsx(S,{conversationId:s,navigate:l,showBackNav:!!t,backLabel:d,beside:x},s)}function _(){const{onlineCount:s,apiConnection:l,reload:x,route:m,agents:r,openContextCapture:t,navigate:d}=C(),{sessions:n,loading:o,loadError:a}=$(),[h]=c.useState(()=>D()),g=B(),i=l.status==="offline",u=E(m),j=c.useRef(!1),N=c.useMemo(()=>{const y=M(r,u);return[...A(n,y,u)].sort((k,p)=>(p.lastMessageAt??0)-(k.lastMessageAt??0))},[n,r,u]),v=c.useMemo(()=>{const y=N.filter(p=>!w(p));return y.find(p=>L(g,p)?.status==="needs_attention"&&F(p.lastMessageAt,p.id,h))??y[0]},[N,g,h]);c.useEffect(()=>{j.current||o||a||i||v&&(j.current=!0,T(v.id),d({view:"messages",conversationId:v.id,...u?{machineId:u}:{}},{replace:!0}))},[v,o,a,i,u,d]);const f=!i&&!a&&(o||!!v);return e.jsx("div",{className:`s-conv-empty${i?" s-conv-empty--offline":""}`,children:e.jsxs("div",{className:"s-conv-empty-inner",children:[e.jsx(G,{}),e.jsx("div",{className:"s-conv-empty-eyebrow",children:i?"Connection":"Conversations"}),e.jsx("p",{className:"s-conv-empty-title",children:i?"Scout server offline":f?"Opening your latest conversation":a?"Chats unavailable":"Nothing open yet"}),e.jsx("p",{className:"s-conv-empty-detail",children:i?"Start or restart Scout services. Chats and context will appear when the server responds.":f?q(v):a||"Start a chat by choosing an agent and sending the first message."}),i||a?e.jsx("button",{type:"button",className:"s-conv-empty-action",onClick:()=>{x()},children:"Retry connection"}):f?null:e.jsxs("button",{type:"button",className:"s-conv-empty-new",onClick:()=>t(),children:[e.jsx(z,{size:16,"aria-hidden":"true"}),"New chat"]}),e.jsxs("div",{className:"s-conv-empty-ambient",children:[e.jsx("span",{className:"s-conv-empty-ambient-dot","aria-hidden":"true"}),i?"waiting for server":`${s} ${s===1?"agent":"agents"} active`]})]})})}function q(s){return s?b(s):"Finding where you left off."}function G(){return e.jsxs("svg",{className:"s-conv-empty-mesh",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"24",y2:"46"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"50",y2:"54"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"50",y1:"54",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"50",y2:"54"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"14",cy:"20",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"58",cy:"24",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"24",cy:"46",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"50",cy:"54",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node s-conv-empty-mesh-node--accent",cx:"36",cy:"12",r:"3.5"})]})}export{_t as MessagesScreen};
@@ -1 +1 @@
1
- import{r as h,j as s}from"./index-DReVb7jZ.js";import{H as A}from"./HarnessMark-DSvM_H7H.js";import{s as C,t as M,b as k}from"./bash-format-BRV5C6Gv.js";import{d as E,c as S}from"./context-budget-8qFKqM-j.js";import{s as b}from"./page-status-DwFR4wSw.js";import{t as T}from"./time-Dhsh_2EG.js";import{b as y,a as B,l as O}from"./agent-lane-detail-Ti3trpfH.js";import{b as _}from"./agent-lane-preview-Dpa3DuOn.js";import{m as F}from"./mission-wall-DOuGOxQy.js";import"./lane-observe-CteDwdD-.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./lane-ask-display-BTVSakyo.js";import"./mission-control-model-C30vU1Fe.js";import"./colors-CFlbwC25.js";import"./agent-state-DDhnFEEP.js";const P=/^\[[a-z][a-z-]*\]$/i;function H(a,e){const l=w=>w.replace(/[…\s]+$/u,""),n=l(a),i=l(e);if(!n)return!0;const r=n.slice(0,Math.min(n.length,i.length));return i.startsWith(r)||n.startsWith(i)}function D(a,e){const l=a?.headline.trim();if(l&&!P.test(l)){const i=a?.detail?.trim(),r=a?.headFull??l;return i&&H(l,i)?{headline:i.length>l.length?i:l,full:r,detail:null}:{headline:l,full:r,detail:i??null}}const n=[...e?.events??[]].reverse().find(i=>i.kind==="tool");if(n){const i=n.arg?C(M(n.arg)).rest||n.arg:null,r=[n.tool,i].filter(Boolean).join(" · ").trim()||"Running tool";return{headline:r,full:r,detail:null}}return l?{headline:l,full:a?.headFull??l,detail:null}:null}const W=8,z=6,G={created:"+",modified:"~",read:"○"};function f(a,e=42){return a?a.length<=e?a:`…${a.slice(-(e-1))}`:"—"}function K(a){const e=a.replace(/\\/g,"/"),l=e.lastIndexOf("/");return l<0?{dir:"",base:e}:{dir:e.slice(0,l+1),base:e.slice(l+1)}}function os({log:a,lane:e,onClose:l,onExpand:n,onTail:i,onOpenLog:r,onOpenFile:w}){const{agent:j,observe:o}=e,t=h.useMemo(()=>y(e),[e]),v=h.useMemo(()=>_(o,j,{isLive:a.live}),[o,j,a.live]),m=h.useMemo(()=>D(v,o),[v,o]),u=h.useMemo(()=>B(o,W),[o]),p=h.useMemo(()=>O(o,z),[o]),d=h.useMemo(()=>E(t.usage,{model:t.model,adapterType:t.harness}),[t.usage,t.model,t.harness]),N=F(a),g=[a.project,j.branch].filter(Boolean).join("/")||a.cwd||"—",L=u.filter(c=>c.state!=="read").length,$=[["MODEL",[t.harness,t.model].filter(Boolean).join("/")||"—",null],["BRANCH",t.branch??"—",null],["CWD",f(t.cwd),t.cwd],["SESSION",f(t.sessionId,30),t.sessionId],["LOG",f(a.logPath,30),a.logPath]];return s.jsxs("aside",{className:"s-wall-rail","aria-label":`${N} context`,children:[s.jsxs("div",{className:"s-wall-rail-head",children:[s.jsx("span",{className:`s-wall-rail-dot${a.live?" s-wall-rail-dot--live":""}`,"aria-hidden":"true"}),s.jsx(A,{harness:a.source,size:12,title:null}),s.jsxs("div",{className:"s-wall-rail-identity",children:[s.jsx("div",{className:"s-wall-rail-title",title:j.name,children:N}),s.jsxs("div",{className:"s-wall-rail-sub",title:a.cwd??g,children:[g," · ",a.lastActiveAt?T(a.lastActiveAt):"idle"]})]}),s.jsx("button",{type:"button",className:"s-wall-rail-close",onClick:l,"aria-label":"Close context (Esc)",title:"Close context (Esc)",children:"✕"})]}),s.jsxs("div",{className:"s-wall-rail-body",children:[s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:a.live?"executing now":"last action"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),m?s.jsxs("div",{className:"s-wall-rail-now",children:[s.jsx("div",{className:"s-wall-rail-headline",title:m.full,children:m.headline}),m.detail&&s.jsx("div",{className:"s-wall-rail-detail",title:m.detail,children:m.detail})]}):s.jsx("div",{className:"s-wall-rail-empty",children:"No interpreted trace yet — the pane is streaming raw output."}),s.jsxs("dl",{className:"s-wall-rail-stats",children:[s.jsx(x,{label:"events",value:t.events}),s.jsx(x,{label:"tools",value:t.tools}),s.jsx(x,{label:"edits",value:t.edits}),s.jsx(x,{label:"reads",value:t.reads}),s.jsx(x,{label:"files",value:t.files})]}),d&&s.jsxs("div",{className:`s-wall-rail-gauge${d.overLimit?" s-wall-rail-gauge--over":""}`,children:[s.jsxs("div",{className:"s-wall-rail-gauge-line",children:[s.jsx("span",{className:"s-wall-rail-gauge-label",children:"context"}),s.jsxs("span",{className:"s-wall-rail-gauge-value",children:[d.usedLabel,s.jsxs("span",{className:"s-wall-rail-gauge-of",children:[" / ",d.budgetLabel]})]}),s.jsxs("span",{className:"s-wall-rail-gauge-pct",children:[d.pct,"%",d.overLimit?" over":""]})]}),s.jsx("div",{className:"s-wall-rail-gauge-bar",role:"progressbar","aria-label":"Context budget","aria-valuenow":d.pct,"aria-valuemin":0,"aria-valuemax":Math.max(100,d.pct),children:s.jsx("span",{className:"s-wall-rail-gauge-fill",style:{width:`${S(d)}%`}})})]})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"runtime"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),s.jsx("dl",{className:"s-wall-rail-facts",children:$.map(([c,R,I])=>s.jsxs("div",{className:"s-wall-rail-fact",children:[s.jsx("dt",{className:"s-wall-rail-fact-label",children:c}),s.jsx("dd",{className:"s-wall-rail-fact-value",title:I??R,children:R})]},c))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"files"}),u.length>0&&s.jsxs("span",{className:"s-wall-rail-seccount",children:[L," changed · ",u.length-L," read"]}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),u.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No files touched in this window."}):s.jsx("div",{className:"s-wall-rail-files",children:u.map(c=>s.jsx(U,{file:c,onOpen:w},`${c.path}:${c.lastT}`))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"commands"}),p.length>0&&s.jsx("span",{className:"s-wall-rail-seccount",children:p.length}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),p.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No shell commands in this window."}):s.jsx("div",{className:"s-wall-rail-cmds",children:p.map(c=>s.jsx(q,{entry:c},c.id))})]})]}),s.jsxs("div",{className:"s-wall-rail-foot",children:[s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:n,...b({label:`Expand ${N}`}),children:"Expand"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:i,...b({label:`Tail · ${N}`,route:`/ops/tail?q=${encodeURIComponent(a.sessionId)}`}),children:"Tail ↗"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:r,...b({label:`Session · ${a.sessionId}`,route:`/sessions/${a.sessionId}`}),children:"Session ↗"}),s.jsxs("span",{className:"s-wall-rail-keys",children:[s.jsx("kbd",{children:"hjkl"})," move · ",s.jsx("kbd",{children:"esc"})," close"]})]})]})}function x({label:a,value:e}){return s.jsxs("div",{className:"s-wall-rail-stat",children:[s.jsx("dt",{className:"s-wall-rail-stat-label",children:a}),s.jsx("dd",{className:"s-wall-rail-stat-value",children:e>0?e.toLocaleString():"—"})]})}function U({file:a,onOpen:e}){const{dir:l,base:n}=K(a.path);return s.jsxs("button",{type:"button",className:"s-wall-rail-frow",title:a.path,onClick:()=>e(a.path),children:[s.jsx("span",{className:`s-wall-rail-fstate s-wall-rail-fstate--${a.state}`,"aria-hidden":"true",children:G[a.state]??"○"}),s.jsxs("span",{className:"s-wall-rail-fpath",children:[l&&s.jsx("span",{className:"s-wall-rail-fdir",children:l}),s.jsx("span",{className:"s-wall-rail-fbase",children:n})]})]})}function q({entry:a}){const{dir:e,rest:l}=C(M(a.command)),n=k(l||a.command);return s.jsxs("div",{className:"s-wall-rail-crow",title:a.command,children:[s.jsx("span",{className:"s-wall-rail-cmark","aria-hidden":"true",children:"❯"}),s.jsxs("span",{className:"s-wall-rail-ctext",children:[e&&s.jsxs("span",{className:"s-wall-rail-bash-dir",children:[e,"/"]}),n.map((i,r)=>s.jsxs("span",{className:`s-wall-rail-bash-${i.tier}${i.flag?" s-wall-rail-bash-flag":""}`,children:[r>0?" ":"",i.text]},r))]}),a.outcome&&s.jsx("span",{className:"s-wall-rail-cresult",children:a.outcome})]})}export{os as MissionContextRail};
1
+ import{r as h,j as s}from"./index-EsrkGBcv.js";import{H as A}from"./HarnessMark-C4naWc16.js";import{s as C,t as M,b as k}from"./bash-format-BRV5C6Gv.js";import{d as E,c as S}from"./context-budget-8qFKqM-j.js";import{s as b}from"./page-status-BswZLqvA.js";import{t as T}from"./time-Dhsh_2EG.js";import{b as y,a as B,l as O}from"./agent-lane-detail-Ti3trpfH.js";import{b as _}from"./agent-lane-preview-Dpa3DuOn.js";import{m as F}from"./mission-wall-CAo4BKfa.js";import"./lane-observe-CteDwdD-.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./lane-ask-display-BTVSakyo.js";import"./mission-control-model-BpJHDV5D.js";import"./colors-CFlbwC25.js";import"./agent-state-DDhnFEEP.js";const P=/^\[[a-z][a-z-]*\]$/i;function H(a,e){const l=w=>w.replace(/[…\s]+$/u,""),n=l(a),i=l(e);if(!n)return!0;const r=n.slice(0,Math.min(n.length,i.length));return i.startsWith(r)||n.startsWith(i)}function D(a,e){const l=a?.headline.trim();if(l&&!P.test(l)){const i=a?.detail?.trim(),r=a?.headFull??l;return i&&H(l,i)?{headline:i.length>l.length?i:l,full:r,detail:null}:{headline:l,full:r,detail:i??null}}const n=[...e?.events??[]].reverse().find(i=>i.kind==="tool");if(n){const i=n.arg?C(M(n.arg)).rest||n.arg:null,r=[n.tool,i].filter(Boolean).join(" · ").trim()||"Running tool";return{headline:r,full:r,detail:null}}return l?{headline:l,full:a?.headFull??l,detail:null}:null}const W=8,z=6,G={created:"+",modified:"~",read:"○"};function f(a,e=42){return a?a.length<=e?a:`…${a.slice(-(e-1))}`:"—"}function K(a){const e=a.replace(/\\/g,"/"),l=e.lastIndexOf("/");return l<0?{dir:"",base:e}:{dir:e.slice(0,l+1),base:e.slice(l+1)}}function os({log:a,lane:e,onClose:l,onExpand:n,onTail:i,onOpenLog:r,onOpenFile:w}){const{agent:j,observe:o}=e,t=h.useMemo(()=>y(e),[e]),v=h.useMemo(()=>_(o,j,{isLive:a.live}),[o,j,a.live]),m=h.useMemo(()=>D(v,o),[v,o]),u=h.useMemo(()=>B(o,W),[o]),p=h.useMemo(()=>O(o,z),[o]),d=h.useMemo(()=>E(t.usage,{model:t.model,adapterType:t.harness}),[t.usage,t.model,t.harness]),N=F(a),g=[a.project,j.branch].filter(Boolean).join("/")||a.cwd||"—",L=u.filter(c=>c.state!=="read").length,$=[["MODEL",[t.harness,t.model].filter(Boolean).join("/")||"—",null],["BRANCH",t.branch??"—",null],["CWD",f(t.cwd),t.cwd],["SESSION",f(t.sessionId,30),t.sessionId],["LOG",f(a.logPath,30),a.logPath]];return s.jsxs("aside",{className:"s-wall-rail","aria-label":`${N} context`,children:[s.jsxs("div",{className:"s-wall-rail-head",children:[s.jsx("span",{className:`s-wall-rail-dot${a.live?" s-wall-rail-dot--live":""}`,"aria-hidden":"true"}),s.jsx(A,{harness:a.source,size:12,title:null}),s.jsxs("div",{className:"s-wall-rail-identity",children:[s.jsx("div",{className:"s-wall-rail-title",title:j.name,children:N}),s.jsxs("div",{className:"s-wall-rail-sub",title:a.cwd??g,children:[g," · ",a.lastActiveAt?T(a.lastActiveAt):"idle"]})]}),s.jsx("button",{type:"button",className:"s-wall-rail-close",onClick:l,"aria-label":"Close context (Esc)",title:"Close context (Esc)",children:"✕"})]}),s.jsxs("div",{className:"s-wall-rail-body",children:[s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:a.live?"executing now":"last action"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),m?s.jsxs("div",{className:"s-wall-rail-now",children:[s.jsx("div",{className:"s-wall-rail-headline",title:m.full,children:m.headline}),m.detail&&s.jsx("div",{className:"s-wall-rail-detail",title:m.detail,children:m.detail})]}):s.jsx("div",{className:"s-wall-rail-empty",children:"No interpreted trace yet — the pane is streaming raw output."}),s.jsxs("dl",{className:"s-wall-rail-stats",children:[s.jsx(x,{label:"events",value:t.events}),s.jsx(x,{label:"tools",value:t.tools}),s.jsx(x,{label:"edits",value:t.edits}),s.jsx(x,{label:"reads",value:t.reads}),s.jsx(x,{label:"files",value:t.files})]}),d&&s.jsxs("div",{className:`s-wall-rail-gauge${d.overLimit?" s-wall-rail-gauge--over":""}`,children:[s.jsxs("div",{className:"s-wall-rail-gauge-line",children:[s.jsx("span",{className:"s-wall-rail-gauge-label",children:"context"}),s.jsxs("span",{className:"s-wall-rail-gauge-value",children:[d.usedLabel,s.jsxs("span",{className:"s-wall-rail-gauge-of",children:[" / ",d.budgetLabel]})]}),s.jsxs("span",{className:"s-wall-rail-gauge-pct",children:[d.pct,"%",d.overLimit?" over":""]})]}),s.jsx("div",{className:"s-wall-rail-gauge-bar",role:"progressbar","aria-label":"Context budget","aria-valuenow":d.pct,"aria-valuemin":0,"aria-valuemax":Math.max(100,d.pct),children:s.jsx("span",{className:"s-wall-rail-gauge-fill",style:{width:`${S(d)}%`}})})]})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"runtime"}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),s.jsx("dl",{className:"s-wall-rail-facts",children:$.map(([c,R,I])=>s.jsxs("div",{className:"s-wall-rail-fact",children:[s.jsx("dt",{className:"s-wall-rail-fact-label",children:c}),s.jsx("dd",{className:"s-wall-rail-fact-value",title:I??R,children:R})]},c))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"files"}),u.length>0&&s.jsxs("span",{className:"s-wall-rail-seccount",children:[L," changed · ",u.length-L," read"]}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),u.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No files touched in this window."}):s.jsx("div",{className:"s-wall-rail-files",children:u.map(c=>s.jsx(U,{file:c,onOpen:w},`${c.path}:${c.lastT}`))})]}),s.jsxs("section",{className:"s-wall-rail-sec",children:[s.jsxs("div",{className:"s-wall-rail-sechead",children:[s.jsx("span",{className:"s-wall-rail-seclabel",children:"commands"}),p.length>0&&s.jsx("span",{className:"s-wall-rail-seccount",children:p.length}),s.jsx("span",{className:"s-wall-rail-secrule","aria-hidden":"true"})]}),p.length===0?s.jsx("div",{className:"s-wall-rail-empty",children:"No shell commands in this window."}):s.jsx("div",{className:"s-wall-rail-cmds",children:p.map(c=>s.jsx(q,{entry:c},c.id))})]})]}),s.jsxs("div",{className:"s-wall-rail-foot",children:[s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:n,...b({label:`Expand ${N}`}),children:"Expand"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:i,...b({label:`Tail · ${N}`,route:`/ops/tail?q=${encodeURIComponent(a.sessionId)}`}),children:"Tail ↗"}),s.jsx("button",{type:"button",className:"s-wall-rail-act",onClick:r,...b({label:`Session · ${a.sessionId}`,route:`/sessions/${a.sessionId}`}),children:"Session ↗"}),s.jsxs("span",{className:"s-wall-rail-keys",children:[s.jsx("kbd",{children:"hjkl"})," move · ",s.jsx("kbd",{children:"esc"})," close"]})]})]})}function x({label:a,value:e}){return s.jsxs("div",{className:"s-wall-rail-stat",children:[s.jsx("dt",{className:"s-wall-rail-stat-label",children:a}),s.jsx("dd",{className:"s-wall-rail-stat-value",children:e>0?e.toLocaleString():"—"})]})}function U({file:a,onOpen:e}){const{dir:l,base:n}=K(a.path);return s.jsxs("button",{type:"button",className:"s-wall-rail-frow",title:a.path,onClick:()=>e(a.path),children:[s.jsx("span",{className:`s-wall-rail-fstate s-wall-rail-fstate--${a.state}`,"aria-hidden":"true",children:G[a.state]??"○"}),s.jsxs("span",{className:"s-wall-rail-fpath",children:[l&&s.jsx("span",{className:"s-wall-rail-fdir",children:l}),s.jsx("span",{className:"s-wall-rail-fbase",children:n})]})]})}function q({entry:a}){const{dir:e,rest:l}=C(M(a.command)),n=k(l||a.command);return s.jsxs("div",{className:"s-wall-rail-crow",title:a.command,children:[s.jsx("span",{className:"s-wall-rail-cmark","aria-hidden":"true",children:"❯"}),s.jsxs("span",{className:"s-wall-rail-ctext",children:[e&&s.jsxs("span",{className:"s-wall-rail-bash-dir",children:[e,"/"]}),n.map((i,r)=>s.jsxs("span",{className:`s-wall-rail-bash-${i.tier}${i.flag?" s-wall-rail-bash-flag":""}`,children:[r>0?" ":"",i.text]},r))]}),a.outcome&&s.jsx("span",{className:"s-wall-rail-cresult",children:a.outcome})]})}export{os as MissionContextRail};
@@ -0,0 +1 @@
1
+ import{r as n,j as a}from"./index-EsrkGBcv.js";import{s as Ae}from"./send-to-agent-session-DoKCDBJ4.js";/* empty css */import{a as de}from"./api-DSqpVKC7.js";import{u as Se,e as Me,f as Ee,m as je,M as ke,b as Ne,t as z,g as A,d as me}from"./mission-control-store-elEEsIvb.js";import{u as Le}from"./observe-BJqERJVj.js";import{h as Te}from"./NewChatComposer-C97-iTMK.js";import{i as Ce,c as Fe}from"./keyboard-nav-DDHegDbx.js";import{f as Oe}from"./tail-display-DHSNmvor.js";import{u as Pe}from"./tail-events-d0yAYxR0.js";import{u as De}from"./Provider-C35yu29I.js";import{MissionContextRail as _e}from"./MissionContextRail-D62-Wis8.js";import{FocusOverlay as We}from"./MissionFocusOverlay-C1zys3Jv.js";import{MissionLogPane as $e}from"./MissionLogPane-B19lYSY9.js";import{o as Ke}from"./agent-lanes-model-DMAdqCmK.js";import{a as Ve,A as qe}from"./mission-control-model-BpJHDV5D.js";import{b as He,s as Be,f as Qe,c as ze,n as Ue,d as Ge,m as Ye,W as Je}from"./mission-wall-CAo4BKfa.js";import"./agent-state-DDhnFEEP.js";import"./surface-activity-B1rgWB1i.js";import"./runtime-picker-DXu2bOTh.js";import"./scout-voice-CZx60X6E.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-OvccU82H.js";import"./createLucideIcon-zZ8Hx7er.js";import"./router-DCtl8wqb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./media-blobs-Bi8pxr1u.js";import"./index-724SdE6r.js";import"./HarnessMark-C4naWc16.js";import"./conversation-model-FxDeWlle.js";import"./time-Dhsh_2EG.js";import"./conversations-DoAAO6kA.js";import"./colors-CFlbwC25.js";import"./NewChatOrigin-DFbF_XvR.js";import"./x-DAehov0E.js";import"./chevron-down-l1mrh5S9.js";import"./search-DT42oyRW.js";import"./file-text-CnISiiw6.js";import"./lane-edit-display-BjdT9oZl.js";import"./index-BWHgHrtv.js";import"./theme-vars-DNK0nn3k.js";import"./provider-Dojd8quC.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./index-CHD0qcfL.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./chevron-up-CETZJzjV.js";import"./code-xml-BhcNbLWU.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";import"./bash-format-BRV5C6Gv.js";import"./context-budget-8qFKqM-j.js";import"./page-status-BswZLqvA.js";import"./agent-lane-detail-Ti3trpfH.js";import"./lane-observe-CteDwdD-.js";import"./agent-lane-preview-Dpa3DuOn.js";import"./lane-ask-display-BTVSakyo.js";function Xe(t,o,i,p){if(o<=0)return-1;const v=o-1,k=Math.max(1,Math.floor(i));if(t<0||t>v)return p==="left"||p==="up"||p==="last"?v:0;switch(p){case"first":return 0;case"last":return v;case"left":return Math.max(0,t-1);case"right":return Math.min(v,t+1);case"up":{const h=t-k;return h>=0?h:t}case"down":{const h=t+k;return h<=v?h:v}}}function Ze(t){switch(t){case"h":case"ArrowLeft":return"left";case"l":case"ArrowRight":return"right";case"k":case"ArrowUp":return"up";case"j":case"ArrowDown":return"down";case"Home":return"first";case"G":case"End":return"last";default:return null}}const $=4e3,et=250,tt=3e4,st=1800;function nt(t,o){return t.map(i=>({id:i.id,name:i.name,handle:i.handle,state:i.state,project:i.project,branch:i.branch,harness:i.harness,model:i.model,sessionIds:o.get(i.id)??[]}))}function rt(t){return{id:`native:${t.source}:${t.sessionId}`,definitionId:`native:${t.source}:${t.sessionId}`,name:`${t.source} · ${t.project}`,handle:t.sessionId.slice(0,8),agentClass:"native-session",harness:t.source,state:t.live?"working":"ready",projectRoot:t.cwd,cwd:t.cwd,updatedAt:t.lastActiveAt,createdAt:null,transport:"tail",selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:t.project,branch:t.attribution==="unattributed"?"native session":t.attribution,role:"native session",model:null,harnessSessionId:t.sessionId,terminalSurface:null,harnessLogPath:t.logPath,conversationId:null,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null}}function it(t){return t.agentClass==="native-session"||t.id.startsWith("native:")}function fe(t,o){if(t.agent){const i=o.find(p=>p.id===t.agent.id);if(i)return i}return rt(t)}function at(t,o){const i=o.find(p=>p.sessionId?.trim()===t.sessionId);return i||{source:t.source,transcriptPath:t.logPath??"",sessionId:t.sessionId,cwd:t.cwd,project:t.project,harness:t.attribution,mtimeMs:t.lastActiveAt,size:0}}function ot(t,o,i){return t.live?"active":t.lastActiveAt>0&&o-t.lastActiveAt<=i?"recent":"idle"}function ys({navigate:t,agents:o}){const i=Se(),{openFilePreview:p}=De(),{activityFilter:v,sourceFilter:k,activityWindowMs:h,groupMode:U,query:G,focusedId:F,revealRequest:y}=i,[Y,J]=n.useState([]),[O,pe]=n.useState(null),[g,he]=n.useState(()=>Date.now()),N=Le(o),P=n.useRef([]);Pe(e=>{P.current.push(e)}),n.useEffect(()=>{const e=setInterval(()=>{if(P.current.length===0)return;const s=P.current;P.current=[],J(r=>{const c=new Set(r.map(d=>d.id)),I=s.filter(d=>!d.id||!c.has(d.id));if(I.length===0)return r;const u=r.concat(I);return u.length>$?u.slice(u.length-$):u})},et);return()=>clearInterval(e)},[]),n.useEffect(()=>{const e=setInterval(()=>he(Date.now()),1e4);return()=>clearInterval(e)},[]),n.useEffect(()=>{let e=!1;return de(Ve()).then(s=>{if(e)return;const r=s.events??[];J(c=>{const I=new Set(c.map(d=>d.id)),u=r.filter(d=>!I.has(d.id)).concat(c);return u.length>$?u.slice(u.length-$):u})}).catch(()=>{}),()=>{e=!0}},[]),n.useEffect(()=>{let e=!1;const s=async()=>{try{const c=await de("/api/tail/discover");e||pe(c)}catch{}};s();const r=setInterval(()=>{s()},tt);return()=>{e=!0,clearInterval(r)}},[]);const X=n.useMemo(()=>{const e=new Map;for(const s of o){const r=N[s.id],c=[s.harnessSessionId,r?.sessionId,r?.data.metadata?.session?.externalSessionId].map(I=>I?.trim()).filter(I=>!!I);e.set(s.id,[...new Set(c)])}return e},[o,N]),b=n.useMemo(()=>He({events:Oe(Y),transcripts:O?.transcripts??[],agents:nt(o,X),now:g,liveWindowMs:qe}),[o,O?.transcripts,g,X,Y]),[R,K]=n.useState(null),w=n.useMemo(()=>{const e=Be(Qe(b,{sourceFilter:k,activityFilter:v,query:G,now:g,activeWindowMs:h}),U);if(!R)return e;const s=e.find(r=>r.id===R);return s?[s,...e.filter(r=>r.id!==R)]:e},[v,h,U,b,g,R,G,k]),Z=n.useRef(null),ee=n.useRef(null),V=n.useRef({w:0,h:0}),te=n.useRef(0);te.current=w.length;const[m,ve]=n.useState(()=>ze(0,{w:0,h:0})),q=n.useRef(m),D=n.useCallback((e,s)=>{const r=Ue(q.current,e,s);r!==q.current&&(q.current=r,ve(r))},[]);n.useEffect(()=>{const e=ee.current;if(!e)return;const s=new ResizeObserver(([r])=>{V.current={w:r.contentRect.width,h:r.contentRect.height},D(te.current,V.current)});return s.observe(e),()=>s.disconnect()},[D]),n.useLayoutEffect(()=>{D(w.length,V.current)},[w.length,D]);const S=n.useMemo(()=>w.slice(0,m.shown),[w,m.shown]),se=n.useRef(1);se.current=Math.max(1,m.cols),n.useEffect(()=>{Me(w.map(e=>({id:e.id,name:e.agent?.name??Ye(e),handle:e.agent?.handle??Ge(e),harness:e.source,branch:e.agent?.branch??null,project:e.project,model:e.agent?.model??null,state:e.agent?.state??null,agentClass:e.agent?"agent":"native-session",updatedAt:e.lastActiveAt,source:e.agent||e.attribution==="scout-managed"?"scout":"native",activity:ot(e,g,h),lastActiveAt:e.lastActiveAt})))},[h,g,w]);const[we,ne]=n.useState(null),re=n.useRef(null),L=n.useRef(null);n.useEffect(()=>{y&&re.current!==y.serial&&(re.current=y.serial,K(y.id),ne(y.id),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>ne(null),st),Ee(y.serial))},[y]),n.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const T=F?b.find(e=>e.id===F)??null:null,f=n.useMemo(()=>T?fe(T,o):null,[o,T]),Ie=T?.agent?N[T.agent.id]?.data??null:null,[x,C]=n.useState(null),[M,_]=n.useState(!1),ge=x?S.findIndex(e=>e.id===x):-1,ie=n.useRef({index:-1,ids:[]});ie.current={index:ge,ids:S.map(e=>e.id)};const H=x?b.find(e=>e.id===x)??null:null,l=M?H:null;n.useEffect(()=>{M&&!H&&_(!1)},[H,M]);const B=n.useRef(new Map),xe=n.useCallback((e,s)=>{s?B.current.set(e,s):B.current.delete(e)},[]);n.useEffect(()=>{x&&B.current.get(x)?.focus({preventScroll:!0})},[x]);const ae=n.useMemo(()=>{if(!l)return null;const e=fe(l,o),s=(l.agent?N[l.agent.id]?.data??null:null)??Ke(at(l,O?.transcripts??[]),l.lines,l.live,{now:g});return{id:l.id,agent:e,source:l.agent?"scout":"native",observe:s,lastActiveAt:l.lastActiveAt,current:l.live}},[o,O?.transcripts,g,N,l]),oe=n.useCallback(e=>{t({view:"ops",mode:"tail",tailQuery:e.sessionId})},[t]),Q=n.useCallback(e=>{C(e),_(!0)},[]),le=n.useRef({focusedId:F,railOpen:M,pinnedId:R,selectedIds:i.selectedIds,visibleAgents:i.visibleAgents});le.current={focusedId:F,railOpen:M,pinnedId:R,selectedIds:i.selectedIds,visibleAgents:i.visibleAgents},n.useEffect(()=>{const e=s=>{if(Ce(s.target))return;const r=le.current;if(r.focusedId){s.key==="Escape"&&A(null);return}if(Fe())return;if(s.key==="Escape"){r.railOpen?_(!1):r.selectedIds.length>0?me():r.pinnedId?K(null):C(null);return}if((s.metaKey||s.ctrlKey)&&s.key==="a"){if(r.visibleAgents.length===0)return;s.preventDefault();const W=r.visibleAgents.map(j=>j.id);if(W.every(j=>r.selectedIds.includes(j))){me();return}for(const j of W)r.selectedIds.includes(j)||z(j);return}if(s.metaKey||s.ctrlKey||s.altKey||s.defaultPrevented)return;const c=s.target instanceof Node?s.target:null;if(!(!c||c===document.body||c===document.documentElement)&&!Z.current?.contains(c))return;const{index:u,ids:d}=ie.current;if(d.length===0)return;const ue=Ze(s.key);if(ue){s.preventDefault();const W=Xe(u,d.length,se.current,ue);C(d[W]??null);return}if(c instanceof Element&&c.closest("button, a, [role='button'], [role='link']"))return;const Re=u<0?0:u,E=d[Re];if(E){if(s.key==="Enter"||s.key==="i"){s.preventDefault(),Q(E);return}if(s.key==="o"){s.preventDefault(),C(E),A(E);return}(s.key==="x"||s.key===" ")&&(s.preventDefault(),C(E),z(E))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Q]);const ye=S.reduce((e,s)=>e+s.lines.length,0),ce=b.length-w.length,be=je(i);return a.jsxs("div",{className:"s-wall",ref:Z,children:[a.jsxs("div",{className:"s-wall-status",children:[a.jsx("span",{className:"s-wall-status-key",children:"logs"}),a.jsxs("span",{className:"s-wall-status-value",children:[m.shown,"/",w.length]}),a.jsx("span",{className:"s-wall-status-key",children:"grid"}),a.jsx("span",{className:"s-wall-status-value",children:m.cols>0?`${m.cols}×${m.rows}`:"—"}),a.jsx("span",{className:"s-wall-status-key",children:"lines"}),a.jsx("span",{className:"s-wall-status-value",children:ye}),m.hidden>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Least recently active logs are withheld to keep panes readable",children:[m.hidden," withheld"]}),ce>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Sessions discovery knows of that have produced no output to tail",children:[ce," quiet"]}),a.jsxs("span",{className:"s-wall-status-filter",role:"group","aria-label":"Show logs active within",children:[a.jsx("span",{className:"s-wall-status-key",children:"within"}),ke.map(e=>{const s=be===e.id;return a.jsx("button",{type:"button",className:`s-wall-status-chip${s?" s-wall-status-chip--active":""}`,"aria-pressed":s,onClick:()=>Ne(e.id),children:e.label},e.id)})]}),S.length>0&&a.jsxs("span",{className:"s-wall-status-keys",children:[a.jsx("kbd",{children:"hjkl"})," move · ",a.jsx("kbd",{children:"⏎"})," context · ",a.jsx("kbd",{children:"o"})," expand"]}),R&&a.jsx("button",{type:"button",className:"s-wall-status-pin",onClick:()=>K(null),children:"unpin"})]}),a.jsx("div",{ref:ee,className:`s-wall-grid${M?" s-wall-grid--railed":""}`,style:{gridTemplateColumns:`repeat(${Math.max(1,m.cols)}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${Math.max(1,m.rows)}, minmax(0, 1fr))`,gap:Je},children:S.length===0?a.jsxs("div",{className:"s-wall-empty",children:[a.jsx("div",{className:"s-wall-empty-title",children:b.length===0?"No logs on the wire":"No matching logs"}),a.jsx("div",{className:"s-wall-empty-sub",children:b.length===0?"Panes appear as sessions start writing to their transcripts.":"Widen the activity window or clear the filter."})]}):S.map(e=>a.jsx($e,{log:e,selected:i.selectedIds.includes(e.id),revealed:we===e.id,cursor:x===e.id,paneRef:s=>xe(e.id,s),onOpen:()=>Q(e.id),onToggleSelected:()=>z(e.id),onOpenLog:()=>oe(e)},e.id))}),l&&ae&&a.jsx(_e,{log:l,lane:ae,onClose:()=>_(!1),onExpand:()=>A(l.id),onTail:()=>oe(l),onOpenLog:()=>t({view:"sessions",sessionId:l.sessionId}),onOpenFile:p}),f&&a.jsx(We,{agent:f,observe:Ie,onClose:()=>A(null),onSend:async e=>{await Ae(f,e)},onOpenConversation:()=>{if(A(null),it(f)&&f.harnessSessionId){t({view:"sessions",sessionId:f.harnessSessionId});return}Te(f).then(e=>t({view:"conversation",conversationId:e})).catch(()=>t({view:"agents-v2",agentId:f.id,tab:"message"}))},onTail:()=>{A(null),t({view:"ops",mode:"tail",tailQuery:f.harnessSessionId??f.handle??f.name})},onProfile:()=>{A(null),t({view:"agents-v2",agentId:f.id})}})]})}export{ys as MissionControlView};