@openscout/scout 0.2.92 → 0.2.94

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 (507) hide show
  1. package/README.md +22 -28
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/apple-touch-icon.png +0 -0
  5. package/dist/client/assets/ActivityScreen--eANwuxa.js +1 -0
  6. package/dist/client/assets/{AddProjectForm-CpyytDf2.js → AddProjectForm-CcD6qvV8.js} +1 -1
  7. package/dist/client/assets/AgentAvatar-CYhf6twS.js +1 -0
  8. package/dist/client/assets/AgentConfigurationScreen-BTI24HQX.js +1 -0
  9. package/dist/client/assets/AgentDefinitionsWorkspace-srmN6-vj.js +1 -0
  10. package/dist/client/assets/{AgentDetailCard-BTiOmh-a.js → AgentDetailCard-UqPNpcvB.js} +1 -1
  11. package/dist/client/assets/AgentFloorView-XXNgI5Cj.js +1 -0
  12. package/dist/client/assets/AgentInfoScreen-CimdOnZ9.js +1 -0
  13. package/dist/client/assets/{AgentLaneCard-lfRNb7JD.js → AgentLaneCard-Z-aOBR3W.js} +1 -1
  14. package/dist/client/assets/{AgentLaneChrome-Dlwrbq3g.js → AgentLaneChrome-CyhA1reW.js} +1 -1
  15. package/dist/client/assets/AgentLaneDetailSheet-BNzjMjIH.js +4 -0
  16. package/dist/client/assets/{AgentLaneSummaryResize-6SOEWUnr.js → AgentLaneSummaryResize-Box8-_rS.js} +1 -1
  17. package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +1 -0
  18. package/dist/client/assets/{AgentLanesPreflight-C3uOiOzd.js → AgentLanesPreflight-5B6sXvRB.js} +1 -1
  19. package/dist/client/assets/AgentLanesView-DHyzVBk6.js +2 -0
  20. package/dist/client/assets/{AgentLiveActions-BJ5dIfL3.js → AgentLiveActions-BwuzOE8h.js} +1 -1
  21. package/dist/client/assets/AgentSessions-CsZwoukw.js +6 -0
  22. package/dist/client/assets/AgentsConsole-KCao4XmX.js +1 -0
  23. package/dist/client/assets/AgentsScreen-CtPAmwRX.js +1 -0
  24. package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +1 -0
  25. package/dist/client/assets/AstronautSuit-Ckx7lu7G.js +1 -0
  26. package/dist/client/assets/AtopView-DYlpgEHf.js +1 -0
  27. package/dist/client/assets/{BackToPicker-D1LV6Cqp.js → BackToPicker-4JaeRvDm.js} +1 -1
  28. package/dist/client/assets/BriefingDetailScreen-D6-xqrpo.js +1 -0
  29. package/dist/client/assets/BriefingsScreen-DKxSDEmk.js +1 -0
  30. package/dist/client/assets/{BrokerMetadataPanel-BhjECqOK.js → BrokerMetadataPanel-BbREmsbK.js} +1 -1
  31. package/dist/client/assets/BrokerScreen-fbPIouMw.js +5 -0
  32. package/dist/client/assets/CastPicker-BcA2vDDV.js +1 -0
  33. package/dist/client/assets/CastPicker-zXsnkTIy.css +1 -0
  34. package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +1 -0
  35. package/dist/client/assets/{CodeDiffPane-Bx_2VAzv.js → CodeDiffPane-Cn8Y9hAt.js} +1 -1
  36. package/dist/client/assets/{CodeProjectPicker-C1yOJKvs.js → CodeProjectPicker-nPFktrco.js} +1 -1
  37. package/dist/client/assets/CodeScreen-BlAxtxE5.js +1 -0
  38. package/dist/client/assets/ConversationComposer-2HjbGPL9.js +1 -0
  39. package/dist/client/assets/ConversationFeedRows-C6wUqJrx.js +1 -0
  40. package/dist/client/assets/ConversationHeader-C8vfXaTF.js +1 -0
  41. package/dist/client/assets/ConversationPanels-CNCIbpqU.js +6 -0
  42. package/dist/client/assets/ConversationScreen-BNULZAp2.js +2 -0
  43. package/dist/client/assets/ConversationScreen-CkWnKXt6.css +1 -0
  44. package/dist/client/assets/ConversationStatus-DZuyKsWN.js +1 -0
  45. package/dist/client/assets/CrewAvatar-CTIuxp4G.js +1 -0
  46. package/dist/client/assets/CrewAvatar-D0c9z5Qr.css +1 -0
  47. package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +1 -0
  48. package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +1 -0
  49. package/dist/client/assets/{DataTable-CJbbgBdA.js → DataTable-6IDhanr5.js} +1 -1
  50. package/dist/client/assets/DispatchAftermath-DC1u9itO.js +1 -0
  51. package/dist/client/assets/DocumentFocusViewer-DZVhS7as.js +1 -0
  52. package/dist/client/assets/{EmbeddableSurfacesLab-BdsYRDky.js → EmbeddableSurfacesLab-BKUFJMCV.js} +1 -1
  53. package/dist/client/assets/{EmptyState-BRY5jTpz.js → EmptyState-CeBl0iGd.js} +1 -1
  54. package/dist/client/assets/{FileViewerPane-9Bveqm9c.js → FileViewerPane-DQlpNt2S.js} +2 -2
  55. package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +1 -0
  56. package/dist/client/assets/FollowScreen-BXHOp3gb.js +1 -0
  57. package/dist/client/assets/{HarnessMark-BPAphNjx.js → HarnessMark-D5CA5uSp.js} +1 -1
  58. package/dist/client/assets/HarnessesScreen-DhFXq1qz.js +1 -0
  59. package/dist/client/assets/{HerdrSession-BujfGzrP.js → HerdrSession-BRhs5LIR.js} +1 -1
  60. package/dist/client/assets/HomeHero-7JwycwFY.css +1 -0
  61. package/dist/client/assets/HomeHero-DMABJuze.js +1 -0
  62. package/dist/client/assets/HostAdvisorView-RAociATV.js +1 -0
  63. package/dist/client/assets/{KnowledgeSearchInspector-B4ZY24xE.js → KnowledgeSearchInspector-CZPyVNSw.js} +1 -1
  64. package/dist/client/assets/KnowledgeSearchScreen-mGTKIg00.js +1 -0
  65. package/dist/client/assets/{LaneToolHoverCard-B7KdvQvf.js → LaneToolHoverCard-D_DMlBeT.js} +1 -1
  66. package/dist/client/assets/LaneTraceDetailSheet-BEHg3LmH.js +1 -0
  67. package/dist/client/assets/{LaneTraceEventFocus-mkMw2wJU.js → LaneTraceEventFocus-DVimcizS.js} +1 -1
  68. package/dist/client/assets/{MeshCanvas-CpKcWxKy.js → MeshCanvas-BOuZx4AM.js} +2 -2
  69. package/dist/client/assets/{MeshCanvasMinimap-C9IoGHbe.js → MeshCanvasMinimap-wL-1N94e.js} +1 -1
  70. package/dist/client/assets/MeshScreen-DMY9Bmh5.js +1 -0
  71. package/dist/client/assets/{MeshTopologyView-DFzr0IZM.js → MeshTopologyView-DiDcX5f4.js} +2 -2
  72. package/dist/client/assets/MessagesScreen-Eulveud3.js +1 -0
  73. package/dist/client/assets/{MissionContextRail-Y8QxUZGE.js → MissionContextRail-DrNKXG5u.js} +1 -1
  74. package/dist/client/assets/MissionControlView-ByBlHVN8.js +1 -0
  75. package/dist/client/assets/MissionFocusOverlay-D1i6R6Zt.js +1 -0
  76. package/dist/client/assets/MissionLeftAgentRow-DN9NcCML.js +1 -0
  77. package/dist/client/assets/MissionLogPane-DSeIv3Xo.js +1 -0
  78. package/dist/client/assets/NewAgentModal-V7yK6J6j.js +1 -0
  79. package/dist/client/assets/NewChatComposer-hlWT-nbR.js +19 -0
  80. package/dist/client/assets/{NewChatOrigin-DmuJ32wa.js → NewChatOrigin-DdpzE4kz.js} +1 -1
  81. package/dist/client/assets/ObserveEmbedScreen-l_Q3ts2q.js +2 -0
  82. package/dist/client/assets/ObserveTextFlow-BSEtYTxU.js +2 -0
  83. package/dist/client/assets/ObservedTopologyPanel-CdGUXxGR.js +2 -0
  84. package/dist/client/assets/OpenScoutAppShell-DN8dOSK4.js +79 -0
  85. package/dist/client/assets/OpsAgentsView-ntGr4pz4.js +1 -0
  86. package/dist/client/assets/OpsScreen-Ppen_Lmj.js +1 -0
  87. package/dist/client/assets/OpsSubnav-GAKsoSor.js +1 -0
  88. package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +1 -0
  89. package/dist/client/assets/{ProjectAgentProfileBar-BLVg5EeA.js → ProjectAgentProfileBar-BQET-qrY.js} +1 -1
  90. package/dist/client/assets/ProjectAgentProfileHero-Ck8mThtx.js +1 -0
  91. package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +2 -0
  92. package/dist/client/assets/ProjectsRail-DCfNMmnW.js +1 -0
  93. package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +1 -0
  94. package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +1 -0
  95. package/dist/client/assets/Provider-B2xuo3rf.js +1 -0
  96. package/dist/client/assets/RailRow-B-GycCBx.js +1 -0
  97. package/dist/client/assets/RailRow-B0sRaJc6.css +1 -0
  98. package/dist/client/assets/RawSessionsTable-AQThi6sm.js +1 -0
  99. package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +1 -0
  100. package/dist/client/assets/{RepoDiffEmbedScreen-BCDXFE3D.js → RepoDiffEmbedScreen-DXWoRF_c.js} +1 -1
  101. package/dist/client/assets/{RepoDiffPageScreen-m62FiWXC.js → RepoDiffPageScreen-D_274ExO.js} +1 -1
  102. package/dist/client/assets/RepoDiffViewer-DbedmHDX.js +7 -0
  103. package/dist/client/assets/RepoDiffViewerLazy-C0--fPtk.js +2 -0
  104. package/dist/client/assets/ReposScreen-D39_YG4H.js +6 -0
  105. package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +1 -0
  106. package/dist/client/assets/{ScoutSurface-CkgT7A-c.js → ScoutSurface-UsRy0t-I.js} +1 -1
  107. package/dist/client/assets/{ScoutbotFxLab-D-kV5j4T.js → ScoutbotFxLab-Fmdfboxs.js} +1 -1
  108. package/dist/client/assets/{SecondaryNav-_wyKjwNf.js → SecondaryNav-o2RL9H8H.js} +1 -1
  109. package/dist/client/assets/{SessionEmbedScreen-CJZmIBV7.js → SessionEmbedScreen-RD5XOx7R.js} +1 -1
  110. package/dist/client/assets/{SessionObserve-yYA8Gy5s.js → SessionObserve-Dsd0j05N.js} +9 -9
  111. package/dist/client/assets/{SessionObserveEvidence-cHdjYOJe.js → SessionObserveEvidence-DopQYDkD.js} +1 -1
  112. package/dist/client/assets/SessionRefScreen-B_cTv47v.js +1 -0
  113. package/dist/client/assets/SessionsScreen-Bq0Z77On.js +1 -0
  114. package/dist/client/assets/SettingsDrawer-R8a0TlJD.css +1 -0
  115. package/dist/client/assets/SettingsDrawer-_AwuopMS.js +3 -0
  116. package/dist/client/assets/SettingsScreen-Cw4DDfJP.js +1 -0
  117. package/dist/client/assets/{ShikiPane-dBS9hD-z.js → ShikiPane-BfHc_3pM.js} +1 -1
  118. package/dist/client/assets/{SlidePanel-CH-3-8_2.js → SlidePanel-C-q7XwTa.js} +1 -1
  119. package/dist/client/assets/SpriteAvatar-Bs68ZENy.js +1 -0
  120. package/dist/client/assets/{StatusPill-C8m9ZymF.js → StatusPill-ZZQwxB1a.js} +1 -1
  121. package/dist/client/assets/{TailView-B0BSopPs.js → TailView-Q4FVMsUH.js} +2 -2
  122. package/dist/client/assets/Terminal-D7zqHwHV.js +1 -0
  123. package/dist/client/assets/TerminalEmbedScreen-CXIJ7qv6.js +1 -0
  124. package/dist/client/assets/TerminalHeaderMount-BnBLOPbb.js +1 -0
  125. package/dist/client/assets/{TextDocumentSurface-BWJCGBZf.js → TextDocumentSurface-CKQP-cBT.js} +1 -1
  126. package/dist/client/assets/{TmuxPeek-B4QdHbGm.js → TmuxPeek-V9dGESfO.js} +1 -1
  127. package/dist/client/assets/{VoicePermissionsPanel-Dd4ITJy_.js → VoicePermissionsPanel-k7sbLXx2.js} +1 -1
  128. package/dist/client/assets/WorkDetailScreen-60p9litn.js +5 -0
  129. package/dist/client/assets/WorkFilesViewer-BjJS7GyM.js +1 -0
  130. package/dist/client/assets/{activity-CC8JzJNH.js → activity-Bj3Hnbj3.js} +1 -1
  131. package/dist/client/assets/{addon-fit-CaZ-uLrg.js → addon-fit-BL-NTWRU.js} +1 -1
  132. package/dist/client/assets/{addon-webgl-B8utL3bM.js → addon-webgl-CIMgmNjg.js} +1 -1
  133. package/dist/client/assets/{ScoutbotBroadcastChip-CxtYZWPZ.css → agent-autocomplete-C7xwIcwd.css} +1 -1
  134. package/dist/client/assets/agent-autocomplete-DXlvdc4b.js +10 -0
  135. package/dist/client/assets/{agent-essentials-B3wcxg_v.js → agent-essentials-BOMHR0_U.js} +1 -1
  136. package/dist/client/assets/{agent-lane-card-model-q4cwzLX4.js → agent-lane-card-model-CTLxf3R4.js} +1 -1
  137. package/dist/client/assets/agent-lane-detail-ppJId6Jc.js +2 -0
  138. package/dist/client/assets/{agent-lane-preview-C33Dwpn7.js → agent-lane-preview-BhplDYGf.js} +1 -1
  139. package/dist/client/assets/{agent-lanes-BDNktFBZ.css → agent-lanes-DlqcEf0l.css} +1 -1
  140. package/dist/client/assets/{agent-lanes-model-VYQ5a68i.js → agent-lanes-model-AfrjRNK5.js} +2 -2
  141. package/dist/client/assets/agent-specialization-BIPIBW8u.js +1 -0
  142. package/dist/client/assets/api-Co9aQ2Jw.js +1 -0
  143. package/dist/client/assets/{api-BkjHJfgJ.js → api-HFH8wFyb.js} +1 -1
  144. package/dist/client/assets/{arc.es-uFv9UrHn.js → arc.es-IR5r6sj_.js} +1 -1
  145. package/dist/client/assets/archive-BjcGiAy8.js +1 -0
  146. package/dist/client/assets/{arrow-down-w1HPzDSE.js → arrow-down-BydciYFZ.js} +1 -1
  147. package/dist/client/assets/{arrow-left-B-3GJ7ct.js → arrow-left-CghA0kTw.js} +1 -1
  148. package/dist/client/assets/arrow-right-iJFv3jNh.js +1 -0
  149. package/dist/client/assets/{arrow-up-right-G6bJXxhK.js → arrow-up-right-CCfZXPqD.js} +1 -1
  150. package/dist/client/assets/{bot-DzCOGKi6.js → bot-B5sub1-i.js} +1 -1
  151. package/dist/client/assets/broker-display-Q75fupqG.js +2 -0
  152. package/dist/client/assets/{cache-Dr0why2k.js → cache-CeWH_KzJ.js} +1 -1
  153. package/dist/client/assets/{check-BX8nRgop.js → check-C18YQC90.js} +1 -1
  154. package/dist/client/assets/{chevron-down-B3VVRJcV.js → chevron-down-Mp9mu_yd.js} +1 -1
  155. package/dist/client/assets/{chevron-right-BYMV1511.js → chevron-right-CzH-TaSF.js} +1 -1
  156. package/dist/client/assets/{chunk-HRAB3GC3-dRd2eQMJ.js → chunk-HRAB3GC3-swV8PA2k.js} +1 -1
  157. package/dist/client/assets/{chunk-JTPDIGGW-BjX67kHU.js → chunk-JTPDIGGW-BKXqcLKw.js} +3 -3
  158. package/dist/client/assets/{chunk-T65CQEWV-kP6nJjkU.js → chunk-T65CQEWV-vYbNJ8E6.js} +1 -1
  159. package/dist/client/assets/{chunk-YOZR3KYS-C13bZPVd.js → chunk-YOZR3KYS-U65yUmqt.js} +1 -1
  160. package/dist/client/assets/{clock-B9ukVaVn.js → clock-B4PTFi5m.js} +1 -1
  161. package/dist/client/assets/{code-xml-BFc3TMSm.js → code-xml-Jtxsp5d1.js} +1 -1
  162. package/dist/client/assets/collapsed-strip-raJWthAH.css +1 -0
  163. package/dist/client/assets/compass-0_54-vz3.js +1 -0
  164. package/dist/client/assets/content-6RvWTrtk.js +1 -0
  165. package/dist/client/assets/content-BCgwMUqz.js +1 -0
  166. package/dist/client/assets/content-Bf2VLhx0.js +1 -0
  167. package/dist/client/assets/content-BrU_38-m.js +1 -0
  168. package/dist/client/assets/content-BvvJN8rN.js +1 -0
  169. package/dist/client/assets/content-CAeEqYPw.js +1 -0
  170. package/dist/client/assets/content-CHghn-rT.js +1 -0
  171. package/dist/client/assets/{content-Uqt8AG-s.css → content-CINHz-rZ.css} +1 -1
  172. package/dist/client/assets/content-CI_Z9DXk.js +1 -0
  173. package/dist/client/assets/content-CbyKONhW.js +1 -0
  174. package/dist/client/assets/content-Czogvp43.js +1 -0
  175. package/dist/client/assets/content-DFk0zNzX.js +1 -0
  176. package/dist/client/assets/content-DHe4DgkA.js +1 -0
  177. package/dist/client/assets/content-DMbawvqU.js +1 -0
  178. package/dist/client/assets/content-DTz7cKjo.js +1 -0
  179. package/dist/client/assets/content-E3kudY-W.js +1 -0
  180. package/dist/client/assets/content-LpO0aO_U.js +1 -0
  181. package/dist/client/assets/{conversation-icons-gpsv650H.js → conversation-icons-BV10B2Me.js} +1 -1
  182. package/dist/client/assets/conversation-model-CwF6Y9gx.js +1 -0
  183. package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +1 -0
  184. package/dist/client/assets/{copy-BFmOcWof.js → copy-Dtpx4FOE.js} +1 -1
  185. package/dist/client/assets/cpu-BjVis9mc.js +1 -0
  186. package/dist/client/assets/{createLucideIcon-CFBn0Sdk.js → createLucideIcon-DXpqZP7I.js} +1 -1
  187. package/dist/client/assets/credentials-BTce3VP1.js +1 -0
  188. package/dist/client/assets/ctx-panel-D_HJ3nhb.css +1 -0
  189. package/dist/client/assets/discover-CHbrEItO.js +2 -0
  190. package/dist/client/assets/embed-entry-vil28MyU.js +2 -0
  191. package/dist/client/assets/{external-link-B1TI5yIt.js → external-link-Ckiyzjwo.js} +1 -1
  192. package/dist/client/assets/{eye-1J4yOUoG.js → eye-CpfyvdLq.js} +1 -1
  193. package/dist/client/assets/file-code-corner-7mo7EviR.js +1 -0
  194. package/dist/client/assets/{file-text-DcYSrI4v.js → file-text-KijGBnME.js} +1 -1
  195. package/dist/client/assets/gauge-y-Xg8Mrv.js +1 -0
  196. package/dist/client/assets/gestures-Bq9XnSqY.js +1 -0
  197. package/dist/client/assets/git-branch-BQ_x8KZL.js +1 -0
  198. package/dist/client/assets/harnesses-screen-2z36fJKE.css +1 -0
  199. package/dist/client/assets/home-moving-signal-DMguaRWR.css +1 -0
  200. package/dist/client/assets/home-moving-signal-DtRpiNa0.js +1 -0
  201. package/dist/client/assets/home-now-card-DFb4GOgM.js +1 -0
  202. package/dist/client/assets/{home-now-card-nano-y1EhBvVL.js → home-now-card-nano-D--m9jpq.js} +1 -1
  203. package/dist/client/assets/hooks-9d1SoaQA.js +2 -0
  204. package/dist/client/assets/host-advisor-B2Fqs5Dd.css +1 -0
  205. package/dist/client/assets/index-BVlMw8x_.js +1 -0
  206. package/dist/client/assets/index-CZ-05hKz.js +10 -0
  207. package/dist/client/assets/index-Cn0GR-q1.js +1 -0
  208. package/dist/client/assets/index-DosI4AG9.js +1 -0
  209. package/dist/client/assets/index-i7TMxlwW.css +1 -0
  210. package/dist/client/assets/index-wLwc74Pu.css +1 -0
  211. package/dist/client/assets/inspector-panel-C-EhEDYy.js +2 -0
  212. package/dist/client/assets/{keyboard-nav-h1IdakpD.js → keyboard-nav-DFhAJkW3.js} +1 -1
  213. package/dist/client/assets/{lane-observe-BA3g9aVd.js → lane-observe-vfyACHi0.js} +1 -1
  214. package/dist/client/assets/{lane-roster-store-71vFgAem.js → lane-roster-store-gUBsydNf.js} +1 -1
  215. package/dist/client/assets/layers-CGou-LwV.js +1 -0
  216. package/dist/client/assets/layout-grid-BrZt31QH.js +1 -0
  217. package/dist/client/assets/left-B_o51JV6.js +1 -0
  218. package/dist/client/assets/left-BpgWnaah.js +1 -0
  219. package/dist/client/assets/left-CwHZCGO3.js +2 -0
  220. package/dist/client/assets/left-CwLs0okF.js +1 -0
  221. package/dist/client/assets/left-Cx0kv6pe.js +1 -0
  222. package/dist/client/assets/left-DA0amyfu.js +1 -0
  223. package/dist/client/assets/left-DH44V4I_.css +1 -0
  224. package/dist/client/assets/left-R2OOE7VG.css +1 -0
  225. package/dist/client/assets/left-advisor-DU3s01gk.js +1 -0
  226. package/dist/client/assets/left-agents-qL5PpUY-.js +1 -0
  227. package/dist/client/assets/left-default-uvuvDmt0.js +1 -0
  228. package/dist/client/assets/left-lanes-DnNLgec8.js +1 -0
  229. package/dist/client/assets/left-mission-DN3-NLPC.js +1 -0
  230. package/dist/client/assets/left-z-6CkuBe.js +2 -0
  231. package/dist/client/assets/library-DIo5NiGP.js +1 -0
  232. package/dist/client/assets/{loader-circle-d6PKL_KD.js → loader-circle-BiohlpM3.js} +1 -1
  233. package/dist/client/assets/{local-agents-B5pq17tZ.js → local-agents-wUIaBcEr.js} +1 -1
  234. package/dist/client/assets/{mentions-agCGDgyA.js → mentions-CcPFMbmZ.js} +1 -1
  235. package/dist/client/assets/mesh-buckets-ByyFXdKT.js +1 -0
  236. package/dist/client/assets/{mesh-ops-5pZCYptW.js → mesh-ops-CvGyjK84.js} +1 -1
  237. package/dist/client/assets/mesh-roster-n2nDpEmA.js +1 -0
  238. package/dist/client/assets/{mesh-screen-BSDUjrnV.css → mesh-screen-D1Yvo8fU.css} +1 -1
  239. package/dist/client/assets/{mesh-view-store-KJzABIkN.js → mesh-view-store-BpxGm71b.js} +1 -1
  240. package/dist/client/assets/{message-circle-CJO-pi7b.js → message-circle-B2ddzBrX.js} +1 -1
  241. package/dist/client/assets/{message-markup-CyRDLdOn.js → message-markup-RkfmDfME.js} +1 -1
  242. package/dist/client/assets/{message-square-D1hMsMj_.js → message-square-D9YYWE0x.js} +1 -1
  243. package/dist/client/assets/message-visibility-DwxgcgYK.js +1 -0
  244. package/dist/client/assets/mission-control-CnU7dNt1.css +1 -0
  245. package/dist/client/assets/{mission-control-store-Ce6dOvnZ.js → mission-control-store-Bf4b54MV.js} +1 -1
  246. package/dist/client/assets/{observe-BSWVM8YA.js → observe-CJRIvOCn.js} +1 -1
  247. package/dist/client/assets/{operator-attention-BwSPeheT.js → operator-attention-RqieiSY8.js} +1 -1
  248. package/dist/client/assets/{page-status-D2FQLJOX.js → page-status-BptpTdQ-.js} +1 -1
  249. package/dist/client/assets/{paperclip-iZmDMOS5.js → paperclip-B1UNGl5d.js} +1 -1
  250. package/dist/client/assets/perf-PX8Rx0EP.js +1 -0
  251. package/dist/client/assets/persistent-state-YI-WHSCF.js +1 -0
  252. package/dist/client/assets/{plus-gZ0T0eBI.js → plus-CuU_X0-8.js} +1 -1
  253. package/dist/client/assets/profile-rY8jO38P.js +1 -0
  254. package/dist/client/assets/projects-inbox-BBs1hG13.css +1 -0
  255. package/dist/client/assets/projects-inbox-D-zAb9Gp.js +1 -0
  256. package/dist/client/assets/proxy-DnLpZIi9.js +1 -0
  257. package/dist/client/assets/{radio-RMLfV4EO.js → radio-Dm1ItnA4.js} +1 -1
  258. package/dist/client/assets/{refresh-cw-C4x1x6b_.js → refresh-cw-BRn9Oxxl.js} +1 -1
  259. package/dist/client/assets/resolve-panes-DO6LkwhQ.js +1 -0
  260. package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +1 -0
  261. package/dist/client/assets/right-BJltPRnd.js +1 -0
  262. package/dist/client/assets/right-BbyYdzHn.js +1 -0
  263. package/dist/client/assets/right-Beh3nCUB.js +1 -0
  264. package/dist/client/assets/right-C1yumXNx.js +1 -0
  265. package/dist/client/assets/{right-D-k9Z1Fe.js → right-CJnB_Bg7.js} +2 -2
  266. package/dist/client/assets/right-CPP7GyOm.js +1 -0
  267. package/dist/client/assets/right-D3aTKf1F.js +1 -0
  268. package/dist/client/assets/right-DI1B79nR.js +1 -0
  269. package/dist/client/assets/right-DtsRNX5b.js +1 -0
  270. package/dist/client/assets/right-Shpw_xDy.js +1 -0
  271. package/dist/client/assets/{rocket-CMM-IdLy.js → rocket-DOwXHKWA.js} +1 -1
  272. package/dist/client/assets/router-DJj2WbDg.js +1 -0
  273. package/dist/client/assets/{scope-views-BIfMTXU4.js → scope-views-A4_vP97W.js} +1 -1
  274. package/dist/client/assets/scout-voice-BhPzrc6P.js +1 -0
  275. package/dist/client/assets/{scoutbot-BTIErYHo.js → scoutbot-BJIamJOH.js} +2 -2
  276. package/dist/client/assets/scoutbot-markdown-jh7tzFB1.js +6 -0
  277. package/dist/client/assets/{scroll-text-DPPYrqB9.js → scroll-text-DO0GQzvN.js} +1 -1
  278. package/dist/client/assets/{search-DAyagUtF.js → search-D1tJSAWe.js} +1 -1
  279. package/dist/client/assets/secondaryNavConfig-B9IF8wXl.js +1 -0
  280. package/dist/client/assets/{selection-bridge-BXw09aRF.js → selection-bridge-i2S9zpf8.js} +1 -1
  281. package/dist/client/assets/{send-horizontal-IcG46D2M.js → send-horizontal-CgLppsIC.js} +1 -1
  282. package/dist/client/assets/{server-BySujhDV.js → server-Dymv5Emh.js} +1 -1
  283. package/dist/client/assets/{session-catalog-ClS9xf6i.js → session-catalog-DNaOEzoQ.js} +1 -1
  284. package/dist/client/assets/{session-table-BdpHs1GN.js → session-table-PTQVoTyc.js} +1 -1
  285. package/dist/client/assets/settings-2fC_G9nX.js +1 -0
  286. package/dist/client/assets/{sliders-horizontal-R5pWUUcH.js → sliders-horizontal-BPSMHhbm.js} +1 -1
  287. package/dist/client/assets/{sparkles-DJOBD_8l.js → sparkles-Dy8p5xN8.js} +1 -1
  288. package/dist/client/assets/sse-CiOSzE5n.js +1 -0
  289. package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +1 -0
  290. package/dist/client/assets/{tail-display-BRcJltQa.js → tail-display-DcliDVkW.js} +1 -1
  291. package/dist/client/assets/{tail-events-BdvqZHLr.js → tail-events-BMQmSx1n.js} +1 -1
  292. package/dist/client/assets/{terminal-relay-TffuSPGs.js → terminal-relay-9lhzEp2V.js} +1 -1
  293. package/dist/client/assets/terminal-screen-BLk4PAYt.css +1 -0
  294. package/dist/client/assets/terminal-sessions-BQ6t92tJ.js +1 -0
  295. package/dist/client/assets/{terminal-takeover-BOFPRPjR.js → terminal-takeover-DANQfTcy.js} +1 -1
  296. package/dist/client/assets/{terminal-DJPUp_Qn.js → terminal-yN9xN-h9.js} +1 -1
  297. package/dist/client/assets/{runtime-picker--IW3cRry.js → text-CnZ0e1-V.js} +1 -1
  298. package/dist/client/assets/text-rLpBg4_z.css +1 -0
  299. package/dist/client/assets/use-conversation-list-D9BNLfnW.js +1 -0
  300. package/dist/client/assets/{use-fleet-active-asks-BHzeBZSW.js → use-fleet-active-asks-BeAdcl09.js} +1 -1
  301. package/dist/client/assets/{use-mesh-ops-items-KmaauBr_.js → use-mesh-ops-items-BIvIHlqe.js} +1 -1
  302. package/dist/client/assets/use-reduced-motion-CKkhq9c5.js +1 -0
  303. package/dist/client/assets/{use-scout-dev-flags-BJbw87PK.js → use-scout-dev-flags-B2KCzPxn.js} +1 -1
  304. package/dist/client/assets/{useAgentHoverCard-C6o0tlat.js → useAgentHoverCard-CHBsxcbp.js} +1 -1
  305. package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +1 -0
  306. package/dist/client/assets/{usePierreRuntime-Cm7-qdm0.js → usePierreRuntime-DUuXH5yp.js} +1 -1
  307. package/dist/client/assets/{wrench-CvRjjByE.js → wrench-YcXMlsh2.js} +1 -1
  308. package/dist/client/assets/{x-C8ayPBtj.js → x-e3h2hDsp.js} +1 -1
  309. package/dist/client/assets/{xterm-B0ci4Q9a.js → xterm-Byp1Hep_.js} +1 -1
  310. package/dist/client/assets/zap-nMcjPoWB.js +1 -0
  311. package/dist/client/favicon-16.png +0 -0
  312. package/dist/client/favicon-32.png +0 -0
  313. package/dist/client/favicon.ico +0 -0
  314. package/dist/client/favicon.svg +20 -47
  315. package/dist/client/index.html +5 -5
  316. package/dist/client/openscout-icon.png +0 -0
  317. package/dist/client/site.webmanifest +2 -2
  318. package/dist/client/web-app-icon-192.png +0 -0
  319. package/dist/client/web-app-icon-512.png +0 -0
  320. package/dist/main.mjs +20093 -78203
  321. package/dist/node/main.mjs +322 -252
  322. package/dist/pairing-runtime-controller.mjs +1032 -804
  323. package/dist/runtime/base-daemon.mjs +49 -121
  324. package/dist/runtime/broker-daemon.mjs +1105 -281
  325. package/dist/runtime/broker-process-manager.mjs +6 -0
  326. package/dist/runtime/mesh-discover.mjs +6 -0
  327. package/dist/scout-control-plane-web.mjs +3326 -1912
  328. package/package.json +7 -4
  329. package/dist/client/assets/ActivityScreen-DkUP7V7M.js +0 -1
  330. package/dist/client/assets/AgentAvatar-D8ZtMluU.js +0 -1
  331. package/dist/client/assets/AgentConfigurationScreen-BlGI6fuM.js +0 -1
  332. package/dist/client/assets/AgentDefinitionsWorkspace-CfaDVCVt.js +0 -1
  333. package/dist/client/assets/AgentFloorView-DjNLILLt.js +0 -1
  334. package/dist/client/assets/AgentInfoScreen-DG5dlHb_.js +0 -1
  335. package/dist/client/assets/AgentLaneDetailSheet-BzYzBfcW.js +0 -4
  336. package/dist/client/assets/AgentLanesEmbedScreen-Crxx1srt.js +0 -1
  337. package/dist/client/assets/AgentLanesView-ChNlmY-F.js +0 -2
  338. package/dist/client/assets/AgentSessions-DpY0htZV.js +0 -6
  339. package/dist/client/assets/AgentsConsole-CHyXrjhm.js +0 -1
  340. package/dist/client/assets/AgentsScreen-BhCjX2lD.js +0 -1
  341. package/dist/client/assets/AgentsSubnav-az_VDkri.js +0 -1
  342. package/dist/client/assets/AtopView-BjjPM8OX.js +0 -1
  343. package/dist/client/assets/BriefingDetailScreen-B7qJ90Np.js +0 -6
  344. package/dist/client/assets/BriefingsScreen-CW6N829d.js +0 -1
  345. package/dist/client/assets/BrokerScreen-X3z50712.js +0 -5
  346. package/dist/client/assets/ChatCollapsedStrip-DNR9osDy.js +0 -1
  347. package/dist/client/assets/CodeScreen-CIKK1LcZ.js +0 -1
  348. package/dist/client/assets/ContextMenu-CHIuVKz7.js +0 -1
  349. package/dist/client/assets/ConversationComposer-Bf7Ga_49.js +0 -1
  350. package/dist/client/assets/ConversationFeedRows-Cm1Lgo43.js +0 -1
  351. package/dist/client/assets/ConversationHeader-B_GXrKR0.js +0 -1
  352. package/dist/client/assets/ConversationPanels-BTBbEvrP.js +0 -2
  353. package/dist/client/assets/ConversationScreen-B3l2m3JI.js +0 -1
  354. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +0 -1
  355. package/dist/client/assets/ConversationStatus-BqhUHD85.js +0 -1
  356. package/dist/client/assets/DispatchAftermath-BDA9CrOd.js +0 -1
  357. package/dist/client/assets/DocumentFocusViewer-B9vodVmG.js +0 -1
  358. package/dist/client/assets/FleetSearch-Bj9SCl2f.js +0 -1
  359. package/dist/client/assets/FleetSearch-EXOe8ulE.css +0 -1
  360. package/dist/client/assets/FlightObserveScreen-BVMdsiCC.js +0 -1
  361. package/dist/client/assets/FollowScreen-BifwHWOV.js +0 -1
  362. package/dist/client/assets/HarnessesScreen-fMnbnrD4.js +0 -1
  363. package/dist/client/assets/HomeHero-BgM6S39l.js +0 -1
  364. package/dist/client/assets/HomeHero-DEl-WBsT.css +0 -1
  365. package/dist/client/assets/KnowledgeSearchScreen-Ch_WENUC.js +0 -1
  366. package/dist/client/assets/LaneTraceDetailSheet-H3AnN-vN.js +0 -1
  367. package/dist/client/assets/MeshScreen-48QkJSDI.js +0 -1
  368. package/dist/client/assets/MessageComposerSuggestions-FdVHnT_q.js +0 -1
  369. package/dist/client/assets/MessagesScreen-BMOOfbWX.js +0 -1
  370. package/dist/client/assets/MissionControlView-BpsHKu1F.js +0 -1
  371. package/dist/client/assets/MissionFocusOverlay-BPnAEA3F.js +0 -1
  372. package/dist/client/assets/MissionLeftAgentRow-iOZ6ds9L.js +0 -1
  373. package/dist/client/assets/MissionLogPane-B0csI89E.js +0 -1
  374. package/dist/client/assets/NewAgentModal-DBHJR9Qm.js +0 -1
  375. package/dist/client/assets/NewChatComposer-Hd7pI5Ac.js +0 -19
  376. package/dist/client/assets/ObserveEmbedScreen-DyArn7Id.js +0 -2
  377. package/dist/client/assets/ObserveTextFlow-CkMrtT8s.js +0 -2
  378. package/dist/client/assets/ObservedTopologyPanel-CaSZZP05.js +0 -2
  379. package/dist/client/assets/OpenScoutAppShell-BtlKkiuF.js +0 -87
  380. package/dist/client/assets/OpsAgentsView-CnqrwbC2.js +0 -1
  381. package/dist/client/assets/OpsScreen-DOlmlVkP.js +0 -1
  382. package/dist/client/assets/OpsSubnav-Dj3ShAKv.js +0 -1
  383. package/dist/client/assets/PlanView-BLGdWDx6.js +0 -1
  384. package/dist/client/assets/ProjectAgentProfile-Dv1sVnQl.js +0 -1
  385. package/dist/client/assets/ProjectAgentProfileHero-0-GDhsPT.js +0 -1
  386. package/dist/client/assets/ProjectsInbox-B3DpAI5b.js +0 -2
  387. package/dist/client/assets/ProjectsRail-BDl7U9Jq.js +0 -1
  388. package/dist/client/assets/ProjectsScreen-Dl2FcGrR.js +0 -1
  389. package/dist/client/assets/ProjectsThreadAside-BcGC5mHE.js +0 -1
  390. package/dist/client/assets/Provider-cJCdHAxu.js +0 -1
  391. package/dist/client/assets/RailRow-CLcVmywd.js +0 -1
  392. package/dist/client/assets/RailRow-Cf9LOiEj.css +0 -1
  393. package/dist/client/assets/RawSessionsTable-DBto4Ts-.js +0 -1
  394. package/dist/client/assets/RealtimeVoiceScreen-DXEU5v3g.js +0 -1
  395. package/dist/client/assets/RepoDiffViewer-PaNeZMhJ.js +0 -7
  396. package/dist/client/assets/RepoDiffViewerLazy-CWE5GxMP.js +0 -2
  397. package/dist/client/assets/ReposScreen-Cksv1cAD.js +0 -6
  398. package/dist/client/assets/ScoutDeckSurface-BCjPl7C4.js +0 -1
  399. package/dist/client/assets/ScoutbotBroadcastChip-DkiRCHuK.js +0 -2
  400. package/dist/client/assets/ScoutbotRealtimeVoiceCall-1ixiEn1L.js +0 -1
  401. package/dist/client/assets/SessionRefScreen-OkTY7Szg.js +0 -1
  402. package/dist/client/assets/SessionsScreen-B-GFjxIA.js +0 -1
  403. package/dist/client/assets/SettingsDrawer-Co11RFX0.js +0 -3
  404. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +0 -1
  405. package/dist/client/assets/SettingsScreen-Cn09nq5_.js +0 -1
  406. package/dist/client/assets/SpriteAvatar-DS6Tmyua.js +0 -1
  407. package/dist/client/assets/Terminal-U8gjIdm3.js +0 -1
  408. package/dist/client/assets/TerminalEmbedScreen-CTmdE7us.js +0 -1
  409. package/dist/client/assets/WorkDetailScreen-mJs0mb99.js +0 -5
  410. package/dist/client/assets/WorkFilesViewer-ODzLXKxj.js +0 -1
  411. package/dist/client/assets/agent-identity-BxCsXnDp.js +0 -1
  412. package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +0 -2
  413. package/dist/client/assets/api-h5zurxmi.js +0 -1
  414. package/dist/client/assets/broker-display-pp33bLsu.js +0 -2
  415. package/dist/client/assets/collapsed-strip-Dz-of2SM.css +0 -1
  416. package/dist/client/assets/content-B8gahuBy.js +0 -1
  417. package/dist/client/assets/content-BIqX06OQ.js +0 -1
  418. package/dist/client/assets/content-BKDZ6Fxe.js +0 -1
  419. package/dist/client/assets/content-C15Ya-iu.js +0 -1
  420. package/dist/client/assets/content-CDE9tJDF.js +0 -1
  421. package/dist/client/assets/content-CSAfI-PX.js +0 -1
  422. package/dist/client/assets/content-CTF9D60D.js +0 -1
  423. package/dist/client/assets/content-CbAGkYQO.js +0 -1
  424. package/dist/client/assets/content-CtqLJOVp.js +0 -1
  425. package/dist/client/assets/content-Dvs1KRfo.js +0 -1
  426. package/dist/client/assets/content-DyJdVZjI.js +0 -1
  427. package/dist/client/assets/content-Ji7ATaf7.js +0 -1
  428. package/dist/client/assets/content-eqZXKWcP.js +0 -1
  429. package/dist/client/assets/content-iyyQKwvA.js +0 -1
  430. package/dist/client/assets/content-pDE7Fpb9.js +0 -1
  431. package/dist/client/assets/content-pPSd2dua.js +0 -1
  432. package/dist/client/assets/conversation-model-CHwHZNw-.js +0 -1
  433. package/dist/client/assets/conversation-motion-features-DXtKlmuM.js +0 -1
  434. package/dist/client/assets/ctx-panel-B4s49N9e.css +0 -1
  435. package/dist/client/assets/discover-DKf0aTr_.js +0 -2
  436. package/dist/client/assets/embed-entry-RlQUTtc4.js +0 -2
  437. package/dist/client/assets/gestures-CcEOV6Sr.js +0 -1
  438. package/dist/client/assets/harnesses-screen-DBZoTZz8.css +0 -1
  439. package/dist/client/assets/home-moving-signal-Bh2FugbH.js +0 -1
  440. package/dist/client/assets/home-moving-signal-CAa0V91u.css +0 -1
  441. package/dist/client/assets/home-now-card-ByRH5fFx.js +0 -1
  442. package/dist/client/assets/hooks-DUZwL3Aq.js +0 -2
  443. package/dist/client/assets/index-BBznYVWk.css +0 -1
  444. package/dist/client/assets/index-BTuq-8Iv.js +0 -1
  445. package/dist/client/assets/index-CmwGCxUk.js +0 -1
  446. package/dist/client/assets/index-CvF09yvf.css +0 -1
  447. package/dist/client/assets/index-DmFAhGPj.js +0 -10
  448. package/dist/client/assets/index-Dtaswdsh.js +0 -1
  449. package/dist/client/assets/inspector-panel-DzgS5_Mv.js +0 -2
  450. package/dist/client/assets/left-8NITBvFX.js +0 -1
  451. package/dist/client/assets/left-B2HEqrTM.js +0 -2
  452. package/dist/client/assets/left-Bk3XnxPD.css +0 -1
  453. package/dist/client/assets/left-CCoobxPS.css +0 -1
  454. package/dist/client/assets/left-CTYUvXbe.js +0 -1
  455. package/dist/client/assets/left-CwDRT50z.js +0 -2
  456. package/dist/client/assets/left-CxlDLJlw.js +0 -1
  457. package/dist/client/assets/left-XFXxNd4g.js +0 -1
  458. package/dist/client/assets/left-agents-Ck4Xn-R8.js +0 -1
  459. package/dist/client/assets/left-default-BeOyS0bR.js +0 -1
  460. package/dist/client/assets/left-lanes-DZp3jJMo.js +0 -1
  461. package/dist/client/assets/left-mission-CuKFQ5xL.js +0 -1
  462. package/dist/client/assets/left-p1hkO6P0.js +0 -1
  463. package/dist/client/assets/left-plan-3rrFENhp.js +0 -2
  464. package/dist/client/assets/library-E--gKzEZ.js +0 -1
  465. package/dist/client/assets/mesh-buckets-CfAukILK.js +0 -1
  466. package/dist/client/assets/message-visibility-kJM8XcSG.js +0 -1
  467. package/dist/client/assets/mission-control-m3BTDQ9l.css +0 -1
  468. package/dist/client/assets/model-Co0zkMIc.js +0 -1
  469. package/dist/client/assets/plan-view-D56fneVF.css +0 -1
  470. package/dist/client/assets/profile-Dxj3VVOM.js +0 -1
  471. package/dist/client/assets/projects-inbox-COZ23dLR.css +0 -1
  472. package/dist/client/assets/projects-inbox-Dzt_GQDv.js +0 -1
  473. package/dist/client/assets/resolve-panes-C9gF0w4e.js +0 -1
  474. package/dist/client/assets/resolve-sidebar-context-DxbY5RCH.js +0 -1
  475. package/dist/client/assets/right-5L7Tn0zG.js +0 -1
  476. package/dist/client/assets/right-CYtkMmRu.js +0 -1
  477. package/dist/client/assets/right-CreoQzPP.js +0 -1
  478. package/dist/client/assets/right-D9xFfy2b.js +0 -1
  479. package/dist/client/assets/right-DI7zHADe.js +0 -1
  480. package/dist/client/assets/right-DUbJ3WVc.js +0 -1
  481. package/dist/client/assets/right-DiybhsiK.js +0 -1
  482. package/dist/client/assets/right-Jh_1Q88s.js +0 -1
  483. package/dist/client/assets/right-udr1qTJG.js +0 -1
  484. package/dist/client/assets/router-Cn_s9IGH.js +0 -1
  485. package/dist/client/assets/runtime-picker-vhm0gtLs.css +0 -1
  486. package/dist/client/assets/scout-voice-CwbOz6EN.js +0 -1
  487. package/dist/client/assets/secondaryNavConfig-Dw3gS1jR.js +0 -1
  488. package/dist/client/assets/sse-CxXt4tqI.js +0 -1
  489. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +0 -1
  490. package/dist/client/assets/terminal-screen-BqVnCwl0.css +0 -1
  491. package/dist/client/assets/terminal-sessions-AmSgHklm.js +0 -1
  492. package/dist/client/assets/text-DsBWV_4k.js +0 -1
  493. package/dist/client/assets/use-conversation-list-C-dPcjQe.js +0 -1
  494. package/dist/client/assets/use-reduced-motion-CYqhYqHO.js +0 -1
  495. package/dist/client/assets/useContentSecondaryNav-DjHBrgnS.js +0 -1
  496. package/dist/highlights-eq9cgrbb.scm +0 -604
  497. package/dist/highlights-ghv9g403.scm +0 -205
  498. package/dist/highlights-hk7bwhj4.scm +0 -284
  499. package/dist/highlights-r812a2qc.scm +0 -150
  500. package/dist/highlights-x6tmsnaa.scm +0 -115
  501. package/dist/injections-73j83es3.scm +0 -27
  502. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  503. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  504. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  505. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  506. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  507. /package/dist/client/assets/{document-focus-viewer-BSC_JwVE.css → DocumentFocusViewer-BSC_JwVE.css} +0 -0
