@openscout/scout 0.2.87 → 0.2.91

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 (486) hide show
  1. package/README.md +10 -5
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +4 -4
  4. package/dist/client/assets/ActivityScreen-BUeb4ERK.js +1 -0
  5. package/dist/client/assets/{AddProjectForm-Dw2oyCcz.js → AddProjectForm-DtTfn4Zk.js} +1 -1
  6. package/dist/client/assets/AgentAvatar-CneOa70z.js +1 -0
  7. package/dist/client/assets/AgentConfigurationScreen-CkZ7EjZh.js +1 -0
  8. package/dist/client/assets/AgentDefinitionsWorkspace-0Y3kqMtv.js +1 -0
  9. package/dist/client/assets/{AgentDetailCard-2DZQahiN.js → AgentDetailCard-Dtc02KUO.js} +1 -1
  10. package/dist/client/assets/AgentFloorView-B5raPB_U.js +1 -0
  11. package/dist/client/assets/AgentInfoScreen-DFG4ElZD.js +1 -0
  12. package/dist/client/assets/{AgentLaneCard-CeSjWWwh.js → AgentLaneCard-BRAkw8YJ.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-Do7CXwin.js → AgentLaneChrome-T8QE5742.js} +1 -1
  14. package/dist/client/assets/AgentLaneDetailSheet-C8RYotnv.js +4 -0
  15. package/dist/client/assets/{AgentLaneSummaryResize--lHgnncr.js → AgentLaneSummaryResize-FyYweLo_.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-BwkGk8JH.js → AgentLanesPreflight-Cil3dNwu.js} +1 -1
  18. package/dist/client/assets/AgentLanesView-DPfO8MOo.js +2 -0
  19. package/dist/client/assets/{AgentLiveActions-BmXDRxER.js → AgentLiveActions-DwScaVRF.js} +1 -1
  20. package/dist/client/assets/AgentSessions-DKoWA0Lm.js +6 -0
  21. package/dist/client/assets/AgentsConsole-DoBIWGoq.js +1 -0
  22. package/dist/client/assets/AgentsScreen-JuUiSuwY.js +1 -0
  23. package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +1 -0
  24. package/dist/client/assets/{AtopView-DOKJbiJL.js → AtopView-ycxMrRwp.js} +1 -1
  25. package/dist/client/assets/BackToPicker-D6WgIDb-.js +1 -0
  26. package/dist/client/assets/BriefingDetailScreen-Zw-taW1s.js +6 -0
  27. package/dist/client/assets/{BriefingsScreen-DLIJ8eYj.js → BriefingsScreen-BerYOoWS.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-C8WERmHF.js → BrokerMetadataPanel-Cu93j-Ga.js} +1 -1
  29. package/dist/client/assets/BrokerScreen-CeN90URH.js +5 -0
  30. package/dist/client/assets/ChatCollapsedStrip-DdKyMSEM.js +1 -0
  31. package/dist/client/assets/{CodeDiffPane-CtgqIuS0.js → CodeDiffPane-BjCOBLze.js} +1 -1
  32. package/dist/client/assets/{CodeProjectPicker-C4W_udc7.js → CodeProjectPicker-NSGdCaK0.js} +1 -1
  33. package/dist/client/assets/{CodeScreen-WhTvVUKY.js → CodeScreen-CA9Sq6Dx.js} +1 -1
  34. package/dist/client/assets/ContextMenu-DnFcmfMR.js +1 -0
  35. package/dist/client/assets/ConversationComposer-CjRXFkvY.js +1 -0
  36. package/dist/client/assets/ConversationFeedRows-CgRTIpAv.js +1 -0
  37. package/dist/client/assets/ConversationHeader-CRmdtuL7.js +1 -0
  38. package/dist/client/assets/ConversationPanels-DCkcLIHk.js +2 -0
  39. package/dist/client/assets/ConversationScreen-Br0QQ3xo.js +1 -0
  40. package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
  41. package/dist/client/assets/ConversationStatus-BJ1CMbAv.js +1 -0
  42. package/dist/client/assets/{DataTable-DFacT2uu.js → DataTable-Dzqiaha4.js} +1 -1
  43. package/dist/client/assets/{DispatchAftermath-D797PbCe.js → DispatchAftermath-B0WMg_z3.js} +1 -1
  44. package/dist/client/assets/DocumentFocusViewer-CZVVIAD5.js +1 -0
  45. package/dist/client/assets/{EmbeddableSurfacesLab-JczLmmF-.js → EmbeddableSurfacesLab-C3a7hJWO.js} +1 -1
  46. package/dist/client/assets/{EmptyState-uQbB-bvP.js → EmptyState-CYNJZMrZ.js} +1 -1
  47. package/dist/client/assets/{FileViewerPane-ebbCtnHE.js → FileViewerPane-Fwt8_KmD.js} +1 -1
  48. package/dist/client/assets/FleetSearch-Dsi_l2KW.js +1 -0
  49. package/dist/client/assets/FleetSearch-EXOe8ulE.css +1 -0
  50. package/dist/client/assets/FlightObserveScreen-g_tiGmvz.js +1 -0
  51. package/dist/client/assets/{FollowScreen-Bfu2_KtU.js → FollowScreen-Bb_rcrzi.js} +1 -1
  52. package/dist/client/assets/{HarnessMark-CEzmPFHC.js → HarnessMark-DrE57dUq.js} +1 -1
  53. package/dist/client/assets/HarnessesScreen-CAsCJ_tG.js +1 -0
  54. package/dist/client/assets/{HerdrSession-BDLa_rrK.js → HerdrSession-1eVu9Owj.js} +1 -1
  55. package/dist/client/assets/HomeHero-DEl-WBsT.css +1 -0
  56. package/dist/client/assets/HomeHero-W445QrG1.js +1 -0
  57. package/dist/client/assets/{KnowledgeSearchInspector-GjmxYBi_.js → KnowledgeSearchInspector-CbPVg3fr.js} +1 -1
  58. package/dist/client/assets/KnowledgeSearchScreen-C1lN1xJk.js +1 -0
  59. package/dist/client/assets/{LaneToolHoverCard-DCY-m0JK.js → LaneToolHoverCard-BkBcDYm-.js} +1 -1
  60. package/dist/client/assets/LaneTraceDetailSheet-CzTd44rf.js +1 -0
  61. package/dist/client/assets/{LaneTraceEventFocus-BfKZ7G5c.js → LaneTraceEventFocus-BmMmPTyJ.js} +1 -1
  62. package/dist/client/assets/{MeshCanvas-CZYHLTvw.js → MeshCanvas-DwkjsiJ5.js} +2 -2
  63. package/dist/client/assets/{MeshCanvasMinimap-D3mJ78CM.js → MeshCanvasMinimap-vmCpU1sD.js} +1 -1
  64. package/dist/client/assets/MeshScreen-CkMepUpT.js +1 -0
  65. package/dist/client/assets/{MeshTopologyView-A-wh0Ad1.js → MeshTopologyView-BD2xLE2C.js} +2 -2
  66. package/dist/client/assets/MessageComposerSuggestions-qbalTne_.js +1 -0
  67. package/dist/client/assets/MessagesScreen-C8UynyLC.js +1 -0
  68. package/dist/client/assets/{MissionContextRail-MTL2EAnr.js → MissionContextRail-D5MEP2f4.js} +1 -1
  69. package/dist/client/assets/MissionControlView-K_I7eftL.js +1 -0
  70. package/dist/client/assets/MissionFocusOverlay-CWKLdUKG.js +1 -0
  71. package/dist/client/assets/MissionLeftAgentRow-ByGrNAcs.js +1 -0
  72. package/dist/client/assets/MissionLogPane-ZwHJ137T.js +1 -0
  73. package/dist/client/assets/{NewAgentModal-Ctixol4_.js → NewAgentModal-Do9aVvan.js} +1 -1
  74. package/dist/client/assets/NewChatComposer-DKlNX1UA.js +19 -0
  75. package/dist/client/assets/{NewChatOrigin-CCiPg_WR.js → NewChatOrigin-DXPvX-hh.js} +1 -1
  76. package/dist/client/assets/ObserveEmbedScreen-Dghsq2on.js +2 -0
  77. package/dist/client/assets/ObserveTextFlow-DWNlmTVm.js +2 -0
  78. package/dist/client/assets/ObservedTopologyPanel-BlmGoxCE.js +2 -0
  79. package/dist/client/assets/OpenScoutAppShell-DDqQi-oe.js +87 -0
  80. package/dist/client/assets/OpsAgentsView-Bn_fGBdo.js +1 -0
  81. package/dist/client/assets/OpsScreen-DHnT-Q9R.js +1 -0
  82. package/dist/client/assets/OpsSubnav-CJRD7MjM.js +1 -0
  83. package/dist/client/assets/PlanView-B6gKo543.js +1 -0
  84. package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +1 -0
  85. package/dist/client/assets/{ProjectAgentProfileBar-B4RqrI0Q.js → ProjectAgentProfileBar-C5QWwZCn.js} +1 -1
  86. package/dist/client/assets/ProjectAgentProfileHero-DC7Dd8VL.js +1 -0
  87. package/dist/client/assets/ProjectsInbox-DCLrDmj1.js +2 -0
  88. package/dist/client/assets/ProjectsRail-C4hiXYSb.js +1 -0
  89. package/dist/client/assets/ProjectsScreen-jruZRjgD.js +1 -0
  90. package/dist/client/assets/ProjectsThreadAside-DYmL2dCY.js +1 -0
  91. package/dist/client/assets/Provider-p-xuaAoE.js +1 -0
  92. package/dist/client/assets/RailRow-Cf9LOiEj.css +1 -0
  93. package/dist/client/assets/RailRow-bRkkXIpR.js +1 -0
  94. package/dist/client/assets/RawSessionsTable-B7WKmXrk.js +1 -0
  95. package/dist/client/assets/RealtimeVoiceScreen-BzP3BQq9.js +1 -0
  96. package/dist/client/assets/{RepoDiffEmbedScreen-Cr1SL5ht.js → RepoDiffEmbedScreen-xjzjcJ_c.js} +1 -1
  97. package/dist/client/assets/{RepoDiffPageScreen-DeC8fsh_.js → RepoDiffPageScreen-DRzIY-dk.js} +1 -1
  98. package/dist/client/assets/RepoDiffViewer-CNDp01KM.js +7 -0
  99. package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +2 -0
  100. package/dist/client/assets/{ReposScreen-BQwIShXf.js → ReposScreen-CpaLC_NU.js} +6 -6
  101. package/dist/client/assets/ScoutDeckSurface-DkpZ-0DH.js +1 -0
  102. package/dist/client/assets/{ScoutSurface-DdVzN3DA.js → ScoutSurface-BENBUt5-.js} +1 -1
  103. package/dist/client/assets/ScoutbotBroadcastChip-CGZyxS5H.js +2 -0
  104. package/dist/client/assets/{agent-autocomplete-C7xwIcwd.css → ScoutbotBroadcastChip-CxtYZWPZ.css} +1 -1
  105. package/dist/client/assets/{ScoutbotFxLab-sLjfSKtS.js → ScoutbotFxLab-Bk2ZsfPp.js} +1 -1
  106. package/dist/client/assets/ScoutbotRealtimeVoiceCall-n63LdBZs.js +1 -0
  107. package/dist/client/assets/{SecondaryNav-CCQqTT3e.js → SecondaryNav-B4IsujYh.js} +1 -1
  108. package/dist/client/assets/{SessionEmbedScreen-BrLMZJ3N.js → SessionEmbedScreen-CPfH-jqN.js} +1 -1
  109. package/dist/client/assets/{SessionObserve-pbozyqVv.js → SessionObserve-B-SkP3tu.js} +1 -1
  110. package/dist/client/assets/{SessionObserveEvidence-C54Xvbps.js → SessionObserveEvidence-CF5jnH3-.js} +1 -1
  111. package/dist/client/assets/SessionRefScreen-C-4jjmVG.js +1 -0
  112. package/dist/client/assets/SessionsScreen-HAjFvmIq.js +1 -0
  113. package/dist/client/assets/SettingsDrawer-DATxwZrn.js +3 -0
  114. package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
  115. package/dist/client/assets/SettingsScreen-Bu53X7J_.js +1 -0
  116. package/dist/client/assets/{ShikiPane-CiVH-45m.js → ShikiPane-DH8yYDks.js} +1 -1
  117. package/dist/client/assets/{SlidePanel-BLrLF9dt.js → SlidePanel-RFXJpfUa.js} +1 -1
  118. package/dist/client/assets/{SpriteAvatar-vpHO-rXs.js → SpriteAvatar-CEYdCzem.js} +1 -1
  119. package/dist/client/assets/{StatusPill-a3XBw1GG.js → StatusPill-9uy70ttd.js} +1 -1
  120. package/dist/client/assets/{TailView-C3rjOV7i.js → TailView-6bIrgdxN.js} +2 -2
  121. package/dist/client/assets/Terminal-BI6km7H4.js +1 -0
  122. package/dist/client/assets/TerminalEmbedScreen-D4JOWwtm.js +1 -0
  123. package/dist/client/assets/{TextDocumentSurface-B29xZNlI.js → TextDocumentSurface-BcP9vvji.js} +1 -1
  124. package/dist/client/assets/{TmuxPeek-eVfqPB4m.js → TmuxPeek-IaWqCgyJ.js} +1 -1
  125. package/dist/client/assets/{VoicePermissionsPanel-DpInOlVq.js → VoicePermissionsPanel-C80iZxgy.js} +1 -1
  126. package/dist/client/assets/{WorkDetailScreen-DYwgGaJs.js → WorkDetailScreen-CweZ6fEd.js} +3 -3
  127. package/dist/client/assets/WorkFilesViewer-Dy_-06iI.js +1 -0
  128. package/dist/client/assets/{activity-DTqqWiyV.js → activity-DS0u0Itf.js} +1 -1
  129. package/dist/client/assets/{addon-fit-CcaylYTX.js → addon-fit-CN888B3D.js} +1 -1
  130. package/dist/client/assets/{addon-webgl-B37iuzOG.js → addon-webgl-CoAnanQS.js} +1 -1
  131. package/dist/client/assets/{agent-essentials-DbbJm3ne.js → agent-essentials-CuK4G_zS.js} +1 -1
  132. package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
  133. package/dist/client/assets/{agent-lane-card-model-CSugZCdy.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
  134. package/dist/client/assets/{agent-lane-detail-D5EIlX7_.js → agent-lane-detail-BNNm6FNu.js} +1 -1
  135. package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-C33Dwpn7.js} +1 -1
  136. package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-BDNktFBZ.css} +1 -1
  137. package/dist/client/assets/{agent-lanes-model-BKOs_32K.js → agent-lanes-model-VYQ5a68i.js} +2 -2
  138. package/dist/client/assets/{api-BHHEUSS3.js → api-BkjHJfgJ.js} +1 -1
  139. package/dist/client/assets/api-h5zurxmi.js +1 -0
  140. package/dist/client/assets/{arc.es-BRPqOKIx.js → arc.es-BET9ev6q.js} +1 -1
  141. package/dist/client/assets/arrow-down-DxxPnPwh.js +1 -0
  142. package/dist/client/assets/{arrow-left-B0CdJdAC.js → arrow-left-CXDkJuCg.js} +1 -1
  143. package/dist/client/assets/{arrow-up-right-CilNLf4t.js → arrow-up-right-Bj8RjSqW.js} +1 -1
  144. package/dist/client/assets/{bot-Ba3gcRVa.js → bot-BSGSicKC.js} +1 -1
  145. package/dist/client/assets/broker-display-pp33bLsu.js +2 -0
  146. package/dist/client/assets/{cache-BO2Bd_LV.js → cache-Dr0why2k.js} +1 -1
  147. package/dist/client/assets/{check-BdovFDz8.js → check-BfA0T8UD.js} +1 -1
  148. package/dist/client/assets/{chevron-down-Jh540uf3.js → chevron-down-BVg09D6U.js} +1 -1
  149. package/dist/client/assets/{chevron-right-CV7sEVBS.js → chevron-right-CaEwYkxE.js} +1 -1
  150. package/dist/client/assets/{chunk-HRAB3GC3-BYQZ1LOn.js → chunk-HRAB3GC3-HhKwnZCi.js} +1 -1
  151. package/dist/client/assets/chunk-JTPDIGGW-DX2eTIQ_.js +46 -0
  152. package/dist/client/assets/chunk-T65CQEWV-D-bOfuCH.js +1 -0
  153. package/dist/client/assets/chunk-YOZR3KYS-oS9dlQCI.js +2 -0
  154. package/dist/client/assets/{clock-DpfYdWcr.js → clock-C3TUL7D7.js} +1 -1
  155. package/dist/client/assets/{code-xml-CPzpZkhu.js → code-xml-Dbvjk9Kw.js} +1 -1
  156. package/dist/client/assets/collapsed-strip-Dz-of2SM.css +1 -0
  157. package/dist/client/assets/content-BQuEedeL.js +1 -0
  158. package/dist/client/assets/content-BUae-L_N.js +1 -0
  159. package/dist/client/assets/content-BfG98J1k.js +1 -0
  160. package/dist/client/assets/content-BkVTfkAC.js +1 -0
  161. package/dist/client/assets/content-BsNMos_d.js +1 -0
  162. package/dist/client/assets/content-C2TZOKSE.js +1 -0
  163. package/dist/client/assets/content-CCn98eSk.js +1 -0
  164. package/dist/client/assets/content-CJuH5cDP.js +1 -0
  165. package/dist/client/assets/content-CYnPp9yo.js +1 -0
  166. package/dist/client/assets/content-CcrUhm4P.js +1 -0
  167. package/dist/client/assets/content-CiOMtgQc.js +1 -0
  168. package/dist/client/assets/content-CxuVONeQ.js +1 -0
  169. package/dist/client/assets/content-Dmq9n1_L.js +1 -0
  170. package/dist/client/assets/content-DskHP2NI.js +1 -0
  171. package/dist/client/assets/content-DvvzL2HK.js +1 -0
  172. package/dist/client/assets/content-snCAUbwv.js +1 -0
  173. package/dist/client/assets/{conversation-icons-bHIIZ9z3.js → conversation-icons-DmC_Ak3z.js} +1 -1
  174. package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
  175. package/dist/client/assets/conversation-motion-features-DPiGTO21.js +1 -0
  176. package/dist/client/assets/{copy-DQAM0eSY.js → copy-C79v_7D-.js} +1 -1
  177. package/dist/client/assets/{createLucideIcon-Da0lq809.js → createLucideIcon-DCq_3fQn.js} +1 -1
  178. package/dist/client/assets/ctx-panel-B4s49N9e.css +1 -0
  179. package/dist/client/assets/discover-IEnbrH8_.js +2 -0
  180. package/dist/client/assets/embed-entry-XUPb-AzL.js +2 -0
  181. package/dist/client/assets/{external-link-BheHazeW.js → external-link-Dd8xaveL.js} +1 -1
  182. package/dist/client/assets/{eye-B908WSFH.js → eye-DkU59kfl.js} +1 -1
  183. package/dist/client/assets/{file-text-BGVkHS4_.js → file-text-BITQqGtF.js} +1 -1
  184. package/dist/client/assets/gestures-B5rLNRpi.js +1 -0
  185. package/dist/client/assets/home-moving-signal-Bs635mVw.js +1 -0
  186. package/dist/client/assets/home-moving-signal-CAa0V91u.css +1 -0
  187. package/dist/client/assets/home-now-card-VxlLjg1A.js +1 -0
  188. package/dist/client/assets/{home-now-card-nano-iwd10r9G.js → home-now-card-nano-C06GMiwD.js} +1 -1
  189. package/dist/client/assets/hooks-BWiLxTw1.js +2 -0
  190. package/dist/client/assets/index-9as_JTUs.css +1 -0
  191. package/dist/client/assets/index-BTj2MguM.js +1 -0
  192. package/dist/client/assets/index-BZovGpDk.js +10 -0
  193. package/dist/client/assets/index-CvF09yvf.css +1 -0
  194. package/dist/client/assets/index-DiiEQwdc.js +1 -0
  195. package/dist/client/assets/index-vbaJ8sin.js +1 -0
  196. package/dist/client/assets/inspector-panel-C96HcyK5.js +2 -0
  197. package/dist/client/assets/{keyboard-nav-feLCB3Zm.js → keyboard-nav-CHo_xmjw.js} +1 -1
  198. package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BA3g9aVd.js} +1 -1
  199. package/dist/client/assets/{lane-roster-store-BAmj273z.js → lane-roster-store-B6ybJlHJ.js} +1 -1
  200. package/dist/client/assets/left-Bk3XnxPD.css +1 -0
  201. package/dist/client/assets/left-BuJ0wJW1.js +2 -0
  202. package/dist/client/assets/left-C6Zj3cR4.js +1 -0
  203. package/dist/client/assets/left-CCoobxPS.css +1 -0
  204. package/dist/client/assets/left-COMAiMfB.js +2 -0
  205. package/dist/client/assets/left-Ce4WKYPK.js +1 -0
  206. package/dist/client/assets/left-DMJkmJOF.js +1 -0
  207. package/dist/client/assets/left-DrCbY6ja.js +1 -0
  208. package/dist/client/assets/left-agents-BuSyVNGE.js +1 -0
  209. package/dist/client/assets/left-default-DRHywOKX.js +1 -0
  210. package/dist/client/assets/left-l92tw5Kc.js +1 -0
  211. package/dist/client/assets/left-lanes-4-aUyyrV.js +1 -0
  212. package/dist/client/assets/left-mission-e849d_Td.js +1 -0
  213. package/dist/client/assets/left-plan-MchYwAB_.js +2 -0
  214. package/dist/client/assets/library-DygjpA6u.js +1 -0
  215. package/dist/client/assets/{loader-circle-Be0T8xv2.js → loader-circle-B-l2Wj3-.js} +1 -1
  216. package/dist/client/assets/{local-agents-Q6KQ12B9.js → local-agents-Wof5knTJ.js} +1 -1
  217. package/dist/client/assets/{mentions-KNASbAjG.js → mentions-BjXfeF7t.js} +1 -1
  218. package/dist/client/assets/{mesh-ops-C-i8OMiM.js → mesh-ops-C1gq8zKf.js} +1 -1
  219. package/dist/client/assets/{mesh-view-store-B0lqpw8M.js → mesh-view-store-B56D3f77.js} +1 -1
  220. package/dist/client/assets/{message-circle-2v9Udia0.js → message-circle-BwVx5X0q.js} +1 -1
  221. package/dist/client/assets/{message-markup-BP2nH9kQ.js → message-markup-DlVX-iuc.js} +1 -1
  222. package/dist/client/assets/{message-square-DURSOrUr.js → message-square-BnkG6tae.js} +1 -1
  223. package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
  224. package/dist/client/assets/{mission-control-store-HeCy97KT.js → mission-control-store-CMgIVjLJ.js} +1 -1
  225. package/dist/client/assets/model-Co0zkMIc.js +1 -0
  226. package/dist/client/assets/{observe-DkAhvkfn.js → observe-DVHAcIrv.js} +1 -1
  227. package/dist/client/assets/{operator-attention-BqoWAlhp.js → operator-attention-BwSPeheT.js} +1 -1
  228. package/dist/client/assets/{page-status-CEP5pGf3.js → page-status-Bg2hd27j.js} +1 -1
  229. package/dist/client/assets/paperclip-DblaLD_N.js +1 -0
  230. package/dist/client/assets/plan-view-D56fneVF.css +1 -0
  231. package/dist/client/assets/{plus-ZReaTFF-.js → plus-BAI0t5g9.js} +1 -1
  232. package/dist/client/assets/profile-3Q4sUtvJ.js +1 -0
  233. package/dist/client/assets/projects-inbox-Da2hYEn6.js +1 -0
  234. package/dist/client/assets/{radio-BC9TO5Pl.js → radio-BGtkyCG9.js} +1 -1
  235. package/dist/client/assets/{refresh-cw-C4E58VJK.js → refresh-cw-DtF8xPqX.js} +1 -1
  236. package/dist/client/assets/resolve-panes-D4tlKNCT.js +1 -0
  237. package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +1 -0
  238. package/dist/client/assets/right-B8qg3JdB.js +1 -0
  239. package/dist/client/assets/{right-BarpRgcv.js → right-BU_W1kSH.js} +1 -1
  240. package/dist/client/assets/right-BlR7h0US.js +1 -0
  241. package/dist/client/assets/right-BwgwTGGd.js +1 -0
  242. package/dist/client/assets/right-ByptvkVX.js +1 -0
  243. package/dist/client/assets/right-CUP-NIDG.js +1 -0
  244. package/dist/client/assets/right-Ch_jrNe2.js +1 -0
  245. package/dist/client/assets/right-Dd2DscRz.js +1 -0
  246. package/dist/client/assets/right-DmVHd8Xj.js +1 -0
  247. package/dist/client/assets/{right-CIzaNH58.js → right-c4PAdFYZ.js} +1 -1
  248. package/dist/client/assets/{rocket-BahfIwFz.js → rocket-BWh18pt_.js} +1 -1
  249. package/dist/client/assets/router-63XV_E7f.js +1 -0
  250. package/dist/client/assets/{text-B2UZi3l9.js → runtime-picker-BXKJbLot.js} +1 -1
  251. package/dist/client/assets/runtime-picker-vhm0gtLs.css +1 -0
  252. package/dist/client/assets/{scope-views-CmG2X_S0.js → scope-views-Dm2_-NPi.js} +1 -1
  253. package/dist/client/assets/scout-voice-D8Q5sZOL.js +1 -0
  254. package/dist/client/assets/{scoutbot-D4vuKzOL.js → scoutbot-BTIErYHo.js} +2 -2
  255. package/dist/client/assets/{scroll-text-uulNqrf7.js → scroll-text-DZb3mmYo.js} +1 -1
  256. package/dist/client/assets/{search-HmdKXdtR.js → search-1QMVOxF3.js} +1 -1
  257. package/dist/client/assets/secondaryNavConfig-c0cz3MkJ.js +1 -0
  258. package/dist/client/assets/{selection-bridge-n4wNTm1B.js → selection-bridge-O9C4kGfF.js} +1 -1
  259. package/dist/client/assets/{send-horizontal-DOjHkZCD.js → send-horizontal-DbyEkGql.js} +1 -1
  260. package/dist/client/assets/{server-CX-xQjJA.js → server-Bncn9S7r.js} +1 -1
  261. package/dist/client/assets/{session-catalog-b7B1Sof1.js → session-catalog-DC6BlBBC.js} +1 -1
  262. package/dist/client/assets/{session-table-Djain1Qr.js → session-table-BUPq9Viy.js} +1 -1
  263. package/dist/client/assets/{sliders-horizontal-D2O6QiDN.js → sliders-horizontal-CMe8Bay1.js} +1 -1
  264. package/dist/client/assets/{sparkles-CgTby-ap.js → sparkles-_7cTZsIH.js} +1 -1
  265. package/dist/client/assets/{sse-QSbhyq9A.js → sse-Bb0EOcU9.js} +1 -1
  266. package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
  267. package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-BRcJltQa.js} +1 -1
  268. package/dist/client/assets/{tail-events-B7BrDaFi.js → tail-events-C12pfUax.js} +1 -1
  269. package/dist/client/assets/{terminal-relay-C2TUIuh1.js → terminal-relay-BgfVJXIL.js} +1 -1
  270. package/dist/client/assets/{terminal-sessions-D4dHTRkt.js → terminal-sessions-AmSgHklm.js} +1 -1
  271. package/dist/client/assets/{terminal-takeover-BArLfNtd.js → terminal-takeover--05EYhJm.js} +1 -1
  272. package/dist/client/assets/{terminal-DNZTCr6a.js → terminal-xGf_F3y7.js} +1 -1
  273. package/dist/client/assets/text-DsBWV_4k.js +1 -0
  274. package/dist/client/assets/{use-conversation-list-htp0Ui63.js → use-conversation-list-DWX02INv.js} +1 -1
  275. package/dist/client/assets/{use-fleet-active-asks-BhuTn5mV.js → use-fleet-active-asks-Cnwa4hTK.js} +1 -1
  276. package/dist/client/assets/{use-mesh-ops-items-CD-qsvNX.js → use-mesh-ops-items-BRFm37oY.js} +1 -1
  277. package/dist/client/assets/use-reduced-motion-C8cWvIZ3.js +1 -0
  278. package/dist/client/assets/use-scout-dev-flags-FkMreOOb.js +1 -0
  279. package/dist/client/assets/{useAgentHoverCard-BIrm8esH.js → useAgentHoverCard-DvPZSJK3.js} +1 -1
  280. package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +1 -0
  281. package/dist/client/assets/{usePierreRuntime-CVTMzChM.js → usePierreRuntime-C8WJ0X3F.js} +1 -1
  282. package/dist/client/assets/{wrench-DwFKomxg.js → wrench-_tHBGTop.js} +1 -1
  283. package/dist/client/assets/{x-DuzAbpk5.js → x-CrGUKNRv.js} +1 -1
  284. package/dist/client/assets/{xterm-xQGYNyB-.js → xterm-Ks-VlLTq.js} +1 -1
  285. package/dist/client/index.html +2 -2
  286. package/dist/main.mjs +38 -169
  287. package/dist/node/main.mjs +240 -272
  288. package/dist/pairing-runtime-controller.mjs +476 -394
  289. package/dist/runtime/base-daemon.mjs +121 -49
  290. package/dist/runtime/broker-daemon.mjs +60 -171
  291. package/dist/runtime/broker-process-manager.mjs +0 -6
  292. package/dist/runtime/mesh-discover.mjs +0 -6
  293. package/dist/scout-control-plane-web.mjs +477 -672
  294. package/dist/scout-web-server.mjs +477 -672
  295. package/package.json +7 -6
  296. package/dist/client/assets/ActivityScreen-DRHTQIxu.js +0 -1
  297. package/dist/client/assets/AgentAvatar-CQqJcwOQ.js +0 -1
  298. package/dist/client/assets/AgentAvatar-CUZZARWG.css +0 -1
  299. package/dist/client/assets/AgentConfigurationScreen-C3OI6JmZ.js +0 -1
  300. package/dist/client/assets/AgentDefinitionsWorkspace-D0LDEqfl.js +0 -1
  301. package/dist/client/assets/AgentFloorView-CoGh2q5f.js +0 -1
  302. package/dist/client/assets/AgentInfoScreen-5ybfIL9p.js +0 -1
  303. package/dist/client/assets/AgentLaneDetailSheet-BD8B51ka.js +0 -4
  304. package/dist/client/assets/AgentLanesEmbedScreen-FRTVASPw.js +0 -1
  305. package/dist/client/assets/AgentLanesView-Bm85ittm.js +0 -2
  306. package/dist/client/assets/AgentSessions-C_tAfGN2.js +0 -6
  307. package/dist/client/assets/AgentsConsole-DsHWsaOJ.js +0 -1
  308. package/dist/client/assets/AgentsScreen-Bod6AHlA.js +0 -1
  309. package/dist/client/assets/AgentsSubnav-CsvYzzQ-.js +0 -1
  310. package/dist/client/assets/AstronautSuit-C05Ezxl9.js +0 -1
  311. package/dist/client/assets/BackToPicker-CXsbxbHM.js +0 -1
  312. package/dist/client/assets/BriefingDetailScreen-Uvnk3t0v.js +0 -1
  313. package/dist/client/assets/BrokerScreen-LZ3T7hGG.js +0 -5
  314. package/dist/client/assets/Canvas-BO9mx5_P.js +0 -1
  315. package/dist/client/assets/ChatCollapsedStrip-CtLPTLTY.js +0 -1
  316. package/dist/client/assets/ConversationComposer-DPWu3HvK.js +0 -1
  317. package/dist/client/assets/ConversationFeedRows-MhcPfxUr.js +0 -1
  318. package/dist/client/assets/ConversationHeader-Ce7TENb9.js +0 -1
  319. package/dist/client/assets/ConversationPanels-D-b5SLO-.js +0 -6
  320. package/dist/client/assets/ConversationScreen-C5HnXd5w.css +0 -1
  321. package/dist/client/assets/ConversationScreen-D77SoLos.js +0 -1
  322. package/dist/client/assets/ConversationStatus-lIvSKRic.js +0 -1
  323. package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +0 -1
  324. package/dist/client/assets/CrewWorkspaces-CdojnRMG.js +0 -1
  325. package/dist/client/assets/DocumentFocusViewer-CetjnYut.js +0 -1
  326. package/dist/client/assets/FlightObserveScreen-sqvt7HUO.js +0 -1
  327. package/dist/client/assets/HarnessesScreen-CGhRsqD5.js +0 -1
  328. package/dist/client/assets/HomeHero-7JwycwFY.css +0 -1
  329. package/dist/client/assets/HomeHero-DdxTQ-6a.js +0 -1
  330. package/dist/client/assets/HostAdvisorView-BAUi5ZxX.js +0 -1
  331. package/dist/client/assets/KnowledgeSearchScreen-CRei9pyl.js +0 -1
  332. package/dist/client/assets/LaneTraceDetailSheet-CFsCvKa3.js +0 -1
  333. package/dist/client/assets/MeshScreen-dxNxRtKm.js +0 -1
  334. package/dist/client/assets/MessagesScreen-CR5v-WIE.js +0 -1
  335. package/dist/client/assets/MissionControlView-BGj1qnI2.js +0 -1
  336. package/dist/client/assets/MissionFocusOverlay-hWi6y87j.js +0 -1
  337. package/dist/client/assets/MissionLeftAgentRow-BSRRiiig.js +0 -1
  338. package/dist/client/assets/MissionLogPane-bbG_pM9B.js +0 -1
  339. package/dist/client/assets/NewChatComposer-BPsg8shF.js +0 -19
  340. package/dist/client/assets/ObserveEmbedScreen-Be87Chod.js +0 -2
  341. package/dist/client/assets/ObserveTextFlow-CKYltTPJ.js +0 -2
  342. package/dist/client/assets/ObservedTopologyPanel-CfHYu-4Z.js +0 -2
  343. package/dist/client/assets/OpenScoutAppShell-DPeP1vtK.js +0 -88
  344. package/dist/client/assets/OpsAgentsView-dEtw9yt-.js +0 -1
  345. package/dist/client/assets/OpsScreen-QXRJY8Vf.js +0 -1
  346. package/dist/client/assets/OpsSubnav-BK9Fj3gU.js +0 -1
  347. package/dist/client/assets/ProjectAgentProfile-BjykZ2Xd.js +0 -1
  348. package/dist/client/assets/ProjectAgentProfileHero-Bc0g8rhW.js +0 -1
  349. package/dist/client/assets/ProjectsInbox--ZIqo-IE.js +0 -2
  350. package/dist/client/assets/ProjectsRail-CzS0qTCI.js +0 -1
  351. package/dist/client/assets/ProjectsScreen-0gx7f30h.js +0 -1
  352. package/dist/client/assets/ProjectsThreadAside-BsQRFbdy.js +0 -1
  353. package/dist/client/assets/Provider-Cd-QZltN.js +0 -1
  354. package/dist/client/assets/RailRow-B0sRaJc6.css +0 -1
  355. package/dist/client/assets/RailRow-BY6fxePa.js +0 -1
  356. package/dist/client/assets/RawSessionsTable-CbopOF34.js +0 -1
  357. package/dist/client/assets/RealtimeVoiceScreen-CU4uXz4C.js +0 -9
  358. package/dist/client/assets/RepoDiffViewer-CiTOWK_Z.js +0 -7
  359. package/dist/client/assets/RepoDiffViewerLazy-BU3V7Kwq.js +0 -2
  360. package/dist/client/assets/ScoutDeckSurface-BncYKicb.js +0 -1
  361. package/dist/client/assets/SessionRefScreen-UVNVrwAf.js +0 -1
  362. package/dist/client/assets/SessionsScreen-KeDb5gz4.js +0 -1
  363. package/dist/client/assets/SettingsDrawer-CWdj0VvN.js +0 -3
  364. package/dist/client/assets/SettingsDrawer-J-8x1eII.css +0 -1
  365. package/dist/client/assets/SettingsScreen-C7zJgZzj.js +0 -1
  366. package/dist/client/assets/Terminal-CMQFmHnn.js +0 -1
  367. package/dist/client/assets/TerminalEmbedScreen-GvpoGERN.js +0 -1
  368. package/dist/client/assets/TerminalRelay-CIHlLVf1.js +0 -46
  369. package/dist/client/assets/WorkFilesViewer-C7H5fXaZ.js +0 -1
  370. package/dist/client/assets/agent-autocomplete-cOPLtuhM.js +0 -2
  371. package/dist/client/assets/agent-identity-CIMT7oV6.js +0 -1
  372. package/dist/client/assets/agent-specialization-D3-sqwhU.js +0 -1
  373. package/dist/client/assets/api-DEHEgJ9m.js +0 -1
  374. package/dist/client/assets/archive-DPMdoW_D.js +0 -1
  375. package/dist/client/assets/arrow-right-YRBoTTyf.js +0 -1
  376. package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
  377. package/dist/client/assets/collapsed-strip-raJWthAH.css +0 -1
  378. package/dist/client/assets/compass-D5Io6BIV.js +0 -1
  379. package/dist/client/assets/content-3b_jmxEx.js +0 -1
  380. package/dist/client/assets/content-B-i0XY-t.js +0 -1
  381. package/dist/client/assets/content-BD-DNFmb.js +0 -1
  382. package/dist/client/assets/content-BGeo5tgd.js +0 -1
  383. package/dist/client/assets/content-BMvXPLiQ.js +0 -1
  384. package/dist/client/assets/content-BWTbfMDg.js +0 -1
  385. package/dist/client/assets/content-BwCmeUmF.js +0 -1
  386. package/dist/client/assets/content-C1K3NcZa.js +0 -1
  387. package/dist/client/assets/content-C34J5_Af.js +0 -1
  388. package/dist/client/assets/content-CGRtIS2m.js +0 -1
  389. package/dist/client/assets/content-CIJo_-JS.js +0 -1
  390. package/dist/client/assets/content-CvqIqVAV.js +0 -1
  391. package/dist/client/assets/content-DRnwm-Vu.js +0 -1
  392. package/dist/client/assets/content-Dh39SSvP.js +0 -1
  393. package/dist/client/assets/content-DoypqDj5.js +0 -1
  394. package/dist/client/assets/content-n3mvc6NQ.js +0 -1
  395. package/dist/client/assets/conversation-model-CIzM7aXT.js +0 -1
  396. package/dist/client/assets/conversation-motion-features-CrP5K-dk.js +0 -1
  397. package/dist/client/assets/cpu-CtQc0Z9D.js +0 -1
  398. package/dist/client/assets/credentials-qwds23lv.js +0 -1
  399. package/dist/client/assets/ctx-panel-D_HJ3nhb.css +0 -1
  400. package/dist/client/assets/discover-DdkMhTAV.js +0 -2
  401. package/dist/client/assets/embed-entry-DoSM1GZB.js +0 -2
  402. package/dist/client/assets/file-code-corner-C5Pc6znt.js +0 -1
  403. package/dist/client/assets/gauge-sc_gb5Zw.js +0 -1
  404. package/dist/client/assets/gestures-AzPBSf20.js +0 -1
  405. package/dist/client/assets/git-branch-CdJU49Af.js +0 -1
  406. package/dist/client/assets/home-moving-signal-CZo2bYBi.js +0 -1
  407. package/dist/client/assets/home-moving-signal-DMguaRWR.css +0 -1
  408. package/dist/client/assets/home-now-card-DgxfZHcR.js +0 -1
  409. package/dist/client/assets/hooks-CeCCO6Yg.js +0 -2
  410. package/dist/client/assets/host-advisor-B2Fqs5Dd.css +0 -1
  411. package/dist/client/assets/index-BIiI9gfa.js +0 -1
  412. package/dist/client/assets/index-CD2foMB8.js +0 -1
  413. package/dist/client/assets/index-DReHD_4U.js +0 -1
  414. package/dist/client/assets/index-DzlEgstl.css +0 -1
  415. package/dist/client/assets/index-NRbRrZw-.js +0 -10
  416. package/dist/client/assets/index-wLwc74Pu.css +0 -1
  417. package/dist/client/assets/inspector-panel-CBf8pW7s.js +0 -2
  418. package/dist/client/assets/layers-D9fblkql.js +0 -1
  419. package/dist/client/assets/layout-grid-Vd1chalc.js +0 -1
  420. package/dist/client/assets/left-41_3QKk1.js +0 -1
  421. package/dist/client/assets/left-B3ofA1Pr.js +0 -2
  422. package/dist/client/assets/left-BWBZQhxQ.js +0 -1
  423. package/dist/client/assets/left-BhA6essi.js +0 -1
  424. package/dist/client/assets/left-BmTKCv4f.js +0 -1
  425. package/dist/client/assets/left-CCGR6tIF.js +0 -2
  426. package/dist/client/assets/left-DH44V4I_.css +0 -1
  427. package/dist/client/assets/left-Dfwzkwh_.js +0 -1
  428. package/dist/client/assets/left-R2OOE7VG.css +0 -1
  429. package/dist/client/assets/left-advisor-yrzW1Kwz.js +0 -1
  430. package/dist/client/assets/left-agents-Bgahk0FF.js +0 -1
  431. package/dist/client/assets/left-default-CtkfAquc.js +0 -1
  432. package/dist/client/assets/left-lanes-CpujaVN3.js +0 -1
  433. package/dist/client/assets/left-mission-Bbd-fW6W.js +0 -1
  434. package/dist/client/assets/library-Dx14WNGd.js +0 -1
  435. package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
  436. package/dist/client/assets/persistent-state-Bm_0TmZL.js +0 -1
  437. package/dist/client/assets/profile-Y0X7HZHc.js +0 -1
  438. package/dist/client/assets/projects-inbox-Cbfj4Hx7.js +0 -1
  439. package/dist/client/assets/provider-Bq0ScH3v.js +0 -1
  440. package/dist/client/assets/proxy-DtC2iXnT.js +0 -1
  441. package/dist/client/assets/resolve-panes-BI3WdDS-.js +0 -1
  442. package/dist/client/assets/resolve-sidebar-context-_g0pIxOr.js +0 -1
  443. package/dist/client/assets/right-BA0F8fPI.js +0 -1
  444. package/dist/client/assets/right-C4GXB45w.js +0 -1
  445. package/dist/client/assets/right-CXetlD8X.js +0 -1
  446. package/dist/client/assets/right-CnRcQS_I.js +0 -1
  447. package/dist/client/assets/right-D2_rmbAH.js +0 -1
  448. package/dist/client/assets/right-Dqp--KwX.js +0 -1
  449. package/dist/client/assets/right-HJJzRuGD.js +0 -1
  450. package/dist/client/assets/right-WCMb8YXJ.js +0 -1
  451. package/dist/client/assets/router-Bx1tiwVe.js +0 -1
  452. package/dist/client/assets/scout-voice-BT3gYDhU.js +0 -1
  453. package/dist/client/assets/scoutbot-markdown-DIhLsYxz.js +0 -6
  454. package/dist/client/assets/secondaryNavConfig-BVQiyAXu.js +0 -1
  455. package/dist/client/assets/settings-BpKRzxOD.js +0 -1
  456. package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +0 -1
  457. package/dist/client/assets/text-rLpBg4_z.css +0 -1
  458. package/dist/client/assets/use-reduced-motion-0fAsybdo.js +0 -1
  459. package/dist/client/assets/use-scout-dev-flags-DV_I6URU.js +0 -1
  460. package/dist/client/assets/useContentSecondaryNav-4atpGgFw.js +0 -1
  461. package/dist/client/assets/usePersistentState-InmPXIN4.js +0 -1
  462. package/dist/client/assets/zap-CocRNtyr.js +0 -1
  463. package/dist/client/crew/brik-bust.webp +0 -0
  464. package/dist/client/crew/brik-chip-id.webp +0 -0
  465. package/dist/client/crew/lulu-bust.webp +0 -0
  466. package/dist/client/crew/milo-bust.webp +0 -0
  467. package/dist/client/crew/milo-chip-id.webp +0 -0
  468. package/dist/client/crew/nori-bust.webp +0 -0
  469. package/dist/client/crew/sheets/eye-plate-v1/blink-half.webp +0 -0
  470. package/dist/client/crew/sheets/eye-plate-v1/blink-shut.webp +0 -0
  471. package/dist/client/crew/sheets/eye-plate-v1/look-left.webp +0 -0
  472. package/dist/client/crew/sheets/eye-plate-v1/look-right.webp +0 -0
  473. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  474. package/dist/client/crew/sheets/eye-plate-v1/rest.webp +0 -0
  475. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  476. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  477. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  478. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  479. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  480. package/dist/client/crew/sprout-bust.webp +0 -0
  481. package/dist/client/crew/sprout-chip-id.webp +0 -0
  482. package/dist/client/crew/vex-bust.webp +0 -0
  483. package/dist/client/crew/vex-chip-id.webp +0 -0
  484. package/dist/client/crew/wrench-bust.webp +0 -0
  485. package/dist/client/crew/wrench-chip-id.webp +0 -0
  486. /package/dist/client/assets/{DocumentFocusViewer-BSC_JwVE.css → document-focus-viewer-BSC_JwVE.css} +0 -0
