@openscout/scout 0.2.87 → 0.2.91

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 (486) hide show
  1. package/README.md +10 -5
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +4 -4
  4. package/dist/client/assets/ActivityScreen-BUeb4ERK.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-Dw2oyCcz.js → AddProjectForm-DtTfn4Zk.js} +1 -1
  6. package/dist/client/assets/AgentAvatar-CneOa70z.js +1 -0
  7. package/dist/client/assets/AgentConfigurationScreen-CkZ7EjZh.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-0Y3kqMtv.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-2DZQahiN.js → AgentDetailCard-Dtc02KUO.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-B5raPB_U.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-DFG4ElZD.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-CeSjWWwh.js → AgentLaneCard-BRAkw8YJ.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-Do7CXwin.js → AgentLaneChrome-T8QE5742.js} +1 -1
  14. package/dist/client/assets/AgentLaneDetailSheet-C8RYotnv.js +4 -0
  15. package/dist/client/assets/{AgentLaneSummaryResize--lHgnncr.js → AgentLaneSummaryResize-FyYweLo_.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-BwkGk8JH.js → AgentLanesPreflight-Cil3dNwu.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-DPfO8MOo.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-BmXDRxER.js → AgentLiveActions-DwScaVRF.js} +1 -1
  20. package/dist/client/assets/AgentSessions-DKoWA0Lm.js +6 -0
  21. package/dist/client/assets/AgentsConsole-DoBIWGoq.js +1 -0
  22. package/dist/client/assets/AgentsScreen-JuUiSuwY.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +1 -0
  24. package/dist/client/assets/{AtopView-DOKJbiJL.js → AtopView-ycxMrRwp.js} +1 -1
  25. package/dist/client/assets/BackToPicker-D6WgIDb-.js +1 -0
  26. package/dist/client/assets/BriefingDetailScreen-Zw-taW1s.js +6 -0
  27. package/dist/client/assets/{BriefingsScreen-DLIJ8eYj.js → BriefingsScreen-BerYOoWS.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-C8WERmHF.js → BrokerMetadataPanel-Cu93j-Ga.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-CeN90URH.js +5 -0
  30. package/dist/client/assets/ChatCollapsedStrip-DdKyMSEM.js +1 -0
  31. package/dist/client/assets/{CodeDiffPane-CtgqIuS0.js → CodeDiffPane-BjCOBLze.js} +1 -1
  32. package/dist/client/assets/{CodeProjectPicker-C4W_udc7.js → CodeProjectPicker-NSGdCaK0.js} +1 -1
  33. package/dist/client/assets/{CodeScreen-WhTvVUKY.js → CodeScreen-CA9Sq6Dx.js} +1 -1
  34. package/dist/client/assets/ContextMenu-DnFcmfMR.js +1 -0
  35. package/dist/client/assets/ConversationComposer-CjRXFkvY.js +1 -0
  36. package/dist/client/assets/ConversationFeedRows-CgRTIpAv.js +1 -0
  37. package/dist/client/assets/ConversationHeader-CRmdtuL7.js +1 -0
  38. package/dist/client/assets/ConversationPanels-DCkcLIHk.js +2 -0
  39. package/dist/client/assets/ConversationScreen-Br0QQ3xo.js +1 -0
  40. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
  41. package/dist/client/assets/ConversationStatus-BJ1CMbAv.js +1 -0
  42. package/dist/client/assets/{DataTable-DFacT2uu.js → DataTable-Dzqiaha4.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-D797PbCe.js → DispatchAftermath-B0WMg_z3.js} +1 -1
  44. package/dist/client/assets/DocumentFocusViewer-CZVVIAD5.js +1 -0
  45. package/dist/client/assets/{EmbeddableSurfacesLab-JczLmmF-.js → EmbeddableSurfacesLab-C3a7hJWO.js} +1 -1
  46. package/dist/client/assets/{EmptyState-uQbB-bvP.js → EmptyState-CYNJZMrZ.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-ebbCtnHE.js → FileViewerPane-Fwt8_KmD.js} +1 -1
  48. package/dist/client/assets/FleetSearch-Dsi_l2KW.js +1 -0
  49. package/dist/client/assets/FleetSearch-EXOe8ulE.css +1 -0
  50. package/dist/client/assets/FlightObserveScreen-g_tiGmvz.js +1 -0
  51. package/dist/client/assets/{FollowScreen-Bfu2_KtU.js → FollowScreen-Bb_rcrzi.js} +1 -1
  52. package/dist/client/assets/{HarnessMark-CEzmPFHC.js → HarnessMark-DrE57dUq.js} +1 -1
  53. package/dist/client/assets/HarnessesScreen-CAsCJ_tG.js +1 -0
  54. package/dist/client/assets/{HerdrSession-BDLa_rrK.js → HerdrSession-1eVu9Owj.js} +1 -1
  55. package/dist/client/assets/HomeHero-DEl-WBsT.css +1 -0
  56. package/dist/client/assets/HomeHero-W445QrG1.js +1 -0
  57. package/dist/client/assets/{KnowledgeSearchInspector-GjmxYBi_.js → KnowledgeSearchInspector-CbPVg3fr.js} +1 -1
  58. package/dist/client/assets/KnowledgeSearchScreen-C1lN1xJk.js +1 -0
  59. package/dist/client/assets/{LaneToolHoverCard-DCY-m0JK.js → LaneToolHoverCard-BkBcDYm-.js} +1 -1
  60. package/dist/client/assets/LaneTraceDetailSheet-CzTd44rf.js +1 -0
  61. package/dist/client/assets/{LaneTraceEventFocus-BfKZ7G5c.js → LaneTraceEventFocus-BmMmPTyJ.js} +1 -1
  62. package/dist/client/assets/{MeshCanvas-CZYHLTvw.js → MeshCanvas-DwkjsiJ5.js} +2 -2
  63. package/dist/client/assets/{MeshCanvasMinimap-D3mJ78CM.js → MeshCanvasMinimap-vmCpU1sD.js} +1 -1
  64. package/dist/client/assets/MeshScreen-CkMepUpT.js +1 -0
  65. package/dist/client/assets/{MeshTopologyView-A-wh0Ad1.js → MeshTopologyView-BD2xLE2C.js} +2 -2
  66. package/dist/client/assets/MessageComposerSuggestions-qbalTne_.js +1 -0
  67. package/dist/client/assets/MessagesScreen-C8UynyLC.js +1 -0
  68. package/dist/client/assets/{MissionContextRail-MTL2EAnr.js → MissionContextRail-D5MEP2f4.js} +1 -1
  69. package/dist/client/assets/MissionControlView-K_I7eftL.js +1 -0
  70. package/dist/client/assets/MissionFocusOverlay-CWKLdUKG.js +1 -0
  71. package/dist/client/assets/MissionLeftAgentRow-ByGrNAcs.js +1 -0
  72. package/dist/client/assets/MissionLogPane-ZwHJ137T.js +1 -0
  73. package/dist/client/assets/{NewAgentModal-Ctixol4_.js → NewAgentModal-Do9aVvan.js} +1 -1
  74. package/dist/client/assets/NewChatComposer-DKlNX1UA.js +19 -0
  75. package/dist/client/assets/{NewChatOrigin-CCiPg_WR.js → NewChatOrigin-DXPvX-hh.js} +1 -1
  76. package/dist/client/assets/ObserveEmbedScreen-Dghsq2on.js +2 -0
  77. package/dist/client/assets/ObserveTextFlow-DWNlmTVm.js +2 -0
  78. package/dist/client/assets/ObservedTopologyPanel-BlmGoxCE.js +2 -0
  79. package/dist/client/assets/OpenScoutAppShell-DDqQi-oe.js +87 -0
  80. package/dist/client/assets/OpsAgentsView-Bn_fGBdo.js +1 -0
  81. package/dist/client/assets/OpsScreen-DHnT-Q9R.js +1 -0
  82. package/dist/client/assets/OpsSubnav-CJRD7MjM.js +1 -0
  83. package/dist/client/assets/PlanView-B6gKo543.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +1 -0
  85. package/dist/client/assets/{ProjectAgentProfileBar-B4RqrI0Q.js → ProjectAgentProfileBar-C5QWwZCn.js} +1 -1
  86. package/dist/client/assets/ProjectAgentProfileHero-DC7Dd8VL.js +1 -0
  87. package/dist/client/assets/ProjectsInbox-DCLrDmj1.js +2 -0
  88. package/dist/client/assets/ProjectsRail-C4hiXYSb.js +1 -0
  89. package/dist/client/assets/ProjectsScreen-jruZRjgD.js +1 -0
  90. package/dist/client/assets/ProjectsThreadAside-DYmL2dCY.js +1 -0
  91. package/dist/client/assets/Provider-p-xuaAoE.js +1 -0
  92. package/dist/client/assets/RailRow-Cf9LOiEj.css +1 -0
  93. package/dist/client/assets/RailRow-bRkkXIpR.js +1 -0
  94. package/dist/client/assets/RawSessionsTable-B7WKmXrk.js +1 -0
  95. package/dist/client/assets/RealtimeVoiceScreen-BzP3BQq9.js +1 -0
  96. package/dist/client/assets/{RepoDiffEmbedScreen-Cr1SL5ht.js → RepoDiffEmbedScreen-xjzjcJ_c.js} +1 -1
  97. package/dist/client/assets/{RepoDiffPageScreen-DeC8fsh_.js → RepoDiffPageScreen-DRzIY-dk.js} +1 -1
  98. package/dist/client/assets/RepoDiffViewer-CNDp01KM.js +7 -0
  99. package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +2 -0
  100. package/dist/client/assets/{ReposScreen-BQwIShXf.js → ReposScreen-CpaLC_NU.js} +6 -6
  101. package/dist/client/assets/ScoutDeckSurface-DkpZ-0DH.js +1 -0
  102. package/dist/client/assets/{ScoutSurface-DdVzN3DA.js → ScoutSurface-BENBUt5-.js} +1 -1
  103. package/dist/client/assets/ScoutbotBroadcastChip-CGZyxS5H.js +2 -0
  104. package/dist/client/assets/{agent-autocomplete-C7xwIcwd.css → ScoutbotBroadcastChip-CxtYZWPZ.css} +1 -1
  105. package/dist/client/assets/{ScoutbotFxLab-sLjfSKtS.js → ScoutbotFxLab-Bk2ZsfPp.js} +1 -1
  106. package/dist/client/assets/ScoutbotRealtimeVoiceCall-n63LdBZs.js +1 -0
  107. package/dist/client/assets/{SecondaryNav-CCQqTT3e.js → SecondaryNav-B4IsujYh.js} +1 -1
  108. package/dist/client/assets/{SessionEmbedScreen-BrLMZJ3N.js → SessionEmbedScreen-CPfH-jqN.js} +1 -1
  109. package/dist/client/assets/{SessionObserve-pbozyqVv.js → SessionObserve-B-SkP3tu.js} +1 -1
  110. package/dist/client/assets/{SessionObserveEvidence-C54Xvbps.js → SessionObserveEvidence-CF5jnH3-.js} +1 -1
  111. package/dist/client/assets/SessionRefScreen-C-4jjmVG.js +1 -0
  112. package/dist/client/assets/SessionsScreen-HAjFvmIq.js +1 -0
  113. package/dist/client/assets/SettingsDrawer-DATxwZrn.js +3 -0
  114. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
  115. package/dist/client/assets/SettingsScreen-Bu53X7J_.js +1 -0
  116. package/dist/client/assets/{ShikiPane-CiVH-45m.js → ShikiPane-DH8yYDks.js} +1 -1
  117. package/dist/client/assets/{SlidePanel-BLrLF9dt.js → SlidePanel-RFXJpfUa.js} +1 -1
  118. package/dist/client/assets/{SpriteAvatar-vpHO-rXs.js → SpriteAvatar-CEYdCzem.js} +1 -1
  119. package/dist/client/assets/{StatusPill-a3XBw1GG.js → StatusPill-9uy70ttd.js} +1 -1
  120. package/dist/client/assets/{TailView-C3rjOV7i.js → TailView-6bIrgdxN.js} +2 -2
  121. package/dist/client/assets/Terminal-BI6km7H4.js +1 -0
  122. package/dist/client/assets/TerminalEmbedScreen-D4JOWwtm.js +1 -0
  123. package/dist/client/assets/{TextDocumentSurface-B29xZNlI.js → TextDocumentSurface-BcP9vvji.js} +1 -1
  124. package/dist/client/assets/{TmuxPeek-eVfqPB4m.js → TmuxPeek-IaWqCgyJ.js} +1 -1
  125. package/dist/client/assets/{VoicePermissionsPanel-DpInOlVq.js → VoicePermissionsPanel-C80iZxgy.js} +1 -1
  126. package/dist/client/assets/{WorkDetailScreen-DYwgGaJs.js → WorkDetailScreen-CweZ6fEd.js} +3 -3
  127. package/dist/client/assets/WorkFilesViewer-Dy_-06iI.js +1 -0
  128. package/dist/client/assets/{activity-DTqqWiyV.js → activity-DS0u0Itf.js} +1 -1
  129. package/dist/client/assets/{addon-fit-CcaylYTX.js → addon-fit-CN888B3D.js} +1 -1
  130. package/dist/client/assets/{addon-webgl-B37iuzOG.js → addon-webgl-CoAnanQS.js} +1 -1
  131. package/dist/client/assets/{agent-essentials-DbbJm3ne.js → agent-essentials-CuK4G_zS.js} +1 -1
  132. package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
  133. package/dist/client/assets/{agent-lane-card-model-CSugZCdy.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
  134. package/dist/client/assets/{agent-lane-detail-D5EIlX7_.js → agent-lane-detail-BNNm6FNu.js} +1 -1
  135. package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-C33Dwpn7.js} +1 -1
  136. package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-BDNktFBZ.css} +1 -1
  137. package/dist/client/assets/{agent-lanes-model-BKOs_32K.js → agent-lanes-model-VYQ5a68i.js} +2 -2
  138. package/dist/client/assets/{api-BHHEUSS3.js → api-BkjHJfgJ.js} +1 -1
  139. package/dist/client/assets/api-h5zurxmi.js +1 -0
  140. package/dist/client/assets/{arc.es-BRPqOKIx.js → arc.es-BET9ev6q.js} +1 -1
  141. package/dist/client/assets/arrow-down-DxxPnPwh.js +1 -0
  142. package/dist/client/assets/{arrow-left-B0CdJdAC.js → arrow-left-CXDkJuCg.js} +1 -1
  143. package/dist/client/assets/{arrow-up-right-CilNLf4t.js → arrow-up-right-Bj8RjSqW.js} +1 -1
  144. package/dist/client/assets/{bot-Ba3gcRVa.js → bot-BSGSicKC.js} +1 -1
  145. package/dist/client/assets/broker-display-pp33bLsu.js +2 -0
  146. package/dist/client/assets/{cache-BO2Bd_LV.js → cache-Dr0why2k.js} +1 -1
  147. package/dist/client/assets/{check-BdovFDz8.js → check-BfA0T8UD.js} +1 -1
  148. package/dist/client/assets/{chevron-down-Jh540uf3.js → chevron-down-BVg09D6U.js} +1 -1
  149. package/dist/client/assets/{chevron-right-CV7sEVBS.js → chevron-right-CaEwYkxE.js} +1 -1
  150. package/dist/client/assets/{chunk-HRAB3GC3-BYQZ1LOn.js → chunk-HRAB3GC3-HhKwnZCi.js} +1 -1
  151. package/dist/client/assets/chunk-JTPDIGGW-DX2eTIQ_.js +46 -0
  152. package/dist/client/assets/chunk-T65CQEWV-D-bOfuCH.js +1 -0
  153. package/dist/client/assets/chunk-YOZR3KYS-oS9dlQCI.js +2 -0
  154. package/dist/client/assets/{clock-DpfYdWcr.js → clock-C3TUL7D7.js} +1 -1
  155. package/dist/client/assets/{code-xml-CPzpZkhu.js → code-xml-Dbvjk9Kw.js} +1 -1
  156. package/dist/client/assets/collapsed-strip-Dz-of2SM.css +1 -0
  157. package/dist/client/assets/content-BQuEedeL.js +1 -0
  158. package/dist/client/assets/content-BUae-L_N.js +1 -0
  159. package/dist/client/assets/content-BfG98J1k.js +1 -0
  160. package/dist/client/assets/content-BkVTfkAC.js +1 -0
  161. package/dist/client/assets/content-BsNMos_d.js +1 -0
  162. package/dist/client/assets/content-C2TZOKSE.js +1 -0
  163. package/dist/client/assets/content-CCn98eSk.js +1 -0
  164. package/dist/client/assets/content-CJuH5cDP.js +1 -0
  165. package/dist/client/assets/content-CYnPp9yo.js +1 -0
  166. package/dist/client/assets/content-CcrUhm4P.js +1 -0
  167. package/dist/client/assets/content-CiOMtgQc.js +1 -0
  168. package/dist/client/assets/content-CxuVONeQ.js +1 -0
  169. package/dist/client/assets/content-Dmq9n1_L.js +1 -0
  170. package/dist/client/assets/content-DskHP2NI.js +1 -0
  171. package/dist/client/assets/content-DvvzL2HK.js +1 -0
  172. package/dist/client/assets/content-snCAUbwv.js +1 -0
  173. package/dist/client/assets/{conversation-icons-bHIIZ9z3.js → conversation-icons-DmC_Ak3z.js} +1 -1
  174. package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
  175. package/dist/client/assets/conversation-motion-features-DPiGTO21.js +1 -0
  176. package/dist/client/assets/{copy-DQAM0eSY.js → copy-C79v_7D-.js} +1 -1
  177. package/dist/client/assets/{createLucideIcon-Da0lq809.js → createLucideIcon-DCq_3fQn.js} +1 -1
  178. package/dist/client/assets/ctx-panel-B4s49N9e.css +1 -0
  179. package/dist/client/assets/discover-IEnbrH8_.js +2 -0
  180. package/dist/client/assets/embed-entry-XUPb-AzL.js +2 -0
  181. package/dist/client/assets/{external-link-BheHazeW.js → external-link-Dd8xaveL.js} +1 -1
  182. package/dist/client/assets/{eye-B908WSFH.js → eye-DkU59kfl.js} +1 -1
  183. package/dist/client/assets/{file-text-BGVkHS4_.js → file-text-BITQqGtF.js} +1 -1
  184. package/dist/client/assets/gestures-B5rLNRpi.js +1 -0
  185. package/dist/client/assets/home-moving-signal-Bs635mVw.js +1 -0
  186. package/dist/client/assets/home-moving-signal-CAa0V91u.css +1 -0
  187. package/dist/client/assets/home-now-card-VxlLjg1A.js +1 -0
  188. package/dist/client/assets/{home-now-card-nano-iwd10r9G.js → home-now-card-nano-C06GMiwD.js} +1 -1
  189. package/dist/client/assets/hooks-BWiLxTw1.js +2 -0
  190. package/dist/client/assets/index-9as_JTUs.css +1 -0
  191. package/dist/client/assets/index-BTj2MguM.js +1 -0
  192. package/dist/client/assets/index-BZovGpDk.js +10 -0
  193. package/dist/client/assets/index-CvF09yvf.css +1 -0
  194. package/dist/client/assets/index-DiiEQwdc.js +1 -0
  195. package/dist/client/assets/index-vbaJ8sin.js +1 -0
  196. package/dist/client/assets/inspector-panel-C96HcyK5.js +2 -0
  197. package/dist/client/assets/{keyboard-nav-feLCB3Zm.js → keyboard-nav-CHo_xmjw.js} +1 -1
  198. package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BA3g9aVd.js} +1 -1
  199. package/dist/client/assets/{lane-roster-store-BAmj273z.js → lane-roster-store-B6ybJlHJ.js} +1 -1
  200. package/dist/client/assets/left-Bk3XnxPD.css +1 -0
  201. package/dist/client/assets/left-BuJ0wJW1.js +2 -0
  202. package/dist/client/assets/left-C6Zj3cR4.js +1 -0
  203. package/dist/client/assets/left-CCoobxPS.css +1 -0
  204. package/dist/client/assets/left-COMAiMfB.js +2 -0
  205. package/dist/client/assets/left-Ce4WKYPK.js +1 -0
  206. package/dist/client/assets/left-DMJkmJOF.js +1 -0
  207. package/dist/client/assets/left-DrCbY6ja.js +1 -0
  208. package/dist/client/assets/left-agents-BuSyVNGE.js +1 -0
  209. package/dist/client/assets/left-default-DRHywOKX.js +1 -0
  210. package/dist/client/assets/left-l92tw5Kc.js +1 -0
  211. package/dist/client/assets/left-lanes-4-aUyyrV.js +1 -0
  212. package/dist/client/assets/left-mission-e849d_Td.js +1 -0
  213. package/dist/client/assets/left-plan-MchYwAB_.js +2 -0
  214. package/dist/client/assets/library-DygjpA6u.js +1 -0
  215. package/dist/client/assets/{loader-circle-Be0T8xv2.js → loader-circle-B-l2Wj3-.js} +1 -1
  216. package/dist/client/assets/{local-agents-Q6KQ12B9.js → local-agents-Wof5knTJ.js} +1 -1
  217. package/dist/client/assets/{mentions-KNASbAjG.js → mentions-BjXfeF7t.js} +1 -1
  218. package/dist/client/assets/{mesh-ops-C-i8OMiM.js → mesh-ops-C1gq8zKf.js} +1 -1
  219. package/dist/client/assets/{mesh-view-store-B0lqpw8M.js → mesh-view-store-B56D3f77.js} +1 -1
  220. package/dist/client/assets/{message-circle-2v9Udia0.js → message-circle-BwVx5X0q.js} +1 -1
  221. package/dist/client/assets/{message-markup-BP2nH9kQ.js → message-markup-DlVX-iuc.js} +1 -1
  222. package/dist/client/assets/{message-square-DURSOrUr.js → message-square-BnkG6tae.js} +1 -1
  223. package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
  224. package/dist/client/assets/{mission-control-store-HeCy97KT.js → mission-control-store-CMgIVjLJ.js} +1 -1
  225. package/dist/client/assets/model-Co0zkMIc.js +1 -0
  226. package/dist/client/assets/{observe-DkAhvkfn.js → observe-DVHAcIrv.js} +1 -1
  227. package/dist/client/assets/{operator-attention-BqoWAlhp.js → operator-attention-BwSPeheT.js} +1 -1
  228. package/dist/client/assets/{page-status-CEP5pGf3.js → page-status-Bg2hd27j.js} +1 -1
  229. package/dist/client/assets/paperclip-DblaLD_N.js +1 -0
  230. package/dist/client/assets/plan-view-D56fneVF.css +1 -0
  231. package/dist/client/assets/{plus-ZReaTFF-.js → plus-BAI0t5g9.js} +1 -1
  232. package/dist/client/assets/profile-3Q4sUtvJ.js +1 -0
  233. package/dist/client/assets/projects-inbox-Da2hYEn6.js +1 -0
  234. package/dist/client/assets/{radio-BC9TO5Pl.js → radio-BGtkyCG9.js} +1 -1
  235. package/dist/client/assets/{refresh-cw-C4E58VJK.js → refresh-cw-DtF8xPqX.js} +1 -1
  236. package/dist/client/assets/resolve-panes-D4tlKNCT.js +1 -0
  237. package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +1 -0
  238. package/dist/client/assets/right-B8qg3JdB.js +1 -0
  239. package/dist/client/assets/{right-BarpRgcv.js → right-BU_W1kSH.js} +1 -1
  240. package/dist/client/assets/right-BlR7h0US.js +1 -0
  241. package/dist/client/assets/right-BwgwTGGd.js +1 -0
  242. package/dist/client/assets/right-ByptvkVX.js +1 -0
  243. package/dist/client/assets/right-CUP-NIDG.js +1 -0
  244. package/dist/client/assets/right-Ch_jrNe2.js +1 -0
  245. package/dist/client/assets/right-Dd2DscRz.js +1 -0
  246. package/dist/client/assets/right-DmVHd8Xj.js +1 -0
  247. package/dist/client/assets/{right-CIzaNH58.js → right-c4PAdFYZ.js} +1 -1
  248. package/dist/client/assets/{rocket-BahfIwFz.js → rocket-BWh18pt_.js} +1 -1
  249. package/dist/client/assets/router-63XV_E7f.js +1 -0
  250. package/dist/client/assets/{text-B2UZi3l9.js → runtime-picker-BXKJbLot.js} +1 -1
  251. package/dist/client/assets/runtime-picker-vhm0gtLs.css +1 -0
  252. package/dist/client/assets/{scope-views-CmG2X_S0.js → scope-views-Dm2_-NPi.js} +1 -1
  253. package/dist/client/assets/scout-voice-D8Q5sZOL.js +1 -0
  254. package/dist/client/assets/{scoutbot-D4vuKzOL.js → scoutbot-BTIErYHo.js} +2 -2
  255. package/dist/client/assets/{scroll-text-uulNqrf7.js → scroll-text-DZb3mmYo.js} +1 -1
  256. package/dist/client/assets/{search-HmdKXdtR.js → search-1QMVOxF3.js} +1 -1
  257. package/dist/client/assets/secondaryNavConfig-c0cz3MkJ.js +1 -0
  258. package/dist/client/assets/{selection-bridge-n4wNTm1B.js → selection-bridge-O9C4kGfF.js} +1 -1
  259. package/dist/client/assets/{send-horizontal-DOjHkZCD.js → send-horizontal-DbyEkGql.js} +1 -1
  260. package/dist/client/assets/{server-CX-xQjJA.js → server-Bncn9S7r.js} +1 -1
  261. package/dist/client/assets/{session-catalog-b7B1Sof1.js → session-catalog-DC6BlBBC.js} +1 -1
  262. package/dist/client/assets/{session-table-Djain1Qr.js → session-table-BUPq9Viy.js} +1 -1
  263. package/dist/client/assets/{sliders-horizontal-D2O6QiDN.js → sliders-horizontal-CMe8Bay1.js} +1 -1
  264. package/dist/client/assets/{sparkles-CgTby-ap.js → sparkles-_7cTZsIH.js} +1 -1
  265. package/dist/client/assets/{sse-QSbhyq9A.js → sse-Bb0EOcU9.js} +1 -1
  266. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
  267. package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-BRcJltQa.js} +1 -1
  268. package/dist/client/assets/{tail-events-B7BrDaFi.js → tail-events-C12pfUax.js} +1 -1
  269. package/dist/client/assets/{terminal-relay-C2TUIuh1.js → terminal-relay-BgfVJXIL.js} +1 -1
  270. package/dist/client/assets/{terminal-sessions-D4dHTRkt.js → terminal-sessions-AmSgHklm.js} +1 -1
  271. package/dist/client/assets/{terminal-takeover-BArLfNtd.js → terminal-takeover--05EYhJm.js} +1 -1
  272. package/dist/client/assets/{terminal-DNZTCr6a.js → terminal-xGf_F3y7.js} +1 -1
  273. package/dist/client/assets/text-DsBWV_4k.js +1 -0
  274. package/dist/client/assets/{use-conversation-list-htp0Ui63.js → use-conversation-list-DWX02INv.js} +1 -1
  275. package/dist/client/assets/{use-fleet-active-asks-BhuTn5mV.js → use-fleet-active-asks-Cnwa4hTK.js} +1 -1
  276. package/dist/client/assets/{use-mesh-ops-items-CD-qsvNX.js → use-mesh-ops-items-BRFm37oY.js} +1 -1
  277. package/dist/client/assets/use-reduced-motion-C8cWvIZ3.js +1 -0
  278. package/dist/client/assets/use-scout-dev-flags-FkMreOOb.js +1 -0
  279. package/dist/client/assets/{useAgentHoverCard-BIrm8esH.js → useAgentHoverCard-DvPZSJK3.js} +1 -1
  280. package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +1 -0
  281. package/dist/client/assets/{usePierreRuntime-CVTMzChM.js → usePierreRuntime-C8WJ0X3F.js} +1 -1
  282. package/dist/client/assets/{wrench-DwFKomxg.js → wrench-_tHBGTop.js} +1 -1
  283. package/dist/client/assets/{x-DuzAbpk5.js → x-CrGUKNRv.js} +1 -1
  284. package/dist/client/assets/{xterm-xQGYNyB-.js → xterm-Ks-VlLTq.js} +1 -1
  285. package/dist/client/index.html +2 -2
  286. package/dist/main.mjs +38 -169
  287. package/dist/node/main.mjs +240 -272
  288. package/dist/pairing-runtime-controller.mjs +476 -394
  289. package/dist/runtime/base-daemon.mjs +121 -49
  290. package/dist/runtime/broker-daemon.mjs +60 -171
  291. package/dist/runtime/broker-process-manager.mjs +0 -6
  292. package/dist/runtime/mesh-discover.mjs +0 -6
  293. package/dist/scout-control-plane-web.mjs +477 -672
  294. package/dist/scout-web-server.mjs +477 -672
  295. package/package.json +7 -6
  296. package/dist/client/assets/ActivityScreen-DRHTQIxu.js +0 -1
  297. package/dist/client/assets/AgentAvatar-CQqJcwOQ.js +0 -1
  298. package/dist/client/assets/AgentAvatar-CUZZARWG.css +0 -1
  299. package/dist/client/assets/AgentConfigurationScreen-C3OI6JmZ.js +0 -1
  300. package/dist/client/assets/AgentDefinitionsWorkspace-D0LDEqfl.js +0 -1
  301. package/dist/client/assets/AgentFloorView-CoGh2q5f.js +0 -1
  302. package/dist/client/assets/AgentInfoScreen-5ybfIL9p.js +0 -1
  303. package/dist/client/assets/AgentLaneDetailSheet-BD8B51ka.js +0 -4
  304. package/dist/client/assets/AgentLanesEmbedScreen-FRTVASPw.js +0 -1
  305. package/dist/client/assets/AgentLanesView-Bm85ittm.js +0 -2
  306. package/dist/client/assets/AgentSessions-C_tAfGN2.js +0 -6
  307. package/dist/client/assets/AgentsConsole-DsHWsaOJ.js +0 -1
  308. package/dist/client/assets/AgentsScreen-Bod6AHlA.js +0 -1
  309. package/dist/client/assets/AgentsSubnav-CsvYzzQ-.js +0 -1
  310. package/dist/client/assets/AstronautSuit-C05Ezxl9.js +0 -1
  311. package/dist/client/assets/BackToPicker-CXsbxbHM.js +0 -1
  312. package/dist/client/assets/BriefingDetailScreen-Uvnk3t0v.js +0 -1
  313. package/dist/client/assets/BrokerScreen-LZ3T7hGG.js +0 -5
  314. package/dist/client/assets/Canvas-BO9mx5_P.js +0 -1
  315. package/dist/client/assets/ChatCollapsedStrip-CtLPTLTY.js +0 -1
  316. package/dist/client/assets/ConversationComposer-DPWu3HvK.js +0 -1
  317. package/dist/client/assets/ConversationFeedRows-MhcPfxUr.js +0 -1
  318. package/dist/client/assets/ConversationHeader-Ce7TENb9.js +0 -1
  319. package/dist/client/assets/ConversationPanels-D-b5SLO-.js +0 -6
  320. package/dist/client/assets/ConversationScreen-C5HnXd5w.css +0 -1
  321. package/dist/client/assets/ConversationScreen-D77SoLos.js +0 -1
  322. package/dist/client/assets/ConversationStatus-lIvSKRic.js +0 -1
  323. package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
  324. package/dist/client/assets/CrewWorkspaces-CdojnRMG.js +0 -1
  325. package/dist/client/assets/DocumentFocusViewer-CetjnYut.js +0 -1
  326. package/dist/client/assets/FlightObserveScreen-sqvt7HUO.js +0 -1
  327. package/dist/client/assets/HarnessesScreen-CGhRsqD5.js +0 -1
  328. package/dist/client/assets/HomeHero-7JwycwFY.css +0 -1
  329. package/dist/client/assets/HomeHero-DdxTQ-6a.js +0 -1
  330. package/dist/client/assets/HostAdvisorView-BAUi5ZxX.js +0 -1
  331. package/dist/client/assets/KnowledgeSearchScreen-CRei9pyl.js +0 -1
  332. package/dist/client/assets/LaneTraceDetailSheet-CFsCvKa3.js +0 -1
  333. package/dist/client/assets/MeshScreen-dxNxRtKm.js +0 -1
  334. package/dist/client/assets/MessagesScreen-CR5v-WIE.js +0 -1
  335. package/dist/client/assets/MissionControlView-BGj1qnI2.js +0 -1
  336. package/dist/client/assets/MissionFocusOverlay-hWi6y87j.js +0 -1
  337. package/dist/client/assets/MissionLeftAgentRow-BSRRiiig.js +0 -1
  338. package/dist/client/assets/MissionLogPane-bbG_pM9B.js +0 -1
  339. package/dist/client/assets/NewChatComposer-BPsg8shF.js +0 -19
  340. package/dist/client/assets/ObserveEmbedScreen-Be87Chod.js +0 -2
  341. package/dist/client/assets/ObserveTextFlow-CKYltTPJ.js +0 -2
  342. package/dist/client/assets/ObservedTopologyPanel-CfHYu-4Z.js +0 -2
  343. package/dist/client/assets/OpenScoutAppShell-DPeP1vtK.js +0 -88
  344. package/dist/client/assets/OpsAgentsView-dEtw9yt-.js +0 -1
  345. package/dist/client/assets/OpsScreen-QXRJY8Vf.js +0 -1
  346. package/dist/client/assets/OpsSubnav-BK9Fj3gU.js +0 -1
  347. package/dist/client/assets/ProjectAgentProfile-BjykZ2Xd.js +0 -1
  348. package/dist/client/assets/ProjectAgentProfileHero-Bc0g8rhW.js +0 -1
  349. package/dist/client/assets/ProjectsInbox--ZIqo-IE.js +0 -2
  350. package/dist/client/assets/ProjectsRail-CzS0qTCI.js +0 -1
  351. package/dist/client/assets/ProjectsScreen-0gx7f30h.js +0 -1
  352. package/dist/client/assets/ProjectsThreadAside-BsQRFbdy.js +0 -1
  353. package/dist/client/assets/Provider-Cd-QZltN.js +0 -1
  354. package/dist/client/assets/RailRow-B0sRaJc6.css +0 -1
  355. package/dist/client/assets/RailRow-BY6fxePa.js +0 -1
  356. package/dist/client/assets/RawSessionsTable-CbopOF34.js +0 -1
  357. package/dist/client/assets/RealtimeVoiceScreen-CU4uXz4C.js +0 -9
  358. package/dist/client/assets/RepoDiffViewer-CiTOWK_Z.js +0 -7
  359. package/dist/client/assets/RepoDiffViewerLazy-BU3V7Kwq.js +0 -2
  360. package/dist/client/assets/ScoutDeckSurface-BncYKicb.js +0 -1
  361. package/dist/client/assets/SessionRefScreen-UVNVrwAf.js +0 -1
  362. package/dist/client/assets/SessionsScreen-KeDb5gz4.js +0 -1
  363. package/dist/client/assets/SettingsDrawer-CWdj0VvN.js +0 -3
  364. package/dist/client/assets/SettingsDrawer-J-8x1eII.css +0 -1
  365. package/dist/client/assets/SettingsScreen-C7zJgZzj.js +0 -1
  366. package/dist/client/assets/Terminal-CMQFmHnn.js +0 -1
  367. package/dist/client/assets/TerminalEmbedScreen-GvpoGERN.js +0 -1
  368. package/dist/client/assets/TerminalRelay-CIHlLVf1.js +0 -46
  369. package/dist/client/assets/WorkFilesViewer-C7H5fXaZ.js +0 -1
  370. package/dist/client/assets/agent-autocomplete-cOPLtuhM.js +0 -2
  371. package/dist/client/assets/agent-identity-CIMT7oV6.js +0 -1
  372. package/dist/client/assets/agent-specialization-D3-sqwhU.js +0 -1
  373. package/dist/client/assets/api-DEHEgJ9m.js +0 -1
  374. package/dist/client/assets/archive-DPMdoW_D.js +0 -1
  375. package/dist/client/assets/arrow-right-YRBoTTyf.js +0 -1
  376. package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
  377. package/dist/client/assets/collapsed-strip-raJWthAH.css +0 -1
  378. package/dist/client/assets/compass-D5Io6BIV.js +0 -1
  379. package/dist/client/assets/content-3b_jmxEx.js +0 -1
  380. package/dist/client/assets/content-B-i0XY-t.js +0 -1
  381. package/dist/client/assets/content-BD-DNFmb.js +0 -1
  382. package/dist/client/assets/content-BGeo5tgd.js +0 -1
  383. package/dist/client/assets/content-BMvXPLiQ.js +0 -1
  384. package/dist/client/assets/content-BWTbfMDg.js +0 -1
  385. package/dist/client/assets/content-BwCmeUmF.js +0 -1
  386. package/dist/client/assets/content-C1K3NcZa.js +0 -1
  387. package/dist/client/assets/content-C34J5_Af.js +0 -1
  388. package/dist/client/assets/content-CGRtIS2m.js +0 -1
  389. package/dist/client/assets/content-CIJo_-JS.js +0 -1
  390. package/dist/client/assets/content-CvqIqVAV.js +0 -1
  391. package/dist/client/assets/content-DRnwm-Vu.js +0 -1
  392. package/dist/client/assets/content-Dh39SSvP.js +0 -1
  393. package/dist/client/assets/content-DoypqDj5.js +0 -1
  394. package/dist/client/assets/content-n3mvc6NQ.js +0 -1
  395. package/dist/client/assets/conversation-model-CIzM7aXT.js +0 -1
  396. package/dist/client/assets/conversation-motion-features-CrP5K-dk.js +0 -1
  397. package/dist/client/assets/cpu-CtQc0Z9D.js +0 -1
  398. package/dist/client/assets/credentials-qwds23lv.js +0 -1
  399. package/dist/client/assets/ctx-panel-D_HJ3nhb.css +0 -1
  400. package/dist/client/assets/discover-DdkMhTAV.js +0 -2
  401. package/dist/client/assets/embed-entry-DoSM1GZB.js +0 -2
  402. package/dist/client/assets/file-code-corner-C5Pc6znt.js +0 -1
  403. package/dist/client/assets/gauge-sc_gb5Zw.js +0 -1
  404. package/dist/client/assets/gestures-AzPBSf20.js +0 -1
  405. package/dist/client/assets/git-branch-CdJU49Af.js +0 -1
  406. package/dist/client/assets/home-moving-signal-CZo2bYBi.js +0 -1
  407. package/dist/client/assets/home-moving-signal-DMguaRWR.css +0 -1
  408. package/dist/client/assets/home-now-card-DgxfZHcR.js +0 -1
  409. package/dist/client/assets/hooks-CeCCO6Yg.js +0 -2
  410. package/dist/client/assets/host-advisor-B2Fqs5Dd.css +0 -1
  411. package/dist/client/assets/index-BIiI9gfa.js +0 -1
  412. package/dist/client/assets/index-CD2foMB8.js +0 -1
  413. package/dist/client/assets/index-DReHD_4U.js +0 -1
  414. package/dist/client/assets/index-DzlEgstl.css +0 -1
  415. package/dist/client/assets/index-NRbRrZw-.js +0 -10
  416. package/dist/client/assets/index-wLwc74Pu.css +0 -1
  417. package/dist/client/assets/inspector-panel-CBf8pW7s.js +0 -2
  418. package/dist/client/assets/layers-D9fblkql.js +0 -1
  419. package/dist/client/assets/layout-grid-Vd1chalc.js +0 -1
  420. package/dist/client/assets/left-41_3QKk1.js +0 -1
  421. package/dist/client/assets/left-B3ofA1Pr.js +0 -2
  422. package/dist/client/assets/left-BWBZQhxQ.js +0 -1
  423. package/dist/client/assets/left-BhA6essi.js +0 -1
  424. package/dist/client/assets/left-BmTKCv4f.js +0 -1
  425. package/dist/client/assets/left-CCGR6tIF.js +0 -2
  426. package/dist/client/assets/left-DH44V4I_.css +0 -1
  427. package/dist/client/assets/left-Dfwzkwh_.js +0 -1
  428. package/dist/client/assets/left-R2OOE7VG.css +0 -1
  429. package/dist/client/assets/left-advisor-yrzW1Kwz.js +0 -1
  430. package/dist/client/assets/left-agents-Bgahk0FF.js +0 -1
  431. package/dist/client/assets/left-default-CtkfAquc.js +0 -1
  432. package/dist/client/assets/left-lanes-CpujaVN3.js +0 -1
  433. package/dist/client/assets/left-mission-Bbd-fW6W.js +0 -1
  434. package/dist/client/assets/library-Dx14WNGd.js +0 -1
  435. package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
  436. package/dist/client/assets/persistent-state-Bm_0TmZL.js +0 -1
  437. package/dist/client/assets/profile-Y0X7HZHc.js +0 -1
  438. package/dist/client/assets/projects-inbox-Cbfj4Hx7.js +0 -1
  439. package/dist/client/assets/provider-Bq0ScH3v.js +0 -1
  440. package/dist/client/assets/proxy-DtC2iXnT.js +0 -1
  441. package/dist/client/assets/resolve-panes-BI3WdDS-.js +0 -1
  442. package/dist/client/assets/resolve-sidebar-context-_g0pIxOr.js +0 -1
  443. package/dist/client/assets/right-BA0F8fPI.js +0 -1
  444. package/dist/client/assets/right-C4GXB45w.js +0 -1
  445. package/dist/client/assets/right-CXetlD8X.js +0 -1
  446. package/dist/client/assets/right-CnRcQS_I.js +0 -1
  447. package/dist/client/assets/right-D2_rmbAH.js +0 -1
  448. package/dist/client/assets/right-Dqp--KwX.js +0 -1
  449. package/dist/client/assets/right-HJJzRuGD.js +0 -1
  450. package/dist/client/assets/right-WCMb8YXJ.js +0 -1
  451. package/dist/client/assets/router-Bx1tiwVe.js +0 -1
  452. package/dist/client/assets/scout-voice-BT3gYDhU.js +0 -1
  453. package/dist/client/assets/scoutbot-markdown-DIhLsYxz.js +0 -6
  454. package/dist/client/assets/secondaryNavConfig-BVQiyAXu.js +0 -1
  455. package/dist/client/assets/settings-BpKRzxOD.js +0 -1
  456. package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +0 -1
  457. package/dist/client/assets/text-rLpBg4_z.css +0 -1
  458. package/dist/client/assets/use-reduced-motion-0fAsybdo.js +0 -1
  459. package/dist/client/assets/use-scout-dev-flags-DV_I6URU.js +0 -1
  460. package/dist/client/assets/useContentSecondaryNav-4atpGgFw.js +0 -1
  461. package/dist/client/assets/usePersistentState-InmPXIN4.js +0 -1
  462. package/dist/client/assets/zap-CocRNtyr.js +0 -1
  463. package/dist/client/crew/brik-bust.webp +0 -0
  464. package/dist/client/crew/brik-chip-id.webp +0 -0
  465. package/dist/client/crew/lulu-bust.webp +0 -0
  466. package/dist/client/crew/milo-bust.webp +0 -0
  467. package/dist/client/crew/milo-chip-id.webp +0 -0
  468. package/dist/client/crew/nori-bust.webp +0 -0
  469. package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
  470. package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
  471. package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
  472. package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
  473. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  474. package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
  475. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  476. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  477. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  478. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  479. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  480. package/dist/client/crew/sprout-bust.webp +0 -0
  481. package/dist/client/crew/sprout-chip-id.webp +0 -0
  482. package/dist/client/crew/vex-bust.webp +0 -0
  483. package/dist/client/crew/vex-chip-id.webp +0 -0
  484. package/dist/client/crew/wrench-bust.webp +0 -0
  485. package/dist/client/crew/wrench-chip-id.webp +0 -0
  486. /package/dist/client/assets/{DocumentFocusViewer-BSC_JwVE.css → document-focus-viewer-BSC_JwVE.css} +0 -0
