@openscout/scout 0.2.91 → 0.2.92

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 (283) hide show
  1. package/README.md +12 -4
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/client/assets/{ActivityScreen-BUeb4ERK.js → ActivityScreen-DkUP7V7M.js} +1 -1
  5. package/dist/client/assets/{AddProjectForm-DtTfn4Zk.js → AddProjectForm-CpyytDf2.js} +1 -1
  6. package/dist/client/assets/{AgentAvatar-CneOa70z.js → AgentAvatar-D8ZtMluU.js} +1 -1
  7. package/dist/client/assets/{AgentConfigurationScreen-CkZ7EjZh.js → AgentConfigurationScreen-BlGI6fuM.js} +1 -1
  8. package/dist/client/assets/{AgentDefinitionsWorkspace-0Y3kqMtv.js → AgentDefinitionsWorkspace-CfaDVCVt.js} +1 -1
  9. package/dist/client/assets/{AgentDetailCard-Dtc02KUO.js → AgentDetailCard-BTiOmh-a.js} +1 -1
  10. package/dist/client/assets/{AgentFloorView-B5raPB_U.js → AgentFloorView-DjNLILLt.js} +1 -1
  11. package/dist/client/assets/{AgentInfoScreen-DFG4ElZD.js → AgentInfoScreen-DG5dlHb_.js} +1 -1
  12. package/dist/client/assets/{AgentLaneCard-BRAkw8YJ.js → AgentLaneCard-lfRNb7JD.js} +1 -1
  13. package/dist/client/assets/{AgentLaneChrome-T8QE5742.js → AgentLaneChrome-Dlwrbq3g.js} +1 -1
  14. package/dist/client/assets/{AgentLaneDetailSheet-C8RYotnv.js → AgentLaneDetailSheet-BzYzBfcW.js} +1 -1
  15. package/dist/client/assets/{AgentLaneSummaryResize-FyYweLo_.js → AgentLaneSummaryResize-6SOEWUnr.js} +1 -1
  16. package/dist/client/assets/AgentLanesEmbedScreen-Crxx1srt.js +1 -0
  17. package/dist/client/assets/{AgentLanesPreflight-Cil3dNwu.js → AgentLanesPreflight-C3uOiOzd.js} +1 -1
  18. package/dist/client/assets/{AgentLanesView-DPfO8MOo.js → AgentLanesView-ChNlmY-F.js} +1 -1
  19. package/dist/client/assets/{AgentLiveActions-DwScaVRF.js → AgentLiveActions-BJ5dIfL3.js} +1 -1
  20. package/dist/client/assets/{AgentSessions-DKoWA0Lm.js → AgentSessions-DpY0htZV.js} +1 -1
  21. package/dist/client/assets/{AgentsConsole-DoBIWGoq.js → AgentsConsole-CHyXrjhm.js} +1 -1
  22. package/dist/client/assets/{AgentsScreen-JuUiSuwY.js → AgentsScreen-BhCjX2lD.js} +1 -1
  23. package/dist/client/assets/AgentsSubnav-az_VDkri.js +1 -0
  24. package/dist/client/assets/{AtopView-ycxMrRwp.js → AtopView-BjjPM8OX.js} +1 -1
  25. package/dist/client/assets/{BackToPicker-D6WgIDb-.js → BackToPicker-D1LV6Cqp.js} +1 -1
  26. package/dist/client/assets/{BriefingDetailScreen-Zw-taW1s.js → BriefingDetailScreen-B7qJ90Np.js} +1 -1
  27. package/dist/client/assets/{BriefingsScreen-BerYOoWS.js → BriefingsScreen-CW6N829d.js} +1 -1
  28. package/dist/client/assets/{BrokerMetadataPanel-Cu93j-Ga.js → BrokerMetadataPanel-BhjECqOK.js} +1 -1
  29. package/dist/client/assets/{BrokerScreen-CeN90URH.js → BrokerScreen-X3z50712.js} +1 -1
  30. package/dist/client/assets/{ChatCollapsedStrip-DdKyMSEM.js → ChatCollapsedStrip-DNR9osDy.js} +1 -1
  31. package/dist/client/assets/{CodeDiffPane-BjCOBLze.js → CodeDiffPane-Bx_2VAzv.js} +1 -1
  32. package/dist/client/assets/{CodeProjectPicker-NSGdCaK0.js → CodeProjectPicker-C1yOJKvs.js} +1 -1
  33. package/dist/client/assets/{CodeScreen-CA9Sq6Dx.js → CodeScreen-CIKK1LcZ.js} +1 -1
  34. package/dist/client/assets/{ContextMenu-DnFcmfMR.js → ContextMenu-CHIuVKz7.js} +1 -1
  35. package/dist/client/assets/{ConversationComposer-CjRXFkvY.js → ConversationComposer-Bf7Ga_49.js} +1 -1
  36. package/dist/client/assets/{ConversationFeedRows-CgRTIpAv.js → ConversationFeedRows-Cm1Lgo43.js} +1 -1
  37. package/dist/client/assets/{ConversationHeader-CRmdtuL7.js → ConversationHeader-B_GXrKR0.js} +1 -1
  38. package/dist/client/assets/{ConversationPanels-DCkcLIHk.js → ConversationPanels-BTBbEvrP.js} +2 -2
  39. package/dist/client/assets/{ConversationScreen-Br0QQ3xo.js → ConversationScreen-B3l2m3JI.js} +1 -1
  40. package/dist/client/assets/{ConversationStatus-BJ1CMbAv.js → ConversationStatus-BqhUHD85.js} +1 -1
  41. package/dist/client/assets/{DataTable-Dzqiaha4.js → DataTable-CJbbgBdA.js} +1 -1
  42. package/dist/client/assets/{DispatchAftermath-B0WMg_z3.js → DispatchAftermath-BDA9CrOd.js} +1 -1
  43. package/dist/client/assets/{DocumentFocusViewer-CZVVIAD5.js → DocumentFocusViewer-B9vodVmG.js} +1 -1
  44. package/dist/client/assets/{EmbeddableSurfacesLab-C3a7hJWO.js → EmbeddableSurfacesLab-BdsYRDky.js} +1 -1
  45. package/dist/client/assets/{EmptyState-CYNJZMrZ.js → EmptyState-BRY5jTpz.js} +1 -1
  46. package/dist/client/assets/{FileViewerPane-Fwt8_KmD.js → FileViewerPane-9Bveqm9c.js} +1 -1
  47. package/dist/client/assets/{FleetSearch-Dsi_l2KW.js → FleetSearch-Bj9SCl2f.js} +1 -1
  48. package/dist/client/assets/{FlightObserveScreen-g_tiGmvz.js → FlightObserveScreen-BVMdsiCC.js} +1 -1
  49. package/dist/client/assets/{FollowScreen-Bb_rcrzi.js → FollowScreen-BifwHWOV.js} +1 -1
  50. package/dist/client/assets/{HarnessMark-DrE57dUq.js → HarnessMark-BPAphNjx.js} +1 -1
  51. package/dist/client/assets/{HarnessesScreen-CAsCJ_tG.js → HarnessesScreen-fMnbnrD4.js} +1 -1
  52. package/dist/client/assets/{HerdrSession-1eVu9Owj.js → HerdrSession-BujfGzrP.js} +1 -1
  53. package/dist/client/assets/{HomeHero-W445QrG1.js → HomeHero-BgM6S39l.js} +1 -1
  54. package/dist/client/assets/{KnowledgeSearchInspector-CbPVg3fr.js → KnowledgeSearchInspector-B4ZY24xE.js} +1 -1
  55. package/dist/client/assets/{KnowledgeSearchScreen-C1lN1xJk.js → KnowledgeSearchScreen-Ch_WENUC.js} +1 -1
  56. package/dist/client/assets/{LaneToolHoverCard-BkBcDYm-.js → LaneToolHoverCard-B7KdvQvf.js} +1 -1
  57. package/dist/client/assets/{LaneTraceDetailSheet-CzTd44rf.js → LaneTraceDetailSheet-H3AnN-vN.js} +1 -1
  58. package/dist/client/assets/{LaneTraceEventFocus-BmMmPTyJ.js → LaneTraceEventFocus-mkMw2wJU.js} +1 -1
  59. package/dist/client/assets/{MeshCanvas-DwkjsiJ5.js → MeshCanvas-CpKcWxKy.js} +1 -1
  60. package/dist/client/assets/{MeshCanvasMinimap-vmCpU1sD.js → MeshCanvasMinimap-C9IoGHbe.js} +1 -1
  61. package/dist/client/assets/{MeshScreen-CkMepUpT.js → MeshScreen-48QkJSDI.js} +1 -1
  62. package/dist/client/assets/{MeshTopologyView-BD2xLE2C.js → MeshTopologyView-DFzr0IZM.js} +2 -2
  63. package/dist/client/assets/{MessageComposerSuggestions-qbalTne_.js → MessageComposerSuggestions-FdVHnT_q.js} +1 -1
  64. package/dist/client/assets/{MessagesScreen-C8UynyLC.js → MessagesScreen-BMOOfbWX.js} +1 -1
  65. package/dist/client/assets/{MissionContextRail-D5MEP2f4.js → MissionContextRail-Y8QxUZGE.js} +1 -1
  66. package/dist/client/assets/{MissionControlView-K_I7eftL.js → MissionControlView-BpsHKu1F.js} +1 -1
  67. package/dist/client/assets/{MissionFocusOverlay-CWKLdUKG.js → MissionFocusOverlay-BPnAEA3F.js} +1 -1
  68. package/dist/client/assets/{MissionLeftAgentRow-ByGrNAcs.js → MissionLeftAgentRow-iOZ6ds9L.js} +1 -1
  69. package/dist/client/assets/{MissionLogPane-ZwHJ137T.js → MissionLogPane-B0csI89E.js} +1 -1
  70. package/dist/client/assets/{NewAgentModal-Do9aVvan.js → NewAgentModal-DBHJR9Qm.js} +1 -1
  71. package/dist/client/assets/{NewChatComposer-DKlNX1UA.js → NewChatComposer-Hd7pI5Ac.js} +1 -1
  72. package/dist/client/assets/{NewChatOrigin-DXPvX-hh.js → NewChatOrigin-DmuJ32wa.js} +1 -1
  73. package/dist/client/assets/{ObserveEmbedScreen-Dghsq2on.js → ObserveEmbedScreen-DyArn7Id.js} +1 -1
  74. package/dist/client/assets/{ObserveTextFlow-DWNlmTVm.js → ObserveTextFlow-CkMrtT8s.js} +2 -2
  75. package/dist/client/assets/{ObservedTopologyPanel-BlmGoxCE.js → ObservedTopologyPanel-CaSZZP05.js} +1 -1
  76. package/dist/client/assets/{OpenScoutAppShell-DDqQi-oe.js → OpenScoutAppShell-BtlKkiuF.js} +1 -1
  77. package/dist/client/assets/{OpsAgentsView-Bn_fGBdo.js → OpsAgentsView-CnqrwbC2.js} +1 -1
  78. package/dist/client/assets/OpsScreen-DOlmlVkP.js +1 -0
  79. package/dist/client/assets/OpsSubnav-Dj3ShAKv.js +1 -0
  80. package/dist/client/assets/{PlanView-B6gKo543.js → PlanView-BLGdWDx6.js} +1 -1
  81. package/dist/client/assets/ProjectAgentProfile-Dv1sVnQl.js +1 -0
  82. package/dist/client/assets/{ProjectAgentProfileBar-C5QWwZCn.js → ProjectAgentProfileBar-BLVg5EeA.js} +1 -1
  83. package/dist/client/assets/{ProjectAgentProfileHero-DC7Dd8VL.js → ProjectAgentProfileHero-0-GDhsPT.js} +1 -1
  84. package/dist/client/assets/{ProjectsInbox-DCLrDmj1.js → ProjectsInbox-B3DpAI5b.js} +1 -1
  85. package/dist/client/assets/{ProjectsRail-C4hiXYSb.js → ProjectsRail-BDl7U9Jq.js} +1 -1
  86. package/dist/client/assets/ProjectsScreen-Dl2FcGrR.js +1 -0
  87. package/dist/client/assets/{ProjectsThreadAside-DYmL2dCY.js → ProjectsThreadAside-BcGC5mHE.js} +1 -1
  88. package/dist/client/assets/{Provider-p-xuaAoE.js → Provider-cJCdHAxu.js} +1 -1
  89. package/dist/client/assets/{RailRow-bRkkXIpR.js → RailRow-CLcVmywd.js} +1 -1
  90. package/dist/client/assets/{RawSessionsTable-B7WKmXrk.js → RawSessionsTable-DBto4Ts-.js} +1 -1
  91. package/dist/client/assets/{RealtimeVoiceScreen-BzP3BQq9.js → RealtimeVoiceScreen-DXEU5v3g.js} +1 -1
  92. package/dist/client/assets/{RepoDiffEmbedScreen-xjzjcJ_c.js → RepoDiffEmbedScreen-BCDXFE3D.js} +1 -1
  93. package/dist/client/assets/{RepoDiffPageScreen-DRzIY-dk.js → RepoDiffPageScreen-m62FiWXC.js} +1 -1
  94. package/dist/client/assets/{RepoDiffViewer-CNDp01KM.js → RepoDiffViewer-PaNeZMhJ.js} +1 -1
  95. package/dist/client/assets/RepoDiffViewerLazy-CWE5GxMP.js +2 -0
  96. package/dist/client/assets/{ReposScreen-CpaLC_NU.js → ReposScreen-Cksv1cAD.js} +1 -1
  97. package/dist/client/assets/{ScoutDeckSurface-DkpZ-0DH.js → ScoutDeckSurface-BCjPl7C4.js} +1 -1
  98. package/dist/client/assets/{ScoutSurface-BENBUt5-.js → ScoutSurface-CkgT7A-c.js} +1 -1
  99. package/dist/client/assets/{ScoutbotBroadcastChip-CGZyxS5H.js → ScoutbotBroadcastChip-DkiRCHuK.js} +1 -1
  100. package/dist/client/assets/{ScoutbotFxLab-Bk2ZsfPp.js → ScoutbotFxLab-D-kV5j4T.js} +1 -1
  101. package/dist/client/assets/{ScoutbotRealtimeVoiceCall-n63LdBZs.js → ScoutbotRealtimeVoiceCall-1ixiEn1L.js} +1 -1
  102. package/dist/client/assets/{SecondaryNav-B4IsujYh.js → SecondaryNav-_wyKjwNf.js} +1 -1
  103. package/dist/client/assets/{SessionEmbedScreen-CPfH-jqN.js → SessionEmbedScreen-CJZmIBV7.js} +1 -1
  104. package/dist/client/assets/{SessionObserve-B-SkP3tu.js → SessionObserve-yYA8Gy5s.js} +1 -1
  105. package/dist/client/assets/{SessionObserveEvidence-CF5jnH3-.js → SessionObserveEvidence-cHdjYOJe.js} +1 -1
  106. package/dist/client/assets/{SessionRefScreen-C-4jjmVG.js → SessionRefScreen-OkTY7Szg.js} +1 -1
  107. package/dist/client/assets/SessionsScreen-B-GFjxIA.js +1 -0
  108. package/dist/client/assets/{SettingsDrawer-DATxwZrn.js → SettingsDrawer-Co11RFX0.js} +1 -1
  109. package/dist/client/assets/{SettingsScreen-Bu53X7J_.js → SettingsScreen-Cn09nq5_.js} +1 -1
  110. package/dist/client/assets/{ShikiPane-DH8yYDks.js → ShikiPane-dBS9hD-z.js} +1 -1
  111. package/dist/client/assets/{SlidePanel-RFXJpfUa.js → SlidePanel-CH-3-8_2.js} +1 -1
  112. package/dist/client/assets/{SpriteAvatar-CEYdCzem.js → SpriteAvatar-DS6Tmyua.js} +1 -1
  113. package/dist/client/assets/{StatusPill-9uy70ttd.js → StatusPill-C8m9ZymF.js} +1 -1
  114. package/dist/client/assets/{TailView-6bIrgdxN.js → TailView-B0BSopPs.js} +1 -1
  115. package/dist/client/assets/{Terminal-BI6km7H4.js → Terminal-U8gjIdm3.js} +1 -1
  116. package/dist/client/assets/{TerminalEmbedScreen-D4JOWwtm.js → TerminalEmbedScreen-CTmdE7us.js} +1 -1
  117. package/dist/client/assets/{TextDocumentSurface-BcP9vvji.js → TextDocumentSurface-BWJCGBZf.js} +1 -1
  118. package/dist/client/assets/{TmuxPeek-IaWqCgyJ.js → TmuxPeek-B4QdHbGm.js} +1 -1
  119. package/dist/client/assets/{VoicePermissionsPanel-C80iZxgy.js → VoicePermissionsPanel-Dd4ITJy_.js} +1 -1
  120. package/dist/client/assets/{WorkDetailScreen-CweZ6fEd.js → WorkDetailScreen-mJs0mb99.js} +1 -1
  121. package/dist/client/assets/{WorkFilesViewer-Dy_-06iI.js → WorkFilesViewer-ODzLXKxj.js} +1 -1
  122. package/dist/client/assets/{activity-DS0u0Itf.js → activity-CC8JzJNH.js} +1 -1
  123. package/dist/client/assets/{addon-fit-CN888B3D.js → addon-fit-CaZ-uLrg.js} +1 -1
  124. package/dist/client/assets/{addon-webgl-CoAnanQS.js → addon-webgl-B8utL3bM.js} +1 -1
  125. package/dist/client/assets/{agent-essentials-CuK4G_zS.js → agent-essentials-B3wcxg_v.js} +1 -1
  126. package/dist/client/assets/{arc.es-BET9ev6q.js → arc.es-uFv9UrHn.js} +1 -1
  127. package/dist/client/assets/{arrow-down-DxxPnPwh.js → arrow-down-w1HPzDSE.js} +1 -1
  128. package/dist/client/assets/{arrow-left-CXDkJuCg.js → arrow-left-B-3GJ7ct.js} +1 -1
  129. package/dist/client/assets/{arrow-up-right-Bj8RjSqW.js → arrow-up-right-G6bJXxhK.js} +1 -1
  130. package/dist/client/assets/{bot-BSGSicKC.js → bot-DzCOGKi6.js} +1 -1
  131. package/dist/client/assets/{check-BfA0T8UD.js → check-BX8nRgop.js} +1 -1
  132. package/dist/client/assets/{chevron-down-BVg09D6U.js → chevron-down-B3VVRJcV.js} +1 -1
  133. package/dist/client/assets/{chevron-right-CaEwYkxE.js → chevron-right-BYMV1511.js} +1 -1
  134. package/dist/client/assets/{chunk-HRAB3GC3-HhKwnZCi.js → chunk-HRAB3GC3-dRd2eQMJ.js} +1 -1
  135. package/dist/client/assets/{chunk-JTPDIGGW-DX2eTIQ_.js → chunk-JTPDIGGW-BjX67kHU.js} +3 -3
  136. package/dist/client/assets/{chunk-T65CQEWV-D-bOfuCH.js → chunk-T65CQEWV-kP6nJjkU.js} +1 -1
  137. package/dist/client/assets/{chunk-YOZR3KYS-oS9dlQCI.js → chunk-YOZR3KYS-C13bZPVd.js} +1 -1
  138. package/dist/client/assets/{clock-C3TUL7D7.js → clock-B9ukVaVn.js} +1 -1
  139. package/dist/client/assets/{code-xml-Dbvjk9Kw.js → code-xml-BFc3TMSm.js} +1 -1
  140. package/dist/client/assets/{content-CiOMtgQc.js → content-B8gahuBy.js} +1 -1
  141. package/dist/client/assets/content-BIqX06OQ.js +1 -0
  142. package/dist/client/assets/content-BKDZ6Fxe.js +1 -0
  143. package/dist/client/assets/content-C15Ya-iu.js +1 -0
  144. package/dist/client/assets/content-CDE9tJDF.js +1 -0
  145. package/dist/client/assets/content-CSAfI-PX.js +1 -0
  146. package/dist/client/assets/content-CTF9D60D.js +1 -0
  147. package/dist/client/assets/{content-CJuH5cDP.js → content-CbAGkYQO.js} +1 -1
  148. package/dist/client/assets/content-CtqLJOVp.js +1 -0
  149. package/dist/client/assets/content-Dvs1KRfo.js +1 -0
  150. package/dist/client/assets/content-DyJdVZjI.js +1 -0
  151. package/dist/client/assets/{content-C2TZOKSE.js → content-Ji7ATaf7.js} +1 -1
  152. package/dist/client/assets/content-eqZXKWcP.js +1 -0
  153. package/dist/client/assets/content-iyyQKwvA.js +1 -0
  154. package/dist/client/assets/content-pDE7Fpb9.js +1 -0
  155. package/dist/client/assets/content-pPSd2dua.js +1 -0
  156. package/dist/client/assets/{conversation-icons-DmC_Ak3z.js → conversation-icons-gpsv650H.js} +1 -1
  157. package/dist/client/assets/conversation-motion-features-DXtKlmuM.js +1 -0
  158. package/dist/client/assets/{copy-C79v_7D-.js → copy-BFmOcWof.js} +1 -1
  159. package/dist/client/assets/{createLucideIcon-DCq_3fQn.js → createLucideIcon-CFBn0Sdk.js} +1 -1
  160. package/dist/client/assets/{discover-IEnbrH8_.js → discover-DKf0aTr_.js} +2 -2
  161. package/dist/client/assets/embed-entry-RlQUTtc4.js +2 -0
  162. package/dist/client/assets/{external-link-Dd8xaveL.js → external-link-B1TI5yIt.js} +1 -1
  163. package/dist/client/assets/{eye-DkU59kfl.js → eye-1J4yOUoG.js} +1 -1
  164. package/dist/client/assets/{file-text-BITQqGtF.js → file-text-DcYSrI4v.js} +1 -1
  165. package/dist/client/assets/{gestures-B5rLNRpi.js → gestures-CcEOV6Sr.js} +1 -1
  166. package/dist/client/assets/{home-moving-signal-Bs635mVw.js → home-moving-signal-Bh2FugbH.js} +1 -1
  167. package/dist/client/assets/{home-now-card-VxlLjg1A.js → home-now-card-ByRH5fFx.js} +1 -1
  168. package/dist/client/assets/{home-now-card-nano-C06GMiwD.js → home-now-card-nano-y1EhBvVL.js} +1 -1
  169. package/dist/client/assets/{hooks-BWiLxTw1.js → hooks-DUZwL3Aq.js} +1 -1
  170. package/dist/client/assets/index-BBznYVWk.css +1 -0
  171. package/dist/client/assets/{index-BTj2MguM.js → index-BTuq-8Iv.js} +1 -1
  172. package/dist/client/assets/index-CmwGCxUk.js +1 -0
  173. package/dist/client/assets/{index-BZovGpDk.js → index-DmFAhGPj.js} +2 -2
  174. package/dist/client/assets/{index-vbaJ8sin.js → index-Dtaswdsh.js} +1 -1
  175. package/dist/client/assets/{inspector-panel-C96HcyK5.js → inspector-panel-DzgS5_Mv.js} +1 -1
  176. package/dist/client/assets/{keyboard-nav-CHo_xmjw.js → keyboard-nav-h1IdakpD.js} +1 -1
  177. package/dist/client/assets/{lane-roster-store-B6ybJlHJ.js → lane-roster-store-71vFgAem.js} +1 -1
  178. package/dist/client/assets/{left-DMJkmJOF.js → left-8NITBvFX.js} +1 -1
  179. package/dist/client/assets/{left-COMAiMfB.js → left-B2HEqrTM.js} +1 -1
  180. package/dist/client/assets/{left-C6Zj3cR4.js → left-CTYUvXbe.js} +1 -1
  181. package/dist/client/assets/{left-BuJ0wJW1.js → left-CwDRT50z.js} +1 -1
  182. package/dist/client/assets/{left-l92tw5Kc.js → left-CxlDLJlw.js} +1 -1
  183. package/dist/client/assets/{left-Ce4WKYPK.js → left-XFXxNd4g.js} +1 -1
  184. package/dist/client/assets/{left-agents-BuSyVNGE.js → left-agents-Ck4Xn-R8.js} +1 -1
  185. package/dist/client/assets/{left-default-DRHywOKX.js → left-default-BeOyS0bR.js} +1 -1
  186. package/dist/client/assets/{left-lanes-4-aUyyrV.js → left-lanes-DZp3jJMo.js} +1 -1
  187. package/dist/client/assets/{left-mission-e849d_Td.js → left-mission-CuKFQ5xL.js} +1 -1
  188. package/dist/client/assets/left-p1hkO6P0.js +1 -0
  189. package/dist/client/assets/{left-plan-MchYwAB_.js → left-plan-3rrFENhp.js} +1 -1
  190. package/dist/client/assets/{library-DygjpA6u.js → library-E--gKzEZ.js} +1 -1
  191. package/dist/client/assets/{loader-circle-B-l2Wj3-.js → loader-circle-d6PKL_KD.js} +1 -1
  192. package/dist/client/assets/{local-agents-Wof5knTJ.js → local-agents-B5pq17tZ.js} +1 -1
  193. package/dist/client/assets/{mentions-BjXfeF7t.js → mentions-agCGDgyA.js} +1 -1
  194. package/dist/client/assets/{mesh-ops-C1gq8zKf.js → mesh-ops-5pZCYptW.js} +1 -1
  195. package/dist/client/assets/{mesh-view-store-B56D3f77.js → mesh-view-store-KJzABIkN.js} +1 -1
  196. package/dist/client/assets/{message-circle-BwVx5X0q.js → message-circle-CJO-pi7b.js} +1 -1
  197. package/dist/client/assets/{message-markup-DlVX-iuc.js → message-markup-CyRDLdOn.js} +1 -1
  198. package/dist/client/assets/{message-square-BnkG6tae.js → message-square-D1hMsMj_.js} +1 -1
  199. package/dist/client/assets/{mission-control-store-CMgIVjLJ.js → mission-control-store-Ce6dOvnZ.js} +1 -1
  200. package/dist/client/assets/{observe-DVHAcIrv.js → observe-BSWVM8YA.js} +1 -1
  201. package/dist/client/assets/{page-status-Bg2hd27j.js → page-status-D2FQLJOX.js} +1 -1
  202. package/dist/client/assets/{paperclip-DblaLD_N.js → paperclip-iZmDMOS5.js} +1 -1
  203. package/dist/client/assets/{plus-BAI0t5g9.js → plus-gZ0T0eBI.js} +1 -1
  204. package/dist/client/assets/{profile-3Q4sUtvJ.js → profile-Dxj3VVOM.js} +1 -1
  205. package/dist/client/assets/{projects-inbox-Da2hYEn6.js → projects-inbox-Dzt_GQDv.js} +1 -1
  206. package/dist/client/assets/{radio-BGtkyCG9.js → radio-RMLfV4EO.js} +1 -1
  207. package/dist/client/assets/{refresh-cw-DtF8xPqX.js → refresh-cw-C4x1x6b_.js} +1 -1
  208. package/dist/client/assets/resolve-panes-C9gF0w4e.js +1 -0
  209. package/dist/client/assets/resolve-sidebar-context-DxbY5RCH.js +1 -0
  210. package/dist/client/assets/{right-Dd2DscRz.js → right-5L7Tn0zG.js} +1 -1
  211. package/dist/client/assets/{right-BU_W1kSH.js → right-CYtkMmRu.js} +1 -1
  212. package/dist/client/assets/{right-CUP-NIDG.js → right-CreoQzPP.js} +1 -1
  213. package/dist/client/assets/{right-c4PAdFYZ.js → right-D-k9Z1Fe.js} +1 -1
  214. package/dist/client/assets/{right-ByptvkVX.js → right-D9xFfy2b.js} +1 -1
  215. package/dist/client/assets/{right-BlR7h0US.js → right-DI7zHADe.js} +1 -1
  216. package/dist/client/assets/{right-BwgwTGGd.js → right-DUbJ3WVc.js} +1 -1
  217. package/dist/client/assets/{right-DmVHd8Xj.js → right-DiybhsiK.js} +1 -1
  218. package/dist/client/assets/{right-Ch_jrNe2.js → right-Jh_1Q88s.js} +1 -1
  219. package/dist/client/assets/{right-B8qg3JdB.js → right-udr1qTJG.js} +1 -1
  220. package/dist/client/assets/{rocket-BWh18pt_.js → rocket-CMM-IdLy.js} +1 -1
  221. package/dist/client/assets/{router-63XV_E7f.js → router-Cn_s9IGH.js} +1 -1
  222. package/dist/client/assets/{runtime-picker-BXKJbLot.js → runtime-picker--IW3cRry.js} +1 -1
  223. package/dist/client/assets/{scope-views-Dm2_-NPi.js → scope-views-BIfMTXU4.js} +1 -1
  224. package/dist/client/assets/{scout-voice-D8Q5sZOL.js → scout-voice-CwbOz6EN.js} +1 -1
  225. package/dist/client/assets/{scroll-text-DZb3mmYo.js → scroll-text-DPPYrqB9.js} +1 -1
  226. package/dist/client/assets/{search-1QMVOxF3.js → search-DAyagUtF.js} +1 -1
  227. package/dist/client/assets/{secondaryNavConfig-c0cz3MkJ.js → secondaryNavConfig-Dw3gS1jR.js} +1 -1
  228. package/dist/client/assets/{selection-bridge-O9C4kGfF.js → selection-bridge-BXw09aRF.js} +1 -1
  229. package/dist/client/assets/{send-horizontal-DbyEkGql.js → send-horizontal-IcG46D2M.js} +1 -1
  230. package/dist/client/assets/{server-Bncn9S7r.js → server-BySujhDV.js} +1 -1
  231. package/dist/client/assets/{session-catalog-DC6BlBBC.js → session-catalog-ClS9xf6i.js} +1 -1
  232. package/dist/client/assets/{session-table-BUPq9Viy.js → session-table-BdpHs1GN.js} +1 -1
  233. package/dist/client/assets/{sliders-horizontal-CMe8Bay1.js → sliders-horizontal-R5pWUUcH.js} +1 -1
  234. package/dist/client/assets/{sparkles-_7cTZsIH.js → sparkles-DJOBD_8l.js} +1 -1
  235. package/dist/client/assets/{sse-Bb0EOcU9.js → sse-CxXt4tqI.js} +1 -1
  236. package/dist/client/assets/{tail-events-C12pfUax.js → tail-events-BdvqZHLr.js} +1 -1
  237. package/dist/client/assets/{terminal-xGf_F3y7.js → terminal-DJPUp_Qn.js} +1 -1
  238. package/dist/client/assets/{terminal-relay-BgfVJXIL.js → terminal-relay-TffuSPGs.js} +1 -1
  239. package/dist/client/assets/{terminal-takeover--05EYhJm.js → terminal-takeover-BOFPRPjR.js} +1 -1
  240. package/dist/client/assets/{use-conversation-list-DWX02INv.js → use-conversation-list-C-dPcjQe.js} +1 -1
  241. package/dist/client/assets/{use-fleet-active-asks-Cnwa4hTK.js → use-fleet-active-asks-BHzeBZSW.js} +1 -1
  242. package/dist/client/assets/{use-mesh-ops-items-BRFm37oY.js → use-mesh-ops-items-KmaauBr_.js} +1 -1
  243. package/dist/client/assets/{use-reduced-motion-C8cWvIZ3.js → use-reduced-motion-CYqhYqHO.js} +1 -1
  244. package/dist/client/assets/{use-scout-dev-flags-FkMreOOb.js → use-scout-dev-flags-BJbw87PK.js} +1 -1
  245. package/dist/client/assets/{useAgentHoverCard-DvPZSJK3.js → useAgentHoverCard-C6o0tlat.js} +1 -1
  246. package/dist/client/assets/useContentSecondaryNav-DjHBrgnS.js +1 -0
  247. package/dist/client/assets/{usePierreRuntime-C8WJ0X3F.js → usePierreRuntime-Cm7-qdm0.js} +1 -1
  248. package/dist/client/assets/{wrench-_tHBGTop.js → wrench-CvRjjByE.js} +1 -1
  249. package/dist/client/assets/{x-CrGUKNRv.js → x-C8ayPBtj.js} +1 -1
  250. package/dist/client/assets/{xterm-Ks-VlLTq.js → xterm-B0ci4Q9a.js} +1 -1
  251. package/dist/client/index.html +2 -2
  252. package/dist/main.mjs +348 -254
  253. package/dist/scout-web-server.mjs +2 -96660
  254. package/package.json +3 -3
  255. package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +0 -1
  256. package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +0 -1
  257. package/dist/client/assets/OpsScreen-DHnT-Q9R.js +0 -1
  258. package/dist/client/assets/OpsSubnav-CJRD7MjM.js +0 -1
  259. package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +0 -1
  260. package/dist/client/assets/ProjectsScreen-jruZRjgD.js +0 -1
  261. package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +0 -2
  262. package/dist/client/assets/SessionsScreen-HAjFvmIq.js +0 -1
  263. package/dist/client/assets/content-BQuEedeL.js +0 -1
  264. package/dist/client/assets/content-BUae-L_N.js +0 -1
  265. package/dist/client/assets/content-BfG98J1k.js +0 -1
  266. package/dist/client/assets/content-BkVTfkAC.js +0 -1
  267. package/dist/client/assets/content-BsNMos_d.js +0 -1
  268. package/dist/client/assets/content-CCn98eSk.js +0 -1
  269. package/dist/client/assets/content-CYnPp9yo.js +0 -1
  270. package/dist/client/assets/content-CcrUhm4P.js +0 -1
  271. package/dist/client/assets/content-CxuVONeQ.js +0 -1
  272. package/dist/client/assets/content-Dmq9n1_L.js +0 -1
  273. package/dist/client/assets/content-DskHP2NI.js +0 -1
  274. package/dist/client/assets/content-DvvzL2HK.js +0 -1
  275. package/dist/client/assets/content-snCAUbwv.js +0 -1
  276. package/dist/client/assets/conversation-motion-features-DPiGTO21.js +0 -1
  277. package/dist/client/assets/embed-entry-XUPb-AzL.js +0 -2
  278. package/dist/client/assets/index-9as_JTUs.css +0 -1
  279. package/dist/client/assets/index-DiiEQwdc.js +0 -1
  280. package/dist/client/assets/left-DrCbY6ja.js +0 -1
  281. package/dist/client/assets/resolve-panes-D4tlKNCT.js +0 -1
  282. package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +0 -1
  283. package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +0 -1
