@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
@@ -0,0 +1 @@
1
+ import{r as c,j as s}from"./index-Bli6bTLU.js";import{a as k}from"./api-DEHEgJ9m.js";import{u as R}from"./sse-CSozY6mp.js";import{d as $,t as F}from"./time-Dhsh_2EG.js";import{SessionRefScreen as j}from"./SessionRefScreen-BmKhf29o.js";/* empty css */import{c as E}from"./createLucideIcon-DLlxGjKt.js";import{X as A}from"./x-BJyPzFnn.js";import"./index-BWHgHrtv.js";import"./tail-events-CrN-Rmxj.js";import"./BackToPicker-CqYhOaLB.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./ConversationScreen-CjWWmuuh.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./colors-BtO5_zlx.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./keyboard-nav-7iEtvu9P.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./file-text-BVhkMWyC.js";import"./ConversationComposer-Ce7Byw48.js";import"./AgentAvatar-B1xvQ7ej.js";import"./Provider-Ve8yXaWR.js";import"./provider-CX9EWecp.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./SpriteAvatar-DMrSssNZ.js";import"./agent-identity-DzHGhLdJ.js";import"./zap-rw7uwZht.js";import"./message-markup-DAnnGpWr.js";import"./mentions-Cd6XticV.js";import"./AgentDetailCard-FelCxQrT.js";import"./AgentLiveActions-Bn3zeZBN.js";import"./terminal-takeover-CtA3wcXh.js";import"./openContent-C6XO6kr5.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./message-visibility-kJM8XcSG.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-C3sg0ULI.js";import"./AstronautSuit-BADl7m8x.js";import"./ConversationFeedRows-DygDfQn_.js";import"./ConversationPanels-Dg4Y2GgX.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./use-reduced-motion-BLn59zLn.js";import"./proxy-C35W-YHZ.js";import"./activity-D4W2XZY2.js";import"./message-circle-44KSmbvQ.js";import"./ConversationStatus-BhVIYQza.js";import"./check-Bfs7hMb1.js";import"./sparkles-ytTwpCbZ.js";import"./SessionObserve-zAlFbwFn.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-197xYmRp.js";import"./lane-observe-vfyACHi0.js";import"./lane-ask-display-B6iCAVcd.js";import"./ObservedTopologyPanel-D85P6RAk.js";import"./ObserveTextFlow-C1f5oize.js";import"./SessionObserveEvidence-BVawzqoE.js";import"./wrench-CQvdf7KT.js";import"./external-link-BGHC_naA.js";/* empty css */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],L=E("columns-2",T);function S(t){const o=new Map;for(const r of t)o.delete(r.sessionId),o.set(r.sessionId,r);return[...o.values()]}function M(t,o){const r=S(t),p=o?.trim()||null;return r.find(n=>n.sessionId===p)?.sessionId??r.at(-1)?.sessionId??p}function O(t){return t.length<=34?t:`${t.slice(0,15)}…${t.slice(-14)}`}function q(t,o){return o===0?t.strategy||"dispatch":t.strategy?`switched via ${t.strategy}`:"session changed"}function y({label:t,sessions:o,value:r,onChange:p}){return s.jsxs("label",{className:"s-flight-observe-select-wrap",children:[s.jsx("span",{children:t}),s.jsx("select",{className:"s-flight-observe-select",value:r,onChange:n=>p(n.currentTarget.value),children:o.map(n=>s.jsxs("option",{value:n.sessionId,children:[n.harness?`${n.harness} · `:"",n.sessionId]},n.sessionId))})]})}function ge({route:t,navigate:o}){const[r,p]=c.useState(null),[n,I]=c.useState(!0),[h,N]=c.useState(null),u=c.useCallback(async()=>{try{const e=await k(`/api/flights?active=false&flightId=${encodeURIComponent(t.flightId)}`);p(e[0]??null),N(e.length===0?"This flight is not available on the connected broker.":null)}catch(e){N(e instanceof Error?e.message:String(e))}finally{I(!1)}},[t.flightId]);c.useEffect(()=>{I(!0),u()},[u]),R(()=>{u()});const v=r?.sessions??[],a=c.useMemo(()=>S(v),[v]),g=M(v,t.sessionId),i=a.find(e=>e.sessionId===g)??null,l=a.find(e=>e.sessionId===t.compareSessionId)??null,f=!!(i&&l&&i.sessionId!==l.sessionId),m=c.useCallback((e,d)=>{o({...t,sessionId:e,...d?{compareSessionId:d}:{compareSessionId:void 0}})},[o,t]),w=c.useCallback(()=>{if(!i||a.length<2)return;const e=[...a].reverse().find(d=>d.sessionId!==i.sessionId);e&&m(i.sessionId,e.sessionId)},[i,a,m]),C=c.useCallback(e=>{if(!f||!i||!l){m(e);return}m(e,e===l.sessionId?i.sessionId:l.sessionId)},[l,i,f,m]);return s.jsxs("div",{className:"s-flight-observe",children:[s.jsxs("header",{className:"s-flight-observe-header",children:[s.jsxs("div",{className:"s-flight-observe-heading",children:[s.jsx("div",{className:"s-flight-observe-eyebrow",children:"Flight observe"}),s.jsxs("div",{className:"s-flight-observe-title-row",children:[s.jsx("h2",{children:r?.agentName||r?.agentId||"Flight"}),s.jsx("span",{className:`s-flight-observe-state s-flight-observe-state--${r?.state??"loading"}`,children:r?.state??(n?"loading":"unknown")})]}),s.jsx("div",{className:"s-flight-observe-id",title:t.flightId,children:t.flightId}),r?.summary&&s.jsx("p",{children:r.summary})]}),s.jsxs("div",{className:"s-flight-observe-actions",children:[a.length>1&&!f&&s.jsxs("button",{type:"button",onClick:w,children:[s.jsx(L,{size:13})," Split view"]}),f&&i&&s.jsxs("button",{type:"button",onClick:()=>m(i.sessionId),children:[s.jsx(A,{size:13})," Close split"]})]})]}),v.length>0&&s.jsx("nav",{className:"s-flight-observe-trace","aria-label":"Flight session history",children:v.map((e,d)=>{const b=i?.sessionId===e.sessionId,x=l?.sessionId===e.sessionId;return s.jsxs("div",{className:"s-flight-observe-trace-step",children:[d>0&&s.jsx("span",{className:"s-flight-observe-trace-arrow","aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:"s-flight-observe-session-chip","data-selected":b||x,"data-observe-role":b?"primary":x?"compare":"idle","aria-pressed":b||x,title:e.sessionId,onClick:()=>C(e.sessionId),children:[s.jsxs("span",{className:"s-flight-observe-session-chip-top",children:[s.jsx("span",{children:e.harness||e.transport||"session"}),s.jsx("time",{title:new Date(e.startedAt).toLocaleString(),children:$(e.startedAt)||F(e.startedAt)})]}),s.jsx("strong",{children:O(e.sessionId)}),s.jsx("small",{children:q(e,d)})]})]},`${e.sessionId}:${e.startedAt}:${d}`)})}),h&&!g&&s.jsx("div",{className:"s-flight-observe-message s-flight-observe-message--error",children:h}),h&&g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Flight record unavailable"}),s.jsx("span",{children:"Showing the concrete session captured by this link."})]}),!h&&n&&s.jsx("div",{className:"s-flight-observe-message",children:"Resolving the flight’s session trace…"}),!h&&!n&&a.length===0&&!g&&s.jsxs("div",{className:"s-flight-observe-message",children:[s.jsx("strong",{children:"Waiting for a session"}),s.jsx("span",{children:"The flight is stable here; its trace will appear as soon as a harness acknowledges dispatch."})]}),g&&!f&&s.jsx("main",{className:"s-flight-observe-single",children:s.jsx(j,{sessionRef:g,navigate:o})}),!h&&i&&l&&f&&s.jsxs("main",{className:"s-flight-observe-split",children:[s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Primary session",sessions:a,value:i.sessionId,onChange:e=>m(e,e===l.sessionId?i.sessionId:l.sessionId)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:i.sessionId,navigate:o,showObserveRail:!1})})]}),s.jsxs("section",{className:"s-flight-observe-pane",children:[s.jsx(y,{label:"Compare session",sessions:a.filter(e=>e.sessionId!==i.sessionId),value:l.sessionId,onChange:e=>m(i.sessionId,e)}),s.jsx("div",{className:"s-flight-observe-pane-content",children:s.jsx(j,{sessionRef:l.sessionId,navigate:o,showObserveRail:!1})})]})]})]})}export{ge as FlightObserveScreen};
@@ -1 +1 @@
1
- import{r as o,j as r}from"./index-o4FKpU7Z.js";import{a as h}from"./api-h5zurxmi.js";import{t as p,r as c,m as g}from"./follow-route-BvcGtBIL.js";import{s as l}from"./router-C65cZYPn.js";/* empty css */import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";function N({route:e,navigate:t}){const[d,m]=o.useState(null),i=o.useMemo(()=>p(e),[e]);return o.useEffect(()=>{let n=!1;const s=new URLSearchParams;return e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),(async()=>{try{const a=s.toString(),f=a?await h(`/api/follow?${a}`):i;if(n)return;t(l(c(g(f,i),e.preferredView),e.machineId??null))}catch(a){if(n)return;m(a instanceof Error?a.message:String(a)),t(l(c(i,e.preferredView),e.machineId??null))}})(),()=>{n=!0}},[i,t,e]),r.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:r.jsx("section",{className:"s-thread-overview",children:r.jsxs("div",{className:"s-thread-overview-copy",children:[r.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[r.jsx("h2",{className:"s-page-title",children:"Follow"}),r.jsx("span",{className:"s-meta s-tabular",children:e.preferredView??"auto"})]}),r.jsx("p",{className:"s-thread-overview-summary",children:d?"Opening the closest available Scout view.":"Resolving Scout context..."})]})})})}export{N as FollowScreen};
1
+ import{r as o,j as r}from"./index-Bli6bTLU.js";import{a as h}from"./api-DEHEgJ9m.js";import{t as p,r as c,m as g}from"./follow-route-BvcGtBIL.js";import{s as l}from"./router-B0YclXYg.js";/* empty css */import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";function N({route:e,navigate:t}){const[d,m]=o.useState(null),i=o.useMemo(()=>p(e),[e]);return o.useEffect(()=>{let n=!1;const s=new URLSearchParams;return e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),(async()=>{try{const a=s.toString(),f=a?await h(`/api/follow?${a}`):i;if(n)return;t(l(c(g(f,i),e.preferredView),e.machineId??null))}catch(a){if(n)return;m(a instanceof Error?a.message:String(a)),t(l(c(i,e.preferredView),e.machineId??null))}})(),()=>{n=!0}},[i,t,e]),r.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:r.jsx("section",{className:"s-thread-overview",children:r.jsxs("div",{className:"s-thread-overview-copy",children:[r.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[r.jsx("h2",{className:"s-page-title",children:"Follow"}),r.jsx("span",{className:"s-meta s-tabular",children:e.preferredView??"auto"})]}),r.jsx("p",{className:"s-thread-overview-summary",children:d?"Opening the closest available Scout view.":"Resolving Scout context..."})]})})})}export{N as FollowScreen};
@@ -1 +1 @@
1
- import{j as e}from"./index-o4FKpU7Z.js";function p(o){const i=o?.trim().toLowerCase();if(!i)return"unknown";const n=i.replace(/[\s(].*$/,"").replace(/[_-].*$/,""),l={anthropic:"claude",claude:"claude",claudecode:"claude",sonnet:"claude",opus:"claude",openai:"codex",codex:"codex",gpt:"codex",chatgpt:"codex",oai:"codex",xai:"grok",grok:"grok",kimi:"kimi",moonshot:"kimi",google:"gemini",gemini:"gemini",vertex:"gemini",cursor:"cursor",github:"github",opencode:"opencode",oc:"opencode",amp:"amp",sourcegraph:"amp",pi:"pi",inflection:"pi",omp:"pi","oh-my-pi":"pi",claw:"claw",native:"native",worker:"worker",quad:"quad"};return l[n]??l[i.replace(/[\s(].*$/,"")]??i}const m={claude:"Claude",codex:"Codex",grok:"Grok",kimi:"Kimi",gemini:"Gemini",cursor:"Cursor",github:"GitHub",opencode:"OpenCode",amp:"Amp",pi:"Pi",claw:"Claw",native:"Native",worker:"Worker",quad:"Quad"};function g(o){const i=p(o);return m[i]??(o?.trim()||"Unknown")}const c={fill:{fill:"currentColor"},line:{fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},t={claude:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",gemini:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",cursor:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",github:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",opencode:"M22 24H2V0h20zM17 4.8H7v14.4h10z"},r=o=>e.jsx("path",{d:o,fill:"currentColor"}),k={amp:{viewBox:"0.6 1.4 8.8 8.8",paths:["M2.37694 9.23487L4.34679 7.23716L5.06365 9.95891L6.10505 9.67408L5.06749 5.72214L1.17831 4.6688L0.901367 5.73289L3.5775 6.45984L1.61584 8.45465L2.37694 9.23487Z","M8.05742 6.91898L9.09885 6.63416L8.0613 2.68224L4.17209 1.62891L3.89515 2.693L7.17936 3.58514L8.05742 6.91898Z","M6.56226 8.43797L7.60365 8.15314L6.5661 4.20121L2.67692 3.14787L2.39998 4.21196L5.68416 5.10411L6.56226 8.43797Z"]},grok:{viewBox:"0 0 34 33",paths:["M13.2371 21.0407L24.3186 12.8506C24.8619 12.4491 25.6384 12.6057 25.8973 13.2294C27.2597 16.5185 26.651 20.4712 23.9403 23.1851C21.2297 25.8989 17.4581 26.4941 14.0108 25.1386L10.2449 26.8843C15.6463 30.5806 22.2053 29.6665 26.304 25.5601C29.5551 22.3051 30.562 17.8683 29.6205 13.8673L29.629 13.8758C28.2637 7.99809 29.9647 5.64871 33.449 0.844576C33.5314 0.730667 33.6139 0.616757 33.6964 0.5L29.1113 5.09055V5.07631L13.2343 21.0436","M10.9503 23.0313C7.07343 19.3235 7.74185 13.5853 11.0498 10.2763C13.4959 7.82722 17.5036 6.82767 21.0021 8.2971L24.7595 6.55998C24.0826 6.07017 23.215 5.54334 22.2195 5.17313C17.7198 3.31926 12.3326 4.24192 8.67479 7.90126C5.15635 11.4239 4.0499 16.8403 5.94992 21.4622C7.36924 24.9165 5.04257 27.3598 2.69884 29.826C1.86829 30.7002 1.0349 31.5745 0.36364 32.5L10.9474 23.0341"]}},C=e.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),j=e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M4.5 3h3.4v7.4L14.7 3h4.5l-7.9 8.5L19.8 21h-4.6l-7.3-8.2V21H4.5Z"}),e.jsx("circle",{cx:"20.2",cy:"3.8",r:"1.8"})]}),v=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M6.5 8.5h11"}),e.jsx("path",{d:"M10 8.5 9 17M14.2 8.5 15.2 17"})]}),w=e.jsxs("g",{...c.line,children:[e.jsx("path",{d:"M6.5 8 11 12l-4.5 4"}),e.jsx("path",{d:"M12.5 16.5H18",strokeWidth:1.8})]}),M=e.jsxs("g",{...c.line,strokeWidth:1.8,children:[e.jsx("path",{d:"M12 4.5 18.5 8.2v7.6L12 19.5 5.5 15.8V8.2L12 4.5Z"}),e.jsx("circle",{cx:12,cy:12,r:2.7})]}),y=e.jsxs("g",{...c.fill,children:[e.jsx("rect",{x:5.5,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:5.5,y:13.1,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:13.1,width:5.4,height:5.4,rx:1.3})]}),f=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M7.5 6Q9.5 12 8.5 18"}),e.jsx("path",{d:"M12 5.5Q14 12 13 18.5"}),e.jsx("path",{d:"M16.5 6Q18.5 12 17.5 18"})]}),b={claude:r(t.claude),codex:C,kimi:j,gemini:r(t.gemini),cursor:r(t.cursor),github:r(t.github),opencode:r(t.opencode),pi:v,native:w,worker:M,quad:y,claw:f};function G({harness:o,size:i=14,className:n,style:l,title:d}){const a=p(o),s=k[a],x=b[a],h=d===null?void 0:d??g(o);return e.jsx("span",{className:n,style:l,title:h,"aria-hidden":h?void 0:!0,children:e.jsx("svg",{viewBox:s?.viewBox??"0 0 24 24",width:i,height:i,style:{display:"block"},role:"img","aria-label":h,children:s?s.paths.map((u,L)=>e.jsx("path",{d:u,fill:"currentColor"},L)):x??e.jsx("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"13",fontWeight:"600",fontFamily:"var(--font-mono)",fill:"currentColor",children:(a[0]??"?").toUpperCase()})})})}export{G as H,g as h};
1
+ import{j as e}from"./index-Bli6bTLU.js";function p(o){const i=o?.trim().toLowerCase();if(!i)return"unknown";const n=i.replace(/[\s(].*$/,"").replace(/[_-].*$/,""),l={anthropic:"claude",claude:"claude",claudecode:"claude",sonnet:"claude",opus:"claude",openai:"codex",codex:"codex",gpt:"codex",chatgpt:"codex",oai:"codex",xai:"grok",grok:"grok",kimi:"kimi",moonshot:"kimi",google:"gemini",gemini:"gemini",vertex:"gemini",cursor:"cursor",github:"github",opencode:"opencode",oc:"opencode",amp:"amp",sourcegraph:"amp",pi:"pi",inflection:"pi",omp:"pi","oh-my-pi":"pi",claw:"claw",native:"native",worker:"worker",quad:"quad"};return l[n]??l[i.replace(/[\s(].*$/,"")]??i}const m={claude:"Claude",codex:"Codex",grok:"Grok",kimi:"Kimi",gemini:"Gemini",cursor:"Cursor",github:"GitHub",opencode:"OpenCode",amp:"Amp",pi:"Pi",claw:"Claw",native:"Native",worker:"Worker",quad:"Quad"};function g(o){const i=p(o);return m[i]??(o?.trim()||"Unknown")}const c={fill:{fill:"currentColor"},line:{fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},t={claude:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",gemini:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",cursor:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",github:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",opencode:"M22 24H2V0h20zM17 4.8H7v14.4h10z"},r=o=>e.jsx("path",{d:o,fill:"currentColor"}),k={amp:{viewBox:"0.6 1.4 8.8 8.8",paths:["M2.37694 9.23487L4.34679 7.23716L5.06365 9.95891L6.10505 9.67408L5.06749 5.72214L1.17831 4.6688L0.901367 5.73289L3.5775 6.45984L1.61584 8.45465L2.37694 9.23487Z","M8.05742 6.91898L9.09885 6.63416L8.0613 2.68224L4.17209 1.62891L3.89515 2.693L7.17936 3.58514L8.05742 6.91898Z","M6.56226 8.43797L7.60365 8.15314L6.5661 4.20121L2.67692 3.14787L2.39998 4.21196L5.68416 5.10411L6.56226 8.43797Z"]},grok:{viewBox:"0 0 34 33",paths:["M13.2371 21.0407L24.3186 12.8506C24.8619 12.4491 25.6384 12.6057 25.8973 13.2294C27.2597 16.5185 26.651 20.4712 23.9403 23.1851C21.2297 25.8989 17.4581 26.4941 14.0108 25.1386L10.2449 26.8843C15.6463 30.5806 22.2053 29.6665 26.304 25.5601C29.5551 22.3051 30.562 17.8683 29.6205 13.8673L29.629 13.8758C28.2637 7.99809 29.9647 5.64871 33.449 0.844576C33.5314 0.730667 33.6139 0.616757 33.6964 0.5L29.1113 5.09055V5.07631L13.2343 21.0436","M10.9503 23.0313C7.07343 19.3235 7.74185 13.5853 11.0498 10.2763C13.4959 7.82722 17.5036 6.82767 21.0021 8.2971L24.7595 6.55998C24.0826 6.07017 23.215 5.54334 22.2195 5.17313C17.7198 3.31926 12.3326 4.24192 8.67479 7.90126C5.15635 11.4239 4.0499 16.8403 5.94992 21.4622C7.36924 24.9165 5.04257 27.3598 2.69884 29.826C1.86829 30.7002 1.0349 31.5745 0.36364 32.5L10.9474 23.0341"]}},C=e.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),j=e.jsxs("g",{fill:"currentColor",children:[e.jsx("path",{d:"M4.5 3h3.4v7.4L14.7 3h4.5l-7.9 8.5L19.8 21h-4.6l-7.3-8.2V21H4.5Z"}),e.jsx("circle",{cx:"20.2",cy:"3.8",r:"1.8"})]}),v=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M6.5 8.5h11"}),e.jsx("path",{d:"M10 8.5 9 17M14.2 8.5 15.2 17"})]}),w=e.jsxs("g",{...c.line,children:[e.jsx("path",{d:"M6.5 8 11 12l-4.5 4"}),e.jsx("path",{d:"M12.5 16.5H18",strokeWidth:1.8})]}),M=e.jsxs("g",{...c.line,strokeWidth:1.8,children:[e.jsx("path",{d:"M12 4.5 18.5 8.2v7.6L12 19.5 5.5 15.8V8.2L12 4.5Z"}),e.jsx("circle",{cx:12,cy:12,r:2.7})]}),y=e.jsxs("g",{...c.fill,children:[e.jsx("rect",{x:5.5,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:5.5,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:5.5,y:13.1,width:5.4,height:5.4,rx:1.3}),e.jsx("rect",{x:13.1,y:13.1,width:5.4,height:5.4,rx:1.3})]}),f=e.jsxs("g",{...c.line,strokeWidth:2,children:[e.jsx("path",{d:"M7.5 6Q9.5 12 8.5 18"}),e.jsx("path",{d:"M12 5.5Q14 12 13 18.5"}),e.jsx("path",{d:"M16.5 6Q18.5 12 17.5 18"})]}),b={claude:r(t.claude),codex:C,kimi:j,gemini:r(t.gemini),cursor:r(t.cursor),github:r(t.github),opencode:r(t.opencode),pi:v,native:w,worker:M,quad:y,claw:f};function G({harness:o,size:i=14,className:n,style:l,title:d}){const a=p(o),s=k[a],x=b[a],h=d===null?void 0:d??g(o);return e.jsx("span",{className:n,style:l,title:h,"aria-hidden":h?void 0:!0,children:e.jsx("svg",{viewBox:s?.viewBox??"0 0 24 24",width:i,height:i,style:{display:"block"},role:"img","aria-label":h,children:s?s.paths.map((u,L)=>e.jsx("path",{d:u,fill:"currentColor"},L)):x??e.jsx("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"13",fontWeight:"600",fontFamily:"var(--font-mono)",fill:"currentColor",children:(a[0]??"?").toUpperCase()})})})}export{G as H,g as h};
@@ -1 +1 @@
1
- import{r as u,j as e}from"./index-o4FKpU7Z.js";import{H as R,h as q}from"./HarnessMark-MztYnrGK.js";import{a as M}from"./api-h5zurxmi.js";import{d as D}from"./router-C65cZYPn.js";import{t as O,n as S,f as L}from"./time-Dhsh_2EG.js";import{u as P}from"./Provider-DKZWuzSR.js";import{u as T}from"./useContentSecondaryNav-DOr5yHbT.js";import{OpsSubnav as E}from"./OpsSubnav-CZs_OL2N.js";/* empty css */import{R as U}from"./refresh-cw-B5To7b6B.js";import{E as $}from"./external-link-Dem738OJ.js";import{c as H}from"./createLucideIcon-Bt67PWH-.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./provider-BvAxRQfE.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"./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"./SecondaryNav-Dj30epYF.js";import"./secondaryNavConfig-CSFDCQAf.js";import"./message-square-ER1_q2pe.js";import"./terminal-By1Lw2i2.js";import"./scroll-text-BuneRiAD.js";/* empty css */const _=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],z=H("clipboard-paste",_),B={codex:"Codex",claude:"Claude",kimi:"Kimi",minimax:"MiniMax",cursor:"Cursor",native:"Native",worker:"Worker",bridge:"Bridge",http:"HTTP",pi:"Pi",flue:"Flue",github:"GitHub",unknown:"Unknown"},C=[{id:"claude",description:"Anthropic plan windows captured from Claude Code.",links:[{label:"Usage",href:"https://claude.ai/settings/usage"},{label:"Manage plan",href:"https://claude.ai/settings/billing"}]},{id:"codex",description:"OpenAI plan windows reported by local Codex sessions.",links:[{label:"Usage",href:"https://chatgpt.com/codex/settings/usage"},{label:"Open Codex",href:"https://chatgpt.com/codex"}]},{id:"kimi",description:"Kimi Code subscription windows and membership level.",links:[{label:"Kimi Code",href:"https://www.kimi.com/code"},{label:"Docs",href:"https://www.kimi.com/code/docs/en/"}]},{id:"grok",description:"SuperGrok quota reported by local Grok, with dashboard capture and local activity as fallbacks.",links:[{label:"Open Grok",href:"https://grok.com/"},{label:"Billing",href:"https://grok.com/?_s=billing"},{label:"Help",href:"https://docs.x.ai/grok/faq"}]},{id:"minimax",description:"MiniMax Token Plan 5-hour and weekly allowance.",links:[{label:"Usage",href:"https://platform.minimax.io/console/plan"},{label:"Docs",href:"https://platform.minimax.io/docs/token-plan/intro"}]},{id:"cursor",description:"Cursor membership detected locally, plus usage totals from an exported dashboard capture.",links:[{label:"Usage",href:"https://cursor.com/dashboard/usage"},{label:"Manage plan",href:"https://cursor.com/dashboard/billing"}]}],G={cloudflare:[{label:"Dashboard",href:"https://dash.cloudflare.com/"},{label:"Billing",href:"https://dash.cloudflare.com/?to=/:account/billing"}],vercel:[{label:"Dashboard",href:"https://vercel.com/dashboard"},{label:"Billing",href:"https://vercel.com/account/billing"}],exe:[{label:"VMs",href:"https://exe.dev/"},{label:"Billing",href:"https://exe.dev/user/billing"},{label:"Docs",href:"https://exe.dev/docs/what-is-exe"}]},V={exe:{category:"Agent compute",description:"Persistent VMs for remote Scout agents and isolated workloads."},cloudflare:{category:"Edge platform",description:"Workers, networking, and edge infrastructure available for deployment."},vercel:{category:"App hosting",description:"Projects, preview environments, and production deployments."}};function W({provider:s}){return e.jsx("span",{className:`hs-cloud-mark hs-cloud-mark--${s}`,"aria-hidden":"true",children:s==="exe"?e.jsx("img",{src:"https://exe.dev/apple-touch-icon.png",alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:s==="cloudflare"?e.jsx("path",{d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268Zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"}):e.jsx("path",{d:"m12 1.608 12 20.784H0Z"})})})}function F(s){const t=(s??"").trim().toLowerCase();return t?t.includes("claude")?"claude":t.includes("codex")?"codex":t.includes("cursor")?"cursor":t.includes("kimi")||t.includes("moonshot")?"kimi":t.includes("minimax")?"minimax":t.includes("github")?"github":t.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown":"unknown"}function N(s){return B[s]??q(s)}function K(s){switch(s){case"weekly":return"7d";case"req/h":return"1h";default:return s||"quota"}}function v(s){return s.windows&&s.windows.length>0?s.windows:[{label:K(s.unitLabel),fill:s.fill,usedLabel:s.usedLabel,capLabel:s.capLabel,unitLabel:s.unitLabel,resetAt:s.resetAt}]}function Q(s){return s.capLabel==="100%"&&s.usedLabel.endsWith("%")?s.usedLabel:`${s.usedLabel}/${s.capLabel}`}function A(s){return s>=.9?"err":s>=.75?"warn":"ok"}function Z(s,t=30){const a=s??[];if(a.length<=t)return a;if(t<=1)return[a[a.length-1]];const r=(a.length-1)/(t-1);return Array.from({length:t},(n,o)=>a[Math.round(o*r)])}function I(s){const t=Math.floor((s-Date.now())/1e3),a=t<0,r=Math.abs(t);let n;if(r>=86400){const o=Math.floor(r/86400),c=Math.floor(r%86400/3600);n=c>0?`${o}d ${c}h`:`${o}d`}else if(r>=3600){const o=Math.floor(r/3600),c=Math.floor(r%3600/60);n=c>0?`${o}h ${c}m`:`${o}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return a?`stale ${n}`:n}function J(s){if(!s)return null;const t=S(s.capturedAt);if(t)return t;if(s.kind!=="quota")return null;const a=v(s).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null);return a||v(s).flatMap(r=>r.history??[]).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null)}function X({provider:s,onImported:t}){const[a,r]=u.useState(!1),[n,o]=u.useState(""),[c,b]=u.useState(!1),[i,d]=u.useState(null),l=`hs-${s}-dashboard-capture`,m=N(s);if(!a)return e.jsxs("button",{type:"button",className:"hs-dashboard-capture-trigger",onClick:()=>r(!0),children:[e.jsx(z,{size:12,"aria-hidden":"true"}),"Import dashboard"]});const x=async p=>{if(p.preventDefault(),!(!n.trim()||c)){b(!0),d(null);try{await M("/api/service-budgets/dashboard-import",{method:"POST",body:JSON.stringify({provider:s,text:n})}),o(""),d("Usage snapshot imported."),await t()}catch(h){d(h instanceof Error?h.message:String(h))}finally{b(!1)}}};return e.jsxs("form",{className:"hs-dashboard-capture",onSubmit:p=>{x(p)},children:[e.jsxs("label",{htmlFor:l,children:[m," usage snapshot"]}),e.jsxs("p",{children:[s==="cursor"?"Paste the exported Usage CSV or copied usage table.":"Copy the signed-in Usage panel and paste it here."," ","Scout keeps only normalized totals, not this text."]}),e.jsx("textarea",{id:l,value:n,onChange:p=>o(p.target.value),maxLength:128*1024,rows:5,placeholder:s==="cursor"?"Date (UTC),Type,Model,Tokens,Cost…":"Weekly SuperGrok… Limit · 12% used · Resets…","aria-describedby":i?`${l}-message`:void 0}),i?e.jsx("span",{id:`${l}-message`,className:"hs-dashboard-capture-message",role:"status",children:i}):null,e.jsxs("div",{className:"hs-dashboard-capture-actions",children:[e.jsx("button",{type:"button",onClick:()=>{r(!1),d(null)},disabled:c,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!n.trim()||c,children:c?"Importing…":"Use snapshot"})]})]})}function Y(s){const t=new Map(s.map(a=>[F(a.id),a]));return C.map(({id:a})=>({id:a,label:N(a),gauge:t.get(a)??null}))}function ee({points:s}){const t=Z(s);return t.length===0?e.jsx("span",{className:"hs-history hs-history-empty",children:"live"}):e.jsx("span",{className:"hs-history","aria-label":`${t.length} budget samples`,children:t.map((a,r)=>{const n=Math.max(.06,Math.min(1,a.fill));return e.jsx("span",{className:`hs-history-bar hs-history-bar--${A(a.fill)}`,style:{height:`${Math.round(n*100)}%`},title:`${L(a.capturedAt)||"unknown"} ${a.usedLabel}`},`${a.capturedAt}:${r}`)})})}function se({gauge:s,window:t}){const a=Math.max(0,Math.min(100,Math.round(t.fill*100))),r=100-a,n=A(t.fill),o=Number.isFinite(t.resetAt)?new Date(t.resetAt).toISOString():void 0;return e.jsxs("div",{className:"hs-subscription-window",children:[e.jsxs("div",{className:"hs-subscription-window-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"hs-subscription-window-label",children:[t.label," window"]}),e.jsxs("strong",{className:`hs-subscription-usage hs-subscription-usage--${n}`,children:[a,"% used"]})]}),e.jsxs("div",{className:"hs-subscription-remaining",children:[e.jsxs("strong",{children:[r,"%"]}),e.jsx("span",{children:"available"})]})]}),e.jsx("div",{className:"hs-subscription-meter",role:"progressbar","aria-label":`${s.label} ${t.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:e.jsx("span",{className:`hs-subscription-meter-fill hs-subscription-meter-fill--${n}`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"hs-subscription-window-meta",children:[e.jsxs("span",{children:[Q(t)," ",t.unitLabel==="quota"?"quota":t.unitLabel]}),e.jsxs("span",{children:["resets in ",I(t.resetAt),o?e.jsx("time",{dateTime:o,title:L(t.resetAt)||void 0,children:` · ${L(t.resetAt)||""}`}):null]})]}),e.jsx(ee,{points:t.history})]})}function te(){return e.jsxs("div",{className:"hs-subscription-loading","aria-hidden":"true",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--label"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--value"}),e.jsx("span",{className:"hs-loading-meter"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--meta"}),e.jsx("span",{className:"hs-loading-history"})]})}function ae({rows:s,loading:t,onImported:a}){const r=C.map(i=>({provider:i,row:s.find(d=>d.id===i.id)??null})),n=r.filter(({row:i})=>i?.gauge).length,o=r.filter(({row:i})=>i?.gauge?.kind==="quota").length,c=r.filter(({row:i})=>i?.gauge?.kind==="quota"&&i.gauge.plan||i?.gauge?.kind==="status").length,b=r.flatMap(({row:i})=>i?.gauge?.kind==="quota"?v(i.gauge):[]).map(i=>i.resetAt).filter(i=>i>Date.now()).sort((i,d)=>i-d)[0];return e.jsxs("section",{className:"hs-subscriptions","aria-labelledby":"hs-subscriptions-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-subscriptions-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-subscriptions-title",children:"Subscriptions"}),e.jsx("p",{children:"Plans, remaining allowance, reset windows, and the fastest path to each provider dashboard."})]}),e.jsxs("div",{className:"hs-subscription-summary","aria-label":"Subscription feed summary",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":n})," detected"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":o})," usage feeds"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":c})," plans named"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":b?I(b):"-"})," next reset"]})]})]}),e.jsx("div",{className:"hs-subscription-grid",children:r.map(({provider:i,row:d})=>{const l=d?.gauge??null,m=t&&!l,x=m?"loading":l?"connected":"missing",p=l?.kind==="quota"?l.plan:l?.kind==="status"?l.statusLabel:null,h=J(l),y=l?.kind==="quota"?"Usage connected":l?.kind==="status"?l.detailLabel||"Subscription detected":m?"Checking":"Not detected";return e.jsxs("article",{className:`hs-subscription-card hs-subscription-card--${x}`,children:[e.jsxs("header",{className:"hs-subscription-card-head",children:[e.jsxs("div",{className:"hs-subscription-provider",children:[e.jsx(R,{harness:i.id,size:18,title:null,className:"hs-subscription-mark"}),e.jsxs("div",{children:[e.jsx("h4",{children:N(i.id)}),e.jsx("span",{children:m?"Checking local plan…":p||"Plan not reported"})]})]}),e.jsx("span",{className:`hs-subscription-state hs-subscription-state--${x}`,children:y})]}),e.jsx("p",{className:"hs-subscription-description",children:i.description}),m?e.jsx(te,{}):l?.kind==="quota"?e.jsx("div",{className:"hs-subscription-windows",children:v(l).map(f=>e.jsx(se,{gauge:l,window:f},`${i.id}:${f.label}`))}):l?.kind==="status"?e.jsxs("div",{className:"hs-subscription-status-detail",children:[e.jsx("strong",{children:l.statusLabel}),e.jsx("span",{children:l.detailLabel||"Subscription detected locally. Open the provider dashboard for live usage."})]}):e.jsxs("div",{className:"hs-subscription-missing",children:[e.jsx("strong",{children:"No local subscription feed yet"}),e.jsx("span",{children:"Open the provider locally, then refresh Scout."})]}),i.id==="cursor"||i.id==="grok"&&l?.kind!=="quota"?e.jsx(X,{provider:i.id,onImported:a}):null,e.jsxs("footer",{className:"hs-subscription-footer",children:[e.jsxs("span",{children:[m?"checking local feed":h?`updated ${O(h)||"now"}`:l?"detected locally":"waiting for provider data",l?.source?` · ${l.source}`:""]}),e.jsx("nav",{"aria-label":`${N(i.id)} quick links`,children:i.links.map(f=>e.jsxs("a",{href:f.href,target:"_blank",rel:"noreferrer",children:[f.label,e.jsx($,{size:11,"aria-hidden":"true"})]},f.href))})]})]},i.id)})})]})}function re({accounts:s,loading:t}){return s.length===0&&!t?null:e.jsxs("section",{className:"hs-cloud-accounts","aria-labelledby":"hs-cloud-accounts-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-cloud-accounts-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-cloud-accounts-title",children:"Cloud accounts"}),e.jsx("p",{children:"Infrastructure available to Scout for deployment and agent compute."})]}),e.jsx("span",{className:"hs-section-meta",children:t?"checking accounts":`${s.length} connected`})]}),e.jsxs("div",{className:"hs-cloud-grid",children:[t&&s.length===0?Array.from({length:3},(a,r)=>e.jsxs("article",{className:"hs-cloud-card hs-cloud-card--loading","aria-hidden":"true",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsx("span",{className:"hs-loading-mark"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-title"})]}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-copy"}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-meta"}),e.jsx("span",{className:"hs-loading-actions"})]})]},r)):null,s.map(a=>{const r=V[a.id];return e.jsxs("article",{className:"hs-cloud-card",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsxs("div",{className:"hs-cloud-identity",children:[e.jsx(W,{provider:a.id}),e.jsxs("div",{children:[e.jsx("span",{className:"hs-cloud-category",children:r.category}),e.jsx("h4",{children:a.label})]})]}),e.jsx("span",{className:"hs-subscription-state hs-subscription-state--connected",children:a.statusLabel})]}),e.jsx("p",{className:"hs-cloud-description",children:r.description}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsxs("span",{className:"hs-cloud-connection",children:[e.jsx("span",{className:"hs-cloud-dot","aria-hidden":"true"}),a.detailLabel]}),e.jsx("nav",{"aria-label":`${a.label} quick links`,children:G[a.id].map(n=>e.jsxs("a",{href:n.href,target:"_blank",rel:"noreferrer",children:[n.label,e.jsx($,{size:11,"aria-hidden":"true"})]},n.href))})]})]},a.id)})]})]})}function ts({navigate:s}){const{route:t}=P(),a=D(t),[r,n]=u.useState([]),[o,c]=u.useState([]),[b,i]=u.useState(!0),[d,l]=u.useState(!1),[m,x]=u.useState(null),p=u.useRef(0),h=u.useCallback(async(g=!1,k=!1)=>{const w=++p.current;k&&i(!0),l(!0),x(null);try{const j=await M(`/api/service-budgets${g?"?refresh=1":""}`);if(w!==p.current)return;n(j.gauges??[]),c(j.cloudAccounts??[])}catch(j){w===p.current&&x(j instanceof Error?j.message:String(j))}finally{w===p.current&&(i(!1),l(!1))}},[]);u.useEffect(()=>{let g=!1,k;return h(!1,!0).then(()=>{g||(k=window.setTimeout(()=>{h(!0)},600))}),()=>{g=!0,k!==void 0&&window.clearTimeout(k)}},[h]),u.useEffect(()=>{const g=window.setInterval(()=>{h(!1)},3e4);return()=>window.clearInterval(g)},[h]);const y=u.useMemo(()=>Y(r),[r]),f=T();return e.jsxs("div",{className:"s-ops",children:[f?e.jsx("div",{className:"s-ops-header",children:e.jsx(E,{activeRoute:{view:"harnesses",...a?{machineId:a}:{}},navigate:s})}):null,e.jsx("div",{className:"s-ops-body hs-body",children:e.jsxs("div",{className:"hs-page",children:[e.jsxs("header",{className:"hs-page-head",children:[e.jsxs("div",{className:"hs-title-group",children:[e.jsx("span",{className:"hs-kicker",children:"ops / provider central"}),e.jsx("h2",{children:"Agent Providers"}),e.jsx("p",{children:"See what you pay for, how much remains, and where to use it."})]}),e.jsxs("button",{type:"button",className:"hs-refresh",disabled:d,onClick:()=>{h(!0)},children:[e.jsx(U,{size:14,className:d?"hs-refresh-icon-spinning":"","aria-hidden":"true"}),e.jsx("span",{children:d?"Refreshing":"Refresh"})]})]}),m&&e.jsxs("div",{className:"hs-error",role:"status","aria-live":"polite",children:["refresh: ",m]}),e.jsx(ae,{rows:y,loading:b,onImported:()=>h(!1)}),e.jsx(re,{accounts:o,loading:b})]})})]})}export{ts as HarnessesScreen};
1
+ import{r as u,j as e}from"./index-Bli6bTLU.js";import{H as R,h as q}from"./HarnessMark-DGZ6o6Ct.js";import{a as M}from"./api-DEHEgJ9m.js";import{d as D}from"./router-B0YclXYg.js";import{t as O,n as S,f as L}from"./time-Dhsh_2EG.js";import{u as P}from"./Provider-Ve8yXaWR.js";import{u as T}from"./useContentSecondaryNav-D-hVKzM9.js";import{OpsSubnav as E}from"./OpsSubnav-BijKI3yG.js";/* empty css */import{R as U}from"./refresh-cw-IgN2fZLM.js";import{E as $}from"./external-link-BGHC_naA.js";import{c as H}from"./createLucideIcon-DLlxGjKt.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./provider-CX9EWecp.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./SecondaryNav-cYTw2p39.js";import"./secondaryNavConfig-DyC_P9Wx.js";import"./message-square-DlY4EneU.js";import"./compass-BepM5iWH.js";import"./settings-BzWCF3NF.js";import"./terminal-BiNIXhna.js";import"./git-branch-q8Ayc8py.js";import"./scroll-text-DRidbcse.js";/* empty css */const _=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],z=H("clipboard-paste",_),B={codex:"Codex",claude:"Claude",kimi:"Kimi",minimax:"MiniMax",cursor:"Cursor",native:"Native",worker:"Worker",bridge:"Bridge",http:"HTTP",pi:"Pi",flue:"Flue",github:"GitHub",unknown:"Unknown"},C=[{id:"claude",description:"Anthropic plan windows captured from Claude Code.",links:[{label:"Usage",href:"https://claude.ai/settings/usage"},{label:"Manage plan",href:"https://claude.ai/settings/billing"}]},{id:"codex",description:"OpenAI plan windows reported by local Codex sessions.",links:[{label:"Usage",href:"https://chatgpt.com/codex/settings/usage"},{label:"Open Codex",href:"https://chatgpt.com/codex"}]},{id:"kimi",description:"Kimi Code subscription windows and membership level.",links:[{label:"Kimi Code",href:"https://www.kimi.com/code"},{label:"Docs",href:"https://www.kimi.com/code/docs/en/"}]},{id:"grok",description:"SuperGrok quota reported by local Grok, with dashboard capture and local activity as fallbacks.",links:[{label:"Open Grok",href:"https://grok.com/"},{label:"Billing",href:"https://grok.com/?_s=billing"},{label:"Help",href:"https://docs.x.ai/grok/faq"}]},{id:"minimax",description:"MiniMax Token Plan 5-hour and weekly allowance.",links:[{label:"Usage",href:"https://platform.minimax.io/console/plan"},{label:"Docs",href:"https://platform.minimax.io/docs/token-plan/intro"}]},{id:"cursor",description:"Cursor membership detected locally, plus usage totals from an exported dashboard capture.",links:[{label:"Usage",href:"https://cursor.com/dashboard/usage"},{label:"Manage plan",href:"https://cursor.com/dashboard/billing"}]}],G={cloudflare:[{label:"Dashboard",href:"https://dash.cloudflare.com/"},{label:"Billing",href:"https://dash.cloudflare.com/?to=/:account/billing"}],vercel:[{label:"Dashboard",href:"https://vercel.com/dashboard"},{label:"Billing",href:"https://vercel.com/account/billing"}],exe:[{label:"VMs",href:"https://exe.dev/"},{label:"Billing",href:"https://exe.dev/user/billing"},{label:"Docs",href:"https://exe.dev/docs/what-is-exe"}]},V={exe:{category:"Agent compute",description:"Persistent VMs for remote Scout agents and isolated workloads."},cloudflare:{category:"Edge platform",description:"Workers, networking, and edge infrastructure available for deployment."},vercel:{category:"App hosting",description:"Projects, preview environments, and production deployments."}};function W({provider:s}){return e.jsx("span",{className:`hs-cloud-mark hs-cloud-mark--${s}`,"aria-hidden":"true",children:s==="exe"?e.jsx("img",{src:"https://exe.dev/apple-touch-icon.png",alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx("svg",{viewBox:"0 0 24 24",focusable:"false",children:s==="cloudflare"?e.jsx("path",{d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268Zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"}):e.jsx("path",{d:"m12 1.608 12 20.784H0Z"})})})}function F(s){const t=(s??"").trim().toLowerCase();return t?t.includes("claude")?"claude":t.includes("codex")?"codex":t.includes("cursor")?"cursor":t.includes("kimi")||t.includes("moonshot")?"kimi":t.includes("minimax")?"minimax":t.includes("github")?"github":t.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown":"unknown"}function N(s){return B[s]??q(s)}function K(s){switch(s){case"weekly":return"7d";case"req/h":return"1h";default:return s||"quota"}}function v(s){return s.windows&&s.windows.length>0?s.windows:[{label:K(s.unitLabel),fill:s.fill,usedLabel:s.usedLabel,capLabel:s.capLabel,unitLabel:s.unitLabel,resetAt:s.resetAt}]}function Q(s){return s.capLabel==="100%"&&s.usedLabel.endsWith("%")?s.usedLabel:`${s.usedLabel}/${s.capLabel}`}function A(s){return s>=.9?"err":s>=.75?"warn":"ok"}function Z(s,t=30){const a=s??[];if(a.length<=t)return a;if(t<=1)return[a[a.length-1]];const r=(a.length-1)/(t-1);return Array.from({length:t},(n,o)=>a[Math.round(o*r)])}function I(s){const t=Math.floor((s-Date.now())/1e3),a=t<0,r=Math.abs(t);let n;if(r>=86400){const o=Math.floor(r/86400),c=Math.floor(r%86400/3600);n=c>0?`${o}d ${c}h`:`${o}d`}else if(r>=3600){const o=Math.floor(r/3600),c=Math.floor(r%3600/60);n=c>0?`${o}h ${c}m`:`${o}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return a?`stale ${n}`:n}function J(s){if(!s)return null;const t=S(s.capturedAt);if(t)return t;if(s.kind!=="quota")return null;const a=v(s).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null);return a||v(s).flatMap(r=>r.history??[]).reduce((r,n)=>{const o=S(n.capturedAt);return Math.max(r??0,o??0)||r},null)}function X({provider:s,onImported:t}){const[a,r]=u.useState(!1),[n,o]=u.useState(""),[c,b]=u.useState(!1),[i,d]=u.useState(null),l=`hs-${s}-dashboard-capture`,m=N(s);if(!a)return e.jsxs("button",{type:"button",className:"hs-dashboard-capture-trigger",onClick:()=>r(!0),children:[e.jsx(z,{size:12,"aria-hidden":"true"}),"Import dashboard"]});const x=async p=>{if(p.preventDefault(),!(!n.trim()||c)){b(!0),d(null);try{await M("/api/service-budgets/dashboard-import",{method:"POST",body:JSON.stringify({provider:s,text:n})}),o(""),d("Usage snapshot imported."),await t()}catch(h){d(h instanceof Error?h.message:String(h))}finally{b(!1)}}};return e.jsxs("form",{className:"hs-dashboard-capture",onSubmit:p=>{x(p)},children:[e.jsxs("label",{htmlFor:l,children:[m," usage snapshot"]}),e.jsxs("p",{children:[s==="cursor"?"Paste the exported Usage CSV or copied usage table.":"Copy the signed-in Usage panel and paste it here."," ","Scout keeps only normalized totals, not this text."]}),e.jsx("textarea",{id:l,value:n,onChange:p=>o(p.target.value),maxLength:128*1024,rows:5,placeholder:s==="cursor"?"Date (UTC),Type,Model,Tokens,Cost…":"Weekly SuperGrok… Limit · 12% used · Resets…","aria-describedby":i?`${l}-message`:void 0}),i?e.jsx("span",{id:`${l}-message`,className:"hs-dashboard-capture-message",role:"status",children:i}):null,e.jsxs("div",{className:"hs-dashboard-capture-actions",children:[e.jsx("button",{type:"button",onClick:()=>{r(!1),d(null)},disabled:c,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!n.trim()||c,children:c?"Importing…":"Use snapshot"})]})]})}function Y(s){const t=new Map(s.map(a=>[F(a.id),a]));return C.map(({id:a})=>({id:a,label:N(a),gauge:t.get(a)??null}))}function ee({points:s}){const t=Z(s);return t.length===0?e.jsx("span",{className:"hs-history hs-history-empty",children:"live"}):e.jsx("span",{className:"hs-history","aria-label":`${t.length} budget samples`,children:t.map((a,r)=>{const n=Math.max(.06,Math.min(1,a.fill));return e.jsx("span",{className:`hs-history-bar hs-history-bar--${A(a.fill)}`,style:{height:`${Math.round(n*100)}%`},title:`${L(a.capturedAt)||"unknown"} ${a.usedLabel}`},`${a.capturedAt}:${r}`)})})}function se({gauge:s,window:t}){const a=Math.max(0,Math.min(100,Math.round(t.fill*100))),r=100-a,n=A(t.fill),o=Number.isFinite(t.resetAt)?new Date(t.resetAt).toISOString():void 0;return e.jsxs("div",{className:"hs-subscription-window",children:[e.jsxs("div",{className:"hs-subscription-window-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"hs-subscription-window-label",children:[t.label," window"]}),e.jsxs("strong",{className:`hs-subscription-usage hs-subscription-usage--${n}`,children:[a,"% used"]})]}),e.jsxs("div",{className:"hs-subscription-remaining",children:[e.jsxs("strong",{children:[r,"%"]}),e.jsx("span",{children:"available"})]})]}),e.jsx("div",{className:"hs-subscription-meter",role:"progressbar","aria-label":`${s.label} ${t.label} usage`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:e.jsx("span",{className:`hs-subscription-meter-fill hs-subscription-meter-fill--${n}`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"hs-subscription-window-meta",children:[e.jsxs("span",{children:[Q(t)," ",t.unitLabel==="quota"?"quota":t.unitLabel]}),e.jsxs("span",{children:["resets in ",I(t.resetAt),o?e.jsx("time",{dateTime:o,title:L(t.resetAt)||void 0,children:` · ${L(t.resetAt)||""}`}):null]})]}),e.jsx(ee,{points:t.history})]})}function te(){return e.jsxs("div",{className:"hs-subscription-loading","aria-hidden":"true",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--label"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--value"}),e.jsx("span",{className:"hs-loading-meter"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--meta"}),e.jsx("span",{className:"hs-loading-history"})]})}function ae({rows:s,loading:t,onImported:a}){const r=C.map(i=>({provider:i,row:s.find(d=>d.id===i.id)??null})),n=r.filter(({row:i})=>i?.gauge).length,o=r.filter(({row:i})=>i?.gauge?.kind==="quota").length,c=r.filter(({row:i})=>i?.gauge?.kind==="quota"&&i.gauge.plan||i?.gauge?.kind==="status").length,b=r.flatMap(({row:i})=>i?.gauge?.kind==="quota"?v(i.gauge):[]).map(i=>i.resetAt).filter(i=>i>Date.now()).sort((i,d)=>i-d)[0];return e.jsxs("section",{className:"hs-subscriptions","aria-labelledby":"hs-subscriptions-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-subscriptions-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-subscriptions-title",children:"Subscriptions"}),e.jsx("p",{children:"Plans, remaining allowance, reset windows, and the fastest path to each provider dashboard."})]}),e.jsxs("div",{className:"hs-subscription-summary","aria-label":"Subscription feed summary",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":n})," detected"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":o})," usage feeds"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":c})," plans named"]}),e.jsxs("span",{children:[e.jsx("strong",{children:t?"—":b?I(b):"-"})," next reset"]})]})]}),e.jsx("div",{className:"hs-subscription-grid",children:r.map(({provider:i,row:d})=>{const l=d?.gauge??null,m=t&&!l,x=m?"loading":l?"connected":"missing",p=l?.kind==="quota"?l.plan:l?.kind==="status"?l.statusLabel:null,h=J(l),y=l?.kind==="quota"?"Usage connected":l?.kind==="status"?l.detailLabel||"Subscription detected":m?"Checking":"Not detected";return e.jsxs("article",{className:`hs-subscription-card hs-subscription-card--${x}`,children:[e.jsxs("header",{className:"hs-subscription-card-head",children:[e.jsxs("div",{className:"hs-subscription-provider",children:[e.jsx(R,{harness:i.id,size:18,title:null,className:"hs-subscription-mark"}),e.jsxs("div",{children:[e.jsx("h4",{children:N(i.id)}),e.jsx("span",{children:m?"Checking local plan…":p||"Plan not reported"})]})]}),e.jsx("span",{className:`hs-subscription-state hs-subscription-state--${x}`,children:y})]}),e.jsx("p",{className:"hs-subscription-description",children:i.description}),m?e.jsx(te,{}):l?.kind==="quota"?e.jsx("div",{className:"hs-subscription-windows",children:v(l).map(f=>e.jsx(se,{gauge:l,window:f},`${i.id}:${f.label}`))}):l?.kind==="status"?e.jsxs("div",{className:"hs-subscription-status-detail",children:[e.jsx("strong",{children:l.statusLabel}),e.jsx("span",{children:l.detailLabel||"Subscription detected locally. Open the provider dashboard for live usage."})]}):e.jsxs("div",{className:"hs-subscription-missing",children:[e.jsx("strong",{children:"No local subscription feed yet"}),e.jsx("span",{children:"Open the provider locally, then refresh Scout."})]}),i.id==="cursor"||i.id==="grok"&&l?.kind!=="quota"?e.jsx(X,{provider:i.id,onImported:a}):null,e.jsxs("footer",{className:"hs-subscription-footer",children:[e.jsxs("span",{children:[m?"checking local feed":h?`updated ${O(h)||"now"}`:l?"detected locally":"waiting for provider data",l?.source?` · ${l.source}`:""]}),e.jsx("nav",{"aria-label":`${N(i.id)} quick links`,children:i.links.map(f=>e.jsxs("a",{href:f.href,target:"_blank",rel:"noreferrer",children:[f.label,e.jsx($,{size:11,"aria-hidden":"true"})]},f.href))})]})]},i.id)})})]})}function re({accounts:s,loading:t}){return s.length===0&&!t?null:e.jsxs("section",{className:"hs-cloud-accounts","aria-labelledby":"hs-cloud-accounts-title","aria-busy":t,children:[e.jsxs("div",{className:"hs-section-head hs-cloud-accounts-head",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"hs-cloud-accounts-title",children:"Cloud accounts"}),e.jsx("p",{children:"Infrastructure available to Scout for deployment and agent compute."})]}),e.jsx("span",{className:"hs-section-meta",children:t?"checking accounts":`${s.length} connected`})]}),e.jsxs("div",{className:"hs-cloud-grid",children:[t&&s.length===0?Array.from({length:3},(a,r)=>e.jsxs("article",{className:"hs-cloud-card hs-cloud-card--loading","aria-hidden":"true",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsx("span",{className:"hs-loading-mark"}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-title"})]}),e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-copy"}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsx("span",{className:"hs-loading-line hs-loading-line--cloud-meta"}),e.jsx("span",{className:"hs-loading-actions"})]})]},r)):null,s.map(a=>{const r=V[a.id];return e.jsxs("article",{className:"hs-cloud-card",children:[e.jsxs("header",{className:"hs-cloud-card-head",children:[e.jsxs("div",{className:"hs-cloud-identity",children:[e.jsx(W,{provider:a.id}),e.jsxs("div",{children:[e.jsx("span",{className:"hs-cloud-category",children:r.category}),e.jsx("h4",{children:a.label})]})]}),e.jsx("span",{className:"hs-subscription-state hs-subscription-state--connected",children:a.statusLabel})]}),e.jsx("p",{className:"hs-cloud-description",children:r.description}),e.jsxs("footer",{className:"hs-cloud-card-footer",children:[e.jsxs("span",{className:"hs-cloud-connection",children:[e.jsx("span",{className:"hs-cloud-dot","aria-hidden":"true"}),a.detailLabel]}),e.jsx("nav",{"aria-label":`${a.label} quick links`,children:G[a.id].map(n=>e.jsxs("a",{href:n.href,target:"_blank",rel:"noreferrer",children:[n.label,e.jsx($,{size:11,"aria-hidden":"true"})]},n.href))})]})]},a.id)})]})]})}function ss({navigate:s}){const{route:t}=P(),a=D(t),[r,n]=u.useState([]),[o,c]=u.useState([]),[b,i]=u.useState(!0),[d,l]=u.useState(!1),[m,x]=u.useState(null),p=u.useRef(0),h=u.useCallback(async(g=!1,k=!1)=>{const w=++p.current;k&&i(!0),l(!0),x(null);try{const j=await M(`/api/service-budgets${g?"?refresh=1":""}`);if(w!==p.current)return;n(j.gauges??[]),c(j.cloudAccounts??[])}catch(j){w===p.current&&x(j instanceof Error?j.message:String(j))}finally{w===p.current&&(i(!1),l(!1))}},[]);u.useEffect(()=>{let g=!1,k;return h(!1,!0).then(()=>{g||(k=window.setTimeout(()=>{h(!0)},600))}),()=>{g=!0,k!==void 0&&window.clearTimeout(k)}},[h]),u.useEffect(()=>{const g=window.setInterval(()=>{h(!1)},3e4);return()=>window.clearInterval(g)},[h]);const y=u.useMemo(()=>Y(r),[r]),f=T();return e.jsxs("div",{className:"s-ops",children:[f?e.jsx("div",{className:"s-ops-header",children:e.jsx(E,{activeRoute:{view:"harnesses",...a?{machineId:a}:{}},navigate:s})}):null,e.jsx("div",{className:"s-ops-body hs-body",children:e.jsxs("div",{className:"hs-page",children:[e.jsxs("header",{className:"hs-page-head",children:[e.jsxs("div",{className:"hs-title-group",children:[e.jsx("span",{className:"hs-kicker",children:"ops / provider central"}),e.jsx("h2",{children:"Agent Providers"}),e.jsx("p",{children:"See what you pay for, how much remains, and where to use it."})]}),e.jsxs("button",{type:"button",className:"hs-refresh",disabled:d,onClick:()=>{h(!0)},children:[e.jsx(U,{size:14,className:d?"hs-refresh-icon-spinning":"","aria-hidden":"true"}),e.jsx("span",{children:d?"Refreshing":"Refresh"})]})]}),m&&e.jsxs("div",{className:"hs-error",role:"status","aria-live":"polite",children:["refresh: ",m]}),e.jsx(ae,{rows:y,loading:b,onImported:()=>h(!1)}),e.jsx(re,{accounts:o,loading:b})]})})]})}export{ss as HarnessesScreen};
@@ -1,4 +1,4 @@
1
- import{r as d,j as e}from"./index-o4FKpU7Z.js";import{L as K,u as X}from"./usePersistentState-D3M4m2Ou.js";import{c as Q}from"./clipboard-e3fSpeo7.js";import{e as A}from"./terminal-sessions-AmSgHklm.js";import{a as C}from"./api-h5zurxmi.js";import{H as D}from"./HarnessMark-MztYnrGK.js";import{T as H}from"./terminal-By1Lw2i2.js";import{R as V}from"./refresh-cw-B5To7b6B.js";import{C as Z}from"./check--esHw52j.js";import{C as ee}from"./copy-Dty8ZYsM.js";import{E as G}from"./eye-B3lBIwJZ.js";import{c as te}from"./createLucideIcon-Bt67PWH-.js";import{X as se}from"./x-ynOfVadO.js";const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],J=te("crosshair",ne);async function re(){return C("/api/terminal-hosts")}async function ae(t,s){return C(`/api/terminal-hosts/${encodeURIComponent(t)}/sessions`,{method:"POST",body:JSON.stringify(s)})}let $=null,O=null;function ie(){return $?Promise.resolve($):(O??=re().then(t=>($=t,t)).finally(()=>{O=null}),O)}function Ae(){const[t,s]=d.useState($);return d.useEffect(()=>{if(t)return;let n=!1;return ie().then(a=>{n||s(a)}).catch(()=>{}),()=>{n=!0}},[t]),{hosts:t?.hosts??[],preferredHostId:t?.preferredHostId??null,loaded:t!==null}}async function le(t){return(await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/topology`)).topology}async function F(t,s){await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/focus`,{method:"POST",body:JSON.stringify({target:s})})}async function Y(t,s,n=48){const a=new URLSearchParams({backend:"herdr",sessionName:t,paneId:s,lines:String(n)}),i=await C(`/api/terminal-sessions/peek?${a.toString()}`);return i.available?{body:i.body,reason:null}:{body:null,reason:i.reason??"No preview available."}}const oe=3e3;function ce(t,s,n={}){const a=n.enabled??!0,i=n.lines??48,c=n.pollMs??oe,[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!s||!a)return;let l=!1;m(null);const b=()=>{Y(t,s,i).then(h=>{l||m(h)}).catch(h=>{if(l)return;const r=h instanceof Error?h.message:String(h);m(g=>({body:g?.body??null,reason:r}))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,s,i,a,c,u]),{body:p?.body??null,reason:p?.reason??null,loading:p===null,refresh:()=>o(l=>l+1)}}const de=15e3;function ue(t,s,n={}){const a=n.enabled??!0,i=n.lines??6,c=n.pollMs??de,[p,m]=d.useState({}),u=s.join(`
1
+ import{r as d,j as e}from"./index-Bli6bTLU.js";import{L as K,u as X}from"./usePersistentState-DOEahRlt.js";import{c as Q}from"./clipboard-e3fSpeo7.js";import{e as A}from"./terminal-sessions-D4dHTRkt.js";import{a as C}from"./api-DEHEgJ9m.js";import{H as D}from"./HarnessMark-DGZ6o6Ct.js";import{T as H}from"./terminal-BiNIXhna.js";import{R as V}from"./refresh-cw-IgN2fZLM.js";import{C as Z}from"./check-Bfs7hMb1.js";import{C as ee}from"./copy-De4s38o2.js";import{E as G}from"./eye-BeCSqJn1.js";import{c as te}from"./createLucideIcon-DLlxGjKt.js";import{X as se}from"./x-BJyPzFnn.js";const ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],J=te("crosshair",ne);async function re(){return C("/api/terminal-hosts")}async function ae(t,s){return C(`/api/terminal-hosts/${encodeURIComponent(t)}/sessions`,{method:"POST",body:JSON.stringify(s)})}let $=null,O=null;function ie(){return $?Promise.resolve($):(O??=re().then(t=>($=t,t)).finally(()=>{O=null}),O)}function Ae(){const[t,s]=d.useState($);return d.useEffect(()=>{if(t)return;let n=!1;return ie().then(a=>{n||s(a)}).catch(()=>{}),()=>{n=!0}},[t]),{hosts:t?.hosts??[],preferredHostId:t?.preferredHostId??null,loaded:t!==null}}async function le(t){return(await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/topology`)).topology}async function F(t,s){await C(`/api/terminal-hosts/herdr/sessions/${encodeURIComponent(t)}/focus`,{method:"POST",body:JSON.stringify({target:s})})}async function Y(t,s,n=48){const a=new URLSearchParams({backend:"herdr",sessionName:t,paneId:s,lines:String(n)}),i=await C(`/api/terminal-sessions/peek?${a.toString()}`);return i.available?{body:i.body,reason:null}:{body:null,reason:i.reason??"No preview available."}}const oe=3e3;function ce(t,s,n={}){const a=n.enabled??!0,i=n.lines??48,c=n.pollMs??oe,[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!s||!a)return;let l=!1;m(null);const b=()=>{Y(t,s,i).then(h=>{l||m(h)}).catch(h=>{if(l)return;const r=h instanceof Error?h.message:String(h);m(g=>({body:g?.body??null,reason:r}))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,s,i,a,c,u]),{body:p?.body??null,reason:p?.reason??null,loading:p===null,refresh:()=>o(l=>l+1)}}const de=15e3;function ue(t,s,n={}){const a=n.enabled??!0,i=n.lines??6,c=n.pollMs??de,[p,m]=d.useState({}),u=s.join(`
2
2
  `);return d.useEffect(()=>{const o=u?u.split(`
3
3
  `):[];if(!t||!a||o.length===0)return;let l=!1;const b=()=>{Promise.all(o.map(async h=>{try{const r=await Y(t,h,i);return[h,r.body]}catch{return[h,void 0]}})).then(h=>{l||m(r=>{const g={};for(const[S,k]of h)g[S]=k===void 0?r[S]??null:k;return g})})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},c);return()=>{l=!0,window.clearInterval(j)}},[t,u,i,a,c]),p}const he=3e3;function pe(t,s={}){const n=s.enabled??!0,a=s.pollMs??he,[i,c]=d.useState(null),[p,m]=d.useState(null),[u,o]=d.useState(0);return d.useEffect(()=>{if(!t||!n)return;let l=!1;const b=()=>{le(t).then(h=>{l||(c(h),m(null))}).catch(h=>{l||m(h instanceof Error?h.message:String(h))})};b();const j=window.setInterval(()=>{document.visibilityState!=="hidden"&&b()},a);return()=>{l=!0,window.clearInterval(j)}},[t,n,a,u]),{topology:i,error:p,refresh:()=>o(l=>l+1)}}const me={column:"status",direction:"desc"},z=[{id:"pane",label:"Pane",initialDirection:"asc"},{id:"harness",label:"Harness",initialDirection:"asc"},{id:"status",label:"Status",initialDirection:"desc"},{id:"directory",label:"Directory",initialDirection:"asc"},{id:"tab",label:"Tab",initialDirection:"asc"},{id:"drift",label:"Drift",initialDirection:"desc"},{id:"output",label:"Last output",initialDirection:"asc"}];function U(t){switch(t){case"working":return 4;case"blocked":return 3;case"idle":return 2;case"done":return 1;case"unknown":return 0}}function T(t){return t.label??t.paneId}function M(t){return t.foregroundCwd??t.cwd??""}function R(t){return t.scroll?.offsetFromBottom??null}function L(t){if(!t)return null;const n=t.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g,"").split(`
4
4
  `);for(let a=n.length-1;a>=0;a-=1){const i=n[a].trim();if(i)return i}return null}function N(t,s){return t.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}function be(t,s){const n=s.direction==="asc"?1:-1;return[...t].sort((a,i)=>{const c=fe(a,i,s.column);if(c!==0)return c;const p=xe(a,i,s.column)*n;return p!==0?p:N(T(a.pane),T(i.pane))})}function fe(t,s,n){const a=p=>n==="drift"?R(p.pane):n==="output"?L(p.output):!0,i=a(t),c=a(s);return i===null&&c===null?0:i===null?1:c===null?-1:0}function xe(t,s,n){switch(n){case"pane":return N(T(t.pane),T(s.pane));case"harness":return N(t.pane.agent??"",s.pane.agent??"");case"status":return U(t.pane.agentStatus)-U(s.pane.agentStatus);case"directory":return N(M(t.pane),M(s.pane));case"tab":return N(t.tabLabel,s.tabLabel);case"drift":return B(R(t.pane),R(s.pane));case"output":return B(L(t.output),L(s.output))}}function B(t,s){return t===null&&s===null?0:t===null?-1:s===null?1:typeof t=="string"&&typeof s=="string"?N(t,s):Number(t)-Number(s)}function je(t,s){if(t.column===s)return{column:s,direction:t.direction==="asc"?"desc":"asc"};const n=z.find(a=>a.id===s)?.initialDirection??"asc";return{column:s,direction:n}}const ye="openscout.herdr.pane-table-sort.v1";function W(t){return{view:"terminal",terminalBackend:"herdr",terminalAgent:"shell",terminalTabId:`herdr-${t}`,terminalSessionName:t}}function ge({sessionName:t,navigate:s}){const{topology:n,error:a,refresh:i}=pe(t),[c,p]=d.useState(null),[m,u]=d.useState(null),[o,l]=d.useState("idle"),[b,j]=d.useState(null),h=t==="default"?"herdr":`herdr session attach ${t}`,r=n?.running??!1,g=d.useCallback(()=>{l("starting"),j(null),ae("herdr",{sessionName:t}).then(()=>{l("idle"),i()}).catch(y=>{l("failed"),j(y instanceof Error?y.message:String(y))})},[t,i]),S=d.useCallback(()=>{s(W(t))},[s,t]),k=d.useCallback(y=>{F(t,y.terminalId??y.paneId).catch(()=>{}),s(W(t))},[s,t]);return e.jsxs("div",{className:"s-term s-herdr",children:[e.jsxs("header",{className:"s-herdr-header",children:[e.jsxs("div",{className:"s-herdr-title",children:[e.jsx("span",{className:"s-herdr-mark",children:e.jsx(H,{size:16,strokeWidth:1.8})}),e.jsx("strong",{children:t}),e.jsx("span",{className:`s-herdr-state ${r?"s-herdr-state--live":""}`,children:n?r?"running":"stopped":"loading"})]}),e.jsxs("div",{className:"s-herdr-actions",children:[r&&e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:S,title:"Open a live web terminal attached to this session",children:[e.jsx(K,{size:13,strokeWidth:1.8}),"Open terminal"]}),e.jsx(we,{command:h}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:i,title:"Refresh","aria-label":"Refresh",children:e.jsx(V,{size:14,strokeWidth:1.8})})]})]}),a&&e.jsx("div",{className:"s-herdr-error",children:a}),n&&!r&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx(H,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"This herdr session is stopped."}),e.jsx("span",{children:"The session still exists — herdr sessions are persistent. Start it and the projection fills in."}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:g,disabled:o==="starting",children:o==="starting"?"Starting…":"Start it"}),b&&e.jsx("code",{children:b})]}),n&&r&&n.workspaces.length===0&&e.jsxs("div",{className:"s-herdr-empty",children:[e.jsx(H,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:"No workspaces yet."}),e.jsx("span",{children:"Open this session in herdr to create one — layout is herdr's job, Scout just watches."})]}),n&&r&&n.workspaces.length>0&&(()=>{const y=n.workspaces.flatMap(f=>f.tabs.map(x=>({workspace:f,tab:x})));if(y.length===0)return null;const v=n.workspaces.find(f=>f.focused)?.activeTabId??n.workspaces[0]?.activeTabId??null,E=y.find(f=>f.tab.tabId===c)??y.find(f=>f.tab.tabId===v)??y[0],{workspace:w,tab:I}=E,q=f=>{p(f),u(null)};return e.jsxs("section",{className:"s-herdr-workspace",children:[e.jsxs("div",{className:"s-herdr-workspace-head",children:[e.jsx("span",{className:"s-herdr-workspace-label",children:w.label??w.workspaceId}),e.jsx(_,{status:w.agentStatus})]}),e.jsx("div",{className:"s-herdr-tabs",role:"tablist",children:y.map(({workspace:f,tab:x})=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x.tabId===I.tabId,className:`s-herdr-tab ${x.tabId===I.tabId?"s-herdr-tab--active":""}`,title:`${f.label??f.workspaceId} · ${x.label??x.tabId}`,onClick:()=>q(x.tabId),children:[e.jsx(P,{status:x.agentStatus}),e.jsx("span",{children:x.label??`Tab ${x.number??""}`}),e.jsx(Ne,{tab:x}),e.jsx("span",{className:"s-herdr-tab-count",children:x.panes.length})]},x.tabId))}),I.layout&&e.jsx(ke,{tab:I,diveInPaneId:m,onEnterPane:k,onToggleDiveIn:f=>u(x=>x===f?null:f)}),e.jsx(ve,{sessionName:t,tab:I,onEnterPane:k}),m&&(()=>{const f=I.panes.find(x=>x.paneId===m);return f?e.jsx(Se,{sessionName:t,pane:f,onClose:()=>u(null)}):null})()]})})()]})}function ke({tab:t,diveInPaneId:s,onEnterPane:n,onToggleDiveIn:a}){const i=t.layout;if(!i)return null;const{area:c}=i,p=new Map(t.panes.map(u=>[u.paneId,u])),m=`${c.width} / ${Math.max(c.height*2,1)}`;return e.jsxs("div",{className:"s-herdr-layout-window",children:[e.jsxs("div",{className:"s-herdr-layout-titlebar",children:[e.jsxs("span",{className:"s-herdr-layout-lights","aria-hidden":"true",children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-herdr-layout-title",children:[t.label??`Tab ${t.number??""}`," — ",i.panes.length," ",i.panes.length===1?"pane":"panes"]}),e.jsx("span",{className:"s-herdr-layout-hint",children:"click a pane to enter"})]}),e.jsx("div",{className:"s-herdr-layout",style:{aspectRatio:m},role:"group","aria-label":`Layout of ${t.label??t.tabId}`,children:i.panes.map(u=>{const o=p.get(u.paneId),{rect:l}=u,b={left:`${(l.x-c.x)/c.width*100}%`,top:`${(l.y-c.y)/c.height*100}%`,width:`${l.width/c.width*100}%`,height:`${l.height/c.height*100}%`},j=o?.paneId===s;return e.jsxs("div",{role:"button",tabIndex:0,className:`s-herdr-layout-pane ${u.focused?"s-herdr-layout-pane--focused":""}`,style:b,onClick:()=>o&&n(o),onKeyDown:h=>{o&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),n(o))},title:o?`Enter ${o.label??o.paneId} — focus it and open the web terminal`:u.paneId,children:[e.jsxs("span",{className:"s-herdr-layout-pane-head",children:[o&&e.jsx(P,{status:o.agentStatus}),o?.agent&&e.jsx(D,{harness:o.agent,size:12,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:o?.label??u.paneId})]}),o?.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(o.foregroundCwd)}),o&&e.jsx("button",{type:"button",className:`s-herdr-layout-pane-peek ${j?"s-herdr-layout-pane-peek--active":""}`,onClick:h=>{h.stopPropagation(),a(o.paneId)},title:j?"Close the live view":"Watch this pane live","aria-label":j?"Close the live view":"Watch this pane live","aria-pressed":j,children:e.jsx(G,{size:13,strokeWidth:1.8})})]},u.paneId)})})]})}function ve({sessionName:t,tab:s,onEnterPane:n}){const[a,i]=X(ye,me),[c,p]=d.useState(null),[m,u]=d.useState(null),o=d.useMemo(()=>s.panes.map(r=>r.paneId),[s.panes]),l=ue(t,o,{lines:6}),b=s.label??`Tab ${s.number??""}`,j=d.useMemo(()=>be(s.panes.map(r=>({pane:r,tabLabel:b,output:l[r.paneId]??null})),a),[s.panes,b,l,a]),h=d.useCallback(r=>{u(null),F(t,r.terminalId??r.paneId).catch(g=>u(g instanceof Error?g.message:String(g)))},[t]);return e.jsxs("div",{className:"s-herdr-table-wrap",children:[e.jsxs("table",{className:"s-herdr-table","aria-label":`Panes of ${b}`,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[z.map(r=>e.jsx("th",{scope:"col","aria-sort":a.column===r.id?a.direction==="asc"?"ascending":"descending":"none",children:e.jsxs("button",{type:"button",onClick:()=>i(je(a,r.id)),children:[e.jsx("span",{children:r.label}),e.jsx("em",{"aria-hidden":"true",children:a.column===r.id?a.direction==="asc"?"▲":"▼":"·"})]})},r.id)),e.jsx("th",{scope:"col","aria-label":"Actions"})]})}),e.jsx("tbody",{children:j.map(({pane:r,tabLabel:g,output:S})=>{const k=r.paneId===c,y=L(S),v=R(r),E=M(r);return e.jsxs(d.Fragment,{children:[e.jsxs("tr",{className:r.focused?"is-focused":void 0,onClick:()=>n(r),title:`Enter ${T(r)} — focus it and open the web terminal`,children:[e.jsxs("td",{className:"s-herdr-table-pane",children:[e.jsx(P,{status:r.agentStatus}),e.jsx("strong",{title:r.paneId,children:T(r)}),r.focused&&e.jsx("span",{className:"s-herdr-focused",children:"focused in herdr"})]}),e.jsx("td",{className:"s-herdr-table-harness",children:r.agent?e.jsx("span",{title:r.agent,className:"s-herdr-table-harness-mark",children:e.jsx(D,{harness:r.agent,size:13,className:"s-herdr-agent-mark"})}):e.jsx("span",{title:"shell — no agent running",className:"s-herdr-table-harness-mark",children:e.jsx(H,{size:12,strokeWidth:1.8})})}),e.jsx("td",{children:r.agentStatus==="unknown"?"—":e.jsx(_,{status:r.agentStatus})}),e.jsx("td",{className:"s-herdr-table-dir",title:E||void 0,children:E?A(E):"—"}),e.jsx("td",{children:g}),e.jsx("td",{className:"s-herdr-table-drift",title:v===null?void 0:v===0?"Pinned to live output":`Scrolled up ${v} ${v===1?"line":"lines"} from the live edge`,children:v===null?"—":v===0?"live":`↑${v}`}),e.jsx("td",{className:"s-herdr-table-output",title:y??void 0,children:y??"—"}),e.jsxs("td",{className:"s-herdr-table-actions",children:[e.jsx("button",{type:"button",className:`s-term-icon-button${k?" is-active":""}`,onClick:w=>{w.stopPropagation(),p(I=>I===r.paneId?null:r.paneId)},title:k?"Hide the pane's last lines":"Show the pane's last lines","aria-label":k?"Hide the pane's last lines":"Show the pane's last lines","aria-pressed":k,children:e.jsx(G,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),h(r)},title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:13,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:w=>{w.stopPropagation(),n(r)},title:"Enter — focus it and open the web terminal","aria-label":"Enter — focus it and open the web terminal",children:e.jsx(K,{size:13,strokeWidth:1.8})})]})]}),k&&e.jsx("tr",{className:"s-herdr-table-expand",children:e.jsx("td",{colSpan:z.length+1,children:S?e.jsx("pre",{children:S}):e.jsx("span",{className:"s-herdr-peek-reason",children:"No output captured yet."})})})]},r.paneId)})})]}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})}function we({command:t}){const[s,n]=d.useState(!1);return e.jsxs("button",{type:"button",className:"s-herdr-attach",title:"Copy attach command — open this session in the herdr client",onClick:()=>{Q(t).then(()=>{n(!0),window.setTimeout(()=>n(!1),1500)})},children:[s?e.jsx(Z,{size:13,strokeWidth:2}):e.jsx(ee,{size:13,strokeWidth:1.8}),e.jsx("code",{children:t})]})}function Se({sessionName:t,pane:s,onClose:n}){const{body:a,reason:i,loading:c,refresh:p}=ce(t,s.paneId,{lines:48}),[m,u]=d.useState(null);d.useEffect(()=>{const l=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n]);const o=d.useCallback(()=>{u(null),F(t,s.terminalId??s.paneId).catch(l=>u(l instanceof Error?l.message:String(l)))},[t,s.terminalId,s.paneId]);return e.jsx("div",{className:"s-herdr-lightbox",onClick:n,role:"presentation",children:e.jsxs("section",{className:"s-herdr-live","aria-label":`Live view of ${s.label??s.paneId}`,onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"s-herdr-live-head",children:[e.jsx(P,{status:s.agentStatus}),s.agent&&e.jsx(D,{harness:s.agent,size:13,className:"s-herdr-agent-mark"}),e.jsx("strong",{className:"s-herdr-pane-label",children:s.label??s.paneId}),e.jsx(_,{status:s.agentStatus}),s.foregroundCwd&&e.jsx("span",{className:"s-herdr-cwd",children:A(s.foregroundCwd)}),e.jsx("span",{className:"s-herdr-pane-spacer"}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:o,title:"Focus this pane in the herdr client","aria-label":"Focus this pane in the herdr client",children:e.jsx(J,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:p,title:"Refresh now","aria-label":"Refresh now",children:e.jsx(V,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:n,title:"Close the live view (Esc)","aria-label":"Close the live view",children:e.jsx(se,{size:14,strokeWidth:1.8})})]}),e.jsx("div",{className:"s-herdr-live-body",children:a!==null?e.jsx("pre",{children:a}):c?e.jsx("span",{className:"s-herdr-peek-reason",children:"Loading…"}):e.jsx("span",{className:"s-herdr-peek-reason",children:i??"No preview available."})}),m&&e.jsx("div",{className:"s-herdr-error",children:m})]})})}function Ie(t){return t}function P({status:t}){return e.jsx("span",{className:`s-herdr-dot s-herdr-dot--${t}`,"aria-hidden":"true"})}function _({status:t}){return t==="unknown"?null:e.jsx("span",{className:`s-herdr-badge s-herdr-badge--${t}`,children:t})}function Ne({tab:t}){const s=[...new Set(t.panes.map(n=>n.agent).filter(n=>!!n))].slice(0,4);return s.length===0?null:e.jsx("span",{className:"s-herdr-tab-marks",children:s.map(n=>e.jsx(D,{harness:n,size:11,className:"s-herdr-agent-mark"},n))})}function Te(t){return{label:t.label??`Tab ${t.number??""}`,statuses:t.panes.map(s=>s.agentStatus)}}const Fe=Object.freeze(Object.defineProperty({__proto__:null,AgentStatusBadge:_,AgentStatusDot:P,HerdrSessionScreen:ge,herdrAgentStatusLabel:Ie,herdrTabSummary:Te,herdrTerminalRoute:W},Symbol.toStringTag,{value:"Module"}));export{P as A,ge as H,pe as a,Te as b,ae as c,Fe as d,W as h,Ae as u};
@@ -0,0 +1 @@
1
+ .hd{display:flex;flex-direction:column;gap:var(--space-md);margin-bottom:var(--space-xl)}.hd-vitals-band{display:flex;align-items:center;justify-content:space-between;gap:var(--space-md);flex-wrap:wrap;padding:var(--space-xs) var(--space-md);border-radius:var(--radius-lg);background:color-mix(in srgb,var(--surface) 60%,var(--bg));border:1px solid color-mix(in srgb,var(--border) 70%,transparent)}.hd-vitals-left{display:flex;align-items:center;gap:var(--space-sm);flex-wrap:wrap}.hd-vitals-title{color:var(--ink);letter-spacing:var(--tracking-lg)}.hd-vitals-callsign{font-weight:500}.hd-vitals-right{display:flex;align-items:center;gap:var(--space-xs);margin-left:auto}.hd-meta{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--dim);font-variant-numeric:tabular-nums}.hd-meta--err{color:var(--red)}.hd-refresh-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border-radius:var(--radius-sm);border:1px solid color-mix(in srgb,var(--border) 70%,transparent);background:color-mix(in srgb,var(--ink) 3%,transparent);color:var(--dim);cursor:pointer;transition:background var(--motion-duration-fast) ease,color var(--motion-duration-fast) ease,border-color var(--motion-duration-fast) ease}.hd-refresh-btn:hover:not(:disabled){background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink);border-color:var(--border)}.hd-refresh-btn:disabled{opacity:.5;cursor:default}.hd-spin{animation:hd-spin .8s linear infinite}@keyframes hd-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.hd-telemetry-grid{display:grid;gap:var(--space-md)}.hd-telemetry-grid--split{grid-template-columns:minmax(0,1.45fr) minmax(0,1fr)}.hd-telemetry-grid--single{grid-template-columns:minmax(0,1fr)}.hd-card{border:1px solid var(--border);border-radius:var(--radius-xl);background:color-mix(in srgb,var(--surface) 80%,var(--bg));overflow:hidden;display:flex;flex-direction:column}.hd-card-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-md);padding:var(--space-sm) var(--space-lg);border-bottom:1px solid color-mix(in srgb,var(--border) 70%,transparent);background:color-mix(in srgb,var(--bg) 30%,var(--surface))}.hd-card-head-left,.hd-card-head-right{display:flex;align-items:center;gap:var(--space-sm)}.hd-card-title{color:var(--ink);letter-spacing:var(--tracking-lg)}.hd-card-sub{color:var(--dim)}.hd-heartrate-icon{color:var(--accent)}.hd-gauge-set{display:flex;flex-direction:column;padding:var(--space-2xs) 0}.hd-gauge-table-head{display:grid;grid-template-columns:88px minmax(100px,1.1fr) minmax(68px,.7fr) minmax(100px,1.1fr) minmax(90px,1fr);gap:var(--space-xs) var(--space-sm);padding:var(--space-xs) var(--space-lg);color:var(--dim);letter-spacing:var(--tracking-md);border-bottom:1px solid color-mix(in srgb,var(--border) 40%,transparent)}.hd-gauge-wrap{display:block;border-bottom:1px solid color-mix(in srgb,var(--border) 45%,transparent)}.hd-gauge-wrap:last-child{border-bottom:none}.hd-gauge{display:grid;grid-template-columns:88px minmax(100px,1.1fr) minmax(68px,.7fr) minmax(100px,1.1fr) minmax(90px,1fr);gap:var(--space-xs) var(--space-sm);align-items:center;width:100%;padding:7px var(--space-lg);border:0;background:transparent;color:inherit;font:inherit;text-align:left;transition:background var(--motion-duration-hover) ease}.hd-gauge--interactive{cursor:pointer}.hd-gauge--interactive:hover{background:color-mix(in srgb,var(--ink) 4%,transparent)}.hd-gauge-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-xs);min-width:0}.hd-gauge-label{font-family:var(--font-mono);font-size:var(--text-xs);font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hd-gauge-pct{font-family:var(--font-mono);font-size:var(--text-2xs);font-weight:600;font-variant-numeric:tabular-nums}.hd-gauge-pct--ok{color:var(--accent)}.hd-gauge-pct--warn{color:var(--amber)}.hd-gauge-pct--err{color:var(--red)}.hd-gauge-cell{min-width:0;display:flex;align-items:center;font-family:var(--font-mono);font-size:var(--text-xs)}.hd-gauge-cell--empty{color:var(--dim)}.hd-gauge-cell--usage{display:flex;align-items:center;gap:var(--space-xs)}.hd-gauge-window-name{color:var(--dim);min-width:18px}.hd-gauge-bar{flex:1 1 auto;height:5px;border-radius:var(--radius-xs);background:color-mix(in srgb,var(--ink) 12%,transparent);overflow:hidden;position:relative;min-width:32px}.hd-gauge-bar-fill{position:absolute;inset:0 auto 0 0;height:100%;border-radius:var(--radius-xs);transition:width .2s ease}.hd-gauge-bar-fill--ok{background:var(--accent)}.hd-gauge-bar-fill--warn{background:var(--amber)}.hd-gauge-bar-fill--err{background:var(--red)}.hd-gauge-window-used{font-size:var(--text-2xs);color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}.hd-gauge-reset{color:var(--dim);font-size:var(--text-2xs);font-variant-numeric:tabular-nums;white-space:nowrap}.hd-gauge-reset--imminent{color:var(--amber)}.hd-gauge-reset--featured{display:flex;flex-direction:column;line-height:1.15;gap:1px}.hd-gauge-reset--featured strong{font-weight:600;color:var(--ink);font-size:var(--text-xs)}.hd-gauge-reset--featured time,.hd-gauge-reset--featured span{font-size:10px;color:var(--dim)}.hd-gauge-reset--imminent strong{color:var(--amber)}.hd-gauge-reset--due strong{color:var(--accent)}.hd-gauge-reset--stale strong{color:var(--red)}.hd-gauge-toggle{background:transparent;border:0;padding:0;font-family:var(--font-mono);font-size:var(--text-2xs);color:var(--dim);cursor:pointer;letter-spacing:var(--tracking-md);text-transform:uppercase}.hd-gauge-toggle:hover{color:var(--ink)}.hd-heartrate-plot-body{padding:var(--space-sm) var(--space-lg) var(--space-md);display:flex;flex-direction:column;justify-content:flex-end}.hd-heartrate-svg-wrap{width:100%;overflow:hidden}@media(max-width:900px){.hd-telemetry-grid--split{grid-template-columns:1fr}}@media(max-width:680px){.hd-gauge-table-head,.hd-gauge{grid-template-columns:80px 1fr auto}.hd-gauge-table-head span:nth-child(2),.hd-gauge-table-head span:nth-child(3),.hd-gauge>.hd-gauge-cell:nth-child(2),.hd-gauge>.hd-gauge-cell:nth-child(3){display:none}}
@@ -0,0 +1 @@
1
+ import{r as v,j as t}from"./index-Bli6bTLU.js";import{R as H}from"./refresh-cw-IgN2fZLM.js";import{A as _}from"./activity-D4W2XZY2.js";import"./createLucideIcon-DLlxGjKt.js";const q=3,I=2;function W(e){return e>=.9?"err":e>=.75?"warn":"ok"}const O=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function A(e,a){const s=e-a.getTime(),c=new Date(e).toDateString()===a.toDateString(),r=new Date(e),n=String(r.getHours()).padStart(2,"0"),l=String(r.getMinutes()).padStart(2,"0"),i=s>0&&s<6*3600*1e3;return c?{label:`${n}:${l}`,imminent:i}:{label:`${O[r.getDay()]} ${n}:${l}`,imminent:i}}function G(e,a){const s=Math.floor((e-a.getTime())/1e3),c=s<0,r=Math.abs(s);let n;if(r>=86400){const l=Math.floor(r/86400),i=Math.floor(r%86400/3600);n=i>0?`${l}d ${i}h`:`${l}d`}else if(r>=3600){const l=Math.floor(r/3600),i=Math.floor(r%3600/60);n=i>0?`${l}h ${i}m`:`${l}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return c?`stale ${n}`:n}function w(e){return e.windows&&e.windows.length>0?e.windows:[{label:z(e.unitLabel),fill:e.fill,usedLabel:e.usedLabel,capLabel:e.capLabel,unitLabel:e.unitLabel,resetAt:e.resetAt}]}function z(e){switch(e){case"weekly":return"7d";case"req/h":return"1h";default:return e||"quota"}}function E(e,a){return w(e).map(s=>{const c=A(s.resetAt,a),r=G(s.resetAt,a);return`${s.label}: ${s.usedLabel} / ${s.capLabel} ${s.unitLabel} · resets ${c.label} (in ${r})`}).join(" · ")}function S(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([mhd])$/i);if(!a)return null;const s=Number(a[1]);if(!Number.isFinite(s))return null;switch(a[2]?.toLowerCase()){case"m":return s;case"h":return s*60;case"d":return s*24*60;default:return null}}function Q(e){const a=[...e].sort((r,n)=>(S(r.label)??Number.MAX_SAFE_INTEGER)-(S(n.label)??Number.MAX_SAFE_INTEGER)),s=a.find(r=>(S(r.label)??0)>=1440)??(a.length>1?a[a.length-1]:null);return{shortWindow:a.find(r=>r!==s)??null,longWindow:s}}function V(e){return e.capLabel==="100%"&&e.usedLabel.endsWith("%")?e.usedLabel:`${e.usedLabel}/${e.capLabel}`}function N(){return t.jsx("span",{className:"hd-gauge-cell hd-gauge-cell--empty",children:"—"})}function T({window:e}){if(!e)return t.jsx(N,{});const a=Math.round(e.fill*100),s=W(e.fill);return t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.label}),t.jsx("span",{className:"hd-gauge-bar","aria-hidden":"true",children:t.jsx("span",{className:`hd-gauge-bar-fill hd-gauge-bar-fill--${s}`,style:{width:`${a}%`}})}),t.jsx("span",{className:"hd-gauge-window-used",children:V(e)})]})}function R({window:e,now:a,featured:s=!1}){if(!e)return t.jsx(N,{});if(s){const n=P(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset hd-gauge-reset--featured hd-gauge-reset--${n.tone}`,"aria-live":"off","aria-label":n.ariaLabel,children:[t.jsx("strong",{children:n.primary}),n.dateTime?t.jsx("time",{dateTime:n.dateTime,children:n.secondary}):t.jsx("span",{children:n.secondary})]})}const c=A(e.resetAt,a),r=G(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset${c.imminent?" hd-gauge-reset--imminent":""}`,children:["↻ ",r]})}function P(e,a){if(!Number.isFinite(e))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const s=e-a.getTime(),c=new Date(e);if(!Number.isFinite(c.getTime()))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const r=c.toISOString();if(s<=0){const u=Math.abs(s);if(u<=9e4)return{primary:"reset due",secondary:"refreshing…",ariaLabel:"Weekly reset due; refreshing usage",tone:"due",dateTime:r};const x=Math.floor(u/6e4),$=x>=60?`+${Math.floor(x/60)}h ${x%60}m`:`+${Math.max(1,x)}m`;return{primary:u<=360*6e4?"reset due":"stale",secondary:$,ariaLabel:`Weekly reset data ${$} overdue`,tone:u<=360*6e4?"due":"stale",dateTime:r}}const n=Math.floor(s/1e3),l=Math.floor(n/86400),i=Math.floor(n%86400/3600),o=Math.floor(n%3600/60),d=n%60,h=[i,o,d].map(u=>String(u).padStart(2,"0")).join(":"),b=l>0?`${l}d ${h}`:h,m=c.toDateString()===a.toDateString(),f=c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),g=m?`today ${f}`:`${c.toLocaleDateString([],{weekday:"short"})} ${f}`,p=l>0?`${l} ${l===1?"day":"days"} ${i} hours`:`${i} hours ${o} minutes`;return{primary:b,secondary:g,ariaLabel:`Weekly quota resets in ${p}; ${g}`,tone:s<360*6e4?"imminent":"normal",dateTime:r}}function B(e){if(e.length===0)return"";if(e.length===1)return`M ${e[0].x} ${e[0].y}`;const a=[`M ${e[0].x} ${e[0].y}`];for(let s=0;s<e.length-1;s++){const c=e[s-1]??e[s],r=e[s],n=e[s+1],l=e[s+2]??n,i=r.x+(n.x-c.x)/6,o=r.y+(n.y-c.y)/6,d=n.x-(l.x-r.x)/6,h=n.y-(l.y-r.y)/6;a.push(`C ${i} ${o}, ${d} ${h}, ${n.x} ${n.y}`)}return a.join(" ")}function U(e){const a=v.useRef(null),[s,c]=v.useState(e);return v.useLayoutEffect(()=>{const r=a.current;if(!r)return;const n=i=>{const o=Math.round(i);o>0&&c(d=>d===o?d:o)};n(r.getBoundingClientRect().width);const l=new ResizeObserver(i=>{n(i[0]?.contentRect.width??0)});return l.observe(r),()=>l.disconnect()},[]),[a,s]}function X({buckets:e}){const[a,s]=U(372),c=72,r=8,n=54,l=67,i=e.length,o=i<2||e.every(p=>p.count===0),d=Math.max(1,s-4),h={viewBox:`0 0 ${s} ${c}`,style:{width:"100%",height:c,display:"block"}};if(o)return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsx("svg",{...h,children:t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"})})});const b=d/(i-1),m=e.map((p,u)=>({x:u*b,y:n-Math.max(0,Math.min(1,p.value))*(n-r)})),f=B(m),g=`${f} L ${d} ${n} L 0 ${n} Z`;return t.jsx("div",{ref:a,className:"hd-heartrate-svg-wrap",children:t.jsxs("svg",{...h,children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"hrdFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--accent)",stopOpacity:"0.28"}),t.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0.0"})]})}),t.jsx("line",{x1:"0",y1:r,x2:s,y2:r,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:(r+n)/2,x2:s,y2:(r+n)/2,stroke:"var(--border)",opacity:"0.25"}),t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"}),t.jsx("path",{d:g,fill:"url(#hrdFill)"}),t.jsx("path",{d:f,fill:"none",stroke:"var(--accent)",strokeWidth:"1.75",strokeLinecap:"round"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"3",fill:"var(--accent)"}),t.jsx("circle",{cx:m[i-1].x,cy:m[i-1].y,r:"6",fill:"var(--accent)",opacity:"0.25"}),t.jsx("text",{x:"0",y:l,fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"7d"}),t.jsx("text",{x:s/2,y:l,textAnchor:"middle",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"3d"}),t.jsx("text",{x:s,y:l,textAnchor:"end",fill:"var(--dim)",fontSize:"9",fontFamily:"var(--font-mono)",children:"now"})]})})}function K({gauge:e,now:a,onClick:s}){const c=s?"button":"span",r=s?{type:"button",onClick:s}:{};if(e.kind==="status")return t.jsxs(c,{className:`hd-gauge hd-gauge--status hd-gauge--${e.tone}${s?" hd-gauge--interactive":""}`,"aria-label":`${e.label} subscription usage`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsx("span",{className:`hd-gauge-dot hd-gauge-dot--${e.tone}`,"aria-hidden":"true"})]}),t.jsx(N,{}),t.jsx(N,{}),t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage hd-gauge-cell--status",children:[t.jsx("span",{className:"hd-gauge-window-name label-xs",children:e.windowLabel??"usage"}),t.jsx("span",{className:"hd-gauge-status",children:e.statusLabel})]}),t.jsx("span",{className:"hd-gauge-cell hd-gauge-reset",children:e.detailLabel??"quota n/a"})]});const n=w(e),{shortWindow:l,longWindow:i}=Q(n),o=W(Math.max(...n.map(h=>h.fill))),d=Math.round(Math.max(...n.map(h=>h.fill))*100);return t.jsxs(c,{className:`hd-gauge hd-gauge--${o}${s?" hd-gauge--interactive":""}`,title:E(e,a),"aria-label":`${e.label} subscription usage. ${E(e,a)}`,...r,children:[t.jsxs("span",{className:"hd-gauge-head",children:[t.jsx("span",{className:"hd-gauge-label",children:e.label}),t.jsxs("span",{className:`hd-gauge-pct hd-gauge-pct--${o}`,children:[d,"%"]})]}),t.jsx(T,{window:l}),t.jsx(R,{window:l,now:a}),t.jsx(T,{window:i}),t.jsx(R,{window:i,now:a,featured:!0})]})}function Y(e){const a=e.trim().match(/^(\d+(?:\.\d+)?)([kKmM])?$/u);if(!a)return 0;const s=Number(a[1]);if(!Number.isFinite(s))return 0;switch(a[2]?.toLowerCase()){case"m":return s*1e6;case"k":return s*1e3;default:return s}}function Z(e){return e.kind==="quota"?Math.max(e.fill,...w(e).map(a=>a.fill)):Y(e.statusLabel)>0?.01:0}function J(e){return e.kind==="quota"}function ee(e){return C(e).slice(0,I)}function C(e){return e.map((a,s)=>({gauge:a,index:s,score:Z(a)})).sort((a,s)=>s.score-a.score||a.index-s.index).map(({gauge:a})=>a)}function re(e){const{now:a,operatorName:s,syncLabel:c,error:r,loading:n,refreshing:l,onRefresh:i,navigate:o,heartrate:d,heartrateWindow:h,heartrateBucketLabel:b,heartrateVisibleEventThreshold:m=q,serviceGauges:f}=e,[g,p]=v.useState(!1),u=r?"err":"ok",x=f.filter(J),$=C(x),k=ee(x),y=g?$:k,F=x.length>k.length,L=d.reduce((j,D)=>j+D.count,0),M=L>=m;return t.jsxs("section",{className:"hd","aria-label":"Fleet Cockpit and Service Cluster",children:[t.jsxs("div",{className:"hd-vitals-band",children:[t.jsxs("div",{className:"hd-vitals-left",children:[t.jsx("span",{className:"label-sm hd-vitals-title",children:"Fleet Cockpit"}),s&&t.jsx("span",{className:"chip chip--neutral chip--mono chip--sm hd-vitals-callsign",children:s})]}),t.jsxs("div",{className:"hd-vitals-right",children:[r&&t.jsx("span",{className:"dot dot--warning","aria-hidden":"true"}),t.jsx("span",{className:`hd-meta hd-meta--${u}`,children:c}),t.jsx("button",{type:"button",className:"hd-refresh-btn",disabled:n||l,onClick:i,title:"Refresh status (r)","aria-label":l?"Refreshing status":"Refresh status",children:t.jsx(H,{size:11,className:l?"hd-spin":"","aria-hidden":"true"})})]})]}),(y.length>0||M)&&t.jsxs("div",{className:`hd-telemetry-grid ${M&&y.length>0?"hd-telemetry-grid--split":"hd-telemetry-grid--single"}`,children:[y.length>0&&t.jsxs("div",{className:"hd-card hd-card--quotas",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx("span",{className:"label-xs hd-card-title",children:"Subscriptions & Quotas"}),t.jsxs("span",{className:"chip chip--neutral chip--mono chip--sm",children:[y.length," Active"]})]}),F&&t.jsxs("button",{type:"button",className:"hd-gauge-toggle","aria-expanded":g,onClick:()=>p(j=>!j),children:["[",g?"Top 2":`All ${x.length}`,"]"]})]}),t.jsxs("div",{className:"hd-gauge-set",children:[t.jsxs("div",{className:"hd-gauge-table-head label-xs","aria-hidden":"true",children:[t.jsx("span",{children:"Service"}),t.jsx("span",{children:"Short Window"}),t.jsx("span",{children:"Resets"}),t.jsx("span",{children:"Long Window"}),t.jsx("span",{children:"Reset Countdown"})]}),y.map(j=>t.jsx("span",{className:"hd-gauge-wrap",children:t.jsx(K,{gauge:j,now:a,onClick:()=>o({view:"harnesses"})})},j.id))]})]}),M&&t.jsxs("div",{className:"hd-card hd-card--heartrate",children:[t.jsxs("div",{className:"hd-card-head",children:[t.jsxs("div",{className:"hd-card-head-left",children:[t.jsx(_,{size:12,className:"hd-heartrate-icon","aria-hidden":"true"}),t.jsx("span",{className:"label-xs hd-card-title",children:"Fleet Velocity"})]}),t.jsxs("div",{className:"hd-card-head-right",children:[t.jsxs("span",{className:"label-xs hd-card-sub",children:[h," ",b?`· ${b}`:""]}),t.jsxs("span",{className:"chip chip--working chip--mono chip--sm",children:[L," ",L===1?"Event":"Events"]})]})]}),t.jsx("div",{className:"hd-heartrate-plot-body",children:t.jsx(X,{buckets:d})})]})]})]})}export{re as default};
@@ -0,0 +1 @@
1
+ import{r as c,j as s}from"./index-Bli6bTLU.js";/* empty css */import{H as ds}from"./HarnessMark-DGZ6o6Ct.js";import{a as b}from"./api-DEHEgJ9m.js";import{u as hs}from"./sse-CSozY6mp.js";import{t as C}from"./time-Dhsh_2EG.js";import{C as ms}from"./compass-BepM5iWH.js";import{F as us}from"./file-text-BVhkMWyC.js";import{L as ps}from"./layout-grid-DMpv9CZM.js";import{R as xs}from"./refresh-cw-IgN2fZLM.js";import{A as H}from"./arrow-up-right-RBC6k8nn.js";import{C as Ns}from"./cpu-Bc268H9Q.js";import{G as fs,D as js}from"./gauge-CPcEPmNt.js";import{c as gs}from"./createLucideIcon-DLlxGjKt.js";import"./index-BWHgHrtv.js";const bs=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],ks=gs("folder-git-2",bs),vs=.8,ws=20,F="░",T="·",Ss=["▏","▎","▍","▌","▋","▊","▉"];function ys(a,r=ws){const o=Number.isFinite(a)?Math.min(1,Math.max(0,a)):0,d=Math.round(o*100);if(o<=0)return{filled:"",rest:T.repeat(r),cells:r,percent:0};const i=o*r;let h=Math.floor(i),m=Math.round((i-h)*8);return m===8&&(h+=1,m=0),h>=r?{filled:F.repeat(r),rest:"",cells:r,percent:d}:m===0?h===0?{filled:"▏",rest:T.repeat(r-1),cells:r,percent:d}:{filled:F.repeat(h),rest:T.repeat(r-h),cells:r,percent:d}:{filled:F.repeat(h)+Ss[m-1],rest:T.repeat(r-h-1),cells:r,percent:d}}function S(a){return a.kind==="status"||typeof a.fill!="number"||!Number.isFinite(a.fill)?null:Math.min(1,Math.max(0,a.fill))}function _(a){const r=S(a);return r!==null&&r>=vs}function J(a){return S(a)===0}function $s(a){if(a===null)return{verdict:"Reading",figures:"provider budgets still arriving",showGauges:!1,near:[],unused:0,configured:0,peakPercent:null};if(a.length===0)return{verdict:"All clear",figures:"no provider budgets reported",showGauges:!1,near:[],unused:0,configured:0,peakPercent:null};const r=[...a].filter(_).sort((v,D)=>(S(D)??0)-(S(v)??0)),o=a.filter(J).length,d=a.map(S).filter(v=>v!==null),i=d.length>0?Math.round(Math.max(...d)*100):null,h=a.length-o;let m;r.length>0?m=`${r.length} near ceiling`:h===0?m="Unused":m=`Peak ${i??0}%`;const f=[r.length>0?r.map(v=>`${v.label} ${Math.round((S(v)??0)*100)}%`).join(" · "):null,`${a.length} configured`,o>0&&h>0?`${o} unused`:null].filter(Boolean).join(" · ");return{verdict:m,figures:f,showGauges:!0,near:r,unused:o,configured:a.length,peakPercent:i}}function Es(a,r){if(!a)return r||"process";if(a.includes("--append-system-prompt")){const o=a.match(/session-[a-zA-Z0-9_-]+/);return o?`${r||"harness"} (relay ${o[0]})`:`${r||"harness"} (prompted relay)`}return a.length>70?`${a.slice(0,67)}...`:a}function I(a){if(!a)return"workspace";const r=a.replace(/\/+$/,"").split("/");return r[r.length-1]||a}function Rs(a){if(!a)return;const[r,o]=a.includes("-")?a.split("-"):["0",a],d=o.split(":").map(f=>Number.parseInt(f,10));if(d.length<2||d.some(f=>!Number.isFinite(f)))return;const[i,h,m]=d.length===3?d:[0,d[0],d[1]];return((Number.parseInt(r,10)||0)*24+i)*3600+h*60+m}function Z(a){if(a<60)return`${Math.round(a)}s`;const r=Math.floor(a/60);if(r<60)return`${r}m`;const o=Math.floor(r/60),d=r%60;return o<24?d?`${o}h${String(d).padStart(2,"0")}m`:`${o}h`:`${Math.floor(o/24)}d${o%24}h`}function As(a){const r=a.split("/").filter(Boolean);return r[r.length-1]||a}const X={stalled_relay:"relay",idle_process:"process",uncommitted_branch:"branch",unresumed_session:"session"};function Ps({gauge:a}){const r=S(a),o=_(a),d=J(a),i=ys(r??0),h=r!==null,m=o?"warn":d||!h?"unused":"ok",f=d?"UNUSED":a.resetAt?`RESET ${C(a.resetAt)}`:a.statusLabel||a.usedLabel||"";return s.jsxs("div",{className:`s-host-rack-row ${o?"s-host-rack-row--warn":""} ${d||!h?"s-host-rack-row--unused":""}`,children:[s.jsx("span",{className:"s-host-rack-name font-mono",children:a.label}),s.jsxs("span",{className:`s-host-gauge s-host-gauge--${m}`,role:"meter","aria-label":h?`${a.label} ${i.percent} percent`:`${a.label} ${a.statusLabel||"no quota"}`,"aria-valuemin":h?0:void 0,"aria-valuemax":h?100:void 0,"aria-valuenow":h?i.percent:void 0,children:[s.jsx("span",{className:"s-host-gauge-chrome","aria-hidden":"true",children:"["}),s.jsx("span",{className:"s-host-gauge-fill","aria-hidden":"true",children:i.filled}),s.jsx("span",{className:"s-host-gauge-rest","aria-hidden":"true",children:i.rest}),s.jsx("span",{className:"s-host-gauge-chrome","aria-hidden":"true",children:"]"})]}),s.jsx("span",{className:`s-host-rack-right font-mono ${o?"s-host-rack-age--warn":""} ${d||!h?"s-host-rack-dim":""}`,children:h?`${i.percent}%`:"—"}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono s-host-rack-truncate",children:f})]})}function Js({navigate:a,agents:r}){const[o,d]=c.useState(null),[i,h]=c.useState(null),[m,f]=c.useState(null),[v,D]=c.useState(null),[z,ss]=c.useState(null),[L,es]=c.useState(null),[O,ts]=c.useState([]),[Ms,as]=c.useState(null),[V,ns]=c.useState([]),[Ts,rs]=c.useState([]),[Is,K]=c.useState(!0),[E,W]=c.useState(!1),[Cs,os]=c.useState(Date.now()),[G,Y]=c.useState("inquiry"),[ls,Ds]=c.useState(!1),[Ls,Os]=c.useState({"q-attention":!0,"q-dropped":!0,"q-quotas":!0,"q-posture":!0}),R=c.useCallback(async(e=!1)=>{e?W(!0):K(!0);try{const[t,n,l,k,P,p,N,M,B,q]=await Promise.allSettled([b("/.host-info"),b("/api/build"),b("/api/service-budgets"),b("/api/tail/discover"),b("/api/knowledge/status"),b("/api/pairing-state"),b("/api/terminal-sessions"),b("/api/fleet"),b("/api/sessions"),b("/api/activity")]);t.status==="fulfilled"&&d(t.value),n.status==="fulfilled"&&h(n.value),l.status==="fulfilled"?f(l.value?.gauges??[]):l.status==="rejected"&&f([]),k.status==="fulfilled"&&D(k.value),P.status==="fulfilled"&&ss(P.value),p.status==="fulfilled"&&es(p.value),N.status==="fulfilled"&&N.value?.sessions&&ts(N.value.sessions),M.status==="fulfilled"&&as(M.value),B.status==="fulfilled"&&Array.isArray(B.value)&&ns(B.value),q.status==="fulfilled"&&Array.isArray(q.value)&&rs(q.value),os(Date.now())}finally{K(!1),W(!1)}},[]);c.useEffect(()=>{R()},[R]),hs(()=>{R(!0)});const x=v?.processes??[],is=ls?x:x.slice(0,5);c.useMemo(()=>{const e={};for(const t of r){const n=t.harness||"other";e[n]||(e[n]={total:0,active:0}),e[n].total+=1,t.state==="working"&&(e[n].active+=1)}for(const t of x){const n=t.harness||"other";e[n]||(e[n]={total:0,active:0}),e[n].total=Math.max(e[n].total,1),e[n].active=Math.max(e[n].active,1)}return e},[r,x]);const $=c.useMemo(()=>{const e=new Map;for(const t of r){const n=t.projectRoot||t.cwd||"unknown";e.has(n)||e.set(n,{root:n,name:I(n),agents:[],branches:new Set,processes:[]});const l=e.get(n);l.agents.push(t),t.branch&&l.branches.add(t.branch)}for(const t of x)if(t.cwd)for(const[n,l]of e.entries())(t.cwd.startsWith(n)||n.startsWith(t.cwd))&&l.processes.push(t);return Array.from(e.values())},[r,x]),w=c.useMemo(()=>{const e=$.reduce((p,N)=>p+Math.max(1,N.agents.length+N.processes.length*3),0),t=$.map(p=>{const N=Math.max(1,p.agents.length+p.processes.length*3),M=e>0?Math.round(N/e*100):0;return{...p,weight:N,percent:M,primaryBranch:Array.from(p.branches)[0]||p.name==="openscout"&&i?.gitBranch||"main"}}).sort((p,N)=>N.weight-p.weight),n=t.slice(0,5),l=t[0],k=t.slice(5),P=k.reduce((p,N)=>p+N.percent,0);return{ranked:t,topProjects:n,topProject:l,otherProjects:k,otherPercent:P,totalProjects:t.length}},[$,i]),j=c.useMemo(()=>{const e=[];for(const t of x)if(t.command&&t.command.includes("--append-system-prompt")){const n=t.command.match(/session-[a-zA-Z0-9_-]+/),l=n?n[0]:`PID ${t.pid}`;e.push({id:`relay-${t.pid}`,kind:"stalled_relay",title:l,subtitle:`Launched in ${I(t.cwd)} · PID ${t.pid} · Runtime ${t.etime||"active"}`,ageLabel:t.etime||"active",ageSeconds:Rs(t.etime),projectRoot:t.cwd||void 0,harness:t.harness,pid:t.pid,severity:"warn",actionLabel:"Tail Process",actionRoute:{view:"ops",mode:"mission"}})}i?.gitBranch&&i.gitBranch!=="main"&&e.push({id:"branch-divergence",kind:"uncommitted_branch",title:i.gitBranch,subtitle:`Local worktree is ahead with uncommitted edits on ${i.runtime?.platform||"darwin"}`,ageLabel:"Unmerged",projectRoot:"/Users/art/dev/openscout",severity:"neutral",actionLabel:"Inspect Repos",actionRoute:{view:"repos"}});for(const t of V.slice(0,4))t.lastMessageAt&&Date.now()-t.lastMessageAt>3600*1e3&&e.push({id:`session-${t.id}`,kind:"unresumed_session",title:t.title||t.id,subtitle:`Last turn recorded ${C(t.lastMessageAt)} · ${t.messageCount} messages · ${I(t.workspaceRoot)}`,ageLabel:C(t.lastMessageAt),ageSeconds:(Date.now()-t.lastMessageAt)/1e3,conversationId:t.id,projectRoot:t.workspaceRoot||void 0,harness:t.harness||void 0,severity:"info",actionLabel:"Open Chat",actionRoute:{view:"conversation",conversationId:t.id}});return e},[x,i,V]),g=c.useMemo(()=>m?.length?[...m].sort((e,t)=>(t.fill??0)-(e.fill??0))[0]:null,[m]),u=c.useMemo(()=>{const e=w.ranked;if(e.length===0)return null;const t=e[0].percent,n=w.otherProjects;return{verdict:t>=50?"Concentrated":t>=25?"Weighted":"Scattered",topPercent:t,tailPercent:w.otherPercent,tailCount:n.length,tailAgents:n.reduce((l,k)=>l+k.agents.length,0),tailProcesses:n.reduce((l,k)=>l+k.processes.length,0),aboveTen:e.filter(l=>l.percent>=10).length}},[w]),y=c.useMemo(()=>{const e=j.reduce((n,l)=>(n[l.kind]=(n[l.kind]??0)+1,n),{}),t=j.map(n=>n.ageSeconds).filter(n=>typeof n=="number").sort((n,l)=>l-n)[0];return{verdict:j.length===0?"Nothing unattended":`${j.length} unattended`,byKind:e,oldestLabel:t?Z(t):null}},[j]),U=c.useMemo(()=>$s(m),[m]),A=c.useMemo(()=>{const e=O.length,t=z?.indexedSessions??0,n=L?.trustedPeerCount??0,l=o?.brokerUrl||(o?.ports?.broker?`127.0.0.1:${o.ports.broker}`:null);return[{key:"broker",label:"broker",detail:l?[l,o?.brokerSocketPath?As(o.brokerSocketPath):null].filter(Boolean).join(" · "):"endpoint not reported",state:l?"UP":"UNKNOWN",tone:l?"ok":"unknown"},{key:"pty",label:"pty relay",detail:e>0?`${e} socket${e===1?"":"s"}`:"0 sockets · latency unmeasured",state:e>0?"ACTIVE":"IDLE",tone:e>0?"ok":"idle"},{key:"knowledge",label:"knowledge",detail:t>0?`${t.toLocaleString()} transcript${t===1?"":"s"} indexed`:"0 transcripts indexed",state:t>0?"INDEXED":"EMPTY",tone:t>0?"ok":"warn",action:t>0?void 0:{label:"Index",route:{view:"search"}}},{key:"mesh",label:"mesh",detail:n>0?`${n} trusted peer${n===1?"":"s"} · scope ${o?.advertiseScope||"mesh"}`:`no trusted peers · scope ${o?.advertiseScope||"mesh"}`,state:n>0?"PAIRED":"UNPAIRED",tone:n>0?"ok":"idle"}]},[o,O,z,L]),Q=c.useMemo(()=>{const e=A.reduce((n,l)=>(n[l.tone]=(n[l.tone]??0)+1,n),{}),t=A.filter(n=>n.tone==="warn");return{verdict:t.length>0?`${t.length} ${t.length===1?"needs":"need"} attention`:"All nominal",figures:[e.ok?`${e.ok} up`:null,e.idle?`${e.idle} idle`:null,e.warn?`${e.warn} empty`:null,e.unknown?`${e.unknown} unknown`:null].filter(Boolean).join(" · ")}},[A]);o?.nodeName||o?.hostName;const cs=i?.runtime?`${i.runtime.platform} ${i.runtime.arch} · ${i.runtime.engine} ${i.runtime.engineVersion}`:"Darwin arm64";return s.jsxs("div",{className:"s-host-view",children:[s.jsxs("header",{className:"s-host-header",children:[s.jsxs("div",{className:"s-host-header-left",children:[s.jsxs("div",{className:"s-host-header-status-line",children:[s.jsx("span",{className:"dot dot--sm dot--working dot--pulse","aria-hidden":"true"}),s.jsxs("span",{className:"label-xs s-host-mono-dim",children:["NODE: ",o?.nodeId||"local"]}),s.jsx("span",{className:"s-host-header-divider",children:"/"}),s.jsx("span",{className:"label-xs s-host-mono-dim",children:cs}),i?.gitHash&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"s-host-header-divider",children:"/"}),s.jsxs("span",{className:"label-xs s-host-mono-dim",children:["git:",i.gitHash.slice(0,7)]})]})]}),s.jsxs("h1",{className:"s-host-title",children:[s.jsx(ms,{size:22,className:"s-host-title-icon"}),s.jsx("span",{children:"Host Advisor"})]})]}),s.jsxs("div",{className:"s-host-header-right",children:[s.jsxs("div",{className:"s-host-mode-toggle",role:"group","aria-label":"Advisor Format",children:[s.jsxs("button",{type:"button",className:`s-host-mode-btn ${G==="inquiry"?"s-host-mode-btn--active":""}`,onClick:()=>Y("inquiry"),title:"Formatted Executive Inquiries & Operator Answers",children:[s.jsx(us,{size:12}),s.jsx("span",{children:"Inquiries"})]}),s.jsxs("button",{type:"button",className:`s-host-mode-btn ${G==="matrix"?"s-host-mode-btn--active":""}`,onClick:()=>Y("matrix"),title:"Compact Infrastructure Matrix",children:[s.jsx(ps,{size:12}),s.jsx("span",{children:"Matrix"})]})]}),s.jsxs("button",{type:"button",className:`btn btn--sm ${E?"btn--accent":""}`,disabled:E,onClick:()=>{R(!0)},children:[s.jsx(xs,{size:12,className:E?"s-spin":""}),s.jsx("span",{children:E?"Scanning...":"Refresh"})]})]})]}),s.jsxs("section",{className:"s-host-readouts","aria-label":"Host Readouts",children:[s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"AGENTS"}),s.jsx("span",{className:"s-host-readout-figure",children:r.length}),s.jsxs("span",{className:"label-xs s-host-readout-qual",children:[x.length," PROCESS",x.length===1?"":"ES"]})]}),s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"ROOTS"}),s.jsx("span",{className:"s-host-readout-figure",children:$.length}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:u?`TOP SHARE ${u.topPercent}%`:"NONE ACTIVE"})]}),s.jsxs("div",{className:`s-host-readout ${g&&_(g)?"s-host-readout--warn":""}`,children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"PEAK BUDGET"}),s.jsx("span",{className:"s-host-readout-figure",children:g?`${Math.round((g.fill??0)*100)}%`:"—"}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:g?`${g.label}${g.resetAt?` · RESET ${C(g.resetAt)}`:""}`:"NO PROVIDERS CONFIGURED"})]}),s.jsxs("div",{className:`s-host-readout ${j.length>0?"s-host-readout--flag":""}`,children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"UNATTENDED"}),s.jsx("span",{className:"s-host-readout-figure",children:j.length}),s.jsx("span",{className:"label-xs s-host-readout-qual",children:y.oldestLabel?`OLDEST ${y.oldestLabel}`:"NONE OPEN"})]}),s.jsxs("div",{className:"s-host-readout",children:[s.jsx("span",{className:"label-xs s-host-readout-label",children:"MESH PEERS"}),s.jsx("span",{className:"s-host-readout-figure",children:L?.trustedPeerCount??0}),s.jsxs("span",{className:"label-xs s-host-readout-qual",children:["SCOPE ",(o?.advertiseScope||"mesh").toUpperCase()]})]})]}),G==="inquiry"?s.jsxs("div",{className:"s-host-readings","aria-label":"Host Readings",children:[s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"01 // ATTENTION"}),s.jsx("span",{className:"s-host-reading-verdict",children:u?.verdict??"No active roots"}),s.jsx("span",{className:"s-host-reading-figures",children:u?s.jsxs(s.Fragment,{children:["top ",u.topPercent,"%",s.jsx("span",{className:"s-host-sep",children:"·"}),"tail ",u.tailPercent,"%",s.jsx("span",{className:"s-host-sep",children:"·"}),u.aboveTen," root",u.aboveTen===1?"":"s"," above 10%"]}):s.jsx(s.Fragment,{children:"no agents or processes bound to a workspace"})}),s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"repos"}),children:[s.jsx("span",{children:"Repos"}),s.jsx(H,{size:10})]})]}),w.ranked.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"s-host-share-bar",children:[w.topProjects.map((e,t)=>s.jsx("div",{className:`s-host-share-seg s-host-share-seg--${Math.min(t,4)}`,style:{width:`${e.percent}%`},title:`${e.name} ${e.percent}%`,children:s.jsxs("span",{className:"s-host-share-seg-label font-mono text-2xs",children:[e.name," ",e.percent,"%"]})},e.root)),u&&u.tailCount>0&&s.jsx("div",{className:"s-host-share-seg s-host-share-seg--tail",style:{flex:1},children:s.jsxs("span",{className:"s-host-share-seg-label font-mono text-2xs",children:[u.tailCount," OTHER ROOTS — ",u.tailPercent,"%"]})})]}),s.jsxs("div",{className:"s-host-rack s-host-rack--roots",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs",children:"ROOT"}),s.jsx("span",{className:"label-xs",children:"SHARE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PCT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"AGENTS"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PROCS"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"BRANCH"})]}),w.topProjects.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:"s-host-rack-name font-mono",children:e.name}),s.jsx("span",{className:"s-host-rack-track",children:s.jsx("span",{className:"s-host-rack-fill",style:{width:`${u&&u.topPercent>0?Math.round(e.percent/u.topPercent*100):0}%`}})}),s.jsxs("span",{className:"s-host-rack-right font-mono",children:[e.percent,"%"]}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.agents.length}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.processes.length}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono s-host-rack-truncate",children:e.primaryBranch})]},e.root)),u&&u.tailCount>0&&s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--tail",children:[s.jsxs("span",{className:"s-host-rack-name font-mono",children:["tail — ",u.tailCount," roots"]}),s.jsx("span",{className:"s-host-rack-track s-host-rack-track--hatch"}),s.jsxs("span",{className:"s-host-rack-right font-mono",children:[u.tailPercent,"%"]}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:u.tailAgents}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:u.tailProcesses}),s.jsxs("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:["each below ",w.topProjects.at(-1)?.percent??0,"%"]})]})]})]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"02 // UNATTENDED"}),s.jsx("span",{className:"s-host-reading-verdict",children:y.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:j.length>0?s.jsxs(s.Fragment,{children:[y.oldestLabel&&s.jsxs(s.Fragment,{children:["oldest ",y.oldestLabel,s.jsx("span",{className:"s-host-sep",children:"·"})]}),Object.entries(y.byKind).map(([e,t])=>`${t} ${X[e]??e}`).join(" · "),s.jsx("span",{className:"s-host-sep",children:"·"}),"of ",x.length," processes"]}):s.jsx(s.Fragment,{children:"no idle relays, diverged branches or stale conversations"})})]}),j.length>0&&s.jsxs("div",{className:"s-host-rack s-host-rack--unattended",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs"}),s.jsx("span",{className:"label-xs",children:"SIGNAL"}),s.jsx("span",{className:"label-xs",children:"ROOT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"REF"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"AGE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"ACTION"})]}),j.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:`dot dot--sm ${e.severity==="warn"?"dot--warning":"dot--neutral"}`,"aria-hidden":"true"}),s.jsx("span",{className:"s-host-rack-name font-mono s-host-rack-truncate",children:e.title}),s.jsx("span",{className:"s-host-rack-dim font-mono s-host-rack-truncate",children:e.projectRoot?I(e.projectRoot):"—"}),s.jsx("span",{className:"s-host-rack-right s-host-rack-dim font-mono",children:e.pid?`pid ${e.pid}`:X[e.kind]??e.kind}),s.jsx("span",{className:`s-host-rack-right font-mono s-host-rack-age ${e.severity==="warn"?"s-host-rack-age--warn":""}`,children:e.ageSeconds?Z(e.ageSeconds):e.ageLabel}),s.jsx("span",{className:"s-host-rack-right s-host-rack-actions",children:e.actionRoute&&s.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>e.actionRoute&&a(e.actionRoute),children:e.actionLabel})})]},e.id))]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"03 // BUDGETS"}),s.jsx("span",{className:"s-host-reading-verdict",children:U.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:U.figures}),s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"harnesses"}),children:[s.jsx("span",{children:"Providers"}),s.jsx(H,{size:10})]})]}),U.showGauges&&m&&s.jsxs("div",{className:"s-host-rack s-host-rack--budgets",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs",children:"PROVIDER"}),s.jsx("span",{className:"label-xs",children:"GAUGE"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"PCT"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"NOTE"})]}),m.map(e=>s.jsx(Ps,{gauge:e},e.id))]})]}),s.jsxs("article",{className:"s-host-reading",children:[s.jsxs("div",{className:"s-host-reading-head",children:[s.jsx("span",{className:"label-xs s-host-reading-num",children:"04 // SUBSYSTEMS"}),s.jsx("span",{className:"s-host-reading-verdict",children:Q.verdict}),s.jsx("span",{className:"s-host-reading-figures",children:Q.figures})]}),s.jsxs("div",{className:"s-host-rack s-host-rack--subsystems",children:[s.jsxs("div",{className:"s-host-rack-row s-host-rack-row--head",children:[s.jsx("span",{className:"label-xs"}),s.jsx("span",{className:"label-xs",children:"SUBSYSTEM"}),s.jsx("span",{className:"label-xs",children:"DETAIL"}),s.jsx("span",{className:"label-xs s-host-rack-right",children:"STATE"})]}),A.map(e=>s.jsxs("div",{className:"s-host-rack-row",children:[s.jsx("span",{className:`dot dot--sm s-host-dot--${e.tone}`,"aria-hidden":"true"}),s.jsx("span",{className:"s-host-rack-name font-mono",children:e.label}),s.jsx("span",{className:"s-host-rack-dim font-mono s-host-rack-truncate",children:e.detail}),s.jsxs("span",{className:"s-host-rack-right s-host-rack-actions",children:[e.action&&s.jsx("button",{type:"button",className:"btn btn--sm s-host-btn-accent",onClick:()=>e.action&&a(e.action.route),children:e.action.label}),s.jsx("span",{className:`chip chip--sm chip--mono s-host-state s-host-state--${e.tone}`,children:e.state})]})]},e.key))]})]})]}):s.jsxs("div",{className:"s-host-matrix-container",children:[s.jsxs("section",{className:"s-host-telemetry-grid","aria-label":"Host Telemetry Overview",children:[s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"REGISTERED AGENTS"}),s.jsx(Ns,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:r.length}),s.jsxs("span",{className:"s-host-stat-kicker",children:[x.length," background processes"]})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"SERVICE QUOTA RADAR"}),s.jsx(fs,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:g?`${Math.round((g.fill??0)*100)}%`:"Nominal"}),s.jsx("span",{className:"s-host-stat-kicker",children:"peak token consumption"})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"WORKSPACES & REPOS"}),s.jsx(ks,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:$.length}),s.jsx("span",{className:"s-host-stat-kicker",children:"registered project roots"})]})]}),s.jsxs("div",{className:"s-host-stat-box",children:[s.jsxs("div",{className:"s-host-stat-head",children:[s.jsx("span",{className:"label-xs s-host-stat-label",children:"SUBSYSTEM RELAYS"}),s.jsx(js,{size:13,className:"s-host-stat-icon"})]}),s.jsxs("div",{className:"s-host-stat-body",children:[s.jsx("span",{className:"s-host-stat-big",children:O.length}),s.jsx("span",{className:"s-host-stat-kicker",children:"live terminal relays"})]})]})]}),s.jsxs("section",{className:"s-host-block","aria-label":"Active Processes",children:[s.jsx("div",{className:"s-host-block-head",children:s.jsxs("span",{className:"label-xs",children:["ACTIVE HARNESS PROCESSES (",x.length,")"]})}),s.jsx("div",{className:"s-host-table-box",children:s.jsx("div",{className:"s-host-table",children:is.map(e=>s.jsxs("div",{className:"s-host-table-row",children:[s.jsxs("div",{className:"s-host-table-cell-main",children:[s.jsx("span",{className:"dot dot--sm dot--working dot--pulse","aria-hidden":"true"}),s.jsx(ds,{harness:e.harness,size:13}),s.jsx("span",{className:"font-semibold text-xs font-mono",children:Es(e.command,e.harness)}),s.jsxs("span",{className:"chip chip--sm chip--ghost chip--mono",children:["PID ",e.pid]}),e.etime&&s.jsx("span",{className:"chip chip--sm chip--ghost chip--mono",children:e.etime})]}),s.jsx("div",{className:"s-host-table-cell-action",children:s.jsxs("button",{type:"button",className:"btn btn--sm",onClick:()=>a({view:"ops",mode:"mission"}),children:[s.jsx("span",{children:"Tail"}),s.jsx(H,{size:10})]})})]},e.pid))})})]})]})]})}export{Js as HostAdvisorView};
@@ -1 +1 @@
1
- import{r as t,j as e}from"./index-o4FKpU7Z.js";/* empty css */import{a as se}from"./api-h5zurxmi.js";import{C as ne,au as re,av as Q,B as te,aw as ae,ax as ie,ay as A,az as ce,aA as B,aB as de,aC as oe,aD as le,H as he}from"./router-C65cZYPn.js";import{u as pe}from"./Provider-DKZWuzSR.js";import{c as P}from"./createLucideIcon-Bt67PWH-.js";import{X as ue}from"./x-ynOfVadO.js";import{C as V}from"./check--esHw52j.js";import{C as D}from"./copy-Dty8ZYsM.js";import{E as xe}from"./external-link-Dem738OJ.js";import{L as me}from"./loader-circle-4LDsy4Ke.js";const je=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],fe=P("file-braces",je);const ye=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],J=P("message-square-text",ye);const ve=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],ge=P("radio-tower",ve);function S({text:n,query:f}){return e.jsx(e.Fragment,{children:he(n,f).map((l,i)=>l.match?e.jsx("mark",{children:l.text},i):e.jsx("span",{children:l.text},i))})}function U(n){return n.renderedText||n.summary||n.raw}function ke({record:n,role:f,query:l,expanded:i,onToggle:k}){const h=t.useRef(null),[y,N]=t.useState(!1),u=U(n),x=t.useCallback(()=>{const d=h.current;!d||i||N(d.scrollHeight>d.clientHeight+1)},[i]);return t.useEffect(()=>{x();const d=h.current;if(!d||i||typeof ResizeObserver>"u")return;const w=new ResizeObserver(x);return w.observe(d),()=>w.disconnect()},[i,x,l,u]),e.jsxs("article",{className:`ks-excerpt-turn${n.matched?" ks-excerpt-turn--matched":""}`,children:[e.jsxs("header",{children:[e.jsx("span",{children:String(n.index).padStart(4,"0")}),e.jsx("strong",{children:f}),n.matched?e.jsx("em",{children:"match"}):null]}),e.jsx("p",{ref:h,className:i?"is-expanded":void 0,children:e.jsx(S,{text:u,query:l})}),y?e.jsx("button",{type:"button",className:"ks-excerpt-turn-expand","aria-expanded":i,onClick:k,children:i?"Collapse turn":"Show full turn"}):null]})}function X(){const{selectedKnowledgeHit:n,selectedKnowledgeQuery:f,clearKnowledgeHit:l,openFilePreview:i,navigate:k}=pe(),[h,y]=t.useState(null),[N,u]=t.useState(!1),[x,d]=t.useState(null),[w,_]=t.useState(!1),[b,M]=t.useState(!1),[G,I]=t.useState({}),[W,K]=t.useState({}),c=h&&h.hitId===n?.id?h.value:null,r=n?ne(n):null,v=n?re(n):null,$=n?Q(n,"project"):"",L=n?Q(n,"harness"):"",p=f.trim(),z=te(r),T=ae(r),q=r?.path??v?.path,m=n?ie(n):"",E=t.useMemo(()=>c?.records.filter(s=>s.matched).sort((s,o)=>{const a=A(s)-A(o);return a!==0?a:(o.matchCount??0)-(s.matchCount??0)}).at(0)??null,[c]),C=t.useMemo(()=>ce(c?.records??[],{contextRadius:4,maxTurns:6,centerRecordIndex:E?.index}),[c,E?.index]),O=t.useMemo(()=>{const s=C.flatMap(o=>o.kind==="turn"?[o.record.index]:o.records.map(a=>a.index));return s.length>0?[Math.min(...s),Math.max(...s)]:null},[C]),Y=c?.records.find(s=>s.matched)?.index??r?.recordRange?.[0];t.useEffect(()=>{I({}),K({}),M(!1),_(!1)},[n?.id]),t.useEffect(()=>{let s=!1;return(async()=>{if(y(null),d(null),!n||!r){u(!1);return}u(!0);try{const a=await se("/api/knowledge/source-preview",{method:"POST",body:JSON.stringify({sourceRef:r,contextRecords:4,maxRecords:80,q:p})});s||y({hitId:n.id,value:a})}catch(a){s||(y(null),d(a instanceof Error?a.message:String(a)))}finally{s||u(!1)}})(),()=>{s=!0}},[n?.id,r?.recordRange?.[0],r?.recordRange?.[1],p]);const Z=t.useCallback(()=>{const s=r??v;s&&i(B(s.path))},[r,v,i]),F=t.useCallback(async()=>{if(m)try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else if(typeof document<"u"){const s=document.createElement("textarea");s.value=m,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}M(!0),window.setTimeout(()=>M(!1),1600)}catch{}},[m]);return e.jsxs("div",{className:"ks-inspector",children:[x?e.jsx("div",{className:"ks-inspector-error",role:"alert",children:x}):null,e.jsx("section",{className:"ks-preview-panel","aria-label":"Selected search result preview",children:n?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"ks-preview-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"ks-panel-eyebrow",children:"Result"}),e.jsx("h2",{children:n.title})]}),e.jsx("button",{type:"button","aria-label":"Clear selected result",onClick:l,className:"ks-preview-close",children:e.jsx(ue,{size:14,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"ks-preview-meta",children:[$?e.jsx("span",{children:$}):null,L?e.jsx("span",{children:L}):null,n.freshness&&n.freshness!=="unknown"&&e.jsx("span",{children:n.freshness}),r?.recordRange?e.jsxs("span",{children:["records ",r.recordRange[0],"..",r.recordRange[1]]}):null]}),z||T||r||v||m?e.jsxs("div",{className:"ks-preview-actions","aria-label":"Selected result actions",children:[z?e.jsxs("button",{type:"button",className:"ks-action-primary",onClick:()=>k({view:"sessions",sessionId:z}),children:[e.jsx(J,{size:13,"aria-hidden":"true"}),"Open conversation"]}):null,T?e.jsxs("button",{type:"button",onClick:()=>k({view:"ops",mode:"tail",tailQuery:T}),children:[e.jsx(ge,{size:13,"aria-hidden":"true"}),"Observe window"]}):null,m?e.jsxs("button",{type:"button",onClick:()=>{F()},children:[b?e.jsx(V,{size:13,"aria-hidden":"true"}):e.jsx(D,{size:13,"aria-hidden":"true"}),b?"Copied":"Copy ref"]}):null,r||v?e.jsxs("button",{type:"button",onClick:Z,children:[e.jsx(xe,{size:13,"aria-hidden":"true"}),"Open file"]}):null]}):null,e.jsxs("details",{className:"ks-why-matched",children:[e.jsxs("summary",{children:[e.jsx("span",{children:de(n,p,E)}),e.jsx("em",{children:oe(n)})]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Index signal"}),e.jsx("dd",{children:n.scoreSource||"fts"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Origin"}),e.jsxs("dd",{children:[n.origin," · ",n.ownership]})]}),r?.recordRange?e.jsxs("div",{children:[e.jsx("dt",{children:"Records"}),e.jsxs("dd",{children:[r.recordRange[0],"…",r.recordRange[1]]})]}):null]})]}),N?e.jsxs("div",{className:"ks-preview-loading",children:[e.jsx(me,{size:15,className:"ks-spin","aria-hidden":"true"}),"Loading conversation…"]}):C.length>0?e.jsxs("section",{className:"ks-conversation-excerpt","aria-label":"Conversation excerpt",children:[e.jsxs("div",{className:"ks-rendered-head",children:[e.jsx(J,{size:14,"aria-hidden":"true"}),e.jsx("strong",{children:"Conversation"}),O?e.jsxs("span",{children:["records ",O[0],"…",O[1]]}):null]}),C.map((s,o)=>{if(s.kind==="folded"){const g=s.records[0]?.index??o,R=G[g]===!0;return e.jsxs("div",{className:"ks-excerpt-fold",children:[e.jsxs("button",{type:"button",className:"ks-excerpt-fold-toggle","aria-expanded":R,onClick:()=>I(j=>({...j,[g]:!R})),children:[e.jsx("span",{"aria-hidden":"true",children:R?"▾":"▸"}),s.summary]}),R?e.jsx("div",{className:"ks-excerpt-fold-body",children:s.records.map(j=>e.jsxs("article",{className:"ks-excerpt-turn ks-excerpt-turn--muted",children:[e.jsxs("header",{children:[e.jsx("span",{children:String(j.index).padStart(4,"0")}),e.jsx("strong",{children:le(j)})]}),e.jsx("p",{tabIndex:0,children:e.jsx(S,{text:U(j),query:p})})]},`fold-record:${j.index}`))}):null]},`fold:${g}`)}const{record:a,role:ee}=s,H=W[a.index]===!0;return e.jsx(ke,{record:a,role:ee,query:p,expanded:H,onToggle:()=>K(g=>({...g,[a.index]:!H}))},`turn:${a.index}`)})]}):e.jsxs("section",{className:"ks-indexed-snippet","aria-label":"Match snippet",children:[e.jsx("span",{children:"Match"}),e.jsx("p",{children:e.jsx(S,{text:n.snippet,query:p})})]}),q?e.jsxs("div",{className:"ks-preview-source",children:[e.jsx("span",{children:"Source"}),e.jsx("code",{children:B(q)}),e.jsxs("button",{type:"button",onClick:()=>{F()},"aria-label":"Copy source reference",children:[b?e.jsx(V,{size:12,"aria-hidden":"true"}):e.jsx(D,{size:12,"aria-hidden":"true"}),b?"Copied":"Copy ref"]})]}):null,c?e.jsxs("details",{className:"ks-jsonl-window",open:w,onToggle:s=>_(s.target.open),children:[e.jsxs("summary",{className:"ks-jsonl-window-head",children:[e.jsx("strong",{children:"Raw evidence (advanced)"}),e.jsxs("span",{children:["records ",c.previewRange[0],"..",c.previewRange[1]]})]}),c.records.map(s=>e.jsxs("details",{className:`ks-jsonl-record${s.matched?" ks-jsonl-record--matched":""}`,open:s.index===Y,children:[e.jsxs("summary",{children:[e.jsx("span",{children:String(s.index).padStart(4,"0")}),e.jsx("strong",{children:s.kind||s.role||s.type||"record"}),e.jsx("em",{children:e.jsx(S,{text:s.summary||"no summary",query:p})})]}),e.jsx("pre",{children:s.raw})]},`${c.path}:${s.index}`))]}):null]}):e.jsxs("div",{className:"ks-inspector-empty",children:[e.jsx(fe,{size:18,"aria-hidden":"true"}),e.jsx("strong",{children:"Select a result"}),e.jsx("span",{children:"Pick a match to see the conversation moment, jump to the session, or open the file."}),e.jsxs("span",{className:"ks-inspector-empty-hint",children:["Use ",e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," to walk the list, ",e.jsx("kbd",{children:"↵"})," to pick, ",e.jsx("kbd",{children:"⌘↵"})," to open the session."]})]})})]})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"})),_e=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"}));export{X as K,_e as a,Pe as r};
1
+ import{r as t,j as e}from"./index-Bli6bTLU.js";/* empty css */import{a as se}from"./api-DEHEgJ9m.js";import{C as ne,au as re,av as Q,B as te,aw as ae,ax as ie,ay as A,az as ce,aA as B,aB as de,aC as oe,aD as le,H as he}from"./router-B0YclXYg.js";import{u as pe}from"./Provider-Ve8yXaWR.js";import{c as P}from"./createLucideIcon-DLlxGjKt.js";import{X as ue}from"./x-BJyPzFnn.js";import{C as V}from"./check-Bfs7hMb1.js";import{C as D}from"./copy-De4s38o2.js";import{E as xe}from"./external-link-BGHC_naA.js";import{L as me}from"./loader-circle-DoT8gpw6.js";const je=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],fe=P("file-braces",je);const ye=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],J=P("message-square-text",ye);const ve=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],ge=P("radio-tower",ve);function S({text:n,query:f}){return e.jsx(e.Fragment,{children:he(n,f).map((l,i)=>l.match?e.jsx("mark",{children:l.text},i):e.jsx("span",{children:l.text},i))})}function U(n){return n.renderedText||n.summary||n.raw}function ke({record:n,role:f,query:l,expanded:i,onToggle:k}){const h=t.useRef(null),[y,N]=t.useState(!1),u=U(n),x=t.useCallback(()=>{const d=h.current;!d||i||N(d.scrollHeight>d.clientHeight+1)},[i]);return t.useEffect(()=>{x();const d=h.current;if(!d||i||typeof ResizeObserver>"u")return;const w=new ResizeObserver(x);return w.observe(d),()=>w.disconnect()},[i,x,l,u]),e.jsxs("article",{className:`ks-excerpt-turn${n.matched?" ks-excerpt-turn--matched":""}`,children:[e.jsxs("header",{children:[e.jsx("span",{children:String(n.index).padStart(4,"0")}),e.jsx("strong",{children:f}),n.matched?e.jsx("em",{children:"match"}):null]}),e.jsx("p",{ref:h,className:i?"is-expanded":void 0,children:e.jsx(S,{text:u,query:l})}),y?e.jsx("button",{type:"button",className:"ks-excerpt-turn-expand","aria-expanded":i,onClick:k,children:i?"Collapse turn":"Show full turn"}):null]})}function X(){const{selectedKnowledgeHit:n,selectedKnowledgeQuery:f,clearKnowledgeHit:l,openFilePreview:i,navigate:k}=pe(),[h,y]=t.useState(null),[N,u]=t.useState(!1),[x,d]=t.useState(null),[w,_]=t.useState(!1),[b,M]=t.useState(!1),[G,I]=t.useState({}),[W,K]=t.useState({}),c=h&&h.hitId===n?.id?h.value:null,r=n?ne(n):null,v=n?re(n):null,$=n?Q(n,"project"):"",L=n?Q(n,"harness"):"",p=f.trim(),z=te(r),T=ae(r),q=r?.path??v?.path,m=n?ie(n):"",E=t.useMemo(()=>c?.records.filter(s=>s.matched).sort((s,o)=>{const a=A(s)-A(o);return a!==0?a:(o.matchCount??0)-(s.matchCount??0)}).at(0)??null,[c]),C=t.useMemo(()=>ce(c?.records??[],{contextRadius:4,maxTurns:6,centerRecordIndex:E?.index}),[c,E?.index]),O=t.useMemo(()=>{const s=C.flatMap(o=>o.kind==="turn"?[o.record.index]:o.records.map(a=>a.index));return s.length>0?[Math.min(...s),Math.max(...s)]:null},[C]),Y=c?.records.find(s=>s.matched)?.index??r?.recordRange?.[0];t.useEffect(()=>{I({}),K({}),M(!1),_(!1)},[n?.id]),t.useEffect(()=>{let s=!1;return(async()=>{if(y(null),d(null),!n||!r){u(!1);return}u(!0);try{const a=await se("/api/knowledge/source-preview",{method:"POST",body:JSON.stringify({sourceRef:r,contextRecords:4,maxRecords:80,q:p})});s||y({hitId:n.id,value:a})}catch(a){s||(y(null),d(a instanceof Error?a.message:String(a)))}finally{s||u(!1)}})(),()=>{s=!0}},[n?.id,r?.recordRange?.[0],r?.recordRange?.[1],p]);const Z=t.useCallback(()=>{const s=r??v;s&&i(B(s.path))},[r,v,i]),F=t.useCallback(async()=>{if(m)try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else if(typeof document<"u"){const s=document.createElement("textarea");s.value=m,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}M(!0),window.setTimeout(()=>M(!1),1600)}catch{}},[m]);return e.jsxs("div",{className:"ks-inspector",children:[x?e.jsx("div",{className:"ks-inspector-error",role:"alert",children:x}):null,e.jsx("section",{className:"ks-preview-panel","aria-label":"Selected search result preview",children:n?e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"ks-preview-head",children:[e.jsxs("div",{children:[e.jsx("span",{className:"ks-panel-eyebrow",children:"Result"}),e.jsx("h2",{children:n.title})]}),e.jsx("button",{type:"button","aria-label":"Clear selected result",onClick:l,className:"ks-preview-close",children:e.jsx(ue,{size:14,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"ks-preview-meta",children:[$?e.jsx("span",{children:$}):null,L?e.jsx("span",{children:L}):null,n.freshness&&n.freshness!=="unknown"&&e.jsx("span",{children:n.freshness}),r?.recordRange?e.jsxs("span",{children:["records ",r.recordRange[0],"..",r.recordRange[1]]}):null]}),z||T||r||v||m?e.jsxs("div",{className:"ks-preview-actions","aria-label":"Selected result actions",children:[z?e.jsxs("button",{type:"button",className:"ks-action-primary",onClick:()=>k({view:"sessions",sessionId:z}),children:[e.jsx(J,{size:13,"aria-hidden":"true"}),"Open conversation"]}):null,T?e.jsxs("button",{type:"button",onClick:()=>k({view:"ops",mode:"tail",tailQuery:T}),children:[e.jsx(ge,{size:13,"aria-hidden":"true"}),"Observe window"]}):null,m?e.jsxs("button",{type:"button",onClick:()=>{F()},children:[b?e.jsx(V,{size:13,"aria-hidden":"true"}):e.jsx(D,{size:13,"aria-hidden":"true"}),b?"Copied":"Copy ref"]}):null,r||v?e.jsxs("button",{type:"button",onClick:Z,children:[e.jsx(xe,{size:13,"aria-hidden":"true"}),"Open file"]}):null]}):null,e.jsxs("details",{className:"ks-why-matched",children:[e.jsxs("summary",{children:[e.jsx("span",{children:de(n,p,E)}),e.jsx("em",{children:oe(n)})]}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Index signal"}),e.jsx("dd",{children:n.scoreSource||"fts"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Origin"}),e.jsxs("dd",{children:[n.origin," · ",n.ownership]})]}),r?.recordRange?e.jsxs("div",{children:[e.jsx("dt",{children:"Records"}),e.jsxs("dd",{children:[r.recordRange[0],"…",r.recordRange[1]]})]}):null]})]}),N?e.jsxs("div",{className:"ks-preview-loading",children:[e.jsx(me,{size:15,className:"ks-spin","aria-hidden":"true"}),"Loading conversation…"]}):C.length>0?e.jsxs("section",{className:"ks-conversation-excerpt","aria-label":"Conversation excerpt",children:[e.jsxs("div",{className:"ks-rendered-head",children:[e.jsx(J,{size:14,"aria-hidden":"true"}),e.jsx("strong",{children:"Conversation"}),O?e.jsxs("span",{children:["records ",O[0],"…",O[1]]}):null]}),C.map((s,o)=>{if(s.kind==="folded"){const g=s.records[0]?.index??o,R=G[g]===!0;return e.jsxs("div",{className:"ks-excerpt-fold",children:[e.jsxs("button",{type:"button",className:"ks-excerpt-fold-toggle","aria-expanded":R,onClick:()=>I(j=>({...j,[g]:!R})),children:[e.jsx("span",{"aria-hidden":"true",children:R?"▾":"▸"}),s.summary]}),R?e.jsx("div",{className:"ks-excerpt-fold-body",children:s.records.map(j=>e.jsxs("article",{className:"ks-excerpt-turn ks-excerpt-turn--muted",children:[e.jsxs("header",{children:[e.jsx("span",{children:String(j.index).padStart(4,"0")}),e.jsx("strong",{children:le(j)})]}),e.jsx("p",{tabIndex:0,children:e.jsx(S,{text:U(j),query:p})})]},`fold-record:${j.index}`))}):null]},`fold:${g}`)}const{record:a,role:ee}=s,H=W[a.index]===!0;return e.jsx(ke,{record:a,role:ee,query:p,expanded:H,onToggle:()=>K(g=>({...g,[a.index]:!H}))},`turn:${a.index}`)})]}):e.jsxs("section",{className:"ks-indexed-snippet","aria-label":"Match snippet",children:[e.jsx("span",{children:"Match"}),e.jsx("p",{children:e.jsx(S,{text:n.snippet,query:p})})]}),q?e.jsxs("div",{className:"ks-preview-source",children:[e.jsx("span",{children:"Source"}),e.jsx("code",{children:B(q)}),e.jsxs("button",{type:"button",onClick:()=>{F()},"aria-label":"Copy source reference",children:[b?e.jsx(V,{size:12,"aria-hidden":"true"}):e.jsx(D,{size:12,"aria-hidden":"true"}),b?"Copied":"Copy ref"]})]}):null,c?e.jsxs("details",{className:"ks-jsonl-window",open:w,onToggle:s=>_(s.target.open),children:[e.jsxs("summary",{className:"ks-jsonl-window-head",children:[e.jsx("strong",{children:"Raw evidence (advanced)"}),e.jsxs("span",{children:["records ",c.previewRange[0],"..",c.previewRange[1]]})]}),c.records.map(s=>e.jsxs("details",{className:`ks-jsonl-record${s.matched?" ks-jsonl-record--matched":""}`,open:s.index===Y,children:[e.jsxs("summary",{children:[e.jsx("span",{children:String(s.index).padStart(4,"0")}),e.jsx("strong",{children:s.kind||s.role||s.type||"record"}),e.jsx("em",{children:e.jsx(S,{text:s.summary||"no summary",query:p})})]}),e.jsx("pre",{children:s.raw})]},`${c.path}:${s.index}`))]}):null]}):e.jsxs("div",{className:"ks-inspector-empty",children:[e.jsx(fe,{size:18,"aria-hidden":"true"}),e.jsx("strong",{children:"Select a result"}),e.jsx("span",{children:"Pick a match to see the conversation moment, jump to the session, or open the file."}),e.jsxs("span",{className:"ks-inspector-empty-hint",children:["Use ",e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," to walk the list, ",e.jsx("kbd",{children:"↵"})," to pick, ",e.jsx("kbd",{children:"⌘↵"})," to open the session."]})]})})]})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"})),_e=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:X},Symbol.toStringTag,{value:"Module"}));export{X as K,_e as a,Pe as r};
@@ -0,0 +1 @@
1
+ import{r as l,j as e}from"./index-Bli6bTLU.js";/* empty css */import{a as F}from"./api-DEHEgJ9m.js";import{d as we}from"./time-Dhsh_2EG.js";import{u as ve}from"./Provider-Ve8yXaWR.js";import{o as le,p as Ce,q as Ee,t as Ke,v as oe,K as m,S as qe,x as fe,y as Le,z as Ae,A as Ie,B as ce,C as ue,D as Te,E as He,F as Re,G as $e,H as De,I as Fe}from"./router-B0YclXYg.js";import{S as Me}from"./search-BbgsEMXa.js";import{X as We}from"./x-BJyPzFnn.js";import{L as de}from"./loader-circle-DoT8gpw6.js";import{c as Oe}from"./createLucideIcon-DLlxGjKt.js";import{S as Pe}from"./sparkles-ytTwpCbZ.js";import{C as Ue}from"./chevron-down-Da5tV19_.js";import{C as ze}from"./clock-DaKLp6Xd.js";import"./provider-CX9EWecp.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./HarnessMark-DGZ6o6Ct.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";const _e=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Be=Oe("funnel",_e);function y(i){return new Intl.NumberFormat("en-US").format(i||0)}function Ge({text:i,query:a}){return e.jsx(e.Fragment,{children:De(i,a).map((o,c)=>o.match?e.jsx("mark",{children:o.text},c):e.jsx("span",{children:o.text},c))})}function Je(i,a){i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),a()))}async function Xe(){return F("/api/knowledge/status")}async function Qe(i){const a=new URLSearchParams;for(const o of i)a.append("key",o);return a.set("limit","200"),F(`/api/knowledge/search-primitives?${a.toString()}`)}async function G(i,a){const o=new URLSearchParams({q:i,limit:String(m.hitLimit)});if(a.sourceKinds.length>0)for(const u of a.sourceKinds)o.append("sourceKind",u);for(const u of a.harness)o.append("harness",u);for(const u of a.project)o.append("project",u);const c=$e(a.timeWindow);return c!=null&&o.set("updatedAfterMs",String(c)),F(`/api/knowledge/search?${o.toString()}`)}async function he(i=!1){return F("/api/knowledge/sessions/index",{method:"POST",body:JSON.stringify({days:m.days,limit:m.sessionLimit,force:i})})}const Ve=Le;function I({active:i,onClick:a,count:o,label:c,ariaLabel:u}){return e.jsxs("button",{type:"button",className:`ks-chip${i?" ks-chip--active":""}`,onClick:a,"aria-pressed":i,"aria-label":u??c,children:[e.jsx("span",{className:"ks-chip-label",children:c}),typeof o=="number"?e.jsx("span",{className:"ks-chip-count","aria-hidden":"true",children:y(o)}):null]})}function xe(i){return i&&i.split(/[\s_-]+/u).filter(a=>a.length>0).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function me(i,a,o=6){return i?i.filter(c=>c.key===a&&c.value.length>0).sort((c,u)=>u.count-c.count||c.value.localeCompare(u.value)).slice(0,o):[]}function pe(i){return i.sourceKinds.length>0||i.harness.length>0||i.project.length>0||i.timeWindow!=="all"}function Ye(i){const a=[];return i.sourceKinds.length>0&&a.push(i.sourceKinds.map(o=>fe[o]??o).join(" + ")),i.harness.length>0&&a.push(i.harness.map(xe).join(" + ")),i.project.length>0&&a.push(i.project.join(" + ")),i.timeWindow!=="all"&&a.push(Fe(i.timeWindow)),a.length>0?`Filters: ${a.join(" · ")}`:""}function Fs({navigate:i,mode:a,hitId:o,routeFilters:c}){const{selectedKnowledgeHit:u,inspectKnowledgeHit:g,clearKnowledgeHit:S}=ve(),ke=l.useMemo(()=>c||(typeof window>"u"?le():Ce(window.location.search)),[c]),[E,T]=l.useState(null),[J,je]=l.useState(null),[n,M]=l.useState(ke),[w,X]=l.useState([]),[W,Q]=l.useState(!1),[K,H]=l.useState(!1),[O,b]=l.useState(null),[ye,R]=l.useState(!1),[V,Y]=l.useState(!1),q=l.useRef(n);q.current=n;const p=(E?.chunks??0)>0,$=E?.activeJobs[0]??null,v=l.useMemo(()=>Ee(w),[w]),Z=K||!!$,L=n.query.trim(),P=Ke(n);l.useEffect(()=>{c&&M(s=>oe(s,c)?s:c)},[c]);const f=l.useMemo(()=>{const s=[];for(const t of v)s.push(...t.moments);return s},[v]),C=l.useCallback((s,t)=>{X(t.hits),T(t.status);const d=(o?t.hits.find(x=>x.id===o):void 0)??t.hits[0];d?g(d,s.query,s):S()},[o,g,S]),U=l.useCallback(async s=>{const t=s.query.trim();if(!t){X([]),S();return}Q(!0);try{b(null),C(s,await G(t,s))}catch(r){b(r instanceof Error?r.message:String(r))}finally{Q(!1)}},[C,S]),ee=l.useCallback(async(s=!1)=>{H(!0);try{b(null);const t=await he(s);T(t.status),R(!0);const r=q.current;t.status.chunks>0&&r.query.trim()&&C(r,await G(r.query.trim(),r))}catch(t){b(t instanceof Error?t.message:String(t))}finally{H(!1)}},[C]);l.useEffect(()=>{let s=!1;return(async()=>{try{const t=await Xe();if(s)return;T(t),R(!0),b(null)}catch{}if(!s){H(!0);try{b(null);const t=await he(!1);if(s)return;T(t.status),R(!0);const r=q.current;t.status.chunks>0&&r.query.trim()&&C(r,await G(r.query.trim(),r))}catch(t){s||(b(t instanceof Error?t.message:String(t)),R(!0))}finally{s||H(!1)}}})(),()=>{s=!0}},[C]),l.useEffect(()=>{if(!p||V)return;let s=!1;return(async()=>{try{const t=await Qe(["harness","project","sourceKind"]);s||(je(t),Y(!0))}catch{s||Y(!0)}})(),()=>{s=!0}},[p,V]),l.useEffect(()=>{if(!p)return;const s=window.setTimeout(()=>{U(n)},m.debounceMs);return()=>window.clearTimeout(s)},[n,p,U]);const ge=s=>{if(s.preventDefault(),!p&&!K){ee(!1);return}U(n)},j=l.useCallback(s=>{M(t=>{const r={...t,...s};return oe(t,r)?t:(i({view:"search",...a?{mode:a}:{},filters:r},{replace:!0}),r)})},[a,i]),A=l.useCallback(()=>{const s=le();M(s),i({view:"search",...a?{mode:a}:{},filters:s},{replace:!0})},[a,i]),be=l.useCallback(()=>{f[0]&&g(f[0],q.current.query)},[f,g]);l.useEffect(()=>{function s(t){const r=t.target,d=r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable);if(t.key==="/"&&!d){t.preventDefault();const x=document.querySelector(".ks-search-input");x?.focus(),x?.select()}else if(t.key==="Escape"&&!d)f.length>0?S():A();else if(!d&&(t.key==="j"||t.key==="k")){if(f.length===0)return;t.preventDefault();const x=u?f.findIndex(z=>z.id===u.id):-1,N=t.key==="j"?Math.min(f.length-1,x+1):Math.max(0,x-1),D=f[N];D&&g(D,q.current.query)}}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[f,g,S,u,A]);const Ne=E?we(E.generatedAt)||"just now":"—",Se=Z?$?`Indexing ${y($.progress.indexed??0)} of ${y($.progress.discovered??0)}`:p?`Refreshing last ${m.days} days in the background`:`Building last ${m.days} days of sessions`:p?`${y(E?.chunks??0)} moments · last ${m.days} days · updated ${Ne}`:ye?"No index yet":"Loading index",se=me(J?.facets,"harness"),te=me(J?.facets,"project");return e.jsxs("main",{className:"ks-page",children:[e.jsxs("div",{className:"ks-shell",children:[e.jsx("header",{className:"ks-header",children:e.jsxs("div",{className:"ks-header-titles",children:[e.jsx("span",{className:"ks-eyebrow",children:"Search"}),e.jsx("h1",{children:"Find anything you ran, opened, or decided"}),e.jsxs("p",{children:["Search across sessions, skills, MCP tools, codebase, and context packs from the last ",m.days," days."]})]})}),e.jsxs("form",{className:"ks-search-form",onSubmit:ge,role:"search",children:[e.jsx(Me,{size:17,strokeWidth:1.75,"aria-hidden":"true"}),e.jsx("input",{value:n.query,onChange:s=>j({query:s.target.value}),placeholder:"Search topics, files, decisions, agents…",className:"ks-search-input",spellCheck:!1,autoFocus:!0,"aria-label":"Search OpenScout knowledge"}),n.query?e.jsx("button",{type:"button",className:"ks-search-clear",onClick:()=>j({query:""}),"aria-label":"Clear search",children:e.jsx(We,{size:14,"aria-hidden":"true"})}):e.jsx("span",{className:"ks-search-hint","aria-hidden":"true",children:"/"}),W?e.jsx(de,{size:15,className:"ks-spin","aria-hidden":"true"}):null]}),e.jsxs("section",{className:"ks-filterbar","aria-label":"Search filters",children:[e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Be,{size:12,"aria-hidden":"true"}),"Source"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Source kind filters",children:qe.map(s=>e.jsx(I,{active:n.sourceKinds.includes(s),onClick:()=>j({sourceKinds:n.sourceKinds.includes(s)?n.sourceKinds.filter(t=>t!==s):[...n.sourceKinds,s]}),label:fe[s]??s},s))})]}),se.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Pe,{size:12,"aria-hidden":"true"}),"Agent"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Harness filters",children:se.map(s=>e.jsx(I,{active:n.harness.includes(s.value),onClick:()=>j({harness:n.harness.includes(s.value)?n.harness.filter(t=>t!==s.value):[...n.harness,s.value]}),label:xe(s.value),count:s.count},`harness:${s.value}`))})]}):null,te.length>0?e.jsxs("div",{className:"ks-filterbar-row",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(Ue,{size:12,"aria-hidden":"true"}),"Project"]}),e.jsx("div",{className:"ks-chip-row",role:"group","aria-label":"Project filters",children:te.map(s=>e.jsx(I,{active:n.project.includes(s.value),onClick:()=>j({project:n.project.includes(s.value)?n.project.filter(t=>t!==s.value):[...n.project,s.value]}),label:s.value,count:s.count},`project:${s.value}`))})]}):null,e.jsxs("div",{className:"ks-filterbar-row ks-filterbar-row--inline",children:[e.jsxs("span",{className:"ks-filterbar-label",children:[e.jsx(ze,{size:12,"aria-hidden":"true"}),"Time"]}),e.jsxs("div",{className:"ks-chip-row",role:"group","aria-label":"Time window filter",children:[e.jsx(I,{active:n.timeWindow==="all",onClick:()=>j({timeWindow:"all"}),label:"Any time"}),Ve.map(s=>e.jsx(I,{active:n.timeWindow===s.value,onClick:()=>j({timeWindow:s.value}),label:s.label},s.value))]}),pe(n)?e.jsx("button",{type:"button",className:"ks-clear-all",onClick:A,children:"Clear filters"}):null]})]}),O?e.jsx("section",{className:"ks-error",role:"alert",children:O}):null,!p&&!O?e.jsxs("div",{className:"ks-empty-state",children:[e.jsx("strong",{children:K?"Preparing your session index":"Preparing search"}),e.jsxs("span",{children:["First load builds the last ",m.days," days"," ","(up to ",y(m.sessionLimit)," sessions). You can keep this page open — results appear as soon as the index is ready."]})]}):null,p?e.jsxs("div",{className:"ks-hit-list",role:"listbox","aria-label":"Search results",children:[e.jsxs("div",{className:"ks-hit-list-head","aria-live":"polite",children:[e.jsx("span",{children:W?"Searching…":L?`${y(v.length)} session${v.length===1?"":"s"}`:"Ready"}),L&&w.length>0?e.jsxs("span",{className:"ks-hit-list-meta",children:[y(w.length)," moment",w.length===1?"":"s",P?e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"ks-text-action",onClick:A,children:"Clear filters"})]}):null]}):null]}),L&&v.length===0&&!W?e.jsxs("div",{className:"ks-empty-hit",children:[e.jsxs("strong",{children:["No matches for “",L,"”"]}),e.jsxs("span",{children:["Try a project name, file path, or topic from recent work",P?", or clear one of the filters above.":"."]}),e.jsxs("div",{className:"ks-empty-hit-actions",children:[e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>j({query:""}),children:"Clear query"}),P?e.jsx("button",{type:"button",className:"ks-text-action",onClick:A,children:"Clear all filters"}):null]})]}):null,L?null:e.jsxs("div",{className:"ks-empty-hit ks-empty-hit--quiet",children:[e.jsx("strong",{children:"Start with a query"}),e.jsxs("span",{children:["Type a topic, file path, agent, or session hint. Use"," ",e.jsx("kbd",{children:"/"})," to focus this field, ",e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," to walk results, ",e.jsx("kbd",{children:"↵"})," to select, ",e.jsx("kbd",{children:"⌘↵"})," to open the session."]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:be,disabled:w.length===0,children:"Pick the first result automatically"})]}),e.jsx("div",{className:"ks-hit-list-body",children:v.map((s,t)=>{const r=s.best,d=Ae(r),x=Ie(r),N=ce(ue(r)),D=()=>{N&&i({view:"sessions",sessionId:N})},z=s.moments.some(k=>u?.id===k.id);return e.jsxs("section",{className:`ks-session${z?" ks-session--selected":""}`,"aria-label":`Session ${t+1}`,children:[e.jsxs("header",{className:"ks-session-head",children:[e.jsxs("div",{className:"ks-session-topline",children:[e.jsxs("div",{className:"ks-session-meta",children:[d.agent?e.jsx("span",{className:"ks-hit-chip",children:d.agent}):null,d.project?e.jsx("span",{children:d.project}):null,d.session?e.jsxs("span",{className:"ks-hit-session",title:N??d.session,children:["session ",d.session]}):null,e.jsxs("span",{className:"ks-session-count",children:[y(s.moments.length)," match",s.moments.length===1?"":"es"]})]}),d.when?e.jsx("time",{className:"ks-hit-when",children:d.when}):null]}),e.jsx("button",{type:"button",className:"ks-session-goal",onClick:D,title:N?"Open session":void 0,children:x})]}),e.jsx("div",{className:"ks-session-moments",children:s.moments.map(k=>{const ie=Te(k,n.query),ae=u?.id===k.id,_=He(k,n.query,200),ne=Re(k),B=()=>g(k,n.query),re=()=>{const h=ce(ue(k))??N;if(!h){B();return}i({view:"sessions",sessionId:h})};return e.jsx("article",{className:`ks-hit${ae?" ks-hit--selected":""}`,role:"option","aria-selected":ae,tabIndex:0,onClick:B,onDoubleClick:re,onKeyDown:h=>{if(h.key==="Enter"&&(h.metaKey||h.ctrlKey)){h.preventDefault(),re();return}Je(h,B)},children:e.jsxs("div",{className:"ks-hit-body",children:[ne.length>0?e.jsx("div",{className:"ks-hit-details ks-hit-details--moment","aria-label":"Turn",children:ne.map(h=>e.jsx("span",{className:"ks-hit-details-strong",children:h},h))}):null,e.jsx("h3",{className:"ks-hit-title",children:ie}),_&&_!==ie?e.jsx("p",{className:"ks-hit-snippet",children:e.jsx(Ge,{text:_,query:n.query})}):null]})},k.id)})})]},s.collectionId)})})]}):null]}),e.jsxs("footer",{className:"ks-foot-status","aria-live":"polite",children:[e.jsxs("span",{className:"ks-foot-status-facts",children:[Z?e.jsx(de,{size:12,className:"ks-spin","aria-hidden":"true"}):null,Se,pe(n)?e.jsxs(e.Fragment,{children:[" · ",Ye(n)]}):null]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>{ee(!0)},disabled:K,children:K?"Updating…":"Update index"})]})]})}export{Fs as KnowledgeSearchScreen};
@@ -1 +1 @@
1
- import{r as n,j as T}from"./index-o4FKpU7Z.js";import{r as j}from"./index-BMwKgdz_.js";import{b as D,l as N}from"./lane-tool-detail-0WhMf4Vj.js";import"./lane-edit-display-C_Aujldz.js";const _=140,k=100,p=320,v=4,u=8,S=7;function y(e){return(e.querySelector(".s-observe-tool")??e).getBoundingClientRect()}function F(){return document.querySelector("[data-scout-theme]")??document.body}function q(e,t){return e===t?!0:!e||!t?!1:e.top===t.top&&e.left===t.left&&e.side===t.side&&e.caretTop===t.caretTop}function W(e,t){const l=window.innerWidth,f=window.innerHeight,E=e.top+e.height/2,d=l-e.right-u,m=e.left-u,R=d>=p+v,a=m>=p+v;let c="right",s=e.right+v,o=e.top;R?(c="right",s=e.right+v):a?(c="left",s=e.left-v-p):(c="right",s=Math.max(u,Math.min(e.right+v,l-p-u)),o=e.bottom+v),o+t>f-u&&(o=Math.max(u,e.top-t+e.height)),o=Math.max(u,Math.min(o,f-t-u)),s=Math.max(u,Math.min(s,l-p-u));const x=Math.max(S+4,Math.min(E-o,t-S-4));return{top:o,left:s,side:c,caretTop:x}}function G({model:e,position:t,cardRef:l,onMouseEnter:f,onMouseLeave:E}){const d=N(e),m=e.hoverFields.find(a=>a.label==="when"),R={position:"fixed",top:t.top,left:t.left,width:p,maxWidth:p,"--hover-caret-top":`${t.caretTop}px`};return T.jsxs("div",{ref:l,className:`s-observe-tool-hover-card s-observe-tool-hover-card--side-${t.side}`,style:R,onMouseEnter:f,onMouseLeave:E,role:"tooltip",children:[T.jsx("div",{className:"s-observe-tool-hover-card-cmd",children:e.command}),m&&T.jsx("div",{className:"s-observe-tool-hover-card-meta",children:m.value}),d.slice(1).map((a,c)=>T.jsx("div",{className:"s-observe-tool-hover-card-line",children:a},c)),T.jsx("div",{className:"s-observe-tool-hover-card-hint",children:"Click row for full detail"})]})}function $(e=!0){const[t,l]=n.useState(null),[f,E]=n.useState(null),d=n.useRef(new Map),m=n.useRef(new Map),R=n.useRef(new Map),a=n.useRef(new Map),c=n.useRef(null),s=n.useRef(null),o=n.useRef(null),x=n.useRef(null);c.current=t;const L=n.useCallback(()=>{s.current&&clearTimeout(s.current),o.current&&clearTimeout(o.current),s.current=null,o.current=null},[]),I=n.useMemo(()=>{if(!e||!t)return null;const r=R.current.get(t);if(!r)return null;const i=m.current.get(t);return D(r,i)},[e,t]),M=n.useCallback(r=>{E(i=>q(i,r)?i:r)},[]),g=n.useCallback(()=>{const r=c.current;if(!r){M(null);return}const i=d.current.get(r);if(!i)return;const w=y(i),h=x.current?.offsetHeight??132;M(W(w,h))},[M]);n.useEffect(()=>()=>L(),[L]),n.useLayoutEffect(()=>{if(!t){M(null);return}g();const r=requestAnimationFrame(g);return()=>cancelAnimationFrame(r)},[t,M,g]),n.useEffect(()=>{if(!t)return;const r=()=>g();return window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)}},[t,g]);const C=n.useCallback(r=>{e&&(o.current&&clearTimeout(o.current),o.current=null,c.current!==r&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{l(r),s.current=null},_)))},[e]),b=n.useCallback(()=>{s.current&&clearTimeout(s.current),s.current=null,c.current&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(null),o.current=null},k))},[]),A=n.useCallback((r,i)=>{R.current.set(r.id,r),m.current.set(r.id,i);let w=a.current.get(r.id);if(!w){const h=r.id;w={ref:P=>{P?d.current.set(h,P):d.current.delete(h)},onMouseEnter:()=>C(h),onMouseLeave:b,onFocus:()=>C(h),onBlur:b},a.current.set(h,w)}return w},[C,b]),H=e&&I&&f&&typeof document<"u"?j.createPortal(T.jsx(G,{model:I,position:f,cardRef:x,onMouseEnter:()=>{const r=c.current;r&&C(r)},onMouseLeave:b}),F()):null;return{bind:A,card:H,hoveredEventId:t}}export{$ as useLaneToolHoverCard};
1
+ import{r as n,j as T}from"./index-Bli6bTLU.js";import{r as j}from"./index-DFdlQs_c.js";import{b as D,l as N}from"./lane-tool-detail-0WhMf4Vj.js";import"./lane-edit-display-C_Aujldz.js";const _=140,k=100,p=320,v=4,u=8,S=7;function y(e){return(e.querySelector(".s-observe-tool")??e).getBoundingClientRect()}function F(){return document.querySelector("[data-scout-theme]")??document.body}function q(e,t){return e===t?!0:!e||!t?!1:e.top===t.top&&e.left===t.left&&e.side===t.side&&e.caretTop===t.caretTop}function W(e,t){const l=window.innerWidth,f=window.innerHeight,E=e.top+e.height/2,d=l-e.right-u,m=e.left-u,R=d>=p+v,a=m>=p+v;let c="right",s=e.right+v,o=e.top;R?(c="right",s=e.right+v):a?(c="left",s=e.left-v-p):(c="right",s=Math.max(u,Math.min(e.right+v,l-p-u)),o=e.bottom+v),o+t>f-u&&(o=Math.max(u,e.top-t+e.height)),o=Math.max(u,Math.min(o,f-t-u)),s=Math.max(u,Math.min(s,l-p-u));const x=Math.max(S+4,Math.min(E-o,t-S-4));return{top:o,left:s,side:c,caretTop:x}}function G({model:e,position:t,cardRef:l,onMouseEnter:f,onMouseLeave:E}){const d=N(e),m=e.hoverFields.find(a=>a.label==="when"),R={position:"fixed",top:t.top,left:t.left,width:p,maxWidth:p,"--hover-caret-top":`${t.caretTop}px`};return T.jsxs("div",{ref:l,className:`s-observe-tool-hover-card s-observe-tool-hover-card--side-${t.side}`,style:R,onMouseEnter:f,onMouseLeave:E,role:"tooltip",children:[T.jsx("div",{className:"s-observe-tool-hover-card-cmd",children:e.command}),m&&T.jsx("div",{className:"s-observe-tool-hover-card-meta",children:m.value}),d.slice(1).map((a,c)=>T.jsx("div",{className:"s-observe-tool-hover-card-line",children:a},c)),T.jsx("div",{className:"s-observe-tool-hover-card-hint",children:"Click row for full detail"})]})}function $(e=!0){const[t,l]=n.useState(null),[f,E]=n.useState(null),d=n.useRef(new Map),m=n.useRef(new Map),R=n.useRef(new Map),a=n.useRef(new Map),c=n.useRef(null),s=n.useRef(null),o=n.useRef(null),x=n.useRef(null);c.current=t;const L=n.useCallback(()=>{s.current&&clearTimeout(s.current),o.current&&clearTimeout(o.current),s.current=null,o.current=null},[]),I=n.useMemo(()=>{if(!e||!t)return null;const r=R.current.get(t);if(!r)return null;const i=m.current.get(t);return D(r,i)},[e,t]),M=n.useCallback(r=>{E(i=>q(i,r)?i:r)},[]),g=n.useCallback(()=>{const r=c.current;if(!r){M(null);return}const i=d.current.get(r);if(!i)return;const w=y(i),h=x.current?.offsetHeight??132;M(W(w,h))},[M]);n.useEffect(()=>()=>L(),[L]),n.useLayoutEffect(()=>{if(!t){M(null);return}g();const r=requestAnimationFrame(g);return()=>cancelAnimationFrame(r)},[t,M,g]),n.useEffect(()=>{if(!t)return;const r=()=>g();return window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)}},[t,g]);const C=n.useCallback(r=>{e&&(o.current&&clearTimeout(o.current),o.current=null,c.current!==r&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{l(r),s.current=null},_)))},[e]),b=n.useCallback(()=>{s.current&&clearTimeout(s.current),s.current=null,c.current&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(null),o.current=null},k))},[]),A=n.useCallback((r,i)=>{R.current.set(r.id,r),m.current.set(r.id,i);let w=a.current.get(r.id);if(!w){const h=r.id;w={ref:P=>{P?d.current.set(h,P):d.current.delete(h)},onMouseEnter:()=>C(h),onMouseLeave:b,onFocus:()=>C(h),onBlur:b},a.current.set(h,w)}return w},[C,b]),H=e&&I&&f&&typeof document<"u"?j.createPortal(T.jsx(G,{model:I,position:f,cardRef:x,onMouseEnter:()=>{const r=c.current;r&&C(r)},onMouseLeave:b}),F()):null;return{bind:A,card:H,hoveredEventId:t}}export{$ as useLaneToolHoverCard};
@@ -0,0 +1 @@
1
+ import{r as f,j as e}from"./index-Bli6bTLU.js";import{S as L}from"./SlidePanel-Dg8_styW.js";import{A as j}from"./AgentAvatar-B1xvQ7ej.js";import{H as S}from"./HarnessMark-DGZ6o6Ct.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as g,f as k,b as y}from"./lane-observe-vfyACHi0.js";import{S as A}from"./SessionObserve-zAlFbwFn.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-C9cmqxnK.js";import{b as T}from"./agent-lane-detail-D5EIlX7_.js";import{l as I,a as z}from"./agent-lanes-model-BKOs_32K.js";import"./Provider-Ve8yXaWR.js";import"./provider-CX9EWecp.js";import"./router-B0YclXYg.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./api-DEHEgJ9m.js";import"./sse-CSozY6mp.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-DmtFisY9.js";import"./createLucideIcon-DLlxGjKt.js";import"./TextDocumentSurface-C7fGlzY8.js";import"./file-text-BVhkMWyC.js";import"./x-BJyPzFnn.js";import"./chevron-right-BMqtBds_.js";import"./code-xml-ByQsfOI_.js";import"./arrow-left-i-h6JAgs.js";import"./arrow-right-B0Yi01Zr.js";import"./scout-voice-DvG_3stJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-7iEtvu9P.js";import"./NewChatComposer-Bgqes0UQ.js";import"./text-BR9Bap0E.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DoT8gpw6.js";import"./conversation-model-CigSPlKA.js";import"./index-DFdlQs_c.js";import"./NewChatOrigin-DpHS2Wmt.js";import"./chevron-down-Da5tV19_.js";import"./search-BbgsEMXa.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./SpriteAvatar-DMrSssNZ.js";import"./agent-identity-DzHGhLdJ.js";import"./tail-display-DcliDVkW.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-197xYmRp.js";import"./lane-ask-display-B6iCAVcd.js";import"./mentions-Cd6XticV.js";import"./AgentDetailCard-FelCxQrT.js";import"./AgentLiveActions-Bn3zeZBN.js";import"./terminal-takeover-CtA3wcXh.js";import"./openContent-C6XO6kr5.js";import"./eye-BeCSqJn1.js";import"./terminal-BiNIXhna.js";import"./message-markup-DAnnGpWr.js";import"./ObservedTopologyPanel-D85P6RAk.js";import"./ObserveTextFlow-C1f5oize.js";import"./use-reduced-motion-BLn59zLn.js";import"./proxy-C35W-YHZ.js";import"./SessionObserveEvidence-BVawzqoE.js";import"./message-circle-44KSmbvQ.js";import"./wrench-CQvdf7KT.js";import"./external-link-BGHC_naA.js";import"./context-budget-DX_fwUs3.js";const M={think:"Thought",tool:"Tool",ask:"Request",message:"Message",note:"Note",system:"System",boot:"Boot"};function Ve({target:d,onClose:n}){const{lane:i,event:t}=d,{agent:s,observe:l,source:r,lastActiveAt:a}=i,p=f.useMemo(()=>T(i),[i]),c=I(s,r),v=z(s,r),h=M[t.kind]??t.kind,u=l?.metadata?.session?.sessionStart,o=g(t,u),b=o!=null?k(o,a):void 0,x=o!=null?y(o):void 0,m=t.kind==="tool"||t.kind==="ask"?t:void 0;return e.jsxs(L,{open:!0,onClose:n,side:"right",owner:"openscout.lane-trace",layer:"elevated",resizable:!0,defaultSize:980,minSize:560,maxSize:1280,scrollLock:!0,ariaLabel:`${c} session trace`,className:"s-lane-trace-sheet",children:[e.jsxs("div",{className:"s-slide-header s-lane-trace-sheet-header",children:[e.jsx(j,{agent:s,placement:"row",size:28,presence:!1,className:"s-agent-lane-avatar"}),e.jsxs("div",{className:"s-lane-trace-sheet-header-copy",children:[e.jsx("div",{className:"s-lane-trace-sheet-title",children:c}),e.jsxs("div",{className:"s-lane-trace-sheet-sub",children:[v," · ",h,a?` · ${N(a)}`:""]})]}),e.jsx("span",{className:"s-slide-spacer"}),e.jsx(S,{harness:s.harness??p.harness,size:18,className:"s-lane-trace-sheet-hmark"}),e.jsx("button",{type:"button",className:"s-slide-close",onClick:n,"aria-label":"Close",children:"×"})]}),e.jsx("div",{className:"s-slide-body s-lane-trace-sheet-body",children:e.jsx(A,{data:l??void 0,agentId:r==="scout"?s.id:void 0,sessionId:s.harnessSessionId??p.sessionId,showRail:!0,variant:"default",initialCursorT:t.t,focusEventId:t.id,inlineFocusEventId:m?.id,inlineFocusContent:m?e.jsx(E,{event:m,wallLabel:b,wallTitle:x,variant:"inline"}):void 0})})]})}export{Ve as LaneTraceDetailSheet};
@@ -1 +1 @@
1
- import{j as e,r as o}from"./index-o4FKpU7Z.js";import{i as x,l as h}from"./lane-edit-display-C_Aujldz.js";import{b as p}from"./lane-ask-display-B6iCAVcd.js";import{f as m,b as j}from"./lane-tool-detail-0WhMf4Vj.js";const N=new Set(["detail","output","result","diff","change"]);function f({text:c,label:t}){return e.jsx("button",{type:"button",className:"s-lane-trace-focus-copy",onClick:()=>{navigator.clipboard?.writeText(c)},title:t,"aria-label":t,children:"Copy"})}function q({event:c,wallLabel:t,wallTitle:r,variant:n="sheet"}){return c.kind==="ask"?e.jsx(v,{event:c,wallLabel:t,wallTitle:r,variant:n}):e.jsx(y,{event:c,wallLabel:t,wallTitle:r,variant:n})}function y({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>j(c,{wallLabel:t,wallTitle:r,sessionOffset:`${m(c.t)} from start`}),[c,t,r]),{primarySection:i,secondarySections:d}=o.useMemo(()=>{if(!s)return{primarySection:null,secondarySections:[]};const a=s.sections.find(u=>N.has(u.title))??s.sections[0]??null,l=a?s.sections.filter(u=>u!==a):s.sections;return{primarySection:a,secondarySections:l}},[s]);return s?e.jsxs("section",{className:`s-lane-trace-focus${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected trace event",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this step":"Selected command"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.command}),x(c.tool)&&c.arg?.trim()&&(()=>{const a=h(c.arg.trim()),l=a.split("/").pop()??a;return a===l?null:e.jsx("div",{className:"s-lane-trace-focus-path",title:c.arg.trim(),children:a})})()]}),e.jsx(f,{text:s.copyText,label:"Copy event detail"})]}),s.hoverFields.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:s.hoverFields.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:a.label}),e.jsx("dd",{title:a.value,children:a.value})]},a.label))}),i&&e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:i.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:i.content})]}),d.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:a.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:a.content})]},a.title))]}):null}function v({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>p(c),[c]),i=o.useMemo(()=>{const l=[...s.fields];return t&&l.unshift({label:"when",value:r?`${t} · ${r}`:t}),l.push({label:"offset",value:`${m(c.t)} from start`}),l},[s.fields,c.t,t,r]),d=s.preview&&s.preview!==s.fullText,a=s.requestText&&s.requestText!==s.fullText&&s.requestText!==s.preview;return e.jsxs("section",{className:`s-lane-trace-focus s-lane-trace-focus--ask${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected request",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this request":"Selected request"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.title}),d?e.jsx("div",{className:"s-lane-trace-focus-ask-preview",children:s.preview}):null]}),e.jsx(f,{text:s.copyText,label:"Copy full request"})]}),i.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:i.map(l=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:l.label}),e.jsx("dd",{title:l.value,children:l.value})]},`${l.label}:${l.value}`))}),e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"full request"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.fullText})]}),a?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"request preview"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.requestText})]}):null,s.answer?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:s.answer.label}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.answer.text})]}):null]})}export{q as LaneTraceEventFocus};
1
+ import{j as e,r as o}from"./index-Bli6bTLU.js";import{i as x,l as h}from"./lane-edit-display-C_Aujldz.js";import{b as p}from"./lane-ask-display-B6iCAVcd.js";import{f as m,b as j}from"./lane-tool-detail-0WhMf4Vj.js";const N=new Set(["detail","output","result","diff","change"]);function f({text:c,label:t}){return e.jsx("button",{type:"button",className:"s-lane-trace-focus-copy",onClick:()=>{navigator.clipboard?.writeText(c)},title:t,"aria-label":t,children:"Copy"})}function q({event:c,wallLabel:t,wallTitle:r,variant:n="sheet"}){return c.kind==="ask"?e.jsx(v,{event:c,wallLabel:t,wallTitle:r,variant:n}):e.jsx(y,{event:c,wallLabel:t,wallTitle:r,variant:n})}function y({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>j(c,{wallLabel:t,wallTitle:r,sessionOffset:`${m(c.t)} from start`}),[c,t,r]),{primarySection:i,secondarySections:d}=o.useMemo(()=>{if(!s)return{primarySection:null,secondarySections:[]};const a=s.sections.find(u=>N.has(u.title))??s.sections[0]??null,l=a?s.sections.filter(u=>u!==a):s.sections;return{primarySection:a,secondarySections:l}},[s]);return s?e.jsxs("section",{className:`s-lane-trace-focus${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected trace event",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this step":"Selected command"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.command}),x(c.tool)&&c.arg?.trim()&&(()=>{const a=h(c.arg.trim()),l=a.split("/").pop()??a;return a===l?null:e.jsx("div",{className:"s-lane-trace-focus-path",title:c.arg.trim(),children:a})})()]}),e.jsx(f,{text:s.copyText,label:"Copy event detail"})]}),s.hoverFields.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:s.hoverFields.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:a.label}),e.jsx("dd",{title:a.value,children:a.value})]},a.label))}),i&&e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:i.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:i.content})]}),d.map(a=>e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:a.title}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:a.content})]},a.title))]}):null}function v({event:c,wallLabel:t,wallTitle:r,variant:n}){const s=o.useMemo(()=>p(c),[c]),i=o.useMemo(()=>{const l=[...s.fields];return t&&l.unshift({label:"when",value:r?`${t} · ${r}`:t}),l.push({label:"offset",value:`${m(c.t)} from start`}),l},[s.fields,c.t,t,r]),d=s.preview&&s.preview!==s.fullText,a=s.requestText&&s.requestText!==s.fullText&&s.requestText!==s.preview;return e.jsxs("section",{className:`s-lane-trace-focus s-lane-trace-focus--ask${n==="inline"?" s-lane-trace-focus--inline":""}`,"aria-label":"Selected request",children:[e.jsxs("div",{className:"s-lane-trace-focus-eyebrow",children:[e.jsx("span",{className:"s-lane-trace-focus-eyebrow-dot","aria-hidden":!0}),n==="inline"?"Expanded at this request":"Selected request"]}),e.jsxs("div",{className:"s-lane-trace-focus-head",children:[e.jsxs("div",{className:"s-lane-trace-focus-head-copy",children:[e.jsx("div",{className:"s-lane-trace-focus-cmd",children:s.title}),d?e.jsx("div",{className:"s-lane-trace-focus-ask-preview",children:s.preview}):null]}),e.jsx(f,{text:s.copyText,label:"Copy full request"})]}),i.length>0&&e.jsx("dl",{className:"s-lane-trace-focus-meta",children:i.map(l=>e.jsxs("div",{className:"s-lane-trace-focus-meta-row",children:[e.jsx("dt",{children:l.label}),e.jsx("dd",{title:l.value,children:l.value})]},`${l.label}:${l.value}`))}),e.jsxs("div",{className:"s-lane-trace-focus-section s-lane-trace-focus-section--primary",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"full request"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.fullText})]}),a?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:"request preview"}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.requestText})]}):null,s.answer?e.jsxs("div",{className:"s-lane-trace-focus-section",children:[e.jsx("div",{className:"s-lane-trace-focus-section-title",children:s.answer.label}),e.jsx("pre",{className:"s-lane-trace-focus-section-body",children:s.answer.text})]}):null]})}export{q as LaneTraceEventFocus};