@@ -1 +1 @@
1
- import{r as s,j as w}from"./index-NRbRrZw-.js";const K=e=>e==="right"?"railOccupantRight":"railOccupantBottom";function N(e,n,r,l){s.useEffect(()=>{if(!r||typeof window>"u"||typeof document>"u")return;const d=K(e),o=document.body.dataset[d];document.body.dataset[d]=n,window.dispatchEvent(new CustomEvent("hudson:rail:claim",{detail:{owner:n,side:e}})),o&&o!==n&&window.dispatchEvent(new CustomEvent("hudson:rail:preempted",{detail:{owner:o,side:e,by:n}}));const m=f=>{const a=f.detail;a&&a.side===e&&a.owner!==n&&l?.()},v=f=>{const a=f.detail;a&&a.side===e&&a.owner===n&&l?.()};return window.addEventListener("hudson:rail:claim",m),window.addEventListener("hudson:rail:preempted",v),()=>{window.removeEventListener("hudson:rail:claim",m),window.removeEventListener("hudson:rail:preempted",v),document.body.dataset[d]===n&&delete document.body.dataset[d],window.dispatchEvent(new CustomEvent("hudson:rail:release",{detail:{owner:n,side:e}}))}},[e,n,r,l])}const k=620,B=360,$=280,H=900,X=720;function q(e,n,r,l){if(typeof window>"u")return n;try{const d=window.localStorage.getItem(e);if(d==null)return n;const o=Number(d);return Number.isFinite(o)?Math.min(l,Math.max(r,o)):n}catch{return n}}const z=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(", ");function P({open:e,onClose:n,side:r="right",owner:l,defaultSize:d,minSize:o=$,maxSize:m,resizable:v=!1,backdrop:f=!0,scrollLock:a=!1,focusTrap:A=!1,ariaLabel:_,className:F,layer:j="default",children:C}){const I=d??(r==="right"?k:B),h=m??(r==="right"?H:X),y=`slidepanel.size.${l}.${r}`,[E,L]=s.useState(()=>q(y,I,o,h)),S=s.useRef(E);S.current=E;const[g,R]=s.useState(!1),b=s.useRef(null),D=s.useRef(null),p=s.useCallback(()=>n(),[n]);N(r,l,e,p),s.useEffect(()=>{if(!e)return;const t=i=>{i.key==="Escape"&&(i.preventDefault(),p())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,p]),s.useEffect(()=>{if(!e||!a)return;const t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e,a]),s.useEffect(()=>{if(!e)return;D.current=document.activeElement;const t=b.current;return t?((t.querySelector(z)??t).focus(),()=>{D.current?.focus?.()}):void 0},[e]),s.useEffect(()=>{if(!g)return;const t=u=>{if(r==="right"){const c=window.innerWidth-u.clientX;L(Math.min(h,Math.max(o,c)))}else{const c=window.innerHeight-u.clientY;L(Math.min(h,Math.max(o,c)))}},i=()=>{R(!1);try{window.localStorage.setItem(y,String(S.current))}catch{}};return window.addEventListener("pointermove",t),window.addEventListener("pointerup",i),window.addEventListener("pointercancel",i),()=>{window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",i)}},[g,r,o,h,y]);const O=t=>{if(!A||t.key!=="Tab")return;const i=b.current;if(!i)return;const u=Array.from(i.querySelectorAll(z));if(u.length===0){t.preventDefault(),i.focus();return}const c=u[0],T=u[u.length-1],x=document.activeElement;t.shiftKey?(x===c||!i.contains(x))&&(t.preventDefault(),T.focus()):x===T&&(t.preventDefault(),c.focus())};if(!e)return null;const U=r==="right"?{width:E}:{height:E},M=j==="elevated";return w.jsxs(w.Fragment,{children:[f&&w.jsx("div",{className:`s-slide-backdrop${M?" s-slide-backdrop--elevated":""}`,"data-side":r,onClick:p,"aria-hidden":"true"}),w.jsxs("aside",{ref:b,className:["s-slide",`s-slide--${r}`,g?"s-slide--resizing":"",M?"s-slide--elevated":"",F].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":_,tabIndex:-1,onKeyDown:O,style:U,children:[v&&w.jsx("div",{className:`s-slide-resize s-slide-resize--${r}`,onPointerDown:t=>{t.preventDefault(),R(!0)},role:"separator","aria-orientation":r==="right"?"vertical":"horizontal","aria-label":"Resize panel"}),C]})]})}export{P as S};
1
+ import{r as s,j as w}from"./index-BZovGpDk.js";const K=e=>e==="right"?"railOccupantRight":"railOccupantBottom";function N(e,n,r,l){s.useEffect(()=>{if(!r||typeof window>"u"||typeof document>"u")return;const d=K(e),o=document.body.dataset[d];document.body.dataset[d]=n,window.dispatchEvent(new CustomEvent("hudson:rail:claim",{detail:{owner:n,side:e}})),o&&o!==n&&window.dispatchEvent(new CustomEvent("hudson:rail:preempted",{detail:{owner:o,side:e,by:n}}));const m=f=>{const a=f.detail;a&&a.side===e&&a.owner!==n&&l?.()},v=f=>{const a=f.detail;a&&a.side===e&&a.owner===n&&l?.()};return window.addEventListener("hudson:rail:claim",m),window.addEventListener("hudson:rail:preempted",v),()=>{window.removeEventListener("hudson:rail:claim",m),window.removeEventListener("hudson:rail:preempted",v),document.body.dataset[d]===n&&delete document.body.dataset[d],window.dispatchEvent(new CustomEvent("hudson:rail:release",{detail:{owner:n,side:e}}))}},[e,n,r,l])}const k=620,B=360,$=280,H=900,X=720;function q(e,n,r,l){if(typeof window>"u")return n;try{const d=window.localStorage.getItem(e);if(d==null)return n;const o=Number(d);return Number.isFinite(o)?Math.min(l,Math.max(r,o)):n}catch{return n}}const z=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(", ");function P({open:e,onClose:n,side:r="right",owner:l,defaultSize:d,minSize:o=$,maxSize:m,resizable:v=!1,backdrop:f=!0,scrollLock:a=!1,focusTrap:A=!1,ariaLabel:_,className:F,layer:j="default",children:C}){const I=d??(r==="right"?k:B),h=m??(r==="right"?H:X),y=`slidepanel.size.${l}.${r}`,[E,L]=s.useState(()=>q(y,I,o,h)),S=s.useRef(E);S.current=E;const[g,R]=s.useState(!1),b=s.useRef(null),D=s.useRef(null),p=s.useCallback(()=>n(),[n]);N(r,l,e,p),s.useEffect(()=>{if(!e)return;const t=i=>{i.key==="Escape"&&(i.preventDefault(),p())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,p]),s.useEffect(()=>{if(!e||!a)return;const t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e,a]),s.useEffect(()=>{if(!e)return;D.current=document.activeElement;const t=b.current;return t?((t.querySelector(z)??t).focus(),()=>{D.current?.focus?.()}):void 0},[e]),s.useEffect(()=>{if(!g)return;const t=u=>{if(r==="right"){const c=window.innerWidth-u.clientX;L(Math.min(h,Math.max(o,c)))}else{const c=window.innerHeight-u.clientY;L(Math.min(h,Math.max(o,c)))}},i=()=>{R(!1);try{window.localStorage.setItem(y,String(S.current))}catch{}};return window.addEventListener("pointermove",t),window.addEventListener("pointerup",i),window.addEventListener("pointercancel",i),()=>{window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",i)}},[g,r,o,h,y]);const O=t=>{if(!A||t.key!=="Tab")return;const i=b.current;if(!i)return;const u=Array.from(i.querySelectorAll(z));if(u.length===0){t.preventDefault(),i.focus();return}const c=u[0],T=u[u.length-1],x=document.activeElement;t.shiftKey?(x===c||!i.contains(x))&&(t.preventDefault(),T.focus()):x===T&&(t.preventDefault(),c.focus())};if(!e)return null;const U=r==="right"?{width:E}:{height:E},M=j==="elevated";return w.jsxs(w.Fragment,{children:[f&&w.jsx("div",{className:`s-slide-backdrop${M?" s-slide-backdrop--elevated":""}`,"data-side":r,onClick:p,"aria-hidden":"true"}),w.jsxs("aside",{ref:b,className:["s-slide",`s-slide--${r}`,g?"s-slide--resizing":"",M?"s-slide--elevated":"",F].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":_,tabIndex:-1,onKeyDown:O,style:U,children:[v&&w.jsx("div",{className:`s-slide-resize s-slide-resize--${r}`,onPointerDown:t=>{t.preventDefault(),R(!0)},role:"separator","aria-orientation":r==="right"?"vertical":"horizontal","aria-label":"Resize panel"}),C]})]})}export{P as S};
@@ -1 +1 @@
1
- import{r as v,j as r}from"./index-NRbRrZw-.js";import{H as y,s as S}from"./agent-identity-CIMT7oV6.js";import{n as j}from"./colors-BtO5_zlx.js";const k=7,t=10,w=k*t;function N({name:i,size:s,hue:h,tone:c,salt:o,spectrum:e,tile:l=!1,glow:g,corner:p,cornerPulse:u,className:n,title:x}){const a=v.useMemo(()=>S(i,{hue:h,salt:o,spectrum:e,tone:c}),[i,h,o,e,c?.l,c?.c]),d=g??(s!=null&&s>=40),m={position:"relative",display:"inline-grid",placeItems:"center",...s!=null?{width:s,height:s}:{width:"100%",height:"100%"},borderRadius:l?"26%":void 0,background:l?a.palette.soft:void 0,boxSizing:"border-box"};return r.jsxs("span",{className:n,style:m,title:x,children:[r.jsx(E,{sprite:a,glow:d,inset:l}),p&&r.jsx("span",{"aria-hidden":!0,style:{position:"absolute",right:"-4%",bottom:"-4%",width:"28%",height:"28%",minWidth:6,minHeight:6,borderRadius:"999px",background:p,boxShadow:u?`0 0 0 2px var(--scout-chrome-surface, var(--hud-bg, #000)), 0 0 0 4px color-mix(in oklab, ${p} 32%, transparent)`:"0 0 0 2px var(--scout-chrome-surface, var(--hud-bg, #000))"}})]})}function E({sprite:i,glow:s=!1,inset:h=!1}){const{cells:c,palette:o}=i,e=t*.07,l=t*.2,g=t*.24;return r.jsx("svg",{viewBox:`0 0 ${w} ${w}`,shapeRendering:"geometricPrecision",style:{display:"block",width:h?"72%":"100%",height:"auto",aspectRatio:"1 / 1",overflow:"visible",filter:s?`drop-shadow(0 1.6px 5px ${o.glow})`:void 0},children:c.flatMap((p,u)=>p.map((n,x)=>{if(n==="off")return null;const a=x*t,d=u*t,f=`${u}-${x}`;if(n==="eye")return r.jsxs("g",{className:"sprite-cell sprite-cell--eye",children:[r.jsx("rect",{x:a+e,y:d+e,width:t-e*2,height:t-e*2,rx:l,fill:o.sclera}),r.jsx("circle",{cx:a+t/2,cy:d+t*.52,r:g,fill:o.ink})]},f);const m=n==="accent"?o.accent:n==="mouth"?o.ink:o.body,b=n==="accent"?"sprite-cell sprite-cell--accent":"sprite-cell";return r.jsx("rect",{className:b,x:a+e,y:d+e,width:t-e*2,height:t-e*2,rx:l,fill:m},f)}))})}const R={in_turn:{l:.75,c:.16},in_flight:{l:.72,c:.14},needs_attention:{l:.78,c:.16},callable:{l:.73,c:.13},blocked:{l:.5,c:.02}};function T(i){const s=i.harness?.trim().toLowerCase();return{hue:s?y[s]:void 0,tone:R[j(i.state??null)]}}export{N as S,T as a};
1
+ import{r as v,j as r}from"./index-BZovGpDk.js";import{H as y,s as S}from"./agent-identity-BxCsXnDp.js";import{n as j}from"./colors-BtO5_zlx.js";const k=7,t=10,w=k*t;function N({name:i,size:s,hue:h,tone:c,salt:o,spectrum:e,tile:l=!1,glow:g,corner:p,cornerPulse:u,className:n,title:x}){const a=v.useMemo(()=>S(i,{hue:h,salt:o,spectrum:e,tone:c}),[i,h,o,e,c?.l,c?.c]),d=g??(s!=null&&s>=40),m={position:"relative",display:"inline-grid",placeItems:"center",...s!=null?{width:s,height:s}:{width:"100%",height:"100%"},borderRadius:l?"26%":void 0,background:l?a.palette.soft:void 0,boxSizing:"border-box"};return r.jsxs("span",{className:n,style:m,title:x,children:[r.jsx(E,{sprite:a,glow:d,inset:l}),p&&r.jsx("span",{"aria-hidden":!0,style:{position:"absolute",right:"-4%",bottom:"-4%",width:"28%",height:"28%",minWidth:6,minHeight:6,borderRadius:"999px",background:p,boxShadow:u?`0 0 0 2px var(--scout-chrome-surface, var(--hud-bg, #000)), 0 0 0 4px color-mix(in oklab, ${p} 32%, transparent)`:"0 0 0 2px var(--scout-chrome-surface, var(--hud-bg, #000))"}})]})}function E({sprite:i,glow:s=!1,inset:h=!1}){const{cells:c,palette:o}=i,e=t*.07,l=t*.2,g=t*.24;return r.jsx("svg",{viewBox:`0 0 ${w} ${w}`,shapeRendering:"geometricPrecision",style:{display:"block",width:h?"72%":"100%",height:"auto",aspectRatio:"1 / 1",overflow:"visible",filter:s?`drop-shadow(0 1.6px 5px ${o.glow})`:void 0},children:c.flatMap((p,u)=>p.map((n,x)=>{if(n==="off")return null;const a=x*t,d=u*t,f=`${u}-${x}`;if(n==="eye")return r.jsxs("g",{className:"sprite-cell sprite-cell--eye",children:[r.jsx("rect",{x:a+e,y:d+e,width:t-e*2,height:t-e*2,rx:l,fill:o.sclera}),r.jsx("circle",{cx:a+t/2,cy:d+t*.52,r:g,fill:o.ink})]},f);const m=n==="accent"?o.accent:n==="mouth"?o.ink:o.body,b=n==="accent"?"sprite-cell sprite-cell--accent":"sprite-cell";return r.jsx("rect",{className:b,x:a+e,y:d+e,width:t-e*2,height:t-e*2,rx:l,fill:m},f)}))})}const R={in_turn:{l:.75,c:.16},in_flight:{l:.72,c:.14},needs_attention:{l:.78,c:.16},callable:{l:.73,c:.13},blocked:{l:.5,c:.02}};function T(i){const s=i.harness?.trim().toLowerCase();return{hue:s?y[s]:void 0,tone:R[j(i.state??null)]}}export{N as S,T as a};
@@ -1 +1 @@
1
- import{j as n}from"./index-NRbRrZw-.js";import{t as r,a as e}from"./status-tone-BM_zuRy1.js";function f({tone:s,children:t,variant:o="chip",className:i,title:a}){const l=o==="pill"?"s-pill":"sys-chip",p=o==="pill"?`s-pill-${r(s)}`:`sys-chip-${e(s)}`,c=i?`${l} ${p} ${i}`:`${l} ${p}`;return n.jsx("span",{className:c,title:a,children:t})}export{f as S};
1
+ import{j as n}from"./index-BZovGpDk.js";import{t as r,a as e}from"./status-tone-BM_zuRy1.js";function f({tone:s,children:t,variant:o="chip",className:i,title:a}){const l=o==="pill"?"s-pill":"sys-chip",p=o==="pill"?`s-pill-${r(s)}`:`sys-chip-${e(s)}`,c=i?`${l} ${p} ${i}`:`${l} ${p}`;return n.jsx("span",{className:c,title:a,children:t})}export{f as S};
@@ -1,2 +1,2 @@
1
- import{r as c,j as e}from"./index-NRbRrZw-.js";import{S as ps}from"./SlidePanel-BLrLF9dt.js";import{H as A,h as $}from"./HarnessMark-CEzmPFHC.js";import{a as Q}from"./api-DEHEgJ9m.js";import{d as ms,n as hs}from"./time-Dhsh_2EG.js";import{i as fs,c as js,s as es,T as ts,d as as}from"./tail-display-DcliDVkW.js";import{u as xs}from"./tail-events-B7BrDaFi.js";import{o as ys}from"./openContent-C6XO6kr5.js";import{u as gs}from"./Provider-Cd-QZltN.js";import"./lane-edit-display-C_Aujldz.js";import"./index-BWHgHrtv.js";import"./provider-Bq0ScH3v.js";import"./router-Bx1tiwVe.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-D4dHTRkt.js";import"./sse-QSbhyq9A.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-D4vuKzOL.js";import"./DocumentFocusViewer-CetjnYut.js";import"./createLucideIcon-Da0lq809.js";import"./TextDocumentSurface-B29xZNlI.js";import"./file-text-BGVkHS4_.js";import"./x-DuzAbpk5.js";import"./chevron-right-CV7sEVBS.js";import"./code-xml-CPzpZkhu.js";import"./arrow-left-B0CdJdAC.js";import"./arrow-right-YRBoTTyf.js";import"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-feLCB3Zm.js";import"./NewChatComposer-BPsg8shF.js";import"./text-B2UZi3l9.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-Be0T8xv2.js";import"./conversation-model-CIzM7aXT.js";import"./index-CD2foMB8.js";import"./NewChatOrigin-CCiPg_WR.js";import"./chevron-down-Jh540uf3.js";import"./search-HmdKXdtR.js";import"./chunk-HRAB3GC3-BYQZ1LOn.js";const Z=5e3,bs=500,ks=3e4,ls="openscout:tail-display-mode",E={"scout-managed":"scout","hudson-managed":"hudson",unattributed:"native"},rs={"scout-managed":"sc","hudson-managed":"hu",unattributed:"na"};function Ns(s){return s?.trim().toLowerCase()||"unknown"}function ws(s,t){const l=new Map,o=s?.transcripts?.length?s.transcripts:s?.processes.length?s.processes:t;for(const r of o){const i=Ns(r.source);l.set(i,(l.get(i)??0)+1)}return[...l.entries()].map(([r,i])=>({source:r,count:i})).sort((r,i)=>i.count-r.count||r.source.localeCompare(i.source))}function Ss(s){return ms(s,{milliseconds:!0})||"—"}function $s(s,t,l=1){return`${s.id}:${s.ts}:${l}:${t}`}function Es(){try{const s=sessionStorage.getItem(ls);if(s==="work"||s==="all")return s}catch{}return"work"}const Is=/\b(error|failed|failure|exception|panic|timeout|timed out|refused|crash|fatal|non[- ]?zero|exit(?:ed)? with code [1-9])\b/i,Ts=/\b(warn(?:ing)?|deprecated|retry|rate limit|rate-limited|blocked|skipped|interrupted|aborted|stale|conflict|permission denied|denied)\b/i;function is(s){const t=s.replace(/[_-]+/g," ");return Is.test(t)?"error":Ts.test(t)?"warn":null}function v(s){return!(s==null||s===!1||typeof s=="string"&&!s.trim())}function Y(s,t=0){if(s==null||t>4||typeof s=="string"||typeof s!="object")return null;if(Array.isArray(s)){let o=null;for(const r of s.slice(0,40)){const i=Y(r,t+1);if(i==="error")return"error";o??=i}return o}let l=null;for(const[o,r]of Object.entries(s).slice(0,80)){const i=o.toLowerCase();if((i==="is_error"||i==="failed")&&r===!0||i==="error"&&v(r))return"error";if((i==="warning"||i==="warn")&&v(r)&&(l="warn"),typeof r=="string"&&(i==="level"||i==="severity"||i==="status"||i==="type"||i==="subtype")){const d=is(r);if(d==="error")return"error";l??=d}const m=Y(r,t+1);if(m==="error")return"error";l??=m}return l}function ns(s){const t=Y(s.raw);if(t==="error")return"error";if(s.kind==="tool-result"||s.kind==="system"||s.kind==="other"){const l=is(s.summary);return l==="error"?"error":t??l}return t}function Cs(s,t){return t==="all"?!0:t==="warn-plus"?s!=null:s==="error"}function Ls(s){switch(s){case"errors-only":return"errors";case"warn-plus":return"warnings or errors";case"all":return"all session events"}}function _s(s,t,l=null,o="all"){if(!t)return!0;const r=E[s.harness],i=l==="error"?"error failed failure issue":l==="warn"?"warn warning issue":"",d=(o==="context"?[s.project,s.cwd,s.sessionId,s.source,s.harness,r,i]:[s.summary,s.project,s.cwd,s.sessionId,s.source,s.harness,r,i]).join(" ").toLowerCase(),u=t.toLowerCase().split("|").map(p=>p.trim()).filter(Boolean);return u.length===0?!0:u.some(p=>d.includes(p))}function Rs(s){try{return JSON.stringify(s,null,2)??""}catch{return String(s)}}function Ds(s){return[["time",P(s.ts)],["kind",s.kind],["project",s.project],["cwd",s.cwd||"—"],["session",s.sessionId||"—"],["source",$(s.source)],["origin",E[s.harness]],["pid",s.parentPid!=null?`${s.pid} <- ${s.parentPid}`:String(s.pid)]].map(([l,o])=>`${l}: ${o}`).join(`
2
- `)}function Ms(s){const t=$(s.source),l=E[s.harness],o=Rs(s.raw??s),r=[{label:"Time",value:P(s.ts)},{label:"Kind",value:s.kind},{label:"Project",value:s.project},{label:"Cwd",value:s.cwd||"—"},{label:"Session",value:s.sessionId||"—"},{label:"Source",value:t},{label:"Origin",value:l},{label:"Pid",value:s.parentPid!=null?`${s.pid} <- ${s.parentPid}`:String(s.pid)}];return{source:"tail",focus:"item",title:`${s.kind} · ${t}`,meta:`${P(s.ts)} · ${s.project} · ${es(s.sessionId)}`,body:s.summary,metadata:r,copy:[{label:"Copy message",value:s.summary},{label:"Copy metadata",value:Ds(s)},{label:"Copy raw",value:o}],action:s.sessionId?{label:"Open session",route:{view:"sessions",sessionId:s.sessionId}}:null}}function ss(s){if(typeof window>"u")return;const t=window;t.scoutOpsDetailSnapshot=s,window.dispatchEvent(new CustomEvent("scout:ops-detail",{detail:s}))}function Ie({navigate:s,initialFilter:t,variant:l="tail",chrome:o="full",filterLabel:r,filterScope:i="all"}={}){const{route:m}=gs(),d=l==="issues",u=o==="embedded",[p,f]=c.useState([]),[b,os]=c.useState(null),[y,I]=c.useState(t??""),[O,T]=c.useState(!!t&&!u),[j,H]=c.useState("warn-plus"),[x,B]=c.useState(!1),[w,z]=c.useState(0),[k,J]=c.useState(null),[g,U]=c.useState(Es),C=c.useRef(null),N=c.useRef(null),cs=c.useRef(!0),us=c.useCallback(a=>{f(n=>n.length>=Z?[...n.slice(n.length-Z+1),a]:[...n,a])},[]);xs(us),c.useEffect(()=>{I(t??""),T(!!t&&!u)},[u,t]),c.useEffect(()=>{try{sessionStorage.setItem(ls,g)}catch{}},[g]),c.useEffect(()=>{let a=!1;return(async()=>{try{const n=new URLSearchParams({limit:String(bs)});(u||t)&&n.set("transcripts","true");const h=await Q(`/api/tail/recent?${n.toString()}`);a||f(h.events??[])}catch{}})(),()=>{a=!0}},[u,t]),c.useEffect(()=>{if(!u)return ss(k?Ms(k):null),()=>ss(null)},[u,k]);const K=c.useCallback(async()=>{try{const a=await Q("/api/tail/discover");os(a)}catch{}},[]);c.useEffect(()=>{K();const a=setInterval(()=>{K()},ks);return()=>clearInterval(a)},[K]);const L=c.useMemo(()=>p.map(a=>({event:a,severity:ns(a)})),[p]),V=c.useMemo(()=>{let a=0,n=0;for(const h of L)h.severity==="error"&&n++,h.severity==="warn"&&a++;return{warn:a,error:n,total:a+n}},[L]),G=c.useMemo(()=>L.filter(({event:a,severity:n})=>d&&!Cs(n,j)?!1:_s(a,y,n,i)),[L,y,i,j,d]),S=c.useMemo(()=>{const a=G.filter(({event:n})=>g==="all"||!fs(n));return js(a.map(n=>({event:n.event,meta:n.severity})))},[g,G]);c.useLayoutEffect(()=>{const a=C.current;if(a){if(x){z(n=>n+1);return}a.scrollTop=a.scrollHeight}},[S,x]);const ds=c.useCallback(()=>{const a=C.current;if(!a)return;const h=a.scrollHeight-a.scrollTop-a.clientHeight<24;cs.current=h,h?(B(!1),z(0)):x||B(!0)},[x]),W=c.useCallback(a=>{I(a),T(!0),requestAnimationFrame(()=>N.current?.focus())},[]),q=c.useCallback(a=>{!a||!s||ys(s,{view:"sessions",sessionId:a},{returnTo:m})},[s,m]),_=c.useCallback(()=>{const a=C.current;a&&(a.scrollTop=a.scrollHeight,B(!1),z(0))},[]);c.useEffect(()=>{if(u)return;const a=n=>{const h=n.target,D=h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||(h?.isContentEditable??!1);if(n.key==="/"&&!D){n.preventDefault(),T(!0),requestAnimationFrame(()=>N.current?.focus());return}if(n.key==="Escape"&&O&&document.activeElement===N.current){n.preventDefault(),T(!1),N.current?.blur(),I("");return}(n.key==="g"||n.key==="G")&&!D&&(n.preventDefault(),_())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[u,O,_]);const R=b?.totals?.transcripts??b?.transcripts?.length??0,X=c.useMemo(()=>ws(b,p),[b,p]);return e.jsxs("div",{className:`s-tail s-tail--${o}`,children:[e.jsxs("div",{className:`s-tail-status${d?" s-tail-status--issues":""}`,children:[e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--metrics",children:[e.jsx("span",{className:`s-tail-live-dot${x?" s-tail-live-dot--paused":""}`,"aria-hidden":"true"}),e.jsx("span",{className:`s-tail-status-state${x?" s-tail-status-state--paused":""}`,children:x?"paused":"live"})]}),!d&&e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--display",children:[e.jsx("span",{className:"s-tail-status-key",children:"view"}),e.jsxs("span",{className:"s-tail-issue-filter",role:"group","aria-label":"Tail display mode",children:[e.jsx("button",{type:"button",className:`s-tail-issue-filter-btn${g==="work"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>U("work"),"aria-pressed":g==="work",children:"work"}),e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${g==="all"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>U("all"),"aria-pressed":g==="all",children:["all:",G.length]})]})]}),d&&e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--issues",children:[e.jsx("span",{className:"s-tail-status-key",children:"flt"}),e.jsxs("span",{className:"s-tail-issue-filter",role:"group","aria-label":"Alert severity filter",children:[e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${j==="errors-only"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>H("errors-only"),"aria-pressed":j==="errors-only",children:["err:",V.error]}),e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${j==="warn-plus"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>H("warn-plus"),"aria-pressed":j==="warn-plus",children:["wrn+:",V.total]}),e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${j==="all"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>H("all"),"aria-pressed":j==="all",children:["all:",p.length]})]})]}),e.jsx("span",{className:"s-tail-status-spacer"}),e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--harnesses",children:[e.jsx("span",{className:"s-tail-status-key",children:"src"}),e.jsx("span",{className:"s-tail-status-inline",children:X.length>0?X.slice(0,4).map(a=>e.jsxs("span",{className:"s-tail-status-src",children:[e.jsx(A,{harness:a.source,size:10,title:null}),e.jsxs("span",{children:[$(a.source),":",a.count]})]},a.source)):e.jsx("span",{className:"s-tail-status-src",children:"—"})})]}),y&&u&&e.jsxs("span",{className:"s-tail-status-filter",title:y,children:["q=",r??"filtered"]})]}),O&&e.jsxs("div",{className:"s-tail-filter",children:[e.jsx("span",{className:"s-tail-filter-prompt",children:"/"}),e.jsx("input",{ref:N,className:"s-tail-filter-input",value:y,placeholder:"substring across summary · project · session",onChange:a=>I(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),N.current?.blur())},autoFocus:!0,spellCheck:!1}),e.jsx("span",{className:"s-tail-filter-hint",children:"esc to clear"})]}),e.jsxs("div",{className:"s-tail-body",ref:C,onScroll:ds,children:[S.length===0?e.jsxs("div",{className:"s-tail-empty",children:[e.jsxs("span",{className:"s-tail-empty-title",children:[d?"No alert events":"Waiting for events",e.jsx("span",{className:"s-tail-empty-cursor","aria-hidden":"true"})]}),e.jsx("span",{className:"s-tail-empty-body",children:y?u?e.jsxs(e.Fragment,{children:["no events match ",e.jsx("strong",{children:r??"this work filter"})]}):e.jsxs(e.Fragment,{children:["no events match filter ",e.jsx("strong",{children:y})]}):d?e.jsxs(e.Fragment,{children:["no ",Ls(j)," in the buffered session tail"]}):R?e.jsxs(e.Fragment,{children:["watching ",R," transcript",R===1?"":"s"," · no events yet"]}):e.jsx(e.Fragment,{children:"agent tool calls, messages, and system events stream here"})}),!R&&!y&&e.jsxs("span",{className:"s-tail-empty-hint",children:["Start a session to see traffic",e.jsx("span",{className:"s-tail-empty-hint-sep",children:" · "}),e.jsx("code",{children:"scout watch --tail"})]})]}):S.map(({event:a,repeatCount:n,meta:h},D)=>e.jsx(As,{event:a,repeatCount:n,issueSeverity:h,selected:k===a,onSelect:J,onProjectClick:W,onSessionClick:q},$s(a,D,n))),x&&w>0&&e.jsxs("div",{className:"s-tail-divider",onClick:_,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),_())},role:"button",tabIndex:0,"aria-label":`Resume live tail · ${w} new`,children:["── paused · ",w," new · click or press G to jump back to live ──"]})]}),u?e.jsxs("div",{className:"s-tail-keys s-tail-keys--embedded",children:[e.jsxs("span",{children:[S.length," / ",p.length," lines buffered"]}),x&&w>0&&e.jsxs("span",{children:[w," new"]})]}):e.jsxs("div",{className:"s-tail-keys",children:[e.jsxs("span",{children:[e.jsx("kbd",{children:"j"}),e.jsx("kbd",{children:"k"})," scroll"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"/"})," filter"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"G"})," live"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"esc"})," clr"]}),e.jsx("span",{className:"s-tail-keys-spacer"}),e.jsxs("span",{children:[S.length,"/",p.length," buf"]})]}),u&&k&&e.jsx(Ps,{event:k,onClose:()=>J(null),onProjectClick:W,onSessionClick:q})]})}function As({event:s,repeatCount:t=1,issueSeverity:l,selected:o,onSelect:r,onProjectClick:i,onSessionClick:m}){const d=E[s.harness],u=$(s.source),p=l?` s-tail-row--issue s-tail-row--issue-${l}`:"";return e.jsxs("div",{className:`s-tail-row s-tail-row--${s.kind}${p}${o?" s-tail-row--selected":""}`,role:"button",tabIndex:0,onClick:()=>r(s),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r(s))},children:[e.jsx("span",{className:"s-tail-cell-time",children:Ss(s.ts)}),e.jsxs("span",{className:"s-tail-token s-tail-token--harness",title:`source: ${u}`,children:[e.jsx(A,{harness:s.source,size:11,title:null}),e.jsx("span",{className:"s-tail-harness-label",children:u})]}),e.jsx("span",{className:"s-tail-token s-tail-token--origin",title:`origin: ${d}`,children:rs[s.harness]}),e.jsxs("span",{className:"s-tail-cell-context",children:[e.jsx(F,{className:"s-tail-link s-tail-link--project",onClick:i?()=>i(s.project):void 0,title:`Filter to ${s.project}`,children:s.project}),e.jsx("span",{className:"s-tail-sep",children:"/"}),e.jsx(F,{className:"s-tail-link s-tail-link--session",onClick:m&&s.sessionId?()=>m(s.sessionId):void 0,title:s.sessionId?`Open session ${s.sessionId}`:void 0,children:es(s.sessionId)}),e.jsx("span",{className:"s-tail-sep",children:":"}),e.jsx("span",{className:"s-tail-cell-pid",title:s.pid>0?`pid ${s.pid}`:"file-backed log",children:s.pid>0?s.pid:"log"})]}),e.jsxs("span",{className:"s-tail-kind",title:s.kind,children:[e.jsx("span",{className:`s-tail-glyph s-tail-glyph--${s.kind}`,children:ts[s.kind]}),e.jsx("span",{className:"s-tail-kind-label",children:as[s.kind]})]}),e.jsxs("span",{className:"s-tail-summary",children:[l==="error"?"✕ ":l==="warn"?"△ ":null,s.summary,t>1?e.jsxs("span",{className:"s-tail-repeat",title:`${t} identical events collapsed`,children:[" ","×",t]}):null]})]})}function F({className:s,onClick:t,title:l,children:o}){return t?e.jsx("span",{className:`${s} s-tail-link--active`,role:"link",tabIndex:0,title:l,onClick:r=>{r.stopPropagation(),t()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),t())},children:o}):e.jsx("span",{className:s,title:l,children:o})}function P(s){const t=hs(s);if(t===null)return"—";const l=new Date(t),o=l.getFullYear(),r=String(l.getMonth()+1).padStart(2,"0"),i=String(l.getDate()).padStart(2,"0"),m=String(l.getHours()).padStart(2,"0"),d=String(l.getMinutes()).padStart(2,"0"),u=String(l.getSeconds()).padStart(2,"0"),p=String(l.getMilliseconds()).padStart(3,"0");return`${o}-${r}-${i} ${m}:${d}:${u}.${p}`}function M(s){return(JSON.stringify(s,null,2)??"undefined").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(?:\\.|[^"\\])*"\s*:)|("(?:\\.|[^"\\])*")|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,(o,r,i,m,d)=>r?`<span class="s-tail-jk">${r}</span>`:i?`<span class="s-tail-js">${i}</span>`:m?`<span class="s-tail-jl">${m}</span>`:d?`<span class="s-tail-jn">${d}</span>`:o)}function Fs(s){if(!s||typeof s!="object")return null;const t=s,o=t.message?.content??t.content;return Array.isArray(o)?o:typeof o=="string"?[{type:"text",text:o}]:null}function Ps({event:s,onClose:t,onProjectClick:l,onSessionClick:o}){const[r,i]=c.useState(!0),m=E[s.harness],d=$(s.source),u=ns(s),p=Fs(s.raw);return e.jsxs(ps,{open:!0,onClose:t,side:"right",owner:"openscout.tail",resizable:!0,defaultSize:620,minSize:400,maxSize:960,ariaLabel:"Tail event detail",children:[e.jsxs("div",{className:"s-slide-header s-tail-sheet-header",children:[e.jsx("span",{className:`s-tail-glyph s-tail-glyph--${s.kind}`,children:ts[s.kind]}),e.jsx("span",{className:"s-tail-sheet-kind",children:as[s.kind]}),u&&e.jsx("span",{className:`s-tail-token s-tail-token--issue-${u}`,children:u==="error"?"✕":"△"}),e.jsxs("span",{className:"s-tail-token s-tail-token--harness",children:[e.jsx(A,{harness:s.source,size:12,title:null}),e.jsx("span",{className:"s-tail-harness-label",children:d})]}),e.jsx("span",{className:"s-tail-token s-tail-token--origin",title:`origin: ${m}`,children:rs[s.harness]}),e.jsx("span",{className:"s-slide-spacer"}),e.jsx("span",{className:"s-tail-sheet-time",children:P(s.ts)}),e.jsx("button",{type:"button",className:"s-slide-close",onClick:t,"aria-label":"Close",children:"×"})]}),e.jsxs("div",{className:"s-slide-body s-tail-sheet-body",children:[e.jsx("section",{className:"s-tail-sheet-section",children:e.jsxs("div",{className:"s-tail-sheet-grid",children:[e.jsx("span",{className:"s-tail-sheet-key",children:"project"}),e.jsx("span",{className:"s-tail-sheet-val",children:e.jsx(F,{className:"s-tail-link s-tail-link--project",onClick:l?()=>l(s.project):void 0,title:`Filter to ${s.project}`,children:s.project})}),e.jsx("span",{className:"s-tail-sheet-key",children:"cwd"}),e.jsx("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:s.cwd||"—"}),e.jsx("span",{className:"s-tail-sheet-key",children:"session"}),e.jsx("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:e.jsx(F,{className:"s-tail-link s-tail-link--session",onClick:o&&s.sessionId?()=>o(s.sessionId):void 0,title:s.sessionId?`Open session ${s.sessionId}`:void 0,children:s.sessionId||"—"})}),e.jsx("span",{className:"s-tail-sheet-key",children:"harness"}),e.jsxs("span",{className:"s-tail-sheet-val s-tail-sheet-val--harness",children:[e.jsx(A,{harness:s.source,size:13,title:null}),e.jsx("span",{children:d})]}),e.jsx("span",{className:"s-tail-sheet-key",children:"origin"}),e.jsx("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:m}),e.jsx("span",{className:"s-tail-sheet-key",children:"pid"}),e.jsxs("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:[s.pid,s.parentPid!=null?` ← ${s.parentPid}`:""]})]})}),e.jsxs("section",{className:"s-tail-sheet-section",children:[e.jsx("h4",{className:"s-tail-sheet-h",children:"summary"}),e.jsx("div",{className:"s-tail-sheet-summary",children:s.summary})]}),p&&p.length>0&&e.jsxs("section",{className:"s-tail-sheet-section",children:[e.jsx("h4",{className:"s-tail-sheet-h",children:"content"}),p.map((f,b)=>e.jsx(Os,{block:f},b))]}),e.jsxs("section",{className:"s-tail-sheet-section",children:[e.jsxs("button",{type:"button",className:"s-tail-sheet-toggle",onClick:()=>i(f=>!f),children:[r?"▾":"▸"," raw event"]}),r&&e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(s.raw??s)}})]})]})]})}function Os({block:s}){if(s.type==="text"){const t=s.text??"";return e.jsx("div",{className:"s-tail-sheet-text",children:t})}if(s.type==="tool_use"){const t=s;return e.jsxs("div",{className:"s-tail-sheet-block s-tail-sheet-block--tool",children:[e.jsxs("div",{className:"s-tail-sheet-block-head",children:[e.jsx("span",{className:"s-tail-glyph s-tail-glyph--tool",children:"*"}),e.jsx("span",{className:"s-tail-sheet-block-title",children:t.name??"tool_use"})]}),e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(t.input??{})}})]})}if(s.type==="tool_result"){const t=s,l=typeof t.content=="string";return e.jsxs("div",{className:`s-tail-sheet-block s-tail-sheet-block--tool-result${t.is_error?" s-tail-sheet-block--err":""}`,children:[e.jsxs("div",{className:"s-tail-sheet-block-head",children:[e.jsx("span",{className:"s-tail-glyph s-tail-glyph--tool-result",children:"="}),e.jsxs("span",{className:"s-tail-sheet-block-title",children:["tool_result",t.is_error?" · error":""]})]}),l?e.jsx("pre",{className:"s-tail-sheet-pre",children:t.content}):e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(t.content??{})}})]})}return e.jsxs("div",{className:"s-tail-sheet-block",children:[e.jsxs("div",{className:"s-tail-sheet-block-head",children:[e.jsx("span",{className:"s-tail-glyph s-tail-glyph--other",children:"·"}),e.jsx("span",{className:"s-tail-sheet-block-title",children:s.type})]}),e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(s)}})]})}export{Ie as TailView};
1
+ import{r as c,j as e}from"./index-BZovGpDk.js";import{S as ps}from"./SlidePanel-RFXJpfUa.js";import{H as A,h as $}from"./HarnessMark-DrE57dUq.js";import{a as Q}from"./api-h5zurxmi.js";import{d as ms,n as hs}from"./time-Dhsh_2EG.js";import{i as fs,c as js,s as es,T as ts,b as as}from"./tail-display-BRcJltQa.js";import{u as xs}from"./tail-events-C12pfUax.js";import{o as ys}from"./openContent-C6XO6kr5.js";import{u as gs}from"./Provider-p-xuaAoE.js";import"./lane-edit-display-C_Aujldz.js";import"./index-BWHgHrtv.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-Bb0EOcU9.js";import"./surface-activity-B1rgWB1i.js";import"./colors-BtO5_zlx.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";const Z=5e3,bs=500,ks=3e4,ls="openscout:tail-display-mode",E={"scout-managed":"scout","hudson-managed":"hudson",unattributed:"native"},rs={"scout-managed":"sc","hudson-managed":"hu",unattributed:"na"};function Ns(s){return s?.trim().toLowerCase()||"unknown"}function ws(s,t){const l=new Map,o=s?.transcripts?.length?s.transcripts:s?.processes.length?s.processes:t;for(const r of o){const i=Ns(r.source);l.set(i,(l.get(i)??0)+1)}return[...l.entries()].map(([r,i])=>({source:r,count:i})).sort((r,i)=>i.count-r.count||r.source.localeCompare(i.source))}function Ss(s){return ms(s,{milliseconds:!0})||"—"}function $s(s,t,l=1){return`${s.id}:${s.ts}:${l}:${t}`}function Es(){try{const s=sessionStorage.getItem(ls);if(s==="work"||s==="all")return s}catch{}return"work"}const Is=/\b(error|failed|failure|exception|panic|timeout|timed out|refused|crash|fatal|non[- ]?zero|exit(?:ed)? with code [1-9])\b/i,Ts=/\b(warn(?:ing)?|deprecated|retry|rate limit|rate-limited|blocked|skipped|interrupted|aborted|stale|conflict|permission denied|denied)\b/i;function is(s){const t=s.replace(/[_-]+/g," ");return Is.test(t)?"error":Ts.test(t)?"warn":null}function v(s){return!(s==null||s===!1||typeof s=="string"&&!s.trim())}function Y(s,t=0){if(s==null||t>4||typeof s=="string"||typeof s!="object")return null;if(Array.isArray(s)){let o=null;for(const r of s.slice(0,40)){const i=Y(r,t+1);if(i==="error")return"error";o??=i}return o}let l=null;for(const[o,r]of Object.entries(s).slice(0,80)){const i=o.toLowerCase();if((i==="is_error"||i==="failed")&&r===!0||i==="error"&&v(r))return"error";if((i==="warning"||i==="warn")&&v(r)&&(l="warn"),typeof r=="string"&&(i==="level"||i==="severity"||i==="status"||i==="type"||i==="subtype")){const d=is(r);if(d==="error")return"error";l??=d}const m=Y(r,t+1);if(m==="error")return"error";l??=m}return l}function ns(s){const t=Y(s.raw);if(t==="error")return"error";if(s.kind==="tool-result"||s.kind==="system"||s.kind==="other"){const l=is(s.summary);return l==="error"?"error":t??l}return t}function Cs(s,t){return t==="all"?!0:t==="warn-plus"?s!=null:s==="error"}function Ls(s){switch(s){case"errors-only":return"errors";case"warn-plus":return"warnings or errors";case"all":return"all session events"}}function _s(s,t,l=null,o="all"){if(!t)return!0;const r=E[s.harness],i=l==="error"?"error failed failure issue":l==="warn"?"warn warning issue":"",d=(o==="context"?[s.project,s.cwd,s.sessionId,s.source,s.harness,r,i]:[s.summary,s.project,s.cwd,s.sessionId,s.source,s.harness,r,i]).join(" ").toLowerCase(),u=t.toLowerCase().split("|").map(p=>p.trim()).filter(Boolean);return u.length===0?!0:u.some(p=>d.includes(p))}function Rs(s){try{return JSON.stringify(s,null,2)??""}catch{return String(s)}}function Ds(s){return[["time",P(s.ts)],["kind",s.kind],["project",s.project],["cwd",s.cwd||"—"],["session",s.sessionId||"—"],["source",$(s.source)],["origin",E[s.harness]],["pid",s.parentPid!=null?`${s.pid} <- ${s.parentPid}`:String(s.pid)]].map(([l,o])=>`${l}: ${o}`).join(`
2
+ `)}function Ms(s){const t=$(s.source),l=E[s.harness],o=Rs(s.raw??s),r=[{label:"Time",value:P(s.ts)},{label:"Kind",value:s.kind},{label:"Project",value:s.project},{label:"Cwd",value:s.cwd||"—"},{label:"Session",value:s.sessionId||"—"},{label:"Source",value:t},{label:"Origin",value:l},{label:"Pid",value:s.parentPid!=null?`${s.pid} <- ${s.parentPid}`:String(s.pid)}];return{source:"tail",focus:"item",title:`${s.kind} · ${t}`,meta:`${P(s.ts)} · ${s.project} · ${es(s.sessionId)}`,body:s.summary,metadata:r,copy:[{label:"Copy message",value:s.summary},{label:"Copy metadata",value:Ds(s)},{label:"Copy raw",value:o}],action:s.sessionId?{label:"Open session",route:{view:"sessions",sessionId:s.sessionId}}:null}}function ss(s){if(typeof window>"u")return;const t=window;t.scoutOpsDetailSnapshot=s,window.dispatchEvent(new CustomEvent("scout:ops-detail",{detail:s}))}function Le({navigate:s,initialFilter:t,variant:l="tail",chrome:o="full",filterLabel:r,filterScope:i="all"}={}){const{route:m}=gs(),d=l==="issues",u=o==="embedded",[p,f]=c.useState([]),[b,os]=c.useState(null),[y,I]=c.useState(t??""),[O,T]=c.useState(!!t&&!u),[j,H]=c.useState("warn-plus"),[x,B]=c.useState(!1),[w,z]=c.useState(0),[k,J]=c.useState(null),[g,U]=c.useState(Es),C=c.useRef(null),N=c.useRef(null),cs=c.useRef(!0),us=c.useCallback(a=>{f(n=>n.length>=Z?[...n.slice(n.length-Z+1),a]:[...n,a])},[]);xs(us),c.useEffect(()=>{I(t??""),T(!!t&&!u)},[u,t]),c.useEffect(()=>{try{sessionStorage.setItem(ls,g)}catch{}},[g]),c.useEffect(()=>{let a=!1;return(async()=>{try{const n=new URLSearchParams({limit:String(bs)});(u||t)&&n.set("transcripts","true");const h=await Q(`/api/tail/recent?${n.toString()}`);a||f(h.events??[])}catch{}})(),()=>{a=!0}},[u,t]),c.useEffect(()=>{if(!u)return ss(k?Ms(k):null),()=>ss(null)},[u,k]);const K=c.useCallback(async()=>{try{const a=await Q("/api/tail/discover");os(a)}catch{}},[]);c.useEffect(()=>{K();const a=setInterval(()=>{K()},ks);return()=>clearInterval(a)},[K]);const L=c.useMemo(()=>p.map(a=>({event:a,severity:ns(a)})),[p]),V=c.useMemo(()=>{let a=0,n=0;for(const h of L)h.severity==="error"&&n++,h.severity==="warn"&&a++;return{warn:a,error:n,total:a+n}},[L]),G=c.useMemo(()=>L.filter(({event:a,severity:n})=>d&&!Cs(n,j)?!1:_s(a,y,n,i)),[L,y,i,j,d]),S=c.useMemo(()=>{const a=G.filter(({event:n})=>g==="all"||!fs(n));return js(a.map(n=>({event:n.event,meta:n.severity})))},[g,G]);c.useLayoutEffect(()=>{const a=C.current;if(a){if(x){z(n=>n+1);return}a.scrollTop=a.scrollHeight}},[S,x]);const ds=c.useCallback(()=>{const a=C.current;if(!a)return;const h=a.scrollHeight-a.scrollTop-a.clientHeight<24;cs.current=h,h?(B(!1),z(0)):x||B(!0)},[x]),W=c.useCallback(a=>{I(a),T(!0),requestAnimationFrame(()=>N.current?.focus())},[]),q=c.useCallback(a=>{!a||!s||ys(s,{view:"sessions",sessionId:a},{returnTo:m})},[s,m]),_=c.useCallback(()=>{const a=C.current;a&&(a.scrollTop=a.scrollHeight,B(!1),z(0))},[]);c.useEffect(()=>{if(u)return;const a=n=>{const h=n.target,D=h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||(h?.isContentEditable??!1);if(n.key==="/"&&!D){n.preventDefault(),T(!0),requestAnimationFrame(()=>N.current?.focus());return}if(n.key==="Escape"&&O&&document.activeElement===N.current){n.preventDefault(),T(!1),N.current?.blur(),I("");return}(n.key==="g"||n.key==="G")&&!D&&(n.preventDefault(),_())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[u,O,_]);const R=b?.totals?.transcripts??b?.transcripts?.length??0,X=c.useMemo(()=>ws(b,p),[b,p]);return e.jsxs("div",{className:`s-tail s-tail--${o}`,children:[e.jsxs("div",{className:`s-tail-status${d?" s-tail-status--issues":""}`,children:[e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--metrics",children:[e.jsx("span",{className:`s-tail-live-dot${x?" s-tail-live-dot--paused":""}`,"aria-hidden":"true"}),e.jsx("span",{className:`s-tail-status-state${x?" s-tail-status-state--paused":""}`,children:x?"paused":"live"})]}),!d&&e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--display",children:[e.jsx("span",{className:"s-tail-status-key",children:"view"}),e.jsxs("span",{className:"s-tail-issue-filter",role:"group","aria-label":"Tail display mode",children:[e.jsx("button",{type:"button",className:`s-tail-issue-filter-btn${g==="work"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>U("work"),"aria-pressed":g==="work",children:"work"}),e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${g==="all"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>U("all"),"aria-pressed":g==="all",children:["all:",G.length]})]})]}),d&&e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--issues",children:[e.jsx("span",{className:"s-tail-status-key",children:"flt"}),e.jsxs("span",{className:"s-tail-issue-filter",role:"group","aria-label":"Alert severity filter",children:[e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${j==="errors-only"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>H("errors-only"),"aria-pressed":j==="errors-only",children:["err:",V.error]}),e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${j==="warn-plus"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>H("warn-plus"),"aria-pressed":j==="warn-plus",children:["wrn+:",V.total]}),e.jsxs("button",{type:"button",className:`s-tail-issue-filter-btn${j==="all"?" s-tail-issue-filter-btn--active":""}`,onClick:()=>H("all"),"aria-pressed":j==="all",children:["all:",p.length]})]})]}),e.jsx("span",{className:"s-tail-status-spacer"}),e.jsxs("span",{className:"s-tail-status-cluster s-tail-status-cluster--harnesses",children:[e.jsx("span",{className:"s-tail-status-key",children:"src"}),e.jsx("span",{className:"s-tail-status-inline",children:X.length>0?X.slice(0,4).map(a=>e.jsxs("span",{className:"s-tail-status-src",children:[e.jsx(A,{harness:a.source,size:10,title:null}),e.jsxs("span",{children:[$(a.source),":",a.count]})]},a.source)):e.jsx("span",{className:"s-tail-status-src",children:"—"})})]}),y&&u&&e.jsxs("span",{className:"s-tail-status-filter",title:y,children:["q=",r??"filtered"]})]}),O&&e.jsxs("div",{className:"s-tail-filter",children:[e.jsx("span",{className:"s-tail-filter-prompt",children:"/"}),e.jsx("input",{ref:N,className:"s-tail-filter-input",value:y,placeholder:"substring across summary · project · session",onChange:a=>I(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),N.current?.blur())},autoFocus:!0,spellCheck:!1}),e.jsx("span",{className:"s-tail-filter-hint",children:"esc to clear"})]}),e.jsxs("div",{className:"s-tail-body",ref:C,onScroll:ds,children:[S.length===0?e.jsxs("div",{className:"s-tail-empty",children:[e.jsxs("span",{className:"s-tail-empty-title",children:[d?"No alert events":"Waiting for events",e.jsx("span",{className:"s-tail-empty-cursor","aria-hidden":"true"})]}),e.jsx("span",{className:"s-tail-empty-body",children:y?u?e.jsxs(e.Fragment,{children:["no events match ",e.jsx("strong",{children:r??"this work filter"})]}):e.jsxs(e.Fragment,{children:["no events match filter ",e.jsx("strong",{children:y})]}):d?e.jsxs(e.Fragment,{children:["no ",Ls(j)," in the buffered session tail"]}):R?e.jsxs(e.Fragment,{children:["watching ",R," transcript",R===1?"":"s"," · no events yet"]}):e.jsx(e.Fragment,{children:"agent tool calls, messages, and system events stream here"})}),!R&&!y&&e.jsxs("span",{className:"s-tail-empty-hint",children:["Start a session to see traffic",e.jsx("span",{className:"s-tail-empty-hint-sep",children:" · "}),e.jsx("code",{children:"scout watch --tail"})]})]}):S.map(({event:a,repeatCount:n,meta:h},D)=>e.jsx(As,{event:a,repeatCount:n,issueSeverity:h,selected:k===a,onSelect:J,onProjectClick:W,onSessionClick:q},$s(a,D,n))),x&&w>0&&e.jsxs("div",{className:"s-tail-divider",onClick:_,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),_())},role:"button",tabIndex:0,"aria-label":`Resume live tail · ${w} new`,children:["── paused · ",w," new · click or press G to jump back to live ──"]})]}),u?e.jsxs("div",{className:"s-tail-keys s-tail-keys--embedded",children:[e.jsxs("span",{children:[S.length," / ",p.length," lines buffered"]}),x&&w>0&&e.jsxs("span",{children:[w," new"]})]}):e.jsxs("div",{className:"s-tail-keys",children:[e.jsxs("span",{children:[e.jsx("kbd",{children:"j"}),e.jsx("kbd",{children:"k"})," scroll"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"/"})," filter"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"G"})," live"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"esc"})," clr"]}),e.jsx("span",{className:"s-tail-keys-spacer"}),e.jsxs("span",{children:[S.length,"/",p.length," buf"]})]}),u&&k&&e.jsx(Ps,{event:k,onClose:()=>J(null),onProjectClick:W,onSessionClick:q})]})}function As({event:s,repeatCount:t=1,issueSeverity:l,selected:o,onSelect:r,onProjectClick:i,onSessionClick:m}){const d=E[s.harness],u=$(s.source),p=l?` s-tail-row--issue s-tail-row--issue-${l}`:"";return e.jsxs("div",{className:`s-tail-row s-tail-row--${s.kind}${p}${o?" s-tail-row--selected":""}`,role:"button",tabIndex:0,onClick:()=>r(s),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r(s))},children:[e.jsx("span",{className:"s-tail-cell-time",children:Ss(s.ts)}),e.jsxs("span",{className:"s-tail-token s-tail-token--harness",title:`source: ${u}`,children:[e.jsx(A,{harness:s.source,size:11,title:null}),e.jsx("span",{className:"s-tail-harness-label",children:u})]}),e.jsx("span",{className:"s-tail-token s-tail-token--origin",title:`origin: ${d}`,children:rs[s.harness]}),e.jsxs("span",{className:"s-tail-cell-context",children:[e.jsx(F,{className:"s-tail-link s-tail-link--project",onClick:i?()=>i(s.project):void 0,title:`Filter to ${s.project}`,children:s.project}),e.jsx("span",{className:"s-tail-sep",children:"/"}),e.jsx(F,{className:"s-tail-link s-tail-link--session",onClick:m&&s.sessionId?()=>m(s.sessionId):void 0,title:s.sessionId?`Open session ${s.sessionId}`:void 0,children:es(s.sessionId)}),e.jsx("span",{className:"s-tail-sep",children:":"}),e.jsx("span",{className:"s-tail-cell-pid",title:s.pid>0?`pid ${s.pid}`:"file-backed log",children:s.pid>0?s.pid:"log"})]}),e.jsxs("span",{className:"s-tail-kind",title:s.kind,children:[e.jsx("span",{className:`s-tail-glyph s-tail-glyph--${s.kind}`,children:ts[s.kind]}),e.jsx("span",{className:"s-tail-kind-label",children:as[s.kind]})]}),e.jsxs("span",{className:"s-tail-summary",children:[l==="error"?"✕ ":l==="warn"?"△ ":null,s.summary,t>1?e.jsxs("span",{className:"s-tail-repeat",title:`${t} identical events collapsed`,children:[" ","×",t]}):null]})]})}function F({className:s,onClick:t,title:l,children:o}){return t?e.jsx("span",{className:`${s} s-tail-link--active`,role:"link",tabIndex:0,title:l,onClick:r=>{r.stopPropagation(),t()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),t())},children:o}):e.jsx("span",{className:s,title:l,children:o})}function P(s){const t=hs(s);if(t===null)return"—";const l=new Date(t),o=l.getFullYear(),r=String(l.getMonth()+1).padStart(2,"0"),i=String(l.getDate()).padStart(2,"0"),m=String(l.getHours()).padStart(2,"0"),d=String(l.getMinutes()).padStart(2,"0"),u=String(l.getSeconds()).padStart(2,"0"),p=String(l.getMilliseconds()).padStart(3,"0");return`${o}-${r}-${i} ${m}:${d}:${u}.${p}`}function M(s){return(JSON.stringify(s,null,2)??"undefined").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(?:\\.|[^"\\])*"\s*:)|("(?:\\.|[^"\\])*")|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,(o,r,i,m,d)=>r?`<span class="s-tail-jk">${r}</span>`:i?`<span class="s-tail-js">${i}</span>`:m?`<span class="s-tail-jl">${m}</span>`:d?`<span class="s-tail-jn">${d}</span>`:o)}function Fs(s){if(!s||typeof s!="object")return null;const t=s,o=t.message?.content??t.content;return Array.isArray(o)?o:typeof o=="string"?[{type:"text",text:o}]:null}function Ps({event:s,onClose:t,onProjectClick:l,onSessionClick:o}){const[r,i]=c.useState(!0),m=E[s.harness],d=$(s.source),u=ns(s),p=Fs(s.raw);return e.jsxs(ps,{open:!0,onClose:t,side:"right",owner:"openscout.tail",resizable:!0,defaultSize:620,minSize:400,maxSize:960,ariaLabel:"Tail event detail",children:[e.jsxs("div",{className:"s-slide-header s-tail-sheet-header",children:[e.jsx("span",{className:`s-tail-glyph s-tail-glyph--${s.kind}`,children:ts[s.kind]}),e.jsx("span",{className:"s-tail-sheet-kind",children:as[s.kind]}),u&&e.jsx("span",{className:`s-tail-token s-tail-token--issue-${u}`,children:u==="error"?"✕":"△"}),e.jsxs("span",{className:"s-tail-token s-tail-token--harness",children:[e.jsx(A,{harness:s.source,size:12,title:null}),e.jsx("span",{className:"s-tail-harness-label",children:d})]}),e.jsx("span",{className:"s-tail-token s-tail-token--origin",title:`origin: ${m}`,children:rs[s.harness]}),e.jsx("span",{className:"s-slide-spacer"}),e.jsx("span",{className:"s-tail-sheet-time",children:P(s.ts)}),e.jsx("button",{type:"button",className:"s-slide-close",onClick:t,"aria-label":"Close",children:"×"})]}),e.jsxs("div",{className:"s-slide-body s-tail-sheet-body",children:[e.jsx("section",{className:"s-tail-sheet-section",children:e.jsxs("div",{className:"s-tail-sheet-grid",children:[e.jsx("span",{className:"s-tail-sheet-key",children:"project"}),e.jsx("span",{className:"s-tail-sheet-val",children:e.jsx(F,{className:"s-tail-link s-tail-link--project",onClick:l?()=>l(s.project):void 0,title:`Filter to ${s.project}`,children:s.project})}),e.jsx("span",{className:"s-tail-sheet-key",children:"cwd"}),e.jsx("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:s.cwd||"—"}),e.jsx("span",{className:"s-tail-sheet-key",children:"session"}),e.jsx("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:e.jsx(F,{className:"s-tail-link s-tail-link--session",onClick:o&&s.sessionId?()=>o(s.sessionId):void 0,title:s.sessionId?`Open session ${s.sessionId}`:void 0,children:s.sessionId||"—"})}),e.jsx("span",{className:"s-tail-sheet-key",children:"harness"}),e.jsxs("span",{className:"s-tail-sheet-val s-tail-sheet-val--harness",children:[e.jsx(A,{harness:s.source,size:13,title:null}),e.jsx("span",{children:d})]}),e.jsx("span",{className:"s-tail-sheet-key",children:"origin"}),e.jsx("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:m}),e.jsx("span",{className:"s-tail-sheet-key",children:"pid"}),e.jsxs("span",{className:"s-tail-sheet-val s-tail-sheet-val--mono",children:[s.pid,s.parentPid!=null?` ← ${s.parentPid}`:""]})]})}),e.jsxs("section",{className:"s-tail-sheet-section",children:[e.jsx("h4",{className:"s-tail-sheet-h",children:"summary"}),e.jsx("div",{className:"s-tail-sheet-summary",children:s.summary})]}),p&&p.length>0&&e.jsxs("section",{className:"s-tail-sheet-section",children:[e.jsx("h4",{className:"s-tail-sheet-h",children:"content"}),p.map((f,b)=>e.jsx(Os,{block:f},b))]}),e.jsxs("section",{className:"s-tail-sheet-section",children:[e.jsxs("button",{type:"button",className:"s-tail-sheet-toggle",onClick:()=>i(f=>!f),children:[r?"▾":"▸"," raw event"]}),r&&e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(s.raw??s)}})]})]})]})}function Os({block:s}){if(s.type==="text"){const t=s.text??"";return e.jsx("div",{className:"s-tail-sheet-text",children:t})}if(s.type==="tool_use"){const t=s;return e.jsxs("div",{className:"s-tail-sheet-block s-tail-sheet-block--tool",children:[e.jsxs("div",{className:"s-tail-sheet-block-head",children:[e.jsx("span",{className:"s-tail-glyph s-tail-glyph--tool",children:"*"}),e.jsx("span",{className:"s-tail-sheet-block-title",children:t.name??"tool_use"})]}),e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(t.input??{})}})]})}if(s.type==="tool_result"){const t=s,l=typeof t.content=="string";return e.jsxs("div",{className:`s-tail-sheet-block s-tail-sheet-block--tool-result${t.is_error?" s-tail-sheet-block--err":""}`,children:[e.jsxs("div",{className:"s-tail-sheet-block-head",children:[e.jsx("span",{className:"s-tail-glyph s-tail-glyph--tool-result",children:"="}),e.jsxs("span",{className:"s-tail-sheet-block-title",children:["tool_result",t.is_error?" · error":""]})]}),l?e.jsx("pre",{className:"s-tail-sheet-pre",children:t.content}):e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(t.content??{})}})]})}return e.jsxs("div",{className:"s-tail-sheet-block",children:[e.jsxs("div",{className:"s-tail-sheet-block-head",children:[e.jsx("span",{className:"s-tail-glyph s-tail-glyph--other",children:"·"}),e.jsx("span",{className:"s-tail-sheet-block-title",children:s.type})]}),e.jsx("pre",{className:"s-tail-sheet-json",dangerouslySetInnerHTML:{__html:M(s)}})]})}export{Le as TailView};
@@ -0,0 +1 @@
1
+ import{j as e,r as o,n as Ve,o as Ye}from"./index-BZovGpDk.js";/* empty css */import{u as Es}from"./ContextMenu-DnFcmfMR.js";import{a as me}from"./api-h5zurxmi.js";import{c as xs}from"./clipboard-e3fSpeo7.js";import{d as Ws}from"./colors-BtO5_zlx.js";import{r as Te,S as Ge,a as Je,w as Ie,s as bt,b as xt,d as yt,c as jt,e as As,f as Ce,g as gt}from"./terminal-relay-BgfVJXIL.js";import{p as Ms,g as St,f as Ls,b as Ds,s as F,d as Be,h as He,r as zs,i as Os,j as wt,k as Nt,m as Ct,t as Ps,n as vt}from"./terminal-sessions-AmSgHklm.js";import{H as Tt,u as Xe,a as It,c as Rt,h as Et,b as Wt,A as At}from"./HerdrSession-1eVu9Owj.js";import{D as Mt,c as Lt,P as Dt,s as _e,T as zt,a as Ot,d as _s}from"./session-table-BUPq9Viy.js";import{u as Qe,T as Pt}from"./chunk-JTPDIGGW-DX2eTIQ_.js";import{u as $e,L as Ze}from"./chunk-YOZR3KYS-oS9dlQCI.js";import{q as _t}from"./terminal-takeover--05EYhJm.js";import{t as $t}from"./time-Dhsh_2EG.js";import{u as $s}from"./Provider-p-xuaAoE.js";import{B as ue}from"./BackToPicker-D6WgIDb-.js";import{T as Ft}from"./TmuxPeek-IaWqCgyJ.js";import{R as es}from"./refresh-cw-DtF8xPqX.js";import{c as ss}from"./createLucideIcon-DCq_3fQn.js";import{P as Q}from"./plus-BAI0t5g9.js";import{T as U}from"./terminal-xGf_F3y7.js";import{S as Kt}from"./runtime-picker-BXKJbLot.js";import{X as pe}from"./x-CrGUKNRv.js";import{E as Ut}from"./eye-DkU59kfl.js";import{E as Fs}from"./external-link-Dd8xaveL.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./HarnessMark-DrE57dUq.js";import"./check-BfA0T8UD.js";import"./copy-C79v_7D-.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./arrow-down-DxxPnPwh.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./index-DiiEQwdc.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./loader-circle-B-l2Wj3-.js";/* empty css */import"./voice-levels-Dcr3jglk.js";const Ks=6,Us=2;function Re(s){if(s.layout?.mode)return{mode:s.layout.mode,...s.layout.columns===void 0?{}:{columns:Bt(s.layout.columns)}};const t=s.cellCount??0,r=We(s.columns??Us);return t<=1?{mode:"solo"}:r>=t?{mode:"lanes",columns:r}:{mode:"grid",columns:r}}function Ee(s,t){const r=Math.max(1,Math.floor(t.tileCount)||1);if(s.mode==="solo")return 1;if(s.columns===void 0||s.columns==="dynamic"){const i=s.mode==="lanes"?r:Math.ceil(Math.sqrt(r));return Math.max(1,Math.min(Ks,i))}return We(s.columns)}function Bt(s){return s==="dynamic"?"dynamic":We(s)}function Ht(s){if(s.mode==="solo")return"Solo";const t=s.mode==="lanes"?"Lanes":"Grid";return s.columns===void 0||s.columns==="dynamic"?`${t} · dynamic`:`${t} · ${s.columns} column${s.columns===1?"":"s"}`}function We(s){return typeof s!="number"||!Number.isFinite(s)?Us:Math.max(1,Math.min(Ks,Math.floor(s)))}const qt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Vt=ss("ellipsis",qt);const Yt=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],de=ss("grid-2x2",Yt);const Gt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Jt=ss("zap",Gt),ts=6;function Xt(s="main",t="Main"){return{version:1,activeWorkspaceId:s,workspaces:[{id:s,name:t,tiles:[]}]}}function ns(){return{version:1,activeWorkspaceId:"",workspaces:[]}}function ys(s,t,r={}){const i=()=>r.allowEmpty?ns():Xt();if(!s||typeof s!="object")return i();const l=s;if(!Array.isArray(l.workspaces))return i();const m=[],d=new Set;for(const c of l.workspaces){if(!c||typeof c!="object")continue;const x=typeof c.id=="string"?c.id.trim():"",y=typeof c.name=="string"?c.name.trim():"";if(!x||!y||d.has(x)||!Array.isArray(c.tiles))continue;d.add(x);const S=typeof c.purpose=="string"?c.purpose.trim():"",w=Zt(c.columns),A=Qt(c.layout),M=typeof c.updatedAt=="number"&&Number.isFinite(c.updatedAt)&&c.updatedAt>=0?c.updatedAt:null;m.push({id:x,name:y,tiles:c.tiles.filter(t),...S?{purpose:S}:{},...w?{columns:w}:{},...A?{layout:A}:{},...M===null?{}:{updatedAt:M}})}return m.length===0?i():{version:1,activeWorkspaceId:typeof l.activeWorkspaceId=="string"&&d.has(l.activeWorkspaceId)?l.activeWorkspaceId:m[0].id,workspaces:m}}function Qt(s){if(!s||typeof s!="object")return null;const t=s;if(t.mode!=="solo"&&t.mode!=="lanes"&&t.mode!=="grid")return null;if(t.columns===void 0)return{mode:t.mode};if(t.columns==="dynamic")return{mode:t.mode,columns:"dynamic"};const r=We(t.columns);return{mode:t.mode,columns:r}}function Zt(s){if(typeof s!="number"||!Number.isFinite(s))return null;const t=Math.floor(s);return t<1?null:Math.min(t,ts)}function js(s,t){const r=t.id.trim();if(!r)return s;const i={...t,id:r},m=s.workspaces.some(d=>d.id===r)?s.workspaces.map(d=>d.id===r?i:d):[i,...s.workspaces];return{...s,activeWorkspaceId:r,workspaces:m}}function gs(s,t,r){const i=s.workspaces.findIndex(f=>f.id===t);if(i<0)return s;const l=s.workspaces[i],m={...l,...r};return Object.keys(r).every(f=>l[f]===m[f])?s:{...s,workspaces:s.workspaces.map((f,c)=>c===i?m:f)}}function en(s,t){return t===s.activeWorkspaceId||!s.workspaces.some(r=>r.id===t)?s:{...s,activeWorkspaceId:t}}function sn(s,t,r={}){if(s.workspaces.length<=1)return r.allowEmpty&&s.workspaces[0]?.id===t?ns():s;const i=s.workspaces.findIndex(d=>d.id===t);if(i<0)return s;const l=s.workspaces.filter(d=>d.id!==t),m=s.activeWorkspaceId===t?l[Math.min(i,l.length-1)].id:s.activeWorkspaceId;return{...s,activeWorkspaceId:m,workspaces:l}}function tn(s,t,r){return r>1?{axis:"horizontal",edge:s.x<t.left+t.width/2?"before":"after"}:{axis:"vertical",edge:s.y<t.top+t.height/2?"before":"after"}}function nn(s,t,r,i){if(t===r)return[...s];const l=s.findIndex(y=>y.id===t),m=s.findIndex(y=>y.id===r);if(l<0||m<0)return[...s];const d=[...s],[f]=d.splice(l,1);if(!f)return[...s];const c=d.findIndex(y=>y.id===r),x=i==="after"?c+1:c;return d.splice(Math.max(0,x),0,f),d}const rn="openscout.terminal.workspaces.v1",an=2,on="openscout.terminal.workspace-view.v1",Fe=2;function ve(s){const t=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);return`${s}-${Date.now().toString(36)}-${t}`}const ln=24;function Bs(s,t,r){const i=t.replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^[^A-Za-z0-9_]+/u,"").slice(0,ln).replace(/-+$/u,""),l=cn(JSON.stringify([r,t,s]));return`scout-${s}-${i||"cell"}-${l}`}function cn(s){let t=2166136261;for(let r=0;r<s.length;r+=1)t^=s.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}function oe(s,t="shell"){return{id:ve("cell"),kind:"fresh",backend:s,agent:t}}function Ss(s){if(!s||typeof s!="object")return!1;const t=s;return typeof t.id!="string"||!t.id.trim()?!1:t.kind==="fresh"?typeof t.backend=="string"&&typeof t.agent=="string":t.kind==="registered"?typeof t.terminalSessionId=="string"&&typeof t.terminalSurfaceKey=="string":!1}function ws(s){return{id:s.id,name:s.name,...s.purpose?{purpose:s.purpose}:{},columns:s.columns,...s.layout?{layout:s.layout}:{},updatedAt:s.updatedAt,tiles:s.cells.map(t=>t.surfaceId&&t.terminalSessionId?{id:t.id,kind:"registered",terminalSessionId:t.terminalSessionId,terminalSurfaceKey:t.surfaceId}:{id:t.id,kind:"fresh",backend:mn(t.intent.hostId)?t.intent.hostId:"pty",agent:"shell"})}}function Ke(s,t={}){return{id:s.id,name:s.name,purpose:s.purpose??"",columns:Ee(Re({layout:s.layout,columns:s.columns,cellCount:s.tiles.length}),{tileCount:s.tiles.length}),layout:Re({layout:s.layout,columns:s.columns,cellCount:s.tiles.length}),cells:s.tiles.map(r=>r.kind==="registered"?{id:r.id,surfaceId:r.terminalSurfaceKey,terminalSessionId:r.terminalSessionId,intent:dn(r,t.sessions??[])}:{id:r.id,intent:{hostId:r.backend,sessionName:r.backend==="pty"?null:Bs(r.backend,r.id,s.id)}})}}function dn(s,t){const r=Ms(s.terminalSurfaceKey),i=t.find(l=>l.id===s.terminalSessionId||l.surfaces.some(m=>St(m,s.terminalSurfaceKey)));return{...r?{hostId:r.backend,sessionName:r.hostSession}:{},...i?.cwd?{cwd:i.cwd}:{},...i?.harness?{harness:i.harness}:{},...i?.resumeCommand?{resumeCommand:i.resumeCommand}:{}}}function mn(s){return s==="pty"||s==="tmux"||s==="zellij"||s==="herdr"}function un(s){if(!Array.isArray(s))return ys(s,Ss,{allowEmpty:!0});const t=s.flatMap(r=>{if(!r||typeof r!="object")return[];const i=r;if(typeof i.id!="string"||!i.id.trim())return[];const l=Array.isArray(i.cells)?i.cells:[];return[{id:i.id,name:typeof i.name=="string"&&i.name.trim()?i.name:i.id,purpose:i.purpose,columns:i.columns,updatedAt:i.updatedAt,tiles:l.map((m,d)=>({...m,id:`${i.id}-${d}`}))}]});return ys({activeWorkspaceId:t[0]?.id??"",workspaces:t},Ss,{allowEmpty:!0})}function pn(s,t,r){const i=s.find(l=>l.id===t);return i?i.capabilities.control.includes(r)||i.capabilities.harnessControl.includes(r):!1}function hn(s,t){return s.find(r=>r.id===t)??null}function fn(s){return[{value:"pty",label:"Shell",detail:"Disposable local shell",relayAttach:!0},...s.filter(t=>t.availability.installed&&t.capabilities.create).map(t=>({value:t.id,label:t.label,detail:t.description,relayAttach:t.capabilities.relayAttach})).sort((t,r)=>Number(r.relayAttach)-Number(t.relayAttach)||t.value.localeCompare(r.value))]}async function kn(){return me("/api/terminal-workspaces")}async function Ns(s){return(await me(`/api/terminal-workspaces/${encodeURIComponent(s.id)}`,{method:"PUT",body:JSON.stringify(s)})).workspace}async function bn(s,t){return me(`/api/terminal-workspaces/${encodeURIComponent(s)}/cells/${encodeURIComponent(t)}/revive`,{method:"POST",body:"{}"})}async function xn(s){return(await me(`/api/terminal-workspaces/${encodeURIComponent(s)}`,{method:"DELETE"})).deleted}function yn(s){const t=new Map;for(const r of s?.cells??[])t.set(r.cellId,r);return t}const Cs="scout:terminal-send-line";function jn(s){const t=s.detail;if(!t||typeof t!="object"||!("line"in t))return null;const r=t.line;return typeof r=="string"&&r.trim().length>0?r:null}const le=typeof window>"u"?o.useEffect:o.useLayoutEffect,gn="openscout.terminal.picker-view.v1",vs={mode:"grid",columns:"dynamic"},Ts=[{mode:"solo",label:"Solo",detail:"One terminal, full width",minimumCells:1},{mode:"lanes",label:"Lanes",detail:"Side by side, one row",minimumCells:2},{mode:"grid",label:"Grid",detail:"Rows and columns",minimumCells:4}],Sn=[{value:"shell",label:"Shell"},{value:"codex",label:"Codex"},{value:"claude",label:"Claude"},{value:"pi",label:"Pi"}],Ue="'JetBrainsMono Nerd Font', 'JetBrainsMonoNL Nerd Font', 'MesloLGS Nerd Font Mono', 'Hack Nerd Font Mono', 'JetBrains Mono', monospace",Is=s=>{},wn=()=>{};function Nn(){if(typeof window>"u")return{fontFamily:Ue,fontSize:13};const s=new URLSearchParams(window.location.search),t=s.get("terminalFontFamily")?.trim(),r=Number(s.get("terminalFontSize"));return{fontFamily:t?`'${t.replaceAll("'","\\'")}', ${Ue}`:Ue,fontSize:Number.isFinite(r)&&r>=9&&r<=32?r:13}}function rs(s){const t=Nn();return e.jsx(Pt,{...s,renderer:s.renderer??"dom",fontFamily:t.fontFamily,fontSize:t.fontSize})}function Cn(s,t){const[r,i]=o.useState({state:"loading",sessions:[]}),l=o.useCallback(()=>{i(d=>({state:"loading",sessions:d.sessions})),Ls({includeDiscovered:!0}).then(d=>{i({state:"ready",sessions:d})}).catch(d=>{i(f=>({state:"failed",sessions:f.sessions,error:d instanceof Error?d.message:String(d)}))})},[]);return o.useEffect(()=>{l()},[l]),{target:o.useMemo(()=>zs(r.sessions,s,t),[r.sessions,s,t]),loadState:r.state,loadSessions:l,hasSessionHint:!!s}}function vn(s,t,r){const i=bt(t,r),[l,m]=o.useState(i?{state:"preparing"}:{state:"ready"}),[d,f]=o.useState(0);return o.useEffect(()=>{if(!i||!s){m({state:"ready"});return}let c=!1;return m({state:"preparing"}),me(`/api/agents/${encodeURIComponent(s)}/session-catalog`).then(x=>{if(x.resumeCommand)return _t({command:x.resumeCommand,cwd:x.resumeCwd,agentId:s})}).then(()=>{c||m({state:"ready"})}).catch(x=>{c||m({state:"failed",error:x instanceof Error?x.message:String(x)})}),()=>{c=!0}},[s,i,d]),{ready:l.state==="ready",label:l.state==="failed"?"TAKEOVER FAILED":"PREPARING TAKEOVER",status:l.state==="failed"?l.error:"Resolving live session...",onRetry:l.state==="failed"?()=>f(c=>c+1):void 0}}function Tn(s){const{agentId:t,agent:r,mode:i,navigate:l,registeredTarget:m,showContextMenu:d}=s,{hosts:f}=Xe(),c=r?Ws(r.name):"var(--accent)",x=o.useRef(null),y=m?Ps(m.surface):Te(r),S=i==="observe",w=m?.session.cwd??r?.cwd??r?.projectRoot??void 0,A=Ve(),M=Ye(),h=xt({agentId:t,agent:r,registeredTarget:m,terminalSurface:y,relayUrl:A,harness:m?.session.harness??r?.harness,cwd:w,mode:i}),j=Qe({url:h.scopedRelayUrl,healthUrl:M,autoConnect:!0,...S?{}:{sessionKey:h.relayStorageSessionKey},...h.surfaceOptions??{},...h.orphanTTL?{orphanTTL:h.orphanTTL}:{},...h.cwd?{cwd:h.cwd}:{},...h.relayAgent?{agent:h.relayAgent}:{},controlMode:h.controlMode});le(()=>{j.resize(Ge,Je)},[j.resize]);const C=o.useMemo(()=>S?{...j,sendInput:Is,sendLine:Is,restart:wn}:j,[S,j]),v=yt({agentId:t,registeredTarget:m}),z=Ie(v,i),R=o.useCallback(()=>{const b=x.current;b?.querySelector(".xterm-helper-textarea")?.focus(),b?.querySelector(".xterm")?.focus()},[]);o.useEffect(()=>{const b=_=>{const $=_.detail?.line;return typeof $=="string"&&$.length>0?$:null},O=_=>{const $=b(_);!$||S||(C.sendInput($),R())},D=_=>{const $=b(_);!$||S||(C.sendLine($),R())};return window.addEventListener("scout:terminal-send-input",O),window.addEventListener("scout:terminal-send-line",D),()=>{window.removeEventListener("scout:terminal-send-input",O),window.removeEventListener("scout:terminal-send-line",D)}},[R,S,C]);const E=o.useCallback(b=>y?jt(y,b):null,[y]),W=o.useCallback(()=>{xs(As(z))},[z]),H=o.useCallback(()=>{S||!navigator.clipboard?.readText||navigator.clipboard.readText().then(b=>{b&&C.sendInput(b)}).catch(()=>{})},[S,C]),B=o.useCallback(()=>{Ce(h.relayStorageSessionKey);const b=E("detach");if(b){b.finally(()=>j.disconnect());return}j.disconnect()},[h.relayStorageSessionKey,j,E]),k=o.useCallback(()=>{Ce(h.relayStorageSessionKey);const b=E("force-quit-bridge");if(b){b.finally(()=>{j.connect(),window.setTimeout(R,250)});return}j.connect(),window.setTimeout(R,250)},[h.relayStorageSessionKey,R,j,E]),N=o.useCallback(()=>{if(S)return;const b=E("interrupt");b?b.catch(()=>C.sendInput("")):C.sendInput(""),R()},[R,S,E,C]),L=o.useCallback(()=>{if(S)return;const b=E("quit");b?b.catch(()=>C.sendInput("")):C.sendInput(""),R()},[R,S,E,C]),K=o.useCallback(()=>{if(S)return;const b=E("stop-job");if(b){b.finally(R);return}R()},[R,S,E]),ne=o.useCallback(()=>{if(Ce(h.relayStorageSessionKey),y&&!window.confirm(`Force quit Claude in ${He(y.sessionName)}?`))return;const b=E("force-quit");if(b){b.finally(()=>j.disconnect());return}const O=j.sessionId;if(!O){j.disconnect();return}gt(O).catch(()=>{}).finally(()=>j.disconnect())},[h.relayStorageSessionKey,j,E,y]),re=o.useCallback(()=>{if(!y||!window.confirm(`Restart Claude in ${He(y.sessionName)} and resume its latest session?`))return;Ce(h.relayStorageSessionKey);const b=E("restart-resume");b&&b.finally(()=>{j.disconnect(),window.setTimeout(()=>{j.connect(),window.setTimeout(R,250)},600)})},[h.relayStorageSessionKey,R,j,E,y]),ae=o.useCallback(b=>{l(Ie(v,b))},[l,v]),Z=o.useCallback(()=>{l(v)},[l,v]),ee=o.useMemo(()=>{const b=y?.backend??null,O=$=>pn(f,b,$),D=[];(!b||O("detach"))&&D.push({kind:"action",label:"Leave this session running",onSelect:B}),D.push({kind:"action",label:"Reconnect",onSelect:k});const _=[];return O("restart-resume")&&_.push({kind:"action",label:"Restart Claude and resume",onSelect:re}),O("force-quit")&&_.push({kind:"action",label:"Force quit Claude",onSelect:ne}),_.length>0&&D.push({kind:"separator"},..._),D},[B,ne,k,re,f,y?.backend]),he=o.useCallback(b=>{d(b,ee)},[ee,d]),se=o.useCallback(b=>{const O=typeof window>"u"?"":window.getSelection()?.toString()??"",D=[];O.trim()&&D.push({kind:"action",label:"Copy Selection",shortcut:"⌘C",onSelect:()=>{xs(O)}}),S||D.push({kind:"action",label:"Paste",shortcut:"⌘V",onSelect:H},{kind:"action",label:"Send Ctrl-C",shortcut:"⌃C",onSelect:N},{kind:"action",label:"Quit With Ctrl-D",shortcut:"⌃D",onSelect:L},{kind:"action",label:"Stop Running Job",onSelect:K}),D.length>0&&D.push({kind:"separator"}),D.push({kind:"action",label:"Focus Terminal",onSelect:R},...ee,{kind:"separator"},{kind:"action",label:S?"Open Takeover":"Open Observe",onSelect:()=>ae(S?"takeover":"observe")},{kind:"action",label:"Open Summary",onSelect:Z},{kind:"action",label:"Copy Terminal Link",onSelect:W}),d(b,D)},[W,R,N,ae,Z,H,L,S,ee,d,K]);return{color:c,terminalBodyRef:x,terminalSurface:y,readOnly:S,relay:j,terminalRelay:C,healthUrl:M,scopedRelayUrl:h.scopedRelayUrl,hasViewActions:!!(m||y),canSignalTerminal:!S&&!!(y||j.status==="connected"),canStopTerminalJob:!S&&!!y,handleSessionMenu:he,handleTerminalContextMenu:se,openMode:ae,openSummary:Z,interruptTerminal:N,quitTerminal:L,stopTerminalJob:K,terminalRouteBase:v}}function In({agent:s,agentId:t,color:r,navigate:i,label:l,status:m,onRetry:d}){return e.jsxs("div",{className:"s-term",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:i,className:"s-term-back"}),s&&e.jsxs("div",{className:"s-term-agent",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:r},children:s.name[0]?.toUpperCase()}),e.jsx("span",{className:"s-term-agent-name",children:s.name}),s.handle&&e.jsxs("span",{className:"s-term-agent-handle",children:["@",s.handle]})]}),e.jsx("span",{className:"s-term-label",children:l}),e.jsx("div",{className:"s-term-status",children:d?"OFFLINE":"CONNECTING"})]}),e.jsx("div",{className:"s-term-body s-term-body--placeholder",children:e.jsxs("div",{className:"s-term-placeholder",children:[e.jsx("span",{children:m}),d&&e.jsx("button",{type:"button",onClick:d,children:"Retry"})]})})]})}function Rn({target:s,navigate:t}){const r=o.useMemo(()=>Ds([s.session]).find(d=>F(d.surface)===F(s.surface)),[s]),i={view:"terminal",terminalSessionId:s.session.id,terminalSurfaceKey:F(s.surface)},l=Nt(s.session,s.surface),m=Ct(s);return e.jsx("div",{className:"s-term s-term--summary",children:e.jsxs("div",{className:"s-term-summary",children:[e.jsxs("div",{className:"s-term-summary-main",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),e.jsxs("div",{className:"s-term-summary-mark",children:[e.jsx(U,{size:18,strokeWidth:1.7}),e.jsx("span",{children:"Terminal"})]}),e.jsxs("div",{className:"s-term-summary-heading",children:[e.jsx("h1",{children:r?.title??s.surface.sessionName}),e.jsxs("p",{children:[s.surface.backend," · ",l]})]}),e.jsxs("div",{className:"s-term-summary-actions",children:[e.jsxs("button",{type:"button",className:"s-term-summary-action s-term-summary-action--primary",onClick:()=>t(Ie(i,"takeover")),children:[e.jsx(Ze,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Enter"})]}),e.jsxs("button",{type:"button",className:"s-term-summary-action",onClick:()=>t(Ie(i,"observe")),children:[e.jsx(Ut,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Observe"})]})]})]}),e.jsx("div",{className:"s-term-summary-preview",children:e.jsx(Ft,{surface:Ps(s.surface),lines:26,columns:112,pollMs:3e4,idlePollMs:3e4,className:"s-term-preview-peek"})}),e.jsx("dl",{className:"s-term-summary-details",children:m.map(([d,f])=>e.jsxs("div",{className:"s-term-summary-detail",children:[e.jsx("dt",{children:d}),e.jsx("dd",{title:f,children:f})]},d))})]})})}function as({agentId:s,agent:t,mode:r,navigate:i,registeredTarget:l,embedded:m=!1,tileActions:d}){const f=Es(),c=Tn({agentId:s,agent:t,mode:r,navigate:i,registeredTarget:l,showContextMenu:f});return e.jsxs("div",{className:`s-term${m?" s-term--embedded":""}`,children:[e.jsxs("div",{className:"s-term-bar s-term-bar--takeover",children:[e.jsxs("div",{className:"s-term-bar-left",children:[!m&&e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:i,className:"s-term-back"}),t&&e.jsxs("div",{className:"s-term-agent",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"18px",background:c.color},children:t.name[0]?.toUpperCase()}),e.jsx("span",{className:"s-term-agent-name",children:t.name}),t.handle&&e.jsxs("span",{className:"s-term-agent-handle",children:["@",t.handle]})]}),l&&e.jsxs("div",{className:"s-term-registered-chip",children:[e.jsx(U,{size:14,strokeWidth:1.8}),e.jsx("span",{children:l.session.harness}),e.jsx("span",{children:l.session.sourceSessionId})]})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:c.terminalSurface?c.readOnly?"TERMINAL OBSERVE":"TERMINAL TAKEOVER":"TAKEOVER"}),c.terminalSurface&&e.jsx("span",{className:"s-term-session",title:c.terminalSurface.sessionName,children:He(c.terminalSurface.sessionName)})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[c.hasViewActions&&e.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--view","aria-label":"Terminal view actions",children:[l&&e.jsx("button",{type:"button",className:"s-term-action",onClick:c.openSummary,title:"Leave the terminal canvas and show the session summary",children:"Summary"}),c.terminalSurface&&e.jsx("button",{type:"button",className:"s-term-action",onClick:()=>c.openMode(c.readOnly?"takeover":"observe"),title:c.readOnly?"Switch to interactive takeover":"Switch to read-only terminal observe",children:c.readOnly?"Takeover":"Observe"})]}),(c.canSignalTerminal||c.canStopTerminalJob)&&e.jsxs("div",{className:"s-term-action-cluster s-term-action-cluster--signals","aria-label":"Terminal signal actions",children:[c.canSignalTerminal&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.interruptTerminal,title:"Send Ctrl-C to the terminal",children:[e.jsx(Jt,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Ctrl-C"})]}),c.canSignalTerminal&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.quitTerminal,title:"Send Ctrl-D / EOF to the terminal",children:[e.jsx(Dt,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Quit"})]}),c.canStopTerminalJob&&e.jsxs("button",{type:"button",className:"s-term-action s-term-action--warn",onClick:c.stopTerminalJob,title:"Stop Claude's current shell/tool job without quitting Claude",children:[e.jsx(Kt,{size:12,strokeWidth:2}),e.jsx("span",{children:"Stop Job"})]})]}),e.jsxs("button",{type:"button",className:"s-term-action s-term-session-menu",onClick:c.handleSessionMenu,title:"Open session, recovery, and external handoff actions",children:[e.jsx(Vt,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Session"})]}),e.jsx("div",{className:"s-term-status",children:c.relay.status==="connected"?"LIVE":c.relay.status==="connecting"?"CONNECTING":"OFFLINE"}),d]})]}),e.jsx("div",{ref:c.terminalBodyRef,className:"s-term-body",onContextMenuCapture:c.handleTerminalContextMenu,children:e.jsx(rs,{relay:c.terminalRelay,readOnly:c.readOnly,quiet:!0,configItems:[...c.terminalSurface?[{label:"backend",value:c.terminalSurface.backend},{label:"session",value:c.terminalSurface.sessionName},...c.terminalSurface.paneId?[{label:"pane",value:c.terminalSurface.paneId}]:[],...c.terminalSurface.socketDir?[{label:"socket",value:c.terminalSurface.socketDir}]:[],{label:"mode",value:c.readOnly?"read-only":"takeover"}]:[],{label:"ws",value:c.scopedRelayUrl},{label:"health",value:c.healthUrl}]})})]})}function En({terminalSessionId:s,terminalSurfaceKey:t,mode:r,navigate:i}){const{target:l,loadState:m,loadSessions:d,hasSessionHint:f}=Cn(s,t);return l&&r?e.jsx(as,{agent:null,mode:r,navigate:i,registeredTarget:l},`${F(l.surface)}:${r}`):l?e.jsx(Rn,{target:l,navigate:i}):e.jsx("div",{className:"s-term s-term--empty-main",children:e.jsxs("div",{className:"s-term-empty-main-mark",children:[e.jsx(U,{size:18,strokeWidth:1.6}),e.jsx("span",{children:m==="loading"?"Loading terminal":m==="failed"?"Terminal list unavailable":f?"Terminal unavailable":"Select a terminal"}),m==="failed"&&e.jsx("button",{type:"button",className:"s-term-empty-action",onClick:d,children:"Retry"})]})})}function Wn(s,t){return s.kind!=="fresh"||!s.sessionName?!1:t.some(r=>r.surfaces.some(i=>i.backend===s.backend&&i.sessionName===s.sessionName&&i.state!=="exited"))}function ce(s){return`${s.session.id}:${F(s.surface)}`}function An(s,t,r){if(s.kind==="fresh")return{id:s.id,kind:"fresh",backend:s.backend,agent:s.agent,...s.backend==="pty"?{}:{sessionName:Bs(s.backend,s.id,r)}};const i=zs(t,s.terminalSessionId,s.terminalSurfaceKey);return i?{id:s.id,kind:"registered",target:i}:{id:s.id,kind:"unavailable",terminalSessionId:s.terminalSessionId,terminalSurfaceKey:s.terminalSurfaceKey}}function G(s){return{session:s.session,surface:s.surface}}function Mn(s){const t=s.backend;return t!=="pty"&&!Os(t)?null:{view:"terminal",terminalBackend:t,terminalAgent:s.agent,terminalTabId:s.id,...s.sessionName?{terminalSessionName:s.sessionName}:{},...s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{}}}function Ln(s,t="takeover"){return{view:"terminal",terminalSessionId:s.session.id,terminalSurfaceKey:F(s.surface),mode:t}}function Hs(s,t){if(typeof window>"u"){t(s);return}window.open(As(s),"_blank","noopener,noreferrer")}function Dn({navigate:s}){const{agents:t}=$s(),r=Es(),{hosts:i}=Xe(),l=o.useMemo(()=>fn(i),[i]),[m,d]=$e(rn,ns(),{version:an,migrate:un}),[f,c]=$e(on,"library"),x=o.useRef(new Map),[y,S]=o.useState(null),[w,A]=o.useState(""),[M,h]=o.useState(""),[j,C]=o.useState(vs),[v,z]=o.useState(()=>Array.from({length:4},()=>oe("pty"))),[R,E]=o.useState(0),[W,H]=o.useState({state:"loading",sessions:[]}),[B,k]=o.useState(0),[N,L]=o.useState(!0),[K,ne]=$e(gn,"list"),[re,ae]=o.useState(Mt),[Z,ee]=o.useState([]),[he,se]=o.useState(null),[b,O]=o.useState(null),[D,_]=o.useState(null),[$,os]=o.useState(!1),[fe,ls]=o.useState(null),[Vs,Ae]=o.useState(null),ke=o.useRef(null),be=o.useRef(null),xe=o.useRef("after"),ye=o.useRef(null),je=o.useRef(null),Me=o.useRef(!1),q=o.useCallback((n={})=>{n.silent||H(a=>({state:"loading",sessions:a.sessions})),Ls({includeDiscovered:!0}).then(a=>H({state:"ready",sessions:a})).catch(a=>{n.silent||H(u=>({state:"failed",sessions:u.sessions,error:a instanceof Error?a.message:String(a)}))})},[]);o.useEffect(()=>{q()},[q]),o.useEffect(()=>{const n=()=>{document.visibilityState==="visible"&&q({silent:!0})},a=window.setInterval(n,8e3);return window.addEventListener("focus",n),document.addEventListener("visibilitychange",n),()=>{window.clearInterval(a),window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",n)}},[q]),o.useEffect(()=>{let n=!1;return kn().then(a=>{if(!n){ee(a.resolutions);for(const u of a.workspaces)x.current.set(u.id,JSON.stringify(Ke(ws(u),{sessions:W.sessions})));a.workspaces.length!==0&&d(u=>{let p=u;for(const g of a.workspaces)p=js(p,ws(g));return{...p,activeWorkspaceId:u.activeWorkspaceId||p.activeWorkspaceId}})}}).catch(()=>{}),()=>{n=!0}},[d]);const ge=o.useMemo(()=>Ds(W.sessions),[W.sessions]),V=o.useMemo(()=>ge.filter(n=>n.surface.state!=="exited"),[ge]),Le=o.useMemo(()=>{const n=new Set,a=[];for(const u of ge)u.surface.backend!=="herdr"||n.has(u.surface.sessionName)||(n.add(u.surface.sessionName),a.push(G(u)));return a},[ge]);o.useMemo(()=>Un(t),[t]);const cs=W.state==="failed"?W.error:null,Ys=m.workspaces,T=m.workspaces.find(n=>n.id===m.activeWorkspaceId)??null,te=Re({layout:T?.layout,columns:T?.columns,cellCount:T?.tiles.length??0}),Y=o.useMemo(()=>(T?.tiles??[]).map(n=>An(n,W.sessions,T?.id??"")),[T?.id,T?.tiles,W.sessions]),De=Ee(te,{tileCount:Y.length});o.useEffect(()=>{if(!T||!x.current.has(T.id))return;const n=Ke(T,{sessions:W.sessions}),a=JSON.stringify(n);x.current.get(T.id)!==a&&(x.current.set(T.id,a),Ns(n).catch(u=>se(u instanceof Error?u.message:String(u))))},[T,W.sessions]);const ds=f==="workspace"&&!T?"library":f,P=o.useCallback(n=>{d(a=>{const u=a.workspaces.find(g=>g.id===a.activeWorkspaceId);if(!u)return a;const p=n(u.tiles);return p===u.tiles?a:gs(a,u.id,{tiles:p,updatedAt:Date.now()})})},[d]),Se=o.useCallback(n=>{d(a=>a.activeWorkspaceId?gs(a,a.activeWorkspaceId,{layout:n,updatedAt:Date.now()}):a)},[d]),Gs=o.useCallback(n=>{d(a=>en(a,n.id)),L(!1),c("workspace")},[d,c]),Js=o.useCallback(()=>{c("library")},[c]),ie=o.useCallback(n=>{S(n?.id??null),A(n?.name??""),h(n?.purpose??""),C(n?Re({layout:n.layout,columns:n.columns,cellCount:n.tiles.length}):vs),z(n?.tiles??Array.from({length:4},()=>oe("pty"))),E(0),c("builder")},[c]),Xs=o.useCallback(n=>{C(a=>n.mode==="solo"?{mode:"solo"}:{mode:n.mode,columns:a.columns??"dynamic"}),z(a=>a.length>=n.minimumCells?a:[...a,...Array.from({length:n.minimumCells-a.length},()=>oe("pty"))]),E(a=>Math.max(0,Math.min(a,n.minimumCells-1)))},[]),Qs=o.useCallback(n=>{C(a=>a.mode==="solo"?{mode:"lanes",columns:n}:{...a,columns:n})},[]),Zs=o.useCallback(()=>{z(n=>{const a=[...n,oe("pty")];return E(a.length-1),a})},[]),et=o.useCallback(n=>{z(a=>{if(a.length<=1)return a;const u=a.filter((p,g)=>g!==n);return E(p=>Math.min(p,u.length-1)),u})},[]),st=o.useCallback(()=>{const n=w.trim();if(!n)return;const a={id:y??ve("workspace"),name:n,purpose:M.trim(),columns:Ee(j,{tileCount:v.length}),layout:j,tiles:v,updatedAt:Date.now()};d(p=>js(p,a));const u=Ke(a,{sessions:W.sessions});x.current.set(a.id,JSON.stringify(u)),Ns(u).catch(p=>se(p instanceof Error?p.message:String(p))),L(!1),c("workspace")},[y,d,c,W.sessions,v,j,w,M]),tt=o.useCallback(n=>{d(a=>sn(a,n,{allowEmpty:!0})),xn(n).catch(()=>{})},[d]),ms=o.useCallback((n,a="shell")=>{P(u=>[...u,oe(n,a)])},[P]),J=o.useCallback((n,a)=>{const u={kind:"registered",terminalSessionId:n.session.id,terminalSurfaceKey:F(n.surface)};P(p=>{const g=p.some(I=>I.kind==="registered"&&I.terminalSessionId===u.terminalSessionId&&Be(I.terminalSurfaceKey,u.terminalSurfaceKey));return a?p.some(I=>I.id===a)?p.map(I=>I.id===a?{...u,id:I.id}:I):p:g?p:[...p,{...u,id:ve("cell")}]})},[P]),nt=o.useCallback(n=>{J(n)},[J]),ze=o.useMemo(()=>new Set(Y.filter(n=>n.kind==="registered").map(n=>ce(n.target))),[Y]),rt=o.useCallback(n=>{const a=Le.length>0?Le.map(u=>{const p=ze.has(ce(u)),g=u.surface.state==="live"?"running":"detached";return{kind:"action",label:`${u.surface.sessionName} · ${g}${p?" · in grid":""}`,onSelect:()=>J(u)}}):[{kind:"action",label:"No herdr sessions discovered",onSelect:()=>{}}];r(n,a)},[Le,ze,J,r]),we=o.useCallback(n=>{n?.currentTarget.hasPointerCapture(n.pointerId)&&n.currentTarget.releasePointerCapture(n.pointerId),ye.current=null,je.current=null,Me.current=!1,O(null),_(null),os(!1)},[]),at=o.useCallback((n,a)=>{const u=n.target;n.button!==0||u instanceof Element&&u.closest("button, a")||(ye.current={pointerId:n.pointerId,target:G(a),targetId:ce(G(a)),startX:n.clientX,startY:n.clientY},n.currentTarget.setPointerCapture(n.pointerId))},[]),it=o.useCallback(n=>{const a=ye.current;if(!a||a.pointerId!==n.pointerId||Math.hypot(n.clientX-a.startX,n.clientY-a.startY)<6&&!b)return;b||O(a.targetId);const p=document.querySelector(".s-term--workspace");if(p){const bs=p.getBoundingClientRect();n.clientY<bs.top+72&&(p.scrollTop-=28),n.clientY>bs.bottom-72&&(p.scrollTop+=28)}const g=document.elementFromPoint(n.clientX,n.clientY),I=g?.closest(".s-term-workspace-cell"),X=!!(g?.closest(".s-term-workspace-add-cell")||!I&&g?.closest(".s-term--workspace")&&!g?.closest(".s-term-picker")),ks=X?null:I?.dataset.terminalTileId??null;je.current=ks,Me.current=X,_(ks),os(X)},[b]),ot=o.useCallback(n=>{const a=ye.current;!a||a.pointerId!==n.pointerId||(Me.current?J(a.target):je.current&&J(a.target,je.current),we(n))},[we,J]),lt=o.useCallback(n=>{we(n)},[we]),ct=o.useCallback(()=>{const n=V.map(G);n.length!==0&&P(a=>{const u=a.filter(g=>g.kind==="registered"),p=n.filter(g=>!u.some(I=>I.kind==="registered"&&I.terminalSessionId===g.session.id&&Be(I.terminalSurfaceKey,F(g.surface)))).map(g=>({id:ve("cell"),kind:"registered",terminalSessionId:g.session.id,terminalSurfaceKey:F(g.surface)}));return p.length===0?a:[...a,...p]})},[V,P]),Oe=o.useCallback(n=>{P(a=>{const u=a.filter(p=>p.id!==n);return u.length===a.length?a:u})},[P]),us=o.useCallback((n,a,u)=>{n!==a&&P(p=>nn(p,n,a,u))},[P]),Pe=o.useCallback((n,a)=>{P(u=>{const p=u.findIndex(X=>X.id===n),g=p+a;if(p<0||g<0||g>=u.length)return u;const I=[...u];return[I[p],I[g]]=[I[g],I[p]],I})},[P]),ps=o.useCallback((n,a)=>{P(u=>u.map(p=>p.id===n?{id:p.id,kind:"fresh",backend:a,agent:"shell"}:p))},[P]),Ne=o.useCallback(()=>[...Ts.map(n=>({kind:"action",label:n.label,onSelect:()=>Se(n.mode==="solo"?{mode:"solo"}:{mode:n.mode,columns:te.columns??"dynamic"})})),...te.mode==="solo"?[]:[{kind:"separator"},{kind:"action",label:"Dynamic columns",onSelect:()=>Se({...te,columns:"dynamic"})},...Array.from({length:ts},(n,a)=>({kind:"action",label:a===0?"One column":`${a+1} columns`,onSelect:()=>Se({...te,columns:a+1})}))],{kind:"separator"},{kind:"action",label:"Edit workspace…",onSelect:()=>T&&ie(T)}],[T,Se,ie,te]),dt=o.useCallback(n=>{r(n,Ne())},[Ne,r]),mt=o.useCallback((n,a)=>{const u=Y.findIndex(g=>g.id===a.id),p=[];u>0&&p.push({kind:"action",label:"Move left",onSelect:()=>Pe(a.id,-1)}),u>=0&&u<Y.length-1&&p.push({kind:"action",label:"Move right",onSelect:()=>Pe(a.id,1)}),p.length>0&&p.push({kind:"separator"}),p.push(...l.map(g=>({kind:"action",label:g.value==="pty"?"Replace with a disposable shell":`Replace with a session that survives (${g.label})`,onSelect:()=>ps(a.id,g.value)})),{kind:"separator"},{kind:"action",label:"Remove cell",onSelect:()=>Oe(a.id)},{kind:"separator"},...Ne()),r(n,p)},[Oe,Ne,Pe,ps,r,l,Y]),ut=o.useCallback((n,a)=>{const u=n.target;n.button===0&&u instanceof Element&&u.closest(".s-term-bar")&&!u.closest("button, a")&&(ke.current={pointerId:n.pointerId,tileId:a,startX:n.clientX,startY:n.clientY},n.currentTarget.setPointerCapture(n.pointerId))},[]),pt=o.useCallback(n=>{const a=ke.current;if(!a||a.pointerId!==n.pointerId||Math.hypot(n.clientX-a.startX,n.clientY-a.startY)<6&&!fe)return;fe||ls(a.tileId);const p=document.elementFromPoint(n.clientX,n.clientY)?.closest(".s-term-workspace-cell"),g=p?.dataset.terminalTileId??null;if(!p||!g||g===a.tileId){be.current=null,xe.current="after",Ae(null);return}const I=p.getBoundingClientRect(),X=tn({x:n.clientX,y:n.clientY},{left:I.left,top:I.top,width:I.width,height:I.height},De);be.current=g,xe.current=X.edge,Ae(g)},[fe,De]),hs=o.useCallback(n=>{const a=ke.current;if(!a||a.pointerId!==n.pointerId)return;const u=be.current;u&&us(a.tileId,u,xe.current),n.currentTarget.hasPointerCapture(n.pointerId)&&n.currentTarget.releasePointerCapture(n.pointerId),ke.current=null,be.current=null,xe.current="after",ls(null),Ae(null)},[us]),ht=o.useMemo(()=>yn(Z.find(n=>n.workspaceId===T?.id)),[T?.id,Z]),fs=o.useCallback(n=>{ae(a=>Lt(a,n))},[]),ft=o.useCallback(()=>{q(),k(n=>n+1)},[q]),kt=o.useCallback(n=>{T&&bn(T.id,n).then(()=>{se(null),q()}).catch(a=>se(a instanceof Error?a.message:String(a)))},[T,q]);return ds==="library"?e.jsx(zn,{workspaces:Ys,sessionsReady:W.state!=="loading",onOpen:Gs,onCreate:()=>ie(),onEdit:ie,onDelete:tt}):ds==="builder"?e.jsx(Pn,{editing:!!y,name:w,purpose:M,modes:Ts,layout:j,startOptions:l,cells:v,selectedSlot:R,terminalItems:V,onNameChange:A,onPurposeChange:h,onApplyMode:Xs,onColumnsChange:Qs,onSelectSlot:E,onAddCell:Zs,onRemoveCell:et,pickerView:K,pickerSort:re,onPickerView:ne,onPickerSort:fs,onAssignFresh:(n,a="shell")=>z(u=>u.map((p,g)=>g===R?{id:p.id,kind:"fresh",backend:n,agent:a}:p)),onAssignRegistered:n=>z(a=>a.map((u,p)=>p===R?{id:u.id,kind:"registered",terminalSessionId:n.session.id,terminalSurfaceKey:F(n.surface)}:u)),onCancel:()=>{c(T?"workspace":"library")},onSave:st}):e.jsx("div",{className:"s-term s-term--workspace",children:e.jsxs("div",{className:"s-term-workspace",children:[e.jsxs("header",{className:"s-term-workspace-head",children:[e.jsxs("div",{className:"s-term-workspace-title",children:[e.jsxs("span",{className:"s-term-summary-mark",children:[e.jsx(de,{size:18,strokeWidth:1.7}),e.jsxs("span",{children:["Workspaces / ",T?.name??"Workspace"]})]}),e.jsx("h1",{children:T?.name??"Workspace"}),T?.purpose&&e.jsx("p",{children:T.purpose})]}),e.jsxs("div",{className:"s-term-workspace-actions","aria-label":"Terminal workspace actions",children:[e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:Js,children:e.jsx("span",{children:"All workspaces"})}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>T&&ie(T),children:[e.jsx(de,{size:14,strokeWidth:1.8}),e.jsx("span",{children:"Edit workspace"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:()=>ms("pty"),title:"Add a shell tile",children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Shell"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>ms("pty","codex"),title:"Add a Codex TUI tile",children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Codex"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:rt,title:"Add a herdr session's layout as a tile",children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Herdr"})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:()=>L(n=>!n),title:N?"Hide terminal picker":"Show terminal picker","aria-pressed":N,children:[e.jsx(U,{size:14,strokeWidth:1.8}),e.jsx("span",{children:N?"Hide picker":"Show picker"})]}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:ft,disabled:W.state==="loading",title:"Reload all terminal tiles","aria-label":"Reload all terminal tiles",children:e.jsx(es,{size:14,strokeWidth:1.8})})]})]}),cs&&e.jsxs("div",{className:"s-term-home-error",children:[e.jsx("span",{children:"Terminal registry unavailable"}),e.jsx("code",{children:cs})]}),he&&e.jsxs("div",{className:"s-term-home-error",children:[e.jsx("span",{children:"This workspace is not saved to Scout — it will not follow you to another device"}),e.jsx("code",{children:he})]}),(Y.length>0||N)&&e.jsxs("div",{className:"s-term-workspace-grid","aria-label":"Terminal tiles",style:{"--terminal-grid-columns":De},onContextMenu:dt,children:[Y.map(n=>e.jsx("div",{className:`s-term-workspace-cell${fe===n.id?" s-term-workspace-cell--dragging":""}${Vs===n.id||D===n.id?" s-term-workspace-cell--drop-target":""}`,"data-terminal-tile-id":n.id,onPointerDownCapture:a=>ut(a,n.id),onPointerMove:pt,onPointerUp:hs,onPointerCancel:hs,onContextMenu:a=>mt(a,n),children:e.jsx($n,{tile:n,navigate:s,onClose:Oe,resolution:ht.get(n.id)??null,onRevive:kt,live:Wn(n,W.sessions)})},`${n.id}:${B}`)),N&&e.jsxs("button",{type:"button",className:`s-term-workspace-add-cell${$?" s-term-workspace-add-cell--target":""}`,onClick:()=>L(!0),children:[e.jsx(Q,{size:20,strokeWidth:1.7}),e.jsx("strong",{children:"New slot"}),e.jsx("span",{children:b?"Drop to add":"Drag a terminal here"})]})]}),e.jsxs("section",{className:`s-term-picker${N?"":" s-term-picker--collapsed"}`,"aria-labelledby":"terminal-picker-title",onPointerDownCapture:n=>{const a=n.target;if(!(a instanceof Element))return;const u=a.closest("[data-picker-item-id]")?.dataset.pickerItemId,p=V.find(g=>g.id===u);p&&at(n,p)},onPointerMove:it,onPointerUp:ot,onPointerCancel:lt,children:[e.jsxs("header",{className:"s-term-picker-head",children:[e.jsxs("div",{className:"s-term-picker-title",children:[e.jsx(U,{size:14,strokeWidth:1.8}),e.jsx("h2",{id:"terminal-picker-title",children:"Terminal picker"}),e.jsx("span",{children:W.state==="loading"?"syncing":V.length})]}),e.jsxs("div",{className:"s-term-picker-actions",children:[N&&e.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Picker view",children:["list","table"].map(n=>e.jsx("button",{type:"button",className:K===n?"is-selected":"",onClick:()=>ne(n),"aria-pressed":K===n,children:n==="list"?"List":"Table"},n))}),N&&e.jsxs("button",{type:"button",className:"s-term-workspace-action",onClick:ct,disabled:V.length===0,children:[e.jsx(Ze,{size:13,strokeWidth:1.8}),e.jsx("span",{children:"Attach all"})]}),e.jsxs("button",{type:"button",className:"s-term-picker-toggle",onClick:()=>L(n=>!n),"aria-expanded":N,children:[e.jsx("span",{children:N?"Hide":"Show terminal picker"}),e.jsx("span",{"aria-hidden":"true",children:N?"⌄":"⌃"})]})]})]}),N&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"s-term-picker-hint",children:"Drag a terminal onto a cell to place it, or onto New slot to grow the grid."}),V.length===0&&W.state!=="loading"?e.jsx("div",{className:"s-term-picker-empty",children:"No live terminals"}):e.jsx(qs,{items:V,view:K,sort:re,attachedIds:ze,draggedTargetId:b,onSort:fs,onAttach:nt,navigate:s})]})]})]})})}function zn({workspaces:s,sessionsReady:t,onOpen:r,onCreate:i,onEdit:l,onDelete:m}){return e.jsx("div",{className:"s-term s-term--workspace-library",children:e.jsxs("main",{className:"s-term-workspace-library",children:[e.jsxs("header",{className:"s-term-workspace-library-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"s-term-summary-mark",children:[e.jsx(de,{size:18,strokeWidth:1.7}),e.jsx("span",{children:"Terminals"})]}),e.jsx("h1",{children:"Workspaces"}),e.jsx("p",{children:"Saved terminal layouts for projects, roles, and cross-project operations."})]}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:i,children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"New workspace"})]})]}),s.length===0?e.jsxs("section",{className:"s-term-workspace-library-empty",children:[e.jsx(de,{size:24,strokeWidth:1.5}),e.jsx("h2",{children:"Create your first terminal workspace"}),e.jsx("p",{children:"Choose a layout, give it a purpose, place sessions, then enter the grid."}),e.jsxs("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:i,children:[e.jsx(Q,{size:14,strokeWidth:1.9}),e.jsx("span",{children:"Create workspace"})]})]}):e.jsx("div",{className:"s-term-workspace-library-grid",children:s.map(d=>e.jsxs("article",{className:"s-term-workspace-card",children:[e.jsx("div",{className:"s-term-workspace-card-preview",style:{"--terminal-grid-columns":d.columns??Fe},children:d.tiles.map(f=>e.jsx("span",{className:f.kind==="registered"?"is-session":"is-shell"},f.id))}),e.jsxs("div",{className:"s-term-workspace-card-copy",children:[e.jsxs("span",{children:[d.columns??Fe," column",(d.columns??Fe)===1?"":"s"," · ",d.tiles.length," cells"]}),e.jsx("h2",{children:d.name}),e.jsx("p",{children:d.purpose||"No purpose added yet."})]}),e.jsxs("div",{className:"s-term-workspace-card-actions",children:[e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>l(d),children:"Edit"}),e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:()=>m(d.id),children:"Delete"}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>r(d),disabled:!t,children:"Enter workspace"})]})]},d.id))})]})})}function qe(s,t){return s==="solo"?1:s==="lanes"?Math.max(2,Math.min(4,t)):Math.max(2,Math.min(3,t))}function On(s,t){return s==="solo"?1:s==="lanes"?qe(s,t):qe(s,t)*2}function Pn({editing:s,name:t,purpose:r,modes:i,layout:l,startOptions:m,cells:d,selectedSlot:f,terminalItems:c,onNameChange:x,onPurposeChange:y,onApplyMode:S,onColumnsChange:w,onSelectSlot:A,onAddCell:M,onRemoveCell:h,pickerView:j,pickerSort:C,onPickerView:v,onPickerSort:z,onAssignFresh:R,onAssignRegistered:E,onCancel:W,onSave:H}){const B=Ee(l,{tileCount:d.length});return e.jsx("div",{className:"s-term s-term--workspace-builder",children:e.jsxs("main",{className:"s-term-workspace-builder",children:[e.jsxs("header",{className:"s-term-workspace-builder-head",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"s-term-summary-mark",children:[e.jsx(de,{size:18,strokeWidth:1.7}),e.jsx("span",{children:"Workspace builder"})]}),e.jsx("h1",{children:s?"Edit workspace":"Create a workspace"}),e.jsx("p",{children:"Define the job, choose the grid, and place the sessions before entering."})]}),e.jsxs("div",{className:"s-term-workspace-builder-actions",children:[e.jsx("button",{type:"button",className:"s-term-workspace-action",onClick:W,children:"Cancel"}),e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:H,disabled:!t.trim(),children:s?"Save and enter":"Create and enter"})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-identity","aria-label":"Workspace identity",children:[e.jsxs("label",{children:[e.jsx("span",{children:"Name"}),e.jsx("input",{value:t,onChange:k=>x(k.target.value),placeholder:"Release desk",autoFocus:!0})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Purpose"}),e.jsx("input",{value:r,onChange:k=>y(k.target.value),placeholder:"Cross-project release monitoring"})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-layout","aria-labelledby":"workspace-layout-title",children:[e.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Step 1"}),e.jsx("h2",{id:"workspace-layout-title",children:"Choose the layout"})]}),e.jsxs("p",{children:[Ht(l)," · ",d.length," cell",d.length===1?"":"s"]})]}),e.jsx("div",{className:"s-term-grid-presets","aria-label":"Workspace layout",children:i.map(k=>e.jsxs("button",{type:"button",className:`s-term-grid-preset${k.mode===l.mode?" s-term-grid-preset--selected":""}`,onClick:()=>S(k),"aria-pressed":k.mode===l.mode,children:[e.jsx("span",{className:"s-term-grid-preset-map",style:{"--terminal-preset-columns":qe(k.mode,B)},"aria-hidden":"true",children:Array.from({length:On(k.mode,B)},(N,L)=>e.jsx("i",{},L))}),e.jsx("span",{className:"s-term-grid-preset-label",children:k.label}),e.jsx("span",{className:"s-term-grid-preset-detail",children:k.detail})]},k.mode))}),l.mode!=="solo"&&e.jsxs("div",{className:"s-term-workspace-builder-columns",role:"group","aria-label":"Columns",children:[e.jsx("span",{children:"Columns"}),e.jsx("button",{type:"button",className:l.columns==="dynamic"||l.columns===void 0?"is-selected":"",onClick:()=>w("dynamic"),"aria-pressed":l.columns==="dynamic"||l.columns===void 0,title:"Fit the columns to the number of tiles",children:"Dynamic"}),Array.from({length:ts},(k,N)=>e.jsx("button",{type:"button",className:l.columns===N+1?"is-selected":"",onClick:()=>w(N+1),"aria-pressed":l.columns===N+1,children:N+1},N)),(l.columns==="dynamic"||l.columns===void 0)&&e.jsxs("em",{children:[B," right now"]})]})]}),e.jsxs("section",{className:"s-term-workspace-builder-placement","aria-labelledby":"workspace-placement-title",children:[e.jsxs("div",{className:"s-term-workspace-builder-section-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Step 2"}),e.jsx("h2",{id:"workspace-placement-title",children:"Place terminals"})]}),e.jsx("p",{children:"Select a cell, then choose a session or shell. Add as many cells as the work needs."})]}),e.jsxs("div",{className:"s-term-workspace-builder-canvas",children:[e.jsxs("div",{className:"s-term-workspace-builder-grid",style:{"--terminal-grid-columns":B},children:[d.map((k,N)=>{const L=k.kind==="registered"?c.find(K=>K.session.id===k.terminalSessionId&&Be(F(K.surface),k.terminalSurfaceKey)):null;return e.jsxs("div",{className:`s-term-workspace-builder-cell${f===N?" is-selected":""}`,children:[e.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell-select",onClick:()=>A(N),"aria-pressed":f===N,children:[e.jsx("span",{children:String(N+1).padStart(2,"0")}),e.jsx(U,{size:17,strokeWidth:1.7}),e.jsx("strong",{children:k.kind==="registered"?L?.title??"Unavailable session":is(k.backend,k.agent).title}),e.jsx("small",{children:k.kind==="registered"?L?.cwdLabel||L?.detail:k.backend})]}),d.length>1&&e.jsx("button",{type:"button",className:"s-term-workspace-builder-cell-remove",onClick:()=>h(N),title:"Remove this cell","aria-label":`Remove cell ${N+1}`,children:e.jsx(pe,{size:13,strokeWidth:1.9})})]},k.id)}),e.jsxs("button",{type:"button",className:"s-term-workspace-builder-cell s-term-workspace-builder-cell--add",onClick:M,children:[e.jsx(Q,{size:18,strokeWidth:1.7}),e.jsx("strong",{children:"Add cell"})]})]}),e.jsxs("aside",{className:"s-term-workspace-builder-source",children:[e.jsxs("span",{children:["Cell ",String(f+1).padStart(2,"0")]}),e.jsx("h3",{children:"Start something new"}),e.jsxs("div",{className:"s-term-workspace-builder-source-actions",children:[Sn.map(k=>e.jsx("button",{type:"button",onClick:()=>R("pty",k.value),children:k.label},k.value)),m.filter(k=>k.value!=="pty").map(k=>e.jsxs("button",{type:"button",onClick:()=>R(k.value,"shell"),title:k.relayAttach?k.detail:`${k.detail} — Scout starts it; open it in ${k.label} to use it`,children:[k.label,!k.relayAttach&&e.jsx("sup",{"aria-label":"opens outside Scout",children:" ↗"})]},k.value))]}),e.jsxs("div",{className:"s-term-workspace-builder-source-head",children:[e.jsx("h3",{children:"Or use a live session"}),e.jsx("div",{className:"s-term-picker-views",role:"group","aria-label":"Session picker view",children:["list","table"].map(k=>e.jsx("button",{type:"button",className:j===k?"is-selected":"",onClick:()=>v(k),"aria-pressed":j===k,children:k==="list"?"List":"Table"},k))})]}),e.jsx("div",{className:"s-term-workspace-builder-sessions",children:c.length===0?e.jsx("span",{className:"s-term-workspace-builder-no-sessions",children:"No live sessions"}):e.jsx(qs,{items:c,view:j,sort:C,attachedIds:new Set,draggedTargetId:null,onSort:z,onAttach:k=>{const N=c.find(L=>L.session.id===k.session.id&&L.surface.sessionName===k.surface.sessionName);N&&E(N)}})})]})]})]})]})})}function _n({item:s,attached:t,dragging:r,onAttach:i,onOpen:l}){return e.jsxs("article",{className:`s-term-picker-item${t?" s-term-picker-item--attached":""}${r?" s-term-picker-item--dragging":""}`,"data-picker-item-id":s.id,children:[e.jsx("span",{className:"s-term-picker-grip","aria-hidden":"true",children:"⠿"}),e.jsxs("div",{className:"s-term-picker-item-main",children:[e.jsx("strong",{title:s.surface.sessionName,children:s.title}),e.jsx("span",{title:s.session.cwd??s.detail,children:s.cwdLabel||s.detail})]}),e.jsxs("div",{className:"s-term-picker-item-meta",children:[e.jsx("span",{children:s.surface.backend}),e.jsx("span",{children:_s(s)}),e.jsx("span",{title:s.session.cwd??void 0,children:s.project})]}),l&&e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:l,children:"Open"}),e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>i(G(s)),disabled:t,children:t?"In grid":"Add"})]})}function qs({items:s,view:t,sort:r,attachedIds:i,draggedTargetId:l,onSort:m,onAttach:d,navigate:f}){const c=o.useMemo(()=>_e(s,r),[s,r]),{managed:x,regular:y}=o.useMemo(()=>wt(s),[s]),S=o.useMemo(()=>_e(x,r),[x,r]),w=o.useMemo(()=>_e(y,r),[y,r]),A=h=>{f?.({view:"terminal",terminalSessionId:h.session.id,terminalSurfaceKey:F(h.surface)})},M=(h,j)=>{const C=ce(G(h));return e.jsx(_n,{item:h,attached:i.has(C),dragging:l===C,onAttach:d,onOpen:j&&f?()=>A(h):void 0},h.id)};return t==="table"?e.jsx("div",{className:"s-term-picker-table-wrap",children:e.jsxs("table",{className:"s-term-picker-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[zt.map(h=>e.jsx("th",{scope:"col","aria-sort":r.column===h.id?r.direction==="asc"?"ascending":"descending":"none",children:e.jsxs("button",{type:"button",onClick:()=>m(h.id),children:[e.jsx("span",{children:h.label}),e.jsx("em",{"aria-hidden":"true",children:r.column===h.id?r.direction==="asc"?"▲":"▼":"·"})]})},h.id)),e.jsx("th",{scope:"col","aria-label":"Place"})]})}),e.jsx("tbody",{children:c.map(h=>{const j=ce(G(h)),C=Ot(h);return e.jsxs("tr",{"data-picker-item-id":h.id,className:i.has(j)?"is-attached":void 0,children:[e.jsx("td",{title:h.surface.sessionName,children:h.title}),e.jsx("td",{children:h.surface.backend}),e.jsx("td",{children:_s(h)}),e.jsx("td",{title:h.session.cwd??void 0,children:h.project}),e.jsx("td",{children:C?$t(C):"—"}),e.jsx("td",{children:e.jsx("button",{type:"button",className:"s-term-picker-add",onClick:()=>d(G(h)),disabled:i.has(j),children:i.has(j)?"In grid":"Add"})})]},h.id)})})]})}):e.jsxs("div",{className:"s-term-picker-list","aria-label":"Available terminals",children:[S.length>0&&e.jsxs("section",{className:"s-term-picker-group","aria-label":"Managed sessions",children:[e.jsx("h3",{className:"s-term-picker-group-title",children:"Managed sessions"}),S.map(h=>M(h,!0))]}),S.length>0&&w.length>0?e.jsxs("section",{className:"s-term-picker-group","aria-label":"Terminals",children:[e.jsx("h3",{className:"s-term-picker-group-title",children:"Terminals"}),w.map(h=>M(h,!1))]}):w.map(h=>M(h,!1))]})}function $n({tile:s,navigate:t,onClose:r,resolution:i,onRevive:l,live:m=!1}){if(s.kind==="registered")return s.target.surface.backend==="herdr"?e.jsx(Rs,{tileId:s.id,backend:"herdr",sessionName:s.target.surface.sessionName,live:s.target.surface.state==="live",onClose:r,navigate:t}):e.jsx(Kn,{tile:s,navigate:t,onClose:r});if(s.kind==="unavailable"){const d=i?.status==="revivable"&&!!l;return e.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--unavailable","aria-label":"Unavailable terminal session",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(U,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:"Not running"})]}),e.jsx("div",{className:"s-term-bar-actions",children:e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>r(s.id),title:"Remove cell","aria-label":"Remove cell",children:e.jsx(pe,{size:14,strokeWidth:1.8})})})]}),e.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[e.jsx(U,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:d?"This tile is not running.":"This saved session is not currently live."}),e.jsx("span",{children:i?.detail??"Show the terminal picker to replace it, or wait for the session to reconnect."}),d&&e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:()=>l?.(s.id),children:"Start it again"})]})]})}return!Os(s.backend)&&s.backend!=="pty"?e.jsx(Rs,{tileId:s.id,backend:s.backend,sessionName:s.sessionName,live:m,onClose:r,navigate:t}):e.jsx(Fn,{tile:s,navigate:t,onClose:r})}function Rs({tileId:s,backend:t,sessionName:r,live:i,onClose:l,navigate:m}){const{hosts:d}=Xe(),f=hn(d,t),[c,x]=o.useState("idle"),[y,S]=o.useState(null),w=t==="herdr",{topology:A}=It(w?r??null:null,{enabled:w&&i}),M=o.useCallback(()=>{r&&(x("starting"),S(null),Rt(t,{sessionName:r}).then(()=>x("idle")).catch(v=>{x("failed"),S(v instanceof Error?v.message:String(v))}))},[t,r]),h=o.useCallback(()=>{if(!m||!r)return;const v=vt(t,r);v&&m({view:"terminal",terminalSurfaceKey:v})},[m,t,r]),j=o.useCallback(()=>{!m||!r||m(Et(r))},[m,r]),C=w&&A?.running?A.workspaces.flatMap(v=>v.tabs):[];return e.jsxs("section",{className:"s-term-workspace-tile s-term-workspace-tile--hosted","aria-label":`${f?.label??t} session`,children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(U,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:f?.label??t})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:i?"running":"not running"}),r&&e.jsx("span",{className:"s-term-session",title:r,children:r})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[w&&i&&r&&m&&e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:j,title:"Enter — open a live web terminal attached to this session","aria-label":"Enter — open a live web terminal attached to this session",children:e.jsx(Ze,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>l(s),title:"Remove cell","aria-label":"Remove cell",children:e.jsx(pe,{size:14,strokeWidth:1.8})})]})]}),C.length>0?e.jsx("button",{type:"button",className:"s-term-workspace-hosted-body s-term-workspace-hosted-body--link",onClick:h,children:C.map(v=>{const z=Wt(v);return e.jsxs("span",{className:"s-term-workspace-hosted-tab",children:[e.jsx("span",{className:"s-term-workspace-hosted-tab-dots",children:z.statuses.map((R,E)=>e.jsx(At,{status:R},`${v.tabId}:${E}`))}),e.jsx("span",{className:"s-term-workspace-hosted-tab-label",children:z.label}),e.jsx("span",{className:"s-term-workspace-hosted-tab-count",children:z.statuses.length})]},v.tabId)})}):e.jsxs("div",{className:"s-term-workspace-unavailable-body",children:[e.jsx(U,{size:22,strokeWidth:1.5}),e.jsx("strong",{children:i?`Running in ${f?.label??t}`:"Not running yet"}),e.jsx("span",{children:i?`Scout keeps this session for you. Open it in ${f?.label??t} to use it.`:`Scout can start a ${f?.label??t} session and keep it for you.`}),!i&&e.jsx("button",{type:"button",className:"s-term-workspace-action s-term-workspace-action--primary",onClick:M,disabled:c==="starting"||!r,children:c==="starting"?"Starting…":"Start it"}),y&&e.jsx("code",{children:y})]})]})}function Fn({tile:s,navigate:t,onClose:r}){const i=o.useRef(null),l=Ve(),m=Ye(),d=is(s.backend,s.agent),f=Mn(s),c=["scout-terminal-workspace",s.id,s.backend,s.agent,s.sessionName??"pty"].join("-"),x=Qe({url:l,healthUrl:m,autoConnect:!0,sessionKey:c,backend:s.backend,...s.sessionName?{terminalSession:s.sessionName}:{},...s.backend==="tmux"&&s.sessionName?{tmuxSession:s.sessionName}:{},...s.backend==="zellij"&&s.sessionName?{zellijSession:s.sessionName}:{},...s.backend==="zellij"&&s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{},...s.backend==="herdr"&&s.sessionName?{tmuxSession:s.sessionName}:{},agent:s.agent,controlMode:"takeover"});le(()=>{x.resize(Ge,Je)},[x.resize]);const y=o.useCallback(()=>{f&&Hs(f,t)},[t,f]);return e.jsx("section",{className:"s-term-workspace-tile","aria-label":d.title,children:e.jsxs("div",{className:"s-term s-term--embedded",children:[e.jsxs("div",{className:"s-term-bar s-term-bar--fresh",children:[e.jsxs("div",{className:"s-term-bar-left",children:[e.jsx("span",{className:"s-term-workspace-tile-mark",children:e.jsx(U,{size:14,strokeWidth:1.8})}),e.jsx("span",{className:"s-term-workspace-tile-name",children:d.title})]}),e.jsxs("div",{className:"s-term-bar-meta",children:[e.jsx("span",{className:"s-term-label",children:s.backend}),e.jsx("span",{className:"s-term-session",children:d.detail})]}),e.jsxs("div",{className:"s-term-bar-actions",children:[e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>x.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:e.jsx(es,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:y,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:e.jsx(Fs,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>r(s.id),title:"Close tile","aria-label":"Close tile",children:e.jsx(pe,{size:14,strokeWidth:1.8})})]})]}),e.jsx("div",{ref:i,className:"s-term-body",onMouseDown:()=>{i.current?.querySelector(".xterm-helper-textarea")?.focus(),i.current?.querySelector(".xterm")?.focus()},children:e.jsx(rs,{relay:x,quiet:!0,configItems:[{label:"backend",value:s.backend},{label:"agent",value:s.agent},...s.sessionName?[{label:"session",value:s.sessionName}]:[],...s.zellijSocketDir?[{label:"socket",value:s.zellijSocketDir}]:[],{label:"ws",value:l},{label:"health",value:m}]})})]})})}function Kn({tile:s,navigate:t,onClose:r}){const i=o.useCallback(()=>{Hs(Ln(s.target),t)},[t,s.target]);return e.jsx("section",{className:"s-term-workspace-tile","aria-label":s.target.surface.sessionName,children:e.jsx(as,{agent:null,mode:"takeover",navigate:t,registeredTarget:s.target,embedded:!0,tileActions:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:i,title:"Open terminal in a new window","aria-label":"Open terminal in a new window",children:e.jsx(Fs,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",className:"s-term-icon-button s-term-icon-button--danger",onClick:()=>r(s.id),title:"Close tile","aria-label":"Close tile",children:e.jsx(pe,{size:14,strokeWidth:1.8})})]})})})}function Un(s){return[...s].filter(t=>!t.retiredFromFleet).sort((t,r)=>{const i=+!!Te(r)-+!!Te(t);if(i!==0)return i;const l=(r.updatedAt??0)-(t.updatedAt??0);return l!==0?l:t.name.localeCompare(r.name)})}function Bn({route:s,navigate:t}){const r=o.useRef(null),i=s.terminalBackend??"pty",l=s.terminalAgent??"shell",m=s.terminalTabId??"adhoc",d=i==="pty"?void 0:`scout-${i}-${m}`,f=s.terminalSessionName??d,c=Ve(),x=Ye(),y=is(i,l),S=["scout-terminal-new",i,l,f??m].join("-"),w=Qe({url:c,healthUrl:x,autoConnect:!0,sessionKey:S,backend:i,...f?{terminalSession:f}:{},...i==="tmux"&&f?{tmuxSession:f}:{},...i==="zellij"&&f?{zellijSession:f}:{},...i==="zellij"&&s.zellijSocketDir?{zellijSocketDir:s.zellijSocketDir}:{},...i==="herdr"&&f?{tmuxSession:f}:{},agent:l,controlMode:"takeover"}),A=o.useRef([]),M=o.useRef({status:w.status,sendLine:w.sendLine});return M.current={status:w.status,sendLine:w.sendLine},le(()=>{const h=j=>{const C=jn(j);if(!C)return;const v=M.current;if(v.status==="connected"){v.sendLine(C);return}A.current=[...A.current.slice(-15),C]};return window.addEventListener(Cs,h),()=>window.removeEventListener(Cs,h)},[]),le(()=>{if(w.status!=="connected"||A.current.length===0)return;const h=A.current;A.current=[];for(const j of h)w.sendLine(j)},[w.sendLine,w.status]),le(()=>{w.resize(Ge,Je)},[w.resize]),e.jsxs("div",{className:"s-term",children:[e.jsxs("div",{className:"s-term-bar",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:t,className:"s-term-back"}),e.jsx("span",{className:"s-term-label",children:y.title}),e.jsx("div",{className:"s-term-status",children:y.detail}),e.jsx("div",{className:"s-term-actions",children:e.jsx("button",{type:"button",className:"s-term-icon-button",onClick:()=>w.restart(),title:"Restart terminal","aria-label":"Restart terminal",children:e.jsx(es,{size:14,strokeWidth:1.8})})})]}),e.jsx("div",{ref:r,className:"s-term-body",onMouseDown:()=>{r.current?.querySelector(".xterm-helper-textarea")?.focus(),r.current?.querySelector(".xterm")?.focus()},children:e.jsx(rs,{relay:w,quiet:!0,configItems:[{label:"backend",value:i},{label:"agent",value:l},...f?[{label:"session",value:f}]:[],...s.zellijSocketDir?[{label:"socket",value:s.zellijSocketDir}]:[],{label:"ws",value:c},{label:"health",value:x}]})})]})}function is(s,t){const r=t==="shell"?"Shell":t==="codex"?"Codex":t==="pi"?"Pi":"Claude";return s==="pty"?{title:r,detail:"fresh PTY tab"}:{title:`${r} ${s}`,detail:`fresh ${s} backed tab`}}function Hn({agentId:s,agent:t,mode:r,navigate:i,children:l}){const m=vn(s,t,r);return m.ready?e.jsx(e.Fragment,{children:l}):e.jsx(In,{agent:t,agentId:s,color:Ws(t.name),navigate:i,label:m.label,status:m.status,onRetry:m.onRetry})}function qn({navigate:s}){return e.jsx("div",{className:"s-term",children:e.jsxs("div",{className:"s-term-bar",children:[e.jsx(ue,{slot:"terminal",fallback:{view:"terminal"},navigate:s,className:"s-term-back"}),e.jsx("span",{className:"s-term-label",children:"Terminal"}),e.jsx("div",{className:"s-term-status",children:"Resolving agent..."})]})})}function Vn({route:s,navigate:t}){const{agentId:r,mode:i,terminalSessionId:l,terminalSurfaceKey:m}=s,{agents:d}=$s();if(s.terminalBackend)return e.jsx(Bn,{route:s,navigate:t});const f=s.terminalSurfaceKey?Ms(s.terminalSurfaceKey):null;if(!r&&f?.backend==="herdr")return e.jsx(Tt,{sessionName:f.hostSession,navigate:t});if(!r)return!l&&!m?e.jsx(Dn,{navigate:t}):e.jsx(En,{terminalSessionId:l,terminalSurfaceKey:m,mode:i,navigate:t});const c=d.find(S=>S.id===r)??null;if(!c)return e.jsx(qn,{navigate:t});const x=Te(c),y=x?`${x.backend}:${c.id}:${x.sessionName}:${i??"takeover"}`:`takeover:${r}:${i??"takeover"}`;return e.jsx(Hn,{agentId:r,agent:c,mode:i,navigate:t,children:e.jsx(as,{agentId:r,agent:c,mode:i,navigate:t})},y)}function Qr({agentId:s,mode:t,terminalSessionId:r,terminalSurfaceKey:i,navigate:l}){const m={view:"terminal",agentId:s,mode:t,terminalSessionId:r,terminalSurfaceKey:i};return e.jsx(Vn,{route:m,navigate:l})}export{Vn as TerminalContent,Qr as TerminalScreen};
@@ -0,0 +1 @@
1
+ import{r as e,j as c,a as A,b as C,S as k}from"./index-BZovGpDk.js";import{C as y}from"./ContextMenu-DnFcmfMR.js";import{a as T}from"./api-h5zurxmi.js";import{L,D as x,f as R,S as P}from"./Provider-p-xuaAoE.js";import{i as I}from"./colors-BtO5_zlx.js";import{r as j,a as D}from"./router-63XV_E7f.js";import{TerminalContent as H}from"./Terminal-BI6km7H4.js";import"./sse-Bb0EOcU9.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./createLucideIcon-DCq_3fQn.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./file-text-BITQqGtF.js";import"./x-CrGUKNRv.js";import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-CHo_xmjw.js";import"./MessageComposerSuggestions-qbalTne_.js";import"./NewChatComposer-DKlNX1UA.js";import"./runtime-picker-BXKJbLot.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./index-DiiEQwdc.js";import"./HarnessMark-DrE57dUq.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DXPvX-hh.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";/* empty css */import"./clipboard-e3fSpeo7.js";import"./terminal-relay-BgfVJXIL.js";import"./HerdrSession-1eVu9Owj.js";import"./chunk-YOZR3KYS-oS9dlQCI.js";import"./arrow-down-DxxPnPwh.js";import"./terminal-xGf_F3y7.js";import"./refresh-cw-DtF8xPqX.js";import"./check-BfA0T8UD.js";import"./copy-C79v_7D-.js";import"./eye-DkU59kfl.js";import"./session-table-BUPq9Viy.js";import"./chunk-JTPDIGGW-DX2eTIQ_.js";import"./terminal-takeover--05EYhJm.js";import"./BackToPicker-D6WgIDb-.js";import"./TmuxPeek-IaWqCgyJ.js";/* empty css */import"./plus-BAI0t5g9.js";import"./external-link-Dd8xaveL.js";function g(){const t=new URLSearchParams(window.location.search).get("route")?.trim()||"/terminal",s=j(t);return s.view==="terminal"?s:{view:"terminal"}}function S(o){const t=new URLSearchParams(window.location.search);return t.set("route",D(o)),t.has("profile")||t.set("profile","macos.terminal"),`${window.location.pathname}?${t.toString()}${window.location.hash}`}function Ue(){const[o,t]=e.useState(()=>g()),s=!!(o.terminalBackend||o.agentId||o.terminalSessionId||o.terminalSurfaceKey);e.useEffect(()=>{const i=()=>t(g());return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[]);const n=e.useCallback(i=>{if(i.view!=="terminal"){const p={view:"terminal"},a=S(p);window.history.pushState(null,"",a),t(p);return}const l=S(i);window.history.pushState(null,"",l),t(i)},[]);return c.jsx(M,{route:o,navigate:n,children:c.jsx("div",{className:`s-terminal-embed${s?" s-terminal-embed--surface":""}`,children:c.jsx(H,{route:o,navigate:n})})})}function M({route:o,navigate:t,children:s}){const[n,i]=e.useState([]),[l,p]=e.useState({status:"checking",message:null,lastCheckedAt:null}),a=e.useRef(null),u=e.useMemo(()=>A(),[]),f=e.useMemo(()=>C(),[]),b=e.useMemo(()=>({...u==="light"?L:x,...f??{}}),[u,f]),w=e.useCallback(()=>{p({status:"online",message:null,lastCheckedAt:Date.now()})},[]),h=e.useCallback(r=>{p({status:"offline",message:R(r),lastCheckedAt:Date.now()})},[]),m=e.useCallback(async()=>{if(a.current)return a.current;const r=(async()=>{try{i(await T("/api/agents")),w()}catch(d){h(d)}})();a.current=r;try{await r}finally{a.current=null}},[h,w]);e.useEffect(()=>{m()},[m]),e.useEffect(()=>{const r=()=>{document.visibilityState!=="hidden"&&m()},d=window.setInterval(r,15e3);return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{window.clearInterval(d),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[m]);const v=e.useMemo(()=>n.filter(r=>I(r.state)).length,[n]),E=e.useMemo(()=>({route:o,navigate:t,navigateBack:()=>{typeof window<"u"&&window.history.back()},canNavigateBack:typeof window<"u"&&window.history.length>1,agents:n,agentsLoaded:l.status!=="checking",onlineCount:v,apiConnection:l,appearanceDetails:k,updateAppearanceDetails:()=>{},reload:m,onboarding:null,refreshOnboarding:async()=>{},onboardingSkipped:!0,skipOnboarding:()=>{},settingsOpen:!1,openSettings:()=>{},closeSettings:()=>{},scoutbotAgentId:"scoutbot",scoutbotConversationId:null,applyScoutbotUiAction:()=>{},selectedBrokerAttempt:null,inspectBrokerAttempt:()=>{},clearBrokerAttempt:()=>{},selectedKnowledgeHit:null,selectedKnowledgeQuery:"",inspectKnowledgeHit:()=>{},clearKnowledgeHit:()=>{},focusedSession:null,focusSession:()=>{},openFilePreview:()=>{},closeFilePreview:()=>{},openContextCapture:()=>{},closeContextCapture:()=>{}}),[n,l,t,v,m,o]);return c.jsx(P.Provider,{value:E,children:c.jsx("div",{"data-scout-theme":u,"data-scout-theme-mode":u,style:b,children:c.jsx(y,{children:s})})})}export{Ue as TerminalEmbedScreen};
@@ -1,4 +1,4 @@
1
- import{j as i,r as I}from"./index-NRbRrZw-.js";const N={cjs:"javascript",css:"css",htm:"html",html:"html",js:"javascript",jsx:"javascript",json:"json",mjs:"javascript",md:"markdown",mdx:"markdown",sh:"shell",ts:"typescript",tsx:"typescript",txt:"plain"},L=new Set(["cjs","css","htm","html","js","jsx","json","mjs","sh","ts","tsx"]);function b(t){const s=(t.filename??t.title??t.uri??"").split(/[?#]/)[0],n=s.split("/").pop()??s,r=n.lastIndexOf(".");return r>=0?n.slice(r+1).toLowerCase():""}function S(t){const e=t.mediaType?.toLowerCase()??"";return e.includes("json")?"json":e.includes("markdown")?"markdown":e.includes("javascript")?"javascript":e.includes("typescript")?"typescript":e.includes("html")?"html":e.includes("css")?"css":e.includes("shell")||e.includes("x-sh")?"shell":N[b(t)]??"plain"}function E(t){const e=t.mediaType?.toLowerCase()??"",s=b(t);if(e.includes("markdown")||s==="md"||s==="mdx")return"markdown";if(e.includes("json")||e.includes("javascript")||e.includes("typescript")||e.includes("html")||e.includes("xml")||e.includes("css")||L.has(s))return"code";if(e.startsWith("text/")||s==="txt")return"text";const n=t.value.trim();return/^#{1,6}\s+/m.test(n)||/```[\s\S]*```/.test(n)?"markdown":"text"}function it(t){const e=t.title??t.filename??t.uri?.split("/").pop()??"Untitled",s=t.language??S(t);return{id:t.id??t.uri??e,title:e,uri:t.uri,mediaType:t.mediaType,language:s,kind:t.kind??E(t),value:t.value,readOnly:t.readOnly}}function ct({document:t,mode:e,className:s}){const n=e??(t.kind==="markdown"?"preview":"read"),r=t.kind==="markdown"&&n==="preview"?i.jsx(k,{markdown:t.value}):i.jsx(W,{document:t});return i.jsx("div",{className:`s-text-document-surface s-text-document-surface-${t.kind}${s?` ${s}`:""}`,children:r})}function W({document:t}){const e=I.useMemo(()=>_(t.value,t.language??t.kind),[t.language,t.kind,t.value]);return i.jsx("pre",{className:"s-text-document-code","data-language":t.language??t.kind,children:i.jsx("code",{children:e})})}function k({markdown:t}){const e=A(t);return i.jsx("div",{className:"s-text-document-markdown",children:e.length>0?e:i.jsx("p",{})})}function A(t){const e=t.replace(/\r\n/g,`
1
+ import{j as i,r as I}from"./index-BZovGpDk.js";const N={cjs:"javascript",css:"css",htm:"html",html:"html",js:"javascript",jsx:"javascript",json:"json",mjs:"javascript",md:"markdown",mdx:"markdown",sh:"shell",ts:"typescript",tsx:"typescript",txt:"plain"},L=new Set(["cjs","css","htm","html","js","jsx","json","mjs","sh","ts","tsx"]);function b(t){const s=(t.filename??t.title??t.uri??"").split(/[?#]/)[0],n=s.split("/").pop()??s,r=n.lastIndexOf(".");return r>=0?n.slice(r+1).toLowerCase():""}function S(t){const e=t.mediaType?.toLowerCase()??"";return e.includes("json")?"json":e.includes("markdown")?"markdown":e.includes("javascript")?"javascript":e.includes("typescript")?"typescript":e.includes("html")?"html":e.includes("css")?"css":e.includes("shell")||e.includes("x-sh")?"shell":N[b(t)]??"plain"}function E(t){const e=t.mediaType?.toLowerCase()??"",s=b(t);if(e.includes("markdown")||s==="md"||s==="mdx")return"markdown";if(e.includes("json")||e.includes("javascript")||e.includes("typescript")||e.includes("html")||e.includes("xml")||e.includes("css")||L.has(s))return"code";if(e.startsWith("text/")||s==="txt")return"text";const n=t.value.trim();return/^#{1,6}\s+/m.test(n)||/```[\s\S]*```/.test(n)?"markdown":"text"}function it(t){const e=t.title??t.filename??t.uri?.split("/").pop()??"Untitled",s=t.language??S(t);return{id:t.id??t.uri??e,title:e,uri:t.uri,mediaType:t.mediaType,language:s,kind:t.kind??E(t),value:t.value,readOnly:t.readOnly}}function ct({document:t,mode:e,className:s}){const n=e??(t.kind==="markdown"?"preview":"read"),r=t.kind==="markdown"&&n==="preview"?i.jsx(k,{markdown:t.value}):i.jsx(W,{document:t});return i.jsx("div",{className:`s-text-document-surface s-text-document-surface-${t.kind}${s?` ${s}`:""}`,children:r})}function W({document:t}){const e=I.useMemo(()=>_(t.value,t.language??t.kind),[t.language,t.kind,t.value]);return i.jsx("pre",{className:"s-text-document-code","data-language":t.language??t.kind,children:i.jsx("code",{children:e})})}function k({markdown:t}){const e=A(t);return i.jsx("div",{className:"s-text-document-markdown",children:e.length>0?e:i.jsx("p",{})})}function A(t){const e=t.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),s=[];let n=0;for(;n<e.length;){const r=e[n]??"";if(!r.trim()){n+=1;continue}const c=/^```(\S*)\s*$/.exec(r);if(c){const l=[];for(n+=1;n<e.length&&!/^```\s*$/.test(e[n]??"");)l.push(e[n]??""),n+=1;n<e.length&&(n+=1),s.push({kind:"code",content:l.join(`
4
4
  `),language:c[1]||void 0});continue}const a=/^(#{1,6})\s+(.+)$/.exec(r);if(a){s.push({kind:"heading",depth:z(a[1].length),content:a[2].trim()}),n+=1;continue}if(/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(r)){s.push({kind:"hr"}),n+=1;continue}if(/^>\s?/.test(r)){const l=[];for(;n<e.length&&/^>\s?/.test(e[n]??"");)l.push((e[n]??"").replace(/^>\s?/,"")),n+=1;s.push({kind:"blockquote",content:l.join(" ")});continue}const o=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(r);if(o){const l=/\d/.test(o[2]),m=[];for(;n<e.length;){const f=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(e[n]??"");if(!f||/\d/.test(f[2])!==l)break;m.push(f[3]),n+=1}s.push({kind:"list",ordered:l,items:m});continue}const u=y(e,n);if(u){s.push(u.block),n=u.nextIndex;continue}const p=[];for(;n<e.length;){const l=e[n]??"";if(!l.trim()||/^```/.test(l)||/^(#{1,6})\s+/.test(l)||/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(l)||/^>\s?/.test(l)||/^(\s*)([-*+]|\d+[.)])\s+/.test(l)||y(e,n))break;p.push(l.trim()),n+=1}s.push({kind:"paragraph",content:p.join(" ")})}return s.map((r,c)=>C(r,c))}function z(t){return t<=1?1:t===2?2:t===3?3:t===4?4:t===5?5:6}function C(t,e){switch(t.kind){case"heading":{const n=`h${t.depth}`;return i.jsx(n,{children:d(t.content)},e)}case"paragraph":return i.jsx("p",{children:d(t.content)},e);case"blockquote":return i.jsx("blockquote",{children:d(t.content)},e);case"list":{const n=t.ordered?"ol":"ul";return i.jsx(n,{children:t.items.map((r,c)=>i.jsx("li",{children:d(r)},`${e}:${c}`))},e)}case"code":const s=$(t.language);return i.jsx("pre",{className:"s-text-document-fenced-code","data-language":s,children:i.jsx("code",{children:_(t.content,s)})},e);case"hr":return i.jsx("hr",{},e);case"table":return i.jsx("div",{className:"s-text-document-table-wrap",children:i.jsxs("table",{className:"s-text-document-table",children:[i.jsx("thead",{children:i.jsx("tr",{children:t.headers.map((n,r)=>i.jsx("th",{"data-align":t.alignments[r]??void 0,children:d(n)},`${e}:h:${r}`))})}),i.jsx("tbody",{children:t.rows.map((n,r)=>i.jsx("tr",{children:n.map((c,a)=>i.jsx("td",{"data-align":t.alignments[a]??void 0,children:d(c)},`${e}:r:${r}:${a}`))},`${e}:r:${r}`))})]})},e)}}function y(t,e){const s=w(t[e]??""),n=R(t[e+1]??"");if(!s||!n||s.length!==n.length)return null;const r=s.length,c=[];let a=e+2;for(;a<t.length;){const o=w(t[a]??"");if(!o||o.length<2)break;c.push(T(o,r)),a+=1}return{block:{kind:"table",alignments:n,headers:T(s,r),rows:c},nextIndex:a}}function w(t){const e=t.trim();if(!e.includes("|"))return null;let s=e;s.startsWith("|")&&(s=s.slice(1)),s.endsWith("|")&&!s.endsWith("\\|")&&(s=s.slice(0,-1));const n=[];let r="";for(let c=0;c<s.length;c+=1){const a=s[c];if(a==="\\"&&s[c+1]==="|"){r+="|",c+=1;continue}if(a==="|"){n.push(r.trim()),r="";continue}r+=a}return n.push(r.trim()),n.length>=2?n:null}function R(t){const e=w(t);if(!e||e.length<2)return null;const s=[];for(const n of e){const r=n.replace(/\s/g,"");if(!/^:?-{3,}:?$/u.test(r))return null;r.startsWith(":")&&r.endsWith(":")?s.push("center"):r.endsWith(":")?s.push("right"):r.startsWith(":")?s.push("left"):s.push(null)}return s}function T(t,e){const s=t.slice(0,e);for(;s.length<e;)s.push("");return s}const M=/\/\/[^\n]*|\/\*[\s\S]*?\*\/|`(?:\\[\s\S]|[^`\\])*`|'(?:\\.|[^'\\\n])*'|"(?:\\.|[^"\\\n])*"|\b\d+(?:\.\d+)?(?:e[+-]?\d+)?n?\b|\b[A-Za-z_$][\w$]*\b|=>|[{}()[\].,;:?]|[-+*/%=&|!<>~^]+/giu,D=/"(?:\\.|[^"\\])*"|-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b|\b(?:true|false|null)\b|[{}\[\]:,]/giu,O=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|#[0-9a-f]{3,8}\b|@[a-z-]+|--[a-z0-9-]+|[a-z-]+(?=\s*:)|\b\d+(?:\.\d+)?(?:%|px|r?em|vh|vw|vmin|vmax|s|ms|deg|fr)?\b|[{}():;,]|\.[a-z_][\w-]*|#[a-z_][\w-]*|[a-z_][\w-]*/giu,v=/<!--[\s\S]*?-->|<!doctype[^>]*>|<\/?[a-z][\w:-]*|\/?>|[a-z_:][\w:.-]*(?==)|=|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|&[a-z0-9#]+;/giu,P=/#[^\n]*|"(?:\\.|[^"\\])*"|'[^']*'|\$\{?[\w?@#$!-]+\}?|--?[A-Za-z0-9][\w-]*(?:=[^\s]+)?|\b(?:case|cd|do|done|echo|elif|else|esac|exit|export|fi|for|function|if|in|local|return|set|source|test|then|unset|while)\b|\b\d+\b|[|&;(){}<>]/giu,H=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","declare","default","delete","do","else","enum","export","extends","finally","for","from","function","get","if","implements","import","in","infer","interface","is","keyof","let","new","of","private","protected","public","readonly","return","satisfies","set","static","switch","throw","try","type","typeof","var","void","while","with","yield"]),B=new Set(["false","null","super","this","true","undefined"]);function _(t,e){switch($(e)){case"css":return g(t,O,Z);case"html":return g(t,v,U);case"javascript":case"typescript":return g(t,M,K);case"json":return g(t,D,q);case"shell":return g(t,P,Y);default:return[t]}}function g(t,e,s){const n=[];let r=0,c=0;e.lastIndex=0;let a;for(;(a=e.exec(t))!==null;){const o=a[0];if(!o){e.lastIndex+=1;continue}a.index>r&&n.push(t.slice(r,a.index));const u=s(o,a.index,a.index+o.length,t);n.push(u?i.jsx("span",{className:`s-syntax s-syntax-${u}`,children:o},`syntax-${c++}`):o),r=a.index+o.length}return r<t.length&&n.push(t.slice(r)),n.length>0?n:[t]}function $(t){const e=String(t??"").toLowerCase().replace(/^\./,"");return e==="bash"||e==="sh"||e==="shell"||e==="zsh"?"shell":e==="css"||e==="scss"?"css":e==="html"||e==="htm"||e==="xml"||e==="svg"?"html":e==="js"||e==="jsx"||e==="javascript"||e==="mjs"||e==="cjs"?"javascript":e==="json"||e==="jsonc"?"json":e==="markdown"||e==="md"||e==="mdx"?"markdown":e==="ts"||e==="tsx"||e==="typescript"?"typescript":"plain"}function K(t,e,s,n){return t.startsWith("//")||t.startsWith("/*")?"comment":x(t)?"string":/^\d/u.test(t)?"number":H.has(t)?"keyword":B.has(t)?"literal":/^[A-Z][\w$]*$/u.test(t)?"type":/^[A-Za-z_$][\w$]*$/u.test(t)&&n.slice(s).trimStart().startsWith("(")?"function":/^[{}()[\].,;:?]$/u.test(t)?"punctuation":/^(?:=>|[-+*/%=&|!<>~^]+)$/u.test(t)?"operator":null}function q(t,e,s,n){return x(t)?n.slice(s).trimStart().startsWith(":")?"property":"string":/^-?\d/u.test(t)?"number":t==="true"||t==="false"||t==="null"?"literal":"punctuation"}function Z(t,e,s,n){return t.startsWith("/*")?"comment":x(t)?"string":t.startsWith("@")?"keyword":t.startsWith("#")&&/^#[0-9a-f]/iu.test(t)||/^\d/u.test(t)?"number":t.startsWith(".")||t.startsWith("#")?"tag":/^--/u.test(t)||n.slice(s).trimStart().startsWith(":")?"property":/^[{}():;,]$/u.test(t)?"punctuation":null}function U(t){return t.startsWith("<!--")?"comment":/^<!doctype/iu.test(t)||t.startsWith("&")?"meta":t.startsWith("<")?"tag":x(t)?"string":t==="="?"operator":t===">"||t==="/>"?"punctuation":"attribute"}function Y(t){return t.startsWith("#")?"comment":x(t)?"string":t.startsWith("$")?"property":t.startsWith("-")?"attribute":/^\d/u.test(t)?"number":/^[|&;(){}<>]$/u.test(t)?"operator":G.has(t)?"keyword":null}const G=new Set(["case","cd","do","done","echo","elif","else","esac","exit","export","fi","for","function","if","in","local","return","set","source","test","then","unset","while"]);function x(t){return t.startsWith('"')||t.startsWith("'")||t.startsWith("`")}const J=/`([^`]+)`/y,X=/\[([^\]]+)\]\(([^)\s]+)\)/y,F=/\*\*\*(.+?)\*\*\*/y,Q=/\*\*(.+?)\*\*/y,V=/__(.+?)__(?!\w)/y,tt=/~~(.+?)~~/y,et=/\*(?!\s)([^*]+?)\*/y,nt=/_(?!\s)([^_]+?)_(?!\w)/y;function h(t,e,s){t.lastIndex=s;const n=t.exec(e);return n&&n.index===s?n:null}function d(t){const e=[];let s="",n=0,r=0;const c=()=>{s&&(e.push(s),s="")};for(;n<t.length;){const a=n===0||/[^\w]/.test(t[n-1]??""),o=h(J,t,n);if(o){c(),e.push(i.jsx("code",{children:o[1]},r++)),n+=o[0].length;continue}const u=h(X,t,n);if(u){c();const j=st(u[2]);e.push(j?i.jsx("a",{href:j,target:"_blank",rel:"noreferrer",children:d(u[1])},r++):i.jsx("span",{children:d(u[1])},r++)),n+=u[0].length;continue}const p=h(F,t,n);if(p){c(),e.push(i.jsx("strong",{children:i.jsx("em",{children:d(p[1])})},r++)),n+=p[0].length;continue}const l=h(Q,t,n)??(a?h(V,t,n):null);if(l){c(),e.push(i.jsx("strong",{children:d(l[1])},r++)),n+=l[0].length;continue}const m=h(tt,t,n);if(m){c(),e.push(i.jsx("del",{children:d(m[1])},r++)),n+=m[0].length;continue}const f=h(et,t,n)??(a?h(nt,t,n):null);if(f){c(),e.push(i.jsx("em",{children:d(f[1])},r++)),n+=f[0].length;continue}s+=t[n],n+=1}return c(),e}function st(t){if(!t)return null;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"||e.protocol==="mailto:"?t:null}catch{return null}}export{ct as T,it as c};
@@ -1 +1 @@
1
- import{r as l,j as a}from"./index-NRbRrZw-.js";import{a as D}from"./api-DEHEgJ9m.js";import{f as v}from"./time-Dhsh_2EG.js";/* empty css */import{R as F}from"./refresh-cw-C4E58VJK.js";const M=44,B=132,H=3500,V=7e3;function W(e,t){return!!(e&&e.available===t.available&&e.sessionId===t.sessionId&&e.body===t.body&&e.lineCount===t.lineCount&&e.columnCount===t.columnCount&&e.truncated===t.truncated&&e.reason===t.reason)}function q(e){const t=new URLSearchParams({lines:String(e.lines),cols:String(e.columns)});return e.agentId?`/api/agents/${encodeURIComponent(e.agentId)}/tmux-peek?${t.toString()}`:e.surface?(t.set("backend",e.surface.backend),t.set("sessionName",e.surface.sessionName),`/api/terminal-sessions/peek?${t.toString()}`):null}function ee({agentId:e,surface:t,enabled:x=!0,lines:E=M,columns:L=B,pollMs:h=H,idlePollMs:u=V,className:N}){const[n,T]=l.useState(null),[k,m]=l.useState(!1),[A,b]=l.useState(null),[U,K]=l.useState(0),c=q({agentId:e,surface:t,lines:E,columns:L});if(l.useEffect(()=>{T(null),b(null),m(!1)},[c]),l.useEffect(()=>{if(!x||!c){m(!1);return}let r=!1,f,y=!0;const R=d=>{window.clearTimeout(f),f=window.setTimeout(()=>{S()},d)},S=async()=>{if(r)return;if(document.visibilityState!=="visible"){R(u);return}y&&m(!0);let d=h;try{const i=await D(c);if(r)return;b(null),T(o=>o&&W(o.payload,i)?o.steady?o:{...o,steady:!0}:{payload:i,observedAt:o?.observedAt??i.capturedAt,changedAt:o?i.capturedAt:null,steady:!1}),d=i.available?h:u}catch(i){if(r)return;b(i instanceof Error?i.message:String(i)),d=u}finally{r||(y&&m(!1),y=!1,R(d))}},$=()=>{document.visibilityState==="visible"&&(window.clearTimeout(f),S())};return S(),document.addEventListener("visibilitychange",$),()=>{r=!0,window.clearTimeout(f),document.removeEventListener("visibilitychange",$)}},[x,u,c,h,U]),!x||!c)return null;const s=n?.payload??null,g=s?.body??"",p=s?.lineCount??E,j=s?.columnCount??L,w=6,I=1.32,O={"--tmux-peek-columns":String(j),"--tmux-peek-rows":String(p),"--tmux-peek-font-size":`${w}px`,"--tmux-peek-line-height":String(I),"--tmux-peek-height":`${Math.ceil(p*w*I+18)}px`},C=!!(s?.available&&g),X=A||(k&&!n?"Loading terminal peek...":s?.available===!1?s.reason??"No tmux pane is available.":C?null:s?.available?"Pane is empty.":"Loading terminal peek..."),_=n?n.changedAt&&!n.steady?"Changed":n.steady?"At rest":"Peeked":null,P=n?.changedAt??n?.observedAt??null,z=n?n.changedAt?n.steady?`No terminal content change since ${v(n.changedAt)}`:`Terminal content changed ${v(n.changedAt)}`:`First terminal peek observed ${v(n.observedAt)}`:void 0;return a.jsxs("div",{className:`ctx-panel-tmux-peek${N?` ${N}`:""}`,style:O,children:[a.jsxs("div",{className:"ctx-panel-tmux-peek-head",children:[a.jsx("span",{children:"Terminal peek"}),a.jsxs("span",{className:"ctx-panel-tmux-peek-grid",children:[j,"x",p]}),s?.sessionId&&a.jsx("span",{className:"ctx-panel-tmux-peek-session",title:s.sessionId,children:s.sessionId.length>12?s.sessionId.slice(0,10):s.sessionId}),_&&P&&a.jsx("time",{className:"ctx-panel-tmux-peek-state",dateTime:new Date(P).toISOString(),title:z,children:_}),a.jsxs("button",{type:"button",className:"ctx-panel-tmux-peek-refresh",onClick:()=>K(r=>r+1),disabled:k,title:"Refresh terminal peek","aria-label":"Refresh terminal peek",children:[a.jsx(F,{size:12,strokeWidth:1.8}),a.jsx("span",{children:k?"Refreshing":"Refresh"})]})]}),C?a.jsx("pre",{className:"ctx-panel-tmux-peek-screen",children:g}):a.jsx("div",{className:"ctx-panel-tmux-peek-empty",children:X}),s?.truncated&&g&&a.jsxs("div",{className:"ctx-panel-tmux-peek-foot",children:["Last ",p," rows from tmux pane"]})]})}export{ee as T};
1
+ import{r as l,j as a}from"./index-BZovGpDk.js";import{a as D}from"./api-h5zurxmi.js";import{f as v}from"./time-Dhsh_2EG.js";/* empty css */import{R as F}from"./refresh-cw-DtF8xPqX.js";const M=44,B=132,H=3500,V=7e3;function W(e,t){return!!(e&&e.available===t.available&&e.sessionId===t.sessionId&&e.body===t.body&&e.lineCount===t.lineCount&&e.columnCount===t.columnCount&&e.truncated===t.truncated&&e.reason===t.reason)}function q(e){const t=new URLSearchParams({lines:String(e.lines),cols:String(e.columns)});return e.agentId?`/api/agents/${encodeURIComponent(e.agentId)}/tmux-peek?${t.toString()}`:e.surface?(t.set("backend",e.surface.backend),t.set("sessionName",e.surface.sessionName),`/api/terminal-sessions/peek?${t.toString()}`):null}function ee({agentId:e,surface:t,enabled:x=!0,lines:E=M,columns:L=B,pollMs:h=H,idlePollMs:u=V,className:N}){const[n,T]=l.useState(null),[k,m]=l.useState(!1),[A,b]=l.useState(null),[U,K]=l.useState(0),c=q({agentId:e,surface:t,lines:E,columns:L});if(l.useEffect(()=>{T(null),b(null),m(!1)},[c]),l.useEffect(()=>{if(!x||!c){m(!1);return}let r=!1,f,y=!0;const R=d=>{window.clearTimeout(f),f=window.setTimeout(()=>{S()},d)},S=async()=>{if(r)return;if(document.visibilityState!=="visible"){R(u);return}y&&m(!0);let d=h;try{const i=await D(c);if(r)return;b(null),T(o=>o&&W(o.payload,i)?o.steady?o:{...o,steady:!0}:{payload:i,observedAt:o?.observedAt??i.capturedAt,changedAt:o?i.capturedAt:null,steady:!1}),d=i.available?h:u}catch(i){if(r)return;b(i instanceof Error?i.message:String(i)),d=u}finally{r||(y&&m(!1),y=!1,R(d))}},$=()=>{document.visibilityState==="visible"&&(window.clearTimeout(f),S())};return S(),document.addEventListener("visibilitychange",$),()=>{r=!0,window.clearTimeout(f),document.removeEventListener("visibilitychange",$)}},[x,u,c,h,U]),!x||!c)return null;const s=n?.payload??null,g=s?.body??"",p=s?.lineCount??E,j=s?.columnCount??L,w=6,I=1.32,O={"--tmux-peek-columns":String(j),"--tmux-peek-rows":String(p),"--tmux-peek-font-size":`${w}px`,"--tmux-peek-line-height":String(I),"--tmux-peek-height":`${Math.ceil(p*w*I+18)}px`},C=!!(s?.available&&g),X=A||(k&&!n?"Loading terminal peek...":s?.available===!1?s.reason??"No tmux pane is available.":C?null:s?.available?"Pane is empty.":"Loading terminal peek..."),_=n?n.changedAt&&!n.steady?"Changed":n.steady?"At rest":"Peeked":null,P=n?.changedAt??n?.observedAt??null,z=n?n.changedAt?n.steady?`No terminal content change since ${v(n.changedAt)}`:`Terminal content changed ${v(n.changedAt)}`:`First terminal peek observed ${v(n.observedAt)}`:void 0;return a.jsxs("div",{className:`ctx-panel-tmux-peek${N?` ${N}`:""}`,style:O,children:[a.jsxs("div",{className:"ctx-panel-tmux-peek-head",children:[a.jsx("span",{children:"Terminal peek"}),a.jsxs("span",{className:"ctx-panel-tmux-peek-grid",children:[j,"x",p]}),s?.sessionId&&a.jsx("span",{className:"ctx-panel-tmux-peek-session",title:s.sessionId,children:s.sessionId.length>12?s.sessionId.slice(0,10):s.sessionId}),_&&P&&a.jsx("time",{className:"ctx-panel-tmux-peek-state",dateTime:new Date(P).toISOString(),title:z,children:_}),a.jsxs("button",{type:"button",className:"ctx-panel-tmux-peek-refresh",onClick:()=>K(r=>r+1),disabled:k,title:"Refresh terminal peek","aria-label":"Refresh terminal peek",children:[a.jsx(F,{size:12,strokeWidth:1.8}),a.jsx("span",{children:k?"Refreshing":"Refresh"})]})]}),C?a.jsx("pre",{className:"ctx-panel-tmux-peek-screen",children:g}):a.jsx("div",{className:"ctx-panel-tmux-peek-empty",children:X}),s?.truncated&&g&&a.jsxs("div",{className:"ctx-panel-tmux-peek-foot",children:["Last ",p," rows from tmux pane"]})]})}export{ee as T};
@@ -1 +1 @@
1
- import{j as n,r as h}from"./index-NRbRrZw-.js";import{r as w,o as g}from"./scout-voice-BT3gYDhU.js";import"./fx-z37u1o2z.js";const p={microphone:{label:"Microphone",privacyPane:"Microphone",hint:"Scout Menu captures audio for web dictation. The browser never records.",appLabel:"Scout Menu"},speechRecognition:{label:"Speech recognition",privacyPane:"Speech Recognition",hint:"Live partials and Apple Speech fallback while Parakeet warms.",appLabel:"Scout Menu"}};function x(e){return e?e.granted?"ok":e.canRequest?"warn":e.status==="denied"||e.status==="restricted"?"fail":"warn":"idle"}function y(e){if(!e)return"Unknown";if(e.granted)return"Granted";switch(e.status){case"notDetermined":return"Not requested";case"denied":return"Denied";case"restricted":return"Restricted";case"authorized":return"Granted";default:return e.status}}function M(e,s){return e?e.granted?`${p[s].appLabel} is allowed to use ${p[s].label.toLowerCase()}.`:e.canRequest?`Click Request to show the macOS permission dialog for ${p[s].appLabel}.`:e.status==="denied"?`Choose Retry access. Scout Menu will open macOS ${p[s].privacyPane} settings and detect the change automatically.`:e.status==="restricted"?`${p[s].label} access is restricted on this Mac.`:`${p[s].appLabel} needs ${p[s].label.toLowerCase()} access before dictation works.`:"Launch Scout Menu on this Mac, then refresh."}function j(e){return!!(e&&!e.granted&&!e.canRequest&&e.status!=="unknown")}function R(e){return!!(e&&!e.granted&&e.status!=="restricted"&&e.status!=="unknown")}function L({hostOnline:e,micPermission:s,speechPermission:r,modelReady:l}){const c=s?.granted??!1,d=r?.granted??!1,u=e&&c&&d;let i="fail",t="Scout Menu not connected",a="Launch Scout Menu on this Mac. Web dictation uses the Scout voice host — not the browser microphone.";return e&&!c&&(s?.status==="denied"||s?.status==="restricted")?(i="fail",t="Microphone blocked for Scout Menu",a=s?.status==="restricted"?"Microphone access is restricted on this Mac.":"Choose Retry access below. Scout will open the right macOS pane and detect the change."):e&&!c&&s?.canRequest?(i="warn",t="Microphone access needed",a="Request permission below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&c&&!d&&(r?.status==="denied"||r?.status==="restricted")?(i="warn",t="Speech recognition blocked for Scout Menu",a=r?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Open Privacy & Security → Speech Recognition to change it."):e&&c&&!d?(i="warn",t="Speech recognition needed",a="Request access below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&u?(i="ok",t=l?"Dictation ready":"Dictation ready · model warming",a="Scout Menu is running as the voice host. The browser does not capture audio."):e&&(i="warn",t="Voice host connected",a="Finish permissions below to enable dictation."),n.jsxs("div",{className:`s-voice-host-banner s-voice-host-banner--${i}`,children:[n.jsx("div",{className:"s-voice-host-banner-dot","aria-hidden":!0}),n.jsxs("div",{className:"s-voice-host-banner-copy",children:[n.jsx("div",{className:"s-voice-host-banner-title",children:t}),n.jsx("div",{className:"s-voice-host-banner-detail",children:a}),n.jsxs("div",{className:"s-voice-host-banner-meta",children:[n.jsx("span",{children:"Voice host · Scout Menu"}),n.jsx("span",{children:e?"Connected":"Offline"}),n.jsx("span",{children:"Capture · native"})]})]})]})}function f({kind:e,status:s,disabled:r,onActionError:l,onRefresh:c}){const[d,u]=h.useState(!1),i=h.useRef(s),t=p[e],a=x(s);h.useEffect(()=>{i.current=s},[s]);const m=h.useCallback(async()=>{for(let o=0;o<30;o+=1)if(await new Promise(S=>window.setTimeout(S,1e3)),await c(),i.current?.granted)return},[c]),v=h.useCallback(async()=>{u(!0);try{await w(e),await m()}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l,m]),b=h.useCallback(async()=>{u(!0);try{await g(e)}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l]);return n.jsxs("div",{className:`s-voice-permission-card s-voice-permission-card--${a}`,children:[n.jsxs("div",{className:"s-voice-permission-card-head",children:[n.jsx("span",{className:"s-voice-permission-card-dot","aria-hidden":!0}),n.jsxs("div",{children:[n.jsx("div",{className:"s-voice-permission-card-label",children:t.label}),n.jsxs("div",{className:"s-voice-permission-card-app",children:["via ",t.appLabel]})]}),n.jsx("span",{className:`s-voice-permission-card-status s-voice-permission-card-status--${a}`,children:y(s)})]}),n.jsx("p",{className:"s-voice-permission-card-hint",children:t.hint}),n.jsx("p",{className:"s-voice-permission-card-detail",children:M(s,e)}),n.jsxs("div",{className:"s-voice-permission-card-actions",children:[R(s)?n.jsx("button",{type:"button",className:"s-voice-permission-btn s-voice-permission-btn--primary",disabled:r||d,onClick:()=>{v()},children:d?s?.canRequest?"Requesting…":"Waiting for macOS…":s?.canRequest?"Request access":"Retry access"}):null,j(s)?n.jsxs("button",{type:"button",className:"s-voice-permission-btn",disabled:r||d,onClick:()=>{b()},children:["Open Privacy & Security → ",t.privacyPane]}):null]})]})}function P({permissions:e,hostOnline:s,disabled:r,onError:l,onRefresh:c}){const d=e?.find(i=>i.kind==="microphone")??null,u=e?.find(i=>i.kind==="speechRecognition")??null;return n.jsxs("div",{className:"s-voice-permissions-panel",children:[n.jsx(f,{kind:"microphone",status:s?d:null,disabled:r||!s,onActionError:l,onRefresh:c}),n.jsx(f,{kind:"speechRecognition",status:s?u:null,disabled:r||!s,onActionError:l,onRefresh:c}),s?null:n.jsx("p",{className:"s-voice-permissions-offline",children:"Scout Menu is not reporting to this web server. Permissions are managed on the Mac where Scout Menu runs."})]})}export{L as VoiceHostStatusBanner,P as VoicePermissionsPanel};
1
+ import{j as n,r as h}from"./index-BZovGpDk.js";import{r as w,o as g}from"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";const p={microphone:{label:"Microphone",privacyPane:"Microphone",hint:"Scout Menu captures audio for web dictation. The browser never records.",appLabel:"Scout Menu"},speechRecognition:{label:"Speech recognition",privacyPane:"Speech Recognition",hint:"Live partials and Apple Speech fallback while Parakeet warms.",appLabel:"Scout Menu"}};function x(e){return e?e.granted?"ok":e.canRequest?"warn":e.status==="denied"||e.status==="restricted"?"fail":"warn":"idle"}function y(e){if(!e)return"Unknown";if(e.granted)return"Granted";switch(e.status){case"notDetermined":return"Not requested";case"denied":return"Denied";case"restricted":return"Restricted";case"authorized":return"Granted";default:return e.status}}function M(e,s){return e?e.granted?`${p[s].appLabel} is allowed to use ${p[s].label.toLowerCase()}.`:e.canRequest?`Click Request to show the macOS permission dialog for ${p[s].appLabel}.`:e.status==="denied"?`Choose Retry access. Scout Menu will open macOS ${p[s].privacyPane} settings and detect the change automatically.`:e.status==="restricted"?`${p[s].label} access is restricted on this Mac.`:`${p[s].appLabel} needs ${p[s].label.toLowerCase()} access before dictation works.`:"Launch Scout Menu on this Mac, then refresh."}function j(e){return!!(e&&!e.granted&&!e.canRequest&&e.status!=="unknown")}function R(e){return!!(e&&!e.granted&&e.status!=="restricted"&&e.status!=="unknown")}function L({hostOnline:e,micPermission:s,speechPermission:r,modelReady:l}){const c=s?.granted??!1,d=r?.granted??!1,u=e&&c&&d;let i="fail",t="Scout Menu not connected",a="Launch Scout Menu on this Mac. Web dictation uses the Scout voice host — not the browser microphone.";return e&&!c&&(s?.status==="denied"||s?.status==="restricted")?(i="fail",t="Microphone blocked for Scout Menu",a=s?.status==="restricted"?"Microphone access is restricted on this Mac.":"Choose Retry access below. Scout will open the right macOS pane and detect the change."):e&&!c&&s?.canRequest?(i="warn",t="Microphone access needed",a="Request permission below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&c&&!d&&(r?.status==="denied"||r?.status==="restricted")?(i="warn",t="Speech recognition blocked for Scout Menu",a=r?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Open Privacy & Security → Speech Recognition to change it."):e&&c&&!d?(i="warn",t="Speech recognition needed",a="Request access below or tap the mic in chat. Scout Menu will show the macOS prompt."):e&&u?(i="ok",t=l?"Dictation ready":"Dictation ready · model warming",a="Scout Menu is running as the voice host. The browser does not capture audio."):e&&(i="warn",t="Voice host connected",a="Finish permissions below to enable dictation."),n.jsxs("div",{className:`s-voice-host-banner s-voice-host-banner--${i}`,children:[n.jsx("div",{className:"s-voice-host-banner-dot","aria-hidden":!0}),n.jsxs("div",{className:"s-voice-host-banner-copy",children:[n.jsx("div",{className:"s-voice-host-banner-title",children:t}),n.jsx("div",{className:"s-voice-host-banner-detail",children:a}),n.jsxs("div",{className:"s-voice-host-banner-meta",children:[n.jsx("span",{children:"Voice host · Scout Menu"}),n.jsx("span",{children:e?"Connected":"Offline"}),n.jsx("span",{children:"Capture · native"})]})]})]})}function f({kind:e,status:s,disabled:r,onActionError:l,onRefresh:c}){const[d,u]=h.useState(!1),i=h.useRef(s),t=p[e],a=x(s);h.useEffect(()=>{i.current=s},[s]);const m=h.useCallback(async()=>{for(let o=0;o<30;o+=1)if(await new Promise(S=>window.setTimeout(S,1e3)),await c(),i.current?.granted)return},[c]),v=h.useCallback(async()=>{u(!0);try{await w(e),await m()}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l,m]),b=h.useCallback(async()=>{u(!0);try{await g(e)}catch(o){l(o instanceof Error?o.message:String(o))}finally{u(!1)}},[e,l]);return n.jsxs("div",{className:`s-voice-permission-card s-voice-permission-card--${a}`,children:[n.jsxs("div",{className:"s-voice-permission-card-head",children:[n.jsx("span",{className:"s-voice-permission-card-dot","aria-hidden":!0}),n.jsxs("div",{children:[n.jsx("div",{className:"s-voice-permission-card-label",children:t.label}),n.jsxs("div",{className:"s-voice-permission-card-app",children:["via ",t.appLabel]})]}),n.jsx("span",{className:`s-voice-permission-card-status s-voice-permission-card-status--${a}`,children:y(s)})]}),n.jsx("p",{className:"s-voice-permission-card-hint",children:t.hint}),n.jsx("p",{className:"s-voice-permission-card-detail",children:M(s,e)}),n.jsxs("div",{className:"s-voice-permission-card-actions",children:[R(s)?n.jsx("button",{type:"button",className:"s-voice-permission-btn s-voice-permission-btn--primary",disabled:r||d,onClick:()=>{v()},children:d?s?.canRequest?"Requesting…":"Waiting for macOS…":s?.canRequest?"Request access":"Retry access"}):null,j(s)?n.jsxs("button",{type:"button",className:"s-voice-permission-btn",disabled:r||d,onClick:()=>{b()},children:["Open Privacy & Security → ",t.privacyPane]}):null]})]})}function P({permissions:e,hostOnline:s,disabled:r,onError:l,onRefresh:c}){const d=e?.find(i=>i.kind==="microphone")??null,u=e?.find(i=>i.kind==="speechRecognition")??null;return n.jsxs("div",{className:"s-voice-permissions-panel",children:[n.jsx(f,{kind:"microphone",status:s?d:null,disabled:r||!s,onActionError:l,onRefresh:c}),n.jsx(f,{kind:"speechRecognition",status:s?u:null,disabled:r||!s,onActionError:l,onRefresh:c}),s?null:n.jsx("p",{className:"s-voice-permissions-offline",children:"Scout Menu is not reporting to this web server. Permissions are managed on the Mac where Scout Menu runs."})]})}export{L as VoiceHostStatusBanner,P as VoicePermissionsPanel};