@@ -1 +1 @@
1
- import{r as n,j as a}from"./index-BZovGpDk.js";/* empty css */import{a as K}from"./api-h5zurxmi.js";import{u as Ae,f as Re,g as ge,t as U,h as b,e as ue}from"./mission-control-store-CMgIVjLJ.js";import{u as be}from"./observe-DVHAcIrv.js";import{e as me}from"./NewChatComposer-DKlNX1UA.js";import{i as Ee,c as je}from"./keyboard-nav-CHo_xmjw.js";import{g as Me}from"./tail-display-BRcJltQa.js";import{u as Le}from"./tail-events-C12pfUax.js";import{u as Te}from"./Provider-p-xuaAoE.js";import{MissionContextRail as ke}from"./MissionContextRail-D5MEP2f4.js";import{FocusOverlay as Ne}from"./MissionFocusOverlay-CWKLdUKG.js";import{MissionLogPane as Ce}from"./MissionLogPane-ZwHJ137T.js";import{o as Fe}from"./agent-lanes-model-VYQ5a68i.js";import{A as Oe}from"./mission-control-model-C0fByIjm.js";import{b as Pe,s as _e,f as De,c as We,n as $e,d as Ke,m as Ve,W as qe}from"./mission-wall-CocIM1cF.js";import"./colors-BtO5_zlx.js";import"./surface-activity-B1rgWB1i.js";import"./runtime-picker-BXKJbLot.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";import"./MessageComposerSuggestions-qbalTne_.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"./x-CrGUKNRv.js";import"./chevron-down-BVg09D6U.js";import"./search-1QMVOxF3.js";import"./file-text-BITQqGtF.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"./scoutbot-BTIErYHo.js";import"./ContextMenu-DnFcmfMR.js";import"./DocumentFocusViewer-CZVVIAD5.js";import"./TextDocumentSurface-BcP9vvji.js";/* empty css */import"./chevron-right-CaEwYkxE.js";import"./code-xml-Dbvjk9Kw.js";import"./arrow-left-CXDkJuCg.js";import"./chunk-HRAB3GC3-HhKwnZCi.js";import"./bash-format-BRV5C6Gv.js";import"./context-budget-DX_fwUs3.js";import"./page-status-Bg2hd27j.js";import"./agent-lane-detail-BNNm6FNu.js";import"./lane-observe-BA3g9aVd.js";import"./agent-lane-preview-C33Dwpn7.js";import"./lane-ask-display-B6iCAVcd.js";function He(t,o,r,c){if(o<=0)return-1;const d=o-1,x=Math.max(1,Math.floor(r));if(t<0||t>d)return c==="left"||c==="up"||c==="last"?d:0;switch(c){case"first":return 0;case"last":return d;case"left":return Math.max(0,t-1);case"right":return Math.min(d,t+1);case"up":{const v=t-x;return v>=0?v:t}case"down":{const v=t+x;return v<=d?v:d}}}function Be(t){switch(t){case"h":case"ArrowLeft":return"left";case"l":case"ArrowRight":return"right";case"k":case"ArrowUp":return"up";case"j":case"ArrowDown":return"down";case"g":case"Home":return"first";case"G":case"End":return"last";default:return null}}const $=4e3,Qe=250,ze=3e4,Ue=1500,Ge=1800;function Je(t,o){return t.map(r=>({id:r.id,name:r.name,handle:r.handle,state:r.state,project:r.project,branch:r.branch,harness:r.harness,model:r.model,sessionIds:o.get(r.id)??[]}))}function Ye(t){return{id:`native:${t.source}:${t.sessionId}`,definitionId:`native:${t.source}:${t.sessionId}`,name:`${t.source} · ${t.project}`,handle:t.sessionId.slice(0,8),agentClass:"native-session",harness:t.source,state:t.live?"working":"ready",projectRoot:t.cwd,cwd:t.cwd,updatedAt:t.lastActiveAt,createdAt:null,transport:"tail",selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:t.project,branch:t.attribution==="unattributed"?"native session":t.attribution,role:"native session",model:null,harnessSessionId:t.sessionId,terminalSurface:null,harnessLogPath:t.logPath,conversationId:null,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null}}function fe(t){return t.agentClass==="native-session"||t.id.startsWith("native:")}function de(t,o){if(t.agent){const r=o.find(c=>c.id===t.agent.id);if(r)return r}return Ye(t)}function Xe(t,o){const r=o.find(c=>c.sessionId?.trim()===t.sessionId);return r||{source:t.source,transcriptPath:t.logPath??"",sessionId:t.sessionId,cwd:t.cwd,project:t.project,harness:t.attribution,mtimeMs:t.lastActiveAt,size:0}}function Ze(t,o){const r=t.harnessSessionId?.trim();if(!r)throw new Error("This native session has no session id to continue.");const c=t.projectRoot?.trim()||t.cwd?.trim();if(!c)throw new Error("This native session has no project path to route from.");const d=t.harness?.trim(),x=t.model?.trim();return{target:{projectPath:c},execution:{session:"existing",targetSessionId:r,...d?{harness:d}:{},...x?{model:x}:{}},agent:{persistence:"one_time",...t.handle?.trim()?{handle:t.handle.trim()}:{}},seed:{instructions:o}}}async function et(t,o){if(fe(t)){await K("/api/sessions",{method:"POST",body:JSON.stringify(Ze(t,o))});return}const r=await me(t);await K("/api/send",{method:"POST",body:JSON.stringify({body:o,chatId:r,execution:{...t.harness?.trim()?{harness:t.harness.trim()}:{},...t.model?.trim()?{model:t.model.trim()}:{}}})})}function tt(t,o,r){return t.live?"active":t.lastActiveAt>0&&o-t.lastActiveAt<=r?"recent":"idle"}function as({navigate:t,agents:o}){const r=Ae(),{openFilePreview:c}=Te(),{activityFilter:d,sourceFilter:x,activityWindowMs:v,groupMode:G,query:J,focusedId:F,revealRequest:A}=r,[Y,X]=n.useState([]),[O,pe]=n.useState(null),[y,he]=n.useState(()=>Date.now()),T=be(o),P=n.useRef([]);Le(e=>{P.current.push(e)}),n.useEffect(()=>{const e=setInterval(()=>{if(P.current.length===0)return;const s=P.current;P.current=[],X(i=>{const p=new Set(i.map(w=>w.id)),u=s.filter(w=>!w.id||!p.has(w.id));if(u.length===0)return i;const h=i.concat(u);return h.length>$?h.slice(h.length-$):h})},Qe);return()=>clearInterval(e)},[]),n.useEffect(()=>{const e=setInterval(()=>he(Date.now()),1e4);return()=>clearInterval(e)},[]),n.useEffect(()=>{let e=!1;return K(`/api/tail/recent?limit=${Ue}`).then(s=>{if(e)return;const i=s.events??[];X(p=>{const u=new Set(p.map(w=>w.id)),h=i.filter(w=>!u.has(w.id)).concat(p);return h.length>$?h.slice(h.length-$):h})}).catch(()=>{}),()=>{e=!0}},[]),n.useEffect(()=>{let e=!1;const s=async()=>{try{const p=await K("/api/tail/discover");e||pe(p)}catch{}};s();const i=setInterval(()=>{s()},ze);return()=>{e=!0,clearInterval(i)}},[]);const Z=n.useMemo(()=>{const e=new Map;for(const s of o){const i=T[s.id],p=[s.harnessSessionId,i?.sessionId,i?.data.metadata?.session?.externalSessionId].map(u=>u?.trim()).filter(u=>!!u);e.set(s.id,[...new Set(p)])}return e},[o,T]),R=n.useMemo(()=>Pe({events:Me(Y),transcripts:O?.transcripts??[],agents:Je(o,Z),now:y,liveWindowMs:Oe}),[o,O?.transcripts,y,Z,Y]),[g,V]=n.useState(null),I=n.useMemo(()=>{const e=_e(De(R,{sourceFilter:x,activityFilter:d,query:J,now:y,activeWindowMs:v}),G);if(!g)return e;const s=e.find(i=>i.id===g);return s?[s,...e.filter(i=>i.id!==g)]:e},[d,v,G,R,y,g,J,x]),ee=n.useRef(null),q=n.useRef({w:0,h:0}),te=n.useRef(0);te.current=I.length;const[m,ve]=n.useState(()=>We(0,{w:0,h:0})),H=n.useRef(m),_=n.useCallback((e,s)=>{const i=$e(H.current,e,s);i!==H.current&&(H.current=i,ve(i))},[]);n.useEffect(()=>{const e=ee.current;if(!e)return;const s=new ResizeObserver(([i])=>{q.current={w:i.contentRect.width,h:i.contentRect.height},_(te.current,q.current)});return s.observe(e),()=>s.disconnect()},[_]),n.useLayoutEffect(()=>{_(I.length,q.current)},[I.length,_]);const E=n.useMemo(()=>I.slice(0,m.shown),[I,m.shown]),se=n.useRef(1);se.current=Math.max(1,m.cols),n.useEffect(()=>{Re(I.map(e=>({id:e.id,name:e.agent?.name??Ve(e),handle:e.agent?.handle??Ke(e),harness:e.source,branch:e.agent?.branch??null,project:e.project,model:e.agent?.model??null,state:e.agent?.state??null,agentClass:e.agent?"agent":"native-session",updatedAt:e.lastActiveAt,source:e.agent||e.attribution==="scout-managed"?"scout":"native",activity:tt(e,y,v),lastActiveAt:e.lastActiveAt})))},[v,y,I]);const[we,ne]=n.useState(null),re=n.useRef(null),k=n.useRef(null);n.useEffect(()=>{A&&re.current!==A.serial&&(re.current=A.serial,V(A.id),ne(A.id),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>ne(null),Ge),ge(A.serial))},[A]),n.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const N=F?R.find(e=>e.id===F)??null:null,f=n.useMemo(()=>N?de(N,o):null,[o,N]),Ie=N?.agent?T[N.agent.id]?.data??null:null,[S,C]=n.useState(null),[j,D]=n.useState(!1),xe=S?E.findIndex(e=>e.id===S):-1,ie=n.useRef({index:-1,ids:[]});ie.current={index:xe,ids:E.map(e=>e.id)};const B=S?R.find(e=>e.id===S)??null:null,l=j?B:null;n.useEffect(()=>{j&&!B&&D(!1)},[B,j]);const Q=n.useRef(new Map),ye=n.useCallback((e,s)=>{s?Q.current.set(e,s):Q.current.delete(e)},[]);n.useEffect(()=>{S&&Q.current.get(S)?.focus({preventScroll:!0})},[S]);const oe=n.useMemo(()=>{if(!l)return null;const e=de(l,o),s=(l.agent?T[l.agent.id]?.data??null:null)??Fe(Xe(l,O?.transcripts??[]),l.lines,l.live,{now:y});return{id:l.id,agent:e,source:l.agent?"scout":"native",observe:s,lastActiveAt:l.lastActiveAt,current:l.live}},[o,O?.transcripts,y,T,l]),ae=n.useCallback(e=>{t({view:"ops",mode:"tail",tailQuery:e.sessionId})},[t]),z=n.useCallback(e=>{C(e),D(!0)},[]),le=n.useRef({focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents});le.current={focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents},n.useEffect(()=>{const e=s=>{if(Ee(s.target))return;const i=le.current;if(i.focusedId){s.key==="Escape"&&b(null);return}if(je())return;if(s.key==="Escape"){i.railOpen?D(!1):i.selectedIds.length>0?ue():i.pinnedId?V(null):C(null);return}if((s.metaKey||s.ctrlKey)&&s.key==="a"){if(i.visibleAgents.length===0)return;s.preventDefault();const W=i.visibleAgents.map(L=>L.id);if(W.every(L=>i.selectedIds.includes(L))){ue();return}for(const L of W)i.selectedIds.includes(L)||U(L);return}if(s.metaKey||s.ctrlKey||s.altKey)return;const{index:p,ids:u}=ie.current;if(u.length===0)return;const h=Be(s.key);if(h){s.preventDefault();const W=He(p,u.length,se.current,h);C(u[W]??null);return}const w=p<0?0:p,M=u[w];if(M){if(s.key==="Enter"||s.key==="i"){s.preventDefault(),z(M);return}if(s.key==="o"){s.preventDefault(),C(M),b(M);return}(s.key==="x"||s.key===" ")&&(s.preventDefault(),C(M),U(M))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[z]);const Se=E.reduce((e,s)=>e+s.lines.length,0),ce=R.length-I.length;return a.jsxs("div",{className:"s-wall",children:[a.jsxs("div",{className:"s-wall-status",children:[a.jsx("span",{className:"s-wall-status-key",children:"logs"}),a.jsxs("span",{className:"s-wall-status-value",children:[m.shown,"/",I.length]}),a.jsx("span",{className:"s-wall-status-key",children:"grid"}),a.jsx("span",{className:"s-wall-status-value",children:m.cols>0?`${m.cols}×${m.rows}`:"—"}),a.jsx("span",{className:"s-wall-status-key",children:"lines"}),a.jsx("span",{className:"s-wall-status-value",children:Se}),m.hidden>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Least recently active logs are withheld to keep panes readable",children:[m.hidden," withheld"]}),ce>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Sessions discovery knows of that have produced no output to tail",children:[ce," quiet"]}),E.length>0&&a.jsxs("span",{className:"s-wall-status-keys",children:[a.jsx("kbd",{children:"hjkl"})," move · ",a.jsx("kbd",{children:"⏎"})," context · ",a.jsx("kbd",{children:"o"})," expand"]}),g&&a.jsx("button",{type:"button",className:"s-wall-status-pin",onClick:()=>V(null),children:"unpin"})]}),a.jsx("div",{ref:ee,className:`s-wall-grid${j?" s-wall-grid--railed":""}`,style:{gridTemplateColumns:`repeat(${Math.max(1,m.cols)}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${Math.max(1,m.rows)}, minmax(0, 1fr))`,gap:qe},children:E.length===0?a.jsxs("div",{className:"s-wall-empty",children:[a.jsx("div",{className:"s-wall-empty-title",children:R.length===0?"No logs on the wire":"No matching logs"}),a.jsx("div",{className:"s-wall-empty-sub",children:R.length===0?"Panes appear as sessions start writing to their transcripts.":"Widen the activity window or clear the filter."})]}):E.map(e=>a.jsx(Ce,{log:e,selected:r.selectedIds.includes(e.id),revealed:we===e.id,cursor:S===e.id,paneRef:s=>ye(e.id,s),onOpen:()=>z(e.id),onToggleSelected:()=>U(e.id),onOpenLog:()=>ae(e)},e.id))}),l&&oe&&a.jsx(ke,{log:l,lane:oe,onClose:()=>D(!1),onExpand:()=>b(l.id),onTail:()=>ae(l),onOpenLog:()=>t({view:"sessions",sessionId:l.sessionId}),onOpenFile:c}),f&&a.jsx(Ne,{agent:f,observe:Ie,onClose:()=>b(null),onSend:e=>et(f,e),onOpenConversation:()=>{if(b(null),fe(f)&&f.harnessSessionId){t({view:"sessions",sessionId:f.harnessSessionId});return}me(f).then(e=>t({view:"conversation",conversationId:e})).catch(()=>t({view:"agents-v2",agentId:f.id,tab:"message"}))},onTail:()=>{b(null),t({view:"ops",mode:"tail",tailQuery:f.harnessSessionId??f.handle??f.name})},onProfile:()=>{b(null),t({view:"agents-v2",agentId:f.id})}})]})}export{as as MissionControlView};
1
+ import{r as n,j as a}from"./index-DmFAhGPj.js";/* empty css */import{a as K}from"./api-h5zurxmi.js";import{u as Ae,f as Re,g as ge,t as U,h as b,e as ue}from"./mission-control-store-Ce6dOvnZ.js";import{u as be}from"./observe-BSWVM8YA.js";import{e as me}from"./NewChatComposer-Hd7pI5Ac.js";import{i as Ee,c as je}from"./keyboard-nav-h1IdakpD.js";import{g as Me}from"./tail-display-BRcJltQa.js";import{u as Le}from"./tail-events-BdvqZHLr.js";import{u as Te}from"./Provider-cJCdHAxu.js";import{MissionContextRail as ke}from"./MissionContextRail-Y8QxUZGE.js";import{FocusOverlay as Ne}from"./MissionFocusOverlay-BPnAEA3F.js";import{MissionLogPane as Ce}from"./MissionLogPane-B0csI89E.js";import{o as Fe}from"./agent-lanes-model-VYQ5a68i.js";import{A as Oe}from"./mission-control-model-C0fByIjm.js";import{b as Pe,s as _e,f as De,c as We,n as $e,d as Ke,m as Ve,W as qe}from"./mission-wall-CocIM1cF.js";import"./colors-BtO5_zlx.js";import"./surface-activity-B1rgWB1i.js";import"./runtime-picker--IW3cRry.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./createLucideIcon-CFBn0Sdk.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./index-CmwGCxUk.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./time-Dhsh_2EG.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./x-C8ayPBtj.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./file-text-DcYSrI4v.js";import"./lane-edit-display-C_Aujldz.js";import"./index-BWHgHrtv.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./sse-CxXt4tqI.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./bash-format-BRV5C6Gv.js";import"./context-budget-DX_fwUs3.js";import"./page-status-D2FQLJOX.js";import"./agent-lane-detail-BNNm6FNu.js";import"./lane-observe-BA3g9aVd.js";import"./agent-lane-preview-C33Dwpn7.js";import"./lane-ask-display-B6iCAVcd.js";function He(t,o,r,c){if(o<=0)return-1;const d=o-1,x=Math.max(1,Math.floor(r));if(t<0||t>d)return c==="left"||c==="up"||c==="last"?d:0;switch(c){case"first":return 0;case"last":return d;case"left":return Math.max(0,t-1);case"right":return Math.min(d,t+1);case"up":{const v=t-x;return v>=0?v:t}case"down":{const v=t+x;return v<=d?v:d}}}function Be(t){switch(t){case"h":case"ArrowLeft":return"left";case"l":case"ArrowRight":return"right";case"k":case"ArrowUp":return"up";case"j":case"ArrowDown":return"down";case"g":case"Home":return"first";case"G":case"End":return"last";default:return null}}const $=4e3,Qe=250,ze=3e4,Ue=1500,Ge=1800;function Je(t,o){return t.map(r=>({id:r.id,name:r.name,handle:r.handle,state:r.state,project:r.project,branch:r.branch,harness:r.harness,model:r.model,sessionIds:o.get(r.id)??[]}))}function Ye(t){return{id:`native:${t.source}:${t.sessionId}`,definitionId:`native:${t.source}:${t.sessionId}`,name:`${t.source} · ${t.project}`,handle:t.sessionId.slice(0,8),agentClass:"native-session",harness:t.source,state:t.live?"working":"ready",projectRoot:t.cwd,cwd:t.cwd,updatedAt:t.lastActiveAt,createdAt:null,transport:"tail",selector:null,defaultSelector:null,nodeQualifier:null,workspaceQualifier:null,wakePolicy:null,capabilities:[],project:t.project,branch:t.attribution==="unattributed"?"native session":t.attribution,role:"native session",model:null,harnessSessionId:t.sessionId,terminalSurface:null,harnessLogPath:t.logPath,conversationId:null,homeNodeId:null,homeNodeName:null,ownerId:null,ownerName:null,ownerHandle:null,staleLocalRegistration:!1,retiredFromFleet:!1,replacedByAgentId:null}}function fe(t){return t.agentClass==="native-session"||t.id.startsWith("native:")}function de(t,o){if(t.agent){const r=o.find(c=>c.id===t.agent.id);if(r)return r}return Ye(t)}function Xe(t,o){const r=o.find(c=>c.sessionId?.trim()===t.sessionId);return r||{source:t.source,transcriptPath:t.logPath??"",sessionId:t.sessionId,cwd:t.cwd,project:t.project,harness:t.attribution,mtimeMs:t.lastActiveAt,size:0}}function Ze(t,o){const r=t.harnessSessionId?.trim();if(!r)throw new Error("This native session has no session id to continue.");const c=t.projectRoot?.trim()||t.cwd?.trim();if(!c)throw new Error("This native session has no project path to route from.");const d=t.harness?.trim(),x=t.model?.trim();return{target:{projectPath:c},execution:{session:"existing",targetSessionId:r,...d?{harness:d}:{},...x?{model:x}:{}},agent:{persistence:"one_time",...t.handle?.trim()?{handle:t.handle.trim()}:{}},seed:{instructions:o}}}async function et(t,o){if(fe(t)){await K("/api/sessions",{method:"POST",body:JSON.stringify(Ze(t,o))});return}const r=await me(t);await K("/api/send",{method:"POST",body:JSON.stringify({body:o,chatId:r,execution:{...t.harness?.trim()?{harness:t.harness.trim()}:{},...t.model?.trim()?{model:t.model.trim()}:{}}})})}function tt(t,o,r){return t.live?"active":t.lastActiveAt>0&&o-t.lastActiveAt<=r?"recent":"idle"}function as({navigate:t,agents:o}){const r=Ae(),{openFilePreview:c}=Te(),{activityFilter:d,sourceFilter:x,activityWindowMs:v,groupMode:G,query:J,focusedId:F,revealRequest:A}=r,[Y,X]=n.useState([]),[O,pe]=n.useState(null),[y,he]=n.useState(()=>Date.now()),T=be(o),P=n.useRef([]);Le(e=>{P.current.push(e)}),n.useEffect(()=>{const e=setInterval(()=>{if(P.current.length===0)return;const s=P.current;P.current=[],X(i=>{const p=new Set(i.map(w=>w.id)),u=s.filter(w=>!w.id||!p.has(w.id));if(u.length===0)return i;const h=i.concat(u);return h.length>$?h.slice(h.length-$):h})},Qe);return()=>clearInterval(e)},[]),n.useEffect(()=>{const e=setInterval(()=>he(Date.now()),1e4);return()=>clearInterval(e)},[]),n.useEffect(()=>{let e=!1;return K(`/api/tail/recent?limit=${Ue}`).then(s=>{if(e)return;const i=s.events??[];X(p=>{const u=new Set(p.map(w=>w.id)),h=i.filter(w=>!u.has(w.id)).concat(p);return h.length>$?h.slice(h.length-$):h})}).catch(()=>{}),()=>{e=!0}},[]),n.useEffect(()=>{let e=!1;const s=async()=>{try{const p=await K("/api/tail/discover");e||pe(p)}catch{}};s();const i=setInterval(()=>{s()},ze);return()=>{e=!0,clearInterval(i)}},[]);const Z=n.useMemo(()=>{const e=new Map;for(const s of o){const i=T[s.id],p=[s.harnessSessionId,i?.sessionId,i?.data.metadata?.session?.externalSessionId].map(u=>u?.trim()).filter(u=>!!u);e.set(s.id,[...new Set(p)])}return e},[o,T]),R=n.useMemo(()=>Pe({events:Me(Y),transcripts:O?.transcripts??[],agents:Je(o,Z),now:y,liveWindowMs:Oe}),[o,O?.transcripts,y,Z,Y]),[g,V]=n.useState(null),I=n.useMemo(()=>{const e=_e(De(R,{sourceFilter:x,activityFilter:d,query:J,now:y,activeWindowMs:v}),G);if(!g)return e;const s=e.find(i=>i.id===g);return s?[s,...e.filter(i=>i.id!==g)]:e},[d,v,G,R,y,g,J,x]),ee=n.useRef(null),q=n.useRef({w:0,h:0}),te=n.useRef(0);te.current=I.length;const[m,ve]=n.useState(()=>We(0,{w:0,h:0})),H=n.useRef(m),_=n.useCallback((e,s)=>{const i=$e(H.current,e,s);i!==H.current&&(H.current=i,ve(i))},[]);n.useEffect(()=>{const e=ee.current;if(!e)return;const s=new ResizeObserver(([i])=>{q.current={w:i.contentRect.width,h:i.contentRect.height},_(te.current,q.current)});return s.observe(e),()=>s.disconnect()},[_]),n.useLayoutEffect(()=>{_(I.length,q.current)},[I.length,_]);const E=n.useMemo(()=>I.slice(0,m.shown),[I,m.shown]),se=n.useRef(1);se.current=Math.max(1,m.cols),n.useEffect(()=>{Re(I.map(e=>({id:e.id,name:e.agent?.name??Ve(e),handle:e.agent?.handle??Ke(e),harness:e.source,branch:e.agent?.branch??null,project:e.project,model:e.agent?.model??null,state:e.agent?.state??null,agentClass:e.agent?"agent":"native-session",updatedAt:e.lastActiveAt,source:e.agent||e.attribution==="scout-managed"?"scout":"native",activity:tt(e,y,v),lastActiveAt:e.lastActiveAt})))},[v,y,I]);const[we,ne]=n.useState(null),re=n.useRef(null),k=n.useRef(null);n.useEffect(()=>{A&&re.current!==A.serial&&(re.current=A.serial,V(A.id),ne(A.id),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>ne(null),Ge),ge(A.serial))},[A]),n.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const N=F?R.find(e=>e.id===F)??null:null,f=n.useMemo(()=>N?de(N,o):null,[o,N]),Ie=N?.agent?T[N.agent.id]?.data??null:null,[S,C]=n.useState(null),[j,D]=n.useState(!1),xe=S?E.findIndex(e=>e.id===S):-1,ie=n.useRef({index:-1,ids:[]});ie.current={index:xe,ids:E.map(e=>e.id)};const B=S?R.find(e=>e.id===S)??null:null,l=j?B:null;n.useEffect(()=>{j&&!B&&D(!1)},[B,j]);const Q=n.useRef(new Map),ye=n.useCallback((e,s)=>{s?Q.current.set(e,s):Q.current.delete(e)},[]);n.useEffect(()=>{S&&Q.current.get(S)?.focus({preventScroll:!0})},[S]);const oe=n.useMemo(()=>{if(!l)return null;const e=de(l,o),s=(l.agent?T[l.agent.id]?.data??null:null)??Fe(Xe(l,O?.transcripts??[]),l.lines,l.live,{now:y});return{id:l.id,agent:e,source:l.agent?"scout":"native",observe:s,lastActiveAt:l.lastActiveAt,current:l.live}},[o,O?.transcripts,y,T,l]),ae=n.useCallback(e=>{t({view:"ops",mode:"tail",tailQuery:e.sessionId})},[t]),z=n.useCallback(e=>{C(e),D(!0)},[]),le=n.useRef({focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents});le.current={focusedId:F,railOpen:j,pinnedId:g,selectedIds:r.selectedIds,visibleAgents:r.visibleAgents},n.useEffect(()=>{const e=s=>{if(Ee(s.target))return;const i=le.current;if(i.focusedId){s.key==="Escape"&&b(null);return}if(je())return;if(s.key==="Escape"){i.railOpen?D(!1):i.selectedIds.length>0?ue():i.pinnedId?V(null):C(null);return}if((s.metaKey||s.ctrlKey)&&s.key==="a"){if(i.visibleAgents.length===0)return;s.preventDefault();const W=i.visibleAgents.map(L=>L.id);if(W.every(L=>i.selectedIds.includes(L))){ue();return}for(const L of W)i.selectedIds.includes(L)||U(L);return}if(s.metaKey||s.ctrlKey||s.altKey)return;const{index:p,ids:u}=ie.current;if(u.length===0)return;const h=Be(s.key);if(h){s.preventDefault();const W=He(p,u.length,se.current,h);C(u[W]??null);return}const w=p<0?0:p,M=u[w];if(M){if(s.key==="Enter"||s.key==="i"){s.preventDefault(),z(M);return}if(s.key==="o"){s.preventDefault(),C(M),b(M);return}(s.key==="x"||s.key===" ")&&(s.preventDefault(),C(M),U(M))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[z]);const Se=E.reduce((e,s)=>e+s.lines.length,0),ce=R.length-I.length;return a.jsxs("div",{className:"s-wall",children:[a.jsxs("div",{className:"s-wall-status",children:[a.jsx("span",{className:"s-wall-status-key",children:"logs"}),a.jsxs("span",{className:"s-wall-status-value",children:[m.shown,"/",I.length]}),a.jsx("span",{className:"s-wall-status-key",children:"grid"}),a.jsx("span",{className:"s-wall-status-value",children:m.cols>0?`${m.cols}×${m.rows}`:"—"}),a.jsx("span",{className:"s-wall-status-key",children:"lines"}),a.jsx("span",{className:"s-wall-status-value",children:Se}),m.hidden>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Least recently active logs are withheld to keep panes readable",children:[m.hidden," withheld"]}),ce>0&&a.jsxs("span",{className:"s-wall-status-hidden",title:"Sessions discovery knows of that have produced no output to tail",children:[ce," quiet"]}),E.length>0&&a.jsxs("span",{className:"s-wall-status-keys",children:[a.jsx("kbd",{children:"hjkl"})," move · ",a.jsx("kbd",{children:"⏎"})," context · ",a.jsx("kbd",{children:"o"})," expand"]}),g&&a.jsx("button",{type:"button",className:"s-wall-status-pin",onClick:()=>V(null),children:"unpin"})]}),a.jsx("div",{ref:ee,className:`s-wall-grid${j?" s-wall-grid--railed":""}`,style:{gridTemplateColumns:`repeat(${Math.max(1,m.cols)}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${Math.max(1,m.rows)}, minmax(0, 1fr))`,gap:qe},children:E.length===0?a.jsxs("div",{className:"s-wall-empty",children:[a.jsx("div",{className:"s-wall-empty-title",children:R.length===0?"No logs on the wire":"No matching logs"}),a.jsx("div",{className:"s-wall-empty-sub",children:R.length===0?"Panes appear as sessions start writing to their transcripts.":"Widen the activity window or clear the filter."})]}):E.map(e=>a.jsx(Ce,{log:e,selected:r.selectedIds.includes(e.id),revealed:we===e.id,cursor:S===e.id,paneRef:s=>ye(e.id,s),onOpen:()=>z(e.id),onToggleSelected:()=>U(e.id),onOpenLog:()=>ae(e)},e.id))}),l&&oe&&a.jsx(ke,{log:l,lane:oe,onClose:()=>D(!1),onExpand:()=>b(l.id),onTail:()=>ae(l),onOpenLog:()=>t({view:"sessions",sessionId:l.sessionId}),onOpenFile:c}),f&&a.jsx(Ne,{agent:f,observe:Ie,onClose:()=>b(null),onSend:e=>et(f,e),onOpenConversation:()=>{if(b(null),fe(f)&&f.harnessSessionId){t({view:"sessions",sessionId:f.harnessSessionId});return}me(f).then(e=>t({view:"conversation",conversationId:e})).catch(()=>t({view:"agents-v2",agentId:f.id,tab:"message"}))},onTail:()=>{b(null),t({view:"ops",mode:"tail",tailQuery:f.harnessSessionId??f.handle??f.name})},onProfile:()=>{b(null),t({view:"agents-v2",agentId:f.id})}})]})}export{as as MissionControlView};
@@ -1 +1 @@
1
- import{r as f,j as e}from"./index-BZovGpDk.js";import{d as w,c as N,n as $}from"./colors-BtO5_zlx.js";import{u as C}from"./keyboard-nav-CHo_xmjw.js";import{t as j}from"./time-Dhsh_2EG.js";import{f as M}from"./text-DsBWV_4k.js";import{s as v}from"./page-status-Bg2hd27j.js";import{M as S}from"./runtime-picker-BXKJbLot.js";import"./index-DiiEQwdc.js";import{K as k}from"./mission-control-model-C0fByIjm.js";import"./scout-voice-D8Q5sZOL.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-B-l2Wj3-.js";import"./createLucideIcon-DCq_3fQn.js";function Q({agent:s,observe:a,onClose:l,onSend:o,onOpenConversation:r,onTail:d,onProfile:h}){const p=w(s.name),{ref:m,onKeyDown:u}=C(),[i,n]=f.useState("profile"),c=t=>{if(u(t),t.defaultPrevented)return;const y=t.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||(y?.isContentEditable??!1)||(t.key==="1"?(t.preventDefault(),n("profile")):t.key==="2"?(t.preventDefault(),n("activity")):t.key==="3"&&(t.preventDefault(),n("message")))};return e.jsx("div",{className:"s-mission-overlay",onClick:l,children:e.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":"mission-overlay-title",onClick:t=>t.stopPropagation(),onKeyDown:c,tabIndex:-1,className:"s-mission-overlay-dialog",children:[e.jsxs("div",{className:"s-mission-overlay-header",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:p},children:s.name[0]?.toUpperCase()}),e.jsxs("div",{className:"s-mission-overlay-identity",children:[e.jsxs("div",{className:"s-mission-overlay-name",id:"mission-overlay-title",children:[s.name," ",e.jsx("span",{className:"s-mission-overlay-handle",children:s.handle?`@${s.handle}`:""})]}),e.jsxs("div",{className:"s-mission-overlay-meta",children:[s.project??"—"," · ",s.branch??"main"," · ",N(s.state)]})]}),e.jsx("button",{className:"s-mission-overlay-close",onClick:l,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs",role:"tablist",children:[e.jsxs("div",{className:"s-mission-overlay-tabs-group",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":i==="profile",className:`s-mission-overlay-tab${i==="profile"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("profile"),children:"Profile"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="activity",className:`s-mission-overlay-tab${i==="activity"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("activity"),children:"Activity"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="message",className:`s-mission-overlay-tab${i==="message"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("message"),children:"Message"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs-action",children:[i==="profile"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:h,...v({label:`Open profile · ${s.handle??s.name}`,route:`/agents/${s.id}`}),children:"Open profile ↗"}),i==="activity"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:d,...v({label:`Tail · ${s.handle??s.name}`,route:`/ops/tail?q=${encodeURIComponent(s.handle??s.name)}`}),children:"Open in Tail ↗"}),i==="message"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:r,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"})]})]}),e.jsxs("div",{className:"s-mission-overlay-body",children:[i==="profile"&&e.jsx(E,{agent:s}),i==="activity"&&e.jsx(D,{agent:s,observe:a,onOpenConversation:r,onMessage:()=>n("message")}),i==="message"&&e.jsx(O,{agent:s,onSend:o,onOpenConversation:r})]})]})})}function E({agent:s}){const a=[["MODEL",[s.harness,s.model].filter(Boolean).join("/")||"—"],["AT",[s.project,s.branch].filter(Boolean).join("/")||"—"],["CWD",s.cwd||s.projectRoot||"—"],["AGENT",s.agentClass||"—"],["ROLE",s.role||s.transport||"—"],["MACHINE",s.authorityNodeName??s.homeNodeName??s.authorityNodeId??s.homeNodeId??"—"],["OWNER",s.ownerHandle??s.ownerName??s.ownerId??"—"],["SPAWNED",s.createdAt?j(s.createdAt):"—"],["STATE",N(s.state)]];return e.jsx("div",{className:"s-focus-tab",children:e.jsx("dl",{className:"s-focus-spec",children:a.map(([l,o])=>e.jsxs("div",{className:"s-focus-spec-row",children:[e.jsx("dt",{className:"s-focus-spec-label",children:l}),e.jsx("dd",{className:"s-focus-spec-value",title:o,children:o})]},l))})})}const T={tool:"▸",think:"·",ask:"?",message:"✉",note:"•",system:"◇",boot:"↑"};function A(s,a){if(a){const o=Date.now()-(a+s*1e3);return o<6e4?`${Math.max(0,Math.round(o/1e3))}s`:o<36e5?`${Math.round(o/6e4)}m`:o<864e5?`${Math.round(o/36e5)}h`:`${Math.round(o/864e5)}d`}const l=Math.max(0,Math.round(s));return l<60?`${l}s`:l<3600?`${Math.round(l/60)}m`:`${Math.round(l/3600)}h`}function I(s){if(s.kind==="tool"){const a=s.tool??"tool";return s.arg?`${a} · ${s.arg}`:a}return s.kind==="ask"?s.text||"request received":s.text||s.detail||k[s.kind]||s.kind}function D({agent:s,observe:a,onOpenConversation:l,onMessage:o}){const r=a?.events??[],d=a?.metadata?.usage,h=typeof a?.metadata?.session?.sessionStart=="number"?(a?.metadata?.session).sessionStart:null,p=r.slice(-14).reverse(),m=d?.assistantMessages??r.filter(t=>t.kind==="message").length,u=r.filter(t=>t.kind==="tool").length,i=r.filter(t=>t.kind==="tool"&&(t.tool==="edit"||t.tool==="write")).length,n=a?.contextUsage&&a.contextUsage.length>0?Math.round(a.contextUsage[a.contextUsage.length-1]*100):null,c=n!==null?`${n}%`:d?.contextWindowTokens&&d?.contextInputTokens?`${Math.round(d.contextInputTokens/d.contextWindowTokens*100)}%`:"—";return e.jsxs("div",{className:"s-focus-tab s-focus-tab--activity-preview",children:[e.jsxs("dl",{className:"s-focus-stats",children:[e.jsx(b,{label:"Turns",value:m||"—"}),e.jsx(b,{label:"Tools",value:u||"—"}),e.jsx(b,{label:"Edits",value:i||"—"}),e.jsx(b,{label:"Context",value:c})]}),p.length===0?e.jsx(L,{agent:s,onOpenConversation:l,onMessage:o}):e.jsx("ul",{className:"s-focus-activity-list",children:p.map(t=>e.jsxs("li",{className:`s-focus-activity-row s-focus-activity-row--${t.kind}`,children:[e.jsx("span",{className:"s-focus-activity-time",children:A(t.t,h)}),e.jsx("span",{className:"s-focus-activity-glyph","aria-hidden":!0,children:T[t.kind]??"·"}),e.jsx("span",{className:"s-focus-activity-kind",children:k[t.kind]??t.kind}),e.jsx("span",{className:"s-focus-activity-text",children:I(t)})]},t.id))})]})}function L({agent:s,onOpenConversation:a,onMessage:l}){const o=M(s.role),r=[s.harness,s.model].filter(Boolean).join("/"),d=[s.project,s.branch].filter(Boolean).join("/"),h=$(s.state),p=N(h),m=s.createdAt?j(s.createdAt):null,u=s.updatedAt?j(s.updatedAt):null,i=s.homeNodeName??s.homeNodeId,n=s.ownerHandle??s.ownerName??s.ownerId,c=[];return o&&c.push({label:"Role",value:o}),r&&c.push({label:"Stack",value:r}),d&&c.push({label:"At",value:d}),i&&c.push({label:"Home",value:i}),n&&c.push({label:"Owner",value:n}),m&&c.push({label:"Spawned",value:m}),c.push({label:"State",value:p}),u&&c.push({label:"Last seen",value:u}),e.jsxs("div",{className:"s-focus-activity-empty s-focus-activity-empty--rich",children:[e.jsxs("div",{className:"s-focus-activity-empty-head",children:[e.jsx("span",{className:"s-focus-activity-empty-eyebrow",children:"No tool or turn events recorded"}),e.jsx("span",{className:"s-focus-activity-empty-title",children:s.handle??s.name})]}),e.jsx("dl",{className:"s-focus-activity-empty-facts",children:c.map(t=>e.jsxs("div",{className:"s-focus-activity-empty-fact",children:[e.jsx("dt",{children:t.label}),e.jsx("dd",{title:t.value,children:t.value})]},t.label))}),e.jsxs("div",{className:"s-focus-activity-empty-actions",children:[e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn",onClick:a,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"}),e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn s-focus-activity-empty-btn--primary",onClick:l,...v({label:`Compose message · ${s.handle??s.name}`}),children:"Send a message"})]})]})}function b({label:s,value:a}){return e.jsxs("div",{className:"s-focus-stat",children:[e.jsx("dt",{className:"s-focus-stat-label",children:s}),e.jsx("dd",{className:"s-focus-stat-value",children:a})]})}function O({agent:s,onSend:a,onOpenConversation:l}){const[o,r]=f.useState(""),[d,h]=f.useState(!1),[p,m]=f.useState(!1),[u,i]=f.useState(null),n=f.useRef(null);f.useEffect(()=>{n.current?.focus()},[]);const c=async()=>{const y=o.trim();if(!(!y||d)){h(!0),i(null);try{await a(y),r(""),m(!0),setTimeout(()=>m(!1),1800)}catch(x){i(x instanceof Error?x.message:String(x))}finally{h(!1)}}},t=s.handle??s.name;return e.jsx("div",{className:"s-focus-tab",children:e.jsx("div",{className:"s-focus-compose",children:e.jsx(S,{density:"panel",value:o,onChange:r,onSend:()=>{c()},sending:d,placeholder:`Message @${t}…`,textareaRef:n,rows:4,"aria-label":`Message @${t}`,header:e.jsxs("div",{className:"s-focus-compose-label",children:["Message ",e.jsxs("span",{className:"s-focus-compose-target",children:["@",t]})]}),tools:e.jsx("div",{className:"s-focus-compose-hint",children:u?e.jsxs("span",{className:"s-focus-compose-error",children:["Send failed: ",u]}):p?e.jsxs("span",{className:"s-focus-compose-ok",children:["Sent ↗"," ",e.jsx("button",{type:"button",className:"s-focus-compose-link",onClick:l,children:"Open Chat"})]}):e.jsx("span",{children:"Send starts a Run, or steers the active Run when this agent is already working."})})})})})}export{Q as FocusOverlay};
1
+ import{r as f,j as e}from"./index-DmFAhGPj.js";import{d as w,c as N,n as $}from"./colors-BtO5_zlx.js";import{u as C}from"./keyboard-nav-h1IdakpD.js";import{t as j}from"./time-Dhsh_2EG.js";import{f as M}from"./text-DsBWV_4k.js";import{s as v}from"./page-status-D2FQLJOX.js";import{M as S}from"./runtime-picker--IW3cRry.js";import"./index-CmwGCxUk.js";import{K as k}from"./mission-control-model-C0fByIjm.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./createLucideIcon-CFBn0Sdk.js";function Q({agent:s,observe:a,onClose:l,onSend:o,onOpenConversation:r,onTail:d,onProfile:h}){const p=w(s.name),{ref:m,onKeyDown:u}=C(),[i,n]=f.useState("profile"),c=t=>{if(u(t),t.defaultPrevented)return;const y=t.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||(y?.isContentEditable??!1)||(t.key==="1"?(t.preventDefault(),n("profile")):t.key==="2"?(t.preventDefault(),n("activity")):t.key==="3"&&(t.preventDefault(),n("message")))};return e.jsx("div",{className:"s-mission-overlay",onClick:l,children:e.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":"mission-overlay-title",onClick:t=>t.stopPropagation(),onKeyDown:c,tabIndex:-1,className:"s-mission-overlay-dialog",children:[e.jsxs("div",{className:"s-mission-overlay-header",children:[e.jsx("div",{className:"s-ops-avatar",style:{"--size":"28px",background:p},children:s.name[0]?.toUpperCase()}),e.jsxs("div",{className:"s-mission-overlay-identity",children:[e.jsxs("div",{className:"s-mission-overlay-name",id:"mission-overlay-title",children:[s.name," ",e.jsx("span",{className:"s-mission-overlay-handle",children:s.handle?`@${s.handle}`:""})]}),e.jsxs("div",{className:"s-mission-overlay-meta",children:[s.project??"—"," · ",s.branch??"main"," · ",N(s.state)]})]}),e.jsx("button",{className:"s-mission-overlay-close",onClick:l,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"✕"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs",role:"tablist",children:[e.jsxs("div",{className:"s-mission-overlay-tabs-group",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":i==="profile",className:`s-mission-overlay-tab${i==="profile"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("profile"),children:"Profile"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="activity",className:`s-mission-overlay-tab${i==="activity"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("activity"),children:"Activity"}),e.jsx("button",{type:"button",role:"tab","aria-selected":i==="message",className:`s-mission-overlay-tab${i==="message"?" s-mission-overlay-tab--active":""}`,onClick:()=>n("message"),children:"Message"})]}),e.jsxs("div",{className:"s-mission-overlay-tabs-action",children:[i==="profile"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:h,...v({label:`Open profile · ${s.handle??s.name}`,route:`/agents/${s.id}`}),children:"Open profile ↗"}),i==="activity"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:d,...v({label:`Tail · ${s.handle??s.name}`,route:`/ops/tail?q=${encodeURIComponent(s.handle??s.name)}`}),children:"Open in Tail ↗"}),i==="message"&&e.jsx("button",{type:"button",className:"s-mission-overlay-jump",onClick:r,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"})]})]}),e.jsxs("div",{className:"s-mission-overlay-body",children:[i==="profile"&&e.jsx(E,{agent:s}),i==="activity"&&e.jsx(D,{agent:s,observe:a,onOpenConversation:r,onMessage:()=>n("message")}),i==="message"&&e.jsx(O,{agent:s,onSend:o,onOpenConversation:r})]})]})})}function E({agent:s}){const a=[["MODEL",[s.harness,s.model].filter(Boolean).join("/")||"—"],["AT",[s.project,s.branch].filter(Boolean).join("/")||"—"],["CWD",s.cwd||s.projectRoot||"—"],["AGENT",s.agentClass||"—"],["ROLE",s.role||s.transport||"—"],["MACHINE",s.authorityNodeName??s.homeNodeName??s.authorityNodeId??s.homeNodeId??"—"],["OWNER",s.ownerHandle??s.ownerName??s.ownerId??"—"],["SPAWNED",s.createdAt?j(s.createdAt):"—"],["STATE",N(s.state)]];return e.jsx("div",{className:"s-focus-tab",children:e.jsx("dl",{className:"s-focus-spec",children:a.map(([l,o])=>e.jsxs("div",{className:"s-focus-spec-row",children:[e.jsx("dt",{className:"s-focus-spec-label",children:l}),e.jsx("dd",{className:"s-focus-spec-value",title:o,children:o})]},l))})})}const T={tool:"▸",think:"·",ask:"?",message:"✉",note:"•",system:"◇",boot:"↑"};function A(s,a){if(a){const o=Date.now()-(a+s*1e3);return o<6e4?`${Math.max(0,Math.round(o/1e3))}s`:o<36e5?`${Math.round(o/6e4)}m`:o<864e5?`${Math.round(o/36e5)}h`:`${Math.round(o/864e5)}d`}const l=Math.max(0,Math.round(s));return l<60?`${l}s`:l<3600?`${Math.round(l/60)}m`:`${Math.round(l/3600)}h`}function I(s){if(s.kind==="tool"){const a=s.tool??"tool";return s.arg?`${a} · ${s.arg}`:a}return s.kind==="ask"?s.text||"request received":s.text||s.detail||k[s.kind]||s.kind}function D({agent:s,observe:a,onOpenConversation:l,onMessage:o}){const r=a?.events??[],d=a?.metadata?.usage,h=typeof a?.metadata?.session?.sessionStart=="number"?(a?.metadata?.session).sessionStart:null,p=r.slice(-14).reverse(),m=d?.assistantMessages??r.filter(t=>t.kind==="message").length,u=r.filter(t=>t.kind==="tool").length,i=r.filter(t=>t.kind==="tool"&&(t.tool==="edit"||t.tool==="write")).length,n=a?.contextUsage&&a.contextUsage.length>0?Math.round(a.contextUsage[a.contextUsage.length-1]*100):null,c=n!==null?`${n}%`:d?.contextWindowTokens&&d?.contextInputTokens?`${Math.round(d.contextInputTokens/d.contextWindowTokens*100)}%`:"—";return e.jsxs("div",{className:"s-focus-tab s-focus-tab--activity-preview",children:[e.jsxs("dl",{className:"s-focus-stats",children:[e.jsx(b,{label:"Turns",value:m||"—"}),e.jsx(b,{label:"Tools",value:u||"—"}),e.jsx(b,{label:"Edits",value:i||"—"}),e.jsx(b,{label:"Context",value:c})]}),p.length===0?e.jsx(L,{agent:s,onOpenConversation:l,onMessage:o}):e.jsx("ul",{className:"s-focus-activity-list",children:p.map(t=>e.jsxs("li",{className:`s-focus-activity-row s-focus-activity-row--${t.kind}`,children:[e.jsx("span",{className:"s-focus-activity-time",children:A(t.t,h)}),e.jsx("span",{className:"s-focus-activity-glyph","aria-hidden":!0,children:T[t.kind]??"·"}),e.jsx("span",{className:"s-focus-activity-kind",children:k[t.kind]??t.kind}),e.jsx("span",{className:"s-focus-activity-text",children:I(t)})]},t.id))})]})}function L({agent:s,onOpenConversation:a,onMessage:l}){const o=M(s.role),r=[s.harness,s.model].filter(Boolean).join("/"),d=[s.project,s.branch].filter(Boolean).join("/"),h=$(s.state),p=N(h),m=s.createdAt?j(s.createdAt):null,u=s.updatedAt?j(s.updatedAt):null,i=s.homeNodeName??s.homeNodeId,n=s.ownerHandle??s.ownerName??s.ownerId,c=[];return o&&c.push({label:"Role",value:o}),r&&c.push({label:"Stack",value:r}),d&&c.push({label:"At",value:d}),i&&c.push({label:"Home",value:i}),n&&c.push({label:"Owner",value:n}),m&&c.push({label:"Spawned",value:m}),c.push({label:"State",value:p}),u&&c.push({label:"Last seen",value:u}),e.jsxs("div",{className:"s-focus-activity-empty s-focus-activity-empty--rich",children:[e.jsxs("div",{className:"s-focus-activity-empty-head",children:[e.jsx("span",{className:"s-focus-activity-empty-eyebrow",children:"No tool or turn events recorded"}),e.jsx("span",{className:"s-focus-activity-empty-title",children:s.handle??s.name})]}),e.jsx("dl",{className:"s-focus-activity-empty-facts",children:c.map(t=>e.jsxs("div",{className:"s-focus-activity-empty-fact",children:[e.jsx("dt",{children:t.label}),e.jsx("dd",{title:t.value,children:t.value})]},t.label))}),e.jsxs("div",{className:"s-focus-activity-empty-actions",children:[e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn",onClick:a,...v({label:`Open conversation with ${s.handle??s.name}`,...s.conversationId?{route:`/c/${s.conversationId}`}:{}}),children:"Open conversation ↗"}),e.jsx("button",{type:"button",className:"s-focus-activity-empty-btn s-focus-activity-empty-btn--primary",onClick:l,...v({label:`Compose message · ${s.handle??s.name}`}),children:"Send a message"})]})]})}function b({label:s,value:a}){return e.jsxs("div",{className:"s-focus-stat",children:[e.jsx("dt",{className:"s-focus-stat-label",children:s}),e.jsx("dd",{className:"s-focus-stat-value",children:a})]})}function O({agent:s,onSend:a,onOpenConversation:l}){const[o,r]=f.useState(""),[d,h]=f.useState(!1),[p,m]=f.useState(!1),[u,i]=f.useState(null),n=f.useRef(null);f.useEffect(()=>{n.current?.focus()},[]);const c=async()=>{const y=o.trim();if(!(!y||d)){h(!0),i(null);try{await a(y),r(""),m(!0),setTimeout(()=>m(!1),1800)}catch(x){i(x instanceof Error?x.message:String(x))}finally{h(!1)}}},t=s.handle??s.name;return e.jsx("div",{className:"s-focus-tab",children:e.jsx("div",{className:"s-focus-compose",children:e.jsx(S,{density:"panel",value:o,onChange:r,onSend:()=>{c()},sending:d,placeholder:`Message @${t}…`,textareaRef:n,rows:4,"aria-label":`Message @${t}`,header:e.jsxs("div",{className:"s-focus-compose-label",children:["Message ",e.jsxs("span",{className:"s-focus-compose-target",children:["@",t]})]}),tools:e.jsx("div",{className:"s-focus-compose-hint",children:u?e.jsxs("span",{className:"s-focus-compose-error",children:["Send failed: ",u]}):p?e.jsxs("span",{className:"s-focus-compose-ok",children:["Sent ↗"," ",e.jsx("button",{type:"button",className:"s-focus-compose-link",onClick:l,children:"Open Chat"})]}):e.jsx("span",{children:"Send starts a Run, or steers the active Run when this agent is already working."})})})})})}export{Q as FocusOverlay};
@@ -1 +1 @@
1
- import{j as l}from"./index-BZovGpDk.js";import{c as j}from"./colors-BtO5_zlx.js";import{s as x}from"./page-status-Bg2hd27j.js";import{t as i}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-bRkkXIpR.js";import"./AgentAvatar-CneOa70z.js";import"./SpriteAvatar-CEYdCzem.js";import"./agent-identity-BxCsXnDp.js";function E({agent:e,state:t,isExpanded:s,isSelected:a,tabIndex:n,onToggle:c,onReveal:m,onOpen:d}){const r=x({label:`Focus ${e.handle??e.name}`,route:`/ops/control · ${e.id}`}),p=l.jsxs(l.Fragment,{children:[l.jsxs("dl",{className:"rr-spec-list",children:[l.jsx(o,{label:"MODEL",value:[e.harness,e.model].filter(Boolean).join("/")||"—"}),l.jsx(o,{label:"AT",value:[e.project,e.branch].filter(Boolean).join("/")||"—"}),l.jsx(o,{label:"STATE",value:j(t)}),l.jsx(o,{label:"ACTIVITY",value:e.activity}),l.jsx(o,{label:"SOURCE",value:e.source})]}),l.jsxs("div",{className:"ml-detail-actions",children:[l.jsx("button",{type:"button",className:"ml-detail-btn",onClick:m,children:"Reveal on wall"}),l.jsx("button",{type:"button",className:"ml-detail-btn ml-detail-btn--primary",onClick:d,children:"Open ↗"})]})]});return l.jsx(b,{name:e.handle??e.name,meta:e.lastActiveAt?i(e.lastActiveAt):e.updatedAt?i(e.updatedAt):void 0,tone:t,caret:s?"open":"closed",selected:a,expanded:s,detail:p,tabIndex:n,onClick:u=>c(u),onPointerEnter:r.onPointerEnter,onPointerLeave:r.onPointerLeave})}function o({label:e,value:t}){return l.jsxs("div",{className:"rr-spec",children:[l.jsx("dt",{className:"rr-spec-label",children:e}),l.jsx("dd",{className:"rr-spec-value",title:t,children:t})]})}export{E as MissionLeftAgentRow};
1
+ import{j as l}from"./index-DmFAhGPj.js";import{c as j}from"./colors-BtO5_zlx.js";import{s as x}from"./page-status-D2FQLJOX.js";import{t as i}from"./time-Dhsh_2EG.js";import{R as b}from"./RailRow-CLcVmywd.js";import"./AgentAvatar-D8ZtMluU.js";import"./SpriteAvatar-DS6Tmyua.js";import"./agent-identity-BxCsXnDp.js";function E({agent:e,state:t,isExpanded:s,isSelected:a,tabIndex:n,onToggle:c,onReveal:m,onOpen:d}){const r=x({label:`Focus ${e.handle??e.name}`,route:`/ops/control · ${e.id}`}),p=l.jsxs(l.Fragment,{children:[l.jsxs("dl",{className:"rr-spec-list",children:[l.jsx(o,{label:"MODEL",value:[e.harness,e.model].filter(Boolean).join("/")||"—"}),l.jsx(o,{label:"AT",value:[e.project,e.branch].filter(Boolean).join("/")||"—"}),l.jsx(o,{label:"STATE",value:j(t)}),l.jsx(o,{label:"ACTIVITY",value:e.activity}),l.jsx(o,{label:"SOURCE",value:e.source})]}),l.jsxs("div",{className:"ml-detail-actions",children:[l.jsx("button",{type:"button",className:"ml-detail-btn",onClick:m,children:"Reveal on wall"}),l.jsx("button",{type:"button",className:"ml-detail-btn ml-detail-btn--primary",onClick:d,children:"Open ↗"})]})]});return l.jsx(b,{name:e.handle??e.name,meta:e.lastActiveAt?i(e.lastActiveAt):e.updatedAt?i(e.updatedAt):void 0,tone:t,caret:s?"open":"closed",selected:a,expanded:s,detail:p,tabIndex:n,onClick:u=>c(u),onPointerEnter:r.onPointerEnter,onPointerLeave:r.onPointerLeave})}function o({label:e,value:t}){return l.jsxs("div",{className:"rr-spec",children:[l.jsx("dt",{className:"rr-spec-label",children:e}),l.jsx("dd",{className:"rr-spec-value",title:t,children:t})]})}export{E as MissionLeftAgentRow};
@@ -1 +1 @@
1
- import{r as n,j as a}from"./index-BZovGpDk.js";import{H as L}from"./HarnessMark-DrE57dUq.js";import{n as k}from"./colors-BtO5_zlx.js";import{s as y}from"./page-status-Bg2hd27j.js";import{c as P,T as I,b as T}from"./tail-display-BRcJltQa.js";import{d as A}from"./time-Dhsh_2EG.js";import{s as C}from"./mission-control-model-C0fByIjm.js";import{m as H,a as E}from"./mission-wall-CocIM1cF.js";import"./lane-edit-display-C_Aujldz.js";const K=24;function O({log:e,selected:u,revealed:f,cursor:t=!1,onOpen:c,onToggleSelected:h,onOpenLog:w,paneRef:x}){const i=n.useRef(null),p=n.useRef(!0),o=n.useMemo(()=>P(e.lines.map(s=>({event:s,meta:void 0}))),[e.lines]),j=n.useCallback(()=>{const s=i.current;if(!s)return;const l=s.scrollHeight-s.scrollTop-s.clientHeight;p.current=l<=K},[]);n.useEffect(()=>{const s=i.current;!s||!p.current||(s.scrollTop=s.scrollHeight)},[o.length,e.lastActiveAt]);const v=k(e.agent?.state??null),r=H(e),N=E(e),m=[e.project,e.agent?.branch].filter(Boolean).join("/")||e.cwd||"—",d=y({label:`Focus ${r}`,route:`/ops/control · ${e.sessionId}`}),b=s=>{if(s.metaKey||s.ctrlKey||s.shiftKey){h();return}c()};return a.jsxs("div",{ref:x,className:["s-wall-pane",e.live?"s-wall-pane--live":null,u?"s-wall-pane--selected":null,f?"s-wall-pane--revealed":null,t?"s-wall-pane--cursor":null].filter(Boolean).join(" "),"data-cursor":t?!0:void 0,tabIndex:t?0:-1,onClick:b,onPointerEnter:d.onPointerEnter,onPointerLeave:d.onPointerLeave,children:[a.jsxs("div",{className:"s-wall-pane-head",children:[a.jsx("span",{className:"s-wall-pane-dot",style:{background:e.agent?C(v):"var(--dim)"},"aria-hidden":!0}),a.jsx(L,{harness:e.source,size:11,title:null}),a.jsx("button",{type:"button",className:"s-wall-pane-title",title:e.agent?.name??e.sessionId,"aria-label":`Focus ${r}`,onClick:s=>{s.stopPropagation(),c()},children:r}),a.jsx("span",{className:"s-wall-pane-where",title:e.cwd??m,children:m}),a.jsx("span",{className:"s-wall-pane-spacer"}),e.live&&a.jsx("span",{className:"s-wall-pane-live",children:"live"}),a.jsx("button",{type:"button",className:"s-wall-pane-file",title:e.logPath??`session ${e.sessionId}`,onClick:s=>{s.stopPropagation(),w()},children:N})]}),a.jsx("div",{className:"s-wall-pane-body",ref:i,onScroll:j,children:o.length===0?a.jsx("div",{className:"s-wall-pane-idle",children:"no output since page load"}):o.map(({event:s,repeatCount:l})=>a.jsxs("div",{className:`s-wall-line s-wall-line--${s.kind}`,children:[a.jsx("span",{className:"s-wall-line-time",children:A(s.ts,{milliseconds:!1})||"—"}),a.jsx("span",{className:"s-wall-line-glyph",title:T[s.kind],children:I[s.kind]}),a.jsxs("span",{className:"s-wall-line-text",children:[s.summary,l>1&&a.jsxs("span",{className:"s-wall-line-repeat",title:`${l} identical events`,children:[" ","×",l]})]})]},s.id))})]})}export{O as MissionLogPane};
1
+ import{r as n,j as a}from"./index-DmFAhGPj.js";import{H as L}from"./HarnessMark-BPAphNjx.js";import{n as k}from"./colors-BtO5_zlx.js";import{s as y}from"./page-status-D2FQLJOX.js";import{c as P,T as I,b as T}from"./tail-display-BRcJltQa.js";import{d as A}from"./time-Dhsh_2EG.js";import{s as C}from"./mission-control-model-C0fByIjm.js";import{m as H,a as E}from"./mission-wall-CocIM1cF.js";import"./lane-edit-display-C_Aujldz.js";const K=24;function O({log:e,selected:u,revealed:f,cursor:t=!1,onOpen:c,onToggleSelected:h,onOpenLog:w,paneRef:x}){const i=n.useRef(null),p=n.useRef(!0),o=n.useMemo(()=>P(e.lines.map(s=>({event:s,meta:void 0}))),[e.lines]),j=n.useCallback(()=>{const s=i.current;if(!s)return;const l=s.scrollHeight-s.scrollTop-s.clientHeight;p.current=l<=K},[]);n.useEffect(()=>{const s=i.current;!s||!p.current||(s.scrollTop=s.scrollHeight)},[o.length,e.lastActiveAt]);const v=k(e.agent?.state??null),r=H(e),N=E(e),m=[e.project,e.agent?.branch].filter(Boolean).join("/")||e.cwd||"—",d=y({label:`Focus ${r}`,route:`/ops/control · ${e.sessionId}`}),b=s=>{if(s.metaKey||s.ctrlKey||s.shiftKey){h();return}c()};return a.jsxs("div",{ref:x,className:["s-wall-pane",e.live?"s-wall-pane--live":null,u?"s-wall-pane--selected":null,f?"s-wall-pane--revealed":null,t?"s-wall-pane--cursor":null].filter(Boolean).join(" "),"data-cursor":t?!0:void 0,tabIndex:t?0:-1,onClick:b,onPointerEnter:d.onPointerEnter,onPointerLeave:d.onPointerLeave,children:[a.jsxs("div",{className:"s-wall-pane-head",children:[a.jsx("span",{className:"s-wall-pane-dot",style:{background:e.agent?C(v):"var(--dim)"},"aria-hidden":!0}),a.jsx(L,{harness:e.source,size:11,title:null}),a.jsx("button",{type:"button",className:"s-wall-pane-title",title:e.agent?.name??e.sessionId,"aria-label":`Focus ${r}`,onClick:s=>{s.stopPropagation(),c()},children:r}),a.jsx("span",{className:"s-wall-pane-where",title:e.cwd??m,children:m}),a.jsx("span",{className:"s-wall-pane-spacer"}),e.live&&a.jsx("span",{className:"s-wall-pane-live",children:"live"}),a.jsx("button",{type:"button",className:"s-wall-pane-file",title:e.logPath??`session ${e.sessionId}`,onClick:s=>{s.stopPropagation(),w()},children:N})]}),a.jsx("div",{className:"s-wall-pane-body",ref:i,onScroll:j,children:o.length===0?a.jsx("div",{className:"s-wall-pane-idle",children:"no output since page load"}):o.map(({event:s,repeatCount:l})=>a.jsxs("div",{className:`s-wall-line s-wall-line--${s.kind}`,children:[a.jsx("span",{className:"s-wall-line-time",children:A(s.ts,{milliseconds:!1})||"—"}),a.jsx("span",{className:"s-wall-line-glyph",title:T[s.kind],children:I[s.kind]}),a.jsxs("span",{className:"s-wall-line-text",children:[s.summary,l>1&&a.jsxs("span",{className:"s-wall-line-repeat",title:`${l} identical events`,children:[" ","×",l]})]})]},s.id))})]})}export{O as MissionLogPane};
@@ -1 +1 @@
1
- import{r,j as e}from"./index-BZovGpDk.js";import{r as se}from"./index-DiiEQwdc.js";import{a as U}from"./api-h5zurxmi.js";import{u as ne}from"./keyboard-nav-CHo_xmjw.js";import{o as te}from"./openContent-C6XO6kr5.js";import{s as A,w as le}from"./project-overview-helpers-BQTc_Ous.js";import{X as ie}from"./x-CrGUKNRv.js";import{R as re}from"./rocket-BWh18pt_.js";import"./createLucideIcon-DCq_3fQn.js";const V=[{value:"codex",label:"Codex",runtimeId:"codex"},{value:"claude",label:"Claude",runtimeId:"claude"},{value:"pi",label:"Grok",runtimeId:"pi"}];function w(t){return t.trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function oe(t){const n=new Set;for(const o of t){if(!o)continue;const s=w(o);s&&n.add(s)}return n}function ce(t,n,o){const s=t.trim();if(!s)return{status:"auto",normalized:void 0,rewritten:!1,message:o==="sticky"?"Scout will assign a reusable handle from the name pool.":"Scout will assign a disposable handle from the name pool.",tone:"ok"};const l=w(s);return l?n.has(l)?{status:"conflict",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:`@${l} already exists here. Pick another handle or leave it blank for auto.`,tone:"warn"}:{status:"ok",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:null,tone:"ok"}:{status:"invalid",normalized:void 0,rewritten:!1,message:"Use letters, numbers, dot, or dash.",tone:"warn"}}function S(t){return t==="pi"?"grok":t}function de(t,n,o,s=3){const l=w(t)??"agent",m=[l,`${l}-${S(n)}`,`${l}-dev`,`${l}-2`,`${l}-${S(n)}-2`],u=[];for(const v of m){const x=w(v);if(!(!x||o.has(x)||u.includes(x))&&(u.push(x),u.length>=s))break}return u}function ue(t){const{handle:n,persistence:o,harness:s,projectRootLabel:l}=t,m="A card starts a fresh session for each request. Use session:<id> only to continue an exact run.";return o==="one_time"?{disposable:!0,card:null,cli:`scout ask --project ${l} --harness ${s} "…"`,resolves:"Disposable session — Scout assigns a provisional handle that may be recycled. Not addressable later.",note:m}:n?{disposable:!1,card:`@${n}`,cli:`scout ask @${n} "…"`,resolves:`Reusable ${S(s)} session on this project — @${n} routes here from any surface.`,note:m}:{disposable:!1,card:"@auto",cli:'scout ask @<assigned-handle> "…"',resolves:`Scout assigns a reusable ${S(s)} handle from the name pool.`,note:m}}const me={ready:"ready",configured:"configured",installed:"login needed",missing:"not found"},q={ready:"ok",configured:"ok",installed:"warn",missing:"off"};function ke({open:t,onClose:n,projectTitle:o,projectRoot:s,primaryWt:l,worktreeCount:m,branches:u,existingAgents:v,agentCount:x,sessionCount:H,route:D,navigate:C}){const{ref:J,onKeyDown:W}=ne(t),[h,G]=r.useState("codex"),[M,X]=r.useState(""),[d,E]=r.useState("sticky"),[$,P]=r.useState(""),[R,Q]=r.useState(""),[L,I]=r.useState("idle"),[_,j]=r.useState(null),[K,Y]=r.useState(null);r.useEffect(()=>{t&&(j(null),I("idle"))},[t]),r.useEffect(()=>{if(!t)return;let a=!1;return(async()=>{const c=await U("/api/agent-config/snapshot").catch(()=>null);if(a||!c)return;const f=new Map;for(const g of c.runtimes)f.set(g.id,{state:g.state,detail:g.detail,loginCommand:g.loginCommand});Y(f)})(),()=>{a=!0}},[t]),r.useEffect(()=>{if(!t)return;const a=c=>{c.key==="Escape"&&(c.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,n]);const k=r.useMemo(()=>oe(v.flatMap(a=>[a.name,a.handle])),[v]),i=r.useMemo(()=>ce($,k,d),[$,k,d]),z=r.useMemo(()=>de(o,h,k,3),[o,h,k]),T=s?A(s):"<no-root>",p=r.useMemo(()=>ue({handle:i.normalized,persistence:d,harness:h,projectRootLabel:T}),[i.normalized,d,h,T]),N=K?.get(V.find(a=>a.value===h)?.runtimeId??h);if(!t)return null;const Z=!!s&&L!=="starting"&&i.status!=="invalid"&&i.status!=="conflict",ee=L==="starting"?"Starting…":d==="one_time"?"Dispatch one-off":i.status==="conflict"?"Handle exists":i.normalized?`Create @${i.normalized}`:"Create with auto handle",O=async()=>{if(!(!s||L==="starting")){I("starting"),j(null);try{const a=M.trim(),c=R.trim(),f=i.normalized,g=await U("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:s},execution:{session:"new",harness:h,...a?{model:a}:{}},agent:{persistence:d,...f?{handle:f}:{}},...c?{seed:{instructions:c}}:{}})}),B=g.agentId?.trim(),F=g.sessionId?.trim(),y=g.conversationId?.trim();if(F){n(),te(C,{view:"sessions",sessionId:F},{returnTo:D});return}if(B){n(),C({...D,view:"agents-v2",agentId:B,selectedAgentId:void 0,sessionId:void 0,...y?{conversationId:y,tab:"message"}:{tab:"profile"}});return}if(y){n(),C({view:"conversation",conversationId:y});return}j("Agent start was accepted, but no target came back.")}catch(a){j(a instanceof Error?a.message:"Could not start an agent.")}finally{I("idle")}}},ae=a=>{if((a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault(),O();return}W(a)},b=[];return b.push({label:"root",value:s?A(s):"no project root",title:s??void 0}),l?b.push({label:"branch",value:le(l),title:l.path}):u.length>0&&b.push({label:"branch",value:u.length===1?u[0]:`${u.length} branches`}),m>1&&b.push({label:"worktrees",value:String(m)}),b.push({label:"existing",value:`${x} agent${x===1?"":"s"} · ${H} session${H===1?"":"s"}`}),se.createPortal(e.jsx("div",{className:"na-backdrop",role:"presentation",onClick:n,children:e.jsxs("div",{ref:J,className:"na-panel",role:"dialog","aria-modal":"true","aria-labelledby":"na-title",tabIndex:-1,onClick:a=>a.stopPropagation(),onKeyDown:ae,children:[e.jsxs("header",{className:"na-head",children:[e.jsxs("div",{className:"na-headIdent",children:[e.jsx("h2",{id:"na-title",className:"na-title",children:"New agent"}),e.jsxs("span",{className:"na-scope",children:["/",o]})]}),e.jsx("button",{type:"button",className:"na-close",onClick:n,"aria-label":"Close (Esc)",children:e.jsx(ie,{size:14,strokeWidth:2,"aria-hidden":!0})})]}),e.jsx("div",{className:"na-context",children:b.map(a=>e.jsxs("span",{className:"na-contextChip",title:a.title,children:[e.jsx("span",{className:"na-contextLabel",children:a.label}),e.jsx("span",{className:"na-contextValue",children:a.value})]},a.label))}),e.jsxs("div",{className:"na-body",children:[e.jsxs("section",{className:"na-section na-modeSection",children:[e.jsx("span",{className:"na-sectionLabel",children:"What are you creating?"}),e.jsxs("div",{className:"na-modeChoice",role:"radiogroup","aria-label":"Agent kind",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="one_time",className:"na-modeCard","data-active":d==="one_time"||void 0,onClick:()=>E("one_time"),children:[e.jsx("span",{className:"na-modeTitle",children:"One-off run"}),e.jsx("span",{className:"na-modeSub",children:"Disposable session · not addressable later"})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="sticky",className:"na-modeCard","data-active":d==="sticky"||void 0,onClick:()=>E("sticky"),children:[e.jsx("span",{className:"na-modeTitle",children:"Named agent"}),e.jsx("span",{className:"na-modeSub",children:"Reusable card · addressable by handle"})]})]})]}),e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Runtime"}),e.jsx("div",{className:"na-harnessRow",role:"radiogroup","aria-label":"Harness",children:V.map(a=>{const c=K?.get(a.runtimeId),f=h===a.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":f,className:"na-harness","data-active":f||void 0,onClick:()=>G(a.value),children:[e.jsx("span",{className:"na-harnessName",children:a.label}),c?e.jsxs("span",{className:"na-harnessState","data-tone":q[c.state],children:[e.jsx("span",{className:"na-dot","aria-hidden":!0}),me[c.state]]}):e.jsx("span",{className:"na-harnessState","data-tone":"off",children:"…"})]},a.value)})}),N&&N.state!=="ready"?e.jsxs("p",{className:"na-readinessNote","data-tone":q[N.state],children:[N.detail,N.loginCommand?e.jsxs("code",{className:"na-code",children:[" ",N.loginCommand]}):null]}):null,e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Model / profile"}),e.jsx("input",{value:M,placeholder:"default",onChange:a=>X(a.currentTarget.value)})]})]}),d==="sticky"?e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Handle (optional)"}),e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Address"}),e.jsxs("div",{className:"na-handleWrap","data-tone":i.tone,children:[e.jsx("span",{className:"na-handleAt",children:"@"}),e.jsx("input",{value:$,placeholder:z[0]??"auto","aria-invalid":i.tone==="warn",autoFocus:!0,onChange:a=>P(a.currentTarget.value)})]})]}),z.length>0?e.jsxs("div",{className:"na-suggestRow",children:[e.jsx("span",{className:"na-suggestLabel",children:"suggest"}),z.map(a=>e.jsxs("button",{type:"button",className:"na-suggest",onClick:()=>P(a),children:["@",a]},a))]}):null,i.message?e.jsx("p",{className:"na-validation","data-tone":i.tone,children:i.message}):i.rewritten&&i.normalized?e.jsxs("p",{className:"na-validation","data-tone":"ok",children:["Saved as ",e.jsxs("code",{className:"na-code",children:["@",i.normalized]})]}):null]}):null,e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"First instruction"}),e.jsx("textarea",{className:"na-prompt",value:R,rows:3,placeholder:`Start in /${o}…`,onChange:a=>Q(a.currentTarget.value)})]}),e.jsxs("section",{className:"na-section na-routing",children:[e.jsx("span",{className:"na-sectionLabel",children:p.disposable?"Dispatch preview":"Routing preview"}),p.disposable?e.jsxs("div",{className:"na-routingBody","data-disposable":!0,children:[e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("button",{type:"button",className:"na-promote",onClick:()=>E("sticky"),children:"Name it to keep it →"})]}):e.jsxs("div",{className:"na-routingBody",children:[p.card?e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"address"}),e.jsx("code",{className:"na-routingValue na-routingCard",children:p.card})]}):null,e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"cli"}),e.jsx("code",{className:"na-routingValue",children:p.cli})]}),e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("p",{className:"na-routingNote",children:p.note})]})]})]}),_?e.jsx("div",{className:"na-error",children:_}):null,e.jsxs("footer",{className:"na-foot",children:[e.jsx("span",{className:"na-footRoot",title:s??void 0,children:s?A(s):"No project root — cannot create."}),e.jsxs("div",{className:"na-footActions",children:[e.jsx("button",{type:"button",className:"na-cancel",onClick:n,children:"Cancel"}),e.jsxs("button",{type:"button",className:"na-create",disabled:!Z,onClick:()=>{O()},children:[e.jsx(re,{size:12,strokeWidth:2,"aria-hidden":!0}),ee]})]})]})]})}),document.body)}export{ke as NewAgentModal};
1
+ import{r,j as e}from"./index-DmFAhGPj.js";import{r as se}from"./index-CmwGCxUk.js";import{a as U}from"./api-h5zurxmi.js";import{u as ne}from"./keyboard-nav-h1IdakpD.js";import{o as te}from"./openContent-C6XO6kr5.js";import{s as A,w as le}from"./project-overview-helpers-BQTc_Ous.js";import{X as ie}from"./x-C8ayPBtj.js";import{R as re}from"./rocket-CMM-IdLy.js";import"./createLucideIcon-CFBn0Sdk.js";const V=[{value:"codex",label:"Codex",runtimeId:"codex"},{value:"claude",label:"Claude",runtimeId:"claude"},{value:"pi",label:"Grok",runtimeId:"pi"}];function w(t){return t.trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function oe(t){const n=new Set;for(const o of t){if(!o)continue;const s=w(o);s&&n.add(s)}return n}function ce(t,n,o){const s=t.trim();if(!s)return{status:"auto",normalized:void 0,rewritten:!1,message:o==="sticky"?"Scout will assign a reusable handle from the name pool.":"Scout will assign a disposable handle from the name pool.",tone:"ok"};const l=w(s);return l?n.has(l)?{status:"conflict",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:`@${l} already exists here. Pick another handle or leave it blank for auto.`,tone:"warn"}:{status:"ok",normalized:l,rewritten:l!==s.toLowerCase().replace(/^@+/,""),message:null,tone:"ok"}:{status:"invalid",normalized:void 0,rewritten:!1,message:"Use letters, numbers, dot, or dash.",tone:"warn"}}function S(t){return t==="pi"?"grok":t}function de(t,n,o,s=3){const l=w(t)??"agent",m=[l,`${l}-${S(n)}`,`${l}-dev`,`${l}-2`,`${l}-${S(n)}-2`],u=[];for(const v of m){const x=w(v);if(!(!x||o.has(x)||u.includes(x))&&(u.push(x),u.length>=s))break}return u}function ue(t){const{handle:n,persistence:o,harness:s,projectRootLabel:l}=t,m="A card starts a fresh session for each request. Use session:<id> only to continue an exact run.";return o==="one_time"?{disposable:!0,card:null,cli:`scout ask --project ${l} --harness ${s} "…"`,resolves:"Disposable session — Scout assigns a provisional handle that may be recycled. Not addressable later.",note:m}:n?{disposable:!1,card:`@${n}`,cli:`scout ask @${n} "…"`,resolves:`Reusable ${S(s)} session on this project — @${n} routes here from any surface.`,note:m}:{disposable:!1,card:"@auto",cli:'scout ask @<assigned-handle> "…"',resolves:`Scout assigns a reusable ${S(s)} handle from the name pool.`,note:m}}const me={ready:"ready",configured:"configured",installed:"login needed",missing:"not found"},q={ready:"ok",configured:"ok",installed:"warn",missing:"off"};function ke({open:t,onClose:n,projectTitle:o,projectRoot:s,primaryWt:l,worktreeCount:m,branches:u,existingAgents:v,agentCount:x,sessionCount:H,route:D,navigate:C}){const{ref:J,onKeyDown:W}=ne(t),[h,G]=r.useState("codex"),[M,X]=r.useState(""),[d,E]=r.useState("sticky"),[$,P]=r.useState(""),[R,Q]=r.useState(""),[L,I]=r.useState("idle"),[_,j]=r.useState(null),[K,Y]=r.useState(null);r.useEffect(()=>{t&&(j(null),I("idle"))},[t]),r.useEffect(()=>{if(!t)return;let a=!1;return(async()=>{const c=await U("/api/agent-config/snapshot").catch(()=>null);if(a||!c)return;const f=new Map;for(const g of c.runtimes)f.set(g.id,{state:g.state,detail:g.detail,loginCommand:g.loginCommand});Y(f)})(),()=>{a=!0}},[t]),r.useEffect(()=>{if(!t)return;const a=c=>{c.key==="Escape"&&(c.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,n]);const k=r.useMemo(()=>oe(v.flatMap(a=>[a.name,a.handle])),[v]),i=r.useMemo(()=>ce($,k,d),[$,k,d]),z=r.useMemo(()=>de(o,h,k,3),[o,h,k]),T=s?A(s):"<no-root>",p=r.useMemo(()=>ue({handle:i.normalized,persistence:d,harness:h,projectRootLabel:T}),[i.normalized,d,h,T]),N=K?.get(V.find(a=>a.value===h)?.runtimeId??h);if(!t)return null;const Z=!!s&&L!=="starting"&&i.status!=="invalid"&&i.status!=="conflict",ee=L==="starting"?"Starting…":d==="one_time"?"Dispatch one-off":i.status==="conflict"?"Handle exists":i.normalized?`Create @${i.normalized}`:"Create with auto handle",O=async()=>{if(!(!s||L==="starting")){I("starting"),j(null);try{const a=M.trim(),c=R.trim(),f=i.normalized,g=await U("/api/sessions",{method:"POST",body:JSON.stringify({target:{projectPath:s},execution:{session:"new",harness:h,...a?{model:a}:{}},agent:{persistence:d,...f?{handle:f}:{}},...c?{seed:{instructions:c}}:{}})}),B=g.agentId?.trim(),F=g.sessionId?.trim(),y=g.conversationId?.trim();if(F){n(),te(C,{view:"sessions",sessionId:F},{returnTo:D});return}if(B){n(),C({...D,view:"agents-v2",agentId:B,selectedAgentId:void 0,sessionId:void 0,...y?{conversationId:y,tab:"message"}:{tab:"profile"}});return}if(y){n(),C({view:"conversation",conversationId:y});return}j("Agent start was accepted, but no target came back.")}catch(a){j(a instanceof Error?a.message:"Could not start an agent.")}finally{I("idle")}}},ae=a=>{if((a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault(),O();return}W(a)},b=[];return b.push({label:"root",value:s?A(s):"no project root",title:s??void 0}),l?b.push({label:"branch",value:le(l),title:l.path}):u.length>0&&b.push({label:"branch",value:u.length===1?u[0]:`${u.length} branches`}),m>1&&b.push({label:"worktrees",value:String(m)}),b.push({label:"existing",value:`${x} agent${x===1?"":"s"} · ${H} session${H===1?"":"s"}`}),se.createPortal(e.jsx("div",{className:"na-backdrop",role:"presentation",onClick:n,children:e.jsxs("div",{ref:J,className:"na-panel",role:"dialog","aria-modal":"true","aria-labelledby":"na-title",tabIndex:-1,onClick:a=>a.stopPropagation(),onKeyDown:ae,children:[e.jsxs("header",{className:"na-head",children:[e.jsxs("div",{className:"na-headIdent",children:[e.jsx("h2",{id:"na-title",className:"na-title",children:"New agent"}),e.jsxs("span",{className:"na-scope",children:["/",o]})]}),e.jsx("button",{type:"button",className:"na-close",onClick:n,"aria-label":"Close (Esc)",children:e.jsx(ie,{size:14,strokeWidth:2,"aria-hidden":!0})})]}),e.jsx("div",{className:"na-context",children:b.map(a=>e.jsxs("span",{className:"na-contextChip",title:a.title,children:[e.jsx("span",{className:"na-contextLabel",children:a.label}),e.jsx("span",{className:"na-contextValue",children:a.value})]},a.label))}),e.jsxs("div",{className:"na-body",children:[e.jsxs("section",{className:"na-section na-modeSection",children:[e.jsx("span",{className:"na-sectionLabel",children:"What are you creating?"}),e.jsxs("div",{className:"na-modeChoice",role:"radiogroup","aria-label":"Agent kind",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="one_time",className:"na-modeCard","data-active":d==="one_time"||void 0,onClick:()=>E("one_time"),children:[e.jsx("span",{className:"na-modeTitle",children:"One-off run"}),e.jsx("span",{className:"na-modeSub",children:"Disposable session · not addressable later"})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":d==="sticky",className:"na-modeCard","data-active":d==="sticky"||void 0,onClick:()=>E("sticky"),children:[e.jsx("span",{className:"na-modeTitle",children:"Named agent"}),e.jsx("span",{className:"na-modeSub",children:"Reusable card · addressable by handle"})]})]})]}),e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Runtime"}),e.jsx("div",{className:"na-harnessRow",role:"radiogroup","aria-label":"Harness",children:V.map(a=>{const c=K?.get(a.runtimeId),f=h===a.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":f,className:"na-harness","data-active":f||void 0,onClick:()=>G(a.value),children:[e.jsx("span",{className:"na-harnessName",children:a.label}),c?e.jsxs("span",{className:"na-harnessState","data-tone":q[c.state],children:[e.jsx("span",{className:"na-dot","aria-hidden":!0}),me[c.state]]}):e.jsx("span",{className:"na-harnessState","data-tone":"off",children:"…"})]},a.value)})}),N&&N.state!=="ready"?e.jsxs("p",{className:"na-readinessNote","data-tone":q[N.state],children:[N.detail,N.loginCommand?e.jsxs("code",{className:"na-code",children:[" ",N.loginCommand]}):null]}):null,e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Model / profile"}),e.jsx("input",{value:M,placeholder:"default",onChange:a=>X(a.currentTarget.value)})]})]}),d==="sticky"?e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"Handle (optional)"}),e.jsxs("label",{className:"na-field",children:[e.jsx("span",{children:"Address"}),e.jsxs("div",{className:"na-handleWrap","data-tone":i.tone,children:[e.jsx("span",{className:"na-handleAt",children:"@"}),e.jsx("input",{value:$,placeholder:z[0]??"auto","aria-invalid":i.tone==="warn",autoFocus:!0,onChange:a=>P(a.currentTarget.value)})]})]}),z.length>0?e.jsxs("div",{className:"na-suggestRow",children:[e.jsx("span",{className:"na-suggestLabel",children:"suggest"}),z.map(a=>e.jsxs("button",{type:"button",className:"na-suggest",onClick:()=>P(a),children:["@",a]},a))]}):null,i.message?e.jsx("p",{className:"na-validation","data-tone":i.tone,children:i.message}):i.rewritten&&i.normalized?e.jsxs("p",{className:"na-validation","data-tone":"ok",children:["Saved as ",e.jsxs("code",{className:"na-code",children:["@",i.normalized]})]}):null]}):null,e.jsxs("section",{className:"na-section",children:[e.jsx("span",{className:"na-sectionLabel",children:"First instruction"}),e.jsx("textarea",{className:"na-prompt",value:R,rows:3,placeholder:`Start in /${o}…`,onChange:a=>Q(a.currentTarget.value)})]}),e.jsxs("section",{className:"na-section na-routing",children:[e.jsx("span",{className:"na-sectionLabel",children:p.disposable?"Dispatch preview":"Routing preview"}),p.disposable?e.jsxs("div",{className:"na-routingBody","data-disposable":!0,children:[e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("button",{type:"button",className:"na-promote",onClick:()=>E("sticky"),children:"Name it to keep it →"})]}):e.jsxs("div",{className:"na-routingBody",children:[p.card?e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"address"}),e.jsx("code",{className:"na-routingValue na-routingCard",children:p.card})]}):null,e.jsxs("div",{className:"na-routingLine",children:[e.jsx("span",{className:"na-routingKey",children:"cli"}),e.jsx("code",{className:"na-routingValue",children:p.cli})]}),e.jsx("p",{className:"na-routingResolves",children:p.resolves}),e.jsx("p",{className:"na-routingNote",children:p.note})]})]})]}),_?e.jsx("div",{className:"na-error",children:_}):null,e.jsxs("footer",{className:"na-foot",children:[e.jsx("span",{className:"na-footRoot",title:s??void 0,children:s?A(s):"No project root — cannot create."}),e.jsxs("div",{className:"na-footActions",children:[e.jsx("button",{type:"button",className:"na-cancel",onClick:n,children:"Cancel"}),e.jsxs("button",{type:"button",className:"na-create",disabled:!Z,onClick:()=>{O()},children:[e.jsx(re,{size:12,strokeWidth:2,"aria-hidden":!0}),ee]})]})]})]})}),document.body)}export{ke as NewAgentModal};
@@ -1,4 +1,4 @@
1
- import{r as c,j as o}from"./index-BZovGpDk.js";import{M as ms}from"./runtime-picker-BXKJbLot.js";import{i as sn,b as hs,d as rt,M as rn,u as ps}from"./MessageComposerSuggestions-qbalTne_.js";import{r as gs}from"./index-DiiEQwdc.js";import{H as on}from"./HarnessMark-DrE57dUq.js";import{c as bs,S as an,F as ws,G as xs}from"./conversation-model-CHwHZNw-.js";import{a as z}from"./api-h5zurxmi.js";import{d as ys}from"./colors-BtO5_zlx.js";import{NewChatOrigin as vs}from"./NewChatOrigin-DXPvX-hh.js";import{u as js}from"./keyboard-nav-CHo_xmjw.js";import{n as Cs}from"./model-Co0zkMIc.js";import{X as Ms}from"./x-CrGUKNRv.js";import{C as Ss}from"./chevron-down-BVg09D6U.js";import{S as Es}from"./search-1QMVOxF3.js";import{L as jt}from"./loader-circle-B-l2Wj3-.js";import{F as Is}from"./file-text-BITQqGtF.js";const Ns={schemaVersion:"openscout.runtime-catalog.v1",revision:"2026-08-18.1",harnesses:[{id:"claude",label:"Claude Code",enabled:!0,default:!0,reasoningEfforts:["low","medium","high","xhigh","max"],defaultReasoningEffort:"medium",models:[{id:"claude-opus-5",label:"Opus 5",enabled:!0,default:!0,family:"Opus",version:"5"},{id:"claude-sonnet-4-6",label:"Sonnet 4.6",enabled:!0,family:"Sonnet",version:"4.6"},{id:"claude-haiku-4-5",label:"Haiku 4.5",enabled:!0,family:"Haiku",version:"4.5"},{id:"claude-opus-4-8",label:"Opus 4.8",enabled:!0,family:"Opus",version:"4.8"},{id:"claude-opus-4-7",label:"Opus 4.7",enabled:!0,family:"Opus",version:"4.7"},{id:"claude-sonnet-4-5",label:"Sonnet 4.5",enabled:!0,family:"Sonnet",version:"4.5"}]},{id:"codex",label:"Codex",enabled:!0,reasoningEfforts:["low","medium","high","xhigh"],defaultReasoningEffort:"medium",models:[{id:"gpt-5.6-sol",label:"5.6 Sol",enabled:!0,default:!0,family:"GPT",version:"5.6 Sol",reasoningEfforts:["low","medium","high","xhigh","ultra"]},{id:"gpt-5.6-terra",label:"5.6 Terra",enabled:!0,family:"GPT",version:"5.6 Terra",reasoningEfforts:["low","medium","high","xhigh","ultra"]},{id:"gpt-5.6-luna",label:"5.6 Luna",enabled:!0,family:"GPT",version:"5.6 Luna"},{id:"gpt-5.5",label:"5.5",enabled:!0,family:"GPT",version:"5.5"},{id:"gpt-5.5-mini",label:"5.5 mini",enabled:!0,family:"GPT",version:"5.5 mini"}]},{id:"grok",label:"Grok CLI",enabled:!0,listed:!1,reasoningEfforts:["low","medium","high","xhigh"],defaultReasoningEffort:"medium",models:[{id:"grok-4.6",label:"Grok 4.6",enabled:!0,default:!0,family:"Grok",version:"4.6",contextWindowTokens:5e5},{id:"grok-4.5",label:"Grok 4.5",enabled:!0,family:"Grok",version:"4.5"},{id:"grok-4.3",label:"Grok 4.3",enabled:!0,family:"Grok",version:"4.3"}]},{id:"grok-acp",label:"Grok",enabled:!0,reasoningEfforts:null,models:[{id:"grok-4.6",label:"Grok 4.6",enabled:!0,default:!0,family:"Grok",version:"4.6",contextWindowTokens:5e5},{id:"grok-4.5",label:"Grok 4.5",enabled:!0,family:"Grok",version:"4.5"},{id:"grok-4.3",label:"Grok 4.3",enabled:!0,family:"Grok",version:"4.3"}]},{id:"kimi",label:"Kimi Code",enabled:!0,reasoningEfforts:null,models:[]},{id:"flue",label:"Flue",enabled:!0,reasoningEfforts:null,models:[]},{id:"cursor",label:"Cursor CLI",enabled:!0,reasoningEfforts:null,models:[]},{id:"opencode",label:"OpenCode",enabled:!0,reasoningEfforts:null,models:[{id:"opencode-go/glm-5.2",label:"GLM-5.2",enabled:!0,default:!0,family:"GLM",version:"5.2"},{id:"opencode-go/glm-5.1",label:"GLM-5.1",enabled:!0,family:"GLM",version:"5.1"},{id:"opencode-go/kimi-k3",label:"Kimi K3",enabled:!0,family:"Kimi",version:"K3"},{id:"opencode-go/qwen3.8-max",label:"Qwen3.8 Max",enabled:!0,family:"Qwen",version:"3.8 Max"},{id:"opencode-go/minimax-m3",label:"MiniMax M3",enabled:!0,family:"MiniMax",version:"M3"},{id:"opencode-go/deepseek-v4-pro",label:"DeepSeek V4 Pro",enabled:!0,family:"DeepSeek",version:"V4 Pro"},{id:"opencode-go/grok-4.5",label:"Grok 4.5",enabled:!0,family:"Grok",version:"4.5"},{id:"opencode/nemotron-3-ultra-free",label:"Nemotron 3 Ultra (free)",enabled:!0,family:"Nemotron",version:"3 Ultra Free"},{id:"opencode/laguna-s-2.1-free",label:"Laguna S 2.1 (free)",enabled:!0,family:"Laguna",version:"S 2.1 Free"}]},{id:"pi",label:"Pi",enabled:!0,reasoningEfforts:null,models:[]}]},Tt=["none","minimal","low","medium","high","xhigh","max","ultra"],Cn={none:"None",minimal:"Minimal",low:"Light",medium:"Medium",high:"High",xhigh:"Extra High",max:"Max",ultra:"Ultra"},W=Ns;function Lt(e,t=W){return t.harnesses.find(s=>s.id===e)}function ks(e=W){return e.harnesses.find(t=>t.enabled&&t.default)?.id??e.harnesses.find(t=>t.enabled)?.id??null}function Mn(e,t=W){const s=Lt(e,t);return s?.models.find(n=>n.enabled&&n.default)?.id??s?.models.find(n=>n.enabled)?.id??null}function Rs(e,t,s=W){const n=Lt(e,s);if(!n||!n.enabled)return null;const a=t?n.models.find(i=>i.enabled&&i.id===t):void 0;return a?.reasoningEfforts===null?null:a?.reasoningEfforts??n.reasoningEfforts}function Sn(e,t,s=W){const n=Lt(e,s),a=t?n?.models.find(y=>y.enabled&&y.id===t):void 0,i=Rs(e,t,s),f=a?.defaultReasoningEffort??n?.defaultReasoningEffort??null;return f&&i?.includes(f)?f:i?.[0]??null}function As(e=W){return Object.fromEntries(e.harnesses.filter(t=>t.enabled).map(t=>{const s=Mn(t.id,e);return[t.id,{model:s,reasoningEffort:Sn(t.id,s,e)}]}))}const Ts=As();Object.fromEntries(W.harnesses.filter(e=>e.enabled).map(e=>{const t=Tt.filter(s=>e.reasoningEfforts?.includes(s)||e.models.some(n=>n.enabled&&n.reasoningEfforts?.includes(s)));return[e.id,t]}));function Ls(e=W){const t=new Map;for(const s of e.harnesses)if(s.enabled)for(const n of s.models){if(!n.enabled)continue;const a=t.get(n.id);if(a){a.harnesses.includes(s.id)||a.harnesses.push(s.id);continue}t.set(n.id,{id:n.id,label:n.label,...n.description?{description:n.description}:{},harnesses:[s.id],source:"default",...n.family?{family:n.family}:{},...n.version?{version:n.version}:{}})}return Array.from(t.values())}const Ds=Ls(),Ps={none:"No extra thinking",minimal:"Smallest reasoning budget",low:"Fast responses with lighter reasoning",medium:"Balanced speed and reasoning depth",high:"Greater reasoning depth for complex work",xhigh:"Extra high reasoning depth",max:"Maximum reasoning depth",ultra:"Maximum reasoning with delegation"};function Os(e=W){return Tt.flatMap(t=>{const s=[],n=[];for(const a of e.harnesses){if(!a.enabled)continue;const i=a.models.filter(b=>b.enabled),f=i.filter(b=>(b.reasoningEfforts??a.reasoningEfforts)?.includes(t)),y=i.length===0&&a.reasoningEfforts?.includes(t);f.length===0&&!y||(s.push(a.id),i.length>0&&f.length<i.length&&n.push(...f.map(b=>b.id)))}return s.length===0?[]:[{id:t,label:Cn[t],description:Ps[t],harnesses:s,...n.length>0?{models:n}:{}}]})}const _s=Os();function $s(e,t){const s=t?.trim();return s?e.find(n=>n.id===s)??null:null}function Fs(e,t){if(e.view==="conversation"&&e.conversationId)return{agentId:null,conversationId:e.conversationId,label:"Current chat",canUseExistingChat:!0};if(e.view==="messages"&&e.conversationId)return{agentId:null,conversationId:e.conversationId,label:"Current chat",canUseExistingChat:!0};if(e.view==="agents-v2"&&e.agentId){const s=$s(t,e.agentId),n=e.conversationId??s?.conversationId??null;return{agentId:e.agentId,conversationId:n,label:s?.name??e.agentId,canUseExistingChat:!!n}}return{agentId:null,conversationId:null,label:"Pick a project",canUseExistingChat:!1}}const G="",Hs={none:"no reasoning",minimal:"lightest",low:"triage",medium:"default",high:"deep",xhigh:"exhaustive",max:"fullest",ultra:"beyond max"},Us=Tt.map(e=>({value:e,label:Cn[e],note:Hs[e]}));function Le(e,t){return e.harnesses.find(s=>s.value===t)}function Dt(e,t){return Le(e,t)?.models??[]}function Se(e,t,s){const n=Le(e,t),a=n?n.efforts===null?null:n.efforts??e.efforts:e.efforts;if(!a||!s)return a;const i=new Set((n?.models??[]).map(f=>f.value));return i.has(s)?a.filter(f=>{if(!f.models||f.models.length===0)return!0;const y=f.models.filter(b=>i.has(b));return y.length===0||y.includes(s)}):a}function En(e,t){const n=Dt(e,t.harness).find(a=>a.value===t.model);return n||(t.model.trim()?{value:t.model,label:t.model,note:"custom"}:{value:G,label:"Default",note:"harness picks"})}function Gs(e,t){const s=Le(e,t.harness),n=s?.label??t.harness??"Default",a=En(e,t),i=Se(e,t.harness,t.model),f=i?.find($=>$.value===t.effort),y=f?.label??t.effort,b=i?`Runtime: ${n}, model ${a.label}, effort ${y}`:`Runtime: ${n}, model ${a.label}`;return{harness:s,harnessLabel:n,model:a,modelLabel:a.label,effort:f,effortLabel:y,supportsEffort:i!==null,summary:b}}function Bs(e,t,s){const n={...t,...s};if(!(s.harness!==void 0&&s.harness!==t.harness)){if(s.model===void 0||s.model===t.model)return n;const T=Se(e,n.harness,n.model);if(!T||n.effort===G||T.some(V=>V.value===n.effort))return n;const de=(Se(e,t.harness,t.model)??e.efforts).findIndex(V=>V.value===t.effort),J=Math.min(Math.max(de,0),T.length-1);return n.effort=T[J]?.value??T[0]?.value??G,n}const i=Le(e,n.harness);n.model=s.model??i?.defaultModel??G,s.effort===void 0&&i?.defaultEffort&&(n.effort=i.defaultEffort);const f=Se(e,n.harness,n.model);if(!f)return n.effort=G,n;if(f.some(T=>T.value===n.effort))return n;const b=(Se(e,t.harness,t.model)??e.efforts).findIndex(T=>T.value===t.effort),$=Math.min(Math.max(b,0),f.length-1);return n.effort=f[$]?.value??f[0]?.value??G,n}function qs(e,t){const s=t?.harness??e.harnesses.find(i=>!i.disabled)?.value??"",n=Se(e,s),a=n?.find(i=>i.note==="default")?.value??n?.[Math.floor((n.length-1)/2)]?.value??G;return{harness:s,model:t?.model??Le(e,s)?.defaultModel??Dt(e,s)[1]?.value??G,effort:n?t?.effort??Le(e,s)?.defaultEffort??a:G}}function Ks(e,t){const s=t.trim().toLowerCase();return s?e.filter(n=>`${n.label} ${n.value} ${n.note??""}`.toLowerCase().includes(s)):e}function Ge(...e){for(const t of e){const s=t?.trim();if(s)return s}}function In(e){const t=e.harnesses.map(n=>{const a=e.defaultsByHarness?.[n.id],i=n.ready!==!1,f=[{value:G,label:"Default",note:"harness picks"},...e.models.filter(b=>b.harnesses.includes(n.id)).map(b=>({value:b.id,label:b.label,note:Ge(b.description)}))],y=e.efforts.filter(b=>b.harnesses.includes(n.id));return{value:n.id,label:n.label,note:i?Ge(n.description):Ge(n.detail,n.state,"unavailable"),disabled:!i,defaultModel:a?.model??G,defaultEffort:a?.reasoningEffort??G,models:f,efforts:y.length===0?null:y.map(b=>({value:b.id,label:b.label,note:Ge(b.description),...b.models?.length?{models:[...b.models]}:{}}))}}),s=e.efforts.map(n=>({value:n.id,label:n.label,note:Ge(n.description)}));return{harnesses:t,efforts:s.length>0?s:Us}}const zs=6,Ct=34,Mt=460,Ws=14,Js=300,Be=8,St=["harness","model","effort"],Vs={harness:"vertical",model:"vertical",effort:"horizontal"};function Xs(){return o.jsx("svg",{className:"s-rt-chip-chevron",width:"8",height:"5",viewBox:"0 0 8 5",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M1 1.2 4 4 7 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ys({ctx:e}){const{efforts:t,value:s,set:n}=e;if(!t)return null;const a=Math.max(0,t.findIndex(i=>i.value===s.effort));return o.jsx("div",{className:"s-rt-ladder",role:"radiogroup","aria-label":"Reasoning effort",children:t.map((i,f)=>{const y=f===a;return o.jsxs("button",{type:"button",role:"radio","aria-checked":y,title:i.note,onClick:()=>n({effort:i.value}),...e.cell("effort",f),className:"s-rt-step",children:[o.jsx("span",{className:"s-rt-step-bar","data-state":y?"current":f<a?"filled":"empty"}),o.jsx("span",{className:"s-rt-step-label",children:i.label})]},i.value)})})}function Qs({harnessLabel:e}){return o.jsxs("p",{className:"s-rt-effort-absent",children:[e," has no effort control."]})}function Zs({option:e,selected:t,index:s,ctx:n}){const a=e.disabled??!1;return o.jsxs("button",{type:"button",role:"option","aria-selected":t,"aria-disabled":a||void 0,onClick:()=>{a||n.set({model:e.value})},"data-on":t||void 0,"data-disabled":a||void 0,...n.cell("model",s),style:{animationDelay:`${Math.min(s,6)*16}ms`},className:"s-rt-row s-rt-model-row",children:[o.jsx("span",{"aria-hidden":!0,className:"s-rt-dot"}),o.jsx("span",{className:"s-rt-row-label",children:e.label}),e.note?o.jsx("span",{className:"s-rt-note",children:e.note}):null]})}function er({ctx:e}){return o.jsxs("div",{className:"s-rt-search",children:[o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 12 12","aria-hidden":"true",className:"s-rt-search-icon",children:[o.jsx("circle",{cx:"5",cy:"5",r:"3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),o.jsx("path",{d:"M7.6 7.6 10.5 10.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),o.jsx("input",{ref:e.searchRef,type:"text",value:e.query,onChange:t=>e.setQuery(t.target.value),onKeyDown:e.onSearchKeyDown,placeholder:"Filter models","aria-label":"Filter models",spellCheck:!1,autoComplete:"off",className:"s-rt-search-input"}),e.query?o.jsx("button",{type:"button",onClick:()=>{e.setQuery(""),e.searchRef.current?.focus()},"aria-label":"Clear filter",className:"s-rt-search-clear",children:"clear"}):null]})}function tr({ctx:e}){return e.status==="loading"?o.jsxs("div",{className:"s-rt-status","aria-busy":!0,role:"status",children:[o.jsx("span",{className:"s-rt-sr",children:"Loading models"}),[0,1,2].map(t=>o.jsx("span",{"aria-hidden":!0,className:"s-rt-skel",style:{animationDelay:`${t*90}ms`}},t))]}):e.status==="error"?o.jsxs("div",{role:"alert",className:"s-rt-status s-rt-status--error",children:[o.jsx("span",{className:"s-rt-status-message",children:e.statusMessage??"Model catalog unavailable."}),e.onRetry?o.jsx("button",{type:"button",onClick:e.onRetry,className:"s-rt-retry",children:"Retry"}):null]}):o.jsx("p",{className:"s-rt-empty",children:e.query.trim()?`No model matches “${e.query.trim()}”.`:"No models listed."})}function nr({ctx:e}){return e.status!=="ready"||e.models.length===0?o.jsx(tr,{ctx:e}):o.jsx("div",{role:"listbox","aria-label":"Model",className:"s-rt-models",children:e.models.map((t,s)=>o.jsx(Zs,{option:t,index:s,selected:t.value===e.value.model,ctx:e},t.value||"default"))},e.value.harness)}function ln({value:e,defaultValue:t,onChange:s,catalog:n,status:a="ready",statusMessage:i,onRetry:f,disabled:y=!1,showEffort:b,searchable:$="auto",className:T}){const[v,de]=c.useState(!1),[J,V]=c.useState(""),[ze,We]=c.useState(()=>qs(n,t)),j=e??ze,C=c.useRef(null),ue=c.useRef(null),fe=c.useRef(null),me=c.useRef(null),S=c.useId(),je=c.useCallback(d=>{const h=Bs(n,j,d);e===void 0&&We(h),s?.(h),d.harness!==void 0&&d.harness!==j.harness&&V("")},[n,e,s,j]),L=n.harnesses,De=c.useMemo(()=>Dt(n,j.harness),[n,j.harness]),P=c.useMemo(()=>{const d=En(n,j);return d.note!=="custom"?De:[...De,d]},[De,n,j]),ne=c.useMemo(()=>Ks(P,J),[P,J]),Pe=Se(n,j.harness,j.model),X=b===!1?null:b===!0?Pe??n.efforts:Pe,D=$==="auto"?P.length>zs:$,Y=Gs(n,j),I=c.useRef(new Map),[he,k]=c.useState({group:"model",index:0}),R=c.useMemo(()=>({harness:L.length,model:a==="ready"?ne.length:0,effort:X?.length??0}),[X?.length,L.length,ne.length,a]),se=c.useCallback(d=>d==="harness"?Math.max(0,L.findIndex(h=>h.value===j.harness)):d==="model"?Math.max(0,ne.findIndex(h=>h.value===j.model)):Math.max(0,X?.findIndex(h=>h.value===j.effort)??0),[X,L,ne,j]),N=c.useCallback((d,h)=>{k({group:d,index:h}),I.current.get(`${d}:${h}`)?.focus()},[]),pe=c.useCallback((d,h)=>{const w=St.indexOf(d);for(let g=w+h;g>=0&&g<St.length;g+=h){const A=St[g];if(R[A]>0)return N(A,Math.min(se(A),R[A]-1)),!0}return!1},[R,N,se]),Je=c.useCallback((d,h)=>({ref:w=>{const g=`${d}:${h}`;w?I.current.set(g,w):I.current.delete(g)},tabIndex:he.group===d&&he.index===h?0:-1,onFocus:()=>k({group:d,index:h}),onKeyDown:w=>{const g=Vs[d]==="vertical",A=g?"ArrowDown":"ArrowRight",U=g?"ArrowUp":"ArrowLeft",_e=g?"ArrowRight":"ArrowDown",re=g?"ArrowLeft":"ArrowUp",we=R[d];if(we!==0)if(w.key===A)w.preventDefault(),N(d,(h+1)%we);else if(w.key===U){if(w.preventDefault(),d==="model"&&h===0&&D){k({group:d,index:0}),me.current?.focus();return}N(d,(h-1+we)%we)}else w.key===_e?(w.preventDefault(),pe(d,1)):w.key===re?(w.preventDefault(),pe(d,-1)):w.key==="Home"?(w.preventDefault(),N(d,0)):w.key==="End"&&(w.preventDefault(),N(d,we-1))}}),[R,he,N,pe,D]),ke=c.useCallback(d=>{if(d.key==="ArrowDown"&&R.model>0)d.preventDefault(),N("model",0);else if(d.key==="Enter"&&R.model===1){d.preventDefault();const h=ne[0];h.disabled||je({model:h.value})}else d.key==="Escape"&&J&&(d.preventDefault(),d.stopPropagation(),V(""))},[R.model,N,ne,J,je]),[F,Oe]=c.useState(null),ge=c.useCallback(()=>{const d=ue.current;if(!d)return;const h=d.getBoundingClientRect(),w=h.top,g=window.innerHeight-h.bottom,A=w>=Js||w>=g?"up":"down",U=Math.min(Math.max(Be,h.right-Mt),Math.max(Be,window.innerWidth-Mt-Be));Oe({left:U,top:A==="up"?h.top-Be:h.bottom+Be,placement:A})},[]);c.useLayoutEffect(()=>{if(!v)return;ge();const d=()=>ge();return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[v,ge]);const E=c.useCallback(d=>{de(!1),d&&ue.current?.focus()},[]);c.useEffect(()=>{if(!v)return;const d=w=>{const g=w.target;C.current?.contains(g)||fe.current?.contains(g)||de(!1)},h=w=>{w.key==="Escape"&&(w.stopPropagation(),E(!0))};return document.addEventListener("pointerdown",d),document.addEventListener("keydown",h),()=>{document.removeEventListener("pointerdown",d),document.removeEventListener("keydown",h)}},[v,E]),c.useEffect(()=>{if(!v)return;const d=R.model>0?"model":"harness",h=Math.min(se(d),Math.max(0,R[d]-1));k({group:d,index:h});const w=requestAnimationFrame(()=>{const g=I.current.get(`${d}:${h}`);g?g.focus():fe.current?.focus()});return()=>cancelAnimationFrame(w)},[v]),c.useEffect(()=>{v||V("")},[v]),c.useEffect(()=>{y&&de(!1)},[y]);const be=Math.max(0,L.findIndex(d=>d.value===j.harness)),H={value:j,set:je,status:a,statusMessage:i,onRetry:f,harnesses:L,models:ne,efforts:X,harnessLabel:Y.harnessLabel,searchable:D,query:J,setQuery:V,searchRef:me,cell:Je,onSearchKeyDown:ke};return o.jsxs("div",{ref:C,className:T?`s-rt-root ${T}`:"s-rt-root",style:{position:"relative",display:"inline-flex"},children:[o.jsxs("button",{ref:ue,type:"button",className:`s-rt-chip${y?" s-rt-chip--disabled":""}`,"aria-haspopup":"dialog","aria-expanded":v,"aria-controls":v?S:void 0,"aria-label":Y.summary,disabled:y,onClick:()=>de(d=>!d),children:[o.jsx(on,{harness:j.harness||"unknown",size:12,className:"s-rt-chip-mark",title:null}),o.jsxs("span",{className:"s-rt-chip-type",children:[o.jsx("span",{className:"s-rt-chip-model",style:{maxWidth:`${Ws}ch`},children:o.jsx("span",{className:"s-rt-chip-model-text",children:Y.modelLabel},Y.modelLabel)}),X&&Y.effortLabel?o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":!0,className:"s-rt-chip-divider"}),o.jsx("span",{className:"s-rt-chip-effort","data-effort":j.effort,children:Y.effortLabel})]}):null]}),o.jsx(Xs,{})]}),v&&F?gs.createPortal(o.jsx("div",{ref:fe,id:S,role:"dialog","aria-label":"Runtime",tabIndex:-1,"data-placement":F.placement,className:"s-rt-panel",style:{left:F.left,width:Mt,...F.placement==="up"?{bottom:window.innerHeight-F.top}:{top:F.top}},children:o.jsxs("div",{className:"s-rt-rail",children:[o.jsxs("div",{className:"s-rt-rail-main",children:[o.jsxs("div",{className:"s-rt-harnesses",role:"radiogroup","aria-label":"Harness",children:[o.jsx("span",{"aria-hidden":!0,className:"s-rt-marker",style:{height:Ct-10,transform:`translateY(${be*Ct+5}px)`}}),L.map((d,h)=>{const w=d.value===j.harness,g=d.disabled??!1;return o.jsxs("button",{type:"button",role:"radio","aria-checked":w,"aria-disabled":g||void 0,onClick:()=>{g||H.set({harness:d.value})},style:{height:Ct},"data-on":w||void 0,"data-disabled":g||void 0,title:g?d.note:void 0,...H.cell("harness",h),className:"s-rt-harness",children:[o.jsx(on,{harness:d.value||"unknown",size:14,className:"s-rt-opt-mark",title:null}),o.jsx("span",{className:"s-rt-harness-label",children:d.label})]},d.value||"default")})]}),o.jsxs("div",{className:"s-rt-models-col",children:[D?o.jsx(er,{ctx:H}):null,o.jsx(nr,{ctx:H})]})]}),o.jsx("div",{className:"s-rt-effort-foot",children:X?o.jsx(Ys,{ctx:H}):o.jsx(Qs,{harnessLabel:Y.harnessLabel})})]})}),document.body):null]})}const Nt="scout:newchat:frame:v1",sr=620,cn=420,dn=300,it=12,rr=210,or=154;function Nn(e){return e>sr}function un(e,t,s){if(!Nn(s.width))return null;const n=e??t;return n?lt(n,s):null}function ar(e){return e?Math.max(or,Math.round(e.height-rr)):null}function fn(e,t,s){const n=s-t-it;return Math.round(Math.max(it,Math.min(e,n)))}function lt(e,t){const s=Math.round(Math.max(cn,Math.min(e.width,Math.max(cn,t.width-it*2)))),n=Math.round(Math.max(dn,Math.min(e.height,Math.max(dn,t.height-it*2))));return{x:fn(e.x,s,t.width),y:fn(e.y,n,t.height),width:s,height:n}}function ir(e,t,s,n){return lt({...e,x:e.x+t,y:e.y+s},n)}function lr(e,t,s,n,a){const i=n==="s"?e.width:e.width+t,f=n==="e"?e.height:e.height+s;return lt({...e,width:i,height:f},a)}function cr(e){if(!e||typeof e!="object")return!1;const t=e;return["x","y","width","height"].every(s=>typeof t[s]=="number"&&Number.isFinite(t[s]))}function dr(e){if(!e)return null;try{const t=JSON.parse(e);return cr(t)?{x:t.x,y:t.y,width:t.width,height:t.height}:null}catch{return null}}function mn(){try{return typeof localStorage>"u"?null:dr(localStorage.getItem(Nt))}catch{return null}}function hn(e){try{if(typeof localStorage>"u")return;if(!e){localStorage.removeItem(Nt);return}localStorage.setItem(Nt,JSON.stringify(e))}catch{}}const kt=ks()??"",pn=Mn(kt),Ee={schemaVersion:"openscout.runtime-capabilities.v1",catalogVersion:W.schemaVersion,defaults:{harness:kt,model:pn,reasoningEffort:Sn(kt,pn)},defaultsByHarness:Ts,harnesses:W.harnesses.filter(e=>e.enabled&&e.listed!==!1).map(e=>({id:e.id,label:e.label})),models:Ds.map(e=>({id:e.id,label:e.label,...e.description?{description:e.description}:{},harnesses:[...e.harnesses]})),efforts:_s.map(e=>({id:e.id,label:e.label,...e.description?{description:e.description}:{},harnesses:[...e.harnesses],...e.models?{models:[...e.models]}:{}}))};function wo(e){return In({defaultsByHarness:e.defaultsByHarness,harnesses:e.harnesses.map(t=>({id:t.id,label:t.label??t.id})),models:e.models.map(t=>({id:t.id,label:t.label??t.id,description:t.description,harnesses:t.harnesses})),efforts:e.efforts.map(t=>({id:t.id,label:t.label,description:t.description,harnesses:t.harnesses,...t.models?.length?{models:[...t.models]}:{}}))})}const ur="|";function gn(e){return e<55296?e:e<57344?e+8192:e-2048}function fr(e,t){if(e===t)return 0;const s=Math.min(e.length,t.length);for(let n=0;n<s;n+=1){const a=e.charCodeAt(n),i=t.charCodeAt(n);if(a!==i)return gn(a)<gn(i)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function bn(e){return Number.isFinite(e)?e:0}function mr(e,t){const s=bn(e.createdAt),n=bn(t.createdAt);return s!==n?s<n?-1:1:fr(e.id,t.id)}function hr(e){return`${Number.isFinite(e.createdAt)?Math.max(0,Math.trunc(e.createdAt)):0}${ur}${e.id}`}const pr=10,gr=80,wn=300,xn=100,kn=2e3,br=pr,ve=new Map,ce=new Map;let Rn=0;function Ne(e){return e.trim()}function wr(e){const t=new Map;for(const s of e)t.set(s.id,s);return[...t.values()].sort(mr)}function xr(){if(ve.size<=br)return;let e=null,t=Number.POSITIVE_INFINITY;for(const[s,n]of ve)n.touchedAt<t&&(e=s,t=n.touchedAt);e&&ve.delete(e)}function Ie(e){const t=Ne(e),s=ve.get(t);return s?(s.touchedAt=++Rn,s.messages):null}function Pt(e,t,s={}){const n=Ne(e);if(!n)return[];const a=ve.get(n),i=wr(t).slice(-kn);return ve.set(n,{messages:i,historyLoaded:s.historyLoaded??a?.historyLoaded??!1,historyExhausted:s.historyExhausted??a?.historyExhausted??!1,touchedAt:++Rn}),xr(),i}function An(e,t){const s=Ie(e)??[];return Pt(e,[...s,...t])}function Tn(e){return ve.get(Ne(e))?.historyLoaded??!1}function yr(e){const t=ve.get(Ne(e));return!!(t&&t.historyLoaded&&!t.historyExhausted&&t.messages.length>0&&t.messages.length<kn)}async function xo(e,t={}){const s=Ne(e);if(!s)return[];const n=Ie(s);if(n&&!t.refresh)return n;const a=ce.get(s);if(a)return a;const i=z(`/api/messages?conversationId=${encodeURIComponent(s)}&limit=${gr}`).then(f=>An(s,f));ce.set(s,i);try{return await i}finally{ce.delete(s)}}async function vr(e){const t=Ne(e);if(!t)return[];if(Tn(t))return Ie(t)??[];const s=`${t}:history`,n=ce.get(s);if(n)return n;const a=z(`/api/messages?conversationId=${encodeURIComponent(t)}&limit=${wn}`).then(i=>Pt(t,[...Ie(t)??[],...i],{historyLoaded:!0,historyExhausted:i.length<wn}));ce.set(s,a);try{return await a}finally{ce.delete(s)}}async function yo(e){const t=Ne(e);if(!t)return[];if(!Tn(t))return vr(t);if(!yr(t))return Ie(t)??[];const s=Ie(t)??[],n=s[0];if(!n)return s;const a=hr(n),i=`${t}:before:${a}`,f=ce.get(i);if(f)return f;const y=z(`/api/messages?conversationId=${encodeURIComponent(t)}&limit=${xn}&beforeMessageId=${encodeURIComponent(a)}`).then(b=>Pt(t,[...b,...Ie(t)??[]],{historyLoaded:!0,historyExhausted:b.length<xn}));ce.set(i,y);try{return await y}finally{ce.delete(i)}}const jr=12e4,Ke=new Map;function Cr(){const e=globalThis.crypto?.randomUUID?.();return e?`web-${e}`:`web-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Mr(e){const t=e.conversationId.trim(),s=e.messageId.trim();if(!t||!s)return;An(t,[{id:s,conversationId:t,actorId:"operator",actorName:"operator",body:e.body,createdAt:e.createdAt,class:"operator",...e.attachments?.length?{attachments:e.attachments}:{},metadata:{clientMessageId:e.clientMessageId}}]);const n=e.flightId?.trim(),a=e.agentId?.trim();!n||!a||Ke.set(t,{flight:{id:n,invocationId:e.invocationId?.trim()||`pending:${n}`,agentId:a,agentName:null,conversationId:t,collaborationRecordId:null,state:"queued",summary:"Request accepted; waiting for worker activity.",startedAt:e.createdAt,completedAt:null,sessions:[]},expiresAt:Date.now()+jr})}function vo(e,t=Date.now()){const s=e.trim(),n=Ke.get(s);return n?n.expiresAt<=t?(Ke.delete(s),null):n.flight:null}function jo(e,t){const s=e.trim(),n=Ke.get(s);n&&(!t||n.flight.id===t)&&Ke.delete(s)}const Sr=1200,Er=new Set(["Page","URL"]);function Ln(e){return e.trim().slice(0,Sr)}function Ir(e){const t=[{label:"Page",value:e.pageTitle??""},{label:"URL",value:e.pageUrl??""}];return e.selection?.trim()&&t.push({label:"Selection",value:Ln(e.selection)}),(e.notes??[]).forEach((s,n)=>{t.push({label:`Note ${n+1}`,value:s})}),t.filter(s=>s.value.trim())}function Nr(e,t){const s=[];for(const a of t){const i=a.value.trim();i&&(Er.has(a.label)?s.push(`${a.label}: ${i}`):s.push(`${a.label}:
1
+ import{r as c,j as o}from"./index-DmFAhGPj.js";import{M as ms}from"./runtime-picker--IW3cRry.js";import{i as sn,b as hs,d as rt,M as rn,u as ps}from"./MessageComposerSuggestions-FdVHnT_q.js";import{r as gs}from"./index-CmwGCxUk.js";import{H as on}from"./HarnessMark-BPAphNjx.js";import{c as bs,S as an,F as ws,G as xs}from"./conversation-model-CHwHZNw-.js";import{a as z}from"./api-h5zurxmi.js";import{d as ys}from"./colors-BtO5_zlx.js";import{NewChatOrigin as vs}from"./NewChatOrigin-DmuJ32wa.js";import{u as js}from"./keyboard-nav-h1IdakpD.js";import{n as Cs}from"./model-Co0zkMIc.js";import{X as Ms}from"./x-C8ayPBtj.js";import{C as Ss}from"./chevron-down-B3VVRJcV.js";import{S as Es}from"./search-DAyagUtF.js";import{L as jt}from"./loader-circle-d6PKL_KD.js";import{F as Is}from"./file-text-DcYSrI4v.js";const Ns={schemaVersion:"openscout.runtime-catalog.v1",revision:"2026-08-18.1",harnesses:[{id:"claude",label:"Claude Code",enabled:!0,default:!0,reasoningEfforts:["low","medium","high","xhigh","max"],defaultReasoningEffort:"medium",models:[{id:"claude-opus-5",label:"Opus 5",enabled:!0,default:!0,family:"Opus",version:"5"},{id:"claude-sonnet-4-6",label:"Sonnet 4.6",enabled:!0,family:"Sonnet",version:"4.6"},{id:"claude-haiku-4-5",label:"Haiku 4.5",enabled:!0,family:"Haiku",version:"4.5"},{id:"claude-opus-4-8",label:"Opus 4.8",enabled:!0,family:"Opus",version:"4.8"},{id:"claude-opus-4-7",label:"Opus 4.7",enabled:!0,family:"Opus",version:"4.7"},{id:"claude-sonnet-4-5",label:"Sonnet 4.5",enabled:!0,family:"Sonnet",version:"4.5"}]},{id:"codex",label:"Codex",enabled:!0,reasoningEfforts:["low","medium","high","xhigh"],defaultReasoningEffort:"medium",models:[{id:"gpt-5.6-sol",label:"5.6 Sol",enabled:!0,default:!0,family:"GPT",version:"5.6 Sol",reasoningEfforts:["low","medium","high","xhigh","ultra"]},{id:"gpt-5.6-terra",label:"5.6 Terra",enabled:!0,family:"GPT",version:"5.6 Terra",reasoningEfforts:["low","medium","high","xhigh","ultra"]},{id:"gpt-5.6-luna",label:"5.6 Luna",enabled:!0,family:"GPT",version:"5.6 Luna"},{id:"gpt-5.5",label:"5.5",enabled:!0,family:"GPT",version:"5.5"},{id:"gpt-5.5-mini",label:"5.5 mini",enabled:!0,family:"GPT",version:"5.5 mini"}]},{id:"grok",label:"Grok CLI",enabled:!0,listed:!1,reasoningEfforts:["low","medium","high","xhigh"],defaultReasoningEffort:"medium",models:[{id:"grok-4.6",label:"Grok 4.6",enabled:!0,default:!0,family:"Grok",version:"4.6",contextWindowTokens:5e5},{id:"grok-4.5",label:"Grok 4.5",enabled:!0,family:"Grok",version:"4.5"},{id:"grok-4.3",label:"Grok 4.3",enabled:!0,family:"Grok",version:"4.3"}]},{id:"grok-acp",label:"Grok",enabled:!0,reasoningEfforts:null,models:[{id:"grok-4.6",label:"Grok 4.6",enabled:!0,default:!0,family:"Grok",version:"4.6",contextWindowTokens:5e5},{id:"grok-4.5",label:"Grok 4.5",enabled:!0,family:"Grok",version:"4.5"},{id:"grok-4.3",label:"Grok 4.3",enabled:!0,family:"Grok",version:"4.3"}]},{id:"kimi",label:"Kimi Code",enabled:!0,reasoningEfforts:null,models:[]},{id:"flue",label:"Flue",enabled:!0,reasoningEfforts:null,models:[]},{id:"cursor",label:"Cursor CLI",enabled:!0,reasoningEfforts:null,models:[]},{id:"opencode",label:"OpenCode",enabled:!0,reasoningEfforts:null,models:[{id:"opencode-go/glm-5.2",label:"GLM-5.2",enabled:!0,default:!0,family:"GLM",version:"5.2"},{id:"opencode-go/glm-5.1",label:"GLM-5.1",enabled:!0,family:"GLM",version:"5.1"},{id:"opencode-go/kimi-k3",label:"Kimi K3",enabled:!0,family:"Kimi",version:"K3"},{id:"opencode-go/qwen3.8-max",label:"Qwen3.8 Max",enabled:!0,family:"Qwen",version:"3.8 Max"},{id:"opencode-go/minimax-m3",label:"MiniMax M3",enabled:!0,family:"MiniMax",version:"M3"},{id:"opencode-go/deepseek-v4-pro",label:"DeepSeek V4 Pro",enabled:!0,family:"DeepSeek",version:"V4 Pro"},{id:"opencode-go/grok-4.5",label:"Grok 4.5",enabled:!0,family:"Grok",version:"4.5"},{id:"opencode/nemotron-3-ultra-free",label:"Nemotron 3 Ultra (free)",enabled:!0,family:"Nemotron",version:"3 Ultra Free"},{id:"opencode/laguna-s-2.1-free",label:"Laguna S 2.1 (free)",enabled:!0,family:"Laguna",version:"S 2.1 Free"}]},{id:"pi",label:"Pi",enabled:!0,reasoningEfforts:null,models:[]}]},Tt=["none","minimal","low","medium","high","xhigh","max","ultra"],Cn={none:"None",minimal:"Minimal",low:"Light",medium:"Medium",high:"High",xhigh:"Extra High",max:"Max",ultra:"Ultra"},W=Ns;function Lt(e,t=W){return t.harnesses.find(s=>s.id===e)}function ks(e=W){return e.harnesses.find(t=>t.enabled&&t.default)?.id??e.harnesses.find(t=>t.enabled)?.id??null}function Mn(e,t=W){const s=Lt(e,t);return s?.models.find(n=>n.enabled&&n.default)?.id??s?.models.find(n=>n.enabled)?.id??null}function Rs(e,t,s=W){const n=Lt(e,s);if(!n||!n.enabled)return null;const a=t?n.models.find(i=>i.enabled&&i.id===t):void 0;return a?.reasoningEfforts===null?null:a?.reasoningEfforts??n.reasoningEfforts}function Sn(e,t,s=W){const n=Lt(e,s),a=t?n?.models.find(y=>y.enabled&&y.id===t):void 0,i=Rs(e,t,s),f=a?.defaultReasoningEffort??n?.defaultReasoningEffort??null;return f&&i?.includes(f)?f:i?.[0]??null}function As(e=W){return Object.fromEntries(e.harnesses.filter(t=>t.enabled).map(t=>{const s=Mn(t.id,e);return[t.id,{model:s,reasoningEffort:Sn(t.id,s,e)}]}))}const Ts=As();Object.fromEntries(W.harnesses.filter(e=>e.enabled).map(e=>{const t=Tt.filter(s=>e.reasoningEfforts?.includes(s)||e.models.some(n=>n.enabled&&n.reasoningEfforts?.includes(s)));return[e.id,t]}));function Ls(e=W){const t=new Map;for(const s of e.harnesses)if(s.enabled)for(const n of s.models){if(!n.enabled)continue;const a=t.get(n.id);if(a){a.harnesses.includes(s.id)||a.harnesses.push(s.id);continue}t.set(n.id,{id:n.id,label:n.label,...n.description?{description:n.description}:{},harnesses:[s.id],source:"default",...n.family?{family:n.family}:{},...n.version?{version:n.version}:{}})}return Array.from(t.values())}const Ds=Ls(),Ps={none:"No extra thinking",minimal:"Smallest reasoning budget",low:"Fast responses with lighter reasoning",medium:"Balanced speed and reasoning depth",high:"Greater reasoning depth for complex work",xhigh:"Extra high reasoning depth",max:"Maximum reasoning depth",ultra:"Maximum reasoning with delegation"};function Os(e=W){return Tt.flatMap(t=>{const s=[],n=[];for(const a of e.harnesses){if(!a.enabled)continue;const i=a.models.filter(b=>b.enabled),f=i.filter(b=>(b.reasoningEfforts??a.reasoningEfforts)?.includes(t)),y=i.length===0&&a.reasoningEfforts?.includes(t);f.length===0&&!y||(s.push(a.id),i.length>0&&f.length<i.length&&n.push(...f.map(b=>b.id)))}return s.length===0?[]:[{id:t,label:Cn[t],description:Ps[t],harnesses:s,...n.length>0?{models:n}:{}}]})}const _s=Os();function $s(e,t){const s=t?.trim();return s?e.find(n=>n.id===s)??null:null}function Fs(e,t){if(e.view==="conversation"&&e.conversationId)return{agentId:null,conversationId:e.conversationId,label:"Current chat",canUseExistingChat:!0};if(e.view==="messages"&&e.conversationId)return{agentId:null,conversationId:e.conversationId,label:"Current chat",canUseExistingChat:!0};if(e.view==="agents-v2"&&e.agentId){const s=$s(t,e.agentId),n=e.conversationId??s?.conversationId??null;return{agentId:e.agentId,conversationId:n,label:s?.name??e.agentId,canUseExistingChat:!!n}}return{agentId:null,conversationId:null,label:"Pick a project",canUseExistingChat:!1}}const G="",Hs={none:"no reasoning",minimal:"lightest",low:"triage",medium:"default",high:"deep",xhigh:"exhaustive",max:"fullest",ultra:"beyond max"},Us=Tt.map(e=>({value:e,label:Cn[e],note:Hs[e]}));function Le(e,t){return e.harnesses.find(s=>s.value===t)}function Dt(e,t){return Le(e,t)?.models??[]}function Se(e,t,s){const n=Le(e,t),a=n?n.efforts===null?null:n.efforts??e.efforts:e.efforts;if(!a||!s)return a;const i=new Set((n?.models??[]).map(f=>f.value));return i.has(s)?a.filter(f=>{if(!f.models||f.models.length===0)return!0;const y=f.models.filter(b=>i.has(b));return y.length===0||y.includes(s)}):a}function En(e,t){const n=Dt(e,t.harness).find(a=>a.value===t.model);return n||(t.model.trim()?{value:t.model,label:t.model,note:"custom"}:{value:G,label:"Default",note:"harness picks"})}function Gs(e,t){const s=Le(e,t.harness),n=s?.label??t.harness??"Default",a=En(e,t),i=Se(e,t.harness,t.model),f=i?.find($=>$.value===t.effort),y=f?.label??t.effort,b=i?`Runtime: ${n}, model ${a.label}, effort ${y}`:`Runtime: ${n}, model ${a.label}`;return{harness:s,harnessLabel:n,model:a,modelLabel:a.label,effort:f,effortLabel:y,supportsEffort:i!==null,summary:b}}function Bs(e,t,s){const n={...t,...s};if(!(s.harness!==void 0&&s.harness!==t.harness)){if(s.model===void 0||s.model===t.model)return n;const T=Se(e,n.harness,n.model);if(!T||n.effort===G||T.some(V=>V.value===n.effort))return n;const de=(Se(e,t.harness,t.model)??e.efforts).findIndex(V=>V.value===t.effort),J=Math.min(Math.max(de,0),T.length-1);return n.effort=T[J]?.value??T[0]?.value??G,n}const i=Le(e,n.harness);n.model=s.model??i?.defaultModel??G,s.effort===void 0&&i?.defaultEffort&&(n.effort=i.defaultEffort);const f=Se(e,n.harness,n.model);if(!f)return n.effort=G,n;if(f.some(T=>T.value===n.effort))return n;const b=(Se(e,t.harness,t.model)??e.efforts).findIndex(T=>T.value===t.effort),$=Math.min(Math.max(b,0),f.length-1);return n.effort=f[$]?.value??f[0]?.value??G,n}function qs(e,t){const s=t?.harness??e.harnesses.find(i=>!i.disabled)?.value??"",n=Se(e,s),a=n?.find(i=>i.note==="default")?.value??n?.[Math.floor((n.length-1)/2)]?.value??G;return{harness:s,model:t?.model??Le(e,s)?.defaultModel??Dt(e,s)[1]?.value??G,effort:n?t?.effort??Le(e,s)?.defaultEffort??a:G}}function Ks(e,t){const s=t.trim().toLowerCase();return s?e.filter(n=>`${n.label} ${n.value} ${n.note??""}`.toLowerCase().includes(s)):e}function Ge(...e){for(const t of e){const s=t?.trim();if(s)return s}}function In(e){const t=e.harnesses.map(n=>{const a=e.defaultsByHarness?.[n.id],i=n.ready!==!1,f=[{value:G,label:"Default",note:"harness picks"},...e.models.filter(b=>b.harnesses.includes(n.id)).map(b=>({value:b.id,label:b.label,note:Ge(b.description)}))],y=e.efforts.filter(b=>b.harnesses.includes(n.id));return{value:n.id,label:n.label,note:i?Ge(n.description):Ge(n.detail,n.state,"unavailable"),disabled:!i,defaultModel:a?.model??G,defaultEffort:a?.reasoningEffort??G,models:f,efforts:y.length===0?null:y.map(b=>({value:b.id,label:b.label,note:Ge(b.description),...b.models?.length?{models:[...b.models]}:{}}))}}),s=e.efforts.map(n=>({value:n.id,label:n.label,note:Ge(n.description)}));return{harnesses:t,efforts:s.length>0?s:Us}}const zs=6,Ct=34,Mt=460,Ws=14,Js=300,Be=8,St=["harness","model","effort"],Vs={harness:"vertical",model:"vertical",effort:"horizontal"};function Xs(){return o.jsx("svg",{className:"s-rt-chip-chevron",width:"8",height:"5",viewBox:"0 0 8 5",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M1 1.2 4 4 7 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ys({ctx:e}){const{efforts:t,value:s,set:n}=e;if(!t)return null;const a=Math.max(0,t.findIndex(i=>i.value===s.effort));return o.jsx("div",{className:"s-rt-ladder",role:"radiogroup","aria-label":"Reasoning effort",children:t.map((i,f)=>{const y=f===a;return o.jsxs("button",{type:"button",role:"radio","aria-checked":y,title:i.note,onClick:()=>n({effort:i.value}),...e.cell("effort",f),className:"s-rt-step",children:[o.jsx("span",{className:"s-rt-step-bar","data-state":y?"current":f<a?"filled":"empty"}),o.jsx("span",{className:"s-rt-step-label",children:i.label})]},i.value)})})}function Qs({harnessLabel:e}){return o.jsxs("p",{className:"s-rt-effort-absent",children:[e," has no effort control."]})}function Zs({option:e,selected:t,index:s,ctx:n}){const a=e.disabled??!1;return o.jsxs("button",{type:"button",role:"option","aria-selected":t,"aria-disabled":a||void 0,onClick:()=>{a||n.set({model:e.value})},"data-on":t||void 0,"data-disabled":a||void 0,...n.cell("model",s),style:{animationDelay:`${Math.min(s,6)*16}ms`},className:"s-rt-row s-rt-model-row",children:[o.jsx("span",{"aria-hidden":!0,className:"s-rt-dot"}),o.jsx("span",{className:"s-rt-row-label",children:e.label}),e.note?o.jsx("span",{className:"s-rt-note",children:e.note}):null]})}function er({ctx:e}){return o.jsxs("div",{className:"s-rt-search",children:[o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 12 12","aria-hidden":"true",className:"s-rt-search-icon",children:[o.jsx("circle",{cx:"5",cy:"5",r:"3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),o.jsx("path",{d:"M7.6 7.6 10.5 10.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),o.jsx("input",{ref:e.searchRef,type:"text",value:e.query,onChange:t=>e.setQuery(t.target.value),onKeyDown:e.onSearchKeyDown,placeholder:"Filter models","aria-label":"Filter models",spellCheck:!1,autoComplete:"off",className:"s-rt-search-input"}),e.query?o.jsx("button",{type:"button",onClick:()=>{e.setQuery(""),e.searchRef.current?.focus()},"aria-label":"Clear filter",className:"s-rt-search-clear",children:"clear"}):null]})}function tr({ctx:e}){return e.status==="loading"?o.jsxs("div",{className:"s-rt-status","aria-busy":!0,role:"status",children:[o.jsx("span",{className:"s-rt-sr",children:"Loading models"}),[0,1,2].map(t=>o.jsx("span",{"aria-hidden":!0,className:"s-rt-skel",style:{animationDelay:`${t*90}ms`}},t))]}):e.status==="error"?o.jsxs("div",{role:"alert",className:"s-rt-status s-rt-status--error",children:[o.jsx("span",{className:"s-rt-status-message",children:e.statusMessage??"Model catalog unavailable."}),e.onRetry?o.jsx("button",{type:"button",onClick:e.onRetry,className:"s-rt-retry",children:"Retry"}):null]}):o.jsx("p",{className:"s-rt-empty",children:e.query.trim()?`No model matches “${e.query.trim()}”.`:"No models listed."})}function nr({ctx:e}){return e.status!=="ready"||e.models.length===0?o.jsx(tr,{ctx:e}):o.jsx("div",{role:"listbox","aria-label":"Model",className:"s-rt-models",children:e.models.map((t,s)=>o.jsx(Zs,{option:t,index:s,selected:t.value===e.value.model,ctx:e},t.value||"default"))},e.value.harness)}function ln({value:e,defaultValue:t,onChange:s,catalog:n,status:a="ready",statusMessage:i,onRetry:f,disabled:y=!1,showEffort:b,searchable:$="auto",className:T}){const[v,de]=c.useState(!1),[J,V]=c.useState(""),[ze,We]=c.useState(()=>qs(n,t)),j=e??ze,C=c.useRef(null),ue=c.useRef(null),fe=c.useRef(null),me=c.useRef(null),S=c.useId(),je=c.useCallback(d=>{const h=Bs(n,j,d);e===void 0&&We(h),s?.(h),d.harness!==void 0&&d.harness!==j.harness&&V("")},[n,e,s,j]),L=n.harnesses,De=c.useMemo(()=>Dt(n,j.harness),[n,j.harness]),P=c.useMemo(()=>{const d=En(n,j);return d.note!=="custom"?De:[...De,d]},[De,n,j]),ne=c.useMemo(()=>Ks(P,J),[P,J]),Pe=Se(n,j.harness,j.model),X=b===!1?null:b===!0?Pe??n.efforts:Pe,D=$==="auto"?P.length>zs:$,Y=Gs(n,j),I=c.useRef(new Map),[he,k]=c.useState({group:"model",index:0}),R=c.useMemo(()=>({harness:L.length,model:a==="ready"?ne.length:0,effort:X?.length??0}),[X?.length,L.length,ne.length,a]),se=c.useCallback(d=>d==="harness"?Math.max(0,L.findIndex(h=>h.value===j.harness)):d==="model"?Math.max(0,ne.findIndex(h=>h.value===j.model)):Math.max(0,X?.findIndex(h=>h.value===j.effort)??0),[X,L,ne,j]),N=c.useCallback((d,h)=>{k({group:d,index:h}),I.current.get(`${d}:${h}`)?.focus()},[]),pe=c.useCallback((d,h)=>{const w=St.indexOf(d);for(let g=w+h;g>=0&&g<St.length;g+=h){const A=St[g];if(R[A]>0)return N(A,Math.min(se(A),R[A]-1)),!0}return!1},[R,N,se]),Je=c.useCallback((d,h)=>({ref:w=>{const g=`${d}:${h}`;w?I.current.set(g,w):I.current.delete(g)},tabIndex:he.group===d&&he.index===h?0:-1,onFocus:()=>k({group:d,index:h}),onKeyDown:w=>{const g=Vs[d]==="vertical",A=g?"ArrowDown":"ArrowRight",U=g?"ArrowUp":"ArrowLeft",_e=g?"ArrowRight":"ArrowDown",re=g?"ArrowLeft":"ArrowUp",we=R[d];if(we!==0)if(w.key===A)w.preventDefault(),N(d,(h+1)%we);else if(w.key===U){if(w.preventDefault(),d==="model"&&h===0&&D){k({group:d,index:0}),me.current?.focus();return}N(d,(h-1+we)%we)}else w.key===_e?(w.preventDefault(),pe(d,1)):w.key===re?(w.preventDefault(),pe(d,-1)):w.key==="Home"?(w.preventDefault(),N(d,0)):w.key==="End"&&(w.preventDefault(),N(d,we-1))}}),[R,he,N,pe,D]),ke=c.useCallback(d=>{if(d.key==="ArrowDown"&&R.model>0)d.preventDefault(),N("model",0);else if(d.key==="Enter"&&R.model===1){d.preventDefault();const h=ne[0];h.disabled||je({model:h.value})}else d.key==="Escape"&&J&&(d.preventDefault(),d.stopPropagation(),V(""))},[R.model,N,ne,J,je]),[F,Oe]=c.useState(null),ge=c.useCallback(()=>{const d=ue.current;if(!d)return;const h=d.getBoundingClientRect(),w=h.top,g=window.innerHeight-h.bottom,A=w>=Js||w>=g?"up":"down",U=Math.min(Math.max(Be,h.right-Mt),Math.max(Be,window.innerWidth-Mt-Be));Oe({left:U,top:A==="up"?h.top-Be:h.bottom+Be,placement:A})},[]);c.useLayoutEffect(()=>{if(!v)return;ge();const d=()=>ge();return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[v,ge]);const E=c.useCallback(d=>{de(!1),d&&ue.current?.focus()},[]);c.useEffect(()=>{if(!v)return;const d=w=>{const g=w.target;C.current?.contains(g)||fe.current?.contains(g)||de(!1)},h=w=>{w.key==="Escape"&&(w.stopPropagation(),E(!0))};return document.addEventListener("pointerdown",d),document.addEventListener("keydown",h),()=>{document.removeEventListener("pointerdown",d),document.removeEventListener("keydown",h)}},[v,E]),c.useEffect(()=>{if(!v)return;const d=R.model>0?"model":"harness",h=Math.min(se(d),Math.max(0,R[d]-1));k({group:d,index:h});const w=requestAnimationFrame(()=>{const g=I.current.get(`${d}:${h}`);g?g.focus():fe.current?.focus()});return()=>cancelAnimationFrame(w)},[v]),c.useEffect(()=>{v||V("")},[v]),c.useEffect(()=>{y&&de(!1)},[y]);const be=Math.max(0,L.findIndex(d=>d.value===j.harness)),H={value:j,set:je,status:a,statusMessage:i,onRetry:f,harnesses:L,models:ne,efforts:X,harnessLabel:Y.harnessLabel,searchable:D,query:J,setQuery:V,searchRef:me,cell:Je,onSearchKeyDown:ke};return o.jsxs("div",{ref:C,className:T?`s-rt-root ${T}`:"s-rt-root",style:{position:"relative",display:"inline-flex"},children:[o.jsxs("button",{ref:ue,type:"button",className:`s-rt-chip${y?" s-rt-chip--disabled":""}`,"aria-haspopup":"dialog","aria-expanded":v,"aria-controls":v?S:void 0,"aria-label":Y.summary,disabled:y,onClick:()=>de(d=>!d),children:[o.jsx(on,{harness:j.harness||"unknown",size:12,className:"s-rt-chip-mark",title:null}),o.jsxs("span",{className:"s-rt-chip-type",children:[o.jsx("span",{className:"s-rt-chip-model",style:{maxWidth:`${Ws}ch`},children:o.jsx("span",{className:"s-rt-chip-model-text",children:Y.modelLabel},Y.modelLabel)}),X&&Y.effortLabel?o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":!0,className:"s-rt-chip-divider"}),o.jsx("span",{className:"s-rt-chip-effort","data-effort":j.effort,children:Y.effortLabel})]}):null]}),o.jsx(Xs,{})]}),v&&F?gs.createPortal(o.jsx("div",{ref:fe,id:S,role:"dialog","aria-label":"Runtime",tabIndex:-1,"data-placement":F.placement,className:"s-rt-panel",style:{left:F.left,width:Mt,...F.placement==="up"?{bottom:window.innerHeight-F.top}:{top:F.top}},children:o.jsxs("div",{className:"s-rt-rail",children:[o.jsxs("div",{className:"s-rt-rail-main",children:[o.jsxs("div",{className:"s-rt-harnesses",role:"radiogroup","aria-label":"Harness",children:[o.jsx("span",{"aria-hidden":!0,className:"s-rt-marker",style:{height:Ct-10,transform:`translateY(${be*Ct+5}px)`}}),L.map((d,h)=>{const w=d.value===j.harness,g=d.disabled??!1;return o.jsxs("button",{type:"button",role:"radio","aria-checked":w,"aria-disabled":g||void 0,onClick:()=>{g||H.set({harness:d.value})},style:{height:Ct},"data-on":w||void 0,"data-disabled":g||void 0,title:g?d.note:void 0,...H.cell("harness",h),className:"s-rt-harness",children:[o.jsx(on,{harness:d.value||"unknown",size:14,className:"s-rt-opt-mark",title:null}),o.jsx("span",{className:"s-rt-harness-label",children:d.label})]},d.value||"default")})]}),o.jsxs("div",{className:"s-rt-models-col",children:[D?o.jsx(er,{ctx:H}):null,o.jsx(nr,{ctx:H})]})]}),o.jsx("div",{className:"s-rt-effort-foot",children:X?o.jsx(Ys,{ctx:H}):o.jsx(Qs,{harnessLabel:Y.harnessLabel})})]})}),document.body):null]})}const Nt="scout:newchat:frame:v1",sr=620,cn=420,dn=300,it=12,rr=210,or=154;function Nn(e){return e>sr}function un(e,t,s){if(!Nn(s.width))return null;const n=e??t;return n?lt(n,s):null}function ar(e){return e?Math.max(or,Math.round(e.height-rr)):null}function fn(e,t,s){const n=s-t-it;return Math.round(Math.max(it,Math.min(e,n)))}function lt(e,t){const s=Math.round(Math.max(cn,Math.min(e.width,Math.max(cn,t.width-it*2)))),n=Math.round(Math.max(dn,Math.min(e.height,Math.max(dn,t.height-it*2))));return{x:fn(e.x,s,t.width),y:fn(e.y,n,t.height),width:s,height:n}}function ir(e,t,s,n){return lt({...e,x:e.x+t,y:e.y+s},n)}function lr(e,t,s,n,a){const i=n==="s"?e.width:e.width+t,f=n==="e"?e.height:e.height+s;return lt({...e,width:i,height:f},a)}function cr(e){if(!e||typeof e!="object")return!1;const t=e;return["x","y","width","height"].every(s=>typeof t[s]=="number"&&Number.isFinite(t[s]))}function dr(e){if(!e)return null;try{const t=JSON.parse(e);return cr(t)?{x:t.x,y:t.y,width:t.width,height:t.height}:null}catch{return null}}function mn(){try{return typeof localStorage>"u"?null:dr(localStorage.getItem(Nt))}catch{return null}}function hn(e){try{if(typeof localStorage>"u")return;if(!e){localStorage.removeItem(Nt);return}localStorage.setItem(Nt,JSON.stringify(e))}catch{}}const kt=ks()??"",pn=Mn(kt),Ee={schemaVersion:"openscout.runtime-capabilities.v1",catalogVersion:W.schemaVersion,defaults:{harness:kt,model:pn,reasoningEffort:Sn(kt,pn)},defaultsByHarness:Ts,harnesses:W.harnesses.filter(e=>e.enabled&&e.listed!==!1).map(e=>({id:e.id,label:e.label})),models:Ds.map(e=>({id:e.id,label:e.label,...e.description?{description:e.description}:{},harnesses:[...e.harnesses]})),efforts:_s.map(e=>({id:e.id,label:e.label,...e.description?{description:e.description}:{},harnesses:[...e.harnesses],...e.models?{models:[...e.models]}:{}}))};function wo(e){return In({defaultsByHarness:e.defaultsByHarness,harnesses:e.harnesses.map(t=>({id:t.id,label:t.label??t.id})),models:e.models.map(t=>({id:t.id,label:t.label??t.id,description:t.description,harnesses:t.harnesses})),efforts:e.efforts.map(t=>({id:t.id,label:t.label,description:t.description,harnesses:t.harnesses,...t.models?.length?{models:[...t.models]}:{}}))})}const ur="|";function gn(e){return e<55296?e:e<57344?e+8192:e-2048}function fr(e,t){if(e===t)return 0;const s=Math.min(e.length,t.length);for(let n=0;n<s;n+=1){const a=e.charCodeAt(n),i=t.charCodeAt(n);if(a!==i)return gn(a)<gn(i)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function bn(e){return Number.isFinite(e)?e:0}function mr(e,t){const s=bn(e.createdAt),n=bn(t.createdAt);return s!==n?s<n?-1:1:fr(e.id,t.id)}function hr(e){return`${Number.isFinite(e.createdAt)?Math.max(0,Math.trunc(e.createdAt)):0}${ur}${e.id}`}const pr=10,gr=80,wn=300,xn=100,kn=2e3,br=pr,ve=new Map,ce=new Map;let Rn=0;function Ne(e){return e.trim()}function wr(e){const t=new Map;for(const s of e)t.set(s.id,s);return[...t.values()].sort(mr)}function xr(){if(ve.size<=br)return;let e=null,t=Number.POSITIVE_INFINITY;for(const[s,n]of ve)n.touchedAt<t&&(e=s,t=n.touchedAt);e&&ve.delete(e)}function Ie(e){const t=Ne(e),s=ve.get(t);return s?(s.touchedAt=++Rn,s.messages):null}function Pt(e,t,s={}){const n=Ne(e);if(!n)return[];const a=ve.get(n),i=wr(t).slice(-kn);return ve.set(n,{messages:i,historyLoaded:s.historyLoaded??a?.historyLoaded??!1,historyExhausted:s.historyExhausted??a?.historyExhausted??!1,touchedAt:++Rn}),xr(),i}function An(e,t){const s=Ie(e)??[];return Pt(e,[...s,...t])}function Tn(e){return ve.get(Ne(e))?.historyLoaded??!1}function yr(e){const t=ve.get(Ne(e));return!!(t&&t.historyLoaded&&!t.historyExhausted&&t.messages.length>0&&t.messages.length<kn)}async function xo(e,t={}){const s=Ne(e);if(!s)return[];const n=Ie(s);if(n&&!t.refresh)return n;const a=ce.get(s);if(a)return a;const i=z(`/api/messages?conversationId=${encodeURIComponent(s)}&limit=${gr}`).then(f=>An(s,f));ce.set(s,i);try{return await i}finally{ce.delete(s)}}async function vr(e){const t=Ne(e);if(!t)return[];if(Tn(t))return Ie(t)??[];const s=`${t}:history`,n=ce.get(s);if(n)return n;const a=z(`/api/messages?conversationId=${encodeURIComponent(t)}&limit=${wn}`).then(i=>Pt(t,[...Ie(t)??[],...i],{historyLoaded:!0,historyExhausted:i.length<wn}));ce.set(s,a);try{return await a}finally{ce.delete(s)}}async function yo(e){const t=Ne(e);if(!t)return[];if(!Tn(t))return vr(t);if(!yr(t))return Ie(t)??[];const s=Ie(t)??[],n=s[0];if(!n)return s;const a=hr(n),i=`${t}:before:${a}`,f=ce.get(i);if(f)return f;const y=z(`/api/messages?conversationId=${encodeURIComponent(t)}&limit=${xn}&beforeMessageId=${encodeURIComponent(a)}`).then(b=>Pt(t,[...b,...Ie(t)??[]],{historyLoaded:!0,historyExhausted:b.length<xn}));ce.set(i,y);try{return await y}finally{ce.delete(i)}}const jr=12e4,Ke=new Map;function Cr(){const e=globalThis.crypto?.randomUUID?.();return e?`web-${e}`:`web-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Mr(e){const t=e.conversationId.trim(),s=e.messageId.trim();if(!t||!s)return;An(t,[{id:s,conversationId:t,actorId:"operator",actorName:"operator",body:e.body,createdAt:e.createdAt,class:"operator",...e.attachments?.length?{attachments:e.attachments}:{},metadata:{clientMessageId:e.clientMessageId}}]);const n=e.flightId?.trim(),a=e.agentId?.trim();!n||!a||Ke.set(t,{flight:{id:n,invocationId:e.invocationId?.trim()||`pending:${n}`,agentId:a,agentName:null,conversationId:t,collaborationRecordId:null,state:"queued",summary:"Request accepted; waiting for worker activity.",startedAt:e.createdAt,completedAt:null,sessions:[]},expiresAt:Date.now()+jr})}function vo(e,t=Date.now()){const s=e.trim(),n=Ke.get(s);return n?n.expiresAt<=t?(Ke.delete(s),null):n.flight:null}function jo(e,t){const s=e.trim(),n=Ke.get(s);n&&(!t||n.flight.id===t)&&Ke.delete(s)}const Sr=1200,Er=new Set(["Page","URL"]);function Ln(e){return e.trim().slice(0,Sr)}function Ir(e){const t=[{label:"Page",value:e.pageTitle??""},{label:"URL",value:e.pageUrl??""}];return e.selection?.trim()&&t.push({label:"Selection",value:Ln(e.selection)}),(e.notes??[]).forEach((s,n)=>{t.push({label:`Note ${n+1}`,value:s})}),t.filter(s=>s.value.trim())}function Nr(e,t){const s=[];for(const a of t){const i=a.value.trim();i&&(Er.has(a.label)?s.push(`${a.label}: ${i}`):s.push(`${a.label}:
2
2
  ${i.split(`
3
3
  `).map(f=>`> ${f}`).join(`
4
4
  `)}`))}const n=e.trim();return n&&s.push(n),s.join(`
@@ -1 +1 @@
1
- import{j as e}from"./index-BZovGpDk.js";function c({context:l,selection:a,attached:n,onToggleSelection:i}){return l.length===0?null:e.jsxs("div",{className:"s-newchat-origin",children:[e.jsx("span",{className:"label-md s-newchat-origin-label",children:"From"}),e.jsx("dl",{className:"s-newchat-origin-facts",children:l.map(s=>e.jsxs("div",{className:"s-newchat-origin-fact",children:[e.jsx("dt",{children:s.label}),e.jsx("dd",{title:s.value,children:s.value})]},s.label))}),a?e.jsx("button",{type:"button",className:"s-newchat-origin-attach","aria-pressed":n,onClick:i,children:n?"Remove selection":`Attach selection (${a.length} chars)`}):null]})}export{c as NewChatOrigin};
1
+ import{j as e}from"./index-DmFAhGPj.js";function c({context:l,selection:a,attached:n,onToggleSelection:i}){return l.length===0?null:e.jsxs("div",{className:"s-newchat-origin",children:[e.jsx("span",{className:"label-md s-newchat-origin-label",children:"From"}),e.jsx("dl",{className:"s-newchat-origin-facts",children:l.map(s=>e.jsxs("div",{className:"s-newchat-origin-fact",children:[e.jsx("dt",{children:s.label}),e.jsx("dd",{title:s.value,children:s.value})]},s.label))}),a?e.jsx("button",{type:"button",className:"s-newchat-origin-attach","aria-pressed":n,onClick:i,children:n?"Remove selection":`Attach selection (${a.length} chars)`}):null]})}export{c as NewChatOrigin};
@@ -1,2 +1,2 @@
1
- import{r as o,j as e}from"./index-BZovGpDk.js";import{a as v}from"./api-h5zurxmi.js";import{d as b,S as u}from"./SessionObserve-B-SkP3tu.js";import{u as h}from"./sse-Bb0EOcU9.js";import{f as x}from"./time-Dhsh_2EG.js";import{SessionObserveEmbedStatus as f}from"./SessionObserveEvidence-CF5jnH3-.js";import{E as c}from"./external-link-Dd8xaveL.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-BkBcDYm-.js";import"./index-DiiEQwdc.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./colors-BtO5_zlx.js";import"./mentions-BjXfeF7t.js";import"./Provider-p-xuaAoE.js";import"./router-63XV_E7f.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.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"./HarnessMark-DrE57dUq.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";import"./AgentDetailCard-Dtc02KUO.js";import"./AgentLiveActions-DwScaVRF.js";import"./terminal-takeover--05EYhJm.js";import"./openContent-C6XO6kr5.js";import"./eye-DkU59kfl.js";import"./terminal-xGf_F3y7.js";import"./message-markup-DlVX-iuc.js";import"./ObservedTopologyPanel-BlmGoxCE.js";import"./ObserveTextFlow-DWNlmTVm.js";import"./use-reduced-motion-C8cWvIZ3.js";import"./message-circle-BwVx5X0q.js";import"./wrench-_tHBGTop.js";import"./index-BWHgHrtv.js";const j=2500,g=240,N=5;function I({ask:r,sessionId:s}){const[i,p]=o.useState(!1);if(!r)return e.jsxs("section",{className:"s-observe-embed-ask s-observe-embed-ask--unknown",children:[e.jsx("div",{className:"s-observe-embed-ask-kicker",children:"Ask"}),e.jsx("div",{className:"s-observe-embed-ask-unknown",children:"Not available for this observed session."})]});const m=r.task.length>g||r.task.split(`
1
+ import{r as o,j as e}from"./index-DmFAhGPj.js";import{a as v}from"./api-h5zurxmi.js";import{d as b,S as u}from"./SessionObserve-yYA8Gy5s.js";import{u as h}from"./sse-CxXt4tqI.js";import{f as x}from"./time-Dhsh_2EG.js";import{SessionObserveEmbedStatus as f}from"./SessionObserveEvidence-cHdjYOJe.js";import{E as c}from"./external-link-B1TI5yIt.js";import"./bash-format-BRV5C6Gv.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./lane-tool-detail-0WhMf4Vj.js";import"./LaneToolHoverCard-B7KdvQvf.js";import"./index-CmwGCxUk.js";import"./lane-observe-BA3g9aVd.js";import"./lane-ask-display-B6iCAVcd.js";import"./colors-BtO5_zlx.js";import"./mentions-agCGDgyA.js";import"./Provider-cJCdHAxu.js";import"./router-Cn_s9IGH.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-AmSgHklm.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-BTIErYHo.js";import"./ContextMenu-CHIuVKz7.js";import"./DocumentFocusViewer-B9vodVmG.js";import"./createLucideIcon-CFBn0Sdk.js";import"./TextDocumentSurface-BWJCGBZf.js";/* empty css */import"./file-text-DcYSrI4v.js";import"./x-C8ayPBtj.js";import"./chevron-right-BYMV1511.js";import"./code-xml-BFc3TMSm.js";import"./arrow-left-B-3GJ7ct.js";import"./scout-voice-CwbOz6EN.js";import"./fx-z37u1o2z.js";import"./keyboard-nav-h1IdakpD.js";import"./MessageComposerSuggestions-FdVHnT_q.js";import"./NewChatComposer-Hd7pI5Ac.js";import"./runtime-picker--IW3cRry.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-d6PKL_KD.js";import"./HarnessMark-BPAphNjx.js";import"./conversation-model-CHwHZNw-.js";import"./NewChatOrigin-DmuJ32wa.js";import"./model-Co0zkMIc.js";import"./text-DsBWV_4k.js";import"./chevron-down-B3VVRJcV.js";import"./search-DAyagUtF.js";import"./chunk-HRAB3GC3-dRd2eQMJ.js";import"./AgentDetailCard-BTiOmh-a.js";import"./AgentLiveActions-BJ5dIfL3.js";import"./terminal-takeover-BOFPRPjR.js";import"./openContent-C6XO6kr5.js";import"./eye-1J4yOUoG.js";import"./terminal-DJPUp_Qn.js";import"./message-markup-CyRDLdOn.js";import"./ObservedTopologyPanel-CaSZZP05.js";import"./ObserveTextFlow-CkMrtT8s.js";import"./use-reduced-motion-CYqhYqHO.js";import"./message-circle-CJO-pi7b.js";import"./wrench-CvRjjByE.js";import"./index-BWHgHrtv.js";const j=2500,g=240,N=5;function I({ask:r,sessionId:s}){const[i,p]=o.useState(!1);if(!r)return e.jsxs("section",{className:"s-observe-embed-ask s-observe-embed-ask--unknown",children:[e.jsx("div",{className:"s-observe-embed-ask-kicker",children:"Ask"}),e.jsx("div",{className:"s-observe-embed-ask-unknown",children:"Not available for this observed session."})]});const m=r.task.length>g||r.task.split(`
2
2
  `).length>N,n=r.conversationId?`/messages/${encodeURIComponent(r.conversationId)}${r.messageId?`#msg-${encodeURIComponent(r.messageId)}`:""}`:null,d=`/flights/${encodeURIComponent(r.flightId)}/observe${s?`?session=${encodeURIComponent(s)}`:""}`;return e.jsxs("section",{className:"s-observe-embed-ask",children:[e.jsxs("div",{className:"s-observe-embed-ask-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"s-observe-embed-ask-kicker",children:"Ask"}),e.jsxs("div",{className:"s-observe-embed-ask-byline",children:[e.jsx("span",{children:r.requesterName}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("time",{dateTime:new Date(r.requestedAt).toISOString(),children:x(r.requestedAt)})]})]}),e.jsxs("nav",{className:"s-observe-embed-ask-links","aria-label":"Run provenance",children:[n&&e.jsxs("a",{href:n,target:"_top",children:["Origin ",e.jsx(c,{size:11,"aria-hidden":"true"})]}),e.jsxs("a",{href:d,target:"_top",children:["Flight ",e.jsx(c,{size:11,"aria-hidden":"true"})]})]})]}),e.jsx("div",{className:`s-observe-embed-ask-body${i?" is-expanded":""}`,children:r.task}),m&&e.jsx("button",{type:"button",className:"s-observe-embed-ask-toggle","aria-expanded":i,onClick:()=>p(t=>!t),children:i?"Show less":"Show full ask"})]})}function _e({agentId:r}){const[s,i]=o.useState(null),[p,m]=o.useState(!0),[n,d]=o.useState(null),t=o.useCallback(async(l=!1)=>{l||m(!0),d(null);try{const a=await v(`/api/agents/${encodeURIComponent(r)}/observe`);i(a)}catch(a){l||i(null),d(a instanceof Error?a.message:String(a))}finally{m(!1)}},[r]);return o.useEffect(()=>{t();const l=window.setInterval(()=>{t(!0)},j);return()=>window.clearInterval(l)},[t]),h(()=>{t(!0)}),n&&!s?e.jsx("div",{className:"s-observe-embed-page",children:e.jsxs("div",{className:"s-observe-embed-empty",children:[e.jsx("div",{className:"s-observe-embed-empty-title",children:"Observe unavailable"}),e.jsx("div",{className:"s-observe-embed-empty-detail",children:n})]})}):p&&!s?e.jsx("div",{className:"s-observe-embed-page",children:e.jsxs("div",{className:"s-observe-embed-empty",children:[e.jsx("div",{className:"s-observe-embed-empty-title",children:"Resolving trace"}),e.jsx("div",{className:"s-observe-embed-empty-detail",children:r})]})}):e.jsxs("div",{className:"s-observe-embed-page",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(f,{source:s.source,fidelity:s.fidelity,sessionId:s.sessionId,evidence:b({source:s.source,fidelity:s.fidelity,live:s.data.live,eventCount:s.data.events.length})}),e.jsx(I,{ask:s.initiatingAsk,sessionId:s.sessionId})]}),e.jsx(u,{data:s?.data,agentId:r,sessionId:s?.sessionId,showRail:!1,observeSource:s?.source,observeFidelity:s?.fidelity})]})}export{I as InitiatingAsk,_e as ObserveEmbedScreen};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/conversation-motion-features-DPiGTO21.js","assets/gestures-B5rLNRpi.js","assets/index-BZovGpDk.js","assets/index-9as_JTUs.css","assets/use-reduced-motion-C8cWvIZ3.js"])))=>i.map(i=>d[i]);
2
- import{r as n,j as e,_ as b}from"./index-BZovGpDk.js";import{l as p}from"./lane-observe-BA3g9aVd.js";import{C as f}from"./chevron-down-BVg09D6U.js";import{u as h,L as g,m as x}from"./use-reduced-motion-C8cWvIZ3.js";import"./time-Dhsh_2EG.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./createLucideIcon-DCq_3fQn.js";const j=420,N=()=>b(()=>import("./conversation-motion-features-DPiGTO21.js"),__vite__mapDeps([0,1,2,3,4])).then(t=>t.default);function R({text:t}){const s=h(),[o,i]=n.useState(!0),r=n.useRef(null);return n.useEffect(()=>(i(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>i(!1),j),()=>{r.current&&clearTimeout(r.current)}),[t]),e.jsx(g,{features:N,strict:!0,children:e.jsx(x.span,{className:"s-observe-stream-cursor","data-receiving":o||void 0,"aria-hidden":"true",initial:!1,animate:s||o?{opacity:1}:{opacity:[1,.28,1]},transition:s||o?{duration:.12}:{duration:1.05,ease:"linear",repeat:1/0}})})}function k({text:t,live:s,compact:o=!1,copyControl:i}){const r=n.useId(),c=t.trim(),[a,d]=n.useState(s),u=n.useRef(s);n.useEffect(()=>{s?d(!0):u.current&&d(!1),u.current=s},[s]);const l=p(c,o?120:168,1),m=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"s-observe-reasoning-state",children:[e.jsx("span",{className:"s-observe-reasoning-dot","aria-hidden":"true"}),s?"Thinking":"Reasoning"]}),!s&&!a&&l?e.jsx("span",{className:"s-observe-reasoning-preview",title:c,children:l}):null,s?null:e.jsx(f,{className:"s-observe-reasoning-chevron",size:12,strokeWidth:1.8,"aria-hidden":"true"})]});return e.jsxs("div",{className:["s-observe-block","s-observe-reasoning",o&&"s-observe-reasoning--compact",s&&"s-observe-reasoning--live",a&&"s-observe-reasoning--open"].filter(Boolean).join(" "),"aria-busy":s||void 0,children:[s?e.jsx("div",{className:"s-observe-reasoning-header",role:"status",children:m}):e.jsx("button",{type:"button",className:"s-observe-reasoning-header s-observe-reasoning-header--button","aria-expanded":a,"aria-controls":r,"aria-label":a?"Hide reasoning":"Show reasoning",onClick:()=>d(v=>!v),children:m}),e.jsx("div",{id:r,className:"s-observe-reasoning-body","aria-hidden":!a,inert:a?void 0:!0,children:e.jsx("div",{className:"s-observe-reasoning-body-clip",children:e.jsxs("div",{className:"s-observe-reasoning-body-inner",children:[e.jsxs("div",{className:"s-observe-reasoning-text",children:[c,s?e.jsx(R,{text:c}):null]}),i?e.jsx("div",{className:"s-observe-reasoning-tools",children:i}):null]})})})]})}export{k as ObserveReasoningDisclosure,R as ObserveStreamCursor};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/conversation-motion-features-DXtKlmuM.js","assets/gestures-CcEOV6Sr.js","assets/index-DmFAhGPj.js","assets/index-BBznYVWk.css","assets/use-reduced-motion-CYqhYqHO.js"])))=>i.map(i=>d[i]);
2
+ import{r as n,j as e,_ as b}from"./index-DmFAhGPj.js";import{l as p}from"./lane-observe-BA3g9aVd.js";import{C as f}from"./chevron-down-B3VVRJcV.js";import{u as h,L as g,m as x}from"./use-reduced-motion-CYqhYqHO.js";import"./time-Dhsh_2EG.js";import"./tail-display-BRcJltQa.js";import"./lane-edit-display-C_Aujldz.js";import"./createLucideIcon-CFBn0Sdk.js";const j=420,N=()=>b(()=>import("./conversation-motion-features-DXtKlmuM.js"),__vite__mapDeps([0,1,2,3,4])).then(t=>t.default);function R({text:t}){const s=h(),[o,i]=n.useState(!0),r=n.useRef(null);return n.useEffect(()=>(i(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>i(!1),j),()=>{r.current&&clearTimeout(r.current)}),[t]),e.jsx(g,{features:N,strict:!0,children:e.jsx(x.span,{className:"s-observe-stream-cursor","data-receiving":o||void 0,"aria-hidden":"true",initial:!1,animate:s||o?{opacity:1}:{opacity:[1,.28,1]},transition:s||o?{duration:.12}:{duration:1.05,ease:"linear",repeat:1/0}})})}function k({text:t,live:s,compact:o=!1,copyControl:i}){const r=n.useId(),c=t.trim(),[a,d]=n.useState(s),u=n.useRef(s);n.useEffect(()=>{s?d(!0):u.current&&d(!1),u.current=s},[s]);const l=p(c,o?120:168,1),m=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"s-observe-reasoning-state",children:[e.jsx("span",{className:"s-observe-reasoning-dot","aria-hidden":"true"}),s?"Thinking":"Reasoning"]}),!s&&!a&&l?e.jsx("span",{className:"s-observe-reasoning-preview",title:c,children:l}):null,s?null:e.jsx(f,{className:"s-observe-reasoning-chevron",size:12,strokeWidth:1.8,"aria-hidden":"true"})]});return e.jsxs("div",{className:["s-observe-block","s-observe-reasoning",o&&"s-observe-reasoning--compact",s&&"s-observe-reasoning--live",a&&"s-observe-reasoning--open"].filter(Boolean).join(" "),"aria-busy":s||void 0,children:[s?e.jsx("div",{className:"s-observe-reasoning-header",role:"status",children:m}):e.jsx("button",{type:"button",className:"s-observe-reasoning-header s-observe-reasoning-header--button","aria-expanded":a,"aria-controls":r,"aria-label":a?"Hide reasoning":"Show reasoning",onClick:()=>d(v=>!v),children:m}),e.jsx("div",{id:r,className:"s-observe-reasoning-body","aria-hidden":!a,inert:a?void 0:!0,children:e.jsx("div",{className:"s-observe-reasoning-body-clip",children:e.jsxs("div",{className:"s-observe-reasoning-body-inner",children:[e.jsxs("div",{className:"s-observe-reasoning-text",children:[c,s?e.jsx(R,{text:c}):null]}),i?e.jsx("div",{className:"s-observe-reasoning-tools",children:i}):null]})})})]})}export{k as ObserveReasoningDisclosure,R as ObserveStreamCursor};
@@ -1,2 +1,2 @@
1
- import{r as x,j as t}from"./index-BZovGpDk.js";import{a as I}from"./api-h5zurxmi.js";import{a as w}from"./time-Dhsh_2EG.js";function A(e){if(!e)return null;const o=Date.parse(e);return Number.isFinite(o)?o:null}function S(e){return e?e.length<=12?e:e.slice(0,12):null}function R(e){return e.includes("workflow")?"Claude workflows":e.includes("codex")?"Codex":e.includes("claude")?"Claude Code":e.replace(/[-_]/g," ")}function T(e){const o=[];return e.workerCount>0&&o.push(`${e.workerCount} worker${e.workerCount===1?"":"s"}`),e.eventCount>0?o.push(`${e.eventCount} event${e.eventCount===1?"":"s"}`):e.taskCount>0&&o.push(`${e.completedTaskCount}/${e.taskCount} tasks`),o.join(" · ")}function $(e){const o=[e.label];e.description&&o.push(e.description);const n=T(e);return n&&o.push(n),e.parentSessionId&&o.push(`Parent session ${e.parentSessionId}`),o.join(`
1
+ import{r as x,j as t}from"./index-DmFAhGPj.js";import{a as I}from"./api-h5zurxmi.js";import{a as w}from"./time-Dhsh_2EG.js";function A(e){if(!e)return null;const o=Date.parse(e);return Number.isFinite(o)?o:null}function S(e){return e?e.length<=12?e:e.slice(0,12):null}function R(e){return e.includes("workflow")?"Claude workflows":e.includes("codex")?"Codex":e.includes("claude")?"Claude Code":e.replace(/[-_]/g," ")}function T(e){const o=[];return e.workerCount>0&&o.push(`${e.workerCount} worker${e.workerCount===1?"":"s"}`),e.eventCount>0?o.push(`${e.eventCount} event${e.eventCount===1?"":"s"}`):e.taskCount>0&&o.push(`${e.completedTaskCount}/${e.taskCount} tasks`),o.join(" · ")}function $(e){const o=[e.label];e.description&&o.push(e.description);const n=T(e);return n&&o.push(n),e.parentSessionId&&o.push(`Parent session ${e.parentSessionId}`),o.join(`
2
2
  `)}function k(e){return e.name??S(e.externalSessionId)??e.id.replace(/^.*:/,"")}function W(e){return e.status??e.role??e.type??"observed"}function j(e,o){const n=e?.[o];return typeof n=="string"&&n.trim()?n.trim():null}function F(e,o){const n=e?.[o];return typeof n=="number"&&Number.isFinite(n)?n:null}function C(e){return j(e,"claudeWorkflowRunId")??j(e,"workflowRunId")}function P(e,o,n){return o.filter(a=>a.kind==="spawned"&&a.toId===e.id).map(a=>n.get(a.fromId)).filter(a=>!!a).map(k)}function B(e,o){return o.find(n=>n.assigneeId===e.id)??null}function D(e,o){return C(e.providerMeta)===o||e.id.includes(o)}function E(e,o){return C(e.providerMeta)===o||e.id.includes(o)}function q(e){const o=j(e.providerMeta,"latestTimestamp");if(!o)return null;const n=Date.parse(o);return Number.isFinite(n)?n:null}function G(e,o){return e.some(n=>n.state&&b(n.state)===0)||o.some(n=>n.status&&b(n.status)===0)?"running":e.some(n=>n.state==="failed"||n.state==="error")||o.some(n=>n.status==="failed"||n.status==="error")?"failed":e.length>0&&e.every(n=>n.state==="completed"||n.state==="done")||o.length>0&&o.every(n=>n.status==="completed"||n.status==="done")?"completed":e.length>0?"observed":"workflow"}function M(e,o){return e.groups.filter(a=>a.kind==="workflow").map(a=>{const c=C(a.providerMeta)??a.id,d=e.tasks.filter(r=>D(r,c)),m=e.agents.filter(r=>r.role!=="lead"&&E(r,c)),u=d.filter(r=>r.state!=="completed"&&r.state!=="done"),f=d.filter(r=>r.state==="completed"||r.state==="done"),p=m.map(q).filter(r=>!!r).sort((r,h)=>h-r)[0]??null,g=m.reduce((r,h)=>r+(F(h.providerMeta,"eventCount")??0),0),v=(u.length>0?u:d).slice(0,3);return{id:a.id,label:a.name??c,description:j(a.providerMeta,"description"),runId:c,parentSessionId:j(a.providerMeta,"parentSessionId"),status:G(d,m),workerCount:m.length,taskCount:d.length,activeTaskCount:u.length,completedTaskCount:f.length,eventCount:g,latestAt:p??o,taskPreview:v}}).sort((a,c)=>{const d=(c.activeTaskCount>0?1:0)-(a.activeTaskCount>0?1:0);return d!==0?d:(c.latestAt??0)-(a.latestAt??0)||a.label.localeCompare(c.label)})}function b(e){return e==="running"||e==="in_progress"||e==="working"?0:e==="queued"||e==="pending"||e==="materialized"?1:e==="failed"||e==="error"?2:e==="completed"||e==="done"?3:4}function H(e){return e?e.observations.map(o=>({source:o.source,observedAt:A(o.observedAt),topology:o.topology})):[]}function K({topology:e,sessionId:o,size:n="full",title:a="Internal topology",maxAgents:c=n==="rail"?5:8,maxTasks:d=n==="rail"?3:5,showEmpty:m=!1}){const[u,f]=x.useState(null),[p,g]=x.useState(!1);x.useEffect(()=>{if(e)return;let i=!1;const s=o?`?sessionId=${encodeURIComponent(o)}`:"";return I(`/api/topology/snapshot${s}`).then(l=>{i||(f(l),g(!1))}).catch(()=>{i||g(!0)}),()=>{i=!0}},[o,e]);const v=x.useMemo(()=>e?[{source:e.source,observedAt:A(e.observedAt),topology:e}]:H(u),[u,e]),r=x.useMemo(()=>v.reduce((i,s)=>(i.sources+=1,i.workflows+=s.topology.groups.filter(l=>l.kind==="workflow").length,i.agents+=s.topology.agents.length,i.subagents+=s.topology.agents.filter(l=>l.role==="subagent").length,i.tasks+=s.topology.tasks.length,i.activeTasks+=s.topology.tasks.filter(l=>l.state!=="completed").length,i.spawned+=s.topology.relationships.filter(l=>l.kind==="spawned").length,i),{sources:0,workflows:0,agents:0,subagents:0,tasks:0,activeTasks:0,spawned:0}),[v]),h=n==="rail",y=v.reduce((i,s)=>i+M(s.topology,s.observedAt).filter(l=>l.status==="running").length,0);return v.length===0?!m&&!p?null:t.jsxs("section",{className:`s-observed-topology s-observed-topology--${n}`,children:[!h&&t.jsx("header",{className:"s-observed-topology-head",children:t.jsxs("div",{children:[t.jsx("div",{className:"s-observed-topology-kicker",children:"Harness observed"}),t.jsx("h3",{children:a})]})}),t.jsx("div",{className:"s-observed-topology-empty",children:p?"Topology is unavailable right now.":"No interacted agents observed yet."})]}):t.jsxs("section",{className:`s-observed-topology s-observed-topology--${n}`,children:[h?r.workflows>0&&t.jsxs("div",{className:"s-observed-topology-rail-summary",children:[y>0?`${y} running`:"No active workflows",r.workflows>0&&` · ${r.workflows} total`]}):t.jsxs("header",{className:"s-observed-topology-head",children:[t.jsxs("div",{children:[t.jsx("div",{className:"s-observed-topology-kicker",children:"Harness observed"}),t.jsx("h3",{children:a})]}),t.jsxs("div",{className:"s-observed-topology-counts",children:[r.workflows>0&&t.jsxs("span",{children:[r.workflows," workflows"]}),t.jsxs("span",{children:[r.subagents," workers"]}),t.jsxs("span",{children:[r.tasks," tasks"]}),r.activeTasks>0?t.jsxs("span",{children:[r.activeTasks," active"]}):t.jsxs("span",{children:[r.spawned," spawn links"]})]})]}),t.jsx("div",{className:"s-observed-topology-sources",children:v.map(i=>t.jsx(O,{source:i,maxAgents:c,maxTasks:d,size:n},`${i.source}:${i.topology.observedAt}`))})]})}function L({workflow:e}){const o=T(e);return t.jsxs("div",{className:`s-observed-topology-rail-row s-observed-topology-rail-row--${e.status}`,title:$(e),children:[t.jsx("span",{className:`s-observed-topology-rail-dot s-observed-topology-rail-dot--${e.status}`,"aria-label":e.status}),t.jsx("span",{className:"s-observed-topology-rail-name",children:e.label}),o&&t.jsx("span",{className:"s-observed-topology-rail-stats",children:o})]})}function O({source:e,maxAgents:o,maxTasks:n,size:a="full"}){const c=a==="rail",{topology:d}=e,m=new Map(d.agents.map(s=>[s.id,s])),u=M(d,e.observedAt),f=u.slice(0,o),p=u.length-f.length,g=(s,l)=>b(s.status)-b(l.status)||k(s).localeCompare(k(l)),v=d.agents.filter(s=>s.role==="subagent").sort(g),r=d.agents.filter(s=>s.role==="lead").sort(g),h=d.agents.filter(s=>s.role!=="subagent"&&s.role!=="lead").sort(g),y=[...r,...v,...h].slice(0,o),i=d.tasks.filter(s=>s.state!=="completed").sort((s,l)=>b(s.state)-b(l.state)||(s.title??s.id).localeCompare(l.title??l.id)).slice(0,n);return t.jsxs("div",{className:"s-observed-topology-source",children:[!c&&t.jsxs("div",{className:"s-observed-topology-source-head",children:[t.jsx("span",{children:R(e.source)}),t.jsx("span",{children:w(e.observedAt)||"observed"})]}),u.length>0?c?t.jsxs("div",{className:"s-observed-topology-rail-list",children:[f.map(s=>t.jsx(L,{workflow:s},s.id)),p>0&&t.jsxs("div",{className:"s-observed-topology-rail-more",children:["+",p," more workflow",p===1?"":"s"]})]}):t.jsxs("div",{className:"s-observed-topology-workflow-list",children:[f.map(s=>t.jsxs("div",{className:"s-observed-topology-workflow",children:[t.jsxs("div",{className:"s-observed-topology-workflow-main",children:[t.jsx("span",{className:`s-observed-topology-workflow-state s-observed-topology-workflow-state--${s.status}`,children:s.status}),t.jsx("span",{className:"s-observed-topology-workflow-name",title:$(s),children:s.label}),t.jsx("span",{className:"s-observed-topology-workflow-age",children:w(s.latestAt)||"observed"})]}),t.jsxs("div",{className:"s-observed-topology-workflow-meta",children:[t.jsxs("span",{children:[s.workerCount," workers"]}),s.taskCount>0&&t.jsxs("span",{children:[s.completedTaskCount,"/",s.taskCount," tasks"]}),s.eventCount>0&&t.jsxs("span",{children:[s.eventCount," events"]}),s.parentSessionId&&t.jsxs("span",{children:["parent ",S(s.parentSessionId)]})]}),s.description&&t.jsx("div",{className:"s-observed-topology-workflow-description",children:s.description}),s.taskPreview.length>0&&t.jsx("div",{className:"s-observed-topology-workflow-tasks",children:s.taskPreview.map(l=>t.jsx("span",{children:l.title??l.id.replace(/^.*:/,"")},l.id))})]},s.id)),p>0&&t.jsxs("div",{className:"s-observed-topology-more",children:[p," more workflow",p===1?"":"s"]})]}):t.jsx("div",{className:"s-observed-topology-agent-list",children:y.map(s=>{const l=P(s,d.relationships,m),N=B(s,d.tasks);return t.jsxs("div",{className:"s-observed-topology-agent",children:[t.jsxs("div",{className:"s-observed-topology-agent-main",children:[t.jsx("span",{className:`s-observed-topology-agent-role s-observed-topology-agent-role--${s.role??"observed"}`,children:s.role??"observed"}),t.jsx("span",{className:"s-observed-topology-agent-name",children:k(s)}),t.jsx("span",{className:"s-observed-topology-agent-status",children:W(s)})]}),(l.length>0||N?.title)&&t.jsxs("div",{className:"s-observed-topology-agent-detail",children:[l.length>0&&t.jsxs("span",{children:["spawned by ",l.join(", ")]}),N?.title&&t.jsx("span",{children:N.title})]})]},s.id)})}),u.length===0&&i.length>0&&t.jsx("div",{className:"s-observed-topology-task-list",children:i.map(s=>t.jsxs("div",{className:"s-observed-topology-task",children:[t.jsx("span",{children:s.state??"task"}),t.jsx("strong",{children:s.title??s.id.replace(/^.*:/,"")})]},s.id))})]})}export{K as O};