@openscout/scout 0.2.96 → 0.2.98

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 (395) hide show
  1. package/README.md +0 -1
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-sfonf5SR.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-IqOtJfRs.js → AddProjectForm-fXndbzXT.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-6-KBVKUu.js → AgentAvatar-Dz79iTxB.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-DDc3udYM.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-DHDS9Pgd.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-C9rn3Fj5.js → AgentDetailCard-8viaEY8b.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-DuyvyMMj.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-qntgg2q2.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-DI2iW9zO.js → AgentLaneCard-Cc9uyfBr.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-D8bARHMx.js → AgentLaneChrome-Dv2lBFoH.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-52un7dKC.js → AgentLaneDetailSheet-CGqtqSHQ.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-CEBjmPTa.js → AgentLaneSummaryResize-Di4u6df2.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-q20mTjms.js → AgentLanesPreflight-CCGBArIb.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-96lHsoX7.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-DrEJDJef.js → AgentLiveActions-DlSKL60c.js} +1 -1
  20. package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +1 -0
  21. package/dist/client/assets/{AgentSessions-DCPCG4xb.js → AgentSessions-DV9v34aq.js} +2 -2
  22. package/dist/client/assets/AgentsConsole-DTpVhS67.js +1 -0
  23. package/dist/client/assets/AgentsScreen-hZ4o2I-e.js +1 -0
  24. package/dist/client/assets/AgentsSubnav-Ci7uWM7P.js +1 -0
  25. package/dist/client/assets/{AstronautSuit-DbjQtfD_.js → AstronautSuit-CwB4Dw07.js} +1 -1
  26. package/dist/client/assets/{AtopView-Daq_ob3z.js → AtopView-D7vyQDtE.js} +1 -1
  27. package/dist/client/assets/{BackToPicker-CXZjBRAe.js → BackToPicker-BHicJyfc.js} +1 -1
  28. package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +1 -0
  29. package/dist/client/assets/{BriefingsScreen-B5oMTGKv.js → BriefingsScreen-Cn4Mbam9.js} +1 -1
  30. package/dist/client/assets/{BrokerMetadataPanel-BsiU8lTD.js → BrokerMetadataPanel-BJSwU9XZ.js} +1 -1
  31. package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +5 -0
  32. package/dist/client/assets/{CastPicker-_5E5hNUe.js → CastPicker-CkgTalIt.js} +1 -1
  33. package/dist/client/assets/{ChatCollapsedStrip-D-eXhzPf.js → ChatCollapsedStrip-7Wrg8Ge0.js} +1 -1
  34. package/dist/client/assets/{CodeDiffPane-n7W4iGUG.js → CodeDiffPane-DfluIWmO.js} +1 -1
  35. package/dist/client/assets/{CodeProjectPicker-CMsbSTDq.js → CodeProjectPicker-By_Wz9ex.js} +1 -1
  36. package/dist/client/assets/CodeScreen-cLC0tJ4S.js +1 -0
  37. package/dist/client/assets/ConversationComposer-BUIjWMBi.js +1 -0
  38. package/dist/client/assets/ConversationFeedRows-Bx0gFyG_.js +1 -0
  39. package/dist/client/assets/ConversationHeader-Bt2RBj93.js +1 -0
  40. package/dist/client/assets/{ConversationPanels-Dujvnmup.js → ConversationPanels-o6W-cOoU.js} +2 -2
  41. package/dist/client/assets/ConversationScreen-DIU7m_aC.js +2 -0
  42. package/dist/client/assets/{ConversationStatus-DVzSb2Hv.js → ConversationStatus-CTYOywFh.js} +1 -1
  43. package/dist/client/assets/{CrewAvatar-BwXjyg8N.js → CrewAvatar-CZ_faQ_s.js} +1 -1
  44. package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +1 -0
  45. package/dist/client/assets/CrewWorkspaces-Diq11KDq.css +1 -0
  46. package/dist/client/assets/{DataTable-Bp8tU9AK.js → DataTable-C6aMSilS.js} +1 -1
  47. package/dist/client/assets/{DispatchAftermath-B-6rmXzL.js → DispatchAftermath-ZCEB75hh.js} +1 -1
  48. package/dist/client/assets/{DocumentFocusViewer-Do3wQ_3Z.js → DocumentFocusViewer-D8iB6SMt.js} +1 -1
  49. package/dist/client/assets/{EmbeddableSurfacesLab-C1orRyP9.js → EmbeddableSurfacesLab-D3iZiS8o.js} +1 -1
  50. package/dist/client/assets/{EmptyState-CJzXj1l5.js → EmptyState-CKPWFSjq.js} +1 -1
  51. package/dist/client/assets/{FileViewerPane-Df6VzXjA.js → FileViewerPane-CxNbcTYf.js} +1 -1
  52. package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +1 -0
  53. package/dist/client/assets/{FollowScreen-DvnxYLVh.js → FollowScreen-CkR-okdL.js} +1 -1
  54. package/dist/client/assets/{HarnessMark-B979GCSB.js → HarnessMark-DttReffF.js} +1 -1
  55. package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +1 -0
  56. package/dist/client/assets/{HerdrSession-B3McuYgi.js → HerdrSession-DsuxCtfX.js} +1 -1
  57. package/dist/client/assets/{HomeHero-CdUVPjkG.js → HomeHero-DXJo2QSO.js} +1 -1
  58. package/dist/client/assets/{HostAdvisorView-Bok5Sk5c.js → HostAdvisorView-DeJ-8RZV.js} +1 -1
  59. package/dist/client/assets/{KnowledgeSearchInspector-B7XSoJsu.js → KnowledgeSearchInspector-W_zNIBRV.js} +1 -1
  60. package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +1 -0
  61. package/dist/client/assets/{LaneToolHoverCard-HByf2ndx.js → LaneToolHoverCard-t7-XJP-h.js} +1 -1
  62. package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +1 -0
  63. package/dist/client/assets/{LaneTraceEventFocus-DM-hoPxG.js → LaneTraceEventFocus-BB5DhFQm.js} +1 -1
  64. package/dist/client/assets/{MeshCanvas-DCLJRsBy.js → MeshCanvas-DZv2ipsy.js} +1 -1
  65. package/dist/client/assets/{MeshCanvasMinimap-cEFS9eW7.js → MeshCanvasMinimap-BXHRNb7l.js} +1 -1
  66. package/dist/client/assets/MeshScreen-DuNvpDC5.js +1 -0
  67. package/dist/client/assets/{MeshTopologyView-CCRPd8PU.js → MeshTopologyView-Dc0GSrKa.js} +2 -2
  68. package/dist/client/assets/MessagesScreen-dNNPFwAc.js +1 -0
  69. package/dist/client/assets/{MissionContextRail-DF0_kiU7.js → MissionContextRail-DnCWPzAM.js} +1 -1
  70. package/dist/client/assets/MissionControlView-DmaThhNR.js +1 -0
  71. package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +1 -0
  72. package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +1 -0
  73. package/dist/client/assets/{MissionLogPane-BbdDKjUl.js → MissionLogPane-BLvSSIdT.js} +1 -1
  74. package/dist/client/assets/{NewAgentModal-DfHxad34.js → NewAgentModal-B7qxjZlW.js} +1 -1
  75. package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +19 -0
  76. package/dist/client/assets/{NewChatOrigin-B1u7ki70.js → NewChatOrigin-DCn5cWPZ.js} +1 -1
  77. package/dist/client/assets/{ObserveEmbedScreen-Co0xTii6.js → ObserveEmbedScreen-DvKGsaLv.js} +2 -2
  78. package/dist/client/assets/{ObserveTextFlow-ZQWwrK3i.js → ObserveTextFlow-DCJ5EmD8.js} +2 -2
  79. package/dist/client/assets/{ObservedTopologyPanel-BJUhDSuQ.js → ObservedTopologyPanel-CJVqIqQ2.js} +1 -1
  80. package/dist/client/assets/{OpenScoutAppShell-CUd2yOLu.js → OpenScoutAppShell-C9TOLB7u.js} +2 -2
  81. package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +1 -0
  82. package/dist/client/assets/OpsScreen-CJBwshEp.js +1 -0
  83. package/dist/client/assets/OpsSubnav-CjDTnp64.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +1 -0
  85. package/dist/client/assets/ProjectAgentProfileBar-CUzZ4Rpx.js +1 -0
  86. package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +1 -0
  87. package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +2 -0
  88. package/dist/client/assets/ProjectsRail-kMDA0yn4.js +1 -0
  89. package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +1 -0
  90. package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +1 -0
  91. package/dist/client/assets/Provider-D0bB7q6y.js +1 -0
  92. package/dist/client/assets/{RailRow-CEH2MFBw.js → RailRow-B88JVr62.js} +1 -1
  93. package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +1 -0
  94. package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +1 -0
  95. package/dist/client/assets/{RepoDiffEmbedScreen-kY2pHjIs.js → RepoDiffEmbedScreen-mexrJPhW.js} +1 -1
  96. package/dist/client/assets/{RepoDiffPageScreen-C6LhoKrn.js → RepoDiffPageScreen-DbqX4L3q.js} +1 -1
  97. package/dist/client/assets/{RepoDiffViewer-BhcIIQQg.js → RepoDiffViewer-Bw5yMC4A.js} +1 -1
  98. package/dist/client/assets/{RepoDiffViewerLazy-Csy_j9LD.js → RepoDiffViewerLazy-DzfoFhbl.js} +2 -2
  99. package/dist/client/assets/{ReposScreen-B_cB0zu7.js → ReposScreen-CzbO1Fuy.js} +2 -2
  100. package/dist/client/assets/{ScoutDeckSurface-CSy_fjcG.js → ScoutDeckSurface-DQoZofzH.js} +1 -1
  101. package/dist/client/assets/{ScoutSurface-CQVcSrin.js → ScoutSurface-NlhDsPzg.js} +1 -1
  102. package/dist/client/assets/{ScoutbotFxLab-DqGiLYNy.js → ScoutbotFxLab-l2WAahCg.js} +1 -1
  103. package/dist/client/assets/{SecondaryNav-BR4VRdgh.js → SecondaryNav-Cs0_FQdj.js} +1 -1
  104. package/dist/client/assets/{SessionEmbedScreen-BTlZ9gAg.js → SessionEmbedScreen-CpduQ0O9.js} +1 -1
  105. package/dist/client/assets/{SessionObserve-dQDN23pP.js → SessionObserve-BVeTkcIl.js} +1 -1
  106. package/dist/client/assets/{SessionObserveEvidence-BRBGKAgd.js → SessionObserveEvidence-BkOezTGV.js} +1 -1
  107. package/dist/client/assets/SessionRefScreen-DetLMkTT.js +1 -0
  108. package/dist/client/assets/SessionsScreen-B-McKw6d.js +1 -0
  109. package/dist/client/assets/{SettingsDrawer-RGVK_bmE.js → SettingsDrawer-CPB32w0n.js} +3 -3
  110. package/dist/client/assets/SettingsScreen-BEzYFdjz.js +1 -0
  111. package/dist/client/assets/{ShikiPane-DYI9Hkge.js → ShikiPane-C0TuCATU.js} +1 -1
  112. package/dist/client/assets/{SlidePanel-B9ugxWgA.js → SlidePanel-CETQ5NTx.js} +1 -1
  113. package/dist/client/assets/{SpriteAvatar-z5hHesx9.js → SpriteAvatar-DFO4Kb4Z.js} +1 -1
  114. package/dist/client/assets/{StatusPill-BFvMjmZV.js → StatusPill-BllrY-eg.js} +1 -1
  115. package/dist/client/assets/{TailView-0uEIj2JH.js → TailView-_gKWfaQM.js} +2 -2
  116. package/dist/client/assets/Terminal-DWyZTZdY.js +1 -0
  117. package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +1 -0
  118. package/dist/client/assets/{TerminalHeaderMount-BL07cd0q.js → TerminalHeaderMount-CY7uIWBg.js} +1 -1
  119. package/dist/client/assets/{TextDocumentSurface-BflAwXeZ.js → TextDocumentSurface-2X1Gw4eA.js} +1 -1
  120. package/dist/client/assets/{TmuxPeek-BTnjOQi0.js → TmuxPeek-CqTJRhkI.js} +1 -1
  121. package/dist/client/assets/{VoicePermissionsPanel-CgQ6GGS-.js → VoicePermissionsPanel-C4vkU-sU.js} +1 -1
  122. package/dist/client/assets/{WorkDetailScreen-CaLG-zDs.js → WorkDetailScreen-DqGnuK0e.js} +3 -3
  123. package/dist/client/assets/{WorkFilesViewer-B9Sil_No.js → WorkFilesViewer-D8-4vF5l.js} +1 -1
  124. package/dist/client/assets/{activity-DcrMApUY.js → activity-CzTJ-YMX.js} +1 -1
  125. package/dist/client/assets/{addon-fit-DMVrz5Sv.js → addon-fit-Zx3A7pGS.js} +1 -1
  126. package/dist/client/assets/{addon-webgl-BYvpZUyu.js → addon-webgl-DitJj-N0.js} +1 -1
  127. package/dist/client/assets/{agent-autocomplete-B-5QTeas.js → agent-autocomplete-BlK8wY06.js} +1 -1
  128. package/dist/client/assets/{agent-essentials-D7KRGYvF.js → agent-essentials-K9B6kbTS.js} +1 -1
  129. package/dist/client/assets/{agent-lane-card-model-CNZMPkhc.js → agent-lane-card-model-CY3OE1Xu.js} +1 -1
  130. package/dist/client/assets/{agent-lanes-model-DXqjs0OK.js → agent-lanes-model-tc-1hE6q.js} +1 -1
  131. package/dist/client/assets/{agent-master-model-DqjrVI2h.js → agent-master-model-DMcHeNq3.js} +1 -1
  132. package/dist/client/assets/agent-specialization-CtF_jI34.js +1 -0
  133. package/dist/client/assets/agents-project-DgbqDc65.css +1 -0
  134. package/dist/client/assets/{arc.es-NHqHWohb.js → arc.es-BNXJqSw7.js} +1 -1
  135. package/dist/client/assets/{arrow-down-CKtSUjmW.js → arrow-down-BAGkhHA6.js} +1 -1
  136. package/dist/client/assets/{arrow-left-Czpf-AE4.js → arrow-left-eToA6GxC.js} +1 -1
  137. package/dist/client/assets/{arrow-right-BuzMnLYP.js → arrow-right-DTX42clh.js} +1 -1
  138. package/dist/client/assets/{arrow-up-right-C6Wl-1uw.js → arrow-up-right-B09GPwFl.js} +1 -1
  139. package/dist/client/assets/{bot-rd0awxD3.js → bot-WxKXYtEX.js} +1 -1
  140. package/dist/client/assets/{check-ofKUE8yH.js → check-Dz2SRHft.js} +1 -1
  141. package/dist/client/assets/{chevron-down-wciXnOQz.js → chevron-down-D120PY4g.js} +1 -1
  142. package/dist/client/assets/{chevron-right-D-HdlPg8.js → chevron-right-CowuvuE6.js} +1 -1
  143. package/dist/client/assets/{chunk-HRAB3GC3-Tyv9rzx7.js → chunk-HRAB3GC3-KjjrTLCU.js} +1 -1
  144. package/dist/client/assets/{chunk-JTPDIGGW-BC2Mandc.js → chunk-JTPDIGGW-COJ00z94.js} +3 -3
  145. package/dist/client/assets/{chunk-T65CQEWV-C1AWTYZZ.js → chunk-T65CQEWV-H2QEKfr1.js} +1 -1
  146. package/dist/client/assets/{chunk-YOZR3KYS-DwHPHa6f.js → chunk-YOZR3KYS-CrCgXw9l.js} +1 -1
  147. package/dist/client/assets/{clock-B88r8OrZ.js → clock-_9FDplIT.js} +1 -1
  148. package/dist/client/assets/{code-xml-D7pOQM9l.js → code-xml-CkkNdRmu.js} +1 -1
  149. package/dist/client/assets/{compass-Dt1AMXz2.js → compass-BdpImt_W.js} +1 -1
  150. package/dist/client/assets/content-0RBfbCIJ.js +1 -0
  151. package/dist/client/assets/content-BTmnk2bl.js +1 -0
  152. package/dist/client/assets/content-Bk5DKhyP.js +1 -0
  153. package/dist/client/assets/{content-nkx0swDe.js → content-Bw_8GE_S.js} +1 -1
  154. package/dist/client/assets/content-CI4gLEWi.js +1 -0
  155. package/dist/client/assets/content-CLCtp9Rb.js +1 -0
  156. package/dist/client/assets/content-C_FAGTNk.js +1 -0
  157. package/dist/client/assets/content-CnnzWOE3.js +1 -0
  158. package/dist/client/assets/content-DKlY98pO.js +1 -0
  159. package/dist/client/assets/content-Df7ndXTG.js +1 -0
  160. package/dist/client/assets/content-DkZDzzx3.js +1 -0
  161. package/dist/client/assets/content-DnGmb2L0.js +1 -0
  162. package/dist/client/assets/content-Ds-zs-Ss.js +1 -0
  163. package/dist/client/assets/content-JIWSyC0f.js +1 -0
  164. package/dist/client/assets/content-Q3TIYC8q.js +1 -0
  165. package/dist/client/assets/content-evaBfvxD.js +1 -0
  166. package/dist/client/assets/{context-budget-DX_fwUs3.js → context-budget-DqxWzalx.js} +1 -1
  167. package/dist/client/assets/{conversation-icons-tp9BX6X2.js → conversation-icons-DHGc9wbT.js} +1 -1
  168. package/dist/client/assets/conversation-model-C2KuZUXc.js +1 -0
  169. package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +1 -0
  170. package/dist/client/assets/{copy-CWWAJ75H.js → copy-BzdzWsQd.js} +1 -1
  171. package/dist/client/assets/{cpu-DrqejfkB.js → cpu-CHFIGw87.js} +1 -1
  172. package/dist/client/assets/{createLucideIcon-DezKXSG2.js → createLucideIcon-Dv8H8m7J.js} +1 -1
  173. package/dist/client/assets/discover-DutlV0ZU.js +2 -0
  174. package/dist/client/assets/embed-entry-CJG7WEVw.js +2 -0
  175. package/dist/client/assets/{external-link-Dp_a2vRZ.js → external-link-BvX5PfLh.js} +1 -1
  176. package/dist/client/assets/{eye-BRyD0jno.js → eye-C9cGk5z6.js} +1 -1
  177. package/dist/client/assets/{file-code-corner-muIVH_xO.js → file-code-corner-jlGFdr8d.js} +1 -1
  178. package/dist/client/assets/{file-text-CqJgwxmv.js → file-text-BHro8MkG.js} +1 -1
  179. package/dist/client/assets/{gauge-hU--hKVP.js → gauge-DSflSery.js} +1 -1
  180. package/dist/client/assets/{gestures-DN4hEeqv.js → gestures-YA5IIwp-.js} +1 -1
  181. package/dist/client/assets/{git-branch-CK5v8F2v.js → git-branch-Bc_eDIpG.js} +1 -1
  182. package/dist/client/assets/{home-moving-signal-BjDtEJUP.js → home-moving-signal-PHSqSBu_.js} +1 -1
  183. package/dist/client/assets/home-now-card-C_qsI6C6.js +1 -0
  184. package/dist/client/assets/{home-now-card-nano-C-r_bBg5.js → home-now-card-nano-Jmy7eJ6H.js} +1 -1
  185. package/dist/client/assets/{hooks-D46bABUP.js → hooks-ME7rmhpE.js} +1 -1
  186. package/dist/client/assets/{index-DvLtl7rV.js → index-C1VaWNuD.js} +2 -2
  187. package/dist/client/assets/index-C8UCRm2W.js +1 -0
  188. package/dist/client/assets/index-Cn0I2Hgi.js +1 -0
  189. package/dist/client/assets/index-Cx6Gbr6n.js +1 -0
  190. package/dist/client/assets/{inspector-panel-Dkc7rLvY.js → inspector-panel-CwrHjRaQ.js} +2 -2
  191. package/dist/client/assets/{keyboard-nav-BLYDhL3Z.js → keyboard-nav-B8sQ_8IF.js} +1 -1
  192. package/dist/client/assets/{lane-roster-store-DOdI1O13.js → lane-roster-store-DN2jxXF-.js} +1 -1
  193. package/dist/client/assets/{layers-CSsg3JVP.js → layers-CW2-qHsG.js} +1 -1
  194. package/dist/client/assets/{layout-grid-DOChPJdZ.js → layout-grid-BoVnPOk-.js} +1 -1
  195. package/dist/client/assets/left-BRu9pnqx.js +2 -0
  196. package/dist/client/assets/left-BjS1dKNV.js +2 -0
  197. package/dist/client/assets/left-CL-TVLJ7.js +1 -0
  198. package/dist/client/assets/left-DLpsDi55.js +1 -0
  199. package/dist/client/assets/left-DPcM9o8Y.js +1 -0
  200. package/dist/client/assets/left-MmTJf1tK.js +1 -0
  201. package/dist/client/assets/left-P80i5V8L.js +1 -0
  202. package/dist/client/assets/left-advisor-CbXVzAqS.js +1 -0
  203. package/dist/client/assets/left-agents-7mJsiNyr.js +1 -0
  204. package/dist/client/assets/left-default-COK26l3H.js +1 -0
  205. package/dist/client/assets/left-lanes-Dbdm9Veu.js +1 -0
  206. package/dist/client/assets/left-mission-DqGR5jby.js +1 -0
  207. package/dist/client/assets/library-COnWzUWv.js +1 -0
  208. package/dist/client/assets/{loader-circle-pM56HNhR.js → loader-circle-DmUG_YC7.js} +1 -1
  209. package/dist/client/assets/{local-agents-C8xAhbO5.js → local-agents-VP1-ZlPw.js} +1 -1
  210. package/dist/client/assets/{mentions-DG6OQrsc.js → mentions-BZ5SBMtc.js} +1 -1
  211. package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +1 -0
  212. package/dist/client/assets/{mesh-ops-BZ1h5RQs.js → mesh-ops-CKSWgax2.js} +1 -1
  213. package/dist/client/assets/{mesh-view-store-ChUOASK8.js → mesh-view-store-CBM1za_N.js} +1 -1
  214. package/dist/client/assets/{message-circle-mZCv8tvB.js → message-circle-joGFxfj1.js} +1 -1
  215. package/dist/client/assets/{message-markup-C2LQDm_k.js → message-markup-DC0QFEZn.js} +1 -1
  216. package/dist/client/assets/{message-square-C7t_qtuj.js → message-square-BLiFqpe_.js} +1 -1
  217. package/dist/client/assets/{mission-control-store-nDLdUZPA.js → mission-control-store-CM8mQGg8.js} +1 -1
  218. package/dist/client/assets/model-CBkMvT1w.js +1 -0
  219. package/dist/client/assets/{observe-BpEm1INu.js → observe-BLmy4quB.js} +1 -1
  220. package/dist/client/assets/{page-status-E5jnk48p.js → page-status-BE0-J1xY.js} +1 -1
  221. package/dist/client/assets/{paperclip-C64lkcbM.js → paperclip-Br7wUDFl.js} +1 -1
  222. package/dist/client/assets/{persistent-state-EHXw8WNy.js → persistent-state-BubPQ7tT.js} +1 -1
  223. package/dist/client/assets/{plus-Co-dqKul.js → plus-BWKhylds.js} +1 -1
  224. package/dist/client/assets/profile-BCvk8jOQ.js +1 -0
  225. package/dist/client/assets/projects-inbox-BIW7nv-H.css +1 -0
  226. package/dist/client/assets/projects-inbox-DFbgVlXL.js +1 -0
  227. package/dist/client/assets/{proxy-BiW5suC7.js → proxy-DVDRhSRR.js} +1 -1
  228. package/dist/client/assets/{radio-BOxBQX-T.js → radio-CxIXS1nU.js} +1 -1
  229. package/dist/client/assets/{refresh-cw-DMxGzDwn.js → refresh-cw-Bkh7Cvnd.js} +1 -1
  230. package/dist/client/assets/resolve-panes-DhD5qmQO.js +1 -0
  231. package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +1 -0
  232. package/dist/client/assets/right-B_08ilv6.js +1 -0
  233. package/dist/client/assets/right-Brm67HOL.js +1 -0
  234. package/dist/client/assets/right-BveAPKBW.js +1 -0
  235. package/dist/client/assets/right-CpTB_-Ya.js +1 -0
  236. package/dist/client/assets/right-CqC4Qdot.js +1 -0
  237. package/dist/client/assets/right-D91j9d5Y.js +1 -0
  238. package/dist/client/assets/{right-CimaAvQN.js → right-DVUq5374.js} +1 -1
  239. package/dist/client/assets/right-DaLRhYl3.js +1 -0
  240. package/dist/client/assets/right-Dt1wOwA5.js +1 -0
  241. package/dist/client/assets/right-DtzqIZQF.js +1 -0
  242. package/dist/client/assets/{rocket-BQm5_CvR.js → rocket-CnxqjX_K.js} +1 -1
  243. package/dist/client/assets/{router-B9vQkNJL.js → router-kfcaYqZr.js} +1 -1
  244. package/dist/client/assets/runtime-picker-C20lTGhV.js +1 -0
  245. package/dist/client/assets/{scope-views-1IYJdl41.js → scope-views-KPY85UUx.js} +1 -1
  246. package/dist/client/assets/{scout-voice-BVUqGhth.js → scout-voice-Cg1qfepC.js} +1 -1
  247. package/dist/client/assets/scoutbot-D7kGGyK_.js +3 -0
  248. package/dist/client/assets/{scoutbot-markdown-BQ_Ee2Ic.js → scoutbot-markdown-yb87JlSE.js} +1 -1
  249. package/dist/client/assets/{scroll-text-Dze_dXtQ.js → scroll-text-DFcBYy5J.js} +1 -1
  250. package/dist/client/assets/{search-CDko0PKE.js → search-FB2vVxCp.js} +1 -1
  251. package/dist/client/assets/{secondaryNavConfig-BoQ_zYR9.js → secondaryNavConfig-C0Srrmy8.js} +1 -1
  252. package/dist/client/assets/{selection-bridge-Din6yV3h.js → selection-bridge-qBGFCJv8.js} +1 -1
  253. package/dist/client/assets/{send-horizontal-CSjIm6xg.js → send-horizontal-CS7mxVhX.js} +1 -1
  254. package/dist/client/assets/{server-Bzj7lPIx.js → server-WY6gsbZz.js} +1 -1
  255. package/dist/client/assets/{session-catalog-DsaZJXZt.js → session-catalog-CG4oL_yN.js} +1 -1
  256. package/dist/client/assets/{session-table-BQfR7u6r.js → session-table-uJh3v-ly.js} +1 -1
  257. package/dist/client/assets/{settings-Dyvpkb1D.js → settings-DQEtqkM9.js} +1 -1
  258. package/dist/client/assets/{sliders-horizontal-C8njVwfg.js → sliders-horizontal-57e99_qO.js} +1 -1
  259. package/dist/client/assets/{sparkles-CETYrxGA.js → sparkles-D0vWLTyC.js} +1 -1
  260. package/dist/client/assets/{sse-CD9MMUxl.js → sse-B29iGBnw.js} +1 -1
  261. package/dist/client/assets/{system-surfaces-redesign-QVXNeGYw.css → system-surfaces-redesign-kuf3wuE_.css} +1 -1
  262. package/dist/client/assets/{tail-events-Ps8KpKah.js → tail-events-LK29oCKm.js} +1 -1
  263. package/dist/client/assets/{terminal-9GRS_Qdc.js → terminal-UDy4lzV1.js} +1 -1
  264. package/dist/client/assets/{terminal-relay-GYMIvKs1.js → terminal-relay-CXHMdain.js} +1 -1
  265. package/dist/client/assets/{terminal-screen-BLk4PAYt.css → terminal-screen-vMICbBJh.css} +1 -1
  266. package/dist/client/assets/{terminal-sessions-BQ6t92tJ.js → terminal-sessions-Bdt2W3Y4.js} +1 -1
  267. package/dist/client/assets/{terminal-takeover-_Jyys4me.js → terminal-takeover-BMeBjBB2.js} +1 -1
  268. package/dist/client/assets/{use-conversation-list-C9ABzjXI.js → use-conversation-list-UG-tMN67.js} +1 -1
  269. package/dist/client/assets/{use-fleet-active-asks-DAspZQjE.js → use-fleet-active-asks-CCGrll5q.js} +1 -1
  270. package/dist/client/assets/{use-mesh-ops-items-Dh54ymEp.js → use-mesh-ops-items-BjyeFJTz.js} +1 -1
  271. package/dist/client/assets/{use-reduced-motion-x8pJMVrG.js → use-reduced-motion-CPoX8iV2.js} +1 -1
  272. package/dist/client/assets/{use-scout-dev-flags-DhCbiDK3.js → use-scout-dev-flags-DTseRrFi.js} +1 -1
  273. package/dist/client/assets/{useAgentHoverCard-DoBwV0LX.js → useAgentHoverCard-BgTLNcF-.js} +1 -1
  274. package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +1 -0
  275. package/dist/client/assets/useEmbedHeadline-DuUnwTB7.js +1 -0
  276. package/dist/client/assets/{usePierreRuntime-ejq9dCWV.js → usePierreRuntime-35AHf9RQ.js} +1 -1
  277. package/dist/client/assets/{wrench-DjkoAOQt.js → wrench-BfVeded5.js} +1 -1
  278. package/dist/client/assets/{x-CAbNespN.js → x-DgmmnPKt.js} +1 -1
  279. package/dist/client/assets/{xterm-Cf-ngcGP.js → xterm-DnJJmrCA.js} +1 -1
  280. package/dist/client/assets/{zap-Cq8eWkcF.js → zap-Bcja1lHG.js} +1 -1
  281. package/dist/client/index.html +1 -1
  282. package/dist/main.mjs +5180 -9874
  283. package/dist/node/main.mjs +18 -2
  284. package/dist/pairing-runtime-controller.mjs +31 -2
  285. package/dist/runtime/broker-daemon.mjs +87 -13
  286. package/dist/scout-control-plane-web.mjs +35 -3
  287. package/package.json +2 -5
  288. package/dist/client/assets/ActivityScreen-BnoaUkVZ.js +0 -1
  289. package/dist/client/assets/AgentConfigurationScreen-CuZJy07q.js +0 -1
  290. package/dist/client/assets/AgentDefinitionsWorkspace-Iyl4BesU.js +0 -1
  291. package/dist/client/assets/AgentFloorView-YT-Jjccf.js +0 -1
  292. package/dist/client/assets/AgentInfoScreen-Dr99gQEZ.js +0 -1
  293. package/dist/client/assets/AgentLanesEmbedScreen-Dgcm7zd_.js +0 -1
  294. package/dist/client/assets/AgentLanesView-CetZZDyF.js +0 -2
  295. package/dist/client/assets/AgentMasterScreen-DJPnstoD.js +0 -1
  296. package/dist/client/assets/AgentsConsole-CsYOoFJi.js +0 -1
  297. package/dist/client/assets/AgentsScreen-k8LvBuU_.js +0 -1
  298. package/dist/client/assets/AgentsSubnav-C4xpQhsv.js +0 -1
  299. package/dist/client/assets/BriefingDetailScreen-CUCXO-KH.js +0 -1
  300. package/dist/client/assets/BrokerScreen-BPbOHhCS.js +0 -5
  301. package/dist/client/assets/CodeScreen-CeuO3EhR.js +0 -1
  302. package/dist/client/assets/ConversationComposer-CXPKx86g.js +0 -1
  303. package/dist/client/assets/ConversationFeedRows-WrH-YI3L.js +0 -1
  304. package/dist/client/assets/ConversationHeader-BQWzGzLK.js +0 -1
  305. package/dist/client/assets/ConversationScreen-CR9pWB65.js +0 -2
  306. package/dist/client/assets/CrewWorkspaces-CkQDhyie.css +0 -1
  307. package/dist/client/assets/CrewWorkspaces-NKujRzwh.js +0 -1
  308. package/dist/client/assets/FlightObserveScreen-6mGnmWQA.js +0 -1
  309. package/dist/client/assets/HarnessesScreen-CHTuv8p6.js +0 -1
  310. package/dist/client/assets/KnowledgeSearchScreen-D3o3IODW.js +0 -1
  311. package/dist/client/assets/LaneTraceDetailSheet-BUgHz-sd.js +0 -1
  312. package/dist/client/assets/MeshScreen-BcxPkhm6.js +0 -1
  313. package/dist/client/assets/MessagesScreen-Bb5l13MO.js +0 -1
  314. package/dist/client/assets/MissionControlView-E3V7bENU.js +0 -1
  315. package/dist/client/assets/MissionFocusOverlay-h15sQFvP.js +0 -1
  316. package/dist/client/assets/MissionLeftAgentRow-KPdk9rSa.js +0 -1
  317. package/dist/client/assets/NewChatComposer-_Stj0fZy.js +0 -19
  318. package/dist/client/assets/OpsAgentsView-DI5wu1si.js +0 -1
  319. package/dist/client/assets/OpsScreen-D8fQafCl.js +0 -1
  320. package/dist/client/assets/OpsSubnav-1K4Jaf__.js +0 -1
  321. package/dist/client/assets/ProjectAgentProfile-Bdjd_dAx.js +0 -1
  322. package/dist/client/assets/ProjectAgentProfileBar-k2QHHHsQ.js +0 -1
  323. package/dist/client/assets/ProjectAgentProfileHero-Bpxk1ui2.js +0 -1
  324. package/dist/client/assets/ProjectsInbox-C_bMHLCc.js +0 -2
  325. package/dist/client/assets/ProjectsRail-J-aH_pxT.js +0 -1
  326. package/dist/client/assets/ProjectsScreen-cVUkGbPz.js +0 -1
  327. package/dist/client/assets/ProjectsThreadAside-_ourdM-Q.js +0 -1
  328. package/dist/client/assets/Provider-CtXJeLrP.js +0 -1
  329. package/dist/client/assets/RawSessionsTable-CDyrom-F.js +0 -1
  330. package/dist/client/assets/RealtimeVoiceScreen-DBl3DN1H.js +0 -1
  331. package/dist/client/assets/SessionRefScreen-COVQMbtE.js +0 -1
  332. package/dist/client/assets/SessionsScreen--5OJ3p3v.js +0 -1
  333. package/dist/client/assets/SettingsScreen-CCxzy5IU.js +0 -1
  334. package/dist/client/assets/Terminal-DouZeNxc.js +0 -1
  335. package/dist/client/assets/TerminalEmbedScreen-dMNUbzXr.js +0 -1
  336. package/dist/client/assets/agent-specialization-BujJVUTD.js +0 -1
  337. package/dist/client/assets/agents-project-COzHxZAF.css +0 -1
  338. package/dist/client/assets/agents-project-model-UYiamtrU.js +0 -1
  339. package/dist/client/assets/content-9K38QchR.js +0 -1
  340. package/dist/client/assets/content-BRgnyXWh.js +0 -1
  341. package/dist/client/assets/content-BWPNyXJ0.js +0 -1
  342. package/dist/client/assets/content-BdkI07v3.js +0 -1
  343. package/dist/client/assets/content-C4oWa8SB.js +0 -1
  344. package/dist/client/assets/content-C9ijJxyl.js +0 -1
  345. package/dist/client/assets/content-CFZ4rghn.js +0 -1
  346. package/dist/client/assets/content-CIqu_Ci_.js +0 -1
  347. package/dist/client/assets/content-CnJF9DGO.js +0 -1
  348. package/dist/client/assets/content-CriW8Y8u.js +0 -1
  349. package/dist/client/assets/content-DDCyPPk_.js +0 -1
  350. package/dist/client/assets/content-DtcZeh5m.js +0 -1
  351. package/dist/client/assets/content-U9tsdtle.js +0 -1
  352. package/dist/client/assets/content-hFLK3CON.js +0 -1
  353. package/dist/client/assets/content-p00KQrtD.js +0 -1
  354. package/dist/client/assets/conversation-model-Dc02NsGp.js +0 -1
  355. package/dist/client/assets/conversation-motion-features-D9-RmBSq.js +0 -1
  356. package/dist/client/assets/discover-C2CZO4Tk.js +0 -2
  357. package/dist/client/assets/embed-entry-BSMUykuG.js +0 -2
  358. package/dist/client/assets/home-now-card-nF8OotI-.js +0 -1
  359. package/dist/client/assets/index-CPrU5q04.js +0 -1
  360. package/dist/client/assets/index-kL1WLbeS.js +0 -1
  361. package/dist/client/assets/index-zvhpRHao.js +0 -1
  362. package/dist/client/assets/left-B-SdEJSJ.js +0 -1
  363. package/dist/client/assets/left-B3wSE6ql.js +0 -1
  364. package/dist/client/assets/left-BNRFiRsb.js +0 -2
  365. package/dist/client/assets/left-BggzhgXN.js +0 -1
  366. package/dist/client/assets/left-CARCvvxS.js +0 -2
  367. package/dist/client/assets/left-CpokZYHt.js +0 -1
  368. package/dist/client/assets/left-YT7mIGuH.js +0 -1
  369. package/dist/client/assets/left-advisor-CCY0vkcO.js +0 -1
  370. package/dist/client/assets/left-agents-trhO5sL8.js +0 -1
  371. package/dist/client/assets/left-default-CG33elBs.js +0 -1
  372. package/dist/client/assets/left-lanes-CitMgeTp.js +0 -1
  373. package/dist/client/assets/left-mission-Zl2m_5eU.js +0 -1
  374. package/dist/client/assets/library-DkALuCh5.js +0 -1
  375. package/dist/client/assets/mesh-buckets-6y3ZIibI.js +0 -1
  376. package/dist/client/assets/mesh-roster-Bc7T4b7z.js +0 -1
  377. package/dist/client/assets/model-IGCUEsMy.js +0 -1
  378. package/dist/client/assets/profile-APxDsN2P.js +0 -1
  379. package/dist/client/assets/projects-inbox-Cg4X2lUQ.js +0 -1
  380. package/dist/client/assets/projects-inbox-DRBl2N85.css +0 -1
  381. package/dist/client/assets/resolve-panes-DeVJbS9c.js +0 -1
  382. package/dist/client/assets/resolve-sidebar-context-BQe5J6xF.js +0 -1
  383. package/dist/client/assets/right-Bmfd3pjP.js +0 -1
  384. package/dist/client/assets/right-BqI-nr9G.js +0 -1
  385. package/dist/client/assets/right-BuCgE0fZ.js +0 -1
  386. package/dist/client/assets/right-BwlW6E57.js +0 -1
  387. package/dist/client/assets/right-C0ybUw0j.js +0 -1
  388. package/dist/client/assets/right-CdkcrmeD.js +0 -1
  389. package/dist/client/assets/right-CkCCPbCX.js +0 -1
  390. package/dist/client/assets/right-D3eSiy41.js +0 -1
  391. package/dist/client/assets/right-Dz_xD0Vj.js +0 -1
  392. package/dist/client/assets/scoutbot-BJIamJOH.js +0 -3
  393. package/dist/client/assets/text-BP3oyl8-.js +0 -1
  394. package/dist/client/assets/useContentSecondaryNav-pZe2Zfk1.js +0 -1
  395. /package/dist/client/assets/{text-BYAFNLNq.css → runtime-picker-BYAFNLNq.css} +0 -0
