@openscout/scout 0.2.102 → 0.2.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) 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 +285 -0
  6. package/dist/client/assets/ActivityScreen-CcDdQTBK.js +1 -0
  7. package/dist/client/assets/{AddProjectForm-DfbjlFfy.js → AddProjectForm-CHNJ4NnS.js} +1 -1
  8. package/dist/client/assets/{AdventureEvidence-Dzz9VbuE.js → AdventureEvidence-B4mEvXeD.js} +1 -1
  9. package/dist/client/assets/{AdventureReader-ClMxT0e4.js → AdventureReader-ZsBDQITY.js} +1 -1
  10. package/dist/client/assets/{AdventureScenery-D548O0x4.js → AdventureScenery-DSxDlqG1.js} +1 -1
  11. package/dist/client/assets/AgentAdventures-BxrYq_2v.js +1 -0
  12. package/dist/client/assets/{AgentAvatar-BIwg54Tj.js → AgentAvatar-NZOqcsB2.js} +1 -1
  13. package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +1 -0
  14. package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +1 -0
  15. package/dist/client/assets/{AgentDetailCard-CFDE8TLi.js → AgentDetailCard-MIEBKw_S.js} +1 -1
  16. package/dist/client/assets/AgentFloorView-A0dDRlRV.js +1 -0
  17. package/dist/client/assets/{AgentFloorWorld-BDJmXl3C.js → AgentFloorWorld-BTqwmK5G.js} +1 -1
  18. package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +1 -0
  19. package/dist/client/assets/{AgentLaneCard-C6YmwPxQ.js → AgentLaneCard-C4rKLLdT.js} +1 -1
  20. package/dist/client/assets/{AgentLaneChrome-D9uJ4QY7.js → AgentLaneChrome-fGC-ZrJS.js} +1 -1
  21. package/dist/client/assets/{AgentLaneDetailSheet-KYckCBCX.js → AgentLaneDetailSheet-BTF4_th9.js} +1 -1
  22. package/dist/client/assets/{AgentLaneSummaryResize-BBYBS3DO.js → AgentLaneSummaryResize-DgSeA_vS.js} +1 -1
  23. package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +1 -0
  24. package/dist/client/assets/{AgentLanesPreflight-pw2vMO3Q.js → AgentLanesPreflight-CcS23wij.js} +1 -1
  25. package/dist/client/assets/{AgentLanesView-aAyC7lHf.js → AgentLanesView-WZhEDBFE.js} +1 -1
  26. package/dist/client/assets/{AgentLiveActions-lYzicnNa.js → AgentLiveActions-6Kfr1uOT.js} +1 -1
  27. package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +1 -0
  28. package/dist/client/assets/{AgentSessions-Cox2zS-e.js → AgentSessions-CO1WGa8Z.js} +2 -2
  29. package/dist/client/assets/AgentsConsole-BQOWkj35.js +1 -0
  30. package/dist/client/assets/AgentsScreen-BMNAj1PH.js +1 -0
  31. package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +1 -0
  32. package/dist/client/assets/{AstronautSuit-C-4I5YKi.js → AstronautSuit-D67fIBdR.js} +1 -1
  33. package/dist/client/assets/{AtopView-DKm-ERYC.js → AtopView-Ck30FbzG.js} +1 -1
  34. package/dist/client/assets/{BackToPicker-Bys9ColC.js → BackToPicker-CkBhGRlD.js} +1 -1
  35. package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +1 -0
  36. package/dist/client/assets/{BriefingsScreen-D4Zf31Y6.js → BriefingsScreen-DTxYMr3a.js} +1 -1
  37. package/dist/client/assets/{BrokerMetadataPanel-1GoSl2BV.js → BrokerMetadataPanel-crirZCdo.js} +1 -1
  38. package/dist/client/assets/BrokerScreen-CT37VQiL.js +8 -0
  39. package/dist/client/assets/Canvas-CRP0KjKb.js +1 -0
  40. package/dist/client/assets/{CastPicker-BuwE_JQp.js → CastPicker-ZPomvOf-.js} +1 -1
  41. package/dist/client/assets/ChannelComposer-BVItWlEz.js +1 -0
  42. package/dist/client/assets/ChannelSidebar-B-2spawY.js +1 -0
  43. package/dist/client/assets/{CharacterFamilyPreview-CfO3j8Of.js → CharacterFamilyPreview-ckVkecDO.js} +1 -1
  44. package/dist/client/assets/ChatAvatar-DKBsbOqk.js +1 -0
  45. package/dist/client/assets/ChatBits-CLJ71hTY.js +1 -0
  46. package/dist/client/assets/{ChatCollapsedStrip-TV0j1xTB.js → ChatCollapsedStrip-Co0NmqOO.js} +1 -1
  47. package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +1 -0
  48. package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +1 -0
  49. package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +1 -0
  50. package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +1 -0
  51. package/dist/client/assets/{CodeDiffPane-DB6-mqtX.js → CodeDiffPane-D-iv28LJ.js} +1 -1
  52. package/dist/client/assets/{CodeProjectPicker-B_LNLpIK.js → CodeProjectPicker-CZ3gDdiT.js} +1 -1
  53. package/dist/client/assets/{CodeScreen-C9H160XS.js → CodeScreen-CSC-zbP9.js} +1 -1
  54. package/dist/client/assets/{CommsCanvas-DOKw3Q8i.js → CommsCanvas-DdNAwjGW.js} +1 -1
  55. package/dist/client/assets/{CommsDeck-C18JA7rK.js → CommsDeck-mGWY7Ivi.js} +1 -1
  56. package/dist/client/assets/{CommsFlowGraph-Czg-KTS0.js → CommsFlowGraph-voDD9M5R.js} +1 -1
  57. package/dist/client/assets/{CommsFlowMap-CzBWvSa5.js → CommsFlowMap-C33sgD48.js} +1 -1
  58. package/dist/client/assets/{CommsSelection-g1twA-Lb.js → CommsSelection-BL8aYD7z.js} +1 -1
  59. package/dist/client/assets/{ConversationComposer-B7RU6LKd.js → ConversationComposer-DNcn5U6D.js} +1 -1
  60. package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +1 -0
  61. package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +1 -0
  62. package/dist/client/assets/{ConversationPanels-C9yCAoJy.js → ConversationPanels-6pprBpmq.js} +2 -2
  63. package/dist/client/assets/ConversationScreen-tpj4cqWs.js +2 -0
  64. package/dist/client/assets/{ConversationStatus-CK-YfLpi.js → ConversationStatus-Cv-7hErW.js} +1 -1
  65. package/dist/client/assets/{CrewAvatar-CJhuqTsJ.js → CrewAvatar-zgzC3cbU.js} +1 -1
  66. package/dist/client/assets/{CrewSprite-hgpA3SWB.js → CrewSprite-Dp9KBBGY.js} +1 -1
  67. package/dist/client/assets/CrewWorkspaces-DDuYMByu.css +1 -0
  68. package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +1 -0
  69. package/dist/client/assets/{DataTable-BMOZ1-z8.js → DataTable-av71ehJV.js} +1 -1
  70. package/dist/client/assets/{DispatchAftermath-DDlwqSCY.js → DispatchAftermath-CcYGUB10.js} +1 -1
  71. package/dist/client/assets/{DocumentFocusViewer-f12RRQpV.js → DocumentFocusViewer-DlMiEALb.js} +1 -1
  72. package/dist/client/assets/{EmbeddableSurfacesLab-DGl9EMRV.js → EmbeddableSurfacesLab-CTkO_tQR.js} +1 -1
  73. package/dist/client/assets/{EmptyState-uyYN5piI.js → EmptyState-CYUwYyAW.js} +1 -1
  74. package/dist/client/assets/{FileViewerPane-HtiDbj9N.js → FileViewerPane-Cxhixtks.js} +1 -1
  75. package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +1 -0
  76. package/dist/client/assets/{FloorContextSheet-DV-SYA0K.js → FloorContextSheet-Vj_wVZq1.js} +1 -1
  77. package/dist/client/assets/{FloorExchangePanel-D59nvRCF.js → FloorExchangePanel-CjHSDXad.js} +1 -1
  78. package/dist/client/assets/{FloorMessagePasses-BCwsz9VS.js → FloorMessagePasses-BG4ebnX5.js} +1 -1
  79. package/dist/client/assets/{FloorReplay-BHo79HCD.js → FloorReplay-BoYaGY9t.js} +1 -1
  80. package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +1 -0
  81. package/dist/client/assets/{FloorSavedWork-2tjBoy06.js → FloorSavedWork-jbtRs-YE.js} +1 -1
  82. package/dist/client/assets/{FloorTacticalHUD-Bngao6sn.js → FloorTacticalHUD-BhyOqlL5.js} +1 -1
  83. package/dist/client/assets/{FollowScreen-eHXOlK-u.js → FollowScreen-CupyOgt4.js} +1 -1
  84. package/dist/client/assets/HarnessMark-DSvM_H7H.js +1 -0
  85. package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +1 -0
  86. package/dist/client/assets/{HerdrSession-CtJOUn7H.js → HerdrSession-Dcm3vf9U.js} +1 -1
  87. package/dist/client/assets/{HomeHero-Cvwx2H0w.js → HomeHero-pIZtE1cC.js} +1 -1
  88. package/dist/client/assets/{HostAdvisorView-CTJXIc1Q.js → HostAdvisorView-Dv5meXo2.js} +1 -1
  89. package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +1 -0
  90. package/dist/client/assets/InviteSheet--5Zjct25.js +1 -0
  91. package/dist/client/assets/JumpPalette-BmiSOEmp.js +1 -0
  92. package/dist/client/assets/{KnowledgeSearchInspector-DwGMVmFL.js → KnowledgeSearchInspector-B8yiM524.js} +1 -1
  93. package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +1 -0
  94. package/dist/client/assets/{LaneToolHoverCard-C6YehJqD.js → LaneToolHoverCard-D2cnTeUd.js} +1 -1
  95. package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +1 -0
  96. package/dist/client/assets/{LaneTraceEventFocus-WLNZZVi_.js → LaneTraceEventFocus-BLhVHwff.js} +1 -1
  97. package/dist/client/assets/{MeshCanvas-FDDGE69h.js → MeshCanvas-BR25OBTJ.js} +1 -1
  98. package/dist/client/assets/{MeshCanvasMinimap-CGRzQCac.js → MeshCanvasMinimap-ClVolr4-.js} +1 -1
  99. package/dist/client/assets/MeshScreen-BW1dMFWF.js +1 -0
  100. package/dist/client/assets/{MeshTopologyView-C2Cv_2gx.js → MeshTopologyView-BT3ke2D1.js} +2 -2
  101. package/dist/client/assets/MessagesScreen-CtNMfIvC.js +1 -0
  102. package/dist/client/assets/{MissionContextRail-CVSZJnvX.js → MissionContextRail-CafjuseK.js} +1 -1
  103. package/dist/client/assets/MissionControlView-BjPOViGY.js +1 -0
  104. package/dist/client/assets/{MissionFocusOverlay-B9SiuO-i.js → MissionFocusOverlay-nhy3hkxQ.js} +1 -1
  105. package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +1 -0
  106. package/dist/client/assets/{MissionLogPane-CMBiI29U.js → MissionLogPane-DiUf3vWW.js} +1 -1
  107. package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +1 -0
  108. package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +1 -0
  109. package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +1 -0
  110. package/dist/client/assets/{NewAgentModal-Cl4nsGhu.js → NewAgentModal-BQ2wQ5gp.js} +1 -1
  111. package/dist/client/assets/NewChatComposer-BEXS8vV6.js +19 -0
  112. package/dist/client/assets/{NewChatOrigin-CyPPWTJP.js → NewChatOrigin-C8ROO4ps.js} +1 -1
  113. package/dist/client/assets/{NodeDetailPanel-BUG8rOb-.js → NodeDetailPanel-BNTqYC7m.js} +1 -1
  114. package/dist/client/assets/{NodeMenu-Fw8ATWQA.js → NodeMenu-CcOeFRCB.js} +1 -1
  115. package/dist/client/assets/{ObserveEmbedScreen-BPiSXXvm.js → ObserveEmbedScreen-Dh30EjAQ.js} +2 -2
  116. package/dist/client/assets/{ObserveTextFlow-ET0dD1wO.js → ObserveTextFlow-CC5mnngm.js} +2 -2
  117. package/dist/client/assets/{ObservedTopologyPanel-DkEkQzo-.js → ObservedTopologyPanel-DF6tRZL_.js} +1 -1
  118. package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +31 -0
  119. package/dist/client/assets/OpsAgentsView-D3rM0udq.js +1 -0
  120. package/dist/client/assets/OpsScreen-DySeNQ1V.js +1 -0
  121. package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +1 -0
  122. package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +1 -0
  123. package/dist/client/assets/{ProjectAgentProfileBar-C1fR65Eh.js → ProjectAgentProfileBar-C8z22pJ2.js} +1 -1
  124. package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +1 -0
  125. package/dist/client/assets/ProjectsInbox-DfCXReZK.js +2 -0
  126. package/dist/client/assets/ProjectsRail-CELVubfJ.js +1 -0
  127. package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +1 -0
  128. package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +1 -0
  129. package/dist/client/assets/{Provider-5Hotn7NQ.js → Provider-CNZluAZb.js} +2 -2
  130. package/dist/client/assets/{RailRow-BYguXNm4.js → RailRow-DUPqXMZh.js} +1 -1
  131. package/dist/client/assets/RailToggle-BwmY70B8.js +1 -0
  132. package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +1 -0
  133. package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +9 -0
  134. package/dist/client/assets/{RenderedWorkerSprite-CvdWO32C.js → RenderedWorkerSprite-C8fxndAh.js} +1 -1
  135. package/dist/client/assets/{ReplayClock-B7JLTp8A.js → ReplayClock-DUVJjrIu.js} +1 -1
  136. package/dist/client/assets/{ReplayLog-DZTpf2CW.js → ReplayLog-Bek1Vc4W.js} +1 -1
  137. package/dist/client/assets/{ReplayOutpost-CvWQa30T.js → ReplayOutpost-DlRg3172.js} +1 -1
  138. package/dist/client/assets/{RepoDiffEmbedScreen-Cbu0_PJW.js → RepoDiffEmbedScreen-CVUMnt6A.js} +1 -1
  139. package/dist/client/assets/{RepoDiffPageScreen-Chwm6GXL.js → RepoDiffPageScreen-D9-s5PyB.js} +1 -1
  140. package/dist/client/assets/{RepoDiffViewer-C2mb0Wj-.js → RepoDiffViewer-D7FN-oyY.js} +1 -1
  141. package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +2 -0
  142. package/dist/client/assets/{ReposScreen-C7JZQmyh.js → ReposScreen-BQ7HO1om.js} +2 -2
  143. package/dist/client/assets/{RiggedWorkerCharacter-DNe731GE.js → RiggedWorkerCharacter-CJMWlvV-.js} +1 -1
  144. package/dist/client/assets/{SageModelStudio-BR1J2D4R.js → SageModelStudio-B526NSnw.js} +1 -1
  145. package/dist/client/assets/{ScoutDeckSurface-flRamdvE.js → ScoutDeckSurface-ChkvGyEW.js} +1 -1
  146. package/dist/client/assets/{ScoutSurface-BpklGmDL.js → ScoutSurface-6g1f5chk.js} +1 -1
  147. package/dist/client/assets/{ScoutbotFxLab-DeK7ySWZ.js → ScoutbotFxLab-BuwBdnPf.js} +1 -1
  148. package/dist/client/assets/{SecondaryNav-BkTn5tkq.js → SecondaryNav-Bs-_VwTC.js} +1 -1
  149. package/dist/client/assets/{SessionEmbedScreen-CcQN6xlo.js → SessionEmbedScreen-C2wf35-P.js} +1 -1
  150. package/dist/client/assets/{SessionObserve-DaqDhqDI.js → SessionObserve-B64YsYhy.js} +9 -9
  151. package/dist/client/assets/{SessionObserve-BOBJSfs0.css → SessionObserve-CDdJ7fAE.css} +1 -1
  152. package/dist/client/assets/{SessionObserveEvidence-Drv-D8Oh.js → SessionObserveEvidence-CS1aQBpQ.js} +1 -1
  153. package/dist/client/assets/SessionRefScreen-DURV0MpF.js +1 -0
  154. package/dist/client/assets/SessionsScreen-D71ZR-8t.js +1 -0
  155. package/dist/client/assets/{SettingsDrawer-BDapR4E9.js → SettingsDrawer-Nz98oBVl.js} +3 -3
  156. package/dist/client/assets/SettingsScreen-CYBHal6y.js +1 -0
  157. package/dist/client/assets/{SharedFloorCharacter-CSYG_t9t.js → SharedFloorCharacter-V04kD5T9.js} +1 -1
  158. package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +2 -0
  159. package/dist/client/assets/{ShikiPane-BudrOxNK.js → ShikiPane-XwFI-pCp.js} +1 -1
  160. package/dist/client/assets/{SlidePanel-Datu7XG4.js → SlidePanel-BMpkXai_.js} +1 -1
  161. package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +1 -0
  162. package/dist/client/assets/{SpriteAvatar-BW1JzkDt.js → SpriteAvatar-aHeF4ZQZ.js} +1 -1
  163. package/dist/client/assets/{SproutActionSprite-DveCzg6l.js → SproutActionSprite-DI5N3gOj.js} +1 -1
  164. package/dist/client/assets/{StatusPill-MxYClPG5.js → StatusPill-Dw4LP7wu.js} +1 -1
  165. package/dist/client/assets/{TailView-Dn7uWmPz.js → TailView-BofjmUMJ.js} +2 -2
  166. package/dist/client/assets/Terminal-jIqnIZZ6.js +4 -0
  167. package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +1 -0
  168. package/dist/client/assets/{TerminalHeaderMount-DCGstkZ4.js → TerminalHeaderMount-CwbQhXcI.js} +1 -1
  169. package/dist/client/assets/TerminalRelay--qOBwnbR.js +46 -0
  170. package/dist/client/assets/{TextDocumentSurface-BhYvAB0o.js → TextDocumentSurface-BK6Qy41F.js} +1 -1
  171. package/dist/client/assets/{TmuxPeek-BhK0V9Qt.js → TmuxPeek-DpUT9Tpc.js} +1 -1
  172. package/dist/client/assets/{VoicePermissionsPanel-CecFWzva.js → VoicePermissionsPanel-D35fOnQj.js} +1 -1
  173. package/dist/client/assets/{WorkDetailScreen-CwtRCm_-.js → WorkDetailScreen-Bcf_yHhU.js} +2 -2
  174. package/dist/client/assets/{WorkFilesViewer-DJHftsH9.js → WorkFilesViewer-t8AEyx3Q.js} +1 -1
  175. package/dist/client/assets/{WorkRunView-x5PH1byG.js → WorkRunView-_mhG_FR2.js} +1 -1
  176. package/dist/client/assets/WorldActorTalk-CKerDikx.js +1 -0
  177. package/dist/client/assets/{WorldCharacter-Dn4sIXNP.js → WorldCharacter-BRrj3MQN.js} +1 -1
  178. package/dist/client/assets/{WorldMinimap-Blqg0d5r.js → WorldMinimap-DOptgrc4.js} +1 -1
  179. package/dist/client/assets/{WorldSky-DV9bpvXj.js → WorldSky-D-RJzSa6.js} +1 -1
  180. package/dist/client/assets/{activity-CSUhvjD0.js → activity-BJqFrZyB.js} +1 -1
  181. package/dist/client/assets/{addon-fit-MR98IWES.js → addon-fit-CHohcvS3.js} +1 -1
  182. package/dist/client/assets/{addon-webgl-CIIKXrvK.js → addon-webgl-CaRy2x2b.js} +1 -1
  183. package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +2 -0
  184. package/dist/client/assets/{agent-essentials-8t2il7PV.js → agent-essentials-bKWYOZaH.js} +1 -1
  185. package/dist/client/assets/{agent-floor-actor-3v9drnxh.js → agent-floor-actor-DW8zLht0.js} +1 -1
  186. package/dist/client/assets/{agent-lane-card-model-l0stnU9N.js → agent-lane-card-model-CeqQGp-8.js} +1 -1
  187. package/dist/client/assets/{agent-lane-detail-Db7KyAlf.js → agent-lane-detail-Ti3trpfH.js} +1 -1
  188. package/dist/client/assets/{agent-lane-preview-B8lsQJOQ.js → agent-lane-preview-Dpa3DuOn.js} +1 -1
  189. package/dist/client/assets/{agent-lanes-model-CX0wTcnF.js → agent-lanes-model-DMAdqCmK.js} +1 -1
  190. package/dist/client/assets/{agent-specialization-CiVxQsFT.js → agent-specialization-BplZUa_0.js} +1 -1
  191. package/dist/client/assets/{api-B9_IqFKY.js → api-BQYTwoz6.js} +1 -1
  192. package/dist/client/assets/{api-CaROe5_H.js → api-DSqpVKC7.js} +1 -1
  193. package/dist/client/assets/{arc.es-BzhWalCl.js → arc.es-CubLvQ4W.js} +1 -1
  194. package/dist/client/assets/{arrow-left-PuKdO3NM.js → arrow-left-DFfKAq0d.js} +1 -1
  195. package/dist/client/assets/{arrow-right-ldbfp4SZ.js → arrow-right-DmAWnyAH.js} +1 -1
  196. package/dist/client/assets/{arrow-up-right-Hn754ybA.js → arrow-up-right-B0aLKiyF.js} +1 -1
  197. package/dist/client/assets/at-sign-DM7xeppo.js +1 -0
  198. package/dist/client/assets/{book-open-BlJnpf2U.js → book-open-BL9qvhEI.js} +1 -1
  199. package/dist/client/assets/{bot-CfN9PSBF.js → bot-BhAVbcCA.js} +1 -1
  200. package/dist/client/assets/{cache-DEy9E34b.js → cache-DGBo3vIf.js} +1 -1
  201. package/dist/client/assets/chat-api-BPVC0asu.js +1 -0
  202. package/dist/client/assets/chat-space-model-B6Jg2CY4.js +4 -0
  203. package/dist/client/assets/{check-B8dMv3Is.js → check-g7D7-c1J.js} +1 -1
  204. package/dist/client/assets/{chevron-down-B5eMsn5c.js → chevron-down-CDzRQQGl.js} +1 -1
  205. package/dist/client/assets/{chevron-right-C7UGFpkl.js → chevron-right-DKGTLiqc.js} +1 -1
  206. package/dist/client/assets/{chevron-up-BHOEgHcn.js → chevron-up-DX7R6KY2.js} +1 -1
  207. package/dist/client/assets/{chunk-HRAB3GC3-C5X-kFhb.js → chunk-HRAB3GC3-Dvk_QpRq.js} +1 -1
  208. package/dist/client/assets/{clock-DFcRbtrl.js → clock-CQb4FeMf.js} +1 -1
  209. package/dist/client/assets/{code-xml-BmyLM0I2.js → code-xml-Cmadr3pQ.js} +1 -1
  210. package/dist/client/assets/{coffee-C_D9zooM.js → coffee-ljG1_krY.js} +1 -1
  211. package/dist/client/assets/{compass-DTZdCpv9.js → compass-CvzkzkIh.js} +1 -1
  212. package/dist/client/assets/content-0AXa0klu.js +1 -0
  213. package/dist/client/assets/content-BEyJ19Lx.js +1 -0
  214. package/dist/client/assets/content-BN5weWKW.js +1 -0
  215. package/dist/client/assets/content-BNokkm7C.js +1 -0
  216. package/dist/client/assets/content-BV4PUM9q.js +1 -0
  217. package/dist/client/assets/content-BxUPlcx5.js +1 -0
  218. package/dist/client/assets/content-CIC5sku8.js +1 -0
  219. package/dist/client/assets/content-CKJ9zb7Z.js +1 -0
  220. package/dist/client/assets/content-CdkTyxqk.js +1 -0
  221. package/dist/client/assets/content-CnhhSCZq.js +1 -0
  222. package/dist/client/assets/content-D1Ze_FG9.js +1 -0
  223. package/dist/client/assets/content-DY3F9Vfr.js +1 -0
  224. package/dist/client/assets/content-DrKBYpcb.js +1 -0
  225. package/dist/client/assets/content-LSStQYj5.js +1 -0
  226. package/dist/client/assets/content-YvU-D0hF.js +1 -0
  227. package/dist/client/assets/content-oKQMyVnH.js +1 -0
  228. package/dist/client/assets/{context-budget-DemtXu7E.js → context-budget-8qFKqM-j.js} +1 -1
  229. package/dist/client/assets/{conversation-icons-BQ4OeOmr.js → conversation-icons-CIRaxmid.js} +1 -1
  230. package/dist/client/assets/{conversation-model-BGFHoxQ0.js → conversation-model-m8HhzroS.js} +1 -1
  231. package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +1 -0
  232. package/dist/client/assets/{copy-D9WUpQRf.js → copy-BGOC1tJB.js} +1 -1
  233. package/dist/client/assets/{cpu-Ck_4tB_-.js → cpu-Q6nrHFTN.js} +1 -1
  234. package/dist/client/assets/{createLucideIcon-DkjnzvcJ.js → createLucideIcon-ChvMq-zl.js} +1 -1
  235. package/dist/client/assets/{credentials-C4VXz2hr.js → credentials-OeoF-VKJ.js} +1 -1
  236. package/dist/client/assets/discover-DlwbftpC.js +2 -0
  237. package/dist/client/assets/embed-entry-c0lwtjBG.js +2 -0
  238. package/dist/client/assets/{external-link-RT4Ph-6-.js → external-link-BVccgH0n.js} +1 -1
  239. package/dist/client/assets/{eye-CtqSV8BS.js → eye-CsGfEVR6.js} +1 -1
  240. package/dist/client/assets/{file-code-corner-D_Aptal2.js → file-code-corner-Be6da5l3.js} +1 -1
  241. package/dist/client/assets/{file-text-ChtICwub.js → file-text-DP6txVW-.js} +1 -1
  242. package/dist/client/assets/{flag-CqdOxVkI.js → flag-DAFE2wZ5.js} +1 -1
  243. package/dist/client/assets/{floor-context-model-DZBpo_oD.js → floor-context-model-rWKqaKmV.js} +1 -1
  244. package/dist/client/assets/{floor-message-passes-CJh9f8Jp.js → floor-message-passes-CO3Ix_wR.js} +1 -1
  245. package/dist/client/assets/{folder-0fWevPvQ.js → folder-B_S7gBVr.js} +1 -1
  246. package/dist/client/assets/{gauge-Dgtfxf_o.js → gauge-DQCGlE3o.js} +1 -1
  247. package/dist/client/assets/{gestures-BDCZ1FRG.js → gestures-CofqY4Km.js} +1 -1
  248. package/dist/client/assets/{git-branch-CA3cHKCI.js → git-branch-DcUCsWdJ.js} +1 -1
  249. package/dist/client/assets/{go-shortcuts-DKtw4qYx.js → go-shortcuts-KQy-ZOpV.js} +1 -1
  250. package/dist/client/assets/{home-moving-signal-B7m-ngb2.js → home-moving-signal-BIHUGNfI.js} +1 -1
  251. package/dist/client/assets/home-now-card-CaLgZze2.js +1 -0
  252. package/dist/client/assets/{home-now-card-nano-D1ScGrgv.js → home-now-card-nano-CvU8B61b.js} +1 -1
  253. package/dist/client/assets/hooks-DaUOREpP.js +2 -0
  254. package/dist/client/assets/index-CGbs0SBm.css +1 -0
  255. package/dist/client/assets/index-CbqBwfIW.js +1 -0
  256. package/dist/client/assets/index-CyPMl7Up.js +1 -0
  257. package/dist/client/assets/index-DReVb7jZ.js +10 -0
  258. package/dist/client/assets/index-PQpJveGO.js +1 -0
  259. package/dist/client/assets/{index-CvsM3jm8.js → index-kkXUq-zf.js} +1 -1
  260. package/dist/client/assets/{inspector-panel-BLhDODb3.js → inspector-panel-CLU7wjnT.js} +2 -2
  261. package/dist/client/assets/{keyboard-nav-CXfav14z.js → keyboard-nav-CJXPaHXj.js} +1 -1
  262. package/dist/client/assets/lane-ask-display-BTVSakyo.js +18 -0
  263. package/dist/client/assets/{lane-observe-BD21P8BB.js → lane-observe-CteDwdD-.js} +3 -3
  264. package/dist/client/assets/{lane-roster-store-DzNHP392.js → lane-roster-store-Ch9t6lb0.js} +1 -1
  265. package/dist/client/assets/{layers-Bolb8ejU.js → layers-BOwyWodP.js} +1 -1
  266. package/dist/client/assets/{layout-grid-DI9tVJ2E.js → layout-grid-B36Qsh0y.js} +1 -1
  267. package/dist/client/assets/left-0vBrvrBG.js +2 -0
  268. package/dist/client/assets/left-C6SyaqlJ.js +1 -0
  269. package/dist/client/assets/left-CTuXysZR.js +2 -0
  270. package/dist/client/assets/left-Cc6s4DT2.js +1 -0
  271. package/dist/client/assets/left-DF5caiyh.js +1 -0
  272. package/dist/client/assets/left-DgT4tWCx.js +1 -0
  273. package/dist/client/assets/left-R0wppTTr.js +1 -0
  274. package/dist/client/assets/left-advisor-C-kt8V28.js +1 -0
  275. package/dist/client/assets/left-agents-thnBO156.js +1 -0
  276. package/dist/client/assets/left-default-CT42fnpF.js +1 -0
  277. package/dist/client/assets/left-lanes-CSmZgciK.js +1 -0
  278. package/dist/client/assets/left-mission-C86x6i9h.js +1 -0
  279. package/dist/client/assets/library-DdhYL_9v.js +1 -0
  280. package/dist/client/assets/{loader-circle-DurUYl7E.js → loader-circle-DNUsuPWz.js} +1 -1
  281. package/dist/client/assets/{local-agents-D9fYYRyj.js → local-agents-I40PawYA.js} +1 -1
  282. package/dist/client/assets/{machine-children-RGS4Q0r6.js → machine-children-CdhNzDF0.js} +1 -1
  283. package/dist/client/assets/{mentions-Ctw1ECUC.js → mentions-Ck_Vjnyp.js} +1 -1
  284. package/dist/client/assets/{mesh-ops-CGpRk4ik.js → mesh-ops-DSlvHp-D.js} +1 -1
  285. package/dist/client/assets/{mesh-view-store-CliSYsmt.js → mesh-view-store-C1-mdP3P.js} +1 -1
  286. package/dist/client/assets/{message-circle-CSiJj6yo.js → message-circle-cI5_A5mj.js} +1 -1
  287. package/dist/client/assets/{message-markup-DgFSyb3f.js → message-markup-6Tgo4qFJ.js} +1 -1
  288. package/dist/client/assets/{message-square-NmXWtWLR.js → message-square-CJW4WRlo.js} +1 -1
  289. package/dist/client/assets/{mission-control-store-DZ29Mlj1.js → mission-control-store-p_cboAm4.js} +1 -1
  290. package/dist/client/assets/monitor-C7_cHlkC.js +1 -0
  291. package/dist/client/assets/{nav-destinations-CyXnw9kh.js → nav-destinations-CU_euC-Q.js} +1 -1
  292. package/dist/client/assets/{observe-CkfOxYx_.js → observe-CtS0l3zu.js} +1 -1
  293. package/dist/client/assets/{operator-attention-DGR4kOog.js → operator-attention-DBaRg5ep.js} +1 -1
  294. package/dist/client/assets/{page-status-CkS3SZu-.js → page-status-DwFR4wSw.js} +1 -1
  295. package/dist/client/assets/{panel-right-BNTJhy8M.js → panel-right-qP17MwMl.js} +1 -1
  296. package/dist/client/assets/{pause-DWS7YGQ3.js → pause-B_hliKuR.js} +1 -1
  297. package/dist/client/assets/{persistent-state-xsuk6Kc-.js → persistent-state-BUsTTZFE.js} +1 -1
  298. package/dist/client/assets/{pin-DWlD1BOF.js → pin-Oi4qHR6M.js} +1 -1
  299. package/dist/client/assets/{play-D_Pggug4.js → play-CVeRmqLH.js} +1 -1
  300. package/dist/client/assets/{plus-D_wLGJGT.js → plus-D5NLH_fM.js} +1 -1
  301. package/dist/client/assets/profile-BegEUmB7.js +1 -0
  302. package/dist/client/assets/projects-inbox-CKPLZN8s.css +1 -0
  303. package/dist/client/assets/{projects-inbox-DvbqJO3q.js → projects-inbox-CfwxCTdN.js} +1 -1
  304. package/dist/client/assets/provider-DwmCoSlc.js +1 -0
  305. package/dist/client/assets/{proxy-DOG46ja4.js → proxy-DgzP27W8.js} +1 -1
  306. package/dist/client/assets/{radio-C_jtwbFP.js → radio-Cas2qg1D.js} +1 -1
  307. package/dist/client/assets/{refresh-cw-Da9DDLk2.js → refresh-cw-IcD2lPoT.js} +1 -1
  308. package/dist/client/assets/resolve-panes-pfZTezKo.js +1 -0
  309. package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +1 -0
  310. package/dist/client/assets/right-BDaCJ0CF.js +1 -0
  311. package/dist/client/assets/right-BP6lXRFS.js +1 -0
  312. package/dist/client/assets/right-Cb1VCrdj.js +1 -0
  313. package/dist/client/assets/right-CeFaxfBo.js +1 -0
  314. package/dist/client/assets/right-Ck2SrYCj.js +1 -0
  315. package/dist/client/assets/right-D-uv5YfF.js +1 -0
  316. package/dist/client/assets/right-DJMSICky.js +1 -0
  317. package/dist/client/assets/right-Dnljs8ah.js +1 -0
  318. package/dist/client/assets/right-SdCSF8PP.js +1 -0
  319. package/dist/client/assets/{right-BLJsc2-p.js → right-cjPTwPXS.js} +1 -1
  320. package/dist/client/assets/{rocket-DyrYDo8V.js → rocket-DAqYvu8I.js} +1 -1
  321. package/dist/client/assets/router-C-MF5-mb.js +1 -0
  322. package/dist/client/assets/{runtime-picker-DdsttHHc.js → runtime-picker-C_AVYF63.js} +1 -1
  323. package/dist/client/assets/{scope-views-B7PZGlhY.js → scope-views-Dl3ml9OZ.js} +1 -1
  324. package/dist/client/assets/{scout-voice-DOQ_B77g.js → scout-voice-CqAyfblr.js} +1 -1
  325. package/dist/client/assets/{scoutbot-markdown-Bz0Vbto2.js → scoutbot-markdown-DwvGQOWo.js} +1 -1
  326. package/dist/client/assets/{scroll-text-DwC8r2g6.js → scroll-text-B0tKI9Sg.js} +1 -1
  327. package/dist/client/assets/{search-C4VlW_0l.js → search-UsM-9-_W.js} +1 -1
  328. package/dist/client/assets/secondaryNavConfig-D15P1Y9k.css +1 -0
  329. package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +1 -0
  330. package/dist/client/assets/{selection-bridge-B5jqyMR9.js → selection-bridge-OTS2iFkt.js} +1 -1
  331. package/dist/client/assets/{send-horizontal-pOtGI7FM.js → send-horizontal-BlQsRK6C.js} +1 -1
  332. package/dist/client/assets/{send-to-agent-session-BZGq_ycy.js → send-to-agent-session-C1mgqdow.js} +1 -1
  333. package/dist/client/assets/{server-ms1yxUYJ.js → server-DBlPW0Mp.js} +1 -1
  334. package/dist/client/assets/{session-catalog-s-T_w41t.js → session-catalog-CnpZMB7C.js} +1 -1
  335. package/dist/client/assets/{session-table-CDx_16xf.js → session-table-CGkfG5Yd.js} +1 -1
  336. package/dist/client/assets/{sessions-view-DzYGsKWS.js → sessions-view-Bge4XZ4I.js} +1 -1
  337. package/dist/client/assets/{settings-TJIkkZ0P.js → settings-C69Zjrpq.js} +1 -1
  338. package/dist/client/assets/{shared-work-artifacts-4IIQXQfc.js → shared-work-artifacts-DfNl9KTo.js} +1 -1
  339. package/dist/client/assets/{sliders-horizontal-CHf3ntw0.js → sliders-horizontal-6bzeod7c.js} +1 -1
  340. package/dist/client/assets/{sparkles-BbOFw3d0.js → sparkles-Cc5lPZRv.js} +1 -1
  341. package/dist/client/assets/{sse-v5QLsOHV.js → sse-A8AyLH0g.js} +1 -1
  342. package/dist/client/assets/{tail-events-DQ46QBW1.js → tail-events-C4WdhVeK.js} +1 -1
  343. package/dist/client/assets/{terminal-96JWDYDL.js → terminal-DMZjX1es.js} +1 -1
  344. package/dist/client/assets/{terminal-relay-Bfx8pg80.js → terminal-relay-mO89dX-Y.js} +1 -1
  345. package/dist/client/assets/{terminal-sessions-Ch9aYlgi.js → terminal-sessions-3RfJpen8.js} +1 -1
  346. package/dist/client/assets/{terminal-takeover-BlpxpvSp.js → terminal-takeover-CZZsnPzj.js} +1 -1
  347. package/dist/client/assets/use-beside-D3cJpA5p.js +1 -0
  348. package/dist/client/assets/{use-conversation-list-A_YUf8lo.js → use-conversation-list-D5EnpVba.js} +1 -1
  349. package/dist/client/assets/{use-fleet-active-asks-DFs_u-vM.js → use-fleet-active-asks-D_QOmjg5.js} +1 -1
  350. package/dist/client/assets/{use-mesh-node-state-Ck9CYplv.js → use-mesh-node-state-3V3ADQ-G.js} +1 -1
  351. package/dist/client/assets/{use-mesh-ops-items-Be1WmwCg.js → use-mesh-ops-items-DI9GKWlF.js} +1 -1
  352. package/dist/client/assets/{use-reduced-motion-D7n3vK8t.js → use-reduced-motion-CiaZHMnk.js} +1 -1
  353. package/dist/client/assets/use-scout-dev-flags-CkdAHlDR.js +1 -0
  354. package/dist/client/assets/{useAgentHoverCard-Dr-OjNFF.js → useAgentHoverCard-A3QGXqIy.js} +1 -1
  355. package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +1 -0
  356. package/dist/client/assets/{useEmbedHeadline-BL8wQawZ.js → useEmbedHeadline-atkQVfGw.js} +1 -1
  357. package/dist/client/assets/usePersistentState-Y8XwSTg-.js +1 -0
  358. package/dist/client/assets/{usePierreRuntime-DJkRHMoe.js → usePierreRuntime-DTvcwISe.js} +1 -1
  359. package/dist/client/assets/users-RLK3P5U4.js +1 -0
  360. package/dist/client/assets/{wrench-BsMTSeji.js → wrench-B4maQJai.js} +1 -1
  361. package/dist/client/assets/{x-DI1ktCYb.js → x-rlMdRqJF.js} +1 -1
  362. package/dist/client/assets/{xterm-B1YBE4Gq.js → xterm-B1zHHOLQ.js} +1 -1
  363. package/dist/client/assets/{zap-sKPkh4sQ.js → zap-B4X0OrEw.js} +1 -1
  364. package/dist/client/index.html +15 -3
  365. package/dist/drizzle/0019_session_actor_targets.sql +227 -0
  366. package/dist/drizzle/README.md +19 -0
  367. package/dist/drizzle/meta/0019_snapshot.json +6804 -0
  368. package/dist/drizzle/meta/_journal.json +7 -0
  369. package/dist/highlights-eq9cgrbb.scm +604 -0
  370. package/dist/highlights-ghv9g403.scm +205 -0
  371. package/dist/highlights-hk7bwhj4.scm +284 -0
  372. package/dist/highlights-r812a2qc.scm +150 -0
  373. package/dist/highlights-x6tmsnaa.scm +115 -0
  374. package/dist/injections-73j83es3.scm +27 -0
  375. package/dist/main.mjs +1214 -722
  376. package/dist/node/main.mjs +133 -22
  377. package/dist/pairing-runtime-controller.mjs +715 -492
  378. package/dist/runtime/base-daemon.mjs +14176 -58
  379. package/dist/runtime/broker-daemon.mjs +15520 -445
  380. package/dist/runtime/broker-process-manager.mjs +5 -3
  381. package/dist/runtime/mesh-discover.mjs +5 -3
  382. package/dist/scout-control-plane-web.mjs +21065 -3387
  383. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  384. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  385. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  386. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  387. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  388. package/dist/update-helper.mjs +83 -17
  389. package/package.json +2 -2
  390. package/dist/client/assets/ActivityScreen-DCALiEXY.js +0 -1
  391. package/dist/client/assets/AgentAdventures-NwTKeF0F.js +0 -1
  392. package/dist/client/assets/AgentConfigurationScreen-B2Hw0ce1.js +0 -1
  393. package/dist/client/assets/AgentDefinitionsWorkspace-CwZJ833X.js +0 -1
  394. package/dist/client/assets/AgentFloorView-l2wNKFob.js +0 -1
  395. package/dist/client/assets/AgentInfoScreen-ClZM1wQb.js +0 -1
  396. package/dist/client/assets/AgentLanesEmbedScreen-DqHwqY0X.js +0 -1
  397. package/dist/client/assets/AgentMasterScreen-By6DN0jF.js +0 -1
  398. package/dist/client/assets/AgentsConsole-Dq0S_hRA.js +0 -1
  399. package/dist/client/assets/AgentsScreen-Bi9Lx47B.js +0 -1
  400. package/dist/client/assets/AgentsSubnav-BOobgtGE.js +0 -1
  401. package/dist/client/assets/BriefingDetailScreen-sprFl4Nk.js +0 -1
  402. package/dist/client/assets/BrokerScreen-CejzhRsB.js +0 -8
  403. package/dist/client/assets/ConversationFeedRows-DVqnZQH0.js +0 -1
  404. package/dist/client/assets/ConversationHeader-CCSU8uo_.js +0 -1
  405. package/dist/client/assets/ConversationScreen-tTP6B_F-.js +0 -2
  406. package/dist/client/assets/CrewWorkspaces-4O8dgRUD.js +0 -1
  407. package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +0 -1
  408. package/dist/client/assets/FlightObserveScreen-DDXfNbsw.js +0 -1
  409. package/dist/client/assets/FloorResourcesSheet-Djrgd_ZU.js +0 -1
  410. package/dist/client/assets/HarnessMark-Bt47OeHy.js +0 -1
  411. package/dist/client/assets/HarnessesScreen-M84sFjWY.js +0 -1
  412. package/dist/client/assets/KnowledgeSearchScreen-WC0WhFio.js +0 -1
  413. package/dist/client/assets/LaneTraceDetailSheet-mAhj7MJi.js +0 -1
  414. package/dist/client/assets/MeshScreen-DlfiMlaR.js +0 -1
  415. package/dist/client/assets/MessagesScreen-BZ7yaGJx.js +0 -1
  416. package/dist/client/assets/MissionControlView-DpGhxG4a.js +0 -1
  417. package/dist/client/assets/MissionLeftAgentRow-DhhRRim0.js +0 -1
  418. package/dist/client/assets/NativeAreaScreen-BQyHHRAM.js +0 -1
  419. package/dist/client/assets/NativeAreaScreen-Ditv-TYW.js +0 -1
  420. package/dist/client/assets/NativeAreaScreen-Dq3uPSEI.js +0 -1
  421. package/dist/client/assets/NewChatComposer-JjLbm3W2.js +0 -19
  422. package/dist/client/assets/OpenScoutAppShell-CzKbjwCA.js +0 -22
  423. package/dist/client/assets/OpsAgentsView-CZbtkcQH.js +0 -1
  424. package/dist/client/assets/OpsScreen-DJq-aBmX.js +0 -1
  425. package/dist/client/assets/OpsSubnav-9sURjajO.js +0 -1
  426. package/dist/client/assets/ProjectAgentProfile-q_1tMJIL.js +0 -1
  427. package/dist/client/assets/ProjectAgentProfileHero-DyEFyTFs.js +0 -1
  428. package/dist/client/assets/ProjectsInbox-Bs8I__my.js +0 -2
  429. package/dist/client/assets/ProjectsRail-Deb38OJ1.js +0 -1
  430. package/dist/client/assets/ProjectsScreen-CgLiYiss.js +0 -1
  431. package/dist/client/assets/ProjectsThreadAside-C0Yw3yIL.js +0 -1
  432. package/dist/client/assets/RawSessionsTable-DIhmlvk-.js +0 -1
  433. package/dist/client/assets/RealtimeVoiceScreen-3oU7b7V5.js +0 -1
  434. package/dist/client/assets/RepoDiffViewerLazy-BQ6ZCrsq.js +0 -2
  435. package/dist/client/assets/SessionRefScreen-BOQ1_ydg.js +0 -1
  436. package/dist/client/assets/SessionsScreen-R8QKvoey.js +0 -1
  437. package/dist/client/assets/SettingsScreen-DirtO7Z0.js +0 -1
  438. package/dist/client/assets/SharedWorkFloor-yPWFLZwX.js +0 -2
  439. package/dist/client/assets/Terminal-D-DsQlmV.js +0 -4
  440. package/dist/client/assets/TerminalEmbedScreen-9Gmln759.js +0 -1
  441. package/dist/client/assets/WorldActorTalk-uIH2jGqA.js +0 -1
  442. package/dist/client/assets/agent-autocomplete-CeHQpuG9.js +0 -10
  443. package/dist/client/assets/arrow-down-WoVlkUmg.js +0 -1
  444. package/dist/client/assets/chunk-JTPDIGGW-ZC-98AHT.js +0 -46
  445. package/dist/client/assets/chunk-T65CQEWV-CSVUz2rY.js +0 -1
  446. package/dist/client/assets/chunk-YOZR3KYS-B59jqwO0.js +0 -2
  447. package/dist/client/assets/content-B5Q4pb9R.js +0 -1
  448. package/dist/client/assets/content-BK1IfOZs.js +0 -1
  449. package/dist/client/assets/content-BeEsWLEm.js +0 -1
  450. package/dist/client/assets/content-BkOwEknW.js +0 -1
  451. package/dist/client/assets/content-C32W5kAG.js +0 -1
  452. package/dist/client/assets/content-CoqyLs9v.js +0 -1
  453. package/dist/client/assets/content-CwpdIS5b.js +0 -1
  454. package/dist/client/assets/content-DS2OkJ3Q.js +0 -1
  455. package/dist/client/assets/content-DXKaPDfn.js +0 -1
  456. package/dist/client/assets/content-DZt5-dkI.js +0 -1
  457. package/dist/client/assets/content-DbQJH8L1.js +0 -1
  458. package/dist/client/assets/content-DetoiaHq.js +0 -1
  459. package/dist/client/assets/content-Dhu3wL7J.js +0 -1
  460. package/dist/client/assets/content-Dpv34iZu.js +0 -1
  461. package/dist/client/assets/content-TtQJb61D.js +0 -1
  462. package/dist/client/assets/content-ymNb2R7g.js +0 -1
  463. package/dist/client/assets/conversation-motion-features-9x8uZpwh.js +0 -1
  464. package/dist/client/assets/discover-C8IOY7_K.js +0 -2
  465. package/dist/client/assets/embed-entry-CG3CfCbm.js +0 -2
  466. package/dist/client/assets/home-now-card-DduXkHRR.js +0 -1
  467. package/dist/client/assets/hooks-C6VyQTQe.js +0 -2
  468. package/dist/client/assets/index-C5cX8dkl.js +0 -1
  469. package/dist/client/assets/index-C8uS5szO.js +0 -10
  470. package/dist/client/assets/index-Ck1__1yL.css +0 -1
  471. package/dist/client/assets/index-ClOOrVG1.js +0 -1
  472. package/dist/client/assets/index-Crtgfc9I.js +0 -1
  473. package/dist/client/assets/lane-ask-display-B6iCAVcd.js +0 -18
  474. package/dist/client/assets/left-B-_z_nqj.js +0 -2
  475. package/dist/client/assets/left-B1LY7rJc.js +0 -1
  476. package/dist/client/assets/left-C6bdjWcG.js +0 -2
  477. package/dist/client/assets/left-CF4iuqlz.js +0 -1
  478. package/dist/client/assets/left-DLtNyZl1.js +0 -1
  479. package/dist/client/assets/left-Fpxoq-VY.js +0 -1
  480. package/dist/client/assets/left-N2wXfTlp.js +0 -1
  481. package/dist/client/assets/left-advisor-CeIjCKbd.js +0 -1
  482. package/dist/client/assets/left-agents-upjHVlOj.js +0 -1
  483. package/dist/client/assets/left-default-08gmdCtb.js +0 -1
  484. package/dist/client/assets/left-lanes-Cvsp73Hw.js +0 -1
  485. package/dist/client/assets/left-mission-W1LLaz74.js +0 -1
  486. package/dist/client/assets/library-DLKBVUJ6.js +0 -1
  487. package/dist/client/assets/profile-C3KgiZvc.js +0 -1
  488. package/dist/client/assets/projects-inbox-BIW7nv-H.css +0 -1
  489. package/dist/client/assets/resolve-panes-DuowGRTk.js +0 -1
  490. package/dist/client/assets/resolve-sidebar-context-BkTbqteq.js +0 -1
  491. package/dist/client/assets/right-B9OUA6Ho.js +0 -1
  492. package/dist/client/assets/right-BDQnjetX.js +0 -1
  493. package/dist/client/assets/right-BUbKHmRH.js +0 -1
  494. package/dist/client/assets/right-Ci2IcD4s.js +0 -1
  495. package/dist/client/assets/right-CmCce3e5.js +0 -1
  496. package/dist/client/assets/right-D7w0zM5a.js +0 -1
  497. package/dist/client/assets/right-DIoON_bv.js +0 -1
  498. package/dist/client/assets/right-E0Jr3VN5.js +0 -1
  499. package/dist/client/assets/right-lCdAk9dW.js +0 -1
  500. package/dist/client/assets/router-BKiMcYa7.js +0 -1
  501. package/dist/client/assets/secondaryNavConfig-DAXIFtVd.js +0 -1
  502. package/dist/client/assets/secondaryNavConfig-xssF_ubT.css +0 -1
  503. package/dist/client/assets/use-beside-Df-F2Uvg.js +0 -1
  504. package/dist/client/assets/use-scout-dev-flags-0TXfQcG0.js +0 -1
  505. package/dist/client/assets/useContentSecondaryNav-CGvMOVGY.js +0 -1