@@ -1 +0,0 @@
1
- import{j as t,r as h}from"./index-DmFAhGPj.js";import{u as Z}from"./Provider-cJCdHAxu.js";import{o as ee}from"./openAgent-Dbv5wfuL.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-CxXt4tqI.js";import{r as E}from"./terminal-relay-TffuSPGs.js";import{q as re}from"./terminal-takeover-BOFPRPjR.js";import{r as fe,s as ve,a as be,b as je,c as ke}from"./session-catalog-ClS9xf6i.js";import{p as ae}from"./model-Co0zkMIc.js";import{u as ge}from"./ContextMenu-CHIuVKz7.js";import{A as Ne}from"./AgentAvatar-D8ZtMluU.js";import{A as we}from"./AgentLiveActions-BJ5dIfL3.js";import{T as H}from"./TmuxPeek-B4QdHbGm.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./index-BWHgHrtv.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";import"./eye-1J4yOUoG.js";import"./terminal-DJPUp_Qn.js";/* empty css */import"./refresh-cw-C4x1x6b_.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};
@@ -1 +0,0 @@
1
- import{r as p,j as s}from"./index-DmFAhGPj.js";import{u as R,s as v,a as b}from"./mesh-view-store-KJzABIkN.js";import{u as E}from"./local-agents-B5pq17tZ.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-cJCdHAxu.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.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};
@@ -1 +0,0 @@
1
- import{r as l,j as e}from"./index-DmFAhGPj.js";import{u as P}from"./Provider-cJCdHAxu.js";import{a as g}from"./api-h5zurxmi.js";import{u as A}from"./sse-CxXt4tqI.js";import{t as b}from"./time-Dhsh_2EG.js";import{o as k}from"./openContent-C6XO6kr5.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.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};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-DmFAhGPj.js";import{u as h}from"./Provider-cJCdHAxu.js";import{o as j}from"./openAgent-Dbv5wfuL.js";import{n as v,i as u,c as d}from"./colors-BtO5_zlx.js";import{A as b}from"./AgentAvatar-D8ZtMluU.js";import{t as g}from"./time-Dhsh_2EG.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./openContent-C6XO6kr5.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.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};
@@ -1 +0,0 @@
1
- import{r as y,j as e}from"./index-DmFAhGPj.js";import{a as O}from"./api-h5zurxmi.js";import{a as r,t as f}from"./time-Dhsh_2EG.js";import{u as M,j as R}from"./mesh-ops-5pZCYptW.js";import{u as L}from"./mesh-view-store-KJzABIkN.js";import{u as H}from"./Provider-cJCdHAxu.js";/* empty css */import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";function E(o){return o.state==="waiting"&&o.nextMoveOwnerId==="operator"&&o.waitingOn?.label==="Held by operator"}function t({label:o,value:c}){return c?e.jsxs("div",{className:"mesh-ops-detail-row",children:[e.jsx("span",{className:"mesh-ops-detail-label",children:o}),e.jsx("span",{className:"mesh-ops-detail-value",children:c})]}):null}function Ae(){const{navigate:o}=H(),{items:c,hosts:h,selectedItemId:w,lab:A}=M(),{meshSnapshot:p}=L(),[i,x]=y.useState(null),[v,j]=y.useState(null),s=c.find(l=>l.id===w)??null,u=async l=>{if(!(!s||i)){x(l),j(null);try{await O(`/api/mesh-ops/items/${encodeURIComponent(s.id)}/${l}`,{method:"POST",body:"{}"}),R()}catch(d){j(d instanceof Error?d.message:String(d))}finally{x(null)}}};if(!s){const l=new Map;for(const n of c)n.hostNodeId&&l.set(n.hostNodeId,(l.get(n.hostNodeId)??0)+1);const d=p?.localNode?.id??null;return e.jsxs("div",{className:"ctx-panel mesh-ops-inspector",children:[e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Mesh"}),h.map(n=>e.jsx(t,{label:n.nodeId===d?"this host":"peer",value:`${n.label} · ${l.get(n.nodeId)??0} items${n.liveSessionCount>0?` · ${n.liveSessionCount} live`:""}`},n.nodeId)),h.length===0&&e.jsx("div",{className:"ctx-panel-empty",children:"No hosts yet."})]}),e.jsx("div",{className:"ctx-panel-section",children:e.jsx("p",{className:"mesh-ops-inspector-note",children:"Select an item to inspect it. Counts are items attributed to each host; the map stays in the mesh screen."})})]})}if(s.kind==="session"&&s.session){const l=s.session;return e.jsxs("div",{className:"ctx-panel mesh-ops-inspector",children:[e.jsxs("div",{className:"mesh-ops-inspector-header",children:[e.jsx("div",{className:"mesh-ops-inspector-title",children:s.title}),e.jsxs("div",{className:"mesh-ops-inspector-summary",children:[l.live?`Live ${l.harness} session`:l.endedAt!==null?`Ended ${l.harness} session`:`Lost ${l.harness} session — no end marker, last seen ${r(l.lastSeenAt)}`,l.alias?` · ${l.alias}`:""]})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Session"}),e.jsx(t,{label:"harness",value:l.harness}),e.jsx(t,{label:"state",value:l.endedAt!==null?"ended":l.state}),e.jsx(t,{label:"agent",value:s.ownerId}),e.jsx(t,{label:"started",value:l.startedAt!==null?r(l.startedAt):null}),e.jsx(t,{label:"last seen",value:r(l.lastSeenAt)}),e.jsx(t,{label:"ended",value:l.endedAt!==null?r(l.endedAt):null})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Venue"}),e.jsx(t,{label:"host",value:s.hostLabel}),e.jsx(t,{label:"project",value:s.projectRoot}),e.jsx(t,{label:"cwd",value:l.cwd})]})]})}const S=E(s),I=s.state==="done"||s.state==="cancelled",$=s.state==="open"||s.state==="working",C=S,m=s.state==="review",a=s.latestFlight,k=a!==null&&(a.state==="running"||a.state==="queued"),b=p?.localNode?.hostName?.split(".")[0]??p?.localNode?.name??"here",N=s.hostLabel??"unattributed",g=N===b||s.hostNodeId===null;return e.jsxs("div",{className:"ctx-panel mesh-ops-inspector",children:[e.jsxs("div",{className:"mesh-ops-inspector-header",children:[e.jsx("div",{className:"mesh-ops-inspector-title",children:s.title}),s.summary&&e.jsx("div",{className:"mesh-ops-inspector-summary",children:s.summary})]}),A.routeStrip&&e.jsx("div",{className:"mesh-ops-routestrip","aria-hidden":!0,children:e.jsxs("svg",{viewBox:"0 0 260 40",className:"mesh-ops-routestrip-svg",children:[e.jsx("line",{x1:"24",y1:"18",x2:"236",y2:"18",className:`mesh-ops-routestrip-line${k&&!g?" mesh-ops-routestrip-line--moving":""}`}),e.jsx("rect",{x:"14",y:"12",width:"12",height:"12",rx:"2",className:"mesh-ops-routestrip-node"}),e.jsx("rect",{x:"234",y:"12",width:"12",height:"12",rx:"2",className:"mesh-ops-routestrip-node"}),e.jsx("text",{x:"20",y:"36",textAnchor:"middle",className:"mesh-ops-routestrip-label",children:b}),e.jsx("text",{x:"246",y:"36",textAnchor:"end",className:"mesh-ops-routestrip-label",children:g?"(same host)":N})]})}),!I&&e.jsxs("div",{className:"mesh-ops-actions",children:[C?e.jsx("button",{type:"button",className:"mesh-ops-button",disabled:i!==null,onClick:()=>{u("release")},children:i==="release"?"Releasing…":"Release"}):$?e.jsx("button",{type:"button",className:"mesh-ops-button",disabled:i!==null,onClick:()=>{u("hold")},children:i==="hold"?"Holding…":"Hold"}):null,(s.state==="review"||s.attention!=="silent")&&e.jsx("button",{type:"button",className:"mesh-ops-button",disabled:i!==null,onClick:()=>{u(m?"accept":"clear")},title:m?"Accept this work item":"Dismiss this item from the attention queue",children:i==="accept"||i==="clear"?m?"Accepting…":"Clearing…":m?"Accept":"Clear"}),e.jsx("button",{type:"button",className:"mesh-ops-button",onClick:()=>o({view:"work",workId:s.id}),title:"Open the full work item",children:"Open item"})]}),v&&e.jsx("div",{className:"ctx-panel-empty","data-tone":"error",children:v}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"State"}),e.jsx(t,{label:"phase",value:s.currentPhase}),e.jsx(t,{label:"state",value:s.state}),e.jsx(t,{label:"attention",value:s.attention==="silent"?null:s.attention}),e.jsx(t,{label:"waiting on",value:s.waitingOn?.label??null}),e.jsx(t,{label:"acceptance",value:s.acceptanceState==="none"?null:s.acceptanceState}),e.jsx(t,{label:"priority",value:s.priority}),e.jsx(t,{label:"labels",value:s.labels.length>0?s.labels.join(", "):null})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Venue"}),e.jsx(t,{label:"owner",value:s.ownerName??s.ownerId}),e.jsx(t,{label:"host",value:s.hostLabel??(s.hostNodeId?s.hostNodeId:null)}),e.jsx(t,{label:"project",value:s.projectRoot})]}),a&&e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Latest flight"}),e.jsx(t,{label:"state",value:a.state}),e.jsx(t,{label:"summary",value:a.summary}),e.jsx(t,{label:"started",value:a.startedAt!==null?r(a.startedAt):null}),e.jsx(t,{label:"completed",value:a.completedAt!==null?r(a.completedAt):null}),s.activeFlightCount>0&&e.jsx(t,{label:"active",value:`${s.activeFlightCount} in flight`})]}),e.jsxs("div",{className:"ctx-panel-section",children:[e.jsx("div",{className:"ctx-panel-section-label",children:"Activity"}),e.jsx(t,{label:"last",value:s.lastMeaningfulSummary}),e.jsx(t,{label:"updated",value:`${f(s.updatedAt)} · created ${f(s.createdAt)}`})]})]})}export{Ae as MeshOpsInspector};
@@ -1 +0,0 @@
1
- import{r as i,j as e}from"./index-DmFAhGPj.js";import{u as ct}from"./Provider-cJCdHAxu.js";import{o as $e}from"./openContent-C6XO6kr5.js";import{a as B}from"./api-h5zurxmi.js";import{u as rt}from"./sse-CxXt4tqI.js";import{u as lt}from"./tail-events-BdvqZHLr.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-BJ5dIfL3.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-CHwHZNw-.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-Cn_s9IGH.js";import{T as yt}from"./TmuxPeek-B4QdHbGm.js";import{S as It}from"./scroll-text-DPPYrqB9.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./index-BWHgHrtv.js";import"./terminal-takeover-BOFPRPjR.js";import"./eye-1J4yOUoG.js";import"./terminal-DJPUp_Qn.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";/* empty css */import"./refresh-cw-C4x1x6b_.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};
@@ -1 +0,0 @@
1
- import{r as d,j as e}from"./index-DmFAhGPj.js";import{u as k}from"./Provider-cJCdHAxu.js";import{c as y}from"./colors-BtO5_zlx.js";import{A as S}from"./AgentAvatar-D8ZtMluU.js";import{t as N}from"./time-Dhsh_2EG.js";import{f as w}from"./text-DsBWV_4k.js";import{c as I}from"./clipboard-e3fSpeo7.js";import{f as T,r as C,t as R}from"./terminal-sessions-AmSgHklm.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./api-h5zurxmi.js";import"./sse-CxXt4tqI.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";function Se(){const{route:t,agents:o,navigate:s}=k();if(t.view!=="terminal")return null;const r=t.agentId?o.find(i=>i.id===t.agentId)??null:null,l=t.mode??"takeover",[f,p]=d.useState(null);d.useEffect(()=>{if(t.view!=="terminal"||t.agentId||!t.terminalSurfaceKey){p(null);return}let i=!1;return T().then(g=>{i||p(C(g,t.terminalSessionId,t.terminalSurfaceKey))}).catch(()=>{i||p(null)}),()=>{i=!0}},[t.agentId,t.terminalSessionId,t.terminalSurfaceKey,t.view]);const j=f?R(f.surface):null,n=(r?$(r):null)??j,c=d.useMemo(()=>n?A(n):null,[n]);return r?e.jsxs("div",{className:"flex h-full flex-col gap-4 overflow-y-auto p-4 text-sm frame-scrollbar",children:[e.jsx(D,{agent:r}),e.jsxs(u,{label:"Terminal",children:[e.jsx(a,{label:"Mode",value:v(l)}),e.jsx(a,{label:"Backend",value:n?.backend??"pty"}),n&&e.jsx(a,{label:"Session",value:n.sessionName}),n?.paneId&&e.jsx(a,{label:"Pane",value:n.paneId}),e.jsx(a,{label:"State",value:y(r.state)})]}),c&&e.jsx(h,{label:"Open in your own terminal",command:c}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[n&&e.jsx(m,{active:l==="observe",label:"Observe",onClick:()=>s(b(r.id,"observe"))}),e.jsx(m,{active:l==="takeover",label:"Takeover",onClick:()=>s(b(r.id,"takeover"))}),e.jsx(m,{label:"Profile",onClick:()=>s({view:"agents-v2",agentId:r.id,tab:"profile"})}),e.jsx(m,{label:"Trace",onClick:()=>s({view:"agents-v2",agentId:r.id,tab:"observe"})})]}),e.jsxs(u,{label:"Agent",children:[e.jsx(a,{label:"Harness",value:r.harness??"-"}),e.jsx(a,{label:"Transport",value:r.transport??"-"}),r.role&&e.jsx(a,{label:"Role",value:w(r.role)??r.role}),r.handle&&e.jsx(a,{label:"Handle",value:`@${r.handle}`}),r.updatedAt&&e.jsx(a,{label:"Updated",value:N(r.updatedAt)})]}),(r.project||r.branch||r.cwd||r.projectRoot)&&e.jsxs(u,{label:"Workspace",children:[r.project&&e.jsx(a,{label:"Name",value:r.project}),r.branch&&e.jsx(a,{label:"Branch",value:r.branch}),r.cwd&&e.jsx(a,{label:"Cwd",value:r.cwd}),!r.cwd&&r.projectRoot&&e.jsx(a,{label:"Root",value:r.projectRoot})]})]}):e.jsxs("div",{className:"flex h-full flex-col gap-4 overflow-y-auto p-4 text-sm frame-scrollbar",children:[e.jsxs(u,{label:"Terminal",children:[e.jsx(a,{label:"Mode",value:v(l)}),t.agentId&&e.jsx(a,{label:"Agent",value:t.agentId}),n&&e.jsx(a,{label:"Backend",value:n.backend}),n&&e.jsx(a,{label:"Session",value:n.sessionName})]}),c&&e.jsx(h,{label:"Open in your own terminal",command:c})]})}function x(t){return/^[A-Za-z0-9_./:@%+=,-]+$/u.test(t)?t:`'${t.replace(/'/gu,"'\\''")}'`}function A(t){return t.backend==="tmux"?`tmux attach -t ${x(t.sessionName)}`:`${t.socketDir?`ZELLIJ_SOCKET_DIR=${x(t.socketDir)} `:""}zellij attach ${x(t.sessionName)}`}function b(t,o){return{view:"terminal",agentId:t,mode:o}}function $(t){return t.terminalSurface?t.terminalSurface:t.transport==="tmux"&&t.harnessSessionId?{backend:"tmux",sessionName:t.harnessSessionId,paneId:null,socketDir:null}:null}function v(t){return t==="observe"?"Read-only observe":"Interactive takeover"}function D({agent:t}){return e.jsx("div",{className:"border-b border-[var(--scout-chrome-border-soft)] pb-3",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(S,{agent:t,placement:"row",size:32,presence:!1}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-lg leading-snug text-[var(--scout-chrome-ink-strong)]",children:t.name}),t.handle&&e.jsxs("div",{className:"truncate font-mono text-xs text-cyan-400/70",children:["@",t.handle]})]})]})})}function m({active:t,label:o,onClick:s}){return e.jsx("button",{type:"button",onClick:s,className:`h-7 rounded border px-2 font-mono text-2xs uppercase tracking-[0.1em] transition-colors ${t?"border-cyan-400/35 bg-cyan-400/[0.12] text-cyan-200":"border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] text-[var(--scout-chrome-ink-soft)] hover:bg-[var(--scout-chrome-active)] hover:text-[var(--scout-chrome-ink)]"}`,children:o})}function h({label:t,command:o}){const[s,r]=d.useState(!1);return e.jsxs("details",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] p-2",children:[e.jsx("summary",{className:"cursor-pointer select-none font-mono text-2xs uppercase tracking-[0.15em] text-[var(--scout-chrome-ink-faint)]",children:t}),e.jsx("div",{className:"mb-1.5 mt-2 flex items-center justify-end gap-2",children:e.jsx("button",{type:"button",className:"rounded border border-cyan-400/20 bg-cyan-400/[0.08] px-2 py-1 font-mono text-2xs uppercase tracking-[0.1em] text-cyan-100/80 hover:bg-cyan-400/[0.14]",onClick:()=>{I(o).then(l=>{l&&(r(!0),window.setTimeout(()=>r(!1),1200))})},children:s?"Copied":"Copy"})}),e.jsx("code",{className:"block select-text break-all rounded bg-black/25 p-2 font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink)]",children:o})]})}function u({label:t,children:o}){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}),o]})}function a({label:t,value:o}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-2 py-0.5",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-right text-sm font-mono text-[var(--scout-chrome-ink)]",children:o})]})}export{Se as TerminalInspector};
@@ -1 +0,0 @@
1
- import{r as L,j as Nn,p as ce,q as Mn,t as Ne,v as Me,k as Bn,w as zn,s as T,l as h,x as Wn,y as J,z as Kn,A as Gn}from"./index-DmFAhGPj.js";import{n as ue}from"./synthetic-agent-routing-aduMYO7P.js";import{o as Hn,q as Be,n as Vn,u as Yn}from"./terminal-sessions-AmSgHklm.js";var ze=["local","url","sharedConfig","env"];function We(e){const n=qn(e),t=e.audienceIncludes??Qn(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 u=r[a];if(!u)return o(a),{key:a,enabled:!1,value:!1,layer:"default",audience:n,reason:"unknown-flag"};const d=Xn(e.layers,a);return d?{key:a,enabled:d.value,value:d.value,layer:d.layer,audience:n,requiredTier:u.tier,reason:"override",definition:u}:u.defaultEnabled?u.tier&&!t(n,u.tier)?{key:a,enabled:!1,value:!1,layer:"default",audience:n,requiredTier:u.tier,reason:"audience-denied",definition:u}:{key:a,enabled:!0,value:!0,layer:"default",audience:n,requiredTier:u.tier,reason:"default",definition:u}:{key:a,enabled:!1,value:!1,layer:"default",audience:n,requiredTier:u.tier,reason:"default",definition:u}}return{registry:e.registry,isEnabled:a=>i(String(a)).enabled,explain:a=>i(String(a)),all:()=>Object.keys(e.registry).sort().map(i),audience:()=>n}}function qn(e){let n=e.audience.tier;for(const t of ze.slice().reverse()){const s=e.layers?.[t]?.audience;s&&(n=s)}return{...e.audience,tier:n}}function Qn(e){return(n,t)=>{if(n.tier===t)return!0;if(!e||e.length===0)return!1;const s=e.indexOf(n.tier),o=e.indexOf(t);return s<0||o<0?!1:s>=o}}function Xn(e,n){for(const t of ze){const s=Zn(e?.[t]?.flags?.[n]);if(s!==null)return{layer:t,value:s}}return null}function Zn(e){return e===!0||e==="on"?!0:e===!1||e==="off"?!1:null}function Jn(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 n=e.trim().toLowerCase();if(["1","true","on","yes","enabled","enable"].includes(n))return!0;if(["0","false","off","no","disabled","disable"].includes(n))return!1;if(["default","null","unset","clear"].includes(n))return"default"}function et(e,n={}){const t=n.paramPrefix??"ff.",s=n.audienceParam??"ffAudience",o=typeof e=="string"?new URL(e,"http://hudson.local"):e,r={};let i;for(const[a,u]of o.searchParams.entries()){if(a===s&&u.trim()&&(i=u.trim()),!a.startsWith(t))continue;const d=a.slice(t.length),f=Jn(u);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 n=window.localStorage?.getItem(e);return nt(n)}catch{return{version:x}}}function q(e,n){if(typeof window>"u")return;const t=Ge(n),s=JSON.stringify(t);try{window.localStorage?.setItem(e,s)}catch{}tt(e,s)}function nt(e){if(!e)return{version:x};try{const n=JSON.parse(e);return!n||typeof n!="object"?{version:x}:Ge(n)}catch{return{version:x}}}function Ge(e){const n={version:x};if(e.audience&&(n.audience=e.audience),e.flags&&typeof e.flags=="object"){n.flags={};for(const[t,s]of Object.entries(e.flags))(s===!0||s===!1)&&(n.flags[t]=s);Object.keys(n.flags).length===0&&delete n.flags}return n}function tt(e,n){if(!(typeof document>"u"))try{const t=encodeURIComponent(n);document.cookie=`${encodeURIComponent(e)}=${t}; Path=/; SameSite=Lax; Max-Age=31536000`}catch{}}var st="hudson.flags",He=L.createContext(null);function xs({registry:e,audience:n,audienceOrder:t,audienceIncludes:s,initialLayers:o,storageKey:r=st,warnOnUnknown:i=!1,children:a}){const[u,d]=L.useState(()=>{const g=o?.local;return{version:1,audience:g?.audience??void 0,flags:ot(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:u.audience??o?.local?.audience,flags:{...o?.local?.flags??{},...u.flags??{}}}}),[o,u]),S=L.useMemo(()=>We({registry:e,audience:n,audienceOrder:t,audienceIncludes:s,layers:f,warnOnUnknown:i}),[e,n,t,s,f,i]),A=L.useMemo(()=>({...S,layers:f,storageKey:r,setLocalOverride:(g,w)=>{d(R=>{const U={...R.flags??{}};w===null?delete U[g]:U[g]=w;const _={...R,version:1,flags:U};return q(r,_),_})},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)}}),[S,f,r]);return Nn.jsx(He.Provider,{value:A,children:a})}function Ve(){return L.useContext(He)}function Ds(){const e=Ve();if(!e)throw new Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}function js(e,n=!0){return Ve()?.isEnabled(e)??n}function ot(e){if(!e?.flags)return;const n={};for(const[t,s]of Object.entries(e.flags))(s===!0||s===!1)&&(n[t]=s);return Object.keys(n).length>0?n:void 0}const rt=["ops.control","ops.mesh","ops.runtime","ops.plans","ops.terminal"],at=["surface.search","surface.sessions","surface.briefings","surface.work","surface.activity","surface.follow","surface.scoutbot","surface.workflows"];function ye(e,n){return Object.fromEntries(e.map(t=>[t,n]))}const Ye={label:"Surface · Scope",description:`Scope presentation on Scout infra — lean lanes/tail/sessions/agents at ${Mn}/*.`,defaultEnabled:!1,tier:"everyone",owner:"scout-web",tags:["surface","scope","observability"]},it={...Ye,label:"Surface · Scope (legacy alias)",description:`Legacy alias for ${ce}. Prefer the primary flag; ${Ne} remains for old dev links.`},Ns=ce;function ct(){return{audience:"everyone",flags:{"ops.control":!0,"ops.lanes":!0,...ye(rt,!1),...ye(at,!1)}}}const qe=["ffBundle","ffVariant","scoutBundle","scoutExperience","ab"],Qe=["ffGlobal","scoutGlobalBundle"],Xe=["ffPersist","persistBundle"],ut=new Set(["no-ops","ffAudience",...qe,...Qe,...Xe]);function Ms(e){for(const n of[...e.searchParams.keys()])(ut.has(n)||n.startsWith("ff."))&&e.searchParams.delete(n);return e}const lt=["everyone","internal","power"],dt="openscout.flags",ee="openscout.flagBundle",ft={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"],mt={"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]:it},pt={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",...zn},Re=new Set(["clear","default","none","reset","unset"]);function K(e,n){return Object.fromEntries(e.map(t=>[t,n]))}function Ze(...e){const n={};for(const t of e)t.audience&&(n.audience=t.audience),t.flags&&Object.keys(t.flags).length>0&&(n.flags={...n.flags??{},...t.flags});return n}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 Bn:return ct()}}function j(e){return e?pt[e.trim().toLowerCase()]??null:null}function ne(e,n){for(const t of n){const s=e.get(t);if(s!==null)return s}return null}function Je(e){const n=ne(e,qe);return j(n)}function gt(e){const n=ne(e,Qe);if(n){const i=n.trim().toLowerCase();if(Re.has(i))return{action:"clear"};const a=j(n);return a?{action:"set",bundle:a}:null}const t=ne(e,Xe);if(!t)return null;const s=t.trim().toLowerCase();if(Re.has(s))return{action:"clear"};if(["0","false","no"].includes(s))return null;const o=j(t);if(o)return{action:"set",bundle:o};const r=Je(e);return r?{action:"set",bundle:r}:null}function en(){if(typeof window>"u")return null;try{return j(window.localStorage.getItem(ee))}catch{return null}}function ht(e){if(!(typeof window>"u"))try{e.action==="clear"?window.localStorage.removeItem(ee):window.localStorage.setItem(ee,e.bundle)}catch{}}function Bs(){return en()??j(Me())??tn}function nn(){const e=en();return e?le(e):{}}const tn="light-prod";function sn(){const e=j(Me())??tn;return le(e)}function wt(e){const n=gt(e);n&&ht(n)}function on(e=new URLSearchParams(window.location.search)){const n=et(window.location.href),t=Je(e),s=t?le(t):{},o={audience:n.audience??s.audience,flags:{...s.flags??{},...n.flags??{}}};return e.has("no-ops")&&(o.flags={...o.flags,"ops.control":!1}),o}function It(){const e=Ke(dt);return{flags:e.flags,audience:e.audience??void 0}}function zs(){if(typeof window>"u")return{};const e=new URLSearchParams(window.location.search);return wt(e),{sharedConfig:Ze(sn(),nn()),url:on(e)}}function vt(e){const n=typeof window>"u"?{}:{sharedConfig:Ze(sn(),nn()),url:on(),local:It()};return We({registry:mt,audience:ft,audienceOrder:lt,layers:n,warnOnUnknown:!1}).isEnabled(e)}function rn(){return vt("ops.control")}const te={sm:408,md:512,lg:616},an=240,cn=640,St=24,un="openscout:lane-deck:v1",bt=new Set(["web.ops","macos.lanes","hud.tail","web.embed"]),de=new Set(["sm","md","lg"]),ln={"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}},Lt=ln["web.ops"];function fe(e){return dn(e)?ln[e]:Lt}const H={pinned_left:0,main:1,pinned_right:2};function dn(e){return bt.has(e)}function Ws(e=window.location.search,n=window.location.pathname){const t=new URLSearchParams(e),s=t.get("profile")?.trim().toLowerCase();if(s&&dn(s))return s;const o=t.get("embed")?.trim().toLowerCase();return o==="hud"?"hud.tail":o==="app"?"macos.lanes":n.includes("/lanes/embed")?"web.embed":(n.includes("/ops/lanes"),"web.ops")}function Ks(e=window.location.search){const n=new URLSearchParams(e),t=(n.get("lanes")??n.get("size"))?.trim().toLowerCase();return t&&de.has(t)?t:"lg"}function Gs(e,n){if(typeof e=="number"&&Number.isFinite(e))return Math.min(cn,Math.max(an,Math.round(e)));const t=typeof e=="string"&&de.has(e)?e:n;return te[t]}function Hs(e){const n=Math.min(cn,Math.max(an,Math.round(e)));let t=null,s=Number.POSITIVE_INFINITY;for(const[o,r]of Object.entries(te)){const i=Math.abs(r-n);i<s&&(s=i,t=o)}return t&&s<=St?{px:te[t],tier:t}:{px:n,tier:null}}function me(e,n,t){return{version:1,profileId:e,defaultLaneWidth:n??t.defaultLaneWidth,defaultHorizon:t.defaultHorizon,laneWidths:{},laneDefs:[],slots:[],showAutoLanes:t.showAutoLanes,updatedAt:Date.now()}}function Pe(e,n){const t=fe(e);return me(e,n,t)}function se(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&de.has(e))return e}function yt(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||n.kind!=="session"&&n.kind!=="harness"&&n.kind!=="project"&&n.kind!=="attention"||typeof n.title!="string"||!n.title.trim()?null:{id:n.id.trim(),kind:n.kind,title:n.title.trim(),sessionId:typeof n.sessionId=="string"?n.sessionId.trim():void 0,harness:typeof n.harness=="string"?n.harness.trim():void 0,projectPath:typeof n.projectPath=="string"?n.projectPath.trim():void 0}}function Et(e){if(!e||typeof e!="object")return null;const n=e;return typeof n.id!="string"||!n.id.trim()||typeof n.laneDefId!="string"||!n.laneDefId.trim()||n.zone!=="pinned_left"&&n.zone!=="main"&&n.zone!=="pinned_right"||typeof n.position!="number"||!Number.isFinite(n.position)?null:{id:n.id.trim(),laneDefId:n.laneDefId.trim(),zone:n.zone,position:n.position,width:se(n.width)}}function fn(e,n,t,s){if(!e||typeof e!="object")return me(n,t,s);const o=e,r=Array.isArray(o.laneDefs)?o.laneDefs.map(yt).filter(d=>d!==null):[],i=Array.isArray(o.slots)?o.slots.map(Et).filter(d=>d!==null):[],a={};if(o.laneWidths&&typeof o.laneWidths=="object")for(const[d,f]of Object.entries(o.laneWidths)){const S=se(f);S!==void 0&&(a[d]=S)}const u=se(o.defaultLaneWidth);return{version:1,profileId:n,defaultLaneWidth:(typeof u=="string"?u:void 0)??t??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 $t(e,n,t){return fn(e,n,t,fe(n))}function Vs(e,n){const t=fe(e),s=n??t.defaultLaneWidth;try{const o=localStorage.getItem(`${un}:${e}`);return o?$t(JSON.parse(o),e,s):Pe(e,s)}catch{return Pe(e,s)}}function Rt(e){try{localStorage.setItem(`${un}:${e.profileId}`,JSON.stringify({...e,updatedAt:Date.now()}))}catch{}}function Ys(e){return[...e].sort((n,t)=>{const s=H[n.zone]-H[t.zone];return s!==0?s:n.position-t.position})}function qs(e,n){return H[e]-H[n]}function mn(){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 Pt(e){return`harness:${pe(e)}`}function Ct(e){return`project:${pe(e)}`}const At="attention:needs-input";function pn(e,n){const t=e.filter(s=>s.zone===n);return t.length===0?0:Math.max(...t.map(s=>s.position))+1}function gn(e,n){const t=e.laneDefs.some(s=>s.id===n.id);return{...e,laneDefs:t?e.laneDefs.map(s=>s.id===n.id?n:s):[...e.laneDefs,n]}}function hn(e,n){const t=e.slots.some(s=>s.id===n.id);return{...e,slots:t?e.slots.map(s=>s.id===n.id?n:s):[...e.slots,n]}}function wn(e,n){return{...e,slots:e.slots.filter(t=>t.laneDefId!==n)}}function _t(e,n){const t=Y(n);return{...wn(e,t),laneDefs:e.laneDefs.filter(s=>s.id!==t)}}function Qs(e,n){const t=Y(n);return e.slots.some(s=>s.laneDefId===t&&s.zone!=="main")}function Xs(e,n){const t=Y(n),s=e.slots.find(o=>o.laneDefId===t);return!s||s.zone==="main"?null:s.zone}function Zs(e,n){const t=n.zone??"pinned_left",s=Y(n.laneId),o=_t(e,n.laneId),r=gn(o,{id:s,kind:"session",title:n.title,sessionId:n.laneId});return hn(r,{id:mn(),laneDefId:s,zone:t,position:pn(r.slots,t),width:n.width})}function Js(e,n){const t=n.zone??"pinned_left",s=n.kind==="attention"?At:n.kind==="harness"&&n.harness?Pt(n.harness):n.kind==="project"&&n.projectPath?Ct(n.projectPath):`${n.kind}:${pe(n.title)}`,o=wn(e,s),r=gn(o,{id:s,kind:n.kind,title:n.title,harness:n.harness,projectPath:n.projectPath});return hn(r,{id:mn(),laneDefId:s,zone:t,position:pn(r.slots,t),width:n.width})}function eo(e,n,t){return{...e,laneWidths:{...e.laneWidths,[n]:t},updatedAt:Date.now()}}function no(e,n){return{...e,defaultLaneWidth:n,updatedAt:Date.now()}}function to(e){const n=new Set(e.slots.filter(t=>t.zone!=="main").map(t=>t.laneDefId));return{...e,slots:e.slots.filter(t=>t.zone==="main"),laneDefs:e.laneDefs.filter(t=>!n.has(t.id))}}const V="scope.lanes",oe={defaultLaneWidth:"md",showAutoLanes:!0,defaultHorizon:"30m"},Ut="openscout:lane-deck:v1";function Ce(e){return me(V,e,oe)}function so(e){const n=e??oe.defaultLaneWidth;try{const t=localStorage.getItem(`${Ut}:${V}`);return t?fn(JSON.parse(t),V,n,oe):Ce(n)}catch{return Ce(n)}}function oo(e){Rt(e)}const kt=[h.lanes,h.tail,h.sessions,h.agents];function Ft(e){return kt.includes(e)}function Tt(e){return e===Kn||e===Gn}function In(e){return Wn(e)}function Q(e,n={}){switch(e){case h.tail:{const t=new URLSearchParams;n.tailQuery&&t.set("q",n.tailQuery);const s=t.toString();return T(e,s?`?${s}`:"")}case h.sessions:return n.sessionId?T(e,`/${encodeURIComponent(n.sessionId)}`):T(e);case h.lanes:return T(J);case h.agents:return T(e);default:return T(J)}}function vn(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 Ot(e){const n=vn(e);return n?n===h.tail&&e.view==="ops"?Q(n,{tailQuery:e.tailQuery}):n===h.sessions&&e.view==="sessions"?Q(n,{sessionId:e.sessionId}):Q(n):null}function xt(e,n,t){if(!Tt(e[0]))return null;const s=e[1]??J;if(!Ft(s))return{view:"ops",mode:"lanes"};switch(s){case h.tail:{const o=n.searchParams.get("q")?.trim();return{view:"ops",mode:"tail",...o?{tailQuery:o}:{}}}case h.sessions:return e[2]?t({view:"sessions",sessionId:decodeURIComponent(e[2])}):t({view:"sessions"});case h.agents:return t({view:"agents-v2"});case h.lanes:default:return{view:"ops",mode:"lanes"}}}const Dt=new Set(["no-ops","ffBundle","ffVariant","scoutBundle","scoutExperience","ab","ffGlobal","scoutGlobalBundle","ffPersist","persistBundle","ffAudience","studio","studioInjection","studioMode"]),jt=["ff.","studio.","studioMode."];function Nt(e){return Dt.has(e)||jt.some(n=>e.startsWith(n))}function Sn(e,n=""){const t=new URL(e,"http://scout.local");new URLSearchParams(n).forEach((r,i)=>{Nt(i)&&(t.searchParams.has(i)||t.searchParams.set(i,r))});const o=t.searchParams.toString();return`${t.pathname}${o?`?${o}`:""}`}function ro(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 Mt(e=typeof window<"u"?window.location.pathname:""){return In(e)}function ao(){return V}function io(e=Mt()){return e?{"data-scope-presentation":!0}:void 0}function bn(e,n=typeof window<"u"?window.location.pathname:""){return In(n)?Ot(e):null}function Bt(e,n=typeof window<"u"?window.location.pathname:""){return bn(e,n)!==null}function co(e,n=typeof window<"u"?window.location.pathname:""){return Bt(e,n)?vn(e):null}const uo={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 Ae(e){const n=e?.trim();if(!n)return null;const t=n.replace(/[\\/]+$/,""),s=t.split(/[\\/]/).filter(Boolean).at(-1)??t;return s.endsWith(".jsonl")?s.slice(0,-6):s}function F(e){return e.sourceRefs.find(n=>n.kind==="harness_transcript")??null}function Ln(e){return e.sourceRefs.find(n=>n.kind==="file")??null}function ge(e){return e?Ae(e.sessionId)??Ae(re(e.path)):null}function lo(e){const n=ge(e);if(!n)return null;const t=e?.recordRange;return t?`${n}|records ${t[0]}..${t[1]}`:n}function z(e,n){const t=e.facets[n];return Array.isArray(t)?t.filter(Boolean).join(", "):typeof t=="string"?t:""}function M(e){const n=new Set;return e.split(/[^A-Za-z0-9_./-]+/u).map(t=>t.trim()).filter(t=>t.length>1).filter(t=>{const s=t.toLowerCase();return n.has(s)?!1:(n.add(s),!0)}).slice(0,12)}const zt=/^(events?\s+window(\s+\d+)?|files?\s+touched|tool\s+calls?|indexed\s+snippet|manifest|summary|decisions?|context\s+pack)\b/iu,_e=/^(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 yn(e){return zt.test(e.replace(/\s+/g," ").trim())}function Wt(e){let n=e.replace(/\s+/g," ").trim();if(!n)return"";if(n=n.replace(/<[^>\n]+>/g," ").replace(/\s+/g," ").trim(),Ue.test(n))n=n.replace(Ue,"").trim();else{const t=n.match(/^(.{6,72}?)\s[-–—]\s+(.+)$/u);if(t){const s=t[1]??"",o=t[2]??"";(_e.test(s)||/\b(?:am|pm|\d{1,2}:\d{2}|plugin|session|openscout)\b/iu.test(s))&&(n=o.trim())}}return n=n.replace(_e,"").replace(/^\s*[-–—:]\s*/,"").trim(),n=n.replace(/\s{2,}/g," ").trim(),n.length>72&&(n=`${n.slice(0,69).replace(/\s+\S*$/u,"").trimEnd()}…`),n}function Kt(e){const n=z(e,"project"),t=e.title.replace(/\s+/g," ").trim();if(t&&!yn(t)){const o=Wt(t);if(o&&o.toLowerCase()!==n.toLowerCase()||o)return o}if(n)return n;const s=ge(F(e));return s?s.length>18?`${s.slice(0,16)}…`:s:"Session match"}function En(e){const n=B(e,"recordKind",8).map(s=>s.toLowerCase());if(n.length===0&&n.push(...B(e,"recordTag",8).map(s=>s.toLowerCase())),n.some(s=>s.includes("assistant")))return"assistant";if(n.some(s=>s.includes("user")))return"user";if(n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response")))return"tool";const t=we(e);return t==="tool activity"?"tool":t==="overview"?"overview":""}function fo(e,n){const t=Ie(e.snippet,n),s=En(e),o=he(e);let r="";if(t){const i=M(n).map(d=>d.toLowerCase()),a=t.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]??t).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||Kt(e)}function Gt(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 ke(e){const n=e.trim().toLowerCase();return n?n==="events"||n.startsWith("events")?"conversation":n==="overview"||n==="summary"?"overview":n==="tool-calls"||n==="tools"?"tool activity":n==="files"||n==="files-touched"?"files touched":n==="manifest"?"session index":n.replace(/[-_]+/g," "):""}function Ht(e){const n=e.trim();return n?n.charAt(0).toUpperCase()+n.slice(1):""}function Vt(e){const n=z(e,"harness")||F(e)?.harness||"";if(!n)return"";const t=n.toLowerCase();return t==="claude"?"Claude":t==="codex"?"Codex":t==="kimi"?"Kimi":t==="cursor"?"Cursor":Ht(n)}function Yt(e){const n=z(e,"sessionId").trim(),t=ge(F(e)),s=(n||t||"").trim();return s?s.length>14?s.slice(0,8):s:""}function he(e){const n=F(e)?.recordRange;if(n){const[s,o]=n;return s===o?`turn ${s}`:o-s<=1?`turns ${s}–${o}`:`turns ${s}–${o}`}const t=e.title.match(/events?\s+window\s+(\d+)/iu);return t?`window ${Number(t[1])}`:""}function qt(e){const n=B(e,"recordKind",8).map(s=>s.toLowerCase());n.length===0&&n.push(...B(e,"recordTag",8).map(s=>s.toLowerCase()));const t=[];return n.some(s=>s.includes("user"))&&t.push("user"),n.some(s=>s.includes("assistant"))&&t.push("assistant"),n.some(s=>s.includes("tool")||s.includes("command")||s.includes("response"))&&t.push("tool"),t.length===0?"":t.join(" · ")}function we(e){const n=z(e,"documentKind");if(n){const s=n.split(",")[0]?.trim()??n;return ke(s)}return yn(e.title)?ke(e.title):Ln(e)?"file":F(e)?"conversation":""}function B(e,n,t=3){const s=e.facets[n];return(Array.isArray(s)?s:typeof s=="string"?s.split(","):[]).map(r=>r.trim()).filter(Boolean).slice(0,t)}function mo(e){return{agent:Vt(e),project:z(e,"project"),session:Yt(e),when:Gt(e),turn:he(e),role:qt(e),where:we(e)}}function po(e){const n=[],t=he(e);t&&n.push(t);const s=En(e);s&&n.push(s);const o=we(e);o&&o!=="conversation"&&n.push(o);const r=B(e,"toolName",2);r.length===1&&n.push(r[0]),r.length>1&&n.push(r.join(", "));const i=new Set;return n.filter(a=>{const u=a.toLowerCase();return i.has(u)?!1:(i.add(u),!0)})}function ae(e,n){return new RegExp(`(?<![A-Za-z0-9_./~-])${Pn(n)}(?![A-Za-z0-9_./~-])`,"iu").exec(e)?.index??-1}function Ie(e,n=""){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(t=t.replace(/\s*-\s*\[\d{3,}\]\s*`[^`]+`(?:\s*\([^)]*\))?\s*-\s*/gu," "),t=t.replace(/\[\d{3,}\]\s*`[^`]+`\s*/gu,""),t=t.replace(/\*\*/gu,""),t=t.replace(/\b(?:assistant_turn|user_turn|agent_reasoning|command_or_tool|response_item|system_record)\b/giu," "),t=t.replace(/(?:~\/|\.\.?\/|\/(?:Users|home|var|tmp|opt)\/)\S+/gu," "),t=t.replace(/https?:\/\/\S+/gu," "),t=t.replace(/\b[\w.-]+\.(?:com|net|org|io|dev|app)(?:\/\S*)?/giu," "),t=t.replace(/\{[^{}]{0,160}\}/gu," "),t=t.replace(/`[^`]{0,64}`/gu,r=>{const i=r.slice(1,-1);return M(n).some(a=>ae(i,a)>=0)||/^[A-Za-z][\w.-]{0,24}$/u.test(i)?i:" "}),t=t.replace(/\s{2,}/g," ").trim(),t=t.replace(/^[\s,;:.\-–—|/]+/u,"").trim(),t.includes("{")||t.includes("[")){const r=t.search(/[\[{]/u);if(r>18){const i=t.slice(0,r).trim().replace(/[-–—,:;]+$/u,"").trim();i&&(t=i)}}const s=M(n),o=200;if(s.length>0&&t.length>o){let r=-1;for(const i of s){const a=ae(t,i);a>=0&&(r<0||a<r)&&(r=a)}if(r<0)for(const i of s){if(i.length<4)continue;const a=t.toLowerCase().indexOf(i.toLowerCase());a>=0&&(r<0||a<r)&&(r=a)}if(r>=0){const a=Math.max(0,r-48),u=Math.min(t.length,a+o),d=t.slice(a,u).trim();t=`${a>0?"…":""}${d}${u<t.length?"…":""}`}else t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`}else t.length>o&&(t=`${t.slice(0,o-1).replace(/\s+\S*$/u,"").trimEnd()}…`);return t.replace(/\s{2,}/g," ").trim()}function go(e,n,t){const s=Ie(e.snippet,n);return s.length<=t?s:`${s.slice(0,t-1).replace(/\s+\S*$/u,"").trimEnd()}…`}function Qt(e,n){return M(n).filter(t=>{const s=t.toLowerCase();return e.title.toLowerCase().includes(s)||e.snippet.toLowerCase().includes(s)||Ie(e.snippet,n).toLowerCase().includes(s)})}function $n(e){const n=(e.kind||e.role||e.type||"record").toLowerCase();return n==="assistant_turn"||n==="assistant"?"assistant":n==="user_turn"||n==="user"?"user":n==="system_record"||n==="system"?"system":n==="command_or_tool"||n==="tool_use"?"tool":n==="response_item"?"tool output":n==="agent_reasoning"||n==="reasoning"?"reasoning":n.replace(/_/gu," ")}function Rn(e){const n=(e.kind||e.role||e.type||"").toLowerCase();return n==="assistant"||n==="assistant_turn"||n==="user"||n==="user_turn"||n==="last-prompt"||n==="ai-title"?0:n==="system"||n==="system_record"||n.includes("reasoning")?1:2}function ho(e){return e.scoreSource==="hybrid"?"Words and meaning":e.scoreSource==="vector"?"Similar in meaning":"Exact words"}function wo(e,n,t){const s=Qt(e,n),o=s.length===1?`Matched “${s[0]}”`:s.length>1?`Matched ${s.length} terms`:"Matched in this session";if(!t?.matched)return o;const r=[t.renderedText,t.summary].filter(Boolean).join(" ").toLowerCase(),i=s.filter(d=>r.includes(d.toLowerCase()));if(i.length===0)return o;const a=$n(t),u=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 ${u}`:`Matched ${i.length} terms in ${u}`}function Io(e){const n=F(e);if(n){const s=re(n.path),o=n.recordRange;return o?`${s}#R${o[0]}-R${o[1]}`:s}const t=Ln(e);if(t){const s=re(t.path),o=t.lineRange;return o?`${s}#L${o[0]}-L${o[1]}`:s}return e.id}function Xt(e){const n=e.filter(o=>Rn(o)===2).length,t=e.length-n,s=e.some(o=>o.matched)?" · match inside":"";return n>0&&t===0?`${n} tool step${n===1?"":"s"}${s}`:n===0?`${t} process step${t===1?"":"s"}${s}`:`${n} tool + ${t} process step${e.length===1?"":"s"}${s}`}function Zt(e){return`${e.length} more conversation turn${e.length===1?"":"s"}`}function vo(e,n={}){if(e.length===0)return[];const t=n.contextRadius??3,s=n.maxTurns??6,o=n.centerRecordIndex===void 0?-1:e.findIndex(w=>w.index===n.centerRecordIndex),r=e.findIndex(w=>w.matched),i=o>=0?o:r>=0?r:0,a=e.slice(Math.max(0,i-t),Math.min(e.length,i+t+1)),u=[];let d=[],f=[],S=0;const A=()=>{d.length!==0&&(u.push({kind:"folded",records:d,summary:Xt(d)}),d=[])},g=()=>{f.length!==0&&(u.push({kind:"folded",records:f,summary:Zt(f)}),f=[])};for(const w of a){if(Rn(w)>0){g(),d.push(w);continue}if(A(),S>=s){f.push(w);continue}u.push({kind:"turn",record:w,role:$n(w)}),S+=1}return A(),g(),u}function Fe(e){const n=F(e)?.recordRange;return n?n[0]:Number.MAX_SAFE_INTEGER}function So(e){const n=[],t=new Map;for(const s of e){const o=s.collectionId||s.id,r=t.get(o);r?r.push(s):(n.push(o),t.set(o,[s]))}return n.map(s=>{const o=[...t.get(s)??[]].sort((i,a)=>{const u=Fe(i)-Fe(a);return u!==0?u:i.score-a.score}),r=t.get(s)?.[0]??o[0];return{collectionId:s,best:r,moments:o}})}function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bo(e,n){const t=M(n);if(t.length===0||e.length===0)return[{text:e,match:!1}];const s=t.map(a=>`(?<![A-Za-z0-9_./~-])${Pn(a)}(?![A-Za-z0-9_./~-])`),o=new RegExp(`(${s.join("|")})`,"giu"),r=[];let i=0;for(const a of e.matchAll(o)){const u=a.index??0;u>i&&r.push({text:e.slice(i,u),match:!1}),r.push({text:a[0],match:!0}),i=u+a[0].length}return i<e.length&&r.push({text:e.slice(i),match:!1}),r.length>0?r:[{text:e,match:!1}]}const Lo={sessions:"Sessions",skills:"Skills",mcp:"MCP",codebase:"Codebase",context_pack:"Context packs",mixed:"Mixed"},Cn=[{value:"1",label:"Last 24h"},{value:"3",label:"Last 3 days"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],yo=["sessions","skills","mcp","codebase","context_pack"];function Eo(){return{query:"",sourceKinds:[],harness:[],project:[],timeWindow:"all"}}function Jt(e){return e?Cn.some(n=>n.value===e):!1}function X(e){return e?e.split(",").map(n=>n.trim()).filter(n=>n.length>0):[]}function es(e){const n=e==null?new URLSearchParams:typeof e=="string"?new URLSearchParams(e):e,t=n.get("time"),s=Jt(t)?t:"all";return{query:n.get("q")?.trim()??"",sourceKinds:X(n.get("source")),harness:X(n.get("harness")),project:X(n.get("project")),timeWindow:s}}function ns(e,n={}){const t=new URLSearchParams,s=e.query.trim();return s&&t.set("q",s),e.sourceKinds.length>0&&t.set("source",e.sourceKinds.join(",")),e.harness.length>0&&t.set("harness",e.harness.join(",")),e.project.length>0&&t.set("project",e.project.join(",")),e.timeWindow!=="all"&&t.set("time",e.timeWindow),n.hitId&&t.set("hit",n.hitId),t}function $o(e,n){return e.query.trim()===n.query.trim()&&e.timeWindow===n.timeWindow&&Z(e.sourceKinds,n.sourceKinds)&&Z(e.harness,n.harness)&&Z(e.project,n.project)}function Z(e,n){if(e.length!==n.length)return!1;const t=[...e].map(o=>o.trim().toLowerCase()).sort(),s=[...n].map(o=>o.trim().toLowerCase()).sort();return t.every((o,r)=>o===s[r])}function ts(e){return e.query.trim().length>0||e.sourceKinds.length>0||e.harness.length>0||e.project.length>0||e.timeWindow!=="all"}function Ro(e){if(e==="all")return null;const n=Number.parseInt(e,10);return!Number.isFinite(n)||n<=0?null:Date.now()-n*24*60*60*1e3}function Po(e){return e==="all"?"Any time":Cn.find(t=>t.value===e)?.label??e}const An=typeof window<"u"?window.location.href:"http://scout.local/";function ss(e){const n=e.toString();return new URL(n,An)}function os(e){switch(e){case"profile":case"config":case"definitions":return e==="definitions"?"config":e;case"observe":case"message":return e;default:return}}function rs(e){const n=e.trim().replace(/^#/,"");if(!n.startsWith("msg-"))return null;const t=n.slice(4).trim();if(!t)return null;try{return decodeURIComponent(t)}catch{return t}}function as(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 is(e){return e==="delivered"||e==="failed"||e==="all"?e:void 0}function cs(e){return e==="indexer"||e==="knowledge"?e:void 0}function us(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 ls(e){switch(e){case"tail":case"session":case"chat":case"work":return e;default:return}}function ds(e){const n=e?.trim().replace(/\.+$/u,"");return n==="observe"||n==="takeover"?n:void 0}function fs(e){const n=e?.trim().toLowerCase();return n==="pty"||n==="tmux"||n==="zellij"||n==="herdr"?n:void 0}function ms(e){const n=e?.trim().toLowerCase();return n==="shell"||n==="claude"||n==="codex"||n==="pi"?n:void 0}function ps(e){return e==="all"||e==="touched"?"all":e==="changed"?"changed":void 0}function Te(e){if(!e)return;const n=Number.parseInt(e,10);return Number.isSafeInteger(n)&&n>0?n:void 0}function Oe(e){return e==="mission"?"control":e}function gs(e){return e.searchParams.has("no-ops")?!1:typeof window>"u"?!0:rn()}function hs(e){return e==="tail"}function ws(e){return e==="lanes"}function _n(e){return hs(e)||ws(e)}const ve="machineId",Un=new Set(["inbox","conversation","agents-v2","messages","sessions","repos","harnesses","mesh","mesh-ops","activity","work","follow"]);function Is(e){return e.searchParams.get(ve)?.trim()||void 0}function vs(e,n){return!n||!Un.has(e.view)?e:{...e,machineId:n}}function Se(e){return Un.has(e.view)}function Ss(e){return"machineId"in e&&e.machineId?e.machineId:null}function xe(e,n){if(!Se(e))return e;const t={...e},s=n?.trim();return s?t.machineId=s:delete t.machineId,t}function Co(e){return Se(e)?{...e,machineId:""}:e}function bs(e,n){return Se(e)?"machineId"in e?xe(e,e.machineId??null):xe(e,Ss(n)):e}function k(e,n){"machineId"in n&&n.machineId&&e.set(ve,n.machineId)}function v(e){const n=e.toString();return n?`?${n}`:""}function O(e,n){const t=new URLSearchParams;return k(t,n),`${e}${v(t)}`}function Ls(e){return"machineId"in e&&e.machineId?`:machine:${e.machineId}`:""}function kn(e){const n=ss(e),t=n.pathname.replace(/^\/+/,"").split("/").filter(Boolean),s=Is(n),o=c=>vs(c,s),r=xt(t,n,o);if(r)return r;const i=rs(n.hash),a=os(n.searchParams.get("tab"))??(i?"message":void 0),u=n.searchParams.get("project")?.trim()||void 0,d=n.searchParams.get("agentId")?.trim()||void 0;if(t[0]==="agent"&&t[1])return{view:"agent-info",conversationId:decodeURIComponent(t[1])};const f=n.searchParams.get("project")?.trim()||void 0,S=n.searchParams.get("harness")?.trim()||void 0,A=n.searchParams.get("node")?.trim()||void 0,g=n.searchParams.get("set")?.trim(),w=g==="live"||g==="ephemeral"||g==="archived"?g:void 0,R=n.searchParams.get("view")?.trim(),U=R==="sessions"||R==="agents"?R:void 0,_=n.searchParams.get("state")?.trim(),be=_==="needs"||_==="live"||_==="idle"?_:void 0,jn=n.searchParams.get("ephemeral")==="1",W=n.searchParams.get("session")?.trim()||void 0,y=n.searchParams.get("select")?.trim()||void 0,$={...S?{harness:S}:{},...A?{node:A}:{},...w?{set:w}:{},...U?{indexView:U}:{},...be?{stateFilter:be}:{},...jn?{showEphemeral:!0}:{}};if(t[0]==="projects"){const c=t[1]?decodeURIComponent(t[1]):void 0;if(!c)return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...$});if(t[2]==="agents"){const l=t[3]?decodeURIComponent(t[3]):void 0;if(l){if(t[4]==="c"&&t[5])return o({view:"agents-v2",projectSlug:c,agentId:l,conversationId:decodeURIComponent(t[5]),tab:a??"message",...$});const m=t[4]==="sessions"&&t[5]?decodeURIComponent(t[5]):W;return o({view:"agents-v2",projectSlug:c,agentId:l,...m?{sessionId:m}:{},...a?{tab:a}:{},...$})}return o({view:"agents-v2",projectSlug:c,indexView:"agents",...y?{selectedAgentId:y}:{},...$})}return t[2]==="sessions"?o({view:"agents-v2",projectSlug:c,indexView:"sessions",...t[3]?{sessionId:decodeURIComponent(t[3])}:{},...y?{selectedAgentId:y}:{},...$}):o({view:"agents-v2",projectSlug:c,...y?{selectedAgentId:y}:{},...$})}if(t[0]==="agents-v2"&&t[1]==="sessions"&&t[2])return o({view:"agents-v2",sessionId:decodeURIComponent(t[2]),...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(t[0]==="agents-v2"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...W?{sessionId:W}:{},...f?{projectSlug:f}:{},...$})}if(t[0]==="agents-v2")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(t[0]==="agents"&&t[1]){const c=decodeURIComponent(t[1]),l=t[2]==="sessions"&&t[3]?decodeURIComponent(t[3]):W;return t[2]==="c"&&t[3]?o({view:"agents-v2",agentId:c,conversationId:decodeURIComponent(t[3]),tab:a??"message",...$}):o({view:"agents-v2",agentId:c,...l?{sessionId:l}:{},...a?{tab:a}:{},...$})}if(t[0]==="agents")return o({view:"agents-v2",...y?{selectedAgentId:y}:{},...f?{projectSlug:f}:{},...$});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="sessions"&&t[3])return o({view:"sessions",agentId:decodeURIComponent(t[1]),sessionId:decodeURIComponent(t[3])});if(t[0]==="agents.deprecated"&&t[1]&&t[2]==="c"&&t[3])return o({view:"agents-v2",agentId:decodeURIComponent(t[1]),conversationId:decodeURIComponent(t[3]),tab:a??"message"});if(t[0]==="agents.deprecated"&&t[1]){const c=decodeURIComponent(t[1]);return o({view:"agents-v2",agentId:c,...a?{tab:a}:{},...!a&&u?{projectSlug:u}:{}})}if(t[0]==="agents.deprecated")return o({view:"agents-v2",...u?{projectSlug:u}:{}});if(t[0]==="fleet")return o({view:"inbox"});if(t[0]==="c"&&t[1])return o({view:"conversation",conversationId:decodeURIComponent(t[1])});if(t[0]==="flights"&&t[1]&&t[2]==="observe"){const c=n.searchParams.get("session")?.trim()||void 0,l=n.searchParams.get("compare")?.trim()||void 0;return o({view:"sessions",flightId:decodeURIComponent(t[1]),...c?{sessionId:c}:{},...l?{compareSessionId:l}:{}})}if(t[0]==="sessions"&&t[1])return o({view:"sessions",sessionId:decodeURIComponent(t[1]),...d?{agentId:d}:{}});if(t[0]==="conversations")return o({view:"messages"});if(t[0]==="messages"){const c={view:"messages",...t[1]?{conversationId:decodeURIComponent(t[1])}:{}};return o(c)}if(t[0]==="sessions")return o({view:"sessions",...d?{agentId:d}:{}});if(t[0]==="repos"){const c=n.searchParams.get("root")?.trim()||void 0;return o({view:"repos",...c?{root:c}:{}})}if(t[0]==="providers"||t[0]==="harnesses")return o({view:"harnesses"});if(t[0]==="repo-diff"){const c=n.searchParams.get("path")?.trim();if(c){const l=n.searchParams.getAll("layer").filter(I=>I==="unstaged"||I==="staged"||I==="branch"),m=n.searchParams.getAll("file").map(I=>I.trim()).filter(Boolean),p=n.searchParams.get("sessionId")?.trim()||void 0,b=n.searchParams.get("agentId")?.trim()||void 0,E=ps(n.searchParams.get("include"));return{view:"repo-diff",path:c,...l.length>0?{layers:l}:{},...m.length>0?{files:m}:{},...p?{sessionId:p}:{},...b?{agentId:b}:{},...E?{include:E}:{}}}}if(t[0]==="search"){const c=cs(t[1]),l=n.searchParams.get("hit")?.trim()||void 0,m=es(n.searchParams);return{view:"search",...c&&c!=="knowledge"?{mode:c}:{},...l?{hitId:l}:{},...ts(m)?{filters:m}:{}}}if(t[0]==="channels"&&t[1])return o({view:"messages",conversationId:decodeURIComponent(t[1])});if(t[0]==="channels")return o({view:"messages"});if(t[0]==="mesh")return o({view:"mesh"});if(t[0]==="mesh-ops")return o({view:"mesh-ops",...t[1]?{itemId:decodeURIComponent(t[1])}:{}});if(t[0]==="dispatch"||t[0]==="broker"){const c=n.searchParams.get("attempt")?.trim()||void 0,l=is(n.searchParams.get("filter"));return{view:"broker",...c?{attemptId:c}:{},...l&&l!=="all"?{filter:l}:{}}}if(t[0]==="code"){const c=n.searchParams.get("wt")?.trim()||void 0,l=n.searchParams.get("fromConversation")?.trim()||void 0,m=Te(n.searchParams.get("line")),p=Te(n.searchParams.get("endLine")),b=m&&p&&p>=m?p:void 0;if(t[1]){const C=decodeURIComponent(t[1]),P=t.length>2?t.slice(2).map(decodeURIComponent).join("/"):void 0;return{view:"code",project:C,...P?{path:P}:{},...c?{wt:c}:{},...m?{line:m}:{},...b?{endLine:b}:{},...l?{returnConversationId:l}:{}}}const E=n.searchParams.get("root")?.trim()||void 0,I=n.searchParams.get("file")?.trim()||void 0;return{view:"code",...E?{root:E}:{},...I?{file:I}:{},...c?{wt:c}:{},...m?{line:m}:{},...b?{endLine:b}:{},...l?{returnConversationId:l}:{}}}if(t[0]==="briefings"&&t[1])return{view:"briefings",briefingId:decodeURIComponent(t[1])};if(t[0]==="briefings")return{view:"briefings"};if(t[0]==="activity")return o({view:"activity"});if(t[0]==="voice")return{view:"voice"};if(t[0]==="work"&&t[1])return o({view:"work",workId:decodeURIComponent(t[1])});if(t[0]==="follow"){const c=ls(n.searchParams.get("view")),l={view:"follow",...c?{preferredView:c}:{}},m=t[1],p=t[2]?decodeURIComponent(t[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 b=n.searchParams.get("flightId"),E=n.searchParams.get("invocationId"),I=n.searchParams.get("conversationId"),C=n.searchParams.get("workId"),P=n.searchParams.get("sessionId"),Le=n.searchParams.get("targetAgentId");return b&&(l.flightId=b),E&&(l.invocationId=E),I&&(l.conversationId=I),C&&(l.workId=C),P&&(l.sessionId=P),Le&&(l.targetAgentId=Le),o(l)}if(t[0]==="settings"){if(t[1]==="agents")return{view:"settings",section:"agents",...t[2]?{agentId:decodeURIComponent(t[2])}:{}};const c=us(t[1]);return{view:"settings",...c?{section:c}:{}}}if(t[0]==="terminal"){const c=ds(n.searchParams.get("mode")),l=n.searchParams.get("session")?.trim()||void 0,m=Hn(n.searchParams.get("surface"))??void 0;if(t[1]==="new"){const b=fs(n.searchParams.get("backend"))??"pty",E=ms(n.searchParams.get("agent"))??"shell",I=n.searchParams.get("name")?.trim()||void 0,C=n.searchParams.get("tab")?.trim()||void 0,P=n.searchParams.get("socketDir")?.trim()||void 0;return{view:"terminal",terminalBackend:b,terminalAgent:E,...I?{terminalSessionName:I}:{},...C?{terminalTabId:C}:{},...P?{zellijSocketDir:P}:{}}}const p=t[1]==="s"&&t[2]?Be(decodeURIComponent(t.slice(2).join("/")))?decodeURIComponent(t.slice(2).join("/")):null:Vn(t[1]?decodeURIComponent(t[1]):void 0,t[2]?decodeURIComponent(t.slice(2).join("/")):void 0);return p?{view:"terminal",terminalSurfaceKey:p,...l?{terminalSessionId:l}:{},...c?{mode:c}:{}}:{view:"terminal",...t[1]?{agentId:decodeURIComponent(t[1])}:{},...c?{mode:c}:{},...!t[1]&&l?{terminalSessionId:l}:{},...!t[1]&&m?{terminalSurfaceKey:m}:{}}}if(t[0]==="ops"){const c=as(t[1])??"mission";if(!_n(c)&&!gs(n))return o({view:"inbox"});const l=c==="tail"?n.searchParams.get("q")?.trim():"",m=c==="plan"?n.searchParams.get("plan")?.trim():"",p=n.searchParams.get("flightId")?.trim(),b=n.searchParams.get("invocationId")?.trim(),E=n.searchParams.get("conversationId")?.trim(),I=n.searchParams.get("workId")?.trim(),C=n.searchParams.get("sessionId")?.trim(),P=n.searchParams.get("targetAgentId")?.trim()??n.searchParams.get("agentId")?.trim();return{view:"ops",mode:c,...l?{tailQuery:l}:{},...m?{planDocumentId:m}:{},...p?{flightId:p}:{},...b?{invocationId:b}:{},...E?{conversationId:E}:{},...I?{workId:I}:{},...C?{sessionId:C}:{},...P?{targetAgentId:P}:{}}}return o({view:"inbox"})}function Fn(e,n){const t=e.view==="sessions"&&e.flightId?null:bn(e,n);if(t)return t;switch(e.view){case"inbox":return O("/",e);case"conversation":{const s=new URLSearchParams;return k(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),k(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 k(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),k(s,e),`/flights/${encodeURIComponent(e.flightId)}/observe${v(s)}`):(k(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),k(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?ns(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=Yn(e.terminalSurfaceKey);return o?`/terminal/${encodeURIComponent(o.backend)}/${encodeURIComponent(o.sessionName)}${v(s)}`:Be(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 n=Ls(e);switch(e.view){case"conversation":return`conv:${e.conversationId}${n}`;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??"",n].join(":");case"sessions":return e.flightId?`flight-observe:${e.flightId}:${e.sessionId??""}:${e.compareSessionId??""}${n}`:e.sessionId?`session:${e.agentId??""}:${e.sessionId}${n}`:`sessions${n}`;case"messages":return e.conversationId?`messages:${e.conversationId}${n}`:`messages${n}`;case"work":return`work:${e.workId}${n}`;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??""}${n}`;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}${n}`}}function G(e,n){return ue(kn(`${e}${n}`))}function Tn(e){return e?`#${e}`:""}function ys(e){return e.startsWith("/embed/")||e==="/ops/lanes/embed"}function De(){if(typeof window>"u"){const e=new URL(An);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 Es(e,n){return e.pathname===n.pathname&&e.searchStr===n.searchStr&&e.hash===n.hash&&Object.is(e.state,n.state)}function $s(e){let n=e.read();const t=new Set;let s=null;const o=()=>{const r=e.read();if(!Es(n,r)){n=r;for(const i of t)i()}};return{getSnapshot:()=>n,subscribe(r){return s||(s=e.observe(o)),t.add(r),()=>{t.delete(r)}},navigateTo(r,i={}){const a=i.state===void 0?n.state:i.state;i.replace?e.replace(r,a):e.push(r,a),o()}}}function Rs(){return typeof window>"u"?{read:De,push:()=>{},replace:()=>{},observe:()=>()=>{}}:{read:De,push:(e,n)=>window.history.pushState(n,"",e),replace:(e,n)=>window.history.replaceState(n,"",e),observe:e=>(window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)})}}const D=$s(Rs());function Ps(){return L.useSyncExternalStore(D.subscribe,D.getSnapshot,D.getSnapshot)}function ie(e,n={}){D.navigateTo(e,n)}function On(){return typeof window>"u"?null:window.navigation??null}function xn(){if(typeof window>"u")return!1;const e=On();return e?e.canGoBack:window.history.length>1}function Cs(){if(!xn())return;const e=On();if(e){e.back();return}window.history.back()}function Ao(e){if(!e||typeof e!="object")return null;const n=e.returnTo;return!n||typeof n!="object"||typeof n.view!="string"?null:n}function _o(e){return!e||typeof e!="object"?!1:e.returnUseHistory===!0}function je(e){if(!e||typeof e!="object")return e;const{returnTo:n,returnUseHistory:t,settingsEntry:s,...o}=e;return o}function As(e,n){if(n.returnTo!==void 0){const t=n.state!==void 0?n.state:je(e),s=t&&typeof t=="object"?{...t}:{};return s.returnTo=n.returnTo,s.returnUseHistory=n.replace!==!0,s}return n.state!==void 0?n.state:n.replace?e:je(e)}function Dn(e){return e?e.replace(/^#/,""):""}function _s(e,n,t={}){const s=G(e.pathname,e.searchStr),o=bs(n,s),r=t.preserveSearch===!1?"":e.searchStr,i=Sn(Fn(o,e.pathname),r),a=Dn(t.hash);return{route:o,href:`${i}${a?`#${a}`:""}`}}function Us(e,n){const t=new URLSearchParams(e.searchStr);for(const[r,i]of Object.entries(n.searchPatch??{}))i===null?t.delete(r):t.set(r,i);const s=t.toString(),o=n.hash===void 0?e.hash:Dn(n.hash);return`${e.pathname}${s?`?${s}`:""}${o?`#${o}`:""}`}function Uo(e){const n=D.getSnapshot(),t=Us(n,e),s=`${n.pathname}${n.searchStr}${Tn(n.hash)}`;t!==s&&ie(t,{replace:e.replace??!0,state:e.state})}function ks(e,n,t){if(ys(e))return null;const s=`${e}${n}`,o=kn(s),r=ue(o),i=Sn(Fn(r,e),n);return!(N(o)!==N(r)||r.view==="agents-v2"||s!==i)||s===i?null:`${i}${Tn(t)}`}function ko(){const{pathname:e,searchStr:n,hash:t}=Ps(),s=`${e}${n}`,o=L.useMemo(()=>G(e,n),[e,n]),r=L.useRef({}),i=L.useRef(s);L.useEffect(()=>{const f=ks(e,n,t);f&&ie(f,{replace:!0})},[e,n,t]),L.useEffect(()=>{if(i.current===s)return;const f=G(e,n);requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(f)]??0)}),i.current=s},[s,e,n]);const a=L.useCallback((f,S={})=>{const A=ue(f.view==="ops"&&!rn()&&!_n(f.mode)?{view:"inbox"}:f),g=G(e,n),{route:w,href:R}=_s({pathname:e,searchStr:n},A,S);r.current[N(g)]=window.scrollY;const U=D.getSnapshot().state,_=As(U,S);ie(R,{replace:S.replace,state:_}),requestAnimationFrame(()=>{window.scrollTo(0,r.current[N(w)]??0)})},[e,n]),u=L.useCallback(()=>Cs(),[]),d=xn();return{route:o,navigate:a,navigateBack:u,canNavigateBack:d}}export{Zs as $,ge as A,F as B,fo as C,go as D,po as E,Ro as F,bo as G,Po as H,xs as I,dt as J,uo as K,lt as L,ft as M,mt as N,zs as O,Uo as P,ro as Q,vn as R,yo as S,In as T,io as U,Ys as V,Gs as W,qs as X,At as Y,Vs as Z,Rt as _,Fn as a,_t as a0,eo as a1,no as a2,Js as a3,to as a4,Qs as a5,Xs as a6,Hs as a7,cn as a8,an as a9,vo as aA,re as aB,wo as aC,ho as aD,$n as aE,Se as aa,so as ab,oo as ac,V as ad,te as ae,Ns as af,oe as ag,Q as ah,Ot as ai,Mt as aj,xt as ak,Sn as al,Bt as am,ct as an,ao,bn as ap,Ye as aq,co as ar,ko as as,Ve as at,Zn as au,Ln as av,z as aw,lo as ax,Io as ay,Rn as az,Ss as b,Co as c,Ds as d,en as e,Bs as f,le as g,Ms as h,Ws as i,Ks as j,Ps as k,Ao as l,_o as m,Eo as n,So as o,es as p,ts as q,kn as r,xe as s,$o as t,js as u,Lo as v,ht as w,Cn as x,mo as y,Kt as z};
@@ -1 +0,0 @@
1
- .s-dictation-mic{width:34px;height:34px;border-radius:50%;border:1px solid var(--border);background:transparent;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:flex-end;cursor:pointer;transition:color .12s ease,border-color .12s ease,background .12s ease}.s-dictation-mic:not(:disabled):hover{color:var(--ink);border-color:color-mix(in srgb,var(--ink) 35%,var(--border))}.s-dictation-mic:disabled{opacity:.4;cursor:not-allowed}.s-dictation-mic--needs-permission{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 50%,var(--border))}.s-dictation-mic--needs-permission:not(:disabled):hover{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 70%,var(--border));background:color-mix(in srgb,var(--accent) 10%,transparent)}.s-dictation-mic--unavailable{color:var(--amber);border-color:color-mix(in srgb,var(--amber) 45%,var(--border))}.s-dictation-mic--unavailable:not(:disabled):hover{color:var(--amber);border-color:color-mix(in srgb,var(--amber) 65%,var(--border));background:color-mix(in srgb,var(--amber) 8%,transparent)}.s-dictation-mic--error{color:var(--red, #ef4444);border-color:color-mix(in srgb,var(--red, #ef4444) 45%,var(--border))}.s-dictation-mic--recording{color:var(--green);border-color:color-mix(in srgb,var(--green) 55%,var(--border));background:color-mix(in srgb,var(--green) 10%,transparent)}.s-dictation-mic--recording:not(:disabled):hover{border-color:color-mix(in srgb,var(--green) 75%,var(--border))}.s-dictation-mic--busy{color:var(--muted)}.s-dictation-mic-spin{animation:s-dictation-mic-spin 1s linear infinite}@keyframes s-dictation-mic-spin{to{transform:rotate(360deg)}}.s-msg-compose{box-sizing:border-box;width:100%;min-width:0;flex-shrink:0}.s-msg-compose--panel{padding:0}.s-msg-compose--thread{padding:var(--space-md) var(--space-3xl) var(--space-2xl);border-top:1px solid color-mix(in srgb,var(--border) 40%,transparent);background:transparent;margin-top:auto}.s-msg-compose--compact{padding:var(--space-sm)}.s-msg-compose--bare{padding:0}.s-msg-compose-frame{position:relative;width:100%;min-width:0}.s-msg-compose-shell{position:relative;box-sizing:border-box;width:100%;max-width:100%;min-width:0;border:1px solid color-mix(in srgb,var(--border) 60%,var(--surface));border-radius:var(--radius-xl);background:var(--surface);transition:border-color .15s ease;overflow:hidden;display:flex;flex-direction:column}.s-msg-compose-shell:focus-within{border-color:color-mix(in srgb,var(--border) 100%,transparent)}.s-msg-compose-header{flex-shrink:0;padding:var(--space-sm) var(--space-md);border-bottom:1px solid color-mix(in srgb,var(--border) 40%,transparent);background:color-mix(in srgb,var(--bg) 40%,var(--surface));min-width:0}.s-msg-compose-body{flex:1;min-width:0;display:flex;flex-direction:column;padding:var(--space-sm) var(--space-md) var(--space-xs)}.s-msg-compose-body>*:first-child{min-width:0;width:100%}.s-msg-compose-input{display:block;width:100%;min-width:0;min-height:44px;max-height:160px;border:none;border-radius:0;background:transparent;padding:0;font-size:var(--text-lg);font-family:var(--font-sans);line-height:var(--leading-normal);color:var(--ink);resize:none;outline:none;cursor:text;user-select:text;-webkit-user-select:text}.s-msg-compose-input::placeholder{color:var(--dim)}.s-msg-compose-shell .s-msg-compose-input:focus,.s-msg-compose-shell .s-msg-compose-input:focus-visible{box-shadow:none}.s-msg-compose-input:disabled{opacity:.55;cursor:not-allowed}.s-msg-compose-suggest{position:absolute;left:0;right:0;bottom:calc(100% + 6px);max-height:260px;overflow-y:auto;padding:var(--space-2xs);background:var(--surface);border:1px solid color-mix(in srgb,var(--border) 80%,transparent);border-radius:var(--radius-xl);box-shadow:0 12px 32px color-mix(in srgb,var(--ink) 22%,transparent);z-index:20}.s-msg-compose-suggest[data-placement=inside]{top:40px;right:var(--space-sm);bottom:52px;left:var(--space-sm);max-height:none;border-radius:var(--radius-lg);box-shadow:0 14px 28px -18px color-mix(in srgb,var(--ink) 48%,transparent)}.s-msg-compose-suggest-label{padding:var(--space-xs) var(--space-md) var(--space-2xs);font-family:var(--font-mono);font-size:var(--text-2xs);font-weight:600;letter-spacing:var(--tracking-lg);text-transform:uppercase;color:var(--dim)}.s-msg-compose-suggest-item{display:flex;align-items:center;gap:var(--space-md);width:100%;padding:var(--space-xs) var(--space-md);border:none;border-radius:var(--radius-lg);background:transparent;color:var(--ink);text-align:left;cursor:pointer;font-family:inherit}.s-msg-compose-suggest-item:hover,.s-msg-compose-suggest-item--active{background:color-mix(in srgb,var(--accent) 8%,transparent)}.s-msg-compose-suggest-token{font-family:var(--font-mono);font-size:var(--text-md);color:var(--ink)}.s-msg-compose-suggest-desc{flex:1;min-width:0;font-size:var(--text-sm);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-msg-compose-suggest-avatar{flex-shrink:0}.s-msg-compose-voice{display:flex;flex-direction:column;gap:var(--space-2xs);margin-top:var(--space-sm);min-width:0;color:var(--dim)}.s-msg-compose-voice--recording{color:var(--green)}.s-msg-compose-voice--processing{color:var(--muted)}.s-msg-compose-voice--error{color:var(--red, #ef4444)}.s-msg-compose-voice-meta{display:flex;align-items:baseline;gap:var(--space-sm);min-width:0;font-size:var(--text-xs);line-height:var(--leading-snug)}.s-msg-compose-voice-label{flex-shrink:0;font-family:var(--font-mono);font-size:var(--text-2xs);font-weight:600;letter-spacing:.08em;text-transform:uppercase}.s-msg-compose-voice-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-msg-compose-wave{display:flex;align-items:center;justify-content:space-between;gap:2px;width:100%;height:28px;padding:2px 0;pointer-events:none}.s-msg-compose-wave-bar{flex:1 1 0;min-width:1.5px;max-width:3px;height:100%;border-radius:999px;background:currentColor;opacity:.28;transform-origin:center;transform:scaleY(.12);transition:transform 40ms linear,opacity 80ms ease;will-change:transform}@media(prefers-reduced-motion:reduce){.s-msg-compose-wave-bar{transition:none}}.s-msg-compose-toolbar{flex-shrink:0;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:var(--space-sm);min-width:0;padding:var(--space-xs) var(--space-sm) var(--space-sm);border-top:1px solid color-mix(in srgb,var(--border) 40%,transparent);background:color-mix(in srgb,var(--bg) 28%,var(--surface))}.s-msg-compose-toolbar-start{grid-column:1;display:flex;align-items:center;gap:var(--space-xs);min-width:0}.s-msg-compose-toolbar-spacer{display:block;width:0;height:0}.s-msg-compose-toolbar-end{grid-column:3;justify-self:end;display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:var(--space-xs);min-width:0;max-width:100%}.s-msg-compose-tools{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:var(--space-xs);min-width:0}.s-msg-compose-tools-hint{font-size:var(--text-xs);color:var(--dim);letter-spacing:.01em;white-space:nowrap}.s-msg-compose-tool{position:relative;display:inline-flex;align-items:center;gap:4px;max-width:min(200px,40vw);min-height:28px;padding:0 8px 0 10px;border-radius:var(--radius-pill);border:none;background:color-mix(in srgb,var(--ink) 7%,transparent);box-shadow:none;color:var(--ink);cursor:pointer;transition:background .12s ease,color .12s ease;-webkit-user-select:none;user-select:none}.s-msg-compose-tool:hover{background:color-mix(in srgb,var(--ink) 11%,transparent)}.s-msg-compose-tool:focus-within{background:color-mix(in srgb,var(--ink) 12%,transparent);outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--ink) 14%,transparent)}.s-msg-compose-tool--disabled{opacity:.45;cursor:not-allowed;box-shadow:none}.s-msg-compose-tool-kicker{display:none}.s-msg-compose-tool-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--font-mono);font-size:var(--text-sm);font-weight:500;letter-spacing:.01em;color:var(--muted);line-height:1}.s-msg-compose-tool:hover .s-msg-compose-tool-value,.s-msg-compose-tool:focus-within .s-msg-compose-tool-value{color:var(--ink)}.s-msg-compose-tool-chevron{flex-shrink:0;color:var(--dim);opacity:.75;transition:color .12s ease,opacity .12s ease}.s-msg-compose-tool:hover .s-msg-compose-tool-chevron,.s-msg-compose-tool:focus-within .s-msg-compose-tool-chevron{color:var(--muted);opacity:1}.s-msg-compose-tool-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:inherit;border:none;background:transparent;font-size:var(--text-2xl);appearance:none}.s-msg-compose-tool--disabled .s-msg-compose-tool-native{cursor:not-allowed}.s-msg-compose-icon-btn{width:32px;height:32px;border-radius:50%;border:1px solid var(--border);background:transparent;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;transition:color .12s ease,border-color .12s ease,background .12s ease}.s-msg-compose-icon-btn:not(:disabled):hover{color:var(--ink);border-color:color-mix(in srgb,var(--ink) 35%,var(--border))}.s-msg-compose-icon-btn:disabled{opacity:.4;cursor:not-allowed}.s-msg-compose-send{width:32px;height:32px;border-radius:50%;border:none;background:var(--ink);color:var(--bg);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:opacity .12s ease,transform .12s ease}.s-msg-compose-send:not(:disabled):hover{transform:scale(1.05)}.s-msg-compose-send:disabled{opacity:.25;cursor:default}.s-msg-compose-send--agent-stop{background:var(--red, #ef4444)}.s-msg-compose-toolbar .s-dictation-mic{align-self:center;width:32px;height:32px}.s-msg-compose--compact .s-msg-compose-input{min-height:32px;font-size:var(--text-md)}.s-msg-compose--compact .s-msg-compose-body{padding:var(--space-xs) var(--space-sm)}.s-msg-compose--compact .s-msg-compose-send,.s-msg-compose--compact .s-msg-compose-icon-btn,.s-msg-compose--compact .s-msg-compose-toolbar .s-dictation-mic{width:28px;height:28px}.s-msg-compose--compact .s-msg-compose-toolbar{padding:var(--space-2xs) var(--space-xs) var(--space-xs)}.s-msg-compose-file-input{display:none}.s-msg-compose-attachments{display:flex;flex-wrap:wrap;gap:var(--space-2xs);padding-bottom:var(--space-2xs)}.s-msg-compose-attachment{position:relative;width:56px;height:56px;border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden;background:var(--surface-2)}.s-msg-compose-attachment img,.s-msg-compose-attachment video{width:100%;height:100%;object-fit:cover;display:block}.s-msg-compose-attachment-file{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;height:100%;padding:var(--space-2xs);color:var(--text-2)}.s-msg-compose-attachment-file span{font-size:var(--text-2xs);line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.s-msg-compose-attachment-remove{position:absolute;top:2px;right:2px;width:16px;height:16px;display:grid;place-items:center;border:none;border-radius:50%;background:color-mix(in srgb,var(--surface-0) 78%,transparent);color:var(--text-1);font-size:var(--text-md);line-height:1;cursor:pointer}.s-msg-compose-attachment-remove:hover{background:var(--surface-0)}.s-msg-compose-attach-note{font-size:var(--text-xs);color:var(--text-3);padding-bottom:var(--space-2xs)}.s-msg-compose-attach-note[data-tone=error]{color:var(--danger-fg, var(--text-1))}.s-msg-compose[data-drag-active=true],.s-msg-compose-shell[data-drag-active=true]{outline:1px dashed var(--scout-accent);outline-offset:-2px}.s-msg-compose-secondary{display:flex;align-items:center}.s-msg-compose-steer{height:28px;padding:0 var(--space-xs);border:1px solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--text-2);font-size:var(--text-xs);font-weight:500;cursor:pointer;white-space:nowrap}.s-msg-compose-steer:hover:not(:disabled){color:var(--text-1);border-color:var(--scout-accent)}.s-msg-compose-steer:disabled{opacity:.5;cursor:default}.s-thread-compose-queue-note{font-size:var(--text-xs);color:var(--text-3);padding-top:var(--space-2xs)}.s-msg-compose-above{box-sizing:border-box;width:100%;min-width:0;margin-bottom:var(--space-2xs)}.s-msg-compose-frame[data-above-attached=true] .s-msg-compose-above{margin-bottom:0}.s-msg-compose-frame[data-above-attached=true] .s-msg-compose-shell{border-top-left-radius:0;border-top-right-radius:0}.s-msg-compose-queue{box-sizing:border-box;display:flex;flex-direction:column;gap:2px;width:100%;min-width:0;padding:var(--space-2xs) var(--space-sm) var(--space-xs);border:1px solid color-mix(in srgb,var(--border) 45%,transparent);border-radius:var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-sm);background:color-mix(in srgb,var(--surface) 55%,transparent)}.s-msg-compose-frame[data-above-attached=true] .s-msg-compose-queue{padding-bottom:var(--space-2xs);border-color:color-mix(in srgb,var(--border) 60%,var(--surface));border-bottom:none;border-radius:var(--radius-xl) var(--radius-xl) 0 0;background:color-mix(in srgb,var(--bg) 40%,var(--surface))}.s-msg-compose-frame[data-above-attached=true]:focus-within .s-msg-compose-queue{border-color:color-mix(in srgb,var(--border) 100%,transparent)}.s-msg-compose-queue-head{display:flex;align-items:center;gap:var(--space-sm);min-width:0;padding-bottom:2px}.s-msg-compose-queue-kicker{flex-shrink:0;font-family:var(--font-mono);font-size:var(--text-2xs);font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--dim)}.s-msg-compose-queue-hint{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);color:var(--text-3)}.s-msg-compose-queue-head .s-msg-compose-steer{margin-left:auto;height:24px}.s-msg-compose-queue-row{display:flex;align-items:center;gap:var(--space-xs);min-width:0;min-height:24px;padding:2px var(--space-2xs) 2px 0;border-left:2px solid color-mix(in srgb,var(--scout-accent) 55%,transparent);padding-left:var(--space-xs);border-radius:0 var(--radius-sm) var(--radius-sm) 0;background:color-mix(in srgb,var(--ink) 4%,transparent)}.s-msg-compose-queue-index{flex-shrink:0;font-family:var(--font-mono);font-size:var(--text-2xs);color:var(--dim)}.s-msg-compose-queue-body{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);color:var(--text-2)}.s-msg-compose-queue-clip{flex-shrink:0;font-family:var(--font-mono);font-size:var(--text-2xs);color:var(--dim)}.s-msg-compose-queue-edit,.s-msg-compose-queue-now,.s-msg-compose-queue-drop{flex-shrink:0;border:none;background:transparent;color:var(--text-3);font-size:var(--text-xs);line-height:1;cursor:pointer;opacity:0;transition:opacity .12s ease,color .12s ease}.s-msg-compose-queue-drop{width:16px;height:16px;display:grid;place-items:center;border-radius:50%}.s-msg-compose-queue-row:hover .s-msg-compose-queue-edit,.s-msg-compose-queue-row:hover .s-msg-compose-queue-now,.s-msg-compose-queue-row:hover .s-msg-compose-queue-drop,.s-msg-compose-queue-edit:focus-visible,.s-msg-compose-queue-now:focus-visible,.s-msg-compose-queue-drop:focus-visible{opacity:1}.s-msg-compose-queue-edit:hover,.s-msg-compose-queue-now:hover,.s-msg-compose-queue-drop:hover{color:var(--text-1)}.s-msg-compose-queue-edit:disabled,.s-msg-compose-queue-now:disabled,.s-msg-compose-queue-drop:disabled{opacity:.4;cursor:default}.s-msg-compose-queue-row[data-editing=true]{border-left-color:var(--scout-accent);background:color-mix(in srgb,var(--scout-accent) 10%,transparent)}.s-msg-compose-carried{font-size:var(--text-xs);color:var(--text-3);padding-bottom:var(--space-2xs)}.s-msg-compose-mode{flex-shrink:0;display:flex;align-items:center;margin-left:auto;padding:1px;border:1px solid color-mix(in srgb,var(--border) 60%,transparent);border-radius:var(--radius-sm);background:color-mix(in srgb,var(--bg) 45%,transparent)}.s-msg-compose-mode-btn{height:20px;padding:0 var(--space-2xs);border:none;border-radius:calc(var(--radius-sm) - 1px);background:transparent;color:var(--text-3);font-size:var(--text-2xs);font-weight:500;letter-spacing:.02em;cursor:pointer;white-space:nowrap;transition:background .12s ease,color .12s ease}.s-msg-compose-mode-btn:hover:not(:disabled){color:var(--text-1)}.s-msg-compose-mode-btn[aria-pressed=true]{background:var(--surface);color:var(--text-1);box-shadow:0 1px 2px color-mix(in srgb,var(--ink) 12%,transparent)}.s-msg-compose-mode-btn[aria-pressed=true][data-mode=steer]{color:var(--scout-accent)}.s-msg-compose-mode-btn:disabled{opacity:.5;cursor:default}.s-rt-root,.s-rt-panel{--s-rt-accent: var(--hud-accent, oklch(.86 .17 125))}.s-rt-chip{position:relative;display:inline-flex;align-items:center;gap:5px;min-height:24px;max-width:min(280px,56vw);padding:0 6px 0 8px;border:none;border-radius:var(--radius-pill);background:color-mix(in srgb,var(--ink) 7%,transparent);color:var(--ink);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .12s ease,color .12s ease}.s-rt-chip:hover{background:color-mix(in srgb,var(--ink) 11%,transparent)}.s-rt-chip[aria-expanded=true]{background:color-mix(in srgb,var(--ink) 13%,transparent)}.s-rt-chip:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--s-rt-accent) 60%,transparent)}.s-rt-chip--disabled,.s-rt-chip:disabled{opacity:.45;cursor:not-allowed}.s-rt-chip-mark{flex-shrink:0;color:var(--muted);transition:color .12s ease}.s-rt-chip:hover .s-rt-chip-mark{color:var(--ink)}.s-rt-chip-type{display:inline-flex;align-items:baseline;gap:6px;min-width:0}.s-rt-chip-model{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left;font-family:var(--font-mono);font-size:var(--text-sm);font-weight:500;letter-spacing:.01em;color:var(--muted);line-height:1;transition:color .12s ease}.s-rt-chip:hover .s-rt-chip-model{color:var(--ink)}.s-rt-chip-model-text{display:inline-block;animation:s-rt-chip-swap .14s cubic-bezier(.16,.84,.44,1) both}@keyframes s-rt-chip-swap{0%{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}.s-rt-chip-divider{align-self:center;flex-shrink:0;width:1px;height:10px;background:color-mix(in srgb,var(--ink) 22%,transparent)}.s-rt-chip-effort{flex-shrink:0;font-family:var(--font-mono);font-size:var(--text-xs);font-weight:600;letter-spacing:0;line-height:1;color:var(--muted)}.s-rt-chip-effort[data-effort=none],.s-rt-chip-effort[data-effort=minimal],.s-rt-chip-effort[data-effort=low]{color:var(--dim)}.s-rt-chip-effort[data-effort=medium]{color:var(--muted)}.s-rt-chip-effort[data-effort=high]{color:var(--ink)}.s-rt-chip-effort[data-effort=xhigh],.s-rt-chip-effort[data-effort=max],.s-rt-chip-effort[data-effort=ultra]{color:var(--s-rt-accent)}.s-rt-chip-chevron{flex-shrink:0;color:var(--dim);opacity:.75;transition:transform .18s cubic-bezier(.16,.84,.44,1),opacity .12s ease}.s-rt-chip:hover .s-rt-chip-chevron{opacity:1}.s-rt-chip[aria-expanded=true] .s-rt-chip-chevron{transform:rotate(180deg)}.s-rt-panel{position:fixed;z-index:60;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-md, 6px);background:var(--surface);box-shadow:0 18px 40px -12px #00000073;transform-origin:bottom right;animation:s-rt-in .17s cubic-bezier(.16,.84,.44,1) both}.s-rt-panel[data-placement=down]{transform-origin:top right}@keyframes s-rt-in{0%{opacity:0;transform:translateY(5px) scale(.985,.96)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes s-rt-row-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes s-rt-swap-in{0%{opacity:0;transform:translate(5px)}to{opacity:1;transform:translate(0)}}.s-rt-rail{display:flex;flex-direction:column}.s-rt-rail-main{display:flex}.s-rt-harnesses{position:relative;flex-shrink:0;padding:6px 8px 6px 6px;border-right:1px solid var(--border)}.s-rt-marker{position:absolute;left:0;top:6px;width:2px;border-radius:999px;background:var(--s-rt-accent);transition:transform .18s cubic-bezier(.16,.84,.44,1)}.s-rt-harness{display:flex;align-items:center;gap:8px;width:124px;padding:0 8px;border:none;border-radius:3px;background:transparent;color:var(--dim);font-family:var(--font-mono);font-size:var(--text-md);font-weight:500;cursor:pointer;transition:color .12s ease,background .12s ease}.s-rt-harness:hover{color:var(--muted)}.s-rt-harness[data-on]{color:var(--ink)}.s-rt-harness[data-disabled]{opacity:.5;cursor:default}.s-rt-harness:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--s-rt-accent) 60%,transparent)}.s-rt-harness-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.s-rt-opt-mark{flex-shrink:0}.s-rt-models-col{display:flex;flex:1;min-width:0;flex-direction:column}.s-rt-models{display:flex;flex:1;min-width:0;flex-direction:column;gap:1px;padding:6px;max-height:264px;overflow-y:auto;animation:s-rt-swap-in .15s cubic-bezier(.16,.84,.44,1) both}.s-rt-row{display:flex;align-items:baseline;gap:8px;width:100%;padding:6px 8px;border:none;border-radius:3px;background:transparent;color:var(--muted);font-family:var(--font-mono);font-size:var(--text-md);text-align:left;cursor:pointer;animation:s-rt-row-in .16s cubic-bezier(.16,.84,.44,1) both;transition:color .12s ease,background .12s ease}.s-rt-row:hover{color:var(--ink)}.s-rt-row[data-on]{color:var(--ink);background:color-mix(in srgb,var(--ink) 5%,transparent)}.s-rt-row[data-disabled]{opacity:.5;cursor:default}.s-rt-row:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--s-rt-accent) 60%,transparent)}.s-rt-dot{flex-shrink:0;align-self:center;width:6px;height:6px;border-radius:999px;background:transparent;transform:scale(.4);transition:transform .2s cubic-bezier(.34,1.56,.64,1),background-color .13s ease-out}.s-rt-row[data-on] .s-rt-dot{background:var(--s-rt-accent);transform:scale(1)}.s-rt-row-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.s-rt-note{flex-shrink:0;font-size:var(--text-2xs);letter-spacing:.12em;text-transform:uppercase;color:var(--dim)}.s-rt-search{display:flex;align-items:center;gap:6px;margin:6px 6px 0;padding:4px 8px;border:1px solid var(--border);border-radius:4px;color:var(--dim)}.s-rt-search-icon{flex-shrink:0}.s-rt-search-input{flex:1;min-width:0;border:none;background:transparent;color:var(--ink);font-family:var(--font-mono);font-size:var(--text-md);outline:none}.s-rt-search-input::placeholder{color:var(--dim)}.s-rt-search-clear{flex-shrink:0;border:none;border-radius:3px;background:transparent;padding:0 4px;color:var(--dim);font-family:var(--font-mono);font-size:var(--text-2xs);letter-spacing:.12em;text-transform:uppercase;cursor:pointer}.s-rt-search-clear:hover{color:var(--ink)}.s-rt-search-clear:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--s-rt-accent) 60%,transparent)}.s-rt-status{display:flex;flex-direction:column;gap:4px;padding:6px}.s-rt-status--error{align-items:flex-start;gap:6px;padding:12px 10px}.s-rt-status-message{font-family:var(--font-mono);font-size:var(--text-md);color:var(--ink)}.s-rt-retry{border:none;border-radius:3px;background:transparent;padding:2px 6px;color:var(--s-rt-accent);font-family:var(--font-mono);font-size:var(--text-2xs);letter-spacing:.12em;text-transform:uppercase;cursor:pointer}.s-rt-retry:hover{text-decoration:underline}.s-rt-retry:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--s-rt-accent) 60%,transparent)}.s-rt-empty{margin:0;padding:12px 10px;font-family:var(--font-mono);font-size:var(--text-md);color:var(--dim)}.s-rt-skel{display:block;height:26px;border-radius:3px;background:color-mix(in srgb,var(--ink) 6%,transparent);animation:s-rt-skel-pulse 1.2s ease-in-out infinite}@keyframes s-rt-skel-pulse{0%,to{opacity:.55}50%{opacity:1}}.s-rt-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.s-rt-effort-foot{padding:8px 12px 10px;border-top:1px solid var(--border)}.s-rt-effort-absent{margin:0;font-family:var(--font-mono);font-size:var(--text-2xs);line-height:1.5;color:var(--dim)}.s-rt-ladder{display:flex;gap:4px}.s-rt-step{flex:1;border:none;background:transparent;padding:0;cursor:pointer}.s-rt-step:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--s-rt-accent) 60%,transparent);border-radius:3px}.s-rt-step-bar{display:block;height:4px;width:100%;border-radius:999px;transition:background .14s ease-out}.s-rt-step-bar[data-state=filled]{background:color-mix(in srgb,var(--ink) 42%,transparent)}.s-rt-step-bar[data-state=empty]{background:color-mix(in srgb,var(--ink) 14%,transparent)}.s-rt-step:hover .s-rt-step-bar[data-state=empty]{background:color-mix(in srgb,var(--ink) 26%,transparent)}.s-rt-step-bar[data-state=current]{background:var(--s-rt-accent)}.s-rt-step-label{display:block;margin-top:6px;font-family:var(--font-mono);font-size:var(--text-xs);letter-spacing:0;color:var(--dim)}.s-rt-step[aria-checked=true] .s-rt-step-label{color:var(--ink);font-weight:600}@media(prefers-reduced-motion:reduce){.s-rt-panel,.s-rt-models,.s-rt-row,.s-rt-chip-model-text{animation-duration:.01ms;animation-delay:0ms!important}.s-rt-chip-chevron,.s-rt-step-bar,.s-rt-marker,.s-rt-chip-model,.s-rt-dot,.s-rt-harness{transition-duration:.01ms}.s-rt-dot{transform:scale(1)}}
@@ -1 +0,0 @@
1
- import{_ as x}from"./index-DmFAhGPj.js";import{b as k,p as D,V as A,D as q}from"./fx-z37u1o2z.js";function le(t){return t?t.hint?`${t.message} ${t.hint}`:t.message:"Scout voice is unavailable."}async function pe(t={}){const e=await fetch("/api/voice/engage",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(e.status===404)return j(t);if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(g(n,e.status))}return await e.json()}async function j(t={}){const e=await ce(),n=e.settings,i=e.devices,r=i.length>0||(n.permissions?.length??0)>0,o=n.permissions?.find(f=>f.kind==="microphone")??null,a=n.permissions?.find(f=>f.kind==="speechRecognition")??null,u=U(n,i);if(t.requestPermissions&&(o&&!o.granted&&o.status!=="restricted"?await C("microphone").catch(()=>{}):(o?.granted??!1)&&a&&!a.granted&&a.status!=="restricted"&&await C("speechRecognition").catch(()=>{})),!r)return{ready:!1,issue:{code:"host_offline",title:"Scout Menu is not running",message:"Launch Scout Menu on this Mac to dictate in web chat.",hint:"Restart the web server if you just updated Scout — `scout server restart` or restart `bun run server/index.ts`.",action:"launch_host"},warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:!1};const h=$(o);if(h)return{ready:!1,issue:h,warnings:[],settings:n,devices:i,inputDevice:u,hostOnline:r};if(!u)return{ready:!1,issue:{code:"no_input_device",title:"No microphone detected",message:"Scout Menu did not report any audio input devices.",hint:"Plug in a microphone, check Sound settings, then refresh Settings → Voice.",action:"open_voice_settings"},warnings:[],settings:n,devices:i,inputDevice:null,hostOnline:r};const d=F(a);return{ready:!0,issue:null,warnings:d?[d]:[],settings:n,devices:i,inputDevice:u,hostOnline:r}}function U(t,e){if(e.length===0)return null;const n=t.inputDeviceId?e.find(o=>o.id===t.inputDeviceId):null,i=e.find(o=>o.isDefault)??e[0]??null,r=n??i;return r?{id:r.id,name:r.name}:null}function $(t){return!t||t.granted?null:t.canRequest?{code:"microphone_not_requested",title:"Microphone access needed",message:"Scout Menu needs microphone access before dictation can start.",hint:"Request access or tap the mic again to show the macOS prompt.",action:"request_microphone"}:{code:"microphone_denied",title:"Microphone blocked",message:"Scout Menu cannot record because microphone access is off.",hint:"Scout is opening macOS Microphone settings and will detect the change automatically.",action:"open_microphone_settings"}}function F(t){return!t||t.granted?null:t.canRequest?{code:"speech_not_requested",title:"Speech recognition needed",message:"Scout Menu needs speech recognition for live partials.",hint:"Request access to show the macOS prompt.",action:"request_speech"}:{code:"speech_denied",title:"Speech recognition blocked",message:"Speech recognition is off for Scout Menu.",hint:"Choose Retry access to reopen macOS Speech Recognition settings.",action:"open_speech_settings"}}function N(t,e){switch(e){case"microphone_permission":return"Microphone access is off for Scout Menu. Tap the mic to retry; Scout will open macOS Microphone settings.";case"empty_transcript":return"No speech was detected. Check your microphone input in Settings → Voice.";default:return t}}const H=6e4,G=3e3,J=2e4,z=8e3,B=45e3;let M=null,E=null,l=null,_=!1;const R=new Set;function W(){return typeof window>"u"?!1:typeof fetch=="function"}function X(){return M||(M=new K),M}function he(t){return R.add(t),l&&t(l),()=>{R.delete(t)}}function fe(){if(_||!W())return;_=!0;const t=X();t.probe();const e=()=>{t.probeIfStale()};window.addEventListener("focus",e),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function I(t){for(const e of R)e(t)}function O(t,e=Date.now()){const n=t.ok?J:z;return e-t.probedAt<n}class K{state="unknown";unavailableReason=null;captureMode=null;hostReachable=!1;microphoneGranted=null;microphoneCanRequest=null;get connectionState(){return this.state}get lastUnavailableReason(){return this.unavailableReason}get preferredCaptureMode(){return this.captureMode}get isVoiceHostReachable(){return this.hostReachable}get isMicrophoneGranted(){return this.microphoneGranted}get canRequestMicrophone(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!0}get isMicrophoneHardDenied(){return this.hostReachable&&this.microphoneGranted===!1&&this.microphoneCanRequest===!1}get isMicrophoneDenied(){return this.isMicrophoneHardDenied}async probeIfStale(){const e=Date.now();return l&&O(l,e)?(this.applyProbeSnapshot(l),l.ok):l&&l.ok&&e-l.probedAt<B?(this.applyProbeSnapshot(l),!0):l&&!l.ok?this.probe({force:!0}):this.probe()}async probe(e={}){const n=typeof e=="number"?{timeoutMs:e}:e,i=n.force??!1,r=n.timeoutMs??G,o=Date.now();return!i&&l&&O(l,o)?(this.applyProbeSnapshot(l),l.ok):E||(this.state="probing",E=this.fetchProbe(r).finally(()=>{E=null}),E)}async fetchProbe(e){const n=new AbortController,i=window.setTimeout(()=>n.abort(),e);try{const r=await fetch("/api/voice/health?quiet=1",{signal:n.signal}),o=await r.json().catch(()=>({})),a=!!o.host?.hostId,u=typeof o.microphoneGranted=="boolean"?o.microphoneGranted:null,h=typeof o.microphoneCanRequest=="boolean"?o.microphoneCanRequest:null,d=o.capture==="browser"?"browser":"native",f=r.ok&&o.ok===!0,v=f?null:o.detail??o.error??(a?"Scout voice is not ready.":"Scout voice service is unavailable."),w={ok:f,reason:v,captureMode:f?d:null,hostReachable:a,microphoneGranted:u,microphoneCanRequest:h,probedAt:Date.now()};return l=w,this.applyProbeSnapshot(w),I(w),f}catch(r){const a={ok:!1,reason:r instanceof Error&&r.name==="AbortError"?"Scout voice service did not respond.":"Scout voice service is unavailable.",captureMode:null,hostReachable:!1,microphoneGranted:null,microphoneCanRequest:null,probedAt:Date.now()};return l=a,this.applyProbeSnapshot(a),I(a),!1}finally{window.clearTimeout(i)}}applyProbeSnapshot(e){if(this.hostReachable=e.hostReachable,this.microphoneGranted=e.microphoneGranted,this.microphoneCanRequest=e.microphoneCanRequest,e.ok){this.unavailableReason=null,this.captureMode=e.captureMode,this.state="connected";return}this.unavailableReason=e.reason,this.captureMode=null,this.state="unavailable"}async launch(e={}){try{const i=await(await fetch("/api/scout-services/restart-link",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({target:"all"})})).json().catch(()=>({}));if(i.url?.startsWith("scout://services/restart/")){window.location.href=i.url;return}}catch{}window.location.href="scout://hud/show"}async startLive(e={},n={}){return this.captureMode!=="browser"?await Q(e,n):await Y(e)}}async function Q(t={},e={}){t.onState?.("starting");const n=await fetch("/api/voice/session",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({clientId:"openscout-web",surface:e.surface?.trim()||"chat-composer"})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(g(s,n.status))}const r=(await n.json()).sessionId?.trim();if(!r)throw new Error("Scout voice did not return a session id.");let o=!1,a,u;const h=new Promise((s,p)=>{a=s,u=p});let d=null;const f=()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{w(new Error("Scout voice transcription timed out. Try again or check voice settings."))},H)},v=()=>{d&&(window.clearTimeout(d),d=null)},w=(s,p="error")=>{o||(o=!0,v(),m.close(),t.onState?.(p),u(s))},y=s=>{o||(o=!0,v(),m.close(),t.onFinal?.(s),t.onState?.("done"),a(s))},m=new EventSource(`/api/voice/session/${encodeURIComponent(r)}/events`),c=s=>p=>{if(o)return;let S={};try{S=JSON.parse(p.data)}catch{return}if(s==="session.partial"){const b=typeof S.text=="string"?S.text:"";t.onPartial?.(b);return}if(s==="session.state"){const b=Z(S.state);b&&(t.onState?.(b),b==="processing"&&f());return}if(s==="session.final"){y({sessionId:r,text:typeof S.text=="string"?S.text.trim():"",durationMs:Number(S.durationMs??0)});return}if(s==="session.cancelled"){w(T(),"cancelled");return}if(s==="session.error"){const b=typeof S.message=="string"?S.message:"Scout voice session failed.",L=typeof S.code=="string"?S.code:null;w(new Error(N(b,L)))}};return m.addEventListener("session.started",()=>{t.onState?.("starting")}),m.addEventListener("session.state",c("session.state")),m.addEventListener("session.partial",c("session.partial")),m.addEventListener("session.final",c("session.final")),m.addEventListener("session.cancelled",c("session.cancelled")),m.addEventListener("session.error",c("session.error")),m.onerror=()=>{o||w(new Error("Scout voice event stream disconnected."))},{get sessionId(){return r},result:h,stop:async()=>{t.onState?.("processing"),f();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/stop`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(g(p,s.status))}},cancel:async()=>{o=!0,v(),m.close();const s=await fetch(`/api/voice/session/${encodeURIComponent(r)}/cancel`,{method:"POST"});if(!s.ok){const p=await s.text().catch(()=>"");throw new Error(g(p,s.status))}t.onState?.("cancelled"),u(T())}}}async function Y(t={}){if(typeof MediaRecorder>"u"||!navigator.mediaDevices?.getUserMedia)throw new Error("Scout voice capture is unavailable in this browser.");const{startStreamLevelMeter:e}=await x(async()=>{const{startStreamLevelMeter:c}=await import("./voice-levels-Dcr3jglk.js");return{startStreamLevelMeter:c}},[]),n=ae(),i=[];let r=null,o=null,a=null,u=!1,h=!1,d,f;const v=new Promise((c,s)=>{d=c,f=s}),w=()=>{a?.stop(),a=null;for(const c of r?.getTracks()??[])c.stop();r=null},y=(c,s="error")=>{h||(h=!0,w(),t.onState?.(s),f(c))},m=async()=>{if(h)return;if(w(),u){y(T(),"cancelled");return}t.onState?.("processing");const c=o?.mimeType||V()||"application/octet-stream",s=new Blob(i,{type:c});if(s.size===0){y(new Error("No voice audio was captured."));return}try{const p=await ne(s,{sessionId:n});if(h)return;h=!0,t.onFinal?.(p),t.onState?.("done"),d(p)}catch(p){y(p instanceof Error?p:new Error(String(p)))}};try{t.onState?.("starting"),r=await navigator.mediaDevices.getUserMedia({audio:!0}),t.onLevel&&(a=e(r,t.onLevel));const c=V();o=new MediaRecorder(r,c?{mimeType:c}:void 0),o.addEventListener("dataavailable",s=>{s.data.size>0&&i.push(s.data)}),o.addEventListener("error",()=>{y(new Error("Scout voice recorder failed."))}),o.addEventListener("stop",()=>{m()},{once:!0}),o.start(),t.onPartial?.(""),t.onState?.("recording")}catch(c){const s=c instanceof Error?c:new Error(String(c));throw y(s),v.catch(()=>{}),s}return{get sessionId(){return n},result:v,stop:async()=>{!o||o.state==="inactive"||o.stop()},cancel:async()=>{if(u=!0,o&&o.state!=="inactive"){o.stop();return}y(T(),"cancelled")}}}function Z(t){return t==="starting"||t==="recording"||t==="processing"||t==="done"||t==="cancelled"||t==="error"?t:null}function g(t,e){try{return JSON.parse(t).error??`Scout voice returned HTTP ${e}`}catch{return t||`Scout voice returned HTTP ${e}`}}function me(t){return t instanceof Error&&t.name==="AbortError"}async function ee(t,e={}){const n={text:t,speed:se(e.speed)};e.modelId&&(n.modelId=e.modelId),e.voiceId&&(n.voiceId=e.voiceId),e.originAppId&&(n.originAppId=e.originAppId),e.utteranceId&&(n.utteranceId=e.utteranceId),e.instructions&&(n.instructions=e.instructions),e.speechTiming?.enabled&&(n.speechTiming=e.speechTiming);const i=await fetch("/api/voice/speak",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n),signal:e.signal});if(!i.ok){const r=await i.text().catch(()=>"");try{const o=JSON.parse(r);throw new Error(o.error??`Scout voice returned HTTP ${i.status}`)}catch(o){throw o instanceof SyntaxError?new Error(r||`Scout voice returned HTTP ${i.status}`):o}}return await i.json()}async function we(t){const e=t?`?modelId=${encodeURIComponent(t)}`:"",n=await fetch(`/api/voice/catalog${e}`,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(`Scout voice catalog returned HTTP ${n.status}`);return await n.json()}async function Se(t,e={}){if(e.signal?.aborted)throw P();const n=new Audio(`data:${t.contentType};base64,${t.audioBase64}`),i=()=>{n.pause(),n.currentTime=0};e.signal?.addEventListener("abort",i,{once:!0}),await n.play(),e.onPlaybackStart?.();try{return await new Promise((r,o)=>{const a=()=>{n.removeEventListener("ended",u),n.removeEventListener("error",h),e.signal?.removeEventListener("abort",d)},u=()=>{a(),r()},h=()=>{a(),o(new Error("Scout voice playback failed."))},d=()=>{a(),o(P())};if(e.signal?.aborted){d();return}n.addEventListener("ended",u,{once:!0}),n.addEventListener("error",h,{once:!0}),e.signal?.addEventListener("abort",d,{once:!0})}),t}finally{e.signal?.removeEventListener("abort",i)}}async function te(t,e={}){const n=await ee(t,e);if(e.signal?.aborted)throw P();const i=await k(n.audioBase64,n.contentType),r=ie(e.presetId,e.params);return await D(i,{params:r,signal:e.signal}).promise,n}function ge(t,e={}){const n=new AbortController;return{promise:te(t,{...e,signal:n.signal}),stop:()=>n.abort()}}async function ne(t,e){const n=new FormData,i=oe(t.type);n.append("audio",t,`audio.${re(t.type)}`),n.append("sessionId",e.sessionId),i&&n.append("format",i);const r=await fetch("/api/voice/transcribe",{method:"POST",body:n});if(!r.ok){const a=await r.text().catch(()=>"");try{const u=JSON.parse(a);throw new Error(u.error??`Scout voice returned HTTP ${r.status}`)}catch(u){throw u instanceof SyntaxError?new Error(a||`Scout voice returned HTTP ${r.status}`):u}}const o=await r.json();return{sessionId:e.sessionId,text:o.text?.trim()??"",durationMs:Number(o.durationMs??0)}}function P(){const t=new Error("Speech stopped.");return t.name="AbortError",t}function T(){const t=new Error("Voice recording was cancelled.");return t.name="AbortError",t}function V(){return typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"?void 0:["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/webm","audio/wav"].find(e=>{try{return MediaRecorder.isTypeSupported(e)}catch{return!1}})}function oe(t){const e=t.toLowerCase();if(e.includes("mp3")||e.includes("mpeg"))return"mp3";if(e.includes("wav"))return"wav";if(e.includes("aac")||e.includes("mp4"))return"aac";if(e.includes("opus")||e.includes("ogg")||e.includes("webm"))return"opus"}function re(t){const e=t.toLowerCase();return e.includes("webm")?"webm":e.includes("ogg")||e.includes("opus")?"opus":e.includes("mp4")||e.includes("aac")?"m4a":e.includes("wav")?"wav":e.includes("mp3")||e.includes("mpeg")?"mp3":"audio"}function ie(t,e){const n=t?A.find(i=>i.id===t)?.params:void 0;return{...q,...n??{},...e??{}}}function se(t){if(!(t===void 0||!Number.isFinite(t)))return Math.min(2,Math.max(.5,Number(t.toFixed(2))))}function ae(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`scout-voice:${crypto.randomUUID()}`:`scout-voice:${Date.now().toString(36)}:${Math.random().toString(36).slice(2)}`}async function ce(){const t=await fetch("/api/voice/settings");if(!t.ok){const e=await t.text().catch(()=>"");throw new Error(g(e,t.status))}return await t.json()}async function ve(t="microphone"){const e=await fetch("/api/voice/permissions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(g(n,e.status))}}async function C(t="microphone"){const e=await fetch("/api/voice/permissions/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:t})});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(g(n,e.status))}}async function ye(t=12){const e=await fetch(`/api/voice/history?limit=${t}`);if(!e.ok){const i=await e.text().catch(()=>"");throw new Error(g(i,e.status))}return(await e.json()).sessions??[]}async function be(t){const e=await fetch("/api/voice/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.text().catch(()=>"");throw new Error(g(n,e.status))}return await e.json()}export{pe as a,we as b,Se as c,ge as d,fe as e,le as f,X as g,ce as h,me as i,ye as j,be as k,ve as o,ee as p,C as r,he as s};