@openscout/scout 0.2.78 → 0.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/README.md +19 -0
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/ActivityScreen-DnqqRSlS.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-DMnobKch.js → AddProjectForm-BoVtelSP.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-D90c1Rzk.js → AgentAvatar-CufDA4A-.js} +1 -1
  7. package/dist/client/assets/AgentConfigurationScreen-CJqoMA0J.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-FpEkb-tu.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-BcRBRp88.js → AgentDetailCard-DxxVkgT1.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-CycUn0Lv.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-CAQAxpAK.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-RrNnDZu8.js → AgentLaneCard-DTUvE96I.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-D9ZwUKrl.js → AgentLaneChrome-BfVygkgL.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-BXbPls9N.js → AgentLaneDetailSheet-CWs9wKWk.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-BhFmGNzT.js → AgentLaneSummaryResize-CMgzYvAA.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-BUCW4nUj.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-eSAoDsPi.js → AgentLanesPreflight-KWfLcaNB.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-CxfbV8Kd.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-DBtnD0qE.js → AgentLiveActions-CZdAInEu.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-DyqOf4nG.js → AgentSessions-Bkr0lyry.js} +2 -2
  21. package/dist/client/assets/AgentsConsole-WtFVqaPJ.js +1 -0
  22. package/dist/client/assets/AgentsScreen-BMXvuiA2.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-BTNjPYoA.js +1 -0
  24. package/dist/client/assets/{AtopView-BCkae3e1.js → AtopView-_OKDlZ1h.js} +1 -1
  25. package/dist/client/assets/BackToPicker-CkUmHuuo.js +1 -0
  26. package/dist/client/assets/{BriefingDetailScreen-BwFyysT8.js → BriefingDetailScreen-i54EtZKW.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-BQEevztH.js → BriefingsScreen-CBrHojlQ.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-7UjcuNjd.js → BrokerMetadataPanel-opTLuZU6.js} +1 -1
  29. package/dist/client/assets/{BrokerScreen-7ekklu88.js → BrokerScreen-CObCQvoy.js} +2 -2
  30. package/dist/client/assets/{ChatCollapsedStrip-CQSYSd8s.js → ChatCollapsedStrip-Dr2vmKXQ.js} +1 -1
  31. package/dist/client/assets/CodeDiffPane-CLOGjwul.js +1 -0
  32. package/dist/client/assets/{CodeProjectPicker-DqKFCpLU.js → CodeProjectPicker-DTV8hR6A.js} +1 -1
  33. package/dist/client/assets/CodeScreen-BXqi72NK.js +1 -0
  34. package/dist/client/assets/{ContextMenu-bARZqTzD.js → ContextMenu-BlBQhpax.js} +1 -1
  35. package/dist/client/assets/{ConversationComposer-Bla3DDvM.js → ConversationComposer-BBNPa5S9.js} +1 -1
  36. package/dist/client/assets/ConversationFeedRows-BuejHMCY.js +1 -0
  37. package/dist/client/assets/ConversationHeader-DXMT-YXv.js +1 -0
  38. package/dist/client/assets/ConversationPanels-DHCtilQF.js +2 -0
  39. package/dist/client/assets/ConversationScreen-DSxIt9pq.css +1 -0
  40. package/dist/client/assets/ConversationScreen-Dz2d_Z_F.js +1 -0
  41. package/dist/client/assets/ConversationStatus-DSgdVofa.js +1 -0
  42. package/dist/client/assets/{DataTable-E8s_MmoA.js → DataTable-0DwuXyvW.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-Dpe88DFX.js → DispatchAftermath-BrreQifA.js} +1 -1
  44. package/dist/client/assets/{DocumentFocusViewer-BeVwwl26.js → DocumentFocusViewer-DU_9BHsD.js} +1 -1
  45. package/dist/client/assets/{EmbeddableSurfacesLab-BQqFQVnI.js → EmbeddableSurfacesLab-DdaswbfI.js} +1 -1
  46. package/dist/client/assets/{EmptyState-4F9XDFQm.js → EmptyState-CoL-QuUO.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-CLgUhSm4.js → FileViewerPane-C9Ly01Ef.js} +1 -1
  48. package/dist/client/assets/{FleetSearch-Dz5euQJe.js → FleetSearch-DlWTLl-v.js} +1 -1
  49. package/dist/client/assets/FlightObserveScreen-C-9S0nA5.js +1 -0
  50. package/dist/client/assets/{FollowScreen-DZ4qfYOY.js → FollowScreen--Q04xSSE.js} +1 -1
  51. package/dist/client/assets/{HarnessMark-Cbv3Ib0c.js → HarnessMark-Dm_qm1Ku.js} +1 -1
  52. package/dist/client/assets/HarnessesScreen-Y54viPX8.js +1 -0
  53. package/dist/client/assets/{HomeHero-B3uYd-pP.js → HomeHero-Cfsow7qL.js} +1 -1
  54. package/dist/client/assets/KnowledgeSearchInspector-DKashKoH.js +1 -0
  55. package/dist/client/assets/KnowledgeSearchScreen-DsdDz8wY.js +1 -0
  56. package/dist/client/assets/{LaneToolHoverCard-Bla0gBdm.js → LaneToolHoverCard-BzehBmdi.js} +1 -1
  57. package/dist/client/assets/LaneTraceDetailSheet-CBf_aNZx.js +1 -0
  58. package/dist/client/assets/{LaneTraceEventFocus-BF9ERP5O.js → LaneTraceEventFocus-DYvHfs_3.js} +1 -1
  59. package/dist/client/assets/{MeshCanvas-DFEPkpqY.js → MeshCanvas-DIjlrMPU.js} +2 -2
  60. package/dist/client/assets/{MeshCanvasMinimap-CyVFYixr.js → MeshCanvasMinimap-DEq-PkF0.js} +1 -1
  61. package/dist/client/assets/MeshScreen-TgDtz-1l.js +1 -0
  62. package/dist/client/assets/{MeshTopologyView-CalkZghg.js → MeshTopologyView-BMHpH5BU.js} +2 -2
  63. package/dist/client/assets/{MessageComposerSuggestions-DpxN9WiB.js → MessageComposerSuggestions-zAUUcLOv.js} +1 -1
  64. package/dist/client/assets/MessagesScreen-BTQL0UcE.js +1 -0
  65. package/dist/client/assets/{MissionControlView-lUeAiSVg.js → MissionControlView-D59SPnAm.js} +1 -1
  66. package/dist/client/assets/{MissionFocusOverlay-wlCmWDCT.js → MissionFocusOverlay-C7cPt6eU.js} +1 -1
  67. package/dist/client/assets/MissionLeftAgentRow-CxlH3dON.js +1 -0
  68. package/dist/client/assets/{MissionLogPane-__MVtEl9.js → MissionLogPane-Ye3YlF9s.js} +1 -1
  69. package/dist/client/assets/{NewAgentModal-Bg-eWHpY.js → NewAgentModal-DprvD4EK.js} +1 -1
  70. package/dist/client/assets/NewChatComposer-B5FnPyzS.js +19 -0
  71. package/dist/client/assets/{NewChatOrigin-Bk2OyVjI.js → NewChatOrigin--pHWUb4V.js} +1 -1
  72. package/dist/client/assets/ObserveEmbedScreen-CfvrnOiZ.js +2 -0
  73. package/dist/client/assets/{ObserveTextFlow-rsFj_rVo.js → ObserveTextFlow-CBitljxi.js} +2 -2
  74. package/dist/client/assets/{ObservedTopologyPanel-DyUeV98H.js → ObservedTopologyPanel-Dv6fbHzW.js} +1 -1
  75. package/dist/client/assets/OpenScoutAppShell-BIp0WitK.js +87 -0
  76. package/dist/client/assets/OpsAgentsView-CoBfAigH.js +1 -0
  77. package/dist/client/assets/OpsScreen-Bbo0W64T.js +1 -0
  78. package/dist/client/assets/OpsSubnav-CoN8utF8.js +1 -0
  79. package/dist/client/assets/{PlanView-C1CjH3PG.js → PlanView-DYtt8H37.js} +1 -1
  80. package/dist/client/assets/ProjectAgentProfile-FiiIcB5R.js +1 -0
  81. package/dist/client/assets/{ProjectAgentProfileBar-CtTpj6fU.js → ProjectAgentProfileBar-B3IvVbqS.js} +1 -1
  82. package/dist/client/assets/ProjectAgentProfileHero-D5E8yvDj.js +1 -0
  83. package/dist/client/assets/ProjectsInbox-BWiXjGi7.js +2 -0
  84. package/dist/client/assets/{ProjectsRail-BgiuV4LR.js → ProjectsRail-DEDS-M1c.js} +1 -1
  85. package/dist/client/assets/ProjectsScreen-Cxk4CuYn.js +1 -0
  86. package/dist/client/assets/ProjectsThreadAside-BF66ugT5.js +1 -0
  87. package/dist/client/assets/Provider-tFc3jqZ4.js +1 -0
  88. package/dist/client/assets/{RailRow-BoGxAHNF.js → RailRow-BTlVAnHS.js} +1 -1
  89. package/dist/client/assets/RawSessionsTable-BsGVgZB3.js +1 -0
  90. package/dist/client/assets/RealtimeVoiceScreen-B0Bem5Rc.js +1 -0
  91. package/dist/client/assets/{RepoDiffEmbedScreen-C0rumUME.js → RepoDiffEmbedScreen-CtTdlQ2A.js} +1 -1
  92. package/dist/client/assets/{RepoDiffPageScreen-DMv6DioL.js → RepoDiffPageScreen-BRvaVYoC.js} +1 -1
  93. package/dist/client/assets/RepoDiffViewer-Bo0gREMj.js +7 -0
  94. package/dist/client/assets/RepoDiffViewerLazy-C8UPk4oo.js +2 -0
  95. package/dist/client/assets/{ReposScreen-CB_YBWYf.js → ReposScreen-BBkJf8xT.js} +2 -2
  96. package/dist/client/assets/{ScoutDeckSurface-CxIYFyWx.js → ScoutDeckSurface-Bi9ov9Bm.js} +1 -1
  97. package/dist/client/assets/{ScoutSurface-CYz_TcWC.js → ScoutSurface-DEQg_7Io.js} +1 -1
  98. package/dist/client/assets/{ScoutbotBroadcastChip-L_R9atj0.js → ScoutbotBroadcastChip-DJXuyn73.js} +1 -1
  99. package/dist/client/assets/{ScoutbotFxLab-CgiZMDMW.js → ScoutbotFxLab-BgsuLDjo.js} +1 -1
  100. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-FMQOr1Np.js → ScoutbotRealtimeVoiceCall-Bzyl0BCS.js} +1 -1
  101. package/dist/client/assets/{SecondaryNav-B3-nh5dM.js → SecondaryNav-Bks0CO2h.js} +1 -1
  102. package/dist/client/assets/SessionEmbedScreen-b0Zgmfx5.js +1 -0
  103. package/dist/client/assets/SessionObserve-CLrHfAKZ.css +1 -0
  104. package/dist/client/assets/SessionObserve-Dlx5vDaV.js +12 -0
  105. package/dist/client/assets/SessionObserveEvidence-ChBD1d4c.js +1 -0
  106. package/dist/client/assets/SessionRefScreen-D7TfPYPN.js +1 -0
  107. package/dist/client/assets/SessionsScreen-BlknOWAd.js +1 -0
  108. package/dist/client/assets/{SettingsDrawer-XfdAa_nD.js → SettingsDrawer-C587L1i1.js} +3 -3
  109. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
  110. package/dist/client/assets/SettingsScreen-BIlYxv_a.js +1 -0
  111. package/dist/client/assets/{ShikiPane-Ap1iPxYb.js → ShikiPane-I_OTW5NO.js} +1 -1
  112. package/dist/client/assets/{SlidePanel-COwtoJqR.js → SlidePanel-FCqT1zO3.js} +1 -1
  113. package/dist/client/assets/SpriteAvatar-CQs-jC-v.js +1 -0
  114. package/dist/client/assets/{StatusPill-DhBL__p8.js → StatusPill-CbABggnQ.js} +1 -1
  115. package/dist/client/assets/{TailView-DGj_5HA9.js → TailView-C_MXVSum.js} +2 -2
  116. package/dist/client/assets/Terminal-DwZyo8kA.js +1 -0
  117. package/dist/client/assets/TerminalEmbedScreen-Czp3tQyd.js +1 -0
  118. package/dist/client/assets/{TextDocumentSurface-BpAw4eQS.js → TextDocumentSurface-C-9EtYqt.js} +1 -1
  119. package/dist/client/assets/{TmuxPeek-m1osv33Q.js → TmuxPeek-Dz1gJ2pU.js} +1 -1
  120. package/dist/client/assets/{VoicePermissionsPanel-DsK53ar4.js → VoicePermissionsPanel-MfICy9kk.js} +1 -1
  121. package/dist/client/assets/{WorkDetailScreen-Bx0JimPC.js → WorkDetailScreen-Cs7kdllj.js} +3 -3
  122. package/dist/client/assets/{WorkFilesViewer-Btl6C2Q1.js → WorkFilesViewer-CF-nhtZ4.js} +1 -1
  123. package/dist/client/assets/{activity-CA8qS6PI.js → activity-WhBf3FXP.js} +1 -1
  124. package/dist/client/assets/{addon-fit-BZ-kXjeN.js → addon-fit-q-x_HytU.js} +1 -1
  125. package/dist/client/assets/{addon-webgl-D9-EQVEK.js → addon-webgl-fhhvEA9h.js} +1 -1
  126. package/dist/client/assets/{agent-essentials-BSY1o46q.js → agent-essentials-DyJiUGpZ.js} +1 -1
  127. package/dist/client/assets/agent-identity-xQHedtLl.js +1 -0
  128. package/dist/client/assets/agent-lane-card-BkWVDYM8.css +1 -0
  129. package/dist/client/assets/{agent-lane-card-model-r2frk57c.js → agent-lane-card-model-BCIwPjEh.js} +1 -1
  130. package/dist/client/assets/{agent-lane-detail-Djm3YJEa.js → agent-lane-detail-Cw4QVAgH.js} +1 -1
  131. package/dist/client/assets/{agent-lane-preview-CmHVe3dU.js → agent-lane-preview-BtnfNyFR.js} +1 -1
  132. package/dist/client/assets/{agent-lanes-model-B4YTt4OF.js → agent-lanes-model-Bl6xfviL.js} +1 -1
  133. package/dist/client/assets/{arc.es-CQBb-dVu.js → arc.es-DPJ0xRV6.js} +1 -1
  134. package/dist/client/assets/{arrow-down-BPLe0am9.js → arrow-down-DsD-dYj-.js} +1 -1
  135. package/dist/client/assets/{arrow-left-DEZzHiPS.js → arrow-left-WjQIN9J6.js} +1 -1
  136. package/dist/client/assets/{arrow-up-right-ClxBnsi7.js → arrow-up-right-CtTDrZJr.js} +1 -1
  137. package/dist/client/assets/{bot-eu8pBNvI.js → bot-B_Uzf4_O.js} +1 -1
  138. package/dist/client/assets/{check-DjgFiBxb.js → check-BbgHJX8u.js} +1 -1
  139. package/dist/client/assets/{chevron-down-BGk5qoEw.js → chevron-down-BFai6ZfE.js} +1 -1
  140. package/dist/client/assets/{chevron-right-XiIHsk4m.js → chevron-right-CyUa1zXx.js} +1 -1
  141. package/dist/client/assets/chunk-HRAB3GC3-CvwpNg-G.js +1 -0
  142. package/dist/client/assets/{chunk-T65CQEWV-CrzwSeEt.js → chunk-T65CQEWV-DI4NKdNq.js} +1 -1
  143. package/dist/client/assets/{chunk-YOZR3KYS-Bet8khjg.js → chunk-YOZR3KYS-BW85tiCr.js} +3 -3
  144. package/dist/client/assets/clock-DviOalxA.js +1 -0
  145. package/dist/client/assets/{code-xml-B6jOCM4V.js → code-xml-05TD3uOC.js} +1 -1
  146. package/dist/client/assets/content-2u_eV3fX.js +1 -0
  147. package/dist/client/assets/content-5irOghrY.js +1 -0
  148. package/dist/client/assets/content-8Z_0CwtD.js +1 -0
  149. package/dist/client/assets/content-B38YRDBu.js +1 -0
  150. package/dist/client/assets/content-BE3uK0LB.js +1 -0
  151. package/dist/client/assets/{content-C2EwTb2y.js → content-BtIxSqVY.js} +1 -1
  152. package/dist/client/assets/content-CFsPAihU.js +1 -0
  153. package/dist/client/assets/content-CKj5g5tu.js +1 -0
  154. package/dist/client/assets/{content-D5kJmfgl.js → content-CLDWXf9Z.js} +1 -1
  155. package/dist/client/assets/content-CRr73E0r.js +1 -0
  156. package/dist/client/assets/content-CVR75_Uj.js +1 -0
  157. package/dist/client/assets/content-Czdp7_JQ.js +1 -0
  158. package/dist/client/assets/content-D0_EJ6nP.js +1 -0
  159. package/dist/client/assets/content-DNmxpNhD.js +1 -0
  160. package/dist/client/assets/content-XpbI9uxd.js +1 -0
  161. package/dist/client/assets/content-cyxWdgKQ.js +1 -0
  162. package/dist/client/assets/{context-budget-CbB4BDcO.js → context-budget-DX_fwUs3.js} +1 -1
  163. package/dist/client/assets/{conversation-icons-IIG5ha6D.js → conversation-icons-DohQL6GI.js} +1 -1
  164. package/dist/client/assets/conversation-model-C4yb6_FA.js +1 -0
  165. package/dist/client/assets/conversation-motion-features-CifSdJtm.js +1 -0
  166. package/dist/client/assets/{copy-CQGYbxdu.js → copy-CwCAivnc.js} +1 -1
  167. package/dist/client/assets/{createLucideIcon-OpA4Amw5.js → createLucideIcon-DlxlBfLC.js} +1 -1
  168. package/dist/client/assets/discover-DoiAJo4Z.js +2 -0
  169. package/dist/client/assets/embed-entry-D1Or9S4d.js +2 -0
  170. package/dist/client/assets/{external-link-CXBytO9o.js → external-link-CnjcXf32.js} +1 -1
  171. package/dist/client/assets/{eye-0PvebX_a.js → eye-So8tNNK6.js} +1 -1
  172. package/dist/client/assets/{file-text-BODxCjcz.js → file-text-i3xTDUjJ.js} +1 -1
  173. package/dist/client/assets/{gestures-CcwOTu8C.js → gestures-CgvAMd6F.js} +1 -1
  174. package/dist/client/assets/{home-moving-signal-CK147hxn.js → home-moving-signal-BdkERL6B.js} +1 -1
  175. package/dist/client/assets/home-now-card-lLkv6nQs.js +1 -0
  176. package/dist/client/assets/{home-now-card-nano-BcjnOU9H.js → home-now-card-nano-CkLHUQ4J.js} +1 -1
  177. package/dist/client/assets/hooks-BPLDD9yu.js +2 -0
  178. package/dist/client/assets/inbox-thread-redesign-B_1ocqaX.css +1 -0
  179. package/dist/client/assets/index-DGoLx89y.js +1 -0
  180. package/dist/client/assets/index-DITWsjFb.css +1 -0
  181. package/dist/client/assets/index-m6dFtY5f.js +1 -0
  182. package/dist/client/assets/index-pY8-Mz7y.js +1 -0
  183. package/dist/client/assets/{index-DMiGbrBt.js → index-sUomXsrf.js} +6 -6
  184. package/dist/client/assets/{inspector-panel-DPoCWxKs.js → inspector-panel-DhXd-YbT.js} +2 -2
  185. package/dist/client/assets/{keyboard-nav-2kv_tGUS.js → keyboard-nav-BhZZ5HEq.js} +1 -1
  186. package/dist/client/assets/knowledge-search-D_bLoYtC.css +1 -0
  187. package/dist/client/assets/{lane-observe-D0rfKDnU.js → lane-observe-DrhKkQ3A.js} +1 -1
  188. package/dist/client/assets/{lane-roster-store-D8x1jac2.js → lane-roster-store-NE15Oe6M.js} +1 -1
  189. package/dist/client/assets/left-B6eawimv.js +1 -0
  190. package/dist/client/assets/left-BL2uBHe0.js +2 -0
  191. package/dist/client/assets/left-BNJguPDG.js +1 -0
  192. package/dist/client/assets/left-BvCtvN0f.js +1 -0
  193. package/dist/client/assets/left-CfBb6bxM.js +1 -0
  194. package/dist/client/assets/left-DTrlBF0h.js +2 -0
  195. package/dist/client/assets/left-agents-DsOHgDCY.js +1 -0
  196. package/dist/client/assets/left-d4hlBBxY.js +1 -0
  197. package/dist/client/assets/left-default-BRCwoCJr.js +1 -0
  198. package/dist/client/assets/left-lanes-DNtoRzoV.js +1 -0
  199. package/dist/client/assets/left-mission-DsTu2X5Y.js +1 -0
  200. package/dist/client/assets/left-plan-CtySjsXC.js +2 -0
  201. package/dist/client/assets/library-CLpgWNJO.js +1 -0
  202. package/dist/client/assets/{loader-circle-CbHjZsz1.js → loader-circle-lWOOKezu.js} +1 -1
  203. package/dist/client/assets/{local-agents--00gLMqr.js → local-agents-C7fDHLVC.js} +1 -1
  204. package/dist/client/assets/{mentions-jSuTGeet.js → mentions-CY_wPZc5.js} +1 -1
  205. package/dist/client/assets/mesh-ops-B1kDjizF.css +1 -0
  206. package/dist/client/assets/mesh-ops-Kn8pCtyJ.js +1 -0
  207. package/dist/client/assets/{mesh-view-store-CWidRbTE.js → mesh-view-store-D14ihwkF.js} +1 -1
  208. package/dist/client/assets/{message-circle-CG-96zts.js → message-circle-C5UZ6fO7.js} +1 -1
  209. package/dist/client/assets/{message-markup-3J9pi3nx.js → message-markup-C8Nx04sP.js} +1 -1
  210. package/dist/client/assets/{message-square-DSaGpjFU.js → message-square-BD-4UUdc.js} +1 -1
  211. package/dist/client/assets/{mission-control-store-BlnEhiCq.js → mission-control-store-xQHVQdm8.js} +1 -1
  212. package/dist/client/assets/{model-CpAxGuis.js → model-IGCUEsMy.js} +1 -1
  213. package/dist/client/assets/{observe-CuLGD9Zp.js → observe-uJfIlIUV.js} +1 -1
  214. package/dist/client/assets/{page-status-DpkedE1F.js → page-status-BymFEFai.js} +1 -1
  215. package/dist/client/assets/paperclip-DL9BXPp2.js +1 -0
  216. package/dist/client/assets/{plus--b1raV_O.js → plus-C9lTjsgd.js} +1 -1
  217. package/dist/client/assets/profile-BqY5tesX.js +1 -0
  218. package/dist/client/assets/{projects-inbox-CHyUFQ6w.js → projects-inbox-DfVmGFFk.js} +1 -1
  219. package/dist/client/assets/{radio-Bz8ZePxj.js → radio-DedMyP8J.js} +1 -1
  220. package/dist/client/assets/{refresh-cw-BBmAnCB7.js → refresh-cw-D8PFyhUa.js} +1 -1
  221. package/dist/client/assets/repo-diff-DyYmQMSA.css +1 -0
  222. package/dist/client/assets/resolve-panes-1xeZMuaw.js +1 -0
  223. package/dist/client/assets/resolve-sidebar-context-PLr32WHN.js +1 -0
  224. package/dist/client/assets/right-1x7HzabC.js +1 -0
  225. package/dist/client/assets/{right-DjRXbnRP.js → right-C1sIsSHR.js} +1 -1
  226. package/dist/client/assets/right-CFzPUzlF.js +1 -0
  227. package/dist/client/assets/right-CRKyeJDk.js +1 -0
  228. package/dist/client/assets/right-CagzkLWg.js +1 -0
  229. package/dist/client/assets/right-CsV149pN.js +1 -0
  230. package/dist/client/assets/right-DITNyG2s.js +1 -0
  231. package/dist/client/assets/right-E3nNcLE3.js +1 -0
  232. package/dist/client/assets/right-eUQvSjd7.js +1 -0
  233. package/dist/client/assets/right-ozp4nM44.js +1 -0
  234. package/dist/client/assets/{rocket-BSNS_rLs.js → rocket-CriBwkHM.js} +1 -1
  235. package/dist/client/assets/router-Dja9_ygK.js +1 -0
  236. package/dist/client/assets/{runtime-picker-Bcl5iIX5.js → runtime-picker-DOZpZOlt.js} +1 -1
  237. package/dist/client/assets/{scope-views-U-ucT9m0.js → scope-views-BF_RvGKU.js} +1 -1
  238. package/dist/client/assets/{scout-voice-CU5c0LGi.js → scout-voice-BZ4KqADJ.js} +1 -1
  239. package/dist/client/assets/{scroll-text-D6Pdnar7.js → scroll-text-BIYf6g6N.js} +1 -1
  240. package/dist/client/assets/{search-CWfZtOt2.js → search-DCT_EvPr.js} +1 -1
  241. package/dist/client/assets/secondaryNavConfig-Drb7wPG4.js +1 -0
  242. package/dist/client/assets/{selection-bridge-16pk1qyG.js → selection-bridge-CJOTyYQs.js} +1 -1
  243. package/dist/client/assets/{send-horizontal-Bg5-QggH.js → send-horizontal-DDwOgEs3.js} +1 -1
  244. package/dist/client/assets/{server-CPp4ZJhZ.js → server-CHZCp3cF.js} +1 -1
  245. package/dist/client/assets/{session-catalog-BmoyVTJ_.js → session-catalog-XhGxCtP-.js} +1 -1
  246. package/dist/client/assets/{session-table-DZcrKoIH.js → session-table-sAVe44a4.js} +1 -1
  247. package/dist/client/assets/{sliders-horizontal-1oW76Xc9.js → sliders-horizontal-B9Nj-Y4J.js} +1 -1
  248. package/dist/client/assets/sparkles-up7pVlX-.js +1 -0
  249. package/dist/client/assets/{sse-CjIkKo46.js → sse-CVoGDiKW.js} +1 -1
  250. package/dist/client/assets/{tail-events-D19uAGe3.js → tail-events-CTipUIli.js} +1 -1
  251. package/dist/client/assets/{terminal-B9AOZQKR.js → terminal-DXQISjZn.js} +1 -1
  252. package/dist/client/assets/{terminal-relay-CWbJ1RCW.js → terminal-relay-B5Sma7fK.js} +1 -1
  253. package/dist/client/assets/{terminal-takeover-B8UeD9OX.js → terminal-takeover-X97KCSJk.js} +1 -1
  254. package/dist/client/assets/{time-DltNTpLl.js → time-Dhsh_2EG.js} +1 -1
  255. package/dist/client/assets/{use-conversation-list-Byab41G6.js → use-conversation-list-B1T6J_qE.js} +1 -1
  256. package/dist/client/assets/{use-fleet-active-asks-BIbQx5AS.js → use-fleet-active-asks-DLofGhhK.js} +1 -1
  257. package/dist/client/assets/use-mesh-ops-items-ByGZk8rU.js +1 -0
  258. package/dist/client/assets/{use-reduced-motion-RRBkmVkk.js → use-reduced-motion-Cvk-HRKg.js} +1 -1
  259. package/dist/client/assets/use-scout-dev-flags-BHvg3G2c.js +1 -0
  260. package/dist/client/assets/{useAgentHoverCard-DMrbBif0.js → useAgentHoverCard-D5e8Qg1z.js} +1 -1
  261. package/dist/client/assets/useContentSecondaryNav-ZfBNi3d4.js +1 -0
  262. package/dist/client/assets/usePierreRuntime-DIVunfX0.js +50 -0
  263. package/dist/client/assets/{wrench-Bkc_0lKF.js → wrench-pEVd8JnN.js} +1 -1
  264. package/dist/client/assets/{x-D3GElQbe.js → x-0XjXwGqq.js} +1 -1
  265. package/dist/client/assets/{xterm-BKR8oAkR.js → xterm-CRLlV1Xp.js} +1 -1
  266. package/dist/client/index.html +2 -2
  267. package/dist/drizzle/0007_lean_venus.sql +26 -0
  268. package/dist/drizzle/0008_luxuriant_ted_forrester.sql +1 -0
  269. package/dist/drizzle/meta/0007_snapshot.json +5767 -0
  270. package/dist/drizzle/meta/0008_snapshot.json +5774 -0
  271. package/dist/drizzle/meta/_journal.json +14 -0
  272. package/dist/main.mjs +27836 -4437
  273. package/dist/node/main.mjs +31770 -12098
  274. package/dist/pairing-runtime-controller.mjs +37653 -16847
  275. package/dist/runtime/base-daemon.mjs +109 -18
  276. package/dist/runtime/broker-daemon.mjs +22018 -2739
  277. package/dist/runtime/broker-process-manager.mjs +122 -12
  278. package/dist/runtime/mesh-discover.mjs +90 -13
  279. package/dist/scout-control-plane-web.mjs +22453 -3299
  280. package/dist/scout-web-server.mjs +22453 -3299
  281. package/dist/statusline.mjs +2 -0
  282. package/package.json +3 -1
  283. package/dist/client/assets/ActivityScreen-Cu_1V4bq.js +0 -1
  284. package/dist/client/assets/AgentConfigurationScreen-BqfOz90D.js +0 -1
  285. package/dist/client/assets/AgentDefinitionsWorkspace-CUpUrY57.js +0 -1
  286. package/dist/client/assets/AgentFloorView-8LoAEBwS.js +0 -1
  287. package/dist/client/assets/AgentInfoScreen-DZs2_ibL.js +0 -1
  288. package/dist/client/assets/AgentLanesEmbedScreen-W3qs022h.js +0 -1
  289. package/dist/client/assets/AgentLanesView-B9vuEEmZ.js +0 -2
  290. package/dist/client/assets/AgentsConsole-BgiYP2wR.js +0 -1
  291. package/dist/client/assets/AgentsScreen-DBi8x4MB.js +0 -1
  292. package/dist/client/assets/AgentsSubnav-DIEO4NPx.js +0 -1
  293. package/dist/client/assets/BackToPicker-BRvfostO.js +0 -1
  294. package/dist/client/assets/CodeDiffPane-DDPt6KPh.js +0 -1
  295. package/dist/client/assets/CodeScreen-BxCrpRHd.js +0 -1
  296. package/dist/client/assets/ConversationFeedRows-B_gPxcqA.js +0 -1
  297. package/dist/client/assets/ConversationHeader-DE3FC0m-.js +0 -1
  298. package/dist/client/assets/ConversationPanels-DLek4H6A.js +0 -2
  299. package/dist/client/assets/ConversationScreen-BDRhx-RU.js +0 -1
  300. package/dist/client/assets/ConversationScreen-C9yMAMYF.css +0 -1
  301. package/dist/client/assets/ConversationStatus-BwVLiiO4.js +0 -1
  302. package/dist/client/assets/FlightObserveScreen-6RpZYwVz.js +0 -1
  303. package/dist/client/assets/HarnessesScreen-CznAImej.js +0 -1
  304. package/dist/client/assets/KnowledgeSearchInspector-Dgdkfvvz.js +0 -1
  305. package/dist/client/assets/KnowledgeSearchScreen-DJDGGaqC.js +0 -1
  306. package/dist/client/assets/LaneTraceDetailSheet-D1CspRbl.js +0 -1
  307. package/dist/client/assets/MeshScreen-DFgevn8N.js +0 -1
  308. package/dist/client/assets/MessagesScreen-C8YKW10Y.js +0 -1
  309. package/dist/client/assets/MissionLeftAgentRow-BpZWntfl.js +0 -1
  310. package/dist/client/assets/NewChatComposer-Cs6OsxK6.js +0 -19
  311. package/dist/client/assets/ObserveEmbedScreen-y2EpuqRZ.js +0 -2
  312. package/dist/client/assets/OpenScoutAppShell-C_URc8sV.js +0 -87
  313. package/dist/client/assets/OpsAgentsView-UN7iOscs.js +0 -1
  314. package/dist/client/assets/OpsScreen-Buf3LKjb.js +0 -1
  315. package/dist/client/assets/OpsSubnav-DsuXzHah.js +0 -1
  316. package/dist/client/assets/ProjectAgentProfile-DJusrAV-.js +0 -1
  317. package/dist/client/assets/ProjectAgentProfileHero-BFwNJo_N.js +0 -1
  318. package/dist/client/assets/ProjectsInbox-GhVMxOhw.js +0 -2
  319. package/dist/client/assets/ProjectsScreen-eNUBy4YU.js +0 -1
  320. package/dist/client/assets/ProjectsThreadAside-CoBgnHmr.js +0 -1
  321. package/dist/client/assets/Provider-C7UKGHQy.js +0 -1
  322. package/dist/client/assets/RawSessionsTable-DL8y_eEy.js +0 -1
  323. package/dist/client/assets/RealtimeVoiceScreen-ffS-39zy.js +0 -1
  324. package/dist/client/assets/RepoDiffViewer-D_exm6xK.js +0 -7
  325. package/dist/client/assets/RepoDiffViewerLazy-BPgF92Bg.js +0 -2
  326. package/dist/client/assets/SessionEmbedScreen-BVC7yvWF.js +0 -1
  327. package/dist/client/assets/SessionObserve-BpggNO_M.css +0 -1
  328. package/dist/client/assets/SessionObserve-yfXFafp8.js +0 -12
  329. package/dist/client/assets/SessionRefScreen-DRgJu7Jo.js +0 -1
  330. package/dist/client/assets/SessionsScreen-D6XUsZfA.js +0 -1
  331. package/dist/client/assets/SettingsDrawer-CmJt72ww.css +0 -1
  332. package/dist/client/assets/SettingsScreen-Cy8z-EuR.js +0 -1
  333. package/dist/client/assets/SpriteAvatar-DyaGuhik.js +0 -1
  334. package/dist/client/assets/Terminal-CqvGbjXU.js +0 -1
  335. package/dist/client/assets/TerminalEmbedScreen-DuZZFFzW.js +0 -1
  336. package/dist/client/assets/agent-lane-card-Dm7YWoew.css +0 -1
  337. package/dist/client/assets/content-BDt9VBPk.js +0 -1
  338. package/dist/client/assets/content-BIXf4cKR.js +0 -1
  339. package/dist/client/assets/content-BLm0NBJM.js +0 -1
  340. package/dist/client/assets/content-C5UbLsDF.js +0 -1
  341. package/dist/client/assets/content-CR3vdrYY.js +0 -1
  342. package/dist/client/assets/content-CSPVmo2s.js +0 -1
  343. package/dist/client/assets/content-C_FGqx1X.js +0 -1
  344. package/dist/client/assets/content-CvlVUOG8.js +0 -1
  345. package/dist/client/assets/content-DTpQsomG.js +0 -1
  346. package/dist/client/assets/content-DikVsqLf.js +0 -1
  347. package/dist/client/assets/content-DlUe5Ono.js +0 -1
  348. package/dist/client/assets/content-GIBv_55n.js +0 -1
  349. package/dist/client/assets/content-Q2oclDzi.js +0 -1
  350. package/dist/client/assets/conversation-model-B47vYmWN.js +0 -1
  351. package/dist/client/assets/conversation-motion-features-BdAONVls.js +0 -1
  352. package/dist/client/assets/discover-C1YwpBDE.js +0 -2
  353. package/dist/client/assets/embed-entry-BAcGL3g9.js +0 -2
  354. package/dist/client/assets/home-now-card-BgvNWuea.js +0 -1
  355. package/dist/client/assets/hooks-B6y_O2FB.js +0 -2
  356. package/dist/client/assets/inbox-thread-redesign-Bz4FjWzr.css +0 -1
  357. package/dist/client/assets/index-BcuhqXLe.js +0 -1
  358. package/dist/client/assets/index-CJXzfjo9.js +0 -1
  359. package/dist/client/assets/index-DQPvraRS.js +0 -1
  360. package/dist/client/assets/index-DxGoC5l5.css +0 -1
  361. package/dist/client/assets/knowledge-search-CVxQwxPn.js +0 -1
  362. package/dist/client/assets/knowledge-search-DjrQdiiW.css +0 -1
  363. package/dist/client/assets/left-C--GiIh8.js +0 -2
  364. package/dist/client/assets/left-Cj7Rt89X.js +0 -1
  365. package/dist/client/assets/left-CpNEtFEg.js +0 -1
  366. package/dist/client/assets/left-CzXAuK_t.js +0 -2
  367. package/dist/client/assets/left-agents-Bo9sO1by.js +0 -1
  368. package/dist/client/assets/left-bN4PCAXa.js +0 -1
  369. package/dist/client/assets/left-default-DV9GdvYi.js +0 -1
  370. package/dist/client/assets/left-jYYGAOYD.js +0 -1
  371. package/dist/client/assets/left-lanes-D0l_Co7V.js +0 -1
  372. package/dist/client/assets/left-mission-Ci7zREkQ.js +0 -1
  373. package/dist/client/assets/left-plan-D4U1uflW.js +0 -2
  374. package/dist/client/assets/library-D-RxGiCw.js +0 -1
  375. package/dist/client/assets/profile-CVRziEDA.js +0 -1
  376. package/dist/client/assets/repo-diff-C9Qs-bEn.css +0 -1
  377. package/dist/client/assets/resolve-panes-r9B3mpW7.js +0 -1
  378. package/dist/client/assets/resolve-sidebar-context-DcG8xGaB.js +0 -1
  379. package/dist/client/assets/right-BHeiIaty.js +0 -1
  380. package/dist/client/assets/right-BkgKo9VT.js +0 -1
  381. package/dist/client/assets/right-BpEU5jWE.js +0 -1
  382. package/dist/client/assets/right-CRZXoy-X.js +0 -1
  383. package/dist/client/assets/right-ChF_pbPy.js +0 -1
  384. package/dist/client/assets/right-DMoUT3KN.js +0 -1
  385. package/dist/client/assets/right-T4Ue6EqM.js +0 -1
  386. package/dist/client/assets/right-wzrLXKur.js +0 -1
  387. package/dist/client/assets/router-Bq5dwf78.js +0 -1
  388. package/dist/client/assets/secondaryNavConfig-DqUIp0Es.js +0 -1
  389. package/dist/client/assets/sparkles-ClfRJQ6w.js +0 -1
  390. package/dist/client/assets/useContentSecondaryNav-DMl1WNm7.js +0 -1
  391. package/dist/client/assets/usePierreRuntime-wC-yMtBb.js +0 -50