@@ -1 +0,0 @@
1
- import{r as o,j as e}from"./index-C8uS5szO.js";import{A as O}from"./AgentAvatar-BIwg54Tj.js";import{H as W}from"./HarnessMark-Bt47OeHy.js";import{u as q,b as I,f as V}from"./use-fleet-active-asks-DFs_u-vM.js";import{p as z,N as K,t as U}from"./sessions-view-DzYGsKWS.js";import{t as G}from"./time-Dhsh_2EG.js";import{a as H}from"./api-CaROe5_H.js";import{u as J}from"./use-conversation-list-A_YUf8lo.js";import{u as D}from"./router-BKiMcYa7.js";import{u as Q}from"./Provider-5Hotn7NQ.js";import{CommsFlowView as X}from"./CommsFlowGraph-Czg-KTS0.js";import{mapIdentities as Y}from"./CommsFlowMap-CzBWvSa5.js";import{p as Z,f as tt,e as et,a as st}from"./comms-gesture-_aGFo6g3.js";import{u as rt,a as at}from"./use-beside-Df-F2Uvg.js";import{ConversationScreen as ot}from"./ConversationScreen-tTP6B_F-.js";import{b as it,s as nt}from"./agent-master-model-C-KdOFDK.js";/* empty css */import{P as lt}from"./panel-right-BNTJhy8M.js";import"./SpriteAvatar-BW1JzkDt.js";import"./agent-state-DDhnFEEP.js";import"./CrewAvatar-CJhuqTsJ.js";import"./colors-CFlbwC25.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./message-visibility-DwxgcgYK.js";import"./machine-scope-DJt9RZ2w.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./conversation-model-BGFHoxQ0.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./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"./CommsCanvas-DOKw3Q8i.js";import"./comms-deck-CBhsXnY-.js";import"./CommsSelection-g1twA-Lb.js";/* empty css */import"./ConversationComposer-B7RU6LKd.js";import"./zap-sKPkh4sQ.js";import"./message-markup-DgFSyb3f.js";import"./mentions-Ctw1ECUC.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./openContent-C6XO6kr5.js";import"./eye-CtqSV8BS.js";import"./terminal-96JWDYDL.js";import"./operator-attention-DGR4kOog.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-CCSU8uo_.js";import"./BackToPicker-Bys9ColC.js";import"./AstronautSuit-C-4I5YKi.js";import"./ConversationFeedRows-DVqnZQH0.js";import"./ConversationPanels-C9yCAoJy.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-D7n3vK8t.js";import"./proxy-DOG46ja4.js";import"./activity-CSUhvjD0.js";import"./message-circle-CSiJj6yo.js";import"./tail-events-DQ46QBW1.js";import"./ConversationStatus-CK-YfLpi.js";import"./check-B8dMv3Is.js";import"./sparkles-BbOFw3d0.js";const mt=500;function ct(s,n){const[i,m]=o.useState([]),[f,c]=o.useState(!1),[l,d]=o.useState(null);return o.useEffect(()=>{if(m([]),!n||!s){c(!1),d(null);return}let a=!0;return c(!0),d(null),H(`/api/messages?actor=${encodeURIComponent(s)}&limit=${mt}`).then(r=>{a&&m([...r].sort((x,v)=>x.createdAt-v.createdAt))}).catch(r=>{a&&(m([]),d(r instanceof Error?r.message:"Could not load this agent's messages."))}).finally(()=>{a&&c(!1)}),()=>{a=!1}},[s,n]),{messages:i,loading:f,error:l}}const pt=[{id:"chat",label:"Chat",hint:"The conversation on the stage"},{id:"flow",label:"Flow",hint:"Who asked whom across everything this agent is in"},{id:"map",label:"Map",hint:"Who this agent exchanges work with, and on which model"},{id:"canvas",label:"Canvas",hint:"The same window laid out left to right, with nobody folded away"}];function dt(s,n){const{messages:i,loading:m,error:f}=ct(s,n),{passes:c,flights:l}=o.useMemo(()=>{const a=i.filter(r=>!!r.actorId).map(r=>({id:r.id,conversationId:r.conversationId,actorId:r.actorId,actorName:r.actorName,body:r.body,createdAt:r.createdAt,class:r.class,metadata:r.metadata??null,replyToMessageId:r.replyToMessageId??null}));return et(a)},[i]),d=o.useMemo(()=>st(c,l),[c,l]);return{passes:c,flights:l,tasks:d,loading:m,error:f,count:i.length}}function Ze({agentId:s,threadId:n,machineId:i,navigate:m}){const{agents:f}=Q(),c=D(),l=rt(),d=at(m,i),[a,r]=o.useState(()=>{if(typeof window>"u")return"chat";const t=new URLSearchParams(window.location.search).get("view");return t==="flow"||t==="map"||t==="canvas"?t:"chat"}),[x,v]=o.useState(null),b=`${s}\0${n??""}`,S=o.useRef(b);o.useEffect(()=>{S.current!==b&&(S.current=b,r("chat"),v(null))},[b]),o.useEffect(()=>v(null),[a]),o.useEffect(()=>{if(typeof window>"u")return;const t=new URL(window.location.href),h=a==="chat"?"":a;(t.searchParams.get("view")??"")!==h&&(h?t.searchParams.set("view",h):t.searchParams.delete("view"),window.history.replaceState(window.history.state,"",`${t.pathname}${t.search}${t.hash}`))},[a,c.searchStr]);const{sessions:C,loading:T}=J(),N=q(),{agent:g,memberAgentIds:E,sessions:k,master:p,threads:A}=o.useMemo(()=>it({agentId:s,threadId:n,machineId:i,agents:f,sessions:C}),[s,n,i,f,C]),$=o.useMemo(()=>I(N,E),[N,E]),u=dt(s,a!=="chat"),B=o.useMemo(()=>Y(k.flatMap(t=>t.participants??[])),[k]),w=n??p?.id??null,L=o.useMemo(()=>p?[p,...A]:A,[p,A]),_=t=>!!w&&nt(t,w),P=t=>{m({view:"messages",agentId:s,...p&&t.id===p.id?{}:{threadId:t.id},...i?{machineId:i}:{}})},y=g?.name??k[0]?.agentName??s.split(".")[0]??s,R=(()=>{const t=z(g);return t===K?null:t})(),M=ut($),F=[R,M?.label??g?.branch??null].filter(Boolean).join(" · ");return e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"amv-head",children:[e.jsx(O,{agent:g??{name:y,harness:p?.harness??null,state:null},placement:"row",size:32}),e.jsxs("div",{className:"amv-ident",children:[e.jsx("span",{className:"amv-name",children:y}),F?e.jsxs("span",{className:"amv-sub",children:[M?e.jsx("span",{className:"amv-dot","data-tone":M.tone,"aria-hidden":!0}):null,F]}):null]}),g?.harness??p?.harness?e.jsx(W,{harness:g?.harness??p?.harness??"",size:14}):null,e.jsx("div",{className:"s-thread-view-toggle",role:"group","aria-label":"View",children:pt.map(t=>e.jsx("button",{type:"button",className:`s-thread-view-option${a===t.id?" is-active":""}`,onClick:()=>r(t.id),"aria-pressed":a===t.id,title:t.hint,children:t.label},t.id))})]}),L.length>0?e.jsx("div",{className:"amv-strip",role:"list","aria-label":"Conversations",children:L.map(t=>{const h=_(t),j=l.has(t.id);return e.jsxs("div",{role:"listitem",className:`amv-card${h?" amv-card--on":""}${j?" amv-card--kept":""}`,children:[e.jsxs("button",{type:"button",className:"amv-cardMain",title:h?"On the stage":"Open on the stage · double-click to keep beside","aria-current":h?"true":void 0,...Z(()=>{r("chat"),P(t)},()=>l.add(t.id)),children:[e.jsx("span",{className:"amv-mark","data-state":ft(t,N),"aria-hidden":!0}),e.jsx("span",{className:"amv-cardTitle",children:U(t)}),e.jsx("span",{className:"amv-cardMeta",children:t.lastMessageAt?G(t.lastMessageAt):"—"})]}),e.jsx("button",{type:"button",className:"amv-cardBeside",title:j?"Close the column beside the stage":"Keep beside the stage","aria-label":j?"Close beside":"Keep beside","aria-pressed":j,onClick:()=>l.toggle(t.id),children:e.jsx(lt,{size:12,strokeWidth:2,"aria-hidden":!0})})]},t.id)})}):null,e.jsx("div",{className:"amv-feed",children:a!=="chat"?u.error?e.jsx("div",{className:"amv-empty",children:u.error}):u.loading&&u.count===0?e.jsx("div",{className:"amv-empty",children:"Loading this agent’s work…"}):u.count===0?e.jsx("div",{className:"amv-empty",children:"Nothing has passed through this agent yet."}):e.jsx(X,{passes:u.passes,flights:u.flights,rootId:tt(s),identities:B,view:a,selected:x,onSelect:v,onStage:t=>{r("chat"),d(t)},beside:l}):w?e.jsx(ot,{conversationId:w,navigate:m,embedded:!0,showBackNav:!1,beside:l},w):e.jsx("div",{className:"amv-empty",children:T?"Loading conversations…":`No conversations with ${y} yet.`})})]})}function ut(s){return s?s.status==="working"?{label:"working",tone:"working"}:s.status==="needs_attention"?{label:"needs you",tone:"attention"}:s.status==="queued"?{label:"starting",tone:"pending"}:null:null}function ht(s){return s.status==="needs_attention"?"needs_you":s.status==="working"||s.status==="queued"?"working":"quiet"}function ft(s,n){const i=V(n,s);return i?ht(i):"quiet"}export{Ze as AgentMasterScreen};
@@ -1 +0,0 @@
1
- import{r as u,j as s}from"./index-C8uS5szO.js";import{A as B}from"./AgentAvatar-BIwg54Tj.js";import{H as S,h as w}from"./HarnessMark-Bt47OeHy.js";import{c as P}from"./agent-state-DDhnFEEP.js";import{f as R}from"./runtime-picker-DdsttHHc.js";import{t as C}from"./time-Dhsh_2EG.js";import"./Provider-5Hotn7NQ.js";import"./router-BKiMcYa7.js";import"./api-CaROe5_H.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-v5QLsOHV.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./conversation-model-BGFHoxQ0.js";import"./createLucideIcon-DkjnzvcJ.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./loader-circle-DurUYl7E.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"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./SpriteAvatar-BW1JzkDt.js";import"./CrewAvatar-CJhuqTsJ.js";import"./voice-levels-Dcr3jglk.js";function K(n){return n.needsYou?"needs":n.status==="in_turn"||n.status==="in_flight"?"live":"idle"}const H=[{id:"prompt",label:"System prompt",sigil:"◆"},{id:"config",label:"Config",sigil:"▤"},{id:"conversations",label:"Conversations",sigil:"◇"},{id:"context",label:"Context",sigil:"▸"}],q={prompt:"System prompt",config:"Config",conversations:"Conversations",context:"Context"};function U(n){return n?n.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~"):""}const k=(n,e)=>`${n} ${e}${n===1?"":"s"}`;function qs({projects:n,initialSelection:e,onEdit:a,onInterrupt:l,onResetContext:i,onOpenConversation:m,onNewAgent:o}){const d=u.useMemo(()=>n.flatMap(t=>t.agents.map(c=>[t,c])),[n]),x=d[0]?.[1],[p,A]=u.useState(e?.agentId??x?.agent.id??null),[F,E]=u.useState(e?.facet??"prompt"),[I,y]=u.useState(()=>new Set(p?[p]:[])),[M,V]=u.useState(""),g=M.trim().toLowerCase(),D=u.useMemo(()=>g?n.map(t=>({...t,agents:t.agents.filter(c=>c.agent.name.toLowerCase().includes(g)||(c.agent.harness??"").toLowerCase().includes(g)||t.slug.toLowerCase().includes(g))})).filter(t=>t.agents.length>0):n,[n,g]),v=u.useMemo(()=>{for(const[t,c]of d)if(c.agent.id===p)return{project:t,entry:c};return null},[d,p]),T=n.reduce((t,c)=>t+c.agents.length,0),_=T*H.length,z=(t,c)=>{A(t),c&&E(c),y(r=>new Set(r).add(t))},$=t=>{y(c=>{const r=new Set(c);return r.has(t)?r.delete(t):r.add(t),r}),A(t)};return s.jsxs("div",{className:"s-acon",children:[s.jsxs("div",{className:"ac-shell",children:[s.jsxs("aside",{className:"ac-tree",children:[s.jsxs("div",{className:"ac-treeHead",children:[s.jsx("span",{className:"ac-treeIco","aria-hidden":!0,children:"⌕"}),s.jsx("input",{className:"ac-treeFind",placeholder:"Filter agents…",value:M,onChange:t=>V(t.target.value)})]}),s.jsxs("div",{className:"ac-treeScroll",children:[D.map(t=>s.jsxs("div",{className:"ac-treeGroup",children:[s.jsxs("div",{className:"ac-treeProject",children:[s.jsx("span",{className:"ac-sigil",children:"/"}),t.slug,s.jsx("span",{className:"ac-treeProjectCount",children:t.agents.length})]}),t.agents.map(c=>{const r=I.has(c.agent.id),f=K(c),G=c.agent.id===p;return s.jsxs("div",{className:"ac-agentBlock",children:[s.jsxs("button",{type:"button",className:"ac-agent","data-open":r||void 0,onClick:()=>$(c.agent.id),children:[s.jsx("span",{className:"ac-agentChev","data-open":r||void 0,"aria-hidden":!0,children:"▸"}),s.jsx("span",{className:"ac-agentAvatar","aria-hidden":!0,children:s.jsx(B,{agent:{name:c.agent.name,harness:c.agent.harness,state:c.agent.state},placement:"node",size:16})}),s.jsx("span",{className:"ac-agentName","data-idle":f==="idle"||void 0,children:c.agent.name}),f==="needs"?s.jsx("span",{className:"ac-needs",children:"needs you"}):null,s.jsxs("span",{className:"ac-agentTail",children:[f!=="idle"?s.jsx("span",{className:"ac-dot","data-tone":f,"aria-hidden":!0}):null,c.agent.harness?s.jsx("span",{className:"ac-agentMark","aria-hidden":!0,children:s.jsx(S,{harness:c.agent.harness,size:11})}):null]})]}),r?s.jsx("div",{className:"ac-facets",children:H.map(j=>{const L=j.id==="conversations"?c.sessions.length:void 0,W=G&&F===j.id;return s.jsxs("button",{type:"button",className:"ac-facet","data-active":W||void 0,onClick:()=>z(c.agent.id,j.id),children:[s.jsx("span",{className:"ac-facetSigil","aria-hidden":!0,children:j.sigil}),s.jsx("span",{className:"ac-facetLabel",children:j.label}),L!=null?s.jsx("span",{className:"ac-facetCount",children:L}):null]},j.id)})}):null]},c.agent.id)})]},t.key)),o?s.jsx("button",{type:"button",className:"ac-newAgent",onClick:o,children:"+ new agent"}):null]})]}),s.jsx("main",{className:"ac-read",children:v?s.jsx(Y,{project:v.project,entry:v.entry,facet:F,onEdit:a,onInterrupt:l,onResetContext:i,onOpenConversation:m}):s.jsx("div",{className:"ac-empty",children:"No agents."})}),s.jsx("aside",{className:"ac-rail",children:v?s.jsx(ss,{entry:v.entry,onOpenConversation:m}):null})]}),s.jsxs("div",{className:"ac-foot",children:[s.jsx("span",{className:"ac-footStat",children:k(n.length,"project")}),s.jsx("span",{className:"ac-footSep",children:"·"}),s.jsx("span",{className:"ac-footStat",children:k(T,"agent")}),s.jsx("span",{className:"ac-footSep",children:"·"}),s.jsx("span",{className:"ac-footStat",children:k(_,"facet")})]})]})}function Y({project:n,entry:e,facet:a,onEdit:l,onInterrupt:i,onResetContext:m,onOpenConversation:o}){const{agent:d,config:x}=e,p=e.status==="in_turn"||e.status==="in_flight";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"ac-readHead",children:[s.jsxs("div",{className:"ac-crumb",children:[s.jsx("span",{className:"ac-crumbDim",children:n.slug}),s.jsx("span",{className:"ac-crumbSep",children:"/"}),s.jsxs("span",{className:"ac-crumbAgent",children:["@",d.name]}),s.jsx("span",{className:"ac-crumbSep",children:"/"}),s.jsx("span",{className:"ac-crumbFacet",children:q[a]})]}),s.jsxs("div",{className:"ac-readActions",children:[(a==="prompt"||a==="config")&&l&&x.editable?s.jsx("button",{type:"button",className:"ac-actPrimary",onClick:()=>l(d.id),children:"Edit"}):null,p&&i?s.jsx("button",{type:"button",className:"ac-act",onClick:()=>i(d.id),children:"Interrupt"}):null,a==="context"&&m?s.jsx("button",{type:"button",className:"ac-act",onClick:()=>m(d.id),children:"Reset"}):null,o?s.jsx("button",{type:"button",className:"ac-act",onClick:()=>o(d.id),children:"Open ↗"}):null]})]}),s.jsxs("div",{className:"ac-metaStrip",children:[s.jsx(b,{k:"Type",v:Q(a)}),x.model?s.jsx(b,{k:"Model",v:x.model,mono:!0}):null,s.jsx(b,{k:"Editable",v:x.editable?"yes":"read-only"}),e.lastActivityAt?s.jsx(b,{k:"Active",v:C(e.lastActivityAt)}):null]}),s.jsxs("div",{className:"ac-readBody",children:[a==="prompt"?s.jsx(J,{entry:e}):null,a==="config"?s.jsx(X,{entry:e}):null,a==="conversations"?s.jsx(Z,{entry:e,onOpenConversation:o}):null,a==="context"?s.jsx(O,{entry:e}):null]})]})}function Q(n){switch(n){case"prompt":return"Markdown · system prompt";case"config":return"Runtime config";case"conversations":return"Conversation list";case"context":return"Live context window"}}function J({entry:n}){const{agent:e,config:a}=n,l=a.systemPrompt.trim()||a.templateHint||"default template",i=!a.systemPrompt.trim();return s.jsxs("div",{className:"ac-doc",children:[s.jsxs("div",{className:"ac-docHead",children:[s.jsx("span",{className:"ac-docKey",children:"name"}),s.jsx("span",{className:"ac-docVal",children:e.name}),e.role?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ac-docKey",children:"role"}),s.jsx("span",{className:"ac-docVal",children:R(e.role)??e.role})]}):null,s.jsx("span",{className:"ac-docKey",children:"harness"}),s.jsx("span",{className:"ac-docVal",children:w(e.harness)}),a.model?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ac-docKey",children:"model"}),s.jsx("span",{className:"ac-docVal",children:a.model})]}):null]}),s.jsx("div",{className:"ac-docLabel",children:i?"Default template":"System prompt"}),s.jsx("pre",{className:"ac-prose","data-default":i||void 0,children:l})]})}function X({entry:n}){const{agent:e,config:a}=n;return s.jsxs("div",{className:"ac-config",children:[s.jsxs(N,{k:"Harness",children:[s.jsx("span",{className:"ac-inlineMark",children:s.jsx(S,{harness:e.harness,size:12})}),w(e.harness)]}),s.jsx(N,{k:"Model",children:a.model??"—"}),s.jsx(N,{k:"Permissions",children:a.permission??"default"}),s.jsx(N,{k:"Transport",children:a.runtime.transport}),s.jsx(N,{k:"Workdir",mono:!0,title:a.runtime.cwd,children:U(a.runtime.cwd)||a.runtime.cwd}),s.jsx(N,{k:"Session",mono:!0,children:a.runtime.sessionId}),a.launchArgs.length?s.jsxs("div",{className:"ac-configBlock",children:[s.jsx("div",{className:"ac-configKey",children:"Launch"}),s.jsxs("pre",{className:"ac-cmd",children:[a.runtime.harness," ",a.launchArgs.join(" ")]})]}):null,a.capabilities.length?s.jsxs("div",{className:"ac-configBlock",children:[s.jsx("div",{className:"ac-configKey",children:"Capabilities"}),s.jsx("div",{className:"ac-chips",children:a.capabilities.map(l=>s.jsx("span",{className:"ac-chip",children:l},l))})]}):null]})}function Z({entry:n,onOpenConversation:e}){return n.sessions.length?s.jsx("div",{className:"ac-convos",children:n.sessions.map(a=>s.jsxs("button",{type:"button",className:"ac-convo",disabled:!e,onClick:()=>e?.(n.agent.id,a.id),children:[s.jsx("span",{className:"ac-convoDot","aria-hidden":!0}),s.jsxs("span",{className:"ac-convoBody",children:[s.jsx("span",{className:"ac-convoTitle",children:a.title||a.preview||"Conversation"}),a.preview&&a.title?s.jsx("span",{className:"ac-convoPreview",children:a.preview}):null,s.jsxs("span",{className:"ac-convoMeta",children:[a.currentBranch?s.jsx("span",{className:"ac-convoBranch",children:a.currentBranch}):null,s.jsxs("span",{children:[a.messageCount," msgs"]}),a.lastMessageAt?s.jsx("span",{children:C(a.lastMessageAt)}):null]})]})]},a.id))}):s.jsx("div",{className:"ac-empty",children:"No conversations yet."})}function O({entry:n}){const e=n.context;if(!e)return s.jsx("div",{className:"ac-empty",children:"No live context — agent is not in an active session."});const a=e.usedPercent!=null?Math.round(e.usedPercent):null;return s.jsxs("div",{className:"ac-ctx",children:[s.jsxs("div",{className:"ac-ctxTop",children:[s.jsx("span",{className:"ac-ctxState","data-state":e.state,children:e.state}),s.jsxs("span",{className:"ac-ctxTurns",children:[e.turnCount," turns"]})]}),a!=null?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"ac-ctxGauge",children:s.jsx("span",{className:"ac-ctxFill",style:{width:`${Math.min(100,a)}%`}})}),s.jsxs("div",{className:"ac-ctxRead",children:[s.jsxs("span",{className:"ac-ctxNum",children:[a,"%"]}),s.jsx("span",{className:"ac-ctxDim",children:"of context window used"})]})]}):null,e.contextInputTokens!=null&&e.contextWindowTokens!=null?s.jsxs("div",{className:"ac-ctxTokens",children:[e.contextInputTokens.toLocaleString()," / ",e.contextWindowTokens.toLocaleString()," ","tokens"]}):null]})}function ss({entry:n,onOpenConversation:e}){const{agent:a,config:l}=n,i=K(n),m=a.ownerName||a.ownerHandle||null;return s.jsxs("div",{className:"ac-railInner",children:[s.jsxs("div",{className:"ac-railIdent",children:[s.jsx("span",{className:"ac-railAvatar","aria-hidden":!0,children:s.jsx(B,{agent:{name:a.name,harness:a.harness,state:a.state},placement:"inspector"})}),s.jsxs("div",{className:"ac-railNames",children:[s.jsxs("div",{className:"ac-railName",children:["@",a.name]}),a.role?s.jsx("div",{className:"ac-railRole",children:R(a.role)??a.role}):null]})]}),s.jsxs("div",{className:"ac-railState","data-tone":i==="idle"?void 0:i,children:[i!=="idle"?s.jsx("span",{className:"ac-dot","data-tone":i,"aria-hidden":!0}):null,s.jsx("span",{children:n.needsYou?"Needs you":P(a.state)})]}),n.activeTask?s.jsx("div",{className:"ac-railTask",children:n.activeTask}):null,s.jsxs("div",{className:"ac-railGroup",children:[s.jsx(h,{k:"Harness",v:w(a.harness),mark:a.harness}),s.jsx(h,{k:"Model",v:l.model??"—"}),m?s.jsx(h,{k:"Owner",v:m}):null,a.branch?s.jsx(h,{k:"Branch",v:a.branch,mono:!0}):null,s.jsx(h,{k:"State",v:P(a.state)}),a.updatedAt?s.jsx(h,{k:"Updated",v:C(a.updatedAt)}):null,s.jsx(h,{k:"Sessions",v:String(n.sessions.length)})]}),l.permission?s.jsxs("div",{className:"ac-railSub",children:[s.jsx("div",{className:"ac-railSubHead",children:"Permissions"}),s.jsx("span",{className:"ac-chip",children:l.permission})]}):null,l.capabilities.length?s.jsxs("div",{className:"ac-railSub",children:[s.jsxs("div",{className:"ac-railSubHead",children:["Capabilities · ",l.capabilities.length]}),s.jsx("div",{className:"ac-chips",children:l.capabilities.map(o=>s.jsx("span",{className:"ac-chip",children:o},o))})]}):null,a.conversationId&&e?s.jsx("button",{type:"button",className:"ac-railOpen",onClick:()=>e(a.id),children:"Open conversation →"}):null]})}function b({k:n,v:e,mono:a}){return s.jsxs("span",{className:"ac-metaItem",children:[s.jsx("span",{className:"ac-metaKey",children:n}),s.jsx("span",{className:"ac-metaVal","data-mono":a||void 0,children:e})]})}function N({k:n,children:e,mono:a,title:l}){return s.jsxs("div",{className:"ac-configRow",children:[s.jsx("span",{className:"ac-configKey",children:n}),s.jsx("span",{className:"ac-configVal","data-mono":a||void 0,title:l,children:e})]})}function h({k:n,v:e,mono:a,mark:l}){return s.jsxs("div",{className:"ac-railFact",children:[s.jsx("span",{className:"ac-railFactKey",children:n}),s.jsxs("span",{className:"ac-railFactVal","data-mono":a||void 0,children:[l?s.jsx("span",{className:"ac-inlineMark",children:s.jsx(S,{harness:l,size:11})}):null,e]})]})}export{qs as AgentsConsole};
@@ -1 +0,0 @@
1
- import{j as e,r as d}from"./index-C8uS5szO.js";import{p as S,a as E}from"./api-CaROe5_H.js";import{b as W}from"./machine-scope-DJt9RZ2w.js";import{d as X,b as Y}from"./router-BKiMcYa7.js";import{a as J}from"./sse-v5QLsOHV.js";import{o as Q,i as C}from"./surface-activity-B1rgWB1i.js";import{u as Z}from"./Provider-5Hotn7NQ.js";/* empty css */import{AgentsSubnav as ee}from"./AgentsSubnav-BOobgtGE.js";import{AgentsLibrary as te}from"./library-DLKBVUJ6.js";import{r as se,d as oe}from"./NewChatComposer-JjLbm3W2.js";import{AgentDetailWithRail as ie,AgentProfileBar as ne}from"./profile-C3KgiZvc.js";/* empty css *//* empty css *//* empty css */import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./index-BWHgHrtv.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./time-Dhsh_2EG.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./createLucideIcon-DkjnzvcJ.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./file-text-ChtICwub.js";import"./x-DI1ktCYb.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"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CXfav14z.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./SecondaryNav-BkTn5tkq.js";import"./secondaryNavConfig-DAXIFtVd.js";import"./nav-destinations-CyXnw9kh.js";import"./message-square-NmXWtWLR.js";import"./terminal-96JWDYDL.js";import"./search-C4VlW_0l.js";import"./compass-DTZdCpv9.js";import"./settings-TJIkkZ0P.js";import"./git-branch-CA3cHKCI.js";import"./scroll-text-DwC8r2g6.js";/* empty css */import"./SpriteAvatar-BW1JzkDt.js";import"./HarnessMark-Bt47OeHy.js";import"./AgentSessions-Cox2zS-e.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./runtime-picker-DdsttHHc.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./conversation-model-BGFHoxQ0.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./NewChatOrigin-CyPPWTJP.js";import"./chevron-down-B5eMsn5c.js";import"./AgentAvatar-BIwg54Tj.js";import"./CrewAvatar-CJhuqTsJ.js";import"./context-budget-DemtXu7E.js";import"./session-catalog-s-T_w41t.js";import"./terminal-relay-Bfx8pg80.js";import"./BackToPicker-Bys9ColC.js";import"./ConversationScreen-tTP6B_F-.js";import"./ConversationComposer-B7RU6LKd.js";import"./zap-sKPkh4sQ.js";import"./message-markup-DgFSyb3f.js";import"./mentions-Ctw1ECUC.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./eye-CtqSV8BS.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-DGR4kOog.js";import"./sessionRead-CvFz2RHv.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-CCSU8uo_.js";import"./AstronautSuit-C-4I5YKi.js";import"./panel-right-BNTJhy8M.js";import"./CommsFlowGraph-Czg-KTS0.js";import"./comms-gesture-_aGFo6g3.js";import"./CommsCanvas-DOKw3Q8i.js";import"./comms-deck-CBhsXnY-.js";import"./CommsFlowMap-CzBWvSa5.js";import"./CommsSelection-g1twA-Lb.js";/* empty css */import"./use-conversation-list-A_YUf8lo.js";import"./agent-master-model-C-KdOFDK.js";import"./use-beside-Df-F2Uvg.js";import"./ConversationFeedRows-DVqnZQH0.js";import"./ConversationPanels-C9yCAoJy.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-D7n3vK8t.js";import"./proxy-DOG46ja4.js";import"./activity-CSUhvjD0.js";import"./message-circle-CSiJj6yo.js";import"./tail-events-DQ46QBW1.js";import"./ConversationStatus-CK-YfLpi.js";import"./check-B8dMv3Is.js";import"./sparkles-BbOFw3d0.js";import"./SessionObserve-DaqDhqDI.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-Czggx8oM.js";import"./LaneToolHoverCard-C6YehJqD.js";import"./lane-observe-BD21P8BB.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-DkEkQzo-.js";import"./ObserveTextFlow-ET0dD1wO.js";import"./SessionObserveEvidence-Drv-D8Oh.js";import"./wrench-BsMTSeji.js";import"./external-link-RT4Ph-6-.js";import"./AgentDefinitionsWorkspace-CwZJ833X.js";import"./agent-specialization-CiVxQsFT.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-HtiDbj9N.js";/* empty css */import"./agent-essentials-8t2il7PV.js";const U=new Set(["0","false","off","no","clear","none"]),re=new Set(["1","true","on","yes"]),ae=new Set(["localhost","127.0.0.1","::1"]);function de(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function M(t){const o=t?.trim().toLowerCase();return o==="before"||o==="after"?o:null}function V(t){if(!t)return null;const o=t.trim().toLowerCase();return re.has(o)?!0:U.has(o)?!1:null}function L(t,o,n=[]){const r=V(t);if(r!==null)return r;if(!t)return null;const l=o.toLowerCase(),a=new Set([l,l.replace(/-/g,""),...n.map(i=>i.trim().toLowerCase()).filter(Boolean)]),s=t.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean);return s.some(i=>U.has(i))?!1:s.some(i=>a.has(i))?!0:null}function le({studyId:t,aliases:o,href:n,storedEnabled:r,storedMode:l,dev:a,defaultMode:s="after"}){const i=n?new URL(n,"http://localhost"):null,p=L(i?.searchParams.get("studio"),t,o)??L(i?.searchParams.get(`studio.${t}`),t,o)??L(i?.searchParams.get("studioInjection"),t,o),c=i?ae.has(de(i.hostname)):!1;if(!a&&!c)return{enabled:!1,mode:s};const u=p??V(r)??!1,g=M(i?.searchParams.get("studioMode"))??M(i?.searchParams.get(`studioMode.${t}`))??M(l)??s;return{enabled:u,mode:g}}const ce="openscout.studio.inject.",me="openscout.studio.mode.";function D(t){return`${ce}${t}`}function $(t){return`${me}${t}`}function I(t){if(typeof window>"u")return null;try{return window.localStorage.getItem(t)}catch{return null}}function O(t,o){if(!(typeof window>"u"))try{window.localStorage.setItem(t,o)}catch{}}function ue(){return import.meta.env?.DEV===!0}function pe(t){return t==="before"?"after":"before"}function he(t){typeof window>"u"||X({searchPatch:{studio:null,[`studio.${t}`]:null,studioInjection:null,studioMode:null,[`studioMode.${t}`]:null},replace:!0})}function fe(t,o=[]){const[n,r]=d.useState(()=>le({studyId:t,aliases:o,href:typeof window>"u"?void 0:window.location.href,storedEnabled:I(D(t)),storedMode:I($(t)),dev:ue()})),[l,a]=d.useState(!1);d.useEffect(()=>{if(!n.enabled){a(!1);return}const c=j=>{j.altKey&&a(!0)},u=j=>{j.altKey||a(!1)},g=()=>a(!1);return window.addEventListener("keydown",c),window.addEventListener("keyup",u),window.addEventListener("blur",g),()=>{window.removeEventListener("keydown",c),window.removeEventListener("keyup",u),window.removeEventListener("blur",g)}},[n.enabled]);const s=d.useCallback(c=>{O(D(t),c?"1":"0"),r(u=>({...u,enabled:c}))},[t]),i=d.useCallback(c=>{O($(t),c),r(u=>({...u,mode:c}))},[t]),p=l?pe(n.mode):n.mode;return d.useMemo(()=>({...n,renderedMode:p,peeking:p!==n.mode,setEnabled:s,setMode:i}),[p,s,i,n])}function ge({studyId:t,aliases:o,anchor:n,title:r,children:l,renderStudy:a}){const s=fe(t,o);return s.enabled?e.jsxs("div",{className:"s-studio-injection","data-studio-anchor":n,children:[e.jsxs("div",{className:"s-studio-injection-bar",children:[e.jsxs("div",{className:"s-studio-injection-label",children:[e.jsx("span",{className:"s-studio-injection-kicker",children:"Studio injection"}),e.jsx("span",{className:"s-studio-injection-title",children:r}),e.jsx("span",{className:"s-studio-injection-anchor",children:n})]}),e.jsxs("div",{className:"s-studio-injection-controls",role:"group","aria-label":`${r} mode`,children:[e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="before","aria-pressed":s.mode==="before",onClick:()=>s.setMode("before"),children:"Before"}),e.jsx("button",{type:"button",className:"s-studio-injection-mode","data-active":s.mode==="after","aria-pressed":s.mode==="after",onClick:()=>s.setMode("after"),children:"After"})]}),e.jsx("span",{className:"s-studio-injection-state",children:s.peeking?`Option: ${s.renderedMode}`:s.renderedMode}),e.jsx("button",{type:"button",className:"s-studio-injection-close",onClick:()=>{he(t),s.setEnabled(!1)},children:"Close"})]}),e.jsx("div",{className:"s-studio-injection-body","data-studio-mode":s.renderedMode,children:s.renderedMode==="before"?l:a()})]}):e.jsx(e.Fragment,{children:l})}const b=[{id:"openscout",title:"openscout",root:"~/dev/openscout",signal:"Studio mode injection for agent directory",sessions:9,agents:[{id:"hudson",name:"Hudson",handle:"@hudson",state:"working",role:"web design system",branch:"feat/studio-mode",task:"Refactoring the agent directory into insertion points",last:"18s"},{id:"scout",name:"Scout",handle:"@scout",state:"attention",role:"operator assistant",branch:"main",task:"Needs placement decision",last:"1m"},{id:"quill",name:"Quill",handle:"@quill",state:"ready",role:"docs",branch:"docs/agent-view",task:"Ready to write the study summary",last:"7m"}]},{id:"hudson",title:"hudson",root:"~/dev/hudson",signal:"Slot contracts and chrome primitives",sessions:4,agents:[{id:"atlas",name:"Atlas",handle:"@atlas",state:"working",role:"framework",branch:"slots/studio-anchor",task:"Mapping chrome slots to page anchors",last:"3m"},{id:"mira",name:"Mira",handle:"@mira",state:"ready",role:"qa",branch:"main",task:"Idle",last:"12m"}]},{id:"lattices",title:"lattices",root:"~/dev/lattices",signal:"macOS web view parity pass",sessions:2,agents:[{id:"north",name:"North",handle:"@north",state:"offline",role:"native",branch:"main",task:"No active session",last:"1h"}]}],je={working:"working",ready:"ready",attention:"attention",offline:"offline"};function xe({children:t}){return e.jsx(ge,{studyId:"agent-directory",aliases:["agents","agent","agent-directory-before-after"],anchor:"agents.directory",title:"Agent Directory",renderStudy:()=>e.jsx(ve,{}),children:t})}function ve(){const t=b.flatMap(s=>s.agents),o=t.filter(s=>s.state==="working"),n=t.filter(s=>s.state==="ready"),r=t.filter(s=>s.state==="attention"),l=b.reduce((s,i)=>s+i.sessions,0),a=o[0]??t[0];return e.jsxs("section",{className:"s-agent-studio-study","aria-label":"Agent directory injected study",children:[e.jsxs("div",{className:"s-agent-studio-banner",children:[e.jsx("span",{children:"After study"}),e.jsx("strong",{children:"Injected static view inside the live Agents route"}),e.jsx("em",{children:"Fixture data · insertion-point prototype · no backend writes"})]}),e.jsxs("header",{className:"s-agent-studio-head","data-studio-anchor":"agent.directory.header",children:[e.jsxs("div",{className:"s-agent-studio-title-block",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Studio / agents.directory / after"}),e.jsx("h1",{className:"s-agent-studio-title",children:"Project command center"}),e.jsxs("span",{className:"s-agent-studio-subtitle",children:[t.length," agents across ",b.length," projects"]})]}),e.jsxs("div",{className:"s-agent-studio-metrics","aria-label":"Agent study summary",children:[e.jsx(y,{label:"working",value:o.length,tone:"working"}),e.jsx(y,{label:"ready",value:n.length}),e.jsx(y,{label:"attention",value:r.length,tone:"attention"}),e.jsx(y,{label:"sessions",value:l})]})]}),e.jsxs("div",{className:"s-agent-studio-layout",children:[e.jsxs("div",{className:"s-agent-studio-main",children:[e.jsxs("section",{className:"s-agent-studio-pressure","data-studio-anchor":"agent.active-strip",children:[e.jsxs("div",{className:"s-agent-studio-section-head",children:[e.jsx("span",{children:"Pressure queue"}),e.jsx("strong",{children:o.length+r.length})]}),e.jsx("div",{className:"s-agent-studio-pressure-list",children:[...o,...r].map(s=>e.jsxs("article",{className:`s-agent-studio-pressure-card s-agent-studio-pressure-card--${s.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":s.state}),e.jsxs("div",{className:"s-agent-studio-pressure-copy",children:[e.jsx("strong",{children:s.name}),e.jsx("span",{children:s.task})]}),e.jsx("time",{children:s.last})]},s.id))})]}),e.jsx("section",{className:"s-agent-studio-projects","data-studio-anchor":"agent.project-board",children:b.map(s=>e.jsxs("article",{className:"s-agent-studio-project",children:[e.jsxs("div",{className:"s-agent-studio-project-main",children:[e.jsxs("div",{children:[e.jsx("span",{className:"s-agent-studio-project-root",children:s.root}),e.jsx("h2",{children:s.title})]}),e.jsxs("span",{className:"s-agent-studio-project-sessions",children:[s.sessions," sessions"]})]}),e.jsx("p",{children:s.signal}),e.jsx("div",{className:"s-agent-studio-agent-row",children:s.agents.map(i=>e.jsxs("span",{className:`s-agent-studio-agent-pill s-agent-studio-agent-pill--${i.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":i.state}),i.name]},i.id))})]},s.id))})]}),e.jsxs("aside",{className:"s-agent-studio-detail","data-studio-anchor":"agent.detail-preview",children:[e.jsx("span",{className:"s-agent-studio-kicker",children:"Pinned agent"}),e.jsx("h2",{children:a.name}),e.jsx("span",{className:`s-agent-studio-state s-agent-studio-state--${a.state}`,children:je[a.state]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Handle"}),e.jsx("dd",{children:a.handle})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Role"}),e.jsx("dd",{children:a.role})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Branch"}),e.jsx("dd",{children:a.branch})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Current task"}),e.jsx("dd",{children:a.task})]})]})]})]})]})}function y({label:t,value:o,tone:n}){return e.jsxs("div",{className:`s-agent-studio-metric${n?` s-agent-studio-metric--${n}`:""}`,children:[e.jsx("strong",{children:o}),e.jsx("span",{children:t})]})}const R="/api/conversations",T="/api/fleet",H="/api/tail/discover",N=3e4;function $s({navigate:t,selectedAgentId:o,conversationId:n,tab:r,activeRoute:l}){const{agents:a,agentsLoaded:s,route:i}=Z(),[p,c]=d.useState(()=>S(R,N)??[]),[u,g]=d.useState(()=>S(T,N)),[j,K]=d.useState(()=>S(H,N)),[z,q]=d.useState(()=>S(R,N)===null),P=Y(i),A=d.useMemo(()=>W(a,P),[a,P]),x=d.useCallback(async()=>{const[h,f,w]=await Promise.allSettled([E(R),E(T),E(H)]);h.status==="fulfilled"&&c(h.value),f.status==="fulfilled"&&g(f.value),w.status==="fulfilled"&&K(w.value),q(!1)},[]);d.useEffect(()=>{x()},[x]),d.useEffect(()=>{const h=()=>{C()&&x()},f=window.setInterval(h,1e4),w=Q(h);return()=>{window.clearInterval(f),w()}},[x]),J(()=>!0,()=>{C()&&x()});const m=se(A,o),B=!!(o&&m&&m.id!==o),v=i.view==="agents-v2"?i.projectSlug:void 0,k=!!(v&&!r),{conversationByAgentId:_,sessionByAgentId:G}=d.useMemo(()=>oe(p),[p]);if(d.useEffect(()=>{!o||!m||!B||t({view:"agents-v2",agentId:m.id,...k&&v?{projectSlug:v}:{},...n?{conversationId:n}:{},...r?{tab:r}:{}})},[n,r,k,t,v,m,o,B]),m&&!k){const h=n??_.get(m.id)??m.conversationId??null,f=r??(n?"message":"profile");return e.jsx(F,{activeRoute:l??i,navigate:t,bar:e.jsx(ne,{agent:m,conversationId:h,activeTab:f,navigate:t}),children:e.jsx(ie,{agent:m,allAgents:A,conversationId:h,navigate:t,activeTab:f})})}return e.jsx(F,{activeRoute:l??i,navigate:t,children:e.jsx(xe,{children:e.jsx(te,{agents:A,fleet:u,sessionByAgentId:G,conversationByAgentId:_,sessions:p,discovery:j,loading:!s||z,navigate:t,selectedAgentId:m?.id??o})})})}function F({activeRoute:t,children:o,navigate:n,bar:r}){return e.jsxs("div",{className:"s-secondary-nav-shell",children:[e.jsx("div",{className:"s-secondary-nav-bar",children:r??e.jsx(ee,{activeRoute:t,navigate:n})}),e.jsx("div",{className:"s-secondary-nav-body",children:o})]})}export{$s as AgentsScreen};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-C8uS5szO.js";import{S as i}from"./SecondaryNav-BkTn5tkq.js";import{A as m}from"./secondaryNavConfig-DAXIFtVd.js";import"./nav-destinations-CyXnw9kh.js";import"./createLucideIcon-DkjnzvcJ.js";import"./message-square-NmXWtWLR.js";import"./terminal-96JWDYDL.js";import"./search-C4VlW_0l.js";import"./compass-DTZdCpv9.js";import"./settings-TJIkkZ0P.js";import"./file-text-ChtICwub.js";import"./git-branch-CA3cHKCI.js";import"./code-xml-BmyLM0I2.js";import"./scroll-text-DwC8r2g6.js";function E({activeRoute:r,navigate:o}){return t.jsx(i,{ariaLabel:"Agents sections",activeRoute:r,groups:m,navigate:o})}export{E as AgentsSubnav};
@@ -1 +0,0 @@
1
- import{r as o,j as e}from"./index-C8uS5szO.js";import{E as p}from"./EmptyState-uyYN5piI.js";import{a as f}from"./api-CaROe5_H.js";import{S as b}from"./scoutbot-markdown-Bz0Vbto2.js";import{b as h,t as u}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */import"./Provider-5Hotn7NQ.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"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-JjLbm3W2.js";import"./runtime-picker-DdsttHHc.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DurUYl7E.js";import"./createLucideIcon-DkjnzvcJ.js";import"./conversation-model-BGFHoxQ0.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./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"./external-link-RT4Ph-6-.js";const g={"fleet-home":"fleet briefing",tour:"tour briefing"};function je({briefingId:s,navigate:i}){const[r,n]=o.useState(null),[t,a]=o.useState(null),c=o.useCallback(async()=>{try{const d=await f(`/api/briefings/${encodeURIComponent(s)}`);n(d),a(null)}catch(d){a(d instanceof Error?d.message:"Failed to load briefing")}},[s]);return o.useEffect(()=>{c()},[c]),t?e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide",children:[e.jsx("button",{type:"button",className:"briefing-detail-back",onClick:()=>i({view:"briefings"}),children:"← back to briefings"}),e.jsx(p,{title:"Couldn't load briefing",body:t})]}):r?e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide briefing-detail",children:[e.jsx("button",{type:"button",className:"briefing-detail-back",onClick:()=>i({view:"briefings"}),children:"← back to briefings"}),e.jsxs("header",{className:"briefing-detail-header",children:[e.jsx("h2",{children:r.title}),e.jsxs("div",{className:"briefing-detail-header-meta",children:[e.jsx("span",{className:`briefing-kind briefing-kind-${r.kind}`,children:g[r.kind]}),e.jsx("span",{children:h(r.preparedAt)}),e.jsxs("span",{children:["· ",u(r.preparedAt)]})]}),e.jsx("p",{className:"briefing-detail-summary",children:r.summary}),r.recommendation?e.jsx("div",{className:"briefing-detail-recommendation",children:r.recommendation}):null]}),r.markdown?e.jsx(x,{markdown:r.markdown}):null,r.brief?.presented?e.jsx(y,{presented:r.brief.presented}):null,e.jsx(j,{call:r.call}),e.jsx(N,{brief:r.brief,navigate:i}),e.jsx(k,{observations:r.observations,navigate:i}),e.jsx(v,{snapshot:r.snapshot,call:r.call})]}):e.jsx("div",{className:"sys-surface-page sys-surface-page-wide",children:e.jsx("div",{className:"briefings-placeholder",children:"Loading briefing..."})})}function x({markdown:s}){return e.jsxs("section",{className:"briefing-layer briefing-layer-markdown",children:[e.jsx(l,{eyebrow:"Layer 0",title:"Brief (markdown)"}),e.jsx("div",{className:"briefing-markdown",children:e.jsx(b,{text:s})})]})}function j({call:s}){return!s||!s.telemetry&&!s.presenter?null:e.jsxs("section",{className:"briefing-layer briefing-layer-telemetry",children:[e.jsx(l,{eyebrow:"Telemetry",title:"Calls & usage"}),e.jsxs("dl",{className:"briefing-telemetry",children:[e.jsx(m,{label:"Analyst",model:s.model,responseId:s.responseId,telemetry:s.telemetry??null}),s.presenter?e.jsx(m,{label:"Presenter",model:s.presenter.model,responseId:s.presenter.responseId,telemetry:s.presenter,note:s.presenter.skipped==="rate-guard"?"skipped — rate-guard hit":s.presenter.skipped==="error"?`failed — ${s.presenter.errorMessage??"unknown"}`:null}):null]})]})}function m({label:s,model:i,responseId:r,telemetry:n,note:t}){const a=n?.usage??null;return e.jsxs("div",{className:"briefing-telemetry-row",children:[e.jsxs("div",{className:"briefing-telemetry-row-head",children:[e.jsx("span",{className:"briefing-telemetry-label",children:s}),e.jsx("span",{className:"briefing-telemetry-model",children:i}),t?e.jsx("span",{className:"briefing-telemetry-note",children:t}):null]}),e.jsxs("div",{className:"briefing-telemetry-stats",children:[e.jsx("span",{children:n&&n.elapsedMs>0?`${(n.elapsedMs/1e3).toFixed(2)}s`:"—"}),e.jsxs("span",{children:["in ",a?.inputTokens??"—"]}),e.jsxs("span",{children:["out ",a?.outputTokens??"—"]}),e.jsxs("span",{children:["total ",a?.totalTokens??"—"]}),r?e.jsx("span",{className:"briefing-telemetry-response",children:r}):null]})]})}function y({presented:s}){return e.jsxs("section",{className:"briefing-layer briefing-layer-presented",children:[e.jsx(l,{eyebrow:"Spoken",title:`Presented as · ${s.voiceSpec.persona}, ~${s.voiceSpec.targetWords} words`}),e.jsx("ol",{className:"briefing-presented-sentences",children:s.sentences.map((i,r)=>e.jsx("li",{className:"briefing-presented-sentence",children:i},r))}),e.jsxs("div",{className:"briefing-presented-meta",children:["model: ",s.model,s.responseId?` · response: ${s.responseId}`:""]})]})}function N({brief:s,navigate:i}){return s?e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 3",title:"Brief"}),s.steps.length>0?e.jsx("ol",{className:"briefing-steps",children:s.steps.map((r,n)=>e.jsxs("li",{className:"briefing-step",children:[e.jsxs("div",{className:"briefing-step-label",children:[n+1,". ",r.label]}),r.narration?e.jsx("p",{className:"briefing-step-narration",children:r.narration}):null]},r.id??n))}):null,s.actions.length>0?e.jsx("div",{className:"briefing-actions",children:s.actions.map((r,n)=>e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{r.route&&i(r.route)},children:r.label},`${r.label}-${n}`))}):null]}):e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 3",title:"Brief & call"}),e.jsx("p",{className:"briefings-placeholder",children:"No brief body persisted."})]})}function k({observations:s,navigate:i}){return e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 2",title:`Observations (${s.length})`}),s.length===0?e.jsx("p",{className:"briefings-placeholder",children:"No observations on this brief."}):e.jsx("div",{className:"briefing-observations",children:s.map((r,n)=>{const t=r.tone==="warn"?"briefing-observation-warn":r.tone==="err"||r.tone==="error"?"briefing-observation-err":"";return e.jsxs("div",{className:`briefing-observation ${t}`.trim(),children:[e.jsx("div",{className:"briefing-observation-text",children:r.text}),r.references.length>0?e.jsx("div",{className:"briefing-observation-refs",children:r.references.map((a,c)=>e.jsx(w,{reference:a,navigate:i},`${a.label}-${c}`))}):null]},n)})})]})}function w({reference:s,navigate:i}){const r=!!s.route,n=s.detail?`${s.label} · ${s.detail}`:s.label;return r?e.jsx("button",{type:"button",className:"briefing-ref-chip",onClick:()=>i(s.route),children:n}):e.jsx("span",{className:"briefing-ref-chip briefing-ref-chip-static",children:n})}function v({snapshot:s,call:i}){const r=o.useMemo(()=>C(s),[s]),[n,t]=o.useState(!1);return e.jsxs("section",{className:"briefing-layer",children:[e.jsx(l,{eyebrow:"Layer 1",title:"Read snapshot"}),r.length>0?e.jsx("div",{className:"briefing-snapshot-counts",children:r.map(a=>e.jsxs("span",{className:"briefing-snapshot-count",children:[e.jsx("strong",{children:a.value})," ",a.label]},a.label))}):null,i?e.jsxs("details",{className:"briefing-snapshot-section",children:[e.jsx("summary",{className:"briefing-snapshot-section-head",children:"Call metadata"}),e.jsxs("dl",{className:"briefing-call-grid",children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{children:i.model}),e.jsx("dt",{children:"Response ID"}),e.jsx("dd",{children:i.responseId??"—"}),e.jsx("dt",{children:"System prompt"}),e.jsx("dd",{children:e.jsx("pre",{className:"briefing-call-prompt",children:i.systemPrompt})}),e.jsx("dt",{children:"Operator request"}),e.jsx("dd",{children:e.jsx("pre",{className:"briefing-call-prompt",children:i.operatorRequest})})]})]}):null,e.jsxs("div",{className:"briefing-snapshot-section",children:[e.jsx("button",{type:"button",className:"briefing-detail-back",onClick:()=>t(a=>!a),children:n?"Hide raw snapshot":"Show raw snapshot JSON"}),n?e.jsx("pre",{className:"briefing-snapshot-raw",children:JSON.stringify(s??{},null,2)}):null]})]})}function l({eyebrow:s,title:i}){return e.jsxs("div",{className:"briefing-layer-head",children:[e.jsx("span",{className:"briefing-layer-eyebrow",children:s}),e.jsx("span",{className:"briefing-layer-title",children:i})]})}function C(s){if(!s?.state)return[];const i=s.state,r=[],n=(t,a)=>{Array.isArray(a)&&r.push({label:t,value:a.length})};if(n("agents",i.agents),i.fleet&&typeof i.fleet=="object"){const t=i.fleet;n("active requests",t.activeAsks),n("attention",t.needsAttention),n("recent",t.recentCompleted)}if(i.broker&&typeof i.broker=="object"){const t=i.broker;n("broker msgs",t.recentMessages)}if(n("scout chatter",i.scoutChatter),n("tail events",i.agentLogMessages),i.operatorAttention&&typeof i.operatorAttention=="object"){const t=i.operatorAttention;n("operator items",t.items)}return r}export{je as BriefingDetailScreen};
@@ -1,8 +0,0 @@
1
- import{r as t,j as e}from"./index-C8uS5szO.js";import{r as xs}from"./index-C5cX8dkl.js";import{D as js}from"./runtime-picker-DdsttHHc.js";import{E as Ee}from"./EmptyState-uyYN5piI.js";import"./router-BKiMcYa7.js";import{B as ks,j as vs,F as ws,R as Ns,G as Ss,H as Is}from"./NewChatComposer-JjLbm3W2.js";import{p as As,a as ie}from"./api-CaROe5_H.js";import{c as Rs}from"./clipboard-e3fSpeo7.js";import{u as Cs}from"./sse-v5QLsOHV.js";import{b as ze}from"./status-tone-BM_zuRy1.js";import{t as Fe,b as ns,n as ee}from"./time-Dhsh_2EG.js";import{u as os}from"./Provider-5Hotn7NQ.js";import{o as Ye}from"./openContent-C6XO6kr5.js";import{g as $s,b as le,h as is,d as Ds,i as Es,j as Fs,k as Ms}from"./broker-display-BkBzyvbR.js";import{BrokerMetadataPanel as Ts}from"./BrokerMetadataPanel-1GoSl2BV.js";import{DispatchAftermath as Ls}from"./DispatchAftermath-DDlwqSCY.js";import{i as Ps,c as Bs,n as Xe}from"./keyboard-nav-CXfav14z.js";import{ShikiPane as zs}from"./ShikiPane-BudrOxNK.js";import{d as Os}from"./types-B0PlfpKc.js";import{u as _s}from"./useEmbedHeadline-BL8wQawZ.js";/* empty css */import{L as ke}from"./loader-circle-DurUYl7E.js";import{R as qs}from"./refresh-cw-Da9DDLk2.js";import{X as Me}from"./x-DI1ktCYb.js";import{A as Us}from"./arrow-down-WoVlkUmg.js";import{E as Ze}from"./external-link-RT4Ph-6-.js";import{M as ls}from"./message-square-NmXWtWLR.js";import{A as Te}from"./arrow-right-ldbfp4SZ.js";import{c as Oe}from"./createLucideIcon-DkjnzvcJ.js";import{P as Ks}from"./plus-D_wLGJGT.js";import{C as es}from"./chevron-down-B5eMsn5c.js";import{S as Hs}from"./send-horizontal-pOtGI7FM.js";import{C as Js}from"./check-B8dMv3Is.js";import{C as Gs}from"./copy-D9WUpQRf.js";import{R as Qs}from"./radio-C_jtwbFP.js";import{M as Vs,a as Ws}from"./DocumentFocusViewer-f12RRQpV.js";const Ys=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Xs=Oe("at-sign",Ys);const Zs=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],er=Oe("hash",Zs);const sr=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],rr=Oe("paperclip",sr),ar=160;function De(s){const a=new URLSearchParams({limit:String(ar)});return s&&a.set("cursor",s),`/api/broker?${a.toString()}`}const ss={index:-1,request:0};function tr(s,a){return{index:a,request:s.request+1}}function cs(s,a){return a===s.index?s:{index:a,request:s.request}}function nr(s,a){return s.index<a?s:cs(s,a>0?a-1:-1)}function or(s,a){return s.request!==a}function ir({enabled:s,rowCount:a,onActivateRow:n,onClearSelection:o}){const[f,h]=t.useState(ss),b=f.index,p=t.useRef(new Map),j=t.useRef(ss.request),c=t.useCallback(y=>{h(u=>tr(u,typeof y=="function"?y(u.index):y))},[]),w=t.useCallback(y=>{h(u=>cs(u,typeof y=="function"?y(u.index):y))},[]);t.useEffect(()=>{if(!or(f,j.current)||(j.current=f.request,f.index<0))return;const y=p.current.get(f.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[f]),t.useEffect(()=>{h(y=>nr(y,a))},[a]);const I=t.useCallback((y,u)=>{u?p.current.set(y,u):p.current.delete(y)},[]);t.useEffect(()=>{if(!s)return;const y=u=>{if(document.querySelector(".sys-broker-page")&&!(Ps(u.target)||Bs())&&a!==0){if(u.key==="Escape"){o&&(u.preventDefault(),o(),w(-1));return}if(u.key==="ArrowDown"||u.key==="j"){u.preventDefault(),c(N=>Xe(N,a,1));return}if(u.key==="ArrowUp"||u.key==="k"){u.preventDefault(),c(N=>Xe(N,a,-1));return}if(u.key==="Home"||u.key==="g"&&!u.shiftKey){u.preventDefault(),c(0);return}if(u.key==="End"||u.key==="G"){u.preventDefault(),c(a-1);return}if(u.key==="Enter"||u.key===" "){const N=b<0?0:b;u.preventDefault(),c(N),n(N)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,c,n,o,a,w]);const F=t.useCallback(y=>({tabIndex:b===y?0:-1,ref:u=>I(y,u),onFocus:()=>w(y)}),[b,I,w]);return{focusedIndex:b,setFocusedIndex:w,getRowFocusProps:F}}const xe=["all","delivered","failed"],lr=3e4,cr={all:"All",delivered:"Delivered",failed:"Failed"};function dr(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function ds(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function Le(s){switch(ze(s.kind,s.status)){case"success":return"Delivered";case"danger":return"Failed";case"working":return"Pending";case"warning":return"Held";default:return s.status?s.status.charAt(0).toUpperCase()+s.status.slice(1):"Queued"}}function Ae(s){if(!s)return"··";const a=s.trim().split(/\s+/).filter(Boolean);if(a.length===0)return"··";const n=a[a.length-1];return/^\d+$/.test(n)?n.slice(-2):a.length>=2?(a[0][0]+a[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function ur(s){const a=ee(s)??0;return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ie(s){const a=ee(s);return a===null?"—":new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ce(s,a,n=0){if(!s||typeof s!="object"||Array.isArray(s)||n>3)return;const o=s;for(const f of a)if(o[f]!==void 0&&o[f]!==null)return o[f];for(const f of Object.values(o)){const h=Ce(f,a,n+1);if(h!==void 0)return h}}function O(s,...a){const n=Ce(s.metadata,a);return typeof n!="string"&&typeof n!="number"?null:String(n).trim()||null}function Re(s,...a){const n=Ce(s.metadata,a);return typeof n=="number"||typeof n=="string"?ee(n):null}function Pe(s){switch(s){case"dm":return"Direct · agent";case"channel":return"Channel";case"broadcast":return"Broadcast";case null:return"No route";default:return s.replaceAll("_"," ")}}function Be(s,a){if(a==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const n=O(s,"class","actorClass")?.toLowerCase();return n==="operator"||n==="human"?"Operator":n==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function rs(s){const a=Ce(s.metadata,["latencyMs","durationMs"]);if(typeof a=="number"&&Number.isFinite(a)&&a>=0)return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(a<1e4?1:0)}s`;const n=Re(s,"sentAt","createdAt")??ee(s.ts),o=Re(s,"deliveredAt","completedAt");if(n===null||o===null||o<n)return"—";const f=o-n;return f<1e3?`${f}ms`:`${(f/1e3).toFixed(f<1e4?1:0)}s`}function _e({route:s}){switch(s){case"channel":return e.jsx(er,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Qs,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Xs,{size:12,"aria-hidden":"true"});default:return e.jsx(ls,{size:12,"aria-hidden":"true"})}}function hr(s,a){if(!a)return null;const n=a.trim().replace(/^@/,"").toLowerCase();return s.find(o=>[o.id,o.name,o.handle,o.selector,o.defaultSelector,o.conversationId,o.harnessSessionId].some(f=>f?.trim().replace(/^@/,"").toLowerCase()===n))??null}function as(s,a,n){const o=n==="from"?s.actorName:s.target,f=hr(a,o),h=f?.name??o??(n==="from"?"Unknown":"No target"),b=f?"Agent":n==="to"&&s.conversationId?"Session route":Be(s,n);return{label:h,kind:b,agent:f}}function fr(s,a,n){const o=n.agent??a.agent;return[{label:"From",value:a.kind},{label:"To",value:n.kind},{label:"Target",value:s.target??n.label},{label:"Channel",value:Pe(s.route)},{label:"Project",value:o?.project??O(s,"project","projectName")},{label:"Branch",value:o?.branch??O(s,"branch")},{label:"Runtime",value:o?[o.harness,o.model,o.reasoningEffort].filter(Boolean).join(" · ")||null:[O(s,"harness"),O(s,"model")].filter(Boolean).join(" · ")||null},{label:"Machine",value:o?.authorityNodeName??o?.homeNodeName??o?.authorityNodeId??o?.homeNodeId??O(s,"machine","machineName","nodeName")}].filter(f=>!!f.value)}function ts({party:s,route:a,side:n}){return e.jsxs("span",{className:`sys-broker-route-end sys-broker-route-end--${n}`,children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:s.agent||n==="from"?Ae(s.label):e.jsx(_e,{route:a})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:s.label,children:s.label})]})}function mr({attempt:s,agents:a}){const n=as(s,a,"from"),o=as(s,a,"to"),f=fr(s,n,o),h=`dispatch-route-${s.id}`;return e.jsxs("span",{className:"sys-broker-route",tabIndex:0,"aria-describedby":h,children:[e.jsx(ts,{party:n,route:s.route,side:"from"}),e.jsx(Te,{className:"sys-broker-route-arrow",size:11,"aria-hidden":"true"}),e.jsx(ts,{party:o,route:s.route,side:"to"}),e.jsxs("span",{className:"sys-broker-endpoint-card",id:h,role:"tooltip",children:[e.jsx("span",{className:"sys-broker-endpoint-card-head",children:e.jsxs("span",{className:"sys-broker-endpoint-card-edge",children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:Ae(n.label)}),e.jsx("strong",{children:n.label}),e.jsx(Te,{className:"sys-broker-route-arrow",size:11,"aria-hidden":"true"}),e.jsx("span",{className:"sys-broker-avatar sys-broker-endpoint-avatar","aria-hidden":"true",children:o.agent?Ae(o.label):e.jsx(_e,{route:s.route})}),e.jsx("strong",{children:o.label})]})}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:f.map(b=>e.jsxs("span",{className:"sys-broker-endpoint-card-field",children:[e.jsx("small",{children:b.label}),e.jsx("code",{title:b.value,children:b.value})]},b.label))})]})]})}function je(s){const a=ee(s)??0,n=new Date(a);return`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`}function pr(s,a=Date.now()){const n=ee(s)??0,o=new Date(n),f=new Date(a),h=new Date(a);return h.setDate(h.getDate()-1),je(s)===je(f.getTime())?"Today":je(s)===je(h.getTime())?"Yesterday":o.toLocaleDateString(void 0,{month:"short",day:"numeric",year:o.getFullYear()===f.getFullYear()?void 0:"numeric"})}function br(s,a,n){return{...a,source:s.source,attempts:[...s.attempts,...a.attempts],failedQueries:s.failedQueries,failedDeliveries:s.failedDeliveries,dialogue:s.dialogue,ledger:{...a.ledger,cursors:{...s.ledger.cursors,[n]:a.ledger.cursors[n]},hasMore:{...s.ledger.hasMore,[n]:a.ledger.hasMore[n]}}}}function yr({navigate:s,embedded:a=!1,initialAttemptId:n}){_s("Dispatch",a);const{route:o,agents:f,selectedBrokerAttempt:h,inspectBrokerAttempt:b,clearBrokerAttempt:p}=os(),[j]=t.useState(()=>As(De(),lr)),[c,w]=t.useState(j),I=o.view==="broker"?o.filter??"all":"all",[F,y]=t.useState(j===null),[u,N]=t.useState(!1),[L,ce]=t.useState(!1),[_,T]=t.useState(null),J=t.useRef(j),M=t.useRef(0),q=t.useRef(null),G=t.useCallback(async(l="initial")=>{const d=++M.current;!J.current&&l!=="background"?(y(!0),T(null)):N(!0);try{const g=await ie(De());if(d!==M.current)return;J.current=g,w(g),T(null)}catch(g){if(d!==M.current)return;T(g instanceof Error?g.message:String(g))}finally{d===M.current&&(y(!1),N(!1))}},[]),de=t.useCallback(async()=>{const l=J.current;if(!l||L)return;const d="attempts",g=l.ledger.cursors[d];if(!g||!l.ledger.hasMore[d])return;const S=++M.current;ce(!0),T(null);try{const H=await ie(De(g));if(S!==M.current)return;const E=J.current,re=E?br(E,H,d):H;J.current=re,w(re)}catch(H){if(S!==M.current)return;T(H instanceof Error?H.message:String(H))}finally{S===M.current&&ce(!1)}},[L]),ne=t.useCallback(()=>{q.current||(q.current=setTimeout(()=>{q.current=null,G("background")},250))},[G]);t.useEffect(()=>(G("initial"),()=>{q.current&&clearTimeout(q.current)}),[G]),Cs(l=>{(l.kind==="message.posted"||l.kind==="delivery.planned"||l.kind==="delivery.attempted"||l.kind==="delivery.state.changed"||l.kind==="scout.dispatched")&&ne()});const v=t.useMemo(()=>{if(!c)return[];const l=new Map(c.dialogue.map(d=>[d.id,d.body]));return $s(c.attempts).map(d=>{const g=d.messageId?l.get(d.messageId):null;return g&&g!==d.detail?{...d,detail:g}:d})},[c]),R=t.useMemo(()=>{switch(I){case"delivered":return v.filter(l=>!le(l));case"failed":return v.filter(le);default:return v}},[I,v]),ue=c?.ledger.hasMore.attempts??!1,U=t.useMemo(()=>({all:v.length,delivered:v.filter(l=>!le(l)).length,failed:v.filter(le).length}),[v]),D=t.useMemo(()=>{const l=o.view==="broker"?o.attemptId:void 0;return!c||!l?null:v.find(d=>d.id===l)??c.attempts.find(d=>d.id===l)??c.failedQueries.find(d=>d.id===l)??c.failedDeliveries.find(d=>d.id===l)??null},[c,v,o]),he=D?`${D.id}\0${D.status}\0${D.ts}`:null,Q=h?`${h.id}\0${h.status}\0${h.ts}`:null;t.useEffect(()=>{D&&he!==Q&&b(D)},[Q,b,D,he]);const[C,K]=t.useState(null),$=t.useRef(!1),V=t.useCallback(l=>{if(a){$.current=!0,K(l);return}b(l)},[a,b]),A=t.useCallback(()=>{if(a){$.current=!0,K(null);return}p()},[p,a]),se=t.useCallback(l=>{const d=R[l];d&&(V(d),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[R,V]),{getRowFocusProps:W,setFocusedIndex:Y}=ir({enabled:!!c&&R.length>0,rowCount:R.length,onActivateRow:se,onClearSelection:A}),P=C?.id??null,oe=C?`${C.id} ${C.status} ${C.ts}`:null;t.useEffect(()=>{if(!a||!P)return;const l=v.find(d=>d.id===P);l&&`${l.id} ${l.status} ${l.ts}`!==oe&&K(l)},[a,P,oe,v]),t.useEffect(()=>{if(!a||!n||!c||$.current||C)return;const l=v.find(d=>d.id===n)??c.attempts.find(d=>d.id===n)??c.failedQueries.find(d=>d.id===n)??c.failedDeliveries.find(d=>d.id===n);l&&($.current=!0,K(l))},[c,a,C,v,n]),t.useEffect(()=>{const l=o.view==="broker"?o.attemptId:void 0;if(!l)return;const d=R.findIndex(g=>g.id===l);d>=0&&Y(d)},[R,I,o,Y]);const ve=t.useCallback(l=>{const g=(xe.indexOf(I)+l+xe.length)%xe.length,S=xe[g];s({view:"broker",...S==="all"?{}:{filter:S}})},[I,s]),fe=a?C:null;return e.jsx("div",{className:`s-ops${a?" s-ops--embedded":""}${fe?" s-ops--split":""}`,children:e.jsxs("div",{className:"s-ops-body",children:[e.jsxs("div",{className:"sys-surface-page sys-surface-page-wide sys-surface-page-fluid sys-broker-page",children:[e.jsxs("div",{className:"sys-ledger-toolbar","aria-label":"Dispatch controls",children:[c?e.jsx("div",{className:"sys-tab-row sys-tab-row--toolbar",role:"tablist","aria-label":"Dispatch message filters",onKeyDown:l=>{l.key==="ArrowRight"?(l.preventDefault(),ve(1)):l.key==="ArrowLeft"&&(l.preventDefault(),ve(-1))},children:xe.map(l=>e.jsxs("button",{type:"button",role:"tab","aria-selected":I===l,className:`sys-tab${I===l?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...l==="all"?{}:{filter:l}}),children:[e.jsx("span",{children:cr[l]}),e.jsx("span",{className:"sys-tab-count",children:U[l]})]},l))}):e.jsx("div",{className:"sys-ledger-kicker",children:"Dispatch ledger"}),e.jsxs("div",{className:"sys-page-actions sys-ledger-actions",children:[e.jsx("div",{className:"sys-sync-note",children:F?"Loading dispatch ledger...":c?`Updated ${Fe(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${Fe(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:F||u,onClick:()=>{G("manual")},children:u?"Refreshing...":"Refresh"})]})]}),_&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:_})]}),u&&c&&e.jsxs("div",{className:"sys-broker-source-note",role:"status","aria-live":"polite",children:[e.jsx(ke,{className:"sys-broker-source-spinner",size:12,"aria-hidden":"true"}),e.jsx("strong",{children:"Updating dispatches…"})]}),!u&&c?.source?.mode==="sqlite_projection"&&c.source.status==="degraded"&&c.source.detail&&e.jsxs("div",{className:"sys-broker-source-note sys-broker-source-note--warning",role:"status","aria-label":c.source.detail,title:c.source.detail,children:[e.jsx("span",{className:"sys-broker-source-dot","aria-hidden":"true"}),e.jsx("strong",{children:c.source.brokerReachable?"Dispatch history is loading":"Dispatch may be out of date"}),e.jsx("span",{children:c.source.brokerReachable?"Broker online; showing saved dispatch history while live messages load.":"Live broker unavailable; showing saved dispatch history."})]}),F&&!c&&e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",icon:e.jsx(ke,{className:"sys-broker-source-spinner",size:24,"aria-hidden":"true"}),title:"Loading dispatch",body:"Reading the dispatch database snapshot."})}),!F&&!c&&!_&&e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",title:"No dispatch data",body:"No dispatch rows are available yet."})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(gr,{attempts:R,agents:f,selectedAttemptId:a?C?.id??null:h?.id??(o.view==="broker"?o.attemptId??null:null),onInspect:V,getRowFocusProps:W}),R.length>0&&ue&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:L,onClick:()=>{de()},children:L?"Loading older...":"Load older"})})]})]}),fe&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(us,{attempt:fe,navigate:s,onClose:A})})]})})}function gr({attempts:s,agents:a,selectedAttemptId:n,onInspect:o,getRowFocusProps:f}){if(s.length===0)return e.jsx("div",{className:"sys-broker-empty-wrap",children:e.jsx(Ee,{className:"sys-state-card-centered",title:"No dispatch rows",body:"No dispatch rows are available yet."})});const h=s.reduce((b,p,j)=>{const c=je(p.ts),w=b[b.length-1];return w?.key===c?w.attempts.push({attempt:p,index:j}):b.push({key:c,label:pr(p.ts),attempts:[{attempt:p,index:j}]}),b},[]);return e.jsxs("div",{className:"sys-broker-wire","aria-label":"Dispatch ledger",children:[e.jsxs("div",{className:"sys-broker-wire-head","aria-hidden":"true",children:[e.jsx("span",{className:"sys-broker-col sys-broker-col--route",children:"Route"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--msg",children:"Message"}),e.jsx("span",{className:"sys-broker-col sys-broker-col--time",children:"Time"})]}),h.map(b=>e.jsxs("section",{className:"sys-broker-day","aria-labelledby":`dispatch-day-${b.key}`,children:[e.jsxs("header",{className:"sys-broker-day-head",children:[e.jsx("h2",{id:`dispatch-day-${b.key}`,children:b.label}),e.jsxs("span",{children:[b.attempts.length," ",b.attempts.length===1?"dispatch":"dispatches"]})]}),e.jsx("div",{className:"sys-broker-wire-body",role:"list",children:b.attempts.map(({attempt:p,index:j})=>{const c=ze(p.kind,p.status),w=le(p),I=!w&&(c==="working"||c==="warning"),F=is(p),y=Le(p),u=w?F:I?y:null,N=()=>{o(p),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${w?" sys-broker-wire-row--failure":I?" sys-broker-wire-row--pending":""}${n===p.id?" sys-broker-wire-row--selected":""}`,"aria-label":`${y}. Inspect ${p.detail}`,onClick:N,...f(j),children:[e.jsx("div",{className:"sys-broker-cell sys-broker-col--route",children:e.jsx(mr,{attempt:p,agents:a})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:p.detail,children:p.detail}),u&&e.jsx("span",{className:`sys-broker-msg-error sys-broker-msg-error--${w?"danger":"warning"}`,title:u,children:u})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--time",children:e.jsx("time",{className:"sys-broker-time-abs",title:`${Fe(p.ts)} · ${ns(p.ts)}`,children:ur(p.ts)})})]},p.id)})})]},b.key))]})}function xr(s){const a=ds(s);return[{label:"Kind",value:dr(s.kind)},{label:"Time",value:ns(s.ts)},{label:"Actor",value:s.actorName},{label:"Target",value:s.target},{label:"Route",value:s.route},{label:"Conversation",value:s.conversationId},{label:"Reference",value:a},{label:"Message",value:s.messageId===a?null:s.messageId},{label:"Delivery",value:s.deliveryId===a?null:s.deliveryId},{label:"Invocation",value:s.invocationId===a?null:s.invocationId}].filter(n=>!!n.value)}function z({value:s,subject:a,className:n}){const[o,f]=t.useState("idle"),h=t.useRef(null);t.useEffect(()=>{f("idle")},[s]),t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const b=t.useCallback(async()=>{const c=await Rs(s);h.current&&clearTimeout(h.current),f(c?"copied":"failed"),h.current=setTimeout(()=>{f("idle"),h.current=null},1500)},[s]),p=o==="copied",j=o==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${n?` ${n}`:""}${p?" sys-copy-btn--copied":""}${j?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:p?`Copied ${a}`:j?"Copy failed":`Copy ${a}`,"aria-label":p?`Copied ${a}`:j?`Copy ${a} failed`:`Copy ${a}`,children:p?e.jsx(Js,{size:14,"aria-hidden":"true"}):e.jsx(Gs,{size:14,"aria-hidden":"true"})})}function jr(s){const a=s.trim();if(a.startsWith("{")||a.startsWith("["))try{return{code:JSON.stringify(JSON.parse(a),null,2),path:"payload.json",language:"JSON"}}catch{}return{code:s,path:"payload.md",language:"Text · Markdown"}}function kr({payload:s}){const a=t.useMemo(()=>jr(s),[s]),[n,o]=t.useState(!1),f=t.useRef(null),h=a.code.split(`
2
- `).length;t.useEffect(()=>{const p=f.current;!p||!n||p.open||p.showModal()},[n]),t.useEffect(()=>{o(!1)},[s]);const b=e.jsx("div",{className:"sys-broker-payload-code","data-language":a.path==="payload.json"?"json":"markdown",role:"region","aria-label":`Dispatch payload, ${a.language}`,tabIndex:0,children:e.jsx(zs,{code:a.code,path:a.path})});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sys-broker-payload-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",h," ",h===1?"line":"lines"]}),e.jsx(z,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-payload-expand",onClick:()=>o(!0),title:"Expand payload","aria-label":"Expand payload",children:e.jsx(Vs,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),n&&xs.createPortal(e.jsxs("dialog",{ref:f,className:"sys-broker-payload-dialog","aria-label":"Expanded dispatch payload",onCancel:p=>{p.preventDefault(),o(!1)},onClose:()=>o(!1),children:[e.jsxs("header",{className:"sys-broker-payload-dialog-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Dispatch payload"}),e.jsxs("span",{className:"sys-broker-payload-meta",children:[a.language," · ",h," ",h===1?"line":"lines"]})]}),e.jsx(z,{value:s,subject:"payload"}),e.jsx("button",{type:"button",className:"sys-copy-btn",onClick:()=>o(!1),title:"Return payload to inspector","aria-label":"Return payload to inspector",children:e.jsx(Ws,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function vr({attempt:s}){const a=Ms(s);return e.jsxs("div",{className:"sys-broker-route-failure",role:"status",children:[e.jsx("span",{className:"sys-broker-route-failure-mark","aria-hidden":"true",children:e.jsx(Me,{size:14})}),e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Routing stopped"}),e.jsx("strong",{children:a}),e.jsx("p",{children:s.detail})]}),e.jsx(z,{value:s.detail,subject:"failure detail"})]})}function us({attempt:s,navigate:a,onClose:n}){const{route:o,agents:f,scoutbotAgentId:h}=os(),b=xr(s),p=Ds(s.metadata),j=le(s),c=s.kind==="failed_query",w=is(s),I=ze(s.kind,s.status),F=Re(s,"sentAt","createdAt")??ee(s.ts),y=Re(s,"deliveredAt","completedAt")??ee(s.ts),u=ds(s),[N,L]=t.useState("idle"),[ce,_]=t.useState(null),[T,J]=t.useState(null),[M,q]=t.useState(!1),[G,de]=t.useState(!1),[ne,v]=t.useState(""),[R,ue]=t.useState(""),[U,D]=t.useState("idle"),[he,Q]=t.useState(null),[C,K]=t.useState(""),[$,V]=t.useState(""),[A,se]=t.useState(""),[W,Y]=t.useState(""),[P,oe]=t.useState("medium"),[ve,fe]=t.useState(null),[l,d]=t.useState([]),[g,S]=t.useState("idle"),[H,E]=t.useState(null),re=O(s,"harness"),we=O(s,"model"),Ne=O(s,"reasoningEffort","effort"),qe=t.useRef(null),Ue=t.useRef(null),me=t.useMemo(()=>Es(s),[s]),k=t.useMemo(()=>f.filter(r=>!r.retiredFromFleet&&!r.staleLocalRegistration).slice().sort((r,i)=>r.id===h?-1:i.id===h?1:(i.updatedAt??0)-(r.updatedAt??0)||r.name.localeCompare(i.name)),[f,h]),pe=t.useMemo(()=>Fs(s,k)?.id??"",[s,k]),be=k.find(r=>r.id!==h)?.id??k[0]?.id??"",Se=k[0]?.id??"",ae=k.find(r=>r.id===be)??null,hs=t.useMemo(()=>{const r=new Map;for(const i of k){const m=i.projectRoot?.trim()||i.cwd?.trim();if(!m)continue;const x=m.split("/").filter(Boolean).at(-1)??m;r.set(m,i.project?.trim()||x)}return[...r.entries()].map(([i,m])=>({path:i,label:m}))},[k]),Ke=t.useRef({originalTargetAgentId:pe,firstRoutableAgentId:Se,defaultForwardAgentId:be,defaultForwardAgent:ae,effort:"medium"});Ke.current={originalTargetAgentId:pe,firstRoutableAgentId:Se,defaultForwardAgentId:be,defaultForwardAgent:ae,effort:O(s,"reasoningEffort","effort")||"medium"};const ye=t.useRef(!1);t.useEffect(()=>{const r=Ke.current;ye.current=!1,L("idle"),_(null),J(null),q(!1),de(!1),v(""),ue(r.originalTargetAgentId||r.firstRoutableAgentId),D("idle"),Q(null),K(r.defaultForwardAgentId),V(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),se(r.defaultForwardAgent?.harness?.trim()||""),Y(r.defaultForwardAgent?.model?.trim()||""),oe(r.effort),d([]),S("idle"),E(null)},[s.id]),t.useEffect(()=>{ye.current||(ue(r=>r||pe||Se),K(r=>r||be),V(r=>r||ae?.projectRoot?.trim()||ae?.cwd?.trim()||""),se(r=>r||ae?.harness?.trim()||""),Y(r=>r||ae?.model?.trim()||""))},[ae,be,Se,pe]),t.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});$&&r.set("projectRoot",$);let i=!1;return ie(`/api/runner/options?${r.toString()}`).then(m=>{!i&&m.schemaVersion==="openscout.runtime-capabilities.v1"&&fe(m)}).catch(()=>{}),()=>{i=!0}},[$]);const fs=t.useCallback(()=>{q(!0),window.requestAnimationFrame(()=>qe.current?.focus())},[]),He=t.useCallback(()=>{q(!1),de(!1),v(""),d([]),S("idle"),E(null)},[]),ms=t.useCallback(async()=>{const r=k.find(i=>i.id===R);if(!(!r||U==="sending")){D("sending"),Q(null);try{const i=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...re||we||Ne?{execution:{...re?{harness:re}:{},...we?{model:we}:{},...Ne?{reasoningEffort:Ne}:{},session:"new"}}:{},metadata:{source:"scout-dispatch-redispatch",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),m=i.flightId??i.flight?.id;D("sent"),Q(`New dispatch sent to ${r.name}${m?` · ${m}`:""}`)}catch(i){D("failed"),Q(`Retry failed. ${i instanceof Error?i.message:String(i)}`)}}},[s,R,U,Ne,re,we,k]),Je=t.useCallback(async()=>{const r=ne.trim(),i=k.find(m=>m.id===C);if(!(!r||!i||g==="sending")){S("sending"),E(l.length>0?`Uploading ${l.length} ${l.length===1?"attachment":"attachments"}…`:null);try{const m=l.length>0?await ks(l):[],x=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
3
-
4
- Attached dispatch context:
5
- ${me}`,targetAgentId:i.id,targetLabel:i.name,...m.length>0?{attachments:m}:{},execution:{...A?{harness:A}:{},...W?{model:W}:{},...P?{reasoningEffort:P}:{}},metadata:{source:"scout-dispatch-forward",originalDispatchId:s.id,...$?{targetProjectPath:$}:{},...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),X=x.flightId??x.flight?.id;S("sent"),E(`Request sent to ${i.name}${X?` · ${X}`:""}`),v(""),d([])}catch(m){S("failed"),E(`Request wasn't sent. ${m instanceof Error?m.message:String(m)}`)}}},[s,me,C,P,l,A,W,$,g,ne,k]),ps=t.useCallback(r=>{const i=r.filter(vs),m=r.length-i.length;i.length>0&&(d(x=>[...x,...i]),S("idle"),E(null)),m>0&&(S("failed"),E("Attach markdown, code, an image, or a video clip."))},[]),B=k.find(r=>r.id===R)??null,te=k.find(r=>r.id===C)??null,ge=k.filter(r=>$?(r.projectRoot?.trim()||r.cwd?.trim())===$:!0),Ge=ve??Ns,$e=t.useMemo(()=>{const r=ws(Ge),i=[W,te?.harness===A?te.model:null,...ge.filter(x=>x.harness===A).map(x=>x.model)].map(x=>x?.trim()).filter(x=>!!x);let m=r.harnesses;return m.some(x=>x.value===A)||(m=[{value:A,label:A||"default",models:[]},...m]),m=m.map(x=>{if(x.value!==A)return x;const X=x.models.some(Z=>Z.value==="")?x.models:[{value:"",label:"Default",note:"harness picks"},...x.models],gs=new Set(X.map(Z=>Z.value)),We=i.filter(Z=>!gs.has(Z)).map(Z=>({value:Z,label:Z,note:"observed"}));return We.length===0&&X===x.models?x:{...x,models:[...X,...We]}}),{...r,harnesses:m}},[Ge,te,A,W,ge]);t.useEffect(()=>{const r=Ss($e,A);!r||r.some(i=>i.value===P)||oe(r.find(i=>i.value==="medium")?.value??r[0]?.value??"")},[$e,A,P]);const Qe=j?"Investigate why this dispatch failed. Say what stopped it, whether anything was received, and propose a recovery: who should take it and what should happen next.":"Summarize this dispatch and what happened next. Flag anything that needs the operator.",bs=t.useCallback(async()=>{if(N==="sending")return;if(T){Ye(a,{view:"conversation",conversationId:T},{returnTo:o});return}const r=k.find(i=>i.id===h);if(!r){L("failed"),_("Scout isn't reachable right now.");return}L("sending"),_(null);try{const i=await ie("/api/ask",{method:"POST",body:JSON.stringify({body:`${Qe}
6
-
7
- Attached dispatch context:
8
- ${me}`,targetAgentId:r.id,targetLabel:"Scout",metadata:{source:"scout-dispatch-investigate",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),m=i.flightId??i.flight?.id;L("sent"),J(i.conversationId??null),_(i.conversationId?"Investigation started. Open it to follow along.":`Investigation sent to Scout${m?` · ${m}`:""}.`)}catch(i){L("failed"),_(`Investigation wasn't sent. ${i instanceof Error?i.message:String(i)}`)}},[s,me,T,Qe,N,a,k,o,h]),ys=t.useMemo(()=>{const r={state:Le(s),reference:u,channel:Pe(s.route),latency:rs(s),sent:Ie(F),[j?"failed":"delivered"]:Ie(y)};for(const i of b)r[i.label.toLowerCase()]=i.value;return JSON.stringify(r,null,2)},[s,y,j,u,b,F]),Ve=e.jsxs("div",{className:"sys-broker-action-row",children:[e.jsxs("div",{className:"sys-broker-action-line",children:[e.jsx("span",{className:"sys-broker-action-label",id:"dispatch-redispatch-title",children:"Retry"}),e.jsxs("div",{className:"sys-broker-redispatch-controls",children:[e.jsx("select",{"aria-label":"Retry destination",value:R,disabled:U==="sending"||k.length===0,onChange:r=>{ue(r.target.value),D("idle"),Q(null)},children:k.length===0?e.jsx("option",{value:"",children:"No agents available"}):e.jsxs(e.Fragment,{children:[!R&&e.jsx("option",{value:"",children:"Original destination unavailable"}),k.map(r=>e.jsxs("option",{value:r.id,children:[r.id===h?"Scout":r.name,r.project?` · ${r.project}`:""]},r.id))]})}),e.jsxs("button",{type:"button",className:"sys-broker-redispatch-send",disabled:!B||U==="sending",onClick:()=>{ms()},children:[U==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(qs,{size:13,"aria-hidden":"true"}),U==="sending"?"Retrying…":"Retry dispatch"]})]})]}),B&&e.jsxs("div",{className:"sys-broker-action-target-meta",children:[B.harness&&e.jsx("span",{children:B.harness}),B.model&&e.jsx("span",{children:B.model}),(B.cwd??B.projectRoot)&&e.jsx("code",{children:B.cwd??B.projectRoot})]}),he&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${U}`,role:"status",children:he})]});return e.jsxs("aside",{className:"sys-panel sys-broker-inspector","aria-label":"Dispatch route inspector",children:[e.jsx("header",{className:"sys-broker-inspector-head",children:e.jsxs("div",{className:"sys-broker-inspector-status",children:[e.jsx("span",{className:`sys-broker-dot sys-broker-dot--${I}`,"aria-hidden":"true"}),e.jsx("strong",{className:`sys-broker-state sys-broker-state--${I}`,children:Le(s)}),e.jsx("code",{title:u,children:u}),e.jsx(z,{value:u,subject:"message id",className:"sys-broker-inspector-copy"}),e.jsx(z,{value:me,subject:"dispatch context",className:"sys-broker-inspector-copy"}),e.jsx("button",{type:"button",className:"sys-copy-btn sys-broker-inspector-close",onClick:n,title:"Close inspector","aria-label":"Close inspector",children:e.jsx(Me,{size:14,"aria-hidden":"true"})})]})}),e.jsxs("div",{className:"sys-broker-inspector-body",children:[e.jsxs("section",{className:"sys-broker-route-stack","aria-label":"Dispatch route",children:[e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-avatar sys-broker-route-avatar","aria-hidden":"true",children:Ae(s.actorName)}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["From · ",Be(s,"from")]}),e.jsx("strong",{children:s.actorName??"Unknown sender"})]}),s.actorName&&e.jsx(z,{value:s.actorName,subject:"sender"})]}),e.jsx(Us,{className:"sys-broker-route-down",size:17,"aria-hidden":"true"}),e.jsxs("div",{className:"sys-broker-route-party",children:[e.jsx("span",{className:"sys-broker-route-target-icon","aria-hidden":"true",children:e.jsx(_e,{route:s.route})}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["To · ",Be(s,"to")]}),e.jsx("code",{title:s.target??"No target",children:s.target??"No target"})]}),s.target&&e.jsx(z,{value:s.target,subject:"target"}),s.conversationId&&e.jsxs("button",{type:"button",className:"sys-broker-route-button",onClick:()=>Ye(a,{view:"conversation",conversationId:s.conversationId},{returnTo:o}),children:[e.jsx(Ze,{size:11,"aria-hidden":"true"}),"Route"]})]})]}),e.jsxs("section",{className:"sys-broker-payload",children:[c?e.jsx(vr,{attempt:s}):e.jsx(kr,{payload:s.detail}),j&&!c&&w&&e.jsxs("div",{className:"sys-broker-inspector-error",role:"status",children:[e.jsx("span",{className:"sys-broker-inspector-error-label",children:"Error"}),e.jsx("p",{children:w})]})]}),e.jsx(Ls,{attempt:s,targetAgentId:pe||null,navigate:a,returnTo:o}),e.jsxs("section",{className:"sys-broker-actions","aria-label":"Dispatch actions",children:[j&&Ve,e.jsxs("div",{className:"sys-broker-intents",children:[e.jsxs("button",{type:"button",className:`sys-broker-intent${j?"":" sys-broker-intent--primary"}`,disabled:N==="sending",onClick:()=>{bs()},children:[N==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):T?e.jsx(Ze,{size:13,"aria-hidden":"true"}):e.jsx(ls,{size:13,"aria-hidden":"true"}),N==="sending"?"Asking Scout…":T?"Open investigation":"Investigate with Scout"]}),e.jsxs("button",{type:"button",className:"sys-broker-intent","aria-expanded":M,onClick:()=>M?He():fs(),children:[e.jsx(Te,{size:13,"aria-hidden":"true"}),"Forward to agent…"]})]}),ce&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${N}`,role:"status",children:ce}),M&&e.jsxs("div",{className:"sys-broker-forward-draft",children:[e.jsxs("div",{className:"sys-broker-forward-draft-head",children:[e.jsx("span",{className:"sys-broker-action-label",children:"Forward to agent"}),e.jsx("button",{type:"button",className:"sys-broker-forward-discard",onClick:He,children:"Discard"})]}),e.jsxs("form",{className:"sys-broker-message-composer",onSubmit:r=>{r.preventDefault(),Je()},children:[e.jsx("textarea",{ref:qe,id:"dispatch-message-input","aria-label":"Forward message",value:ne,rows:3,placeholder:`What should ${te?.id===h?"Scout":te?.name??"this agent"} investigate or do?`,disabled:g==="sending",onChange:r=>{v(r.target.value),g!=="idle"&&(S("idle"),E(null))},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),Je())}}),l.length>0&&e.jsx("div",{className:"sys-broker-composer-attachments","aria-label":"Attachments",children:l.map((r,i)=>e.jsxs("span",{children:[e.jsx(rr,{size:10,"aria-hidden":"true"}),e.jsx("span",{title:r.name,children:r.name}),e.jsx("button",{type:"button",onClick:()=>d(m=>m.filter((x,X)=>X!==i)),"aria-label":`Remove ${r.name}`,children:e.jsx(Me,{size:10,"aria-hidden":"true"})})]},`${r.name}:${r.size}:${i}`))}),e.jsxs("footer",{children:[e.jsxs("div",{className:"sys-broker-composer-left",children:[e.jsx("input",{ref:Ue,type:"file",multiple:!0,hidden:!0,disabled:g==="sending",onChange:r=>{ps([...r.target.files??[]]),r.target.value=""}}),e.jsx("button",{type:"button",className:"sys-broker-composer-attach",disabled:g==="sending",onClick:()=>Ue.current?.click(),"aria-label":"Attach files",title:"Attach files",children:e.jsx(Ks,{size:16,"aria-hidden":"true"})}),e.jsx("span",{className:"sys-broker-message-attachment",title:u,children:"Context + payload attached"})]}),e.jsxs("div",{className:"sys-broker-composer-targets",children:[e.jsx("span",{className:"sys-broker-composer-route-label",children:"To"}),e.jsxs("label",{title:"Forward target",children:[e.jsx("span",{children:"Agent"}),e.jsx("select",{"aria-label":"Forward target",value:C,disabled:g==="sending"||ge.length===0,onChange:r=>{const i=k.find(m=>m.id===r.target.value)??null;ye.current=!0,K(r.target.value),i&&(V(i.projectRoot?.trim()||i.cwd?.trim()||""),se(i.harness?.trim()||""),Y(i.model?.trim()||"")),S("idle"),E(null)},children:ge.length===0?e.jsx("option",{value:"",children:"No agents"}):ge.map(r=>e.jsx("option",{value:r.id,children:r.id===h?"Scout":r.name},r.id))})]}),e.jsxs("button",{type:"button",className:"sys-broker-forward-adjust-toggle","aria-expanded":G,onClick:()=>de(r=>!r),children:["Adjust",e.jsx(es,{size:11,"aria-hidden":"true"})]}),e.jsx(js,{className:"sys-broker-composer-mic",disabled:g==="sending",onAppend:r=>v(i=>i.trim()?`${i.trimEnd()} ${r}`:r),onError:r=>{S("failed"),E(r)}})]}),e.jsx("button",{type:"submit",className:"sys-broker-composer-send",disabled:!ne.trim()||!te||g==="sending","aria-label":`Ask ${te?.name??"recipient"} about this dispatch`,children:g==="sending"?e.jsx(ke,{size:14,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Hs,{size:14,"aria-hidden":"true"})})]}),G&&e.jsxs("div",{className:"sys-broker-composer-targets sys-broker-forward-adjust",children:[e.jsxs("label",{title:"Project target",children:[e.jsx("span",{children:"Project"}),e.jsxs("select",{"aria-label":"Project target",value:$,disabled:g==="sending",onChange:r=>{const i=r.target.value,m=k.find(x=>!i||(x.projectRoot?.trim()||x.cwd?.trim())===i)??null;ye.current=!0,V(i),m&&(K(m.id),se(m.harness?.trim()||""),Y(m.model?.trim()||""))},children:[e.jsx("option",{value:"",children:"Any project"}),hs.map(r=>e.jsx("option",{value:r.path,children:r.label},r.path))]})]}),e.jsx(Is,{catalog:$e,value:{harness:A,model:W,effort:P},onChange:r=>{ye.current=!0,se(r.harness),Y(r.model),oe(r.effort)},disabled:g==="sending"})]})]}),H&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${g}`,role:"status",children:H})]})]}),e.jsxs("details",{className:"sys-broker-technical",children:[e.jsxs("summary",{children:[e.jsx("span",{children:"Technical details"}),e.jsx(es,{size:13,"aria-hidden":"true"})]}),e.jsxs("dl",{className:"sys-broker-delivery-grid",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Channel"}),e.jsx("dd",{children:Pe(s.route)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Latency"}),e.jsx("dd",{className:"sys-broker-delivery-accent",children:rs(s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sent"}),e.jsx("dd",{children:Ie(F)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:j?"Failed":"Delivered"}),e.jsx("dd",{children:Ie(y)})]})]}),e.jsxs("div",{className:"sys-broker-record-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Record"}),e.jsx(z,{value:ys,subject:"record as JSON",className:"sys-broker-metadata-copy"})]}),e.jsx("div",{className:"sys-broker-inspector-rows",children:b.map(r=>e.jsxs("div",{className:"sys-broker-inspector-row",children:[e.jsx("span",{className:"sys-detail-label",children:r.label}),e.jsx("code",{className:"sys-detail-value",children:r.value}),e.jsx(z,{value:r.value,subject:r.label.toLowerCase()})]},r.label))}),e.jsxs("div",{className:"sys-broker-metadata",children:[e.jsxs("div",{className:"sys-broker-metadata-head",children:[e.jsx("span",{className:"sys-detail-label",children:"Metadata"}),e.jsx(z,{value:p,subject:"metadata",className:"sys-broker-metadata-copy"})]}),e.jsx(Ts,{metadata:s.metadata,rawJson:p})]}),!j&&Ve]})]})]})}const wr=Os({id:"dispatch",label:"Dispatch",route:{view:"broker"},webPath:"/dispatch",screen:"BrokerScreen",embed:{path:"/embed/dispatch",profile:"macos.dispatch",rootClassName:"s-broker-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},ownsInternalRoutes:!0,resolveEmbedProps:s=>{const a=s.get("attempt")?.trim();return a?{initialAttemptId:a}:{}},hosts:{macos:!0}}}),oa=Object.freeze(Object.defineProperty({__proto__:null,BrokerAttemptInspector:us,BrokerScreen:yr,scoutSurface:wr},Symbol.toStringTag,{value:"Module"}));export{us as B,yr as a,De as b,oa as c};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-C8uS5szO.js";import{M as p}from"./message-markup-DgFSyb3f.js";import{f as d}from"./conversation-model-BGFHoxQ0.js";import{t as n}from"./time-Dhsh_2EG.js";import"./mentions-Ctw1ECUC.js";import"./colors-CFlbwC25.js";import"./agent-state-DDhnFEEP.js";import"./index-C5cX8dkl.js";import"./api-CaROe5_H.js";import"./Provider-5Hotn7NQ.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"./createLucideIcon-DkjnzvcJ.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";import"./conversations-Cbg9h_Af.js";function l({at:i}){const r=d(i);return t.jsxs("div",{className:"s-thread-day-divider","aria-label":r,children:[t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"}),t.jsx("span",{className:"s-thread-day-label",children:r}),t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"})]})}function pt({row:i,expanded:r,showDayDivider:e,onToggle:s}){const m=`${i.recipients.length} recipients`;return t.jsxs("div",{className:["s-thread-feed-block","s-thread-fanout",e&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[e&&t.jsx(l,{at:i.createdAt}),i.messages.map(a=>t.jsx("span",{id:`msg-${a.id}`,className:"s-thread-fanout-anchor","aria-hidden":"true"},a.id)),t.jsxs("button",{type:"button",className:"s-thread-fanout-summary","aria-expanded":r,onClick:s,title:i.recipients.join(", "),children:[t.jsx("span",{className:"s-thread-fanout-caret","aria-hidden":"true",children:r?"▾":"▸"}),t.jsx("span",{className:"s-thread-fanout-label",children:m}),t.jsx("span",{className:"s-thread-fanout-time",children:n(i.createdAt)})]}),r&&t.jsxs("div",{className:"s-thread-fanout-detail",children:[t.jsx("ul",{className:"s-thread-fanout-recipients",children:i.messages.map((a,o)=>t.jsx("li",{className:"s-thread-fanout-recipient",children:i.recipients[o]},a.id))}),t.jsx("div",{className:"s-thread-fanout-body",children:t.jsx(p,{text:i.messages[0].body})})]})]})}export{pt as FanOutRow,l as ThreadDayDivider};
@@ -1 +0,0 @@
1
- import{r as S,j as e,H as Z}from"./index-C8uS5szO.js";import{c as M}from"./clipboard-e3fSpeo7.js";import{b as ee}from"./router-BKiMcYa7.js";import{A as P}from"./AgentAvatar-BIwg54Tj.js";import{H as te}from"./HarnessMark-Bt47OeHy.js";import{a as se}from"./Provider-5Hotn7NQ.js";import{n as ne,c as ae}from"./agent-state-DDhnFEEP.js";import{B as re}from"./BackToPicker-Bys9ColC.js";import{o as z}from"./openContent-C6XO6kr5.js";import{AstronautSuit as oe}from"./AstronautSuit-C-4I5YKi.js";import{l as ie,s as le}from"./conversation-model-BGFHoxQ0.js";import{E as ce}from"./eye-CtqSV8BS.js";import{P as de}from"./panel-right-BNTJhy8M.js";import{c as he}from"./createLucideIcon-DkjnzvcJ.js";import"./api-CaROe5_H.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./SpriteAvatar-BW1JzkDt.js";import"./CrewAvatar-CJhuqTsJ.js";import"./colors-CFlbwC25.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"./index-C5cX8dkl.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./model-CBkMvT1w.js";import"./time-Dhsh_2EG.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"./conversations-Cbg9h_Af.js";const me=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],pe=he("user-plus",me),Y=150,T=320,ue=1.4,xe=1.1,G=5,fe=22,J=5200,ve=1,ge=1200;function je(n){S.useEffect(()=>{const s=n.current;if(!s||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let i=[],r=[],d=-9999,x=-9999,h=0;const c=()=>{i=[],r=[],s.querySelectorAll(".sprite-cell--eye circle").forEach(o=>{const a=o.getBoundingClientRect();if(!a.width)return;const u=o.closest("[data-state]");i.push({el:o,cx:a.left+a.width/2,cy:a.top+a.height/2,working:u?.dataset.state==="in_flight"})}),s.querySelectorAll(".s-thread-participant-avatar svg").forEach(o=>{const a=o.getBoundingClientRect();a.width&&r.push({el:o,cx:a.left+a.width/2,cy:a.top+a.height/2})})},E=o=>o<Y?1:o>T?0:(T-o)/(T-Y),j=o=>{for(const a of i){const u=d-a.cx,y=x-a.cy,p=Math.hypot(u,y),v=E(p),b=p<1?1:p;let A=u/b*ue*v;const L=y/b*xe*v;if(a.working&&v<1){const w=o%J/J;A+=Math.sin(w*Math.PI*2)*ve*(1-v)}a.el.style.transform=`translate(${A.toFixed(2)}px, ${L.toFixed(2)}px)`}for(const a of r){const u=d-a.cx,y=Math.hypot(u,x-a.cy),p=E(y),v=Math.max(-G,Math.min(G,u/fe))*p;a.el.style.transform=v===0?"":`rotate(${v.toFixed(2)}deg)`}h=requestAnimationFrame(j)},f=o=>{d=o.clientX,x=o.clientY};c();const m=window.setInterval(c,ge);return h=requestAnimationFrame(j),window.addEventListener("resize",c),document.addEventListener("pointermove",f,{passive:!0}),()=>{cancelAnimationFrame(h),window.clearInterval(m),window.removeEventListener("resize",c),document.removeEventListener("pointermove",f);for(const o of i)o.el.style.transform="";for(const o of r)o.el.style.transform=""}},[n])}function I(n,s,i){const r=i?Z[i.trim().toLowerCase()]:void 0;return{"--fp-z":String(n-s),"--fp-i":String(s),...r==null?{}:{"--fp-suit-hue":String(r)}}}function be(n){if(n<1e3)return String(n);const s=n/1e3;return s<10?`${s.toFixed(1).replace(/\.0$/,"")}k`:`${Math.round(s)}k`}function B({name:n,runtime:s,state:i,action:r}){return e.jsxs("span",{className:"s-thread-participant-card","aria-hidden":"true",children:[e.jsx("strong",{children:n}),s?e.jsx("span",{children:s}):null,e.jsx("span",{children:i}),r?e.jsx("span",{className:"s-thread-participant-card-action",children:r}):null]})}function H({count:n,className:s,style:i,rosterId:r,expanded:d,onClick:x}){const h=`${n} more participant${n===1?"":"s"}`;return e.jsx("button",{type:"button",className:`s-thread-participant s-thread-participant--button ${s}`,style:i,"aria-label":`${h}; open participant list`,"aria-haspopup":"dialog","aria-controls":r,"aria-expanded":d,onClick:x,children:e.jsxs("span",{className:"s-thread-participant-face s-thread-participant-face--overflow",children:["+",be(n)]})})}const ye=[{id:"thread",label:"Thread",hint:"The conversation in order"},{id:"flow",label:"Flow",hint:"Who asked whom, who waited, and where the work branched"},{id:"map",label:"Map",hint:"Who exchanges work with whom, and on which model"},{id:"canvas",label:"Canvas",hint:"The same window laid out left to right, with nobody folded away"}];function jt({showBackNav:n,backLabel:s,isDm:i,navigate:r,route:d,canonicalConversationId:x,threadTitle:h,agentId:c,sessionId:E,detailRoute:j,participants:f,operator:m,canAddParticipants:o,onToggleAddParticipant:a,view:u,onChangeView:y,beside:p}){const v=se(),b=ee(d),A=S.useRef(null),L=S.useRef(null),w=S.useId(),[N,C]=S.useState(!1);je(A);const $=f.slice(0,4),O=Math.max(f.length-$.length,0),U=Math.max(f.length-2,0),W=Math.max(f.length-1,0),k=$.length+(O>0?1:0)+(m.active?1:0);S.useEffect(()=>{if(!N)return;const t=g=>{L.current?.contains(g.target)||C(!1)},l=g=>{g.key==="Escape"&&C(!1)};return document.addEventListener("mousedown",t),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("keydown",l)}},[N]);const R=t=>t.agent?{view:"agents-v2",agentId:t.agent.id,...b?{machineId:b}:{}}:t.sessionId?{view:"sessions",sessionId:t.sessionId,...b?{machineId:b}:{}}:null,q=t=>{const l=R(t);l&&(C(!1),z(r,l,{returnTo:d}))};return e.jsxs("div",{className:"s-thread-center-header",onClick:t=>{t.target?.closest("button,a,input,select,textarea")||!i||!j||z(r,j,{returnTo:d})},style:i&&j?{cursor:"pointer"}:void 0,onContextMenu:t=>{const l=[{kind:"action",label:"Copy Title",onSelect:()=>{M(h)}}];c&&l.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{M(c)}}),!c&&E&&l.push({kind:"action",label:"Copy Session ID",onSelect:()=>{M(E)}}),l.push({kind:"action",label:"Copy Conversation ID",onSelect:()=>{M(x)}}),v(t,l)},children:[n&&e.jsx(re,{slot:"conversation",fallback:{view:"inbox"},navigate:r,label:s??"Back",className:"s-thread-header-back"}),e.jsx("div",{className:"s-thread-center-header-info",children:i&&j?e.jsx("button",{type:"button",className:"s-thread-center-header-name",title:`Open ${h} details`,onClick:()=>z(r,j,{returnTo:d}),children:h}):e.jsx("span",{className:"s-thread-center-header-name",children:h})}),e.jsxs("div",{className:"s-thread-center-header-right",children:[e.jsx("div",{className:"s-thread-view-toggle",role:"group","aria-label":"Conversation view",children:ye.map(t=>e.jsx("button",{type:"button",className:`s-thread-view-option${u===t.id?" s-thread-view-option--on":""}`,"aria-pressed":u===t.id,title:t.hint,onClick:()=>y(t.id),children:t.label},t.id))}),f.length>0&&e.jsxs("div",{className:"s-thread-participants",ref:t=>{A.current=t,L.current=t},"aria-label":"Conversation participants",children:[$.map((t,l)=>{const g=[t.harness,t.model,t.reasoningEffort].filter(Boolean).join(" · ")||null,F=t.agent?ne(t.agent.state??null,t.agent):null,D=t.agent?ae(t.agent.state??null,t.agent):"Session participant",V=R(t),X=V?t.agent?"Open profile":"Open session":null,Q=[t.name,g,D,X].filter(Boolean).join(", "),K=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"s-thread-participant-face",children:[e.jsx(oe,{}),e.jsx(P,{agent:t.agent??void 0,name:t.name,placement:"turn",size:28,className:"s-thread-participant-avatar"})]}),t.harness?e.jsx(te,{harness:t.harness,size:9,className:"s-thread-participant-harness",title:null}):null,e.jsx(B,{name:t.name,runtime:g,state:D,action:X})]}),_={className:"s-thread-participant",style:I(k,l,t.harness),"data-state":F??void 0,"data-compact-hidden":l>=2?"true":void 0,"data-narrow-hidden":l>=1?"true":void 0,"aria-label":Q};return V?e.jsx("button",{type:"button",..._,className:`${_.className} s-thread-participant--button`,onClick:()=>q(t),children:K},t.id):e.jsx("span",{..._,role:"group",tabIndex:0,children:K},t.id)}),O>0?e.jsx(H,{count:O,className:"s-thread-participant--desktop-overflow",style:I(k,$.length),rosterId:w,expanded:N,onClick:()=>C(t=>!t)}):null,U>0?e.jsx(H,{count:U,className:"s-thread-participant--compact-overflow",style:I(k,2),rosterId:w,expanded:N,onClick:()=>C(t=>!t)}):null,W>0?e.jsx(H,{count:W,className:"s-thread-participant--narrow-overflow",style:I(k,1),rosterId:w,expanded:N,onClick:()=>C(t=>!t)}):null,m.active?e.jsxs("span",{className:"s-thread-participant s-thread-participant--operator",style:I(k,k-1),role:"group",tabIndex:0,"aria-label":`${m.name}, you, in this conversation`,children:[e.jsx("span",{className:"s-thread-participant-face",children:e.jsx(P,{name:m.name,placement:"turn",size:28,className:"s-thread-participant-avatar"})}),e.jsx(B,{name:`${m.name} (you)`,runtime:null,state:"In this conversation",action:null})]}):e.jsxs("span",{className:"s-thread-participant-observer",role:"group",tabIndex:0,"aria-label":`${m.name}, observing, not in this conversation`,children:[e.jsx(ce,{size:15,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx(B,{name:m.name,runtime:null,state:"Observing, not in this conversation",action:null})]}),N?e.jsxs("div",{id:w,className:"s-thread-participant-roster",role:"dialog","aria-label":"Conversation participants",onClick:t=>t.stopPropagation(),children:[e.jsx("strong",{className:"s-thread-participant-roster-title",children:"Participants"}),e.jsxs("div",{className:"s-thread-participant-roster-list",children:[f.map(t=>{const l=R(t),g=[t.harness,t.model].filter(Boolean).join(" · "),F=e.jsxs(e.Fragment,{children:[e.jsx(P,{agent:t.agent??void 0,name:t.name,placement:"turn",size:24,className:"s-thread-participant-roster-avatar"}),e.jsxs("span",{children:[e.jsx("strong",{children:t.name}),g?e.jsx("small",{children:g}):null]})]});return l?e.jsx("button",{type:"button",className:"s-thread-participant-roster-row",onClick:()=>q(t),children:F},t.id):e.jsx("div",{className:"s-thread-participant-roster-row",children:F},t.id)}),m.active?e.jsxs("div",{className:"s-thread-participant-roster-row",children:[e.jsx(P,{name:m.name,placement:"turn",size:24,className:"s-thread-participant-roster-avatar"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[m.name," (you)"]}),e.jsx("small",{children:"Operator"})]})]}):null]})]}):null]}),p&&e.jsx("button",{type:"button",className:`s-thread-add-participant-trigger${p.on?" is-on":""}`,onClick:p.toggle,title:p.on?"Close the column beside the stage":"Keep this conversation beside the stage","aria-label":p.on?"Close beside":"Keep beside","aria-pressed":p.on,children:e.jsx(de,{size:14,strokeWidth:1.9,"aria-hidden":"true"})}),o&&e.jsx("button",{type:"button",className:"s-thread-add-participant-trigger",onClick:a,title:"Add participant","aria-label":"Add participant",children:e.jsx(pe,{size:14,strokeWidth:1.9,"aria-hidden":"true"})})]})]})}function bt({canonicalConversationId:n,conversationAlias:s}){return e.jsxs("div",{className:"s-thread-identity-row",children:[e.jsxs("button",{type:"button",className:"s-thread-identity-chip",title:n,onClick:()=>{M(n)},children:[e.jsx("span",{children:ie()}),e.jsx("strong",{children:le(n)})]}),s&&e.jsxs("span",{className:"s-thread-identity-chip",title:s,children:[e.jsx("span",{children:"Alias"}),e.jsx("strong",{children:s})]})]})}function yt({agents:n,addParticipantId:s,setAddParticipantId:i,addingParticipant:r,addParticipantError:d,onCancel:x,onSubmit:h}){return e.jsxs("form",{className:"s-thread-add-participant",onSubmit:c=>{c.preventDefault(),h()},children:[e.jsxs("div",{className:"s-thread-add-participant-row",children:[e.jsxs("div",{className:"s-thread-add-participant-field",children:[e.jsx("label",{className:"s-thread-add-participant-label",htmlFor:"thread-add-participant-select",children:"Agent"}),e.jsx("select",{id:"thread-add-participant-select",className:"s-thread-add-participant-select",value:s,onChange:c=>i(c.target.value),autoFocus:!0,children:n.map(c=>e.jsx("option",{value:c.id,children:c.name},c.id))})]}),e.jsxs("div",{className:"s-thread-add-participant-actions",children:[e.jsx("button",{type:"button",className:"s-btn s-btn-sm",onClick:x,disabled:r,children:"Cancel"}),e.jsx("button",{type:"submit",className:"s-btn s-btn-primary s-btn-sm",disabled:r||s.trim().length===0,children:r?"Adding...":"Add"})]})]}),d&&e.jsx("div",{className:"s-thread-add-participant-error",children:d})]})}export{yt as AddParticipantForm,jt as ConversationHeader,bt as ConversationIdentityRow};
@@ -1,2 +0,0 @@
1
- import{j as r,r as o}from"./index-C8uS5szO.js";import{o as wt,w as ha,q as Zt,s as Bs,t as pa,u as fa,v as ga,x as Us,y as ya,z as wa,A as Sa,B as ba}from"./NewChatComposer-JjLbm3W2.js";import{a as U}from"./api-CaROe5_H.js";import"./runtime-picker-DdsttHHc.js";import{b as Hs,u as va}from"./router-BKiMcYa7.js";import{u as Ta,C as xa}from"./ConversationComposer-B7RU6LKd.js";import"./index-C5cX8dkl.js";import{b as Ca}from"./machine-scope-DJt9RZ2w.js";import{d as ka,a as Ma,k as ae,n as Ws,o as Na,q as Ne,u as Aa,v as Ia,w as ja,x as Ra,c as _s,S as Vs,y as Ea,z as La,A as $a,B as Fa,b as Ks,D as Pa,E as Oa,i as qa,p as Da,r as es,F as Ba,G as Ua,H as Ha,I as Wa,J as _a,K as Qs,L as Va,M as Ge,N as Ka,O as Qa,P as zs,Q as za,R as Ja,T as Ga,U as Ya,W as Js,V as Xa,X as Gs,Y as Za,Z as er,_ as tr}from"./conversation-model-BGFHoxQ0.js";import{u as sr}from"./sse-v5QLsOHV.js";import{n as ts,t as St,f as Ys}from"./time-Dhsh_2EG.js";import{s as nr,h as ar,g as rr,b as or,j as ir,T as lr,k as cr,f as dr}from"./conversations-Cbg9h_Af.js";import{M as ur}from"./message-markup-DgFSyb3f.js";import{a as Xs,i as ss,b as mr}from"./message-visibility-DwxgcgYK.js";import{d as hr}from"./operator-attention-DGR4kOog.js";import{f as ns,a as pr}from"./scoutbot-Bk3nyrkj.js";import{s as fr}from"./sessionRead-CvFz2RHv.js";import{u as gr,a as yr}from"./Provider-5Hotn7NQ.js";import{o as bt}from"./openContent-C6XO6kr5.js";import{c as Ye}from"./clipboard-e3fSpeo7.js";import{A as as}from"./AgentAvatar-BIwg54Tj.js";import{d as wr}from"./types-B0PlfpKc.js";/* empty css */import{ConversationHeader as Sr,ConversationIdentityRow as br,AddParticipantForm as vr}from"./ConversationHeader-CCSU8uo_.js";import{CommsFlowPane as Tr}from"./CommsFlowGraph-Czg-KTS0.js";import{a as xr}from"./use-beside-Df-F2Uvg.js";import{FanOutRow as Cr,ThreadDayDivider as kr}from"./ConversationFeedRows-DVqnZQH0.js";import{T as Mr,t as Zs,m as en,a as Nr,b as Ar,o as Ir,d as jr,s as Rr,l as Er,c as Lr,e as $r,W as Fr,f as Pr,g as Or}from"./ConversationPanels-C9yCAoJy.js";import{u as qr}from"./tail-events-DQ46QBW1.js";import{PinnedAskCard as Dr,ConversationStatusStrip as Br}from"./ConversationStatus-CK-YfLpi.js";import"./HarnessMark-Bt47OeHy.js";import"./colors-CFlbwC25.js";import"./agent-state-DDhnFEEP.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./x-DI1ktCYb.js";import"./createLucideIcon-DkjnzvcJ.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./loader-circle-DurUYl7E.js";import"./file-text-ChtICwub.js";import"./scout-voice-DOQ_B77g.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./zap-sKPkh4sQ.js";import"./index-BWHgHrtv.js";import"./mentions-Ctw1ECUC.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./eye-CtqSV8BS.js";import"./terminal-96JWDYDL.js";import"./surface-activity-B1rgWB1i.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./SpriteAvatar-BW1JzkDt.js";import"./CrewAvatar-CJhuqTsJ.js";import"./BackToPicker-Bys9ColC.js";import"./AstronautSuit-C-4I5YKi.js";import"./panel-right-BNTJhy8M.js";import"./comms-gesture-_aGFo6g3.js";import"./CommsCanvas-DOKw3Q8i.js";import"./comms-deck-CBhsXnY-.js";import"./CommsFlowMap-CzBWvSa5.js";import"./CommsSelection-g1twA-Lb.js";/* empty css */import"./use-conversation-list-A_YUf8lo.js";import"./agent-master-model-C-KdOFDK.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-D7n3vK8t.js";import"./proxy-DOG46ja4.js";import"./activity-CSUhvjD0.js";import"./message-circle-CSiJj6yo.js";import"./check-B8dMv3Is.js";import"./sparkles-BbOFw3d0.js";const rn="scout:conversations:failure-dismissals:v1",Ur=64;let is={};function on(){try{if(typeof localStorage<"u"){const n=JSON.parse(localStorage.getItem(rn)??"null");_r(n)&&(is=ls(n))}}catch{}return ls(is)}function Hr(n){is=ls(n);try{typeof localStorage<"u"&&localStorage.setItem(rn,JSON.stringify(n))}catch{}}function tn(n){return new Set(on()[n]??[])}function Wr(n,c){const d=on(),f=(d[n]??[]).filter(C=>C!==c);f.push(c),d[n]=f.slice(-100);const y=Object.keys(d);for(const C of y.slice(0,Math.max(0,y.length-Ur)))delete d[C];return Hr(d),new Set(d[n])}function ls(n){return Object.fromEntries(Object.entries(n).map(([c,d])=>[c,[...d]]))}function _r(n){return!n||typeof n!="object"||Array.isArray(n)?!1:Object.values(n).every(c=>Array.isArray(c)&&c.every(d=>typeof d=="string"&&d.length>0))}const Vr=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)(?:$|[?#])/iu,Kr=/\bhttps?:\/\/[^\s<>"')\]]+/giu;function Xe(n){if(typeof n!="string")return null;try{const c=new URL(n.trim());return c.protocol==="http:"||c.protocol==="https:"?c.toString():null}catch{return null}}function J(n,c){const d=n?.[c];return typeof d=="string"&&d.trim()?d.trim():null}function Qr(n){return n.mediaType.toLowerCase().startsWith("image/")}function zr(n){return Vr.test(n)}function Jr(n){try{const c=new URL(n),d=[c.pathname==="/"?"":c.pathname,c.search].join("").trim();return{host:c.hostname.replace(/^www\./iu,""),detail:d||c.hostname}}catch{return{host:n,detail:n}}}function Gr(n){const c=new Set,d=[];for(const f of n.matchAll(Kr)){const y=f[0]?.replace(/[.,;:!?]+$/u,""),C=Xe(y);!C||c.has(C)||(c.add(C),d.push(C))}return d}const Yr=/^\/api\/blobs\/[^/]+$/u;function rs(n){try{const c=new URL(n);return Yr.test(c.pathname)?`${c.pathname}${c.search}`:n}catch{return n}}function vt(n){return Xe(n.url)??Xe(J(n.metadata,"url"))??Xe(J(n.metadata,"href"))}function Xr(n){const c=n.metadata??null,d=J(c,"kind")??J(c,"type"),f=vt(n);if(!f||d!=="link_preview"&&d!=="link-preview"&&n.mediaType!=="text/x-uri")return null;const y=Jr(f);return{id:n.id,url:f,title:J(c,"title")??y.host,description:J(c,"description"),imageUrl:Xe(J(c,"imageUrl")??J(c,"image")),siteName:J(c,"siteName")??y.host}}function Zr({src:n,alt:c}){const[d,f]=o.useState(!1);return d?r.jsxs("a",{className:"s-message-embed s-message-embed--file",href:n,target:"_blank",rel:"noreferrer",children:[r.jsx("span",{className:"s-message-embed-title",children:c}),r.jsx("span",{className:"s-message-embed-description",children:"Preview unavailable"})]}):r.jsx("a",{className:"s-message-embed s-message-embed--image",href:n,target:"_blank",rel:"noreferrer",children:r.jsx("img",{src:n,alt:c,loading:"lazy",decoding:"async",onError:()=>f(!0)})})}function eo({preview:n}){return r.jsxs("a",{className:"s-message-embed s-message-embed--link",href:n.url,target:"_blank",rel:"noreferrer",children:[n.imageUrl&&r.jsx("span",{className:"s-message-embed-thumb",children:r.jsx("img",{src:n.imageUrl,alt:"",loading:"lazy",decoding:"async"})}),r.jsxs("span",{className:"s-message-embed-copy",children:[n.siteName&&r.jsx("span",{className:"s-message-embed-site",children:n.siteName}),r.jsx("span",{className:"s-message-embed-title",children:n.title}),n.description&&r.jsx("span",{className:"s-message-embed-description",children:n.description})]})]})}function to({message:n}){const c=n.attachments??[],d=new Set,f=[],y=[];for(const m of c){const N=vt(m);if(N&&Qr(m)){d.add(m.id),f.push({id:m.id,src:rs(N),alt:m.fileName??"Image attachment"});continue}const W=Xr(m);W&&(d.add(m.id),y.push(W))}const C=new Set(y.map(m=>m.url)),re=new Set(c.map(vt).filter(m=>!!m));for(const m of Gr(n.body))re.has(m)||C.has(m)||zr(m)&&f.push({id:m,src:rs(m),alt:"Embedded image"});const H=c.filter(m=>!d.has(m.id));return f.length===0&&y.length===0&&H.length===0?null:r.jsxs("div",{className:"s-message-embeds",children:[f.map(m=>r.jsx(Zr,{src:m.src,alt:m.alt},m.id)),y.slice(0,1).map(m=>r.jsx(eo,{preview:m},m.id)),H.map(m=>{const N=vt(m),W=N?rs(N):null,q=m.fileName??J(m.metadata,"title")??m.mediaType;return W?r.jsxs("a",{className:"s-message-embed s-message-embed--file",href:W,target:"_blank",rel:"noreferrer",children:[r.jsx("span",{className:"s-message-embed-title",children:q}),r.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id):r.jsxs("div",{className:"s-message-embed s-message-embed--file",children:[r.jsx("span",{className:"s-message-embed-title",children:q}),r.jsx("span",{className:"s-message-embed-description",children:m.mediaType})]},m.id)})]})}function so(n){const{sessionIds:c,active:d}=n,f=c.join("|"),y=d&&c.length>0,[C,re]=o.useState([]);return o.useEffect(()=>{re([])},[f]),o.useEffect(()=>{if(!y)return;let H=!1;const m=new URLSearchParams({limit:String(Mr*3),transcripts:"true"});return U(`/api/tail/recent?${m.toString()}`).then(N=>{if(H)return;const W=(N.events??[]).filter(q=>Zs(q,c));W.length!==0&&re(q=>en(q,W))}).catch(()=>{}),()=>{H=!0}},[y,f]),qr(H=>{y&&Zs(H,c)&&re(m=>en(m,[H]))},y),o.useMemo(()=>y?Nr(C):[],[y,C])}const no=3500;function sn(n){const c=n?.trim().replace(/^#/,"");if(!c?.startsWith("msg-"))return null;const d=c.slice(4).trim();if(!d)return null;try{return decodeURIComponent(d)}catch{return d}}const ao=64;function ro(n){const c=n?.clientMessageId;return typeof c=="string"&&c.trim()?c.trim():null}function nn(n){const c=n.body.replace(/\s+/gu," ").trim();if(c)return c.length>180?`${c.slice(0,179).trimEnd()}…`:c;const d=n.attachments?.length??0;return d===1?"Attachment":d>1?`${d} attachments`:"Message"}function an(n,c){const d=n.toLocaleLowerCase().indexOf(c.toLocaleLowerCase());if(d<0)return n;const f=n.slice(0,d),y=n.slice(d+c.length);return!f&&y.startsWith(" ")?y.slice(1):f.endsWith(" ")&&y.startsWith(" ")?`${f}${y.slice(1)}`:`${f}${y}`}function oo(n){return n instanceof TypeError||typeof DOMException<"u"&&n instanceof DOMException&&n.name==="AbortError"}function Ui({conversationId:n,initialDraft:c,navigate:d,embedded:f,showBackNav:y=!0,beside:C,backLabel:re,treatment:H="standard"}){const{agents:m,route:N,openContextCapture:W}=gr(),q=Hs(N),k=o.useMemo(()=>Ca(m,q),[m,q]),[h,Tt]=o.useState(null),cs=o.useRef(null);cs.current=h;const Ze=o.useMemo(()=>wt(n),[n]),[ln,cn]=o.useState(()=>Ze?{[n]:Ze}:{}),b=ln[n]??Ze??[],[dn,ds]=o.useState(()=>Ze!==null),Ae=o.useRef(null),us=o.useMemo(()=>{const e=Ae.current;return e===null?null:new Set(b.filter(t=>!e.has(t.id)).map(t=>t.id))},[b]),et=Ae.current===null&&b.length>0;o.useEffect(()=>{if(b.length===0)return;const e=Ae.current??new Set;for(const t of b)e.add(t.id);Ae.current=e},[b]),o.useEffect(()=>{Ae.current=null,ds(wt(n)!==null)},[n]);const ms=!dn&&b.length===0,G=o.useCallback(e=>{cn(t=>{const s=t[n]??wt(n)??[],a=typeof e=="function"?e(s):e,i=ha(n,a);return{...t,[n]:i}})},[n]),un=Zt(n),[g,we]=o.useState(un),[Ie,je]=o.useState([]),[tt,xt]=o.useState(null),[st,Re]=o.useState(null),[nt,mn]=o.useState(()=>typeof window>"u"?null:sn(window.location.hash)),[hs,oe]=o.useState(null),[Ct,ps]=o.useState(()=>tn(n)),[Se,kt]=o.useState(!1),[hn,Ee]=o.useState(!1),[Mt,at]=o.useState(0),Le=o.useRef(null),$e=o.useRef(null),pn=o.useRef(null),Fe=o.useRef(!0),rt=o.useRef(!1),be=o.useRef(null),A=o.useRef(null),Pe=o.useRef(new Set),Oe=o.useRef(null),fs=o.useRef(0),gs=o.useRef(null),qe=o.useRef(null),De=o.useRef(new Set),X=o.useRef(n);X.current=n;const ie=o.useRef(new Map),fn=Bs(n),ot=o.useRef(!1);o.useLayoutEffect(()=>{const e=$e.current,t=Le.current;!e||!t||(t.scrollTop=e.scrollTop+(t.scrollHeight-e.scrollHeight),$e.current=null,ot.current=!0)}),o.useEffect(()=>{kt(!1),$e.current=null,ot.current=!1,Fe.current=!0,rt.current=!1,Ee(!1),at(0),Vt(new Set),ie.current.clear(),we(Zt(n)),ps(tn(n))},[n]);const it=o.useCallback(async e=>{let s=typeof e.metadata?.flightId=="string"?e.metadata.flightId.trim():"";if(!s&&e.replyToMessageId)try{s=(await U(`/api/flights?conversationId=${encodeURIComponent(n)}&active=false`)).find(i=>i.messageId===e.replyToMessageId)?.id??""}catch{}await hr({...s?{flightId:s}:{},conversationId:n,messageId:e.replyToMessageId??e.id,itemUpdatedAt:ts(e.createdAt)??Date.now()})},[n]),ys=o.useCallback(e=>{const t=e.replyToMessageId??e.id;ps(Wr(n,e.id)),ns({type:"dismiss-conversation-failure",conversationId:n,messageId:t,reason:"The operator cleared this delivery issue"});const s=`${n}:${e.id}`;De.current.add(s),it(e).catch(()=>{De.current.delete(s)})},[n,it]);o.useEffect(()=>{for(const e of b){if(!Ct.has(e.id)||!Xs(e))continue;const t=`${n}:${e.id}`;De.current.has(t)||(De.current.add(t),it(e).catch(()=>{De.current.delete(t)}))}},[n,Ct,b,it]);const x=h?.agentId??null,M=h?.kind==="direct",lt=o.useMemo(()=>new Set([n,...h?.equivalentConversationIds??[]]),[n,h?.equivalentConversationIds]),Q=o.useMemo(()=>x?k.find(e=>e.id===x)??null:null,[k,x]),ws=ka(h),gn=Ma({resolvedAgentId:Q?.id,sessionId:ws,machineId:q}),[Nt,Ss]=o.useState(null);o.useEffect(()=>{U("/api/fleet").then(e=>{Ss(t=>ae(t,Ws(e.activeAsks,n,x)))}).catch(()=>{})},[n,x]);const D=o.useCallback(async(e={})=>{const t=e.messageMode??"none",s=e.includeMetadata??!0;oe(null);try{const a=s?await U(`/api/session/${encodeURIComponent(n)}`).catch(()=>null):cs.current;if(X.current!==n)return;Tt(v=>ae(v,a));const i=a?.agentId??null,l=a?.id&&a.id!==n?a.id:n;if(l!==n){d({view:"conversation",conversationId:l});return}const u=wt(l),R=pa(l),w=t==="initial"&&!R,p=t==="refresh"||t==="initial",S=Promise.all([U(`/api/flights?conversationId=${encodeURIComponent(l)}`).catch(()=>[]),U("/api/fleet?limit=24&activityLimit=160").catch(()=>Na())]),V=await(w?fa(l):p?ga(l,{refresh:!0}):Promise.resolve(u));if(X.current!==n)return;const L=Ne(V??[]),ye=L.filter(v=>!ss(v));V&&G(v=>ae(v,Aa(v,ye))),ds(!0),fr(l);const E=L.at(-1);E&&qe.current!==E.id&&(qe.current=E.id,U(`/api/conversations/${encodeURIComponent(l)}/read-cursor`,{method:"POST",body:JSON.stringify({lastReadMessageId:E.id})}).catch(()=>{qe.current===E.id&&(qe.current=null)}));const[ne,z]=await S;if(X.current!==n)return;const K=Ia(ne),Y=Zt(l),Me=K??Y;Pe.current=new Set([...ne.map(v=>v.invocationId),...Y?.invocationId?.startsWith("pending:")?[]:Y?.invocationId?[Y.invocationId]:[]]),K&&Y?.id===K.id&&Us(l,K.id);const P=Me?.agentId??i??null,Xt=ja(z.activity,Me,l,P),yt=Ra(z.activeAsks,Me,l,P);we(v=>ae(v,Me)),je(v=>ae(v,Xt)),Re(v=>ae(v,yt)),Ss(v=>ae(v,Ws(z.activeAsks,l,i)))}catch(a){if(X.current!==n)return;oe(a instanceof Error?a.message:String(a))}},[n,d,G]);o.useEffect(()=>{D({messageMode:"initial"})},[D]),o.useEffect(()=>{qe.current=null},[n]),o.useEffect(()=>{Oe.current=g},[g]);const yn=o.useCallback(async()=>{if(Se||!Bs(n))return;const e=Le.current,t=e?{scrollHeight:e.scrollHeight,scrollTop:e.scrollTop}:null;kt(!0),oe(null);try{const s=await ya(n);if(X.current!==n)return;t&&($e.current=t),G(Ne(s).filter(a=>!ss(a)))}catch(s){X.current===n&&oe(s instanceof Error?s.message:String(s))}finally{X.current===n&&kt(!1)}},[n,Se,G]),[I,B]=o.useState(()=>c??""),[le,ce]=o.useState(null),[_,ct]=o.useState(!1),[T,wn]=o.useState("operator"),[de,Be]=o.useState({open:!1,query:"",triggerStart:-1,index:0}),[ue,Ue]=o.useState({open:!1,query:"",triggerStart:-1,index:0}),[$,Z]=o.useState(null),[At,dt]=o.useState(!1),[It,ut]=o.useState(""),[Sn,He]=o.useState(null),[bn,jt]=o.useState(!1);o.useEffect(()=>{dt(!1),ut(""),He(null),jt(!1)},[n]),o.useEffect(()=>{if(!c)return;const e=`${n}:${c}`;gs.current!==e&&(gs.current=e,B(c),requestAnimationFrame(()=>A.current?.focus()))},[n,c]);const ee=o.useMemo(()=>{const e=new Map;for(const t of h?.participants??[])e.set(t.actorId,t),t.agentId&&e.set(t.agentId,t);return e},[h]),Rt=o.useMemo(()=>{const e=new Set,t=[];for(const s of h?.participantIds??[]){if(s==="operator")continue;const a=ee.get(s),i=a?.scopedAlias?.trim().replace(/^@+/,"");if(!i)continue;const l=i.toLowerCase();e.has(l)||(e.add(l),t.push({id:s,label:a?.label??a?.displayName??i,name:a?.displayName??i,handle:i}))}for(const s of k){const a=s.handle?.trim().replace(/^@+/,"")??_s(s.id)??s.id;if(!a)continue;const i=a.toLowerCase();e.has(i)||(e.add(i),t.push({id:s.id,label:a,name:s.name??a,handle:a}))}return t.sort((s,a)=>s.handle.localeCompare(a.handle))},[ee,k,h]),vn=o.useMemo(()=>{if(!de.open)return[];const e=de.query.toLowerCase();return e?Vs.filter(t=>t.command.toLowerCase().startsWith("/"+e)||t.command.toLowerCase().includes(e)):Vs},[de.open,de.query]),Tn=o.useMemo(()=>{if(!ue.open)return[];const e=ue.query.toLowerCase();return e?Rt.filter(t=>t.handle.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.label.toLowerCase().includes(e)).slice(0,8):Rt.slice(0,8)},[ue.open,ue.query,Rt]),xn=o.useCallback(()=>{Be(e=>e.open?{...e,open:!1}:e),Ue(e=>e.open?{...e,open:!1}:e)},[]),Cn=o.useCallback((e,t)=>{const s=Ea(e,t);Be(s?i=>({open:!0,query:s.query,triggerStart:s.start,index:i.open&&i.triggerStart===s.start?i.index:0}):i=>i.open?{...i,open:!1}:i);const a=La(e,t);Ue(a?i=>({open:!0,query:a.query,triggerStart:a.start,index:i.open&&i.triggerStart===a.start?i.index:0}):i=>i.open?{...i,open:!1}:i)},[]),kn=o.useCallback(e=>{const t=A.current,s=de.triggerStart;if(s<0)return;const a=t?.selectionStart??I.length,i=I.slice(0,s),l=I.slice(a),u=e.insert,R=`${i}${u}${l}`;B(R),Be(w=>({...w,open:!1})),requestAnimationFrame(()=>{const w=A.current;if(!w)return;const p=i.length+u.length;w.focus(),w.setSelectionRange(p,p)})},[I,de.triggerStart]),Mn=o.useCallback(e=>{const t=A.current,s=ue.triggerStart;if(s<0)return;const a=t?.selectionStart??I.length,i=I.slice(0,s),l=I.slice(a),u=l.length===0||!l.startsWith(" "),R=`@${e.handle}${u?" ":""}`,w=`${i}${R}${l}`;B(w),Ue(p=>({...p,open:!1})),requestAnimationFrame(()=>{const p=A.current;if(!p)return;const S=i.length+R.length;p.focus(),p.setSelectionRange(S,S)})},[I,ue.triggerStart]);o.useEffect(()=>{const e=A.current;if(!e)return;e.style.height="0px";const t=Math.min(Math.max(e.scrollHeight,40),160);e.style.height=`${t}px`,e.style.overflowY=e.scrollHeight>t?"auto":"hidden"},[I]),o.useEffect(()=>{U("/api/user").then(e=>wn(e.name)).catch(()=>{})},[]);const mt=o.useMemo(()=>$a(b,T),[b,T]);o.useEffect(()=>{$===null||mt===null||mt>=$&&Z(null)},[$,mt]);const Nn=o.useMemo(()=>nr(g),[g]),ve=Date.now(),An=ar(g,mt,ve),Et=Nn&&!rr(g)&&!An,bs=M&&(_||$!==null||Et),vs=M&&Fa({sending:_,awaitingResponse:$!==null,currentFlight:g}),F=Ks({name:Q?.name,agentName:h?.agentName,id:x,title:h?.title}),j=o.useMemo(()=>M?Pa({agentName:F,agentState:Q?.state??null,sending:_,currentFlight:g,showWorkingTurn:Et,awaitingResponse:$!==null}):{label:"Open",detail:"",tone:"idle",showStrip:!1,showTyping:!1},[Q?.state,F,$,g,ve,M,_,Et]),Lt=g?.startedAt??st?.startedAt??$,$t=ts(Lt),Ts=Xa(Lt,ve),[,In]=o.useState(0);o.useEffect(()=>{if(!j.showTyping||$t===null)return;const e=Math.max(0,Date.now()-$t),t=[Js.sustained,Js.long].find(a=>a>e);if(t===void 0)return;const s=window.setTimeout(()=>In(a=>a+1),t-e+50);return()=>window.clearTimeout(s)},[$t,j.showTyping,Ts]);const jn="Live",Ft=o.useMemo(()=>Oa({currentFlight:g,presence:j,turnActivity:Ie,turnAsk:st,awaitingResponseSince:$,nowMs:ve}),[$,g,ve,j,Ie,st]),Rn="s-thread-msg-card s-thread-msg-working-card s-thread-msg-card--avatar-row",En="s-thread-msg-kind",Ln="s-thread-turn-snapshot",$n="s-thread-turn-snapshot-pulse",Fn="s-thread-presence-line",Pn=["s-thread-presence-strip",`s-thread-presence-strip--${Ts}`].filter(Boolean).join(" "),Pt=h?qa(h):F,We=h?.id??n,On=h?.alias?.trim()||null,ht=Da(h?.workspaceRoot),qn=j.tone,Ot=b.length===0&&M&&(j.showTyping||g!==null||Ie.length>0||st!==null||$!==null),xs=o.useMemo(()=>h?h.participantIds.includes("operator"):M,[M,h]),_e=g?.agentId??x,Ve=_e?es(k,[_e]):null,Ke=Ve?.id??_e,Qe=g?.sessions.at(-1)?.sessionId??Ve?.harnessSessionId??void 0,Cs=g?.id?()=>{bt(d,{view:"sessions",flightId:g.id,...Ke?{agentId:Ke}:{},...Qe?{sessionId:Qe}:{},...q?{machineId:q}:{}},{returnTo:N})}:void 0,ks=g?.id??null;o.useEffect(()=>{if(!ks||!Ke){xt(null);return}let e=!1;const t=Qe?`?sessionId=${encodeURIComponent(Qe)}`:"",s=async()=>{try{const i=await U(`/api/agents/${encodeURIComponent(Ke)}/observe${t}`);if(e)return;xt(l=>ae(l,i))}catch{}};s();const a=window.setInterval(()=>{s()},no);return()=>{e=!0,window.clearInterval(a),xt(null)}},[ks,Ke,Qe]);const qt=o.useMemo(()=>Ar({flight:g,agent:Ve??Q,sessionMeta:h,observeSessionId:tt?.sessionId}),[Q,g,h,tt?.sessionId,Ve]),Ms=so({sessionIds:qt,active:j.showTyping||Ot}),Dn=o.useMemo(()=>Ir({observe:tt,flight:g}),[g,tt]),te=Ms.length>0?Ms:Dn,Dt=o.useMemo(()=>te.length>0?null:jr({flight:g,hasSessionScope:qt.length>0,awaitingResponse:$!==null}),[$,g,qt.length,te.length]),Bt=Rr(te),Ut=Er(te),Ns=te.at(-1)??null,Ht=Ns?St(Ns.ts,ve):null,me=o.useMemo(()=>Ut?{...Ft,latest:Ut,...Bt?{activityLabel:Bt}:{},...Ht?{lastActivityLabel:Ht}:{}}:Ft,[Ht,Ut,Ft,Bt]),Bn=`${F}: ${me.latest}`,As=_e&&Ba(Ve)?()=>{bt(d,{view:"terminal",agentId:_e,mode:"takeover"},{returnTo:N})}:void 0,Wt=M?()=>{f&&ns({type:"focus-composer",reason:"Steer the active conversation"})||requestAnimationFrame(()=>{A.current?.focus({preventScroll:!0}),A.current?.scrollIntoView({block:"nearest"})})}:void 0,[Te,Is]=o.useState(()=>{if(f||typeof window>"u")return"thread";const e=new URLSearchParams(window.location.search).get("view");return e==="flow"||e==="map"||e==="canvas"?e:"thread"}),Un=o.useCallback(e=>Is(e),[]),js=xr(d,Hs(N)??void 0),Hn=o.useCallback(e=>{Is("thread"),js(e)},[js]),Wn=va();o.useEffect(()=>{if(f||typeof window>"u")return;const e=new URL(window.location.href),t=Te==="thread"?"":Te;(e.searchParams.get("view")??"")!==t&&(t?e.searchParams.set("view",t):e.searchParams.delete("view"),window.history.replaceState(window.history.state,"",`${e.pathname}${e.search}${e.hash}`))},[f,Te,Wn.searchStr]);const _n=o.useMemo(()=>(h?h.participantIds.filter(t=>t!=="operator"):x?[x]:[]).map(t=>{const s=es(k,[t]),a=ee.get(t);return{id:t,name:a?.scopedAlias??s?.name??a?.displayName??_s(t)??t,title:a?.label??s?.id??t,agent:s,sessionId:a?.sessionId??null,harness:s?.harness??a?.harness??null,model:s?.model??null,reasoningEffort:s?.reasoningEffort??null}}),[x,ee,k,h]),Vn=o.useMemo(()=>({name:T,active:xs}),[xs,T]),he=o.useMemo(()=>new Map(b.map(e=>[e.id,e])),[b]),_t=o.useMemo(()=>k.find(e=>pr(e)&&!!e.conversationId?.trim())?.conversationId?.trim()??null,[k]),ze=o.useMemo(()=>Ua(b),[b]),[Kn,Vt]=o.useState(()=>new Set),Qn=o.useCallback(e=>{Vt(t=>{const s=new Set(t);return s.delete(e)||s.add(e),s})},[]),Rs=o.useMemo(()=>{const e=new Map;for(const t of ze)if(t.kind==="fanout")for(const s of t.messages)e.set(s.id,t.key);return e},[ze]),pt=o.useCallback(e=>{const t=Rs.get(e);t&&Vt(l=>l.has(t)?l:new Set(l).add(t));const s=document.getElementById(`msg-${e}`);if(!s)return;const a=s.closest(".s-thread-fanout")??s,i=a===s?"s-thread-msg--flash":"s-thread-fanout--flash";a.scrollIntoView({behavior:"smooth",block:"center"}),a.classList.add(i),window.setTimeout(()=>a.classList.remove(i),1200)},[Rs]);o.useEffect(()=>{const e=()=>mn(sn(window.location.hash));return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),o.useEffect(()=>{if(!nt||!he.has(nt))return;const e=window.setTimeout(()=>pt(nt),50);return()=>window.clearTimeout(e)},[nt,he,pt]),sr(o.useCallback(e=>{if(e.kind==="message.posted"){const t=e.payload?.message;if(!t||!lt.has(t.conversationId))return;const s=t.actorId==="operator",a=M&&!s&&t.class==="agent",i={id:t.id,conversationId:t.conversationId,actorId:t.actorId,actorName:a?F:Ha(t.actorId,k,T),body:t.body,createdAt:t.createdAt,class:s?"operator":t.class,attachments:t.attachments,metadata:t.metadata,replyToMessageId:t.replyToMessageId??t.n??null};if(ss(i))return;if(G(l=>{const u=ro(t.metadata),R=u?ie.current.get(u):void 0;if(l.some(w=>w.id===t.id))return u&&ie.current.delete(u),l;if(s&&u){const w=Wa(l,u,R);if(w!==-1){const p=[...l];return p[w]=i,ie.current.delete(u),Ne(p)}}return Ne([...l,i])}),a){const l=ts(t.createdAt)??Date.now();Z(u=>u===null||l<u||or(Oe.current)?u:null),we(u=>ir(u)?null:u)}return}if(e.kind==="invocation.requested"){const t=e.payload?.invocation;if(!_a(t,lt))return;Pe.current.add(t.id),je([]),Re(null),Z(s=>s??Date.now());return}if(e.kind==="conversation.upserted"){const t=e.payload?.conversation;t?.id&&lt.has(t.id)&&D({messageMode:"none",includeMetadata:!1});return}if(e.kind==="flight.updated"){const t=e.payload?.flight;if(!t||t.targetAgentId!==x||!(Pe.current.has(t.invocationId)||Oe.current?.id===t.id))return;if(lr.has(t.state)){Us(n,t.id),we(l=>l?.id===t.id?null:l),je([]),Re(null),Z(null),D({messageMode:"refresh",includeMetadata:!1});return}Pe.current.add(t.invocationId);const a=Oe.current?.id===t.id,i=Qs(t,n,x??"",Oe.current);cr(i)&&Z(null),we(i),a||(je([]),Re(null));return}e.kind!=="agent.endpoint.upserted"&&e.kind==="unknown"&&D({messageMode:"refresh"})},[x,F,n,lt,M,D,T,k])),o.useEffect(()=>{if(!bs)return;const e=setInterval(()=>{D({messageMode:"refresh",includeMetadata:!1})},5e3);return()=>clearInterval(e)},[bs,D]),o.useEffect(()=>{const e=()=>{if(document.visibilityState!=="visible")return;const t=Date.now();t-fs.current<1e3||(fs.current=t,D({messageMode:"refresh"}))};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[D]);const Kt=o.useRef(null),Es=o.useRef(!1),Qt=o.useRef(!1),zt=o.useCallback(e=>{const t=Le.current;t&&(rt.current=!0,be.current!==null&&clearTimeout(be.current),e==="instant"?t.scrollTop=t.scrollHeight:t.scrollTo({top:t.scrollHeight,behavior:"smooth"}),be.current=setTimeout(()=>{rt.current=!1,be.current=null},e==="smooth"?700:0))},[]);o.useEffect(()=>()=>{be.current!==null&&clearTimeout(be.current)},[]);const zn=o.useCallback(()=>{const e=Le.current;if(!e||rt.current)return;const s=e.scrollHeight-e.clientHeight-e.scrollTop<=ao;Fe.current=s,s?(Ee(!1),at(0)):Ee(!0)},[]),Jn=o.useCallback(()=>{Fe.current=!0,Ee(!1),at(0),zt("smooth")},[zt]);o.useEffect(()=>{const e=b.at(-1)?.id??null,t=!!(e&&e!==Kt.current),s=Va({newestMessageId:e,previousNewestMessageId:Kt.current,showTyping:j.showTyping,previousShowTyping:Es.current,historyRestorePending:ot.current||$e.current!==null,initialScrollDone:Qt.current,nearBottom:Fe.current});s!=="none"?(zt(s),Qt.current=!0):t&&Qt.current&&!Fe.current&&(Ee(!0),at(a=>a+1)),ot.current=!1,Kt.current=e,Es.current=j.showTyping});const[,Gn]=o.useState(0);o.useEffect(()=>{const e=setInterval(()=>Gn(t=>t+1),15e3);return()=>clearInterval(e)},[]);const pe=Ta(),[fe,se]=o.useState([]),[Ls,ft]=o.useState("queue"),[xe,Ce]=o.useState(null),ke=async(e,t)=>{const s=e.trim(),a=t?.attachments??[],i=t?.replyTarget??null;if(!s&&a.length===0||_)return"failed";const u=t?.forceAction??Gs({isDm:M,hasOutstandingReply:vs}),R=Date.now(),w=Sa(),p={id:`optimistic-${w}`,conversationId:n,actorId:"operator",actorName:T,body:s,createdAt:R,class:"operator",...i?{replyToMessageId:i.messageId}:{},metadata:{clientMessageId:w,deliveryState:"sending"},...a.length>0?{attachments:a}:{}};ct(!0),u!=="message"&&Z(R),oe(null),ie.current.set(w,p.id),G(S=>Ne([...S,p]));try{const S=await U(`/api/chats/${encodeURIComponent(n)}/messages`,{method:"POST",body:JSON.stringify({body:s,clientMessageId:w,...i?{replyToMessageId:i.messageId}:{},...a.length>0?{attachments:a}:{}})}),V=S.chatId?.trim()??S.conversationId?.trim();if(V&&V!==n)throw new Error(`Send returned a different Chat (${V}) instead of appending to ${n}.`);if(S.messageId?.trim()){const L=S.messageId.trim();G(ye=>Ne(ye.map(E=>E.id===p.id?{...E,id:L,metadata:{clientMessageId:w}}:E))),ie.current.delete(w)}return S.flight?(Pe.current.add(S.flight.invocationId),we(Qs(S.flight,n,x??"")),je([]),Re(null)):u!=="message"&&Z(null),"sent"}catch(S){return oo(S)?(G(V=>V.map(L=>L.id===p.id?{...L,metadata:{...L.metadata??{},deliveryState:"unknown"}}:L)),"unknown"):(G(V=>V.filter(L=>L.id!==p.id)),ie.current.delete(w),Z(null),oe(S instanceof Error?S.message:String(S)),"failed")}finally{ct(!1)}},Yn=async e=>{const t=e.replyToMessageId?he.get(e.replyToMessageId):null;if(!t||_)return;const s=[];for(const i of t.attachments??[]){if(!i.url){oe("This request includes an attachment that can’t be reused. Add it again, then retry."),requestAnimationFrame(()=>A.current?.focus());return}s.push({id:i.id,mediaType:i.mediaType,...i.fileName?{fileName:i.fileName}:{},url:i.url})}await ke(t.body,{forceAction:"invoke",attachments:s})!=="failed"&&ys(e)},Xn=(e,t,s)=>{if(!_t)return;const a=e.replyToMessageId?he.get(e.replyToMessageId)?.body.trim():"",i=a?`${a.slice(0,1200)}${a.length>1200?"…":""}`:"(The original request is no longer available in this transcript.)",l=[`Help me recover a failed request to ${t}.`,s,"","Original request:",i].join(`
2
- `),u={view:"conversation",conversationId:_t,composeDraft:l};f&&ns({type:"navigate",route:u,reason:"Ask @scoutbot to help recover a failed conversation request"})||d(u)},Zn=async()=>{const e=I.trim(),t=le,s=pe.files,a=xe?.attachments??[];if(!e&&s.length===0&&a.length===0)return null;let i=[];if(s.length>0){ct(!0);try{i=await ba(s)}catch(l){return pe.setError(l instanceof Error?l.message:String(l)),null}finally{ct(!1)}}return B(""),ce(null),pe.clear(),Ce(null),{body:e,attachments:[...a,...i],replyTarget:t}},ea=async()=>{const e=er({isAgentBusy:ge,intent:Ls}),t=xe?.id??null,s=await Zn();if(!s)return;if(e==="queue"){se(l=>t?l.map(u=>u.id===t?{...u,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget}:u):[...l,{id:`queued-${Date.now()}-${l.length}`,body:s.body,attachments:s.attachments,replyTarget:s.replyTarget,queuedAt:Date.now()}]);return}t&&se(l=>l.filter(u=>u.id!==t));const a=()=>{B(s.body),Ce(s.attachments.length>0?{id:null,attachments:s.attachments}:null),ce(s.replyTarget),requestAnimationFrame(()=>A.current?.focus())};if(e==="steer"){ft("queue"),await Gt(),await ke(s.body,{forceAction:"steer",attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a();return}await ke(s.body,{attachments:s.attachments,replyTarget:s.replyTarget})==="failed"&&a()},ta=e=>{se(t=>t.filter(s=>s.id!==e)),Ce(t=>t?.id===e?null:t)},sa=e=>{const t=fe.find(s=>s.id===e);t&&(B(t.body),ce(t.replyTarget??null),Ce({id:e,attachments:t.attachments}),requestAnimationFrame(()=>{const s=A.current;s&&(s.focus(),s.setSelectionRange(s.value.length,s.value.length))}))},na=()=>{Ce(null),B(""),ce(null),pe.clear()},aa=async e=>{const t=fe.find(a=>a.id===e);if(!t)return;se(a=>a.filter(i=>i.id!==e)),await Gt(),await ke(t.body,{forceAction:"steer",attachments:t.attachments,replyTarget:t.replyTarget??null})==="failed"&&se(a=>[t,...a])},gt=o.useCallback((e,t)=>{const s=t?.trim().replace(/^@+/,"")||null,a=s?`@${s}`:null,i=le?.insertedMention?an(I,le.insertedMention):I,l=!!(!M&&a&&!i.toLocaleLowerCase().includes(a.toLocaleLowerCase())),u=l&&a?i.trim()?`${i.trimEnd()} ${a} `:`${a} `:i;B(u),ce({messageId:e.id,actorLabel:s?`@${s}`:e.actorName,preview:nn(e),insertedMention:l?a:null}),requestAnimationFrame(()=>A.current?.focus())},[I,M,le?.insertedMention]),ra=o.useCallback(()=>{const e=le?.insertedMention;ce(null),e&&B(t=>an(t,e)),requestAnimationFrame(()=>A.current?.focus())},[le]),Jt=o.useCallback(e=>{const t=new URL(window.location.href);N.view==="agents-v2"&&t.searchParams.set("tab","message"),t.hash=`msg-${e}`,Ye(t.toString())},[N.view]),$s=o.useCallback((e,t,s)=>{const a=wa({conversationId:n,selectedMessageId:e.id,messages:b.map(i=>({id:i.id,actorLabel:i.id===e.id?t:Ge(i,T)?T:i.actorName,body:i.body,attachmentCount:i.attachments?.length??0}))});W({intent:"forward-message",forwardContext:a,forwardContextMode:"selected-message",...s?{projectPath:s}:{}})},[n,b,W,T]),Gt=async()=>{if(x)try{await U("/api/agents/"+encodeURIComponent(x)+"/interrupt",{method:"POST",body:JSON.stringify({})})}catch{}},ge=j.tone==="working"||j.tone==="pending",oa=Gs({isDm:M,hasOutstandingReply:vs}),ia=M?`Message ${F} — type / to route or @ to mention an agent`:h?.kind==="channel"?`Comment in #${dr(h)} — mention @agent to request a reply`:`Comment in ${Pt} — mention @agent to request a reply`,Fs=xe?.attachments??[],la=!I.trim()&&!pe.hasFiles&&Fs.length===0&&ge,Yt=o.useRef(!1);o.useEffect(()=>{const e=xe?.id??null,t=e?fe.filter(a=>a.id!==e):fe;if(!Ka({isAgentBusy:ge,sending:_,queued:t})||Yt.current)return;const s=t[0];s&&(Yt.current=!0,se(a=>a.filter(i=>i.id!==s.id)),ke(s.body,{attachments:s.attachments,replyTarget:s.replyTarget??null}).then(a=>{a==="failed"&&se(i=>[s,...i])}).finally(()=>{Yt.current=!1}))},[ge,_,fe,xe]),o.useEffect(()=>{ge||ft("queue")},[ge]),o.useEffect(()=>{se([]),Ce(null),ce(null),ft("queue"),pe.clear()},[n]);const ca=Qa(fe),Ps=yr(),da=o.useCallback((e,t)=>{const s=window.getSelection()?.toString().trim(),a=Ge(t,T),i=t.actorId?ee.get(t.actorId):null,l=a?null:zs(t,k,x),u=(i?.scopedAlias?.trim()||l?.handle?.trim()||null)?.replace(/^@+/,"")??null,R=u?`@${u}`:t.actorName,w=(l?.id||i?.agentId||t.actorId||"").trim(),p=[];a||p.push({kind:"action",label:"Reply",onSelect:()=>gt(t,u)}),p.push({kind:"action",label:"Forward to new task…",onSelect:()=>$s(t,R,i?.workspaceRoot??l?.projectRoot??l?.cwd??void 0)}),p.push({kind:"separator"}),s&&p.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{Ye(s)}}),p.push({kind:"action",label:"Copy Message",onSelect:()=>{Ye(t.body)}}),p.push({kind:"action",label:"Copy Link",onSelect:()=>Jt(t.id)}),p.push({kind:"separator"}),!a&&w&&p.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{Ye(w)}}),p.push({kind:"action",label:"Copy Message ID",onSelect:()=>{Ye(t.id)}}),Ps(e,p)},[x,gt,Jt,$s,T,ee,k,Ps]),ua=async(e,t)=>{const s=`@${t.agentId} `,a=I.trim();if(a){B(""),await ke(`${s}${a}`,{forceAction:"invoke"});return}B(s),A.current?.focus()},Je=o.useMemo(()=>{if(!h)return[];const e=new Set(h.participantIds);return k.filter(t=>!e.has(t.id)&&!t.retiredFromFleet).sort((t,s)=>t.name.localeCompare(s.name))},[h,k]);o.useEffect(()=>{At&&ut(e=>e&&Je.some(t=>t.id===e)?e:Je[0]?.id??"")},[At,Je]);const Os=!!(h&&["direct","group_direct","channel"].includes(h.kind)&&Je.length>0),ma=o.useCallback(async()=>{if(!h)return;const e=It.trim();if(e){jt(!0),He(null);try{const t=await U(`/api/conversations/${encodeURIComponent(h.id)}/members`,{method:"POST",body:JSON.stringify({actorId:e})});t.session?Tt(t.session):Tt(s=>s&&{...s,kind:t.kind,participantIds:t.participantIds}),dt(!1),ut(""),await D({messageMode:"none"})}catch(t){He(t instanceof Error?t.message:String(t))}finally{jt(!1)}}},[It,D,h]);return r.jsx("div",{className:`s-thread-layout${f?" s-thread-layout--embedded":""}`,"data-thread-treatment":H==="standard"?void 0:H,children:r.jsxs("div",{className:"s-thread-center",children:[!f&&r.jsx(Sr,{showBackNav:y,backLabel:re,beside:C&&We?{on:C.has(We),toggle:()=>C.toggle(We)}:void 0,isDm:M,navigate:d,route:N,canonicalConversationId:We,threadTitle:Pt,agentId:Q?.id??null,sessionId:ws,detailRoute:gn,participants:_n,operator:Vn,canAddParticipants:Os,view:Te,onChangeView:Un,onToggleAddParticipant:()=>{He(null),dt(e=>!e)}}),!f&&h&&r.jsx(br,{canonicalConversationId:We,conversationAlias:On}),!f&&At&&Os&&r.jsx(vr,{agents:Je,addParticipantId:It,setAddParticipantId:ut,addingParticipant:bn,addParticipantError:Sn,onCancel:()=>{dt(!1),He(null)},onSubmit:()=>{ma()}}),Nt&&r.jsx(Dr,{pinnedAsk:Nt,onAnswer:()=>{const e=[...b].reverse().find(t=>t.actorId===Nt.agentId)??[...b].reverse().find(t=>!Ge(t,T)&&t.class!=="status"&&t.class!=="system");e?gt(e,e.actorId?ee.get(e.actorId)?.scopedAlias??null:null):A.current?.focus()},onSteer:Wt}),r.jsx(Br,{presence:j,agent:Q}),hs&&r.jsx("p",{className:"s-thread-error",children:hs}),Te!=="thread"?r.jsx(Tr,{messages:b,view:Te,participants:h?.participants,onStage:Hn,beside:C}):r.jsxs("div",{className:"s-thread-feed","data-conversation-id":n,ref:Le,onScroll:zn,children:[!ms&&b.length>0&&fn&&r.jsx("div",{className:"s-thread-history-control",children:r.jsxs("button",{type:"button",className:"s-thread-history-button",disabled:Se,"aria-busy":Se,onClick:()=>{yn()},children:[Se&&r.jsx("span",{className:"s-thread-history-spinner","aria-hidden":"true"}),Se?"Loading earlier messages…":"Load earlier messages"]})}),ms?r.jsx(Lr,{}):b.length===0?Ot?r.jsx($r,{agentName:F,title:j.label,detail:j.detail||me.latest,snapshot:me,events:Ie,steps:te,phase:Dt,tone:qn,workspaceName:ht,branch:h?.currentBranch,startedAt:Lt,onOpenTrace:Cs,onOpenTerminal:As,onSteer:Wt}):r.jsxs("div",{className:"s-thread-empty",children:[r.jsx("div",{className:"s-thread-empty-glyph","aria-hidden":"true",children:M?"@":"#"}),r.jsx("p",{children:Pt}),r.jsx("p",{children:M?"No messages yet. Send a message to start working with this agent.":"No messages yet. Start the conversation below."}),(ht||h?.currentBranch)&&r.jsxs("div",{className:"s-thread-empty-chips",children:[ht&&r.jsx("span",{className:"s-thread-empty-chip",children:ht}),h?.currentBranch&&r.jsx("span",{className:"s-thread-empty-chip",children:h.currentBranch})]})]}):ze.map((e,t)=>{const s=za(e,t);if(e.kind==="fanout")return r.jsx(Cr,{row:e,expanded:Kn.has(e.key),showDayDivider:s,onToggle:()=>Qn(e.key)},e.key);const a=e.message,i=Ge(a,T),l=Ja(a),u=l?"scout.dispatch":a.class,R=Za(u),w=u==="status",p=Ys(a.createdAt),S=i?null:zs(a,k,x),L=(a.actorId?ee.get(a.actorId):void 0)?.scopedAlias?.trim()||null,ye=!i&&L?L:a.actorName,E=i?T.toLowerCase():L??S?.handle??null,ne=Ga(a.body),z=ne?Ya({flightId:ne.flightId,replyToMessageId:a.replyToMessageId,messagesById:he,agents:k,operatorName:T}):null,K=!ne&&a.replyToMessageId?he.get(a.replyToMessageId)??null:null,Y=K?Ge(K,T)?T:K.actorName:null,Me=ne?ne.body:a.body,P=Xs(a);if(P&&Ct.has(a.id))return null;const Xt=typeof a.metadata?.targetAgentId=="string"?a.metadata.targetAgentId:null,yt=P?es(k,[Xt,P.target]):null,v=P?Ks({name:yt?.name,id:yt?.id,title:mr(P.target)}):null;return r.jsxs("div",{className:["s-thread-feed-block",i&&"s-thread-feed-block--you",s&&"s-thread-feed-block--full-width"].filter(Boolean).join(" "),children:[s&&r.jsx(kr,{at:a.createdAt}),P&&v?r.jsxs("article",{id:`msg-${a.id}`,className:["s-thread-msg","s-thread-failure-notice",(et||us?.has(a.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:et?{animationDelay:`${Math.max(0,7-(ze.length-1-t))*26}ms`}:void 0,"data-class":u,"aria-label":"Delivery issue",children:[r.jsx("span",{className:"s-thread-failure-notice-mark","aria-hidden":"true",children:"!"}),r.jsxs("div",{className:"s-thread-failure-notice-content",children:[r.jsxs("p",{children:[r.jsxs("strong",{children:[v," couldn’t reply."]})," ",r.jsx("span",{children:P.explanation})]}),P.technicalDetail&&r.jsxs("details",{className:"s-thread-failure-notice-details",children:[r.jsx("summary",{children:"Technical details"}),r.jsx("pre",{children:P.technicalDetail})]}),r.jsxs("div",{className:"s-thread-failure-notice-actions",children:[a.replyToMessageId&&he.has(a.replyToMessageId)&&r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--primary",type:"button",disabled:_,onClick:()=>{Yn(a)},children:_?"Retrying…":"Retry"}),_t&&r.jsx("button",{className:"s-thread-failure-notice-action",type:"button",onClick:()=>Xn(a,v,P.explanation),children:"Ask @scoutbot"}),r.jsx("button",{className:"s-thread-failure-notice-action s-thread-failure-notice-action--clear",type:"button",onClick:()=>ys(a),"aria-label":`Clear delivery issue for ${v}`,children:"Clear"})]})]}),r.jsx("span",{className:"s-thread-failure-notice-time",title:p,children:St(a.createdAt)})]}):r.jsx("article",{id:`msg-${a.id}`,className:["s-thread-msg",i&&"s-thread-msg--you",w&&"s-thread-msg--tool",(et||us?.has(a.id))&&"s-thread-msg--enter"].filter(Boolean).join(" "),style:et?{animationDelay:`${Math.max(0,7-(ze.length-1-t))*26}ms`}:void 0,"data-class":u,onContextMenu:O=>da(O,a),children:r.jsx("div",{className:"s-thread-msg-card",children:r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[(()=>{const O=!i&&S?()=>bt(d,{view:"agents-v2",agentId:S.id},{returnTo:N}):null,qs=i?T:ye??"?",Ds=r.jsx(as,{agent:S??void 0,name:qs,placement:"turn",size:28,className:"s-thread-msg-avatar",title:qs});return O?r.jsx("button",{type:"button",className:"s-thread-msg-avatar--nav",onClick:O,"aria-label":`View profile for ${a.actorName??"agent"}`,title:`View profile for ${a.actorName??"agent"}`,children:Ds}):Ds})(),!i&&S?r.jsx("button",{type:"button",className:"s-thread-msg-actor s-thread-msg-actor--nav",onClick:()=>bt(d,{view:"agents-v2",agentId:S.id},{returnTo:N}),title:`View profile for ${a.actorName}`,children:ye}):r.jsx("span",{className:"s-thread-msg-actor",children:i?T:ye}),E&&r.jsxs("span",{className:"s-thread-msg-handle",children:["@",E]}),R&&r.jsx("span",{className:"s-thread-msg-kind",children:R})]}),r.jsx("span",{className:"s-thread-msg-time",title:p,children:St(a.createdAt)}),r.jsxs("span",{className:"s-thread-msg-actions",children:[!i&&E&&r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":`Reply to @${E}`,title:`Reply to @${E}`,onClick:()=>gt(a,E),children:r.jsx(os,{})}),r.jsx("button",{type:"button",className:"s-thread-msg-permalink","aria-label":"Copy link to message",title:"Copy link to message",onClick:()=>Jt(a.id),children:r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M6.5 9.5a2.5 2.5 0 0 0 3.54 0l2.12-2.12a2.5 2.5 0 0 0-3.54-3.54l-.7.7"}),r.jsx("path",{d:"M9.5 6.5a2.5 2.5 0 0 0-3.54 0L3.84 8.62a2.5 2.5 0 0 0 3.54 3.54l.7-.7"})]})})]})]}),z&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open the originating request${z.flightId?` · ${z.flightId}`:""}`,onClick:()=>pt(z.originatingMessageId),children:[r.jsx(os,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:z.title}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",z.from]}),r.jsx("span",{className:"s-thread-reply-ctx-status",children:"· done"})]}),K&&Y&&r.jsxs("button",{type:"button",className:"s-thread-reply-ctx",title:`Open message from ${Y}`,onClick:()=>pt(K.id),children:[r.jsx(os,{}),r.jsx("span",{className:"s-thread-reply-ctx-label",children:"reply to"}),r.jsx("span",{className:"s-thread-reply-ctx-title",children:nn(K)}),r.jsxs("span",{className:"s-thread-reply-ctx-from",children:["· ",Y]})]}),r.jsx("div",{className:"s-thread-msg-body",title:p,children:r.jsx(ur,{text:Me})}),r.jsx(to,{message:a}),l&&l.candidates.length>0&&r.jsx("div",{className:"s-thread-dispatch",children:l.candidates.map(O=>r.jsxs("button",{type:"button",className:"s-thread-dispatch-tile",onClick:()=>{ua(l,O)},children:[r.jsxs("span",{className:"s-thread-dispatch-tile-id",children:["@",O.agentId]}),r.jsx("span",{className:"s-thread-dispatch-tile-state",children:O.endpointState}),r.jsx("span",{className:"s-thread-dispatch-tile-meta",children:[O.workspace,O.node,O.projectRoot].filter(Boolean).join(" · ")||O.displayName})]},O.agentId))})]})})})]},a.id)}),j.showTyping&&!Ot&&r.jsx("div",{className:"s-thread-feed-block",children:r.jsx("div",{className:"s-thread-msg","aria-live":"polite",children:r.jsxs("div",{className:Rn,children:[r.jsx(as,{agent:Q??void 0,name:F,placement:"turn",size:28,className:"s-thread-msg-avatar s-thread-msg-avatar--working",title:F}),r.jsxs("div",{className:"s-thread-msg-card-content",children:[r.jsxs("div",{className:"s-thread-msg-header",children:[r.jsxs("div",{className:"s-thread-msg-meta",children:[r.jsx("span",{className:"s-thread-msg-actor",children:F}),r.jsx("span",{className:En,children:jn})]}),r.jsx("span",{className:"s-thread-msg-time",title:g?.startedAt?Ys(g.startedAt):"now",children:g?.startedAt?St(g.startedAt):"now"})]}),r.jsxs("div",{className:"s-thread-msg-working-body",children:[r.jsxs("div",{className:Ln,children:[r.jsx("span",{className:$n,"aria-hidden":"true"}),r.jsxs("div",{className:"s-thread-turn-snapshot-main",children:[r.jsx("span",{className:"s-thread-turn-snapshot-label",children:"Latest"}),r.jsx("span",{className:"s-thread-msg-working-copy",children:me.latest})]})]}),r.jsxs("dl",{className:"s-thread-turn-snapshot-stats",children:[r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Activity"}),r.jsx("dd",{children:me.activityLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Elapsed"}),r.jsx("dd",{children:me.elapsedLabel})]}),r.jsxs("div",{className:"s-thread-turn-snapshot-stat",children:[r.jsx("dt",{children:"Last"}),r.jsx("dd",{children:me.lastActivityLabel})]})]}),te.length>0||Dt?r.jsx(Fr,{steps:te,phase:Dt,limit:5,compact:!0}):r.jsx(Pr,{events:Ie,limit:4,compact:!0}),r.jsx(Or,{onOpenTrace:Cs,onOpenTerminal:As,onSteer:Wt,compact:!0})]})]})]})})}),hn&&Mt>0&&r.jsxs("button",{type:"button",className:"s-thread-new-messages",onClick:Jn,children:[r.jsx("span",{"aria-hidden":"true",children:"↓"})," ",Mt," new ",Mt===1?"message":"messages"," · jump to latest"]}),r.jsx("div",{ref:pn})]}),j.showTyping&&r.jsxs("div",{className:Fn,children:[r.jsx("div",{className:"s-thread-presence-line-avatars",children:r.jsx(as,{agent:Q??void 0,name:F,placement:"turn",size:22,className:"s-thread-presence-line-avatar",title:F})}),r.jsx("span",{className:"s-thread-presence-line-label",children:Bn}),r.jsx("div",{className:Pn,"aria-hidden":"true"})]}),r.jsx(xa,{composeRef:A,draft:I,setDraft:B,composePlaceholder:ia,slashState:de,setSlashState:Be,filteredSlashCommands:vn,applySlashCommand:kn,mentionState:ue,setMentionState:Ue,filteredMentions:Tn,applyMention:Mn,updateTriggersFromDraft:Cn,closeSuggestions:xn,replyTarget:le,onCancelReply:ra,isStopMode:la,sending:_,composeAction:oa,onSend:()=>{ea()},onInterrupt:()=>{Gt()},attachments:pe,isAgentBusy:ge,busyIntent:Ls,onBusyIntentChange:ft,queued:fe,queueNote:ca,onEditQueued:sa,editingQueuedId:xe?.id??null,editingAttachmentCount:Fs.length,onCancelEdit:na,onUnqueue:ta,onSendQueuedNow:e=>{aa(e)}})]})})}function os(){return r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("polyline",{points:"9 14 4 9 9 4"}),r.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}const Hi=wr({id:"thread",label:"Thread",route:{view:"conversation",conversationId:""},webPath:"/chat",screen:"ConversationScreen",embed:{path:"/embed/thread",profile:"macos.thread",rootClassName:"s-thread-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:tr}});export{Ui as ConversationScreen,Hi as scoutSurface};
@@ -1 +0,0 @@
1
- import{j as t,r as w}from"./index-C8uS5szO.js";import{A as E}from"./AgentAvatar-BIwg54Tj.js";import{H as Q}from"./HarnessMark-Bt47OeHy.js";import{t as T}from"./time-Dhsh_2EG.js";import{F as D,A as O}from"./AddProjectForm-DfbjlFfy.js";import{y as q,z as U}from"./Provider-5Hotn7NQ.js";import{b as J}from"./machine-scope-DJt9RZ2w.js";import{a as K}from"./agent-specialization-CiVxQsFT.js";import{o as G}from"./model-CBkMvT1w.js";import{s as W}from"./project-overview-helpers-BQTc_Ous.js";import{c as M}from"./createLucideIcon-DkjnzvcJ.js";import{S as V}from"./search-C4VlW_0l.js";import{S as X}from"./sliders-horizontal-CHf3ntw0.js";import{F as x}from"./folder-0fWevPvQ.js";import{F as Y}from"./DocumentFocusViewer-f12RRQpV.js";import{M as Z}from"./message-square-NmXWtWLR.js";const ee=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],te=M("rows-3",ee);const se=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],ne=M("telescope",se);const re=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ie=M("users",re);function z(e){return e.needs?3:e.working?2:1}function $(e){return[...e].sort((n,s)=>z(s)-z(n)||s.lastActivityAt-n.lastActivityAt)}function S(e){return[...new Set(e.map(n=>n?.trim().toLowerCase()).filter(n=>!!n))].sort()}function _(e){const n=[...new Set(e.map(s=>s?.trim()).filter(s=>!!s))];return n.length===0?null:n.length===1?n[0]:`${n.length} branches`}function H(e){return e.needs>0?"needs":e.working>0||e.liveSessionCount>0?"working":"idle"}function oe(e){if(e.needs>0)return`${e.needs} ${e.needs===1?"item needs":"items need"} attention`;const n=Math.max(e.working,e.liveSessionCount);return n>0?`${n} active work ${n===1?"stream":"streams"}`:"No active work"}function ae(e,n){const s=$(n.filter(i=>i.projectSlug===e.slug)),r=S(s.map(i=>i.harness)),o={threadId:`project:${e.slug}`,projectSlug:e.slug,projectTitle:e.title,projectRoot:e.root,branch:_(e.branches.length>0?e.branches:s.map(i=>i.branch)),working:e.working>0||e.liveSessionCount>0,needs:e.needs>0,lastActivityAt:e.lastActivityAt,sessionCount:e.sessionCount,work:oe(e),conversationId:null};return{kind:"project",key:`project:${e.slug}`,agentId:null,name:e.title,headline:"Project agent",harnesses:r,model:null,effort:null,status:H(e),needs:o.needs,working:o.working,substrates:[o],primary:o,work:o.work,conversationId:null,lastActivityAt:e.lastActivityAt,sessionCount:e.sessionCount}}function ce(e){const n=$(e),s=n[0];return{threadId:s.id,projectSlug:s.projectSlug,projectTitle:s.projectTitle,projectRoot:s.projectRoot,branch:_(n.map(r=>r.branch)),working:n.some(r=>r.working),needs:n.some(r=>r.needs),lastActivityAt:Math.max(...n.map(r=>r.lastActivityAt)),sessionCount:n.reduce((r,o)=>r+o.sessionCount,0),work:s.work,conversationId:s.conversationId}}function le(e){const n=new Map;for(const s of e){const r=n.get(s.projectSlug)??[];r.push(s),n.set(s.projectSlug,r)}return[...n.values()].map(ce).sort((s,r)=>Number(r.needs)-Number(s.needs)||Number(r.working)-Number(s.working)||r.lastActivityAt-s.lastActivityAt)}function de(e,n){return n.some(s=>s.needs)?"needs":e.some(s=>(s.state??"").toLowerCase().includes("think"))?"thinking":n.some(s=>s.working)||e.some(s=>/work|running|in_turn/iu.test(s.state??""))?"working":"idle"}function b(e){const n=e?.trim().replace(/\/+$/u,"");return n?n.replace(/^\/(?:Users|home)\/[^/]+(?=\/)/u,"~"):null}function ue(e,n){return[n.root,...n.worktrees.map(r=>r.root)].map(b).filter(r=>!!r).some(r=>e===r||e.startsWith(`${r}/`))}function he(e,n,s){const r=new Set;for(const i of s)i.agentId===e.id&&r.add(i.projectSlug);const o=[e.projectRoot,e.cwd].map(b).filter(i=>!!i);for(const i of n){const a=[i.slug,i.title].map(l=>l.trim().toLowerCase());e.project&&a.includes(e.project.trim().toLowerCase())&&r.add(i.slug),e.workspaceQualifier&&a.includes(e.workspaceQualifier.trim().toLowerCase())&&r.add(i.slug),o.some(l=>ue(l,i))&&r.add(i.slug)}if(r.size===0){const i=b(e.projectRoot??e.cwd);i?r.add(`root:${i}`):e.project?.trim()?r.add(`project:${e.project.trim().toLowerCase()}`):e.workspaceQualifier?.trim()&&r.add(`workspace:${e.workspaceQualifier.trim().toLowerCase()}`)}return r}function pe(e,n,s){const r=new Set;for(const o of e)for(const i of he(o,n,s))r.add(i);return r.size>1?!0:e.some(o=>!U(o)&&!o.workspaceQualifier?.trim()&&!o.cwd?.trim())}function je(e,n,s){const r=e.filter(q),o=new Map;for(const i of r){const a=i.definitionId.trim()||i.id,l=o.get(a)??[];l.push(i),o.set(a,l)}return[...o.entries()].flatMap(([i,a])=>{if(!pe(a,n,s))return[];const h=[...a].sort((d,k)=>(k.updatedAt??0)-(d.updatedAt??0))[0],u=new Set(a.map(d=>d.id)),v=s.filter(d=>d.agentId&&u.has(d.agentId)),j=le(v),f=j[0]??null,p=S([...a.map(d=>d.harness),...v.map(d=>d.harness)]),y=S(a.map(d=>d.model)),A=S(a.map(d=>d.reasoningEffort)),m=de(a,j),C=Math.max(0,...a.map(d=>d.updatedAt??0),...j.map(d=>d.lastActivityAt)),g=K(h);return[{kind:"role",key:`role:${i}`,agentId:h.id,name:h.name,headline:g.headline,harnesses:p,model:y.length===1?y[0]:null,effort:A.length===1?A[0]:null,status:m,needs:m==="needs",working:m==="working"||m==="thinking",substrates:j,primary:f,work:f?.work??g.headline,conversationId:f?.conversationId??h.conversationId,lastActivityAt:C,sessionCount:j.reduce((d,k)=>d+k.sessionCount,0)}]})}function R(e){switch(e.status){case"needs":return 3;case"working":return 2;case"thinking":return 1;case"idle":return 0}}function B(e,n,s,r=null){const o=J(s,r);return[...e.map(a=>ae(a,n)),...je(o,e,n)].sort((a,l)=>R(l)-R(a)||l.lastActivityAt-a.lastActivityAt||a.name.localeCompare(l.name))}function we(e,n){switch(n){case"all":return!0;case"active":return e.status==="working"||e.status==="thinking";case"needs":return e.status==="needs";case"idle":return e.status==="idle"}}function me(e,n){const s=H(e);switch(n){case"all":return!0;case"active":return s==="working";case"needs":return s==="needs";case"idle":return s==="idle"}}function fe(e,n){const s=n.trim().toLowerCase();return!s||e.name.toLowerCase().includes(s)||e.headline.toLowerCase().includes(s)||e.work.toLowerCase().includes(s)?!0:e.substrates.some(r=>r.projectTitle.toLowerCase().includes(s)||r.projectSlug.toLowerCase().includes(s)||(r.projectRoot?.toLowerCase().includes(s)??!1))}function ge(e,n){const s=n.trim().toLowerCase();return s?e.title.toLowerCase().includes(s)||e.slug.toLowerCase().includes(s)||(e.root?.toLowerCase().includes(s)??!1):!0}function ke(e){switch(e){case"needs":return"Needs attention";case"working":return"Working";case"thinking":return"Thinking";case"idle":return"Idle"}}const xe=[{id:"all",label:"All"},{id:"active",label:"Active"},{id:"needs",label:"Needs attention"},{id:"idle",label:"Idle"}];function ve(e,n){if(n){e({view:"conversation",conversationId:n});return}e({view:"messages"})}function L(e,n){e({view:"code",project:n})}function ye(e,n,s){e(G(n,s))}function P(e,n,s){e({view:"agents-v2",projectSlug:s,...n.machineId?{machineId:n.machineId}:{},...n.showEphemeral?{showEphemeral:!0}:{}})}function Ae({model:e,agents:n,route:s,navigate:r,nowMs:o}){const[i,a]=w.useState("projects"),[l,h]=w.useState("all"),[u,v]=w.useState(""),[j,f]=w.useState(!1),p=w.useMemo(()=>B(e.projects,e.threads,n,s.machineId??null),[n,e.projects,e.threads,s.machineId]),y=w.useMemo(()=>p.filter(c=>we(c,l)&&fe(c,u)),[p,u,l]),A=w.useMemo(()=>e.projects.filter(c=>me(c,l)&&ge(c,u)),[e.projects,u,l]),m=e.projects.filter(c=>c.working>0||c.liveSessionCount>0).length,C=e.projects.filter(c=>c.needs>0).length,g=p.filter(c=>c.status==="working"||c.status==="thinking").length,d=p.filter(c=>c.status==="needs").length,k=p.filter(c=>c.kind==="project").length,N=p.filter(c=>c.kind==="role").length;return t.jsxs("main",{className:"cw-root","aria-label":"Projects and agents",children:[t.jsxs("div",{className:"cw-toolbar",children:[t.jsxs("div",{className:"cw-modeToggle",role:"group","aria-label":"Directory view",children:[t.jsxs("button",{type:"button","data-active":i==="projects"||void 0,"aria-pressed":i==="projects",onClick:()=>a("projects"),title:"Browse tracked projects",children:[t.jsx(te,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Projects"]}),t.jsxs("button",{type:"button","data-active":i==="agents"||void 0,"aria-pressed":i==="agents",onClick:()=>a("agents"),title:"Browse durable agent identities",children:[t.jsx(ie,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Agents"]})]}),t.jsxs("label",{className:"cw-search",role:"search",children:[t.jsx(V,{size:13,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("input",{type:"search",value:u,placeholder:i==="projects"?"Find project":"Find agent or project","aria-label":i==="projects"?"Find project":"Find agent or project",onChange:c=>v(c.currentTarget.value)})]}),t.jsxs("div",{className:"cw-filters","aria-label":"Status filter",children:[t.jsx(X,{size:12,strokeWidth:1.9,"aria-hidden":!0,className:"cw-filtersIcon"}),xe.map(c=>t.jsx("button",{type:"button","data-active":l===c.id||void 0,"aria-pressed":l===c.id,onClick:()=>h(c.id),children:c.label},c.id))]}),t.jsxs("button",{type:"button",className:"cw-addProject","aria-expanded":j,onClick:()=>f(c=>!c),children:[t.jsx(D,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Add project"]})]}),j?t.jsx(O,{onClose:()=>f(!1)}):null,t.jsx("div",{className:"cw-digest",children:i==="projects"?t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[e.projects.length," projects"]}),t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":m>0?"live":void 0,children:[m," active"]}),C>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":"needs",children:[C," need you"]})]}):null]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[k," project agents"]}),N>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{children:[N," role ",N===1?"agent":"agents"]})]}):null,t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":g>0?"live":void 0,children:[g," active"]}),d>0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cw-digestSep",children:"·"}),t.jsxs("span",{"data-tone":"needs",children:[d," need you"]})]}):null]})}),i==="projects"?t.jsx(Se,{projects:A,route:s,navigate:r,nowMs:o,allEmpty:e.projects.length===0}):t.jsx(be,{members:y,route:s,navigate:r,nowMs:o,allEmpty:p.length===0})]})}function Ce({project:e,threads:n,route:s,navigate:r,nowMs:o}){const i=B([e],n,[])[0];return t.jsx("main",{className:"cw-root cw-root--scoped","aria-label":`${e.title} agent`,children:t.jsx(I,{title:"Project agent",members:[i],route:s,navigate:r,nowMs:o})})}const F=5;function Se({projects:e,route:n,navigate:s,nowMs:r,allEmpty:o}){const[i,a]=w.useState(!1);if(e.length===0)return t.jsx("div",{className:"cw-empty",children:o?"No projects are tracked yet.":"No projects match these filters."});const l=i?e:e.slice(0,F),h=Math.max(0,e.length-F);return t.jsxs("div",{className:"cw-workspaceList",children:[l.map(u=>t.jsx(Ne,{project:u,route:n,navigate:s,nowMs:r},u.slug)),h>0?t.jsx("button",{type:"button",className:"cw-showMore",onClick:()=>a(u=>!u),children:i?"Show fewer projects":`Show ${h} more`}):null]})}function Ne({project:e,route:n,navigate:s,nowMs:r}){const o=e.working>0||e.liveSessionCount>0;return t.jsx("article",{className:"cw-workspace","data-state":e.needs>0?"needs":o?"live":void 0,children:t.jsxs("button",{type:"button",className:"cw-workspaceHead",onClick:()=>P(s,n,e.slug),children:[t.jsxs("span",{className:"cw-workspaceTitle",children:[t.jsx(x,{size:13,strokeWidth:1.7,"aria-hidden":!0}),"/",e.title]}),t.jsx("span",{className:"cw-workspaceRoot",title:e.root??void 0,children:e.root?W(e.root):"Discovered project"}),t.jsxs("span",{className:"cw-workspaceMeta",children:[e.needs>0?t.jsx("b",{"data-tone":"needs",children:"Needs you"}):null,o?t.jsx("b",{"data-tone":"live",children:"Active"}):null,t.jsxs("span",{children:[e.worktreeCount," ",e.worktreeCount===1?"worktree":"worktrees"]}),t.jsxs("span",{children:[e.sessionCount," ",e.sessionCount===1?"session":"sessions"]}),t.jsx("time",{children:e.lastActivityAt?T(e.lastActivityAt,r):"no activity"})]})]})})}function be({members:e,route:n,navigate:s,nowMs:r,allEmpty:o}){if(e.length===0)return t.jsx("div",{className:"cw-empty",children:o?"No durable agents are registered yet.":"No agents match these filters."});const i=e.filter(l=>l.kind==="role"),a=e.filter(l=>l.kind==="project");return t.jsxs("div",{className:"cw-agentDirectory",children:[i.length>0?t.jsx(I,{title:"Role agents",members:i,route:n,navigate:s,nowMs:r}):null,a.length>0?t.jsx(I,{title:"Project agents",members:a,route:n,navigate:s,nowMs:r}):null]})}function I({title:e,members:n,route:s,navigate:r,nowMs:o}){return t.jsxs("section",{className:"cw-agentSection","aria-label":e,children:[t.jsxs("div",{className:"cw-agentSectionHead",children:[t.jsx("h2",{children:e}),t.jsx("span",{children:n.length})]}),t.jsx("div",{className:"cw-grid",children:n.map(i=>t.jsx(Ie,{member:i,route:s,navigate:r,nowMs:o},i.key))})]})}function Ie({member:e,route:n,navigate:s,nowMs:r}){const o=e.primary;return t.jsxs("article",{className:"cw-card","data-status":e.status,"data-kind":e.kind,children:[t.jsxs("header",{className:"cw-cardHead",children:[t.jsx(E,{agent:{name:e.name,state:Me(e.status)},placement:"hero",size:46,presence:!0}),t.jsxs("div",{className:"cw-cardIdentity",children:[t.jsxs("div",{className:"cw-cardNameRow",children:[e.harnesses.length>0?t.jsx("span",{className:"cw-cardHarness","data-idle":e.status==="idle"||void 0,"aria-hidden":!0,children:e.harnesses.map(i=>t.jsx(Q,{harness:i,size:13},i))}):null,t.jsx("b",{title:e.name,children:e.name}),t.jsx("span",{className:"cw-statusPill","data-status":e.status,children:ke(e.status)})]}),t.jsx("div",{className:"cw-cardSubline",children:t.jsx("span",{className:"cw-headline",children:e.headline})})]})]}),e.kind==="project"&&o?t.jsxs("div",{className:"cw-projectContext",title:o.projectRoot??void 0,children:[t.jsx(x,{size:11,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("span",{children:o.projectRoot?W(o.projectRoot):`/${o.projectTitle}`}),t.jsxs("em",{children:[e.sessionCount," ",e.sessionCount===1?"session":"sessions"]})]}):e.substrates.length>0?t.jsx("div",{className:"cw-substrates",children:e.substrates.map((i,a)=>t.jsx(Pe,{substrate:i,route:n,navigate:s,primary:a===0},i.threadId))}):null,t.jsxs("div",{className:"cw-work",children:[t.jsx("p",{title:e.work,children:e.work}),t.jsx("time",{children:e.lastActivityAt?T(e.lastActivityAt,r):"—"})]}),t.jsx("footer",{className:"cw-cardActions",children:e.kind==="project"&&o?t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:()=>P(s,n,o.projectSlug),children:[t.jsx(Y,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Open project"]}),t.jsxs("button",{type:"button",onClick:()=>L(s,o.projectSlug),children:[t.jsx(x,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]})]}):t.jsxs(t.Fragment,{children:[e.conversationId?t.jsxs("button",{type:"button",onClick:()=>ve(s,e.conversationId),children:[t.jsx(Z,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Chat"]}):null,o?t.jsxs("button",{type:"button",onClick:()=>L(s,o.projectSlug),children:[t.jsx(x,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Browse code"]}):null,e.agentId?t.jsxs("button",{type:"button",onClick:()=>ye(s,n,e.agentId),children:[t.jsx(ne,{size:12,strokeWidth:1.9,"aria-hidden":!0}),"Inspect"]}):null]})})]})}function Me(e){switch(e){case"needs":return"needs_attention";case"working":return"in_turn";case"thinking":return"thinking";case"idle":return"idle"}}function Pe({substrate:e,route:n,navigate:s,primary:r=!1}){return t.jsxs("button",{type:"button",className:"cw-substrateChip","data-primary":r||void 0,"data-live":e.working||void 0,title:e.projectRoot??void 0,onClick:()=>P(s,n,e.projectSlug),children:[t.jsx(x,{size:11,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("span",{children:e.projectTitle}),e.branch?t.jsxs("em",{children:["git: ",e.branch]}):null]})}const Je=Object.freeze(Object.defineProperty({__proto__:null,CrewWorkspaces:Ae,ProjectAgentDirectory:Ce},Symbol.toStringTag,{value:"Module"}));export{Ae as C,Ce as P,ie as U,Je as a};
@@ -1 +0,0 @@
1
- .cw-root{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:var(--space-lg);padding:var(--space-xl) var(--space-2xl) var(--space-6xl)}.cw-root--scoped{padding-top:var(--space-lg)}.cw-toolbar{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm)}.cw-modeToggle{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--pi-hairline);border-radius:9px;background:color-mix(in srgb,var(--hud-surface) 40%,transparent)}.cw-modeToggle button{display:flex;align-items:center;gap:6px;height:26px;padding:0 10px;border:none;border-radius:7px;background:transparent;color:var(--pi-dim);font-size:var(--text-xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-modeToggle button:hover{color:var(--pi-muted)}.cw-modeToggle button[data-active]{background:color-mix(in srgb,var(--hud-ink) 10%,transparent);color:var(--pi-ink);box-shadow:inset 0 0 0 1px var(--pi-hairline-strong)}.cw-search{flex:1 1 220px;min-width:180px;max-width:420px;display:flex;align-items:center;gap:7px;height:30px;padding:0 10px;border:1px solid var(--pi-hairline);border-radius:8px;background:color-mix(in srgb,var(--hud-surface) 34%,transparent);color:var(--pi-dim)}.cw-search input{flex:1;min-width:0;border:none;background:transparent;color:var(--pi-ink);font-size:var(--text-sm);font-family:var(--pi-sans)}.cw-search input:focus{outline:none}.cw-search input::placeholder{color:var(--pi-dim)}.cw-filters{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.cw-filtersIcon{color:var(--pi-dim);margin-right:2px}.cw-filters button{height:26px;padding:0 10px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 30%,transparent);color:var(--pi-dim);font-size:var(--text-2xs);font-weight:600;letter-spacing:.01em;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease),border-color .15s var(--pi-ease)}.cw-filters button:hover{color:var(--pi-muted);border-color:var(--pi-hairline-strong)}.cw-filters button[data-active]{background:color-mix(in srgb,var(--pi-accent) 16%,transparent);border-color:color-mix(in srgb,var(--pi-accent) 40%,var(--pi-hairline));color:var(--pi-ink)}.cw-addProject{margin-left:auto;display:flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:1px solid var(--pi-hairline);border-radius:8px;background:color-mix(in srgb,var(--hud-surface) 34%,transparent);color:var(--pi-muted);font-size:var(--text-xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-addProject:hover{color:var(--pi-ink);border-color:var(--pi-hairline-strong)}.cw-digest{flex:none;display:flex;align-items:center;gap:6px;color:var(--pi-dim);font-size:var(--text-xs);font-family:var(--pi-mono)}.cw-digest span[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 78%,var(--pi-ink))}.cw-digest span[data-tone=needs]{color:color-mix(in srgb,#d9a441 82%,var(--pi-ink));font-weight:650}.cw-digestSep{opacity:.5}.cw-empty{padding:48px 12px;text-align:center;color:var(--pi-dim);font-size:var(--text-sm)}.cw-agentDirectory,.cw-agentSection{display:flex;flex-direction:column;gap:var(--space-lg)}.cw-agentSectionHead{display:flex;align-items:baseline;gap:8px;padding-bottom:var(--space-xs);border-bottom:1px solid var(--pi-hairline)}.cw-agentSectionHead h2{margin:0;color:var(--pi-ink);font-size:var(--text-sm);font-weight:650}.cw-agentSectionHead span{color:var(--pi-dim);font-family:var(--pi-mono);font-size:var(--text-2xs)}.cw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:var(--space-lg)}.cw-card{display:flex;flex-direction:column;gap:var(--space-md);padding:var(--space-lg);border:1px solid var(--pi-hairline);border-radius:12px;background:linear-gradient(180deg,color-mix(in srgb,white 2.5%,transparent),transparent 40%),color-mix(in srgb,var(--hud-surface) 30%,transparent);transition:border-color .16s var(--pi-ease),transform .16s var(--pi-ease),background .16s var(--pi-ease)}.cw-card:hover{border-color:var(--pi-hairline-strong);transform:translateY(-1px)}.cw-card[data-status=needs]{border-color:color-mix(in srgb,#d9a441 45%,var(--pi-hairline))}.cw-card[data-status=working]{border-color:color-mix(in srgb,var(--pi-accent) 32%,var(--pi-hairline))}.cw-cardHead{display:flex;align-items:flex-start;gap:var(--space-md)}.cw-cardIdentity{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.cw-cardNameRow{display:flex;align-items:center;gap:8px;min-width:0}.cw-cardHarness{flex:none;display:inline-flex;align-items:center;gap:4px;color:var(--pi-ink)}.cw-cardHarness[data-idle]{color:var(--pi-dim)}.cw-cardNameRow b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-size:var(--text-md);font-weight:650}.cw-statusPill{flex:none;padding:2px 8px;border-radius:999px;font-size:var(--text-2xs);font-weight:650;letter-spacing:.01em;color:var(--pi-dim);background:color-mix(in srgb,var(--hud-ink) 8%,transparent);box-shadow:inset 0 0 0 1px var(--pi-hairline)}.cw-statusPill[data-status=needs]{color:color-mix(in srgb,#d9a441 88%,var(--pi-ink));background:color-mix(in srgb,#d9a441 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,#d9a441 40%,transparent)}.cw-statusPill[data-status=working]{color:color-mix(in srgb,var(--pi-accent) 84%,var(--pi-ink));background:color-mix(in srgb,var(--pi-accent) 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--pi-accent) 32%,transparent)}.cw-statusPill[data-status=thinking]{color:color-mix(in srgb,#6fb7c7 86%,var(--pi-ink));background:color-mix(in srgb,#6fb7c7 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,#6fb7c7 32%,transparent)}.cw-cardSubline{display:flex;align-items:center;gap:6px;min-width:0;color:var(--pi-muted);font-size:var(--text-xs)}.cw-headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-substrates{display:flex;flex-wrap:wrap;gap:6px}.cw-substrateChip{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border:1px solid var(--pi-hairline);border-radius:999px;background:color-mix(in srgb,var(--hud-surface) 26%,transparent);color:var(--pi-muted);font-size:var(--text-2xs);cursor:pointer;transition:border-color .15s var(--pi-ease),color .15s var(--pi-ease)}.cw-substrateChip:hover{border-color:var(--pi-hairline-strong);color:var(--pi-ink)}.cw-substrateChip[data-primary]{color:var(--pi-ink);background:color-mix(in srgb,var(--hud-ink) 6%,transparent)}.cw-substrateChip[data-live]{border-color:color-mix(in srgb,var(--pi-accent) 34%,var(--pi-hairline))}.cw-substrateChip em{font-style:normal;color:var(--pi-dim);font-family:var(--pi-mono)}.cw-work{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-md);padding-top:var(--space-2xs);border-top:1px solid var(--pi-hairline)}.cw-work p{flex:1;min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-ink);font-size:var(--text-sm)}.cw-work time{flex:none;color:var(--pi-dim);font-size:var(--text-2xs);font-family:var(--pi-mono)}.cw-cardActions{display:flex;gap:6px}.cw-cardActions:empty{display:none}.cw-cardActions button{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;height:26px;border:1px solid var(--pi-hairline);border-radius:7px;background:transparent;color:var(--pi-muted);font-size:var(--text-2xs);font-weight:600;cursor:pointer;transition:background .15s var(--pi-ease),color .15s var(--pi-ease),border-color .15s var(--pi-ease)}.cw-cardActions button:hover{color:var(--pi-ink);border-color:var(--pi-hairline-strong);background:color-mix(in srgb,var(--hud-ink) 5%,transparent)}.cw-projectContext{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:6px;padding:5px 8px;border:1px solid var(--pi-hairline);border-radius:7px;background:color-mix(in srgb,var(--hud-surface) 28%,transparent);color:var(--pi-muted);font-size:var(--text-2xs)}.cw-projectContext span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--pi-mono)}.cw-projectContext em{font-style:normal;color:var(--pi-dim)}.cw-workspaceList{display:flex;flex-direction:column;gap:5px}.cw-workspace{border:1px solid var(--pi-hairline);border-radius:8px;background:color-mix(in srgb,var(--hud-surface) 18%,transparent);overflow:hidden}.cw-workspace[data-state=needs]{border-color:color-mix(in srgb,#d9a441 40%,var(--pi-hairline))}.cw-workspace[data-state=live]{border-color:color-mix(in srgb,var(--pi-accent) 28%,var(--pi-hairline))}.cw-workspaceHead{width:100%;display:flex;align-items:center;gap:var(--space-md);min-height:44px;padding:8px 12px;border:none;background:transparent;color:inherit;text-align:left;cursor:pointer;transition:background .15s var(--pi-ease)}.cw-workspaceHead:hover{background:color-mix(in srgb,var(--hud-ink) 4%,transparent)}.cw-workspaceTitle{flex:none;display:flex;align-items:center;gap:6px;color:var(--pi-ink);font-size:var(--text-sm);font-weight:650}.cw-workspaceRoot{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-dim);font-family:var(--pi-mono);font-size:var(--text-xs)}.cw-workspaceMeta{flex:none;display:flex;align-items:center;gap:10px;color:var(--pi-dim);font-size:var(--text-xs)}.cw-workspaceMeta b{font-weight:650;color:var(--pi-muted)}.cw-workspaceMeta b[data-tone=needs]{color:color-mix(in srgb,#d9a441 85%,var(--pi-ink))}.cw-workspaceMeta b[data-tone=live]{color:color-mix(in srgb,var(--pi-accent) 82%,var(--pi-ink))}.cw-workspaceMeta time{font-family:var(--pi-mono)}.cw-showMore{align-self:flex-start;height:28px;padding:0 10px;border:none;background:transparent;color:var(--pi-dim);font-size:var(--text-xs);font-weight:600;cursor:pointer}.cw-showMore:hover{color:var(--pi-ink)}.cw-modeToggle button:focus-visible,.cw-filters button:focus-visible,.cw-addProject:focus-visible,.cw-showMore:focus-visible,.cw-workspaceHead:focus-visible,.cw-substrateChip:focus-visible,.cw-cardActions button:focus-visible{outline:2px solid color-mix(in srgb,var(--pi-accent) 70%,white);outline-offset:2px}@media(max-width:600px){.cw-toolbar{flex-direction:column;align-items:stretch}.cw-search{flex:none;width:100%;min-width:0;max-width:none}.cw-addProject{margin-left:0}.cw-grid{grid-template-columns:1fr}.cw-workspaceHead{flex-wrap:wrap}.cw-workspaceRoot{flex:1 1 100%;order:3}.cw-workspaceMeta{flex-wrap:wrap}}
@@ -1 +0,0 @@
1
- import{r as m,j as s}from"./index-C8uS5szO.js";import{a as k}from"./api-CaROe5_H.js";import{u as R}from"./sse-v5QLsOHV.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as j}from"./SessionRefScreen-BOQ1_ydg.js";/* empty css */import{c as E}from"./createLucideIcon-DkjnzvcJ.js";import{X as A}from"./x-DI1ktCYb.js";import"./index-BWHgHrtv.js";import"./tail-events-DQ46QBW1.js";import"./BackToPicker-Bys9ColC.js";import"./router-BKiMcYa7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-Ch9aYlgi.js";import"./ConversationScreen-tTP6B_F-.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"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-C5cX8dkl.js";import"./HarnessMark-Bt47OeHy.js";import"./NewChatOrigin-CyPPWTJP.js";import"./keyboard-nav-CXfav14z.js";import"./chevron-down-B5eMsn5c.js";import"./search-C4VlW_0l.js";import"./file-text-ChtICwub.js";import"./ConversationComposer-B7RU6LKd.js";import"./AgentAvatar-BIwg54Tj.js";import"./Provider-5Hotn7NQ.js";import"./machine-scope-DJt9RZ2w.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-f12RRQpV.js";import"./TextDocumentSurface-BhYvAB0o.js";import"./index-CvsM3jm8.js";import"./chevron-right-C7UGFpkl.js";import"./folder-0fWevPvQ.js";import"./chevron-up-BHOEgHcn.js";import"./code-xml-BmyLM0I2.js";import"./arrow-left-PuKdO3NM.js";import"./arrow-right-ldbfp4SZ.js";import"./chunk-HRAB3GC3-C5X-kFhb.js";import"./SpriteAvatar-BW1JzkDt.js";import"./CrewAvatar-CJhuqTsJ.js";import"./zap-sKPkh4sQ.js";import"./message-markup-DgFSyb3f.js";import"./mentions-Ctw1ECUC.js";import"./AgentDetailCard-CFDE8TLi.js";import"./AgentLiveActions-lYzicnNa.js";import"./terminal-takeover-BlpxpvSp.js";import"./openContent-C6XO6kr5.js";import"./eye-CtqSV8BS.js";import"./terminal-96JWDYDL.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-DGR4kOog.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-CCSU8uo_.js";import"./AstronautSuit-C-4I5YKi.js";import"./panel-right-BNTJhy8M.js";import"./CommsFlowGraph-Czg-KTS0.js";import"./comms-gesture-_aGFo6g3.js";import"./CommsCanvas-DOKw3Q8i.js";import"./comms-deck-CBhsXnY-.js";import"./CommsFlowMap-CzBWvSa5.js";import"./CommsSelection-g1twA-Lb.js";/* empty css */import"./use-conversation-list-A_YUf8lo.js";import"./agent-master-model-C-KdOFDK.js";import"./use-beside-Df-F2Uvg.js";import"./ConversationFeedRows-DVqnZQH0.js";import"./ConversationPanels-C9yCAoJy.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-D7n3vK8t.js";import"./proxy-DOG46ja4.js";import"./activity-CSUhvjD0.js";import"./message-circle-CSiJj6yo.js";import"./ConversationStatus-CK-YfLpi.js";import"./check-B8dMv3Is.js";import"./sparkles-BbOFw3d0.js";import"./SessionObserve-DaqDhqDI.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-Czggx8oM.js";import"./LaneToolHoverCard-C6YehJqD.js";import"./lane-observe-BD21P8BB.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-DkEkQzo-.js";import"./ObserveTextFlow-ET0dD1wO.js";import"./SessionObserveEvidence-Drv-D8Oh.js";import"./wrench-BsMTSeji.js";import"./external-link-RT4Ph-6-.js";import"./session-ref-lookup-state-SATH_jAP.js";/* empty css */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],L=E("columns-2",T);function S(t){const o=new Map;for(const r of t)o.delete(r.sessionId),o.set(r.sessionId,r);return[...o.values()]}function M(t,o){const r=S(t),d=o?.trim()||null;return r.find(n=>n.sessionId===d)?.sessionId??r.at(-1)?.sessionId??d}function O(t){return t.length<=34?t:`${t.slice(0,15)}…${t.slice(-14)}`}function q(t,o){return o===0?t.strategy||"dispatch":t.strategy?`switched via ${t.strategy}`:"session changed"}function y({label:t,sessions:o,value:r,onChange:d}){return s.jsxs("label",{className:"s-flight-observe-select-wrap",children:[s.jsx("span",{children:t}),s.jsx("select",{className:"s-flight-observe-select",value:r,onChange:n=>d(n.currentTarget.value),children:o.map(n=>s.jsxs("option",{value:n.sessionId,children:[n.harness?`${n.harness} · `:"",n.sessionId]},n.sessionId))})]})}function Te({route:t,navigate:o}){const[r,d]=m.useState(null),[n,I]=m.useState(!0),[h,N]=m.useState(null),u=m.useCallback(async()=>{try{const e=await k(`/api/flights?active=false&flightId=${encodeURIComponent(t.flightId)}`);d(e[0]??null),N(e.length===0?"This flight is not available on the connected broker.":null)}catch(e){N(e instanceof Error?e.message:String(e))}finally{I(!1)}},[t.flightId]);m.useEffect(()=>{I(!0),u()},[u]),R(()=>{u()});const v=r?.sessions??[],a=m.useMemo(()=>S(v),[v]),g=M(v,t.sessionId),i=a.find(e=>e.sessionId===g)??null,l=a.find(e=>e.sessionId===t.compareSessionId)??null,f=!!(i&&l&&i.sessionId!==l.sessionId),c=m.useCallback((e,p)=>{o({...t,sessionId:e,...p?{compareSessionId:p}:{compareSessionId:void 0}})},[o,t]),w=m.useCallback(()=>{if(!i||a.length<2)return;const e=[...a].reverse().find(p=>p.sessionId!==i.sessionId);e&&c(i.sessionId,e.sessionId)},[i,a,c]),C=m.useCallback(e=>{if(!f||!i||!l){c(e);return}c(e,e===l.sessionId?i.sessionId:l.sessionId)},[l,i,f,c]);return s.jsxs("div",{className:"s-flight-observe",children:[s.jsxs("header",{className:"s-flight-observe-header",children:[s.jsxs("div",{className:"s-flight-observe-heading",children:[s.jsx("div",{className:"s-flight-observe-eyebrow",children:"Flight observe"}),s.jsxs("div",{className:"s-flight-observe-title-row",children:[s.jsx("h2",{children:r?.agentName||r?.agentId||"Flight"}),s.jsx("span",{className:`s-flight-observe-state s-flight-observe-state--${r?.state??"loading"}`,children:r?.state??(n?"loading":"unknown")})]}),s.jsx("div",{className:"s-flight-observe-id",title:t.flightId,children:t.flightId}),r?.summary&&s.jsx("p",{children:r.summary})]}),s.jsxs("div",{className:"s-flight-observe-actions",children:[a.length>1&&!f&&s.jsxs("button",{type:"button",onClick:w,children:[s.jsx(L,{size:13})," Split view"]}),f&&i&&s.jsxs("button",{type:"button",onClick:()=>c(i.sessionId),children:[s.jsx(A,{size:13})," Close split"]})]})]}),v.length>0&&s.jsx("nav",{className:"s-flight-observe-trace","aria-label":"Flight session history",children:v.map((e,p)=>{const b=i?.sessionId===e.sessionId,x=l?.sessionId===e.sessionId;return s.jsxs("div",{className:"s-flight-observe-trace-step",children:[p>0&&s.jsx("span",{className:"s-flight-observe-trace-arrow","aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:"s-flight-observe-session-chip","data-selected":b||x,"data-observe-role":b?"primary":x?"compare":"idle","aria-pressed":b||x,title:e.sessionId,onClick:()=>C(e.sessionId),children:[s.jsxs("span",{className:"s-flight-observe-session-chip-top",children:[s.jsx("span",{children:e.harness||e.transport||"session"}),s.jsx("time",{title:new Date(e.startedAt).toLocaleString(),children:$(e.startedAt)||F(e.startedAt)})]}),s.jsx("strong",{children:O(e.sessionId)}),s.jsx("small",{children:q(e,p)})]})]},`${e.sessionId}:${e.startedAt}:${p}`)})}),h&&!g&&s.jsx("div",{className:"s-flight-observe-message s-flight-observe-message--error",children:h}),h&&g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Flight record unavailable"}),s.jsx("span",{children:"Showing the concrete session captured by this link."})]}),!h&&n&&s.jsx("div",{className:"s-flight-observe-message",children:"Resolving the flight’s session trace…"}),!h&&!n&&a.length===0&&!g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Waiting for a session"}),s.jsx("span",{children:"The flight is stable here; its trace will appear as soon as a harness acknowledges dispatch."})]}),g&&!f&&s.jsx("main",{className:"s-flight-observe-single",children:s.jsx(j,{sessionRef:g,navigate:o})}),!h&&i&&l&&f&&s.jsxs("main",{className:"s-flight-observe-split",children:[s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Primary session",sessions:a,value:i.sessionId,onChange:e=>c(e,e===l.sessionId?i.sessionId:l.sessionId)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:i.sessionId,navigate:o,showObserveRail:!1})})]}),s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Compare session",sessions:a.filter(e=>e.sessionId!==i.sessionId),value:l.sessionId,onChange:e=>c(i.sessionId,e)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:l.sessionId,navigate:o,showObserveRail:!1})})]})]})]})}export{Te as FlightObserveScreen};