@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 i,j as e}from"./index-sUomXsrf.js";import{u as ct}from"./Provider-tFc3jqZ4.js";import{o as $e}from"./openContent-C6XO6kr5.js";import{a as B}from"./api-h5zurxmi.js";import{u as rt}from"./sse-CVoGDiKW.js";import{u as lt}from"./tail-events-CTipUIli.js";import{n as ot,a as dt,s as Me,c as _e}from"./colors-BtO5_zlx.js";import{A as ut}from"./AgentLiveActions-CZdAInEu.js";import{i as mt}from"./message-visibility-kJM8XcSG.js";import{o as pt,q as ht,s as vt,m as xt,c as Be,u as ft}from"./conversation-model-C4yb6_FA.js";import{c as jt,e as gt,t as W,f as oe}from"./time-Dhsh_2EG.js";import{b as Nt}from"./router-Dja9_ygK.js";import{T as yt}from"./TmuxPeek-Dz1gJ2pU.js";import{S as It}from"./scroll-text-BIYf6g6N.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"./index-BWHgHrtv.js";import"./terminal-takeover-X97KCSJk.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";import"./terminal-sessions-D5CIR2OL.js";/* empty css */import"./refresh-cw-D8PFyhUa.js";const wt=20;function de(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.split(/[\\/]/).filter(Boolean).at(-1)??s:null}function ue(t){const s=t?.trim();return s?s.length>18?`${s.slice(0,8)}...${s.slice(-6)}`:s:null}function b(t){const s=new Set,a=[];for(const c of t){const m=c?.trim();if(!m)continue;const h=m.toLowerCase();s.has(h)||(s.add(h),a.push(m))}return a}function Ue(t,s){const a=t?.trim().replace(/[\\/]+$/,""),c=s.trim().replace(/[\\/]+$/,"");if(!a||!c)return!1;if(a===c)return!0;if(c.startsWith("~/")){const m=c.slice(1);if(a.endsWith(m)||a.includes(`${m}/`))return!0}if(a.startsWith("~/")){const m=a.slice(1);if(c.endsWith(m)||c.includes(`${m}/`))return!0}return a.startsWith(`${c}/`)||c.startsWith(`${a}/`)}function Fe(t,s){const a=t?.trim().toLowerCase(),c=s.trim().toLowerCase();return!a||!c?!1:a.includes(c)||c.includes(a)}function Ve(t,s){const a=t?.trim().toLowerCase(),c=s.trim().toLowerCase();return!a||!c?!1:a===c}function St(t){const{activeSessionId:s,agent:a,sessionMeta:c}=t,m=b([s,a?.harnessSessionId]),h=b([a?.cwd,a?.projectRoot,c?.workspaceRoot]),r=b([a?.project,de(a?.cwd),de(a?.projectRoot),de(c?.workspaceRoot)]).filter(U=>U.length>2),o=b([...m.slice(0,2),...r.slice(0,2)]).join("|");return{sessionIds:m,paths:h,projects:r,query:o}}function he(t,s){return!!(s.sessionIds.some(a=>Fe(t.sessionId,a))||s.paths.some(a=>Ue(t.cwd,a))||s.projects.some(a=>Ve(t.project,a)))}function Tt(t,s){const a=s.filter(r=>he(r,t)),c=b(a.filter(r=>t.sessionIds.some(o=>Fe(r.sessionId,o))).map(r=>r.sessionId));if(c[0])return c[0];const m=b(a.filter(r=>t.paths.some(o=>Ue(r.cwd,o))).map(r=>r.sessionId));if(m[0])return m[0];const h=b(a.filter(r=>t.projects.some(o=>Ve(r.project,o))).map(r=>r.sessionId));return h[0]?h[0]:t.paths[0]?t.paths[0]:t.sessionIds[0]?t.sessionIds[0]:t.projects[0]?t.projects[0]:t.query}function X(t,s){const a=new Map;for(const c of[...s,...t])a.set(c.id,c);return[...a.values()].sort((c,m)=>jt(c.ts,m.ts)).slice(0,wt)}function bt(t){return t==="tool-result"?"tool result":t}function kt(t){const s=t.replace(/\s+/g," ").trim();return s.length<=180?s:`${s.slice(0,177)}...`}const At={direct:"Conversation",channel:"Conversation",group_direct:"Conversation",thread:"Thread"},Ct=1800,Et=4800,We=2,Lt=120,Rt=650,Pt=1800;function me(t,s){try{return JSON.stringify(t)===JSON.stringify(s)?t:s}catch{return s}}function ze(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.split(/[\\/]/).filter(Boolean).at(-1)??s:null}function $t(t){if(!t)return null;const s=t.replace(/[\\/]+$/,"");return s?s.replace(/^\/Users\/[^/]+(?=\/|$)/,"~"):null}function z(t){switch(t){case"queued":return"Queued";case"waking":return"Waking";case"waiting":return"Thinking";case"running":return"Working";default:return t.replace(/_/g," ")}}function Ws(){const{route:t,agents:s,navigate:a,apiConnection:c,reload:m}=ct(),h=Nt(t),r=t.view==="conversation"||t.view==="messages"?t.conversationId??null:null,[o,U]=i.useState(null),[E,ve]=i.useState([]),[G,xe]=i.useState(null),[He,F]=i.useState(!1),V=i.useCallback(async()=>{if(!r){U(null),ve([]),xe(null),F(!0);return}try{const[n,l,f]=await Promise.all([B(`/api/session/${encodeURIComponent(r)}`).catch(()=>null),B(`/api/flights?conversationId=${encodeURIComponent(r)}`).catch(()=>[]),B(`/api/messages?conversationId=${encodeURIComponent(r)}&limit=8`).catch(()=>[])]);U(p=>me(p,n)),ve(p=>me(p,l??[])),xe(p=>me(p,f?.filter(_=>!mt(_)).sort((_,it)=>gt(_.createdAt,it.createdAt)).at(-1)??null)),F(!0)}catch{F(!0)}},[r]);i.useEffect(()=>{F(!1),V()},[V]);const j=o?.agentId??null,d=i.useMemo(()=>j?s.find(n=>n.id===j)??null:null,[s,j]),H=d?.id??null,fe=pt(o),ee=ht({resolvedAgentId:H,sessionId:fe,machineId:h}),[je,ge]=i.useState(null),[L,te]=i.useState([]),[w,se]=i.useState([]),Ne=i.useRef([]),S=i.useRef(null),q=i.useRef(null),x=i.useRef([]),g=i.useRef(null),N=i.useRef(null),R=i.useRef(new Set),O=i.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null),q.current=null},[]),P=i.useCallback(()=>{if(!r)return;const n=Date.now(),l=q.current??n;q.current=l;const p=n-l>=Et?0:Ct;S.current!==null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{S.current=null,q.current=null,V()},p)},[r,V]);i.useEffect(()=>O,[O]),i.useEffect(()=>{if(ge(null),!H)return;let n=!1;return B(`/api/agents/${encodeURIComponent(H)}/session-catalog`).then(l=>{n||ge(l)}).catch(()=>{}),()=>{n=!0}},[H]);const qe=vt({name:d?.name,agentName:o?.agentName,id:j,title:o?.title}),ye=d?xt(d)??Be(d.id)??d.id:j?Be(j)??j:null,u=i.useMemo(()=>E.filter(ft).sort((n,l)=>(l.startedAt??0)-(n.startedAt??0))[0]??null,[E]);i.useEffect(()=>{R.current=new Set(E.map(n=>n.invocationId))},[E]),i.useEffect(()=>{O(),R.current.clear()},[O,r]),rt(n=>{if(r){if(n.kind==="message.posted"){n.payload?.message?.conversationId===r&&P();return}if(n.kind==="conversation.upserted"){n.payload?.conversation?.id===r&&P();return}if(n.kind==="invocation.requested"){const l=n.payload?.invocation;if(l?.conversationId===r){R.current.add(l.id),P();return}!l?.conversationId&&j&&l?.targetAgentId===j&&(R.current.add(l.id),P());return}if(n.kind==="flight.updated"){const l=n.payload?.flight;if(!l)return;(u?.id===l.id||u?.invocationId===l.invocationId||R.current.has(l.invocationId)||E.some(p=>p.id===l.id||p.invocationId===l.invocationId))&&P()}}});const v=je?.activeSessionId??d?.harnessSessionId??fe??o?.harnessSessionId??null,I=d?.harnessSessionId??o?.harnessSessionId??null,k=d?.harnessLogPath??null,y=i.useMemo(()=>St({activeSessionId:v,agent:d,sessionMeta:o}),[v,d,o]),ne=JSON.stringify({sessionIds:y.sessionIds,paths:y.paths,projects:y.projects}),$=y.sessionIds.length>0||y.paths.length>0||y.projects.length>0,D=i.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),N.current!==null&&(window.clearInterval(N.current),N.current=null),x.current=[]},[]),K=i.useCallback(()=>{D()},[D]),Ie=i.useCallback(()=>{if(N.current!==null||(g.current!==null&&(window.clearTimeout(g.current),g.current=null),x.current.length===0))return;const l=()=>{const f=x.current.slice(0,We);x.current=x.current.slice(We),f.length>0&&se(p=>X(p,f)),!(x.current.length>0)&&N.current!==null&&(window.clearInterval(N.current),N.current=null)};l(),x.current.length>0&&(N.current=window.setInterval(l,Lt))},[]),we=i.useCallback(n=>{N.current===null&&g.current===null&&(g.current=window.setTimeout(()=>{g.current=null,Ie()},n))},[Ie]);i.useEffect(()=>{Ne.current=w},[w]),i.useEffect(()=>D,[D]),i.useEffect(()=>{K(),te([]),se([])},[K,ne]),i.useEffect(()=>{if(!$)return;let n=!1;const l=new URLSearchParams({limit:"180",transcripts:"true"});return B(`/api/tail/recent?${l.toString()}`).then(f=>{if(n)return;const p=(f.events??[]).filter(_=>he(_,y));te(X([],p))}).catch(()=>{}),()=>{n=!0}},[$,ne]),lt(i.useCallback(n=>{$&&he(n,y)&&te(l=>X(l,[n]))},[$,ne])),i.useEffect(()=>{if(L.length===0){K(),se([]);return}const n=Ne.current,l=new Set([...n.map(p=>p.id),...x.current.map(p=>p.id)]),f=L.filter(p=>!l.has(p.id));f.length!==0&&(x.current=X(x.current,f),x.current.length>0&&we(n.length===0?Rt:Pt))},[we,K,L]);const ae=i.useMemo(()=>w.flatMap(Bt).slice(0,5),[w]);if(!r)return e.jsx(Mt,{apiOffline:c.status==="offline",onRetry:()=>{m()}});if(!He)return e.jsx("div",{className:"ctx-panel ctx-panel--conversation",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsx("div",{className:"ctx-panel-empty-hint",children:"Loading conversation…"})})});const Oe=o?.kind?At[o.kind]??o.kind:"Conversation",J=o?.workspaceRoot??null,ie=ze(J),Q=$t(J),Se=o?.currentBranch??null,ce=d?.harness??o?.harness??null,Y=o?.lastMessageAt??G?.createdAt??null,Te=o?.messageCount??null,be=o?o.participantIds.filter(n=>n!=="operator").length+1:null,A=d?.state??null,De=ot(A),ke=G?.body?.trim()||o?.preview?.trim()||null,Ae=G?.actorName??null,Ce=ue(v),M=v??I,Ee=ue(M),Ke=ue(I),Le=!!(I&&I!==M),Re=[ce,d?.transport].filter(Boolean).join(" · "),Je=!!(v||I||k),T=!!(d?.terminalSurface?.backend==="tmux"||d?.transport==="tmux"&&d.harnessSessionId),C=!!(u||dt(A,d)),Qe=C?u?z(u.state):"In motion":"At rest",Ye=u?.summary?.trim()??(Y?`Last update ${W(Y)??"recently"}`:"No recent activity recorded"),re=[Se?`branch ${Se}`:null,ce,d?.transport].filter(Boolean),Ze=!!(ie||Q||re.length>0),Xe=C?"Live activity":T?"Terminal":"Activity",le=u?.summary?.trim()??(v&&!T?"Terminal session is live.":w.length>0&&!T?"Streaming matching Tail events.":null),Z=Tt(y,L),Ge=!!(d&&(u||v||L.length>0||T)),et=!T,tt=v?T?"Terminal session":"Trace session":u?"Session starting":"Session context",st=v?Ee??v:u?z(u.state):"Waiting for a session id",Pe=v?[ce,d?.transport,u?z(u.state):null].filter(Boolean).join(" · "):u?.summary?.trim()??le??null,nt=()=>{ee&&$e(a,ee,{returnTo:t})},at=()=>{$e(a,{view:"ops",mode:"tail",...Z?{tailQuery:Z}:{}},{returnTo:t})};return e.jsxs("div",{className:"ctx-panel ctx-panel--conversation",children:[e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-summary",children:[e.jsx("div",{className:"ctx-panel-section-label",children:Oe}),e.jsxs("div",{className:"ctx-panel-conversation-card",children:[e.jsx("div",{className:"ctx-panel-conversation-title",children:qe}),ye&&e.jsxs("div",{className:"ctx-panel-conversation-handle",children:["@",ye]}),e.jsxs("div",{className:"ctx-panel-conversation-state",children:[e.jsx("span",{className:"ctx-panel-conversation-state-dot",style:{background:Me(A)}}),e.jsx("span",{children:_e(A)})]})]})]}),u&&e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Now"}),e.jsxs("div",{className:"ctx-panel-conversation-flight",children:[e.jsxs("div",{className:"ctx-panel-conversation-flight-row",children:[e.jsx("span",{className:"ctx-panel-conversation-flight-label",children:z(u.state)}),u.startedAt&&e.jsx("span",{className:"ctx-panel-conversation-flight-time",children:W(u.startedAt)})]}),u.summary&&e.jsx("div",{className:"ctx-panel-conversation-flight-summary",children:u.summary})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Workspace"}),Ze?e.jsxs("div",{className:"ctx-panel-workspace-card",children:[e.jsxs("div",{className:"ctx-panel-workspace-head",children:[e.jsx("div",{className:"ctx-panel-workspace-kicker",children:"Project"}),e.jsx("div",{className:"ctx-panel-workspace-title",title:J??ie??void 0,children:ie??"Unscoped workspace"})]}),Q&&e.jsx("div",{className:"ctx-panel-workspace-path",title:J??Q,children:Q}),re.length>0&&e.jsx("div",{className:"ctx-panel-workspace-strip",children:re.map(n=>e.jsx("span",{className:"ctx-panel-workspace-chip",children:n},n))})]}):e.jsx("div",{className:"ctx-panel-empty",children:"No workspace metadata yet"})]}),Je&&e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Session"}),e.jsxs("div",{className:"ctx-panel-session-card",children:[e.jsx("div",{className:"ctx-panel-session-head",children:e.jsxs("div",{className:"ctx-panel-session-primary",children:[Re&&e.jsx("div",{className:"ctx-panel-session-kind",children:Re}),M&&e.jsx("div",{className:"ctx-panel-session-id",title:M,children:Ee??M})]})}),(Le||k)&&e.jsxs("div",{className:"ctx-panel-session-meta",children:[Le&&I&&e.jsxs("div",{className:"ctx-panel-session-meta-item",children:[e.jsx("span",{children:"Harness session"}),e.jsx("strong",{title:I,children:Ke??I})]}),k&&e.jsxs("div",{className:"ctx-panel-session-meta-item",children:[e.jsx("span",{children:"Harness log"}),e.jsx("strong",{title:k,children:ze(k)??k})]})]})]})]}),e.jsxs("section",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Activity"}),e.jsxs("div",{className:`ctx-panel-activity-card${C?" ctx-panel-activity-card--active":""}`,children:[e.jsxs("div",{className:"ctx-panel-activity-head",children:[e.jsx("span",{className:"ctx-panel-activity-dot",style:{background:C?"var(--green)":Me(A)}}),e.jsxs("div",{className:"ctx-panel-activity-main",children:[e.jsx("div",{className:"ctx-panel-activity-title",children:Qe}),e.jsx("div",{className:"ctx-panel-activity-sub",title:Y?oe(Y):void 0,children:Ye})]})]}),u&&e.jsxs("div",{className:"ctx-panel-activity-ledger",children:[e.jsx("span",{className:"ctx-panel-activity-ledger-label",children:z(u.state)}),u.startedAt&&e.jsx("span",{className:"ctx-panel-activity-ledger-time",title:oe(u.startedAt),children:W(u.startedAt)})]}),e.jsxs("div",{className:"ctx-panel-activity-facts",children:[typeof Te=="number"&&e.jsx(pe,{label:"Messages",value:`${Te}`}),typeof be=="number"&&e.jsx(pe,{label:"People",value:`${be}`}),De&&e.jsx(pe,{label:"Agent",value:_e(A)})]})]})]}),ke&&e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-preview",children:[e.jsx("div",{className:"ctx-panel-section-label",children:Ae?`Latest · ${Ae}`:"Latest"}),e.jsx("div",{className:"ctx-panel-conversation-preview-body",children:ke})]}),Ge&&d&&e.jsxs("section",{className:"ctx-panel-section ctx-panel-conversation-live-section",children:[e.jsxs("div",{className:"ctx-panel-section-label",children:[e.jsx("span",{children:Xe}),Ce&&e.jsx("span",{className:"ctx-panel-live-session",title:v??void 0,children:Ce})]}),e.jsxs("div",{className:`ctx-panel-live-card${C?" ctx-panel-live-card--active":""}`,children:[e.jsxs("div",{className:`ctx-panel-live-session-card${C?" ctx-panel-live-session-card--active":""}`,children:[e.jsxs("div",{className:"ctx-panel-live-session-copy",children:[e.jsx("span",{children:tt}),e.jsx("strong",{title:v??void 0,children:st}),Pe&&e.jsx("small",{children:Pe})]}),e.jsx("div",{className:"ctx-panel-live-session-pulse","aria-hidden":"true",children:e.jsx("span",{})})]}),e.jsx(ut,{agent:d,catalog:je,navigate:a,returnTo:t,variant:"compact",className:"ctx-panel-live-actions"}),le&&e.jsx("div",{className:"ctx-panel-live-summary",children:le}),T&&e.jsx(yt,{agentId:d.id,lines:24,columns:132,className:"ctx-panel-tmux-peek--conversation"}),ae.length>0&&e.jsxs("div",{className:"ctx-panel-live-files","aria-live":"polite",children:[e.jsxs("div",{className:"ctx-panel-live-files-label",children:[e.jsx("span",{children:"Files"}),e.jsx("strong",{children:ae.length})]}),e.jsx("ol",{className:"ctx-panel-live-file-list",children:ae.map(n=>e.jsxs("li",{className:`ctx-panel-live-file ctx-panel-live-file--${n.tone}`,title:`${n.path} · ${n.verb}`,children:[e.jsx("span",{className:"ctx-panel-live-file-mark",children:n.mark}),e.jsx("span",{className:"ctx-panel-live-file-path",children:Ft(n.path)}),e.jsx("span",{className:"ctx-panel-live-file-time",children:W(n.ts)})]},`${n.eventId}:${n.path}`))})]}),et&&e.jsx("div",{className:"ctx-panel-live-stream","aria-live":"polite",children:w.length>0?e.jsx("ol",{className:"ctx-panel-live-events",children:w.map(n=>e.jsxs("li",{className:"ctx-panel-live-event",children:[e.jsx("span",{className:"ctx-panel-live-event-kind",children:bt(n.kind)}),e.jsx("span",{className:"ctx-panel-live-event-summary",children:kt(n.summary)}),e.jsx("span",{className:"ctx-panel-live-event-time",title:oe(n.ts),children:W(n.ts)})]},n.id))}):e.jsx("div",{className:"ctx-panel-live-stream-empty",children:"Waiting for matching Tail events"})}),$&&e.jsxs("button",{type:"button",className:"ctx-panel-live-tail-button",onClick:at,title:Z?`Tail filter: ${Z}`:"Open Tail",children:[e.jsx(It,{size:13,strokeWidth:1.9,"aria-hidden":"true"}),e.jsx("span",{children:"Tail"})]})]})]}),ee&&e.jsx("section",{className:"ctx-panel-section ctx-panel-conversation-profile-section",children:e.jsxs("button",{type:"button",className:"ctx-panel-roster-button ctx-panel-conversation-profile-button",onClick:nt,children:[e.jsx("span",{className:"ctx-panel-roster-label",children:d?"Open agent profile":"Open session trace"}),e.jsx("span",{className:"ctx-panel-roster-count",children:e.jsx("span",{children:"→"})})]})})]})}function Mt({apiOffline:t,onRetry:s}){return e.jsx("div",{className:"ctx-panel ctx-panel--conversation",children:e.jsx("div",{className:"ctx-panel-empty-state",children:e.jsxs("div",{className:"ctx-panel-empty-card","data-tone":t?"error":"neutral",children:[e.jsx("div",{className:"ctx-panel-empty-card-title",children:t?"Context unavailable":"No conversation selected"}),e.jsx("div",{className:"ctx-panel-empty-card-detail",children:t?"Scout context will load after the server reconnects.":"Select a chat to inspect participants, sessions, and recent activity."}),t&&e.jsx("button",{type:"button",className:"ctx-panel-empty-card-action",onClick:s,children:"Retry"})]})})})}function pe({label:t,value:s}){return e.jsxs("div",{className:"ctx-panel-fact",children:[e.jsx("span",{className:"ctx-panel-fact-value",children:s}),e.jsx("span",{className:"ctx-panel-fact-label",children:t})]})}const _t=/(?:["'`])?((?:~|\/|\.{1,2}\/|[A-Za-z0-9_.-]+\/)[^\s"'`),;]+?\.(?:ts|tsx|js|jsx|mjs|cjs|css|scss|swift|md|json|jsonc|yml|yaml|toml|sql|py|rs|go|sh|html|m|mm))(?:["'`])?/gi;function Bt(t){const s=new Set,a=[],c=Wt(t.summary);for(const m of t.summary.matchAll(_t)){const h=m[1]?.trim();if(!h)continue;const r=h.toLowerCase();s.has(r)||(s.add(r),a.push({eventId:t.id,path:h,verb:c,mark:Ut(c),tone:zt(c),ts:t.ts}))}return a}function Wt(t){return/\b(created|create|wrote|write|edited|edit|modified|modify|updated|update|changed|change|patched|patch)\b/i.test(t)?"changed":/\b(read|opened|viewed|cat|sed)\b/i.test(t)?"read":"touched"}function zt(t){return t==="changed"?"changed":t==="read"?"read":"touched"}function Ut(t){return t==="changed"?"+":t==="read"?"r":"·"}function Ft(t){const s=t.replace(/[\\/]+$/g,""),a=s.split(/[\\/]/).filter(Boolean);return a.length<=2?s:`${a.at(-2)}/${a.at(-1)}`}export{Ws as ConversationInspector};
@@ -0,0 +1 @@
1
+ import{r as p,j as s}from"./index-sUomXsrf.js";import{u as R,s as v,a as b}from"./mesh-view-store-D14ihwkF.js";import{u as E}from"./local-agents-C7fDHLVC.js";import{n as _,b as B,a as P}from"./colors-BtO5_zlx.js";import{a as g}from"./api-h5zurxmi.js";import{t as U}from"./time-Dhsh_2EG.js";/* empty css *//* empty css */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"./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";function D(e){return e.issues.some(t=>t.code==="mesh_loopback")?"loopback":e.identity.discoverable?"discoverable":e.tailscale.available?e.tailscale.running?"local-only":"tailnet-stopped":"unavailable"}function F(e){const t=new Map;for(const i of e){const r=(i.harness??i.agentClass??"agent").toLowerCase(),c=t.get(r)??{total:0,working:0};c.total+=1,P(i.state)&&(c.working+=1),t.set(r,c)}return Array.from(t.entries()).map(([i,r])=>({label:i,total:r.total,working:r.working})).sort((i,r)=>r.total-i.total).slice(0,6)}function S(e){return e?e.replace(/^https?:\/\//,"").split("/")[0]??e:"Unavailable"}function z(e){return e.split("/")[0]}function H(e){return new Promise(t=>window.setTimeout(t,e))}async function T(e,t){let i=null,r=null;for(let c=0;c<=t.attempts;c+=1){try{if(i=await g("/api/mesh"),v(i),e(i))return i}catch(u){r=u}c<t.attempts&&await H(t.intervalMs)}if(i)return i;throw r instanceof Error?r:new Error("Mesh status is temporarily unavailable.")}function W(e){return e.issues.find(t=>t.code==="local_only"||t.code==="mesh_loopback"||t.code==="tailscale_stopped")?.summary??null}function Es(){const{meshSnapshot:e,selectedId:t,selectedType:i,probeCache:r}=R(),{agents:c}=E(),[u,f]=p.useState(!1),[C,k]=p.useState(!1),[x,h]=p.useState(null),A=p.useCallback(async()=>{f(!0),h({tone:"info",text:"Restarting broker with mesh discovery enabled..."});try{const l=await g("/api/mesh/announce",{method:"POST",body:"{}"});v(l);const a=l.identity.discoverable?l:await T(n=>n.identity.discoverable,{attempts:6,intervalMs:750});a.identity.discoverable?h({tone:"success",text:`Discoverable at ${S(a.identity.announceUrl??a.brokerUrl)}.`}):h({tone:"warning",text:W(a)??"Scout restarted the broker, but it is not discoverable yet."})}catch(l){h({tone:"error",text:l instanceof Error?l.message:String(l)})}finally{f(!1)}},[]),M=p.useCallback(async()=>{k(!0),h({tone:"info",text:"Opening Tailscale and waiting for the backend..."});try{const l=await g("/api/mesh/tailscale",{method:"POST",body:JSON.stringify({action:"open_app"})});v(l);const a=l.tailscale.running?l:await T(n=>n.tailscale.running,{attempts:12,intervalMs:1e3});a.tailscale.running?h({tone:"success",text:`Tailscale is running with ${a.tailscale.onlineCount} online peer${a.tailscale.onlineCount===1?"":"s"}.`}):h({tone:"warning",text:`Tailscale opened, but the backend is still ${a.tailscale.backendState??"not running"}. Finish startup or sign-in in Tailscale.app.`})}catch(l){h({tone:"error",text:l instanceof Error?l.message:String(l)})}finally{k(!1)}},[]),y=p.useMemo(()=>{const l={total:c.length,working:0,ready:0,notReady:0};for(const a of c){const n=_(a.state);n==="in_turn"||n==="in_flight"?l.working+=1:n==="callable"?l.ready+=1:l.notReady+=1}return l},[c]),w=p.useMemo(()=>F(c),[c]);if(!e)return s.jsx("div",{className:"sys-inspector-empty",children:s.jsx("p",{children:"Loading mesh…"})});if(t?.startsWith("tailnet:")&&i==="node"){const l=t.slice(8),a=e.tailscale.peers.find(m=>m.id===l),n=r[t]??null,d=a?.addresses?.[0]?z(a.addresses[0]):null,N=a?.hostName?.split(".")[0]??a?.hostName??"Tailnet peer";return s.jsxs("div",{className:"sys-inspector-content",children:[s.jsxs("div",{className:"sys-inspector-head",children:[s.jsx("h3",{className:"sys-inspector-title",children:N}),s.jsx("span",{className:`sys-chip sys-chip-${a?.online?"success":"failed"}`,children:a?.online?"Online":"Offline"})]}),s.jsxs("div",{className:"sys-detail-grid",children:[d&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Address"}),s.jsx("code",{className:"sys-detail-value",children:d})]}),a?.os&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Platform"}),s.jsx("span",{className:"sys-detail-value",children:a.os})]}),n?.result?.node?.meshId&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Mesh ID"}),s.jsxs("code",{className:"sys-detail-value",children:[n.result.node.meshId.slice(0,14),"…"]})]}),n?.result?.node?.name&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Node name"}),s.jsx("span",{className:"sys-detail-value",children:n.result.node.name})]})]}),(!n||n.status==="loading")&&s.jsx("div",{className:"sys-banner sys-banner-muted",style:{marginTop:8},children:s.jsx("span",{children:"Connecting to Scout broker…"})}),n?.status==="error"&&s.jsxs("div",{className:"sys-banner sys-banner-warning",style:{marginTop:8},children:[s.jsx("strong",{children:"Broker unreachable."}),s.jsx("span",{children:n.result?.error??"Could not reach the remote broker."})]}),n?.status==="done"&&n.result?.node?.capabilities?.length&&s.jsxs("div",{style:{marginTop:10},children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Capabilities"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:n.result.node.capabilities.map(m=>s.jsx("span",{className:"sys-chip sys-chip-neutral",children:m},m))})]}),n?.status==="done"&&n.result?.home&&s.jsxs("div",{style:{marginTop:14},children:[s.jsxs("div",{className:"sys-inspector-section-label",children:["Agents — ",n.result.home.agents.length," registered"]}),n.result.home.agents.length===0?s.jsx("div",{className:"sys-list-empty",style:{marginTop:4},children:s.jsx("p",{children:"No agents registered on this broker."})}):s.jsx("div",{className:"mesh-agent-table",style:{marginTop:4},children:n.result.home.agents.map(m=>{const j=B(m.state);return s.jsxs("div",{className:"mesh-detail-agent",style:{padding:"4px 0"},children:[s.jsx("span",{className:`mesh-detail-dot mesh-detail-dot--${j}`}),s.jsxs("div",{className:"mesh-detail-agent-body",children:[s.jsx("span",{className:"mesh-detail-agent-name",style:{fontSize:12},children:m.title}),m.activeTask&&s.jsx("span",{className:"mesh-detail-agent-task",children:m.activeTask})]}),s.jsx("span",{className:`mesh-detail-agent-state mesh-detail-agent-state--${j}`,children:m.statusLabel||j})]},m.id)})})]}),s.jsx("button",{type:"button",className:"s-btn",style:{marginTop:14},onClick:()=>b(null,null),children:"Clear selection"})]})}if(t&&i==="node"){const a=Object.values(e.nodes).find(d=>d.id===t)??(e.localNode?.id===t?e.localNode:null),n=e.localNode?.id===t;return a?s.jsxs("div",{className:"sys-inspector-content",children:[s.jsxs("div",{className:"sys-inspector-head",children:[s.jsx("h3",{className:"sys-inspector-title",children:a.hostName?.split(".")[0]??a.name??"Node"}),n&&s.jsx("span",{className:"sys-chip sys-chip-neutral",children:"this broker"})]}),s.jsxs("div",{className:"sys-detail-grid",children:[s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Node ID"}),s.jsxs("code",{className:"sys-detail-value",children:[a.id.slice(0,16),"…"]})]}),a.brokerUrl&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Broker URL"}),s.jsx("code",{className:"sys-detail-value",children:S(a.brokerUrl)})]}),a.hostName&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Host"}),s.jsx("span",{className:"sys-detail-value",children:a.hostName})]}),!n&&"lastSeenAt"in a&&typeof a.lastSeenAt=="number"&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Last seen"}),s.jsx("span",{className:"sys-detail-value",children:U(a.lastSeenAt)})]}),!n&&s.jsxs("div",{className:"sys-detail-card",children:[s.jsx("span",{className:"sys-detail-label",children:"Scope"}),s.jsx("span",{className:"sys-detail-value",children:a.advertiseScope==="mesh"?"Announced to mesh":"Local only"})]})]}),n&&e.issues.length>0&&s.jsx("div",{className:"sys-issue-grid",style:{marginTop:12},children:e.issues.map((d,N)=>s.jsxs("article",{className:`sys-issue-card sys-issue-card-${d.severity==="error"?"error":"warning"}`,children:[s.jsx("div",{className:"sys-issue-head",children:s.jsx("h3",{className:"sys-issue-title",children:d.title})}),s.jsx("p",{className:"sys-issue-body",children:d.summary}),d.actionCommand&&s.jsx("div",{className:"sys-issue-action",children:s.jsx("code",{className:"sys-code-inline",children:d.actionCommand})})]},N))}),s.jsx("button",{type:"button",className:"s-btn",style:{marginTop:12},onClick:()=>b(null,null),children:"Clear selection"})]}):s.jsxs("div",{className:"sys-inspector-empty",children:[s.jsx("p",{children:"Node not found."}),s.jsx("button",{type:"button",className:"s-btn",onClick:()=>b(null,null),children:"Clear"})]})}const o=e,L=D(o),$=Object.values(o.nodes).filter(l=>l.id!==o.localNode?.id).length,I=o.tailscale.onlineCount??0,O=o.localNode?.hostName?.split(".")[0]??o.localNode?.name??o.identity.name??"this broker";return s.jsxs("div",{className:"sys-inspector-content mesh-summary",children:[s.jsxs("div",{className:"sys-inspector-head",children:[s.jsx("h3",{className:"sys-inspector-title",children:O}),s.jsx("span",{className:"mesh-summary-mode",children:o.identity.modeLabel})]}),s.jsx("section",{className:"mesh-summary-section",children:s.jsxs("div",{className:"mesh-summary-counts",children:[s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.total}),s.jsx("span",{className:"mesh-summary-count-label",children:"agents"})]}),s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--working",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.working}),s.jsx("span",{className:"mesh-summary-count-label",children:"working"})]}),s.jsxs("div",{className:"mesh-summary-count",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.ready}),s.jsx("span",{className:"mesh-summary-count-label",children:"ready"})]}),s.jsxs("div",{className:"mesh-summary-count mesh-summary-count--offline",children:[s.jsx("span",{className:"mesh-summary-count-value",children:y.notReady}),s.jsx("span",{className:"mesh-summary-count-label",children:"not ready"})]})]})}),w.length>0&&s.jsxs("section",{className:"mesh-summary-section",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"By harness"}),s.jsx("div",{className:"mesh-summary-harness",children:w.map(l=>s.jsxs("div",{className:"mesh-summary-harness-row",children:[s.jsx("span",{className:"mesh-summary-harness-name",children:l.label}),s.jsx("span",{className:"mesh-summary-harness-count",children:l.total}),l.working>0&&s.jsxs("span",{className:"mesh-summary-harness-working",children:[l.working," working"]})]},l.label))})]}),s.jsxs("section",{className:"mesh-summary-section",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Peers"}),s.jsxs("div",{className:"mesh-summary-peers",children:[s.jsxs("div",{className:"mesh-summary-peer-row",children:[s.jsx("span",{className:"mesh-summary-peer-label",children:"Mesh"}),s.jsx("span",{className:"mesh-summary-peer-value",children:$})]}),o.tailscale.available&&s.jsxs("div",{className:"mesh-summary-peer-row",children:[s.jsx("span",{className:"mesh-summary-peer-label",children:"Tailnet"}),s.jsx("span",{className:`mesh-summary-peer-value${o.tailscale.running?"":" mesh-summary-peer-value--dim"}`,children:o.tailscale.running?`${I} online`:"stopped"})]})]})]}),s.jsxs("section",{className:"mesh-summary-section mesh-summary-reach",children:[s.jsx("div",{className:"sys-inspector-section-label",children:"Reach"}),s.jsx(J,{state:L,tailscaleAvailable:o.tailscale.available,announcing:u,tailscaleBusy:C,onAnnounce:()=>{A()},onStartTailscale:()=>{M()}}),x&&s.jsx("div",{className:`sys-banner mesh-action-message sys-banner-${x.tone}`,children:s.jsx("span",{children:x.text})})]})]})}function J({state:e,tailscaleAvailable:t,announcing:i,tailscaleBusy:r,onAnnounce:c,onStartTailscale:u}){return e==="discoverable"?s.jsxs("div",{className:"mesh-reach mesh-reach--on",children:[s.jsx("span",{className:"mesh-reach-dot"}),s.jsx("span",{className:"mesh-reach-label",children:"Discoverable on mesh"})]}):e==="tailnet-stopped"?s.jsxs("div",{className:"mesh-reach",children:[s.jsxs("div",{className:"mesh-reach-row",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Tailscale stopped"})]}),s.jsx("button",{type:"button",className:"s-btn mesh-reach-action",disabled:r,onClick:u,children:r?"Opening…":"Start Tailscale"})]}):e==="loopback"?s.jsxs("div",{className:"mesh-reach",children:[s.jsxs("div",{className:"mesh-reach-row",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Announcement broken"})]}),s.jsx("button",{type:"button",className:"s-btn mesh-reach-action",disabled:i,onClick:c,children:i?"Fixing…":"Fix announcement"})]}):e==="unavailable"?s.jsxs("div",{className:"mesh-reach mesh-reach--neutral",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Local only — no tailnet on this host"})]}):s.jsxs("div",{className:"mesh-reach",children:[s.jsxs("div",{className:"mesh-reach-row",children:[s.jsx("span",{className:"mesh-reach-dot mesh-reach-dot--off"}),s.jsx("span",{className:"mesh-reach-label",children:"Local only"})]}),s.jsx("button",{type:"button",className:"s-btn s-btn-primary mesh-reach-action",disabled:i||!t,onClick:c,children:i?"Announcing…":"Make discoverable"})]})}export{Es as MeshInspectorPanel};
@@ -0,0 +1 @@
1
+ import{j as t,r as h}from"./index-sUomXsrf.js";import{u as Z}from"./Provider-tFc3jqZ4.js";import{o as ee}from"./openAgent-Bjt57GdM.js";import{o as F}from"./openContent-C6XO6kr5.js";import{i as pe,s as te,c as se,n as D,d as X}from"./colors-BtO5_zlx.js";import{t as O,c as ne}from"./time-Dhsh_2EG.js";import{f as oe}from"./text-DsBWV_4k.js";import{a as R}from"./api-h5zurxmi.js";import{u as L}from"./sse-CVoGDiKW.js";import{r as E}from"./terminal-relay-B5Sma7fK.js";import{q as re}from"./terminal-takeover-X97KCSJk.js";import{r as fe,s as ve,a as be,b as je,c as ke}from"./session-catalog-XhGxCtP-.js";import{p as ae}from"./model-Co0zkMIc.js";import{u as ge}from"./ContextMenu-BlBQhpax.js";import{A as Ne}from"./AgentAvatar-CufDA4A-.js";import{A as we}from"./AgentLiveActions-CZdAInEu.js";import{T as H}from"./TmuxPeek-Dz1gJ2pU.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.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"./chevron-down-BFai6ZfE.js";import"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./index-BWHgHrtv.js";import"./SpriteAvatar-CQs-jC-v.js";import"./agent-identity-xQHedtLl.js";import"./eye-So8tNNK6.js";import"./terminal-DXQISjZn.js";/* empty css */import"./refresh-cw-D8PFyhUa.js";const ye=new Intl.NumberFormat("en-US"),Ce=new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1});function M(e){return typeof e!="number"||!Number.isFinite(e)?"-":Math.abs(e)<1e3?ye.format(e):Ce.format(e).toLowerCase()}function Se(e){if(!Number.isFinite(e)||e<=0)return"0s";if(e<60)return`${Math.round(e)}s`;const s=Math.round(e),a=Math.floor(s/3600),r=Math.floor(s%3600/60),i=s%60;return a>0?`${a}h ${r}m`:r>=10||i===0?`${r}m`:`${r}m ${i}s`}function Ie(e){return e.replace(/\.local$/i,"").replace(/-local-openscout$/i,"")}function z(e){const s=e?.trim();return s?s.toLowerCase()==="a2a"?"A2A":s:null}function Y(e){const s=e?.trim();return s?s==="claude_stream_json"?"Claude stream-json worker":s==="codex_app_server"?"Codex app server":s==="pi_rpc"?"Pi RPC":s==="tmux"?"tmux terminal":s:null}function ie(e){return!!(e.providerName||z(e.protocol)||(e.skills?.length??0)>0)}async function Ae(e){await R("/api/local-path/reveal",{method:"POST",body:JSON.stringify({path:e.path,agentId:e.agentId,...e.basePath?{basePath:e.basePath}:{},...e.sessionId?{sessionId:e.sessionId}:{}})})}function ce(e){Ae(e).catch(s=>{console.warn("Failed to reveal local path",s)})}function _t(){const{route:e,agents:s,navigate:a}=Z();if(e.view==="agent-info")return t.jsx(Re,{conversationId:e.conversationId,agents:s,navigate:a,route:e});if(e.view==="agents-v2"){if(!e.agentId)return null;const r=s.find(i=>i.id===e.agentId)??null;return r?t.jsx(le,{agent:r,agents:s,navigate:a,route:e,observeMode:e.tab==="observe",showStaticIdentity:!1}):null}return null}function Re({conversationId:e,agents:s,navigate:a,route:r}){const[i,m]=h.useState(null),[x,v]=h.useState(null),[p,f]=h.useState(!1),n=h.useCallback(async()=>{const o=await R(`/api/session/${encodeURIComponent(e)}`).catch(()=>null);m(o),f(!0)},[e]);h.useEffect(()=>{f(!1),n()},[n]),L(()=>{n()});const l=i?.agentId??null;h.useEffect(()=>{if(!l||s.some(c=>c.id===l)){v(null);return}let o=!1;return R(`/api/agents/${encodeURIComponent(l)}`).then(c=>{o||v(c)}).catch(()=>{o||v(null)}),()=>{o=!0}},[s,l]);const u=h.useMemo(()=>l?s.find(o=>o.id===l)??(x?.id===l?x:null):null,[x,s,l]);return p?u?t.jsx(le,{agent:u,agents:s,navigate:a,route:r,observeMode:!1}):t.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar p-4 gap-4 text-sm",children:[t.jsx(w,{label:"Conversation",value:e}),t.jsx("div",{className:"mt-2 text-xs font-mono uppercase tracking-[0.15em] leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"No live agent registration matches this profile."})]}):t.jsx("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm italic text-[var(--scout-chrome-ink-faint)]",children:"Loading agent context..."})}function le({agent:e,agents:s,navigate:a,route:r,observeMode:i,showStaticIdentity:m=!0}){const x=pe(e.state),[v,p]=h.useState(null),[f,n]=h.useState(null),[l,u]=h.useState(null),o=e.skills??[],c=z(e.protocol),j=ie(e),y=h.useCallback(async()=>{const[k,xe,he]=await Promise.all([R("/api/fleet").catch(()=>null),R(`/api/agents/${encodeURIComponent(e.id)}/session-catalog`).catch(()=>null),R(`/api/agents/${encodeURIComponent(e.id)}/observe`).catch(()=>null)]);k&&p(k),n(xe),u(he)},[e.id]);h.useEffect(()=>{y()},[y]),h.useEffect(()=>{n(null),u(null)},[e.id]),L(()=>{y()});const{focusedSession:d,focusSession:C}=Z(),N=fe(e,f),S=h.useMemo(()=>ve(f?.sessions??[],N),[f?.sessions,N]),$=r.view==="agents-v2"&&r.agentId===e.id?r.sessionId:null,I=be(e.id,d,N,S,$),P=je($,S);h.useEffect(()=>{P&&(d?.agentId===e.id&&d.sessionId===P||C(e.id,P))},[e.id,d?.agentId,d?.sessionId,C,P]);const b=S.find(k=>k.id===I)??null,_=!!(b&&N&&b.id===N),G=l?.sessionId?.trim()||l?.data.metadata?.session?.externalSessionId?.trim()||l?.data.metadata?.session?.threadId?.trim()||null,T=b&&_&&G?G:b?.id??null,U=b&&T&&T!==b.id?b.id:null,W=b?ke(e,f,b,_):{canObserve:!1,canTakeover:!1},me=()=>F(a,{view:"terminal",agentId:e.id,mode:"observe"},{returnTo:r}),B=()=>F(a,{view:"terminal",agentId:e.id,mode:"takeover"},{returnTo:r}),ue=()=>{if(E(e)){B();return}const k=f?.resumeCommand;if(k){re({command:k,cwd:f?.resumeCwd,agentId:e.id}).then(()=>B());return}B()};return m?t.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar p-4 gap-4 text-sm",children:[t.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--scout-chrome-border-soft)] pb-3",children:[t.jsx(Ne,{agent:e,placement:"inspector"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"truncate text-lg text-[var(--scout-chrome-ink-strong)]",children:e.name}),e.handle&&t.jsxs("span",{className:"text-xs font-mono text-[var(--scout-chrome-ink-faint)]",children:["@",e.handle]})]})]}),t.jsx(we,{agent:e,catalog:f,navigate:a,returnTo:r,variant:"compact"}),E(e)?.backend==="tmux"&&t.jsx(H,{agentId:e.id,lines:44,columns:132}),t.jsxs(g,{label:"State",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:te(e.state),opacity:x?1:.4}}),t.jsx("span",{className:"text-md capitalize text-[var(--scout-chrome-ink)]",children:se(e.state)})]}),e.updatedAt&&t.jsxs("div",{className:"mt-1 text-xs font-mono text-[var(--scout-chrome-ink-faint)]",children:["Updated ",O(e.updatedAt)]})]}),t.jsx(g,{label:"Presence",children:t.jsx(_e,{focusAgent:e,agents:s,onOpenAgent:k=>ee(a,k,{returnTo:r})})}),i&&t.jsx(J,{agentId:e.id}),v&&t.jsx(V,{asks:v.activeAsks,agentId:e.id,navigate:a}),t.jsxs(g,{label:"Identity",children:[e.providerName&&t.jsx(w,{label:"Provider",value:e.providerName}),c&&t.jsx(w,{label:"Protocol",value:c}),!j&&t.jsx(w,{label:"Class",value:e.agentClass}),!j&&e.role&&t.jsx(w,{label:"Role",value:oe(e.role)??e.role}),!j&&e.harness&&t.jsx(w,{label:"Harness",value:e.harness}),!j&&e.transport&&t.jsx(w,{label:"Transport",value:Y(e.transport)??e.transport}),(e.homeNodeName||e.homeNodeId)&&t.jsx(w,{label:"Host",value:Ie(e.homeNodeName??e.homeNodeId??"")})]}),o.length>0&&t.jsx(g,{label:`Skills · ${o.length}`,children:t.jsx("div",{className:"flex flex-wrap gap-1",children:o.map(k=>t.jsx("span",{className:"rounded-sm bg-[var(--scout-chrome-hover)] px-1.5 py-0.5 text-xs font-mono text-[var(--scout-chrome-ink-soft)]",children:k},k))})}),(e.project||e.branch||e.cwd)&&t.jsxs(g,{label:"Project",children:[e.project&&t.jsx(w,{label:"Name",value:e.project}),e.branch&&t.jsx(w,{label:"Branch",value:e.branch}),e.cwd&&t.jsx(w,{label:"Cwd",value:e.cwd})]}),e.capabilities.length>0&&t.jsx(g,{label:`Capabilities · ${e.capabilities.length}`,children:t.jsx("div",{className:"flex flex-wrap gap-1",children:e.capabilities.map(k=>t.jsx("span",{className:"rounded-sm bg-[var(--scout-chrome-hover)] px-1.5 py-0.5 text-xs font-mono text-[var(--scout-chrome-ink-soft)]",children:k},k))})}),t.jsx(Me,{agent:e,catalog:f,navigate:a,returnTo:r})]}):t.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar p-4 gap-4 text-sm",children:[b&&t.jsxs(g,{label:"Session",children:[t.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("span",{className:"truncate font-mono text-md text-[var(--scout-chrome-ink)]",title:T??b.id,children:de(T??b.id)}),t.jsx("span",{className:"shrink-0 font-mono text-2xs uppercase tracking-[0.12em]",style:{color:_?"var(--accent)":"var(--scout-chrome-ink-faint)"},children:_?"now":b.endedAt?`ended · ${O(b.endedAt)||"recent"}`:O(b.startedAt)||"recent"})]}),b.cwd&&t.jsx("div",{className:"mt-1 truncate font-mono text-2xs text-[var(--scout-chrome-ink-ghost)]",title:b.cwd,children:b.cwd}),T&&t.jsxs("div",{className:"mt-1 break-all font-mono text-2xs leading-snug text-[var(--scout-chrome-ink-faint)]",title:T,children:[t.jsx("span",{className:"uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:"id"})," ",T]}),U&&t.jsxs("div",{className:"mt-0.5 truncate font-mono text-2xs text-[var(--scout-chrome-ink-ghost)]",title:U,children:["profile ",U]}),t.jsx("div",{className:"mt-2.5 flex flex-col gap-1.5",children:t.jsxs(Te,{label:"Terminal",children:[t.jsx(q,{onClick:me,disabled:!W.canObserve,title:W.canObserve?"Watch the live terminal, read-only":"No live terminal to observe",children:"Observe"}),t.jsx(q,{onClick:ue,disabled:!W.canTakeover,title:W.canTakeover?"Grab the keyboard and drive it":"Can't take over this session",children:"Take over"})]})})]}),!i&&b&&t.jsx(Ee,{agentId:e.id,navigate:a,cwd:b.cwd??e.cwd,route:r}),E(e)?.backend==="tmux"&&t.jsx(H,{agentId:e.id,lines:44,columns:132}),t.jsx(g,{label:"Runtime",children:t.jsx($e,{agent:e})}),i&&t.jsx(J,{agentId:e.id}),v&&t.jsx(V,{asks:v.activeAsks,agentId:e.id,navigate:a})]})}function $e({agent:e}){const s=[],a=(m,x)=>{x&&x.trim()&&s.push({label:m,value:x.trim()})},r=z(e.protocol);return ie(e)?a("Protocol",r):(a("Role",oe(e.role)),a("Class",e.agentClass)),s.length===0?null:t.jsx("div",{className:"grid grid-cols-2 gap-x-3 gap-y-2",children:s.map(m=>t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-mono text-3xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:m.label}),t.jsx("div",{className:"truncate font-mono text-sm text-[var(--scout-chrome-ink)]",children:m.value})]},m.label))})}function Te({label:e,children:s}){return t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("span",{className:"w-[56px] shrink-0 font-mono text-3xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:e}),t.jsx("div",{className:"flex gap-1.5",children:s})]})}function q({onClick:e,disabled:s,title:a,children:r}){return t.jsx("button",{type:"button",onClick:e,disabled:s,title:a,className:"rounded-[4px] border border-[var(--scout-chrome-border-soft)] px-2.5 py-1 font-mono text-3xs uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-soft)] transition-colors hover:bg-[var(--scout-chrome-active)] hover:text-[var(--scout-chrome-ink)] disabled:cursor-default disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-[var(--scout-chrome-ink-soft)]",children:r})}function Me({agent:e,catalog:s,navigate:a,returnTo:r}){const i=ge(),m=E(e),x=s?.activeSessionId??(m?e.harnessSessionId??m.sessionName:null),p=h.useMemo(()=>Pe(e,s,x),[e,s,x]).filter(c=>c.id===x||!c.endedAt),f=p.slice(0,5);if(f.length===0)return null;const n=c=>F(a,{view:"terminal",agentId:e.id,mode:c},{returnTo:r}),l=()=>{if(m){n("takeover");return}s?.resumeCommand&&re({command:s.resumeCommand,cwd:s.resumeCwd,agentId:e.id}).then(()=>n("takeover"))},u=c=>F(a,{view:"sessions",sessionId:c},{returnTo:r}),o=(c,j,y)=>{const d=[];return j&&d.push({kind:"action",label:"Observe in terminal",onSelect:()=>n("observe")}),y&&d.push({kind:"action",label:"Takeover terminal",onSelect:l}),d.length>0&&d.push({kind:"separator"}),d.push({kind:"action",label:"Open session detail",onSelect:()=>u(c.id)}),d.push({kind:"action",label:"Open agent profile",onSelect:()=>ee(a,e,{returnTo:r})}),d};return t.jsx(g,{label:`Running sessions · ${p.length}`,children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.map(c=>{const j=c.id===x,y=j&&!!m,d=j&&(!!m||!!s?.resumeCommand),C=O(c.startedAt)||"recent",N=Y(c.transport)??c.harness??Y(e.transport)??e.harness??"session",S=j?C:c.endedAt?`${O(c.endedAt)||C} ended`:N,$=o(c,y,d);return t.jsxs("div",{onContextMenu:I=>i(I,$),className:`rounded border px-2 py-1.5 transition-colors ${j?"border-[color-mix(in_srgb,var(--accent)_40%,transparent)] bg-[color-mix(in_srgb,var(--accent)_8%,transparent)]":"border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)]"}`,children:[t.jsxs("button",{type:"button",title:y?`Observe terminal ${c.id}`:`Open session ${c.id}`,onClick:()=>y?n("observe"):u(c.id),className:"flex w-full items-center justify-between gap-2 bg-transparent p-0 text-left",children:[t.jsxs("span",{className:"flex min-w-0 flex-col",children:[t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[j&&t.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--accent)]"}),t.jsx("span",{className:"truncate font-mono text-xs text-[var(--scout-chrome-ink)]",children:de(c.id)}),t.jsx("span",{className:"shrink-0 rounded-sm bg-[var(--scout-chrome-hover)] px-1 py-0.5 font-mono text-3xs uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-faint)]",children:N})]}),t.jsx("span",{className:"mt-0.5 truncate font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:c.cwd?ae(c.cwd):"workspace"})]}),t.jsxs("span",{className:"flex shrink-0 flex-col items-end",children:[t.jsx("span",{className:"font-mono text-2xs uppercase tracking-[0.12em] text-[var(--accent)]",children:j?"active":"running"}),t.jsx("span",{className:"mt-0.5 max-w-[78px] truncate font-mono text-2xs text-[var(--scout-chrome-ink-ghost)]",children:S})]})]}),t.jsx("button",{type:"button",title:"Session actions",onClick:I=>i(I,$),className:"mt-1.5 h-5 rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] px-1.5 font-mono text-3xs uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-active)] hover:text-[var(--scout-chrome-ink)]",children:"..."})]},c.id)}),p.length>f.length&&t.jsxs("div",{className:"px-1 pt-0.5 font-mono text-2xs text-[var(--scout-chrome-ink-ghost)]",children:[p.length-f.length," more running"]})]})})}function Pe(e,s,a){const r=[...s?.sessions??[]],i=E(e);return i&&a&&!r.some(m=>m.id===a)&&r.unshift({id:a,startedAt:e.createdAt??e.updatedAt??Date.now(),cwd:e.cwd??e.projectRoot??".",...e.harness?{harness:e.harness}:{},transport:i.backend,model:e.model}),r.sort((m,x)=>{const v=m.endedAt??m.startedAt,p=x.endedAt??x.startedAt;return ne(v,p)})}function de(e){const s=e.replace(/^session[_:-]?/i,"");return s.length>10?s.slice(0,8):s}function J({agentId:e}){const[s,a]=h.useState(null),r=h.useCallback(async()=>{const i=await R(`/api/agents/${encodeURIComponent(e)}/observe`).catch(()=>null);a(i)},[e]);return h.useEffect(()=>{r()},[r]),L(()=>{r()}),s?.data?t.jsx(Oe,{agentId:e,data:s.data,sessionId:s.sessionId}):t.jsx(g,{label:"Trace",children:t.jsx("div",{className:"text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:"Resolving session trace."})})}function Oe({agentId:e,data:s,sessionId:a}){const r=s.metadata?.session,i=s.events,m=s.files,x=i.filter(o=>o.kind==="tool").length,v=i.filter(o=>o.kind==="think").length,p=i.filter(o=>o.kind==="ask").length,f=i.filter(o=>o.kind==="tool"&&o.tool==="read").length,n=i.filter(o=>o.kind==="tool"&&(o.tool==="edit"||o.tool==="write")).length,l=i.length>0?i[i.length-1].t:0,u=r?.threadPath;return t.jsxs(t.Fragment,{children:[t.jsxs(g,{label:"Session",children:[a&&t.jsx(w,{label:"Active",value:a}),u&&t.jsx(Q,{label:"Source",path:u,basePath:r?.cwd??null,value:ae(u),agentId:e,sessionId:a}),r?.cwd&&t.jsx(Q,{label:"Workspace",path:r.cwd,value:r.cwd,agentId:e,sessionId:a})]}),t.jsx(g,{label:"Trace stats",children:t.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[t.jsx(A,{label:"Turns",value:M(r?.turnCount)}),t.jsx(A,{label:"Tools",value:M(x)}),t.jsx(A,{label:"Thinks",value:M(v)}),t.jsx(A,{label:"Requests",value:M(p)}),t.jsx(A,{label:"Reads",value:M(f)}),t.jsx(A,{label:"Edits",value:M(n)}),t.jsx(A,{label:"Files",value:M(m.length)}),t.jsx(A,{label:"Window",value:Se(l)})]})}),m.length>0&&t.jsx(g,{label:`Files touched · ${m.length}`,children:t.jsx("div",{className:"flex flex-col gap-1",children:m.slice(0,8).map(o=>t.jsxs("button",{type:"button",title:o.path,onClick:()=>ce({path:o.path,basePath:r?.cwd??null,agentId:e,sessionId:a}),className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] px-2 py-1 text-left hover:border-[var(--accent)]",children:[t.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-[var(--scout-chrome-ink-soft)]",children:o.path}),t.jsxs("span",{className:"shrink-0 font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:["x",o.touches]})]},o.path))})})]})}function K(e,s){return e?.view==="agents-v2"?{...e,view:"agents-v2",agentId:s,tab:"observe"}:{view:"agents-v2",agentId:s,tab:"observe"}}function Ee({agentId:e,navigate:s,cwd:a,route:r}){const[i,m]=h.useState(null),x=h.useCallback(async()=>{const d=await R(`/api/agents/${encodeURIComponent(e)}/observe`).catch(()=>null);m(d)},[e]);h.useEffect(()=>{x()},[x]),L(()=>{x()});const v=i?.data;if(!v||v.files.length===0)return null;const p=v.files,n=[...p].sort((d,C)=>{const N=d.state==="read"?0:1,S=C.state==="read"?0:1;return N!==S?S-N:C.touches-d.touches}).slice(0,6),l=p.length-n.length,u=p.filter(d=>d.state!=="read").length,o=v.metadata?.session?.cwd??a??null,c=i.sessionId??v.metadata?.session?.externalSessionId??void 0,j=()=>s(o?{view:"repo-diff",path:o,agentId:e,include:"changed",...c?{sessionId:c}:{}}:K(r,e)),y=()=>s(o?{view:"repo-diff",path:o}:K(r,e));return t.jsxs(g,{label:"Files changed",children:[t.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between font-mono text-3xs uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:[t.jsx("span",{children:u>0?`${u} changed`:"touched"}),t.jsx("span",{className:"tabular-nums",children:p.length})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(d=>{const C=d.path.replace(/\/+$/,"").split("/"),N=C.pop()??d.path,S=C.pop(),$=S?`${S}/`:"",I=d.state!=="read",P=d.state==="created"?"+":d.state==="modified"?"~":"·";return t.jsxs("div",{className:"flex items-baseline justify-between gap-2 font-mono text-xs leading-tight",title:`${d.path} · ${d.state}`,children:[t.jsxs("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[t.jsx("span",{className:"flex-none tabular-nums",style:{color:I?"var(--accent)":"var(--scout-chrome-ink-ghost)"},children:P}),t.jsxs("span",{className:"flex min-w-0 items-baseline",children:[t.jsx("span",{className:"truncate text-[var(--scout-chrome-ink-ghost)]",children:$}),t.jsx("span",{className:"flex-none",style:{color:I?"var(--scout-chrome-ink-soft)":"var(--scout-chrome-ink-faint)"},children:N})]})]}),t.jsxs("span",{className:"shrink-0 tabular-nums text-2xs text-[var(--scout-chrome-ink-faint)]",children:["×",d.touches]})]},d.path)}),t.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1",children:[t.jsxs("button",{type:"button",onClick:j,className:"w-fit cursor-pointer font-mono text-2xs uppercase tracking-[0.1em] text-[var(--accent)] hover:underline",children:["Session diff",l>0?` · +${l}`:""," →"]}),t.jsx("button",{type:"button",onClick:y,className:"w-fit cursor-pointer font-mono text-2xs uppercase tracking-[0.1em] text-[var(--scout-chrome-ink-faint)] hover:text-[var(--accent)] hover:underline",children:"Worktree diff →"})]})]})]})}function Q({label:e,path:s,basePath:a,value:r,agentId:i,sessionId:m}){return t.jsxs("div",{className:"flex items-baseline justify-between py-0.5 gap-2",children:[t.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:e}),t.jsx("button",{type:"button",title:`Reveal ${s}`,onClick:()=>ce({path:s,basePath:a,agentId:i,sessionId:m}),className:"min-w-0 truncate bg-transparent p-0 text-right font-mono text-sm text-[var(--accent)] hover:text-[var(--scout-chrome-ink)] hover:underline",children:r})]})}function A({label:e,value:s}){return t.jsxs("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] px-2 py-1.5",children:[t.jsx("div",{className:"font-mono text-3xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:e}),t.jsx("div",{className:"mt-0.5 font-mono text-md text-[var(--scout-chrome-ink)]",children:s})]})}function _e({focusAgent:e,agents:s,onOpenAgent:a}){const p=h.useMemo(()=>{const n=s.filter(u=>u.id!==e.id),l=u=>{const o=D(u);return o==="in_turn"?0:o==="in_flight"?1:2};return n.slice().sort((u,o)=>{const c=l(u.state??""),j=l(o.state??"");return c!==j?c-j:ne(u.updatedAt,o.updatedAt)}).slice(0,8)},[s,e.id]),f=h.useMemo(()=>{const n=[{agent:e,x:120,y:90,focused:!0}];return p.forEach((l,u)=>{const o=2*Math.PI*u/Math.max(p.length,1)-Math.PI/2;n.push({agent:l,x:120+68*Math.cos(o),y:90+68*Math.sin(o),focused:!1})}),n},[e,p,120,90,68]);return t.jsxs("div",{className:"@container flex flex-wrap items-start gap-3",children:[t.jsxs("svg",{viewBox:"0 0 240 180",className:"block mx-auto shrink-0 w-full",style:{maxWidth:240},xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("defs",{children:t.jsxs("radialGradient",{id:"inspMeshGlow",cx:"50%",cy:"50%",r:"50%",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--accent)",stopOpacity:"0.06"}),t.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0"})]})}),t.jsx("circle",{cx:120,cy:90,r:82,fill:"url(#inspMeshGlow)"}),t.jsx("circle",{cx:120,cy:90,r:68,fill:"none",stroke:"var(--border)",strokeDasharray:"2 4"}),f.slice(1).map((n,l)=>t.jsxs("g",{children:[t.jsx("line",{x1:120,y1:90,x2:n.x,y2:n.y,stroke:"var(--accent)",strokeWidth:1,opacity:.6}),t.jsx("circle",{r:2,fill:"var(--accent)",children:t.jsx("animateMotion",{dur:`${2+l*.3}s`,repeatCount:"indefinite",path:`M 120,90 L ${n.x},${n.y}`})})]},`e-${n.agent.id}`)),f.map(n=>{const l=D(n.agent.state),u=l==="in_turn"||l==="in_flight"||l==="callable",o=n.focused?14:9;return t.jsxs("g",{style:{cursor:"pointer"},onClick:()=>a(n.agent),children:[u&&t.jsxs("circle",{cx:n.x,cy:n.y,r:o+5,fill:"none",stroke:X(n.agent.name),strokeWidth:.8,opacity:.3,children:[t.jsx("animate",{attributeName:"r",values:`${o};${o+8};${o}`,dur:"2.5s",repeatCount:"indefinite"}),t.jsx("animate",{attributeName:"opacity",values:"0.3;0;0.3",dur:"2.5s",repeatCount:"indefinite"})]}),t.jsx("circle",{cx:n.x,cy:n.y,r:o,fill:X(n.agent.name),stroke:n.focused?"var(--accent)":"var(--surface)",strokeWidth:n.focused?1.5:1}),t.jsx("text",{x:n.x,y:n.y,dy:"0.35em",textAnchor:"middle",fontFamily:"var(--font-mono)",fontSize:n.focused?10:8,fontWeight:600,fill:"var(--scout-chrome-avatar-ink)",children:n.agent.name[0].toUpperCase()}),t.jsx("text",{x:n.x,y:n.y+o+10,textAnchor:"middle",fontFamily:"var(--font-mono)",fontSize:8,fill:"var(--dim)",letterSpacing:"0.04em",children:n.agent.name.length>9?n.agent.name.slice(0,8)+"...":n.agent.name})]},n.agent.id)})]}),p.length>0&&t.jsx("ul",{className:"@max-[380px]:hidden flex-1 min-w-[120px] flex flex-col gap-1 m-0 p-0 list-none",children:p.map(n=>{const l=D(n.state);return t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>a(n),className:"w-full flex items-center gap-2 py-1 px-1.5 rounded hover:bg-[var(--surface-hover)] text-left",children:[t.jsx("span",{"aria-hidden":!0,className:"shrink-0 w-2 h-2 rounded-full",style:{background:X(n.name)}}),t.jsx("span",{className:"flex-1 truncate text-sm font-mono text-[var(--scout-chrome-ink)]",children:n.name}),t.jsx("span",{"aria-hidden":!0,title:se(n.state),className:"shrink-0 w-1.5 h-1.5 rounded-full",style:{background:te(l)}})]})},n.id)})})]})}function V({asks:e,agentId:s,navigate:a}){const r=e.filter(i=>i.agentId===s&&(i.status==="needs_attention"||i.status==="queued"));return r.length===0?null:t.jsx(g,{label:`Incoming requests · ${r.length}`,children:t.jsx("div",{className:"flex flex-col gap-2",children:r.map(i=>t.jsxs("div",{className:"p-2.5 rounded-md border border-amber-500/30 bg-amber-500/[0.04] cursor-pointer hover:bg-amber-500/[0.08] transition-colors",onClick:()=>{i.conversationId&&a({view:"agents-v2",agentId:s,conversationId:i.conversationId})},children:[t.jsx("div",{className:"text-2xs font-mono uppercase tracking-[0.12em] text-amber-500/80 mb-1",children:"awaiting"}),t.jsx("div",{className:"line-clamp-2 text-sm leading-relaxed text-[var(--scout-chrome-ink)]",children:i.summary??i.task}),t.jsxs("div",{className:"mt-1.5 text-2xs font-mono text-[var(--scout-chrome-ink-ghost)]",children:[i.harness??"operator"," → ",i.agentName??"agent"]})]},i.invocationId))})})}function g({label:e,children:s}){return t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"mb-1.5 text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:e}),s]})}function w({label:e,value:s}){return t.jsxs("div",{className:"flex items-baseline justify-between py-0.5 gap-2",children:[t.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:e}),t.jsx("span",{className:"truncate text-sm font-mono text-[var(--scout-chrome-ink)]",title:s,children:s})]})}export{_t as AgentsInspector};
@@ -0,0 +1 @@
1
+ import{r as l,j as e}from"./index-sUomXsrf.js";import{u as P}from"./Provider-tFc3jqZ4.js";import{a as g}from"./api-h5zurxmi.js";import{u as A}from"./sse-CVoGDiKW.js";import{t as b}from"./time-Dhsh_2EG.js";import{o as k}from"./openContent-C6XO6kr5.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.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"./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"./index-BWHgHrtv.js";function f(t){const r=t.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean);return r[r.length-1]??t}function N(t){const n=t?.trim();if(!n)return null;const r=f(n);return r.endsWith(".jsonl")?r.slice(0,-6):r}function L(t){return t.workspaceRoot?f(t.workspaceRoot):t.agentName??"unassigned"}function $(t){return t.harness?.trim()||t.kind?.trim()||"scout"}function w(t){return t.project?.trim()||(t.cwd?f(t.cwd):null)||"unknown"}function y(t,n=4){const r=new Map;for(const c of t){const a=c.trim()||"unknown";r.set(a,(r.get(a)??0)+1)}return[...r.entries()].map(([c,a])=>({label:c,count:a})).sort((c,a)=>a.count-c.count||c.label.localeCompare(a.label)).slice(0,n)}function je(){const{route:t,navigate:n}=P(),[r,c]=l.useState([]),[a,h]=l.useState(null),p=l.useCallback(async()=>{const[u,d]=await Promise.allSettled([g("/api/sessions"),g("/api/tail/discover")]);u.status==="fulfilled"&&c(u.value),d.status==="fulfilled"&&h(d.value)},[]);if(l.useEffect(()=>{p()},[p]),A(()=>{p()}),t.view!=="sessions")return null;const s=t.sessionId?r.find(u=>u.id===t.sessionId)??null:null;return s?e.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar p-4 gap-4 text-sm",children:[e.jsxs("div",{className:"border-b border-[var(--scout-chrome-border-soft)] pb-3",children:[e.jsx("div",{className:"text-lg leading-snug text-[var(--scout-chrome-ink-strong)]",children:s.title}),e.jsx("div",{className:"text-xs font-mono uppercase tracking-wider text-cyan-400/70 mt-1",children:s.kind})]}),s.agentName&&e.jsxs(m,{label:"Agent",children:[e.jsx(x,{label:"Name",value:s.agentName}),s.harness&&e.jsx(x,{label:"Harness",value:s.harness})]}),(s.currentBranch||s.workspaceRoot)&&e.jsxs(m,{label:"Workspace",children:[s.currentBranch&&e.jsx(x,{label:"Branch",value:s.currentBranch}),s.workspaceRoot&&e.jsx(x,{label:"Root",value:s.workspaceRoot})]}),e.jsxs(m,{label:"Activity",children:[e.jsx(x,{label:"Messages",value:`${s.messageCount}`}),s.lastMessageAt&&e.jsx(x,{label:"Last",value:b(s.lastMessageAt)}),s.participantIds.length>0&&e.jsx(x,{label:"Participants",value:`${s.participantIds.length}`})]}),s.preview&&e.jsx(m,{label:"Preview",children:e.jsxs("div",{className:"text-sm italic leading-relaxed text-[var(--scout-chrome-ink-soft)]",children:['"',s.preview,'"']})})]}):e.jsx(I,{sessions:r,discovery:a,navigate:n,route:t})}function I({sessions:t,discovery:n,navigate:r,route:c}){const a=n?.transcripts??[],h=l.useMemo(()=>y([...t.map($),...a.map(o=>o.source||"unknown")],5),[t,a]),p=l.useMemo(()=>y([...t.map(L),...a.map(w)],5),[t,a]),s=l.useMemo(()=>a.slice().sort((o,i)=>i.mtimeMs-o.mtimeMs).slice(0,5),[a]),u=l.useMemo(()=>t.filter(o=>o.lastMessageAt).slice().sort((o,i)=>(i.lastMessageAt??0)-(o.lastMessageAt??0)).slice(0,5),[t]),d=n?.processes?.length??0,S=n?.totals.transcripts??a.length,R=d>0?"Live harness activity":"Quiet session surface";return e.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar p-4 gap-4 text-sm",children:[e.jsxs("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] p-2.5",children:[e.jsx("div",{className:"text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:"Sessions context"}),e.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-1",children:[e.jsx(v,{label:"Scout",value:`${t.length}`}),e.jsx(v,{label:"Raw",value:`${S}`}),e.jsx(v,{label:"Live",value:`${d}`})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2 border-t border-[var(--scout-chrome-border-soft)] pt-2 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:[e.jsx("span",{children:R}),e.jsxs("span",{children:[h.length," sources"]})]})]}),e.jsx(m,{label:"Sources",children:e.jsx(M,{items:h,empty:"No sources visible"})}),e.jsx(m,{label:"Project mix",children:e.jsx(M,{items:p,empty:"No projects visible"})}),e.jsx(m,{label:"Recent raw",children:s.length===0?e.jsx(j,{children:"No raw transcripts discovered."}):e.jsx("div",{className:"flex flex-col gap-1.5",children:s.map(o=>{const i=N(o.sessionId)??N(o.transcriptPath);return e.jsxs("button",{type:"button",className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] px-2 py-1.5 text-left transition-colors hover:border-[var(--scout-chrome-border)]",onClick:()=>{i&&k(r,{view:"sessions",sessionId:i},{returnTo:c})},disabled:!i,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"shrink-0 rounded-sm bg-[var(--scout-chrome-bg)] px-1 py-0.5 font-mono text-3xs uppercase tracking-[0.08em] text-[var(--scout-chrome-ink-faint)]",children:o.source||"raw"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-[var(--scout-chrome-ink)]",children:w(o)}),e.jsx("span",{className:"shrink-0 font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:b(o.mtimeMs)})]}),e.jsx("div",{className:"mt-0.5 truncate font-mono text-2xs text-[var(--scout-chrome-ink-ghost)]",children:i??f(o.transcriptPath)})]},`${o.source}:${o.transcriptPath}`)})})}),e.jsx(m,{label:"Recent Scout sessions",children:u.length===0?e.jsx(j,{children:"No recent Scout session messages."}):e.jsx("div",{className:"flex flex-col gap-1",children:u.map(o=>e.jsxs("button",{type:"button",className:"flex items-center gap-2 bg-transparent px-0 py-0.5 text-left",onClick:()=>k(r,{view:"sessions",sessionId:o.id},{returnTo:c}),children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-[var(--scout-chrome-ink-soft)]",children:o.title}),e.jsx("span",{className:"shrink-0 font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:o.lastMessageAt?b(o.lastMessageAt):"-"})]},o.id))})})]})}function v({label:t,value:n}){return e.jsxs("div",{className:"min-w-0 rounded-sm border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-bg)] px-1.5 py-1",children:[e.jsx("div",{className:"font-mono text-2xs uppercase tracking-[0.1em] text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("div",{className:"mt-0.5 truncate font-mono text-lg text-[var(--scout-chrome-ink-strong)]",children:n})]})}function M({items:t,empty:n}){return t.length===0?e.jsx(j,{children:n}):e.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(r=>e.jsxs("span",{className:"rounded-sm border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] px-1.5 py-0.5 font-mono text-xs text-[var(--scout-chrome-ink-soft)]",title:`${r.count} ${r.label}`,children:[r.label," ",r.count]},r.label))})}function j({children:t}){return e.jsx("div",{className:"text-xs font-mono uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:t})}function m({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1.5 text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),n]})}function x({label:t,value:n}){return e.jsxs("div",{className:"flex items-baseline justify-between py-0.5 gap-2",children:[e.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("span",{className:"truncate text-sm font-mono text-[var(--scout-chrome-ink)]",children:n})]})}export{je as SessionsInspector};
@@ -0,0 +1 @@
1
+ import{j as t}from"./index-sUomXsrf.js";import{u as h}from"./Provider-tFc3jqZ4.js";import{o as j}from"./openAgent-Bjt57GdM.js";import{n as v,i as u,c as d}from"./colors-BtO5_zlx.js";import{A as b}from"./AgentAvatar-CufDA4A-.js";import{t as g}from"./time-Dhsh_2EG.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"./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"./openContent-C6XO6kr5.js";import"./SpriteAvatar-CQs-jC-v.js";import"./agent-identity-xQHedtLl.js";function pt(){const{agents:r,agentsLoaded:s,apiConnection:o,navigate:a,route:f}=h(),n=e=>j(a,e,{returnTo:f});if(!s)return t.jsx("div",{className:"flex h-full flex-col justify-center","aria-busy":"true",children:t.jsxs("div",{className:"base-rail-loading",role:"status","aria-label":"Loading agent roster",children:[t.jsx("span",{"aria-hidden":"true"}),t.jsx("span",{"aria-hidden":"true"}),t.jsx("span",{"aria-hidden":"true"}),t.jsx("span",{"aria-hidden":"true"})]})});if(r.length===0)return t.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-4 text-center font-mono text-sm leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:[t.jsx("div",{className:"mb-1 uppercase tracking-[0.15em]",children:o.status==="offline"?"Roster unavailable":"No agents"}),t.jsx("div",{children:o.status==="offline"?o.message:"Connect an agent to see your roster here."})]});const i=r.filter(e=>{const x=v(e.state,e);return x==="in_turn"||x==="in_flight"}),l=r.filter(e=>u(e.state,e)&&!i.includes(e)),m=r.filter(e=>!u(e.state,e));return t.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar p-4 gap-4 text-sm",children:[i.length>0&&t.jsx(c,{label:"In progress",count:i.length,children:i.map(e=>t.jsx(p,{agent:e,onOpen:n,subLabel:d(e.state,e)},e.id))}),l.length>0&&t.jsx(c,{label:"Callable",count:l.length,children:l.map(e=>t.jsx(p,{agent:e,onOpen:n},e.id))}),m.length>0&&t.jsx(c,{label:"Blocked",count:m.length,children:m.map(e=>t.jsx(p,{agent:e,onOpen:n,subLabel:d(e.state,e),dim:!0},e.id))})]})}function c({label:r,count:s,children:o}){return t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[t.jsx("span",{className:"text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:r}),t.jsx("span",{className:"text-2xs font-mono tabular-nums text-[var(--scout-chrome-ink-ghost)]",children:s})]}),t.jsx("div",{className:"flex flex-col gap-0.5",children:o})]})}function p({agent:r,onOpen:s,subLabel:o,dim:a}){return t.jsxs("button",{onClick:()=>s(r),className:`group flex items-center gap-2.5 px-2 py-1.5 rounded-sm text-left transition-colors ${a?"opacity-60 hover:opacity-100 hover:bg-[var(--scout-chrome-hover)]":"hover:bg-[var(--scout-chrome-hover)]"}`,children:[t.jsx(b,{agent:r,placement:"row"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"truncate font-medium text-[var(--scout-chrome-ink)]",children:r.name}),o?t.jsx("span",{className:"truncate text-xs text-[var(--scout-chrome-ink-faint)]",children:o}):r.updatedAt?t.jsx("span",{className:"truncate text-xs text-[var(--scout-chrome-ink-ghost)]",children:g(r.updatedAt)}):null]})]})}export{pt as HomeRight};
@@ -0,0 +1 @@
1
+ import{r as u,j as e}from"./index-sUomXsrf.js";import{u as j}from"./Provider-tFc3jqZ4.js";import{o as b}from"./openContent-C6XO6kr5.js";import{a as N}from"./api-h5zurxmi.js";import{u as w}from"./sse-CVoGDiKW.js";import{t as g,b as p}from"./time-Dhsh_2EG.js";import{C as y}from"./chevron-down-BFai6ZfE.js";import{C as I}from"./chevron-right-CyUa1zXx.js";import{M as C}from"./message-square-BD-4UUdc.js";import"./router-Dja9_ygK.js";import"./terminal-sessions-D5CIR2OL.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"./createLucideIcon-DlxlBfLC.js";import"./TextDocumentSurface-C-9EtYqt.js";/* empty css */import"./file-text-i3xTDUjJ.js";import"./x-0XjXwGqq.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"./search-DCT_EvPr.js";import"./chunk-HRAB3GC3-CvwpNg-G.js";import"./index-BWHgHrtv.js";const M=5;function je(){const{route:t,navigate:s}=j(),a=t.view==="work"?t.workId:null,[r,o]=u.useState(null),i=u.useCallback(async()=>{if(!a){o(null);return}try{o(await N(`/api/work/${encodeURIComponent(a)}`))}catch{o(null)}},[a]);if(u.useEffect(()=>{i()},[i]),w(()=>{a&&i()}),t.view!=="work")return null;if(!r)return e.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center text-sm font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-ghost)]",children:"Loading work item…"});const d=O(r.state),m=T(r.attention),f=r.ownerName??r.ownerId??"Unassigned",l=r.nextMoveOwnerName??r.nextMoveOwnerId??null,h=l!==null&&(r.ownerId??null)!==(r.nextMoveOwnerId??null)&&l!==f,k=1+(h?1:0)+(r.priority?1:0)+2+(r.parentId?1:0)+(r.conversationId?1:0);return e.jsxs("div",{className:"flex flex-col h-full overflow-y-auto frame-scrollbar text-sm",children:[e.jsx("div",{className:"sticky top-0 z-10 border-b border-[var(--scout-chrome-border-soft)] bg-black/55 px-4 py-2 backdrop-blur",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${d.dot}`}),e.jsx("span",{className:`font-mono text-xs uppercase tracking-[0.15em] ${d.text}`,children:L(r.state)}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink-faint)]",children:[e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:f}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"px-1 text-[var(--scout-chrome-ink-ghost)]",children:"→"}),e.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:l})]})]}),m&&e.jsx("span",{className:"shrink-0 rounded border border-amber-400/30 bg-amber-400/10 px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-amber-300/90",children:m})]})}),e.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[e.jsxs(c,{label:"Case facts",children:[e.jsx(n,{label:"Phase",value:r.currentPhase}),e.jsx(n,{label:"Acceptance",value:r.acceptanceState.replace(/_/g," ")}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority})]}),e.jsx(c,{label:"Timeline",children:r.timeline.length===0?e.jsx("div",{className:"text-xs text-[var(--scout-chrome-ink-faint)]",children:"No activity yet."}):e.jsx("div",{className:"flex flex-col gap-1.5",children:r.timeline.slice(0,M).map(x=>e.jsx(W,{item:x,onOpen:x.conversationId?()=>b(s,{view:"conversation",conversationId:x.conversationId},{returnTo:t}):void 0},x.id))})}),e.jsxs(c,{label:"Routing",collapsible:!0,defaultOpen:!1,count:k,children:[e.jsx(n,{label:"Owner",value:f}),h&&l&&e.jsx(n,{label:"Next move",value:l}),r.priority&&e.jsx(n,{label:"Priority",value:r.priority}),e.jsx(n,{label:"Children",value:`${r.activeChildWorkCount}`}),e.jsx(n,{label:"Flights",value:`${r.activeFlightCount}`}),r.lastMeaningfulAt&&e.jsx(n,{label:"Last update",value:g(r.lastMeaningfulAt)}),(r.conversationId||r.parentId)&&e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5",children:[r.conversationId&&e.jsx(v,{label:"Open thread",onClick:()=>b(s,{view:"conversation",conversationId:r.conversationId},{returnTo:t})}),r.parentId&&r.parentTitle&&e.jsx(v,{label:r.parentTitle,eyebrow:"Parent",onClick:()=>b(s,{view:"work",workId:r.parentId},{returnTo:t})})]})]}),e.jsxs(c,{label:"Record",collapsible:!0,defaultOpen:!1,children:[e.jsx(n,{label:"Case ID",value:r.id}),e.jsx(n,{label:"Created",value:p(r.createdAt)}),e.jsx(n,{label:"Updated",value:p(r.updatedAt)}),e.jsx(n,{label:"Last activity",value:p(r.lastMeaningfulAt)})]}),r.lastMeaningfulSummary&&e.jsxs(c,{label:"Hudson context",collapsible:!0,defaultOpen:!1,children:[e.jsx("div",{className:"text-sm italic leading-relaxed text-[var(--scout-chrome-ink-soft)]",children:r.lastMeaningfulSummary}),e.jsxs("div",{className:"mt-2 flex gap-1.5",children:[e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Plan"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Docs"}),e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Code"})]})]})]})]})}function L(t){switch(t){case"review":return"In review";case"waiting":return"Waiting";case"working":return"Working";case"done":return"Done";default:return t.replace(/_/g," ")}}function T(t){switch(t){case"badge":return"Noteworthy";case"interrupt":return"Blocked";default:return null}}function O(t){return/complete|done|finished/i.test(t)?{dot:"bg-emerald-400",text:"text-emerald-300/90"}:/fail|error/i.test(t)?{dot:"bg-red-400",text:"text-red-300/90"}:/block|wait|pause/i.test(t)?{dot:"bg-amber-400",text:"text-amber-300/90"}:/active|working|in[_-]?progress/i.test(t)?{dot:"bg-cyan-400",text:"text-cyan-300/90"}:{dot:"bg-[var(--scout-chrome-ink-faint)]",text:"text-[var(--scout-chrome-ink)]"}}function c({label:t,children:s,collapsible:a=!1,defaultOpen:r=!0,count:o}){const[i,d]=u.useState(r);return a?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("button",{type:"button",onClick:()=>d(m=>!m),className:"flex items-center gap-1.5 text-left text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)] hover:text-[var(--scout-chrome-ink)]",children:[i?e.jsx(y,{"aria-hidden":"true",size:10,strokeWidth:2}):e.jsx(I,{"aria-hidden":"true",size:10,strokeWidth:2}),e.jsx("span",{children:t}),typeof o=="number"&&o>0&&e.jsx("span",{className:"rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0 font-mono text-3xs tracking-[0.1em] text-[var(--scout-chrome-ink-faint)]",children:o})]}),i&&e.jsx("div",{className:"mt-1.5",children:s})]}):e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1.5 text-2xs font-mono uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),s]})}function v({label:t,eyebrow:s,onClick:a}){return e.jsxs("button",{type:"button",onClick:a,className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-white/[0.025] px-2 py-1.5 text-left hover:border-cyan-400/25 hover:bg-cyan-400/10",children:[e.jsxs("span",{className:"min-w-0",children:[s&&e.jsx("span",{className:"block font-mono text-2xs uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:s}),e.jsx("span",{className:"block truncate font-mono text-xs text-[var(--scout-chrome-ink)]",children:t})]}),e.jsx(C,{"aria-hidden":"true",size:11,strokeWidth:1.8,className:"shrink-0 text-cyan-300/75"})]})}function W({item:t,onOpen:s}){const a=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`mt-1 h-1.5 w-1.5 shrink-0 rounded-full ${A(t)}`}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-mono text-2xs text-[var(--scout-chrome-ink-faint)]",children:g(t.at)}),e.jsx("span",{className:"shrink-0 rounded border border-[var(--scout-chrome-border-soft)] px-1 py-0.5 font-mono text-3xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:_(t)})]}),e.jsx("span",{className:"mt-0.5 block truncate text-xs font-semibold text-[var(--scout-chrome-ink-strong)]",children:t.actorName??"system"}),t.title&&e.jsx("span",{className:"mt-0.5 block truncate text-xs leading-snug text-[var(--scout-chrome-ink)]",children:t.title}),t.summary&&e.jsx("span",{className:"mt-0.5 block text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden"},children:t.summary})]})]}),r="flex gap-2 border-t border-[var(--scout-chrome-border-soft)] pt-1.5 first:border-t-0 first:pt-0",o=p(t.at);return s?e.jsx("button",{type:"button",onClick:s,title:o,className:`${r} text-left hover:text-cyan-300/90`,children:a}):e.jsx("div",{className:r,title:o,children:a})}function _(t){switch(t.kind){case"flight_started":return"flight started";case"flight_completed":return t.detailKind?`flight ${t.detailKind}`:"flight ended";case"message":return"message";default:return t.title??t.detailKind??"event"}}function A(t){return t.kind==="message"?"bg-cyan-400":t.kind==="flight_started"?"bg-lime-400":t.kind==="flight_completed"?t.detailKind?.includes("fail")?"bg-red-400":"bg-emerald-400":t.detailKind?.includes("interrupt")||t.detailKind?.includes("block")?"bg-amber-400":"bg-[var(--scout-chrome-ink-faint)]"}function n({label:t,value:s}){return e.jsxs("div",{className:"flex items-baseline justify-between py-0.5 gap-2",children:[e.jsx("span",{className:"shrink-0 text-xs font-mono uppercase tracking-wider text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("span",{className:"truncate text-sm font-mono text-[var(--scout-chrome-ink)]",children:s})]})}export{je as WorkInspector};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-OpA4Amw5.js";const e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],t=c("rocket",e);export{t as R};
1
+ import{c}from"./createLucideIcon-DlxlBfLC.js";const e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],t=c("rocket",e);export{t as R};
@@ -0,0 +1 @@
1
+ import{r as L,j as xt,n as ce,o as Dt,p as Ne,q as Me,k as jt,t as Nt,s as k,l as h,v as Mt,w as J,x as zt,y as Bt}from"./index-sUomXsrf.js";import{n as ue,e as Wt,g as ze,h as Kt,j as Gt}from"./terminal-sessions-D5CIR2OL.js";var Be=["local","url","sharedConfig","env"];function We(e){const t=Ht(e),n=e.audienceIncludes??Vt(e.audienceOrder),s=new Set;function o(a){!e.warnOnUnknown||s.has(a)||(s.add(a),typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[hudsonkit/flags] Unknown feature flag "${a}" resolved false.`))}const r=e.registry;function i(a){const c=r[a];if(!c)return o(a),{key:a,enabled:!1,value:!1,layer:"default",audience:t,reason:"unknown-flag"};const d=Yt(e.layers,a);return d?{key:a,enabled:d.value,value:d.value,layer:d.layer,audience:t,requiredTier:c.tier,reason:"override",definition:c}:c.defaultEnabled?c.tier&&!n(t,c.tier)?{key:a,enabled:!1,value:!1,layer:"default",audience:t,requiredTier:c.tier,reason:"audience-denied",definition:c}:{key:a,enabled:!0,value:!0,layer:"default",audience:t,requiredTier:c.tier,reason:"default",definition:c}:{key:a,enabled:!1,value:!1,layer:"default",audience:t,requiredTier:c.tier,reason:"default",definition:c}}return{registry:e.registry,isEnabled:a=>i(String(a)).enabled,explain:a=>i(String(a)),all:()=>Object.keys(e.registry).sort().map(i),audience:()=>t}}function Ht(e){let t=e.audience.tier;for(const n of Be.slice().reverse()){const s=e.layers?.[n]?.audience;s&&(t=s)}return{...e.audience,tier:t}}function Vt(e){return(t,n)=>{if(t.tier===n)return!0;if(!e||e.length===0)return!1;const s=e.indexOf(t.tier),o=e.indexOf(n);return s<0||o<0?!1:s>=o}}function Yt(e,t){for(const n of Be){const s=qt(e?.[n]?.flags?.[t]);if(s!==null)return{layer:n,value:s}}return null}function qt(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function Qt(e){if(e===!0||e===!1)return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e!="string")return;const t=e.trim().toLowerCase();if(["1","true","on","yes","enabled","enable"].includes(t))return!0;if(["0","false","off","no","disabled","disable"].includes(t))return!1;if(["default","null","unset","clear"].includes(t))return"default"}function Xt(e,t={}){const n=t.paramPrefix??"ff.",s=t.audienceParam??"ffAudience",o=typeof e=="string"?new URL(e,"http://hudson.local"):e,r={};let i;for(const[a,c]of o.searchParams.entries()){if(a===s&&c.trim()&&(i=c.trim()),!a.startsWith(n))continue;const d=a.slice(n.length),f=Qt(c);d&&f!==void 0&&(r[d]=f)}return{flags:r,audience:i}}var x=1;function Ke(e){if(typeof window>"u")return{version:x};try{const t=window.localStorage?.getItem(e);return Zt(t)}catch{return{version:x}}}function q(e,t){if(typeof window>"u")return;const n=Ge(t),s=JSON.stringify(n);try{window.localStorage?.setItem(e,s)}catch{}Jt(e,s)}function Zt(e){if(!e)return{version:x};try{const t=JSON.parse(e);return!t||typeof t!="object"?{version:x}:Ge(t)}catch{return{version:x}}}function Ge(e){const t={version:x};if(e.audience&&(t.audience=e.audience),e.flags&&typeof e.flags=="object"){t.flags={};for(const[n,s]of Object.entries(e.flags))(s===!0||s===!1)&&(t.flags[n]=s);Object.keys(t.flags).length===0&&delete t.flags}return t}function Jt(e,t){if(!(typeof document>"u"))try{const n=encodeURIComponent(t);document.cookie=`${encodeURIComponent(e)}=${n}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}var en="hudson.flags",He=L.createContext(null);function Fs({registry:e,audience:t,audienceOrder:n,audienceIncludes:s,initialLayers:o,storageKey:r=en,warnOnUnknown:i=!1,children:a}){const[c,d]=L.useState(()=>{const g=o?.local;return{version:1,audience:g?.audience??void 0,flags:tn(g)}});L.useEffect(()=>{const g=Ke(r);(g.audience||Object.keys(g.flags??{}).length>0)&&d(g)},[r]);const f=L.useMemo(()=>({...o,local:{...o?.local,audience:c.audience??o?.local?.audience,flags:{...o?.local?.flags??{},...c.flags??{}}}}),[o,c]),y=L.useMemo(()=>We({registry:e,audience:t,audienceOrder:n,audienceIncludes:s,layers:f,warnOnUnknown:i}),[e,t,n,s,f,i]),_=L.useMemo(()=>({...y,layers:f,storageKey:r,setLocalOverride:(g,w)=>{d(R=>{const T={...R.flags??{}};w===null?delete T[g]:T[g]=w;const A={...R,version:1,flags:T};return q(r,A),A})},setLocalAudienceOverride:g=>{d(w=>{const R={...w,version:1,audience:g??void 0};return q(r,R),R})},resetLocalOverrides:()=>{const g={version:1};q(r,g),d(g)}}),[y,f,r]);return xt.jsx(He.Provider,{value:_,children:a})}function Ve(){return L.useContext(He)}function Ts(){const e=Ve();if(!e)throw new Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}function ks(e,t=!0){return Ve()?.isEnabled(e)??t}function tn(e){if(!e?.flags)return;const t={};for(const[n,s]of Object.entries(e.flags))(s===!0||s===!1)&&(t[n]=s);return Object.keys(t).length>0?t:void 0}const nn=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],sn=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.scoutbot","surface.workflows"];function ye(e,t){return Object.fromEntries(e.map(n=>[n,t]))}const Ye={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Dt}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},on={...Ye,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ce}. Prefer the primary flag; ${Ne} remains for old dev links.`},Os=ce;function rn(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...ye(nn,!1),...ye(sn,!1)}}}const qe=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Qe=["ffGlobal","scoutGlobalBundle"],Xe=["ffPersist","persistBundle"],an=new Set(["no-ops","ffAudience",...qe,...Qe,...Xe]);function xs(e){for(const t of[...e.searchParams.keys()])(an.has(t)||t.startsWith("ff."))&&e.searchParams.delete(t);return e}const cn=["everyone","internal","power"],un="openscout.flags",ee="openscout.flagBundle",ln={tier:"power"},Ee=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal","ops.lanes"],$e=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.mesh-ops","surface.scoutbot","surface.realtime-voice","surface.workflows"],dn={"nav.sidebar":{label:"Nav · Sidebar",description:"Classic sidebar chrome (8 primary areas + icon rail). Default on since sco-083 soak; opt out with ?ff.nav.sidebar=off. Not included in max-pro.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["nav","chrome"]},"ops.control":{label:"Ops · Control",description:"Mission control, issues, and the Ops section shell.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops","nav"]},"ops.mesh":{label:"Ops · Mesh",description:"Mesh topology and peer status.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.runtime":{label:"Ops · Runtime",description:"Runtime / atop process telemetry.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.plans":{label:"Ops · Plans",description:"Plan documents and plan-mode review.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.terminal":{label:"Ops · Terminal",description:"Observe / takeover terminal sessions.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"ops.lanes":{label:"Ops · Agent Lanes",description:"One column per local agent — follow live harness work in power-user mode.",defaultEnabled:!0,tier:"power",owner:"scout-web",tags:["ops"]},"surface.search":{label:"Surface · Search",description:"Knowledge + indexer search as a top-level nav entry.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.sessions":{label:"Surface · Sessions",description:"Standalone top-level Sessions entry (still reachable under Agents).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","nav"]},"surface.briefings":{label:"Surface · Briefings",description:"Briefings list + detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.work":{label:"Surface · Work",description:"Work item detail.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.activity":{label:"Surface · Activity",description:"Activity stream.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.follow":{label:"Surface · Follow",description:"Follow view.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface"]},"surface.mesh-ops":{label:"Surface · Mesh Ops",description:"Mesh Ops — work-item triage over the mesh (hosts rail, item list, inspector).",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","ops"]},"surface.scoutbot":{label:"Surface · Scoutbot",description:"Scoutbot assistant — the inspector panel, the status-bar broadcast chip, and the Message-Scout command-palette actions.",defaultEnabled:!0,tier:"everyone",owner:"scout-web",tags:["surface","assistant"]},"surface.realtime-voice":{label:"Surface · Realtime voice",description:"Live WebRTC voice conversations with Scoutbot through OpenAI Realtime.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","assistant","voice"]},"surface.workflows":{label:"Surface · Workflows",description:"Observed harness families / workflow topology telemetry on the Agents directory. Off in the lean view — the directory is just the project-grouped agent board.",defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","observability"]},[ce]:Ye,[Ne]:on},fn={a:"light-prod",control:"light-prod",light:"light-prod","light-prod":"light-prod",prod:"light-prod",production:"light-prod",b:"max-pro",max:"max-pro","max-pro":"max-pro",pro:"max-pro",treatment:"max-pro",...Nt},Re=new Set(["clear","default","none","reset","unset"]);function K(e,t){return Object.fromEntries(e.map(n=>[n,t]))}function Ze(...e){const t={};for(const n of e)n.audience&&(t.audience=n.audience),n.flags&&Object.keys(n.flags).length>0&&(t.flags={...t.flags??{},...n.flags});return t}function le(e){switch(e){case"light-prod":return{audience:"everyone",flags:{...K(Ee,!1),...K($e,!1)}};case"max-pro":return{audience:"power",flags:{...K(Ee,!0),...K($e,!0)}};case jt:return rn()}}function j(e){return e?fn[e.trim().toLowerCase()]??null:null}function te(e,t){for(const n of t){const s=e.get(n);if(s!==null)return s}return null}function Je(e){const t=te(e,qe);return j(t)}function mn(e){const t=te(e,Qe);if(t){const i=t.trim().toLowerCase();if(Re.has(i))return{action:"clear"};const a=j(t);return a?{action:"set",bundle:a}:null}const n=te(e,Xe);if(!n)return null;const s=n.trim().toLowerCase();if(Re.has(s))return{action:"clear"};if(["0","false","no"].includes(s))return null;const o=j(n);if(o)return{action:"set",bundle:o};const r=Je(e);return r?{action:"set",bundle:r}:null}function et(){if(typeof window>"u")return null;try{return j(window.localStorage.getItem(ee))}catch{return null}}function pn(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(ee):window.localStorage.setItem(ee,e.bundle)}catch{}}function Ds(){return et()??j(Me())??nt}function tt(){const e=et();return e?le(e):{}}const nt="light-prod";function st(){const e=j(Me())??nt;return le(e)}function gn(e){const t=mn(e);t&&pn(t)}function ot(e=new URLSearchParams(window.location.search)){const t=Xt(window.location.href),n=Je(e),s=n?le(n):{},o={audience:t.audience??s.audience,flags:{...s.flags??{},...t.flags??{}}};return e.has("no-ops")&&(o.flags={...o.flags,"ops.control":!1}),o}function hn(){const e=Ke(un);return{flags:e.flags,audience:e.audience??void 0}}function js(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return gn(e),{sharedConfig:Ze(st(),tt()),url:ot(e)}}function wn(e){const t=typeof window>"u"?{}:{sharedConfig:Ze(st(),tt()),url:ot(),local:hn()};return We({registry:dn,audience:ln,audienceOrder:cn,layers:t,warnOnUnknown:!1}).isEnabled(e)}function rt(){return wn("ops.control")}const ne={sm:408,md:512,lg:616},at=240,it=640,In=24,ct="openscout:lane-deck:v1",vn=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),de=new Set(["sm","md","lg"]),ut={"web.ops":{defaultLaneWidth:"lg",showAutoLanes:!0},"macos.lanes":{defaultLaneWidth:"md",showAutoLanes:!0},"hud.tail":{defaultLaneWidth:"sm",showAutoLanes:!0,defaultHorizon:"30m"},"web.embed":{defaultLaneWidth:"md",showAutoLanes:!0}},Sn=ut["web.ops"];function fe(e){return lt(e)?ut[e]:Sn}const H={pinned_left:0,main:1,pinned_right:2};function lt(e){return vn.has(e)}function Ns(e=window.location.search,t=window.location.pathname){const n=new URLSearchParams(e),s=n.get("profile")?.trim().toLowerCase();if(s&&lt(s))return s;const o=n.get("embed")?.trim().toLowerCase();return o==="hud"?"hud.tail":o==="app"?"macos.lanes":t.includes("/lanes/embed")?"web.embed":(t.includes("/ops/lanes"),"web.ops")}function Ms(e=window.location.search){const t=new URLSearchParams(e),n=(t.get("lanes")??t.get("size"))?.trim().toLowerCase();return n&&de.has(n)?n:"lg"}function zs(e,t){if(typeof e=="number"&&Number.isFinite(e))return Math.min(it,Math.max(at,Math.round(e)));const n=typeof e=="string"&&de.has(e)?e:t;return ne[n]}function Bs(e){const t=Math.min(it,Math.max(at,Math.round(e)));let n=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(ne)){const i=Math.abs(r-t);i<s&&(s=i,n=o)}return n&&s<=In?{px:ne[n],tier:n}:{px:t,tier:null}}function me(e,t,n){return{version:1,profileId:e,defaultLaneWidth:t??n.defaultLaneWidth,defaultHorizon:n.defaultHorizon,laneWidths:{},laneDefs:[],slots:[],showAutoLanes:n.showAutoLanes,updatedAt:Date.now()}}function Pe(e,t){const n=fe(e);return me(e,t,n)}function se(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&de.has(e))return e}function bn(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||!t.id.trim()||t.kind!=="session"&&t.kind!=="harness"&&t.kind!=="project"&&t.kind!=="attention"||typeof t.title!="string"||!t.title.trim()?null:{id:t.id.trim(),kind:t.kind,title:t.title.trim(),sessionId:typeof t.sessionId=="string"?t.sessionId.trim():void 0,harness:typeof t.harness=="string"?t.harness.trim():void 0,projectPath:typeof t.projectPath=="string"?t.projectPath.trim():void 0}}function Ln(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||!t.id.trim()||typeof t.laneDefId!="string"||!t.laneDefId.trim()||t.zone!=="pinned_left"&&t.zone!=="main"&&t.zone!=="pinned_right"||typeof t.position!="number"||!Number.isFinite(t.position)?null:{id:t.id.trim(),laneDefId:t.laneDefId.trim(),zone:t.zone,position:t.position,width:se(t.width)}}function dt(e,t,n,s){if(!e||typeof e!="object")return me(t,n,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map(bn).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map(Ln).filter(d=>d!==null):[],a={};if(o.laneWidths&&typeof o.laneWidths=="object")for(const[d,f]of Object.entries(o.laneWidths)){const y=se(f);y!==void 0&&(a[d]=y)}const c=se(o.defaultLaneWidth);return{version:1,profileId:t,defaultLaneWidth:(typeof c=="string"?c:void 0)??n??s.defaultLaneWidth,defaultHorizon:typeof o.defaultHorizon=="string"?o.defaultHorizon:s.defaultHorizon,laneWidths:a,laneDefs:r,slots:i,showAutoLanes:typeof o.showAutoLanes=="boolean"?o.showAutoLanes:s.showAutoLanes,updatedAt:typeof o.updatedAt=="number"?o.updatedAt:Date.now()}}function yn(e,t,n){return dt(e,t,n,fe(t))}function Ws(e,t){const n=fe(e),s=t??n.defaultLaneWidth;try{const o=localStorage.getItem(`${ct}:${e}`);return o?yn(JSON.parse(o),e,s):Pe(e,s)}catch{return Pe(e,s)}}function En(e){try{localStorage.setItem(`${ct}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Ks(e){return[...e].sort((t,n)=>{const s=H[t.zone]-H[n.zone];return s!==0?s:t.position-n.position})}function Gs(e,t){return H[e]-H[t]}function ft(){return`slot:${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function pe(e){return e.trim().toLowerCase().replace(/['"]/gu,"").replace(/[^a-z0-9]+/gu,"-").replace(/^-+|-+$/gu,"")}function Y(e){return`session:${e}`}function $n(e){return`harness:${pe(e)}`}function Rn(e){return`project:${pe(e)}`}const Pn="attention:needs-input";function mt(e,t){const n=e.filter(s=>s.zone===t);return n.length===0?0:Math.max(...n.map(s=>s.position))+1}function pt(e,t){const n=e.laneDefs.some(s=>s.id===t.id);return{...e,laneDefs:n?e.laneDefs.map(s=>s.id===t.id?t:s):[...e.laneDefs,t]}}function gt(e,t){const n=e.slots.some(s=>s.id===t.id);return{...e,slots:n?e.slots.map(s=>s.id===t.id?t:s):[...e.slots,t]}}function ht(e,t){return{...e,slots:e.slots.filter(n=>n.laneDefId!==t)}}function Cn(e,t){const n=Y(t);return{...ht(e,n),laneDefs:e.laneDefs.filter(s=>s.id!==n)}}function Hs(e,t){const n=Y(t);return e.slots.some(s=>s.laneDefId===n&&s.zone!=="main")}function Vs(e,t){const n=Y(t),s=e.slots.find(o=>o.laneDefId===n);return!s||s.zone==="main"?null:s.zone}function Ys(e,t){const n=t.zone??"pinned_left",s=Y(t.laneId),o=Cn(e,t.laneId),r=pt(o,{id:s,kind:"session",title:t.title,sessionId:t.laneId});return gt(r,{id:ft(),laneDefId:s,zone:n,position:mt(r.slots,n),width:t.width})}function qs(e,t){const n=t.zone??"pinned_left",s=t.kind==="attention"?Pn:t.kind==="harness"&&t.harness?$n(t.harness):t.kind==="project"&&t.projectPath?Rn(t.projectPath):`${t.kind}:${pe(t.title)}`,o=ht(e,s),r=pt(o,{id:s,kind:t.kind,title:t.title,harness:t.harness,projectPath:t.projectPath});return gt(r,{id:ft(),laneDefId:s,zone:n,position:mt(r.slots,n),width:t.width})}function Qs(e,t,n){return{...e,laneWidths:{...e.laneWidths,[t]:n},updatedAt:Date.now()}}function Xs(e,t){return{...e,defaultLaneWidth:t,updatedAt:Date.now()}}function Zs(e){const t=new Set(e.slots.filter(n=>n.zone!=="main").map(n=>n.laneDefId));return{...e,slots:e.slots.filter(n=>n.zone==="main"),laneDefs:e.laneDefs.filter(n=>!t.has(n.id))}}const V="scope.lanes",oe={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},_n="openscout:lane-deck:v1";function Ce(e){return me(V,e,oe)}function Js(e){const t=e??oe.defaultLaneWidth;try{const n=localStorage.getItem(`${_n}:${V}`);return n?dt(JSON.parse(n),V,t,oe):Ce(t)}catch{return Ce(t)}}function eo(e){En(e)}const An=[h.lanes,h.tail,h.sessions,h.agents];function Un(e){return An.includes(e)}function Fn(e){return e===zt||e===Bt}function wt(e){return Mt(e)}function Q(e,t={}){switch(e){case h.tail:{const n=new URLSearchParams;t.tailQuery&&n.set("q",t.tailQuery);const s=n.toString();return k(e,s?`?${s}`:"")}case h.sessions:return t.sessionId?k(e,`/${encodeURIComponent(t.sessionId)}`):k(e);case h.lanes:return k(J);case h.agents:return k(e);default:return k(J)}}function It(e){switch(e.view){case"ops":return!e.mode||e.mode==="lanes"?h.lanes:e.mode==="tail"?h.tail:null;case"sessions":return e.agentId?null:h.sessions;case"agents-v2":return e.agentId||e.projectSlug||e.sessionId||e.conversationId?null:h.agents;default:return null}}function Tn(e){const t=It(e);return t?t===h.tail&&e.view==="ops"?Q(t,{tailQuery:e.tailQuery}):t===h.sessions&&e.view==="sessions"?Q(t,{sessionId:e.sessionId}):Q(t):null}function kn(e,t,n){if(!Fn(e[0]))return null;const s=e[1]??J;if(!Un(s))return{view:"ops",mode:"lanes"};switch(s){case h.tail:{const o=t.searchParams.get("q")?.trim();return{view:"ops",mode:"tail",...o?{tailQuery:o}:{}}}case h.sessions:return e[2]?n({view:"sessions",sessionId:decodeURIComponent(e[2])}):n({view:"sessions"});case h.agents:return n({view:"agents-v2"});case h.lanes:default:return{view:"ops",mode:"lanes"}}}const On=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),xn=["ff.","studio.","studioMode."];function Dn(e){return On.has(e)||xn.some(t=>e.startsWith(t))}function vt(e,t=""){const n=new URL(e,"http://scout.local");new URLSearchParams(t).forEach((r,i)=>{Dn(i)&&(n.searchParams.has(i)||n.searchParams.set(i,r))});const o=n.searchParams.toString();return`${n.pathname}${o?`?${o}`:""}`}function to(e){switch(e){case h.tail:return{view:"ops",mode:"tail"};case h.sessions:return{view:"sessions"};case h.agents:return{view:"agents-v2"};case h.lanes:default:return{view:"ops",mode:"lanes"}}}function jn(e=typeof window<"u"?window.location.pathname:""){return wt(e)}function no(){return V}function so(e=jn()){return e?{"data-scope-presentation":!0}:void 0}function St(e,t=typeof window<"u"?window.location.pathname:""){return wt(t)?Tn(e):null}function Nn(e,t=typeof window<"u"?window.location.pathname:""){return St(e,t)!==null}function oo(e,t=typeof window<"u"?window.location.pathname:""){return Nn(e,t)?It(e):null}const ro={days:3,sessionLimit:200,hitLimit:60,debounceMs:180};function re(e){return e.root==="HOME"?`~/${e.relPath}`:e.root==="ABSOLUTE"?e.relPath:`$${e.root}/${e.relPath}`}function _e(e){const t=e?.trim();if(!t)return null;const n=t.replace(/[\\/]+$/,""),s=n.split(/[\\/]/).filter(Boolean).at(-1)??n;return s.endsWith(".jsonl")?s.slice(0,-6):s}function F(e){return e.sourceRefs.find(t=>t.kind==="harness_transcript")??null}function bt(e){return e.sourceRefs.find(t=>t.kind==="file")??null}function ge(e){return e?_e(e.sessionId)??_e(re(e.path)):null}function ao(e){const t=ge(e);if(!t)return null;const n=e?.recordRange;return n?`${t}|records ${n[0]}..${n[1]}`:t}function B(e,t){const n=e.facets[t];return Array.isArray(n)?n.filter(Boolean).join(", "):typeof n=="string"?n:""}function M(e){const t=new Set;return e.split(/[^A-Za-z0-9_./-]+/u).map(n=>n.trim()).filter(n=>n.length>1).filter(n=>{const s=n.toLowerCase();return t.has(s)?!1:(t.add(s),!0)}).slice(0,12)}const Mn=/^(events?\s+window(\s+\d+)?|files?\s+touched|tool\s+calls?|indexed\s+snippet|manifest|summary|decisions?|context\s+pack)\b/iu,Ae=/^(claude|codex|kimi|cursor|gpt|gemini)\b/iu,Ue=/^(?:claude|codex|kimi|cursor|gpt|gemini)?\s*[a-z0-9._/-]*\s*(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\s+\d{1,2}(?:\s+at\s+\d{1,2}:\d{2}\s*(?:am|pm)?)?\s*[-–—:]\s*/iu;function Lt(e){return Mn.test(e.replace(/\s+/g," ").trim())}function zn(e){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(t=t.replace(/<[^>\n]+>/g," ").replace(/\s+/g," ").trim(),Ue.test(t))t=t.replace(Ue,"").trim();else{const n=t.match(/^(.{6,72}?)\s[-–—]\s+(.+)$/u);if(n){const s=n[1]??"",o=n[2]??"";(Ae.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(t=o.trim())}}return t=t.replace(Ae,"").replace(/^\s*[-–—:]\s*/,"").trim(),t=t.replace(/\s{2,}/g," ").trim(),t.length>72&&(t=`${t.slice(0,69).replace(/\s+\S*$/u,"").trimEnd()}…`),t}function Bn(e){const t=B(e,"project"),n=e.title.replace(/\s+/g," ").trim();if(n&&!Lt(n)){const o=zn(n);if(o&&o.toLowerCase()!==t.toLowerCase()||o)return o}if(t)return t;const s=ge(F(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function yt(e){const t=z(e,"recordKind",8).map(s=>s.toLowerCase());if(t.length===0&&t.push(...z(e,"recordTag",8).map(s=>s.toLowerCase())),t.some(s=>s.includes("assistant")))return"assistant";if(t.some(s=>s.includes("user")))return"user";if(t.some(s=>s.includes("tool")||s.includes("command")||s.includes("response")))return"tool";const n=we(e);return n==="tool activity"?"tool":n==="overview"?"overview":""}function io(e,t){const n=Ie(e.snippet,t),s=yt(e),o=he(e);let r="";if(n){const i=M(t).map(d=>d.toLowerCase()),a=n.split(new RegExp("(?<=[.!?])\\s+|\\s+[–—]\\s+|\\s+·\\s+","u")).map(d=>d.replace(/^…+|…+$/gu,"").trim()).filter(d=>d.length>12);r=((i.length>0?a.find(d=>i.some(f=>ae(d,f)>=0)):void 0)??a[0]??n).replace(/^…+|…+$/gu,"").trim()}return r?(r.length>78&&(r=`${r.slice(0,75).replace(/\s+\S*$/u,"").trimEnd()}…`),r):s&&o?`${s} · ${o}`:o||s||Bn(e)}function Wn(e){return e.freshness&&e.freshness!=="unknown"?e.freshness:e.title.replace(/\s+/g," ").trim().match(/\b((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]*\s+\d{1,2}(?:\s+at\s+\d{1,2}:\d{2}\s*(?:AM|PM)?)?)\b/iu)?.[1]??""}function Fe(e){const t=e.trim().toLowerCase();return t?t==="events"||t.startsWith("events")?"conversation":t==="overview"||t==="summary"?"overview":t==="tool-calls"||t==="tools"?"tool activity":t==="files"||t==="files-touched"?"files touched":t==="manifest"?"session index":t.replace(/[-_]+/g," "):""}function Kn(e){const t=e.trim();return t?t.charAt(0).toUpperCase()+t.slice(1):""}function Gn(e){const t=B(e,"harness")||F(e)?.harness||"";if(!t)return"";const n=t.toLowerCase();return n==="claude"?"Claude":n==="codex"?"Codex":n==="kimi"?"Kimi":n==="cursor"?"Cursor":Kn(t)}function Hn(e){const t=B(e,"sessionId").trim(),n=ge(F(e)),s=(t||n||"").trim();return s?s.length>14?s.slice(0,8):s:""}function he(e){const t=F(e)?.recordRange;if(t){const[s,o]=t;return s===o?`turn ${s}`:o-s<=1?`turns ${s}–${o}`:`turns ${s}–${o}`}const n=e.title.match(/events?\s+window\s+(\d+)/iu);return n?`window ${Number(n[1])}`:""}function Vn(e){const t=z(e,"recordKind",8).map(s=>s.toLowerCase());t.length===0&&t.push(...z(e,"recordTag",8).map(s=>s.toLowerCase()));const n=[];return t.some(s=>s.includes("user"))&&n.push("user"),t.some(s=>s.includes("assistant"))&&n.push("assistant"),t.some(s=>s.includes("tool")||s.includes("command")||s.includes("response"))&&n.push("tool"),n.length===0?"":n.join(" · ")}function we(e){const t=B(e,"documentKind");if(t){const s=t.split(",")[0]?.trim()??t;return Fe(s)}return Lt(e.title)?Fe(e.title):bt(e)?"file":F(e)?"conversation":""}function z(e,t,n=3){const s=e.facets[t];return(Array.isArray(s)?s:typeof s=="string"?s.split(","):[]).map(r=>r.trim()).filter(Boolean).slice(0,n)}function co(e){return{agent:Gn(e),project:B(e,"project"),session:Hn(e),when:Wn(e),turn:he(e),role:Vn(e),where:we(e)}}function uo(e){const t=[],n=he(e);n&&t.push(n);const s=yt(e);s&&t.push(s);const o=we(e);o&&o!=="conversation"&&t.push(o);const r=z(e,"toolName",2);r.length===1&&t.push(r[0]),r.length>1&&t.push(r.join(", "));const i=new Set;return t.filter(a=>{const c=a.toLowerCase();return i.has(c)?!1:(i.add(c),!0)})}function ae(e,t){return new RegExp(`(?<![A-Za-z0-9_./~-])${Rt(t)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function Ie(e,t=""){let n=e.replace(/\s+/g," ").trim();if(!n)return"";if(n=n.replace(/\s*-\s*\[\d{3,}\]\s*`[^`]+`(?:\s*\([^)]*\))?\s*-\s*/gu," "),n=n.replace(/\[\d{3,}\]\s*`[^`]+`\s*/gu,""),n=n.replace(/\*\*/gu,""),n=n.replace(/\b(?:assistant_turn|user_turn|agent_reasoning|command_or_tool|response_item|system_record)\b/giu," "),n=n.replace(/(?:~\/|\.\.?\/|\/(?:Users|home|var|tmp|opt)\/)\S+/gu," "),n=n.replace(/https?:\/\/\S+/gu," "),n=n.replace(/\b[\w.-]+\.(?:com|net|org|io|dev|app)(?:\/\S*)?/giu," "),n=n.replace(/\{[^{}]{0,160}\}/gu," "),n=n.replace(/`[^`]{0,64}`/gu,r=>{const i=r.slice(1,-1);return M(t).some(a=>ae(i,a)>=0)||/^[A-Za-z][\w.-]{0,24}$/u.test(i)?i:" "}),n=n.replace(/\s{2,}/g," ").trim(),n=n.replace(/^[\s,;:.\-–—|/]+/u,"").trim(),n.includes("{")||n.includes("[")){const r=n.search(/[\[{]/u);if(r>18){const i=n.slice(0,r).trim().replace(/[-–—,:;]+$/u,"").trim();i&&(n=i)}}const s=M(t),o=200;if(s.length>0&&n.length>o){let r=-1;for(const i of s){const a=ae(n,i);a>=0&&(r<0||a<r)&&(r=a)}if(r<0)for(const i of s){if(i.length<4)continue;const a=n.toLowerCase().indexOf(i.toLowerCase());a>=0&&(r<0||a<r)&&(r=a)}if(r>=0){const a=Math.max(0,r-48),c=Math.min(n.length,a+o),d=n.slice(a,c).trim();n=`${a>0?"…":""}${d}${c<n.length?"…":""}`}else n=`${n.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`}else n.length>o&&(n=`${n.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`);return n.replace(/\s{2,}/g," ").trim()}function lo(e,t,n){const s=Ie(e.snippet,t);return s.length<=n?s:`${s.slice(0,n-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function Yn(e,t){return M(t).filter(n=>{const s=n.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||Ie(e.snippet,t).toLowerCase().includes(s)})}function Et(e){const t=(e.kind||e.role||e.type||"record").toLowerCase();return t==="assistant_turn"||t==="assistant"?"assistant":t==="user_turn"||t==="user"?"user":t==="system_record"||t==="system"?"system":t==="command_or_tool"||t==="tool_use"?"tool":t==="response_item"?"tool output":t==="agent_reasoning"||t==="reasoning"?"reasoning":t.replace(/_/gu," ")}function $t(e){const t=(e.kind||e.role||e.type||"").toLowerCase();return t==="assistant"||t==="assistant_turn"||t==="user"||t==="user_turn"||t==="last-prompt"||t==="ai-title"?0:t==="system"||t==="system_record"||t.includes("reasoning")?1:2}function fo(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function mo(e,t,n){const s=Yn(e,t),o=s.length===1?`Matched “${s[0]}”`:s.length>1?`Matched ${s.length} terms`:"Matched in this session";if(!n?.matched)return o;const r=[n.renderedText,n.summary].filter(Boolean).join(" ").toLowerCase(),i=s.filter(d=>r.includes(d.toLowerCase()));if(i.length===0)return o;const a=Et(n),c=a==="assistant"?"an assistant reply":a==="user"?"your message":a==="tool"?"a tool call":a==="tool output"?"tool output":a==="system"?"a system record":a==="reasoning"?"agent reasoning":`a ${a} record`;return i.length===1?`Matched “${i[0]}” in ${c}`:`Matched ${i.length} terms in ${c}`}function po(e){const t=F(e);if(t){const s=re(t.path),o=t.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const n=bt(e);if(n){const s=re(n.path),o=n.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function qn(e){const t=e.filter(o=>$t(o)===2).length,n=e.length-t,s=e.some(o=>o.matched)?" · match inside":"";return t>0&&n===0?`${t} tool step${t===1?"":"s"}${s}`:t===0?`${n} process step${n===1?"":"s"}${s}`:`${t} tool + ${n} process step${e.length===1?"":"s"}${s}`}function Qn(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function go(e,t={}){if(e.length===0)return[];const n=t.contextRadius??3,s=t.maxTurns??6,o=t.centerRecordIndex===void 0?-1:e.findIndex(w=>w.index===t.centerRecordIndex),r=e.findIndex(w=>w.matched),i=o>=0?o:r>=0?r:0,a=e.slice(Math.max(0,i-n),Math.min(e.length,i+n+1)),c=[];let d=[],f=[],y=0;const _=()=>{d.length!==0&&(c.push({kind:"folded",records:d,summary:qn(d)}),d=[])},g=()=>{f.length!==0&&(c.push({kind:"folded",records:f,summary:Qn(f)}),f=[])};for(const w of a){if($t(w)>0){g(),d.push(w);continue}if(_(),y>=s){f.push(w);continue}c.push({kind:"turn",record:w,role:Et(w)}),y+=1}return _(),g(),c}function Te(e){const t=F(e)?.recordRange;return t?t[0]:Number.MAX_SAFE_INTEGER}function ho(e){const t=[],n=new Map;for(const s of e){const o=s.collectionId||s.id,r=n.get(o);r?r.push(s):(t.push(o),n.set(o,[s]))}return t.map(s=>{const o=[...n.get(s)??[]].sort((i,a)=>{const c=Te(i)-Te(a);return c!==0?c:i.score-a.score}),r=n.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function Rt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wo(e,t){const n=M(t);if(n.length===0||e.length===0)return[{text:e,match:!1}];const s=n.map(a=>`(?<![A-Za-z0-9_./~-])${Rt(a)}(?![A-Za-z0-9_./~-])`),o=new RegExp(`(${s.join("|")})`,"giu"),r=[];let i=0;for(const a of e.matchAll(o)){const c=a.index??0;c>i&&r.push({text:e.slice(i,c),match:!1}),r.push({text:a[0],match:!0}),i=c+a[0].length}return i<e.length&&r.push({text:e.slice(i),match:!1}),r.length>0?r:[{text:e,match:!1}]}const Io={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},Pt=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],vo=["sessions","skills","mcp","codebase","context_pack"];function So(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function Xn(e){return e?Pt.some(t=>t.value===e):!1}function X(e){return e?e.split(",").map(t=>t.trim()).filter(t=>t.length>0):[]}function Zn(e){const t=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,n=t.get("time"),s=Xn(n)?n:"all";return{query:t.get("q")?.trim()??"",sourceKinds:X(t.get("source")),harness:X(t.get("harness")),project:X(t.get("project")),timeWindow:s}}function Jn(e,t={}){const n=new URLSearchParams,s=e.query.trim();return s&&n.set("q",s),e.sourceKinds.length>0&&n.set("source",e.sourceKinds.join(",")),e.harness.length>0&&n.set("harness",e.harness.join(",")),e.project.length>0&&n.set("project",e.project.join(",")),e.timeWindow!=="all"&&n.set("time",e.timeWindow),t.hitId&&n.set("hit",t.hitId),n}function bo(e,t){return e.query.trim()===t.query.trim()&&e.timeWindow===t.timeWindow&&Z(e.sourceKinds,t.sourceKinds)&&Z(e.harness,t.harness)&&Z(e.project,t.project)}function Z(e,t){if(e.length!==t.length)return!1;const n=[...e].map(o=>o.trim().toLowerCase()).sort(),s=[...t].map(o=>o.trim().toLowerCase()).sort();return n.every((o,r)=>o===s[r])}function es(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function Lo(e){if(e==="all")return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:Date.now()-t*24*60*60*1e3}function yo(e){return e==="all"?"Any time":Pt.find(n=>n.value===e)?.label??e}const Ct=typeof window<"u"?window.location.href:"http://scout.local/";function ts(e){const t=e.toString();return new URL(t,Ct)}function ns(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function ss(e){const t=e.trim().replace(/^#/,"");if(!t.startsWith("msg-"))return null;const n=t.slice(4).trim();if(!n)return null;try{return decodeURIComponent(n)}catch{return n}}function os(e){switch(e){case"control":case"mission":case"command":case"warroom":case"conduct":case"conductor":return"mission";case"plan":return"plan";case"issues":case"errors":case"warnings":return"issues";case"agents":case"tail":case"atop":case"lanes":return e;default:return}}function rs(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function as(e){return e==="indexer"||e==="knowledge"?e:void 0}function is(e){switch(e){case"pairing":case"agents":case"appearance":case"operator":case"comms":case"credentials":case"voice":case"devices":case"about":return e;case"communications":return"comms";default:return}}function cs(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function us(e){const t=e?.trim().replace(/\.+$/u,"");return t==="observe"||t==="takeover"?t:void 0}function ls(e){const t=e?.trim().toLowerCase();return t==="pty"||t==="tmux"||t==="zellij"||t==="herdr"?t:void 0}function ds(e){const t=e?.trim().toLowerCase();return t==="shell"||t==="claude"||t==="codex"||t==="pi"?t:void 0}function fs(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function ke(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isSafeInteger(t)&&t>0?t:void 0}function Oe(e){return e==="mission"?"control":e}function ms(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:rt()}function ps(e){return e==="tail"}function gs(e){return e==="lanes"}function _t(e){return ps(e)||gs(e)}const ve="machineId",At=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function hs(e){return e.searchParams.get(ve)?.trim()||void 0}function ws(e,t){return!t||!At.has(e.view)?e:{...e,machineId:t}}function Se(e){return At.has(e.view)}function Is(e){return"machineId"in e&&e.machineId?e.machineId:null}function xe(e,t){if(!Se(e))return e;const n={...e},s=t?.trim();return s?n.machineId=s:delete n.machineId,n}function Eo(e){return Se(e)?{...e,machineId:""}:e}function vs(e,t){return Se(e)?"machineId"in e?xe(e,e.machineId??null):xe(e,Is(t)):e}function U(e,t){"machineId"in t&&t.machineId&&e.set(ve,t.machineId)}function v(e){const t=e.toString();return t?`?${t}`:""}function O(e,t){const n=new URLSearchParams;return U(n,t),`${e}${v(n)}`}function Ss(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function Ut(e){const t=ts(e),n=t.pathname.replace(/^\/+/,"").split("/").filter(Boolean),s=hs(t),o=u=>ws(u,s),r=kn(n,t,o);if(r)return r;const i=ss(t.hash),a=ns(t.searchParams.get("tab"))??(i?"message":void 0),c=t.searchParams.get("project")?.trim()||void 0,d=t.searchParams.get("agentId")?.trim()||void 0;if(n[0]==="agent"&&n[1])return{view:"agent-info",conversationId:decodeURIComponent(n[1])};const f=t.searchParams.get("project")?.trim()||void 0,y=t.searchParams.get("harness")?.trim()||void 0,_=t.searchParams.get("node")?.trim()||void 0,g=t.searchParams.get("set")?.trim(),w=g==="live"||g==="ephemeral"||g==="archived"?g:void 0,R=t.searchParams.get("view")?.trim(),T=R==="sessions"||R==="agents"?R:void 0,A=t.searchParams.get("state")?.trim(),be=A==="needs"||A==="live"||A==="idle"?A:void 0,Ot=t.searchParams.get("ephemeral")==="1",W=t.searchParams.get("session")?.trim()||void 0,b=t.searchParams.get("select")?.trim()||void 0,$={...y?{harness:y}:{},..._?{node:_}:{},...w?{set:w}:{},...T?{indexView:T}:{},...be?{stateFilter:be}:{},...Ot?{showEphemeral:!0}:{}};if(n[0]==="projects"){const u=n[1]?decodeURIComponent(n[1]):void 0;if(!u)return o({view:"agents-v2",...b?{selectedAgentId:b}:{},...$});if(n[2]==="agents"){const l=n[3]?decodeURIComponent(n[3]):void 0;if(l){if(n[4]==="c"&&n[5])return o({view:"agents-v2",projectSlug:u,agentId:l,conversationId:decodeURIComponent(n[5]),tab:a??"message",...$});const m=n[4]==="sessions"&&n[5]?decodeURIComponent(n[5]):W;return o({view:"agents-v2",projectSlug:u,agentId:l,...m?{sessionId:m}:{},...a?{tab:a}:{},...$})}return o({view:"agents-v2",projectSlug:u,indexView:"agents",...b?{selectedAgentId:b}:{},...$})}return n[2]==="sessions"?o({view:"agents-v2",projectSlug:u,indexView:"sessions",...n[3]?{sessionId:decodeURIComponent(n[3])}:{},...b?{selectedAgentId:b}:{},...$}):o({view:"agents-v2",projectSlug:u,...b?{selectedAgentId:b}:{},...$})}if(n[0]==="agents-v2"&&n[1]==="sessions"&&n[2])return o({view:"agents-v2",sessionId:decodeURIComponent(n[2]),...b?{selectedAgentId:b}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents-v2"&&n[1]){const u=decodeURIComponent(n[1]);return o({view:"agents-v2",agentId:u,...a?{tab:a}:{},...W?{sessionId:W}:{},...f?{projectSlug:f}:{},...$})}if(n[0]==="agents-v2")return o({view:"agents-v2",...b?{selectedAgentId:b}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents"&&n[1]){const u=decodeURIComponent(n[1]),l=n[2]==="sessions"&&n[3]?decodeURIComponent(n[3]):W;return n[2]==="c"&&n[3]?o({view:"agents-v2",agentId:u,conversationId:decodeURIComponent(n[3]),tab:a??"message",...$}):o({view:"agents-v2",agentId:u,...l?{sessionId:l}:{},...a?{tab:a}:{},...$})}if(n[0]==="agents")return o({view:"agents-v2",...b?{selectedAgentId:b}:{},...f?{projectSlug:f}:{},...$});if(n[0]==="agents.deprecated"&&n[1]&&n[2]==="sessions"&&n[3])return o({view:"sessions",agentId:decodeURIComponent(n[1]),sessionId:decodeURIComponent(n[3])});if(n[0]==="agents.deprecated"&&n[1]&&n[2]==="c"&&n[3])return o({view:"agents-v2",agentId:decodeURIComponent(n[1]),conversationId:decodeURIComponent(n[3]),tab:a??"message"});if(n[0]==="agents.deprecated"&&n[1]){const u=decodeURIComponent(n[1]);return o({view:"agents-v2",agentId:u,...a?{tab:a}:{},...!a&&c?{projectSlug:c}:{}})}if(n[0]==="agents.deprecated")return o({view:"agents-v2",...c?{projectSlug:c}:{}});if(n[0]==="fleet")return o({view:"inbox"});if(n[0]==="c"&&n[1])return o({view:"conversation",conversationId:decodeURIComponent(n[1])});if(n[0]==="flights"&&n[1]&&n[2]==="observe"){const u=t.searchParams.get("session")?.trim()||void 0,l=t.searchParams.get("compare")?.trim()||void 0;return o({view:"sessions",flightId:decodeURIComponent(n[1]),...u?{sessionId:u}:{},...l?{compareSessionId:l}:{}})}if(n[0]==="sessions"&&n[1])return o({view:"sessions",sessionId:decodeURIComponent(n[1]),...d?{agentId:d}:{}});if(n[0]==="conversations")return o({view:"messages"});if(n[0]==="messages"){const u={view:"messages",...n[1]?{conversationId:decodeURIComponent(n[1])}:{}};return o(u)}if(n[0]==="sessions")return o({view:"sessions",...d?{agentId:d}:{}});if(n[0]==="repos"){const u=t.searchParams.get("root")?.trim()||void 0;return o({view:"repos",...u?{root:u}:{}})}if(n[0]==="providers"||n[0]==="harnesses")return o({view:"harnesses"});if(n[0]==="repo-diff"){const u=t.searchParams.get("path")?.trim();if(u){const l=t.searchParams.getAll("layer").filter(I=>I==="unstaged"||I==="staged"||I==="branch"),m=t.searchParams.getAll("file").map(I=>I.trim()).filter(Boolean),p=t.searchParams.get("sessionId")?.trim()||void 0,S=t.searchParams.get("agentId")?.trim()||void 0,E=fs(t.searchParams.get("include"));return{view:"repo-diff",path:u,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...S?{agentId:S}:{},...E?{include:E}:{}}}}if(n[0]==="search"){const u=as(n[1]),l=t.searchParams.get("hit")?.trim()||void 0,m=Zn(t.searchParams);return{view:"search",...u&&u!=="knowledge"?{mode:u}:{},...l?{hitId:l}:{},...es(m)?{filters:m}:{}}}if(n[0]==="channels"&&n[1])return o({view:"messages",conversationId:decodeURIComponent(n[1])});if(n[0]==="channels")return o({view:"messages"});if(n[0]==="mesh")return o({view:"mesh"});if(n[0]==="mesh-ops")return o({view:"mesh-ops",...n[1]?{itemId:decodeURIComponent(n[1])}:{}});if(n[0]==="dispatch"||n[0]==="broker"){const u=t.searchParams.get("attempt")?.trim()||void 0,l=rs(t.searchParams.get("filter"));return{view:"broker",...u?{attemptId:u}:{},...l&&l!=="all"?{filter:l}:{}}}if(n[0]==="code"){const u=t.searchParams.get("wt")?.trim()||void 0,l=t.searchParams.get("fromConversation")?.trim()||void 0,m=ke(t.searchParams.get("line")),p=ke(t.searchParams.get("endLine")),S=m&&p&&p>=m?p:void 0;if(n[1]){const C=decodeURIComponent(n[1]),P=n.length>2?n.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:C,...P?{path:P}:{},...u?{wt:u}:{},...m?{line:m}:{},...S?{endLine:S}:{},...l?{returnConversationId:l}:{}}}const E=t.searchParams.get("root")?.trim()||void 0,I=t.searchParams.get("file")?.trim()||void 0;return{view:"code",...E?{root:E}:{},...I?{file:I}:{},...u?{wt:u}:{},...m?{line:m}:{},...S?{endLine:S}:{},...l?{returnConversationId:l}:{}}}if(n[0]==="briefings"&&n[1])return{view:"briefings",briefingId:decodeURIComponent(n[1])};if(n[0]==="briefings")return{view:"briefings"};if(n[0]==="activity")return o({view:"activity"});if(n[0]==="voice")return{view:"voice"};if(n[0]==="work"&&n[1])return o({view:"work",workId:decodeURIComponent(n[1])});if(n[0]==="follow"){const u=cs(t.searchParams.get("view")),l={view:"follow",...u?{preferredView:u}:{}},m=n[1],p=n[2]?decodeURIComponent(n[2]):"";m==="flight"&&p&&(l.flightId=p),m==="invocation"&&p&&(l.invocationId=p),m==="conversation"&&p&&(l.conversationId=p),m==="work"&&p&&(l.workId=p),m==="session"&&p&&(l.sessionId=p),m==="agent"&&p&&(l.targetAgentId=p);const S=t.searchParams.get("flightId"),E=t.searchParams.get("invocationId"),I=t.searchParams.get("conversationId"),C=t.searchParams.get("workId"),P=t.searchParams.get("sessionId"),Le=t.searchParams.get("targetAgentId");return S&&(l.flightId=S),E&&(l.invocationId=E),I&&(l.conversationId=I),C&&(l.workId=C),P&&(l.sessionId=P),Le&&(l.targetAgentId=Le),o(l)}if(n[0]==="settings"){if(n[1]==="agents")return{view:"settings",section:"agents",...n[2]?{agentId:decodeURIComponent(n[2])}:{}};const u=is(n[1]);return{view:"settings",...u?{section:u}:{}}}if(n[0]==="terminal"){const u=us(t.searchParams.get("mode")),l=t.searchParams.get("session")?.trim()||void 0,m=Wt(t.searchParams.get("surface"))??void 0;if(n[1]==="new"){const S=ls(t.searchParams.get("backend"))??"pty",E=ds(t.searchParams.get("agent"))??"shell",I=t.searchParams.get("name")?.trim()||void 0,C=t.searchParams.get("tab")?.trim()||void 0,P=t.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:S,terminalAgent:E,...I?{terminalSessionName:I}:{},...C?{terminalTabId:C}:{},...P?{zellijSocketDir:P}:{}}}const p=n[1]==="s"&&n[2]?ze(decodeURIComponent(n.slice(2).join("/")))?decodeURIComponent(n.slice(2).join("/")):null:Kt(n[1]?decodeURIComponent(n[1]):void 0,n[2]?decodeURIComponent(n.slice(2).join("/")):void 0);return p?{view:"terminal",terminalSurfaceKey:p,...l?{terminalSessionId:l}:{},...u?{mode:u}:{}}:{view:"terminal",...n[1]?{agentId:decodeURIComponent(n[1])}:{},...u?{mode:u}:{},...!n[1]&&l?{terminalSessionId:l}:{},...!n[1]&&m?{terminalSurfaceKey:m}:{}}}if(n[0]==="ops"){const u=os(n[1])??"mission";if(!_t(u)&&!ms(t))return o({view:"inbox"});const l=u==="tail"?t.searchParams.get("q")?.trim():"",m=u==="plan"?t.searchParams.get("plan")?.trim():"",p=t.searchParams.get("flightId")?.trim(),S=t.searchParams.get("invocationId")?.trim(),E=t.searchParams.get("conversationId")?.trim(),I=t.searchParams.get("workId")?.trim(),C=t.searchParams.get("sessionId")?.trim(),P=t.searchParams.get("targetAgentId")?.trim()??t.searchParams.get("agentId")?.trim();return{view:"ops",mode:u,...l?{tailQuery:l}:{},...m?{planDocumentId:m}:{},...p?{flightId:p}:{},...S?{invocationId:S}:{},...E?{conversationId:E}:{},...I?{workId:I}:{},...C?{sessionId:C}:{},...P?{targetAgentId:P}:{}}}return o({view:"inbox"})}function Ft(e,t){const n=e.view==="sessions"&&e.flightId?null:St(e,t);if(n)return n;switch(e.view){case"inbox":return O("/",e);case"conversation":{const s=new URLSearchParams;return U(s,e),`/c/${encodeURIComponent(e.conversationId)}${v(s)}`}case"agent-info":return`/agent/${encodeURIComponent(e.conversationId)}`;case"agents-v2":{const s=new URLSearchParams;e.harness&&s.set("harness",e.harness),e.node&&s.set("node",e.node),e.set&&s.set("set",e.set),!e.projectSlug&&e.indexView&&e.indexView!=="agents"&&s.set("view",e.indexView),e.stateFilter&&s.set("state",e.stateFilter),e.showEphemeral&&s.set("ephemeral","1"),e.selectedAgentId&&!e.agentId&&!e.sessionId&&s.set("select",e.selectedAgentId);const o=e.conversationId?"message":"profile";e.agentId&&e.tab&&e.tab!==o&&s.set("tab",e.tab),U(s,e);const r=e.projectSlug?`/projects/${encodeURIComponent(e.projectSlug)}`:null;return`${r?e.agentId?e.conversationId?`${r}/agents/${encodeURIComponent(e.agentId)}/c/${encodeURIComponent(e.conversationId)}`:e.sessionId?`${r}/agents/${encodeURIComponent(e.agentId)}/sessions/${encodeURIComponent(e.sessionId)}`:`${r}/agents/${encodeURIComponent(e.agentId)}`:e.sessionId?`${r}/sessions/${encodeURIComponent(e.sessionId)}`:e.indexView==="sessions"?`${r}/sessions`:e.indexView==="agents"?`${r}/agents`:r:e.agentId?e.conversationId?`/agents/${encodeURIComponent(e.agentId)}/c/${encodeURIComponent(e.conversationId)}`:e.sessionId?`/agents/${encodeURIComponent(e.agentId)}/sessions/${encodeURIComponent(e.sessionId)}`:`/agents/${encodeURIComponent(e.agentId)}`:e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/projects"}${v(s)}`}case"messages":{const s=new URLSearchParams;return U(s,e),`${e.conversationId?`/messages/${encodeURIComponent(e.conversationId)}`:"/messages"}${v(s)}`}case"sessions":{const s=new URLSearchParams;return e.agentId&&s.set("agentId",e.agentId),e.flightId?(e.sessionId&&s.set("session",e.sessionId),e.compareSessionId&&s.set("compare",e.compareSessionId),U(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${v(s)}`):(U(s,e),`${e.sessionId?`/sessions/${encodeURIComponent(e.sessionId)}`:"/sessions"}${v(s)}`)}case"repos":{const s=new URLSearchParams;return e.root&&s.set("root",e.root),U(s,e),`/repos${v(s)}`}case"harnesses":return O("/providers",e);case"repo-diff":{const s=new URLSearchParams;s.set("path",e.path);for(const o of e.layers??[])s.append("layer",o);for(const o of e.files??[])s.append("file",o);return e.sessionId&&s.set("sessionId",e.sessionId),e.agentId&&s.set("agentId",e.agentId),e.include&&s.set("include",e.include),`/repo-diff${v(s)}`}case"search":{const s=e.mode==="indexer"?"/search/indexer":"/search",o=e.filters?Jn(e.filters,{hitId:e.hitId??null}):new URLSearchParams;return!e.filters&&e.hitId&&o.set("hit",e.hitId),`${s}${v(o)}`}case"mesh":return O("/mesh",e);case"mesh-ops":return O(e.itemId?`/mesh-ops/${encodeURIComponent(e.itemId)}`:"/mesh-ops",e);case"broker":{const s=new URLSearchParams;return e.attemptId&&s.set("attempt",e.attemptId),e.filter&&e.filter!=="all"&&s.set("filter",e.filter),`/dispatch${v(s)}`}case"code":{const s=new URLSearchParams;if(e.wt&&s.set("wt",e.wt),e.line&&s.set("line",String(e.line)),e.line&&e.endLine&&e.endLine>=e.line&&s.set("endLine",String(e.endLine)),e.project){e.returnConversationId&&s.set("fromConversation",e.returnConversationId);const r=[encodeURIComponent(e.project)];return e.path&&r.push(...e.path.split("/").map(encodeURIComponent)),`${`/code/${r.join("/")}`}${v(s)}`}e.root&&s.set("root",e.root),e.file&&s.set("file",e.file),e.returnConversationId&&s.set("fromConversation",e.returnConversationId);const o=s.toString();return o?`/code?${o}`:"/code"}case"briefings":return e.briefingId?`/briefings/${encodeURIComponent(e.briefingId)}`:"/briefings";case"activity":return O("/activity",e);case"voice":return"/voice";case"work":return O(`/work/${encodeURIComponent(e.workId)}`,e);case"settings":return e.section==="agents"?e.agentId?`/settings/agents/${encodeURIComponent(e.agentId)}`:"/settings/agents":e.section?e.section==="pairing"?"/settings/pairing":e.section==="comms"?"/settings/comms":`/settings/${e.section}`:"/settings";case"ops":if(!e.mode)return"/ops";if(e.mode==="tail"||e.mode==="plan"){const s=new URLSearchParams;return e.mode==="tail"&&e.tailQuery&&s.set("q",e.tailQuery),e.mode==="plan"&&e.planDocumentId&&s.set("plan",e.planDocumentId),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),`/ops/${Oe(e.mode)}${v(s)}`}return`/ops/${Oe(e.mode)}`;case"follow":{const s=new URLSearchParams;e.preferredView&&s.set("view",e.preferredView),e.flightId&&s.set("flightId",e.flightId),e.invocationId&&s.set("invocationId",e.invocationId),e.conversationId&&s.set("conversationId",e.conversationId),e.workId&&s.set("workId",e.workId),e.sessionId&&s.set("sessionId",e.sessionId),e.targetAgentId&&s.set("targetAgentId",e.targetAgentId),e.machineId&&s.set(ve,e.machineId);const o=s.toString();return`/follow${o?`?${o}`:""}`}case"terminal":if(e.agentId){const s=new URLSearchParams;return e.mode&&s.set("mode",e.mode),`/terminal/${encodeURIComponent(e.agentId)}${v(s)}`}{const s=new URLSearchParams;if(e.terminalBackend)return e.terminalBackend!=="pty"&&s.set("backend",e.terminalBackend),e.terminalAgent&&e.terminalAgent!=="shell"&&s.set("agent",e.terminalAgent),e.terminalSessionName&&s.set("name",e.terminalSessionName),e.terminalTabId&&s.set("tab",e.terminalTabId),e.zellijSocketDir&&s.set("socketDir",e.zellijSocketDir),`/terminal/new${v(s)}`;e.mode&&s.set("mode",e.mode);const o=Gt(e.terminalSurfaceKey);return o?`/terminal/${encodeURIComponent(o.backend)}/${encodeURIComponent(o.sessionName)}${v(s)}`:ze(e.terminalSurfaceKey)?`/terminal/s/${encodeURIComponent(e.terminalSurfaceKey)}${v(s)}`:(e.terminalSessionId&&s.set("session",e.terminalSessionId),e.terminalSurfaceKey&&s.set("surface",e.terminalSurfaceKey),`/terminal${v(s)}`)}}}function N(e){const t=Ss(e);switch(e.view){case"conversation":return`conv:${e.conversationId}${t}`;case"agent-info":return`agent-info:${e.conversationId}`;case"settings":return`settings:${e.section??"pairing"}:${e.agentId??""}`;case"agents-v2":return["agents-v2",e.projectSlug??"",e.harness??"",e.node??"",e.set??"",e.indexView??"agents",e.stateFilter??"",e.showEphemeral?"eph":"",e.agentId??"",e.sessionId??"",t].join(":");case"sessions":return e.flightId?`flight-observe:${e.flightId}:${e.sessionId??""}:${e.compareSessionId??""}${t}`:e.sessionId?`session:${e.agentId??""}:${e.sessionId}${t}`:`sessions${t}`;case"messages":return e.conversationId?`messages:${e.conversationId}${t}`:`messages${t}`;case"work":return`work:${e.workId}${t}`;case"ops":return`ops:${e.mode??"plan"}:${e.tailQuery??""}:${e.planDocumentId??""}:${e.flightId??""}:${e.invocationId??""}:${e.workId??""}:${e.conversationId??""}:${e.sessionId??""}:${e.targetAgentId??""}`;case"search":return`search:${e.mode??"knowledge"}:${e.hitId??""}`;case"broker":return`broker:${e.attemptId??""}`;case"follow":return`follow:${e.flightId??e.invocationId??e.conversationId??e.workId??e.sessionId??e.targetAgentId??""}:${e.preferredView??""}${t}`;case"terminal":return`terminal:${e.agentId??""}:${e.terminalSessionId??""}:${e.terminalSurfaceKey??""}:${e.terminalBackend??""}:${e.terminalAgent??""}:${e.terminalSessionName??""}:${e.terminalTabId??""}:${e.mode??"detail"}`;case"repo-diff":return`repo-diff:${e.path}`;default:return`${e.view}${t}`}}function G(e,t){return ue(Ut(`${e}${t}`))}function Tt(e){return e?`#${e}`:""}function bs(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function De(){if(typeof window>"u"){const e=new URL(Ct);return{pathname:e.pathname,searchStr:e.search,hash:e.hash.replace(/^#/,""),state:null}}return{pathname:window.location.pathname,searchStr:window.location.search,hash:window.location.hash.replace(/^#/,""),state:window.history.state}}function Ls(e,t){return e.pathname===t.pathname&&e.searchStr===t.searchStr&&e.hash===t.hash&&Object.is(e.state,t.state)}function ys(e){let t=e.read();const n=new Set;let s=null;const o=()=>{const r=e.read();if(!Ls(t,r)){t=r;for(const i of n)i()}};return{getSnapshot:()=>t,subscribe(r){return s||(s=e.observe(o)),n.add(r),()=>{n.delete(r)}},navigateTo(r,i={}){const a=i.state===void 0?t.state:i.state;i.replace?e.replace(r,a):e.push(r,a),o()}}}function Es(){return typeof window>"u"?{read:De,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:De,push:(e,t)=>window.history.pushState(t,"",e),replace:(e,t)=>window.history.replaceState(t,"",e),observe:e=>(window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)})}}const D=ys(Es());function $s(){return L.useSyncExternalStore(D.subscribe,D.getSnapshot,D.getSnapshot)}function ie(e,t={}){D.navigateTo(e,t)}function $o(e){if(!e||typeof e!="object")return null;const t=e.returnTo;return!t||typeof t!="object"||typeof t.view!="string"?null:t}function Ro(e){return!e||typeof e!="object"?!1:e.returnUseHistory===!0}function je(e){if(!e||typeof e!="object")return e;const{returnTo:t,returnUseHistory:n,settingsEntry:s,...o}=e;return o}function Rs(e,t){if(t.returnTo!==void 0){const n=t.state!==void 0?t.state:je(e),s=n&&typeof n=="object"?{...n}:{};return s.returnTo=t.returnTo,s.returnUseHistory=t.replace!==!0,s}return t.state!==void 0?t.state:t.replace?e:je(e)}function kt(e){return e?e.replace(/^#/,""):""}function Ps(e,t,n={}){const s=G(e.pathname,e.searchStr),o=vs(t,s),r=n.preserveSearch===!1?"":e.searchStr,i=vt(Ft(o,e.pathname),r),a=kt(n.hash);return{route:o,href:`${i}${a?`#${a}`:""}`}}function Cs(e,t){const n=new URLSearchParams(e.searchStr);for(const[r,i]of Object.entries(t.searchPatch??{}))i===null?n.delete(r):n.set(r,i);const s=n.toString(),o=t.hash===void 0?e.hash:kt(t.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function Po(e){const t=D.getSnapshot(),n=Cs(t,e),s=`${t.pathname}${t.searchStr}${Tt(t.hash)}`;n!==s&&ie(n,{replace:e.replace??!0,state:e.state})}function _s(e,t,n){if(bs(e))return null;const s=`${e}${t}`,o=Ut(s),r=ue(o),i=vt(Ft(r,e),t);return!(N(o)!==N(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${Tt(n)}`}function Co(){const{pathname:e,searchStr:t,hash:n}=$s(),s=`${e}${t}`,o=L.useMemo(()=>G(e,t),[e,t]),r=L.useRef({}),i=L.useRef(s);L.useEffect(()=>{const c=_s(e,t,n);c&&ie(c,{replace:!0})},[e,t,n]),L.useEffect(()=>{if(i.current===s)return;const c=G(e,t);requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(c)]??0)}),i.current=s},[s,e,t]);const a=L.useCallback((c,d={})=>{const f=ue(c.view==="ops"&&!rt()&&!_t(c.mode)?{view:"inbox"}:c),y=G(e,t),{route:_,href:g}=Ps({pathname:e,searchStr:t},f,d);r.current[N(y)]=window.scrollY;const w=D.getSnapshot().state,R=Rs(w,d);ie(g,{replace:d.replace,state:R}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(_)]??0)})},[e,t]);return{route:o,navigate:a}}export{Ys as $,ge as A,F as B,io as C,lo as D,uo as E,Lo as F,wo as G,yo as H,Fs as I,un as J,ro as K,cn as L,ln as M,dn as N,js as O,Po as P,to as Q,It as R,vo as S,wt as T,so as U,Ks as V,zs as W,Gs as X,Pn as Y,Ws as Z,En as _,Ft as a,Cn as a0,Qs as a1,Xs as a2,qs as a3,Zs as a4,Hs as a5,Vs as a6,Bs as a7,it as a8,at as a9,go as aA,re as aB,mo as aC,fo as aD,Et as aE,Se as aa,Js as ab,eo as ac,V as ad,ne as ae,Os as af,oe as ag,Q as ah,Tn as ai,jn as aj,kn as ak,vt as al,Nn as am,rn as an,no as ao,St as ap,Ye as aq,oo as ar,Co as as,Ve as at,qt as au,bt as av,B as aw,ao as ax,po as ay,$t as az,Is as b,Eo as c,Ts as d,et as e,Ds as f,le as g,xs as h,Ns as i,Ms as j,$s as k,$o as l,Ro as m,So as n,ho as o,Zn as p,es as q,Ut as r,xe as s,bo as t,ks as u,Io as v,pn as w,Pt as x,co as y,Bn as z};
@@ -1 +1 @@
1
- import{r,j as t,u as Ce}from"./index-DMiGbrBt.js";import{g as ke,e as Ne,s as Me,a as de,f as Re}from"./scout-voice-CU5c0LGi.js";import{createLevelHistory as Ee,energyFromPartialDelta as me,tryStartMicLevelMeter as Le,VOICE_WAVE_BARS as he}from"./voice-levels-Dcr3jglk.js";import{L as Ve}from"./loader-circle-CbHjZsz1.js";import{c as ge}from"./createLucideIcon-OpA4Amw5.js";const Ae=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Be=ge("mic",Ae);const _e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pe=ge("square",_e);function Te(e,n=!1){return e.key==="Enter"&&!e.shiftKey&&(n||!!(e.metaKey||e.ctrlKey))&&!e.nativeEvent?.isComposing}function De(e){switch(e){case"starting":return"starting";case"recording":return"recording";case"processing":return"processing";default:return"idle"}}function qe(e,n,l){if(l)return l;switch(e){case"starting":return"Starting voice…";case"recording":return n.trim()?n.trim():null;case"processing":return"Transcribing…";default:return null}}function fe(e){return new Promise(n=>window.setTimeout(n,e))}function Fe({onAppend:e,onError:n,onStatus:l,disabled:L,className:m}){const h=r.useRef(ke()),u=r.useRef(null),g=r.useRef(Ee(he)),K=r.useRef(null),C=r.useRef(!1),S=r.useRef(""),T=r.useRef(0),b=r.useRef(0),[v,k]=r.useState("idle"),[G,_]=r.useState(""),[J,D]=r.useState("probing"),[se,q]=r.useState(null),[R,V]=r.useState(null),[P,W]=r.useState(null),[Q,y]=r.useState(0),N=r.useCallback(()=>{b.current&&(window.cancelAnimationFrame(b.current),b.current=0),K.current?.stop(),K.current=null,C.current=!1},[]),j=r.useCallback(s=>{W(s),n?.(s)},[n]),X=r.useCallback((s,i,o)=>{l?.({state:s,partial:i,message:qe(s,i,o),tone:o?"error":s==="recording"?"recording":s==="processing"?"processing":"neutral",levels:s==="idle"&&!o?[]:g.current.snapshot(),levelsLive:C.current})},[l]);r.useEffect(()=>{X(v,G,P)},[X,P,G,v,Q]);const A=r.useCallback(async(s=!1)=>{const i=h.current;D(x=>x==="launching"?x:"probing");const o=await i.probe(s?{force:!0}:void 0);return q(o),V(null),D("idle"),o},[]);r.useEffect(()=>{Ne();const s=h.current,i=Me(o=>{q(o.ok),V(null),D("idle")});return s.connectionState==="unknown"?A():(q(s.connectionState==="connected"),V(null),D("idle")),()=>{i(),N();const o=u.current;o&&(o.cancel().catch(()=>{}),u.current=null)}},[A,N]);const B=r.useCallback(s=>{g.current.push(s),y(i=>i+1)},[]),Z=r.useCallback(()=>{if(b.current)return;let s=performance.now();const i=o=>{if(o-s>=36){s=o;const x=o-(T.current||o),w=me(S.current,S.current,x);g.current.push(Math.max(.05,w)),y(c=>c+1)}b.current=window.requestAnimationFrame(i)};b.current=window.requestAnimationFrame(i)},[]),ee=r.useCallback(async()=>{const s=h.current;W(null),_(""),S.current="",T.current=performance.now(),g.current.clear(),y(c=>c+1),k("starting"),N();let i=await de({surface:"chat-composer",requestPermissions:!0});if(!i.ready&&i.issue?.code==="microphone_not_requested"&&(await fe(1800),i=await de({surface:"chat-composer"})),!(i.ready||i.issue?.code==="microphone_not_requested")){k("idle");const c=i.issue;c?(V(c),j(Re(c))):j("Scout voice is not ready."),A(!0);return}V(null),q(!0);let x=null,w=!1;try{if(x=await s.startLive({onState:p=>k(De(p)),onPartial:p=>{const U=S.current;if(S.current=p,T.current=performance.now(),_(p),!C.current){const ce=me(U,p,0);B(ce)}},onLevel:p=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(p)}}),u.current=x,k("recording"),await fe(140),u.current&&!w&&!C.current){const p=await Le(U=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(U)});p&&u.current?K.current=p:u.current&&!C.current&&(C.current=!1,Z())}const c=await x.result;u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",W(null),g.current.clear(),y(p=>p+1);const E=c.text?.trim()||$;E?e(E):j("No speech was detected. Check your microphone in Settings → Voice."),A(!0)}catch(c){u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",g.current.clear(),y(p=>p+1);const E=c instanceof Error?c.message:"Scout voice recording failed.";if($){e($),c instanceof Error&&c.name==="AbortError"||j(`Recording ended early, but Scout recovered the partial transcript. ${E}`);return}if(c instanceof Error&&c.name==="AbortError")return;j(E),A(!0)}},[e,A,B,j,Z,N]),te=r.useCallback(async()=>{const s=u.current;if(!s)return;k("processing"),N();const i=window.setInterval(()=>{g.current.decay(.82),y(o=>o+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await s.stop()}catch(o){try{await s.cancel()}catch{}u.current=null,k("idle");const x=S.current.trim();_(""),S.current="",g.current.clear(),y(c=>c+1);const w=o instanceof Error?o.message:"Scout voice recording did not finish.";x?(e(x),j(`Recording ended early, but Scout recovered the partial transcript. ${w}`)):j(w)}},[e,j,N]),ne=r.useCallback(()=>{if(v==="recording"){te();return}v==="processing"||v==="starting"||ee()},[v,ee,te]),f=v==="recording",M=J==="launching"||v==="starting"||v==="processing",z=(h.current.canRequestMicrophone||R?.action==="request_microphone"||R?.action==="request_speech")&&!f&&!M,O=(h.current.isMicrophoneHardDenied||R?.action==="open_microphone_settings")&&!f&&!M,F=(se===!1||R!==null)&&!z&&!O&&!f&&!M,I=P||(R?R.title:O?"Microphone blocked. Open Privacy & Security → Microphone to change it.":z?"Allow microphone access":F?"Scout voice is not ready":J==="probing"?"Checking voice…":f?"Stop recording":v==="processing"?"Transcribing…":v==="starting"?"Starting voice…":"Start recording"),oe=P?"s-dictation-mic--error":f?"s-dictation-mic--recording":O?"s-dictation-mic--error":z?"s-dictation-mic--needs-permission":F?"s-dictation-mic--unavailable":M?"s-dictation-mic--busy":"",H=M?Ve:f?Pe:Be,d=f?12:14;return t.jsx("button",{type:"button",title:I,"aria-label":I,"aria-pressed":f,onClick:ne,disabled:L||v==="processing",className:["s-dictation-mic",oe,m].filter(Boolean).join(" "),children:t.jsx(H,{size:d,className:M?"s-dictation-mic-spin":f?"fill-current":""})})}function Ie({samples:e,active:n,processing:l=!1,className:L}){const m=$e(e,he,l?.06:.04),h=["s-msg-compose-wave",n?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",L??""].filter(Boolean).join(" ");return t.jsx("div",{className:h,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:m.map((u,g)=>t.jsx("span",{className:"s-msg-compose-wave-bar",style:{transform:`scaleY(${Math.max(.08,u)})`,opacity:l?.28+u*.35:n?.4+u*.55:.25}},g))})}function $e(e,n,l){if(!e||e.length===0)return Array.from({length:n},()=>l);if(e.length===n)return e.map(m=>Math.max(l,Math.min(1,m)));const L=new Array(n);for(let m=0;m<n;m+=1){const h=Math.min(e.length-1,Math.round(m/Math.max(1,n-1)*(e.length-1)));L[m]=Math.max(l,Math.min(1,e[h]??l))}return L}function Ke(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M12 19V5"}),t.jsx("path",{d:"m5 12 7-7 7 7"})]})}function We(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function ze(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("path",{d:"M21.44 11.05 12.05 20.44a5.5 5.5 0 0 1-7.78-7.78l9.19-9.19a3.5 3.5 0 0 1 4.95 4.95l-9.2 9.19a1.5 1.5 0 0 1-2.12-2.12l8.49-8.48"})})}function pe(e,n){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,n)}px`}function Oe(e){return e.tone==="error"?"Voice":e.state==="recording"?"Listening":e.state==="processing"?"Transcribing":e.state==="starting"?"Starting":"Voice"}function Xe({renderWhenEmbedded:e=!1,...n}){return Ce()&&!e?null:t.jsx(He,{...n})}function He({value:e,onChange:n,onSend:l,placeholder:L="Type a message…",disabled:m=!1,sending:h=!1,canSend:u,stopMode:g=!1,onStop:K,sendTitle:C="Send (Cmd+Enter)",sendAriaLabel:S="Send message (Cmd+Enter)",stopAriaLabel:T="Stop agent",showDictation:b=!0,onDictationStatusChange:v,showAttach:k=!1,onAttach:G,attachTitle:_="Add attachment",attachAriaLabel:J="Add attachment",onPaste:D,dropHandlers:se,dragActive:q=!1,secondaryAction:R,leadingTools:V,tools:P,footer:W,header:Q,above:y,aboveAttached:N=!1,input:j,overlay:X,status:A,textareaRef:B,onKeyDown:Z,sendOnEnter:ee=!1,onSelect:te,onBlur:ne,density:f="panel",as:M="form",className:z,rows:O=1,autoResize:F=!0,maxHeightPx:I=160,"aria-label":oe="Message"}){const H=r.useRef(null),[d,s]=r.useState(null),i=r.useCallback(a=>{H.current=a,B&&(B.current=a)},[B]);r.useEffect(()=>{if(!F)return;const a=H.current;a&&pe(a,I)},[e,F,I]);const o=(u??e.trim().length>0)&&!h&&!m,x=P??W,w=d?.state==="recording"||d?.state==="starting",c=d?.state==="processing",$=!!(d&&(d.tone==="error"||w||c||d.partial&&d.partial.trim())),E=r.useCallback(()=>{g||!(u??e.trim().length>0)||h||m||l()},[u,m,l,h,g,e]),p=a=>{a.preventDefault(),E()},U=a=>{if(Z?.(a)){a.preventDefault();return}if(Te(a,ee)){a.preventDefault(),E();return}},ce=a=>{const Y=a.target.value;n(Y,{caret:a.target.selectionStart??Y.length}),F&&pe(a.target,I)},ve=a=>{const Y=e.trim()?`${e.trimEnd()} ${a}`:a;n(Y,{caret:Y.length}),requestAnimationFrame(()=>H.current?.focus())},be=r.useCallback(a=>{s(a),v?.(a)},[v]),ie=["s-msg-compose",`s-msg-compose--${f}`,f==="thread"?"s-thread-compose":"",z??""].filter(Boolean).join(" "),xe=["s-msg-compose-shell",f==="thread"?"s-thread-compose-shell":""].filter(Boolean).join(" "),Se=["s-msg-compose-input",f==="thread"?"s-thread-compose-input":""].filter(Boolean).join(" "),ae=["s-msg-compose-send",f==="thread"?"s-thread-compose-send":"",g?"s-msg-compose-send--agent-stop s-thread-compose-send--stop":""].filter(Boolean).join(" "),we=["s-msg-compose-voice",d?.tone==="recording"||w?"s-msg-compose-voice--recording":"",d?.tone==="processing"||c?"s-msg-compose-voice--processing":"",d?.tone==="error"?"s-msg-compose-voice--error":""].filter(Boolean).join(" "),re=d?.tone==="error",ye=d?.partial?.trim()||null,le=re?d?.message:c?"Finalizing transcript…":ye,je=t.jsxs("div",{className:xe,"data-drag-active":q?"true":void 0,...se,children:[Q?t.jsx("div",{className:"s-msg-compose-header",children:Q}):null,t.jsxs("div",{className:"s-msg-compose-body",children:[j??t.jsx("textarea",{ref:i,className:Se,placeholder:L,value:e,disabled:m,rows:O,"aria-label":oe,onChange:ce,onKeyDown:U,onSelect:te,onBlur:ne,onPaste:D}),$?t.jsxs("div",{className:we,role:re?"alert":"status","aria-live":re?"assertive":"polite",children:[!re&&(w||c)?t.jsx(Ie,{samples:d?.levels,active:w,processing:c}):null,t.jsxs("div",{className:"s-msg-compose-voice-meta",children:[t.jsx("span",{className:"s-msg-compose-voice-label",children:d?Oe(d):"Voice"}),le?t.jsx("span",{className:"s-msg-compose-voice-text",children:le}):null]})]}):null]}),t.jsxs("div",{className:["s-msg-compose-toolbar",f==="thread"?"s-thread-compose-footer":""].filter(Boolean).join(" "),children:[t.jsxs("div",{className:"s-msg-compose-toolbar-start",children:[V,k?t.jsx("button",{type:"button",className:"s-msg-compose-icon-btn",title:_,"aria-label":J,disabled:m||h,onClick:G,children:t.jsx(ze,{})}):V?null:t.jsx("span",{className:"s-msg-compose-toolbar-spacer","aria-hidden":"true"})]}),t.jsxs("div",{className:"s-msg-compose-toolbar-end",children:[x?t.jsx("div",{className:"s-msg-compose-tools",children:x}):null,b?t.jsx(Fe,{onAppend:ve,onStatus:be,disabled:m||h}):null,R?t.jsx("div",{className:"s-msg-compose-secondary",children:R}):null,g?t.jsx("button",{type:"button",className:ae,onClick:K,title:T,"aria-label":T,children:t.jsx(We,{})}):t.jsx("button",{type:M==="form"?"submit":"button",className:ae,disabled:!o,title:C,"aria-label":S,"data-action":"send",onClick:M==="div"?()=>E():void 0,children:t.jsx(Ke,{})})]})]}),A]}),ue=t.jsxs("div",{className:"s-msg-compose-frame","data-above-attached":y&&N?"true":void 0,children:[X,y?t.jsx("div",{className:"s-msg-compose-above",children:y}):null,je]});return M==="div"?t.jsx("div",{className:ie,children:ue}):t.jsx("form",{className:ie,onSubmit:p,children:ue})}export{Fe as D,Xe as M,Pe as S,Be as a,Te as i};
1
+ import{r,j as t,u as Ce}from"./index-sUomXsrf.js";import{g as ke,e as Ne,s as Me,a as de,f as Re}from"./scout-voice-BZ4KqADJ.js";import{createLevelHistory as Ee,energyFromPartialDelta as me,tryStartMicLevelMeter as Le,VOICE_WAVE_BARS as he}from"./voice-levels-Dcr3jglk.js";import{L as Ve}from"./loader-circle-lWOOKezu.js";import{c as ge}from"./createLucideIcon-DlxlBfLC.js";const Ae=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Be=ge("mic",Ae);const _e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pe=ge("square",_e);function Te(e,n=!1){return e.key==="Enter"&&!e.shiftKey&&(n||!!(e.metaKey||e.ctrlKey))&&!e.nativeEvent?.isComposing}function De(e){switch(e){case"starting":return"starting";case"recording":return"recording";case"processing":return"processing";default:return"idle"}}function qe(e,n,l){if(l)return l;switch(e){case"starting":return"Starting voice…";case"recording":return n.trim()?n.trim():null;case"processing":return"Transcribing…";default:return null}}function fe(e){return new Promise(n=>window.setTimeout(n,e))}function Fe({onAppend:e,onError:n,onStatus:l,disabled:L,className:m}){const h=r.useRef(ke()),u=r.useRef(null),g=r.useRef(Ee(he)),K=r.useRef(null),C=r.useRef(!1),S=r.useRef(""),T=r.useRef(0),b=r.useRef(0),[v,k]=r.useState("idle"),[G,_]=r.useState(""),[J,D]=r.useState("probing"),[se,q]=r.useState(null),[R,V]=r.useState(null),[P,W]=r.useState(null),[Q,y]=r.useState(0),N=r.useCallback(()=>{b.current&&(window.cancelAnimationFrame(b.current),b.current=0),K.current?.stop(),K.current=null,C.current=!1},[]),j=r.useCallback(s=>{W(s),n?.(s)},[n]),X=r.useCallback((s,i,o)=>{l?.({state:s,partial:i,message:qe(s,i,o),tone:o?"error":s==="recording"?"recording":s==="processing"?"processing":"neutral",levels:s==="idle"&&!o?[]:g.current.snapshot(),levelsLive:C.current})},[l]);r.useEffect(()=>{X(v,G,P)},[X,P,G,v,Q]);const A=r.useCallback(async(s=!1)=>{const i=h.current;D(x=>x==="launching"?x:"probing");const o=await i.probe(s?{force:!0}:void 0);return q(o),V(null),D("idle"),o},[]);r.useEffect(()=>{Ne();const s=h.current,i=Me(o=>{q(o.ok),V(null),D("idle")});return s.connectionState==="unknown"?A():(q(s.connectionState==="connected"),V(null),D("idle")),()=>{i(),N();const o=u.current;o&&(o.cancel().catch(()=>{}),u.current=null)}},[A,N]);const B=r.useCallback(s=>{g.current.push(s),y(i=>i+1)},[]),Z=r.useCallback(()=>{if(b.current)return;let s=performance.now();const i=o=>{if(o-s>=36){s=o;const x=o-(T.current||o),w=me(S.current,S.current,x);g.current.push(Math.max(.05,w)),y(c=>c+1)}b.current=window.requestAnimationFrame(i)};b.current=window.requestAnimationFrame(i)},[]),ee=r.useCallback(async()=>{const s=h.current;W(null),_(""),S.current="",T.current=performance.now(),g.current.clear(),y(c=>c+1),k("starting"),N();let i=await de({surface:"chat-composer",requestPermissions:!0});if(!i.ready&&i.issue?.code==="microphone_not_requested"&&(await fe(1800),i=await de({surface:"chat-composer"})),!(i.ready||i.issue?.code==="microphone_not_requested")){k("idle");const c=i.issue;c?(V(c),j(Re(c))):j("Scout voice is not ready."),A(!0);return}V(null),q(!0);let x=null,w=!1;try{if(x=await s.startLive({onState:p=>k(De(p)),onPartial:p=>{const U=S.current;if(S.current=p,T.current=performance.now(),_(p),!C.current){const ce=me(U,p,0);B(ce)}},onLevel:p=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(p)}}),u.current=x,k("recording"),await fe(140),u.current&&!w&&!C.current){const p=await Le(U=>{w=!0,C.current=!0,b.current&&(window.cancelAnimationFrame(b.current),b.current=0),B(U)});p&&u.current?K.current=p:u.current&&!C.current&&(C.current=!1,Z())}const c=await x.result;u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",W(null),g.current.clear(),y(p=>p+1);const E=c.text?.trim()||$;E?e(E):j("No speech was detected. Check your microphone in Settings → Voice."),A(!0)}catch(c){u.current=null,N(),k("idle");const $=S.current.trim();_(""),S.current="",g.current.clear(),y(p=>p+1);const E=c instanceof Error?c.message:"Scout voice recording failed.";if($){e($),c instanceof Error&&c.name==="AbortError"||j(`Recording ended early, but Scout recovered the partial transcript. ${E}`);return}if(c instanceof Error&&c.name==="AbortError")return;j(E),A(!0)}},[e,A,B,j,Z,N]),te=r.useCallback(async()=>{const s=u.current;if(!s)return;k("processing"),N();const i=window.setInterval(()=>{g.current.decay(.82),y(o=>o+1)},50);window.setTimeout(()=>window.clearInterval(i),600);try{await s.stop()}catch(o){try{await s.cancel()}catch{}u.current=null,k("idle");const x=S.current.trim();_(""),S.current="",g.current.clear(),y(c=>c+1);const w=o instanceof Error?o.message:"Scout voice recording did not finish.";x?(e(x),j(`Recording ended early, but Scout recovered the partial transcript. ${w}`)):j(w)}},[e,j,N]),ne=r.useCallback(()=>{if(v==="recording"){te();return}v==="processing"||v==="starting"||ee()},[v,ee,te]),f=v==="recording",M=J==="launching"||v==="starting"||v==="processing",z=(h.current.canRequestMicrophone||R?.action==="request_microphone"||R?.action==="request_speech")&&!f&&!M,O=(h.current.isMicrophoneHardDenied||R?.action==="open_microphone_settings")&&!f&&!M,F=(se===!1||R!==null)&&!z&&!O&&!f&&!M,I=P||(R?R.title:O?"Microphone blocked. Open Privacy & Security → Microphone to change it.":z?"Allow microphone access":F?"Scout voice is not ready":J==="probing"?"Checking voice…":f?"Stop recording":v==="processing"?"Transcribing…":v==="starting"?"Starting voice…":"Start recording"),oe=P?"s-dictation-mic--error":f?"s-dictation-mic--recording":O?"s-dictation-mic--error":z?"s-dictation-mic--needs-permission":F?"s-dictation-mic--unavailable":M?"s-dictation-mic--busy":"",H=M?Ve:f?Pe:Be,d=f?12:14;return t.jsx("button",{type:"button",title:I,"aria-label":I,"aria-pressed":f,onClick:ne,disabled:L||v==="processing",className:["s-dictation-mic",oe,m].filter(Boolean).join(" "),children:t.jsx(H,{size:d,className:M?"s-dictation-mic-spin":f?"fill-current":""})})}function Ie({samples:e,active:n,processing:l=!1,className:L}){const m=$e(e,he,l?.06:.04),h=["s-msg-compose-wave",n?"s-msg-compose-wave--live":"",l?"s-msg-compose-wave--processing":"",L??""].filter(Boolean).join(" ");return t.jsx("div",{className:h,"aria-hidden":"true","data-wave-source":e&&e.length>0?"levels":"floor",children:m.map((u,g)=>t.jsx("span",{className:"s-msg-compose-wave-bar",style:{transform:`scaleY(${Math.max(.08,u)})`,opacity:l?.28+u*.35:n?.4+u*.55:.25}},g))})}function $e(e,n,l){if(!e||e.length===0)return Array.from({length:n},()=>l);if(e.length===n)return e.map(m=>Math.max(l,Math.min(1,m)));const L=new Array(n);for(let m=0;m<n;m+=1){const h=Math.min(e.length-1,Math.round(m/Math.max(1,n-1)*(e.length-1)));L[m]=Math.max(l,Math.min(1,e[h]??l))}return L}function Ke(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M12 19V5"}),t.jsx("path",{d:"m5 12 7-7 7 7"})]})}function We(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function ze(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("path",{d:"M21.44 11.05 12.05 20.44a5.5 5.5 0 0 1-7.78-7.78l9.19-9.19a3.5 3.5 0 0 1 4.95 4.95l-9.2 9.19a1.5 1.5 0 0 1-2.12-2.12l8.49-8.48"})})}function pe(e,n){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,n)}px`}function Oe(e){return e.tone==="error"?"Voice":e.state==="recording"?"Listening":e.state==="processing"?"Transcribing":e.state==="starting"?"Starting":"Voice"}function Xe({renderWhenEmbedded:e=!1,...n}){return Ce()&&!e?null:t.jsx(He,{...n})}function He({value:e,onChange:n,onSend:l,placeholder:L="Type a message…",disabled:m=!1,sending:h=!1,canSend:u,stopMode:g=!1,onStop:K,sendTitle:C="Send (Cmd+Enter)",sendAriaLabel:S="Send message (Cmd+Enter)",stopAriaLabel:T="Stop agent",showDictation:b=!0,onDictationStatusChange:v,showAttach:k=!1,onAttach:G,attachTitle:_="Add attachment",attachAriaLabel:J="Add attachment",onPaste:D,dropHandlers:se,dragActive:q=!1,secondaryAction:R,leadingTools:V,tools:P,footer:W,header:Q,above:y,aboveAttached:N=!1,input:j,overlay:X,status:A,textareaRef:B,onKeyDown:Z,sendOnEnter:ee=!1,onSelect:te,onBlur:ne,density:f="panel",as:M="form",className:z,rows:O=1,autoResize:F=!0,maxHeightPx:I=160,"aria-label":oe="Message"}){const H=r.useRef(null),[d,s]=r.useState(null),i=r.useCallback(a=>{H.current=a,B&&(B.current=a)},[B]);r.useEffect(()=>{if(!F)return;const a=H.current;a&&pe(a,I)},[e,F,I]);const o=(u??e.trim().length>0)&&!h&&!m,x=P??W,w=d?.state==="recording"||d?.state==="starting",c=d?.state==="processing",$=!!(d&&(d.tone==="error"||w||c||d.partial&&d.partial.trim())),E=r.useCallback(()=>{g||!(u??e.trim().length>0)||h||m||l()},[u,m,l,h,g,e]),p=a=>{a.preventDefault(),E()},U=a=>{if(Z?.(a)){a.preventDefault();return}if(Te(a,ee)){a.preventDefault(),E();return}},ce=a=>{const Y=a.target.value;n(Y,{caret:a.target.selectionStart??Y.length}),F&&pe(a.target,I)},ve=a=>{const Y=e.trim()?`${e.trimEnd()} ${a}`:a;n(Y,{caret:Y.length}),requestAnimationFrame(()=>H.current?.focus())},be=r.useCallback(a=>{s(a),v?.(a)},[v]),ie=["s-msg-compose",`s-msg-compose--${f}`,f==="thread"?"s-thread-compose":"",z??""].filter(Boolean).join(" "),xe=["s-msg-compose-shell",f==="thread"?"s-thread-compose-shell":""].filter(Boolean).join(" "),Se=["s-msg-compose-input",f==="thread"?"s-thread-compose-input":""].filter(Boolean).join(" "),ae=["s-msg-compose-send",f==="thread"?"s-thread-compose-send":"",g?"s-msg-compose-send--agent-stop s-thread-compose-send--stop":""].filter(Boolean).join(" "),we=["s-msg-compose-voice",d?.tone==="recording"||w?"s-msg-compose-voice--recording":"",d?.tone==="processing"||c?"s-msg-compose-voice--processing":"",d?.tone==="error"?"s-msg-compose-voice--error":""].filter(Boolean).join(" "),re=d?.tone==="error",ye=d?.partial?.trim()||null,le=re?d?.message:c?"Finalizing transcript…":ye,je=t.jsxs("div",{className:xe,"data-drag-active":q?"true":void 0,...se,children:[Q?t.jsx("div",{className:"s-msg-compose-header",children:Q}):null,t.jsxs("div",{className:"s-msg-compose-body",children:[j??t.jsx("textarea",{ref:i,className:Se,placeholder:L,value:e,disabled:m,rows:O,"aria-label":oe,onChange:ce,onKeyDown:U,onSelect:te,onBlur:ne,onPaste:D}),$?t.jsxs("div",{className:we,role:re?"alert":"status","aria-live":re?"assertive":"polite",children:[!re&&(w||c)?t.jsx(Ie,{samples:d?.levels,active:w,processing:c}):null,t.jsxs("div",{className:"s-msg-compose-voice-meta",children:[t.jsx("span",{className:"s-msg-compose-voice-label",children:d?Oe(d):"Voice"}),le?t.jsx("span",{className:"s-msg-compose-voice-text",children:le}):null]})]}):null]}),t.jsxs("div",{className:["s-msg-compose-toolbar",f==="thread"?"s-thread-compose-footer":""].filter(Boolean).join(" "),children:[t.jsxs("div",{className:"s-msg-compose-toolbar-start",children:[V,k?t.jsx("button",{type:"button",className:"s-msg-compose-icon-btn",title:_,"aria-label":J,disabled:m||h,onClick:G,children:t.jsx(ze,{})}):V?null:t.jsx("span",{className:"s-msg-compose-toolbar-spacer","aria-hidden":"true"})]}),t.jsxs("div",{className:"s-msg-compose-toolbar-end",children:[x?t.jsx("div",{className:"s-msg-compose-tools",children:x}):null,b?t.jsx(Fe,{onAppend:ve,onStatus:be,disabled:m||h}):null,R?t.jsx("div",{className:"s-msg-compose-secondary",children:R}):null,g?t.jsx("button",{type:"button",className:ae,onClick:K,title:T,"aria-label":T,children:t.jsx(We,{})}):t.jsx("button",{type:M==="form"?"submit":"button",className:ae,disabled:!o,title:C,"aria-label":S,"data-action":"send",onClick:M==="div"?()=>E():void 0,children:t.jsx(Ke,{})})]})]}),A]}),ue=t.jsxs("div",{className:"s-msg-compose-frame","data-above-attached":y&&N?"true":void 0,children:[X,y?t.jsx("div",{className:"s-msg-compose-above",children:y}):null,je]});return M==="div"?t.jsx("div",{className:ie,children:ue}):t.jsx("form",{className:ie,onSubmit:p,children:ue})}export{Fe as D,Xe as M,Pe as S,Be as a,Te as i};
@@ -1 +1 @@
1
- import{k as a,s as m,l as n,m as r,r as l}from"./index-DMiGbrBt.js";import{m as p,n as i,o as c,e as E,p as S}from"./router-Bq5dwf78.js";const _={path:m(n.lanes),bundle:`?ffBundle=${a}`,deploy:`OPENSCOUT_WEB_FLAG_BUNDLE=${a}`},o=[{key:"lanes",label:"Agent Lanes",segment:n.lanes},{key:"sessions",label:"Sessions",segment:n.sessions},{key:"tail",label:"Live Activity",segment:n.tail},{key:"agents",label:"Agents",segment:n.agents}],b=o.map(e=>({key:e.key,label:e.label,route:p(e.segment)}));function A(e){const t=i(e);return o.find(s=>s.segment===t)?.key??"lanes"}function d(e){const t=i(e);return o.find(s=>s.segment===t)?.label??r}function u(){const{pathname:e}=E();return c(e)}function P(){return S(u())}function L(e){const t=u();return l.useEffect(()=>(t?document.documentElement.setAttribute("data-scope-presentation",""):document.documentElement.removeAttribute("data-scope-presentation"),()=>document.documentElement.removeAttribute("data-scope-presentation")),[t]),{active:t,brandLabel:t?d(e.route):r}}function O(){return c(typeof window<"u"?window.location.pathname:"")}export{b as S,u as a,_ as b,d as c,L as d,O as i,A as s,P as u};
1
+ import{k as a,s as l,l as n,m as r,r as m}from"./index-sUomXsrf.js";import{Q as p,R as i,T as c,k as E,U as S}from"./router-Dja9_ygK.js";const _={path:l(n.lanes),bundle:`?ffBundle=${a}`,deploy:`OPENSCOUT_WEB_FLAG_BUNDLE=${a}`},o=[{key:"lanes",label:"Agent Lanes",segment:n.lanes},{key:"sessions",label:"Sessions",segment:n.sessions},{key:"tail",label:"Live Activity",segment:n.tail},{key:"agents",label:"Agents",segment:n.agents}],b=o.map(e=>({key:e.key,label:e.label,route:p(e.segment)}));function A(e){const t=i(e);return o.find(s=>s.segment===t)?.key??"lanes"}function d(e){const t=i(e);return o.find(s=>s.segment===t)?.label??r}function u(){const{pathname:e}=E();return c(e)}function P(){return S(u())}function T(e){const t=u();return m.useEffect(()=>(t?document.documentElement.setAttribute("data-scope-presentation",""):document.documentElement.removeAttribute("data-scope-presentation"),()=>document.documentElement.removeAttribute("data-scope-presentation")),[t]),{active:t,brandLabel:t?d(e.route):r}}function L(){return c(typeof window<"u"?window.location.pathname:"")}export{b as S,u as a,_ as b,d as c,T as d,L as i,A as s,P as u};