@@ -0,0 +1 @@
1
+ import{r as u,j as e}from"./index-sUomXsrf.js";import{H as R,h as q}from"./HarnessMark-Dm_qm1Ku.js";import{a as M}from"./api-h5zurxmi.js";import{b as D}from"./router-Dja9_ygK.js";import{t as O,n as S,f as L}from"./time-Dhsh_2EG.js";import{u as P}from"./Provider-tFc3jqZ4.js";import{u as T}from"./useContentSecondaryNav-ZfBNi3d4.js";import{OpsSubnav as E}from"./OpsSubnav-CoN8utF8.js";/* empty css */import{R as U}from"./refresh-cw-D8PFyhUa.js";import{E as $}from"./external-link-CnjcXf32.js";import{c as H}from"./createLucideIcon-DlxlBfLC.js";import"./terminal-sessions-D5CIR2OL.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./SecondaryNav-Bks0CO2h.js";import"./secondaryNavConfig-Drb7wPG4.js";import"./message-square-BD-4UUdc.js";import"./terminal-DXQISjZn.js";import"./scroll-text-BIYf6g6N.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 +1 @@
1
- import{r as $,j as t}from"./index-DMiGbrBt.js";const F=3,H=2;function k(e){return e>=.9?"err":e>=.75?"warn":"ok"}const C=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function E(e,a){const s=e-a.getTime(),i=new Date(e).toDateString()===a.toDateString(),r=new Date(e),n=String(r.getHours()).padStart(2,"0"),l=String(r.getMinutes()).padStart(2,"0"),o=s>0&&s<6*3600*1e3;return i?{label:`${n}:${l}`,imminent:o}:{label:`${C[r.getDay()]} ${n}:${l}`,imminent:o}}function W(e,a){const s=Math.floor((e-a.getTime())/1e3),i=s<0,r=Math.abs(s);let n;if(r>=86400){const l=Math.floor(r/86400),o=Math.floor(r%86400/3600);n=o>0?`${l}d ${o}h`:`${l}d`}else if(r>=3600){const l=Math.floor(r/3600),o=Math.floor(r%3600/60);n=o>0?`${l}h ${o}m`:`${l}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return i?`stale ${n}`:n}function M(e){return e.windows&&e.windows.length>0?e.windows:[{label:_(e.unitLabel),fill:e.fill,usedLabel:e.usedLabel,capLabel:e.capLabel,unitLabel:e.unitLabel,resetAt:e.resetAt}]}function _(e){switch(e){case"weekly":return"7d";case"req/h":return"1h";default:return e||"quota"}}function S(e,a){return M(e).map(s=>{const i=E(s.resetAt,a),r=W(s.resetAt,a);return`${s.label}: ${s.usedLabel} / ${s.capLabel} ${s.unitLabel} · resets ${i.label} (in ${r})`}).join(" · ")}function L(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 I(e){const a=[...e].sort((r,n)=>(L(r.label)??Number.MAX_SAFE_INTEGER)-(L(n.label)??Number.MAX_SAFE_INTEGER)),s=a.find(r=>(L(r.label)??0)>=1440)??(a.length>1?a[a.length-1]:null);return{shortWindow:a.find(r=>r!==s)??null,longWindow:s}}function q(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 w({window:e}){if(!e)return t.jsx(N,{});const a=Math.round(e.fill*100),s=k(e.fill);return t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage",children:[t.jsx("span",{className:"hd-gauge-window-name",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:q(e)})]})}function T({window:e,now:a,featured:s=!1}){if(!e)return t.jsx(N,{});if(s){const n=O(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 i=E(e.resetAt,a),r=W(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset${i.imminent?" hd-gauge-reset--imminent":""}`,children:["↻ ",r]})}function O(e,a){if(!Number.isFinite(e))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const s=e-a.getTime(),i=new Date(e);if(!Number.isFinite(i.getTime()))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const r=i.toISOString();if(s<=0){const h=Math.abs(s);if(h<=9e4)return{primary:"reset due",secondary:"refreshing…",ariaLabel:"Weekly reset due; refreshing usage",tone:"due",dateTime:r};const p=Math.floor(h/6e4),y=p>=60?`+${Math.floor(p/60)}h ${p%60}m`:`+${Math.max(1,p)}m`;return{primary:h<=360*6e4?"reset due":"stale",secondary:y,ariaLabel:`Weekly reset data ${y} overdue`,tone:h<=360*6e4?"due":"stale",dateTime:r}}const n=Math.floor(s/1e3),l=Math.floor(n/86400),o=Math.floor(n%86400/3600),c=Math.floor(n%3600/60),u=n%60,d=[o,c,u].map(h=>String(h).padStart(2,"0")).join(":"),j=l>0?`${l}d ${d}`:d,f=i.toDateString()===a.toDateString(),m=i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),x=f?`today ${m}`:`${i.toLocaleDateString([],{weekday:"short"})} ${m}`,g=l>0?`${l} ${l===1?"day":"days"} ${o} hours`:`${o} hours ${c} minutes`;return{primary:j,secondary:x,ariaLabel:`Weekly quota resets in ${g}; ${x}`,tone:s<360*6e4?"imminent":"normal",dateTime:r}}function P(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 i=e[s-1]??e[s],r=e[s],n=e[s+1],l=e[s+2]??n,o=r.x+(n.x-i.x)/6,c=r.y+(n.y-i.y)/6,u=n.x-(l.x-r.x)/6,d=n.y-(l.y-r.y)/6;a.push(`C ${o} ${c}, ${u} ${d}, ${n.x} ${n.y}`)}return a.join(" ")}function B(e){const a=$.useRef(null),[s,i]=$.useState(e);return $.useLayoutEffect(()=>{const r=a.current;if(!r)return;const n=o=>{const c=Math.round(o);c>0&&i(u=>u===c?u:c)};n(r.getBoundingClientRect().width);const l=new ResizeObserver(o=>{n(o[0]?.contentRect.width??0)});return l.observe(r),()=>l.disconnect()},[]),[a,s]}function Q({buckets:e}){const[a,s]=B(372),i=70,r=6,n=56,l=67,o=e.length,c=o<2||e.every(g=>g.count===0),u=Math.max(1,s-3),d={viewBox:`0 0 ${s} ${i}`,style:{width:"100%",height:i,display:"block"}};if(c)return t.jsx("div",{ref:a,children:t.jsx("svg",{...d,children:t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"})})});const j=u/(o-1),f=e.map((g,h)=>({x:h*j,y:n-Math.max(0,Math.min(1,g.value))*(n-r)})),m=P(f),x=`${m} L ${u} ${n} L 0 ${n} Z`;return t.jsx("div",{ref:a,children:t.jsxs("svg",{...d,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.22"}),t.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0"})]})}),t.jsx("line",{x1:"0",y1:r,x2:s,y2:r,stroke:"var(--border)",opacity:"0.18"}),t.jsx("line",{x1:"0",y1:(r+n)/2,x2:s,y2:(r+n)/2,stroke:"var(--border)",opacity:"0.22"}),t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"}),t.jsx("path",{d:x,fill:"url(#hrdFill)"}),t.jsx("path",{d:m,fill:"none",stroke:"var(--accent)",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("circle",{cx:f[o-1].x,cy:f[o-1].y,r:"2.5",fill:"var(--accent)"}),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 V({gauge:e,now:a,onClick:s}){const i=s?"button":"span",r=s?{type:"button",onClick:s}:{};if(e.kind==="status")return t.jsxs(i,{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",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=M(e),{shortWindow:l,longWindow:o}=I(n),c=k(Math.max(...n.map(d=>d.fill))),u=Math.round(Math.max(...n.map(d=>d.fill))*100);return t.jsxs(i,{className:`hd-gauge hd-gauge--${c}${s?" hd-gauge--interactive":""}`,title:S(e,a),"aria-label":`${e.label} subscription usage. ${S(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--${c}`,children:[u,"%"]})]}),t.jsx(w,{window:l}),t.jsx(T,{window:l,now:a}),t.jsx(w,{window:o}),t.jsx(T,{window:o,now:a,featured:!0})]})}function z(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 U(e){return e.kind==="quota"?Math.max(e.fill,...M(e).map(a=>a.fill)):z(e.statusLabel)>0?.01:0}function X(e){return e.kind==="quota"}function K(e){return R(e).slice(0,H)}function R(e){return e.map((a,s)=>({gauge:a,index:s,score:U(a)})).sort((a,s)=>s.score-a.score||a.index-s.index).map(({gauge:a})=>a)}function Z(e){const{now:a,syncLabel:s,error:i,loading:r,refreshing:n,onRefresh:l,navigate:o,heartrate:c,heartrateWindow:u,heartrateBucketLabel:d,heartrateVisibleEventThreshold:j=F,serviceGauges:f}=e,[m,x]=$.useState(!1),g=i?"err":"ok",h=f.filter(X),p=R(h),y=K(h),v=m?p:y,G=h.length>y.length,A=c.reduce((b,D)=>b+D.count,0)>=j;return t.jsxs("section",{className:"hd",children:[t.jsxs("div",{className:`hd-topbar${v.length>0?"":" hd-topbar--bare"}`,children:[t.jsxs("div",{className:"hd-topbar-r",children:[t.jsx("span",{className:`hd-dot hd-dot--${g}`,"aria-hidden":"true"}),t.jsx("span",{className:`hd-meta hd-meta--${g}`,children:s}),t.jsx("span",{className:"hd-topbar-actions",children:t.jsxs("button",{type:"button",className:"hd-btn",disabled:r||n,onClick:l,children:["[",n?"refreshing":"r refresh","]"]})})]}),v.length>0&&t.jsxs("div",{className:"hd-topbar-c","aria-label":"subscription usage",children:[t.jsxs("div",{className:"hd-gauge-title-row",children:[t.jsx("span",{className:"hd-gauge-window",children:"SUBSCRIPTIONS"}),G&&t.jsxs("button",{type:"button",className:"hd-gauge-toggle","aria-expanded":m,onClick:()=>x(b=>!b),children:["[",m?"top 2":`all ${h.length}`,"]"]})]}),t.jsxs("div",{className:"hd-gauge-set",children:[t.jsxs("div",{className:"hd-gauge-table-head","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:"resets in"})]}),v.map(b=>t.jsx("span",{className:"hd-gauge-wrap",children:t.jsx(V,{gauge:b,now:a,onClick:()=>o({view:"harnesses"})})},b.id))]})]})]}),A&&t.jsx("div",{className:"hd-grid hd-grid--single",children:t.jsxs("div",{className:"hd-panel hd-panel--hr",children:[t.jsxs("div",{className:"hd-panel-title",children:[t.jsx("span",{children:"HEART-RATE"}),t.jsx("span",{className:"hd-sep",children:"·"}),t.jsx("span",{children:u}),d?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"hd-sep",children:"·"}),t.jsx("span",{children:d})]}):null]}),t.jsx(Q,{buckets:c})]})})]})}export{Z as default};
1
+ import{r as $,j as t}from"./index-sUomXsrf.js";const F=3,H=2;function k(e){return e>=.9?"err":e>=.75?"warn":"ok"}const C=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function E(e,a){const s=e-a.getTime(),i=new Date(e).toDateString()===a.toDateString(),r=new Date(e),n=String(r.getHours()).padStart(2,"0"),l=String(r.getMinutes()).padStart(2,"0"),o=s>0&&s<6*3600*1e3;return i?{label:`${n}:${l}`,imminent:o}:{label:`${C[r.getDay()]} ${n}:${l}`,imminent:o}}function W(e,a){const s=Math.floor((e-a.getTime())/1e3),i=s<0,r=Math.abs(s);let n;if(r>=86400){const l=Math.floor(r/86400),o=Math.floor(r%86400/3600);n=o>0?`${l}d ${o}h`:`${l}d`}else if(r>=3600){const l=Math.floor(r/3600),o=Math.floor(r%3600/60);n=o>0?`${l}h ${o}m`:`${l}h`}else n=`${Math.max(1,Math.floor(r/60))}m`;return i?`stale ${n}`:n}function M(e){return e.windows&&e.windows.length>0?e.windows:[{label:_(e.unitLabel),fill:e.fill,usedLabel:e.usedLabel,capLabel:e.capLabel,unitLabel:e.unitLabel,resetAt:e.resetAt}]}function _(e){switch(e){case"weekly":return"7d";case"req/h":return"1h";default:return e||"quota"}}function S(e,a){return M(e).map(s=>{const i=E(s.resetAt,a),r=W(s.resetAt,a);return`${s.label}: ${s.usedLabel} / ${s.capLabel} ${s.unitLabel} · resets ${i.label} (in ${r})`}).join(" · ")}function L(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 I(e){const a=[...e].sort((r,n)=>(L(r.label)??Number.MAX_SAFE_INTEGER)-(L(n.label)??Number.MAX_SAFE_INTEGER)),s=a.find(r=>(L(r.label)??0)>=1440)??(a.length>1?a[a.length-1]:null);return{shortWindow:a.find(r=>r!==s)??null,longWindow:s}}function q(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 w({window:e}){if(!e)return t.jsx(N,{});const a=Math.round(e.fill*100),s=k(e.fill);return t.jsxs("span",{className:"hd-gauge-cell hd-gauge-cell--usage",children:[t.jsx("span",{className:"hd-gauge-window-name",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:q(e)})]})}function T({window:e,now:a,featured:s=!1}){if(!e)return t.jsx(N,{});if(s){const n=O(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 i=E(e.resetAt,a),r=W(e.resetAt,a);return t.jsxs("span",{className:`hd-gauge-cell hd-gauge-reset${i.imminent?" hd-gauge-reset--imminent":""}`,children:["↻ ",r]})}function O(e,a){if(!Number.isFinite(e))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const s=e-a.getTime(),i=new Date(e);if(!Number.isFinite(i.getTime()))return{primary:"—",secondary:"unknown",ariaLabel:"Weekly reset time unknown",tone:"stale"};const r=i.toISOString();if(s<=0){const h=Math.abs(s);if(h<=9e4)return{primary:"reset due",secondary:"refreshing…",ariaLabel:"Weekly reset due; refreshing usage",tone:"due",dateTime:r};const p=Math.floor(h/6e4),y=p>=60?`+${Math.floor(p/60)}h ${p%60}m`:`+${Math.max(1,p)}m`;return{primary:h<=360*6e4?"reset due":"stale",secondary:y,ariaLabel:`Weekly reset data ${y} overdue`,tone:h<=360*6e4?"due":"stale",dateTime:r}}const n=Math.floor(s/1e3),l=Math.floor(n/86400),o=Math.floor(n%86400/3600),c=Math.floor(n%3600/60),u=n%60,d=[o,c,u].map(h=>String(h).padStart(2,"0")).join(":"),j=l>0?`${l}d ${d}`:d,f=i.toDateString()===a.toDateString(),m=i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),x=f?`today ${m}`:`${i.toLocaleDateString([],{weekday:"short"})} ${m}`,g=l>0?`${l} ${l===1?"day":"days"} ${o} hours`:`${o} hours ${c} minutes`;return{primary:j,secondary:x,ariaLabel:`Weekly quota resets in ${g}; ${x}`,tone:s<360*6e4?"imminent":"normal",dateTime:r}}function P(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 i=e[s-1]??e[s],r=e[s],n=e[s+1],l=e[s+2]??n,o=r.x+(n.x-i.x)/6,c=r.y+(n.y-i.y)/6,u=n.x-(l.x-r.x)/6,d=n.y-(l.y-r.y)/6;a.push(`C ${o} ${c}, ${u} ${d}, ${n.x} ${n.y}`)}return a.join(" ")}function B(e){const a=$.useRef(null),[s,i]=$.useState(e);return $.useLayoutEffect(()=>{const r=a.current;if(!r)return;const n=o=>{const c=Math.round(o);c>0&&i(u=>u===c?u:c)};n(r.getBoundingClientRect().width);const l=new ResizeObserver(o=>{n(o[0]?.contentRect.width??0)});return l.observe(r),()=>l.disconnect()},[]),[a,s]}function Q({buckets:e}){const[a,s]=B(372),i=70,r=6,n=56,l=67,o=e.length,c=o<2||e.every(g=>g.count===0),u=Math.max(1,s-3),d={viewBox:`0 0 ${s} ${i}`,style:{width:"100%",height:i,display:"block"}};if(c)return t.jsx("div",{ref:a,children:t.jsx("svg",{...d,children:t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"})})});const j=u/(o-1),f=e.map((g,h)=>({x:h*j,y:n-Math.max(0,Math.min(1,g.value))*(n-r)})),m=P(f),x=`${m} L ${u} ${n} L 0 ${n} Z`;return t.jsx("div",{ref:a,children:t.jsxs("svg",{...d,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.22"}),t.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0"})]})}),t.jsx("line",{x1:"0",y1:r,x2:s,y2:r,stroke:"var(--border)",opacity:"0.18"}),t.jsx("line",{x1:"0",y1:(r+n)/2,x2:s,y2:(r+n)/2,stroke:"var(--border)",opacity:"0.22"}),t.jsx("line",{x1:"0",y1:n,x2:s,y2:n,stroke:"var(--border)"}),t.jsx("path",{d:x,fill:"url(#hrdFill)"}),t.jsx("path",{d:m,fill:"none",stroke:"var(--accent)",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("circle",{cx:f[o-1].x,cy:f[o-1].y,r:"2.5",fill:"var(--accent)"}),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 V({gauge:e,now:a,onClick:s}){const i=s?"button":"span",r=s?{type:"button",onClick:s}:{};if(e.kind==="status")return t.jsxs(i,{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",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=M(e),{shortWindow:l,longWindow:o}=I(n),c=k(Math.max(...n.map(d=>d.fill))),u=Math.round(Math.max(...n.map(d=>d.fill))*100);return t.jsxs(i,{className:`hd-gauge hd-gauge--${c}${s?" hd-gauge--interactive":""}`,title:S(e,a),"aria-label":`${e.label} subscription usage. ${S(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--${c}`,children:[u,"%"]})]}),t.jsx(w,{window:l}),t.jsx(T,{window:l,now:a}),t.jsx(w,{window:o}),t.jsx(T,{window:o,now:a,featured:!0})]})}function z(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 U(e){return e.kind==="quota"?Math.max(e.fill,...M(e).map(a=>a.fill)):z(e.statusLabel)>0?.01:0}function X(e){return e.kind==="quota"}function K(e){return R(e).slice(0,H)}function R(e){return e.map((a,s)=>({gauge:a,index:s,score:U(a)})).sort((a,s)=>s.score-a.score||a.index-s.index).map(({gauge:a})=>a)}function Z(e){const{now:a,syncLabel:s,error:i,loading:r,refreshing:n,onRefresh:l,navigate:o,heartrate:c,heartrateWindow:u,heartrateBucketLabel:d,heartrateVisibleEventThreshold:j=F,serviceGauges:f}=e,[m,x]=$.useState(!1),g=i?"err":"ok",h=f.filter(X),p=R(h),y=K(h),v=m?p:y,G=h.length>y.length,A=c.reduce((b,D)=>b+D.count,0)>=j;return t.jsxs("section",{className:"hd",children:[t.jsxs("div",{className:`hd-topbar${v.length>0?"":" hd-topbar--bare"}`,children:[t.jsxs("div",{className:"hd-topbar-r",children:[t.jsx("span",{className:`hd-dot hd-dot--${g}`,"aria-hidden":"true"}),t.jsx("span",{className:`hd-meta hd-meta--${g}`,children:s}),t.jsx("span",{className:"hd-topbar-actions",children:t.jsxs("button",{type:"button",className:"hd-btn",disabled:r||n,onClick:l,children:["[",n?"refreshing":"r refresh","]"]})})]}),v.length>0&&t.jsxs("div",{className:"hd-topbar-c","aria-label":"subscription usage",children:[t.jsxs("div",{className:"hd-gauge-title-row",children:[t.jsx("span",{className:"hd-gauge-window",children:"SUBSCRIPTIONS"}),G&&t.jsxs("button",{type:"button",className:"hd-gauge-toggle","aria-expanded":m,onClick:()=>x(b=>!b),children:["[",m?"top 2":`all ${h.length}`,"]"]})]}),t.jsxs("div",{className:"hd-gauge-set",children:[t.jsxs("div",{className:"hd-gauge-table-head","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:"resets in"})]}),v.map(b=>t.jsx("span",{className:"hd-gauge-wrap",children:t.jsx(V,{gauge:b,now:a,onClick:()=>o({view:"harnesses"})})},b.id))]})]})]}),A&&t.jsx("div",{className:"hd-grid hd-grid--single",children:t.jsxs("div",{className:"hd-panel hd-panel--hr",children:[t.jsxs("div",{className:"hd-panel-title",children:[t.jsx("span",{children:"HEART-RATE"}),t.jsx("span",{className:"hd-sep",children:"·"}),t.jsx("span",{children:u}),d?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"hd-sep",children:"·"}),t.jsx("span",{children:d})]}):null]}),t.jsx(Q,{buckets:c})]})})]})}export{Z as default};
@@ -0,0 +1 @@
1
+ import{r as t,j as e}from"./index-sUomXsrf.js";/* empty css */import{a as se}from"./api-h5zurxmi.js";import{B as ne,av as re,aw as A,A as te,ax as ae,ay as ie,az as Q,aA as ce,aB as B,aC as de,aD as oe,aE as le,G as he}from"./router-Dja9_ygK.js";import{u as pe}from"./Provider-tFc3jqZ4.js";import{c as P}from"./createLucideIcon-DlxlBfLC.js";import{X as ue}from"./x-0XjXwGqq.js";import{C as V}from"./check-BbgHJX8u.js";import{C as D}from"./copy-CwCAivnc.js";import{E as xe}from"./external-link-CnjcXf32.js";import{L as me}from"./loader-circle-lWOOKezu.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"}]],G=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 J(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=J(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 U(){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),[X,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?A(n,"project"):"",L=n?A(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=Q(s)-Q(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(G,{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(G,{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=X[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:J(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:U},Symbol.toStringTag,{value:"Module"})),_e=Object.freeze(Object.defineProperty({__proto__:null,KnowledgeSearchInspector:U},Symbol.toStringTag,{value:"Module"}));export{U as K,_e as a,Pe as r};
@@ -0,0 +1 @@
1
+ import{r as l,j as e}from"./index-sUomXsrf.js";/* empty css */import{a as F}from"./api-h5zurxmi.js";import{d as we}from"./time-Dhsh_2EG.js";import{u as ve}from"./Provider-tFc3jqZ4.js";import{n as le,p as Ce,o as Ee,q as Ke,t as oe,K as m,S as qe,v as fe,x as Le,y as Ae,z as Te,A as ce,B as ue,C as Ie,D as He,E as Re,F as $e,G as De,H as Fe}from"./router-Dja9_ygK.js";import{S as Me}from"./search-DCT_EvPr.js";import{X as We}from"./x-0XjXwGqq.js";import{L as de}from"./loader-circle-lWOOKezu.js";import{c as Oe}from"./createLucideIcon-DlxlBfLC.js";import{S as Pe}from"./sparkles-up7pVlX-.js";import{C as Ue}from"./chevron-down-BFai6ZfE.js";import{C as ze}from"./clock-DviOalxA.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./terminal-sessions-D5CIR2OL.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:n}){return e.jsx(e.Fragment,{children:De(i,n).map((o,c)=>o.match?e.jsx("mark",{children:o.text},c):e.jsx("span",{children:o.text},c))})}function Je(i,n){i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),n()))}async function Xe(){return F("/api/knowledge/status")}async function Qe(i){const n=new URLSearchParams;for(const o of i)n.append("key",o);return n.set("limit","200"),F(`/api/knowledge/search-primitives?${n.toString()}`)}async function G(i,n){const o=new URLSearchParams({q:i,limit:String(m.hitLimit)});if(n.sourceKinds.length>0)for(const u of n.sourceKinds)o.append("sourceKind",u);for(const u of n.harness)o.append("harness",u);for(const u of n.project)o.append("project",u);const c=$e(n.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 T({active:i,onClick:n,count:o,label:c,ariaLabel:u}){return e.jsxs("button",{type:"button",className:`ks-chip${i?" ks-chip--active":""}`,onClick:n,"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(n=>n.length>0).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function me(i,n,o=6){return i?i.filter(c=>c.key===n&&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 n=[];return i.sourceKinds.length>0&&n.push(i.sourceKinds.map(o=>fe[o]??o).join(" + ")),i.harness.length>0&&n.push(i.harness.map(xe).join(" + ")),i.project.length>0&&n.push(i.project.join(" + ")),i.timeWindow!=="all"&&n.push(Fe(i.timeWindow)),n.length>0?`Filters: ${n.join(" · ")}`:""}function Os({navigate:i,mode:n,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,I]=l.useState(null),[J,je]=l.useState(null),[a,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(a);q.current=a;const p=(E?.chunks??0)>0,$=E?.activeJobs[0]??null,v=l.useMemo(()=>Ee(w),[w]),Z=K||!!$,L=a.query.trim(),P=Ke(a);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),I(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);I(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;I(t),R(!0),b(null)}catch{}if(!s){H(!0);try{b(null);const t=await he(!1);if(s)return;I(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(a)},m.debounceMs);return()=>window.clearTimeout(s)},[a,p,U]);const ge=s=>{if(s.preventDefault(),!p&&!K){ee(!1);return}U(a)},j=l.useCallback(s=>{M(t=>{const r={...t,...s};return oe(t,r)?t:(i({view:"search",...n?{mode:n}:{},filters:r},{replace:!0}),r)})},[n,i]),A=l.useCallback(()=>{const s=le();M(s),i({view:"search",...n?{mode:n}:{},filters:s},{replace:!0})},[n,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:a.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"}),a.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(T,{active:a.sourceKinds.includes(s),onClick:()=>j({sourceKinds:a.sourceKinds.includes(s)?a.sourceKinds.filter(t=>t!==s):[...a.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(T,{active:a.harness.includes(s.value),onClick:()=>j({harness:a.harness.includes(s.value)?a.harness.filter(t=>t!==s.value):[...a.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(T,{active:a.project.includes(s.value),onClick:()=>j({project:a.project.includes(s.value)?a.project.filter(t=>t!==s.value):[...a.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(T,{active:a.timeWindow==="all",onClick:()=>j({timeWindow:"all"}),label:"Any time"}),Ve.map(s=>e.jsx(T,{active:a.timeWindow===s.value,onClick:()=>j({timeWindow:s.value}),label:s.label},s.value))]}),pe(a)?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=Te(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=Ie(k,a.query),ne=u?.id===k.id,_=He(k,a.query,200),ae=Re(k),B=()=>g(k,a.query),re=()=>{const h=ce(ue(k))??N;if(!h){B();return}i({view:"sessions",sessionId:h})};return e.jsx("article",{className:`ks-hit${ne?" ks-hit--selected":""}`,role:"option","aria-selected":ne,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:[ae.length>0?e.jsx("div",{className:"ks-hit-details ks-hit-details--moment","aria-label":"Turn",children:ae.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:a.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(a)?e.jsxs(e.Fragment,{children:[" · ",Ye(a)]}):null]}),e.jsx("button",{type:"button",className:"ks-text-action",onClick:()=>{ee(!0)},disabled:K,children:K?"Updating…":"Update index"})]})]})}export{Os as KnowledgeSearchScreen};
@@ -1 +1 @@
1
- import{r as n,j as T}from"./index-DMiGbrBt.js";import{r as j}from"./index-CJXzfjo9.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-sUomXsrf.js";import{r as j}from"./index-m6dFtY5f.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-sUomXsrf.js";import{S as L}from"./SlidePanel-FCqT1zO3.js";import{A as j}from"./AgentAvatar-CufDA4A-.js";import{H as S}from"./HarnessMark-Dm_qm1Ku.js";import{t as N}from"./time-Dhsh_2EG.js";import{o as g,f as k,b as y}from"./lane-observe-DrhKkQ3A.js";import{S as A}from"./SessionObserve-Dlx5vDaV.js";import{LaneTraceEventFocus as E}from"./LaneTraceEventFocus-DYvHfs_3.js";import{b as T}from"./agent-lane-detail-Cw4QVAgH.js";import{l as I,a as z}from"./agent-lanes-model-Bl6xfviL.js";import"./SpriteAvatar-CQs-jC-v.js";import"./agent-identity-xQHedtLl.js";import"./colors-BtO5_zlx.js";import"./tail-display-BdyoLvzY.js";import"./lane-edit-display-C_Aujldz.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BzehBmdi.js";import"./index-m6dFtY5f.js";import"./lane-ask-display-B6iCAVcd.js";import"./api-h5zurxmi.js";import"./mentions-CY_wPZc5.js";import"./Provider-tFc3jqZ4.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./openContent-C6XO6kr5.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";import"./message-markup-C8Nx04sP.js";import"./ObservedTopologyPanel-Dv6fbHzW.js";import"./ObserveTextFlow-CBitljxi.js";import"./use-reduced-motion-Cvk-HRKg.js";import"./SessionObserveEvidence-ChBD1d4c.js";import"./message-circle-C5UZ6fO7.js";import"./wrench-pEVd8JnN.js";import"./external-link-CnjcXf32.js";import"./context-budget-DX_fwUs3.js";const M={think:"Thought",tool:"Tool",ask:"Request",message:"Message",note:"Note",system:"System",boot:"Boot"};function Je({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{Je as LaneTraceDetailSheet};
@@ -1 +1 @@
1
- import{j as e,r as o}from"./index-DMiGbrBt.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-sUomXsrf.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,3 +1,3 @@
1
- import{r as x,j as s}from"./index-DMiGbrBt.js";import{C as me}from"./chunk-T65CQEWV-CrzwSeEt.js";import{u as te,t as de,b as pe,c as ue}from"./mesh-view-store-CWidRbTE.js";import{n as T,s as B}from"./colors-BtO5_zlx.js";import{t as Q}from"./time-DltNTpLl.js";import{u as fe}from"./Provider-C7UKGHQy.js";import{u as xe}from"./useAgentHoverCard-DMrbBif0.js";import{b as ye}from"./mesh-buckets-CfAukILK.js";import"./plus--b1raV_O.js";import"./createLucideIcon-OpA4Amw5.js";import"./router-Bq5dwf78.js";import"./terminal-sessions-D5CIR2OL.js";import"./api-h5zurxmi.js";import"./sse-CjIkKo46.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-bARZqTzD.js";import"./DocumentFocusViewer-BeVwwl26.js";import"./TextDocumentSurface-BpAw4eQS.js";/* empty css */import"./file-text-BODxCjcz.js";import"./x-D3GElQbe.js";import"./chevron-right-XiIHsk4m.js";import"./code-xml-B6jOCM4V.js";import"./arrow-left-DEZzHiPS.js";import"./scout-voice-CU5c0LGi.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-2kv_tGUS.js";import"./MessageComposerSuggestions-DpxN9WiB.js";import"./NewChatComposer-Cs6OsxK6.js";import"./runtime-picker-Bcl5iIX5.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-CbHjZsz1.js";import"./index-CJXzfjo9.js";import"./HarnessMark-Cbv3Ib0c.js";import"./conversation-model-B47vYmWN.js";import"./NewChatOrigin-Bk2OyVjI.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BGk5qoEw.js";import"./search-CWfZtOt2.js";import"./AgentDetailCard-BcRBRp88.js";import"./AgentLiveActions-DBtnD0qE.js";import"./terminal-takeover-B8UeD9OX.js";import"./openContent-C6XO6kr5.js";import"./eye-0PvebX_a.js";import"./terminal-B9AOZQKR.js";function ge(e,t){if(t.type==="pan")return{...e,pan:{x:e.pan.x+t.delta.x,y:e.pan.y+t.delta.y}};if(t.type==="zoom"){const n=Math.max(.25,Math.min(4,e.scale*t.factor)),{mx:i,my:h,cx:c,cy:f}=t,m=(i-c)/e.scale-e.pan.x,d=(h-f)/e.scale-e.pan.y;return{scale:n,pan:{x:(i-c)/n-m,y:(h-f)/n-d}}}return e}const ce="openscout.mesh.canvas.viewport.v1";function we(){const e={pan:{x:0,y:0},scale:1};if(typeof window>"u")return e;try{const t=window.sessionStorage.getItem(ce);if(!t)return e;const n=JSON.parse(t);if(n&&typeof n=="object"&&typeof n.scale=="number"&&n.pan&&typeof n.pan.x=="number"&&typeof n.pan.y=="number")return{pan:{x:n.pan.x,y:n.pan.y},scale:n.scale}}catch{}return e}function ve(e){const t=e.name&&e.name.trim()||e.handle&&e.handle.trim()||e.harness&&e.harness.trim()||"agent";return{key:t.toLowerCase(),label:t}}function be(e){const t=new Map;for(const n of e){const{key:i,label:h}=ve(n);let c=t.get(i);c||(c={key:i,label:h,instances:[]},t.set(i,c)),c.instances.push(n)}return Array.from(t.values()).map(n=>(n.instances.sort((i,h)=>i.id.localeCompare(h.id)),n)).sort((n,i)=>{const h=n.label.localeCompare(i.label);return h!==0?h:i.instances.length-n.instances.length})}function je(e){switch(e){case"compact":return{density:e,instanceW:138,instanceH:32,stepX:144,stepY:38,clusterPadX:12,clusterPadY:12,labelH:22,clusterGap:16};case"spacious":return{density:e,instanceW:260,instanceH:68,stepX:268,stepY:76,clusterPadX:14,clusterPadY:14,labelH:26,clusterGap:16};default:return{density:"comfortable",instanceW:210,instanceH:52,stepX:218,stepY:60,clusterPadX:12,clusterPadY:12,labelH:24,clusterGap:14}}}function Ne(e,t){return Math.max(1,Math.round(Math.sqrt(e*t)))}function Ce(e,t,n){if(e.length===0)return[];const i=e.map(l=>{const H=l.instances.length,b=Ne(H,Math.max(.6,Math.min(n,2))),I=Math.ceil(H/b),N=b*t.stepX-(t.stepX-t.instanceW),A=I*t.stepY-(t.stepY-t.instanceH);return{cluster:l,cols:b,width:N+t.clusterPadX*2,height:A+t.clusterPadY*2+t.labelH}}),h=i.reduce((l,H)=>l+H.width*H.height,0),c=Math.max(Math.max(...i.map(l=>l.width)),Math.sqrt(h*n)),f=t.clusterGap,m=[];let d=0,j=0,v=0;for(const l of i)d>0&&d+l.width>c&&(j+=v+f,d=0,v=0),m.push({cluster:l.cluster,x:d,y:j,width:l.width,height:l.height,cols:l.cols}),d+=l.width+f,v=Math.max(v,l.height);const p=Math.min(...m.map(l=>l.x)),u=Math.max(...m.map(l=>l.x+l.width)),M=Math.min(...m.map(l=>l.y)),C=Math.max(...m.map(l=>l.y+l.height)),r=-((p+u)/2),g=-((M+C)/2);return m.map(l=>({...l,x:l.x+r,y:l.y+g}))}function Me(e,t,n){const i=e%t,h=Math.floor(e/t);return{x:n.clusterPadX+i*n.stepX,y:n.labelH+n.clusterPadY+h*n.stepY}}function Z(e){const t=e.harness?.trim(),n=e.model?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function ee(e){const t=e.project?.trim(),n=e.branch?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function D(e){return e.cwd||e.projectRoot||"—"}function se({onClick:e}){return s.jsx("button",{type:"button",className:"mesh-sheet-open",title:"Open agent view","aria-label":"Open agent view",onClick:t=>{t.stopPropagation(),e()},children:"↗"})}function Ie({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"",m=Z(e),d=ee(e);return s.jsxs("div",{...n??{},className:`mesh-instance-spec mesh-instance-spec--${h}${c?" mesh-instance-spec--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m} — ${d}`,children:[s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-primary",children:m}),f&&s.jsx("span",{className:"mesh-instance-spec-time",children:f})]}),s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-secondary",children:d}),s.jsx(se,{onClick:t})]})]})}function He({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"—",m=`${Z(e)} · ${ee(e)}`;return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--${h}${c?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m}
1
+ import{r as x,j as s}from"./index-sUomXsrf.js";import{C as me}from"./chunk-T65CQEWV-DI4NKdNq.js";import{u as te,t as de,b as pe,c as ue}from"./mesh-view-store-D14ihwkF.js";import{n as T,s as B}from"./colors-BtO5_zlx.js";import{t as Q}from"./time-Dhsh_2EG.js";import{u as fe}from"./Provider-tFc3jqZ4.js";import{u as xe}from"./useAgentHoverCard-D5e8Qg1z.js";import{b as ye}from"./mesh-buckets-CfAukILK.js";import"./plus-C9lTjsgd.js";import"./createLucideIcon-DlxlBfLC.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.js";import"./api-h5zurxmi.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./openContent-C6XO6kr5.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";function ge(e,t){if(t.type==="pan")return{...e,pan:{x:e.pan.x+t.delta.x,y:e.pan.y+t.delta.y}};if(t.type==="zoom"){const n=Math.max(.25,Math.min(4,e.scale*t.factor)),{mx:i,my:h,cx:c,cy:f}=t,m=(i-c)/e.scale-e.pan.x,d=(h-f)/e.scale-e.pan.y;return{scale:n,pan:{x:(i-c)/n-m,y:(h-f)/n-d}}}return e}const ce="openscout.mesh.canvas.viewport.v1";function we(){const e={pan:{x:0,y:0},scale:1};if(typeof window>"u")return e;try{const t=window.sessionStorage.getItem(ce);if(!t)return e;const n=JSON.parse(t);if(n&&typeof n=="object"&&typeof n.scale=="number"&&n.pan&&typeof n.pan.x=="number"&&typeof n.pan.y=="number")return{pan:{x:n.pan.x,y:n.pan.y},scale:n.scale}}catch{}return e}function ve(e){const t=e.name&&e.name.trim()||e.handle&&e.handle.trim()||e.harness&&e.harness.trim()||"agent";return{key:t.toLowerCase(),label:t}}function be(e){const t=new Map;for(const n of e){const{key:i,label:h}=ve(n);let c=t.get(i);c||(c={key:i,label:h,instances:[]},t.set(i,c)),c.instances.push(n)}return Array.from(t.values()).map(n=>(n.instances.sort((i,h)=>i.id.localeCompare(h.id)),n)).sort((n,i)=>{const h=n.label.localeCompare(i.label);return h!==0?h:i.instances.length-n.instances.length})}function je(e){switch(e){case"compact":return{density:e,instanceW:138,instanceH:32,stepX:144,stepY:38,clusterPadX:12,clusterPadY:12,labelH:22,clusterGap:16};case"spacious":return{density:e,instanceW:260,instanceH:68,stepX:268,stepY:76,clusterPadX:14,clusterPadY:14,labelH:26,clusterGap:16};default:return{density:"comfortable",instanceW:210,instanceH:52,stepX:218,stepY:60,clusterPadX:12,clusterPadY:12,labelH:24,clusterGap:14}}}function Ne(e,t){return Math.max(1,Math.round(Math.sqrt(e*t)))}function Ce(e,t,n){if(e.length===0)return[];const i=e.map(l=>{const H=l.instances.length,b=Ne(H,Math.max(.6,Math.min(n,2))),I=Math.ceil(H/b),N=b*t.stepX-(t.stepX-t.instanceW),A=I*t.stepY-(t.stepY-t.instanceH);return{cluster:l,cols:b,width:N+t.clusterPadX*2,height:A+t.clusterPadY*2+t.labelH}}),h=i.reduce((l,H)=>l+H.width*H.height,0),c=Math.max(Math.max(...i.map(l=>l.width)),Math.sqrt(h*n)),f=t.clusterGap,m=[];let d=0,j=0,v=0;for(const l of i)d>0&&d+l.width>c&&(j+=v+f,d=0,v=0),m.push({cluster:l.cluster,x:d,y:j,width:l.width,height:l.height,cols:l.cols}),d+=l.width+f,v=Math.max(v,l.height);const p=Math.min(...m.map(l=>l.x)),u=Math.max(...m.map(l=>l.x+l.width)),M=Math.min(...m.map(l=>l.y)),C=Math.max(...m.map(l=>l.y+l.height)),r=-((p+u)/2),g=-((M+C)/2);return m.map(l=>({...l,x:l.x+r,y:l.y+g}))}function Me(e,t,n){const i=e%t,h=Math.floor(e/t);return{x:n.clusterPadX+i*n.stepX,y:n.labelH+n.clusterPadY+h*n.stepY}}function Z(e){const t=e.harness?.trim(),n=e.model?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function ee(e){const t=e.project?.trim(),n=e.branch?.trim();return t&&n?`${t}/${n}`:t||n||"—"}function D(e){return e.cwd||e.projectRoot||"—"}function se({onClick:e}){return s.jsx("button",{type:"button",className:"mesh-sheet-open",title:"Open agent view","aria-label":"Open agent view",onClick:t=>{t.stopPropagation(),e()},children:"↗"})}function Ie({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"",m=Z(e),d=ee(e);return s.jsxs("div",{...n??{},className:`mesh-instance-spec mesh-instance-spec--${h}${c?" mesh-instance-spec--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m} — ${d}`,children:[s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-primary",children:m}),f&&s.jsx("span",{className:"mesh-instance-spec-time",children:f})]}),s.jsxs("span",{className:"mesh-instance-spec-row",children:[s.jsx("span",{className:"mesh-instance-spec-secondary",children:d}),s.jsx(se,{onClick:t})]})]})}function He({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"—",m=`${Z(e)} · ${ee(e)}`;return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--${h}${c?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m}
2
2
  ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsx("span",{className:"mesh-sheet-path",children:D(e)}),s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]})]})]})}function $e({agent:e,onOpen:t,bindings:n,active:i}){const h=T(e.state),c=e.agentClass==="organic",f=e.updatedAt?Q(e.updatedAt):"—",m=`${Z(e)} · ${ee(e)}`,d=e.agentClass?.trim();return s.jsxs("div",{...n??{},className:`mesh-instance-sheet mesh-instance-sheet--spacious mesh-instance-sheet--${h}${c?" mesh-instance-sheet--organic":""}${i?" mesh-instance--active":""}`,style:{"--state-stripe":B(e.state)},title:`${m}
3
- ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsx("span",{className:"mesh-sheet-line",children:s.jsx("span",{className:"mesh-sheet-path",children:D(e)})}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]}),d&&s.jsx("span",{className:"mesh-sheet-tag",children:d})]})]})}function Ee({layout:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h}){const{cluster:c,x:f,y:m,width:d,height:j,cols:v}=e,p=x.useMemo(()=>{const u={working:0,ready:0,notReady:0};for(const M of c.instances){const C=T(M.state);C==="in_turn"||C==="in_flight"?u.working+=1:C==="callable"?u.ready+=1:u.notReady+=1}return u},[c.instances]);return s.jsxs("div",{className:"mesh-cluster",style:{position:"absolute",left:f,top:m,width:d,height:j},children:[s.jsxs("div",{className:"mesh-cluster-header",style:{height:t.labelH},children:[s.jsx("span",{className:"mesh-cluster-name",children:c.label}),s.jsx("span",{className:"mesh-cluster-count",children:c.instances.length}),s.jsxs("span",{className:"mesh-cluster-states",children:[p.working>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--working",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.working]}),p.ready>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--available",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.ready]}),p.notReady>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--offline",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.notReady]})]})]}),c.instances.map((u,M)=>{const C=Me(M,v,t);return s.jsx("div",{style:{position:"absolute",left:C.x,top:C.y,width:t.instanceW,height:t.instanceH},children:t.density==="compact"?s.jsx(Ie,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):t.density==="spacious"?s.jsx($e,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):s.jsx(He,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id})},u.id)})]})}const U=34,re=22,Se=6,ne=28,ae=10,F=12,ie=380,Ae=240,J=38;function _e(e,t,n,i,h,c){const f=[],m=[],d=[];for(const r of e)i[r.machineId]?d.push(r):m.push(r);let j=0,v=ie;const p=(r,g)=>{const H=t.has(r.machineId)||!r.online,b=n.has(r.machineId);let I=0,N=0,A=0;for(const L of r.agents){const S=T(L.state);S==="in_turn"||S==="in_flight"?I+=1:S==="callable"?N+=1:A+=1}const G=r.online?I>0?"working":N>0?"available":"offline":"offline";if(H)return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:!1,ghost:!0,pinned:g,x:0,y:0,width:Ae,height:J,headerHeight:J,chromeHeight:J,layouts:[]};const Y=b?[]:be(r.agents),E=b?[]:Ce(Y,h,c),z=b?ke():0,O=b?oe+z*re+Se:0,X=U+O;let k=0,P=0;if(!b&&E.length>0){const L=Math.min(...E.map(o=>o.x)),S=Math.max(...E.map(o=>o.x+o.width)),_=Math.min(...E.map(o=>o.y)),q=Math.max(...E.map(o=>o.y+o.height));k=S-L,P=q-_;const K=-L+F,a=-_+X+ae;for(const o of E)o.x+=K,o.y+=a}const R=Math.max(ie,k+F*2),V=b?X:X+ae+P+F;return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:b,ghost:!1,pinned:g,x:0,y:0,width:R,height:V,headerHeight:U,chromeHeight:X,layouts:E}};for(const r of m){const g=p(r,!1);g.x=0,g.y=j,f.push(g),v=Math.max(v,g.width),j+=g.height+ne}const u=Math.max(0,j-ne),M=-v/2,C=-u/2;for(const r of f)r.ghost||(r.width=v),r.x=M,r.y+=C;for(const r of d){const g=p(r,!0),l=i[r.machineId];g.x=l.x,g.y=l.y,f.push(g)}return f}function Ye({section:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h,onHeaderPointerDown:c,onHeaderClick:f,onGhostActivate:m}){const d=e.reachability==="this"?"this node":e.reachability==="peer"?"peer":e.reachability==="tailnet"?"tailnet":"",j=e.online?e.agentCount===0?"idle":"standby":"unreachable";if(e.ghost)return s.jsx("div",{"data-machine-id":e.machineId,className:"mesh-machine-ghost",style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},title:`${e.machineLabel} · ${j} — click to show`,children:s.jsxs("button",{type:"button",className:"mesh-machine-ghost-body",onPointerDown:p=>c(p,e),onClick:()=>m(e.machineId),children:[s.jsx("span",{className:"mesh-machine-ghost-led","aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-ghost-name",children:e.machineLabel}),s.jsx("span",{className:"mesh-machine-ghost-stamp",children:j}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability} mesh-machine-chip--ghost`,children:d}),s.jsxs("span",{className:"mesh-machine-ghost-counts",children:[s.jsx("span",{className:"mesh-machine-count",children:e.agentCount}),e.workingCount>0&&s.jsxs("span",{className:"mesh-machine-count mesh-machine-count--working",children:[e.workingCount,"W"]})]})]})});const v=e.collapsed?Oe(e):[];return s.jsxs("div",{"data-machine-id":e.machineId,className:`mesh-machine-section${e.collapsed?" mesh-machine-section--collapsed":""}${e.pinned?" mesh-machine-section--pinned":""}`,style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},children:[s.jsxs("button",{type:"button",className:"mesh-machine-header",style:{height:e.headerHeight},onPointerDown:p=>c(p,e),onClick:()=>f(e.machineId),"aria-expanded":!e.collapsed,children:[s.jsx("span",{className:`mesh-machine-led mesh-machine-led--${e.dominantState}`,style:{color:B(e.dominantState)},"aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-caret","aria-hidden":!0,children:e.collapsed?"▸":"▾"}),s.jsx("span",{className:"mesh-machine-grip","aria-hidden":!0,children:"⠿"}),s.jsx("span",{className:"mesh-machine-name",children:e.machineLabel}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability}`,children:d})]}),e.collapsed&&s.jsxs("div",{className:"mesh-machine-spec",children:[s.jsxs("div",{className:"mesh-machine-state-strip",style:{height:oe},children:[s.jsxs("div",{className:"mesh-machine-state-cell mesh-machine-state-cell--working",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.workingCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"working"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.availableCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.agentCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"total"})]})]}),v.map(p=>s.jsxs("div",{className:"mesh-machine-spec-row",style:{height:re},children:[s.jsx("span",{className:"mesh-machine-spec-label",children:p.label}),s.jsx("span",{className:"mesh-machine-spec-value",title:p.value,children:p.value})]},p.label))]}),!e.collapsed&&e.layouts.map(p=>s.jsx(Ee,{layout:p,metrics:t,onAgentOpen:n,bindFor:i,activeId:h},p.cluster.key))]})}function Oe(e){const t=e.host;return[{label:"os",value:t?.os??"—"},{label:"arch",value:t?.arch??"—"},{label:"cpu",value:t?.cpuCores?`${t.cpuCores}c`:"—"},{label:"ram",value:t?.memoryGb?`${t.memoryGb} G`:"—"},{label:"disk",value:t?.storageCapacityGb?`${t.storageCapacityGb} G`:"—"},{label:"network",value:t?.network??"—"},{label:"scout",value:t?.scoutVersion?`v${t.scoutVersion}`:"—"}]}const Xe=7,oe=54;function ke(e,t,n,i){return Xe}function _s({mesh:e,agents:t=[]}){const n=x.useRef(null),[i,h]=x.useState({w:0,h:0}),[c,f]=x.useReducer(ge,void 0,we);x.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(ce,JSON.stringify({pan:c.pan,scale:c.scale}))}catch{}},[c.pan,c.scale]);const{density:m,query:d,agentStateFilters:j,hiddenMachineIds:v,collapsedMachineIds:p,scrollTargetMachineId:u}=te(),{navigate:M}=fe();x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=()=>h({w:a.clientWidth,h:a.clientHeight});o();const w=new ResizeObserver(o);return w.observe(a),()=>w.disconnect()},[]),x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=w=>{w.preventDefault();const y=w.deltaY<0?1.12:1/1.12,$=a.getBoundingClientRect();f({type:"zoom",factor:y,mx:w.clientX-$.left,my:w.clientY-$.top,cx:$.width/2,cy:$.height/2})};return a.addEventListener("wheel",o,{passive:!1}),()=>a.removeEventListener("wheel",o)},[]);const{machinePositions:C}=te(),r=x.useMemo(()=>je(m),[m]),g=x.useMemo(()=>{const a=d.trim().toLowerCase();return t.filter(o=>{const y=T(o.state);return j.has(y)?a?`${o.name??""} ${o.handle??""} ${o.harness??""} ${o.project??""} ${o.branch??""}`.toLowerCase().includes(a):!0:!1})},[t,d,j]),l=x.useMemo(()=>ye(g,e),[g,e]),H=i.w>0&&i.h>0?i.w/i.h:1.6,b=x.useMemo(()=>_e(l,v,p,C,r,H),[l,v,p,C,r,H]),I=x.useRef(null),[N,A]=x.useState(null),G=x.useCallback((a,o)=>{if(a.button!==0)return;a.stopPropagation(),a.currentTarget.setPointerCapture(a.pointerId),I.current={machineId:o.machineId,startClientX:a.clientX,startClientY:a.clientY,startSectionX:o.x,startSectionY:o.y,pointerId:a.pointerId,moved:!1}},[]);x.useEffect(()=>{const a=w=>{const y=I.current;if(!y||w.pointerId!==y.pointerId)return;const $=w.clientX-y.startClientX,W=w.clientY-y.startClientY;if(!y.moved&&Math.hypot($,W)<4)return;y.moved=!0;const le=$/c.scale,he=W/c.scale;A({machineId:y.machineId,x:y.startSectionX+le,y:y.startSectionY+he})},o=w=>{const y=I.current;if(!(!y||w.pointerId!==y.pointerId)){if(I.current=null,y.moved){const $=(w.clientX-y.startClientX)/c.scale,W=(w.clientY-y.startClientY)/c.scale;ue(y.machineId,{x:y.startSectionX+$,y:y.startSectionY+W})}A(null)}};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o),()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)}},[c.scale]);const Y=x.useRef(!1);x.useEffect(()=>{if(N)Y.current=!0;else{const a=setTimeout(()=>{Y.current=!1},50);return()=>clearTimeout(a)}},[N]);const E=x.useCallback(a=>{Y.current||de(a)},[]),z=x.useCallback(a=>{Y.current||pe(a)},[]),O=x.useMemo(()=>N?b.map(a=>a.machineId===N.machineId?{...a,x:N.x,y:N.y,pinned:!0}:a):b,[b,N]);x.useEffect(()=>{if(!u)return;const a=O.find(o=>o.machineId===u);a&&f({type:"pan",delta:{x:-a.x-c.pan.x-a.width/2,y:-a.y-c.pan.y+i.h/4-U}})},[u,O,c.pan.x,c.pan.y,i.h]);const X=x.useCallback(a=>{a.agentClass!=="organic"&&M({view:"agents-v2",agentId:a.id})},[M]),k=x.useMemo(()=>g.filter(a=>a.agentClass!=="organic"),[g]),P=x.useMemo(()=>k.map(a=>a.id),[k]),R=xe({agents:k,orderedIds:P,navigate:M,selectMode:"preview"}),V=x.useCallback(a=>P.includes(a)?R.bind(a):null,[R,P]),L=R.activeAgent?.id??null,{pan:S,scale:_}=c,q=i.w/2,K=i.h/2;return s.jsxs("div",{ref:n,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[i.w>0&&s.jsx(me,{panOffset:S,scale:_,onPan:a=>f({type:"pan",delta:a}),gridOpacity:.7}),s.jsx("div",{style:{position:"absolute",left:0,top:0,width:0,height:0,transform:`translate(${q}px, ${K}px) translate(${S.x*_}px, ${S.y*_}px) scale(${_})`,transformOrigin:"0 0",pointerEvents:"none"},children:O.length===0?s.jsx("div",{style:{position:"absolute",left:-120,top:-20,width:240,textAlign:"center",pointerEvents:"none"},children:s.jsx("div",{className:"mesh-empty-pill",children:"no machines visible"})}):O.map(a=>s.jsx(Ye,{section:a,metrics:r,onAgentOpen:X,bindFor:V,activeId:L,onHeaderPointerDown:G,onHeaderClick:z,onGhostActivate:E},a.machineId))}),s.jsx("div",{className:"mesh-canvas-hint",children:"scroll to zoom · drag to pan"}),R.card]})}export{_s as MeshCanvas};
3
+ ${D(e)}`,children:[s.jsxs("span",{className:"mesh-sheet-line mesh-sheet-line--head",children:[s.jsx("span",{className:"mesh-sheet-id",children:m}),s.jsx("span",{className:"mesh-sheet-time",children:f}),s.jsx(se,{onClick:t})]}),s.jsx("span",{className:"mesh-sheet-line",children:s.jsx("span",{className:"mesh-sheet-path",children:D(e)})}),s.jsxs("span",{className:"mesh-sheet-line",children:[s.jsxs("span",{className:"mesh-sheet-ctx",children:[s.jsx("span",{className:"mesh-sheet-ctx-label",children:"CTX"})," —"]}),d&&s.jsx("span",{className:"mesh-sheet-tag",children:d})]})]})}function Ee({layout:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h}){const{cluster:c,x:f,y:m,width:d,height:j,cols:v}=e,p=x.useMemo(()=>{const u={working:0,ready:0,notReady:0};for(const M of c.instances){const C=T(M.state);C==="in_turn"||C==="in_flight"?u.working+=1:C==="callable"?u.ready+=1:u.notReady+=1}return u},[c.instances]);return s.jsxs("div",{className:"mesh-cluster",style:{position:"absolute",left:f,top:m,width:d,height:j},children:[s.jsxs("div",{className:"mesh-cluster-header",style:{height:t.labelH},children:[s.jsx("span",{className:"mesh-cluster-name",children:c.label}),s.jsx("span",{className:"mesh-cluster-count",children:c.instances.length}),s.jsxs("span",{className:"mesh-cluster-states",children:[p.working>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--working",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.working]}),p.ready>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--available",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.ready]}),p.notReady>0&&s.jsxs("span",{className:"mesh-cluster-state mesh-cluster-state--offline",children:[s.jsx("span",{className:"mesh-cluster-state-dot"}),p.notReady]})]})]}),c.instances.map((u,M)=>{const C=Me(M,v,t);return s.jsx("div",{style:{position:"absolute",left:C.x,top:C.y,width:t.instanceW,height:t.instanceH},children:t.density==="compact"?s.jsx(Ie,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):t.density==="spacious"?s.jsx($e,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id}):s.jsx(He,{agent:u,onOpen:()=>n(u),bindings:i(u.id),active:h===u.id})},u.id)})]})}const U=34,re=22,Se=6,ne=28,ae=10,F=12,ie=380,Ae=240,J=38;function _e(e,t,n,i,h,c){const f=[],m=[],d=[];for(const r of e)i[r.machineId]?d.push(r):m.push(r);let j=0,v=ie;const p=(r,g)=>{const H=t.has(r.machineId)||!r.online,b=n.has(r.machineId);let I=0,N=0,A=0;for(const L of r.agents){const S=T(L.state);S==="in_turn"||S==="in_flight"?I+=1:S==="callable"?N+=1:A+=1}const G=r.online?I>0?"working":N>0?"available":"offline":"offline";if(H)return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:!1,ghost:!0,pinned:g,x:0,y:0,width:Ae,height:J,headerHeight:J,chromeHeight:J,layouts:[]};const Y=b?[]:be(r.agents),E=b?[]:Ce(Y,h,c),z=b?ke():0,O=b?oe+z*re+Se:0,X=U+O;let k=0,P=0;if(!b&&E.length>0){const L=Math.min(...E.map(o=>o.x)),S=Math.max(...E.map(o=>o.x+o.width)),_=Math.min(...E.map(o=>o.y)),q=Math.max(...E.map(o=>o.y+o.height));k=S-L,P=q-_;const K=-L+F,a=-_+X+ae;for(const o of E)o.x+=K,o.y+=a}const R=Math.max(ie,k+F*2),V=b?X:X+ae+P+F;return{machineId:r.machineId,machineLabel:r.machineLabel,reachability:r.reachability,online:r.online,agentCount:r.agents.length,workingCount:I,availableCount:N,offlineCount:A,dominantState:G,host:r.host,collapsed:b,ghost:!1,pinned:g,x:0,y:0,width:R,height:V,headerHeight:U,chromeHeight:X,layouts:E}};for(const r of m){const g=p(r,!1);g.x=0,g.y=j,f.push(g),v=Math.max(v,g.width),j+=g.height+ne}const u=Math.max(0,j-ne),M=-v/2,C=-u/2;for(const r of f)r.ghost||(r.width=v),r.x=M,r.y+=C;for(const r of d){const g=p(r,!0),l=i[r.machineId];g.x=l.x,g.y=l.y,f.push(g)}return f}function Ye({section:e,metrics:t,onAgentOpen:n,bindFor:i,activeId:h,onHeaderPointerDown:c,onHeaderClick:f,onGhostActivate:m}){const d=e.reachability==="this"?"this node":e.reachability==="peer"?"peer":e.reachability==="tailnet"?"tailnet":"",j=e.online?e.agentCount===0?"idle":"standby":"unreachable";if(e.ghost)return s.jsx("div",{"data-machine-id":e.machineId,className:"mesh-machine-ghost",style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},title:`${e.machineLabel} · ${j} — click to show`,children:s.jsxs("button",{type:"button",className:"mesh-machine-ghost-body",onPointerDown:p=>c(p,e),onClick:()=>m(e.machineId),children:[s.jsx("span",{className:"mesh-machine-ghost-led","aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-ghost-name",children:e.machineLabel}),s.jsx("span",{className:"mesh-machine-ghost-stamp",children:j}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability} mesh-machine-chip--ghost`,children:d}),s.jsxs("span",{className:"mesh-machine-ghost-counts",children:[s.jsx("span",{className:"mesh-machine-count",children:e.agentCount}),e.workingCount>0&&s.jsxs("span",{className:"mesh-machine-count mesh-machine-count--working",children:[e.workingCount,"W"]})]})]})});const v=e.collapsed?Oe(e):[];return s.jsxs("div",{"data-machine-id":e.machineId,className:`mesh-machine-section${e.collapsed?" mesh-machine-section--collapsed":""}${e.pinned?" mesh-machine-section--pinned":""}`,style:{position:"absolute",left:e.x,top:e.y,width:e.width,height:e.height,pointerEvents:"all"},children:[s.jsxs("button",{type:"button",className:"mesh-machine-header",style:{height:e.headerHeight},onPointerDown:p=>c(p,e),onClick:()=>f(e.machineId),"aria-expanded":!e.collapsed,children:[s.jsx("span",{className:`mesh-machine-led mesh-machine-led--${e.dominantState}`,style:{color:B(e.dominantState)},"aria-hidden":!0}),s.jsx("span",{className:"mesh-machine-caret","aria-hidden":!0,children:e.collapsed?"▸":"▾"}),s.jsx("span",{className:"mesh-machine-grip","aria-hidden":!0,children:"⠿"}),s.jsx("span",{className:"mesh-machine-name",children:e.machineLabel}),d&&s.jsx("span",{className:`mesh-machine-chip mesh-machine-chip--${e.reachability}`,children:d})]}),e.collapsed&&s.jsxs("div",{className:"mesh-machine-spec",children:[s.jsxs("div",{className:"mesh-machine-state-strip",style:{height:oe},children:[s.jsxs("div",{className:"mesh-machine-state-cell mesh-machine-state-cell--working",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.workingCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"working"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.availableCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-machine-state-cell",children:[s.jsx("span",{className:"mesh-machine-state-num",children:e.agentCount}),s.jsx("span",{className:"mesh-machine-state-label",children:"total"})]})]}),v.map(p=>s.jsxs("div",{className:"mesh-machine-spec-row",style:{height:re},children:[s.jsx("span",{className:"mesh-machine-spec-label",children:p.label}),s.jsx("span",{className:"mesh-machine-spec-value",title:p.value,children:p.value})]},p.label))]}),!e.collapsed&&e.layouts.map(p=>s.jsx(Ee,{layout:p,metrics:t,onAgentOpen:n,bindFor:i,activeId:h},p.cluster.key))]})}function Oe(e){const t=e.host;return[{label:"os",value:t?.os??"—"},{label:"arch",value:t?.arch??"—"},{label:"cpu",value:t?.cpuCores?`${t.cpuCores}c`:"—"},{label:"ram",value:t?.memoryGb?`${t.memoryGb} G`:"—"},{label:"disk",value:t?.storageCapacityGb?`${t.storageCapacityGb} G`:"—"},{label:"network",value:t?.network??"—"},{label:"scout",value:t?.scoutVersion?`v${t.scoutVersion}`:"—"}]}const Xe=7,oe=54;function ke(e,t,n,i){return Xe}function Ys({mesh:e,agents:t=[]}){const n=x.useRef(null),[i,h]=x.useState({w:0,h:0}),[c,f]=x.useReducer(ge,void 0,we);x.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(ce,JSON.stringify({pan:c.pan,scale:c.scale}))}catch{}},[c.pan,c.scale]);const{density:m,query:d,agentStateFilters:j,hiddenMachineIds:v,collapsedMachineIds:p,scrollTargetMachineId:u}=te(),{navigate:M}=fe();x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=()=>h({w:a.clientWidth,h:a.clientHeight});o();const w=new ResizeObserver(o);return w.observe(a),()=>w.disconnect()},[]),x.useLayoutEffect(()=>{const a=n.current;if(!a)return;const o=w=>{w.preventDefault();const y=w.deltaY<0?1.12:1/1.12,$=a.getBoundingClientRect();f({type:"zoom",factor:y,mx:w.clientX-$.left,my:w.clientY-$.top,cx:$.width/2,cy:$.height/2})};return a.addEventListener("wheel",o,{passive:!1}),()=>a.removeEventListener("wheel",o)},[]);const{machinePositions:C}=te(),r=x.useMemo(()=>je(m),[m]),g=x.useMemo(()=>{const a=d.trim().toLowerCase();return t.filter(o=>{const y=T(o.state);return j.has(y)?a?`${o.name??""} ${o.handle??""} ${o.harness??""} ${o.project??""} ${o.branch??""}`.toLowerCase().includes(a):!0:!1})},[t,d,j]),l=x.useMemo(()=>ye(g,e),[g,e]),H=i.w>0&&i.h>0?i.w/i.h:1.6,b=x.useMemo(()=>_e(l,v,p,C,r,H),[l,v,p,C,r,H]),I=x.useRef(null),[N,A]=x.useState(null),G=x.useCallback((a,o)=>{if(a.button!==0)return;a.stopPropagation(),a.currentTarget.setPointerCapture(a.pointerId),I.current={machineId:o.machineId,startClientX:a.clientX,startClientY:a.clientY,startSectionX:o.x,startSectionY:o.y,pointerId:a.pointerId,moved:!1}},[]);x.useEffect(()=>{const a=w=>{const y=I.current;if(!y||w.pointerId!==y.pointerId)return;const $=w.clientX-y.startClientX,W=w.clientY-y.startClientY;if(!y.moved&&Math.hypot($,W)<4)return;y.moved=!0;const le=$/c.scale,he=W/c.scale;A({machineId:y.machineId,x:y.startSectionX+le,y:y.startSectionY+he})},o=w=>{const y=I.current;if(!(!y||w.pointerId!==y.pointerId)){if(I.current=null,y.moved){const $=(w.clientX-y.startClientX)/c.scale,W=(w.clientY-y.startClientY)/c.scale;ue(y.machineId,{x:y.startSectionX+$,y:y.startSectionY+W})}A(null)}};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o),()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)}},[c.scale]);const Y=x.useRef(!1);x.useEffect(()=>{if(N)Y.current=!0;else{const a=setTimeout(()=>{Y.current=!1},50);return()=>clearTimeout(a)}},[N]);const E=x.useCallback(a=>{Y.current||de(a)},[]),z=x.useCallback(a=>{Y.current||pe(a)},[]),O=x.useMemo(()=>N?b.map(a=>a.machineId===N.machineId?{...a,x:N.x,y:N.y,pinned:!0}:a):b,[b,N]);x.useEffect(()=>{if(!u)return;const a=O.find(o=>o.machineId===u);a&&f({type:"pan",delta:{x:-a.x-c.pan.x-a.width/2,y:-a.y-c.pan.y+i.h/4-U}})},[u,O,c.pan.x,c.pan.y,i.h]);const X=x.useCallback(a=>{a.agentClass!=="organic"&&M({view:"agents-v2",agentId:a.id})},[M]),k=x.useMemo(()=>g.filter(a=>a.agentClass!=="organic"),[g]),P=x.useMemo(()=>k.map(a=>a.id),[k]),R=xe({agents:k,orderedIds:P,navigate:M,selectMode:"preview"}),V=x.useCallback(a=>P.includes(a)?R.bind(a):null,[R,P]),L=R.activeAgent?.id??null,{pan:S,scale:_}=c,q=i.w/2,K=i.h/2;return s.jsxs("div",{ref:n,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[i.w>0&&s.jsx(me,{panOffset:S,scale:_,onPan:a=>f({type:"pan",delta:a}),gridOpacity:.7}),s.jsx("div",{style:{position:"absolute",left:0,top:0,width:0,height:0,transform:`translate(${q}px, ${K}px) translate(${S.x*_}px, ${S.y*_}px) scale(${_})`,transformOrigin:"0 0",pointerEvents:"none"},children:O.length===0?s.jsx("div",{style:{position:"absolute",left:-120,top:-20,width:240,textAlign:"center",pointerEvents:"none"},children:s.jsx("div",{className:"mesh-empty-pill",children:"no machines visible"})}):O.map(a=>s.jsx(Ye,{section:a,metrics:r,onAgentOpen:X,bindFor:V,activeId:L,onHeaderPointerDown:G,onHeaderClick:z,onGhostActivate:E},a.machineId))}),s.jsx("div",{className:"mesh-canvas-hint",children:"scroll to zoom · drag to pan"}),R.card]})}export{Ys as MeshCanvas};
@@ -1 +1 @@
1
- import{r as x,j as e}from"./index-DMiGbrBt.js";import{u as v,d as $,t as C,a as M,r as b}from"./mesh-view-store-CWidRbTE.js";import{u as w}from"./Provider-C7UKGHQy.js";import{b as I}from"./mesh-buckets-CfAukILK.js";import{a as j,f as S,s as f}from"./colors-BtO5_zlx.js";function T(){const[i,o]=x.useState("rack"),{agents:r}=w(),{meshSnapshot:l,selectedId:s,selectedType:a,hiddenMachineIds:m,machinePositions:n}=v(),t=x.useMemo(()=>l?I(r,l):[],[r,l]);if(!l||t.length===0)return null;const h=t.filter(d=>!m.has(d.machineId)).length,p=t.length,g=Object.keys(n).length,c=d=>{M(d,"node"),b(d)};return e.jsxs("div",{className:"mesh-rail",children:[e.jsxs("div",{className:"mesh-rail-head",children:[e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0}),e.jsxs("div",{className:"mesh-rail-mode",role:"group","aria-label":"Bottom view",children:[e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="map"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("map"),"aria-pressed":i==="map",children:"map"}),e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="rack"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("rack"),"aria-pressed":i==="rack",children:"rack"})]}),e.jsx("span",{className:"mesh-rail-title-count",children:p}),e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0})]}),i==="rack"?e.jsx(k,{buckets:t,hiddenMachineIds:m,selectedId:s,selectedType:a,onFocus:c}):e.jsx(B,{buckets:t,selectedId:s,selectedType:a,onFocus:c}),e.jsxs("div",{className:"mesh-rail-foot",children:[e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0}),e.jsx("span",{className:"mesh-rail-foot-meta",children:i==="map"?`${p} machines`:`${h}/${p} shown`}),g>0&&i==="rack"?e.jsx("button",{type:"button",className:"mesh-rail-foot-reset",onClick:()=>$(),title:"Reset machine layout",children:"reset"}):e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0})]})]})}function k({buckets:i,hiddenMachineIds:o,selectedId:r,selectedType:l,onFocus:s}){return e.jsx("div",{className:"mesh-rail-body",children:i.map((a,m)=>{const n=o.has(a.machineId),t=r===a.machineId&&l==="node",h=a.agents.filter(u=>j(u.state)).length,p=a.agents.filter(u=>S(u.state)).length,g=a.online?a.agents.length===0?"offline":h>0?"working":"available":"offline",c=n||!a.online?void 0:f(g),d=a.reachability==="this"?"L":a.reachability==="peer"?"P":a.reachability==="tailnet"?"T":"·",N=String(m+1).padStart(2,"0"),y=a.online?a.agents.length===0?"idle":`${h}w · ${p}r`:"unreachable";return e.jsxs("div",{className:["mesh-rail-unit",n&&"mesh-rail-unit--off",!a.online&&"mesh-rail-unit--unreachable",t&&"mesh-rail-unit--active"].filter(Boolean).join(" "),children:[e.jsxs("button",{type:"button",className:"mesh-rail-unit-body",onClick:()=>s(a.machineId),title:`Focus ${a.machineLabel} on the map`,children:[e.jsx("span",{className:"mesh-rail-slot",children:N}),e.jsx("span",{className:`mesh-rail-led${n||!a.online?"":" mesh-rail-led--on"}`,style:c?{background:c,color:c}:void 0,"aria-hidden":!0}),e.jsxs("span",{className:"mesh-rail-unit-text",children:[e.jsx("span",{className:"mesh-rail-unit-name",title:a.machineLabel,children:a.machineLabel}),e.jsxs("span",{className:"mesh-rail-unit-sub",children:[e.jsx("span",{className:`mesh-rail-reach mesh-rail-reach--${a.reachability}`,children:d}),e.jsx("span",{className:"mesh-rail-unit-stamp",children:y})]})]}),e.jsx("span",{className:"mesh-rail-unit-count",children:a.agents.length})]}),e.jsx("div",{className:"mesh-rail-unit-actions",children:e.jsx("button",{type:"button",className:`mesh-rail-unit-eye${n?" mesh-rail-unit-eye--off":""}`,onClick:u=>{u.stopPropagation(),C(a.machineId)},title:n?"Show in workspace":"Hide from workspace","aria-pressed":!n,children:n?"○":"●"})}),e.jsx("span",{className:"mesh-rail-vent","aria-hidden":!0})]},a.machineId)})})}function B({buckets:i,selectedId:o,selectedType:r,onFocus:l}){return e.jsx("div",{className:"mesh-rail-body mesh-rail-body--map",children:e.jsx("div",{className:"mesh-mini-map",children:i.map(s=>{const a=o===s.machineId&&r==="node",m=s.agents.filter(h=>j(h.state)).length,n=s.online?s.agents.length===0?"offline":m>0?"working":"available":"offline",t=s.online?f(n):void 0;return e.jsxs("button",{type:"button",className:`mesh-mini-node mesh-mini-node--${n}${a?" mesh-mini-node--active":""}${s.online?"":" mesh-mini-node--off"}`,onClick:()=>l(s.machineId),title:`${s.machineLabel} — ${s.agents.length} agents`,children:[e.jsx("span",{className:"mesh-mini-led",style:t?{background:t}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"mesh-mini-label",children:s.machineLabel}),s.agents.length>0&&e.jsx("span",{className:"mesh-mini-count",children:s.agents.length})]},s.machineId)})})})}export{T as M};
1
+ import{r as x,j as e}from"./index-sUomXsrf.js";import{u as v,d as $,t as C,a as M,r as b}from"./mesh-view-store-D14ihwkF.js";import{u as w}from"./Provider-tFc3jqZ4.js";import{b as I}from"./mesh-buckets-CfAukILK.js";import{a as j,f as S,s as f}from"./colors-BtO5_zlx.js";function T(){const[i,o]=x.useState("rack"),{agents:r}=w(),{meshSnapshot:l,selectedId:s,selectedType:a,hiddenMachineIds:m,machinePositions:n}=v(),t=x.useMemo(()=>l?I(r,l):[],[r,l]);if(!l||t.length===0)return null;const h=t.filter(d=>!m.has(d.machineId)).length,p=t.length,g=Object.keys(n).length,c=d=>{M(d,"node"),b(d)};return e.jsxs("div",{className:"mesh-rail",children:[e.jsxs("div",{className:"mesh-rail-head",children:[e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0}),e.jsxs("div",{className:"mesh-rail-mode",role:"group","aria-label":"Bottom view",children:[e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="map"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("map"),"aria-pressed":i==="map",children:"map"}),e.jsx("button",{type:"button",className:`mesh-rail-mode-btn${i==="rack"?" mesh-rail-mode-btn--active":""}`,onClick:()=>o("rack"),"aria-pressed":i==="rack",children:"rack"})]}),e.jsx("span",{className:"mesh-rail-title-count",children:p}),e.jsx("span",{className:"mesh-rail-ear","aria-hidden":!0})]}),i==="rack"?e.jsx(k,{buckets:t,hiddenMachineIds:m,selectedId:s,selectedType:a,onFocus:c}):e.jsx(B,{buckets:t,selectedId:s,selectedType:a,onFocus:c}),e.jsxs("div",{className:"mesh-rail-foot",children:[e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0}),e.jsx("span",{className:"mesh-rail-foot-meta",children:i==="map"?`${p} machines`:`${h}/${p} shown`}),g>0&&i==="rack"?e.jsx("button",{type:"button",className:"mesh-rail-foot-reset",onClick:()=>$(),title:"Reset machine layout",children:"reset"}):e.jsx("span",{className:"mesh-rail-foot-mark","aria-hidden":!0})]})]})}function k({buckets:i,hiddenMachineIds:o,selectedId:r,selectedType:l,onFocus:s}){return e.jsx("div",{className:"mesh-rail-body",children:i.map((a,m)=>{const n=o.has(a.machineId),t=r===a.machineId&&l==="node",h=a.agents.filter(u=>j(u.state)).length,p=a.agents.filter(u=>S(u.state)).length,g=a.online?a.agents.length===0?"offline":h>0?"working":"available":"offline",c=n||!a.online?void 0:f(g),d=a.reachability==="this"?"L":a.reachability==="peer"?"P":a.reachability==="tailnet"?"T":"·",N=String(m+1).padStart(2,"0"),y=a.online?a.agents.length===0?"idle":`${h}w · ${p}r`:"unreachable";return e.jsxs("div",{className:["mesh-rail-unit",n&&"mesh-rail-unit--off",!a.online&&"mesh-rail-unit--unreachable",t&&"mesh-rail-unit--active"].filter(Boolean).join(" "),children:[e.jsxs("button",{type:"button",className:"mesh-rail-unit-body",onClick:()=>s(a.machineId),title:`Focus ${a.machineLabel} on the map`,children:[e.jsx("span",{className:"mesh-rail-slot",children:N}),e.jsx("span",{className:`mesh-rail-led${n||!a.online?"":" mesh-rail-led--on"}`,style:c?{background:c,color:c}:void 0,"aria-hidden":!0}),e.jsxs("span",{className:"mesh-rail-unit-text",children:[e.jsx("span",{className:"mesh-rail-unit-name",title:a.machineLabel,children:a.machineLabel}),e.jsxs("span",{className:"mesh-rail-unit-sub",children:[e.jsx("span",{className:`mesh-rail-reach mesh-rail-reach--${a.reachability}`,children:d}),e.jsx("span",{className:"mesh-rail-unit-stamp",children:y})]})]}),e.jsx("span",{className:"mesh-rail-unit-count",children:a.agents.length})]}),e.jsx("div",{className:"mesh-rail-unit-actions",children:e.jsx("button",{type:"button",className:`mesh-rail-unit-eye${n?" mesh-rail-unit-eye--off":""}`,onClick:u=>{u.stopPropagation(),C(a.machineId)},title:n?"Show in workspace":"Hide from workspace","aria-pressed":!n,children:n?"○":"●"})}),e.jsx("span",{className:"mesh-rail-vent","aria-hidden":!0})]},a.machineId)})})}function B({buckets:i,selectedId:o,selectedType:r,onFocus:l}){return e.jsx("div",{className:"mesh-rail-body mesh-rail-body--map",children:e.jsx("div",{className:"mesh-mini-map",children:i.map(s=>{const a=o===s.machineId&&r==="node",m=s.agents.filter(h=>j(h.state)).length,n=s.online?s.agents.length===0?"offline":m>0?"working":"available":"offline",t=s.online?f(n):void 0;return e.jsxs("button",{type:"button",className:`mesh-mini-node mesh-mini-node--${n}${a?" mesh-mini-node--active":""}${s.online?"":" mesh-mini-node--off"}`,onClick:()=>l(s.machineId),title:`${s.machineLabel} — ${s.agents.length} agents`,children:[e.jsx("span",{className:"mesh-mini-led",style:t?{background:t}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"mesh-mini-label",children:s.machineLabel}),s.agents.length>0&&e.jsx("span",{className:"mesh-mini-count",children:s.agents.length})]},s.machineId)})})})}export{T as M};
@@ -0,0 +1 @@
1
+ import{r as d,j as e}from"./index-sUomXsrf.js";import{a as B}from"./api-h5zurxmi.js";import{t as A}from"./time-Dhsh_2EG.js";import{n as _,b as D,s as z,c as F}from"./colors-BtO5_zlx.js";import{u as O,e as H}from"./Provider-tFc3jqZ4.js";import{b as K}from"./router-Dja9_ygK.js";import{MeshCanvas as U}from"./MeshCanvas-DIjlrMPU.js";import{u as V}from"./useAgentHoverCard-D5e8Qg1z.js";import{u as Q}from"./local-agents-C7fDHLVC.js";import{u as J,a as W,s as X,e as E,f as I,g as Y,h as L}from"./mesh-view-store-D14ihwkF.js";import{u as Z}from"./useContentSecondaryNav-ZfBNi3d4.js";import{OpsSubnav as G}from"./OpsSubnav-CoN8utF8.js";/* empty css *//* empty css */import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./conversation-model-C4yb6_FA.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./terminal-sessions-D5CIR2OL.js";import"./chunk-T65CQEWV-DI4NKdNq.js";import"./plus-C9lTjsgd.js";import"./mesh-buckets-CfAukILK.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./openContent-C6XO6kr5.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";import"./SecondaryNav-Bks0CO2h.js";import"./secondaryNavConfig-Drb7wPG4.js";import"./message-square-BD-4UUdc.js";import"./scroll-text-BIYf6g6N.js";/* empty css */function ee(c){const p=new Map,x=new Map;for(const a of c){const o=a.project??"Unassigned",i=o.toLowerCase(),m=a.branch??"—";let r=p.get(i);r||(r=new Map,p.set(i,r));const u=r.get(m)??[];u.push(a),r.set(m,u);let s=x.get(i);s||(s=new Map,x.set(i,s)),s.set(o,(s.get(o)??0)+1)}const g=a=>{const o=x.get(a);if(!o)return a;let i=null,m=-1;for(const[r,u]of o)u>m&&(i=r,m=u);return i??a},j=[];for(const[a,o]of p){const i=g(a),m=[];let r=0;const u={in_turn:0,in_flight:0,needs_attention:0,callable:0,blocked:0},s=[];for(const[l,n]of o){const t=[...n].sort((h,b)=>(b.updatedAt??0)-(h.updatedAt??0)),y=t.reduce((h,b)=>Math.max(h,b.updatedAt??0),0);r=Math.max(r,y);for(const h of t)u[_(h.state)]+=1,s.push(h);m.push({branch:l,agents:t,latest:y})}m.sort((l,n)=>n.latest-l.latest),j.push({project:i,branches:m,agents:s,latest:r,counts:u})}return j.sort((a,o)=>o.latest-a.latest),j}function T(c){return c?c.replace(/^\/Users\/[^/]+/,"~"):null}function se({agents:c,emptyTitle:p="No agents registered",emptyBody:x="Agents connected to this broker will appear here.",selectMode:g="preview"}){const{navigate:j}=O(),a=d.useMemo(()=>ee(c),[c]),[o,i]=d.useState(()=>new Set),m=d.useMemo(()=>{const s=[];for(const l of a)if(!o.has(l.project))for(const n of l.branches)for(const t of n.agents)s.push(t.id);return s},[a,o]),r=V({agents:c,orderedIds:m,navigate:j,selectMode:g});if(c.length===0)return e.jsxs("div",{className:"sys-list-empty",children:[e.jsx("h3",{children:p}),e.jsx("p",{children:x})]});const u=s=>{i(l=>{const n=new Set(l);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"mesh-tree",ref:r.containerRef,children:[a.map(s=>{const l=o.has(s.project);return e.jsxs("div",{className:`mesh-tree-group${l?" mesh-tree-group--collapsed":""}`,children:[e.jsxs("button",{type:"button",className:"mesh-tree-project",onClick:()=>u(s.project),"aria-expanded":!l,children:[e.jsx("span",{className:`mesh-tree-caret${l?"":" mesh-tree-caret--open"}`,"aria-hidden":!0,children:"›"}),e.jsx("span",{className:"mesh-tree-project-name",children:s.project}),e.jsx("span",{className:"mesh-tree-project-count",children:s.agents.length}),e.jsxs("span",{className:"mesh-tree-counts",children:[s.counts.in_turn+s.counts.in_flight+s.counts.needs_attention>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--working",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.in_turn+s.counts.in_flight+s.counts.needs_attention]}),s.counts.callable>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--available",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.callable]}),s.counts.blocked>0&&e.jsxs("span",{className:"mesh-tree-count mesh-tree-count--offline",children:[e.jsx("span",{className:"mesh-tree-count-dot"}),s.counts.blocked]})]}),e.jsx("span",{className:"mesh-tree-project-time",children:s.latest?A(s.latest):""})]}),!l&&e.jsx("div",{className:"mesh-tree-branches",children:s.branches.map(n=>e.jsxs("div",{className:"mesh-tree-branch",children:[e.jsxs("div",{className:"mesh-tree-branch-head",children:[e.jsx("span",{className:"mesh-tree-branch-elbow","aria-hidden":!0,children:"└"}),e.jsx("span",{className:"mesh-tree-branch-name",children:n.branch})]}),e.jsx("div",{className:"mesh-tree-agents",children:n.agents.map(t=>{const y=_(t.state),h=D(t.state),b=t.agentClass==="organic",S=r.getState(t.id),k=T(t.cwd)??T(t.projectRoot),f=t.harnessSessionId?t.harnessSessionId.slice(0,8):null,v=[];k&&v.push({kind:"cwd",text:k}),t.harness&&v.push({kind:"harness",text:t.harness}),t.model&&v.push({kind:"model",text:t.model}),f&&v.push({kind:"sess",text:`sess:${f}`});const $=r.bind(t.id);return e.jsxs("button",{type:"button",className:`mesh-tree-agent${b?" mesh-tree-agent--organic":""}${S.isActive?" mesh-tree-agent--active":""}${S.isPinned?" mesh-tree-agent--pinned":""}`,title:b?`${t.harness??t.name} · organic session`:void 0,...$,children:[e.jsx("span",{className:`mesh-tree-agent-dot mesh-tree-agent-dot--${h}`,style:{background:z(t.state)}}),e.jsx("span",{className:"mesh-tree-agent-name",children:t.handle??t.name}),b&&e.jsx("span",{className:"mesh-tree-agent-organic","aria-label":"organic session",children:"○"}),e.jsx("span",{className:"mesh-tree-agent-inline",children:v.map((w,R)=>e.jsxs("span",{className:`mesh-tree-agent-inline-part mesh-tree-agent-inline-part--${w.kind}`,children:[R>0&&e.jsx("span",{className:"mesh-tree-agent-inline-sep",children:"·"}),w.text]},w.kind))}),e.jsx("span",{className:`mesh-tree-agent-state mesh-tree-agent-state--${h}`,children:F(y)}),e.jsx("span",{className:"mesh-tree-agent-time",children:t.updatedAt?A(t.updatedAt):""})]},t.id)})})]},n.branch))})]},s.project)}),r.card]})}function P({mode:c,density:p,query:x,stateFilter:g,loading:j,refreshing:a,error:o,lastLoadedAt:i,hasMesh:m,onRefresh:r}){return e.jsxs("div",{className:`mesh-hud mesh-hud--${c}`,children:[e.jsxs("div",{className:"mesh-hud-left",children:[e.jsxs("div",{className:"mesh-mode-toggle",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${c==="map"?" mesh-mode-btn--active":""}`,onClick:()=>E("map"),children:"Map"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${c==="tree"?" mesh-mode-btn--active":""}`,onClick:()=>E("tree"),children:"Tree"})]}),e.jsxs("div",{className:"mesh-mode-toggle mesh-density-toggle",role:"group","aria-label":"Density","aria-hidden":c!=="map","data-mode-only":"map",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="compact"?" mesh-mode-btn--active":""}`,onClick:()=>I("compact"),disabled:c!=="map",title:"Compact — dots",children:"Compact"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="comfortable"?" mesh-mode-btn--active":""}`,onClick:()=>I("comfortable"),disabled:c!=="map",title:"Comfortable — chips",children:"Comfortable"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${p==="spacious"?" mesh-mode-btn--active":""}`,onClick:()=>I("spacious"),disabled:c!=="map",title:"Spacious — cards",children:"Spacious"})]})]}),m&&e.jsxs("div",{className:"mesh-hud-filters",children:[e.jsx("input",{type:"search",className:"mesh-hud-search",placeholder:"Filter agents…",value:x,onChange:u=>Y(u.target.value),spellCheck:!1,autoCorrect:"off",autoCapitalize:"off"}),e.jsxs("div",{className:"mesh-mode-toggle",role:"group","aria-label":"State",children:[e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="all"?" mesh-mode-btn--active":""}`,onClick:()=>L("all"),children:"All"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="in_turn"?" mesh-mode-btn--active":""}`,onClick:()=>L("in_turn"),children:"In turn"}),e.jsx("button",{type:"button",className:`mesh-mode-btn${g==="callable"?" mesh-mode-btn--active":""}`,onClick:()=>L("callable"),children:"Callable"})]})]}),e.jsxs("div",{className:"mesh-hud-right",children:[e.jsx("span",{className:"mesh-hud-sync",children:j?"Loading…":o&&m?`Last sync old — ${i?A(i):"unknown"}`:i?A(i):"—"}),e.jsx("button",{type:"button",className:"s-btn",disabled:j||a,onClick:r,children:a?"Refreshing…":"Refresh"})]})]})}function ls({navigate:c}){const[p,x]=d.useState(!0),[g,j]=d.useState(!1),[a,o]=d.useState(null),[i,m]=d.useState(null),{mode:r,density:u,query:s,stateFilter:l,meshSnapshot:n}=J(),{agents:t}=Q(),{route:y}=O(),h=K(y),b=d.useMemo(()=>H(t,h,n?.localNode?.id),[t,h,n?.localNode?.id]),S=d.useRef(null),k=d.useRef(0);d.useEffect(()=>{S.current=n},[n]),d.useEffect(()=>{h&&W(h,"node")},[h]);const f=d.useCallback(async(C="initial")=>{const N=++k.current;!(S.current!==null)&&C!=="background"?(x(!0),o(null)):j(!0);try{const M=await B("/api/mesh");if(N!==k.current)return;X(M),o(null),m(Date.now())}catch(M){if(N!==k.current)return;o(M instanceof Error?M.message:String(M))}finally{N===k.current&&(x(!1),j(!1))}},[]);d.useEffect(()=>{f("initial")},[f]),d.useEffect(()=>{const C=setInterval(()=>{f("background")},1e4);return()=>clearInterval(C)},[f]);const v=d.useMemo(()=>{const C=s.trim().toLowerCase();return b.filter(N=>l!=="all"&&_(N.state)!==l?!1:C?`${N.name??""} ${N.handle??""} ${N.harness??""} ${N.project??""} ${N.branch??""}`.toLowerCase().includes(C):!0)},[s,b,l]),$={mode:r,density:u,query:s,stateFilter:l,loading:p,refreshing:g,error:a,lastLoadedAt:i,hasMesh:!!n,onRefresh:()=>{f("manual")}},w=r==="map"?e.jsxs("div",{className:"mesh-map-canvas",children:[n&&e.jsx(U,{mesh:n,agents:v}),p&&!n&&e.jsx("div",{className:"mesh-canvas-center",children:e.jsx("p",{className:"mesh-canvas-center-label",children:"Loading mesh…"})}),!p&&!n&&a&&e.jsxs("div",{className:"mesh-canvas-center",children:[e.jsx("p",{className:"mesh-canvas-center-label",children:a}),e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{f("manual")},children:"Try again"})]}),e.jsx(P,{...$})]}):e.jsxs("div",{className:"mesh-tree-page",children:[e.jsx(P,{...$}),p&&!n&&e.jsxs("div",{className:"sys-panel sys-state-card mesh-tree-state",children:[e.jsx("h3",{className:"sys-state-title",children:"Loading mesh status"}),e.jsx("p",{className:"sys-state-body",children:"Inspecting broker reachability and peer discovery inputs."})]}),!p&&!n&&a&&e.jsxs("div",{className:"sys-panel sys-state-card sys-state-card-error mesh-tree-state",children:[e.jsx("h3",{className:"sys-state-title",children:"Mesh status is unavailable"}),e.jsx("p",{className:"sys-state-body",children:a}),e.jsx("div",{className:"sys-inline-actions",children:e.jsx("button",{type:"button",className:"s-btn",onClick:()=>{f("manual")},children:"Try again"})})]}),n&&e.jsxs("section",{className:"mesh-tree-panel",children:[e.jsxs("div",{className:"mesh-tree-hint","aria-hidden":!0,children:[e.jsx("kbd",{children:"↑"}),e.jsx("kbd",{children:"↓"}),e.jsx("span",{children:"navigate"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"enter"}),e.jsx("span",{children:"pin"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"o"}),e.jsx("span",{children:"open"}),e.jsx("span",{className:"mesh-tree-hint-sep",children:"·"}),e.jsx("kbd",{children:"esc"}),e.jsx("span",{children:"clear"})]}),e.jsx(se,{agents:v,emptyTitle:b.length===0?h?"No agents on this machine":"No agents registered":"No agents match your filter",emptyBody:b.length===0?"Agents connected to this broker will appear here.":"Try clearing the search or switching the state pill back to All."})]})]}),R=Z();return e.jsxs("div",{className:"s-ops",children:[R?e.jsx("div",{className:"s-ops-header",children:e.jsx(G,{activeRoute:y,navigate:c})}):null,e.jsx("div",{className:"s-ops-body",children:w})]})}export{ls as MeshScreen};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/arc.es-CQBb-dVu.js","assets/index-DMiGbrBt.js","assets/index-DxGoC5l5.css"])))=>i.map(i=>d[i]);
2
- import{r as g,j as d,_ as j}from"./index-DMiGbrBt.js";const E=g.lazy(()=>j(()=>import("./arc.es-CQBb-dVu.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/arc.es-DPJ0xRV6.js","assets/index-sUomXsrf.js","assets/index-DITWsjFb.css"])))=>i.map(i=>d[i]);
2
+ import{r as g,j as d,_ as j}from"./index-sUomXsrf.js";const E=g.lazy(()=>j(()=>import("./arc.es-DPJ0xRV6.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.ArcDiagram})));function i(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.split(".")[0]}function S(t){const e=t.hostName?.trim();if(e&&e.toLowerCase()!=="localhost")return i(e)||e;const o=t.dnsName?.trim().replace(/\.$/,"");return o?i(o)||o:i(t.name)||t.name}function y(t){if(!t)return"";const e=t.replace(/^https?:\/\//,"").split("/")[0],[o]=e.split(":");return o.replace(/\.$/,"").toLowerCase()}function l(t){const e=y(t);return e?e.split(".")[0]??e:""}function B(t){return t.brokerUrl?i(t.brokerUrl):t.hostName?i(t.hostName):t.id.slice(0,10)}function I(t,e){return Math.abs(t)>=Math.abs(e)?t>=0?["right","left"]:["left","right"]:e>=0?["bottom","top"]:["top","bottom"]}function W(t,e){const o=l(e.hostName||e.name),c=l(t.localNode?.hostName||t.localNode?.name);return!!c&&o===c}function C(t,e){const o=new Set([l(t.hostName),l(t.name),...t.addresses.map(n=>y(n)),...t.addresses.map(n=>l(n))].filter(Boolean)),c=new Set([l(e.hostName),l(e.name),y(e.brokerUrl),l(e.brokerUrl)].filter(Boolean));for(const n of o)if(c.has(n))return!0;return!1}function L(t){if(!t.localNode)return null;const e=t.localNode.id,o=Object.values(t.nodes).filter(s=>s.id!==e),c=t.tailscale.peers.filter(s=>!W(t,s)).filter(s=>!o.some(u=>C(s,u))),n=[...o.map(s=>({kind:"mesh",peer:s})),...c.map(s=>({kind:"tailnet",peer:s}))],M=800,_=300,h=M/2,m=_/2,f={[e]:{x:h,y:m,size:"m"}},p={[e]:{icon:"Database",name:i(t.localNode.hostName)||t.localNode.name||"broker",subtitle:"this node",color:"violet"}},N=[];if(n.length===0)f.__placeholder={x:h+220,y:m,size:"m"},p.__placeholder={icon:"CircleDashed",name:"No peers yet",subtitle:"awaiting discovery",color:"zinc"},N.push({from:e,to:"__placeholder",fromAnchor:"right",toAnchor:"left",style:"pending"});else{const s=n.length,u=Math.min(170,100+s*10);n.forEach(({kind:r,peer:a},z)=>{const v=z/s*Math.PI*2-Math.PI/2,x=Math.round(h+u*Math.cos(v)),k=Math.round(m+u*Math.sin(v)),b=r==="mesh"?a.id:`tailnet:${a.id}`,A=r==="mesh"?i(a.hostName)||a.name||"peer":S(a)||"tailnet",D=r==="mesh"?B(a):a.online?a.addresses[0]??"tailnet only":"tailnet offline";f[b]={x,y:k,size:r==="mesh"?"m":"s"},p[b]={icon:r==="mesh"?"Database":"CircleDashed",name:A,subtitle:D,color:r==="mesh"?a.advertiseScope==="mesh"?"emerald":"zinc":a.online?"sky":"zinc"};const[w,P]=I(x-h,k-m);N.push({from:e,to:b,fromAnchor:w,toAnchor:P,style:r==="mesh"?a.advertiseScope==="mesh"?"mesh":"local":a.online?"tailnet":"tailnet-offline"})})}return{layout:{width:M,height:_},nodes:f,nodeData:p,connectors:N,connectorStyles:{mesh:{color:"emerald",strokeWidth:2,label:"mesh"},local:{color:"zinc",strokeWidth:1.5},tailnet:{color:"sky",strokeWidth:1.5,dashed:!0,label:"tailnet"},"tailnet-offline":{color:"zinc",strokeWidth:1.25,dashed:!0,label:"tailnet"},pending:{color:"zinc",strokeWidth:1.5,dashed:!0}}}}function U({mesh:t}){const e=g.useMemo(()=>L(t),[t]);return e?d.jsx("div",{className:"s-mesh-topology",children:d.jsx(g.Suspense,{fallback:d.jsx("div",{className:"s-mesh-topology-fallback"}),children:d.jsx(E,{data:e,className:"s-mesh-topology-canvas",mode:"light",theme:"cool",interactive:!0,showArcToggle:!1,defaultZoom:"fit",maxFitZoom:.95,hoverEffects:{dim:!0,lift:!0,glow:!0,highlightEdges:!0}})})}):null}export{U as MeshTopologyView};
@@ -1 +1 @@
1
- import{a as x}from"./api-h5zurxmi.js";import{j as o}from"./index-DMiGbrBt.js";const m=new Set(["md","markdown","mdx","mdown","mkd"]),g=new Set(["c","cc","cpp","cxx","h","hh","hpp","hxx","cjs","mjs","js","jsx","ts","tsx","py","pyw","pyi","rs","go","java","kt","kts","swift","cs","rb","php","lua","r","sh","bash","zsh","fish","ps1","bat","cmd","sql","prisma","json","jsonc","json5","yaml","yml","toml","xml","html","htm","xhtml","css","scss","sass","less","vue","svelte","astro","graphql","gql","zig","ex","exs","erl","hrl","hs","clj","cljs","cljc","dart","tf","hcl","nix","env","ini","cfg","conf","properties","txt","log","cmake","gradle","groovy","patch","diff","proto","wat"]),w=new Set(["dockerfile","containerfile","makefile","gemfile","rakefile","procfile","brewfile"]),y=new Set(["text/markdown","text/x-markdown","text/plain","text/javascript","text/typescript","text/css","text/html","text/yaml","text/toml","text/x-shellscript","application/json","application/javascript"]);function p(e){return e.trim().split(/[/\\]/).pop()?.toLowerCase()??""}function l(e){const t=p(e),s=t.lastIndexOf(".");return s>=0?t.slice(s+1):""}function j(e){return m.has(l(e))}function v(e){const t=p(e);return w.has(t)?!0:g.has(l(e))}function d(e){return j(e)||v(e)}function f(e,t){if(!d(t))return null;const s=l(t);if(m.has(s))return"text/markdown";switch(s){case"json":case"jsonc":case"json5":return"application/json";case"yaml":case"yml":return"text/yaml";case"toml":return"text/toml";case"html":case"htm":case"xhtml":return"text/html";case"css":case"scss":case"sass":case"less":return"text/css";case"js":case"jsx":case"mjs":case"cjs":return"text/javascript";case"ts":case"tsx":return"text/typescript";case"sh":case"bash":case"zsh":case"fish":return"text/x-shellscript"}const r=e.trim().toLowerCase();return y.has(r)?r:"text/plain"}function k(e,t){const s=e.trim().toLowerCase();return s.startsWith("image/")||s.startsWith("video/")||s==="text/markdown"||s==="text/x-markdown"?!0:t?f(s,t)?!0:!s||s==="application/octet-stream"?d(t):!1:!1}function b(e){const t=e.type.trim().toLowerCase();return t.startsWith("image/")||t.startsWith("video/")?t:f(t,e.name)??t}function u(e){return k(e.type,e.name)}function E(e){return b(e)}function O(e){return e?e.files.length>0||[...e.types].some(t=>t.toLowerCase()==="files")?!0:[...e.items].some(t=>t.kind==="file"):!1}function C(e){if(!e)return[];const t=[...e.files];if(t.length>0)return t;const s=[];for(const r of e.items){if(r.kind!=="file")continue;const a=r.getAsFile();a&&s.push(a)}return s}function M(e){return C(e).filter(u)}function D(e){return M(e)}function F(e){return new Promise((t,s)=>{const r=new FileReader;r.onload=()=>{const a=typeof r.result=="string"?r.result:"",i=a.indexOf(",");t(i>=0?a.slice(i+1):a)},r.onerror=()=>s(r.error??new Error("Could not read file.")),r.readAsDataURL(e)})}async function N(e){if(!u(e))throw new Error("Only markdown, code, image, and video files can be routed.");const t=await F(e);return x("/api/blobs",{method:"POST",body:JSON.stringify({data:t,mediaType:E(e),fileName:e.name})})}async function R(e){const t=e.filter(u);if(t.length===0)throw new Error("Drop markdown, code, an image, or a video clip to route.");return(await Promise.all(t.map(r=>N(r)))).map((r,a)=>({id:r.id,mediaType:r.mediaType,fileName:r.fileName??t[a]?.name,url:r.url}))}function A({label:e,items:t,activeIndex:s,placement:r="above",onPick:a,onActiveIndexChange:i}){return t.length===0?null:o.jsxs("div",{className:"s-msg-compose-suggest","data-placement":r,role:"listbox","aria-label":e,children:[o.jsx("div",{className:"s-msg-compose-suggest-label",children:e}),t.map((n,c)=>o.jsxs("button",{type:"button",role:"option","aria-selected":c===s,className:["s-msg-compose-suggest-item",c===s&&"s-msg-compose-suggest-item--active"].filter(Boolean).join(" "),onMouseDown:h=>{h.preventDefault(),a(c)},onMouseEnter:()=>i(c),children:[n.avatar?o.jsx("span",{className:"s-ops-avatar s-msg-compose-suggest-avatar",style:{"--size":"20px",background:n.avatar.color},"aria-hidden":"true",children:n.avatar.label}):null,o.jsx("span",{className:"s-msg-compose-suggest-token",children:n.token}),o.jsx("span",{className:"s-msg-compose-suggest-desc",children:n.description})]},n.id))]})}export{A as M,M as a,C as b,O as d,u as i,D as r,R as u};
1
+ import{a as x}from"./api-h5zurxmi.js";import{j as o}from"./index-sUomXsrf.js";const m=new Set(["md","markdown","mdx","mdown","mkd"]),g=new Set(["c","cc","cpp","cxx","h","hh","hpp","hxx","cjs","mjs","js","jsx","ts","tsx","py","pyw","pyi","rs","go","java","kt","kts","swift","cs","rb","php","lua","r","sh","bash","zsh","fish","ps1","bat","cmd","sql","prisma","json","jsonc","json5","yaml","yml","toml","xml","html","htm","xhtml","css","scss","sass","less","vue","svelte","astro","graphql","gql","zig","ex","exs","erl","hrl","hs","clj","cljs","cljc","dart","tf","hcl","nix","env","ini","cfg","conf","properties","txt","log","cmake","gradle","groovy","patch","diff","proto","wat"]),w=new Set(["dockerfile","containerfile","makefile","gemfile","rakefile","procfile","brewfile"]),y=new Set(["text/markdown","text/x-markdown","text/plain","text/javascript","text/typescript","text/css","text/html","text/yaml","text/toml","text/x-shellscript","application/json","application/javascript"]);function p(e){return e.trim().split(/[/\\]/).pop()?.toLowerCase()??""}function l(e){const t=p(e),s=t.lastIndexOf(".");return s>=0?t.slice(s+1):""}function j(e){return m.has(l(e))}function v(e){const t=p(e);return w.has(t)?!0:g.has(l(e))}function d(e){return j(e)||v(e)}function f(e,t){if(!d(t))return null;const s=l(t);if(m.has(s))return"text/markdown";switch(s){case"json":case"jsonc":case"json5":return"application/json";case"yaml":case"yml":return"text/yaml";case"toml":return"text/toml";case"html":case"htm":case"xhtml":return"text/html";case"css":case"scss":case"sass":case"less":return"text/css";case"js":case"jsx":case"mjs":case"cjs":return"text/javascript";case"ts":case"tsx":return"text/typescript";case"sh":case"bash":case"zsh":case"fish":return"text/x-shellscript"}const r=e.trim().toLowerCase();return y.has(r)?r:"text/plain"}function k(e,t){const s=e.trim().toLowerCase();return s.startsWith("image/")||s.startsWith("video/")||s==="text/markdown"||s==="text/x-markdown"?!0:t?f(s,t)?!0:!s||s==="application/octet-stream"?d(t):!1:!1}function b(e){const t=e.type.trim().toLowerCase();return t.startsWith("image/")||t.startsWith("video/")?t:f(t,e.name)??t}function u(e){return k(e.type,e.name)}function E(e){return b(e)}function O(e){return e?e.files.length>0||[...e.types].some(t=>t.toLowerCase()==="files")?!0:[...e.items].some(t=>t.kind==="file"):!1}function C(e){if(!e)return[];const t=[...e.files];if(t.length>0)return t;const s=[];for(const r of e.items){if(r.kind!=="file")continue;const a=r.getAsFile();a&&s.push(a)}return s}function M(e){return C(e).filter(u)}function D(e){return M(e)}function F(e){return new Promise((t,s)=>{const r=new FileReader;r.onload=()=>{const a=typeof r.result=="string"?r.result:"",i=a.indexOf(",");t(i>=0?a.slice(i+1):a)},r.onerror=()=>s(r.error??new Error("Could not read file.")),r.readAsDataURL(e)})}async function N(e){if(!u(e))throw new Error("Only markdown, code, image, and video files can be routed.");const t=await F(e);return x("/api/blobs",{method:"POST",body:JSON.stringify({data:t,mediaType:E(e),fileName:e.name})})}async function R(e){const t=e.filter(u);if(t.length===0)throw new Error("Drop markdown, code, an image, or a video clip to route.");return(await Promise.all(t.map(r=>N(r)))).map((r,a)=>({id:r.id,mediaType:r.mediaType,fileName:r.fileName??t[a]?.name,url:r.url}))}function A({label:e,items:t,activeIndex:s,placement:r="above",onPick:a,onActiveIndexChange:i}){return t.length===0?null:o.jsxs("div",{className:"s-msg-compose-suggest","data-placement":r,role:"listbox","aria-label":e,children:[o.jsx("div",{className:"s-msg-compose-suggest-label",children:e}),t.map((n,c)=>o.jsxs("button",{type:"button",role:"option","aria-selected":c===s,className:["s-msg-compose-suggest-item",c===s&&"s-msg-compose-suggest-item--active"].filter(Boolean).join(" "),onMouseDown:h=>{h.preventDefault(),a(c)},onMouseEnter:()=>i(c),children:[n.avatar?o.jsx("span",{className:"s-ops-avatar s-msg-compose-suggest-avatar",style:{"--size":"20px",background:n.avatar.color},"aria-hidden":"true",children:n.avatar.label}):null,o.jsx("span",{className:"s-msg-compose-suggest-token",children:n.token}),o.jsx("span",{className:"s-msg-compose-suggest-desc",children:n.description})]},n.id))]})}export{A as M,M as a,C as b,O as d,u as i,D as r,R as u};
@@ -0,0 +1 @@
1
+ import{j as e,r as a}from"./index-sUomXsrf.js";import{i as w,a as C}from"./conversation-model-C4yb6_FA.js";import{u as b,m as M,g as S}from"./Provider-tFc3jqZ4.js";import{b as A}from"./router-Dja9_ygK.js";import{l as I,i as B,s as E}from"./sessionRead-CvFz2RHv.js";import{u as L}from"./use-conversation-list-B1T6J_qE.js";import{u as R}from"./use-fleet-active-asks-DLofGhhK.js";import{ConversationScreen as D}from"./ConversationScreen-Dz2d_Z_F.js";import{P as O}from"./plus-C9lTjsgd.js";import"./colors-BtO5_zlx.js";import"./time-Dhsh_2EG.js";import"./api-h5zurxmi.js";import"./sse-CVoGDiKW.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-BlBQhpax.js";import"./DocumentFocusViewer-DU_9BHsD.js";import"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.js";import"./chevron-right-CyUa1zXx.js";import"./code-xml-05TD3uOC.js";import"./arrow-left-WjQIN9J6.js";import"./scout-voice-BZ4KqADJ.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-BhZZ5HEq.js";import"./MessageComposerSuggestions-zAUUcLOv.js";import"./NewChatComposer-B5FnPyzS.js";import"./runtime-picker-DOZpZOlt.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-lWOOKezu.js";import"./index-m6dFtY5f.js";import"./HarnessMark-Dm_qm1Ku.js";import"./NewChatOrigin--pHWUb4V.js";import"./agent-chat-Bfjd9y6c.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./terminal-sessions-D5CIR2OL.js";import"./ConversationComposer-BBNPa5S9.js";import"./message-markup-C8Nx04sP.js";import"./mentions-CY_wPZc5.js";import"./AgentDetailCard-DxxVkgT1.js";import"./AgentLiveActions-CZdAInEu.js";import"./terminal-takeover-X97KCSJk.js";import"./openContent-C6XO6kr5.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";import"./message-visibility-kJM8XcSG.js";import"./clipboard-e3fSpeo7.js";import"./AgentAvatar-CufDA4A-.js";import"./SpriteAvatar-CQs-jC-v.js";import"./agent-identity-xQHedtLl.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-DXMT-YXv.js";import"./BackToPicker-CkUmHuuo.js";import"./ConversationFeedRows-BuejHMCY.js";import"./ConversationPanels-DHCtilQF.js";import"./use-reduced-motion-Cvk-HRKg.js";import"./activity-WhBf3FXP.js";import"./message-circle-C5UZ6fO7.js";import"./tail-display-BdyoLvzY.js";import"./lane-edit-display-C_Aujldz.js";import"./tail-events-CTipUIli.js";import"./ConversationStatus-DSgdVofa.js";import"./conversation-icons-DohQL6GI.js";function nt({conversationId:s,navigate:c}){return s?e.jsx(D,{conversationId:s,navigate:c,showBackNav:!1}):e.jsx(P,{})}function P(){const{onlineCount:s,apiConnection:c,reload:j,route:N,agents:d,openContextCapture:k,navigate:u}=b(),{sessions:y,loading:p,loadError:n}=L(),[x]=a.useState(()=>I()),v=R(),t=c.status==="offline",i=A(N),f=a.useRef(!1),h=a.useMemo(()=>{const m=M(d,i);return[...S(y,m,i)].sort((g,o)=>(o.lastMessageAt??0)-(g.lastMessageAt??0))},[y,d,i]),r=a.useMemo(()=>{const m=h.filter(o=>!w(o));return m.find(o=>o.agentId?v.get(o.agentId)?.status==="needs_attention"&&B(o.lastMessageAt,o.id,x):!1)??m[0]},[h,v,x]);a.useEffect(()=>{f.current||p||n||t||r&&(f.current=!0,E(r.id),u({view:"messages",conversationId:r.id,...i?{machineId:i}:{}},{replace:!0}))},[r,p,n,t,i,u]);const l=!t&&!n&&(p||!!r);return e.jsx("div",{className:`s-conv-empty${t?" s-conv-empty--offline":""}`,children:e.jsxs("div",{className:"s-conv-empty-inner",children:[e.jsx($,{}),e.jsx("div",{className:"s-conv-empty-eyebrow",children:t?"Connection":"Conversations"}),e.jsx("p",{className:"s-conv-empty-title",children:t?"Scout server offline":l?"Opening your latest conversation":n?"Chats unavailable":"Nothing open yet"}),e.jsx("p",{className:"s-conv-empty-detail",children:t?"Start or restart Scout services. Chats and context will appear when the server responds.":l?V(r):n||"Start a chat by choosing an agent and sending the first message."}),t||n?e.jsx("button",{type:"button",className:"s-conv-empty-action",onClick:()=>{j()},children:"Retry connection"}):l?null:e.jsxs("button",{type:"button",className:"s-conv-empty-new",onClick:()=>k(),children:[e.jsx(O,{size:16,"aria-hidden":"true"}),"New chat"]}),e.jsxs("div",{className:"s-conv-empty-ambient",children:[e.jsx("span",{className:"s-conv-empty-ambient-dot","aria-hidden":"true"}),t?"waiting for server":`${s} ${s===1?"agent":"agents"} active`]})]})})}function V(s){return s?C(s):"Finding where you left off."}function $(){return e.jsxs("svg",{className:"s-conv-empty-mesh",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"14",y1:"20",x2:"24",y2:"46"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"36",y2:"12"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"24",y1:"46",x2:"50",y2:"54"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"50",y1:"54",x2:"58",y2:"24"}),e.jsx("line",{className:"s-conv-empty-mesh-link",x1:"36",y1:"12",x2:"50",y2:"54"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"14",cy:"20",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"58",cy:"24",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"24",cy:"46",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node",cx:"50",cy:"54",r:"2.5"}),e.jsx("circle",{className:"s-conv-empty-mesh-node s-conv-empty-mesh-node--accent",cx:"36",cy:"12",r:"3.5"})]})}export{nt as MessagesScreen};