@openscout/scout 0.2.102 → 0.2.106

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 (605) hide show
  1. package/README.md +37 -0
  2. package/bin/scout.mjs +6 -0
  3. package/bin/scoutd +0 -0
  4. package/dist/build-manifest.json +4 -4
  5. package/dist/chat.mjs +307 -0
  6. package/dist/client/assets/ActivityScreen-CZmGwQ2U.js +1 -0
  7. package/dist/client/assets/{AddProjectForm-DfbjlFfy.js → AddProjectForm-CusDRiVO.js} +1 -1
  8. package/dist/client/assets/{AdventureEvidence-Dzz9VbuE.js → AdventureEvidence-CyegKk1V.js} +1 -1
  9. package/dist/client/assets/{AdventureReader-ClMxT0e4.js → AdventureReader-X-hbTOi0.js} +1 -1
  10. package/dist/client/assets/{AdventureScenery-D548O0x4.js → AdventureScenery-LPXSVP67.js} +1 -1
  11. package/dist/client/assets/AgentAdventures-BAgxdOF8.js +1 -0
  12. package/dist/client/assets/AgentAvatar-CrP1eXxk.js +1 -0
  13. package/dist/client/assets/AgentConfigurationScreen-1L0IQm2w.js +1 -0
  14. package/dist/client/assets/AgentDefinitionsWorkspace-DguGs7jZ.js +1 -0
  15. package/dist/client/assets/{AgentDetailCard-CFDE8TLi.js → AgentDetailCard-DtHT3sCo.js} +1 -1
  16. package/dist/client/assets/AgentFloorView-DH4jiDgw.js +1 -0
  17. package/dist/client/assets/{AgentFloorWorld-BDJmXl3C.js → AgentFloorWorld-CjoIa6jA.js} +1 -1
  18. package/dist/client/assets/AgentInfoScreen-DYtmKkeE.js +1 -0
  19. package/dist/client/assets/{AgentLaneCard-C6YmwPxQ.js → AgentLaneCard-BaZ2g-f8.js} +1 -1
  20. package/dist/client/assets/{AgentLaneChrome-D9uJ4QY7.js → AgentLaneChrome-TF1SlJSc.js} +1 -1
  21. package/dist/client/assets/{AgentLaneDetailSheet-KYckCBCX.js → AgentLaneDetailSheet-EzEPsn3g.js} +1 -1
  22. package/dist/client/assets/{AgentLaneSummaryResize-BBYBS3DO.js → AgentLaneSummaryResize-dpp7YvrX.js} +1 -1
  23. package/dist/client/assets/AgentLanesEmbedScreen-BlSof_6S.js +1 -0
  24. package/dist/client/assets/{AgentLanesPreflight-pw2vMO3Q.js → AgentLanesPreflight-Ry-aqDTr.js} +1 -1
  25. package/dist/client/assets/AgentLanesView-BJi9xXz6.js +2 -0
  26. package/dist/client/assets/{AgentLiveActions-lYzicnNa.js → AgentLiveActions-CfTupTEl.js} +1 -1
  27. package/dist/client/assets/AgentMasterScreen-EJhmuKgl.js +1 -0
  28. package/dist/client/assets/AgentSessions-B1gOhDBf.js +6 -0
  29. package/dist/client/assets/AgentsConsole-RXGqRvcb.js +1 -0
  30. package/dist/client/assets/AgentsScreen-ChwMBs11.js +1 -0
  31. package/dist/client/assets/AgentsSubnav-DwNX4yy0.js +1 -0
  32. package/dist/client/assets/{AstronautSuit-C-4I5YKi.js → AstronautSuit-Cchnc4Ug.js} +1 -1
  33. package/dist/client/assets/{AtopView-DKm-ERYC.js → AtopView-gkEp4y__.js} +1 -1
  34. package/dist/client/assets/{BackToPicker-Bys9ColC.js → BackToPicker-CUkjnoVk.js} +1 -1
  35. package/dist/client/assets/BriefingDetailScreen-DrlC3qkm.js +1 -0
  36. package/dist/client/assets/{BriefingsScreen-D4Zf31Y6.js → BriefingsScreen-B1HlBMGZ.js} +1 -1
  37. package/dist/client/assets/{BrokerMetadataPanel-1GoSl2BV.js → BrokerMetadataPanel-Dk242Yh_.js} +1 -1
  38. package/dist/client/assets/BrokerScreen-DwOF6bMA.js +8 -0
  39. package/dist/client/assets/Canvas-X9pVSkw3.js +1 -0
  40. package/dist/client/assets/{CastPicker-BuwE_JQp.js → CastPicker-BXUtPAGC.js} +1 -1
  41. package/dist/client/assets/ChannelComposer-DoK7IDGa.js +1 -0
  42. package/dist/client/assets/ChannelSidebar-e9DOPulb.js +1 -0
  43. package/dist/client/assets/{CharacterFamilyPreview-CfO3j8Of.js → CharacterFamilyPreview-DMfw7UM_.js} +1 -1
  44. package/dist/client/assets/ChatAvatar-C3a_o5Hj.js +1 -0
  45. package/dist/client/assets/ChatBits-CsvxbToF.js +1 -0
  46. package/dist/client/assets/{ChatCollapsedStrip-TV0j1xTB.js → ChatCollapsedStrip-FEmQ_G9J.js} +1 -1
  47. package/dist/client/assets/ChatRichInput-DhtwFxQE.js +31 -0
  48. package/dist/client/assets/ChatRightPanel-C1h_aIkn.js +1 -0
  49. package/dist/client/assets/ChatSpaceSurface-BXyLYKHn.js +1 -0
  50. package/dist/client/assets/ChatSpaceTheme-3wLZGsvT.css +1 -0
  51. package/dist/client/assets/ChatSpaceTheme-CUH8bTZc.js +1 -0
  52. package/dist/client/assets/{CodeDiffPane-DB6-mqtX.js → CodeDiffPane-DuQRwpgK.js} +1 -1
  53. package/dist/client/assets/{CodeProjectPicker-B_LNLpIK.js → CodeProjectPicker-ZQ6gSBpg.js} +1 -1
  54. package/dist/client/assets/{CodeScreen-C9H160XS.js → CodeScreen-BXyKeL5T.js} +1 -1
  55. package/dist/client/assets/{CommsCanvas-DOKw3Q8i.js → CommsCanvas-THp0r_U8.js} +1 -1
  56. package/dist/client/assets/{CommsDeck-C18JA7rK.js → CommsDeck-BVmSMV2V.js} +1 -1
  57. package/dist/client/assets/{CommsFlowGraph-Czg-KTS0.js → CommsFlowGraph-DxoOaLF_.js} +1 -1
  58. package/dist/client/assets/{CommsFlowMap-CzBWvSa5.js → CommsFlowMap-Vi8ziCPg.js} +1 -1
  59. package/dist/client/assets/{CommsSelection-g1twA-Lb.js → CommsSelection-BUoRbu9o.js} +1 -1
  60. package/dist/client/assets/ComposerAttachments-DW0AIb8k.js +1 -0
  61. package/dist/client/assets/ConversationComposer-CUQyArlk.js +1 -0
  62. package/dist/client/assets/ConversationFeedRows-DWiOfT-y.js +1 -0
  63. package/dist/client/assets/ConversationHeader-C-ZWscKj.js +1 -0
  64. package/dist/client/assets/{ConversationPanels-C9yCAoJy.js → ConversationPanels-D9oC0xG5.js} +2 -2
  65. package/dist/client/assets/ConversationScreen-9MlMnEo4.css +1 -0
  66. package/dist/client/assets/ConversationScreen-CUfsQ4MR.js +2 -0
  67. package/dist/client/assets/ConversationStatus--IPm2nGh.js +1 -0
  68. package/dist/client/assets/{CrewAvatar-D0c9z5Qr.css → CrewAvatar-BnIPIn_Z.css} +1 -1
  69. package/dist/client/assets/CrewAvatar-kTznzqcO.js +1 -0
  70. package/dist/client/assets/{CrewSprite-hgpA3SWB.js → CrewSprite-Dhryjx2c.js} +1 -1
  71. package/dist/client/assets/CrewStage-vdO0qm3D.js +1 -0
  72. package/dist/client/assets/CrewWorkspaces-DCBzAAS4.js +1 -0
  73. package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
  74. package/dist/client/assets/{DataTable-BMOZ1-z8.js → DataTable-aH-jCyDq.js} +1 -1
  75. package/dist/client/assets/{DispatchAftermath-DDlwqSCY.js → DispatchAftermath-66uQAorV.js} +1 -1
  76. package/dist/client/assets/{DocumentFocusViewer-f12RRQpV.js → DocumentFocusViewer-DJr0v0D_.js} +1 -1
  77. package/dist/client/assets/{EmbeddableSurfacesLab-DGl9EMRV.js → EmbeddableSurfacesLab-BBa70EhJ.js} +1 -1
  78. package/dist/client/assets/{EmptyState-uyYN5piI.js → EmptyState-CZlrHXy-.js} +1 -1
  79. package/dist/client/assets/{FileViewerPane-HtiDbj9N.js → FileViewerPane-BAO6mtjD.js} +1 -1
  80. package/dist/client/assets/FleetRollCallHud-C5q2567n.js +1 -0
  81. package/dist/client/assets/FlightObserveScreen-DZ2mrw91.js +1 -0
  82. package/dist/client/assets/{FloorContextSheet-DV-SYA0K.js → FloorContextSheet-2_NVPQor.js} +1 -1
  83. package/dist/client/assets/{FloorExchangePanel-D59nvRCF.js → FloorExchangePanel-BU1pPu8K.js} +1 -1
  84. package/dist/client/assets/{FloorMessagePasses-BCwsz9VS.js → FloorMessagePasses-cLW2UGNP.js} +1 -1
  85. package/dist/client/assets/{FloorReplay-BHo79HCD.js → FloorReplay-VFzA6Kxc.js} +1 -1
  86. package/dist/client/assets/FloorResourcesSheet-C-kQ6Ren.js +1 -0
  87. package/dist/client/assets/{FloorSavedWork-2tjBoy06.js → FloorSavedWork-BeHDejWz.js} +1 -1
  88. package/dist/client/assets/FloorTacticalHUD-CO-iiFpb.js +1 -0
  89. package/dist/client/assets/{FollowScreen-eHXOlK-u.js → FollowScreen-CFfkIbc6.js} +1 -1
  90. package/dist/client/assets/HarnessMark-C4naWc16.js +1 -0
  91. package/dist/client/assets/HarnessesScreen-DX3NLcDG.js +1 -0
  92. package/dist/client/assets/{HerdrSession-CtJOUn7H.js → HerdrSession-_t7yM8vX.js} +2 -2
  93. package/dist/client/assets/{HomeHero-Cvwx2H0w.js → HomeHero-DouPyNmz.js} +1 -1
  94. package/dist/client/assets/{HostAdvisorView-CTJXIc1Q.js → HostAdvisorView-CnM1i8hW.js} +1 -1
  95. package/dist/client/assets/InviteLandingScreen-CEjG2E34.js +1 -0
  96. package/dist/client/assets/InviteSheet-CwxZtWCl.js +1 -0
  97. package/dist/client/assets/JumpPalette-O1aJE9gR.js +1 -0
  98. package/dist/client/assets/{KnowledgeSearchInspector-DwGMVmFL.js → KnowledgeSearchInspector-32n9baT-.js} +1 -1
  99. package/dist/client/assets/KnowledgeSearchScreen-Dd6jrQ0A.js +1 -0
  100. package/dist/client/assets/{LaneToolHoverCard-C6YehJqD.js → LaneToolHoverCard-CJa110yk.js} +1 -1
  101. package/dist/client/assets/LaneTraceDetailSheet-DYrd0BIf.js +1 -0
  102. package/dist/client/assets/{LaneTraceEventFocus-WLNZZVi_.js → LaneTraceEventFocus-TbrNHRj_.js} +1 -1
  103. package/dist/client/assets/{MeshCanvas-FDDGE69h.js → MeshCanvas-DWZHYh1A.js} +2 -2
  104. package/dist/client/assets/{MeshCanvasMinimap-CGRzQCac.js → MeshCanvasMinimap-iswYFpIb.js} +1 -1
  105. package/dist/client/assets/MeshScreen-8nAzQVbm.js +1 -0
  106. package/dist/client/assets/{MeshTopologyView-C2Cv_2gx.js → MeshTopologyView-BVvtqI8q.js} +2 -2
  107. package/dist/client/assets/MessageEmbeds-ksPazAKH.js +1 -0
  108. package/dist/client/assets/MessagesScreen-C3WB4T21.js +1 -0
  109. package/dist/client/assets/{MissionContextRail-CVSZJnvX.js → MissionContextRail-D62-Wis8.js} +1 -1
  110. package/dist/client/assets/MissionControlView-B9cNPXvl.js +1 -0
  111. package/dist/client/assets/{MissionFocusOverlay-B9SiuO-i.js → MissionFocusOverlay-C1zys3Jv.js} +1 -1
  112. package/dist/client/assets/MissionLeftAgentRow-vycMV77n.js +1 -0
  113. package/dist/client/assets/{MissionLogPane-CMBiI29U.js → MissionLogPane-B19lYSY9.js} +1 -1
  114. package/dist/client/assets/NativeAreaScreen-B1RLa85C.js +1 -0
  115. package/dist/client/assets/NativeAreaScreen-CV0OhGra.js +1 -0
  116. package/dist/client/assets/NativeAreaScreen-CzuZt6o1.js +1 -0
  117. package/dist/client/assets/{NewAgentModal-Cl4nsGhu.js → NewAgentModal-Bh-L-emz.js} +1 -1
  118. package/dist/client/assets/NewChatComposer-C97-iTMK.js +19 -0
  119. package/dist/client/assets/{NewChatOrigin-CyPPWTJP.js → NewChatOrigin-DFbF_XvR.js} +1 -1
  120. package/dist/client/assets/{NodeDetailPanel-BUG8rOb-.js → NodeDetailPanel-CElOEpCh.js} +1 -1
  121. package/dist/client/assets/{NodeMenu-Fw8ATWQA.js → NodeMenu-B-jjHf1c.js} +1 -1
  122. package/dist/client/assets/ObserveEmbedScreen-B7Qt69Ms.js +2 -0
  123. package/dist/client/assets/{ObserveTextFlow-ET0dD1wO.js → ObserveTextFlow-PFnG_10h.js} +2 -2
  124. package/dist/client/assets/{ObservedTopologyPanel-DkEkQzo-.js → ObservedTopologyPanel-CUTIoLZJ.js} +1 -1
  125. package/dist/client/assets/OpenScoutAppShell-37PDFfA4.js +31 -0
  126. package/dist/client/assets/OpsAgentsView-DajlX8LO.js +1 -0
  127. package/dist/client/assets/OpsScreen-jVcaBKGi.js +1 -0
  128. package/dist/client/assets/OpsSubnav-BOOYShHE.js +1 -0
  129. package/dist/client/assets/ProjectAgentProfile-D_wlW4sQ.js +1 -0
  130. package/dist/client/assets/{ProjectAgentProfileBar-C1fR65Eh.js → ProjectAgentProfileBar-DHuMKJj-.js} +1 -1
  131. package/dist/client/assets/ProjectAgentProfileHero-Dbebtug1.js +1 -0
  132. package/dist/client/assets/ProjectsInbox-B8zYE4vP.css +1 -0
  133. package/dist/client/assets/ProjectsInbox-Cgu7B4--.js +2 -0
  134. package/dist/client/assets/ProjectsRail-CDWocin_.js +1 -0
  135. package/dist/client/assets/ProjectsScreen-B_CJycqW.js +1 -0
  136. package/dist/client/assets/ProjectsThreadAside-1MMl_qUD.js +1 -0
  137. package/dist/client/assets/Provider-C35yu29I.js +5 -0
  138. package/dist/client/assets/{RailRow-BYguXNm4.js → RailRow-BjmWK420.js} +1 -1
  139. package/dist/client/assets/RawSessionsTable-DzT90hWu.js +1 -0
  140. package/dist/client/assets/RealtimeVoiceScreen-B6ylX3WQ.js +16 -0
  141. package/dist/client/assets/{RenderedWorkerSprite-CvdWO32C.js → RenderedWorkerSprite-Dhlyg89J.js} +1 -1
  142. package/dist/client/assets/{ReplayClock-B7JLTp8A.js → ReplayClock-348f17bW.js} +1 -1
  143. package/dist/client/assets/{ReplayLog-DZTpf2CW.js → ReplayLog-CBnAM3ui.js} +1 -1
  144. package/dist/client/assets/{ReplayOutpost-CvWQa30T.js → ReplayOutpost-DyRPfNFx.js} +1 -1
  145. package/dist/client/assets/{RepoDiffEmbedScreen-Cbu0_PJW.js → RepoDiffEmbedScreen-BWxvRDrS.js} +1 -1
  146. package/dist/client/assets/{RepoDiffPageScreen-Chwm6GXL.js → RepoDiffPageScreen-DN94irmY.js} +1 -1
  147. package/dist/client/assets/{RepoDiffViewer-C2mb0Wj-.js → RepoDiffViewer-_4JVXBIW.js} +1 -1
  148. package/dist/client/assets/RepoDiffViewerLazy-XGVC3WXv.js +2 -0
  149. package/dist/client/assets/{ReposScreen-C7JZQmyh.js → ReposScreen-uMCpt0e9.js} +2 -2
  150. package/dist/client/assets/{RiggedWorkerCharacter-DNe731GE.js → RiggedWorkerCharacter-q6QRc7_o.js} +1 -1
  151. package/dist/client/assets/{SageModelStudio-BR1J2D4R.js → SageModelStudio-CNDhZhgD.js} +1 -1
  152. package/dist/client/assets/{ScoutDeckSurface-flRamdvE.js → ScoutDeckSurface-CUaU4R6T.js} +1 -1
  153. package/dist/client/assets/{ScoutSurface-BpklGmDL.js → ScoutSurface-3_25USO_.js} +1 -1
  154. package/dist/client/assets/{ScoutbotFxLab-DeK7ySWZ.js → ScoutbotFxLab-CRqhYe0a.js} +1 -1
  155. package/dist/client/assets/{SecondaryNav-BkTn5tkq.js → SecondaryNav-D7dbV2qo.js} +1 -1
  156. package/dist/client/assets/SessionContextStrip-CXfs9hUD.js +1 -0
  157. package/dist/client/assets/SessionContextStrip-DAIXwtHd.css +1 -0
  158. package/dist/client/assets/{SessionEmbedScreen-CcQN6xlo.js → SessionEmbedScreen-D0zFmou-.js} +1 -1
  159. package/dist/client/assets/SessionHopMenu-E6VJZrE0.js +1 -0
  160. package/dist/client/assets/{SessionObserve-BOBJSfs0.css → SessionObserve-CDdJ7fAE.css} +1 -1
  161. package/dist/client/assets/SessionObserve-DXxBvejJ.js +12 -0
  162. package/dist/client/assets/SessionObserveEvidence-Cuj_KHxR.js +1 -0
  163. package/dist/client/assets/SessionRefScreen-DqLSUlCE.js +1 -0
  164. package/dist/client/assets/SessionsScreen-BLIRkohT.js +1 -0
  165. package/dist/client/assets/SettingsDrawer-juCpnbH6.js +3 -0
  166. package/dist/client/assets/SettingsScreen-BtGzE2-O.js +1 -0
  167. package/dist/client/assets/{SharedFloorCharacter-CSYG_t9t.js → SharedFloorCharacter-DNEiaOUh.js} +1 -1
  168. package/dist/client/assets/SharedWorkFloor-0rqtdF-n.css +1 -0
  169. package/dist/client/assets/SharedWorkFloor-D9mf9KSg.js +2 -0
  170. package/dist/client/assets/{ShikiPane-BudrOxNK.js → ShikiPane-CRtTYkMj.js} +1 -1
  171. package/dist/client/assets/{SlidePanel-Datu7XG4.js → SlidePanel-_CHAQdOa.js} +1 -1
  172. package/dist/client/assets/SpaceSwitcher-BLgSCf_T.js +1 -0
  173. package/dist/client/assets/{SpriteAvatar-BW1JzkDt.js → SpriteAvatar-CpZWf54-.js} +1 -1
  174. package/dist/client/assets/{SproutActionSprite-DveCzg6l.js → SproutActionSprite-BSiTS4en.js} +1 -1
  175. package/dist/client/assets/{StatusPill-MxYClPG5.js → StatusPill-2gCP6H7A.js} +1 -1
  176. package/dist/client/assets/{TailView-Dn7uWmPz.js → TailView-CYSijNTy.js} +2 -2
  177. package/dist/client/assets/Terminal-Bi97yb5s.js +4 -0
  178. package/dist/client/assets/TerminalEmbedScreen-Bqop67Bq.js +1 -0
  179. package/dist/client/assets/{TerminalHeaderMount-DCGstkZ4.js → TerminalHeaderMount-Cq4OD_xN.js} +1 -1
  180. package/dist/client/assets/TerminalRelay-DrikpUSJ.js +46 -0
  181. package/dist/client/assets/{TextDocumentSurface-BhYvAB0o.js → TextDocumentSurface-D52m7Vd8.js} +1 -1
  182. package/dist/client/assets/{TmuxPeek-BhK0V9Qt.js → TmuxPeek-CXFeweMg.js} +1 -1
  183. package/dist/client/assets/VoiceControlWell-DF3bjcYA.js +1 -0
  184. package/dist/client/assets/VoicePathDiagram-CmpHWfO-.js +1 -0
  185. package/dist/client/assets/{VoicePermissionsPanel-CecFWzva.js → VoicePermissionsPanel-Ok2nfxHw.js} +1 -1
  186. package/dist/client/assets/VoiceTurnDetails-wAByRaNB.js +8 -0
  187. package/dist/client/assets/VoiceTurnStage-edoJalLV.js +1 -0
  188. package/dist/client/assets/VoiceTurnView-D-8g5E4r.js +1 -0
  189. package/dist/client/assets/WorkDetailScreen-zQkNVy2F.js +5 -0
  190. package/dist/client/assets/{WorkFilesViewer-DJHftsH9.js → WorkFilesViewer-vNt01sDd.js} +1 -1
  191. package/dist/client/assets/{WorkRunView-x5PH1byG.js → WorkRunView-BDkR7Edq.js} +1 -1
  192. package/dist/client/assets/WorldActorTalk-BvSg_b1y.js +1 -0
  193. package/dist/client/assets/{WorldCharacter-Dn4sIXNP.js → WorldCharacter-CIIlutQq.js} +1 -1
  194. package/dist/client/assets/WorldMinimap-B6HNgcDe.js +1 -0
  195. package/dist/client/assets/{WorldSky-DV9bpvXj.js → WorldSky-Jm2Z6dfW.js} +1 -1
  196. package/dist/client/assets/{activity-CSUhvjD0.js → activity-CIlFrfPJ.js} +1 -1
  197. package/dist/client/assets/{addon-fit-MR98IWES.js → addon-fit-dFpj9Kfq.js} +1 -1
  198. package/dist/client/assets/{addon-webgl-CIIKXrvK.js → addon-webgl-BFCGRtGh.js} +1 -1
  199. package/dist/client/assets/{agent-essentials-8t2il7PV.js → agent-essentials-BGGvT5G6.js} +1 -1
  200. package/dist/client/assets/{agent-floor-actor-3v9drnxh.js → agent-floor-actor-DW8zLht0.js} +1 -1
  201. package/dist/client/assets/{agent-lane-card-model-l0stnU9N.js → agent-lane-card-model-CeqQGp-8.js} +1 -1
  202. package/dist/client/assets/{agent-lane-detail-Db7KyAlf.js → agent-lane-detail-Ti3trpfH.js} +1 -1
  203. package/dist/client/assets/{agent-lane-preview-B8lsQJOQ.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
  204. package/dist/client/assets/{agent-lanes-model-CX0wTcnF.js → agent-lanes-model-DMAdqCmK.js} +1 -1
  205. package/dist/client/assets/{agent-master-model-C-KdOFDK.js → agent-master-model-Bk_yuUXJ.js} +1 -1
  206. package/dist/client/assets/{agent-specialization-CiVxQsFT.js → agent-specialization-DDc7mLCW.js} +1 -1
  207. package/dist/client/assets/agents-screen-BYakbO50.css +1 -0
  208. package/dist/client/assets/{api-B9_IqFKY.js → api-BQYTwoz6.js} +1 -1
  209. package/dist/client/assets/{api-CaROe5_H.js → api-DSqpVKC7.js} +1 -1
  210. package/dist/client/assets/{arc.es-BzhWalCl.js → arc.es-C1SQHJ3k.js} +1 -1
  211. package/dist/client/assets/{arrow-left-PuKdO3NM.js → arrow-left-MVUKauwQ.js} +1 -1
  212. package/dist/client/assets/{arrow-right-ldbfp4SZ.js → arrow-right-Bp-FpE5V.js} +1 -1
  213. package/dist/client/assets/{arrow-up-right-Hn754ybA.js → arrow-up-right-BPedAgxO.js} +1 -1
  214. package/dist/client/assets/{book-open-BlJnpf2U.js → book-open-CV98WMSp.js} +1 -1
  215. package/dist/client/assets/{bot-CfN9PSBF.js → bot-B4zLQ4IN.js} +1 -1
  216. package/dist/client/assets/{cache-DEy9E34b.js → cache-DGBo3vIf.js} +1 -1
  217. package/dist/client/assets/chat-api-DSJMBYoT.js +2 -0
  218. package/dist/client/assets/chat-message-markup-91DIry6R.js +1 -0
  219. package/dist/client/assets/chat-space-model-aW3Fd8_U.js +4 -0
  220. package/dist/client/assets/chat-transport-DNS5CB2I.js +1 -0
  221. package/dist/client/assets/{check-B8dMv3Is.js → check-lrJ3a73a.js} +1 -1
  222. package/dist/client/assets/{chevron-down-B5eMsn5c.js → chevron-down-l1mrh5S9.js} +1 -1
  223. package/dist/client/assets/{chevron-right-C7UGFpkl.js → chevron-right-DrfqcerI.js} +1 -1
  224. package/dist/client/assets/{chevron-up-BHOEgHcn.js → chevron-up-CETZJzjV.js} +1 -1
  225. package/dist/client/assets/{chunk-HRAB3GC3-C5X-kFhb.js → chunk-HRAB3GC3-DbVLgbWX.js} +1 -1
  226. package/dist/client/assets/{clock-DFcRbtrl.js → clock-BV1aqPkK.js} +1 -1
  227. package/dist/client/assets/{code-xml-BmyLM0I2.js → code-xml-BhcNbLWU.js} +1 -1
  228. package/dist/client/assets/{coffee-C_D9zooM.js → coffee-D7EAOdCk.js} +1 -1
  229. package/dist/client/assets/{compass-DTZdCpv9.js → compass-63TUaz5_.js} +1 -1
  230. package/dist/client/assets/content-B1lgE8qr.js +1 -0
  231. package/dist/client/assets/content-B5l11YyQ.js +1 -0
  232. package/dist/client/assets/content-BNZOZEpX.js +1 -0
  233. package/dist/client/assets/content-BRIxP155.js +1 -0
  234. package/dist/client/assets/content-BWd8gt8L.js +1 -0
  235. package/dist/client/assets/content-BfwS2jAK.js +1 -0
  236. package/dist/client/assets/content-C4p43_eT.js +1 -0
  237. package/dist/client/assets/content-CdYfaoDV.js +1 -0
  238. package/dist/client/assets/content-CzldLxw0.js +1 -0
  239. package/dist/client/assets/content-D-olnc4U.js +1 -0
  240. package/dist/client/assets/content-DTioimq4.js +1 -0
  241. package/dist/client/assets/content-LOebm3_d.js +1 -0
  242. package/dist/client/assets/content-nGlEZhUI.js +1 -0
  243. package/dist/client/assets/content-oyzDM-LK.js +1 -0
  244. package/dist/client/assets/content-x1PHxED7.js +1 -0
  245. package/dist/client/assets/content-zX3ZY3T9.js +1 -0
  246. package/dist/client/assets/{context-budget-DemtXu7E.js → context-budget-8qFKqM-j.js} +1 -1
  247. package/dist/client/assets/{conversation-icons-BQ4OeOmr.js → conversation-icons-Tqba2d56.js} +1 -1
  248. package/dist/client/assets/conversation-model-FxDeWlle.js +1 -0
  249. package/dist/client/assets/conversation-motion-features-C5zjuNwE.js +1 -0
  250. package/dist/client/assets/conversations-DoAAO6kA.js +1 -0
  251. package/dist/client/assets/{copy-D9WUpQRf.js → copy-xKeM5ZtU.js} +1 -1
  252. package/dist/client/assets/{cpu-Ck_4tB_-.js → cpu-BOTa_WLr.js} +1 -1
  253. package/dist/client/assets/{createLucideIcon-DkjnzvcJ.js → createLucideIcon-zZ8Hx7er.js} +1 -1
  254. package/dist/client/assets/{credentials-C4VXz2hr.js → credentials-OeoF-VKJ.js} +1 -1
  255. package/dist/client/assets/ctx-panel-BC8fpcWJ.css +1 -0
  256. package/dist/client/assets/direct-voice-BbLPuJ04.js +2 -0
  257. package/dist/client/assets/direct-voice-DbO7CSv_.css +1 -0
  258. package/dist/client/assets/discover-DJFxyV1k.js +2 -0
  259. package/dist/client/assets/embed-entry-Lyvu0Kfc.js +2 -0
  260. package/dist/client/assets/{external-link-RT4Ph-6-.js → external-link-CUObqmgX.js} +1 -1
  261. package/dist/client/assets/{eye-CtqSV8BS.js → eye-LrO-cXQt.js} +1 -1
  262. package/dist/client/assets/{file-code-corner-D_Aptal2.js → file-code-corner-CsU7jJpu.js} +1 -1
  263. package/dist/client/assets/{file-text-ChtICwub.js → file-text-CnISiiw6.js} +1 -1
  264. package/dist/client/assets/{flag-CqdOxVkI.js → flag-C4wl8z2-.js} +1 -1
  265. package/dist/client/assets/fleet-roll-call-BUgf7w-V.css +1 -0
  266. package/dist/client/assets/{floor-context-model-DZBpo_oD.js → floor-context-model-rWKqaKmV.js} +1 -1
  267. package/dist/client/assets/{floor-message-passes-CJh9f8Jp.js → floor-message-passes-CO3Ix_wR.js} +1 -1
  268. package/dist/client/assets/{folder-0fWevPvQ.js → folder-D5prSkzz.js} +1 -1
  269. package/dist/client/assets/{gauge-Dgtfxf_o.js → gauge-D9_5iJEm.js} +1 -1
  270. package/dist/client/assets/{gestures-BDCZ1FRG.js → gestures-QZub3Ot9.js} +1 -1
  271. package/dist/client/assets/{git-branch-CA3cHKCI.js → git-branch-B0_fPLO7.js} +1 -1
  272. package/dist/client/assets/{go-shortcuts-DKtw4qYx.js → go-shortcuts-DicR7sUf.js} +1 -1
  273. package/dist/client/assets/home-moving-signal-rpMhsOJB.js +1 -0
  274. package/dist/client/assets/home-now-card-ByE6Umcx.js +1 -0
  275. package/dist/client/assets/{home-now-card-nano-D1ScGrgv.js → home-now-card-nano-B5Dv3-pb.js} +1 -1
  276. package/dist/client/assets/hooks-_eCZZPsR.js +2 -0
  277. package/dist/client/assets/index-724SdE6r.js +1 -0
  278. package/dist/client/assets/{index-CvsM3jm8.js → index-CHD0qcfL.js} +1 -1
  279. package/dist/client/assets/index-CN4rBB_s.css +1 -0
  280. package/dist/client/assets/index-D1d98iYf.js +1 -0
  281. package/dist/client/assets/index-EsrkGBcv.js +10 -0
  282. package/dist/client/assets/index-gGHPA-By.js +1 -0
  283. package/dist/client/assets/{inspector-panel-BLhDODb3.js → inspector-panel-BkgUDn6G.js} +2 -2
  284. package/dist/client/assets/{keyboard-nav-CXfav14z.js → keyboard-nav-DDHegDbx.js} +1 -1
  285. package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
  286. package/dist/client/assets/{lane-observe-BD21P8BB.js → lane-observe-CteDwdD-.js} +3 -3
  287. package/dist/client/assets/{lane-roster-store-DzNHP392.js → lane-roster-store-D-RSWjb-.js} +1 -1
  288. package/dist/client/assets/{layers-Bolb8ejU.js → layers-C8PDiMul.js} +1 -1
  289. package/dist/client/assets/{layout-grid-DI9tVJ2E.js → layout-grid-Cor2frzj.js} +1 -1
  290. package/dist/client/assets/left-Bn5X7x2o.js +2 -0
  291. package/dist/client/assets/left-BqS0fYX1.js +1 -0
  292. package/dist/client/assets/left-CTCeeeD3.js +1 -0
  293. package/dist/client/assets/left-DhtVPVux.js +1 -0
  294. package/dist/client/assets/left-K39b-Wvx.js +2 -0
  295. package/dist/client/assets/left-KGmueNPt.js +1 -0
  296. package/dist/client/assets/left-P_GOYB-s.js +1 -0
  297. package/dist/client/assets/left-advisor-B0N47De2.js +1 -0
  298. package/dist/client/assets/left-agents-CsSNc51Y.js +1 -0
  299. package/dist/client/assets/left-default-BlO5LP2T.js +1 -0
  300. package/dist/client/assets/left-lanes-C4PhaJE6.js +1 -0
  301. package/dist/client/assets/left-mission-BjTE5vPa.js +1 -0
  302. package/dist/client/assets/library-CkWNPHRp.js +1 -0
  303. package/dist/client/assets/{loader-circle-DurUYl7E.js → loader-circle-OvccU82H.js} +1 -1
  304. package/dist/client/assets/{local-agents-D9fYYRyj.js → local-agents-BqnoxJrq.js} +1 -1
  305. package/dist/client/assets/log-in-7SnYqW5w.js +1 -0
  306. package/dist/client/assets/{machine-children-RGS4Q0r6.js → machine-children-DxcqCLmd.js} +1 -1
  307. package/dist/client/assets/media-blobs-Bi8pxr1u.js +1 -0
  308. package/dist/client/assets/{mentions-Ctw1ECUC.js → mentions-ByUvhS-v.js} +1 -1
  309. package/dist/client/assets/{mesh-ops-CGpRk4ik.js → mesh-ops-CiZ8xSAx.js} +1 -1
  310. package/dist/client/assets/{mesh-view-store-CliSYsmt.js → mesh-view-store-DZvJC4KU.js} +1 -1
  311. package/dist/client/assets/{message-circle-CSiJj6yo.js → message-circle-CxRVKNE-.js} +1 -1
  312. package/dist/client/assets/message-markup-BQW5jdJw.js +15 -0
  313. package/dist/client/assets/message-markup-Zwo3t4cI.js +1 -0
  314. package/dist/client/assets/{message-square-NmXWtWLR.js → message-square-BxesYglW.js} +1 -1
  315. package/dist/client/assets/mission-control-model-BpJHDV5D.js +1 -0
  316. package/dist/client/assets/{mission-control-store-DZ29Mlj1.js → mission-control-store-elEEsIvb.js} +1 -1
  317. package/dist/client/assets/{mission-wall-DOuGOxQy.js → mission-wall-CAo4BKfa.js} +1 -1
  318. package/dist/client/assets/monitor-DTTYEb73.js +1 -0
  319. package/dist/client/assets/{nav-destinations-CyXnw9kh.js → nav-destinations-uorRqFxf.js} +1 -1
  320. package/dist/client/assets/{observe-CkfOxYx_.js → observe-BJqERJVj.js} +1 -1
  321. package/dist/client/assets/{operator-attention-DGR4kOog.js → operator-attention-DBaRg5ep.js} +1 -1
  322. package/dist/client/assets/{page-status-CkS3SZu-.js → page-status-BswZLqvA.js} +1 -1
  323. package/dist/client/assets/{panel-right-BNTJhy8M.js → panel-right-Bv7sP_fc.js} +1 -1
  324. package/dist/client/assets/paperclip-BjcuP_Hx.js +1 -0
  325. package/dist/client/assets/{pause-DWS7YGQ3.js → pause-C2XTlkjs.js} +1 -1
  326. package/dist/client/assets/{persistent-state-xsuk6Kc-.js → persistent-state-KRk_yb0q.js} +1 -1
  327. package/dist/client/assets/{pin-DWlD1BOF.js → pin-C2mFOV1l.js} +1 -1
  328. package/dist/client/assets/{play-D_Pggug4.js → play-FT6K3It1.js} +1 -1
  329. package/dist/client/assets/{plus-D_wLGJGT.js → plus-DFDDeGKu.js} +1 -1
  330. package/dist/client/assets/profile-DTmzN16I.js +1 -0
  331. package/dist/client/assets/{projects-inbox-DvbqJO3q.js → projects-inbox-C0FUCv_p.js} +1 -1
  332. package/dist/client/assets/projects-inbox-ColX6lpx.css +1 -0
  333. package/dist/client/assets/provider-Dojd8quC.js +1 -0
  334. package/dist/client/assets/{proxy-DOG46ja4.js → proxy-AJsmwA6h.js} +1 -1
  335. package/dist/client/assets/{radio-C_jtwbFP.js → radio-DRoOZsws.js} +1 -1
  336. package/dist/client/assets/{refresh-cw-Da9DDLk2.js → refresh-cw-BmVr7sCD.js} +1 -1
  337. package/dist/client/assets/resolve-panes-pbY1fCWi.js +1 -0
  338. package/dist/client/assets/resolve-sidebar-context-YWkZTq1t.js +1 -0
  339. package/dist/client/assets/right-49kO-6nD.js +1 -0
  340. package/dist/client/assets/right-APtItA8A.js +1 -0
  341. package/dist/client/assets/right-BJwhPqtn.js +1 -0
  342. package/dist/client/assets/right-BPqrf4ek.js +1 -0
  343. package/dist/client/assets/right-D7djOy6K.js +1 -0
  344. package/dist/client/assets/right-DKOUCRob.js +1 -0
  345. package/dist/client/assets/right-DMNrVzg7.js +1 -0
  346. package/dist/client/assets/{right-BLJsc2-p.js → right-DWPVB-nK.js} +1 -1
  347. package/dist/client/assets/right-DppeMCy4.js +1 -0
  348. package/dist/client/assets/right-GAL5Mw1v.js +1 -0
  349. package/dist/client/assets/{rocket-DyrYDo8V.js → rocket-CGl4RTV7.js} +1 -1
  350. package/dist/client/assets/router-DCtl8wqb.js +1 -0
  351. package/dist/client/assets/runtime-picker-DXu2bOTh.js +1 -0
  352. package/dist/client/assets/{scope-views-B7PZGlhY.js → scope-views-RUWwCVAr.js} +1 -1
  353. package/dist/client/assets/scout-voice-CZx60X6E.js +1 -0
  354. package/dist/client/assets/{scoutbot-markdown-Bz0Vbto2.js → scoutbot-markdown-BKEBSbG0.js} +1 -1
  355. package/dist/client/assets/{scroll-text-DwC8r2g6.js → scroll-text-DNjxhyO2.js} +1 -1
  356. package/dist/client/assets/{search-C4VlW_0l.js → search-DT42oyRW.js} +1 -1
  357. package/dist/client/assets/secondaryNavConfig-CS1svh6n.js +1 -0
  358. package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
  359. package/dist/client/assets/{selection-bridge-B5jqyMR9.js → selection-bridge-x3wFUjxj.js} +1 -1
  360. package/dist/client/assets/{send-horizontal-pOtGI7FM.js → send-horizontal-CH0-fbZE.js} +1 -1
  361. package/dist/client/assets/{send-to-agent-session-BZGq_ycy.js → send-to-agent-session-DoKCDBJ4.js} +1 -1
  362. package/dist/client/assets/{server-ms1yxUYJ.js → server-QfsgMLk1.js} +1 -1
  363. package/dist/client/assets/{session-catalog-s-T_w41t.js → session-catalog-CvSdPHPe.js} +1 -1
  364. package/dist/client/assets/session-recap-lanes-D-eVJnpY.js +1 -0
  365. package/dist/client/assets/session-recap-queue-41l2XVkI.js +1 -0
  366. package/dist/client/assets/{session-table-CDx_16xf.js → session-table-L-pns6Zl.js} +1 -1
  367. package/dist/client/assets/{sessions-view-DzYGsKWS.js → sessions-view-Dc-QAa7O.js} +1 -1
  368. package/dist/client/assets/{settings-TJIkkZ0P.js → settings-BVh7kldq.js} +1 -1
  369. package/dist/client/assets/{shared-work-artifacts-4IIQXQfc.js → shared-work-artifacts-DfNl9KTo.js} +1 -1
  370. package/dist/client/assets/{sliders-horizontal-CHf3ntw0.js → sliders-horizontal-782VC_yy.js} +1 -1
  371. package/dist/client/assets/{sparkles-BbOFw3d0.js → sparkles-BjHq_DNK.js} +1 -1
  372. package/dist/client/assets/{sse-v5QLsOHV.js → sse-BCPRocpq.js} +1 -1
  373. package/dist/client/assets/system-surfaces-redesign-q2BmCB7e.css +1 -0
  374. package/dist/client/assets/{tail-events-DQ46QBW1.js → tail-events-d0yAYxR0.js} +1 -1
  375. package/dist/client/assets/{terminal-96JWDYDL.js → terminal-hQKQygcf.js} +1 -1
  376. package/dist/client/assets/{terminal-relay-Bfx8pg80.js → terminal-relay-Bxs1hp-j.js} +1 -1
  377. package/dist/client/assets/{terminal-sessions-Ch9aYlgi.js → terminal-sessions-3RfJpen8.js} +1 -1
  378. package/dist/client/assets/{terminal-takeover-BlpxpvSp.js → terminal-takeover-Ay5C2c-M.js} +1 -1
  379. package/dist/client/assets/theme-vars-DNK0nn3k.js +1 -0
  380. package/dist/client/assets/triangle-alert-CHoRGdVO.js +1 -0
  381. package/dist/client/assets/use-beside-DoRC1nt0.js +1 -0
  382. package/dist/client/assets/{use-conversation-list-A_YUf8lo.js → use-conversation-list-CY4JciOV.js} +1 -1
  383. package/dist/client/assets/{use-fleet-active-asks-DFs_u-vM.js → use-fleet-active-asks-CymmXWH4.js} +1 -1
  384. package/dist/client/assets/{use-mesh-node-state-Ck9CYplv.js → use-mesh-node-state-BvaqtODo.js} +1 -1
  385. package/dist/client/assets/{use-mesh-ops-items-Be1WmwCg.js → use-mesh-ops-items-BSYaqH_0.js} +1 -1
  386. package/dist/client/assets/{use-reduced-motion-D7n3vK8t.js → use-reduced-motion-3gMYZNIp.js} +1 -1
  387. package/dist/client/assets/use-scout-dev-flags-DS_pYYQd.js +1 -0
  388. package/dist/client/assets/{useAgentHoverCard-Dr-OjNFF.js → useAgentHoverCard-BANmpjMh.js} +1 -1
  389. package/dist/client/assets/useContentSecondaryNav-C6OBu-3_.js +1 -0
  390. package/dist/client/assets/{useEmbedHeadline-BL8wQawZ.js → useEmbedHeadline-D6pJRxUg.js} +1 -1
  391. package/dist/client/assets/usePersistentState-B8lP7TRb.js +1 -0
  392. package/dist/client/assets/{usePierreRuntime-DJkRHMoe.js → usePierreRuntime-BAQdiN0L.js} +1 -1
  393. package/dist/client/assets/useSidebarCollapse-OL_8J5cL.js +1 -0
  394. package/dist/client/assets/users-BUjx36gx.js +1 -0
  395. package/dist/client/assets/voice-paths-CJUuBPh3.css +1 -0
  396. package/dist/client/assets/voice-turn-DftA0iIb.css +1 -0
  397. package/dist/client/assets/voice-turn-ledger-BMZxlSjg.js +1 -0
  398. package/dist/client/assets/{wrench-BsMTSeji.js → wrench-DR0i5BU7.js} +1 -1
  399. package/dist/client/assets/{x-DI1ktCYb.js → x-DAehov0E.js} +1 -1
  400. package/dist/client/assets/{xterm-B1YBE4Gq.js → xterm-BXQiLVnI.js} +1 -1
  401. package/dist/client/assets/{zap-sKPkh4sQ.js → zap-CEjZNZbI.js} +1 -1
  402. package/dist/client/crew/sheets/eye-plate-v1/look-down-left.webp +0 -0
  403. package/dist/client/crew/sheets/eye-plate-v1/look-down-right.webp +0 -0
  404. package/dist/client/crew/sheets/eye-plate-v1/look-down.webp +0 -0
  405. package/dist/client/crew/sheets/eye-plate-v1/look-up-left.webp +0 -0
  406. package/dist/client/crew/sheets/eye-plate-v1/look-up-right.webp +0 -0
  407. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  408. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  409. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  410. package/dist/client/crew/sheets/sprout/look-down-left.webp +0 -0
  411. package/dist/client/crew/sheets/sprout/look-down-right.webp +0 -0
  412. package/dist/client/crew/sheets/sprout/look-down.webp +0 -0
  413. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  414. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  415. package/dist/client/crew/sheets/sprout/look-up-left.webp +0 -0
  416. package/dist/client/crew/sheets/sprout/look-up-right.webp +0 -0
  417. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  418. package/dist/client/index.html +15 -3
  419. package/dist/drizzle/0019_session_actor_targets.sql +227 -0
  420. package/dist/drizzle/0020_message_reactions.sql +11 -0
  421. package/dist/drizzle/README.md +19 -0
  422. package/dist/drizzle/meta/_journal.json +14 -0
  423. package/dist/highlights-eq9cgrbb.scm +604 -0
  424. package/dist/highlights-ghv9g403.scm +205 -0
  425. package/dist/highlights-hk7bwhj4.scm +284 -0
  426. package/dist/highlights-r812a2qc.scm +150 -0
  427. package/dist/highlights-x6tmsnaa.scm +115 -0
  428. package/dist/injections-73j83es3.scm +27 -0
  429. package/dist/main.mjs +1721 -837
  430. package/dist/node/main.mjs +264 -39
  431. package/dist/pairing-runtime-controller.mjs +1090 -570
  432. package/dist/runtime/base-daemon.mjs +14272 -61
  433. package/dist/runtime/broker-daemon.mjs +16999 -1243
  434. package/dist/runtime/broker-process-manager.mjs +101 -6
  435. package/dist/runtime/mesh-discover.mjs +101 -6
  436. package/dist/scout-control-plane-web.mjs +27057 -6178
  437. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  438. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  439. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  440. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  441. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  442. package/dist/update-helper.mjs +294 -56
  443. package/package.json +2 -2
  444. package/dist/client/assets/ActivityScreen-DCALiEXY.js +0 -1
  445. package/dist/client/assets/AgentAdventures-NwTKeF0F.js +0 -1
  446. package/dist/client/assets/AgentAvatar-BIwg54Tj.js +0 -1
  447. package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +0 -1
  448. package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +0 -1
  449. package/dist/client/assets/AgentFloorView-l2wNKFob.js +0 -1
  450. package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +0 -1
  451. package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +0 -1
  452. package/dist/client/assets/AgentLanesView-aAyC7lHf.js +0 -2
  453. package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +0 -1
  454. package/dist/client/assets/AgentSessions-Cox2zS-e.js +0 -6
  455. package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +0 -1
  456. package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +0 -1
  457. package/dist/client/assets/AgentsSubnav-BOobgtGE.js +0 -1
  458. package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +0 -1
  459. package/dist/client/assets/BrokerScreen-CejzhRsB.js +0 -8
  460. package/dist/client/assets/ConversationComposer-B7RU6LKd.js +0 -1
  461. package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +0 -1
  462. package/dist/client/assets/ConversationHeader-CCSU8uo_.js +0 -1
  463. package/dist/client/assets/ConversationScreen-Brfas2y0.css +0 -1
  464. package/dist/client/assets/ConversationScreen-tTP6B_F-.js +0 -2
  465. package/dist/client/assets/ConversationStatus-CK-YfLpi.js +0 -1
  466. package/dist/client/assets/CrewAvatar-CJhuqTsJ.js +0 -1
  467. package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +0 -1
  468. package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
  469. package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +0 -1
  470. package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +0 -1
  471. package/dist/client/assets/FloorTacticalHUD-Bngao6sn.js +0 -1
  472. package/dist/client/assets/HarnessMark-Bt47OeHy.js +0 -1
  473. package/dist/client/assets/HarnessesScreen-M84sFjWY.js +0 -1
  474. package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +0 -1
  475. package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +0 -1
  476. package/dist/client/assets/MeshScreen-DlfiMlaR.js +0 -1
  477. package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +0 -1
  478. package/dist/client/assets/MissionControlView-DpGhxG4a.js +0 -1
  479. package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +0 -1
  480. package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +0 -1
  481. package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +0 -1
  482. package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +0 -1
  483. package/dist/client/assets/NewChatComposer-JjLbm3W2.js +0 -19
  484. package/dist/client/assets/ObserveEmbedScreen-BPiSXXvm.js +0 -2
  485. package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +0 -22
  486. package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +0 -1
  487. package/dist/client/assets/OpsScreen-DJq-aBmX.js +0 -1
  488. package/dist/client/assets/OpsSubnav-9sURjajO.js +0 -1
  489. package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +0 -1
  490. package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +0 -1
  491. package/dist/client/assets/ProjectsInbox-Bs8I__my.js +0 -2
  492. package/dist/client/assets/ProjectsRail-Deb38OJ1.js +0 -1
  493. package/dist/client/assets/ProjectsScreen-CgLiYiss.js +0 -1
  494. package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +0 -1
  495. package/dist/client/assets/Provider-5Hotn7NQ.js +0 -5
  496. package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +0 -1
  497. package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +0 -1
  498. package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +0 -2
  499. package/dist/client/assets/SessionObserve-DaqDhqDI.js +0 -12
  500. package/dist/client/assets/SessionObserveEvidence-Drv-D8Oh.js +0 -1
  501. package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +0 -1
  502. package/dist/client/assets/SessionsScreen-R8QKvoey.js +0 -1
  503. package/dist/client/assets/SettingsDrawer-BDapR4E9.js +0 -3
  504. package/dist/client/assets/SettingsScreen-DirtO7Z0.js +0 -1
  505. package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +0 -1
  506. package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +0 -2
  507. package/dist/client/assets/Terminal-D-DsQlmV.js +0 -4
  508. package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +0 -1
  509. package/dist/client/assets/WorkDetailScreen-CwtRCm_-.js +0 -5
  510. package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +0 -1
  511. package/dist/client/assets/WorldMinimap-Blqg0d5r.js +0 -1
  512. package/dist/client/assets/agent-autocomplete-C7xwIcwd.css +0 -1
  513. package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +0 -10
  514. package/dist/client/assets/agents-screen-BMu6PpRY.css +0 -1
  515. package/dist/client/assets/arrow-down-WoVlkUmg.js +0 -1
  516. package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +0 -46
  517. package/dist/client/assets/chunk-T65CQEWV-CSVUz2rY.js +0 -1
  518. package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +0 -2
  519. package/dist/client/assets/content-B5Q4pb9R.js +0 -1
  520. package/dist/client/assets/content-BK1IfOZs.js +0 -1
  521. package/dist/client/assets/content-BeEsWLEm.js +0 -1
  522. package/dist/client/assets/content-BkOwEknW.js +0 -1
  523. package/dist/client/assets/content-C32W5kAG.js +0 -1
  524. package/dist/client/assets/content-CoqyLs9v.js +0 -1
  525. package/dist/client/assets/content-CwpdIS5b.js +0 -1
  526. package/dist/client/assets/content-DS2OkJ3Q.js +0 -1
  527. package/dist/client/assets/content-DXKaPDfn.js +0 -1
  528. package/dist/client/assets/content-DZt5-dkI.js +0 -1
  529. package/dist/client/assets/content-DbQJH8L1.js +0 -1
  530. package/dist/client/assets/content-DetoiaHq.js +0 -1
  531. package/dist/client/assets/content-Dhu3wL7J.js +0 -1
  532. package/dist/client/assets/content-Dpv34iZu.js +0 -1
  533. package/dist/client/assets/content-TtQJb61D.js +0 -1
  534. package/dist/client/assets/content-ymNb2R7g.js +0 -1
  535. package/dist/client/assets/conversation-model-BGFHoxQ0.js +0 -1
  536. package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +0 -1
  537. package/dist/client/assets/conversations-Cbg9h_Af.js +0 -1
  538. package/dist/client/assets/ctx-panel-F05jXK4Q.css +0 -1
  539. package/dist/client/assets/discover-C8IOY7_K.js +0 -2
  540. package/dist/client/assets/embed-entry-CG3CfCbm.js +0 -2
  541. package/dist/client/assets/home-moving-signal-B7m-ngb2.js +0 -1
  542. package/dist/client/assets/home-now-card-DduXkHRR.js +0 -1
  543. package/dist/client/assets/hooks-C6VyQTQe.js +0 -2
  544. package/dist/client/assets/index-C5cX8dkl.js +0 -1
  545. package/dist/client/assets/index-C8uS5szO.js +0 -10
  546. package/dist/client/assets/index-Ck1__1yL.css +0 -1
  547. package/dist/client/assets/index-ClOOrVG1.js +0 -1
  548. package/dist/client/assets/index-Crtgfc9I.js +0 -1
  549. package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
  550. package/dist/client/assets/left-B-_z_nqj.js +0 -2
  551. package/dist/client/assets/left-B1LY7rJc.js +0 -1
  552. package/dist/client/assets/left-C6bdjWcG.js +0 -2
  553. package/dist/client/assets/left-CF4iuqlz.js +0 -1
  554. package/dist/client/assets/left-DLtNyZl1.js +0 -1
  555. package/dist/client/assets/left-Fpxoq-VY.js +0 -1
  556. package/dist/client/assets/left-N2wXfTlp.js +0 -1
  557. package/dist/client/assets/left-advisor-CeIjCKbd.js +0 -1
  558. package/dist/client/assets/left-agents-upjHVlOj.js +0 -1
  559. package/dist/client/assets/left-default-08gmdCtb.js +0 -1
  560. package/dist/client/assets/left-lanes-Cvsp73Hw.js +0 -1
  561. package/dist/client/assets/left-mission-W1LLaz74.js +0 -1
  562. package/dist/client/assets/library-DLKBVUJ6.js +0 -1
  563. package/dist/client/assets/message-markup-DgFSyb3f.js +0 -15
  564. package/dist/client/assets/mission-control-model-C30vU1Fe.js +0 -1
  565. package/dist/client/assets/profile-C3KgiZvc.js +0 -1
  566. package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
  567. package/dist/client/assets/resolve-panes-DuowGRTk.js +0 -1
  568. package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +0 -1
  569. package/dist/client/assets/right-B9OUA6Ho.js +0 -1
  570. package/dist/client/assets/right-BDQnjetX.js +0 -1
  571. package/dist/client/assets/right-BUbKHmRH.js +0 -1
  572. package/dist/client/assets/right-Ci2IcD4s.js +0 -1
  573. package/dist/client/assets/right-CmCce3e5.js +0 -1
  574. package/dist/client/assets/right-D7w0zM5a.js +0 -1
  575. package/dist/client/assets/right-DIoON_bv.js +0 -1
  576. package/dist/client/assets/right-E0Jr3VN5.js +0 -1
  577. package/dist/client/assets/right-lCdAk9dW.js +0 -1
  578. package/dist/client/assets/router-BKiMcYa7.js +0 -1
  579. package/dist/client/assets/runtime-picker-DdsttHHc.js +0 -1
  580. package/dist/client/assets/scout-voice-DOQ_B77g.js +0 -1
  581. package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +0 -1
  582. package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
  583. package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +0 -1
  584. package/dist/client/assets/use-beside-Df-F2Uvg.js +0 -1
  585. package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +0 -1
  586. package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +0 -1
  587. package/dist/drizzle/meta/0000_snapshot.json +0 -4575
  588. package/dist/drizzle/meta/0001_snapshot.json +0 -4624
  589. package/dist/drizzle/meta/0002_snapshot.json +0 -4631
  590. package/dist/drizzle/meta/0003_snapshot.json +0 -4952
  591. package/dist/drizzle/meta/0004_snapshot.json +0 -5235
  592. package/dist/drizzle/meta/0005_snapshot.json +0 -5599
  593. package/dist/drizzle/meta/0006_snapshot.json +0 -5606
  594. package/dist/drizzle/meta/0007_snapshot.json +0 -5767
  595. package/dist/drizzle/meta/0008_snapshot.json +0 -5774
  596. package/dist/drizzle/meta/0009_snapshot.json +0 -6262
  597. package/dist/drizzle/meta/0010_snapshot.json +0 -6286
  598. package/dist/drizzle/meta/0011_snapshot.json +0 -6337
  599. package/dist/drizzle/meta/0012_snapshot.json +0 -6458
  600. package/dist/drizzle/meta/0013_snapshot.json +0 -6465
  601. package/dist/drizzle/meta/0014_snapshot.json +0 -6503
  602. package/dist/drizzle/meta/0015_snapshot.json +0 -6596
  603. package/dist/drizzle/meta/0016_snapshot.json +0 -6611
  604. package/dist/drizzle/meta/0017_snapshot.json +0 -6785
  605. package/dist/drizzle/meta/0018_snapshot.json +0 -6804
@@ -1,3 +1,3 @@
1
- import{r as u,j as s}from"./index-C8uS5szO.js";import{C as pe}from"./chunk-T65CQEWV-CSVUz2rY.js";import{u as ne,t as oe,a as D,b as ue,c as fe,d as xe,e as ye,f as we}from"./mesh-view-store-CliSYsmt.js";import{NodeMenu as ge,nodeMenuRowProps as be}from"./NodeMenu-Fw8ATWQA.js";import{c as ve,b as Ne}from"./machine-children-RGS4Q0r6.js";import{u as je,s as Ce,r as Me}from"./use-mesh-node-state-Ck9CYplv.js";import{n as T}from"./agent-state-DDhnFEEP.js";import{s as z}from"./colors-CFlbwC25.js";import{t as Z}from"./time-Dhsh_2EG.js";import{u as Ie}from"./Provider-5Hotn7NQ.js";import{u as He}from"./useAgentHoverCard-Dr-OjNFF.js";import"./plus-D_wLGJGT.js";import"./createLucideIcon-DkjnzvcJ.js";import"./index-C5cX8dkl.js";import"./api-CaROe5_H.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./conversation-model-BGFHoxQ0.js";import"./conversations-Cbg9h_Af.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./openContent-C6XO6kr5.js";import"./eye-CtqSV8BS.js";import"./terminal-96JWDYDL.js";function $e(e,t){if(t.type==="pan")return{...e,pan:{x:e.pan.x+t.delta.x,y:e.pan.y+t.delta.y}};if(t.type==="zoom"){const n=Math.max(.25,Math.min(4,e.scale*t.factor)),{mx:i,my:d,cx:o,cy:f}=t,p=(i-o)/e.scale-e.pan.x,y=(d-f)/e.scale-e.pan.y;return{scale:n,pan:{x:(i-o)/n-p,y:(d-f)/n-y}}}return e}const re="openscout.mesh.canvas.viewport.v1";function Se(){const e={pan:{x:0,y:0},scale:1};if(typeof window>"u")return e;try{const t=window.sessionStorage.getItem(re);if(!t)return e;const n=JSON.parse(t);if(n&&typeof n=="object"&&typeof n.scale=="number"&&n.pan&&typeof n.pan.x=="number"&&typeof n.pan.y=="number")return{pan:{x:n.pan.x,y:n.pan.y},scale:n.scale}}catch{}return e}function ke(e){const t=e.name&&e.name.trim()||e.handle&&e.handle.trim()||e.harness&&e.harness.trim()||"agent";return{key:t.toLowerCase(),label:t}}function Ee(e){const t=new Map;for(const n of e){const{key:i,label:d}=ke(n);let o=t.get(i);o||(o={key:i,label:d,instances:[]},t.set(i,o)),o.instances.push(n)}return Array.from(t.values()).map(n=>(n.instances.sort((i,d)=>i.id.localeCompare(d.id)),n)).sort((n,i)=>{const d=n.label.localeCompare(i.label);return d!==0?d:i.instances.length-n.instances.length})}function Ae(e){switch(e){case"compact":return{density:e,instanceW:138,instanceH:32,stepX:144,stepY:38,clusterPadX:12,clusterPadY:12,labelH:22,clusterGap:16};case"spacious":return{density:e,instanceW:260,instanceH:68,stepX:268,stepY:76,clusterPadX:14,clusterPadY:14,labelH:26,clusterGap:16};default:return{density:"comfortable",instanceW:210,instanceH:52,stepX:218,stepY:60,clusterPadX:12,clusterPadY:12,labelH:24,clusterGap:14}}}function _e(e,t){return Math.max(1,Math.round(Math.sqrt(e*t)))}function Ye(e,t,n){if(e.length===0)return[];const i=e.map(h=>{const I=h.instances.length,r=_e(I,Math.max(.6,Math.min(n,2))),H=Math.ceil(I/r),C=r*t.stepX-(t.stepX-t.instanceW),E=H*t.stepY-(t.stepY-t.instanceH);return{cluster:h,cols:r,width:C+t.clusterPadX*2,height:E+t.clusterPadY*2+t.labelH}}),d=i.reduce((h,I)=>h+I.width*I.height,0),o=Math.max(Math.max(...i.map(h=>h.width)),Math.sqrt(d*n)),f=t.clusterGap,p=[];let y=0,M=0,g=0;for(const h of i)y>0&&y+h.width>o&&(M+=g+f,y=0,g=0),p.push({cluster:h.cluster,x:y,y:M,width:h.width,height:h.height,cols:h.cols}),y+=h.width+f,g=Math.max(g,h.height);const b=Math.min(...p.map(h=>h.x)),l=Math.max(...p.map(h=>h.x+h.width)),v=Math.min(...p.map(h=>h.y)),j=Math.max(...p.map(h=>h.y+h.height)),c=-((b+l)/2),x=-((v+j)/2);return p.map(h=>({...h,x:h.x+c,y:h.y+x}))}function Pe(e,t,n){const i=e%t,d=Math.floor(e/t);return{x:n.clusterPadX+i*n.stepX,y:n.labelH+n.clusterPadY+d*n.stepY}}function ee(e){const t=e.harness?.trim(),n=e.model?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function se(e){const t=e.project?.trim(),n=e.branch?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function B(e){return e.cwd||e.projectRoot||"—"}function te({onClick:e}){return s.jsx("button",{type:"button",className:"mesh-sheet-open",title:"Open agent view","aria-label":"Open agent view",onClick:t=>{t.stopPropagation(),e()},children:"↗"})}function Oe({agent:e,onOpen:t,bindings:n,active:i}){const d=T(e.state),o=e.agentClass==="organic",f=e.updatedAt?Z(e.updatedAt):"",p=ee(e),y=se(e);return s.jsxs("div",{...n??{},className:`mesh-instance-spec mesh-instance-spec--${d}${o?" mesh-instance-spec--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":z(e.state)},title:`${p} — ${y}`,children:[s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-primary",children:p}),f&&s.jsx("span",{className:"mesh-instance-spec-time",children:f})]}),s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-secondary",children:y}),s.jsx(te,{onClick:t})]})]})}function Xe({agent:e,onOpen:t,bindings:n,active:i}){const d=T(e.state),o=e.agentClass==="organic",f=e.updatedAt?Z(e.updatedAt):"—",p=`${ee(e)} · ${se(e)}`;return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--${d}${o?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":z(e.state)},title:`${p}
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-C8uS5szO.js";import{u as I,g as S,t as k,a as b,r as B}from"./mesh-view-store-CliSYsmt.js";import{u as L}from"./Provider-5Hotn7NQ.js";import{a as N,e as P}from"./agent-state-DDhnFEEP.js";import{a as v}from"./use-mesh-node-state-Ck9CYplv.js";import{c as R,m as y}from"./machine-children-RGS4Q0r6.js";import{s as w}from"./colors-CFlbwC25.js";function D(){const[i,m]=g.useState("rack"),{agents:c}=L(),{meshSnapshot:t,selectedId:h,selectedType:a,hiddenMachineIds:s,machinePositions:r}=I(),n=g.useMemo(()=>t?R(c,t):[],[c,t]);if(!t||n.length===0)return null;const u=n.filter(p=>!s.has(p.machineId)).length,l=n.length,d=Object.keys(r).length,o=p=>{b(p,"node"),B(p)};return e.jsxs("div",{className:"mesh-rail",children:[e.jsxs("div",{className:"mesh-rail-head",children:[e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0}),e.jsxs("div",{className:"mesh-rail-mode",role:"group","aria-label":"Bottom view",children:[e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="map"?" mesh-rail-mode-btn--active":""}`,onClick:()=>m("map"),"aria-pressed":i==="map",children:"map"}),e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="rack"?" mesh-rail-mode-btn--active":""}`,onClick:()=>m("rack"),"aria-pressed":i==="rack",children:"rack"})]}),e.jsx("span",{className:"mesh-rail-title-count",children:l}),e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0})]}),i==="rack"?e.jsx(A,{buckets:n,hiddenMachineIds:s,selectedId:h,selectedType:a,onFocus:o}):e.jsx(F,{buckets:n,selectedId:h,selectedType:a,onFocus:o}),e.jsxs("div",{className:"mesh-rail-foot",children:[e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0}),e.jsx("span",{className:"mesh-rail-foot-meta",children:i==="map"?`${l} machines`:`${u}/${l} shown`}),d>0&&i==="rack"?e.jsx("button",{type:"button",className:"mesh-rail-foot-reset",onClick:()=>S(),title:"Reset machine layout",children:"reset"}):e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0})]})]})}function A({buckets:i,hiddenMachineIds:m,selectedId:c,selectedType:t,onFocus:h}){const{entries:a}=v();return e.jsx("div",{className:"mesh-rail-body",children:i.map((s,r)=>{const n=m.has(s.machineId),u=c===s.machineId&&t==="node",l=s.agents.filter(x=>N(x.state)).length;s.agents.filter(x=>P(x.state)).length;const d=s.online?s.agents.length===0?"offline":l>0?"working":"available":"offline",o=n||!s.online?void 0:w(d),p=s.reachability==="this"?"L":s.reachability==="peer"?"P":s.reachability==="tailnet"?"T":"·",M=String(r+1).padStart(2,"0"),f=a[s.machineId],j=f?.view??null,C=y(s,j,f?.loading??!1),$=s.kind==="this"?s.agents.length:j?.workload?.total??"—";return e.jsxs("div",{className:["mesh-rail-unit",n&&"mesh-rail-unit--off",!s.online&&"mesh-rail-unit--unreachable",u&&"mesh-rail-unit--active"].filter(Boolean).join(" "),children:[e.jsxs("button",{type:"button",className:"mesh-rail-unit-body",onClick:()=>h(s.machineId),title:`Focus ${s.machineLabel} on the map`,children:[e.jsx("span",{className:"mesh-rail-slot",children:M}),e.jsx("span",{className:`mesh-rail-led${n||!s.online?"":" mesh-rail-led--on"}`,style:o?{background:o,color:o}:void 0,"aria-hidden":!0}),e.jsxs("span",{className:"mesh-rail-unit-text",children:[e.jsx("span",{className:"mesh-rail-unit-name",title:s.machineLabel,children:s.machineLabel}),e.jsxs("span",{className:"mesh-rail-unit-sub",children:[e.jsx("span",{className:`mesh-rail-reach mesh-rail-reach--${s.reachability}`,children:p}),e.jsx("span",{className:"mesh-rail-unit-stamp",children:C})]})]}),e.jsx("span",{className:"mesh-rail-unit-count",children:$})]}),e.jsx("div",{className:"mesh-rail-unit-actions",children:e.jsx("button",{type:"button",className:`mesh-rail-unit-eye${n?" mesh-rail-unit-eye--off":""}`,onClick:x=>{x.stopPropagation(),k(s.machineId)},title:n?"Show in workspace":"Hide from workspace","aria-pressed":!n,children:n?"○":"●"})}),e.jsx("span",{className:"mesh-rail-vent","aria-hidden":!0})]},s.machineId)})})}function F({buckets:i,selectedId:m,selectedType:c,onFocus:t}){const{entries:h}=v();return e.jsx("div",{className:"mesh-rail-body mesh-rail-body--map",children:e.jsx("div",{className:"mesh-mini-map",children:i.map(a=>{const s=h[a.machineId],r=a.kind==="this"?a.agents.length:s?.view?.workload?.total,n=m===a.machineId&&c==="node",u=a.agents.filter(o=>N(o.state)).length,l=a.online?a.agents.length===0?"offline":u>0?"working":"available":"offline",d=a.online?w(l):void 0;return e.jsxs("button",{type:"button",className:`mesh-mini-node mesh-mini-node--${l}${n?" mesh-mini-node--active":""}${a.online?"":" mesh-mini-node--off"}`,onClick:()=>t(a.machineId),title:`${a.machineLabel} — ${y(a,s?.view??null,s?.loading??!1)}`,children:[e.jsx("span",{className:"mesh-mini-led",style:d?{background:d}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"mesh-mini-label",children:a.machineLabel}),r!==void 0&&r>0&&e.jsx("span",{className:"mesh-mini-count",children:r})]},a.machineId)})})})}export{D as M};
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-BzhWalCl.js","assets/index-C8uS5szO.js","assets/index-Ck1__1yL.css"])))=>i.map(i=>d[i]);
2
- import{r as g,j as d,_ as j}from"./index-C8uS5szO.js";const E=g.lazy(()=>j(()=>import("./arc.es-BzhWalCl.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};
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-C8uS5szO.js";import{H as A}from"./HarnessMark-Bt47OeHy.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-DemtXu7E.js";import{s as b}from"./page-status-CkS3SZu-.js";import{t as T}from"./time-Dhsh_2EG.js";import{b as y,a as B,l as O}from"./agent-lane-detail-Db7KyAlf.js";import{b as _}from"./agent-lane-preview-B8lsQJOQ.js";import{m as F}from"./mission-wall-DOuGOxQy.js";import"./lane-observe-BD21P8BB.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./lane-ask-display-B6iCAVcd.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};
@@ -1 +1 @@
1
- import{r as f,j as e}from"./index-C8uS5szO.js";import{a as w}from"./colors-CFlbwC25.js";import{c as N,n as $}from"./agent-state-DDhnFEEP.js";import{u as C}from"./keyboard-nav-CXfav14z.js";import{t as j}from"./time-Dhsh_2EG.js";import{M,f as S}from"./runtime-picker-DdsttHHc.js";import{s as v}from"./page-status-CkS3SZu-.js";import"./api-CaROe5_H.js";import"./index-C5cX8dkl.js";import{K as k}from"./mission-control-model-C30vU1Fe.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";function g({agent:s,observe:a,onClose:l,onSend:o,onOpenConversation:r,onTail:d,onProfile:p}){const h=w(s.name),{ref:m,onKeyDown:u}=C(),[i,n]=f.useState("profile"),c=t=>{if(u(t),t.defaultPrevented)return;const y=t.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||(y?.isContentEditable??!1)||(t.key==="1"?(t.preventDefault(),n("profile")):t.key==="2"?(t.preventDefault(),n("activity")):t.key==="3"&&(t.preventDefault(),n("message")))};return e.jsx("div",{className:"s-mission-overlay",onClick:l,children:e.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":"mission-overlay-title",onClick:t=>t.stopPropagation(),onKeyDown:c,tabIndex:-1,className:"s-mission-overlay-dialog",children:[e.jsxs("div",{className:"s-mission-overlay-header",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:h},children:s.name[0]?.toUpperCase()}),e.jsxs("div",{className:"s-mission-overlay-identity",children:[e.jsxs("div",{className:"s-mission-overlay-name",id:"mission-overlay-title",children:[s.name," ",e.jsx("span",{className:"s-mission-overlay-handle",children:s.handle?`@${s.handle}`:""})]}),e.jsxs("div",{className:"s-mission-overlay-meta",children:[s.project??"—"," · ",s.branch??"main"," · ",N(s.state)]})]}),e.jsx("button",{className:"s-mission-overlay-close",onClick:l,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs",role:"tablist",children:[e.jsxs("div",{className:"s-mission-overlay-tabs-group",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":i==="profile",className:`s-mission-overlay-tab${i==="profile"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("profile"),children:"Profile"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="activity",className:`s-mission-overlay-tab${i==="activity"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("activity"),children:"Activity"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="message",className:`s-mission-overlay-tab${i==="message"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("message"),children:"Message"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs-action",children:[i==="profile"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:p,...v({label:`Open profile · ${s.handle??s.name}`,route:`/agents/${s.id}`}),children:"Open profile ↗"}),i==="activity"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:d,...v({label:`Tail · ${s.handle??s.name}`,route:`/ops/tail?q=${encodeURIComponent(s.handle??s.name)}`}),children:"Open in Tail ↗"}),i==="message"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:r,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"})]})]}),e.jsxs("div",{className:"s-mission-overlay-body",children:[i==="profile"&&e.jsx(E,{agent:s}),i==="activity"&&e.jsx(D,{agent:s,observe:a,onOpenConversation:r,onMessage:()=>n("message")}),i==="message"&&e.jsx(O,{agent:s,onSend:o,onOpenConversation:r})]})]})})}function E({agent:s}){const a=[["MODEL",[s.harness,s.model].filter(Boolean).join("/")||"—"],["AT",[s.project,s.branch].filter(Boolean).join("/")||"—"],["CWD",s.cwd||s.projectRoot||"—"],["AGENT",s.agentClass||"—"],["ROLE",s.role||s.transport||"—"],["MACHINE",s.authorityNodeName??s.homeNodeName??s.authorityNodeId??s.homeNodeId??"—"],["OWNER",s.ownerHandle??s.ownerName??s.ownerId??"—"],["SPAWNED",s.createdAt?j(s.createdAt):"—"],["STATE",N(s.state)]];return e.jsx("div",{className:"s-focus-tab",children:e.jsx("dl",{className:"s-focus-spec",children:a.map(([l,o])=>e.jsxs("div",{className:"s-focus-spec-row",children:[e.jsx("dt",{className:"s-focus-spec-label",children:l}),e.jsx("dd",{className:"s-focus-spec-value",title:o,children:o})]},l))})})}const T={tool:"▸",think:"·",ask:"?",message:"✉",note:"•",system:"◇",boot:"↑"};function A(s,a){if(a){const o=Date.now()-(a+s*1e3);return o<6e4?`${Math.max(0,Math.round(o/1e3))}s`:o<36e5?`${Math.round(o/6e4)}m`:o<864e5?`${Math.round(o/36e5)}h`:`${Math.round(o/864e5)}d`}const l=Math.max(0,Math.round(s));return l<60?`${l}s`:l<3600?`${Math.round(l/60)}m`:`${Math.round(l/3600)}h`}function I(s){if(s.kind==="tool"){const a=s.tool??"tool";return s.arg?`${a} · ${s.arg}`:a}return s.kind==="ask"?s.text||"request received":s.text||s.detail||k[s.kind]||s.kind}function D({agent:s,observe:a,onOpenConversation:l,onMessage:o}){const r=a?.events??[],d=a?.metadata?.usage,p=typeof a?.metadata?.session?.sessionStart=="number"?(a?.metadata?.session).sessionStart:null,h=r.slice(-14).reverse(),m=d?.assistantMessages??r.filter(t=>t.kind==="message").length,u=r.filter(t=>t.kind==="tool").length,i=r.filter(t=>t.kind==="tool"&&(t.tool==="edit"||t.tool==="write")).length,n=a?.contextUsage&&a.contextUsage.length>0?Math.round(a.contextUsage[a.contextUsage.length-1]*100):null,c=n!==null?`${n}%`:d?.contextWindowTokens&&d?.contextInputTokens?`${Math.round(d.contextInputTokens/d.contextWindowTokens*100)}%`:"—";return e.jsxs("div",{className:"s-focus-tab s-focus-tab--activity-preview",children:[e.jsxs("dl",{className:"s-focus-stats",children:[e.jsx(b,{label:"Turns",value:m||"—"}),e.jsx(b,{label:"Tools",value:u||"—"}),e.jsx(b,{label:"Edits",value:i||"—"}),e.jsx(b,{label:"Context",value:c})]}),h.length===0?e.jsx(L,{agent:s,onOpenConversation:l,onMessage:o}):e.jsx("ul",{className:"s-focus-activity-list",children:h.map(t=>e.jsxs("li",{className:`s-focus-activity-row s-focus-activity-row--${t.kind}`,children:[e.jsx("span",{className:"s-focus-activity-time",children:A(t.t,p)}),e.jsx("span",{className:"s-focus-activity-glyph","aria-hidden":!0,children:T[t.kind]??"·"}),e.jsx("span",{className:"s-focus-activity-kind",children:k[t.kind]??t.kind}),e.jsx("span",{className:"s-focus-activity-text",children:I(t)})]},t.id))})]})}function L({agent:s,onOpenConversation:a,onMessage:l}){const o=S(s.role),r=[s.harness,s.model].filter(Boolean).join("/"),d=[s.project,s.branch].filter(Boolean).join("/"),p=$(s.state),h=N(p),m=s.createdAt?j(s.createdAt):null,u=s.updatedAt?j(s.updatedAt):null,i=s.homeNodeName??s.homeNodeId,n=s.ownerHandle??s.ownerName??s.ownerId,c=[];return o&&c.push({label:"Role",value:o}),r&&c.push({label:"Stack",value:r}),d&&c.push({label:"At",value:d}),i&&c.push({label:"Home",value:i}),n&&c.push({label:"Owner",value:n}),m&&c.push({label:"Spawned",value:m}),c.push({label:"State",value:h}),u&&c.push({label:"Last seen",value:u}),e.jsxs("div",{className:"s-focus-activity-empty s-focus-activity-empty--rich",children:[e.jsxs("div",{className:"s-focus-activity-empty-head",children:[e.jsx("span",{className:"s-focus-activity-empty-eyebrow",children:"No tool or turn events recorded"}),e.jsx("span",{className:"s-focus-activity-empty-title",children:s.handle??s.name})]}),e.jsx("dl",{className:"s-focus-activity-empty-facts",children:c.map(t=>e.jsxs("div",{className:"s-focus-activity-empty-fact",children:[e.jsx("dt",{children:t.label}),e.jsx("dd",{title:t.value,children:t.value})]},t.label))}),e.jsxs("div",{className:"s-focus-activity-empty-actions",children:[e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn",onClick:a,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"}),e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn s-focus-activity-empty-btn--primary",onClick:l,...v({label:`Compose message · ${s.handle??s.name}`}),children:"Send a message"})]})]})}function b({label:s,value:a}){return e.jsxs("div",{className:"s-focus-stat",children:[e.jsx("dt",{className:"s-focus-stat-label",children:s}),e.jsx("dd",{className:"s-focus-stat-value",children:a})]})}function O({agent:s,onSend:a,onOpenConversation:l}){const[o,r]=f.useState(""),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[u,i]=f.useState(null),n=f.useRef(null);f.useEffect(()=>{n.current?.focus()},[]);const c=async()=>{const y=o.trim();if(!(!y||d)){p(!0),i(null);try{await a(y),r(""),m(!0),setTimeout(()=>m(!1),1800)}catch(x){i(x instanceof Error?x.message:String(x))}finally{p(!1)}}},t=s.handle??s.name;return e.jsx("div",{className:"s-focus-tab",children:e.jsx("div",{className:"s-focus-compose",children:e.jsx(M,{density:"panel",value:o,onChange:r,onSend:()=>{c()},sending:d,placeholder:`Message @${t}…`,textareaRef:n,rows:4,"aria-label":`Message @${t}`,header:e.jsxs("div",{className:"s-focus-compose-label",children:["Message ",e.jsxs("span",{className:"s-focus-compose-target",children:["@",t]})]}),tools:e.jsx("div",{className:"s-focus-compose-hint",children:u?e.jsxs("span",{className:"s-focus-compose-error",children:["Send failed: ",u]}):h?e.jsxs("span",{className:"s-focus-compose-ok",children:["Sent ↗"," ",e.jsx("button",{type:"button",className:"s-focus-compose-link",onClick:l,children:"Open Chat"})]}):e.jsx("span",{children:"Send starts a Run, or steers the active Run when this agent is already working."})})})})})}export{g as FocusOverlay};
1
+ import{r as f,j as e}from"./index-EsrkGBcv.js";import{a as w}from"./colors-CFlbwC25.js";import{c as N,n as $}from"./agent-state-DDhnFEEP.js";import{u as C}from"./keyboard-nav-DDHegDbx.js";import{t as j}from"./time-Dhsh_2EG.js";import{M,f as S}from"./runtime-picker-DXu2bOTh.js";import{s as v}from"./page-status-BswZLqvA.js";import"./api-DSqpVKC7.js";import"./index-724SdE6r.js";import{K as k}from"./mission-control-model-BpJHDV5D.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";function g({agent:s,observe:a,onClose:l,onSend:o,onOpenConversation:r,onTail:d,onProfile:p}){const h=w(s.name),{ref:m,onKeyDown:u}=C(),[i,n]=f.useState("profile"),c=t=>{if(u(t),t.defaultPrevented)return;const y=t.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||(y?.isContentEditable??!1)||(t.key==="1"?(t.preventDefault(),n("profile")):t.key==="2"?(t.preventDefault(),n("activity")):t.key==="3"&&(t.preventDefault(),n("message")))};return e.jsx("div",{className:"s-mission-overlay",onClick:l,children:e.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":"mission-overlay-title",onClick:t=>t.stopPropagation(),onKeyDown:c,tabIndex:-1,className:"s-mission-overlay-dialog",children:[e.jsxs("div",{className:"s-mission-overlay-header",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:h},children:s.name[0]?.toUpperCase()}),e.jsxs("div",{className:"s-mission-overlay-identity",children:[e.jsxs("div",{className:"s-mission-overlay-name",id:"mission-overlay-title",children:[s.name," ",e.jsx("span",{className:"s-mission-overlay-handle",children:s.handle?`@${s.handle}`:""})]}),e.jsxs("div",{className:"s-mission-overlay-meta",children:[s.project??"—"," · ",s.branch??"main"," · ",N(s.state)]})]}),e.jsx("button",{className:"s-mission-overlay-close",onClick:l,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs",role:"tablist",children:[e.jsxs("div",{className:"s-mission-overlay-tabs-group",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":i==="profile",className:`s-mission-overlay-tab${i==="profile"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("profile"),children:"Profile"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="activity",className:`s-mission-overlay-tab${i==="activity"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("activity"),children:"Activity"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="message",className:`s-mission-overlay-tab${i==="message"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("message"),children:"Message"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs-action",children:[i==="profile"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:p,...v({label:`Open profile · ${s.handle??s.name}`,route:`/agents/${s.id}`}),children:"Open profile ↗"}),i==="activity"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:d,...v({label:`Tail · ${s.handle??s.name}`,route:`/ops/tail?q=${encodeURIComponent(s.handle??s.name)}`}),children:"Open in Tail ↗"}),i==="message"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:r,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"})]})]}),e.jsxs("div",{className:"s-mission-overlay-body",children:[i==="profile"&&e.jsx(E,{agent:s}),i==="activity"&&e.jsx(D,{agent:s,observe:a,onOpenConversation:r,onMessage:()=>n("message")}),i==="message"&&e.jsx(O,{agent:s,onSend:o,onOpenConversation:r})]})]})})}function E({agent:s}){const a=[["MODEL",[s.harness,s.model].filter(Boolean).join("/")||"—"],["AT",[s.project,s.branch].filter(Boolean).join("/")||"—"],["CWD",s.cwd||s.projectRoot||"—"],["AGENT",s.agentClass||"—"],["ROLE",s.role||s.transport||"—"],["MACHINE",s.authorityNodeName??s.homeNodeName??s.authorityNodeId??s.homeNodeId??"—"],["OWNER",s.ownerHandle??s.ownerName??s.ownerId??"—"],["SPAWNED",s.createdAt?j(s.createdAt):"—"],["STATE",N(s.state)]];return e.jsx("div",{className:"s-focus-tab",children:e.jsx("dl",{className:"s-focus-spec",children:a.map(([l,o])=>e.jsxs("div",{className:"s-focus-spec-row",children:[e.jsx("dt",{className:"s-focus-spec-label",children:l}),e.jsx("dd",{className:"s-focus-spec-value",title:o,children:o})]},l))})})}const T={tool:"▸",think:"·",ask:"?",message:"✉",note:"•",system:"◇",boot:"↑"};function A(s,a){if(a){const o=Date.now()-(a+s*1e3);return o<6e4?`${Math.max(0,Math.round(o/1e3))}s`:o<36e5?`${Math.round(o/6e4)}m`:o<864e5?`${Math.round(o/36e5)}h`:`${Math.round(o/864e5)}d`}const l=Math.max(0,Math.round(s));return l<60?`${l}s`:l<3600?`${Math.round(l/60)}m`:`${Math.round(l/3600)}h`}function I(s){if(s.kind==="tool"){const a=s.tool??"tool";return s.arg?`${a} · ${s.arg}`:a}return s.kind==="ask"?s.text||"request received":s.text||s.detail||k[s.kind]||s.kind}function D({agent:s,observe:a,onOpenConversation:l,onMessage:o}){const r=a?.events??[],d=a?.metadata?.usage,p=typeof a?.metadata?.session?.sessionStart=="number"?(a?.metadata?.session).sessionStart:null,h=r.slice(-14).reverse(),m=d?.assistantMessages??r.filter(t=>t.kind==="message").length,u=r.filter(t=>t.kind==="tool").length,i=r.filter(t=>t.kind==="tool"&&(t.tool==="edit"||t.tool==="write")).length,n=a?.contextUsage&&a.contextUsage.length>0?Math.round(a.contextUsage[a.contextUsage.length-1]*100):null,c=n!==null?`${n}%`:d?.contextWindowTokens&&d?.contextInputTokens?`${Math.round(d.contextInputTokens/d.contextWindowTokens*100)}%`:"—";return e.jsxs("div",{className:"s-focus-tab s-focus-tab--activity-preview",children:[e.jsxs("dl",{className:"s-focus-stats",children:[e.jsx(b,{label:"Turns",value:m||"—"}),e.jsx(b,{label:"Tools",value:u||"—"}),e.jsx(b,{label:"Edits",value:i||"—"}),e.jsx(b,{label:"Context",value:c})]}),h.length===0?e.jsx(L,{agent:s,onOpenConversation:l,onMessage:o}):e.jsx("ul",{className:"s-focus-activity-list",children:h.map(t=>e.jsxs("li",{className:`s-focus-activity-row s-focus-activity-row--${t.kind}`,children:[e.jsx("span",{className:"s-focus-activity-time",children:A(t.t,p)}),e.jsx("span",{className:"s-focus-activity-glyph","aria-hidden":!0,children:T[t.kind]??"·"}),e.jsx("span",{className:"s-focus-activity-kind",children:k[t.kind]??t.kind}),e.jsx("span",{className:"s-focus-activity-text",children:I(t)})]},t.id))})]})}function L({agent:s,onOpenConversation:a,onMessage:l}){const o=S(s.role),r=[s.harness,s.model].filter(Boolean).join("/"),d=[s.project,s.branch].filter(Boolean).join("/"),p=$(s.state),h=N(p),m=s.createdAt?j(s.createdAt):null,u=s.updatedAt?j(s.updatedAt):null,i=s.homeNodeName??s.homeNodeId,n=s.ownerHandle??s.ownerName??s.ownerId,c=[];return o&&c.push({label:"Role",value:o}),r&&c.push({label:"Stack",value:r}),d&&c.push({label:"At",value:d}),i&&c.push({label:"Home",value:i}),n&&c.push({label:"Owner",value:n}),m&&c.push({label:"Spawned",value:m}),c.push({label:"State",value:h}),u&&c.push({label:"Last seen",value:u}),e.jsxs("div",{className:"s-focus-activity-empty s-focus-activity-empty--rich",children:[e.jsxs("div",{className:"s-focus-activity-empty-head",children:[e.jsx("span",{className:"s-focus-activity-empty-eyebrow",children:"No tool or turn events recorded"}),e.jsx("span",{className:"s-focus-activity-empty-title",children:s.handle??s.name})]}),e.jsx("dl",{className:"s-focus-activity-empty-facts",children:c.map(t=>e.jsxs("div",{className:"s-focus-activity-empty-fact",children:[e.jsx("dt",{children:t.label}),e.jsx("dd",{title:t.value,children:t.value})]},t.label))}),e.jsxs("div",{className:"s-focus-activity-empty-actions",children:[e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn",onClick:a,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"}),e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn s-focus-activity-empty-btn--primary",onClick:l,...v({label:`Compose message · ${s.handle??s.name}`}),children:"Send a message"})]})]})}function b({label:s,value:a}){return e.jsxs("div",{className:"s-focus-stat",children:[e.jsx("dt",{className:"s-focus-stat-label",children:s}),e.jsx("dd",{className:"s-focus-stat-value",children:a})]})}function O({agent:s,onSend:a,onOpenConversation:l}){const[o,r]=f.useState(""),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[u,i]=f.useState(null),n=f.useRef(null);f.useEffect(()=>{n.current?.focus()},[]);const c=async()=>{const y=o.trim();if(!(!y||d)){p(!0),i(null);try{await a(y),r(""),m(!0),setTimeout(()=>m(!1),1800)}catch(x){i(x instanceof Error?x.message:String(x))}finally{p(!1)}}},t=s.handle??s.name;return e.jsx("div",{className:"s-focus-tab",children:e.jsx("div",{className:"s-focus-compose",children:e.jsx(M,{density:"panel",value:o,onChange:r,onSend:()=>{c()},sending:d,placeholder:`Message @${t}…`,textareaRef:n,rows:4,"aria-label":`Message @${t}`,header:e.jsxs("div",{className:"s-focus-compose-label",children:["Message ",e.jsxs("span",{className:"s-focus-compose-target",children:["@",t]})]}),tools:e.jsx("div",{className:"s-focus-compose-hint",children:u?e.jsxs("span",{className:"s-focus-compose-error",children:["Send failed: ",u]}):h?e.jsxs("span",{className:"s-focus-compose-ok",children:["Sent ↗"," ",e.jsx("button",{type:"button",className:"s-focus-compose-link",onClick:l,children:"Open Chat"})]}):e.jsx("span",{children:"Send starts a Run, or steers the active Run when this agent is already working."})})})})})}export{g as FocusOverlay};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-EsrkGBcv.js";import{c as j}from"./agent-state-DDhnFEEP.js";import{s as x}from"./page-status-BswZLqvA.js";import{t as l}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-BjmWK420.js";import"./colors-CFlbwC25.js";import"./AgentAvatar-CrP1eXxk.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"./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"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";function jt({agent:t,state:r,isExpanded:e,isSelected:p,tabIndex:s,onToggle:a,onReveal:n,onOpen:c}){const m=x({label:`Focus ${t.handle??t.name}`,route:`/ops/control · ${t.id}`}),d=o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"rr-spec-list",children:[o.jsx(i,{label:"MODEL",value:[t.harness,t.model].filter(Boolean).join("/")||"—"}),o.jsx(i,{label:"AT",value:[t.project,t.branch].filter(Boolean).join("/")||"—"}),o.jsx(i,{label:"STATE",value:j(r)}),o.jsx(i,{label:"ACTIVITY",value:t.activity}),o.jsx(i,{label:"SOURCE",value:t.source})]}),o.jsxs("div",{className:"ml-detail-actions",children:[o.jsx("button",{type:"button",className:"ml-detail-btn",onClick:n,children:"Reveal on wall"}),o.jsx("button",{type:"button",className:"ml-detail-btn ml-detail-btn--primary",onClick:c,children:"Open ↗"})]})]});return o.jsx(b,{name:t.handle??t.name,meta:t.lastActiveAt?l(t.lastActiveAt):t.updatedAt?l(t.updatedAt):void 0,tone:r,caret:e?"open":"closed",selected:p,expanded:e,detail:d,tabIndex:s,onClick:u=>a(u),onPointerEnter:m.onPointerEnter,onPointerLeave:m.onPointerLeave})}function i({label:t,value:r}){return o.jsxs("div",{className:"rr-spec",children:[o.jsx("dt",{className:"rr-spec-label",children:t}),o.jsx("dd",{className:"rr-spec-value",title:r,children:r})]})}export{jt as MissionLeftAgentRow};
@@ -1 +1 @@
1
- import{r as a,j as l}from"./index-C8uS5szO.js";import{H as k}from"./HarnessMark-Bt47OeHy.js";import{n as y}from"./agent-state-DDhnFEEP.js";import{s as P}from"./page-status-CkS3SZu-.js";import{c as T,b as I,T as C,d as H}from"./tail-display-DHSNmvor.js";import{d as A}from"./time-Dhsh_2EG.js";import{s as E}from"./mission-control-model-C30vU1Fe.js";import{m as R,a as K}from"./mission-wall-DOuGOxQy.js";import"./lane-edit-display-BjdT9oZl.js";import"./colors-CFlbwC25.js";const _=24;function U({log:s,selected:f,revealed:h,cursor:i=!1,onOpen:c,onToggleSelected:w,onOpenLog:v,paneRef:j}){const o=a.useRef(null),m=a.useRef(!0),r=a.useMemo(()=>T(s.lines.map(e=>({event:e,meta:void 0}))).map(e=>({...e,outcome:e.event.kind==="tool-result"?I(e.event).result?.outcome??null:null})),[s.lines]),x=a.useCallback(()=>{const e=o.current;if(!e)return;const n=e.scrollHeight-e.scrollTop-e.clientHeight;m.current=n<=_},[]);a.useEffect(()=>{const e=o.current;!e||!m.current||(e.scrollTop=e.scrollHeight)},[r.length,s.lastActiveAt]);const N=y(s.agent?.state??null),t=R(s),b=K(s),p=[s.project,s.agent?.branch].filter(Boolean).join("/")||s.cwd||"—",d=a.useMemo(()=>P({label:`Tail · ${t}`,route:`/ops/tail?q=${encodeURIComponent(s.sessionId)}`}),[s.sessionId,t]),L=e=>{if(e.metaKey||e.ctrlKey||e.shiftKey){w();return}c()};return l.jsxs("div",{ref:j,className:["s-wall-pane",s.live?"s-wall-pane--live":null,f?"s-wall-pane--selected":null,h?"s-wall-pane--revealed":null,i?"s-wall-pane--cursor":null].filter(Boolean).join(" "),"data-cursor":i?!0:void 0,tabIndex:i?0:-1,onClick:L,children:[l.jsxs("div",{className:"s-wall-pane-head",children:[l.jsx("span",{className:"s-wall-pane-dot",style:{background:s.agent?E(N):"var(--dim)"},"aria-hidden":!0}),l.jsx(k,{harness:s.source,size:11,title:null}),l.jsx("button",{type:"button",className:"s-wall-pane-title",title:s.agent?.name??s.sessionId,"aria-label":`Focus ${t}`,onClick:e=>{e.stopPropagation(),c()},children:t}),l.jsx("span",{className:"s-wall-pane-where",title:s.cwd??p,children:p}),l.jsx("span",{className:"s-wall-pane-spacer"}),s.live&&l.jsx("span",{className:"s-wall-pane-live",children:"live"}),l.jsx("button",{type:"button",className:"s-wall-pane-file",title:s.logPath??`session ${s.sessionId}`,"aria-label":"Open raw tail",onClick:e=>{e.stopPropagation(),v()},onPointerEnter:d.onPointerEnter,onPointerLeave:d.onPointerLeave,children:b})]}),l.jsx("div",{className:"s-wall-pane-body",ref:o,onScroll:x,children:r.length===0?l.jsx("div",{className:"s-wall-pane-idle",children:"no output since page load"}):r.map(({event:e,repeatCount:n,outcome:u})=>l.jsxs("div",{className:["s-wall-line",`s-wall-line--${e.kind}`,u==="success"?"s-wall-line--result-ok":null,u==="error"?"s-wall-line--result-error":null].filter(Boolean).join(" "),children:[l.jsx("span",{className:"s-wall-line-time",children:A(e.ts,{milliseconds:!1})||"—"}),l.jsx("span",{className:"s-wall-line-glyph",title:H[e.kind],children:C[e.kind]}),l.jsxs("span",{className:"s-wall-line-text",children:[e.summary,n>1&&l.jsxs("span",{className:"s-wall-line-repeat",title:`${n} identical events`,children:[" ","×",n]})]})]},e.id))})]})}export{U as MissionLogPane};
1
+ import{r as a,j as l}from"./index-EsrkGBcv.js";import{H as k}from"./HarnessMark-C4naWc16.js";import{n as y}from"./agent-state-DDhnFEEP.js";import{s as P}from"./page-status-BswZLqvA.js";import{c as T,b as I,T as C,d as H}from"./tail-display-DHSNmvor.js";import{d as A}from"./time-Dhsh_2EG.js";import{s as E}from"./mission-control-model-BpJHDV5D.js";import{m as R,a as K}from"./mission-wall-CAo4BKfa.js";import"./lane-edit-display-BjdT9oZl.js";import"./colors-CFlbwC25.js";const _=24;function U({log:s,selected:f,revealed:h,cursor:i=!1,onOpen:c,onToggleSelected:w,onOpenLog:v,paneRef:j}){const o=a.useRef(null),m=a.useRef(!0),r=a.useMemo(()=>T(s.lines.map(e=>({event:e,meta:void 0}))).map(e=>({...e,outcome:e.event.kind==="tool-result"?I(e.event).result?.outcome??null:null})),[s.lines]),x=a.useCallback(()=>{const e=o.current;if(!e)return;const n=e.scrollHeight-e.scrollTop-e.clientHeight;m.current=n<=_},[]);a.useEffect(()=>{const e=o.current;!e||!m.current||(e.scrollTop=e.scrollHeight)},[r.length,s.lastActiveAt]);const N=y(s.agent?.state??null),t=R(s),b=K(s),p=[s.project,s.agent?.branch].filter(Boolean).join("/")||s.cwd||"—",d=a.useMemo(()=>P({label:`Tail · ${t}`,route:`/ops/tail?q=${encodeURIComponent(s.sessionId)}`}),[s.sessionId,t]),L=e=>{if(e.metaKey||e.ctrlKey||e.shiftKey){w();return}c()};return l.jsxs("div",{ref:j,className:["s-wall-pane",s.live?"s-wall-pane--live":null,f?"s-wall-pane--selected":null,h?"s-wall-pane--revealed":null,i?"s-wall-pane--cursor":null].filter(Boolean).join(" "),"data-cursor":i?!0:void 0,tabIndex:i?0:-1,onClick:L,children:[l.jsxs("div",{className:"s-wall-pane-head",children:[l.jsx("span",{className:"s-wall-pane-dot",style:{background:s.agent?E(N):"var(--dim)"},"aria-hidden":!0}),l.jsx(k,{harness:s.source,size:11,title:null}),l.jsx("button",{type:"button",className:"s-wall-pane-title",title:s.agent?.name??s.sessionId,"aria-label":`Focus ${t}`,onClick:e=>{e.stopPropagation(),c()},children:t}),l.jsx("span",{className:"s-wall-pane-where",title:s.cwd??p,children:p}),l.jsx("span",{className:"s-wall-pane-spacer"}),s.live&&l.jsx("span",{className:"s-wall-pane-live",children:"live"}),l.jsx("button",{type:"button",className:"s-wall-pane-file",title:s.logPath??`session ${s.sessionId}`,"aria-label":"Open raw tail",onClick:e=>{e.stopPropagation(),v()},onPointerEnter:d.onPointerEnter,onPointerLeave:d.onPointerLeave,children:b})]}),l.jsx("div",{className:"s-wall-pane-body",ref:o,onScroll:x,children:r.length===0?l.jsx("div",{className:"s-wall-pane-idle",children:"no output since page load"}):r.map(({event:e,repeatCount:n,outcome:u})=>l.jsxs("div",{className:["s-wall-line",`s-wall-line--${e.kind}`,u==="success"?"s-wall-line--result-ok":null,u==="error"?"s-wall-line--result-error":null].filter(Boolean).join(" "),children:[l.jsx("span",{className:"s-wall-line-time",children:A(e.ts,{milliseconds:!1})||"—"}),l.jsx("span",{className:"s-wall-line-glyph",title:H[e.kind],children:C[e.kind]}),l.jsxs("span",{className:"s-wall-line-text",children:[e.summary,n>1&&l.jsxs("span",{className:"s-wall-line-repeat",title:`${n} identical events`,children:[" ","×",n]})]})]},e.id))})]})}export{U as MissionLogPane};
@@ -0,0 +1 @@
1
+ import{j as i}from"./index-EsrkGBcv.js";import{n as p}from"./embed-navigation-DayfkQau.js";import{a as m}from"./provider-Dojd8quC.js";import{OpsScreen as e}from"./OpsScreen-jVcaBKGi.js";import{u as s}from"./Provider-C35yu29I.js";import{d as a}from"./types-B0PlfpKc.js";import"./scoutbot-Bk3nyrkj.js";import"./router-DCtl8wqb.js";import"./api-DSqpVKC7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";/* empty css *//* empty css */import"./page-status-BswZLqvA.js";import"./AgentLanesView-BJi9xXz6.js";/* empty css */import"./tail-events-d0yAYxR0.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./observe-BJqERJVj.js";import"./agent-state-DDhnFEEP.js";import"./useEmbedHeadline-D6pJRxUg.js";import"./AgentAvatar-CrP1eXxk.js";import"./SpriteAvatar-CpZWf54-.js";import"./CrewAvatar-kTznzqcO.js";import"./HarnessMark-C4naWc16.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"./colors-CFlbwC25.js";import"./SessionObserve-DXxBvejJ.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./lane-tool-detail-Czggx8oM.js";import"./LaneToolHoverCard-CJa110yk.js";import"./index-724SdE6r.js";import"./lane-observe-CteDwdD-.js";import"./time-Dhsh_2EG.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"./NewChatComposer-C97-iTMK.js";import"./media-blobs-Bi8pxr1u.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"./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"./chevron-up-CETZJzjV.js";import"./AgentFloorView-DH4jiDgw.js";import"./AgentAdventures-BAgxdOF8.js";import"./ReplayClock-348f17bW.js";import"./SproutActionSprite-BSiTS4en.js";/* empty css */import"./CrewSprite-Dhryjx2c.js";import"./agent-lanes-model-DMAdqCmK.js";import"./context-budget-8qFKqM-j.js";import"./adventure-playback-DTfkhIc0.js";import"./AdventureScenery-LPXSVP67.js";import"./adventure-habitats-v1-M1lcpTJh.js";import"./AdventureReader-X-hbTOi0.js";import"./index-CHD0qcfL.js";import"./TextDocumentSurface-D52m7Vd8.js";import"./chevron-right-DrfqcerI.js";import"./folder-D5prSkzz.js";import"./floor-preview-text-HrORUJ7D.js";/* empty css */import"./book-open-CV98WMSp.js";import"./scroll-text-DNjxhyO2.js";import"./ReplayLog-CBnAM3ui.js";import"./AdventureEvidence-CyegKk1V.js";import"./agent-lane-detail-Ti3trpfH.js";/* empty css */import"./arrow-up-right-BPedAgxO.js";/* empty css */import"./flag-C4wl8z2-.js";import"./pause-C2XTlkjs.js";import"./play-FT6K3It1.js";import"./radio-DRoOZsws.js";import"./arrow-left-MVUKauwQ.js";import"./arrow-right-Bp-FpE5V.js";import"./SharedWorkFloor-D9mf9KSg.js";import"./WorldMinimap-B6HNgcDe.js";import"./WorldSky-Jm2Z6dfW.js";import"./WorldActorTalk-BvSg_b1y.js";import"./send-to-agent-session-DoKCDBJ4.js";import"./FloorExchangePanel-BU1pPu8K.js";import"./floor-character-name-CqJPOlXb.js";import"./floor-message-passes-CO3Ix_wR.js";import"./shared-work-artifacts-DfNl9KTo.js";import"./floor-memory-YMM8AlLY.js";import"./CharacterFamilyPreview-DMfw7UM_.js";import"./RenderedWorkerSprite-Dhlyg89J.js";import"./FloorMessagePasses-cLW2UGNP.js";import"./WorkRunView-BDkR7Edq.js";import"./floor-context-model-rWKqaKmV.js";import"./agent-floor-actor-DW8zLht0.js";import"./SharedFloorCharacter-DNEiaOUh.js";import"./WorldCharacter-CIIlutQq.js";import"./RiggedWorkerCharacter-q6QRc7_o.js";import"./file-code-corner-CsU7jJpu.js";import"./FloorReplay-VFzA6Kxc.js";import"./AgentFloorWorld-CjoIa6jA.js";/* empty css */import"./agent-floor-world-layout-hfMjuoui.js";import"./coffee-D7EAOdCk.js";import"./git-branch-B0_fPLO7.js";/* empty css */import"./FloorTacticalHUD-CO-iiFpb.js";import"./FloorSavedWork-BeHDejWz.js";import"./pin-C2mFOV1l.js";/* empty css */import"./triangle-alert-CHoRGdVO.js";import"./FloorResourcesSheet-C-kQ6Ren.js";/* empty css */import"./theme-vars-DNK0nn3k.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-BCPRocpq.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DJr0v0D_.js";import"./code-xml-BhcNbLWU.js";import"./voice-turn-ledger-BMZxlSjg.js";import"./chunk-HRAB3GC3-DbVLgbWX.js";/* empty css */import"./FloorContextSheet-2_NVPQor.js";import"./lane-roster-store-D-RSWjb-.js";import"./session-recap-lanes-D-eVJnpY.js";import"./message-square-BxesYglW.js";import"./AgentLanesPreflight-Ry-aqDTr.js";import"./AgentLaneChrome-TF1SlJSc.js";import"./AgentLaneCard-BaZ2g-f8.js";/* empty css */import"./AgentLaneSummaryResize-dpp7YvrX.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-CeqQGp-8.js";import"./agent-lane-preview-Dpa3DuOn.js";import"./AgentLaneDetailSheet-EzEPsn3g.js";import"./SlidePanel-_CHAQdOa.js";import"./LaneTraceDetailSheet-DYrd0BIf.js";import"./LaneTraceEventFocus-TbrNHRj_.js";import"./MissionControlView-B9cNPXvl.js";/* empty css */import"./mission-control-store-elEEsIvb.js";import"./MissionContextRail-D62-Wis8.js";import"./mission-wall-CAo4BKfa.js";import"./mission-control-model-BpJHDV5D.js";import"./MissionFocusOverlay-C1zys3Jv.js";import"./MissionLogPane-B19lYSY9.js";import"./OpsAgentsView-DajlX8LO.js";/* empty css */import"./DataTable-aH-jCyDq.js";/* empty css */import"./useAgentHoverCard-BANmpjMh.js";import"./sliders-horizontal-782VC_yy.js";import"./HostAdvisorView-CnM1i8hW.js";/* empty css */import"./compass-63TUaz5_.js";import"./layout-grid-Cor2frzj.js";import"./refresh-cw-BmVr7sCD.js";import"./cpu-BOTa_WLr.js";import"./gauge-D9_5iJEm.js";import"./AtopView-gkEp4y__.js";/* empty css */import"./TailView-CYSijNTy.js";import"./useContentSecondaryNav-C6OBu-3_.js";import"./OpsSubnav-BOOYShHE.js";import"./SecondaryNav-D7dbV2qo.js";import"./secondaryNavConfig-CS1svh6n.js";import"./nav-destinations-uorRqFxf.js";import"./settings-BVh7kldq.js";import"./FleetRollCallHud-C5q2567n.js";import"./session-recap-queue-41l2XVkI.js";/* empty css */function Tr({navigate:t}){const{route:o}=s(),r=m("ops.control",!0);return i.jsx(e,{navigate:t,mode:(o.view==="ops"?o.mode:void 0)??(r?"mission":"tail"),tailQuery:o.view==="ops"?o.tailQuery:void 0,showSecondaryNav:!0})}const Ur=a({id:"ops",label:"Ops",route:{view:"ops"},webPath:"/ops",screen:"NativeAreaScreen",embed:{path:"/embed/ops",profile:"macos.ops",ownsInternalRoutes:!0,isInternalRoute:p,hosts:{macos:!0}}});export{Tr as NativeAreaScreen,Ur as scoutSurface};
@@ -0,0 +1 @@
1
+ import{j as r}from"./index-EsrkGBcv.js";import{K as m}from"./KnowledgeSearchInspector-32n9baT-.js";import{SearchContent as e}from"./content-x1PHxED7.js";import{u as p}from"./Provider-C35yu29I.js";import{d as s}from"./types-B0PlfpKc.js";/* empty css */import"./api-DSqpVKC7.js";import"./router-DCtl8wqb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./createLucideIcon-zZ8Hx7er.js";import"./x-DAehov0E.js";import"./check-lrJ3a73a.js";import"./copy-xKeM5ZtU.js";import"./external-link-CUObqmgX.js";import"./loader-circle-OvccU82H.js";import"./KnowledgeSearchScreen-Dd6jrQ0A.js";import"./time-Dhsh_2EG.js";import"./search-DT42oyRW.js";import"./sparkles-BjHq_DNK.js";import"./chevron-down-l1mrh5S9.js";import"./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";function nr({navigate:t}){const{route:o,selectedKnowledgeHit:i}=p();return r.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,minWidth:0},children:[r.jsx("div",{style:{flex:1,minWidth:0,overflow:"auto"},children:r.jsx(e,{navigate:t,route:o.view==="search"?o:{view:"search"}})}),i?r.jsx("aside",{"aria-label":"Search result",style:{width:"38%",minWidth:260,overflow:"auto"},children:r.jsx(m,{navigate:t})}):null]})}const lr=s({id:"search",label:"Search",route:{view:"search"},webPath:"/search",screen:"NativeAreaScreen",embed:{path:"/embed/search",profile:"macos.search",ownsInternalRoutes:!0,hosts:{macos:!0}}});export{nr as NativeAreaScreen,lr as scoutSurface};
@@ -0,0 +1 @@
1
+ import{j as r}from"./index-EsrkGBcv.js";import{HomeContent as t}from"./content-BNZOZEpX.js";import{d as m}from"./types-B0PlfpKc.js";import"./HomeHero-DouPyNmz.js";import"./refresh-cw-BmVr7sCD.js";import"./createLucideIcon-zZ8Hx7er.js";import"./activity-CIlFrfPJ.js";import"./TailView-CYSijNTy.js";import"./SlidePanel-_CHAQdOa.js";import"./HarnessMark-C4naWc16.js";import"./api-DSqpVKC7.js";import"./time-Dhsh_2EG.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./tail-events-d0yAYxR0.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./Provider-C35yu29I.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"./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"./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"./observe-BJqERJVj.js";import"./persistent-state-KRk_yb0q.js";import"./operator-attention-DBaRg5ep.js";import"./agent-lanes-model-DMAdqCmK.js";import"./lane-ask-display-BTVSakyo.js";import"./context-budget-8qFKqM-j.js";import"./lane-observe-CteDwdD-.js";import"./home-moving-signal-rpMhsOJB.js";import"./home-live-action-BkqGLVRY.js";import"./cpu-BOTa_WLr.js";import"./git-branch-B0_fPLO7.js";import"./file-code-corner-CsU7jJpu.js";import"./terminal-hQKQygcf.js";import"./external-link-CUObqmgX.js";function Ao({navigate:o}){return r.jsx(t,{navigate:o})}const Ho=m({id:"home",label:"Home",route:{view:"inbox"},webPath:"/",screen:"NativeAreaScreen",embed:{path:"/embed/home",profile:"macos.home",ownsInternalRoutes:!0,hosts:{macos:!0}}});export{Ao as NativeAreaScreen,Ho as scoutSurface};
@@ -1 +1 @@
1
- import{r,j as e}from"./index-C8uS5szO.js";import{r as se}from"./index-C5cX8dkl.js";import{a as U}from"./api-CaROe5_H.js";import{u as ne}from"./keyboard-nav-CXfav14z.js";import{o as te}from"./openContent-C6XO6kr5.js";import{s as A,w as le}from"./project-overview-helpers-BQTc_Ous.js";import{X as ie}from"./x-DI1ktCYb.js";import{R as re}from"./rocket-DyrYDo8V.js";import"./createLucideIcon-DkjnzvcJ.js";const V=[{value:"codex",label:"Codex",runtimeId:"codex"},{value:"claude",label:"Claude",runtimeId:"claude"},{value:"pi",label:"Grok",runtimeId:"pi"}];function w(t){return t.trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function oe(t){const n=new Set;for(const o of t){if(!o)continue;const s=w(o);s&&n.add(s)}return n}function ce(t,n,o){const s=t.trim();if(!s)return{status:"auto",normalized:void 0,rewritten:!1,message:o==="sticky"?"Scout will assign a reusable handle from the name pool.":"Scout will assign a disposable handle from the name pool.",tone:"ok"};const l=w(s);return l?n.has(l)?{status:"conflict",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:`@${l} already exists here. Pick another handle or leave it blank for auto.`,tone:"warn"}:{status:"ok",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:null,tone:"ok"}:{status:"invalid",normalized:void 0,rewritten:!1,message:"Use letters, numbers, dot, or dash.",tone:"warn"}}function S(t){return t==="pi"?"grok":t}function de(t,n,o,s=3){const l=w(t)??"agent",m=[l,`${l}-${S(n)}`,`${l}-dev`,`${l}-2`,`${l}-${S(n)}-2`],u=[];for(const v of m){const x=w(v);if(!(!x||o.has(x)||u.includes(x))&&(u.push(x),u.length>=s))break}return u}function ue(t){const{handle:n,persistence:o,harness:s,projectRootLabel:l}=t,m="A card starts a fresh session for each request. Use session:<id> only to continue an exact run.";return o==="one_time"?{disposable:!0,card:null,cli:`scout ask --project ${l} --harness ${s} "…"`,resolves:"Disposable session — Scout assigns a provisional handle that may be recycled. Not addressable later.",note:m}:n?{disposable:!1,card:`@${n}`,cli:`scout ask @${n} "…"`,resolves:`Reusable ${S(s)} session on this project — @${n} routes here from any surface.`,note:m}:{disposable:!1,card:"@auto",cli:'scout ask @<assigned-handle> "…"',resolves:`Scout assigns a reusable ${S(s)} handle from the name pool.`,note:m}}const me={ready:"ready",configured:"configured",installed:"login needed",missing:"not found"},q={ready:"ok",configured:"ok",installed:"warn",missing:"off"};function ke({open:t,onClose:n,projectTitle:o,projectRoot:s,primaryWt:l,worktreeCount:m,branches:u,existingAgents:v,agentCount:x,sessionCount:H,route:D,navigate:C}){const{ref:J,onKeyDown:W}=ne(t),[h,G]=r.useState("codex"),[M,X]=r.useState(""),[d,E]=r.useState("sticky"),[$,P]=r.useState(""),[R,Q]=r.useState(""),[L,I]=r.useState("idle"),[_,j]=r.useState(null),[K,Y]=r.useState(null);r.useEffect(()=>{t&&(j(null),I("idle"))},[t]),r.useEffect(()=>{if(!t)return;let a=!1;return(async()=>{const c=await U("/api/agent-config/snapshot").catch(()=>null);if(a||!c)return;const f=new Map;for(const g of c.runtimes)f.set(g.id,{state:g.state,detail:g.detail,loginCommand:g.loginCommand});Y(f)})(),()=>{a=!0}},[t]),r.useEffect(()=>{if(!t)return;const a=c=>{c.key==="Escape"&&(c.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,n]);const k=r.useMemo(()=>oe(v.flatMap(a=>[a.name,a.handle])),[v]),i=r.useMemo(()=>ce($,k,d),[$,k,d]),z=r.useMemo(()=>de(o,h,k,3),[o,h,k]),T=s?A(s):"<no-root>",p=r.useMemo(()=>ue({handle:i.normalized,persistence:d,harness:h,projectRootLabel:T}),[i.normalized,d,h,T]),N=K?.get(V.find(a=>a.value===h)?.runtimeId??h);if(!t)return null;const Z=!!s&&L!=="starting"&&i.status!=="invalid"&&i.status!=="conflict",ee=L==="starting"?"Starting…":d==="one_time"?"Dispatch one-off":i.status==="conflict"?"Handle exists":i.normalized?`Create @${i.normalized}`:"Create with auto handle",O=async()=>{if(!(!s||L==="starting")){I("starting"),j(null);try{const a=M.trim(),c=R.trim(),f=i.normalized,g=await U("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:s},execution:{session:"new",harness:h,...a?{model:a}:{}},agent:{persistence:d,...f?{handle:f}:{}},...c?{seed:{instructions:c}}:{}})}),B=g.agentId?.trim(),F=g.sessionId?.trim(),y=g.conversationId?.trim();if(F){n(),te(C,{view:"sessions",sessionId:F},{returnTo:D});return}if(B){n(),C({...D,view:"agents-v2",agentId:B,selectedAgentId:void 0,sessionId:void 0,...y?{conversationId:y,tab:"message"}:{tab:"profile"}});return}if(y){n(),C({view:"conversation",conversationId:y});return}j("Agent start was accepted, but no target came back.")}catch(a){j(a instanceof Error?a.message:"Could not start an agent.")}finally{I("idle")}}},ae=a=>{if((a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault(),O();return}W(a)},b=[];return b.push({label:"root",value:s?A(s):"no project root",title:s??void 0}),l?b.push({label:"branch",value:le(l),title:l.path}):u.length>0&&b.push({label:"branch",value:u.length===1?u[0]:`${u.length} branches`}),m>1&&b.push({label:"worktrees",value:String(m)}),b.push({label:"existing",value:`${x} agent${x===1?"":"s"} · ${H} session${H===1?"":"s"}`}),se.createPortal(e.jsx("div",{className:"na-backdrop",role:"presentation",onClick:n,children:e.jsxs("div",{ref:J,className:"na-panel",role:"dialog","aria-modal":"true","aria-labelledby":"na-title",tabIndex:-1,onClick:a=>a.stopPropagation(),onKeyDown:ae,children:[e.jsxs("header",{className:"na-head",children:[e.jsxs("div",{className:"na-headIdent",children:[e.jsx("h2",{id:"na-title",className:"na-title",children:"New agent"}),e.jsxs("span",{className:"na-scope",children:["/",o]})]}),e.jsx("button",{type:"button",className:"na-close",onClick:n,"aria-label":"Close (Esc)",children:e.jsx(ie,{size:14,strokeWidth:2,"aria-hidden":!0})})]}),e.jsx("div",{className:"na-context",children:b.map(a=>e.jsxs("span",{className:"na-contextChip",title:a.title,children:[e.jsx("span",{className:"na-contextLabel",children:a.label}),e.jsx("span",{className:"na-contextValue",children:a.value})]},a.label))}),e.jsxs("div",{className:"na-body",children:[e.jsxs("section",{className:"na-section na-modeSection",children:[e.jsx("span",{className:"na-sectionLabel",children:"What are you creating?"}),e.jsxs("div",{className:"na-modeChoice",role:"radiogroup","aria-label":"Agent kind",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="one_time",className:"na-modeCard","data-active":d==="one_time"||void 0,onClick:()=>E("one_time"),children:[e.jsx("span",{className:"na-modeTitle",children:"One-off run"}),e.jsx("span",{className:"na-modeSub",children:"Disposable session · not addressable later"})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="sticky",className:"na-modeCard","data-active":d==="sticky"||void 0,onClick:()=>E("sticky"),children:[e.jsx("span",{className:"na-modeTitle",children:"Named agent"}),e.jsx("span",{className:"na-modeSub",children:"Reusable card · addressable by handle"})]})]})]}),e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Runtime"}),e.jsx("div",{className:"na-harnessRow",role:"radiogroup","aria-label":"Harness",children:V.map(a=>{const c=K?.get(a.runtimeId),f=h===a.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":f,className:"na-harness","data-active":f||void 0,onClick:()=>G(a.value),children:[e.jsx("span",{className:"na-harnessName",children:a.label}),c?e.jsxs("span",{className:"na-harnessState","data-tone":q[c.state],children:[e.jsx("span",{className:"na-dot","aria-hidden":!0}),me[c.state]]}):e.jsx("span",{className:"na-harnessState","data-tone":"off",children:"…"})]},a.value)})}),N&&N.state!=="ready"?e.jsxs("p",{className:"na-readinessNote","data-tone":q[N.state],children:[N.detail,N.loginCommand?e.jsxs("code",{className:"na-code",children:[" ",N.loginCommand]}):null]}):null,e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Model / profile"}),e.jsx("input",{value:M,placeholder:"default",onChange:a=>X(a.currentTarget.value)})]})]}),d==="sticky"?e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Handle (optional)"}),e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Address"}),e.jsxs("div",{className:"na-handleWrap","data-tone":i.tone,children:[e.jsx("span",{className:"na-handleAt",children:"@"}),e.jsx("input",{value:$,placeholder:z[0]??"auto","aria-invalid":i.tone==="warn",autoFocus:!0,onChange:a=>P(a.currentTarget.value)})]})]}),z.length>0?e.jsxs("div",{className:"na-suggestRow",children:[e.jsx("span",{className:"na-suggestLabel",children:"suggest"}),z.map(a=>e.jsxs("button",{type:"button",className:"na-suggest",onClick:()=>P(a),children:["@",a]},a))]}):null,i.message?e.jsx("p",{className:"na-validation","data-tone":i.tone,children:i.message}):i.rewritten&&i.normalized?e.jsxs("p",{className:"na-validation","data-tone":"ok",children:["Saved as ",e.jsxs("code",{className:"na-code",children:["@",i.normalized]})]}):null]}):null,e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"First instruction"}),e.jsx("textarea",{className:"na-prompt",value:R,rows:3,placeholder:`Start in /${o}…`,onChange:a=>Q(a.currentTarget.value)})]}),e.jsxs("section",{className:"na-section na-routing",children:[e.jsx("span",{className:"na-sectionLabel",children:p.disposable?"Dispatch preview":"Routing preview"}),p.disposable?e.jsxs("div",{className:"na-routingBody","data-disposable":!0,children:[e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("button",{type:"button",className:"na-promote",onClick:()=>E("sticky"),children:"Name it to keep it →"})]}):e.jsxs("div",{className:"na-routingBody",children:[p.card?e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"address"}),e.jsx("code",{className:"na-routingValue na-routingCard",children:p.card})]}):null,e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"cli"}),e.jsx("code",{className:"na-routingValue",children:p.cli})]}),e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("p",{className:"na-routingNote",children:p.note})]})]})]}),_?e.jsx("div",{className:"na-error",children:_}):null,e.jsxs("footer",{className:"na-foot",children:[e.jsx("span",{className:"na-footRoot",title:s??void 0,children:s?A(s):"No project root — cannot create."}),e.jsxs("div",{className:"na-footActions",children:[e.jsx("button",{type:"button",className:"na-cancel",onClick:n,children:"Cancel"}),e.jsxs("button",{type:"button",className:"na-create",disabled:!Z,onClick:()=>{O()},children:[e.jsx(re,{size:12,strokeWidth:2,"aria-hidden":!0}),ee]})]})]})]})}),document.body)}export{ke as NewAgentModal};
1
+ import{r,j as e}from"./index-EsrkGBcv.js";import{r as se}from"./index-724SdE6r.js";import{a as U}from"./api-DSqpVKC7.js";import{u as ne}from"./keyboard-nav-DDHegDbx.js";import{o as te}from"./openContent-C6XO6kr5.js";import{s as A,w as le}from"./project-overview-helpers-BQTc_Ous.js";import{X as ie}from"./x-DAehov0E.js";import{R as re}from"./rocket-CGl4RTV7.js";import"./createLucideIcon-zZ8Hx7er.js";const V=[{value:"codex",label:"Codex",runtimeId:"codex"},{value:"claude",label:"Claude",runtimeId:"claude"},{value:"pi",label:"Grok",runtimeId:"pi"}];function w(t){return t.trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function oe(t){const n=new Set;for(const o of t){if(!o)continue;const s=w(o);s&&n.add(s)}return n}function ce(t,n,o){const s=t.trim();if(!s)return{status:"auto",normalized:void 0,rewritten:!1,message:o==="sticky"?"Scout will assign a reusable handle from the name pool.":"Scout will assign a disposable handle from the name pool.",tone:"ok"};const l=w(s);return l?n.has(l)?{status:"conflict",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:`@${l} already exists here. Pick another handle or leave it blank for auto.`,tone:"warn"}:{status:"ok",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:null,tone:"ok"}:{status:"invalid",normalized:void 0,rewritten:!1,message:"Use letters, numbers, dot, or dash.",tone:"warn"}}function S(t){return t==="pi"?"grok":t}function de(t,n,o,s=3){const l=w(t)??"agent",m=[l,`${l}-${S(n)}`,`${l}-dev`,`${l}-2`,`${l}-${S(n)}-2`],u=[];for(const v of m){const x=w(v);if(!(!x||o.has(x)||u.includes(x))&&(u.push(x),u.length>=s))break}return u}function ue(t){const{handle:n,persistence:o,harness:s,projectRootLabel:l}=t,m="A card starts a fresh session for each request. Use session:<id> only to continue an exact run.";return o==="one_time"?{disposable:!0,card:null,cli:`scout ask --project ${l} --harness ${s} "…"`,resolves:"Disposable session — Scout assigns a provisional handle that may be recycled. Not addressable later.",note:m}:n?{disposable:!1,card:`@${n}`,cli:`scout ask @${n} "…"`,resolves:`Reusable ${S(s)} session on this project — @${n} routes here from any surface.`,note:m}:{disposable:!1,card:"@auto",cli:'scout ask @<assigned-handle> "…"',resolves:`Scout assigns a reusable ${S(s)} handle from the name pool.`,note:m}}const me={ready:"ready",configured:"configured",installed:"login needed",missing:"not found"},q={ready:"ok",configured:"ok",installed:"warn",missing:"off"};function ke({open:t,onClose:n,projectTitle:o,projectRoot:s,primaryWt:l,worktreeCount:m,branches:u,existingAgents:v,agentCount:x,sessionCount:H,route:D,navigate:C}){const{ref:J,onKeyDown:W}=ne(t),[h,G]=r.useState("codex"),[M,X]=r.useState(""),[d,E]=r.useState("sticky"),[$,P]=r.useState(""),[R,Q]=r.useState(""),[L,I]=r.useState("idle"),[_,j]=r.useState(null),[K,Y]=r.useState(null);r.useEffect(()=>{t&&(j(null),I("idle"))},[t]),r.useEffect(()=>{if(!t)return;let a=!1;return(async()=>{const c=await U("/api/agent-config/snapshot").catch(()=>null);if(a||!c)return;const f=new Map;for(const g of c.runtimes)f.set(g.id,{state:g.state,detail:g.detail,loginCommand:g.loginCommand});Y(f)})(),()=>{a=!0}},[t]),r.useEffect(()=>{if(!t)return;const a=c=>{c.key==="Escape"&&(c.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,n]);const k=r.useMemo(()=>oe(v.flatMap(a=>[a.name,a.handle])),[v]),i=r.useMemo(()=>ce($,k,d),[$,k,d]),z=r.useMemo(()=>de(o,h,k,3),[o,h,k]),T=s?A(s):"<no-root>",p=r.useMemo(()=>ue({handle:i.normalized,persistence:d,harness:h,projectRootLabel:T}),[i.normalized,d,h,T]),N=K?.get(V.find(a=>a.value===h)?.runtimeId??h);if(!t)return null;const Z=!!s&&L!=="starting"&&i.status!=="invalid"&&i.status!=="conflict",ee=L==="starting"?"Starting…":d==="one_time"?"Dispatch one-off":i.status==="conflict"?"Handle exists":i.normalized?`Create @${i.normalized}`:"Create with auto handle",O=async()=>{if(!(!s||L==="starting")){I("starting"),j(null);try{const a=M.trim(),c=R.trim(),f=i.normalized,g=await U("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:s},execution:{session:"new",harness:h,...a?{model:a}:{}},agent:{persistence:d,...f?{handle:f}:{}},...c?{seed:{instructions:c}}:{}})}),B=g.agentId?.trim(),F=g.sessionId?.trim(),y=g.conversationId?.trim();if(F){n(),te(C,{view:"sessions",sessionId:F},{returnTo:D});return}if(B){n(),C({...D,view:"agents-v2",agentId:B,selectedAgentId:void 0,sessionId:void 0,...y?{conversationId:y,tab:"message"}:{tab:"profile"}});return}if(y){n(),C({view:"conversation",conversationId:y});return}j("Agent start was accepted, but no target came back.")}catch(a){j(a instanceof Error?a.message:"Could not start an agent.")}finally{I("idle")}}},ae=a=>{if((a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault(),O();return}W(a)},b=[];return b.push({label:"root",value:s?A(s):"no project root",title:s??void 0}),l?b.push({label:"branch",value:le(l),title:l.path}):u.length>0&&b.push({label:"branch",value:u.length===1?u[0]:`${u.length} branches`}),m>1&&b.push({label:"worktrees",value:String(m)}),b.push({label:"existing",value:`${x} agent${x===1?"":"s"} · ${H} session${H===1?"":"s"}`}),se.createPortal(e.jsx("div",{className:"na-backdrop",role:"presentation",onClick:n,children:e.jsxs("div",{ref:J,className:"na-panel",role:"dialog","aria-modal":"true","aria-labelledby":"na-title",tabIndex:-1,onClick:a=>a.stopPropagation(),onKeyDown:ae,children:[e.jsxs("header",{className:"na-head",children:[e.jsxs("div",{className:"na-headIdent",children:[e.jsx("h2",{id:"na-title",className:"na-title",children:"New agent"}),e.jsxs("span",{className:"na-scope",children:["/",o]})]}),e.jsx("button",{type:"button",className:"na-close",onClick:n,"aria-label":"Close (Esc)",children:e.jsx(ie,{size:14,strokeWidth:2,"aria-hidden":!0})})]}),e.jsx("div",{className:"na-context",children:b.map(a=>e.jsxs("span",{className:"na-contextChip",title:a.title,children:[e.jsx("span",{className:"na-contextLabel",children:a.label}),e.jsx("span",{className:"na-contextValue",children:a.value})]},a.label))}),e.jsxs("div",{className:"na-body",children:[e.jsxs("section",{className:"na-section na-modeSection",children:[e.jsx("span",{className:"na-sectionLabel",children:"What are you creating?"}),e.jsxs("div",{className:"na-modeChoice",role:"radiogroup","aria-label":"Agent kind",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="one_time",className:"na-modeCard","data-active":d==="one_time"||void 0,onClick:()=>E("one_time"),children:[e.jsx("span",{className:"na-modeTitle",children:"One-off run"}),e.jsx("span",{className:"na-modeSub",children:"Disposable session · not addressable later"})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="sticky",className:"na-modeCard","data-active":d==="sticky"||void 0,onClick:()=>E("sticky"),children:[e.jsx("span",{className:"na-modeTitle",children:"Named agent"}),e.jsx("span",{className:"na-modeSub",children:"Reusable card · addressable by handle"})]})]})]}),e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Runtime"}),e.jsx("div",{className:"na-harnessRow",role:"radiogroup","aria-label":"Harness",children:V.map(a=>{const c=K?.get(a.runtimeId),f=h===a.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":f,className:"na-harness","data-active":f||void 0,onClick:()=>G(a.value),children:[e.jsx("span",{className:"na-harnessName",children:a.label}),c?e.jsxs("span",{className:"na-harnessState","data-tone":q[c.state],children:[e.jsx("span",{className:"na-dot","aria-hidden":!0}),me[c.state]]}):e.jsx("span",{className:"na-harnessState","data-tone":"off",children:"…"})]},a.value)})}),N&&N.state!=="ready"?e.jsxs("p",{className:"na-readinessNote","data-tone":q[N.state],children:[N.detail,N.loginCommand?e.jsxs("code",{className:"na-code",children:[" ",N.loginCommand]}):null]}):null,e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Model / profile"}),e.jsx("input",{value:M,placeholder:"default",onChange:a=>X(a.currentTarget.value)})]})]}),d==="sticky"?e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Handle (optional)"}),e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Address"}),e.jsxs("div",{className:"na-handleWrap","data-tone":i.tone,children:[e.jsx("span",{className:"na-handleAt",children:"@"}),e.jsx("input",{value:$,placeholder:z[0]??"auto","aria-invalid":i.tone==="warn",autoFocus:!0,onChange:a=>P(a.currentTarget.value)})]})]}),z.length>0?e.jsxs("div",{className:"na-suggestRow",children:[e.jsx("span",{className:"na-suggestLabel",children:"suggest"}),z.map(a=>e.jsxs("button",{type:"button",className:"na-suggest",onClick:()=>P(a),children:["@",a]},a))]}):null,i.message?e.jsx("p",{className:"na-validation","data-tone":i.tone,children:i.message}):i.rewritten&&i.normalized?e.jsxs("p",{className:"na-validation","data-tone":"ok",children:["Saved as ",e.jsxs("code",{className:"na-code",children:["@",i.normalized]})]}):null]}):null,e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"First instruction"}),e.jsx("textarea",{className:"na-prompt",value:R,rows:3,placeholder:`Start in /${o}…`,onChange:a=>Q(a.currentTarget.value)})]}),e.jsxs("section",{className:"na-section na-routing",children:[e.jsx("span",{className:"na-sectionLabel",children:p.disposable?"Dispatch preview":"Routing preview"}),p.disposable?e.jsxs("div",{className:"na-routingBody","data-disposable":!0,children:[e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("button",{type:"button",className:"na-promote",onClick:()=>E("sticky"),children:"Name it to keep it →"})]}):e.jsxs("div",{className:"na-routingBody",children:[p.card?e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"address"}),e.jsx("code",{className:"na-routingValue na-routingCard",children:p.card})]}):null,e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"cli"}),e.jsx("code",{className:"na-routingValue",children:p.cli})]}),e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("p",{className:"na-routingNote",children:p.note})]})]})]}),_?e.jsx("div",{className:"na-error",children:_}):null,e.jsxs("footer",{className:"na-foot",children:[e.jsx("span",{className:"na-footRoot",title:s??void 0,children:s?A(s):"No project root — cannot create."}),e.jsxs("div",{className:"na-footActions",children:[e.jsx("button",{type:"button",className:"na-cancel",onClick:n,children:"Cancel"}),e.jsxs("button",{type:"button",className:"na-create",disabled:!Z,onClick:()=>{O()},children:[e.jsx(re,{size:12,strokeWidth:2,"aria-hidden":!0}),ee]})]})]})]})}),document.body)}export{ke as NewAgentModal};