@openscout/scout 0.2.84 → 0.2.86

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 (451) hide show
  1. package/README.md +1 -1
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-C7AwUogt.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-Czb5uwou.js → AddProjectForm-BNRpRPod.js} +1 -1
  6. package/dist/client/assets/AgentAvatar-B1xvQ7ej.js +1 -0
  7. package/dist/client/assets/AgentConfigurationScreen-BoBQpyz5.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-rw3vh8Lm.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-Biq8b2gv.js → AgentDetailCard-FelCxQrT.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-Crdw8Uo5.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-Cge7HHbV.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-C4DMQR-c.js → AgentLaneCard-CRDG74C1.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-D1xNNf7A.js → AgentLaneChrome-CWFqUdch.js} +1 -1
  14. package/dist/client/assets/AgentLaneDetailSheet-DCIIg3Zp.js +4 -0
  15. package/dist/client/assets/{AgentLaneSummaryResize-C9loK-st.js → AgentLaneSummaryResize-yTM4GQAJ.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BJLwXSNp.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-M7iDXdP2.js → AgentLanesPreflight-DJeDRTAN.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-CbY9qD0z.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-0iy8QZ1T.js → AgentLiveActions-Bn3zeZBN.js} +1 -1
  20. package/dist/client/assets/AgentSessions-czl5zT7A.js +6 -0
  21. package/dist/client/assets/AgentsConsole-CoT2crwq.js +1 -0
  22. package/dist/client/assets/{AgentsScreen-Bww6HgFs.js → AgentsScreen-BcPM-z1T.js} +1 -1
  23. package/dist/client/assets/AgentsSubnav-3_vpn2bT.js +1 -0
  24. package/dist/client/assets/AstronautSuit-BADl7m8x.js +1 -0
  25. package/dist/client/assets/{AtopView-h_aFoNkP.js → AtopView-DymBCiXv.js} +1 -1
  26. package/dist/client/assets/{BackToPicker-BXp5E2ck.js → BackToPicker-CqYhOaLB.js} +1 -1
  27. package/dist/client/assets/BriefingDetailScreen-DDfZ8ci1.js +1 -0
  28. package/dist/client/assets/{BriefingsScreen-BTsvr5fv.js → BriefingsScreen-CLvSOJjy.js} +1 -1
  29. package/dist/client/assets/{BrokerMetadataPanel-jg7odHQp.js → BrokerMetadataPanel-DFAH-NO6.js} +1 -1
  30. package/dist/client/assets/BrokerScreen-Bkvu92jk.js +5 -0
  31. package/dist/client/assets/{Canvas-BePL08RR.js → Canvas-KyTsDJlB.js} +1 -1
  32. package/dist/client/assets/ChatCollapsedStrip-Bjjqa30K.js +1 -0
  33. package/dist/client/assets/{CodeDiffPane-86odpBSt.js → CodeDiffPane-C9HT1dCT.js} +1 -1
  34. package/dist/client/assets/{CodeProjectPicker-8svr_S_A.js → CodeProjectPicker-5Y3GvXkM.js} +1 -1
  35. package/dist/client/assets/{CodeScreen-CJ2RgB32.js → CodeScreen-DpN9kQvm.js} +1 -1
  36. package/dist/client/assets/ConversationComposer-Ce7Byw48.js +1 -0
  37. package/dist/client/assets/ConversationFeedRows-DygDfQn_.js +1 -0
  38. package/dist/client/assets/ConversationHeader-C3sg0ULI.js +1 -0
  39. package/dist/client/assets/ConversationPanels-Dg4Y2GgX.js +6 -0
  40. package/dist/client/assets/ConversationScreen-BP5tdz2k.css +1 -0
  41. package/dist/client/assets/ConversationScreen-CjWWmuuh.js +1 -0
  42. package/dist/client/assets/ConversationStatus-BhVIYQza.js +1 -0
  43. package/dist/client/assets/CrewWorkspaces-B6YIyw1z.css +1 -0
  44. package/dist/client/assets/CrewWorkspaces-CDU-wy1Y.js +1 -0
  45. package/dist/client/assets/{DataTable-CGw5CECG.js → DataTable-oJP339bX.js} +1 -1
  46. package/dist/client/assets/{DispatchAftermath-DowTb7uO.js → DispatchAftermath-CH02HAVw.js} +1 -1
  47. package/dist/client/assets/DocumentFocusViewer-DmtFisY9.js +1 -0
  48. package/dist/client/assets/{EmbeddableSurfacesLab-CxfJXS2g.js → EmbeddableSurfacesLab-84b9I3fy.js} +1 -1
  49. package/dist/client/assets/{EmptyState-BUvllvA6.js → EmptyState-BnDda92b.js} +1 -1
  50. package/dist/client/assets/{FileViewerPane-BM4AD_bo.js → FileViewerPane-Dg7_88pv.js} +1 -1
  51. package/dist/client/assets/FlightObserveScreen-DL3Xhl0h.js +1 -0
  52. package/dist/client/assets/{FollowScreen-DG0osbUp.js → FollowScreen-DcFBqr6l.js} +1 -1
  53. package/dist/client/assets/{HarnessMark-MztYnrGK.js → HarnessMark-DGZ6o6Ct.js} +1 -1
  54. package/dist/client/assets/{HarnessesScreen-BWqirBjK.js → HarnessesScreen-DTDL-XaA.js} +1 -1
  55. package/dist/client/assets/{HerdrSession-6sFln7WX.js → HerdrSession-DV2hD6Yh.js} +1 -1
  56. package/dist/client/assets/HomeHero-7JwycwFY.css +1 -0
  57. package/dist/client/assets/HomeHero-CENwVZ45.js +1 -0
  58. package/dist/client/assets/HostAdvisorView-PgiZUkd_.js +1 -0
  59. package/dist/client/assets/{KnowledgeSearchInspector-BOIhFWd2.js → KnowledgeSearchInspector-DNQjeWZO.js} +1 -1
  60. package/dist/client/assets/KnowledgeSearchScreen-Bj80IgR0.js +1 -0
  61. package/dist/client/assets/{LaneToolHoverCard-CcEiQC6B.js → LaneToolHoverCard-197xYmRp.js} +1 -1
  62. package/dist/client/assets/LaneTraceDetailSheet-BztwvOv9.js +1 -0
  63. package/dist/client/assets/{LaneTraceEventFocus-Bl9L0EYb.js → LaneTraceEventFocus-C9cmqxnK.js} +1 -1
  64. package/dist/client/assets/{MeshCanvas-ZjIuMiRo.js → MeshCanvas-C3_2p9B6.js} +2 -2
  65. package/dist/client/assets/{MeshCanvasMinimap-C-LQtiX6.js → MeshCanvasMinimap-ZTjYWXTZ.js} +1 -1
  66. package/dist/client/assets/{MeshScreen-Bs3soujg.js → MeshScreen-lJKaOyGB.js} +1 -1
  67. package/dist/client/assets/{MeshTopologyView-C0LUyT3K.js → MeshTopologyView-CBjHbAZw.js} +2 -2
  68. package/dist/client/assets/MessagesScreen-D6MVLvdg.js +1 -0
  69. package/dist/client/assets/{MissionContextRail-CjGAEGu8.js → MissionContextRail-DXkrbcnZ.js} +1 -1
  70. package/dist/client/assets/MissionControlView-BCH-Zsp4.js +1 -0
  71. package/dist/client/assets/MissionFocusOverlay-DbAliOSF.js +1 -0
  72. package/dist/client/assets/MissionLeftAgentRow-Bx6Pg8_O.js +1 -0
  73. package/dist/client/assets/MissionLogPane-D06c29Y8.js +1 -0
  74. package/dist/client/assets/{NewAgentModal-D5e0YUAo.js → NewAgentModal-C18Ajovd.js} +1 -1
  75. package/dist/client/assets/NewChatComposer-Bgqes0UQ.js +19 -0
  76. package/dist/client/assets/{NewChatOrigin-BEz6jyqf.js → NewChatOrigin-DpHS2Wmt.js} +1 -1
  77. package/dist/client/assets/ObserveEmbedScreen-Cmhwai4X.js +2 -0
  78. package/dist/client/assets/ObserveTextFlow-C1f5oize.js +2 -0
  79. package/dist/client/assets/ObservedTopologyPanel-D85P6RAk.js +2 -0
  80. package/dist/client/assets/OpenScoutAppShell-IDI4fuUE.js +88 -0
  81. package/dist/client/assets/OpsAgentsView-yt0JavoB.js +1 -0
  82. package/dist/client/assets/OpsScreen-C3yNQqJE.js +1 -0
  83. package/dist/client/assets/OpsSubnav-BijKI3yG.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfile-DnIeC16r.js +1 -0
  85. package/dist/client/assets/{ProjectAgentProfileBar-B1VpwzGD.js → ProjectAgentProfileBar-IDEpKZvI.js} +1 -1
  86. package/dist/client/assets/ProjectAgentProfileHero-Bh_aISs-.js +1 -0
  87. package/dist/client/assets/ProjectsInbox-B8Srlklk.js +2 -0
  88. package/dist/client/assets/ProjectsRail-DqAbdvCf.js +1 -0
  89. package/dist/client/assets/ProjectsScreen-DKHQ2iEv.js +1 -0
  90. package/dist/client/assets/ProjectsThreadAside-DpkjYLL2.js +1 -0
  91. package/dist/client/assets/Provider-Ve8yXaWR.js +1 -0
  92. package/dist/client/assets/RailRow-B0sRaJc6.css +1 -0
  93. package/dist/client/assets/RailRow-C4GNGR80.js +1 -0
  94. package/dist/client/assets/RawSessionsTable-Co3vzwsf.js +1 -0
  95. package/dist/client/assets/RealtimeVoiceScreen-DMd1CBAf.js +9 -0
  96. package/dist/client/assets/{RepoDiffEmbedScreen-VLg4caej.js → RepoDiffEmbedScreen-C97Euf4s.js} +1 -1
  97. package/dist/client/assets/{RepoDiffPageScreen-BelnvgnP.js → RepoDiffPageScreen-DUKLzkrW.js} +1 -1
  98. package/dist/client/assets/RepoDiffViewer-CovKjSgb.js +7 -0
  99. package/dist/client/assets/RepoDiffViewerLazy-zIiEmh-e.js +2 -0
  100. package/dist/client/assets/{ReposScreen-IINK-CFn.js → ReposScreen-BR1LqTf1.js} +6 -6
  101. package/dist/client/assets/ScoutDeckSurface-BGsVicc2.js +1 -0
  102. package/dist/client/assets/{ScoutSurface-x_QbcRyk.js → ScoutSurface-BMKW7hSu.js} +1 -1
  103. package/dist/client/assets/{ScoutbotFxLab-7t9JVvZg.js → ScoutbotFxLab-0O2iDRrF.js} +1 -1
  104. package/dist/client/assets/{SecondaryNav-Dj30epYF.js → SecondaryNav-cYTw2p39.js} +1 -1
  105. package/dist/client/assets/{SessionEmbedScreen-s2mJ5Fg9.js → SessionEmbedScreen-mNjT0R6j.js} +1 -1
  106. package/dist/client/assets/{SessionObserve-DaUrJCMq.js → SessionObserve-zAlFbwFn.js} +1 -1
  107. package/dist/client/assets/{SessionObserveEvidence-ClUW8jpV.js → SessionObserveEvidence-BVawzqoE.js} +1 -1
  108. package/dist/client/assets/SessionRefScreen-BmKhf29o.js +1 -0
  109. package/dist/client/assets/SessionsScreen-CsSqjIY2.js +1 -0
  110. package/dist/client/assets/SettingsDrawer-Dsj-On_x.css +1 -0
  111. package/dist/client/assets/SettingsDrawer-DwYQTGi8.js +3 -0
  112. package/dist/client/assets/SettingsScreen-Btaku7YM.js +1 -0
  113. package/dist/client/assets/{ShikiPane-Dkwyx--r.js → ShikiPane-DyEJdcvb.js} +1 -1
  114. package/dist/client/assets/{SlidePanel-CuTeirnk.js → SlidePanel-Dg8_styW.js} +1 -1
  115. package/dist/client/assets/{SpriteAvatar-DQ3PTb8L.js → SpriteAvatar-DMrSssNZ.js} +1 -1
  116. package/dist/client/assets/{StatusPill-BJ1ierIR.js → StatusPill-NFFnphtx.js} +1 -1
  117. package/dist/client/assets/{TailView-CufWcrvf.js → TailView-BfObcZu3.js} +2 -2
  118. package/dist/client/assets/Terminal-Dr-M9U4u.js +1 -0
  119. package/dist/client/assets/TerminalEmbedScreen-BmyZkonh.js +1 -0
  120. package/dist/client/assets/{TerminalRelay-rvUzI9Ek.js → TerminalRelay-lJ2KdMCW.js} +3 -3
  121. package/dist/client/assets/{TextDocumentSurface-Bc-kHPgG.js → TextDocumentSurface-C7fGlzY8.js} +1 -1
  122. package/dist/client/assets/{TmuxPeek-DLyDkq_D.js → TmuxPeek-BSeKIjnX.js} +1 -1
  123. package/dist/client/assets/{VoicePermissionsPanel-CD903y9K.js → VoicePermissionsPanel-BkIGTzgw.js} +1 -1
  124. package/dist/client/assets/{WorkDetailScreen-D51oI0dH.js → WorkDetailScreen-Cwe-KWK4.js} +3 -3
  125. package/dist/client/assets/WorkFilesViewer-BBtKRBPv.js +1 -0
  126. package/dist/client/assets/{activity-BvGruxWG.js → activity-D4W2XZY2.js} +1 -1
  127. package/dist/client/assets/{addon-fit-Cfq4Ayjd.js → addon-fit-Celjj2yn.js} +1 -1
  128. package/dist/client/assets/{addon-webgl-B8sIf9-s.js → addon-webgl-Cu4tJ21-.js} +1 -1
  129. package/dist/client/assets/{ScoutbotBroadcastChip-CxtYZWPZ.css → agent-autocomplete-C7xwIcwd.css} +1 -1
  130. package/dist/client/assets/agent-autocomplete-Dv-_9dAw.js +2 -0
  131. package/dist/client/assets/{agent-essentials-yb4wIJlX.js → agent-essentials-CngjUhQj.js} +1 -1
  132. package/dist/client/assets/agent-identity-DzHGhLdJ.js +1 -0
  133. package/dist/client/assets/{agent-lane-card-model-q4cwzLX4.js → agent-lane-card-model-CSugZCdy.js} +1 -1
  134. package/dist/client/assets/{agent-lane-detail-BNNm6FNu.js → agent-lane-detail-D5EIlX7_.js} +1 -1
  135. package/dist/client/assets/{agent-lane-preview-C33Dwpn7.js → agent-lane-preview-BhplDYGf.js} +1 -1
  136. package/dist/client/assets/{agent-lanes-BDNktFBZ.css → agent-lanes-DlqcEf0l.css} +1 -1
  137. package/dist/client/assets/{agent-lanes-model-VYQ5a68i.js → agent-lanes-model-BKOs_32K.js} +2 -2
  138. package/dist/client/assets/agent-specialization-CNrsRbKA.js +1 -0
  139. package/dist/client/assets/{api-BkjHJfgJ.js → api-BHHEUSS3.js} +1 -1
  140. package/dist/client/assets/api-DEHEgJ9m.js +1 -0
  141. package/dist/client/assets/{arc.es-BBTfhvLE.js → arc.es-DNT50Y-_.js} +1 -1
  142. package/dist/client/assets/archive-DH49QqFG.js +1 -0
  143. package/dist/client/assets/{arrow-left-BOht-YQu.js → arrow-left-i-h6JAgs.js} +1 -1
  144. package/dist/client/assets/arrow-right-B0Yi01Zr.js +1 -0
  145. package/dist/client/assets/{arrow-up-right-hoR8_oUz.js → arrow-up-right-RBC6k8nn.js} +1 -1
  146. package/dist/client/assets/{bot-BUK7dOPS.js → bot-r2IuAuJd.js} +1 -1
  147. package/dist/client/assets/broker-display-Q75fupqG.js +2 -0
  148. package/dist/client/assets/{cache-Dr0why2k.js → cache-BO2Bd_LV.js} +1 -1
  149. package/dist/client/assets/{check--esHw52j.js → check-Bfs7hMb1.js} +1 -1
  150. package/dist/client/assets/{chevron-down-NAhBUkFd.js → chevron-down-Da5tV19_.js} +1 -1
  151. package/dist/client/assets/{chevron-right-C10o7t_X.js → chevron-right-BMqtBds_.js} +1 -1
  152. package/dist/client/assets/{chunk-HRAB3GC3-DF8R9rPv.js → chunk-HRAB3GC3-BUVYXXAp.js} +1 -1
  153. package/dist/client/assets/{clock-of01sAB6.js → clock-DaKLp6Xd.js} +1 -1
  154. package/dist/client/assets/{code-xml-CLn3TDWF.js → code-xml-ByQsfOI_.js} +1 -1
  155. package/dist/client/assets/collapsed-strip-raJWthAH.css +1 -0
  156. package/dist/client/assets/compass-BepM5iWH.js +1 -0
  157. package/dist/client/assets/{content-Cgj5AWqT.js → content-5hnDC9WE.js} +1 -1
  158. package/dist/client/assets/content-BRFZ-a6m.js +1 -0
  159. package/dist/client/assets/content-BYykncDo.js +1 -0
  160. package/dist/client/assets/content-Be6yyWbJ.js +1 -0
  161. package/dist/client/assets/content-Bgl_X3ao.js +1 -0
  162. package/dist/client/assets/content-BopJW1Zx.js +1 -0
  163. package/dist/client/assets/content-Bv2sfg0w.js +1 -0
  164. package/dist/client/assets/content-CMBiIZTg.js +1 -0
  165. package/dist/client/assets/content-CPVqvf5o.js +1 -0
  166. package/dist/client/assets/content-CbwyFqdI.js +1 -0
  167. package/dist/client/assets/content-ClQjAWYi.js +1 -0
  168. package/dist/client/assets/content-Cv2tSAbv.js +1 -0
  169. package/dist/client/assets/content-DFFe3-Ot.js +1 -0
  170. package/dist/client/assets/content-DY5hwBmm.js +1 -0
  171. package/dist/client/assets/content-_IXoxGno.js +1 -0
  172. package/dist/client/assets/content-j_tewJdE.js +1 -0
  173. package/dist/client/assets/{conversation-icons-ClBJi21l.js → conversation-icons-C4amK8Sa.js} +1 -1
  174. package/dist/client/assets/conversation-model-CigSPlKA.js +1 -0
  175. package/dist/client/assets/conversation-motion-features-_95aZx_1.js +1 -0
  176. package/dist/client/assets/{copy-Dty8ZYsM.js → copy-De4s38o2.js} +1 -1
  177. package/dist/client/assets/cpu-Bc268H9Q.js +1 -0
  178. package/dist/client/assets/{createLucideIcon-Bt67PWH-.js → createLucideIcon-DLlxGjKt.js} +1 -1
  179. package/dist/client/assets/credentials-qwds23lv.js +1 -0
  180. package/dist/client/assets/ctx-panel-D_HJ3nhb.css +1 -0
  181. package/dist/client/assets/discover-DOlk1hG7.js +2 -0
  182. package/dist/client/assets/embed-entry-BqDJfa87.js +2 -0
  183. package/dist/client/assets/{external-link-Dem738OJ.js → external-link-BGHC_naA.js} +1 -1
  184. package/dist/client/assets/{eye-B3lBIwJZ.js → eye-BeCSqJn1.js} +1 -1
  185. package/dist/client/assets/file-code-corner-CX53Cd9y.js +1 -0
  186. package/dist/client/assets/{file-text-iF0hyVyU.js → file-text-BVhkMWyC.js} +1 -1
  187. package/dist/client/assets/gauge-CPcEPmNt.js +1 -0
  188. package/dist/client/assets/gestures-BXIGYk_p.js +1 -0
  189. package/dist/client/assets/git-branch-q8Ayc8py.js +1 -0
  190. package/dist/client/assets/home-moving-signal-DMguaRWR.css +1 -0
  191. package/dist/client/assets/home-moving-signal-Dm2Z2x0p.js +1 -0
  192. package/dist/client/assets/{home-now-card-nano-hZl9klbP.js → home-now-card-nano-Djhy6ax0.js} +1 -1
  193. package/dist/client/assets/home-now-card-xU5LGP7q.js +1 -0
  194. package/dist/client/assets/hooks-CdKx1CxP.js +2 -0
  195. package/dist/client/assets/host-advisor-B2Fqs5Dd.css +1 -0
  196. package/dist/client/assets/index-Bli6bTLU.js +10 -0
  197. package/dist/client/assets/index-D7UEHxaY.js +1 -0
  198. package/dist/client/assets/index-DFdlQs_c.js +1 -0
  199. package/dist/client/assets/index-DhfOMK0D.js +1 -0
  200. package/dist/client/assets/index-DzlEgstl.css +1 -0
  201. package/dist/client/assets/index-wLwc74Pu.css +1 -0
  202. package/dist/client/assets/inspector-panel-B8pigRsg.js +2 -0
  203. package/dist/client/assets/{keyboard-nav-Chf51dns.js → keyboard-nav-7iEtvu9P.js} +1 -1
  204. package/dist/client/assets/{lane-observe-BA3g9aVd.js → lane-observe-vfyACHi0.js} +1 -1
  205. package/dist/client/assets/{lane-roster-store-BiIVlYmG.js → lane-roster-store-pHT3TAVs.js} +1 -1
  206. package/dist/client/assets/layers-BiZA-Clc.js +1 -0
  207. package/dist/client/assets/layout-grid-DMpv9CZM.js +1 -0
  208. package/dist/client/assets/left-BayK4ocL.js +1 -0
  209. package/dist/client/assets/left-BhZhSrS2.js +1 -0
  210. package/dist/client/assets/left-BhgU6NOA.js +1 -0
  211. package/dist/client/assets/left-CY_FGnN7.js +1 -0
  212. package/dist/client/assets/left-Cq8mjamr.js +1 -0
  213. package/dist/client/assets/left-DH44V4I_.css +1 -0
  214. package/dist/client/assets/left-Dnqla0b5.js +2 -0
  215. package/dist/client/assets/left-Dy403II2.js +2 -0
  216. package/dist/client/assets/left-R2OOE7VG.css +1 -0
  217. package/dist/client/assets/left-advisor-oOAtJ9YE.js +1 -0
  218. package/dist/client/assets/left-agents-TIKe8vW8.js +1 -0
  219. package/dist/client/assets/left-default-owH0Lwxo.js +1 -0
  220. package/dist/client/assets/left-lanes-BE_co2lP.js +1 -0
  221. package/dist/client/assets/left-mission-C_nWUtfA.js +1 -0
  222. package/dist/client/assets/library-BSVrjn_m.js +1 -0
  223. package/dist/client/assets/{loader-circle-4LDsy4Ke.js → loader-circle-DoT8gpw6.js} +1 -1
  224. package/dist/client/assets/{local-agents-DIi2EacM.js → local-agents-BMadXuP1.js} +1 -1
  225. package/dist/client/assets/mentions-Cd6XticV.js +1 -0
  226. package/dist/client/assets/{mesh-ops-JZwGuAPn.js → mesh-ops-C0zCLTR8.js} +1 -1
  227. package/dist/client/assets/{mesh-view-store-Du7VqIT_.js → mesh-view-store-Cpqil_2D.js} +1 -1
  228. package/dist/client/assets/{message-circle-BM3XgevU.js → message-circle-44KSmbvQ.js} +1 -1
  229. package/dist/client/assets/{message-markup-BcY1lShv.js → message-markup-DAnnGpWr.js} +1 -1
  230. package/dist/client/assets/{message-square-ER1_q2pe.js → message-square-DlY4EneU.js} +1 -1
  231. package/dist/client/assets/mission-control-CnU7dNt1.css +1 -0
  232. package/dist/client/assets/{mission-control-store-C6w5iVfg.js → mission-control-store-DtjtRs9Z.js} +1 -1
  233. package/dist/client/assets/{observe-3-jn4SXb.js → observe-DL5_8-Zj.js} +1 -1
  234. package/dist/client/assets/{operator-attention-BwSPeheT.js → operator-attention-BqoWAlhp.js} +1 -1
  235. package/dist/client/assets/{page-status-0LPfBC8S.js → page-status-CW8co39E.js} +1 -1
  236. package/dist/client/assets/persistent-state-DYjP8lqN.js +1 -0
  237. package/dist/client/assets/{plus-C-2gTcPK.js → plus-64n9qucr.js} +1 -1
  238. package/dist/client/assets/profile-BkmuseW7.js +1 -0
  239. package/dist/client/assets/projects-inbox-C0umZMSY.js +1 -0
  240. package/dist/client/assets/{provider-BvAxRQfE.js → provider-CX9EWecp.js} +1 -1
  241. package/dist/client/assets/proxy-C35W-YHZ.js +1 -0
  242. package/dist/client/assets/{radio-v7UAMZGh.js → radio-BjpQTKT0.js} +1 -1
  243. package/dist/client/assets/{refresh-cw-B5To7b6B.js → refresh-cw-IgN2fZLM.js} +1 -1
  244. package/dist/client/assets/resolve-panes-CCqRkQdM.js +1 -0
  245. package/dist/client/assets/resolve-sidebar-context-JkxY8qsV.js +1 -0
  246. package/dist/client/assets/right-B3PQUHd5.js +1 -0
  247. package/dist/client/assets/right-B96CBzrV.js +1 -0
  248. package/dist/client/assets/right-BPirlFC8.js +1 -0
  249. package/dist/client/assets/right-BUP2Ro_M.js +1 -0
  250. package/dist/client/assets/right-BVWYPIFX.js +1 -0
  251. package/dist/client/assets/right-BoAJxwA3.js +1 -0
  252. package/dist/client/assets/right-C2aOC2li.js +1 -0
  253. package/dist/client/assets/right-CtPJjgOV.js +1 -0
  254. package/dist/client/assets/{right-BvoGOUKH.js → right-DqiVyo8v.js} +1 -1
  255. package/dist/client/assets/right-SfSu0zHC.js +1 -0
  256. package/dist/client/assets/{rocket-BQQQv2L5.js → rocket-DnmN_YOD.js} +1 -1
  257. package/dist/client/assets/{router-C65cZYPn.js → router-B0YclXYg.js} +1 -1
  258. package/dist/client/assets/{scope-views-BOOmgmwx.js → scope-views-Z8aoAmtU.js} +1 -1
  259. package/dist/client/assets/scout-voice-DvG_3stJ.js +1 -0
  260. package/dist/client/assets/{scoutbot-BTIErYHo.js → scoutbot-D4vuKzOL.js} +2 -2
  261. package/dist/client/assets/scoutbot-markdown-BJJyaPu2.js +6 -0
  262. package/dist/client/assets/{scroll-text-BuneRiAD.js → scroll-text-DRidbcse.js} +1 -1
  263. package/dist/client/assets/{search-7_n7CxWl.js → search-BbgsEMXa.js} +1 -1
  264. package/dist/client/assets/secondaryNavConfig-DyC_P9Wx.js +1 -0
  265. package/dist/client/assets/{selection-bridge-SlGsgHw2.js → selection-bridge-CpzFGx3-.js} +1 -1
  266. package/dist/client/assets/{send-horizontal-DP16OOIW.js → send-horizontal-BXo2uz3Z.js} +1 -1
  267. package/dist/client/assets/{server-pYOMFjrT.js → server-Dt3tpiBj.js} +1 -1
  268. package/dist/client/assets/{session-catalog-_QfQ7fhZ.js → session-catalog-CUQ8LUJY.js} +1 -1
  269. package/dist/client/assets/{session-table-CYN8e4s3.js → session-table-B4JOKevn.js} +1 -1
  270. package/dist/client/assets/settings-BzWCF3NF.js +1 -0
  271. package/dist/client/assets/{sliders-horizontal-D2Z8gz6J.js → sliders-horizontal-7V8B3xsf.js} +1 -1
  272. package/dist/client/assets/{sparkles-Bth2iK7t.js → sparkles-ytTwpCbZ.js} +1 -1
  273. package/dist/client/assets/{sse-CL6gctHY.js → sse-CSozY6mp.js} +1 -1
  274. package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +1 -0
  275. package/dist/client/assets/{tail-display-BRcJltQa.js → tail-display-DcliDVkW.js} +1 -1
  276. package/dist/client/assets/{tail-events-NLIWLq27.js → tail-events-CrN-Rmxj.js} +1 -1
  277. package/dist/client/assets/{terminal-By1Lw2i2.js → terminal-BiNIXhna.js} +1 -1
  278. package/dist/client/assets/{terminal-relay-CjkI5aUy.js → terminal-relay-pSm7_An6.js} +1 -1
  279. package/dist/client/assets/{terminal-sessions-AmSgHklm.js → terminal-sessions-D4dHTRkt.js} +1 -1
  280. package/dist/client/assets/{terminal-takeover-7AvNpnkC.js → terminal-takeover-CtA3wcXh.js} +1 -1
  281. package/dist/client/assets/{runtime-picker-eDEvx2Mz.js → text-BR9Bap0E.js} +1 -1
  282. package/dist/client/assets/text-rLpBg4_z.css +1 -0
  283. package/dist/client/assets/{use-conversation-list-BCzY032j.js → use-conversation-list-C0bEXFeH.js} +1 -1
  284. package/dist/client/assets/{use-fleet-active-asks-CJ6-oj5k.js → use-fleet-active-asks-CK4aw-3G.js} +1 -1
  285. package/dist/client/assets/{use-mesh-ops-items-D5L-CKe_.js → use-mesh-ops-items-QixBijmT.js} +1 -1
  286. package/dist/client/assets/use-reduced-motion-BLn59zLn.js +1 -0
  287. package/dist/client/assets/{use-scout-dev-flags-BohC8seq.js → use-scout-dev-flags-JKb1EhFh.js} +1 -1
  288. package/dist/client/assets/{useAgentHoverCard-RsLUYyeh.js → useAgentHoverCard-6N8b7qsU.js} +1 -1
  289. package/dist/client/assets/useContentSecondaryNav-D-hVKzM9.js +1 -0
  290. package/dist/client/assets/{usePersistentState-D3M4m2Ou.js → usePersistentState-DOEahRlt.js} +1 -1
  291. package/dist/client/assets/{usePierreRuntime-B4hbNWTz.js → usePierreRuntime-Bq6mXrgd.js} +1 -1
  292. package/dist/client/assets/{wrench-M4G7WtYB.js → wrench-CQvdf7KT.js} +1 -1
  293. package/dist/client/assets/{x-ynOfVadO.js → x-BJyPzFnn.js} +1 -1
  294. package/dist/client/assets/{xterm-DZHyijPp.js → xterm-D6dE_wMr.js} +1 -1
  295. package/dist/client/assets/zap-rw7uwZht.js +1 -0
  296. package/dist/client/index.html +2 -2
  297. package/dist/main.mjs +629 -167
  298. package/dist/node/main.mjs +454 -270
  299. package/dist/pairing-runtime-controller.mjs +607 -357
  300. package/dist/runtime/base-daemon.mjs +384 -21
  301. package/dist/runtime/broker-daemon.mjs +11024 -10023
  302. package/dist/runtime/broker-process-manager.mjs +9 -3
  303. package/dist/runtime/mesh-discover.mjs +9 -3
  304. package/dist/scout-control-plane-web.mjs +1590 -984
  305. package/dist/scout-web-server.mjs +1590 -984
  306. package/package.json +4 -4
  307. package/dist/client/assets/ActivityScreen-aewI4Ul1.js +0 -1
  308. package/dist/client/assets/AgentAvatar-DMov24_o.js +0 -1
  309. package/dist/client/assets/AgentConfigurationScreen-BjG6ECjl.js +0 -1
  310. package/dist/client/assets/AgentDefinitionsWorkspace-D4MbSMXp.js +0 -1
  311. package/dist/client/assets/AgentFloorView-h9KDJdw0.js +0 -1
  312. package/dist/client/assets/AgentInfoScreen-SjhK_SBh.js +0 -1
  313. package/dist/client/assets/AgentLaneDetailSheet-DnAKe4e3.js +0 -4
  314. package/dist/client/assets/AgentLanesEmbedScreen-BNOYF16R.js +0 -1
  315. package/dist/client/assets/AgentLanesView-Ct-Gz5WD.js +0 -2
  316. package/dist/client/assets/AgentSessions-CDfSfNiE.js +0 -6
  317. package/dist/client/assets/AgentsConsole-BVxhBqRa.js +0 -1
  318. package/dist/client/assets/AgentsSubnav-CiIuzxnZ.js +0 -1
  319. package/dist/client/assets/BriefingDetailScreen-C83o2YfN.js +0 -6
  320. package/dist/client/assets/BrokerScreen-DplF8d_X.js +0 -5
  321. package/dist/client/assets/ChatCollapsedStrip-BRljIymi.js +0 -1
  322. package/dist/client/assets/ContextMenu-CxkmFQcN.js +0 -1
  323. package/dist/client/assets/ConversationComposer-CWohCCmn.js +0 -1
  324. package/dist/client/assets/ConversationFeedRows-IWh0JSIL.js +0 -1
  325. package/dist/client/assets/ConversationHeader-BxTzXl8e.js +0 -1
  326. package/dist/client/assets/ConversationPanels-D9UCwNkS.js +0 -2
  327. package/dist/client/assets/ConversationScreen-oZSitVtX.js +0 -1
  328. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +0 -1
  329. package/dist/client/assets/ConversationStatus-B6pAbo2w.js +0 -1
  330. package/dist/client/assets/DocumentFocusViewer-DRKjNG9s.js +0 -1
  331. package/dist/client/assets/FleetSearch-CYeWn85V.js +0 -1
  332. package/dist/client/assets/FleetSearch-EXOe8ulE.css +0 -1
  333. package/dist/client/assets/FlightObserveScreen-DYJJ3Z2B.js +0 -1
  334. package/dist/client/assets/HomeHero-BPBArHXa.js +0 -1
  335. package/dist/client/assets/HomeHero-DEl-WBsT.css +0 -1
  336. package/dist/client/assets/KnowledgeSearchScreen-BP8tD-Bh.js +0 -1
  337. package/dist/client/assets/LaneTraceDetailSheet-B4i1Ut4R.js +0 -1
  338. package/dist/client/assets/MessageComposerSuggestions-Dfc3PH2y.js +0 -1
  339. package/dist/client/assets/MessagesScreen-TgSL5KMc.js +0 -1
  340. package/dist/client/assets/MissionControlView-D629w2A8.js +0 -1
  341. package/dist/client/assets/MissionFocusOverlay-Bubrr8Gc.js +0 -1
  342. package/dist/client/assets/MissionLeftAgentRow-DokImu4Y.js +0 -1
  343. package/dist/client/assets/MissionLogPane-Cs0LuIkn.js +0 -1
  344. package/dist/client/assets/NewChatComposer-S08F6_La.js +0 -19
  345. package/dist/client/assets/ObserveEmbedScreen-CHx2sEAA.js +0 -2
  346. package/dist/client/assets/ObserveTextFlow-_ApDwRCO.js +0 -2
  347. package/dist/client/assets/ObservedTopologyPanel-ByW7Ar7p.js +0 -2
  348. package/dist/client/assets/OpenScoutAppShell-DTmnbG-h.js +0 -88
  349. package/dist/client/assets/OpsAgentsView-DiFuHcJs.js +0 -1
  350. package/dist/client/assets/OpsScreen-CCR3U_9P.js +0 -1
  351. package/dist/client/assets/OpsSubnav-CZs_OL2N.js +0 -1
  352. package/dist/client/assets/PlanView-C54eAzig.js +0 -1
  353. package/dist/client/assets/ProjectAgentProfile-BEfYOaxc.js +0 -1
  354. package/dist/client/assets/ProjectAgentProfileHero-B4f_AoCr.js +0 -1
  355. package/dist/client/assets/ProjectsInbox-DoPZ17FC.js +0 -2
  356. package/dist/client/assets/ProjectsRail-CWOkZjsY.js +0 -1
  357. package/dist/client/assets/ProjectsScreen-Dse0Q6p6.js +0 -1
  358. package/dist/client/assets/ProjectsThreadAside-DMnfyPLE.js +0 -1
  359. package/dist/client/assets/Provider-DKZWuzSR.js +0 -1
  360. package/dist/client/assets/RailRow-Cf9LOiEj.css +0 -1
  361. package/dist/client/assets/RailRow-DIGd3MMM.js +0 -1
  362. package/dist/client/assets/RawSessionsTable-Zkl4YDvz.js +0 -1
  363. package/dist/client/assets/RealtimeVoiceScreen-B_PMJxY_.js +0 -1
  364. package/dist/client/assets/RepoDiffViewer-VrUJw33u.js +0 -7
  365. package/dist/client/assets/RepoDiffViewerLazy-BPg_JkYW.js +0 -2
  366. package/dist/client/assets/ScoutDeckSurface-MbwGp6Ab.js +0 -1
  367. package/dist/client/assets/ScoutbotBroadcastChip-DAKQKB25.js +0 -2
  368. package/dist/client/assets/ScoutbotRealtimeVoiceCall-Br4bYVAx.js +0 -1
  369. package/dist/client/assets/SessionRefScreen-DLZNFZFK.js +0 -1
  370. package/dist/client/assets/SessionsScreen-D-hN1n4k.js +0 -1
  371. package/dist/client/assets/SettingsDrawer-BFsnww-k.js +0 -3
  372. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +0 -1
  373. package/dist/client/assets/SettingsScreen-Bc3Xtv5V.js +0 -1
  374. package/dist/client/assets/Terminal-D_OmdFmr.js +0 -1
  375. package/dist/client/assets/TerminalEmbedScreen-D21ytNXW.js +0 -1
  376. package/dist/client/assets/WorkFilesViewer-BDMNbxE4.js +0 -1
  377. package/dist/client/assets/agent-identity-BxCsXnDp.js +0 -1
  378. package/dist/client/assets/api-h5zurxmi.js +0 -1
  379. package/dist/client/assets/broker-display-pp33bLsu.js +0 -2
  380. package/dist/client/assets/collapsed-strip-Dz-of2SM.css +0 -1
  381. package/dist/client/assets/content-B-SUUhXj.js +0 -1
  382. package/dist/client/assets/content-BRY2vo1_.js +0 -1
  383. package/dist/client/assets/content-BTm0mVyD.js +0 -1
  384. package/dist/client/assets/content-BTqvyb5E.js +0 -1
  385. package/dist/client/assets/content-BjDaXmSD.js +0 -1
  386. package/dist/client/assets/content-BrR6deGh.js +0 -1
  387. package/dist/client/assets/content-C5yvBEMy.js +0 -1
  388. package/dist/client/assets/content-CkhG__-v.js +0 -1
  389. package/dist/client/assets/content-CudIBsiP.js +0 -1
  390. package/dist/client/assets/content-DBb7ppd5.js +0 -1
  391. package/dist/client/assets/content-DEw_kGyK.js +0 -1
  392. package/dist/client/assets/content-DIy0DCzK.js +0 -1
  393. package/dist/client/assets/content-THl9hRAo.js +0 -1
  394. package/dist/client/assets/content-vi9FbmV9.js +0 -1
  395. package/dist/client/assets/content-wcgPMGVf.js +0 -1
  396. package/dist/client/assets/conversation-model-CHwHZNw-.js +0 -1
  397. package/dist/client/assets/conversation-motion-features-zU0k3Agz.js +0 -1
  398. package/dist/client/assets/ctx-panel-B4s49N9e.css +0 -1
  399. package/dist/client/assets/discover-NDAqNvKt.js +0 -2
  400. package/dist/client/assets/embed-entry-BVR09F6e.js +0 -2
  401. package/dist/client/assets/home-moving-signal-C8dTXieA.js +0 -1
  402. package/dist/client/assets/home-moving-signal-CAa0V91u.css +0 -1
  403. package/dist/client/assets/home-now-card-BgvVcE83.js +0 -1
  404. package/dist/client/assets/hooks-DBIezYS2.js +0 -2
  405. package/dist/client/assets/index-BMwKgdz_.js +0 -1
  406. package/dist/client/assets/index-Bu-fckyR.css +0 -1
  407. package/dist/client/assets/index-BxoufAPA.js +0 -1
  408. package/dist/client/assets/index-Cj7NnSxI.js +0 -1
  409. package/dist/client/assets/index-CvF09yvf.css +0 -1
  410. package/dist/client/assets/index-o4FKpU7Z.js +0 -10
  411. package/dist/client/assets/inspector-panel-Dy2cVTCi.js +0 -2
  412. package/dist/client/assets/left-BC7p5QbT.js +0 -1
  413. package/dist/client/assets/left-BCSGqccQ.js +0 -1
  414. package/dist/client/assets/left-BSyj8PuJ.js +0 -2
  415. package/dist/client/assets/left-Bk3XnxPD.css +0 -1
  416. package/dist/client/assets/left-CCoobxPS.css +0 -1
  417. package/dist/client/assets/left-DDnxNUxd.js +0 -1
  418. package/dist/client/assets/left-DLoDKxT5.js +0 -2
  419. package/dist/client/assets/left-O-TBH7JB.js +0 -1
  420. package/dist/client/assets/left-agents-Dk9Y89lb.js +0 -1
  421. package/dist/client/assets/left-default-B3JBRQNJ.js +0 -1
  422. package/dist/client/assets/left-lanes-30Oe_3RM.js +0 -1
  423. package/dist/client/assets/left-mission-DEl4-7xu.js +0 -1
  424. package/dist/client/assets/left-plan-B4qdm4Gn.js +0 -2
  425. package/dist/client/assets/left-rvUOB14X.js +0 -1
  426. package/dist/client/assets/library-DDKSLFJ_.js +0 -1
  427. package/dist/client/assets/mentions-CvDaviLJ.js +0 -1
  428. package/dist/client/assets/mission-control-m3BTDQ9l.css +0 -1
  429. package/dist/client/assets/model-Co0zkMIc.js +0 -1
  430. package/dist/client/assets/plan-view-D56fneVF.css +0 -1
  431. package/dist/client/assets/profile-DW80Gn5k.js +0 -1
  432. package/dist/client/assets/projects-inbox-DCeD3FfV.js +0 -1
  433. package/dist/client/assets/resolve-panes-BDi9Qx4R.js +0 -1
  434. package/dist/client/assets/resolve-sidebar-context-HE-5eZYa.js +0 -1
  435. package/dist/client/assets/right-BDf_yTv6.js +0 -1
  436. package/dist/client/assets/right-C-bgjYg-.js +0 -1
  437. package/dist/client/assets/right-C3JdEfYQ.js +0 -1
  438. package/dist/client/assets/right-CYIs2tEe.js +0 -1
  439. package/dist/client/assets/right-CyRCv6Up.js +0 -1
  440. package/dist/client/assets/right-DBYGtoRv.js +0 -1
  441. package/dist/client/assets/right-o3LHMiKa.js +0 -1
  442. package/dist/client/assets/right-oPrcx9MX.js +0 -1
  443. package/dist/client/assets/right-sSvBUK-j.js +0 -1
  444. package/dist/client/assets/runtime-picker-vhm0gtLs.css +0 -1
  445. package/dist/client/assets/scout-voice-B7kXlkcl.js +0 -1
  446. package/dist/client/assets/secondaryNavConfig-CSFDCQAf.js +0 -1
  447. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +0 -1
  448. package/dist/client/assets/text-DsBWV_4k.js +0 -1
  449. package/dist/client/assets/use-reduced-motion-CqXpVXv-.js +0 -1
  450. package/dist/client/assets/useContentSecondaryNav-DOr5yHbT.js +0 -1
  451. /package/dist/client/assets/{document-focus-viewer-BSC_JwVE.css → DocumentFocusViewer-BSC_JwVE.css} +0 -0