@@ -1 +0,0 @@
1
- import{r as i,j as e}from"./index-DvLtl7rV.js";/* empty css */import{H as Me}from"./HarnessMark-B979GCSB.js";import{a as ue,S as fe}from"./SpriteAvatar-z5hHesx9.js";import{n as Ze}from"./colors-BtO5_zlx.js";import{o as He,l as Ke}from"./lane-observe-vfyACHi0.js";import{t as We}from"./time-Dhsh_2EG.js";import{S as Be}from"./SessionObserve-dQDN23pP.js";import{l as X,i as Ge}from"./agent-lanes-model-DXqjs0OK.js";import{p as Ve,s as je,a as Ne}from"./lane-roster-store-DOdI1O13.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-HByf2ndx.js";import"./index-zvhpRHao.js";import"./lane-ask-display-B6iCAVcd.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./mentions-DG6OQrsc.js";import"./Provider-CtXJeLrP.js";import"./router-B9vQkNJL.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./AgentDetailCard-C9rn3Fj5.js";import"./AgentLiveActions-DrEJDJef.js";import"./terminal-takeover-_Jyys4me.js";import"./openContent-C6XO6kr5.js";import"./eye-BRyD0jno.js";import"./terminal-9GRS_Qdc.js";import"./message-markup-C2LQDm_k.js";import"./ObservedTopologyPanel-BJUhDSuQ.js";import"./ObserveTextFlow-ZQWwrK3i.js";import"./use-reduced-motion-x8pJMVrG.js";import"./proxy-BiW5suC7.js";import"./SessionObserveEvidence-BRBGKAgd.js";import"./message-circle-mZCv8tvB.js";import"./wrench-DjkoAOQt.js";import"./external-link-Dp_a2vRZ.js";import"./context-budget-DX_fwUs3.js";const z=5*6e4,qe=6,Z=qe+1,be=8,Ue=30*6e4,ye=.65,Ae=1.45,ke=.1,ve=360,Se=260;function pe(t){return Math.round(Math.min(Ae,Math.max(ye,t))*100)/100}function se(t,o){return Math.round(Math.min(o,Math.max(-o,t)))}const I=164,ne=56,$e=14,Le=12,C=66,me=7,P=96,ce=12,D=88,M=150,Je=48,Qe=24,et=480,tt=38,Oe="openscout:agent-floor-orient",Ee="openscout:agent-floor-lane-order";function st(){try{const t=localStorage.getItem(Oe);if(t==="past-left"||t==="past-right")return t}catch{}return"past-left"}function nt(){try{const t=JSON.parse(sessionStorage.getItem(Ee)??"[]");return Array.isArray(t)?t.filter(o=>typeof o=="string"):[]}catch{return[]}}function ae(t){return new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}const at=/^(edit|multi_?edit|write|apply_?patch|patch_apply|str_?replace|notebook_?edit|create_file)/i;function ot(t){return t.kind==="tool"?t.diff||t.tool&&at.test(t.tool.trim())?"edit":"tool":t.kind==="message"||t.kind==="ask"?"msg":null}function lt(t,o){const a=t.observe?.metadata?.session?.sessionStart,l={tool:0,edit:0,msg:0},c=Array.from({length:Z},()=>({blocks:[],counts:{tool:0,edit:0,msg:0},tools:new Map,total:0})),u=[];let b=0,g=null;for(const m of t.observe?.events??[]){const r=ot(m);if(!r)continue;const d=He(m,a),w=d===null||d>=o?0:Math.floor((o-d)/z)+1;if(w>=Z)continue;const _=c[w];_.blocks.push(r),_.counts[r]+=1,_.total+=1,l[r]+=1,b+=1;const x=r==="msg"?null:m.tool?.trim()||"tool";x&&_.tools.set(x,(_.tools.get(x)??0)+1),u.push({kind:r,label:r==="msg"?Ke(m.text,44,1):m.text.trim()||x||"tool",at:d}),g={at:d,label:r==="msg"?"message":m.tool?.trim()||"tool"}}return{lane:t,live:Ge(t.observe)&&b>0,slots:c.map(m=>({blocks:m.blocks.slice(-8),counts:m.counts,tools:[...m.tools.entries()].sort((r,d)=>d[1]-r[1]),total:m.total})),counts:l,strip:u.slice(-10).map(m=>m.kind),lastLabel:g?.label??null,lastAt:g?.at??(t.lastActiveAt||null)}}function oe(t){const o=(a,l,c)=>`${a} ${a===1?l:c}`;return[o(t.tool,"tool","tools"),o(t.edit,"edit","edits"),o(t.msg,"msg","msgs")].join(" · ")}function rt(t){return/^(working|active|running|in_turn|in_flight)/i.test(t.lane.agent.state??"")?"quiet":"idle"}function F(t){return t.tool+t.edit+t.msg}function we(t){if(F(t)===0)return"quiet";const a=[["tool-led",t.tool],["edit-heavy",t.edit],["conversation-led",t.msg]].sort((l,c)=>c[1]-l[1]);return a[0][1]===a[1][1]?"balanced":a[0][0]}function it(t){const o=new Map;for(const l of t.slots)for(const[c,u]of l.tools)o.set(c,(o.get(c)??0)+u);const[a]=[...o.entries()].sort((l,c)=>c[1]-l[1]);return a?{value:a[0],detail:`${a[1]} call${a[1]===1?"":"s"} · 30m`}:{value:"no tool pattern",detail:"messages and edits only"}}function ct(t){const o=t.slots[0]?.total??0,a=t.slots[1]?.total??0;return o===0&&a===0?{value:"quiet",detail:"no work in the last 10m"}:o===0?{value:"paused",detail:`${a} in the prior 5m`}:a===0?{value:"new burst",detail:`${o} in the current 5m`}:o>=a+3?{value:"building",detail:`${o} now · ${a} prior`}:a>=o+3?{value:"easing",detail:`${o} now · ${a} prior`}:{value:"steady",detail:`${o} now · ${a} prior`}}function L({label:t,value:o,detail:a,mix:l}){const c=l?Math.max(1,F(l)):1;return e.jsxs("span",{className:"agent-floor__dock-insight",children:[e.jsx("span",{className:"agent-floor__dock-insight-label",children:t}),e.jsx("span",{className:"agent-floor__dock-insight-value",children:o}),e.jsx("span",{className:"agent-floor__dock-insight-detail",children:a}),l?e.jsx("span",{className:"agent-floor__dock-mix",style:{"--mix-tool":`${l.tool/c*100}%`,"--mix-edit":`${(l.tool+l.edit)/c*100}%`},"aria-hidden":"true"}):null]})}function Ce(t,o){const a=t.lastAt?We(t.lastAt,o):null;return t.live?{glyph:"▸",label:t.lastLabel??"working",meta:a??"now"}:{glyph:"⏸",label:rt(t),meta:a?`· ${a}`:""}}function Fe({series:t,now:o}){const a=Ce(t,o);return t.live?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"agent-floor__card-run",children:a.glyph}),e.jsx("span",{className:"agent-floor__card-tool",children:a.label}),e.jsx("span",{className:"agent-floor__card-ago",children:a.meta})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"agent-floor__card-pause",children:a.glyph}),e.jsxs("span",{className:"agent-floor__card-idle",children:[a.label,a.meta?` ${a.meta}`:""]})]})}function de({kind:t,z:o,size:a=ne,faceH:l=Le,pad:c,live:u}){return e.jsxs("span",{className:`agent-floor__block is-${t}${c?" is-pedestal":""}${u?" is-live":""}`,style:{"--z":`${o}px`,"--bs":`${a}px`,"--bh":`${l}px`},"aria-hidden":"true",children:[e.jsx("span",{className:"agent-floor__face is-left"}),e.jsx("span",{className:"agent-floor__face is-right"}),e.jsx("span",{className:"agent-floor__face is-top"})]})}function dt({slot:t}){const o=Math.max(1,t.total),a=t.counts.tool/o*100,l=t.counts.edit/o*100;return e.jsxs("span",{className:"agent-floor__block agent-floor__slab",style:{"--z":"0px","--bs":`${C}px`,"--bh":`${me}px`,"--mix-a":`${a.toFixed(1)}%`,"--mix-b":`${(a+l).toFixed(1)}%`},"aria-hidden":"true",children:[e.jsx("span",{className:"agent-floor__face is-left"}),e.jsx("span",{className:"agent-floor__face is-right"}),e.jsx("span",{className:"agent-floor__face is-top"})]})}function pt({slot:t,slotIndex:o,periodStart:a}){const l=o===0?`${ae(a)} — now`:`${ae(a-o*z)} – ${ae(a-(o-1)*z)}`;return e.jsxs("span",{className:"agent-floor__peek",children:[e.jsx("span",{className:"agent-floor__peek-range",children:l}),e.jsxs("span",{className:"agent-floor__peek-cols",children:[e.jsxs("span",{className:"agent-floor__peek-col",children:[t.tools.slice(0,3).map(([c,u])=>e.jsxs("span",{className:"agent-floor__peek-tool",children:[c,u>1?` ×${u}`:""]},c)),t.tools.length===0?e.jsx("span",{className:"agent-floor__peek-tool is-empty",children:"no tools"}):null]}),e.jsxs("span",{className:"agent-floor__peek-col is-right",children:[e.jsxs("span",{children:[t.counts.edit," edit",t.counts.edit===1?"":"s"]}),e.jsxs("span",{children:[t.counts.msg," msg",t.counts.msg===1?"":"s"]})]})]})]})}function mt({series:t,index:o,planeW:a,flip:l,periodStart:c,now:u,focused:b,pinned:g,dimmed:m,peekSlot:r,onFocus:d,onPeek:w,onSelect:_}){const{lane:x,live:j,slots:S}=t,O=x.agent,$=X(O,x.source),R=ue(O),H=l?(M-P)/2:a-M+(M-P)/2,Y=(I-P)/2,K=(I-C)/2,le=k=>{const N=(D-C)/2;return l?M+k*D+N:a-M-(k+1)*D+N},W=ce+tt+o%2*14;return e.jsxs("button",{type:"button",className:`agent-floor__lane${j?" is-live":""}${o%2===1?" is-alt":""}${b?" is-focus":""}${g?" is-pinned":""}${m?" is-dim":""}`,style:{left:0,top:o*I,width:a,height:I},onClick:()=>_(x),onMouseEnter:()=>d(x.id),onMouseLeave:()=>{d(null),w(x.id,null)},"aria-label":g?`${$} — open timeline`:`${$} — pin details`,children:[e.jsx("span",{className:"agent-floor__lane-strip","aria-hidden":"true"}),S.map((k,N)=>{if(k.total===0)return null;const B=b&&r===N,T=me+2+k.blocks.length*$e;return e.jsxs("span",{className:`agent-floor__stack${N===0?" is-now":" is-minted"}${B?" is-peeking":""}`,style:{left:le(N),top:K},onMouseEnter:()=>w(x.id,N),children:[e.jsx(dt,{slot:k}),e.jsx("span",{className:"agent-floor__stack-blocks",style:{left:(C-ne)/2,top:(C-ne)/2},children:k.blocks.map((re,y)=>e.jsx(de,{kind:re,z:me+2+y*$e},y))}),B?e.jsx("span",{className:"agent-floor__bb agent-floor__peek-anchor",style:{left:C/2,top:C/2,"--z":`${T+46}px`},children:e.jsx(pt,{slot:k,slotIndex:N,periodStart:c})}):null]},N)}),e.jsxs("span",{className:"agent-floor__pad",style:{left:H,top:Y},"aria-hidden":"true",children:[e.jsx("span",{className:"agent-floor__ground"}),e.jsx(de,{kind:"pad",z:0,size:P,faceH:ce,pad:!0}),j?e.jsx(de,{kind:"head",z:ce+2,size:ne,faceH:Le,live:!0}):null]}),e.jsx("span",{className:"agent-floor__bb agent-floor__flag-anchor",style:{left:H+P/2,top:Y+P/2,"--z":`${W}px`},children:e.jsxs("span",{className:`agent-floor__flag${b?" is-focus":""}${g?" is-pinned":""}`,children:[e.jsx(fe,{name:O.name,size:15,tile:!0,hue:R.hue,tone:R.tone}),e.jsx("span",{className:"agent-floor__flag-name",children:$}),e.jsx("span",{className:"agent-floor__flag-action",children:e.jsx(Fe,{series:t,now:u})}),e.jsx("span",{className:`agent-floor__card-dot${j?" is-live":""}`})]})})]})}function ut({focus:t,pinned:o,ledger:a,liveCount:l,now:c}){if(!t){const d=a.reduce((j,S)=>(j.tool+=S.counts.tool,j.edit+=S.counts.edit,j.msg+=S.counts.msg,j),{tool:0,edit:0,msg:0}),w=a.filter(j=>F(j.counts)>0).length,_=[...a].sort((j,S)=>F(S.counts)-F(j.counts))[0]??null,x=_?F(_.counts):0;return e.jsxs("div",{className:"agent-floor__dock is-resting",children:[e.jsx("span",{className:"agent-floor__dock-id agent-floor__dock-fleet",children:e.jsxs("span",{className:"agent-floor__dock-id-copy",children:[e.jsx("span",{className:"agent-floor__dock-title",children:"fleet at a glance"}),e.jsxs("span",{children:[a.length," lane",a.length===1?"":"s"," · ",l," live"]})]})}),e.jsxs("span",{className:"agent-floor__dock-insights",children:[e.jsx(L,{label:"coverage",value:`${w}/${a.length} lanes`,detail:"showed work · 30m"}),e.jsx(L,{label:"hottest lane",value:_?X(_.lane.agent,_.lane.source):"none yet",detail:_?`${x} classified events`:"waiting for activity"}),e.jsx(L,{label:"throughput",value:`${F(d)} events`,detail:"classified · 30m"}),e.jsx(L,{label:"activity mix",value:we(d),detail:oe(d),mix:d})]})]})}const u=t.lane.agent,b=ue(u),g=ct(t),m=it(t),r=t.slots.filter(d=>d.total>0).length;return e.jsxs("div",{className:`agent-floor__dock${o?" is-pinned":""}`,children:[e.jsxs("span",{className:"agent-floor__dock-id",children:[e.jsx(fe,{name:u.name,size:30,tile:!0,hue:b.hue,tone:b.tone}),e.jsxs("span",{className:"agent-floor__dock-id-copy",children:[e.jsxs("span",{className:"agent-floor__dock-name",children:[X(u,t.lane.source),e.jsx(Me,{harness:u.harness,size:12,className:"agent-floor__card-mark"}),e.jsx("span",{className:`agent-floor__card-dot${t.live?" is-live":""}`}),o?e.jsx("span",{className:"agent-floor__dock-lock",children:"locked"}):null]}),e.jsx("span",{className:"agent-floor__dock-action",children:e.jsx(Fe,{series:t,now:c})})]})]}),e.jsxs("span",{className:"agent-floor__dock-insights",children:[e.jsx(L,{label:"momentum",value:g.value,detail:g.detail}),e.jsx(L,{label:"cadence",value:`${r}/${t.slots.length} windows`,detail:"active five-minute bands"}),e.jsx(L,{label:"signature",value:m.value,detail:m.detail}),e.jsx(L,{label:"activity mix",value:we(t.counts),detail:oe(t.counts),mix:t.counts})]})]})}function ft({series:t,now:o,concise:a,onConciseChange:l,onClose:c,onOpenFull:u,operatorName:b}){const{agent:g,observe:m,source:r}=t.lane,d=X(g,r);return e.jsxs("aside",{className:"agent-floor__trace-panel","aria-label":`${d} selected lane trace`,children:[e.jsx("button",{type:"button",className:"agent-floor__trace-close",onClick:c,"aria-label":"Close selected lane trace",children:"×"}),e.jsx("div",{className:"agent-floor__trace-body",children:m?e.jsx(Be,{data:m,agentId:r==="scout"?g.id:void 0,sessionId:g.harnessSessionId,showRail:!1,variant:"lane",nowMs:o,traceWindowMs:Ue,traceWindowLabel:"30m",laneCollapseTechnicalEvents:a,onLaneCollapseTechnicalEventsChange:l,laneOperatorName:b,onLaneEventSelect:u}):e.jsx("div",{className:"agent-floor__trace-empty",children:"Waiting for trace activity…"})})]})}function gt({zoom:t,fit:o,onZoomChange:a,onReset:l}){const c=Math.round(t*100);return e.jsxs("div",{className:"agent-floor__zoom",role:"group","aria-label":"Floor zoom",children:[e.jsx("button",{type:"button","aria-label":"Zoom out",disabled:t<=ye,onClick:()=>a(pe(t-ke)),children:"−"}),e.jsx("button",{type:"button",className:"agent-floor__zoom-reset","aria-label":"Reset floor zoom to fit",title:"Reset zoom and position to automatic fit",onClick:l,children:o?"fit":`${c}%`}),e.jsx("button",{type:"button","aria-label":"Zoom in",disabled:t>=Ae,onClick:()=>a(pe(t+ke)),children:"+"})]})}function Ms({lanes:t,now:o,onOpenTrace:a,railLedger:l=!1,operatorName:c}){const[u,b]=i.useState(st),[g,m]=i.useState(null),[r,d]=i.useState(null),[w,_]=i.useState(null),[x,j]=i.useState(!1),[S,O]=i.useState(1),[$,R]=i.useState({x:0,y:0}),[H,Y]=i.useState(!1),[K,le]=i.useState(nt),W=i.useRef(null),k=i.useRef(null),[N,B]=i.useState(null),T=u==="past-right";i.useEffect(()=>{const s=W.current;if(!s)return;const n=new ResizeObserver(p=>{const h=p[0]?.contentRect;h&&B(f=>f&&Math.abs(f.w-h.width)<2&&Math.abs(f.h-h.height)<2?f:{w:h.width,h:h.height})});return n.observe(s),()=>n.disconnect()},[]);const re=i.useCallback(()=>{b(s=>{const n=s==="past-left"?"past-right":"past-left";try{localStorage.setItem(Oe,n)}catch{}return n})},[]),y=i.useCallback(s=>{m(s),s===null&&_(null)},[]),Re=i.useCallback((s,n)=>{_(n===null?null:{laneId:s,slot:n})},[]),G=i.useCallback(s=>{r===s.id?a(s):d(s.id)},[r,a]),Te=i.useCallback(()=>{O(1),R({x:0,y:0})},[]),Pe=i.useCallback(s=>{if(!(s.target instanceof Element?s.target:null)?.closest(".agent-floor__trace-panel, .agent-floor__zoom")){if(s.preventDefault(),s.metaKey||s.ctrlKey){O(p=>pe(p-s.deltaY*.002));return}R(p=>({x:se(p.x-s.deltaX,ve),y:se(p.y-s.deltaY,Se)}))}},[]),Ie=i.useCallback(s=>{const n=s.target instanceof Element?s.target:null;s.button!==0||n?.closest("button, .agent-floor__trace-panel")||(k.current={pointerId:s.pointerId,startX:s.clientX,startY:s.clientY,panX:$.x,panY:$.y},s.currentTarget.setPointerCapture(s.pointerId),Y(!0))},[$]),ze=i.useCallback(s=>{const n=k.current;!n||n.pointerId!==s.pointerId||R({x:se(n.panX+s.clientX-n.startX,ve),y:se(n.panY+s.clientY-n.startY,Se)})},[]),ge=i.useCallback(s=>{k.current?.pointerId===s.pointerId&&(k.current=null,s.currentTarget.hasPointerCapture(s.pointerId)&&s.currentTarget.releasePointerCapture(s.pointerId),Y(!1))},[]);i.useEffect(()=>{if(r===null)return;const s=n=>{n.key==="Escape"&&d(null)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[r]);const V=Math.floor(o/z)*z,q=i.useMemo(()=>{const s=new Map(t.map(f=>[f.id,f])),n=K.flatMap(f=>{const te=s.get(f);return te?[te]:[]}),p=new Set(n.map(f=>f.id)),h=t.filter(f=>!p.has(f.id)).sort((f,te)=>te.lastActiveAt-f.lastActiveAt);return n.concat(h)},[t,K]);i.useEffect(()=>{const s=q.map(n=>n.id);le(n=>n.length===s.length&&n.every((p,h)=>p===s[h])?n:s);try{sessionStorage.setItem(Ee,JSON.stringify(s))}catch{}},[q]);const{series:U,hidden:J,planeW:E,planeD:Q,lanesStartY:_e}=i.useMemo(()=>{const s=q.map(f=>lt(f,V)),n=s.slice(0,be),p=n.length*I,h=Math.max(et,p+Qe*2);return{series:n,hidden:s.slice(be),planeW:Je+Z*D+M,planeD:h,lanesStartY:(h-p)/2}},[q,V]),v=i.useMemo(()=>U.concat(J),[U,J]),ie=v.filter(s=>s.live).length,A=g??r,De=A===null?null:v.find(s=>s.lane.id===A)??null,ee=r===null?null:v.find(s=>s.lane.id===r)??null;i.useEffect(()=>{r!==null&&!v.some(s=>s.lane.id===r)&&d(null)},[v,r]),i.useEffect(()=>{j(!1)},[r]),i.useEffect(()=>{if(!l)return;const s=v.map(n=>{const p=Ce(n,o);return{id:n.lane.id,label:X(n.lane.agent,n.lane.source),statusLabel:n.lane.agent.harness?.trim()||"lane",tone:Ze(n.lane.agent.state,n.lane.agent),updatedAt:n.lane.lastActiveAt>0?n.lane.lastActiveAt:void 0,floor:{live:n.live,harness:n.lane.agent.harness,actionGlyph:p.glyph,actionLabel:p.label,actionMeta:p.meta,strip:n.strip,countsLabel:oe(n.counts)}}});Ve(s)},[l,v,o]),i.useEffect(()=>{if(l)return je({onHover:y,onSelect:s=>{const n=v.find(p=>p.lane.id===s);n&&G(n.lane)}}),()=>je(null)},[l,v,y,G]),i.useEffect(()=>{if(l)return Ne(A),()=>Ne(null)},[l,A]);const he=s=>T?M+s*D:E-M-s*D,xe=_e+U.length*I+26,Xe=i.useMemo(()=>{if(!N)return 1;const s=E+Q,n=.708*s+60,p=.386*s+250,h=Math.min(N.w/n,N.h/p);return Math.round(Math.min(1.6,Math.max(.7,h))*100)/100},[N,E,Q]),Ye=Math.round(Xe*S*100)/100;return e.jsxs("div",{className:`agent-floor${l?" is-rail-ledger":""}`,"data-live-count":ie,"data-floor-orient":u,children:[e.jsxs("div",{className:"agent-floor__body",children:[l?null:e.jsxs("aside",{className:"agent-floor__ledger","aria-label":"Fleet ledger",children:[e.jsxs("header",{className:"agent-floor__ledger-head",children:[e.jsx("span",{className:"agent-floor__ledger-title",children:"fleet"}),e.jsxs("span",{className:"agent-floor__ledger-meta",children:[v.length," lane",v.length===1?"":"s"," · ",ie," live"]}),e.jsx("span",{className:"agent-floor__ledger-trace",children:"trace 30m"})]}),e.jsx("div",{className:"agent-floor__ledger-rows",children:v.map(s=>{const n=s.lane.agent,p=ue(n);return e.jsxs("button",{type:"button",className:`agent-floor__ledger-row${A===s.lane.id?" is-focus":""}`,onClick:()=>G(s.lane),onMouseEnter:()=>y(s.lane.id),onMouseLeave:()=>y(null),children:[e.jsxs("span",{className:"agent-floor__ledger-id",children:[e.jsx(fe,{name:n.name,size:18,tile:!0,hue:p.hue,tone:p.tone}),e.jsx("span",{className:"agent-floor__ledger-name",children:X(n,s.lane.source)}),e.jsx(Me,{harness:n.harness,size:11,className:"agent-floor__card-mark"}),e.jsx("span",{className:`agent-floor__card-dot${s.live?" is-live":""}`})]}),e.jsxs("span",{className:"agent-floor__ledger-tally",children:[e.jsx("span",{className:"agent-floor__ledger-strip",children:s.strip.map((h,f)=>e.jsx("span",{className:`agent-floor__ledger-cell is-${h}`},f))}),e.jsx("span",{className:"agent-floor__ledger-counts",children:oe(s.counts)})]})]},s.lane.id)})}),e.jsx("footer",{className:"agent-floor__ledger-foot",children:"rows and flags are linked — hover to unroll, click to pin"})]}),e.jsxs("div",{className:`agent-floor__viewport${ee?" is-inspecting":""}${H?" is-dragging":""}`,ref:W,onWheel:Pe,onPointerDown:Ie,onPointerMove:ze,onPointerUp:ge,onPointerCancel:ge,children:[e.jsx(gt,{zoom:S,fit:S===1&&$.x===0&&$.y===0,onZoomChange:O,onReset:Te}),e.jsx("div",{className:"agent-floor__stage",style:{transform:`translate3d(${$.x}px, ${$.y}px, 0) scale(${Ye}) rotateX(57deg) rotateZ(45deg)`},children:e.jsxs("div",{className:"agent-floor__field",style:{width:E,height:Q,left:-E/2,top:-Q/2},children:[e.jsx("div",{className:"agent-floor__plane"}),Array.from({length:Z+1},(s,n)=>e.jsx("div",{className:`agent-floor__seam${n===0?" is-front":""}`,style:{left:he(n)}},n)),Array.from({length:Z+1},(s,n)=>e.jsx("div",{className:`agent-floor__bb agent-floor__tick${n===0?" is-now":""}`,style:{left:he(n),top:xe},children:n===0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"agent-floor__tick-pulse"}),e.jsx("span",{children:"now"})]}):ae(V-(n-1)*z)},n)),e.jsx("div",{className:"agent-floor__lanes",style:{left:0,top:_e},"data-focus":A!==null||void 0,children:U.map((s,n)=>e.jsx(mt,{series:s,index:n,planeW:E,flip:T,periodStart:V,now:o,focused:A===s.lane.id,pinned:r===s.lane.id,dimmed:r===null&&g!==null&&g!==s.lane.id,peekSlot:w?.laneId===s.lane.id?w.slot:null,onFocus:y,onPeek:Re,onSelect:G},s.lane.id))}),J.length>0?e.jsxs("div",{className:"agent-floor__bb agent-floor__chip",style:{left:T?M/2:E-M/2,top:xe+30},children:["+",J.length," more in the ledger"]}):null]})}),ee?e.jsx(ft,{series:ee,now:o,concise:x,onConciseChange:j,onClose:()=>d(null),onOpenFull:()=>a(ee.lane),operatorName:c}):null]})]}),e.jsx(ut,{focus:De,pinned:r!==null&&A===r,ledger:v,liveCount:ie,now:o}),e.jsxs("footer",{className:"agent-floor__legend",children:[e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-swatch is-tool"}),"tool call"]}),e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-swatch is-edit"}),"file edit"]}),e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-swatch is-msg"}),"message"]}),e.jsxs("span",{className:"agent-floor__legend-item",children:[e.jsx("span",{className:"agent-floor__legend-pulse"}),"live — pad glows"]}),e.jsxs("button",{type:"button",className:"agent-floor__legend-flip",onClick:re,title:"Flip which side history accumulates on",children:["past ",T?"→":"←"]}),e.jsx("span",{className:"agent-floor__legend-note",children:"Towers mint every 5 min · details land in the dock · click to pin, click again for the timeline"})]})]})}export{Ms as AgentFloorView};
@@ -1 +0,0 @@
1
- import{r as u,j as a}from"./index-DvLtl7rV.js";/* empty css */import{c as J,d as X,s as Y,b as Z}from"./colors-BtO5_zlx.js";import{m as ee,c as ae}from"./conversation-model-Dc02NsGp.js";import{a as U}from"./api-Co9aQ2Jw.js";import{u as se}from"./sse-CD9MMUxl.js";import{b as te,t as le}from"./time-Dhsh_2EG.js";import{f as m}from"./text-BP3oyl8-.js";import{u as oe}from"./Provider-CtXJeLrP.js";import{o as re}from"./openContent-C6XO6kr5.js";import{B as L}from"./BackToPicker-CXZjBRAe.js";import{A as ie}from"./AgentLiveActions-DrEJDJef.js";import{O as ne}from"./ObservedTopologyPanel-BJUhDSuQ.js";import{a as ce}from"./NewChatComposer-_Stj0fZy.js";import"./createLucideIcon-DezKXSG2.js";import"./perf-PX8Rx0EP.js";import"./index-BWHgHrtv.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./router-B9vQkNJL.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./keyboard-nav-BLYDhL3Z.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./terminal-takeover-_Jyys4me.js";import"./eye-BRyD0jno.js";import"./terminal-9GRS_Qdc.js";import"./index-zvhpRHao.js";import"./HarnessMark-B979GCSB.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";function A({values:s}){return a.jsx("span",{className:"s-agent-token-list",children:s.map(t=>a.jsx("span",{className:"s-agent-token",children:t},t))})}function o({value:s}){return a.jsx("span",{className:"s-agent-code-value",children:s})}function I({label:s,value:t}){return t?.trim()?a.jsxs("span",{className:"s-agent-profile-chip",children:[a.jsx("span",{className:"s-agent-profile-chip-label",children:s}),a.jsx("span",{className:"s-agent-profile-chip-value",children:t})]}):null}function T(s){return(s??"").toLowerCase().replace(/[^a-z0-9]+/g,"")}function de(s){return s.trim().replace(/^@+/,"").replace(/^(project|agent|session)[-_.:\s]+/iu,"").split(/[-_\s·]+/u).filter(Boolean).map(t=>t.slice(0,1).toUpperCase()+t.slice(1)).join(" ")}function ue(s,t,i,n){let l=s.trim().replace(/^@+/,"");const h=[t,i,n,n?m(n):null].filter(p=>!!p?.trim());for(const p of h){const f=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");l=l.replace(new RegExp(`^${f}[-_.:\\s·]+`,"iu"),"")}return l}function pe(s,t,i,n){const l=t?.participants?.find(d=>d.agentId===s.id||d.actorId===s.id),h=T(s.harness),p=T(i),f=[l?.scopedAlias,t?.alias,s.handle,l?.displayName,t?.agentName,s.name];for(const d of f){if(!d?.trim())continue;const v=ue(d,i,n,s.harness),N=de(v),g=T(N);if(!(!g||g===p||g===h))return N}return null}function me(s){const t=s?.trim();return t?t.toLowerCase()==="a2a"?"A2A":m(t)??t:null}function he({name:s,url:t}){return t?a.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:s}):a.jsx(a.Fragment,{children:s})}function j({title:s,subtitle:t,items:i,variant:n}){return i.length===0?null:a.jsxs("section",{className:`s-agent-profile-card${n?` s-agent-profile-card-${n}`:""}`,children:[a.jsx("div",{className:"s-agent-profile-card-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"s-agent-profile-card-title",children:s}),t&&a.jsx("div",{className:"s-agent-profile-card-subtitle",children:t})]})}),a.jsx("div",{className:"s-agent-meta-card-body",children:i.map(l=>a.jsxs("div",{className:"s-agent-meta-row",children:[a.jsx("span",{className:"s-agent-meta-label",children:l.label}),a.jsx("span",{className:"s-agent-meta-value",children:l.value})]},l.label))})]})}function oa({conversationId:s,navigate:t}){const{agents:i,route:n}=oe(),[l,h]=u.useState(null),[p,f]=u.useState(!1),[d,v]=u.useState(null),[N,g]=u.useState(null),[y,B]=u.useState(null),S=u.useCallback(async()=>{B(null);try{const r=await U(`/api/session/${encodeURIComponent(s)}`).catch(()=>null);h(r)}catch(r){B(r instanceof Error?r.message:String(r)),h(null)}finally{f(!0)}},[s]);u.useEffect(()=>{f(!1),S()},[S]),se(()=>{S()});const c=l?.agentId??null;u.useEffect(()=>{if(!c||i.some(R=>R.id===c)){v(null);return}let r=!1;return U(`/api/agents/${encodeURIComponent(c)}`).then(R=>{r||v(R)}).catch(()=>{r||v(null)}).finally(()=>{r||g(c)}),()=>{r=!0}},[i,c]);const e=u.useMemo(()=>c?i.find(r=>r.id===c)??(d?.id===c?d:null):null,[d,i,c]);if(!e)return!p||c!==null&&N!==c?a.jsxs("div",{children:[a.jsx(L,{slot:"agent-info",fallback:{view:"conversation",conversationId:s},navigate:t}),a.jsx("div",{className:"s-empty",children:a.jsx("p",{children:"Loading…"})})]}):a.jsxs("div",{children:[a.jsx(L,{slot:"agent-info",fallback:{view:"conversation",conversationId:s},navigate:t}),y&&a.jsx("p",{className:"s-error",children:y}),a.jsx("div",{className:"s-empty",children:a.jsx("p",{children:"Agent not found"})})]});const W=ee(e),C=e.handle?`@${e.handle.replace(/^@+/,"")}`:null,P=e.selector??e.defaultSelector??C,D=J(e.state),E=e.authorityNodeName?`${e.authorityNodeName} (${e.authorityNodeId??"unknown"})`:e.authorityNodeId,H=e.homeNodeName?`${e.homeNodeName} (${e.homeNodeId??"unknown"})`:e.homeNodeId,$=e.skills??[],b=me(e.protocol),k=!!(e.providerName||b||$.length>0),F=ce(e),x=F.title,w=pe(e,l,x,F.slug),z=w?`${x} · ${w}`:x,M=l?.participants?.find(r=>r.agentId===e.id||r.actorId===e.id),O=e.model&&e.harness&&e.model.startsWith(`${e.harness}-`)?e.model.slice(e.harness.length+1):e.model,Q=[m(e.harness??"")??e.harness,O].filter(r=>!!r).join(" · "),_=[{label:"Project",value:x},{label:"Alias",value:w??"Default project participant"},...P?[{label:"Primary selector",value:a.jsx(o,{value:P})}]:[],...M?.scopedAlias?[{label:"Scoped alias",value:a.jsx(o,{value:M.scopedAlias})}]:[],...C?[{label:"Handle",value:a.jsx(o,{value:C})}]:[],...e.defaultSelector&&e.defaultSelector!==e.selector?[{label:"Default selector",value:a.jsx(o,{value:e.defaultSelector})}]:[],{label:"Definition",value:a.jsx(o,{value:e.definitionId})}],q=[{label:"Routable agent ID",value:a.jsx(o,{value:e.id})},...e.providerName?[{label:"Provider",value:a.jsx(he,{name:e.providerName,url:e.providerUrl})}]:[],...b?[{label:"Protocol",value:b}]:[],...$.length>0?[{label:"Skills",value:a.jsx(A,{values:$})}]:[],...k?[]:[{label:"Class",value:m(e.agentClass)??"—"}],...!k&&e.role?[{label:"Role",value:m(e.role)??e.role}]:[],...e.authorityProfile?[{label:"Authority profile",value:a.jsx(o,{value:e.authorityProfile.roleId})}]:[],...e.workspaceQualifier?[{label:"Workspace qualifier",value:a.jsx(o,{value:e.workspaceQualifier})}]:[],...e.nodeQualifier?[{label:"Node qualifier",value:a.jsx(o,{value:e.nodeQualifier})}]:[],...e.staleLocalRegistration?[{label:"Registration",value:e.replacedByAgentId?`Superseded by ${e.replacedByAgentId}`:"Historical registration"}]:[],...e.retiredFromFleet?[{label:"Fleet state",value:"Retired"}]:[]],K=[...e.projectRoot?[{label:"Project path",value:a.jsx(o,{value:e.projectRoot})}]:[],...e.cwd?[{label:"Working dir",value:a.jsx(o,{value:e.cwd})}]:[],...e.branch?[{label:"Branch",value:e.branch}]:[],...E?[{label:"Authority node",value:a.jsx(o,{value:E})}]:[],...H?[{label:"Home node",value:a.jsx(o,{value:H})}]:[],...e.ownerId?[{label:"Owner",value:e.ownerName?`${e.ownerName} (${e.ownerId})`:e.ownerId}]:[],...e.conversationId?[{label:"Direct conversation",value:a.jsx(o,{value:e.conversationId})}]:[]],V=[...!k&&e.harness?[{label:"Harness",value:e.harness}]:[],...e.model?[{label:"Model",value:e.model}]:[],...!k&&e.transport?[{label:"Transport",value:m(e.transport)??e.transport}]:[],...e.wakePolicy?[{label:"Wake policy",value:m(e.wakePolicy)??e.wakePolicy}]:[],...e.harnessSessionId?[{label:b?`${b} session`:"Harness session",value:a.jsx(o,{value:e.harnessSessionId})}]:[],...e.harnessLogPath?[{label:"Harness log",value:a.jsx(o,{value:e.harnessLogPath})}]:[],...e.capabilities.length>0?[{label:"Capabilities",value:a.jsx(A,{values:e.capabilities})}]:[],...e.authorityProfile?.readTools.length?[{label:"Broker reads",value:a.jsx(A,{values:e.authorityProfile.readTools})}]:[],...e.authorityProfile?.writeTools.length?[{label:"Broker writes",value:a.jsx(A,{values:e.authorityProfile.writeTools})}]:[],...e.authorityProfile?[{label:"Machine access",value:`shell ${e.authorityProfile.shell?"allowed":"blocked"} · code writes ${e.authorityProfile.codebaseWrites?"allowed":"blocked"}`}]:[],...e.runtimePolicy?.sandbox?[{label:"Sandbox",value:e.runtimePolicy.sandbox}]:[]],G=[{label:"Conversation ID",value:a.jsx(o,{value:s})},...l?.alias?[{label:"Conversation alias",value:a.jsx(o,{value:l.alias})}]:[],...l?.naturalKey?[{label:"Natural key",value:a.jsx(o,{value:l.naturalKey})}]:[],...l?.workspaceRoot?[{label:"Workspace",value:a.jsx(o,{value:l.workspaceRoot})}]:[],...l?.currentBranch?[{label:"Session branch",value:l.currentBranch}]:[],...l?.messageCount!=null?[{label:"Messages",value:String(l.messageCount)}]:[],...l?.lastMessageAt?[{label:"Last message",value:te(l.lastMessageAt)}]:[]];return a.jsxs("div",{className:"s-agent-profile-page",children:[a.jsxs("div",{className:"s-agent-profile-page-topbar",children:[a.jsx(L,{slot:"agent-info",fallback:{view:"conversation",conversationId:s},navigate:t}),a.jsx("button",{type:"button",className:"s-btn",onClick:()=>t({view:"agents-v2",agentId:e.id}),children:"Open in Agents"})]}),y&&a.jsx("p",{className:"s-error",children:y}),a.jsxs("section",{className:"s-agent-profile-hero",children:[a.jsx("div",{className:"s-agent-profile-hero-main",children:a.jsxs("div",{className:"s-agent-profile-hero-title-row",children:[a.jsx("div",{className:"s-avatar s-agent-profile-hero-avatar",style:{background:X(e.name)},children:e.name[0].toUpperCase()}),a.jsxs("div",{className:"s-agent-profile-hero-copy",children:[a.jsxs("div",{className:"s-agent-casefile-title-meta",children:[a.jsx("span",{className:"s-agent-casefile-record",children:P??W??ae(e.id)??e.id}),D&&a.jsxs("span",{className:`s-agent-state-chip s-agent-state-chip-${Z(e.state)}`,children:[a.jsx("span",{className:"s-dot",style:{background:Y(e.state)}}),D]}),e.staleLocalRegistration&&a.jsx("span",{className:"s-agent-state-chip s-agent-state-chip-offline",children:"Superseded registration"})]}),a.jsx("h1",{className:"s-agent-profile-hero-title",children:z}),a.jsxs("div",{className:"s-agent-profile-hero-tags",children:[a.jsx(I,{label:"Project",value:x}),a.jsx(I,{label:"Alias",value:w??"Default"}),a.jsx(I,{label:"Runtime",value:Q||null}),a.jsx(I,{label:"Host",value:e.homeNodeName?.replace(/\.local$/i,"")??null})]}),a.jsxs("p",{className:"s-agent-profile-hero-context",children:[l?.title?`Conversation: ${l.title}.`:"Attached to this conversation.",e.updatedAt?` Updated ${le(e.updatedAt)}.`:""]})]})]})}),a.jsxs("div",{className:"s-agent-profile-hero-actions",children:[a.jsx(ie,{agent:e,navigate:t,returnTo:n}),a.jsx("button",{type:"button",className:"s-btn s-btn-primary",onClick:()=>re(t,{view:"conversation",conversationId:s},{returnTo:n}),children:"Open conversation"})]})]}),a.jsxs("div",{className:"s-agent-profile-grid",children:[a.jsx(j,{title:"Stable alias",subtitle:"Repeatable project identity used to route future work.",items:_,variant:"primary"}),a.jsx(j,{title:"Current conversation",subtitle:"Unique DM/context attached to this page.",items:G}),a.jsx(j,{title:"Runtime instance",subtitle:"Concrete harness state for the current attachment.",items:V}),a.jsx(j,{title:"Location",subtitle:"Where this alias resolves right now.",items:K}),a.jsx(j,{title:"Diagnostics",subtitle:"Broker and provider fields for debugging.",items:q,variant:"secondary"})]}),a.jsx(ne,{title:"Observed harness families",size:"compact",maxAgents:8,maxTasks:4,showEmpty:!0})]})}export{oa as AgentInfoScreen};
@@ -1 +0,0 @@
1
- import{r as t,j as m}from"./index-DvLtl7rV.js";import{u as a}from"./Provider-CtXJeLrP.js";import{A as n}from"./AgentLanesView-CetZZDyF.js";import{i as c,j as l}from"./router-B9vQkNJL.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./time-Dhsh_2EG.js";import"./index-zvhpRHao.js";import"./HarnessMark-B979GCSB.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";/* empty css */import"./tail-events-Ps8KpKah.js";import"./observe-BpEm1INu.js";import"./terminal-sessions-BQ6t92tJ.js";import"./types-B0PlfpKc.js";import"./AgentAvatar-6-KBVKUu.js";import"./SpriteAvatar-z5hHesx9.js";import"./CrewAvatar-BwXjyg8N.js";import"./SessionObserve-dQDN23pP.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-HByf2ndx.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-DG6OQrsc.js";import"./AgentDetailCard-C9rn3Fj5.js";import"./AgentLiveActions-DrEJDJef.js";import"./terminal-takeover-_Jyys4me.js";import"./openContent-C6XO6kr5.js";import"./eye-BRyD0jno.js";import"./terminal-9GRS_Qdc.js";import"./message-markup-C2LQDm_k.js";import"./ObservedTopologyPanel-BJUhDSuQ.js";import"./ObserveTextFlow-ZQWwrK3i.js";import"./use-reduced-motion-x8pJMVrG.js";import"./proxy-BiW5suC7.js";import"./SessionObserveEvidence-BRBGKAgd.js";import"./message-circle-mZCv8tvB.js";import"./wrench-DjkoAOQt.js";import"./external-link-Dp_a2vRZ.js";import"./AgentFloorView-YT-Jjccf.js";/* empty css */import"./agent-lanes-model-DXqjs0OK.js";import"./context-budget-DX_fwUs3.js";import"./lane-roster-store-DOdI1O13.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./AgentLanesPreflight-q20mTjms.js";import"./AgentLaneChrome-D8bARHMx.js";import"./AgentLaneCard-DI2iW9zO.js";/* empty css */import"./AgentLaneSummaryResize-CEBjmPTa.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-CNZMPkhc.js";import"./agent-lane-preview-BhplDYGf.js";import"./agent-lane-detail-ppJId6Jc.js";import"./AgentLaneDetailSheet-52un7dKC.js";import"./SlidePanel-B9ugxWgA.js";import"./LaneTraceDetailSheet-BUgHz-sd.js";import"./LaneTraceEventFocus-DM-hoPxG.js";function p(r){return new URLSearchParams(window.location.search).get(r)?.trim()||null}function Hr(){const{agents:r,navigate:o}=a(),e=t.useMemo(()=>c(),[]),s=t.useMemo(()=>l(),[]),i=t.useMemo(()=>({harnessFilter:p("harness"),projectFilter:p("project")}),[]);return m.jsx("div",{className:"s-agent-lanes-embed","data-scout-theme":!0,children:m.jsx(n,{navigate:o,agents:r,embedded:!0,profileId:e,laneSize:s,harnessFilter:i.harnessFilter,projectFilter:i.projectFilter})})}export{Hr as AgentLanesEmbedScreen};
@@ -1,2 +0,0 @@
1
- import{r as a,j as o}from"./index-DvLtl7rV.js";/* empty css */import{a as rn}from"./api-Co9aQ2Jw.js";import{u as Fn}from"./tail-events-Ps8KpKah.js";import{i as _e,o as on}from"./surface-activity-B1rgWB1i.js";import{u as Wn}from"./observe-BpEm1INu.js";import{f as Hn}from"./terminal-sessions-BQ6t92tJ.js";import{n as ln}from"./colors-BtO5_zlx.js";import{S as Bn}from"./Provider-CtXJeLrP.js";import{d as Vn}from"./types-B0PlfpKc.js";import{A as Gn}from"./AgentAvatar-6-KBVKUu.js";import{h as Kn,S as Un}from"./SessionObserve-dQDN23pP.js";import{W as qn,X as cn,Y as Yn,Z as Zn,_ as Xn,$ as Xe,a0 as Jn,a1 as Qn,a2 as et,a3 as nt,a4 as tt,a5 as Ce,a6 as st,a7 as at,a8 as rt,a9 as dn,aa as ot,ab as it,i as un,j as fn}from"./router-B9vQkNJL.js";import{AgentFloorView as lt}from"./AgentFloorView-YT-Jjccf.js";import{u as ct,s as dt,A as ut,a as ft,L as mt}from"./AgentLanesPreflight-q20mTjms.js";import{AgentLaneChrome as ht}from"./AgentLaneChrome-D8bARHMx.js";import{AgentLaneCard as gt}from"./AgentLaneCard-DI2iW9zO.js";import{a as pt}from"./agent-lane-card-model-CNZMPkhc.js";import{c as Lt}from"./agent-lane-detail-ppJId6Jc.js";import{i as yt,A as bt}from"./AgentLaneDetailSheet-52un7dKC.js";import{LaneTraceDetailSheet as vt}from"./LaneTraceDetailSheet-BUgHz-sd.js";import{readStoredLaneSummaryHeight as St,useLaneSummaryResize as kt,AgentLaneSummaryResizeHandle as xt}from"./AgentLaneSummaryResize-CEBjmPTa.js";import{A as ge,l as Z,j as Et,k as mn,m as Nt,e as wt,g as Rt,n as jt,r as Ct,d as hn,D as It,h as At,i as Tt}from"./agent-lanes-model-DXqjs0OK.js";import{i as _t,c as Pt,n as Je}from"./keyboard-nav-BLYDhL3Z.js";import{p as Qe}from"./lane-roster-store-DOdI1O13.js";function Pe(e){return[e.source,e.sessionId,e.ts,e.kind,e.summary].join("\0")}function Dt(e){const n=new Set,t=[];for(const s of e){const i=Pe(s);n.has(i)||(n.add(i),t.push(s))}return t}function Mt(e,n){return e.length<=n?e:[...e].sort((t,s)=>t.ts-s.ts).slice(e.length-n)}function zt(e,n,t){const s=Pe(n);for(const l of e)if(Pe(l)===s)return e;const i=[...e,n];return i.length>t?i.slice(i.length-t):i}function Ot(e,n,t){return Mt(Dt([...n,...e]),t)}const $t=500;function Ie(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):null}function Ft(e){return JSON.stringify([Ie(e.recentLimit),e.includeTranscriptReplay,Ie(e.recentWindowMs),e.discoveryScope??null,Ie(e.discoveryLimit)])}function Wt(e,n){return e==="error"||n==="error"}function Ht(e,n){return n?Math.min(e,$t):e}async function Bt(e){const n=await e.load(!1);if(e.publish(n,"live"),e.markReady(),!e.includeTranscriptReplay)return{replay:"not-requested"};try{return e.publish(await e.load(!0),"replay"),{replay:"loaded"}}catch{return{replay:"failed"}}}function Vt(e){return e.discovery==="error"||e.recent==="error"?e.discoveryLoaded&&e.recentLoaded?"degraded":"blank":"none"}const Gt=500,Kt=6e4;function Ut(){return{generatedAt:Date.now(),processes:[],transcripts:[],totals:{total:0,scoutManaged:0,hudsonManaged:0,unattributed:0,transcripts:0}}}async function qt(e,n,t){const s=new URLSearchParams({limit:String(e)});return n&&s.set("transcripts","true"),typeof t=="number"&&Number.isFinite(t)&&t>0&&s.set("windowMs",String(Math.floor(t))),(await rn(`/api/tail/recent?${s.toString()}`)).events??[]}function Yt(e,n){const t=new URLSearchParams;e&&t.set("scope",e),typeof n=="number"&&Number.isFinite(n)&&n>0&&t.set("limit",String(Math.floor(n)));const s=t.toString();return s?`/api/tail/discover?${s}`:"/api/tail/discover"}function Zt(e){const n=e?.recentLimit??Gt,t=e?.enabled??!0,s=e?.discoveryIntervalMs??Kt,i=e?.includeTranscriptReplay??!1,l=e?.discoveryScope,f=e?.discoveryLimit,y=e?.recentWindowMs,u=e?.pauseWhenHidden??!1,d=Ft({recentLimit:n,includeTranscriptReplay:i,recentWindowMs:y,discoveryScope:l,discoveryLimit:f}),[m,c]=a.useState(null),[p,L]=a.useState([]),[R,b]=a.useState({discovery:"loading",recent:"loading",discoveryLoaded:!1,recentLoaded:!1}),I=a.useRef("loading"),h=a.useRef("idle"),A=a.useRef(null),x=a.useRef(null),j=a.useRef(0);Fn(S=>{L(k=>zt(k,S,n))},t);const v=a.useCallback((S=!1)=>{if(!t||u&&!S&&!_e())return Promise.resolve();S&&(I.current="loading",b(w=>({...w,recent:"loading"})));const k=d,T=x.current;if(T?.key===k)return T.promise;const M=++j.current;h.current=i?"loading":"ready";let z;return z=Bt({includeTranscriptReplay:i,load:w=>qt(w?n:Ht(n,i),w,y),publish:(w,F)=>{if(M!==j.current)return;const B=()=>{L(W=>Ot(W,w,n))};F==="replay"?a.startTransition(B):B()},markReady:()=>{M===j.current&&(I.current="ready",b(w=>({...w,recent:"ready",recentLoaded:!0})))}}).then(w=>{M===j.current&&(i&&(h.current=w.replay==="failed"?"error":"ready"),w.replay!=="failed"&&(A.current=d))}).catch(()=>{M===j.current&&(I.current="error",i&&(h.current="error"),b(w=>({...w,recent:"error"})))}).finally(()=>{x.current?.promise===z&&(x.current=null)}),x.current={key:k,promise:z},z},[t,d,i,u,n,y]),D=a.useCallback(async(S=!1)=>{if(t&&!(u&&!S&&!_e())){S&&b(k=>({...k,discovery:"loading"}));try{const k=await rn(Yt(l,f));c(k),b(T=>({...T,discovery:"ready",discoveryLoaded:!0})),Wt(I.current,h.current)&&v()}catch{c(k=>k??Ut()),b(k=>({...k,discovery:"error"}))}}},[f,l,t,u,v]),C=a.useCallback(async()=>{await Promise.all([D(!0),v(!0)])},[D,v]);return a.useEffect(()=>{if(!t)return;let S=!1,k=!0;const T=()=>{S||D(k),k=!1};T();const M=setInterval(T,s),z=u?on(T):null;return()=>{S=!0,clearInterval(M),z?.()}},[s,t,u,D]),a.useEffect(()=>{t||(j.current+=1,x.current=null,A.current=null,h.current="idle")},[t]),a.useEffect(()=>{t&&A.current!==d&&v(!0)},[t,d,v]),{discovery:m,events:p,loadState:R,refreshDiscovery:D,retryInitialLoad:C}}function Xt({lanes:e,inspectedLaneId:n,onInspect:t,onHorizonChange:s,onTogglePin:i}){const[l,f]=a.useState(-1),y=a.useRef(new Map);a.useEffect(()=>{if(l<0)return;if(l>=e.length){f(e.length-1);return}const m=e[l];if(!m)return;const c=y.current.get(m.id);c?.scrollIntoView({block:"nearest",inline:"nearest"}),c?.focus()},[l,e]),a.useEffect(()=>{n||l>=e.length&&f(e.length>0?e.length-1:-1)},[l,n,e.length]);const u=a.useCallback((m,c)=>{c?y.current.set(m,c):y.current.delete(m)},[]);a.useEffect(()=>{const m=c=>{if(!document.querySelector(".s-agent-lanes")||_t(c.target)||Pt()||n||e.length===0)return;const p=Number(c.key)-1;if(!c.metaKey&&!c.ctrlKey&&!c.altKey&&p>=0&&p<ge.length){c.preventDefault(),s(ge[p].key);return}if(c.key==="ArrowDown"||c.key==="j"){c.preventDefault(),f(L=>Je(L,e.length,1));return}if(c.key==="ArrowUp"||c.key==="k"){c.preventDefault(),f(L=>Je(L,e.length,-1));return}if(c.key==="Home"||c.key==="g"&&!c.shiftKey){c.preventDefault(),f(0);return}if(c.key==="End"||c.key==="G"){c.preventDefault(),f(e.length-1);return}if(c.key==="Enter"||c.key==="i"){const L=l<0?0:l,R=e[L];if(!R)return;c.preventDefault(),f(L),t(R);return}if(c.key.toLowerCase()==="p"&&i){const L=l<0?0:l,R=e[L];if(!R)return;c.preventDefault(),f(L),i(R)}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[l,n,e,s,t,i]);const d=a.useCallback((m,c)=>({"data-cursor":l===m?!0:void 0,tabIndex:l===m?0:-1,ref:p=>u(c,p),onFocus:()=>f(m)}),[l,u]);return{focusedIndex:l,getLaneFocusProps:d}}function Jt(e){return e.trim().replace(/\/+$/u,"").split(/[\\/]/u).filter(Boolean).pop()?.trim()||null}function he(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function gn(e,n){if(!n)return!0;const t=he(n);return e.some(s=>{const i=s?.trim();if(!i)return!1;const l=i.toLowerCase(),f=Jt(i);return l===n||he(i)===t||!!(f&&(f.toLowerCase()===n||he(f)===t))})}function Qt(e,n){const t=n?.trim().toLowerCase()||null,{agent:s,facts:i,source:l}=e;return gn([s.harness,s.definitionId,i?.attribution,l],t)}function es(e,n){const t=n?.trim().toLowerCase()||null,{agent:s,facts:i,source:l}=e;return gn([s.project,s.projectRoot,s.cwd,i?.cwd,Z(s,l)],t)}function ns(e){return ln(e.agent.state??null,e.agent)==="needs_attention"?!0:Kn(e.observe?.events??[])}function en(e,n,t,s){return cn(t?.width??e.laneWidths[n.id],s??e.defaultLaneWidth)}function ts(e,n){switch(e.kind){case"session":return n.filter(t=>t.id===e.sessionId);case"harness":return n.filter(t=>Qt(t,e.harness));case"project":return n.filter(t=>es(t,e.projectPath));case"attention":return n.filter(t=>ns(t));default:return[]}}function nn(e,n,t){n.has(t.lane.id)||(n.add(t.lane.id),e.push({key:t.slot?`${t.slot.id}:${t.lane.id}`:t.lane.id,lane:t.lane,widthPx:t.widthPx,zone:t.zone,position:t.position,slotId:t.slot?.id,laneDefId:t.laneDef?.id,isPinned:t.zone!=="main"}))}function Ae(e){return[...e].sort((n,t)=>{const s=Yn(n.zone,t.zone);return s!==0?s:n.position!==t.position?n.position-t.position:n.lane.id.localeCompare(t.lane.id)})}function ss(e){const{autoLanes:n,deck:t,defaultWidthTier:s}=e,i=new Set,l=[],f=[],y=[],u=new Map(t.laneDefs.map(p=>[p.id,p]));for(const p of qn(t.slots)){const L=u.get(p.laneDefId);if(!L)continue;const R=ts(L,n),b=p.zone==="pinned_left"?l:p.zone==="pinned_right"?y:f;for(const I of R)nn(b,i,{lane:I,zone:p.zone,position:p.position,widthPx:en(t,I,p,s),slot:p,laneDef:L})}if(t.showAutoLanes){let p=0;for(const L of n)i.has(L.id)||(nn(f,i,{lane:L,zone:"main",position:p,widthPx:en(t,L,void 0,s)}),p+=1)}const d=Ae(l),m=Ae(f),c=Ae(y);return{pinnedLeft:d,main:m,pinnedRight:c,flat:[...d,...m,...c]}}function as(e){return e.slots.some(n=>n.laneDefId===Xn)}function me(e,n){const t=`harness:${he(n)}`;return e.slots.some(s=>s.laneDefId===t)}function rs(e,n){const t=Zn(n);return e.slots.some(s=>s.laneDefId===t)}function os(e,n,t){const[s,i]=a.useState(()=>Xe(e,n));a.useEffect(()=>{i(Xe(e,n))},[n,e]);const l=a.useCallback(h=>{Jn(h),i(h)},[]),f=a.useMemo(()=>ss({autoLanes:t,deck:s,defaultWidthTier:n}),[t,s,n]),y=a.useCallback((h,A="pinned_left")=>{l(Qn(s,{laneId:h.id,title:Z(h.agent,h.source),zone:A,width:s.laneWidths[h.id]}))},[s,l]),u=a.useCallback(h=>{l(et(s,h))},[s,l]),d=a.useCallback((h,A)=>{l(nt(s,h,A))},[s,l]),m=a.useCallback(h=>{l(tt(s,h))},[s,l]),c=a.useCallback((h,A)=>{l(Ce(s,{kind:"harness",title:A??`${h} sessions`,harness:h,zone:"pinned_left",width:s.defaultLaneWidth}))},[s,l]),p=a.useCallback((h,A)=>{const x=h.trim();if(!x)return;const j=A?.trim()||x.split(/[\\/]/u).filter(Boolean).pop()||x;l(Ce(s,{kind:"project",title:j,projectPath:x,zone:"main",width:s.defaultLaneWidth}))},[s,l]),L=a.useCallback(()=>{l(Ce(s,{kind:"attention",title:"Needs attention",zone:"pinned_left",width:"sm"}))},[s,l]),R=a.useCallback(()=>{l(st(s))},[s,l]),b=a.useCallback(h=>at(s,h),[s]),I=a.useCallback(h=>rt(s,h),[s]);return{deck:s,layout:f,pinLane:y,unpinLane:u,setLaneWidth:d,setDefaultLaneWidth:m,addHarnessLane:c,addAttentionLane:L,addProjectLane:p,clearPins:R,isPinned:b,pinnedZone:I}}function is(e){const[n,t]=a.useState(null),s=a.useRef({laneId:"",x:0,width:512}),i=a.useRef(512),l=a.useCallback((u,d,m)=>{d.preventDefault(),d.stopPropagation(),d.currentTarget.setPointerCapture(d.pointerId),s.current={laneId:u,x:d.clientX,width:m},i.current=m,t(u),document.body.classList.add("s-agent-lanes--resizing-width")},[]),f=a.useCallback(()=>{t(u=>{if(u){document.body.classList.remove("s-agent-lanes--resizing-width");const d=dn(i.current);e(s.current.laneId,d.tier??d.px)}return null})},[e]);a.useEffect(()=>{if(!n)return;const u=m=>{const c=m.clientX-s.current.x;i.current=Math.min(ot,Math.max(it,s.current.width+c));const p=document.querySelector(`[data-lane-id="${s.current.laneId}"]`);p&&p.style.setProperty("--lane-width",`${i.current}px`)},d=()=>f();return window.addEventListener("pointermove",u),window.addEventListener("pointerup",d),window.addEventListener("pointercancel",d),()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d)}},[f,n]);const y=a.useCallback((u,d)=>{e(u,d),document.querySelector(`[data-lane-id="${u}"]`)?.style.removeProperty("--lane-width")},[e]);return{beginResize:l,resetLaneWidth:y,resizingLaneId:n}}const tn=[{key:"lanes",label:"lanes"},{key:"grid",label:"grid"},{key:"floor",label:"floor"}],ls=[{key:"auto",label:"auto"},{key:"2",label:"2"},{key:"3",label:"3"},{key:"4",label:"4"}];function cs(e,n=!1){return e==="grid"?"grid":e==="floor"?n?"lanes":"floor":"lanes"}function ds(e){return e==="2"||e==="3"||e==="4"?e:"auto"}function us(e){return e?tn.filter(n=>n.key!=="floor"):tn}const pn="openscout:agent-lanes-horizon",Ln="openscout:agent-lanes-layout",yn="openscout:agent-lanes-grid-columns",bn="openscout:agent-lanes-technical-rollup",fs=`${bn}:lane:`,ms="openscout:agent-lanes-scroll",hs=96,gs=160,ps=6e4,Ls=6e4,ys=3e4,bs=3e4,vs=3e4,Ss=12e4,ks=["pinned-left","main","pinned-right"];function sn(){return!_e()}function vn(e,n){return`${ms}:${e}:${n}`}function xs(e,n){try{const t=sessionStorage.getItem(vn(e,n)),s=t?Number.parseFloat(t):0;return Number.isFinite(s)&&s>0?s:0}catch{return 0}}function Es(e,n,t){try{sessionStorage.setItem(vn(e,n),String(Math.max(0,Math.round(t))))}catch{}}function Ns(){try{const e=sessionStorage.getItem(pn);if(e&&ge.some(n=>n.key===e))return e}catch{}return It}function ws(e){try{const n=sessionStorage.getItem(Ln);return cs(n,e)}catch{}return"lanes"}function Rs(){try{return ds(sessionStorage.getItem(yn))}catch{return"auto"}}function js(){try{const e=sessionStorage.getItem(bn);if(e==="0")return!1;if(e==="1")return!0}catch{}return null}function Sn(e){return`${fs}${encodeURIComponent(e)}`}function an(e){try{const n=sessionStorage.getItem(Sn(e));if(n==="0")return!1;if(n==="1")return!0}catch{}return js()??!1}function Cs(e,n){try{sessionStorage.setItem(Sn(e),n?"1":"0")}catch{}}function Is(e,n){const t=a.useRef(new Map),s=a.useRef({}),i=a.useCallback((u,d=t.current.get(u))=>{if(!d)return;const m=s.current[u]??xs(e,u);if(m<=0)return;const c=Math.max(0,d.scrollWidth-d.clientWidth),p=Math.min(m,c);Math.abs(d.scrollLeft-p)>1&&(d.scrollLeft=p)},[e]),l=a.useCallback(()=>{for(const u of ks)i(u)},[i]);a.useLayoutEffect(()=>{l();const u=window.requestAnimationFrame(l);return()=>window.cancelAnimationFrame(u)},[e,l,n]);const f=a.useCallback((u,d)=>{if(!d){t.current.delete(u);return}t.current.set(u,d),i(u,d)},[i]);return{handleLaneScroll:a.useCallback((u,d)=>{const m=d.currentTarget.scrollLeft;s.current[u]=m,Es(e,u,m)},[e]),setLaneScrollNode:f}}function As({issue:e}){const n=e.agentNames?.length?e.agentNames.join(", "):e.agentIds?.join(", "),t=e.transcriptPaths?.join(" · "),s=[n,t].filter(Boolean).join(" · ");return o.jsxs("li",{className:"s-agent-lanes-issues-item",children:[o.jsx("span",{className:"s-agent-lanes-issues-kind",children:e.kind.replaceAll("_"," ")}),o.jsx("span",{className:"s-agent-lanes-issues-message",children:e.message}),s?o.jsx("span",{className:"s-agent-lanes-issues-detail",children:s}):null]})}function Ts({loadState:e,onRetry:n}){const t=[e.discovery==="error"?"session discovery":"",e.recent==="error"?"recent history":""].filter(Boolean).join(" and "),s=e.recent==="error"?"Recent activity could not be loaded":"Session discovery could not be completed";return o.jsx("div",{className:"s-agent-lanes-empty s-agent-lanes-empty--degraded",role:"alert",children:o.jsxs("div",{className:"s-agent-lanes-empty-card",children:[o.jsxs("div",{className:"s-agent-lanes-empty-rail","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("div",{className:"s-agent-lanes-empty-copy",children:[o.jsx("span",{className:"s-agent-lanes-empty-kicker",children:"Tail incomplete"}),o.jsx("h2",{children:s}),o.jsxs("p",{children:["Scout could not finish ",t||"the tail scan",", so this is not being treated as a quiet interval."]}),o.jsx("p",{className:"s-agent-lanes-empty-secondary",children:"Live events can still arrive while Scout retries."})]}),o.jsx("div",{className:"s-agent-lanes-empty-actions",children:o.jsx("button",{type:"button",onClick:n,children:"Retry tail scan"})})]})})}function _s({activeFilterLabel:e,horizon:n,horizonLabel:t,showAutoLanes:s,onHorizonChange:i,onAddAttentionLane:l,onAddCodexLane:f,sourceCount:y,eventCount:u,degraded:d=!1,onRetry:m}){const c=!!e,p=c?"No matching lanes":s?`No activity in the last ${t}`:"No pinned lanes",L=c?`${e} has no activity in the last ${t}.`:s?`Scout checked ${y.toLocaleString()} session source${y===1?"":"s"} and ${u.toLocaleString()} recent tail event${u===1?"":"s"}; nothing is active in this interval.`:"Automatic lanes are off, and this deck has no pinned sessions.",R=d?"The last tail refresh failed, so this reading is from the previous scan and may be behind.":s?"Scout will keep listening. New turns and tool output will appear here automatically.":"Pin a session lane or turn automatic lanes back on to populate the deck.",b=n==="5m"?"30m":n==="24h"?null:"24h";return o.jsx("div",{className:"s-agent-lanes-empty",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"s-agent-lanes-empty-card",children:[o.jsxs("div",{className:"s-agent-lanes-empty-rail","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("div",{className:"s-agent-lanes-empty-copy",children:[o.jsx("span",{className:"s-agent-lanes-empty-kicker",children:d?"Tail refresh behind":c?"Filter checked":s?"Tail scanned":"Lane deck ready"}),o.jsx("h2",{children:p}),o.jsx("p",{children:L}),o.jsx("p",{className:"s-agent-lanes-empty-secondary",children:R})]}),o.jsxs("div",{className:"s-agent-lanes-empty-actions",children:[d&&m?o.jsx("button",{type:"button",onClick:m,children:"Retry tail scan"}):null,b?o.jsxs("button",{type:"button",onClick:()=>i(b),children:["Look back ",mn(b)]}):null,o.jsx("button",{type:"button",onClick:l,children:"Show attention"}),o.jsx("button",{type:"button",onClick:f,children:"Pin Codex sessions"})]})]})})}function Ps({lane:e,widthPx:n,laneTitle:t,pinned:s,laneWidth:i,defaultWidth:l,isNew:f,nowMs:y,traceWindowMs:u,traceWindowLabel:d,summaryHeight:m,onSummaryResizeStart:c,onSummaryResizeReset:p,summaryResizing:L,onInspect:R,onTraceEventSelect:b,onTogglePin:I,onWidthChange:h,onWidthResizeStart:A,widthResizing:x,focusProps:j,operatorName:v,grid:D=!1}){const{agent:C,observe:S,source:k}=e,T=Tt(S),M=!!S,z=T?" s-agent-lane--live":"",w=f?" s-agent-lane--new":"",[F,B]=a.useState(!0),[W,V]=a.useState(()=>an(e.id)),G=a.useRef(e.id);a.useEffect(()=>{if(G.current!==e.id){G.current=e.id,V(an(e.id));return}Cs(e.id,W)},[W,e.id]);const O=j?.ref,U=j?{"data-cursor":j["data-cursor"],tabIndex:j.tabIndex,onFocus:j.onFocus}:void 0,K=()=>o.jsx("section",{className:"s-agent-lane-trace","aria-label":`${Z(C,k)} trace`,children:o.jsx("div",{className:"s-agent-lane-body",children:M?o.jsx(Un,{data:S??void 0,agentId:e.source==="scout"?C.id:void 0,sessionId:C.harnessSessionId,showRail:!1,variant:"lane",nowMs:y,traceWindowMs:u,traceWindowLabel:d,laneCollapseTechnicalEvents:W,onLaneCollapseTechnicalEventsChange:V,laneOperatorName:v,onLaneEventSelect:X=>b(e,X)}):o.jsx("div",{className:"s-agent-lane-empty",children:"Waiting for trace activity…"})})}),te=a.useMemo(()=>pt(e,{isLive:T,nowMs:y}),[e,T,y]),se=a.useMemo(K,[M,S,e.source,C.id,C.harnessSessionId,y,u,d,W,v,b,e]);return o.jsxs("article",{ref:O,"data-lane-id":e.id,className:`s-agent-lane${D?" s-agent-lane--grid":""}${z}${w}${s?" s-agent-lane--pinned":""}${j?.["data-cursor"]?" s-agent-lane--cursor":""}`,style:D?void 0:{"--lane-width":`${n}px`},...U,children:[o.jsx(ht,{title:t,width:i,defaultWidth:l,pinned:s,onTogglePin:I,onWidthChange:h,onResizeStart:A,resizing:x,statusLabel:hn(C,k),live:T,widthControls:!D}),o.jsx(gt,{model:te,avatar:o.jsx(Gn,{agent:C,placement:"row",size:44,presence:!1,tile:!1}),collapsed:F,cockpitHeight:F?void 0:m,onToggleCollapsed:()=>B(X=>!X),onOpen:()=>R(e)}),!F&&o.jsx(xt,{onResizeStart:c,onReset:p,active:L}),se]})}function Ds({navigate:e,agents:n,data:t,embedded:s=!1,laneSize:i="lg",profileId:l,harnessFilter:f,projectFilter:y}){const u=a.useContext(Bn),d=t?.agents??n??u?.agents??[],m=t?.operatorName?.trim()||u?.onboarding?.operatorName?.trim()||void 0,c=l??un(),p=i??fn(),[L,R]=a.useState(Date.now()),[b,I]=a.useState(Ns),[h,A]=a.useState(()=>ws(s)),[x,j]=a.useState(Rs),v=!s&&h==="floor",D=h==="grid",C=v?"4h":b,[S,k]=a.useState(St),[T,M]=a.useState([]),{beginResize:z,resetSummaryHeight:w,resizing:F}=kt(k),B=a.useCallback(r=>z(r,S),[z,S]),W=At(),V=Et(C),G=Zt({enabled:!t,includeTranscriptReplay:!0,discoveryIntervalMs:s?ps:Ls,recentLimit:W,recentWindowMs:V,discoveryLimit:s?hs:gs,pauseWhenHidden:!0}),O=t?.discovery??G.discovery,U=t?.tailEvents??G.events,K=t?.loadState??G.loadState,te=t?.retryInitialLoad??G.retryInitialLoad,se=t?.terminalSessions??T,X={view:"ops",mode:"lanes"},J=mn(C),De=s?ys:1e4,Me=s?bs:1e4;a.useEffect(()=>{const r=setInterval(()=>{sn()||R(Date.now())},De);return()=>clearInterval(r)},[De]),a.useEffect(()=>{if(t)return;let r=!1;const g=async()=>{if(!sn())try{const Re=await Hn({includeDiscovered:!1});r||M(Re)}catch{r||M([])}};g();const N=setInterval(()=>{g()},Me),P=on(()=>{g()});return()=>{r=!0,clearInterval(N),P()}},[t,Me]),a.useEffect(()=>{try{sessionStorage.setItem(pn,b)}catch{}},[b]),a.useEffect(()=>{try{sessionStorage.setItem(Ln,h)}catch{}},[h]),a.useEffect(()=>{try{sessionStorage.setItem(yn,x)}catch{}},[x]);const kn=a.useRef(Nt()),ze=a.useRef(""),[ae,Oe]=a.useState(()=>new Set),[ye,$e]=a.useState(null),xn=a.useMemo(()=>d.filter(r=>wt(r,L,C)),[d,L,C]),En=Wn(xn,{enabled:!t,activeIntervalMs:s?vs:void 0,idleIntervalMs:s?Ss:void 0,pauseWhenHidden:!0}),Fe=t?.observeCache??En,We=Vt(K),He=We==="blank",Nn=We==="degraded",Be=O?.totals.transcripts??O?.transcripts?.length??0;a.useEffect(()=>{if(ae.size===0)return;const r=setTimeout(()=>Oe(new Set),900);return()=>clearTimeout(r)},[ae]);const{lanes:re,issues:$,freshLaneIds:be}=a.useMemo(()=>{const r=Rt({transcripts:O?.transcripts??[],tailEvents:U,processes:O?.processes??[],scoutAgents:d,terminalSessions:se,observeCache:Fe,now:L,workingOnly:!0,horizon:C}),g=jt(r.lanes,kn.current),N=[...Ct(O),...r.issues];return{lanes:g.lanes,issues:N,freshLaneIds:g.newLaneIds}},[O,U,d,se,Fe,L,C]);a.useEffect(()=>{const r=$.map(g=>`${g.id}\0${g.message}`).join(`
2
- `);r!==ze.current&&(ze.current=r,$.length!==0&&console.warn(`[agent-lanes] ${$.length} roster issue${$.length===1?"":"s"}`,$))},[$]),a.useEffect(()=>{be.length!==0&&Oe(r=>{const g=new Set(r);for(const N of be)g.add(N);return g})},[be.join("\0")]);const Q=a.useMemo(()=>re.find(r=>r.id===ye)??null,[ye,re]),ve=a.useMemo(()=>re.filter(r=>zs(r,{harnessFilter:f,projectFilter:y})),[re,f,y]),wn=a.useCallback(r=>Os(r,{harnessFilter:f,projectFilter:y}),[f,y]),{deck:_,layout:E,pinLane:oe,unpinLane:ie,setLaneWidth:Se,addHarnessLane:ee,addAttentionLane:Ve,addProjectLane:Rn,clearPins:jn,isPinned:le}=os(c,p,ve),{beginResize:Ge,resizingLaneId:Ke}=is(Se),ke=a.useMemo(()=>$s({harnessFilter:f,projectFilter:y}),[f,y]),xe=a.useMemo(()=>Q?Lt(Q):null,[Q]),Cn=a.useMemo(()=>xe?rs(_,xe):!1,[_,xe]),In=a.useMemo(()=>[E.pinnedLeft,E.main,E.pinnedRight].map(r=>r.map(g=>`${g.key}:${g.widthPx}`).join(",")).join("/"),[E.main,E.pinnedLeft,E.pinnedRight]),{handleLaneScroll:q,setLaneScrollNode:Y}=Is(c,In),An=a.useCallback(r=>{Y("pinned-left",r)},[Y]),Tn=a.useCallback(r=>{Y("main",r)},[Y]),_n=a.useCallback(r=>{Y("pinned-right",r)},[Y]),Pn=a.useCallback(r=>{q("pinned-left",r)},[q]),Dn=a.useCallback(r=>{q("main",r)},[q]),Mn=a.useCallback(r=>{q("pinned-right",r)},[q]),ne=E.flat,Ee=E.pinnedLeft.length+E.pinnedRight.length,ce=v?ve.length:ne.length,de=ct(dt(K,ce),He?0:mt);a.useEffect(()=>{if(v)return;const r=ne.map(g=>{const{lane:N}=g;return{id:N.id,label:Z(N.agent,N.source),statusLabel:hn(N.agent,N.source),tone:ln(N.agent.state,N.agent),agentId:yt(N.agent)?void 0:N.agent.id,updatedAt:N.lastActiveAt>0?N.lastActiveAt:void 0}});Qe(r)},[ne,v]),a.useEffect(()=>()=>Qe(null),[]);const[Ue,Ne]=a.useState(null),we=a.useCallback(r=>{$e(r.id)},[]),qe=a.useCallback((r,g)=>{Ne({lane:r,event:g})},[]),zn=a.useCallback(r=>{const g=r.observe?.events.at(-1);g&&Ne({lane:r,event:g})},[]),On=a.useCallback(r=>{le(r.id)?ie(r.id):oe(r)},[le,oe,ie]),{getLaneFocusProps:Ye}=Xt({lanes:ne.map(r=>r.lane),inspectedLaneId:ye,onInspect:we,onHorizonChange:I,onTogglePin:On}),[ue,H]=a.useState(!1),Ze=a.useRef(null);a.useEffect(()=>{if(!ue)return;const r=g=>{Ze.current?.contains(g.target)||H(!1)};return window.addEventListener("pointerdown",r),()=>window.removeEventListener("pointerdown",r)},[ue]);const fe=a.useCallback((r,g,N=!1)=>{const{lane:P}=r,Re=Z(P.agent,P.source),$n=_.laneWidths[P.id]??dn(r.widthPx).tier??r.widthPx;return o.jsx(Ps,{lane:P,widthPx:r.widthPx,laneTitle:Re,pinned:r.isPinned,laneWidth:$n,defaultWidth:_.defaultLaneWidth,isNew:ae.has(P.id),nowMs:L,traceWindowMs:V,traceWindowLabel:J,summaryHeight:S,onSummaryResizeStart:B,onSummaryResizeReset:w,summaryResizing:F,onInspect:we,onTraceEventSelect:qe,onTogglePin:()=>{le(P.id)?ie(P.id):oe(P)},onWidthChange:je=>Se(P.id,je),onWidthResizeStart:je=>Ge(P.id,je,r.widthPx),widthResizing:Ke===P.id,focusProps:Ye(g,P.id),operatorName:m,grid:N},r.key)},[Ge,_.defaultLaneWidth,_.laneWidths,Ye,B,J,we,qe,le,m,ae,L,oe,w,Ke,Se,S,F,V,ie]);return o.jsxs("div",{className:`s-agent-lanes${s?" s-agent-lanes--embedded s-agent-lanes--low-motion":""}`,"data-lane-profile":c,"data-lane-layout":v?"floor":h,"data-lanes-deck-version":"1",children:[o.jsxs("div",{className:"s-agent-lanes-bar",children:[o.jsxs("div",{className:"s-agent-lanes-bar-leading",children:[o.jsx("div",{className:"s-agent-lanes-title",children:"Agent Lanes"}),o.jsxs("div",{className:"s-agent-lanes-meta","aria-label":"Lane deck status",children:[o.jsxs("span",{className:"s-agent-lanes-meta-stat",children:[ce," live"]}),!v&&Ee>0?o.jsxs("span",{className:"s-agent-lanes-meta-stat",children:[Ee," pinned"]}):null,o.jsx("span",{className:"s-agent-lanes-meta-stat",children:v?"past 30m · lanes 4h":`trace ${J}`}),ke?o.jsx("span",{className:"s-agent-lanes-meta-filter",children:ke}):null,o.jsxs("span",{className:"s-agent-lanes-meta-detail",children:["deck v1 · ",c]})]})]}),o.jsxs("div",{className:"s-agent-lanes-bar-controls",children:[o.jsx("div",{className:"s-agent-lanes-layouts",role:"group","aria-label":"Lane layout",children:us(s).map(r=>o.jsx("button",{type:"button",className:`s-agent-lanes-horizon${h===r.key?" s-agent-lanes-horizon--on":""}`,"aria-pressed":h===r.key,onClick:()=>A(r.key),children:r.label},r.key))}),D?o.jsx("div",{className:"s-agent-lanes-grid-density",role:"group","aria-label":"Grid columns",children:ls.map(r=>o.jsx("button",{type:"button",className:`s-agent-lanes-horizon${x===r.key?" s-agent-lanes-horizon--on":""}`,"aria-pressed":x===r.key,title:r.key==="auto"?"Fit columns to the available width":`${r.key} columns`,onClick:()=>j(r.key),children:r.label},r.key))}):null,o.jsxs("div",{className:"s-agent-lanes-deck-menu",ref:Ze,hidden:v,children:[o.jsx("button",{type:"button",className:"s-agent-lanes-deck-btn","aria-expanded":ue,onClick:()=>H(r=>!r),children:"+ Lane"}),ue?o.jsxs("div",{className:"s-agent-lanes-deck-popover",role:"menu",children:[o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{Ve(),H(!1)},disabled:as(_),children:"Needs attention"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{ee("codex","Codex sessions"),H(!1)},disabled:me(_,"codex"),children:"Codex sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{ee("claude","Claude sessions"),H(!1)},disabled:me(_,"claude"),children:"Claude sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{ee("grok","Grok sessions"),H(!1)},disabled:me(_,"grok"),children:"Grok sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item",onClick:()=>{ee("kimi","Kimi sessions"),H(!1)},disabled:me(_,"kimi"),children:"Kimi sessions"}),o.jsx("button",{type:"button",role:"menuitem",className:"s-agent-lanes-deck-item s-agent-lanes-deck-item--danger",onClick:()=>{jn(),H(!1)},disabled:Ee===0,children:"Clear pinned lanes"})]}):null]}),v?null:o.jsx("div",{className:"s-agent-lanes-horizons",role:"group","aria-label":"Activity window",children:ge.map((r,g)=>o.jsx("button",{type:"button",className:`s-agent-lanes-horizon${b===r.key?" s-agent-lanes-horizon--on":""}`,"aria-pressed":b===r.key,title:`${r.label} window (${g+1})`,onClick:()=>I(r.key),children:r.label},r.key))})]})]}),t==null&&$.length>0?o.jsxs("div",{className:"s-agent-lanes-issues",role:"status","aria-live":"polite",children:[o.jsxs("div",{className:"s-agent-lanes-issues-head",children:[o.jsx("span",{className:"s-agent-lanes-issues-badge",children:"Roster issues"}),o.jsxs("span",{className:"s-agent-lanes-issues-meta",children:[$.length," fleet/transcript warning",$.length===1?"":"s"," — lanes follow tail, not agent registry"]})]}),o.jsx("ul",{className:"s-agent-lanes-issues-list",children:$.map(r=>o.jsx(As,{issue:r},r.id))})]}):null,ce===0?de.visible?o.jsx(ut,{discovery:O,discoveryPhase:K.discovery,windowMs:V,nowMs:L,layout:v?"none":D?"grid":"scroll",gridColumns:x,laneWidthPx:cn(_.defaultLaneWidth,_.defaultLaneWidth),matchTranscript:wn}):He?o.jsx(Ts,{loadState:K,onRetry:()=>{te()}}):o.jsx(_s,{activeFilterLabel:ke,horizon:b,horizonLabel:J,showAutoLanes:_.showAutoLanes,onHorizonChange:I,onAddAttentionLane:Ve,onAddCodexLane:()=>ee("codex","Codex sessions"),sourceCount:Be,eventCount:U.length,degraded:Nn,onRetry:()=>{te()}}):v?o.jsx(lt,{lanes:ve,now:L,onOpenTrace:zn,railLedger:!0,operatorName:m}):D?o.jsx("div",{className:"s-agent-lanes-grid","data-grid-columns":x,role:"listbox","aria-label":"Agent lane grid",children:ne.map((r,g)=>fe(r,g,!0))}):o.jsxs("div",{className:"s-agent-lanes-body",children:[E.pinnedLeft.length>0?o.jsxs("section",{className:"s-agent-lanes-zone s-agent-lanes-zone--pinned-left","aria-label":"Pinned lanes",children:[o.jsx("div",{className:"s-agent-lanes-zone-label",children:"Pinned"}),o.jsx("div",{ref:An,className:"s-agent-lanes-scroll",role:"listbox","aria-label":"Pinned agent lanes",onScroll:Pn,children:E.pinnedLeft.map((r,g)=>fe(r,g))})]}):null,E.main.length>0?o.jsxs("section",{className:"s-agent-lanes-zone s-agent-lanes-zone--main","aria-label":"Active lanes",children:[E.pinnedLeft.length>0?o.jsx("div",{className:"s-agent-lanes-zone-label",children:"Live"}):null,o.jsx("div",{ref:Tn,className:"s-agent-lanes-scroll",role:"listbox","aria-label":"Active agent lanes",onScroll:Dn,children:E.main.map((r,g)=>fe(r,E.pinnedLeft.length+g))})]}):null,E.pinnedRight.length>0?o.jsxs("section",{className:"s-agent-lanes-zone s-agent-lanes-zone--pinned-right","aria-label":"Pinned right lanes",children:[o.jsx("div",{className:"s-agent-lanes-zone-label",children:"Pinned"}),o.jsx("div",{ref:_n,className:"s-agent-lanes-scroll",role:"listbox","aria-label":"Pinned right agent lanes",onScroll:Mn,children:E.pinnedRight.map((r,g)=>fe(r,E.pinnedLeft.length+E.main.length+g))})]}):null]}),de.visible?o.jsx(ft,{loadState:K,sourceCount:Be,processCount:O?.processes.length??0,eventCount:U.length,laneCount:ce,horizonLabel:J,handedOff:de.exiting,exiting:de.exiting}):null,Q&&o.jsx(bt,{lane:Q,navigate:e,returnRoute:X,navigationEnabled:t==null,onClose:()=>$e(null),onPinProject:Rn,projectPinned:Cn}),Ue&&o.jsx(vt,{target:Ue,onClose:()=>Ne(null)})]})}function pe(e){const n=e?.trim().toLowerCase();return n||null}function Te(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Ms(e){return e.trim().replace(/\/+$/u,"").split(/[\\/]/u).filter(Boolean).pop()?.trim()||null}function Le(e,n){if(!n)return!0;const t=Te(n);return e.some(s=>{const i=s?.trim();if(!i)return!1;const l=i.toLowerCase(),f=Ms(i);return l===n||Te(i)===t||!!(f&&(f.toLowerCase()===n||Te(f)===t))})}function zs(e,n){const t=pe(n.harnessFilter),s=pe(n.projectFilter),{agent:i,facts:l,source:f}=e;return Le([i.harness,i.definitionId,l?.attribution,f],t)&&Le([i.project,i.projectRoot,i.cwd,l?.cwd,Z(i,f)],s)}function Os(e,n){return Le([e.harness,e.source],pe(n.harnessFilter))&&Le([e.project,e.cwd],pe(n.projectFilter))}function $s(e){return[e.harnessFilter?.trim()?`harness ${e.harnessFilter.trim()}`:"",e.projectFilter?.trim()?`project ${e.projectFilter.trim()}`:""].filter(Boolean).join(" · ")}const Fs=Vn({id:"lanes",label:"Agent Lanes",route:{view:"ops",mode:"lanes"},webPath:"/ops/lanes",screen:"AgentLanesView",embed:{path:"/embed/agent-lanes",aliases:["/ops/lanes/embed","/embed/lanes","/embed/traces"],profile:"macos.lanes",rootClassName:"s-agent-lanes-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:e=>({profileId:un(),laneSize:fn(),harnessFilter:e.get("harness")?.trim()||null,projectFilter:e.get("project")?.trim()||null})}}),fa=Object.freeze(Object.defineProperty({__proto__:null,AgentLanesView:Ds,scoutSurface:Fs},Symbol.toStringTag,{value:"Module"}));export{Ds as A,fa as a,ss as r,Zt as u};
@@ -1 +0,0 @@
1
- import{r as b,j as t}from"./index-DvLtl7rV.js";import{A as C}from"./AgentAvatar-6-KBVKUu.js";import{H as S}from"./HarnessMark-B979GCSB.js";import{u as B,b as L,f as T}from"./use-fleet-active-asks-DAspZQjE.js";import{b as F,p as R,N as _,t as u}from"./agent-master-model-DqjrVI2h.js";import{t as q}from"./time-Dhsh_2EG.js";import{u as z}from"./use-conversation-list-C9ABzjXI.js";import{u as E}from"./Provider-CtXJeLrP.js";import{ConversationScreen as A}from"./ConversationScreen-CR9pWB65.js";/* empty css */import{A as O}from"./arrow-up-right-C6Wl-1uw.js";import{X as H}from"./x-CAbNespN.js";import"./SpriteAvatar-z5hHesx9.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-BwXjyg8N.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./message-visibility-CGOmSSKs.js";import"./conversation-model-Dc02NsGp.js";import"./createLucideIcon-DezKXSG2.js";import"./router-B9vQkNJL.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./index-zvhpRHao.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./ConversationComposer-CXPKx86g.js";import"./zap-Cq8eWkcF.js";import"./message-markup-C2LQDm_k.js";import"./mentions-DG6OQrsc.js";import"./AgentDetailCard-C9rn3Fj5.js";import"./AgentLiveActions-DrEJDJef.js";import"./terminal-takeover-_Jyys4me.js";import"./openContent-C6XO6kr5.js";import"./eye-BRyD0jno.js";import"./terminal-9GRS_Qdc.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-BQWzGzLK.js";import"./BackToPicker-CXZjBRAe.js";import"./AstronautSuit-DbjQtfD_.js";import"./ConversationFeedRows-WrH-YI3L.js";import"./ConversationPanels-Dujvnmup.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-x8pJMVrG.js";import"./proxy-BiW5suC7.js";import"./activity-DcrMApUY.js";import"./message-circle-mZCv8tvB.js";import"./tail-events-Ps8KpKah.js";import"./ConversationStatus-DVzSb2Hv.js";import"./check-ofKUE8yH.js";import"./sparkles-CETYrxGA.js";function de({agentId:e,threadId:m,machineId:r,navigate:n}){const{agents:h}=E(),{sessions:v,loading:k}=z(),l=B(),{agent:i,memberAgentIds:j,sessions:g,master:o,threads:x,thread:a}=b.useMemo(()=>F({agentId:e,threadId:m,machineId:r,agents:h,sessions:v}),[e,m,r,h,v]),w=b.useMemo(()=>L(l,j),[l,j]),p=s=>({view:"messages",agentId:e,...s?{threadId:s}:{},...r?{machineId:r}:{}}),M=s=>({view:"messages",conversationId:s,...r?{machineId:r}:{}}),d=i?.name??g[0]?.agentName??e.split(".")[0]??e,y=(()=>{const s=R(i);return s===_?null:s})(),c=W(w),f=[y,c?.label??i?.branch??null].filter(Boolean).join(" · ");return t.jsxs("div",{className:"amv",children:[t.jsxs("section",{className:"amv-main",children:[t.jsxs("header",{className:"amv-head",children:[t.jsx(C,{agent:i??{name:d,harness:o?.harness??null,state:null},placement:"row",size:32}),t.jsxs("div",{className:"amv-ident",children:[t.jsx("span",{className:"amv-name",children:d}),f?t.jsxs("span",{className:"amv-sub",children:[c?t.jsx("span",{className:"amv-dot","data-tone":c.tone,"aria-hidden":!0}):null,f]}):null]}),i?.harness??o?.harness?t.jsx(S,{harness:i?.harness??o?.harness??"",size:14}):null]}),x.length>0?t.jsx("div",{className:"amv-strip",role:"list","aria-label":"Session threads",children:x.map(s=>{const N=s.id===a?.id;return t.jsxs("button",{type:"button",role:"listitem",className:`amv-card${N?" amv-card--on":""}`,onClick:()=>n(N?p():p(s.id)),children:[t.jsx("span",{className:"amv-mark","data-state":J(s,l),"aria-hidden":!0}),t.jsx("span",{className:"amv-cardTitle",children:u(s)}),t.jsx("span",{className:"amv-cardMeta",children:s.lastMessageAt?q(s.lastMessageAt):"—"})]},s.id)})}):null,t.jsx("div",{className:"amv-feed",children:o?t.jsx(A,{conversationId:o.id,navigate:n,embedded:!0,showBackNav:!1},o.id):t.jsx("div",{className:"amv-empty",children:k?"Loading conversations…":`No conversations with ${d} yet.`})})]}),a?t.jsxs("aside",{className:"amv-thread","aria-label":"Thread",children:[t.jsxs("header",{className:"amv-threadHead",children:[t.jsxs("div",{className:"amv-threadIdent",children:[t.jsx("span",{className:"amv-threadKicker",children:"Thread"}),t.jsx("span",{className:"amv-threadTitle",title:u(a),children:u(a)})]}),t.jsx("button",{type:"button",className:"amv-threadBtn",title:"Open as full conversation","aria-label":"Open as full conversation",onClick:()=>n(M(a.id)),children:t.jsx(O,{size:14,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"amv-threadBtn",title:"Close thread","aria-label":"Close thread",onClick:()=>n(p()),children:t.jsx(H,{size:14,strokeWidth:2,"aria-hidden":!0})})]}),t.jsx("div",{className:"amv-threadBody",children:t.jsx(A,{conversationId:a.id,navigate:n,embedded:!0,showBackNav:!1},a.id)})]}):null]})}function W(e){return e?e.status==="working"?{label:"working",tone:"working"}:e.status==="needs_attention"?{label:"needs you",tone:"attention"}:e.status==="queued"?{label:"starting",tone:"pending"}:null:null}function $(e){return e.status==="needs_attention"?"needs_you":e.status==="working"||e.status==="queued"?"working":"quiet"}function J(e,m){const r=T(m,e);return r?$(r):"quiet"}export{de as AgentMasterScreen};
@@ -1 +0,0 @@
1
- import{r as h,j as s}from"./index-DvLtl7rV.js";import{A as B}from"./AgentAvatar-6-KBVKUu.js";import{H as S,h as w}from"./HarnessMark-B979GCSB.js";import{c as P}from"./colors-BtO5_zlx.js";import{f as R}from"./text-BP3oyl8-.js";import{t as C}from"./time-Dhsh_2EG.js";import"./Provider-CtXJeLrP.js";import"./router-B9vQkNJL.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./NewChatComposer-_Stj0fZy.js";import"./conversation-model-Dc02NsGp.js";import"./index-zvhpRHao.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./loader-circle-pM56HNhR.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./SpriteAvatar-z5hHesx9.js";import"./CrewAvatar-BwXjyg8N.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 Ds({projects:n,initialSelection:e,onEdit:a,onInterrupt:l,onResetContext:i,onOpenConversation:m,onNewAgent:o}){const d=h.useMemo(()=>n.flatMap(t=>t.agents.map(c=>[t,c])),[n]),x=d[0]?.[1],[u,A]=h.useState(e?.agentId??x?.agent.id??null),[F,E]=h.useState(e?.facet??"prompt"),[I,y]=h.useState(()=>new Set(u?[u]:[])),[M,V]=h.useState(""),g=M.trim().toLowerCase(),D=h.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=h.useMemo(()=>{for(const[t,c]of d)if(c.agent.id===u)return{project:t,entry:c};return null},[d,u]),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===u;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,u=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,u&&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(p,{k:"Harness",v:w(a.harness),mark:a.harness}),s.jsx(p,{k:"Model",v:l.model??"—"}),m?s.jsx(p,{k:"Owner",v:m}):null,a.branch?s.jsx(p,{k:"Branch",v:a.branch,mono:!0}):null,s.jsx(p,{k:"State",v:P(a.state)}),a.updatedAt?s.jsx(p,{k:"Updated",v:C(a.updatedAt)}):null,s.jsx(p,{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 p({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{Ds as AgentsConsole};
@@ -1 +0,0 @@
1
- import{j as e,r as d}from"./index-DvLtl7rV.js";import{p as S,a as E}from"./api-Co9aQ2Jw.js";import{u as W,d as X}from"./Provider-CtXJeLrP.js";import{Q,b as Y}from"./router-B9vQkNJL.js";import{a as J}from"./sse-CD9MMUxl.js";import{o as Z,i as C}from"./surface-activity-B1rgWB1i.js";/* empty css */import{AgentsSubnav as ee}from"./AgentsSubnav-C4xpQhsv.js";import{AgentsLibrary as te}from"./library-DkALuCh5.js";import{r as se,d as oe}from"./NewChatComposer-_Stj0fZy.js";import{AgentDetailWithRail as ne,AgentProfileBar as ie}from"./profile-APxDsN2P.js";/* empty css *//* empty css *//* empty css */import"./perf-PX8Rx0EP.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-BR4VRdgh.js";import"./secondaryNavConfig-BoQ_zYR9.js";import"./message-square-C7t_qtuj.js";import"./search-CDko0PKE.js";import"./compass-Dt1AMXz2.js";import"./settings-Dyvpkb1D.js";import"./terminal-9GRS_Qdc.js";import"./git-branch-CK5v8F2v.js";import"./scroll-text-Dze_dXtQ.js";/* empty css */import"./time-Dhsh_2EG.js";import"./SpriteAvatar-z5hHesx9.js";import"./HarnessMark-B979GCSB.js";import"./AgentSessions-DCPCG4xb.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./index-zvhpRHao.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./agents-project-model-UYiamtrU.js";import"./AgentAvatar-6-KBVKUu.js";import"./CrewAvatar-BwXjyg8N.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-DsaZJXZt.js";import"./terminal-relay-GYMIvKs1.js";import"./BackToPicker-CXZjBRAe.js";import"./ConversationScreen-CR9pWB65.js";import"./ConversationComposer-CXPKx86g.js";import"./zap-Cq8eWkcF.js";import"./message-markup-C2LQDm_k.js";import"./mentions-DG6OQrsc.js";import"./AgentDetailCard-C9rn3Fj5.js";import"./AgentLiveActions-DrEJDJef.js";import"./terminal-takeover-_Jyys4me.js";import"./eye-BRyD0jno.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-BQWzGzLK.js";import"./AstronautSuit-DbjQtfD_.js";import"./ConversationFeedRows-WrH-YI3L.js";import"./ConversationPanels-Dujvnmup.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-x8pJMVrG.js";import"./proxy-BiW5suC7.js";import"./activity-DcrMApUY.js";import"./message-circle-mZCv8tvB.js";import"./tail-events-Ps8KpKah.js";import"./ConversationStatus-DVzSb2Hv.js";import"./check-ofKUE8yH.js";import"./sparkles-CETYrxGA.js";import"./SessionObserve-dQDN23pP.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-HByf2ndx.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-BJUhDSuQ.js";import"./ObserveTextFlow-ZQWwrK3i.js";import"./SessionObserveEvidence-BRBGKAgd.js";import"./wrench-DjkoAOQt.js";import"./external-link-Dp_a2vRZ.js";import"./AgentDefinitionsWorkspace-Iyl4BesU.js";import"./agent-specialization-BujJVUTD.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-Df6VzXjA.js";/* empty css */import"./agent-essentials-D7KRGYvF.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,i=[]){const r=V(t);if(r!==null)return r;if(!t)return null;const l=o.toLowerCase(),a=new Set([l,l.replace(/-/g,""),...i.map(n=>n.trim().toLowerCase()).filter(Boolean)]),s=t.split(",").map(n=>n.trim().toLowerCase()).filter(Boolean);return s.some(n=>U.has(n))?!1:s.some(n=>a.has(n))?!0:null}function le({studyId:t,aliases:o,href:i,storedEnabled:r,storedMode:l,dev:a,defaultMode:s="after"}){const n=i?new URL(i,"http://localhost"):null,p=L(n?.searchParams.get("studio"),t,o)??L(n?.searchParams.get(`studio.${t}`),t,o)??L(n?.searchParams.get("studioInjection"),t,o),c=n?ae.has(de(n.hostname)):!1;if(!a&&!c)return{enabled:!1,mode:s};const u=p??V(r)??!1,g=M(n?.searchParams.get("studioMode"))??M(n?.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"||Q({searchPatch:{studio:null,[`studio.${t}`]:null,studioInjection:null,studioMode:null,[`studioMode.${t}`]:null},replace:!0})}function fe(t,o=[]){const[i,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(!i.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)}},[i.enabled]);const s=d.useCallback(c=>{O(D(t),c?"1":"0"),r(u=>({...u,enabled:c}))},[t]),n=d.useCallback(c=>{O($(t),c),r(u=>({...u,mode:c}))},[t]),p=l?pe(i.mode):i.mode;return d.useMemo(()=>({...i,renderedMode:p,peeking:p!==i.mode,setEnabled:s,setMode:n}),[p,s,n,i])}function ge({studyId:t,aliases:o,anchor:i,title:r,children:l,renderStudy:a}){const s=fe(t,o);return s.enabled?e.jsxs("div",{className:"s-studio-injection","data-studio-anchor":i,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:i})]}),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"),i=t.filter(s=>s.state==="ready"),r=t.filter(s=>s.state==="attention"),l=b.reduce((s,n)=>s+n.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:i.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(n=>e.jsxs("span",{className:`s-agent-studio-agent-pill s-agent-studio-agent-pill--${n.state}`,children:[e.jsx("span",{className:"s-agent-studio-dot","data-state":n.state}),n.name]},n.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:i}){return e.jsxs("div",{className:`s-agent-studio-metric${i?` s-agent-studio-metric--${i}`:""}`,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 vs({navigate:t,selectedAgentId:o,conversationId:i,tab:r,activeRoute:l}){const{agents:a,agentsLoaded:s,route:n}=W(),[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(n),A=d.useMemo(()=>X(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=Z(h);return()=>{window.clearInterval(f),w()}},[x]),J(()=>!0,()=>{C()&&x()});const m=se(A,o),B=!!(o&&m&&m.id!==o),v=n.view==="agents-v2"?n.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}:{},...i?{conversationId:i}:{},...r?{tab:r}:{}})},[i,r,k,t,v,m,o,B]),m&&!k){const h=i??_.get(m.id)??m.conversationId??null,f=r??(i?"message":"profile");return e.jsx(F,{activeRoute:l??n,navigate:t,bar:e.jsx(ie,{agent:m,conversationId:h,activeTab:f,navigate:t}),children:e.jsx(ne,{agent:m,allAgents:A,conversationId:h,navigate:t,activeTab:f})})}return e.jsx(F,{activeRoute:l??n,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:i,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:i})}),e.jsx("div",{className:"s-secondary-nav-body",children:o})]})}export{vs as AgentsScreen};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-DvLtl7rV.js";import{S as i}from"./SecondaryNav-BR4VRdgh.js";import{A as m}from"./secondaryNavConfig-BoQ_zYR9.js";import"./createLucideIcon-DezKXSG2.js";import"./message-square-C7t_qtuj.js";import"./file-text-CqJgwxmv.js";import"./search-CDko0PKE.js";import"./compass-Dt1AMXz2.js";import"./settings-Dyvpkb1D.js";import"./terminal-9GRS_Qdc.js";import"./git-branch-CK5v8F2v.js";import"./code-xml-D7pOQM9l.js";import"./scroll-text-Dze_dXtQ.js";function j({activeRoute:r,navigate:o}){return t.jsx(i,{ariaLabel:"Agents sections",activeRoute:r,groups:m,navigate:o})}export{j as AgentsSubnav};
@@ -1 +0,0 @@
1
- import{r as o,j as e}from"./index-DvLtl7rV.js";import{E as p}from"./EmptyState-CJzXj1l5.js";import{a as f}from"./api-Co9aQ2Jw.js";import{S as b}from"./scoutbot-markdown-BQ_Ee2Ic.js";import{b as h,t as u}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */import"./perf-PX8Rx0EP.js";import"./Provider-CtXJeLrP.js";import"./router-B9vQkNJL.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./conversation-model-Dc02NsGp.js";import"./index-zvhpRHao.js";import"./HarnessMark-B979GCSB.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./external-link-Dp_a2vRZ.js";const g={"fleet-home":"fleet briefing",tour:"tour briefing"};function fe({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{fe as BriefingDetailScreen};
@@ -1,5 +0,0 @@
1
- import{r as a,j as e}from"./index-DvLtl7rV.js";import{r as us}from"./index-zvhpRHao.js";import{D as hs}from"./text-BP3oyl8-.js";import{E as Ie}from"./EmptyState-CJzXj1l5.js";import{B as fs,j as ms,F as ps,R as bs,G as ys,H as gs}from"./NewChatComposer-_Stj0fZy.js";import{p as xs,a as ne}from"./api-Co9aQ2Jw.js";import{c as js}from"./clipboard-e3fSpeo7.js";import{u as ks}from"./sse-CD9MMUxl.js";import{b as Fe}from"./status-tone-BM_zuRy1.js";import{t as $e,b as We,n as X}from"./time-Dhsh_2EG.js";import{u as Ve}from"./Provider-CtXJeLrP.js";import{o as Oe}from"./openContent-C6XO6kr5.js";import{g as vs,b as oe,h as Ye,d as ws,i as Ns,j as Ss,k as Rs,l as As}from"./broker-display-Q75fupqG.js";import{BrokerMetadataPanel as Cs}from"./BrokerMetadataPanel-BsiU8lTD.js";import{DispatchAftermath as Is}from"./DispatchAftermath-B-6rmXzL.js";import{i as $s,c as Ds,n as _e}from"./keyboard-nav-BLYDhL3Z.js";import{ShikiPane as Es}from"./ShikiPane-DYI9Hkge.js";import{d as Fs}from"./types-B0PlfpKc.js";/* empty css */import{L as ke}from"./loader-circle-pM56HNhR.js";import{R as Ms}from"./refresh-cw-DMxGzDwn.js";import{X as De}from"./x-CAbNespN.js";import{A as Ts}from"./arrow-down-CKtSUjmW.js";import{E as Ue}from"./external-link-Dp_a2vRZ.js";import{C as Ls}from"./chevron-down-wciXnOQz.js";import{S as Ps}from"./sparkles-CETYrxGA.js";import{P as Bs}from"./paperclip-C64lkcbM.js";import{P as zs}from"./plus-Co-dqKul.js";import{S as qs}from"./send-horizontal-CSjIm6xg.js";import{A as Ke}from"./arrow-right-BuzMnLYP.js";import{C as Os}from"./check-ofKUE8yH.js";import{C as _s}from"./copy-CWWAJ75H.js";import{M as Us}from"./message-square-C7t_qtuj.js";import{c as Xe}from"./createLucideIcon-DezKXSG2.js";import{R as Ks}from"./radio-BOxBQX-T.js";import{M as Hs,b as Js}from"./DocumentFocusViewer-Do3wQ_3Z.js";import{B as Gs}from"./bot-rd0awxD3.js";const Qs=[["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"}]],Ws=Xe("at-sign",Qs);const Vs=[["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"}]],Ys=Xe("hash",Vs),Xs=160;function Ce(s){const t=new URLSearchParams({limit:String(Xs)});return s&&t.set("cursor",s),`/api/broker?${t.toString()}`}const He={index:-1,request:0};function Zs(s,t){return{index:t,request:s.request+1}}function Ze(s,t){return t===s.index?s:{index:t,request:s.request}}function er(s,t){return s.index<t?s:Ze(s,t>0?t-1:-1)}function sr(s,t){return s.request!==t}function rr({enabled:s,rowCount:t,onActivateRow:n,onClearSelection:o}){const[u,h]=a.useState(He),b=u.index,m=a.useRef(new Map),k=a.useRef(He.request),c=a.useCallback(y=>{h(f=>Zs(f,typeof y=="function"?y(f.index):y))},[]),N=a.useCallback(y=>{h(f=>Ze(f,typeof y=="function"?y(f.index):y))},[]);a.useEffect(()=>{if(!sr(u,k.current)||(k.current=u.request,u.index<0))return;const y=m.current.get(u.index);y?.scrollIntoView({block:"nearest"}),y?.focus()},[u]),a.useEffect(()=>{h(y=>er(y,t))},[t]);const R=a.useCallback((y,f)=>{f?m.current.set(y,f):m.current.delete(y)},[]);a.useEffect(()=>{if(!s)return;const y=f=>{if(document.querySelector(".sys-broker-page")&&!($s(f.target)||Ds())&&t!==0){if(f.key==="Escape"){o&&(f.preventDefault(),o(),N(-1));return}if(f.key==="ArrowDown"||f.key==="j"){f.preventDefault(),c(S=>_e(S,t,1));return}if(f.key==="ArrowUp"||f.key==="k"){f.preventDefault(),c(S=>_e(S,t,-1));return}if(f.key==="Home"||f.key==="g"&&!f.shiftKey){f.preventDefault(),c(0);return}if(f.key==="End"||f.key==="G"){f.preventDefault(),c(t-1);return}if(f.key==="Enter"||f.key===" "){const S=b<0?0:b;f.preventDefault(),c(S),n(S)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,b,c,n,o,t,N]);const q=a.useCallback(y=>({tabIndex:b===y?0:-1,ref:f=>R(y,f),onFocus:()=>N(y)}),[b,R,N]);return{focusedIndex:b,setFocusedIndex:N,getRowFocusProps:q}}const ye=["all","delivered","failed"],tr=3e4,ar={all:"All",delivered:"Delivered",failed:"Failed"};function nr(s){switch(s){case"success":return"Success";case"failed_query":return"Query failure";case"failed_delivery":return"Delivery failure";default:return"Delivery attempt"}}function es(s){return s.messageId??s.deliveryId??s.invocationId??s.id}function ss(s){switch(Fe(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 ve(s){if(!s)return"··";const t=s.trim().split(/\s+/).filter(Boolean);if(t.length===0)return"··";const n=t[t.length-1];return/^\d+$/.test(n)?n.slice(-2):t.length>=2?(t[0][0]+t[1][0]).toUpperCase():s.trim().slice(0,2).toUpperCase()}function or(s){const t=X(s)??0;return new Date(t).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Je(s){const t=X(s);return t===null?"—":new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ne(s,t,n=0){if(!s||typeof s!="object"||Array.isArray(s)||n>3)return;const o=s;for(const u of t)if(o[u]!==void 0&&o[u]!==null)return o[u];for(const u of Object.values(o)){const h=Ne(u,t,n+1);if(h!==void 0)return h}}function U(s,...t){const n=Ne(s.metadata,t);return typeof n!="string"&&typeof n!="number"?null:String(n).trim()||null}function we(s,...t){const n=Ne(s.metadata,t);return typeof n=="number"||typeof n=="string"?X(n):null}function rs(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 Ee(s,t){if(t==="to")return s.route==="channel"?"Channel":s.route==="broadcast"?"Broadcast":s.target?.toLowerCase().includes("operator")?"Operator":"Agent lane";const n=U(s,"class","actorClass")?.toLowerCase();return n==="operator"||n==="human"?"Operator":n==="agent"?"Agent":s.actorName?.toLowerCase().includes("operator")?"Operator":"Sender"}function ir(s){const t=Ne(s.metadata,["latencyMs","durationMs"]);if(typeof t=="number"&&Number.isFinite(t)&&t>=0)return t<1e3?`${Math.round(t)}ms`:`${(t/1e3).toFixed(t<1e4?1:0)}s`;const n=we(s,"sentAt","createdAt")??X(s.ts),o=we(s,"deliveredAt","completedAt");if(n===null||o===null||o<n)return"—";const u=o-n;return u<1e3?`${u}ms`:`${(u/1e3).toFixed(u<1e4?1:0)}s`}function Me({route:s}){switch(s){case"channel":return e.jsx(Ys,{size:12,"aria-hidden":"true"});case"broadcast":return e.jsx(Ks,{size:12,"aria-hidden":"true"});case"dm":return e.jsx(Ws,{size:12,"aria-hidden":"true"});default:return e.jsx(Us,{size:12,"aria-hidden":"true"})}}function lr(s,t){if(!t)return null;const n=t.trim().replace(/^@/,"").toLowerCase();return s.find(o=>[o.id,o.name,o.handle,o.selector,o.defaultSelector,o.conversationId,o.harnessSessionId].some(u=>u?.trim().replace(/^@/,"").toLowerCase()===n))??null}function Ge(s,t,n){const o=n==="from"?s.actorName:s.target,u=lr(t,o),h=u?.name??o??(n==="from"?"Unknown":"No target"),b=u?"Agent":n==="to"&&s.conversationId?"Session route":Ee(s,n);return{label:h,kind:b,agent:u}}function cr(s,t,n){const o=n.agent??t.agent;return[{label:"From",value:t.kind},{label:"To",value:n.kind},{label:"Target",value:s.target??n.label},{label:"Channel",value:rs(s.route)},{label:"Project",value:o?.project??U(s,"project","projectName")},{label:"Branch",value:o?.branch??U(s,"branch")},{label:"Runtime",value:o?[o.harness,o.model,o.reasoningEffort].filter(Boolean).join(" · ")||null:[U(s,"harness"),U(s,"model")].filter(Boolean).join(" · ")||null},{label:"Machine",value:o?.authorityNodeName??o?.homeNodeName??o?.authorityNodeId??o?.homeNodeId??U(s,"machine","machineName","nodeName")}].filter(u=>!!u.value)}function Qe({party:s,route:t,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"?ve(s.label):e.jsx(Me,{route:t})}),e.jsx("span",{className:"sys-broker-endpoint-name",title:s.label,children:s.label})]})}function dr({attempt:s,agents:t}){const n=Ge(s,t,"from"),o=Ge(s,t,"to"),u=cr(s,n,o),h=`dispatch-route-${s.id}`;return e.jsxs("span",{className:"sys-broker-route",tabIndex:0,"aria-describedby":h,children:[e.jsx(Qe,{party:n,route:s.route,side:"from"}),e.jsx(Ke,{className:"sys-broker-route-arrow",size:11,"aria-hidden":"true"}),e.jsx(Qe,{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:ve(n.label)}),e.jsx("strong",{children:n.label}),e.jsx(Ke,{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?ve(o.label):e.jsx(Me,{route:s.route})}),e.jsx("strong",{children:o.label})]})}),e.jsx("span",{className:"sys-broker-endpoint-card-body",children:u.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 ge(s){const t=X(s)??0,n=new Date(t);return`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`}function ur(s,t=Date.now()){const n=X(s)??0,o=new Date(n),u=new Date(t),h=new Date(t);return h.setDate(h.getDate()-1),ge(s)===ge(u.getTime())?"Today":ge(s)===ge(h.getTime())?"Yesterday":o.toLocaleDateString(void 0,{month:"short",day:"numeric",year:o.getFullYear()===u.getFullYear()?void 0:"numeric"})}function hr(s,t,n){return{...t,source:s.source,attempts:[...s.attempts,...t.attempts],failedQueries:s.failedQueries,failedDeliveries:s.failedDeliveries,dialogue:s.dialogue,ledger:{...t.ledger,cursors:{...s.ledger.cursors,[n]:t.ledger.cursors[n]},hasMore:{...s.ledger.hasMore,[n]:t.ledger.hasMore[n]}}}}function fr({navigate:s,embedded:t=!1,initialAttemptId:n}){const{route:o,agents:u,selectedBrokerAttempt:h,inspectBrokerAttempt:b,clearBrokerAttempt:m}=Ve(),[k]=a.useState(()=>xs(Ce(),tr)),[c,N]=a.useState(k),R=o.view==="broker"?o.filter??"all":"all",[q,y]=a.useState(k===null),[f,S]=a.useState(!1),[K,le]=a.useState(!1),[Q,F]=a.useState(null),W=a.useRef(k),C=a.useRef(0),M=a.useRef(null),T=a.useCallback(async(i="initial")=>{const d=++C.current;!W.current&&i!=="background"?(y(!0),F(null)):S(!0);try{const j=await ne(Ce());if(d!==C.current)return;W.current=j,N(j),F(null)}catch(j){if(d!==C.current)return;F(j instanceof Error?j.message:String(j))}finally{d===C.current&&(y(!1),S(!1))}},[]),ce=a.useCallback(async()=>{const i=W.current;if(!i||K)return;const d="attempts",j=i.ledger.cursors[d];if(!j||!i.ledger.hasMore[d])return;const B=++C.current;le(!0),F(null);try{const z=await ne(Ce(j));if(B!==C.current)return;const ue=W.current,he=ue?hr(ue,z,d):z;W.current=he,N(he)}catch(z){if(B!==C.current)return;F(z instanceof Error?z.message:String(z))}finally{B===C.current&&le(!1)}},[K]),H=a.useCallback(()=>{M.current||(M.current=setTimeout(()=>{M.current=null,T("background")},250))},[T]);a.useEffect(()=>(T("initial"),()=>{M.current&&clearTimeout(M.current)}),[T]),ks(i=>{(i.kind==="message.posted"||i.kind==="delivery.planned"||i.kind==="delivery.attempted"||i.kind==="delivery.state.changed"||i.kind==="scout.dispatched")&&H()});const v=a.useMemo(()=>{if(!c)return[];const i=new Map(c.dialogue.map(d=>[d.id,d.body]));return vs(c.attempts).map(d=>{const j=d.messageId?i.get(d.messageId):null;return j&&j!==d.detail?{...d,detail:j}:d})},[c]),L=a.useMemo(()=>{switch(R){case"delivered":return v.filter(i=>!oe(i));case"failed":return v.filter(oe);default:return v}},[R,v]),Z=c?.ledger.hasMore.attempts??!1,ae=a.useMemo(()=>({all:v.length,delivered:v.filter(i=>!oe(i)).length,failed:v.filter(oe).length}),[v]),$=a.useMemo(()=>{const i=o.view==="broker"?o.attemptId:void 0;return!c||!i?null:v.find(d=>d.id===i)??c.attempts.find(d=>d.id===i)??c.failedQueries.find(d=>d.id===i)??c.failedDeliveries.find(d=>d.id===i)??null},[c,v,o]),D=$?`${$.id}\0${$.status}\0${$.ts}`:null,ee=h?`${h.id}\0${h.status}\0${h.ts}`:null;a.useEffect(()=>{$&&D!==ee&&b($)},[ee,b,$,D]);const[x,O]=a.useState(null),P=a.useRef(!1),J=a.useCallback(i=>{if(t){P.current=!0,O(i);return}b(i)},[t,b]),G=a.useCallback(()=>{if(t){P.current=!0,O(null);return}m()},[m,t]),de=a.useCallback(i=>{const d=L[i];d&&(J(d),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}})))},[L,J]),{getRowFocusProps:Se,setFocusedIndex:xe}=rr({enabled:!!c&&L.length>0,rowCount:L.length,onActivateRow:de,onClearSelection:G}),E=x?.id??null,se=x?`${x.id} ${x.status} ${x.ts}`:null;a.useEffect(()=>{if(!t||!E)return;const i=v.find(d=>d.id===E);i&&`${i.id} ${i.status} ${i.ts}`!==se&&O(i)},[t,E,se,v]),a.useEffect(()=>{if(!t||!n||!c||P.current||x)return;const i=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);i&&(P.current=!0,O(i))},[c,t,x,v,n]),a.useEffect(()=>{const i=o.view==="broker"?o.attemptId:void 0;if(!i)return;const d=L.findIndex(j=>j.id===i);d>=0&&xe(d)},[L,R,o,xe]);const A=a.useCallback(i=>{const j=(ye.indexOf(R)+i+ye.length)%ye.length,B=ye[j];s({view:"broker",...B==="all"?{}:{filter:B}})},[R,s]),I=t?x:null;return e.jsx("div",{className:`s-ops${t?" s-ops--embedded":""}${I?" 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:i=>{i.key==="ArrowRight"?(i.preventDefault(),A(1)):i.key==="ArrowLeft"&&(i.preventDefault(),A(-1))},children:ye.map(i=>e.jsxs("button",{type:"button",role:"tab","aria-selected":R===i,className:`sys-tab${R===i?" sys-tab-active":""}`,onClick:()=>s({view:"broker",...i==="all"?{}:{filter:i}}),children:[e.jsx("span",{children:ar[i]}),e.jsx("span",{className:"sys-tab-count",children:ae[i]})]},i))}):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:q?"Loading dispatch ledger...":c?`Updated ${$e(c.generatedAt)}${c.source?.latestMessageAt?` · latest message ${$e(c.source.latestMessageAt)}`:""}`:"Waiting for dispatch data"}),e.jsx("button",{type:"button",className:"s-btn",disabled:q||f,onClick:()=>{T("manual")},children:f?"Refreshing...":"Refresh"})]})]}),Q&&e.jsxs("div",{className:"sys-banner sys-banner-warning",children:[e.jsx("strong",{children:"Refresh failed."}),e.jsx("span",{children:Q})]}),f&&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…"})]}),!f&&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."})]}),q&&!c&&e.jsx(Ie,{title:"Loading dispatch",body:"Reading the dispatch database snapshot."}),!q&&!c&&!Q&&e.jsx(Ie,{title:"No dispatch data",body:"No dispatch rows are available yet."}),c&&e.jsxs(e.Fragment,{children:[e.jsx(mr,{attempts:L,agents:u,selectedAttemptId:t?x?.id??null:h?.id??(o.view==="broker"?o.attemptId??null:null),onInspect:J,getRowFocusProps:Se}),L.length>0&&Z&&e.jsx("div",{className:"sys-ledger-footer",children:e.jsx("button",{type:"button",className:"s-btn",disabled:K,onClick:()=>{ce()},children:K?"Loading older...":"Load older"})})]})]}),I&&e.jsx("div",{className:"s-broker-embed-detail",children:e.jsx(ts,{attempt:I,navigate:s,onClose:G})})]})})}function mr({attempts:s,agents:t,selectedAttemptId:n,onInspect:o,getRowFocusProps:u}){if(s.length===0)return e.jsx(Ie,{title:"No dispatch rows",body:"No dispatch rows are available yet."});const h=s.reduce((b,m,k)=>{const c=ge(m.ts),N=b[b.length-1];return N?.key===c?N.attempts.push({attempt:m,index:k}):b.push({key:c,label:ur(m.ts),attempts:[{attempt:m,index:k}]}),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:m,index:k})=>{const c=Fe(m.kind,m.status),N=oe(m),R=!N&&(c==="working"||c==="warning"),q=Ye(m),y=ss(m),f=N?q:R?y:null,S=()=>{o(m),window.dispatchEvent(new CustomEvent("scout:set-inspector-width",{detail:{width:520}}))};return e.jsxs("div",{role:"listitem",className:`sys-broker-wire-row${N?" sys-broker-wire-row--failure":R?" sys-broker-wire-row--pending":""}${n===m.id?" sys-broker-wire-row--selected":""}`,"aria-label":`${y}. Inspect ${m.detail}`,onClick:S,...u(k),children:[e.jsx("div",{className:"sys-broker-cell sys-broker-col--route",children:e.jsx(dr,{attempt:m,agents:t})}),e.jsxs("div",{className:"sys-broker-cell sys-broker-col--msg",children:[e.jsx("span",{className:"sys-broker-msg",title:m.detail,children:m.detail}),f&&e.jsx("span",{className:`sys-broker-msg-error sys-broker-msg-error--${N?"danger":"warning"}`,title:f,children:f})]}),e.jsx("div",{className:"sys-broker-cell sys-broker-col--time",children:e.jsx("time",{className:"sys-broker-time-abs",title:`${$e(m.ts)} · ${We(m.ts)}`,children:or(m.ts)})})]},m.id)})})]},b.key))]})}function pr(s){const t=es(s);return[{label:"Kind",value:nr(s.kind)},{label:"Time",value:We(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:t},{label:"Message",value:s.messageId===t?null:s.messageId},{label:"Delivery",value:s.deliveryId===t?null:s.deliveryId},{label:"Invocation",value:s.invocationId===t?null:s.invocationId}].filter(n=>!!n.value)}function ie({value:s,subject:t,className:n}){const[o,u]=a.useState("idle"),h=a.useRef(null);a.useEffect(()=>{u("idle")},[s]),a.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const b=a.useCallback(async()=>{const c=await js(s);h.current&&clearTimeout(h.current),u(c?"copied":"failed"),h.current=setTimeout(()=>{u("idle"),h.current=null},1500)},[s]),m=o==="copied",k=o==="failed";return e.jsx("button",{type:"button",className:`sys-copy-btn${n?` ${n}`:""}${m?" sys-copy-btn--copied":""}${k?" sys-copy-btn--failed":""}`,onClick:()=>{b()},title:m?`Copied ${t}`:k?"Copy failed":`Copy ${t}`,"aria-label":m?`Copied ${t}`:k?`Copy ${t} failed`:`Copy ${t}`,children:m?e.jsx(Os,{size:14,"aria-hidden":"true"}):e.jsx(_s,{size:14,"aria-hidden":"true"})})}function br(s){const t=s.trim();if(t.startsWith("{")||t.startsWith("["))try{return{code:JSON.stringify(JSON.parse(t),null,2),path:"payload.json",language:"JSON"}}catch{}return{code:s,path:"payload.md",language:"Text · Markdown"}}function yr({payload:s}){const t=a.useMemo(()=>br(s),[s]),[n,o]=a.useState(!1),u=a.useRef(null),h=t.code.split(`
2
- `).length;a.useEffect(()=>{const m=u.current;!m||!n||m.open||m.showModal()},[n]),a.useEffect(()=>{o(!1)},[s]);const b=e.jsx("div",{className:"sys-broker-payload-code","data-language":t.path==="payload.json"?"json":"markdown",role:"region","aria-label":`Dispatch payload, ${t.language}`,tabIndex:0,children:e.jsx(Es,{code:t.code,path:t.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:[t.language," · ",h," ",h===1?"line":"lines"]}),e.jsx(ie,{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(Hs,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-resizer",children:b}),n&&us.createPortal(e.jsxs("dialog",{ref:u,className:"sys-broker-payload-dialog","aria-label":"Expanded dispatch payload",onCancel:m=>{m.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:[t.language," · ",h," ",h===1?"line":"lines"]})]}),e.jsx(ie,{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(Js,{size:14,"aria-hidden":"true"})})]}),e.jsx("div",{className:"sys-broker-payload-dialog-body",children:b})]}),document.body)]})}function gr({attempt:s}){const t=As(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(De,{size:14})}),e.jsxs("div",{children:[e.jsx("span",{className:"sys-detail-label",children:"Routing stopped"}),e.jsx("strong",{children:t}),e.jsx("p",{children:s.detail})]}),e.jsx(ie,{value:s.detail,subject:"failure detail"})]})}function ts({attempt:s,navigate:t,onClose:n}){const{route:o,agents:u,scoutbotAgentId:h}=Ve(),b=pr(s),m=ws(s.metadata),k=oe(s),c=s.kind==="failed_query",N=Ye(s),R=Fe(s.kind,s.status),q=we(s,"sentAt","createdAt")??X(s.ts),y=we(s,"deliveredAt","completedAt")??X(s.ts),f=es(s),[S,K]=a.useState("idle"),[le,Q]=a.useState(null),[F,W]=a.useState(null),[C,M]=a.useState(""),[T,ce]=a.useState(""),[H,v]=a.useState("idle"),[L,Z]=a.useState(null),[ae,$]=a.useState(""),[D,ee]=a.useState(""),[x,O]=a.useState(""),[P,J]=a.useState(""),[G,de]=a.useState("medium"),[Se,xe]=a.useState(null),[E,se]=a.useState([]),[A,I]=a.useState("idle"),[i,d]=a.useState(null),j=U(s,"harness"),B=U(s,"model"),z=U(s,"reasoningEffort","effort"),ue=a.useRef(null),he=a.useRef(null),Re=a.useMemo(()=>Ns(s),[s]),w=a.useMemo(()=>u.filter(r=>!r.retiredFromFleet&&!r.staleLocalRegistration).slice().sort((r,l)=>r.id===h?-1:l.id===h?1:(l.updatedAt??0)-(r.updatedAt??0)||r.name.localeCompare(l.name)),[u,h]),fe=a.useMemo(()=>Ss(s,w)?.id??"",[s,w]),me=w.some(r=>r.id===h)?h:w[0]?.id??"",je=w[0]?.id??"",re=w.find(r=>r.id===me)??null,as=a.useMemo(()=>{const r=new Map;for(const l of w){const p=l.projectRoot?.trim()||l.cwd?.trim();if(!p)continue;const g=p.split("/").filter(Boolean).at(-1)??p;r.set(p,l.project?.trim()||g)}return[...r.entries()].map(([l,p])=>({path:l,label:p}))},[w]),Te=a.useRef({originalTargetAgentId:fe,firstRoutableAgentId:je,defaultForwardAgentId:me,defaultForwardAgent:re,effort:"medium"});Te.current={originalTargetAgentId:fe,firstRoutableAgentId:je,defaultForwardAgentId:me,defaultForwardAgent:re,effort:U(s,"reasoningEffort","effort")||"medium"};const pe=a.useRef(!1);a.useEffect(()=>{const r=Te.current;pe.current=!1,K("idle"),Q(null),W(null),M(""),ce(r.originalTargetAgentId||r.firstRoutableAgentId),v("idle"),Z(null),$(r.defaultForwardAgentId),ee(r.defaultForwardAgent?.projectRoot?.trim()||r.defaultForwardAgent?.cwd?.trim()||""),O(r.defaultForwardAgent?.harness?.trim()||""),J(r.defaultForwardAgent?.model?.trim()||""),de(r.effort),se([]),I("idle"),d(null)},[s.id]),a.useEffect(()=>{pe.current||(ce(r=>r||fe||je),$(r=>r||me),ee(r=>r||re?.projectRoot?.trim()||re?.cwd?.trim()||""),O(r=>r||re?.harness?.trim()||""),J(r=>r||re?.model?.trim()||""))},[re,me,je,fe]),a.useEffect(()=>{const r=new URLSearchParams({scope:"global+project"});D&&r.set("projectRoot",D);let l=!1;return ne(`/api/runner/options?${r.toString()}`).then(p=>{!l&&p.schemaVersion==="openscout.runtime-capabilities.v1"&&xe(p)}).catch(()=>{}),()=>{l=!0}},[D]);const ns=a.useCallback(r=>{M(r),window.requestAnimationFrame(()=>ue.current?.focus())},[]),os=a.useCallback(async()=>{const r=w.find(l=>l.id===T);if(!(!r||H==="sending")){v("sending"),Z(null);try{const l=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:s.detail,targetAgentId:r.id,targetLabel:r.name,...j||B||z?{execution:{...j?{harness:j}:{},...B?{model:B}:{},...z?{reasoningEffort:z}:{},session:"new"}}:{},metadata:{source:"scout-dispatch-redispatch",originalDispatchId:s.id,...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),p=l.flightId??l.flight?.id;v("sent"),Z(`New dispatch sent to ${r.name}${p?` · ${p}`:""}`)}catch(l){v("failed"),Z(`Retry failed. ${l instanceof Error?l.message:String(l)}`)}}},[s,T,H,z,j,B,w]),Le=a.useCallback(async()=>{const r=C.trim(),l=w.find(p=>p.id===ae);if(!(!r||!l||A==="sending")){I("sending"),d(E.length>0?`Uploading ${E.length} ${E.length===1?"attachment":"attachments"}…`:null);try{const p=E.length>0?await fs(E):[],g=await ne("/api/ask",{method:"POST",body:JSON.stringify({body:`${r}
3
-
4
- Attached dispatch context:
5
- ${Re}`,targetAgentId:l.id,targetLabel:l.name,...p.length>0?{attachments:p}:{},execution:{...x?{harness:x}:{},...P?{model:P}:{},...G?{reasoningEffort:G}:{}},metadata:{source:"scout-dispatch-forward",originalDispatchId:s.id,...D?{targetProjectPath:D}:{},...s.messageId?{originalMessageId:s.messageId}:{},...s.conversationId?{originalConversationId:s.conversationId}:{}}})}),V=g.flightId??g.flight?.id;I("sent"),d(`Request sent to ${l.name}${V?` · ${V}`:""}`),M(""),se([])}catch(p){I("failed"),d(`Request wasn't sent. ${p instanceof Error?p.message:String(p)}`)}}},[s,Re,ae,G,E,x,P,D,A,C,w]),is=a.useCallback(r=>{const l=r.filter(ms),p=r.length-l.length;l.length>0&&(se(g=>[...g,...l]),I("idle"),d(null)),p>0&&(I("failed"),d("Attach markdown, code, an image, or a video clip."))},[]),ls=k?["Get a second opinion","Propose a recovery plan","Draft a follow-up"]:["Summarize this dispatch","Draft a follow-up","What changed?"],_=w.find(r=>r.id===T)??null,te=w.find(r=>r.id===ae)??null,be=w.filter(r=>D?(r.projectRoot?.trim()||r.cwd?.trim())===D:!0),Pe=Se??bs,Ae=a.useMemo(()=>{const r=ps(Pe),l=[P,te?.harness===x?te.model:null,...be.filter(g=>g.harness===x).map(g=>g.model)].map(g=>g?.trim()).filter(g=>!!g);let p=r.harnesses;return p.some(g=>g.value===x)||(p=[{value:x,label:x||"default",models:[]},...p]),p=p.map(g=>{if(g.value!==x)return g;const V=g.models.some(Y=>Y.value==="")?g.models:[{value:"",label:"Default",note:"harness picks"},...g.models],ds=new Set(V.map(Y=>Y.value)),qe=l.filter(Y=>!ds.has(Y)).map(Y=>({value:Y,label:Y,note:"observed"}));return qe.length===0&&V===g.models?g:{...g,models:[...V,...qe]}}),{...r,harnesses:p}},[Pe,te,x,P,be]);a.useEffect(()=>{const r=ys(Ae,x);!r||r.some(l=>l.value===G)||de(r.find(l=>l.value==="medium")?.value??r[0]?.value??"")},[Ae,x,G]);const cs=a.useCallback(async()=>{K("running"),Q(null);try{const r=await ne("/api/broker/dispatch-review",{method:"POST",body:JSON.stringify(Rs(s))});K("sent"),W(r.conversationId),Q(r.conversationId?`Report started${r.targetLabel?` with ${r.targetLabel}`:""}. Open the conversation to follow it.`:`Report started${r.targetLabel?` with ${r.targetLabel}`:""}${r.flightId?` · ${r.flightId}`:""}.`)}catch(r){K("failed"),Q(`Couldn't start the report. ${r instanceof Error?r.message:String(r)}`)}},[s]),Be=k?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-report-title",children:"Failure report"}),e.jsxs("button",{type:"button",className:"sys-broker-report-button",disabled:S==="running"||S==="sent"&&!F,onClick:()=>{if(F){Oe(t,{view:"conversation",conversationId:F},{returnTo:o});return}cs()},children:[S==="running"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):F?e.jsx(Ue,{size:13,"aria-hidden":"true"}):e.jsx(Gs,{size:13,"aria-hidden":"true"}),S==="running"?"Starting report…":F?"Open report conversation":"Start failure report"]})]}),le&&e.jsx("div",{className:`sys-broker-review-status sys-broker-review-status--${S}`,role:"status",children:le})]}):null,ze=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:T,disabled:H==="sending"||w.length===0,onChange:r=>{ce(r.target.value),v("idle"),Z(null)},children:w.length===0?e.jsx("option",{value:"",children:"No agents available"}):e.jsxs(e.Fragment,{children:[!T&&e.jsx("option",{value:"",children:"Original destination unavailable"}),w.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:!_||H==="sending",onClick:()=>{os()},children:[H==="sending"?e.jsx(ke,{size:13,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(Ms,{size:13,"aria-hidden":"true"}),H==="sending"?"Retrying…":"Retry dispatch"]})]})]}),_&&e.jsxs("div",{className:"sys-broker-action-target-meta",children:[_.harness&&e.jsx("span",{children:_.harness}),_.model&&e.jsx("span",{children:_.model}),(_.cwd??_.projectRoot)&&e.jsx("code",{children:_.cwd??_.projectRoot})]}),L&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${H}`,role:"status",children:L})]});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--${R}`,"aria-hidden":"true"}),e.jsx("strong",{className:`sys-broker-state sys-broker-state--${R}`,children:ss(s)}),e.jsx("code",{title:f,children:f}),e.jsx(ie,{value:Re,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(De,{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:ve(s.actorName)}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["From · ",Ee(s,"from")]}),e.jsx("strong",{children:s.actorName??"Unknown sender"})]})]}),e.jsx(Ts,{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(Me,{route:s.route})}),e.jsxs("div",{className:"sys-broker-route-party-copy",children:[e.jsxs("span",{className:"sys-detail-label",children:["To · ",Ee(s,"to")]}),e.jsx("code",{title:s.target??"No target",children:s.target??"No target"})]}),s.conversationId&&e.jsxs("button",{type:"button",className:"sys-broker-route-button",onClick:()=>Oe(t,{view:"conversation",conversationId:s.conversationId},{returnTo:o}),children:[e.jsx(Ue,{size:11,"aria-hidden":"true"}),"Route"]})]})]}),e.jsxs("dl",{className:"sys-broker-delivery-grid",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Channel"}),e.jsx("dd",{children:rs(s.route)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Latency"}),e.jsx("dd",{className:"sys-broker-delivery-accent",children:ir(s)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Sent"}),e.jsx("dd",{children:Je(q)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:k?"Failed":"Delivered"}),e.jsx("dd",{children:Je(y)})]})]}),e.jsxs("section",{className:"sys-broker-payload",children:[c?e.jsx(gr,{attempt:s}):e.jsx(yr,{payload:s.detail}),k&&!c&&N&&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:N})]})]}),e.jsx(Is,{attempt:s,targetAgentId:fe||null,navigate:t,returnTo:o}),e.jsx("section",{className:"sys-broker-actions","aria-label":"Dispatch actions",children:c?e.jsxs(e.Fragment,{children:[Be,ze]}):e.jsxs(e.Fragment,{children:[ze,Be]})}),e.jsxs("details",{className:"sys-broker-technical",children:[e.jsxs("summary",{children:[e.jsx("span",{children:"Technical details"}),e.jsx(Ls,{size:13,"aria-hidden":"true"})]}),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(ie,{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(ie,{value:m,subject:"metadata",className:"sys-broker-metadata-copy"})]}),e.jsx(Cs,{metadata:s.metadata,rawJson:m})]})]})]}),e.jsxs("section",{className:"sys-broker-forward","aria-labelledby":"dispatch-forward-title",children:[e.jsx("div",{className:"sys-broker-forward-head",children:e.jsx("span",{id:"dispatch-forward-title",className:"sys-broker-action-label",children:"Follow up"})}),e.jsxs("div",{id:"dispatch-forward-content",children:[e.jsx("div",{className:"sys-broker-forward-intro",children:e.jsx("div",{className:"sys-broker-ask-prompts","aria-label":"Suggested requests",children:ls.map(r=>e.jsxs("button",{type:"button",onClick:()=>ns(r),children:[e.jsx(Ps,{size:11,"aria-hidden":"true"}),r]},r))})}),e.jsxs("form",{className:"sys-broker-message-composer",onSubmit:r=>{r.preventDefault(),Le()},children:[e.jsx("label",{htmlFor:"dispatch-message-input",children:"Request"}),e.jsx("textarea",{ref:ue,id:"dispatch-message-input",value:C,rows:3,placeholder:`What should ${te?.id===h?"Scout":te?.name??"this agent"} investigate or do?`,disabled:A==="sending",onChange:r=>{M(r.target.value),A!=="idle"&&(I("idle"),d(null))},onKeyDown:r=>{r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),Le())}}),E.length>0&&e.jsx("div",{className:"sys-broker-composer-attachments","aria-label":"Attachments",children:E.map((r,l)=>e.jsxs("span",{children:[e.jsx(Bs,{size:10,"aria-hidden":"true"}),e.jsx("span",{title:r.name,children:r.name}),e.jsx("button",{type:"button",onClick:()=>se(p=>p.filter((g,V)=>V!==l)),"aria-label":`Remove ${r.name}`,children:e.jsx(De,{size:10,"aria-hidden":"true"})})]},`${r.name}:${r.size}:${l}`))}),e.jsxs("footer",{children:[e.jsxs("div",{className:"sys-broker-composer-left",children:[e.jsx("input",{ref:he,type:"file",multiple:!0,hidden:!0,disabled:A==="sending",onChange:r=>{is([...r.target.files??[]]),r.target.value=""}}),e.jsx("button",{type:"button",className:"sys-broker-composer-attach",disabled:A==="sending",onClick:()=>he.current?.click(),"aria-label":"Attach files",title:"Attach files",children:e.jsx(zs,{size:16,"aria-hidden":"true"})}),e.jsx("span",{className:"sys-broker-message-attachment",title:f,children:"Dispatch context included"})]}),e.jsxs("div",{className:"sys-broker-composer-targets",children:[e.jsx("span",{className:"sys-broker-composer-route-label",children:"Send to"}),e.jsxs("label",{title:"Project target",children:[e.jsx("span",{children:"Project"}),e.jsxs("select",{"aria-label":"Project target",value:D,disabled:A==="sending",onChange:r=>{const l=r.target.value,p=w.find(g=>!l||(g.projectRoot?.trim()||g.cwd?.trim())===l)??null;pe.current=!0,ee(l),p&&($(p.id),O(p.harness?.trim()||""),J(p.model?.trim()||""))},children:[e.jsx("option",{value:"",children:"Any project"}),as.map(r=>e.jsx("option",{value:r.path,children:r.label},r.path))]})]}),e.jsxs("label",{title:"Agent target",children:[e.jsx("span",{children:"Agent"}),e.jsx("select",{"aria-label":"Agent target",value:ae,disabled:A==="sending"||be.length===0,onChange:r=>{const l=w.find(p=>p.id===r.target.value)??null;pe.current=!0,$(r.target.value),l&&(ee(l.projectRoot?.trim()||l.cwd?.trim()||""),O(l.harness?.trim()||""),J(l.model?.trim()||"")),I("idle"),d(null)},children:be.length===0?e.jsx("option",{value:"",children:"No agents"}):be.map(r=>e.jsx("option",{value:r.id,children:r.id===h?"Scout":r.name},r.id))})]}),e.jsx(gs,{catalog:Ae,value:{harness:x,model:P,effort:G},onChange:r=>{pe.current=!0,O(r.harness),J(r.model),de(r.effort)},disabled:A==="sending"}),e.jsx(hs,{className:"sys-broker-composer-mic",disabled:A==="sending",onAppend:r=>M(l=>l.trim()?`${l.trimEnd()} ${r}`:r),onError:r=>{I("failed"),d(r)}})]}),e.jsx("button",{type:"submit",className:"sys-broker-composer-send",disabled:!C.trim()||!te||A==="sending","aria-label":`Ask ${te?.name??"recipient"} about this dispatch`,children:A==="sending"?e.jsx(ke,{size:14,className:"sys-broker-action-spinner","aria-hidden":"true"}):e.jsx(qs,{size:14,"aria-hidden":"true"})})]})]}),i&&e.jsx("div",{className:`sys-broker-action-status sys-broker-action-status--${A}`,role:"status",children:i})]})]})]})}const xr=Fs({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 t=s.get("attempt")?.trim();return t?{initialAttemptId:t}:{}},hosts:{macos:!0}}}),tt=Object.freeze(Object.defineProperty({__proto__:null,BrokerAttemptInspector:ts,BrokerScreen:fr,scoutSurface:xr},Symbol.toStringTag,{value:"Module"}));export{ts as B,fr as a,Ce as b,tt as c};
@@ -1 +0,0 @@
1
- import{r as s,j as r}from"./index-DvLtl7rV.js";import{a as G}from"./api-Co9aQ2Jw.js";import{c as je}from"./clipboard-e3fSpeo7.js";import{f as ze}from"./scoutbot-BJIamJOH.js";import{g as Ae,f as Ce}from"./api-HFH8wFyb.js";import{d as Ke}from"./types-B0PlfpKc.js";import{r as Oe,C as He}from"./CodeDiffPane-n7W4iGUG.js";import{r as qe,a as Ge,w as Ve,b as Xe,f as xe,C as Je,s as Qe}from"./CodeProjectPicker-CMsbSTDq.js";import{ShikiPane as Ye}from"./ShikiPane-DYI9Hkge.js";/* empty css */import{A as Ze}from"./arrow-left-Czpf-AE4.js";import{C as et}from"./chevron-right-D-HdlPg8.js";import{C as tt}from"./check-ofKUE8yH.js";import{C as nt}from"./copy-CWWAJ75H.js";import"./perf-PX8Rx0EP.js";import"./cache-CeWH_KzJ.js";import"./usePierreRuntime-ejq9dCWV.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";/* empty css */import"./chevron-down-wciXnOQz.js";import"./createLucideIcon-DezKXSG2.js";import"./search-CDko0PKE.js";const st=new Set(["node_modules",".git","dist",".next",".build","DerivedData","__pycache__",".venv","target"]);function we(i){const l=i.lastIndexOf("/");return l>0?i.slice(0,l):"/"}function ce(i){const l=i.lastIndexOf("/");return l>=0?i.slice(l+1):i}function V(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function S(i){return i.toLowerCase().replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function rt(i,l,k){const g=S(l),f=i.projects.find(u=>S(u.name)===g||S(ce(u.root))===g);if(!f)return null;const x=k?f.worktrees.find(u=>u.name===k||u.branch.name===k||S(u.name)===S(k)):f.worktrees[0];return{projectName:f.name,root:x?.path??f.root}}function ye(i,l){if(!l.startsWith(`${i}/`))return[];const k=l.slice(i.length+1).split("/"),g=[];let f=i;for(const x of k.slice(0,-1))f=`${f}/${x}`,g.push(f);return g}function it(i){switch(i){case"untracked":return"U";case"conflicted":return"C";case"staged":return"S";case"unstaged":return"M";case"staged+unstaged":return"SM";default:return i.charAt(0).toUpperCase()}}function be(i,l,k,g,f){const x=k.get(i);if(!x){f.push({path:`${i}#loading`,name:"Loading…",kind:"file",depth:l,loading:!0});return}for(const u of x)u.kind==="directory"&&st.has(u.name)||(f.push({path:u.path,name:u.name,kind:u.kind,depth:l}),u.kind==="directory"&&g.has(u.path)&&be(u.path,l+1,k,g,f))}function Rt({route:i,navigate:l,root:k,file:g,project:f,path:x,wt:u,line:Le,endLine:Ne,returnConversationId:Re,embedded:X=!1}){const I=k??i?.root??null,B=g??i?.file??null,p=f??i?.project??null,b=x??i?.path??null,P=u??i?.wt??null,j=Le??i?.line,w=Ne??i?.endLine,C=Re??i?.returnConversationId??null,[h,le]=s.useState(()=>Ae()),[o,J]=s.useState(()=>I??(p?null:qe())),[y,Q]=s.useState(()=>new Map),[L,U]=s.useState(()=>new Set),[de,ue]=s.useState(null),[a,W]=s.useState(B),[c,_]=s.useState(null),[Ee,Y]=s.useState(!1),[fe,z]=s.useState(null),[pe,Z]=s.useState("idle"),[M,ee]=s.useState("source"),[m,te]=s.useState(()=>j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null),[N,A]=s.useState(()=>p?{phase:"resolving"}:{phase:"idle"}),ne=p?`${p}\0${b??""}\0${P??""}`:null,R=s.useRef(null),se=s.useRef(null),T=s.useRef(ne);T.current!==ne&&(T.current=ne,R.current=null,se.current=null),s.useEffect(()=>{te(j&&j>0?{line:j,...w&&w>=j?{endLine:w}:{}}:null)},[w,j]),s.useEffect(()=>{if(h)return;let e=!1;return Ce("quick",!1,2e4).then(t=>{e||le(t)}).catch(()=>{}),()=>{e=!0}},[h]);const E=s.useCallback(async e=>{try{const t=await G(`/api/file/preview?path=${encodeURIComponent(e)}`);if(t.kind!=="directory")return;const n=t.entries.map(d=>({name:d.name,path:d.path,kind:d.kind}));Q(d=>new Map(d).set(e,n))}catch(t){ue(t instanceof Error?t.message:String(t))}},[]),$=s.useCallback((e,t)=>{if(!t)return;const n=ye(e,t);if(n.length!==0){U(d=>new Set([...d,...n]));for(const d of n)E(d)}},[E]);s.useEffect(()=>{if(!p)return;const e=`${p}\0${b??""}\0${P??""}`;if(R.current===e)return;const t=n=>{R.current=e;const d=b?`${n}/${b}`:null;A({phase:"idle"}),J(n),W(d),$(n,d)};if(h){const n=rt(h,p,P);if(n){t(n.root);return}}se.current!==e&&(A({phase:"resolving"}),G(`/api/code/resolve-project?slug=${encodeURIComponent(p)}`).then(n=>{R.current===e||T.current!==e||t(n.root)}).catch(n=>{if(R.current===e||T.current!==e)return;se.current=e;const d=n instanceof Error?n.message:String(n);A({phase:"failed",message:d.includes(p)?d:`Can't resolve project "${p}": ${d}`})}))},[p,b,P,h,$]),s.useEffect(()=>{if(o||p||!h)return;const e=h.projects[0];e&&J(e.worktrees[0]?.path??e.root)},[o,p,h]);const he=s.useRef(a);he.current=a,s.useEffect(()=>{if(!o)return;ue(null);const e=Ge(o),t=he.current,n=t?ye(o,t):[];e?(Q(new Map(Object.entries(e.entries))),U(new Set([...e.expanded,...n])),!t&&e.selectedFile&&W(e.selectedFile)):(Q(new Map),U(new Set(n)));const d=new Set([o,...e?.expanded??[],...n]);for(const ae of d)E(ae);Ce("quick",!1,2e4).then(le).catch(()=>{})},[o,E]),s.useEffect(()=>{!o||y.size===0||(Ve(o,{entries:y,expanded:L,selectedFile:a}),Xe(o))},[o,y,L,a]),s.useEffect(()=>{!I||!B||$(I,B)},[I,B,$]);const re=s.useRef(new Map),ie=s.useRef(new Set),$e=3e4,K=s.useCallback(e=>{const t=re.current.get(e);return t?Date.now()-t.at>$e?(re.current.delete(e),null):t.preview:null},[]),O=s.useCallback((e,t)=>{const n=re.current;if(n.set(e,{at:Date.now(),preview:t}),n.size>80){const d=n.keys().next().value;d&&n.delete(d)}},[]),Fe=s.useCallback(e=>{K(e)||ie.current.has(e)||(ie.current.add(e),G(`/api/file/preview?path=${encodeURIComponent(e)}`).then(t=>O(e,t)).catch(()=>{}).finally(()=>ie.current.delete(e)))},[K,O]);s.useEffect(()=>{if(Z("idle"),!a){_(null),z(null);return}const e=K(a);if(e){_(e.kind==="file"?e:null),z(null),Y(!1);return}let t=!1;return Y(!0),z(null),G(`/api/file/preview?path=${encodeURIComponent(a)}`).then(n=>{t||(O(a,n),_(n.kind==="file"?n:null))}).catch(n=>{t||(_(null),z(n instanceof Error?n.message:String(n)))}).finally(()=>{t||Y(!1)}),()=>{t=!0}},[a,K,O]);const Me=s.useMemo(()=>{if(!o)return[];const e=[];return be(o,0,y,L,e),e},[o,y,L]),me=s.useCallback((e,t)=>{const n=C?{returnConversationId:C}:{};if(h){for(const d of h.projects)for(const[ae,ge]of d.worktrees.entries())if(ge.path===e){const ve=t&&t.startsWith(`${e}/`)?t.slice(e.length+1):void 0;return{view:"code",project:S(d.name),...ve?{path:ve}:{},...ae>0?{wt:ge.name}:{},...n}}}return{view:"code",root:e,...t?{file:t}:{},...n}},[C,h]),oe=s.useCallback(()=>{if(!C)return;const e={view:"conversation",conversationId:C};ze({type:"navigate",route:e})||l?.(e)},[l,C]);s.useEffect(()=>{if(!C)return;const e=t=>{if(!t.defaultPrevented&&!(!t.metaKey||t.key!=="[")){if(t.target instanceof HTMLElement){const n=t.target.tagName;if(n==="INPUT"||n==="TEXTAREA"||t.target.isContentEditable)return}t.preventDefault(),oe()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[C,oe]);const H=s.useCallback((e,t)=>{X||!l||l(me(e,t))},[X,l,me]),Te=s.useCallback(e=>{U(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),y.has(e)||E(e)},[y,E]),De=s.useCallback(e=>{te(null),W(e),o&&H(o,e)},[o,H]),v=s.useMemo(()=>{if(!h||!o)return null;for(const e of h.projects)for(const t of e.worktrees)if(t.path===o)return{project:e,worktree:t};return null},[h,o]),F=s.useMemo(()=>{const e=new Map;if(!o||!v)return e;for(const t of v.worktree.status.files)e.set(`${o}/${t.path}`,t.status);return e},[o,v]),Ie=s.useMemo(()=>{const e=new Set;if(!o)return e;for(const t of F.keys()){let n=we(t);for(;n.startsWith(o)&&(e.add(n),n!==o);)n=we(n)}return e},[o,F]),q=!!(o&&a&&Oe(o,a));s.useEffect(()=>{q||ee("source")},[q]);const Be=a&&o&&a.startsWith(`${o}/`)?a.slice(o.length+1):c?.kind==="file"?c.title:a?ce(a):null,Pe=s.useCallback(async()=>{if(!c||c.kind!=="file"||!c.previewable)return;await je(c.content)&&(Z("copied"),window.setTimeout(()=>Z("idle"),1500))},[c]),[Ue,ke]=s.useState("idle"),D=s.useMemo(()=>{if(!o)return null;if(v){const e=a&&a.startsWith(`${o}/`)?a.slice(o.length+1):void 0,t=v.project.worktrees[0]?.path;return xe({project:S(v.project.name),...e?{path:e}:{},...t&&t!==o?{wt:v.worktree.name}:{},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})}return xe({...a?{file:a}:{root:o},...m?.line?{line:m.line}:{},...m?.endLine?{endLine:m.endLine}:{}})},[o,a,v,m]),We=s.useCallback(async()=>{if(!D)return;await je(D)&&(ke("copied"),window.setTimeout(()=>ke("idle"),1500))},[D]),_e=s.useCallback(e=>{R.current=T.current,A({phase:"idle"}),te(e.line&&e.line>0?{line:e.line,...e.endLine&&e.endLine>=e.line?{endLine:e.endLine}:{}}:null),W(e.file??null),J(e.root),e.file&&$(e.root,e.file),H(e.root,e.file??null)},[$,H]);return r.jsxs("div",{className:"s-code-screen","data-embedded":X||void 0,children:[r.jsxs("div",{className:"s-code-head",children:[C?r.jsxs("button",{type:"button",className:"s-code-returnThread",onClick:oe,title:"Back to thread (⌘[)",children:[r.jsx(Ze,{size:13,strokeWidth:1.9,"aria-hidden":!0}),r.jsx("span",{children:"Back to thread"})]}):null,r.jsx(Je,{snapshot:h,root:o,onSelect:_e}),v?.worktree.diff.branchShortstat?r.jsx("span",{className:"s-code-headStat",children:v.worktree.diff.branchShortstat}):null,o?r.jsx("span",{className:"s-code-headPath",title:o,children:Qe(o)}):null,D?r.jsx("button",{type:"button",className:"s-code-copyLink",title:D,onClick:()=>{We()},children:Ue==="copied"?"Copied scout://":"Copy scout://"}):null]}),r.jsxs("div",{className:"s-code-body",children:[r.jsx("div",{className:"s-code-tree",role:"tree","aria-label":"Files",children:de?r.jsx("div",{className:"s-code-treeNote",children:de}):o?Me.map(e=>e.loading?r.jsx("div",{className:"s-code-node s-code-node--loading",style:{paddingLeft:10+e.depth*14},children:e.name},e.path):r.jsxs("button",{type:"button",role:"treeitem",className:"s-code-node","data-selected":e.path===a||void 0,"data-diff":e.kind==="file"?F.get(e.path):void 0,"aria-expanded":e.kind==="directory"?L.has(e.path):void 0,style:{paddingLeft:10+e.depth*14},onClick:()=>e.kind==="directory"?Te(e.path):De(e.path),onMouseEnter:e.kind==="file"?()=>Fe(e.path):void 0,children:[e.kind==="directory"?r.jsx(et,{size:11,strokeWidth:2,className:"s-code-nodeChevron","data-open":L.has(e.path)||void 0,"aria-hidden":!0}):r.jsx("span",{className:"s-code-nodeSpacer","aria-hidden":!0}),r.jsx("span",{className:"s-code-nodeName",children:e.name}),e.kind==="file"&&F.has(e.path)?r.jsx("span",{className:"s-code-nodeBadge","data-diff":F.get(e.path),children:it(F.get(e.path)??"")}):null,e.kind==="directory"&&Ie.has(e.path)?r.jsx("span",{className:"s-code-nodeDot","aria-label":"Contains changes"}):null]},e.path)):N.phase==="resolving"?r.jsxs("div",{className:"s-code-treeNote",children:["Resolving “",p,"”…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-treeNote",children:N.message}):r.jsx("div",{className:"s-code-treeNote",children:"No repo selected."})}),r.jsxs("div",{className:"s-code-main",children:[a?r.jsxs("div",{className:"s-code-fileHead",children:[r.jsx("span",{className:"s-code-filePath",children:Be}),q?r.jsxs("div",{className:"s-code-fileMode",role:"tablist","aria-label":"File view",children:[r.jsx("button",{type:"button",role:"tab","aria-selected":M==="source","data-selected":M==="source"||void 0,onClick:()=>ee("source"),children:"Source"}),r.jsx("button",{type:"button",role:"tab","aria-selected":M==="changes","data-selected":M==="changes"||void 0,onClick:()=>ee("changes"),children:"Changes"})]}):null,c?.kind==="file"?r.jsxs("span",{className:"s-code-fileMeta",children:[V(c.sizeBytes),c.previewable&&c.truncated?" · truncated":"",m?` · L${m.line}${m.endLine?`–${m.endLine}`:""}`:""]}):null,c?.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"s-code-fileAction",onClick:()=>{Pe()},title:"Copy file contents",children:[pe==="copied"?r.jsx(tt,{size:12,"aria-hidden":!0}):r.jsx(nt,{size:12,"aria-hidden":!0}),pe==="copied"?"Copied":"Copy"]}),r.jsx("a",{className:"s-code-fileAction",href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"Raw"})]}):null]}):null,M==="changes"&&q&&o&&a?r.jsx(He,{root:o,file:a},`${o}\0${a}`):Ee?r.jsxs("div",{className:"s-code-empty",children:["Loading ",a?ce(a):"file","…"]}):fe?r.jsx("div",{className:"s-code-empty",children:fe}):c&&c.kind==="file"&&c.previewable?r.jsxs(r.Fragment,{children:[c.truncated?r.jsxs("div",{className:"s-code-fileNote",children:["Showing the first ",V(256*1024)," of ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):null,r.jsx(Ye,{code:c.content,path:c.path,focusLine:m?.line,endLine:m?.endLine})]}):c&&c.kind==="file"?r.jsxs("div",{className:"s-code-empty",children:[c.previewReason," · ",V(c.sizeBytes)," ·"," ",r.jsx("a",{href:c.rawUrl,target:"_blank",rel:"noreferrer",children:"open raw"})]}):N.phase==="resolving"?r.jsxs("div",{className:"s-code-empty",children:["Opening ",b??`“${p}”`,"…"]}):N.phase==="failed"?r.jsx("div",{className:"s-code-empty",children:N.message}):r.jsx("div",{className:"s-code-empty",children:"Pick a file to read."})]})]})]})}const Et=Ke({id:"code",label:"Code Browser",route:{view:"code"},webPath:"/code",screen:"CodeContent",embed:{path:"/embed/code",profile:"macos.code",rootClassName:"s-code-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:i=>({root:i.get("root")?.trim()||void 0,file:i.get("file")?.trim()||void 0,project:i.get("project")?.trim()||void 0,path:i.get("path")?.trim()||void 0,wt:i.get("wt")?.trim()||void 0,line:Se(i.get("line")),endLine:Se(i.get("endLine")),returnConversationId:i.get("fromConversation")?.trim()||void 0})}});function Se(i){if(!i)return;const l=Number.parseInt(i,10);return Number.isSafeInteger(l)&&l>0?l:void 0}export{Rt as CodeContent,Et as scoutSurface};
@@ -1 +0,0 @@
1
- import{r as h,j as e}from"./index-DvLtl7rV.js";import{A as G}from"./AgentAvatar-6-KBVKUu.js";import{M as J}from"./text-BP3oyl8-.js";import{j as Y,k as ee,l as O,m as se,M as _}from"./NewChatComposer-_Stj0fZy.js";import{F as te}from"./file-text-CqJgwxmv.js";import"./index-zvhpRHao.js";import{c as I}from"./createLucideIcon-DezKXSG2.js";import{Z as ae}from"./zap-Cq8eWkcF.js";import{X as ne}from"./x-CAbNespN.js";const re=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],oe=I("pencil",re);const ce=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],ie=I("reply",ce),U="Only markdown, code, images, and video clips can be attached.";function we(){const[t,c]=h.useState([]),[g,x]=h.useState(null),[d,p]=h.useState(null),[i,j]=h.useState(0),n=h.useRef(null),f=h.useCallback((r,l="Attached")=>{const m=r.filter(Y);return m.length===0?(r.length>0&&p(U),0):(p(null),c(v=>{const F=new Set(v.map(u=>`${u.name}:${u.size}:${u.lastModified}`)),R=m.filter(u=>!F.has(`${u.name}:${u.size}:${u.lastModified}`));return R.length>0?[...v,...R]:v}),x(m.length===1?`${l} ${m[0]?.name??"1 attachment"}.`:`${l} ${m.length} attachments.`),m.length)},[]),b=h.useCallback(r=>{c(l=>l.filter(m=>m!==r)),x(null)},[]),$=h.useCallback(()=>{c([]),x(null),p(null),j(0)},[]),y=h.useCallback(()=>{n.current?.click()},[]),E=h.useCallback(r=>{const l=ee(r.clipboardData);l.length!==0&&(r.preventDefault(),f(l,"Pasted"))},[f]),k=h.useMemo(()=>({onDragOver:r=>{O(r.dataTransfer)&&(r.preventDefault(),j(l=>l===0?1:l))},onDragLeave:r=>{r.currentTarget.contains(r.relatedTarget)||j(0)},onDrop:r=>{if(!O(r.dataTransfer))return;r.preventDefault(),j(0);const l=se(r.dataTransfer);if(l.length===0){p(U);return}f(l,"Dropped")}}),[f]);return{files:t,hasFiles:t.length>0,feedback:g,error:d,dragActive:i>0,stage:f,remove:b,clear:$,setError:p,openPicker:y,dropHandlers:k,onPaste:E,inputRef:n}}function le(t){if(t<1024)return`${t} B`;const c=t/1024;return c<1024?`${c.toFixed(0)} KB`:`${(c/1024).toFixed(1)} MB`}function de(t){return(t.split(".").pop()?.toUpperCase()??"FILE").slice(0,4)}function me({file:t,onRemove:c}){const g=h.useMemo(()=>URL.createObjectURL(t),[t]);h.useEffect(()=>()=>URL.revokeObjectURL(g),[g]);const x=t.type.startsWith("video/"),d=t.type.startsWith("image/"),p=de(t.name),i=le(t.size);return e.jsxs("div",{className:"s-msg-compose-attachment surface-card surface-card--inset",children:[x?e.jsx("video",{src:g,muted:!0,playsInline:!0}):d?e.jsx("img",{src:g,alt:t.name}):e.jsxs("div",{className:"s-msg-compose-attachment-file",title:`${t.name} (${i})`,children:[e.jsxs("div",{className:"s-msg-compose-attachment-file-icon",children:[e.jsx(te,{size:16,"aria-hidden":"true"}),e.jsx("span",{className:"s-msg-compose-attachment-ext label-xs",children:p})]}),e.jsx("span",{className:"s-msg-compose-attachment-name",children:t.name}),e.jsx("span",{className:"s-msg-compose-attachment-size label-xs text-dim",children:i})]}),e.jsx("button",{type:"button",className:"s-msg-compose-attachment-remove btn btn--ghost btn--icon","aria-label":`Remove ${t.name}`,title:`Remove ${t.name}`,onClick:c,children:"×"})]})}function ue({attachments:t,accept:c="image/*,video/*,text/markdown,.md,.markdown,text/plain,.txt"}){const{files:g,feedback:x,error:d,remove:p,stage:i,inputRef:j}=t;return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:j,type:"file",multiple:!0,accept:c,className:"s-msg-compose-file-input",onChange:n=>{i([...n.target.files??[]]),n.target.value=""}}),g.length>0?e.jsx("div",{className:"s-msg-compose-attachments","aria-label":"Staged attachments",children:g.map(n=>e.jsx(me,{file:n,onRemove:()=>p(n)},`${n.name}:${n.size}:${n.lastModified}`))}):null,d?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"error",role:"alert",children:d}):x?e.jsx("div",{className:"s-msg-compose-attach-note","data-tone":"muted",role:"status",children:x}):null]})}function pe({composeRef:t,draft:c,setDraft:g,composePlaceholder:x,slashState:d,setSlashState:p,filteredSlashCommands:i,applySlashCommand:j,mentionState:n,setMentionState:f,filteredMentions:b,applyMention:$,updateTriggersFromDraft:y,closeSuggestions:E,replyTarget:k,onCancelReply:r,isStopMode:l,sending:m,composeAction:v,onSend:F,onInterrupt:R,attachments:u,isAgentBusy:H,busyIntent:D,onBusyIntentChange:L,queued:N,queueNote:K,onEditQueued:B,editingQueuedId:w,editingAttachmentCount:A,onCancelEdit:W,onUnqueue:S,onSendQueuedNow:Q}){const Z=e.jsxs(e.Fragment,{children:[d.open?e.jsx(_,{label:"Slash commands",items:i.map(s=>({id:s.command,token:s.label,description:s.description})),activeIndex:d.index,onPick:s=>{const a=i[s];a&&j(a)},onActiveIndexChange:s=>p(a=>({...a,index:s}))}):null,n.open?e.jsx(_,{label:"Mention agent",items:b.map(s=>({id:s.id,token:`@${s.handle}`,description:s.name,avatarNode:e.jsx(G,{name:s.name,size:20,tile:!0,presence:!1})})),activeIndex:n.index,onPick:s=>{const a=b[s];a&&$(a)},onActiveIndexChange:s=>f(a=>({...a,index:s}))}):null]}),V=c.trim().length>0,q=w!==null,P=V||u.hasFiles||A>0,z=H&&P,C=z&&D==="steer",T=q?N.findIndex(s=>s.id===w)+1:0,M=z?e.jsxs("div",{className:"s-msg-compose-mode",role:"group","aria-label":"What Send does while this turn is running",children:[e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"queue","aria-pressed":D==="queue",title:"Hold this draft until the running turn lands",disabled:m,onClick:()=>L("queue"),children:"Queue"}),e.jsx("button",{type:"button",className:"s-msg-compose-mode-btn","data-mode":"steer","aria-pressed":D==="steer",title:"Interrupt the running turn and deliver this now",disabled:m,onClick:()=>L("steer"),children:"Steer"})]}):null,X=N.length>0||M?e.jsxs("div",{className:"s-msg-compose-queue",role:"group","aria-label":"Queued messages",children:[e.jsxs("div",{className:"s-msg-compose-queue-head",children:[e.jsx("span",{className:"s-msg-compose-queue-kicker",children:N.length>0?`Queue · ${N.length}`:"Queues next"}),e.jsx("span",{className:"s-msg-compose-queue-hint",children:q?C?`Rewriting ${T} — send interrupts this turn`:`Rewriting ${T} — send returns it to its place`:N.length>0?C?"Send interrupts this turn":K??"":C?"Interrupts this turn on send":"Sends when this turn lands"}),M]}),N.map((s,a)=>e.jsxs("div",{className:"s-msg-compose-queue-row","data-editing":s.id===w?"true":void 0,children:[e.jsx("span",{className:"s-msg-compose-queue-index",children:a+1}),e.jsx("span",{className:"s-msg-compose-queue-body",children:s.body.trim()||"Attachments only"}),s.attachments.length>0?e.jsxs("span",{className:"s-msg-compose-queue-clip",children:[s.attachments.length," file",s.attachments.length===1?"":"s"]}):null,s.id===w?e.jsx("button",{type:"button",className:"s-msg-compose-queue-edit btn btn--sm btn--ghost",title:"Stop rewriting — leave this row as it was","aria-label":`Cancel rewriting queued message ${a+1}`,onClick:W,children:"Cancel edit"}):e.jsxs("button",{type:"button",className:"s-msg-compose-queue-edit btn btn--sm btn--ghost",title:"Pull this back into the input box to rewrite it","aria-label":`Edit queued message ${a+1}`,disabled:m||q,onClick:()=>B(s.id),children:[e.jsx(oe,{size:11,"aria-hidden":"true"}),e.jsx("span",{children:"Edit"})]}),e.jsxs("button",{type:"button",className:"s-msg-compose-queue-now btn btn--sm btn--accent",title:"Interrupt this turn and send this now","aria-label":`Send queued message ${a+1} now`,disabled:m||s.id===w,onClick:()=>Q(s.id),children:[e.jsx(ae,{size:11,"aria-hidden":"true"}),e.jsx("span",{children:"Send now"})]}),e.jsx("button",{type:"button",className:"s-msg-compose-queue-drop btn btn--ghost btn--icon",title:"Cancel — drop this from the queue","aria-label":`Cancel queued message ${a+1}`,onClick:()=>S(s.id),children:"×"})]},s.id))]}):null;return e.jsx(J,{density:"thread",value:c,onChange:(s,a)=>{g(s),y(s,a?.caret??s.length)},onSend:F,placeholder:x,sending:m,stopMode:l,onStop:R,canSend:P,sendTitle:C?"Steer — interrupt this turn and send now (Cmd+Enter)":z?"Queue for the next turn (Cmd+Enter)":"Send (Cmd+Enter)",sendAriaLabel:C?"Steer — interrupt this turn and send now (Cmd+Enter)":z?"Queue message for the next turn (Cmd+Enter)":v==="steer"?"Send follow-up (Cmd+Enter)":"Send message (Cmd+Enter)",showAttach:!0,onAttach:u.openPicker,onPaste:u.onPaste,dropHandlers:u.dropHandlers,dragActive:u.dragActive,textareaRef:t,overlay:Z,above:X,aboveAttached:!0,header:e.jsxs(e.Fragment,{children:[k?e.jsxs("div",{className:"s-thread-compose-reply surface-card surface-card--inset",role:"status",children:[e.jsx(ie,{className:"s-thread-compose-reply-icon text-muted",size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{className:"s-thread-compose-reply-label label-xs text-muted",children:"Replying to"}),e.jsx("span",{className:"s-thread-compose-reply-actor chip chip--sm chip--mono chip--neutral",children:k.actorLabel}),e.jsx("span",{className:"s-thread-compose-reply-preview text-muted",title:k.preview,children:k.preview}),e.jsx("button",{type:"button",className:"s-thread-compose-reply-cancel btn btn--ghost btn--icon","aria-label":"Cancel reply",title:"Cancel reply",onClick:r,children:e.jsx(ne,{size:13,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,q&&A>0?e.jsxs("div",{className:"s-msg-compose-carried",role:"status",children:[A," file",A===1?"":"s"," stay attached to this draft"]}):null,e.jsx(ue,{attachments:u})]}),tools:e.jsxs("span",{className:"s-thread-compose-hint s-msg-compose-tools-hint",children:[e.jsx("kbd",{className:"s-kbd",children:"/"})," commands"," · ",e.jsx("kbd",{className:"s-kbd",children:"@"})," agents"]}),onSelect:s=>{const a=s.currentTarget;y(a.value,a.selectionStart)},onBlur:()=>{setTimeout(E,120)},onKeyDown:s=>{if(!(d.open&&i.length>0||n.open&&b.length>0))return!1;if(s.key==="ArrowDown")return d.open?p(o=>({...o,index:(o.index+1)%i.length})):n.open&&f(o=>({...o,index:(o.index+1)%b.length})),!0;if(s.key==="ArrowUp")return d.open?p(o=>({...o,index:(o.index-1+i.length)%i.length})):n.open&&f(o=>({...o,index:(o.index-1+b.length)%b.length})),!0;if(s.key==="Escape")return E(),!0;if((s.key==="Enter"||s.key==="Tab")&&!s.shiftKey&&!s.metaKey&&!s.ctrlKey&&!s.altKey){if(d.open){const o=i[d.index]??i[0];o&&j(o)}else if(n.open){const o=b[n.index]??b[0];o&&$(o)}return!0}return!1}})}const Ce=Object.freeze(Object.defineProperty({__proto__:null,ConversationComposer:pe},Symbol.toStringTag,{value:"Module"}));export{pe as C,Ce as a,we as u};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-DvLtl7rV.js";import{M as p}from"./message-markup-C2LQDm_k.js";import{f as d}from"./conversation-model-Dc02NsGp.js";import{t as n}from"./time-Dhsh_2EG.js";import"./mentions-DG6OQrsc.js";import"./colors-BtO5_zlx.js";import"./index-zvhpRHao.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./Provider-CtXJeLrP.js";import"./router-B9vQkNJL.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-CD9MMUxl.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-Do3wQ_3Z.js";import"./createLucideIcon-DezKXSG2.js";import"./TextDocumentSurface-BflAwXeZ.js";import"./file-text-CqJgwxmv.js";import"./x-CAbNespN.js";import"./chevron-right-D-HdlPg8.js";import"./code-xml-D7pOQM9l.js";import"./arrow-left-Czpf-AE4.js";import"./arrow-right-BuzMnLYP.js";import"./scout-voice-BVUqGhth.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BLYDhL3Z.js";import"./NewChatComposer-_Stj0fZy.js";import"./text-BP3oyl8-.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-pM56HNhR.js";import"./HarnessMark-B979GCSB.js";import"./NewChatOrigin-B1u7ki70.js";import"./chevron-down-wciXnOQz.js";import"./search-CDko0PKE.js";import"./chunk-HRAB3GC3-Tyv9rzx7.js";import"./AgentDetailCard-C9rn3Fj5.js";import"./AgentLiveActions-DrEJDJef.js";import"./terminal-takeover-_Jyys4me.js";import"./openContent-C6XO6kr5.js";import"./eye-BRyD0jno.js";import"./terminal-9GRS_Qdc.js";function l({at:a}){const i=d(a);return t.jsxs("div",{className:"s-thread-day-divider","aria-label":i,children:[t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"}),t.jsx("span",{className:"s-thread-day-label",children:i}),t.jsx("span",{className:"s-thread-day-line","aria-hidden":"true"})]})}function it({row:a,expanded:i,showDayDivider:e,onToggle:s}){const m=`${a.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:a.createdAt}),a.messages.map(r=>t.jsx("span",{id:`msg-${r.id}`,className:"s-thread-fanout-anchor","aria-hidden":"true"},r.id)),t.jsxs("button",{type:"button",className:"s-thread-fanout-summary","aria-expanded":i,onClick:s,title:a.recipients.join(", "),children:[t.jsx("span",{className:"s-thread-fanout-caret","aria-hidden":"true",children:i?"▾":"▸"}),t.jsx("span",{className:"s-thread-fanout-label",children:m}),t.jsx("span",{className:"s-thread-fanout-time",children:n(a.createdAt)})]}),i&&t.jsxs("div",{className:"s-thread-fanout-detail",children:[t.jsx("ul",{className:"s-thread-fanout-recipients",children:a.messages.map((r,o)=>t.jsx("li",{className:"s-thread-fanout-recipient",children:a.recipients[o]},r.id))}),t.jsx("div",{className:"s-thread-fanout-body",children:t.jsx(p,{text:a.messages[0].body})})]})]})}export{it as FanOutRow,l as ThreadDayDivider};