@@ -1 +0,0 @@
1
- import{r as p,j as r}from"./index-NRbRrZw-.js";/* empty css */import{i as J,n as Z,s as ee}from"./colors-BtO5_zlx.js";import{a as A}from"./api-DEHEgJ9m.js";import{u as te}from"./sse-QSbhyq9A.js";import{t as re}from"./time-Dhsh_2EG.js";import{D as ne}from"./DataTable-DFacT2uu.js";import{u as ae}from"./useAgentHoverCard-BIrm8esH.js";import{S as se}from"./search-HmdKXdtR.js";import{S as oe}from"./sliders-horizontal-D2O6QiDN.js";import"./index-BWHgHrtv.js";/* empty css */import"./index-CD2foMB8.js";import"./AgentDetailCard-2DZQahiN.js";import"./AgentLiveActions-BmXDRxER.js";import"./terminal-takeover-BArLfNtd.js";import"./Provider-Cd-QZltN.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./HarnessMark-CEzmPFHC.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./openContent-C6XO6kr5.js";import"./eye-B908WSFH.js";import"./terminal-DNZTCr6a.js";function ie(e,t){return{model:t?.data.metadata?.session?.model??e.model??null,provider:t?.data.metadata?.session?.modelProvider??e.providerName??null}}const ce=["openai","codex","codex_app_server"],ue=["anthropic","claude","claude-code","claude_stream_json"],W={"openai:gpt-5.5":{provider:"openai",model:"gpt-5.5",inputPerM:5,cachedInputPerM:.5,cacheWritePerM:null,outputPerM:30,webSearchPer1K:10},"openai:gpt-5.5-pro":{provider:"openai",model:"gpt-5.5-pro",inputPerM:30,cachedInputPerM:null,cacheWritePerM:null,outputPerM:180,webSearchPer1K:10},"openai:gpt-5.4":{provider:"openai",model:"gpt-5.4",inputPerM:2.5,cachedInputPerM:.25,cacheWritePerM:null,outputPerM:15,webSearchPer1K:10},"openai:gpt-5.4-mini":{provider:"openai",model:"gpt-5.4-mini",inputPerM:.75,cachedInputPerM:.075,cacheWritePerM:null,outputPerM:4.5,webSearchPer1K:10},"openai:gpt-5.4-nano":{provider:"openai",model:"gpt-5.4-nano",inputPerM:.2,cachedInputPerM:.02,cacheWritePerM:null,outputPerM:1.25,webSearchPer1K:10},"openai:gpt-5.4-pro":{provider:"openai",model:"gpt-5.4-pro",inputPerM:30,cachedInputPerM:null,cacheWritePerM:null,outputPerM:180,webSearchPer1K:10},"openai:gpt-5.3-codex":{provider:"openai",model:"gpt-5.3-codex",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.3-chat-latest":{provider:"openai",model:"gpt-5.3-chat-latest",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2":{provider:"openai",model:"gpt-5.2",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2-codex":{provider:"openai",model:"gpt-5.2-codex",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2-chat-latest":{provider:"openai",model:"gpt-5.2-chat-latest",inputPerM:1.75,cachedInputPerM:.175,cacheWritePerM:null,outputPerM:14,webSearchPer1K:10},"openai:gpt-5.2-pro":{provider:"openai",model:"gpt-5.2-pro",inputPerM:21,cachedInputPerM:null,cacheWritePerM:null,outputPerM:168,webSearchPer1K:10},"openai:gpt-5.1":{provider:"openai",model:"gpt-5.1",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5.1-codex":{provider:"openai",model:"gpt-5.1-codex",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5.1-codex-max":{provider:"openai",model:"gpt-5.1-codex-max",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5.1-chat-latest":{provider:"openai",model:"gpt-5.1-chat-latest",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5":{provider:"openai",model:"gpt-5",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5-codex":{provider:"openai",model:"gpt-5-codex",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5-chat-latest":{provider:"openai",model:"gpt-5-chat-latest",inputPerM:1.25,cachedInputPerM:.125,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-5-mini":{provider:"openai",model:"gpt-5-mini",inputPerM:.25,cachedInputPerM:.025,cacheWritePerM:null,outputPerM:2,webSearchPer1K:10},"openai:gpt-5-nano":{provider:"openai",model:"gpt-5-nano",inputPerM:.05,cachedInputPerM:.005,cacheWritePerM:null,outputPerM:.4,webSearchPer1K:10},"openai:gpt-5-pro":{provider:"openai",model:"gpt-5-pro",inputPerM:15,cachedInputPerM:null,cacheWritePerM:null,outputPerM:120,webSearchPer1K:10},"openai:gpt-4.1":{provider:"openai",model:"gpt-4.1",inputPerM:2,cachedInputPerM:.5,cacheWritePerM:null,outputPerM:8,webSearchPer1K:10},"openai:gpt-4.1-mini":{provider:"openai",model:"gpt-4.1-mini",inputPerM:.4,cachedInputPerM:.1,cacheWritePerM:null,outputPerM:1.6,webSearchPer1K:10},"openai:gpt-4.1-nano":{provider:"openai",model:"gpt-4.1-nano",inputPerM:.1,cachedInputPerM:.025,cacheWritePerM:null,outputPerM:.4,webSearchPer1K:10},"openai:gpt-4o":{provider:"openai",model:"gpt-4o",inputPerM:2.5,cachedInputPerM:1.25,cacheWritePerM:null,outputPerM:10,webSearchPer1K:10},"openai:gpt-4o-mini":{provider:"openai",model:"gpt-4o-mini",inputPerM:.15,cachedInputPerM:.075,cacheWritePerM:null,outputPerM:.6,webSearchPer1K:10},"anthropic:claude-opus-4.6":{provider:"anthropic",model:"claude-opus-4.6",inputPerM:5,cachedInputPerM:.5,cacheWritePerM:6.25,outputPerM:25,webSearchPer1K:10},"anthropic:claude-opus-4.5":{provider:"anthropic",model:"claude-opus-4.5",inputPerM:5,cachedInputPerM:.5,cacheWritePerM:6.25,outputPerM:25,webSearchPer1K:10},"anthropic:claude-opus-4.1":{provider:"anthropic",model:"claude-opus-4.1",inputPerM:15,cachedInputPerM:1.5,cacheWritePerM:18.75,outputPerM:75,webSearchPer1K:10},"anthropic:claude-opus-4":{provider:"anthropic",model:"claude-opus-4",inputPerM:15,cachedInputPerM:1.5,cacheWritePerM:18.75,outputPerM:75,webSearchPer1K:10},"anthropic:claude-sonnet-4.6":{provider:"anthropic",model:"claude-sonnet-4.6",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-sonnet-4.5":{provider:"anthropic",model:"claude-sonnet-4.5",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-sonnet-4":{provider:"anthropic",model:"claude-sonnet-4",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-3-7-sonnet":{provider:"anthropic",model:"claude-3-7-sonnet",inputPerM:3,cachedInputPerM:.3,cacheWritePerM:3.75,outputPerM:15,webSearchPer1K:10},"anthropic:claude-haiku-4.5":{provider:"anthropic",model:"claude-haiku-4.5",inputPerM:1,cachedInputPerM:.1,cacheWritePerM:1.25,outputPerM:5,webSearchPer1K:10}},le={"claude-sonnet-4-5":"anthropic:claude-sonnet-4.5","claude-sonnet-4-6":"anthropic:claude-sonnet-4.6","claude-opus-4-5":"anthropic:claude-opus-4.5","claude-opus-4-6":"anthropic:claude-opus-4.6","claude-haiku-4-5":"anthropic:claude-haiku-4.5"};function pe(e){const t=e.provider?.trim().toLowerCase()??"",s=e.adapterType?.trim().toLowerCase()??"",a=V(e.model)??"",i=[t,s].filter(Boolean);return i.some(o=>ce.some(c=>o.includes(c)))?"openai":i.some(o=>ue.some(c=>o.includes(c)))?"anthropic":a.startsWith("gpt-")||a.startsWith("o")||a.includes("codex")?"openai":a.startsWith("claude-")?"anthropic":"unknown"}function V(e){return e?e.trim().toLowerCase().replace(/^(openai|anthropic)\//,"").replace(/_/g,"-").replace(/-\d{8}$/,""):null}function de(e){const t=x(e?.inputTokens),s=x(e?.cacheReadInputTokens),a=x(e?.cacheCreationInputTokens),i=x(e?.outputTokens),o=x(e?.reasoningOutputTokens),c=[t,i].reduce((m,b)=>m+(b??0),0),h=x(e?.totalTokens)??(c||null);return{input:t,uncachedInput:t==null?null:Math.max(0,t-(s??0)-(a??0)),cachedInput:s,cacheWrite:a,output:i,reasoningOutput:o,total:h,webSearchRequests:x(e?.webSearchRequests),webFetchRequests:x(e?.webFetchRequests)}}function he(e){const t=pe(e),s=V(e.model),a=de(e.usage),i=me(t,s),o=ge(e);if(!i.rateCard)return{provider:t,model:s,rateCard:null,rateCardSource:"unknown",capturedAt:e.capturedAt??Date.now(),usage:a,lineItems:[],totalUsd:null,billedTotalUsd:null,billingMode:o,subscriptionWindows:e.subscriptionWindows??[]};const c=i.rateCard,h=a.uncachedInput??a.input??0,m=a.cachedInput??0,b=a.cacheWrite??0,g=a.output??0,v=a.webSearchRequests??0,f=[j("input","Input",h,c.inputPerM,o),j("cached_input","Cached input",m,c.cachedInputPerM??c.inputPerM,o),j("cache_write","Cache write",b,c.cacheWritePerM??c.inputPerM,o),j("output","Output",g,c.outputPerM,o),{key:"web_search",label:"Web search",quantity:v,unit:"requests",rate:c.webSearchPer1K??0,billedRate:o==="subscription"?0:c.webSearchPer1K??0,costUsd:v/1e3*(c.webSearchPer1K??0),billedCostUsd:o==="subscription"?0:v/1e3*(c.webSearchPer1K??0)}].filter(P=>P.quantity>0);return{provider:t,model:s,rateCard:c,rateCardSource:i.source,capturedAt:e.capturedAt??Date.now(),usage:a,lineItems:f,totalUsd:f.reduce((P,d)=>P+d.costUsd,0),billedTotalUsd:f.reduce((P,d)=>P+d.billedCostUsd,0),billingMode:o,subscriptionWindows:e.subscriptionWindows??[]}}function me(e,t){if(e==="unknown")return{rateCard:null,source:"unknown"};const s=t?`${e}:${t}`:null;if(s&&W[s])return{rateCard:W[s],source:"exact"};const a=t?le[t]:null;if(a&&W[a])return{rateCard:W[a],source:"alias"};if(e==="anthropic"){if(t?.includes("opus"))return{rateCard:W["anthropic:claude-opus-4.5"],source:"provider-default"};if(t?.includes("haiku"))return{rateCard:W["anthropic:claude-haiku-4.5"],source:"provider-default"};if(t?.includes("sonnet")||!t)return{rateCard:W["anthropic:claude-sonnet-4.5"],source:"provider-default"}}return{rateCard:null,source:"unknown"}}function j(e,t,s,a,i){const o=i==="subscription"?0:a;return{key:e,label:t,quantity:s,unit:"tokens",rate:a,billedRate:o,costUsd:s/1e6*a,billedCostUsd:s/1e6*o}}function x(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function ge(e){if(e.billingMode)return e.billingMode;const t=e.adapterType?.trim().toLowerCase();if(t==="claude-code"||t==="claude_stream_json")return"subscription";const s=e.usage?.planType?.trim().toLowerCase();return!s||s==="api"||s.includes("api")?"api":"subscription"}const Pe=1500,T=1440*6e4,Me=90*6e4,E={needs_attention:0,in_turn:1,in_flight:2,callable:3,blocked:4},be=[{key:"agent",label:"Agent",kind:"custom",sortable:!0,sortValue:e=>e.agent.name.toLowerCase(),defaultWidth:220,minWidth:160,render:e=>r.jsxs("div",{className:"s-ops-agents-agent-cell",children:[r.jsx("span",{className:"s-ops-agents-dot",style:{background:ee(e.state)},"aria-hidden":!0}),r.jsx("span",{className:"s-ops-agents-agent-name",title:e.agent.name,children:e.agent.handle??e.agent.name})]})},{key:"task",label:"Active task",kind:"custom",sortable:!0,sortValue:e=>(e.activeTask??"").toLowerCase()||null,defaultWidth:240,minWidth:140,render:e=>e.activeTask?r.jsx("span",{className:"s-ops-agents-task",title:e.activeTask,children:e.activeTask}):r.jsx("span",{className:"s-ops-agents-task s-ops-agents-task--idle",children:"—"})},{key:"team",label:"Project",kind:"text",defaultWidth:140,minWidth:90,cls:"s-ops-agents-meta",render:e=>r.jsx("span",{className:"s-ops-agents-meta-cell",children:e.team}),sortValue:e=>e.team.toLowerCase()},{key:"machine",label:"Machine",kind:"text",defaultWidth:120,minWidth:88,cls:"s-ops-agents-meta",render:e=>r.jsx("span",{className:"s-ops-agents-meta-cell",children:e.machine}),sortValue:e=>e.machine.toLowerCase()},{key:"active",label:"Active",kind:"number",defaultWidth:90,minWidth:64,cls:"s-ops-agents-num",render:e=>e.activeFlights,sortValue:e=>e.activeFlights},{key:"sessions24h",label:"24h sessions",kind:"number",defaultWidth:108,minWidth:78,cls:"s-ops-agents-num",render:e=>e.sessions24h,sortValue:e=>e.sessions24h},{key:"throughput",label:"Throughput",kind:"custom",sortable:!1,defaultWidth:110,minWidth:90,render:e=>r.jsx(ke,{values:e.throughput,warn:e.errors>0})},{key:"avgLatency",label:"Avg latency",kind:"number",defaultWidth:108,minWidth:80,cls:"s-ops-agents-num",render:e=>D(e.avgLatencyMs),sortValue:e=>e.avgLatencyMs},{key:"input",label:"Input",kind:"number",defaultWidth:88,minWidth:64,cls:"s-ops-agents-num",render:e=>w(e.usage.uncachedInput??e.usage.input),sortValue:e=>e.usage.uncachedInput??e.usage.input??null},{key:"cacheRead",label:"Cache read",kind:"number",defaultWidth:98,minWidth:72,cls:"s-ops-agents-num",render:e=>w(e.usage.cachedInput),sortValue:e=>e.usage.cachedInput??null},{key:"cacheWrite",label:"Cache write",kind:"number",defaultWidth:98,minWidth:72,cls:"s-ops-agents-num",render:e=>w(e.usage.cacheWrite),sortValue:e=>e.usage.cacheWrite??null},{key:"output",label:"Output",kind:"number",defaultWidth:88,minWidth:64,cls:"s-ops-agents-num",render:e=>w(e.usage.output),sortValue:e=>e.usage.output??null},{key:"apiEquiv",label:"API equiv",kind:"number",defaultWidth:92,minWidth:72,cls:"s-ops-agents-num",render:e=>r.jsx("span",{className:e.cost.rateCardSource==="unknown"?"s-ops-agents-num--dim":void 0,children:N(e.cost.totalUsd)}),sortValue:e=>e.cost.totalUsd??null},{key:"billed",label:"Billed",kind:"number",defaultWidth:92,minWidth:72,cls:"s-ops-agents-num",render:e=>r.jsx("span",{className:e.cost.billingMode==="subscription"?"s-ops-agents-num--covered":void 0,children:N(e.cost.billedTotalUsd)}),sortValue:e=>e.cost.billedTotalUsd??null},{key:"errors",label:"Errors",kind:"number",defaultWidth:72,minWidth:58,cls:"s-ops-agents-num",render:e=>r.jsx("span",{className:e.errors>0?"s-ops-agents-num--warn":void 0,children:e.errors}),sortValue:e=>e.errors},{key:"lastActive",label:"Last active",kind:"time",defaultWidth:104,minWidth:78,cls:"s-ops-agents-last",render:e=>e.lastActiveAt?re(e.lastActiveAt):"—",sortValue:e=>e.lastActiveAt}];function U(e){if(!e)return null;const t=e.replace(/\/+$/,""),s=t.lastIndexOf("/");return s>=0?t.slice(s+1):t}function w(e){return e==null?"—":e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}K`:String(e)}function D(e){return e==null?"—":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function N(e){return e==null?"$—":e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function fe(e,t){if(!e)return null;const s=e.data.events.filter(i=>i.kind==="message"||i.kind==="tool").filter(i=>t-i.t<=Me).sort((i,o)=>i.t-o.t);if(s.length<2)return null;const a=[];for(let i=1;i<s.length;i+=1){const o=s[i].t-s[i-1].t;o>0&&o<12e4&&a.push(o)}return a.length===0?null:Math.round(a.reduce((i,o)=>i+o,0)/a.length)}function ve(e,t){const s=new Array(24).fill(0),a=t-T;for(const i of e){if(i.ts<a||i.ts>t)continue;const o=Math.min(23,Math.max(0,Math.floor((i.ts-a)/T*s.length)));s[o]+=1}return s}function ke({values:e,warn:t=!1}){const i=Math.max(1,...e),o=e.map((c,h)=>{const m=h/Math.max(1,e.length-1)*92,b=22-c/i*19-1.5;return`${m.toFixed(1)},${b.toFixed(1)}`}).join(" ");return r.jsx("svg",{className:`s-ops-agents-spark${t?" s-ops-agents-spark--warn":""}`,viewBox:"0 0 92 22","aria-hidden":"true",children:r.jsx("polyline",{points:o,fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function xe(e){return e.authorityNodeName??e.homeNodeName??e.authorityNodeId??e.homeNodeId??e.transport??U(e.cwd)??U(e.projectRoot)??"local"}function We(e){return e.project??e.role??e.agentClass??"Unassigned"}function Se(e){if(e.length===0)return null;const t={working:0,needs_attention:1,queued:2,failed:3,completed:4},a=[...e].sort((o,c)=>{const h=t[o.status]-t[c.status];return h!==0?h:(c.updatedAt??0)-(o.updatedAt??0)})[0];return(a.task??a.summary??"").trim()||null}function we(e,t,s,a,i,o){const c=t.filter(l=>l.agentId===e.id),h=c.filter(l=>{const I=l.lastMessageAt??0;return I>0&&o-I<=T}),m=e.conversationId,b=s.filter(l=>l.actorName===e.name||!!(m&&l.conversationId===m)),g=i.get(e.id),{model:v,provider:f}=ie(e,g),P=he({adapterType:g?.data.metadata?.session?.adapterType,capturedAt:g?.updatedAt??o,model:v,provider:f,usage:g?.data.metadata?.usage}),d=a.filter(l=>l.agentId===e.id);return{agent:e,team:We(e),machine:xe(e),model:v,provider:f,state:Z(e.state),activeFlights:d.length,activeTask:Se(d),sessions24h:h.length,throughput:ve(b,o),avgLatencyMs:fe(g,o),usage:P.usage,cost:P,errors:d.filter(l=>l.status==="failed"||l.status==="needs_attention").length,lastActiveAt:Math.max(0,...c.map(l=>l.lastMessageAt??0),...b.map(l=>l.ts),e.updatedAt??0)||null}}function ft({navigate:e,agents:t}){const[s,a]=p.useState(null),[i,o]=p.useState([]),[c,h]=p.useState([]),[m,b]=p.useState([]),[g,v]=p.useState(""),[f,P]=p.useState(()=>Date.now()),d=p.useRef(null),l=p.useCallback(async()=>{const n=t.map(X=>X.id).join(","),[u,k,L,$]=await Promise.allSettled([A("/api/fleet"),A("/api/conversations"),A("/api/activity"),n?A(`/api/observe/agents?ids=${encodeURIComponent(n)}`):Promise.resolve([])]);u.status==="fulfilled"&&a(u.value),k.status==="fulfilled"&&o(k.value),L.status==="fulfilled"&&h(L.value),$.status==="fulfilled"&&b($.value),P(Date.now())},[t]);p.useEffect(()=>{l()},[l]);const I=p.useCallback(()=>{d.current||(d.current=setTimeout(()=>{d.current=null,l()},Pe))},[l]);te(I),p.useEffect(()=>()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]),p.useEffect(()=>{const n=setInterval(()=>P(Date.now()),1e3);return()=>clearInterval(n)},[]);const R=p.useMemo(()=>new Map(m.map(n=>[n.agentId,n])),[m]),M=p.useMemo(()=>{const n=s?.activeAsks??[];return t.map(u=>we(u,i,c,n,R,f))},[c,t,s?.activeAsks,f,R,i]),S=p.useMemo(()=>{const n=g.trim().toLowerCase();return n?M.filter(u=>`${u.agent.name} ${u.team} ${u.machine} ${u.agent.handle??""} ${u.agent.harness??""} ${u.activeTask??""}`.toLowerCase().includes(n)):M},[g,M]),[K,F]=p.useState({key:"lastActive",dir:-1}),O=p.useMemo(()=>K?.key==="agent"?void 0:(n,u)=>E[n.state]-E[u.state],[K?.key]),q=p.useMemo(()=>S.map(n=>n.agent),[S]),B=p.useMemo(()=>S.map(n=>n.agent.id),[S]),y=ae({agents:q,orderedIds:B,navigate:e,selectMode:"preview"}),z=M.filter(n=>n.state==="in_turn"||n.state==="in_flight").length,H=M.filter(n=>J(n.agent.state,n.agent)).length,Y=M.reduce((n,u)=>n+(u.usage.total??0),0),_=M.some(n=>n.cost.totalUsd!=null)?M.reduce((n,u)=>n+(u.cost.totalUsd??0),0):null,G=M.some(n=>n.cost.billedTotalUsd!=null)?M.reduce((n,u)=>n+(u.cost.billedTotalUsd??0),0):null,Q=(()=>{const n=M.map(u=>u.avgLatencyMs).filter(u=>u!=null);return n.length===0?null:Math.round(n.reduce((u,k)=>u+k,0)/n.length)})();return r.jsxs("div",{className:"s-ops-agents",children:[r.jsxs("main",{className:"s-ops-agents-main",children:[r.jsxs("div",{className:"s-ops-agents-toolbar",children:[r.jsxs("div",{className:"s-ops-agents-breadcrumb",children:["Agents ",r.jsx("span",{children:"/"})," Directory"]}),r.jsxs("div",{className:"s-ops-agents-live",children:[r.jsx("span",{className:"s-ops-agents-live-dot"}),H," active"]}),r.jsxs("div",{className:"s-ops-agents-search",children:[r.jsx(se,{size:13}),r.jsx("input",{value:g,onChange:n=>v(n.target.value),placeholder:"Search agents, tasks, projects, machines…"})]}),r.jsx("button",{className:"s-ops-agents-icon-btn",type:"button",title:"Filters",children:r.jsx(oe,{size:14})})]}),r.jsx("section",{className:"s-ops-agents-hero",children:r.jsxs("div",{children:[r.jsx("div",{className:"s-ops-agents-kicker",children:"Agents"}),r.jsx("h1",{children:"All agents"}),r.jsx("p",{children:"Every registered agent across the local fleet, sorted by live status."})]})}),r.jsxs("section",{className:"s-ops-agents-stats",children:[r.jsx(C,{label:"Running",value:String(z),sub:`of ${t.length} total`}),r.jsx(C,{label:"Tokens",value:w(Y||null),sub:_==null?"usage metadata pending":`${N(_)} API equiv`}),r.jsx(C,{label:"Avg latency",value:D(Q),sub:"recent observe events"}),r.jsx(C,{label:"Billed",value:N(G),sub:"subscription usage can mark this down"})]}),r.jsxs("section",{className:"s-ops-agents-table-panel",children:[r.jsxs("div",{className:"s-ops-agents-table-title",children:["Agents ",r.jsx("span",{children:S.length}),r.jsxs("span",{className:"s-ops-agents-hint","aria-hidden":!0,children:[r.jsx("kbd",{children:"↑"}),r.jsx("kbd",{children:"↓"})," navigate · ",r.jsx("kbd",{children:"enter"})," pin · ",r.jsx("kbd",{children:"o"})," open · ",r.jsx("kbd",{children:"esc"})," clear"]})]}),r.jsx("div",{className:"s-ops-agents-table-wrap",ref:y.containerRef,children:r.jsx(ne,{rows:S,columns:be,rowId:n=>n.agent.id,storageKey:"openscout.opsAgents.cols",sort:K,onSortChange:F,secondarySort:O,density:"compact",rowBindings:n=>{const u=y.bind(n);return{...u,onKeyDown:k=>{k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),u.onClick())}}},rowState:n=>y.getState(n),empty:{title:"No agents match",body:"Adjust the search to find a different slice of the fleet."},className:"s-ops-agents-data-table",ariaLabel:"Agents directory"})})]})]}),y.card]})}function C({label:e,value:t,sub:s,tone:a="default"}){return r.jsxs("div",{className:`s-ops-agents-metric s-ops-agents-metric--${a}`,children:[r.jsx("div",{className:"s-ops-agents-metric-label",children:e}),r.jsx("div",{className:"s-ops-agents-metric-value",children:t}),r.jsx("div",{className:"s-ops-agents-metric-sub",children:s})]})}export{ft as OpsAgentsView};
@@ -1 +0,0 @@
1
- import{r as n,j as t}from"./index-NRbRrZw-.js";/* empty css */import{u as d}from"./Provider-Cd-QZltN.js";/* empty css */import{u as v}from"./page-status-CEP5pGf3.js";import{A as x}from"./AgentLanesView-Bm85ittm.js";import{MissionControlView as j}from"./MissionControlView-BGj1qnI2.js";import{OpsAgentsView as f}from"./OpsAgentsView-dEtw9yt-.js";import{HostAdvisorView as w}from"./HostAdvisorView-BAUi5ZxX.js";import{AtopView as N}from"./AtopView-DOKJbiJL.js";import{TailView as c}from"./TailView-C3rjOV7i.js";import{u as g}from"./useContentSecondaryNav-4atpGgFw.js";import{OpsSubnav as S}from"./OpsSubnav-BK9Fj3gU.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./api-DEHEgJ9m.js";import"./sse-QSbhyq9A.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./time-Dhsh_2EG.js";import"./index-CD2foMB8.js";import"./HarnessMark-CEzmPFHC.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";/* empty css */import"./tail-events-B7BrDaFi.js";import"./observe-DkAhvkfn.js";import"./types-B0PlfpKc.js";import"./AgentAvatar-CQqJcwOQ.js";import"./SpriteAvatar-vpHO-rXs.js";import"./agent-identity-CIMT7oV6.js";import"./SessionObserve-pbozyqVv.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DCY-m0JK.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-KNASbAjG.js";import"./AgentDetailCard-2DZQahiN.js";import"./AgentLiveActions-BmXDRxER.js";import"./terminal-takeover-BArLfNtd.js";import"./openContent-C6XO6kr5.js";import"./eye-B908WSFH.js";import"./terminal-DNZTCr6a.js";import"./message-markup-BP2nH9kQ.js";import"./ObservedTopologyPanel-CfHYu-4Z.js";import"./ObserveTextFlow-CKYltTPJ.js";import"./use-reduced-motion-0fAsybdo.js";import"./proxy-DtC2iXnT.js";import"./SessionObserveEvidence-C54Xvbps.js";import"./message-circle-2v9Udia0.js";import"./wrench-DwFKomxg.js";import"./external-link-BheHazeW.js";import"./AgentFloorView-CoGh2q5f.js";/* empty css */import"./agent-lanes-model-BKOs_32K.js";import"./context-budget-DX_fwUs3.js";import"./lane-roster-store-BAmj273z.js";import"./AgentLanesPreflight-BwkGk8JH.js";import"./AgentLaneChrome-Do7CXwin.js";import"./AgentLaneCard-CeSjWWwh.js";/* empty css */import"./AgentLaneSummaryResize--lHgnncr.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-CSugZCdy.js";import"./agent-lane-preview-BhplDYGf.js";import"./AgentLaneDetailSheet-BD8B51ka.js";import"./SlidePanel-BLrLF9dt.js";import"./agent-lane-detail-D5EIlX7_.js";import"./LaneTraceDetailSheet-CFsCvKa3.js";import"./LaneTraceEventFocus-BfKZ7G5c.js";/* empty css */import"./mission-control-store-HeCy97KT.js";import"./MissionContextRail-MTL2EAnr.js";import"./mission-wall-CocIM1cF.js";import"./mission-control-model-C0fByIjm.js";import"./MissionFocusOverlay-hWi6y87j.js";import"./MissionLogPane-bbG_pM9B.js";/* empty css */import"./DataTable-DFacT2uu.js";/* empty css */import"./useAgentHoverCard-BIrm8esH.js";import"./sliders-horizontal-D2O6QiDN.js";/* empty css */import"./compass-D5Io6BIV.js";import"./layout-grid-Vd1chalc.js";import"./refresh-cw-C4E58VJK.js";import"./arrow-up-right-CilNLf4t.js";import"./cpu-CtQc0Z9D.js";import"./gauge-sc_gb5Zw.js";/* empty css */import"./SecondaryNav-CCQqTT3e.js";import"./secondaryNavConfig-BVQiyAXu.js";import"./message-square-DURSOrUr.js";import"./settings-BpKRzxOD.js";import"./git-branch-CdJU49Af.js";import"./scroll-text-uulNqrf7.js";const A=220;function F(){const r=v(),o=!!(r.hover||r.content),[i,p]=n.useState(o?{hover:r.hover,content:r.content}:null),[e,s]=n.useState(o?"enter":"hidden"),m=n.useRef(null);if(n.useEffect(()=>{if(o){m.current&&(clearTimeout(m.current),m.current=null),p({hover:r.hover,content:r.content}),s(h=>h==="show"?"show":"enter");const u=requestAnimationFrame(()=>s("show"));return()=>cancelAnimationFrame(u)}return s("leave"),m.current=setTimeout(()=>{s("hidden"),p(null),m.current=null},A),()=>{m.current&&(clearTimeout(m.current),m.current=null)}},[o,r.hover,r.content]),e==="hidden"||!i)return null;const a=i.hover?.label??i.hover?.route??null,l=i.hover?.label&&i.hover?.route?i.hover.route:null;return t.jsxs("div",{className:`s-page-status s-page-status--${e}`,role:"status","aria-live":"polite",children:[t.jsx("div",{className:"s-page-status-left",children:a&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"s-page-status-arrow","aria-hidden":!0,children:"→"}),t.jsx("span",{className:"s-page-status-target",children:a}),l&&t.jsx("span",{className:"s-page-status-route",children:l})]})}),t.jsx("div",{className:"s-page-status-right",children:i.content&&t.jsx("span",{className:"s-page-status-content",children:i.content})})]})}function qr({navigate:r,mode:o="mission",tailQuery:i}){const{agents:p,route:e}=d(),s=g();return t.jsxs("div",{className:"s-ops",children:[s?t.jsx("div",{className:"s-ops-header",children:t.jsx(S,{activeRoute:e,navigate:r})}):null,t.jsxs("div",{className:"s-ops-body",children:[o==="mission"&&t.jsx(j,{navigate:r,agents:p}),o==="agents"&&t.jsx(f,{navigate:r,agents:p}),o==="advisor"&&t.jsx(w,{navigate:r,agents:p}),o==="issues"&&t.jsx(c,{navigate:r,initialFilter:i,variant:"issues"}),o==="tail"&&t.jsx(c,{navigate:r,initialFilter:i,variant:"tail"}),o==="atop"&&t.jsx(N,{}),o==="lanes"&&t.jsx(x,{navigate:r,agents:p})]}),t.jsx(F,{})]})}export{qr as OpsScreen};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-NRbRrZw-.js";import{S as p}from"./SecondaryNav-CCQqTT3e.js";import{O as i}from"./secondaryNavConfig-BVQiyAXu.js";/* empty css */import"./createLucideIcon-Da0lq809.js";import"./message-square-DURSOrUr.js";import"./file-text-BGVkHS4_.js";import"./search-HmdKXdtR.js";import"./compass-D5Io6BIV.js";import"./settings-BpKRzxOD.js";import"./terminal-DNZTCr6a.js";import"./git-branch-CdJU49Af.js";import"./code-xml-CPzpZkhu.js";import"./scroll-text-uulNqrf7.js";function v({activeRoute:r,navigate:o}){return t.jsx(p,{ariaLabel:"Ops sections",activeRoute:r,groups:i,navigate:o})}export{v as OpsSubnav};
@@ -1 +0,0 @@
1
- import{r as m,j as o}from"./index-NRbRrZw-.js";import{a as A}from"./api-DEHEgJ9m.js";import{u as b,c as S}from"./Provider-Cd-QZltN.js";import{d as y}from"./router-Bx1tiwVe.js";import{u as P}from"./sse-QSbhyq9A.js";import{AgentsSubnav as N}from"./AgentsSubnav-CsvYzzQ-.js";import{AgentDetailWithRail as B,AgentProfileSessionsCenter as E}from"./profile-Y0X7HZHc.js";import{r as R,d as C,b as M}from"./NewChatComposer-BPsg8shF.js";/* empty css *//* empty css *//* empty css */import{ProjectAgentProfileBar as w}from"./ProjectAgentProfileBar-B4RqrI0Q.js";/* empty css */import"./provider-Bq0ScH3v.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-CCQqTT3e.js";import"./secondaryNavConfig-BVQiyAXu.js";import"./message-square-DURSOrUr.js";import"./search-HmdKXdtR.js";import"./compass-D5Io6BIV.js";import"./settings-BpKRzxOD.js";import"./terminal-DNZTCr6a.js";import"./git-branch-CdJU49Af.js";import"./scroll-text-uulNqrf7.js";import"./AgentAvatar-CQqJcwOQ.js";import"./SpriteAvatar-vpHO-rXs.js";import"./agent-identity-CIMT7oV6.js";import"./HarnessMark-CEzmPFHC.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-b7B1Sof1.js";import"./terminal-relay-C2TUIuh1.js";import"./time-Dhsh_2EG.js";import"./BackToPicker-CXsbxbHM.js";import"./openContent-C6XO6kr5.js";import"./ConversationScreen-D77SoLos.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./ConversationComposer-DPWu3HvK.js";import"./index-CD2foMB8.js";import"./zap-CocRNtyr.js";import"./conversation-model-CIzM7aXT.js";import"./message-markup-BP2nH9kQ.js";import"./mentions-KNASbAjG.js";import"./AgentDetailCard-2DZQahiN.js";import"./AgentLiveActions-BmXDRxER.js";import"./terminal-takeover-BArLfNtd.js";import"./eye-B908WSFH.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-Ce7TENb9.js";import"./AstronautSuit-C05Ezxl9.js";import"./ConversationFeedRows-MhcPfxUr.js";import"./ConversationPanels-D-b5SLO-.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-0fAsybdo.js";import"./proxy-DtC2iXnT.js";import"./chevron-down-Jh540uf3.js";import"./activity-DTqqWiyV.js";import"./message-circle-2v9Udia0.js";import"./tail-events-B7BrDaFi.js";import"./ConversationStatus-lIvSKRic.js";import"./check-BdovFDz8.js";import"./sparkles-CgTby-ap.js";import"./SessionObserve-pbozyqVv.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DCY-m0JK.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CfHYu-4Z.js";import"./ObserveTextFlow-CKYltTPJ.js";import"./SessionObserveEvidence-C54Xvbps.js";import"./wrench-DwFKomxg.js";import"./external-link-BheHazeW.js";/* empty css */import"./AgentDefinitionsWorkspace-D0LDEqfl.js";import"./agent-specialization-D3-sqwhU.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-ebbCtnHE.js";import"./agent-essentials-DbbJm3ne.js";import"./NewChatOrigin-CCiPg_WR.js";import"./model-IGCUEsMy.js";import"./agents-project-model-UYiamtrU.js";function Mo({route:t,navigate:r}){const{agents:e}=b(),p=y(t),n=m.useMemo(()=>S(e,p),[e,p]),[f,g]=m.useState([]),a=m.useCallback(async()=>{const s=await A("/api/conversations").catch(()=>[]);g(s)},[]);m.useEffect(()=>{a()},[a]),P(()=>{a()});const i=R(n,t.agentId),c=!!(t.agentId&&i&&i.id!==t.agentId),{conversationByAgentId:j}=C(f);if(m.useEffect(()=>{!t.agentId||!i||!c||r({...t,view:"agents-v2",agentId:i.id})},[r,t,i,t.agentId,c]),!i)return o.jsx(v,{activeRoute:t,navigate:r,children:o.jsx("div",{className:"av2-empty",children:"Agent not found."})});const d=t.conversationId??j.get(i.id)??i.conversationId??null,l=t.tab??(t.conversationId?"message":"profile");return o.jsx("div",{className:"s-av2-profileShell",children:o.jsx(v,{activeRoute:t,navigate:r,bar:o.jsx(w,{agent:i,conversationId:d,activeTab:l,route:t,navigate:r}),children:o.jsx("div",{className:"av2-profileCanvas",children:o.jsx(B,{agent:i,allAgents:n,conversationId:d,navigate:r,activeTab:l,renderProfile:({agent:s,sessionCatalog:x,conversationId:h,navigate:I,route:u})=>o.jsx(E,{agent:s,name:M(s,n).name,sessionCatalog:x,conversationId:h,navigate:I,route:u,homeView:"agents-v2"})})})})})}function v({activeRoute:t,children:r,navigate:e,bar:p}){return o.jsxs("div",{className:"s-secondary-nav-shell",children:[o.jsx("div",{className:"s-secondary-nav-bar",children:p??o.jsx(N,{activeRoute:t,navigate:e})}),o.jsx("div",{className:"s-secondary-nav-body",children:r})]})}export{Mo as ProjectAgentProfile};
@@ -1 +0,0 @@
1
- import{r as c,j as e}from"./index-NRbRrZw-.js";import{i as y,c as L}from"./colors-BtO5_zlx.js";import{a as u}from"./api-DEHEgJ9m.js";import{u as T}from"./sse-QSbhyq9A.js";import{t as P}from"./time-Dhsh_2EG.js";import{o as R}from"./openContent-C6XO6kr5.js";import{A as E}from"./AgentAvatar-CQqJcwOQ.js";import{H as O}from"./HarnessMark-CEzmPFHC.js";import{n as V}from"./NewChatComposer-BPsg8shF.js";import{h as B}from"./model-IGCUEsMy.js";import"./index-BWHgHrtv.js";import"./Provider-Cd-QZltN.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./SpriteAvatar-vpHO-rXs.js";import"./agent-identity-CIMT7oV6.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./index-CD2foMB8.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./agents-project-model-UYiamtrU.js";function U(s){return s?s.startsWith("/Users/")?`~/${s.split("/").slice(3).join("/")}`:s:null}function _(s){const a=s.model?.trim();if(!a)return null;const o=s.harness?.trim();return o&&a.startsWith(`${o}-`)?a.slice(o.length+1).replace(/-\d{8}$/,""):a.replace(/^claude-/,"").replace(/-\d{8}$/,"")}function g(s){const a=new Map;for(const o of s){if(o.kind!=="tool"||!o.tool)continue;const t=o.tool.toLowerCase();a.set(t,(a.get(t)??0)+1)}return[...a.entries()].sort((o,t)=>t[1]-o[1]||o[0].localeCompare(t[0])).map(([o])=>o).slice(0,6)}function i({label:s,value:a,title:o}){return a?.trim()?e.jsxs("div",{className:"av2-coreMetaItem",title:o??a,children:[e.jsx("span",{className:"av2-coreMetaLabel",children:s}),e.jsx("span",{className:"av2-coreMetaValue",children:a})]}):null}function ys({agent:s,route:a,navigate:o}){const[t,h]=c.useState(null),[C,v]=c.useState(null),m=c.useCallback(async()=>{const[r,l]=await Promise.all([u(`/api/agents/${encodeURIComponent(s.id)}/observe`).catch(()=>null),u(`/api/agents/${encodeURIComponent(s.id)}/session-catalog`).catch(()=>null)]);h(r),v(l)},[s.id]);c.useEffect(()=>{h(null),v(null),m()},[m]),T(()=>{m()});const p=s.handle?.trim().replace(/^@+/,"")||null,j=p?`@${p}`:s.name,n=s.harness?B(s.harness):null,H=_(s),w=U(s.cwd??s.projectRoot),M=(s.homeNodeName??s.authorityNodeName??"").replace(/\.local$/i,"").replace(/-local-openscout$/i,""),I=y(s.state),k=L(s.state,s),x=t?.data.events??[],d=c.useMemo(()=>g(x),[x]),f=t?.data.metadata?.usage??null,N=(()=>{const r=f?.contextWindowTokens??0,l=f?.contextInputTokens??0;return!r||r<=0||l<=0?null:Math.min(100,Math.max(0,Math.round(l/r*100)))})(),A=C?.sessions?.length??0,$=s.transport==="claude_stream_json"?"stream-json":s.transport==="codex_app_server"?"app-server":s.transport?.trim()||null,S=async()=>{try{const r=await u("/api/sessions",{method:"POST",body:JSON.stringify(V(s))}),l=r.sessionId?.trim();if(l){R(o,{view:"sessions",sessionId:l},{returnTo:a});return}const b=r.conversationId?.trim();o({...a,view:"agents-v2",agentId:r.agentId?.trim()||s.id,...b?{conversationId:b}:{},tab:"message"})}catch{}};return e.jsxs("header",{className:"av2-profileHero",children:[e.jsx(E,{agent:s,size:56,tile:!0,presence:!0}),e.jsxs("div",{className:"av2-profileHeroCore",children:[e.jsxs("div",{className:"av2-profileHeroTop",children:[e.jsxs("div",{className:"av2-profileHeroIdent",children:[e.jsx("h1",{className:"av2-profileHeroTitle",title:j,children:j}),e.jsxs("span",{className:"av2-profileHeroState","data-online":I||void 0,children:[e.jsx("span",{className:"av2-profileHeroDot","aria-hidden":!0}),k,s.updatedAt?` · ${P(s.updatedAt)}`:""]}),p&&s.name.toLowerCase()!==p.toLowerCase()?e.jsx("span",{className:"av2-profileHeroBroker",title:s.id,children:s.name}):e.jsx("span",{className:"av2-profileHeroBroker",title:s.id,children:s.id})]}),e.jsxs("div",{className:"av2-profileHeroActions",children:[e.jsx("button",{type:"button",className:"av2-heroGhost",onClick:()=>o({...a,view:"agents-v2",agentId:s.id,tab:"config"}),children:"Edit config"}),e.jsx("button",{type:"button",className:"av2-heroCta",onClick:()=>{S()},children:"+ New session"})]})]}),e.jsxs("div",{className:"av2-profileHeroMeta",children:[e.jsx(i,{label:"Project",value:s.project?`/${s.project}`:null}),e.jsx(i,{label:"Branch",value:s.branch}),e.jsx(i,{label:"Harness",value:n?n.charAt(0).toUpperCase()+n.slice(1):null,title:s.harness??void 0}),e.jsx(i,{label:"Model",value:H}),e.jsx(i,{label:"Host",value:M||null}),e.jsx(i,{label:"Root",value:w,title:s.cwd??s.projectRoot??void 0}),e.jsx(i,{label:"Transport",value:$})]}),e.jsxs("div",{className:"av2-profileHeroSignal",children:[n?e.jsx("span",{className:"av2-signalMark",title:s.harness??n,children:e.jsx(O,{harness:n,size:12})}):null,e.jsxs("span",{className:"av2-signalChip",children:[e.jsx("span",{className:"av2-signalLabel",children:"Sessions"}),e.jsx("span",{className:"av2-signalValue",children:A})]}),N!=null?e.jsxs("span",{className:"av2-signalChip",children:[e.jsx("span",{className:"av2-signalLabel",children:"Ctx"}),e.jsxs("span",{className:"av2-signalValue",children:[N,"%"]})]}):null,d.length>0?e.jsxs("span",{className:"av2-signalChip av2-signalChip--wide",title:d.join(" · "),children:[e.jsx("span",{className:"av2-signalLabel",children:"Tools"}),e.jsx("span",{className:"av2-signalValue",children:d.join(" · ")})]}):t?e.jsxs("span",{className:"av2-signalChip",children:[e.jsx("span",{className:"av2-signalLabel",children:"Tools"}),e.jsx("span",{className:"av2-signalValue",children:"—"})]}):null]})]})]})}export{ys as ProjectAgentProfileHero};
@@ -1,2 +0,0 @@
1
- import{r as m,j as s}from"./index-NRbRrZw-.js";import{A as Me}from"./AgentAvatar-CQqJcwOQ.js";import{H as ge}from"./HarnessMark-CEzmPFHC.js";import{a as Ee}from"./api-DEHEgJ9m.js";import{r as Ie,i as $e}from"./ui-LM8pS8qE.js";import{t as _,d as We,n as ee}from"./time-Dhsh_2EG.js";import{p as Fe,l as Be,s as De,f as Oe}from"./terminal-sessions-D4dHTRkt.js";import{u as ze}from"./Provider-Cd-QZltN.js";import{o as He}from"./openContent-C6XO6kr5.js";import{p as Z}from"./NewChatComposer-BPsg8shF.js";import{SessionRefScreen as qe}from"./SessionRefScreen-UVNVrwAf.js";import{C as Ge}from"./CrewWorkspaces-CdojnRMG.js";import{r as X,s as V}from"./project-overview-helpers-BQTc_Ous.js";import{u as _e,e as Q,d as oe,g as Ve,s as re,a as le,f as Ke,h as be,b as Ue,j as Xe,r as Ye}from"./projects-inbox-Cbfj4Hx7.js";import{g as Ze,a as Je,f as ce,b as Qe}from"./api-BHHEUSS3.js";import{f as es}from"./cache-BO2Bd_LV.js";import{A as ue}from"./arrow-up-right-CilNLf4t.js";import{C as ss}from"./chevron-right-CV7sEVBS.js";import{F as ts}from"./AddProjectForm-Dw2oyCcz.js";import{S as ns}from"./search-HmdKXdtR.js";import{A as is}from"./arrow-right-YRBoTTyf.js";import{E as as}from"./external-link-BheHazeW.js";import{F as os}from"./DocumentFocusViewer-CetjnYut.js";import"./SpriteAvatar-vpHO-rXs.js";import"./agent-identity-CIMT7oV6.js";import"./colors-BtO5_zlx.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-QSbhyq9A.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./createLucideIcon-Da0lq809.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./index-CD2foMB8.js";import"./NewChatOrigin-CCiPg_WR.js";import"./x-DuzAbpk5.js";import"./chevron-down-Jh540uf3.js";import"./tail-events-B7BrDaFi.js";import"./BackToPicker-CXsbxbHM.js";import"./ConversationScreen-D77SoLos.js";import"./ConversationComposer-DPWu3HvK.js";import"./zap-CocRNtyr.js";import"./message-markup-BP2nH9kQ.js";import"./mentions-KNASbAjG.js";import"./AgentDetailCard-2DZQahiN.js";import"./AgentLiveActions-BmXDRxER.js";import"./terminal-takeover-BArLfNtd.js";import"./eye-B908WSFH.js";import"./terminal-DNZTCr6a.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-Ce7TENb9.js";import"./AstronautSuit-C05Ezxl9.js";import"./ConversationFeedRows-MhcPfxUr.js";import"./ConversationPanels-D-b5SLO-.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-0fAsybdo.js";import"./proxy-DtC2iXnT.js";import"./activity-DTqqWiyV.js";import"./message-circle-2v9Udia0.js";import"./ConversationStatus-lIvSKRic.js";import"./check-BdovFDz8.js";import"./sparkles-CgTby-ap.js";import"./SessionObserve-pbozyqVv.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DCY-m0JK.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CfHYu-4Z.js";import"./ObserveTextFlow-CKYltTPJ.js";import"./SessionObserveEvidence-C54Xvbps.js";import"./wrench-DwFKomxg.js";/* empty css */import"./model-IGCUEsMy.js";import"./agents-project-model-UYiamtrU.js";import"./agent-specialization-D3-sqwhU.js";import"./cpu-CtQc0Z9D.js";import"./sliders-horizontal-D2O6QiDN.js";import"./message-square-DURSOrUr.js";function de(e){const t=e?.trim();if(!t)return null;const i=t.split(/[\\/]/u).filter(Boolean).at(-1)??t;return i.endsWith(".jsonl")?i.slice(0,-6):i}function rs(e){return e.surfaces.filter(t=>t.backend==="tmux")}function ls(e,t){return{terminalSessionId:e.id,terminalSurfaceKey:De(t),sessionName:t.sessionName}}function cs(e,t){const i=de(t.agentId),n=new Set(t.sessionRefs.map(de).filter(r=>!!r)),o=i?.split(".",1)[0]??null;o?.startsWith("session-")&&n.add(o);for(const r of e){const a=rs(r).find(u=>n.has(u.sessionName));if(a)return ls(r,a)}return null}function us(e,t){const i=Fe(e.terminalSurfaceKey);return i?`scout://terminal?${new URLSearchParams({session:e.terminalSessionId,surface:Be(i),mode:t}).toString()}`:null}const ds=1e4,ps=2e4,ms=6e4,hs=15e3,fs=45e3,js=["branch","unstaged","staged"];function te(e){const t=()=>{document.visibilityState==="visible"&&e()};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}}function xs(e,t){const i=new Set;for(const n of[e,...t]){const o=n?.trim();o&&i.add(o.replace(/\/+$/u,""))}return[...i].slice(0,6)}function gs(e){return e.replace(/\/+$/u,"").split("/").pop()?.toLocaleLowerCase()??e.toLocaleLowerCase()}function bs(e,t,i){return e.path===t||i?.worktrees.some(o=>o.path===e.path)?!0:e.repo.split("/").pop()?.toLocaleLowerCase()===(i?.name.toLocaleLowerCase()??gs(t))}function J(e){return e&&typeof e=="object"&&"name"in e&&e.name==="AbortError"?"The repository scan timed out.":e instanceof Error?e.message:String(e)}function vs(e,t=[]){const i=xs(e,t).join("\0"),n=m.useMemo(()=>i?i.split("\0"):[],[i]),[o,r]=m.useState(()=>Ze()),[a,u]=m.useState(()=>Je()),[c,j]=m.useState(!!(e&&!X(o,e))),[v,g]=m.useState(!!e),[C,N]=m.useState(!!e),[L,R]=m.useState(null),[y,M]=m.useState(null),[F,I]=m.useState(()=>new Map),[D,k]=m.useState(()=>new Map),[S,B]=m.useState(0),f=m.useRef(null),x=m.useCallback(()=>{f.current=null,B(d=>d+1)},[]);m.useEffect(()=>{if(!e){j(!1),R(null);return}let d=!1,b=!1,T=!0;const W=async()=>{if(b)return;b=!0,d||(j(!0),R(null));let O=null;try{let E=null;const z=S>0&&T;T=!1;try{E=await ce("standard",z,hs)}catch(A){O=J(A)}if((!E||!X(E,e))&&f.current!==e){f.current=e;try{const A=await ce("expanded",z,fs);X(A,e)&&(E=A)}catch(A){O=J(A)}}!d&&E&&r(A=>X(E,e)?E:A&&X(A,e)?A:E),!d&&!X(E,e)&&R(O??"Repo Watch did not include this project in its latest scan.")}finally{b=!1,d||j(!1)}};W();const p=window.setInterval(()=>{document.visibilityState==="visible"&&W()},ds),P=te(()=>{W()});return()=>{d=!0,window.clearInterval(p),P()}},[e,S]),m.useEffect(()=>{if(n.length===0){N(!1),k(new Map);return}let d=!1,b=!1,T=!0;const W=async()=>{if(b)return;b=!0,d||N(!0);const O=await Promise.allSettled(n.map(E=>es(E,[...js],{force:S>0&&T,tier:"summary"})));if(T=!1,!d){const E=new Map,z=new Map;O.forEach((A,K)=>{const q=n[K];A.status==="fulfilled"?E.set(q,A.value.snapshot):z.set(q,J(A.reason))}),I(A=>{const K=new Map(A);for(const q of n)K.delete(q);for(const[q,se]of E)K.set(q,se);return K}),k(z),N(!1)}b=!1};W();const p=window.setInterval(()=>{document.visibilityState==="visible"&&W()},ps),P=te(()=>{W()});return()=>{d=!0,window.clearInterval(p),P()}},[n,S]),m.useEffect(()=>{if(n.length===0){g(!1),M(null);return}let d=!1,b=!1;const T=async()=>{if(!b){b=!0;try{const P=await Qe(n);d||(u(P),M(null))}catch(P){d||M(J(P))}finally{b=!1,d||g(!1)}}};g(!0),M(null),T();const W=window.setInterval(()=>{document.visibilityState==="visible"&&T()},ms),p=te(()=>{T()});return()=>{d=!0,window.clearInterval(W),p()}},[n,S]);const l=m.useMemo(()=>X(o,e),[e,o]),h=m.useMemo(()=>e?(a?.pullRequests??[]).filter(d=>bs(d,e,l)):[],[l,e,a]),$=m.useMemo(()=>{const d=a?.paths.some(b=>n.includes(b))?a.warnings:[];return y?[y,...d]:d},[n,y,a]);return{project:l,pullRequests:h,pullRequestsLoading:v,pullRequestWarnings:$,repoLoading:c,repoError:L,diffSnapshots:F,diffErrors:D,diffLoading:C,refresh:x}}const ws=[];function Ns(e,t){return e.thread===t.thread&&e.crossProject===t.crossProject&&e.selected===t.selected&&e.cursor===t.cursor&&e.nowMs===t.nowMs&&e.workLabel===t.workLabel}const ks=m.memo(function({thread:t,crossProject:i,selected:n,cursor:o,nowMs:r,onSelect:a,onOpen:u,rowRef:c,workLabel:j}){return s.jsxs("button",{ref:c,type:"button",className:"pi-row","data-state":t.group,"data-selected":n||void 0,"data-cursor":o||void 0,onClick:a,onDoubleClick:u,children:[s.jsx("span",{className:"pi-rowDot","aria-hidden":!0}),s.jsxs("span",{className:"pi-rowBody",children:[s.jsx("span",{className:"pi-rowWork",title:t.work,children:j??t.work}),s.jsxs("span",{className:"pi-rowAttr",children:[s.jsx("span",{className:"pi-rowAvatar",children:s.jsx(Me,{agent:{name:t.agentName,harness:t.harness,state:t.working?"in_turn":null},placement:"row",size:22})}),s.jsx("span",{className:"pi-rowAgent",title:t.agentName,children:t.agentName}),s.jsx("span",{className:"pi-rowHmark","aria-hidden":!0,children:s.jsx(ge,{harness:t.harness,size:11})}),i?s.jsxs("span",{className:"pi-rowChip",title:`/${t.projectTitle}`,children:["/",t.projectTitle]}):t.branch?s.jsx("span",{className:"pi-rowBranch",title:t.branch,children:t.branch}):null]})]}),s.jsxs("span",{className:"pi-rowVitals",children:[t.working?s.jsx("span",{className:"pi-rowLiveTag",children:"live"}):null,s.jsx("span",{className:"pi-rowAgo",children:t.lastActivityAt?_(t.lastActivityAt,r):"—"}),t.contextPct!=null?s.jsxs("span",{className:"pi-rowCtx",children:[t.contextPct,"%"]}):null]}),s.jsxs("span",{className:"pi-rowOpen","aria-hidden":!0,children:[s.jsx("span",{children:"Open"}),s.jsx(ss,{size:14,strokeWidth:1.8})]})]})},Ns);function pe({title:e,detail:t,tone:i="muted"}){return s.jsxs("div",{className:"pi-stateBlock","data-tone":i,role:i==="loading"?"status":"note",children:[s.jsx("span",{className:"pi-statePulse","aria-hidden":!0}),s.jsx("span",{className:"pi-stateTitle",children:e}),t?s.jsx("span",{className:"pi-stateDetail",children:t}):null]})}function Ss({rows:e=7}){return s.jsxs("div",{className:"pi-loadingRows","aria-hidden":"true",children:[s.jsxs("div",{className:"pi-sectionHead pi-sectionHead--loading",children:[s.jsx("span",{className:"pi-loadingLine pi-loadingLine--label"}),s.jsx("span",{className:"pi-loadingLine pi-loadingLine--count"})]}),Array.from({length:e},(t,i)=>s.jsxs("div",{className:"pi-row pi-row--loading",children:[s.jsx("span",{className:"pi-rowDot"}),s.jsxs("span",{className:"pi-rowBody",children:[s.jsx("span",{className:"pi-loadingLine pi-loadingLine--title"}),s.jsx("span",{className:"pi-loadingLine pi-loadingLine--meta"})]}),s.jsx("span",{className:"pi-rowVitals",children:s.jsx("span",{className:"pi-loadingLine pi-loadingLine--time"})})]},i))]})}function ys({route:e,navigate:t,slug:i,model:n,mode:o,repoProject:r}){const a=n.projects.find(y=>y.slug===i)??null,u=Q(n.threads,i),c=u.filter(y=>y.kind==="agent"),j=a?.title??i,v=a?.root??null,g=(a?.agentCount??c.length)>1,C=e.machineId?{machineId:e.machineId}:{},N={view:"agents-v2",projectSlug:i,...C},L=Cs(a?.needs??0,a?.working??0,u.length),R=r?.worktrees.length??a?.worktreeCount??0;return s.jsxs("header",{className:"pi-projectHead",children:[s.jsx("div",{className:"pi-projectHeadTop",children:s.jsxs("div",{className:"pi-projectIdent",children:[s.jsx("h1",{className:"pi-projectTitle",children:j}),s.jsxs("div",{className:"pi-projectMeta",children:[v?s.jsx("span",{title:v,children:V(v)}):null,s.jsx("span",{className:"pi-projectDigest",children:L})]})]})}),s.jsxs("div",{className:"pi-projectFacets","aria-label":"Project sections",children:[s.jsx("button",{type:"button",className:"pi-projectFacet","data-selected":o==="overview"||void 0,onClick:()=>t(N),children:s.jsx("span",{children:"Overview"})}),s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="sessions"||void 0,onClick:()=>t({...N,indexView:"sessions"}),children:[s.jsx("span",{children:"Sessions"}),s.jsx("b",{children:a?.sessionCount??0})]}),g?s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="agents"||void 0,onClick:()=>t({...N,indexView:"agents"}),children:[s.jsx("span",{children:"Agents"}),s.jsx("b",{children:a?.agentCount??c.length})]}):null,s.jsxs("button",{type:"button",className:"pi-projectFacet",title:"Open worktrees in Repos",onClick:()=>t({view:"repos",...v?{root:v}:{},...C}),children:[s.jsx("span",{children:"Worktrees"}),s.jsx("b",{children:R}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]}),s.jsxs("button",{type:"button",className:"pi-projectFacet",disabled:!v,title:v?"Open this project's AGENTS.md":"No project root known",onClick:()=>t({view:"code",project:i,path:"AGENTS.md"}),children:[s.jsx("span",{children:"Rules"}),s.jsx("b",{children:v?"set":"—"}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]})]})]})}function Cs(e,t,i){if(i===0)return s.jsx("span",{children:"No conversations yet."});const n=[];return t>0&&n.push(s.jsxs("b",{children:[t," moving"]},"w")),e>0&&n.push(s.jsxs("b",{children:[e," needs you"]},"n")),n.push(s.jsxs("span",{children:[i," conversation",i===1?"":"s"]},"t")),n.reduce((o,r,a)=>(a>0&&o.push(s.jsx("span",{children:" · "},`sep${a}`)),o.push(r),o),[])}function ve(e){if(e.length<=18)return e;const t=e.match(/^([0-9a-f]{8})-[0-9a-f-]{27,}$/iu);return t?t[1]:`${e.slice(0,10)}…${e.slice(-5)}`}function As(e,t){return`${t?0:e.projects.length} tracked`}function Rs({route:e,navigate:t,projects:i}){const{onboarding:n,refreshOnboarding:o,reload:r}=ze(),a=Ts(n?.defaultHarness),[u,c]=m.useState(""),[j,v]=m.useState(""),[g,C]=m.useState(a),[N,L]=m.useState(!1),[R,y]=m.useState(null),[M,F]=m.useState(null),[I,D]=m.useState(null);m.useEffect(()=>{C(a)},[a]);const k=m.useMemo(()=>Ls(i),[i]),S=m.useMemo(()=>Ps(k,u),[u,k]),B=m.useMemo(()=>k.find(p=>p.slug===j)??he(k,u),[u,k,j]),f=u.trim(),x=Es(f)&&!he(k,f),l=B??(!x&&f?S[0]??null:null),h=l?"Open project":x?"Create project":"Find project",$=!!(l||x||f);m.useEffect(()=>{j&&(k.some(p=>p.slug===j)||v(""))},[k,j]),m.useEffect(()=>{if(!I)return;const p=k.find(P=>Is(P,I));p&&(D(null),t(me(e,p.slug)))},[I,t,k,e]);const d=p=>{v(p.slug),c(p.title),y(null),F(null)},b=p=>{t(me(e,p.slug))},T=async p=>{L(!0),y(null),F(null);try{await Ee("/api/onboarding/project",{method:"POST",body:JSON.stringify({contextRoot:p,sourceRoots:[p],defaultHarness:g})}),D(p),F("Project created. Refreshing inventory."),v(""),c(""),Ye(),await Promise.all([o(),r()])}catch(P){y(P instanceof Error?P.message:"Could not create project.")}finally{L(!1)}},W=p=>{if(p.preventDefault(),!N){if(l){b(l);return}if(x){T(f);return}if(f){y("No project matches that search. Paste a repo path to create one.");return}y("Choose a project or paste a repo path.")}};return s.jsxs("div",{className:"pi-zero",children:[s.jsxs("div",{className:"pi-zeroHead",children:[s.jsxs("span",{className:"pi-zeroKicker",children:[s.jsx(ts,{size:13,strokeWidth:1.9,"aria-hidden":!0}),"Projects"]}),s.jsx("h2",{children:"Pick a project to start."})]}),s.jsxs("form",{className:"pi-zeroComposer",onSubmit:W,children:[s.jsxs("div",{className:"pi-zeroBar",children:[s.jsxs("label",{className:"pi-zeroSelect",children:[s.jsx(ns,{size:13,strokeWidth:1.8,"aria-hidden":!0}),s.jsxs("select",{value:j,"aria-label":"Choose project",onChange:p=>{const P=k.find(O=>O.slug===p.currentTarget.value);P?d(P):v("")},children:[s.jsx("option",{value:"",children:"Choose project"}),k.slice(0,80).map(p=>s.jsx("option",{value:p.slug,children:p.title},p.slug))]})]}),s.jsx("div",{className:"pi-zeroHarness",role:"group","aria-label":"Default harness",children:["claude","codex"].map(p=>s.jsx("button",{type:"button","data-on":g===p||void 0,onClick:()=>C(p),children:p==="claude"?"Claude":"Codex"},p))})]}),s.jsxs("div",{className:"pi-zeroInputRow",children:[s.jsx("textarea",{value:u,rows:2,placeholder:"Find project or paste /path/to/repo","aria-label":"Find or create project",onChange:p=>{c(p.currentTarget.value),v(""),y(null),F(null)},onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),p.currentTarget.form?.requestSubmit())}}),s.jsxs("button",{type:"submit",className:"pi-zeroSend",disabled:N||!$,title:h,children:[s.jsx(is,{size:15,strokeWidth:2,"aria-hidden":!0}),s.jsx("span",{children:N?"Working":h})]})]}),S.length>0?s.jsx("div",{className:"pi-zeroMatches","aria-label":"Matching projects",children:S.map(p=>s.jsxs("button",{type:"button",className:"pi-zeroMatch","data-selected":B?.slug===p.slug||void 0,onClick:()=>d(p),onDoubleClick:()=>b(p),children:[s.jsxs("span",{className:"pi-zeroMatchMain",children:[s.jsxs("span",{className:"pi-zeroMatchTitle",children:["/",p.title]}),s.jsx("span",{className:"pi-zeroMatchRoot",title:p.root??void 0,children:p.root?V(p.root):p.slug})]}),s.jsx("span",{className:"pi-zeroMatchMeta",children:$s(p)})]},p.slug))}):f?s.jsx("div",{className:"pi-zeroEmpty",children:"No project matches."}):null,R?s.jsx("div",{className:"pi-zeroError",children:R}):null,M?s.jsx("div",{className:"pi-zeroStatus",children:M}):null]})]})}function Ts(e){return e==="codex"?"codex":"claude"}function me(e,t){return{view:"agents-v2",projectSlug:t,...e.showEphemeral?{showEphemeral:!0}:{},...e.machineId?{machineId:e.machineId}:{}}}function Ls(e){return e.map(t=>({slug:t.slug,title:t.title,root:t.root,agentCount:t.agentCount,sessionCount:t.sessionCount,lastActivityAt:t.lastActivityAt})).sort((t,i)=>i.lastActivityAt-t.lastActivityAt||i.agentCount-t.agentCount||i.sessionCount-t.sessionCount||t.title.localeCompare(i.title))}function Ps(e,t){const i=H(t);return i?e.map(n=>({option:n,score:Ms(n,i)})).filter(n=>n.score!==null).sort((n,o)=>n.score-o.score||o.option.lastActivityAt-n.option.lastActivityAt||n.option.title.localeCompare(o.option.title)).slice(0,6).map(n=>n.option):e.slice(0,6)}function he(e,t){const i=H(t);return i?e.find(n=>{const o=H(n.root??""),r=H(n.root?Z(n.root):"");return H(n.title)===i||H(n.slug)===i||o===i||r===i||H(n.root?V(n.root):"")===i})??null:null}function Ms(e,t){const i=H(e.title),n=H(e.slug),o=H(e.root??""),r=H(e.root?Z(e.root):"");return i===t||n===t||o===t||r===t?0:i.startsWith(t)||n.startsWith(t)||r.startsWith(t)?1:i.includes(t)||n.includes(t)||r.includes(t)?2:o.includes(t)?3:null}function H(e){return e.trim().toLowerCase().replace(/^~(?=\/)/u,"").replace(/\s+/g," ")}function Es(e){const t=e.trim();return/^(~\/|\/|\.{1,2}\/)/u.test(t)||t.includes("/")}function Is(e,t){const i=H(t);return i?[e.root??"",e.root?V(e.root):"",e.root?Z(e.root):"",e.slug,e.title].map(H).some(o=>o===i||o.endsWith(i)):!1}function $s(e){return[fe(e.agentCount,"agent"),fe(e.sessionCount,"session"),e.lastActivityAt?_(e.lastActivityAt):null].filter(Boolean).join(" · ")}function fe(e,t){return`${e} ${t}${e===1?"":"s"}`}function Ws(e,t){return t.sessionId?e.find(i=>i.sessionId===t.sessionId||i.conversationId===t.sessionId||i.id===t.sessionId)??null:null}function je(e){return/^native:process:/iu.test(e??"")}function Fs(e){return e.startsWith("/")||e.startsWith("~/")||e.includes("/")&&/\.(jsonl?|events)$/i.test(e)}function we(e,t,i){const n=e?.trim()??"";return!n||Fs(n)?t:n}function Bs({session:e,sessionRef:t,threads:i,lookup:n,route:o,navigate:r,nowMs:a}){const[u,c]=m.useState(null),j=e?.agentName??o.selectedAgentId??o.agentId??"Session",v=e?.harness??"session",g=n?.kind==="observe"?n.observe.data:null,C=g?.metadata?.session,N=e?.lastActivityAt??n?.session?.lastMessageAt??null,[L,R,y]=m.useMemo(()=>[ae(g),ke(g,N),qs(g,N)],[g,N]),M=C?.gitBranch??n?.session?.currentBranch??e?.branch??null,F=C?.model??null,I=C?.turnCount??g?.metadata?.usage?.assistantMessages??(n?.kind==="conversation"?n.session.messageCount:null),D=R?_(R,a):e?.lastActivityAt?_(e.lastActivityAt,a):"—",k=e?.working?`live · last ${D}`:D!=="—"?`last ${D}`:"trace resolving",S=we(e?.work,j),B=ve(t),f=n?.session??null,x=n?.kind==="observe"?n.observe.agentId??f?.agentId??e?.agentId:f?.agentId??e?.agentId,l=n?.kind==="observe"?n.observe.sessionId:f?.harnessSessionId,h=[j,v,F,M,L?`started ${We(L)}`:null,y,I!=null?`turn ${w(I)}`:null,B].filter(b=>!!b&&b!=="—");m.useEffect(()=>{let b=!0;return c(null),!x&&!l&&!t?()=>{b=!1}:(Oe({includeDiscovered:!0}).then(T=>{b&&c(cs(T,{agentId:x,sessionRefs:[t,l,e?.sessionId]}))}).catch(()=>{b&&c(null)}),()=>{b=!1})},[e?.sessionId,t,x,l]);const $=()=>{u&&He(r,{view:"terminal",terminalSessionId:u.terminalSessionId,terminalSurfaceKey:u.terminalSurfaceKey,mode:"takeover"},{returnTo:o})},d=u?us(u,"takeover"):null;return s.jsxs("section",{className:"pi-sessionOverview","aria-label":"Session overview",children:[s.jsxs("section",{className:"pi-sessionMasthead","data-state":e?.working?"working":"recent",children:[s.jsxs("div",{className:"pi-sessionMastTop",children:[s.jsx("span",{className:"pi-sessionCrumb",children:"Sessions ▸"}),s.jsx("h2",{className:"pi-sessionHeadline",title:S,children:S}),s.jsxs("span",{className:"pi-sessionState",children:[e?.working?s.jsx("span",{className:"pi-sessionLiveDot","aria-hidden":!0}):null,k]})]}),s.jsx("div",{className:"pi-sessionMeta",children:h.map((b,T)=>s.jsxs("span",{title:T===h.length-1?t:b,children:[T===1?s.jsx(ge,{harness:v,size:11}):null,b]},`${b}:${T}`))}),u?s.jsxs("div",{className:"pi-sessionTerminalActions","aria-label":"tmux terminal actions",children:[s.jsxs("span",{className:"pi-sessionTerminalName",title:u.sessionName,children:["tmux · ",u.sessionName]}),s.jsx("button",{type:"button",onClick:$,children:"Open in web terminal"}),d?s.jsxs("a",{href:d,children:["Open in native terminal",s.jsx(as,{size:11,strokeWidth:1.8,"aria-hidden":!0})]}):null]}):null]}),s.jsx(Ys,{lookup:n,session:e,threads:i,nowMs:a,route:o,navigate:r})]})}function Ds({session:e,sessionRef:t,threads:i,route:n,navigate:o,nowMs:r}){const[a,u]=m.useState(null);return m.useEffect(()=>{u(null)},[t]),s.jsx("main",{className:"pi-sessionDetail","aria-label":"Selected session",children:s.jsxs("div",{className:"pi-sessionContent",children:[s.jsx(Bs,{session:e,sessionRef:t,threads:i,lookup:a,route:n,navigate:o,nowMs:r}),s.jsx(qe,{sessionRef:t,navigate:o,showObserveRail:!1,onLookup:u})]})})}function w(e){return typeof e!="number"||!Number.isFinite(e)?"—":Math.abs(e)<1e3?e.toLocaleString("en-US"):Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(e).toLowerCase()}function Ne(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?"—":`${w(e)} tok`}function G(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}function Os(e){const t=G(e?.contextInputTokens),i=G(e?.contextWindowTokens);return t===null||i===null?null:Math.max(0,Math.min(1,t/i))}function zs(e){const t=[{key:"input",label:"input",value:G(e?.inputTokens)??0},{key:"cache-read",label:"cache rd",value:G(e?.cacheReadInputTokens)??0},{key:"cache-write",label:"cache wr",value:G(e?.cacheCreationInputTokens)??0},{key:"output",label:"output",value:G(e?.outputTokens)??0},{key:"reasoning",label:"reasoning",value:G(e?.reasoningOutputTokens)??0}].filter(r=>r.value>0),i=t.reduce((r,a)=>r+a.value,0),n=t.filter(r=>r.key!=="reasoning"||i>0&&r.value/i>=.02);if(n.length>0)return n;const o=G(e?.totalTokens);return o!==null?[{key:"total",label:"total",value:o}]:[]}function Hs({buckets:e}){const t=e.reduce((i,n)=>i+n.value,0);return e.length===0?null:s.jsxs("div",{className:"pi-sessionGlanceTokens","aria-label":"Token usage",children:[s.jsx("div",{className:"pi-sessionGlanceTokenBars",children:e.map(i=>s.jsx("span",{className:"pi-sessionGlanceTokenSeg","data-kind":i.key,style:{flexGrow:t>0?Math.max(.035,i.value/t):1,flexBasis:0},title:`${i.label}: ${Ne(i.value)}`},i.key))}),s.jsx("div",{className:"pi-sessionGlanceTokenLegend",children:e.map(i=>s.jsxs("span",{children:[s.jsx("i",{"data-kind":i.key,"aria-hidden":!0}),i.label," ",s.jsx("b",{children:w(i.value)})]},i.key))})]})}function ae(e){const t=ee(e?.metadata?.session?.sessionStart);if(t!==null)return t;for(const i of e?.events??[]){const n=ee(i.at);if(n!==null)return n}return null}function ke(e,t){for(let o=(e?.events.length??0)-1;o>=0;o-=1){const r=ee(e?.events[o]?.at);if(r!==null)return r}const i=ae(e),n=e?.events.at(-1)?.t;return i!==null&&typeof n=="number"&&Number.isFinite(n)?i+n*1e3:ee(t)}function qs(e,t){const i=ae(e),n=ke(e,t);if(i!==null&&n!==null)return ie(Math.max(0,n-i))||"—";const o=e?.events.at(-1)?.t;return typeof o=="number"&&Number.isFinite(o)&&ie(o*1e3)||"—"}function ie(e){if(typeof e!="number"||!Number.isFinite(e)||e<0)return"";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const n=Math.floor(i/60),o=i%60;if(n<48)return o>0?`${n}h ${o}m`:`${n}h`;const r=Math.floor(n/24),a=n%24;return a>0?`${r}d ${a}h`:`${r}d`}function Gs(e){const t=e?.metadata?.topology;if(!t)return null;const i=t.agents.length,n=t.agents.filter(u=>u.role!=="lead").length,o=t.groups.filter(u=>u.kind==="workflow").length,r=t.tasks.length,a=[];return n>0?a.push(`${n} worker${n===1?"":"s"}`):i>0&&a.push(`${i} agent${i===1?"":"s"}`),o>0&&a.push(`${o} workflow${o===1?"":"s"}`),r>0&&a.push(`${r} task${r===1?"":"s"}`),a.length?a.join(" · "):null}function _s(e){return[...e].sort((t,i)=>xe(i.state)-xe(t.state)||i.touches-t.touches||i.lastT-t.lastT||t.path.localeCompare(i.path)).slice(0,5).map(t=>({path:t.path,kind:t.state,detail:[t.touches>1?`${w(t.touches)} touches`:"1 touch",t.lastT>0?`last ${ie(t.lastT*1e3)}`:null].filter(Boolean).join(" · ")}))}function xe(e){switch(e){case"created":return 3;case"modified":return 2;case"read":return 1}}function Vs(e){const t=new Map;for(const i of e){if(i.kind!=="tool")continue;const n=Ks(i.tool||i.text),o=t.get(n)??{count:0,samples:[]};o.count+=1;const r=i.arg||i.detail||i.text;r&&o.samples.length<2&&o.samples.push(r),t.set(n,o)}return[...t.entries()].sort((i,n)=>n[1].count-i[1].count||i[0].localeCompare(n[0])).slice(0,5).map(([i,n])=>({name:i,count:n.count,detail:n.samples.join(" · ")||`${w(n.count)} uses`}))}function Ks(e){return(e.trim().split(/\s+/u)[0]??"tool").replace(/[_-]+/gu," ").toLowerCase()}function Us({usage:e,contextPct:t,topology:i,workspace:n,projectRoot:o,branch:r}){const a=[];return t!==null&&a.push({label:"Context",value:`${t}%`,detail:t>=80?"approaching limit":"within window",tone:t>=80?"warn":void 0}),(e?.serviceTier||e?.planType||e?.speed)&&a.push({label:"Budget",value:e.serviceTier??e.planType??e.speed??"usage",detail:[e.planType,e.speed].filter(Boolean).join(" · ")||"provider metadata"}),n&&o&&n!==o?a.push({label:"Worktree",value:V(n),detail:"session cwd differs from project root",tone:"warn"}):r&&a.push({label:"Repo",value:r,detail:"session branch"}),i&&a.push({label:"Topology",value:i,detail:"observed harness hierarchy"}),(e?.webSearchRequests||e?.webFetchRequests)&&a.push({label:"Network",value:`${w((e.webSearchRequests??0)+(e.webFetchRequests??0))} req`,detail:[e.webSearchRequests?`${w(e.webSearchRequests)} search`:null,e.webFetchRequests?`${w(e.webFetchRequests)} fetch`:null].filter(Boolean).join(" · ")}),a.slice(0,4)}function Xs({session:e,threads:t,nowMs:i}){return t.filter(n=>n.kind==="agent").filter(n=>n.agentId!==e?.agentId||n.work!==e?.work).sort((n,o)=>Number(o.working)-Number(n.working)||o.lastActivityAt-n.lastActivityAt).slice(0,4).map(n=>{const o=!!(e?.branch&&n.branch===e.branch),r=!!(e?.agentName&&n.agentName===e.agentName);return{thread:n,title:we(n.work,n.agentName,n.id),channel:n.conversationId?ve(n.conversationId):n.agentName,state:n.needs?"needs":n.working?"working":"recent",time:n.lastActivityAt?_(n.lastActivityAt,i):"—",participants:n.agentName,why:o?"same branch":r?"same agent":n.working?"active in project":"project thread"}})}function Y({label:e,value:t,title:i,detail:n}){return s.jsxs("span",{className:"pi-sessionGlanceField",title:i,children:[s.jsx("span",{children:e}),s.jsx("b",{children:t}),n?s.jsx("small",{children:n}):null]})}function Ys({lookup:e,session:t,threads:i,nowMs:n,route:o,navigate:r}){const[a,u]=m.useState(!1),c=m.useMemo(()=>{const x=e?.kind==="observe"?e.observe.data:null,l=x?.metadata?.session,h=x?.metadata?.usage,$=x?.events??[],d=x?.files??[],b=l?.turnCount??h?.assistantMessages??(e?.kind==="conversation"?e.session.messageCount:null),T=$.filter(U=>U.kind==="tool").length,W=d.filter(U=>U.state==="created").length,p=d.filter(U=>U.state==="modified").length,P=d.filter(U=>U.state==="read").length,O=W+p,E=Os(h),z=E!==null?Math.round(E*100):null,A=l?.cwd??e?.session?.workspaceRoot??t?.projectRoot??null,K=l?.gitBranch??e?.session?.currentBranch??t?.branch??null,q=Gs(x),se=Ne(h?.totalTokens??(typeof h?.inputTokens=="number"||typeof h?.outputTokens=="number"?(h?.inputTokens??0)+(h?.outputTokens??0):null)),ye=zs(h),Ce=O>0?[p>0?`${w(p)} mod`:null,W>0?`${w(W)} new`:null].filter(Boolean).join(" · "):P>0?"read-only":"no file trace",Ae=d.length>0?`${w(d.length)} touched`:"—",Re=_s(d),Te=Vs($),Le=Us({usage:h,contextPct:z,topology:q,workspace:A,projectRoot:t?.projectRoot,branch:K}),Pe=Xs({session:t,threads:i,nowMs:n});return{turnCount:b,toolCount:T,editCount:O,fileCountLabel:Ae,fileStateLabel:Ce,workspace:A,contextPct:z,showContext:z!==null,contextWarn:z!==null&&z>=80,tokenTotal:se,buckets:ye,fileSignals:Re,toolSignals:Te,contextSignals:Le,threadSignals:Pe,projectRoot:t?.projectRoot??null}},[e,t,i,n]),{turnCount:j,toolCount:v,editCount:g,fileCountLabel:C,fileStateLabel:N,workspace:L,contextPct:R,showContext:y,contextWarn:M,tokenTotal:F,buckets:I,fileSignals:D,toolSignals:k,contextSignals:S,threadSignals:B,projectRoot:f}=c;return s.jsxs("section",{className:"pi-sessionGlance","aria-label":"Session glance",children:[s.jsxs("div",{className:"pi-sessionVitals","aria-label":"Session vitals",children:[s.jsx(Y,{label:"Turns",value:w(j)}),s.jsx(Y,{label:"Tools",value:w(v)}),s.jsx(Y,{label:"Edits",value:w(g)}),s.jsx(Y,{label:"Files",value:C,detail:N!=="no file trace"?N:null}),L&&f&&L!==f?s.jsx(Y,{label:"Worktree",value:V(L),title:L}):null,y?s.jsxs("span",{className:"pi-sessionContextVital",title:"Context window usage",children:[s.jsx("span",{children:"Ctx"}),s.jsx("span",{className:"pi-sessionContextBar","aria-hidden":!0,children:s.jsx("span",{"data-warn":M||void 0,style:{width:`${R}%`}})}),s.jsxs("b",{"data-warn":M||void 0,children:[R,"%"]})]}):null,I.length>0?s.jsxs("button",{type:"button",className:"pi-sessionTokenToggle","aria-expanded":a,onClick:()=>u(x=>!x),children:[s.jsx("span",{children:"Tokens"}),s.jsx("b",{children:F}),s.jsx("i",{children:a?"▾":"▸"})]}):null]}),a&&I.length>0?s.jsx(Hs,{buckets:I}):null,s.jsx(Zs,{files:D,tools:k,context:S,threads:B,route:o,navigate:r})]})}function Zs({files:e,tools:t,context:i,threads:n,route:o,navigate:r}){return s.jsxs("section",{className:"pi-sessionSignals","aria-label":"Session work signals",children:[s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsxs("div",{className:"pi-sessionSignalHead",children:[s.jsx("span",{children:"Files"}),s.jsx("b",{children:w(e.length)})]}),e.length>0?s.jsx("div",{className:"pi-sessionFileList",children:e.map(a=>s.jsxs("div",{className:"pi-sessionFileRow",children:[s.jsx("span",{"data-kind":a.kind,children:a.kind}),s.jsx("code",{title:a.path,children:a.path}),s.jsx("small",{children:a.detail})]},`${a.kind}:${a.path}`))}):s.jsx("span",{className:"pi-sessionSignalEmpty",children:"No file trace yet."})]}),s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsx("div",{className:"pi-sessionSignalHead",children:s.jsx("span",{children:"Tools · Context · Topology"})}),t.length>0?s.jsx("div",{className:"pi-sessionToolGrid",children:t.map(a=>s.jsxs("span",{className:"pi-sessionToolPill",title:a.detail,children:[s.jsx("b",{children:a.name}),s.jsx("em",{children:w(a.count)})]},a.name))}):null,i.length>0?s.jsx("div",{className:"pi-sessionContextList",children:i.map(a=>s.jsxs("div",{className:"pi-sessionContextRow",children:[s.jsx("span",{children:a.label}),s.jsx("b",{"data-tone":a.tone,children:a.value}),s.jsx("small",{children:a.detail})]},`${a.label}:${a.value}`))}):t.length===0?s.jsx("span",{className:"pi-sessionSignalEmpty",children:"Trace metadata is still resolving."}):null]}),s.jsxs("div",{className:"pi-sessionSignalCol",children:[s.jsxs("div",{className:"pi-sessionSignalHead",children:[s.jsx("span",{children:"Recent threads"}),s.jsx("b",{children:w(n.length)})]}),n.length>0?s.jsx("div",{className:"pi-sessionThreadList",children:n.map(a=>s.jsxs("button",{type:"button",className:"pi-sessionThreadRow",onClick:()=>r(be(a.thread,o)),children:[s.jsx("span",{className:"pi-sessionThreadTitle",title:a.title,children:a.title}),s.jsxs("span",{className:"pi-sessionThreadMeta",children:[s.jsx("b",{children:a.channel}),s.jsx("em",{children:a.state}),s.jsx("small",{children:a.time})]}),s.jsxs("span",{className:"pi-sessionThreadWhy",children:[a.participants," · ",a.why]})]},a.thread.id))}):s.jsx("span",{className:"pi-sessionSignalEmpty",children:"No recent agent threads."})]})]})}function ne(e){return!e||e==="—"||/^\d+\s+branches$/iu.test(e)?null:e}function Se(e,t,i,n){const o=new Map,r=(u,c)=>{const j=u??e,v=ne(c),g=j??"project",C=o.get(g);if(C)return!C.branch&&v&&(C.branch=v),C;const N={key:g,root:j,branch:v,sessions:0,work:0,moving:0,lastActivityAt:0,repoWatch:null};return o.set(g,N),N};for(const u of t){const c=r(u.root,u.branch);u.working&&(c.moving+=1),c.lastActivityAt=Math.max(c.lastActivityAt,u.lastActivityAt)}const a=(u,c)=>{const j=u??e,v=o.get(j??"project");return v||(t.length>0?o.get(e??"")??o.values().next().value:r(u,c))};for(const u of i){const c=a(u.workspaceRoot??u.projectRoot,u.branch);c.sessions+=1,u.working&&(c.moving+=1,c.branch=ne(u.branch)??c.branch),c.lastActivityAt=Math.max(c.lastActivityAt,u.lastActivityAt)}for(const u of n){const c=a(u.workspaceRoot??u.projectRoot,u.branch);c.work+=1,u.working&&(c.moving+=1,c.branch=ne(u.branch)??c.branch),c.lastActivityAt=Math.max(c.lastActivityAt,u.lastActivityAt)}return o.size===0&&r(e,null),[...o.values()].sort((u,c)=>c.moving-u.moving||c.lastActivityAt-u.lastActivityAt||(u.root??"").localeCompare(c.root??""))}function Js(e){return e.worktrees.map(t=>({key:t.id,root:t.path,branch:t.branch.name,sessions:t.sessions.length,work:t.agents.length,moving:t.agents.some($e)?1:0,lastActivityAt:t.lastCommitAt??0,repoWatch:t}))}function Qs({pullRequests:e,loading:t,warnings:i,onRefresh:n,nowMs:o}){return s.jsxs("section",{className:"pi-projectPullRequests","aria-label":"Open pull requests",children:[s.jsxs("div",{className:"pi-projectPullRequestsHead",children:[s.jsx("span",{children:"Open PRs"}),s.jsx("b",{children:t&&e.length===0?"…":w(e.length)})]}),e.length>0?s.jsx("div",{className:"pi-projectPullRequestList",children:e.slice(0,6).map(r=>{const a=r.updatedAt?Date.parse(r.updatedAt):Number.NaN;return s.jsxs("a",{className:"pi-projectPullRequest",href:r.url,target:"_blank",rel:"noreferrer",children:[s.jsxs("span",{className:"pi-projectPullRequestNumber",children:["#",r.number]}),s.jsx("b",{title:r.title,children:r.title}),s.jsxs("span",{className:"pi-projectPullRequestBranch",title:`${r.headRefName} → ${r.baseRefName}`,children:[r.headRefName," → ",r.baseRefName]}),s.jsx("em",{children:r.isDraft?"draft":"open"}),s.jsx("time",{children:Number.isFinite(a)?_(a,o):"updated"})]},r.id)})}):s.jsxs("div",{className:"pi-projectPullRequestState","data-loading":t||void 0,children:[s.jsx("span",{children:t?"Checking GitHub for open pull requests…":i[0]??"No open pull requests for this repository."}),!t&&i.length>0?s.jsx("button",{type:"button",onClick:n,children:"Retry"}):null]})]})}function et(e){const t=new Set;let i=0,n=0;const o=[];for(const r of e.layers){r.files.length>0&&o.push(r.kind);for(const a of r.files)t.add(a.newPath??a.oldPath??"unknown"),i+=a.additions??0,n+=a.deletions??0}return{additions:i,deletions:n,files:[...t],layers:o}}function st({additions:e,deletions:t}){return e+t===0?s.jsx("span",{className:"pi-projectWorktreeChurnBar","data-empty":!0}):s.jsxs("span",{className:"pi-projectWorktreeChurnBar","aria-label":`${e} additions and ${t} deletions`,children:[e>0?s.jsx("i",{"data-add":!0,style:{flexGrow:e}}):null,t>0?s.jsx("i",{"data-delete":!0,style:{flexGrow:t}}):null]})}function tt({project:e,repoProject:t,repoLoading:i,repoError:n,diffSnapshots:o,diffErrors:r,diffLoading:a,pullRequests:u,pullRequestsLoading:c,pullRequestWarnings:j,onRepositoryRefresh:v,threads:g,sessions:C,route:N,navigate:L,nowMs:R}){const y=e?.root??C[0]?.projectRoot??g[0]?.projectRoot??null,M=g.length,F=e?.sessionCount??C.length,I=e?.agentCount??0,D=Math.max(e?.lastActivityAt??0,C[0]?.lastActivityAt??0,g[0]?.lastActivityAt??0),k=e?.branches.length?e.branches:[...new Set([...C.map(l=>l.branch),...g.map(l=>l.branch)].filter(l=>!!l&&l!=="—"&&l!=="main"))],S=t?.worktrees.length?Js(t):Se(y,e?.worktrees??[],C,g),B=S.find(l=>l.moving>0&&l.branch)?.branch??S.find(l=>l.branch)?.branch??k[0]??"main",f=y?Z(y):e?.title??N.projectSlug??"project",x=S.find(l=>l.moving>0)?.key??S.find(l=>l.branch===B)?.key??S[0]?.key;return s.jsxs("main",{className:"pi-projectOverview","aria-label":"Project overview",children:[s.jsxs("section",{className:"pi-projectSnapshot","aria-label":"Project snapshot",children:[s.jsxs("div",{className:"pi-projectRepository",children:[s.jsxs("div",{className:"pi-projectRepositoryHead",children:[s.jsx("span",{children:"Repository"}),s.jsx(os,{size:13,strokeWidth:1.7,"aria-hidden":!0})]}),s.jsxs("div",{className:"pi-projectRepositoryIdentity",children:[s.jsx("b",{children:f}),s.jsx("span",{title:y??void 0,children:y?V(y):N.projectSlug??"project"})]}),s.jsxs("div",{className:"pi-projectRepositoryCurrent",children:[S.some(l=>l.moving>0)?s.jsx("span",{className:"pi-projectRepositoryPulse","aria-label":"Active now"}):null,s.jsxs("span",{children:[s.jsx("small",{children:"Current branch"}),s.jsx("b",{title:B,children:B})]}),s.jsx("time",{children:D?_(D,R):"no activity"})]}),F>0||I>0||M>0?s.jsxs("div",{className:"pi-projectRepositoryStats","aria-label":"Repository activity",children:[F>0?s.jsxs("span",{children:[s.jsx("b",{children:w(F)})," sessions"]}):null,I>0?s.jsxs("span",{children:[s.jsx("b",{children:w(I)})," agents"]}):null,M>0?s.jsxs("span",{children:[s.jsx("b",{children:w(M)})," threads"]}):null]}):null]}),s.jsxs("div",{className:"pi-projectWorktrees",children:[s.jsxs("div",{className:"pi-projectWorktreesHead",children:[s.jsx("span",{children:"Worktree preview"}),s.jsx("b",{children:w(S.length)})]}),s.jsx("div",{className:"pi-projectWorktreeList",children:S.slice(0,6).map(l=>{const h=l.repoWatch,$=l.root?o.get(l.root)??null:null,d=$?et($):null,b=h?Ie(h):null,T=d?.additions??b?.add??0,W=d?.deletions??b?.del??0,p=d?.files.length??(h?Math.max(h.status.changedFiles,b?.files??0):0),P=!!(p>0||h&&(!h.status.clean||h.branch.ahead>0||h.branch.behind>0)),O=u.filter(A=>A.headRefName===l.branch),E=!!(l.root&&a&&!$&&!r.has(l.root)),z=l.root?r.get(l.root)??null:"No worktree path is available.";return s.jsxs("article",{className:"pi-projectWorktree","data-active":l.key===x||void 0,"data-stranded":P||void 0,children:[s.jsx("span",{className:"pi-projectWorktreeTop",children:s.jsx("b",{title:l.branch??"main",children:l.branch??"main"})}),s.jsx("em",{title:l.root??void 0,children:l.root?V(l.root):"workspace"}),$||h?s.jsxs("div",{className:"pi-projectWorktreeDiff","data-clean":!P||void 0,children:[P?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"pi-projectWorktreeChurn",children:[s.jsxs("b",{className:"pi-projectWorktreeAdd",children:["+",w(T)]}),s.jsxs("b",{className:"pi-projectWorktreeDel",children:["−",w(W)]}),s.jsx(st,{additions:T,deletions:W})]}),s.jsxs("small",{children:[w(p)," changed"]})]}):s.jsx("small",{children:"clean"}),l.root?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:()=>L({view:"repo-diff",path:l.root}),children:"View diff"}):null]}):s.jsxs("div",{className:"pi-projectWorktreeDiff","data-pending":!0,children:[s.jsx("small",{children:E||i?"Reading worktree diff…":z??n??"No diff data returned."}),!E&&!i?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:v,children:"Retry"}):null]}),d&&d.files.length>0?s.jsxs("span",{className:"pi-projectWorktreeFiles",title:d.files.join(`
2
- `),children:[d.files.slice(0,2).map(A=>Z(A)).join(" · "),d.files.length>2?` · +${d.files.length-2} more`:""]}):null,s.jsx("span",{className:"pi-projectWorktreeMeta",children:h?s.jsxs(s.Fragment,{children:[s.jsx("small",{children:h.branch.ahead>0||h.branch.behind>0?`${h.branch.ahead}↑ ${h.branch.behind}↓`:"synced"}),h.status.staged>0?s.jsxs("small",{children:[w(h.status.staged)," staged"]}):null,h.status.unstaged>0?s.jsxs("small",{children:[w(h.status.unstaged)," unstaged"]}):null,h.status.untracked>0?s.jsxs("small",{children:[w(h.status.untracked)," untracked"]}):null,h.status.conflicts>0?s.jsxs("small",{children:[w(h.status.conflicts)," conflicts"]}):null,d?.layers.map(A=>s.jsx("small",{children:A},A)),O.length>0?s.jsxs("small",{children:[O.length," PR",O.length===1?"":"s"]}):null]}):s.jsxs(s.Fragment,{children:[s.jsx("small",{children:l.lastActivityAt?_(l.lastActivityAt,R):"idle"}),s.jsxs("small",{children:[w(l.sessions)," sessions"]}),s.jsxs("small",{children:[w(l.work)," threads"]})]})})]},l.key)})}),S.length>6?s.jsxs("div",{className:"pi-projectWorktreeMore",children:["+",S.length-6," more worktrees"]}):null]})]}),s.jsx(Qs,{pullRequests:u,loading:c,warnings:j,onRefresh:v,nowMs:R})]})}function nt({project:e,threads:t,sessions:i,route:n,navigate:o,nowMs:r}){const a=e?.root??i[0]?.projectRoot??t[0]?.projectRoot??null,u=m.useMemo(()=>Se(a,e?.worktrees??[],i,t).map(j=>j.root).filter(j=>!!j),[e?.worktrees,a,i,t]),c=vs(a,u);return s.jsx(tt,{project:e,repoProject:c.project,repoLoading:c.repoLoading,repoError:c.repoError,diffSnapshots:c.diffSnapshots,diffErrors:c.diffErrors,diffLoading:c.diffLoading,pullRequests:c.pullRequests,pullRequestsLoading:c.pullRequestsLoading,pullRequestWarnings:c.pullRequestWarnings,onRepositoryRefresh:c.refresh,threads:t,sessions:i,route:n,navigate:o,nowMs:r})}function Xn({route:e,navigate:t,zeroPreview:i=!1}){const{model:n,nowMs:o,loading:r,error:a,agents:u=ws}=_e(e),c=!!e.projectSlug,j=c&&!je(e.sessionId)?e.sessionId??null:null,v=m.useMemo(()=>j?Ws(n.sessions,e):null,[n.sessions,e,j]),g=c?e.indexView==="agents"?"agents":e.indexView==="sessions"?"sessions":"overview":"overview",C=c?n.projects.find(f=>f.slug===e.projectSlug)??null:null,N=m.useMemo(()=>{if(i)return[];if(!c)return[];const f=e.projectSlug,x=Q(n.threads,f),l=oe(n.sessions,f);return g==="overview"?[]:g==="agents"?x.filter(h=>h.kind==="agent"):l.length>0?l:x},[n.sessions,n.threads,g,e.projectSlug,c,i]),L=m.useMemo(()=>Ve(N),[N]),R=m.useMemo(()=>L.flatMap(f=>f.items),[L]),y=n.projects.length>0||n.threads.length>0||n.sessions.length>0,M=r&&!y,F=r&&!i,I=!c&&!F&&(i||n.projects.length===0&&N.length===0),D=!c&&!I,[k,S]=m.useState(-1),B=m.useRef(new Map);return m.useEffect(()=>{!c||!e.sessionId||!je(e.sessionId)||t({...e,indexView:"sessions",sessionId:void 0,selectedAgentId:void 0})},[t,e,c]),m.useEffect(()=>{S(-1)},[e.projectSlug]),m.useEffect(()=>{function f(x){const l=document.activeElement;if(!!l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const $=R.length;if($){if(x.key==="ArrowDown"||x.key==="j")x.preventDefault(),S(d=>d<0?0:Math.min($-1,d+1));else if(x.key==="ArrowUp"||x.key==="k")x.preventDefault(),S(d=>d<0?0:Math.max(0,d-1));else if(x.key==="Enter"){const d=R[k<0?0:k];d&&(x.preventDefault(),t(d.kind==="session"?re(d,e):le(d,e)))}}}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[k,R,t,e]),m.useEffect(()=>{if(k<0)return;const f=R[k];f&&B.current.get(f.id)?.scrollIntoView({block:"nearest"})},[k,R]),s.jsxs("div",{className:"s-pi s-pi-inbox","aria-busy":r||void 0,"data-loading":r||void 0,children:[c?s.jsx(ys,{route:e,navigate:t,slug:e.projectSlug,model:n,mode:g,repoProject:null}):s.jsx("div",{className:"pi-inboxHead",children:s.jsxs("div",{className:"pi-inboxHeading",children:[s.jsx("h1",{className:"pi-inboxTitle",children:"Projects"}),s.jsx("span",{className:"pi-inboxDigest",children:As(n,i)})]})}),j?s.jsx(Ds,{session:v,sessionRef:j,threads:Q(n.threads,e.projectSlug),route:e,navigate:t,nowMs:o}):c&&g==="overview"?s.jsx(nt,{project:C,threads:Q(n.threads,e.projectSlug),sessions:oe(n.sessions,e.projectSlug),route:e,navigate:t,nowMs:o}):D?s.jsx(Ge,{model:n,agents:u,route:e,navigate:t,nowMs:o}):s.jsxs("div",{className:"pi-threads",children:[M?s.jsx(Ss,{}):null,!M&&L.map(f=>{let x=0;for(const l of L){if(l.group===f.group)break;x+=l.items.length}return s.jsxs("div",{children:[s.jsxs("div",{className:"pi-sectionHead","data-tone":f.group,children:[s.jsx("span",{className:"pi-sectionLabel",children:f.label}),s.jsx("span",{className:"pi-sectionCount",children:f.items.length})]}),f.items.map((l,h)=>{const $=x+h;return s.jsx(ks,{thread:l,crossProject:!c,selected:l.kind==="session"?Ue(l,e):Xe(l,e),cursor:k===$,nowMs:o,onSelect:()=>{const d=l.kind==="session"?Ke(l,e):be(l,e);t(d)},onOpen:()=>t(l.kind==="session"?re(l,e):le(l,e)),rowRef:d=>{d?B.current.set(l.id,d):B.current.delete(l.id)}},l.id)})]},f.group)}),!M&&N.length===0?a&&!y?s.jsx(pe,{tone:"error",title:"Projects unavailable",detail:a}):I?s.jsx("div",{className:"pi-empty",children:s.jsx(Rs,{route:e,navigate:t,projects:n.projects})}):F?s.jsx("div",{className:"pi-empty",children:"Loading…"}):s.jsx(pe,{title:it(c,g)}):null]})]})}function it(e,t){return e&&t==="agents"?"No visible agents in this project.":e?"No sessions in this project yet.":"No projects yet."}export{Xn as ProjectsInbox,ks as ThreadRow};
@@ -1 +0,0 @@
1
- import{r as d,j as t}from"./index-NRbRrZw-.js";import{t as se}from"./time-Dhsh_2EG.js";import{p as ue}from"./NewChatComposer-BPsg8shF.js";import{F as he,A as je}from"./AddProjectForm-Dw2oyCcz.js";import{s as me}from"./project-overview-helpers-BQTc_Ous.js";import{u as Se,i as q,s as fe,b as I,c as $,d as xe}from"./projects-inbox-Cbfj4Hx7.js";import{S as K}from"./search-HmdKXdtR.js";import{X as ge}from"./x-DuzAbpk5.js";import{C as ie}from"./chevron-down-Jh540uf3.js";import{C as ne}from"./chevron-right-CV7sEVBS.js";import{F as oe}from"./DocumentFocusViewer-CetjnYut.js";import{c as we}from"./createLucideIcon-Da0lq809.js";import{A as ve}from"./archive-DPMdoW_D.js";const Ne=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],ye=we("pin",Ne),U=4,re="openscout.projects.pinnedSessions",ae="openscout.projects.archivedSessions";function Ce(e){return e.needs>0?"needs":e.working>0||e.liveSessionCount>0?"working":"idle"}function Ae({rows:e=6}){return t.jsx("div",{className:"pi-railLoading","aria-hidden":"true",children:Array.from({length:e},(s,i)=>t.jsxs("div",{className:"pi-projectGroup pi-projectGroup--loading",children:[t.jsx("div",{className:"pi-projectGroupHead",children:t.jsxs("span",{className:"pi-projectPath",children:[t.jsx(oe,{size:13,strokeWidth:1.6,"aria-hidden":!0}),t.jsx("span",{className:"pi-loadingLine pi-loadingLine--railProject"})]})}),t.jsxs("div",{className:"pi-projectSessionList",children:[t.jsx("span",{className:"pi-loadingLine pi-loadingLine--railSession"}),t.jsx("span",{className:"pi-loadingLine pi-loadingLine--railSession"})]})]},i))})}function Pe({route:e,navigate:s,zeroPreview:i=!1}){const{model:o,nowMs:l,loading:r,error:c}=Se(e),[u,y]=d.useState(""),[j,m]=d.useState("recent"),[g,w]=d.useState(!1),[h,v]=d.useState(()=>new Set),[N,C]=d.useState(()=>new Set),[A,S]=d.useState(()=>Oe()),[W,de]=d.useState(()=>Fe()),[_,H]=d.useState(!1),f=e.machineId,P=e.showEphemeral,pe=r&&o.projects.length===0&&o.sessions.length===0,L=d.useMemo(()=>i?[]:o.sessions.filter(n=>!W.has(b(n))),[o.sessions,W,i]),z=d.useMemo(()=>i?[]:Le(o.projects,L),[o.projects,L,i]),T=d.useMemo(()=>Te(z,u,j),[z,u,j]),D=u.trim().length>0,V=D?T:T.filter(n=>!q(n.project,l)),E=D?[]:T.filter(n=>q(n.project,l)),B=d.useMemo(()=>i?[]:G(L.filter(n=>A.has(b(n))&&ce(n,u))),[L,A,u,i]),J=d.useCallback(n=>{v(a=>ee(a,n)),s({view:"agents-v2",projectSlug:n,...f?{machineId:f}:{},...P?{showEphemeral:!0}:{}})},[f,s,P]),O=d.useCallback(n=>{v(a=>ee(a,n.projectSlug)),s(fe(n,{projectSlug:n.projectSlug,...f?{machineId:f}:{},...P?{showEphemeral:!0}:{}}))},[f,s,P]),F=d.useCallback(n=>{const a=b(n);S(x=>{const p=new Set(x);return p.has(a)?p.delete(a):p.add(a),te(p),p})},[]),M=d.useCallback(n=>{const a=b(n);de(x=>{if(x.has(a))return x;const p=new Set(x);return p.add(a),Me(p),p}),S(x=>{if(!x.has(a))return x;const p=new Set(x);return p.delete(a),te(p),p}),I(n,e)&&s({view:"agents-v2",projectSlug:n.projectSlug,indexView:"sessions",...f?{machineId:f}:{},...P?{showEphemeral:!0}:{}})},[f,s,e,P]);return t.jsxs("nav",{className:"s-pi s-pi-rail","aria-label":"Projects","aria-busy":r||void 0,"data-loading":r||void 0,children:[t.jsxs("div",{className:"pi-railFind",role:"search",children:[t.jsx(K,{size:13,strokeWidth:1.8,"aria-hidden":!0}),t.jsx("input",{className:"pi-railFindInput",type:"search",value:u,placeholder:"Find project or session","aria-label":"Find project or session",onChange:n=>y(n.currentTarget.value)}),u?t.jsx("button",{type:"button",className:"pi-railFindClear","aria-label":"Clear",onClick:()=>y(""),children:t.jsx(ge,{size:12,strokeWidth:2,"aria-hidden":!0})}):null]}),t.jsx("div",{className:"pi-railBody",children:t.jsxs("div",{className:"pi-railGroup pi-railGroup--projects",children:[t.jsxs("div",{className:"pi-railProjectTools",children:[t.jsx("div",{className:"pi-railLabel",children:"Projects"}),t.jsxs("label",{className:"pi-railSortWrap",title:"Sort projects",children:[t.jsx("span",{className:"pi-srOnly",children:"Sort projects"}),t.jsxs("select",{className:"pi-railSort",value:j,"aria-label":"Sort projects",onChange:n=>m(n.currentTarget.value),children:[t.jsx("option",{value:"recent",children:"Recent"}),t.jsx("option",{value:"name",children:"Name"}),t.jsx("option",{value:"sessions",children:"Sessions"})]}),t.jsx(ie,{size:12,strokeWidth:2,"aria-hidden":!0})]}),t.jsx("button",{type:"button",className:"pi-railAddBtn","aria-expanded":_,"aria-label":"Add project",title:"Add a project by path",onClick:()=>H(n=>!n),children:t.jsx(he,{size:13,strokeWidth:1.8,"aria-hidden":!0})})]}),_?t.jsx(je,{onClose:()=>H(!1)}):null,pe?t.jsx(Ae,{}):c&&T.length===0?t.jsx("div",{className:"pi-railEmpty",children:"Projects unavailable."}):t.jsxs(t.Fragment,{children:[B.length>0?t.jsxs("div",{className:"pi-pinnedSessions",children:[t.jsx("div",{className:"pi-pinnedLabel",children:"Pinned"}),t.jsx("div",{className:"pi-projectSessionList",children:B.map(n=>t.jsx(le,{session:n,pinned:!0,selected:I(n,e),showProject:!0,nowMs:l,onOpenSession:O,onTogglePinnedSession:F,onArchiveSession:M},`pinned:${n.id}`))})]}):null,V.map(n=>t.jsx(Q,{group:n,selected:e.projectSlug===n.project.slug,collapsed:h.has(n.project.slug),expanded:N.has(n.project.slug),pinnedSessions:A,nowMs:l,route:e,onOpenProject:J,onOpenSession:O,onToggleCollapsed:()=>v(a=>R(a,n.project.slug)),onToggleExpanded:()=>C(a=>R(a,n.project.slug)),onTogglePinnedSession:F,onArchiveSession:M},n.project.slug)),V.length===0&&E.length===0?t.jsx("div",{className:"pi-railEmpty",children:u?"No projects matched.":"No projects yet."}):null,E.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",className:"pi-railDisclosure","data-open":g||void 0,onClick:()=>w(n=>!n),children:[t.jsx(ne,{className:"pi-railChev",size:12,strokeWidth:2,"aria-hidden":!0}),"All projects · ",E.length," quiet"]}),g?E.map(n=>t.jsx(Q,{group:n,selected:e.projectSlug===n.project.slug,collapsed:h.has(n.project.slug),expanded:N.has(n.project.slug),pinnedSessions:A,nowMs:l,route:e,onOpenProject:J,onOpenSession:O,onToggleCollapsed:()=>v(a=>R(a,n.project.slug)),onToggleExpanded:()=>C(a=>R(a,n.project.slug)),onTogglePinnedSession:F,onArchiveSession:M},n.project.slug)):null]}):null]})]})}),t.jsx("div",{className:"pi-railFoot",children:t.jsxs("button",{type:"button",className:"pi-railFootBtn",onClick:()=>s({view:"search"}),children:[t.jsx(K,{size:13,strokeWidth:1.8,"aria-hidden":!0}),"Search agents & sessions"]})})]})}function Q({group:e,selected:s,collapsed:i,expanded:o,pinnedSessions:l,nowMs:r,route:c,onOpenProject:u,onOpenSession:y,onToggleCollapsed:j,onToggleExpanded:m,onTogglePinnedSession:g,onArchiveSession:w}){const{project:h,sessions:v}=e,N=G(v.filter(S=>!l.has(b(S)))),C=i?[]:o?N:N.slice(0,U),A=Math.max(0,N.length-C.length);return t.jsxs("div",{className:"pi-projectGroup","data-selected":s||void 0,"data-state":Ce(h),"data-collapsed":i||void 0,children:[t.jsxs("div",{className:"pi-projectGroupHead",children:[t.jsxs("button",{type:"button",className:"pi-projectPath","aria-expanded":s?!i:void 0,title:Re(h),"aria-current":s?"page":void 0,"aria-label":s?i?`Expand /${h.title}`:`Collapse /${h.title}`:`Open /${h.title}`,onClick:()=>{s?j():u(h.slug)},children:[t.jsx(oe,{size:13,strokeWidth:1.6,"aria-hidden":!0}),t.jsxs("span",{className:"pi-projectPathText",children:["/",h.title]})]}),t.jsx("button",{type:"button",className:"pi-projectPathToggle","aria-expanded":!i,"aria-label":i?`Expand /${h.title}`:`Collapse /${h.title}`,onClick:j,children:i?t.jsx(ne,{size:12,strokeWidth:2}):t.jsx(ie,{size:12,strokeWidth:2})})]}),!i&&C.length>0?t.jsx("div",{className:"pi-projectSessionList",children:C.map(S=>t.jsx(le,{session:S,pinned:l.has(b(S)),selected:I(S,c),showProject:!1,nowMs:r,onOpenSession:y,onTogglePinnedSession:g,onArchiveSession:w},S.id))}):!i&&v.length===0?t.jsx("div",{className:"pi-projectSessionEmpty",children:"No sessions yet"}):null,!i&&A>0?t.jsx("button",{type:"button",className:"pi-projectShowMore",onClick:m,children:"Show more"}):!i&&o&&N.length>U?t.jsx("button",{type:"button",className:"pi-projectShowMore",onClick:m,children:"Show less"}):null]})}function be(e,s){return e.session===s.session&&e.pinned===s.pinned&&e.selected===s.selected&&e.showProject===s.showProject&&e.nowMs===s.nowMs&&e.onOpenSession===s.onOpenSession&&e.onTogglePinnedSession===s.onTogglePinnedSession&&e.onArchiveSession===s.onArchiveSession}function Y(e){const s=e.getBoundingClientRect();return{left:Math.min(window.innerWidth-304-12,s.right+10),top:Math.max(12,Math.min(window.innerHeight-174-12,s.top-18))}}const le=d.memo(function({session:s,pinned:i,selected:o,showProject:l,nowMs:r,onOpenSession:c,onTogglePinnedSession:u,onArchiveSession:y}){const[j,m]=d.useState(null),g=k(s);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pi-projectSession","data-active":s.working||void 0,"data-pinned":i||void 0,"data-selected":o||void 0,onMouseEnter:w=>m(Y(w.currentTarget)),onMouseLeave:()=>m(null),onFocusCapture:w=>m(Y(w.currentTarget)),onBlurCapture:()=>m(null),children:[t.jsxs("button",{type:"button",className:"pi-projectSessionMain","aria-label":l?`${g} /${s.projectTitle}`:g,onClick:()=>{m(null),c(s)},children:[t.jsx("span",{className:"pi-projectSessionTitle",children:g}),l?t.jsxs("span",{className:"pi-projectSessionProject",children:["/",s.projectTitle]}):null]}),t.jsx("button",{type:"button",className:"pi-sessionPin","data-pinned":i||void 0,"aria-pressed":i,"aria-label":i?"Unpin session":"Pin session",title:i?"Unpin session":"Pin session",onClick:()=>u(s),children:t.jsx(ye,{size:11,strokeWidth:2,"aria-hidden":!0})}),t.jsx("button",{type:"button",className:"pi-sessionArchive","aria-label":"Archive session",title:"Archive session",onClick:()=>y(s),children:t.jsx(ve,{size:11,strokeWidth:2,"aria-hidden":!0})}),t.jsx("span",{className:"pi-projectSessionWhen",children:s.lastActivityAt?se(s.lastActivityAt,r):"-"})]}),j?t.jsx(ke,{session:s,left:j.left,top:j.top,nowMs:r}):null]})},be);function ke({session:e,left:s,top:i,nowMs:o}){const l=e.agentName||null,r=e.projectRoot?me(e.projectRoot):`/${e.projectTitle}`,c=$(e);return t.jsxs("div",{className:"pi-sessionHoverCard",role:"tooltip",style:{left:s,top:i},children:[t.jsxs("div",{className:"pi-sessionHoverKicker",children:[t.jsxs("span",{children:["/",e.projectTitle]}),t.jsx("span",{children:e.lastActivityAt?se(e.lastActivityAt,o):"-"})]}),t.jsx("div",{className:"pi-sessionHoverTitle",children:k(e)}),t.jsxs("div",{className:"pi-sessionHoverContext",children:[e.working?"Live now":"Last touched"," in ",r]}),t.jsxs("div",{className:"pi-sessionHoverFacts",children:[t.jsx("span",{children:e.harness}),t.jsx("span",{children:e.working?"active":"recent"}),e.branch?t.jsx("span",{children:e.branch}):null,l?t.jsx("span",{children:l}):null]}),t.jsx("div",{className:"pi-sessionHoverRef",children:c??"No session archive yet"})]})}function Le(e,s){return e.map(i=>{const o=xe(s,i.slug);return{project:i,sessions:G(o),lastActivityAt:o[0]?.lastActivityAt??i.lastActivityAt}})}function Te(e,s,i){const o=s.trim().toLowerCase();return[...o?e.filter(r=>r.project.title.toLowerCase().includes(o)||r.project.slug.toLowerCase().includes(o)||r.sessions.some(c=>ce(c,o))):e].sort((r,c)=>{switch(i){case"name":return r.project.title.localeCompare(c.project.title);case"sessions":return c.project.sessionCount-r.project.sessionCount||c.lastActivityAt-r.lastActivityAt||r.project.title.localeCompare(c.project.title);default:return c.project.liveSessionCount-r.project.liveSessionCount||c.lastActivityAt-r.lastActivityAt||c.project.sessionCount-r.project.sessionCount||r.project.title.localeCompare(c.project.title)}})}function G(e){return[...e].sort((s,i)=>Number(i.working)-Number(s.working)||X(i)-X(s)||i.lastActivityAt-s.lastActivityAt||k(s).localeCompare(k(i)))}function X(e){return $(e)?2:e.agentId?1:0}function ce(e,s){const i=s.trim().toLowerCase();return i?e.projectTitle.toLowerCase().includes(i)||e.projectSlug.toLowerCase().includes(i)||k(e).toLowerCase().includes(i)||e.agentName.toLowerCase().includes(i)||e.harness.toLowerCase().includes(i)||(e.branch?.toLowerCase().includes(i)??!1):!0}function b(e){return $(e)??e.id}function k(e){const s=e.work||e.sessionId||e.id,i=s.includes("/")?ue(s):s;return Ee(i,e.harness)}function Ee(e,s){const i=e.replace(/\.jsonl$/iu,""),o=i.match(/^rollout-(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})/u);if(o)return`${Z(s)} rollout ${o[4]}:${o[5]}`;const l=i.match(/^([0-9a-f]{8})-[0-9a-f-]{27,}$/iu);return l?`${Z(s)} session ${l[1]}`:i.length>42?`${i.slice(0,39).trim()}...`:i}function Re(e){return`/${e.title}`}function Z(e){const s=e.trim();return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():"Session"}function R(e,s){const i=new Set(e);return i.has(s)?i.delete(s):i.add(s),i}function ee(e,s){if(!e.has(s))return e;const i=new Set(e);return i.delete(s),i}function Oe(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(re),s=e?JSON.parse(e):[];return new Set(Array.isArray(s)?s.filter(i=>typeof i=="string"):[])}catch{return new Set}}function te(e){if(!(typeof window>"u"))try{window.localStorage.setItem(re,JSON.stringify([...e]))}catch{}}function Fe(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(ae),s=e?JSON.parse(e):[];return new Set(Array.isArray(s)?s.filter(i=>typeof i=="string"):[])}catch{return new Set}}function Me(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ae,JSON.stringify([...e]))}catch{}}const Ue=Object.freeze(Object.defineProperty({__proto__:null,ProjectsRail:Pe},Symbol.toStringTag,{value:"Module"}));export{Pe as P,ye as a,Ue as b};
@@ -1 +0,0 @@
1
- import{j as i}from"./index-NRbRrZw-.js";import{u as e}from"./Provider-Cd-QZltN.js";import{d as s}from"./types-B0PlfpKc.js";import{ProjectsInbox as c}from"./ProjectsInbox--ZIqo-IE.js";import{P as a}from"./ProjectsRail-CzS0qTCI.js";import{ProjectAgentProfile as n}from"./ProjectAgentProfile-BjykZ2Xd.js";import{i as l}from"./model-IGCUEsMy.js";/* empty css */import"./projects-inbox-Cbfj4Hx7.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./api-DEHEgJ9m.js";import"./sse-QSbhyq9A.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./time-Dhsh_2EG.js";import"./index-CD2foMB8.js";import"./HarnessMark-CEzmPFHC.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./AgentAvatar-CQqJcwOQ.js";import"./SpriteAvatar-vpHO-rXs.js";import"./agent-identity-CIMT7oV6.js";import"./ui-LM8pS8qE.js";import"./openContent-C6XO6kr5.js";import"./SessionRefScreen-UVNVrwAf.js";import"./tail-events-B7BrDaFi.js";import"./BackToPicker-CXsbxbHM.js";import"./ConversationScreen-D77SoLos.js";import"./ConversationComposer-DPWu3HvK.js";import"./zap-CocRNtyr.js";import"./message-markup-BP2nH9kQ.js";import"./mentions-KNASbAjG.js";import"./AgentDetailCard-2DZQahiN.js";import"./AgentLiveActions-BmXDRxER.js";import"./terminal-takeover-BArLfNtd.js";import"./eye-B908WSFH.js";import"./terminal-DNZTCr6a.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";/* empty css */import"./ConversationHeader-Ce7TENb9.js";import"./AstronautSuit-C05Ezxl9.js";import"./ConversationFeedRows-MhcPfxUr.js";import"./ConversationPanels-D-b5SLO-.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-0fAsybdo.js";import"./proxy-DtC2iXnT.js";import"./activity-DTqqWiyV.js";import"./message-circle-2v9Udia0.js";import"./ConversationStatus-lIvSKRic.js";import"./check-BdovFDz8.js";import"./sparkles-CgTby-ap.js";import"./SessionObserve-pbozyqVv.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-DCY-m0JK.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-CfHYu-4Z.js";import"./ObserveTextFlow-CKYltTPJ.js";import"./SessionObserveEvidence-C54Xvbps.js";import"./wrench-DwFKomxg.js";import"./external-link-BheHazeW.js";/* empty css */import"./CrewWorkspaces-CdojnRMG.js";import"./project-overview-helpers-BQTc_Ous.js";import"./AddProjectForm-Dw2oyCcz.js";import"./agent-specialization-D3-sqwhU.js";import"./cpu-CtQc0Z9D.js";import"./sliders-horizontal-D2O6QiDN.js";import"./message-square-DURSOrUr.js";import"./api-BHHEUSS3.js";import"./cache-BO2Bd_LV.js";import"./arrow-up-right-CilNLf4t.js";import"./archive-DPMdoW_D.js";import"./AgentsSubnav-CsvYzzQ-.js";import"./SecondaryNav-CCQqTT3e.js";import"./secondaryNavConfig-BVQiyAXu.js";import"./compass-D5Io6BIV.js";import"./settings-BpKRzxOD.js";import"./git-branch-CdJU49Af.js";import"./scroll-text-uulNqrf7.js";import"./profile-Y0X7HZHc.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-b7B1Sof1.js";import"./terminal-relay-C2TUIuh1.js";/* empty css */import"./AgentDefinitionsWorkspace-D0LDEqfl.js";import"./FileViewerPane-ebbCtnHE.js";import"./agent-essentials-DbbJm3ne.js";/* empty css *//* empty css */import"./ProjectAgentProfileBar-B4RqrI0Q.js";import"./agents-project-model-UYiamtrU.js";function f({route:o,navigate:r}){const t=l(o),m=t?`profile:${o.agentId}`:"index",p=!t&&j();return i.jsx("div",{className:"s-av2","data-view":t?"profile":"index",children:i.jsx("div",{className:"av2-stagePane",children:t?i.jsx(n,{route:o,navigate:r}):i.jsx(c,{route:o,navigate:r,zeroPreview:p})},m)})}function yr({navigate:o}){const{route:r}=e(),t=r.view==="agents-v2"?r:{view:"agents-v2"};return i.jsxs("div",{className:"pi-projectsEmbedShell",children:[i.jsx(a,{route:t,navigate:o}),i.jsx(f,{route:t,navigate:o})]})}const Cr=s({id:"projects",label:"Projects",route:{view:"agents-v2"},webPath:"/projects",screen:"ProjectsEmbedScreen",embed:{path:"/embed/projects",profile:"macos.projects",ownsInternalRoutes:!0,rootClassName:"s-projects-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0}}});function j(){if(typeof window>"u")return!1;const o=window.location.hostname.toLowerCase();if(o!=="localhost"&&o!=="127.0.0.1"&&o!=="::1")return!1;const r=new URLSearchParams(window.location.search).get("zero")?.trim().toLowerCase();return r==="projects"||r==="project"||r==="1"||r==="true"}export{yr as ProjectsEmbedScreen,f as ProjectsScreen,Cr as scoutSurface};
@@ -1 +0,0 @@
1
- import{j as s}from"./index-NRbRrZw-.js";import{A as R}from"./AgentAvatar-CQqJcwOQ.js";import{H as O}from"./HarnessMark-CEzmPFHC.js";import{t as P}from"./time-Dhsh_2EG.js";import{s as y}from"./project-overview-helpers-BQTc_Ous.js";import{u as H,t as T,a as B,s as C}from"./projects-inbox-Cbfj4Hx7.js";import{A as g}from"./arrow-up-right-CilNLf4t.js";import"./Provider-Cd-QZltN.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./api-DEHEgJ9m.js";import"./sse-QSbhyq9A.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./index-CD2foMB8.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";import"./SpriteAvatar-vpHO-rXs.js";import"./agent-identity-CIMT7oV6.js";import"./agents-project-model-UYiamtrU.js";import"./model-IGCUEsMy.js";function L(i,r,t){if(t.sessionId){const d=r.find(a=>a.sessionId===t.sessionId||a.conversationId===t.sessionId||a.id===t.sessionId);if(d)return{kind:"session",session:d};const o=i.find(a=>a.kind==="native"&&a.sessionId===t.sessionId)??null;if(o)return{kind:"thread",thread:o}}if(t.selectedAgentId){const d=i.find(a=>a.agentId===t.selectedAgentId)??null;if(d)return{kind:"thread",thread:d};const o=r.find(a=>!a.sessionId&&a.agentId===t.selectedAgentId)??null;if(o)return{kind:"session",session:o}}return null}function p({label:i,value:r}){return s.jsxs("span",{className:"pi-stat",children:[s.jsx("span",{className:"pi-statLabel",children:i}),s.jsx("span",{className:"pi-statValue",children:r})]})}function Ss({route:i,navigate:r}){const{model:t,nowMs:d,loading:o,error:a}=H(i);if(!i.sessionId&&!i.selectedAgentId)return null;const l=L(t.threads,t.sessions,i);if(!l)return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsx("header",{className:"pi-asideHead",children:s.jsxs("div",{className:"pi-asideIdent",children:[s.jsx("div",{className:"pi-asideTop",children:s.jsx("span",{className:"pi-asideName",children:o?"Resolving selection":a?"Project data unavailable":"Selection unavailable"})}),s.jsx("div",{className:"pi-asideSub",children:s.jsxs("span",{className:"pi-asideStatus","data-tone":o?"working":"recent",children:[o?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,o?"loading":"idle"]})})]})}),s.jsx("div",{className:"pi-asideBody",children:s.jsx("p",{className:"pi-asideMuted",children:a??"The selected item is not in the current project snapshot."})})]});const n=l.kind==="thread"?l.thread:null,e=l.kind==="session"?l.session:null,m=n?.agentName??e?.agentName??"Session",h=n?.harness??e?.harness??"session",I=n?.projectTitle??e?.projectTitle??i.projectSlug??"project",x=n?.branch??e?.branch??null,c=n?.working??e?.working??!1,f=n?.needs?"needs":c?"working":"recent",b=n?.needs?"your turn":c?"working":e?"selected":"idle",k=n?.work??e?.work??"No session detail available.",v=n?.lastActivityAt??e?.lastActivityAt??0,j=e?.sessionId??n?.sessionId??null,u=n?.projectRoot??e?.projectRoot??null,N=n?T(n,i):null,w=n?B(n,i):e?C(e,i):i,A=e?e.route?.view==="conversation"?"Open conversation":e.route?.view==="sessions"?"Open session":e.agentId?"Open agent":"Open project":n?.kind==="native"?"Open session":n?.conversationId?"Open conversation":"Open agent",S={view:"agents-v2",...i.projectSlug?{projectSlug:i.projectSlug}:{},...i.indexView?{indexView:i.indexView}:{},...i.machineId?{machineId:i.machineId}:{},...i.showEphemeral?{showEphemeral:!0}:{}};return s.jsxs("div",{className:"s-pi s-pi-aside",children:[s.jsxs("header",{className:"pi-asideHead",children:[s.jsx("span",{className:"pi-asideAvatar",children:s.jsx(R,{agent:{name:m,harness:h,state:c?"in_turn":null},placement:"row",size:38})}),s.jsxs("div",{className:"pi-asideIdent",children:[s.jsxs("div",{className:"pi-asideTop",children:[s.jsx("span",{className:"pi-asideName",title:m,children:m}),s.jsx("span",{className:"pi-asideHmark","aria-hidden":!0,children:s.jsx(O,{harness:h,size:13})}),s.jsxs("span",{className:"pi-asideProj",children:["/",I]})]}),s.jsxs("div",{className:"pi-asideSub",children:[x?s.jsx("span",{className:"pi-asideBranch",children:x}):null,s.jsxs("span",{className:"pi-asideStatus","data-tone":f,children:[c?s.jsx("span",{className:"pi-asidePulse","aria-hidden":!0}):null,b]})]})]})]}),s.jsxs("div",{className:"pi-asideBody",children:[s.jsx("h2",{className:"pi-asideHeadline",children:k}),s.jsxs("div",{className:"pi-asideReadouts",children:[s.jsx(p,{label:"Last active",value:v?P(v,d):"—"}),s.jsx(p,{label:e?"Session":"Conversations",value:e?"1":String(n?.sessionCount??0)}),s.jsx(p,{label:"Harness",value:h}),n?.contextPct!=null?s.jsx(p,{label:"Context",value:`${n.contextPct}%`}):null]}),e?s.jsxs("div",{className:"pi-asideSection",children:[s.jsx("div",{className:"pi-asideSectionHead",children:"Session context"}),s.jsxs("div",{className:"pi-asideLine",children:[j?s.jsxs("span",{title:j,children:["ref · ",j]}):s.jsx("span",{children:"No stable session reference yet."}),u?s.jsxs("span",{title:u,children:["root · ",y(u)]}):null,e.conversationId?s.jsxs("span",{title:e.conversationId,children:["conversation · ",e.conversationId]}):null]})]}):null,s.jsxs("div",{className:"pi-asideActions",children:[s.jsxs("button",{type:"button",className:"pi-asideBtn pi-asideBtnPrimary",onClick:()=>r(w),children:[A,s.jsx(g,{size:13,strokeWidth:2,"aria-hidden":!0})]}),N?s.jsxs("button",{type:"button",className:"pi-asideBtn",onClick:()=>r(N),children:["Observe",s.jsx(g,{size:13,strokeWidth:2,"aria-hidden":!0})]}):null,s.jsx("button",{type:"button",className:"pi-asideBtn",onClick:()=>r(S),children:"Clear"})]})]})]})}export{Ss as ProjectsThreadAside};
@@ -1 +0,0 @@
1
- import{r as o,j as a,J as Oe,b as st,K as it,L as at,q as ct}from"./index-NRbRrZw-.js";import{a as Ue}from"./provider-Bq0ScH3v.js";import{d as lt,as as ut}from"./router-Bx1tiwVe.js";import{a as V}from"./api-DEHEgJ9m.js";import{u as dt}from"./sse-QSbhyq9A.js";import{o as ft,i as Le}from"./surface-activity-B1rgWB1i.js";import{i as pt}from"./colors-BtO5_zlx.js";import{e as qe,s as ht,i as _e,r as mt,a as vt,f as gt}from"./scoutbot-D4vuKzOL.js";import{F as wt,a as bt,D as yt}from"./DocumentFocusViewer-CetjnYut.js";import{c as He,T as Ve}from"./TextDocumentSurface-B29xZNlI.js";import{C as St}from"./chevron-right-CV7sEVBS.js";import{F as Ct}from"./file-text-BGVkHS4_.js";import{c as kt}from"./createLucideIcon-Da0lq809.js";import{C as Et}from"./code-xml-CPzpZkhu.js";import{A as xt}from"./arrow-left-B0CdJdAC.js";import{A as At}from"./arrow-right-YRBoTTyf.js";import{d as Tt}from"./scout-voice-BT3gYDhU.js";import{i as Rt}from"./keyboard-nav-feLCB3Zm.js";import{J as It,N as Nt,E as pe,K as je,C as De}from"./NewChatComposer-BPsg8shF.js";import{u as Ot}from"./chunk-HRAB3GC3-BYQZ1LOn.js";const $e={current:null,setMenu:null};function yr(){return o.useCallback((e,t)=>{e.preventDefault(),e.stopPropagation(),$e.setMenu?.({position:{x:e.clientX,y:e.clientY},items:t})},[])}function Lt({children:e}){const[t,n]=o.useState(null),r=o.useRef(null);$e.setMenu=n;const s=o.useCallback(()=>{n(null)},[]);return o.useEffect(()=>{if(!t)return;const i=h=>{h.target instanceof Node&&r.current?.contains(h.target)||s()},c=h=>{h.key==="Escape"&&s()},f=()=>s(),d=h=>{h.defaultPrevented||s()};return window.addEventListener("mousedown",i,!0),window.addEventListener("keydown",c),window.addEventListener("wheel",f,!0),window.addEventListener("contextmenu",d),()=>{window.removeEventListener("mousedown",i,!0),window.removeEventListener("keydown",c),window.removeEventListener("wheel",f,!0),window.removeEventListener("contextmenu",d)}},[t,s]),o.useLayoutEffect(()=>{if(!t||!r.current)return;const i=r.current,c=i.getBoundingClientRect(),f=window.innerWidth,d=window.innerHeight;let h=t.position.x,m=t.position.y;h+c.width>f-8&&(h=f-c.width-8),m+c.height>d-8&&(m=d-c.height-8),h<8&&(h=8),m<8&&(m=8),i.style.left=`${h}px`,i.style.top=`${m}px`,i.style.visibility="visible"},[t]),a.jsxs(a.Fragment,{children:[e,t&&a.jsx("div",{ref:r,className:"s-context-menu",style:{left:t.position.x,top:t.position.y,visibility:"hidden"},role:"menu",onMouseDown:i=>i.stopPropagation(),children:t.items.map((i,c)=>i.kind==="separator"?a.jsx("div",{className:"s-context-menu-sep",role:"separator"},c):a.jsxs("button",{type:"button",className:"s-context-menu-item",role:"menuitem",onClick:()=>{i.onSelect(),s()},children:[a.jsx("span",{className:"s-context-menu-label",children:i.label}),i.shortcut&&a.jsx("span",{className:"s-context-menu-shortcut",children:i.shortcut})]},c))})]})}function _t(e){const t=e instanceof Error?e.message:String(e);return Dt(t)?"Scout server is unreachable":t}function jt(e){return e==="Scout server is unreachable"}function Dt(e){return/failed to fetch|fetch failed|networkerror|load failed|couldn'?t connect|could not connect|connection refused|econnrefused|server is unreachable/i.test(e)}const be="openscout.operator.name",Pt=new Set(["operator","you","user","unknown","null","undefined"]);function Je(e){const t=e?.trim();return!t||t.length>64||Pt.has(t.toLowerCase())?null:t}function Mt(){if(typeof window>"u")return null;try{return Je(window.localStorage.getItem(be))}catch{return null}}function Ft(e){if(!(typeof window>"u"))try{const t=Je(e);t?window.localStorage.setItem(be,t):window.localStorage.removeItem(be)}catch{}}const Bt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ut=kt("chevron-up",Bt),qt={id:"audio",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("audio/"),render:({resource:e})=>{const t=e;return a.jsx("div",{className:"s-file-preview-media-wrap",children:a.jsx("div",{className:"s-file-preview-audio-stage",children:a.jsx("audio",{className:"s-file-preview-audio",src:t.rawUrl,controls:!0})})})}},Ht={id:"binary",canHandle:()=>!0,render:({resource:e})=>{const t=e;return a.jsxs("div",{className:"s-file-preview-callout",children:[a.jsxs("div",{className:"s-file-preview-callout-title",children:[t.previewReason," — open in OS"]}),a.jsxs("div",{className:"s-file-preview-callout-copy",children:["Scout can resolve this file, but it does not have an inline preview for ",t.mediaType," yet."]})]})}},Vt=new Set(["text/typescript","text/javascript","text/css","text/html","application/json","text/yaml","text/toml","text/x-shellscript","text/plain"]),$t={id:"code",canHandle:e=>e.kind==="file"&&e.previewable&&Vt.has(e.mediaType),render:({resource:e})=>{const t=e,n=He({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"code",readOnly:!0});return a.jsx(Ve,{document:n,mode:"read",className:"s-doc-focus-document"})}},Jt={id:"directory",canHandle:e=>e.kind==="directory",render:({resource:e,openFilePreview:t})=>{const n=e,r=Kt(n.realPath,n.rootPath);return a.jsxs("div",{className:"s-file-preview-directory",children:[a.jsx("div",{className:"s-file-preview-breadcrumb","aria-label":"Directory breadcrumb",children:r.map((s,i)=>{const c=i===r.length-1;return a.jsxs("div",{className:"s-file-preview-breadcrumb-item",children:[i>0&&a.jsx(St,{size:12,"aria-hidden":"true"}),c?a.jsx("span",{className:"s-file-preview-breadcrumb-current",children:s.label}):a.jsx("button",{type:"button",className:"s-file-preview-breadcrumb-link",onClick:()=>t(s.path),children:s.label})]},s.path)})}),a.jsxs("div",{className:"s-file-preview-directory-list",role:"list",children:[n.entries.map(s=>a.jsxs("button",{type:"button",className:"s-file-preview-entry",onClick:()=>t(s.path),children:[a.jsx("span",{className:"s-file-preview-entry-icon","aria-hidden":"true",children:s.kind==="directory"?a.jsx(wt,{size:14}):a.jsx(Ct,{size:14})}),a.jsx("span",{className:"s-file-preview-entry-name",children:s.name}),a.jsx("span",{className:"s-file-preview-entry-kind",children:s.kind==="directory"?"dir":"file"})]},s.realPath)),n.entries.length===0&&a.jsx("div",{className:"s-file-preview-directory-empty",children:"This directory is empty."})]})]})}};function Kt(e,t){const n=t==="/"?"/":t.replace(/\/+$/u,""),r=e==="/"?"/":e.replace(/\/+$/u,""),s=n.split("/").filter(Boolean),i=r.split("/").filter(Boolean),c=[{label:s[s.length-1]??"/",path:n||"/"}];let f=n||"/";for(let d=s.length;d<i.length;d+=1){const h=i[d];h&&(f=f==="/"?`/${h}`:`${f}/${h}`,c.push({label:h,path:f}))}return c}const zt={id:"html",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/html",render:({resource:e})=>a.jsx("div",{className:"s-file-preview-html-wrap",children:a.jsx("iframe",{className:"s-file-preview-html-frame",src:e.kind==="file"?e.rawUrl:"",title:e.title,sandbox:"allow-forms allow-popups allow-popups-to-escape-sandbox allow-scripts",referrerPolicy:"no-referrer"})})},Wt={id:"image",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("image/"),render:({resource:e})=>a.jsx("div",{className:"s-file-preview-image-wrap",children:a.jsx("div",{className:"s-file-preview-image-stage",children:a.jsx("img",{className:"s-file-preview-image",src:e.kind==="file"?e.rawUrl:"",alt:e.title})})})},Gt={id:"markdown",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/markdown",render:({resource:e})=>{const t=e,n=He({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"markdown",readOnly:!0});return a.jsx(Ve,{document:n,mode:"preview",className:"s-doc-focus-document"})}},Qt={id:"video",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("video/"),render:({resource:e})=>{const t=e;return a.jsx("div",{className:"s-file-preview-media-wrap",children:a.jsx("div",{className:"s-file-preview-media-stage",children:a.jsx("video",{className:"s-file-preview-video",src:t.rawUrl,controls:!0})})})}},Yt=[Jt,Gt,zt,$t,Wt,Qt,qt,Ht];function Xt({path:e,onOpenPath:t,onOpenInCode:n,onClose:r}){const[s,i]=o.useState(null),[c,f]=o.useState(null),[d,h]=o.useState(!1),[m,R]=o.useState(null),j=o.useRef(null);o.useEffect(()=>{j.current=m},[m]),o.useEffect(()=>{if(!e){i(null),f(null),h(!1);return}let p=!1;return h(!0),f(null),i(null),V(`/api/file/preview?path=${encodeURIComponent(e)}`).then(v=>{p||(i(v),Zt(v,j.current,R))}).catch(v=>{p||f(v instanceof Error?v.message:"could not load file")}).finally(()=>{p||h(!1)}),()=>{p=!0}},[e]);const{currentIndex:L,prevPath:u,nextPath:w}=o.useMemo(()=>{if(!s||s.kind!=="file"||!m)return{currentIndex:-1,prevPath:null,nextPath:null};const p=m.files.findIndex(v=>v.realPath===s.realPath);return p<0?{currentIndex:-1,prevPath:null,nextPath:null}:{currentIndex:p,prevPath:p>0?m.files[p-1].path:null,nextPath:p<m.files.length-1?m.files[p+1].path:null}},[s,m]);if(o.useEffect(()=>{if(!e)return;const p=v=>{if(v.key==="Escape"){r();return}if(v.target instanceof HTMLElement){const S=v.target.tagName;if(S==="INPUT"||S==="TEXTAREA"||v.target.isContentEditable)return}v.metaKey||v.ctrlKey||v.altKey||(v.key==="ArrowLeft"&&u?(v.preventDefault(),t(u)):v.key==="ArrowRight"&&w?(v.preventDefault(),t(w)):v.key==="Backspace"&&m&&s?.kind==="file"&&(v.preventDefault(),t(m.dirPath)))};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e,r,t,u,w,m,s]),!e)return null;const C=()=>{V("/api/file/reveal",{method:"POST",body:JSON.stringify({path:s?.realPath??e})}).catch(p=>{f(p instanceof Error?p.message:"reveal failed")})},N=s?Yt.find(p=>p.canHandle(s))??null:null,k=!!(s&&s.kind==="file"&&m&&L>=0&&m.files.length>1),A=[];k&&m&&A.push({label:`Folder: ${m.dirTitle}`,icon:a.jsx(Ut,{size:12}),onClick:()=>t(m.dirPath),title:`Back to ${m.dirTitle} (Backspace)`}),A.push({label:"Open in Code",icon:a.jsx(Et,{size:12}),onClick:()=>{s?.kind==="file"&&n(s.realPath,s.rootPath)},title:"Continue with this file in Scout’s Code browser",disabled:s?.kind!=="file"}),A.push({label:"Show in folder",icon:a.jsx(bt,{size:12}),onClick:C,title:"Show this file in its operating system folder",hideLabel:!0});const D=s?tn(s):[];k&&D.unshift(`${L+1} / ${m.files.length}`);const I=s&&N?N.render({resource:s,openFilePreview:t}):null;return a.jsx(yt,{open:!0,kind:en(s),document:null,title:s?.title??e.split("/").pop()??"File",eyebrow:"File preview",subtitle:s?.realPath??e,meta:D,state:d?"Loading…":null,error:c,body:I?a.jsxs("div",{className:`s-file-preview-shell${k?" s-file-preview-shell-nav":""}`,children:[k&&a.jsx("button",{type:"button",className:"s-file-preview-side-nav s-file-preview-side-nav-left",onClick:()=>u&&t(u),disabled:!u,"aria-label":"Previous file",title:"Previous file (←)",children:a.jsx(xt,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}),a.jsx("div",{className:"s-file-preview-shell-body",children:I}),k&&a.jsx("button",{type:"button",className:"s-file-preview-side-nav s-file-preview-side-nav-right",onClick:()=>w&&t(w),disabled:!w,"aria-label":"Next file",title:"Next file (→)",children:a.jsx(At,{size:18,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,actions:A,onClose:r})}function Zt(e,t,n){if(e.kind==="directory"){const s=e.entries.filter(i=>i.kind==="file");n({dirPath:e.path,dirTitle:e.title,files:s});return}if(!t){n(null);return}t.files.some(s=>s.realPath===e.realPath)||n(null)}function en(e){return!e||e.kind==="directory"||e.mediaType==="text/markdown"||e.mediaType==="text/plain"?"doc":"code"}function tn(e){return e.kind==="directory"?[`${e.entries.length} ${e.entries.length===1?"entry":"entries"}`]:[...e.previewable&&e.truncated?["truncated"]:[],nn(e.sizeBytes),e.mediaType]}function nn(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const Ke={activity:"idle",brief:{lastDeliveredAt:null},reminders:{dueCount:0,upcomingCount:0,due:[],next:null},voice:{available:null,setupBlocked:!1,replies:!1},error:null,session:{title:null,lastActivityAt:null},conversation:{messageCount:0,loading:!0}},G=()=>{},ze={focusScoutbot:G,triggerBrief:G,triggerAskState:G,toggleVoiceReplies:G,openScoutbotSettings:G,startNewChat:G,dismissReminder:G,askReminderStatus:G},ye=o.createContext(null);function rn({children:e}){const[t,n]=o.useState(Ke),r=o.useRef(ze),s=o.useCallback(d=>{n(h=>on(h,d)?h:d)},[]),i=o.useCallback(d=>{r.current=d},[]),c=o.useMemo(()=>({focusScoutbot:()=>r.current.focusScoutbot(),triggerBrief:()=>r.current.triggerBrief(),triggerAskState:()=>r.current.triggerAskState(),toggleVoiceReplies:()=>r.current.toggleVoiceReplies(),openScoutbotSettings:()=>r.current.openScoutbotSettings(),startNewChat:()=>r.current.startNewChat(),dismissReminder:d=>r.current.dismissReminder(d),askReminderStatus:d=>r.current.askReminderStatus(d)}),[]),f=o.useMemo(()=>({state:t,actions:c,publishState:s,registerActions:i}),[t,c,s,i]);return a.jsx(ye.Provider,{value:f,children:e})}function Sr(){const e=o.useContext(ye);return e?{state:e.state,actions:e.actions}:{state:Ke,actions:ze}}function Cr(){const e=o.useContext(ye);return e?{publishState:e.publishState,registerActions:e.registerActions}:null}function on(e,t){return e.activity===t.activity&&e.brief.lastDeliveredAt===t.brief.lastDeliveredAt&&e.reminders.dueCount===t.reminders.dueCount&&e.reminders.upcomingCount===t.reminders.upcomingCount&&sn(e.reminders.due,t.reminders.due)&&We(e.reminders.next,t.reminders.next)&&e.voice.available===t.voice.available&&e.voice.setupBlocked===t.voice.setupBlocked&&e.voice.replies===t.voice.replies&&e.error===t.error&&e.session.title===t.session.title&&e.session.lastActivityAt===t.session.lastActivityAt&&e.conversation.messageCount===t.conversation.messageCount&&e.conversation.loading===t.conversation.loading}function sn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!We(e[n],t[n]))return!1;return!0}function We(e,t){return e===t?!0:!e||!t?!1:e.id===t.id&&e.body===t.body&&e.status===t.status&&e.dueAt===t.dueAt}const an="/api/voice/realtime/call",Ge="/api/voice/realtime/lease",cn="x-openscout-realtime-voice-lease",Qe="surface.realtime-voice",kr="scout:realtime-voice-stop",ln={noise_reduction:{type:"far_field"},turn_detection:{type:"server_vad",threshold:.6,prefix_padding_ms:300,silence_duration_ms:500,create_response:!0,interrupt_response:!0}},un={noise_reduction:{type:"near_field"},turn_detection:{type:"server_vad",threshold:.5,prefix_padding_ms:300,silence_duration_ms:500,create_response:!0,interrupt_response:!0}},dn="/api/scoutbot/chat",fn=25e3;async function pn(e={}){if(ie(e.signal),!globalThis.RTCPeerConnection||!navigator.mediaDevices?.getUserMedia)throw new Error("This browser does not support realtime audio calls.");e.onState?.("connecting");const t=new RTCPeerConnection,n=new Audio;n.autoplay=!0;let r=!1,s=null,i=null,c=null,f=0,d=0;const h=(u,w,C="voice")=>{d+=1,e.onTrace?.({id:`voice-${d}`,at:Date.now(),kind:C,label:u,...w?{detail:w}:{}})};let m=null;const R=()=>{if(m)return m;r=!0,e.signal?.removeEventListener("abort",L),c&&clearInterval(c),c=null,s?.getTracks().forEach(w=>w.stop()),n.pause(),n.srcObject=null,t.close();const u=i;return i=null,m=(async()=>{u&&await En(u),e.onState?.("ended")})(),m},j=()=>{R().catch(u=>{e.onError?.(u instanceof Error?u.message:"Could not release the realtime voice lease."),e.onState?.("error")})},L=()=>{j()};e.signal?.addEventListener("abort",L,{once:!0}),t.ontrack=({streams:u})=>{const w=u[0];if(!w||r)return;const[C]=w.getAudioTracks();C&&C.addEventListener("ended",()=>{r||e.onError?.("Realtime voice audio ended unexpectedly.")}),n.srcObject=w,n.play().catch(()=>{e.onError?.("Browser playback was blocked. Interact with the page, then start the call again.")})},t.onconnectionstatechange=()=>{r||(t.connectionState==="connected"?(e.onState?.("live"),h("Realtime channel connected","Scoutbot bridge is ready")):(t.connectionState==="failed"||t.connectionState==="disconnected")&&(e.onError?.("Realtime voice connection ended unexpectedly."),j()))};try{s=await Cn(e.inputDeviceName,e.signal),ie(e.signal);for(const g of s.getTracks())t.addTrack(g,s);const u=t.createDataChannel("oai-events"),w=new Set;let C=Promise.resolve(),N=!1,k=null;const A=[],D=g=>{if(r||u.readyState!=="open")return!1;try{return u.send(JSON.stringify(g)),!0}catch{return e.onError?.("Realtime voice events channel closed unexpectedly."),!1}},I=()=>{if(N||k||A.length===0)return;const g=A.shift();if(g){if(k=g,!D({type:"response.create",response:{instructions:g}})){k=null,A.unshift(g);return}N=!0}},p=g=>{A.push(g),I()};u.addEventListener("open",()=>{if(r)return;const g=Sn(e.inputDeviceName);if(!D({type:"session.update",session:{type:"realtime",audio:{input:g}}})){e.onError?.("Could not configure Scout's realtime microphone processing.");return}h("Scoutbot bridge ready","Live fleet context is available"),p("Open with one brief audible greeting: 'Hi, I’m Scoutbot. I can check the fleet and coordinate through Scout. What would you like to work on?'")}),u.addEventListener("error",()=>{r||e.onError?.("Realtime voice events channel closed unexpectedly.")}),u.addEventListener("message",g=>{const O=mn(g.data);if(O?.type==="error"){if(Ye(O.message)){k&&(A.unshift(k),k=null),N=!0,h("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}e.onError?.(O.message??"OpenAI Realtime reported an error.");return}if(O?.type==="response.created"){N=!0,k=null;return}if(O?.type==="response.done"){N=!1,k=null;for(const _ of vn(O))_.name!=="ask_scoutbot"||w.has(_.callId)||(w.add(_.callId),C=C.then(()=>hn({functionCall:_,route:e.getRoute?.()??e.route,uiContext:e.getUiContext?.(),onReply:e.onScoutbotReply,onTrace:h,send:D,requestResponse:p})).catch($=>{e.onError?.($ instanceof Error?$.message:"Scoutbot could not complete the voice request.")}));I()}});const v=await he(t.createOffer(),e.signal);if(await he(t.setLocalDescription(v),e.signal),!v.sdp)throw new Error("Could not create a WebRTC offer.");const S=await fetch(an,{method:"POST",headers:{"content-type":"application/sdp"},body:v.sdp,signal:e.signal});i=S.headers.get(cn)?.trim()||null;const y=await he(S.text(),e.signal);if(!S.ok)throw new Error(bn(y,S.status));if(!i)throw new Error("Scout started the audio connection without a concurrency lease. Please try again.");return c=setInterval(()=>{if(!i||r)return;const g=i;kn(g).then(O=>{if(!(r||g!==i)){if(O){f=0;return}e.onError?.("Realtime voice lost its server lease. Reconnect to continue safely."),j()}}).catch(()=>{f+=1,!(f<2||r)&&(e.onError?.("Realtime voice could not renew its server lease. Check the connection and try again."),j())})},fn),await he(t.setRemoteDescription({type:"answer",sdp:y}),e.signal),ie(e.signal),{leaseId:i,stop:R}}catch(u){throw await R(),u}}async function hn(e){const t=gn(e.functionCall.arguments);if(!t){e.onTrace("Scoutbot request could not be read",void 0,"error"),ge(e,{ok:!1,error:"The voice request did not include a usable Scoutbot prompt."});return}e.onTrace("Scoutbot is checking the control plane",t,"scoutbot");try{const n=await fetch(dn,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({body:t,route:e.route,uiContext:e.uiContext})}),r=await n.text();if(!n.ok)throw new Error(wn(r,n.status));const s=JSON.parse(r),i=typeof s.reply?.body=="string"?s.reply.body.trim():"";if(!i)throw new Error("Scoutbot returned an empty reply.");const c=qe(i).filter(h=>h.type==="ask-agent").length,f=e.onReply?await e.onReply(i):{agentRequests:{requested:c,sent:0,failed:c}},d=ht(i);e.onTrace("Scoutbot reply ready",void 0,"scoutbot"),ge(e,{ok:!0,reply:d,...f.agentRequests.requested>0?{agentRequests:f.agentRequests}:{}})}catch(n){const r=n instanceof Error?n.message:"Scoutbot could not complete the voice request.";e.onTrace("Scoutbot request failed",r,"error"),ge(e,{ok:!1,error:r})}}function ge(e,t){if(!e.send({type:"conversation.item.create",item:{type:"function_call_output",call_id:e.functionCall.callId,output:JSON.stringify(t)}}))return;const r=t.agentRequests;e.requestResponse(t.ok?r&&r.requested>0?r.failed>0?"Answer using the Scoutbot result. Say clearly that Scoutbot tried to send the agent request automatically but delivery failed, and tell the operator to check the activity log. Be concise and do not mention tools, JSON, fences, or implementation details.":"Answer using the Scoutbot result. Say clearly that the agent request was sent automatically. Do not claim the requested work is complete. Be concise and do not mention tools, JSON, fences, or implementation details.":"Answer using the Scoutbot result. Speak the useful answer naturally and concisely. Do not mention tools, JSON, fences, or implementation details.":"Briefly tell the operator that Scoutbot could not complete the live lookup and state the returned error plainly.")}function Ye(e){const t=e?.toLowerCase()??"";return t.includes("active response in progress")||t.includes("conversation already has an active response")||t.includes("response is already in progress")}function mn(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return{...typeof t.type=="string"?{type:t.type}:{},...typeof t.error?.message=="string"?{message:t.error.message}:{},...t.response&&typeof t.response=="object"?{response:t.response}:{}}}catch{return null}}function vn(e){return Array.isArray(e.response?.output)?e.response.output.flatMap(t=>{if(!t||typeof t!="object")return[];const n=t;return n.type!=="function_call"||typeof n.call_id!="string"||typeof n.name!="string"||typeof n.arguments!="string"?[]:[{callId:n.call_id,name:n.name,arguments:n.arguments}]}):[]}function gn(e){try{const t=JSON.parse(e);if(typeof t.request!="string")return null;const n=t.request.trim();return n?n.slice(0,8e3):null}catch{return null}}function wn(e,t){try{const n=JSON.parse(e);if(typeof n.error=="string"&&n.error.trim())return n.error}catch{}return`Scoutbot could not complete the live lookup (HTTP ${t}).`}function bn(e,t){try{const n=JSON.parse(e);if(typeof n.error=="string"&&n.error.trim())return n.error}catch{}return`Could not start realtime voice (HTTP ${t}).`}async function he(e,t){return t?(ie(t),new Promise((n,r)=>{const s=()=>r(Se(t));t.addEventListener("abort",s,{once:!0}),e.then(i=>{t.removeEventListener("abort",s),n(i)},i=>{t.removeEventListener("abort",s),r(i)})})):e}async function Pe(e,t){return t?(ie(t),new Promise((n,r)=>{let s=!1;const i=()=>{s=!0,r(Se(t))};t.addEventListener("abort",i,{once:!0}),e.then(c=>{if(t.removeEventListener("abort",i),s||t.aborted){c.getTracks().forEach(f=>f.stop());return}n(c)},c=>{t.removeEventListener("abort",i),s||r(c)})})):e}const Me={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1},yn=/\b(?:airpods?|earbuds?|earphones?|headsets?|headphones?|buds?|hands[- ]?free)\b/iu;function Sn(e){return yn.test(e?.trim()??"")?un:ln}async function Cn(e,t){const n=await Fe(e);let r=await Pe(navigator.mediaDevices.getUserMedia({audio:{...Me,...n?{deviceId:{exact:n.deviceId}}:{}}}),t);if(!n&&e?.trim()){const s=await Fe(e),i=r.getAudioTracks?.()[0]?.label?.trim().toLocaleLowerCase()??"";if(s&&s.label.trim().toLocaleLowerCase()!==i)try{const c=await Pe(navigator.mediaDevices.getUserMedia({audio:{...Me,deviceId:{exact:s.deviceId}}}),t);r.getTracks().forEach(f=>f.stop()),r=c}catch(c){if(t?.aborted)throw r.getTracks().forEach(f=>f.stop()),c}}for(const s of r.getAudioTracks?.()??[])s.contentHint="speech";return r}async function Fe(e){const t=e?.trim().toLocaleLowerCase();if(!t||typeof navigator.mediaDevices.enumerateDevices!="function")return null;try{const n=(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="audioinput"&&r.deviceId&&r.label.trim());return n.find(r=>r.label.trim().toLocaleLowerCase()===t)??n.find(r=>{const s=r.label.trim().toLocaleLowerCase();return s.includes(t)||t.includes(s)})??null}catch{return null}}function ie(e){if(e?.aborted)throw Se(e)}function Se(e){return e.reason instanceof Error?e.reason:new DOMException("Realtime voice connection was cancelled.","AbortError")}async function kn(e){return(await fetch(`${Ge}/${encodeURIComponent(e)}`,{method:"PUT"})).ok}async function En(e){const t=await fetch(`${Ge}/${encodeURIComponent(e)}`,{method:"DELETE",keepalive:!0});if(!t.ok&&t.status!==404)throw new Error(`Could not release realtime voice lease (HTTP ${t.status}).`)}const xn=[{id:"home",label:"Home",description:"Fleet overview, briefings, and recent activity.",route:{view:"inbox"}},{id:"projects",label:"Projects",description:"Projects, agents, and project-scoped work.",route:{view:"agents-v2"},deepActions:["Open a project by projectSlug.","Open an agent by agentId."]},{id:"sessions",label:"Sessions",description:"Active and recent harness sessions.",route:{view:"sessions"},deepActions:["Open a session by sessionId."]},{id:"messages",label:"Messages",description:"Direct conversations and channels.",route:{view:"messages"},deepActions:["Open a conversation by conversationId.","Filter by all, direct messages, or channels."]},{id:"dispatch",label:"Dispatch",description:"Requests, flights, work, and delivery state.",route:{view:"broker"}},{id:"search",label:"Search",description:"Knowledge and indexed workspace search.",route:{view:"search"}},{id:"operations",label:"Operations",description:"Mission Control, live activity, agent lanes, runtime, and mesh health.",route:{view:"ops",mode:"mission"}},{id:"repositories",label:"Repositories",description:"Repository and worktree status, including diffs.",route:{view:"repos"},deepActions:["Open a repository by absolute root."]},{id:"code-browser",label:"Code Browser",description:"Read files in a project or worktree.",route:{view:"code"},deepActions:["Select a project with the project field; it accepts the displayed project name or slug.","Open a file inside it with path and optional wt.","Alternatively use absolute root and file fields.","Focus a line with line and optional endLine.","Deep links: scout://{project}/{path}, scout:///{absolute/path}, or legacy scout://code/{project}/{path}."]},{id:"terminals",label:"Terminals",description:"Observe or take over terminal sessions.",route:{view:"terminal"}},{id:"settings",label:"Settings",description:"Connections, agents, communications, credentials, voice, and devices.",route:{view:"settings"}}],An=[{id:"comms",label:"Comms",description:"Native conversations and channels.",route:{view:"messages"},deepActions:["Open a conversation by conversationId.","Open a channel by channelId."]},{id:"projects",label:"Projects",description:"Native project and agent browser.",route:{view:"agents-v2"},deepActions:["Filter to a project by projectSlug.","Select an agent by agentId."]},{id:"terminals",label:"Terminals",description:"Native terminal workspace.",route:{view:"terminal"},deepActions:["Select an agent terminal by agentId."]},{id:"tail",label:"Tail",description:"Live agent and harness activity.",route:{view:"ops",mode:"tail"}},{id:"dispatch",label:"Dispatch",description:"Dispatch and coordination overview.",route:{view:"broker"}},{id:"agent-lanes",label:"Agent Lanes",description:"Native lane overview for active agents.",route:{view:"ops",mode:"lanes"}},{id:"repositories",label:"Repositories",description:"Native repository and worktree status.",route:{view:"repos"}},{id:"code-browser",label:"Code Browser",description:"Embedded read-only project browser.",route:{view:"code"},deepActions:["Select a project with the project field; it accepts the displayed project name or slug.","Open a file inside it with path and optional wt.","Alternatively use absolute root and file fields.","Focus a line with line and optional endLine.","Deep links: scout://{project}/{path}, scout:///{absolute/path}, or legacy scout://code/{project}/{path}."]},{id:"settings",label:"Settings",description:"Native app settings; Voice is directly addressable.",route:{view:"settings"},deepActions:["Open Voice settings with section=voice."]}];function Tn(e){const t=e==="macos";return{host:e,shellLabel:t?"Scout for macOS":"OpenScout web",destinations:t?An:xn,rules:["When asked what navigation is available, list only these human labels and short descriptions.","Never expose internal Route.view names, aliases, URL fragments, or implementation vocabulary in the human reply.","Emit only a destination route or deep action explicitly described by this host context.","If the requested destination or deep action is absent, say it is not available in this app instead of approximating it with another page."]}}const Rn="scout:scoutbot-realtime-reply",me="scout:scoutbot-session-changed",In={enabled:!1,open:!1,state:"idle",leaseId:null,error:null,trace:[],chatState:null,sessionAction:null,setOpen:()=>{},startCall:async()=>{},endCall:async()=>!0,startNewChat:async()=>{},switchChat:async()=>{},updatePreferredModel:async e=>e,clearTrace:()=>{},openVoiceSettings:()=>{}},Xe=o.createContext(In);function Nn({children:e}){const{route:t,applyScoutbotUiAction:n}=et(),r=Ue(Qe,!1),[s,i]=o.useState(!1),[c,f]=o.useState("idle"),[d,h]=o.useState(null),[m,R]=o.useState(null),[j,L]=o.useState([]),[u,w]=o.useState(null),[C,N]=o.useState(null),k=o.useRef(null),A=o.useRef(null),D=o.useRef(null),I=o.useRef(0),p=o.useRef(!1),v=o.useRef(!1),S=o.useRef({route:t,applyScoutbotUiAction:n});S.current={route:t,applyScoutbotUiAction:n};const y=o.useCallback((b,E,T="voice")=>{L(P=>[...P,{id:`voice-ui-${Date.now()}-${P.length}`,at:Date.now(),kind:T,label:b,...E?{detail:E}:{}}].slice(-100))},[]),g=o.useCallback(()=>L([]),[]),O=o.useCallback(async()=>{const b=await V("/api/scoutbot/session");return p.current||w(b),b},[]);o.useEffect(()=>{if(!r)return;const b=()=>{O().catch(E=>{p.current||R(E instanceof Error?E.message:"Could not load Scoutbot chats.")})};return b(),window.addEventListener(me,b),()=>window.removeEventListener(me,b)},[r,O]);const _=o.useCallback(async()=>{I.current+=1;const b=D.current;A.current?.abort(),A.current=null;const E=k.current;k.current=null;try{await E?.stop(),await b}catch(T){return p.current||(f("error"),R(T instanceof Error?T.message:"Could not end realtime voice cleanly.")),!1}return p.current||(h(null),f("ended"),y("Live voice ended","Microphone and host lease released","voice")),!0},[y]);o.useEffect(()=>{r||(i(!1),(k.current||c==="connecting"||c==="live")&&_())},[r,_,c]),o.useEffect(()=>(p.current=!1,()=>{p.current=!0,I.current+=1,A.current?.abort(),A.current=null,k.current?.stop().catch(()=>{}),k.current=null}),[]);const $=o.useCallback(async b=>{window.dispatchEvent(new CustomEvent(Rn,{detail:{body:b}}));const E=b.replace(/```[\s\S]*?```/gu,"").trim();E&&y("Scoutbot replied",E.slice(0,2e3),"scoutbot");let T=0,P=0,z=0;for(const B of qe(b))if(B.type==="ask-agent")T+=1,await jn(B,y,R)?P+=1:z+=1;else if(B.type!=="reminder"){const M=_n(B),q=B.type==="navigate"||B.type==="view-file"?"navigation":"scoutbot";y(Ln(B),M,q),S.current.applyScoutbotUiAction(B),y(_e()?"Action sent to Scout for macOS":"Action applied in OpenScout",M,q)}return await O().catch(()=>null),{agentRequests:{requested:T,sent:P,failed:z}}},[y,O]),Z=o.useCallback(()=>{const b={type:"navigate",route:{view:"settings",section:"voice"}};y("Voice settings requested",void 0,"navigation"),S.current.applyScoutbotUiAction(b)},[y]),ee=o.useCallback(async()=>{if(!r){R("Turn on live voice in Settings → Voice before starting a call."),i(!1);return}if(v.current||c==="connecting"||c==="live")return;v.current=!0,A.current?.abort();const b=k.current;k.current=null;try{await b?.stop(),h(null)}catch(M){f("error"),R(M instanceof Error?M.message:"Could not end the previous realtime voice call."),v.current=!1;return}const E=new AbortController;A.current=E;const T=I.current+1;I.current=T;let P=()=>{};const z=new Promise(M=>{P=M});D.current=z;let B=!1;R(null),L([{id:"connecting",at:Date.now(),label:"Connecting secure audio"}]),f("connecting");try{const M=await Tt().then(({settings:U})=>U.inputDeviceName).catch(()=>null),q=await pn({signal:E.signal,inputDeviceName:M,getRoute:()=>S.current.route,getUiContext:()=>Tn(_e()?"macos":"web"),onState:U=>{!p.current&&I.current===T&&f(U)},onError:U=>{if(!(p.current||I.current!==T)){if(Ye(U)){y("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}R(U),y("Voice issue",U,"error")}},onTrace:U=>{!p.current&&I.current===T&&L(J=>[...J,U].slice(-100))},onScoutbotReply:U=>!p.current&&I.current===T?$(U):{agentRequests:{requested:0,sent:0,failed:0}}});if(p.current||E.signal.aborted||I.current!==T){await q.stop();return}k.current=q,h(q.leaseId),B=!0}catch(M){if(!p.current&&I.current===T&&!On(M)){f("error");const q=M instanceof Error?M.message:"Could not start realtime voice.";R(q),y("Live voice could not start",q,"error")}}finally{!B&&A.current===E&&(A.current=null),P(),D.current===z&&(D.current=null),v.current=!1}},[y,$,r,c]),te=o.useCallback(async()=>{if(!C){N("new"),R(null);try{if((k.current||c==="connecting"||c==="live")&&!await _())return;if(u?.session.messages.length===0){L([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]);return}const b=await V("/api/scoutbot/session/reset",{method:"POST"});w(b),L([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]),window.dispatchEvent(new CustomEvent(me,{detail:{id:b.session.id}}))}catch(b){const E=b instanceof Error?b.message:"Could not start a new Scoutbot chat.";R(E),y("Could not start a new live chat",E,"error")}finally{N(null)}}},[y,u?.session.messages.length,_,C,c]),ne=o.useCallback(async b=>{if(!(!b||C||b===u?.session.id)){N(b),R(null);try{if((k.current||c==="connecting"||c==="live")&&!await _())return;const E=await V("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:b})});w(E),L([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"Live chat restored",detail:E.session.title}]),window.dispatchEvent(new CustomEvent(me,{detail:{id:E.session.id}}))}catch(E){const T=E instanceof Error?E.message:"Could not switch Scoutbot chats.";R(T),y("Could not restore the live chat",T,"error")}finally{N(null)}}},[y,u?.session.id,_,C,c]),re=o.useCallback(async b=>{const E=b.trim();if(!E)throw new Error("Preferred model is required.");const T=await V("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:E})});return w(P=>P&&{...P,config:{...P.config,...T.config}}),y("Scoutbot preferred model updated",T.config.model,"scoutbot"),T.config.model},[y]),ae=o.useMemo(()=>({enabled:r,open:s,state:c,leaseId:d,error:m,trace:j,chatState:u,sessionAction:C,setOpen:i,startCall:ee,endCall:_,startNewChat:te,switchChat:ne,updatePreferredModel:re,clearTrace:g,openVoiceSettings:Z}),[r,s,c,d,m,j,u,C,ee,_,te,ne,re,g,Z]);return a.jsx(Xe.Provider,{value:ae,children:e})}function On(e){return(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError"}function Er(){return o.useContext(Xe)}function Ln(e){return e.type==="navigate"?"Navigation requested":e.type==="open-scoutbot"?"Scoutbot opened its panel":e.type==="refresh"?"Scoutbot refreshed live state":"Scoutbot opened the requested file"}function _n(e){return e.type==="navigate"?JSON.stringify(e.route):e.type==="view-file"?e.path:e.reason?.trim()||e.type}async function jn(e,t,n){t("Scoutbot is coordinating",`Asking ${e.targetLabel}`,"agent");try{const r=await V("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:e.targetLabel,targetAgentId:e.targetAgentId,body:e.body,channel:e.channel})});return t("Scoutbot sent the request",r.flightId?`${r.targetAgentId??r.targetLabel} · run ${r.flightId}`:r.targetAgentId??r.targetLabel,"agent"),!0}catch(r){const s=r instanceof Error?r.message:"Could not send to agent.";return t("Scoutbot could not send the request",s,"error"),n(s),!1}}function we(e,t){const n=t?.trim();n&&e.add(n)}function Dn(e,t){const n=new Set;return we(n,e.authorityNodeId),we(n,e.homeNodeId),n.size===0&&we(n,t),n}function Ze(e,t,n){return t?Dn(e,n).has(t):!0}function Pn(e,t,n){return t?e.filter(r=>Ze(r,t,n)):e}function xr(e,t,n){return t?new Set(e.filter(r=>Ze(r,t,n)).map(r=>r.id)):null}function Q(e,t,n){return!t&&!n||n&&e.authorityNodeId===n?!0:t?e.agentId&&t.has(e.agentId)||e.actorId&&t.has(e.actorId)||e.ownerId&&t.has(e.ownerId)||e.nextMoveOwnerId&&t.has(e.nextMoveOwnerId)?!0:!!e.participantIds?.some(r=>t.has(r)):!1}function Mn(e,t,n){return Q(e,t,n)}function Ar(e,t,n){return!t&&!n?e:e.filter(r=>Mn(r,t,n))}function Fn(e,t){return Q(e,t)}function Bn(e,t){return t?e.filter(n=>Fn(n,t)):e}function Be(e,t){return Q(e,t)}function Tr(e,t){if(!e||!t)return e;const n=e.activeAsks.filter(c=>Q(c,t)),r=e.recentCompleted.filter(c=>Q(c,t)),s=e.needsAttention.filter(c=>Q(c,t)),i=Bn(e.activity,t);return{...e,totals:{active:n.length,recentCompleted:r.length,needsAttention:s.length,activity:i.length},activeAsks:n,recentCompleted:r,needsAttention:s,activity:i}}function Rr(e,t){if(!t)return e;const n=e.activeFlights.filter(i=>Q(i,t)),r=e.childWork.filter(i=>Be(i,t));return Be(e,t)||n.length>0||r.length>0?{...e,activeFlights:n,childWork:r}:null}function Un(e){return!!(e&&(e.message.trim().length>0||e.files.length>0||e.forwardContext))}function qn(e){return[e.name,e.type,e.size,e.lastModified].join(":")}function Hn(e,t){const n=new Set;return[...e,...t].filter(r=>{const s=qn(r);return n.has(s)?!1:(n.add(s),!0)})}function Vn(e,t){const n=t.intent??e?.intent??"new-task",r=n==="route-capture",s=n==="forward-message";return{intent:n,...r&&(t.agentId??e?.agentId)?{agentId:t.agentId??e?.agentId}:{},...r&&(t.conversationId??e?.conversationId)?{conversationId:t.conversationId??e?.conversationId}:{},message:t.message??e?.message??"",files:Hn(e?.files??[],t.files??[]),attachmentFeedback:t.attachmentFeedback??e?.attachmentFeedback??null,mode:r?t.preferExistingChat===void 0?e?.mode??"new-session":t.preferExistingChat?"existing-chat":"new-session":"new-session",projectPath:t.projectPath??e?.projectPath??"",projectQuery:e?.projectQuery??"",...s&&(t.forwardContext??e?.forwardContext)?{forwardContext:t.forwardContext??e?.forwardContext}:{},forwardContextMode:s?t.forwardContextMode??e?.forwardContextMode??"selected-message":"selected-message"}}function $n({request:e,onClose:t,onOpenCapture:n}){const{agents:r,route:s,navigate:i}=et(),c=lt(s),f=Pn(r,c),d=It(s,f),[h,m]=o.useState(0),[R,j]=o.useState(null),[L,u]=o.useState(null),w=o.useRef(0),C=e?Vn(L,e):null,N=o.useCallback((A,D)=>{if(A.length===0)return;const I=!!(d.agentId||d.conversationId);n({intent:I?"route-capture":"new-task",files:A,attachmentFeedback:D,agentId:d.agentId??void 0,conversationId:d.conversationId??void 0,preferExistingChat:d.canUseExistingChat})},[n,d]);o.useEffect(()=>{if(!R)return;const A=window.setTimeout(()=>j(null),5e3);return()=>window.clearTimeout(A)},[R]),o.useEffect(()=>{const A=S=>{pe(S.dataTransfer)&&(S.preventDefault(),w.current+=1,m(w.current))},D=S=>{pe(S.dataTransfer)&&(S.preventDefault(),S.dataTransfer&&(S.dataTransfer.dropEffect="copy"))},I=()=>{w.current!==0&&(w.current=Math.max(0,w.current-1),m(w.current))},p=S=>{if(!pe(S.dataTransfer))return;S.preventDefault();const y=je(S.dataTransfer),g=y.filter(De),O=y.length-g.length;if(w.current=0,m(0),g.length===0){j(y.length===0?"Scout could not read that file. Try the attachment picker instead.":"That file type is not supported. Drop markdown, code, an image, or a video clip.");return}const _=g.length===1?`Dropped ${g[0]?.name||"1 attachment"}.`:`Dropped ${g.length} attachments.`,$=O>0?`${_} Skipped ${O} unsupported ${O===1?"file":"files"}.`:_;j(null),N(g,$)},v=S=>{if(Rt(S.target)||!pe(S.clipboardData))return;S.preventDefault();const y=je(S.clipboardData),g=y.filter(De);if(g.length===0){j(y.length===0?"Scout could not read that pasted file. Try the attachment picker instead.":"That pasted file type is not supported. Paste an image or video, or attach markdown or code.");return}N(g,g.length===1?`Pasted ${g[0]?.name||"1 attachment"}.`:`Pasted ${g.length} attachments.`)};return window.addEventListener("dragenter",A),window.addEventListener("dragover",D),window.addEventListener("dragleave",I),window.addEventListener("drop",p),window.addEventListener("paste",v),()=>{window.removeEventListener("dragenter",A),window.removeEventListener("dragover",D),window.removeEventListener("dragleave",I),window.removeEventListener("drop",p),window.removeEventListener("paste",v)}},[N]);const k=h>0&&!e;return a.jsxs(a.Fragment,{children:[k?a.jsx("div",{className:"s-capture-drop",role:"presentation",children:a.jsxs("div",{className:"s-capture-drop-card",children:[a.jsx("div",{className:"s-capture-drop-title",children:"Route capture"}),a.jsx("div",{className:"s-capture-drop-copy",children:"Drop markdown, code, an image, or a video clip to send it to the right agent or chat."})]})}):null,R?a.jsx("div",{className:"s-capture-feedback",role:"alert",children:R}):null,e?a.jsx(Nt,{agents:f,route:s,navigate:i,onClose:t,initialAgentId:C?.agentId,initialConversationId:C?.conversationId,initialMessage:C?.message,initialFiles:C?.files,initialAttachmentFeedback:C?.attachmentFeedback??void 0,initialIntent:C?.intent,initialProjectPath:C?.projectPath,initialProjectQuery:C?.projectQuery,initialForwardContext:C?.forwardContext,initialForwardContextMode:C?.forwardContextMode,defaultMode:C?.mode,draftRestored:Un(L),onDraftChange:u,onDraftConsumed:()=>u(null)}):null]})}const Ce=o.createContext(null),Jn=["hello","node.upserted","actor.registered","agent.registered","agent.endpoint.upserted","invocation.requested","flight.updated","delivery.state.changed","scout.dispatched"],Kn=new Set(Jn),zn=3e4,Wn=250;function Gn(e,t){try{return JSON.stringify(e)===JSON.stringify(t)?e:t}catch{return t}}const Qn={"--hud-bg":"oklch(0.118 0.004 260)","--hud-surface":"oklch(0.205 0.005 260)","--hud-ink":"oklch(0.975 0.006 260)","--hud-muted":"oklch(0.80 0.008 260)","--hud-dim":"oklch(0.70 0.007 260)","--hud-border":"oklch(0.975 0.006 260 / 0.08)","--hud-accent":"oklch(0.86 0.17 125)","--hud-accent-soft":"oklch(0.86 0.17 125 / 0.08)","--hud-shadow-soft":"oklch(0.08 0.004 260 / 0.42)","--hud-chrome-border":"oklch(0.975 0.006 260 / 0.04)","--hud-shadow-panel":"0 12px 34px oklch(0.08 0.004 260 / 0.45)","--hud-shadow-panel-hover":"0 14px 38px oklch(0.08 0.004 260 / 0.52)","--hud-shadow-bar":"0 -10px 28px oklch(0.08 0.004 260 / 0.38)","--hud-shadow-nav":"0 8px 24px oklch(0.08 0.004 260 / 0.32)","--hud-shadow-minimap":"0 10px 24px oklch(0.08 0.004 260 / 0.38)","--hud-status-ok":"oklch(0.80 0.15 155)","--hud-status-warn":"oklch(0.82 0.15 85)","--hud-status-error":"oklch(0.72 0.18 25)","--background":"0.132 0.004 260","--foreground":"0.965 0.006 260","--card":"0.178 0.005 260","--card-foreground":"0.965 0.006 260","--popover":"0.178 0.005 260","--popover-foreground":"0.965 0.006 260","--muted-foreground":"0.72 0.008 260","--scrim":"rgba(0, 0, 0, 0.5)","--scrim-soft":"rgba(0, 0, 0, 0.3)","--info":"#62b6ff","--shadow-card":"0 8px 22px rgba(0, 0, 0, 0.22)","--shadow-card-hover":"0 14px 36px rgba(0, 0, 0, 0.30)","--cat-gold":"#d7a978","--cat-purple":"#c58cff","--cat-sky":"#38bdf8","--scout-chrome-ink-strong":"color-mix(in srgb, var(--hud-ink) 94%, transparent)","--scout-chrome-ink":"color-mix(in srgb, var(--hud-ink) 84%, transparent)","--scout-chrome-ink-soft":"color-mix(in srgb, var(--hud-ink) 68%, transparent)","--scout-chrome-ink-faint":"color-mix(in srgb, var(--hud-ink) 64%, transparent)","--scout-chrome-ink-ghost":"color-mix(in srgb, var(--hud-ink) 56%, transparent)","--scout-chrome-hover":"color-mix(in srgb, var(--hud-ink) 5%, transparent)","--scout-chrome-active":"color-mix(in srgb, var(--hud-ink) 9%, transparent)","--scout-chrome-border-soft":"color-mix(in srgb, var(--hud-ink) 8%, transparent)","--scout-chrome-avatar-ink":"#111111","--hud-font-sans":"'Inter', ui-sans-serif, system-ui, sans-serif","--hud-font-mono":"'JetBrains Mono', ui-monospace, Menlo, monospace","--hud-font-serif":"'Spectral', 'Cormorant Garamond', Georgia, serif","--hud-font-accent-title":"'Inter Tight', var(--hud-font-sans)"},Yn={"--hud-bg":"oklch(0.982 0.008 78)","--hud-surface":"oklch(0.994 0.006 78)","--hud-ink":"oklch(0.26 0.018 72)","--hud-muted":"oklch(0.50 0.028 70)","--hud-dim":"oklch(0.64 0.022 72)","--hud-border":"oklch(0.86 0.016 75 / 0.92)","--hud-accent":"oklch(0.72 0.16 125)","--hud-accent-soft":"oklch(0.72 0.16 125 / 0.11)","--hud-shadow-soft":"oklch(0.42 0.02 70 / 0.11)","--hud-status-ok":"oklch(0.64 0.16 155)","--hud-status-warn":"oklch(0.72 0.15 85)","--hud-status-error":"oklch(0.62 0.19 25)","--background":"0.978 0.004 85","--foreground":"0.24 0.01 80","--card":"0.992 0.003 85","--card-foreground":"0.24 0.01 80","--popover":"0.992 0.003 85","--popover-foreground":"0.24 0.01 80","--muted-foreground":"0.56 0.014 80","--scrim":"rgba(28, 24, 20, 0.30)","--scrim-soft":"rgba(28, 24, 20, 0.16)","--info":"#2f7fd6","--shadow-card":"0 8px 22px oklch(0.42 0.02 70 / 0.09)","--shadow-card-hover":"0 14px 36px oklch(0.42 0.02 70 / 0.13)","--cat-gold":"#a9824f","--cat-purple":"#8b5cf6","--cat-sky":"#0ea5e9","--scout-chrome-ink-strong":"color-mix(in srgb, var(--hud-ink) 94%, transparent)","--scout-chrome-ink":"color-mix(in srgb, var(--hud-ink) 78%, transparent)","--scout-chrome-ink-soft":"color-mix(in srgb, var(--hud-ink) 60%, transparent)","--scout-chrome-ink-faint":"color-mix(in srgb, var(--hud-ink) 56%, transparent)","--scout-chrome-ink-ghost":"color-mix(in srgb, var(--hud-ink) 50%, transparent)","--scout-chrome-hover":"color-mix(in srgb, var(--hud-ink) 4%, transparent)","--scout-chrome-active":"color-mix(in srgb, var(--hud-ink) 8%, transparent)","--scout-chrome-border-soft":"color-mix(in srgb, var(--hud-border) 80%, transparent)","--scout-chrome-avatar-ink":"#ffffff","--hud-font-sans":"'Inter', ui-sans-serif, system-ui, sans-serif","--hud-font-mono":"'JetBrains Mono', ui-monospace, Menlo, monospace","--hud-font-serif":"'Spectral', 'Cormorant Garamond', Georgia, serif","--hud-font-accent-title":"'Inter Tight', var(--hud-font-sans)"},Xn=new Set(["--hud-bg","--hud-surface","--hud-ink","--hud-muted","--hud-dim","--hud-border","--hud-accent","--hud-accent-soft","--hud-shadow-soft","--hud-chrome-border","--hud-shadow-panel","--hud-shadow-panel-hover","--hud-shadow-bar","--hud-shadow-nav","--hud-shadow-minimap","--hud-status-ok","--hud-status-warn","--hud-status-error"]);function Zn(e){return Object.fromEntries(Object.entries(e==="light"?Yn:Qn).filter(([n])=>!Xn.has(n)))}function Ir(){return o.useContext(Ce)}function et(){const e=o.useContext(Ce);if(!e)throw new Error("useScout must be used inside ScoutProvider");return e}function Nr({children:e,initialTheme:t="dark"}){const{route:n,navigate:r,navigateBack:s,canNavigateBack:i}=ut(),c=Ot(),f=Ue(Qe,!1),[d,h]=o.useState([]),[m,R]=o.useState(!1),[j,L]=o.useState({status:"checking",message:null,lastCheckedAt:null}),[u,w]=o.useState(Oe),[C,N]=o.useState(null),k=o.useRef(!1),[A,D]=o.useState(Mt),[I,p]=o.useState(!1),[v,S]=o.useState(null),[y,g]=o.useState(null),[O,_]=o.useState(""),[$,Z]=o.useState(null),ee=n.view==="settings",te=o.useMemo(()=>n.view!=="broker"||!n.attemptId?null:v?.id===n.attemptId?v:null,[v,n]),ne=o.useMemo(()=>n.view!=="search"||!n.hitId?null:y?.id===n.hitId?y:null,[y,n]),re=o.useMemo(()=>n.view==="agents-v2"&&n.agentId&&n.sessionId?{agentId:n.agentId,sessionId:n.sessionId}:n.view==="sessions"&&n.sessionId?{agentId:n.agentId??"",sessionId:n.sessionId}:null,[n]),ae=o.useCallback((l,x)=>{if(n.view==="agents-v2"&&n.agentId===l){r({...n,sessionId:x},{replace:!0});return}if(n.view==="sessions"){r({view:"sessions",sessionId:x,agentId:l},{replace:!0});return}r({view:"agents-v2",agentId:l,sessionId:x},{replace:!0})},[r,n]),b=o.useCallback(()=>{r({view:"settings",section:"appearance"})},[r]),E=o.useCallback(()=>{n.view==="settings"&&r({view:"inbox"})},[r,n.view]),T=o.useCallback(l=>{Z(l??{intent:"new-task"})},[]),P=o.useCallback(()=>Z(null),[]),z=o.useCallback(l=>{S(l),!(n.view==="broker"&&n.attemptId===l.id)&&r({view:"broker",attemptId:l.id,...n.view==="broker"&&n.filter?{filter:n.filter}:{}},{replace:n.view==="broker"})},[r,n]),B=o.useCallback(()=>{S(null),n.view==="broker"&&n.attemptId&&r({view:"broker",...n.filter?{filter:n.filter}:{}},{replace:!0})},[r,n]),M=o.useCallback((l,x,F)=>{if(g(l),typeof x=="string"&&_(x.trim()),n.view==="search"&&n.hitId===l.id)return;const H=F??(n.view==="search"?n.filters:void 0);r({view:"search",...n.view==="search"&&n.mode?{mode:n.mode}:{},...H?{filters:H}:{},hitId:l.id},{replace:n.view==="search"})},[r,n]),q=o.useCallback(()=>{g(null),_(""),n.view==="search"&&n.hitId&&r({view:"search",...n.mode?{mode:n.mode}:{},...n.filters?{filters:n.filters}:{}},{replace:!0})},[r,n]),U=o.useMemo(()=>st(),[]),J=c?.resolvedTheme??t,ve=c?.template??"hudson",tt=o.useMemo(()=>({...Zn(J),...U??{}}),[U,J]),ke=o.useCallback(l=>{w(x=>({...x,...l}))},[]);o.useEffect(()=>{it(J,ve,u),at(u)},[ve,u,J]),o.useEffect(()=>{const l=x=>{x.key!==null&&x.key!==ct||w(Oe())};return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[]);const Ee=o.useMemo(()=>mt(d),[d]),xe=Ee?.id??vt(d),Ae=Ee?.conversationId??null,ce=o.useRef(null),Y=o.useRef(null),le=n.view==="ops"?"/api/agents":"/api/agents?detail=summary",ue=o.useCallback(()=>{L({status:"online",message:null,lastCheckedAt:Date.now()})},[]),de=o.useCallback(l=>{const x=_t(l);L({status:jt(x)?"offline":"degraded",message:x,lastCheckedAt:Date.now()})},[]),K=o.useCallback(async()=>{const l=ce.current;if(l&&(await l.promise,l.url===le))return;const x=(async()=>{try{const F=await V(le);h(H=>Gn(H,F)),ue()}catch(F){de(F)}finally{R(!0)}})();ce.current={url:le,promise:x};try{await x}finally{ce.current?.promise===x&&(ce.current=null)}},[le,de,ue]),W=o.useCallback(async()=>{try{const l=await V("/api/onboarding/state");k.current=!1,N(l);const x=l.operatorName?.trim()||l.operatorNameSuggestion?.trim()||null;D(x),Ft(x),ue()}catch(l){de(l),k.current=!0,N({hasLocalConfig:!0,hasProjectConfig:!0,hasOperatorName:!0,localConfigPath:null,projectRoot:null,currentDirectory:null,operatorName:null,operatorNameSuggestion:null,needed:!1})}},[de,ue]),Te=o.useCallback(()=>{p(!0),V("/api/onboarding/skip",{method:"POST",body:"{}"}).then(()=>W()).catch(()=>null)},[W]);o.useEffect(()=>{K(),W()},[K,W]),o.useEffect(()=>{const l=()=>{Le()&&(K(),k.current&&W())},x=window.setInterval(l,zn),F=ft(l);return()=>{window.clearInterval(x),F()}},[K,W]);const Re=o.useMemo(()=>d.filter(l=>pt(l.state)).length,[d]),[nt,Ie]=o.useState(null),oe=o.useCallback(l=>{l?.trim()&&Ie(l.trim())},[]),se=o.useCallback(()=>Ie(null),[]),X=o.useCallback(l=>{if(!gt(l))switch(l.type){case"navigate":r(l.route);break;case"focus-composer":window.dispatchEvent(new CustomEvent("scout:composer-focus"));break;case"open-scoutbot":window.dispatchEvent(new CustomEvent("scout:scoutbot-panel-open",{detail:l}));break;case"refresh":K();break;case"view-file":oe(l.path);break}},[r,oe,K]),rt=o.useCallback((l,x)=>{const F=l.trim(),H=x.trim();if(!F||!H)return;const Ne=n.view==="conversation"||n.view==="messages"?n.conversationId:window.location.pathname==="/embed/thread"&&new URLSearchParams(window.location.search).get("conversationId")?.trim()||void 0;se(),X({type:"navigate",route:{view:"code",root:H,file:F,...Ne?{returnConversationId:Ne}:{}}})},[X,se,n]),fe=o.useRef({applyScoutbotUiAction:X});fe.current={applyScoutbotUiAction:X},dt(l=>{Le()&&Kn.has(l.kind)&&(Y.current!==null&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>{Y.current=null,K()},Wn))}),o.useEffect(()=>()=>{Y.current!==null&&window.clearTimeout(Y.current)},[]),o.useEffect(()=>{const l=x=>{const F=x.detail,H=F&&typeof F=="object"&&"type"in F?F:null;H&&fe.current.applyScoutbotUiAction(H)};return window.addEventListener("scout:scoutbot-ui-action",l),window.scoutScoutbot={applyUiAction:x=>fe.current.applyScoutbotUiAction(x),navigate:x=>fe.current.applyScoutbotUiAction({type:"navigate",route:x})},()=>{window.removeEventListener("scout:scoutbot-ui-action",l),window.scoutScoutbot?.applyUiAction&&delete window.scoutScoutbot}},[]);const ot=o.useMemo(()=>({route:n,navigate:r,navigateBack:s,canNavigateBack:i,agents:d,agentsLoaded:m,onlineCount:Re,apiConnection:j,reload:K,appearanceDetails:u,updateAppearanceDetails:ke,onboarding:C,operatorName:A,refreshOnboarding:W,onboardingSkipped:I,skipOnboarding:Te,settingsOpen:ee,openSettings:b,closeSettings:E,scoutbotAgentId:xe,scoutbotConversationId:Ae,applyScoutbotUiAction:X,selectedBrokerAttempt:te,inspectBrokerAttempt:z,clearBrokerAttempt:B,selectedKnowledgeHit:ne,selectedKnowledgeQuery:O,inspectKnowledgeHit:M,clearKnowledgeHit:q,focusedSession:re,focusSession:ae,openFilePreview:oe,closeFilePreview:se,openContextCapture:T,closeContextCapture:P}),[n,r,s,i,d,m,Re,j,K,u,ke,C,A,W,I,Te,ee,b,E,xe,Ae,X,te,z,B,ne,O,M,q,re,ae,oe,se,T,P]);return a.jsx(Ce.Provider,{value:ot,children:a.jsx("div",{"data-scout-theme-mode":J,"data-scout-palette":u.palette,"data-scout-contrast":u.contrast,"data-scout-accent":u.accent,"data-scout-shell":u.shell,"data-scout-avatar-style":u.avatarStyle,"data-hudson-theme":J,"data-hudson-template":ve,style:{...tt},children:a.jsx("div",{"data-scout-theme":J,style:{display:"contents"},children:a.jsx(Lt,{children:a.jsxs(rn,{children:[f?a.jsx(Nn,{children:e}):e,a.jsx(Xt,{path:nt,onOpenPath:oe,onOpenInCode:rt,onClose:se}),a.jsx($n,{request:$,onClose:P,onOpenCapture:T})]})})})})})}export{Lt as C,Qn as D,Yn as L,Ce as S,yr as a,Bn as b,Pn as c,Ar as d,Tr as e,_t as f,Nr as g,Ir as h,jt as i,Rr as j,Ut as k,Er as l,xr as m,Sr as n,Cr as o,Qe as p,me as q,Rn as r,Tn as s,kr as t,et as u};
@@ -1 +0,0 @@
1
- .rr-row{display:flex;flex-direction:column;border-bottom:1px solid color-mix(in srgb,var(--ink) 5%,transparent)}.rr-row-head{display:flex;align-items:center;gap:var(--space-sm);width:100%;padding:var(--space-xs) var(--space-lg);border:0;background:transparent;text-align:left;cursor:pointer;font-family:inherit;min-width:0;min-height:0;transition:background .12s}.rr-row-head:hover{background:color-mix(in srgb,var(--accent) 5%,transparent)}.rr-row-head:focus-visible{outline:1px solid var(--accent);outline-offset:-1px}.rr-row--child .rr-row-head{padding-left:var(--space-4xl)}.rr-row--active .rr-row-head{background:color-mix(in srgb,var(--accent) 9%,transparent);box-shadow:inset 2px 0 0 0 var(--accent)}.rr-row--selected .rr-row-head{background:color-mix(in srgb,var(--accent) 10%,transparent);box-shadow:inset 2px 0 0 0 var(--accent)}.rr-row--expanded .rr-row-head{background:color-mix(in srgb,var(--accent) 6%,transparent)}.rr-row--motion .rr-row-head{background:linear-gradient(90deg,color-mix(in srgb,var(--green) 7%,transparent),transparent 64%),transparent}.rr-row--active.rr-row--motion .rr-row-head{background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 16%,transparent),transparent 70%),color-mix(in srgb,var(--accent) 9%,transparent)}.rr-row-dot{flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:color-mix(in srgb,var(--dim) 55%,transparent)}.rr-row-dot--unavailable,.rr-row-dot--offline{background:color-mix(in srgb,var(--dim) 45%,transparent)}.rr-row-dot--channel,.rr-row-dot--dm{background:color-mix(in srgb,var(--ink) 28%,transparent)}.rr-row-avatar-wrap{flex:0 0 auto;position:relative;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.rr-row-avatar{width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:var(--text-xs);font-weight:600;color:color-mix(in srgb,var(--bg) 92%,transparent);letter-spacing:0;text-transform:uppercase;-webkit-user-select:none;user-select:none}.rr-row-presence{position:absolute;right:-2px;bottom:-2px;width:7px;height:7px;border-radius:50%;border:1.5px solid var(--surface)}.rr-row-hash{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:5px;background:color-mix(in srgb,var(--ink) 6%,transparent);border:1px solid color-mix(in srgb,var(--border) 40%,transparent);color:color-mix(in srgb,var(--ink) 70%,transparent);font-family:var(--font-mono);font-size:11px;font-weight:700;-webkit-user-select:none;user-select:none;transition:background-color .12s,border-color .12s,color .12s}.rr-row-head:hover .rr-row-hash{background:color-mix(in srgb,var(--ink) 10%,transparent);border-color:color-mix(in srgb,var(--border) 60%,transparent);color:var(--ink)}.rr-row--active .rr-row-hash{background:color-mix(in srgb,var(--accent) 14%,transparent);border-color:color-mix(in srgb,var(--accent) 60%,transparent);color:var(--accent)}.rr-row-icon{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-family:var(--font-mono);font-size:var(--text-md);color:var(--dim)}.rr-row-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}.rr-row-name{font-family:var(--font-mono);font-size:var(--text-sm);font-weight:500;color:color-mix(in srgb,var(--ink) 88%,transparent);letter-spacing:.005em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .12s}.rr-row-head:hover .rr-row-name{color:var(--ink)}.rr-row--active .rr-row-name{font-weight:600;color:var(--ink)}.rr-row--unread .rr-row-name{font-weight:650;color:var(--ink)}.rr-row--unread .rr-row-meta{color:var(--ink);font-weight:600}.rr-row-sub{font-family:var(--font-mono);font-size:var(--text-2xs);color:color-mix(in srgb,var(--ink) 58%,transparent);letter-spacing:var(--tracking-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rr-row--active .rr-row-sub{color:color-mix(in srgb,var(--ink) 78%,transparent)}.rr-row-worktree{overflow:hidden;color:var(--dim);font-family:var(--font-mono);font-size:var(--text-3xs);letter-spacing:var(--tracking-sm);text-overflow:ellipsis;white-space:nowrap}.rr-row-activity{min-height:12px;display:inline-flex;align-items:center;gap:var(--space-xs);margin-top:1px;color:var(--green);font-family:var(--font-mono);font-size:var(--text-2xs);font-weight:650;letter-spacing:var(--tracking-md);text-transform:uppercase}.rr-row-activity--pending{color:var(--accent)}.rr-row-activity--attention{color:var(--amber)}.rr-row-activity-bars{flex:0 0 auto;width:18px;height:10px;display:inline-grid;grid-template-columns:repeat(4,1fr);align-items:end;gap:2px}.rr-row-activity-bars span{display:block;min-height:3px;border-radius:var(--radius-pill);background:currentColor;opacity:.45;animation:rr-row-activity-rise 1.05s ease-in-out infinite}.rr-row-activity-bars span:nth-child(1){height:38%;animation-delay:0ms}.rr-row-activity-bars span:nth-child(2){height:72%;animation-delay:.11s}.rr-row-activity-bars span:nth-child(3){height:52%;animation-delay:.22s}.rr-row-activity-bars span:nth-child(4){height:84%;animation-delay:.33s}.rr-row-activity-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes rr-row-activity-rise{0%,to{opacity:.38;transform:scaleY(.66)}45%{opacity:1;transform:scaleY(1)}}@media(prefers-reduced-motion:reduce){.rr-row-activity-bars span{animation:none;opacity:.8;transform:none}}.rr-row-meta{flex:0 0 auto;font-family:var(--font-mono);font-size:var(--text-2xs);color:color-mix(in srgb,var(--ink) 58%,transparent);letter-spacing:var(--tracking-sm)}.rr-row-caret{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;color:color-mix(in srgb,var(--ink) 45%,transparent);border-radius:var(--radius-sm);transition:color .12s,background .12s}.rr-row-caret--leading{width:14px;height:14px;color:color-mix(in srgb,var(--ink) 50%,transparent)}.rr-row-head:hover .rr-row-caret{color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent)}.rr-row--unread .rr-row-caret--leading{color:var(--accent)}.rr-chevron{display:block;transition:transform .16s ease}.rr-chevron--open{transform:rotate(90deg)}.rr-row-detail{padding:var(--space-2xs) var(--space-lg) var(--space-sm) var(--space-4xl);background:color-mix(in srgb,var(--accent) 3%,transparent);font-family:var(--font-mono);font-size:var(--text-sm);color:var(--muted);line-height:var(--leading-snug)}.rr-row-detail-preview{color:var(--ink);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.rr-spec-list{margin:0;display:flex;flex-direction:column;gap:var(--space-3xs)}.rr-spec{display:grid;grid-template-columns:56px 1fr;column-gap:var(--space-sm);align-items:baseline;margin:0}.rr-spec-label{margin:0;font-size:var(--text-2xs);letter-spacing:var(--tracking-xl);text-transform:uppercase;color:var(--dim);white-space:nowrap}.rr-spec-value{margin:0;font-size:var(--text-sm);color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rr-row{position:relative}.rr-row-name{display:inline-flex;align-items:center;gap:5px;max-width:100%}.rr-row-pin-mark{flex:none;display:inline-flex;color:var(--accent);opacity:.9}.rr-row-actions{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:none;align-items:center;gap:2px;padding:1px;border-radius:var(--radius-md);background:color-mix(in srgb,var(--surface) 92%,var(--bg));border:1px solid color-mix(in srgb,var(--border) 70%,transparent);box-shadow:0 4px 12px #01020259;z-index:2}.rr-row--has-actions:hover .rr-row-actions,.rr-row--has-actions:focus-within .rr-row-actions{display:inline-flex}.rr-row--has-actions:hover .rr-row-meta,.rr-row--has-actions:focus-within .rr-row-meta{opacity:0}.rr-row-action{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 5px;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--muted);font-family:var(--font-mono);font-size:var(--text-2xs);font-weight:600;letter-spacing:var(--tracking-sm);cursor:pointer}.rr-row-action:hover{background:color-mix(in srgb,var(--ink) 6%,transparent);color:var(--ink)}.rr-row-action--on,.rr-row-action--on:hover{color:var(--accent)}
@@ -1 +0,0 @@
1
- import{j as r}from"./index-NRbRrZw-.js";import{s as $,b as E}from"./colors-BtO5_zlx.js";import{A as M}from"./AgentAvatar-CQqJcwOQ.js";function q({name:a,meta:i,sub:s,tone:o="neutral",agent:t,avatarName:c,avatarKind:e="user",leadingIcon:n,caret:l,active:j,selected:v,unread:N,depth:f=0,detail:d,expanded:h,activityLabel:w,worktreeLabel:u,activityTone:g="working",actions:p,pinned:x,onClick:k,onKeyDown:b,onContextMenu:y,onPointerEnter:C,onPointerLeave:P,title:R,tabIndex:z}){const A=l?l==="open":d!==void 0?!!h:void 0,B=["rr-row",f===1&&"rr-row--child",j&&"rr-row--active",v&&"rr-row--selected",N&&"rr-row--unread",h&&"rr-row--expanded",w&&"rr-row--motion",x&&"rr-row--pinned",p&&"rr-row--has-actions"].filter(Boolean).join(" ");return r.jsxs("div",{className:B,children:[r.jsxs("button",{type:"button",className:"rr-row-head",onClick:k,onKeyDown:b,onContextMenu:y,onPointerEnter:C,onPointerLeave:P,title:R,tabIndex:z,"aria-expanded":A,children:[r.jsx(T,{icon:n,tone:o,caret:l,agent:t,avatarName:c,avatarKind:e}),r.jsxs("span",{className:"rr-row-body",children:[r.jsxs("span",{className:"rr-row-name",children:[x?r.jsx("span",{className:"rr-row-pin-mark","aria-label":"Pinned",title:"Pinned",children:r.jsx(S,{})}):null,a]}),s&&r.jsx("span",{className:"rr-row-sub",children:s}),u&&r.jsx("span",{className:"rr-row-worktree",children:u}),w&&r.jsxs("span",{className:`rr-row-activity rr-row-activity--${g}`,children:[r.jsxs("span",{className:"rr-row-activity-bars","aria-hidden":!0,children:[r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{})]}),r.jsx("span",{className:"rr-row-activity-label",children:w})]})]}),i&&r.jsx("span",{className:"rr-row-meta",children:i})]}),p?r.jsx("div",{className:"rr-row-actions",onClick:L=>L.stopPropagation(),children:p}):null,h&&d&&r.jsx("div",{className:"rr-row-detail",children:d})]})}function T({icon:a,tone:i,caret:s,agent:o,avatarName:t,avatarKind:c}){if(s)return r.jsx("span",{className:`rr-row-caret rr-row-caret--leading rr-row-caret--${s}`,"aria-hidden":!0,children:r.jsx(G,{open:s==="open"})});if(t||o){if(c==="channel")return r.jsx("span",{className:"rr-row-hash","aria-hidden":!0,children:"#"});const n=m(i),l=n==="active"||n==="available"||n==="working"||n==="in_turn";return r.jsx("span",{className:"rr-row-avatar-wrap","aria-hidden":!0,children:r.jsx(M,{agent:o,name:t??o?.name,placement:"row",size:20,tile:!0,presence:l})})}if(a)return r.jsx("span",{className:"rr-row-icon","aria-hidden":!0,children:a});const e=m(i);return r.jsx("span",{className:`rr-row-dot rr-row-dot--${e}`,style:e==="active"||e==="available"?{background:$(e)}:void 0,"aria-hidden":!0})}function G({open:a}){return r.jsx("svg",{className:`rr-chevron${a?" rr-chevron--open":""}`,viewBox:"0 0 12 12",width:"12",height:"12",fill:"none","aria-hidden":!0,children:r.jsx("path",{d:"M4.25 3L7.75 6L4.25 9",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function m(a){return a==="channel"||a==="dm"||a==="neutral"?a:E(a)}function S(){return r.jsx("svg",{width:"9",height:"9",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M9.8 1.6 14.4 6.2a1 1 0 0 1-.2 1.6l-2.7 1.1-.9 3.4a.7.7 0 0 1-1.2.3L6.3 9.5 2.8 13 1.7 11.9l3.5-3.5L2.1 5.3a.7.7 0 0 1 .3-1.2l3.4-.9 1.1-2.7a1 1 0 0 1 1.6-.2Z"})})}export{q as R};
@@ -1 +0,0 @@
1
- import{r as o,j as n}from"./index-NRbRrZw-.js";/* empty css */import{D as O}from"./DataTable-DFacT2uu.js";import{p as W,a as L}from"./api-DEHEgJ9m.js";import{t as U,n as R,f as Y}from"./time-Dhsh_2EG.js";import{u as G}from"./tail-events-B7BrDaFi.js";import{o as Q}from"./openContent-C6XO6kr5.js";import{u as X}from"./Provider-Cd-QZltN.js";/* empty css */import"./index-BWHgHrtv.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./sse-QSbhyq9A.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./index-CD2foMB8.js";import"./HarnessMark-CEzmPFHC.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";const q=1e4,J=500,$=1e3,Z=6e4,D="/api/tail/discover",_=`/api/tail/recent?limit=${J}`,P=3e4,tt=[{key:"status",label:"status",cls:"s-atop-col-status",kind:"text",sortable:!1,defaultWidth:96,minWidth:70,render:t=>n.jsxs("span",{className:`s-atop-status s-atop-status--${t.status}`,children:[n.jsx("span",{className:"s-atop-status-dot","aria-hidden":"true"}),t.statusLabel]})},{key:"session",label:"session",cls:"s-atop-col-agent",kind:"text",sortable:!1,defaultWidth:168,minWidth:110,maxWidth:280,render:t=>n.jsxs("div",{className:"s-atop-agent-cell",title:t.sessionId??t.refId,children:[n.jsx("span",{className:`s-atop-chip s-atop-chip--harness s-atop-chip--harness-${st(t.source)}`,children:t.source}),n.jsx("span",{className:"s-atop-agent-id",children:t.refId.slice(0,8)})]})},{key:"project",label:"project",cls:"s-atop-col-project",kind:"text",sortable:!1,defaultWidth:200,minWidth:96,maxWidth:360,render:t=>n.jsx("span",{title:t.cwd??t.project,children:t.project})},{key:"updated",label:"updated",cls:"s-atop-col-last",kind:"time",sortable:!1,defaultWidth:86,minWidth:64,render:t=>n.jsx("span",{title:Y(t.mtimeMs),children:U(Math.max(R(t.mtimeMs)??0,R(t.lastEvent?.ts)??0))||"-"})},{key:"size",label:"size",cls:"s-atop-col-runtime",kind:"number",sortable:!1,defaultWidth:80,minWidth:64,render:t=>nt(t.size)},{key:"path",label:"path",kind:"text",sortable:!1,defaultWidth:360,minWidth:160,maxWidth:800,render:t=>n.jsx("span",{title:t.transcriptPath,children:t.cwd??t.transcriptPath})}];function z(t){const i=t?.trim();if(!i)return null;const r=F(i);return r.endsWith(".jsonl")?r.slice(0,-6):r}function F(t){const i=t.replace(/[\\/]+$/,"");return i.split(/[\\/]/).filter(Boolean).at(-1)??i}function et(t){const r=t.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean);return r.pop(),r.at(-1)??""}function st(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function nt(t){if(!Number.isFinite(t)||t<0)return"-";if(t<1024)return`${t} B`;const i=t/1024;if(i<1024)return`${i.toFixed(i>=10?0:1)} KiB`;const r=i/1024;return`${r.toFixed(r>=10?0:1)} MiB`}function at(t,i){return i?[t.refId,t.sessionId??"",t.source,t.project,t.cwd??"",t.transcriptPath,t.lastEvent?.summary??"",t.process?.command??""].join(" ").toLowerCase().includes(i.toLowerCase()):!0}function B(t){return`${t.source}\0${t.cwd??""}`}function ot(t){return`${t.source}\0${t.cwd??""}`}function it(t,i,r){if(!t?.transcripts?.length)return[];const d=new Map;for(const s of i){const l=d.get(s.sessionId);(!l||s.ts>l.ts)&&d.set(s.sessionId,s)}const h=new Map;for(const s of t.processes){if(!s.cwd)continue;const l=h.get(B(s));(!l||s.pid<l.pid)&&h.set(B(s),s)}return t.transcripts.map(s=>{const l=z(s.sessionId)??z(s.transcriptPath);if(!l)return null;const u=s.sessionId?d.get(s.sessionId)??null:null,x=h.get(ot(s))??null,m=Math.max(s.mtimeMs,u?.ts??0),j=!!x||r-m<=Z,p=s.project?.trim()||(s.cwd?F(s.cwd):et(s.transcriptPath))||"unknown";return{refId:l,source:s.source||"unknown",project:p,cwd:s.cwd,transcriptPath:s.transcriptPath,sessionId:s.sessionId,mtimeMs:s.mtimeMs,size:s.size,status:j?"run":"idle",statusLabel:j?"active":"idle",lastEvent:u,process:x}}).filter(s=>s!==null).sort((s,l)=>{const u=Math.max(s.mtimeMs,s.lastEvent?.ts??0);return Math.max(l.mtimeMs,l.lastEvent?.ts??0)-u||s.project.localeCompare(l.project)})}function Gt({navigate:t}){const{route:i}=X(),[r]=o.useState(()=>W(D,P)),[d,h]=o.useState(r),[s,l]=o.useState(()=>W(_,P)?.events??[]),[u,x]=o.useState(r===null),[m,j]=o.useState(""),[p,S]=o.useState("all"),[y,k]=o.useState(0),[N,C]=o.useState(null),[T,V]=o.useState(Date.now()),b=o.useRef(null),I=o.useCallback(async()=>{C(null);try{h(await L(D))}catch(e){C(e instanceof Error?e.message:String(e))}finally{x(!1)}},[]);o.useEffect(()=>{I();const e=setInterval(()=>{I()},q);return()=>clearInterval(e)},[I]),o.useEffect(()=>{let e=!1;return(async()=>{try{const a=await L(_);e||l(a.events??[])}catch{}})(),()=>{e=!0}},[]),G(e=>{l(a=>a.length>=$?[...a.slice(a.length-$+1),e]:[...a,e])}),o.useEffect(()=>{const e=setInterval(()=>V(Date.now()),15e3);return()=>clearInterval(e)},[]);const f=o.useMemo(()=>it(d,s,T),[d,s,T]),H=o.useMemo(()=>[...new Set(f.map(e=>e.source))].sort(),[f]),c=o.useMemo(()=>f.filter(e=>(p==="all"||e.source===p)&&at(e,m.trim())),[f,p,m]);o.useEffect(()=>{y>=c.length&&k(Math.max(0,c.length-1))},[c.length,y]);const M=o.useCallback(e=>{e&&Q(t,{view:"sessions",sessionId:e.refId},{returnTo:i})},[t,i]);o.useEffect(()=>{const e=a=>{const E=a.target,A=E instanceof HTMLInputElement||E instanceof HTMLTextAreaElement||(E?.isContentEditable??!1);if(a.key==="/"&&!A){a.preventDefault(),b.current?.focus();return}if(A){a.key==="Escape"&&E===b.current&&(j(""),b.current?.blur());return}if(a.key==="ArrowDown"||a.key==="j"){a.preventDefault(),k(w=>c.length===0?0:Math.min(c.length-1,w+1));return}if(a.key==="ArrowUp"||a.key==="k"){a.preventDefault(),k(w=>Math.max(0,w-1));return}(a.key==="Enter"||a.key==="o")&&(a.preventDefault(),M(c[y]))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,y,M]);const K=N?[]:c,g=o.useCallback(e=>`${e.source}:${e.transcriptPath}`,[]),v=o.useMemo(()=>new Map(c.map((e,a)=>[g(e),a])),[c,g]);return n.jsxs("div",{className:"s-atop s-atop--sessions",children:[n.jsxs("div",{className:"s-atop-fbar",children:[n.jsxs("label",{className:"s-atop-search",children:[n.jsx("span",{className:"s-atop-search-prompt",children:"/"}),n.jsx("input",{ref:b,className:"s-atop-search-input",placeholder:"filter sessions",value:m,onChange:e=>j(e.target.value)}),n.jsx("kbd",{className:"s-atop-search-kbd",children:"/"})]}),n.jsx("span",{className:"s-atop-fbar-label",children:"source"}),n.jsxs("button",{type:"button",className:`s-atop-pill${p==="all"?" s-atop-pill--on":""}`,onClick:()=>S("all"),children:["all",n.jsx("span",{className:"s-atop-pill-ct",children:f.length})]}),H.map(e=>n.jsxs("button",{type:"button",className:`s-atop-pill${p===e?" s-atop-pill--on":""}`,onClick:()=>S(e),children:[e,n.jsx("span",{className:"s-atop-pill-ct",children:f.filter(a=>a.source===e).length})]},e)),n.jsx("div",{className:"s-atop-fbar-spacer"})]}),n.jsx(O,{rows:K,columns:tt,rowId:g,storageKey:"openscout.sessions.cols",rowBindings:e=>({onMouseEnter:()=>{const a=v.get(e);a!=null&&k(a)},onFocus:()=>{const a=v.get(e);a!=null&&k(a)}}),onRowClick:e=>M(e),rowClassName:e=>v.get(g(e))===y?"s-atop-row--selected":void 0,empty:N?{title:"Discovery failed",body:N}:{title:"No raw sessions",body:m?"No sessions match the current filter.":"No transcript sessions were discovered."},loading:u,density:"compact",className:"s-atop-data-table",ariaLabel:"Raw sessions"}),n.jsxs("div",{className:"s-atop-keys",children:[n.jsxs("span",{children:[n.jsx("kbd",{children:"/"}),"filter"]}),n.jsxs("span",{children:[n.jsx("kbd",{children:"j/k"}),"select"]}),n.jsxs("span",{children:[n.jsx("kbd",{children:"enter"}),"open"]}),n.jsx("span",{className:"s-atop-keys-spacer"}),n.jsxs("span",{className:"s-atop-keys-count",children:[n.jsx("strong",{children:c.length})," sessions"]})]})]})}export{Gt as RawSessionsTable};