@@ -1 +0,0 @@
1
- import{r as p,j as r}from"./index-o4FKpU7Z.js";/* empty css */import{i as J,n as Z,s as ee}from"./colors-BtO5_zlx.js";import{a as A}from"./api-h5zurxmi.js";import{u as te}from"./sse-CL6gctHY.js";import{t as re}from"./time-Dhsh_2EG.js";import{D as ne}from"./DataTable-CGw5CECG.js";import{u as ae}from"./useAgentHoverCard-RsLUYyeh.js";import{S as se}from"./search-7_n7CxWl.js";import{S as oe}from"./sliders-horizontal-D2Z8gz6J.js";import"./index-BWHgHrtv.js";/* empty css */import"./index-BMwKgdz_.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./Provider-DKZWuzSR.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./openContent-C6XO6kr5.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.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 Wt({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{Wt as OpsAgentsView};
@@ -1 +0,0 @@
1
- import{r as n,j as t}from"./index-o4FKpU7Z.js";/* empty css */import{u as d}from"./Provider-DKZWuzSR.js";/* empty css */import{u as v}from"./page-status-0LPfBC8S.js";import{A as x}from"./AgentLanesView-Ct-Gz5WD.js";import{MissionControlView as j}from"./MissionControlView-D629w2A8.js";import{OpsAgentsView as f}from"./OpsAgentsView-DiFuHcJs.js";import{PlanView as w}from"./PlanView-C54eAzig.js";import{AtopView as N}from"./AtopView-h_aFoNkP.js";import{TailView as c}from"./TailView-CufWcrvf.js";import{u as g}from"./useContentSecondaryNav-DOr5yHbT.js";import{OpsSubnav as S}from"./OpsSubnav-CZs_OL2N.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";/* empty css */import"./tail-events-NLIWLq27.js";import"./observe-3-jn4SXb.js";import"./types-B0PlfpKc.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./SessionObserve-DaUrJCMq.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-CcEiQC6B.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-CvDaviLJ.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./openContent-C6XO6kr5.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.js";import"./message-markup-BcY1lShv.js";import"./ObservedTopologyPanel-ByW7Ar7p.js";import"./ObserveTextFlow-_ApDwRCO.js";import"./use-reduced-motion-CqXpVXv-.js";import"./SessionObserveEvidence-ClUW8jpV.js";import"./message-circle-BM3XgevU.js";import"./wrench-M4G7WtYB.js";import"./external-link-Dem738OJ.js";import"./AgentFloorView-h9KDJdw0.js";/* empty css */import"./agent-lanes-model-VYQ5a68i.js";import"./context-budget-DX_fwUs3.js";import"./lane-roster-store-BiIVlYmG.js";import"./AgentLanesPreflight-M7iDXdP2.js";import"./AgentLaneChrome-D1xNNf7A.js";import"./AgentLaneCard-C4DMQR-c.js";/* empty css */import"./AgentLaneSummaryResize-C9loK-st.js";import"./clipboard-e3fSpeo7.js";import"./agent-lane-card-model-q4cwzLX4.js";import"./agent-lane-preview-C33Dwpn7.js";import"./AgentLaneDetailSheet-DnAKe4e3.js";import"./SlidePanel-CuTeirnk.js";import"./agent-lane-detail-BNNm6FNu.js";import"./LaneTraceDetailSheet-B4i1Ut4R.js";import"./LaneTraceEventFocus-Bl9L0EYb.js";/* empty css */import"./mission-control-store-C6w5iVfg.js";import"./MissionContextRail-CjGAEGu8.js";import"./mission-wall-CocIM1cF.js";import"./mission-control-model-C0fByIjm.js";import"./MissionFocusOverlay-Bubrr8Gc.js";import"./MissionLogPane-Cs0LuIkn.js";/* empty css */import"./DataTable-CGw5CECG.js";/* empty css */import"./useAgentHoverCard-RsLUYyeh.js";import"./sliders-horizontal-D2Z8gz6J.js";/* empty css *//* empty css */import"./SecondaryNav-Dj30epYF.js";import"./secondaryNavConfig-CSFDCQAf.js";import"./message-square-ER1_q2pe.js";import"./scroll-text-BuneRiAD.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),[m,s]=n.useState(o?"enter":"hidden"),e=n.useRef(null);if(n.useEffect(()=>{if(o){e.current&&(clearTimeout(e.current),e.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"),e.current=setTimeout(()=>{s("hidden"),p(null),e.current=null},A),()=>{e.current&&(clearTimeout(e.current),e.current=null)}},[o,r.hover,r.content]),m==="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--${m}`,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 Lr({navigate:r,mode:o="mission",tailQuery:i}){const{agents:p,route:m}=d(),s=g(),e=m.view==="ops"&&m.mode==="plan"?m.planDocumentId:void 0;return t.jsxs("div",{className:"s-ops",children:[s?t.jsx("div",{className:"s-ops-header",children:t.jsx(S,{activeRoute:m,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==="plan"&&t.jsx(w,{navigate:r,agents:p,selectedPlanDocumentId:e}),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{Lr as OpsScreen};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-o4FKpU7Z.js";import{S as p}from"./SecondaryNav-Dj30epYF.js";import{O as i}from"./secondaryNavConfig-CSFDCQAf.js";/* empty css */import"./createLucideIcon-Bt67PWH-.js";import"./message-square-ER1_q2pe.js";import"./file-text-iF0hyVyU.js";import"./search-7_n7CxWl.js";import"./terminal-By1Lw2i2.js";import"./code-xml-CLn3TDWF.js";import"./scroll-text-BuneRiAD.js";function j({activeRoute:r,navigate:o}){return t.jsx(p,{ariaLabel:"Ops sections",activeRoute:r,groups:i,navigate:o})}export{j as OpsSubnav};
@@ -1 +0,0 @@
1
- import{r as a,j as e}from"./index-o4FKpU7Z.js";/* empty css *//* empty css */import{c as w,T as y}from"./TextDocumentSurface-Bc-kHPgG.js";import{a as k}from"./api-h5zurxmi.js";import{u as S}from"./sse-CL6gctHY.js";import{t as T,f as C}from"./time-Dhsh_2EG.js";import"./index-BWHgHrtv.js";const E={active:"Active",archived:"Archived",blocked:"Blocked",completed:"Complete",draft:"Draft",unknown:"Unknown"},$={active:"var(--green)",archived:"var(--dim)",blocked:"var(--amber)",completed:"var(--muted)",draft:"var(--accent)",unknown:"var(--dim)"};function A(s){switch(s.source){case"claude":return"Claude";case"codex":return"Codex";case"openscout":return"OpenScout";case"workspace":return"Workspace";case"unknown":return"Other"}}function I({navigate:s,agents:c,selectedPlanDocumentId:r}){const[l,h]=a.useState(null),[i,x]=a.useState(!0),[v,g]=a.useState(null),j=a.useRef(0),m=a.useCallback(async()=>{const t=++j.current;x(!0);const o=await Promise.resolve(k("/api/plan-documents")).then(d=>({status:"fulfilled",value:d})).catch(d=>({status:"rejected",reason:d}));if(t!==j.current)return;o.status==="fulfilled"&&h(o.value);const b=[o.status==="rejected"?`plans: ${o.reason instanceof Error?o.reason.message:String(o.reason)}`:null].filter(d=>!!d);g(b.length>0?b.join(" · "):null),x(!1)},[]);a.useEffect(()=>{m()},[m]),S(()=>{m()});const N=a.useMemo(()=>Object.fromEntries(c.map(t=>[t.id,t])),[c]),n=l?.documents??[],f=a.useMemo(()=>n.find(t=>t.id===r)??n[0]??null,[n,r]);a.useEffect(()=>{n.length>0&&(!r||!n.some(t=>t.id===r))&&s({view:"ops",mode:"plan",planDocumentId:n[0].id})},[n,s,r]);const u=a.useMemo(()=>{const t={claude:0,codex:0,openscout:0,workspace:0,unknown:0};for(const o of n)t[o.source]+=1;return t},[n]);return e.jsx("div",{className:"s-plan",children:e.jsxs("div",{className:"s-plan-inner s-plan-inner--documents",children:[e.jsxs("header",{className:"s-plan-banner",children:[e.jsx("span",{className:"s-plan-banner-badge",children:"Plan Documents"}),e.jsx("span",{className:"s-plan-banner-meta",children:i&&n.length===0?"indexing plan documents...":`${n.length} document${n.length===1?"":"s"} · ${u.claude} Claude · ${u.codex} Codex · ${u.openscout} OpenScout · ${u.workspace} workspace`}),l&&e.jsxs("span",{className:"s-plan-banner-meta",children:[l.roots.length," roots · updated ",T(l.generatedAt)]}),v&&e.jsxs("span",{className:"s-plan-banner-meta s-plan-banner-meta--error",children:["partial data · ",v]}),e.jsx("span",{className:"s-plan-banner-spacer"}),e.jsx("button",{className:"s-ops-btn",onClick:()=>{m()},disabled:i,children:i?"Indexing...":"Refresh"})]}),e.jsx("main",{className:"s-plan-col s-plan-col--canvas",children:f?e.jsx(L,{document:f,agentsById:N}):e.jsxs("div",{className:"s-plan-empty-card",children:[e.jsx("div",{className:"s-plan-empty-title",children:"No plan document selected"}),e.jsx("div",{className:"s-plan-empty-copy",children:"The plan inventory will appear here once the index finds documents."})]})})]})})}function L({document:s,agentsById:c}){const[r,l]=a.useState("preview"),h=s.agentId?c[s.agentId]:null,i=a.useMemo(()=>w({id:s.id,title:s.title,uri:s.path,filename:s.path,mediaType:"text/markdown",kind:"markdown",value:s.body||s.rawText,readOnly:!0}),[s]);return a.useEffect(()=>{l("preview")},[s.id]),e.jsxs("div",{className:"s-plan-document",children:[e.jsxs("div",{className:"s-plan-readonly-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"s-ops-eyebrow",children:"Plan document"}),e.jsx("h1",{className:"s-plan-title",children:s.title}),s.summary&&e.jsx("p",{className:"s-plan-goal",children:s.summary})]}),e.jsx("span",{className:"s-ops-state-chip",style:{color:$[s.status]},children:E[s.status]})]}),e.jsxs("section",{className:"s-plan-doc-section s-plan-doc-section--primary",children:[e.jsxs("div",{className:"s-plan-tree-header",children:[e.jsx("div",{className:"s-ops-eyebrow",style:{marginBottom:0},children:"Document"}),e.jsxs("span",{className:"s-plan-tree-stats",children:[s.body.length.toLocaleString()," chars · ",s.path]}),e.jsxs("div",{className:"s-plan-tree-toggle s-plan-doc-mode-toggle",children:[e.jsx("button",{type:"button",className:`s-plan-tree-toggle-btn${r==="preview"?" s-plan-tree-toggle-btn--active":""}`,onClick:()=>l("preview"),children:"Preview"}),e.jsx("button",{type:"button",className:`s-plan-tree-toggle-btn${r==="source"?" s-plan-tree-toggle-btn--active":""}`,onClick:()=>l("source"),children:"Source"})]})]}),r==="preview"?e.jsx(y,{document:i,mode:"preview",className:"s-plan-doc-preview s-plan-doc-body--primary"}):e.jsx("pre",{className:"s-plan-doc-body s-plan-doc-body--primary",children:s.body||s.rawText})]}),e.jsxs("section",{className:"s-plan-doc-section",children:[e.jsx("div",{className:"s-ops-eyebrow",children:"Provenance"}),e.jsxs("dl",{className:"s-plan-doc-meta",children:[e.jsx(p,{label:"Source",value:`${A(s)} · ${s.confidence}`}),e.jsx(p,{label:"Path",value:s.path}),e.jsx(p,{label:"Workspace",value:s.workspaceName??s.provenance.root}),e.jsx(p,{label:"Agent",value:s.agentName??h?.name??s.agentId??"unassigned"}),e.jsx(p,{label:"Updated",value:C(s.updatedAt)||"unknown"})]})]})]})}function p({label:s,value:c}){return e.jsxs("div",{className:"s-plan-doc-meta-row",children:[e.jsx("dt",{children:s}),e.jsx("dd",{title:c,children:c})]})}export{I as PlanView};
@@ -1 +0,0 @@
1
- import{r as m,j as o}from"./index-o4FKpU7Z.js";import{a as A}from"./api-h5zurxmi.js";import{u as b,e as S}from"./Provider-DKZWuzSR.js";import{d as y}from"./router-C65cZYPn.js";import{u as P}from"./sse-CL6gctHY.js";import{AgentsSubnav as N}from"./AgentsSubnav-CiIuzxnZ.js";import{AgentDetailWithRail as B,AgentProfileSessionsCenter as E}from"./profile-DW80Gn5k.js";import{r as R,d as C,b as M}from"./model-Co0zkMIc.js";/* empty css *//* empty css *//* empty css */import{ProjectAgentProfileBar as w}from"./ProjectAgentProfileBar-B1VpwzGD.js";/* empty css */import"./provider-BvAxRQfE.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./index-BWHgHrtv.js";import"./SecondaryNav-Dj30epYF.js";import"./secondaryNavConfig-CSFDCQAf.js";import"./message-square-ER1_q2pe.js";import"./terminal-By1Lw2i2.js";import"./scroll-text-BuneRiAD.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-_QfQ7fhZ.js";import"./terminal-relay-CjkI5aUy.js";import"./BackToPicker-BXp5E2ck.js";import"./openContent-C6XO6kr5.js";import"./ConversationScreen-oZSitVtX.js";import"./ConversationComposer-CWohCCmn.js";import"./message-markup-BcY1lShv.js";import"./mentions-CvDaviLJ.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./eye-B3lBIwJZ.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";import"./ConversationHeader-BxTzXl8e.js";import"./ConversationFeedRows-IWh0JSIL.js";import"./ConversationPanels-D9UCwNkS.js";import"./use-reduced-motion-CqXpVXv-.js";import"./activity-BvGruxWG.js";import"./message-circle-BM3XgevU.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-NLIWLq27.js";import"./ConversationStatus-B6pAbo2w.js";import"./SessionObserve-DaUrJCMq.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-CcEiQC6B.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-ByW7Ar7p.js";import"./ObserveTextFlow-_ApDwRCO.js";import"./SessionObserveEvidence-ClUW8jpV.js";import"./wrench-M4G7WtYB.js";import"./external-link-Dem738OJ.js";/* empty css */import"./AgentDefinitionsWorkspace-D4MbSMXp.js";import"./text-DsBWV_4k.js";import"./project-overview-helpers-BQTc_Ous.js";import"./FileViewerPane-BM4AD_bo.js";import"./agent-essentials-yb4wIJlX.js";import"./model-IGCUEsMy.js";import"./agents-project-model-UYiamtrU.js";function No({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{No as ProjectAgentProfile};
@@ -1 +0,0 @@
1
- import{r as c,j as e}from"./index-o4FKpU7Z.js";import{i as y,c as L}from"./colors-BtO5_zlx.js";import{a as u}from"./api-h5zurxmi.js";import{u as T}from"./sse-CL6gctHY.js";import{t as P}from"./time-Dhsh_2EG.js";import{o as R}from"./openContent-C6XO6kr5.js";import{A as E}from"./AgentAvatar-DMov24_o.js";import{H as O}from"./HarnessMark-MztYnrGK.js";import{n as V}from"./model-Co0zkMIc.js";import{h as B}from"./model-IGCUEsMy.js";import"./index-BWHgHrtv.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./text-DsBWV_4k.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 o=s.model?.trim();if(!o)return null;const a=s.harness?.trim();return a&&o.startsWith(`${a}-`)?o.slice(a.length+1).replace(/-\d{8}$/,""):o.replace(/^claude-/,"").replace(/-\d{8}$/,"")}function g(s){const o=new Map;for(const a of s){if(a.kind!=="tool"||!a.tool)continue;const l=a.tool.toLowerCase();o.set(l,(o.get(l)??0)+1)}return[...o.entries()].sort((a,l)=>l[1]-a[1]||a[0].localeCompare(l[0])).map(([a])=>a).slice(0,6)}function r({label:s,value:o,title:a}){return o?.trim()?e.jsxs("div",{className:"av2-coreMetaItem",title:a??o,children:[e.jsx("span",{className:"av2-coreMetaLabel",children:s}),e.jsx("span",{className:"av2-coreMetaValue",children:o})]}):null}function os({agent:s,route:o,navigate:a}){const[l,h]=c.useState(null),[C,v]=c.useState(null),p=c.useCallback(async()=>{const[t,n]=await Promise.all([u(`/api/agents/${encodeURIComponent(s.id)}/observe`).catch(()=>null),u(`/api/agents/${encodeURIComponent(s.id)}/session-catalog`).catch(()=>null)]);h(t),v(n)},[s.id]);c.useEffect(()=>{h(null),v(null),p()},[p]),T(()=>{p()});const d=s.handle?.trim().replace(/^@+/,"")||null,j=d?`@${d}`:s.name,i=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=l?.data.events??[],m=c.useMemo(()=>g(x),[x]),f=l?.data.metadata?.usage??null,N=(()=>{const t=f?.contextWindowTokens??0,n=f?.contextInputTokens??0;return!t||t<=0||n<=0?null:Math.min(100,Math.max(0,Math.round(n/t*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 t=await u("/api/sessions",{method:"POST",body:JSON.stringify(V(s))}),n=t.sessionId?.trim();if(n){R(a,{view:"sessions",sessionId:n},{returnTo:o});return}const b=t.conversationId?.trim();a({...o,view:"agents-v2",agentId:t.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)}`:""]}),d&&s.name.toLowerCase()!==d.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:()=>a({...o,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(r,{label:"Project",value:s.project?`/${s.project}`:null}),e.jsx(r,{label:"Branch",value:s.branch}),e.jsx(r,{label:"Harness",value:i?i.charAt(0).toUpperCase()+i.slice(1):null,title:s.harness??void 0}),e.jsx(r,{label:"Model",value:H}),e.jsx(r,{label:"Host",value:M||null}),e.jsx(r,{label:"Root",value:w,title:s.cwd??s.projectRoot??void 0}),e.jsx(r,{label:"Transport",value:$})]}),e.jsxs("div",{className:"av2-profileHeroSignal",children:[i?e.jsx("span",{className:"av2-signalMark",title:s.harness??i,children:e.jsx(O,{harness:i,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,m.length>0?e.jsxs("span",{className:"av2-signalChip av2-signalChip--wide",title:m.join(" · "),children:[e.jsx("span",{className:"av2-signalLabel",children:"Tools"}),e.jsx("span",{className:"av2-signalValue",children:m.join(" · ")})]}):l?e.jsxs("span",{className:"av2-signalChip",children:[e.jsx("span",{className:"av2-signalLabel",children:"Tools"}),e.jsx("span",{className:"av2-signalValue",children:"—"})]}):null]})]})]})}export{os as ProjectAgentProfileHero};
@@ -1,2 +0,0 @@
1
- import{r as p,j as s}from"./index-o4FKpU7Z.js";import{A as Fe}from"./AgentAvatar-DMov24_o.js";import{H as be}from"./HarnessMark-MztYnrGK.js";import{a as $e}from"./api-h5zurxmi.js";import{g as ie,a as De,f as ae,b as Oe}from"./api-BkjHJfgJ.js";import{r as ve,i as Be}from"./ui-LM8pS8qE.js";import{t as q,d as He,n as se}from"./time-Dhsh_2EG.js";import{p as ze,l as qe,s as _e,f as Ve}from"./terminal-sessions-AmSgHklm.js";import{u as Ge,A as Ke}from"./Provider-DKZWuzSR.js";import{o as Ue}from"./openContent-C6XO6kr5.js";import{p as Z}from"./model-Co0zkMIc.js";import{SessionRefScreen as Je}from"./SessionRefScreen-DLZNFZFK.js";import{F as we,A as Xe}from"./AddProjectForm-Czb5uwou.js";import{r as J,s as _}from"./project-overview-helpers-BQTc_Ous.js";import{u as Ze,e as Y,d as le,g as Qe,s as ce,a as de,f as Ye,h as Ne,b as es,j as ss,r as ts}from"./projects-inbox-DCeD3FfV.js";import{f as ns}from"./cache-Dr0why2k.js";import{A as ue}from"./arrow-up-right-hoR8_oUz.js";import{S as ke}from"./search-7_n7CxWl.js";import{C as is}from"./chevron-right-C10o7t_X.js";import{E as as}from"./external-link-Dem738OJ.js";import{F as os}from"./DocumentFocusViewer-DRKjNG9s.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./colors-BtO5_zlx.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./TextDocumentSurface-Bc-kHPgG.js";import"./file-text-iF0hyVyU.js";import"./createLucideIcon-Bt67PWH-.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./x-ynOfVadO.js";import"./chevron-down-NAhBUkFd.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./text-DsBWV_4k.js";import"./tail-events-NLIWLq27.js";import"./BackToPicker-BXp5E2ck.js";import"./ConversationScreen-oZSitVtX.js";import"./ConversationComposer-CWohCCmn.js";import"./message-markup-BcY1lShv.js";import"./mentions-CvDaviLJ.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-BxTzXl8e.js";import"./ConversationFeedRows-IWh0JSIL.js";/* empty css */import"./ConversationPanels-D9UCwNkS.js";import"./use-reduced-motion-CqXpVXv-.js";import"./activity-BvGruxWG.js";import"./message-circle-BM3XgevU.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./ConversationStatus-B6pAbo2w.js";import"./SessionObserve-DaUrJCMq.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-CcEiQC6B.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-ByW7Ar7p.js";import"./ObserveTextFlow-_ApDwRCO.js";import"./SessionObserveEvidence-ClUW8jpV.js";import"./wrench-M4G7WtYB.js";/* empty css */import"./agents-project-model-UYiamtrU.js";import"./model-IGCUEsMy.js";function pe(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:_e(t),sessionName:t.sessionName}}function cs(e,t){const i=pe(t.agentId),n=new Set(t.sessionRefs.map(pe).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(l=>n.has(l.sessionName));if(a)return ls(r,a)}return null}function ds(e,t){const i=ze(e.terminalSurfaceKey);return i?`scout://terminal?${new URLSearchParams({session:e.terminalSessionId,surface:qe(i),mode:t}).toString()}`:null}const us=1e4,ps=2e4,hs=6e4,ms=15e3,fs=45e3,js=["branch","unstaged","staged"];function ee(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 Q(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=p.useMemo(()=>i?i.split("\0"):[],[i]),[o,r]=p.useState(()=>ie()),[a,l]=p.useState(()=>De()),[c,g]=p.useState(!!(e&&!J(o,e))),[x,N]=p.useState(!!e),[S,j]=p.useState(!!e),[T,M]=p.useState(null),[y,F]=p.useState(null),[O,$]=p.useState(()=>new Map),[E,L]=p.useState(()=>new Map),[C,k]=p.useState(0),b=p.useRef(null),h=p.useCallback(()=>{b.current=null,k(f=>f+1)},[]);p.useEffect(()=>{if(!e){g(!1),M(null);return}let f=!1,v=!1,P=!0;const D=async()=>{if(v)return;v=!0,f||(g(!0),M(null));let B=null;try{let W=null;const H=C>0&&P;P=!1;try{W=await ae("standard",H,ms)}catch(R){B=Q(R)}if((!W||!J(W,e))&&b.current!==e){b.current=e;try{const R=await ae("expanded",H,fs);J(R,e)&&(W=R)}catch(R){B=Q(R)}}!f&&W&&r(R=>J(W,e)?W:R&&J(R,e)?R:W),!f&&!J(W,e)&&M(B??"Repo Watch did not include this project in its latest scan.")}finally{v=!1,f||g(!1)}};D();const u=window.setInterval(()=>{document.visibilityState==="visible"&&D()},us),I=ee(()=>{D()});return()=>{f=!0,window.clearInterval(u),I()}},[e,C]),p.useEffect(()=>{if(n.length===0){j(!1),L(new Map);return}let f=!1,v=!1,P=!0;const D=async()=>{if(v)return;v=!0,f||j(!0);const B=await Promise.allSettled(n.map(W=>ns(W,[...js],{force:C>0&&P,tier:"summary"})));if(P=!1,!f){const W=new Map,H=new Map;B.forEach((R,K)=>{const V=n[K];R.status==="fulfilled"?W.set(V,R.value.snapshot):H.set(V,Q(R.reason))}),$(R=>{const K=new Map(R);for(const V of n)K.delete(V);for(const[V,te]of W)K.set(V,te);return K}),L(H),j(!1)}v=!1};D();const u=window.setInterval(()=>{document.visibilityState==="visible"&&D()},ps),I=ee(()=>{D()});return()=>{f=!0,window.clearInterval(u),I()}},[n,C]),p.useEffect(()=>{if(n.length===0){N(!1),F(null);return}let f=!1,v=!1;const P=async()=>{if(!v){v=!0;try{const I=await Oe(n);f||(l(I),F(null))}catch(I){f||F(Q(I))}finally{v=!1,f||N(!1)}}};N(!0),F(null),P();const D=window.setInterval(()=>{document.visibilityState==="visible"&&P()},hs),u=ee(()=>{P()});return()=>{f=!0,window.clearInterval(D),u()}},[n,C]);const d=p.useMemo(()=>J(o,e),[e,o]),m=p.useMemo(()=>e?(a?.pullRequests??[]).filter(f=>bs(f,e,d)):[],[d,e,a]),A=p.useMemo(()=>{const f=a?.paths.some(v=>n.includes(v))?a.warnings:[];return y?[y,...f]:f},[n,y,a]);return{project:d,pullRequests:m,pullRequestsLoading:x,pullRequestWarnings:A,repoLoading:c,repoError:T,diffSnapshots:O,diffErrors:E,diffLoading:S,refresh:h}}function ws(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 Ns=p.memo(function({thread:t,crossProject:i,selected:n,cursor:o,nowMs:r,onSelect:a,onOpen:l,rowRef:c,workLabel:g}){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:l,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:g??t.work}),s.jsxs("span",{className:"pi-rowAttr",children:[s.jsx("span",{className:"pi-rowAvatar",children:s.jsx(Fe,{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(be,{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?q(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(is,{size:14,strokeWidth:1.8})]})]})},ws);function he({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 ks({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 Ss({route:e,navigate:t,slug:i,model:n,mode:o,repoProject:r}){const a=n.projects.find(y=>y.slug===i)??null,l=Y(n.threads,i),c=l.filter(y=>y.kind==="agent"),g=a?.title??i,x=a?.root??null,N=(a?.agentCount??c.length)>1,S=e.machineId?{machineId:e.machineId}:{},j={view:"agents-v2",projectSlug:i,...S},T=ys(a?.needs??0,a?.working??0,l.length),M=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:g}),s.jsxs("div",{className:"pi-projectMeta",children:[x?s.jsx("span",{title:x,children:_(x)}):null,s.jsx("span",{className:"pi-projectDigest",children:T})]})]})}),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(j),children:s.jsx("span",{children:"Overview"})}),s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="sessions"||void 0,onClick:()=>t({...j,indexView:"sessions"}),children:[s.jsx("span",{children:"Sessions"}),s.jsx("b",{children:a?.sessionCount??0})]}),N?s.jsxs("button",{type:"button",className:"pi-projectFacet","data-selected":o==="agents"||void 0,onClick:()=>t({...j,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",...x?{root:x}:{},...S}),children:[s.jsx("span",{children:"Worktrees"}),s.jsx("b",{children:M}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]}),s.jsxs("button",{type:"button",className:"pi-projectFacet",disabled:!x,title:x?"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:x?"set":"—"}),s.jsx(ue,{className:"pi-projectFacetOut",size:11,strokeWidth:2,"aria-hidden":!0})]})]})]})}function ys(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 Se(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 Cs(e,t){return`${t?0:e.projects.length} tracked`}function As({route:e,navigate:t,projects:i}){const{onboarding:n,refreshOnboarding:o,reload:r}=Ge(),a=Rs(n?.defaultHarness),[l,c]=p.useState(""),[g,x]=p.useState(""),[N,S]=p.useState(a),[j,T]=p.useState(!1),[M,y]=p.useState(null),[F,O]=p.useState(null),[$,E]=p.useState(null);p.useEffect(()=>{S(a)},[a]);const L=p.useMemo(()=>Ts(i),[i]),C=p.useMemo(()=>Ls(L,l),[l,L]),k=p.useMemo(()=>L.find(u=>u.slug===g)??fe(L,l),[l,L,g]),b=l.trim(),h=Ms(b)&&!fe(L,b),d=k??(!h&&b?C[0]??null:null),m=d?"Open project":h?"Create project":"Find project",A=!!(d||h||b);p.useEffect(()=>{g&&(L.some(u=>u.slug===g)||x(""))},[L,g]),p.useEffect(()=>{if(!$)return;const u=L.find(I=>Es(I,$));u&&(E(null),t(me(e,u.slug)))},[$,t,L,e]);const f=u=>{x(u.slug),c(u.title),y(null),O(null)},v=u=>{t(me(e,u.slug))},P=async u=>{T(!0),y(null),O(null);try{await $e("/api/onboarding/project",{method:"POST",body:JSON.stringify({contextRoot:u,sourceRoots:[u],defaultHarness:N})}),E(u),O("Project created. Refreshing inventory."),x(""),c(""),ts(),await Promise.all([o(),r()])}catch(I){y(I instanceof Error?I.message:"Could not create project.")}finally{T(!1)}},D=u=>{if(u.preventDefault(),!j){if(d){v(d);return}if(h){P(b);return}if(b){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(we,{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:D,children:[s.jsxs("div",{className:"pi-zeroBar",children:[s.jsxs("label",{className:"pi-zeroSelect",children:[s.jsx(ke,{size:13,strokeWidth:1.8,"aria-hidden":!0}),s.jsxs("select",{value:g,"aria-label":"Choose project",onChange:u=>{const I=L.find(B=>B.slug===u.currentTarget.value);I?f(I):x("")},children:[s.jsx("option",{value:"",children:"Choose project"}),L.slice(0,80).map(u=>s.jsx("option",{value:u.slug,children:u.title},u.slug))]})]}),s.jsx("div",{className:"pi-zeroHarness",role:"group","aria-label":"Default harness",children:["claude","codex"].map(u=>s.jsx("button",{type:"button","data-on":N===u||void 0,onClick:()=>S(u),children:u==="claude"?"Claude":"Codex"},u))})]}),s.jsxs("div",{className:"pi-zeroInputRow",children:[s.jsx("textarea",{value:l,rows:2,placeholder:"Find project or paste /path/to/repo","aria-label":"Find or create project",onChange:u=>{c(u.currentTarget.value),x(""),y(null),O(null)},onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),u.currentTarget.form?.requestSubmit())}}),s.jsxs("button",{type:"submit",className:"pi-zeroSend",disabled:j||!A,title:m,children:[s.jsx(Ke,{size:15,strokeWidth:2,"aria-hidden":!0}),s.jsx("span",{children:j?"Working":m})]})]}),C.length>0?s.jsx("div",{className:"pi-zeroMatches","aria-label":"Matching projects",children:C.map(u=>s.jsxs("button",{type:"button",className:"pi-zeroMatch","data-selected":k?.slug===u.slug||void 0,onClick:()=>f(u),onDoubleClick:()=>v(u),children:[s.jsxs("span",{className:"pi-zeroMatchMain",children:[s.jsxs("span",{className:"pi-zeroMatchTitle",children:["/",u.title]}),s.jsx("span",{className:"pi-zeroMatchRoot",title:u.root??void 0,children:u.root?_(u.root):u.slug})]}),s.jsx("span",{className:"pi-zeroMatchMeta",children:Is(u)})]},u.slug))}):b?s.jsx("div",{className:"pi-zeroEmpty",children:"No project matches."}):null,M?s.jsx("div",{className:"pi-zeroError",children:M}):null,F?s.jsx("div",{className:"pi-zeroStatus",children:F}):null]})]})}function Rs(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 Ts(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 Ls(e,t){const i=z(t);return i?e.map(n=>({option:n,score:Ps(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 fe(e,t){const i=z(t);return i?e.find(n=>{const o=z(n.root??""),r=z(n.root?Z(n.root):"");return z(n.title)===i||z(n.slug)===i||o===i||r===i||z(n.root?_(n.root):"")===i})??null:null}function Ps(e,t){const i=z(e.title),n=z(e.slug),o=z(e.root??""),r=z(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 z(e){return e.trim().toLowerCase().replace(/^~(?=\/)/u,"").replace(/\s+/g," ")}function Ms(e){const t=e.trim();return/^(~\/|\/|\.{1,2}\/)/u.test(t)||t.includes("/")}function Es(e,t){const i=z(t);return i?[e.root??"",e.root?_(e.root):"",e.root?Z(e.root):"",e.slug,e.title].map(z).some(o=>o===i||o.endsWith(i)):!1}function Is(e){return[je(e.agentCount,"agent"),je(e.sessionCount,"session"),e.lastActivityAt?q(e.lastActivityAt):null].filter(Boolean).join(" · ")}function je(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 xe(e){return/^native:process:/iu.test(e??"")}function Fs(e){return e.startsWith("/")||e.startsWith("~/")||e.includes("/")&&/\.(jsonl?|events)$/i.test(e)}function ye(e,t,i){const n=e?.trim()??"";return!n||Fs(n)?t:n}function $s({session:e,sessionRef:t,threads:i,lookup:n,route:o,navigate:r,nowMs:a}){const[l,c]=p.useState(null),g=e?.agentName??o.selectedAgentId??o.agentId??"Session",x=e?.harness??"session",N=n?.kind==="observe"?n.observe.data:null,S=N?.metadata?.session,j=e?.lastActivityAt??n?.session?.lastMessageAt??null,[T,M,y]=p.useMemo(()=>[re(N),Ae(N,j),zs(N,j)],[N,j]),F=S?.gitBranch??n?.session?.currentBranch??e?.branch??null,O=S?.model??null,$=S?.turnCount??N?.metadata?.usage?.assistantMessages??(n?.kind==="conversation"?n.session.messageCount:null),E=M?q(M,a):e?.lastActivityAt?q(e.lastActivityAt,a):"—",L=e?.working?`live · last ${E}`:E!=="—"?`last ${E}`:"trace resolving",C=ye(e?.work,g),k=Se(t),b=n?.session??null,h=n?.kind==="observe"?n.observe.agentId??b?.agentId??e?.agentId:b?.agentId??e?.agentId,d=n?.kind==="observe"?n.observe.sessionId:b?.harnessSessionId,m=[g,x,O,F,T?`started ${He(T)}`:null,y,$!=null?`turn ${w($)}`:null,k].filter(v=>!!v&&v!=="—");p.useEffect(()=>{let v=!0;return c(null),!h&&!d&&!t?()=>{v=!1}:(Ve({includeDiscovered:!0}).then(P=>{v&&c(cs(P,{agentId:h,sessionRefs:[t,d,e?.sessionId]}))}).catch(()=>{v&&c(null)}),()=>{v=!1})},[e?.sessionId,t,h,d]);const A=()=>{l&&Ue(r,{view:"terminal",terminalSessionId:l.terminalSessionId,terminalSurfaceKey:l.terminalSurfaceKey,mode:"takeover"},{returnTo:o})},f=l?ds(l,"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:C,children:C}),s.jsxs("span",{className:"pi-sessionState",children:[e?.working?s.jsx("span",{className:"pi-sessionLiveDot","aria-hidden":!0}):null,L]})]}),s.jsx("div",{className:"pi-sessionMeta",children:m.map((v,P)=>s.jsxs("span",{title:P===m.length-1?t:v,children:[P===1?s.jsx(be,{harness:x,size:11}):null,v]},`${v}:${P}`))}),l?s.jsxs("div",{className:"pi-sessionTerminalActions","aria-label":"tmux terminal actions",children:[s.jsxs("span",{className:"pi-sessionTerminalName",title:l.sessionName,children:["tmux · ",l.sessionName]}),s.jsx("button",{type:"button",onClick:A,children:"Open in web terminal"}),f?s.jsxs("a",{href:f,children:["Open in native terminal",s.jsx(as,{size:11,strokeWidth:1.8,"aria-hidden":!0})]}):null]}):null]}),s.jsx(Js,{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,l]=p.useState(null);return p.useEffect(()=>{l(null)},[t]),s.jsx("main",{className:"pi-sessionDetail","aria-label":"Selected session",children:s.jsxs("div",{className:"pi-sessionContent",children:[s.jsx($s,{session:e,sessionRef:t,threads:i,lookup:a,route:n,navigate:o,nowMs:r}),s.jsx(Je,{sessionRef:t,navigate:o,showObserveRail:!1,onLookup:l})]})})}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 Ce(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 Bs(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}: ${Ce(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 re(e){const t=se(e?.metadata?.session?.sessionStart);if(t!==null)return t;for(const i of e?.events??[]){const n=se(i.at);if(n!==null)return n}return null}function Ae(e,t){for(let o=(e?.events.length??0)-1;o>=0;o-=1){const r=se(e?.events[o]?.at);if(r!==null)return r}const i=re(e),n=e?.events.at(-1)?.t;return i!==null&&typeof n=="number"&&Number.isFinite(n)?i+n*1e3:se(t)}function zs(e,t){const i=re(e),n=Ae(e,t);if(i!==null&&n!==null)return oe(Math.max(0,n-i))||"—";const o=e?.events.at(-1)?.t;return typeof o=="number"&&Number.isFinite(o)&&oe(o*1e3)||"—"}function oe(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 qs(e){const t=e?.metadata?.topology;if(!t)return null;const i=t.agents.length,n=t.agents.filter(l=>l.role!=="lead").length,o=t.groups.filter(l=>l.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)=>ge(i.state)-ge(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 ${oe(t.lastT*1e3)}`:null].filter(Boolean).join(" · ")}))}function ge(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=Gs(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 Gs(e){return(e.trim().split(/\s+/u)[0]??"tool").replace(/[_-]+/gu," ").toLowerCase()}function Ks({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:_(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 Us({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:ye(n.work,n.agentName,n.id),channel:n.conversationId?Se(n.conversationId):n.agentName,state:n.needs?"needs":n.working?"working":"recent",time:n.lastActivityAt?q(n.lastActivityAt,i):"—",participants:n.agentName,why:o?"same branch":r?"same agent":n.working?"active in project":"project thread"}})}function X({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 Js({lookup:e,session:t,threads:i,nowMs:n,route:o,navigate:r}){const[a,l]=p.useState(!1),c=p.useMemo(()=>{const h=e?.kind==="observe"?e.observe.data:null,d=h?.metadata?.session,m=h?.metadata?.usage,A=h?.events??[],f=h?.files??[],v=d?.turnCount??m?.assistantMessages??(e?.kind==="conversation"?e.session.messageCount:null),P=A.filter(U=>U.kind==="tool").length,D=f.filter(U=>U.state==="created").length,u=f.filter(U=>U.state==="modified").length,I=f.filter(U=>U.state==="read").length,B=D+u,W=Os(m),H=W!==null?Math.round(W*100):null,R=d?.cwd??e?.session?.workspaceRoot??t?.projectRoot??null,K=d?.gitBranch??e?.session?.currentBranch??t?.branch??null,V=qs(h),te=Ce(m?.totalTokens??(typeof m?.inputTokens=="number"||typeof m?.outputTokens=="number"?(m?.inputTokens??0)+(m?.outputTokens??0):null)),Te=Bs(m),Le=B>0?[u>0?`${w(u)} mod`:null,D>0?`${w(D)} new`:null].filter(Boolean).join(" · "):I>0?"read-only":"no file trace",Pe=f.length>0?`${w(f.length)} touched`:"—",Me=_s(f),Ee=Vs(A),Ie=Ks({usage:m,contextPct:H,topology:V,workspace:R,projectRoot:t?.projectRoot,branch:K}),We=Us({session:t,threads:i,nowMs:n});return{turnCount:v,toolCount:P,editCount:B,fileCountLabel:Pe,fileStateLabel:Le,workspace:R,contextPct:H,showContext:H!==null,contextWarn:H!==null&&H>=80,tokenTotal:te,buckets:Te,fileSignals:Me,toolSignals:Ee,contextSignals:Ie,threadSignals:We,projectRoot:t?.projectRoot??null}},[e,t,i,n]),{turnCount:g,toolCount:x,editCount:N,fileCountLabel:S,fileStateLabel:j,workspace:T,contextPct:M,showContext:y,contextWarn:F,tokenTotal:O,buckets:$,fileSignals:E,toolSignals:L,contextSignals:C,threadSignals:k,projectRoot:b}=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(X,{label:"Turns",value:w(g)}),s.jsx(X,{label:"Tools",value:w(x)}),s.jsx(X,{label:"Edits",value:w(N)}),s.jsx(X,{label:"Files",value:S,detail:j!=="no file trace"?j:null}),T&&b&&T!==b?s.jsx(X,{label:"Worktree",value:_(T),title:T}):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":F||void 0,style:{width:`${M}%`}})}),s.jsxs("b",{"data-warn":F||void 0,children:[M,"%"]})]}):null,$.length>0?s.jsxs("button",{type:"button",className:"pi-sessionTokenToggle","aria-expanded":a,onClick:()=>l(h=>!h),children:[s.jsx("span",{children:"Tokens"}),s.jsx("b",{children:O}),s.jsx("i",{children:a?"▾":"▸"})]}):null]}),a&&$.length>0?s.jsx(Hs,{buckets:$}):null,s.jsx(Xs,{files:E,tools:L,context:C,threads:k,route:o,navigate:r})]})}function Xs({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(Ne(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 Re(e,t,i,n){const o=new Map,r=(l,c)=>{const g=l??e,x=ne(c),N=g??"project",S=o.get(N);if(S)return!S.branch&&x&&(S.branch=x),S;const j={key:N,root:g,branch:x,sessions:0,work:0,moving:0,lastActivityAt:0,repoWatch:null};return o.set(N,j),j};for(const l of t){const c=r(l.root,l.branch);l.working&&(c.moving+=1),c.lastActivityAt=Math.max(c.lastActivityAt,l.lastActivityAt)}const a=(l,c)=>{const g=l??e,x=o.get(g??"project");return x||(t.length>0?o.get(e??"")??o.values().next().value:r(l,c))};for(const l of i){const c=a(l.workspaceRoot??l.projectRoot,l.branch);c.sessions+=1,l.working&&(c.moving+=1,c.branch=ne(l.branch)??c.branch),c.lastActivityAt=Math.max(c.lastActivityAt,l.lastActivityAt)}for(const l of n){const c=a(l.workspaceRoot??l.projectRoot,l.branch);c.work+=1,l.working&&(c.moving+=1,c.branch=ne(l.branch)??c.branch),c.lastActivityAt=Math.max(c.lastActivityAt,l.lastActivityAt)}return o.size===0&&r(e,null),[...o.values()].sort((l,c)=>c.moving-l.moving||c.lastActivityAt-l.lastActivityAt||(l.root??"").localeCompare(c.root??""))}function Zs(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(Be)?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)?q(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 Ys(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 et({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 st({project:e,repoProject:t,repoLoading:i,repoError:n,diffSnapshots:o,diffErrors:r,diffLoading:a,pullRequests:l,pullRequestsLoading:c,pullRequestWarnings:g,onRepositoryRefresh:x,threads:N,sessions:S,route:j,navigate:T,nowMs:M}){const y=e?.root??S[0]?.projectRoot??N[0]?.projectRoot??null,F=N.length,O=e?.sessionCount??S.length,$=e?.agentCount??0,E=Math.max(e?.lastActivityAt??0,S[0]?.lastActivityAt??0,N[0]?.lastActivityAt??0),L=e?.branches.length?e.branches:[...new Set([...S.map(d=>d.branch),...N.map(d=>d.branch)].filter(d=>!!d&&d!=="—"&&d!=="main"))],C=t?.worktrees.length?Zs(t):Re(y,e?.worktrees??[],S,N),k=C.find(d=>d.moving>0&&d.branch)?.branch??C.find(d=>d.branch)?.branch??L[0]??"main",b=y?Z(y):e?.title??j.projectSlug??"project",h=C.find(d=>d.moving>0)?.key??C.find(d=>d.branch===k)?.key??C[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:b}),s.jsx("span",{title:y??void 0,children:y?_(y):j.projectSlug??"project"})]}),s.jsxs("div",{className:"pi-projectRepositoryCurrent",children:[C.some(d=>d.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:k,children:k})]}),s.jsx("time",{children:E?q(E,M):"no activity"})]}),O>0||$>0||F>0?s.jsxs("div",{className:"pi-projectRepositoryStats","aria-label":"Repository activity",children:[O>0?s.jsxs("span",{children:[s.jsx("b",{children:w(O)})," sessions"]}):null,$>0?s.jsxs("span",{children:[s.jsx("b",{children:w($)})," agents"]}):null,F>0?s.jsxs("span",{children:[s.jsx("b",{children:w(F)})," 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(C.length)})]}),s.jsx("div",{className:"pi-projectWorktreeList",children:C.slice(0,6).map(d=>{const m=d.repoWatch,A=d.root?o.get(d.root)??null:null,f=A?Ys(A):null,v=m?ve(m):null,P=f?.additions??v?.add??0,D=f?.deletions??v?.del??0,u=f?.files.length??(m?Math.max(m.status.changedFiles,v?.files??0):0),I=!!(u>0||m&&(!m.status.clean||m.branch.ahead>0||m.branch.behind>0)),B=l.filter(R=>R.headRefName===d.branch),W=!!(d.root&&a&&!A&&!r.has(d.root)),H=d.root?r.get(d.root)??null:"No worktree path is available.";return s.jsxs("article",{className:"pi-projectWorktree","data-active":d.key===h||void 0,"data-stranded":I||void 0,children:[s.jsx("span",{className:"pi-projectWorktreeTop",children:s.jsx("b",{title:d.branch??"main",children:d.branch??"main"})}),s.jsx("em",{title:d.root??void 0,children:d.root?_(d.root):"workspace"}),A||m?s.jsxs("div",{className:"pi-projectWorktreeDiff","data-clean":!I||void 0,children:[I?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"pi-projectWorktreeChurn",children:[s.jsxs("b",{className:"pi-projectWorktreeAdd",children:["+",w(P)]}),s.jsxs("b",{className:"pi-projectWorktreeDel",children:["−",w(D)]}),s.jsx(et,{additions:P,deletions:D})]}),s.jsxs("small",{children:[w(u)," changed"]})]}):s.jsx("small",{children:"clean"}),d.root?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:()=>T({view:"repo-diff",path:d.root}),children:"View diff"}):null]}):s.jsxs("div",{className:"pi-projectWorktreeDiff","data-pending":!0,children:[s.jsx("small",{children:W||i?"Reading worktree diff…":H??n??"No diff data returned."}),!W&&!i?s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:x,children:"Retry"}):null]}),f&&f.files.length>0?s.jsxs("span",{className:"pi-projectWorktreeFiles",title:f.files.join(`
2
- `),children:[f.files.slice(0,2).map(R=>Z(R)).join(" · "),f.files.length>2?` · +${f.files.length-2} more`:""]}):null,s.jsx("span",{className:"pi-projectWorktreeMeta",children:m?s.jsxs(s.Fragment,{children:[s.jsx("small",{children:m.branch.ahead>0||m.branch.behind>0?`${m.branch.ahead}↑ ${m.branch.behind}↓`:"synced"}),m.status.staged>0?s.jsxs("small",{children:[w(m.status.staged)," staged"]}):null,m.status.unstaged>0?s.jsxs("small",{children:[w(m.status.unstaged)," unstaged"]}):null,m.status.untracked>0?s.jsxs("small",{children:[w(m.status.untracked)," untracked"]}):null,m.status.conflicts>0?s.jsxs("small",{children:[w(m.status.conflicts)," conflicts"]}):null,f?.layers.map(R=>s.jsx("small",{children:R},R)),B.length>0?s.jsxs("small",{children:[B.length," PR",B.length===1?"":"s"]}):null]}):s.jsxs(s.Fragment,{children:[s.jsx("small",{children:d.lastActivityAt?q(d.lastActivityAt,M):"idle"}),s.jsxs("small",{children:[w(d.sessions)," sessions"]}),s.jsxs("small",{children:[w(d.work)," threads"]})]})})]},d.key)})}),C.length>6?s.jsxs("div",{className:"pi-projectWorktreeMore",children:["+",C.length-6," more worktrees"]}):null]})]}),s.jsx(Qs,{pullRequests:l,loading:c,warnings:g,onRefresh:x,nowMs:M})]})}const tt=8,nt=6,it=3e4,at=15e3;function ot(){const[e,t]=p.useState(()=>ie()),[i,n]=p.useState(()=>ie()===null);return p.useEffect(()=>{let o=!1,r=!1;const a=async()=>{if(!r){r=!0;try{const g=await ae("standard",!1,at);o||(t(g),n(!1))}catch{o||n(!1)}finally{r=!1}}};a();const l=window.setInterval(()=>{document.visibilityState==="visible"&&a()},it),c=ee(()=>{a()});return()=>{o=!0,window.clearInterval(l),c()}},[]),{snapshot:e,loading:i}}function rt(e){if(!e)return[];const t=[];for(const i of e.projects)for(const n of i.worktrees)n.status.changedFiles<=0&&n.branch.ahead<=0||t.push({projectName:i.name,projectRoot:i.root,worktree:n});return t.sort((i,n)=>n.worktree.status.changedFiles-i.worktree.status.changedFiles||(n.worktree.lastCommitAt??0)-(i.worktree.lastCommitAt??0)||i.projectName.localeCompare(n.projectName))}function lt({model:e,route:t,navigate:i,nowMs:n}){const[o,r]=p.useState(!1),a=t.machineId?{machineId:t.machineId}:{},l=t.showEphemeral?{showEphemeral:!0}:{},c=p.useMemo(()=>[...e.projects].sort((j,T)=>T.lastActivityAt-j.lastActivityAt||j.title.localeCompare(T.title)).slice(0,tt),[e.projects]),{snapshot:g,loading:x}=ot(),N=p.useMemo(()=>rt(g).slice(0,nt),[g]),S=j=>i({view:"agents-v2",projectSlug:j.slug,...a,...l});return s.jsxs("main",{className:"pi-meta","aria-label":"Projects overview",children:[s.jsxs("div",{className:"pi-metaShortcuts",children:[s.jsxs("button",{type:"button",className:"pi-shortcut","aria-expanded":o,onClick:()=>r(j=>!j),children:[s.jsx(we,{size:13,strokeWidth:1.8,"aria-hidden":!0}),"Add project"]}),s.jsxs("button",{type:"button",className:"pi-shortcut",onClick:()=>i({view:"search"}),children:[s.jsx(ke,{size:13,strokeWidth:1.8,"aria-hidden":!0}),"Search agents & sessions"]}),s.jsx("button",{type:"button",className:"pi-shortcut",onClick:()=>i({view:"sessions",...a}),children:"Browse sessions"})]}),o?s.jsx(Xe,{onClose:()=>r(!1)}):null,s.jsxs("section",{className:"pi-metaSection","aria-label":"Recent projects",children:[s.jsxs("div",{className:"pi-sectionHead",children:[s.jsx("span",{className:"pi-sectionLabel",children:"Recent projects"}),s.jsx("span",{className:"pi-sectionCount",children:e.projects.length})]}),c.map(j=>s.jsx(ct,{project:j,nowMs:n,onOpen:()=>S(j)},j.slug))]}),s.jsxs("section",{className:"pi-metaSection","aria-label":"Active diffs",children:[s.jsxs("div",{className:"pi-sectionHead",children:[s.jsx("span",{className:"pi-sectionLabel",children:"Active diffs"}),s.jsx("span",{className:"pi-sectionCount",children:N.length})]}),N.length>0?N.map(j=>s.jsx(dt,{diff:j,machineScope:a,navigate:i},j.worktree.id)):s.jsx("div",{className:"pi-metaEmpty",children:x?"Reading repositories…":"No uncommitted changes across your repos."})]})]})}function ct({project:e,nowMs:t,onOpen:i}){const n=e.needs>0,o=Math.max(e.liveSessionCount,e.working);return s.jsxs("button",{type:"button",className:"pi-recentRow","data-state":n?"needs":o>0?"live":void 0,onClick:i,children:[s.jsx("span",{className:"pi-recentDot","aria-hidden":!0}),s.jsxs("span",{className:"pi-recentMain",children:[s.jsxs("span",{className:"pi-recentTitle",children:["/",e.title]}),s.jsx("span",{className:"pi-recentRoot",children:e.root?_(e.root):"Discovered project"})]}),s.jsxs("span",{className:"pi-recentMeta",children:[n?s.jsxs("b",{children:[e.needs," needs you"]}):null,o>0?s.jsxs("span",{children:[o," live"]}):null,s.jsx("time",{children:e.lastActivityAt?q(e.lastActivityAt,t):"—"})]})]})}function dt({diff:e,machineScope:t,navigate:i}){const n=ve(e.worktree);return s.jsxs("div",{className:"pi-diffRow",children:[s.jsxs("button",{type:"button",className:"pi-diffMain",title:e.worktree.path,onClick:()=>i({view:"repos",root:e.projectRoot,...t}),children:[s.jsxs("span",{className:"pi-diffProject",children:["/",e.projectName]}),s.jsx("span",{className:"pi-diffBranch",children:e.worktree.branch.name??"main"})]}),s.jsxs("span",{className:"pi-diffChurn",children:[s.jsxs("b",{className:"pi-projectWorktreeAdd",children:["+",w(n.add)]}),s.jsxs("b",{className:"pi-projectWorktreeDel",children:["−",w(n.del)]}),s.jsxs("small",{children:[w(e.worktree.status.changedFiles)," changed"]})]}),s.jsx("button",{type:"button",className:"pi-projectWorktreeOpenDiff",onClick:()=>i({view:"repo-diff",path:e.worktree.path}),children:"View diff"})]})}function ut({project:e,threads:t,sessions:i,route:n,navigate:o,nowMs:r}){const a=e?.root??i[0]?.projectRoot??t[0]?.projectRoot??null,l=p.useMemo(()=>Re(a,e?.worktrees??[],i,t).map(g=>g.root).filter(g=>!!g),[e?.worktrees,a,i,t]),c=vs(a,l);return s.jsx(st,{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 Zn({route:e,navigate:t,zeroPreview:i=!1}){const{model:n,nowMs:o,loading:r,error:a}=Ze(e),l=!!e.projectSlug,c=l&&!xe(e.sessionId)?e.sessionId??null:null,g=p.useMemo(()=>c?Ws(n.sessions,e):null,[n.sessions,e,c]),x=l?e.indexView==="agents"?"agents":e.indexView==="sessions"?"sessions":"overview":"overview",N=l?n.projects.find(k=>k.slug===e.projectSlug)??null:null,S=p.useMemo(()=>{if(i)return[];if(!l)return[];const k=e.projectSlug,b=Y(n.threads,k),h=le(n.sessions,k);return x==="overview"?[]:x==="agents"?b.filter(d=>d.kind==="agent"):h.length>0?h:b},[n.sessions,n.threads,x,e.projectSlug,l,i]),j=p.useMemo(()=>Qe(S),[S]),T=p.useMemo(()=>j.flatMap(k=>k.items),[j]),M=n.projects.length>0||n.threads.length>0||n.sessions.length>0,y=r&&!M,F=r&&!i,O=!l&&!F&&(i||n.projects.length===0&&S.length===0),$=!l&&!O,[E,L]=p.useState(-1),C=p.useRef(new Map);return p.useEffect(()=>{!l||!e.sessionId||!xe(e.sessionId)||t({...e,indexView:"sessions",sessionId:void 0,selectedAgentId:void 0})},[t,e,l]),p.useEffect(()=>{L(-1)},[e.projectSlug]),p.useEffect(()=>{function k(b){const h=document.activeElement;if(!!h&&(h.tagName==="INPUT"||h.tagName==="TEXTAREA"||h.isContentEditable))return;const m=T.length;if(m){if(b.key==="ArrowDown"||b.key==="j")b.preventDefault(),L(A=>A<0?0:Math.min(m-1,A+1));else if(b.key==="ArrowUp"||b.key==="k")b.preventDefault(),L(A=>A<0?0:Math.max(0,A-1));else if(b.key==="Enter"){const A=T[E<0?0:E];A&&(b.preventDefault(),t(A.kind==="session"?ce(A,e):de(A,e)))}}}return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[E,T,t,e]),p.useEffect(()=>{if(E<0)return;const k=T[E];k&&C.current.get(k.id)?.scrollIntoView({block:"nearest"})},[E,T]),s.jsxs("div",{className:"s-pi s-pi-inbox","aria-busy":r||void 0,"data-loading":r||void 0,children:[l?s.jsx(Ss,{route:e,navigate:t,slug:e.projectSlug,model:n,mode:x,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:Cs(n,i)})]})}),c?s.jsx(Ds,{session:g,sessionRef:c,threads:Y(n.threads,e.projectSlug),route:e,navigate:t,nowMs:o}):l&&x==="overview"?s.jsx(ut,{project:N,threads:Y(n.threads,e.projectSlug),sessions:le(n.sessions,e.projectSlug),route:e,navigate:t,nowMs:o}):$?s.jsx(lt,{model:n,route:e,navigate:t,nowMs:o}):s.jsxs("div",{className:"pi-threads",children:[y?s.jsx(ks,{}):null,!y&&j.map(k=>{let b=0;for(const h of j){if(h.group===k.group)break;b+=h.items.length}return s.jsxs("div",{children:[s.jsxs("div",{className:"pi-sectionHead","data-tone":k.group,children:[s.jsx("span",{className:"pi-sectionLabel",children:k.label}),s.jsx("span",{className:"pi-sectionCount",children:k.items.length})]}),k.items.map((h,d)=>{const m=b+d;return s.jsx(Ns,{thread:h,crossProject:!l,selected:h.kind==="session"?es(h,e):ss(h,e),cursor:E===m,nowMs:o,onSelect:()=>{const A=h.kind==="session"?Ye(h,e):Ne(h,e);t(A)},onOpen:()=>t(h.kind==="session"?ce(h,e):de(h,e)),rowRef:A=>{A?C.current.set(h.id,A):C.current.delete(h.id)}},h.id)})]},k.group)}),!y&&S.length===0?a&&!M?s.jsx(he,{tone:"error",title:"Projects unavailable",detail:a}):O?s.jsx("div",{className:"pi-empty",children:s.jsx(As,{route:e,navigate:t,projects:n.projects})}):F?s.jsx("div",{className:"pi-empty",children:"Loading…"}):s.jsx(he,{title:pt(l,x)}):null]})]})}function pt(e,t){return e&&t==="agents"?"No visible agents in this project.":e?"No sessions in this project yet.":"No projects yet."}export{Zn as ProjectsInbox,Ns as ThreadRow};
@@ -1 +0,0 @@
1
- import{r as d,j as t}from"./index-o4FKpU7Z.js";import{t as se}from"./time-Dhsh_2EG.js";import{p as he}from"./model-Co0zkMIc.js";import{F as je,A as me}from"./AddProjectForm-Czb5uwou.js";import{s as Se}from"./project-overview-helpers-BQTc_Ous.js";import{u as xe,i as q,s as fe,b as $,c as I,d as ge}from"./projects-inbox-DCeD3FfV.js";import{S as K}from"./search-7_n7CxWl.js";import{X as we}from"./x-ynOfVadO.js";import{C as ie}from"./chevron-down-NAhBUkFd.js";import{C as ne}from"./chevron-right-C10o7t_X.js";import{F as oe}from"./DocumentFocusViewer-DRKjNG9s.js";import{c as re}from"./createLucideIcon-Bt67PWH-.js";const ve=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ne=re("archive",ve);const ye=[["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"}]],Ce=re("pin",ye),U=4,ae="openscout.projects.pinnedSessions",ce="openscout.projects.archivedSessions";function Ae(e){return e.needs>0?"needs":e.working>0||e.liveSessionCount>0?"working":"idle"}function Pe({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 be({route:e,navigate:s,zeroPreview:i=!1}){const{model:o,nowMs:c,loading:r,error:l}=xe(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()),[G,pe]=d.useState(()=>Fe()),[W,H]=d.useState(!1),x=e.machineId,P=e.showEphemeral,ue=r&&o.projects.length===0&&o.sessions.length===0,L=d.useMemo(()=>i?[]:o.sessions.filter(n=>!G.has(b(n))),[o.sessions,G,i]),z=d.useMemo(()=>i?[]:Te(o.projects,L),[o.projects,L,i]),T=d.useMemo(()=>Ee(z,u,j),[z,u,j]),D=u.trim().length>0,V=D?T:T.filter(n=>!q(n.project,c)),E=D?[]:T.filter(n=>q(n.project,c)),B=d.useMemo(()=>i?[]:_(L.filter(n=>A.has(b(n))&&de(n,u))),[L,A,u,i]),J=d.useCallback(n=>{v(a=>ee(a,n)),s({view:"agents-v2",projectSlug:n,...x?{machineId:x}:{},...P?{showEphemeral:!0}:{}})},[x,s,P]),M=d.useCallback(n=>{v(a=>ee(a,n.projectSlug)),s(fe(n,{projectSlug:n.projectSlug,...x?{machineId:x}:{},...P?{showEphemeral:!0}:{}}))},[x,s,P]),O=d.useCallback(n=>{const a=b(n);S(f=>{const p=new Set(f);return p.has(a)?p.delete(a):p.add(a),te(p),p})},[]),F=d.useCallback(n=>{const a=b(n);pe(f=>{if(f.has(a))return f;const p=new Set(f);return p.add(a),$e(p),p}),S(f=>{if(!f.has(a))return f;const p=new Set(f);return p.delete(a),te(p),p}),$(n,e)&&s({view:"agents-v2",projectSlug:n.projectSlug,indexView:"sessions",...x?{machineId:x}:{},...P?{showEphemeral:!0}:{}})},[x,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(we,{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":W,"aria-label":"Add project",title:"Add a project by path",onClick:()=>H(n=>!n),children:t.jsx(je,{size:13,strokeWidth:1.8,"aria-hidden":!0})})]}),W?t.jsx(me,{onClose:()=>H(!1)}):null,ue?t.jsx(Pe,{}):l&&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:$(n,e),showProject:!0,nowMs:c,onOpenSession:M,onTogglePinnedSession:O,onArchiveSession:F},`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:c,route:e,onOpenProject:J,onOpenSession:M,onToggleCollapsed:()=>v(a=>R(a,n.project.slug)),onToggleExpanded:()=>C(a=>R(a,n.project.slug)),onTogglePinnedSession:O,onArchiveSession:F},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:c,route:e,onOpenProject:J,onOpenSession:M,onToggleCollapsed:()=>v(a=>R(a,n.project.slug)),onToggleExpanded:()=>C(a=>R(a,n.project.slug)),onTogglePinnedSession:O,onArchiveSession:F},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:c,nowMs:r,route:l,onOpenProject:u,onOpenSession:y,onToggleCollapsed:j,onToggleExpanded:m,onTogglePinnedSession:g,onArchiveSession:w}){const{project:h,sessions:v}=e,N=_(v.filter(S=>!c.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":Ae(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:Me(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:c.has(b(S)),selected:$(S,l),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 ke(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:c,nowMs:r,onOpenSession:l,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":c?`${g} /${s.projectTitle}`:g,onClick:()=>{m(null),l(s)},children:[t.jsx("span",{className:"pi-projectSessionTitle",children:g}),c?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(Ce,{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(Ne,{size:11,strokeWidth:2,"aria-hidden":!0})}),t.jsx("span",{className:"pi-projectSessionWhen",children:s.lastActivityAt?se(s.lastActivityAt,r):"-"})]}),j?t.jsx(Le,{session:s,left:j.left,top:j.top,nowMs:r}):null]})},ke);function Le({session:e,left:s,top:i,nowMs:o}){const c=e.agentName||null,r=e.projectRoot?Se(e.projectRoot):`/${e.projectTitle}`,l=I(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,c?t.jsx("span",{children:c}):null]}),t.jsx("div",{className:"pi-sessionHoverRef",children:l??"No session archive yet"})]})}function Te(e,s){return e.map(i=>{const o=ge(s,i.slug);return{project:i,sessions:_(o),lastActivityAt:o[0]?.lastActivityAt??i.lastActivityAt}})}function Ee(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(l=>de(l,o))):e].sort((r,l)=>{switch(i){case"name":return r.project.title.localeCompare(l.project.title);case"sessions":return l.project.sessionCount-r.project.sessionCount||l.lastActivityAt-r.lastActivityAt||r.project.title.localeCompare(l.project.title);default:return l.project.liveSessionCount-r.project.liveSessionCount||l.lastActivityAt-r.lastActivityAt||l.project.sessionCount-r.project.sessionCount||r.project.title.localeCompare(l.project.title)}})}function _(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 I(e)?2:e.agentId?1:0}function de(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 I(e)??e.id}function k(e){const s=e.work||e.sessionId||e.id,i=s.includes("/")?he(s):s;return Re(i,e.harness)}function Re(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 c=i.match(/^([0-9a-f]{8})-[0-9a-f-]{27,}$/iu);return c?`${Z(s)} session ${c[1]}`:i.length>42?`${i.slice(0,39).trim()}...`:i}function Me(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(ae),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(ae,JSON.stringify([...e]))}catch{}}function Fe(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(ce),s=e?JSON.parse(e):[];return new Set(Array.isArray(s)?s.filter(i=>typeof i=="string"):[])}catch{return new Set}}function $e(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ce,JSON.stringify([...e]))}catch{}}const Ue=Object.freeze(Object.defineProperty({__proto__:null,ProjectsRail:be},Symbol.toStringTag,{value:"Module"}));export{Ne as A,be as P,Ce as a,Ue as b};
@@ -1 +0,0 @@
1
- import{j as i}from"./index-o4FKpU7Z.js";import{u as e}from"./Provider-DKZWuzSR.js";import{d as s}from"./types-B0PlfpKc.js";import{ProjectsInbox as c}from"./ProjectsInbox-DoPZ17FC.js";import{P as a}from"./ProjectsRail-CWOkZjsY.js";import{ProjectAgentProfile as n}from"./ProjectAgentProfile-BEfYOaxc.js";import{i as l}from"./model-IGCUEsMy.js";/* empty css */import"./projects-inbox-DCeD3FfV.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.js";import"./AgentAvatar-DMov24_o.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./api-BkjHJfgJ.js";import"./ui-LM8pS8qE.js";import"./openContent-C6XO6kr5.js";import"./SessionRefScreen-DLZNFZFK.js";import"./tail-events-NLIWLq27.js";import"./BackToPicker-BXp5E2ck.js";import"./ConversationScreen-oZSitVtX.js";import"./ConversationComposer-CWohCCmn.js";import"./message-markup-BcY1lShv.js";import"./mentions-CvDaviLJ.js";import"./AgentDetailCard-Biq8b2gv.js";import"./AgentLiveActions-0iy8QZ1T.js";import"./terminal-takeover-7AvNpnkC.js";import"./eye-B3lBIwJZ.js";import"./terminal-By1Lw2i2.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";/* empty css */import"./ConversationHeader-BxTzXl8e.js";import"./ConversationFeedRows-IWh0JSIL.js";import"./ConversationPanels-D9UCwNkS.js";import"./use-reduced-motion-CqXpVXv-.js";import"./activity-BvGruxWG.js";import"./message-circle-BM3XgevU.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./ConversationStatus-B6pAbo2w.js";import"./SessionObserve-DaUrJCMq.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-CcEiQC6B.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-ByW7Ar7p.js";import"./ObserveTextFlow-_ApDwRCO.js";import"./SessionObserveEvidence-ClUW8jpV.js";import"./wrench-M4G7WtYB.js";import"./external-link-Dem738OJ.js";/* empty css */import"./AddProjectForm-Czb5uwou.js";import"./project-overview-helpers-BQTc_Ous.js";import"./cache-Dr0why2k.js";import"./arrow-up-right-hoR8_oUz.js";import"./AgentsSubnav-CiIuzxnZ.js";import"./SecondaryNav-Dj30epYF.js";import"./secondaryNavConfig-CSFDCQAf.js";import"./message-square-ER1_q2pe.js";import"./scroll-text-BuneRiAD.js";import"./profile-DW80Gn5k.js";import"./context-budget-DX_fwUs3.js";import"./session-catalog-_QfQ7fhZ.js";import"./terminal-relay-CjkI5aUy.js";/* empty css */import"./AgentDefinitionsWorkspace-D4MbSMXp.js";import"./FileViewerPane-BM4AD_bo.js";import"./agent-essentials-yb4wIJlX.js";/* empty css *//* empty css */import"./ProjectAgentProfileBar-B1VpwzGD.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 hr({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 vr=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{hr as ProjectsEmbedScreen,f as ProjectsScreen,vr as scoutSurface};
@@ -1 +0,0 @@
1
- import{j as s}from"./index-o4FKpU7Z.js";import{A as R}from"./AgentAvatar-DMov24_o.js";import{H as O}from"./HarnessMark-MztYnrGK.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-DCeD3FfV.js";import{A as g}from"./arrow-up-right-hoR8_oUz.js";import"./SpriteAvatar-DQ3PTb8L.js";import"./agent-identity-BxCsXnDp.js";import"./colors-BtO5_zlx.js";import"./api-h5zurxmi.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CL6gctHY.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./Provider-DKZWuzSR.js";import"./provider-BvAxRQfE.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.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 ys({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{ys as ProjectsThreadAside};
@@ -1 +0,0 @@
1
- import{j as i,r as o,J as Te,b as et,K as tt,L as nt,C as rt}from"./index-o4FKpU7Z.js";import{u as Pe}from"./provider-BvAxRQfE.js";import{d as ot,as as st}from"./router-C65cZYPn.js";import{a as $}from"./api-h5zurxmi.js";import{u as it}from"./sse-CL6gctHY.js";import{o as at,i as Re}from"./surface-activity-B1rgWB1i.js";import{i as ct}from"./colors-BtO5_zlx.js";import{e as Me,s as lt,i as Ie,r as ut,a as dt,f as ft}from"./scoutbot-BTIErYHo.js";import{C as pt}from"./ContextMenu-CxkmFQcN.js";import{F as ht,a as mt,D as vt}from"./DocumentFocusViewer-DRKjNG9s.js";import{c as Fe,T as Be}from"./TextDocumentSurface-Bc-kHPgG.js";import{C as gt}from"./chevron-right-C10o7t_X.js";import{F as wt}from"./file-text-iF0hyVyU.js";import{c as Ue}from"./createLucideIcon-Bt67PWH-.js";import{C as bt}from"./code-xml-CLn3TDWF.js";import{A as yt}from"./arrow-left-BOht-YQu.js";import{h as St}from"./scout-voice-B7kXlkcl.js";import{i as Ct}from"./keyboard-nav-Chf51dns.js";import{d as pe,b as Ne,i as Oe}from"./MessageComposerSuggestions-Dfc3PH2y.js";import{o as kt,N as Et}from"./NewChatComposer-S08F6_La.js";import{u as xt}from"./chunk-HRAB3GC3-DF8R9rPv.js";function At(e){const t=e instanceof Error?e.message:String(e);return Rt(t)?"Scout server is unreachable":t}function Tt(e){return e==="Scout server is unreachable"}function Rt(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 It=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Nt=Ue("arrow-right",It);const Ot=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_t=Ue("chevron-up",Ot),Lt={id:"audio",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("audio/"),render:({resource:e})=>{const t=e;return i.jsx("div",{className:"s-file-preview-media-wrap",children:i.jsx("div",{className:"s-file-preview-audio-stage",children:i.jsx("audio",{className:"s-file-preview-audio",src:t.rawUrl,controls:!0})})})}},jt={id:"binary",canHandle:()=>!0,render:({resource:e})=>{const t=e;return i.jsxs("div",{className:"s-file-preview-callout",children:[i.jsxs("div",{className:"s-file-preview-callout-title",children:[t.previewReason," — open in OS"]}),i.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."]})]})}},Dt=new Set(["text/typescript","text/javascript","text/css","text/html","application/json","text/yaml","text/toml","text/x-shellscript","text/plain"]),Pt={id:"code",canHandle:e=>e.kind==="file"&&e.previewable&&Dt.has(e.mediaType),render:({resource:e})=>{const t=e,n=Fe({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"code",readOnly:!0});return i.jsx(Be,{document:n,mode:"read",className:"s-doc-focus-document"})}},Mt={id:"directory",canHandle:e=>e.kind==="directory",render:({resource:e,openFilePreview:t})=>{const n=e,r=Ft(n.realPath,n.rootPath);return i.jsxs("div",{className:"s-file-preview-directory",children:[i.jsx("div",{className:"s-file-preview-breadcrumb","aria-label":"Directory breadcrumb",children:r.map((s,a)=>{const c=a===r.length-1;return i.jsxs("div",{className:"s-file-preview-breadcrumb-item",children:[a>0&&i.jsx(gt,{size:12,"aria-hidden":"true"}),c?i.jsx("span",{className:"s-file-preview-breadcrumb-current",children:s.label}):i.jsx("button",{type:"button",className:"s-file-preview-breadcrumb-link",onClick:()=>t(s.path),children:s.label})]},s.path)})}),i.jsxs("div",{className:"s-file-preview-directory-list",role:"list",children:[n.entries.map(s=>i.jsxs("button",{type:"button",className:"s-file-preview-entry",onClick:()=>t(s.path),children:[i.jsx("span",{className:"s-file-preview-entry-icon","aria-hidden":"true",children:s.kind==="directory"?i.jsx(ht,{size:14}):i.jsx(wt,{size:14})}),i.jsx("span",{className:"s-file-preview-entry-name",children:s.name}),i.jsx("span",{className:"s-file-preview-entry-kind",children:s.kind==="directory"?"dir":"file"})]},s.realPath)),n.entries.length===0&&i.jsx("div",{className:"s-file-preview-directory-empty",children:"This directory is empty."})]})]})}};function Ft(e,t){const n=t==="/"?"/":t.replace(/\/+$/u,""),r=e==="/"?"/":e.replace(/\/+$/u,""),s=n.split("/").filter(Boolean),a=r.split("/").filter(Boolean),c=[{label:s[s.length-1]??"/",path:n||"/"}];let p=n||"/";for(let f=s.length;f<a.length;f+=1){const A=a[f];A&&(p=p==="/"?`/${A}`:`${p}/${A}`,c.push({label:A,path:p}))}return c}const Bt={id:"html",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/html",render:({resource:e})=>i.jsx("div",{className:"s-file-preview-html-wrap",children:i.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"})})},Ut={id:"image",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("image/"),render:({resource:e})=>i.jsx("div",{className:"s-file-preview-image-wrap",children:i.jsx("div",{className:"s-file-preview-image-stage",children:i.jsx("img",{className:"s-file-preview-image",src:e.kind==="file"?e.rawUrl:"",alt:e.title})})})},qt={id:"markdown",canHandle:e=>e.kind==="file"&&e.previewable&&e.mediaType==="text/markdown",render:({resource:e})=>{const t=e,n=Fe({id:t.realPath,title:t.title,uri:t.realPath,mediaType:t.mediaType,value:t.content,filename:t.title,kind:"markdown",readOnly:!0});return i.jsx(Be,{document:n,mode:"preview",className:"s-doc-focus-document"})}},Vt={id:"video",canHandle:e=>e.kind==="file"&&e.mediaType.startsWith("video/"),render:({resource:e})=>{const t=e;return i.jsx("div",{className:"s-file-preview-media-wrap",children:i.jsx("div",{className:"s-file-preview-media-stage",children:i.jsx("video",{className:"s-file-preview-video",src:t.rawUrl,controls:!0})})})}},Ht=[Mt,qt,Bt,Pt,Ut,Vt,Lt,jt];function $t({path:e,onOpenPath:t,onOpenInCode:n,onClose:r}){const[s,a]=o.useState(null),[c,p]=o.useState(null),[f,A]=o.useState(!1),[w,T]=o.useState(null),P=o.useRef(null);o.useEffect(()=>{P.current=w},[w]),o.useEffect(()=>{if(!e){a(null),p(null),A(!1);return}let d=!1;return A(!0),p(null),a(null),$(`/api/file/preview?path=${encodeURIComponent(e)}`).then(h=>{d||(a(h),Jt(h,P.current,T))}).catch(h=>{d||p(h instanceof Error?h.message:"could not load file")}).finally(()=>{d||A(!1)}),()=>{d=!0}},[e]);const{currentIndex:j,prevPath:u,nextPath:g}=o.useMemo(()=>{if(!s||s.kind!=="file"||!w)return{currentIndex:-1,prevPath:null,nextPath:null};const d=w.files.findIndex(h=>h.realPath===s.realPath);return d<0?{currentIndex:-1,prevPath:null,nextPath:null}:{currentIndex:d,prevPath:d>0?w.files[d-1].path:null,nextPath:d<w.files.length-1?w.files[d+1].path:null}},[s,w]);if(o.useEffect(()=>{if(!e)return;const d=h=>{if(h.key==="Escape"){r();return}if(h.target instanceof HTMLElement){const b=h.target.tagName;if(b==="INPUT"||b==="TEXTAREA"||h.target.isContentEditable)return}h.metaKey||h.ctrlKey||h.altKey||(h.key==="ArrowLeft"&&u?(h.preventDefault(),t(u)):h.key==="ArrowRight"&&g?(h.preventDefault(),t(g)):h.key==="Backspace"&&w&&s?.kind==="file"&&(h.preventDefault(),t(w.dirPath)))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,r,t,u,g,w,s]),!e)return null;const S=()=>{$("/api/file/reveal",{method:"POST",body:JSON.stringify({path:s?.realPath??e})}).catch(d=>{p(d instanceof Error?d.message:"reveal failed")})},O=s?Ht.find(d=>d.canHandle(s))??null:null,k=!!(s&&s.kind==="file"&&w&&j>=0&&w.files.length>1),E=[];k&&w&&E.push({label:`Folder: ${w.dirTitle}`,icon:i.jsx(_t,{size:12}),onClick:()=>t(w.dirPath),title:`Back to ${w.dirTitle} (Backspace)`}),E.push({label:"Open in Code",icon:i.jsx(bt,{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"}),E.push({label:"Show in folder",icon:i.jsx(mt,{size:12}),onClick:S,title:"Show this file in its operating system folder",hideLabel:!0});const _=s?zt(s):[];k&&_.unshift(`${j+1} / ${w.files.length}`);const I=s&&O?O.render({resource:s,openFilePreview:t}):null;return i.jsx(vt,{open:!0,kind:Kt(s),document:null,title:s?.title??e.split("/").pop()??"File",eyebrow:"File preview",subtitle:s?.realPath??e,meta:_,state:f?"Loading…":null,error:c,body:I?i.jsxs("div",{className:`s-file-preview-shell${k?" s-file-preview-shell-nav":""}`,children:[k&&i.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:i.jsx(yt,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}),i.jsx("div",{className:"s-file-preview-shell-body",children:I}),k&&i.jsx("button",{type:"button",className:"s-file-preview-side-nav s-file-preview-side-nav-right",onClick:()=>g&&t(g),disabled:!g,"aria-label":"Next file",title:"Next file (→)",children:i.jsx(Nt,{size:18,strokeWidth:1.8,"aria-hidden":"true"})})]}):null,actions:E,onClose:r})}function Jt(e,t,n){if(e.kind==="directory"){const s=e.entries.filter(a=>a.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 Kt(e){return!e||e.kind==="directory"||e.mediaType==="text/markdown"||e.mediaType==="text/plain"?"doc":"code"}function zt(e){return e.kind==="directory"?[`${e.entries.length} ${e.entries.length===1?"entry":"entries"}`]:[...e.previewable&&e.truncated?["truncated"]:[],Gt(e.sizeBytes),e.mediaType]}function Gt(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const qe={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}},z=()=>{},Ve={focusScoutbot:z,triggerBrief:z,triggerAskState:z,toggleVoiceReplies:z,openScoutbotSettings:z,startNewChat:z,dismissReminder:z,askReminderStatus:z},we=o.createContext(null);function Wt({children:e}){const[t,n]=o.useState(qe),r=o.useRef(Ve),s=o.useCallback(f=>{n(A=>Qt(A,f)?A:f)},[]),a=o.useCallback(f=>{r.current=f},[]),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:f=>r.current.dismissReminder(f),askReminderStatus:f=>r.current.askReminderStatus(f)}),[]),p=o.useMemo(()=>({state:t,actions:c,publishState:s,registerActions:a}),[t,c,s,a]);return i.jsx(we.Provider,{value:p,children:e})}function pr(){const e=o.useContext(we);return e?{state:e.state,actions:e.actions}:{state:qe,actions:Ve}}function hr(){const e=o.useContext(we);return e?{publishState:e.publishState,registerActions:e.registerActions}:null}function Qt(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&&Xt(e.reminders.due,t.reminders.due)&&He(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 Xt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!He(e[n],t[n]))return!1;return!0}function He(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 Yt="/api/voice/realtime/call",$e="/api/voice/realtime/lease",Zt="x-openscout-realtime-voice-lease",Je="surface.realtime-voice",mr="scout:realtime-voice-stop",en={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}},tn={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}},nn="/api/scoutbot/chat",rn=25e3;async function on(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,a=null,c=null,p=0,f=0;const A=(u,g,S="voice")=>{f+=1,e.onTrace?.({id:`voice-${f}`,at:Date.now(),kind:S,label:u,...g?{detail:g}:{}})};let w=null;const T=()=>{if(w)return w;r=!0,e.signal?.removeEventListener("abort",j),c&&clearInterval(c),c=null,s?.getTracks().forEach(g=>g.stop()),n.pause(),n.srcObject=null,t.close();const u=a;return a=null,w=(async()=>{u&&await vn(u),e.onState?.("ended")})(),w},P=()=>{T().catch(u=>{e.onError?.(u instanceof Error?u.message:"Could not release the realtime voice lease."),e.onState?.("error")})},j=()=>{P()};e.signal?.addEventListener("abort",j,{once:!0}),t.ontrack=({streams:u})=>{const g=u[0];if(!g||r)return;const[S]=g.getAudioTracks();S&&S.addEventListener("ended",()=>{r||e.onError?.("Realtime voice audio ended unexpectedly.")}),n.srcObject=g,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"),A("Realtime channel connected","Scoutbot bridge is ready")):(t.connectionState==="failed"||t.connectionState==="disconnected")&&(e.onError?.("Realtime voice connection ended unexpectedly."),P()))};try{s=await hn(e.inputDeviceName,e.signal),ie(e.signal);for(const m of s.getTracks())t.addTrack(m,s);const u=t.createDataChannel("oai-events"),g=new Set;let S=Promise.resolve(),O=!1,k=null;const E=[],_=m=>{if(r||u.readyState!=="open")return!1;try{return u.send(JSON.stringify(m)),!0}catch{return e.onError?.("Realtime voice events channel closed unexpectedly."),!1}},I=()=>{if(O||k||E.length===0)return;const m=E.shift();if(m){if(k=m,!_({type:"response.create",response:{instructions:m}})){k=null,E.unshift(m);return}O=!0}},d=m=>{E.push(m),I()};u.addEventListener("open",()=>{if(r)return;const m=pn(e.inputDeviceName);if(!_({type:"session.update",session:{type:"realtime",audio:{input:m}}})){e.onError?.("Could not configure Scout's realtime microphone processing.");return}A("Scoutbot bridge ready","Live fleet context is available"),d("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",m=>{const L=an(m.data);if(L?.type==="error"){if(Ke(L.message)){k&&(E.unshift(k),k=null),O=!0,A("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}e.onError?.(L.message??"OpenAI Realtime reported an error.");return}if(L?.type==="response.created"){O=!0,k=null;return}if(L?.type==="response.done"){O=!1,k=null;for(const D of cn(L))D.name!=="ask_scoutbot"||g.has(D.callId)||(g.add(D.callId),S=S.then(()=>sn({functionCall:D,route:e.getRoute?.()??e.route,uiContext:e.getUiContext?.(),onReply:e.onScoutbotReply,onTrace:A,send:_,requestResponse:d})).catch(V=>{e.onError?.(V instanceof Error?V.message:"Scoutbot could not complete the voice request.")}));I()}});const h=await he(t.createOffer(),e.signal);if(await he(t.setLocalDescription(h),e.signal),!h.sdp)throw new Error("Could not create a WebRTC offer.");const b=await fetch(Yt,{method:"POST",headers:{"content-type":"application/sdp"},body:h.sdp,signal:e.signal});a=b.headers.get(Zt)?.trim()||null;const y=await he(b.text(),e.signal);if(!b.ok)throw new Error(dn(y,b.status));if(!a)throw new Error("Scout started the audio connection without a concurrency lease. Please try again.");return c=setInterval(()=>{if(!a||r)return;const m=a;mn(m).then(L=>{if(!(r||m!==a)){if(L){p=0;return}e.onError?.("Realtime voice lost its server lease. Reconnect to continue safely."),P()}}).catch(()=>{p+=1,!(p<2||r)&&(e.onError?.("Realtime voice could not renew its server lease. Check the connection and try again."),P())})},rn),await he(t.setRemoteDescription({type:"answer",sdp:y}),e.signal),ie(e.signal),{leaseId:a,stop:T}}catch(u){throw await T(),u}}async function sn(e){const t=ln(e.functionCall.arguments);if(!t){e.onTrace("Scoutbot request could not be read",void 0,"error"),ve(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(nn,{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(un(r,n.status));const s=JSON.parse(r),a=typeof s.reply?.body=="string"?s.reply.body.trim():"";if(!a)throw new Error("Scoutbot returned an empty reply.");const c=Me(a).filter(A=>A.type==="ask-agent").length,p=e.onReply?await e.onReply(a):{agentRequests:{requested:c,sent:0,failed:c}},f=lt(a);e.onTrace("Scoutbot reply ready",void 0,"scoutbot"),ve(e,{ok:!0,reply:f,...p.agentRequests.requested>0?{agentRequests:p.agentRequests}:{}})}catch(n){const r=n instanceof Error?n.message:"Scoutbot could not complete the voice request.";e.onTrace("Scoutbot request failed",r,"error"),ve(e,{ok:!1,error:r})}}function ve(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 Ke(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 an(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 cn(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 ln(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 un(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 dn(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(be(t));t.addEventListener("abort",s,{once:!0}),e.then(a=>{t.removeEventListener("abort",s),n(a)},a=>{t.removeEventListener("abort",s),r(a)})})):e}async function _e(e,t){return t?(ie(t),new Promise((n,r)=>{let s=!1;const a=()=>{s=!0,r(be(t))};t.addEventListener("abort",a,{once:!0}),e.then(c=>{if(t.removeEventListener("abort",a),s||t.aborted){c.getTracks().forEach(p=>p.stop());return}n(c)},c=>{t.removeEventListener("abort",a),s||r(c)})})):e}const Le={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1},fn=/\b(?:airpods?|earbuds?|earphones?|headsets?|headphones?|buds?|hands[- ]?free)\b/iu;function pn(e){return fn.test(e?.trim()??"")?tn:en}async function hn(e,t){const n=await je(e);let r=await _e(navigator.mediaDevices.getUserMedia({audio:{...Le,...n?{deviceId:{exact:n.deviceId}}:{}}}),t);if(!n&&e?.trim()){const s=await je(e),a=r.getAudioTracks?.()[0]?.label?.trim().toLocaleLowerCase()??"";if(s&&s.label.trim().toLocaleLowerCase()!==a)try{const c=await _e(navigator.mediaDevices.getUserMedia({audio:{...Le,deviceId:{exact:s.deviceId}}}),t);r.getTracks().forEach(p=>p.stop()),r=c}catch(c){if(t?.aborted)throw r.getTracks().forEach(p=>p.stop()),c}}for(const s of r.getAudioTracks?.()??[])s.contentHint="speech";return r}async function je(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 be(e)}function be(e){return e.reason instanceof Error?e.reason:new DOMException("Realtime voice connection was cancelled.","AbortError")}async function mn(e){return(await fetch(`${$e}/${encodeURIComponent(e)}`,{method:"PUT"})).ok}async function vn(e){const t=await fetch(`${$e}/${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 gn=[{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"}}],wn=[{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 bn(e){const t=e==="macos";return{host:e,shellLabel:t?"Scout for macOS":"OpenScout web",destinations:t?wn:gn,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 yn="scout:scoutbot-realtime-reply",me="scout:scoutbot-session-changed",Sn={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:()=>{}},ze=o.createContext(Sn);function Cn({children:e}){const{route:t,applyScoutbotUiAction:n}=Qe(),r=Pe(Je,!1),[s,a]=o.useState(!1),[c,p]=o.useState("idle"),[f,A]=o.useState(null),[w,T]=o.useState(null),[P,j]=o.useState([]),[u,g]=o.useState(null),[S,O]=o.useState(null),k=o.useRef(null),E=o.useRef(null),_=o.useRef(null),I=o.useRef(0),d=o.useRef(!1),h=o.useRef(!1),b=o.useRef({route:t,applyScoutbotUiAction:n});b.current={route:t,applyScoutbotUiAction:n};const y=o.useCallback((v,C,R="voice")=>{j(M=>[...M,{id:`voice-ui-${Date.now()}-${M.length}`,at:Date.now(),kind:R,label:v,...C?{detail:C}:{}}].slice(-100))},[]),m=o.useCallback(()=>j([]),[]),L=o.useCallback(async()=>{const v=await $("/api/scoutbot/session");return d.current||g(v),v},[]);o.useEffect(()=>{if(!r)return;const v=()=>{L().catch(C=>{d.current||T(C instanceof Error?C.message:"Could not load Scoutbot chats.")})};return v(),window.addEventListener(me,v),()=>window.removeEventListener(me,v)},[r,L]);const D=o.useCallback(async()=>{I.current+=1;const v=_.current;E.current?.abort(),E.current=null;const C=k.current;k.current=null;try{await C?.stop(),await v}catch(R){return d.current||(p("error"),T(R instanceof Error?R.message:"Could not end realtime voice cleanly.")),!1}return d.current||(A(null),p("ended"),y("Live voice ended","Microphone and host lease released","voice")),!0},[y]);o.useEffect(()=>{r||(a(!1),(k.current||c==="connecting"||c==="live")&&D())},[r,D,c]),o.useEffect(()=>(d.current=!1,()=>{d.current=!0,I.current+=1,E.current?.abort(),E.current=null,k.current?.stop().catch(()=>{}),k.current=null}),[]);const V=o.useCallback(async v=>{window.dispatchEvent(new CustomEvent(yn,{detail:{body:v}}));const C=v.replace(/```[\s\S]*?```/gu,"").trim();C&&y("Scoutbot replied",C.slice(0,2e3),"scoutbot");let R=0,M=0,K=0;for(const B of Me(v))if(B.type==="ask-agent")R+=1,await An(B,y,T)?M+=1:K+=1;else if(B.type!=="reminder"){const N=xn(B),U=B.type==="navigate"||B.type==="view-file"?"navigation":"scoutbot";y(En(B),N,U),b.current.applyScoutbotUiAction(B),y(Ie()?"Action sent to Scout for macOS":"Action applied in OpenScout",N,U)}return await L().catch(()=>null),{agentRequests:{requested:R,sent:M,failed:K}}},[y,L]),Y=o.useCallback(()=>{const v={type:"navigate",route:{view:"settings",section:"voice"}};y("Voice settings requested",void 0,"navigation"),b.current.applyScoutbotUiAction(v)},[y]),Z=o.useCallback(async()=>{if(!r){T("Turn on live voice in Settings → Voice before starting a call."),a(!1);return}if(h.current||c==="connecting"||c==="live")return;h.current=!0,E.current?.abort();const v=k.current;k.current=null;try{await v?.stop(),A(null)}catch(N){p("error"),T(N instanceof Error?N.message:"Could not end the previous realtime voice call."),h.current=!1;return}const C=new AbortController;E.current=C;const R=I.current+1;I.current=R;let M=()=>{};const K=new Promise(N=>{M=N});_.current=K;let B=!1;T(null),j([{id:"connecting",at:Date.now(),label:"Connecting secure audio"}]),p("connecting");try{const N=await St().then(({settings:q})=>q.inputDeviceName).catch(()=>null),U=await on({signal:C.signal,inputDeviceName:N,getRoute:()=>b.current.route,getUiContext:()=>bn(Ie()?"macos":"web"),onState:q=>{!d.current&&I.current===R&&p(q)},onError:q=>{if(!(d.current||I.current!==R)){if(Ke(q)){y("Scoutbot reply queued","Waiting for the current spoken response to finish","scoutbot");return}T(q),y("Voice issue",q,"error")}},onTrace:q=>{!d.current&&I.current===R&&j(ae=>[...ae,q].slice(-100))},onScoutbotReply:q=>!d.current&&I.current===R?V(q):{agentRequests:{requested:0,sent:0,failed:0}}});if(d.current||C.signal.aborted||I.current!==R){await U.stop();return}k.current=U,A(U.leaseId),B=!0}catch(N){if(!d.current&&I.current===R&&!kn(N)){p("error");const U=N instanceof Error?N.message:"Could not start realtime voice.";T(U),y("Live voice could not start",U,"error")}}finally{!B&&E.current===C&&(E.current=null),M(),_.current===K&&(_.current=null),h.current=!1}},[y,V,r,c]),ee=o.useCallback(async()=>{if(!S){O("new"),T(null);try{if((k.current||c==="connecting"||c==="live")&&!await D())return;if(u?.session.messages.length===0){j([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]);return}const v=await $("/api/scoutbot/session/reset",{method:"POST"});g(v),j([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"New live chat ready"}]),window.dispatchEvent(new CustomEvent(me,{detail:{id:v.session.id}}))}catch(v){const C=v instanceof Error?v.message:"Could not start a new Scoutbot chat.";T(C),y("Could not start a new live chat",C,"error")}finally{O(null)}}},[y,u?.session.messages.length,D,S,c]),te=o.useCallback(async v=>{if(!(!v||S||v===u?.session.id)){O(v),T(null);try{if((k.current||c==="connecting"||c==="live")&&!await D())return;const C=await $("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:v})});g(C),j([{id:`voice-chat-${Date.now()}`,at:Date.now(),kind:"scoutbot",label:"Live chat restored",detail:C.session.title}]),window.dispatchEvent(new CustomEvent(me,{detail:{id:C.session.id}}))}catch(C){const R=C instanceof Error?C.message:"Could not switch Scoutbot chats.";T(R),y("Could not restore the live chat",R,"error")}finally{O(null)}}},[y,u?.session.id,D,S,c]),ne=o.useCallback(async v=>{const C=v.trim();if(!C)throw new Error("Preferred model is required.");const R=await $("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:C})});return g(M=>M&&{...M,config:{...M.config,...R.config}}),y("Scoutbot preferred model updated",R.config.model,"scoutbot"),R.config.model},[y]),re=o.useMemo(()=>({enabled:r,open:s,state:c,leaseId:f,error:w,trace:P,chatState:u,sessionAction:S,setOpen:a,startCall:Z,endCall:D,startNewChat:ee,switchChat:te,updatePreferredModel:ne,clearTrace:m,openVoiceSettings:Y}),[r,s,c,f,w,P,u,S,Z,D,ee,te,ne,m,Y]);return i.jsx(ze.Provider,{value:re,children:e})}function kn(e){return(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError"}function vr(){return o.useContext(ze)}function En(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 xn(e){return e.type==="navigate"?JSON.stringify(e.route):e.type==="view-file"?e.path:e.reason?.trim()||e.type}async function An(e,t,n){t("Scoutbot is coordinating",`Asking ${e.targetLabel}`,"agent");try{const r=await $("/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 ge(e,t){const n=t?.trim();n&&e.add(n)}function Tn(e,t){const n=new Set;return ge(n,e.authorityNodeId),ge(n,e.homeNodeId),n.size===0&&ge(n,t),n}function Ge(e,t,n){return t?Tn(e,n).has(t):!0}function Rn(e,t,n){return t?e.filter(r=>Ge(r,t,n)):e}function gr(e,t,n){return t?new Set(e.filter(r=>Ge(r,t,n)).map(r=>r.id)):null}function G(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 In(e,t,n){return G(e,t,n)}function wr(e,t,n){return!t&&!n?e:e.filter(r=>In(r,t,n))}function Nn(e,t){return G(e,t)}function On(e,t){return t?e.filter(n=>Nn(n,t)):e}function De(e,t){return G(e,t)}function br(e,t){if(!e||!t)return e;const n=e.activeAsks.filter(c=>G(c,t)),r=e.recentCompleted.filter(c=>G(c,t)),s=e.needsAttention.filter(c=>G(c,t)),a=On(e.activity,t);return{...e,totals:{active:n.length,recentCompleted:r.length,needsAttention:s.length,activity:a.length},activeAsks:n,recentCompleted:r,needsAttention:s,activity:a}}function yr(e,t){if(!t)return e;const n=e.activeFlights.filter(a=>G(a,t)),r=e.childWork.filter(a=>De(a,t));return De(e,t)||n.length>0||r.length>0?{...e,activeFlights:n,childWork:r}:null}function _n(e){return!!(e&&(e.message.trim().length>0||e.files.length>0||e.forwardContext))}function Ln(e){return[e.name,e.type,e.size,e.lastModified].join(":")}function jn(e,t){const n=new Set;return[...e,...t].filter(r=>{const s=Ln(r);return n.has(s)?!1:(n.add(s),!0)})}function Dn(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:jn(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 Pn({request:e,onClose:t,onOpenCapture:n}){const{agents:r,route:s,navigate:a}=Qe(),c=ot(s),p=Rn(r,c),f=kt(s,p),[A,w]=o.useState(0),[T,P]=o.useState(null),[j,u]=o.useState(null),g=o.useRef(0),S=e?Dn(j,e):null,O=o.useCallback((E,_)=>{if(E.length===0)return;const I=!!(f.agentId||f.conversationId);n({intent:I?"route-capture":"new-task",files:E,attachmentFeedback:_,agentId:f.agentId??void 0,conversationId:f.conversationId??void 0,preferExistingChat:f.canUseExistingChat})},[n,f]);o.useEffect(()=>{if(!T)return;const E=window.setTimeout(()=>P(null),5e3);return()=>window.clearTimeout(E)},[T]),o.useEffect(()=>{const E=b=>{pe(b.dataTransfer)&&(b.preventDefault(),g.current+=1,w(g.current))},_=b=>{pe(b.dataTransfer)&&(b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="copy"))},I=()=>{g.current!==0&&(g.current=Math.max(0,g.current-1),w(g.current))},d=b=>{if(!pe(b.dataTransfer))return;b.preventDefault();const y=Ne(b.dataTransfer),m=y.filter(Oe),L=y.length-m.length;if(g.current=0,w(0),m.length===0){P(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 D=m.length===1?`Dropped ${m[0]?.name||"1 attachment"}.`:`Dropped ${m.length} attachments.`,V=L>0?`${D} Skipped ${L} unsupported ${L===1?"file":"files"}.`:D;P(null),O(m,V)},h=b=>{if(Ct(b.target)||!pe(b.clipboardData))return;b.preventDefault();const y=Ne(b.clipboardData),m=y.filter(Oe);if(m.length===0){P(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}O(m,m.length===1?`Pasted ${m[0]?.name||"1 attachment"}.`:`Pasted ${m.length} attachments.`)};return window.addEventListener("dragenter",E),window.addEventListener("dragover",_),window.addEventListener("dragleave",I),window.addEventListener("drop",d),window.addEventListener("paste",h),()=>{window.removeEventListener("dragenter",E),window.removeEventListener("dragover",_),window.removeEventListener("dragleave",I),window.removeEventListener("drop",d),window.removeEventListener("paste",h)}},[O]);const k=A>0&&!e;return i.jsxs(i.Fragment,{children:[k?i.jsx("div",{className:"s-capture-drop",role:"presentation",children:i.jsxs("div",{className:"s-capture-drop-card",children:[i.jsx("div",{className:"s-capture-drop-title",children:"Route capture"}),i.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,T?i.jsx("div",{className:"s-capture-feedback",role:"alert",children:T}):null,e?i.jsx(Et,{agents:p,route:s,navigate:a,onClose:t,initialAgentId:S?.agentId,initialConversationId:S?.conversationId,initialMessage:S?.message,initialFiles:S?.files,initialAttachmentFeedback:S?.attachmentFeedback??void 0,initialIntent:S?.intent,initialProjectPath:S?.projectPath,initialProjectQuery:S?.projectQuery,initialForwardContext:S?.forwardContext,initialForwardContextMode:S?.forwardContextMode,defaultMode:S?.mode,draftRestored:_n(j),onDraftChange:u,onDraftConsumed:()=>u(null)}):null]})}const We=o.createContext(null),Mn=["hello","node.upserted","actor.registered","agent.registered","agent.endpoint.upserted","invocation.requested","flight.updated","delivery.state.changed","scout.dispatched"],Fn=new Set(Mn),Bn=3e4,Un=250;function qn(e,t){try{return JSON.stringify(e)===JSON.stringify(t)?e:t}catch{return t}}const Vn={"--hud-bg":"oklch(0.132 0.004 260)","--hud-surface":"oklch(0.178 0.005 260)","--hud-ink":"oklch(0.965 0.006 260)","--hud-muted":"oklch(0.72 0.008 260)","--hud-dim":"oklch(0.57 0.007 260)","--hud-border":"oklch(0.965 0.006 260 / 0.04)","--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.965 0.006 260 / 0.012)","--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) 92%, transparent)","--scout-chrome-ink":"color-mix(in srgb, var(--hud-ink) 78%, transparent)","--scout-chrome-ink-soft":"color-mix(in srgb, var(--hud-ink) 58%, transparent)","--scout-chrome-ink-faint":"color-mix(in srgb, var(--hud-ink) 55%, transparent)","--scout-chrome-ink-ghost":"color-mix(in srgb, var(--hud-ink) 48%, 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-ink) 4%, 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)"},Hn={"--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)"},$n=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 Jn(e){return Object.fromEntries(Object.entries(e==="light"?Hn:Vn).filter(([n])=>!$n.has(n)))}function Qe(){const e=o.useContext(We);if(!e)throw new Error("useScout must be used inside ScoutProvider");return e}function Sr({children:e,initialTheme:t="dark"}){const{route:n,navigate:r,navigateBack:s,canNavigateBack:a}=st(),c=xt(),p=Pe(Je,!1),[f,A]=o.useState([]),[w,T]=o.useState(!1),[P,j]=o.useState({status:"checking",message:null,lastCheckedAt:null}),[u,g]=o.useState(Te),[S,O]=o.useState(null),[k,E]=o.useState(!1),[_,I]=o.useState(null),[d,h]=o.useState(null),[b,y]=o.useState(""),[m,L]=o.useState(null),D=n.view==="settings",V=o.useMemo(()=>n.view!=="broker"||!n.attemptId?null:_?.id===n.attemptId?_:null,[_,n]),Y=o.useMemo(()=>n.view!=="search"||!n.hitId?null:d?.id===n.hitId?d:null,[d,n]),Z=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]),ee=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]),te=o.useCallback(()=>{r({view:"settings",section:"appearance"})},[r]),ne=o.useCallback(()=>{n.view==="settings"&&r({view:"inbox"})},[r,n.view]),re=o.useCallback(l=>{L(l??{intent:"new-task"})},[]),v=o.useCallback(()=>L(null),[]),C=o.useCallback(l=>{I(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]),R=o.useCallback(()=>{I(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(h(l),typeof x=="string"&&y(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]),K=o.useCallback(()=>{h(null),y(""),n.view==="search"&&n.hitId&&r({view:"search",...n.mode?{mode:n.mode}:{},...n.filters?{filters:n.filters}:{}},{replace:!0})},[r,n]),B=o.useMemo(()=>et(),[]),N=c?.resolvedTheme??t,U=c?.template??"hudson",q=o.useMemo(()=>({...Jn(N),...B??{}}),[B,N]),ae=o.useCallback(l=>{g(x=>({...x,...l}))},[]);o.useEffect(()=>{tt(N,U,u),nt(u)},[U,u,N]),o.useEffect(()=>{const l=x=>{x.key!==null&&x.key!==rt||g(Te())};return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[]);const ye=o.useMemo(()=>ut(f),[f]),Se=ye?.id??dt(f),Ce=ye?.conversationId??null,ce=o.useRef(null),W=o.useRef(null),le=n.view==="ops"?"/api/agents":"/api/agents?detail=summary",ue=o.useCallback(()=>{j({status:"online",message:null,lastCheckedAt:Date.now()})},[]),de=o.useCallback(l=>{const x=At(l);j({status:Tt(x)?"offline":"degraded",message:x,lastCheckedAt:Date.now()})},[]),J=o.useCallback(async()=>{const l=ce.current;if(l&&(await l.promise,l.url===le))return;const x=(async()=>{try{const F=await $(le);A(H=>qn(H,F)),ue()}catch(F){de(F)}finally{T(!0)}})();ce.current={url:le,promise:x};try{await x}finally{ce.current?.promise===x&&(ce.current=null)}},[le,de,ue]),Q=o.useCallback(async()=>{try{const l=await $("/api/onboarding/state");O(l),ue()}catch(l){de(l),O({hasLocalConfig:!0,hasProjectConfig:!0,hasOperatorName:!0,localConfigPath:null,projectRoot:null,currentDirectory:null,operatorName:null,operatorNameSuggestion:null})}},[de,ue]),ke=o.useCallback(()=>{E(!0),$("/api/onboarding/skip",{method:"POST",body:"{}"}).then(()=>Q()).catch(()=>null)},[Q]);o.useEffect(()=>{J(),Q()},[J,Q]),o.useEffect(()=>{const l=()=>{Re()&&J()},x=window.setInterval(l,Bn),F=at(l);return()=>{window.clearInterval(x),F()}},[J]);const Ee=o.useMemo(()=>f.filter(l=>ct(l.state)).length,[f]),[Xe,xe]=o.useState(null),oe=o.useCallback(l=>{l?.trim()&&xe(l.trim())},[]),se=o.useCallback(()=>xe(null),[]),X=o.useCallback(l=>{if(!ft(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":J();break;case"view-file":oe(l.path);break}},[r,oe,J]),Ye=o.useCallback((l,x)=>{const F=l.trim(),H=x.trim();if(!F||!H)return;const Ae=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,...Ae?{returnConversationId:Ae}:{}}})},[X,se,n]),fe=o.useRef({applyScoutbotUiAction:X});fe.current={applyScoutbotUiAction:X},it(l=>{Re()&&Fn.has(l.kind)&&(W.current!==null&&window.clearTimeout(W.current),W.current=window.setTimeout(()=>{W.current=null,J()},Un))}),o.useEffect(()=>()=>{W.current!==null&&window.clearTimeout(W.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 Ze=o.useMemo(()=>({route:n,navigate:r,navigateBack:s,canNavigateBack:a,agents:f,agentsLoaded:w,onlineCount:Ee,apiConnection:P,reload:J,appearanceDetails:u,updateAppearanceDetails:ae,onboarding:S,refreshOnboarding:Q,onboardingSkipped:k,skipOnboarding:ke,settingsOpen:D,openSettings:te,closeSettings:ne,scoutbotAgentId:Se,scoutbotConversationId:Ce,applyScoutbotUiAction:X,selectedBrokerAttempt:V,inspectBrokerAttempt:C,clearBrokerAttempt:R,selectedKnowledgeHit:Y,selectedKnowledgeQuery:b,inspectKnowledgeHit:M,clearKnowledgeHit:K,focusedSession:Z,focusSession:ee,openFilePreview:oe,closeFilePreview:se,openContextCapture:re,closeContextCapture:v}),[n,r,s,a,f,w,Ee,P,J,u,ae,S,Q,k,ke,D,te,ne,Se,Ce,X,V,C,R,Y,b,M,K,Z,ee,oe,se,re,v]);return i.jsx(We.Provider,{value:Ze,children:i.jsx("div",{"data-scout-theme-mode":N,"data-scout-palette":u.palette,"data-scout-contrast":u.contrast,"data-scout-accent":u.accent,"data-scout-shell":u.shell,"data-hudson-theme":N,"data-hudson-template":U,style:{...q},children:i.jsx("div",{"data-scout-theme":N,style:{display:"contents"},children:i.jsx(pt,{children:i.jsxs(Wt,{children:[p?i.jsx(Cn,{children:e}):e,i.jsx($t,{path:Xe,onOpenPath:oe,onOpenInCode:Ye,onClose:se}),i.jsx(Pn,{request:m,onClose:v,onOpenCapture:re})]})})})})})}export{Nt as A,_t as C,Vn as D,Hn as L,We as S,Je as a,vr as b,mr as c,On as d,Rn as e,At as f,wr as g,br as h,Tt as i,pr as j,Sr as k,yr as l,gr as m,hr as n,me as o,yn as p,bn as s,Qe 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:18px;height:18px;display:inline-flex}.rr-row-avatar{width:18px;height:18px;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:18px;height:18px;border-radius:var(--radius-sm);background:color-mix(in srgb,var(--ink) 8%,transparent);color:color-mix(in srgb,var(--ink) 70%,transparent);font-family:var(--font-mono);font-size:var(--text-md);font-weight:600;-webkit-user-select:none;user-select:none}.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:var(--muted);letter-spacing:.005em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.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-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-o4FKpU7Z.js";import{n as x,a as M,s as v,b as S}from"./colors-BtO5_zlx.js";import{A as m}from"./AgentAvatar-DMov24_o.js";function T({state:n,className:e,style:s}){x(typeof n=="string"?n:n??null);const a=x(typeof n=="string"?n:n??null)!=="blocked"?M(typeof n=="string"?n:n??null)?"working":"available":null;return r.jsx("span",{className:e,style:{background:v(a),...s}})}function F({name:n,meta:e,sub:s,tone:a="neutral",avatarName:c,avatarKind:o="user",leadingIcon:i,caret:l,active:f,selected:g,unread:N,depth:k=0,detail:t,expanded:d,activityLabel:h,worktreeLabel:p,activityTone:y="working",actions:u,pinned:w,onClick:b,onKeyDown:C,onContextMenu:A,onPointerEnter:P,onPointerLeave:B,title:R,tabIndex:$}){const z=l?l==="open":t!==void 0?!!d:void 0,L=["rr-row",k===1&&"rr-row--child",f&&"rr-row--active",g&&"rr-row--selected",N&&"rr-row--unread",d&&"rr-row--expanded",h&&"rr-row--motion",w&&"rr-row--pinned",u&&"rr-row--has-actions"].filter(Boolean).join(" ");return r.jsxs("div",{className:L,children:[r.jsxs("button",{type:"button",className:"rr-row-head",onClick:b,onKeyDown:C,onContextMenu:A,onPointerEnter:P,onPointerLeave:B,title:R,tabIndex:$,"aria-expanded":z,children:[r.jsx(D,{icon:i,tone:a,caret:l,avatarName:c,avatarKind:o}),r.jsxs("span",{className:"rr-row-body",children:[r.jsxs("span",{className:"rr-row-name",children:[w?r.jsx("span",{className:"rr-row-pin-mark","aria-label":"Pinned",title:"Pinned",children:r.jsx(I,{})}):null,n]}),s&&r.jsx("span",{className:"rr-row-sub",children:s}),p&&r.jsx("span",{className:"rr-row-worktree",children:p}),h&&r.jsxs("span",{className:`rr-row-activity rr-row-activity--${y}`,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:h})]})]}),e&&r.jsx("span",{className:"rr-row-meta",children:e})]}),u?r.jsx("div",{className:"rr-row-actions",onClick:E=>E.stopPropagation(),children:u}):null,d&&t&&r.jsx("div",{className:"rr-row-detail",children:t})]})}function D({icon:n,tone:e,caret:s,avatarName:a,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(a){if(c==="channel")return r.jsx(m,{kind:"channel",name:a,channelClassName:"rr-row-hash"});const i=j(e),l=i==="active"||i==="available";return r.jsxs("span",{className:"rr-row-avatar-wrap","aria-hidden":!0,children:[r.jsx(m,{name:a,placement:"roster",className:"rr-row-avatar"}),l&&r.jsx(T,{state:i,className:`rr-row-presence rr-row-presence--${i}`})]})}if(n)return r.jsx("span",{className:"rr-row-icon","aria-hidden":!0,children:n});const o=j(e);return r.jsx("span",{className:`rr-row-dot rr-row-dot--${o}`,style:o==="active"||o==="available"?{background:v(o)}:void 0,"aria-hidden":!0})}function G({open:n}){return r.jsx("svg",{className:`rr-chevron${n?" 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 j(n){return n==="channel"||n==="dm"||n==="neutral"?n:S(n)}function I(){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{F as R};
@@ -1 +0,0 @@
1
- import{r as o,j as n}from"./index-o4FKpU7Z.js";/* empty css */import{D as O}from"./DataTable-CGw5CECG.js";import{p as W,a as L}from"./api-h5zurxmi.js";import{t as U,n as R,f as Y}from"./time-Dhsh_2EG.js";import{u as G}from"./tail-events-NLIWLq27.js";import{o as Q}from"./openContent-C6XO6kr5.js";import{u as X}from"./Provider-DKZWuzSR.js";/* empty css */import"./index-BWHgHrtv.js";import"./provider-BvAxRQfE.js";import"./router-C65cZYPn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CL6gctHY.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CxkmFQcN.js";import"./DocumentFocusViewer-DRKjNG9s.js";import"./createLucideIcon-Bt67PWH-.js";import"./TextDocumentSurface-Bc-kHPgG.js";/* empty css */import"./file-text-iF0hyVyU.js";import"./x-ynOfVadO.js";import"./chevron-right-C10o7t_X.js";import"./code-xml-CLn3TDWF.js";import"./arrow-left-BOht-YQu.js";import"./scout-voice-B7kXlkcl.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-Chf51dns.js";import"./MessageComposerSuggestions-Dfc3PH2y.js";import"./NewChatComposer-S08F6_La.js";import"./runtime-picker-eDEvx2Mz.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-4LDsy4Ke.js";import"./index-BMwKgdz_.js";import"./HarnessMark-MztYnrGK.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-BEz6jyqf.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-NAhBUkFd.js";import"./search-7_n7CxWl.js";import"./chunk-HRAB3GC3-DF8R9rPv.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 Jt({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{Jt as RawSessionsTable};