@openscout/scout 0.2.97 → 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 (391) 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-r_1tVuWk.js → AddProjectForm-fXndbzXT.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-B7c0egdP.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-B_KLcgsP.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-ajZvcfdW.js → AgentLaneCard-Cc9uyfBr.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-CTp39syR.js → AgentLaneChrome-Dv2lBFoH.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-DRc-TpMB.js → AgentLaneDetailSheet-CGqtqSHQ.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-VMNDo7kD.js → AgentLaneSummaryResize-Di4u6df2.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BA6fRwkD.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-CFadSaia.js → AgentLanesPreflight-CCGBArIb.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-96lHsoX7.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-CsQA3pu_.js → AgentLiveActions-DlSKL60c.js} +1 -1
  20. package/dist/client/assets/AgentMasterScreen-DHrMuQ6_.js +1 -0
  21. package/dist/client/assets/{AgentSessions-BePq5Lgc.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-Cjjcv6yQ.js → AstronautSuit-CwB4Dw07.js} +1 -1
  26. package/dist/client/assets/{AtopView-PxWQd-sX.js → AtopView-D7vyQDtE.js} +1 -1
  27. package/dist/client/assets/{BackToPicker-Cto0Ioz9.js → BackToPicker-BHicJyfc.js} +1 -1
  28. package/dist/client/assets/BriefingDetailScreen-B-wD_Bot.js +1 -0
  29. package/dist/client/assets/{BriefingsScreen-DNyFBrPn.js → BriefingsScreen-Cn4Mbam9.js} +1 -1
  30. package/dist/client/assets/{BrokerMetadataPanel-DbaCQlhw.js → BrokerMetadataPanel-BJSwU9XZ.js} +1 -1
  31. package/dist/client/assets/BrokerScreen-C8FQ5rlg.js +5 -0
  32. package/dist/client/assets/{CastPicker-CTBHjjGw.js → CastPicker-CkgTalIt.js} +1 -1
  33. package/dist/client/assets/{ChatCollapsedStrip-D4rc7wBQ.js → ChatCollapsedStrip-7Wrg8Ge0.js} +1 -1
  34. package/dist/client/assets/{CodeDiffPane-QvxCUzTi.js → CodeDiffPane-DfluIWmO.js} +1 -1
  35. package/dist/client/assets/{CodeProjectPicker-DplkpM7f.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-fMo6Uy1v.js → ConversationPanels-o6W-cOoU.js} +2 -2
  41. package/dist/client/assets/ConversationScreen-DIU7m_aC.js +2 -0
  42. package/dist/client/assets/{ConversationStatus-DI5GCiyW.js → ConversationStatus-CTYOywFh.js} +1 -1
  43. package/dist/client/assets/{CrewAvatar-CXJHLNVM.js → CrewAvatar-CZ_faQ_s.js} +1 -1
  44. package/dist/client/assets/CrewWorkspaces-DNX-QQ1h.js +1 -0
  45. package/dist/client/assets/{DataTable-DXIlOlVu.js → DataTable-C6aMSilS.js} +1 -1
  46. package/dist/client/assets/{DispatchAftermath-CrELgl2e.js → DispatchAftermath-ZCEB75hh.js} +1 -1
  47. package/dist/client/assets/{DocumentFocusViewer-DFFE85Tq.js → DocumentFocusViewer-D8iB6SMt.js} +1 -1
  48. package/dist/client/assets/{EmbeddableSurfacesLab-DgpewB3y.js → EmbeddableSurfacesLab-D3iZiS8o.js} +1 -1
  49. package/dist/client/assets/{EmptyState-D9X16fKq.js → EmptyState-CKPWFSjq.js} +1 -1
  50. package/dist/client/assets/{FileViewerPane-CY0RN78e.js → FileViewerPane-CxNbcTYf.js} +1 -1
  51. package/dist/client/assets/FlightObserveScreen-BTe1YRPr.js +1 -0
  52. package/dist/client/assets/{FollowScreen-wZ-z67mX.js → FollowScreen-CkR-okdL.js} +1 -1
  53. package/dist/client/assets/{HarnessMark-DAaWPiT_.js → HarnessMark-DttReffF.js} +1 -1
  54. package/dist/client/assets/HarnessesScreen-COO_Q8VY.js +1 -0
  55. package/dist/client/assets/{HerdrSession-CYKRfBad.js → HerdrSession-DsuxCtfX.js} +1 -1
  56. package/dist/client/assets/{HomeHero-DYyd3cpz.js → HomeHero-DXJo2QSO.js} +1 -1
  57. package/dist/client/assets/{HostAdvisorView-NtM0bsg8.js → HostAdvisorView-DeJ-8RZV.js} +1 -1
  58. package/dist/client/assets/{KnowledgeSearchInspector-CU6BCFcS.js → KnowledgeSearchInspector-W_zNIBRV.js} +1 -1
  59. package/dist/client/assets/KnowledgeSearchScreen-_rxJNUUh.js +1 -0
  60. package/dist/client/assets/{LaneToolHoverCard-Bo2Zl-1a.js → LaneToolHoverCard-t7-XJP-h.js} +1 -1
  61. package/dist/client/assets/LaneTraceDetailSheet-DNIECgEl.js +1 -0
  62. package/dist/client/assets/{LaneTraceEventFocus-Cek_64zR.js → LaneTraceEventFocus-BB5DhFQm.js} +1 -1
  63. package/dist/client/assets/{MeshCanvas-TvsID4fe.js → MeshCanvas-DZv2ipsy.js} +1 -1
  64. package/dist/client/assets/{MeshCanvasMinimap-CxqeVVco.js → MeshCanvasMinimap-BXHRNb7l.js} +1 -1
  65. package/dist/client/assets/MeshScreen-DuNvpDC5.js +1 -0
  66. package/dist/client/assets/{MeshTopologyView-BjprutE8.js → MeshTopologyView-Dc0GSrKa.js} +2 -2
  67. package/dist/client/assets/MessagesScreen-dNNPFwAc.js +1 -0
  68. package/dist/client/assets/{MissionContextRail-Be0uXljQ.js → MissionContextRail-DnCWPzAM.js} +1 -1
  69. package/dist/client/assets/MissionControlView-DmaThhNR.js +1 -0
  70. package/dist/client/assets/MissionFocusOverlay-K21ssTxv.js +1 -0
  71. package/dist/client/assets/MissionLeftAgentRow-CbQm4BLv.js +1 -0
  72. package/dist/client/assets/{MissionLogPane-EsM_S3ro.js → MissionLogPane-BLvSSIdT.js} +1 -1
  73. package/dist/client/assets/{NewAgentModal-Cqiq1CE1.js → NewAgentModal-B7qxjZlW.js} +1 -1
  74. package/dist/client/assets/NewChatComposer-D2Ah4T-W.js +19 -0
  75. package/dist/client/assets/{NewChatOrigin-D7hwp6dm.js → NewChatOrigin-DCn5cWPZ.js} +1 -1
  76. package/dist/client/assets/{ObserveEmbedScreen-CGHI_hb5.js → ObserveEmbedScreen-DvKGsaLv.js} +2 -2
  77. package/dist/client/assets/{ObserveTextFlow-BcrGQet8.js → ObserveTextFlow-DCJ5EmD8.js} +2 -2
  78. package/dist/client/assets/{ObservedTopologyPanel-BhVsvwkh.js → ObservedTopologyPanel-CJVqIqQ2.js} +1 -1
  79. package/dist/client/assets/{OpenScoutAppShell-BtfvMkAp.js → OpenScoutAppShell-C9TOLB7u.js} +2 -2
  80. package/dist/client/assets/OpsAgentsView-vIoY-AW1.js +1 -0
  81. package/dist/client/assets/OpsScreen-CJBwshEp.js +1 -0
  82. package/dist/client/assets/OpsSubnav-CjDTnp64.js +1 -0
  83. package/dist/client/assets/ProjectAgentProfile-Br1eTD7G.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfileBar-CUzZ4Rpx.js +1 -0
  85. package/dist/client/assets/ProjectAgentProfileHero-mjxNcRvw.js +1 -0
  86. package/dist/client/assets/ProjectsInbox-Bq29DE_o.js +2 -0
  87. package/dist/client/assets/ProjectsRail-kMDA0yn4.js +1 -0
  88. package/dist/client/assets/ProjectsScreen-BDaJYhc0.js +1 -0
  89. package/dist/client/assets/ProjectsThreadAside-B940p3vW.js +1 -0
  90. package/dist/client/assets/Provider-D0bB7q6y.js +1 -0
  91. package/dist/client/assets/{RailRow-ClMmtaIE.js → RailRow-B88JVr62.js} +1 -1
  92. package/dist/client/assets/RawSessionsTable-CzGhEdiZ.js +1 -0
  93. package/dist/client/assets/RealtimeVoiceScreen-CyP1CWsX.js +1 -0
  94. package/dist/client/assets/{RepoDiffEmbedScreen-CjZ5ew3y.js → RepoDiffEmbedScreen-mexrJPhW.js} +1 -1
  95. package/dist/client/assets/{RepoDiffPageScreen-CdTFfmbk.js → RepoDiffPageScreen-DbqX4L3q.js} +1 -1
  96. package/dist/client/assets/{RepoDiffViewer-BFperHQg.js → RepoDiffViewer-Bw5yMC4A.js} +1 -1
  97. package/dist/client/assets/{RepoDiffViewerLazy-BkBmbi1Z.js → RepoDiffViewerLazy-DzfoFhbl.js} +2 -2
  98. package/dist/client/assets/{ReposScreen-C8dT4bK0.js → ReposScreen-CzbO1Fuy.js} +2 -2
  99. package/dist/client/assets/{ScoutDeckSurface-BcJsm2Kq.js → ScoutDeckSurface-DQoZofzH.js} +1 -1
  100. package/dist/client/assets/{ScoutSurface-DmzEtrx8.js → ScoutSurface-NlhDsPzg.js} +1 -1
  101. package/dist/client/assets/{ScoutbotFxLab-DU15Plja.js → ScoutbotFxLab-l2WAahCg.js} +1 -1
  102. package/dist/client/assets/{SecondaryNav-BrXMtvKE.js → SecondaryNav-Cs0_FQdj.js} +1 -1
  103. package/dist/client/assets/{SessionEmbedScreen-Bt4flmAx.js → SessionEmbedScreen-CpduQ0O9.js} +1 -1
  104. package/dist/client/assets/{SessionObserve-BCehTlO8.js → SessionObserve-BVeTkcIl.js} +1 -1
  105. package/dist/client/assets/{SessionObserveEvidence-Bb6U-dem.js → SessionObserveEvidence-BkOezTGV.js} +1 -1
  106. package/dist/client/assets/SessionRefScreen-DetLMkTT.js +1 -0
  107. package/dist/client/assets/SessionsScreen-B-McKw6d.js +1 -0
  108. package/dist/client/assets/{SettingsDrawer-BieUmb8g.js → SettingsDrawer-CPB32w0n.js} +3 -3
  109. package/dist/client/assets/SettingsScreen-BEzYFdjz.js +1 -0
  110. package/dist/client/assets/{ShikiPane-DPWsVNtn.js → ShikiPane-C0TuCATU.js} +1 -1
  111. package/dist/client/assets/{SlidePanel-BMRIR6bH.js → SlidePanel-CETQ5NTx.js} +1 -1
  112. package/dist/client/assets/{SpriteAvatar-56DTXxSV.js → SpriteAvatar-DFO4Kb4Z.js} +1 -1
  113. package/dist/client/assets/{StatusPill-BcuYUgsD.js → StatusPill-BllrY-eg.js} +1 -1
  114. package/dist/client/assets/{TailView-BDy8c2VB.js → TailView-_gKWfaQM.js} +2 -2
  115. package/dist/client/assets/Terminal-DWyZTZdY.js +1 -0
  116. package/dist/client/assets/TerminalEmbedScreen-_SSzwhWa.js +1 -0
  117. package/dist/client/assets/{TerminalHeaderMount-Cy-uxkey.js → TerminalHeaderMount-CY7uIWBg.js} +1 -1
  118. package/dist/client/assets/{TextDocumentSurface-BeSwe3Yl.js → TextDocumentSurface-2X1Gw4eA.js} +1 -1
  119. package/dist/client/assets/{TmuxPeek-B4no_aGI.js → TmuxPeek-CqTJRhkI.js} +1 -1
  120. package/dist/client/assets/{VoicePermissionsPanel-Bd16scwz.js → VoicePermissionsPanel-C4vkU-sU.js} +1 -1
  121. package/dist/client/assets/{WorkDetailScreen-DIFQufak.js → WorkDetailScreen-DqGnuK0e.js} +3 -3
  122. package/dist/client/assets/{WorkFilesViewer-CT5XEFGf.js → WorkFilesViewer-D8-4vF5l.js} +1 -1
  123. package/dist/client/assets/{activity-CqZafWfx.js → activity-CzTJ-YMX.js} +1 -1
  124. package/dist/client/assets/{addon-fit-CM6F_JRD.js → addon-fit-Zx3A7pGS.js} +1 -1
  125. package/dist/client/assets/{addon-webgl-DRTiePFC.js → addon-webgl-DitJj-N0.js} +1 -1
  126. package/dist/client/assets/{agent-autocomplete-DXUBnlkN.js → agent-autocomplete-BlK8wY06.js} +1 -1
  127. package/dist/client/assets/{agent-essentials-vytdybaX.js → agent-essentials-K9B6kbTS.js} +1 -1
  128. package/dist/client/assets/{agent-lane-card-model-CNZMPkhc.js → agent-lane-card-model-CY3OE1Xu.js} +1 -1
  129. package/dist/client/assets/{agent-lanes-model-DXqjs0OK.js → agent-lanes-model-tc-1hE6q.js} +1 -1
  130. package/dist/client/assets/{agent-master-model-DAZL92oe.js → agent-master-model-DMcHeNq3.js} +1 -1
  131. package/dist/client/assets/agent-specialization-CtF_jI34.js +1 -0
  132. package/dist/client/assets/{arc.es-Bh84oHJ7.js → arc.es-BNXJqSw7.js} +1 -1
  133. package/dist/client/assets/{arrow-down-DvTsLokL.js → arrow-down-BAGkhHA6.js} +1 -1
  134. package/dist/client/assets/{arrow-left-DHfdXJVZ.js → arrow-left-eToA6GxC.js} +1 -1
  135. package/dist/client/assets/{arrow-right-BBsrogWf.js → arrow-right-DTX42clh.js} +1 -1
  136. package/dist/client/assets/{arrow-up-right-CY0Vw_67.js → arrow-up-right-B09GPwFl.js} +1 -1
  137. package/dist/client/assets/{bot-DzkOUFBb.js → bot-WxKXYtEX.js} +1 -1
  138. package/dist/client/assets/{check-DbIkldnK.js → check-Dz2SRHft.js} +1 -1
  139. package/dist/client/assets/{chevron-down-C475vltS.js → chevron-down-D120PY4g.js} +1 -1
  140. package/dist/client/assets/{chevron-right-CnZRSd-V.js → chevron-right-CowuvuE6.js} +1 -1
  141. package/dist/client/assets/{chunk-HRAB3GC3-DLNT8aOo.js → chunk-HRAB3GC3-KjjrTLCU.js} +1 -1
  142. package/dist/client/assets/{chunk-JTPDIGGW-Ci5j4vzV.js → chunk-JTPDIGGW-COJ00z94.js} +3 -3
  143. package/dist/client/assets/{chunk-T65CQEWV-BtNvicWs.js → chunk-T65CQEWV-H2QEKfr1.js} +1 -1
  144. package/dist/client/assets/{chunk-YOZR3KYS-DN5EJulq.js → chunk-YOZR3KYS-CrCgXw9l.js} +1 -1
  145. package/dist/client/assets/{clock-DVvENUU5.js → clock-_9FDplIT.js} +1 -1
  146. package/dist/client/assets/{code-xml-CvKBY3KA.js → code-xml-CkkNdRmu.js} +1 -1
  147. package/dist/client/assets/{compass-BcRI_YXo.js → compass-BdpImt_W.js} +1 -1
  148. package/dist/client/assets/content-0RBfbCIJ.js +1 -0
  149. package/dist/client/assets/content-BTmnk2bl.js +1 -0
  150. package/dist/client/assets/content-Bk5DKhyP.js +1 -0
  151. package/dist/client/assets/{content-BNyAjpUl.js → content-Bw_8GE_S.js} +1 -1
  152. package/dist/client/assets/content-CI4gLEWi.js +1 -0
  153. package/dist/client/assets/content-CLCtp9Rb.js +1 -0
  154. package/dist/client/assets/content-C_FAGTNk.js +1 -0
  155. package/dist/client/assets/content-CnnzWOE3.js +1 -0
  156. package/dist/client/assets/content-DKlY98pO.js +1 -0
  157. package/dist/client/assets/content-Df7ndXTG.js +1 -0
  158. package/dist/client/assets/content-DkZDzzx3.js +1 -0
  159. package/dist/client/assets/content-DnGmb2L0.js +1 -0
  160. package/dist/client/assets/content-Ds-zs-Ss.js +1 -0
  161. package/dist/client/assets/content-JIWSyC0f.js +1 -0
  162. package/dist/client/assets/content-Q3TIYC8q.js +1 -0
  163. package/dist/client/assets/content-evaBfvxD.js +1 -0
  164. package/dist/client/assets/{context-budget-DX_fwUs3.js → context-budget-DqxWzalx.js} +1 -1
  165. package/dist/client/assets/{conversation-icons-CBMKBGHd.js → conversation-icons-DHGc9wbT.js} +1 -1
  166. package/dist/client/assets/conversation-model-C2KuZUXc.js +1 -0
  167. package/dist/client/assets/conversation-motion-features-BJnHs3Ul.js +1 -0
  168. package/dist/client/assets/{copy-Cj-owMb-.js → copy-BzdzWsQd.js} +1 -1
  169. package/dist/client/assets/{cpu-DuD3RFX5.js → cpu-CHFIGw87.js} +1 -1
  170. package/dist/client/assets/{createLucideIcon-DthwWQIg.js → createLucideIcon-Dv8H8m7J.js} +1 -1
  171. package/dist/client/assets/discover-DutlV0ZU.js +2 -0
  172. package/dist/client/assets/embed-entry-CJG7WEVw.js +2 -0
  173. package/dist/client/assets/{external-link-C_nxk0MJ.js → external-link-BvX5PfLh.js} +1 -1
  174. package/dist/client/assets/{eye-FnaaPfja.js → eye-C9cGk5z6.js} +1 -1
  175. package/dist/client/assets/{file-code-corner-DDPq4Cur.js → file-code-corner-jlGFdr8d.js} +1 -1
  176. package/dist/client/assets/{file-text--hfhwZH1.js → file-text-BHro8MkG.js} +1 -1
  177. package/dist/client/assets/{gauge-BVEknshP.js → gauge-DSflSery.js} +1 -1
  178. package/dist/client/assets/{gestures-3gw5VgUS.js → gestures-YA5IIwp-.js} +1 -1
  179. package/dist/client/assets/{git-branch-DJyvr0k-.js → git-branch-Bc_eDIpG.js} +1 -1
  180. package/dist/client/assets/{home-moving-signal-BPqBoNSm.js → home-moving-signal-PHSqSBu_.js} +1 -1
  181. package/dist/client/assets/home-now-card-C_qsI6C6.js +1 -0
  182. package/dist/client/assets/{home-now-card-nano-G8kMB32m.js → home-now-card-nano-Jmy7eJ6H.js} +1 -1
  183. package/dist/client/assets/{hooks-BMsQzo9j.js → hooks-ME7rmhpE.js} +1 -1
  184. package/dist/client/assets/{index-BI9AljSD.js → index-C1VaWNuD.js} +2 -2
  185. package/dist/client/assets/index-C8UCRm2W.js +1 -0
  186. package/dist/client/assets/index-Cn0I2Hgi.js +1 -0
  187. package/dist/client/assets/index-Cx6Gbr6n.js +1 -0
  188. package/dist/client/assets/{inspector-panel-CFSArQ8Y.js → inspector-panel-CwrHjRaQ.js} +2 -2
  189. package/dist/client/assets/{keyboard-nav-e6yGeorb.js → keyboard-nav-B8sQ_8IF.js} +1 -1
  190. package/dist/client/assets/{lane-roster-store-Q7pcblY5.js → lane-roster-store-DN2jxXF-.js} +1 -1
  191. package/dist/client/assets/{layers-Dz2dKOnU.js → layers-CW2-qHsG.js} +1 -1
  192. package/dist/client/assets/{layout-grid-Bvs5fdB4.js → layout-grid-BoVnPOk-.js} +1 -1
  193. package/dist/client/assets/left-BRu9pnqx.js +2 -0
  194. package/dist/client/assets/left-BjS1dKNV.js +2 -0
  195. package/dist/client/assets/left-CL-TVLJ7.js +1 -0
  196. package/dist/client/assets/left-DLpsDi55.js +1 -0
  197. package/dist/client/assets/left-DPcM9o8Y.js +1 -0
  198. package/dist/client/assets/left-MmTJf1tK.js +1 -0
  199. package/dist/client/assets/left-P80i5V8L.js +1 -0
  200. package/dist/client/assets/left-advisor-CbXVzAqS.js +1 -0
  201. package/dist/client/assets/left-agents-7mJsiNyr.js +1 -0
  202. package/dist/client/assets/left-default-COK26l3H.js +1 -0
  203. package/dist/client/assets/left-lanes-Dbdm9Veu.js +1 -0
  204. package/dist/client/assets/left-mission-DqGR5jby.js +1 -0
  205. package/dist/client/assets/library-COnWzUWv.js +1 -0
  206. package/dist/client/assets/{loader-circle-B2W9DPG5.js → loader-circle-DmUG_YC7.js} +1 -1
  207. package/dist/client/assets/{local-agents-DKr-gIDC.js → local-agents-VP1-ZlPw.js} +1 -1
  208. package/dist/client/assets/{mentions-DuLQnEcn.js → mentions-BZ5SBMtc.js} +1 -1
  209. package/dist/client/assets/mesh-buckets-CLYS8Jx8.js +1 -0
  210. package/dist/client/assets/{mesh-ops-CRR-KnCG.js → mesh-ops-CKSWgax2.js} +1 -1
  211. package/dist/client/assets/{mesh-view-store-CiET-yN8.js → mesh-view-store-CBM1za_N.js} +1 -1
  212. package/dist/client/assets/{message-circle-B2DoYKDO.js → message-circle-joGFxfj1.js} +1 -1
  213. package/dist/client/assets/{message-markup-Cc_O-WdA.js → message-markup-DC0QFEZn.js} +1 -1
  214. package/dist/client/assets/{message-square-O-Hu9Mk2.js → message-square-BLiFqpe_.js} +1 -1
  215. package/dist/client/assets/{mission-control-store-DDAgWKUl.js → mission-control-store-CM8mQGg8.js} +1 -1
  216. package/dist/client/assets/model-CBkMvT1w.js +1 -0
  217. package/dist/client/assets/{observe-Da2mRAsc.js → observe-BLmy4quB.js} +1 -1
  218. package/dist/client/assets/{page-status-Crtgjbq3.js → page-status-BE0-J1xY.js} +1 -1
  219. package/dist/client/assets/{paperclip-BudMKSyr.js → paperclip-Br7wUDFl.js} +1 -1
  220. package/dist/client/assets/{persistent-state-xJz-qAFc.js → persistent-state-BubPQ7tT.js} +1 -1
  221. package/dist/client/assets/{plus-BJ1If8vj.js → plus-BWKhylds.js} +1 -1
  222. package/dist/client/assets/profile-BCvk8jOQ.js +1 -0
  223. package/dist/client/assets/projects-inbox-BIW7nv-H.css +1 -0
  224. package/dist/client/assets/projects-inbox-DFbgVlXL.js +1 -0
  225. package/dist/client/assets/{proxy-1BABCaDb.js → proxy-DVDRhSRR.js} +1 -1
  226. package/dist/client/assets/{radio-B5OpHrrK.js → radio-CxIXS1nU.js} +1 -1
  227. package/dist/client/assets/{refresh-cw-DmNAhaH0.js → refresh-cw-Bkh7Cvnd.js} +1 -1
  228. package/dist/client/assets/resolve-panes-DhD5qmQO.js +1 -0
  229. package/dist/client/assets/resolve-sidebar-context-GqhZNRPY.js +1 -0
  230. package/dist/client/assets/right-B_08ilv6.js +1 -0
  231. package/dist/client/assets/right-Brm67HOL.js +1 -0
  232. package/dist/client/assets/right-BveAPKBW.js +1 -0
  233. package/dist/client/assets/right-CpTB_-Ya.js +1 -0
  234. package/dist/client/assets/right-CqC4Qdot.js +1 -0
  235. package/dist/client/assets/right-D91j9d5Y.js +1 -0
  236. package/dist/client/assets/{right-D8id_DWQ.js → right-DVUq5374.js} +1 -1
  237. package/dist/client/assets/right-DaLRhYl3.js +1 -0
  238. package/dist/client/assets/right-Dt1wOwA5.js +1 -0
  239. package/dist/client/assets/right-DtzqIZQF.js +1 -0
  240. package/dist/client/assets/{rocket-D3-TUJ2m.js → rocket-CnxqjX_K.js} +1 -1
  241. package/dist/client/assets/{router-DTtux5sP.js → router-kfcaYqZr.js} +1 -1
  242. package/dist/client/assets/runtime-picker-C20lTGhV.js +1 -0
  243. package/dist/client/assets/{scope-views-CPM0sBw_.js → scope-views-KPY85UUx.js} +1 -1
  244. package/dist/client/assets/{scout-voice-BZKsdquE.js → scout-voice-Cg1qfepC.js} +1 -1
  245. package/dist/client/assets/scoutbot-D7kGGyK_.js +3 -0
  246. package/dist/client/assets/{scoutbot-markdown-CQ7Y1McC.js → scoutbot-markdown-yb87JlSE.js} +1 -1
  247. package/dist/client/assets/{scroll-text-kPhYbh-M.js → scroll-text-DFcBYy5J.js} +1 -1
  248. package/dist/client/assets/{search-DmFM_9jm.js → search-FB2vVxCp.js} +1 -1
  249. package/dist/client/assets/{secondaryNavConfig-C9bQ9_IA.js → secondaryNavConfig-C0Srrmy8.js} +1 -1
  250. package/dist/client/assets/{selection-bridge-Dy2mtMyi.js → selection-bridge-qBGFCJv8.js} +1 -1
  251. package/dist/client/assets/{send-horizontal-qyjNgEaV.js → send-horizontal-CS7mxVhX.js} +1 -1
  252. package/dist/client/assets/{server-nWqndnxu.js → server-WY6gsbZz.js} +1 -1
  253. package/dist/client/assets/{session-catalog-BkmktBHI.js → session-catalog-CG4oL_yN.js} +1 -1
  254. package/dist/client/assets/{session-table-DKSF0mrS.js → session-table-uJh3v-ly.js} +1 -1
  255. package/dist/client/assets/{settings-C6h9y5XX.js → settings-DQEtqkM9.js} +1 -1
  256. package/dist/client/assets/{sliders-horizontal-BhHKxsCO.js → sliders-horizontal-57e99_qO.js} +1 -1
  257. package/dist/client/assets/{sparkles-Cf8gin88.js → sparkles-D0vWLTyC.js} +1 -1
  258. package/dist/client/assets/{sse-DDHEHUgz.js → sse-B29iGBnw.js} +1 -1
  259. package/dist/client/assets/{system-surfaces-redesign-QVXNeGYw.css → system-surfaces-redesign-kuf3wuE_.css} +1 -1
  260. package/dist/client/assets/{tail-events-BdUrO0kb.js → tail-events-LK29oCKm.js} +1 -1
  261. package/dist/client/assets/{terminal-C3YRPfyz.js → terminal-UDy4lzV1.js} +1 -1
  262. package/dist/client/assets/{terminal-relay-BFhdIstF.js → terminal-relay-CXHMdain.js} +1 -1
  263. package/dist/client/assets/{terminal-screen-BLk4PAYt.css → terminal-screen-vMICbBJh.css} +1 -1
  264. package/dist/client/assets/{terminal-sessions-BQ6t92tJ.js → terminal-sessions-Bdt2W3Y4.js} +1 -1
  265. package/dist/client/assets/{terminal-takeover-B6H4llRR.js → terminal-takeover-BMeBjBB2.js} +1 -1
  266. package/dist/client/assets/{use-conversation-list-DO5J8T1H.js → use-conversation-list-UG-tMN67.js} +1 -1
  267. package/dist/client/assets/{use-fleet-active-asks-BtgNnRgK.js → use-fleet-active-asks-CCGrll5q.js} +1 -1
  268. package/dist/client/assets/{use-mesh-ops-items-N1HHhChY.js → use-mesh-ops-items-BjyeFJTz.js} +1 -1
  269. package/dist/client/assets/{use-reduced-motion-8WuxLa5l.js → use-reduced-motion-CPoX8iV2.js} +1 -1
  270. package/dist/client/assets/{use-scout-dev-flags-B31qTy6m.js → use-scout-dev-flags-DTseRrFi.js} +1 -1
  271. package/dist/client/assets/{useAgentHoverCard-Bkv-Uz_V.js → useAgentHoverCard-BgTLNcF-.js} +1 -1
  272. package/dist/client/assets/useContentSecondaryNav-CoIoz7JU.js +1 -0
  273. package/dist/client/assets/useEmbedHeadline-DuUnwTB7.js +1 -0
  274. package/dist/client/assets/{usePierreRuntime-BfZHKAkI.js → usePierreRuntime-35AHf9RQ.js} +1 -1
  275. package/dist/client/assets/{wrench-DkxnZRlR.js → wrench-BfVeded5.js} +1 -1
  276. package/dist/client/assets/{x-DfRJbqrh.js → x-DgmmnPKt.js} +1 -1
  277. package/dist/client/assets/{xterm-CJw8Epxv.js → xterm-DnJJmrCA.js} +1 -1
  278. package/dist/client/assets/{zap-CIo8msJB.js → zap-Bcja1lHG.js} +1 -1
  279. package/dist/client/index.html +1 -1
  280. package/dist/main.mjs +5116 -9854
  281. package/dist/node/main.mjs +18 -2
  282. package/dist/pairing-runtime-controller.mjs +23 -2
  283. package/dist/runtime/broker-daemon.mjs +29 -3
  284. package/dist/scout-control-plane-web.mjs +27 -3
  285. package/package.json +2 -5
  286. package/dist/client/assets/ActivityScreen-y-5DLleY.js +0 -1
  287. package/dist/client/assets/AgentConfigurationScreen-BD7Unt2P.js +0 -1
  288. package/dist/client/assets/AgentDefinitionsWorkspace-BbcZc9Xk.js +0 -1
  289. package/dist/client/assets/AgentFloorView-DMFiHs21.js +0 -1
  290. package/dist/client/assets/AgentInfoScreen-DHGLRddI.js +0 -1
  291. package/dist/client/assets/AgentLanesEmbedScreen-C5k_dDS8.js +0 -1
  292. package/dist/client/assets/AgentLanesView-u5vpLwQf.js +0 -2
  293. package/dist/client/assets/AgentMasterScreen-C5WlWNmk.js +0 -1
  294. package/dist/client/assets/AgentsConsole-BuiZ_bDo.js +0 -1
  295. package/dist/client/assets/AgentsScreen-CRi-hG2k.js +0 -1
  296. package/dist/client/assets/AgentsSubnav-DUsya4WK.js +0 -1
  297. package/dist/client/assets/BriefingDetailScreen-C29smC5d.js +0 -1
  298. package/dist/client/assets/BrokerScreen-CS0s4Gm4.js +0 -5
  299. package/dist/client/assets/CodeScreen-CrR2JaVj.js +0 -1
  300. package/dist/client/assets/ConversationComposer-H8_hsYSc.js +0 -1
  301. package/dist/client/assets/ConversationFeedRows-hlEFlURs.js +0 -1
  302. package/dist/client/assets/ConversationHeader-B0ZBhE_E.js +0 -1
  303. package/dist/client/assets/ConversationScreen-CXAHQwQ3.js +0 -2
  304. package/dist/client/assets/CrewWorkspaces-Bz2Dcnt4.js +0 -1
  305. package/dist/client/assets/FlightObserveScreen-qyzHzxLa.js +0 -1
  306. package/dist/client/assets/HarnessesScreen-DbKkQM4o.js +0 -1
  307. package/dist/client/assets/KnowledgeSearchScreen-DvbRRPQB.js +0 -1
  308. package/dist/client/assets/LaneTraceDetailSheet-C3C8UjXv.js +0 -1
  309. package/dist/client/assets/MeshScreen-BJ-j9YXv.js +0 -1
  310. package/dist/client/assets/MessagesScreen-CyNIZ3-X.js +0 -1
  311. package/dist/client/assets/MissionControlView-Bj7cAbZd.js +0 -1
  312. package/dist/client/assets/MissionFocusOverlay-DvTw6ts5.js +0 -1
  313. package/dist/client/assets/MissionLeftAgentRow-B0QG7Gys.js +0 -1
  314. package/dist/client/assets/NewChatComposer-C_1op4dH.js +0 -19
  315. package/dist/client/assets/OpsAgentsView-DBYtmLnh.js +0 -1
  316. package/dist/client/assets/OpsScreen-CuYVgkC_.js +0 -1
  317. package/dist/client/assets/OpsSubnav-BEU4kKXm.js +0 -1
  318. package/dist/client/assets/ProjectAgentProfile-BhXAZEkW.js +0 -1
  319. package/dist/client/assets/ProjectAgentProfileBar-uJw9Wdfk.js +0 -1
  320. package/dist/client/assets/ProjectAgentProfileHero-CIMS4Dy_.js +0 -1
  321. package/dist/client/assets/ProjectsInbox-JgU0lrY8.js +0 -2
  322. package/dist/client/assets/ProjectsRail-p99BRBOa.js +0 -1
  323. package/dist/client/assets/ProjectsScreen-BB45DU53.js +0 -1
  324. package/dist/client/assets/ProjectsThreadAside-BHDTJWOz.js +0 -1
  325. package/dist/client/assets/Provider-Bu-C8Hxc.js +0 -1
  326. package/dist/client/assets/RawSessionsTable-BtKdQPiv.js +0 -1
  327. package/dist/client/assets/RealtimeVoiceScreen-KPHJgO1l.js +0 -1
  328. package/dist/client/assets/SessionRefScreen-C8BiRVPx.js +0 -1
  329. package/dist/client/assets/SessionsScreen-BNvjUflN.js +0 -1
  330. package/dist/client/assets/SettingsScreen-3JvX1WFL.js +0 -1
  331. package/dist/client/assets/Terminal-BlUQY9_Z.js +0 -1
  332. package/dist/client/assets/TerminalEmbedScreen-DTjxktyr.js +0 -1
  333. package/dist/client/assets/agent-specialization-BtxLN4UR.js +0 -1
  334. package/dist/client/assets/agents-project-model-UYiamtrU.js +0 -1
  335. package/dist/client/assets/content--T3p6akp.js +0 -1
  336. package/dist/client/assets/content-4nFMLuzF.js +0 -1
  337. package/dist/client/assets/content-BJ4nHvcu.js +0 -1
  338. package/dist/client/assets/content-BmGp9wNl.js +0 -1
  339. package/dist/client/assets/content-CBWhwaRo.js +0 -1
  340. package/dist/client/assets/content-CQlykFbe.js +0 -1
  341. package/dist/client/assets/content-CevL0DgF.js +0 -1
  342. package/dist/client/assets/content-Ch8pf2bj.js +0 -1
  343. package/dist/client/assets/content-Cpvdcm_l.js +0 -1
  344. package/dist/client/assets/content-DfS3vgAu.js +0 -1
  345. package/dist/client/assets/content-DpQdNePJ.js +0 -1
  346. package/dist/client/assets/content-Dqpibejl.js +0 -1
  347. package/dist/client/assets/content-TV0nd6-r.js +0 -1
  348. package/dist/client/assets/content-odbb5H4U.js +0 -1
  349. package/dist/client/assets/content-uXHLPHe0.js +0 -1
  350. package/dist/client/assets/conversation-model-QsJVfSeG.js +0 -1
  351. package/dist/client/assets/conversation-motion-features-BFLHX2eg.js +0 -1
  352. package/dist/client/assets/discover-B3uQlh5L.js +0 -2
  353. package/dist/client/assets/embed-entry-DkRcHKTh.js +0 -2
  354. package/dist/client/assets/home-now-card-UspVW2-2.js +0 -1
  355. package/dist/client/assets/index-C-v0Z6ZS.js +0 -1
  356. package/dist/client/assets/index-D9DzUORB.js +0 -1
  357. package/dist/client/assets/index-DfsTyYDx.js +0 -1
  358. package/dist/client/assets/left-B4Ak-Ibt.js +0 -2
  359. package/dist/client/assets/left-BMb493FZ.js +0 -1
  360. package/dist/client/assets/left-BjFLvVOC.js +0 -1
  361. package/dist/client/assets/left-CsXQ8Q3G.js +0 -1
  362. package/dist/client/assets/left-FNH7faCI.js +0 -1
  363. package/dist/client/assets/left-POkqE8gI.js +0 -2
  364. package/dist/client/assets/left-UulOTcWh.js +0 -1
  365. package/dist/client/assets/left-advisor-CJkQS2d6.js +0 -1
  366. package/dist/client/assets/left-agents-CFMxyEjT.js +0 -1
  367. package/dist/client/assets/left-default-rnX5HANc.js +0 -1
  368. package/dist/client/assets/left-lanes-BpLXT_qH.js +0 -1
  369. package/dist/client/assets/left-mission-B0bhseWw.js +0 -1
  370. package/dist/client/assets/library-D1iXfda2.js +0 -1
  371. package/dist/client/assets/mesh-buckets-6y3ZIibI.js +0 -1
  372. package/dist/client/assets/mesh-roster-Bc7T4b7z.js +0 -1
  373. package/dist/client/assets/model-IGCUEsMy.js +0 -1
  374. package/dist/client/assets/profile-B3qDSbrH.js +0 -1
  375. package/dist/client/assets/projects-inbox-CLek3QaG.js +0 -1
  376. package/dist/client/assets/projects-inbox-DRBl2N85.css +0 -1
  377. package/dist/client/assets/resolve-panes-DXw-cHaj.js +0 -1
  378. package/dist/client/assets/resolve-sidebar-context-CDdbRDEa.js +0 -1
  379. package/dist/client/assets/right-BgJ4mQLf.js +0 -1
  380. package/dist/client/assets/right-Bk6h7o-Z.js +0 -1
  381. package/dist/client/assets/right-BrICCmEt.js +0 -1
  382. package/dist/client/assets/right-C1QIbqFZ.js +0 -1
  383. package/dist/client/assets/right-CfliKiHY.js +0 -1
  384. package/dist/client/assets/right-CtOLXB9s.js +0 -1
  385. package/dist/client/assets/right-DJ34yMAi.js +0 -1
  386. package/dist/client/assets/right-DiFmtw6d.js +0 -1
  387. package/dist/client/assets/right-Lx79pxpG.js +0 -1
  388. package/dist/client/assets/scoutbot-BJIamJOH.js +0 -3
  389. package/dist/client/assets/text-Faa3ZStB.js +0 -1
  390. package/dist/client/assets/useContentSecondaryNav-Bpkc8ayb.js +0 -1
  391. /package/dist/client/assets/{text-BYAFNLNq.css → runtime-picker-BYAFNLNq.css} +0 -0
@@ -1,2 +0,0 @@
1
- import{r as a,j as o}from"./index-BI9AljSD.js";/* empty css */import{a as rn}from"./api-Co9aQ2Jw.js";import{u as Fn}from"./tail-events-BdUrO0kb.js";import{i as _e,o as on}from"./surface-activity-B1rgWB1i.js";import{u as Wn}from"./observe-Da2mRAsc.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-Bu-C8Hxc.js";import{d as Vn}from"./types-B0PlfpKc.js";import{A as Gn}from"./AgentAvatar-B7c0egdP.js";import{h as Kn,S as Un}from"./SessionObserve-BCehTlO8.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-DTtux5sP.js";import{AgentFloorView as lt}from"./AgentFloorView-DMFiHs21.js";import{u as ct,s as dt,A as ut,a as ft,L as mt}from"./AgentLanesPreflight-CFadSaia.js";import{AgentLaneChrome as ht}from"./AgentLaneChrome-CTp39syR.js";import{AgentLaneCard as gt}from"./AgentLaneCard-ajZvcfdW.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-DRc-TpMB.js";import{LaneTraceDetailSheet as vt}from"./LaneTraceDetailSheet-C3C8UjXv.js";import{readStoredLaneSummaryHeight as St,useLaneSummaryResize as kt,AgentLaneSummaryResizeHandle as xt}from"./AgentLaneSummaryResize-VMNDo7kD.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-e6yGeorb.js";import{p as Qe}from"./lane-roster-store-Q7pcblY5.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-BI9AljSD.js";import{A as C}from"./AgentAvatar-B7c0egdP.js";import{H as S}from"./HarnessMark-DAaWPiT_.js";import{u as B,b as L,f as T}from"./use-fleet-active-asks-BtgNnRgK.js";import{b as F,p as R,N as _,t as u}from"./agent-master-model-DAZL92oe.js";import{t as q}from"./time-Dhsh_2EG.js";import{u as z}from"./use-conversation-list-DO5J8T1H.js";import{u as E}from"./Provider-Bu-C8Hxc.js";import{ConversationScreen as A}from"./ConversationScreen-CXAHQwQ3.js";/* empty css */import{A as O}from"./arrow-up-right-CY0Vw_67.js";import{X as H}from"./x-DfRJbqrh.js";import"./SpriteAvatar-56DTXxSV.js";import"./colors-BtO5_zlx.js";import"./CrewAvatar-CXJHLNVM.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./message-visibility-CGOmSSKs.js";import"./conversation-model-QsJVfSeG.js";import"./createLucideIcon-DthwWQIg.js";import"./router-DTtux5sP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./index-DfsTyYDx.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./ConversationComposer-H8_hsYSc.js";import"./zap-CIo8msJB.js";import"./message-markup-Cc_O-WdA.js";import"./mentions-DuLQnEcn.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./openContent-C6XO6kr5.js";import"./eye-FnaaPfja.js";import"./terminal-C3YRPfyz.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-B0ZBhE_E.js";import"./BackToPicker-Cto0Ioz9.js";import"./AstronautSuit-Cjjcv6yQ.js";import"./ConversationFeedRows-hlEFlURs.js";import"./ConversationPanels-fMo6Uy1v.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-8WuxLa5l.js";import"./proxy-1BABCaDb.js";import"./activity-CqZafWfx.js";import"./message-circle-B2DoYKDO.js";import"./tail-events-BdUrO0kb.js";import"./ConversationStatus-DI5GCiyW.js";import"./check-DbIkldnK.js";import"./sparkles-Cf8gin88.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-BI9AljSD.js";import{A as B}from"./AgentAvatar-B7c0egdP.js";import{H as S,h as w}from"./HarnessMark-DAaWPiT_.js";import{c as P}from"./colors-BtO5_zlx.js";import{f as R}from"./text-Faa3ZStB.js";import{t as C}from"./time-Dhsh_2EG.js";import"./Provider-Bu-C8Hxc.js";import"./router-DTtux5sP.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./createLucideIcon-DthwWQIg.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./loader-circle-B2W9DPG5.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./SpriteAvatar-56DTXxSV.js";import"./CrewAvatar-CXJHLNVM.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-BI9AljSD.js";import{p as S,a as E}from"./api-Co9aQ2Jw.js";import{u as W,d as X}from"./Provider-Bu-C8Hxc.js";import{Q,b as Y}from"./router-DTtux5sP.js";import{a as J}from"./sse-DDHEHUgz.js";import{o as Z,i as C}from"./surface-activity-B1rgWB1i.js";/* empty css */import{AgentsSubnav as ee}from"./AgentsSubnav-DUsya4WK.js";import{AgentsLibrary as te}from"./library-D1iXfda2.js";import{r as se,d as oe}from"./NewChatComposer-C_1op4dH.js";import{AgentDetailWithRail as ne,AgentProfileBar as ie}from"./profile-B3qDSbrH.js";/* empty css *//* empty css *//* empty css */import"./perf-PX8Rx0EP.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./createLucideIcon-DthwWQIg.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-BrXMtvKE.js";import"./secondaryNavConfig-C9bQ9_IA.js";import"./message-square-O-Hu9Mk2.js";import"./search-DmFM_9jm.js";import"./compass-BcRI_YXo.js";import"./settings-C6h9y5XX.js";import"./terminal-C3YRPfyz.js";import"./git-branch-DJyvr0k-.js";import"./scroll-text-kPhYbh-M.js";/* empty css */import"./time-Dhsh_2EG.js";import"./SpriteAvatar-56DTXxSV.js";import"./HarnessMark-DAaWPiT_.js";import"./AgentSessions-BePq5Lgc.js";import"./openContent-C6XO6kr5.js";import"./clipboard-e3fSpeo7.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./agents-project-model-UYiamtrU.js";import"./AgentAvatar-B7c0egdP.js";import"./CrewAvatar-CXJHLNVM.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-BkmktBHI.js";import"./terminal-relay-BFhdIstF.js";import"./BackToPicker-Cto0Ioz9.js";import"./ConversationScreen-CXAHQwQ3.js";import"./ConversationComposer-H8_hsYSc.js";import"./zap-CIo8msJB.js";import"./message-markup-Cc_O-WdA.js";import"./mentions-DuLQnEcn.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./eye-FnaaPfja.js";import"./message-visibility-CGOmSSKs.js";import"./operator-attention-RqieiSY8.js";import"./sessionRead-CvFz2RHv.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-B0ZBhE_E.js";import"./AstronautSuit-Cjjcv6yQ.js";import"./ConversationFeedRows-hlEFlURs.js";import"./ConversationPanels-fMo6Uy1v.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-8WuxLa5l.js";import"./proxy-1BABCaDb.js";import"./activity-CqZafWfx.js";import"./message-circle-B2DoYKDO.js";import"./tail-events-BdUrO0kb.js";import"./ConversationStatus-DI5GCiyW.js";import"./check-DbIkldnK.js";import"./sparkles-Cf8gin88.js";import"./SessionObserve-BCehTlO8.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-Bo2Zl-1a.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-BhVsvwkh.js";import"./ObserveTextFlow-BcrGQet8.js";import"./SessionObserveEvidence-Bb6U-dem.js";import"./wrench-DkxnZRlR.js";import"./external-link-C_nxk0MJ.js";import"./AgentDefinitionsWorkspace-BbcZc9Xk.js";import"./agent-specialization-BtxLN4UR.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-CY0RN78e.js";/* empty css */import"./agent-essentials-vytdybaX.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-BI9AljSD.js";import{S as i}from"./SecondaryNav-BrXMtvKE.js";import{A as m}from"./secondaryNavConfig-C9bQ9_IA.js";import"./createLucideIcon-DthwWQIg.js";import"./message-square-O-Hu9Mk2.js";import"./file-text--hfhwZH1.js";import"./search-DmFM_9jm.js";import"./compass-BcRI_YXo.js";import"./settings-C6h9y5XX.js";import"./terminal-C3YRPfyz.js";import"./git-branch-DJyvr0k-.js";import"./code-xml-CvKBY3KA.js";import"./scroll-text-kPhYbh-M.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-BI9AljSD.js";import{E as p}from"./EmptyState-D9X16fKq.js";import{a as f}from"./api-Co9aQ2Jw.js";import{S as b}from"./scoutbot-markdown-CQ7Y1McC.js";import{b as h,t as u}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */import"./perf-PX8Rx0EP.js";import"./Provider-Bu-C8Hxc.js";import"./router-DTtux5sP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./createLucideIcon-DthwWQIg.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./conversation-model-QsJVfSeG.js";import"./index-DfsTyYDx.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./external-link-C_nxk0MJ.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-BI9AljSD.js";import{r as us}from"./index-DfsTyYDx.js";import{D as hs}from"./text-Faa3ZStB.js";import{E as Ie}from"./EmptyState-D9X16fKq.js";import{B as fs,j as ms,F as ps,R as bs,G as ys,H as gs}from"./NewChatComposer-C_1op4dH.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-DDHEHUgz.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-Bu-C8Hxc.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-DbaCQlhw.js";import{DispatchAftermath as Is}from"./DispatchAftermath-CrELgl2e.js";import{i as $s,c as Ds,n as _e}from"./keyboard-nav-e6yGeorb.js";import{ShikiPane as Es}from"./ShikiPane-DPWsVNtn.js";import{d as Fs}from"./types-B0PlfpKc.js";/* empty css */import{L as ke}from"./loader-circle-B2W9DPG5.js";import{R as Ms}from"./refresh-cw-DmNAhaH0.js";import{X as De}from"./x-DfRJbqrh.js";import{A as Ts}from"./arrow-down-DvTsLokL.js";import{E as Ue}from"./external-link-C_nxk0MJ.js";import{C as Ls}from"./chevron-down-C475vltS.js";import{S as Ps}from"./sparkles-Cf8gin88.js";import{P as Bs}from"./paperclip-BudMKSyr.js";import{P as zs}from"./plus-BJ1If8vj.js";import{S as qs}from"./send-horizontal-qyjNgEaV.js";import{A as Ke}from"./arrow-right-BBsrogWf.js";import{C as Os}from"./check-DbIkldnK.js";import{C as _s}from"./copy-Cj-owMb-.js";import{M as Us}from"./message-square-O-Hu9Mk2.js";import{c as Xe}from"./createLucideIcon-DthwWQIg.js";import{R as Ks}from"./radio-B5OpHrrK.js";import{M as Hs,b as Js}from"./DocumentFocusViewer-DFFE85Tq.js";import{B as Gs}from"./bot-DzkOUFBb.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-BI9AljSD.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-QvxCUzTi.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-DplkpM7f.js";import{ShikiPane as Ye}from"./ShikiPane-DPWsVNtn.js";/* empty css */import{A as Ze}from"./arrow-left-DHfdXJVZ.js";import{C as et}from"./chevron-right-CnZRSd-V.js";import{C as tt}from"./check-DbIkldnK.js";import{C as nt}from"./copy-Cj-owMb-.js";import"./perf-PX8Rx0EP.js";import"./cache-CeWH_KzJ.js";import"./usePierreRuntime-BfZHKAkI.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";/* empty css */import"./chevron-down-C475vltS.js";import"./createLucideIcon-DthwWQIg.js";import"./search-DmFM_9jm.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-BI9AljSD.js";import{A as G}from"./AgentAvatar-B7c0egdP.js";import{M as J}from"./text-Faa3ZStB.js";import{j as Y,k as ee,l as O,m as se,M as _}from"./NewChatComposer-C_1op4dH.js";import{F as te}from"./file-text--hfhwZH1.js";import"./index-DfsTyYDx.js";import{c as I}from"./createLucideIcon-DthwWQIg.js";import{Z as ae}from"./zap-CIo8msJB.js";import{X as ne}from"./x-DfRJbqrh.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-BI9AljSD.js";import{M as p}from"./message-markup-Cc_O-WdA.js";import{f as d}from"./conversation-model-QsJVfSeG.js";import{t as n}from"./time-Dhsh_2EG.js";import"./mentions-DuLQnEcn.js";import"./colors-BtO5_zlx.js";import"./index-DfsTyYDx.js";import"./api-Co9aQ2Jw.js";import"./perf-PX8Rx0EP.js";import"./Provider-Bu-C8Hxc.js";import"./router-DTtux5sP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./createLucideIcon-DthwWQIg.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./HarnessMark-DAaWPiT_.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./AgentDetailCard-B_KLcgsP.js";import"./AgentLiveActions-CsQA3pu_.js";import"./terminal-takeover-B6H4llRR.js";import"./openContent-C6XO6kr5.js";import"./eye-FnaaPfja.js";import"./terminal-C3YRPfyz.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};
@@ -1 +0,0 @@
1
- import{r as k,j as e,H as G}from"./index-BI9AljSD.js";import{c as A}from"./clipboard-e3fSpeo7.js";import{b as K}from"./router-DTtux5sP.js";import{A as M}from"./AgentAvatar-B7c0egdP.js";import{H as J}from"./HarnessMark-DAaWPiT_.js";import{a as Q}from"./Provider-Bu-C8Hxc.js";import{n as Z,c as ee}from"./colors-BtO5_zlx.js";import{B as te}from"./BackToPicker-Cto0Ioz9.js";import{o as P}from"./openContent-C6XO6kr5.js";import{AstronautSuit as se}from"./AstronautSuit-Cjjcv6yQ.js";import{v as ne,w as ae}from"./conversation-model-QsJVfSeG.js";import{E as re}from"./eye-FnaaPfja.js";import{c as oe}from"./createLucideIcon-DthwWQIg.js";import"./perf-PX8Rx0EP.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-BQ6t92tJ.js";import"./api-Co9aQ2Jw.js";import"./SpriteAvatar-56DTXxSV.js";import"./CrewAvatar-CXJHLNVM.js";import"./sse-DDHEHUgz.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BJIamJOH.js";import"./DocumentFocusViewer-DFFE85Tq.js";import"./TextDocumentSurface-BeSwe3Yl.js";import"./file-text--hfhwZH1.js";import"./x-DfRJbqrh.js";import"./chevron-right-CnZRSd-V.js";import"./code-xml-CvKBY3KA.js";import"./arrow-left-DHfdXJVZ.js";import"./arrow-right-BBsrogWf.js";import"./scout-voice-BZKsdquE.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-e6yGeorb.js";import"./NewChatComposer-C_1op4dH.js";import"./text-Faa3ZStB.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B2W9DPG5.js";import"./index-DfsTyYDx.js";import"./NewChatOrigin-D7hwp6dm.js";import"./chevron-down-C475vltS.js";import"./search-DmFM_9jm.js";import"./chunk-HRAB3GC3-DLNT8aOo.js";import"./time-Dhsh_2EG.js";const ie=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],le=oe("user-plus",ie),X=150,_=320,ce=1.4,de=1.1,V=5,me=22,W=5200,he=1,pe=1200;function ue(n){k.useEffect(()=>{const s=n.current;if(!s||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let i=[],r=[],x=-9999,m=-9999,u=0;const c=()=>{i=[],r=[],s.querySelectorAll(".sprite-cell--eye circle").forEach(o=>{const a=o.getBoundingClientRect();if(!a.width)return;const h=o.closest("[data-state]");i.push({el:o,cx:a.left+a.width/2,cy:a.top+a.height/2,working:h?.dataset.state==="in_flight"})}),s.querySelectorAll(".s-thread-participant-avatar svg").forEach(o=>{const a=o.getBoundingClientRect();a.width&&r.push({el:o,cx:a.left+a.width/2,cy:a.top+a.height/2})})},y=o=>o<X?1:o>_?0:(_-o)/(_-X),f=o=>{for(const a of i){const h=x-a.cx,N=m-a.cy,b=Math.hypot(h,N),p=y(b),v=b<1?1:b;let j=h/v*ce*p;const w=N/v*de*p;if(a.working&&p<1){const S=o%W/W;j+=Math.sin(S*Math.PI*2)*he*(1-p)}a.el.style.transform=`translate(${j.toFixed(2)}px, ${w.toFixed(2)}px)`}for(const a of r){const h=x-a.cx,N=Math.hypot(h,m-a.cy),b=y(N),p=Math.max(-V,Math.min(V,h/me))*b;a.el.style.transform=p===0?"":`rotate(${p.toFixed(2)}deg)`}u=requestAnimationFrame(f)},d=o=>{x=o.clientX,m=o.clientY};c();const L=window.setInterval(c,pe);return u=requestAnimationFrame(f),window.addEventListener("resize",c),document.addEventListener("pointermove",d,{passive:!0}),()=>{cancelAnimationFrame(u),window.clearInterval(L),window.removeEventListener("resize",c),document.removeEventListener("pointermove",d);for(const o of i)o.el.style.transform="";for(const o of r)o.el.style.transform=""}},[n])}function E(n,s,i){const r=i?G[i.trim().toLowerCase()]:void 0;return{"--fp-z":String(n-s),"--fp-i":String(s),...r==null?{}:{"--fp-suit-hue":String(r)}}}function xe(n){if(n<1e3)return String(n);const s=n/1e3;return s<10?`${s.toFixed(1).replace(/\.0$/,"")}k`:`${Math.round(s)}k`}function O({name:n,runtime:s,state:i,action:r}){return e.jsxs("span",{className:"s-thread-participant-card","aria-hidden":"true",children:[e.jsx("strong",{children:n}),s?e.jsx("span",{children:s}):null,e.jsx("span",{children:i}),r?e.jsx("span",{className:"s-thread-participant-card-action",children:r}):null]})}function R({count:n,className:s,style:i,rosterId:r,expanded:x,onClick:m}){const u=`${n} more participant${n===1?"":"s"}`;return e.jsx("button",{type:"button",className:`s-thread-participant s-thread-participant--button ${s}`,style:i,"aria-label":`${u}; open participant list`,"aria-haspopup":"dialog","aria-controls":r,"aria-expanded":x,onClick:m,children:e.jsxs("span",{className:"s-thread-participant-face s-thread-participant-face--overflow",children:["+",xe(n)]})})}function ot({showBackNav:n,isDm:s,navigate:i,route:r,canonicalConversationId:x,threadTitle:m,agentId:u,sessionId:c,detailRoute:y,participants:f,operator:d,canAddParticipants:L,onToggleAddParticipant:o}){const a=Q(),h=K(r),N=k.useRef(null),b=k.useRef(null),p=k.useId(),[v,j]=k.useState(!1);ue(N);const w=f.slice(0,4),S=Math.max(f.length-w.length,0),z=Math.max(f.length-2,0),B=Math.max(f.length-1,0),C=w.length+(S>0?1:0)+(d.active?1:0);k.useEffect(()=>{if(!v)return;const t=g=>{b.current?.contains(g.target)||j(!1)},l=g=>{g.key==="Escape"&&j(!1)};return document.addEventListener("mousedown",t),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("keydown",l)}},[v]);const $=t=>t.agent?{view:"agents-v2",agentId:t.agent.id,...h?{machineId:h}:{}}:t.sessionId?{view:"sessions",sessionId:t.sessionId,...h?{machineId:h}:{}}:null,H=t=>{const l=$(t);l&&(j(!1),P(i,l,{returnTo:r}))};return e.jsxs("div",{className:"s-thread-center-header",onClick:t=>{t.target?.closest("button,a,input,select,textarea")||!s||!y||P(i,y,{returnTo:r})},style:s&&y?{cursor:"pointer"}:void 0,onContextMenu:t=>{const l=[{kind:"action",label:"Copy Title",onSelect:()=>{A(m)}}];u&&l.push({kind:"action",label:"Copy Agent ID",onSelect:()=>{A(u)}}),!u&&c&&l.push({kind:"action",label:"Copy Session ID",onSelect:()=>{A(c)}}),l.push({kind:"action",label:"Copy Conversation ID",onSelect:()=>{A(x)}}),a(t,l)},children:[n&&e.jsx(te,{slot:"conversation",fallback:{view:"inbox"},navigate:i,label:"Back",className:"s-thread-header-back"}),e.jsx("div",{className:"s-thread-center-header-info",children:s&&y?e.jsx("button",{type:"button",className:"s-thread-center-header-name",title:`Open ${m} details`,onClick:()=>P(i,y,{returnTo:r}),children:m}):e.jsx("span",{className:"s-thread-center-header-name",children:m})}),e.jsxs("div",{className:"s-thread-center-header-right",children:[f.length>0&&e.jsxs("div",{className:"s-thread-participants",ref:t=>{N.current=t,b.current=t},"aria-label":"Conversation participants",children:[w.map((t,l)=>{const g=[t.harness,t.model,t.reasoningEffort].filter(Boolean).join(" · ")||null,I=t.agent?Z(t.agent.state??null,t.agent):null,U=t.agent?ee(t.agent.state??null,t.agent):"Session participant",q=$(t),T=q?t.agent?"Open profile":"Open session":null,Y=[t.name,g,U,T].filter(Boolean).join(", "),D=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"s-thread-participant-face",children:[e.jsx(se,{}),e.jsx(M,{agent:t.agent??void 0,name:t.name,placement:"turn",size:28,className:"s-thread-participant-avatar"})]}),t.harness?e.jsx(J,{harness:t.harness,size:9,className:"s-thread-participant-harness",title:null}):null,e.jsx(O,{name:t.name,runtime:g,state:U,action:T})]}),F={className:"s-thread-participant",style:E(C,l,t.harness),"data-state":I??void 0,"data-compact-hidden":l>=2?"true":void 0,"data-narrow-hidden":l>=1?"true":void 0,"aria-label":Y};return q?e.jsx("button",{type:"button",...F,className:`${F.className} s-thread-participant--button`,onClick:()=>H(t),children:D},t.id):e.jsx("span",{...F,role:"group",tabIndex:0,children:D},t.id)}),S>0?e.jsx(R,{count:S,className:"s-thread-participant--desktop-overflow",style:E(C,w.length),rosterId:p,expanded:v,onClick:()=>j(t=>!t)}):null,z>0?e.jsx(R,{count:z,className:"s-thread-participant--compact-overflow",style:E(C,2),rosterId:p,expanded:v,onClick:()=>j(t=>!t)}):null,B>0?e.jsx(R,{count:B,className:"s-thread-participant--narrow-overflow",style:E(C,1),rosterId:p,expanded:v,onClick:()=>j(t=>!t)}):null,d.active?e.jsxs("span",{className:"s-thread-participant s-thread-participant--operator",style:E(C,C-1),role:"group",tabIndex:0,"aria-label":`${d.name}, you, in this conversation`,children:[e.jsx("span",{className:"s-thread-participant-face",children:e.jsx(M,{name:d.name,placement:"turn",size:28,className:"s-thread-participant-avatar"})}),e.jsx(O,{name:`${d.name} (you)`,runtime:null,state:"In this conversation",action:null})]}):e.jsxs("span",{className:"s-thread-participant-observer",role:"group",tabIndex:0,"aria-label":`${d.name}, observing, not in this conversation`,children:[e.jsx(re,{size:15,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx(O,{name:d.name,runtime:null,state:"Observing, not in this conversation",action:null})]}),v?e.jsxs("div",{id:p,className:"s-thread-participant-roster",role:"dialog","aria-label":"Conversation participants",onClick:t=>t.stopPropagation(),children:[e.jsx("strong",{className:"s-thread-participant-roster-title",children:"Participants"}),e.jsxs("div",{className:"s-thread-participant-roster-list",children:[f.map(t=>{const l=$(t),g=[t.harness,t.model].filter(Boolean).join(" · "),I=e.jsxs(e.Fragment,{children:[e.jsx(M,{agent:t.agent??void 0,name:t.name,placement:"turn",size:24,className:"s-thread-participant-roster-avatar"}),e.jsxs("span",{children:[e.jsx("strong",{children:t.name}),g?e.jsx("small",{children:g}):null]})]});return l?e.jsx("button",{type:"button",className:"s-thread-participant-roster-row",onClick:()=>H(t),children:I},t.id):e.jsx("div",{className:"s-thread-participant-roster-row",children:I},t.id)}),d.active?e.jsxs("div",{className:"s-thread-participant-roster-row",children:[e.jsx(M,{name:d.name,placement:"turn",size:24,className:"s-thread-participant-roster-avatar"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[d.name," (you)"]}),e.jsx("small",{children:"Operator"})]})]}):null]})]}):null]}),L&&e.jsx("button",{type:"button",className:"s-thread-add-participant-trigger",onClick:o,title:"Add participant","aria-label":"Add participant",children:e.jsx(le,{size:14,strokeWidth:1.9,"aria-hidden":"true"})})]})]})}function it({canonicalConversationId:n,conversationAlias:s}){return e.jsxs("div",{className:"s-thread-identity-row",children:[e.jsxs("button",{type:"button",className:"s-thread-identity-chip",title:n,onClick:()=>{A(n)},children:[e.jsx("span",{children:ne()}),e.jsx("strong",{children:ae(n)})]}),s&&e.jsxs("span",{className:"s-thread-identity-chip",title:s,children:[e.jsx("span",{children:"Alias"}),e.jsx("strong",{children:s})]})]})}function lt({agents:n,addParticipantId:s,setAddParticipantId:i,addingParticipant:r,addParticipantError:x,onCancel:m,onSubmit:u}){return e.jsxs("form",{className:"s-thread-add-participant",onSubmit:c=>{c.preventDefault(),u()},children:[e.jsxs("div",{className:"s-thread-add-participant-row",children:[e.jsxs("div",{className:"s-thread-add-participant-field",children:[e.jsx("label",{className:"s-thread-add-participant-label",htmlFor:"thread-add-participant-select",children:"Agent"}),e.jsx("select",{id:"thread-add-participant-select",className:"s-thread-add-participant-select",value:s,onChange:c=>i(c.target.value),autoFocus:!0,children:n.map(c=>e.jsx("option",{value:c.id,children:c.name},c.id))})]}),e.jsxs("div",{className:"s-thread-add-participant-actions",children:[e.jsx("button",{type:"button",className:"s-btn s-btn-sm",onClick:m,disabled:r,children:"Cancel"}),e.jsx("button",{type:"submit",className:"s-btn s-btn-primary s-btn-sm",disabled:r||s.trim().length===0,children:r?"Adding...":"Add"})]})]}),x&&e.jsx("div",{className:"s-thread-add-participant-error",children:x})]})}export{lt as AddParticipantForm,ot as ConversationHeader,it as ConversationIdentityRow};